add new rule

This commit is contained in:
Frédéric FRANCE 2020-05-21 01:41:27 +02:00
parent 416e6dd90d
commit ee6fadd0d5
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
565 changed files with 5190 additions and 8632 deletions

View File

@ -76,14 +76,12 @@ function getfieldname($l)
if (preg_match("/`(.*)`/", $l, $regs)) { if (preg_match("/`(.*)`/", $l, $regs)) {
if ($regs[1]) if ($regs[1])
return $regs[1]; return $regs[1];
else else return null;
return null;
} // if its not in quotes, then it should (we hope!) be the first "word" on the line, up to the first space. } // 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)) { elseif (preg_match("/([^\ ]*)/", trim($l), $regs)) {
if ($regs[1]) if ($regs[1])
return $regs[1]; return $regs[1];
else else return null;
return null;
} }
} }
@ -102,8 +100,7 @@ function formatsize($s)
return sprintf("%.1f", round($s / 1024, 1)) . "K"; return sprintf("%.1f", round($s / 1024, 1)) . "K";
elseif ($s < pow(2, 30)) elseif ($s < pow(2, 30))
return sprintf("%.1f", round($s / 1024 / 1024, 1)) . "M"; return sprintf("%.1f", round($s / 1024 / 1024, 1)) . "M";
else else return sprintf("%.1f", round($s / 1024 / 1024 / 1024, 1)) . "G";
return sprintf("%.1f", round($s / 1024 / 1024 / 1024, 1)) . "G";
} }
/** /**
@ -146,8 +143,7 @@ function pg2mysql_large($infilename, $outfilename)
if ($c % 2 != 0) { if ($c % 2 != 0) {
if ($inquotes) if ($inquotes)
$inquotes = false; $inquotes = false;
else else $inquotes = true;
$inquotes = true;
} }
if ($linenum % 10000 == 0) { if ($linenum % 10000 == 0) {
@ -329,8 +325,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true)
$num = $regs[1]; $num = $regs[1];
if ($num <= 255) if ($num <= 255)
$line = preg_replace("/ character varying\([0-9]*\)/", " varchar($num)", $line); $line = preg_replace("/ character varying\([0-9]*\)/", " varchar($num)", $line);
else else $line = preg_replace("/ character varying\([0-9]*\)/", " text", $line);
$line = preg_replace("/ character varying\([0-9]*\)/", " text", $line);
} }
// character varying with no size, we will default to varchar(255) // character varying with no size, we will default to varchar(255)
if (preg_match("/ character varying/", $line)) { if (preg_match("/ character varying/", $line)) {
@ -352,8 +347,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true)
$num = $regs[1]; $num = $regs[1];
if ($num <= 255) if ($num <= 255)
$line = preg_replace("/ character\([0-9]*\)/", " varchar($num)", $line); $line = preg_replace("/ character\([0-9]*\)/", " varchar($num)", $line);
else else $line = preg_replace("/ character\([0-9]*\)/", " text", $line);
$line = preg_replace("/ character\([0-9]*\)/", " text", $line);
} }
// timestamps // timestamps
$line = str_replace(" timestamp with time zone", " datetime", $line); $line = str_replace(" timestamp with time zone", " datetime", $line);
@ -465,8 +459,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true)
if ($c % 2 != 0) { if ($c % 2 != 0) {
if ($inquotes) if ($inquotes)
$inquotes = false; $inquotes = false;
else else $inquotes = true;
$inquotes = true;
// echo "inquotes=$inquotes\n"; // echo "inquotes=$inquotes\n";
} }
} while (substr($lines[$linenumber], - 3, - 1) != ");" || $inquotes); } while (substr($lines[$linenumber], - 3, - 1) != ");" || $inquotes);

View File

@ -124,8 +124,7 @@ class autoTranslator
echo "File not found: " . $destPath . ". We generate it.<br>\n"; echo "File not found: " . $destPath . ". We generate it.<br>\n";
$this->createTranslationFile($destPath, $my_destlang); $this->createTranslationFile($destPath, $my_destlang);
} }
else else {
{
echo "Updating file: " . $destPath . "<br>\n"; echo "Updating file: " . $destPath . "<br>\n";
} }

View File

@ -360,16 +360,14 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
$unused[$value] = $line; $unused[$value] = $line;
echo $line; // $trad contains the \n echo $line; // $trad contains the \n
} }
else else {
{
unset($output); unset($output);
//print 'X'.$output.'Y'; //print 'X'.$output.'Y';
} }
} }
if (empty($unused)) print "No string not used found.\n"; if (empty($unused)) print "No string not used found.\n";
else else {
{
$filetosave='/tmp/'.($argv[2]?$argv[2]:"").'notused.lang'; $filetosave='/tmp/'.($argv[2]?$argv[2]:"").'notused.lang';
print "Strings in en_US that are never used are saved into file ".$filetosave.":\n"; print "Strings in en_US that are never used are saved into file ".$filetosave.":\n";
file_put_contents($filetosave, implode("", $unused)); file_put_contents($filetosave, implode("", $unused));

View File

@ -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"; print "Key $key is redundant in file $lPrimaryFile (line: $cnt) - Already found into ".$fileFirstFound[$key]." (line: ".$lineFirstFound[$key].").\n";
continue; continue;
} }
else else {
{
$fileFirstFound[$key] = $fileToProcess; $fileFirstFound[$key] = $fileToProcess;
$lineFirstFound[$key] = $cnt; $lineFirstFound[$key] = $cnt;
} }

View File

@ -62,8 +62,7 @@ if ($resql)
} }
$db->free($resql); $db->free($resql);
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -108,8 +107,7 @@ if ($action == "save" && empty($cancel))
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
$db->commit(); $db->commit();
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
$db->rollback(); $db->rollback();
} }

View File

@ -108,8 +108,7 @@ if ($actionsave)
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
$db->rollback(); $db->rollback();
if (empty($errorsaved)) setEventMessages($langs->trans("Error"), null, 'errors'); 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); print ajax_constantonoff('AGENDA_DISABLE_EXT', array('enabled'=>array(0=>'.hideifnotset')), null, 1);
} }
else else {
{
if (empty($conf->global->AGENDA_DISABLE_EXT)) if (empty($conf->global->AGENDA_DISABLE_EXT))
{ {
print '<a href="'.$_SERVER['PHP_SELF'].'?save=1&AGENDA_DISABLE_EXT=1">'.img_picto($langs->trans("Enabled"), 'on').'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?save=1&AGENDA_DISABLE_EXT=1">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
} }
else else {
{
print '<a href="'.$_SERVER['PHP_SELF'].'?save=1&AGENDA_DISABLE_EXT=0">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?save=1&AGENDA_DISABLE_EXT=0">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} }
} }

View File

@ -60,8 +60,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
Header("Location: ".$_SERVER["PHP_SELF"]); Header("Location: ".$_SERVER["PHP_SELF"]);
exit; exit;
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -74,8 +73,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
Header("Location: ".$_SERVER["PHP_SELF"]); Header("Location: ".$_SERVER["PHP_SELF"]);
exit; exit;
} }
else else {
{
dol_print_error($db); 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"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=action&file=SPECIMEN.pdf");
return; return;
} }
else else {
{
setEventMessages($module->error, $module->errors, 'errors'); setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR); dol_syslog($module->error, LOG_ERR);
} }
} }
else else {
{
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
@ -214,8 +210,7 @@ if ($resql)
$i++; $i++;
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -263,8 +258,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
$module = new $classname($db, $specimenthirdparty); $module = new $classname($db, $specimenthirdparty);
if (method_exists($module, 'info')) if (method_exists($module, 'info'))
print $module->info($langs); print $module->info($langs);
else else print $module->description;
print $module->description;
print "</td>\n"; print "</td>\n";
// Active // Active
@ -277,14 +271,12 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
print img_picto($langs->trans("Enabled"), 'switch_on'); print img_picto($langs->trans("Enabled"), 'switch_on');
print '</a>'; print '</a>';
} }
else else {
{
print img_picto($langs->trans("Enabled"), 'switch_on'); print img_picto($langs->trans("Enabled"), 'switch_on');
} }
print "</td>"; print "</td>";
} }
else else {
{
print '<td class="center">'."\n"; print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=action">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=action">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";
@ -296,8 +288,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
{ {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
} }
else else {
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} }
print '</td>'; print '</td>';
@ -347,8 +338,7 @@ if (empty($conf->global->AGENDA_USE_EVENT_TYPE))
{ {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_USE_EVENT_TYPE">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_USE_EVENT_TYPE">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
} }
else else {
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_USE_EVENT_TYPE">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_USE_EVENT_TYPE">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>';
} }
print '</td></tr>'."\n"; print '</td></tr>'."\n";

View File

@ -55,8 +55,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
Header("Location: ".$_SERVER["PHP_SELF"]); Header("Location: ".$_SERVER["PHP_SELF"]);
exit; exit;
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -69,8 +68,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
Header("Location: ".$_SERVER["PHP_SELF"]); Header("Location: ".$_SERVER["PHP_SELF"]);
exit; exit;
} }
else else {
{
dol_print_error($db); 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"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=action&file=SPECIMEN.pdf");
return; return;
} }
else else {
{
setEventMessages($module->error, $module->errors, 'errors'); setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR); dol_syslog($module->error, LOG_ERR);
} }
} }
else else {
{
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }

View File

@ -55,8 +55,7 @@ if ($actionsave)
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
$db->rollback(); $db->rollback();
setEventMessages($langs->trans("SaveFailed"), null, 'errors'); setEventMessages($langs->trans("SaveFailed"), null, 'errors');
} }

View File

@ -128,8 +128,7 @@ if ($actionsave)
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
$db->rollback(); $db->rollback();
if (empty($errorsaved)) setEventMessages($langs->trans("Error"), null, 'errors'); if (empty($errorsaved)) setEventMessages($langs->trans("Error"), null, 'errors');
} }
@ -359,8 +358,7 @@ foreach ($dirmodels as $reldir) {
print "</td><td>\n"; print "</td><td>\n";
if (method_exists($module, 'info')) if (method_exists($module, 'info'))
print $module->info($langs); print $module->info($langs);
else else print $module->description;
print $module->description;
print '</td>'; print '</td>';
// Active // Active
@ -448,8 +446,7 @@ if ($conf->global->BANK_COLORIZE_MOVEMENT) {
print '</a>'; print '</a>';
print '</td>'; print '</td>';
} }
else else {
{
print '<td class="center">'."\n"; print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setbankcolorizemovement">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setbankcolorizemovement">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";
@ -509,8 +506,7 @@ if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) {
print '</a>'; print '</a>';
print '</td>'; print '</td>';
} }
else else {
{
print '<td class="center">'."\n"; print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setreportlastnumreleve">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setreportlastnumreleve">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";

View File

@ -81,8 +81,7 @@ elseif ($action == 'update')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -265,19 +264,16 @@ if ($resql)
//print $url; //print $url;
print '<img src="'.$url.'" title="'.$obj->example.'" border="0">'; print '<img src="'.$url.'" title="'.$obj->example.'" border="0">';
} }
else else {
{
print $langs->trans("FormatNotSupportedByGenerator"); print $langs->trans("FormatNotSupportedByGenerator");
} }
} }
else else {
{
print 'ErrorClassNotFoundInModule '.$classname.' '.$obj->coder; print 'ErrorClassNotFoundInModule '.$classname.' '.$obj->coder;
} }
} }
} }
else else {
{
print $langs->trans("ChooseABarCode"); print $langs->trans("ChooseABarCode");
} }
print '</td>'; print '</td>';
@ -412,8 +408,7 @@ if ($conf->product->enabled)
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>'; print '</a></td>';
} }
else else {
{
print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproducton&amp;value='.$file.'">'; print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproducton&amp;value='.$file.'">';
print img_picto($langs->trans("Disabled"), 'switch_off'); print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>'; print '</a></td>';

View File

@ -58,8 +58,7 @@ if ($action == 'updateMask')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=bom&file=SPECIMEN.pdf");
return; return;
} }
else else {
{
setEventMessages($module->error, null, 'errors'); setEventMessages($module->error, null, 'errors');
dol_syslog($module->error, LOG_ERR); dol_syslog($module->error, LOG_ERR);
} }
} }
else else {
{
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
@ -161,8 +158,7 @@ elseif ($action == 'set_BOM_DRAFT_WATERMARK')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -179,8 +175,7 @@ elseif ($action == 'set_BOM_FREE_TEXT')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -262,8 +257,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} }
else else {
{
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'">'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'">';
print img_picto($langs->trans("Disabled"), 'switch_off'); print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>'; print '</a>';
@ -328,8 +322,7 @@ if ($resql)
$i++; $i++;
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -399,8 +392,7 @@ foreach ($dirmodels as $reldir)
print '</a>'; print '</a>';
print '</td>'; print '</td>';
} }
else else {
{
print '<td class="center">'."\n"; print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";
@ -412,8 +404,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
} }
else else {
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} }
print '</td>'; print '</td>';
@ -442,8 +433,7 @@ foreach ($dirmodels as $reldir)
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
} }
else else {
{
print img_object($langs->trans("PreviewNotAvailable"), 'generic'); print img_object($langs->trans("PreviewNotAvailable"), 'generic');
} }
print '</td>'; print '</td>';
@ -489,8 +479,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{ {
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>'; print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
} }
else else {
{
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create(); print $doleditor->Create();

View File

@ -84,8 +84,7 @@ if ($action == 'add') {
$i++; $i++;
} }
} }
else else {
{
setEventMessages($db->lasterror(), null, 'errors'); setEventMessages($db->lasterror(), null, 'errors');
$error++; $error++;
} }
@ -135,8 +134,7 @@ if ($action == 'add') {
$db->commit(); $db->commit();
$action = ''; $action = '';
} }
else else {
{
$db->rollback(); $db->rollback();
} }
} }
@ -205,8 +203,7 @@ if ($action == 'switch')
{ {
$db->commit(); $db->commit();
} }
else else {
{
$db->rollback(); $db->rollback();
} }
} }
@ -346,8 +343,7 @@ foreach ($boxtoadd as $box)
{ {
$logo = $box->boximg; $logo = $box->boximg;
} }
else else {
{
$logo = preg_replace("/^object_/i", "", $box->boximg); $logo = preg_replace("/^object_/i", "", $box->boximg);
} }
@ -411,8 +407,7 @@ foreach ($boxactivated as $key => $box)
{ {
$logo = $box->boximg; $logo = $box->boximg;
} }
else else {
{
$logo = preg_replace("/^object_/i", "", $box->boximg); $logo = preg_replace("/^object_/i", "", $box->boximg);
} }

View File

@ -61,8 +61,7 @@ if ($action == 'updateMask')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -84,8 +83,7 @@ if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -182,8 +180,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} }
else else {
{
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/', '', $file).'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/', '', $file).'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
} }
print '</td>'; print '</td>';
@ -260,8 +257,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{ {
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>'; print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
} }
else else {
{
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create(); print $doleditor->Create();

View File

@ -47,8 +47,7 @@ if ($action == 'setvalue' && $user->admin)
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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'); print $langs->trans("LinkToTest", $user->login).': '.dol_print_phone($phonefortest, '', 0, 0, 'AC_TEL');
} }
else else {
{
$langs->load("errors"); $langs->load("errors");
print '<div class="warning">'.$langs->trans("WarningClickToDialUserSetupNotComplete").'</div>'; print '<div class="warning">'.$langs->trans("WarningClickToDialUserSetupNotComplete").'</div>';
} }

View File

@ -67,8 +67,7 @@ if ($action == 'updateMask')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande&file=SPECIMEN.pdf");
return; return;
} }
else else {
{
setEventMessages($module->error, null, 'errors'); setEventMessages($module->error, null, 'errors');
dol_syslog($module->error, LOG_ERR); dol_syslog($module->error, LOG_ERR);
} }
} }
else else {
{
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
@ -170,8 +167,7 @@ elseif ($action == 'set_COMMANDE_DRAFT_WATERMARK')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -188,8 +184,7 @@ elseif ($action == 'set_ORDER_FREE_TEXT')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -218,8 +213,7 @@ elseif ($action == 'setribchq')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -252,8 +245,7 @@ elseif ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -335,8 +327,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} }
else else {
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'">'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'">';
print img_picto($langs->trans("Disabled"), 'switch_off'); print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>'; print '</a>';
@ -401,8 +392,7 @@ if ($resql)
$i++; $i++;
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -472,8 +462,7 @@ foreach ($dirmodels as $reldir)
print '</a>'; print '</a>';
print '</td>'; print '</td>';
} }
else else {
{
print '<td class="center">'."\n"; print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";
@ -485,8 +474,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
} }
else else {
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} }
print '</td>'; print '</td>';
@ -520,8 +508,7 @@ foreach ($dirmodels as $reldir)
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
} }
else else {
{
print img_object($langs->trans("PreviewNotAvailable"), 'generic'); print img_object($langs->trans("PreviewNotAvailable"), 'generic');
} }
print '</td>'; print '</td>';
@ -595,14 +582,12 @@ if (empty($conf->facture->enabled))
} }
print "</select>"; print "</select>";
} }
else else {
{
print "<i>".$langs->trans("NoActiveBankAccountDefined")."</i>"; print "<i>".$langs->trans("NoActiveBankAccountDefined")."</i>";
} }
} }
} }
else else {
{
print '<span class="opacitymedium">'.$langs->trans("BankModuleNotActive").'</span>'; print '<span class="opacitymedium">'.$langs->trans("BankModuleNotActive").'</span>';
} }
} }
@ -682,8 +667,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{ {
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>'; print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
} }
else else {
{
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create(); print $doleditor->Create();

View File

@ -85,8 +85,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
$s = $mysoc->state_id.':'.$mysoc->state_code.':'.$mysoc->state_label; $s = $mysoc->state_id.':'.$mysoc->state_code.':'.$mysoc->state_label;
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE", $s, 'chaine', 0, '', $conf->entity); 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); dolibarr_del_const($db, "MAIN_INFO_SOCIETE_STATE", $conf->entity);
} }
@ -165,14 +164,12 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
$tmparray = explode(':', $result); $tmparray = explode(':', $result);
setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus', $tmparray[1]), null, 'errors'); setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus', $tmparray[1]), null, 'errors');
} }
else else {
{
$error++; $error++;
setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
} }
} }
else else {
{
$error++; $error++;
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans("ErrorBadImageFormat"), null, '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); 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_VALUE_LOCALTAX1", GETPOST('lt1', 'aZ09'), 'chaine', 0, '', $conf->entity);
} }
dolibarr_set_const($db, "MAIN_INFO_LOCALTAX_CALC1", GETPOST("clt1", '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); 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_VALUE_LOCALTAX2", GETPOST('lt2', 'aZ09'), 'chaine', 0, '', $conf->entity);
} }
dolibarr_set_const($db, "MAIN_INFO_LOCALTAX_CALC2", GETPOST("clt2", '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(); $db->commit();
} }
else else {
{
$db->rollback(); $db->rollback();
} }
@ -302,16 +296,14 @@ if ($action == 'addthumb' || $action == 'addthumbsquarred') // Regenerate thumb
header("Location: ".$_SERVER["PHP_SELF"]); header("Location: ".$_SERVER["PHP_SELF"]);
exit; exit;
} }
else else {
{
$error++; $error++;
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors');
dol_syslog($langs->transnoentities("ErrorBadImageFormat"), LOG_INFO); dol_syslog($langs->transnoentities("ErrorBadImageFormat"), LOG_INFO);
} }
} }
else else {
{
$error++; $error++;
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans("ErrorFileDoesNotExists", $_GET["file"]), null, 'errors'); setEventMessages($langs->trans("ErrorFileDoesNotExists", $_GET["file"]), null, 'errors');
@ -583,8 +575,7 @@ if ($langs->transcountry("ProfId1", $mysoc->country_code) != '-')
{ {
print '<input name="siren" id="profid1" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_SIREN) ? $conf->global->MAIN_INFO_SIREN : '').'">'; print '<input name="siren" id="profid1" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_SIREN) ? $conf->global->MAIN_INFO_SIREN : '').'">';
} }
else else {
{
print $countrynotdefined; print $countrynotdefined;
} }
print '</td></tr>'; print '</td></tr>';
@ -598,8 +589,7 @@ if ($langs->transcountry("ProfId2", $mysoc->country_code) != '-')
{ {
print '<input name="siret" id="profid2" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_SIRET) ? $conf->global->MAIN_INFO_SIRET : '').'">'; print '<input name="siret" id="profid2" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_SIRET) ? $conf->global->MAIN_INFO_SIRET : '').'">';
} }
else else {
{
print $countrynotdefined; print $countrynotdefined;
} }
print '</td></tr>'; print '</td></tr>';
@ -613,8 +603,7 @@ if ($langs->transcountry("ProfId3", $mysoc->country_code) != '-')
{ {
print '<input name="ape" id="profid3" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_APE) ? $conf->global->MAIN_INFO_APE : '').'">'; print '<input name="ape" id="profid3" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_APE) ? $conf->global->MAIN_INFO_APE : '').'">';
} }
else else {
{
print $countrynotdefined; print $countrynotdefined;
} }
print '</td></tr>'; print '</td></tr>';
@ -628,8 +617,7 @@ if ($langs->transcountry("ProfId4", $mysoc->country_code) != '-')
{ {
print '<input name="rcs" id="profid4" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_RCS) ? $conf->global->MAIN_INFO_RCS : '').'">'; print '<input name="rcs" id="profid4" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_RCS) ? $conf->global->MAIN_INFO_RCS : '').'">';
} }
else else {
{
print $countrynotdefined; print $countrynotdefined;
} }
print '</td></tr>'; print '</td></tr>';
@ -643,8 +631,7 @@ if ($langs->transcountry("ProfId5", $mysoc->country_code) != '-')
{ {
print '<input name="MAIN_INFO_PROFID5" id="profid5" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_PROFID5) ? $conf->global->MAIN_INFO_PROFID5 : '').'">'; print '<input name="MAIN_INFO_PROFID5" id="profid5" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_PROFID5) ? $conf->global->MAIN_INFO_PROFID5 : '').'">';
} }
else else {
{
print $countrynotdefined; print $countrynotdefined;
} }
print '</td></tr>'; print '</td></tr>';
@ -658,8 +645,7 @@ if ($langs->transcountry("ProfId6", $mysoc->country_code) != '-')
{ {
print '<input name="MAIN_INFO_PROFID6" id="profid6" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_PROFID6) ? $conf->global->MAIN_INFO_PROFID6 : '').'">'; print '<input name="MAIN_INFO_PROFID6" id="profid6" class="minwidth200" value="'.dol_escape_htmltag(!empty($conf->global->MAIN_INFO_PROFID6) ? $conf->global->MAIN_INFO_PROFID6 : '').'">';
} }
else else {
{
print $countrynotdefined; print $countrynotdefined;
} }
print '</td></tr>'; print '</td></tr>';

View File

@ -102,8 +102,7 @@ if ($action == 'update')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }

View File

@ -136,8 +136,7 @@ if (empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
{ {
print '<a href="confexped.php?action=activate_delivery">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="confexped.php?action=activate_delivery">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
} }
else else {
{
print '<a href="confexped.php?action=disable_delivery">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>'; print '<a href="confexped.php?action=disable_delivery">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>';
} }

View File

@ -86,8 +86,7 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update'))
$constvalue = ""; $constvalue = "";
$constnote = ""; $constnote = "";
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -105,8 +104,7 @@ if (!empty($consts) && $action == 'update')
{ {
$nbmodified++; $nbmodified++;
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -127,8 +125,7 @@ if (!empty($consts) && $action == 'delete')
{ {
$nbdeleted++; $nbdeleted++;
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -144,8 +141,7 @@ if ($action == 'delete')
{ {
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -231,8 +227,7 @@ if (!empty($conf->multicompany->enabled) && !$user->entity)
print '</td>'; print '</td>';
print '<td class="center">'; print '<td class="center">';
} }
else else {
{
print '<td class="center">'; print '<td class="center">';
print '<input type="hidden" name="entity" value="'.$conf->entity.'">'; print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
} }
@ -298,8 +293,7 @@ if ($result)
print '</td>'; print '</td>';
print '<td class="center">'; print '<td class="center">';
} }
else else {
{
print '<td class="center">'; print '<td class="center">';
print '<input type="hidden" name="const['.$i.'][entity]" value="'.$obj->entity.'">'; print '<input type="hidden" name="const['.$i.'][entity]" value="'.$obj->entity.'">';
} }
@ -308,8 +302,7 @@ if ($result)
{ {
print '<input type="checkbox" class="flat checkboxfordelete" id="check_'.$i.'" name="const['.$i.'][check]" value="1">'; print '<input type="checkbox" class="flat checkboxfordelete" id="check_'.$i.'" name="const['.$i.'][check]" value="1">';
} }
else else {
{
print '<a href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&action=delete'.((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_delete().'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&action=delete'.((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_delete().'</a>';
} }

View File

@ -63,8 +63,7 @@ if ($action == 'updateMask')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=contract&file=SPECIMEN.pdf");
return; return;
} }
else else {
{
setEventMessages($obj->error, $obj->errors, 'errors'); setEventMessages($obj->error, $obj->errors, 'errors');
dol_syslog($obj->error, LOG_ERR); dol_syslog($obj->error, LOG_ERR);
} }
} }
else else {
{
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
@ -169,8 +166,7 @@ elseif ($action == 'set_other')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -252,8 +248,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} }
else else {
{
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'">'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'">';
print img_picto($langs->trans("Disabled"), 'switch_off'); print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>'; print '</a>';
@ -317,8 +312,7 @@ if ($resql)
$i++; $i++;
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -388,8 +382,7 @@ foreach ($dirmodels as $reldir)
print '</a>'; print '</a>';
print '</td>'; print '</td>';
} }
else else {
{
print '<td class="center">'."\n"; print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";
@ -401,8 +394,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
} }
else else {
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} }
print '</td>'; print '</td>';
@ -434,8 +426,7 @@ foreach ($dirmodels as $reldir)
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'contract').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'contract').'</a>';
} }
else else {
{
print img_object($langs->trans("PreviewNotAvailable"), 'generic'); print img_object($langs->trans("PreviewNotAvailable"), 'generic');
} }
print '</td>'; print '</td>';
@ -483,8 +474,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{ {
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>'; print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
} }
else else {
{
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create(); print $doleditor->Create();

View File

@ -101,8 +101,7 @@ if ($action == 'edit')
{ {
print $form->selectyesno($key, $conf->global->$key, 1); print $form->selectyesno($key, $conf->global->$key, 1);
} }
else else {
{
print '<input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->$key.'">'; print '<input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->$key.'">';
} }
print '</td></tr>'; print '</td></tr>';
@ -117,8 +116,7 @@ if ($action == 'edit')
print '</form>'; print '</form>';
print '<br>'; print '<br>';
} }
else else {
{
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>'; print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
@ -141,8 +139,7 @@ else
{ {
print yn($conf->global->$key); print yn($conf->global->$key);
} }
else else {
{
print $conf->global->$key; print $conf->global->$key;
} }
print '</td></tr>'; print '</td></tr>';

View File

@ -59,8 +59,7 @@ if ($action == 'set')
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
$db->rollback(); $db->rollback();
setEventMessages($error, null, 'errors'); setEventMessages($error, null, 'errors');
} }

View File

@ -151,8 +151,7 @@ if (($action == 'add' || (GETPOST('add') && $action != 'update')) || GETPOST('ac
$defaultkey = ''; $defaultkey = '';
$defaultvalue = ''; $defaultvalue = '';
} }
else else {
{
$db->rollback(); $db->rollback();
setEventMessages($db->lasterror(), null, 'errors'); setEventMessages($db->lasterror(), null, 'errors');
$action = ''; $action = '';
@ -170,8 +169,7 @@ if ($action == 'delete')
{ {
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
} }
else else {
{
dol_print_error($db); 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 .= img_picto($langs->trans("Disabled"), 'switch_off');
$enabledisablehtml .= '</a>'; $enabledisablehtml .= '</a>';
} }
else else {
{
// Button on, click to disable // Button on, click to disable
$enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setMAIN_ENABLE_DEFAULT_VALUES&value=0'.$param.'">'; $enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setMAIN_ENABLE_DEFAULT_VALUES&value=0'.$param.'">';
$enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on'); $enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on');
@ -261,8 +258,7 @@ if ($mode != 'sortorder')
{ {
$textkey = $form->textwithpicto($langs->trans("Field"), $texthelp); $textkey = $form->textwithpicto($langs->trans("Field"), $texthelp);
} }
else else {
{
$texthelp = 'field or alias.field'; $texthelp = 'field or alias.field';
$textkey = $form->textwithpicto($langs->trans("Field"), $texthelp); $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'); $textvalue = $form->textwithpicto($langs->trans("Value"), $texthelp, 1, 'help', '', 0, 2, 'subsitutiontooltip');
} }
else else {
{
$texthelp = 'ASC or DESC'; $texthelp = 'ASC or DESC';
$textvalue = $form->textwithpicto($langs->trans("SortOrder"), $texthelp); $textvalue = $form->textwithpicto($langs->trans("SortOrder"), $texthelp);
} }
@ -322,8 +317,7 @@ if (!empty($conf->multicompany->enabled) && !$user->entity)
print '<input type="text" class="flat" size="1" disabled name="entity" value="'.$conf->entity.'">'; // We see environment, but to change it we must switch on other entity print '<input type="text" class="flat" size="1" disabled name="entity" value="'.$conf->entity.'">'; // We see environment, but to change it we must switch on other entity
print '</td>'; print '</td>';
} }
else else {
{
print '<td class="center">'; print '<td class="center">';
print '<input type="hidden" name="entity" value="'.$conf->entity.'">'; print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
print '</td>'; print '</td>';
@ -394,8 +388,7 @@ if ($result)
print ' &nbsp; '; print ' &nbsp; ';
print '<a href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&mode='.$mode.'&action=delete'.((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_delete().'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&mode='.$mode.'&action=delete'.((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_delete().'</a>';
} }
else else {
{
print '<input type="hidden" name="page" value="'.$page.'">'; print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="rowid" value="'.$id.'">'; print '<input type="hidden" name="rowid" value="'.$id.'">';
print '<div name="'.(!empty($obj->rowid) ? $obj->rowid : 'none').'"></div>'; print '<div name="'.(!empty($obj->rowid) ? $obj->rowid : 'none').'"></div>';
@ -409,8 +402,7 @@ if ($result)
$i++; $i++;
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }

View File

@ -250,8 +250,7 @@ if ($action == 'edit')
print '</table>'; print '</table>';
} }
else else {
{
/* /*
* Show parameters * Show parameters
*/ */

