Fix: problme avec les apostrophes

Fix: le dossier parent tait perdu si erreur
This commit is contained in:
Regis Houssin 2008-04-29 06:00:58 +00:00
parent 6664deb106
commit 4e9a3225e1
2 changed files with 6 additions and 4 deletions

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008 Regis Houssin <regis@dolibarr.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
@ -138,7 +139,7 @@ if ($_GET["action"] == 'create')
print '<tr><td>'.$langs->trans("Label").'</td><td><input name="label" size="40" value="'.$ecmdir->label.'"></td></tr>'."\n";
print '<tr><td>'.$langs->trans ("AddIn").'</td><td>';
print $formecm->select_all_sections($ecmdir->parent,'catParent');
print $formecm->select_all_sections($ecmdir->fk_parent,'catParent');
print '</td></tr>'."\n";
// Description

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2007-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008 Regis Houssin <regis@dolibarr.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
@ -77,7 +78,7 @@ class EcmDirectory // extends CommonObject
$now=time();
// Clean parameters
$this->label=sanitize_string($this->label);
$this->label=sanitize_string($this->label);
$this->fk_parent=trim($this->fk_parent);
$this->description=trim($this->description);
if (! $this->cachenbofdoc) $this->cachenbofdoc=0;
@ -97,9 +98,9 @@ class EcmDirectory // extends CommonObject
$sql.= "date_c,";
$sql.= "fk_user_c";
$sql.= ") VALUES (";
$sql.= " '".$this->label."',";
$sql.= " '".addslashes($this->label)."',";
$sql.= " '".$this->fk_parent."',";
$sql.= " '".$this->description."',";
$sql.= " '".addslashes($this->description)."',";
$sql.= " ".($this->cachenbofdoc).",";
$sql.= " ".$this->db->idate($this->date_c).",";
$sql.= " '".$this->fk_user_c."'";