diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index c62101ab70b..0969dc9c66b 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -202,7 +202,7 @@ if (!empty($triggers)) { print ''.$trigger['label'].''; print ''; $key = 'MAIN_AGENDA_ACTIONAUTO_'.$trigger['code']; - $value = $conf->global->$key; + $value = getDolGlobalInt($key); print ''; print ''."\n"; } diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 83391e6ce3d..18d9c67c06f 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -203,7 +203,7 @@ print ''.$langs->trans("AgendaExtSitesDesc")."\n"; -$selectedvalue=$conf->global->AGENDA_DISABLE_EXT; +$selectedvalue = getDolGlobalInt('AGENDA_DISABLE_EXT'); if ($selectedvalue==1) $selectedvalue=0; else $selectedvalue=1; print ""; diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 5003593905e..fa01e0a5ec4 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -328,7 +328,7 @@ print ''."\n"; print ''."\n"; // Manual or automatic @@ -390,7 +390,7 @@ print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; print '
'.$form->textwithpicto($langs->trans("AGENDA_DEFAULT_VIEW"), $htmltex print ' '."\n"; $tmplist = array(''=>' ', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser")); -print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW); +print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, getDolGlobalString('AGENDA_DEFAULT_VIEW')); print '
'.$langs->trans("AGENDA_DEFAULT_FILTER_STATUS").' '."\n"; -$formactions->form_select_status_action('agenda', $conf->global->AGENDA_DEFAULT_FILTER_STATUS, 1, 'AGENDA_DEFAULT_FILTER_STATUS', 1, 2, 'minwidth100'); +$formactions->form_select_status_action('agenda', getDolGlobalString('AGENDA_DEFAULT_FILTER_STATUS'), 1, 'AGENDA_DEFAULT_FILTER_STATUS', 1, 2, 'minwidth100'); print '
'; diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index 499d7233ed0..af66fc8eef3 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -39,6 +39,23 @@ $langs->loadLangs(array("admin", "other", "agenda")); $def = array(); $actionsave = GETPOST('save', 'alpha'); +$MAIN_AGENDA_XCAL_EXPORTKEY = getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY'); +$MAIN_AGENDA_EXPORT_PAST_DELAY = getDolGlobalInt('MAIN_AGENDA_EXPORT_PAST_DELAY'); +$MAIN_AGENDA_EXPORT_CACHE = getDolGlobalInt('MAIN_AGENDA_EXPORT_CACHE'); +$AGENDA_EXPORT_FIX_TZ = getDolGlobalString('AGENDA_EXPORT_FIX_TZ'); + +if (GETPOSTISSET('MAIN_AGENDA_XCAL_EXPORTKEY')) { + $MAIN_AGENDA_XCAL_EXPORTKEY = trim(GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY', 'alpha')); +} +if (GETPOSTISSET('MAIN_AGENDA_EXPORT_PAST_DELAY')) { + $MAIN_AGENDA_EXPORT_PAST_DELAY = intval(GETPOST('MAIN_AGENDA_EXPORT_PAST_DELAY', 'int')); +} +if (GETPOSTISSET('MAIN_AGENDA_EXPORT_CACHE')) { + $MAIN_AGENDA_EXPORT_CACHE = intval(GETPOST('MAIN_AGENDA_EXPORT_CACHE', 'int')); +} +if (GETPOSTISSET('AGENDA_EXPORT_FIX_TZ')) { + $AGENDA_EXPORT_FIX_TZ = trim(GETPOST('AGENDA_EXPORT_FIX_TZ', 'alpha')); +} // Sauvegardes parametres if ($actionsave) { @@ -46,10 +63,10 @@ if ($actionsave) { $db->begin(); - $i += dolibarr_set_const($db, 'MAIN_AGENDA_XCAL_EXPORTKEY', trim(GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY', 'alpha')), 'chaine', 0, '', $conf->entity); - $i += dolibarr_set_const($db, 'MAIN_AGENDA_EXPORT_PAST_DELAY', trim(GETPOST('MAIN_AGENDA_EXPORT_PAST_DELAY', 'alpha')), 'chaine', 0, '', $conf->entity); - $i += dolibarr_set_const($db, 'MAIN_AGENDA_EXPORT_CACHE', trim(GETPOST('MAIN_AGENDA_EXPORT_CACHE', 'alpha')), 'chaine', 0, '', $conf->entity); - $i += dolibarr_set_const($db, 'AGENDA_EXPORT_FIX_TZ', trim(GETPOST('AGENDA_EXPORT_FIX_TZ', 'alpha')), 'chaine', 0, '', $conf->entity); + $i += dolibarr_set_const($db, 'MAIN_AGENDA_XCAL_EXPORTKEY', $MAIN_AGENDA_XCAL_EXPORTKEY, 'chaine', 0, '', $conf->entity); + $i += dolibarr_set_const($db, 'MAIN_AGENDA_EXPORT_PAST_DELAY', $MAIN_AGENDA_EXPORT_PAST_DELAY, 'chaine', 0, '', $conf->entity); + $i += dolibarr_set_const($db, 'MAIN_AGENDA_EXPORT_CACHE', $MAIN_AGENDA_EXPORT_CACHE, 'chaine', 0, '', $conf->entity); + $i += dolibarr_set_const($db, 'AGENDA_EXPORT_FIX_TZ', $AGENDA_EXPORT_FIX_TZ, 'chaine', 0, '', $conf->entity); if ($i >= 4) { $db->commit(); @@ -98,7 +115,7 @@ print ""; print ''; print ''.$langs->trans("PasswordTogetVCalExport").""; -print ''; +print ''; if (!empty($conf->use_javascript_ajax)) { print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"'); } @@ -108,13 +125,13 @@ print ""; print ''; print "".$langs->trans("PastDelayVCalExport").""; -print "global->MAIN_AGENDA_EXPORT_PAST_DELAY)."\" size=\"10\"> ".$langs->trans("days").""; +print " ".$langs->trans("days").""; print " "; print ""; print ''; print "".$langs->trans("UseACacheDelay").""; -print "global->MAIN_AGENDA_EXPORT_CACHE)."\" size=\"10\">"; +print ""; print " "; print ""; @@ -131,7 +148,7 @@ print ""; print ''; print ''.$langs->trans("FixTZ").""; print ""; -print ''; +print ''; print '   '.$langs->trans("FillThisOnlyIfRequired"); print ""; print ""; diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php index d0fd21c80a0..1b615ddeed1 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -43,7 +43,7 @@ $arrayofparameters = array( 'DAV_RESTICT_ON_IP'=>array('css'=>'minwidth200', 'enabled'=>1), 'DAV_ALLOW_PRIVATE_DIR'=>array('css'=>'minwidth200', 'enabled'=>2), 'DAV_ALLOW_PUBLIC_DIR'=>array('css'=>'minwidth200', 'enabled'=>1), - 'DAV_ALLOW_ECM_DIR'=>array('css'=>'minwidth200', 'enabled'=>$conf->ecm->enabled) + 'DAV_ALLOW_ECM_DIR'=>array('css'=>'minwidth200', 'enabled'=>isModEnabled('ecm')) ); // To fix when dire does not exists @@ -124,6 +124,10 @@ if ($action == 'edit') { print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; foreach ($arrayofparameters as $key => $val) { + if (isset($val['enabled']) && empty($val['enabled'])) { + continue; + } + print ''; $tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : ''); $label = $langs->trans($key); diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index a715004529e..d82f4f0bde0 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -364,7 +364,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->FACTURE_ADDON == $file || $conf->global->FACTURE_ADDON.'.php' == $file) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -702,12 +702,14 @@ if (isModEnabled('banque')) { } print ""; +$FACTURE_CHQ_NUMBER = getDolGlobalInt('FACTURE_CHQ_NUMBER'); + print ''; print "".$langs->trans("SuggestPaymentByChequeToAddress").""; print ""; print '', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; @@ -128,7 +128,7 @@ class mod_payment_ant extends ModeleNumRefPayments require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // We get cursor rule - $mask = $conf->global->PAYMENT_ANT_MASK; + $mask = getDolGlobalString('PAYMENT_ANT_MASK'); if (!$mask) { $this->error = 'NotConfigured'; diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 6715b2e39a5..f2aed73f2e3 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -117,13 +117,16 @@ class doc_generic_proposal_odt extends ModelePDFPropales $form = new Form($this->db); + $odtChosen = getDolGlobalInt('MAIN_PROPAL_CHOOSE_ODT_DOCUMENT') > 0; + $odtPath = trim(getDolGlobalString('PROPALE_ADDON_PDF_ODT_PATH')); + $texte = $this->description.".
\n"; $texte .= '
'; $texte .= ''; $texte .= ''; $texte .= ''; $texte .= ''; - if (getDolGlobalInt("MAIN_PROPAL_CHOOSE_ODT_DOCUMENT") > 0) { + if ($odtChosen) { $texte .= ''; $texte .= ''; $texte .= ''; @@ -133,7 +136,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales // List of directories area $texte .= ''; $texttitle = $langs->trans("ListOfDirectories"); - $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim($conf->global->PROPALE_ADDON_PDF_ODT_PATH))); + $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', $odtPath)); $listoffiles = array(); foreach ($listofdir as $key => $tmpdir) { $tmpdir = trim($tmpdir); @@ -159,7 +162,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales $texte .= $form->textwithpicto($texttitle, $texthelp, 1, 'help', '', 1); $texte .= '
'; $texte .= ''; $texte .= '
'; $texte .= ''; @@ -167,7 +170,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales // Scan directories $nbofiles = count($listoffiles); - if (!empty($conf->global->PROPALE_ADDON_PDF_ODT_PATH)) { + if (!empty($odtPath)) { $texte .= $langs->trans("NumberOfModelFilesFound").': '; //$texte.=$nbofiles?'':''; $texte .= count($listoffiles); @@ -187,26 +190,26 @@ class doc_generic_proposal_odt extends ModelePDFPropales $texte .= '
'; // Set default template for different status of proposal - if (getDolGlobalInt("MAIN_PROPAL_CHOOSE_ODT_DOCUMENT") > 0) { + if ($odtChosen) { // Model for creation $list = ModelePDFPropales::liste_modeles($this->db); $texte .= ''; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= '
'.$langs->trans("DefaultModelPropalCreate").''; - $texte .= $form->selectarray('value2', $list, $conf->global->PROPALE_ADDON_PDF_ODT_DEFAULT); + $texte .= $form->selectarray('value2', $list, getDolGlobalString('PROPALE_ADDON_PDF_ODT_DEFAULT')); $texte .= "
'.$langs->trans("DefaultModelPropalToBill").''; - $texte .= $form->selectarray('value3', $list, $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL); + $texte .= $form->selectarray('value3', $list, getDolGlobalString('PROPALE_ADDON_PDF_ODT_TOBILL')); $texte .= "
'.$langs->trans("DefaultModelPropalClosed").''; - $texte .= $form->selectarray('value4', $list, $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED); + $texte .= $form->selectarray('value4', $list, getDolGlobalString('PROPALE_ADDON_PDF_ODT_CLOSED')); $texte .= "
'; } diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index 55a7710c5a4..ede5bec1a81 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -117,13 +117,16 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal $form = new Form($this->db); + $odtChosen = getDolGlobalInt('MAIN_SUPPLIER_PROPOSAL_CHOOSE_ODT_DOCUMENT') > 0; + $odtPath = trim(getDolGlobalString('SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH')); + $texte = $this->description.".
\n"; $texte .= ''; $texte .= ''; $texte .= ''; $texte .= ''; $texte .= ''; - if ($conf->global->MAIN_SUPPLIER_PROPOSAL_CHOOSE_ODT_DOCUMENT > 0) { + if ($odtChosen) { $texte .= ''; $texte .= ''; $texte .= ''; @@ -133,7 +136,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal // List of directories area $texte .= ''; $texttitle = $langs->trans("ListOfDirectories"); - $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH))); + $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', $odtPath)); $listoffiles = array(); foreach ($listofdir as $key => $tmpdir) { $tmpdir = trim($tmpdir); @@ -159,7 +162,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal $texte .= $form->textwithpicto($texttitle, $texthelp, 1, 'help', '', 1); $texte .= '
'; $texte .= ''; $texte .= '
'; $texte .= ''; @@ -167,7 +170,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal // Scan directories $nbofiles = count($listoffiles); - if (!empty($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH)) { + if (!empty($odtPath)) { $texte .= $langs->trans("NumberOfModelFilesFound").': '; //$texte.=$nbofiles?'':''; $texte .= count($listoffiles); @@ -185,26 +188,26 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal } $texte .= '
'; - if ($conf->global->MAIN_SUPPLIER_PROPOSAL_CHOOSE_ODT_DOCUMENT > 0) { + if ($odtChosen) { // Model for creation $list = ModelePDFSupplierProposal::liste_modeles($this->db); $texte .= ''; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= '
'.$langs->trans("DefaultModelSupplierProposalCreate").''; - $texte .= $form->selectarray('value2', $list, $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_DEFAULT); + $texte .= $form->selectarray('value2', $list, getDolGlobalString('SUPPLIER_PROPOSAL_ADDON_PDF_ODT_DEFAULT')); $texte .= "
'.$langs->trans("DefaultModelSupplierProposalToBill").''; - $texte .= $form->selectarray('value3', $list, $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL); + $texte .= $form->selectarray('value3', $list, getDolGlobalString('SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL')); $texte .= "
'.$langs->trans("DefaultModelSupplierProposalClosed").''; - $texte .= $form->selectarray('value4', $list, $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED); + $texte .= $form->selectarray('value4', $list, getDolGlobalString('SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED')); $texte .= "
'; } diff --git a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php index c73a8a16db6..8a984af95f7 100644 --- a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php +++ b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php @@ -64,7 +64,7 @@ class mod_supplier_proposal_saphir extends ModeleNumRefSupplierProposal */ public function info() { - global $conf, $langs, $db; + global $langs, $db; $langs->load("bills"); @@ -83,9 +83,11 @@ class mod_supplier_proposal_saphir extends ModeleNumRefSupplierProposal $tooltip .= $langs->trans("GenericMaskCodes4a", $langs->transnoentities("CommRequest"), $langs->transnoentities("CommRequest")); $tooltip .= $langs->trans("GenericMaskCodes5"); + $mask = dolGetGlobalString('SUPPLIER_PROPOSAL_SAPHIR_MASK'); + // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; @@ -131,7 +133,7 @@ class mod_supplier_proposal_saphir extends ModeleNumRefSupplierProposal require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // On defini critere recherche compteur - $mask = $conf->global->SUPPLIER_PROPOSAL_SAPHIR_MASK; + $mask = empty($conf->global->SUPPLIER_PROPOSAL_SAPHIR_MASK) ? '' : $conf->global->SUPPLIER_PROPOSAL_SAPHIR_MASK; if (!$mask) { $this->error = 'NotConfigured'; diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index 1c3e346203b..62160bad9ad 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -114,13 +114,16 @@ class doc_generic_user_odt extends ModelePDFUser $form = new Form($this->db); + $odtChosen = getDolGlobalInt('MAIN_PROPAL_CHOOSE_ODT_DOCUMENT') > 0; + $odtPath = trim(getDolGlobalString('USER_ADDON_PDF_ODT_PATH')); + $texte = $this->description.".
\n"; $texte .= ''; $texte .= ''; $texte .= ''; $texte .= ''; $texte .= ''; - if (!empty($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT)) { + if ($odtChosen) { $texte .= ''; $texte .= ''; $texte .= ''; @@ -130,7 +133,7 @@ class doc_generic_user_odt extends ModelePDFUser // List of directories area $texte .= ''; $texttitle = $langs->trans("ListOfDirectories"); - $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim($conf->global->USER_ADDON_PDF_ODT_PATH))); + $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', $odtPath)); $listoffiles = array(); foreach ($listofdir as $key => $tmpdir) { $tmpdir = trim($tmpdir); @@ -156,7 +159,7 @@ class doc_generic_user_odt extends ModelePDFUser $texte .= $form->textwithpicto($texttitle, $texthelp, 1, 'help', '', 1); $texte .= '
'; $texte .= ''; $texte .= '
'; $texte .= ''; @@ -166,26 +169,26 @@ class doc_generic_user_odt extends ModelePDFUser if (count($listofdir)) { $texte .= $langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).''; - if (!empty($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT)) { + if ($odtChosen) { // Model for creation $list = ModelePDFUser::liste_modeles($this->db); $texte .= ''; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= '
'.$langs->trans("DefaultModelPropalCreate").''; - $texte .= $form->selectarray('value2', $list, $conf->global->USER_ADDON_PDF_ODT_DEFAULT); + $texte .= $form->selectarray('value2', $list, getDolGlobalString('USER_ADDON_PDF_ODT_DEFAULT')); $texte .= "
'.$langs->trans("DefaultModelPropalToBill").''; - $texte .= $form->selectarray('value3', $list, $conf->global->USER_ADDON_PDF_ODT_TOBILL); + $texte .= $form->selectarray('value3', $list, getDolGlobalString('USER_ADDON_PDF_ODT_TOBILL')); $texte .= "
'.$langs->trans("DefaultModelPropalClosed").''; - $texte .= $form->selectarray('value4', $list, $conf->global->USER_ADDON_PDF_ODT_CLOSED); + $texte .= $form->selectarray('value4', $list, getDolGlobalString('USER_ADDON_PDF_ODT_CLOSED')); $texte .= "
'; } diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index 4bbb39c0086..f8a8f54b14b 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -117,13 +117,16 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup $form = new Form($this->db); + $odtChosen = getDolGlobalInt('MAIN_PROPAL_CHOOSE_ODT_DOCUMENT') > 0; + $odtPath = trim(getDolGlobalString('USERGROUP_ADDON_PDF_ODT_PATH')); + $texte = $this->description.".
\n"; $texte .= ''; $texte .= ''; $texte .= ''; $texte .= ''; $texte .= ''; - if (!empty($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT)) { + if ($odtChosen) { $texte .= ''; $texte .= ''; $texte .= ''; @@ -133,7 +136,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup // List of directories area $texte .= ''; $texttitle = $langs->trans("ListOfDirectories"); - $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim($conf->global->USERGROUP_ADDON_PDF_ODT_PATH))); + $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', $odtPath)); $listoffiles = array(); foreach ($listofdir as $key => $tmpdir) { $tmpdir = trim($tmpdir); @@ -159,7 +162,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup $texte .= $form->textwithpicto($texttitle, $texthelp, 1, 'help', '', 1); $texte .= '
'; $texte .= ''; $texte .= '
'; $texte .= ''; @@ -169,26 +172,26 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup if (count($listofdir)) { $texte .= $langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).''; - if (!empty($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT)) { + if ($odtChosen) { // Model for creation $list = ModelePDFUserGroup::liste_modeles($this->db); $texte .= ''; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= '
'.$langs->trans("DefaultModelPropalCreate").''; - $texte .= $form->selectarray('value2', $list, $conf->global->USERGROUP_ADDON_PDF_ODT_DEFAULT); + $texte .= $form->selectarray('value2', $list, getDolGlobalString('USERGROUP_ADDON_PDF_ODT_DEFAULT')); $texte .= "
'.$langs->trans("DefaultModelPropalToBill").''; - $texte .= $form->selectarray('value3', $list, $conf->global->USERGROUP_ADDON_PDF_ODT_TOBILL); + $texte .= $form->selectarray('value3', $list, getDolGlobalString('USERGROUP_ADDON_PDF_ODT_TOBILL')); $texte .= "
'.$langs->trans("DefaultModelPropalClosed").''; - $texte .= $form->selectarray('value4', $list, $conf->global->USERGROUP_ADDON_PDF_ODT_CLOSED); + $texte .= $form->selectarray('value4', $list, getDolGlobalString('USERGROUP_ADDON_PDF_ODT_CLOSED')); $texte .= "
'; } diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 686f59a70c7..d8b57918d83 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -1101,7 +1101,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $ret = $actioncomm->create($user); // User creating action if ($ret > 0 && !empty($conf->global->MAIN_COPY_FILE_IN_EVENT_AUTO)) { - if (is_array($object->attachedfiles) && array_key_exists('paths', $object->attachedfiles) && count($object->attachedfiles['paths']) > 0) { + if (property_exists($object, 'attachedfiles') && is_array($object->attachedfiles) && array_key_exists('paths', $object->attachedfiles) && count($object->attachedfiles['paths']) > 0) { foreach ($object->attachedfiles['paths'] as $key => $filespath) { $srcfile = $filespath; $destdir = $conf->agenda->dir_output.'/'.$ret; diff --git a/htdocs/dav/dav.lib.php b/htdocs/dav/dav.lib.php index 2861b8744bf..9babbabbe83 100644 --- a/htdocs/dav/dav.lib.php +++ b/htdocs/dav/dav.lib.php @@ -54,7 +54,7 @@ function dav_admin_prepare_head() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/admin/dav.php?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT.'/admin/dav.php'; $head[$h][1] = $langs->trans("WebDAV"); $head[$h][2] = 'webdav'; $h++;