View File

@ -698,8 +698,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
{ {
$_POST["country"] = ''; $_POST["country"] = '';
} }
else else {
{
$ok = 0; $ok = 0;
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Country")), null, 'errors'); setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Country")), null, 'errors');
} }
@ -792,8 +791,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs'); setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
$_POST = array('id'=>$id); // Clean $_POST array, we keep only $_POST = array('id'=>$id); // Clean $_POST array, we keep only
} }
else else {
{
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors'); setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors');
} }
@ -883,8 +881,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete
{ {
setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors'); setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors');
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -1302,8 +1299,7 @@ if ($id)
print '</td>'; print '</td>';
$filterfound++; $filterfound++;
} }
else else {
{
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '</td>'; print '</td>';
} }
@ -1439,8 +1435,7 @@ if ($id)
print '<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'">';
print '</td>'; print '</td>';
} }
else else {
{
$tmpaction = 'view'; $tmpaction = 'view';
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); $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 $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 = '-'; $valuetoshow = '-';
} }
else else {
{
$key = $langs->trans("Country".strtoupper($obj->country_code)); $key = $langs->trans("Country".strtoupper($obj->country_code));
$valuetoshow = ($key != "Country".strtoupper($obj->country_code) ? $obj->country_code." - ".$key : $obj->country); $valuetoshow = ($key != "Country".strtoupper($obj->country_code) ? $obj->country_code." - ".$key : $obj->country);
} }
@ -1605,15 +1599,13 @@ if ($id)
elseif ($fieldlist[$field] == 'localtax1_type') { elseif ($fieldlist[$field] == 'localtax1_type') {
if ($obj->localtax1 != 0) if ($obj->localtax1 != 0)
$valuetoshow = $localtax_typeList[$valuetoshow]; $valuetoshow = $localtax_typeList[$valuetoshow];
else else $valuetoshow = '';
$valuetoshow = '';
$class = "center"; $class = "center";
} }
elseif ($fieldlist[$field] == 'localtax2_type') { elseif ($fieldlist[$field] == 'localtax2_type') {
if ($obj->localtax2 != 0) if ($obj->localtax2 != 0)
$valuetoshow = $localtax_typeList[$valuetoshow]; $valuetoshow = $localtax_typeList[$valuetoshow];
else else $valuetoshow = '';
$valuetoshow = '';
$class = "center"; $class = "center";
} }
elseif ($fieldlist[$field] == 'taux') { elseif ($fieldlist[$field] == 'taux') {
@ -1709,8 +1701,7 @@ if ($id)
// Active // Active
print '<td class="nowrap center">'; print '<td class="nowrap center">';
if ($canbedisabled) print '<a class="reposition" href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>'; if ($canbedisabled) print '<a class="reposition" href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
else else {
{
if (in_array($obj->code, array('AC_OTH', 'AC_OTH_AUTO'))) print $langs->trans("AlwaysActive"); 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('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"); 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 '</form>'; print '</form>';
} }
else else {
{
/* /*
* Show list of dictionary to show * Show list of dictionary to show
*/ */
@ -1782,8 +1772,7 @@ else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$i.'">'.$langs->trans($tablib[$i]).'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$i.'">'.$langs->trans($tablib[$i]).'</a>';
} }
else else {
{
print $langs->trans($tablib[$i]); print $langs->trans($tablib[$i]);
} }
print '</td>'; print '</td>';
@ -1796,8 +1785,7 @@ else
print '<td>'.$tabname[$i].'</td></tr>'; print '<td>'.$tabname[$i].'</td></tr>';
$lastlineisempty = false; $lastlineisempty = false;
} }
else else {
{
if (!$lastlineisempty) if (!$lastlineisempty)
{ {
$showemptyline = 1; $showemptyline = 1;
@ -2003,8 +1991,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
$accountancy_account = (!empty($obj->$fieldname) ? $obj->$fieldname : 0); $accountancy_account = (!empty($obj->$fieldname) ? $obj->$fieldname : 0);
print $formaccounting->select_account($accountancy_account, '.'.$fieldlist[$field], 1, '', 1, 1, 'maxwidth200 maxwidthonsmartphone'); print $formaccounting->select_account($accountancy_account, '.'.$fieldlist[$field], 1, '', 1, 1, 'maxwidth200 maxwidthonsmartphone');
} }
else else {
{
$fieldname = $fieldlist[$field]; $fieldname = $fieldlist[$field];
print '<input type="text" size="10" class="flat" value="'.(isset($obj->$fieldname) ? $obj->$fieldname : '').'" name="'.$fieldlist[$field].'">'; print '<input type="text" size="10" class="flat" value="'.(isset($obj->$fieldname) ? $obj->$fieldname : '').'" name="'.$fieldlist[$field].'">';
} }
@ -2028,8 +2015,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
print $form->selectExpenseRanges($obj->fk_range); print $form->selectExpenseRanges($obj->fk_range);
print '</td>'; print '</td>';
} }
else else {
{
$fieldValue = isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''; $fieldValue = isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:'';
if ($fieldlist[$field] == 'sortorder') if ($fieldlist[$field] == 'sortorder')

View File

@ -136,9 +136,10 @@ class PrestaShopWebservice
{ {
if (isset($curl_params[$defkey])) if (isset($curl_params[$defkey]))
$curl_options[$defkey] = $curl_params[$defkey]; $curl_options[$defkey] = $curl_params[$defkey];
else else {
$curl_options[$defkey] = $defaultParams[$defkey]; $curl_options[$defkey] = $defaultParams[$defkey];
} }
}
foreach ($curl_params as $defkey => $defval) foreach ($curl_params as $defkey => $defval)
if (!isset($curl_options[$defkey])) if (!isset($curl_options[$defkey]))
$curl_options[$defkey] = $curl_params[$defkey]; $curl_options[$defkey] = $curl_params[$defkey];
@ -237,9 +238,10 @@ class PrestaShopWebservice
} }
return $xml; return $xml;
} }
else else {
throw new PrestaShopWebserviceException('HTTP response is empty'); throw new PrestaShopWebserviceException('HTTP response is empty');
} }
}
/** /**
* Add (POST) a resource * Add (POST) a resource
@ -264,9 +266,7 @@ class PrestaShopWebservice
$url .= '&id_shop='.$options['id_shop']; $url .= '&id_shop='.$options['id_shop'];
if (isset($options['id_group_shop'])) if (isset($options['id_group_shop']))
$url .= '&id_group_shop='.$options['id_group_shop']; $url .= '&id_group_shop='.$options['id_group_shop'];
} } else {
else
{
throw new PrestaShopWebserviceException('Bad parameters given'); throw new PrestaShopWebserviceException('Bad parameters given');
} }
$request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $xml)); $request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $xml));
@ -323,9 +323,9 @@ class PrestaShopWebservice
$url_params[$k] = $options[$k]; $url_params[$k] = $options[$k];
if (count($url_params) > 0) if (count($url_params) > 0)
$url .= '?'.http_build_query($url_params); $url .= '?'.http_build_query($url_params);
} } else {
else
throw new PrestaShopWebserviceException('Bad parameters given '); throw new PrestaShopWebserviceException('Bad parameters given ');
}
$request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET')); $request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET'));
self::checkStatusCode($request['status_code']); // check the response validity self::checkStatusCode($request['status_code']); // check the response validity
@ -356,9 +356,9 @@ class PrestaShopWebservice
$url_params[$k] = $options[$k]; $url_params[$k] = $options[$k];
if (count($url_params) > 0) if (count($url_params) > 0)
$url .= '?'.http_build_query($url_params); $url .= '?'.http_build_query($url_params);
} } else {
else
throw new PrestaShopWebserviceException('Bad parameters given'); throw new PrestaShopWebserviceException('Bad parameters given');
}
$request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'HEAD', CURLOPT_NOBODY => true)); $request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'HEAD', CURLOPT_NOBODY => true));
self::checkStatusCode($request['status_code']); // check the response validity self::checkStatusCode($request['status_code']); // check the response validity
return $request['header']; return $request['header'];
@ -387,9 +387,9 @@ class PrestaShopWebservice
$url .= '&id_shop='.$options['id_shop']; $url .= '&id_shop='.$options['id_shop'];
if (isset($options['id_group_shop'])) if (isset($options['id_group_shop']))
$url .= '&id_group_shop='.$options['id_group_shop']; $url .= '&id_group_shop='.$options['id_group_shop'];
} } else {
else
throw new PrestaShopWebserviceException('Bad parameters given'); throw new PrestaShopWebserviceException('Bad parameters given');
}
$request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_POSTFIELDS => $xml)); $request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_POSTFIELDS => $xml));
self::checkStatusCode($request['status_code']); // check the response validity self::checkStatusCode($request['status_code']); // check the response validity

View File

@ -101,8 +101,7 @@ class Dolistore
$trace = $e->getTrace(); $trace = $e->getTrace();
if ($trace[0]['args'][0] == 404) die('Bad ID'); if ($trace[0]['args'][0] == 404) die('Bad ID');
elseif ($trace[0]['args'][0] == 401) die('Bad auth key'); elseif ($trace[0]['args'][0] == 401) die('Bad auth key');
else else {
{
print 'Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'<br>'; print 'Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'<br>';
print $e->getMessage(); print $e->getMessage();
} }
@ -183,8 +182,7 @@ class Dolistore
$trace = $e->getTrace(); $trace = $e->getTrace();
if ($trace[0]['args'][0] == 404) die('Bad ID'); if ($trace[0]['args'][0] == 404) die('Bad ID');
elseif ($trace[0]['args'][0] == 401) die('Bad auth key'); elseif ($trace[0]['args'][0] == 401) die('Bad auth key');
else else {
{
print 'Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'<br>'; print 'Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'<br>';
print $e->getMessage(); print $e->getMessage();
} }

View File

@ -42,8 +42,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
header("Location: ".$_SERVER["PHP_SELF"]); header("Location: ".$_SERVER["PHP_SELF"]);
exit; exit;
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -56,8 +55,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
header("Location: ".$_SERVER["PHP_SELF"]); header("Location: ".$_SERVER["PHP_SELF"]);
exit; exit;
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -94,8 +92,7 @@ if ($conf->use_javascript_ajax)
{ {
print ajax_constantonoff('ECM_AUTO_TREE_ENABLED'); print ajax_constantonoff('ECM_AUTO_TREE_ENABLED');
} }
else else {
{
if (empty($conf->global->ECM_AUTO_TREE_ENABLED)) if (empty($conf->global->ECM_AUTO_TREE_ENABLED))
{ {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_ECM_AUTO_TREE_ENABLED">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_ECM_AUTO_TREE_ENABLED">'.img_picto($langs->trans("Disabled"), 'off').'</a>';

View File

@ -127,8 +127,7 @@ if (GETPOST('addfilter', 'alpha'))
{ {
$object->fetchFilters(); $object->fetchFilters();
} }
else else {
{
setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error, 'errors'); setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error, 'errors');
} }
} }
@ -142,8 +141,7 @@ if ($action == 'deletefilter')
{ {
$object->fetchFilters(); $object->fetchFilters();
} }
else else {
{
setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error, 'errors'); setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error, 'errors');
} }
} }
@ -163,8 +161,7 @@ if (GETPOST('addoperation', 'alpha'))
{ {
$object->fetchActions(); $object->fetchActions();
} }
else else {
{
setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors'); setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors');
} }
} }
@ -182,8 +179,7 @@ if ($action == 'updateoperation')
{ {
$object->fetchActions(); $object->fetchActions();
} }
else else {
{
setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors'); setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors');
} }
} }
@ -196,8 +192,7 @@ if ($action == 'deleteoperation')
{ {
$object->fetchActions(); $object->fetchActions();
} }
else else {
{
setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors'); setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors');
} }
} }
@ -212,8 +207,7 @@ if ($action == 'confirm_collect')
$debuginfo = $object->debuginfo; $debuginfo = $object->debuginfo;
setEventMessages($object->lastresult, null, 'mesgs'); setEventMessages($object->lastresult, null, 'mesgs');
} }
else else {
{
$debuginfo = $object->debuginfo; $debuginfo = $object->debuginfo;
setEventMessages($object->error, null, 'errors'); 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); $morehtml .= $form->textwithpicto('', 'connect string '.$connectstringserver);
} }
else else {
{
$morehtml .= 'IMAP functions not available on your PHP'; $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; $morehtml .= 'Failed to open IMAP connection '.$connectstringsource;
} }
else else {
{
$morehtml .= imap_num_msg($connection); $morehtml .= imap_num_msg($connection);
} }
@ -582,8 +574,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($res) if ($res)
$arrayoftypes = $hookmanager->resArray; $arrayoftypes = $hookmanager->resArray;
else else foreach ($hookmanager->resArray as $k=>$desc)
foreach ($hookmanager->resArray as $k=>$desc)
$arrayoftypes[$k] = $desc; $arrayoftypes[$k] = $desc;
@ -626,8 +617,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<input type="hidden" name="rowidoperation2" value="'.$ruleaction['id'].'"><br>'; print '<input type="hidden" name="rowidoperation2" value="'.$ruleaction['id'].'"><br>';
print '<input type="submit" class="button" name="saveoperation2" value="'.$langs->trans("Save").'"> <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" class="button" name="saveoperation2" value="'.$langs->trans("Save").'"> <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
} }
else else {
{
print $ruleaction['actionparam']; print $ruleaction['actionparam'];
} }
print '</td>'; print '</td>';

View File

@ -242,8 +242,7 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords)
{ {
$num = $nbtotalofrecords; $num = $nbtotalofrecords;
} }
else else {
{
$sql .= $db->plimit($limit + 1, $offset); $sql .= $db->plimit($limit + 1, $offset);
$resql = $db->query($sql); $resql = $db->query($sql);

View File

@ -69,8 +69,7 @@ if ($action == 'updateMask')
{ {
if ($res > 0) if ($res > 0)
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
else else setEventMessages($langs->trans("Error"), null, 'errors');
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"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=expedition&file=SPECIMEN.pdf");
return; return;
} }
else else {
{
setEventMessages($module->error, $module->errors, 'errors'); setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR); dol_syslog($module->error, LOG_ERR);
} }
} }
else else {
{
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
@ -259,8 +256,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} }
else else {
{
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmodel&amp;value='.$file.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmodel&amp;value='.$file.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Disabled"), 'switch_off'); print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>'; print '</a>';
@ -327,8 +323,7 @@ if ($resql)
$i++; $i++;
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -396,8 +391,7 @@ foreach ($dirmodels as $reldir)
print '</a>'; print '</a>';
print '</td>'; print '</td>';
} }
else else {
{
print '<td class="center">'."\n"; print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";
@ -409,8 +403,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
} }
else else {
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} }
print '</td>'; print '</td>';
@ -439,8 +432,7 @@ foreach ($dirmodels as $reldir)
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'sending').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'sending').'</a>';
} }
else else {
{
print img_object($langs->trans("PreviewNotAvailable"), 'generic'); print img_object($langs->trans("PreviewNotAvailable"), 'generic');
} }
print '</td>'; print '</td>';
@ -487,8 +479,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{ {
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>'; print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
} }
else else {
{
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create(); print $doleditor->Create();

View File

@ -64,8 +64,7 @@ if ($action == 'updateMask')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=expensereport&file=SPECIMEN.pdf");
return; return;
} }
else else {
{
setEventMessages($module->error, $module->errors, 'errors'); setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR); dol_syslog($module->error, LOG_ERR);
} }
} }
else else {
{
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
@ -179,8 +176,7 @@ elseif ($action == 'setoptions')
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
$db->rollback(); $db->rollback();
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
@ -264,8 +260,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} }
else else {
{
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'">'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'">';
print img_picto($langs->trans("Disabled"), 'switch_off'); print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>'; print '</a>';
@ -329,8 +324,7 @@ if ($resql)
$i++; $i++;
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -396,8 +390,7 @@ foreach ($dirmodels as $reldir)
print '</a>'; print '</a>';
print "</td>"; print "</td>";
} }
else else {
{
print '<td class="center">'."\n"; print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";
@ -409,8 +402,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
} }
else else {
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} }
print '</td>'; print '</td>';
@ -435,8 +427,7 @@ foreach ($dirmodels as $reldir)
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'intervention').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'intervention').'</a>';
} }
else else {
{
print img_object($langs->trans("PreviewNotAvailable"), 'generic'); print img_object($langs->trans("PreviewNotAvailable"), 'generic');
} }
print '</td>'; print '</td>';
@ -485,8 +476,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{ {
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>'; print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
} }
else else {
{
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create(); print $doleditor->Create();

View File

@ -162,8 +162,7 @@ foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab)
echo '<input id="" class="button" name="save" value="'.$langs->trans('Save').'" type="submit" />'; echo '<input id="" class="button" name="save" value="'.$langs->trans('Save').'" type="submit" />';
echo '<input class="button" value="'.$langs->trans('Cancel').'" onclick="javascript:history.go(-1)" type="button" />'; echo '<input class="button" value="'.$langs->trans('Cancel').'" onclick="javascript:history.go(-1)" type="button" />';
} }
else else {
{
echo '<a href="'.$_SERVER['PHP_SELF'].'?action=edit&id='.$range->ik->id.'&fk_c_exp_tax_cat='.$range->fk_c_exp_tax_cat.'&fk_range='.$range->rowid.'">'.img_edit().'</a>'; echo '<a href="'.$_SERVER['PHP_SELF'].'?action=edit&id='.$range->ik->id.'&fk_c_exp_tax_cat='.$range->fk_c_exp_tax_cat.'&fk_range='.$range->rowid.'">'.img_edit().'</a>';
if (!empty($range->ik->id)) echo '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&id='.$range->ik->id.'">'.img_delete().'</a>'; if (!empty($range->ik->id)) echo '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&id='.$range->ik->id.'">'.img_delete().'</a>';
// TODO add delete link // TODO add delete link

View File

@ -229,8 +229,7 @@ foreach ($rules as $rule)
echo '<div id="user" class="float">'.$form->select_dolusers($object->fk_user, 'fk_user').'</div>'; echo '<div id="user" class="float">'.$form->select_dolusers($object->fk_user, 'fk_user').'</div>';
echo '<div id="group" class="float">'.$form->select_dolgroups($object->fk_usergroup, 'fk_usergroup').'</div>'; echo '<div id="group" class="float">'.$form->select_dolgroups($object->fk_usergroup, 'fk_usergroup').'</div>';
} }
else else {
{
if ($rule->is_for_all > 0) echo $tab_apply['A']; if ($rule->is_for_all > 0) echo $tab_apply['A'];
elseif ($rule->fk_usergroup > 0) echo $tab_apply['G'].' ('.$rule->getGroupLabel().')'; elseif ($rule->fk_usergroup > 0) echo $tab_apply['G'].' ('.$rule->getGroupLabel().')';
elseif ($rule->fk_user > 0) echo $tab_apply['U'].' ('.$rule->getUserName().')'; 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); 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'); 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'); $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); 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' 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); 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 $tab_rules_type[$rule->code_expense_rules_type];
} }
echo '</td>'; echo '</td>';
@ -273,8 +269,7 @@ foreach ($rules as $rule)
{ {
print $form->selectDate(strtotime(date('Y-m-d', $object->dates)), 'start', '', '', 0, '', 1, 0); print $form->selectDate(strtotime(date('Y-m-d', $object->dates)), 'start', '', '', 0, '', 1, 0);
} }
else else {
{
echo dol_print_date($rule->dates, 'day'); echo dol_print_date($rule->dates, 'day');
} }
echo '</td>'; echo '</td>';
@ -285,8 +280,7 @@ foreach ($rules as $rule)
{ {
print $form->selectDate(strtotime(date('Y-m-d', $object->datee)), 'end', '', '', 0, '', 1, 0); print $form->selectDate(strtotime(date('Y-m-d', $object->datee)), 'end', '', '', 0, '', 1, 0);
} }
else else {
{
echo dol_print_date($rule->datee, 'day'); echo dol_print_date($rule->datee, 'day');
} }
echo '</td>'; echo '</td>';
@ -297,8 +291,7 @@ foreach ($rules as $rule)
{ {
echo '<input type="text" value="'.price2num($object->amount).'" name="amount" class="amount" />'.$conf->currency; echo '<input type="text" value="'.price2num($object->amount).'" name="amount" class="amount" />'.$conf->currency;
} }
else else {
{
echo price($rule->amount, 0, $langs, 1, -1, -1, $conf->currency); echo price($rule->amount, 0, $langs, 1, -1, -1, $conf->currency);
} }
echo '</td>'; echo '</td>';
@ -309,8 +302,7 @@ foreach ($rules as $rule)
{ {
echo $form->selectyesno('restrictive', $object->restrictive, 1); echo $form->selectyesno('restrictive', $object->restrictive, 1);
} }
else else {
{
echo yn($rule->restrictive, 1, 1); echo yn($rule->restrictive, 1, 1);
} }
echo '</td>'; echo '</td>';
@ -322,8 +314,7 @@ foreach ($rules as $rule)
echo '<a href="'.$_SERVER['PHP_SELF'].'?action=edit&id='.$rule->id.'">'.img_edit().'</a>&nbsp;'; echo '<a href="'.$_SERVER['PHP_SELF'].'?action=edit&id='.$rule->id.'">'.img_edit().'</a>&nbsp;';
echo '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&id='.$rule->id.'">'.img_delete().'</a>'; echo '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&id='.$rule->id.'">'.img_delete().'</a>';
} }
else else {
{
echo '<input type="submit" class="button" value="'.$langs->trans('Update').'" />&nbsp;'; echo '<input type="submit" class="button" value="'.$langs->trans('Update').'" />&nbsp;';
echo '<a href="'.$_SERVER['PHP_SELF'].'" class="button">'.$langs->trans('Cancel').'</a>'; echo '<a href="'.$_SERVER['PHP_SELF'].'" class="button">'.$langs->trans('Cancel').'</a>';
} }

View File

@ -61,8 +61,7 @@ if ($result)
if ($reg[1] && $reg[1] > $lastexternalrss) $lastexternalrss = $reg[1]; if ($reg[1] && $reg[1] > $lastexternalrss) $lastexternalrss = $reg[1];
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -93,8 +92,7 @@ if ($action == 'add' || GETPOST("modify"))
} }
*/ */
} }
else else {
{
// Ajoute boite box_external_rss dans definition des boites // Ajoute boite box_external_rss dans definition des boites
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes_def (file, note)"; $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')).")')"; $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"]); header("Location: ".$_SERVER["PHP_SELF"]);
exit; exit;
} }
else else {
{
$db->rollback(); $db->rollback();
dol_print_error($db); dol_print_error($db);
} }
@ -162,8 +159,7 @@ if ($_POST["delete"])
$db->commit(); $db->commit();
} }
else else {
{
$db->rollback(); $db->rollback();
dol_print_error($db, "sql=".$sql); dol_print_error($db, "sql=".$sql);
exit; exit;
@ -179,8 +175,7 @@ if ($_POST["delete"])
header("Location: external_rss.php"); header("Location: external_rss.php");
exit; exit;
} }
else else {
{
$db->rollback(); $db->rollback();
dol_print_error($db); dol_print_error($db);
} }
@ -293,8 +288,7 @@ if ($resql)
{ {
print '<font class="ok">'.$langs->trans("Online").'</div>'; print '<font class="ok">'.$langs->trans("Online").'</div>';
} }
else else {
{
print '<font class="error">'.$langs->trans("Offline"); print '<font class="error">'.$langs->trans("Offline");
$langs->load("errors"); $langs->load("errors");
if ($rssparser->error) print ' - '.$langs->trans($rssparser->error); if ($rssparser->error) print ' - '.$langs->trans($rssparser->error);
@ -332,8 +326,7 @@ if ($resql)
$i++; $i++;
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }

View File

@ -72,8 +72,7 @@ if ($action == 'updateMask')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture&file=SPECIMEN.pdf");
return; return;
} }
else else {
{
setEventMessages($module->error, $module->errors, 'errors'); setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR); dol_syslog($module->error, LOG_ERR);
} }
} }
else else {
{
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
@ -173,8 +170,7 @@ elseif ($action == 'setribchq')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -190,8 +186,7 @@ elseif ($action == 'set_FACTURE_DRAFT_WATERMARK')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -208,8 +203,7 @@ elseif ($action == 'set_INVOICE_FREE_TEXT')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -225,8 +219,7 @@ elseif ($action == 'setforcedate')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -248,8 +241,7 @@ elseif ($action == 'setDefaultPDFModulesByType')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -350,8 +342,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} }
else else {
{
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/', '', $file).'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/', '', $file).'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
} }
print '</td>'; print '</td>';
@ -463,8 +454,7 @@ if ($resql)
$i++; $i++;
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -535,8 +525,7 @@ foreach ($dirmodels as $reldir)
print '</a>'; print '</a>';
print '</td>'; print '</td>';
} }
else else {
{
print '<td class="center">'."\n"; print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("SetAsDefault"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("SetAsDefault"), 'switch_off').'</a>';
print "</td>"; print "</td>";
@ -548,8 +537,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
} }
else else {
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("SetAsDefault"), 'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("SetAsDefault"), 'off').'</a>';
} }
print '</td>'; print '</td>';
@ -583,8 +571,7 @@ foreach ($dirmodels as $reldir)
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
} }
else else {
{
print img_object($langs->trans("PreviewNotAvailable"), 'generic'); print img_object($langs->trans("PreviewNotAvailable"), 'generic');
} }
print '</td>'; print '</td>';
@ -691,14 +678,12 @@ if (!empty($conf->banque->enabled))
} }
print "</select>"; print "</select>";
} }
else else {
{
print '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>'; print '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>';
} }
} }
} }
else else {
{
print $langs->trans("BankModuleNotActive"); print $langs->trans("BankModuleNotActive");
} }
print "</td></tr>"; print "</td></tr>";
@ -777,8 +762,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{ {
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>'; print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
} }
else else {
{
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create(); print $doleditor->Create();

View File

@ -127,8 +127,7 @@ if (GETPOST('save', 'alpha'))
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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'); setEventMessages(array($langs->trans("NotAvailable"), $langs->trans("JavascriptDisabled")), null, 'errors');
} }
else else {
{
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("ActivateFCKeditor").'</td>'; print '<td colspan="2">'.$langs->trans("ActivateFCKeditor").'</td>';
@ -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 = new DolEditor('formtestfield', isset($conf->global->FCKEDITOR_TEST) ? $conf->global->FCKEDITOR_TEST : 'Test', '', 200, $mode, 'In', true, $uselocalbrowser, 1, 120, 8, $readonly);
$editor->Create(); $editor->Create();
} }
else else {
{
print '<div style="border: 1px solid #888;" contenteditable="true">'; print '<div style="border: 1px solid #888;" contenteditable="true">';
print $conf->global->FCKEDITOR_TEST; print $conf->global->FCKEDITOR_TEST;
print '</div>'; print '</div>';

View File

@ -64,8 +64,7 @@ if ($action == 'updateMask')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=ficheinter&file=SPECIMEN.pdf");
return; return;
} }
else else {
{
setEventMessages($module->error, $module->errors, 'errors'); setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR); dol_syslog($module->error, LOG_ERR);
} }
} }
else else {
{
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
@ -167,8 +164,7 @@ elseif ($action == 'set_FICHINTER_FREE_TEXT')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -184,8 +180,7 @@ elseif ($action == 'set_FICHINTER_DRAFT_WATERMARK')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -201,8 +196,7 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} elseif ($action == 'set_FICHINTER_USE_SERVICE_DURATION') { } elseif ($action == 'set_FICHINTER_USE_SERVICE_DURATION') {
@ -325,8 +319,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} }
else else {
{
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$classname.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$classname.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
} }
print '</td>'; print '</td>';
@ -389,8 +382,7 @@ if ($resql)
$i++; $i++;
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -458,8 +450,7 @@ foreach ($dirmodels as $reldir)
print '</a>'; print '</a>';
print "</td>"; print "</td>";
} }
else else {
{
print "<td align=\"center\">\n"; print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";
@ -471,8 +462,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
} }
else else {
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} }
print '</td>'; print '</td>';
@ -499,8 +489,7 @@ foreach ($dirmodels as $reldir)
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'intervention').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'intervention').'</a>';
} }
else else {
{
print img_object($langs->trans("PreviewNotAvailable"), 'generic'); print img_object($langs->trans("PreviewNotAvailable"), 'generic');
} }
print '</td>'; print '</td>';
@ -545,8 +534,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{ {
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>'; print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
} }
else else {
{
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create(); print $doleditor->Create();

View File

@ -65,8 +65,7 @@ if ($action == 'set')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -183,8 +182,7 @@ if ($geoip)
if ($result) print $result; if ($result) print $result;
else print $langs->trans("Error"); else print $langs->trans("Error");
} }
else else {
{
print '<br>'.$ip.' -> '; print '<br>'.$ip.' -> ';
$result = dol_print_ip($ip, 1); $result = dol_print_ip($ip, 1);
if ($result) print $result; if ($result) print $result;

View File

@ -65,8 +65,7 @@ if ($action == 'updateMask')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=holiday&file=SPECIMEN.pdf");
return; return;
} }
else else {
{
setEventMessages($obj->error, $obj->errors, 'errors'); setEventMessages($obj->error, $obj->errors, 'errors');
dol_syslog($obj->error, LOG_ERR); dol_syslog($obj->error, LOG_ERR);
} }
} }
else else {
{
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
@ -171,8 +168,7 @@ elseif ($action == 'set_other')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -255,8 +251,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} }
else else {
{
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'">'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'">';
print img_picto($langs->trans("Disabled"), 'switch_off'); print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>'; print '</a>';
@ -332,8 +327,7 @@ if ($resql)
$i++; $i++;
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -404,8 +398,7 @@ foreach ($dirmodels as $reldir)
print '</a>'; print '</a>';
print '</td>'; print '</td>';
} }
else else {
{
print '<td class="center">'."\n"; print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";
@ -417,8 +410,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
} }
else else {
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} }
print '</td>'; print '</td>';
@ -450,8 +442,7 @@ foreach ($dirmodels as $reldir)
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'contract').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'contract').'</a>';
} }
else else {
{
print img_object($langs->trans("PreviewNotAvailable"), 'generic'); print img_object($langs->trans("PreviewNotAvailable"), 'generic');
} }
print '</td>'; print '</td>';
@ -502,8 +493,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{ {
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>'; print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
} }
else else {
{
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create(); print $doleditor->Create();

View File

@ -197,14 +197,12 @@ if ($action == 'update')
$tmparray = explode(':', $result); $tmparray = explode(':', $result);
setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus', $tmparray[1]), null, 'errors'); setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus', $tmparray[1]), null, 'errors');
} }
else else {
{
$error++; $error++;
setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
} }
} }
else else {
{
$error++; $error++;
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors');

View File

@ -77,8 +77,7 @@ if (empty($reshook))
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
$db->rollback(); $db->rollback();
dol_print_error($db); dol_print_error($db);
} }
@ -215,8 +214,7 @@ if (!empty($conf->global->LDAP_SERVER_PORT))
{ {
print '<input size="25" type="text" name="port" value="'.$conf->global->LDAP_SERVER_PORT.'">'; print '<input size="25" type="text" name="port" value="'.$conf->global->LDAP_SERVER_PORT.'">';
} }
else else {
{
print '<input size="25" type="text" name="port" value="389">'; print '<input size="25" type="text" name="port" value="389">';
} }
print '</td><td>'.$langs->trans("LDAPServerPortExample").'</td></tr>'; print '</td><td>'.$langs->trans("LDAPServerPortExample").'</td></tr>';
@ -249,8 +247,7 @@ if (!empty($conf->global->LDAP_ADMIN_PASS))
{ {
print '<input size="25" type="password" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">'; // je le met en visible pour test print '<input size="25" type="password" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">'; // je le met en visible pour test
} }
else else {
{
print '<input size="25" type="text" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">'; print '<input size="25" type="text" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">';
} }
print '</td><td>'.$langs->trans('Password').' (ex: secret)</td></tr>'; print '</td><td>'.$langs->trans('Password').' (ex: secret)</td></tr>';
@ -296,8 +293,7 @@ if (function_exists("ldap_connect"))
print '<font class="ok">'.$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)).'</font>'; print '<font class="ok">'.$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)).'</font>';
print '<br>'; print '<br>';
} }
else else {
{
print img_picto('', 'error').' '; print img_picto('', 'error').' ';
print '<font class="error">'.$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)).'</font>'; print '<font class="error">'.$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)).'</font>';
print '<br>'; print '<br>';
@ -305,8 +301,7 @@ if (function_exists("ldap_connect"))
print '<br>'; print '<br>';
} }
} }
else else {
{
print img_picto('', 'warning').' '; print img_picto('', 'warning').' ';
print '<font class="warning">'.$langs->trans("LDAPNoUserOrPasswordProvidedAccessIsReadOnly").'</font>'; print '<font class="warning">'.$langs->trans("LDAPNoUserOrPasswordProvidedAccessIsReadOnly").'</font>';
print '<br>'; print '<br>';
@ -320,8 +315,7 @@ if (function_exists("ldap_connect"))
print '<font class="ok">'.$langs->trans("LDAPSetupForVersion3").'</font>'; print '<font class="ok">'.$langs->trans("LDAPSetupForVersion3").'</font>';
print '<br>'; print '<br>';
} }
else else {
{
print img_picto('', 'info').' '; print img_picto('', 'info').' ';
print '<font class="ok">'.$langs->trans("LDAPSetupForVersion2").'</font>'; print '<font class="ok">'.$langs->trans("LDAPSetupForVersion2").'</font>';
print '<br>'; print '<br>';
@ -329,8 +323,7 @@ if (function_exists("ldap_connect"))
$unbind = $ldap->unbind(); $unbind = $ldap->unbind();
} }
else else {
{
print img_picto('', 'error').' '; print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPTCPConnectKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).'</font>'; print '<font class="error">'.$langs->trans("LDAPTCPConnectKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).'</font>';
print '<br>'; print '<br>';

View File

@ -79,8 +79,7 @@ if ($action == 'setvalue' && $user->admin)
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
$db->rollback(); $db->rollback();
dol_print_error($db); dol_print_error($db);
} }
@ -293,8 +292,7 @@ if (function_exists("ldap_connect"))
print img_picto('', 'info').' '; print img_picto('', 'info').' ';
print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>'; print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>';
} }
else else {
{
print img_picto('', 'error').' '; print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions"); print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
print ': '.$ldap->error; print ': '.$ldap->error;
@ -307,8 +305,7 @@ if (function_exists("ldap_connect"))
print nl2br($ldap->dump_content($dn, $info)); print nl2br($ldap->dump_content($dn, $info));
print "\n<br>"; print "\n<br>";
} }
else else {
{
print img_picto('', 'error').' '; print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKO"); print '<font class="error">'.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error; print ': '.$ldap->error;

View File

@ -71,8 +71,7 @@ if ($action == 'setvalue' && $user->admin)
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
$db->rollback(); $db->rollback();
dol_print_error($db); dol_print_error($db);
} }
@ -234,8 +233,7 @@ if (function_exists("ldap_connect"))
print img_picto('', 'info').' '; print img_picto('', 'info').' ';
print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>'; print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>';
} }
else else {
{
print img_picto('', 'error').' '; print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions"); print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
print ': '.$ldap->error; print ': '.$ldap->error;
@ -248,8 +246,7 @@ if (function_exists("ldap_connect"))
print nl2br($ldap->dump_content($dn, $info)); print nl2br($ldap->dump_content($dn, $info));
print "\n<br>"; print "\n<br>";
} }
else else {
{
print img_picto('', 'error').' '; print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKO"); print '<font class="error">'.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error; print ': '.$ldap->error;

View File

@ -96,8 +96,7 @@ if ($action == 'setvalue' && $user->admin)
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
$db->rollback(); $db->rollback();
dol_print_error($db); dol_print_error($db);
} }
@ -416,8 +415,7 @@ if (function_exists("ldap_connect"))
print img_picto('', 'info').' '; print img_picto('', 'info').' ';
print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>'; print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>';
} }
else else {
{
print img_picto('', 'error').' '; print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions"); print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
print ': '.$ldap->error; print ': '.$ldap->error;
@ -430,8 +428,7 @@ if (function_exists("ldap_connect"))
print nl2br($ldap->dump_content($dn, $info)); print nl2br($ldap->dump_content($dn, $info));
print "\n<br>"; print "\n<br>";
} }
else else {
{
print img_picto('', 'error').' '; print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKO"); print '<font class="error">'.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error; print ': '.$ldap->error;

View File

@ -69,8 +69,7 @@ if ($action == 'setvalue' && $user->admin)
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
$db->rollback(); $db->rollback();
dol_print_error($db); dol_print_error($db);
} }
@ -216,8 +215,7 @@ if (function_exists("ldap_connect"))
print img_picto('', 'info').' '; print img_picto('', 'info').' ';
print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>'; print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>';
} }
else else {
{
print img_picto('', 'error').' '; print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions"); print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
print ': '.$ldap->error; print ': '.$ldap->error;
@ -230,8 +228,7 @@ if (function_exists("ldap_connect"))
print nl2br($ldap->dump_content($dn, $info)); print nl2br($ldap->dump_content($dn, $info));
print "\n<br>"; print "\n<br>";
} }
else else {
{
print img_picto('', 'error').' '; print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKO"); print '<font class="error">'.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error; print ': '.$ldap->error;

View File

@ -90,8 +90,7 @@ if ($action == 'setvalue' && $user->admin)
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
$db->rollback(); $db->rollback();
dol_print_error($db); dol_print_error($db);
} }
@ -396,8 +395,7 @@ if (function_exists("ldap_connect"))
print img_picto('', 'info').' '; print img_picto('', 'info').' ';
print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>'; print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>';
} }
else else {
{
print img_picto('', 'error').' '; print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions"); print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
print ': '.$ldap->error; print ': '.$ldap->error;
@ -410,8 +408,7 @@ if (function_exists("ldap_connect"))
print nl2br($ldap->dump_content($dn, $info)); print nl2br($ldap->dump_content($dn, $info));
print "\n<br>"; print "\n<br>";
} }
else else {
{
print img_picto('', 'error').' '; print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKO"); print '<font class="error">'.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error; print ': '.$ldap->error;
@ -477,8 +474,7 @@ if (function_exists("ldap_connect"))
$liste[$key] = $label; $liste[$key] = $label;
} }
} }
else else {
{
setEventMessages($ldap->error, $ldap->errors, 'errors'); setEventMessages($ldap->error, $ldap->errors, 'errors');
} }
@ -491,8 +487,7 @@ if (function_exists("ldap_connect"))
print "=> ".count($liste)." records<br>\n"; print "=> ".count($liste)." records<br>\n";
print "\n<br>"; print "\n<br>";
} }
else else {
{
print img_picto('', 'error').' '; print img_picto('', 'error').' ';
print '<font class="error">'.$langs->trans("LDAPSynchroKO"); print '<font class="error">'.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error; print ': '.$ldap->error;

View File

@ -163,8 +163,7 @@ if ($action == 'edit')
print '</form>'; print '</form>';
print '<br>'; print '<br>';
} }
else else {
{
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>'; print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
@ -204,8 +203,7 @@ if (empty($mysoc->country_code))
$warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete")); $warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete"));
print '<br><a href="'.DOL_URL_ROOT.'/admin/company.php?mainmenu=home">'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").'</a>'; print '<br><a href="'.DOL_URL_ROOT.'/admin/company.php?mainmenu=home">'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").'</a>';
} }
else else {
{
// Show examples // Show examples
print load_fiche_titre($langs->trans("ExamplesWithCurrentSetup"), '', ''); print load_fiche_titre($langs->trans("ExamplesWithCurrentSetup"), '', '');
@ -270,8 +268,7 @@ else
} }
} }
} }
else else {
{
// More examples if not specific vat rate found // 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) // 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. // were calculated to show all possible cases of rounding. If we change this, examples becomes useless or show the same rounding rule.

View File

@ -64,8 +64,7 @@ if ($action == 'updateMask')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -81,8 +80,7 @@ if ($action == 'set_DELIVERY_FREE_TEXT')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=livraison&file=SPECIMEN.pdf");
return; return;
} }
else else {
{
setEventMessages($module->error, $module->errors, 'errors'); setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR); dol_syslog($module->error, LOG_ERR);
} }
} }
else else {
{
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
@ -250,8 +246,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} }
else else {
{
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
} }
print '</td>'; print '</td>';
@ -317,8 +312,7 @@ if ($resql)
$i++; $i++;
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -384,8 +378,7 @@ foreach ($dirmodels as $reldir)
print '</a>'; print '</a>';
print "</td>"; print "</td>";
} }
else else {
{
print "<td align=\"center\">\n"; print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";
@ -397,8 +390,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
} }
else else {
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} }
print '</td>'; print '</td>';
@ -418,8 +410,7 @@ foreach ($dirmodels as $reldir)
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'sending').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'sending').'</a>';
} }
else else {
{
print img_object($langs->trans("PreviewNotAvailable"), 'generic'); print img_object($langs->trans("PreviewNotAvailable"), 'generic');
} }
print '</td>'; print '</td>';
@ -463,8 +454,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{ {
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>'; print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
} }
else else {
{
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create(); print $doleditor->Create();

View File

@ -64,8 +64,7 @@ if ($action == 'update')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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); print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1);
} }
else else {
{
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">'; print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
} }
print '</td></tr>'; print '</td></tr>';

