diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 4cea0fb8c5e..0a7acee88ea 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 @@ -782,17 +782,33 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra exit; } } + else { + header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id); + exit; + } } elseif ($action=='setref') { - $object->ref=GETPOST('ref','alpha'); + $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) 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; 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