diff --git a/intranet/modules/impression/main.py b/intranet/modules/impression/main.py index fda4bf93..94e751c5 100644 --- a/intranet/modules/impression/main.py +++ b/intranet/modules/impression/main.py @@ -172,11 +172,12 @@ class main(ModuleBase): # # methode pour changer les parametres # - def changeSettings(self, copies=None, couleurs=None, recto_verso=None, agrafes=None, papier=None): + def changeSettings(self, copies=None, couleur=None, recto_verso=None, agrafage=None, papier=None, livret=None): if not cherrypy.session.has_key('impression') or cherrypy.session['impression'] == None : return {'nouvPrix':0.0} try: - nouvPrix = cherrypy.session['impression'].changeSettings(papier=papier, couleurs=couleurs, agraphes=agrafes, recto_verso=recto_verso, copies=int(copies)) + nouvPrix = cherrypy.session['impression'].changeSettings(papier=papier, couleur=couleur, agrafage=agrafage, recto_verso=recto_verso, copies=int(copies), livret=livret) + crans.cp.log("changeSettings returns : %s" % str(nouvPrix)) except Exception, e: crans.cp.log("changeSettings : %s" % str(e), 'IMPRESSION', 1) return {"erreur":str(e)} diff --git a/intranet/modules/impression/static/impression.js b/intranet/modules/impression/static/impression.js index bf2d283c..72cd050e 100644 --- a/intranet/modules/impression/static/impression.js +++ b/intranet/modules/impression/static/impression.js @@ -129,6 +129,7 @@ Impression.settings.disableField = function(afield) { // Impression.settings.update = function () { var orientation = "portrait"; + Impression.settings.livret="False" if (this.theform.type_impression_couleur.checked) this.getValue(this.theform.type_impression_couleur); else @@ -139,22 +140,25 @@ Impression.settings.update = function () { else if (this.theform.disposition_recto_verso.checked) this.getValue(this.theform.disposition_recto_verso); else - this.getValue(this.theform.disposition_recto_verso_short); - this.getValue(this.theform.papier); + { + this.getValue(this.theform.disposition_livret); + Impression.settings.livret="True"; + } + this.getValue(this.theform.papier); this.getCopies(this.theform.nb_copies); - this.getValue(this.theform.agrafes); - // Contraintes + this.getValue(this.theform.agrafage); + // Contraintes if ( - ( this.papier != "A4" ) || - ( (this.disposition == "recto") && (this.nb_pages>50) ) || - ( (this.disposition == "rectoverso") && (this.nb_pages>100) ) || - ( (this.disposition == "rectoversoshort") && (this.nb_pages>100) )) + /* ( this.papier != "A4" ) || */ + ( (this.disposition == "recto") && (this.nb_pages>50) ) || + ( (this.disposition == "rectoverso") && (this.nb_pages>100) ) + ) { - this.setValue(this.theform.agrafes, "pasdagraphes"); - this.disableField(this.theform.agrafes); - this.getValue(this.theform.agrafes); + this.setValue(this.theform.agrafage, "None"); + this.disableField(this.theform.agrafage); + this.getValue(this.theform.agrafage); } else { - this.setDisableField(this.theform.agrafes, false); + this.setDisableField(this.theform.agrafage, false); } if (this.papier == "A4tr") { @@ -317,11 +321,12 @@ Impression.AJAX.analysefini = function(AJAXResp) Impression.AJAX.recalcPrix = function() { settings = Impression.settings; - var url = "changeSettings?copies=" + settings.copies - +"&couleurs="+ settings.type_impression - +"&papier="+ settings.papier - +"&recto_verso="+ settings.disposition - +"&agrafes="+ settings.agrafes; + var url = "changeSettings?copies=" + settings.copies + +"&couleur="+ settings.type_impression + +"&papier="+ settings.papier + +"&recto_verso="+ settings.disposition + +"&agrafage="+ settings.agrafage + +"&livret="+ settings.livret; this.modifPrix("Calcul en cours", true); this.call(url, this.changePrix); } diff --git a/intranet/modules/impression/templates/impression.tmpl b/intranet/modules/impression/templates/impression.tmpl index 4e986818..c9396a76 100644 --- a/intranet/modules/impression/templates/impression.tmpl +++ b/intranet/modules/impression/templates/impression.tmpl @@ -19,10 +19,10 @@ Crans.messages.setMessage('$errorMsg.replace("\'","\\\'")', 'errorMessage')