View File

@ -66,8 +66,7 @@ if ($action == 'setvalue')
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
$db->rollback(); $db->rollback();
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }

View File

@ -66,8 +66,7 @@ if ($action == 'update' || $action == 'add')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -100,8 +99,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && !empty($conf
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans("ErrorBadEMail", $email), null, 'errors'); setEventMessages($langs->trans("ErrorBadEMail", $email), null, 'errors');
} }
else else {
{
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'; include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
$mailmanspip = new MailmanSpip($db); $mailmanspip = new MailmanSpip($db);
@ -119,8 +117,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && !empty($conf
$error++; $error++;
setEventMessages($mailmanspip->error, $mailmanspip->errors, 'errors'); setEventMessages($mailmanspip->error, $mailmanspip->errors, 'errors');
} }
else else {
{
setEventMessages($langs->trans("MailmanCreationSuccess"), null); setEventMessages($langs->trans("MailmanCreationSuccess"), null);
} }
} }
@ -132,8 +129,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && !empty($conf
$error++; $error++;
setEventMessages($mailmanspip->error, $mailmanspip->errors, 'errors'); setEventMessages($mailmanspip->error, $mailmanspip->errors, 'errors');
} }
else else {
{
setEventMessages($langs->trans("MailmanDeletionSuccess"), null); setEventMessages($langs->trans("MailmanDeletionSuccess"), null);
} }
} }
@ -212,8 +208,7 @@ if (!empty($conf->global->ADHERENT_USE_MAILMAN))
print '</form>'; print '</form>';
} }
else else {
{
dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user'); dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user');
$link = '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value=1&name=ADHERENT_USE_MAILMAN">'; $link = '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value=1&name=ADHERENT_USE_MAILMAN">';

View File

@ -170,8 +170,7 @@ if ($action == 'edit')
jQuery("#smtp_server_mess").show(); jQuery("#smtp_server_mess").show();
jQuery("#smtp_port_mess").show();'; jQuery("#smtp_port_mess").show();';
} }
else else {
{
print ' print '
jQuery("#MAIN_MAIL_SMTP_SERVER").prop("disabled", true); jQuery("#MAIN_MAIL_SMTP_SERVER").prop("disabled", true);
jQuery("#MAIN_MAIL_SMTP_PORT").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); print $form->selectarray('MAIN_MAIL_SENDMODE', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE);
} }
else else {
{
$text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE]; $text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE];
if (empty($text)) $text = $langs->trans("Undefined"); if (empty($text)) $text = $langs->trans("Undefined");
$htmltext = $langs->trans("ContactSuperAdminForChange"); $htmltext = $langs->trans("ContactSuperAdminForChange");
@ -305,8 +303,7 @@ if ($action == 'edit')
print '</td><td>'; print '</td><td>';
print '<span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>'; print '<span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
} }
else else {
{
$mainserver = (!empty($conf->global->MAIN_MAIL_SMTP_SERVER) ? $conf->global->MAIN_MAIL_SMTP_SERVER : ''); $mainserver = (!empty($conf->global->MAIN_MAIL_SMTP_SERVER) ? $conf->global->MAIN_MAIL_SMTP_SERVER : '');
$smtpserver = ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined"); $smtpserver = ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined");
if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike");
@ -319,8 +316,7 @@ if ($action == 'edit')
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_sav" name="MAIN_MAIL_SMTP_SERVER_sav" value="'.$mainserver.'">'; print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_sav" name="MAIN_MAIL_SMTP_SERVER_sav" value="'.$mainserver.'">';
print '<span id="smtp_server_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>'; print '<span id="smtp_server_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
} }
else else {
{
$text = !empty($mainserver) ? $mainserver : $smtpserver; $text = !empty($mainserver) ? $mainserver : $smtpserver;
$htmltext = $langs->trans("ContactSuperAdminForChange"); $htmltext = $langs->trans("ContactSuperAdminForChange");
print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
@ -337,8 +333,7 @@ if ($action == 'edit')
print '</td><td>'; print '</td><td>';
print '<span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>'; print '<span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
} }
else else {
{
$mainport = (!empty($conf->global->MAIN_MAIL_SMTP_PORT) ? $conf->global->MAIN_MAIL_SMTP_PORT : ''); $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"); $smtpport = ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined");
if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike");
@ -351,8 +346,7 @@ if ($action == 'edit')
print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_sav" name="MAIN_MAIL_SMTP_PORT_sav" value="'.$mainport.'">'; print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_sav" name="MAIN_MAIL_SMTP_PORT_sav" value="'.$mainport.'">';
print '<span id="smtp_port_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>'; print '<span id="smtp_port_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
} }
else else {
{
$text = (!empty($mainport) ? $mainport : $smtpport); $text = (!empty($mainport) ? $mainport : $smtpport);
$htmltext = $langs->trans("ContactSuperAdminForChange"); $htmltext = $langs->trans("ContactSuperAdminForChange");
print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
@ -371,8 +365,7 @@ if ($action == 'edit')
{ {
print '<input class="flat" name="MAIN_MAIL_SMTPS_ID" size="32" value="'.$mainstmpid.'">'; print '<input class="flat" name="MAIN_MAIL_SMTPS_ID" size="32" value="'.$mainstmpid.'">';
} }
else else {
{
$htmltext = $langs->trans("ContactSuperAdminForChange"); $htmltext = $langs->trans("ContactSuperAdminForChange");
print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID, $htmltext, 1, 'superadmin'); print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID, $htmltext, 1, 'superadmin');
print '<input type="hidden" name="MAIN_MAIL_SMTPS_ID" value="'.$mainstmpid.'">'; print '<input type="hidden" name="MAIN_MAIL_SMTPS_ID" value="'.$mainstmpid.'">';
@ -392,8 +385,7 @@ if ($action == 'edit')
{ {
print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW" size="32" value="'.$mainsmtppw.'" autocomplete="off">'; print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW" size="32" value="'.$mainsmtppw.'" autocomplete="off">';
} }
else else {
{
$htmltext = $langs->trans("ContactSuperAdminForChange"); $htmltext = $langs->trans("ContactSuperAdminForChange");
print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW, $htmltext, 1, 'superadmin'); print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW, $htmltext, 1, 'superadmin');
print '<input type="hidden" name="MAIN_MAIL_SMTPS_PW" value="'.$mainsmtppw.'">'; print '<input type="hidden" name="MAIN_MAIL_SMTPS_PW" value="'.$mainsmtppw.'">';
@ -497,8 +489,7 @@ if ($action == 'edit')
print '</form>'; print '</form>';
} }
else else {
{
dol_fiche_head($head, 'common', '', -1); dol_fiche_head($head, 'common', '', -1);
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n"; print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
@ -539,8 +530,7 @@ else
{ {
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").'</td><td><span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span></td></tr>'; print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").'</td><td><span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span></td></tr>';
} }
else else {
{
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined")).'</td><td>'.(!empty($conf->global->MAIN_MAIL_SMTP_SERVER) ? $conf->global->MAIN_MAIL_SMTP_SERVER : '').'</td></tr>'; print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined")).'</td><td>'.(!empty($conf->global->MAIN_MAIL_SMTP_SERVER) ? $conf->global->MAIN_MAIL_SMTP_SERVER : '').'</td></tr>';
} }
@ -549,8 +539,7 @@ else
{ {
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").'</td><td><span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span></td></tr>'; print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").'</td><td><span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span></td></tr>';
} }
else else {
{
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined")).'</td><td>'.(!empty($conf->global->MAIN_MAIL_SMTP_PORT) ? $conf->global->MAIN_MAIL_SMTP_PORT : '').'</td></tr>'; print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined")).'</td><td>'.(!empty($conf->global->MAIN_MAIL_SMTP_PORT) ? $conf->global->MAIN_MAIL_SMTP_PORT : '').'</td></tr>';
} }
@ -699,8 +688,7 @@ else
print $conf->global->MAIN_MAIL_AUTOCOPY_TO; print $conf->global->MAIN_MAIL_AUTOCOPY_TO;
if (!isValidEmail($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print img_warning($langs->trans("ErrorBadEMail")); if (!isValidEmail($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print img_warning($langs->trans("ErrorBadEMail"));
} }
else else {
{
print '&nbsp;'; print '&nbsp;';
} }
print '</td></tr>'; print '</td></tr>';
@ -722,8 +710,7 @@ else
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect#formmailbeforetitle">'.$langs->trans("DoTestServerAvailability").'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect#formmailbeforetitle">'.$langs->trans("DoTestServerAvailability").'</a>';
} }
} }
else else {
{
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("FeatureNotAvailableOnLinux").'">'.$langs->trans("DoTestServerAvailability").'</a>'; print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("FeatureNotAvailableOnLinux").'">'.$langs->trans("DoTestServerAvailability").'</a>';
} }
@ -795,8 +782,7 @@ else
$mail = new CMailFile('', '', '', '', array(), array(), array(), '', '', 0, '', '', '', '', $trackid, $sendcontext); $mail = new CMailFile('', '', '', '', array(), array(), array(), '', '', 0, '', '', '', '', $trackid, $sendcontext);
$result = $mail->check_server_port($server, $port); $result = $mail->check_server_port($server, $port);
if ($result) print '<div class="ok">'.$langs->trans("ServerAvailableOnIPOrPort", $server, $port).'</div>'; if ($result) print '<div class="ok">'.$langs->trans("ServerAvailableOnIPOrPort", $server, $port).'</div>';
else else {
{
$errormsg = $langs->trans("ServerNotAvailableOnIPOrPort", $server, $port); $errormsg = $langs->trans("ServerNotAvailableOnIPOrPort", $server, $port);
if ($mail->error) { if ($mail->error) {

View File

@ -157,8 +157,7 @@ if ($action == 'edit')
jQuery("#smtp_port_mess").show(); jQuery("#smtp_port_mess").show();
'; ';
} }
else else {
{
print ' print '
jQuery("#MAIN_MAIL_SMTP_SERVER_EMAILING").prop("disabled", true); jQuery("#MAIN_MAIL_SMTP_SERVER_EMAILING").prop("disabled", true);
jQuery("#MAIN_MAIL_SMTP_PORT_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); print $form->selectarray('MAIN_MAIL_SENDMODE_EMAILING', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE_EMAILING);
} }
else else {
{
$text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE_EMAILING]; $text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE_EMAILING];
if (empty($text)) $text = $langs->trans("Undefined"); if (empty($text)) $text = $langs->trans("Undefined");
$htmltext = $langs->trans("ContactSuperAdminForChange"); $htmltext = $langs->trans("ContactSuperAdminForChange");
@ -256,8 +254,7 @@ if ($action == 'edit')
print '</td><td>'; print '</td><td>';
print $langs->trans("SeeLocalSendMailSetup"); print $langs->trans("SeeLocalSendMailSetup");
} }
else else {
{
$mainserver = (!empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING : ''); $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"); $smtpserver = ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined");
if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike");
@ -270,8 +267,7 @@ if ($action == 'edit')
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" name="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" value="'.$mainserver.'">'; print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" name="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" value="'.$mainserver.'">';
print '<span id="smtp_server_mess">'.$langs->trans("SeeLocalSendMailSetup").'</span>'; print '<span id="smtp_server_mess">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
} }
else else {
{
$text = !empty($mainserver) ? $mainserver : $smtpserver; $text = !empty($mainserver) ? $mainserver : $smtpserver;
$htmltext = $langs->trans("ContactSuperAdminForChange"); $htmltext = $langs->trans("ContactSuperAdminForChange");
print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
@ -289,8 +285,7 @@ if ($action == 'edit')
print '</td><td>'; print '</td><td>';
print $langs->trans("SeeLocalSendMailSetup"); print $langs->trans("SeeLocalSendMailSetup");
} }
else else {
{
$mainport = (!empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : ''); $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"); $smtpport = ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined");
if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike");
@ -303,8 +298,7 @@ if ($action == 'edit')
print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING_sav" name="MAIN_MAIL_SMTP_PORT_EMAILING_sav" value="'.$mainport.'">'; print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING_sav" name="MAIN_MAIL_SMTP_PORT_EMAILING_sav" value="'.$mainport.'">';
print '<span id="smtp_port_mess">'.$langs->trans("SeeLocalSendMailSetup").'</span>'; print '<span id="smtp_port_mess">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
} }
else else {
{
$text = (!empty($mainport) ? $mainport : $smtpport); $text = (!empty($mainport) ? $mainport : $smtpport);
$htmltext = $langs->trans("ContactSuperAdminForChange"); $htmltext = $langs->trans("ContactSuperAdminForChange");
print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
@ -323,8 +317,7 @@ if ($action == 'edit')
{ {
print '<input class="flat" name="MAIN_MAIL_SMTPS_ID_EMAILING" size="32" value="'.$mainstmpid.'">'; print '<input class="flat" name="MAIN_MAIL_SMTPS_ID_EMAILING" size="32" value="'.$mainstmpid.'">';
} }
else else {
{
$htmltext = $langs->trans("ContactSuperAdminForChange"); $htmltext = $langs->trans("ContactSuperAdminForChange");
print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING, $htmltext, 1, 'superadmin'); print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING, $htmltext, 1, 'superadmin');
print '<input type="hidden" name="MAIN_MAIL_SMTPS_ID_EMAILING" value="'.$mainstmpid.'">'; print '<input type="hidden" name="MAIN_MAIL_SMTPS_ID_EMAILING" value="'.$mainstmpid.'">';
@ -342,8 +335,7 @@ if ($action == 'edit')
{ {
print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW_EMAILING" size="32" value="'.$mainsmtppw.'">'; print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW_EMAILING" size="32" value="'.$mainsmtppw.'">';
} }
else else {
{
$htmltext = $langs->trans("ContactSuperAdminForChange"); $htmltext = $langs->trans("ContactSuperAdminForChange");
print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING, $htmltext, 1, 'superadmin'); print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING, $htmltext, 1, 'superadmin');
print '<input type="hidden" name="MAIN_MAIL_SMTPS_PW_EMAILING" value="'.$mainsmtppw.'">'; print '<input type="hidden" name="MAIN_MAIL_SMTPS_PW_EMAILING" value="'.$mainsmtppw.'">';
@ -391,8 +383,7 @@ if ($action == 'edit')
print '</form>'; print '</form>';
} }
else else {
{
dol_fiche_head($head, 'common_emailing', '', -1); dol_fiche_head($head, 'common_emailing', '', -1);
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n"; print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
@ -415,8 +406,7 @@ else
{ {
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").'</td><td>'.$langs->trans("SeeLocalSendMailSetup").'</td></tr>'; print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").'</td><td>'.$langs->trans("SeeLocalSendMailSetup").'</td></tr>';
} }
else else {
{
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined")).'</td><td>'.(!empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING : '').'</td></tr>'; print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined")).'</td><td>'.(!empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING : '').'</td></tr>';
} }
@ -425,8 +415,7 @@ else
{ {
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").'</td><td>'.$langs->trans("SeeLocalSendMailSetup").'</td></tr>'; print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").'</td><td>'.$langs->trans("SeeLocalSendMailSetup").'</td></tr>';
} }
else else {
{
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined")).'</td><td>'.(!empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : '').'</td></tr>'; print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined")).'</td><td>'.(!empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : '').'</td></tr>';
} }
@ -507,8 +496,7 @@ else
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect">'.$langs->trans("DoTestServerAvailability").'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect">'.$langs->trans("DoTestServerAvailability").'</a>';
} }
} }
else else {
{
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("FeatureNotAvailableOnLinux").'">'.$langs->trans("DoTestServerAvailability").'</a>'; print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("FeatureNotAvailableOnLinux").'">'.$langs->trans("DoTestServerAvailability").'</a>';
} }
@ -539,8 +527,7 @@ else
$result = $mail->check_server_port($server, $port); $result = $mail->check_server_port($server, $port);
if ($result) print '<div class="ok">'.$langs->trans("ServerAvailableOnIPOrPort", $server, $port).'</div>'; if ($result) print '<div class="ok">'.$langs->trans("ServerAvailableOnIPOrPort", $server, $port).'</div>';
else else {
{
$errormsg = $langs->trans("ServerNotAvailableOnIPOrPort", $server, $port); $errormsg = $langs->trans("ServerNotAvailableOnIPOrPort", $server, $port);
if ($mail->error) { if ($mail->error) {

View File

@ -282,8 +282,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit
{ {
$num = $nbtotalofrecords; $num = $nbtotalofrecords;
} }
else else {
{
if ($limit) $sql .= $db->plimit($limit + 1, $offset); if ($limit) $sql .= $db->plimit($limit + 1, $offset);
$resql = $db->query($sql); $resql = $db->query($sql);

View File

@ -123,8 +123,7 @@ if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES))
$helpsubstitforlines .= $key.' -> '.$val.'<br>'; $helpsubstitforlines .= $key.' -> '.$val.'<br>';
} }
} }
else else {
{
$tmp = FormMail::getAvailableSubstitKey('formemailwithlines'); $tmp = FormMail::getAvailableSubstitKey('formemailwithlines');
$tmp['__(AnyTranslationKey)__'] = 'Translation'; $tmp['__(AnyTranslationKey)__'] = 'Translation';
$helpsubstit = $langs->trans("AvailableVariables").':<br>'; $helpsubstit = $langs->trans("AvailableVariables").':<br>';
@ -297,8 +296,7 @@ if (empty($reshook))
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs'); setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
$_POST = array('id'=>$id); // Clean $_POST array, we keep only id $_POST = array('id'=>$id); // Clean $_POST array, we keep only id
} }
else else {
{
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors'); setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors');
} }
@ -356,8 +354,7 @@ if (empty($reshook))
{ {
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs'); setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($db->error(), null, 'errors'); setEventMessages($db->error(), null, 'errors');
} }
} }
@ -377,8 +374,7 @@ if (empty($reshook))
{ {
setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors'); setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors');
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -577,8 +573,7 @@ foreach ($fieldsforcontent as $tmpfieldlist)
elseif ($tmpfieldlist == 'joinfiles') { elseif ($tmpfieldlist == 'joinfiles') {
print '<input type="text" class="flat maxwidth50" name="'.$tmpfieldlist.'" value="'.(isset($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '1').'">'; print '<input type="text" class="flat maxwidth50" name="'.$tmpfieldlist.'" value="'.(isset($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '1').'">';
} }
else else {
{
if ($context != 'hide') { if ($context != 'hide') {
// print '<textarea cols="3" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'</textarea>'; // print '<textarea cols="3" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'</textarea>';
$okforextended = true; $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%'); $doleditor = new DolEditor($tmpfieldlist, (!empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 120, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_4, '90%');
print $doleditor->Create(1); print $doleditor->Create(1);
} }
else else print '&nbsp;';
print '&nbsp;';
} }
print '</td>'; print '</td>';
if ($tmpfieldlist == 'topic') { if ($tmpfieldlist == 'topic') {
@ -802,8 +796,7 @@ if ($resql)
print "</tr>\n"; print "</tr>\n";
} }
else else {
{
$keyforobj = 'type_template'; $keyforobj = 'type_template';
if (!in_array($obj->$keyforobj, array_keys($elementList))) 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'); 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 if ($context == 'add') // I am not admin and we show the add form
{ {
print $user->getNomUrl(1); // Me print $user->getNomUrl(1); // Me
$forcedvalue = $user->id; $forcedvalue = $user->id;
} }
else else {
{
if ($obj && !empty($obj->{$fieldlist[$field]}) && $obj->{$fieldlist[$field]} > 0) if ($obj && !empty($obj->{$fieldlist[$field]}) && $obj->{$fieldlist[$field]} > 0)
{ {
$fuser = new User($db); $fuser = new User($db);
@ -1005,8 +996,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
print $fuser->getNomUrl(1); print $fuser->getNomUrl(1);
$forcedvalue = $fuser->id; $forcedvalue = $fuser->id;
} }
else else {
{
$forcedvalue = $obj->{$fieldlist[$field]}; $forcedvalue = $obj->{$fieldlist[$field]};
} }
} }
@ -1024,8 +1014,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
if ($context == 'edit') $selectedlang = $obj->{$fieldlist[$field]}; if ($context == 'edit') $selectedlang = $obj->{$fieldlist[$field]};
print $formadmin->select_language($selectedlang, 'langcode', 0, null, 1, 0, 0, 'maxwidth150'); print $formadmin->select_language($selectedlang, 'langcode', 0, null, 1, 0, 0, 'maxwidth150');
} }
else else {
{
if (!empty($obj->{$fieldlist[$field]})) if (!empty($obj->{$fieldlist[$field]}))
{ {
print $obj->{$fieldlist[$field]}.' - '.$langs->trans('Language_'.$obj->{$fieldlist[$field]}); print $obj->{$fieldlist[$field]}.' - '.$langs->trans('Language_'.$obj->{$fieldlist[$field]});
@ -1046,8 +1035,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
print '<input type="hidden" name="type_template" value="'.$obj->{$fieldlist[$field]}.'">'; print '<input type="hidden" name="type_template" value="'.$obj->{$fieldlist[$field]}.'">';
print $obj->{$fieldlist[$field]}; 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 $form->selectarray('type_template', $elementList, (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''), 1, 0, 0, '', 0, 0, 0, '', 'maxwidth150 maxwidth100onsmartphone');
} }
print '</td>'; print '</td>';
@ -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 == '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 == '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; elseif ($context == 'hide' && in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue;
else else {
{
$size = ''; $class = ''; $classtd = ''; $size = ''; $class = ''; $classtd = '';
if ($fieldlist[$field] == 'code') $class = 'maxwidth100'; if ($fieldlist[$field] == 'code') $class = 'maxwidth100';
if ($fieldlist[$field] == 'label') $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); print $form->selectyesno($fieldlist[$field], '1', 1);
} }
else else {
{
//print '<input type="text" '.$size.'class="flat'.($class?' '.$class:'').'" value="1" name="'.$fieldlist[$field].'">'; //print '<input type="text" '.$size.'class="flat'.($class?' '.$class:'').'" value="1" name="'.$fieldlist[$field].'">';
print $form->selectyesno($fieldlist[$field], (isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''), 1); print $form->selectyesno($fieldlist[$field], (isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''), 1);
} }
} }
else else {
{
print '<input type="text" '.$size.'class="flat'.($class ? ' '.$class : '').'" value="'.(isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'">'; print '<input type="text" '.$size.'class="flat'.($class ? ' '.$class : '').'" value="'.(isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'">';
} }
print '</td>'; print '</td>';

View File

@ -97,8 +97,7 @@ if ($action == 'update' && !$cancel)
{ {
$db->commit(); $db->commit();
} }
else else {
{
$error++; $error++;
setEventMessages($langs->trans("FailedToInitializeMenu").' '.$key, null, 'errors'); setEventMessages($langs->trans("FailedToInitializeMenu").' '.$key, null, 'errors');
$db->rollback(); $db->rollback();

View File

@ -103,9 +103,7 @@ if ($action == 'update')
if (is_numeric(GETPOST('menuIdParent', 'alpha'))) if (is_numeric(GETPOST('menuIdParent', 'alpha')))
{ {
$menu->fk_menu = GETPOST('menuIdParent', 'alpha'); $menu->fk_menu = GETPOST('menuIdParent', 'alpha');
} } else {
else
{
if (GETPOST('type', 'alpha') == 'top') $menu->fk_menu = 0; if (GETPOST('type', 'alpha') == 'top') $menu->fk_menu = 0;
else $menu->fk_menu = -1; else $menu->fk_menu = -1;
$menu->fk_mainmenu = $mainmenu; $menu->fk_mainmenu = $mainmenu;
@ -116,14 +114,10 @@ if ($action == 'update')
if ($result > 0) if ($result > 0)
{ {
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
} } else {
else
{
setEventMessages($menu->error, $menu->errors, 'errors'); setEventMessages($menu->error, $menu->errors, 'errors');
} }
} } else {
else
{
setEventMessages($menu->error, $menu->errors, 'errors'); setEventMessages($menu->error, $menu->errors, 'errors');
} }
$action = "edit"; $action = "edit";
@ -131,8 +125,7 @@ if ($action == 'update')
header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".$menu_handler); header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".$menu_handler);
exit; exit;
} }
else else {
{
header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".$menu_handler); header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".$menu_handler);
exit; exit;
} }
@ -222,8 +215,7 @@ if ($action == 'add')
{ {
$menu->fk_menu = GETPOST('menuId', 'alpha', 3); $menu->fk_menu = GETPOST('menuId', 'alpha', 3);
} }
else else {
{
if (GETPOST('type', 'alpha') == 'top') $menu->fk_menu = 0; if (GETPOST('type', 'alpha') == 'top') $menu->fk_menu = 0;
else $menu->fk_menu = -1; else $menu->fk_menu = -1;
$menu->fk_mainmenu = $mainmenu; $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')); header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".GETPOST('menu_handler', 'aZ09'));
exit; exit;
} }
else else {
{
$action = 'create'; $action = 'create';
setEventMessages($menu->error, $menu->errors, 'errors'); setEventMessages($menu->error, $menu->errors, 'errors');
} }
@ -261,8 +252,7 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == 'yes')
llxFooter(); llxFooter();
exit; exit;
} }
else else {
{
$this->db->rollback(); $this->db->rollback();
$reload = 0; $reload = 0;
@ -359,8 +349,7 @@ if ($action == 'create')
print $langs->trans('Left'); print $langs->trans('Left');
print '<input type="hidden" name="type" value="left">'; print '<input type="hidden" name="type" value="left">';
} }
else else {
{
print '<select name="type" class="flat" id="topleft">'; print '<select name="type" class="flat" id="topleft">';
print '<option value="">&nbsp;</option>'; print '<option value="">&nbsp;</option>';
print '<option value="top"'.($_POST["type"] && $_POST["type"] == 'top' ? ' selected' : '').'>'.$langs->trans('Top').'</option>'; print '<option value="top"'.($_POST["type"] && $_POST["type"] == 'top' ? ' selected' : '').'>'.$langs->trans('Top').'</option>';
@ -382,8 +371,7 @@ if ($action == 'create')
{ {
print '<td>'.$parent_rowid.'<input type="hidden" name="menuId" value="'.$parent_rowid.'"></td>'; print '<td>'.$parent_rowid.'<input type="hidden" name="menuId" value="'.$parent_rowid.'"></td>';
} }
else else {
{
print '<td><input type="text" class="minwidth300" id="menuId" name="menuId" value="'.(GETPOST("menuId", 'int') ?GETPOST("menuId", 'int') : '').'"></td>'; print '<td><input type="text" class="minwidth300" id="menuId" name="menuId" value="'.(GETPOST("menuId", 'int') ?GETPOST("menuId", 'int') : '').'"></td>';
} }
print '<td>'.$langs->trans('DetailMenuIdParent'); print '<td>'.$langs->trans('DetailMenuIdParent');

View File

@ -192,8 +192,7 @@ elseif ($action == 'confirm_delete' && $confirm == 'yes')
header("Location: ".DOL_URL_ROOT.'/admin/menus/index.php?menu_handler='.$menu_handler); header("Location: ".DOL_URL_ROOT.'/admin/menus/index.php?menu_handler='.$menu_handler);
exit; exit;
} }
else else {
{
$db->rollback(); $db->rollback();
$reload = 0; $reload = 0;
@ -409,8 +408,7 @@ if ($conf->use_javascript_ajax)
print '</div>'; print '</div>';
} }
else else {
{
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans("ErrorFeatureNeedJavascript"), null, 'errors'); setEventMessages($langs->trans("ErrorFeatureNeedJavascript"), null, 'errors');
} }

