From 0d1b4e6911341eae77fe5ca6b26e43d496a5c859 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 7 Aug 2015 17:09:36 +0200 Subject: [PATCH 1/3] Update fr_FR and es_ES printing message. Transifex works only for develop branch... --- htdocs/langs/es_ES/printing.lang | 1 + htdocs/langs/fr_FR/printing.lang | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/langs/es_ES/printing.lang b/htdocs/langs/es_ES/printing.lang index adaeafcf55d..d9ad1655e53 100644 --- a/htdocs/langs/es_ES/printing.lang +++ b/htdocs/langs/es_ES/printing.lang @@ -10,6 +10,7 @@ PrintTestDesc=Listado de Impresoras. FileWasSentToPrinter=El archivo %s ha sido enviado a la impresora NoActivePrintingModuleFound=Sin módulo activo para imprimir documentos PleaseSelectaDriverfromList=Seleccione un driver del listado. +PleaseConfigureDriverfromList=Configure el driver seleccionado del listado. SetupDriver=Configuración driver TestDriver=Prueba TargetedPrinter=Impresora destino diff --git a/htdocs/langs/fr_FR/printing.lang b/htdocs/langs/fr_FR/printing.lang index 2044852a879..eab55c121fa 100644 --- a/htdocs/langs/fr_FR/printing.lang +++ b/htdocs/langs/fr_FR/printing.lang @@ -10,6 +10,7 @@ PrintTestDesc=Liste des imprimantes FileWasSentToPrinter=Le fichier %s a été envoyé à l'imprimante NoActivePrintingModuleFound=Pas de module actif pour imprimer le document PleaseSelectaDriverfromList=Sélection un driver dans la liste +PleaseConfigureDriverfromList=Configurer le driver sélectionné dans la liste. SetupDriver=Configuration du driver TestDriver=Test TargetedPrinter=Imprimante cible From 841cc0fe5e41463d56cee3e92b0cb3271545f758 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 7 Aug 2015 17:52:21 +0200 Subject: [PATCH 2/3] Fix #3355 --- htdocs/contrat/card.php | 8 ++++++-- htdocs/contrat/class/contrat.class.php | 8 ++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 4cea0fb8c5e..e4dad139339 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -3,12 +3,12 @@ * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2010-2015 Juanjo Menent * Copyright (C) 2013 Christophe Battarel * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Ferran Marcet * Copyright (C) 2014 Marcos García - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Jean-François Ferry * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -783,6 +783,10 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra } } } elseif ($action=='setref') { + $result = $object->fetch($id); + if ($result < 0) { + setEventMessage($object->errors, 'errors'); + } $object->ref=GETPOST('ref','alpha'); $result = $object->update($user); diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index ce02649674b..eea23be7ae8 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2008 Raphael Bertrand - * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2010-2015 Juanjo Menent * Copyright (C) 2013 Christophe Battarel * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2015 Marcos García @@ -1147,7 +1147,7 @@ class Contrat extends CommonObject if (isset($this->note_private)) $this->note_private=trim($this->note_private); if (isset($this->note_public)) $this->note_public=trim($this->note_public); if (isset($this->import_key)) $this->import_key=trim($this->import_key); - if (isset($this->extraparams)) $this->extraparams=trim($this->extraparams); + //if (isset($this->extraparams)) $this->extraparams=trim($this->extraparams); @@ -1174,8 +1174,8 @@ class Contrat extends CommonObject $sql.= " fk_user_cloture=".(isset($this->fk_user_cloture)?$this->fk_user_cloture:"null").","; $sql.= " note_private=".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null").","; $sql.= " note_public=".(isset($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null").","; - $sql.= " import_key=".(isset($this->import_key)?"'".$this->db->escape($this->import_key)."'":"null").","; - $sql.= " extraparams=".(isset($this->extraparams)?"'".$this->db->escape($this->extraparams)."'":"null").""; + $sql.= " import_key=".(isset($this->import_key)?"'".$this->db->escape($this->import_key)."'":"null").""; + //$sql.= " extraparams=".(isset($this->extraparams)?"'".$this->db->escape($this->extraparams)."'":"null").""; $sql.= " WHERE rowid=".$this->id; From fd6f7dfa61f05ff109964a4a3c247de694c858e4 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 7 Aug 2015 18:01:13 +0200 Subject: [PATCH 3/3] Fix #3355 --- htdocs/contrat/card.php | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index e4dad139339..0a7acee88ea 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -782,21 +782,33 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra exit; } } -} elseif ($action=='setref') { - $result = $object->fetch($id); - if ($result < 0) { - setEventMessage($object->errors, 'errors'); + else { + header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id); + exit; } - $object->ref=GETPOST('ref','alpha'); +} elseif ($action=='setref') { + $cancelbutton = GETPOST('cancel'); - $result = $object->update($user); - if ($result < 0) { - setEventMessage($object->errors,'errors'); - $action='editref'; - } else { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } + if (!$cancelbutton) { + $result = $object->fetch($id); + if ($result < 0) { + setEventMessage($object->errors, 'errors'); + } + $object->ref = GETPOST('ref', 'alpha'); + + $result = $object->update($user); + if ($result < 0) { + setEventMessage($object->errors, 'errors'); + $action = 'editref'; + } else { + header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id); + exit; + } + } + else { + header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id); + exit; + } } // Generation doc (depuis lien ou depuis cartouche doc)