From c57e7ebdba7dc585ce2c31394edcdccdde3b502a Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Tue, 19 Sep 2023 13:33:25 +0200 Subject: [PATCH 1/2] 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"; } From d45627aae40aa30bb0be4ec04033c06c655f5eab Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Wed, 20 Sep 2023 14:22:30 +0200 Subject: [PATCH 2/2] fix problem --- htdocs/hrm/skill_tab.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/skill_tab.php b/htdocs/hrm/skill_tab.php index a8972e2d3c6..83841b6258d 100644 --- a/htdocs/hrm/skill_tab.php +++ b/htdocs/hrm/skill_tab.php @@ -336,7 +336,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $ret .= ''; print $ret; } else { - print $object->national_registration_number; + print showValueWithClipboardCPButton(!empty($object->national_registration_number) ? $object->national_registration_number : ''); } print ''; print ''."\n";