This commit is contained in:
Juanjo Menent 2015-08-07 17:52:21 +02:00
parent 0d1b4e6911
commit 841cc0fe5e
2 changed files with 10 additions and 6 deletions

View File

@ -3,12 +3,12 @@
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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);

View File

@ -4,7 +4,7 @@
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
@ -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;