mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 09:08:09 +01:00
Clean code
This commit is contained in:
@@ -325,7 +325,7 @@ if (!getDolGlobalString('MAIN_DISABLE_METEO') || getDolGlobalInt('MAIN_DISABLE_M
|
||||
$str_mode_enabled = $str_mode_percentage;
|
||||
}
|
||||
print '<br><a href="#" onclick="return false;" id="change_mode">'.$str_mode_enabled.'</a>';
|
||||
print '<input type="hidden" id="MAIN_USE_METEO_WITH_PERCENTAGE" name="MAIN_USE_METEO_WITH_PERCENTAGE" value="'.(getDolGlobalString('MAIN_USE_METEO_WITH_PERCENTAGE') ? $conf->global->MAIN_USE_METEO_WITH_PERCENTAGE : '').'" />';
|
||||
print '<input type="hidden" id="MAIN_USE_METEO_WITH_PERCENTAGE" name="MAIN_USE_METEO_WITH_PERCENTAGE" value="'.getDolGlobalString('MAIN_USE_METEO_WITH_PERCENTAGE').'" />';
|
||||
|
||||
print '<br><br>';
|
||||
} else {
|
||||
|
||||
@@ -219,7 +219,7 @@ if ($action == 'edit') {
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"), $langs->trans("ParameterActiveForNextInputOnly"));
|
||||
print '</td><td align="right">'.(isset($conf->global->$mainroundingruletot) ? $conf->global->$mainroundingruletot : (getDolGlobalString('MAIN_ROUNDING_RULE_TOT') ? $conf->global->MAIN_ROUNDING_RULE_TOT : '')).'</td></tr>';
|
||||
print '</td><td align="right">'.(isset($conf->global->$mainroundingruletot) ? $conf->global->$mainroundingruletot : getDolGlobalString('MAIN_ROUNDING_RULE_TOT')).'</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
@@ -165,7 +165,7 @@ print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MAIN_PROXY_USE").'</td><td class="right">';
|
||||
print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
print $form->selectyesno('MAIN_PROXY_USE', (getDolGlobalString('MAIN_PROXY_USE') ? $conf->global->MAIN_PROXY_USE : 0), 1);
|
||||
print $form->selectyesno('MAIN_PROXY_USE', getDolGlobalInt('MAIN_PROXY_USE'), 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@@ -174,7 +174,7 @@ print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MAIN_PROXY_HOST").'</td><td class="right">';
|
||||
print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
print '<input class="flat" name="MAIN_PROXY_HOST" type="text" size="16" value="'.(getDolGlobalString('MAIN_PROXY_HOST') ? $conf->global->MAIN_PROXY_HOST : '').'">';
|
||||
print '<input class="flat" name="MAIN_PROXY_HOST" type="text" size="16" value="'.getDolGlobalString('MAIN_PROXY_HOST').'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@@ -183,7 +183,7 @@ print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MAIN_PROXY_PORT").'</td><td class="right">';
|
||||
print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
print '<input class="flat" name="MAIN_PROXY_PORT" type="text" size="4" value="'.(getDolGlobalString('MAIN_PROXY_PORT') ? $conf->global->MAIN_PROXY_PORT : '').'">';
|
||||
print '<input class="flat" name="MAIN_PROXY_PORT" type="text" size="4" value="'.getDolGlobalInt('MAIN_PROXY_PORT').'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@@ -192,7 +192,7 @@ print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MAIN_PROXY_USER").'</td><td class="right">';
|
||||
print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
print '<input class="flat" name="MAIN_PROXY_USER" type="text" size="16" value="'.(getDolGlobalString('MAIN_PROXY_USER') ? $conf->global->MAIN_PROXY_USER : '').'">';
|
||||
print '<input class="flat" name="MAIN_PROXY_USER" type="text" size="16" value="'.getDolGlobalString('MAIN_PROXY_USER').'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@@ -201,7 +201,7 @@ print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MAIN_PROXY_PASS").'</td><td class="right">';
|
||||
print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
print '<input class="flat" name="MAIN_PROXY_PASS" type="text" size="16" value="'.(getDolGlobalString('MAIN_PROXY_PASS') ? $conf->global->MAIN_PROXY_PASS : '').'">';
|
||||
print '<input class="flat" name="MAIN_PROXY_PASS" type="password" size="16" value="'.getDolGlobalString('MAIN_PROXY_PASS').'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ if (empty($mysoc->tva_assuj)) {
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven"><td><label for="deadline_day_vat">'.$langs->trans("DeadlineDayVATSubmission").'</label></td><td>';
|
||||
print '<input placeholder="'.$langs->trans("Example").':21" name="deadline_day_vat" id="deadline_day_vat" class="minwidth200" value="'.(getDolGlobalString('MAIN_INFO_TVA_DAY_DEADLINE_SUBMISSION') ? $conf->global->MAIN_INFO_TVA_DAY_DEADLINE_SUBMISSION : '').'">';
|
||||
print '<input placeholder="'.$langs->trans("Example").':21" name="deadline_day_vat" id="deadline_day_vat" class="minwidth200" value="'.getDolGlobalString('MAIN_INFO_TVA_DAY_DEADLINE_SUBMISSION').'">';
|
||||
print '</td></tr>';
|
||||
|
||||
$key = 'CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT';
|
||||
|
||||
@@ -2545,7 +2545,7 @@ if ($action == 'create') {
|
||||
print '<td class="valuefieldcreate">';
|
||||
print img_picto('', 'pdf', 'class="pictofixedwidth"');
|
||||
$liste = ModelePDFPropales::liste_modeles($db);
|
||||
$preselected = (getDolGlobalString('PROPALE_ADDON_PDF_ODT_DEFAULT') ? $conf->global->PROPALE_ADDON_PDF_ODT_DEFAULT : getDolGlobalString("PROPALE_ADDON_PDF"));
|
||||
$preselected = getDolGlobalString('PROPALE_ADDON_PDF_ODT_DEFAULT', getDolGlobalString("PROPALE_ADDON_PDF"));
|
||||
print $form->selectarray('model', $liste, $preselected, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth200 widthcentpercentminusx', 1);
|
||||
print "</td></tr>";
|
||||
|
||||
@@ -2562,7 +2562,7 @@ if ($action == 'create') {
|
||||
print '<tr class="field_note_public">';
|
||||
print '<td class="titlefieldcreate tdtop">' . $langs->trans('NotePublic') . '</td>';
|
||||
print '<td class="valuefieldcreate">';
|
||||
$note_public = $object->getDefaultCreateValueFor('note_public', (!empty($objectsrc) ? $objectsrc->note_public : (getDolGlobalString('PROPALE_ADDON_NOTE_PUBLIC_DEFAULT') ? $conf->global->PROPALE_ADDON_NOTE_PUBLIC_DEFAULT : null)), 'restricthtml');
|
||||
$note_public = $object->getDefaultCreateValueFor('note_public', (!empty($objectsrc) ? $objectsrc->note_public : getDolGlobalString('PROPALE_ADDON_NOTE_PUBLIC_DEFAULT', null), 'restricthtml');
|
||||
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PUBLIC') ? 0 : 1, ROWS_3, '90%');
|
||||
print $doleditor->Create(1);
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ if (isModEnabled('project')) {
|
||||
|
||||
if ($object->id > 0) {
|
||||
// Load object modContract
|
||||
$module = (getDolGlobalString('CONTRACT_ADDON') ? $conf->global->CONTRACT_ADDON : 'mod_contract_serpis');
|
||||
$module = getDolGlobalString('CONTRACT_ADDON', 'mod_contract_serpis');
|
||||
if (substr($module, 0, 13) == 'mod_contract_' && substr($module, -3) == 'php') {
|
||||
$module = substr($module, 0, dol_strlen($module) - 4);
|
||||
}
|
||||
|
||||
@@ -1142,7 +1142,7 @@ if (isModEnabled('project')) {
|
||||
}
|
||||
|
||||
// Load object modContract
|
||||
$module = (getDolGlobalString('CONTRACT_ADDON') ? $conf->global->CONTRACT_ADDON : 'mod_contract_serpis');
|
||||
$module = getDolGlobalString('CONTRACT_ADDON', 'mod_contract_serpis');
|
||||
if (substr($module, 0, 13) == 'mod_contract_' && substr($module, -3) == 'php') {
|
||||
$module = substr($module, 0, dol_strlen($module) - 4);
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ if (empty($reshook)) {
|
||||
$form = new Form($db);
|
||||
|
||||
// Load object modContract
|
||||
$module = (getDolGlobalString('CONTRACT_ADDON') ? $conf->global->CONTRACT_ADDON : 'mod_contract_serpis');
|
||||
$module = getDolGlobalString('CONTRACT_ADDON', 'mod_contract_serpis');
|
||||
if (substr($module, 0, 13) == 'mod_contract_' && substr($module, -3) == 'php') {
|
||||
$module = substr($module, 0, dol_strlen($module) - 4);
|
||||
}
|
||||
|
||||
@@ -711,7 +711,7 @@ class FormMail extends Form
|
||||
|
||||
// Add also company main email
|
||||
if (getDolGlobalString('MAIN_INFO_SOCIETE_MAIL')) {
|
||||
$s = (!getDolGlobalString('MAIN_INFO_SOCIETE_NOM') ? $conf->global->MAIN_INFO_SOCIETE_EMAIL : $conf->global->MAIN_INFO_SOCIETE_NOM).' <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
|
||||
$s = getDolGlobalString('MAIN_INFO_SOCIETE_NOM', getDolGlobalString('MAIN_INFO_SOCIETE_EMAIL')).' <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
|
||||
$liste['company'] = array('label' => $s, 'data-html' => $s);
|
||||
}
|
||||
|
||||
|
||||
@@ -776,7 +776,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
||||
print '<td>'.$langs->trans("LeftMenuBackgroundColor").'</td>';
|
||||
print '<td colspan="'.($colspan - 1).'">';
|
||||
if ($edit) {
|
||||
print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_VERMENU_BACK1') ? $conf->global->THEME_ELDY_VERMENU_BACK1 : ''), array()), ''), 'THEME_ELDY_VERMENU_BACK1', '', 1, array(), '', 'colorbackvmenu1', $default).' ';
|
||||
print $formother->selectColor(colorArrayToHex(colorStringToArray(getDolGlobalString('THEME_ELDY_VERMENU_BACK1'), array()), ''), 'THEME_ELDY_VERMENU_BACK1', '', 1, array(), '', 'colorbackvmenu1', $default).' ';
|
||||
} else {
|
||||
$color = colorArrayToHex(colorStringToArray(getDolGlobalString('THEME_ELDY_VERMENU_BACK1'), array()), '');
|
||||
if ($color) {
|
||||
@@ -990,7 +990,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
||||
print '<td>'.$langs->trans("LinkColor").'</td>';
|
||||
print '<td colspan="'.($colspan - 1).'">';
|
||||
if ($edit) {
|
||||
print $formother->selectColor(colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_TEXTLINK') ? $conf->global->THEME_ELDY_TEXTLINK : ''), array()), ''), 'THEME_ELDY_TEXTLINK', '', 1, array(), '', 'colortextlink', $default).' ';
|
||||
print $formother->selectColor(colorArrayToHex(colorStringToArray(getDolGlobalString('THEME_ELDY_TEXTLINK'), array()), ''), 'THEME_ELDY_TEXTLINK', '', 1, array(), '', 'colortextlink', $default).' ';
|
||||
} else {
|
||||
$color = colorArrayToHex(colorStringToArray(getDolGlobalString('THEME_ELDY_TEXTLINK'), array()), '');
|
||||
if ($color) {
|
||||
@@ -1031,14 +1031,14 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
||||
if (getDolGlobalString('THEME_ELDY_USE_HOVER') == '1') {
|
||||
$color = colorArrayToHex(colorStringToArray($colorbacklinepairhover));
|
||||
} else {
|
||||
$color = colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_USE_HOVER') ? $conf->global->THEME_ELDY_USE_HOVER : ''), array()), '');
|
||||
$color = colorArrayToHex(colorStringToArray(getDolGlobalString('THEME_ELDY_USE_HOVER'), array()), '');
|
||||
}
|
||||
print $formother->selectColor($color, 'THEME_ELDY_USE_HOVER', '', 1, array(), '', 'colorbacklinepairhover', $default).' ';
|
||||
} else {
|
||||
if (getDolGlobalString('THEME_ELDY_USE_HOVER') == '1') {
|
||||
$color = colorArrayToHex(colorStringToArray($colorbacklinepairhover));
|
||||
} else {
|
||||
$color = colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_USE_HOVER') ? $conf->global->THEME_ELDY_USE_HOVER : ''), array()), '');
|
||||
$color = colorArrayToHex(colorStringToArray(getDolGlobalString('THEME_ELDY_USE_HOVER'), array()), '');
|
||||
}
|
||||
if ($color) {
|
||||
if ($color != colorArrayToHex(colorStringToArray($colorbacklinepairhover))) {
|
||||
@@ -1079,14 +1079,14 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
||||
if (getDolGlobalString('THEME_ELDY_USE_CHECKED') == '1') {
|
||||
$color = 'e6edf0';
|
||||
} else {
|
||||
$color = colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_USE_CHECKED') ? $conf->global->THEME_ELDY_USE_CHECKED : ''), array()), '');
|
||||
$color = colorArrayToHex(colorStringToArray(getDolGlobalString('THEME_ELDY_USE_CHECKED'), array()), '');
|
||||
}
|
||||
print $formother->selectColor($color, 'THEME_ELDY_USE_CHECKED', '', 1, array(), '', 'colorbacklinepairchecked', $default).' ';
|
||||
} else {
|
||||
if (getDolGlobalString('THEME_ELDY_USE_CHECKED') == '1') {
|
||||
$color = 'e6edf0';
|
||||
} else {
|
||||
$color = colorArrayToHex(colorStringToArray((getDolGlobalString('THEME_ELDY_USE_CHECKED') ? $conf->global->THEME_ELDY_USE_CHECKED : ''), array()), '');
|
||||
$color = colorArrayToHex(colorStringToArray(getDolGlobalString('THEME_ELDY_USE_CHECKED'), array()), '');
|
||||
}
|
||||
if ($color) {
|
||||
if ($color != 'e6edf0') {
|
||||
|
||||
@@ -259,7 +259,7 @@ if ($massaction == 'presend') {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
$formmail->withform = -1;
|
||||
$formmail->fromtype = (GETPOST('fromtype') ? GETPOST('fromtype') : (getDolGlobalString('MAIN_MAIL_DEFAULT_FROMTYPE') ? $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE : 'user'));
|
||||
$formmail->fromtype = (GETPOST('fromtype') ? GETPOST('fromtype') : getDolGlobalString('MAIN_MAIL_DEFAULT_FROMTYPE', 'user'));
|
||||
|
||||
if ($formmail->fromtype === 'user') {
|
||||
$formmail->fromid = $user->id;
|
||||
|
||||
@@ -778,7 +778,7 @@ if (getDolGlobalInt('MAIN_MULTILANGS')) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ViewProductDescInThirdpartyLanguageAbility").'</td>';
|
||||
print '<td class="right">';
|
||||
print $form->selectyesno("activate_viewProdTextsInThirdpartyLanguage", (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') ? $conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE : 0), 1);
|
||||
print $form->selectyesno("activate_viewProdTextsInThirdpartyLanguage", getDolGlobalInt('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE'), 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@@ -1644,7 +1644,7 @@ if ($ispaymentok) {
|
||||
$cc = ($cc ? ', ' : '').$attendeetovalidate->email_company;
|
||||
}
|
||||
|
||||
$from = getDolGlobalString('MAILING_EMAIL_FROM') ? $conf->global->MAILING_EMAIL_FROM : getDolGlobalString("MAIN_MAIL_EMAIL_FROM");
|
||||
$from = getDolGlobalString('MAILING_EMAIL_FROM', getDolGlobalString("MAIN_MAIL_EMAIL_FROM"));
|
||||
|
||||
$urlback = $_SERVER["REQUEST_URI"];
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ print "</tr>";
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="fieldrequired">'.$langs->trans("KeyForWebServicesAccess").'</td>';
|
||||
print '<td><input type="text" class="flat" id="WEBSERVICES_KEY" name="WEBSERVICES_KEY" value="'.(GETPOST('WEBSERVICES_KEY') ? GETPOST('WEBSERVICES_KEY') : (getDolGlobalString('WEBSERVICES_KEY') ? $conf->global->WEBSERVICES_KEY : '')).'" size="40">';
|
||||
print '<td><input type="text" class="flat width300" id="WEBSERVICES_KEY" name="WEBSERVICES_KEY" value="'.(GETPOST('WEBSERVICES_KEY') ? GETPOST('WEBSERVICES_KEY') : getDolGlobalString('WEBSERVICES_KEY')).'">';
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user