View File

@ -95,8 +95,7 @@ if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED))
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=activate_hidemenu">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=activate_hidemenu">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
} }
else else {
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_hidemenu">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_hidemenu">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>';
} }
print "</td>"; print "</td>";

View File

@ -105,8 +105,7 @@ foreach ($modulesdir as $dir)
continue; continue;
} }
try try {
{
$res = include_once $dir.$file; $res = include_once $dir.$file;
if (class_exists($modName)) if (class_exists($modName))
{ {
@ -141,8 +140,7 @@ foreach ($modulesdir as $dir)
{ {
$arrayofnatures['external_'.$publisher] = $langs->trans("External").' - '.$publisher; $arrayofnatures['external_'.$publisher] = $langs->trans("External").' - '.$publisher;
} }
else else {
{
$arrayofnatures['external_'] = $langs->trans("External").' - '.$langs->trans("UnknownPublishers"); $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); 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)<br>"; print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)<br>";
} }
} }
@ -202,8 +199,7 @@ foreach ($modulesdir as $dir)
} }
closedir($handle); closedir($handle);
} }
else else {
{
dol_syslog("htdocs/admin/modulehelp.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING); 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 .= $textexternal;
$text .= '<br>'; $text .= '<br>';
} }
else else {
{
$text .= '<br><span class="opacitymedium">'.$langs->trans("Origin").':</span> '.$langs->trans("Core").'<br>'; $text .= '<br><span class="opacitymedium">'.$langs->trans("Origin").':</span> '.$langs->trans("Core").'<br>';
} }
@ -450,8 +445,7 @@ if ($mode == 'feature')
{ {
$yesno = 'Yes'; $yesno = 'Yes';
} }
else else {
{
$yesno = 'No'; $yesno = 'No';
} }
require_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';

View File

@ -126,8 +126,7 @@ if ($action == 'install')
setEventMessages($langs->trans("ErrorModuleFileRequired"), null, 'warnings'); setEventMessages($langs->trans("ErrorModuleFileRequired"), null, 'warnings');
$error++; $error++;
} }
else else {
{
if (!$error && !preg_match('/\.zip$/i', $original_file)) if (!$error && !preg_match('/\.zip$/i', $original_file))
{ {
$langs->load("errors"); $langs->load("errors");
@ -174,8 +173,7 @@ if ($action == 'install')
setEventMessages($langs->trans($result['error'], $original_file), null, 'errors'); setEventMessages($langs->trans($result['error'], $original_file), null, 'errors');
$error++; $error++;
} }
else else {
{
// Now we move the dir of the module // Now we move the dir of the module
$modulename = preg_replace('/module_/', '', $original_file); $modulename = preg_replace('/module_/', '', $original_file);
$modulename = preg_replace('/\-([0-9][0-9\.]*)\.zip$/i', '', $modulename); $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'); setEventMessages($langs->trans("ErrorFailToRenameFile", $_FILES['fileinstall']['tmp_name'], $newfile), null, 'errors');
$error++; $error++;
} }
@ -248,8 +245,7 @@ if ($action == 'set' && $user->admin)
{ {
$resarray = activateModule($value); $resarray = activateModule($value);
if (!empty($resarray['errors'])) setEventMessages('', $resarray['errors'], 'errors'); if (!empty($resarray['errors'])) setEventMessages('', $resarray['errors'], 'errors');
else else {
{
//var_dump($resarray);exit; //var_dump($resarray);exit;
if ($resarray['nbperms'] > 0) if ($resarray['nbperms'] > 0)
{ {
@ -341,8 +337,7 @@ foreach ($modulesdir as $dir)
continue; continue;
} }
try try {
{
$res = include_once $dir.$file; // A class already exists in a different file will send a non catchable fatal error. $res = include_once $dir.$file; // A class already exists in a different file will send a non catchable fatal error.
if (class_exists($modName)) if (class_exists($modName))
{ {
@ -376,8 +371,7 @@ foreach ($modulesdir as $dir)
{ {
$arrayofnatures['external_'.$publisher] = $langs->trans("External").' - '.$publisher; $arrayofnatures['external_'.$publisher] = $langs->trans("External").' - '.$publisher;
} }
else else {
{
$arrayofnatures['external_'] = $langs->trans("External").' - '.$langs->trans("UnknownPublishers"); $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); 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)<br>"; print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)<br>";
} }
} }
@ -452,8 +445,7 @@ foreach ($modulesdir as $dir)
} }
closedir($handle); closedir($handle);
} }
else else {
{
dol_syslog("htdocs/admin/modules.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING); 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++; if (!empty($conf->multicompany->enabled) && $user->entity) $disableSetup++;
} }
else else {
{
if (!empty($objMod->warnings_unactivation[$mysoc->country_code]) && method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) { if (!empty($objMod->warnings_unactivation[$mysoc->country_code]) && method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) {
$codeenabledisable .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&amp;module_position='.$module_position.'&amp;action=reset_confirm&amp;confirm_message_code='.$objMod->warnings_unactivation[$mysoc->country_code].'&amp;value='.$modName.'&amp;mode='.$mode.$param.'">'; $codeenabledisable .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&amp;module_position='.$module_position.'&amp;action=reset_confirm&amp;confirm_message_code='.$objMod->warnings_unactivation[$mysoc->country_code].'&amp;value='.$modName.'&amp;mode='.$mode.$param.'">';
$codeenabledisable .= img_picto($langs->trans("Activated"), 'switch_on'); $codeenabledisable .= img_picto($langs->trans("Activated"), 'switch_on');
@ -752,15 +743,13 @@ if ($mode == 'common' || $mode == 'commonkanban')
$codetoconfig .= '<a href="'.$urlpage.'" title="'.$langs->trans($page).'">'.img_picto(ucfirst($page), "setup").'</a>'; $codetoconfig .= '<a href="'.$urlpage.'" title="'.$langs->trans($page).'">'.img_picto(ucfirst($page), "setup").'</a>';
// print '<a href="'.$page.'">'.ucfirst($page).'</a>&nbsp;'; // print '<a href="'.$page.'">'.ucfirst($page).'</a>&nbsp;';
} }
else else {
{
if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs)) if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs))
{ {
$urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1); $urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1);
$codetoconfig .= '<a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').'</a>'; $codetoconfig .= '<a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').'</a>';
} }
else else {
{
$urltouse = $urlpage; $urltouse = $urlpage;
$codetoconfig .= '<a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').'</a>'; $codetoconfig .= '<a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').'</a>';
} }
@ -771,13 +760,11 @@ if ($mode == 'common' || $mode == 'commonkanban')
{ {
$codetoconfig .= '<a class="valignmiddle" href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1).'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').'</a>'; $codetoconfig .= '<a class="valignmiddle" href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1).'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').'</a>';
} }
else else {
{
$codetoconfig .= '<a class="valignmiddle" href="'.$objMod->config_page_url.'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').'</a>'; $codetoconfig .= '<a class="valignmiddle" href="'.$objMod->config_page_url.'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').'</a>';
} }
} }
else else {
{
$codetoconfig .= img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"', false, 0, 0, '', 'fa-15'); $codetoconfig .= img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"', false, 0, 0, '', 'fa-15');
} }
} }
@ -792,8 +779,7 @@ if ($mode == 'common' || $mode == 'commonkanban')
{ {
$codeenabledisable .= $langs->trans("Disabled"); $codeenabledisable .= $langs->trans("Disabled");
} }
else else {
{
// Module qualified for activation // Module qualified for activation
$warningmessage = ''; $warningmessage = '';
if (!empty($arrayofwarnings[$modName])) 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); 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 print img_object($alttext, $objMod->picto, 'class="valignmiddle pictomodule paddingrightonly"');
} }
else else {
{
print img_object($alttext, 'generic', 'class="valignmiddle paddingrightonly"'); print img_object($alttext, 'generic', 'class="valignmiddle paddingrightonly"');
} }
print ' <span class="valignmiddle">'.$objMod->getName().'</span>'; print ' <span class="valignmiddle">'.$objMod->getName().'</span>';
@ -1028,8 +1013,7 @@ if ($mode == 'deploy')
$message = info_admin($langs->trans("ConfFileMustContainCustom", DOL_DOCUMENT_ROOT.'/custom', DOL_DOCUMENT_ROOT)); $message = info_admin($langs->trans("ConfFileMustContainCustom", DOL_DOCUMENT_ROOT.'/custom', DOL_DOCUMENT_ROOT));
$allowfromweb = -1; $allowfromweb = -1;
} }
else else {
{
if ($dirins_ok) if ($dirins_ok)
{ {
if (!is_writable(dol_osencode($dirins))) if (!is_writable(dol_osencode($dirins)))
@ -1039,15 +1023,13 @@ if ($mode == 'deploy')
$allowfromweb = 0; $allowfromweb = 0;
} }
} }
else else {
{
$message = info_admin($langs->trans("NotExistsDirect", $dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample")); $message = info_admin($langs->trans("NotExistsDirect", $dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample"));
$allowfromweb = 0; $allowfromweb = 0;
} }
} }
} }
else else {
{
$message = info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile", $dolibarrdataroot.'/installmodules.lock')); $message = info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile", $dolibarrdataroot.'/installmodules.lock'));
$allowfromweb = 0; $allowfromweb = 0;
} }
@ -1068,8 +1050,7 @@ if ($mode == 'deploy')
{ {
//print $langs->trans("ThisIsProcessToFollow").'<br>'; //print $langs->trans("ThisIsProcessToFollow").'<br>';
} }
else else {
{
print $langs->trans("ThisIsAlternativeProcessToFollow").'<br>'; print $langs->trans("ThisIsAlternativeProcessToFollow").'<br>';
print '<b>'.$langs->trans("StepNb", 1).'</b>: '; print '<b>'.$langs->trans("StepNb", 1).'</b>: ';
print $langs->trans("FindPackageFromWebSite", $fullurl).'<br>'; print $langs->trans("FindPackageFromWebSite", $fullurl).'<br>';
@ -1150,8 +1131,7 @@ if ($mode == 'deploy')
print info_admin($langs->trans("ThisLimitIsDefinedInSetup", $max, $maxphptoshow, $maxphptoshowparam), 1); print info_admin($langs->trans("ThisLimitIsDefinedInSetup", $max, $maxphptoshow, $maxphptoshowparam), 1);
} }
} }
else else {
{
print ' ('.$langs->trans("UploadDisabled").')'; print ' ('.$langs->trans("UploadDisabled").')';
} }
@ -1162,8 +1142,7 @@ if ($mode == 'deploy')
print '<div class="center"><div class="logo_setup"></div></div>'; print '<div class="center"><div class="logo_setup"></div></div>';
} }
else else {
{
print $langs->trans("UnpackPackageInModulesRoot", $dirins).'<br>'; print $langs->trans("UnpackPackageInModulesRoot", $dirins).'<br>';
print '<b>'.$langs->trans("StepNb", 4).'</b>: '; print '<b>'.$langs->trans("StepNb", 4).'</b>: ';
print $langs->trans("SetupIsReadyForUse").'<br>'; print $langs->trans("SetupIsReadyForUse").'<br>';

View File

@ -59,8 +59,7 @@ if ($action == 'updateMask')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=mrp&file=SPECIMEN.pdf");
return; return;
} }
else else {
{
setEventMessages($module->error, null, 'errors'); setEventMessages($module->error, null, 'errors');
dol_syslog($module->error, LOG_ERR); dol_syslog($module->error, LOG_ERR);
} }
} }
else else {
{
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
@ -162,8 +159,7 @@ elseif ($action == 'set_MRP_MO_DRAFT_WATERMARK')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -180,8 +176,7 @@ elseif ($action == 'set_MRP_MO_FREE_TEXT')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -263,8 +258,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} }
else else {
{
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'">'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'">';
print img_picto($langs->trans("Disabled"), 'switch_off'); print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>'; print '</a>';
@ -329,8 +323,7 @@ if ($resql)
$i++; $i++;
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -400,8 +393,7 @@ foreach ($dirmodels as $reldir)
print '</a>'; print '</a>';
print '</td>'; print '</td>';
} }
else else {
{
print '<td class="center">'."\n"; print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";
@ -413,8 +405,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
} }
else else {
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} }
print '</td>'; print '</td>';
@ -443,8 +434,7 @@ foreach ($dirmodels as $reldir)
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
} }
else else {
{
print img_object($langs->trans("PreviewNotAvailable"), 'generic'); print img_object($langs->trans("PreviewNotAvailable"), 'generic');
} }
print '</td>'; print '</td>';
@ -490,8 +480,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{ {
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>'; print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
} }
else else {
{
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create(); print $doleditor->Create();

View File

@ -54,8 +54,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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_APP_SOURCE', GETPOST('MULTICURRENCY_APP_SOURCE', 'alpha'));
//dolibarr_set_const($db, 'MULTICURRENCY_ALTERNATE_SOURCE', GETPOST('MULTICURRENCY_ALTERNATE_SOURCE', 'alpha')); //dolibarr_set_const($db, 'MULTICURRENCY_ALTERNATE_SOURCE', GETPOST('MULTICURRENCY_ALTERNATE_SOURCE', 'alpha'));
} }
else else {
{
$result = MultiCurrency::syncRates($conf->global->MULTICURRENCY_APP_ID); $result = MultiCurrency::syncRates($conf->global->MULTICURRENCY_APP_ID);
if ($result > 0) { if ($result > 0) {
setEventMessages($langs->trans("CurrencyRateSyncSucceed"), null, "mesgs"); setEventMessages($langs->trans("CurrencyRateSyncSucceed"), null, "mesgs");

View File

@ -85,8 +85,7 @@ if ($action == 'settemplates')
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
$db->rollback(); $db->rollback();
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
@ -107,8 +106,7 @@ if ($action == 'setvalue' && $user->admin)
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
$db->rollback(); $db->rollback();
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
@ -161,8 +159,7 @@ if ($action == 'setfixednotif' && $user->admin)
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
$db->rollback(); $db->rollback();
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');

View File

@ -120,8 +120,7 @@ foreach ($list as $key)
print '<td><input style="width: 80%" type"text" name="uri'.$key[0].'" value="'.$redirect_uri.'">'; print '<td><input style="width: 80%" type"text" name="uri'.$key[0].'" value="'.$redirect_uri.'">';
print '</td></tr>'; print '</td></tr>';
} }
else else {
{
print '<tr class="oddeven value">'; print '<tr class="oddeven value">';
print '<td>'.$langs->trans("UseTheFollowingUrlAsRedirectURI").'</td>'; print '<td>'.$langs->trans("UseTheFollowingUrlAsRedirectURI").'</td>';
print '<td>'.$langs->trans("FeatureNotYetSupported").'</td>'; print '<td>'.$langs->trans("FeatureNotYetSupported").'</td>';

View File

@ -79,8 +79,7 @@ if ($action == 'setconst' && $user->admin)
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null); setEventMessages($langs->trans("SetupSaved"), null);
} }
else else {
{
$db->rollback(); $db->rollback();
dol_print_error($db); dol_print_error($db);
} }
@ -99,8 +98,7 @@ if ($action == 'setvalue' && $user->admin)
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null); setEventMessages($langs->trans("SetupSaved"), null);
} }
else else {
{
$db->rollback(); $db->rollback();
dol_print_error($db); dol_print_error($db);
} }
@ -179,8 +177,7 @@ if ($mode == 'setup' && $user->admin)
$urltodelete = ''; $urltodelete = '';
$urltocheckperms = ''; $urltocheckperms = '';
} }
else else {
{
$urltorenew = ''; $urltorenew = '';
$urltodelete = ''; $urltodelete = '';
$urltocheckperms = ''; $urltocheckperms = '';
@ -194,8 +191,7 @@ if ($mode == 'setup' && $user->admin)
require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php'; require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php';
// Dolibarr storage // Dolibarr storage
$storage = new DoliStorage($db, $conf); $storage = new DoliStorage($db, $conf);
try try {
{
$tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME); $tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME);
} }
catch (Exception $e) catch (Exception $e)
@ -226,8 +222,7 @@ if ($mode == 'setup' && $user->admin)
{ {
$expiredat = $langs->trans("Unknown"); $expiredat = $langs->trans("Unknown");
} }
else else {
{
$expiredat = dol_print_date($endoflife, "dayhour"); $expiredat = dol_print_date($endoflife, "dayhour");
} }
} }

