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