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

fix and fix

parent d1f9c985
......@@ -170,7 +170,7 @@ if( $mode != "pdf" ){
today = today.getDate() + '/' + (today.getMonth()+1) + '/' + today.getFullYear();
ctxTpl = {
id : "<?php echo $answer['_id'] ?>",
id : "<?php echo (string)$answer['_id'] ?>",
collection : "answers",
path : "validation."+formData.form,
value : {
......@@ -181,7 +181,7 @@ if( $mode != "pdf" ){
user : userId
}
};
if(costum.form.subForms.length == $.inArray( "<?php echo $form['id'] ?>", costum.form.subForms )+1 && formData.valid == "valid")
if(form.subForms.length == $.inArray( "<?php echo $form['id'] ?>", form.subForms )+1 && formData.valid == "valid")
ctxTpl.value.finished = true;
mylog.log("validation save",ctxTpl);
......@@ -191,13 +191,13 @@ if( $mode != "pdf" ){
//only increment step form to next step if step valid
if( ctxTpl.value.valid == "valid" || ctxTpl.value.valid == "validReserve" ){
step = 0;
if(costum.form.subForms.length == $.inArray( "<?php echo $form['id'] ?>", costum.form.subForms )+1)
if(form.subForms.length == $.inArray( "<?php echo $form['id'] ?>", form.subForms )+1)
step = "all";
else
step = costum.form.subForms[$.inArray( "<?php echo $form['id'] ?>", costum.form.subForms )+1];
step = form.subForms[$.inArray( "<?php echo $form['id'] ?>", form.subForms )+1];
ctxTpl = {
id : "<?php echo $answer['_id'] ?>",
id : "<?php echo (string)$answer['_id'] ?>",
collection : "answers",
path : "step",
value : step
......
......@@ -41,9 +41,9 @@ $initAnswerFiles=Document::getListDocumentsWhere(array(
<?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">
<script type="text/template" id="qq-template-gallery<?php echo $domUploader ?>">
<?php }else{ ?>
<script type="text/template" id="qq-template-manual-trigger">
<script type="text/template" id="qq-template-manual-trigger<?php echo $domUploader ?>">
<?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 } ?>">
......@@ -151,6 +151,7 @@ $initAnswerFiles=Document::getListDocumentsWhere(array(
<!---->
</div>
<?php } ?>
</div>
<?php if($mode != "pdf"){ ?>
<script type="text/javascript">
//var domUploader="<?php echo $domUploader ?>";
......@@ -160,7 +161,7 @@ $initAnswerFiles=Document::getListDocumentsWhere(array(
jQuery(document).ready(function() {
$("#"+uploadAnswerObj.dom).off();
$("#"+uploadAnswerObj.dom).fineUploader({
template: ((uploadAnswerObj.docType=="image") ? 'qq-template-gallery' : 'qq-template-manual-trigger'),
template: ((uploadAnswerObj.docType=="image") ? 'qq-template-gallery'+uploadAnswerObj.dom : 'qq-template-manual-trigger'+uploadAnswerObj.dom),
paste: {
defaultName: 'pasted_image',
//promptForName:true,
......@@ -331,12 +332,15 @@ $initAnswerFiles=Document::getListDocumentsWhere(array(
idUploader=$(this).data("dom-uploader");
listObject=$("#"+idUploader).fineUploader('getUploads');
goToUpload=false;
alert(idUploader);
mylog.log(listObject);
if(listObject.length > 0){
$.each(listObject, function(e,v){
if(v.status == "submitted")
goToUpload=true;
});
}
alert(goToUpload);
if( goToUpload ){
insideCallBMulti=true;
$("#"+idUploader).fineUploader('uploadStoredFiles');
......
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