From 3db024e6b593ee60e496ff0023e8dd0f9ca563a3 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 28 Aug 2023 14:33:02 +0200 Subject: [PATCH] fix travis --- .../core/modules/modMyModule.class.php | 4 ++-- .../doc/doc_generic_myobject_odt.modules.php | 10 ++++----- .../doc/pdf_standard_myobject.modules.php | 22 +++++++++---------- .../template/myobject_agenda.php | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 311bc6c14b5..b5dfb86dba7 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -403,8 +403,8 @@ class modMyModule extends DolibarrModules $this->import_convertvalue_array[$r] = array( 't.ref' => array( 'rule'=>'getrefifauto', - 'class'=>(empty(getDolGlobalString('MYMODULE_MYOBJECT_ADDON')) ? 'mod_myobject_standard' : getDolGlobalString('MYMODULE_MYOBJECT_ADDON')), - 'path'=>"/core/modules/commande/".(empty(getDolGlobalString('MYMODULE_MYOBJECT_ADDON')) ? 'mod_myobject_standard' : getDolGlobalString('MYMODULE_MYOBJECT_ADDON')).'.php' + 'class'=>(getDolGlobalString('MYMODULE_MYOBJECT_ADDON')=='') ? 'mod_myobject_standard' : getDolGlobalString('MYMODULE_MYOBJECT_ADDON')), + 'path'=>"/core/modules/commande/".(getDolGlobalString('MYMODULE_MYOBJECT_ADDON')=='') ? 'mod_myobject_standard' : getDolGlobalString('MYMODULE_MYOBJECT_ADDON')).'.php' 'classobject'=>'MyObject', 'pathobject'=>'/mymodule/class/myobject.class.php', ), diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php index dc0c0945278..829cba459e1 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php @@ -163,7 +163,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject // Scan directories $nbofiles = count($listoffiles); - if (!empty(getDolGlobalString('MYMODULE_MYOBJECT_ADDON_PDF_ODT_PATH'))) { + if (getDolGlobalString('MYMODULE_MYOBJECT_ADDON_PDF_ODT_PATH')) { $texte .= $langs->trans("NumberOfModelFilesFound").': '; //$texte.=$nbofiles?'':''; $texte .= count($listoffiles); @@ -287,7 +287,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); - if (!empty(getDolGlobalString('MAIN_DOC_USE_TIMING'))) { + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; @@ -350,7 +350,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject // Line of free text $newfreetext = ''; $paramfreetext = 'MYMODULE_MYOBJECT_FREE_TEXT'; - if (!empty(getDolGlobalString($paramfreetext))) { + if (getDolGlobalString($paramfreetext)) { $newfreetext = make_substitutions(getDolGlobalString($paramfreetext), $substitutionarray); } @@ -477,7 +477,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 // Write new file - if (!empty(getDolGlobalString($MAIN_ODT_AS_PDF))) { + if (getDolGlobalString('MAIN_ODT_AS_PDF')) { try { $odfHandler->exportAsAttachedPDF($file); } catch (Exception $e) { @@ -498,7 +498,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray); $reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks - if (!empty(getDolGlobalString('MAIN_UMASK'))) { + if (getDolGlobalString('MAIN_UMASK')) { @chmod($file, octdec(getDolGlobalString('MAIN_UMASK'))); } diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index 9b0cd33c283..38be530e909 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -197,7 +197,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $realpatharray = array(); $this->atleastonephoto = false; /* - if (!empty(getDolGlobalString('MAIN_GENERATE_MYOBJECT_WITH_PICTURE'))) + if (getDolGlobalString('MAIN_GENERATE_MYOBJECT_WITH_PICTURE')) { $objphoto = new Product($this->db); @@ -289,7 +289,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $heightforinfotot = 50; // Height reserved to output the info and total part and payment part $heightforfreetext = (getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT') ? getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT') : 5); // Height reserved to output the free text on last page - $heightforfooter = $this->marge_basse + (empty(getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) ? 12 : 22); // Height reserved to output the footer (value include bottom margin) + $heightforfooter = $this->marge_basse + ((getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')=='') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); @@ -298,7 +298,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $pdf->SetFont(pdf_getPDFFont($outputlangs)); // Set path to the background PDF File - if (!empty(getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'))) { + if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) { $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); $tplidx = $pdf->importPage(1); } @@ -320,7 +320,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $cert = empty($user->conf->CERTIFICATE_CRT) ? '' : $user->conf->CERTIFICATE_CRT; // If user has no certificate, we try to take the company one if (!$cert) { - $cert = empty(getDolGlobalString('CERTIFICATE_CRT')) ? '' : getDolGlobalString('CERTIFICATE_CRT'); + $cert = getDolGlobalString('CERTIFICATE_CRT'); } // If a certificate is found if ($cert) { @@ -757,7 +757,7 @@ class pdf_standard_myobject extends ModelePDFMyObject // Display payment area /* - if (($deja_regle || $amount_credit_notes_included || $amount_deposits_included) && empty(getDolGlobalString('INVOICE_NO_PAYMENT_DETAILS'))) + if (($deja_regle || $amount_credit_notes_included || $amount_deposits_included) && (getDolGlobalString('INVOICE_NO_PAYMENT_DETAILS')=='')) { $posy = $this->drawPaymentsTable($pdf, $object, $posy, $outputlangs); } @@ -783,7 +783,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $this->errors = $hookmanager->errors; } - if (!empty(getDolGlobalString('MAIN_UMASK'))) { + if (getDolGlobalString('MAIN_UMASK')) { @chmod($file, octdec(getDolGlobalString('MAIN_UMASK'))); } @@ -848,14 +848,14 @@ class pdf_standard_myobject extends ModelePDFMyObject if (empty($hidetop)) { $titre = $outputlangs->transnoentities("AmountInCurrency", $outputlangs->transnoentitiesnoconv("Currency".$currency)); - if (!empty(getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')) && is_object($outputlangsbis)) { + if (getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) { $titre .= ' - '.$outputlangsbis->transnoentities("AmountInCurrency", $outputlangsbis->transnoentitiesnoconv("Currency".$currency)); } $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top - 4); $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); - if (!empty(getDolGlobalString('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(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } @@ -912,7 +912,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $pdf->SetXY($this->marge_gauche, $posy); // Logo - if (empty(getDolGlobalString('PDF_DISABLE_MYCOMPANY_LOGO'))) { + if (getDolGlobalString('PDF_DISABLE_MYCOMPANY_LOGO')) { if ($this->emetteur->logo) { $logodir = $conf->mycompany->dir_output; if (!empty($conf->mycompany->multidir_output[$object->entity])) { @@ -942,7 +942,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); $title = $outputlangs->transnoentities("PdfTitle"); - if (!empty(getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')) && is_object($outputlangsbis)) { + if (getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) { $title .= ' - '; $title .= $outputlangsbis->transnoentities("PdfTitle"); } @@ -996,7 +996,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $pdf->SetTextColor(0, 0, 60); $title = $outputlangs->transnoentities("Date"); - if (!empty(getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')) && is_object($outputlangsbis)) { + if (getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) { $title .= ' - '.$outputlangsbis->transnoentities("Date"); } $pdf->MultiCell($w, 3, $title." : ".dol_print_date($object->date, "day", false, $outputlangs), '', 'R'); diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index 968076385c9..2a313d17da8 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -94,7 +94,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty(getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')) ? '' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'))); + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'))); } $search_rowid = GETPOST('search_rowid'); $search_agenda_label = GETPOST('search_agenda_label');