View File

@ -57,8 +57,7 @@ if ($action == 'updateMask')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -184,8 +183,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} }
else else {
{
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/', '', $file).'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/', '', $file).'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
} }
print '</td>'; print '</td>';

View File

@ -190,8 +190,7 @@ for ($i = 1; $i <= 6; $i++)
$pid = $langs->transcountry("ProfId".$i, $mysoc->country_code); $pid = $langs->transcountry("ProfId".$i, $mysoc->country_code);
if ($pid == '-') $pid = false; if ($pid == '-') $pid = false;
} }
else else {
{
$pid = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</font>'; $pid = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
} }
if ($pid) if ($pid)

View File

@ -230,8 +230,7 @@ if ($result)
print img_picto($langs->trans("Active"), 'tick'); print img_picto($langs->trans("Active"), 'tick');
print '</td>'; print '</td>';
} }
else else {
{
print '<td>'; print '<td>';
print '<a class="reposition" href="perms.php?pid='.$obj->id.'&amp;action=add">'.img_edit_add().'</a>'; print '<a class="reposition" href="perms.php?pid='.$obj->id.'&amp;action=add">'.img_edit_add().'</a>';
print '</td>'; print '</td>';

View File

@ -101,8 +101,7 @@ if ($action == "set")
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
$db->rollback(); $db->rollback();
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }

View File

@ -64,8 +64,7 @@ if ($action == 'updateMask')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=propal&file=SPECIMEN.pdf");
return; return;
} }
else else {
{
setEventMessages($module->error, $module->errors, 'errors'); setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR); dol_syslog($module->error, LOG_ERR);
} }
} }
else else {
{
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
@ -127,8 +124,7 @@ elseif ($action == 'setribchq')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -143,8 +139,7 @@ elseif ($action == 'set_PROPALE_DRAFT_WATERMARK')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -160,8 +155,7 @@ elseif ($action == 'set_PROPOSAL_FREE_TEXT')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -175,8 +169,7 @@ elseif ($action == 'setdefaultduration')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -311,8 +303,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} }
else else {
{
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'">'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'">';
print img_picto($langs->trans("Disabled"), 'switch_off'); print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>'; print '</a>';
@ -377,8 +368,7 @@ if ($resql)
$i++; $i++;
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -449,8 +439,7 @@ foreach ($dirmodels as $reldir)
print '</a>'; print '</a>';
print '</td>'; print '</td>';
} }
else else {
{
print "<td align=\"center\">\n"; print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";
@ -462,8 +451,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
} }
else else {
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} }
print '</td>'; print '</td>';
@ -497,8 +485,7 @@ foreach ($dirmodels as $reldir)
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
} }
else else {
{
print img_object($langs->trans("PreviewNotAvailable"), 'generic'); print img_object($langs->trans("PreviewNotAvailable"), 'generic');
} }
print '</td>'; print '</td>';
@ -572,14 +559,12 @@ if (empty($conf->facture->enabled))
} }
print "</select>"; print "</select>";
} }
else else {
{
print "<i>".$langs->trans("NoActiveBankAccountDefined")."</i>"; print "<i>".$langs->trans("NoActiveBankAccountDefined")."</i>";
} }
} }
} }
else else {
{
print '<span class="opacitymedium">'.$langs->trans("BankModuleNotActive").'</span>'; print '<span class="opacitymedium">'.$langs->trans("BankModuleNotActive").'</span>';
} }
} }
@ -686,8 +671,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{ {
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>'; print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
} }
else else {
{
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create(); print $doleditor->Create();

View File

@ -90,8 +90,7 @@ if ($action == 'addprinter' && $user->admin) {
$db->commit(); $db->commit();
setEventMessages($langs->trans("PrinterAdded", $printername), null); setEventMessages($langs->trans("PrinterAdded", $printername), null);
} }
else else {
{
$db->rollback(); $db->rollback();
dol_print_error($db); dol_print_error($db);
} }
@ -116,8 +115,7 @@ if ($action == 'deleteprinter' && $user->admin) {
$db->commit(); $db->commit();
setEventMessages($langs->trans("PrinterDeleted", $printername), null); setEventMessages($langs->trans("PrinterDeleted", $printername), null);
} }
else else {
{
$db->rollback(); $db->rollback();
dol_print_error($db); dol_print_error($db);
} }

