From c57e7ebdba7dc585ce2c31394edcdccdde3b502a Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Tue, 19 Sep 2023 13:33:25 +0200 Subject: [PATCH] New updating for edit NRC in skills tabs --- htdocs/hrm/skill_tab.php | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/htdocs/hrm/skill_tab.php b/htdocs/hrm/skill_tab.php index 738bee72fe2..a8972e2d3c6 100644 --- a/htdocs/hrm/skill_tab.php +++ b/htdocs/hrm/skill_tab.php @@ -113,6 +113,15 @@ if (empty($reshook)) { } } + // update national_registration_number + if ($action == 'setnational_registration_number') { + $object->national_registration_number = (string) GETPOST('national_registration_number', 'alphanohtml'); + $result = $object->update($user); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + } + if ($action == 'addSkill') { $error = 0; @@ -314,9 +323,21 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''."\n"; // National Registration Number - print ''.$langs->trans("NationalRegistrationNumber").''; - print ''; - print showValueWithClipboardCPButton(!empty($object->national_registration_number) ? $object->national_registration_number : ''); + print ''.$langs->trans("NationalRegistrationNumber").' '.img_picto($langs->trans("Edit"), 'edit').''; + print ''; + if ($action == 'editnational_registration_number') { + $ret = '
'; + $ret .= ''; + $ret .= ''; + $ret .= ''; + $ret .= ''; + $ret .= ' '; + $ret .= ''; + $ret .= '
'; + print $ret; + } else { + print $object->national_registration_number; + } print ''; print ''."\n"; }