Commit 1865e6b6 authored by Raph El's avatar Raph El

Replace : Yii::app()->session["costum"] to $this->costum

parent cb85be5c
//parent form //parent form
{ {
"parent" : Ne pas oublié de rattacher le parent,
"parent" : {
"5e3bb97569086421758b465a" : {
"type" : "projects",
"name" : "DEAL"
}
},
"hasStepValidations" : 1, "hasStepValidations" : 1,
"id" : "dealForm", "id" : "dealForm",
"source" : { "source" : {
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
costum.col = "<?php echo Yii::app()->session["costum"]["contextType"] ?>"; costum.col = "<?php echo Yii::app()->session["costum"]["contextType"] ?>";
costum.ctrl = "<?php echo Element::getControlerByCollection(Yii::app()->session["costum"]["contextType"]) ?>"; costum.ctrl = "<?php echo Element::getControlerByCollection(Yii::app()->session["costum"]["contextType"]) ?>";
var configDynForm = <?php echo json_encode(Yii::app()->session['costum']['dynForm']); ?>; var configDynForm = <?php echo json_encode($this->costum['dynForm']); ?>;
var tplsList = <?php echo json_encode((isset(Yii::app()->session['costum']['tpls'])) ? Yii::app()->session['costum']['tpls']:null); ?>; var tplsList = <?php echo json_encode((isset($this->costum['tpls'])) ? $this->costum['tpls']:null); ?>;
//contains all dynform definitions for complexe inputs //contains all dynform definitions for complexe inputs
//it also carries sub dynforms, when an input needs extra parameters to //it also carries sub dynforms, when an input needs extra parameters to
......
...@@ -14,14 +14,14 @@ ...@@ -14,14 +14,14 @@
$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='".Yii::app()->session["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 = ($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>" : "";
$paramsData = [ $paramsData = [
"mail_type" => "" "mail_type" => ""
]; ];
if( isset(Yii::app()->session["costum"]["form"]["params"][$kunik]["mail_type"]) ) if( isset($this->costum["form"]["params"][$kunik]["mail_type"]) )
$paramsData["mail_type"] = Yii::app()->session["costum"]["form"]["params"][$kunik]["mail_type"]; $paramsData["mail_type"] = $this->costum["form"]["params"][$kunik]["mail_type"];
$properties = [ $properties = [
......
...@@ -12,10 +12,10 @@ $paramsData = [ "title" => "", ...@@ -12,10 +12,10 @@ $paramsData = [ "title" => "",
"tags" => "structags" "tags" => "structags"
]; ];
if( isset(Yii::app()->session["costum"]["tpls"][$keyTpl]) ) { if( isset($this->costum["tpls"][$keyTpl]) ) {
foreach ($paramsData as $i => $v) { foreach ($paramsData as $i => $v) {
if( isset(Yii::app()->session["costum"]["tpls"][$keyTpl][$i]) ) if( isset($this->costum["tpls"][$keyTpl][$i]) )
$paramsData[$i] = Yii::app()->session["costum"]["tpls"][$keyTpl][$i]; $paramsData[$i] = $this->costum["tpls"][$keyTpl][$i];
} }
} }
...@@ -59,8 +59,8 @@ var formInputsHere = formInputs; ...@@ -59,8 +59,8 @@ var formInputsHere = formInputs;
{ {
echo '<h1 class="text-center" style="color:'.$color1.'" >'.@$form["name"].'</h1>'; echo '<h1 class="text-center" style="color:'.$color1.'" >'.@$form["name"].'</h1>';
echo "<div class='text-center'>"; echo "<div class='text-center'>";
if(isset(Yii::app()->session["costum"]["cms"][$form["id"]."desc"])) if(isset($this->costum["cms"][$form["id"]."desc"]))
echo htmlentities(Yii::app()->session["costum"]["cms"][$form["id"]."desc"]); echo htmlentities($this->costum["cms"][$form["id"]."desc"]);
else else
echo "<span style='color:#aaa'>* section description</span>"; echo "<span style='color:#aaa'>* section description</span>";
if($canEdit) if($canEdit)
......
...@@ -7,15 +7,15 @@ if( $mode != "pdf" ){ ...@@ -7,15 +7,15 @@ if( $mode != "pdf" ){
$isFinanceur=false; $isFinanceur=false;
if(Authorisation::isInterfaceAdmin()) if(Authorisation::isInterfaceAdmin())
$isFinanceur=true; $isFinanceur=true;
if(isset(Yii::app()->session["costum"][$this->costum["slug"]]["financorOf"])){ if(isset($this->costum[$this->costum["slug"]]["financorOf"])){
$isFinanceur=true; $isFinanceur=true;
$financorOf=Yii::app()->session["costum"][$this->costum["slug"]]["financorOf"]; $financorOf=$this->costum[$this->costum["slug"]]["financorOf"];
$financorOf["thumbImg"]=(isset($financorOf["profilThumbImageUrl"])) ? Yii::app()->createUrl($financorOf["profilThumbImageUrl"]) : Yii::app()->getModule( Yii::app()->params["module"]["parent"] )->getAssetsUrl()."/images/thumb/default_organizations.jpg"; $financorOf["thumbImg"]=(isset($financorOf["profilThumbImageUrl"])) ? Yii::app()->createUrl($financorOf["profilThumbImageUrl"]) : Yii::app()->getModule( Yii::app()->params["module"]["parent"] )->getAssetsUrl()."/images/thumb/default_organizations.jpg";
} }
$isOperator = false; $isOperator = false;
if(isset(Yii::app()->session["costum"][$this->costum["slug"]]["operatorOf"])){ if(isset($this->costum[$this->costum["slug"]]["operatorOf"])){
$isOperator= true; $isOperator= true;
$operatorOf=Yii::app()->session["costum"][$this->costum["slug"]]["operatorOf"]; $operatorOf=$this->costum[$this->costum["slug"]]["operatorOf"];
$operatorOf["thumbImg"]=(isset($operatorOf["profilThumbImageUrl"])) ? Yii::app()->createUrl($operatorOf["profilThumbImageUrl"]) : Yii::app()->getModule( Yii::app()->params["module"]["parent"] )->getAssetsUrl()."/images/thumb/default_organizations.jpg"; $operatorOf["thumbImg"]=(isset($operatorOf["profilThumbImageUrl"])) ? Yii::app()->createUrl($operatorOf["profilThumbImageUrl"]) : Yii::app()->getModule( Yii::app()->params["module"]["parent"] )->getAssetsUrl()."/images/thumb/default_organizations.jpg";
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
} }
} }
} }
if(isset(Yii::app()->session["costum"]["form"]["params"][$kunik]['num_row']) and Yii::app()->session["costum"]["form"]["params"][$kunik]['num_row'] == "0" and isset(Yii::app()->session["costum"]["form"]["params"][$kunik]["nbmax"]) and ((int)Yii::app()->session["costum"]["form"]["params"][$kunik]["nbmax"]) <= $i){ if(isset($this->costum["form"]["params"][$kunik]['num_row']) and $this->costum["form"]["params"][$kunik]['num_row'] == "0" and isset($this->costum["form"]["params"][$kunik]["nbmax"]) and ((int)$this->costum["form"]["params"][$kunik]["nbmax"]) <= $i){
$show = false; $show = false;
} }
$editBtnL=""; $editBtnL="";
...@@ -19,16 +19,16 @@ ...@@ -19,16 +19,16 @@
$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='".Yii::app()->session["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 = ($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>" : "";
$paramsData = [ $paramsData = [
"nbmax" => "2", "num_row" => ["limité","illimité"] "nbmax" => "2", "num_row" => ["limité","illimité"]
]; ];
if( isset(Yii::app()->session["costum"]["form"]["params"][$kunik]["nbmax"]) ) if( isset($this->costum["form"]["params"][$kunik]["nbmax"]) )
$paramsData["nbmax"] = Yii::app()->session["costum"]["form"]["params"][$kunik]["nbmax"]; $paramsData["nbmax"] = $this->costum["form"]["params"][$kunik]["nbmax"];
if( isset(Yii::app()->session["costum"]["form"]["params"][$kunik]["limited"]) ) if( isset($this->costum["form"]["params"][$kunik]["limited"]) )
$paramsData["num_row"] = Yii::app()->session["costum"]["form"]["params"][$kunik]["num_row"]; $paramsData["num_row"] = $this->costum["form"]["params"][$kunik]["num_row"];
$properties = [ $properties = [
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
inputType : "select", inputType : "select",
label : "Limitation", label : "Limitation",
options : sectionDyf.<?php echo $kunik ?>ParamsData.num_row, options : sectionDyf.<?php echo $kunik ?>ParamsData.num_row,
value : "<?php echo (isset(Yii::app()->session["costum"]["form"]["params"][$kunik]['num_row'])) ? Yii::app()->session["costum"]["form"]["params"][$kunik]['num_row'] : ''; ?>" value : "<?php echo (isset($this->costum["form"]["params"][$kunik]['num_row'])) ? $this->costum["form"]["params"][$kunik]['num_row'] : ''; ?>"
}, },
nbmax : { nbmax : {
......
...@@ -21,30 +21,30 @@ ...@@ -21,30 +21,30 @@
$cnt++; $cnt++;
} }
} }
if(isset(Yii::app()->session["costum"]["form"]["params"][$kunik]['num_row']) and Yii::app()->session["costum"]["form"]["params"][$kunik]['num_row'] == "0" and isset(Yii::app()->session["costum"]["form"]["params"][$kunik]["nbmax"]) and ((int)Yii::app()->session["costum"]["form"]["params"][$kunik]["nbmax"]) <= $i){ if(isset($this->costum["form"]["params"][$kunik]['num_row']) and $this->costum["form"]["params"][$kunik]['num_row'] == "0" and isset($this->costum["form"]["params"][$kunik]["nbmax"]) and ((int)$this->costum["form"]["params"][$kunik]["nbmax"]) <= $i){
$show = false; $show = false;
} }
$editBtnL=""; $editBtnL="";
$editParamsBtn = ($canEdit) ? " <a href='javascript:;' data-id='".$el["_id"]."' data-collection='".Yii::app()->session["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 = ($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>" : "";
$paramsData = [ $paramsData = [
"nbmax" => "2", "num_row" => ["limité","illimité"], "nblist_max" => "2" ,"num_list" => ["limité","illimité"], "width" => ["1" => "1","2" => "2","2" => "2","3" => "3"] "nbmax" => "2", "num_row" => ["limité","illimité"], "nblist_max" => "2" ,"num_list" => ["limité","illimité"], "width" => ["1" => "1","2" => "2","2" => "2","3" => "3"]
]; ];
if( isset(Yii::app()->session["costum"]["form"]["params"][$kunik]["nbmax"]) ) if( isset($this->costum["form"]["params"][$kunik]["nbmax"]) )
$paramsData["nbmax"] = Yii::app()->session["costum"]["form"]["params"][$kunik]["nbmax"]; $paramsData["nbmax"] = $this->costum["form"]["params"][$kunik]["nbmax"];
if( isset(Yii::app()->session["costum"]["form"]["params"][$kunik]["limited"]) ) if( isset($this->costum["form"]["params"][$kunik]["limited"]) )
$paramsData["num_row"] = Yii::app()->session["costum"]["form"]["params"][$kunik]["num_row"]; $paramsData["num_row"] = $this->costum["form"]["params"][$kunik]["num_row"];
if( isset(Yii::app()->session["costum"]["form"]["params"][$kunik]["nblist_max"]) ) if( isset($this->costum["form"]["params"][$kunik]["nblist_max"]) )
$paramsData["nblist_max"] = Yii::app()->session["costum"]["form"]["params"][$kunik]["nblist_max"]; $paramsData["nblist_max"] = $this->costum["form"]["params"][$kunik]["nblist_max"];
if( isset(Yii::app()->session["costum"]["form"]["params"][$kunik]["num_list"]) ) if( isset($this->costum["form"]["params"][$kunik]["num_list"]) )
$paramsData["num_list"] = Yii::app()->session["costum"]["form"]["params"][$kunik]["num_list"]; $paramsData["num_list"] = $this->costum["form"]["params"][$kunik]["num_list"];
if( isset(Yii::app()->session["costum"]["form"]["params"][$kunik]["width"]) ) if( isset($this->costum["form"]["params"][$kunik]["width"]) )
$paramsData["width"] = Yii::app()->session["costum"]["form"]["params"][$kunik]["width"]; $paramsData["width"] = $this->costum["form"]["params"][$kunik]["width"];
$cssRow = "6"; $cssRow = "6";
if( isset(Yii::app()->session["costum"]["form"]["params"][$kunik]["width"]) ){ if( isset($this->costum["form"]["params"][$kunik]["width"]) ){
if($paramsData["width"] == "1"){ if($paramsData["width"] == "1"){
$cssRow = "12"; $cssRow = "12";
}elseif ($paramsData["width"] == "2"){ }elseif ($paramsData["width"] == "2"){
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
inputType : "select", inputType : "select",
label : "Limitation", label : "Limitation",
options : sectionDyf.<?php echo $kunik ?>ParamsData.num_row, options : sectionDyf.<?php echo $kunik ?>ParamsData.num_row,
value : "<?php echo (isset(Yii::app()->session["costum"]["form"]["params"][$kunik]['num_row'])) ? Yii::app()->session["costum"]["form"]["params"][$kunik]['num_row'] : ''; ?>" value : "<?php echo (isset($this->costum["form"]["params"][$kunik]['num_row'])) ? $this->costum["form"]["params"][$kunik]['num_row'] : ''; ?>"
}, },
nbmax : { nbmax : {
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
inputType : "text", inputType : "text",
label : "Nombre d'element par ligne", label : "Nombre d'element par ligne",
options : sectionDyf.<?php echo $kunik ?>ParamsData.width, options : sectionDyf.<?php echo $kunik ?>ParamsData.width,
value : "<?php echo (isset(Yii::app()->session["costum"]["form"]["params"][$kunik]['width'])) ? Yii::app()->session["costum"]["form"]["params"][$kunik]['width'] : ''; ?>" value : "<?php echo (isset($this->costum["form"]["params"][$kunik]['width'])) ? $this->costum["form"]["params"][$kunik]['width'] : ''; ?>"
} }
}, },
save : function () { save : function () {
......
...@@ -93,18 +93,18 @@ if( $mode != "pdf" ){ ...@@ -93,18 +93,18 @@ if( $mode != "pdf" ){
<tr> <tr>
<td colspan='2' class="text-center" > <td colspan='2' class="text-center" >
<?php <?php
// var_dump(Yii::app()->session["costum"][$el['costum']['slug']]["hasRoles"][0]); // var_dump($this->costum[$el['costum']['slug']]["hasRoles"][0]);
// var_dump($paramsData['canValidRoles']); // var_dump($paramsData['canValidRoles']);
if( (!isset($answer["validation"][$form['id']]) || (isset( $answer["validation"][ $form['id'] ]["valid"] ) && $answer["validation"][ $form['id'] ]["valid"] == "notValid")) && if( (!isset($answer["validation"][$form['id']]) || (isset( $answer["validation"][ $form['id'] ]["valid"] ) && $answer["validation"][ $form['id'] ]["valid"] == "notValid")) &&
//isset( $answ) && //isset( $answ) &&
isset( Yii::app()->session["costum"][$el['costum']['slug']]["hasRoles"][0]) && isset( $this->costum[$el['costum']['slug']]["hasRoles"][0]) &&
in_array(Yii::app()->session["costum"][$el['costum']['slug']]["hasRoles"][0], $paramsData['canRequestRoles']) ) in_array($this->costum[$el['costum']['slug']]["hasRoles"][0], $paramsData['canRequestRoles']) )
echo '<a href="javascript:;" data-type="'.$form['id'].'" class="requestValid btn btn-primary">Étape terminé , Demander la Validation</a>'; echo '<a href="javascript:;" data-type="'.$form['id'].'" class="requestValid btn btn-primary">Étape terminé , Demander la Validation</a>';
else if( isset( $answer["validation"][ $form['id'] ]["valid"] ) && else if( isset( $answer["validation"][ $form['id'] ]["valid"] ) &&
$answer["validation"][ $form['id'] ]["valid"] == "request" && $answer["validation"][ $form['id'] ]["valid"] == "request" &&
isset( Yii::app()->session["costum"][$el['costum']['slug']]["hasRoles"][0] ) && isset( $this->costum[$el['costum']['slug']]["hasRoles"][0] ) &&
in_array(Yii::app()->session["costum"][$el['costum']['slug']]["hasRoles"][0], $paramsData['canValidRoles']) ) in_array($this->costum[$el['costum']['slug']]["hasRoles"][0], $paramsData['canValidRoles']) )
echo '<a href="javascript:;" data-type="'.$form['id'].'" class="validEdit btn btn-primary">Valider cette Étape</a>'; echo '<a href="javascript:;" data-type="'.$form['id'].'" class="validEdit btn btn-primary">Valider cette Étape</a>';
else { else {
if(isset( $answer["validation"][ $form['id'] ] ) && if(isset( $answer["validation"][ $form['id'] ] ) &&
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<?php <?php
$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='".Yii::app()->session["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 = ($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>" : "";
$paramsData = [ $paramsData = [
"role" => [ "role" => [
...@@ -14,8 +14,8 @@ $paramsData = [ ...@@ -14,8 +14,8 @@ $paramsData = [
"graphiste" "graphiste"
] ]; ] ];
if( isset(Yii::app()->session["costum"]["form"]["params"][$kunik]["role"]) ) if( isset($this->costum["form"]["params"][$kunik]["role"]) )
$paramsData["role"] = Yii::app()->session["costum"]["form"]["params"][$kunik]["role"]; $paramsData["role"] = $this->costum["form"]["params"][$kunik]["role"];
$properties = [ $properties = [
"titre_sous_action" => [ "titre_sous_action" => [
......
<?php if($answer){ <?php if($answer){
$copy = "opalProcess1.depense"; $copy = "opalProcess1.depense";
if( isset(Yii::app()->session["costum"]["form"]["params"][$kunik]["offresCopy"]) ) if( isset($this->costum["form"]["params"][$kunik]["offresCopy"]) )
$copy = Yii::app()->session["costum"]["form"]["params"][$kunik]["offresCopy"]; $copy = $this->costum["form"]["params"][$kunik]["offresCopy"];
//var_dump($copy); //var_dump($copy);
$copyT = explode(".", $copy); $copyT = explode(".", $copy);
$copyF = $copyT[0]; $copyF = $copyT[0];
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
$editBtnL = ""; $editBtnL = "";
$editParamsBtn = ($canEdit) ? " <a href='javascript:;' data-id='".$el["_id"]."' data-collection='".Yii::app()->session["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 = ($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>" : "";
$paramsData = [ $paramsData = [
...@@ -39,22 +39,22 @@ $paramsData = [ ...@@ -39,22 +39,22 @@ $paramsData = [
] ]
]; ];
if( isset(Yii::app()->session["costum"]["form"]["params"][$kunik]) ) { if( isset($this->costum["form"]["params"][$kunik]) ) {
if( isset(Yii::app()->session["costum"]["form"]["params"][$offresKey]["group"]) ) if( isset($this->costum["form"]["params"][$offresKey]["group"]) )
$paramsData["group"] = Yii::app()->session["costum"]["form"]["params"][$offresKey]["group"]; $paramsData["group"] = $this->costum["form"]["params"][$offresKey]["group"];
if( isset(Yii::app()->session["costum"]["form"]["params"][$offresKey]["nature"]) ) if( isset($this->costum["form"]["params"][$offresKey]["nature"]) )
$paramsData["nature"] = Yii::app()->session["costum"]["form"]["params"][$offresKey]["nature"]; $paramsData["nature"] = $this->costum["form"]["params"][$offresKey]["nature"];
if( isset(Yii::app()->session["costum"]["form"]["params"][$offresKey]["amounts"]) ) if( isset($this->costum["form"]["params"][$offresKey]["amounts"]) )
$paramsData["amounts"] = Yii::app()->session["costum"]["form"]["params"][$kunik]["amounts"]; $paramsData["amounts"] = $this->costum["form"]["params"][$kunik]["amounts"];
} }
$communityLinks = Element::getCommunityByTypeAndId(Yii::app()->session["costum"]["contextType"],Yii::app()->session["costum"]["contextId"]); $communityLinks = Element::getCommunityByTypeAndId($this->costum["contextType"],$this->costum["contextId"]);
$organizations = Link::groupFindByType( Organization::COLLECTION,$communityLinks,["name","links"] ); $organizations = Link::groupFindByType( Organization::COLLECTION,$communityLinks,["name","links"] );
$orgs = []; $orgs = [];
foreach ($organizations as $id => $or) { foreach ($organizations as $id => $or) {
$roles = $or["links"]["memberOf"][Yii::app()->session["costum"]["contextId"]]["roles"]; $roles = $or["links"]["memberOf"][$this->costum["contextId"]]["roles"];
if( $paramsData["limitRoles"] && !empty($roles)) if( $paramsData["limitRoles"] && !empty($roles))
{ {
foreach ($roles as $i => $r) { foreach ($roles as $i => $r) {
...@@ -98,7 +98,7 @@ $properties["votes"] = [ ...@@ -98,7 +98,7 @@ $properties["votes"] = [
<tr> <tr>
<td colspan='<?php echo count( $properties)+2?>' ><h4 style="color:<?php echo ($titleColor) ? $titleColor : "black"; ?>"><?php echo $label.$editQuestionBtn.$editParamsBtn.$editBtnL?></h4> <td colspan='<?php echo count( $properties)+2?>' ><h4 style="color:<?php echo ($titleColor) ? $titleColor : "black"; ?>"><?php echo $label.$editQuestionBtn.$editParamsBtn.$editBtnL?></h4>
<?php echo $info; <?php echo $info;
if( !isset(Yii::app()->session["costum"]["form"]["params"][$kunik]["offresCopy"]) ) if( !isset($this->costum["form"]["params"][$kunik]["offresCopy"]) )
echo "<br/><span class='text-red text-center'><i class='fa fa-warning fa-2x'></i> THIS FIELD HAS TO BE CONFIGURED FIRST ".$editParamsBtn."</span>"; ?> echo "<br/><span class='text-red text-center'><i class='fa fa-warning fa-2x'></i> THIS FIELD HAS TO BE CONFIGURED FIRST ".$editParamsBtn."</span>"; ?>
</td> </td>
</tr> </tr>
...@@ -274,13 +274,13 @@ echo "<h4 style='color:".(($titleColor) ? $titleColor : "black")."'>Décision Gl ...@@ -274,13 +274,13 @@ echo "<h4 style='color:".(($titleColor) ? $titleColor : "black")."'>Décision Gl
<?php <?php
if( isset(Yii::app()->session["costum"]["form"]["params"]["financement"]["tpl"])){ if( isset($this->costum["form"]["params"]["financement"]["tpl"])){
//if( Yii::app()->session["costum"]["form"]["params"]["financement"]["tpl"] == "tpls.forms.equioffres" ) //if( $this->costum["form"]["params"]["financement"]["tpl"] == "tpls.forms.equioffres" )
$this->renderPartial( "costum.views.".Yii::app()->session["costum"]["form"]["params"]["financement"]["tpl"] , $this->renderPartial( "costum.views.".$this->costum["form"]["params"]["financement"]["tpl"] ,
[ "totalFin" => $total, [ "totalFin" => $total,
"totalBudg" => Yii::app()->session["totaloffres"]["totaloffres"] ] ); "totalBudg" => Yii::app()->session["totaloffres"]["totaloffres"] ] );
// else // else
// $this->renderPartial( "costum.views.".Yii::app()->session["costum"]["form"]["params"]["financement"]["tpl"]); // $this->renderPartial( "costum.views.".$this->costum["form"]["params"]["financement"]["tpl"]);
} }
?> ?>
......
...@@ -7,8 +7,8 @@ uses a classic costum engine with a json associated ...@@ -7,8 +7,8 @@ uses a classic costum engine with a json associated
editable blocks in the *costumTpl* are made editable like this editable blocks in the *costumTpl* are made editable like this
``` ```
<?php <?php
if(isset(Yii::app()->session["costum"]["cms"]["title1"])){ if(isset($this->costum["cms"]["title1"])){
echo htmlentities(Yii::app()->session["costum"]["cms"]["title1"]); echo htmlentities($this->costum["cms"]["title1"]);
} else { ?> Open Form <?php } } else { ?> Open Form <?php }
if($canEdit) if($canEdit)
echo "<a class='btn btn-xs btn-danger editBtn' href='javascript:;' data-key='title1' data-path='costum.cms.title1'><i class='fa fa-pencil'></i></a>"; echo "<a class='btn btn-xs btn-danger editBtn' href='javascript:;' data-key='title1' data-path='costum.cms.title1'><i class='fa fa-pencil'></i></a>";
......
...@@ -43,7 +43,7 @@ isMultiForms ...@@ -43,7 +43,7 @@ isMultiForms
initValues : contains any dyfinputs initial data initValues : contains any dyfinputs initial data
answerObj : contains answer data for the current form answerObj : contains answer data for the current form
** to edit costum page pieces ** to edit costum page pieces
var configDynForm = <?php echo json_encode(Yii::app()->session['costum']['dynForm']); ?>; var configDynForm = <?php echo json_encode($this->costum['dynForm']); ?>;
** information and structure of the form in this page ** information and structure of the form in this page
var formInputs = <?php echo json_encode($form['inputs']); ?>; var formInputs = <?php echo json_encode($form['inputs']); ?>;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<?php <?php
$editBtnL = ($canAnswer) ? " <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> <a href='javascript:;' data-id='".Yii::app()->request->getQuery("answer")."' data-collection='answers' data-path='answers.sommomForm1.sommomForm122.' class='addorganismesommomForm122 btn btn-default'><i class='fa fa-plus'></i> Ajouter un organisme </a>" : ""; $editBtnL = ($canAnswer) ? " <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> <a href='javascript:;' data-id='".Yii::app()->request->getQuery("answer")."' data-collection='answers' data-path='answers.sommomForm1.sommomForm122.' class='addorganismesommomForm122 btn btn-default'><i class='fa fa-plus'></i> Ajouter un organisme </a>" : "";
$editParamsBtn = ($canEdit) ? " <a href='javascript:;' data-id='".$el["_id"]."' data-collection='".Yii::app()->session["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 = ($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>" : "";
$paramsData = [ $paramsData = [
"type" => [ "type" => [
...@@ -52,8 +52,8 @@ ...@@ -52,8 +52,8 @@
} }
} }
if( isset(Yii::app()->session["costum"]["form"]["params"][$kunik]["ocean"]) ) if( isset($this->costum["form"]["params"][$kunik]["ocean"]) )
$paramsData["ocean"] = Yii::app()->session["costum"]["form"]["params"][$kunik]["ocean"]; $paramsData["ocean"] = $this->costum["form"]["params"][$kunik]["ocean"];
$l = PHDB::findOne(Lists::COLLECTION, array('name' => 'cetaces')); $l = PHDB::findOne(Lists::COLLECTION, array('name' => 'cetaces'));
$i=1; $i=1;
...@@ -121,14 +121,14 @@ ...@@ -121,14 +121,14 @@
foreach ($properties as $k => $v) { foreach ($properties as $k => $v) {
if( isset($v["label"])){ if( isset($v["label"])){
if( isset(Yii::app()->session["costum"]["form"]["params"][$kunik]["labels"][$k]) ) if( isset($this->costum["form"]["params"][$kunik]["labels"][$k]) )
$properties[$k]["label"] = Yii::app()->session["costum"]["form"]["params"][$kunik]["labels"][$k]; $properties[$k]["label"] = $this->costum["form"]["params"][$kunik]["labels"][$k];
$propertiesParams["labels"][$k] = $properties[$k]["label"]; $propertiesParams["labels"][$k] = $properties[$k]["label"];
} }
if( isset($v["placeholder"])){ if( isset($v["placeholder"])){
if(isset(Yii::app()->session["costum"]["form"]["params"][$kunik]["placeholders"][$k]) ) if(isset($this->costum["form"]["params"][$kunik]["placeholders"][$k]) )
$properties[$k]["placeholder"] = Yii::app()->session["costum"]["form"]["params"][$kunik]["placeholders"][$k]; $properties[$k]["placeholder"] = $this->costum["form"]["params"][$kunik]["placeholders"][$k];
$propertiesParams["placeholders"][$k] = $properties[$k]["placeholder"]; $propertiesParams["placeholders"][$k] = $properties[$k]["placeholder"];
} }
} }
......
...@@ -12,10 +12,10 @@ $paramsData = [ "title" => "", ...@@ -12,10 +12,10 @@ $paramsData = [ "title" => "",
"tags" => "structags" "tags" => "structags"
]; ];