2
0
forked from Wavyzz/dolibarr

Qual: Mutualize code for actions of editing notes

New: Add button 'cancel' to cancel edition of a note (private or public)
This commit is contained in:
Laurent Destailleur
2014-01-11 13:33:30 +01:00
parent 171e74ae7e
commit 23eb0f3770
22 changed files with 176 additions and 305 deletions

View File

@@ -50,24 +50,15 @@ if (! $object->fetch($id, $ref) > 0)
dol_print_error($db);
}
$permissionnote=$user->rights->commande->creer; // Used by the include of actions_setnotes.inc.php
/*
* Actions
*/
if ($action == 'setnote_public' && $user->rights->commande->creer)
{
$object->fetch($id);
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
if ($result < 0) dol_print_error($db,$object->error);
}
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
else if ($action == 'setnote_private' && $user->rights->commande->creer)
{
$object->fetch($id);
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES),'_private');
if ($result < 0) dol_print_error($db,$object->error);
}
/*
* View