View File

@ -72,8 +72,7 @@ if ($action == 'updateMask')
{ {
if ($res > 0) if ($res > 0)
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
else else setEventMessages($langs->trans("Error"), null, 'errors');
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"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=reception&file=SPECIMEN.pdf");
return; return;
} }
else else {
{
setEventMessages($module->error, $module->errors, 'errors'); setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR); dol_syslog($module->error, LOG_ERR);
} }
} }
else else {
{
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
@ -264,8 +261,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} }
else else {
{
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmodel&amp;value='.$file.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmodel&amp;value='.$file.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Disabled"), 'switch_off'); print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>'; print '</a>';
@ -332,8 +328,7 @@ if ($resql)
$i++; $i++;
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -402,8 +397,7 @@ foreach ($dirmodels as $reldir)
print '</a>'; print '</a>';
print '</td>'; print '</td>';
} }
else else {
{
print '<td class="center">'."\n"; print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";
@ -415,8 +409,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
} }
else else {
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} }
print '</td>'; print '</td>';
@ -447,8 +440,7 @@ foreach ($dirmodels as $reldir)
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'reception').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'reception').'</a>';
} }
else else {
{
print img_object($langs->trans("PreviewNotAvailable"), 'generic'); print img_object($langs->trans("PreviewNotAvailable"), 'generic');
} }
print '</td>'; print '</td>';

View File

