diff --git a/dev/tools/dolibarr-postgres2mysql.php b/dev/tools/dolibarr-postgres2mysql.php index f2794455ca3..c17a73dfe12 100644 --- a/dev/tools/dolibarr-postgres2mysql.php +++ b/dev/tools/dolibarr-postgres2mysql.php @@ -76,14 +76,12 @@ function getfieldname($l) if (preg_match("/`(.*)`/", $l, $regs)) { if ($regs[1]) return $regs[1]; - else - return null; + else return null; } // if its not in quotes, then it should (we hope!) be the first "word" on the line, up to the first space. elseif (preg_match("/([^\ ]*)/", trim($l), $regs)) { if ($regs[1]) return $regs[1]; - else - return null; + else return null; } } @@ -102,8 +100,7 @@ function formatsize($s) return sprintf("%.1f", round($s / 1024, 1)) . "K"; elseif ($s < pow(2, 30)) return sprintf("%.1f", round($s / 1024 / 1024, 1)) . "M"; - else - return sprintf("%.1f", round($s / 1024 / 1024 / 1024, 1)) . "G"; + else return sprintf("%.1f", round($s / 1024 / 1024 / 1024, 1)) . "G"; } /** @@ -146,8 +143,7 @@ function pg2mysql_large($infilename, $outfilename) if ($c % 2 != 0) { if ($inquotes) $inquotes = false; - else - $inquotes = true; + else $inquotes = true; } if ($linenum % 10000 == 0) { @@ -329,8 +325,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true) $num = $regs[1]; if ($num <= 255) $line = preg_replace("/ character varying\([0-9]*\)/", " varchar($num)", $line); - else - $line = preg_replace("/ character varying\([0-9]*\)/", " text", $line); + else $line = preg_replace("/ character varying\([0-9]*\)/", " text", $line); } // character varying with no size, we will default to varchar(255) if (preg_match("/ character varying/", $line)) { @@ -352,8 +347,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true) $num = $regs[1]; if ($num <= 255) $line = preg_replace("/ character\([0-9]*\)/", " varchar($num)", $line); - else - $line = preg_replace("/ character\([0-9]*\)/", " text", $line); + else $line = preg_replace("/ character\([0-9]*\)/", " text", $line); } // timestamps $line = str_replace(" timestamp with time zone", " datetime", $line); @@ -465,8 +459,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true) if ($c % 2 != 0) { if ($inquotes) $inquotes = false; - else - $inquotes = true; + else $inquotes = true; // echo "inquotes=$inquotes\n"; } } while (substr($lines[$linenumber], - 3, - 1) != ");" || $inquotes); diff --git a/dev/translation/autotranslator.class.php b/dev/translation/autotranslator.class.php index f9657482c86..b51515a42cb 100644 --- a/dev/translation/autotranslator.class.php +++ b/dev/translation/autotranslator.class.php @@ -77,7 +77,7 @@ class autoTranslator $files = $this->getTranslationFilesArray($this->_refLang); $counter = 1; - foreach($files as $file) + foreach ($files as $file) { if ($this->_limittofile && $this->_limittofile != $file) continue; $counter++; @@ -94,7 +94,7 @@ class autoTranslator // If we must process all languages $arraytmp=dol_dir_list($this->_langDir, 'directories', 0); - foreach($arraytmp as $dirtmp) + foreach ($arraytmp as $dirtmp) { if ($dirtmp['name'] === $this->_refLang) continue; // We discard source language $tmppart=explode('_', $dirtmp['name']); @@ -112,7 +112,7 @@ class autoTranslator } // Process translation of source file for each target languages - foreach($targetlangs as $my_destlang) + foreach ($targetlangs as $my_destlang) { $this->_translatedFiles = array(); @@ -124,15 +124,14 @@ class autoTranslator echo "File not found: " . $destPath . ". We generate it.
\n"; $this->createTranslationFile($destPath, $my_destlang); } - else - { + else { echo "Updating file: " . $destPath . "
\n"; } // Translate lines $fileContentDest = file($destPath, FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); $newlines=0; - foreach($fileContent as $line){ + foreach ($fileContent as $line){ $key = $this->getLineKey($line); $value = $this->getLineValue($line); if ($key && $value) @@ -167,7 +166,7 @@ class autoTranslator fwrite($fp, "\n"); fwrite($fp, "// START - Lines generated via autotranslator.php tool (".$this->_time.").\n"); fwrite($fp, "// Reference language: ".$this->_refLang." -> ".$my_destlang."\n"); - foreach($this->_translatedFiles[$file] as $line) { + foreach ($this->_translatedFiles[$file] as $line) { fwrite($fp, $line . "\n"); } fwrite($fp, "// STOP - Lines generated via autotranslator.php tool (".$this->_time_end.").\n"); @@ -209,7 +208,7 @@ class autoTranslator { //print "key =".$key."\n"; - foreach($content as $line) { + foreach ($content as $line) { $destKey = $this->getLineKey($line); $destValue = $this->getLineValue($line); // If translated return @@ -273,8 +272,8 @@ class autoTranslator private function getTranslationFilesArray($lang) { $dir = new DirectoryIterator($this->_langDir.$lang); - while($dir->valid()) { - if(!$dir->isDot() && $dir->isFile() && ! preg_match('/^\./', $dir->getFilename())) { + while ($dir->valid()) { + if (!$dir->isDot() && $dir->isFile() && ! preg_match('/^\./', $dir->getFilename())) { $files[] = $dir->getFilename(); } $dir->next(); diff --git a/dev/translation/sanity_check_en_langfiles.php b/dev/translation/sanity_check_en_langfiles.php index f568ba2b04b..0268fc94ed8 100755 --- a/dev/translation/sanity_check_en_langfiles.php +++ b/dev/translation/sanity_check_en_langfiles.php @@ -360,16 +360,14 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a $unused[$value] = $line; echo $line; // $trad contains the \n } - else - { + else { unset($output); //print 'X'.$output.'Y'; } } if (empty($unused)) print "No string not used found.\n"; - else - { + else { $filetosave='/tmp/'.($argv[2]?$argv[2]:"").'notused.lang'; print "Strings in en_US that are never used are saved into file ".$filetosave.":\n"; file_put_contents($filetosave, implode("", $unused)); diff --git a/dev/translation/strip_language_file.php b/dev/translation/strip_language_file.php index ce28ca5de63..5a94192b2bd 100755 --- a/dev/translation/strip_language_file.php +++ b/dev/translation/strip_language_file.php @@ -80,8 +80,8 @@ $aEnglish = array(); if ($filesToProcess == 'all') { $dir = new DirectoryIterator('htdocs/langs/'.$lPrimary); - while($dir->valid()) { - if(!$dir->isDot() && $dir->isFile() && ! preg_match('/^\./', $dir->getFilename())) { + while ($dir->valid()) { + if (!$dir->isDot() && $dir->isFile() && ! preg_match('/^\./', $dir->getFilename())) { $files[] = $dir->getFilename(); } $dir->next(); @@ -94,7 +94,7 @@ else $filesToProcess=explode(',', $filesToProcess); // Loop on each file -foreach($filesToProcess as $fileToProcess) +foreach ($filesToProcess as $fileToProcess) { $lPrimaryFile = 'htdocs/langs/'.$lPrimary.'/'.$fileToProcess; $lSecondaryFile = 'htdocs/langs/'.$lSecondary.'/'.$fileToProcess; @@ -285,8 +285,7 @@ foreach($filesToProcess as $fileToProcess) print "Key $key is redundant in file $lPrimaryFile (line: $cnt) - Already found into ".$fileFirstFound[$key]." (line: ".$lineFirstFound[$key].").\n"; continue; } - else - { + else { $fileFirstFound[$key] = $fileToProcess; $lineFirstFound[$key] = $cnt; } diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index b6231a45a10..52a1adc4fd2 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -62,8 +62,7 @@ if ($resql) } $db->free($resql); } -else -{ +else { dol_print_error($db); } @@ -108,8 +107,7 @@ if ($action == "save" && empty($cancel)) setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); $db->commit(); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); $db->rollback(); } diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 77113ff1e13..dd5d04732ff 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -108,8 +108,7 @@ if ($actionsave) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); if (empty($errorsaved)) setEventMessages($langs->trans("Error"), null, 'errors'); } @@ -163,14 +162,12 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('AGENDA_DISABLE_EXT', array('enabled'=>array(0=>'.hideifnotset')), null, 1); } -else -{ +else { if (empty($conf->global->AGENDA_DISABLE_EXT)) { print ''.img_picto($langs->trans("Enabled"), 'on').''; } - else - { + else { print ''.img_picto($langs->trans("Disabled"), 'off').''; } } diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index c5b196146d5..a9e5bccd71b 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -60,8 +60,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) Header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -74,8 +73,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) Header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -121,14 +119,12 @@ elseif ($action == 'specimen') // For orders header("Location: ".DOL_URL_ROOT."/document.php?modulepart=action&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -214,8 +210,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -263,8 +258,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) $module = new $classname($db, $specimenthirdparty); if (method_exists($module, 'info')) print $module->info($langs); - else - print $module->description; + else print $module->description; print "\n"; // Active @@ -277,14 +271,12 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; } - else - { + else { print img_picto($langs->trans("Enabled"), 'switch_on'); } print ""; } - else - { + else { print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -296,8 +288,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'&type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -347,8 +338,7 @@ if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } -else -{ +else { print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } print ''."\n"; diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index 3d51bd3158c..d9b7ead6f2e 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -55,8 +55,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) Header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -69,8 +68,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) Header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -114,14 +112,12 @@ elseif ($action == 'specimen') // For orders header("Location: ".DOL_URL_ROOT."/document.php?modulepart=action&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index 7df74ba6a9d..b6d0472c3af 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -55,8 +55,7 @@ if ($actionsave) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("SaveFailed"), null, 'errors'); } diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index b048dea9565..662dc517436 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -128,8 +128,7 @@ if ($actionsave) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); if (empty($errorsaved)) setEventMessages($langs->trans("Error"), null, 'errors'); } @@ -359,8 +358,7 @@ foreach ($dirmodels as $reldir) { print "\n"; if (method_exists($module, 'info')) print $module->info($langs); - else - print $module->description; + else print $module->description; print ''; // Active @@ -448,8 +446,7 @@ if ($conf->global->BANK_COLORIZE_MOVEMENT) { print ''; print ''; } -else -{ +else { print ''."\n"; print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -509,8 +506,7 @@ if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) { print ''; print ''; } -else -{ +else { print ''."\n"; print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index e577942ab21..90a2525de05 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -81,8 +81,7 @@ elseif ($action == 'update') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -265,19 +264,16 @@ if ($resql) //print $url; print ''; } - else - { + else { print $langs->trans("FormatNotSupportedByGenerator"); } } - else - { + else { print 'ErrorClassNotFoundInModule '.$classname.' '.$obj->coder; } } } - else - { + else { print $langs->trans("ChooseABarCode"); } print ''; @@ -412,8 +408,7 @@ if ($conf->product->enabled) print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index 6d37def3187..26f3fe75858 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -58,8 +58,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -96,14 +95,12 @@ elseif ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=bom&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, null, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -161,8 +158,7 @@ elseif ($action == 'set_BOM_DRAFT_WATERMARK') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -179,8 +175,7 @@ elseif ($action == 'set_BOM_FREE_TEXT') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -262,8 +257,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -328,8 +322,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -399,8 +392,7 @@ foreach ($dirmodels as $reldir) print ''; print ''; } - else - { + else { print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -412,8 +404,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -442,8 +433,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'bill').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -489,8 +479,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index c6ff9e94749..46f91e8b366 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -84,8 +84,7 @@ if ($action == 'add') { $i++; } } - else - { + else { setEventMessages($db->lasterror(), null, 'errors'); $error++; } @@ -135,8 +134,7 @@ if ($action == 'add') { $db->commit(); $action = ''; } - else - { + else { $db->rollback(); } } @@ -205,8 +203,7 @@ if ($action == 'switch') { $db->commit(); } - else - { + else { $db->rollback(); } } @@ -346,8 +343,7 @@ foreach ($boxtoadd as $box) { $logo = $box->boximg; } - else - { + else { $logo = preg_replace("/^object_/i", "", $box->boximg); } @@ -411,8 +407,7 @@ foreach ($boxactivated as $key => $box) { $logo = $box->boximg; } - else - { + else { $logo = preg_replace("/^object_/i", "", $box->boximg); } diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index 8b5e7c433bf..397f289eaee 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -61,8 +61,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -84,8 +83,7 @@ if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -182,8 +180,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -260,8 +257,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 36205697e89..56f4f076e54 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -47,8 +47,7 @@ if ($action == 'setvalue' && $user->admin) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -134,8 +133,7 @@ if (!empty($conf->global->CLICKTODIAL_URL)) { print $langs->trans("LinkToTest", $user->login).': '.dol_print_phone($phonefortest, '', 0, 0, 'AC_TEL'); } - else - { + else { $langs->load("errors"); print '
'.$langs->trans("WarningClickToDialUserSetupNotComplete").'
'; } diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 76f04d94c15..f1f22203fa2 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -67,8 +67,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -105,14 +104,12 @@ elseif ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, null, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -170,8 +167,7 @@ elseif ($action == 'set_COMMANDE_DRAFT_WATERMARK') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -188,8 +184,7 @@ elseif ($action == 'set_ORDER_FREE_TEXT') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -218,8 +213,7 @@ elseif ($action == 'setribchq') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -235,8 +229,7 @@ elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -252,8 +245,7 @@ elseif ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -335,8 +327,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -401,8 +392,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -472,8 +462,7 @@ foreach ($dirmodels as $reldir) print ''; print ''; } - else - { + else { print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -485,8 +474,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -520,8 +508,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'bill').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -595,14 +582,12 @@ if (empty($conf->facture->enabled)) } print ""; } - else - { + else { print "".$langs->trans("NoActiveBankAccountDefined").""; } } } - else - { + else { print ''.$langs->trans("BankModuleNotActive").''; } } @@ -682,8 +667,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index f33a3ea6f93..b5ae98378c9 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -85,8 +85,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) $s = $mysoc->state_id.':'.$mysoc->state_code.':'.$mysoc->state_label; dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE", $s, 'chaine', 0, '', $conf->entity); } - else - { + else { dolibarr_del_const($db, "MAIN_INFO_SOCIETE_STATE", $conf->entity); } @@ -165,14 +164,12 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) $tmparray = explode(':', $result); setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus', $tmparray[1]), null, 'errors'); } - else - { + else { $error++; setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); } } - else - { + else { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); @@ -229,8 +226,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) { dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", 0, 'chaine', 0, '', $conf->entity); } - else - { + else { dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", GETPOST('lt1', 'aZ09'), 'chaine', 0, '', $conf->entity); } dolibarr_set_const($db, "MAIN_INFO_LOCALTAX_CALC1", GETPOST("clt1", 'aZ09'), 'chaine', 0, '', $conf->entity); @@ -241,8 +237,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) { dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", 0, 'chaine', 0, '', $conf->entity); } - else - { + else { dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", GETPOST('lt2', 'aZ09'), 'chaine', 0, '', $conf->entity); } dolibarr_set_const($db, "MAIN_INFO_LOCALTAX_CALC2", GETPOST("clt2", 'aZ09'), 'chaine', 0, '', $conf->entity); @@ -252,8 +247,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) { $db->commit(); } - else - { + else { $db->rollback(); } @@ -302,16 +296,14 @@ if ($action == 'addthumb' || $action == 'addthumbsquarred') // Regenerate thumb header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); dol_syslog($langs->transnoentities("ErrorBadImageFormat"), LOG_INFO); } } - else - { + else { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorFileDoesNotExists", $_GET["file"]), null, 'errors'); @@ -583,8 +575,7 @@ if ($langs->transcountry("ProfId1", $mysoc->country_code) != '-') { print ''; } - else - { + else { print $countrynotdefined; } print ''; @@ -598,8 +589,7 @@ if ($langs->transcountry("ProfId2", $mysoc->country_code) != '-') { print ''; } - else - { + else { print $countrynotdefined; } print ''; @@ -613,8 +603,7 @@ if ($langs->transcountry("ProfId3", $mysoc->country_code) != '-') { print ''; } - else - { + else { print $countrynotdefined; } print ''; @@ -628,8 +617,7 @@ if ($langs->transcountry("ProfId4", $mysoc->country_code) != '-') { print ''; } - else - { + else { print $countrynotdefined; } print ''; @@ -643,8 +631,7 @@ if ($langs->transcountry("ProfId5", $mysoc->country_code) != '-') { print ''; } - else - { + else { print $countrynotdefined; } print ''; @@ -658,8 +645,7 @@ if ($langs->transcountry("ProfId6", $mysoc->country_code) != '-') { print ''; } - else - { + else { print $countrynotdefined; } print ''; diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index 3ccc2a213ac..7c1c64369ad 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -102,8 +102,7 @@ if ($action == 'update') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index fd93b0fa83d..3f5cc1cd920 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -136,8 +136,7 @@ if (empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } -else -{ +else { print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index bc22a2020fb..9da7fb10bbf 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -86,8 +86,7 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update')) $constvalue = ""; $constnote = ""; } - else - { + else { dol_print_error($db); } } @@ -105,8 +104,7 @@ if (!empty($consts) && $action == 'update') { $nbmodified++; } - else - { + else { dol_print_error($db); } } @@ -127,8 +125,7 @@ if (!empty($consts) && $action == 'delete') { $nbdeleted++; } - else - { + else { dol_print_error($db); } } @@ -144,8 +141,7 @@ if ($action == 'delete') { setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); } - else - { + else { dol_print_error($db); } } @@ -231,8 +227,7 @@ if (!empty($conf->multicompany->enabled) && !$user->entity) print ''; print ''; } -else -{ +else { print ''; print ''; } @@ -298,8 +293,7 @@ if ($result) print ''; print ''; } - else - { + else { print ''; print ''; } @@ -308,8 +302,7 @@ if ($result) { print ''; } - else - { + else { print ''.img_delete().''; } diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index ae0c9c89b38..f3c50287107 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -63,8 +63,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -101,14 +100,12 @@ elseif ($action == 'specimen') // For contract header("Location: ".DOL_URL_ROOT."/document.php?modulepart=contract&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($obj->error, $obj->errors, 'errors'); dol_syslog($obj->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -169,8 +166,7 @@ elseif ($action == 'set_other') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -252,8 +248,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -317,8 +312,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -388,8 +382,7 @@ foreach ($dirmodels as $reldir) print ''; print ''; } - else - { + else { print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -401,8 +394,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -434,8 +426,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'contract').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -483,8 +474,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php index bb7e82901f5..b7cb424d2cb 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -101,8 +101,7 @@ if ($action == 'edit') { print $form->selectyesno($key, $conf->global->$key, 1); } - else - { + else { print ''; } print ''; @@ -117,8 +116,7 @@ if ($action == 'edit') print ''; print '
'; } -else -{ +else { print ''; print ''; @@ -141,8 +139,7 @@ else { print yn($conf->global->$key); } - else - { + else { print $conf->global->$key; } print ''; diff --git a/htdocs/admin/debugbar.php b/htdocs/admin/debugbar.php index 926080cb9b5..dad99b2ab39 100644 --- a/htdocs/admin/debugbar.php +++ b/htdocs/admin/debugbar.php @@ -59,8 +59,7 @@ if ($action == 'set') $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($error, null, 'errors'); } diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index 094c4a8dd7c..2622d5ca514 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -151,8 +151,7 @@ if (($action == 'add' || (GETPOST('add') && $action != 'update')) || GETPOST('ac $defaultkey = ''; $defaultvalue = ''; } - else - { + else { $db->rollback(); setEventMessages($db->lasterror(), null, 'errors'); $action = ''; @@ -170,8 +169,7 @@ if ($action == 'delete') { setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); } - else - { + else { dol_print_error($db); } } @@ -198,8 +196,7 @@ if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) $enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off'); $enabledisablehtml .= ''; } -else -{ +else { // Button on, click to disable $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on'); @@ -261,8 +258,7 @@ if ($mode != 'sortorder') { $textkey = $form->textwithpicto($langs->trans("Field"), $texthelp); } -else -{ +else { $texthelp = 'field or alias.field'; $textkey = $form->textwithpicto($langs->trans("Field"), $texthelp); } @@ -281,8 +277,7 @@ if ($mode != 'focus' && $mode != 'mandatory') } $textvalue = $form->textwithpicto($langs->trans("Value"), $texthelp, 1, 'help', '', 0, 2, 'subsitutiontooltip'); } - else - { + else { $texthelp = 'ASC or DESC'; $textvalue = $form->textwithpicto($langs->trans("SortOrder"), $texthelp); } @@ -322,8 +317,7 @@ if (!empty($conf->multicompany->enabled) && !$user->entity) print ''; // We see environment, but to change it we must switch on other entity print ''; } -else -{ +else { print ''; @@ -394,8 +388,7 @@ if ($result) print '   '; print ''.img_delete().''; } - else - { + else { print ''; print ''; print '
'; @@ -409,8 +402,7 @@ if ($result) $i++; } } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 3ee262b464a..26f2f87e2d5 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -250,8 +250,7 @@ if ($action == 'edit') print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print ''; print '
'; } -else -{ +else { /* * Show parameters */ diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index cce441c4052..7ed84b59629 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -698,8 +698,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) { $_POST["country"] = ''; } - else - { + else { $ok = 0; setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Country")), null, 'errors'); } @@ -792,8 +791,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs'); $_POST = array('id'=>$id); // Clean $_POST array, we keep only } - else - { + else { if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors'); } @@ -883,8 +881,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete { setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors'); } - else - { + else { dol_print_error($db); } } @@ -1302,8 +1299,7 @@ if ($id) print ''; $filterfound++; } - else - { + else { print ''; print ''; } @@ -1439,8 +1435,7 @@ if ($id) print ''; print ''; } - else - { + else { $tmpaction = 'view'; $parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); $reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks @@ -1479,8 +1474,7 @@ if ($id) { $valuetoshow = '-'; } - else - { + else { $key = $langs->trans("Country".strtoupper($obj->country_code)); $valuetoshow = ($key != "Country".strtoupper($obj->country_code) ? $obj->country_code." - ".$key : $obj->country); } @@ -1605,15 +1599,13 @@ if ($id) elseif ($fieldlist[$field] == 'localtax1_type') { if ($obj->localtax1 != 0) $valuetoshow = $localtax_typeList[$valuetoshow]; - else - $valuetoshow = ''; + else $valuetoshow = ''; $class = "center"; } elseif ($fieldlist[$field] == 'localtax2_type') { if ($obj->localtax2 != 0) $valuetoshow = $localtax_typeList[$valuetoshow]; - else - $valuetoshow = ''; + else $valuetoshow = ''; $class = "center"; } elseif ($fieldlist[$field] == 'taux') { @@ -1709,8 +1701,7 @@ if ($id) // Active print ''; if ($canbedisabled) print ''.$actl[$obj->active].''; - else - { + else { if (in_array($obj->code, array('AC_OTH', 'AC_OTH_AUTO'))) print $langs->trans("AlwaysActive"); elseif (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) print $langs->trans("Deprecated"); elseif (isset($obj->type) && in_array($obj->type, array('system')) && !empty($obj->active) && $obj->code != 'AC_OTH') print $langs->trans("UsedOnlyWithTypeOption"); @@ -1747,8 +1738,7 @@ if ($id) print ''; } -else -{ +else { /* * Show list of dictionary to show */ @@ -1782,8 +1772,7 @@ else { print ''.$langs->trans($tablib[$i]).''; } - else - { + else { print $langs->trans($tablib[$i]); } print ''; @@ -1796,8 +1785,7 @@ else print ''.$tabname[$i].''; $lastlineisempty = false; } - else - { + else { if (!$lastlineisempty) { $showemptyline = 1; @@ -2003,8 +1991,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') $accountancy_account = (!empty($obj->$fieldname) ? $obj->$fieldname : 0); print $formaccounting->select_account($accountancy_account, '.'.$fieldlist[$field], 1, '', 1, 1, 'maxwidth200 maxwidthonsmartphone'); } - else - { + else { $fieldname = $fieldlist[$field]; print ''; } @@ -2028,8 +2015,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print $form->selectExpenseRanges($obj->fk_range); print ''; } - else - { + else { $fieldValue = isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''; if ($fieldlist[$field] == 'sortorder') diff --git a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php index 3c735707c4a..6eaf1cf375a 100644 --- a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php +++ b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php @@ -136,8 +136,9 @@ class PrestaShopWebservice { if (isset($curl_params[$defkey])) $curl_options[$defkey] = $curl_params[$defkey]; - else + else { $curl_options[$defkey] = $defaultParams[$defkey]; + } } foreach ($curl_params as $defkey => $defval) if (!isset($curl_options[$defkey])) @@ -237,8 +238,9 @@ class PrestaShopWebservice } return $xml; } - else + else { throw new PrestaShopWebserviceException('HTTP response is empty'); + } } /** @@ -264,9 +266,7 @@ class PrestaShopWebservice $url .= '&id_shop='.$options['id_shop']; if (isset($options['id_group_shop'])) $url .= '&id_group_shop='.$options['id_group_shop']; - } - else - { + } else { throw new PrestaShopWebserviceException('Bad parameters given'); } $request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $xml)); @@ -323,9 +323,9 @@ class PrestaShopWebservice $url_params[$k] = $options[$k]; if (count($url_params) > 0) $url .= '?'.http_build_query($url_params); - } - else + } else { throw new PrestaShopWebserviceException('Bad parameters given '); + } $request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET')); self::checkStatusCode($request['status_code']); // check the response validity @@ -356,9 +356,9 @@ class PrestaShopWebservice $url_params[$k] = $options[$k]; if (count($url_params) > 0) $url .= '?'.http_build_query($url_params); - } - else + } else { throw new PrestaShopWebserviceException('Bad parameters given'); + } $request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'HEAD', CURLOPT_NOBODY => true)); self::checkStatusCode($request['status_code']); // check the response validity return $request['header']; @@ -387,9 +387,9 @@ class PrestaShopWebservice $url .= '&id_shop='.$options['id_shop']; if (isset($options['id_group_shop'])) $url .= '&id_group_shop='.$options['id_group_shop']; - } - else + } else { throw new PrestaShopWebserviceException('Bad parameters given'); + } $request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_POSTFIELDS => $xml)); self::checkStatusCode($request['status_code']); // check the response validity diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php index a229f3c985d..1d764a849be 100644 --- a/htdocs/admin/dolistore/class/dolistore.class.php +++ b/htdocs/admin/dolistore/class/dolistore.class.php @@ -101,8 +101,7 @@ class Dolistore $trace = $e->getTrace(); if ($trace[0]['args'][0] == 404) die('Bad ID'); elseif ($trace[0]['args'][0] == 401) die('Bad auth key'); - else - { + else { print 'Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'
'; print $e->getMessage(); } @@ -183,8 +182,7 @@ class Dolistore $trace = $e->getTrace(); if ($trace[0]['args'][0] == 404) die('Bad ID'); elseif ($trace[0]['args'][0] == 401) die('Bad auth key'); - else - { + else { print 'Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'
'; print $e->getMessage(); } diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index 0c348b25f60..b9af92dc8a5 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -42,8 +42,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -56,8 +55,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -94,8 +92,7 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('ECM_AUTO_TREE_ENABLED'); } -else -{ +else { if (empty($conf->global->ECM_AUTO_TREE_ENABLED)) { print ''.img_picto($langs->trans("Disabled"), 'off').''; diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 80161eaadc6..a554354420d 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -127,8 +127,7 @@ if (GETPOST('addfilter', 'alpha')) { $object->fetchFilters(); } - else - { + else { setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error, 'errors'); } } @@ -142,8 +141,7 @@ if ($action == 'deletefilter') { $object->fetchFilters(); } - else - { + else { setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error, 'errors'); } } @@ -163,8 +161,7 @@ if (GETPOST('addoperation', 'alpha')) { $object->fetchActions(); } - else - { + else { setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors'); } } @@ -182,8 +179,7 @@ if ($action == 'updateoperation') { $object->fetchActions(); } - else - { + else { setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors'); } } @@ -196,8 +192,7 @@ if ($action == 'deleteoperation') { $object->fetchActions(); } - else - { + else { setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors'); } } @@ -212,8 +207,7 @@ if ($action == 'confirm_collect') $debuginfo = $object->debuginfo; setEventMessages($object->lastresult, null, 'mesgs'); } - else - { + else { $debuginfo = $object->debuginfo; setEventMessages($object->error, null, 'errors'); } @@ -440,8 +434,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtml .= $form->textwithpicto('', 'connect string '.$connectstringserver); } - else - { + else { $morehtml .= 'IMAP functions not available on your PHP'; } @@ -449,8 +442,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { $morehtml .= 'Failed to open IMAP connection '.$connectstringsource; } - else - { + else { $morehtml .= imap_num_msg($connection); } @@ -582,8 +574,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($res) $arrayoftypes = $hookmanager->resArray; - else - foreach ($hookmanager->resArray as $k=>$desc) + else foreach ($hookmanager->resArray as $k=>$desc) $arrayoftypes[$k] = $desc; @@ -626,8 +617,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; print ' '; } - else - { + else { print $ruleaction['actionparam']; } print ''; diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index f180cdf10cf..bb17bbdca05 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -242,8 +242,7 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) { $num = $nbtotalofrecords; } -else -{ +else { $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index be9e7091300..cd9a2976e11 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -69,8 +69,7 @@ if ($action == 'updateMask') { if ($res > 0) setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - else - setEventMessages($langs->trans("Error"), null, 'errors'); + else setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -130,14 +129,12 @@ elseif ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=expedition&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -259,8 +256,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -327,8 +323,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -396,8 +391,7 @@ foreach ($dirmodels as $reldir) print ''; print ''; } - else - { + else { print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -409,8 +403,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -439,8 +432,7 @@ foreach ($dirmodels as $reldir) { print 'scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'sending').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -487,8 +479,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index d076e77bf44..20f85dc6a29 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -64,8 +64,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -104,14 +103,12 @@ elseif ($action == 'specimen') // For fiche inter header("Location: ".DOL_URL_ROOT."/document.php?modulepart=expensereport&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -179,8 +176,7 @@ elseif ($action == 'setoptions') $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } @@ -264,8 +260,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -329,8 +324,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -396,8 +390,7 @@ foreach ($dirmodels as $reldir) print ''; print ""; } - else - { + else { print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -409,8 +402,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -435,8 +427,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'intervention').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -485,8 +476,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/expensereport_ik.php b/htdocs/admin/expensereport_ik.php index 83bb28ca440..2b089335c40 100644 --- a/htdocs/admin/expensereport_ik.php +++ b/htdocs/admin/expensereport_ik.php @@ -162,8 +162,7 @@ foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab) echo ''; echo ''; } - else - { + else { echo ''.img_edit().''; if (!empty($range->ik->id)) echo ''.img_delete().''; // TODO add delete link diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php index a40e8d95520..0c99b4e4dda 100644 --- a/htdocs/admin/expensereport_rules.php +++ b/htdocs/admin/expensereport_rules.php @@ -229,8 +229,7 @@ foreach ($rules as $rule) echo '
'.$form->select_dolusers($object->fk_user, 'fk_user').'
'; echo '
'.$form->select_dolgroups($object->fk_usergroup, 'fk_usergroup').'
'; } - else - { + else { if ($rule->is_for_all > 0) echo $tab_apply['A']; elseif ($rule->fk_usergroup > 0) echo $tab_apply['G'].' ('.$rule->getGroupLabel().')'; elseif ($rule->fk_user > 0) echo $tab_apply['U'].' ('.$rule->getUserName().')'; @@ -243,11 +242,9 @@ foreach ($rules as $rule) { echo $form->selectExpense($object->fk_c_type_fees, 'fk_c_type_fees', 0, 1, 1); } - else - { + else { if ($rule->fk_c_type_fees == -1) echo $langs->trans('AllExpenseReport'); - else - { + else { $key = getDictvalue(MAIN_DB_PREFIX.'c_type_fees', 'code', $rule->fk_c_type_fees, false, 'id'); if ($key != $langs->trans($key)) echo $langs->trans($key); else echo $langs->trans(getDictvalue(MAIN_DB_PREFIX.'c_type_fees', 'label', $rule->fk_c_type_fees, false, 'id')); // TODO check to return trans of 'code' @@ -261,8 +258,7 @@ foreach ($rules as $rule) { echo $form->selectarray('code_expense_rules_type', $tab_rules_type, $object->code_expense_rules_type, 0); } - else - { + else { echo $tab_rules_type[$rule->code_expense_rules_type]; } echo ''; @@ -273,8 +269,7 @@ foreach ($rules as $rule) { print $form->selectDate(strtotime(date('Y-m-d', $object->dates)), 'start', '', '', 0, '', 1, 0); } - else - { + else { echo dol_print_date($rule->dates, 'day'); } echo ''; @@ -285,8 +280,7 @@ foreach ($rules as $rule) { print $form->selectDate(strtotime(date('Y-m-d', $object->datee)), 'end', '', '', 0, '', 1, 0); } - else - { + else { echo dol_print_date($rule->datee, 'day'); } echo ''; @@ -297,8 +291,7 @@ foreach ($rules as $rule) { echo ''.$conf->currency; } - else - { + else { echo price($rule->amount, 0, $langs, 1, -1, -1, $conf->currency); } echo ''; @@ -309,8 +302,7 @@ foreach ($rules as $rule) { echo $form->selectyesno('restrictive', $object->restrictive, 1); } - else - { + else { echo yn($rule->restrictive, 1, 1); } echo ''; @@ -322,8 +314,7 @@ foreach ($rules as $rule) echo ''.img_edit().' '; echo ''.img_delete().''; } - else - { + else { echo ' '; echo ''.$langs->trans('Cancel').''; } diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index 8aa1a425778..eac6d7eb8e9 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -61,8 +61,7 @@ if ($result) if ($reg[1] && $reg[1] > $lastexternalrss) $lastexternalrss = $reg[1]; } } -else -{ +else { dol_print_error($db); } @@ -93,8 +92,7 @@ if ($action == 'add' || GETPOST("modify")) } */ } - else - { + else { // Ajoute boite box_external_rss dans definition des boites $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes_def (file, note)"; $sql .= " VALUES ('box_external_rss.php','".$db->escape(GETPOST("norss", 'int').' ('.GETPOST($external_rss_title, 'alpha')).")')"; @@ -114,8 +112,7 @@ if ($action == 'add' || GETPOST("modify")) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -162,8 +159,7 @@ if ($_POST["delete"]) $db->commit(); } - else - { + else { $db->rollback(); dol_print_error($db, "sql=".$sql); exit; @@ -179,8 +175,7 @@ if ($_POST["delete"]) header("Location: external_rss.php"); exit; } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -293,8 +288,7 @@ if ($resql) { print ''.$langs->trans("Online").''; } - else - { + else { print ''.$langs->trans("Offline"); $langs->load("errors"); if ($rssparser->error) print ' - '.$langs->trans($rssparser->error); @@ -332,8 +326,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 1a484ec8c7e..6c0c03b6dda 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -72,8 +72,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -109,14 +108,12 @@ elseif ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -173,8 +170,7 @@ elseif ($action == 'setribchq') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -190,8 +186,7 @@ elseif ($action == 'set_FACTURE_DRAFT_WATERMARK') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -208,8 +203,7 @@ elseif ($action == 'set_INVOICE_FREE_TEXT') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -225,8 +219,7 @@ elseif ($action == 'setforcedate') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -248,8 +241,7 @@ elseif ($action == 'setDefaultPDFModulesByType') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -350,8 +342,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -463,8 +454,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -535,8 +525,7 @@ foreach ($dirmodels as $reldir) print ''; print ''; } - else - { + else { print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("SetAsDefault"), 'switch_off').''; print ""; @@ -548,8 +537,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("SetAsDefault"), 'off').''; } print ''; @@ -583,8 +571,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'bill').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -691,14 +678,12 @@ if (!empty($conf->banque->enabled)) } print ""; } - else - { + else { print ''.$langs->trans("NoActiveBankAccountDefined").''; } } } -else -{ +else { print $langs->trans("BankModuleNotActive"); } print ""; @@ -777,8 +762,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 00995a302a5..9dfc2cff6d1 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -127,8 +127,7 @@ if (GETPOST('save', 'alpha')) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -147,8 +146,7 @@ if (empty($conf->use_javascript_ajax)) { setEventMessages(array($langs->trans("NotAvailable"), $langs->trans("JavascriptDisabled")), null, 'errors'); } -else -{ +else { print ''; print ''; print ''; @@ -212,8 +210,7 @@ else $editor = new DolEditor('formtestfield', isset($conf->global->FCKEDITOR_TEST) ? $conf->global->FCKEDITOR_TEST : 'Test', '', 200, $mode, 'In', true, $uselocalbrowser, 1, 120, 8, $readonly); $editor->Create(); } - else - { + else { print '
'; print $conf->global->FCKEDITOR_TEST; print '
'; diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 055384c0084..602570194fd 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -64,8 +64,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -102,14 +101,12 @@ elseif ($action == 'specimen') // For fiche inter header("Location: ".DOL_URL_ROOT."/document.php?modulepart=ficheinter&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -167,8 +164,7 @@ elseif ($action == 'set_FICHINTER_FREE_TEXT') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -184,8 +180,7 @@ elseif ($action == 'set_FICHINTER_DRAFT_WATERMARK') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -201,8 +196,7 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } elseif ($action == 'set_FICHINTER_USE_SERVICE_DURATION') { @@ -325,8 +319,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -389,8 +382,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -458,8 +450,7 @@ foreach ($dirmodels as $reldir) print ''; print ""; } - else - { + else { print ""; @@ -471,8 +462,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -499,8 +489,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'intervention').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -545,8 +534,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php index a661f3a8e9a..ba602c4b609 100644 --- a/htdocs/admin/geoipmaxmind.php +++ b/htdocs/admin/geoipmaxmind.php @@ -65,8 +65,7 @@ if ($action == 'set') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -183,8 +182,7 @@ if ($geoip) if ($result) print $result; else print $langs->trans("Error"); } - else - { + else { print '
'.$ip.' -> '; $result = dol_print_ip($ip, 1); if ($result) print $result; diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index aafe01bf5bd..58f39e30ff2 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -65,8 +65,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -103,14 +102,12 @@ elseif ($action == 'specimen') // For contract header("Location: ".DOL_URL_ROOT."/document.php?modulepart=holiday&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($obj->error, $obj->errors, 'errors'); dol_syslog($obj->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -171,8 +168,7 @@ elseif ($action == 'set_other') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -255,8 +251,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -332,8 +327,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -404,8 +398,7 @@ foreach ($dirmodels as $reldir) print ''; print ''; } - else - { + else { print '"; @@ -417,8 +410,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -450,8 +442,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'contract').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -502,8 +493,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 1b088f0c2b9..8df8a120c05 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -197,14 +197,12 @@ if ($action == 'update') $tmparray = explode(':', $result); setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus', $tmparray[1]), null, 'errors'); } - else - { + else { $error++; setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); } } - else - { + else { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index bd24e793374..33f1abb251f 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -77,8 +77,7 @@ if (empty($reshook)) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -215,8 +214,7 @@ if (!empty($conf->global->LDAP_SERVER_PORT)) { print ''; } -else -{ +else { print ''; } print ''; @@ -249,8 +247,7 @@ if (!empty($conf->global->LDAP_ADMIN_PASS)) { print ''; // je le met en visible pour test } -else -{ +else { print ''; } print ''; @@ -296,8 +293,7 @@ if (function_exists("ldap_connect")) print ''.$langs->trans("LDAPBindOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).''; print '
'; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPBindKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).''; print '
'; @@ -305,8 +301,7 @@ if (function_exists("ldap_connect")) print '
'; } } - else - { + else { print img_picto('', 'warning').' '; print ''.$langs->trans("LDAPNoUserOrPasswordProvidedAccessIsReadOnly").''; print '
'; @@ -320,8 +315,7 @@ if (function_exists("ldap_connect")) print ''.$langs->trans("LDAPSetupForVersion3").''; print '
'; } - else - { + else { print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSetupForVersion2").''; print '
'; @@ -329,8 +323,7 @@ if (function_exists("ldap_connect")) $unbind = $ldap->unbind(); } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPTCPConnectKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).''; print '
'; diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index 834bde4eea5..58eb04e595d 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -79,8 +79,7 @@ if ($action == 'setvalue' && $user->admin) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -293,8 +292,7 @@ if (function_exists("ldap_connect")) print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSynchroOK").'
'; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; @@ -307,8 +305,7 @@ if (function_exists("ldap_connect")) print nl2br($ldap->dump_content($dn, $info)); print "\n
"; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index fb49c947411..a301738db94 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -71,8 +71,7 @@ if ($action == 'setvalue' && $user->admin) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -234,8 +233,7 @@ if (function_exists("ldap_connect")) print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSynchroOK").'
'; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; @@ -248,8 +246,7 @@ if (function_exists("ldap_connect")) print nl2br($ldap->dump_content($dn, $info)); print "\n
"; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index f6fa74cb79d..eba84afe925 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -96,8 +96,7 @@ if ($action == 'setvalue' && $user->admin) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -416,8 +415,7 @@ if (function_exists("ldap_connect")) print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSynchroOK").'
'; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; @@ -430,8 +428,7 @@ if (function_exists("ldap_connect")) print nl2br($ldap->dump_content($dn, $info)); print "\n
"; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; diff --git a/htdocs/admin/ldap_members_types.php b/htdocs/admin/ldap_members_types.php index 6628dd4d144..6913c477b38 100644 --- a/htdocs/admin/ldap_members_types.php +++ b/htdocs/admin/ldap_members_types.php @@ -69,8 +69,7 @@ if ($action == 'setvalue' && $user->admin) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -216,8 +215,7 @@ if (function_exists("ldap_connect")) print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSynchroOK").'
'; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; @@ -230,8 +228,7 @@ if (function_exists("ldap_connect")) print nl2br($ldap->dump_content($dn, $info)); print "\n
"; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index 7781cf45676..d0d3bb50d0d 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -90,8 +90,7 @@ if ($action == 'setvalue' && $user->admin) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -396,8 +395,7 @@ if (function_exists("ldap_connect")) print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSynchroOK").'
'; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; @@ -410,8 +408,7 @@ if (function_exists("ldap_connect")) print nl2br($ldap->dump_content($dn, $info)); print "\n
"; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; @@ -477,8 +474,7 @@ if (function_exists("ldap_connect")) $liste[$key] = $label; } } - else - { + else { setEventMessages($ldap->error, $ldap->errors, 'errors'); } @@ -491,8 +487,7 @@ if (function_exists("ldap_connect")) print "=> ".count($liste)." records
\n"; print "\n
"; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index 0646c7f6d46..b03067bd581 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -163,8 +163,7 @@ if ($action == 'edit') print ''; print '
'; } -else -{ +else { print '
'.$langs->trans("ActivateFCKeditor").'\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'.$langs->trans("LDAPServerPortExample").'
'.$langs->trans('Password').' (ex: secret)
'; print ''; @@ -204,8 +203,7 @@ if (empty($mysoc->country_code)) $warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete")); print '
'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").''; } -else -{ +else { // Show examples print load_fiche_titre($langs->trans("ExamplesWithCurrentSetup"), '', ''); @@ -270,8 +268,7 @@ else } } } - else - { + else { // More examples if not specific vat rate found // This example must be kept for test purpose with current value because value used (2/7, 10/3, and vat 0, 10) // were calculated to show all possible cases of rounding. If we change this, examples becomes useless or show the same rounding rule. diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index 4cd8f4841e5..f6e3c0e63f9 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -64,8 +64,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -81,8 +80,7 @@ if ($action == 'set_DELIVERY_FREE_TEXT') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -119,14 +117,12 @@ if ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=livraison&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -250,8 +246,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -317,8 +312,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -384,8 +378,7 @@ foreach ($dirmodels as $reldir) print ''; print ""; } - else - { + else { print "
"; @@ -397,8 +390,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -418,8 +410,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'sending').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -463,8 +454,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/loan.php b/htdocs/admin/loan.php index 45202de342b..23cd1fd6bba 100644 --- a/htdocs/admin/loan.php +++ b/htdocs/admin/loan.php @@ -64,8 +64,7 @@ if ($action == 'update') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -108,8 +107,7 @@ foreach ($list as $key) { print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1); } - else - { + else { print ''; } print ''; diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 921a4a6338c..020c1ef5241 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -66,8 +66,7 @@ if ($action == 'setvalue') $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } diff --git a/htdocs/admin/mailman.php b/htdocs/admin/mailman.php index 05c36128e8d..100b5cf3224 100644 --- a/htdocs/admin/mailman.php +++ b/htdocs/admin/mailman.php @@ -66,8 +66,7 @@ if ($action == 'update' || $action == 'add') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -100,8 +99,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && !empty($conf $langs->load("errors"); setEventMessages($langs->trans("ErrorBadEMail", $email), null, 'errors'); } - else - { + else { include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'; $mailmanspip = new MailmanSpip($db); @@ -119,8 +117,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && !empty($conf $error++; setEventMessages($mailmanspip->error, $mailmanspip->errors, 'errors'); } - else - { + else { setEventMessages($langs->trans("MailmanCreationSuccess"), null); } } @@ -132,8 +129,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && !empty($conf $error++; setEventMessages($mailmanspip->error, $mailmanspip->errors, 'errors'); } - else - { + else { setEventMessages($langs->trans("MailmanDeletionSuccess"), null); } } @@ -212,8 +208,7 @@ if (!empty($conf->global->ADHERENT_USE_MAILMAN)) print ''; } -else -{ +else { dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user'); $link = ''; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 5502d44dae0..42ddb907b7d 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -170,8 +170,7 @@ if ($action == 'edit') jQuery("#smtp_server_mess").show(); jQuery("#smtp_port_mess").show();'; } - else - { + else { print ' jQuery("#MAIN_MAIL_SMTP_SERVER").prop("disabled", true); jQuery("#MAIN_MAIL_SMTP_PORT").prop("disabled", true); @@ -287,8 +286,7 @@ if ($action == 'edit') { print $form->selectarray('MAIN_MAIL_SENDMODE', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE); } - else - { + else { $text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE]; if (empty($text)) $text = $langs->trans("Undefined"); $htmltext = $langs->trans("ContactSuperAdminForChange"); @@ -305,8 +303,7 @@ if ($action == 'edit') print ''; } - else - { + else { print ''; } @@ -549,8 +539,7 @@ else { print ''; } - else - { + else { print ''; } @@ -699,8 +688,7 @@ else print $conf->global->MAIN_MAIL_AUTOCOPY_TO; if (!isValidEmail($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print img_warning($langs->trans("ErrorBadEMail")); } - else - { + else { print ' '; } print ''; @@ -722,8 +710,7 @@ else print ''.$langs->trans("DoTestServerAvailability").''; } } - else - { + else { print ''.$langs->trans("DoTestServerAvailability").''; } @@ -795,8 +782,7 @@ else $mail = new CMailFile('', '', '', '', array(), array(), array(), '', '', 0, '', '', '', '', $trackid, $sendcontext); $result = $mail->check_server_port($server, $port); if ($result) print '
'.$langs->trans("ServerAvailableOnIPOrPort", $server, $port).'
'; - else - { + else { $errormsg = $langs->trans("ServerNotAvailableOnIPOrPort", $server, $port); if ($mail->error) { diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index 84a0d2a0893..98c44f2b503 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -157,8 +157,7 @@ if ($action == 'edit') jQuery("#smtp_port_mess").show(); '; } - else - { + else { print ' jQuery("#MAIN_MAIL_SMTP_SERVER_EMAILING").prop("disabled", true); jQuery("#MAIN_MAIL_SMTP_PORT_EMAILING").prop("disabled", true); @@ -237,8 +236,7 @@ if ($action == 'edit') { print $form->selectarray('MAIN_MAIL_SENDMODE_EMAILING', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE_EMAILING); } - else - { + else { $text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE_EMAILING]; if (empty($text)) $text = $langs->trans("Undefined"); $htmltext = $langs->trans("ContactSuperAdminForChange"); @@ -256,8 +254,7 @@ if ($action == 'edit') print '
'; } - else - { + else { print ''; } @@ -425,8 +415,7 @@ else { print ''; } - else - { + else { print ''; } @@ -507,8 +496,7 @@ else print ''.$langs->trans("DoTestServerAvailability").''; } } - else - { + else { print ''.$langs->trans("DoTestServerAvailability").''; } @@ -539,8 +527,7 @@ else $result = $mail->check_server_port($server, $port); if ($result) print '
'.$langs->trans("ServerAvailableOnIPOrPort", $server, $port).'
'; - else - { + else { $errormsg = $langs->trans("ServerNotAvailableOnIPOrPort", $server, $port); if ($mail->error) { diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 1c50ebf0949..fd5f4e3b1a7 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -282,8 +282,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit { $num = $nbtotalofrecords; } -else -{ +else { if ($limit) $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 37d1f903b4a..1dcc621095c 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -123,8 +123,7 @@ if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $helpsubstitforlines .= $key.' -> '.$val.'
'; } } -else -{ +else { $tmp = FormMail::getAvailableSubstitKey('formemailwithlines'); $tmp['__(AnyTranslationKey)__'] = 'Translation'; $helpsubstit = $langs->trans("AvailableVariables").':
'; @@ -297,8 +296,7 @@ if (empty($reshook)) setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs'); $_POST = array('id'=>$id); // Clean $_POST array, we keep only id } - else - { + else { if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors'); } @@ -356,8 +354,7 @@ if (empty($reshook)) { setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($db->error(), null, 'errors'); } } @@ -377,8 +374,7 @@ if (empty($reshook)) { setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors'); } - else - { + else { dol_print_error($db); } } @@ -577,8 +573,7 @@ foreach ($fieldsforcontent as $tmpfieldlist) elseif ($tmpfieldlist == 'joinfiles') { print ''; } - else - { + else { if ($context != 'hide') { // print ''; $okforextended = true; @@ -587,8 +582,7 @@ foreach ($fieldsforcontent as $tmpfieldlist) $doleditor = new DolEditor($tmpfieldlist, (!empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 120, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_4, '90%'); print $doleditor->Create(1); } - else - print ' '; + else print ' '; } print ''; if ($tmpfieldlist == 'topic') { @@ -802,8 +796,7 @@ if ($resql) print "\n"; } - else - { + else { $keyforobj = 'type_template'; if (!in_array($obj->$keyforobj, array_keys($elementList))) { @@ -989,15 +982,13 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') { print $form->select_dolusers($obj->{$fieldlist[$field]}, 'fk_user', 1, null, 0, '', null, 0, 0, 1, '', 0, '', 'maxwidth200'); } - else - { + else { if ($context == 'add') // I am not admin and we show the add form { print $user->getNomUrl(1); // Me $forcedvalue = $user->id; } - else - { + else { if ($obj && !empty($obj->{$fieldlist[$field]}) && $obj->{$fieldlist[$field]} > 0) { $fuser = new User($db); @@ -1005,8 +996,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print $fuser->getNomUrl(1); $forcedvalue = $fuser->id; } - else - { + else { $forcedvalue = $obj->{$fieldlist[$field]}; } } @@ -1024,8 +1014,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') if ($context == 'edit') $selectedlang = $obj->{$fieldlist[$field]}; print $formadmin->select_language($selectedlang, 'langcode', 0, null, 1, 0, 0, 'maxwidth150'); } - else - { + else { if (!empty($obj->{$fieldlist[$field]})) { print $obj->{$fieldlist[$field]}.' - '.$langs->trans('Language_'.$obj->{$fieldlist[$field]}); @@ -1046,8 +1035,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print ''; print $obj->{$fieldlist[$field]}; } - else - { + else { print $form->selectarray('type_template', $elementList, (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''), 1, 0, 0, '', 0, 0, 0, '', 'maxwidth150 maxwidth100onsmartphone'); } print ''; @@ -1055,8 +1043,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') elseif ($context == 'add' && in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue; elseif ($context == 'edit' && in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue; elseif ($context == 'hide' && in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue; - else - { + else { $size = ''; $class = ''; $classtd = ''; if ($fieldlist[$field] == 'code') $class = 'maxwidth100'; if ($fieldlist[$field] == 'label') $class = 'maxwidth100'; @@ -1073,14 +1060,12 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') { print $form->selectyesno($fieldlist[$field], '1', 1); } - else - { + else { //print ''; print $form->selectyesno($fieldlist[$field], (isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''), 1); } } - else - { + else { print ''; } print ''; diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index 856ad50c28b..b66ab89075f 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -97,8 +97,7 @@ if ($action == 'update' && !$cancel) { $db->commit(); } - else - { + else { $error++; setEventMessages($langs->trans("FailedToInitializeMenu").' '.$key, null, 'errors'); $db->rollback(); diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index ef58c1042d4..a059a76b40c 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -103,9 +103,7 @@ if ($action == 'update') if (is_numeric(GETPOST('menuIdParent', 'alpha'))) { $menu->fk_menu = GETPOST('menuIdParent', 'alpha'); - } - else - { + } else { if (GETPOST('type', 'alpha') == 'top') $menu->fk_menu = 0; else $menu->fk_menu = -1; $menu->fk_mainmenu = $mainmenu; @@ -116,14 +114,10 @@ if ($action == 'update') if ($result > 0) { setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); - } - else - { + } else { setEventMessages($menu->error, $menu->errors, 'errors'); } - } - else - { + } else { setEventMessages($menu->error, $menu->errors, 'errors'); } $action = "edit"; @@ -131,8 +125,7 @@ if ($action == 'update') header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".$menu_handler); exit; } - else - { + else { header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".$menu_handler); exit; } @@ -222,8 +215,7 @@ if ($action == 'add') { $menu->fk_menu = GETPOST('menuId', 'alpha', 3); } - else - { + else { if (GETPOST('type', 'alpha') == 'top') $menu->fk_menu = 0; else $menu->fk_menu = -1; $menu->fk_mainmenu = $mainmenu; @@ -236,8 +228,7 @@ if ($action == 'add') header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".GETPOST('menu_handler', 'aZ09')); exit; } - else - { + else { $action = 'create'; setEventMessages($menu->error, $menu->errors, 'errors'); } @@ -261,8 +252,7 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == 'yes') llxFooter(); exit; } - else - { + else { $this->db->rollback(); $reload = 0; @@ -359,8 +349,7 @@ if ($action == 'create') print $langs->trans('Left'); print ''; } - else - { + else { print '
'; } - else - { + else { print ''; } print '"; diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index d5bf12f1061..7b64dd08bd0 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -105,8 +105,7 @@ foreach ($modulesdir as $dir) continue; } - try - { + try { $res = include_once $dir.$file; if (class_exists($modName)) { @@ -141,8 +140,7 @@ foreach ($modulesdir as $dir) { $arrayofnatures['external_'.$publisher] = $langs->trans("External").' - '.$publisher; } - else - { + else { $arrayofnatures['external_'] = $langs->trans("External").' - '.$langs->trans("UnknownPublishers"); } } @@ -188,8 +186,7 @@ foreach ($modulesdir as $dir) dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR); } } - else - { + else { print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)
"; } } @@ -202,8 +199,7 @@ foreach ($modulesdir as $dir) } closedir($handle); } - else - { + else { dol_syslog("htdocs/admin/modulehelp.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING); } } @@ -332,8 +328,7 @@ if ($mode == 'desc') $text .= $textexternal; $text .= '
'; } - else - { + else { $text .= '
'.$langs->trans("Origin").': '.$langs->trans("Core").'
'; } @@ -450,8 +445,7 @@ if ($mode == 'feature') { $yesno = 'Yes'; } - else - { + else { $yesno = 'No'; } require_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php'; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index c0f1991835b..dba149a2bb0 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -126,8 +126,7 @@ if ($action == 'install') setEventMessages($langs->trans("ErrorModuleFileRequired"), null, 'warnings'); $error++; } - else - { + else { if (!$error && !preg_match('/\.zip$/i', $original_file)) { $langs->load("errors"); @@ -174,8 +173,7 @@ if ($action == 'install') setEventMessages($langs->trans($result['error'], $original_file), null, 'errors'); $error++; } - else - { + else { // Now we move the dir of the module $modulename = preg_replace('/module_/', '', $original_file); $modulename = preg_replace('/\-([0-9][0-9\.]*)\.zip$/i', '', $modulename); @@ -231,8 +229,7 @@ if ($action == 'install') } } } - else - { + else { setEventMessages($langs->trans("ErrorFailToRenameFile", $_FILES['fileinstall']['tmp_name'], $newfile), null, 'errors'); $error++; } @@ -248,8 +245,7 @@ if ($action == 'set' && $user->admin) { $resarray = activateModule($value); if (!empty($resarray['errors'])) setEventMessages('', $resarray['errors'], 'errors'); - else - { + else { //var_dump($resarray);exit; if ($resarray['nbperms'] > 0) { @@ -341,8 +337,7 @@ foreach ($modulesdir as $dir) continue; } - try - { + try { $res = include_once $dir.$file; // A class already exists in a different file will send a non catchable fatal error. if (class_exists($modName)) { @@ -376,8 +371,7 @@ foreach ($modulesdir as $dir) { $arrayofnatures['external_'.$publisher] = $langs->trans("External").' - '.$publisher; } - else - { + else { $arrayofnatures['external_'] = $langs->trans("External").' - '.$langs->trans("UnknownPublishers"); } } @@ -438,8 +432,7 @@ foreach ($modulesdir as $dir) dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR); } } - else - { + else { print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)
"; } } @@ -452,8 +445,7 @@ foreach ($modulesdir as $dir) } closedir($handle); } - else - { + else { dol_syslog("htdocs/admin/modules.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING); } } @@ -716,8 +708,7 @@ if ($mode == 'common' || $mode == 'commonkanban') } if (!empty($conf->multicompany->enabled) && $user->entity) $disableSetup++; } - else - { + else { if (!empty($objMod->warnings_unactivation[$mysoc->country_code]) && method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) { $codeenabledisable .= 'warnings_unactivation[$mysoc->country_code].'&value='.$modName.'&mode='.$mode.$param.'">'; $codeenabledisable .= img_picto($langs->trans("Activated"), 'switch_on'); @@ -752,15 +743,13 @@ if ($mode == 'common' || $mode == 'commonkanban') $codetoconfig .= ''.img_picto(ucfirst($page), "setup").''; // print ''.ucfirst($page).' '; } - else - { + else { if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs)) { $urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1); $codetoconfig .= ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').''; } - else - { + else { $urltouse = $urlpage; $codetoconfig .= ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').''; } @@ -771,17 +760,15 @@ if ($mode == 'common' || $mode == 'commonkanban') { $codetoconfig .= ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').''; } - else - { + else { $codetoconfig .= ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').''; } } - else - { + else { $codetoconfig .= img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"', false, 0, 0, '', 'fa-15'); } } - else // Module not yet activated + else // Module not yet activated { // Set $codeenabledisable if (!empty($objMod->always_enabled)) @@ -792,8 +779,7 @@ if ($mode == 'common' || $mode == 'commonkanban') { $codeenabledisable .= $langs->trans("Disabled"); } - else - { + else { // Module qualified for activation $warningmessage = ''; if (!empty($arrayofwarnings[$modName])) @@ -857,8 +843,7 @@ if ($mode == 'common' || $mode == 'commonkanban') if (preg_match('/^\//i', $objMod->picto)) print img_picto($alttext, $objMod->picto, 'class="valignmiddle pictomodule paddingrightonly"', 1); else print img_object($alttext, $objMod->picto, 'class="valignmiddle pictomodule paddingrightonly"'); } - else - { + else { print img_object($alttext, 'generic', 'class="valignmiddle paddingrightonly"'); } print ' '.$objMod->getName().''; @@ -1028,8 +1013,7 @@ if ($mode == 'deploy') $message = info_admin($langs->trans("ConfFileMustContainCustom", DOL_DOCUMENT_ROOT.'/custom', DOL_DOCUMENT_ROOT)); $allowfromweb = -1; } - else - { + else { if ($dirins_ok) { if (!is_writable(dol_osencode($dirins))) @@ -1039,15 +1023,13 @@ if ($mode == 'deploy') $allowfromweb = 0; } } - else - { + else { $message = info_admin($langs->trans("NotExistsDirect", $dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample")); $allowfromweb = 0; } } } - else - { + else { $message = info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile", $dolibarrdataroot.'/installmodules.lock')); $allowfromweb = 0; } @@ -1068,8 +1050,7 @@ if ($mode == 'deploy') { //print $langs->trans("ThisIsProcessToFollow").'
'; } - else - { + else { print $langs->trans("ThisIsAlternativeProcessToFollow").'
'; print ''.$langs->trans("StepNb", 1).': '; print $langs->trans("FindPackageFromWebSite", $fullurl).'
'; @@ -1150,8 +1131,7 @@ if ($mode == 'deploy') print info_admin($langs->trans("ThisLimitIsDefinedInSetup", $max, $maxphptoshow, $maxphptoshowparam), 1); } } - else - { + else { print ' ('.$langs->trans("UploadDisabled").')'; } @@ -1162,8 +1142,7 @@ if ($mode == 'deploy') print '
'; } - else - { + else { print $langs->trans("UnpackPackageInModulesRoot", $dirins).'
'; print ''.$langs->trans("StepNb", 4).': '; print $langs->trans("SetupIsReadyForUse").'
'; diff --git a/htdocs/admin/mrp.php b/htdocs/admin/mrp.php index 9c59b5cf6da..ddf55993fd7 100644 --- a/htdocs/admin/mrp.php +++ b/htdocs/admin/mrp.php @@ -59,8 +59,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -97,14 +96,12 @@ elseif ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=mrp&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, null, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -162,8 +159,7 @@ elseif ($action == 'set_MRP_MO_DRAFT_WATERMARK') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -180,8 +176,7 @@ elseif ($action == 'set_MRP_MO_FREE_TEXT') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -263,8 +258,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -329,8 +323,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -400,8 +393,7 @@ foreach ($dirmodels as $reldir) print ''; print ''; } - else - { + else { print '
"; @@ -413,8 +405,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -443,8 +434,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'bill').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -490,8 +480,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index 4ba581398ee..1b912b27b5e 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -54,8 +54,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -67,8 +66,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -146,8 +144,7 @@ elseif ($action == 'setapilayer') dolibarr_set_const($db, 'MULTICURRENCY_APP_SOURCE', GETPOST('MULTICURRENCY_APP_SOURCE', 'alpha')); //dolibarr_set_const($db, 'MULTICURRENCY_ALTERNATE_SOURCE', GETPOST('MULTICURRENCY_ALTERNATE_SOURCE', 'alpha')); } - else - { + else { $result = MultiCurrency::syncRates($conf->global->MULTICURRENCY_APP_ID); if ($result > 0) { setEventMessages($langs->trans("CurrencyRateSyncSucceed"), null, "mesgs"); diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index ba92aa1ec21..859d36b7c36 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -85,8 +85,7 @@ if ($action == 'settemplates') setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); @@ -107,8 +106,7 @@ if ($action == 'setvalue' && $user->admin) setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); @@ -161,8 +159,7 @@ if ($action == 'setfixednotif' && $user->admin) setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); diff --git a/htdocs/admin/oauth.php b/htdocs/admin/oauth.php index 785a77ac043..85f9ebf0409 100644 --- a/htdocs/admin/oauth.php +++ b/htdocs/admin/oauth.php @@ -120,8 +120,7 @@ foreach ($list as $key) print ''; } - else - { + else { print ''; print ''; print ''; diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php index d8c65f9a2c5..f0d3c530b71 100644 --- a/htdocs/admin/oauthlogintokens.php +++ b/htdocs/admin/oauthlogintokens.php @@ -79,8 +79,7 @@ if ($action == 'setconst' && $user->admin) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -99,8 +98,7 @@ if ($action == 'setvalue' && $user->admin) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -179,8 +177,7 @@ if ($mode == 'setup' && $user->admin) $urltodelete = ''; $urltocheckperms = ''; } - else - { + else { $urltorenew = ''; $urltodelete = ''; $urltocheckperms = ''; @@ -194,8 +191,7 @@ if ($mode == 'setup' && $user->admin) require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php'; // Dolibarr storage $storage = new DoliStorage($db, $conf); - try - { + try { $tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME); } catch (Exception $e) @@ -226,8 +222,7 @@ if ($mode == 'setup' && $user->admin) { $expiredat = $langs->trans("Unknown"); } - else - { + else { $expiredat = dol_print_date($endoflife, "dayhour"); } } diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index a5b494b62e2..2873cf5d15f 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -57,8 +57,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -184,8 +183,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 496a32923f7..ec4015f6e98 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -190,8 +190,7 @@ for ($i = 1; $i <= 6; $i++) $pid = $langs->transcountry("ProfId".$i, $mysoc->country_code); if ($pid == '-') $pid = false; } - else - { + else { $pid = img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; } if ($pid) diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 0486edebeec..7dcaf0fba47 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -230,8 +230,7 @@ if ($result) print img_picto($langs->trans("Active"), 'tick'); print ''; } - else - { + else { print ''; diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index e9795304ad3..b33b2396aa2 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -101,8 +101,7 @@ if ($action == "set") $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 73703829b8c..f2c748b4ce2 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -64,8 +64,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -101,14 +100,12 @@ elseif ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=propal&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -127,8 +124,7 @@ elseif ($action == 'setribchq') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -143,8 +139,7 @@ elseif ($action == 'set_PROPALE_DRAFT_WATERMARK') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -160,8 +155,7 @@ elseif ($action == 'set_PROPOSAL_FREE_TEXT') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -175,8 +169,7 @@ elseif ($action == 'setdefaultduration') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -191,8 +184,7 @@ elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -311,8 +303,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -377,8 +368,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -449,8 +439,7 @@ foreach ($dirmodels as $reldir) print ''; print ''; } - else - { + else { print ""; @@ -462,8 +451,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -497,8 +485,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'bill').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -572,14 +559,12 @@ if (empty($conf->facture->enabled)) } print ""; } - else - { + else { print "".$langs->trans("NoActiveBankAccountDefined").""; } } } - else - { + else { print ''.$langs->trans("BankModuleNotActive").''; } } @@ -686,8 +671,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index 8730f148c07..dc6aa5da33b 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -90,8 +90,7 @@ if ($action == 'addprinter' && $user->admin) { $db->commit(); setEventMessages($langs->trans("PrinterAdded", $printername), null); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -116,8 +115,7 @@ if ($action == 'deleteprinter' && $user->admin) { $db->commit(); setEventMessages($langs->trans("PrinterDeleted", $printername), null); } - else - { + else { $db->rollback(); dol_print_error($db); } diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index 312038d3fcc..68f8f0e62ee 100644 --- a/htdocs/admin/reception_setup.php +++ b/htdocs/admin/reception_setup.php @@ -72,8 +72,7 @@ if ($action == 'updateMask') { if ($res > 0) setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - else - setEventMessages($langs->trans("Error"), null, 'errors'); + else setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -133,14 +132,12 @@ elseif ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=reception&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -264,8 +261,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -332,8 +328,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -402,8 +397,7 @@ foreach ($dirmodels as $reldir) print ''; print ''; } - else - { + else { print '"; @@ -415,8 +409,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -447,8 +440,7 @@ foreach ($dirmodels as $reldir) { print 'scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'reception').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php index 3efdd05bdc7..04ff3861c7f 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -92,8 +92,7 @@ if (empty($conf->use_javascript_ajax)) print $langs->trans("NotAvailableWhenAjaxDisabled"); print ''; } -else -{ +else { print '\n"; @@ -436,8 +431,7 @@ if (!empty($conf->global->DATABASE_PWD_ENCRYPTED)) //Do not allow "disable encryption" as passwords cannot be decrypted print ''.$langs->trans("Disable").''; } - else - { + else { print '-'; } print ""; @@ -463,8 +457,7 @@ if (empty($dolibarr_main_db_pass) && empty($dolibarr_main_db_encrypted_pass)) $langs->load("errors"); print img_warning($langs->trans("WarningPassIsEmpty")); } -else -{ +else { if (empty($dolibarr_main_db_encrypted_pass)) { print ''.$langs->trans("Activate").''; @@ -516,8 +509,7 @@ if (GETPOST('info', 'int') > 0) { print $langs->trans("Note: The function password_hash exists on your PHP")."
\n"; } - else - { + else { print $langs->trans("Note: The function password_hash does not exists on your PHP")."
\n"; } print 'MAIN_SECURITY_HASH_ALGO = '.$conf->global->MAIN_SECURITY_HASH_ALGO."
\n"; diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index f642cd64182..b6674f00c5c 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -51,8 +51,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) Header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } elseif (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { @@ -62,8 +61,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) Header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -119,20 +117,17 @@ if (function_exists("imagecreatefrompng")) { print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA'); } - else - { + else { if (empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA)) { print ''.img_picto($langs->trans("Disabled"), 'off').''; } - else - { + else { print ''.img_picto($langs->trans("Enabled"), 'on').''; } } } -else -{ +else { $desc = $form->textwithpicto('', $langs->transnoentities("EnableGDLibraryDesc"), 1, 'warning'); print $desc; } @@ -146,14 +141,12 @@ if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('MAIN_USE_ADVANCED_PERMS'); } -else -{ +else { if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { print ''.img_picto($langs->trans("Disabled"), 'off').''; } - else - { + else { print ''.img_picto($langs->trans("Enabled"), 'on').''; } } diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index 09cc0debfd5..0745203f365 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -123,8 +123,7 @@ if ($action == 'send' && !$_POST['cancel']) setEventMessages($langs->trans("SmsSuccessfulySent", $smsfrom, $sendto), null, 'mesgs'); setEventMessages($smsfile->error, $smsfile->errors, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("ResultKo"), null, 'errors'); setEventMessages($smsfile->error, $smsfile->errors, 'errors'); } @@ -206,8 +205,7 @@ if ($action == 'edit') print ''; print '
'; } -else -{ +else { if (!count($listofmethods)) print '
'.$langs->trans("NoSmsEngine", 'DoliStore').'
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "
'; print ''.$langs->trans("SeeLocalSendMailSetup").''; } - else - { + else { $mainserver = (!empty($conf->global->MAIN_MAIL_SMTP_SERVER) ? $conf->global->MAIN_MAIL_SMTP_SERVER : ''); $smtpserver = ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined"); if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); @@ -319,8 +316,7 @@ if ($action == 'edit') print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; } - else - { + else { $text = !empty($mainserver) ? $mainserver : $smtpserver; $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); @@ -337,8 +333,7 @@ if ($action == 'edit') print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; } - else - { + else { $mainport = (!empty($conf->global->MAIN_MAIL_SMTP_PORT) ? $conf->global->MAIN_MAIL_SMTP_PORT : ''); $smtpport = ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined"); if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); @@ -351,8 +346,7 @@ if ($action == 'edit') print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; } - else - { + else { $text = (!empty($mainport) ? $mainport : $smtpport); $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); @@ -371,8 +365,7 @@ if ($action == 'edit') { print ''; } - else - { + else { $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID, $htmltext, 1, 'superadmin'); print ''; @@ -392,8 +385,7 @@ if ($action == 'edit') { print ''; } - else - { + else { $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW, $htmltext, 1, 'superadmin'); print ''; @@ -497,8 +489,7 @@ if ($action == 'edit') print ''; } -else -{ +else { dol_fiche_head($head, 'common', '', -1); print ''.$langs->trans("EMailsDesc")."
\n"; @@ -539,8 +530,7 @@ else { print '
'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined")).''.(!empty($conf->global->MAIN_MAIL_SMTP_SERVER) ? $conf->global->MAIN_MAIL_SMTP_SERVER : '').'
'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.(!empty($conf->global->MAIN_MAIL_SMTP_PORT) ? $conf->global->MAIN_MAIL_SMTP_PORT : '').'
'; print $langs->trans("SeeLocalSendMailSetup"); } - else - { + else { $mainserver = (!empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING : ''); $smtpserver = ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined"); if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); @@ -270,8 +267,7 @@ if ($action == 'edit') print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; } - else - { + else { $text = !empty($mainserver) ? $mainserver : $smtpserver; $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); @@ -289,8 +285,7 @@ if ($action == 'edit') print ''; print $langs->trans("SeeLocalSendMailSetup"); } - else - { + else { $mainport = (!empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : ''); $smtpport = ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined"); if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); @@ -303,8 +298,7 @@ if ($action == 'edit') print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; } - else - { + else { $text = (!empty($mainport) ? $mainport : $smtpport); $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); @@ -323,8 +317,7 @@ if ($action == 'edit') { print ''; } - else - { + else { $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING, $htmltext, 1, 'superadmin'); print ''; @@ -342,8 +335,7 @@ if ($action == 'edit') { print ''; } - else - { + else { $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING, $htmltext, 1, 'superadmin'); print ''; @@ -391,8 +383,7 @@ if ($action == 'edit') print ''; } -else -{ +else { dol_fiche_head($head, 'common_emailing', '', -1); print ''.$langs->trans("EMailsDesc")."
\n"; @@ -415,8 +406,7 @@ else { print '
'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined")).''.(!empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING : '').'
'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.(!empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : '').'
'.$parent_rowid.''.$langs->trans('DetailMenuIdParent'); diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index 97f0246ac88..f27968d462d 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -192,8 +192,7 @@ elseif ($action == 'confirm_delete' && $confirm == 'yes') header("Location: ".DOL_URL_ROOT.'/admin/menus/index.php?menu_handler='.$menu_handler); exit; } - else - { + else { $db->rollback(); $reload = 0; @@ -409,8 +408,7 @@ if ($conf->use_javascript_ajax) print ''; } -else -{ +else { $langs->load("errors"); setEventMessages($langs->trans("ErrorFeatureNeedJavascript"), null, 'errors'); } diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php index ed35f48d90e..145ec566057 100644 --- a/htdocs/admin/menus/other.php +++ b/htdocs/admin/menus/other.php @@ -95,8 +95,7 @@ if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } -else -{ +else { print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } print "'."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; print '
'.$langs->trans("UseTheFollowingUrlAsRedirectURI").''.$langs->trans("FeatureNotYetSupported").''; print ''.img_edit_add().''; print '\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; $arrval = array( '0'=>$langs->trans("No"), diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index d9d61673c5e..161b521337b 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -46,8 +46,7 @@ if ($action == 'setgeneraterule') { dol_print_error($db); } - else - { + else { header("Location: ".$_SERVER["PHP_SELF"]); exit; } @@ -102,8 +101,7 @@ if ($action == 'activate_encrypt') header("Location: security.php"); exit; } - else - { + else { $db->rollback(); dol_print_error($db, ''); } @@ -132,8 +130,7 @@ if ($action == 'activate_encryptdbpassconf') header("Location: security.php"); exit; } - else - { + else { setEventMessages($langs->trans('InstrucToEncodePass', dol_encode($dolibarr_main_db_pass)), null, 'warnings'); } } @@ -149,8 +146,7 @@ elseif ($action == 'disable_encryptdbpassconf') header("Location: security.php"); exit; } - else - { + else { setEventMessages($langs->trans('InstrucToClearPass', $dolibarr_main_db_pass), null, 'warnings'); } } @@ -278,8 +274,7 @@ foreach ($arrayhandler as $key => $module) { print img_picto('', 'tick'); } - else - { + else { print ''.$langs->trans("Activate").''; } print "
'; @@ -265,8 +263,7 @@ else { print ''.$langs->trans("DoTestSend").''; } - else - { + else { print ''.$langs->trans("DoTestSend").''; } print ''; diff --git a/htdocs/admin/socialnetworks.php b/htdocs/admin/socialnetworks.php index d2a92aed9e8..fd4329b7023 100644 --- a/htdocs/admin/socialnetworks.php +++ b/htdocs/admin/socialnetworks.php @@ -49,8 +49,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -63,8 +62,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php index 2ed43e97efd..6c1d1837ea8 100644 --- a/htdocs/admin/spip.php +++ b/htdocs/admin/spip.php @@ -74,8 +74,7 @@ if ($action == 'update' || $action == 'add') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -154,8 +153,7 @@ if (!empty($conf->global->ADHERENT_USE_SPIP)) print ''; } -else -{ +else { dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); $link = ''; diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 43e610c3052..d3b9061eecc 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -49,8 +49,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -63,8 +62,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -120,8 +118,7 @@ if (!empty($conf->facture->enabled)) print $form->selectarray("STOCK_CALCULATE_ON_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_BILL); } } -else -{ +else { print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module30Name")); } print "\n\n"; @@ -140,8 +137,7 @@ if (!empty($conf->commande->enabled)) print $form->selectarray("STOCK_CALCULATE_ON_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER); } } -else -{ +else { print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module25Name")); } print "\n\n"; @@ -162,8 +158,7 @@ if (!empty($conf->expedition->enabled)) print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT); } } -else -{ +else { print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module80Name")); } print "\n\n"; @@ -182,8 +177,7 @@ if (!empty($conf->expedition->enabled)) print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE); } } -else -{ +else { print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module80Name")); } print "\n\n"; @@ -222,8 +216,7 @@ if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUP print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL); } } -else -{ +else { print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name")); } print "\n\n"; @@ -243,8 +236,7 @@ if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUP print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER); } } -else -{ +else { print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name")); } print "\n\n"; @@ -280,8 +272,7 @@ if (!empty($conf->reception->enabled)) print "\n\n"; $found++; } -else -{ +else { print ''; print ''; print '\n\n"; diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 977b99d0c99..c52f4296429 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -71,8 +71,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -110,14 +109,12 @@ if ($action == 'specimen') // For invoices header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture_fournisseur&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -186,8 +183,7 @@ if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -273,8 +269,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -341,8 +336,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -410,8 +404,7 @@ foreach ($dirmodels as $reldir) }*/ print ""; } - else - { + else { print '"; @@ -425,8 +418,7 @@ foreach ($dirmodels as $reldir) // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -488,8 +480,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index db9b3e257f6..f282ee8d7ca 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -69,8 +69,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -108,14 +107,12 @@ elseif ($action == 'specimen') // For orders header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande_fournisseur&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -197,8 +194,7 @@ elseif ($action == 'set_SUPPLIER_ORDER_OTHER') // Insert $newmodule->insert_permissions(1); } - else - { + else { // Remove all rights with Permission1190 $newmodule->delete_permissions(); @@ -218,8 +214,7 @@ elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -305,8 +300,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -371,8 +365,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -430,14 +423,12 @@ foreach ($dirmodels as $reldir) print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; } - else - { + else { print img_picto($langs->trans("Enabled"), 'switch_on'); } print ""; } - else - { + else { print '"; @@ -449,8 +440,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -554,8 +544,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); @@ -573,8 +562,7 @@ if ($conf->reception->enabled) { print ''.$langs->trans("FeatureNotAvailableWithReceptionModule").''; } -else -{ +else { if ($conf->use_javascript_ajax) { print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS'); } else { diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index 5d7a0d0b8d5..1c4cfd5905e 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -58,8 +58,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } }elseif ($action == 'setmod') @@ -132,14 +131,12 @@ elseif ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=supplier_payment&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -207,8 +204,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -283,8 +279,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -399,8 +394,7 @@ foreach ($dirmodels as $reldir) }*/ print ""; } - else - { + else { print '"; @@ -414,8 +408,7 @@ foreach ($dirmodels as $reldir) // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index c1007623a54..bb3454de4f7 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -61,8 +61,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -99,14 +98,12 @@ if ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=supplier_proposal&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, null, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -123,8 +120,7 @@ if ($action == 'set_SUPPLIER_PROPOSAL_DRAFT_WATERMARK') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -141,8 +137,7 @@ if ($action == 'set_SUPPLIER_PROPOSAL_FREE_TEXT') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -157,8 +152,7 @@ if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -279,8 +273,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -344,8 +337,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -415,8 +407,7 @@ foreach ($dirmodels as $reldir) print ''; print ''; } - else - { + else { print ""; @@ -428,8 +419,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -463,8 +453,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'bill').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -512,8 +501,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); @@ -544,21 +532,18 @@ if ($conf->banque->enabled) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL'); } - else - { + else { if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL)) { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } - else - { + else { print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } } print ''; } -else -{ +else { print ''; } diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index 16b273cd6db..44143afb270 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -127,8 +127,7 @@ if ($action == 'set') $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($error, $errors, 'errors'); } @@ -156,8 +155,7 @@ if ($action == 'setlevel') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/system/about.php b/htdocs/admin/system/about.php index 3d0dddd6d10..db7559de17a 100644 --- a/htdocs/admin/system/about.php +++ b/htdocs/admin/system/about.php @@ -201,8 +201,7 @@ if ($showpromotemessage) print $langs->trans("ExampleOfNewsMessageForMajorRelease", DOL_VERSION, DOL_VERSION); print ''; } - else - { + else { print $langs->trans("TitleExampleForMaintenanceRelease").':
'; print ''; print '
'.$langs->trans("SmsInfoCharRemain").': '.(160 - dol_strlen($defaultmessage)).'
'; } diff --git a/htdocs/core/class/html.formsocialcontrib.class.php b/htdocs/core/class/html.formsocialcontrib.class.php index 5ecef635d73..ddc79a3c9cf 100644 --- a/htdocs/core/class/html.formsocialcontrib.class.php +++ b/htdocs/core/class/html.formsocialcontrib.class.php @@ -80,8 +80,7 @@ class FormSocialContrib $sql .= " AND c.fk_pays = ".$mysoc->country_id; $sql .= " ORDER BY c.libelle ASC"; } - else - { + else { $sql = "SELECT c.id, c.libelle as type"; $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c, ".MAIN_DB_PREFIX."c_country as co"; $sql .= " WHERE c.active = 1 AND c.fk_pays = co.rowid"; @@ -112,13 +111,11 @@ class FormSocialContrib if ($user->admin && $help) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); if (!empty($conf->use_javascript_ajax)) print ajax_combobox($htmlname); } - else - { + else { print $langs->trans("ErrorNoSocialContributionForSellerCountry", $mysoc->country_code); } } - else - { + else { dol_print_error($db, $db->lasterror()); } } diff --git a/htdocs/core/class/html.formwebsite.class.php b/htdocs/core/class/html.formwebsite.class.php index 7b067fa11d6..e666260325c 100644 --- a/htdocs/core/class/html.formwebsite.class.php +++ b/htdocs/core/class/html.formwebsite.class.php @@ -80,8 +80,7 @@ class FormWebsite { $out .= '
"; @@ -256,8 +252,7 @@ function displayBox($selectedDate, $month, $year) { $stoploop = 1; } - else - { + else { $mydate = dol_getdate($thedate); if ($firstdate["month"] != $mydate["month"]) $stoploop = 1; } @@ -278,8 +273,7 @@ function displayBox($selectedDate, $month, $year) print sprintf("%02s", $tempDate["mday"]); print ", ".$selectYear; } - else - { + else { print "Click a Date"; } ?> diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index 2818eff65e2..f37d3a4b69d 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -121,8 +121,7 @@ abstract class DoliDB implements Database } return $ret; } - else - { + else { $this->transaction_opened++; dol_syslog('', 0, 1); return 1; @@ -147,13 +146,11 @@ abstract class DoliDB implements Database dol_syslog("COMMIT Transaction".($log ? ' '.$log : ''), LOG_DEBUG); return 1; } - else - { + else { return 0; } } - else - { + else { $this->transaction_opened--; return 1; } @@ -175,8 +172,7 @@ abstract class DoliDB implements Database dol_syslog("ROLLBACK Transaction".($log ? ' '.$log : ''), LOG_DEBUG); return $ret; } - else - { + else { $this->transaction_opened--; return 1; } @@ -253,8 +249,7 @@ abstract class DoliDB implements Database } return $return; } - else - { + else { return ''; } } @@ -331,7 +326,7 @@ abstract class DoliDB implements Database if ($res) { $results = array(); - if($this->num_rows($res) > 0){ + if ($this->num_rows($res) > 0){ while ($obj = $this->fetch_object($res)){ $results[] = $obj; } diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php index 667f1986815..e5bd6c22e36 100644 --- a/htdocs/core/db/mssql.class.php +++ b/htdocs/core/db/mssql.class.php @@ -91,8 +91,7 @@ class DoliDBMssql extends DoliDB $this->connected = true; $this->ok = true; } - else - { + else { // host, login ou password incorrect $this->connected = false; $this->ok = false; @@ -109,8 +108,7 @@ class DoliDBMssql extends DoliDB $this->database_name = $name; $this->ok = true; } - else - { + else { $this->database_selected = false; $this->database_name = ''; $this->ok = false; @@ -118,8 +116,7 @@ class DoliDBMssql extends DoliDB dol_syslog(get_class($this)."::DoliDBMssql : Erreur Select_db ".$this->error, LOG_ERR); } } - else - { + else { // Pas de selection de base demandee, ok ou ko $this->database_selected = false; } @@ -250,8 +247,7 @@ class DoliDBMssql extends DoliDB } return $ret; } - else - { + else { return true; } } @@ -276,8 +272,7 @@ class DoliDBMssql extends DoliDB dol_syslog("COMMIT Transaction", LOG_DEBUG); return true; } - else - { + else { return false; } } @@ -368,8 +363,7 @@ class DoliDBMssql extends DoliDB $query .= " WHERE ".implode(" AND ", $query_comp); } } - else - { + else { if (preg_match('/ALTER TABLE\h+(\w+?)\h+ADD\h+PRIMARY\h+KEY\h+(\w+?)\h*\((.+)\)/is', $query, $matches)) { $original_query = $query; @@ -432,8 +426,7 @@ class DoliDBMssql extends DoliDB // Ordre SQL ne necessitant pas de connexion a une base (exemple: CREATE DATABASE) $ret = mssql_query($query, $this->db); } - else - { + else { $ret = mssql_query($query, $this->db); } @@ -598,8 +591,7 @@ class DoliDBMssql extends DoliDB // Si il y a eu echec de connexion, $this->db n'est pas valide. return 'DB_ERROR_FAILED_TO_CONNECT'; } - else - { + else { // Constants to convert a MSSql error code to a generic Dolibarr error code $errorcode_map = array( 1004 => 'DB_ERROR_CANNOT_CREATE', @@ -671,8 +663,7 @@ class DoliDBMssql extends DoliDB { return $data["id"]; } - else - { + else { return -1; } } @@ -849,8 +840,7 @@ class DoliDBMssql extends DoliDB { if (preg_match("/null/i", $field_desc['default'])) $sqlfields[$i] .= " default ".$field_desc['default']; - else - $sqlfields[$i] .= " default '".$field_desc['default']."'"; + else $sqlfields[$i] .= " default '".$field_desc['default']."'"; } elseif (preg_match("/^[^\s]/i", $field_desc['null'])) $sqlfields[$i] .= " ".$field_desc['null']; @@ -892,8 +882,7 @@ class DoliDBMssql extends DoliDB dol_syslog($sql); if (!$this -> query($sql)) return -1; - else - return 1; + else return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -910,8 +899,7 @@ class DoliDBMssql extends DoliDB if (!$this->query($sql)) return -1; - else - return 1; + else return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -958,16 +946,14 @@ class DoliDBMssql extends DoliDB if (preg_match("/^[^\s]/i", $field_desc['default'])) if (preg_match("/null/i", $field_desc['default'])) $sql .= " default ".$field_desc['default']; - else - $sql .= " default '".$field_desc['default']."'"; + else $sql .= " default '".$field_desc['default']."'"; if (preg_match("/^[^\s]/i", $field_desc['extra'])) $sql .= " ".$field_desc['extra']; $sql .= " ".$field_position; if (!$this -> query($sql)) return -1; - else - return 1; + else return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -991,8 +977,7 @@ class DoliDBMssql extends DoliDB dol_syslog($sql, LOG_DEBUG); if (!$this->query($sql)) return -1; - else - return 1; + else return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -1038,8 +1023,7 @@ class DoliDBMssql extends DoliDB { return -1; } - else - { + else { // If user already exists, we continue to set permissions dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_WARNING); } @@ -1051,8 +1035,7 @@ class DoliDBMssql extends DoliDB dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_WARNING); return -1; } - else - { + else { if ($num) { $this->select_db($dolibarr_main_db_name); @@ -1207,8 +1190,7 @@ class DoliDBMssql extends DoliDB { $where = " IN ('".implode("','", $fields)."')"; } - else - { + else { $where = "='".$this->escape($fields)."'"; } $result = array(); @@ -1220,8 +1202,7 @@ class DoliDBMssql extends DoliDB $result[] = $obj; } } - else - return false; + else return false; return $result; } diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 7c0d680662d..5f797b14c07 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -122,8 +122,7 @@ class DoliDBMysqli extends DoliDB if (!preg_match('/general/', $collation)) $this->db->query("SET collation_connection = ".$collation); } } - else - { + else { $this->database_selected = false; $this->database_name = ''; $this->ok = false; @@ -131,8 +130,7 @@ class DoliDBMysqli extends DoliDB dol_syslog(get_class($this)."::DoliDBMysqli : Select_db error ".$this->error, LOG_ERR); } } - else - { + else { // Pas de selection de base demandee, ok ou ko $this->database_selected = false; @@ -270,8 +268,7 @@ class DoliDBMysqli extends DoliDB // Ordre SQL ne necessitant pas de connexion a une base (exemple: CREATE DATABASE) $ret = $this->db->query($query); } - else - { + else { $ret = $this->db->query($query); } @@ -342,8 +339,7 @@ class DoliDBMysqli extends DoliDB if (!is_object($resultset)) { $resultset = $this->_results; } return $resultset->fetch_row(); } - else - { + else { // si le curseur est un booleen on retourne la valeur 0 return 0; } @@ -747,8 +743,7 @@ class DoliDBMysqli extends DoliDB if (!$this->query($sql)) return -1; - else - return 1; + else return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -765,8 +760,7 @@ class DoliDBMysqli extends DoliDB if (!$this->query($sql)) return -1; - else - return 1; + else return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -823,8 +817,7 @@ class DoliDBMysqli extends DoliDB { if (preg_match("/null/i", $field_desc['default'])) $sql .= " default ".$field_desc['default']; - else - $sql .= " default '".$field_desc['default']."'"; + else $sql .= " default '".$field_desc['default']."'"; } if (isset($field_desc['extra']) && preg_match("/^[^\s]/i", $field_desc['extra'])) { @@ -882,8 +875,7 @@ class DoliDBMysqli extends DoliDB dol_syslog(get_class($this)."::DDLUpdateField ".$sql, LOG_DEBUG); if (!$this->query($sql)) return -1; - else - return 1; + else return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -929,8 +921,7 @@ class DoliDBMysqli extends DoliDB { return -1; } - else - { + else { // If user already exists, we continue to set permissions dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_WARNING); } diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index bf9b468d4a8..f2378bcb998 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -105,8 +105,7 @@ class DoliDBPgsql extends DoliDB $this->connected = true; $this->ok = true; } - else - { + else { // host, login ou password incorrect $this->connected = false; $this->ok = false; @@ -123,8 +122,7 @@ class DoliDBPgsql extends DoliDB $this->database_name = $name; $this->ok = true; } - else - { + else { $this->database_selected = false; $this->database_name = ''; $this->ok = false; @@ -132,8 +130,7 @@ class DoliDBPgsql extends DoliDB dol_syslog(get_class($this)."::DoliDBPgsql : Erreur Select_db ".$this->error, LOG_ERR); } } - else - { + else { // Pas de selection de base demandee, ok ou ko $this->database_selected = false; } @@ -998,8 +995,7 @@ class DoliDBPgsql extends DoliDB { if (preg_match("/null/i", $field_desc['default'])) $sqlfields[$i] .= " default ".$field_desc['default']; - else - $sqlfields[$i] .= " default '".$field_desc['default']."'"; + else $sqlfields[$i] .= " default '".$field_desc['default']."'"; } elseif (preg_match("/^[^\s]/i", $field_desc['null'])) $sqlfields[$i] .= " ".$field_desc['null']; @@ -1041,8 +1037,7 @@ class DoliDBPgsql extends DoliDB dol_syslog($sql, LOG_DEBUG); if (!$this->query($sql)) return -1; - else - return 1; + else return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -1059,8 +1054,7 @@ class DoliDBPgsql extends DoliDB if (!$this->query($sql)) return -1; - else - return 1; + else return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -1313,8 +1307,7 @@ class DoliDBPgsql extends DoliDB { $fullpathofdump = '/usr/bin/pg_dump'; } - else - { + else { // TODO L'utilisateur de la base doit etre un superadmin pour lancer cette commande $resql = $this->query('SHOW data_directory'); if ($resql) @@ -1344,8 +1337,7 @@ class DoliDBPgsql extends DoliDB { $fullpathofdump = '/usr/bin/'.$tool; } - else - { + else { // TODO L'utilisateur de la base doit etre un superadmin pour lancer cette commande $resql = $this->query('SHOW data_directory'); if ($resql) diff --git a/htdocs/core/db/sqlite3.class.php b/htdocs/core/db/sqlite3.class.php index 2d24c232797..e5c9ef6b751 100644 --- a/htdocs/core/db/sqlite3.class.php +++ b/htdocs/core/db/sqlite3.class.php @@ -112,8 +112,7 @@ class DoliDBSqlite3 extends DoliDB $this->addCustomFunction('date_format'); //$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } - else - { + else { // host, login ou password incorrect $this->connected = false; $this->ok = false; @@ -554,8 +553,7 @@ class DoliDBSqlite3 extends DoliDB if (!is_object($resultset)) { $resultset = $this->_results; } return $resultset->fetchArray(SQLITE3_NUM); } - else - { + else { // si le curseur est un booleen on retourne la valeur 0 return false; } @@ -931,8 +929,7 @@ class DoliDBSqlite3 extends DoliDB { if (preg_match("/null/i", $field_desc['default'])) $sqlfields[$i] .= " default ".$field_desc['default']; - else - $sqlfields[$i] .= " default '".$field_desc['default']."'"; + else $sqlfields[$i] .= " default '".$field_desc['default']."'"; } elseif (preg_match("/^[^\s]/i", $field_desc['null'])) $sqlfields[$i] .= " ".$field_desc['null']; @@ -991,8 +988,7 @@ class DoliDBSqlite3 extends DoliDB if (!$this->query($sql)) return -1; - else - return 1; + else return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -1043,8 +1039,7 @@ class DoliDBSqlite3 extends DoliDB { if (preg_match("/null/i", $field_desc['default'])) $sql .= " default ".$field_desc['default']; - else - $sql .= " default '".$field_desc['default']."'"; + else $sql .= " default '".$field_desc['default']."'"; } if (preg_match("/^[^\s]/i", $field_desc['extra'])) $sql .= " ".$field_desc['extra']; diff --git a/htdocs/core/extrafieldsinexport.inc.php b/htdocs/core/extrafieldsinexport.inc.php index 4f85610e657..db926a2b6bc 100644 --- a/htdocs/core/extrafieldsinexport.inc.php +++ b/htdocs/core/extrafieldsinexport.inc.php @@ -63,8 +63,7 @@ if ($resql) // This can fail when class is used on old database (during migra $this->export_entities_array[$r][$fieldname] = $keyforelement; } // If this is a computed field - else - { + else { $this->export_fields_array[$r][$fieldname] = $fieldlabel; $this->export_TypeFields_array[$r][$fieldname] = $typeFilter.'Compute'; $this->export_special_array[$r][$fieldname] = $obj->fieldcomputed; diff --git a/htdocs/core/filemanagerdol/connectors/php/basexml.php b/htdocs/core/filemanagerdol/connectors/php/basexml.php index 0f50f33e988..22eae8093d4 100644 --- a/htdocs/core/filemanagerdol/connectors/php/basexml.php +++ b/htdocs/core/filemanagerdol/connectors/php/basexml.php @@ -98,8 +98,7 @@ function SendError($number, $text) SendErrorNode($number, $text); CreateXmlFooter(); } - else - { + else { SetXmlHeaders(); dol_syslog('Error: '.$number.' '.$text, LOG_ERR); @@ -127,6 +126,5 @@ function SendErrorNode($number, $text) { if ($text) echo ''; - else - echo ''; + else echo ''; } diff --git a/htdocs/core/filemanagerdol/connectors/php/commands.php b/htdocs/core/filemanagerdol/connectors/php/commands.php index dcc1650d4cd..01a4caf9420 100644 --- a/htdocs/core/filemanagerdol/connectors/php/commands.php +++ b/htdocs/core/filemanagerdol/connectors/php/commands.php @@ -86,8 +86,7 @@ function GetFoldersAndFiles($resourceType, $currentFolder) { if (is_dir($sServerDir.$sFile)) $aFolders[] = ''; - else - { + else { $iFileSize = @filesize($sServerDir.$sFile); if (!$iFileSize) { $iFileSize = 0; @@ -147,8 +146,7 @@ function CreateFolder($resourceType, $currentFolder) if (strpos($sNewFolderName, '..') !== false) $sErrorNumber = '102'; // Invalid folder name. - else - { + else { // Map the virtual path to the local server path of the current folder. $sServerDir = ServerMapFolder($resourceType, $currentFolder, 'CreateFolder'); @@ -172,12 +170,10 @@ function CreateFolder($resourceType, $currentFolder) break; } } - else - $sErrorNumber = '103'; + else $sErrorNumber = '103'; } } - else - $sErrorNumber = '102'; + else $sErrorNumber = '102'; // Create the "Error" node. echo ''; @@ -255,8 +251,7 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '') $sFileName = RemoveExtension($sOriginalFileName).'('.$iCounter.').'.$sExtension; $sErrorNumber = '201'; } - else - { + else { move_uploaded_file($oFile['tmp_name'], $sFilePath); if (is_file($sFilePath)) @@ -297,11 +292,9 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '') } } } - else - $sErrorNumber = '202'; + else $sErrorNumber = '202'; } - else - $sErrorNumber = '202'; + else $sErrorNumber = '202'; $sFileUrl = CombinePaths(GetResourceTypePath($resourceType, $sCommand), $currentFolder); @@ -315,8 +308,7 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '') // this line already exists so wrap the if block around it SendUploadResults($sErrorNumber, $sFileUrl, $sFileName); } - else - { + else { //issue the CKEditor Callback SendCKEditorResults( $CKEcallback, diff --git a/htdocs/core/filemanagerdol/connectors/php/io.php b/htdocs/core/filemanagerdol/connectors/php/io.php index 2a9ac9f146b..2da8b4d5baa 100644 --- a/htdocs/core/filemanagerdol/connectors/php/io.php +++ b/htdocs/core/filemanagerdol/connectors/php/io.php @@ -46,8 +46,7 @@ function GetResourceTypePath($resourceType, $sCommand) if ($sCommand == "QuickUpload") return $Config['QuickUploadPath'][$resourceType]; - else - return $Config['FileTypesPath'][$resourceType]; + else return $Config['FileTypesPath'][$resourceType]; } /** @@ -68,8 +67,7 @@ function GetResourceTypeDirectory($resourceType, $sCommand) // Map the "UserFiles" path to a local directory. return Server_MapPath($Config['QuickUploadPath'][$resourceType]); } - else - { + else { if (strlen($Config['FileTypesAbsolutePath'][$resourceType]) > 0) return $Config['FileTypesAbsolutePath'][$resourceType]; @@ -179,8 +177,7 @@ function CreateServerFolder($folderPath, $lastFolder = null) { mkdir($folderPath); } - else - { + else { $permissions = '0777'; if (isset($Config['ChmodOnFolderCreate']) && $Config['ChmodOnFolderCreate']) { @@ -203,8 +200,7 @@ function CreateServerFolder($folderPath, $lastFolder = null) return $sErrorMsg; } - else - return ''; + else return ''; } /** diff --git a/htdocs/core/filemanagerdol/connectors/php/util.php b/htdocs/core/filemanagerdol/connectors/php/util.php index 1349ed00dad..5af89333a48 100644 --- a/htdocs/core/filemanagerdol/connectors/php/util.php +++ b/htdocs/core/filemanagerdol/connectors/php/util.php @@ -82,8 +82,7 @@ function ConvertToXmlAttribute($value) { $os = PHP_OS; } - else - { + else { $os = php_uname(); } @@ -91,8 +90,7 @@ function ConvertToXmlAttribute($value) { return (utf8_encode(htmlspecialchars($value))); } - else - { + else { return (htmlspecialchars($value)); } } diff --git a/htdocs/core/get_info.php b/htdocs/core/get_info.php index 1564fc3f9bc..969de383da0 100644 --- a/htdocs/core/get_info.php +++ b/htdocs/core/get_info.php @@ -90,8 +90,7 @@ if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $logouttext .= ''; $logouttext .= ''; } - else - { + else { $logouthtmltext .= $langs->trans("NoLogoutProcessWithAuthMode", $_SESSION["dol_authmode"]); $logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1); } @@ -118,7 +117,7 @@ $result = $hookmanager->executeHooks('printTopRightMenu', $parameters); // Note if (is_numeric($result)) { if (empty($result)) $toprightmenu .= $hookmanager->resPrint; // add - else $toprightmenu = $hookmanager->resPrint; // replace + else $toprightmenu = $hookmanager->resPrint; // replace } else $toprightmenu .= $result; // For backward compatibility diff --git a/htdocs/core/get_menudiv.php b/htdocs/core/get_menudiv.php index 92b8dc34a0e..6a034377ce7 100644 --- a/htdocs/core/get_menudiv.php +++ b/htdocs/core/get_menudiv.php @@ -178,7 +178,7 @@ if (empty($user->socid)) // If internal user or not defined { $conf->standard_menu = (empty($conf->global->MAIN_MENU_STANDARD_FORCED) ? (empty($conf->global->MAIN_MENU_STANDARD) ? 'eldy_menu.php' : $conf->global->MAIN_MENU_STANDARD) : $conf->global->MAIN_MENU_STANDARD_FORCED); } -else // If external user +else // If external user { $conf->standard_menu = (empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED) ? (empty($conf->global->MAIN_MENUFRONT_STANDARD) ? 'eldy_menu.php' : $conf->global->MAIN_MENUFRONT_STANDARD) : $conf->global->MAIN_MENUFRONT_STANDARD_FORCED); } diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index b78c0478370..d86f823f4c9 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -186,7 +186,7 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle $qualified = 0; } } - else // This is a test on a constant. For example when we have -- VMYSQLUTF8UNICODE, we test constant $conf->global->UTF8UNICODE + else // This is a test on a constant. For example when we have -- VMYSQLUTF8UNICODE, we test constant $conf->global->UTF8UNICODE { $dbcollation = strtoupper(preg_replace('/_/', '', $conf->db->dolibarr_main_db_collation)); //var_dump($reg[2]); @@ -226,8 +226,7 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle if ($buffer) $arraysql[$i] = $buffer; fclose($fp); } - else - { + else { dol_syslog("Admin.lib::run_sql failed to open file ".$sqlfile, LOG_ERR); } @@ -252,8 +251,7 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle $listofmaxrowid[$table] = $obj->max; if (empty($listofmaxrowid[$table])) $listofmaxrowid[$table] = 0; } - else - { + else { if (!$silent) print '"; if (!$silent) print ''; @@ -370,8 +368,7 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle } // print ''; } - else - { + else { $errno = $db->errno(); if (!$silent) print ''."\n"; @@ -414,8 +411,7 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle if (!$silent) print ''."\n"; $ok = 1; } - else - { + else { if (!$silent) print ''; if (!$silent) print ''."\n"; $ok = 0; @@ -458,8 +454,7 @@ function dolibarr_del_const($db, $name, $entity = 1) $conf->global->$name = ''; return 1; } - else - { + else { dol_print_error($db); return -1; } @@ -555,8 +550,7 @@ function dolibarr_set_const($db, $name, $value, $type = 'chaine', $visible = 0, $conf->global->$name = $value; return 1; } - else - { + else { $error = $db->lasterror(); $db->rollback(); return -1; @@ -971,8 +965,7 @@ function activateModule($value, $withdeps = 1) { $ret['errors'][] = $objMod->error; } - else - { + else { if ($withdeps) { if (isset($objMod->depends) && is_array($objMod->depends) && !empty($objMod->depends)) @@ -1009,8 +1002,7 @@ function activateModule($value, $withdeps = 1) $ret['nbmodules'] += $resarray['nbmodules']; $ret['nbperms'] += $resarray['nbperms']; } - else - { + else { $ret['errors'][] = $langs->trans('activateModuleDependNotSatisfied', $objMod->name, $modulestring); } } @@ -1082,7 +1074,7 @@ function unActivateModule($value, $requiredby = 1) $result = $objMod->remove(); if ($result <= 0) $ret = $objMod->error; } - else // We come here when we try to unactivate a module when module does not exists anymore in sources + else // We come here when we try to unactivate a module when module does not exists anymore in sources { //print $dir.$modFile;exit; // TODO Replace this after DolibarrModules is moved as abstract class with a try catch to show module we try to disable has not been found or could not be loaded @@ -1163,8 +1155,7 @@ function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tab { $j = $objMod->numero; } - else - { + else { $j = 1000 + $i; } @@ -1210,8 +1201,7 @@ function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tab print 'Error in descriptor of module '.$const_name.'. Array ->dictionaries has not same number of record for key "tabname", "tablib", "tabsql" and "tabsqlsort"'; //print "$const_name: $nbtabname=$nbtablib=$nbtabsql=$nbtabsqlsort=$nbtabfield=$nbtabfieldvalue=$nbtabfieldinsert=$nbtabrowid=$nbtabcond=$nbtabfieldcheck=$nbtabhelp\n"; } - else - { + else { $taborder[] = 0; // Add an empty line } } @@ -1225,8 +1215,7 @@ function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tab } closedir($handle); } - else - { + else { dol_syslog("htdocs/admin/modules.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING); } } @@ -1291,8 +1280,7 @@ function activateModulesRequiredByCountry($country_code) } closedir($handle); } - else - { + else { dol_syslog("htdocs/admin/modules.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING); } } @@ -1348,8 +1336,7 @@ function complete_elementList_with_modules(&$elementList) { $j = $objMod->numero; } - else - { + else { $j = 1000 + $i; } @@ -1393,8 +1380,7 @@ function complete_elementList_with_modules(&$elementList) } closedir($handle); } - else - { + else { dol_syslog("htdocs/admin/modules.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING); } } @@ -1448,16 +1434,14 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '') if (is_numeric($key)) { // Very old behaviour $type = 'string'; } - else - { + else { if (is_array($const)) { $type = $const['type']; $label = $const['label']; $const = $key; } - else - { + else { $type = $const; $const = $key; } @@ -1549,8 +1533,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '') print ''; print ''; } - else - { + else { print ''; } - else - { + else { print "'; } - else - { + else { //print ''; print ''; print ''; @@ -455,8 +452,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') } $db->free($resql); } - else - { + else { dol_print_error($db); } diff --git a/htdocs/core/lib/signature.lib.php b/htdocs/core/lib/signature.lib.php index 837f505c132..8dd24c87df6 100644 --- a/htdocs/core/lib/signature.lib.php +++ b/htdocs/core/lib/signature.lib.php @@ -63,8 +63,7 @@ function getOnlineSignatureUrl($mode, $type, $ref = '') if ($mode == 0) $out .= urlencode($ref); $out .= ($mode ? '' : ''); if ($mode == 1) $out .= '&hashp=hash_of_file'; - else - { + else { include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; $propaltmp = new Propal($db); $res = $propaltmp->fetch(0, $ref); @@ -81,8 +80,7 @@ function getOnlineSignatureUrl($mode, $type, $ref = '') $out = $langs->trans("FeatureOnlineSignDisabled"); return $out; } - else - { + else { $out .= '&hashp='.$hashp; } } diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index cdf9fe29b1c..46682addf2c 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -175,8 +175,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di if (empty($conf->global->MAIN_INCLUDE_ZERO_VAT_IN_REPORTS)) $sql .= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)"; $sql .= " ORDER BY d.rowid, d.".$fk_facture; } - else - { + else { // Count on payments date $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.$f_rate as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql .= " d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; @@ -274,8 +273,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di $company_id = $assoc['company_id']; } } - else - { + else { dol_print_error($db); return -3; } @@ -323,8 +321,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di if (empty($conf->global->MAIN_INCLUDE_ZERO_VAT_IN_REPORTS)) $sql .= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)"; $sql .= " ORDER BY d.rowid, d.".$fk_facture; } - else - { + else { // Count on payments date $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.$f_rate as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql .= " d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; @@ -425,8 +422,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di $company_id = $assoc['company_id']; } } - else - { + else { dol_print_error($db); return -3; } @@ -529,8 +525,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di $company_id = $assoc['company_id']; } } - else - { + else { dol_print_error($db); return -3; } @@ -580,8 +575,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire $paymentfacturetable = 'paiement_facture'; $invoicefieldref = 'ref'; } - else - { + else { $invoicetable = 'facture_fourn'; $invoicedettable = 'facture_fourn_det'; $fk_facture = 'fk_facture_fourn'; @@ -644,8 +638,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire if (empty($conf->global->MAIN_INCLUDE_ZERO_VAT_IN_REPORTS)) $sql .= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)"; $sql .= " ORDER BY d.rowid, d.".$fk_facture; } - else - { + else { // Count on payments date $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.$f_rate as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql .= " d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; @@ -743,8 +736,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire $rate = $assoc['rate']; } } - else - { + else { dol_print_error($db); return -3; } @@ -792,8 +784,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire if (empty($conf->global->MAIN_INCLUDE_ZERO_VAT_IN_REPORTS)) $sql .= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)"; $sql .= " ORDER BY d.rowid, d.".$fk_facture; } - else - { + else { // Count on payments date $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.$f_rate as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql .= " d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; @@ -894,8 +885,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire $rate = $assoc['rate']; } } - else - { + else { dol_print_error($db); return -3; } @@ -998,8 +988,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire $rate = $assoc['rate']; } } - else - { + else { dol_print_error($db); return -3; } diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index cf6607e6960..4ed30dbcb2f 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -163,16 +163,14 @@ function showDirectPublicLink($object) { $out .= ''.$langs->trans("PublicInterfaceNotEnabled").''; } - else - { + else { $out .= img_picto('', 'object_globe.png').' '.$langs->trans("TicketPublicAccess").':
'; if ($url) { $out .= ''; $out .= ajax_autoselect("directpubliclink", 0); } - else - { + else { $out .= ''.$langs->trans("TicketNotCreatedFromPublicInterface").''; } } @@ -315,8 +313,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no if (is_object($objcon) && $objcon->id > 0) { $sql = "SELECT DISTINCT a.id, a.label as label,"; } - else - { + else { $sql = "SELECT a.id, a.label as label,"; } $sql .= " a.datep as dp,"; @@ -402,14 +399,12 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no { if ($actioncode == 'AC_NON_AUTO') $sql .= " AND c.type != 'systemauto'"; elseif ($actioncode == 'AC_ALL_AUTO') $sql .= " AND c.type = 'systemauto'"; - else - { + else { if ($actioncode == 'AC_OTH') $sql .= " AND c.type != 'systemauto'"; elseif ($actioncode == 'AC_OTH_AUTO') $sql .= " AND c.type = 'systemauto'"; } } - else - { + else { if ($actioncode == 'AC_NON_AUTO') $sql .= " AND c.type != 'systemauto'"; elseif ($actioncode == 'AC_ALL_AUTO') $sql .= " AND c.type = 'systemauto'"; else $sql .= " AND c.code = '".$db->escape($actioncode)."'"; @@ -527,8 +522,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no $i++; } } - else - { + else { dol_print_error($db); } @@ -555,8 +549,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no { $out .= ''; } - else - { + else { $out .= ''; } if ($filterobj && get_class($filterobj) == 'Societe') $out .= ''; diff --git a/htdocs/core/lib/treeview.lib.php b/htdocs/core/lib/treeview.lib.php index 0dcb6e8242d..8f7f6152c97 100644 --- a/htdocs/core/lib/treeview.lib.php +++ b/htdocs/core/lib/treeview.lib.php @@ -80,8 +80,7 @@ function tree_showpad(&$fulltree, $key, $silent = 0) if ($fulltree[$key]['level'] == $pos) print img_picto_common('', 'treemenu/branch.gif'); else print img_picto_common('', 'treemenu/line.gif'); } - else - { + else { if ($fulltree[$key]['level'] == $pos) print img_picto_common('', 'treemenu/branchbottom.gif'); else print img_picto_common('', 'treemenu/linebottom.gif'); } @@ -175,8 +174,7 @@ function tree_recur($tab, $pere, $rang, $iddivjstree = 'iddivjstree', $donoreset print $tab[$x]['buttons']; print '
'.$langs->trans("ReStockOnDispatchOrder").''; @@ -294,8 +285,7 @@ else print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER); } } - else - { + else { print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name")); } print "
'."\n"; print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'."\n"; print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'."\n"; print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").' '.$langs->trans('NotAvailable').'
'; if (!$silent) print '
'.$langs->trans("Failed to get max rowid for ".$table)."
OK'.$langs->trans("OK").'
'.$langs->trans("ProcessMigrateScript").''.$langs->trans("KO").'
'; print ''; print ''; @@ -1595,7 +1578,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '') //var_dump($arrayofmessagename); print $form->selectarray('constvalue_'.$obj->name, $arrayofmessagename, $obj->value.':'.$tmp[1], 'None', 0, 0, '', 0, 0, 0, '', '', 1); } - else // type = 'string' ou 'chaine' + else // type = 'string' ou 'chaine' { print ''; } @@ -1685,8 +1668,7 @@ function addDocumentModel($name, $type, $label = '', $description = '') $db->commit(); return 1; } - else - { + else { dol_print_error($db); $db->rollback(); return -1; @@ -1718,8 +1700,7 @@ function delDocumentModel($name, $type) $db->commit(); return 1; } - else - { + else { dol_print_error($db); $db->rollback(); return -1; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 5d450aa4b04..6070264d487 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -305,8 +305,7 @@ function show_array_actions_to_do($max = 5) $db->free($resql); } - else - { + else { dol_print_error($db); } } @@ -394,8 +393,7 @@ function show_array_last_actions_done($max = 5) $db->free($resql); } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 1d3e80b90be..e917f99defb 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -495,8 +495,7 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof if (empty($conf->global->$code)) print ''.img_picto($langs->trans("Disabled"), 'off').''; else print ''.img_picto($langs->trans("Enabled"), 'on').''; } - else - { + else { $out = "\n".' '; } - else - { + else { $return = $out; } } @@ -6954,8 +6889,7 @@ function dol_htmloutput_mesg($mesgstring = '', $mesgarray = array(), $style = 'o $tmpmesgstring = preg_replace('/<\/div>/', '', $tmpmesgstring); $newmesgarray[] = $tmpmesgstring; } - else - { + else { dol_syslog("Error call of dol_htmloutput_mesg with an array with a value that is not a string", LOG_WARNING); } } @@ -7012,8 +6946,7 @@ function dol_sort_array(&$array, $index, $order = 'asc', $natsort = 0, $case_sen { $temp[$key] = $array[$key]->$index; } - else - { + else { $temp[$key] = $array[$key][$index]; } } @@ -7149,8 +7082,7 @@ function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = $db->free($resql); return $cache_codes[$tablename][$key][$fieldid]; } - else - { + else { return -1; } } @@ -7204,8 +7136,7 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1) if ($hideerrors) return @eval('return '.$s.';'); else return eval('return '.$s.';'); } - else - { + else { if ($hideerrors) @eval($s); else eval($s); } @@ -7249,8 +7180,7 @@ function picto_from_langcode($codelang, $moreatt = '') ); if (isset($langtocountryflag[$codelang])) $flagImage = $langtocountryflag[$codelang]; - else - { + else { $tmparray = explode('_', $codelang); $flagImage = empty($tmparray[1]) ? $tmparray[0] : $tmparray[1]; } @@ -7469,8 +7399,7 @@ function getLanguageCodeFromCountryCode($countrycode) } } } - else - { + else { dol_syslog("Warning Exention php-intl is not available", LOG_WARNING); } @@ -7913,8 +7842,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0) { $newres .= ($i2 > 0 ? ' OR ' : '').$field.' '.$operator.' '.$numnewcrit; } - else - { + else { $newres .= ($i2 > 0 ? ' OR ' : '').'1 = 2'; // force false } $i2++; // a criteria was added to string @@ -7965,7 +7893,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0) } } } - else // $mode=0 + else // $mode=0 { $tmpcrits = explode('|', $crit); $i3 = 0; @@ -7979,8 +7907,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0) { $newres .= $field." = ".(is_numeric(trim($tmpcrit)) ?trim($tmpcrit) : '0'); } - else - { + else { $newres .= $field." LIKE '"; $tmpcrit = trim($tmpcrit); @@ -8271,8 +8198,7 @@ function getDictvalue($tablename, $field, $id, $checkentity = false, $rowidfield $dictvalues[$tablename][$obj->{$rowidfield}] = $obj; } } - else - { + else { dol_print_error($db); } } @@ -8305,8 +8231,7 @@ function colorIsLight($stringcolor) $g = $tmp[1]; $b = $tmp[2]; } - else - { + else { $hexr = $stringcolor[0].$stringcolor[1]; $hexg = $stringcolor[2].$stringcolor[3]; $hexb = $stringcolor[4].$stringcolor[5]; diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 531e0fe242c..dcdd31a1cc2 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -233,8 +233,7 @@ function dol_print_object_info($object, $usetable = 0) if ($object->user_creation->id) print $object->user_creation->getNomUrl(1, '', 0, 0, 0); else print $langs->trans("Unknown"); } - else - { + else { $userstatic = new User($db); $userstatic->fetch($object->user_creation_id ? $object->user_creation_id : $object->user_creation); if ($userstatic->id) print $userstatic->getNomUrl(1, '', 0, 0, 0); @@ -269,8 +268,7 @@ function dol_print_object_info($object, $usetable = 0) if ($object->user_modification->id) print $object->user_modification->getNomUrl(1, '', 0, 0, 0); else print $langs->trans("Unknown"); } - else - { + else { $userstatic = new User($db); $userstatic->fetch($object->user_modification_id ? $object->user_modification_id : $object->user_modification); if ($userstatic->id) print $userstatic->getNomUrl(1, '', 0, 0, 0); @@ -305,8 +303,7 @@ function dol_print_object_info($object, $usetable = 0) if ($object->user_validation->id) print $object->user_validation->getNomUrl(1, '', 0, 0, 0); else print $langs->trans("Unknown"); } - else - { + else { $userstatic = new User($db); $userstatic->fetch($object->user_validation_id ? $object->user_validation_id : $object->user_validation); if ($userstatic->id) print $userstatic->getNomUrl(1, '', 0, 0, 0); @@ -341,8 +338,7 @@ function dol_print_object_info($object, $usetable = 0) if ($object->user_approve->id) print $object->user_approve->getNomUrl(1, '', 0, 0, 0); else print $langs->trans("Unknown"); } - else - { + else { $userstatic = new User($db); $userstatic->fetch($object->user_approve_id ? $object->user_approve_id : $object->user_approve); if ($userstatic->id) print $userstatic->getNomUrl(1, '', 0, 0, 0); @@ -405,8 +401,7 @@ function dol_print_object_info($object, $usetable = 0) if ($object->user_cloture->id) print $object->user_cloture->getNomUrl(1, '', 0, 0, 0); else print $langs->trans("Unknown"); } - else - { + else { $userstatic = new User($db); $userstatic->fetch($object->user_cloture); if ($userstatic->id) print $userstatic->getNomUrl(1, '', 0, 0, 0); @@ -441,8 +436,7 @@ function dol_print_object_info($object, $usetable = 0) if ($object->user_rappro->id) print $object->user_rappro->getNomUrl(1, '', 0, 0, 0); else print $langs->trans("Unknown"); } - else - { + else { $userstatic = new User($db); $userstatic->fetch($object->user_rappro); if ($userstatic->id) print $userstatic->getNomUrl(1, '', 0, 0, 0); @@ -760,8 +754,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ $maskcounter = $reg[1]; $hasglobalcounter = true; } - else - { + else { // setting some defaults so the rest of the code won't fail if there is a third party counter $masktri = '00000'; $maskcounter = '00000'; @@ -799,8 +792,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ $masktype_value = substr(preg_replace('/^TE_/', '', $objsoc->typent_code), 0, dol_strlen($regType[1])); // get n first characters of thirdpaty typent_code (where n is length in mask) $masktype_value = str_pad($masktype_value, dol_strlen($regType[1]), "#", STR_PAD_RIGHT); // we fill on right with # to have same number of char than into mask } - else - { + else { $masktype = ''; $masktype_value = ''; } @@ -815,8 +807,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ $maskuser_value = substr($lastname, 0, dol_strlen($regType[1])); // get n first characters of user firstname (where n is length in mask) $maskuser_value = str_pad($maskuser_value, dol_strlen($regType[1]), "#", STR_PAD_RIGHT); // we fill on right with # to have same number of char than into mask } - else - { + else { $maskuser = ''; $maskuser_value = ''; } @@ -961,7 +952,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ $sqlwhere .= "(SUBSTRING(".$field.", ".$yearpos.", ".$yearlen.") = '".$yearcomp."'"; $sqlwhere .= " AND SUBSTRING(".$field.", ".$monthpos.", ".$monthlen.") = '".str_pad($monthcomp, $monthlen, '0', STR_PAD_LEFT)."')"; } - else // reset is done on january + else // reset is done on january { $sqlwhere .= '(SUBSTRING('.$field.', '.$yearpos.', '.$yearlen.") = '".$yearcomp."')"; } @@ -974,8 +965,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ { $posnumstart = mb_strrpos($maskwithnocode, $maskcounter, 'UTF-8'); } - else - { + else { $posnumstart = strrpos($maskwithnocode, $maskcounter); } // Pos of counter in final string (from 0 to ...) if ($posnumstart < 0) return 'ErrorBadMaskFailedToLocatePosOfSequence'; @@ -1142,7 +1132,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ $numFinal = preg_replace('/\{yy\}/i', date("y", $date) + $yearoffset, $numFinal); $numFinal = preg_replace('/\{y\}/i', substr(date("y", $date), 1, 1) + $yearoffset, $numFinal); } - else // we want yyyy to be current year + else // we want yyyy to be current year { $numFinal = preg_replace('/\{yyyy\}/i', date("Y", $date), $numFinal); $numFinal = preg_replace('/\{yy\}/i', date("y", $date), $numFinal); @@ -1224,8 +1214,7 @@ function check_value($mask, $value) $maskcounter = $reg[1]; $hasglobalcounter = true; } - else - { + else { // setting some defaults so the rest of the code won't fail if there is a third party counter $masktri = '00000'; $maskcounter = '00000'; @@ -1422,8 +1411,7 @@ function numero_semaine($time) { $numeroSemaine = 53; } - else - { + else { $numeroSemaine = 1; } } @@ -1528,8 +1516,7 @@ function dol_set_user_param($db, $conf, &$user, $tab) $user->conf->$key = $value; //print "key=".$key." user->conf->key=".$user->conf->$key; } - else - { + else { unset($user->conf->$key); } } @@ -1552,8 +1539,7 @@ function dol_print_reduction($reduction, $langs) { $string = $langs->transnoentities("Offered"); } - else - { + else { $string = vatrate($reduction, true); } @@ -1674,13 +1660,11 @@ function getListOfModels($db, $type, $maxfilenamelength = 0) $liste[$obj->id.':'.$record['fullname']] = dol_trunc($record['name'], $max, 'middle'); } } - else - { + else { $liste[0] = $obj->label.': '.$langs->trans("None"); } } - else - { + else { if ($type == 'member' && $obj->doc_template_name == 'standard') // Special case, if member template, we add variant per format { global $_Avery_Labels; @@ -1690,7 +1674,7 @@ function getListOfModels($db, $type, $maxfilenamelength = 0) $liste[$obj->id.':'.$key] = ($obj->label ? $obj->label : $obj->doc_template_name).' '.$val['name']; } } - else // Common usage + else // Common usage { $liste[$obj->id] = $obj->label ? $obj->label : $obj->doc_template_name; } @@ -1698,8 +1682,7 @@ function getListOfModels($db, $type, $maxfilenamelength = 0) $i++; } } - else - { + else { dol_print_error($db); return -1; } @@ -1777,8 +1760,7 @@ function getSoapParams() 'trace' => 1 ); } - else - { + else { $params = array('connection_timeout'=>$timeout, 'response_timeout'=>$response_timeout, 'proxy_use' => 0, @@ -1968,8 +1950,7 @@ function cleanCorruptedTree($db, $tabletocleantree, $fieldfkparent) $i++; } } - else - { + else { dol_print_error($db); } @@ -2148,7 +2129,7 @@ function colorAgressiveness($hex, $ratio = -50, $brightness = 0) if ($color > 127) $color += ((255 - $color) * ($ratio / 100)); if ($color < 128) $color -= ($color * ($ratio / 100)); } - else // We decrease agressiveness + else // We decrease agressiveness { if ($color > 128) $color -= (($color - 128) * (abs($ratio) / 100)); if ($color < 127) $color += ((128 - $color) * (abs($ratio) / 100)); @@ -2157,8 +2138,7 @@ function colorAgressiveness($hex, $ratio = -50, $brightness = 0) { $color = ($color * (100 + abs($brightness)) / 100); } - else - { + else { $color = ($color * (100 - abs($brightness)) / 100); } diff --git a/htdocs/core/lib/functionsnumtoword.lib.php b/htdocs/core/lib/functionsnumtoword.lib.php index 26db2bbec90..f3dfa25c05c 100644 --- a/htdocs/core/lib/functionsnumtoword.lib.php +++ b/htdocs/core/lib/functionsnumtoword.lib.php @@ -213,8 +213,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number') $entexto .= hundreds2text($CdMILLON, $DdMILLON, $udMILLON); if (!$CdMMillon && !$DdMMillon && !$UdMMillon && !$CdMILLON && !$DdMILLON && $udMILLON == 1) $entexto .= " MILLÓN "; - else - $entexto .= " MILLONES "; + else $entexto .= " MILLONES "; } if ($number >= 1000) { $cdm = (int) ($numero / 100000); diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index ae0eb86882e..0175ed83e61 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -88,8 +88,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = $array_param = null; curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // HTTP request is 'PUT' if (!is_array($param)) parse_str($param, $array_param); - else - { + else { dol_syslog("parameter param must be a string", LOG_WARNING); $array_param = $param; } @@ -109,8 +108,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = { curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); // POST } - else - { + else { curl_setopt($ch, CURLOPT_POST, 0); // GET } @@ -144,8 +142,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = dol_syslog("getURLContent response array is ".join(',', $rep)); } - else - { + else { $info = curl_getinfo($ch); // Ad keys to $rep @@ -183,8 +180,7 @@ function getDomainFromURL($url, $mode = 0) { $tmpdomain = preg_replace('/^.*\.([^\.]+)\.([^\.]+)\.([^\.]+)$/', '\1.\2.\3', $tmpdomain); // Remove part 'www.' before 'abc.mydomain.com' } - else - { + else { $tmpdomain = preg_replace('/^.*\.([^\.]+)\.([^\.]+)$/', '\1.\2', $tmpdomain); // Remove part 'www.abc.' before 'mydomain.com' } if (empty($mode)) diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index 4f65ca3a2bf..c13c9c0f56c 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -221,8 +221,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, // Compatibilite image GIF $imgThumb = imagecreate($newWidth, $newHeight); } - else - { + else { $imgThumb = imagecreatetruecolor($newWidth, $newHeight); } @@ -359,8 +358,7 @@ function correctExifImageOrientation($fileSource, $fileDest, $quality = 95) if ($fileDest === false) { return $img; } - else - { + else { // In fact there exif is only for JPG but just in case // Create image on disk $image = false; @@ -597,8 +595,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', $thumbWidth = $maxWidth; $thumbHeight = $thumbWidth / $imgWhFact; } - else - { + else { // Si hauteur determinante $thumbHeight = $maxHeight; $thumbWidth = $thumbHeight * $imgWhFact; @@ -615,8 +612,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', // Compatibilite image GIF $imgThumb = imagecreate($thumbWidth, $thumbHeight); } - else - { + else { $imgThumb = imagecreatetruecolor($thumbWidth, $thumbHeight); } diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php index d5ca3431845..64ecdcf9e69 100644 --- a/htdocs/core/lib/invoice2.lib.php +++ b/htdocs/core/lib/invoice2.lib.php @@ -262,15 +262,13 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte $result = 1; } - else - { + else { if ($usestdout) print "No invoices found for criteria.\n"; else dol_syslog("No invoices found for criteria"); $result = 0; } } - else - { + else { dol_print_error($db); dol_syslog("scripts/invoices/rebuild_merge.php: Error"); $error++; diff --git a/htdocs/core/lib/json.lib.php b/htdocs/core/lib/json.lib.php index 44ad9cc6ff1..9bf2db7278c 100644 --- a/htdocs/core/lib/json.lib.php +++ b/htdocs/core/lib/json.lib.php @@ -54,8 +54,7 @@ function dol_json_encode($elements) { foreach ($elements as $key => $value) $num++; } - else - { + else { $num = count($elements); } //var_dump($num); @@ -75,8 +74,7 @@ function dol_json_encode($elements) } $output .= ']'; } - else - { + else { // associative (object) $output = '{'; $last = $num - 1; @@ -201,7 +199,7 @@ function _val($val) elseif (is_int($val)) return sprintf('%d', $val); elseif (is_float($val)) return sprintf('%F', $val); elseif (is_bool($val)) return ($val ? 'true' : 'false'); - else return 'null'; + else return 'null'; } if (!function_exists('json_decode')) diff --git a/htdocs/core/lib/ldap.lib.php b/htdocs/core/lib/ldap.lib.php index 038791ce1cc..b5ea5faf3c5 100644 --- a/htdocs/core/lib/ldap.lib.php +++ b/htdocs/core/lib/ldap.lib.php @@ -122,8 +122,7 @@ function show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass) $langs->load("errors"); print ''.$butlabel.''; } - else - { + else { print ''.$butlabel.''; } print '

'; diff --git a/htdocs/core/lib/memory.lib.php b/htdocs/core/lib/memory.lib.php index a301ac40a2b..6ed00c10b34 100644 --- a/htdocs/core/lib/memory.lib.php +++ b/htdocs/core/lib/memory.lib.php @@ -64,8 +64,7 @@ function dol_setcache($memoryid, $data) { return count($data); } - else - { + else { return -$rescode; } } @@ -87,8 +86,7 @@ function dol_setcache($memoryid, $data) { return count($data); } - else - { + else { return -1; } } @@ -134,8 +132,7 @@ function dol_getcache($memoryid) { return $data; } - else - { + else { return -$rescode; } } @@ -159,8 +156,7 @@ function dol_getcache($memoryid) { return $data; } - else - { + else { return -1; } } @@ -236,8 +232,7 @@ function dol_setshmop($memoryid, $data) shmop_close($handle); return ($shm_bytes_written1 + $shm_bytes_written2); } - else - { + else { print 'Error in shmop_open for memoryid='.$memoryid.' shmkey='.$shmkey.' 6+size=6+'.$size; return -1; } @@ -264,8 +259,7 @@ function dol_getshmop($memoryid) else return -1; shmop_close($handle); } - else - { + else { return -2; } return $data; diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index b9a958160d4..373e80e2a67 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -83,8 +83,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir = //$pathoffiletoedittmp=$destdir.'/class/'.strtolower($objectname).'.class.php.tmp'; //dol_delete_file($pathoffiletoedittmp, 0, 1, 1); - try - { + try { include_once $pathoffiletoeditsrc; if (class_exists($objectname)) $object = new $objectname($db); else return -4; @@ -234,8 +233,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = ' } // Load object from myobject.class.php - try - { + try { if (!is_object($object)) { include_once $pathoffiletoclasssrc; @@ -270,8 +268,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = ' $texttoinsert .= "\t".$key." ".$type; if ($key == 'rowid') $texttoinsert .= ' AUTO_INCREMENT PRIMARY KEY'; if ($key == 'entity') $texttoinsert .= ' DEFAULT 1'; - else - { + else { if ($val['default'] != '') { if (preg_match('/^null$/i', $val['default'])) $texttoinsert .= " DEFAULT NULL"; @@ -293,8 +290,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = ' { @chmod($pathoffiletoedittarget, octdec($newmask)); } - else - { + else { $error++; } @@ -338,8 +334,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = ' { @chmod($pathoffiletoedittarget, octdec($newmask)); } - else - { + else { $error++; } diff --git a/htdocs/core/lib/parsemd.lib.php b/htdocs/core/lib/parsemd.lib.php index 7dfd025609c..6a83fad87be 100644 --- a/htdocs/core/lib/parsemd.lib.php +++ b/htdocs/core/lib/parsemd.lib.php @@ -46,8 +46,7 @@ function dolMd2Html($content, $parser = 'parsedown', $replaceimagepath = null) $Parsedown = new Parsedown(); $content = $Parsedown->text($content); } - else - { + else { $content = nl2br($content); } diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index d031984552e..eedc8034d01 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -190,8 +190,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; - else - { + else { $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + order_ref)"; if ($mode == 0) $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2); @@ -208,8 +207,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; - else - { + else { $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + invoice_ref)"; if ($mode == 0) $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2); @@ -226,8 +224,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; - else - { + else { $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + contractline_ref)"; if ($mode == 0) $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2); @@ -244,8 +241,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; - else - { + else { $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + member_ref)"; if ($mode == 0) $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2); @@ -262,8 +258,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; - else - { + else { $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + donation_ref)"; if ($mode == 0) $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2); diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 63789a18e62..bfa49911b02 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -55,8 +55,7 @@ function pdf_getFormat(Translate $outputlangs = null, $mode = 'setup') include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $pdfformat = dol_getDefaultFormat($outputlangs); } - else - { + else { $pdfformat = $conf->global->MAIN_PDF_FORMAT; } @@ -306,8 +305,7 @@ function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent) if ($end_page == $start_page) { $height = $end_y - $start_y; } - else - { + else { for ($page = $start_page; $page <= $end_page; ++$page) { $pdf->setPage($page); $tmpm = $pdf->getMargins(); @@ -514,8 +512,7 @@ function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $t } } } - else - { + else { $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($targetcompany)); // Country if (!empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code)); @@ -804,8 +801,7 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, $cury += 8; } } - else - { + else { $pdf->SetFont('', 'B', $default_font_size - $diffsizecontent); $pdf->SetXY($curx, $cury); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Bank").': '.$outputlangs->convToOutputCharset($account->bank), 0, 'L', 0); @@ -1059,8 +1055,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ } $freetextheight = $pdf->getStringHeight($width, $line); } - else - { + else { $freetextheight = pdfGetHeightForHtmlContent($pdf, dol_htmlentitiesbr($line, 1, 'UTF-8', 0)); // New method (works for HTML content) //print '
'.$freetextheight;exit; } @@ -1076,8 +1071,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ { $pdf->MultiCell(0, 3, $line, 0, $align, 0); } - else - { + else { $pdf->writeHTMLCell($pdf->page_largeur - $pdf->margin_left - $pdf->margin_right, $freetextheight, $dims['lm'], $dims['hk'] - $marginwithfooter, dol_htmlentitiesbr($line, 1, 'UTF-8', 0)); } $posy -= $freetextheight; @@ -1245,8 +1239,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; $prodser = new ProductFournisseur($db); } - else - { + else { include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; $prodser = new Product($db); } @@ -1328,8 +1321,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, $discount->fetch($object->lines[$i]->fk_remise_except); $libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromExcessPaid", $discount->ref_invoice_supplier_source); } - else - { + else { if ($idprod) { if (empty($hidedesc)) @@ -1338,14 +1330,12 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, { $libelleproduitservice = $desc."\n".$libelleproduitservice; } - else - { + else { $libelleproduitservice .= $desc; } } } - else - { + else { $libelleproduitservice .= $desc; } } @@ -1360,8 +1350,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, { $prefix_prodserv = $outputlangs->transnoentitiesnoconv("Service")." "; } - else - { + else { $prefix_prodserv = $outputlangs->transnoentitiesnoconv("Product")." "; } } @@ -1374,14 +1363,13 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, $ref_prodserv = $ref_supplier; elseif ($conf->global->PDF_HIDE_PRODUCT_REF_IN_SUPPLIER_LINES == 2) $ref_prodserv = $ref_supplier.' ('.$outputlangs->transnoentitiesnoconv("InternalRef").' '.$prodser->ref.')'; - else // Common case + else // Common case { $ref_prodserv = $prodser->ref; // Show local ref if ($ref_supplier) $ref_prodserv .= ($prodser->ref ? ' (' : '').$outputlangs->transnoentitiesnoconv("SupplierRef").' '.$ref_supplier.($prodser->ref ? ')' : ''); } } - else - { + else { $ref_prodserv = $prodser->ref; // Show local ref only } @@ -1944,8 +1932,7 @@ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookm } $result = ($object->lines[$i]->situation_percent - $prev_progress).'%'; } - else - $result = $object->lines[$i]->situation_percent.'%'; + else $result = $object->lines[$i]->situation_percent.'%'; } } return $result; @@ -2001,8 +1988,7 @@ function pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails = 0) } $result .= price($sign * ($total_ht / ($object->lines[$i]->situation_percent / 100)) * $progress, 0, $outputlangs); } - else - { + else { $result .= price($sign * $total_ht, 0, $outputlangs); } } @@ -2187,8 +2173,7 @@ function pdf_getLinkedObjects($object, $outputlangs) //if (! empty($linkedobjects[$objecttype]['date_value'])) $linkedobjects[$objecttype]['date_value'].=' / '; //$linkedobjects[$objecttype]['date_value'].= dol_print_date($elementobject->date_delivery,'day','',$outputlangs); } - else - { + else { $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending"); if (empty($linkedobjects[$objecttype]['ref_value'])) $linkedobjects[$objecttype]['ref_value'] = $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : ''); $linkedobjects[$objecttype]['ref_value'] .= ' / '.$outputlangs->transnoentities($elementobject->ref); @@ -2235,7 +2220,7 @@ function pdf_getSizeForImage($realpath) $width = $maxwidth; $height = (int) round($maxwidth * $tmp['height'] / $tmp['width']); } - else // No pb with maxheight + else // No pb with maxheight { $height = $maxheight; } @@ -2261,8 +2246,7 @@ function pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails = { return $outputlangs->transnoentities("Option"); } - else - { + else { if (is_object($hookmanager)) { $special_code = $object->lines[$i]->special_code; diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index c06c4431562..8f77d24bdab 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -132,7 +132,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt $localtax2_type = $localtaxes_array[2]; $localtax2_rate = $localtaxes_array[3]; } - else // deprecated method. values and type for localtaxes must be provided by caller and loaded with getLocalTaxesFromRate using the full vat rate (including text code) + else // deprecated method. values and type for localtaxes must be provided by caller and loaded with getLocalTaxesFromRate using the full vat rate (including text code) { dol_syslog("Price.lib::calcul_price_total search vat information using old deprecated method", LOG_WARNING); @@ -159,8 +159,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt // pu calculation from pu_devise if pu empty if (empty($pu) && !empty($pu_devise)) { if (!empty($multicurrency_tx)) $pu = $pu_devise / $multicurrency_tx; - else - { + else { dol_syslog('Price.lib::calcul_price_total function called with bad parameters combination (multicurrency_tx empty when pu_devise not) ', LOG_ERR); return array(); } @@ -169,8 +168,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt // pu_devise calculation from pu if (empty($pu_devise) && !empty($multicurrency_tx)) { if (is_numeric($pu) && is_numeric($multicurrency_tx)) $pu_devise = $pu * $multicurrency_tx; - else - { + else { dol_syslog('Price.lib::calcul_price_total function called with bad parameters combination (pu or multicurrency_tx are not numeric)', LOG_ERR); return array(); } @@ -193,8 +191,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt $tot_avec_remise_wt = price2num($tot_avec_remise * (1 + ($txtva / 100)), 'MU'); $pu_wt = price2num($pu * (1 + ($txtva / 100)), 'MU'); } - else - { + else { $tot_sans_remise_wt = $tot_sans_remise; $tot_avec_remise_wt = $tot_avec_remise; $pu_wt = $pu; @@ -269,8 +266,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt $result5bis = price2num($pu * (1 + ($txtva / 100)) + $localtaxes[2], 'MU'); // Si TVA consideree normale (non NPR) $result[4] = price2num($result5bis - ($result[3] + $localtaxes[2]), 'MU'); } - else - { + else { // We work to define prices using the price with tax $result[8] = price2num($tot_sans_remise + $localtaxes[0], 'MT'); $result[6] = price2num($tot_sans_remise / (1 + ((($info_bits & 1) ? 0 : $txtva) / 100)), 'MT'); // Selon TVA NPR ou non @@ -355,8 +351,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt $result[9] = round($result[9] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; $result[10] = round($result[10] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; } - else - { + else { $result[1] = round($result[1] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; $result[2] = round($result[2] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; $result[0] = price2num($result[2] - $result[1], 'MT'); @@ -406,8 +401,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt $result[25] = $newresult[9]; $result[26] = $newresult[10]; } - else - { + else { $result[16] = $result[0]; $result[17] = $result[1]; $result[18] = $result[2]; diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 43acb16ba2a..e1ed6efc805 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -553,8 +553,7 @@ function measuringUnitString($unit, $measuring_style = '', $scale = '', $use_sho 't.active' => 1 ); } - else - { + else { $arrayforfilter = array( 't.rowid' => $unit, 't.unit_type' => $measuring_style, diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index bef3d9fd0dc..c84762f8575 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -419,14 +419,12 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t { $showlineingray = 1; // We will show line but in gray } - else - { + else { $showline = 0; // No reason to show line } } } - else - { + else { // Caller did not ask to filter on tasks of a specific user (this probably means he want also tasks of all users, into public project // or into all other projects if user has permission to). if (empty($user->rights->projet->all->lire)) @@ -682,8 +680,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t if ($lines[$i]->planned_workload) $total_projectlinesa_declared_if_planned += $lines[$i]->planned_workload * $lines[$i]->progress / 100; } } - else - { + else { //$level--; } } @@ -1380,8 +1377,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr } $level--; } - else - { + else { //$level--; } } @@ -1745,8 +1741,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ } $level--; } - else - { + else { //$level--; } } @@ -2006,8 +2001,7 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, & } $level--; } - else - { + else { //$level--; } } @@ -2110,8 +2104,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks $sql .= ", ".MAIN_DB_PREFIX."element_contact as ec"; $sql .= ", ".MAIN_DB_PREFIX."c_type_contact as ctc"; } - else - { + else { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t ON p.rowid = t.fk_projet"; } $sql .= " WHERE p.entity IN (".getEntity('project').")"; @@ -2339,8 +2332,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks $db->free($resql); } - else - { + else { dol_print_error($db); } @@ -2475,8 +2467,7 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide } $out .= ' '; } - else - { + else { // bad $out .= '
'; $out .= '
'; diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 03f1525eb91..76ce3cb5b01 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -504,8 +504,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand $sql .= " WHERE dbt.".$dbt_select." IN (".$objectid.")"; $sql .= " AND dbt.entity IS NOT NULL"; } - else - { + else { $sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug"; $sql .= " WHERE dbt.".$dbt_select." IN (".$objectid.")"; $sql .= " AND ((ug.fk_user = dbt.rowid"; @@ -518,8 +517,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand $sql .= " AND dbt.entity IN (".getEntity($sharedelement, 1).")"; } } - else - { + else { $sql .= " WHERE dbt.".$dbt_select." IN (".$objectid.")"; $sql .= " AND dbt.entity IN (".getEntity($sharedelement, 1).")"; } @@ -590,8 +588,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand $tmparray = explode(',', $tmps); if (!in_array($objectid, $tmparray)) return false; } - else - { + else { $sql = "SELECT COUNT(dbt.".$dbt_select.") as nb"; $sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; $sql .= " WHERE dbt.".$dbt_select." IN (".$objectid.")"; @@ -611,8 +608,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand $tmparray = explode(',', $tmps); if (!in_array($task->fk_project, $tmparray)) return false; } - else - { + else { $sql = "SELECT COUNT(dbt.".$dbt_select.") as nb"; $sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; $sql .= " WHERE dbt.".$dbt_select." IN (".$objectid.")"; @@ -662,8 +658,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand $obj = $db->fetch_object($resql); if (!$obj || $obj->nb < count(explode(',', $objectid))) return false; } - else - { + else { return false; } } @@ -723,8 +718,7 @@ function accessforbidden($message = '', $printheader = 1, $printfooter = 1, $sho print $langs->trans("CurrentLogin").': '.$user->login.'
'; print $langs->trans("ErrorForbidden2", $langs->transnoentitiesnoconv("Home"), $langs->transnoentitiesnoconv("Users")); } - else - { + else { print $langs->trans("ErrorForbidden3"); } } diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index 04d16084365..fba8ba346c6 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -102,8 +102,7 @@ function checkLoginPassEntity($usertotest, $passwordtotest, $entitytotest, $auth $dol_screenheight = GETPOST('screenheight'); } } - else - { + else { dol_syslog("Authentication KO - failed to load file '".$authfile."'", LOG_ERR); sleep(1); // Load translation files required by the page @@ -180,8 +179,7 @@ if (!function_exists('dol_loginfunction')) if (file_exists($tmp)) { $template_dir = preg_replace('/login\.tpl\.php$/', '', $tmp); break; } } } - else - { + else { $template_dir = DOL_DOCUMENT_ROOT."/core/tpl/"; } @@ -376,8 +374,7 @@ function encodedecode_dbpassconf($level = 0) $val = dol_decode($val); $passwd = $val; } - else - { + else { $passwd = $val; $val = dol_encode($val); $passwd_crypted = $val; @@ -401,8 +398,7 @@ function encodedecode_dbpassconf($level = 0) //print 'passwd = '.$passwd.' - passwd_crypted = '.$passwd_crypted; //exit; } - else - { + else { $config .= $buffer; } } @@ -423,14 +419,12 @@ function encodedecode_dbpassconf($level = 0) return 1; } - else - { + else { dol_syslog("encodedecode_dbpassconf Failed to open conf.php file for writing", LOG_WARNING); return -1; } } - else - { + else { dol_syslog("encodedecode_dbpassconf Failed to read conf.php", LOG_ERR); return -2; } @@ -476,7 +470,7 @@ function getRandomPassword($generic = false, $replaceambiguouschars = null, $len $generated_password = str_shuffle($randomCode); } - else // Old platform, non cryptographic random + else // Old platform, non cryptographic random { $max = strlen($lowercase) - 1; for ($x = 0; $x < $nbofchar; $x++) { @@ -514,8 +508,7 @@ function getRandomPassword($generic = false, $replaceambiguouschars = null, $len { $generated_password = str_replace($replaceambiguouschars, $numbers{random_int(0, $max)}, $generated_password); } - else - { + else { $generated_password = str_replace($replaceambiguouschars, $numbers{mt_rand(0, $max)}, $generated_password); } } diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index ad1e6304d03..541aab2358e 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -305,8 +305,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product_label; } - else - { + else { $label = (!empty($objp->label) ? $objp->label : $objp->product_label); } @@ -333,8 +332,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') print '
"; if ($objp->fk_product_type == 1) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); @@ -440,8 +438,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') print dol_print_date($receiving->date_delivery, 'day'); print '   
'; } - else - { + else { print $tab[$x]['entry']; } //print ' -> A '.$tab[$x]['rowid'].' mainmenu='.$tab[$x]['mainmenu'].' leftmenu='.$tab[$x]['leftmenu'].' fk_mainmenu='.$tab[$x]['fk_mainmenu'].' fk_leftmenu='.$tab[$x]['fk_leftmenu'].'
'."\n"; @@ -211,8 +209,7 @@ function tree_recur($tab, $pere, $rang, $iddivjstree = 'iddivjstree', $donoreset print $tab[$x]['buttons']; print ''; } - else - { + else { print $tab[$x]['entry']; } //print ' -> B '.$tab[$x]['rowid'].' mainmenu='.$tab[$x]['mainmenu'].' leftmenu='.$tab[$x]['leftmenu'].' fk_mainmenu='.$tab[$x]['fk_mainmenu'].' fk_leftmenu='.$tab[$x]['fk_leftmenu'].'
'."\n"; diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 9ac9383e516..2fbc6eee325 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -347,8 +347,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ' '; print ''; } - else - { + else { $dirthemestring = ''; foreach ($dirthemes as $dirtheme) { @@ -404,8 +403,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print ' '.$subdir.''; } - else - { + else { print ' '.$subdir; } print ''; @@ -442,8 +440,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { // Nothing } - else - { + else { // Show logo print ''.$langs->trans("EnableShowLogo").''; if ($edit) @@ -451,8 +448,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ajax_constantonoff('MAIN_SHOW_LOGO', array(), null, 0, 0, 1); //print $form->selectyesno('MAIN_SHOW_LOGO', $conf->global->MAIN_SHOW_LOGO, 1); } - else - { + else { print yn($conf->global->MAIN_SHOW_LOGO); } print ''; @@ -487,8 +483,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if ($edit) print '
('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; print '';*/ } - else - { + else { $default = $langs->trans('No'); print ''; print ''.$langs->trans("TopMenuDisableImages").''; @@ -498,8 +493,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ajax_constantonoff('THEME_TOPMENU_DISABLE_IMAGE', array(), null, 0, 0, 1); //print $form->selectyesno('THEME_TOPMENU_DISABLE_IMAGE', $conf->global->THEME_TOPMENU_DISABLE_IMAGE, 1); } - else - { + else { print yn($conf->global->THEME_TOPMENU_DISABLE_IMAGE); } print '   '.$langs->trans("Default").': '.$default.' '; @@ -532,8 +526,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if ($edit) print '
('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; print '';*/ } - else - { + else { print ''; print ''.$langs->trans("BackgroundColor").''; print ''; @@ -542,8 +535,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKBODY, array()), ''), 'THEME_ELDY_BACKBODY', 'formcolor', 1).' '; } - else - { + else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKBODY, array()), ''); if ($color) print ''; else print $langs->trans("Default"); @@ -578,8 +570,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if ($edit) print '
('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; print '';*/ } - else - { + else { $default = (empty($colorbackhmenu1) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colorbackhmenu1))); print ''; @@ -589,8 +580,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1, array()), ''), 'THEME_ELDY_TOPMENU_BACK1', 'formcolor', 1).' '; } - else - { + else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1, array()), ''); if ($color) print ''; else print $langs->trans("Default"); @@ -625,8 +615,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if ($edit) print '
('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; print '';*/ } - else - { + else { $default = (empty($colorbackvmenu1) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colorbackvmenu1))); print ''; @@ -636,8 +625,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_VERMENU_BACK1, array()), ''), 'THEME_ELDY_VERMENU_BACK1', 'formcolor', 1).' '; } - else - { + else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_VERMENU_BACK1, array()), ''); if ($color) print ''; else print $langs->trans("Default"); @@ -652,8 +640,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if ($foruserprofile) { } - else - { + else { $default = (empty($colortexttitlenotab) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colortexttitlenotab))); print ''; @@ -663,8 +650,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTTITLENOTAB, array()), ''), 'THEME_ELDY_TEXTTITLENOTAB', 'formcolor', 1).' '; } - else - { + else { print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLENOTAB, $langs->trans("Default")); } print '   '.$langs->trans("Default").': '.$default.' '; @@ -678,8 +664,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if ($foruserprofile) { } - else - { + else { $default = (empty($colorbacktitle1) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colorbacktitle1))); print ''; @@ -689,8 +674,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKTITLE1, array()), ''), 'THEME_ELDY_BACKTITLE1', 'formcolor', 1).' '; } - else - { + else { print $formother->showColor($conf->global->THEME_ELDY_BACKTITLE1, $langs->trans("Default")); } print '   '.$langs->trans("Default").': '.$default.' '; // $colorbacktitle1 in CSS @@ -704,8 +688,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if ($foruserprofile) { } - else - { + else { $default = (empty($colortexttitle) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colortexttitle))); print ''; @@ -715,8 +698,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTTITLE, array()), ''), 'THEME_ELDY_TEXTTITLE', 'formcolor', 1).' '; } - else - { + else { print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLE, $langs->trans("Default")); } print '   '.$langs->trans("Default").': '.$default.' '; @@ -730,8 +712,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if ($foruserprofile) { } - else - { + else { $default=(empty($colortexttitlelink) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colortexttitlelink))); print ''; @@ -741,8 +722,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTTITLELINK, array()), ''), 'THEME_ELDY_TEXTTITLELINK', 'formcolor', 1).' '; } - else - { + else { print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLELINK, $langs->trans("Default")); } print '   '.$langs->trans("Default").': '.$default.' '; @@ -757,8 +737,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if ($foruserprofile) { } - else - { + else { $default = (empty($colorbacklineimpair1) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colorbacklineimpair1))); print ''; @@ -768,8 +747,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEIMPAIR1, array()), ''), 'THEME_ELDY_LINEIMPAIR1', 'formcolor', 1).' '; } - else - { + else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEIMPAIR1, array()), ''); if ($color) print ''; else print $langs->trans("Default"); @@ -784,8 +762,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if ($foruserprofile) { } - else - { + else { $default = (empty($colorbacklinepair1) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colorbacklinepair1))); print ''; @@ -795,8 +772,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEPAIR1, array()), ''), 'THEME_ELDY_LINEPAIR1', 'formcolor', 1).' '; } - else - { + else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEPAIR1, array()), ''); if ($color) print ''; else print $langs->trans("Default"); @@ -831,8 +807,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if ($edit) print '
('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; print '';*/ } - else - { + else { $default = (empty($colortextlink) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colortextlink))); print ''; @@ -842,12 +817,10 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK, array()), ''), 'THEME_ELDY_TEXTLINK', 'formcolor', 1).' '; } - else - { + else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK, array()), ''); if ($color) print ''; - else - { + else { //print ''; //print ''.$langs->trans("Default").''; print $langs->trans("Default"); @@ -887,8 +860,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_HOVER, array()), ''); print $formother->selectColor($color, 'THEME_ELDY_USE_HOVER', 'formcolor', 1).' '; } - else - { + else { if ($conf->global->THEME_ELDY_USE_HOVER == '1') $color = colorArrayToHex(colorStringToArray($colorbacklinepairhover)); else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_HOVER, array()), ''); if ($color) @@ -917,8 +889,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''; */ } - else - { + else { $default = (empty($colorbacklinepairchecked) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colorbacklinepairchecked))); print ''; @@ -932,8 +903,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_CHECKED, array()), ''); print $formother->selectColor($color, 'THEME_ELDY_USE_CHECKED', 'formcolor', 1).' '; } - else - { + else { if ($conf->global->THEME_ELDY_USE_CHECKED == '1') $color = 'e6edf0'; else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_CHECKED, array()), ''); if ($color) @@ -962,14 +932,12 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $form->selectyesno('MAIN_OPTIMIZEFORTEXTBROWSER', $fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER, 1); } - else - { + else { if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { print yn($fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER); } - else - { + else { print yn(1); if (empty($fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) print ' ('.$langs->trans("ForcedByGlobalSetup").')'; } @@ -979,8 +947,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''; print ''; } - else - { + else { /*var_dump($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER); $default=$langs->trans('No'); print ''; @@ -1024,8 +991,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $form->selectArray('MAIN_OPTIMIZEFORCOLORBLIND', $colorBlindOptions, $fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND, 0); } - else - { + else { if (!empty($fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND) && isset($colorBlindOptions[$fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND])) { print $colorBlindOptions[$fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND]; } @@ -1038,8 +1004,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''; print ''; } - else - { + else { } print ''; } diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 1864ca27bea..9dd7708c36d 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -94,8 +94,7 @@ function dolKeepOnlyPhpCode($str) { $newstr .= $partlings[0].'?>'; } - else - { + else { $newstr .= $part.'?>'; } } @@ -300,7 +299,7 @@ function dolWebsiteOutput($content, $contenttype = 'html', $containerid = '') $content = str_replace('!~!~!~', '', $content); } } - else // REPLACEMENT OF LINKS When page called from virtual host + else // REPLACEMENT OF LINKS When page called from virtual host { $symlinktomediaexists = 1; if ($website->virtualhost) { @@ -336,8 +335,7 @@ function dolWebsiteOutput($content, $contenttype = 'html', $containerid = '') $content = preg_replace('/(]*src=")\/?viewimage\.php/', '\1/wrapper.php', $content, -1, $nbrep); $content = preg_replace('/(]*href=")\/?documents\.php/', '\1/wrapper.php', $content, -1, $nbrep); } - else - { + else { // ]*src=")\/?image\//', '\1/medias/image/', $content, -1, $nbrep); $content = preg_replace('/(url\(["\']?)\/?image\//', '\1/medias/image/', $content, -1, $nbrep); @@ -426,8 +424,7 @@ function redirectToContainer($containerref, $containeraliasalt = '', $containeri { $containerref = $tmpwebsitepage->pageurl; } - else - { + else { print "Error, page contains a redirect to the alternative alias '".$containeraliasalt."' that does not exists in web site (".$website->id." / ".$website->ref.")"; exit; } @@ -464,18 +461,16 @@ function redirectToContainer($containerref, $containeraliasalt = '', $containeri print "Error, page with uri '.$currenturi.' try a redirect to the same alias page '".$containerref."' in web site '".$website->ref."'"; exit; } - else - { + else { $newurl = preg_replace('/&pageref=([^&]+)/', '&pageref='.$containerref, $currenturi); } } - else - { + else { $newurl = $currenturi.'&pageref='.urlencode($containerref); } } } - else // When page called from virtual host server + else // When page called from virtual host server { $newurl = '/'.$containerref.'.php'; } @@ -488,8 +483,7 @@ function redirectToContainer($containerref, $containeraliasalt = '', $containeri header("Location: ".$newurl); exit; } - else - { + else { print "Error, page contains a redirect to the alias page '".$containerref."' that does not exists in web site (".$website->id." / ".$website->ref.")"; exit; } @@ -601,7 +595,7 @@ function getStructuredData($type, $data = array()) if (is_array($mysoc->socialnetworks) && count($mysoc->socialnetworks) > 0) { $ret .= '"sameAs": ['; $i = 0; - foreach($mysoc->socialnetworks as $key => $value) { + foreach ($mysoc->socialnetworks as $key => $value) { if ($key == 'linkedin') { $ret.= '"https://www.'.$key.'.com/company/'.dol_escape_json($value).'"'; } elseif ($key == 'youtube') { @@ -670,7 +664,7 @@ function getStructuredData($type, $data = array()) $ret .= '"keywords": ['; $i = 0; $arrayofkeywords = explode(',', $websitepage->keywords); - foreach($arrayofkeywords as $keyword) { + foreach ($arrayofkeywords as $keyword) { $ret.= '"'.dol_escape_json($keyword).'"'; $i++; if ($i < count($arrayofkeywords)) $ret .= ', '; @@ -810,8 +804,7 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $so $arrayresult['code'] = 'KO'; $arrayresult['message'] = $weblangs->trans("ErrorSearchCriteriaTooSmall"); } - else - { + else { $tmparrayoftype = explode(',', $type); foreach ($tmparrayoftype as $tmptype) { if (!in_array($tmptype, array('', 'page', 'blogpost'))) { @@ -873,8 +866,7 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $so $i++; } } - else - { + else { $error++; $arrayresult['code'] = $db->lasterrno(); $arrayresult['message'] = $db->lasterror(); @@ -934,8 +926,7 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $so $arrayresult['message'] = $weblangs->trans("NoRecordFound"); } } - else - { + else { $error++; $arrayresult['code'] = 'KO'; $arrayresult['message'] = 'No supported algorithm found'; @@ -985,8 +976,7 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify $urltograbdirrootwithoutslash = getRootURLFromURL($urltograb); $urltograbbis = $urltograbdirrootwithoutslash.$regs[2][$key]; // We use dirroot } - else - { + else { $urltograbbis = $urltograb.'/'.$regs[2][$key]; // We use dir of grabbed file } @@ -1029,8 +1019,7 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify setEventMessages('Error getting '.$urltograbbis.': '.$tmpgeturl['http_code'], null, 'errors'); $action = 'create'; } - else - { + else { $alreadygrabbed[$urltograbbis] = 1; // Track that file was alreay grabbed. dol_mkdir(dirname($filetosave)); @@ -1062,8 +1051,7 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify $urltograbdirrootwithoutslash = getRootURLFromURL($urltograb); $urltograbbis = $urltograbdirrootwithoutslash.$regs[2][$key]; // We use dirroot } - else - { + else { $urltograbbis = $urltograb.'/'.$regs[2][$key]; // We use dir of grabbed file } @@ -1108,8 +1096,7 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify setEventMessages('Error getting '.$urltograbbis.': '.$tmpgeturl['http_code'], null, 'errors'); $action = 'create'; } - else - { + else { $alreadygrabbed[$urltograbbis] = 1; // Track that file was alreay grabbed. dol_mkdir(dirname($filetosave)); diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php index 440f1147cbf..33db8490a75 100644 --- a/htdocs/core/lib/xcal.lib.php +++ b/htdocs/core/lib/xcal.lib.php @@ -230,8 +230,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) $enddate = dol_time_plus_duree($startdate, 1, "d"); } } - else - { + else { if (empty($enddate)) { $enddate = $startdate + $duration; @@ -316,8 +315,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) @chmod($outputfile, octdec($conf->global->MAIN_UMASK)); } } - else - { + else { dol_syslog("xcal.lib.php::build_calfile Failed to open file ".$outputfile." for writing"); return -2; } @@ -526,8 +524,7 @@ function calEncode($line) $out .= $newpara; } - else - { + else { $strlength = dol_strlen($line); for ($j = 0; $j < $strlength; $j++) diff --git a/htdocs/core/login/functions_dolibarr.php b/htdocs/core/login/functions_dolibarr.php index ea3fa2f3a19..333e4741cd1 100644 --- a/htdocs/core/login/functions_dolibarr.php +++ b/htdocs/core/login/functions_dolibarr.php @@ -107,8 +107,7 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes { $login = $obj->login; } - else - { + else { sleep(2); // Anti brut force protection dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO bad password for '".$usertotest."', cryptType=".$cryptType, LOG_NOTICE); @@ -124,8 +123,7 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes global $mc; if (!isset($mc)) $conf->multicompany->enabled = false; // Global not available, disable $conf->multicompany->enabled for safety - else - { + else { $ret = $mc->checkRight($obj->rowid, $entitytotest); if ($ret < 0) { @@ -135,8 +133,7 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes } } } - else - { + else { dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO user not found for '".$usertotest."'", LOG_NOTICE); sleep(1); @@ -146,8 +143,7 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes $_SESSION["dol_loginmesg"] = $langs->trans("ErrorBadLoginPassword"); } } - else - { + else { dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO db error for '".$usertotest."' error=".$db->lasterror(), LOG_ERR); sleep(1); $_SESSION["dol_loginmesg"] = $db->lasterror(); diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index 3a8b274c109..9f7f5f1d81c 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -127,8 +127,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) return ''; } } - else - { + else { if ($ldapdebug) print "DEBUG: ".$ldap->error."
\n"; } $ldap->close(); @@ -219,8 +218,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) $_SESSION["dol_loginmesg"] = $langs->trans("ErrorBadLoginPassword"); } } - else - { + else { /* Login failed. Return false, together with the error code and text from ** the LDAP server. The common error codes and reasons are listed below : ** (for iPlanet, other servers may differ) diff --git a/htdocs/core/login/functions_openid.php b/htdocs/core/login/functions_openid.php index a401dfd7764..c354d2d8d0e 100644 --- a/htdocs/core/login/functions_openid.php +++ b/htdocs/core/login/functions_openid.php @@ -57,8 +57,7 @@ function check_user_password_openid($usertotest, $passwordtotest, $entitytotest) $openid->SetApprovedURL($protocol.$_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"]); // Send Response from OpenID server to this script $openid->Redirect(); // This will redirect user to OpenID Server } - else - { + else { $error = $openid->GetError(); return false; } @@ -96,8 +95,7 @@ function check_user_password_openid($usertotest, $passwordtotest, $entitytotest) $error = $openid->GetError(); return false; } - else - { + else { // Signature Verification Failed //echo "INVALID AUTHORIZATION"; return false; diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 4b4a4c54151..c58c8049c27 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -145,8 +145,7 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout { $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini); }*/ - else - { + else { $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo_squarred_alpha.png'; $logoContainerAdditionalClass = ''; } @@ -411,8 +410,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t $i++; } } - else - { + else { // Should not happend. Entries are added $newmenu->add('', $langs->trans("NoJournalDefined"), 2, $user->rights->accounting->comptarapport->lire); } @@ -474,8 +472,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t { print '
'."\n"; } - else - { + else { print '
'."\n"; } } @@ -539,8 +536,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t print ''."\n"; $lastlevel0 = 'greyed'; } - else - { + else { $lastlevel0 = 'hidden'; } if ($showmenu) diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php index 2a67d43c1e3..c654e823b5c 100644 --- a/htdocs/core/menus/standard/auguria_menu.php +++ b/htdocs/core/menus/standard/auguria_menu.php @@ -79,8 +79,7 @@ class MenuManager $_SESSION["mainmenu"] = $mainmenu; $_SESSION["leftmenuopened"] = ""; } - else - { + else { // On va le chercher en session si non defini par le lien $mainmenu = isset($_SESSION["mainmenu"]) ? $_SESSION["mainmenu"] : ''; } @@ -97,8 +96,7 @@ class MenuManager //$leftmenu=""; $_SESSION["leftmenuopened"] = ""; } - else - { + else { $_SESSION["leftmenuopened"] = $leftmenu; } } else { @@ -146,8 +144,7 @@ class MenuManager if ($mode == 'top') print_auguria_menu($this->db, $this->atarget, $this->type_user, $this->tabMenu, $this->menu, 0, $mode); if ($mode == 'left') print_left_auguria_menu($this->db, $this->menu_array, $this->menu_array_after, $this->tabMenu, $this->menu, 0, '', '', $moredata); } - else - { + else { $conf->global->MAIN_SHOW_LOGO = 0; if ($mode == 'top') print_left_auguria_menu($this->db, $this->menu_array, $this->menu_array_after, $this->tabMenu, $this->menu, 0); if ($mode == 'left') print_auguria_menu($this->db, $this->atarget, $this->type_user, $this->tabMenu, $this->menu, 0, $mode); @@ -226,8 +223,7 @@ class MenuManager { $lastlevel[0] = 'greyed'; } - else - { + else { $lastlevel[0] = 'hidden'; } } @@ -259,8 +255,7 @@ class MenuManager { $relurl2 = dol_buildpath($val2['url'], 1); } - else - { + else { $relurl2 = $val2['url']; } $canonurl2 = preg_replace('/\?.*$/', '', $val2['url']); @@ -286,20 +281,18 @@ class MenuManager print '>'; $lastlevel2[$val2['level']] = 'enabled'; } - else // Not allowed but visible (greyed) + else // Not allowed but visible (greyed) { print ''; $lastlevel2[$val2['level']] = 'greyed'; } } - else - { + else { if ($val2['enabled']) // Allowed { $lastlevel2[$val2['level']] = 'enabled'; } - else - { + else { $lastlevel2[$val2['level']] = 'greyed'; } } @@ -308,8 +301,7 @@ class MenuManager { if ($val2['enabled']) // Allowed print ''; - else - print ''; + else print ''; } print ''."\n"; } diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 3f539260856..39f94d6eb2f 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -440,8 +440,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = $mtitle .= $langs->trans($item); } } - else - { + else { $mtitle = $langs->trans($smenu->title); } // Add item @@ -512,8 +511,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = { $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini); }*/ - else - { + else { $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo_squarred_alpha.png'; $logoContainerAdditionalClass = ''; } @@ -1309,8 +1307,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $i++; } } - else - { + else { // Should not happend. Entries are added $newmenu->add('', $langs->trans("NoJournalDefined"), 2, $user->rights->accounting->comptarapport->lire); } @@ -1625,8 +1622,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/product/inventory/card.php?action=create", $langs->trans("NewInventory"), 1, $user->rights->stock->creer); $newmenu->add("/product/inventory/list.php", $langs->trans("List"), 1, $user->rights->stock->lire); } - else - { + else { $newmenu->add("/product/inventory/list.php?leftmenu=stock", $langs->trans("Inventory"), 0, $user->rights->stock->inventory_advance->read, '', $mainmenu, 'stock'); $newmenu->add("/product/inventory/card.php?action=create", $langs->trans("NewInventory"), 1, $user->rights->stock->inventory_advance->write); $newmenu->add("/product/inventory/list.php", $langs->trans("List"), 1, $user->rights->stock->inventory_advance->read); @@ -1987,8 +1983,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM { print '
'."\n"; } - else - { + else { print '
'."\n"; } } @@ -2052,8 +2047,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM print ''."\n"; $lastlevel0 = 'greyed'; } - else - { + else { $lastlevel0 = 'hidden'; } if ($showmenu) diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index 5276a509ae5..2d62f9f7275 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -78,8 +78,7 @@ class MenuManager $_SESSION["mainmenu"] = $mainmenu; $_SESSION["leftmenuopened"] = ""; } - else - { + else { // On va le chercher en session si non defini par le lien $mainmenu = isset($_SESSION["mainmenu"]) ? $_SESSION["mainmenu"] : ''; } @@ -96,8 +95,7 @@ class MenuManager //$leftmenu=""; $_SESSION["leftmenuopened"] = ""; } - else - { + else { $_SESSION["leftmenuopened"] = $leftmenu; } } else { @@ -147,8 +145,7 @@ class MenuManager if ($mode == 'top') print_eldy_menu($this->db, $this->atarget, $this->type_user, $this->tabMenu, $this->menu, 0, $mode); if ($mode == 'left') print_left_eldy_menu($this->db, $this->menu_array, $this->menu_array_after, $this->tabMenu, $this->menu, 0, '', '', $moredata); } - else - { + else { $conf->global->MAIN_SHOW_LOGO = 0; if ($mode == 'top') print_left_eldy_menu($this->db, $this->menu_array, $this->menu_array_after, $this->tabMenu, $this->menu, 0); if ($mode == 'left') print_eldy_menu($this->db, $this->atarget, $this->type_user, $this->tabMenu, $this->menu, 0, $mode); @@ -231,8 +228,7 @@ class MenuManager { $lastlevel[0] = 'greyed'; } - else - { + else { $lastlevel[0] = 'hidden'; } } @@ -264,8 +260,7 @@ class MenuManager { $relurl2 = dol_buildpath($val2['url'], 1); } - else - { + else { $relurl2 = $val2['url']; } $canonurl2 = preg_replace('/\?.*$/', '', $val2['url']); @@ -291,20 +286,18 @@ class MenuManager print '>'; $lastlevel2[$val2['level']] = 'enabled'; } - else // Not allowed but visible (greyed) + else // Not allowed but visible (greyed) { print ''; $lastlevel2[$val2['level']] = 'greyed'; } } - else - { + else { if ($val2['enabled']) // Allowed { $lastlevel2[$val2['level']] = 'enabled'; } - else - { + else { $lastlevel2[$val2['level']] = 'greyed'; } } @@ -313,8 +306,7 @@ class MenuManager { if ($val2['enabled']) // Allowed print ''; - else - print ''; + else print ''; } print ''."\n"; } diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index 923f4e84965..2b2a000fa3b 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -231,8 +231,7 @@ class MenuManager { $lastlevel[0] = 'greyed'; } - else - { + else { $lastlevel[0] = 'hidden'; } } @@ -282,20 +281,18 @@ class MenuManager print '>'; $lastlevel2[$val2['level']] = 'enabled'; } - else // Not allowed but visible (greyed) + else // Not allowed but visible (greyed) { print ''; $lastlevel2[$val2['level']] = 'greyed'; } } - else - { + else { if ($val2['enabled']) // Allowed { $lastlevel2[$val2['level']] = 'enabled'; } - else - { + else { $lastlevel2[$val2['level']] = 'greyed'; } } @@ -376,8 +373,7 @@ class MenuManager { print '
'."\n"; } - else - { + else { print '
'."\n"; } } @@ -398,8 +394,7 @@ class MenuManager { print ''."\n"; } - else - { + else { print ''."\n"; } print ''."\n"; @@ -420,8 +415,7 @@ class MenuManager if ($this->menu->liste[$i]['url']) print $this->menu->liste[$i]['titre'].''; else print ''; } - else - { + else { print $tabstring.''.$this->menu->liste[$i]['titre'].''; } diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 24811ad854d..0911dc85719 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -438,8 +438,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $this->error = $this->db->lasterror(); $err++; } - else - { + else { dol_syslog(get_class($this)."::_init Warning ".$this->db->lasterror(), LOG_WARNING); } } @@ -451,8 +450,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return 0; } @@ -538,8 +536,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return 0; } @@ -561,8 +558,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it // If module name translation exists return $langs->transnoentitiesnoconv("Module".$this->numero."Name"); } - else - { + else { // If module name translation using it's unique id does not exist, we try to use its name to find translation if (is_array($this->langfiles)) { foreach ($this->langfiles as $val) @@ -597,8 +593,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it // If module description translation exists return $langs->transnoentitiesnoconv("Module".$this->numero."Desc"); } - else - { + else { // If module description translation does not exist using its unique id, we can use its name to find translation if (is_array($this->langfiles)) { foreach ($this->langfiles as $val) @@ -651,13 +646,11 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it ) ); } - else - { + else { $content = nl2br($content); } } - else - { + else { // Mostly for internal modules if (!empty($this->descriptionlong)) { if (is_array($this->langfiles)) { @@ -746,8 +739,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it @include_once DOL_DOCUMENT_ROOT.'/core/lib/parsemd.lib.php'; $content = dolMd2Html($content, 'parsedown', array('doc/'=>dol_buildpath(strtolower($this->name).'/doc/', 1))); } - else - { + else { $content = nl2br($content); } } @@ -859,8 +851,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it // Translation not found return $langs->trans($this->export_label[$r]); } - else - { + else { // Translation found return $langs->trans($langstring); } @@ -884,8 +875,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it // Translation not found return $langs->transnoentitiesnoconv($this->import_label[$r]); } - else - { + else { // Translation found return $langs->transnoentitiesnoconv($langstring); } @@ -913,8 +903,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it { $err++; } - else - { + else { $obj = $this->db->fetch_object($resql); if ($obj) { return $this->db->jdate($obj->tms); @@ -946,8 +935,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it { $err++; } - else - { + else { $obj = $this->db->fetch_object($resql); $tmp = array(); if ($obj->note) { @@ -1233,16 +1221,14 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if (!$err) { $this->db->commit(); } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); } } // else box already registered into database } - else - { + else { $this->error = $this->db->lasterror(); $err++; } @@ -1428,16 +1414,14 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if (!$err) { $this->db->commit(); } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); } } // else box already registered into database } - else - { + else { $this->error = $this->db->lasterror(); $err++; } @@ -1629,13 +1613,11 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $err++; } } - else - { + else { dol_syslog(get_class($this)."::insert_const constant '".$name."' already exists", LOG_WARNING); } } - else - { + else { $err++; } } @@ -1738,16 +1720,14 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $sql .= " VALUES "; $sql .= "(".$r_id.",".$entity.",'".$this->db->escape($r_desc)."','".$r_modul."','".$r_type."',".$r_def.",'".$r_perms."','".$r_subperms."')"; } - else - { + else { $sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def"; $sql .= " (id, entity, libelle, module, type, bydefault, perms)"; $sql .= " VALUES "; $sql .= "(".$r_id.",".$entity.",'".$this->db->escape($r_desc)."','".$r_modul."','".$r_type."',".$r_def.",'".$r_perms."')"; } } - else - { + else { $sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def "; $sql .= " (id, entity, libelle, module, type, bydefault)"; $sql .= " VALUES "; @@ -1793,15 +1773,13 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if ($result > 0) { $tmpuser->addrights($r_id, '', '', 0, 1); } - else - { + else { dol_syslog(get_class($this)."::insert_permissions Failed to add the permission to user because fetch return an error", LOG_ERR); } $i++; } } - else - { + else { dol_print_error($this->db); } } @@ -1816,8 +1794,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it } $this->db->free($resql); } - else - { + else { $this->error = $this->db->lasterror(); $err++; } @@ -1885,8 +1862,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if (!$this->menu[$key]['fk_menu']) { $menu->fk_menu = 0; } - else - { + else { $foundparent = 0; $fk_parent = $this->menu[$key]['fk_menu']; if (preg_match('/^r=/', $fk_parent)) // old deprecated method @@ -1934,8 +1910,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if ($result > 0) { $this->menu[$key]['rowid'] = $result; } - else - { + else { $this->error = $menu->error; dol_syslog(get_class($this).'::insert_menus result='.$result." ".$this->error, LOG_ERR); $err++; @@ -1947,8 +1922,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if (!$err) { $this->db->commit(); } - else - { + else { dol_syslog(get_class($this)."::insert_menus ".$this->error, LOG_ERR); $this->db->rollback(); } @@ -2081,8 +2055,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $this->db->query($sql); } } - else - { + else { $this->error = $this->db->lasterror(); $err++; } @@ -2153,7 +2126,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if (isset($value['entity'])) { $entity = $value['entity']; } } - else // when hook is declared with syntax 'hook'=>array('hookcontext1','hookcontext2',...) + else // when hook is declared with syntax 'hook'=>array('hookcontext1','hookcontext2',...) { $newvalue = json_encode($value); } @@ -2184,8 +2157,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $error++; $this->error = $this->db->lasterror(); } - else - { + else { dol_syslog(get_class($this)."::insert_module_parts for ".$this->const_name."_".strtoupper($key)." Record already exists.", LOG_WARNING); } } @@ -2291,8 +2263,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if (preg_match('/^\//i', $this->picto)) print img_picto($alttext, $this->picto, 'class="inline-block valignmiddle"', 1); else print img_object($alttext, $this->picto, 'class="inline-block valignmiddle"'); } - else - { + else { print img_object($alttext, 'generic', 'class="inline-block valignmiddle"'); } diff --git a/htdocs/core/modules/action/modules_action.php b/htdocs/core/modules/action/modules_action.php index bf957175f84..ea3b961b63f 100644 --- a/htdocs/core/modules/action/modules_action.php +++ b/htdocs/core/modules/action/modules_action.php @@ -86,8 +86,7 @@ function action_create($db, $object, $modele, $outputlangs, $hidedetails = 0, $h { $modele = $conf->global->ACTION_EVENT_ADDON_PDF; } - else - { + else { $modele = 'soleil'; } } @@ -142,15 +141,13 @@ function action_create($db, $object, $modele, $outputlangs, $hidedetails = 0, $h return 1; } - else - { + else { $outputlangs->charset_output = $sav_charset_output; dol_print_error($db, "action_pdf_create Error: ".$obj->error); return 0; } } - else - { + else { print $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists", $file); return 0; } diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index b978bed1eab..0b489e7202c 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -295,8 +295,7 @@ class CommActionRapport if ($obj->dp2) { if (dol_print_date($this->db->jdate($obj->dp), "day") != dol_print_date($this->db->jdate($obj->dp2), "day")) $textdate .= " -> ".dol_print_date($this->db->jdate($obj->dp2), "day")." - ".dol_print_date($this->db->jdate($obj->dp2), "hour"); - else - $textdate .= " -> ".dol_print_date($this->db->jdate($obj->dp2), "hour"); + else $textdate .= " -> ".dol_print_date($this->db->jdate($obj->dp2), "hour"); } $textdate = $outputlangs->trans("ID").' '.$obj->id.' - '.$textdate; $pdf->MultiCell(45 - $this->marge_gauche, $height, $textdate, 0, 'L', 0); diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 1bf2b836269..dc19b2c0907 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -119,8 +119,7 @@ class pdf_ban extends ModeleBankAccountDoc $dir = $conf->bank->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->bank->dir_output."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -204,8 +203,7 @@ class pdf_ban extends ModeleBankAccountDoc $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -224,8 +222,7 @@ class pdf_ban extends ModeleBankAccountDoc $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -263,8 +260,7 @@ class pdf_ban extends ModeleBankAccountDoc return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } @@ -332,8 +328,7 @@ class pdf_ban extends ModeleBankAccountDoc $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $langs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index 23868eef643..8bcb06b72da 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -124,8 +124,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc else $dir = $conf->bank->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); if (!empty($moreparams['force_dir_output'])) $dir = $moreparams['force_dir_output']; else $dir = $conf->bank->dir_output."/".$objectref; @@ -210,8 +209,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -368,8 +366,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -416,8 +413,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } @@ -567,8 +563,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $langs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php index 5b561f90c1c..b01df64c088 100644 --- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php @@ -209,8 +209,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode { $result = -2; } - else - { + else { if ($this->verif_syntax($code, $type) >= 0) { $is_dispo = $this->verif_dispo($db, $code, $product); @@ -218,19 +217,16 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode { $result = -3; } - else - { + else { $result = 0; } } - else - { + else { if (dol_strlen($code) == 0) { $result = -2; } - else - { + else { $result = -1; } } @@ -264,13 +260,11 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode { return 0; } - else - { + else { return -1; } } - else - { + else { return -2; } } diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php index 9755369793e..4260cd4d8c4 100644 --- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php +++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php @@ -130,8 +130,7 @@ class doc_generic_bom_odt extends ModelePDFBom unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -268,8 +267,7 @@ class doc_generic_bom_odt extends ModelePDFBom if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -302,8 +300,7 @@ class doc_generic_bom_odt extends ModelePDFBom $contactobject = $object->contact; } } - else - { + else { $socobject = $object->thirdparty; } @@ -386,7 +383,7 @@ class doc_generic_bom_odt extends ModelePDFBom if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -397,8 +394,7 @@ class doc_generic_bom_odt extends ModelePDFBom } } // Replace tags of lines - try - { + try { $foundtagforlines = 1; try { $listlines = $odfHandler->setSegment('lines'); @@ -422,8 +418,7 @@ class doc_generic_bom_odt extends ModelePDFBom $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -497,8 +492,7 @@ class doc_generic_bom_odt extends ModelePDFBom return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/bom/mod_bom_standard.php b/htdocs/core/modules/bom/mod_bom_standard.php index 08acd30451c..2246412997b 100644 --- a/htdocs/core/modules/bom/mod_bom_standard.php +++ b/htdocs/core/modules/bom/mod_bom_standard.php @@ -130,8 +130,7 @@ class mod_bom_standard extends ModeleNumRefboms if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog("mod_bom_standard::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php index daa2e04366d..ea431b5a2ce 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php @@ -127,8 +127,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog(__METHOD__, LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/cheque/modules_chequereceipts.php b/htdocs/core/modules/cheque/modules_chequereceipts.php index 7cc72a865d8..bbe9bc119a4 100644 --- a/htdocs/core/modules/cheque/modules_chequereceipts.php +++ b/htdocs/core/modules/cheque/modules_chequereceipts.php @@ -179,8 +179,7 @@ function chequereceipt_pdf_create($db, $id, $message, $modele, $outputlangs) { $modele = $conf->global->CHEQUERECEIPT_ADDON_PDF; } - else - { + else { //print $langs->trans("Error")." ".$langs->trans("Error_FACTURE_ADDON_PDF_NotDefined"); //return 0; $modele = 'blochet'; @@ -204,15 +203,13 @@ function chequereceipt_pdf_create($db, $id, $message, $modele, $outputlangs) $outputlangs->charset_output = $sav_charset_output; return 1; } - else - { + else { $outputlangs->charset_output = $sav_charset_output; dol_print_error($db, "chequereceipt_pdf_create Error: ".$obj->error); return -1; } } - else - { + else { dol_print_error('', $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists", $dir.$file)); return -1; } diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 75c5103c4ab..f992996403a 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -137,8 +137,7 @@ class doc_generic_order_odt extends ModelePDFCommandes unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -280,8 +279,7 @@ class doc_generic_order_odt extends ModelePDFCommandes if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -314,8 +312,7 @@ class doc_generic_order_odt extends ModelePDFCommandes $contactobject = $object->contact; } } - else - { + else { $socobject = $object->thirdparty; } @@ -402,7 +399,7 @@ class doc_generic_order_odt extends ModelePDFCommandes if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -413,8 +410,7 @@ class doc_generic_order_odt extends ModelePDFCommandes } } // Replace tags of lines - try - { + try { $foundtagforlines = 1; try { $listlines = $odfHandler->setSegment('lines'); @@ -438,8 +434,7 @@ class doc_generic_order_odt extends ModelePDFCommandes $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -513,8 +508,7 @@ class doc_generic_order_odt extends ModelePDFCommandes return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 3838b9146e6..f5568452221 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -173,8 +173,7 @@ class pdf_einstein extends ModelePDFCommandes $this->posxqty = 135; $this->posxunit = 151; } - else - { + else { $this->posxtva = 110; $this->posxup = 126; $this->posxqty = 145; @@ -240,8 +239,7 @@ class pdf_einstein extends ModelePDFCommandes $dir = $conf->commande->multidir_output[$conf->entity]; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->commande->multidir_output[$object->entity]."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -441,17 +439,15 @@ class pdf_einstein extends ModelePDFCommandes $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -567,8 +563,7 @@ class pdf_einstein extends ModelePDFCommandes { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -583,8 +578,7 @@ class pdf_einstein extends ModelePDFCommandes { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -599,8 +593,7 @@ class pdf_einstein extends ModelePDFCommandes // Show square if ($pagenb == 1) $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0, $object->multicurrency_code); - else - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); + else $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; // Affiche zone infos @@ -643,14 +636,12 @@ class pdf_einstein extends ModelePDFCommandes return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->transnoentities("ErrorConstantNotDefined", "COMMANDE_OUTPUTDIR"); return 0; } @@ -915,8 +906,7 @@ class pdf_einstein extends ModelePDFCommandes { // Nothing to do } - else - { + else { //Local tax 1 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ @@ -1282,16 +1272,14 @@ class pdf_einstein extends ModelePDFCommandes $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 1910dd0c048..dc13ad237b7 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -233,8 +233,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; } - else - { + else { $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; // default $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative } @@ -254,13 +253,11 @@ class pdf_eratosthene extends ModelePDFCommandes { $filename = $obj['photo_vignette']; } - else - { + else { $filename = $obj['photo']; } } - else - { + else { $filename = $obj['photo']; } @@ -289,8 +286,7 @@ class pdf_eratosthene extends ModelePDFCommandes $dir = $conf->commande->multidir_output[$conf->entity]; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->commande->multidir_output[$object->entity]."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -532,8 +528,7 @@ class pdf_eratosthene extends ModelePDFCommandes $tab_height = $tab_height - $height_note; $tab_top = $posyafter + 6; } - else - { + else { $height_note = 0; } @@ -583,8 +578,7 @@ class pdf_eratosthene extends ModelePDFCommandes // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -622,17 +616,15 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -785,8 +777,7 @@ class pdf_eratosthene extends ModelePDFCommandes { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -801,8 +792,7 @@ class pdf_eratosthene extends ModelePDFCommandes { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -817,8 +807,7 @@ class pdf_eratosthene extends ModelePDFCommandes // Show square if ($pagenb == $pageposbeforeprintlines) $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code); - else - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); + else $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; // Affiche zone infos @@ -861,14 +850,12 @@ class pdf_eratosthene extends ModelePDFCommandes return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->transnoentities("ErrorConstantNotDefined", "COMMANDE_OUTPUTDIR"); return 0; } @@ -1130,8 +1117,7 @@ class pdf_eratosthene extends ModelePDFCommandes { // Nothing to do } - else - { + else { //Local tax 1 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ @@ -1450,16 +1436,14 @@ class pdf_eratosthene extends ModelePDFCommandes $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -1853,8 +1837,7 @@ class pdf_eratosthene extends ModelePDFCommandes { $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys } - else - { + else { $this->cols = $hookmanager->resArray; } } diff --git a/htdocs/core/modules/commande/mod_commande_marbre.php b/htdocs/core/modules/commande/mod_commande_marbre.php index 87e5666be4b..a5558f2d0b2 100644 --- a/htdocs/core/modules/commande/mod_commande_marbre.php +++ b/htdocs/core/modules/commande/mod_commande_marbre.php @@ -130,8 +130,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog("mod_commande_marbre::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index c938f40cfb2..b5bc55633ee 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -136,8 +136,7 @@ class doc_generic_contract_odt extends ModelePDFContract unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -267,8 +266,7 @@ class doc_generic_contract_odt extends ModelePDFContract if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -301,8 +299,7 @@ class doc_generic_contract_odt extends ModelePDFContract $contactobject = $object->contact; } } - else - { + else { $socobject = $object->thirdparty; } @@ -382,7 +379,7 @@ class doc_generic_contract_odt extends ModelePDFContract if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -394,8 +391,7 @@ class doc_generic_contract_odt extends ModelePDFContract } // Replace tags of lines - try - { + try { $foundtagforlines = 1; try { $listlines = $odfHandler->setSegment('lines'); @@ -419,8 +415,7 @@ class doc_generic_contract_odt extends ModelePDFContract $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -490,8 +485,7 @@ class doc_generic_contract_odt extends ModelePDFContract return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index f8b7908654b..68c8cd1b96c 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -194,8 +194,7 @@ class pdf_strato extends ModelePDFContract $dir = $conf->contrat->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->contrat->dir_output."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -388,18 +387,16 @@ class pdf_strato extends ModelePDFContract $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -426,8 +423,7 @@ class pdf_strato extends ModelePDFContract { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter - $heightforfreetext, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -442,8 +438,7 @@ class pdf_strato extends ModelePDFContract { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter - $heightforfreetext, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -462,8 +457,7 @@ class pdf_strato extends ModelePDFContract $this->tabSignature($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, $outputlangs); $bottomlasttab = $this->page_hauteur - $heightforfooter - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $this->tabSignature($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, $outputlangs); $bottomlasttab = $this->page_hauteur - $heightforfooter - $heightforfooter + 1; @@ -499,14 +493,12 @@ class pdf_strato extends ModelePDFContract return 1; } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "CONTRACT_OUTPUTDIR"); return 0; } @@ -636,16 +628,14 @@ class pdf_strato extends ModelePDFContract $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } diff --git a/htdocs/core/modules/contract/mod_contract_serpis.php b/htdocs/core/modules/contract/mod_contract_serpis.php index 52950778738..2becdf52219 100644 --- a/htdocs/core/modules/contract/mod_contract_serpis.php +++ b/htdocs/core/modules/contract/mod_contract_serpis.php @@ -139,8 +139,7 @@ class mod_contract_serpis extends ModelNumRefContracts if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog("mod_contract_serpis::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/dons/html_cerfafr.modules.php b/htdocs/core/modules/dons/html_cerfafr.modules.php index 4c025750f04..d3ee39e8a5f 100644 --- a/htdocs/core/modules/dons/html_cerfafr.modules.php +++ b/htdocs/core/modules/dons/html_cerfafr.modules.php @@ -104,8 +104,7 @@ class html_cerfafr extends ModeleDon $dir = $conf->don->dir_output; $file = $dir."/SPECIMEN.html"; } - else - { + else { $donref = dol_sanitizeFileName($don->ref); $dir = $conf->don->dir_output."/".$donref; $file = $dir."/".$donref.".html"; @@ -142,8 +141,7 @@ class html_cerfafr extends ModeleDon elseif ($don->modepaymentcode == 'VIR' || $don->modepaymentcode == 'PRE' || $don->modepaymentcode == 'CB') { $ModePaiement = ' Remise d\'espèces Chèque Virement, prĂ©lèvement, carte bancaire'; } - else - { + else { $ModePaiement = ' Remise d\'espèces Chèque Virement, prĂ©lèvement, carte bancaire'; } @@ -217,8 +215,7 @@ class html_cerfafr extends ModeleDon { $art200 = '200 du CGI'; } - else - { + else { $art200 = '200 du CGI'; } } @@ -230,8 +227,7 @@ class html_cerfafr extends ModeleDon { $art238 = '238 bis du CGI'; } - else - { + else { $art238 = '238 bis du CGI'; } } @@ -243,8 +239,7 @@ class html_cerfafr extends ModeleDon { $art978 = '978 du CGI'; } - else - { + else { $art978 = '978 du CGI'; } } @@ -262,14 +257,12 @@ class html_cerfafr extends ModeleDon return 1; } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "DON_OUTPUTDIR"); return 0; } @@ -412,15 +405,13 @@ class html_cerfafr extends ModeleDon $somme = $trio[3].' '.$secon[3].' '.$prim[3].' million '; elseif (($cent[3] != 0 && $cent[3] != '') || ($dix[3] != 0 && $dix[3] != '') || ($unite[3] != 0 && $unite[3] != '')) $somme = $trio[3].' '.$secon[3].' '.$prim[3].' millions '; - else - $somme = $trio[3].' '.$secon[3].' '.$prim[3]; + else $somme = $trio[3].' '.$secon[3].' '.$prim[3]; if (($cent[2] == 0 || $cent[2] == '') && ($dix[2] == 0 || $dix[2] == '') && ($unite[2] == 1)) $somme = $somme.' mille '; elseif (($cent[2] != 0 && $cent[2] != '') || ($dix[2] != 0 && $dix[2] != '') || ($unite[2] != 0 && $unite[2] != '')) $somme = $somme.$trio[2].' '.$secon[2].' '.$prim[2].' milles '; - else - $somme = $somme.$trio[2].' '.$secon[2].' '.$prim[2]; + else $somme = $somme.$trio[2].' '.$secon[2].' '.$prim[2]; $somme = $somme.$trio[1].' '.$secon[1].' '.$prim[1]; @@ -428,7 +419,6 @@ class html_cerfafr extends ModeleDon if (($cent_c == '0' || $cent_c == '') && ($dix_c == '0' || $dix_c == '')) return $somme.' et zéro '.$dev2; - else - return $somme.$trio_c.' '.$secon_c.' '.$dev2; + else return $somme.$trio_c.' '.$secon_c.' '.$dev2; } } diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 1ea817709e1..a9be573f80d 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -138,8 +138,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -280,8 +279,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -385,7 +383,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -407,7 +405,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -431,7 +429,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -452,7 +450,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -478,7 +476,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -489,8 +487,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition } } // Replace tags of lines - try - { + try { $foundtagforlines = 1; try { $listlines = $odfHandler->setSegment('lines'); @@ -512,8 +509,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -585,8 +581,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index c232edbe81c..2aa28f3b7db 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -196,8 +196,7 @@ class pdf_espadon extends ModelePdfExpedition $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product') . $object->lines[$i]->fk_product ."/photos/"; $dir = $conf->product->dir_output.'/'.$pdir; } - else - { + else { $pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product') . dol_sanitizeFileName($objphoto->ref).'/'; $dir = $conf->product->dir_output.'/'.$pdir; } @@ -212,13 +211,11 @@ class pdf_espadon extends ModelePdfExpedition { $filename = $obj['photo_vignette']; } - else - { + else { $filename = $obj['photo']; } } - else - { + else { $filename = $obj['photo']; } @@ -241,8 +238,7 @@ class pdf_espadon extends ModelePdfExpedition $dir = $conf->expedition->dir_output."/sending"; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $expref = dol_sanitizeFileName($object->ref); $dir = $conf->expedition->dir_output."/sending/".$expref; $file = $dir."/".$expref.".pdf"; @@ -413,8 +409,7 @@ class pdf_espadon extends ModelePdfExpedition $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -464,8 +459,7 @@ class pdf_espadon extends ModelePdfExpedition // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } @@ -504,17 +498,15 @@ class pdf_espadon extends ModelePdfExpedition $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -608,8 +600,7 @@ class pdf_espadon extends ModelePdfExpedition { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -624,8 +615,7 @@ class pdf_espadon extends ModelePdfExpedition { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -643,8 +633,7 @@ class pdf_espadon extends ModelePdfExpedition $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -678,14 +667,12 @@ class pdf_espadon extends ModelePdfExpedition return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->transnoentities("ErrorConstantNotDefined", "EXP_OUTPUTDIR"); return 0; } @@ -889,16 +876,14 @@ class pdf_espadon extends ModelePdfExpedition $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -908,8 +893,7 @@ class pdf_espadon extends ModelePdfExpedition { $posx = 105; } - else - { + else { $posx = $this->marge_gauche + 3; } //$pdf->Rect($this->marge_gauche, $this->marge_haute, $this->page_largeur-$this->marge_gauche-$this->marge_droite, 30); @@ -1275,8 +1259,7 @@ class pdf_espadon extends ModelePdfExpedition { $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys } - else - { + else { $this->cols = $hookmanager->resArray; } } diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 7899df494fc..bd698d72519 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -193,8 +193,7 @@ class pdf_merou extends ModelePdfExpedition $dir = $conf->expedition->dir_output."/sending"; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $expref = dol_sanitizeFileName($object->ref); $dir = $conf->expedition->dir_output."/sending/".$expref; $file = $dir."/".$expref.".pdf"; @@ -288,8 +287,7 @@ class pdf_merou extends ModelePdfExpedition $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -366,8 +364,7 @@ class pdf_merou extends ModelePdfExpedition { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -381,8 +378,7 @@ class pdf_merou extends ModelePdfExpedition { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -398,8 +394,7 @@ class pdf_merou extends ModelePdfExpedition $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -435,14 +430,12 @@ class pdf_merou extends ModelePdfExpedition return 1; } - else - { + else { $this->error = $outputlangs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $outputlangs->transnoentities("ErrorConstantNotDefined", "EXP_OUTPUTDIR"); return 0; } @@ -564,16 +557,14 @@ class pdf_merou extends ModelePdfExpedition $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, 10, 5, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $langs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $langs->transnoentities("ErrorGoToModuleSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(70, 3, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -673,8 +664,7 @@ class pdf_merou extends ModelePdfExpedition } } } - else - { + else { $pdf->MultiCell(50, 8, $outputlangs->transnoentities("Deliverer")." ".$outputlangs->convToOutputCharset($this->livreur->getFullName($outputlangs)), '', 'L'); } diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 2e0733f1ba2..99dfd20301f 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -219,8 +219,7 @@ class pdf_rouget extends ModelePdfExpedition $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/"; $dir = $conf->product->dir_output.'/'.$pdir; } - else - { + else { $pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; $dir = $conf->product->dir_output.'/'.$pdir; } @@ -234,13 +233,11 @@ class pdf_rouget extends ModelePdfExpedition { $filename = $obj['photo_vignette']; } - else - { + else { $filename = $obj['photo']; } } - else - { + else { $filename = $obj['photo']; } @@ -262,8 +259,7 @@ class pdf_rouget extends ModelePdfExpedition $dir = $conf->expedition->dir_output."/sending"; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $expref = dol_sanitizeFileName($object->ref); $dir = $conf->expedition->dir_output."/sending/".$expref; $file = $dir."/".$expref.".pdf"; @@ -422,8 +418,7 @@ class pdf_rouget extends ModelePdfExpedition $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -463,8 +458,7 @@ class pdf_rouget extends ModelePdfExpedition // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -503,18 +497,16 @@ class pdf_rouget extends ModelePdfExpedition $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -599,8 +591,7 @@ class pdf_rouget extends ModelePdfExpedition { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -615,8 +606,7 @@ class pdf_rouget extends ModelePdfExpedition { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -634,8 +624,7 @@ class pdf_rouget extends ModelePdfExpedition $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -669,14 +658,12 @@ class pdf_rouget extends ModelePdfExpedition return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->transnoentities("ErrorConstantNotDefined", "EXP_OUTPUTDIR"); return 0; } @@ -924,16 +911,14 @@ class pdf_rouget extends ModelePdfExpedition $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -943,8 +928,7 @@ class pdf_rouget extends ModelePdfExpedition { $posx = 105; } - else - { + else { $posx = $this->marge_gauche + 3; } //$pdf->Rect($this->marge_gauche, $this->marge_haute, $this->page_largeur-$this->marge_gauche-$this->marge_droite, 30); diff --git a/htdocs/core/modules/expedition/mod_expedition_safor.php b/htdocs/core/modules/expedition/mod_expedition_safor.php index afbeec748ea..f2d49ba6409 100644 --- a/htdocs/core/modules/expedition/mod_expedition_safor.php +++ b/htdocs/core/modules/expedition/mod_expedition_safor.php @@ -134,8 +134,7 @@ class mod_expedition_safor extends ModelNumRefExpedition if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog("mod_expedition_safor::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 3a66a8ae961..91539b979c2 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -227,8 +227,7 @@ class pdf_standard extends ModeleExpenseReport $dir = $conf->expensereport->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->expensereport->dir_output."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -340,8 +339,7 @@ class pdf_standard extends ModeleExpenseReport $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -410,17 +408,15 @@ class pdf_standard extends ModeleExpenseReport $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -459,8 +455,7 @@ class pdf_standard extends ModeleExpenseReport { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -475,8 +470,7 @@ class pdf_standard extends ModeleExpenseReport { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -493,8 +487,7 @@ class pdf_standard extends ModeleExpenseReport $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -561,14 +554,12 @@ class pdf_standard extends ModeleExpenseReport return 1; // No error } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "EXPENSEREPORT_OUTPUTDIR"); return 0; } @@ -710,8 +701,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -858,8 +848,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->MultiCell(96, 4, $outputlangs->transnoentities("DATE_CANCEL")." : ".dol_print_date($object->date_cancel, "day", false, $outputlangs), 0, 'L'); } } - else - { + else { if ($object->fk_user_approve > 0) { $userfee = new User($this->db); $userfee->fetch($object->fk_user_approve); $posy += 6; @@ -1106,8 +1095,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->MultiCell(30, 4, $outputlangs->transnoentitiesnoconv("RemainderToPay"), 0, 'L', 0); } } - else - { + else { $this->error = $this->db->lasterror(); return -1; } diff --git a/htdocs/core/modules/expensereport/mod_expensereport_jade.php b/htdocs/core/modules/expensereport/mod_expensereport_jade.php index 9093e55f78f..bae163227e4 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_jade.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_jade.php @@ -187,8 +187,7 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog("mod_expensereport_jade::getNextValue", LOG_DEBUG); return 0; } diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index 5124cb3f160..0e57634f488 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -218,8 +218,7 @@ class ExportCsv extends ModeleExports { $outputlangs->charset_output = $conf->global->EXPORT_CSV_FORCE_CHARSET; } - else - { + else { $outputlangs->charset_output = 'ISO-8859-1'; } @@ -254,8 +253,7 @@ class ExportCsv extends ModeleExports { $outputlangs->charset_output = $conf->global->EXPORT_CSV_FORCE_CHARSET; } - else - { + else { $outputlangs->charset_output = 'ISO-8859-1'; } diff --git a/htdocs/core/modules/export/export_excel2007new.modules.php b/htdocs/core/modules/export/export_excel2007new.modules.php index 779f2240155..a96d51634b0 100644 --- a/htdocs/core/modules/export/export_excel2007new.modules.php +++ b/htdocs/core/modules/export/export_excel2007new.modules.php @@ -274,8 +274,7 @@ class ExportExcel2007new extends ModeleExports { $this->worksheet->write($this->row, $this->col, $outputlangs->transnoentities($alias), $formatheader); } - else - { + else { $this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, $outputlangs->transnoentities($alias)); if (!empty($array_types[$code]) && in_array($array_types[$code], array('Date', 'Numeric', 'TextAuto'))) // Set autowidth for some types { @@ -333,8 +332,7 @@ class ExportExcel2007new extends ModeleExports { $newvalue = $outputlangs->transnoentities($reg[1]); } - else - { + else { $newvalue = $outputlangs->convToOutputCharset($newvalue); } @@ -352,8 +350,7 @@ class ExportExcel2007new extends ModeleExports $coord = $this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row + 1)->getCoordinate(); $this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('yyyy-mm-dd h:mm:ss'); } - else - { + else { if ($typefield == 'Text' || $typefield == 'TextAuto') { //$this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row+1)->setValueExplicit($newvalue, PHPExcel_Cell_DataType::TYPE_STRING); @@ -362,8 +359,7 @@ class ExportExcel2007new extends ModeleExports $this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('@'); $this->workbook->getActiveSheet()->getStyle($coord)->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT); } - else - { + else { $this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, $newvalue); } } diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index acbebd54da8..a25f07384a3 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -137,8 +137,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -280,8 +279,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -410,7 +408,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -421,8 +419,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures } } // Replace tags of lines - try - { + try { $foundtagforlines = 1; try { $listlines = $odfHandler->setSegment('lines'); @@ -446,8 +443,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -519,8 +515,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index cf91ec4806c..ea5376981a4 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -184,8 +184,7 @@ class pdf_crabe extends ModelePDFFactures $this->posxqty = 135; $this->posxunit = 151; } - else - { + else { $this->posxtva = 110; $this->posxup = 126; $this->posxqty = 145; @@ -288,8 +287,7 @@ class pdf_crabe extends ModelePDFFactures $dir = $conf->facture->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->facture->dir_output."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -518,8 +516,7 @@ class pdf_crabe extends ModelePDFFactures // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -556,18 +553,16 @@ class pdf_crabe extends ModelePDFFactures $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -701,8 +696,7 @@ class pdf_crabe extends ModelePDFFactures { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -717,8 +711,7 @@ class pdf_crabe extends ModelePDFFactures { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -736,8 +729,7 @@ class pdf_crabe extends ModelePDFFactures $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -780,14 +772,12 @@ class pdf_crabe extends ModelePDFFactures return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->transnoentities("ErrorConstantNotDefined", "FAC_OUTPUTDIR"); return 0; } @@ -882,8 +872,7 @@ class pdf_crabe extends ModelePDFFactures $i++; } } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -936,8 +925,7 @@ class pdf_crabe extends ModelePDFFactures return $tab3_top + $y + 3; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -1216,8 +1204,7 @@ class pdf_crabe extends ModelePDFFactures { // Nothing to do } - else - { + else { // FIXME amount of vat not supported with multicurrency //Local tax 1 before VAT @@ -1663,16 +1650,14 @@ class pdf_crabe extends ModelePDFFactures $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 8f48f31fddb..acdb6063d5f 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -251,8 +251,7 @@ class pdf_sponge extends ModelePDFFactures $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; } - else - { + else { $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; // default $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative } @@ -272,13 +271,11 @@ class pdf_sponge extends ModelePDFFactures { $filename = $obj['photo_vignette']; } - else - { + else { $filename = $obj['photo']; } } - else - { + else { $filename = $obj['photo']; } @@ -309,8 +306,7 @@ class pdf_sponge extends ModelePDFFactures $dir = $conf->facture->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->facture->dir_output."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -586,8 +582,7 @@ class pdf_sponge extends ModelePDFFactures $tab_height = $tab_height - $height_note; $tab_top = $posyafter + 6; } - else - { + else { $height_note = 0; } @@ -635,8 +630,7 @@ class pdf_sponge extends ModelePDFFactures // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -674,17 +668,15 @@ class pdf_sponge extends ModelePDFFactures $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -849,8 +841,7 @@ class pdf_sponge extends ModelePDFFactures if ($pagenb == $pageposbeforeprintlines) { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code, $outputlangsbis); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code, $outputlangsbis); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -864,8 +855,7 @@ class pdf_sponge extends ModelePDFFactures if ($pagenb == $pageposafter) { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code, $outputlangsbis); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code, $outputlangsbis); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -883,8 +873,7 @@ class pdf_sponge extends ModelePDFFactures $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code, $outputlangsbis); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code, $outputlangsbis); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -927,14 +916,12 @@ class pdf_sponge extends ModelePDFFactures return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->transnoentities("ErrorConstantNotDefined", "FAC_OUTPUTDIR"); return 0; } @@ -1032,8 +1019,7 @@ class pdf_sponge extends ModelePDFFactures $i++; } } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -1075,8 +1061,7 @@ class pdf_sponge extends ModelePDFFactures return $tab3_top + $y + 3; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -1474,8 +1459,7 @@ class pdf_sponge extends ModelePDFFactures { // Nothing to do } - else - { + else { // FIXME amount of vat not supported with multicurrency //Local tax 1 before VAT @@ -1909,16 +1893,14 @@ class pdf_sponge extends ModelePDFFactures $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -2396,8 +2378,7 @@ class pdf_sponge extends ModelePDFFactures { $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys } - else - { + else { $this->cols = $hookmanager->resArray; } } diff --git a/htdocs/core/modules/facture/mod_facture_mars.php b/htdocs/core/modules/facture/mod_facture_mars.php index 6b4b5f0451d..ae349f6f5cb 100644 --- a/htdocs/core/modules/facture/mod_facture_mars.php +++ b/htdocs/core/modules/facture/mod_facture_mars.php @@ -174,8 +174,7 @@ class mod_facture_mars extends ModeleNumRefFactures if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { return -1; } diff --git a/htdocs/core/modules/facture/mod_facture_terre.php b/htdocs/core/modules/facture/mod_facture_terre.php index caa47db3529..c16e751d7db 100644 --- a/htdocs/core/modules/facture/mod_facture_terre.php +++ b/htdocs/core/modules/facture/mod_facture_terre.php @@ -203,8 +203,7 @@ class mod_facture_terre extends ModeleNumRefFactures if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { return -1; } diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index d7509feff7c..a88e3c32bf3 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -186,8 +186,7 @@ class pdf_soleil extends ModelePDFFicheinter $dir = $conf->ficheinter->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->ficheinter->dir_output."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -289,8 +288,7 @@ class pdf_soleil extends ModelePDFFicheinter $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -378,7 +376,7 @@ class pdf_soleil extends ModelePDFFicheinter } } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -404,8 +402,7 @@ class pdf_soleil extends ModelePDFFicheinter { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -420,8 +417,7 @@ class pdf_soleil extends ModelePDFFicheinter { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -440,8 +436,7 @@ class pdf_soleil extends ModelePDFFicheinter $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -470,14 +465,12 @@ class pdf_soleil extends ModelePDFFicheinter return 1; } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "FICHEINTER_OUTPUTDIR"); return 0; } @@ -591,16 +584,14 @@ class pdf_soleil extends ModelePDFFicheinter $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } diff --git a/htdocs/core/modules/fichinter/mod_pacific.php b/htdocs/core/modules/fichinter/mod_pacific.php index b592e65b0d3..5a56b849e5f 100644 --- a/htdocs/core/modules/fichinter/mod_pacific.php +++ b/htdocs/core/modules/fichinter/mod_pacific.php @@ -107,8 +107,7 @@ class mod_pacific extends ModeleNumRefFicheinter { return true; } - else - { + else { $langs->load("errors"); $this->error = $langs->trans('ErrorNumRefModel', $max); return false; diff --git a/htdocs/core/modules/fichinter/modules_fichinter.php b/htdocs/core/modules/fichinter/modules_fichinter.php index 140ce27cf03..b3b5906f683 100644 --- a/htdocs/core/modules/fichinter/modules_fichinter.php +++ b/htdocs/core/modules/fichinter/modules_fichinter.php @@ -179,8 +179,7 @@ function fichinter_create($db, $object, $modele, $outputlangs, $hidedetails = 0, { $modele = $conf->global->FICHEINTER_ADDON_PDF; } - else - { + else { $modele = 'soleil'; } } @@ -235,15 +234,13 @@ function fichinter_create($db, $object, $modele, $outputlangs, $hidedetails = 0, return 1; } - else - { + else { $outputlangs->charset_output = $sav_charset_output; dol_print_error($db, "fichinter_pdf_create Error: ".$obj->error); return 0; } } - else - { + else { print $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists", $file); return 0; } diff --git a/htdocs/core/modules/holiday/mod_holiday_madonna.php b/htdocs/core/modules/holiday/mod_holiday_madonna.php index 3de92c4a05e..90c419bd260 100644 --- a/htdocs/core/modules/holiday/mod_holiday_madonna.php +++ b/htdocs/core/modules/holiday/mod_holiday_madonna.php @@ -140,8 +140,7 @@ class mod_holiday_madonna extends ModelNumRefHolidays if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog("mod_holiday_madonna::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index de32e84d43a..2e8d1d80097 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -199,8 +199,7 @@ class ImportCsv extends ModeleImports $this->error = $langs->trans("ErrorFailToOpenFile", $file); $ret = -1; } - else - { + else { $this->file = $file; } @@ -265,21 +264,19 @@ class ImportCsv extends ModeleImports $newarrayres[$key]['val'] = $val; $newarrayres[$key]['type'] = (dol_strlen($val) ? 1 : -1); // If empty we considere it's null } - else - { + else { $newarrayres[$key]['val'] = utf8_encode($val); $newarrayres[$key]['type'] = (dol_strlen($val) ? 1 : -1); // If empty we considere it's null } } - else // Autodetect format (UTF8 or ISO) + else // Autodetect format (UTF8 or ISO) { if (utf8_check($val)) { $newarrayres[$key]['val'] = $val; $newarrayres[$key]['type'] = (dol_strlen($val) ? 1 : -1); // If empty we considere it's null } - else - { + else { $newarrayres[$key]['val'] = utf8_encode($val); $newarrayres[$key]['type'] = (dol_strlen($val) ? 1 : -1); // If empty we considere it's null } @@ -347,8 +344,7 @@ class ImportCsv extends ModeleImports $this->warnings[$warning]['type'] = 'EMPTY'; $warning++; } - else - { + else { $last_insert_id_array = array(); // store the last inserted auto_increment id for each table, so that dependent tables can be inserted with the appropriate id (eg: extrafields fk_object will be set with the last inserted object's id) $updatedone = false; $insertdone = false; @@ -375,8 +371,7 @@ class ImportCsv extends ModeleImports } else dol_print_error($this->db); } - else - { + else { //dol_syslog("Table ".$tablename." check for entity into cache is ".$tablewithentity_cache[$tablename]); } @@ -411,8 +406,7 @@ class ImportCsv extends ModeleImports $error++; } // Test format only if field is not a missing mandatory field (field may be a value or empty but not mandatory) - else - { + else { // We convert field if required if (!empty($objimport->array_import_convertvalue[0][$val])) { @@ -438,8 +432,7 @@ class ImportCsv extends ModeleImports { $newval = $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval]; } - else - { + else { $resultload = dol_include_once($file); if (empty($resultload)) { @@ -478,8 +471,7 @@ class ImportCsv extends ModeleImports { $newval = $classinstance->id; } - else - { + else { if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) $this->errors[$error]['lib'] = $langs->trans('ErrorFieldRefNotIn', $key, $newval, $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['element'])); else $this->errors[$error]['lib'] = 'ErrorBadDefinitionOfImportProfile'; @@ -542,8 +534,7 @@ class ImportCsv extends ModeleImports { $newval = $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$units][$newval]; } - else - { + else { $resultload = dol_include_once($file); if (empty($resultload)) { @@ -560,8 +551,7 @@ class ImportCsv extends ModeleImports { $newval = $scaleorid ? $scaleorid : 0; } - else - { + else { if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'scale', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); else $this->errors[$error]['lib'] = 'ErrorFieldValueNotIn'; $this->errors[$error]['type'] = 'FOREIGNKEY'; @@ -688,8 +678,7 @@ class ImportCsv extends ModeleImports $i++; } } - else - { + else { dol_print_error($this->db); } } @@ -761,8 +750,7 @@ class ImportCsv extends ModeleImports $listfields[] = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $key); $listvalues[] = "'".$tmp[1]."'"; } - else - { + else { $this->errors[$error]['lib'] = 'Bad value of profile setup '.$val.' for array_import_fieldshidden'; $this->errors[$error]['type'] = 'Import profile setup'; $error++; @@ -812,8 +800,7 @@ class ImportCsv extends ModeleImports // No record found with filters, insert will be tried below } } - else - { + else { //print 'E'; $this->errors[$error]['lib'] = $this->db->lasterror(); $this->errors[$error]['type'] = 'SQL'; @@ -841,8 +828,7 @@ class ImportCsv extends ModeleImports $lastinsertid = 0; } } - else - { + else { //print 'E'; $this->errors[$error]['lib'] = $this->db->lasterror(); $this->errors[$error]['type'] = 'SQL'; @@ -872,8 +858,7 @@ class ImportCsv extends ModeleImports // No error, update has been done. $this->db->db->affected_rows can be 0 if data hasn't changed $updatedone = true; } - else - { + else { //print 'E'; $this->errors[$error]['lib'] = $this->db->lasterror(); $this->errors[$error]['type'] = 'SQL'; @@ -907,8 +892,7 @@ class ImportCsv extends ModeleImports $last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that child tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in Dolibarr). $insertdone = true; } - else - { + else { //print 'E'; $this->errors[$error]['lib'] = $this->db->lasterror(); $this->errors[$error]['type'] = 'SQL'; diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 35aee35869e..dc5bac9568c 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -375,8 +375,7 @@ class ImportXlsx extends ModeleImports $this->warnings[$warning]['type'] = 'EMPTY'; $warning++; } - else - { + else { $last_insert_id_array = array(); // store the last inserted auto_increment id for each table, so that dependent tables can be inserted with the appropriate id (eg: extrafields fk_object will be set with the last inserted object's id) $updatedone = false; $insertdone = false; @@ -403,8 +402,7 @@ class ImportXlsx extends ModeleImports } else dol_print_error($this->db); } - else - { + else { //dol_syslog("Table ".$tablename." check for entity into cache is ".$tablewithentity_cache[$tablename]); } @@ -439,8 +437,7 @@ class ImportXlsx extends ModeleImports $error++; } // Test format only if field is not a missing mandatory field (field may be a value or empty but not mandatory) - else - { + else { // We convert field if required if (!empty($objimport->array_import_convertvalue[0][$val])) { @@ -465,8 +462,7 @@ class ImportXlsx extends ModeleImports { $newval = $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval]; } - else - { + else { $resultload = dol_include_once($file); if (empty($resultload)) { @@ -505,8 +501,7 @@ class ImportXlsx extends ModeleImports { $newval = $classinstance->id; } - else - { + else { if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) $this->errors[$error]['lib'] = $langs->trans('ErrorFieldRefNotIn', $key, $newval, $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['element'])); else $this->errors[$error]['lib'] = 'ErrorBadDefinitionOfImportProfile'; @@ -569,8 +564,7 @@ class ImportXlsx extends ModeleImports { $newval = $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$units][$newval]; } - else - { + else { $resultload = dol_include_once($file); if (empty($resultload)) { @@ -587,8 +581,7 @@ class ImportXlsx extends ModeleImports { $newval = $scaleorid ? $scaleorid : 0; } - else - { + else { if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'scale', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); else $this->errors[$error]['lib'] = 'ErrorFieldValueNotIn'; $this->errors[$error]['type'] = 'FOREIGNKEY'; @@ -715,8 +708,7 @@ class ImportXlsx extends ModeleImports $i++; } } - else - { + else { dol_print_error($this->db); } } @@ -752,7 +744,7 @@ class ImportXlsx extends ModeleImports // Note: arrayrecord (and 'type') is filled with ->import_read_record called by import.php page before calling import_insert if (empty($newval) && $arrayrecord[($key - 1)]['type'] < 0) $listvalues[] = ($newval == '0' ? $newval : "null"); elseif (empty($newval) && $arrayrecord[($key - 1)]['type'] == 0) $listvalues[] = "''"; - else $listvalues[] = "'".$this->db->escape($newval)."'"; + else $listvalues[] = "'".$this->db->escape($newval)."'"; } $i++; } @@ -784,8 +776,7 @@ class ImportXlsx extends ModeleImports $listfields[] = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $key); $listvalues[] = "'".$tmp[1]."'"; } - else - { + else { $this->errors[$error]['lib'] = 'Bad value of profile setup '.$val.' for array_import_fieldshidden'; $this->errors[$error]['type'] = 'Import profile setup'; $error++; @@ -834,8 +825,7 @@ class ImportXlsx extends ModeleImports // No record found with filters, insert will be tried below } } - else - { + else { //print 'E'; $this->errors[$error]['lib'] = $this->db->lasterror(); $this->errors[$error]['type'] = 'SQL'; @@ -863,8 +853,7 @@ class ImportXlsx extends ModeleImports $lastinsertid = 0; } } - else - { + else { //print 'E'; $this->errors[$error]['lib'] = $this->db->lasterror(); $this->errors[$error]['type'] = 'SQL'; @@ -894,8 +883,7 @@ class ImportXlsx extends ModeleImports // No error, update has been done. $this->db->db->affected_rows can be 0 if data hasn't changed $updatedone = true; } - else - { + else { //print 'E'; $this->errors[$error]['lib'] = $this->db->lasterror(); $this->errors[$error]['type'] = 'SQL'; @@ -929,8 +917,7 @@ class ImportXlsx extends ModeleImports $last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that child tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in Dolibarr). $insertdone = true; } - else - { + else { //print 'E'; $this->errors[$error]['lib'] = $this->db->lasterror(); $this->errors[$error]['type'] = 'SQL'; diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php index cda16561f8d..2a1b79bf4f3 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -205,8 +205,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $dir = $conf->expedition->dir_output."/receipt"; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->expedition->dir_output."/receipt/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -358,8 +357,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -404,17 +402,15 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -490,8 +486,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -506,8 +501,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -525,8 +519,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -627,8 +620,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } @@ -775,8 +767,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); @@ -799,8 +790,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder { $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->date_delivery, "%d %b %Y", false, $outputlangs, true), '', 'R'); } - else - { + else { $pdf->SetTextColor(255, 0, 0); $pdf->MultiCell(100, 4, $outputlangs->transnoentities("DeliveryNotValidated"), '', 'R'); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/livraison/mod_livraison_jade.php b/htdocs/core/modules/livraison/mod_livraison_jade.php index 840b6a6f0a6..599a33578f5 100644 --- a/htdocs/core/modules/livraison/mod_livraison_jade.php +++ b/htdocs/core/modules/livraison/mod_livraison_jade.php @@ -143,8 +143,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { return -1; } diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index 464c657fa7b..858e44693b4 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -114,8 +114,7 @@ class mailing_advthirdparties extends MailingTargets $i++; } } - else - { + else { dol_syslog($this->db->error()); $this->error = $this->db->error(); return -1; @@ -169,8 +168,7 @@ class mailing_advthirdparties extends MailingTargets $i++; } } - else - { + else { dol_syslog($this->db->error()); $this->error = $this->db->error(); return -1; @@ -273,8 +271,7 @@ class mailing_advthirdparties extends MailingTargets $i++; } } - else - { + else { dol_print_error($this->db); } diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 9d7a23ce9fd..1a4570df63f 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -191,8 +191,7 @@ class mailing_contacts1 extends MailingTargets $i++; } } - else - { + else { $s .= ''; } } @@ -266,8 +265,7 @@ class mailing_contacts1 extends MailingTargets $i++; } } - else - { + else { $s .= ''; } } @@ -308,8 +306,7 @@ class mailing_contacts1 extends MailingTargets $i++; } } - else - { + else { $s .= ''; } } @@ -448,8 +445,7 @@ class mailing_contacts1 extends MailingTargets $i++; } } - else - { + else { dol_syslog($this->db->error()); $this->error = $this->db->error(); return -1; diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index 8a504ff28b5..e94fe57aa3b 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -155,8 +155,7 @@ class mailing_fraise extends MailingTargets $i++; } } - else - { + else { dol_print_error($this->db); } @@ -194,8 +193,7 @@ class mailing_fraise extends MailingTargets $i++; } } - else - { + else { dol_print_error($this->db); } @@ -314,8 +312,7 @@ class mailing_fraise extends MailingTargets $i++; } } - else - { + else { dol_syslog($this->db->error()); $this->error = $this->db->error(); return -1; diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php index ffba2571d23..9c042de1112 100644 --- a/htdocs/core/modules/mailings/modules_mailings.php +++ b/htdocs/core/modules/mailings/modules_mailings.php @@ -99,8 +99,7 @@ class MailingTargets // This can't be abstract as it is used for some method $obj = $this->db->fetch_object($result); return $obj->nb; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -193,8 +192,7 @@ class MailingTargets // This can't be abstract as it is used for some method { $j++; } - else - { + else { if ($this->db->errno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') { // Si erreur autre que doublon diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php index aa3e9bbc703..1f80623bece 100644 --- a/htdocs/core/modules/mailings/pomme.modules.php +++ b/htdocs/core/modules/mailings/pomme.modules.php @@ -214,8 +214,7 @@ class mailing_pomme extends MailingTargets $i++; } } - else - { + else { dol_syslog($this->db->error()); $this->error = $this->db->error(); return -1; diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 05e9f4f12c4..4773203e5ad 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -80,8 +80,7 @@ class mailing_thirdparties extends MailingTargets $sql .= " AND s.entity IN (".getEntity('societe').")"; $sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; } - else - { + else { $addFilter = ""; if (isset($_POST["filter_client"]) && $_POST["filter_client"] <> '-1') { @@ -103,8 +102,7 @@ class mailing_thirdparties extends MailingTargets { $addDescription .= $langs->trans('ProspectCustomer'); } - else - { + else { $addDescription .= "Unknown status ".$_POST["filter_client"]; } } @@ -120,8 +118,7 @@ class mailing_thirdparties extends MailingTargets $addFilter .= " AND s.status=1"; $addDescription .= $langs->trans("Enabled"); } - else - { + else { $addFilter .= " AND s.status=0"; $addDescription .= $langs->trans("Disabled"); } @@ -187,8 +184,7 @@ class mailing_thirdparties extends MailingTargets $i++; } } - else - { + else { dol_syslog($this->db->error()); $this->error = $this->db->error(); return -1; @@ -286,8 +282,7 @@ class mailing_thirdparties extends MailingTargets $i++; } } - else - { + else { dol_print_error($this->db); } diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index 866712d4bb0..1c76a924883 100644 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -74,8 +74,7 @@ class mailing_thirdparties_services_expired extends MailingTargets $this->arrayofproducts[$i] = $obj->ref; } } - else - { + else { dol_print_error($this->db); } } @@ -154,8 +153,7 @@ class mailing_thirdparties_services_expired extends MailingTargets $i++; } } - else - { + else { dol_syslog($this->db->lasterror()); $this->error = $this->db->lasterror(); return -1; diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php index 9d08cb3565d..040baddd7c2 100644 --- a/htdocs/core/modules/mailings/xinputfile.modules.php +++ b/htdocs/core/modules/mailings/xinputfile.modules.php @@ -180,8 +180,7 @@ class mailing_xinputfile extends MailingTargets $j++; } } - else - { + else { $i++; $langs->load("errors"); $msg = $langs->trans("ErrorFoundBadEmailInFile", $i, $cpt, $email); @@ -197,16 +196,14 @@ class mailing_xinputfile extends MailingTargets return -$i; } } - else - { + else { $this->error = $langs->trans("ErrorFaildToOpenFile"); return -1; } dol_syslog(get_class($this)."::add_to_target mailing ".$cpt." targets found"); } - else - { + else { $langs->load("errors"); if ($resupload < 0) // Unknown error { @@ -216,7 +213,7 @@ class mailing_xinputfile extends MailingTargets { $this->error = '
'.$langs->trans("ErrorFileIsInfectedWithAVirus").'
'; } - else // Known error + else // Known error { $this->error = '
'.$langs->trans($resupload).'
'; } diff --git a/htdocs/core/modules/mailings/xinputuser.modules.php b/htdocs/core/modules/mailings/xinputuser.modules.php index 0875b02ed56..56bbaa58137 100644 --- a/htdocs/core/modules/mailings/xinputuser.modules.php +++ b/htdocs/core/modules/mailings/xinputuser.modules.php @@ -149,15 +149,13 @@ class mailing_xinputuser extends MailingTargets return parent::addTargetsToDatabase($mailing_id, $cibles); } - else - { + else { $langs->load("errors"); $this->error = $langs->trans("ErrorBadEMail", $email); return -1; } } - else - { + else { $langs->load("errors"); $this->error = $langs->trans("ErrorBadEmail", $email); return -1; diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index 1582b1c1c34..e586de52b38 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -166,8 +166,7 @@ class pdf_standard extends CommonStickerGenerator // Output left area if ($textleft == '__LOGO__' && $logo) $pdf->Image($logo, $_PosX + $xleft, $_PosY + $ytop, $widthtouse, $heighttouse); elseif ($textleft == '__PHOTO__' && $photo) $pdf->Image($photo, $_PosX + $xleft, $_PosY + $ytop, $widthtouse, $heighttouse); - else - { + else { $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop); $pdf->MultiCell($this->_Width, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L'); } @@ -188,7 +187,7 @@ class pdf_standard extends CommonStickerGenerator $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop); $pdf->MultiCell($this->_Width - $widthtouse - $xleft - $xleft - 1, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L'); } - else // text on halft left and text on half right + else // text on halft left and text on half right { $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop); $pdf->MultiCell(round($this->_Width / 2), $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L'); @@ -196,13 +195,12 @@ class pdf_standard extends CommonStickerGenerator $pdf->MultiCell(round($this->_Width / 2) - 2, $this->_Line_Height, $outputlangs->convToOutputCharset($textright), 0, 'R'); } } - else // Only a right part + else // Only a right part { // Output right area if ($textright == '__LOGO__' && $logo) $pdf->Image($logo, $_PosX + $this->_Width - $widthtouse - $xleft, $_PosY + $ytop, $widthtouse, $heighttouse); elseif ($textright == '__PHOTO__' && $photo) $pdf->Image($photo, $_PosX + $this->_Width - $widthtouse - $xleft, $_PosY + $ytop, $widthtouse, $heighttouse); - else - { + else { $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop); $pdf->MultiCell($this->_Width - $xleft, $this->_Line_Height, $outputlangs->convToOutputCharset($textright), 0, 'R'); } @@ -306,8 +304,7 @@ class pdf_standard extends CommonStickerGenerator $arrayofrecords = $arrayofmembers; } - else - { + else { $arrayofrecords = $object; } @@ -337,8 +334,7 @@ class pdf_standard extends CommonStickerGenerator $title = $outputlangs->transnoentities('MembersCards'); $keywords = $outputlangs->transnoentities('MembersCards')." ".$outputlangs->transnoentities("Foundation")." ".$outputlangs->convToOutputCharset($mysoc->name); } - else - { + else { dol_print_error('', 'Bad value for $mode'); return -1; } @@ -350,8 +346,7 @@ class pdf_standard extends CommonStickerGenerator $dir = $outputdir."/".get_exdir(0, 0, 0, 0, $object, 'member'); $file = $dir.'/'.$filename; } - else - { + else { $outputdir = $conf->adherent->dir_temp; $dir = $outputdir; $file = $dir.'/'.$filename; diff --git a/htdocs/core/modules/member/modules_cards.php b/htdocs/core/modules/member/modules_cards.php index f9bdd58af24..5f2f7f8b8ae 100644 --- a/htdocs/core/modules/member/modules_cards.php +++ b/htdocs/core/modules/member/modules_cards.php @@ -100,8 +100,7 @@ function members_card_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $o { $code = $conf->global->ADHERENT_CARDS_ADDON_PDF; } - else - { + else { $code = $modele; } } @@ -154,16 +153,14 @@ function members_card_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $o $outputlangs->charset_output = $sav_charset_output; return 1; } - else - { + else { $outputlangs->charset_output = $sav_charset_output; dol_print_error($db, "members_card_pdf_create Error: ".$obj->error); return -1; } } - else - { + else { dol_print_error('', $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists", $file)); return -1; } diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 2184500db8c..04283daf8b4 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -98,8 +98,7 @@ class modAgenda extends DolibarrModules $this->const[] = array('MAIN_AGENDA_ACTIONAUTO_'.$obj->code, "chaine", "1", '', 0, 'current'); } } - else - { + else { dol_print_error($this->db->lasterror()); } diff --git a/htdocs/core/modules/modBlockedLog.class.php b/htdocs/core/modules/modBlockedLog.class.php index 5b645747380..4527b620074 100644 --- a/htdocs/core/modules/modBlockedLog.class.php +++ b/htdocs/core/modules/modBlockedLog.class.php @@ -234,8 +234,7 @@ class modBlockedLog extends DolibarrModules { $res = $b->create($user, '0000000000'); // If already used for something else than SET or UNSET, we log with error } - else - { + else { $res = $b->create($user); } if ($res <= 0) { diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php index e276fe1f5f7..ec0b497e7cd 100644 --- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php +++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php @@ -137,8 +137,7 @@ class doc_generic_mo_odt extends ModelePDFMo unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -275,8 +274,7 @@ class doc_generic_mo_odt extends ModelePDFMo if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -309,8 +307,7 @@ class doc_generic_mo_odt extends ModelePDFMo $contactobject = $object->contact; } } - else - { + else { $socobject = $object->thirdparty; } @@ -393,7 +390,7 @@ class doc_generic_mo_odt extends ModelePDFMo if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -404,8 +401,7 @@ class doc_generic_mo_odt extends ModelePDFMo } } // Replace tags of lines - try - { + try { $foundtagforlines = 1; try { $listlines = $odfHandler->setSegment('lines'); @@ -429,8 +425,7 @@ class doc_generic_mo_odt extends ModelePDFMo $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -504,8 +499,7 @@ class doc_generic_mo_odt extends ModelePDFMo return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/mrp/mod_mo_standard.php b/htdocs/core/modules/mrp/mod_mo_standard.php index 3fd3b1ad87e..8b0edd9c129 100644 --- a/htdocs/core/modules/mrp/mod_mo_standard.php +++ b/htdocs/core/modules/mrp/mod_mo_standard.php @@ -130,8 +130,7 @@ class mod_mo_standard extends ModeleNumRefMos if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog("mod_mo_standard::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/oauth/github_oauthcallback.php b/htdocs/core/modules/oauth/github_oauthcallback.php index 4320481abb1..766d615f884 100644 --- a/htdocs/core/modules/oauth/github_oauthcallback.php +++ b/htdocs/core/modules/oauth/github_oauthcallback.php @@ -153,8 +153,7 @@ else // If entry on page with no parameter, we arrive here { $url = $apiService->getAuthorizationUri(array('state'=>GETPOST('state'))); } - else - { + else { $url = $apiService->getAuthorizationUri(); // Parameter state will be randomly generated } diff --git a/htdocs/core/modules/oauth/google_oauthcallback.php b/htdocs/core/modules/oauth/google_oauthcallback.php index 68aba389f31..0af4113fb0a 100644 --- a/htdocs/core/modules/oauth/google_oauthcallback.php +++ b/htdocs/core/modules/oauth/google_oauthcallback.php @@ -151,8 +151,7 @@ else // If entry on page with no parameter, we arrive here { $url = $apiService->getAuthorizationUri(array('state'=>GETPOST('state'))); } - else - { + else { $url = $apiService->getAuthorizationUri(); // Parameter state will be randomly generated } diff --git a/htdocs/core/modules/oauth/stripelive_oauthcallback.php b/htdocs/core/modules/oauth/stripelive_oauthcallback.php index b2ff4165563..8be1be11cc8 100644 --- a/htdocs/core/modules/oauth/stripelive_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripelive_oauthcallback.php @@ -157,8 +157,7 @@ else // If entry on page with no parameter, we arrive here { $url = $apiService->getAuthorizationUri(array('state'=>GETPOST('state'))); } - else - { + else { //$url = $apiService->getAuthorizationUri(); // Parameter state will be randomly generated //https://connect.stripe.com/oauth/authorize?response_type=code&client_id=ca_AX27ut70tJ1j6eyFCV3ObEXhNOo2jY6V&scope=read_write $url = 'https://connect.stripe.com/oauth/authorize?response_type=code&client_id='.$conf->global->OAUTH_STRIPE_LIVE_ID.'&scope=read_write'; diff --git a/htdocs/core/modules/oauth/stripetest_oauthcallback.php b/htdocs/core/modules/oauth/stripetest_oauthcallback.php index 925a55c7ca1..4374f65746e 100644 --- a/htdocs/core/modules/oauth/stripetest_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripetest_oauthcallback.php @@ -157,8 +157,7 @@ else // If entry on page with no parameter, we arrive here { $url = $apiService->getAuthorizationUri(array('state'=>GETPOST('state'))); } - else - { + else { //$url = $apiService->getAuthorizationUri(); // Parameter state will be randomly generated //https://connect.stripe.com/oauth/authorize?response_type=code&client_id=ca_AX27ut70tJ1j6eyFCV3ObEXhNOo2jY6V&scope=read_write $url = 'https://connect.stripe.com/oauth/authorize?response_type=code&client_id='.$conf->global->OAUTH_STRIPE_TEST_ID.'&scope=read_write'; diff --git a/htdocs/core/modules/payment/mod_payment_cicada.php b/htdocs/core/modules/payment/mod_payment_cicada.php index 5650ad43707..b9909d64fea 100644 --- a/htdocs/core/modules/payment/mod_payment_cicada.php +++ b/htdocs/core/modules/payment/mod_payment_cicada.php @@ -137,8 +137,7 @@ class mod_payment_cicada extends ModeleNumRefPayments if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog(__METHOD__, LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index 1a225518518..90f3825d007 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -157,8 +157,7 @@ class printing_printgcp extends PrintingDriver { $expiredat = $langs->trans("Unknown"); } - else - { + else { $expiredat = dol_print_date($endoflife, "dayhour"); } @@ -220,8 +219,7 @@ class printing_printgcp extends PrintingDriver { $html .= img_picto($langs->trans("Default"), 'on'); } - else - $html .= ''.img_picto($langs->trans("Disabled"), 'off').''; + else $html .= ''.img_picto($langs->trans("Disabled"), 'off').''; $html .= ''; $html .= ''."\n"; } @@ -326,14 +324,12 @@ class printing_printgcp extends PrintingDriver { $printer_id = $obj->printer_id; } - else - { + else { if (!empty($conf->global->PRINTING_GCP_DEFAULT)) { $printer_id = $conf->global->PRINTING_GCP_DEFAULT; } - else - { + else { $this->errors[] = 'NoDefaultPrinterDefined'; $error++; return $error; @@ -507,8 +503,7 @@ class printing_printgcp extends PrintingDriver $html .= ''; } } - else - { + else { $html .= ''; $html .= ''.$langs->trans("None").''; $html .= ''; diff --git a/htdocs/core/modules/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php index 5a3d2481c6d..a305b648cfe 100644 --- a/htdocs/core/modules/printing/printipp.modules.php +++ b/htdocs/core/modules/printing/printipp.modules.php @@ -116,15 +116,13 @@ class printing_printipp extends PrintingDriver dol_syslog("Found a default printer for user ".$user->id." = ".$obj->printer_id); $ipp->setPrinterURI($obj->printer_id); } - else - { + else { if (!empty($conf->global->PRINTIPP_URI_DEFAULT)) { dol_syslog("Will use default printer conf->global->PRINTIPP_URI_DEFAULT = ".$conf->global->PRINTIPP_URI_DEFAULT); $ipp->setPrinterURI($conf->global->PRINTIPP_URI_DEFAULT); } - else - { + else { $this->errors[] = 'NoDefaultPrinterDefined'; $error++; return $error; diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index f85984ab9bd..9155baa8aac 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -153,8 +153,7 @@ class pdf_standardlabel extends CommonStickerGenerator // Output left area if ($textleft == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX + $xleft, $_PosY + $ytop, $widthtouse, $heighttouse); elseif ($textleft == '%PHOTO%' && $photo) $pdf->Image($photo, $_PosX + $xleft, $_PosY + $ytop, $widthtouse, $heighttouse); - else - { + else { $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop); $pdf->MultiCell($this->_Width, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L'); } @@ -175,7 +174,7 @@ class pdf_standardlabel extends CommonStickerGenerator $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop); $pdf->MultiCell($this->_Width - $widthtouse - $xleft - $xleft - 1, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L'); } - else // text on halft left and text on half right + else // text on halft left and text on half right { $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop); $pdf->MultiCell(round($this->_Width / 2), $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L'); @@ -183,13 +182,12 @@ class pdf_standardlabel extends CommonStickerGenerator $pdf->MultiCell(round($this->_Width / 2) - 2, $this->_Line_Height, $outputlangs->convToOutputCharset($textright), 0, 'R'); } } - else // Only a right part + else // Only a right part { // Output right area if ($textright == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX + $this->_Width - $widthtouse - $xleft, $_PosY + $ytop, $widthtouse, $heighttouse); elseif ($textright == '%PHOTO%' && $photo) $pdf->Image($photo, $_PosX + $this->_Width - $widthtouse - $xleft, $_PosY + $ytop, $widthtouse, $heighttouse); - else - { + else { $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop); $pdf->MultiCell($this->_Width - $xleft, $this->_Line_Height, $outputlangs->convToOutputCharset($textright), 0, 'R'); } diff --git a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php index 568d850765f..3a877049a26 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php @@ -167,8 +167,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator { $this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX + $xleft, $_PosY + $ytop, $widthtouse, $heighttouse); } - else - { + else { $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop); $pdf->MultiCell($this->_Width, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L'); } @@ -219,7 +218,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator $pdf->MultiCell($widthtouse - $logoWidth - 1, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L'); } } - else // text on halft left and text on half right + else // text on halft left and text on half right { $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop); $pdf->MultiCell(round($this->_Width / 2), $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L'); @@ -227,7 +226,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator $pdf->MultiCell(round($this->_Width / 2) - 2, $this->_Line_Height, $outputlangs->convToOutputCharset($textright), 0, 'R'); } } - else // Only a right part + else // Only a right part { // Output right area if ($textright == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX + $this->_Width - $widthtouse - $xleft, $_PosY + $ytop, 0, $logoHeight); @@ -235,8 +234,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator { $this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX + $this->_Width - $widthtouse - $xleft, $_PosY + $ytop, $widthtouse, $heighttouse); } - else - { + else { $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop); $pdf->MultiCell($this->_Width - $xleft, $this->_Line_Height, $outputlangs->convToOutputCharset($textright), 0, 'R'); } diff --git a/htdocs/core/modules/printsheet/modules_labels.php b/htdocs/core/modules/printsheet/modules_labels.php index f99ddafc4b8..ddf6d73a2a3 100644 --- a/htdocs/core/modules/printsheet/modules_labels.php +++ b/htdocs/core/modules/printsheet/modules_labels.php @@ -101,8 +101,7 @@ function doc_label_pdf_create($db, $arrayofrecords, $modele, $outputlangs, $outp { $code = $conf->global->ADHERENT_ETIQUETTE_TYPE; } - else - { + else { $code = $modele; } } @@ -156,15 +155,13 @@ function doc_label_pdf_create($db, $arrayofrecords, $modele, $outputlangs, $outp $outputlangs->charset_output = $sav_charset_output; return 1; } - else - { + else { $outputlangs->charset_output = $sav_charset_output; dol_print_error($db, "doc_label_pdf_create Error: ".$obj->error); return -1; } } - else - { + else { dol_print_error('', $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists", $file)); return -1; } diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index c0fa4d0f6eb..3965bd1be5d 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -141,8 +141,7 @@ class doc_generic_product_odt extends ModelePDFProduct unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -294,8 +293,7 @@ class doc_generic_product_odt extends ModelePDFProduct if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -329,8 +327,7 @@ class doc_generic_product_odt extends ModelePDFProduct $contactobject = $object->contact; } } - else - { + else { $socobject = $object->thirdparty; } // Make substitution @@ -417,7 +414,7 @@ class doc_generic_product_odt extends ModelePDFProduct if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -428,8 +425,7 @@ class doc_generic_product_odt extends ModelePDFProduct } } // Replace tags of lines - try - { + try { $listlines = $odfHandler->setSegment('supplierprices'); if (!empty($object->supplierprices)) { foreach ($object->supplierprices as $supplierprice) @@ -441,8 +437,7 @@ class doc_generic_product_odt extends ModelePDFProduct $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($array_lines as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -514,8 +509,7 @@ class doc_generic_product_odt extends ModelePDFProduct return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index cbe618b488f..20c3ba9c087 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -182,8 +182,7 @@ class pdf_standard extends ModelePDFProduct $dir = $conf->product->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->product->dir_output."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -335,8 +334,7 @@ class pdf_standard extends ModelePDFProduct $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -574,14 +572,12 @@ class pdf_standard extends ModelePDFProduct return 1; // No error } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "PRODUCT_OUTPUTDIR"); return 0; } @@ -741,16 +737,14 @@ class pdf_standard extends ModelePDFProduct $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } diff --git a/htdocs/core/modules/product/mod_codeproduct_elephant.php b/htdocs/core/modules/product/mod_codeproduct_elephant.php index ba6329004e3..dc6d7bfd6ef 100644 --- a/htdocs/core/modules/product/mod_codeproduct_elephant.php +++ b/htdocs/core/modules/product/mod_codeproduct_elephant.php @@ -280,8 +280,7 @@ class mod_codeproduct_elephant extends ModeleProductCode { $result = -2; } - else - { + else { // Get Mask value $mask = ''; if ($type == 0) $mask = empty($conf->global->PRODUCT_ELEPHANT_MASK_PRODUCT) ? '' : $conf->global->PRODUCT_ELEPHANT_MASK_PRODUCT; @@ -328,13 +327,11 @@ class mod_codeproduct_elephant extends ModeleProductCode { return 0; } - else - { + else { return -1; } } - else - { + else { return -2; } } diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php index 80bc9f7ce0a..1ecd734dec2 100644 --- a/htdocs/core/modules/product/modules_product.class.php +++ b/htdocs/core/modules/product/modules_product.class.php @@ -170,8 +170,7 @@ abstract class ModeleProductCode $i++; } } - else - { + else { return -1; } return $liste; diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 542ea728f84..585edee00ee 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -408,8 +408,7 @@ class doc_generic_project_odt extends ModelePDFProjects unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -544,8 +543,7 @@ class doc_generic_project_odt extends ModelePDFProjects if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -636,7 +634,7 @@ class doc_generic_project_odt extends ModelePDFProjects if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -648,8 +646,7 @@ class doc_generic_project_odt extends ModelePDFProjects } // Replace tags of lines for tasks - try - { + try { $listlines = $odfHandler->setSegment('tasks'); $taskstatic = new Task($this->db); @@ -667,8 +664,7 @@ class doc_generic_project_odt extends ModelePDFProjects //complete_substitutions_array($tmparray, $outputlangs, $object, $task, "completesubstitutionarray_lines"); foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -718,8 +714,7 @@ class doc_generic_project_odt extends ModelePDFProjects foreach ($tmparray as $key => $val) { - try - { + try { $listlinestaskres->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -768,8 +763,7 @@ class doc_generic_project_odt extends ModelePDFProjects $tmparray = $this->get_substitutionarray_taskstime($row, $outputlangs); foreach ($tmparray as $key => $val) { - try - { + try { $listlinestasktime->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -808,8 +802,7 @@ class doc_generic_project_odt extends ModelePDFProjects foreach ($tmparray as $key => $val) { - try - { + try { $listlinestasktime->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -841,8 +834,7 @@ class doc_generic_project_odt extends ModelePDFProjects //dol_syslog(get_class($this).'::main $tmparray'.var_export($tmparray,true)); foreach ($tmparray as $key => $val) { - try - { + try { $listtasksfiles->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -873,8 +865,7 @@ class doc_generic_project_odt extends ModelePDFProjects } // Replace tags of project files - try - { + try { $listlines = $odfHandler->setSegment('projectfiles'); $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref); @@ -887,8 +878,7 @@ class doc_generic_project_odt extends ModelePDFProjects foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -923,8 +913,7 @@ class doc_generic_project_odt extends ModelePDFProjects } if ((is_array($contact_arrray) && count($contact_arrray) > 0)) { - try - { + try { $listlines = $odfHandler->setSegment('projectcontacts'); foreach ($contact_arrray as $contact) @@ -946,8 +935,7 @@ class doc_generic_project_odt extends ModelePDFProjects $tmparray = $this->get_substitutionarray_project_contacts($contact, $outputlangs); foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -1084,8 +1072,7 @@ class doc_generic_project_odt extends ModelePDFProjects ); //Insert reference - try - { + try { $listlines = $odfHandler->setSegment('projectrefs'); foreach ($listofreferent as $keyref => $valueref) @@ -1147,8 +1134,7 @@ class doc_generic_project_odt extends ModelePDFProjects foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -1217,8 +1203,7 @@ class doc_generic_project_odt extends ModelePDFProjects return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 59e3f855ebf..53b81ef5419 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -301,8 +301,7 @@ class pdf_baleine extends ModelePDFProjects $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -359,15 +358,13 @@ class pdf_baleine extends ModelePDFProjects $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; $forcedesconsamepage = 1; if ($forcedesconsamepage) @@ -397,7 +394,7 @@ class pdf_baleine extends ModelePDFProjects } //var_dump($i.' '.$posybefore.' '.$posyafter.' '.($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot)).' '.$showpricebeforepagebreak); } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -452,8 +449,7 @@ class pdf_baleine extends ModelePDFProjects { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -468,8 +464,7 @@ class pdf_baleine extends ModelePDFProjects { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -484,8 +479,7 @@ class pdf_baleine extends ModelePDFProjects // Show square if ($pagenb == 1) $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); - else - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); + else $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; // Footer of the page @@ -514,14 +508,12 @@ class pdf_baleine extends ModelePDFProjects return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->transnoentities("ErrorConstantNotDefined", "PROJECT_OUTPUTDIR"); return 0; } @@ -613,8 +605,7 @@ class pdf_baleine extends ModelePDFProjects $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $langs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 4044676461e..0888a029d5b 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -274,8 +274,7 @@ class pdf_beluga extends ModelePDFProjects $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -509,15 +508,13 @@ class pdf_beluga extends ModelePDFProjects $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; $forcedesconsamepage = 1; if ($forcedesconsamepage) @@ -547,7 +544,7 @@ class pdf_beluga extends ModelePDFProjects } //var_dump($i.' '.$posybefore.' '.$posyafter.' '.($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot)).' '.$showpricebeforepagebreak); } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -590,8 +587,7 @@ class pdf_beluga extends ModelePDFProjects $fuser->fetch($element->fk_user_author); $pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $fuser->getFullName($outputlangs), 1, 'L'); } - else - { + else { $pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, (is_object($element->thirdparty) ? $element->thirdparty->name : ''), 1, 'L'); } @@ -608,8 +604,7 @@ class pdf_beluga extends ModelePDFProjects $textforamount = dol_trunc($element->label, 26); $pdf->MultiCell($this->posxstatut - $this->posxamountht, 3, $textforamount, 1, 'L'); } - else - { + else { $pdf->MultiCell($this->posxstatut - $this->posxamountht, 3, "", 1, 'R'); } } @@ -688,14 +683,12 @@ class pdf_beluga extends ModelePDFProjects return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->transnoentities("ErrorConstantNotDefined", "PROJECT_OUTPUTDIR"); return 0; } @@ -787,8 +780,7 @@ class pdf_beluga extends ModelePDFProjects $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $langs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 2a13aa8ab57..0b0190cffd2 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -232,8 +232,7 @@ class pdf_timespent extends ModelePDFProjects $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -290,15 +289,13 @@ class pdf_timespent extends ModelePDFProjects $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; $forcedesconsamepage = 1; if ($forcedesconsamepage) @@ -328,7 +325,7 @@ class pdf_timespent extends ModelePDFProjects } //var_dump($i.' '.$posybefore.' '.$posyafter.' '.($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot)).' '.$showpricebeforepagebreak); } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -383,8 +380,7 @@ class pdf_timespent extends ModelePDFProjects { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -399,8 +395,7 @@ class pdf_timespent extends ModelePDFProjects { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -415,8 +410,7 @@ class pdf_timespent extends ModelePDFProjects // Show square if ($pagenb == 1) $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); - else - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); + else $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; // Pied de page @@ -445,14 +439,12 @@ class pdf_timespent extends ModelePDFProjects return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->transnoentities("ErrorConstantNotDefined", "PROJECT_OUTPUTDIR"); return 0; } @@ -544,8 +536,7 @@ class pdf_timespent extends ModelePDFProjects $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $langs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); diff --git a/htdocs/core/modules/project/mod_project_simple.php b/htdocs/core/modules/project/mod_project_simple.php index 301e226020c..9929dd357cb 100644 --- a/htdocs/core/modules/project/mod_project_simple.php +++ b/htdocs/core/modules/project/mod_project_simple.php @@ -107,8 +107,7 @@ class mod_project_simple extends ModeleNumRefProjects { return true; } - else - { + else { $langs->load("errors"); $this->error = $langs->trans('ErrorNumRefModel', $max); return false; @@ -141,8 +140,7 @@ class mod_project_simple extends ModeleNumRefProjects if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog("mod_project_simple::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 9b7b15a884d..eee9945bb8a 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -377,8 +377,7 @@ class doc_generic_task_odt extends ModelePDFTask unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -565,7 +564,7 @@ class doc_generic_task_odt extends ModelePDFTask if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -575,8 +574,7 @@ class doc_generic_task_odt extends ModelePDFTask } // Replace tags of lines for tasks - try - { + try { // Security check $socid = 0; if (!empty($project->fk_soc)) $socid = $project->fk_soc; @@ -674,8 +672,7 @@ class doc_generic_task_odt extends ModelePDFTask foreach ($tmparray as $key => $val) { - try - { + try { $listlinestasktime->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -709,8 +706,7 @@ class doc_generic_task_odt extends ModelePDFTask //dol_syslog(get_class($this).'::main $tmparray'.var_export($tmparray,true)); foreach ($tmparray as $key => $val) { - try - { + try { $listtasksfiles->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -738,8 +734,7 @@ class doc_generic_task_odt extends ModelePDFTask // Replace tags of project files - try - { + try { $listlines = $odfHandler->setSegment('projectfiles'); $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref); @@ -753,8 +748,7 @@ class doc_generic_task_odt extends ModelePDFTask foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -789,8 +783,7 @@ class doc_generic_task_odt extends ModelePDFTask } if ((is_array($contact_arrray) && count($contact_arrray) > 0)) { - try - { + try { $listlines = $odfHandler->setSegment('projectcontacts'); foreach ($contact_arrray as $contact) @@ -813,8 +806,7 @@ class doc_generic_task_odt extends ModelePDFTask foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -875,8 +867,7 @@ class doc_generic_task_odt extends ModelePDFTask return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/project/task/mod_task_simple.php b/htdocs/core/modules/project/task/mod_task_simple.php index cb186594b84..8a409765526 100644 --- a/htdocs/core/modules/project/task/mod_task_simple.php +++ b/htdocs/core/modules/project/task/mod_task_simple.php @@ -108,8 +108,7 @@ class mod_task_simple extends ModeleNumRefTask { return true; } - else - { + else { $langs->load("errors"); $this->error = $langs->trans('ErrorNumRefModel', $max); return false; @@ -141,8 +140,7 @@ class mod_task_simple extends ModeleNumRefTask if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog("mod_task_simple::getNextValue", LOG_DEBUG); return -1; } 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 33850c5d882..e0bcefbd880 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 @@ -140,8 +140,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -309,8 +308,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -343,8 +341,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales $contactobject = $object->contact; } } - else - { + else { $socobject = $object->thirdparty; } // Make substitution @@ -431,7 +428,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -442,8 +439,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales } } // Replace tags of lines - try - { + try { $foundtagforlines = 1; try { $listlines = $odfHandler->setSegment('lines'); @@ -467,8 +463,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -540,8 +535,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index c285f560678..409df828876 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -173,8 +173,7 @@ class pdf_azur extends ModelePDFPropales $this->posxqty = 135; $this->posxunit = 151; } - else - { + else { $this->posxtva = 110; $this->posxup = 126; $this->posxqty = 145; @@ -245,8 +244,7 @@ class pdf_azur extends ModelePDFPropales $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; } - else - { + else { $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; // default $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative } @@ -270,13 +268,11 @@ class pdf_azur extends ModelePDFPropales { $filename = $obj['photo_vignette']; } - else - { + else { $filename = $obj['photo']; } } - else - { + else { $filename = $obj['photo']; } @@ -304,8 +300,7 @@ class pdf_azur extends ModelePDFPropales $dir = $conf->propal->multidir_output[$conf->entity]; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->propal->multidir_output[$object->entity]."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -509,8 +504,7 @@ class pdf_azur extends ModelePDFPropales // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -548,18 +542,16 @@ class pdf_azur extends ModelePDFPropales $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -677,8 +669,7 @@ class pdf_azur extends ModelePDFPropales { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -693,8 +684,7 @@ class pdf_azur extends ModelePDFPropales { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -712,8 +702,7 @@ class pdf_azur extends ModelePDFPropales $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter, 0, $outputlangs, 0, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter + 1; } @@ -782,8 +771,7 @@ class pdf_azur extends ModelePDFPropales $filetomerge_dir = $conf->service->multidir_output[$entity_product_file].'/'.get_exdir($product->id, 2, 0, 0, $product, 'product').$product->id."/photos"; } } - else - { + else { if (!empty($conf->product->enabled)) { $filetomerge_dir = $conf->product->multidir_output[$entity_product_file].'/'.get_exdir(0, 0, 0, 0, $product, 'product').dol_sanitizeFileName($product->ref); } elseif (!empty($conf->service->enabled)) { @@ -836,14 +824,12 @@ class pdf_azur extends ModelePDFPropales return 1; // No error } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "PROP_OUTPUTDIR"); return 0; } @@ -1101,8 +1087,7 @@ class pdf_azur extends ModelePDFPropales { // Nothing to do } - else - { + else { //Local tax 1 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ @@ -1494,16 +1479,14 @@ class pdf_azur extends ModelePDFPropales $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 1af66ca645e..1490dfe4adc 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -232,8 +232,7 @@ class pdf_cyan extends ModelePDFPropales $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; } - else - { + else { $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; // default $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative } @@ -257,13 +256,11 @@ class pdf_cyan extends ModelePDFPropales { $filename = $obj['photo_vignette']; } - else - { + else { $filename = $obj['photo']; } } - else - { + else { $filename = $obj['photo']; } @@ -292,8 +289,7 @@ class pdf_cyan extends ModelePDFPropales $dir = $conf->propal->multidir_output[$conf->entity]; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->propal->multidir_output[$object->entity]."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -551,8 +547,7 @@ class pdf_cyan extends ModelePDFPropales $tab_height = $tab_height - $height_note; $tab_top = $posyafter + 6; } - else - { + else { $height_note = 0; } @@ -602,8 +597,7 @@ class pdf_cyan extends ModelePDFPropales // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } @@ -644,17 +638,15 @@ class pdf_cyan extends ModelePDFPropales $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -808,8 +800,7 @@ class pdf_cyan extends ModelePDFPropales { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -824,8 +815,7 @@ class pdf_cyan extends ModelePDFPropales { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -843,8 +833,7 @@ class pdf_cyan extends ModelePDFPropales $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter + 1; } @@ -913,8 +902,7 @@ class pdf_cyan extends ModelePDFPropales $filetomerge_dir = $conf->service->multidir_output[$entity_product_file].'/'.get_exdir($product->id, 2, 0, 0, $product, 'product').$product->id."/photos"; } } - else - { + else { if (!empty($conf->product->enabled)) { $filetomerge_dir = $conf->product->multidir_output[$entity_product_file].'/'.get_exdir(0, 0, 0, 0, $product, 'product').dol_sanitizeFileName($product->ref); } elseif (!empty($conf->service->enabled)) { @@ -967,14 +955,12 @@ class pdf_cyan extends ModelePDFPropales return 1; // No error } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "PROP_OUTPUTDIR"); return 0; } @@ -1232,8 +1218,7 @@ class pdf_cyan extends ModelePDFPropales { // Nothing to do } - else - { + else { //Local tax 1 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ @@ -1568,16 +1553,14 @@ class pdf_cyan extends ModelePDFPropales $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -2006,8 +1989,7 @@ class pdf_cyan extends ModelePDFPropales { $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys } - else - { + else { $this->cols = $hookmanager->resArray; } } diff --git a/htdocs/core/modules/propale/mod_propale_marbre.php b/htdocs/core/modules/propale/mod_propale_marbre.php index 4dde423a5e6..d342f9d6a4a 100644 --- a/htdocs/core/modules/propale/mod_propale_marbre.php +++ b/htdocs/core/modules/propale/mod_propale_marbre.php @@ -109,8 +109,7 @@ class mod_propale_marbre extends ModeleNumRefPropales { return true; } - else - { + else { $langs->load("errors"); $this->error = $langs->trans('ErrorNumRefModel', $max); return false; @@ -142,8 +141,7 @@ class mod_propale_marbre extends ModeleNumRefPropales if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 103d0fdffba..4f8c8221e79 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -211,8 +211,7 @@ class pdf_paiement // If global param PAYMENTS_REPORT_GROUP_BY_MOD is set, payement are ordered by paiement_code if (!empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD)) $sql .= " ORDER BY paiement_code ASC, p.datep ASC, pf.fk_paiement ASC"; - else - $sql .= " ORDER BY p.datep ASC, pf.fk_paiement ASC"; + else $sql .= " ORDER BY p.datep ASC, pf.fk_paiement ASC"; break; case "fourn": $sql = "SELECT p.datep as dp, f.ref as ref"; @@ -245,8 +244,7 @@ class pdf_paiement // If global param PAYMENTS_FOURN_REPORT_GROUP_BY_MOD is set, payement fourn are ordered by paiement_code if (!empty($conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD)) $sql .= " ORDER BY paiement_code ASC, p.datep ASC, pf.fk_paiementfourn ASC"; - else - $sql .= " ORDER BY p.datep ASC, pf.fk_paiementfourn ASC"; + else $sql .= " ORDER BY p.datep ASC, pf.fk_paiementfourn ASC"; break; } @@ -274,8 +272,7 @@ class pdf_paiement $i++; } } - else - { + else { dol_print_error($this->db); } diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index 89a532c2556..1a7076095ec 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -132,8 +132,7 @@ class doc_generic_reception_odt extends ModelePdfReception unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -272,8 +271,7 @@ class doc_generic_reception_odt extends ModelePdfReception if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -301,8 +299,7 @@ class doc_generic_reception_odt extends ModelePdfReception if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; else $socobject = $object->thirdparty; } - else - { + else { $socobject = $object->thirdparty; } @@ -371,7 +368,7 @@ class doc_generic_reception_odt extends ModelePdfReception if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -391,7 +388,7 @@ class doc_generic_reception_odt extends ModelePdfReception if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -409,7 +406,7 @@ class doc_generic_reception_odt extends ModelePdfReception if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -431,7 +428,7 @@ class doc_generic_reception_odt extends ModelePdfReception if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -440,8 +437,7 @@ class doc_generic_reception_odt extends ModelePdfReception } } // Replace tags of lines - try - { + try { $listlines = $odfHandler->setSegment('lines'); foreach ($object->lines as $line) { @@ -513,8 +509,7 @@ class doc_generic_reception_odt extends ModelePdfReception return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 25b7b62388f..1901a9fc044 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -149,13 +149,11 @@ class pdf_squille extends ModelePdfReception { $filename = $obj['photo_vignette']; } - else - { + else { $filename = $obj['photo']; } } - else - { + else { $filename = $obj['photo']; } @@ -177,8 +175,7 @@ class pdf_squille extends ModelePdfReception $dir = $conf->reception->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $rcpref = dol_sanitizeFileName($object->ref); $dir = $conf->reception->dir_output."/".$rcpref; $file = $dir."/".$rcpref.".pdf"; @@ -336,8 +333,7 @@ class pdf_squille extends ModelePdfReception $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -378,8 +374,7 @@ class pdf_squille extends ModelePdfReception // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -419,18 +414,16 @@ class pdf_squille extends ModelePdfReception $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -512,8 +505,7 @@ class pdf_squille extends ModelePdfReception { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -527,8 +519,7 @@ class pdf_squille extends ModelePdfReception { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -545,8 +536,7 @@ class pdf_squille extends ModelePdfReception $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -578,14 +568,12 @@ class pdf_squille extends ModelePdfReception return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->transnoentities("ErrorConstantNotDefined", "EXP_OUTPUTDIR"); return 0; } @@ -822,16 +810,14 @@ class pdf_squille extends ModelePdfReception $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -841,8 +827,7 @@ class pdf_squille extends ModelePdfReception { $posx = 105; } - else - { + else { $posx = $this->marge_gauche + 3; } //$pdf->Rect($this->marge_gauche, $this->marge_haute, $this->page_largeur-$this->marge_gauche-$this->marge_droite, 30); diff --git a/htdocs/core/modules/reception/mod_reception_beryl.php b/htdocs/core/modules/reception/mod_reception_beryl.php index 66576eaab76..ee3122749a3 100644 --- a/htdocs/core/modules/reception/mod_reception_beryl.php +++ b/htdocs/core/modules/reception/mod_reception_beryl.php @@ -114,8 +114,7 @@ class mod_reception_beryl extends ModelNumRefReception if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog("mod_reception_beryl::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index 2a7e0cf287f..cff1ae3f897 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -117,8 +117,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc $tmpdir = preg_replace('/DOL_DATA_ROOT/', DOL_DATA_ROOT, $tmpdir); if (!$tmpdir) { unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.od(s|t)$', '', 'name', SORT_ASC, 0, true); // Disable hook for the moment if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -250,8 +249,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -313,8 +311,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc } if ((is_array($contact_arrray) && count($contact_arrray) > 0)) { - try - { + try { $listlines = $odfHandler->setSegment('companycontacts'); foreach ($contact_arrray as $array_key => $contact_id) @@ -323,8 +320,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc $tmparray = $this->get_substitutionarray_contact($contactstatic, $outputlangs, 'contact'); foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -370,7 +366,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -439,8 +435,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index 22ec06c8aa6..ce85de4670d 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -286,8 +286,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode { $result = -2; } - else - { + else { // Get Mask value $mask = ''; if ($type == 0) $mask = empty($conf->global->COMPANY_ELEPHANT_MASK_CUSTOMER) ? '' : $conf->global->COMPANY_ELEPHANT_MASK_CUSTOMER; @@ -336,13 +335,11 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode { return 0; } - else - { + else { return -1; } } - else - { + else { return -2; } } diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php index 15519688f98..5582e6459af 100644 --- a/htdocs/core/modules/societe/mod_codeclient_monkey.php +++ b/htdocs/core/modules/societe/mod_codeclient_monkey.php @@ -145,8 +145,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { return -1; } @@ -189,8 +188,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode { $result = -2; } - else - { + else { if ($this->verif_syntax($code) >= 0) { $is_dispo = $this->verif_dispo($db, $code, $soc, $type); @@ -198,19 +196,16 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode { $result = -3; } - else - { + else { $result = 0; } } - else - { + else { if (dol_strlen($code) == 0) { $result = -2; } - else - { + else { $result = -1; } } @@ -250,13 +245,11 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode { return 0; } - else - { + else { return -1; } } - else - { + else { return -2; } } @@ -278,8 +271,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode { $res = -1; } - else - { + else { $res = 0; } return $res; diff --git a/htdocs/core/modules/societe/mod_codecompta_aquarium.php b/htdocs/core/modules/societe/mod_codecompta_aquarium.php index 78b0e2fae8e..27b1572555e 100644 --- a/htdocs/core/modules/societe/mod_codecompta_aquarium.php +++ b/htdocs/core/modules/societe/mod_codecompta_aquarium.php @@ -147,8 +147,7 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode $codetouse = (!empty($societe->code_fournisseur) ? $societe->code_fournisseur : 'SUPPCODE'); $prefix = $this->prefixsupplieraccountancycode; } - else - { + else { $this->error = 'Bad value for parameter type'; return -1; } @@ -172,8 +171,7 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode { $this->code = $codetouse; } - else - { + else { // Pour retour $this->code = $codetouse; } @@ -211,14 +209,12 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode dol_syslog("mod_codecompta_aquarium::verif code '".$code."' available"); return 1; // Dispo } - else - { + else { dol_syslog("mod_codecompta_aquarium::verif code '".$code."' not available"); return 0; // Non dispo } } - else - { + else { $this->error = $db->error()." sql=".$sql; return -1; // Erreur } diff --git a/htdocs/core/modules/societe/mod_codecompta_digitaria.php b/htdocs/core/modules/societe/mod_codecompta_digitaria.php index d97ac5df0ff..3a689b8df93 100644 --- a/htdocs/core/modules/societe/mod_codecompta_digitaria.php +++ b/htdocs/core/modules/societe/mod_codecompta_digitaria.php @@ -170,8 +170,7 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode $prefix = $this->prefixcustomeraccountancycode; $width = $this->customeraccountancycodecharacternumber; } - else - { + else { $this->error = 'Bad value for parameter type'; return -1; } @@ -221,8 +220,7 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode { return 0; // return ok } - else - { + else { return -1; // return ko } } @@ -245,8 +243,7 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode { $typethirdparty = 'code_compta'; } - else - { + else { $this->error = 'Bad value for parameter type'; return -1; } @@ -262,14 +259,12 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode dol_syslog("mod_codecompta_digitaria::checkIfAccountancyCodeIsAlreadyUsed '".$code."' available"); return 0; // Available } - else - { + else { dol_syslog("mod_codecompta_digitaria::checkIfAccountancyCodeIsAlreadyUsed '".$code."' not available"); return -1; // Not available } } - else - { + else { $this->error = $db->error()." sql=".$sql; return -2; // Error } diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php index a6df7aaea20..ea10843a94a 100644 --- a/htdocs/core/modules/societe/modules_societe.class.php +++ b/htdocs/core/modules/societe/modules_societe.class.php @@ -173,8 +173,7 @@ abstract class ModeleThirdPartyCode $i++; } } - else - { + else { return -1; } return $liste; diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php index d5ccf5dbd89..c68d1c37642 100644 --- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php +++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php @@ -141,8 +141,7 @@ class doc_generic_stock_odt extends ModelePDFStock unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -295,8 +294,7 @@ class doc_generic_stock_odt extends ModelePDFStock if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -330,8 +328,7 @@ class doc_generic_stock_odt extends ModelePDFStock $contactobject = $object->contact; } } - else - { + else { $socobject = $object->thirdparty; } // Make substitution @@ -418,7 +415,7 @@ class doc_generic_stock_odt extends ModelePDFStock if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -429,8 +426,7 @@ class doc_generic_stock_odt extends ModelePDFStock } } // Replace tags of lines - try - { + try { $listlines = $odfHandler->setSegment('supplierprices'); if (!empty($object->supplierprices)) { foreach ($object->supplierprices as $supplierprice) @@ -442,8 +438,7 @@ class doc_generic_stock_odt extends ModelePDFStock $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($array_lines as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -515,8 +510,7 @@ class doc_generic_stock_odt extends ModelePDFStock return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index c50f3d2a2f8..708f06a4491 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -211,8 +211,7 @@ class pdf_standard extends ModelePDFStock $dir = $conf->stock->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->stock->dir_output."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -380,18 +379,16 @@ class pdf_standard extends ModelePDFStock $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -476,8 +473,7 @@ class pdf_standard extends ModelePDFStock { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -492,8 +488,7 @@ class pdf_standard extends ModelePDFStock { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -544,8 +539,7 @@ class pdf_standard extends ModelePDFStock $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, price(price2num($totalvaluesell, 'MT'), 0, $outputlangs), 0, 'R', 0); } } - else - { + else { dol_print_error($db); } @@ -570,8 +564,7 @@ class pdf_standard extends ModelePDFStock $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -705,8 +698,7 @@ class pdf_standard extends ModelePDFStock $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -745,14 +737,12 @@ class pdf_standard extends ModelePDFStock return 1; // No error } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "PRODUCT_OUTPUTDIR"); return 0; } @@ -913,16 +903,14 @@ class pdf_standard extends ModelePDFStock $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -965,8 +953,7 @@ class pdf_standard extends ModelePDFStock { $pdf->MultiCell(150, 3, $e->label, '', 'R'); } - else - { + else { $pdf->MultiCell(150, 3, $outputlangs->transnoentities("None"), '', 'R'); } @@ -1004,8 +991,7 @@ class pdf_standard extends ModelePDFStock $obj = $db->fetch_object($resqlbis); $lastmovementdate = $db->jdate($obj->datem); } - else - { + else { dol_print_error($db); } @@ -1013,8 +999,7 @@ class pdf_standard extends ModelePDFStock { $toWrite = dol_print_date($lastmovementdate, 'dayhour').' '; } - else - { + else { $toWrite = $outputlangs->transnoentities("None"); } diff --git a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php index d0e9ba9d1e4..dcf461fd9c0 100644 --- a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php @@ -286,8 +286,7 @@ class pdf_stdmovement extends ModelePDFMovement { if ($year > 0) $sql .= " AND m.datem BETWEEN '".$db->idate(dol_get_first_day($year, $month, false))."' AND '".$db->idate(dol_get_last_day($year, $month, false))."'"; - else - $sql .= " AND date_format(m.datem, '%m') = '$month'"; + else $sql .= " AND date_format(m.datem, '%m') = '$month'"; } elseif ($year > 0) { @@ -363,8 +362,7 @@ class pdf_stdmovement extends ModelePDFMovement $i = 0; $help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; if ($msid) $texte = $langs->trans('StockMovementForId', $msid); - else - { + else { $texte = $langs->trans("ListOfStockMovements"); if ($id) $texte .= ' ('.$langs->trans("ForThisWarehouse").')'; } @@ -376,8 +374,7 @@ class pdf_stdmovement extends ModelePDFMovement $dir = $conf->stock->dir_output."/movement"; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); if (!empty($search_inventorycode)) $objectref .= "_".$id."_".$search_inventorycode; if ($search_type_mouvement) $objectref .= "_".$search_type_mouvement; @@ -540,18 +537,16 @@ class pdf_stdmovement extends ModelePDFMovement $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -667,8 +662,7 @@ class pdf_stdmovement extends ModelePDFMovement { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -683,8 +677,7 @@ class pdf_stdmovement extends ModelePDFMovement { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -720,8 +713,7 @@ class pdf_stdmovement extends ModelePDFMovement $pdf->SetXY($this->postotalht, $curY); $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $totalunit, 0, 'R', 0); } - else - { + else { dol_print_error($db); } @@ -746,8 +738,7 @@ class pdf_stdmovement extends ModelePDFMovement $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -763,8 +754,7 @@ class pdf_stdmovement extends ModelePDFMovement $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -803,14 +793,12 @@ class pdf_stdmovement extends ModelePDFMovement return 1; // No error } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "PRODUCT_OUTPUTDIR"); return 0; } @@ -994,16 +982,14 @@ class pdf_stdmovement extends ModelePDFMovement $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -1046,8 +1032,7 @@ class pdf_stdmovement extends ModelePDFMovement { $pdf->MultiCell(150, 3, $e->label, '', 'R'); } - else - { + else { $pdf->MultiCell(150, 3, $outputlangs->transnoentities("None"), '', 'R'); } @@ -1085,8 +1070,7 @@ class pdf_stdmovement extends ModelePDFMovement $obj = $db->fetch_object($resqlbis); $lastmovementdate = $db->jdate($obj->datem); } - else - { + else { dol_print_error($db); } @@ -1094,8 +1078,7 @@ class pdf_stdmovement extends ModelePDFMovement { $toWrite = dol_print_date($lastmovementdate, 'dayhour').' '; } - else - { + else { $toWrite = $outputlangs->transnoentities("None"); } diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 2e3b4e177d7..551d960008a 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -234,8 +234,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $dir = $conf->fournisseur->facture->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $objectrefsupplier = dol_sanitizeFileName($object->ref_supplier); $dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').$objectref; @@ -425,17 +424,15 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -536,8 +533,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -552,8 +548,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -571,8 +566,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -615,14 +609,12 @@ class pdf_canelle extends ModelePDFSuppliersInvoices return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->transnoentities("ErrorConstantNotDefined", "SUPPLIER_OUTPUTDIR"); return 0; } @@ -733,8 +725,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2, 0, $outputlangs), 0, 'R', 1); } } - else - { + else { //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ //Local tax 1 @@ -1049,8 +1040,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $i++; } } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -1148,8 +1138,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R'); } - else - { + else { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(255, 0, 0); diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php index c821e6b60aa..70c20a77fb3 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php @@ -193,8 +193,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { return -1; } diff --git a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php index d7f48915308..7be80850526 100644 --- a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php +++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php @@ -138,8 +138,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -239,8 +238,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders $dir = $conf->fournisseur->commande->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $objectrefsupplier = dol_sanitizeFileName($object->ref_supplier); $dir = $conf->fournisseur->commande->dir_output.'/'.$objectref; @@ -274,8 +272,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -308,8 +305,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders $contactobject = $object->contact; } } - else - { + else { $socobject = $object->thirdparty; } @@ -396,7 +392,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -407,8 +403,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders } } // Replace tags of lines - try - { + try { $foundtagforlines = 1; try { $listlines = $odfHandler->setSegment('lines'); @@ -432,8 +427,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -507,8 +501,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 657160a9a1b..b08adfcb97c 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -222,8 +222,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/"; $dir = $conf->product->dir_output.'/'.$pdir; } - else - { + else { $pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; $dir = $conf->product->dir_output.'/'.$pdir; } @@ -258,8 +257,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $dir = $conf->fournisseur->commande->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $objectrefsupplier = dol_sanitizeFileName($object->ref_supplier); $dir = $conf->fournisseur->commande->dir_output.'/'.$objectref; @@ -491,8 +489,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $tab_height = $tab_height - $height_note; $tab_top = $posyafter + 6; } - else - { + else { $height_note = 0; } @@ -535,8 +532,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } if (!empty($imglinesize['width']) && !empty($imglinesize['height'])) @@ -574,17 +570,15 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -734,8 +728,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -750,8 +743,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -769,8 +761,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -813,14 +804,12 @@ class pdf_cornas extends ModelePDFSuppliersOrders return 1; // No error } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "SUPPLIER_OUTPUTDIR"); return 0; } @@ -1009,8 +998,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1); } } - else - { + else { //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ //Local tax 1 @@ -1243,16 +1231,14 @@ class pdf_cornas extends ModelePDFSuppliersOrders $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -1296,8 +1282,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : ".dol_print_date($object->date_commande, "day", false, $outputlangs, true), '', 'R'); } - else - { + else { $posy += 5; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(255, 0, 0); @@ -1645,8 +1630,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders { $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys } - else - { + else { $this->cols = $hookmanager->resArray; } } diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 4a27b58f8ae..c2a6af6c05e 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -238,8 +238,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/"; $dir = $conf->product->dir_output.'/'.$pdir; } - else - { + else { $pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; $dir = $conf->product->dir_output.'/'.$pdir; } @@ -274,8 +273,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $dir = $conf->fournisseur->commande->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $objectrefsupplier = dol_sanitizeFileName($object->ref_supplier); $dir = $conf->fournisseur->commande->dir_output.'/'.$objectref; @@ -447,8 +445,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } if (!empty($imglinesize['width']) && !empty($imglinesize['height'])) @@ -467,8 +464,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders { $descWidth = $this->posxpicture - $curX; } - else - { + else { $descWidth = $this->posxtva - $curX; } pdf_writelinedesc($pdf, $object, $i, $outputlangs, $descWidth, 3, $curX, $curY, $hideref, $hidedesc, 1); @@ -492,17 +488,15 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -617,8 +611,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -633,8 +626,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -652,8 +644,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -696,14 +687,12 @@ class pdf_muscadet extends ModelePDFSuppliersOrders return 1; // No error } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "SUPPLIER_OUTPUTDIR"); return 0; } @@ -892,8 +881,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1); } } - else - { + else { //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ //Local tax 1 @@ -1159,16 +1147,14 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -1212,8 +1198,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : ".dol_print_date($object->date_commande, "day", false, $outputlangs, true), '', 'R'); } - else - { + else { $posy += 5; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(255, 0, 0); diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php index df4a60b10e2..c8129f1e491 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php @@ -117,8 +117,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders { return true; } - else - { + else { $langs->load("errors"); $this->error = $langs->trans('ErrorNumRefModel', $max); return false; diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 0ad8b391faf..060394beca6 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -231,8 +231,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $dir = $conf->fournisseur->payment->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $objectrefsupplier = dol_sanitizeFileName($object->ref_supplier); $dir = $conf->fournisseur->payment->dir_output.'/'.$objectref; @@ -360,17 +359,15 @@ class pdf_standard extends ModelePDFSuppliersPayments $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -433,8 +430,7 @@ class pdf_standard extends ModelePDFSuppliersPayments { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -449,8 +445,7 @@ class pdf_standard extends ModelePDFSuppliersPayments { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -468,8 +463,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -506,14 +500,12 @@ class pdf_standard extends ModelePDFSuppliersPayments return 1; // No error } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "SUPPLIER_OUTPUTDIR"); return 0; } @@ -663,16 +655,14 @@ class pdf_standard extends ModelePDFSuppliersPayments $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } diff --git a/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php b/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php index 9baa8d2dafe..4ee8ed90490 100644 --- a/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php +++ b/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php @@ -137,8 +137,7 @@ class mod_supplier_payment_bronan extends ModeleNumRefSupplierPayments if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog(__METHOD__, LOG_DEBUG); return -1; } 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 c97d2f94d63..8b0d7f108a1 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 @@ -142,8 +142,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -307,8 +306,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -338,15 +336,13 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal { $socobject = $object->contact; } - else - { + else { $socobject = $object->thirdparty; // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use $contactobject = $object->contact; } } - else - { + else { $socobject = $object->thirdparty; } @@ -432,7 +428,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -443,8 +439,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal } } // Replace tags of lines - try - { + try { $foundtagforlines = 1; try { $listlines = $odfHandler->setSegment('lines'); @@ -468,8 +463,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -541,8 +535,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index afaf4987e04..fd5fb653a5a 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -234,8 +234,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/"; $dir = $conf->product->dir_output.'/'.$pdir; } - else - { + else { $pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; $dir = $conf->product->dir_output.'/'.$pdir; } @@ -266,8 +265,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $dir = $conf->supplier_proposal->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->supplier_proposal->dir_output."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -432,8 +430,7 @@ class pdf_aurore extends ModelePDFSupplierProposal // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } if (!empty($imglinesize['width']) && !empty($imglinesize['height'])) @@ -452,8 +449,7 @@ class pdf_aurore extends ModelePDFSupplierProposal { $descWidth = $this->posxpicture - $curX; } - else - { + else { $descWidth = $this->posxtva - $curX; } pdf_writelinedesc($pdf, $object, $i, $outputlangs, $descWidth, 3, $curX, $curY, $hideref, $hidedesc, 1); @@ -480,17 +476,15 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // 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)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -613,8 +607,7 @@ class pdf_aurore extends ModelePDFSupplierProposal { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -629,8 +622,7 @@ class pdf_aurore extends ModelePDFSupplierProposal { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -648,8 +640,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -694,14 +685,12 @@ class pdf_aurore extends ModelePDFSupplierProposal return 1; // No error } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "SUPPLIER_PROPOSAL_OUTPUTDIR"); return 0; } @@ -943,8 +932,7 @@ class pdf_aurore extends ModelePDFSupplierProposal { // Nothing to do } - else - { + else { //Local tax 1 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ @@ -1315,16 +1303,14 @@ class pdf_aurore extends ModelePDFSupplierProposal $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -1453,8 +1439,7 @@ class pdf_aurore extends ModelePDFSupplierProposal else $socname = $object->thirdparty->name; $carac_client_name = $outputlangs->convToOutputCharset($socname); } - else - { + else { $carac_client_name = $outputlangs->convToOutputCharset($object->thirdparty->name); } diff --git a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php index 37ba98b0058..02b1c5a6684 100644 --- a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php +++ b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php @@ -109,8 +109,7 @@ class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal { return true; } - else - { + else { $langs->load("errors"); $this->error = $langs->trans('ErrorNumRefModel', $max); return false; @@ -142,8 +141,7 @@ class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/syslog/mod_syslog_file.php b/htdocs/core/modules/syslog/mod_syslog_file.php index dedf0844245..76869791d93 100644 --- a/htdocs/core/modules/syslog/mod_syslog_file.php +++ b/htdocs/core/modules/syslog/mod_syslog_file.php @@ -152,8 +152,7 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface print 'Failed to open log file '.($dolibarr_main_prod ?basename($logfile) : $logfile); } } - else - { + else { $logLevels = array( LOG_EMERG => 'EMERG', LOG_ALERT => 'ALERT', diff --git a/htdocs/core/modules/syslog/mod_syslog_syslog.php b/htdocs/core/modules/syslog/mod_syslog_syslog.php index 56ca1825ab4..d2f1200cc08 100644 --- a/htdocs/core/modules/syslog/mod_syslog_syslog.php +++ b/htdocs/core/modules/syslog/mod_syslog_syslog.php @@ -93,8 +93,7 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface dol_syslog("admin/syslog: facility ".$facility); } - else - { + else { $errors[] = $langs->trans("ErrorUnknownSyslogConstant", $facility); } 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 881ba4cb469..5c2468e29c6 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 @@ -139,8 +139,7 @@ class doc_generic_user_odt extends ModelePDFUser unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -289,8 +288,7 @@ class doc_generic_user_odt extends ModelePDFUser if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -322,8 +320,7 @@ class doc_generic_user_odt extends ModelePDFUser $contactobject = $object->contact; } } - else - { + else { $socobject = $object->thirdparty; } @@ -370,7 +367,7 @@ class doc_generic_user_odt extends ModelePDFUser if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -429,8 +426,7 @@ class doc_generic_user_odt extends ModelePDFUser return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } 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 1b1d6ba1dab..9e227a43588 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 @@ -142,8 +142,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -292,8 +291,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -325,8 +323,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup $contactobject = $object->contact; } } - else - { + else { $socobject = $object->thirdparty; } // Make substitution @@ -402,14 +399,13 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup $reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key=>$value) { - try - { + try { if (preg_match('/logo$/', $key)) // Image { if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -420,8 +416,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup } } // Replace tags of lines - try - { + try { $foundtagforlines = 1; try { $listlines = $odfHandler->setSegment('lines'); @@ -445,8 +440,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key => $val) { - try - { + try { if (!is_array($val)) { $listlines->setVars($key, $val, true, 'UTF-8'); } @@ -520,8 +514,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index 2686efa6419..959d944352b 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -87,7 +87,7 @@ elseif ($modulepart == 'bank') if (!$user->rights->banque->lire) accessforbidden(); $accessallowed = 1; } -else // ticket, holiday, expensereport, societe... +else // ticket, holiday, expensereport, societe... { $result = restrictedArea($user, $modulepart, $id, $modulepart); if (empty($user->rights->$modulepart->read) && empty($user->rights->$modulepart->lire)) accessforbidden(); @@ -286,8 +286,7 @@ if ($cancel) header("Location: ".$backtourl); exit; } - else - { + else { dol_print_error('', 'Cancel on photo_resize with a not supported value of modulepart='.$modulepart); exit; } @@ -347,14 +346,12 @@ if ($action == 'confirm_resize' && GETPOSTISSET("file") && GETPOSTISSET("sizex") header("Location: ".$backtourl); exit; } - else - { + else { dol_print_error('', 'confirm_resize on photo_resize without backtourl defined for modulepart='.$modulepart); exit; } } - else - { + else { setEventMessages($result, null, 'errors'); $_GET['file'] = $_POST["file"]; $action = ''; @@ -417,14 +414,12 @@ if ($action == 'confirm_crop') header("Location: ".$backtourl); exit; } - else - { + else { dol_print_error('', 'confirm_crop on photo_resize without backtourl defined for modulepart='.$modulepart); exit; } } - else - { + else { setEventMessages($result, null, 'errors'); $_GET['file'] = $_POST["file"]; $action = ''; diff --git a/htdocs/core/search.php b/htdocs/core/search.php index b82536edbd2..01c7c078214 100644 --- a/htdocs/core/search.php +++ b/htdocs/core/search.php @@ -148,7 +148,6 @@ if (!empty($_SERVER['HTTP_REFERER'])) header("Location: ".$_SERVER['HTTP_REFERER']); exit; } -else -{ +else { print 'The wrapper search.php was called without any search criteria'; } diff --git a/htdocs/core/search_page.php b/htdocs/core/search_page.php index 119d7ff9a41..5d61ccecdb3 100644 --- a/htdocs/core/search_page.php +++ b/htdocs/core/search_page.php @@ -75,8 +75,7 @@ if ($conf->use_javascript_ajax && 1 == 2) // select2 is ko with jmobile $selected = -1; $searchform .= '

'.$form->selectArrayAjax('searchselectcombo', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, '', '', 0, 1, 'minwidth300', 1, $langs->trans("Search"), 0); } -else -{ +else { $usedbyinclude = 1; // Used into next include $showtitlebefore = GETPOST('showtitlebefore', 'int'); include DOL_DOCUMENT_ROOT.'/core/ajax/selectsearchbox.php'; diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 80a7cac7de3..960e0e57401 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -218,8 +218,7 @@ if (in_array($type, array_keys($typewecanchangeinto))) } print ''; } -else -{ +else { print $type2label[$type]; print ''; } diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index 96620da28d9..4a6c7d67494 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -118,8 +118,7 @@ if (is_array($extrafields->attributes[$elementtype]['type']) && count($extrafiel print ""; } } -else -{ +else { $colspan = 13; if (!empty($conf->multicompany->enabled)) $colspan++; diff --git a/htdocs/core/tpl/bloc_comment.tpl.php b/htdocs/core/tpl/bloc_comment.tpl.php index 0e9e63bff12..d20894d6a03 100644 --- a/htdocs/core/tpl/bloc_comment.tpl.php +++ b/htdocs/core/tpl/bloc_comment.tpl.php @@ -112,8 +112,7 @@ if (!empty($object->comments)) $doleditor = new DolEditor('comment_description', $comment->description, '', 80, 'dolibarr_notes', 'In', 0, true, true, ROWS_3, '100%'); print $doleditor->Create(1); } - else - { + else { print $comment->description; } print '
'; // End comment-description @@ -125,8 +124,7 @@ if (!empty($object->comments)) print ''; } - else - { + else { if ($fk_user == $user->id || $user->admin == 1) { print ''; diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 7e2dc1f420e..6087ca6e906 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -52,8 +52,7 @@ if ($action == 'presend') { $fileparams = dol_most_recent_file($diroutput.'/'.get_exdir($object->id, 2, 0, 0, $object, $object->element).$ref, preg_quote($ref, '/').'([^\-])+'); } - else - { + else { $fileparams = dol_most_recent_file($diroutput.'/'.$ref, preg_quote($ref, '/').'[^\-]+'); } @@ -104,8 +103,7 @@ if ($action == 'presend') { $fileparams = dol_most_recent_file($diroutput.'/'.get_exdir($object->id, 2, 0, 0, $object, $object->element).$ref, preg_quote($ref, '/').'([^\-])+'); } - else - { + else { $fileparams = dol_most_recent_file($diroutput.'/'.$ref, preg_quote($ref, '/').'[^\-]+'); } @@ -161,8 +159,7 @@ if ($action == 'presend') { $liste['thirdparty'] = $object->getFullName($outputlangs)." <".$object->email.">"; } - else - { + else { if (is_object($object->thirdparty)) { foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value) { diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index e9f881accd2..0c1931d480f 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -178,8 +178,7 @@ foreach (array('internal', 'external') as $source) { $contactlist = $objectsrc->liste_contact(-1, $source); } - else - { + else { $contactlist = $object->liste_contact(-1, $source); } diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 0d2949b4e24..efb89043b6b 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -36,8 +36,7 @@ if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_e } $value = $datenotinstring; } - else - { + else { $value = $obj->$tmpkey; } // If field is a computed field, we make computation to get value diff --git a/htdocs/core/tpl/extrafields_list_search_input.tpl.php b/htdocs/core/tpl/extrafields_list_search_input.tpl.php index d6ebb8b919f..b3512136a10 100644 --- a/htdocs/core/tpl/extrafields_list_search_input.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_input.tpl.php @@ -39,8 +39,7 @@ if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_e // TODO // Use showInputField in a particular manner to have input with a comparison operator, not input for a specific value date-hour-minutes } - else - { + else { // for the type as 'checkbox', 'chkbxlst', 'sellist' we should use code instead of id (example: I declare a 'chkbxlst' to have a link with dictionnairy, I have to extend it with the 'code' instead 'rowid') $morecss = ''; if (in_array($typeofextrafield, array('link', 'sellist'))) $morecss = 'maxwidth200'; diff --git a/htdocs/core/tpl/extrafields_list_search_title.tpl.php b/htdocs/core/tpl/extrafields_list_search_title.tpl.php index 9a83cbb42aa..169dd34fee1 100644 --- a/htdocs/core/tpl/extrafields_list_search_title.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_title.tpl.php @@ -27,8 +27,7 @@ if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_e if ($extrafields->attributes[$extrafieldsobjectkey]['type'][$key] == 'separate') { print ''; } - else - { + else { $tooltip = empty($extrafields->attributes[$extrafieldsobjectkey]['help'][$key]) ? '' : $extrafields->attributes[$extrafieldsobjectkey]['help'][$key]; print getTitleFieldOfList($extrafields->attributes[$extrafieldsobjectkey]['label'][$key], 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align ? 'align="'.$align.'" data-titlekey="'.$key.'"' : 'data-titlekey="'.$key.'"'), $sortfield, $sortorder, '', $disablesortlink, $tooltip)."\n"; diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 198a3910747..a7379a69d94 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -87,8 +87,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] { $value = (isset($_POST["options_".$key]) ? $_POST["options_".$key] : $object->array_options["options_".$key]); } - else - { + else { $value = $object->array_options["options_".$key]; //var_dump($key.' - '.$value); } @@ -114,8 +113,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] $lastseparatorkeyfound = $key; } - else - { + else { print ''; print ''; } -else -{ +else { print ''; print ''; print ''; @@ -178,7 +177,7 @@ if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg print ''; } - else // Show filtree when ajax is disabled (rare) + else // Show filtree when ajax is disabled (rare) { print ''; diff --git a/htdocs/core/tpl/list_print_total.tpl.php b/htdocs/core/tpl/list_print_total.tpl.php index 33be5fb99d1..f4f6974ac08 100644 --- a/htdocs/core/tpl/list_print_total.tpl.php +++ b/htdocs/core/tpl/list_print_total.tpl.php @@ -15,8 +15,7 @@ if (isset($totalarray['pos'])) { $i++; if (!empty($totalarray['pos'][$i])) print ''.price($totalarray['val'][$totalarray['pos'][$i]]).''; - else - { + else { if ($i == 1) { if ($num < $limit) print ''.$langs->trans("Total").''; diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 97bece99852..e0245175768 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -254,8 +254,7 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/', $conf->fil $url = $conf->global->MAIN_AUTHENTICATION_OPENID_URL; if (!empty($url)) print ''.$langs->trans("LoginUsingOpenID").''; - else - { + else { $langs->load("errors"); print ''.$langs->trans("ErrorOpenIDSetupNotComplete", 'MAIN_AUTHENTICATION_OPENID_URL').''; } diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 492590c65e4..c507144b151 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -99,8 +99,7 @@ if ($massaction == 'presend') $fuser->fetch($thirdpartyid); $liste['thirdparty'] = $fuser->getFullName($langs)." <".$fuser->email.">"; } - else - { + else { $soc = new Societe($db); $soc->fetch($thirdpartyid); foreach ($soc->thirdparty_and_contact_email_array(1) as $key => $value) { @@ -159,8 +158,7 @@ if ($massaction == 'presend') print ' - '.$langs->trans("GoBack").''; $arrayofmassactions = array(); } - else - { + else { print $formmail->get_form(); } diff --git a/htdocs/core/tpl/object_discounts.tpl.php b/htdocs/core/tpl/object_discounts.tpl.php index 8af029ce071..10db8476bef 100644 --- a/htdocs/core/tpl/object_discounts.tpl.php +++ b/htdocs/core/tpl/object_discounts.tpl.php @@ -43,8 +43,7 @@ if ($fixedDiscount > 0) $translationKey = (!empty($discount_type)) ? 'HasRelativeDiscountFromSupplier' : 'CompanyHasRelativeDiscount'; print $langs->trans($translationKey, $fixedDiscount).'.'; } -else -{ +else { $translationKey = (!empty($discount_type)) ? 'HasNoRelativeDiscountFromSupplier' : 'CompanyHasNoRelativeDiscount'; print $langs->trans($translationKey).'.'; } diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 0fb1aff011d..baa57c7d1c9 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -136,8 +136,7 @@ if ($nolinesbefore) { print ''; if ($conf->global->MARGIN_TYPE == "1") echo $langs->trans('BuyingPrice'); - else - echo $langs->trans('CostPrice'); + else echo $langs->trans('CostPrice'); echo ''; if (!empty($conf->global->DISPLAY_MARGIN_RATES)) echo ''.$langs->trans('MarginRate').''; if (!empty($conf->global->DISPLAY_MARK_RATES)) echo ''.$langs->trans('MarkRate').''; @@ -187,8 +186,7 @@ if ($nolinesbefore) { echo ''; echo ' '; } - else - { + else { echo ''; // Show type selector if ($forceall >= 0) @@ -214,8 +212,7 @@ if ($nolinesbefore) { elseif ((empty($conf->product->enabled) && !empty($conf->service->enabled)) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) echo $langs->trans('PredefinedServicesToSell'); else echo $langs->trans('PredefinedProductsAndServicesToSell'); } - else - { + else { if (!empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToPurchase'); elseif (empty($conf->product->enabled) && !empty($conf->service->enabled)) echo $langs->trans('PredefinedServicesToPurchase'); else echo $langs->trans('PredefinedProductsAndServicesToPurchase'); @@ -232,8 +229,7 @@ if ($nolinesbefore) { // hide products in closed warehouse, but show products for internal transfer $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array')); } - else - { + else { $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array')); } if (!empty($conf->global->MAIN_AUTO_OPEN_SELECT2_ON_FOCUS_FOR_CUSTOMER_PRODUCTS)) @@ -255,8 +251,7 @@ if ($nolinesbefore) { array('remise_percent' => 'discount') // html id tags that will be edited with each ajax json response key ); @@ -449,8 +443,7 @@ if ((!empty($conf->service->enabled) || ($object->element == 'contrat')) && $dat print '   '.$langs->trans("DateEndPlanned").' '; print $form->selectDate($date_end, "date_end", $usehm, $usehm, 1, "addproduct"); } - else - { + else { print $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; print $form->selectDate($date_start, 'date_start', empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 0 : 1, empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 0 : 1, 1, "addproduct", 1, 0); print ' '.$langs->trans('to').' '; diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index d316afb6966..8957021d359 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -231,8 +231,7 @@ $coldisplay++; // if credit note, dont allow to modify margin if ($line->subprice < 0) echo ''.$margin_rate.'%'; - else - echo '%'; + else echo '%'; $coldisplay++; } elseif (!empty($conf->global->DISPLAY_MARK_RATES)) @@ -241,8 +240,7 @@ $coldisplay++; // if credit note, dont allow to modify margin if ($line->subprice < 0) echo ''.$mark_rate.'%'; - else - echo '%'; + else echo '%'; $coldisplay++; } } diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 8849020b885..34f78ae7fcc 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -111,22 +111,19 @@ if (($line->info_bits & 2) == 2) { $discount->fetch($line->fk_remise_except); print ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessPaid", $discount->getNomUrl(0)); } - else - { + else { print ($txt ? ' - ' : '').dol_htmlentitiesbr($line->description); } } } -else -{ +else { $format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE ? 'dayhour' : 'day'; if ($line->fk_product > 0) { print $form->textwithtooltip($text, $description, 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : '')); } - else - { + else { $type = (!empty($line->product_type) ? $line->product_type : $line->fk_product_type); if ($type == 1) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); @@ -178,8 +175,7 @@ if ($user->rights->fournisseur->lire && $line->fk_fournprice > 0) { print $productfourn->getNomUrl(); } - else - { + else { print $productfourn->ref_supplier; } } diff --git a/htdocs/core/tpl/resource_view.tpl.php b/htdocs/core/tpl/resource_view.tpl.php index 2680a763a59..3e92af33a4d 100644 --- a/htdocs/core/tpl/resource_view.tpl.php +++ b/htdocs/core/tpl/resource_view.tpl.php @@ -50,8 +50,7 @@ if ((array) $linked_resources && count($linked_resources) > 0) print '
'; print '
'; } - else - { + else { $class = ''; if ($linked_resource['rowid'] == GETPOST('lineid')) $class = 'highlight'; diff --git a/htdocs/core/triggers/interface_20_all_Logevents.class.php b/htdocs/core/triggers/interface_20_all_Logevents.class.php index fceb1552f0b..591939c6156 100644 --- a/htdocs/core/triggers/interface_20_all_Logevents.class.php +++ b/htdocs/core/triggers/interface_20_all_Logevents.class.php @@ -203,8 +203,7 @@ class InterfaceLogevents extends DolibarrTriggers { return 1; } - else - { + else { $error = "Failed to insert security event: ".$event->error; $this->errors[] = $error; $this->error = $error; diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 49939277f49..46a5df282d2 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -812,8 +812,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $tmpuser->fetch($object->oldcopy->fk_user_assign); $object->actionmsg .= "\n".$langs->transnoentities("OldUser").': '.$tmpuser->getFullName($langs); } - else - { + else { $object->actionmsg .= "\n".$langs->transnoentities("OldUser").': '.$langs->trans("None"); } if ($object->fk_user_assign > 0) @@ -822,14 +821,13 @@ class InterfaceActionsAuto extends DolibarrTriggers $tmpuser->fetch($object->fk_user_assign); $object->actionmsg .= "\n".$langs->transnoentities("NewUser").': '.$tmpuser->getFullName($langs); } - else - { + else { $object->actionmsg .= "\n".$langs->transnoentities("NewUser").': '.$langs->trans("None"); } $object->sendtoid = 0; } // TODO Merge all previous cases into this generic one - else // $action = BILL_DELETE, TICKET_CREATE, TICKET_MODIFY, TICKET_DELETE, ... + else // $action = BILL_DELETE, TICKET_CREATE, TICKET_MODIFY, TICKET_DELETE, ... { // Note: We are here only if $conf->global->MAIN_AGENDA_ACTIONAUTO_action is on (tested at begining of this function). // Note that these key can be set in agenda setup, only if defined into c_action_trigger @@ -867,8 +865,7 @@ class InterfaceActionsAuto extends DolibarrTriggers { if (count($object->sendtoid) == 1) $contactforaction->fetch(reset($object->sendtoid)); } - else - { + else { if ($object->sendtoid > 0) $contactforaction->fetch($object->sendtoid); } // Set societeforaction. @@ -952,8 +949,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $_SESSION['LAST_ACTION_CREATED'] = $ret; return 1; } - else - { + else { $this->error = "Failed to insert event : ".$actioncomm->error." ".join(',', $actioncomm->errors); $this->errors = $actioncomm->errors; diff --git a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php index 2135f463ca7..7740191c94b 100644 --- a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php +++ b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php @@ -143,8 +143,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers $this->errors = $b->errors; return -1; } - else - { + else { return 1; } } diff --git a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php index be5465c06f2..ce9e156883d 100644 --- a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php @@ -72,8 +72,7 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers $this->errors = $object->context['linkto']->errors; $return = -1; } - else - { + else { $return = 1; } @@ -90,8 +89,7 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers $this->errors = $object->context['unlinkoff']->errors; $return = -1; } - else - { + else { $return = 1; } @@ -110,8 +108,7 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers if (!empty($object->error)) $this->errors[] = $object->error; $return = -1; } - else - { + else { $return = 1; } @@ -133,8 +130,7 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers if (!empty($object->oldcopy->error)) $this->errors[] = $object->oldcopy->error; $return = -1; } - else - { + else { $return = 1; } } @@ -145,8 +141,7 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers if (!empty($object->error)) $this->errors[] = $object->error; $return = -1; } - else - { + else { $return = 1; } } @@ -165,8 +160,7 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers if (!empty($object->error)) $this->errors[] = $object->error; $return = -1; } - else - { + else { $return = 1; } diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 6bd33c5b2f9..b3625c09e47 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -171,8 +171,7 @@ class InterfaceTicketEmail extends DolibarrTriggers $ok = 1; } - else - { + else { $this->error = $userstat->error; $this->errors = $userstat->errors; } diff --git a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php index e6c2df36ee1..303f4a523ad 100644 --- a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php +++ b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php @@ -178,8 +178,7 @@ class InterfaceStripe extends DolibarrTriggers $customer->createTaxId($customer->id, array('type'=>'eu_vat', 'value'=>$vatcleaned)); } } - else - { + else { $taxids = $customer->allTaxIds($customer->id); if (is_array($taxids->data)) { diff --git a/htdocs/core/website.inc.php b/htdocs/core/website.inc.php index 5c618b089a3..4ac9d00ca53 100644 --- a/htdocs/core/website.inc.php +++ b/htdocs/core/website.inc.php @@ -118,8 +118,7 @@ if ($_SERVER['PHP_SELF'] != DOL_URL_ROOT.'/website/index.php') // If we browsing header("Location: ".DOL_URL_ROOT.'/public/website/index.php?website='.$websitekey.'&pageid='.$newpageid.'&l='.GETPOST('l', 'aZ09')); exit; } - else - { + else { $newpageref = $obj->pageurl; header("Location: ".$newpageref.'.php?l='.GETPOST('l', 'aZ09')); exit; diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index a8bca51dda3..f20ac732fd4 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -137,8 +137,7 @@ if ($action == "setlive") if ($res > 0) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -238,15 +237,13 @@ if (empty($conf->stripeconnect->enabled)) print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } //print $endpoint; } - else - { + else { print img_picto($langs->trans("inactive"), 'statut5'); } } @@ -311,22 +308,19 @@ if (empty($conf->stripeconnect->enabled)) print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } //print $endpoint; } - else - { + else { print img_picto($langs->trans("inactive"), 'statut5'); } } print ''; } -else -{ +else { print ''.$langs->trans("StripeConnect").''; print ''.$langs->trans("StripeConnect_Mode").''; } diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 44c7db306a2..74fa1aafc43 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -66,8 +66,7 @@ if (!empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETP $servicestatus = '0'; dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); } -else -{ +else { $service = 'StripeLive'; $servicestatus = '1'; } @@ -86,8 +85,7 @@ if (!$rowid) { $list = \Stripe\Charge::all($option, array("stripe_account" => $stripeacc)); } - else - { + else { $list = \Stripe\Charge::all($option); } @@ -184,16 +182,14 @@ if (!$rowid) { $societestatic->fetch($charge->metadata->dol_thirdparty_id); } - else - { + else { $societestatic->id = 0; } if (!empty($tmparray['MEM']) && $tmparray['MEM'] > 0) { $memberstatic->fetch($tmparray['MEM']); } - else - { + else { $memberstatic->id = 0; } diff --git a/htdocs/stripe/class/actions_stripe.class.php b/htdocs/stripe/class/actions_stripe.class.php index 33b19384085..4b68ad72b09 100644 --- a/htdocs/stripe/class/actions_stripe.class.php +++ b/htdocs/stripe/class/actions_stripe.class.php @@ -76,8 +76,7 @@ class ActionsStripeconnect $service = 'StripeTest'; dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); } - else - { + else { $service = 'StripeLive'; } @@ -209,8 +208,7 @@ class ActionsStripeconnect $langs->load("withdrawals"); print ''.$langs->trans("StripeConnectPay").''; } - else - { + else { print ''.$langs->trans("StripeConnectPay").''; } } diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index a72e5291f58..4a56a2a1542 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -261,8 +261,7 @@ class Stripe extends CommonObject } } } - else - { + else { dol_print_error($this->db); } @@ -499,8 +498,7 @@ class Stripe extends CommonObject } } } - else - { + else { $_SESSION["stripe_payment_intent"] = $paymentintent; } } @@ -532,8 +530,7 @@ class Stripe extends CommonObject { return $paymentintent; } - else - { + else { return null; } } @@ -675,8 +672,7 @@ class Stripe extends CommonObject dol_syslog("getSetupIntent ".(is_object($setupintent) ? $setupintent->id : ''), LOG_INFO, -1); return $setupintent; } - else - { + else { dol_syslog("getSetupIntent return error=".$error, LOG_INFO, -1); return null; } @@ -721,8 +717,7 @@ class Stripe extends CommonObject { $card = $cu->sources->retrieve($cardref); } - else - { + else { $card = \Stripe\PaymentMethod::retrieve($cardref); } } else { @@ -769,8 +764,7 @@ class Stripe extends CommonObject $this->error = 'Creation of card on Stripe has failed'; } } - else - { + else { $connect = ''; if (!empty($stripeacc)) $connect = $stripeacc.'/'; $url = 'https://dashboard.stripe.com/'.$connect.'test/customers/'.$cu->id; @@ -793,8 +787,7 @@ class Stripe extends CommonObject $this->error = 'Creation of card on Stripe has failed'; } } - else - { + else { $connect = ''; if (!empty($stripeacc)) $connect = $stripeacc.'/'; $url = 'https://dashboard.stripe.com/'.$connect.'test/customers/'.$cu->id; @@ -832,8 +825,7 @@ class Stripe extends CommonObject } } } - else - { + else { dol_print_error($this->db); } @@ -944,8 +936,7 @@ class Stripe extends CommonObject { $charge->status = 'ok'; } - else - { + else { $charge->status = 'failed'; $charge->failure_code = $stripe->code; $charge->failure_message = $stripe->error; @@ -1039,16 +1030,14 @@ class Stripe extends CommonObject $charge->status = 'ok'; $charge->id = $paymentintent->id; } - else - { + else { $charge->status = 'failed'; $charge->failure_code = $stripe->code; $charge->failure_message = $stripe->error; $charge->failure_declinecode = $stripe->declinecode; } } - else - { + else { $charge = \Stripe\Charge::create($paymentarray, array("idempotency_key" => "$description", "stripe_account" => "$account")); } } @@ -1061,8 +1050,7 @@ class Stripe extends CommonObject { $return->message = 'Payment retreived by card status = '.$charge->status; } - else - { + else { if ($charge->source->type == 'card') { $return->message = $charge->source->card->brand." ....".$charge->source->card->last4; } elseif ($charge->source->type == 'three_d_secure') { diff --git a/htdocs/stripe/config.php b/htdocs/stripe/config.php index 730203245f4..1efe9a7f386 100644 --- a/htdocs/stripe/config.php +++ b/htdocs/stripe/config.php @@ -48,8 +48,7 @@ if (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha')) { $stripearrayofkeys = $stripearrayofkeysbyenv[0]; // Test } -else -{ +else { $stripearrayofkeys = $stripearrayofkeysbyenv[1]; // Live } diff --git a/htdocs/stripe/payout.php b/htdocs/stripe/payout.php index 17f2423327f..741921ac63c 100644 --- a/htdocs/stripe/payout.php +++ b/htdocs/stripe/payout.php @@ -65,8 +65,7 @@ if (!empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETP $servicestatus = '0'; dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); } -else -{ +else { $service = 'StripeLive'; $servicestatus = '1'; } @@ -115,8 +114,7 @@ if (!$rowid) { { $payout = \Stripe\Payout::all(array("limit" => $limit), array("stripe_account" => $stripeacc)); } - else - { + else { $payout = \Stripe\Payout::all(array("limit" => $limit)); } diff --git a/htdocs/stripe/transaction.php b/htdocs/stripe/transaction.php index 3829eba4d0d..eb0ce7df09e 100644 --- a/htdocs/stripe/transaction.php +++ b/htdocs/stripe/transaction.php @@ -66,8 +66,7 @@ if (!empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETP $servicestatus = '0'; dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); } -else -{ +else { $service = 'StripeLive'; $servicestatus = '1'; } @@ -114,8 +113,7 @@ if (!$rowid) { { $txn = \Stripe\BalanceTransaction::all(array("limit" => $limit), array("stripe_account" => $stripeacc)); } - else - { + else { $txn = \Stripe\BalanceTransaction::all(array("limit" => $limit)); } diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 08479b95871..d911e310d90 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -134,16 +134,14 @@ if (empty($reshook)) { setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors'); } - else - { + else { if ($object->id > 0) { $result = $object->createFromClone($user, $socid); if ($result > 0) { header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result); exit(); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } @@ -411,8 +409,7 @@ if (empty($reshook)) $error++; } } // Standard creation - else - { + else { $id = $object->create($user); } @@ -443,14 +440,12 @@ if (empty($reshook)) header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); exit(); } - else - { + else { $db->rollback(); $action = 'create'; } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); $action = 'create'; @@ -552,8 +547,7 @@ if (empty($reshook)) $price_ht = GETPOST('price_ht'); $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); } - else - { + else { $idprod = GETPOST('idprod', 'int'); $price_ht = ''; $tva_tx = ''; @@ -622,8 +616,7 @@ if (empty($reshook)) $productsupplier->ref_supplier = ''; } } - else - { + else { $fksoctosearch = $object->thirdparty->id; $productsupplier->get_buyprice(0, -1, $idprod, 'none', $fksoctosearch); // We force qty to -1 to be sure to find if a supplier price exist } @@ -738,8 +731,7 @@ if (empty($reshook)) { $pu_ht = price2num($price_ht, 'MU'); // $pu_ht must be rounded according to settings } - else - { + else { $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); $pu_ht = price2num($pu_ttc / (1 + ($tva_tx / 100)), 'MU'); // $pu_ht must be rounded according to settings } @@ -835,8 +827,7 @@ if (empty($reshook)) unset($_POST['date_endmonth']); unset($_POST['date_endyear']); } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); @@ -1139,8 +1130,7 @@ if ($action == 'create') if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX) && !empty($objectsrc->multicurrency_tx)) $currency_tx = $objectsrc->multicurrency_tx; } } - else - { + else { $cond_reglement_id = $soc->cond_reglement_supplier_id; $mode_reglement_id = $soc->mode_reglement_supplier_id; if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code; @@ -1895,8 +1885,7 @@ if ($action == 'create') if ($object->statut == SupplierProposal::STATUS_VALIDATED || $object->statut == SupplierProposal::STATUS_SIGNED) { if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->supplier_proposal->send_advance) { print ''; - } else - print ''; + } else print ''; } } diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 97c0ee27e4e..42c30c333d6 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -274,8 +274,7 @@ class SupplierProposal extends CommonObject { $price = $prod->multiprices[$this->thirdparty->price_level]; } - else - { + else { $price = $prod->price; } @@ -347,21 +346,18 @@ class SupplierProposal extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = $supplier_proposalligne->error; $this->db->rollback(); return -2; } } - else - { + else { $this->db->rollback(); return -2; } @@ -431,8 +427,7 @@ class SupplierProposal extends CommonObject { $pu = $pu_ht; } - else - { + else { $pu = $pu_ttc; } @@ -493,16 +488,14 @@ class SupplierProposal extends CommonObject return -1; } } - else - { + else { $this->error = $prod->error; $this->db->rollback(); return -1; } } } - else - { + else { $product_type = $type; } @@ -623,22 +616,19 @@ class SupplierProposal extends CommonObject $this->db->commit(); return $this->line->id; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; } } - else - { + else { $this->error = $this->line->error; $this->db->rollback(); return -2; } } - else - { + else { $this->error = 'BadStatusOfObjectToAddLine'; return -5; } @@ -809,15 +799,13 @@ class SupplierProposal extends CommonObject $this->db->commit(); return $result; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; } } - else - { + else { dol_syslog(get_class($this)."::updateline Erreur -2 SupplierProposal en mode incompatible pour cette action"); return -2; } @@ -845,13 +833,11 @@ class SupplierProposal extends CommonObject return 1; } - else - { + else { return -1; } } - else - { + else { return -2; } } @@ -1080,15 +1066,13 @@ class SupplierProposal extends CommonObject // End call triggers } } - else - { + else { $this->error = $this->db->lasterror(); $error++; } } } - else - { + else { $this->error = $this->db->lasterror(); $error++; } @@ -1099,14 +1083,12 @@ class SupplierProposal extends CommonObject dol_syslog(get_class($this)."::create done id=".$this->id); return $this->id; } - else - { + else { $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -1168,8 +1150,7 @@ class SupplierProposal extends CommonObject // TODO Change product price if multi-prices } - else - { + else { $objsoc->fetch($this->socid); } @@ -1218,8 +1199,7 @@ class SupplierProposal extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -1; } @@ -1411,8 +1391,7 @@ class SupplierProposal extends CommonObject } $this->db->free($result); } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -1427,8 +1406,7 @@ class SupplierProposal extends CommonObject $this->error = "Record Not Found"; return 0; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -1464,8 +1442,7 @@ class SupplierProposal extends CommonObject { $num = $this->getNextNumRef($soc); } - else - { + else { $num = $this->ref; } $this->newref = dol_sanitizeFileName($num); @@ -1539,14 +1516,12 @@ class SupplierProposal extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { dol_syslog("You don't have permission to validate supplier proposal", LOG_WARNING); return -2; } @@ -1574,8 +1549,7 @@ class SupplierProposal extends CommonObject $this->date_livraison = $date_livraison; return 1; } - else - { + else { $this->error = $this->db->error(); dol_syslog(get_class($this)."::set_date_livraison Erreur SQL"); return -1; @@ -1609,8 +1583,7 @@ class SupplierProposal extends CommonObject $this->update_price(1); return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -1645,8 +1618,7 @@ class SupplierProposal extends CommonObject $this->update_price(1); return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -1709,8 +1681,7 @@ class SupplierProposal extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -1783,14 +1754,12 @@ class SupplierProposal extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = $this->db->lasterror(); $this->errors[] = $this->db->lasterror(); $this->db->rollback(); @@ -1958,8 +1927,7 @@ class SupplierProposal extends CommonObject return -1; } } - else - { + else { return -1; } } @@ -2024,8 +1992,7 @@ class SupplierProposal extends CommonObject { $ga[$obj->supplier_proposalid] = $obj->ref.' ('.$obj->name.')'; } - else - { + else { $ga[$i]['id'] = $obj->supplier_proposalid; $ga[$i]['ref'] = $obj->ref; $ga[$i]['name'] = $obj->name; @@ -2036,8 +2003,7 @@ class SupplierProposal extends CommonObject } return $ga; } - else - { + else { dol_print_error($this->db); return -1; } @@ -2134,29 +2100,25 @@ class SupplierProposal extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return 0; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -3; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; } } - else - { + else { $this->db->rollback(); return -1; } @@ -2210,8 +2172,7 @@ class SupplierProposal extends CommonObject } $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -2341,8 +2302,7 @@ class SupplierProposal extends CommonObject } return $response; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -2410,8 +2370,7 @@ class SupplierProposal extends CommonObject $line->total_tva = 9.8; $line->remise_percent = 50; } - else - { + else { $line->total_ht = 100; $line->total_ttc = 119.6; $line->total_tva = 19.6; @@ -2470,8 +2429,7 @@ class SupplierProposal extends CommonObject $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->lasterror(); return -1; @@ -2521,14 +2479,12 @@ class SupplierProposal extends CommonObject { return $numref; } - else - { + else { $this->error = $obj->error; return ""; } } - else - { + else { $langs->load("errors"); print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("SupplierProposal")); return ""; @@ -2699,8 +2655,7 @@ class SupplierProposal extends CommonObject return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -2995,8 +2950,7 @@ class SupplierProposalLine extends CommonObjectLine $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -3042,8 +2996,7 @@ class SupplierProposalLine extends CommonObjectLine { return $result; } - else - { + else { $this->pa_ht = $result; } } @@ -3130,8 +3083,7 @@ class SupplierProposalLine extends CommonObjectLine $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error()." sql=".$sql; $this->db->rollback(); return -1; @@ -3178,8 +3130,7 @@ class SupplierProposalLine extends CommonObjectLine return 1; } - else - { + else { $this->error = $this->db->error()." sql=".$sql; $this->db->rollback(); return -1; @@ -3225,8 +3176,7 @@ class SupplierProposalLine extends CommonObjectLine { return $result; } - else - { + else { $this->pa_ht = $result; } } @@ -3301,8 +3251,7 @@ class SupplierProposalLine extends CommonObjectLine $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -2; @@ -3336,8 +3285,7 @@ class SupplierProposalLine extends CommonObjectLine $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -2; diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php index 43c9b91f563..8f606ad4f67 100644 --- a/htdocs/supplier_proposal/contact.php +++ b/htdocs/supplier_proposal/contact.php @@ -66,15 +66,13 @@ if ($action == 'addcontact' && $permissiontoedit) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -87,8 +85,7 @@ elseif ($action == 'swapstatut' && $permissiontoedit) { $result = $object->swapContactStatus(GETPOST('ligne')); } - else - { + else { dol_print_error($db); } } @@ -195,8 +192,7 @@ if ($id > 0 || !empty($ref)) // Contacts lines include DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php'; } - else - { + else { // Contact not found print "ErrorRecordNotFound"; } diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php index 3f471e28b3f..3096e6fbbdb 100644 --- a/htdocs/supplier_proposal/document.php +++ b/htdocs/supplier_proposal/document.php @@ -167,8 +167,7 @@ if ($object->id > 0) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php index e8432ad8fe4..7a575007be2 100644 --- a/htdocs/supplier_proposal/index.php +++ b/htdocs/supplier_proposal/index.php @@ -163,8 +163,7 @@ if ($resql) print ''.$langs->trans("Total").''.$total.''; print "

"; } -else -{ +else { dol_print_error($db); } @@ -384,8 +383,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa print "

"; } } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index ded5d9ca2bf..eba1db92a94 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -359,8 +359,7 @@ if ($resql) $soc->fetch($socid); $title = $langs->trans('ListOfSupplierProposals').' - '.$soc->name; } - else - { + else { $title = $langs->trans('ListOfSupplierProposals'); } @@ -951,8 +950,7 @@ if ($resql) print $formfile->showdocuments('massfilesarea_supplier_proposal', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/support/inc.php b/htdocs/support/inc.php index 7e5b6aaf531..3f09ac541d3 100644 --- a/htdocs/support/inc.php +++ b/htdocs/support/inc.php @@ -111,13 +111,11 @@ if (!defined('DONOTLOADCONF') && file_exists($conffile) && filesize($conffile) > } } } - else - { + else { $includeconferror = 'ErrorBadValueForDolibarrMainDocumentRoot'; } } - else - { + else { $includeconferror = 'ErrorBadFormatForConfFile'; } } diff --git a/htdocs/takepos/admin/bar.php b/htdocs/takepos/admin/bar.php index 2508ab56040..a33f337cc96 100644 --- a/htdocs/takepos/admin/bar.php +++ b/htdocs/takepos/admin/bar.php @@ -53,8 +53,7 @@ if (GETPOST('action', 'alpha') == 'set') $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } diff --git a/htdocs/takepos/admin/orderprinters.php b/htdocs/takepos/admin/orderprinters.php index 566f18ac1a4..f0410f812d9 100644 --- a/htdocs/takepos/admin/orderprinters.php +++ b/htdocs/takepos/admin/orderprinters.php @@ -147,8 +147,7 @@ if ($nbofentries > 0) } print ''; } -else -{ +else { print ''; print ''; print ''; } -else -{ +else { print ''; print '
'.img_picto_common('', 'treemenu/branchbottom.gif').''; @@ -177,8 +176,7 @@ if ($nbofentries > 0) } print '
'; print '\n"; @@ -122,8 +120,7 @@ if ($conf->receiptprinter->enabled) { { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print "\n"; @@ -139,8 +136,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { print img_picto($langs->trans("Activated"), 'switch_on'); } -else -{ +else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print "\n"; @@ -176,8 +172,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "browser" || $conf->global->TAKEPOS_P { print ''; } - else - { + else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); @@ -192,8 +187,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "browser" || $conf->global->TAKEPOS_P { print ''; } - else - { + else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index 85406c46faa..f4e86677a1b 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -97,8 +97,7 @@ if ($action == 'set') { $db->commit(); } - else - { + else { $db->rollback(); } } elseif ($action == 'updateMask') { @@ -196,8 +195,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 46d168ddd24..e2996ad763d 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -103,8 +103,7 @@ if (GETPOST('action', 'alpha') == 'set') $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } @@ -188,8 +187,7 @@ if (!empty($conf->stock->enabled)) if (empty($conf->productbatch->enabled) || !empty($conf->global->CASHDESK_FORCE_DECREASE_STOCK)) { print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK'.$terminal, $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}, 1); } - else - { + else { if (!$conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}) { $res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK".$terminal, 1, 'chaine', 0, '', $conf->entity); } @@ -208,8 +206,7 @@ if (!empty($conf->stock->enabled)) print $formproduct->selectWarehouses($conf->global->{'CASHDESK_ID_WAREHOUSE'.$terminal}, 'CASHDESK_ID_WAREHOUSE'.$terminal, '', 1, $disabled); print ' '; } - else - { + else { print ''.$langs->trans("StockDecreaseForPointOfSaleDisabled").''; } print ''; diff --git a/htdocs/takepos/ajax/ajax.php b/htdocs/takepos/ajax/ajax.php index d1f59325c1f..75c40e6607e 100644 --- a/htdocs/takepos/ajax/ajax.php +++ b/htdocs/takepos/ajax/ajax.php @@ -65,8 +65,7 @@ if ($action == 'getProducts') { } echo json_encode($prods); } - else - { + else { echo 'Failed to load category with id='.$category; } } diff --git a/htdocs/takepos/genimg/index.php b/htdocs/takepos/genimg/index.php index e668b01aacb..8a752a5d3a5 100644 --- a/htdocs/takepos/genimg/index.php +++ b/htdocs/takepos/genimg/index.php @@ -56,8 +56,7 @@ if ($query == "cat") { $filename = $obj['photo_vignette']; } - else - { + else { $filename = $obj['photo']; } $file = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=category&entity='.$object->entity.'&file='.urlencode($pdir.$filename); @@ -79,8 +78,7 @@ elseif ($query == "pro") if ($file == "") header('Location: ../../public/theme/common/nophoto.png'); else header('Location: '.$file.'&cache=1&publictakepos=1&modulepart=product'); } -else -{ +else { // TODO We don't need this. Size of image must be defined on HTML page, image must NOT be resize when downloaded. // The file diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index dbc68afeaf4..94cc526434e 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -135,8 +135,7 @@ foreach ($categories as $key => $categorycursor) { $maincategories[$key] = $categorycursor; } - else - { + else { $subcategories[$key] = $categorycursor; } } @@ -858,8 +857,7 @@ if (empty($conf->global->TAKEPOS_BAR_RESTAURANT)) { $menus[$r++] = array('title'=>'
'.$langs->trans("New").'
', 'action'=>'New();'); } -else -{ +else { // BAR RESTAURANT specific menu $menus[$r++] = array('title'=>'
'.$langs->trans("Place").'
', 'action'=>'Floors();'); } @@ -988,8 +986,7 @@ if (!empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { //echo ''; echo ''; } - else - { + else { echo ''; } ?> @@ -1023,8 +1020,7 @@ if (!empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { //echo ''; print ''; } - else - { + else { print '
'; print ''; } diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 16012022dc9..274e47a1185 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -57,8 +57,7 @@ if (($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT == 1 && $conf->browser->layout == if ($_SESSION["takeposterminal"] == "") { if ($conf->global->TAKEPOS_NUM_TERMINALS == "1") $_SESSION["takeposterminal"] = 1; - else - { + else { header("Location: ".DOL_URL_ROOT."/takepos/index.php"); exit; } @@ -118,8 +117,7 @@ if ($invoiceid > 0) { $ret = $invoice->fetch($invoiceid); } -else -{ +else { $ret = $invoice->fetch('', '(PROV-POS'.$_SESSION["takeposterminal"].'-'.$place.')'); } if ($ret > 0) @@ -143,8 +141,7 @@ if ($action == 'valid' && $user->rights->facture->creer) if ($pay == "cash") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]}; // For backward compatibility elseif ($pay == "card") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$_SESSION["takeposterminal"]}; // For backward compatibility elseif ($pay == "cheque") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]}; // For backward compatibility - else - { + else { $accountname = "CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takeposterminal"]; $bankaccount = $conf->global->$accountname; } @@ -211,8 +208,7 @@ if ($action == 'valid' && $user->rights->facture->creer) $conf->global->STOCK_CALCULATE_ON_BILL = $savconst; } - else - { + else { $res = $invoice->validate($user); } @@ -275,8 +271,7 @@ if (($action == "addline" || $action == "freezone") && $placeid == 0) $langs->load('errors'); dol_htmloutput_errors($langs->trans("ErrorModuleSetupNotComplete", "TakePos"), null, 1); } - else - { + else { $placeid = $invoice->create($user); if ($placeid < 0) { @@ -421,8 +416,7 @@ if ($action == "delete") { { $db->commit(); } - else - { + else { $db->rollback(); } @@ -581,8 +575,7 @@ if ($action == "valid" || $action == "history") { $sectionwithinvoicelink .= $langs->trans('RemainToPay').': '.price($remaintopay, 1, $langs, 1, -1, -1, $conf->currency).''; } - else - { + else { if ($invoice->paye) $sectionwithinvoicelink .= ''.$langs->trans("Paid").''; else $sectionwithinvoicelink .= $langs->trans('BillShortStatusValidated'); } @@ -814,14 +807,12 @@ $( document ).ready(function() { $s .= " ".img_warning($langs->trans("Late")); } } - else - { + else { $s .= '
'.$langs->trans("SubscriptionNotReceived"); if ($adh->statut > 0) $s .= " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated } } - else - { + else { $s .= '
'.$langs->trans("ThirdpartyNotLinkedToMember"); } $s .= ''; @@ -968,8 +959,7 @@ if ($placeid > 0) { $htmlsupplements[$line->fk_parent_line] .= $form->textwithpicto(dolGetFirstLineOfText($line->desc), $line->desc); } - else - { + else { $htmlsupplements[$line->fk_parent_line] .= $line->desc; } } @@ -1019,8 +1009,7 @@ if ($placeid > 0) { $htmlforlines .= $form->textwithpicto(dolGetFirstLineOfText($line->desc), $line->desc); } - else - { + else { $htmlforlines .= $line->desc; } } @@ -1048,8 +1037,7 @@ if ($placeid > 0) print $htmlforlines; } } - else - { + else { print ''; } } diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index b2534272ae2..f370387d72e 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -52,8 +52,7 @@ if ($invoiceid > 0) { $invoice->fetch($invoiceid); } -else -{ +else { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; $resql = $db->query($sql); $obj = $db->fetch_object($resql); @@ -65,8 +64,7 @@ else { $invoiceid = 0; // Invoice does not exist yet } - else - { + else { $invoice->fetch($invoiceid); } } diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index 90f0aa363dc..1cad9a9ede4 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -136,8 +136,7 @@ else { { $maincategories[$key] = $categorycursor; } - else - { + else { $subcategories[$key] = $categorycursor; } } diff --git a/htdocs/takepos/reduction.php b/htdocs/takepos/reduction.php index 7be5ee85938..4d11663ea85 100644 --- a/htdocs/takepos/reduction.php +++ b/htdocs/takepos/reduction.php @@ -52,8 +52,7 @@ if ($invoiceid > 0) { $invoice->fetch($invoiceid); } -else -{ +else { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; $resql = $db->query($sql); $obj = $db->fetch_object($resql); @@ -65,8 +64,7 @@ else { $invoiceid = 0; // Invoice does not exist yet } - else - { + else { $invoice->fetch($invoiceid); } } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index fc365ae5812..dc25fa4b44a 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2120,8 +2120,7 @@ a.tmenuimage:hover{ content: "\f249"; }'."\n"; } - else - { + else { print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n"; $url = dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.(min($generic, 4))."_over.png", 1); print "div.mainmenu.".$val." {\n"; @@ -2130,8 +2129,7 @@ a.tmenuimage:hover{ } $generic++; } - else - { + else { print "div.mainmenu.".$val." {\n"; print " background-image: url(".$url.");\n"; print "}\n"; diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index d2a11725ecf..6a4f1ebf7e1 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -41,8 +41,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) // File is run after an include of a php p { $theme_datacolor = array(array(157, 56, 191), array(0, 147, 183), array(250, 190, 30), array(221, 75, 57), array(0, 166, 90), array(140, 140, 220), array(190, 120, 120), array(190, 190, 100), array(115, 125, 150), array(100, 170, 20), array(150, 135, 125), array(85, 135, 150), array(150, 135, 80), array(150, 80, 150)); } - else - { + else { // for now we use the same configuration for all types of color blind $theme_datacolor = array(array(248, 220, 1), array(9, 85, 187), array(42, 208, 255), array(0, 0, 0), array(169, 169, 169), array(253, 102, 136), array(120, 154, 190), array(146, 146, 55), array(0, 52, 251), array(196, 226, 161), array(222, 160, 41), array(85, 135, 150), array(150, 135, 80), array(150, 80, 150)); } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index c43fa9cd7d9..a7b759cfea0 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2148,8 +2148,7 @@ div.mainmenu.website { content: "\f249"; }'; } - else - { + else { print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one. */\n"; print "/* Overwrite this definition in your own css with a different content to use your own font awesome icon. */\n"; $url = dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.(min($generic, 4))."_over.png", 1); @@ -2159,8 +2158,7 @@ div.mainmenu.website { } $generic++; } - else - { + else { print "div.mainmenu.".$val." {\n"; print " background-image: url(".$url.");\n"; print "}\n"; diff --git a/htdocs/theme/md/theme_vars.inc.php b/htdocs/theme/md/theme_vars.inc.php index ffad2cc66b5..7d492bcae6a 100644 --- a/htdocs/theme/md/theme_vars.inc.php +++ b/htdocs/theme/md/theme_vars.inc.php @@ -37,8 +37,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) // File is run after an include of a php p { $theme_datacolor = array(array(157, 56, 191), array(0, 147, 183), array(250, 190, 30), array(221, 75, 57), array(0, 166, 90), array(140, 140, 220), array(190, 120, 120), array(190, 190, 100), array(115, 125, 150), array(100, 170, 20), array(150, 135, 125), array(85, 135, 150), array(150, 135, 80), array(150, 80, 150)); } - else - { + else { // for now we use the same configuration for all types of color blind $theme_datacolor = array(array(248, 220, 1), array(9, 85, 187), array(42, 208, 255), array(0, 0, 0), array(169, 169, 169), array(253, 102, 136), array(120, 154, 190), array(146, 146, 55), array(0, 52, 251), array(196, 226, 161), array(222, 160, 41), array(85, 135, 150), array(150, 135, 80), array(150, 80, 150)); } diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index 2c473a9de54..2fd3b2643e0 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -57,8 +57,7 @@ if (GETPOST('actioncode', 'array')) $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; } -else -{ +else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 6e400b3eeaa..2e61ce15045 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1207,8 +1207,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd } print ''."\n"; } - else - { + else { print '
'; } diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index 0fb5835cb4c..f701fabc2c0 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -397,8 +397,7 @@ class ActionsTicket { $urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=mark_ticket_read'; // To set as read, we use a dedicated action } - else - { + else { $urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=set_status&new_status='.$status; } diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 4db98cfe7ad..0f6994d6a03 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -542,8 +542,7 @@ class Ticket extends CommonObject $this->db->free($resql); return 1; } - else - { + else { return 0; } } else { @@ -1354,8 +1353,7 @@ class Ticket extends CommonObject { $sql .= " SET fk_user_assign=".$id_assign_user.", fk_statut = ".Ticket::STATUS_ASSIGNED; } - else - { + else { $sql .= " SET fk_user_assign=null, fk_statut = ".Ticket::STATUS_READ; } $sql .= " WHERE rowid = ".$this->id; @@ -2767,8 +2765,7 @@ class Ticket extends CommonObject } return $response; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -2810,8 +2807,7 @@ class Ticket extends CommonObject $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->lasterror(); return -1; diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php index d48001a680e..86f671d876b 100644 --- a/htdocs/ticket/document.php +++ b/htdocs/ticket/document.php @@ -196,8 +196,7 @@ if ($object->id) include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { accessforbidden('', 0, 1); } diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 1331e2be12e..4d1cb7a5d60 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -286,8 +286,7 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) { $num = $nbtotalofrecords; } -else -{ +else { $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index 0a6c8067db5..c35b60ab42e 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -57,8 +57,7 @@ if (GETPOST('actioncode', 'array')) $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; } -else -{ +else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/ticket/stats/index.php b/htdocs/ticket/stats/index.php index b39ba0fd366..e6760ba9c4d 100644 --- a/htdocs/ticket/stats/index.php +++ b/htdocs/ticket/stats/index.php @@ -85,8 +85,7 @@ if (!$user->rights->societe->client->voir || $user->socid) $filenamenb = $dir.'/ticketsnbinyear-'.$user->id.'-'.$year.'.png'; $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=ticketstats&file=ticketsnbinyear-'.$user->id.'-'.$year.'.png'; } -else -{ +else { $filenamenb = $dir.'/ticketsnbinyear-'.$year.'.png'; $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=ticketstats&file=ticketsnbinyear-'.$year.'.png'; } @@ -126,8 +125,7 @@ if (!$user->rights->societe->client->voir || $user->socid) $filenameamount = $dir.'/ticketsamountinyear-'.$user->id.'-'.$year.'.png'; $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=ticketstats&file=ticketsamountinyear-'.$user->id.'-'.$year.'.png'; } -else -{ +else { $filenameamount = $dir.'/ticketsamountinyear-'.$year.'.png'; $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=ticketstats&file=ticketsamountinyear-'.$year.'.png'; } @@ -165,8 +163,7 @@ if (!$user->rights->societe->client->voir || $user->socid) $filename_avg = $dir.'/ticketsaverage-'.$user->id.'-'.$year.'.png'; $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=ticketstats&file=ticketsaverage-'.$user->id.'-'.$year.'.png'; } -else -{ +else { $filename_avg = $dir.'/ticketsaverage-'.$year.'.png'; $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=ticketstats&file=ticketsaverage-'.$year.'.png'; } diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 3bdc6b5390c..a02e2c17ec6 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -72,8 +72,7 @@ if (!$bankid) { $account->fetch(0, '', $id); } -else -{ +else { $account->fetch($bankid); } if (empty($account->userid)) $account->userid = $object->id; @@ -107,8 +106,7 @@ if ($action == 'add' && !$cancel) setEventMessages($account->error, $account->errors, 'errors'); $action = 'edit'; // Force chargement page edition } - else - { + else { setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); $action = ''; } @@ -138,8 +136,7 @@ if ($action == 'update' && !$cancel) setEventMessages($account->error, $account->errors, 'errors'); $action = 'edit'; // Force chargement page edition } - else - { + else { setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); $action = ''; } @@ -284,8 +281,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco if ($num <= 0) print '
'.img_picto_common('', 'treemenu/branchbottom.gif').''; diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php index 83b31569a7b..7ed4f2786b2 100644 --- a/htdocs/takepos/admin/receipt.php +++ b/htdocs/takepos/admin/receipt.php @@ -58,8 +58,7 @@ if (GETPOST('action', 'alpha') == 'set') $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } @@ -105,8 +104,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "browser") { print img_picto($langs->trans("Activated"), 'switch_on'); } -else -{ +else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print "
'.$langs->trans("Empty").'
'.$langs->trans("None").''; print "
"; } - else - { + else { dol_print_error($db); } } @@ -340,8 +336,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco if ($num <= 0) print '
'.$langs->trans("None").''; print "
"; } - else - { + else { dol_print_error($db); } } @@ -395,8 +390,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco if ($num <= 0) print ''.$langs->trans("None").''; print ""; } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/user/card.php b/htdocs/user/card.php index cd115dbe292..3e7b36e5189 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -295,8 +295,7 @@ if (empty($reshook)) { header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); exit; } - else - { + else { $langs->load("errors"); $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); @@ -326,8 +325,7 @@ if (empty($reshook)) { header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -429,13 +427,11 @@ if (empty($reshook)) { { $object->entity = 1; // all users in master entity } - else - { + else { $object->entity = (!GETPOST('entity', 'int') ? 0 : GETPOST('entity', 'int')); } } - else - { + else { $object->entity = (!GETPOST('entity', 'int') ? 0 : GETPOST('entity', 'int')); } @@ -455,8 +451,7 @@ if (empty($reshook)) { { $object->photo = dol_sanitizeFileName($_FILES['photo']['name']); } - else - { + else { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); @@ -472,8 +467,7 @@ if (empty($reshook)) { $langs->load("errors"); setEventMessages($langs->trans("ErrorLoginAlreadyExists", $object->login), null, 'errors'); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -565,8 +559,7 @@ if (empty($reshook)) { } } } - else - { + else { if ($caneditpassword) // Case we can edit only password { dol_syslog("Not allowed to change fields, only password"); @@ -603,13 +596,11 @@ if (empty($reshook)) { { setEventMessages($langs->trans("PasswordChangedAndSentTo", $object->email), null, 'mesgs'); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { setEventMessages($langs->trans("PasswordChangedTo", $newpassword), null, 'warnings'); } } @@ -666,8 +657,7 @@ if (empty($reshook)) { } } } - else - { + else { setEventMessages($ldap->error, $ldap->errors, 'errors'); } } @@ -765,13 +755,11 @@ if ($action == 'create' || $action == 'adduserldap') $liste[$key] = $label; } } - else - { + else { setEventMessages($ldap->error, $ldap->errors, 'errors'); } } - else - { + else { setEventMessages($ldap->error, $ldap->errors, 'errors'); } @@ -822,8 +810,7 @@ if ($action == 'create' || $action == 'adduserldap') print ''; print $ldap_lastname; } - else - { + else { print ''; } print ''; @@ -836,8 +823,7 @@ if ($action == 'create' || $action == 'adduserldap') print ''; print $ldap_firstname; } - else - { + else { print ''; } print ''; @@ -855,8 +841,7 @@ if ($action == 'create' || $action == 'adduserldap') print ''; print $ldap_loginsmb; } - else - { + else { print ''; } print ''; @@ -887,8 +872,7 @@ if ($action == 'create' || $action == 'adduserldap') $valuetoshow .= ($valuetoshow ? ', ' : '').''; // Dolibarr password is preffiled with LDAP known password $valuetoshow .= preg_replace('/./i', '*', $ldap_pass); } - else - { + else { // We do not use a field password but a field text to show new password to use. $valuetoshow .= ($valuetoshow ? ', ' : '').''; } @@ -914,8 +898,7 @@ if ($action == 'create' || $action == 'adduserldap') print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_api_key" class="linkobject"'); print ''; } - else - { + else { // PARTIAL WORKAROUND $generated_fake_api_key = getRandomPassword(false); print ''; @@ -1060,8 +1043,7 @@ if ($action == 'create' || $action == 'adduserldap') print ''; print $ldap_phone; } - else - { + else { print ''; } print ''; @@ -1074,8 +1056,7 @@ if ($action == 'create' || $action == 'adduserldap') print ''; print $ldap_mobile; } - else - { + else { print ''; } print ''; @@ -1088,8 +1069,7 @@ if ($action == 'create' || $action == 'adduserldap') print ''; print $ldap_fax; } - else - { + else { print ''; } print ''; @@ -1102,8 +1082,7 @@ if ($action == 'create' || $action == 'adduserldap') print ''; print $ldap_mail; } - else - { + else { print ''; } print ''; @@ -1237,8 +1216,7 @@ if ($action == 'create' || $action == 'adduserldap') print "".$mc->select_entities($conf->entity); print "\n"; } - else - { + else { print ''; } } @@ -1358,8 +1336,7 @@ if ($action == 'create' || $action == 'adduserldap') print ""; } -else -{ +else { /* ************************************************************************** */ /* */ /* View and edition */ @@ -1411,8 +1388,7 @@ else } } } - else - { + else { $userDisabled = 1; $statutUACF = "ACCOUNTDISABLE"; } @@ -1430,8 +1406,7 @@ else $title = $langs->trans("Employee"); $linkback = ''.$langs->trans("BackToList").''; } - else - { + else { $title = $langs->trans("User"); $linkback = ''; @@ -1503,8 +1478,7 @@ else { print ''.$langs->trans("LoginAccountDisableInDolibarr").''; } - else - { + else { print ''.$object->login.''; } print ''."\n"; @@ -1530,13 +1504,11 @@ else { $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').''.$langs->trans("LdapUacf_".$statutUACF, $ldap->domainFQDN).''; } - else - { + else { $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').$langs->trans("PasswordOfUserInLDAP"); } } - else - { + else { $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').$langs->trans("PasswordOfUserInLDAP"); } } @@ -1547,8 +1519,7 @@ else if (preg_match('/dolibarr/', $dolibarr_main_authentication)) { if ($object->pass) $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').preg_replace('/./i', '*', $object->pass); - else - { + else { if ($user->admin) $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').$langs->trans("Crypted").': '.$object->pass_indatabase_crypted; else $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').''.$langs->trans("Hidden").''; } @@ -1582,8 +1553,7 @@ else { print $form->textwithpicto(yn($object->admin), $langs->trans("AdministratorDesc"), 1, "admin"); } - else - { + else { print yn($object->admin); } print ''."\n"; @@ -1826,8 +1796,7 @@ else $societe->fetch($object->socid); print $societe->getNomUrl(1, ''); } - else - { + else { print $langs->trans("ThisUserIsNot"); } if (!empty($object->contactid)) @@ -1855,8 +1824,7 @@ else $adh->ref = $adh->getFullname($langs); // Force to show login instead of id print $adh->getNomUrl(1); } - else - { + else { print $langs->trans("UserNotLinkedToMember"); } print ''; @@ -1894,8 +1862,7 @@ else $langs->load("mails"); print ''; } - else - { + else { $langs->load("mails"); print ''; } @@ -1907,8 +1874,7 @@ else { print ''; } - else - { + else { print ''; } } @@ -1955,8 +1921,7 @@ else { print ''; } - else - { + else { if ($user->id == $id) { print ''; @@ -1970,8 +1935,7 @@ else { print ''; } - else - { + else { print ''; } } @@ -2055,8 +2019,7 @@ else { print $group->getNomUrl(1); } - else - { + else { print img_object($langs->trans("ShowGroup"), "group").' '.$group->name; } print ''; @@ -2067,15 +2030,13 @@ else print img_picto($langs->trans("RemoveFromGroup"), 'unlink'); print ''; } - else - { + else { print " "; } print "\n"; } } - else - { + else { print ''.$langs->trans("None").''; } @@ -2123,8 +2084,7 @@ else { print ''; } - else - { + else { print ''; print $object->lastname; } @@ -2138,8 +2098,7 @@ else { print ''; } - else - { + else { print ''; print $object->firstname; } @@ -2152,8 +2111,7 @@ else { print ''; } - else - { + else { print ''; print $object->login; } @@ -2178,8 +2136,7 @@ else { $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').''; } - else - { + else { $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').preg_replace('/./i', '*', $object->pass); } } @@ -2214,8 +2171,7 @@ else print ' ('.$langs->trans("ExternalUser").')'; print ''; } - else - { + else { print ''; $nbAdmin = $user->getNbOfUsers('active', '', 1); $nbSuperAdmin = $user->getNbOfUsers('active', 'superadmin', 1); @@ -2276,8 +2232,7 @@ else print ' '.$langs->trans("SuperAdministrator"); } } - else - { + else { $yn = yn($object->admin); print ''; print ''; @@ -2298,8 +2253,7 @@ else print $form->textwithpicto($type, $langs->trans("InternalExternalDesc")); if ($object->ldap_sid) print ' ('.$langs->trans("DomainUser").')'; } - else - { + else { // Select mode $type = 0; if ($object->contactid) $type = $object->contactid; @@ -2351,8 +2305,7 @@ else { print $form->select_dolusers($object->fk_user, 'fk_user', 1, array($object->id), 0, '', 0, $object->entity, 0, 0, '', 0, '', 'maxwidth300'); } - else - { + else { print ''; $huser = new User($db); $huser->fetch($object->fk_user); @@ -2371,8 +2324,7 @@ else { print $form->select_dolusers($object->fk_user_expense_validator, 'fk_user_expense_validator', 1, array($object->id), 0, '', 0, $object->entity, 0, 0, '', 0, '', 'maxwidth300'); } - else - { + else { print ''; $evuser = new User($db); $evuser->fetch($object->fk_user_expense_validator); @@ -2391,8 +2343,7 @@ else { print $form->select_dolusers($object->fk_user_holiday_validator, 'fk_user_holiday_validator', 1, array($object->id), 0, '', 0, $object->entity, 0, 0, '', 0, '', 'maxwidth300'); } - else - { + else { print ''; $hvuser = new User($db); $hvuser->fetch($object->fk_user_holiday_validator); @@ -2461,8 +2412,7 @@ else { print ''; } - else - { + else { print ''; print $object->office_phone; } @@ -2475,8 +2425,7 @@ else { print ''; } - else - { + else { print ''; print $object->user_mobile; } @@ -2489,8 +2438,7 @@ else { print ''; } - else - { + else { print ''; print $object->office_fax; } @@ -2503,8 +2451,7 @@ else { print ''; } - else - { + else { print ''; print $object->email; } @@ -2538,8 +2485,7 @@ else { print ''; } - else - { + else { print ''; print $object->openid; } @@ -2558,8 +2504,7 @@ else { print ''; } - else - { + else { print ''; print $object->accountancy_code; } @@ -2632,8 +2577,7 @@ else print ' / '.img_object($langs->trans("ShowContact"), 'contact').' '.dol_trunc($contact->getFullName($langs), 32).''; } } - else - { + else { print $langs->trans("ThisUserIsNot"); } print ' ('.$langs->trans("UseTypeFieldToChange").')'; @@ -2654,8 +2598,7 @@ else $adh->ref = $adh->login; // Force to show login instead of id print $adh->getNomUrl(1); } - else - { + else { print $langs->trans("UserNotLinkedToMember"); } print ''; @@ -2675,8 +2618,7 @@ else print "".$mc->select_entities($object->entity, 'entity', '', 0, 1, false, false, 1); // last parameter 1 means, show also a choice 0=>'all entities' print "\n"; } - else - { + else { print ''; } } @@ -2705,8 +2647,7 @@ else $doleditor = new DolEditor('signature', $object->signature, '', 138, 'dolibarr_notes', 'In', false, true, empty($conf->global->FCKEDITOR_ENABLE_USERSIGN) ? 0 : 1, ROWS_4, '90%'); print $doleditor->Create(1); } - else - { + else { print dol_htmlentitiesbr($object->signature); } print ''; @@ -2733,8 +2674,7 @@ else { print ''; } - else - { + else { print ''; print $object->job; } diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index 46022d066f3..54681974e04 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -289,8 +289,7 @@ class Users extends DolibarrApi { return $this->get($id); } - else - { + else { throw new RestException(500, $this->useraccount->error); } } @@ -364,8 +363,7 @@ class Users extends DolibarrApi { $entity = (!empty($entity) ? $entity : $conf->entity); } - else - { + else { // When using API, action is done on entity of logged user because a user of entity X with permission to create user should not be able to // hack the security by giving himself permissions on another entity. $entity = (DolibarrApiAccess::$user->entity > 0 ? DolibarrApiAccess::$user->entity : $conf->entity); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 11d0cec3654..a4daebe3b9a 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -295,17 +295,15 @@ class User extends CommonObject { $sql .= " WHERE u.entity IN (0,".$conf->entity.")"; } - else - { + else { $sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database } } - else // The fetch was forced on an entity + else // The fetch was forced on an entity { if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) $sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database - else - $sql .= " WHERE u.entity IN (0, ".(($entity != '' && $entity >= 0) ? $entity : $conf->entity).")"; // search in entity provided in parameter + else $sql .= " WHERE u.entity IN (0, ".(($entity != '' && $entity >= 0) ? $entity : $conf->entity).")"; // search in entity provided in parameter } if ($sid) // permet une recherche du user par son SID ActiveDirectory ou Samba @@ -320,8 +318,7 @@ class User extends CommonObject { $sql .= " AND u.email = '".$this->db->escape($email)."'"; } - else - { + else { $sql .= " AND u.rowid = ".$id; } $sql .= " ORDER BY u.entity ASC"; // Avoid random result when there is 2 login in 2 different entities @@ -420,8 +417,7 @@ class User extends CommonObject $this->db->free($result); } - else - { + else { $this->error = "USERNOTFOUND"; dol_syslog(get_class($this)."::fetch user not found", LOG_DEBUG); @@ -429,8 +425,7 @@ class User extends CommonObject return 0; } } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -457,8 +452,7 @@ class User extends CommonObject } $this->db->free($resql); } - else - { + else { $this->error = $this->db->lasterror(); return -2; } @@ -525,8 +519,7 @@ class User extends CommonObject return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -592,8 +585,7 @@ class User extends CommonObject { $whereforadd = 'allmodules'; } - else - { + else { $whereforadd = "module='".$this->db->escape($allmodule)."'"; if (!empty($allperms)) $whereforadd .= " AND perms='".$this->db->escape($allperms)."'"; } @@ -629,8 +621,7 @@ class User extends CommonObject $i++; } } - else - { + else { $error++; dol_print_error($this->db); } @@ -713,8 +704,7 @@ class User extends CommonObject { $wherefordel = 'allmodules'; } - else - { + else { $wherefordel = "module='".$this->db->escape($allmodule)."'"; if (!empty($allperms)) $whereforadd .= " AND perms='".$this->db->escape($allperms)."'"; } @@ -750,8 +740,7 @@ class User extends CommonObject $i++; } } - else - { + else { $error++; dol_print_error($this->db); } @@ -833,8 +822,7 @@ class User extends CommonObject { $sql .= " AND r.entity IN (0,".(!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) ? "1," : "").$conf->entity.")"; } - else - { + else { $sql .= " AND ur.entity = ".$conf->entity; } $sql .= " AND ur.fk_user= ".$this->id; @@ -866,8 +854,7 @@ class User extends CommonObject if (empty($this->rights->$module->$perms->$subperms)) $this->nb_rights++; $this->rights->$module->$perms->$subperms = 1; } - else - { + else { if (empty($this->rights->$module->$perms)) $this->nb_rights++; $this->rights->$module->$perms = 1; } @@ -892,8 +879,7 @@ class User extends CommonObject $sql .= " AND r.entity = ".$conf->entity; } } - else - { + else { $sql .= " AND gr.entity = ".$conf->entity; $sql .= " AND gu.entity = ".$conf->entity; $sql .= " AND r.entity = ".$conf->entity; @@ -926,8 +912,7 @@ class User extends CommonObject if (empty($this->rights->$module->$perms->$subperms)) $this->nb_rights++; $this->rights->$module->$perms->$subperms = 1; } - else - { + else { if (empty($this->rights->$module->$perms)) $this->nb_rights++; // if we have already define a subperm like this $this->rights->$module->level1->level2 with llx_user_rights, we don't want override level1 because the level2 can be not define on user group if (!is_object($this->rights->$module->$perms)) $this->rights->$module->$perms = 1; @@ -948,8 +933,7 @@ class User extends CommonObject // que les droits sont en cache (car tous charges) pour cet instance de user $this->all_permissions_are_loaded = 1; } - else - { + else { // If module defined, we flag it as loaded into cache $this->_tab_loaded[$moduletag] = 1; } @@ -993,8 +977,7 @@ class User extends CommonObject $this->db->rollback(); return -$error; } - else - { + else { $this->db->commit(); return 1; } @@ -1133,8 +1116,7 @@ class User extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -1200,8 +1182,7 @@ class User extends CommonObject $this->db->rollback(); return -6; } - else - { + else { $sql = "INSERT INTO ".MAIN_DB_PREFIX."user (datec,login,ldap_sid,entity)"; $sql .= " VALUES('".$this->db->idate($this->datec)."','".$this->db->escape($this->login)."','".$this->db->escape($this->ldap_sid)."',".$this->db->escape($this->entity).")"; $result = $this->db->query($sql); @@ -1253,24 +1234,21 @@ class User extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { //$this->error=$interface->error; dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); $this->db->rollback(); return -3; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; } } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -1339,16 +1317,14 @@ class User extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; } } - else - { + else { // $this->error deja positionne dol_syslog(get_class($this)."::create_from_contact - 0"); @@ -1424,8 +1400,7 @@ class User extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); @@ -1439,8 +1414,7 @@ class User extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { // $this->error deja positionne $this->db->rollback(); return -2; @@ -1752,8 +1726,7 @@ class User extends CommonObject $error++; } } - else - { + else { $this->error = $tmpobj->error; $this->errors = $tmpobj->errors; $error++; @@ -1786,15 +1759,13 @@ class User extends CommonObject $this->db->commit(); return $nbrowsaffected; } - else - { + else { dol_syslog(get_class($this)."::update error=".$this->error, LOG_ERR); $this->db->rollback(); return -1; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; @@ -1827,8 +1798,7 @@ class User extends CommonObject $this->datelastlogin = $now; return 1; } - else - { + else { $this->error = $this->db->lasterror().' sql='.$sql; return -1; } @@ -1877,8 +1847,7 @@ class User extends CommonObject { $sql .= ", pass = null"; } - else - { + else { $sql .= ", pass = '".$this->db->escape($password)."'"; } $sql .= " WHERE rowid = ".$this->id; @@ -1912,8 +1881,7 @@ class User extends CommonObject $error++; } } - else - { + else { $this->error = $adh->error; $error++; } @@ -1932,21 +1900,18 @@ class User extends CommonObject $this->db->commit(); return $this->pass; } - else - { + else { $this->db->rollback(); return 0; } } - else - { + else { $this->db->rollback(); dol_print_error($this->db); return -1; } } - else - { + else { // We store clear password in password temporary field. // After receiving confirmation link, we will crypt it and store it in pass_crypted $sql = "UPDATE ".MAIN_DB_PREFIX."user"; @@ -1959,8 +1924,7 @@ class User extends CommonObject { return $password; } - else - { + else { dol_print_error($this->db); return -3; } @@ -2001,8 +1965,7 @@ class User extends CommonObject if ($this->conf->MAIN_LANG_DEFAULT) { $outputlangs->setDefaultLang($this->conf->MAIN_LANG_DEFAULT); } - else - { // If user has not defined its own language, we used current language + else { // If user has not defined its own language, we used current language $outputlangs = $langs; } @@ -2033,8 +1996,7 @@ class User extends CommonObject dol_syslog(get_class($this)."::send_password changelater is off, url=".$url); } - else - { + else { $url = $urlwithroot.'/user/passwordforgotten.php?action=validatenewpassword&username='.urlencode($this->login)."&passwordhash=".dol_hash($password); $mesg .= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived")."\n"; @@ -2072,8 +2034,7 @@ class User extends CommonObject { return 1; } - else - { + else { $langs->trans("errors"); $this->error = $langs->trans("ErrorFailedToSendPassword").' '.$mailfile->error; return -1; @@ -2122,8 +2083,7 @@ class User extends CommonObject $this->db->free($resql); return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -2161,8 +2121,7 @@ class User extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = $this->db->lasterror(); return -1; @@ -2217,15 +2176,13 @@ class User extends CommonObject $this->db->commit(); return 1; } - else - { + else { dol_syslog(get_class($this)."::SetInGroup ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -2274,15 +2231,13 @@ class User extends CommonObject $this->db->commit(); return 1; } - else - { + else { dol_syslog(get_class($this)."::RemoveFromGroup ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -2774,8 +2729,7 @@ class User extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -2802,8 +2756,7 @@ class User extends CommonObject $this->db->free($resql); return $nb; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -2828,8 +2781,7 @@ class User extends CommonObject $sql .= " WHERE entity = 0"; if ($admin >= 0) $sql .= " AND admin = ".$admin; } - else - { + else { $sql .= " WHERE entity IN (".getEntity('user', 0).")"; if ($limitTo == 'active') $sql .= " AND statut = 1"; if ($admin >= 0) $sql .= " AND admin = ".$admin; @@ -2844,8 +2796,7 @@ class User extends CommonObject $this->db->free($resql); return $nb; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -2917,8 +2868,7 @@ class User extends CommonObject } return $users; } - else - { + else { dol_print_error($this->db); return -1; } @@ -2952,8 +2902,7 @@ class User extends CommonObject } return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -3023,8 +2972,7 @@ class User extends CommonObject $i++; } } - else - { + else { dol_print_error($this->db); return -1; } @@ -3083,8 +3031,7 @@ class User extends CommonObject { $childids = $this->cache_childids[$this->id]; } - else - { + else { // Init this->users $this->get_full_tree(); @@ -3196,8 +3143,7 @@ class User extends CommonObject $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -3228,8 +3174,7 @@ class User extends CommonObject { $modele = $conf->global->USER_ADDON_PDF; } - else - { + else { $modele = 'bluesky'; } } @@ -3272,8 +3217,7 @@ class User extends CommonObject } return $user_property; } - else - { + else { dol_print_error($this->db); } } @@ -3310,13 +3254,11 @@ class User extends CommonObject $sql .= " OR t.entity = 0)"; // Show always superadmin } } - else - { + else { $sql .= " WHERE t.entity IN (".getEntity('user').")"; } } - else - { + else { $sql .= " WHERE 1"; } @@ -3365,8 +3307,7 @@ class User extends CommonObject } return $num; } - else - { + else { $this->errors[] = $this->db->lasterror(); return -1; } diff --git a/htdocs/user/class/userbankaccount.class.php b/htdocs/user/class/userbankaccount.class.php index 79df9d287ec..02a046a60ad 100644 --- a/htdocs/user/class/userbankaccount.class.php +++ b/htdocs/user/class/userbankaccount.class.php @@ -105,8 +105,7 @@ class UserBankAccount extends Account return $this->update($user); } } - else - { + else { print $this->db->error(); return 0; } @@ -142,8 +141,7 @@ class UserBankAccount extends Account if (trim($this->label) != '') $sql .= ",label = '".$this->db->escape($this->label)."'"; - else - $sql .= ",label = NULL"; + else $sql .= ",label = NULL"; $sql .= " WHERE rowid = ".$this->id; $result = $this->db->query($sql); @@ -151,8 +149,7 @@ class UserBankAccount extends Account { return 1; } - else - { + else { dol_print_error($this->db); return 0; } @@ -204,8 +201,7 @@ class UserBankAccount extends Account return 1; } - else - { + else { dol_print_error($this->db); return -1; } diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index bc5396e9f51..f56358963c9 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -155,8 +155,7 @@ class UserGroup extends CommonObject { $result = $this->fetchCommon(0, '', ' AND nom = \''.$this->db->escape($groupname).'\''); } - else - { + else { $result = $this->fetchCommon($id); } @@ -171,8 +170,7 @@ class UserGroup extends CommonObject return 1; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -201,8 +199,7 @@ class UserGroup extends CommonObject { $sql .= " AND g.entity IS NOT NULL"; } - else - { + else { $sql .= " AND g.entity IN (0,".$conf->entity.")"; } $sql .= " ORDER BY g.nom"; @@ -227,8 +224,7 @@ class UserGroup extends CommonObject return $ret; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -258,8 +254,7 @@ class UserGroup extends CommonObject { $sql .= " AND u.entity IS NOT NULL"; } - else - { + else { $sql .= " AND u.entity IN (0,".$conf->entity.")"; } if (!empty($excludefilter)) $sql .= ' AND ('.$excludefilter.')'; @@ -290,8 +285,7 @@ class UserGroup extends CommonObject return $ret; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -357,8 +351,7 @@ class UserGroup extends CommonObject { $whereforadd = 'allmodules'; } - else - { + else { $whereforadd = "module='".$this->db->escape($allmodule)."'"; if (!empty($allperms)) $whereforadd .= " AND perms='".$this->db->escape($allperms)."'"; } @@ -394,8 +387,7 @@ class UserGroup extends CommonObject $i++; } } - else - { + else { $error++; dol_print_error($this->db); } @@ -481,8 +473,7 @@ class UserGroup extends CommonObject { $wherefordel = 'allmodules'; } - else - { + else { $wherefordel = "module='".$this->db->escape($allmodule)."'"; if (!empty($allperms)) $whereforadd .= " AND perms='".$this->db->escape($allperms)."'"; } @@ -518,8 +509,7 @@ class UserGroup extends CommonObject $i++; } } - else - { + else { $error++; dol_print_error($this->db); } @@ -605,8 +595,7 @@ class UserGroup extends CommonObject if (empty($this->rights->$module->$perms->$subperms)) $this->nb_rights++; $this->rights->$module->$perms->$subperms = 1; } - else - { + else { if (empty($this->rights->$module->$perms)) $this->nb_rights++; $this->rights->$module->$perms = 1; } @@ -623,8 +612,7 @@ class UserGroup extends CommonObject // que les droits sont en cache (car tous charges) pour cet instance de group $this->all_permissions_are_loaded = 1; } - else - { + else { // If module defined, we flag it as loaded into cache $this->_tab_loaded[$moduletag] = 1; } @@ -902,8 +890,7 @@ class UserGroup extends CommonObject { $modele = $conf->global->USERGROUP_ADDON_PDF; } - else - { + else { $modele = 'grass'; } } diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index c81e4068558..302e0729bb8 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -122,8 +122,7 @@ if ($id > 0) $langs->load("errors"); print ''.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("ClickToDial")).''; } - else - { + else { print '     '.$form->textwithpicto($langs->trans("KeepEmptyToUseDefault").': '.$conf->global->CLICKTODIAL_URL, $langs->trans("ClickToDialUrlDesc")); } print ''; @@ -147,7 +146,7 @@ if ($id > 0) print ''; } - else // View mode + else // View mode { print ''; @@ -162,8 +161,7 @@ if ($id > 0) $langs->load("errors"); print ''.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("ClickToDial")).''; } - else - { + else { print $form->textwithpicto((empty($object->clicktodial_url) ? $langs->trans("DefaultLink").': ' : '').$url, $langs->trans("ClickToDialUrlDesc")); } print ''; diff --git a/htdocs/user/document.php b/htdocs/user/document.php index 2b8c67d7ae6..912675dd636 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -172,8 +172,7 @@ if ($object->id) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { accessforbidden('', 0, 1); } diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 1cd3b3edc37..524fc25b51a 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -115,8 +115,7 @@ if (empty($reshook)) { header("Location: ".DOL_URL_ROOT."/user/group/list.php?restore_lastsearch_values=1"); exit; } - else - { + else { $langs->load("errors"); setEventMessages($langs->trans('ErrorForbidden'), null, 'errors'); } @@ -153,8 +152,7 @@ if (empty($reshook)) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { $db->rollback(); $langs->load("errors"); @@ -163,8 +161,7 @@ if (empty($reshook)) { } } } - else - { + else { $langs->load("errors"); setEventMessages($langs->trans('ErrorForbidden'), null, 'errors'); } @@ -190,14 +187,12 @@ if (empty($reshook)) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { setEventMessages($edituser->error, $edituser->errors, 'errors'); } } } - else - { + else { $langs->load("errors"); setEventMessages($langs->trans('ErrorForbidden'), null, 'errors'); } @@ -232,14 +227,12 @@ if (empty($reshook)) { setEventMessages($langs->trans("GroupModified"), null, 'mesgs'); $db->commit(); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } } - else - { + else { $langs->load("errors"); setEventMessages($langs->trans('ErrorForbidden'), null, 'mesgs'); } @@ -287,8 +280,7 @@ if ($action == 'create') print "\n"; } - else - { + else { print ''; } } @@ -318,8 +310,7 @@ if ($action == 'create') /* Visu et edition */ /* */ /* ************************************************************************** */ -else -{ +else { if ($id) { $res = $object->fetch_optionals(); @@ -488,15 +479,13 @@ else print img_picto($langs->trans("RemoveFromGroup"), 'unlink'); print ''; } - else - { + else { print "-"; } print "\n"; } } - else - { + else { print ''; } print "
".$mc->select_entities($conf->entity); print "
'.$langs->trans("None").'
"; @@ -557,8 +546,7 @@ else print "".$mc->select_entities($object->entity); print "\n"; } - else - { + else { print ''; } } diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php index 5462167b4af..b72fc7718f9 100644 --- a/htdocs/user/group/ldap.php +++ b/htdocs/user/group/ldap.php @@ -84,8 +84,7 @@ if ($action == 'dolibarr2ldap') { setEventMessages($langs->trans("GroupSynchronized"), null, 'mesgs'); } - else - { + else { setEventMessages($ldap->error, $ldap->errors, 'errors'); } } @@ -196,20 +195,17 @@ if ($result > 0) { print ''.$langs->trans("ErrorFailedToReadLDAP").''; } - else - { + else { $result = show_ldap_content($records, 0, $records['count'], true); } } - else - { + else { print ''.$langs->trans("LDAPRecordNotFound").' (dn='.$dn.' - search='.$search.')'; } $ldap->unbind(); $ldap->close(); } -else -{ +else { setEventMessages($ldap->error, $ldap->errors, 'errors'); } diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index 1701d2ae9c1..48c56a20218 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -117,8 +117,7 @@ if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->global { $sql .= " WHERE g.entity IS NOT NULL"; } -else -{ +else { $sql .= " WHERE g.entity IN (0,".$conf->entity.")"; } if (!empty($search_group)) natural_search(array("g.nom", "g.note"), $search_group); @@ -222,8 +221,7 @@ if ($resql) $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index 70030dbf1af..8c8a59fa536 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -189,8 +189,7 @@ if ($object->id > 0) } $db->free($result); } - else - { + else { dol_print_error($db); } @@ -325,8 +324,7 @@ if ($object->id > 0) print img_picto($langs->trans("Active"), 'tick'); print ''; } - else - { + else { // Do not own permission if ($caneditperms) { @@ -335,8 +333,7 @@ if ($object->id > 0) print ' '; } } - else - { + else { // Do not own permission if ($caneditperms) { diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php index 3a05bb3d640..520821ad84f 100644 --- a/htdocs/user/hierarchy.php +++ b/htdocs/user/hierarchy.php @@ -80,8 +80,7 @@ if (!is_array($user_arbo) && $user_arbo < 0) { setEventMessages($userstatic->error, $userstatic->errors, 'warnings'); } -else -{ +else { // Define fulltree array $fulltree = $user_arbo; //var_dump($fulltree); @@ -113,8 +112,7 @@ else { $entitystring = $langs->trans("AllEntities"); } - else - { + else { $mc->getInfo($entity); $entitystring = $mc->label; } @@ -197,8 +195,7 @@ else print ''; print ''; } - else - { + else { print ''; print ''; print ''; diff --git a/htdocs/user/home.php b/htdocs/user/home.php index 4c46c502acc..cec26f72dcc 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -170,8 +170,7 @@ if ($resql) { print $companystatic->getNomUrl(1); } - else - { + else { print $langs->trans("InternalUser"); } if ($obj->ldap_sid) @@ -188,8 +187,7 @@ if ($resql) { $entitystring = $langs->trans("AllEntities"); } - else - { + else { $mc->getInfo($entity); $entitystring = $mc->label; } @@ -210,8 +208,7 @@ if ($resql) $db->free($resql); } -else -{ +else { dol_print_error($db); } @@ -229,8 +226,7 @@ if ($canreadperms) { $sql .= " WHERE g.entity IS NOT NULL"; } - else - { + else { $sql .= " WHERE g.entity IN (0,".$conf->entity.")"; } $sql .= $db->order("g.datec", "DESC"); @@ -284,8 +280,7 @@ if ($canreadperms) $db->free($resql); } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/user/ldap.php b/htdocs/user/ldap.php index 71410eb223a..674ef0f64b6 100644 --- a/htdocs/user/ldap.php +++ b/htdocs/user/ldap.php @@ -114,8 +114,7 @@ if ($object->ldap_sid) { print ''; } -else -{ +else { print ''; } print ''; @@ -199,21 +198,18 @@ if ($result > 0) { print ''; } - else - { + else { $result = show_ldap_content($records, 0, $records['count'], true); } } - else - { + else { print ''; } $ldap->unbind(); $ldap->close(); } -else -{ +else { setEventMessages($ldap->error, $ldap->errors, 'errors'); } diff --git a/htdocs/user/list.php b/htdocs/user/list.php index ef6e205fd0d..ca2f39b4e9f 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -580,8 +580,7 @@ while ($i < min($num, $limit)) { print $langs->trans("DomainUser"); } - else - { + else { print $langs->trans("InternalUser"); } print ''; @@ -597,8 +596,7 @@ while ($i < min($num, $limit)) { print $langs->trans("AllEntities"); } - else - { + else { $mc->getInfo($obj->entity); print $mc->label; } diff --git a/htdocs/user/note.php b/htdocs/user/note.php index ab4df07e193..988b879653f 100644 --- a/htdocs/user/note.php +++ b/htdocs/user/note.php @@ -121,8 +121,7 @@ if ($id) $doleditor = new DolEditor('note_private', $object->note_private, '', 280, 'dolibarr_notes', 'In', true, false, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_8, '90%'); $doleditor->Create(); } - else - { + else { print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_private)); } print ""; diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 84fbf2793e3..33dded8a304 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -88,8 +88,7 @@ if ($action == 'add') dol_print_error($db); } } - else - { + else { dol_print_error($db); } @@ -97,8 +96,7 @@ if ($action == 'add') { $db->commit(); } - else - { + else { $db->rollback(); } } @@ -152,8 +150,7 @@ if ($result > 0) { print ''; } - else - { + else { print ''; } print ''."\n"; @@ -228,8 +225,7 @@ if ($result > 0) { print ' <'.$object->email.'>'; } - else - { + else { $langs->load("errors"); print '   '.img_warning().' '.$langs->trans("ErrorBadEMail", $object->email); } @@ -244,8 +240,7 @@ if ($result > 0) print ''; print ''; } - else - { + else { print ''; @@ -272,8 +267,7 @@ if ($result > 0) { $num = $db->num_rows($resql); } - else - { + else { dol_print_error($db); } @@ -312,8 +306,7 @@ if ($result > 0) { print ' <'.$obj->email.'>'; } - else - { + else { $langs->load("errors"); print '   '.img_warning().' '.$langs->trans("ErrorBadEMail", $obj->email); } @@ -421,8 +414,7 @@ if ($result > 0) { $num = $db->num_rows($resql); } - else - { + else { dol_print_error($db); } @@ -471,8 +463,7 @@ if ($result > 0) print $userstatic->getNomUrl(1); print $obj->email ? ' <'.$obj->email.'>' : $langs->trans("NoMail"); } - else - { + else { print $obj->email; } print ''; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index f9ebd310cfa..068ea0047b1 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -325,8 +325,7 @@ if ($action == 'edit') print ''; print ''; } -else -{ +else { dol_fiche_head($head, 'guisetup', $title, -1, 'user'); $linkback = ''.$langs->trans("BackToList").''; @@ -397,14 +396,12 @@ else { print "trans("FeatureDisabledInDemo")."\" href=\"#\">".$langs->trans("Modify").""; } - else - { + else { if ($caneditfield || !empty($user->admin)) // Si utilisateur edite = utilisateur courant (pas besoin de droits particulier car il s'agit d'une page de modif d'output et non de donnĂ©es) ou si admin { print 'id.'">'.$langs->trans("Modify").''; } - else - { + else { print "trans("NotEnoughPermissions")."\" href=\"#\">".$langs->trans("Modify").""; } } diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 83289521538..43202a01028 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -73,8 +73,7 @@ if ($action == 'validatenewpassword' && $username && $passwordhash) { $message = '
'.$langs->trans("ErrorLoginDoesNotExists", $username).'
'; } - else - { + else { if (dol_verifyHash($edituser->pass_temp, $passwordhash)) { // Clear session @@ -86,8 +85,7 @@ if ($action == 'validatenewpassword' && $username && $passwordhash) header("Location: ".DOL_URL_ROOT.'/'); exit; } - else - { + else { $langs->load("errors"); $message = '
'.$langs->trans("ErrorFailedToValidatePasswordReset").'
'; } @@ -104,8 +102,7 @@ if ($action == 'buildnewpassword' && $username) { $message = '
'.$langs->trans("ErrorBadValueForCode").'
'; } - else - { + else { $edituser = new User($db); $result = $edituser->fetch('', $username, '', 1); if ($result == 0 && preg_match('/@/', $username)) @@ -118,30 +115,26 @@ if ($action == 'buildnewpassword' && $username) $message = '
'.$langs->trans("ErrorLoginDoesNotExists", $username).'
'; $username = ''; } - else - { + else { if (!$edituser->email) { $message = '
'.$langs->trans("ErrorLoginHasNoEmail").'
'; } - else - { + else { $newpassword = $edituser->setPassword($user, '', 1); if ($newpassword < 0) { // Failed $message = '
'.$langs->trans("ErrorFailedToChangePassword").'
'; } - else - { + else { // Success if ($edituser->send_password($user, $newpassword, 1) > 0) { $message = ''; $username = ''; } - else - { + else { $message .= '
'.$edituser->error.'
'; } } @@ -166,8 +159,7 @@ if (file_exists(DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/tpl/passwordforgotten { $template_dir = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/tpl/"; } -else -{ +else { $template_dir = DOL_DOCUMENT_ROOT."/core/tpl/"; } diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 5d06973abf6..408900eb406 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -209,8 +209,7 @@ if ($result) } $db->free($result); } -else -{ +else { dol_print_error($db); } @@ -240,8 +239,7 @@ if ($result) } $db->free($result); } -else -{ +else { dol_print_error($db); } @@ -411,8 +409,7 @@ if ($result) print img_picto($langs->trans("Active"), 'tick'); print ''; } - else - { + else { // Do not own permission if ($caneditperms) { @@ -421,8 +418,7 @@ if ($result) print ''; } } - else - { + else { // Do not own permission if ($caneditperms) { diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 15e019dd311..f29cc49f35b 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -106,8 +106,7 @@ if ($_POST) { if (!$features) { setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors'); } - else - { + else { $reference = trim($reference); if (empty($reference)) { $reference = false; @@ -361,8 +360,7 @@ if (!empty($id) || !empty($ref)) { print $object->weight." ".measuringUnitString(0, "weight", $object->weight_units); } - else - { + else { print ' '; } print "\n"; @@ -628,8 +626,7 @@ if (!empty($id) || !empty($ref)) print ''; } - else - { + else { if ($action === 'delete') { if ($prodcomb->fetch($valueid) > 0) { $prodstatic->fetch($prodcomb->fk_product_child); @@ -801,8 +798,7 @@ if (!empty($id) || !empty($ref)) print ''; } } - else - { + else { print ''; } print '
'.img_picto_common('', 'treemenu/branchbottom.gif').''.$langs->trans("LoginAccountDisableInDolibarr").''.$object->login.'
'.$langs->trans("ErrorFailedToReadLDAP").'
'.$langs->trans("LDAPRecordNotFound").' (dn='.$dn.' - search='.$search.')
'.$langs->trans("LoginAccountDisableInDolibarr").''.$object->login.'
'; print $langs->trans("YouMustAssignUserMailFirst"); print '
 
'.$langs->trans("None").'
'; diff --git a/htdocs/variants/create.php b/htdocs/variants/create.php index 55bf1c81f34..567dc902a5a 100644 --- a/htdocs/variants/create.php +++ b/htdocs/variants/create.php @@ -43,8 +43,7 @@ if ($_POST) { { header('Location: '.$backtopage); } - else - { + else { header('Location: '.DOL_URL_ROOT.'/variants/card.php?id='.$resid.'&backtopage='.urlencode($backtopage)); } exit; diff --git a/htdocs/webservices/admin/index.php b/htdocs/webservices/admin/index.php index 819694f5041..cb0940bb61c 100644 --- a/htdocs/webservices/admin/index.php +++ b/htdocs/webservices/admin/index.php @@ -48,8 +48,7 @@ if ($actionsave) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } diff --git a/htdocs/webservices/server_actioncomm.php b/htdocs/webservices/server_actioncomm.php index 39ed3b3cdf5..10ef9cfbd7e 100644 --- a/htdocs/webservices/server_actioncomm.php +++ b/htdocs/webservices/server_actioncomm.php @@ -328,14 +328,12 @@ function getActionComm($authentication, $id) 'result'=>array('result_code'=>'OK', 'result_label'=>''), 'actioncomm'=>$actioncomm_result_fields); } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } @@ -389,14 +387,12 @@ function getListActionCommType($authentication) 'result'=>array('result_code'=>'OK', 'result_label'=>''), 'actioncommtypes'=>$resultarray); } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } @@ -482,8 +478,7 @@ function createActionComm($authentication, $actioncomm) $db->commit(); $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$newobject->id); } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; diff --git a/htdocs/webservices/server_category.php b/htdocs/webservices/server_category.php index de1fb73d3c0..d7382447749 100644 --- a/htdocs/webservices/server_category.php +++ b/htdocs/webservices/server_category.php @@ -262,14 +262,12 @@ function getCategory($authentication, $id) 'categorie'=> $cat ); } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php index 804cb3f7db1..023cdc1c4ac 100644 --- a/htdocs/webservices/server_contact.php +++ b/htdocs/webservices/server_contact.php @@ -333,14 +333,12 @@ function getContact($authentication, $id, $ref_ext) 'contact'=>$contact_result_fields ); } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref_ext='.$ref_ext; } @@ -451,8 +449,7 @@ function createContact($authentication, $contact) $db->commit(); $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$newobject->id, 'ref'=>$newobject->ref); } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; @@ -584,8 +581,7 @@ function getContactsForThirdParty($authentication, $idthirdparty) ); } - else - { + else { $error++; $errorcode = $db->lasterrno(); $errorlabel = $db->lasterror(); } diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php index 46590688f88..8b15ade0a6a 100644 --- a/htdocs/webservices/server_invoice.php +++ b/htdocs/webservices/server_invoice.php @@ -370,14 +370,12 @@ function getInvoice($authentication, $id = '', $ref = '', $ref_ext = '') 'lines' => $linesresp )); } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } @@ -511,8 +509,7 @@ function getInvoicesForThirdParty($authentication, $idthirdparty) ); } - else - { + else { $error++; $errorcode = $db->lasterrno(); $errorlabel = $db->lasterror(); } @@ -627,8 +624,7 @@ function createInvoice($authentication, $invoice) $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$new_invoice->id, 'ref'=>$new_invoice->ref, 'ref_ext'=>$new_invoice->ref_ext); } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; @@ -707,14 +703,12 @@ function createInvoiceFromOrder($authentication, $id_order = '', $ref_order = '' } } } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id_order.' nor ref='.$ref_order.' nor ref_ext='.$ref_ext_order; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } @@ -724,8 +718,7 @@ function createInvoiceFromOrder($authentication, $id_order = '', $ref_order = '' { $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); } - else - { + else { $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$newobject->id, 'ref'=>$newobject->ref, 'ref_ext'=>$newobject->ref_ext); } diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index 0b22ea9aab6..7018f5fb5c8 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -473,15 +473,13 @@ function getOrder($authentication, $id = '', $ref = '', $ref_ext = '') )); } } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; @@ -640,8 +638,7 @@ function getOrdersForThirdParty($authentication, $idthirdparty) ); } - else - { + else { $error++; $errorcode = $db->lasterrno(); $errorlabel = $db->lasterror(); } @@ -786,8 +783,7 @@ function createOrder($authentication, $order) $db->commit(); $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$newobject->id, 'ref'=>$newobject->ref); } - else - { + else { dol_syslog("Webservice server_order:: order creation or validation failed, rollback", LOG_ERR); $db->rollback(); $error++; @@ -848,24 +844,21 @@ function validOrder($authentication, $id = '', $id_warehouse = 0) $outputlangs = $langs; $order->generateDocument($order->modelpdf, $outputlangs); } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; $errorlabel = $order->error; } } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; $errorlabel = $order->error; } } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; @@ -877,8 +870,7 @@ function validOrder($authentication, $id = '', $id_warehouse = 0) { $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); } - else - { + else { $db->commit(); $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>'')); } diff --git a/htdocs/webservices/server_other.php b/htdocs/webservices/server_other.php index 4ae702ade15..71ee78d3c4d 100644 --- a/htdocs/webservices/server_other.php +++ b/htdocs/webservices/server_other.php @@ -304,8 +304,7 @@ function getDocument($authentication, $modulepart, $file, $refname = '') 'document'=>$objectret ); } - else - { + else { dol_syslog("File doesn't exist ".$original_file); $errorcode = 'NOT_FOUND'; $errorlabel = ''; diff --git a/htdocs/webservices/server_payment.php b/htdocs/webservices/server_payment.php index 38dab505bac..5145c4a3b7b 100644 --- a/htdocs/webservices/server_payment.php +++ b/htdocs/webservices/server_payment.php @@ -197,8 +197,7 @@ function createPayment($authentication, $payment) $db->commit(); $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$new_payment->id); } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index a98d8b2a6cd..68563bfab38 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -450,14 +450,12 @@ function getProductOrService($authentication, $id = '', $ref = '', $ref_ext = '' 'product'=>$productorservice_result_fields ); } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } @@ -613,8 +611,7 @@ function createProductOrService($authentication, $product) $newobject->error = 'You set a different value for stock, but correction of stock count (before='.$getstockreal.', after='.$savstockreal.') fails with error '.$newobject->error; } } - else - { + else { $error++; $newobject->error = 'You set a different value for stock but we failed to find warehouse '.$product['warehouse_ref'].' to make correction.'; } @@ -627,8 +624,7 @@ function createProductOrService($authentication, $product) $db->commit(); $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$newobject->id, 'ref'=>$newobject->ref); } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; @@ -754,8 +750,7 @@ function updateProductOrService($authentication, $product) { $error++; } - else - { + else { // Update stock if stock count is provided and differs from database after creation or update if (isset($product['stock_real']) && $product['stock_real'] != '' && !empty($conf->global->stock->enabled)) { @@ -785,8 +780,7 @@ function updateProductOrService($authentication, $product) $newobject->error = 'You set a different value for stock, but correction of stock count (before='.$getstockreal.', after='.$savstockreal.') fails with error '.$newobject->error; } } - else - { + else { $error++; $newobject->error = 'You set a different value for stock but we failed to find warehouse '.$product['warehouse_ref'].' to make correction.'; } @@ -819,8 +813,7 @@ function updateProductOrService($authentication, $product) $db->commit(); $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$newobject->id, 'ref'=>$newobject->ref); } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; @@ -890,8 +883,7 @@ function deleteProductOrService($authentication, $listofidstring) $firsterror = 'Product or service with id '.$id.' not found'; break; } - else - { + else { $result = $newobject->delete($user); if ($result <= 0) { @@ -910,8 +902,7 @@ function deleteProductOrService($authentication, $listofidstring) //$objectresp=array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'listofid'=>$listofiddeleted); $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'nbdeleted'=>count($listofiddeleted)); } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; @@ -983,8 +974,7 @@ function getListOfProductsOrServices($authentication, $filterproduct) $i++; } } - else - { + else { $error++; $errorcode = $db->lasterrno(); $errorlabel = $db->lasterror(); @@ -998,8 +988,7 @@ function getListOfProductsOrServices($authentication, $filterproduct) 'products'=>$arrayproducts ); } - else - { + else { $objectresp = array( 'result'=>array('result_code' => 'OK', 'result_label' => ''), 'products'=>$arrayproducts @@ -1139,21 +1128,18 @@ function getProductsForCategory($authentication, $id, $lang = '') 'products'=> $products ); } - else - { + else { $errorcode = 'NORECORDS_FOR_ASSOCIATION'; $errorlabel = 'No products associated'.$sql; $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); dol_syslog("getProductsForCategory:: ".$errorcode, LOG_DEBUG); } } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } diff --git a/htdocs/webservices/server_project.php b/htdocs/webservices/server_project.php index 5bbaaaf035a..dc8fc81db2c 100644 --- a/htdocs/webservices/server_project.php +++ b/htdocs/webservices/server_project.php @@ -298,8 +298,7 @@ function createProject($authentication, $project) $error++; } } - else - { + else { $error++; } @@ -308,16 +307,14 @@ function createProject($authentication, $project) $db->commit(); $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$newobject->id, 'ref'=>$newobject->ref); } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; $errorlabel = $newobject->error; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } @@ -424,14 +421,12 @@ function getProject($authentication, $id = '', $ref = '') 'project'=>$project_result_fields ); } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref='.$ref; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } diff --git a/htdocs/webservices/server_supplier_invoice.php b/htdocs/webservices/server_supplier_invoice.php index 78a00ced40e..ecf2c51fd1f 100644 --- a/htdocs/webservices/server_supplier_invoice.php +++ b/htdocs/webservices/server_supplier_invoice.php @@ -303,14 +303,12 @@ function getSupplierInvoice($authentication, $id = '', $ref = '', $ref_ext = '') )); } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } @@ -441,8 +439,7 @@ function getSupplierInvoicesForThirdParty($authentication, $idthirdparty) ); } - else - { + else { $error++; $errorcode = $db->lasterrno(); $errorlabel = $db->lasterror(); } diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index d69b481323e..1e9f8355d52 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -378,14 +378,12 @@ function getThirdParty($authentication, $id = '', $ref = '', $ref_ext = '') 'result'=>array('result_code'=>'OK', 'result_label'=>''), 'thirdparty'=>$thirdparty_result_fields); } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } @@ -515,8 +513,7 @@ function createThirdParty($authentication, $thirdparty) $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$newobject->id, 'ref'=>$newobject->ref); } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; @@ -750,8 +747,7 @@ function getListOfThirdParties($authentication, $filterthirdparty) $i++; } } - else - { + else { $error++; $errorcode = $db->lasterrno(); $errorlabel = $db->lasterror(); @@ -765,8 +761,7 @@ function getListOfThirdParties($authentication, $filterthirdparty) 'thirdparties'=>$arraythirdparties ); } - else - { + else { $objectresp = array( 'result'=>array('result_code' => 'OK', 'result_label' => ''), 'thirdparties'=>$arraythirdparties @@ -828,8 +823,7 @@ function deleteThirdParty($authentication, $id = '', $ref = '', $ref_ext = '') $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>'')); } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; @@ -837,14 +831,12 @@ function deleteThirdParty($authentication, $id = '', $ref = '', $ref_ext = '') dol_syslog("Function: deleteThirdParty cant delete"); } } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } diff --git a/htdocs/webservices/server_user.php b/htdocs/webservices/server_user.php index 8793d2f02fa..c37e920f61d 100644 --- a/htdocs/webservices/server_user.php +++ b/htdocs/webservices/server_user.php @@ -372,14 +372,12 @@ function getUser($authentication, $id, $ref = '', $ref_ext = '') ) ); } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } @@ -426,8 +424,7 @@ function getListOfGroups($authentication) { $sql .= " WHERE g.entity IS NOT NULL"; } - else - { + else { $sql .= " WHERE g.entity IN (0,".$conf->entity.")"; } $sql .= " GROUP BY g.rowid, g.nom, g.entity, g.datec"; @@ -444,8 +441,7 @@ function getListOfGroups($authentication) $i++; } } - else - { + else { $error++; $errorcode = $db->lasterrno(); $errorlabel = $db->lasterror(); @@ -459,8 +455,7 @@ function getListOfGroups($authentication) 'groups'=>$arraygroups ); } - else - { + else { $objectresp = array( 'result'=>array('result_code' => 'OK', 'result_label' => ''), 'groups'=>$arraygroups @@ -526,8 +521,7 @@ function createUserFromThirdparty($authentication, $thirdpartywithuser) $error++; $errorcode = 'ALREADY_EXIST'; $errorlabel = 'Object not create : company or contact exists '.$thirdpartywithuser['email']; } - else - { + else { $db->begin(); /* * Company creation @@ -633,14 +627,12 @@ function createUserFromThirdparty($authentication, $thirdpartywithuser) if ($thirdpartywithuser['group_id'] > 0) $edituser->SetInGroup($thirdpartywithuser['group_id'], $conf->entity); } - else - { + else { $error++; $errorcode = 'NOT_CREATE'; $errorlabel = 'Object not create : '.$edituser->error; } } - else - { + else { $error++; $errorcode = 'NOT_CREATE'; $errorlabel = 'Object not create : '.$contact->error; } @@ -651,22 +643,19 @@ function createUserFromThirdparty($authentication, $thirdpartywithuser) $error = 0; } } - else - { + else { $error++; $errors = ($thirdparty->error ? array($thirdparty->error) : $thirdparty->errors); } } } - else - { + else { // retour creation KO $error++; $errorcode = 'NOT_CREATE'; $errorlabel = 'Object not create'; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } @@ -732,20 +721,17 @@ function setUserPassword($authentication, $shortuser) 'groups'=>$arraygroups ); } - else - { + else { $error++; $errorcode = 'NOT_MODIFIED'; $errorlabel = 'Error when changing password'; } } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'User not found'; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; }