summaryrefslogtreecommitdiff
path: root/UI/Contact/contact.html
blob: bceea46292990073923c6383b85b3368536de6ab (plain)
  1. <?lsmb script_css = "Contact/contact.css" ?><?lsmb PROCESS 'ui-header.html' ?>
  2. <?lsmb PROCESS 'elements.html' ?>
  3. <body>
  4. <?lsmb IF name ?>
  5. <div class="pageheading"><?lsmb name?></font>
  6. <?lsmb END ?>
  7. <div class="navigation" id="nav_div">
  8. <?lsmb IF entity_id ?><?lsmb operation = "Edit" ?><?lsmb ELSE
  9. ?><?lsmb operation = "Add"
  10. ?><?lsmb END ?>
  11. <!-- CT: Keys for localization scripts:
  12. <?lsmb text("Add Customer") ?>
  13. <?lsmb text("Edit Customer") ?>
  14. <?lsmb text("Add Vendor") ?>
  15. <?lsmb text("Edit Vendor") ?>
  16. <?lsmb text("Add Employee") ?>
  17. <?lsmb text("Edit Employee") ?>
  18. -->
  19. <ul class="navigation">
  20. <?lsmb IF entity_class == 3 ?>
  21. <li><a href="#hr_div"><?lsmb text('HR') ?></a></li>
  22. <?lsmb ELSE ?>
  23. <li><a href="#customer_div"><?lsmb text('Account') ?></a></li>
  24. <?lsmb END ?>
  25. <?lsmb IF entity_id ?>
  26. <li><a href="#location_div"><?lsmb text('Addresses') ?></a></li>
  27. <li><a href="#contact_div"><?lsmb text('Contact Info') ?></a></li>
  28. <li><a href="#bank_div"><?lsmb text('Bank Accounts') ?></a></li>
  29. <li><a href="#notes_div"><?lsmb text('Notes') ?></a></li>
  30. <!-- Commented out as not yet implemented -CT
  31. <li><a href="#history_div"><?lsmb text('History') ?></a></li>
  32. <li><a href="#user_div"><?lsmb text('User') ?></a></li>
  33. -->
  34. <?lsmb END ?>
  35. </ul>
  36. </div>
  37. <?lsmb IF entity_class == 3 ?>
  38. <div id="hr_div" class="container">
  39. <div class="listtop"><strong><?lsmb text("$operation Employee") ?></strong></div>
  40. <form name="hr" action="<?lsmb script ?>" method="post">
  41. <?lsmb PROCESS input element_data = {
  42. type = "hidden"
  43. name = "entity_id"
  44. value = entity_id
  45. } ?>
  46. <div class="input" id="person_name_div"><?lsmb text('Name:')?>&nbsp;
  47. <!-- TODO: Add Saluatation -->
  48. <?lsmb PROCESS input element_data = {
  49. label = text('First')
  50. name = "first_name"
  51. value = first_name
  52. type = "text"
  53. size = 20
  54. } ?>
  55. <?lsmb PROCESS input element_data = {
  56. label = text('Middle')
  57. name = "middle_name"
  58. value = middle_name
  59. type = "text"
  60. size = 20
  61. } ?>
  62. <?lsmb PROCESS input element_data = {
  63. label = text('Last')
  64. name = "last_name"
  65. value = last_name
  66. type = "text"
  67. size = 20
  68. } ?>
  69. </div>
  70. <div id="job_title_div">
  71. <!-- Note that the strange # ' constructs are only necessary to help VIM avoid
  72. problems with multi-word single-quoted constructs in PI tags. -CT -->
  73. <?lsmb PROCESS input element_data = {
  74. label = text('Job Title:')
  75. name = "role"
  76. value = role
  77. type = "text"
  78. size = 20
  79. } # ' ?>
  80. <?lsmb PROCESS input element_data = {
  81. label = text('Sales:')
  82. value = 1
  83. type = "checkbox"
  84. checked = sales
  85. name = "sales"
  86. } ?>
  87. <?lsmb PROCESS input element_data = {
  88. label = text('Employee Number')
  89. value = employee_number
  90. name = "employee_number"
  91. type = "text"
  92. size = 20
  93. } # ' ?>
  94. <label for="manager_select"><?lsmb text('Manager:') ?></label>
  95. <select id="manager_select" name="manager_id">
  96. <?lsmb FOREACH e = employee ?>
  97. <option value = e.entity_id <?lsmb (manager_id == e.entity_id) ? "SELECTED" : ""?><?lsmb e.name ?></option>
  98. <?lsmb END ?>
  99. </select>
  100. <div>
  101. <?lsmb PROCESS input element_data = {
  102. label = text('DOB:')
  103. name = "dob"
  104. value = dob
  105. type = "text"
  106. class = "date"
  107. size = 10
  108. } ?>
  109. <?lsmb PROCESS input element_data = {
  110. label = text('Start Date:')
  111. name = "start_date"
  112. value = start_date
  113. type = "text"
  114. class = "date"
  115. size = 10
  116. } # ' ?>
  117. <?lsmb PROCESS input element_data = {
  118. label = text('End Date:')
  119. name = "end_date"
  120. value = end_date
  121. class = "text"
  122. type = "text"
  123. size = 10
  124. } # ' ?>
  125. <div>
  126. <?lsmb PROCESS button element_data = {
  127. text = text('Save')
  128. class = "submit"
  129. type = "submit"
  130. value = "save_employee"
  131. } ?>
  132. </div>
  133. </form>
  134. <?lsmb ELSE ?>
  135. <div class="container" id="customer_div">
  136. <?lsmb SWITCH entity_class
  137. ?><?lsmb CASE 1 ?><?lsmb entity_classname = "Vendor"
  138. ?><?lsmb CASE 2 ?><?lsmb entity_classname = "Customer"
  139. ?><?lsmb END ?>
  140. <div class="listtop"><strong><?lsmb text("$operation $entity_classname") ?></strong></div>
  141. <?lsmb FOREACH n = notes ?>
  142. <div class="entity_note"><?lsmb n.note ?></div>
  143. <?lsmb END ?>
  144. <form name="customer" method="POST" action="<?lsmb script ?>">
  145. <?lsmb PROCESS input element_data = {
  146. type = "hidden"
  147. name = "entity_id"
  148. value = entity_id
  149. } ?>
  150. <?lsmb PROCESS input element_data = {
  151. label = text('Name:'),
  152. type= "text",
  153. name = "name",
  154. value = name,
  155. size = "20"
  156. } ?><br/>
  157. <?lsmb PROCESS input element_data = {
  158. label = text('Account Number:'),
  159. type= "text",
  160. name = "meta_number",
  161. value = meta_number,
  162. size = "20"
  163. } # ' ?><br/>
  164. <table>
  165. <tr>
  166. <td>
  167. <?lsmb PROCESS input element_data = {
  168. label = text('Starting Date:'),
  169. name = "startdate",
  170. class = "date",
  171. value = startdate,
  172. type = "text",
  173. size = "12",
  174. maxlength = "10"
  175. } #' ?>
  176. </td>
  177. <td>
  178. <?lsmb PROCESS input element_data = {
  179. label = text('End Date:'),
  180. name = "enddate",
  181. class = "date",
  182. value = enddate,
  183. type = "text",
  184. size = "12",
  185. maxlength = "10"
  186. } #' ?>
  187. </td>
  188. </tr>
  189. <tr>
  190. <td>
  191. <?lsmb PROCESS input element_data = {
  192. label = text('Credit Limit:'),
  193. name = "creditlimit",
  194. value = creditlimit,
  195. type = "text",
  196. size = "20"
  197. } #' ?>
  198. </td>
  199. <td>
  200. <?lsmb PROCESS input element_data = {
  201. label = text('Terms:'),
  202. name = "terms",
  203. value = terms,
  204. type = "text",
  205. size = "5"
  206. } ?> <?lsmb text('days') ?>
  207. </td>
  208. </tr>
  209. <tr>
  210. <td>
  211. <?lsmb PROCESS input element_data = {
  212. label = text('Tax Number/SSN:'),
  213. name = "taxnumber",
  214. value = taxnumber,
  215. type = "text",
  216. size = "19"
  217. } #' ?>
  218. </td>
  219. <td>
  220. <?lsmb PROCESS input element_data = {
  221. label = text('Subcontract GIFI:'),
  222. name = "gifi_accno",
  223. value = gifi_accno,
  224. type = "text",
  225. size = "19"
  226. } #' ?>
  227. </td>
  228. </tr>
  229. <tr>
  230. <td>
  231. <?lsmb PROCESS input element_data = {
  232. label = text('Discount:'),
  233. name = "discount",
  234. value = discount,
  235. type = "text",
  236. size = "3",
  237. maxlength = 3
  238. } ?>% /
  239. <?lsmb PROCESS input element_data = {
  240. name = "discount_terms",
  241. value = discount_terms,
  242. type = "text",
  243. size = "3",
  244. maxlength = 3
  245. } ?> <?lsmb text('days') ?>
  246. </td>
  247. <td>
  248. <?lsmb PROCESS input element_data = {
  249. label = text('SIC:'),
  250. name = "sic_code",
  251. value = sic_code,
  252. type = "text",
  253. size = "19",
  254. class = 'sic'
  255. } ?>
  256. </td>
  257. </tr>
  258. <tr>
  259. <tr>
  260. <td>
  261. <!-- TODO: Move to elements.html framework. -CT -->
  262. <label for="notes"><?lsmb text('Notes:') ?></label><br/>
  263. <textarea name="notes" rows="3" cols="40" id="notes"></textarea>
  264. </td>
  265. </tr>
  266. </table>
  267. <hr/>
  268. <?lsmb PROCESS button element_data = {
  269. text = text('Save'),
  270. class="submit"
  271. type="submit"
  272. name="action"
  273. value="save"
  274. accesskey="S"
  275. title="Save [Alt-S]"
  276. } ?>
  277. <?lsmb PROCESS button element_data = {
  278. class="submit"
  279. type="submit"
  280. name="action"
  281. value="add_transaction"
  282. accesskey="A"
  283. title="Transaction [Alt-A]"
  284. text = (entity_class == 1) ? text('AP Transaction') : text('AR Transaction')
  285. } ?>
  286. <?lsmb PROCESS button element_data = {
  287. class="submit"
  288. type="submit"
  289. name="action"
  290. value="add_invoice"
  291. accesskey="I"
  292. title="Invoice [Alt-I]"
  293. text = (entity_class == 1) ? text('Vendor Invoice') : text('Customer Invoice')
  294. } ?>
  295. <?lsmb PROCESS button element_data = {
  296. class="submit"
  297. type="submit"
  298. name="action"
  299. value="add_order"
  300. accesskey="O"
  301. title="Order [Alt-O]"
  302. text = (entity_class == 1) ? text('Purchase Order') : text('Sales Order')
  303. } ?>
  304. <?lsmb PROCESS button element_data = {
  305. class="submit"
  306. type="submit"
  307. name="action"
  308. value="rfq"
  309. accesskey="Q"
  310. title="Quotation [Alt-Q]"
  311. text = (entity_class == 1) ? text('RFQ') : text('Quotation')
  312. } ?>
  313. <?lsmb PROCESS button element_data = {
  314. class="submit"
  315. type="submit"
  316. name="action"
  317. value="pricelist"
  318. accesskey="P"
  319. title="Pricelist [Alt-P]"
  320. text = text('Pricelist')
  321. } ?>
  322. </form>
  323. </div>
  324. <?lsmb END ?>
  325. <?lsmb IF entity_id ?>
  326. <div id="location_div" class="container">
  327. <div class="listtop"><?lsmb text('Locations') ?></div>
  328. <!-- This entire form should probably be optionaly automated with AJAX
  329. in oder to prevent user confusion -->
  330. <form id="location_form" action="<?lsmb script ?>">
  331. <?lsmb PROCESS input element_data = {
  332. type="hidden"
  333. name="entity_id"
  334. value=entity_id
  335. } ?>
  336. <?lsmb PROCESS input element_data = {
  337. type="hidden"
  338. name="location_id"
  339. value=location_id
  340. } ?>
  341. <table width="100%">
  342. <tr class="listheading">
  343. <th class="type"><?lsmb text('Type') ?></th>
  344. <th class="line_one"><?lsmb text('Address1') ?></th>
  345. <th class="city"><?lsmb text('City') ?></th>
  346. <th class="state"><?lsmb text('State/Province') ?></th>
  347. <th class="mail_code"><?lsmb text('ZIP/Post Code') ?></th>
  348. <th class="country"><?lsmb text('Country') ?></th>
  349. <th class="actions"><?lsmb text('Actions') ?></th>
  350. </tr>
  351. <?lsmb FOREACH loc = locations ?>
  352. <tr>
  353. <td class="type"><?lsmb loc.class ?></td>
  354. <td class="line_one"><?lsmb loc.line_one ?></td>
  355. <td class="city"><?lsmb loc.city ?></td>
  356. <td class="state"><?lsmb loc.state ?></td>
  357. <td class="mail_code"><?lsmb loc.mail_code ?></td>
  358. <td class="country"><?lsmb loc.country ?></td>
  359. <td class="actions">
  360. <!-- TODO: Automate links with AJAX -->
  361. <a href="<?lsmb script ?>?action=edit&entity_id=<?lsmb id
  362. ?>&location_id=<?lsmb loc.id ?>">[edit]</a>
  363. <a href="<?lsmb script ?>?action=delete_location&entity_id=<?lsmb
  364. id ?>&location_id=<?lmb loc.id ?>">[delete]</a>
  365. </td>
  366. </tr>
  367. <?lsmb END ?>
  368. </table>
  369. <div> <!-- TODO: Move to elements.html -CT -->
  370. <label for="loc_type"><?lsmb text('Type:') ?></label>
  371. <select id='loc_type' name="location_class">
  372. <?lsmb FOREACH lc = location_class_list ?>
  373. <option value="<?lsmb lc.id ?>"><?lsmb lc.class ?></option>
  374. <?lsmb END ?>
  375. </select>
  376. </div>
  377. <div>
  378. <?lsmb PROCESS input element_data = {
  379. label = text('Address:'),
  380. name = "line_one",
  381. value = line_one,
  382. type = "text",
  383. size = "20"
  384. } ?>
  385. </div>
  386. <div>
  387. <?lsmb PROCESS input element_data = {
  388. name = "line_two",
  389. value = line_two,
  390. type = "text",
  391. size = "20"
  392. } ?>
  393. </div>
  394. <div>
  395. <?lsmb PROCESS input element_data = {
  396. name = "line_three",
  397. value = line_three,
  398. type = "text",
  399. size = "20"
  400. } ?>
  401. </div>
  402. <div>
  403. <?lsmb PROCESS input element_data = {
  404. label = text('City:'),
  405. name = "city",
  406. value = city,
  407. type = "text",
  408. size = "20"
  409. } ?>
  410. </div>
  411. <div>
  412. <?lsmb PROCESS input element_data = {
  413. label = text('State/Province:'),
  414. name = "state",
  415. value = state,
  416. type = "text",
  417. size = "20"
  418. } ?>
  419. </div>
  420. <div>
  421. <?lsmb PROCESS input element_data = {
  422. label = text('Zip/Post Code:'),
  423. name = "mail_code",
  424. value = mail_code,
  425. type = "text",
  426. size = "20"
  427. } #' ?>
  428. </div>
  429. <div> <!-- TODO: Move to elements.html -CT -->
  430. <label for="country"><?lsmb text('Country:') ?></label>
  431. <select name="country" id="country">
  432. <?lsmb FOREACH c = country_list ?>
  433. <option value="<?lsmb c.id ?>"><?lsmb c.name ?></option>
  434. <?lsmb END ?>
  435. </select>
  436. </div>
  437. <div><?lsmb PROCESS button element_data = {
  438. class = "submit"
  439. name = "action"
  440. value = "add_location"
  441. id = "loc_save_location"
  442. text = text('Save Location')
  443. } #' ?>
  444. </div>
  445. </form>
  446. </div>
  447. <div class="container" id="contact_div">
  448. <div class="listtop"><?lsmb text('Contact Information') ?></div>
  449. <table width="100%">
  450. <tr class="listheading">
  451. <th class="contact_class"><?lsmb text('Type:') ?></th>
  452. <th class="contact"><?lsmb text('Contact Info:') ?></th>
  453. <th class="contact_actions"><?lsmb text('Actions:') ?></th>
  454. </tr>
  455. <?lsmb FOREACH ct = contacts ?>
  456. <tr>
  457. <td class="contact_class"><?lsmb ct.class ?></td>
  458. <td class="contact"><?lsmb ct.contact ?></td>
  459. <td class="contact_actions">
  460. <a href="<?lsmb script ?>?entity_id=<?lsmb entity_id
  461. ?>&contact_id=<?lsmb ct.id
  462. ?>&action=edit_contact"
  463. >[<?lsmb text('Edit'); ?>]</a>&nbsp;&nbsp;
  464. <a href="<?lsmb script ?>?entity_id=<?lsmb entity_id
  465. ?>&contact_id=<?lsmb ct.id
  466. ?>&action=delete_contact"
  467. >[<?lsmb text('Delete'); ?>]</a>
  468. </td>
  469. </tr>
  470. <?lsmb END ?>
  471. </table>
  472. <form action="<?lsmb script ?>">
  473. <?lsmb PROCESS input element_data = {
  474. type="hidden"
  475. name="entity_id"
  476. value=entity_id
  477. } ?>
  478. <?lsmb PROCESS input element_data = {
  479. type="hidden"
  480. name="contact_id"
  481. value=contact_id
  482. } ?>
  483. <div><label for="contact_type"><?lsmb text('Type:') ?></label>
  484. <select name="contact_class" id="contact_type">
  485. <?lsmb FOREACH cc = contact_class_list ?>
  486. <option value="<?lsmb cc.id ?>"><?lsmb cc.class ?></option>
  487. <?lsmb END ?>
  488. </select>
  489. <!-- TODO: Move the above select list to elements.html -CT -->
  490. </div>
  491. <div>
  492. <?lsmb PROCESS input element_data = {
  493. label = text('Contact Info:'),
  494. name = "contact"
  495. value = contact
  496. type = "text"
  497. size = "20"
  498. } #' ?>
  499. </div>
  500. <div><?lsmb PROCESS button element_data = {
  501. name = "action",
  502. value = "save_contact",
  503. text = text('Save Contact'),
  504. class = "submit"
  505. } #' ?>
  506. </div>
  507. </form>
  508. </div>
  509. <div class="container" id="bank_div">
  510. <div class="listtop"><?lsmb text('Bank Accounts') ?></div>
  511. <table width="100%">
  512. <tr class="listheading">
  513. <th class="bic"><?lsmb text('BIC/SWIFT Code') ?></th>
  514. <th class="iban"><?lsmb text('Account Number') ?></th>
  515. <th class="actions"><?lsmb text('Actions') ?></th>
  516. </tr>
  517. <?lsmb FOREACH ba = bank_account ?>
  518. <tr>
  519. <td class="bic"><?lsmb ba.bic ?></td>
  520. <td class="iban"><?lsmb ba.iban ?></td>
  521. <td class="actions">
  522. <a href="<?lsmb script ?>?action=edit_bank_acct&entity_id=<?lsmb
  523. entity_id ?>&bank_account_id=<?lsmb ba.id ?>"
  524. >[Edit]</a>
  525. <a href="<?lsmb script ?>?action=delete_bank_acct&entity_id=<?lsmb
  526. entity_id ?>&bank_account_id=<?lsmb ba.id ?>"
  527. >[Delete]</a>
  528. </td>
  529. </tr>
  530. <?lsmb END ?>
  531. </table>
  532. <form name="bank_acct" action="<?lsmb script ?>">
  533. <?lsmb PROCESS input element_data = {
  534. type="hidden"
  535. name="entity_id"
  536. value=entity_id
  537. } ?>
  538. <?lsmb PROCESS input element_data = {
  539. type="hidden"
  540. name="bank_account_id"
  541. value=bank_account_id
  542. } ?>
  543. <div><label for="bic">
  544. <?lsmb PROCESS input element_data = {
  545. type="text"
  546. label = text('BIC/SWIFT Code:')
  547. name="bic"
  548. value=bic
  549. size=20
  550. } #' ?>
  551. </div>
  552. <div><label for="iban">
  553. <?lsmb PROCESS input element_data = {
  554. type="text"
  555. label = text('Bank Account:')
  556. name="iban"
  557. value=iban
  558. size=20
  559. } #' ?>
  560. </div>
  561. <div><?lsmb PROCESS button element_data = {
  562. name="action"
  563. value="save_bank_account"
  564. class="submit"
  565. text = text('Save')
  566. } ?>
  567. </div>
  568. </form>
  569. </div>
  570. <div id="notes_div">
  571. <div class="listtop"><?lsmb text('Notes') ?></div>
  572. <?lsmb FOREACH n = notes ?>
  573. <div class="note">
  574. <div class="timestamp"><?lsmb text('Entered at: [_1]', n.created) ?></div>
  575. <div class="contents"><?lsmb n.note ?></div>
  576. <?lsmb END ?>
  577. <form action="<?lsmb script ?>" method="post">
  578. <?lsmb PROCESS input element_data = {
  579. type="hidden"
  580. name="entity_id"
  581. value=entity_id
  582. } ?>
  583. <div class="input"><?lsmb PROCESS textarea element_data = {
  584. label = text('Notes:')
  585. name = notes
  586. } ?></div>
  587. <div class="input">
  588. <?lsmb PROCESS button element_data = {
  589. text = text('Save')
  590. class = 'submit'
  591. name = 'action'
  592. value = 'save_notes'
  593. } ?>
  594. </form>
  595. </div>
  596. <?lsmb END ?>
  597. </body>
  598. </html>