@ -92,8 +92,7 @@ if (empty($conf->use_javascript_ajax))
print $langs->trans("NotAvailableWhenAjaxDisabled"); print $langs->trans("NotAvailableWhenAjaxDisabled");
print '</td>'; print '</td>';
} }
else else {
{
print '<td width="60" class="right">'; print '<td width="60" class="right">';
$arrval = array( $arrval = array(
'0'=>$langs->trans("No"), '0'=>$langs->trans("No"),

View File

@ -46,8 +46,7 @@ if ($action == 'setgeneraterule')
{ {
dol_print_error($db); dol_print_error($db);
} }
else else {
{
header("Location: ".$_SERVER["PHP_SELF"]); header("Location: ".$_SERVER["PHP_SELF"]);
exit; exit;
} }
@ -102,8 +101,7 @@ if ($action == 'activate_encrypt')
header("Location: security.php"); header("Location: security.php");
exit; exit;
} }
else else {
{
$db->rollback(); $db->rollback();
dol_print_error($db, ''); dol_print_error($db, '');
} }
@ -132,8 +130,7 @@ if ($action == 'activate_encryptdbpassconf')
header("Location: security.php"); header("Location: security.php");
exit; exit;
} }
else else {
{
setEventMessages($langs->trans('InstrucToEncodePass', dol_encode($dolibarr_main_db_pass)), null, 'warnings'); setEventMessages($langs->trans('InstrucToEncodePass', dol_encode($dolibarr_main_db_pass)), null, 'warnings');
} }
} }
@ -149,8 +146,7 @@ elseif ($action == 'disable_encryptdbpassconf')
header("Location: security.php"); header("Location: security.php");
exit; exit;
} }
else else {
{
setEventMessages($langs->trans('InstrucToClearPass', $dolibarr_main_db_pass), null, 'warnings'); setEventMessages($langs->trans('InstrucToClearPass', $dolibarr_main_db_pass), null, 'warnings');
} }
} }
@ -278,8 +274,7 @@ foreach ($arrayhandler as $key => $module)
{ {
print img_picto('', 'tick'); print img_picto('', 'tick');
} }
else else {
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setgeneraterule&amp;value='.$key.'">'.$langs->trans("Activate").'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?action=setgeneraterule&amp;value='.$key.'">'.$langs->trans("Activate").'</a>';
} }
print "</td></tr>\n"; print "</td></tr>\n";
@ -436,8 +431,7 @@ if (!empty($conf->global->DATABASE_PWD_ENCRYPTED))
//Do not allow "disable encryption" as passwords cannot be decrypted //Do not allow "disable encryption" as passwords cannot be decrypted
print '<a href="security.php?action=disable_encrypt">'.$langs->trans("Disable").'</a>'; print '<a href="security.php?action=disable_encrypt">'.$langs->trans("Disable").'</a>';
} }
else else {
{
print '-'; print '-';
} }
print "</td>"; print "</td>";
@ -463,8 +457,7 @@ if (empty($dolibarr_main_db_pass) && empty($dolibarr_main_db_encrypted_pass))
$langs->load("errors"); $langs->load("errors");
print img_warning($langs->trans("WarningPassIsEmpty")); print img_warning($langs->trans("WarningPassIsEmpty"));
} }
else else {
{
if (empty($dolibarr_main_db_encrypted_pass)) if (empty($dolibarr_main_db_encrypted_pass))
{ {
print '<a href="security.php?action=activate_encryptdbpassconf">'.$langs->trans("Activate").'</a>'; print '<a href="security.php?action=activate_encryptdbpassconf">'.$langs->trans("Activate").'</a>';
@ -516,8 +509,7 @@ if (GETPOST('info', 'int') > 0)
{ {
print $langs->trans("Note: The function password_hash exists on your PHP")."<br>\n"; print $langs->trans("Note: The function password_hash exists on your PHP")."<br>\n";
} }
else else {
{
print $langs->trans("Note: The function password_hash does not exists on your PHP")."<br>\n"; print $langs->trans("Note: The function password_hash does not exists on your PHP")."<br>\n";
} }
print 'MAIN_SECURITY_HASH_ALGO = '.$conf->global->MAIN_SECURITY_HASH_ALGO."<br>\n"; print 'MAIN_SECURITY_HASH_ALGO = '.$conf->global->MAIN_SECURITY_HASH_ALGO."<br>\n";

View File

@ -51,8 +51,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
Header("Location: ".$_SERVER["PHP_SELF"]); Header("Location: ".$_SERVER["PHP_SELF"]);
exit; exit;
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} elseif (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { } 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"]); Header("Location: ".$_SERVER["PHP_SELF"]);
exit; exit;
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -119,20 +117,17 @@ if (function_exists("imagecreatefrompng"))
{ {
print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA'); print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA');
} }
else else {
{
if (empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA)) if (empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA))
{ {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_MAIN_SECURITY_ENABLECAPTCHA">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_MAIN_SECURITY_ENABLECAPTCHA">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} }
else else {
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_MAIN_SECURITY_ENABLECAPTCHA">'.img_picto($langs->trans("Enabled"), 'on').'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_MAIN_SECURITY_ENABLECAPTCHA">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
} }
} }
} }
else else {
{
$desc = $form->textwithpicto('', $langs->transnoentities("EnableGDLibraryDesc"), 1, 'warning'); $desc = $form->textwithpicto('', $langs->transnoentities("EnableGDLibraryDesc"), 1, 'warning');
print $desc; print $desc;
} }
@ -146,14 +141,12 @@ if (!empty($conf->use_javascript_ajax))
{ {
print ajax_constantonoff('MAIN_USE_ADVANCED_PERMS'); print ajax_constantonoff('MAIN_USE_ADVANCED_PERMS');
} }
else else {
{
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) if (empty($conf->global->MAIN_USE_ADVANCED_PERMS))
{ {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_MAIN_USE_ADVANCED_PERMS">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_MAIN_USE_ADVANCED_PERMS">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} }
else else {
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_MAIN_USE_ADVANCED_PERMS">'.img_picto($langs->trans("Enabled"), 'on').'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_MAIN_USE_ADVANCED_PERMS">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
} }
} }

View File

@ -123,8 +123,7 @@ if ($action == 'send' && !$_POST['cancel'])
setEventMessages($langs->trans("SmsSuccessfulySent", $smsfrom, $sendto), null, 'mesgs'); setEventMessages($langs->trans("SmsSuccessfulySent", $smsfrom, $sendto), null, 'mesgs');
setEventMessages($smsfile->error, $smsfile->errors, 'mesgs'); setEventMessages($smsfile->error, $smsfile->errors, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("ResultKo"), null, 'errors'); setEventMessages($langs->trans("ResultKo"), null, 'errors');
setEventMessages($smsfile->error, $smsfile->errors, 'errors'); setEventMessages($smsfile->error, $smsfile->errors, 'errors');
} }
@ -206,8 +205,7 @@ if ($action == 'edit')
print '</form>'; print '</form>';
print '<br>'; print '<br>';
} }
else else {
{
if (!count($listofmethods)) print '<div class="warning">'.$langs->trans("NoSmsEngine", '<a target="_blank" href="http://www.dolistore.com/search.php?orderby=position&orderway=desc&search_query=smsmanager">DoliStore</a>').'</div>'; if (!count($listofmethods)) print '<div class="warning">'.$langs->trans("NoSmsEngine", '<a target="_blank" href="http://www.dolistore.com/search.php?orderby=position&orderway=desc&search_query=smsmanager">DoliStore</a>').'</div>';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
@ -265,8 +263,7 @@ else
{ {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test&amp;mode=init">'.$langs->trans("DoTestSend").'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test&amp;mode=init">'.$langs->trans("DoTestSend").'</a>';
} }
else else {
{
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("DoTestSend").'</a>'; print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("DoTestSend").'</a>';
} }
print '</div>'; print '</div>';

View File

@ -49,8 +49,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
header("Location: ".$_SERVER["PHP_SELF"]); header("Location: ".$_SERVER["PHP_SELF"]);
exit; exit;
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -63,8 +62,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
header("Location: ".$_SERVER["PHP_SELF"]); header("Location: ".$_SERVER["PHP_SELF"]);
exit; exit;
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }

View File

@ -74,8 +74,7 @@ if ($action == 'update' || $action == 'add')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -154,8 +153,7 @@ if (!empty($conf->global->ADHERENT_USE_SPIP))
print '</form>'; print '</form>';
} }
else else {
{
dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user');
$link = '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&value=1&name=ADHERENT_USE_SPIP">'; $link = '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&value=1&name=ADHERENT_USE_SPIP">';

View File

@ -49,8 +49,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
header("Location: ".$_SERVER["PHP_SELF"]); header("Location: ".$_SERVER["PHP_SELF"]);
exit; exit;
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }
@ -63,8 +62,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
header("Location: ".$_SERVER["PHP_SELF"]); header("Location: ".$_SERVER["PHP_SELF"]);
exit; exit;
} }
else else {
{
dol_print_error($db); 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); print $form->selectarray("STOCK_CALCULATE_ON_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_BILL);
} }
} }
else else {
{
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module30Name")); print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module30Name"));
} }
print "</td>\n</tr>\n"; print "</td>\n</tr>\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); 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 $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module25Name"));
} }
print "</td>\n</tr>\n"; print "</td>\n</tr>\n";
@ -162,8 +158,7 @@ if (!empty($conf->expedition->enabled))
print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT); print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT);
} }
} }
else else {
{
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module80Name")); print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module80Name"));
} }
print "</td>\n</tr>\n"; print "</td>\n</tr>\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); 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 $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module80Name"));
} }
print "</td>\n</tr>\n"; print "</td>\n</tr>\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); 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 $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name"));
} }
print "</td>\n</tr>\n"; print "</td>\n</tr>\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); 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 $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name"));
} }
print "</td>\n</tr>\n"; print "</td>\n</tr>\n";
@ -280,8 +272,7 @@ if (!empty($conf->reception->enabled))
print "</td>\n</tr>\n"; print "</td>\n</tr>\n";
$found++; $found++;
} }
else else {
{
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("ReStockOnDispatchOrder").'</td>'; print '<td>'.$langs->trans("ReStockOnDispatchOrder").'</td>';
print '<td class="right">'; print '<td class="right">';
@ -294,8 +285,7 @@ else
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER); 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 $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name"));
} }
print "</td>\n</tr>\n"; print "</td>\n</tr>\n";

View File

@ -71,8 +71,7 @@ if ($action == 'updateMask')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture_fournisseur&file=SPECIMEN.pdf");
return; return;
} }
else else {
{
setEventMessages($module->error, $module->errors, 'errors'); setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR); dol_syslog($module->error, LOG_ERR);
} }
} }
else else {
{
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
@ -186,8 +183,7 @@ if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -273,8 +269,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} }
else else {
{
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
} }
print '</td>'; print '</td>';
@ -341,8 +336,7 @@ if ($resql)
$i++; $i++;
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -410,8 +404,7 @@ foreach ($dirmodels as $reldir)
}*/ }*/
print "</td>"; print "</td>";
} }
else else {
{
print '<td class="center">'."\n"; print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";
@ -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 // 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 '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
} }
else else {
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} }
print '</td>'; print '</td>';
@ -488,8 +480,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{ {
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>'; print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
} }
else else {
{
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create(); print $doleditor->Create();

View File

@ -69,8 +69,7 @@ if ($action == 'updateMask')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande_fournisseur&file=SPECIMEN.pdf");
return; return;
} }
else else {
{
setEventMessages($module->error, $module->errors, 'errors'); setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR); dol_syslog($module->error, LOG_ERR);
} }
} }
else else {
{
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
@ -197,8 +194,7 @@ elseif ($action == 'set_SUPPLIER_ORDER_OTHER')
// Insert // Insert
$newmodule->insert_permissions(1); $newmodule->insert_permissions(1);
} }
else else {
{
// Remove all rights with Permission1190 // Remove all rights with Permission1190
$newmodule->delete_permissions(); $newmodule->delete_permissions();
@ -218,8 +214,7 @@ elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -305,8 +300,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} }
else else {
{
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
} }
print '</td>'; print '</td>';
@ -371,8 +365,7 @@ if ($resql)
$i++; $i++;
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -430,14 +423,12 @@ foreach ($dirmodels as $reldir)
print img_picto($langs->trans("Enabled"), 'switch_on'); print img_picto($langs->trans("Enabled"), 'switch_on');
print '</a>'; print '</a>';
} }
else else {
{
print img_picto($langs->trans("Enabled"), 'switch_on'); print img_picto($langs->trans("Enabled"), 'switch_on');
} }
print "</td>"; print "</td>";
} }
else else {
{
print '<td class="center">'."\n"; print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=order_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=order_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";
@ -449,8 +440,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
} }
else else {
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} }
print '</td>'; print '</td>';
@ -554,8 +544,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{ {
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>'; print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
} }
else else {
{
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create(); print $doleditor->Create();
@ -573,8 +562,7 @@ if ($conf->reception->enabled)
{ {
print '<span class="opacitymedium">'.$langs->trans("FeatureNotAvailableWithReceptionModule").'</span>'; print '<span class="opacitymedium">'.$langs->trans("FeatureNotAvailableWithReceptionModule").'</span>';
} }
else else {
{
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS'); print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS');
} else { } else {

View File

@ -58,8 +58,7 @@ if ($action == 'updateMask')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
}elseif ($action == 'setmod') }elseif ($action == 'setmod')
@ -132,14 +131,12 @@ elseif ($action == 'specimen')
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=supplier_payment&file=SPECIMEN.pdf"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=supplier_payment&file=SPECIMEN.pdf");
return; return;
} }
else else {
{
setEventMessages($module->error, $module->errors, 'errors'); setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR); dol_syslog($module->error, LOG_ERR);
} }
} }
else else {
{
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
@ -207,8 +204,7 @@ if ($resql)
$i++; $i++;
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -283,8 +279,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} }
else else {
{
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/', '', $file).'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/', '', $file).'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
} }
print '</td>'; print '</td>';
@ -399,8 +394,7 @@ foreach ($dirmodels as $reldir)
}*/ }*/
print "</td>"; print "</td>";
} }
else else {
{
print '<td class="center">'."\n"; print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=SUPPLIER_PAYMENT">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=SUPPLIER_PAYMENT">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";
@ -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 // 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 '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
} }
else else {
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} }
print '</td>'; print '</td>';

View File

@ -61,8 +61,7 @@ if ($action == 'updateMask')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=supplier_proposal&file=SPECIMEN.pdf");
return; return;
} }
else else {
{
setEventMessages($module->error, null, 'errors'); setEventMessages($module->error, null, 'errors');
dol_syslog($module->error, LOG_ERR); dol_syslog($module->error, LOG_ERR);
} }
} }
else else {
{
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
@ -123,8 +120,7 @@ if ($action == 'set_SUPPLIER_PROPOSAL_DRAFT_WATERMARK')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -141,8 +137,7 @@ if ($action == 'set_SUPPLIER_PROPOSAL_FREE_TEXT')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); 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'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@ -279,8 +273,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} }
else else {
{
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'">'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'">';
print img_picto($langs->trans("Disabled"), 'switch_off'); print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>'; print '</a>';
@ -344,8 +337,7 @@ if ($resql)
$i++; $i++;
} }
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -415,8 +407,7 @@ foreach ($dirmodels as $reldir)
print '</a>'; print '</a>';
print '</td>'; print '</td>';
} }
else else {
{
print "<td align=\"center\">\n"; print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>"; print "</td>";
@ -428,8 +419,7 @@ foreach ($dirmodels as $reldir)
{ {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
} }
else else {
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} }
print '</td>'; print '</td>';
@ -463,8 +453,7 @@ foreach ($dirmodels as $reldir)
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
} }
else else {
{
print img_object($langs->trans("PreviewNotAvailable"), 'generic'); print img_object($langs->trans("PreviewNotAvailable"), 'generic');
} }
print '</td>'; print '</td>';
@ -512,8 +501,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{ {
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>'; print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
} }
else else {
{
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create(); print $doleditor->Create();
@ -544,21 +532,18 @@ if ($conf->banque->enabled)
{ {
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL'); print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL');
} }
else else {
{
if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL)) if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL))
{ {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL&amp;value=1">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL&amp;value=1">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
} }
else else {
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL&amp;value=0">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL&amp;value=0">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>';
} }
} }
print '</td></tr>'; print '</td></tr>';
} }
else else {
{
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
} }

View File

@ -127,8 +127,7 @@ if ($action == 'set')
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
$db->rollback(); $db->rollback();
setEventMessages($error, $errors, 'errors'); setEventMessages($error, $errors, 'errors');
} }
@ -156,8 +155,7 @@ if ($action == 'setlevel')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }

View File

@ -201,8 +201,7 @@ if ($showpromotemessage)
print $langs->trans("ExampleOfNewsMessageForMajorRelease", DOL_VERSION, DOL_VERSION); print $langs->trans("ExampleOfNewsMessageForMajorRelease", DOL_VERSION, DOL_VERSION);
print '</textarea>'; print '</textarea>';
} }
else else {
{
print $langs->trans("TitleExampleForMaintenanceRelease").':<br>'; print $langs->trans("TitleExampleForMaintenanceRelease").':<br>';
print '<textarea style="width:80%; min-height: 60px">'; print '<textarea style="width:80%; min-height: 60px">';
print $langs->trans("ExampleOfNewsMessageForMaintenanceRelease", DOL_VERSION, DOL_VERSION); print $langs->trans("ExampleOfNewsMessageForMaintenanceRelease", DOL_VERSION, DOL_VERSION);

View File

@ -174,8 +174,7 @@ foreach ($configfileparameters as $key)
{ {
print '<td colspan="3">&nbsp;</td>'; print '<td colspan="3">&nbsp;</td>';
} }
else else {
{
// Label // Label
print "<td>".$configfilelib[$i].'</td>'; print "<td>".$configfilelib[$i].'</td>';
// Key // Key
@ -220,8 +219,7 @@ if (empty($conf->multicompany->enabled))
// If no multicompany mode, admins can see global and their constantes // If no multicompany mode, admins can see global and their constantes
$sql .= " WHERE entity IN (0,".$conf->entity.")"; $sql .= " WHERE entity IN (0,".$conf->entity.")";
} }
else else {
{
// If multicompany mode, superadmin (user->entity=0) can see everything, admin are limited to their entities. // If multicompany mode, superadmin (user->entity=0) can see everything, admin are limited to their entities.
if ($user->entity) $sql .= " WHERE entity IN (".$user->entity.",".$conf->entity.")"; if ($user->entity) $sql .= " WHERE entity IN (".$user->entity.",".$conf->entity.")";
} }

View File

@ -83,8 +83,7 @@ if (!$base)
{ {
print $langs->trans("FeatureNotAvailableWithThisDatabaseDriver"); print $langs->trans("FeatureNotAvailableWithThisDatabaseDriver");
} }
else else {
{
if ($base == 1) if ($base == 1)
{ {
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
@ -121,8 +120,7 @@ else
{ {
print '<td><a class="reposition" href="database-tables.php?action=convert&amp;table='.$obj->Name.'">'.$langs->trans("Convert").' InnoDB</a></td>'; print '<td><a class="reposition" href="database-tables.php?action=convert&amp;table='.$obj->Name.'">'.$langs->trans("Convert").' InnoDB</a></td>';
} }
else else {
{
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
} }
print '<td>'.$obj->Row_format.'</td>'; print '<td>'.$obj->Row_format.'</td>';

View File

@ -74,8 +74,7 @@ if (!count($listofvars) && !count($listofstatus))
{ {
print $langs->trans("FeatureNotAvailableWithThisDatabaseDriver"); print $langs->trans("FeatureNotAvailableWithThisDatabaseDriver");
} }
else else {
{
foreach ($arraylist as $listname) foreach ($arraylist as $listname)
{ {
print '<br>'; print '<br>';

View File

@ -60,8 +60,7 @@ if (!$base)
{ {
print $langs->trans("FeatureNotAvailableWithThisDatabaseDriver"); print $langs->trans("FeatureNotAvailableWithThisDatabaseDriver");
} }
else else {
{
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)
{ {

View File

@ -77,8 +77,7 @@ if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE))
// Compare version with last install database version (upgrades never occured) // Compare version with last install database version (upgrades never occured)
if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_INSTALL) print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, $conf->global->MAIN_VERSION_LAST_INSTALL)); if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_INSTALL) print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, $conf->global->MAIN_VERSION_LAST_INSTALL));
} }
else else {
{
// Compare version with last upgrade database version // Compare version with last upgrade database version
if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_UPGRADE) print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, $conf->global->MAIN_VERSION_LAST_UPGRADE)); if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_UPGRADE) print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, $conf->global->MAIN_VERSION_LAST_UPGRADE));
} }
@ -108,13 +107,11 @@ if (function_exists('curl_init'))
// Show version // Show version
print $langs->trans("LastStableVersion").' : <b>'.(($version != '0.0') ? $version : $langs->trans("Unknown")).'</b>'; print $langs->trans("LastStableVersion").' : <b>'.(($version != '0.0') ? $version : $langs->trans("Unknown")).'</b>';
} }
else else {
{
print $langs->trans("LastStableVersion").' : <b>'.$langs->trans("UpdateServerOffline").'</b>'; print $langs->trans("LastStableVersion").' : <b>'.$langs->trans("UpdateServerOffline").'</b>';
} }
} }
else else {
{
print $langs->trans("LastStableVersion").' : <a href="'.$_SERVER["PHP_SELF"].'?action=getlastversion" class="butAction">'.$langs->trans("Check").'</a>'; print $langs->trans("LastStableVersion").' : <a href="'.$_SERVER["PHP_SELF"].'?action=getlastversion" class="butAction">'.$langs->trans("Check").'</a>';
} }
} }
@ -366,8 +363,7 @@ foreach ($configfileparameters as $key => $value)
{ {
print '<td colspan="3">&nbsp;</td>'; print '<td colspan="3">&nbsp;</td>';
} }
else else {
{
// Label // Label
print "<td>".$value.'</td>'; print "<td>".$value.'</td>';
// Key // Key
@ -403,8 +399,7 @@ foreach ($configfileparameters as $key => $value)
} }
print ' &nbsp; <span class="opacitymedium">('.$langs->trans("HashForPing").'='.md5('dolibarr'.$valuetoshow).')</span>'; print ' &nbsp; <span class="opacitymedium">('.$langs->trans("HashForPing").'='.md5('dolibarr'.$valuetoshow).')</span>';
} }
else else {
{
print ${$newkey}; print ${$newkey};
} }
if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')'; if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')';
@ -442,8 +437,7 @@ if (empty($conf->multicompany->enabled))
// If no multicompany mode, admins can see global and their constantes // If no multicompany mode, admins can see global and their constantes
$sql .= " WHERE entity IN (0,".$conf->entity.")"; $sql .= " WHERE entity IN (0,".$conf->entity.")";
} }
else else {
{
// If multicompany mode, superadmin (user->entity=0) can see everything, admin are limited to their entities. // If multicompany mode, superadmin (user->entity=0) can see everything, admin are limited to their entities.
if ($user->entity) $sql .= " WHERE entity IN (".$user->entity.",".$conf->entity.")"; if ($user->entity) $sql .= " WHERE entity IN (".$user->entity.",".$conf->entity.")";
} }

