Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
julien balaka
co2
Commits
a0ff9911
Commit
a0ff9911
authored
Jan 22, 2019
by
Raph El
Browse files
Hotfix
parent
36c0e1d4
Changes
3
Show whitespace changes
Inline
Side-by-side
assets/js/default/directory.js
View file @
a0ff9911
...
...
@@ -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
(
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,6 +2629,7 @@ var directory = {
}
//SHOW HIDE VOTE BTNs
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>
'
;
...
...
@@ -2637,6 +2639,8 @@ var directory = {
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 @
a0ff9911
...
...
@@ -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 @
a0ff9911
...
...
@@ -5449,6 +5449,36 @@ if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
}
}
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
Supports
Markdown
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