31if ($action ==
'setnote_public' && !empty($permissionnote) && !
GETPOST(
'cancel',
'alpha')) {
32 if (empty($action) || !is_object($object) || empty($id)) {
33 dol_print_error(
'',
'Include of actions_setnotes.inc.php was done but required variable was not set before');
35 if (empty($object->id)) {
39 $result_update = $object->update_note(
dol_html_entity_decode(
GETPOST(
'note_public',
'restricthtml'), ENT_QUOTES | ENT_HTML5,
'UTF-8', 1),
'_public');
41 if ($result_update < 0) {
43 } elseif (in_array($object->table_element, array(
'supplier_proposal',
'propal',
'commande_fournisseur',
'commande',
'facture_fourn',
'facture'))) {
45 if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
46 $outputlangs = $langs;
49 $newlang =
GETPOST(
'lang_id',
'aZ09');
52 $newlang = $object->thirdparty->default_lang;
54 if (!empty($newlang)) {
56 $outputlangs->setDefaultLang($newlang);
58 $model = $object->model_pdf;
59 $hidedetails = (
GETPOST(
'hidedetails',
'int') ?
GETPOST(
'hidedetails',
'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
60 $hidedesc = (
GETPOST(
'hidedesc',
'int') ?
GETPOST(
'hidedesc',
'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0));
61 $hideref = (
GETPOST(
'hideref',
'int') ?
GETPOST(
'hideref',
'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0));
65 $resultGenDoc = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
66 if ($resultGenDoc < 0) {
75} elseif ($action ==
'setnote_private' && !empty($permissionnote) && !
GETPOST(
'cancel',
'alpha')) {
76 if (empty($user->socid)) {
78 if (empty($action) || !is_object($object) || empty($id)) {
79 dol_print_error(
'',
'Include of actions_setnotes.inc.php was done but required variable was not set before');
81 if (empty($object->id)) {
84 $result = $object->update_note(
dol_html_entity_decode(
GETPOST(
'note_private',
'restricthtml'), ENT_QUOTES | ENT_HTML5,
'UTF-8', 1),
'_private');
Class to manage translations.
dol_html_entity_decode($a, $b, $c='UTF-8', $keepsomeentities=0)
Replace html_entity_decode functions to manage errors.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.