View File

@ -99,8 +99,7 @@ if (dol_is_file($xmlfile))
print '<input name="xmlshortfile" class="flat minwidth400" value="'.dol_escape_htmltag($xmlshortfile).'">'; print '<input name="xmlshortfile" class="flat minwidth400" value="'.dol_escape_htmltag($xmlshortfile).'">';
print '<br>'; print '<br>';
} }
else else {
{
print '<input type="radio" name="target" value="local"> '.$langs->trans("LocalSignature").' = '; print '<input type="radio" name="target" value="local"> '.$langs->trans("LocalSignature").' = ';
print '<input name="xmlshortfile" class="flat minwidth400" value="'.dol_escape_htmltag($xmlshortfile).'">'; print '<input name="xmlshortfile" class="flat minwidth400" value="'.dol_escape_htmltag($xmlshortfile).'">';
print ' <span class="warning">('.$langs->trans("AvailableOnlyOnPackagedVersions").')</span>'; print ' <span class="warning">('.$langs->trans("AvailableOnlyOnPackagedVersions").')</span>';
@ -112,8 +111,7 @@ if ($enableremotecheck)
print '<input type="radio" name="target" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"' : '').'> '.$langs->trans("RemoteSignature").' = '; print '<input type="radio" name="target" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"' : '').'> '.$langs->trans("RemoteSignature").' = ';
print '<input name="xmlremote" class="flat minwidth400" value="'.dol_escape_htmltag($xmlremote).'"><br>'; print '<input name="xmlremote" class="flat minwidth400" value="'.dol_escape_htmltag($xmlremote).'"><br>';
} }
else else {
{
print '<input type="radio" name="target" value="remote" disabled="disabled"> '.$langs->trans("RemoteSignature").' = '.$xmlremote; print '<input type="radio" name="target" value="remote" disabled="disabled"> '.$langs->trans("RemoteSignature").' = '.$xmlremote;
if (!GETPOST('xmlremote')) print ' <span class="warning">('.$langs->trans("FeatureAvailableOnlyOnStable").')</span>'; if (!GETPOST('xmlremote')) print ' <span class="warning">('.$langs->trans("FeatureAvailableOnlyOnStable").')</span>';
print '<br>'; print '<br>';
@ -141,8 +139,7 @@ if (GETPOST('target') == 'local')
} }
$xml = simplexml_load_file($xmlfile); $xml = simplexml_load_file($xmlfile);
} }
else else {
{
print $langs->trans('XmlNotFound').': '.$xmlfile; print $langs->trans('XmlNotFound').': '.$xmlfile;
$error++; $error++;
} }
@ -158,8 +155,7 @@ if (GETPOST('target') == 'remote')
//print "xmlfilestart".$xmlfile."xmlfileend"; //print "xmlfilestart".$xmlfile."xmlfileend";
$xml = simplexml_load_string($xmlfile); $xml = simplexml_load_string($xmlfile);
} }
else else {
{
$errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg']; $errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
setEventMessages($errormsg, null, 'errors'); setEventMessages($errormsg, null, 'errors');
$error++; $error++;
@ -271,8 +267,7 @@ if (!$error && $xml)
$out .= "</tr>\n"; $out .= "</tr>\n";
} }
} }
else else {
{
$out .= '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; $out .= '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
} }
$out .= '</table>'; $out .= '</table>';
@ -326,8 +321,7 @@ if (!$error && $xml)
$out .= '<td class="right"></td>'."\n"; $out .= '<td class="right"></td>'."\n";
$out .= "</tr>\n"; $out .= "</tr>\n";
} }
else else {
{
$out .= '<tr class="oddeven"><td colspan="6" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; $out .= '<tr class="oddeven"><td colspan="6" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
} }
$out .= '</table>'; $out .= '</table>';
@ -381,8 +375,7 @@ if (!$error && $xml)
$out .= '<td class="right"></td>'."\n"; $out .= '<td class="right"></td>'."\n";
$out .= "</tr>\n"; $out .= "</tr>\n";
} }
else else {
{
$out .= '<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; $out .= '<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
} }
$out .= '</table>'; $out .= '</table>';
@ -394,13 +387,11 @@ if (!$error && $xml)
{ {
setEventMessages($langs->trans("FileIntegrityIsStrictlyConformedWithReference"), null, 'mesgs'); setEventMessages($langs->trans("FileIntegrityIsStrictlyConformedWithReference"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("FileIntegritySomeFilesWereRemovedOrModified"), null, 'warnings'); setEventMessages($langs->trans("FileIntegritySomeFilesWereRemovedOrModified"), null, 'warnings');
} }
} }
else else {
{
print 'Error: Failed to found dolibarr_htdocs_dir into XML file '.$xmlfile; print 'Error: Failed to found dolibarr_htdocs_dir into XML file '.$xmlfile;
$error++; $error++;
} }
@ -434,15 +425,13 @@ if (!$error && $xml)
$resultcomment = 'FileIntegrityIsOkButFilesWereAdded'; $resultcomment = 'FileIntegrityIsOkButFilesWereAdded';
$outcurrentchecksum = $checksumget.' - <span class="'.$resultcode.'">'.$langs->trans("FileIntegrityIsOkButFilesWereAdded").'</span>'; $outcurrentchecksum = $checksumget.' - <span class="'.$resultcode.'">'.$langs->trans("FileIntegrityIsOkButFilesWereAdded").'</span>';
} }
else else {
{
$resultcode = 'ok'; $resultcode = 'ok';
$resultcomment = 'Success'; $resultcomment = 'Success';
$outcurrentchecksum = '<span class="'.$resultcode.'">'.$checksumget.'</span>'; $outcurrentchecksum = '<span class="'.$resultcode.'">'.$checksumget.'</span>';
} }
} }
else else {
{
$resultcode = 'error'; $resultcode = 'error';
$resultcomment = 'Error'; $resultcomment = 'Error';
$outcurrentchecksum = '<span class="'.$resultcode.'">'.$checksumget.'</span>'; $outcurrentchecksum = '<span class="'.$resultcode.'">'.$checksumget.'</span>';

View File

@ -70,8 +70,7 @@ foreach ($modulesdir as $dir)
// File duplicate // File duplicate
print "Warning duplicate file found : ".$file." (Found ".$dir.$file.", already found ".$modules_fullpath[$file].")<br>"; print "Warning duplicate file found : ".$file." (Found ".$dir.$file.", already found ".$modules_fullpath[$file].")<br>";
} }
else else {
{
// File to load // File to load
$res = include_once $dir.$file; $res = include_once $dir.$file;
if (class_exists($modName)) if (class_exists($modName))
@ -90,8 +89,7 @@ foreach ($modulesdir as $dir)
dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR); 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)<br>"; print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)<br>";
} }
} }
@ -125,8 +123,7 @@ foreach ($sortorder as $numero=>$name)
if (preg_match('/^\//', $picto[$numero])) print img_picto($alt, $picto[$numero], 'width="14px"', 1); if (preg_match('/^\//', $picto[$numero])) print img_picto($alt, $picto[$numero], 'width="14px"', 1);
else print img_object($alt, $picto[$numero], 'width="14px"'); else print img_object($alt, $picto[$numero], 'width="14px"');
} }
else else {
{
print img_object($alt, $picto[$numero], 'width="14px"'); print img_object($alt, $picto[$numero], 'width="14px"');
} }
print ' '.$modules[$numero]->getName(); print ' '.$modules[$numero]->getName();

View File

@ -63,8 +63,7 @@ print '<br>';
print '<strong>'.$langs->trans("XDebug").'</strong>: '; print '<strong>'.$langs->trans("XDebug").'</strong>: ';
$test = !function_exists('xdebug_is_enabled'); $test = !function_exists('xdebug_is_enabled');
if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled"); if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled");
else else {
{
print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("XDebug")); print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("XDebug"));
print ' - '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php">XDebug admin page</a>'; print ' - '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php">XDebug admin page</a>';
} }
@ -75,8 +74,7 @@ print '<br>';
print '<strong>'.$langs->trans("Syslog").'</strong>: '; print '<strong>'.$langs->trans("Syslog").'</strong>: ';
$test = empty($conf->syslog->enabled); $test = empty($conf->syslog->enabled);
if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled"); if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled");
else else {
{
print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("Syslog")); print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("Syslog"));
//print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php'.'">XDebug admin page</a>'; //print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php'.'">XDebug admin page</a>';
} }
@ -87,8 +85,7 @@ print '<br>';
print '<strong>'.$langs->trans("DebugBar").'</strong>: '; print '<strong>'.$langs->trans("DebugBar").'</strong>: ';
$test = empty($conf->debugbar->enabled); $test = empty($conf->debugbar->enabled);
if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled"); if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled");
else else {
{
print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("DebugBar")); print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("DebugBar"));
//print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php'.'">XDebug admin page</a>'; //print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php'.'">XDebug admin page</a>';
} }
@ -105,8 +102,7 @@ if ($test)
print img_picto('', 'tick.png').' '.$langs->trans("MemcachedAvailableAndSetup"); print img_picto('', 'tick.png').' '.$langs->trans("MemcachedAvailableAndSetup");
print ' '.$langs->trans("MoreInformation").' <a href="'.dol_buildpath('/memcached/admin/memcached.php', 1).'">Memcached module admin page</a>'; print ' '.$langs->trans("MoreInformation").' <a href="'.dol_buildpath('/memcached/admin/memcached.php', 1).'">Memcached module admin page</a>';
} }
else else {
{
print img_picto('', 'warning').' '.$langs->trans("MemcachedModuleAvailableButNotSetup"); print img_picto('', 'warning').' '.$langs->trans("MemcachedModuleAvailableButNotSetup");
print ' <a href="'.dol_buildpath('/memcached/admin/memcached.php', 1).'">Memcached module admin page</a>'; print ' <a href="'.dol_buildpath('/memcached/admin/memcached.php', 1).'">Memcached module admin page</a>';
} }
@ -148,8 +144,7 @@ if (!$foundcache && $test)
$foundcache++; $foundcache++;
print img_picto('', 'tick.png').' '.$langs->trans("APCInstalled"); print img_picto('', 'tick.png').' '.$langs->trans("APCInstalled");
} }
else else {
{
print img_picto('', 'warning').' '.$langs->trans("APCCacheInstalledButDisabled"); print img_picto('', 'warning').' '.$langs->trans("APCCacheInstalledButDisabled");
} }
} }
@ -163,8 +158,7 @@ if (ini_get('opcache.preload'))
print '<strong>'.$langs->trans("PreloadOPCode").'</strong>: '; print '<strong>'.$langs->trans("PreloadOPCode").'</strong>: ';
print ini_get('opcache.preload'); print ini_get('opcache.preload');
} }
else else {
{
print '<br>'; print '<br>';
print '<strong>'.$langs->trans("PreloadOPCode").'</strong>: '; print '<strong>'.$langs->trans("PreloadOPCode").'</strong>: ';
print $langs->trans("No"); print $langs->trans("No");
@ -469,8 +463,7 @@ if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli')
{ {
print img_picto('', 'tick.png').' '.$langs->trans("YouUseBestDriver", $conf->db->type); print img_picto('', 'tick.png').' '.$langs->trans("YouUseBestDriver", $conf->db->type);
} }
else else {
{
print img_picto('', 'warning.png').' '.$langs->trans("YouDoNotUseBestDriver", $conf->db->type, 'mysqli'); print img_picto('', 'warning.png').' '.$langs->trans("YouDoNotUseBestDriver", $conf->db->type, 'mysqli');
} }
print '<br>'; print '<br>';
@ -496,13 +489,11 @@ if ($resql)
{ {
print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUCT_DONOTSEARCH_ANYWHERE'); print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUCT_DONOTSEARCH_ANYWHERE');
} }
else else {
{
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices")); print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"));
} }
} }
else else {
{
print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ProductsOrServices")); print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"));
} }
print '<br>'; print '<br>';
@ -526,13 +517,11 @@ if ($resql)
{ {
print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_DONOTSEARCH_ANYWHERE'); print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_DONOTSEARCH_ANYWHERE');
} }
else else {
{
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties")); print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties"));
} }
} }
else else {
{
print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ThirdParties")); print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ThirdParties"));
} }
print '<br>'; print '<br>';
@ -546,8 +535,7 @@ if (!in_array($conf->browser->name, array('chrome', 'opera', 'safari', 'firefox'
{ {
print img_picto('', 'warning.png').' '.$langs->trans("BrowserIsKO", $conf->browser->name); print img_picto('', 'warning.png').' '.$langs->trans("BrowserIsKO", $conf->browser->name);
} }
else else {
{
print img_picto('', 'tick.png').' '.$langs->trans("BrowserIsOK", $conf->browser->name); print img_picto('', 'tick.png').' '.$langs->trans("BrowserIsOK", $conf->browser->name);
} }
print '<br>'; print '<br>';

View File

@ -90,8 +90,7 @@ elseif (versioncompare(versionphparray(), $arrayphpminversionwarning) < 0)
{ {
print '<img src="'.$WarningPicturePath.'" alt="Warning"> '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionwarning)); print '<img src="'.$WarningPicturePath.'" alt="Warning"> '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionwarning));
} }
else else {
{
print '<img src="'.$OkayPicturePath.'" alt="Ok"> '.versiontostring(versionphparray()); print '<img src="'.$OkayPicturePath.'" alt="Ok"> '.versiontostring(versionphparray());
} }
@ -103,8 +102,7 @@ if (!isset($_GET["testget"]) && !isset($_POST["testpost"]) && !isset($_GET["main
print '<img src="'.$WarningPicturePath.'" alt="Warning"> '.$langs->trans("PHPSupportPOSTGETKo"); print '<img src="'.$WarningPicturePath.'" alt="Warning"> '.$langs->trans("PHPSupportPOSTGETKo");
print ' (<a href="'.$_SERVER["PHP_SELF"].'?testget=ok">'.$langs->trans("Recheck").'</a>)'; print ' (<a href="'.$_SERVER["PHP_SELF"].'?testget=ok">'.$langs->trans("Recheck").'</a>)';
} }
else else {
{
print '<img src="'.$OkayPicturePath.'" alt="Ok"> '.$langs->trans("PHPSupportPOSTGETOk"); print '<img src="'.$OkayPicturePath.'" alt="Ok"> '.$langs->trans("PHPSupportPOSTGETOk");
} }
@ -115,8 +113,7 @@ if (!function_exists("session_id"))
{ {
print '<img src="'.$ErrorPicturePath.'" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupportSessions"); print '<img src="'.$ErrorPicturePath.'" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupportSessions");
} }
else else {
{
print '<img src="'.$OkayPicturePath.'" alt="Ok"> '.$langs->trans("PHPSupportSessions"); print '<img src="'.$OkayPicturePath.'" alt="Ok"> '.$langs->trans("PHPSupportSessions");
} }
@ -127,8 +124,7 @@ if (!function_exists("utf8_encode"))
{ {
print '<img src="'.$WarningPicturePath.'" alt="Warning"> '.$langs->trans("ErrorPHPDoesNotSupportUTF8"); print '<img src="'.$WarningPicturePath.'" alt="Warning"> '.$langs->trans("ErrorPHPDoesNotSupportUTF8");
} }
else else {
{
print '<img src="'.$OkayPicturePath.'" alt="Ok"> '.$langs->trans("PHPSupportUTF8"); print '<img src="'.$OkayPicturePath.'" alt="Ok"> '.$langs->trans("PHPSupportUTF8");
} }
@ -229,8 +225,7 @@ foreach ($phparray as $key => $value)
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }
else else {
{
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$keyparam.'</td>'; print '<td>'.$keyparam.'</td>';
$i = 0; $i = 0;
@ -346,8 +341,7 @@ function getTableColumn($name, array $list)
{ {
$html .= '<img src="../../theme/eldy/img/tick.png" alt="Ok">'; $html .= '<img src="../../theme/eldy/img/tick.png" alt="Ok">';
} }
else else {
{
$html .= '<img src="../../theme/eldy/img/warning.png" alt="Warning">'; $html .= '<img src="../../theme/eldy/img/warning.png" alt="Warning">';
} }
@ -382,8 +376,7 @@ function getTableColumnFunction(array $functions)
{ {
$html .= '<img src="../../theme/eldy/img/tick.png" alt="Ok">'; $html .= '<img src="../../theme/eldy/img/tick.png" alt="Ok">';
} }
else else {
{
$html .= '<img src="../../theme/eldy/img/warning.png" alt="Warning">'; $html .= '<img src="../../theme/eldy/img/warning.png" alt="Warning">';
} }

View File

@ -109,16 +109,14 @@ xdebug.auto_trace=0
Allow Remote debug=yes or prompt<br>'."\n"; Allow Remote debug=yes or prompt<br>'."\n";
print "<br>\n"; print "<br>\n";
} }
else else {
{
print socket_strerror(socket_last_error()); print socket_strerror(socket_last_error());
echo "Failed to connect to address=".$address." port=".$port."<br>\n"; echo "Failed to connect to address=".$address." port=".$port."<br>\n";
echo "There is no Remote debug server at this address.\n"; echo "There is no Remote debug server at this address.\n";
} }
socket_close($socket); socket_close($socket);
} }
else else {
{
print "Can't test if PHPDebug is OK as PHP socket functions are not enabled."; print "Can't test if PHPDebug is OK as PHP socket functions are not enabled.";
} }

View File

@ -131,8 +131,7 @@ if (empty($mysoc->tva_assuj))
{ {
print $langs->trans("YourCompanyDoesNotUseVAT").'<br>'; print $langs->trans("YourCompanyDoesNotUseVAT").'<br>';
} }
else else {
{
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
@ -151,8 +150,7 @@ else
print $langs->trans("NotAvailableWhenAjaxDisabled"); print $langs->trans("NotAvailableWhenAjaxDisabled");
print "</td>"; print "</td>";
} }
else else {
{
print '<td width="120">'; print '<td width="120">';
$listval = array( $listval = array(
'0'=>$langs->trans(""), '0'=>$langs->trans(""),
@ -206,8 +204,7 @@ else
print $langs->trans("OnPayment"); print $langs->trans("OnPayment");
print ' ('.$langs->trans("SupposedToBePaymentDate").')'; print ' ('.$langs->trans("SupposedToBePaymentDate").')';
} }
else else {
{
print $langs->trans("OnDelivery"); print $langs->trans("OnDelivery");
print ' ('.$langs->trans("SupposedToBeInvoiceDate").')'; print ' ('.$langs->trans("SupposedToBeInvoiceDate").')';
} }
@ -218,8 +215,7 @@ else
print $langs->trans("OnPayment"); print $langs->trans("OnPayment");
print ' ('.$langs->trans("SupposedToBePaymentDate").')'; print ' ('.$langs->trans("SupposedToBePaymentDate").')';
} }
else else {
{
print $langs->trans("OnDelivery"); print $langs->trans("OnDelivery");
print ' ('.$langs->trans("SupposedToBeInvoiceDate").')'; print ' ('.$langs->trans("SupposedToBeInvoiceDate").')';
} }
@ -233,8 +229,7 @@ else
print $langs->trans("OnPayment"); print $langs->trans("OnPayment");
print ' ('.$langs->trans("SupposedToBePaymentDate").')'; print ' ('.$langs->trans("SupposedToBePaymentDate").')';
} }
else else {
{
print $langs->trans("OnInvoice"); print $langs->trans("OnInvoice");
print ' ('.$langs->trans("InvoiceDateUsed").')'; print ' ('.$langs->trans("InvoiceDateUsed").')';
} }
@ -245,8 +240,7 @@ else
print $langs->trans("OnPayment"); print $langs->trans("OnPayment");
print ' ('.$langs->trans("SupposedToBePaymentDate").')'; print ' ('.$langs->trans("SupposedToBePaymentDate").')';
} }
else else {
{
print $langs->trans("OnInvoice"); print $langs->trans("OnInvoice");
print ' ('.$langs->trans("InvoiceDateUsed").')'; print ' ('.$langs->trans("InvoiceDateUsed").')';
} }

View File

@ -64,8 +64,7 @@ if ($action == 'updateMask') {
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} elseif ($action == 'setmod') { } elseif ($action == 'setmod') {

Some files were not shown because too many files have changed in this diff Show More