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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user