summaryrefslogtreecommitdiff
path: root/UI/Admin/edit_user.html
blob: c77406a2f8330e2137c20e042e9446281e1be98d (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.entity_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. <select name="class">
  180. <?lsmb FOREACH class IN contact_classes?>
  181. <option name="<?lsmb class.id?>" <?lsmb IF contact.contact_class_id == class.id?>selected<?lsmb END?>><?lsmb class.contact?></option>
  182. <?lsmb END?>
  183. </select>
  184. </td>
  185. <td>
  186. <input type="textarea" name="contact" value="<?lsmb contact.contact?>"/>
  187. </td>
  188. </tr>
  189. <tr>
  190. <td>
  191. <?lsmb IF contact?>
  192. <input type="submit" value="Edit Contact">
  193. <input type="hidden" name="contact_id" value="<?lsmb contact.id?>"/>
  194. <?lsmb ELSE?>
  195. <input type="submit" value="Save Contact">
  196. <?lsmb END?>
  197. </td>
  198. </tr>
  199. </form>
  200. </table>
  201. <table>
  202. <!-- Groups section -->
  203. <tr>
  204. <?lsmb FOREACH role IN roles ?>
  205. <?lsmb IF loop.count % 2 == 0?>
  206. </tr>
  207. <tr>
  208. <?lsmb END?>
  209. <td>
  210. <input type="checkbox" name="<?lsmb loop.index?>" value="1"
  211. <?lsmb FOREACH rolname IN user.roles ?>
  212. <?lsmb IF role == rolname?>
  213. checked
  214. <?lsmb END?>
  215. <?lsmb END?> />
  216. <?lsmb role?>
  217. </td>
  218. <?lsmb END?>
  219. </tr>
  220. </table>
  221. <table>
  222. <tr>
  223. <td><button value="new_user">Submit</button></td>
  224. <td><button name="method" value="cancel">Cancel</td>
  225. </tr>
  226. </table>
  227. <?lsmb END?>
  228. </div>