Commit 72ae2f8e authored by Tibor Katelbach's avatar Tibor Katelbach

replace ccostum['form'] by parentForm and $_Get

parent cf89cae7
......@@ -33,7 +33,7 @@ class IndexAction extends CAction
// TODO améliorer getdataForAnser pour soit viré la création de lanswers soit charger la bonne answer
$form = PHDB::findOne( Form::COLLECTION , array("id"=>$answer["formId"]));
$form = PHDB::findOne( Form::COLLECTION , array("id"=>$_GET["form"]));
$parentForm = Slug::getElementBySlug($form["id"]);
$canEditForm = false;
$canEditAnswer = false;
......@@ -66,7 +66,7 @@ class IndexAction extends CAction
$params["canSee"] = $canSeeAnswer;
$params["mode"] = (!empty($mode) ? $mode : "r");
//$tpl=(!empty($tpl)) ? $tpl : "survey.views.tpls.forms.formWizard";
$tpl=(!empty($this->getController()->costum["form"]["tpl"])) ? $this->getController()->costum["form"]["tpl"] : "survey.views.tpls.forms.formWizard";
$tpl=(!empty($form["tpl"])) ? $form["tpl"] : "survey.views.tpls.forms.formWizard";
echo $this->getController()->renderPartial($tpl,$params );
} else {
if(Yii::app()->request->isAjaxRequest)
......
......@@ -10,7 +10,7 @@ class Answer{
}
public static function generateAnswer(){
public static function generateAnswer($formId){
$costum = CacheHelper::getCostum();
//Rest::json($costum); exit;
$ans = [
......
......@@ -708,7 +708,7 @@ class Form {
}
//if(isset($_GET["form"]))
$form = (isset($costum["form"])) ? $costum["form"] : PHDB::findOne( Form::COLLECTION, [ "_id" => new MongoId($_GET["form"]) ] );
$form = PHDB::findOne( Form::COLLECTION, [ "_id" => new MongoId($_GET["form"]) ] );
$params["parentForm"] = $form;
if(isset($costum["hasOpenForm"]))
......@@ -774,58 +774,6 @@ class Form {
if( $answer == null && count( $myAnswers ) > 1 && !$params["canEdit"] )
$showForm = false;
//si aucune reponse existe
//et qu'on a des input complexe alors on génere une answer
// if( !isset($_GET['answer']) && $answer == null ){
// if(isset($params["formList"])){
// $generateAnswer = true;
// }
// else if(isset($form["inputs"])){
// foreach ($form["inputs"] as $key => $inp)
// {
// if( stripos( $inp["type"] , "tpls.forms.cplx" ) !== false )
// $generateAnswer = true;
// }
// }
// }
// if( isset($answerId) && $answerId == "new" )
// $generateAnswer = true;
//on pré genere un anwser que quand il n'y en pas
//pour permettre le save onBlur , ou s'il y a des cplx forms
//il ne peut y avoir qu'un seul answer en cours simultanement
//on pré genere un anwser que quand il n'y en pas
//pour permettre le save onBlur , ou s'il y a des cplx forms
//il ne peut y avoir qu'un seul answer en cours simultanement
///TODO purger ANSwers via CRON
// if( $generateAnswer )
// {
// //var_dump("create new" );
// $ans = [
// "formId" => $params["formId"],
// "user" => Yii::app()->session["userId"],
// "parentSlug" => $params["el"]["slug"],
// "links"=>[
// "answered" => [ Yii::app()->session["userId"] ] ,
// //proposed ,particpated,decision,financed,financed,referenced,commented,worked,payed,tested,validated
// //each actor is connectable to his activitystream
// ],
// "created" => time()
// ];
// if(isset($params["formList"]))
// $ans["formList"] = count($params["formList"]);
// PHDB::insert(Form::ANSWER_COLLECTION, $ans);
// $answer = PHDB::findOne( Form::ANSWER_COLLECTION, [ "_id" => new MongoId($ans["_id"]) ] );
// }
// var_dump($params["el"]["slug"] );
// var_dump($params["formId"] );
// var_dump($answer );
// var_dump(Yii::app()->getRequest()->getQuery('answer'));
// exit;
$params["answer"] = $answer;
$params["showForm"] = $showForm;
......
......@@ -267,12 +267,12 @@ if(!empty($canEdit))
?>
</h1>
<div class="text-center">
<?php if(isset($this->costum["form"]["startDate"])){ ?>
Démarrage : <?php echo $this->costum["form"]["startDate"]; ?>
<?php if(isset($parentForm["startDate"])){ ?>
Démarrage : <?php echo $parentForm["startDate"]; ?>
<?php }
if(isset($this->costum["form"]["endDate"])){ ?>
et se termine : <?php echo $this->costum["form"]["endDate"]; ?>
if(isset($parentForm["endDate"])){ ?>
et se termine : <?php echo $parentForm["endDate"]; ?>
<?php } ?>
</div>
</div>
......
......@@ -17,11 +17,11 @@
if( stripos( $inp["type"] , "tpls.forms." ) === false )
echo "<th class='text-center'>".$inp["label"]."</th>";
}
if(isset($this->costum["form"]["showDate"]))
if(isset($parentForm["showDate"]))
echo "<th class='text-center'>Date</th>";
if(isset($this->costum["form"]["canVote"]))
if(isset($parentForm["canVote"]))
echo "<th class='text-center'>Vote</th>";
if(isset($this->costum["form"]["canFund"]))
if(isset($parentForm["canFund"]))
echo "<th class='text-center'>Fund</th>";
echo "<th class='text-center'>Action</th>";
echo "</tr>";
......@@ -36,8 +36,8 @@
foreach ($form['inputs'] as $k => $inp) {
if( stripos( $inp["type"] , "tpls.forms." ) === false )
echo "<td class='text-center'>".@$a["answers"][$k]."</td>";
if(isset($this->costum["form"]["sumColumns"]) &&
in_array($k, $this->costum["form"]["sumColumns"]) &&
if(isset($parentForm["sumColumns"]) &&
in_array($k, $parentForm["sumColumns"]) &&
isset($a["answers"][$k]) &&
is_numeric($a["answers"][$k]) ){
if(!isset($sum[$k]))
......@@ -46,17 +46,17 @@
}
}
if(isset($this->costum["form"]["showDate"]))
if(isset($parentForm["showDate"]))
echo "<td>".date('Y-m-d',$a['created'])."</td>";
if(isset($this->costum["form"]["canVote"])){
if(isset($parentForm["canVote"])){
echo "<td class='text-center'>";
echo "<a href='javascript:;' class='voteBtn btn btn-default'><i class='fa text-red fa-thumbs-up'></i> </a>";
echo "<a href='javascript:;' class='voteListBtn btn btn-default'>".@$a["voteUpCount"]." <i class='fa text-red fa-bars'></i> </a>";
echo "</td>";
}
if(isset($this->costum["form"]["canFund"])){
if(isset($parentForm["canFund"])){
echo "<td class='text-center'>";
$totalFund = "";
if(isset($a["fund"])){
......@@ -74,7 +74,7 @@
echo "<td class='bg-red'>";
if(isset($this->costum["form"]["canModifyAnswer"]))
if(isset($parentForm["canModifyAnswer"]))
echo "<a href='".Yii::app()->createUrl("/costum/co/index/slug/".$slug."/answer/".$a["_id"])."' class='btn btn-default'><i class='fa text-red fa-pencil'></i> </a>";
echo "<a href='javascript:;' data-id='".$a['_id']."' class='deleteAnswer btn btn-default'><i class='fa text-red fa-trash'></i> </a>";
......@@ -84,7 +84,7 @@
}
}
if(isset($this->costum["form"]["sumColumns"])){
if(isset($parentForm["sumColumns"])){
echo "<tr>";
echo "<td class='bold'>SOMME</td>";
foreach ($form['inputs'] as $k => $inp) {
......@@ -95,11 +95,11 @@
echo "</td>";
}
}
if(isset($this->costum["form"]["showDate"]))
if(isset($parentForm["showDate"]))
echo "<td></td>";
if(isset($this->costum["form"]["canVote"]))
if(isset($parentForm["canVote"]))
echo "<td></td>";
if(isset($this->costum["form"]["canFund"]))
if(isset($parentForm["canFund"]))
echo "<td></td>";
echo "<td></td>";
echo "</tr>";
......
......@@ -22,14 +22,14 @@ $paramsData = [
"estimate" => false
];
if( isset($this->costum["form"]["params"][$kunik]["group"]) )
$paramsData["group"] = $this->costum["form"]["params"][$kunik]["group"];
if( isset($this->costum["form"]["params"][$kunik]["nature"]) )
$paramsData["nature"] = $this->costum["form"]["params"][$kunik]["nature"];
if( isset($this->costum["form"]["params"][$kunik]["amounts"]) )
$paramsData["amounts"] = $this->costum["form"]["params"][$kunik]["amounts"];
if( isset($this->costum["form"]["params"][$kunik]["estimate"]) )
$paramsData["estimate"] = $this->costum["form"]["params"][$kunik]["estimate"];
if( isset($parentForm["params"][$kunik]["group"]) )
$paramsData["group"] = $parentForm["params"][$kunik]["group"];
if( isset($parentForm["params"][$kunik]["nature"]) )
$paramsData["nature"] = $parentForm["params"][$kunik]["nature"];
if( isset($parentForm["params"][$kunik]["amounts"]) )
$paramsData["amounts"] = $parentForm["params"][$kunik]["amounts"];
if( isset($parentForm["params"][$kunik]["estimate"]) )
$paramsData["estimate"] = $parentForm["params"][$kunik]["estimate"];
// if(isset($answers)){
// foreach ($answers as $q => $a) {
......
......@@ -30,7 +30,7 @@
"01/07/2022",
"01/01/2023"
]];
$dateSections = (isset($this->costum["form"]["params"][$kunik]["dateSections"])) ? $this->costum["form"]["params"][$kunik]["dateSections"] : $paramsData["dateSections"] ;
$dateSections = (isset($parentForm["params"][$kunik]["dateSections"])) ? $parentForm["params"][$kunik]["dateSections"] : $paramsData["dateSections"] ;
$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>" : "";
......@@ -47,7 +47,7 @@
<th>Actions<br/>
</th>
<?php
$sectionTitles = (isset($this->costum["form"]["params"][$kunik]["sectionTitles"])) ? $this->costum["form"]["params"][$kunik]["sectionTitles"] : $paramsData["sectionTitles"];
$sectionTitles = (isset($parentForm["params"][$kunik]["sectionTitles"])) ? $parentForm["params"][$kunik]["sectionTitles"] : $paramsData["sectionTitles"];
foreach ($sectionTitles as $i => $lbl) {
echo "<th>".$lbl."</th>";
} ?>
......@@ -189,7 +189,7 @@ $(document).ready(function() {
}
};
sectionDyf.<?php echo $kunik?>ParamsData = <?php echo json_encode( ( isset($this->costum["form"]["params"][$kunik]) ) ? $this->costum["form"]["params"][$kunik] : $paramsData); ?>;
sectionDyf.<?php echo $kunik?>ParamsData = <?php echo json_encode( ( isset($parentForm["params"][$kunik]) ) ? $parentForm["params"][$kunik] : $paramsData); ?>;
mylog.log("render","/modules/costum/views/tpls/forms/<?php echo $kunik ?>.php");
......
<?php if($answer){
$copy = "opalProcess1.depense";
if( isset($this->costum["form"]["params"][$kunik]["budgetCopy"]) )
$copy = $this->costum["form"]["params"][$kunik]["budgetCopy"];
if( isset($parentForm["params"][$kunik]["budgetCopy"]) )
$copy = $parentForm["params"][$kunik]["budgetCopy"];
else if( count(Yii::app()->session["budgetInputList"]) == 1 )
$copy = array_keys( Yii::app()->session["budgetInputList"])[0];
......@@ -42,13 +42,13 @@ $paramsData = [
]
];
if( isset($this->costum["form"]["params"][$kunik]) ) {
if( isset($this->costum["form"]["params"][$budgetKey]["group"]) )
$paramsData["group"] = $this->costum["form"]["params"][$budgetKey]["group"];
if( isset($this->costum["form"]["params"][$budgetKey]["nature"]) )
$paramsData["nature"] = $this->costum["form"]["params"][$budgetKey]["nature"];
if( isset($this->costum["form"]["params"][$budgetKey]["amounts"]) )
$paramsData["amounts"] = $this->costum["form"]["params"][$kunik]["amounts"];
if( isset($parentForm["params"][$kunik]) ) {
if( isset($parentForm["params"][$budgetKey]["group"]) )
$paramsData["group"] = $parentForm["params"][$budgetKey]["group"];
if( isset($parentForm["params"][$budgetKey]["nature"]) )
$paramsData["nature"] = $parentForm["params"][$budgetKey]["nature"];
if( isset($parentForm["params"][$budgetKey]["amounts"]) )
$paramsData["amounts"] = $parentForm["params"][$kunik]["amounts"];
}
$communityLinks = Element::getCommunityByTypeAndId($this->costum["contextType"],$this->costum["contextId"]);
......@@ -101,7 +101,7 @@ $properties["votes"] = [
<tr>
<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;
if( !isset($this->costum["form"]["params"][$kunik]["budgetCopy"]) )
if( !isset($parentForm["params"][$kunik]["budgetCopy"]) )
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>
</tr>
......@@ -277,13 +277,13 @@ echo "<h4 style='color:".(($titleColor) ? $titleColor : "black")."'>Décision Gl
<?php
if( isset($this->costum["form"]["params"]["financement"]["tpl"])){
//if( $this->costum["form"]["params"]["financement"]["tpl"] == "tpls.forms.equibudget" )
$this->renderPartial( "costum.views.".$this->costum["form"]["params"]["financement"]["tpl"] ,
if( isset($parentForm["params"]["financement"]["tpl"])){
//if( $parentForm["params"]["financement"]["tpl"] == "tpls.forms.equibudget" )
$this->renderPartial( "costum.views.".$parentForm["params"]["financement"]["tpl"] ,
[ "totalFin" => $total,
"totalBudg" => Yii::app()->session["totalBudget"]["totalBudget"] ] );
// else
// $this->renderPartial( "costum.views.".$this->costum["form"]["params"]["financement"]["tpl"]);
// $this->renderPartial( "costum.views.".$parentForm["params"]["financement"]["tpl"]);
}
?>
......
......@@ -15,8 +15,8 @@ $paramsData = [ "nature" => [
"fonctionnement" => "Fonctionnement"
] ];
if( isset($this->costum["form"]["params"][$keyTpl]) )
$paramsData = $this->costum["form"]["params"][$keyTpl];
if( isset($parentForm["params"][$keyTpl]) )
$paramsData = $parentForm["params"][$keyTpl];
$properties = [
"nature" => [
......
......@@ -33,9 +33,9 @@
],
"limit" => 0 ];
if( isset($this->costum["form"]["params"][$kunik]) ) {
if( isset($this->costum["form"]["params"][$kunik]["limit"]) )
$paramsData["limit"] = $this->costum["form"]["params"][$kunik]["limit"];
if( isset($parentForm["params"][$kunik]) ) {
if( isset($parentForm["params"][$kunik]["limit"]) )
$paramsData["limit"] = $parentForm["params"][$kunik]["limit"];
}
$properties = [
......@@ -50,7 +50,7 @@
];
$editBtnL = (Yii::app()->session["userId"] == $answer["user"]
&& isset($this->costum["form"]["params"][$kunik])
&& isset($parentForm["params"][$kunik])
&& ( $paramsData["limit"] == 0 ||
!isset($answer["answers"][$kunik]) ||
( isset($answer["answers"][$kunik]) && $paramsData["limit"] > count($answer["answers"][$kunik]) )))
......@@ -63,7 +63,7 @@
<tr>
<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;
if( !isset($this->costum["form"]["params"][$kunik]['type']) )
if( !isset($parentForm["params"][$kunik]['type']) )
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>";
?>
......@@ -142,7 +142,7 @@ $(document).ready(function() {
connectToAnswer : function ( data ) {
mylog.log("costum.<?php echo $kunik ?>.connectToAnswer",data)
tplCtx.value = {
type : (data.type) ? data.type : "<?php echo (isset($this->costum["form"]["params"][$kunik]['type'])) ? $this->costum["form"]["params"][$kunik]['type'] : ''; ?>",
type : (data.type) ? data.type : "<?php echo (isset($parentForm["params"][$kunik]['type'])) ? $parentForm["params"][$kunik]['type'] : ''; ?>",
id : data.id,
slug : data.map.slug
};
......@@ -186,11 +186,11 @@ $(document).ready(function() {
inputType : "select",
label : "Définir un type d'élément",
options : sectionDyf.<?php echo $kunik ?>ParamsData.type,
value : "<?php echo (isset($this->costum["form"]["params"][$kunik]['type'])) ? $this->costum["form"]["params"][$kunik]['type'] : ''; ?>"
value : "<?php echo (isset($parentForm["params"][$kunik]['type'])) ? $parentForm["params"][$kunik]['type'] : ''; ?>"
},
limit : {
label : "Combien d'éléments peuvent être ajoutés (0 si pas de limite)",
value : "<?php echo (isset($this->costum["form"]["params"][$kunik]['limit'])) ? $this->costum["form"]["params"][$kunik]['limit'] : ''; ?>"
value : "<?php echo (isset($parentForm["params"][$kunik]['limit'])) ? $parentForm["params"][$kunik]['limit'] : ''; ?>"
}
},
save : function () {
......@@ -218,19 +218,19 @@ $(document).ready(function() {
//adds a line into answer
<?php if( isset($this->costum["form"]["params"][$kunik]['type']) ) { ?>
<?php if( isset($parentForm["params"][$kunik]['type']) ) { ?>
$(".add<?php echo $keyTpl ?>").off().on("click",function() {
tplCtx.id = $(this).data("id");
tplCtx.collection = $(this).data("collection");
tplCtx.path = $(this).data("path")+((notNull(<?php echo $kunik ?>Data) ? <?php echo $kunik ?>Data.length : "0"));
dyFObj.openForm( "<?php echo Element::getControlerByCollection($this->costum["form"]["params"][$kunik]['type']); ?>",null,null,null,costum.<?php echo $kunik ?> );
dyFObj.openForm( "<?php echo Element::getControlerByCollection($parentForm["params"][$kunik]['type']); ?>",null,null,null,costum.<?php echo $kunik ?> );
});
$(".edit<?php echo $keyTpl ?>").off().on("click",function() {
tplCtx.id = $(this).data("id");
tplCtx.collection = $(this).data("collection");
tplCtx.path = $(this).data("path");
dyFObj.openForm( "<?php echo $this->costum["form"]["params"][$kunik]['type']; ?>",null, <?php echo $keyTpl ?>Data[$(this).data("key")]);
dyFObj.openForm( "<?php echo $parentForm["params"][$kunik]['type']; ?>",null, <?php echo $keyTpl ?>Data[$(this).data("key")]);
});
<?php } ?>
......
......@@ -5,7 +5,7 @@
<?php
$editBtnL = (Yii::app()->session["userId"] == $answer["user"] && isset($this->costum["form"]["params"][$keyTpl.$key]) ) ? " <a href='javascript:;' data-id='".$answer["_id"]."' data-collection='".Form::ANSWER_COLLECTION."' data-path='answers.".$keyTpl.$key.".' class='add".$keyTpl." btn btn-default'><i class='fa fa-plus'></i> Ajouter un élément </a>" : "";
$editBtnL = (Yii::app()->session["userId"] == $answer["user"] && isset($parentForm["params"][$keyTpl.$key]) ) ? " <a href='javascript:;' data-id='".$answer["_id"]."' data-collection='".Form::ANSWER_COLLECTION."' data-path='answers.".$keyTpl.$key.".' class='add".$keyTpl." btn btn-default'><i class='fa fa-plus'></i> Ajouter un élément </a>" : "";
$editParamsBtn = ($canEdit) ? " <a href='javascript:;' data-id='".$el["_id"]."' data-collection='".$this->costum["contextType"]."' data-path='costum.form.params.".$keyTpl.$key."' class='previewTpl edit".$keyTpl."Params btn btn-xs btn-danger'><i class='fa fa-cog'></i> </a>" : "";
......@@ -51,7 +51,7 @@
<tr>
<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;
if( !isset($this->costum["form"]["params"][$keyTpl.$key]['type']) )
if( !isset($parentForm["params"][$keyTpl.$key]['type']) )
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>";
?>
......@@ -150,19 +150,19 @@ $(document).ready(function() {
//adds a line into answer
<?php if( isset($this->costum["form"]["params"][$keyTpl.$key]['type']) ) { ?>
<?php if( isset($parentForm["params"][$keyTpl.$key]['type']) ) { ?>
$(".add<?php echo $keyTpl ?>").off().on("click",function() {
tplCtx.id = $(this).data("id");
tplCtx.collection = $(this).data("collection");
tplCtx.path = $(this).data("path")+((notNull(<?php echo $keyTpl ?>Data) ? <?php echo $keyTpl ?>Data.length : "0"));
dyFObj.openForm( "<?php echo $this->costum["form"]["params"][$keyTpl.$key]['type']; ?>" );
dyFObj.openForm( "<?php echo $parentForm["params"][$keyTpl.$key]['type']; ?>" );
});
$(".edit<?php echo $keyTpl ?>").off().on("click",function() {
tplCtx.id = $(this).data("id");
tplCtx.collection = $(this).data("collection");
tplCtx.path = $(this).data("path");
dyFObj.openForm( "<?php echo $this->costum["form"]["params"][$keyTpl.$key]['type']; ?>",null, <?php echo $keyTpl ?>Data[$(this).data("key")]);
dyFObj.openForm( "<?php echo $parentForm["params"][$keyTpl.$key]['type']; ?>",null, <?php echo $keyTpl ?>Data[$(this).data("key")]);
});
<?php } ?>
......
......@@ -17,10 +17,10 @@
if( !empty($or["links"]["memberOf"][$this->costum["contextId"]]["roles"]) ) {
foreach ($financers as $id => $or) {
$roles = $or["links"]["memberOf"][$this->costum["contextId"]]["roles"];
if( isset($this->costum["form"]["params"][$kunik]["limitRoles"]) && !empty($roles))
if( isset($parentForm["params"][$kunik]["limitRoles"]) && !empty($roles))
{
foreach ($roles as $i => $r) {
if( in_array($r, $this->costum["form"]["params"][$kunik]["limitRoles"]) )
if( in_array($r, $parentForm["params"][$kunik]["limitRoles"]) )
$orgs[$id] = $or["name"];
}
}
......@@ -34,13 +34,13 @@
"limitRoles" =>["Financeur"]
];
if( isset($this->costum["form"]["params"][$kunik]) ) {
if( isset($this->costum["form"]["params"][$kunik]["tpl"]) )
$paramsData["tpl"] = $this->costum["form"]["params"][$kunik]["tpl"];
if( isset($this->costum["form"]["params"][$kunik]["financerTypeList"]) )
$paramsData["financerTypeList"] = $this->costum["form"]["params"][$kunik]["financerTypeList"];
if( isset($this->costum["form"]["params"][$kunik]["limitRoles"]) )
$paramsData["financersList"] = $this->costum["form"]["params"][$kunik]["limitRoles"];
if( isset($parentForm["params"][$kunik]) ) {
if( isset($parentForm["params"][$kunik]["tpl"]) )
$paramsData["tpl"] = $parentForm["params"][$kunik]["tpl"];
if( isset($parentForm["params"][$kunik]["financerTypeList"]) )
$paramsData["financerTypeList"] = $parentForm["params"][$kunik]["financerTypeList"];
if( isset($parentForm["params"][$kunik]["limitRoles"]) )
$paramsData["financersList"] = $parentForm["params"][$kunik]["limitRoles"];
}
$properties = [
......@@ -197,13 +197,13 @@ if($total > 0){
</div>
<?php
if( isset($this->costum["form"]["params"]["financement"]["tpl"])){
//if( $this->costum["form"]["params"]["financement"]["tpl"] == "tpls.forms.equibudget" )
$this->renderPartial( "costum.views.".$this->costum["form"]["params"]["financement"]["tpl"] ,
if( isset($parentForm["params"]["financement"]["tpl"])){
//if( $parentForm["params"]["financement"]["tpl"] == "tpls.forms.equibudget" )
$this->renderPartial( "costum.views.".$parentForm["params"]["financement"]["tpl"] ,
[ "totalFin" => $total,
"totalBudg" => Yii::app()->session["totalBudget"]["totalBudget"] ] );
// else
// $this->renderPartial( "costum.views.".$this->costum["form"]["params"]["financement"]["tpl"]);
// $this->renderPartial( "costum.views.".$parentForm["params"]["financement"]["tpl"]);
}
?>
......
......@@ -2,8 +2,8 @@
$copy = "opalProcess1.depense";
if( isset($this->costum["form"]["params"][$kunik]["budgetCopy"]) )
$copy = $this->costum["form"]["params"][$kunik]["budgetCopy"];
if( isset($parentForm["params"][$kunik]["budgetCopy"]) )
$copy = $parentForm["params"][$kunik]["budgetCopy"];
else if( count(Yii::app()->session["budgetInputList"]) == 1 )
$copy = array_keys( Yii::app()->session["budgetInputList"])[0];
......@@ -37,17 +37,17 @@ $paramsData = [
"openFinancing" => true
];
if( isset($this->costum["form"]["params"][$kunik]) ) {
if( isset($this->costum["form"]["params"][$kunik]["tpl"]) )
$paramsData["tpl"] = $this->costum["form"]["params"][$kunik]["tpl"];
if( isset($this->costum["form"]["params"][$kunik]["budgetCopy"]) )
$paramsData["budgetCopy"] = $this->costum["form"]["params"][$kunik]["budgetCopy"];
if( isset($this->costum["form"]["params"][$kunik]["financerTypeList"]) )
$paramsData["financerTypeList"] = $this->costum["form"]["params"][$kunik]["financerTypeList"];
if( isset($this->costum["form"]["params"][$kunik]["limitRoles"]) )
$paramsData["limitRoles"] = $this->costum["form"]["params"][$kunik]["limitRoles"];
if( isset($this->costum["form"]["params"][$kunik]["openFinancing"]) )
$paramsData["openFinancing"] = $this->costum["form"]["params"][$kunik]["openFinancing"];
if( isset($parentForm["params"][$kunik]) ) {
if( isset($parentForm["params"][$kunik]["tpl"]) )
$paramsData["tpl"] = $parentForm["params"][$kunik]["tpl"];
if( isset($parentForm["params"][$kunik]["budgetCopy"]) )
$paramsData["budgetCopy"] = $parentForm["params"][$kunik]["budgetCopy"];
if( isset($parentForm["params"][$kunik]["financerTypeList"]) )
$paramsData["financerTypeList"] = $parentForm["params"][$kunik]["financerTypeList"];
if( isset($parentForm["params"][$kunik]["limitRoles"]) )
$paramsData["limitRoles"] = $parentForm["params"][$kunik]["limitRoles"];
if( isset($parentForm["params"][$kunik]["openFinancing"]) )
$paramsData["openFinancing"] = $parentForm["params"][$kunik]["openFinancing"];
}
$communityLinks = Element::getCommunityByTypeAndId($this->costum["contextType"],$this->costum["contextId"]);
......@@ -95,7 +95,7 @@ $properties = [
"size" => 6,
]
];
$amounts = (isset($this->costum["form"]["params"][$budgetKey]["amounts"])) ? $this->costum["form"]["params"][$budgetKey]["amounts"] : ["price" => "Montant Financé"] ;
$amounts = (isset($parentForm["params"][$budgetKey]["amounts"])) ? $parentForm["params"][$budgetKey]["amounts"] : ["price" => "Montant Financé"] ;
foreach ( $amounts as $k => $l) {
$properties[$k] = [ "inputType" => "text",
"label" => $l,
......@@ -183,13 +183,13 @@ echo $this->renderPartial("survey.views.tpls.forms.cplx.financementFromBudgetTab
<?php
if( isset($this->costum["form"]["params"]["financement"]["tpl"])){
//if( $this->costum["form"]["params"]["financement"]["tpl"] == "tpls.forms.equibudget" )
$this->renderPartial( "costum.views.".$this->costum["form"]["params"]["financement"]["tpl"] ,
if( isset($parentForm["params"]["financement"]["tpl"])){
//if( $parentForm["params"]["financement"]["tpl"] == "tpls.forms.equibudget" )
$this->renderPartial( "costum.views.".$parentForm["params"]["financement"]["tpl"] ,
[ "totalFin" => $total,
"totalBudg" => Yii::app()->session["totalBudget"]["totalBudget"] ] );
// else
// $this->renderPartial( "costum.views.".$this->costum["form"]["params"]["financement"]["tpl"]);
// $this->renderPartial( "costum.views.".$parentForm["params"]["financement"]["tpl"]);
}
?>
<?php if($mode != "pdf"){ ?>
......
......@@ -22,8 +22,8 @@ $paramsData = [ "titles" => [ "Indicateur",
//temporaire car specific au CTE
$indicateurs = Ctenat::getIndicator();
if( isset($this->costum["form"]["params"][$keyTpl]) )
$paramsData = $this->costum["form"][<