项目作者: mo-azfar

项目描述 :
Add another field at OTRS Customer Portal Registration / Sign-Up Page
高级语言: Perl
项目地址: git://github.com/mo-azfar/OTRS-Customer-Portal-Additional-SignUp-Field.git
创建时间: 2020-10-29T06:13:24Z
项目社区:https://github.com/mo-azfar/OTRS-Customer-Portal-Additional-SignUp-Field

开源协议:GNU General Public License v3.0

下载


OTRS-Customer-Portal-Additional-SignUp-Field

  • Based on OTRS CE 6.0.30
  • Add another field at OTRS Customer Portal Registration / Sign-Up Page

paypal

1) For example, UserMobile and UserCountry field (based on Config.pm / Defaults.pm),

  1. [ 'UserMobile', Translatable('Mobile'), 'mobile', 1, 0, 'var', '', 0, undef, undef ],
  2. [ 'UserCountry', Translatable('Country'), 'country', 1, 0, 'var', '', 0, undef, undef ],

2) For Mobile field, since this field is text input field,

  1. a) at Custom/Kernel/Output/HTML/Templates/Standard/CustomerLogin.tt,
  2. inside Signup div
  3. ***Input name and id must be same with the definition at Config mapping (e.g: Mobile)!!.***
  4. ***You may want to build additional css class to check on validation value.***
  5. <!-- BEGIN ADDITIONAL FIELD -->
  6. <div class="NewLine">
  7. <label for="Mobile">[% Translate("Mobile Number") | html %]</label>
  8. <input title="[% Translate("Your mobile number") | html %]" type="text" name="Mobile" id="Mobile" class="W50pc" value="[% Data.UserMobile | html %]"/>
  9. </div>
  10. <!-- END ADDITIONAL FIELD -->

3) For Country, I may want to make it as dropdown selection.

  1. a) So, defined it first in Custom/Kernel/Output/HTML/Layout.pm
  2. Just before this block,
  3. $Self->Block(
  4. Name => 'CreateAccountLink',
  5. Data => \%Param,
  6. );
  7. Add,
  8. #BEGIN ADDITIONAL FIELD
  9. my $CountryRef = [
  10. 'Malaysia',
  11. 'Singapore',
  12. 'Indonesia',
  13. 'Thailand',
  14. ];
  15. ##***Input name and id must be same with the definition at Config mapping (e.g: Country)!!***
  16. $Param{UserCountry} = $Self->BuildSelection(
  17. Data => $CountryRef,
  18. Name => 'Country', # name of element
  19. ID => 'Country', # (optional) the HTML ID for this element, if not provided, the name will be used as ID as well
  20. SelectedID => '',
  21. Class => 'Validate_Required Modernize W50pc',
  22. PossibleNone => 1,
  23. Title => 'Your Country',
  24. Multiple => 0, # (optional) default 0 (0|1)
  25. Size => 1, # (optional) default 1 element size
  26. TreeView => 0, # (optional) default 0 (0|1)
  27. );
  28. #END ADDITIONAL FIELD
  29. b) at Custom/Kernel/Output/HTML/Templates/Standard/CustomerLogin.tt,
  30. inside Signup div
  31. <!-- BEGIN ADDITIONAL FIELD -->
  32. <div class="NewLine">
  33. [% Data.UserCountry %]
  34. </div>
  35. <!-- END ADDITIONAL FIELD -->

4) (Optional) Manually update $OTRS_HOME/var/httpd/htdocs/skins/Customer/default/css/Core.Login.css

  1. Increase height for example 400px for #Slider and #PreLogin. Play around with the css to suit your need.

5) All modified files has been tag with BEGIN ADDITIONAL FIELD and END ADDITIONAL FIELD

1.png

2.png

3.png

4.png