From 9b9492a5d6db8a4e63bb411fe5ab726f6013dae7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Jan 2014 01:31:23 +0100 Subject: [PATCH] New: Start to work on option MAIN_AUTO_TIMESTAMP_IN_NOTES to automatically add timestamp and user line into comment. Remain to do: Add button "cancel" into note edition mode. --- ChangeLog | 5 ++++- htdocs/core/tpl/notes.tpl.php | 31 +++++++++++++++++++++++++------ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index c56f5a0b9e8..e04040366a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,8 +7,11 @@ For users: - New: Add list of orders products in tab "consumption" on thirdparties. - New: Add graph stats for suppliers orders in tab "stats" on products. - New: Add option MAIN_HIDE_INACTIVETAB_ON_PRINT to hide inactive tabs when you - use the "print" view on screen. + use the "print" view on screen. - New: Add menu entry to barcode genration page. +- New: Start to work on option MAIN_AUTO_TIMESTAMP_IN_NOTES to + automatically add timestamp and user line into comment. Remain to do: + Add button "cancel" into note edition mode. For translators: - Update language files. diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index 7dd836240aa..1a690dd7950 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -1,6 +1,7 @@ - * Copyright (C) 2013 Florian Henry +/* Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2014 Laurent Destailleur * * 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 @@ -23,6 +24,24 @@ $note_private = 'note_private'; $colwidth=(isset($colwidth)?$colwidth:25); $permission=(isset($permission)?$permission:(isset($user->rights->$module->creer)?$user->rights->$module->creer:0)); // If already defined by caller page $moreparam=(isset($moreparam)?$moreparam:''); +$value_public=$object->note_public; +$value_private=$object->note_private; +if (! empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_NOTES)) +{ + $stringtoadd=dol_print_date(dol_now(), 'dayhour').' '.$user->getFullName($langs).' --'; + if (GETPOST('action') == 'edit'.$note_public) + { + $value_public=dol_concatdesc($value_public, ($value_public?"\n":"")."-- ".$stringtoadd); + if (dol_textishtml($value_public)) $value_public.="
\n"; + else $value_public.="\n"; + } + if (GETPOST('action') == 'edit'.$note_private) + { + $value_private=dol_concatdesc($value_private, ($value_private?"\n":"")."-- ".$stringtoadd); + if (dol_textishtml($value_private)) $value_private.="
\n"; + else $value_private.="\n"; + } +} // Special cases if ($module == 'propal') { $permission=$user->rights->propale->creer;} @@ -43,13 +62,13 @@ else $typeofdata='textarea:12:100';
-
>editfieldkey("NotePublic", $note_public, $object->note_public, $object, $permission, $typeofdata, $moreparam); ?>
-
editfieldval("NotePublic", $note_public, $object->note_public, $object, $permission, $typeofdata, '', null, null, $moreparam); ?>
+
>editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam); ?>
+
editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam); ?>
societe_id) { ?>
-
>editfieldkey("NotePrivate", $note_private, $object->note_private, $object, $permission, $typeofdata, $moreparam); ?>
-
editfieldval("NotePrivate", $note_private, $object->note_private, $object, $permission, $typeofdata, '', null, null, $moreparam); ?>
+
>editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam); ?>
+
editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam); ?>