Debug last commit

This commit is contained in:
Adrien RENARD 2023-12-22 23:07:48 +01:00
parent 269b6dd2b0
commit b5858bf369
12 changed files with 74 additions and 194 deletions

View File

@ -24,9 +24,7 @@ var modalDeleteClient = false;
var btnDeleteClient = false; var btnDeleteClient = false;
var currentDeleteClient = 0; var currentDeleteClient = 0;
$(document).ready( function() { $(document).ready( function() {
// console.log("INIT CLIENTS");
// INIT SEARCH // INIT SEARCH
clientsSearch = $("#clientsSearch"); clientsSearch = $("#clientsSearch");
if(clientsSearch.length>0) initSearchClients(); if(clientsSearch.length>0) initSearchClients();
@ -60,9 +58,7 @@ $(document).ready( function() {
}); });
/***** SEARCH CLIENTS *****/ /***** SEARCH CLIENTS *****/
function initSearchClients() { function initSearchClients() {
// console.log("INIT SEARCH CLIENTS");
clientsSearch.find("input[name=search]").unbind('keypress').keypress( function(event) { clientsSearch.find("input[name=search]").unbind('keypress').keypress( function(event) {
if(event.keyCode==13) searchClient(false); if(event.keyCode==13) searchClient(false);
}); });
@ -79,9 +75,7 @@ function searchClient(clear) {
} }
/***** VIEW CLIENT *****/ /***** VIEW CLIENT *****/
function initViewClient() { function initViewClient() {
// console.log("INIT VIEW CLIENT");
// BTN VIEW // BTN VIEW
btnViewClient.unbind('click').click( function(event) { btnViewClient.unbind('click').click( function(event) {
event.preventDefault(); event.preventDefault();
@ -92,6 +86,7 @@ function initViewClient() {
loadDatasInViewClientModal(id); loadDatasInViewClientModal(id);
}); });
// INIT FORM VIEW
var form = modalViewClient.find("div.formClient"); var form = modalViewClient.find("div.formClient");
// TABS // TABS
@ -175,9 +170,7 @@ function clearViewClientModal() {
modalViewClient.find("div.tabAbsences").html(""); modalViewClient.find("div.tabAbsences").html("");
} }
function initModalViewClientTabAbsences() { function initModalViewClientTabAbsences() {
console.log("INIT MODAL VIEW CLIENT TAB ABSENCES");
// BTN ADD ABSENCES // BTN ADD ABSENCES
modalViewClient.find("#btnAddAbsence").click(function(e) { modalViewClient.find("#btnAddAbsence").click(function(e) {
e.preventDefault(); e.preventDefault();
@ -369,14 +362,14 @@ function getClientFormDatas(form) {
/***** ADD CLIENT *****/ /***** ADD CLIENT *****/
function initAddClient() { function initAddClient() {
// console.log("INIT ADD CLIENT"); // BTN ADD
btnAddClient.unbind('click').click( function(event) { btnAddClient.unbind('click').click( function(event) {
event.preventDefault(); event.preventDefault();
clearFormClientDatas(formAddClient); clearFormClientDatas(formAddClient);
modalAddClient.modal('show'); modalAddClient.modal('show');
}); });
// INIT FORM ADD
initFormClient(formAddClient); initFormClient(formAddClient);
// SAVE CLIENT // SAVE CLIENT
@ -420,8 +413,7 @@ function initAddClient() {
/***** EDIT CLIENT *****/ /***** EDIT CLIENT *****/
function initEditClient() { function initEditClient() {
// console.log("INIT EDIT CLIENT"); // BTN EDIT
btnEditClient.unbind('click').click( function(event) { btnEditClient.unbind('click').click( function(event) {
event.preventDefault(); event.preventDefault();
id = parseInt($(this).attr('ref')); id = parseInt($(this).attr('ref'));
@ -431,6 +423,7 @@ function initEditClient() {
loadDatasInFormClientDatas(modalEditClient,formEditClient,id); loadDatasInFormClientDatas(modalEditClient,formEditClient,id);
}); });
// INIT FORM EDIT
initFormClient(formEditClient); initFormClient(formEditClient);
// SAVE CLIENT // SAVE CLIENT
@ -447,8 +440,6 @@ function initEditClient() {
datas.action = 'edit'; datas.action = 'edit';
datas.ref = currentEditClient; datas.ref = currentEditClient;
// console.log(datas,"EDIT datas");
formEditClient.find("div.modaLoader").addClass("show"); formEditClient.find("div.modaLoader").addClass("show");
$(".btnSaveEditClient").prop("disabled", true); $(".btnSaveEditClient").prop("disabled", true);
@ -482,8 +473,7 @@ function initEditClient() {
/***** DELETE CLIENT *****/ /***** DELETE CLIENT *****/
function initDeleteClient() { function initDeleteClient() {
// console.log("INIT DELETE CLIENT"); // BTN DELETE
btnDeleteClient.unbind('click').click( function(event) { btnDeleteClient.unbind('click').click( function(event) {
event.preventDefault(); event.preventDefault();
id = parseInt($(this).attr('ref')); id = parseInt($(this).attr('ref'));

View File

@ -30,9 +30,7 @@ var modalDeleteContrat = false;
var btnDeleteContrat = false; var btnDeleteContrat = false;
var currentDeleteContrat = 0; var currentDeleteContrat = 0;
$(document).ready( function() { $(document).ready( function() {
// console.log("INIT CONTRATS");
// INIT SEARCH // INIT SEARCH
contratsSearch = $("#contratsSearch"); contratsSearch = $("#contratsSearch");
if(contratsSearch.length>0) initSearchContrats(); if(contratsSearch.length>0) initSearchContrats();
@ -73,7 +71,6 @@ $(document).ready( function() {
/***** SEARCH CONTRATS *****/ /***** SEARCH CONTRATS *****/
function initSearchContrats() { function initSearchContrats() {
// console.log("INIT SEARCH CONTRATS");
// SEARCH // SEARCH
contratsSearch.find("input[name=search]").unbind('keypress').keypress( function(event) { contratsSearch.find("input[name=search]").unbind('keypress').keypress( function(event) {
if(event.keyCode==13) searchContrat(false); if(event.keyCode==13) searchContrat(false);
@ -127,8 +124,7 @@ function searchContrat(clear) {
/***** VIEW CONTRAT *****/ /***** VIEW CONTRAT *****/
function initViewContrat() { function initViewContrat() {
// console.log("INIT VIEW CONTRAT"); // BTN VIEW
btnViewContrat.unbind('click').click( function(event) { btnViewContrat.unbind('click').click( function(event) {
event.preventDefault(); event.preventDefault();
id = parseInt($(this).attr('ref')); id = parseInt($(this).attr('ref'));
@ -162,7 +158,6 @@ function initViewContrat() {
resizeFormContrat(form); resizeFormContrat(form);
$( window ).on( "resize", function() { resizeFormContrat(form) }); $( window ).on( "resize", function() { resizeFormContrat(form) });
// CANCEL // CANCEL
modalViewContrat.on('hidden.bs.modal', function (e) { modalViewContrat.on('hidden.bs.modal', function (e) {
clearViewContratModal(); clearViewContratModal();
@ -182,7 +177,6 @@ function loadDatasInViewContratModal(id) {
}; };
$.post( contratsBaseURL, datas, function( result ) { $.post( contratsBaseURL, datas, function( result ) {
var datas = JSON.parse(result); var datas = JSON.parse(result);
console.log(datas);
modalViewContrat.find("small.db_ref > span").html(datas.ref); modalViewContrat.find("small.db_ref > span").html(datas.ref);
@ -271,12 +265,7 @@ function initFormContrat(form) {
reponse(datas); reponse(datas);
}).fail(function() { alert(srvErrorMsg+" (form contrat - client autocomplete)"); }); }).fail(function() { alert(srvErrorMsg+" (form contrat - client autocomplete)"); });
}, },
response: function( event, ui ) { focus: function(event, ui) { event.preventDefault(); },
//console.log('ui',ui);
},
focus: function(event, ui) {
event.preventDefault();
},
select: function(event, ui) { select: function(event, ui) {
event.preventDefault(); event.preventDefault();
form.find("input[name=client]").val( ui.item.value ).attr('ref', ui.item.ref).blur(); form.find("input[name=client]").val( ui.item.value ).attr('ref', ui.item.ref).blur();
@ -287,7 +276,6 @@ function initFormContrat(form) {
else if(parseInt($(this).attr('ref'))>0) $(this).val("").removeAttr('ref'); else if(parseInt($(this).attr('ref'))>0) $(this).val("").removeAttr('ref');
}); });
form.find("input[name=client]").on("blur", function(e) { form.find("input[name=client]").on("blur", function(e) {
console.log("blured", $(this).attr('ref'), parseInt($(this).attr('ref'))>0);
if(!parseInt($(this).attr('ref'))>0) $(this).val("").removeAttr('ref'); if(!parseInt($(this).attr('ref'))>0) $(this).val("").removeAttr('ref');
}); });
@ -618,9 +606,7 @@ function loadDatasInFormContratDatas(modal,form,id) {
'action' : 'getDatas' 'action' : 'getDatas'
}; };
$.post( contratsBaseURL, datas, function( result ) { $.post( contratsBaseURL, datas, function( result ) {
//console.log(result);
var datas = JSON.parse(result); var datas = JSON.parse(result);
console.log(datas);
form.find("input[name=client]").val(datas.client_prenom+" "+datas.client_nom).attr('ref', datas.client_ref); form.find("input[name=client]").val(datas.client_prenom+" "+datas.client_nom).attr('ref', datas.client_ref);
@ -865,14 +851,14 @@ function getContratFormDatas(form) {
/***** ADD CONTRAT *****/ /***** ADD CONTRAT *****/
function initAddContrat() { function initAddContrat() {
// console.log("INIT ADD CONTRAT"); // BTN ADD
btnAddContrat.unbind('click').click( function(event) { btnAddContrat.unbind('click').click( function(event) {
event.preventDefault(); event.preventDefault();
clearFormContratDatas(formAddContrat); clearFormContratDatas(formAddContrat);
modalAddContrat.modal('show'); modalAddContrat.modal('show');
}); });
// INIT FORM ADD
initFormContrat(formAddContrat); initFormContrat(formAddContrat);
// SAVE CONTRAT // SAVE CONTRAT
@ -917,8 +903,7 @@ function initAddContrat() {
/***** EDIT CONTRAT *****/ /***** EDIT CONTRAT *****/
function initEditContrat() { function initEditContrat() {
// console.log("INIT EDIT CONTRAT"); // BTN EDIT
btnEditContrat.unbind('click').click( function(event) { btnEditContrat.unbind('click').click( function(event) {
event.preventDefault(); event.preventDefault();
id = parseInt($(this).attr('ref')); id = parseInt($(this).attr('ref'));
@ -928,6 +913,7 @@ function initEditContrat() {
loadDatasInFormContratDatas(modalEditContrat,formEditContrat,id); loadDatasInFormContratDatas(modalEditContrat,formEditContrat,id);
}); });
// INIT FORM EDIT
initFormContrat(formEditContrat); initFormContrat(formEditContrat);
// SAVE CONTRAT // SAVE CONTRAT
@ -944,8 +930,6 @@ function initEditContrat() {
datas.action = 'edit'; datas.action = 'edit';
datas.ref = currentEditContrat; datas.ref = currentEditContrat;
// console.log(datas,"EDIT datas");
formEditContrat.find("div.modaLoader").addClass("show"); formEditContrat.find("div.modaLoader").addClass("show");
$(".btnSaveEditContrat").prop("disabled", true); $(".btnSaveEditContrat").prop("disabled", true);
@ -979,8 +963,7 @@ function initEditContrat() {
/***** ARCHIVE CONTRAT *****/ /***** ARCHIVE CONTRAT *****/
function initArchiveContrat() { function initArchiveContrat() {
// console.log("INIT ARCHIVE CONTRAT"); // BTN ARCHIVE
btnArchiveContrat.unbind('click').click( function(event) { btnArchiveContrat.unbind('click').click( function(event) {
event.preventDefault(); event.preventDefault();
id = parseInt($(this).attr('ref')); id = parseInt($(this).attr('ref'));
@ -1041,8 +1024,7 @@ function initArchiveContrat() {
/***** DELETE CONTRAT *****/ /***** DELETE CONTRAT *****/
function initDeleteContrat() { function initDeleteContrat() {
// console.log("INIT DELETE CONTRAT"); // BTN DELETE
btnDeleteContrat.unbind('click').click( function(event) { btnDeleteContrat.unbind('click').click( function(event) {
event.preventDefault(); event.preventDefault();
id = parseInt($(this).attr('ref')); id = parseInt($(this).attr('ref'));

View File

@ -37,7 +37,6 @@ function getUrlParameter(sParam) {
} }
function beep(duration, frequency, volume, type, callback) { function beep(duration, frequency, volume, type, callback) {
console.log("beep");
var audioCtx = new (window.AudioContext || window.webkitAudioContext || window.audioContext); var audioCtx = new (window.AudioContext || window.webkitAudioContext || window.audioContext);
var oscillator = audioCtx.createOscillator(); var oscillator = audioCtx.createOscillator();
var gainNode = audioCtx.createGain(); var gainNode = audioCtx.createGain();
@ -176,7 +175,6 @@ function initEdiTable(elem,beforeFct,callbacbFct) {
}); });
if(nextFocus && nextFocus.length>0) nextFocus.dblclick(); if(nextFocus && nextFocus.length>0) nextFocus.dblclick();
} }
//else console.log("cancel NextFocus");
}); });
ipt.keypress( function(event) { ipt.keypress( function(event) {
@ -1084,13 +1082,11 @@ function uploadTmpPhotoFile(div, file, oldFile, calbckURL) {
processData: false, processData: false,
type: 'POST', type: 'POST',
success: function(txt){ success: function(txt){
//console.log(txt);
if(txt=="error") { if(txt=="error") {
alert("ERREUR : un problème est survenue durant le chargement de la photo..."); alert("ERREUR : un problème est survenue durant le chargement de la photo...");
} }
else { else {
datas = JSON.parse(txt); datas = JSON.parse(txt);
//console.log(datas);
photoIptFile.attr("file", datas.dir+datas.tmp).attr("nom", datas.tmp); photoIptFile.attr("file", datas.dir+datas.tmp).attr("nom", datas.tmp);
photoPreview.css('background-image', "url('"+datas.prw+"&size=230')"); photoPreview.css('background-image', "url('"+datas.prw+"&size=230')");
@ -1131,7 +1127,6 @@ function getUrlParameter(sParam) {
} }
function beep(duration, frequency, volume, type, callback) { function beep(duration, frequency, volume, type, callback) {
// console.log("beep");
var audioCtx = new (window.AudioContext || window.webkitAudioContext || window.audioContext); var audioCtx = new (window.AudioContext || window.webkitAudioContext || window.audioContext);
var oscillator = audioCtx.createOscillator(); var oscillator = audioCtx.createOscillator();
var gainNode = audioCtx.createGain(); var gainNode = audioCtx.createGain();

View File

@ -24,9 +24,7 @@ var modalDeleteLegume = false;
var btnDeleteLegume = false; var btnDeleteLegume = false;
var currentDeleteLegume = 0; var currentDeleteLegume = 0;
$(document).ready( function() { $(document).ready( function() {
// console.log("INIT LEGUMES");
// INIT SEARCH // INIT SEARCH
legumesSearch = $("#legumesSearch"); legumesSearch = $("#legumesSearch");
if(legumesSearch.length>0) initSearchLegumes(); if(legumesSearch.length>0) initSearchLegumes();
@ -60,9 +58,7 @@ $(document).ready( function() {
}); });
/***** SEARCH LEGUMES *****/ /***** SEARCH LEGUMES *****/
function initSearchLegumes() { function initSearchLegumes() {
// console.log("INIT SEARCH LEGUMES");
legumesSearch.find("input[name=search]").unbind('keypress').keypress( function(event) { legumesSearch.find("input[name=search]").unbind('keypress').keypress( function(event) {
if(event.keyCode==13) searchLegume(false); if(event.keyCode==13) searchLegume(false);
}); });
@ -80,8 +76,7 @@ function searchLegume(clear) {
/***** VIEW LEGUME *****/ /***** VIEW LEGUME *****/
function initViewLegume() { function initViewLegume() {
// console.log("INIT VIEW LEGUME"); // BTN VIEW
btnViewLegume.unbind('click').click( function(event) { btnViewLegume.unbind('click').click( function(event) {
event.preventDefault(); event.preventDefault();
id = parseInt($(this).attr('ref')); id = parseInt($(this).attr('ref'));
@ -223,14 +218,14 @@ function getLegumeFormDatas(form) {
/***** ADD LEGUME *****/ /***** ADD LEGUME *****/
function initAddLegume() { function initAddLegume() {
// console.log("INIT ADD LEGUME"); // BTN ADD
btnAddLegume.unbind('click').click( function(event) { btnAddLegume.unbind('click').click( function(event) {
event.preventDefault(); event.preventDefault();
clearFormLegumeDatas(formAddLegume); clearFormLegumeDatas(formAddLegume);
modalAddLegume.modal('show'); modalAddLegume.modal('show');
}); });
// INIT FORM ADD
initFormLegume(formAddLegume); initFormLegume(formAddLegume);
// SAVE LEGUME // SAVE LEGUME
@ -275,8 +270,7 @@ function initAddLegume() {
/***** EDIT LEGUME *****/ /***** EDIT LEGUME *****/
function initEditLegume() { function initEditLegume() {
// console.log("INIT EDIT LEGUME"); // BTN EDIT
btnEditLegume.unbind('click').click( function(event) { btnEditLegume.unbind('click').click( function(event) {
event.preventDefault(); event.preventDefault();
id = parseInt($(this).attr('ref')); id = parseInt($(this).attr('ref'));
@ -286,6 +280,7 @@ function initEditLegume() {
loadDatasInFormLegumeDatas(modalEditLegume,formEditLegume,id); loadDatasInFormLegumeDatas(modalEditLegume,formEditLegume,id);
}); });
// INIT FORM EDIT
initFormLegume(formEditLegume); initFormLegume(formEditLegume);
// SAVE LEGUME // SAVE LEGUME
@ -302,8 +297,6 @@ function initEditLegume() {
datas.action = 'edit'; datas.action = 'edit';
datas.ref = currentEditLegume; datas.ref = currentEditLegume;
// console.log(datas,"EDIT datas"); return;
formEditLegume.find("div.modaLoader").addClass("show"); formEditLegume.find("div.modaLoader").addClass("show");
$(".btnSaveEditLegume").prop("disabled", true); $(".btnSaveEditLegume").prop("disabled", true);
@ -337,8 +330,7 @@ function initEditLegume() {
/***** DELETE LEGUME *****/ /***** DELETE LEGUME *****/
function initDeleteLegume() { function initDeleteLegume() {
// console.log("INIT DELETE LEGUME"); // BTN DELETE
btnDeleteLegume.unbind('click').click( function(event) { btnDeleteLegume.unbind('click').click( function(event) {
event.preventDefault(); event.preventDefault();
id = parseInt($(this).attr('ref')); id = parseInt($(this).attr('ref'));

View File

@ -31,9 +31,7 @@ var modalDeleteLivraison = false;
var btnDeleteLivraison = false; var btnDeleteLivraison = false;
var currentDeleteLivraison = 0; var currentDeleteLivraison = 0;
$(document).ready( function() { $(document).ready( function() {
// console.log("INIT LIVRAISONS");
// FILTRES // FILTRES
filtreLivraisonGroupe = $("#livraisonsFiltre select[name=groupe]"); filtreLivraisonGroupe = $("#livraisonsFiltre select[name=groupe]");
filtreLivraisonArchive = $("#livraisonsFiltre select[name=archive]"); filtreLivraisonArchive = $("#livraisonsFiltre select[name=archive]");
@ -75,14 +73,13 @@ $(document).ready( function() {
/***** FILTRES LIVRAISONS *****/ /***** FILTRES LIVRAISONS *****/
function initFiltresLivraisons() { function initFiltresLivraisons() {
// console.log("INIT FILTRES LIVRAISONS"); // GROUPE
loadValue = filtreLivraisonGroupe.attr("load_value"); loadValue = filtreLivraisonGroupe.attr("load_value");
filtreLivraisonGroupe.change(function(e) { filtreLivraisonGroupe.change(function(e) {
$(this).blur(); $(this).blur();
document.location = "?groupe="+parseInt($(this).val()); document.location = "?groupe="+parseInt($(this).val());
}).val(loadValue); }).val(loadValue);
// ARCHIVE
loadValue = filtreLivraisonArchive.attr("load_value"); loadValue = filtreLivraisonArchive.attr("load_value");
filtreLivraisonArchive.change(function(e) { filtreLivraisonArchive.change(function(e) {
$(this).blur(); $(this).blur();
@ -91,9 +88,7 @@ function initFiltresLivraisons() {
} }
/***** VIEW LIVRAISON *****/ /***** VIEW LIVRAISON *****/
function initViewLivraison() { function initViewLivraison() {
// console.log("INIT VIEW LIVRAISON");
var form = modalViewLivraison.find("div.formLivraison"); var form = modalViewLivraison.find("div.formLivraison");
// TABS // TABS
@ -149,10 +144,11 @@ function loadDatasInViewLivraisonModal(id) {
}; };
$.post( livraisonsBaseURL, datas, function( result ) { $.post( livraisonsBaseURL, datas, function( result ) {
var datas = JSON.parse(result); var datas = JSON.parse(result);
console.log(datas);
modalViewLivraison.find("small.db_ref > span").html(datas.ref); modalViewLivraison.find("small.db_ref > span").html(datas.ref);
modalViewLivraison.find("td.paniers_groupe").html(datas.paniers_groupe_nom); modalViewLivraison.find("td.groupe").html(datas.paniers_groupe_nom);
modalViewLivraison.find("td.date").html(datas.date_print); modalViewLivraison.find("td.date").html(datas.date_print);
modalViewLivraison.find("td.quinz_groupe").html(datas.quinz_groupe); modalViewLivraison.find("td.quinz_groupe").html(datas.quinz_groupe);
@ -202,7 +198,7 @@ function clearViewLivraisonModal() {
modalViewLivraison.find("div.formLivraisonTabs > div.tab:first-child").addClass("active"); modalViewLivraison.find("div.formLivraisonTabs > div.tab:first-child").addClass("active");
modalViewLivraison.find("div.btnPrint").removeClass("hide").find('li').removeClass("hide"); modalViewLivraison.find("div.btnPrint").removeClass("hide").find('li').removeClass("hide");
modalViewLivraison.find("td.paniers_groupe").html(""); modalViewLivraison.find("td.groupe").html("");
modalViewLivraison.find("td.date").html(""); modalViewLivraison.find("td.date").html("");
modalViewLivraison.find("td.quinz_groupe").html(""); modalViewLivraison.find("td.quinz_groupe").html("");
@ -747,15 +743,15 @@ function getLivraisonPanierCompoLegumeDatas(tr) {
} }
/***** ADD LIVRAISON *****/ /***** ADD LIVRAISON *****/
function initAddLivraison() { function initAddLivraison() {
// console.log("INIT ADD LIVRAISON"); // BTN ADD
btnAddLivraison.unbind('click').click( function(event) { btnAddLivraison.unbind('click').click( function(event) {
event.preventDefault(); event.preventDefault();
clearFormLivraisonDatas(formAddLivraison); clearFormLivraisonDatas(formAddLivraison);
modalAddLivraison.modal('show'); modalAddLivraison.modal('show');
}); });
// INIT FORM ADD
initFormLivraison(formAddLivraison); initFormLivraison(formAddLivraison);
// SAVE LIVRAISON // SAVE LIVRAISON
@ -800,8 +796,7 @@ function initAddLivraison() {
/***** EDIT LIVRAISON *****/ /***** EDIT LIVRAISON *****/
function initEditLivraison() { function initEditLivraison() {
// console.log("INIT EDIT LIVRAISON"); // BTN EDIT
btnEditLivraison.unbind('click').click( function(event) { btnEditLivraison.unbind('click').click( function(event) {
event.preventDefault(); event.preventDefault();
id = parseInt($(this).attr('ref')); id = parseInt($(this).attr('ref'));
@ -811,6 +806,7 @@ function initEditLivraison() {
loadDatasInFormLivraisonDatas(modalEditLivraison,formEditLivraison,id); loadDatasInFormLivraisonDatas(modalEditLivraison,formEditLivraison,id);
}); });
// INIT FORM EDIT
initFormLivraison(formEditLivraison); initFormLivraison(formEditLivraison);
// SAVE LIVRAISON // SAVE LIVRAISON
@ -860,8 +856,7 @@ function initEditLivraison() {
/***** ARCHIVE LIVRAISON *****/ /***** ARCHIVE LIVRAISON *****/
function initArchiveLivraison() { function initArchiveLivraison() {
// console.log("INIT ARCHIVE LIVRAISON"); // BTN ARCHIVE
btnArchiveLivraison.unbind('click').click( function(event) { btnArchiveLivraison.unbind('click').click( function(event) {
event.preventDefault(); event.preventDefault();
id = parseInt($(this).attr('ref')); id = parseInt($(this).attr('ref'));
@ -921,8 +916,7 @@ function initArchiveLivraison() {
/***** DELETE LIVRAISON *****/ /***** DELETE LIVRAISON *****/
function initDeleteLivraison() { function initDeleteLivraison() {
// console.log("INIT DELETE LIVRAISON"); // BTN DELETE
btnDeleteLivraison.unbind('click').click( function(event) { btnDeleteLivraison.unbind('click').click( function(event) {
event.preventDefault(); event.preventDefault();
id = parseInt($(this).attr('ref')); id = parseInt($(this).attr('ref'));

View File

@ -16,9 +16,7 @@ $(document).ready( function() {
if(secondBar.length>0 && iptGrpOrder.length>0) initIptGrpOrder(); if(secondBar.length>0 && iptGrpOrder.length>0) initIptGrpOrder();
}); });
function initSecondBarCollapse() { function initSecondBarCollapse() {
// console.log("INIT SECOND BAR COLLAPSE");
btnCollapseSecondBar.click(function(e) { btnCollapseSecondBar.click(function(e) {
e.preventDefault(); e.preventDefault();
$(this).blur(); $(this).blur();

View File

@ -24,9 +24,7 @@ var modalDeletePanier = false;
var btnDeletePanier = false; var btnDeletePanier = false;
var currentDeletePanier = 0; var currentDeletePanier = 0;
$(document).ready( function() { $(document).ready( function() {
// console.log("INIT PANIERS");
// INIT SEARCH // INIT SEARCH
paniersSearch = $("#paniersSearch"); paniersSearch = $("#paniersSearch");
if(paniersSearch.length>0) initSearchPaniers(); if(paniersSearch.length>0) initSearchPaniers();
@ -61,14 +59,20 @@ $(document).ready( function() {
/***** SEARCH PANIERS *****/ /***** SEARCH PANIERS *****/
function initSearchPaniers() { function initSearchPaniers() {
// console.log("INIT SEARCH PANIERS"); // SEARCH
paniersSearch.find("input[name=search]").unbind('keypress').keypress( function(event) { paniersSearch.find("input[name=search]").unbind('keypress').keypress( function(event) {
if(event.keyCode==13) searchPanier(false); if(event.keyCode==13) searchPanier(false);
}); });
paniersSearch.find(".btnClearSearch").unbind('click').click( function(event) { paniersSearch.find(".btnClearSearch").unbind('click').click( function(event) {
searchPanier(true); searchPanier(true);
}); });
// FILTRE GROUPE
loadValue = paniersSearch.find("select[name=groupe]").attr("load_value");
paniersSearch.find("select[name=groupe]").change(function(e) {
$(this).blur();
document.location = "?groupe="+parseInt($(this).val());
}).val(loadValue);
} }
function searchPanier(clear) { function searchPanier(clear) {
@ -80,8 +84,7 @@ function searchPanier(clear) {
/***** VIEW PANIER *****/ /***** VIEW PANIER *****/
function initViewPanier() { function initViewPanier() {
// console.log("INIT VIEW PANIER"); // BTN VIEW
btnViewPanier.unbind('click').click( function(event) { btnViewPanier.unbind('click').click( function(event) {
event.preventDefault(); event.preventDefault();
id = parseInt($(this).attr('ref')); id = parseInt($(this).attr('ref'));
@ -104,9 +107,7 @@ function loadDatasInViewPanierModal(id) {
'action' : 'getDatas' 'action' : 'getDatas'
}; };
$.post(paniersBaseURL, datas, function(jsonTxt) { $.post(paniersBaseURL, datas, function(jsonTxt) {
//console.log(jsonTxt);
var datas = JSON.parse(jsonTxt); var datas = JSON.parse(jsonTxt);
//console.log(datas);
modalViewPanier.find("small.db_ref > span").html(datas.ref); modalViewPanier.find("small.db_ref > span").html(datas.ref);
@ -275,9 +276,7 @@ function loadDatasInFormPanierDatas(modal,form,id) {
'action' : 'getDatas' 'action' : 'getDatas'
}; };
$.post(paniersBaseURL, datas, function(jsonTxt) { $.post(paniersBaseURL, datas, function(jsonTxt) {
//console.log(jsonTxt);
var datas = JSON.parse(jsonTxt); var datas = JSON.parse(jsonTxt);
//console.log(datas);
form.find("input[name=nom]").val(datas.nom); form.find("input[name=nom]").val(datas.nom);
@ -388,14 +387,14 @@ function getPanierFormDatas(form) {
/***** ADD PANIER *****/ /***** ADD PANIER *****/
function initAddPanier() { function initAddPanier() {
// console.log("INIT ADD PANIER"); // BTN ADD
btnAddPanier.unbind('click').click( function(event) { btnAddPanier.unbind('click').click( function(event) {
event.preventDefault(); event.preventDefault();
clearFormPanierDatas(formAddPanier); clearFormPanierDatas(formAddPanier);
modalAddPanier.modal('show'); modalAddPanier.modal('show');
}); });
// INIT FORM ADD
initFormPanier(formAddPanier); initFormPanier(formAddPanier);
// SAVE PANIER // SAVE PANIER
@ -439,8 +438,7 @@ function initAddPanier() {
/***** EDIT PANIER *****/ /***** EDIT PANIER *****/
function initEditPanier() { function initEditPanier() {
// console.log("INIT EDIT PANIER"); // BTN EDIT
btnEditPanier.unbind('click').click( function(event) { btnEditPanier.unbind('click').click( function(event) {
event.preventDefault(); event.preventDefault();
id = parseInt($(this).attr('ref')); id = parseInt($(this).attr('ref'));
@ -450,6 +448,7 @@ function initEditPanier() {
loadDatasInFormPanierDatas(modalEditPanier,formEditPanier,id); loadDatasInFormPanierDatas(modalEditPanier,formEditPanier,id);
}); });
// INIT FORM EDIT
initFormPanier(formEditPanier); initFormPanier(formEditPanier);
// SAVE PANIER // SAVE PANIER
@ -466,8 +465,6 @@ function initEditPanier() {
datas.action = 'edit'; datas.action = 'edit';
datas.ref = currentEditPanier; datas.ref = currentEditPanier;
// console.log(datas,"EDIT datas");
formEditPanier.find("div.modaLoader").addClass("show"); formEditPanier.find("div.modaLoader").addClass("show");
$(".btnSaveEditPanier").prop("disabled", true); $(".btnSaveEditPanier").prop("disabled", true);
@ -501,8 +498,7 @@ function initEditPanier() {
/***** DELETE PANIER *****/ /***** DELETE PANIER *****/
function initDeletePanier() { function initDeletePanier() {
// console.log("INIT DELETE PANIER"); // BTN DELETE
btnDeletePanier.unbind('click').click( function(event) { btnDeletePanier.unbind('click').click( function(event) {
event.preventDefault(); event.preventDefault();
id = parseInt($(this).attr('ref')); id = parseInt($(this).attr('ref'));

View File

@ -1,75 +0,0 @@
// SEARCH
var searchNav = false;
var searchList = false;
$(document).ready( function() {
searchNav = $("div.search-container > div.leftCol");
searchList = $("div.search-list");
if(searchNav.length>0 && searchList.length>0) initSearch();
})
function initSearch() {
// console.log("INIT SEARCH !");
// FILTRE UNIVERS
var filtreUnivers = searchNav.find("select[name=univers]");
if(filtreUnivers.length>0) filtreUnivers.change(function(e) {
$(this).blur();
document.location = "?filtre_univers="+$(this).val();
});
// FILTRE CATEGORY
var filtreCategory = searchNav.find("select[name=category]");
if(filtreCategory.length>0) filtreCategory.change(function(e) {
$(this).blur();
document.location = "?filtre_category="+$(this).val();
});
// FILTRE FAMILY
var filtreFamily = searchNav.find("select[name=family]");
if(filtreFamily.length>0) filtreFamily.change(function(e) {
$(this).blur();
document.location = "?filtre_family="+$(this).val();
});
// FILTRE GROUP
var filtreGroup = searchNav.find("select[name=group]");
if(filtreGroup.length>0) filtreGroup.change(function(e) {
$(this).blur();
document.location = "?filtre_group="+$(this).val();
});
// FILTRE TYPE
var filtreType = searchNav.find("select[name=type]");
if(filtreType.length>0) filtreType.change(function(e) {
$(this).blur();
document.location = "?filtre_type="+$(this).val();
});
// FILTRE ORIGIN
var filtreOrigin = searchNav.find("select[name=origin]");
if(filtreOrigin.length>0) filtreOrigin.change(function(e) {
$(this).blur();
document.location = "?filtre_origin="+$(this).val();
});
// FILTRE PRODUCER
var filtreProducer = searchNav.find("select[name=producer]");
if(filtreProducer.length>0) filtreProducer.change(function(e) {
$(this).blur();
document.location = "?filtre_producer="+$(this).val();
});
// AUTO-RESIZE SEARCH
$(window).on("resize", function(e) { resizeSearch(); });
resizeSearch();
}
function resizeSearch() {
var h = $(window).height();
if($(window).width()>1260) h -= 78;
else h -= 78;
// console.log("RESIZE SEARCH !", h);
searchNav.css("height", h+"px");
searchList.css("height", h+"px");
}

View File

@ -89,9 +89,11 @@ switch($action) {
// DEFAULT - LIST // DEFAULT - LIST
default: { default: {
// LIST // LIST
$groupesList = getPaniersGroupesList();
$groupe = getRequestAndSessionSave("groupe", "paniers_filtre_groupe", "groupe", "int", 0, $groupesList, true);
$search = getSearch("paniers_search"); $search = getSearch("paniers_search");
$order = getListOrder('paniers_list_order', 'paniers_list_sens', $allowPaniersTypesListOrder); $order = getListOrder('paniers_list_order', 'paniers_list_sens', $allowPaniersTypesListOrder);
$list = getPaniersTypesList($order["order"], $order["sens"], $search); $list = getPaniersTypesList($order["order"], $order["sens"], $search, $groupe);
$GLOBALS['smarty'] -> assign('list',$list); $GLOBALS['smarty'] -> assign('list',$list);
// TEMPLATE // TEMPLATE
@ -99,7 +101,7 @@ switch($action) {
$jsFiles[] = PUBLIC_HTML_ADMIN.'js/paniers.js'; $jsFiles[] = PUBLIC_HTML_ADMIN.'js/paniers.js';
// REQUIRED LISTS // REQUIRED LISTS
$GLOBALS['smarty'] -> assign('paniers_groupes_list', getPaniersGroupesList()); $GLOBALS['smarty'] -> assign('paniers_groupes_list', $groupesList);
/****** DISPLAY PAGE ***********/ /****** DISPLAY PAGE ***********/
$GLOBALS['smarty']->assign('racine',$GLOBALS['racine']); $GLOBALS['smarty']->assign('racine',$GLOBALS['racine']);

View File

@ -54,7 +54,7 @@
nb. de paniers livrés{if $order=="nb_paniers_livres"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if} nb. de paniers livrés{if $order=="nb_paniers_livres"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if}
</a> </a>
</th> </th>
<th class="visible-md visible-lg center"> <th class="visible-lg center">
<a href={if $order=="nb_paniers_restant" && $sens=="ASC"}"?order=nb_paniers_restant&sens=DESC" <a href={if $order=="nb_paniers_restant" && $sens=="ASC"}"?order=nb_paniers_restant&sens=DESC"
{else}"?order=nb_paniers_restant&sens=ASC"{/if} style="text-decoration: none;"> {else}"?order=nb_paniers_restant&sens=ASC"{/if} style="text-decoration: none;">
nb. de paniers restants{if $order=="nb_paniers_restants"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if} nb. de paniers restants{if $order=="nb_paniers_restants"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if}
@ -74,13 +74,13 @@
<tr class="{if $i.archive>0}archive{/if}{if $i.warning_nb_paniers} warning{/if}{if $i.nb_paniers_restants<=0} danger{/if}"> <tr class="{if $i.archive>0}archive{/if}{if $i.warning_nb_paniers} warning{/if}{if $i.nb_paniers_restants<=0} danger{/if}">
<td class="center visible-lg">{$i.ref}</td> <td class="center visible-lg">{$i.ref}</td>
<td><a href="#" class="btnViewContrat" ref={$i.ref}>{$i.client_prenom} {$i.client_nom}</a></td> <td><a href="#" class="btnViewContrat" ref={$i.ref}>{$i.client_prenom} {$i.client_nom}</a></td>
<td class="visible-md visible-lg">{$i.groupe_nom}</td> <td class="visible-lg">{$i.groupe_nom}</td>
<td class="visible-md visible-lg">{$i.type_nom}</td> <td class="visible-lg">{$i.type_nom}</td>
<td class="visible-md visible-lg center">{$i.date_print}</td> <td class="visible-md visible-lg center">{$i.date_print}</td>
<td class="visible-md visible-lg center">{$i.frequence_print}</td> <td class="visible-md visible-lg center">{$i.frequence_print}</td>
<td class="visible-md visible-lg center">{$i.panier_type_nom}</td> <td class="visible-md visible-lg center">{$i.panier_type_nom}</td>
<td class="visible-md visible-lg center">{$i.nb_paniers_livres} / {$i.nb_paniers}</td> <td class="visible-md visible-lg center">{$i.nb_paniers_livres} / {$i.nb_paniers}</td>
<td class="visible-md visible-lg center">{$i.nb_paniers_restants}{if $i.force_eligible>0} <i class="glyphicon glyphicon-star"></i>{/if}</td> <td class="visible-lg center">{$i.nb_paniers_restants}{if $i.force_eligible>0} <i class="glyphicon glyphicon-star"></i>{/if}</td>
<td class="visible-md visible-lg center">{$i.lieu_depot_nom}</td> <td class="visible-md visible-lg center">{$i.lieu_depot_nom}</td>
<td class="td_btn_action"><button class="btn btn-xs btn-link glyphicon glyphicon-edit btnEditContrat" ref="{$i.ref}"></button></td> <td class="td_btn_action"><button class="btn btn-xs btn-link glyphicon glyphicon-edit btnEditContrat" ref="{$i.ref}"></button></td>
{if $i.nb_paniers_livres_absolute>0} {if $i.nb_paniers_livres_absolute>0}

View File

@ -14,19 +14,19 @@
date{if $order=="date"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if} date{if $order=="date"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if}
</a> </a>
</th> </th>
<th> <th class="visible-md visible-lg">
<a href={if $order=="quinz_groupe" && $sens=="ASC"}"?order=quinz_groupe&sens=DESC" <a href={if $order=="quinz_groupe" && $sens=="ASC"}"?order=quinz_groupe&sens=DESC"
{else}"?order=quinz_groupe&sens=ASC"{/if} style="text-decoration: none;"> {else}"?order=quinz_groupe&sens=ASC"{/if} style="text-decoration: none;">
groupe quinzaine{if $order=="quinz_groupe"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if} groupe quinzaine{if $order=="quinz_groupe"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if}
</a> </a>
</th> </th>
<th> <th class="visible-md visible-lg">
<a href={if $order=="paniers_groupe" && $sens=="ASC"}"?order=paniers_groupe&sens=DESC" <a href={if $order=="paniers_groupe" && $sens=="ASC"}"?order=paniers_groupe&sens=DESC"
{else}"?order=paniers_groupe&sens=ASC"{/if} style="text-decoration: none;"> {else}"?order=paniers_groupe&sens=ASC"{/if} style="text-decoration: none;">
groupe de paniers{if $order=="paniers_groupe"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if} groupe de paniers{if $order=="paniers_groupe"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if}
</a> </a>
</th> </th>
<th> <th class="visible-md visible-lg">
<a href={if $order=="nb_paniers" && $sens=="ASC"}"?order=nb_paniers&sens=DESC" <a href={if $order=="nb_paniers" && $sens=="ASC"}"?order=nb_paniers&sens=DESC"
{else}"?order=nb_paniers&sens=ASC"{/if} style="text-decoration: none;"> {else}"?order=nb_paniers&sens=ASC"{/if} style="text-decoration: none;">
nb. de paniers{if $order=="nb_paniers"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if} nb. de paniers{if $order=="nb_paniers"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if}

View File

@ -9,6 +9,12 @@
</div> </div>
<div class="collapse navbar-collapse"> <div class="collapse navbar-collapse">
<form class="navbar-form navbar-right" role="search" id="paniersSearch"> <form class="navbar-form navbar-right" role="search" id="paniersSearch">
<!-- GROUPE -->
<div class="input-group">
<span class="input-group-addon{if $groupe>0} active{/if}">groupe :</span>
<select class="form-control" name="groupe" load_value="{$groupe}">{include file='paniers_groupes/paniers_groupes_select_list.tpl'}</select>
</div>
<!-- SEARCH -->
<div class="input-group class"> <div class="input-group class">
<span class="input-group-addon{if $search!=""} active{/if}"><i class="glyphicon glyphicon-search"></i></span> <span class="input-group-addon{if $search!=""} active{/if}"><i class="glyphicon glyphicon-search"></i></span>
<input type="text" class="form-control" placeholder="rechercher..." name="search" value="{$search}"> <input type="text" class="form-control" placeholder="rechercher..." name="search" value="{$search}">