From d4d828353ff9a21faf50014f494bae6cc8b9f340 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Nov 2008 22:23:13 +0000 Subject: [PATCH] Fix: Failed to modify private note --- htdocs/commonobject.class.php | 2 +- htdocs/fichinter/note.php | 80 ++++++++++++++++------------------- 2 files changed, 38 insertions(+), 44 deletions(-) diff --git a/htdocs/commonobject.class.php b/htdocs/commonobject.class.php index da543a8486b..67346dfe93d 100644 --- a/htdocs/commonobject.class.php +++ b/htdocs/commonobject.class.php @@ -782,7 +782,7 @@ class CommonObject } $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; - $sql.= " SET note = '".addslashes($note)."'"; + $sql.= " SET note_private = '".addslashes($note)."'"; $sql.= " WHERE rowid =". $this->id; dolibarr_syslog("CommonObject::update_note sql=".$sql, LOG_DEBUG); diff --git a/htdocs/fichinter/note.php b/htdocs/fichinter/note.php index 6ad31db484a..2e4299a206f 100644 --- a/htdocs/fichinter/note.php +++ b/htdocs/fichinter/note.php @@ -17,11 +17,11 @@ */ /** - \file htdocs/fichinter/note.php - \ingroup fichinter - \brief Fiche d'information sur une fiche d'intervention - \version $Id$ -*/ + \file htdocs/fichinter/note.php + \ingroup fichinter + \brief Fiche d'information sur une fiche d'intervention + \version $Id$ + */ require('./pre.inc.php'); require_once(DOL_DOCUMENT_ROOT."/fichinter/fichinter.class.php"); @@ -46,7 +46,7 @@ if ($_POST["action"] == 'update_public' && $user->rights->ficheinter->creer) $fichinter->fetch($_GET['id']); $db->begin(); - + $res=$fichinter->update_note_public($_POST["note_public"],$user); if ($res < 0) { @@ -91,7 +91,7 @@ $html = new Form($db); if ($_GET['id']) { if ($mesg) print $mesg; - + $fichinter = new Fichinter($db); if ( $fichinter->fetch($_GET['id']) ) { @@ -101,57 +101,51 @@ if ($_GET['id']) $head = fichinter_prepare_head($fichinter); dolibarr_fiche_head($head, 'note', $langs->trans('InterventionCard')); - print ''; + print '
'; - print ''; + print ''; - // Société - print ''; - - // Date - print ''; - print ''; + // Société + print ''; // Note publique - print ''; + print ''; print '"; - + // Note privée if (! $user->societe_id) { print ''; print '"; } - - print "
'.$langs->trans('Ref').''.$fichinter->ref.'
'.$langs->trans('Ref').''.$fichinter->ref.'
'.$langs->trans('Company').''.$societe->getNomUrl(1).'
'.$langs->trans('Date').''; - print dolibarr_print_date($fichinter->date,'daytext'); - print '
'.$langs->trans('Company').''.$societe->getNomUrl(1).'
'.$langs->trans("NotePublic").' :
'.$langs->trans("NotePublic").' :'; - if ($_GET["action"] == 'edit') - { - print '
'; - print ''; - print '
"; - print ''; - print '
'; - } - else - { - print ($fichinter->note_public?nl2br($fichinter->note_public):" "); - } + if ($_GET["action"] == 'edit') + { + print '
'; + print ''; + print '
"; + print ''; + print '
'; + } + else + { + print ($fichinter->note_public?nl2br($fichinter->note_public):" "); + } print "
'.$langs->trans("NotePrivate").' :'; - if ($_GET["action"] == 'edit') - { - print '
'; - print ''; - print '
"; - print ''; - print '
'; - } + if ($_GET["action"] == 'edit') + { + print '
'; + print ''; + print '
"; + print ''; + print '
'; + } else { - print ($fichinter->note_private?nl2br($fichinter->note_private):" "); + print ($fichinter->note_private?nl2br($fichinter->note_private):" "); } print "
"; + + print ""; print ''; @@ -166,7 +160,7 @@ if ($_GET['id']) } print ''; } - } + } } $db->close(); llxFooter('$Date$ - $Revision: 1.15 ');