31 if ($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;
48 if ($conf->global->MAIN_MULTILANGS && empty($newlang) &&
GETPOST(
'lang_id',
'aZ09')) {
49 $newlang =
GETPOST(
'lang_id',
'aZ09');
51 if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
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));
63 $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
70 } elseif ($action ==
'setnote_private' && !empty($permissionnote) && !
GETPOST(
'cancel',
'alpha')) {
71 if (empty($user->socid)) {
73 if (empty($action) || !is_object($object) || empty($id)) {
74 dol_print_error(
'',
'Include of actions_setnotes.inc.php was done but required variable was not set before');
76 if (empty($object->id)) {