diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 395c9587b7e..6f510ad3706 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -97,7 +97,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL < 2) { $accounting = new AccountingAccount($db); - /* * Actions */ diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index c359f539547..5150bea861e 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -183,7 +183,7 @@ if ($id > 0) { $permission = $user->rights->adherent->creer; $permtoedit = $user->rights->adherent->creer; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; print "

"; } else { dol_print_error($db); diff --git a/htdocs/asset/document.php b/htdocs/asset/document.php index ce8adad8e34..e6f5ed9b353 100644 --- a/htdocs/asset/document.php +++ b/htdocs/asset/document.php @@ -129,7 +129,7 @@ if ($id > 0 || !empty($ref)) { $permission = $user->rights->asset->write; $permtoedit = $user->rights->asset->write; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { dol_print_error($db); } diff --git a/htdocs/bom/bom_document.php b/htdocs/bom/bom_document.php index bac28f2ea9a..1b6db3c0810 100644 --- a/htdocs/bom/bom_document.php +++ b/htdocs/bom/bom_document.php @@ -151,7 +151,7 @@ if ($object->id) { //$relativepathwithnofile='bom/' . dol_sanitizeFileName($object->id).'/'; $relativepathwithnofile = 'bom/'.dol_sanitizeFileName($object->ref).'/'; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { accessforbidden('', 0, 1); } diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index a23dee4fbb9..5779558e722 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -49,6 +49,8 @@ if (is_numeric($type)) { $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility } +// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('categoryindex')); /* * View diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 2ff3b1ade8c..f521fa2ab59 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -287,7 +287,7 @@ if ($object->id > 0) { $modulepart = 'actions'; $permission = $user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index a3ddf4ae039..1a71d4ffaba 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -189,7 +189,7 @@ if ($object->id > 0) { $permission = $user->rights->propal->creer; $permtoedit = $user->rights->propal->creer; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 37fd7a38928..c61f7c63542 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -184,7 +184,7 @@ if ($id > 0 || !empty($ref)) { $permission = $user->rights->commande->creer; $permtoedit = $user->rights->commande->creer; $param = '&id='.$object->id.'&entity='.(!empty($object->entity) ? $object->entity : $conf->entity); - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { dol_print_error($db); } diff --git a/htdocs/compta/bank/account_statement_document.php b/htdocs/compta/bank/account_statement_document.php index e144f6acbe0..6103df38f66 100644 --- a/htdocs/compta/bank/account_statement_document.php +++ b/htdocs/compta/bank/account_statement_document.php @@ -188,7 +188,7 @@ if ($id > 0 || !empty($ref)) { $param = '&id='.$object->id.'&num='.urlencode($numref); $moreparam = '&num='.urlencode($numref); $relativepathwithnofile = $id."/statement/".dol_sanitizeFileName($numref)."/"; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { dol_print_error($db); } diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php index 6f0ffed4153..f97dbca114b 100644 --- a/htdocs/compta/bank/document.php +++ b/htdocs/compta/bank/document.php @@ -139,7 +139,7 @@ if ($id > 0 || !empty($ref)) { $permission = $user->rights->banque->modifier; $permtoedit = $user->rights->banque->modifier; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { dol_print_error($db); } diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php index 98486b67287..ce793f7e6ee 100644 --- a/htdocs/compta/bank/various_payment/document.php +++ b/htdocs/compta/bank/various_payment/document.php @@ -152,7 +152,7 @@ if ($object->id) { $modulepart = 'banque'; $permission = $user->rights->banque->modifier; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/compta/deplacement/document.php b/htdocs/compta/deplacement/document.php index dd87a0c67f9..bd4437715d8 100644 --- a/htdocs/compta/deplacement/document.php +++ b/htdocs/compta/deplacement/document.php @@ -128,7 +128,7 @@ if ($object->id) { $modulepart = 'deplacement'; $permission = $user->rights->deplacement->creer; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index f4937679504..664b84d4444 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -182,7 +182,7 @@ if ($id > 0 || !empty($ref)) { $permission = $user->rights->facture->creer; $permtoedit = $user->rights->facture->creer; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { dol_print_error($db); } diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index 129f7b7d685..3335174d86f 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -165,9 +165,9 @@ if ($object->id) { $modulepart = 'tax'; $permission = $user->rights->tax->charges->creer; - $permtoedit = $user->rights->fournisseur->facture->creer; + $permtoedit = $user->rights->tax->charges->creer; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index ea06d0dca06..eee1abcd2f5 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -151,9 +151,9 @@ if ($object->id) { print dol_get_fiche_end(); $permission = $user->rights->tax->charges->creer; - $permtoedit = $user->rights->fournisseur->facture->creer; + $permtoedit = $user->rights->tax->charges->creer; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index cbe1d1a6194..e980b0ee94c 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -88,6 +88,8 @@ if ($id > 0) { $upload_dir = $conf->societe->multidir_output[$object->entity].'/contact/'.dol_sanitizeFileName($object->ref); $modulepart = 'contact'; +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('contactdocument')); /* * Actions diff --git a/htdocs/contact/note.php b/htdocs/contact/note.php index 9a90cafdd9a..c301ef02276 100644 --- a/htdocs/contact/note.php +++ b/htdocs/contact/note.php @@ -48,6 +48,8 @@ if ($id > 0) { $permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('contactcard')); /* * Actions diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 8e5b1281c47..1dd87fd75e3 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -195,7 +195,7 @@ if ($object->id) { $permission = $user->rights->contrat->creer; $permtoedit = $user->rights->contrat->creer; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 9c8293e4601..1df58740864 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4718,11 +4718,20 @@ class Form if (empty($morecss)) { $morecss = 'minwidth100'; } + + $show_empty = isset($input['select_show_empty']) ? $input['select_show_empty'] : 1; + $key_in_label = isset($input['select_key_in_label']) ? $input['select_key_in_label'] : 0; + $value_as_key = isset($input['select_value_as_key']) ? $input['select_value_as_key'] : 0; + $translate = isset($input['select_translate']) ? $input['select_translate'] : 0; + $maxlen = isset($input['select_maxlen']) ? $input['select_maxlen'] : 0; + $disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0; + $sort = isset($input['select_sort']) ? $input['select_sort'] : ''; + $more .= '
'; if (!empty($input['label'])) { $more .= $input['label'].'
'; } - $more .= $this->selectarray($input['name'], $input['values'], $input['default'], 1, 0, 0, $moreattr, 0, 0, 0, '', $morecss); + $more .= $this->selectarray($input['name'], $input['values'], $input['default'], $show_empty, $key_in_label, $value_as_key, $moreattr, $translate, $maxlen, $disabled, $sort, $morecss); $more .= '
'."\n"; } elseif ($input['type'] == 'checkbox') { $more .= '
'; diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 166814525cf..3eaeb4fc17a 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -28,7 +28,6 @@ */ function payment_prepare_head(Paiement $object) { - global $langs, $conf; $h = 0; @@ -287,6 +286,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag } } } elseif ($type == 'member' || $type == 'membersubscription') { + $newtype = 'member'; $out = $urltouse.'/public/payment/newpayment.php?source=membersubscription&ref='.($mode ? '' : ''); if ($mode == 1) { $out .= 'member_ref'; @@ -301,10 +301,10 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag } else { $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) { - $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + member_ref)"; + $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$newtype."' + member_ref)"; } if ($mode == 0) { - $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2); + $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$newtype.$ref, 2); } $out .= ($mode ? '' : ''); } diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 15c5d54b94e..8da25b01132 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -300,7 +300,11 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetFont(pdf_getPDFFont($outputlangs)); // Set path to the background PDF File if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) { - $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) { + $logodir = $conf->mycompany->multidir_output[$object->entity]; + } + $pagecount = $pdf->setSourceFile($logodir.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); $tplidx = $pdf->importPage(1); } diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index f97d7abee28..f1b64fc4944 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -342,7 +342,11 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetFont(pdf_getPDFFont($outputlangs)); // Set path to the background PDF File if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) { - $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) { + $logodir = $conf->mycompany->multidir_output[$object->entity]; + } + $pagecount = $pdf->setSourceFile($logodir.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); $tplidx = $pdf->importPage(1); } diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 1203943ab91..e60f272caf5 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -342,7 +342,11 @@ class pdf_crabe extends ModelePDFFactures // Set path to the background PDF File if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) { - $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) { + $logodir = $conf->mycompany->multidir_output[$object->entity]; + } + $pagecount = $pdf->setSourceFile($logodir.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); $tplidx = $pdf->importPage(1); } diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 22402e91a92..59dbeeaf207 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -351,7 +351,11 @@ class pdf_sponge extends ModelePDFFactures // Set path to the background PDF File if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) { - $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) { + $logodir = $conf->mycompany->multidir_output[$object->entity]; + } + $pagecount = $pdf->setSourceFile($logodir.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); $tplidx = $pdf->importPage(1); } diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index f3aade80bf8..0ef3835c81d 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -30,6 +30,7 @@ * \ingroup propale * \brief File of Class to generate PDF proposal with Azur template */ + require_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -332,7 +333,11 @@ class pdf_azur extends ModelePDFPropales $pdf->SetFont(pdf_getPDFFont($outputlangs)); // Set path to the background PDF File if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) { - $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) { + $logodir = $conf->mycompany->multidir_output[$object->entity]; + } + $pagecount = $pdf->setSourceFile($logodir.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); $tplidx = $pdf->importPage(1); } diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 5d63a2fe3f5..7b04f7974bd 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -337,7 +337,11 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetFont(pdf_getPDFFont($outputlangs)); // Set path to the background PDF File if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) { - $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) { + $logodir = $conf->mycompany->multidir_output[$object->entity]; + } + $pagecount = $pdf->setSourceFile($logodir.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); $tplidx = $pdf->importPage(1); } diff --git a/htdocs/don/document.php b/htdocs/don/document.php index 63551a12fa3..0bd4edbc77b 100644 --- a/htdocs/don/document.php +++ b/htdocs/don/document.php @@ -188,10 +188,10 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'don'; - $permission = $user->rights->don->lire; + $permission = $user->rights->don->creer; $permtoedit = $user->rights->don->creer; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php index faff2a8d0a0..c5e13967abc 100644 --- a/htdocs/expedition/document.php +++ b/htdocs/expedition/document.php @@ -180,7 +180,7 @@ if ($id > 0 || !empty($ref)) { $permission = $user->rights->expedition->creer; $permtoedit = $user->rights->expedition->creer; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { dol_print_error($db); } diff --git a/htdocs/expensereport/document.php b/htdocs/expensereport/document.php index 7713745a0a3..37206815cbf 100644 --- a/htdocs/expensereport/document.php +++ b/htdocs/expensereport/document.php @@ -156,7 +156,7 @@ if ($object->id) { $permission = $user->rights->expensereport->creer; $permtoedit = $user->rights->expensereport->creer; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php index ba1f22c122b..576e6be0e5e 100644 --- a/htdocs/fichinter/document.php +++ b/htdocs/fichinter/document.php @@ -173,7 +173,7 @@ if ($object->id) { $permission = $user->rights->ficheinter->creer; $permtoedit = $user->rights->ficheinter->creer; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index a4efbec2e55..f3dc1d26496 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -179,7 +179,7 @@ if ($object->id > 0) { $permission = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); $permtoedit = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { header('Location: index.php'); exit; diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php index 02fe52a9a4d..d1be99b0446 100644 --- a/htdocs/holiday/document.php +++ b/htdocs/holiday/document.php @@ -352,7 +352,7 @@ if ($object->id) { $permission = $user->rights->holiday->write; $permtoedit = $user->rights->holiday->write; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php index 545d2ddfabf..85c958dd545 100644 --- a/htdocs/loan/document.php +++ b/htdocs/loan/document.php @@ -163,7 +163,7 @@ if ($object->id) { $permission = $user->rights->loan->write; $permtoedit = $user->rights->loan->write; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index c0765394135..47c88270e8b 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -240,7 +240,7 @@ if ($object->id) { //$relativepathwithnofile='myobject/' . dol_sanitizeFileName($object->id).'/'; $relativepathwithnofile = 'myobject/'.dol_sanitizeFileName($object->ref).'/'; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { accessforbidden('', 0, 1); } diff --git a/htdocs/mrp/mo_document.php b/htdocs/mrp/mo_document.php index 920f69b01af..96041171da6 100644 --- a/htdocs/mrp/mo_document.php +++ b/htdocs/mrp/mo_document.php @@ -186,7 +186,7 @@ if ($object->id) { //$relativepathwithnofile='mo/' . dol_sanitizeFileName($object->id).'/'; $relativepathwithnofile = 'mo/'.dol_sanitizeFileName($object->ref).'/'; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { accessforbidden('', 0, 1); } diff --git a/htdocs/product/document.php b/htdocs/product/document.php index 55cf32b7b56..af44521dc05 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -248,7 +248,7 @@ if ($object->id) { print dol_get_fiche_end(); $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; // Merge propal PDF document PDF files diff --git a/htdocs/product/stock/productlot_document.php b/htdocs/product/stock/productlot_document.php index 97eaace9ee4..5b19288deff 100644 --- a/htdocs/product/stock/productlot_document.php +++ b/htdocs/product/stock/productlot_document.php @@ -193,7 +193,7 @@ if ($object->id) { $permission = ($user->rights->produit->creer); $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 7731e401203..3c2d5b02829 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -605,7 +605,18 @@ if ($action == 'create' && $user->rights->projet->creer) { if (empty($conf->global->PROJECT_DISABLE_PUBLIC_PROJECT)) { $array[1] = $langs->trans("SharedProject"); } - print $form->selectarray('public', $array, GETPOST('public') ?GETPOST('public') : $object->public, 0, 0, 0, '', 0, 0, 0, '', '', 1); + + if (count($array) > 0) { + print $form->selectarray('public', $array, GETPOSTISSET('public') ? GETPOST('public') : $object->public, 0, 0, 0, '', 0, 0, 0, '', '', 1); + } else { + print ''; + + if ( (GETPOSTISSET('public') ? GETPOST('public') : $object->public)==0) { + print $langs->trans("PrivateProject"); + } else { + print $langs->trans("SharedProject"); + } + } print ''; // Date start @@ -878,7 +889,18 @@ if ($action == 'create' && $user->rights->projet->creer) { if (empty($conf->global->PROJECT_DISABLE_PUBLIC_PROJECT)) { $array[1] = $langs->trans("SharedProject"); } - print $form->selectarray('public', $array, $object->public, 0, 0, 0, '', 0, 0, 0, '', '', 1); + + if (count($array) > 0) { + print $form->selectarray('public', $array, $object->public, 0, 0, 0, '', 0, 0, 0, '', '', 1); + } else { + print ''; + + if ($object->public == 0) { + print $langs->trans("PrivateProject"); + } else { + print $langs->trans("SharedProject"); + } + } print ''; if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index d7bcd722988..a069e7bf162 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -166,7 +166,7 @@ if ($object->id > 0) { $modulepart = 'project'; $permission = ($userWrite > 0); $permtoedit = ($userWrite > 0); - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { dol_print_error('', 'NoRecordFound'); } diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 967cc0438da..575f949bb75 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -327,7 +327,7 @@ if ($object->id > 0) { $permission = $user->rights->projet->creer; $permtoedit = $user->rights->projet->creer; $relativepathwithnofile = dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref).'/'; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { header('Location: index.php'); exit; diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 9a88a1b49ac..2125f41e71f 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1351,7 +1351,7 @@ if ($source == 'contractline') { } // Payment on member subscription -if ($source == 'membersubscription') { +if ($source == 'member' || $source == 'membersubscription') { $found = true; $langs->load("members"); diff --git a/htdocs/recruitment/recruitmentcandidature_document.php b/htdocs/recruitment/recruitmentcandidature_document.php index 2d736e1564b..24b9f6d4e67 100644 --- a/htdocs/recruitment/recruitmentcandidature_document.php +++ b/htdocs/recruitment/recruitmentcandidature_document.php @@ -218,7 +218,7 @@ if ($object->id) { $relativepathwithnofile = 'recruitmentcandidature/'.dol_sanitizeFileName($object->ref).'/'; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { accessforbidden('', 0, 1); } diff --git a/htdocs/recruitment/recruitmentjobposition_document.php b/htdocs/recruitment/recruitmentjobposition_document.php index 0f1bdeef0fc..e8ede6f0bdd 100644 --- a/htdocs/recruitment/recruitmentjobposition_document.php +++ b/htdocs/recruitment/recruitmentjobposition_document.php @@ -218,7 +218,7 @@ if ($object->id) { //$relativepathwithnofile='recruitmentjobposition/' . dol_sanitizeFileName($object->id).'/'; $relativepathwithnofile = 'recruitmentjobposition/'.dol_sanitizeFileName($object->ref).'/'; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { accessforbidden('', 0, 1); } diff --git a/htdocs/resource/document.php b/htdocs/resource/document.php index fb291a5a4a7..6f4c714fac4 100644 --- a/htdocs/resource/document.php +++ b/htdocs/resource/document.php @@ -141,7 +141,7 @@ if ($object->id > 0) { $modulepart = 'dolresource'; $permission = $user->rights->resource->write; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php index 5772de8af3a..fddb5259da9 100644 --- a/htdocs/salaries/document.php +++ b/htdocs/salaries/document.php @@ -134,7 +134,7 @@ if ($object->id) { $modulepart = 'salaries'; $permission = $user->rights->salaries->write; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index 746d1c403c7..4ed26f67018 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -178,7 +178,7 @@ if ($object->id) { $permission = $user->rights->societe->creer; $permtoedit = $user->rights->societe->creer; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { accessforbidden('', 0, 0); } diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 021b83baaab..a35e1c0e94c 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -947,8 +947,9 @@ if (empty($type) || $type == 'c' || $type == 'p') { $moreforfilter .= '
'; } } + if (empty($type) || $type == 'f') { - if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { + if (!empty($conf->fournisseur->enabled) && !empty($conf->categorie->enabled) && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('Categories'); diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php index 11fb3149aff..1a61ba5620e 100644 --- a/htdocs/supplier_proposal/document.php +++ b/htdocs/supplier_proposal/document.php @@ -165,7 +165,7 @@ if ($object->id > 0) { $permission = $user->rights->supplier_proposal->creer; $permtoedit = $user->rights->supplier_proposal->creer; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php index b8e0e79eede..f3d40c1c33e 100644 --- a/htdocs/ticket/document.php +++ b/htdocs/ticket/document.php @@ -196,7 +196,7 @@ if ($object->id) { $permtoedit = $user->rights->ticket->write; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { accessforbidden('', 0, 1); } diff --git a/htdocs/user/document.php b/htdocs/user/document.php index 138408a3c2d..297243f36ef 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -179,7 +179,7 @@ if ($object->id) { $permission = $user->rights->user->user->creer; $permtoedit = $user->rights->user->user->creer; $param = '&id='.$object->id; - include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { accessforbidden('', 0, 1); }