Skip to content

Commit

Permalink
Fix empty and getDolGlobal...
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Aug 27, 2023
1 parent 45d323a commit 8fa06cc
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion htdocs/adherents/class/adherent.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ public function sendEmail($text, $subject, $filename_list = array(), $mimetype_l

// Envoi mail confirmation
$from = $conf->email_from;
if (!empty(getDolGlobalString('ADHERENT_MAIL_FROM'))) {
if (getDolGlobalString('ADHERENT_MAIL_FROM')) {
$from = getDolGlobalString('ADHERENT_MAIL_FROM');
}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/admin/dav.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
$message .= ajax_autoselect('webdavpublicurl');

$message .= '<br>';
if (!empty(getDolGlobalString('DAV_ALLOW_PUBLIC_DIR'))) {
if (getDolGlobalString('DAV_ALLOW_PUBLIC_DIR')) {
$urlEntity = (isModEnabled('multicompany') ? '?entity=' . $conf->entity : '');
$url = '<a href="' . $urlwithroot . '/dav/fileserver.php/public/' . $urlEntity . '" target="_blank" rel="noopener noreferrer">' . $urlwithroot . '/dav/fileserver.php/public/' . $urlEntity . '</a>';

Expand Down
2 changes: 1 addition & 1 deletion htdocs/admin/ticket_public.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@
// Show progression
print '<tr class="oddeven"><td>'.$langs->trans("TicketsShowProgression").'</td>';
print '<td class="left">';
if (empty(getDolGlobalInt('TICKET_SHOW_PROGRESSION'))) {
if (!getDolGlobalInt('TICKET_SHOW_PROGRESSION')) {
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_TICKET_SHOW_PROGRESSION">' . img_picto($langs->trans('Disabled'), 'switch_off') . '</a>';
} else {
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_TICKET_SHOW_PROGRESSION">' . img_picto($langs->trans('Enabled'), 'switch_on') . '</a>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/class/html.formaccounting.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ public function select_account($selectid, $htmlname = 'account', $showempty = 0,

$num_rows = $this->db->num_rows($resql);

if ($num_rows == 0 && (empty(getDolGlobalInt('CHARTOFACCOUNTS')) || getDolGlobalInt('CHARTOFACCOUNTS') < 0)) {
if ($num_rows == 0 && getDolGlobalInt('CHARTOFACCOUNTS') <= 0) {
$langs->load("errors");
$showempty = $langs->trans("ErrorYouMustFirstSetupYourChartOfAccount");
} else {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/tpl/card_presend.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
if (is_object($object) && is_object($object->thirdparty)) {
$checkRead= '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php';
$checkRead.='?tag='.(!empty($object->thirdparty->tag)?urlencode($object->thirdparty->tag):"");
$checkRead.='&securitykey='.(!empty(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY'))?urlencode(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY')):"");
$checkRead.='&securitykey='.(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY') ? urlencode(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY')) : "");
$checkRead.='" width="1" height="1" style="width:1px;height:1px" border="0"/>';
$substitutionarray['__CHECK_READ__'] = $checkRead;
}
Expand Down
4 changes: 2 additions & 2 deletions htdocs/modulebuilder/template/class/myobject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1073,11 +1073,11 @@ public function getNextNumRef()
global $langs, $conf;
$langs->load("mymodule@mymodule");

if (empty(getDolGlobalString('MYMODULE_MYOBJECT_ADDON'))) {
if (!getDolGlobalString('MYMODULE_MYOBJECT_ADDON')) {
$conf->global->MYMODULE_MYOBJECT_ADDON = 'mod_myobject_standard';
}

if (!empty(getDolGlobalString('MYMODULE_MYOBJECT_ADDON'))) {
if (getDolGlobalString('MYMODULE_MYOBJECT_ADDON')) {
$mybool = false;

$file = getDolGlobalString('MYMODULE_MYOBJECT_ADDON').".php";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@ public function __construct($db)
$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',
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function info($langs)

// 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").': <b>';
//$texte.=$nbofiles?'<a id="a_'.get_class($this).'" href="#">':'';
$texte .= count($listoffiles);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
// Load translation files required by the page
$outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies"));

if (!empty(getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')) && $outputlangs->defaultlang != getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')) {
if (getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE') && $outputlangs->defaultlang != getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')) {
global $outputlangsbis;
$outputlangsbis = new Translate('', $conf);
$outputlangsbis->setDefaultLang(getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE'));
Expand Down
2 changes: 1 addition & 1 deletion htdocs/modulebuilder/template/myobject_agenda.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@

if ($object->id > 0) {
$title = $langs->trans("Agenda");
//if (!empty(getDolGlobalString('MAIN_HTML_TITLE')) && preg_match('/thirdpartynameonly/',getDolGlobalString('MAIN_HTML_TITLE')) && $object->name) $title=$object->name." - ".$title;
//if (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';
llxHeader('', $title, $help_url);

Expand Down

0 comments on commit 8fa06cc

Please sign in to comment.