getDol rather than ->global

This commit is contained in:
Florian HENRY
2023-06-08 22:38:11 +02:00
parent 88175964f9
commit ce10c68d31
29 changed files with 120 additions and 120 deletions

View File

@@ -262,8 +262,8 @@ class doc_generic_asset_odt extends ModelePDFAsset
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
// Get extension (ods or odt) // Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1); $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = $conf->global->MAIN_DOC_USE_TIMING; $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') { if ($format == '1') {
$format = '%Y%m%d%H%M%S'; $format = '%Y%m%d%H%M%S';
} }

View File

@@ -274,8 +274,8 @@ class doc_generic_bom_odt extends ModelePDFBom
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
// Get extension (ods or odt) // Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1); $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = $conf->global->MAIN_DOC_USE_TIMING; $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') { if ($format == '1') {
$format = '%Y%m%d%H%M%S'; $format = '%Y%m%d%H%M%S';
} }

View File

@@ -280,8 +280,8 @@ class doc_generic_order_odt extends ModelePDFCommandes
// Get extension (ods or odt) // Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1); $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = $conf->global->MAIN_DOC_USE_TIMING; $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') { if ($format == '1') {
$format = '%Y%m%d%H%M%S'; $format = '%Y%m%d%H%M%S';
} }

View File

@@ -278,8 +278,8 @@ class doc_generic_contract_odt extends ModelePDFContract
// Get extension (ods or odt) // Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1); $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = $conf->global->MAIN_DOC_USE_TIMING; $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') { if ($format == '1') {
$format = '%Y%m%d%H%M%S'; $format = '%Y%m%d%H%M%S';
} }

View File

@@ -278,8 +278,8 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
// Get extension (ods or odt) // Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1); $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = $conf->global->MAIN_DOC_USE_TIMING; $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') { if ($format == '1') {
$format = '%Y%m%d%H%M%S'; $format = '%Y%m%d%H%M%S';
} }

View File

@@ -278,8 +278,8 @@ class doc_generic_invoice_odt extends ModelePDFFactures
// Get extension (ods or odt) // Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1); $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = $conf->global->MAIN_DOC_USE_TIMING; $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') { if ($format == '1') {
$format = '%Y%m%d%H%M%S'; $format = '%Y%m%d%H%M%S';
} }

View File

@@ -268,8 +268,8 @@ class doc_generic_member_odt extends ModelePDFMember
// Get extension (ods or odt) // Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1); $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = $conf->global->MAIN_DOC_USE_TIMING; $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') { if ($format == '1') {
$format = '%Y%m%d%H%M%S'; $format = '%Y%m%d%H%M%S';
} }

View File

@@ -267,8 +267,8 @@ class doc_generic_mo_odt extends ModelePDFMo
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
// Get extension (ods or odt) // Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1); $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = $conf->global->MAIN_DOC_USE_TIMING; $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') { if ($format == '1') {
$format = '%Y%m%d%H%M%S'; $format = '%Y%m%d%H%M%S';
} }

View File

@@ -276,8 +276,8 @@ class doc_generic_product_odt extends ModelePDFProduct
// Get extension (ods or odt) // Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1); $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = $conf->global->MAIN_DOC_USE_TIMING; $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') { if ($format == '1') {
$format = '%Y%m%d%H%M%S'; $format = '%Y%m%d%H%M%S';
} }

View File

@@ -559,8 +559,8 @@ class doc_generic_project_odt extends ModelePDFProjects
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
// Get extension (ods or odt) // Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1); $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = $conf->global->MAIN_DOC_USE_TIMING; $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') { if ($format == '1') {
$format = '%Y%m%d%H%M%S'; $format = '%Y%m%d%H%M%S';
} }

View File

@@ -312,8 +312,8 @@ class doc_generic_proposal_odt extends ModelePDFPropales
// Get extension (ods or odt) // Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1); $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = $conf->global->MAIN_DOC_USE_TIMING; $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') { if ($format == '1') {
$format = '%Y%m%d%H%M%S'; $format = '%Y%m%d%H%M%S';
} }

View File

@@ -271,8 +271,8 @@ class doc_generic_reception_odt extends ModelePdfReception
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
// Get extension (ods or odt) // Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1); $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = $conf->global->MAIN_DOC_USE_TIMING; $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') { if ($format == '1') {
$format = '%Y%m%d%H%M%S'; $format = '%Y%m%d%H%M%S';
} }

View File

@@ -252,8 +252,8 @@ class doc_generic_odt extends ModeleThirdPartyDoc
$newfiletmp = dol_sanitizeFileName(dol_string_nospecial($object->name)) . '-' . $newfiletmp; $newfiletmp = dol_sanitizeFileName(dol_string_nospecial($object->name)) . '-' . $newfiletmp;
$newfiletmp = preg_replace('/__+/', '_', $newfiletmp); // Replace repeated _ into one _ (to avoid string with substitution syntax) $newfiletmp = preg_replace('/__+/', '_', $newfiletmp); // Replace repeated _ into one _ (to avoid string with substitution syntax)
} }
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = $conf->global->MAIN_DOC_USE_TIMING; $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') { if ($format == '1') {
$format = '%Y%m%d%H%M%S'; $format = '%Y%m%d%H%M%S';
} }

View File

@@ -278,8 +278,8 @@ class doc_generic_stock_odt extends ModelePDFStock
// Get extension (ods or odt) // Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1); $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = $conf->global->MAIN_DOC_USE_TIMING; $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') { if ($format == '1') {
$format = '%Y%m%d%H%M%S'; $format = '%Y%m%d%H%M%S';
} }

View File

@@ -271,8 +271,8 @@ class doc_generic_supplier_invoice_odt extends ModelePDFSuppliersInvoices
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
// Get extension (ods or odt) // Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1); $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = $conf->global->MAIN_DOC_USE_TIMING; $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') { if ($format == '1') {
$format = '%Y%m%d%H%M%S'; $format = '%Y%m%d%H%M%S';
} }

View File

@@ -266,8 +266,8 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
// Get extension (ods or odt) // Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1); $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = $conf->global->MAIN_DOC_USE_TIMING; $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') { if ($format == '1') {
$format = '%Y%m%d%H%M%S'; $format = '%Y%m%d%H%M%S';
} }

View File

@@ -300,8 +300,8 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
// Get extension (ods or odt) // Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1); $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = $conf->global->MAIN_DOC_USE_TIMING; $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') { if ($format == '1') {
$format = '%Y%m%d%H%M%S'; $format = '%Y%m%d%H%M%S';
} }

View File

@@ -266,8 +266,8 @@ class doc_generic_ticket_odt extends ModelePDFTicket
// Get extension (ods or odt) // Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1); $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = $conf->global->MAIN_DOC_USE_TIMING; $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') { if ($format == '1') {
$format = '%Y%m%d%H%M%S'; $format = '%Y%m%d%H%M%S';
} }

View File

@@ -300,8 +300,8 @@ class doc_generic_user_odt extends ModelePDFUser
// Get extension (ods or odt) // Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1); $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = $conf->global->MAIN_DOC_USE_TIMING; $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') { if ($format == '1') {
$format = '%Y%m%d%H%M%S'; $format = '%Y%m%d%H%M%S';
} }

View File

@@ -282,8 +282,8 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
// Get extension (ods or odt) // Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1); $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = $conf->global->MAIN_DOC_USE_TIMING; $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') { if ($format == '1') {
$format = '%Y%m%d%H%M%S'; $format = '%Y%m%d%H%M%S';
} }

View File

@@ -244,7 +244,7 @@ if ($action == 'updateMask') {
$tmpobjectkey = GETPOST('object'); $tmpobjectkey = GETPOST('object');
if (!empty($tmpobjectkey)) { if (!empty($tmpobjectkey)) {
$constforval = 'MYMODULE_'.strtoupper($tmpobjectkey).'_ADDON_PDF'; $constforval = 'MYMODULE_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
if ($conf->global->$constforval == "$value") { if (getDolGlobalString($constforval) == "$value") {
dolibarr_del_const($db, $constforval, $conf->entity); dolibarr_del_const($db, $constforval, $conf->entity);
} }
} }
@@ -357,10 +357,10 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
$module = new $file($db); $module = new $file($db);
// Show modules according to features level // Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) { if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue; continue;
} }
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) { if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue; continue;
} }
@@ -494,10 +494,10 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
$module = new $classname($db); $module = new $classname($db);
$modulequalified = 1; $modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) { if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0; $modulequalified = 0;
} }
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) { if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0; $modulequalified = 0;
} }

View File

@@ -85,7 +85,7 @@ class MyObject extends CommonObject
* Note: Filter must be a Dolibarr Universal Filter syntax string. Example: "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.status:!=:0) or (t.nature:is:NULL)" * Note: Filter must be a Dolibarr Universal Filter syntax string. Example: "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.status:!=:0) or (t.nature:is:NULL)"
* 'label' the translation key. * 'label' the translation key.
* 'picto' is code of a picto to show before value in forms * 'picto' is code of a picto to show before value in forms
* 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or 'isModEnabled("multicurrency")' ...) * 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalInt('MY_SETUP_PARAM') or 'isModEnabled("multicurrency")' ...)
* 'position' is the sort order of field. * 'position' is the sort order of field.
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
@@ -252,7 +252,7 @@ class MyObject extends CommonObject
$this->db = $db; $this->db = $db;
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid']) && !empty($this->fields['ref'])) { if (getDolGlobalInt('MAIN_SHOW_TECHNICAL_ID') && isset($this->fields['rowid']) && !empty($this->fields['ref'])) {
$this->fields['rowid']['visible'] = 0; $this->fields['rowid']['visible'] = 0;
} }
if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { if (!isModEnabled('multicompany') && isset($this->fields['entity'])) {
@@ -574,8 +574,8 @@ class MyObject extends CommonObject
return 0; return 0;
} }
/*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->myobject->write)) /*if (! ((!getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->myobject->write))
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->myobject->myobject_advance->validate)))) || (getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->myobject->myobject_advance->validate))))
{ {
$this->error='NotEnoughPermissions'; $this->error='NotEnoughPermissions';
dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);
@@ -692,8 +692,8 @@ class MyObject extends CommonObject
return 0; return 0;
} }
/*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) /*if (! ((!getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->write))
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) || (getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->mymodule_advance->validate))))
{ {
$this->error='Permission denied'; $this->error='Permission denied';
return -1; return -1;
@@ -716,8 +716,8 @@ class MyObject extends CommonObject
return 0; return 0;
} }
/*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) /*if (! ((!getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->write))
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) || (getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->mymodule_advance->validate))))
{ {
$this->error='Permission denied'; $this->error='Permission denied';
return -1; return -1;
@@ -740,8 +740,8 @@ class MyObject extends CommonObject
return 0; return 0;
} }
/*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) /*if (! ((!getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->write))
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) || (getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->mymodule_advance->validate))))
{ {
$this->error='Permission denied'; $this->error='Permission denied';
return -1; return -1;
@@ -763,7 +763,7 @@ class MyObject extends CommonObject
$datas = []; $datas = [];
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { if (getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER')) {
return ['optimize' => $langs->trans("ShowMyObject")]; return ['optimize' => $langs->trans("ShowMyObject")];
} }
$datas['picto'] = img_picto('', $this->picto).' <u>'.$langs->trans("MyObject").'</u>'; $datas['picto'] = img_picto('', $this->picto).' <u>'.$langs->trans("MyObject").'</u>';
@@ -824,7 +824,7 @@ class MyObject extends CommonObject
$linkclose = ''; $linkclose = '';
if (empty($notooltip)) { if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { if (getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowMyObject"); $label = $langs->trans("ShowMyObject");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
} }
@@ -864,7 +864,7 @@ class MyObject extends CommonObject
$pospoint = strpos($filearray[0]['name'], '.'); $pospoint = strpos($filearray[0]['name'], '.');
$pathtophoto = $class.'/'.$this->ref.'/thumbs/'.substr($filename, 0, $pospoint).'_mini'.substr($filename, $pospoint); $pathtophoto = $class.'/'.$this->ref.'/thumbs/'.substr($filename, 0, $pospoint).'_mini'.substr($filename, $pospoint);
if (empty($conf->global->{strtoupper($module.'_'.$class).'_FORMATLISTPHOTOSASUSERS'})) { if (!getDolGlobalInt(strtoupper($module.'_'.$class).'_FORMATLISTPHOTOSASUSERS')) {
$result .= '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$module.'" alt="No photo" border="0" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$module.'&entity='.$conf->entity.'&file='.urlencode($pathtophoto).'"></div></div>'; $result .= '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$module.'" alt="No photo" border="0" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$module.'&entity='.$conf->entity.'&file='.urlencode($pathtophoto).'"></div></div>';
} else { } else {
$result .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photouserphoto userphoto" alt="No photo" border="0" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$module.'&entity='.$conf->entity.'&file='.urlencode($pathtophoto).'"></div>'; $result .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photouserphoto userphoto" alt="No photo" border="0" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$module.'&entity='.$conf->entity.'&file='.urlencode($pathtophoto).'"></div>';
@@ -1073,15 +1073,15 @@ class MyObject extends CommonObject
global $langs, $conf; global $langs, $conf;
$langs->load("mymodule@mymodule"); $langs->load("mymodule@mymodule");
if (empty($conf->global->MYMODULE_MYOBJECT_ADDON)) { if (empty(getDolGlobalString('MYMODULE_MYOBJECT_ADDON'))) {
$conf->global->MYMODULE_MYOBJECT_ADDON = 'mod_myobject_standard'; $conf->global->MYMODULE_MYOBJECT_ADDON = 'mod_myobject_standard';
} }
if (!empty($conf->global->MYMODULE_MYOBJECT_ADDON)) { if (!empty(getDolGlobalString('MYMODULE_MYOBJECT_ADDON'))) {
$mybool = false; $mybool = false;
$file = $conf->global->MYMODULE_MYOBJECT_ADDON.".php"; $file = getDolGlobalString('MYMODULE_MYOBJECT_ADDON').".php";
$classname = $conf->global->MYMODULE_MYOBJECT_ADDON; $classname = getDolGlobalString('MYMODULE_MYOBJECT_ADDON');
// Include file with class // Include file with class
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
@@ -1143,8 +1143,8 @@ class MyObject extends CommonObject
if (!empty($this->model_pdf)) { if (!empty($this->model_pdf)) {
$modele = $this->model_pdf; $modele = $this->model_pdf;
} elseif (!empty($conf->global->MYOBJECT_ADDON_PDF)) { } elseif (getDolGlobalString('MYOBJECT_ADDON_PDF')) {
$modele = $conf->global->MYOBJECT_ADDON_PDF; $modele = getDolGlobalString('MYOBJECT_ADDON_PDF');
} }
} }

View File

@@ -410,8 +410,8 @@ class modMyModule extends DolibarrModules
$this->import_convertvalue_array[$r] = array( $this->import_convertvalue_array[$r] = array(
't.ref' => array( 't.ref' => array(
'rule'=>'getrefifauto', 'rule'=>'getrefifauto',
'class'=>(empty($conf->global->MYMODULE_MYOBJECT_ADDON) ? 'mod_myobject_standard' : $conf->global->MYMODULE_MYOBJECT_ADDON), 'class'=>(empty(getDolGlobalString('MYMODULE_MYOBJECT_ADDON')) ? 'mod_myobject_standard' : getDolGlobalString('MYMODULE_MYOBJECT_ADDON')),
'path'=>"/core/modules/commande/".(empty($conf->global->MYMODULE_MYOBJECT_ADDON) ? 'mod_myobject_standard' : $conf->global->MYMODULE_MYOBJECT_ADDON).'.php' 'path'=>"/core/modules/commande/".(empty(getDolGlobalString('MYMODULE_MYOBJECT_ADDON')) ? 'mod_myobject_standard' : getDolGlobalString('MYMODULE_MYOBJECT_ADDON')).'.php'
'classobject'=>'MyObject', 'classobject'=>'MyObject',
'pathobject'=>'/mymodule/class/myobject.class.php', 'pathobject'=>'/mymodule/class/myobject.class.php',
), ),

View File

@@ -129,7 +129,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
// List of directories area // List of directories area
$texte .= '<tr><td>'; $texte .= '<tr><td>';
$texttitle = $langs->trans("ListOfDirectories"); $texttitle = $langs->trans("ListOfDirectories");
$listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim($conf->global->MYMODULE_MYOBJECT_ADDON_PDF_ODT_PATH))); $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim(getDolGlobalString('MYMODULE_MYOBJECT_ADDON_PDF_ODT_PATH'))));
$listoffiles = array(); $listoffiles = array();
foreach ($listofdir as $key => $tmpdir) { foreach ($listofdir as $key => $tmpdir) {
$tmpdir = trim($tmpdir); $tmpdir = trim($tmpdir);
@@ -155,7 +155,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
$texte .= $form->textwithpicto($texttitle, $texthelp, 1, 'help', '', 1); $texte .= $form->textwithpicto($texttitle, $texthelp, 1, 'help', '', 1);
$texte .= '<div><div style="display: inline-block; min-width: 100px; vertical-align: middle;">'; $texte .= '<div><div style="display: inline-block; min-width: 100px; vertical-align: middle;">';
$texte .= '<textarea class="flat" cols="60" name="value1">'; $texte .= '<textarea class="flat" cols="60" name="value1">';
$texte .= $conf->global->MYMODULE_MYOBJECT_ADDON_PDF_ODT_PATH; $texte .= getDolGlobalString('MYMODULE_MYOBJECT_ADDON_PDF_ODT_PATH');
$texte .= '</textarea>'; $texte .= '</textarea>';
$texte .= '</div><div style="display: inline-block; vertical-align: middle;">'; $texte .= '</div><div style="display: inline-block; vertical-align: middle;">';
$texte .= '<input type="submit" class="button small reposition" name="modify" value="'.dol_escape_htmltag($langs->trans("Modify")).'">'; $texte .= '<input type="submit" class="button small reposition" name="modify" value="'.dol_escape_htmltag($langs->trans("Modify")).'">';
@@ -163,7 +163,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
// Scan directories // Scan directories
$nbofiles = count($listoffiles); $nbofiles = count($listoffiles);
if (!empty($conf->global->MYMODULE_MYOBJECT_ADDON_PDF_ODT_PATH)) { if (!empty(getDolGlobalString('MYMODULE_MYOBJECT_ADDON_PDF_ODT_PATH'))) {
$texte .= $langs->trans("NumberOfModelFilesFound").': <b>'; $texte .= $langs->trans("NumberOfModelFilesFound").': <b>';
//$texte.=$nbofiles?'<a id="a_'.get_class($this).'" href="#">':''; //$texte.=$nbofiles?'<a id="a_'.get_class($this).'" href="#">':'';
$texte .= count($listoffiles); $texte .= count($listoffiles);
@@ -283,8 +283,8 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
// Get extension (ods or odt) // Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1); $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = $conf->global->MAIN_DOC_USE_TIMING; $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') { if ($format == '1') {
$format = '%Y%m%d%H%M%S'; $format = '%Y%m%d%H%M%S';
} }
@@ -317,7 +317,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
$contactobject = null; $contactobject = null;
if (!empty($usecontact)) { if (!empty($usecontact)) {
// We can use the company of contact instead of thirdparty company // We can use the company of contact instead of thirdparty company
if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || getDolGlobalInt('MAIN_USE_COMPANY_NAME_OF_CONTACT'))) {
$object->contact->fetch_thirdparty(); $object->contact->fetch_thirdparty();
$socobject = $object->contact->thirdparty; $socobject = $object->contact->thirdparty;
$contactobject = $object->contact; $contactobject = $object->contact;
@@ -346,8 +346,8 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
// Line of free text // Line of free text
$newfreetext = ''; $newfreetext = '';
$paramfreetext = 'MYMODULE_MYOBJECT_FREE_TEXT'; $paramfreetext = 'MYMODULE_MYOBJECT_FREE_TEXT';
if (!empty($conf->global->$paramfreetext)) { if (getDolGlobalString($paramfreetext)) {
$newfreetext = make_substitutions($conf->global->$paramfreetext, $substitutionarray); $newfreetext = make_substitutions(getDolGlobalString($paramfreetext), $substitutionarray);
} }
// Open and load template // Open and load template
@@ -473,7 +473,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks $reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file // Write new file
if (!empty($conf->global->MAIN_ODT_AS_PDF)) { if (getDolGlobalInt('MAIN_ODT_AS_PDF')) {
try { try {
$odfHandler->exportAsAttachedPDF($file); $odfHandler->exportAsAttachedPDF($file);
} catch (Exception $e) { } catch (Exception $e) {

View File

@@ -172,32 +172,32 @@ class pdf_standard_myobject extends ModelePDFMyObject
$outputlangs = $langs; $outputlangs = $langs;
} }
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
if (!empty($conf->global->MAIN_USE_FPDF)) { if (getDolGlobalInt('MAIN_USE_FPDF')) {
$outputlangs->charset_output = 'ISO-8859-1'; $outputlangs->charset_output = 'ISO-8859-1';
} }
// Load translation files required by the page // Load translation files required by the page
$outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies")); $outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies"));
if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) { if (!empty(getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')) && $outputlangs->defaultlang != getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')) {
global $outputlangsbis; global $outputlangsbis;
$outputlangsbis = new Translate('', $conf); $outputlangsbis = new Translate('', $conf);
$outputlangsbis->setDefaultLang($conf->global->PDF_USE_ALSO_LANGUAGE_CODE); $outputlangsbis->setDefaultLang(getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE'));
$outputlangsbis->loadLangs(array("main", "bills", "products", "dict", "companies")); $outputlangsbis->loadLangs(array("main", "bills", "products", "dict", "companies"));
} }
$nblines = (is_array($object->lines) ? count($object->lines) : 0); $nblines = (is_array($object->lines) ? count($object->lines) : 0);
$hidetop = 0; $hidetop = 0;
if (!empty($conf->global->MAIN_PDF_DISABLE_COL_HEAD_TITLE)) { if (getDolGlobalString('MAIN_PDF_DISABLE_COL_HEAD_TITLE')) {
$hidetop = $conf->global->MAIN_PDF_DISABLE_COL_HEAD_TITLE; $hidetop = getDolGlobalString('MAIN_PDF_DISABLE_COL_HEAD_TITLE');
} }
// Loop on each lines to detect if there is at least one image to show // Loop on each lines to detect if there is at least one image to show
$realpatharray = array(); $realpatharray = array();
$this->atleastonephoto = false; $this->atleastonephoto = false;
/* /*
if (!empty($conf->global->MAIN_GENERATE_MYOBJECT_WITH_PICTURE)) if (getDolGlobalInt('MAIN_GENERATE_MYOBJECT_WITH_PICTURE')))
{ {
$objphoto = new Product($this->db); $objphoto = new Product($this->db);
@@ -285,7 +285,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
$heightforinfotot = 50; // Height reserved to output the info and total part and payment part $heightforinfotot = 50; // Height reserved to output the info and total part and payment part
$heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + (empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 12 : 22); // Height reserved to output the footer (value include bottom margin) $heightforfooter = $this->marge_basse + (getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin)
if (class_exists('TCPDF')) { if (class_exists('TCPDF')) {
$pdf->setPrintHeader(false); $pdf->setPrintHeader(false);
@@ -294,8 +294,8 @@ class pdf_standard_myobject extends ModelePDFMyObject
$pdf->SetFont(pdf_getPDFFont($outputlangs)); $pdf->SetFont(pdf_getPDFFont($outputlangs));
// Set path to the background PDF File // Set path to the background PDF File
if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) { if (getDolGlobalInt('MAIN_ADD_PDF_BACKGROUND')) {
$pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
$tplidx = $pdf->importPage(1); $tplidx = $pdf->importPage(1);
} }
@@ -316,7 +316,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
$cert = empty($user->conf->CERTIFICATE_CRT) ? '' : $user->conf->CERTIFICATE_CRT; $cert = empty($user->conf->CERTIFICATE_CRT) ? '' : $user->conf->CERTIFICATE_CRT;
// If user has no certificate, we try to take the company one // If user has no certificate, we try to take the company one
if (!$cert) { if (!$cert) {
$cert = empty($conf->global->CERTIFICATE_CRT) ? '' : $conf->global->CERTIFICATE_CRT; $cert = getDolGlobalString('CERTIFICATE_CRT') ? '' : getDolGlobalString('CERTIFICATE_CRT');
} }
// If a certificate is found // If a certificate is found
if ($cert) { if ($cert) {
@@ -344,10 +344,10 @@ class pdf_standard_myobject extends ModelePDFMyObject
$pdf->SetTextColor(0, 0, 0); $pdf->SetTextColor(0, 0, 0);
$tab_top = 90 + $top_shift; $tab_top = 90 + $top_shift;
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift : 10); $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10);
$tab_height = 130 - $top_shift; $tab_height = 130 - $top_shift;
$tab_height_newpage = 150; $tab_height_newpage = 150;
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
$tab_height_newpage -= $top_shift; $tab_height_newpage -= $top_shift;
} }
@@ -391,7 +391,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
if (!empty($tplidx)) { if (!empty($tplidx)) {
$pdf->useTemplate($tplidx); $pdf->useTemplate($tplidx);
} }
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
$this->_pagehead($pdf, $object, 0, $outputlangs); $this->_pagehead($pdf, $object, 0, $outputlangs);
} }
// $this->_pagefoot($pdf,$object,$outputlangs,1); // $this->_pagefoot($pdf,$object,$outputlangs,1);
@@ -449,7 +449,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
if (!empty($tplidx)) { if (!empty($tplidx)) {
$pdf->useTemplate($tplidx); $pdf->useTemplate($tplidx);
} }
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
$this->_pagehead($pdf, $object, 0, $outputlangs); $this->_pagehead($pdf, $object, 0, $outputlangs);
} }
$height_note = $posyafter - $tab_top_newpage; $height_note = $posyafter - $tab_top_newpage;
@@ -471,7 +471,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
if (!empty($tplidx)) { if (!empty($tplidx)) {
$pdf->useTemplate($tplidx); $pdf->useTemplate($tplidx);
} }
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
$this->_pagehead($pdf, $object, 0, $outputlangs); $this->_pagehead($pdf, $object, 0, $outputlangs);
} }
@@ -528,7 +528,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
$curY = $tab_top_newpage; $curY = $tab_top_newpage;
// Allows data in the first page if description is long enough to break in multiples pages // Allows data in the first page if description is long enough to break in multiples pages
if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) { if (getDolGlobalInt('MAIN_PDF_DATA_ON_FIRST_PAGE')) {
$showpricebeforepagebreak = 1; $showpricebeforepagebreak = 1;
} else { } else {
$showpricebeforepagebreak = 0; $showpricebeforepagebreak = 0;
@@ -569,7 +569,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
} else { } else {
// We found a page break // We found a page break
// Allows data in the first page if description is long enough to break in multiples pages // Allows data in the first page if description is long enough to break in multiples pages
if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) { if (getDolGlobalInt('MAIN_PDF_DATA_ON_FIRST_PAGE')) {
$showpricebeforepagebreak = 1; $showpricebeforepagebreak = 1;
} else { } else {
$showpricebeforepagebreak = 0; $showpricebeforepagebreak = 0;
@@ -689,7 +689,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
$nexY = max($nexY, $posYAfterImage); $nexY = max($nexY, $posYAfterImage);
// Add line // Add line
if (!empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) { if (getDolGlobalInt('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) {
$pdf->setPage($pageposafter); $pdf->setPage($pageposafter);
$pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80))); $pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80)));
//$pdf->SetDrawColor(190,190,200); //$pdf->SetDrawColor(190,190,200);
@@ -709,7 +709,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
$pagenb++; $pagenb++;
$pdf->setPage($pagenb); $pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
$this->_pagehead($pdf, $object, 0, $outputlangs); $this->_pagehead($pdf, $object, 0, $outputlangs);
} }
if (!empty($tplidx)) { if (!empty($tplidx)) {
@@ -730,7 +730,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
$pdf->useTemplate($tplidx); $pdf->useTemplate($tplidx);
} }
$pagenb++; $pagenb++;
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
$this->_pagehead($pdf, $object, 0, $outputlangs); $this->_pagehead($pdf, $object, 0, $outputlangs);
} }
} }
@@ -753,7 +753,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
// Display payment area // Display payment area
/* /*
if (($deja_regle || $amount_credit_notes_included || $amount_deposits_included) && empty($conf->global->INVOICE_NO_PAYMENT_DETAILS)) if (($deja_regle || $amount_credit_notes_included || $amount_deposits_included) && !getDolGlobalInt('INVOICE_NO_PAYMENT_DETAILS')))
{ {
$posy = $this->drawPaymentsTable($pdf, $object, $posy, $outputlangs); $posy = $this->drawPaymentsTable($pdf, $object, $posy, $outputlangs);
} }
@@ -842,7 +842,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
if (empty($hidetop)) { if (empty($hidetop)) {
$titre = $outputlangs->transnoentities("AmountInCurrency", $outputlangs->transnoentitiesnoconv("Currency".$currency)); $titre = $outputlangs->transnoentities("AmountInCurrency", $outputlangs->transnoentitiesnoconv("Currency".$currency));
if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) { if (getDolGlobalInt('PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) {
$titre .= ' - '.$outputlangsbis->transnoentities("AmountInCurrency", $outputlangsbis->transnoentitiesnoconv("Currency".$currency)); $titre .= ' - '.$outputlangsbis->transnoentities("AmountInCurrency", $outputlangsbis->transnoentitiesnoconv("Currency".$currency));
} }
@@ -850,8 +850,8 @@ class pdf_standard_myobject extends ModelePDFMyObject
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
if (!empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) { if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) {
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, 'F', null, explode(',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)); $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')));
} }
} }
@@ -937,7 +937,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
$pdf->SetXY($posx, $posy); $pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60); $pdf->SetTextColor(0, 0, 60);
$title = $outputlangs->transnoentities("PdfTitle"); $title = $outputlangs->transnoentities("PdfTitle");
if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) { if (!empty(getDolGlobalInt('MAIN_ODT_AS_PDF')) && is_object($outputlangsbis)) {
$title .= ' - '; $title .= ' - ';
$title .= $outputlangsbis->transnoentities("PdfTitle"); $title .= $outputlangsbis->transnoentities("PdfTitle");
} }
@@ -965,7 +965,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefCustomer")." : ".$outputlangs->convToOutputCharset($object->ref_client), '', 'R'); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefCustomer")." : ".$outputlangs->convToOutputCharset($object->ref_client), '', 'R');
} }
if (!empty($conf->global->PDF_SHOW_PROJECT_TITLE)) { if (getDolGlobalInt('PDF_SHOW_PROJECT_TITLE')) {
$object->fetch_projet(); $object->fetch_projet();
if (!empty($object->project->ref)) { if (!empty($object->project->ref)) {
$posy += 3; $posy += 3;
@@ -975,7 +975,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
} }
} }
if (!empty($conf->global->PDF_SHOW_PROJECT)) { if (getDolGlobalInt('PDF_SHOW_PROJECT')) {
$object->fetch_projet(); $object->fetch_projet();
if (!empty($object->project->ref)) { if (!empty($object->project->ref)) {
$outputlangs->load("projects"); $outputlangs->load("projects");
@@ -991,7 +991,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
$pdf->SetTextColor(0, 0, 60); $pdf->SetTextColor(0, 0, 60);
$title = $outputlangs->transnoentities("Date"); $title = $outputlangs->transnoentities("Date");
if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) { if (getDolGlobalInt('PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) {
$title .= ' - '.$outputlangsbis->transnoentities("Date"); $title .= ' - '.$outputlangsbis->transnoentities("Date");
} }
$pdf->MultiCell($w, 3, $title." : ".dol_print_date($object->date, "day", false, $outputlangs), '', 'R'); $pdf->MultiCell($w, 3, $title." : ".dol_print_date($object->date, "day", false, $outputlangs), '', 'R');
@@ -1004,7 +1004,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
} }
// Get contact // Get contact
if (!empty($conf->global->DOC_SHOW_FIRST_SALES_REP)) { if (getDolGlobalInt('DOC_SHOW_FIRST_SALES_REP')) {
$arrayidcontact = $object->getIdContact('internal', 'SALESREPFOLL'); $arrayidcontact = $object->getIdContact('internal', 'SALESREPFOLL');
if (count($arrayidcontact) > 0) { if (count($arrayidcontact) > 0) {
$usertmp = new User($this->db); $usertmp = new User($this->db);
@@ -1031,15 +1031,15 @@ class pdf_standard_myobject extends ModelePDFMyObject
$carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object); $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object);
// Show sender // Show sender
$posy = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 40 : 42; $posy = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42;
$posy += $top_shift; $posy += $top_shift;
$posx = $this->marge_gauche; $posx = $this->marge_gauche;
if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) { if (getDolGlobalInt('MAIN_INVERT_SENDER_RECIPIENT')) {
$posx = $this->page_largeur - $this->marge_droite - 80; $posx = $this->page_largeur - $this->marge_droite - 80;
} }
$hautcadre = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 38 : 40; $hautcadre = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? 38 : 40;
$widthrecbox = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 82; $widthrecbox = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 82;
// Show sender frame // Show sender frame
@@ -1085,14 +1085,14 @@ class pdf_standard_myobject extends ModelePDFMyObject
$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object); $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object);
// Show recipient // Show recipient
$widthrecbox = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 100; $widthrecbox = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100;
if ($this->page_largeur < 210) { if ($this->page_largeur < 210) {
$widthrecbox = 84; // To work with US executive format $widthrecbox = 84; // To work with US executive format
} }
$posy = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 40 : 42; $posy = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42;
$posy += $top_shift; $posy += $top_shift;
$posx = $this->page_largeur - $this->marge_droite - $widthrecbox; $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) { if (getDolGlobalInt('MAIN_INVERT_SENDER_RECIPIENT')) {
$posx = $this->marge_gauche; $posx = $this->marge_gauche;
} }
@@ -1133,7 +1133,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0) protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
{ {
global $conf; global $conf;
$showdetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 0 : $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; $showdetails = !getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 0 : getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS');
return pdf_pagefoot($pdf, $outputlangs, 'INVOICE_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext); return pdf_pagefoot($pdf, $outputlangs, 'INVOICE_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);
} }
@@ -1203,7 +1203,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
$rank = $rank + 10; $rank = $rank + 10;
$this->cols['photo'] = array( $this->cols['photo'] = array(
'rank' => $rank, 'rank' => $rank,
'width' => (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH) ? 20 : $conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH), // in mm 'width' => (!getDolGlobalInt('MAIN_DOCUMENTS_WITH_PICTURE_WIDTH') ? 20 : getDolGlobalInt('MAIN_DOCUMENTS_WITH_PICTURE_WIDTH')), // in mm
'status' => false, 'status' => false,
'title' => array( 'title' => array(
'textkey' => 'Photo', 'textkey' => 'Photo',
@@ -1215,7 +1215,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
'border-left' => false, // remove left line separator 'border-left' => false, // remove left line separator
); );
if (!empty($conf->global->MAIN_GENERATE_INVOICES_WITH_PICTURE) && !empty($this->atleastonephoto)) { if (getDolGlobalInt('MAIN_GENERATE_INVOICES_WITH_PICTURE') && !empty($this->atleastonephoto)) {
$this->cols['photo']['status'] = true; $this->cols['photo']['status'] = true;
} }
@@ -1231,7 +1231,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
'border-left' => true, // add left line separator 'border-left' => true, // add left line separator
); );
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) && empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) { if (getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') && !getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN')) {
$this->cols['vat']['status'] = true; $this->cols['vat']['status'] = true;
} }

View File

@@ -65,7 +65,7 @@ function myobjectPrepareHead($object)
$head[$h][0] = dol_buildpath('/mymodule/myobject_note.php', 1).'?id='.$object->id; $head[$h][0] = dol_buildpath('/mymodule/myobject_note.php', 1).'?id='.$object->id;
$head[$h][1] = $langs->trans('Notes'); $head[$h][1] = $langs->trans('Notes');
if ($nbNote > 0) { if ($nbNote > 0) {
$head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : ''); $head[$h][1] .= (!getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : '');
} }
$head[$h][2] = 'note'; $head[$h][2] = 'note';
$h++; $h++;

View File

@@ -187,7 +187,7 @@ $form = new Form($db);
if ($object->id > 0) { if ($object->id > 0) {
$title = $langs->trans("Agenda"); $title = $langs->trans("Agenda");
//if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; //if (!empty(getDolGlobalString('MAIN_HTML_TITLE')) && preg_match('/thirdpartynameonly/',getDolGlobalString('MAIN_HTML_TITLE')) && $object->name) $title=$object->name." - ".$title;
$help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung'; $help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung';
llxHeader('', $title, $help_url); llxHeader('', $title, $help_url);

View File

@@ -411,7 +411,7 @@ $num = $db->num_rows($resql);
// Direct jump if only one record found // Direct jump if only one record found
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { if ($num == 1 && !getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$id = $obj->rowid; $id = $obj->rowid;
header("Location: ".dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$id); header("Location: ".dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$id);

View File

@@ -267,8 +267,8 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
// Get extension (ods or odt) // Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1); $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = $conf->global->MAIN_DOC_USE_TIMING; $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') { if ($format == '1') {
$format = '%Y%m%d%H%M%S'; $format = '%Y%m%d%H%M%S';
} }