PageRenderTime 126ms CodeModel.GetById 42ms RepoModel.GetById 1ms app.codeStats 1ms

/templates/controllers/grid/settings/user/form/userForm.tpl

https://github.com/mbehiels/omp
Smarty Template | 214 lines | 203 code | 3 blank | 8 comment | 2 complexity | 3e7f52f1d484c11266f811bf537d3ac5 MD5 | raw file
  1. {**
  2. * controllers/grid/settings/user/form/userForm.tpl
  3. *
  4. * Copyright (c) 2003-2011 John Willinsky
  5. * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
  6. *
  7. * Form for creating/editing a user.
  8. *}
  9. <script type="text/javascript">
  10. $(function() {ldelim}
  11. $('#userForm').pkpHandler(
  12. '$.pkp.controllers.grid.settings.user.form.UserFormHandler',
  13. {ldelim}
  14. fetchUsernameSuggestionUrl: '{url|escape:"javascript" router=$smarty.const.ROUTE_COMPONENT op="suggestUsername" params=$suggestUsernameParams escape=false}',
  15. usernameSuggestionTextAlert: '{translate key="grid.user.mustProvideName"}',
  16. existingInterests: {literal}[{/literal}{foreach name=existingInterests from=$existingInterests item=interest}"{$interest|escape|escape:"javascript"}"{if !$smarty.foreach.existingInterests.last}, {/if}{/foreach}{literal}]{/literal},
  17. currentInterests: {literal}[{/literal}{foreach name=interestsKeywords from=$interestsKeywords item=interest}"{$interest|escape|escape:"javascript"}"{if !$smarty.foreach.interestsKeywords.last}, {/if}{/foreach}{literal}]{/literal}
  18. {rdelim}
  19. );
  20. {rdelim});
  21. </script>
  22. {if !$userId}
  23. {assign var="passwordRequired" value="true"}
  24. {/if} {* !$userId *}
  25. <form class="pkp_form" id="userForm" method="post" action="{url router=$smarty.const.ROUTE_COMPONENT component="grid.settings.user.UserGridHandler" op="updateUser"}">
  26. <div id="userFormContainer">
  27. <div id="userDetails" class="full left">
  28. {if $userId}
  29. <h3>{translate key="grid.user.userDetails"}</h3>
  30. {else}
  31. <h3>{translate key="grid.user.step1"}</h3>
  32. {/if}
  33. {if $userId}
  34. <input type="hidden" id="userId" name="userId" value="{$userId|escape}" />
  35. {/if}
  36. {include file="controllers/notification/inPlaceNotification.tpl" notificationId="userFormNotification"}
  37. </div>
  38. <div id="userFormCompactLeftContainer" class="half pkp_helpers_align_left">
  39. {fbvFormArea id="userFormCompactLeft"}
  40. {fbvFormSection title="user.firstName" required="true" for="firstName"}
  41. {fbvElement type="text" name="firstName" id="firstName" value=$firstName maxlength="40" size=$fbvStyles.size.MEDIUM}
  42. {/fbvFormSection}
  43. {fbvFormSection title="user.middleName" for="middleName"}
  44. {fbvElement type="text" name="middleName" id="middleName" value=$middleName maxlength="40" size=$fbvStyles.size.MEDIUM}
  45. {/fbvFormSection}
  46. {fbvFormSection title="user.lastName" required="true" for="lastName"}
  47. {fbvElement type="text" name="lastName" id="lastName" value=$lastName maxlength="90" size=$fbvStyles.size.MEDIUM}
  48. {/fbvFormSection}
  49. {fbvFormSection title="user.email" required="true" for="email"}
  50. {fbvElement type="text" name="email" id="email" value=$email maxlength="90" size=$fbvStyles.size.MEDIUM}
  51. {/fbvFormSection}
  52. {if !$userId}
  53. {fbvFormSection title="user.username" required="true" for="username"}
  54. {fbvElement type="text" name="username" id="username" value=$username maxlength="32" size=$fbvStyles.size.MEDIUM}
  55. &nbsp;&nbsp;{fbvElement type="button" id="suggestUsernameButton" label="common.suggest" class="default"}
  56. <br />
  57. <span class="instruct">{translate key="user.register.usernameRestriction"}</span>
  58. {/fbvFormSection}
  59. {else}
  60. {fbvFormSection title="user.username" suppressId="true"}
  61. {$username|escape}
  62. {/fbvFormSection}
  63. {/if}
  64. {if !$implicitAuth && !$userId}
  65. {fbvFormSection title="grid.user.notifyUser" for="sendNotify" list=true}
  66. {if $sendNotify}
  67. {assign var="checked" value="1"}
  68. {else}
  69. {assign var="checked" value=""}
  70. {/if}
  71. {fbvElement type="checkbox" name="sendNotify" id="sendNotify" checked=$checked label="grid.user.notifyUserDescription" translate="true"}
  72. {/fbvFormSection}
  73. {/if} {* !$implicitAuth && !$userId *}
  74. {if $authSourceOptions}
  75. {fbvFormSection title="grid.user.authSource" for="authId"}
  76. {fbvElement type="select" name="authId" id="authId" defaultLabel="" defaultValue="" from=$authSourceOptions translate="true" selected=$authId}
  77. {/fbvFormSection}
  78. {/if}
  79. {/fbvFormArea}
  80. </div>
  81. <div id="userFormCompactRightContainer" class="half pkp_helpers_align_left">
  82. {fbvFormArea id="userFormCompactRight"}
  83. {if !$implicitAuth}
  84. {fbvFormSection title="user.password" required=$passwordRequired for="password"}
  85. {fbvElement type="text" name="password" id="password" password="true" value=$password maxlength="32" size=$fbvStyles.size.MEDIUM}
  86. <br />
  87. <span class="instruct">{translate key="user.register.passwordLengthRestriction" length=$minPasswordLength}</span>
  88. {/fbvFormSection}
  89. {fbvFormSection title="user.repeatPassword" required=$passwordRequired for="password2"}
  90. {fbvElement type="text" name="password2" id="password2" password="true" value=$password2 maxlength="32" size=$fbvStyles.size.MEDIUM}
  91. {/fbvFormSection}
  92. {if $userId}
  93. {fbvFormSection suppressId="true"}
  94. {translate key="user.register.passwordLengthRestriction" length=$minPasswordLength}
  95. <br />
  96. {translate key="user.profile.leavePasswordBlank"}
  97. {/fbvFormSection}
  98. {else}
  99. {fbvFormSection title="grid.user.generatePassword" for="generatePassword" list=true}
  100. {if $generatePassword}
  101. {assign var="checked" value="1"}
  102. {else}
  103. {assign var="checked" value="0"}
  104. {/if}
  105. {fbvElement type="checkbox" name="generatePassword" id="generatePassword" checked=$checked label="grid.user.generatePasswordDescription" translate="true"}
  106. {/fbvFormSection}
  107. {/if}{* $userId *}
  108. {fbvFormSection title="grid.user.mustChangePassword" for="mustChangePassword" list=true}
  109. {if $mustChangePassword}
  110. {assign var="checked" value="1"}
  111. {else}
  112. {assign var="checked" value=""}
  113. {/if}
  114. {fbvElement type="checkbox" name="mustChangePassword" id="mustChangePassword" checked=$checked label="grid.user.mustChangePasswordDescription" translate="true"}
  115. {/fbvFormSection}
  116. {/if}{* !$implicitAuth *}
  117. {/fbvFormArea}
  118. </div>
  119. {capture assign="extraContent"}
  120. <div id="userFormExtendedContainer" class="full left">
  121. <div id="userFormExtendedLeftContainer" class="half pkp_helpers_align_left">
  122. {fbvFormArea id="userFormExtendedLeft"}
  123. {fbvFormSection title="user.salutation" for="salutation"}
  124. {fbvElement type="text" name="salutation" id="salutation" value=$salutation maxlength="40" size=$fbvStyles.size.MEDIUM}
  125. {/fbvFormSection}
  126. {fbvFormSection title="user.gender" for="gender" suppressId="true"}
  127. {fbvElement type="select" name="gender" id="gender" defaultLabel="" defaultValue="" from=$genderOptions translate="true" selected=$gender size=$fbvStyles.size.MEDIUM}
  128. {/fbvFormSection}
  129. {fbvFormSection title="user.initials" for="initials"}
  130. {fbvElement type="text" name="initials" id="initials" value=$initials maxlength="5" size=$fbvStyles.size.MEDIUM}
  131. {/fbvFormSection}
  132. {fbvFormSection title="user.url" for="userUrl"}
  133. {fbvElement type="text" name="userUrl" id="userUrl" value=$userUrl maxlength="90" size=$fbvStyles.size.MEDIUM}
  134. {/fbvFormSection}
  135. {fbvFormSection title="user.phone" for="phone"}
  136. {fbvElement type="text" name="phone" id="phone" value=$phone maxlength="24" size=$fbvStyles.size.MEDIUM}
  137. {/fbvFormSection}
  138. {fbvFormSection title="user.fax" for="fax"}
  139. {fbvElement type="text" name="fax" id="fax" value=$fax maxlength="24" size=$fbvStyles.size.MEDIUM}
  140. {/fbvFormSection}
  141. {if count($availableLocales) > 1}
  142. {fbvFormSection title="user.workingLanguages" list=true}
  143. {foreach from=$availableLocales key=localeKey item=localeName}
  144. {if $userLocales && in_array($localeKey, $userLocales)}
  145. {assign var="checked" value="true"}
  146. {else}
  147. {assign var="checked" value="false"}
  148. {/if}
  149. {fbvElement type="checkbox" name="userLocales[]" id="userLocales-$localeKey" value="$localeKey" checked=$checked label="$localeName" translate=false }
  150. {/foreach}
  151. {/fbvFormSection}
  152. {/if}
  153. {fbvFormSection title="user.interests" for="interests"}
  154. <ul id="interests"><li></li></ul><span class="interestDescription">{fieldLabel for="interests" key="user.interests.description"}</span><br />
  155. <textarea name="interests" id="interestsTextOnly" class="textArea small">
  156. {foreach name=currentInterests from=$interestsKeywords item=interest}
  157. {$interest|escape}
  158. {if !$smarty.foreach.currentInterests.last}, {/if}
  159. {/foreach}
  160. </textarea>
  161. {/fbvFormSection}
  162. {fbvFormSection title="common.mailingAddress" for="mailingAddress"}
  163. {fbvElement type="textarea" name="mailingAddress" id="mailingAddress" value=$mailingAddress size=$fbvStyles.size.MEDIUM}
  164. {/fbvFormSection}
  165. {fbvFormSection title="common.country" for="country"}
  166. {fbvElement type="select" name="country" id="country" defaultLabel="" defaultValue="" from=$countries selected=$country translate="0" size=$fbvStyles.size.MEDIUM}
  167. {/fbvFormSection}
  168. {/fbvFormArea}
  169. </div>
  170. <div id="userFormExtendedRightContainer" class="half pkp_helpers_align_left"
  171. {fbvFormArea id="userFormExtendedRight"}
  172. {fbvFormSection title="user.affiliation" for="affiliation"}
  173. {fbvElement type="textarea" multilingual="true" name="affiliation" id="affiliation" value=$affiliation size=$fbvStyles.size.MEDIUM}
  174. <br />
  175. <span class="instruct">{translate key="user.affiliation.description"}</span>
  176. {/fbvFormSection}
  177. {fbvFormSection title="user.signature" for="signature"}
  178. {fbvElement type="textarea" multilingual="true" name="signature" id="signature" value=$signature size=$fbvStyles.size.MEDIUM}
  179. {/fbvFormSection}
  180. {fbvFormSection title="user.biography" for="biography"}
  181. {fbvElement type="textarea" multilingual="true" name="biography" id="biography" value=$biography size=$fbvStyles.size.MEDIUM}
  182. <br />
  183. <span class="instruct">{translate key="user.biography.description"}</span>
  184. {/fbvFormSection}
  185. {fbvFormSection title="user.gossip" for="gossip"}
  186. {fbvElement type="textarea" multilingual="true" name="gossip" id="gossip" value=$gossip size=$fbvStyles.size.MEDIUM}
  187. {/fbvFormSection}
  188. {/fbvFormArea}
  189. </div>
  190. </div>
  191. {/capture}
  192. <div id="userExtraFormFields" class="left full">
  193. {include file="controllers/extrasOnDemand.tpl"
  194. widgetWrapper="#userExtraFormFields"
  195. moreDetailsText="grid.user.moreDetails"
  196. lessDetailsText="grid.user.lessDetails"
  197. extraContent=$extraContent
  198. }
  199. </div>
  200. {if $userId}
  201. <div id="userRoles" class="full left">
  202. <h3>{translate key="grid.user.userRoles"}</h3>
  203. <div id="userRolesContainer" class="full left">
  204. {url|assign:userRolesUrl router=$smarty.const.ROUTE_COMPONENT component="listbuilder.users.UserUserGroupListbuilderHandler" op="fetch" userId=$userId title="grid.user.addRoles" escape=false}
  205. {load_url_in_div id="userRolesContainer" url=$userRolesUrl}
  206. </div>
  207. </div>
  208. {/if}
  209. {fbvFormButtons}
  210. </div>
  211. </form>