1. The forum you are viewing relates to Kayako Classic. If you signed up or upgraded to the new Kayako (after the 4th July 2016), the information in this thread may not apply to you or to your Kayako. You can visit the forums for the new Kayako here.

How to add a selection list for "Title's" under user profile.

Discussion in 'Style and design' started by cxtsupport, Jul 31, 2012.

  1. cxtsupport

    cxtsupport Established Member

    We didn't want customers to be able to freely type their title since we want to be able to report on this consistently. So I edited the "profileform" template to add this selection list.


    <td>
    <!-- <input name="userdesignation" type="text" size="20" value="<{$_userDesignation}>" class="swifttextlarge" /> -->

    <select name="userdesignation" class="swiftselect">
    <option value="<{$_userDesignation}>" selected=""><{$_userDesignation}></option>
    <option value="Employee: Owner / CEO / President">Employee: Owner / CEO / President</option>
    <option value="Employee: IT Department">Employee: IT Department</option>
    <option value="Employee: Manager">Employee: Manager</option>
    <option value="Employee: Sales Representative">Employee: Sales Representative</option>
    <option value="Employee: Other">Employee: Other</option>
    <option value="Employee: Accounting / HR Department">Employee: Accounting / HR Department</option>
    <option value="Employee: CSR / Dispatcher">Employee: CSR / Dispatcher</option>
    <option value="Employee: Vice President">Employee: Vice President</option>
    <option value="Third Party Consultant: IT Support">Third Party Consultant: IT Support</option>
    <option value="Third Party Consultant: Other">Third Party Consultant: Other</option>
    <option value="Third Party Consultant: Programming / Web Design">Third Party Consultant: Programming / Web Design</option>
    <option value="Third Party Consultant: Mobile Vendor">Third Party Consultant: Mobile Vendor</option>
    </select>
    </td>

    Now in order to get this working on the "STAFF" side I added this code to "__Swift\modules\base\staff"


    about line 208:


    // This was added to hold the HTML that will be used to populate
    $_titleHTML = '
    <select name="userdesignation" class="swiftselect">
    <option value="' . $_userDesignation . '" selected="">' . $_userDesignation . '</option>
    <option value="Employee: Owner / CEO / President">Employee: Owner / CEO / President</option>
    <option value="Employee: IT Department">Employee: IT Department</option>
    <option value="Employee: Manager">Employee: Manager</option>
    <option value="Employee: Sales Representative">Employee: Sales Representative</option>
    <option value="Employee: Other">Employee: Other</option>
    <option value="Employee: Accounting / HR Department">Employee: Accounting / HR Department</option>
    <option value="Employee: CSR / Dispatcher">Employee: CSR / Dispatcher</option>
    <option value="Employee: Vice President">Employee: Vice President</option>
    <option value="Third Party Consultant: IT Support">Third Party Consultant: IT Support</option>
    <option value="Third Party Consultant: Other">Third Party Consultant: Other</option>
    <option value="Third Party Consultant: Programming / Web Design">Third Party Consultant: Programming / Web Design</option>
    <option value="Third Party Consultant: Mobile Vendor">Third Party Consultant: Mobile Vendor</option>
    </select>';

    Then modify line 254.. here is my whole section.


    $_GeneralTabObject->DefaultDescriptionRow($this->Language->Get('userfullname'), $this->Language->Get('desc_userfullname'), $_salutationHTML . $_fullNameHTML, '', $_columnClass);
    $_GeneralTabObject->TextAutoComplete('organization', $this->Language->Get('userorganization'), '/Base/UserOrganization/QuickSearch', $this->Language->Get('desc_userorganization'), $_userOrganization, $_userOrganizationAutoComplete, 'icon_userorganization.png');
    // Edited the row below to add in the drop down list of choices from above LINE 208
    $_GeneralTabObject->DefaultDescriptionRow($this->Language->Get('userdesignation'), $this->Language->Get('desc_userdesignation'), $_titleHTML, '', $_columnClass);
    // Old line below
    //$_GeneralTabObject->Text('userdesignation', $this->Language->Get('userdesignation'), $this->Language->Get('desc_userdesignation'), $_userDesignation);

    This essentially creates a pre-defined list of titles that your users can choose from and your staff can choose from. Enjoy!
     
    Gurpreet Singh likes this.

Share This Page