Commit 3179ae6b authored by Tibor Katelbach's avatar Tibor Katelbach
Browse files

auto config when on ly one budget

parent 04f70de0
......@@ -3,6 +3,9 @@
if( isset($this->costum["form"]["params"][$kunik]["budgetCopy"]) )
$copy = $this->costum["form"]["params"][$kunik]["budgetCopy"];
else if( count(Yii::app()->session["budgetInputList"]) == 1 )
$copy = array_keys( Yii::app()->session["budgetInputList"])[0];
//var_dump($copy);
$copyT = explode(".", $copy);
$copyF = $copyT[0];
......@@ -287,6 +290,8 @@ if( isset($this->costum["form"]["params"]["financement"]["tpl"])){
<script type="text/javascript">
if(typeof costum.lists == "undefined")
costum.lists = {};
if(typeof costum.lists == "undefined")
costum.lists.budgetInputList = <?php echo json_encode( Yii::app()->session["budgetInputList"] ); ?>;
//costum.lists.financerTypeList = <?php //echo json_encode(Ctenat::$financerTypeList); ?>;
costum.lists.workerList = <?php echo json_encode($orgs); ?>;
......
......@@ -4,6 +4,8 @@ $copy = "opalProcess1.depense";
if( isset($this->costum["form"]["params"][$kunik]["budgetCopy"]) )
$copy = $this->costum["form"]["params"][$kunik]["budgetCopy"];
else if( count(Yii::app()->session["budgetInputList"]) == 1 )
$copy = array_keys( Yii::app()->session["budgetInputList"])[0];
//var_dump($copy);
$copyT = explode(".", $copy);
$copyF = $copyT[0];
......@@ -112,7 +114,7 @@ foreach ( $amounts as $k => $l) {
<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($budgetKey) )
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>
......@@ -403,6 +405,8 @@ if( isset($this->costum["form"]["params"]["financement"]["tpl"])){
<script type="text/javascript">
if(typeof costum.lists == "undefined")
costum.lists = {};
if(typeof costum.lists == "undefined")
costum.lists.budgetInputList = <?php echo json_encode( Yii::app()->session["budgetInputList"] ); ?>;
costum.lists.financerTypeList = <?php echo json_encode(Ctenat::$financerTypeList); ?>;
costum.lists.financersList = <?php echo json_encode($orgs); ?>;
......
......@@ -24,6 +24,8 @@ if($answer){
$copy = "opalProcess1.depense";
if( isset($this->costum["form"]["params"][$kunik]["budgetCopy"]) )
$copy = $this->costum["form"]["params"][$kunik]["budgetCopy"];
else if( count(Yii::app()->session["budgetInputList"]) == 1 )
$copy = array_keys( Yii::app()->session["budgetInputList"])[0];
//var_dump($copy);
$copyT = explode(".", $copy);
$copyF = $copyT[0];
......@@ -539,6 +541,9 @@ if( isset($this->costum["form"]["params"]["financement"]["tpl"])){
<script type="text/javascript">
if(typeof costum.lists == "undefined")
costum.lists = {};
if(typeof costum.lists == "undefined")
costum.lists.budgetInputList = <?php echo json_encode( Yii::app()->session["budgetInputList"] ); ?>;
//costum.lists.financerTypeList = <?php //echo json_encode(Ctenat::$financerTypeList); ?>;
costum.lists.workerList = <?php echo json_encode($orgs); ?>;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment