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';
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
$format = $conf->global->MAIN_DOC_USE_TIMING;
if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$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';
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
$format = $conf->global->MAIN_DOC_USE_TIMING;
if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$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)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
$format = $conf->global->MAIN_DOC_USE_TIMING;
if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$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)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
$format = $conf->global->MAIN_DOC_USE_TIMING;
if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$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';
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
$format = $conf->global->MAIN_DOC_USE_TIMING;
if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$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)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
$format = $conf->global->MAIN_DOC_USE_TIMING;
if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$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)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
$format = $conf->global->MAIN_DOC_USE_TIMING;
if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$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';
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
$format = $conf->global->MAIN_DOC_USE_TIMING;
if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$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)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
$format = $conf->global->MAIN_DOC_USE_TIMING;
if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$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';
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
$format = $conf->global->MAIN_DOC_USE_TIMING;
if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$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)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
$format = $conf->global->MAIN_DOC_USE_TIMING;
if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$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';
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
$format = $conf->global->MAIN_DOC_USE_TIMING;
if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$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 = preg_replace('/__+/', '_', $newfiletmp); // Replace repeated _ into one _ (to avoid string with substitution syntax)
}
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
$format = $conf->global->MAIN_DOC_USE_TIMING;
if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$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)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
$format = $conf->global->MAIN_DOC_USE_TIMING;
if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$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';
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
$format = $conf->global->MAIN_DOC_USE_TIMING;
if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$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';
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
$format = $conf->global->MAIN_DOC_USE_TIMING;
if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$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)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
$format = $conf->global->MAIN_DOC_USE_TIMING;
if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$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)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
$format = $conf->global->MAIN_DOC_USE_TIMING;
if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$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)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
$format = $conf->global->MAIN_DOC_USE_TIMING;
if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$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)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
$format = $conf->global->MAIN_DOC_USE_TIMING;
if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
$format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}