Commit 3d147fd3 authored by Tibor Katelbach's avatar Tibor Katelbach
Browse files

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

parents 5c5f9f46 222760aa
......@@ -28,7 +28,7 @@ class IndexAction extends CAction
//Rest::json($params); exit;
$params = Form::getDataForAnswer($params);
//var_dump(Yii::app()->session["budgetInputList"]); exit;
//Rest::json($params); exit;
$params["answer"] = $answer;
// TODO améliorer getdataForAnser pour soit viré la création de lanswers soit charger la bonne answer
......
......@@ -698,8 +698,11 @@ class Form {
//var_dump(Yii::app()->session['costum']);exit;
//WARNING
$costum = CacheHelper::getCostum();
if(isset($costum["contextType"]) && isset($costum["contextId"]))
$params["el"] = Element::getByTypeAndId($costum["contextType"], $costum["contextId"] );
if(isset($costum["contextType"]) && isset($costum["contextId"])){
$params["el"] = Element::getByTypeAndId($costum["contextType"], $costum["contextId"] );
$params["el"]["id"] = $costum["contextId"];
}
if(isset($costum["hasOpenForm"])){
......
......@@ -19,7 +19,7 @@ if($wizard){
} else if( isset($answer["answers"][$copyF][$budgetKey]) && count($answer["answers"][$copyF][$budgetKey])>0 )
$answers = $answer["answers"][$copyF][$kunik];
} else {
if($budgetKey)
if(!empty($budgetKey) && !empty($answer["answers"][$budgetKey]) )
$answers = $answer["answers"][$budgetKey];
else if(isset($answer["answers"][$kunik]))
$answers = $answer["answers"][$kunik];
......@@ -27,7 +27,7 @@ if($wizard){
$editBtnL = "";
$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>" : "";
......
......@@ -41,7 +41,7 @@ if($answer){
} else if( isset($answer["answers"][$copyF][$budgetKey]) && count($answer["answers"][$copyF][$budgetKey])>0 )
$answers = $answer["answers"][$copyF][$kunik];
} else {
if($budgetKey)
if(!empty($budgetKey) && !empty($answer["answers"][$budgetKey]))
$answers = $answer["answers"][$budgetKey];
else if(isset($answer["answers"][$kunik]))
$answers = $answer["answers"][$kunik];
......@@ -49,7 +49,7 @@ if($answer){
$editBtnL = "";
$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 = [
......
......@@ -106,6 +106,7 @@ if( isset( $form["inputs"] ) ){ ?>
"kunik" => $kunik,
"mode" => $mode,
"canEdit" => $canEdit,
"canEditForm" => @$canEditForm,
"editQuestionBtn" => @$editQuestionBtn,
"saveOneByOne" => $saveOneByOne,
"wizard" => (isset($wizard) && $wizard == true) ,
......
......@@ -23,69 +23,73 @@ $initAnswerFiles=Document::getListDocumentsWhere(array(
}
</style>
<div class="uploader_container col-xs-12 no-padding margin-bottom-20">
<br/><h4><?php echo @$inputsObj["label"] ?></h4>
<?php if(isset($inputsObj["info"])){ ?>
<span class="italic">
<?php echo $inputsObj["info"] ?>
</span>
<?php } ?>
<?php if(!isset($uploaderObj["paste"]) || $uploaderObj["paste"]){ ?>
<input type="text" name="upload" id="<?php echo $domUploader ?>_paste" placeholder="coller une image de votre navigateur ici" class="form-control text-center qq-paste-input"/>
<?php } ?>
<div class="col-xs-12 fine-uploader-manual-trigger no-padding" id="<?php echo $domUploader; ?>" data-type="" data-id=""></div>
<?php if(isset($uploaderObj["docType"]) && $uploaderObj["docType"]=="image"){ ?>
<br/>
<label for="<?php echo $kunik ?>">
<h4 style="color:<?php echo ($titleColor) ? $titleColor : "black"; ?>"><?php echo $label.$editQuestionBtn ?>
</h4>
</label><!--<h4><?php echo @$inputsObj["label"] ?></h4>-->
<?php if(isset($inputsObj["info"])){ ?>
<span class="italic">
<?php echo $inputsObj["info"] ?>
</span>
<?php }
if($mode=="r"){
echo $this->renderPartial("co2.views.pod.docsList",array("edit"=>false, "documents"=>$initAnswerFiles,"docType"=>@$uploaderObj["docType"]) );
} else{
if(!isset($uploaderObj["paste"]) || $uploaderObj["paste"]){ ?>
<input type="text" name="upload" id="<?php echo $domUploader ?>_paste" placeholder="coller une image de votre navigateur ici" class="form-control text-center qq-paste-input"/>
<?php } ?>
<div class="col-xs-12 fine-uploader-manual-trigger no-padding" id="<?php echo $domUploader; ?>" data-type="" data-id=""></div>
<?php if(isset($uploaderObj["docType"]) && $uploaderObj["docType"]=="image"){ ?>
<script type="text/template" id="qq-template-gallery">
<?php }else{ ?>
<script type="text/template" id="qq-template-manual-trigger">
<?php } ?>
<div class="qq-uploader-selector qq-uploader qq-upload-drop-area-active<?php if(isset($fieldObj["docType"]) && $fieldObj["docType"]=="image"){ echo " qq-gallery"; } ?>" qq-drop-area-text="drop files" style="<?php if(!isset($uploaderObj["paste"]) || $uploaderObj["paste"]){ ?>border-radius:0px 0px 10px 10px;<?php } ?>">
<div class="qq-total-progress-bar-container-selector qq-total-progress-bar-container">
<div role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" class="qq-total-progress-bar-selector qq-progress-bar qq-total-progress-bar"></div>
</div>
<!--<div class="qq-paste-element-triger"><input type="text" value="" placeholder="paste a link"/></div>qq-hide-dropzone-->
<div class="qq-upload-drop-area-selector qq-upload-drop-area" qq-hide-dropzone>
<span class="qq-upload-drop-area-text-selector"></span>
</div>
<div class="col-xs-12 margin-bottom-10 text-center">
<div class="qq-upload-button-selector btn btn-primary">
<div>Selectionner un document</div>
</div>
</div>
<button type="button" id="trigger-upload" class="btn btn-danger hide">
<i class="icon-upload icon-white"></i> <?php echo Yii::t("common", "Save") ?>
</button>
<span class="qq-drop-processing-selector qq-drop-processing">
<span>En cours de progression...</span>
<span class="qq-drop-processing-spinner-selector qq-drop-processing-spinner"></span>
</span>
<?php if(isset($uploaderObj["docType"]) && $uploaderObj["docType"]=="image"){ ?>
<ul class="qq-upload-list-selector qq-upload-list" role="region" aria-live="polite" aria-relevant="additions removals">
<li>
<span role="status" class="qq-upload-status-text-selector qq-upload-status-text"></span>
<div class="qq-progress-bar-container-selector qq-progress-bar-container">
<div class="qq-total-progress-bar-container-selector qq-total-progress-bar-container">
<div role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" class="qq-total-progress-bar-selector qq-progress-bar qq-total-progress-bar"></div>
</div>
<!--<div class="qq-paste-element-triger"><input type="text" value="" placeholder="paste a link"/></div>qq-hide-dropzone-->
<div class="qq-upload-drop-area-selector qq-upload-drop-area" qq-hide-dropzone>
<span class="qq-upload-drop-area-text-selector"></span>
</div>
<div class="col-xs-12 margin-bottom-10 text-center">
<div class="qq-upload-button-selector btn btn-primary">
<div>Selectionner un document</div>
</div>
</div>
<button type="button" id="trigger-upload" class="btn btn-danger hide">
<i class="icon-upload icon-white"></i> <?php echo Yii::t("common", "Save") ?>
</button>
<span class="qq-drop-processing-selector qq-drop-processing">
<span>En cours de progression...</span>
<span class="qq-drop-processing-spinner-selector qq-drop-processing-spinner"></span>
</span>
<?php if(isset($uploaderObj["docType"]) && $uploaderObj["docType"]=="image"){ ?>
<ul class="qq-upload-list-selector qq-upload-list" role="region" aria-live="polite" aria-relevant="additions removals">
<li>
<span role="status" class="qq-upload-status-text-selector qq-upload-status-text"></span>
<div class="qq-progress-bar-container-selector qq-progress-bar-container">
<div role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" class="qq-progress-bar-selector qq-progress-bar"></div>
</div>
<span class="qq-upload-spinner-selector qq-upload-spinner"></span>
<div class="qq-thumbnail-wrapper">
</div>
<span class="qq-upload-spinner-selector qq-upload-spinner"></span>
<div class="qq-thumbnail-wrapper">
<img class="qq-thumbnail-selector" qq-max-size="120" qq-server-scale>
</div>
<button type="button" class="qq-upload-cancel-selector qq-upload-cancel">X</button>
<button type="button" class="qq-upload-retry-selector qq-upload-retry">
</div>
<button type="button" class="qq-upload-cancel-selector qq-upload-cancel">X</button>
<button type="button" class="qq-upload-retry-selector qq-upload-retry">
<span class="qq-btn qq-retry-icon" aria-label="Retry"></span>
Retry
</button>
<div class="qq-file-info">
</button>
<div class="qq-file-info">
<div class="qq-file-name">
<span class="qq-upload-file-selector qq-upload-file"></span>
</div>
<input class="qq-edit-filename-selector qq-edit-filename" tabindex="0" type="text">
<span class="qq-upload-size-selector qq-upload-size"></span>
<button type="button" class="qq-btn qq-upload-delete-selector qq-upload-delete">
<span class="qq-btn qq-delete-icon" aria-label="Delete"></span>
<?php echo Yii::t("common", "Delete") ?>
</button>
<button type="button" class="qq-btn qq-upload-pause-selector qq-upload-pause">
<span class="qq-btn qq-pause-icon" aria-label="Pause"></span>
......@@ -93,62 +97,60 @@ $initAnswerFiles=Document::getListDocumentsWhere(array(
<button type="button" class="qq-btn qq-upload-continue-selector qq-upload-continue">
<span class="qq-btn qq-continue-icon" aria-label="Continue"></span>
</button>
</div>
<button type="button" class="view-btn hide btn">View</button>
</li>
</ul>
<?php }else{ ?>
<ul class="qq-upload-list-selector qq-upload-list" aria-live="polite" aria-relevant="additions removals">
<li>
<div class="qq-progress-bar-container-selector">
<div role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" class="qq-progress-bar-selector qq-progress-bar"></div>
</div>
<span class="qq-upload-spinner-selector qq-upload-spinner"></span>
<img class="qq-thumbnail-selector" qq-max-size="100" qq-server-scale>
<a href="" target="_blank" class="qq-upload-link">
<span class="qq-upload-file-selector qq-upload-file"></span>
<input class="qq-edit-filename-selector qq-edit-filename" tabindex="0" type="text">
<span class="qq-upload-size-selector qq-upload-size"></span>
</a>
<button type="button" class="qq-btn qq-upload-cancel-selector qq-upload-cancel"><?php echo Yii::t("common", "Cancel") ?></button>
<button type="button" class="qq-btn qq-upload-retry-selector qq-upload-retry"><?php echo Yii::t("common", "Retry") ?></button>
<button type="button" class="qq-btn qq-upload-delete-selector qq-upload-delete"><?php echo Yii::t("common", "Delete") ?></button>
<button type="button" class="view-btn hide btn">View</button>
<span role="status" class="qq-upload-status-text-selector qq-upload-status-text"></span>
</li>
</ul>
<?php } ?>
<dialog class="qq-alert-dialog-selector">
<div class="qq-dialog-message-selector"></div>
<div class="qq-dialog-buttons">
<button type="button" class="qq-cancel-button-selector">Close</button>
</div>
</dialog>
<dialog class="qq-confirm-dialog-selector">
<div class="qq-dialog-message-selector"></div>
<div class="qq-dialog-buttons">
<button type="button" class="qq-cancel-button-selector">No</button>
<button type="button" class="qq-ok-button-selector">Yes</button>
</div>
</dialog>
<dialog class="qq-prompt-dialog-selector">
<div class="qq-dialog-message-selector"></div>
<input type="text">
<div class="qq-dialog-buttons">
<button type="button" class="qq-cancel-button-selector">Cancel</button>
<button type="button" class="qq-ok-button-selector">Ok</button>
</div>
</dialog>
<div class="col-xs-12 text-center" style="display: none;">
<a href="javascript:;" class="btn btn-success margin-top-10 col-sm-6 col-sm-offset-3" id="<?php echo $domUploader ?>_submit">Enregistrer</a>
</div>
</div>
</script>
<button type="button" class="view-btn hide btn">View</button>
</li>
</ul>
<?php }else{ ?>
<ul class="qq-upload-list-selector qq-upload-list" aria-live="polite" aria-relevant="additions removals">
<li>
<div class="qq-progress-bar-container-selector">
<div role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" class="qq-progress-bar-selector qq-progress-bar"></div>
</div>
<span class="qq-upload-spinner-selector qq-upload-spinner"></span>
<img class="qq-thumbnail-selector" qq-max-size="100" qq-server-scale>
<a href="" target="_blank" class="qq-upload-link">
<span class="qq-upload-file-selector qq-upload-file"></span>
<input class="qq-edit-filename-selector qq-edit-filename" tabindex="0" type="text">
<span class="qq-upload-size-selector qq-upload-size"></span>
</a>
<button type="button" class="qq-btn qq-upload-cancel-selector qq-upload-cancel"><?php echo Yii::t("common", "Cancel") ?></button>
<button type="button" class="qq-btn qq-upload-retry-selector qq-upload-retry"><?php echo Yii::t("common", "Retry") ?></button>
<button type="button" class="qq-btn qq-upload-delete-selector qq-upload-delete"><?php echo Yii::t("common", "Delete") ?></button>
<button type="button" class="view-btn hide btn">View</button>
<span role="status" class="qq-upload-status-text-selector qq-upload-status-text"></span>
</li>
</ul>
<?php } ?>
<dialog class="qq-alert-dialog-selector">
<div class="qq-dialog-message-selector"></div>
<div class="qq-dialog-buttons">
<button type="button" class="qq-cancel-button-selector">Close</button>
</div>
</dialog>
<dialog class="qq-confirm-dialog-selector">
<div class="qq-dialog-message-selector"></div>
<div class="qq-dialog-buttons">
<button type="button" class="qq-cancel-button-selector">No</button>
<button type="button" class="qq-ok-button-selector">Yes</button>
</div>
</dialog>
<dialog class="qq-prompt-dialog-selector">
<div class="qq-dialog-message-selector"></div>
<input type="text">
<div class="qq-dialog-buttons">
<button type="button" class="qq-cancel-button-selector">Cancel</button>
<button type="button" class="qq-ok-button-selector">Ok</button>
</div>
</dialog>
<div class="col-xs-12 text-center" style="display: none;">
<a href="javascript:;" class="btn btn-success margin-top-10 col-sm-6 col-sm-offset-3" id="<?php echo $domUploader ?>_submit"><?php echo Yii::t("common","Save") ?></a>
</div>
</div>
</script>
<!---->
</div>
</div>
<?php } ?>
<script type="text/javascript">
//var domUploader="<?php echo $domUploader ?>";
var uploadAnswerObj=<?php echo json_encode($uploaderObj); ?>;
......
......@@ -123,7 +123,7 @@ function showStepForm(id){
echo htmlentities($this->costum["cms"][$form["id"]."desc"]);
else
echo "<span style='color:#aaa'>* section description</span>";
if($canEditForm)
if(@$canEditForm)
echo "<a class='btn btn-xs btn-danger editBtn' href='javascript:;' data-key='".@$form["id"]."desc' data-type='textarea' data-markdown='1' data-path='costum.cms.".@$form["id"]."desc' data-label='Expliquez les objectifs de cette étape ? '> <i class='fa fa-pencil'></i></a>";
echo "</div>";
......@@ -137,7 +137,7 @@ function showStepForm(id){
"mode" => @$mode,
"showForm" => $showForm,
"canEdit" => $canEdit,
"canEditForm" => $canEditForm,
"canEditForm" => @$canEditForm,
"el" => $el ] ,true );
echo "</div>";
}
......
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