mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Clean code, fix warnings
This commit is contained in:
parent
e02aa8ab60
commit
ea42fc7605
|
|
@ -640,7 +640,8 @@ if ($id) {
|
|||
foreach ($fieldlist as $field => $value) {
|
||||
$showfield = 1;
|
||||
$class = "left";
|
||||
$valuetoshow = $obj->{$fieldlist[$field]};
|
||||
$tmpvar = $fieldlist[$field];
|
||||
$valuetoshow = $obj->$tmpvar;
|
||||
if ($value == 'type_template') {
|
||||
$valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -751,7 +751,8 @@ if ($resql) {
|
|||
foreach ($fieldlist as $field => $value) {
|
||||
$showfield = 1;
|
||||
$class = "left";
|
||||
$valuetoshow = $obj->{$fieldlist[$field]};
|
||||
$tmpvar = $fieldlist[$field];
|
||||
$valuetoshow = $obj->$tmpvar;
|
||||
if ($value == 'category_type') {
|
||||
$valuetoshow = yn($valuetoshow);
|
||||
} elseif ($valuetoshow == 'all') {
|
||||
|
|
|
|||
|
|
@ -587,7 +587,8 @@ if ($id) {
|
|||
foreach ($fieldlist as $field => $value) {
|
||||
$showfield = 1;
|
||||
$class = "left";
|
||||
$valuetoshow = $obj->{$fieldlist[$field]};
|
||||
$tmpvar = $fieldlist[$field];
|
||||
$valuetoshow = $obj->$tmpvar;
|
||||
if ($valuetoshow == 'all') {
|
||||
$valuetoshow = $langs->trans('All');
|
||||
} elseif ($fieldlist[$field] == 'nature' && $tabname[$id] == MAIN_DB_PREFIX.'accounting_journal') {
|
||||
|
|
|
|||
|
|
@ -459,7 +459,7 @@ if ($action == 'edit') {
|
|||
print '</form>';
|
||||
} else {
|
||||
print '<br><br><div class="tabsAction">';
|
||||
print '<a class="butAction" href="delais.php?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||
print '<a class="butAction reposition" href="delais.php?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1944,7 +1944,7 @@ if ($id > 0) {
|
|||
//var_dump($fieldlist);
|
||||
$class = '';
|
||||
$showfield = 1;
|
||||
$valuetoshow = empty($obj->{$value}) ? '' : $obj->{$value};
|
||||
$valuetoshow = empty($obj->$value) ? '' : $obj->$value;
|
||||
$titletoshow = '';
|
||||
|
||||
if ($value == 'entity') {
|
||||
|
|
@ -1985,76 +1985,76 @@ if ($id > 0) {
|
|||
} elseif ($value == 'libelle_facture') {
|
||||
$langs->load("bills");
|
||||
$key = $langs->trans("PaymentCondition".strtoupper($obj->code));
|
||||
$valuetoshow = ($obj->code && $key != "PaymentCondition".strtoupper($obj->code) ? $key : $obj->{$value});
|
||||
$valuetoshow = ($obj->code && $key != "PaymentCondition".strtoupper($obj->code) ? $key : $obj->$value);
|
||||
$valuetoshow = nl2br($valuetoshow);
|
||||
} elseif ($value == 'label' && $tabname[$id] == 'c_country') {
|
||||
$key = $langs->trans("Country".strtoupper($obj->code));
|
||||
$valuetoshow = ($obj->code && $key != "Country".strtoupper($obj->code) ? $key : $obj->{$value});
|
||||
$valuetoshow = ($obj->code && $key != "Country".strtoupper($obj->code) ? $key : $obj->$value);
|
||||
} elseif ($value == 'label' && $tabname[$id] == 'c_availability') {
|
||||
$langs->load("propal");
|
||||
$key = $langs->trans("AvailabilityType".strtoupper($obj->code));
|
||||
$valuetoshow = ($obj->code && $key != "AvailabilityType".strtoupper($obj->code) ? $key : $obj->{$value});
|
||||
$valuetoshow = ($obj->code && $key != "AvailabilityType".strtoupper($obj->code) ? $key : $obj->$value);
|
||||
} elseif ($value == 'libelle' && $tabname[$id] == 'c_actioncomm') {
|
||||
$key = $langs->trans("Action".strtoupper($obj->code));
|
||||
$valuetoshow = ($obj->code && $key != "Action".strtoupper($obj->code) ? $key : $obj->{$value});
|
||||
$valuetoshow = ($obj->code && $key != "Action".strtoupper($obj->code) ? $key : $obj->$value);
|
||||
} elseif (!empty($obj->code_iso) && $value == 'label' && $tabname[$id] == 'c_currencies') {
|
||||
$key = $langs->trans("Currency".strtoupper($obj->code_iso));
|
||||
$valuetoshow = ($obj->code_iso && $key != "Currency".strtoupper($obj->code_iso) ? $key : $obj->{$value});
|
||||
$valuetoshow = ($obj->code_iso && $key != "Currency".strtoupper($obj->code_iso) ? $key : $obj->$value);
|
||||
} elseif ($value == 'libelle' && $tabname[$id] == 'c_typent') {
|
||||
$key = $langs->trans(strtoupper($obj->code));
|
||||
$valuetoshow = ($key != strtoupper($obj->code) ? $key : $obj->{$value});
|
||||
$valuetoshow = ($key != strtoupper($obj->code) ? $key : $obj->$value);
|
||||
} elseif ($value == 'libelle' && $tabname[$id] == 'c_prospectlevel') {
|
||||
$key = $langs->trans(strtoupper($obj->code));
|
||||
$valuetoshow = ($key != strtoupper($obj->code) ? $key : $obj->{$value});
|
||||
$valuetoshow = ($key != strtoupper($obj->code) ? $key : $obj->$value);
|
||||
} elseif ($value == 'label' && $tabname[$id] == 'c_civility') {
|
||||
$key = $langs->trans("Civility".strtoupper($obj->code));
|
||||
$valuetoshow = ($obj->code && $key != "Civility".strtoupper($obj->code) ? $key : $obj->{$value});
|
||||
$valuetoshow = ($obj->code && $key != "Civility".strtoupper($obj->code) ? $key : $obj->$value);
|
||||
} elseif ($value == 'libelle' && $tabname[$id] == 'c_type_contact') {
|
||||
$langs->load('agenda');
|
||||
$key = $langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code));
|
||||
$valuetoshow = ($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code) ? $key : $obj->{$value});
|
||||
$valuetoshow = ($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code) ? $key : $obj->$value);
|
||||
} elseif ($value == 'libelle' && $tabname[$id] == 'c_payment_term') {
|
||||
$langs->load("bills");
|
||||
$key = $langs->trans("PaymentConditionShort".strtoupper($obj->code));
|
||||
$valuetoshow = ($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code) ? $key : $obj->{$value});
|
||||
$valuetoshow = ($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code) ? $key : $obj->$value);
|
||||
} elseif ($value == 'libelle' && $tabname[$id] == 'c_paiement') {
|
||||
$langs->load("bills");
|
||||
$key = $langs->trans("PaymentType".strtoupper($obj->code));
|
||||
$valuetoshow = ($obj->code && $key != "PaymentType".strtoupper($obj->code) ? $key : $obj->{$value});
|
||||
$valuetoshow = ($obj->code && $key != "PaymentType".strtoupper($obj->code) ? $key : $obj->$value);
|
||||
} elseif ($value == 'type' && $tabname[$id] == 'c_paiement') {
|
||||
$payment_type_list = array(0=>$langs->trans('PaymentTypeCustomer'), 1=>$langs->trans('PaymentTypeSupplier'), 2=>$langs->trans('PaymentTypeBoth'));
|
||||
$valuetoshow = $payment_type_list[$valuetoshow];
|
||||
} elseif ($value == 'label' && $tabname[$id] == 'c_input_reason') {
|
||||
$key = $langs->trans("DemandReasonType".strtoupper($obj->code));
|
||||
$valuetoshow = ($obj->code && $key != "DemandReasonType".strtoupper($obj->code) ? $key : $obj->{$value});
|
||||
$valuetoshow = ($obj->code && $key != "DemandReasonType".strtoupper($obj->code) ? $key : $obj->$value);
|
||||
} elseif ($value == 'libelle' && $tabname[$id] == 'c_input_method') {
|
||||
$langs->load("orders");
|
||||
$key = $langs->trans($obj->code);
|
||||
$valuetoshow = ($obj->code && $key != $obj->code) ? $key : $obj->{$value};
|
||||
$valuetoshow = ($obj->code && $key != $obj->code) ? $key : $obj->$value;
|
||||
} elseif ($value == 'libelle' && $tabname[$id] == 'c_shipment_mode') {
|
||||
$langs->load("sendings");
|
||||
$key = $langs->trans("SendingMethod".strtoupper($obj->code));
|
||||
$valuetoshow = ($obj->code && $key != "SendingMethod".strtoupper($obj->code) ? $key : $obj->{$value});
|
||||
$valuetoshow = ($obj->code && $key != "SendingMethod".strtoupper($obj->code) ? $key : $obj->$value);
|
||||
} elseif ($value == 'libelle' && $tabname[$id] == 'c_paper_format') {
|
||||
$key = $langs->trans('PaperFormat'.strtoupper($obj->code));
|
||||
$valuetoshow = ($obj->code && $key != 'PaperFormat'.strtoupper($obj->code) ? $key : $obj->{$value});
|
||||
$valuetoshow = ($obj->code && $key != 'PaperFormat'.strtoupper($obj->code) ? $key : $obj->$value);
|
||||
} elseif ($value == 'label' && $tabname[$id] == 'c_type_fees') {
|
||||
$langs->load('trips');
|
||||
$key = $langs->trans(strtoupper($obj->code));
|
||||
$valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->{$value});
|
||||
$valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->$value);
|
||||
} elseif ($value == 'region_id' || $value == 'country_id') {
|
||||
$showfield = 0;
|
||||
} elseif ($value == 'unicode') {
|
||||
$valuetoshow = $langs->getCurrencySymbol($obj->code, 1);
|
||||
} elseif ($value == 'label' && $tabname[GETPOST("id", 'int')] == 'c_units') {
|
||||
$langs->load("products");
|
||||
$valuetoshow = $langs->trans($obj->{$value});
|
||||
$valuetoshow = $langs->trans($obj->$value);
|
||||
} elseif ($value == 'short_label' && $tabname[GETPOST("id", 'int')] == 'c_units') {
|
||||
$langs->load("products");
|
||||
$valuetoshow = $langs->trans($obj->{$value});
|
||||
$valuetoshow = $langs->trans($obj->$value);
|
||||
} elseif (($value == 'unit') && ($tabname[$id] == 'c_paper_format')) {
|
||||
$key = $langs->trans('SizeUnit'.strtolower($obj->unit));
|
||||
$valuetoshow = ($obj->code && $key != 'SizeUnit'.strtolower($obj->unit) ? $key : $obj->{$value});
|
||||
$valuetoshow = ($obj->code && $key != 'SizeUnit'.strtolower($obj->unit) ? $key : $obj->$value);
|
||||
} elseif ($value == 'localtax1' || $value == 'localtax2') {
|
||||
$class = "center";
|
||||
} elseif ($value == 'localtax1_type') {
|
||||
|
|
@ -2357,7 +2357,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|||
|
||||
foreach ($fieldlist as $field => $value) {
|
||||
if ($value == 'entity') {
|
||||
$withentity = $obj->{$value};
|
||||
$withentity = $obj->$value;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -491,16 +491,16 @@ if ($action == 'edit') {
|
|||
|
||||
if ($val['type'] == 'textarea') {
|
||||
print '<textarea class="flat" name="' . $constname . '" id="' . $constname . '" cols="50" rows="5" wrap="soft">' . "\n";
|
||||
print $conf->global->{$constname};
|
||||
print getDolGlobalString($constname);
|
||||
print "</textarea>\n";
|
||||
} elseif ($val['type'] == 'integer') {
|
||||
print '<input class="flat" name="' . $constname . '" id="' . $constname . '" value="' . $conf->global->$constname . '" type="number" step="1" min="0" max="50" >' . "\n";
|
||||
print '<input class="flat" name="' . $constname . '" id="' . $constname . '" value="' . getDolGlobalString($constname) . '" type="number" step="1" min="0" max="50" >' . "\n";
|
||||
} elseif ($val['type'] == 'html') {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($constname, $conf->global->{$constname}, '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%');
|
||||
$doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%');
|
||||
$doleditor->Create();
|
||||
} elseif ($val['type'] == 'yesno') {
|
||||
print $form->selectyesno($constname, $conf->global->{$constname}, 1);
|
||||
print $form->selectyesno($constname, getDolGlobalString($constname), 1);
|
||||
} elseif (preg_match('/emailtemplate:/', $val['type'])) {
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
|
|
@ -575,9 +575,9 @@ if ($action == 'edit') {
|
|||
print '</td><td>';
|
||||
|
||||
if ($val['type'] == 'textarea') {
|
||||
print dol_nl2br($conf->global->{$constname});
|
||||
print dol_nl2br(getDolGlobalString($constname));
|
||||
} elseif ($val['type']== 'html') {
|
||||
print $conf->global->{$constname};
|
||||
print getDolGlobalString($constname);
|
||||
} elseif ($val['type'] == 'yesno') {
|
||||
print ajax_constantonoff($constname);
|
||||
} elseif (preg_match('/emailtemplate:/', $val['type'])) {
|
||||
|
|
@ -586,14 +586,14 @@ if ($action == 'edit') {
|
|||
|
||||
$tmp = explode(':', $val['type']);
|
||||
|
||||
$template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, $conf->global->{$constname});
|
||||
$template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalString($constname));
|
||||
if ($template<0) {
|
||||
setEventMessages(null, $formmail->errors, 'errors');
|
||||
}
|
||||
print $langs->trans($template->label);
|
||||
} elseif (preg_match('/category:/', $val['type'])) {
|
||||
$c = new Categorie($db);
|
||||
$result = $c->fetch($conf->global->{$constname});
|
||||
$result = $c->fetch(getDolGlobalString($constname));
|
||||
if ($result < 0) {
|
||||
setEventMessages(null, $c->errors, 'errors');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -209,14 +209,14 @@ if ($action == 'edit') {
|
|||
|
||||
if ($val['type'] == 'textarea') {
|
||||
print '<textarea class="flat" name="' . $constname . '" id="' . $constname . '" cols="50" rows="5" wrap="soft">' . "\n";
|
||||
print $conf->global->{$constname};
|
||||
print getDolGlobalString($constname);
|
||||
print "</textarea>\n";
|
||||
} elseif ($val['type'] == 'html') {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($constname, $conf->global->{$constname}, '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%');
|
||||
$doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%');
|
||||
$doleditor->Create();
|
||||
} elseif ($val['type'] == 'yesno') {
|
||||
print $form->selectyesno($constname, $conf->global->{$constname}, 1);
|
||||
print $form->selectyesno($constname, getDolGlobalString($constname), 1);
|
||||
} elseif (preg_match('/emailtemplate:/', $val['type'])) {
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
|
|
@ -275,9 +275,9 @@ if ($action == 'edit') {
|
|||
print '</td><td>';
|
||||
|
||||
if ($val['type'] == 'textarea') {
|
||||
print dol_nl2br($conf->global->{$constname});
|
||||
print dol_nl2br(getDolGlobalString($constname));
|
||||
} elseif ($val['type']== 'html') {
|
||||
print $conf->global->{$constname};
|
||||
print getDolGlobalString($constname);
|
||||
} elseif ($val['type'] == 'yesno') {
|
||||
print ajax_constantonoff($constname);
|
||||
} elseif (preg_match('/emailtemplate:/', $val['type'])) {
|
||||
|
|
@ -286,7 +286,7 @@ if ($action == 'edit') {
|
|||
|
||||
$tmp = explode(':', $val['type']);
|
||||
|
||||
$template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, $conf->global->{$constname});
|
||||
$template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalString($constname));
|
||||
if ($template<0) {
|
||||
setEventMessages(null, $formmail->errors, 'errors');
|
||||
}
|
||||
|
|
@ -304,17 +304,17 @@ if ($action == 'edit') {
|
|||
}
|
||||
print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
|
||||
} elseif (preg_match('/thirdparty_type/', $val['type'])) {
|
||||
if ($conf->global->{$constname}==2) {
|
||||
if (getDolGlobalString($constname)==2) {
|
||||
print $langs->trans("Prospect");
|
||||
} elseif ($conf->global->{$constname}==3) {
|
||||
} elseif (getDolGlobalString($constname)==3) {
|
||||
print $langs->trans("ProspectCustomer");
|
||||
} elseif ($conf->global->{$constname}==1) {
|
||||
} elseif (getDolGlobalInt($constname)==1) {
|
||||
print $langs->trans("Customer");
|
||||
} elseif ($conf->global->{$constname}==0) {
|
||||
} elseif (getDolGlobalInt($constname)==0) {
|
||||
print $langs->trans("NorProspectNorCustomer");
|
||||
}
|
||||
} else {
|
||||
print $conf->global->{$constname};
|
||||
print getDolGlobalString($constname);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1134,7 +1134,8 @@ if ($num) {
|
|||
$align = "";
|
||||
$class = "tddict";
|
||||
$title = '';
|
||||
$valuetoshow = $obj->{$fieldlist[$field]};
|
||||
$tmpvar = $fieldlist[$field];
|
||||
$valuetoshow = $obj->$tmpvar;
|
||||
if ($value == 'label' || $value == 'topic') {
|
||||
if ($langs->trans($valuetoshow) != $valuetoshow) {
|
||||
$valuetoshow = $langs->trans($valuetoshow);
|
||||
|
|
@ -1282,19 +1283,19 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|||
if ($value == 'fk_user') {
|
||||
print '<td>';
|
||||
if ($user->admin) {
|
||||
print $form->select_dolusers(empty($obj->{$value}) ? '' : $obj->{$value}, 'fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 0, '', 0, '', 'minwidth150 maxwidth200');
|
||||
print $form->select_dolusers(empty($obj->$value) ? '' : $obj->$value, 'fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 0, '', 0, '', 'minwidth150 maxwidth200');
|
||||
} else {
|
||||
if ($context == 'add') { // I am not admin and we show the add form
|
||||
print $user->getNomUrl(1); // Me
|
||||
$forcedvalue = $user->id;
|
||||
} else {
|
||||
if ($obj && !empty($obj->{$value}) && $obj->{$value} > 0) {
|
||||
if ($obj && !empty($obj->$value) && $obj->$value > 0) {
|
||||
$fuser = new User($db);
|
||||
$fuser->fetch($obj->{$value});
|
||||
$fuser->fetch($obj->$value);
|
||||
print $fuser->getNomUrl(1);
|
||||
$forcedvalue = $fuser->id;
|
||||
} else {
|
||||
$forcedvalue = $obj->{$value};
|
||||
$forcedvalue = $obj->$value;
|
||||
}
|
||||
}
|
||||
$keyname = $value;
|
||||
|
|
|
|||
|
|
@ -1216,10 +1216,10 @@ if ($mode == 'deploy') {
|
|||
print '<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
jQuery("#fileinstall").on("change", function() {
|
||||
if(this.files[0].size > '.($maxmin * 1024).'){
|
||||
if(this.files[0].size > '.($maxmin * 1024).') {
|
||||
alert("'.dol_escape_js($langs->trans("ErrorFileSizeTooLarge")).'");
|
||||
this.value = "";
|
||||
};
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>'."\n";
|
||||
|
|
|
|||
|
|
@ -113,7 +113,8 @@ if (!count($listofvars) && !count($listofstatus)) {
|
|||
if ($key != $param) {
|
||||
continue;
|
||||
}
|
||||
$val2 = ${$val['var']};
|
||||
$tmpvar = $val['var'];
|
||||
$val2 = ${$tmpvar};
|
||||
$text = 'Should be in line with value of param <b>'.$val['var'].'</b> thas is <b>'.($val2 ? $val2 : "'' (=".$val['valifempty'].")").'</b>';
|
||||
$show = 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -293,14 +293,14 @@ if ($action == 'edit') {
|
|||
|
||||
if ($val['type'] == 'textarea') {
|
||||
print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">' . "\n";
|
||||
print $conf->global->{$constname};
|
||||
print getDolGlobalString($constname);
|
||||
print "</textarea>\n";
|
||||
} elseif ($val['type']== 'html') {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($constname, $conf->global->{$constname}, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%');
|
||||
$doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%');
|
||||
$doleditor->Create();
|
||||
} elseif ($val['type'] == 'yesno') {
|
||||
print $form->selectyesno($constname, $conf->global->{$constname}, 1);
|
||||
print $form->selectyesno($constname, getDolGlobalString($constname), 1);
|
||||
} elseif (preg_match('/emailtemplate:/', $val['type'])) {
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
|
|
@ -382,9 +382,9 @@ if ($action == 'edit') {
|
|||
print '</td><td>';
|
||||
|
||||
if ($val['type'] == 'textarea') {
|
||||
print dol_nl2br($conf->global->{$constname});
|
||||
print dol_nl2br(getDolGlobalString($constname));
|
||||
} elseif ($val['type']== 'html') {
|
||||
print $conf->global->{$constname};
|
||||
print getDolGlobalString($constname);
|
||||
} elseif ($val['type'] == 'yesno') {
|
||||
print ajax_constantonoff($constname);
|
||||
} elseif (preg_match('/emailtemplate:/', $val['type'])) {
|
||||
|
|
@ -393,14 +393,14 @@ if ($action == 'edit') {
|
|||
|
||||
$tmp = explode(':', $val['type']);
|
||||
|
||||
$template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, $conf->global->{$constname});
|
||||
$template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalString($constname));
|
||||
if ($template<0) {
|
||||
setEventMessages(null, $formmail->errors, 'errors');
|
||||
}
|
||||
print $langs->trans($template->label);
|
||||
} elseif (preg_match('/category:/', $val['type'])) {
|
||||
$c = new Categorie($db);
|
||||
$result = $c->fetch($conf->global->{$constname});
|
||||
$result = $c->fetch(getDolGlobalString($constname));
|
||||
if ($result < 0) {
|
||||
setEventMessages(null, $c->errors, 'errors');
|
||||
} elseif ($result > 0 ) {
|
||||
|
|
@ -412,25 +412,25 @@ if ($action == 'edit') {
|
|||
print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
|
||||
}
|
||||
} elseif (preg_match('/thirdparty_type/', $val['type'])) {
|
||||
if ($conf->global->{$constname}==2) {
|
||||
if (getDolGlobalInt($constname)==2) {
|
||||
print $langs->trans("Prospect");
|
||||
} elseif ($conf->global->{$constname}==3) {
|
||||
} elseif (getDolGlobalInt($constname)==3) {
|
||||
print $langs->trans("ProspectCustomer");
|
||||
} elseif ($conf->global->{$constname}==1) {
|
||||
} elseif (getDolGlobalInt($constname)==1) {
|
||||
print $langs->trans("Customer");
|
||||
} elseif ($conf->global->{$constname}==0) {
|
||||
} elseif (getDolGlobalInt($constname)==0) {
|
||||
print $langs->trans("NorProspectNorCustomer");
|
||||
}
|
||||
} elseif ($val['type'] == 'product') {
|
||||
$product = new Product($db);
|
||||
$resprod = $product->fetch($conf->global->{$constname});
|
||||
$resprod = $product->fetch(getDolGlobalInt($constname));
|
||||
if ($resprod > 0) {
|
||||
print $product->ref;
|
||||
} elseif ($resprod < 0) {
|
||||
setEventMessages(null, $object->errors, "errors");
|
||||
}
|
||||
} else {
|
||||
print $conf->global->{$constname};
|
||||
print getDolGlobalString($constname);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -473,14 +473,14 @@ if ($action == 'edit') {
|
|||
|
||||
if ($val['type'] == 'textarea') {
|
||||
print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">' . "\n";
|
||||
print $conf->global->{$constname};
|
||||
print getDolGlobalString($constname);
|
||||
print "</textarea>\n";
|
||||
} elseif ($val['type']== 'html') {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($constname, $conf->global->{$constname}, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%');
|
||||
$doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%');
|
||||
$doleditor->Create();
|
||||
} elseif ($val['type'] == 'yesno') {
|
||||
print $form->selectyesno($constname, $conf->global->{$constname}, 1);
|
||||
print $form->selectyesno($constname, getDolGlobalString($constname), 1);
|
||||
} elseif (preg_match('/emailtemplate:/', $val['type'])) {
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
|
|
@ -500,7 +500,7 @@ if ($action == 'edit') {
|
|||
$arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)) . $moreonlabel;
|
||||
}
|
||||
}
|
||||
print $form->selectarray($constname, $arrayofmessagename, $conf->global->{$constname}, 'None', 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
print $form->selectarray($constname, $arrayofmessagename, getDolGlobalString($constname), 'None', 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
} elseif (preg_match('/category:/', $val['type'])) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
|
|
@ -508,11 +508,11 @@ if ($action == 'edit') {
|
|||
|
||||
$tmp = explode(':', $val['type']);
|
||||
print img_picto('', 'category', 'class="pictofixedwidth"');
|
||||
print $formother->select_categories($tmp[1], $conf->global->{$constname}, $constname, 0, $langs->trans('CustomersProspectsCategoriesShort'));
|
||||
print $formother->select_categories($tmp[1], getDolGlobalString($constname), $constname, 0, $langs->trans('CustomersProspectsCategoriesShort'));
|
||||
} elseif (preg_match('/thirdparty_type/', $val['type'])) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
$formcompany = new FormCompany($db);
|
||||
print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname);
|
||||
print $formcompany->selectProspectCustomerType(getDolGlobalString($constname), $constname);
|
||||
} elseif ($val['type'] == 'securekey') {
|
||||
print '<input required="required" type="text" class="flat" id="'.$constname.'" name="'.$constname.'" value="'.(GETPOST($constname, 'alpha') ?GETPOST($constname, 'alpha') : $conf->global->{$constname}).'" size="40">';
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
|
|
@ -524,11 +524,11 @@ if ($action == 'edit') {
|
|||
print dolJSToSetRandomPassword($constname, 'generate_token'.$constname);
|
||||
} elseif ($val['type'] == 'product') {
|
||||
if (isModEnabled("product") || isModEnabled("service")) {
|
||||
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
|
||||
$selected = getDolGlobalString($constname);
|
||||
$form->select_produits($selected, $constname, '', 0);
|
||||
}
|
||||
} elseif ($val['type'] == 'accountancy_code') {
|
||||
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
|
||||
$selected = getDolGlobalString($constname);
|
||||
if (isModEnabled('accounting')) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
|
@ -537,7 +537,7 @@ if ($action == 'edit') {
|
|||
print '<input name="' . $constname . '" class="maxwidth200" value="' . dol_escape_htmltag($selected) . '">';
|
||||
}
|
||||
} elseif ($val['type'] == 'accountancy_category') {
|
||||
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
|
||||
$selected = getDolGlobalString($constname);
|
||||
if (isModEnabled('accounting')) {
|
||||
print '<input type="text" name="' . $constname . '" list="pcg_type_datalist" value="' . $selected . '">';
|
||||
// autosuggest from existing account types if found
|
||||
|
|
@ -587,9 +587,9 @@ if ($action == 'edit') {
|
|||
print '</td><td>';
|
||||
|
||||
if ($val['type'] == 'textarea') {
|
||||
print dol_nl2br($conf->global->{$constname});
|
||||
print dol_nl2br(getDolGlobalString($constname));
|
||||
} elseif ($val['type']== 'html') {
|
||||
print $conf->global->{$constname};
|
||||
print getDolGlobalString($constname);
|
||||
} elseif ($val['type'] == 'yesno') {
|
||||
print ajax_constantonoff($constname);
|
||||
} elseif (preg_match('/emailtemplate:/', $val['type'])) {
|
||||
|
|
@ -598,14 +598,14 @@ if ($action == 'edit') {
|
|||
|
||||
$tmp = explode(':', $val['type']);
|
||||
|
||||
$template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, $conf->global->{$constname});
|
||||
$template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalString($constname));
|
||||
if ($template<0) {
|
||||
setEventMessages(null, $formmail->errors, 'errors');
|
||||
}
|
||||
print $langs->trans($template->label);
|
||||
} elseif (preg_match('/category:/', $val['type'])) {
|
||||
$c = new Categorie($db);
|
||||
$result = $c->fetch($conf->global->{$constname});
|
||||
$result = $c->fetch(getDolGlobalInt($constname));
|
||||
if ($result < 0) {
|
||||
setEventMessages(null, $c->errors, 'errors');
|
||||
} elseif ($result > 0 ) {
|
||||
|
|
@ -617,18 +617,18 @@ if ($action == 'edit') {
|
|||
print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
|
||||
}
|
||||
} elseif (preg_match('/thirdparty_type/', $val['type'])) {
|
||||
if ($conf->global->{$constname}==2) {
|
||||
if (getDolGlobalInt($constname)==2) {
|
||||
print $langs->trans("Prospect");
|
||||
} elseif ($conf->global->{$constname}==3) {
|
||||
} elseif (getDolGlobalInt($constname)==3) {
|
||||
print $langs->trans("ProspectCustomer");
|
||||
} elseif ($conf->global->{$constname}==1) {
|
||||
} elseif (getDolGlobalInt($constname)==1) {
|
||||
print $langs->trans("Customer");
|
||||
} elseif ($conf->global->{$constname}==0) {
|
||||
} elseif (getDolGlobalInt($constname)==0) {
|
||||
print $langs->trans("NorProspectNorCustomer");
|
||||
}
|
||||
} elseif ($val['type'] == 'product') {
|
||||
$product = new Product($db);
|
||||
$resprod = $product->fetch($conf->global->{$constname});
|
||||
$resprod = $product->fetch(getDolGlobalInt($constname));
|
||||
if ($resprod > 0) {
|
||||
print $product->ref;
|
||||
} elseif ($resprod < 0) {
|
||||
|
|
@ -638,11 +638,11 @@ if ($action == 'edit') {
|
|||
if (isModEnabled('accounting')) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch('', $conf->global->{$constname}, 1);
|
||||
$accountingaccount->fetch('', getDolGlobalString($constname), 1);
|
||||
|
||||
print $accountingaccount->getNomUrl(0, 1, 1, '', 1);
|
||||
} else {
|
||||
print $conf->global->{$constname};
|
||||
print getDolGlobalString($constname);
|
||||
}
|
||||
} else {
|
||||
print $conf->global->{$constname};
|
||||
|
|
|
|||
|
|
@ -1602,7 +1602,7 @@ if ($action == 'create') {
|
|||
$("#select_actioncommsendmodel_mail").closest("tr").show();
|
||||
} else {
|
||||
$("#select_actioncommsendmodel_mail").closest("tr").hide();
|
||||
};
|
||||
}
|
||||
});
|
||||
})';
|
||||
print '</script>'."\n";
|
||||
|
|
@ -2104,7 +2104,7 @@ if ($id > 0) {
|
|||
$("#select_actioncommsendmodel_mail").closest("tr").show();
|
||||
} else {
|
||||
$("#select_actioncommsendmodel_mail").closest("tr").hide();
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
})';
|
||||
|
|
|
|||
|
|
@ -1898,7 +1898,7 @@ if ($action == 'create' && $usercancreate) {
|
|||
if ($soc->fetch_optionals() > 0) {
|
||||
$object->array_options = array_merge($object->array_options, $soc->array_options);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
print $object->showOptionals($extrafields, 'create', $parameters);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -353,10 +353,10 @@ if (GETPOST("account") || GETPOST("ref")) {
|
|||
print "<td>".$refcomp."</td>";
|
||||
if ($tmpobj->total_ttc < 0) {
|
||||
print '<td class="nowrap right">'.price(abs($total_ttc))."</td><td> </td>";
|
||||
};
|
||||
}
|
||||
if ($tmpobj->total_ttc >= 0) {
|
||||
print '<td> </td><td class="nowrap right">'.price($total_ttc)."</td>";
|
||||
};
|
||||
}
|
||||
print '<td class="nowrap right">'.price($solde).'</td>';
|
||||
print "</tr>";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3357,7 +3357,7 @@ if ($action == 'create') {
|
|||
jQuery(".checkforselect").prop("disabled", false);
|
||||
jQuery(".checkforselect").prop("checked", true);
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
</script>';
|
||||
|
||||
|
|
@ -3780,7 +3780,7 @@ if ($action == 'create') {
|
|||
if ($soc->fetch_optionals() > 0) {
|
||||
$object->array_options = array_merge($object->array_options, $soc->array_options);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
print $object->showOptionals($extrafields, 'create', $parameters);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -405,7 +405,7 @@ if ($action == 'create') {
|
|||
$("#label_type_payment").removeClass("fieldrequired");
|
||||
$(".hide_if_no_auto_create_payment").hide();
|
||||
}
|
||||
};
|
||||
}
|
||||
$("#radiopayment").click(function() {
|
||||
$("#label").val($(this).data("label"));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -687,7 +687,7 @@ abstract class CommonDocGenerator
|
|||
$resql = $this->db->fetch_object($resql);
|
||||
|
||||
foreach ($extralabels as $key => $label) {
|
||||
$resarray['line_product_supplier_'.$key] = $resql->{$key};
|
||||
$resarray['line_product_supplier_'.$key] = $resql->$key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8228,7 +8228,7 @@ class Form
|
|||
return {
|
||||
q: params.term, // search term
|
||||
page: params.page
|
||||
};
|
||||
}
|
||||
},
|
||||
processResults: function (data) {
|
||||
// parse the results into the format expected by Select2.
|
||||
|
|
@ -8480,14 +8480,14 @@ class Form
|
|||
$out .= 'function formatResult(record, container) {'."\n";
|
||||
$out .= ' if ($(record.element).attr("data-html") != undefined) return htmlEntityDecodeJs($(record.element).attr("data-html")); // If property html set, we decode html entities and use this'."\n";
|
||||
$out .= ' return record.text;';
|
||||
$out .= '};'."\n";
|
||||
$out .= '}'."\n";
|
||||
$out .= 'function formatSelection(record) {'."\n";
|
||||
if ($elemtype == 'category') {
|
||||
$out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
|
||||
} else {
|
||||
$out .= 'return record.text;';
|
||||
}
|
||||
$out .= '};'."\n";
|
||||
$out .= '}'."\n";
|
||||
$out .= '$(document).ready(function () {
|
||||
$(\'#'.$htmlname.'\').'.$tmpplugin.'({';
|
||||
if ($placeholder) {
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ class FormActions
|
|||
$('.hideifna').show();
|
||||
}
|
||||
else {
|
||||
if (defaultvalue == 50 && (percentage.val() == 0 || percentage.val() == 100)) { percentage.val(50) };
|
||||
if (defaultvalue == 50 && (percentage.val() == 0 || percentage.val() == 100)) { percentage.val(50); }
|
||||
percentage.removeAttr('disabled');
|
||||
$('.hideifna').show();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -690,7 +690,7 @@ class FormCompany extends Form
|
|||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -662,7 +662,7 @@ class FormSetupItem
|
|||
{
|
||||
global $conf;
|
||||
if (isset($conf->global->{$this->confKey})) {
|
||||
$this->fieldValue = $conf->global->{$this->confKey};
|
||||
$this->fieldValue = getDolGlobalString($this->confKey);
|
||||
return true;
|
||||
} else {
|
||||
$this->fieldValue = null;
|
||||
|
|
|
|||
|
|
@ -362,7 +362,7 @@ class FormTicket
|
|||
print '<!-- Script to manage change of ticket group -->
|
||||
<script>
|
||||
jQuery(document).ready(function() {
|
||||
function groupticketchange(){
|
||||
function groupticketchange() {
|
||||
console.log("We called groupticketchange, so we try to load list KM linked to event");
|
||||
$("#KWwithajax").html("");
|
||||
idgroupticket = $("#selectcategory_code").val();
|
||||
|
|
@ -1095,7 +1095,7 @@ class FormTicket
|
|||
$levelid++;
|
||||
foreach ($tabscript as $script) {
|
||||
$stringtoprint .= $script;
|
||||
};
|
||||
}
|
||||
$stringtoprint .='})';
|
||||
$stringtoprint .='</script>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1039,4 +1039,4 @@ class ImportCsv extends ModeleImports
|
|||
function cleansep($value)
|
||||
{
|
||||
return str_replace(array(',', ';'), '/', $value);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -511,7 +511,7 @@ if ((isModEnabled("service") || ($object->element == 'contrat')) && $dateSelecto
|
|||
print $form->selectDate($date_start, 'date_start', empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 0 : 1, empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 0 : 1, 1, "addproduct", 1, 0);
|
||||
print ' '.$langs->trans('to').' ';
|
||||
print $form->selectDate($date_end, 'date_end', empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 0 : 1, empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 0 : 1, 1, "addproduct", 1, 0);
|
||||
};
|
||||
}
|
||||
|
||||
if ($prefillDates) {
|
||||
echo ' <span class="small"><a href="#" id="prefill_service_dates">'.$langs->trans('FillWithLastServiceDates').'</a></span>';
|
||||
|
|
|
|||
|
|
@ -2212,7 +2212,7 @@ if ($action == 'create') {
|
|||
jQuery(".checkforselect").prop("disabled", false);
|
||||
jQuery(".checkforselect").prop("checked", true);
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
</script>';
|
||||
|
||||
|
|
|
|||
|
|
@ -319,11 +319,11 @@ function rate(&$TMergedSkills, $field)
|
|||
foreach ($TMergedSkills as $id => &$sk) {
|
||||
$class = "note";
|
||||
$how_many = 0;
|
||||
if (empty($sk->{$field})) {
|
||||
if (empty($sk->$field)) {
|
||||
$note = 'x';
|
||||
$class .= ' none';
|
||||
} else {
|
||||
$note = $sk->{$field};
|
||||
$note = $sk->$field;
|
||||
$how_many = ($field === 'rate1') ? $sk->how_many_max1 : $sk->how_many_max2;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1354,7 +1354,7 @@ if ($step == 4 && $datatoimport) {
|
|||
print ' $("select.targetselectchange").find(\'option[value="\'+value+\'"]:not(:selected)\').prop("disabled", true);'."\n"; // Set to disabled except if currently selected
|
||||
print ' }'."\n";
|
||||
print ' });'."\n";
|
||||
print '};'."\n";
|
||||
print '}'."\n";
|
||||
|
||||
// Function to save the selection in database
|
||||
print 'function saveSelection() {'."\n";
|
||||
|
|
@ -1402,7 +1402,7 @@ if ($step == 4 && $datatoimport) {
|
|||
}
|
||||
";
|
||||
|
||||
print '};'."\n";
|
||||
print '}'."\n";
|
||||
|
||||
// If we make a change on a selectbox
|
||||
print '$(".targetselectchange").change(function(){'."\n";
|
||||
|
|
|
|||
|
|
@ -806,23 +806,15 @@ function getWeatherStatus($totallate)
|
|||
|
||||
$used_conf = empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? 'MAIN_METEO_LEVEL' : 'MAIN_METEO_PERCENTAGE_LEVEL';
|
||||
|
||||
$level0 = $offset;
|
||||
$weather->level = 0;
|
||||
if (!empty($conf->global->{$used_conf.'0'})) {
|
||||
$level0 = $conf->global->{$used_conf.'0'};
|
||||
}
|
||||
$level0 = $offset;
|
||||
$level0 = getDolGlobalString($used_conf.'0', $level0);
|
||||
$level1 = $offset + 1 * $factor;
|
||||
if (!empty($conf->global->{$used_conf.'1'})) {
|
||||
$level1 = $conf->global->{$used_conf.'1'};
|
||||
}
|
||||
$level1 = getDolGlobalString($used_conf.'1', $level1);
|
||||
$level2 = $offset + 2 * $factor;
|
||||
if (!empty($conf->global->{$used_conf.'2'})) {
|
||||
$level2 = $conf->global->{$used_conf.'2'};
|
||||
}
|
||||
$level2 = getDolGlobalString($used_conf.'2', $level2);
|
||||
$level3 = $offset + 3 * $factor;
|
||||
if (!empty($conf->global->{$used_conf.'3'})) {
|
||||
$level3 = $conf->global->{$used_conf.'3'};
|
||||
}
|
||||
$level3 = getDolGlobalString($used_conf.'3', $level3);
|
||||
|
||||
if ($totallate <= $level0) {
|
||||
$weather->picto = 'weather-clear.png';
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers
|
|||
);
|
||||
|
||||
return call_user_func($callback, $action, $object, $user, $langs, $conf);
|
||||
};
|
||||
}
|
||||
|
||||
// Or you can execute some code here
|
||||
switch ($action) {
|
||||
|
|
|
|||
|
|
@ -615,8 +615,8 @@ class MultiCurrency extends CommonObject
|
|||
|
||||
if ($conf->currency != $conf->global->MULTICURRENCY_APP_SOURCE) {
|
||||
$alternate_source = 'USD'.$conf->currency;
|
||||
if (!empty($TRate->{$alternate_source})) {
|
||||
$coef = $TRate->USDUSD / $TRate->{$alternate_source};
|
||||
if (!empty($TRate->$alternate_source)) {
|
||||
$coef = $TRate->USDUSD / $TRate->$alternate_source;
|
||||
foreach ($TRate as $attr => &$rate) {
|
||||
$rate *= $coef;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1529,7 +1529,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) {
|
|||
otherPrices.show();
|
||||
minPrice1.show();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
showHidePriceRules();
|
||||
|
|
|
|||
|
|
@ -78,12 +78,12 @@ while ($tmpobj = $db->fetch_object($resWar)) {
|
|||
$listofqualifiedwarehousesid .= $tmpobj->rowid;
|
||||
$lastWarehouseID = $tmpobj->rowid;
|
||||
$count++;
|
||||
};
|
||||
}
|
||||
|
||||
//MultiCompany : If only 1 Warehouse is visible, filter will automatically be set to it.
|
||||
if ($count == 1 && (empty($fk_entrepot) || $fk_entrepot <= 0) && !empty($conf->global->MULTICOMPANY_PRODUCT_SHARING_ENABLED)) {
|
||||
$fk_entrepot = $lastWarehouseID;
|
||||
};
|
||||
}
|
||||
|
||||
$texte = '';
|
||||
|
||||
|
|
|
|||
|
|
@ -968,7 +968,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
|||
console.log("Hide opportunities fields "+jQuery("#usage_opportunity").prop("checked"));
|
||||
jQuery(".classuseopportunity").hide();
|
||||
}
|
||||
};
|
||||
}
|
||||
});';
|
||||
print '</script>';
|
||||
print '<br>';
|
||||
|
|
@ -994,7 +994,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
|||
console.log("Hide task fields "+jQuery("#usage_task").prop("checked"));
|
||||
jQuery(".classusetask").hide();
|
||||
}
|
||||
};
|
||||
}
|
||||
});';
|
||||
print '</script>';
|
||||
print '<br>';
|
||||
|
|
@ -1020,7 +1020,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
|||
console.log("Hide bill time fields "+jQuery("#usage_bill_time").prop("checked"));
|
||||
jQuery(".classusebilltime").hide();
|
||||
}
|
||||
};
|
||||
}
|
||||
});';
|
||||
print '</script>';
|
||||
print '<br>';
|
||||
|
|
@ -1046,7 +1046,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
|||
console.log("Hide organize event fields "+jQuery("#usage_organize_event").prop("checked"));
|
||||
jQuery(".classuseorganizeevent").hide();
|
||||
}
|
||||
};
|
||||
}
|
||||
});';
|
||||
print '</script>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1025,7 +1025,8 @@ class Task extends CommonObjectLine
|
|||
if (!empty($extrafields->attributes['projet']['label'])) {
|
||||
foreach ($extrafields->attributes['projet']['label'] as $key => $val) {
|
||||
if ($extrafields->attributes['projet']['type'][$key] != 'separate') {
|
||||
$tasks[$i]->{'options_'.$key} = $obj->{'options_'.$key};
|
||||
$tmpvar = 'options_'.$key;
|
||||
$tasks[$i]->{'options_'.$key} = $obj->$tmpvar;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1033,7 +1034,8 @@ class Task extends CommonObjectLine
|
|||
if (!empty($extrafields->attributes['projet_task']['label'])) {
|
||||
foreach ($extrafields->attributes['projet_task']['label'] as $key => $val) {
|
||||
if ($extrafields->attributes['projet_task']['type'][$key] != 'separate') {
|
||||
$tasks[$i]->{'options_'.$key} = $obj->{'options_'.$key};
|
||||
$tmpvar = 'options_'.$key;
|
||||
$tasks[$i]->{'options_'.$key} = $obj->$tmpvar;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ var vLangs={'<?php print $langs->getDefaultLang(1); ?>':
|
|||
'sunday':'<?php print $langs->transnoentities('Sunday'); ?>','monday':'<?php print $langs->transnoentities('Monday'); ?>','tuesday':'<?php print $langs->transnoentities('Tuesday'); ?>','wednesday':'<?php print $langs->transnoentities('Wednesday'); ?>','thursday':'<?php print $langs->transnoentities('Thursday'); ?>','friday':'<?php print $langs->transnoentities('Friday'); ?>','saturday':'<?php print $langs->transnoentities('Saturday'); ?>',
|
||||
'sun':'<?php print $langs->transnoentities('SundayMin'); ?>','mon':'<?php print $langs->transnoentities('MondayMin'); ?>','tue':'<?php print $langs->transnoentities('TuesdayMin'); ?>','wed':'<?php print $langs->transnoentities('WednesdayMin'); ?>','thu':'<?php print $langs->transnoentities('ThursdayMin'); ?>','fri':'<?php print $langs->transnoentities('FridayMin'); ?>','sat':'<?php print $langs->transnoentities('SaturdayMin'); ?>'
|
||||
}
|
||||
};
|
||||
}
|
||||
var vLang='<?php print $langs->getDefaultLang(1); ?>';
|
||||
<?php
|
||||
if (is_object($db)) {
|
||||
|
|
|
|||
|
|
@ -561,7 +561,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW
|
|||
if (jQuery("#morphy").val() == \'mor\') {
|
||||
jQuery("#trcompany").show();
|
||||
}
|
||||
};
|
||||
}
|
||||
initmorphy();
|
||||
jQuery("#morphy").change(function() {
|
||||
initmorphy();
|
||||
|
|
|
|||
|
|
@ -2395,7 +2395,7 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme
|
|||
color: '#fa755a',
|
||||
iconColor: '#fa755a'
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var cardElement = elements.create('card', {style: style});
|
||||
|
||||
|
|
@ -2435,7 +2435,7 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme
|
|||
?>
|
||||
var cardButton = document.getElementById('buttontopay');
|
||||
var clientSecret = cardButton.dataset.secret;
|
||||
var options = { clientSecret: clientSecret,};
|
||||
var options = { clientSecret: clientSecret };
|
||||
|
||||
// Create an instance of Elements
|
||||
var elements = stripe.elements(options);
|
||||
|
|
@ -2465,7 +2465,7 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme
|
|||
color: '#fa755a',
|
||||
iconColor: '#fa755a'
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
<?php
|
||||
if (getDolGlobalInt('STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION') == 2) {
|
||||
|
|
|
|||
|
|
@ -1381,12 +1381,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
data: function (params) {
|
||||
return {
|
||||
newcompany: params.term // search term
|
||||
};
|
||||
}
|
||||
},
|
||||
processResults: function (data, params) {
|
||||
return {
|
||||
results: data
|
||||
};
|
||||
}
|
||||
},
|
||||
cache: true
|
||||
},
|
||||
|
|
@ -2150,7 +2150,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
{
|
||||
jQuery(".visibleifsupplier").show();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
$("#selectcountry_id").change(function() {
|
||||
document.formsoc.action.value="edit";
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ if (isModEnabled('stock')) {
|
|||
}
|
||||
print '</td></tr>';
|
||||
|
||||
$disabled = $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal};
|
||||
$disabled = getDolGlobalString('CASHDESK_NO_DECREASE_STOCK'.$terminal);
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskIdWareHouse").'</td>'; // Force warehouse (this is not a default value)
|
||||
|
|
|
|||
|
|
@ -956,7 +956,7 @@ $( document ).ready(function() {
|
|||
return {
|
||||
vertical:container.scrollHeight > container.clientHeight,
|
||||
horizontal:container.scrollWidth > container.clientWidth
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
$(window).resize(function(){
|
||||
|
|
|
|||
|
|
@ -174,12 +174,12 @@ if (empty($reshook)) {
|
|||
$bankaccount = GETPOST('accountid', 'int');
|
||||
} else {
|
||||
if ($pay == 'LIQ') {
|
||||
$bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]}; // For backward compatibility
|
||||
$bankaccount = getDolGlobalString('CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]); // For backward compatibility
|
||||
} elseif ($pay == "CHQ") {
|
||||
$bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]}; // For backward compatibility
|
||||
$bankaccount = getDolGlobalString('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]); // For backward compatibility
|
||||
} else {
|
||||
$accountname = "CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takeposterminal"];
|
||||
$bankaccount = $conf->global->$accountname;
|
||||
$bankaccount = getDolGlobalString($accountname);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -217,13 +217,6 @@ if (empty($reshook)) {
|
|||
$invoice->update($user);
|
||||
}
|
||||
|
||||
//$sav_FACTURE_ADDON = '';
|
||||
//if (!empty($conf->global->TAKEPOS_ADDON)) {
|
||||
// $sav_FACTURE_ADDON = $conf->global->FACTURE_ADDON;
|
||||
// if ($conf->global->TAKEPOS_ADDON == "terminal") $conf->global->FACTURE_ADDON = $conf->global->{'TAKEPOS_ADDON'.$_SESSION["takeposterminal"]};
|
||||
// else $conf->global->FACTURE_ADDON = $conf->global->TAKEPOS_ADDON;
|
||||
//}
|
||||
|
||||
$constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"];
|
||||
if ($error) {
|
||||
dol_htmloutput_errors($errormsg, null, 1);
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ if (GETPOST('smp-status')) {
|
|||
print '<script type="application/javascript">
|
||||
window.onload = function() {
|
||||
window.close();
|
||||
};
|
||||
}
|
||||
</script>';
|
||||
|
||||
print "Transaction status registered, you can close this";
|
||||
|
|
|
|||
|
|
@ -3371,24 +3371,36 @@ class User extends CommonObject
|
|||
|
||||
$socialnetworks = getArrayOfSocialNetworks();
|
||||
|
||||
$this->firstname = $ldapuser->{$conf->global->LDAP_FIELD_FIRSTNAME};
|
||||
$this->lastname = $ldapuser->{$conf->global->LDAP_FIELD_NAME};
|
||||
$this->login = $ldapuser->{$conf->global->LDAP_FIELD_LOGIN};
|
||||
$this->pass = $ldapuser->{$conf->global->LDAP_FIELD_PASSWORD};
|
||||
$this->pass_indatabase_crypted = $ldapuser->{$conf->global->LDAP_FIELD_PASSWORD_CRYPTED};
|
||||
$tmpvar = getDolGlobalString('LDAP_FIELD_FIRSTNAME');
|
||||
$this->firstname = $ldapuser->$tmpvar;
|
||||
$tmpvar = getDolGlobalString('LDAP_FIELD_NAME');
|
||||
$this->lastname = $ldapuser->$tmpvar;
|
||||
$tmpvar = getDolGlobalString('LDAP_FIELD_LOGIN');
|
||||
$this->login = $ldapuser->$tmpvar;
|
||||
$tmpvar = getDolGlobalString('LDAP_FIELD_PASSWORD');
|
||||
$this->pass = $ldapuser->$tmpvar;
|
||||
$tmpvar = getDolGlobalString('LDAP_FIELD_PASSWORD_CRYPTED');
|
||||
$this->pass_indatabase_crypted = $ldapuser->$tmpvar;
|
||||
|
||||
$this->office_phone = $ldapuser->{$conf->global->LDAP_FIELD_PHONE};
|
||||
$this->user_mobile = $ldapuser->{$conf->global->LDAP_FIELD_MOBILE};
|
||||
$this->office_fax = $ldapuser->{$conf->global->LDAP_FIELD_FAX};
|
||||
$this->email = $ldapuser->{$conf->global->LDAP_FIELD_MAIL};
|
||||
$tmpvar = getDolGlobalString('LDAP_FIELD_PHONE');
|
||||
$this->office_phone = $ldapuser->$tmpvar;
|
||||
$tmpvar = getDolGlobalString('LDAP_FIELD_MOBILE');
|
||||
$this->user_mobile = $ldapuser->$tmpvar;
|
||||
$tmpvar = getDolGlobalString('LDAP_FIELD_FAX');
|
||||
$this->office_fax = $ldapuser->$tmpvar;
|
||||
$tmpvar = getDolGlobalString('LDAP_FIELD_MAIL');
|
||||
$this->email = $ldapuser->$tmpvar;
|
||||
foreach ($socialnetworks as $key => $value) {
|
||||
$tmpkey = 'LDAP_FIELD_'.strtoupper($value['label']);
|
||||
$this->socialnetworks[$value['label']] = $ldapuser->{$conf->global->$tmpkey};
|
||||
$tmpvar = getDolGlobalString('LDAP_FIELD_'.strtoupper($value['label']));
|
||||
$this->socialnetworks[$value['label']] = $ldapuser->$tmpvar;
|
||||
}
|
||||
$this->ldap_sid = $ldapuser->{$conf->global->LDAP_FIELD_SID};
|
||||
$tmpvar = getDolGlobalString('LDAP_FIELD_SID');
|
||||
$this->ldap_sid = $ldapuser->$tmpvar;
|
||||
|
||||
$this->job = $ldapuser->{$conf->global->LDAP_FIELD_TITLE};
|
||||
$this->note_public = $ldapuser->{$conf->global->LDAP_FIELD_DESCRIPTION};
|
||||
$tmpvar = getDolGlobalString('LDAP_FIELD_TITLE');
|
||||
$this->job = $ldapuser->$tmpvar;
|
||||
$tmpvar = getDolGlobalString('LDAP_FIELD_DESCRIPTION');
|
||||
$this->note_public = $ldapuser->$tmpvar;
|
||||
|
||||
$result = $this->update($user);
|
||||
|
||||
|
|
|
|||
|
|
@ -736,7 +736,7 @@ function getListOfThirdParties($authentication, $filterthirdparty)
|
|||
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label'])) {
|
||||
foreach ($extrafields->attributes[$elementtype]['label'] as $key => $label) {
|
||||
if (isset($obj->{$key})) {
|
||||
$extrafieldsOptions['options_'.$key] = $obj->{$key};
|
||||
$extrafieldsOptions['options_'.$key] = $obj->$key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3294,7 +3294,7 @@ if (!GETPOST('hide_websitemenu')) {
|
|||
}
|
||||
isEditingEnabled = false;
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
</script>';
|
||||
print $langs->trans("EditInLine");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user