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