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