Note de frais

<!-- end chunk blapyDiv --> <form id="form_14571" class="col-xs-12 style1" action="/rest/expenseplatform/expense/" method="{{#id}}PUT{{/id}}{{^id}}POST{{/id}}" onsubmit="" data-blapy-noblapydata="1" > <!-- start TPL 300-600-formRow 14569/14572--> <!-- start chunk redirectIfDirectAccessToResource -14572 / 14440 --> <!-- end chunk redirectIfDirectAccessToResource --> <div id="formRow_14572" class="col-xs-12 " style="margin-top:30px;" > <div class="row_14572 row"> <!-- start formInputField 14639 / / --> <!-- start chunk redirectIfDirectAccessToResource -14639 / 14440 --> <!-- end chunk redirectIfDirectAccessToResource --> <div id="input_14639" class="" style="height:0;width:0;" > <div class="form-group"> <div style="display:none"> <label class="control-label" for="id_14639"> <!-- begin displayTitleSection 14639 --> <div class=" noinit formInputFieldTitle"> <div class="formInputFieldTitle titleWithNoLine" style="padding-top:25px;" data-minfontsize="8" data-maxfontsize="100" data-fittextsize="" data-displayRefWidth="1332" ><span > <span id="siteeditor-longtitle-14639-rte" href="/rest/newsiteeditor/longtitle/14639" field="longtitle" method="PUT" class="siteeditor " data-resourceid="14639" data-successmsg="Modification effectuée" >id</span> &nbsp; </span> </div> </div> <!-- end equalHeight --> <!-- end displayTitleSection --> </label> </div> <div> <input type="hidden" class="form-control" name="FORM_id" id="id_14639" placeholder="" value="{{#id}}{{id}}{{/id}}" > </div> </div> </div> <!-- end formInputField --> <!-- start formInputField 14586 / / om--> <!-- start chunk redirectIfDirectAccessToResource -14586 / 14440 --> <!-- end chunk redirectIfDirectAccessToResource --> <div id="input_14586" class="" style="om" > <div class="form-group"> <div > <label class="control-label" for="tv-motif_14586"> <!-- begin displayTitleSection 14586 --> <div class=" noinit formInputFieldTitle"> <div class="formInputFieldTitle titleWithNoLine" style="padding-top:25px;" data-minfontsize="8" data-maxfontsize="100" data-fittextsize="" data-displayRefWidth="1332" ><span > <span id="siteeditor-longtitle-14586-rte" href="/rest/newsiteeditor/longtitle/14586" field="longtitle" method="PUT" class="siteeditor " data-resourceid="14586" data-successmsg="Modification effectuée" >Motif</span> &nbsp; </span> </div> </div> <!-- end equalHeight --> <!-- end displayTitleSection --> </label> </div> <div> <input type="text" class="form-control" name="FORM_tv_motif" id="tv-motif_14586" placeholder="" value="{{#templateVars.motif}}{{templateVars.motif}}{{/templateVars.motif}}" > </div> </div> </div> <!-- end formInputField --> <!-- start formInputField 14587 / / om--> <!-- start chunk redirectIfDirectAccessToResource -14587 / 14440 --> <!-- end chunk redirectIfDirectAccessToResource --> <div id="input_14587" class="col-xs-12 col-sm-3" style="om" > <div class="form-group"> <div > <label class="control-label" for="tv-consommables_14587"> <!-- begin displayTitleSection 14587 --> <div class=" noinit formInputFieldTitle"> <div class="formInputFieldTitle titleWithNoLine" style="padding-top:25px;" data-minfontsize="8" data-maxfontsize="100" data-fittextsize="" data-displayRefWidth="1332" ><span > <span id="siteeditor-longtitle-14587-rte" href="/rest/newsiteeditor/longtitle/14587" field="longtitle" method="PUT" class="siteeditor " data-resourceid="14587" data-successmsg="Modification effectuée" >Consommables</span> &nbsp; </span> </div> </div> <!-- end equalHeight --> <!-- end displayTitleSection --> </label> </div> <div> <input type="text" class="form-control" name="FORM_tv_consommables" id="tv-consommables_14587" placeholder="" value="{{#templateVars.consommables}}{{templateVars.consommables}}{{/templateVars.consommables}}" > </div> </div> </div> <!-- end formInputField --> <!-- start formInputField 14588 / / --> <!-- start chunk redirectIfDirectAccessToResource -14588 / 14440 --> <!-- end chunk redirectIfDirectAccessToResource --> <div id="input_14588" class="col-xs-12 col-sm-3" style="" > <div class="form-group"> <div > <label class="control-label" for="tv-tva_14588"> <!-- begin displayTitleSection 14588 --> <div class=" noinit formInputFieldTitle"> <div class="formInputFieldTitle titleWithNoLine" style="padding-top:25px;" data-minfontsize="8" data-maxfontsize="100" data-fittextsize="" data-displayRefWidth="1332" ><span > <span id="siteeditor-longtitle-14588-rte" href="/rest/newsiteeditor/longtitle/14588" field="longtitle" method="PUT" class="siteeditor " data-resourceid="14588" data-successmsg="Modification effectuée" >Montant de la TVA</span> &nbsp; </span> </div> </div> <!-- end equalHeight --> <!-- end displayTitleSection --> </label> </div> <div> <input type="text" class="form-control" name="FORM_tv_tva" id="tv-tva_14588" placeholder="" value="{{#templateVars.TVA}}{{templateVars.TVA}}{{/templateVars.TVA}}" > </div> </div> </div> <!-- end formInputField --> <!-- start TPL 300-600-formSelectOptions 14698--> <!-- start chunk redirectIfDirectAccessToResource -14698 / 14440 --> <!-- end chunk redirectIfDirectAccessToResource --> <script> function initSelectOption_14698() { function startBootstrapSelect() { $('#tv-expenseperson_14698').val('{{#templateVars.expensePerson}}{{templateVars.expensePerson}}{{/templateVars.expensePerson}}'); $('#tv-expenseperson_14698').selectpicker( $.extend({},{ iconBase: 'far' ,tickIcon:'fa-check' }) ); } $.loadFileOnce("/assets/libraries/bootstrap-select/js/bootstrap-select.js") .done( function() { startBootstrapSelect(); }); }//end initSelectOption_xxx if (typeof $ !== "function") { window.addEventListener('DOMContentLoaded', initSelectOption_14698, false); } else initSelectOption_14698(); </script> <div id="selectoptions_14698" class="col-sm-6 selectContainer" style=""> <div class="form-group"> <div> <label class="control-label" for="tv-expenseperson_14698"> <!-- begin displayTitleSection 14698 --> <div class=" noinit formSelectOptionsFieldTitle"> <div class="formSelectOptionsFieldTitle titleWithNoLine" style="" data-minfontsize="8" data-maxfontsize="100" data-fittextsize="" data-displayRefWidth="1332" ><span > <span id="siteeditor-longtitle-14698-rte" href="/rest/newsiteeditor/longtitle/14698" field="longtitle" method="PUT" class="siteeditor " data-resourceid="14698" data-successmsg="Modification effectuée" >Qui a dépensé?</span> </span> </div> </div> <!-- end equalHeight --> <!-- end displayTitleSection --> </label> </div> <div> <select id="tv-expenseperson_14698" class="form-control selectpicker show-tick" name="FORM_tv_expensePerson" title="" > <!-- start formSelectOption 14698/{{#templateVars.expensePerson}}{{templateVars.expensePerson}}{{/templateVars.expensePerson}}--> <option value="Augustin" data-icon="" > Augustin </option> <!-- end formSelectOption--> <!-- start formSelectOption 14698/{{#templateVars.expensePerson}}{{templateVars.expensePerson}}{{/templateVars.expensePerson}}--> <option value="Maryse" data-icon="" > Maryse </option> <!-- end formSelectOption--> <!-- start formSelectOption 14698/{{#templateVars.expensePerson}}{{templateVars.expensePerson}}{{/templateVars.expensePerson}}--> <option value="Emmanuel" data-icon="" > Emmanuel </option> <!-- end formSelectOption--> </select> <script> function initSelect_14698() { $('#select_tv-expenseperson_14698').val("{{#templateVars.expensePerson}}{{templateVars.expensePerson}}{{/templateVars.expensePerson}}").change(); let chaine="{{#templateVars.expensePerson}}{{templateVars.expensePerson}}{{/templateVars.expensePerson}}"; let defaultOptions = chaine.split(',').map(valeur => valeur.trim()); $.doTimeout( 100, function() { if ($('#tv-expenseperson_14698').length) { $('#tv-expenseperson_14698') .selectpicker('val', defaultOptions); return false; } else { return true;// retest later } }); if (false) { $.doTimeout( 100, function() { if ($('#select_tv-expenseperson_14698').length) { $('#select_tv-expenseperson_14698').attr('data-metronicfixed',"0"); $.doTimeout( 500, function() { if ( ($('#select_tv-expenseperson_14698').attr('data-metronicfixed') == "0") && ($('#select_tv-expenseperson_14698') .parent() .find('div[class="dropdown-menu open"][role="combobox"]') .length) ) { // fix dropdown pb with metronic $('div[class="dropdown-menu open"][role="combobox"]').removeClass('open'); $('#select_tv-expenseperson_14698').attr('data-metronicfixed',"1"); // set an outline to the generated "button" $("#select_tv-expenseperson_14698 ~ button").addClass('btn-outline'); return false; } else { // retest later return true; } }); return false; } else return true; }); } } if (typeof $ === 'undefined') { window.addEventListener('DOMContentLoaded', function(){ initSelect_14698(); }); } else initSelect_14698(); </script> </div> </div> </div> <!-- end 300-600-formSelectOptions --> <!-- BEGIN template 300-000-Section-Sections Folder 14649 /lien-doc / --> <!-- start chunk redirectIfDirectAccessToResource -14649 / 14440 --> <!-- end chunk redirectIfDirectAccessToResource --> <!-- start standardSection lien-doc/14649//14570--> <section id="section_lien_doc_14570" class="section_14569_14649 template_section_40 col-sm-6" style="clear:none; " data-resourceid="14649" > <style scoped> #rowcontainer_lien_doc_14570.container { width:100%; } #rowcontainer_lien_doc_14570 .container { width:100%; } </style> <div id="rowcontainer_lien_doc_14570" class="rowcontainer_14569_14649 template_rowcontainer_40 container" style="clear:none; " data-resourceid="14649" > <div class="row"> <!-- start chunk SectionsFolderCode 14649 --> <div class="col-xs-12 pb15 textcontent" style=""> <div id="siteeditor-content-14649-rte" href="/rest/newsiteeditor/field/14649" field="content" method="PUT" class="siteeditor " data-resourceid="14649" data-successmsg="Modification effectuée" ><p>Liens des factures :</p> <ul> <li><a href="{{templateVars.urlFileName}}" target="_blank" rel="noopener">{{templateVars.urlFileName}}</a></li> <li><a href="{{templateVars.tv_urlPicture}}" target="_blank" rel="noopener">{{templateVars.urlPicture}}</a></li> </ul></div> </div> <!-- streamSection for subsection 14649//-- Nothing to do --> <!-- end chunk SectionsFolderCode 14649 --> <!-- add modalButton '' in section 14649 --> </div> </div> </section> <!-- end standardSection 14649 --> <!-- END template 300-000-Section-Sections Folder 14649 --> <!-- start 300-600-formDate 14600 --> <!-- start chunk redirectIfDirectAccessToResource -14600 / 14440 --> <!-- end chunk redirectIfDirectAccessToResource --> <script> //load datepicker function startDatePicker_14600() { //debugger; $.doTimeout('delayDatePicker14600',1000,function(){ //debugger; let defaultDate=$.datepicker .formatDate( "yy-mm-dd", $.datepicker.parseDate( "yy-mm-dd", $('#tv-consommablesdate_14600_date').attr('value') || "2025-05-21" ) ); let datepickerConfiguration = { altField:"#tv-consommablesdate_14600", altFormat:"yy-mm-dd", dateFormat:"yy-mm-dd", defaultDate: defaultDate, onClose : function() { $(this).blur(); } ,beforeShow: function() { setTimeout(function(){ $('.ui-datepicker').css('z-index', 3000); }, 0); } }; $("#tv-consommablesdate_14600_date").attr('value',defaultDate); datepickerConfiguration = $.extend(datepickerConfiguration, {}); $( "#tv-consommablesdate_14600_date" ).datepicker(datepickerConfiguration); //set hidden input $("#tv-consommablesdate_14600").attr('value',defaultDate); }); } function startDatePickerLoading_14600() { $.loadFileOnce("/assets/libraries/jquery-ui/jquery-ui.min.js") .done( function() { $.loadFileOnce("/assets/libraries/jquery-ui/locales/datepicker-fr.js") .done( function() { //$.datepicker.setDefaults( $.datepicker.regional[ "fr" ] ); $.datepicker.setDefaults( 'yy-mm-dd' ); startDatePicker_14600(); }); }); } if (typeof $ === 'function') { startDatePickerLoading_14600(); } else { window.addEventListener('DOMContentLoaded', function(){ $( document ).ready(function() { startDatePickerLoading_14600(); }); }); } </script> <div class="col-xs-12 col-sm-6"> <div class="form-group"> <label class="control-label" for="tv-consommablesdate14600"> <!-- begin displayTitleSection 14600 --> <div class=" noinit formDateFieldTitle"> <div class="formDateFieldTitle titleWithNoLine" style="" data-minfontsize="8" data-maxfontsize="100" data-fittextsize="" data-displayRefWidth="1332" ><span > <span id="siteeditor-longtitle-14600-rte" href="/rest/newsiteeditor/longtitle/14600" field="longtitle" method="PUT" class="siteeditor " data-resourceid="14600" data-successmsg="Modification effectuée" >Date de la dépense</span> </span> </div> </div> <!-- end equalHeight --> <!-- end displayTitleSection --> </label> <div> <input type="text" id="tv-consommablesdate_14600_date" class="datepicker" placeholder="" autocomplete="off" value="{{#templateVars.consommablesDate}}{{templateVars.consommablesDate}}{{/templateVars.consommablesDate}}" > <input type="hidden" name="FORM_tv_consommablesDate" id="tv-consommablesdate_14600" > </div> </div> </div> <!-- end 300-600-formDate --> <!-- start 300-600-formInputFile 14573--> <!-- start chunk redirectIfDirectAccessToResource -14573 / 14440 --> <!-- end chunk redirectIfDirectAccessToResource --> <script> function startFileInput_14573() { //debugger; $.doTimeout('startFileInput_14573',100,function(){ //debugger; let myInputFile = $("#tv-urlfile_14573"); let myForm = $("#tv-urlfile_14573") .closest("form"); let myFormSubmitButton = null;//myForm.find(':submit').first(); let doSubmitAfterUpload = false; myForm.append('<input type="hidden" id="tv-urlfile_14573Name" name="FORM_tv_urlFileName" value="" />'); myForm.submit(function(eventObject) { //debugger; // get the submit button that generates the submit myFormSubmitButton = eventObject && eventObject.originalEvent && eventObject.originalEvent.submitter; myFormSubmitButton = $(myFormSubmitButton); if (myInputFile.fileinput('getFilesCount')) { myInputFile.fileinput('upload'); doSubmitAfterUpload = true; return false; } }); let fileInputConfiguration = { uploadUrl: "/rest/expenseplatform/expenseupload", uploadExtraData: { "inputFileFieldName": "FORM_tv_urlFile", "targetDirectory": "expenses/" }, }; fileInputConfiguration = $.extend(fileInputConfiguration, {}); myInputFile .fileinput(fileInputConfiguration) .on('fileuploaded', function(event, data, previewId, index) { //debugger; if ($('#tv-urlfile_14573Name').val()) { $('#tv-urlfile_14573Name').val($('#tv-urlfile_14573Name').val()+'||'+data.response.data.fullname); $('#tv-urlfile_14573Name').attr('thumbs',$('#tv-urlfile_14573Name').attr('thumbs')+'||'+previewId); } else { $('#tv-urlfile_14573Name').val(data.response.data.fullname); $('#tv-urlfile_14573Name').attr('thumbs',previewId); } myInputFile.attr('requiredSet',myInputFile.prop('required')); myInputFile.prop('required',false); }) .on('fileuploaderror', function(event, data, msg) { doSubmitAfterUpload=false; }) .on('filebatchuploadcomplete', function(event, preview, config, tags, extraData) { if (doSubmitAfterUpload) { doSubmitAfterUpload=false; (myFormSubmitButton && myFormSubmitButton.click()) || (myForm && myForm.submit()); } }).on('filesuccessremove', function(event, id) { //console.log('id = ' + id + ', index = ' + index); //remove the index start in the file name... let thumbs= $('#tv-urlfile_14573Name').attr('thumbs').split('||'); let position = thumbs.indexOf(id); if (position <= -1) return;//???? let currentLoadedFiles = $('#tv-urlfile_14573Name').val(); //remove file from the list currentLoadedFiles = currentLoadedFiles.split('||'); currentLoadedFiles.splice(position,1); thumbs.splice(position,1); currentLoadedFiles = currentLoadedFiles.join('||'); thumbs = thumbs.join('||'); $('#tv-urlfile_14573Name').val(currentLoadedFiles); $('#tv-urlfile_14573Name').attr('thumbs',thumbs); if (!currentLoadedFiles) { myInputFile.prop('required',myInputFile.attr('requiredSet')); } }) .on('fileclear', function(event) { $('#tv-urlfile_14573Name').val(''); myInputFile.prop('required',myInputFile.attr('requiredSet')); }); });//dotimeout }//end startFileInput function startInputFileLoading_14573() { $.loadFileOnce("/assets/libraries/bootstrap-fileinput/js/fileinput.js") .done( function() { $.loadFileOnce("/assets/libraries/bootstrap-fileinput/themes/fa/theme.js"); $.loadFileOnce("/assets/libraries/bootstrap-fileinput/js/locales/fr.js") .done( function() { startFileInput_14573(); }); });//fileinput }; if (typeof $ === 'function') { startInputFileLoading_14573(); } else { window.addEventListener('DOMContentLoaded', function(){ $( document ).ready(function() { startInputFileLoading_14573(); }); }); } </script> <div class="col-xs-12 col-sm-6"> <div class="form-group"> <label class="control-label" for="tv-urlfile14573"> <!-- begin displayTitleSection 14573 --> <div class=" noinit formInputFieldTitle"> <div class="formInputFieldTitle titleWithNoLine" style="" data-minfontsize="8" data-maxfontsize="100" data-fittextsize="" data-displayRefWidth="1332" ><span > <span id="siteeditor-longtitle-14573-rte" href="/rest/newsiteeditor/longtitle/14573" field="longtitle" method="PUT" class="siteeditor " data-resourceid="14573" data-successmsg="Modification effectuée" >PJ de la facture</span> </span> </div> </div> <!-- end equalHeight --> <!-- end displayTitleSection --> </label> <div class="file-loading"> <input id="tv-urlfile_14573" name="FORM_tv_urlFile[]" type="file" multiple="multiple" placeholder="" style="" class="" data-theme="fa" data-show-caption="true" data-overwrite-initial="false" data-browse-on-zone-click="true" data-show-cancel="false" data-show-upload="false" data-show-preview="false" data-min-file-count="0" data-max-file-count="0" data-language="fr" > </div> </div> </div> <!-- end 300-600-formInputFile --> <!-- start template 300-300-Button to WebPage 14708/14572/right--> <!-- start chunk redirectIfDirectAccessToResource -14708 / 14440 --> <!-- end chunk redirectIfDirectAccessToResource --> <!-- start stdSubSection 14708 / 14572 --> <section id="section_photo_14570" class="section_14569_ template_section_42 col-sm-6 alignItem justifyRight" style="clear:none; " data-resourceid="14569" > <!-- start chunk SectionButtonToWebPage 14708 --> <style scoped> #button_14572_14708 { } #button_14572_14708:hover { } </style> <!-- Trigger the modal with a button / 14708--> <div class="buttonDiv submit_btn right"> <button id="button_14572_14708" type="submit" class="btn btn-default" value="Prendre une photo" onClick="const targetElement = document.getElementById(&quot;formRow_14710&quot;);&#13;&#10; const isHidden = targetElement.style.display === &quot;none&quot; || !targetElement.style.display;&#13;&#10;&#13;&#10; if (isHidden) {&#13;&#10; targetElement.style.display = &quot;block&quot;; // Show the element&#13;&#10; this.textContent = &quot;Hide&quot;; // Update button text&#13;&#10; this.style.backgroundColor = &quot;#28a745&quot;; // Change button to &#39;on&#39; state&#13;&#10; } else {&#13;&#10; targetElement.style.display = &quot;none&quot;; // Hide the element&#13;&#10; this.textContent = &quot;Show&quot;; // Update button text&#13;&#10; this.style.backgroundColor = &quot;#007bff&quot;; // Change button to &#39;off&#39; state&#13;&#10; }" > Prendre une photo </button> </div> <!-- end chunk SectionButtonToWebPage 14708 --> </section> <!-- end stdSubSection 14708 / 14572--> <!-- end template 300-300-Button to WebPage 14708/14572--> </div> </div> <!-- end TPL 300-600-formRow --> <!-- start TPL 300-600-formRow 14569/14710--> <!-- start chunk redirectIfDirectAccessToResource -14710 / 14440 --> <!-- end chunk redirectIfDirectAccessToResource --> <div id="formRow_14710" class="col-xs-12 " style="margin-top:30px; display:none;" > <!-- begin displayTitleSection 14710 --> <div class=" formRowTitle noinit"> <div class="formRowTitle nofittext" style="text-align:center;" data-minfontsize="8" data-maxfontsize="100" data-fittextsize="" data-displayRefWidth="1332" ><span > <span id="siteeditor-longtitle-14710-rte" href="/rest/newsiteeditor/longtitle/14710" field="longtitle" method="PUT" class="siteeditor " data-resourceid="14710" data-successmsg="Modification effectuée" >photo</span> </span> </div> <div class="bottomlinetitle formRowTitle noinit"></div> </div> <!-- end equalHeight --> <!-- end displayTitleSection --> <div class="row_14710 row"> <!-- start 300-600-formInputCamera 14699--> <!-- start chunk redirectIfDirectAccessToResource -14699 / 14440 --> <!-- end chunk redirectIfDirectAccessToResource --> <style scoped> #cameraInput_14699take-photo, #cameraInput_14699photo-switch, #cameraInput_14699photo-redo { background: #00BEF3; border-radius: 50px; box-shadow: 0 10px 15px rgba(0, 190, 243, 0.1); color: #f5f7fa; font-weight: 800; padding: 15px 30px; letter-spacing: 0.1em; transition: all 0.3s ease; text-align: center; cursor: pointer; border: none; outline: none; /*il y a du CSS dans la congiguration CSS */ } #cameraInput_14699take-photo:hover, #cameraInput_14699photo-switch:hover, #cameraInput_14699photo-redo:hover { background: #0098D3; box-shadow: 0 15px 20px rgba(0, 152, 211, 0.2); transform: translateY(-2px); } </style> <div id="formInputCamera_14699" class="camerainput col-xs-12 col-sm-6" > <div class="form-group"> <label class="control-label" for="urlpicture14699"> <!-- begin displayTitleSection 14699 --> <div class=" noinit formInputFieldTitle"> <div class="formInputFieldTitle titleWithNoLine" style="" data-minfontsize="8" data-maxfontsize="100" data-fittextsize="" data-displayRefWidth="1332" ><span > <span id="siteeditor-longtitle-14699-rte" href="/rest/newsiteeditor/longtitle/14699" field="longtitle" method="PUT" class="siteeditor " data-resourceid="14699" data-successmsg="Modification effectuée" >urlPicture</span> </span> </div> </div> <!-- end equalHeight --> <!-- end displayTitleSection --> </label> <div id="cameraInput_14699"></div> <input id="urlpicture_14699" name="FORM_urlPicture" type="hidden" > </div> </div> <script> async function startFileInputCamera_14699() { //debugger; let myInputFile = $("#urlpicture_14699"); let myForm = myInputFile.closest("form"); let myFormSubmitButton = null;//myForm.find(':submit').first(); let doSubmitAfterUpload = true;//by default, no picture taken, so as if upload was done myForm && myForm.submit(function(eventObject ) { //debugger; // get the submit button that generates the submit myFormSubmitButton = eventObject && eventObject.originalEvent && eventObject.originalEvent.submitter; myFormSubmitButton = $(myFormSubmitButton); if (!doSubmitAfterUpload && myCamera_14699.getDataPicture()) { // there is a picture that was not sent to server... so send it myCamera_14699.uploadPicture(); doSubmitAfterUpload = true; return false;//we will to do a new submit once the picture is sent to server } else { myCamera_14699.stopCamera(); } return true; }); let cameraInputConfiguration = { "IMXCameraInputDiv": "cameraInput_14699", "startCameraFunction": function () { myInputFile.val(''); }, "takenPictureFunction": function() { doSubmitAfterUpload = false;//we will need to send the picture to server before any form submit }, "uploadUrl": "/rest/expenseplatform/expenseupload", "uploadUrlData": { "dataParameterName": "urlpicture_14699",//data where we store the data image in imxcamerainput "inputFileFieldName": "urlpicture_14699", //property name where upload will get the file content/name "targetDirectory": "expenses/" }, "fileUploadedFunction": function (imxCameraInput, response) { // debugger; myInputFile.val(response.data.fullname); if (doSubmitAfterUpload) { //need to click submit button in order to send its value (for generic form) (myFormSubmitButton && myFormSubmitButton.click()) || (myForm && myForm.submit()); } }, "fileUploadedErrorFunction": function (imxCameraInput, errorStatus) { }, "errorStartMediaCameraFunction": function (imxCameraInput, errorStatus) { }, } cameraInputConfiguration = $.extend(cameraInputConfiguration, {"autostart": false}); let myCamera_14699 = await IMXCameraInput(cameraInputConfiguration); }//end startFileInputCamera function startInputFileLoading_14699() { $.loadFileOnce("/assets/libraries/imxCameraInput/IMXCameraInput.js") .done( function() { startFileInputCamera_14699(); });//FileInputCamera }; if (typeof $ === 'function') { startInputFileLoading_14699(); } else { window.addEventListener('DOMContentLoaded', function(){ $( document ).ready(function() { startInputFileLoading_14699(); }); }); } </script> <!-- end 300-600-formInputCamera --> </div> </div> <!-- end TPL 300-600-formRow --> <style scoped> #formSubmit_14571, #formReset_14571{ background: #00BEF3; border-radius: 50px; box-shadow: 0 10px 15px rgba(0, 190, 243, 0.1); color: #f5f7fa; font-weight: 800; padding: 15px 30px; letter-spacing: 0.1em; transition: all 0.3s ease; text-align: center; cursor: pointer; border: none; outline: none; /*il y a du CSS dans la congiguration CSS */ } #formSubmit_14571:hover, #formReset_14571:hover { background: #0098D3; box-shadow: 0 15px 20px rgba(0, 152, 211, 0.2); transform: translateY(-2px); } </style> <div class="submit_btn col-xs-12"> <div class="submit inner center"> <button id="formSubmit_14571" type="submit" class="btn btn-default" value="Envoyer" onClick="" > Envoyer </button> </div> </div> </form> <script> if (typeof initFormCode_14571 !== "function") { function initFormCode_14571() { //start JSWebsiteToInclude $("[class^='alert alert-danger']").each(function() {($(this).html()=='')?$(this).removeClass():''}); $("#form_14571 button:submit").click(function(eventObject) { $('#form_14571').find('input,textarea,select').filter('[required]:hidden').prop('required', false); }); // start init /**<!-- start chunk SectionBlapyFormCodeblapyURLDataLink 14571 / -->**/ function addHiddenFields(anArrayName, anArray) { Object.keys(anArray).map(propertyname => { if ( anArrayName == "" ) //SectionBlapy fieldName = propertyname; else if ( !Array.isArray(anArray[propertyname]) && typeof anArray[propertyname] == "object" ) fieldName = anArrayName; else fieldName = anArrayName+"["+propertyname+"]"; if ( Array.isArray(anArray[propertyname]) && typeof anArray[propertyname][0] == "object" ) { addHiddenFields(fieldName, anArray[propertyname]); } else if ( typeof anArray[propertyname] == "object" && ! Array.isArray(anArray[propertyname]) ) { addHiddenFields(fieldName, anArray[propertyname]); } else { $("<input />").attr("type", "hidden") .attr("name", fieldName) .attr("value", anArray[propertyname]) .appendTo("#form_14571"); } }); } /**<!-- end chunk SectionBlapyFormCodeblapyURLDataLink -->**/ /** <!-- start chunk SectionBlapyFormCodeBlapyId 14571 --> **/ $(document).off("submit", "#form_14571"); $(document).on("submit", "#form_14571", function(event) { event.preventDefault(); //debugger; if (!$("#form_14571").attr("data-initDone")) { // {{=<% %>=}} //to skip mustache processing const localData = JSON5.parse("{ \"tv_urlPicture\": \"{{urlPicture}}\",}"); // <%={{ }}=%> //to reactivate mustache processing addHiddenFields("", localData); $("#form_14571").attr("data-initDone","1"); } // get all the inputs into an array. let $inputs = $(this).serializeArray(); // not sure if you wanted this, but I thought I'd add it. // get an associative array of the values in the form. let formValues = {}; $.each($inputs, function() { if (this.name.indexOf('[]') >= 0) {//this input is an array of input (as select options) let name=this.name.replace('[]',''); if (!formValues[name]) formValues[name]=[]; formValues[name].push(this.value); name = name.replace('FORM_',''); if (!formValues[name]) formValues[name]=[]; formValues[name].push(this.value); //add a variable with the concat of the array... formValues[name+'_concat']=formValues[name].join(); } else { formValues[this.name] = this.value; formValues[this.name.replace('FORM_','')] = this.value; } }); //parse tag values with input $.each($inputs, function() { // {{=<% %>=}} //to skip mustache processing let match = this.value.match(/{{(.*)}}/gy); //search tag field name that could be used from blapyURLData_Link // <%={{ }}=%> //to reactivate mustache processing if (match != null) { formValues[this.name]=Mustache.render(this.value,formValues); } }); //add the submit input info that is not given by the serializeArray if (event.originalEvent) { aSubmitInput = $(event.originalEvent.currentTarget.activeElement); if (aSubmitInput) { //the submit was emitted by an input that is not of submit type (enter on a field perhaps) if (aSubmitInput.attr('type') != 'submit') { //let's get the first submit object aSubmitInput = $(event.originalEvent.target).find("*").filter(':submit:visible:first') } if (aSubmitInput && aSubmitInput.attr('name')) formValues[aSubmitInput.attr('name')] = aSubmitInput.attr('value'); } } let blapy_id = "14574"; let blapy_target = blapy_id.split('->'); let blapyObject=blapy_id+"_div"; if (blapy_target.length>1) { blapyObject = blapy_target[0]; blapy_target= blapy_target[1]; } else { blapy_target= blapy_id; } if ($.isNumeric( blapy_target )) blapy_target = "blapy_"+blapy_target+"_div"; $('#blapy_'+blapyObject).trigger('postData', { aUrl: $(this).attr("action"), params: jQuery.extend({'embeddingBlockId':$('#'+blapy_target).attr('data-blapy-container-name')}, formValues), method: $(this).attr("method"), noBlapyData:$(this).attr("data-blapy-noblapydata") }); });//end on submit /** <!-- end chunk SectionBlapyFormCodeBlapyId --> **/ }//end initFormCode_14571 if (typeof $ !== "function") { window.addEventListener('DOMContentLoaded', initFormCode_14571, false); } else initFormCode_14571(); }//end if </script>
<!-- end chunk blapyDiv --> <!-- streamSection for subsection 14574//streamSections --> <!-- start template 400-900-blapyRestReturnedManagement --> <!-- START blapyGeneralErrorManage --> <script id="script_14575" data-extmessage="{{{extmessage}}}"> $(function () { //debugger; let error_message_14575=""; let error_extmessage_14575 = ""; let error_code_14575 = "{{code}}"; let error_class_14575 = ""; let error_delay_14575 = 5000; //debugger; switch(error_code_14575) { case "200": error_message_14575 = "Requête effectuée"; error_class_14575 = "success"; //error_delay_14575 = 2000; // window.location.href = "note-de-frais/mes-notes-de-frais/";; break; default: error_message_14575 = "Erreur : {{message}}"; error_extmessage_14575 = $("#script_14575").attr("data-extmessage"); if (error_extmessage_14575 != '') { error_extmessage_14575 = "<pre>"+error_extmessage_14575+"</pre>"; } else { error_extmessage_14575=''; } error_class_14575 = "danger"; $.imxLoaderHide('sasha');; break; } $.imxNotify(error_message_14575,error_class_14575); }); </script> <!-- END blapyGeneralErrorManage --> <!-- end template 400-900-blapyRestReturnedManagement -->