31 if ($action ==
'setnote_public' && !empty($permissionnote) && !
GETPOST(
'cancel',
'alpha'))
33 if (empty($action) || !is_object($object) || empty($id))
dol_print_error(
'',
'Include of actions_setnotes.inc.php was done but required variable was not set before');
34 if (empty($object->id)) $object->fetch($id);
36 $result_update = $object->update_note(
dol_html_entity_decode(
GETPOST(
'note_public',
'restricthtml'), ENT_QUOTES | ENT_HTML5,
'UTF-8', 1),
'_public');
38 if ($result_update < 0)
setEventMessages($object->error, $object->errors,
'errors');
39 elseif (in_array($object->table_element, array(
'supplier_proposal',
'propal',
'commande_fournisseur',
'commande',
'facture_fourn',
'facture')))
42 if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
44 $outputlangs = $langs;
46 if ($conf->global->MAIN_MULTILANGS && empty($newlang) &&
GETPOST(
'lang_id',
'aZ09')) $newlang =
GETPOST(
'lang_id',
'aZ09');
47 if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
48 if (!empty($newlang)) {
50 $outputlangs->setDefaultLang($newlang);
52 $model = $object->model_pdf;
53 $hidedetails = (
GETPOST(
'hidedetails',
'int') ?
GETPOST(
'hidedetails',
'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
54 $hidedesc = (
GETPOST(
'hidedesc',
'int') ?
GETPOST(
'hidedesc',
'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0));
55 $hideref = (
GETPOST(
'hideref',
'int') ?
GETPOST(
'hideref',
'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0));
57 $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
62 } elseif ($action ==
'setnote_private' && !empty($permissionnote) && !
GETPOST(
'cancel',
'alpha')) {
64 if (empty($action) || !is_object($object) || empty($id))
dol_print_error(
'',
'Include of actions_setnotes.inc.php was done but required variable was not set before');
65 if (empty($object->id)) $object->fetch($id);
67 if ($result < 0)
setEventMessages($object->error, $object->errors,
'errors');
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_html_entity_decode($a, $b, $c= 'UTF-8', $keepsomeentities=0)
Replace html_entity_decode functions to manage errors.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
Class to manage translations.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...