diff --git a/ext/admin/employees/lib.js b/ext/admin/employees/lib.js
index 3a266173..1f7e0c77 100644
--- a/ext/admin/employees/lib.js
+++ b/ext/admin/employees/lib.js
@@ -447,6 +447,43 @@ EmployeeAdapter.method('renderEmployee', function(data) {
$("#"+this.getTableName()+" #profile_image_"+data.id).attr('src',data.image);
+
+ var sectionTemplate = '
';
+ var sectionId = '';
+ var sectionHtml = '';
+ //Add custom fields
+ if(data.customFields != undefined && data.customFields != null && Object.keys(data.customFields).length > 0) {
+
+
+ var ct = '';
+ var customFieldHtml;
+ for (index in data.customFields) {
+
+ if(!data.customFields[index][1]){
+ data.customFields[index][1] = 'Other Details';
+ }
+
+ sectionId = data.customFields[index][1].toLocaleLowerCase();
+ sectionId = sectionId.replace(' ','_');
+
+ if($("#cont_"+sectionId).length <= 0){
+ //Add section
+ sectionHtml = sectionTemplate;
+ sectionHtml = sectionHtml.replace('#_section_#', sectionId);
+ sectionHtml = sectionHtml.replace('#_section.name_#', data.customFields[index][1]);
+ $("#customFieldsCont").append($(sectionHtml));
+ }
+
+ customFieldHtml = ct;
+ customFieldHtml = customFieldHtml.replace('#_label_#', index);
+ customFieldHtml = customFieldHtml.replace('#_value_#', data.customFields[index][0]);
+ $("#cont_"+sectionId).append($(customFieldHtml));
+ }
+ }else{
+ $("#customFieldsCont").remove();
+ }
+
+
this.cancel();
if(!this.isModuleInstalled("admin","documents")) {
diff --git a/ext/modules/employees/customTemplates/myDetails.html b/ext/modules/employees/customTemplates/myDetails.html
index e3775212..77dba539 100644
--- a/ext/modules/employees/customTemplates/myDetails.html
+++ b/ext/modules/employees/customTemplates/myDetails.html
@@ -167,14 +167,7 @@
@@ -214,4 +207,4 @@
-
\ No newline at end of file
+
diff --git a/ext/modules/employees/lib.js b/ext/modules/employees/lib.js
index 6af59380..1ed4686d 100644
--- a/ext/modules/employees/lib.js
+++ b/ext/modules/employees/lib.js
@@ -292,13 +292,31 @@ EmployeeAdapter.method('modEmployeeGetSuccessCallBack' , function(data) {
//Add custom fields
if(data.customFields != undefined && data.customFields != null && Object.keys(data.customFields).length > 0) {
+
+
var ct = '';
var customFieldHtml;
for (index in data.customFields) {
+
+ if(!data.customFields[index][1]){
+ data.customFields[index][1] = 'Other Details';
+ }
+
+ sectionId = data.customFields[index][1].toLocaleLowerCase();
+ sectionId = sectionId.replace(' ','_');
+
+ if($("#cont_"+sectionId).length <= 0){
+ //Add section
+ sectionHtml = sectionTemplate;
+ sectionHtml = sectionHtml.replace('#_section_#', sectionId);
+ sectionHtml = sectionHtml.replace('#_section.name_#', data.customFields[index][1]);
+ $("#customFieldsCont").append($(sectionHtml));
+ }
+
customFieldHtml = ct;
customFieldHtml = customFieldHtml.replace('#_label_#', index);
- customFieldHtml = customFieldHtml.replace('#_value_#', data.customFields[index]);
- $("#customFields").append($(customFieldHtml));
+ customFieldHtml = customFieldHtml.replace('#_value_#', data.customFields[index][0]);
+ $("#cont_"+sectionId).append($(customFieldHtml));
}
}else{
$("#customFieldsCont").remove();
diff --git a/readme.md b/readme.md
index b75117ca..4c0643d4 100644
--- a/readme.md
+++ b/readme.md
@@ -533,10 +533,10 @@ Release note v18.0
* Allow indirect admins to allow travel requests
* Adding more languages to Language meta data table
* Improvements to report module
- *
+ * Ability to select sections for placing custom fields on employee detail view screen
### Fixes
- * Fix: suvordinates are not showing beyond first page issue.
+ * Fix: subordinates are not showing beyond first page issue.
Release note v16.1