How to add company field in admin console (new user) in Alfresco Community?

cancel
Showing results for 
Search instead for 
Did you mean: 
nwali
Established Member

How to add company field in admin console (new user) in Alfresco Community?

Jump to solution

I'm using Alfresco Community 5.0.d and I tried the adding multiple user with all details using Uploading multiple users | Alfresco Documentation. This worked like a charm and showed all details.

But when I tried to add single new user from admin console, I do not get company fields.

So far I came across the users.js file at /Applications/alfresco-5.0.d/tomcat/webapps/share/components/console but not able to add the company name field.

How could I add this field/fields to user I'm creating from admin console?

Also I want when admin update the user info then company field to be shown there as well.

Thanks.

1 Solution

Accepted Solutions
nwali
Established Member

Re: How to add company field in admin console (new user) in Alfresco Community?

Jump to solution

Added a field in new user form.

In users.get.properties file

Add label.companyname=Company

In users.js file

Added fields -create-company label and input like below at different location

            For input box : form.addValidation(parent.id + "-create-companyname",

Alfresco.forms.validation.mandatory, null, "keyup"); 

            For setting the value to personObj : organisation: fnGetter("-create-companyname"),

            For clearing the input field : fnClearEl("-create-companyname");

In users.get.html.ftl

Added div for -create-company

<div class="field-row">

   <span class="crud-label">${msg("label.companyname")}: *</span>

</div>

<div class="field-row">

   <input class="crud-input" id="${el}-create-companyname" type="text" maxlength="100" />

</div>

This way you can add the field to new form. 

Similarly, you can show the company field in edit form of user (in which by default company field is not editable)

View solution in original post

1 Reply
nwali
Established Member

Re: How to add company field in admin console (new user) in Alfresco Community?

Jump to solution

Added a field in new user form.

In users.get.properties file

Add label.companyname=Company

In users.js file

Added fields -create-company label and input like below at different location

            For input box : form.addValidation(parent.id + "-create-companyname",

Alfresco.forms.validation.mandatory, null, "keyup"); 

            For setting the value to personObj : organisation: fnGetter("-create-companyname"),

            For clearing the input field : fnClearEl("-create-companyname");

In users.get.html.ftl

Added div for -create-company

<div class="field-row">

   <span class="crud-label">${msg("label.companyname")}: *</span>

</div>

<div class="field-row">

   <input class="crud-input" id="${el}-create-companyname" type="text" maxlength="100" />

</div>

This way you can add the field to new form. 

Similarly, you can show the company field in edit form of user (in which by default company field is not editable)