summaryrefslogtreecommitdiff
path: root/UI/Admin/edit_user.html
blob: df166cf77ad2a7c443fe6b151bd532d83bacbab7 (plain)
  1. <?lsmb INCLUDE 'ui-header.html' ?>
  2. <?lsmb PROCESS 'elements.html' ?>
  3. <div id="modify_user">
  4. <font size="15">
  5. <strong>
  6. <?lsmb IF user.user.username ?>
  7. Editing User <?lsmb user.user.username ?>
  8. <?lsmb ELSE?>
  9. New User
  10. <?lsmb END?>
  11. </strong>
  12. </font>
  13. <form method="POST" action="admin.pl">
  14. <input type="hidden" name="action" value="<?lsmb IF user.user.username?>edit_user<?lsmb ELSE?>new_user<?lsmb END?>"/>
  15. <table>
  16. <?lsmb UNLESS user.user.username?>
  17. <tr>
  18. <td>Username</td>
  19. <td>
  20. <input type="textarea" name="username" value="<?lsmb user.user.username?>"/>
  21. </td>
  22. </tr>
  23. <?lsmb END?>
  24. <tr>
  25. <td>
  26. <select name="salutation">
  27. <?lsmb FOREACH sal = salutations ?>
  28. <option value="<?lsmb sal.id?>"><?lsmb sal.salutation?></option>
  29. <?lsmb END?>
  30. </select>
  31. </td>
  32. </tr>
  33. <tr>
  34. <td>First Name</td>
  35. <td>
  36. <input type="textarea" name="first_name" value="<?lsmb user.employee.first_name?>"/>
  37. </td>
  38. </tr>
  39. <tr>
  40. <td>Last Name</td>
  41. <td>
  42. <input type="textarea" name="last_name" value="<?lsmb user.employee.last_name?>"/>
  43. </td>
  44. </tr>
  45. <tr>
  46. <td>Employee #</td>
  47. <td>
  48. <input type="textarea" name="employeenumber" value="<?lsmb user.employee.employeenumber?>"/>
  49. </td>
  50. </tr>
  51. </table>
  52. <input type="submit" value="Save User" />
  53. </form>
  54. <?lsmb IF user.user.username?>
  55. <form name="location" method="POST" action="admin.pl">
  56. <?lsmb IF location?>
  57. <input type="hidden" name="location_id" value="<?lsmb location.id?>"/>
  58. <?lsmb END?>
  59. <input type="hidden" name="action" value="save_location"/>
  60. <input type="hidden" name="user_id" value="<?lsmb user.user.id?>"/>
  61. <table>
  62. <tr>
  63. <td colspan="8">
  64. <hr/>
  65. Location
  66. </td>
  67. </tr>
  68. <tr>
  69. <td></td>
  70. <td>
  71. Address
  72. </td>
  73. <td>
  74. City
  75. </td>
  76. <td>
  77. State/Province
  78. </td>
  79. <td>
  80. Zip/Postal Code
  81. </td>
  82. <td>
  83. Country
  84. </td>
  85. </tr>
  86. <?lsmb FOR location IN user.locations ?>
  87. <tr>
  88. <td>
  89. <a href="admin.pl?action=edit_location&amp;id=<?lsmb location.id?>">Edit</a>
  90. <a href="admin.pl?action=delete_location&amp;id=<?lsmb location.id?>">Delete</a>
  91. <td>
  92. <?lsmb location.line_one?>
  93. <?lsmb location.line_two?>
  94. <?lsmb location.line_three?>
  95. </a>
  96. </td>
  97. <td>
  98. <?lsmb location.city?>
  99. </td>
  100. <td>
  101. <?lsmb location.state?>
  102. </td>
  103. <td>
  104. <?lsmb location.zipcode?>
  105. </td>
  106. <td>
  107. <?lsmb location.country?>
  108. </td>
  109. </tr>
  110. <?lsmb END?>
  111. <!-- The editable one. -->
  112. <tr>
  113. <td></td>
  114. <td>
  115. <input type="textarea" name="address1" value="<?lsmb location.line_one?>"/>
  116. <input type="textarea" name="address2" value="<?lsmb location.line_two?>"/>
  117. <input type="textarea" name="address3" value="<?lsmb location.line_three?>" />
  118. </td>
  119. <td valign="top">
  120. <input type="textarea" name="city" value="<?lsmb location.city?>"/>
  121. </td>
  122. <td valign="top">
  123. <input type="textarea" name="state" value="<?lsmb location.state?>"/>
  124. </td>
  125. <td valign="top">
  126. <input type="textarea" name="zipcode" value="<?lsmb location.zipcode?>"/>
  127. </td>
  128. <td valign="top">
  129. <?lsmb PROCESS select element_data = {
  130. name = "country"
  131. options = countries
  132. default_values = [location.country_id]
  133. value_attr = "id"
  134. text_attr = "name"
  135. } ?>
  136. </td>
  137. </tr>
  138. <tr>
  139. <td>
  140. <?lsmb IF location?>
  141. <input type="submit" value="Edit Location">
  142. <input type="hidden" name="location_id" value="<?lsmb location.id?>"/>
  143. <?lsmb ELSE?>
  144. <input type="submit" value="Save Location">
  145. <?lsmb END?>
  146. </td>
  147. </tr>
  148. </form>
  149. </table>
  150. <table>
  151. <form name="contacts" method="POST" action="admin.pl">
  152. <input type="hidden" name="action" value="save_contact"/>
  153. <input type="hidden" name="user_id" value="<?lsmb user.user.id?>"/>
  154. <tr>
  155. <td colspan="8"><hr/></td>
  156. </tr>
  157. <tr>
  158. <td></td>
  159. <td>
  160. Contact type
  161. </td>
  162. <td>
  163. Contact
  164. </td>
  165. </tr>
  166. <?lsmb FOR l_contact IN user.contacts?>
  167. <tr>
  168. <td>
  169. <a href="admin.pl?edit_contact&contact_id=<?lsmb l_contact.id?>&user_id=<?lsmb user.user.id?>">Edit</a>
  170. <a href="admin.pl?delete_contact&contact_id=<?lsmb l_contact.id?>&user_id=<?lsmb user.user.id?>">Delete</a>
  171. </td>
  172. <td><?lsmb l_contact.class?></td>
  173. <td><?lsmb l_contact.contact?></td>
  174. </tr>
  175. <?lsmb END?>
  176. <tr>
  177. <td></td>
  178. <td>
  179. <?lsmb PROCESS select element_data = {
  180. name = "contact_class"
  181. options = contact_classes
  182. default_values = [contact.contact_class_id]
  183. value_attr = "id"
  184. text_attr = "name"
  185. } ?>
  186. </td>
  187. <td>
  188. <input type="textarea" name="contact" value="<?lsmb contact.contact?>"/>
  189. </td>
  190. </tr>
  191. <tr>
  192. <td>
  193. <?lsmb IF contact?>
  194. <input type="submit" value="Edit Contact">
  195. <input type="hidden" name="contact_id" value="<?lsmb contact.id?>"/>
  196. <?lsmb ELSE?>
  197. <input type="submit" value="Save Contact">
  198. <?lsmb END?>
  199. </td>
  200. </tr>
  201. </form>
  202. </table>
  203. <form name="groups" method="POST" action="admin.pl">
  204. <input type="hidden" name="action" value="save_groups"/>
  205. <table>
  206. <!-- Groups section -->
  207. <tr>
  208. <?lsmb FOREACH role IN roles ?>
  209. <?lsmb IF loop.count % 2 == 0?>
  210. </tr>
  211. <tr>
  212. <?lsmb END?>
  213. <td>
  214. <input type="checkbox" name="<?lsmb loop.index?>" value="1"
  215. <?lsmb FOREACH rolname IN user.roles ?>
  216. <?lsmb IF role == rolname?>
  217. checked
  218. <?lsmb END?>
  219. <?lsmb END?> />
  220. <?lsmb role?>
  221. </td>
  222. <?lsmb END?>
  223. </tr>
  224. </table>
  225. <table>
  226. <tr>
  227. <td><button value="groups">Save Groups</button></td>
  228. <td><button name="method" value="cancel">Cancel</td>
  229. </tr>
  230. </table>
  231. </form>
  232. <?lsmb END?>
  233. </div>