Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
co2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Albert Beltran
co2
Commits
afa5f55a
Commit
afa5f55a
authored
Jan 22, 2019
by
Clément Damiens
Browse files
Options
Browse Files
Download
Plain Diff
Merged branch development into development
parents
18d941c4
2b0fbad7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
14 deletions
+57
-14
assets/js/default/directory.js
assets/js/default/directory.js
+17
-13
assets/js/dynForm/proposal.js
assets/js/dynForm/proposal.js
+10
-1
controllers/DatamigrationController.php
controllers/DatamigrationController.php
+30
-0
No files found.
assets/js/default/directory.js
View file @
afa5f55a
...
...
@@ -2600,11 +2600,12 @@ var directory = {
str
+=
'
<small class="text-
'
+
statusColor
+
'
"><i class="fa fa-certificate"></i>
'
+
trad
[
params
.
status
]
+
'
</small>
'
;
// YOUR VOTE STATUS
if
((
params
.
status
==
"
tovote
"
||
params
.
status
==
"
amendementAndVote
"
)
&&
params
.
hasVote
===
false
)
str
+=
'
<small class="margin-left-15 letter-red"><i class="fa fa-ban"></i>
'
+
trad
[
"
You did not vote
"
]
+
'
</small>
'
;
else
if
((
params
.
status
==
"
tovote
"
||
params
.
status
==
"
amendementAndVote
"
)
&&
params
.
hasVote
!==
false
)
str
+=
'
<small class="margin-left-15"><i class="fa fa-thumbs-up"></i>
'
+
trad
[
"
You did vote
"
]
+
'
</small>
'
;
if
(
typeof
userId
!=
"
undefined
"
&&
userId
!=
null
&&
userId
!=
""
){
if
((
params
.
status
==
"
tovote
"
||
params
.
status
==
"
amendementAndVote
"
)
&&
params
.
hasVote
===
false
)
str
+=
'
<small class="margin-left-15 letter-red"><i class="fa fa-ban"></i>
'
+
trad
[
"
You did not vote
"
]
+
'
</small>
'
;
else
if
((
params
.
status
==
"
tovote
"
||
params
.
status
==
"
amendementAndVote
"
)
&&
params
.
hasVote
!==
false
)
str
+=
'
<small class="margin-left-15"><i class="fa fa-thumbs-up"></i>
'
+
trad
[
"
You did vote
"
]
+
'
</small>
'
;
}
// if(params.chat)
// str += '<a href="javascript:" '+linkParams+' data-coop-section="comments" class="openCoopPanelHtml btn btn-xs btn-default tooltips pull-right text-dark" data-toggle="tooltip" data-placement="top" data-original-title="'+tradDynForm.chat+'"><i class="fa fa-comments" ></i></a> ';
// if(params.invite)
...
...
@@ -2628,15 +2629,18 @@ var directory = {
}
//SHOW HIDE VOTE BTNs
var
btnSize
=
(
params
.
status
==
"
amendementAndVote
"
)
?
"
6
"
:
"
12
"
;
if
(
(
params
.
status
==
"
tovote
"
||
params
.
status
==
"
amendementAndVote
"
)
&&
params
.
hasVote
===
false
)
str
+=
'
<a href="javascript:"
'
+
linkParams
+
'
class="btn-openVoteDetail bg-green btn col-sm-
'
+
btnSize
+
'
"><i class="fa fa-gavel"></i>
'
+
trad
.
Vote
+
'
</a>
'
;
else
if
(
(
params
.
status
==
"
tovote
"
||
params
.
status
==
"
amendementAndVote
"
)
&&
params
.
hasVote
!==
false
)
str
+=
'
<a href="javascript:;"
'
+
linkParams
+
'
data-coop-section="vote" class="openCoopPanelHtml btn btn-default col-sm-
'
+
btnSize
+
'
"><i class="fa fa-eye"></i>
'
+
trad
[
"
See votes
"
]
+
'
</a>
'
;
if
(
params
.
status
==
"
amendementAndVote
"
||
params
.
status
==
"
amendable
"
){
amendCount
=
(
params
.
amendements
)
?
"
(
"
+
Object
.
keys
(
params
.
amendements
).
length
+
"
)
"
:
""
;
str
+=
'
<a href="javascript:;"
'
+
linkParams
+
'
data-coop-section="amendments" class="openCoopPanelHtml btn btn-default text-purple col-sm-6 "><i class="fa fa-list"></i>
'
+
trad
.
Amendements
+
amendCount
+
'
</a>
'
;
if
(
typeof
userId
!=
"
undefined
"
&&
userId
!=
null
&&
userId
!=
""
){
var
btnSize
=
(
params
.
status
==
"
amendementAndVote
"
)
?
"
6
"
:
"
12
"
;
if
(
(
params
.
status
==
"
tovote
"
||
params
.
status
==
"
amendementAndVote
"
)
&&
params
.
hasVote
===
false
)
str
+=
'
<a href="javascript:"
'
+
linkParams
+
'
class="btn-openVoteDetail bg-green btn col-sm-
'
+
btnSize
+
'
"><i class="fa fa-gavel"></i>
'
+
trad
.
Vote
+
'
</a>
'
;
else
if
(
(
params
.
status
==
"
tovote
"
||
params
.
status
==
"
amendementAndVote
"
)
&&
params
.
hasVote
!==
false
)
str
+=
'
<a href="javascript:;"
'
+
linkParams
+
'
data-coop-section="vote" class="openCoopPanelHtml btn btn-default col-sm-
'
+
btnSize
+
'
"><i class="fa fa-eye"></i>
'
+
trad
[
"
See votes
"
]
+
'
</a>
'
;
if
(
params
.
status
==
"
amendementAndVote
"
||
params
.
status
==
"
amendable
"
){
amendCount
=
(
params
.
amendements
)
?
"
(
"
+
Object
.
keys
(
params
.
amendements
).
length
+
"
)
"
:
""
;
str
+=
'
<a href="javascript:;"
'
+
linkParams
+
'
data-coop-section="amendments" class="openCoopPanelHtml btn btn-default text-purple col-sm-6 "><i class="fa fa-list"></i>
'
+
trad
.
Amendements
+
amendCount
+
'
</a>
'
;
}
}
str
+=
'
</div>
'
;
...
...
assets/js/dynForm/proposal.js
View file @
afa5f55a
...
...
@@ -24,6 +24,7 @@ dynForm = {
"
</small>
"
);
}
$
(
"
#ajaxFormModal .publiccheckboxSimple
"
).
remove
();
$
(
"
#ajaxFormModal .infoScopecustom
"
).
remove
();
$
(
"
#ajaxFormModal .locationlocation
"
).
remove
();
$
(
"
#ajaxFormModal .shortDescription
"
).
remove
();
...
...
@@ -40,7 +41,7 @@ dynForm = {
$
(
"
#ajax-modal #ajaxFormModal .titletext label
"
).
html
(
"
<i class='fa fa-chevron-down'></i>
"
+
tradDynForm
.
surveyname
);
$
(
"
#ajax-modal #ajaxFormModal .titletext input#title
"
).
attr
(
"
placeholder
"
,
tradDynForm
.
surveyname
);
$
(
"
#ajaxFormModal .locationBtn
"
).
html
(
"
<i class='fa fa-home'></i> Sélectionner une commune
"
);
$
(
"
#ajaxFormModal .publiccheckboxSimple
"
).
hide
();
}
...
...
@@ -392,6 +393,14 @@ dynForm = {
tags
:
dyFInputs
.
tags
(),
urls
:
dyFInputs
.
urls
,
status
:
dyFInputs
.
inputHidden
(
"
amendable
"
),
public
:
dyFInputs
.
checkboxSimple
(
"
true
"
,
"
public
"
,
{
"
onText
"
:
trad
.
yes
,
"
offText
"
:
trad
.
no
,
"
onLabel
"
:
tradDynForm
.
public
,
"
offLabel
"
:
tradDynForm
.
private
,
"
labelText
"
:
tradDynForm
.
makeprojectvisible
+
"
?
"
,
"
labelInformation
"
:
tradDynForm
.
explainvisibleproject
}),
parentId
:
dyFInputs
.
inputHidden
(),
parentType
:
dyFInputs
.
inputHidden
(),
}
...
...
controllers/DatamigrationController.php
View file @
afa5f55a
...
...
@@ -5448,6 +5448,36 @@ if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
echo
"Number of user with preferences modified : "
.
$nbUser
;
}
}
public
function
actionPublicProposal
()
{
if
(
Role
::
isSuperAdmin
(
Role
::
getRolesUserId
(
Yii
::
app
()
->
session
[
"userId"
])
)){
$nbUser
=
0
;
$elts
=
PHDB
::
find
(
Proposal
::
COLLECTION
,
array
(
"modifiedByBatch.PublicProposal"
=>
array
(
'$exists'
=>
0
),
"parentType"
=>
"citoyens"
)
);
foreach
(
$elts
as
$keyE
=>
$elt
)
{
$elt
[
"modifiedByBatch"
][]
=
array
(
"PublicProposal"
=>
new
MongoDate
(
time
()));
$elt
[
"preferences"
]
=
array
();
$elt
[
"preferences"
][
"private"
]
=
false
;
$nbUser
++
;
$res
=
PHDB
::
update
(
Proposal
::
COLLECTION
,
array
(
"_id"
=>
new
MongoId
(
$keyE
)),
array
(
'$set'
=>
array
(
"preferences"
=>
$elt
[
"preferences"
],
"modifiedByBatch"
=>
$elt
[
"modifiedByBatch"
]
)
)
);
if
(
$res
[
"ok"
]
==
1
){
$nbUser
++
;
}
else
{
echo
"<br/> Error with user id : "
.
$key
;
}
}
//Rest::json($tags); exit;
echo
"Number of user with preferences modified : "
.
$nbUser
;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment