mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-13 03:12:35 +01:00
Debug v18
This commit is contained in:
@@ -199,7 +199,7 @@ class Form
|
||||
* @param string $value Value to show/edit
|
||||
* @param object $object Object (that we want to show)
|
||||
* @param boolean $perm Permission to allow button to edit parameter
|
||||
* @param string $typeofdata Type of data ('string' by default, 'checkbox', 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols%', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datehourpicker', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select;xkey:xval,ykey:yval,...')
|
||||
* @param string $typeofdata Type of data ('string' by default, 'checkbox', 'email', 'phone', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols%', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datehourpicker', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select;xkey:xval,ykey:yval,...')
|
||||
* @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of numeric value, or a select combo). Use '' to use same than $value
|
||||
* @param object $extObject External object ???
|
||||
* @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
|
||||
@@ -257,7 +257,7 @@ class Form
|
||||
if (empty($notabletag)) {
|
||||
$ret .= '<tr><td>';
|
||||
}
|
||||
if (preg_match('/^(string|safehtmlstring|email|url)/', $typeofdata)) {
|
||||
if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) {
|
||||
$tmp = explode(':', $typeofdata);
|
||||
$ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>';
|
||||
} elseif (preg_match('/^(integer)/', $typeofdata)) {
|
||||
@@ -339,13 +339,15 @@ class Form
|
||||
}
|
||||
$ret .= '</form>' . "\n";
|
||||
} else {
|
||||
if (preg_match('/^(email)/', $typeofdata)) {
|
||||
if (preg_match('/^email/', $typeofdata)) {
|
||||
$ret .= dol_print_email($value, 0, 0, 0, 0, 1);
|
||||
} elseif (preg_match('/^phone/', $typeofdata)) {
|
||||
$ret .= dol_print_phone($value, '_blank', 32, 1);
|
||||
} elseif (preg_match('/^url/', $typeofdata)) {
|
||||
$ret .= dol_print_url($value, '_blank', 32, 1);
|
||||
} elseif (preg_match('/^(amount|numeric)/', $typeofdata)) {
|
||||
$ret .= ($value != '' ? price($value, '', $langs, 0, -1, -1, $conf->currency) : '');
|
||||
} elseif (preg_match('/^(checkbox)/', $typeofdata)) {
|
||||
} elseif (preg_match('/^checkbox/', $typeofdata)) {
|
||||
$tmp = explode(':', $typeofdata);
|
||||
$ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>';
|
||||
} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) {
|
||||
@@ -391,6 +393,7 @@ class Form
|
||||
}
|
||||
}
|
||||
|
||||
// Custom format if parameter $formatfunc has been provided
|
||||
if ($formatfunc && method_exists($object, $formatfunc)) {
|
||||
$ret = $object->$formatfunc($ret);
|
||||
}
|
||||
|
||||
@@ -211,6 +211,15 @@ if ($action == 'setpersonal_mobile' && $canadduser && !$cancel) {
|
||||
}
|
||||
}
|
||||
|
||||
// update accountancy_code
|
||||
if ($action == 'setaccountancy_code' && $canadduser && !$cancel) {
|
||||
$object->accountancy_code = (string) GETPOST('accountancy_code', 'alphanohtml');
|
||||
$result = $object->update($user);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// update ref_employee
|
||||
if ($action == 'setref_employee' && $canadduser && !$cancel) {
|
||||
$object->ref_employee = (string) GETPOST('ref_employee', 'alphanohtml');
|
||||
@@ -482,7 +491,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
|
||||
print '<td>';
|
||||
print $form->editfieldkey("UserPersonalEmail", 'personal_email', $object->personal_email, $object, $user->hasRight('user', 'user', 'creer') || $user->rights->hrm->write_personal_information->write);
|
||||
print '</td><td>';
|
||||
print $form->editfieldval("UserPersonalEmail", 'personal_email', $object->personal_email, $object, $user->hasRight('user', 'user', 'creer') || $user->rights->hrm->write_personal_information->write, 'email', '', null, null, '', 0, 'dol_print_email');
|
||||
print $form->editfieldval("UserPersonalEmail", 'personal_email', $object->personal_email, $object, $user->hasRight('user', 'user', 'creer') || $user->rights->hrm->write_personal_information->write, 'email', '', null, null, '', 0, '');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@@ -493,7 +502,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
|
||||
print '<td>';
|
||||
print $form->editfieldkey("UserPersonalMobile", 'personal_mobile', $object->personal_mobile, $object, $user->hasRight('user', 'user', 'creer') || $user->rights->hrm->write_personal_information->write);
|
||||
print '</td><td>';
|
||||
print $form->editfieldval("UserPersonalMobile", 'personal_mobile', $object->personal_mobile, $object, $user->hasRight('user', 'user', 'creer') || $user->rights->hrm->write_personal_information->write, 'string', '', null, null, '', 0, 'dol_print_phone');
|
||||
print $form->editfieldval("UserPersonalMobile", 'personal_mobile', $object->personal_mobile, $object, $user->hasRight('user', 'user', 'creer') || $user->rights->hrm->write_personal_information->write, 'phone', '', null, null, '', 0, '');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@@ -548,8 +557,13 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
|
||||
|
||||
// Accountancy code
|
||||
if (isModEnabled('accounting')) {
|
||||
print '<tr><td>'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td>'.$object->accountancy_code.'</td></tr>';
|
||||
print '<tr class="nowrap">';
|
||||
print '<td>';
|
||||
print $form->editfieldkey("AccountancyCode", 'accountancy_code', $object->accountancy_code, $object, $user->hasRight('user', 'user', 'creer'));
|
||||
print '</td><td>';
|
||||
print $form->editfieldval("AccountancyCode", 'accountancy_code', $object->accountancy_code, $object, $user->hasRight('user', 'user', 'creer'), 'string', '', null, null, '', 0, '');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Employee Number
|
||||
|
||||
Reference in New Issue
Block a user