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