Commit 544ed60f authored by Clément Damiens's avatar Clément Damiens
Browse files

Merge remote-tracking branch 'origin/development' into development

parents 114be7c5 ee45e6cd
...@@ -660,6 +660,7 @@ class Form { ...@@ -660,6 +660,7 @@ class Form {
$budgetInputList = []; $budgetInputList = [];
$allforms = []; $allforms = [];
$stockBudgetInputs = false; $stockBudgetInputs = false;
if(!empty($params["formList"])){
foreach ($params["formList"] as $i => $formId) foreach ($params["formList"] as $i => $formId)
{ {
$f = PHDB::findOne(Form::COLLECTION, ["id"=>$formId]); $f = PHDB::findOne(Form::COLLECTION, ["id"=>$formId]);
...@@ -676,6 +677,8 @@ class Form { ...@@ -676,6 +677,8 @@ class Form {
} }
} }
}
if(count($budgetInputList)) if(count($budgetInputList))
Yii::app()->session["budgetInputList"] = $budgetInputList; Yii::app()->session["budgetInputList"] = $budgetInputList;
//var_dump($budgetInputList); //var_dump($budgetInputList);
...@@ -743,6 +746,8 @@ class Form { ...@@ -743,6 +746,8 @@ class Form {
$showForm = true; $showForm = true;
if(!empty($params["formId"])){
$myAnswers = self::getListAnswersBy($params["formId"], $params["el"]["slug"], Yii::app()->session["userId"]); $myAnswers = self::getListAnswersBy($params["formId"], $params["el"]["slug"], Yii::app()->session["userId"]);
...@@ -829,6 +834,8 @@ class Form { ...@@ -829,6 +834,8 @@ class Form {
echo "<a class='btn btn-primary' href='/costum/co/index/slug/".$el["slug"]."/answer/".$myAnswers[0]."'>Votre réponse</a>"; echo "<a class='btn btn-primary' href='/costum/co/index/slug/".$el["slug"]."/answer/".$myAnswers[0]."'>Votre réponse</a>";
} }
} }
}
return $params; return $params;
} }
......
...@@ -6,32 +6,37 @@ else if(!empty($answer) && isset($answer["answers"][$kunik]) && $answer["answers ...@@ -6,32 +6,37 @@ else if(!empty($answer) && isset($answer["answers"][$kunik]) && $answer["answers
$value = "checked"; $value = "checked";
$inpClass = "";
if($saveOneByOne) if($saveOneByOne)
$inpClass = " saveOneByOne"; $inpClass = " saveOneByOne";
if($mode == "r"){ ?> if($mode == "r" || $mode == "pdf"){ ?>
<div class="col-xs-12" id="<?php echo $kunik ?>"> <div class="col-xs-12" id="<?php echo $kunik ?>">
<label for="<?php echo $kunik ?>"><h4 style="color:<?php echo ($titleColor) ? $titleColor : "black"; ?>"><?php echo $label ?></h4></label> <label for="<?php echo $kunik ?>"><h4 style="color:<?php echo ($titleColor) ? $titleColor : "black"; ?>"><?php echo $label ?></h4></label><br/>
<?php <?php echo @$form["inputs"][$key]["placeholder"]." : ".(!empty($value) ? "Yes" : "No"); ?>
echo @$form["inputs"][$key]["placeholder"]." : ".(!empty($value) ? "Yes" : "No");
?>
</div> </div>
<?php <?php
}else{ }else{
?> ?>
<div class="form-check"> <div class="form-check">
<label class="form-check-label" for="<?php echo $kunik ?>"><h4 style="color:<?php echo ($titleColor) ? $titleColor : "black"; ?>"><?php echo $label.$editQuestionBtn ?></h4></label> <label class="form-check-label" for="<?php echo $kunik ?>"><h4 style="color:<?php echo ($titleColor) ? $titleColor : "black"; ?>"><?php echo $label.$editQuestionBtn ?></h4></label>
<br/>
<input type="checkbox" class="form-check-input <?php echo $inpClass ?>" id="<?php echo $kunik ?>" data-form='<?php echo $form["id"] ?>' <?php echo $value ?> > <?php echo @$form["inputs"][$key]["placeholder"]?> <input type="checkbox" class="form-check-input <?php echo $inpClass ?>" id="<?php echo $kunik ?>" data-form='<?php echo $form["id"] ?>' <?php echo $value ?> > <?php echo @$form["inputs"][$key]["placeholder"]?>
<?php if(!empty($info)){ ?> <?php if(!empty($info)){ ?>
<small id="<?php echo $key ?>Help" class="form-text text-muted"><?php echo $info ?></small> <small id="<?php echo $key ?>Help" class="form-text text-muted"><?php echo $info ?></small>
<?php } ?> <?php } ?>
</div> </div>
<script type="text/javascript">
<?php } ?>
<?php if($mode != "pdf"){ ?>
<script type="text/javascript">
jQuery(document).ready(function() { jQuery(document).ready(function() {
mylog.log("render form input","/modules/costum/views/tpls/forms/checkbox.php"); mylog.log("render form input","/modules/costum/views/tpls/forms/checkbox.php");
}); });
</script> </script>
<?php } ?> <?php } ?>
\ No newline at end of file
<?php <?php
//check show btn use cases //check show btn use cases
// role is financer or operater // role is financer or operater
if( $mode != "pdf" ){
if( Form::canFormAccess( ['roles'=>["Financeur","Opérateur"] ])) if(Form::canFormAccess( ['roles'=>["Financeur","Opérateur"] ]))
{ {
if( isset($form['id']) ) if( isset($form['id']) )
{ ?> { ?>
...@@ -86,8 +86,9 @@ if( Form::canFormAccess( ['roles'=>["Financeur","Opérateur"] ])) ...@@ -86,8 +86,9 @@ if( Form::canFormAccess( ['roles'=>["Financeur","Opérateur"] ]))
<?php }?> <?php }?>
</tbody> </tbody>
</table> </table>
<?php <?php
}} else { ?> }
} else { ?>
<div class="col-xs-12 text-center margin-top-50 well"> <div class="col-xs-12 text-center margin-top-50 well">
<?php if(@$answer["step"] && $answer["step"]=="deal1"){ ?> <?php if(@$answer["step"] && $answer["step"]=="deal1"){ ?>
<span style="font-size: 22px;font-weight: 800;">Vous avez soumis votre dossier pour qu'un opérateur se positionne dessus.<br/>Il est en cours de validation. <span style="font-size: 22px;font-weight: 800;">Vous avez soumis votre dossier pour qu'un opérateur se positionne dessus.<br/>Il est en cours de validation.
...@@ -101,13 +102,11 @@ if( Form::canFormAccess( ['roles'=>["Financeur","Opérateur"] ])) ...@@ -101,13 +102,11 @@ if( Form::canFormAccess( ['roles'=>["Financeur","Opérateur"] ]))
</span> </span>
<?php } ?> <?php } ?>
</div> </div>
<?php } ?> <?php
} ?>
<script type="text/javascript">
<script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
mylog.log("render","modules/survey/views/tpls/forms/costum/deal/stepOperateur.php"); mylog.log("render","modules/survey/views/tpls/forms/costum/deal/stepOperateur.php");
var today = new Date(); var today = new Date();
...@@ -165,5 +164,10 @@ $(document).ready(function() { ...@@ -165,5 +164,10 @@ $(document).ready(function() {
}); });
</script> </script>
<?php } ?>
...@@ -5,7 +5,7 @@ if(!empty($answer) && isset($answer["answers"][$form["id"]][$kunik])) ...@@ -5,7 +5,7 @@ if(!empty($answer) && isset($answer["answers"][$form["id"]][$kunik]))
else if(!empty($answer) && isset($answer["answers"][$kunik])) else if(!empty($answer) && isset($answer["answers"][$kunik]))
$value = $answer["answers"][$kunik]; $value = $answer["answers"][$kunik];
if($mode == "r"){ ?> if($mode == "r" || $mode == "pdf"){ ?>
<div class="col-xs-12" id="<?php echo $kunik ?>"> <div class="col-xs-12" id="<?php echo $kunik ?>">
<label for="<?php echo $kunik ?>"><h4 style="color:<?php echo ($titleColor) ? $titleColor : "black"; ?>"><?php echo $label ?></h4></label> <label for="<?php echo $kunik ?>"><h4 style="color:<?php echo ($titleColor) ? $titleColor : "black"; ?>"><?php echo $label ?></h4></label>
<?php <?php
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
$debug = false; $debug = false;
$editBtnL = (Yii::app()->session["userId"] == $answer["user"]) ? " <a href='javascript:;' data-id='".$answer["_id"]."' data-collection='".Form::ANSWER_COLLECTION."' data-path='".$answerPath."' class='add".$kunik." btn btn-default'><i class='fa fa-plus'></i> Ajouter une ligne </a>" : ""; $editBtnL = (Yii::app()->session["userId"] == $answer["user"]) ? " <a href='javascript:;' data-id='".$answer["_id"]."' data-collection='".Form::ANSWER_COLLECTION."' data-path='".$answerPath."' class='add".$kunik." btn btn-default'><i class='fa fa-plus'></i> Ajouter une ligne </a>" : "";
$editParamsBtn = ($canEdit) ? " <a href='javascript:;' data-id='".$el["_id"]."' data-collection='".$this->costum["contextType"]."' data-path='costum.form.params.".$kunik."' class='previewTpl edit".$kunik."Params btn btn-xs btn-danger'><i class='fa fa-cog'></i> </a>" : ""; $editParamsBtn = ($canEditForm) ? " <a href='javascript:;' data-id='".$el["_id"]."' data-collection='".$this->costum["contextType"]."' data-path='costum.form.params.".$kunik."' class='previewTpl edit".$kunik."Params btn btn-xs btn-danger'><i class='fa fa-cog'></i> </a>" : "";
$paramsData = [ $paramsData = [
"group" => [ "group" => [
...@@ -17,7 +17,7 @@ $paramsData = [ ...@@ -17,7 +17,7 @@ $paramsData = [
"fonctionnement" => "Fonctionnement" "fonctionnement" => "Fonctionnement"
], ],
"amounts" => [ "amounts" => [
"price" => "Price" "price" => "Montant"
], ],
"estimate" => false "estimate" => false
]; ];
...@@ -80,6 +80,7 @@ echo $this->renderPartial("survey.views.tpls.forms.cplx.budgetTable", ...@@ -80,6 +80,7 @@ echo $this->renderPartial("survey.views.tpls.forms.cplx.budgetTable",
"answer"=>$answer, "answer"=>$answer,
"mode" => $mode, "mode" => $mode,
"kunik" => $kunik, "kunik" => $kunik,
"answerPath"=>$answerPath,
"key" => $key, "key" => $key,
"titleColor" => $titleColor, "titleColor" => $titleColor,
"properties" => $properties, "properties" => $properties,
...@@ -108,7 +109,7 @@ echo $this->renderPartial("survey.views.tpls.forms.cplx.budgetTable", ...@@ -108,7 +109,7 @@ echo $this->renderPartial("survey.views.tpls.forms.cplx.budgetTable",
<?php } <?php }
if($mode != "r"){ if($mode != "r" && $mode != "pdf"){
?> ?>
<script type="text/javascript"> <script type="text/javascript">
...@@ -131,12 +132,17 @@ $(document).ready(function() { ...@@ -131,12 +132,17 @@ $(document).ready(function() {
tplCtx.value[k] = $("#"+k).val(); tplCtx.value[k] = $("#"+k).val();
}); });
var connectedData = ["financer","todo","payed","progress","worker","validFinal","votes",];
$.each( connectedData , function(k,attr) {
if(notNull("answerObj."+tplCtx.path+"."+attr))
tplCtx.value[attr] = jsonHelper.getValueByPath(answerObj,tplCtx.path+"."+attr);
});
mylog.log("save tplCtx",tplCtx); mylog.log("save tplCtx",tplCtx);
if(typeof tplCtx.value == "undefined") if(typeof tplCtx.value == "undefined")
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");//$("#ajax-modal").modal('hide');
urlCtrl.loadByHash(location.hash); urlCtrl.loadByHash(location.hash);
} ); } );
} }
...@@ -199,8 +205,7 @@ $(document).ready(function() { ...@@ -199,8 +205,7 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>"); urlCtrl.loadByHash(location.hash);
//urlCtrl.loadByHash(location.hash);
} ); } );
} }
...@@ -212,7 +217,7 @@ $(document).ready(function() { ...@@ -212,7 +217,7 @@ $(document).ready(function() {
mylog.log("render","/modules/costum/views/tpls/forms/<?php echo $kunik ?>.php"); mylog.log("render","/modules/costum/views/tpls/forms/<?php echo $kunik ?>.php");
//adds a line into answer //adds a line into answer
$(".add<?php echo $kunik ?>").off().on("click",function() { $( ".add<?php echo $kunik ?>" ).off().on("click",function() {
tplCtx.id = $(this).data("id"); tplCtx.id = $(this).data("id");
tplCtx.collection = $(this).data("collection"); tplCtx.collection = $(this).data("collection");
tplCtx.path = $(this).data("path")+((notNull(<?php echo $kunik ?>Data) ? <?php echo $kunik ?>Data.length : "0")); tplCtx.path = $(this).data("path")+((notNull(<?php echo $kunik ?>Data) ? <?php echo $kunik ?>Data.length : "0"));
...@@ -324,7 +329,7 @@ $(document).ready(function() { ...@@ -324,7 +329,7 @@ $(document).ready(function() {
function closePrioModal(){ function closePrioModal(){
prioModal.modal('hide'); prioModal.modal('hide');
} }
function closePrioModalRel(){ function closePrioModalRel (){
closePrioModal(); closePrioModal();
urlCtrl.loadByHash(location.hash); urlCtrl.loadByHash(location.hash);
} }
......
<?php <?php
$styleT = ( ($mode == "pdf") ? " border : 1px solid black ;" : "");
$colspanplus = (($mode == "r") ? 0 : 2); //var_dump($styleT);
$colspanplus = (($mode == "r" || $mode == "pdf") ? 0 : 2);
?> ?>
<div class="form-group"> <div class="form-group">
<?php <?php
if($mode == "r"){ ?> if($mode == "r" || $mode == "pdf"){ ?>
<label ><h4 style="color:<?php echo (!empty($titleColor) ? $titleColor : "black" ); ?>"><?php echo $label ; ?></h4></label> <label ><h4 style="color:<?php echo (!empty($titleColor) ? $titleColor : "black" ); ?>"><?php echo $label ; ?></h4></label>
<?php echo $info ?> <?php echo $info ?>
<?php <?php
...@@ -15,7 +16,8 @@ $colspanplus = (($mode == "r") ? 0 : 2); ...@@ -15,7 +16,8 @@ $colspanplus = (($mode == "r") ? 0 : 2);
<?php echo $info ?> <?php echo $info ?>
<?php <?php
} ?> } ?>
<table class="table table-bordered table-hover directoryTable" id="<?php echo $kunik?>"> <table class="table table-bordered table-hover directoryTable" id="<?php echo $kunik ; ?>"
>
<thead> <thead>
<?php <?php
...@@ -28,7 +30,7 @@ $colspanplus = (($mode == "r") ? 0 : 2); ...@@ -28,7 +30,7 @@ $colspanplus = (($mode == "r") ? 0 : 2);
} ?> } ?>
<?php <?php
if($mode != "r"){ ?> if($mode != "r" && $mode != "pdf"){ ?>
<th></th> <th></th>
<?php } ?> <?php } ?>
</tr> </tr>
...@@ -70,16 +72,17 @@ $colspanplus = (($mode == "r") ? 0 : 2); ...@@ -70,16 +72,17 @@ $colspanplus = (($mode == "r") ? 0 : 2);
echo "<tr id='".$kunik.$q."' class='".$kunik."Line'>"; echo "<tr id='".$kunik.$q."' class='".$kunik."Line'>";
echo $tds; echo $tds;
if($mode != "r"){ if($mode != "r" && $mode != "pdf"){
?> ?>
<td> <td>
<?php <?php
//echo $answerPath.$q;
$this->renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ $this->renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [
"canEdit"=>($canEdit||Yii::app()->session["userId"] == $answer["user"]), "canEdit"=>($canEdit||Yii::app()->session["userId"] == $answer["user"]),
"id" => $answer["_id"], "id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION, "collection" => Form::ANSWER_COLLECTION,
"q" => $q, "q" => $q,
"path" => "answers.".$kunik.".".$q, "path" => $answerPath.$q,
"kunik"=>$kunik ] ); ?> "kunik"=>$kunik ] ); ?>
<a href="javascript:;" class="btn btn-xs btn-primary openAnswersComment" onclick="commentObj.openPreview('answers','<?php echo $answer["_id"]?>','<?php echo $answer["_id"].$key.$q ?>', '<?php echo @$a['step'] ?>')"><?php echo PHDB::count(Comment::COLLECTION, array("contextId"=>$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> <i class='fa fa-commenting'></i></a> <a href="javascript:;" class="btn btn-xs btn-primary openAnswersComment" onclick="commentObj.openPreview('answers','<?php echo $answer["_id"]?>','<?php echo $answer["_id"].$key.$q ?>', '<?php echo @$a['step'] ?>')"><?php echo PHDB::count(Comment::COLLECTION, array("contextId"=>$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> <i class='fa fa-commenting'></i></a>
...@@ -119,7 +122,7 @@ if($total > 0){ ...@@ -119,7 +122,7 @@ if($total > 0){
echo "<tr class='bold'>"; echo "<tr class='bold'>";
echo "<td colspan=".(count( $paramsData["amounts"] )+2)." style='text-align:right'> TOTAL : </td>"; echo "<td colspan=".(count( $paramsData["amounts"] )+2)." style='text-align:right'> TOTAL : </td>";
if($mode != "r") if($mode != "r" && $mode != "pdf")
echo "<td colspan='".$colspanplus."''>".trim(strrev(chunk_split(strrev($total),3, ' ')))." €</td>"; echo "<td colspan='".$colspanplus."''>".trim(strrev(chunk_split(strrev($total),3, ' ')))." €</td>";
else else
echo "<td>".trim(strrev(chunk_split(strrev($total),3, ' ')))." €</td>"; echo "<td>".trim(strrev(chunk_split(strrev($total),3, ' ')))." €</td>";
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
$editBtnL = (Yii::app()->session["userId"] == $answer["user"]) ? " <a href='javascript:;' data-id='".$answer["_id"]."' data-collection='".Form::ANSWER_COLLECTION."' data-path='".$answerPath."' class='add".$kunik." btn btn-default'><i class='fa fa-plus'></i> Ajouter une ligne </a>" : ""; $editBtnL = (Yii::app()->session["userId"] == $answer["user"]) ? " <a href='javascript:;' data-id='".$answer["_id"]."' data-collection='".Form::ANSWER_COLLECTION."' data-path='".$answerPath."' class='add".$kunik." btn btn-default'><i class='fa fa-plus'></i> Ajouter une ligne </a>" : "";
$editParamsBtn = ($canEdit) ? " <a href='javascript:;' data-id='".$el["_id"]."' data-collection='".$this->costum["contextType"]."' data-path='costum.form.params.".$kunik."' class='previewTpl edit".$kunik."Params btn btn-xs btn-danger'><i class='fa fa-cog'></i> </a>" : ""; $editParamsBtn = ($canEditForm) ? " <a href='javascript:;' data-id='".$el["_id"]."' data-collection='".$this->costum["contextType"]."' data-path='costum.form.params.".$kunik."' class='previewTpl edit".$kunik."Params btn btn-xs btn-danger'><i class='fa fa-cog'></i> </a>" : "";
?> ?>
<thead> <thead>
<tr> <tr>
...@@ -144,8 +144,6 @@ $(document).ready(function() { ...@@ -144,8 +144,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { dataHelper.path2Value( tplCtx, function(params) {
//$("#ajax-modal").modal('hide');
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");
urlCtrl.loadByHash(location.hash); urlCtrl.loadByHash(location.hash);
} ); } );
} }
...@@ -183,8 +181,6 @@ $(document).ready(function() { ...@@ -183,8 +181,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { dataHelper.path2Value( tplCtx, function(params) {
//$("#ajax-modal").modal('hide');
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");
urlCtrl.loadByHash(location.hash); urlCtrl.loadByHash(location.hash);
} ); } );
} }
......
...@@ -317,7 +317,6 @@ $(document).ready(function() { ...@@ -317,7 +317,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");//$("#ajax-modal").modal('hide');
urlCtrl.loadByHash(location.hash); urlCtrl.loadByHash(location.hash);
} ); } );
} }
...@@ -362,7 +361,6 @@ $(document).ready(function() { ...@@ -362,7 +361,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");
urlCtrl.loadByHash(location.hash); urlCtrl.loadByHash(location.hash);
} ); } );
} }
...@@ -491,13 +489,7 @@ $(document).ready(function() { ...@@ -491,13 +489,7 @@ $(document).ready(function() {
}); });
}); });
function closePrioModal(){
prioModal.modal('hide');
}
function closePrioModalRel(){
closePrioModal();
urlCtrl.loadByHash(location.hash);
}
</script> </script>
<?php } else { <?php } else {
//echo "<h4 class='text-red'>CALENDAR works with existing answers</h4>"; //echo "<h4 class='text-red'>CALENDAR works with existing answers</h4>";
......
...@@ -185,7 +185,6 @@ $(document).ready(function() { ...@@ -185,7 +185,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");//$("#ajax-modal").modal('hide');
urlCtrl.loadByHash(location.hash); urlCtrl.loadByHash(location.hash);
} ); } );
} }
...@@ -222,7 +221,6 @@ $(document).ready(function() { ...@@ -222,7 +221,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");
urlCtrl.loadByHash(location.hash); urlCtrl.loadByHash(location.hash);
} ); } );
} }
......
...@@ -234,7 +234,6 @@ $(document).ready(function() { ...@@ -234,7 +234,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");//$("#ajax-modal").modal('hide');
urlCtrl.loadByHash(location.hash); urlCtrl.loadByHash(location.hash);
} ); } );
} }
...@@ -281,7 +280,6 @@ $(document).ready(function() { ...@@ -281,7 +280,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");
urlCtrl.loadByHash(location.hash); urlCtrl.loadByHash(location.hash);
} ); } );
} }
......
...@@ -57,20 +57,18 @@ $orgs = []; ...@@ -57,20 +57,18 @@ $orgs = [];
foreach ($organizations as $id => $or) { foreach ($organizations as $id => $or) {
$roles = null; $roles = null;
if(!empty($or["links"]) && if( isset( $communityLinks[$id]["roles"] ) )
!empty($or["links"]["memberOf"]) && $roles = $communityLinks[$id]["roles"];
!empty($or["links"]["memberOf"][$this->costum["contextId"]]) && if( $paramsData["limitRoles"] && !empty($roles) )
!empty($or["links"]["memberOf"][$this->costum["contextId"]]["roles"]) ) {
$roles = $or["links"]["memberOf"][$this->costum["contextId"]]["roles"]; foreach ($roles as $i => $r)
if( $paramsData["limitRoles"] && !empty($roles))
{ {
foreach ($roles as $i => $r) {
if( in_array($r, $paramsData["limitRoles"]) ) if( in_array($r, $paramsData["limitRoles"]) )
$orgs[$id] = $or["name"]; $orgs[$id] = $or["name"];
} }
} }