summaryrefslogtreecommitdiff
path: root/UI/Contact/contact.html
blob: 311660b83f12e42b6116f0796f4b6cc746f51d45 (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. type = "hidden"
  156. name = "account_class"
  157. value = account_class
  158. } ?>
  159. <?lsmb PROCESS input element_data = {
  160. label = text('Name:'),
  161. type= "text",
  162. name = "name",
  163. value = name,
  164. size = "20"
  165. } ?><br/>
  166. <?lsmb PROCESS input element_data = {
  167. label = text("$entity_classname Number:"),
  168. type= "text",
  169. name = "meta_number",
  170. value = meta_number,
  171. size = "20"
  172. } # " ?><br/>
  173. <table>
  174. <tr>
  175. <td>
  176. <?lsmb PROCESS input element_data = {
  177. label = text('Starting Date:'),
  178. name = "startdate",
  179. class = "date",
  180. value = startdate,
  181. type = "text",
  182. size = "12",
  183. maxlength = "10"
  184. } #' ?>
  185. </td>
  186. <td>
  187. <?lsmb PROCESS input element_data = {
  188. label = text('End Date:'),
  189. name = "enddate",
  190. class = "date",
  191. value = enddate,
  192. type = "text",
  193. size = "12",
  194. maxlength = "10"
  195. } #' ?>
  196. </td>
  197. </tr>
  198. <tr>
  199. <td>
  200. <?lsmb INCLUDE input element_data = {
  201. label = text('Credit Limit:'),
  202. name = "creditlimit",
  203. value = creditlimit,
  204. type = "text",
  205. size = "20"
  206. } #' ?>
  207. </td>
  208. <td>
  209. <?lsmb INCLUDE input element_data = {
  210. label = text('Terms:'),
  211. name = "terms",
  212. value = terms,
  213. type = "text",
  214. size = "5"
  215. } ?> <?lsmb text('days') ?>
  216. </td>
  217. </tr>
  218. <tr>
  219. <td>
  220. <?lsmb INCLUDE input element_data = {
  221. label = text('Tax Number/SSN:'),
  222. name = "taxnumber",
  223. value = taxnumber,
  224. type = "text",
  225. size = "19"
  226. } #' ?>
  227. </td>
  228. <td>
  229. <?lsmb INCLUDE input element_data = {
  230. label = text('Subcontract GIFI:'),
  231. name = "gifi_accno",
  232. value = gifi_accno,
  233. type = "text",
  234. size = "19"
  235. } #' ?>
  236. </td>
  237. </tr>
  238. <tr>
  239. <td>
  240. <?lsmb INCLUDE input element_data = {
  241. label = text('Discount:'),
  242. name = "discount",
  243. value = discount,
  244. type = "text",
  245. size = "3",
  246. maxlength = 3
  247. } ?>% /
  248. <?lsmb INCLUDE input element_data = {
  249. name = "discount_terms",
  250. value = discount_terms,
  251. type = "text",
  252. size = "3",
  253. maxlength = 3
  254. } ?> <?lsmb text('days') ?>
  255. </td>
  256. <td>
  257. <?lsmb INCLUDE input element_data = {
  258. label = text('SIC:'),
  259. name = "sic_code",
  260. value = sic_code,
  261. type = "text",
  262. size = "19",
  263. class = 'sic'
  264. } ?>
  265. </td>
  266. </tr>
  267. <tr>
  268. <td> <?lsmb INCLUDE select element_data = {
  269. name = "ar_ap_account_id"
  270. default_values = [ar_ap_account_id]
  271. options = ar_ap_acc_list
  272. label = text((account_class == 1) ? 'AP' : 'AR')
  273. text_attr = "text"
  274. value_attr = "id"
  275. } ?>
  276. </td>
  277. <td> <?lsmb INCLUDE select element_data = {
  278. name = "payment_account_id"
  279. default_values = [payment_account_id]
  280. options = cash_acc_list
  281. label = text('Payment')
  282. text_attr = "text"
  283. value_attr = "id"
  284. } ?>
  285. </td>
  286. <tr>
  287. <td> <?lsmb INCLUDE select element_data = {
  288. name = "business_id"
  289. options = business_types
  290. default_values = [business_id]
  291. text_attr = "description"
  292. value_attr = "id"
  293. label = text('Business Type:') #'
  294. } ?>
  295. </td>
  296. <td> <?lsmb INCLUDE input element_data = {
  297. name = "threshold"
  298. value = threshold
  299. type = "text"
  300. size = "20"
  301. label = text('Threshold')
  302. class = "numeric"
  303. } ?>
  304. </tr>
  305. </table>
  306. <hr/>
  307. <?lsmb INCLUDE button element_data = {
  308. text = text('Save'),
  309. class="submit"
  310. type="submit"
  311. name="action"
  312. value="save"
  313. accesskey="S"
  314. title="Save [Alt-S]"
  315. } ?>
  316. <?lsmb INCLUDE button element_data = {
  317. class="submit"
  318. type="submit"
  319. name="action"
  320. value="add_transaction"
  321. accesskey="A"
  322. title="Transaction [Alt-A]"
  323. text = (entity_class == 1) ? text('AP Transaction') : text('AR Transaction')
  324. } ?>
  325. <?lsmb INCLUDE button element_data = {
  326. class="submit"
  327. type="submit"
  328. name="action"
  329. value="add_invoice"
  330. accesskey="I"
  331. title="Invoice [Alt-I]"
  332. text = (entity_class == 1) ? text('Vendor Invoice') : text('Customer Invoice')
  333. } ?>
  334. <?lsmb INCLUDE button element_data = {
  335. class="submit"
  336. type="submit"
  337. name="action"
  338. value="add_order"
  339. accesskey="O"
  340. title="Order [Alt-O]"
  341. text = (entity_class == 1) ? text('Purchase Order') : text('Sales Order')
  342. } ?>
  343. <?lsmb INCLUDE button element_data = {
  344. class="submit"
  345. type="submit"
  346. name="action"
  347. value="rfq"
  348. accesskey="Q"
  349. title="Quotation [Alt-Q]"
  350. text = (entity_class == 1) ? text('RFQ') : text('Quotation')
  351. } ?>
  352. <?lsmb INCLUDE button element_data = {
  353. class="submit"
  354. type="submit"
  355. name="action"
  356. value="pricelist"
  357. accesskey="P"
  358. title="Pricelist [Alt-P]"
  359. text = text('Pricelist')
  360. } ?>
  361. </form>
  362. </div>
  363. <?lsmb END ?>
  364. <?lsmb IF entity_id ?>
  365. <div id="location_div" class="container">
  366. <div class="listtop"><?lsmb text('Locations') ?></div>
  367. <!-- This entire form should probably be optionaly automated with AJAX
  368. in order to prevent user confusion -CT -->
  369. <form id="location_form" action="<?lsmb script ?>">
  370. <?lsmb PROCESS input element_data = {
  371. type="hidden"
  372. name="entity_id"
  373. value=entity_id
  374. } ?>
  375. <?lsmb PROCESS input element_data = {
  376. type="hidden"
  377. name="location_id"
  378. value=location_id
  379. } ?>
  380. <table width="100%">
  381. <tr class="listheading">
  382. <th class="type"><?lsmb text('Type') ?></th>
  383. <th class="line_one"><?lsmb text('Address1') ?></th>
  384. <th class="city"><?lsmb text('City') ?></th>
  385. <th class="state"><?lsmb text('State/Province') ?></th>
  386. <th class="mail_code"><?lsmb text('ZIP/Post Code') ?></th>
  387. <th class="country"><?lsmb text('Country') ?></th>
  388. <th class="actions"><?lsmb text('Actions') ?></th>
  389. </tr>
  390. <?lsmb FOREACH loc = locations ?>
  391. <tr>
  392. <td class="type"><?lsmb loc.class ?></td>
  393. <td class="line_one"><?lsmb loc.line_one ?></td>
  394. <td class="city"><?lsmb loc.city ?></td>
  395. <td class="state"><?lsmb loc.state ?></td>
  396. <td class="mail_code"><?lsmb loc.mail_code ?></td>
  397. <td class="country"><?lsmb loc.country ?></td>
  398. <td class="actions">
  399. <!-- TODO: Automate links with AJAX -->
  400. <a href="<?lsmb script ?>?action=edit&entity_id=<?lsmb id
  401. ?>&location_id=<?lsmb loc.id ?>">[edit]</a>
  402. <a href="<?lsmb script ?>?action=delete_location&entity_id=<?lsmb
  403. id ?>&location_id=<?lmb loc.id ?>">[delete]</a>
  404. </td>
  405. </tr>
  406. <?lsmb END ?>
  407. </table>
  408. <div> <!-- TODO: Move to elements.html -CT -->
  409. <label for="loc_type"><?lsmb text('Type:') ?></label>
  410. <select id='loc_type' name="location_class">
  411. <?lsmb FOREACH lc = location_class_list ?>
  412. <option value="<?lsmb lc.id ?>"><?lsmb lc.class ?></option>
  413. <?lsmb END ?>
  414. </select>
  415. </div>
  416. <div>
  417. <?lsmb PROCESS input element_data = {
  418. label = text('Address:'),
  419. name = "line_one",
  420. value = line_one,
  421. type = "text",
  422. size = "20"
  423. } ?>
  424. </div>
  425. <div>
  426. <?lsmb PROCESS input element_data = {
  427. name = "line_two",
  428. value = line_two,
  429. type = "text",
  430. size = "20"
  431. } ?>
  432. </div>
  433. <div>
  434. <?lsmb PROCESS input element_data = {
  435. name = "line_three",
  436. value = line_three,
  437. type = "text",
  438. size = "20"
  439. } ?>
  440. </div>
  441. <div>
  442. <?lsmb PROCESS input element_data = {
  443. label = text('City:'),
  444. name = "city",
  445. value = city,
  446. type = "text",
  447. size = "20"
  448. } ?>
  449. </div>
  450. <div>
  451. <?lsmb PROCESS input element_data = {
  452. label = text('State/Province:'),
  453. name = "state",
  454. value = state,
  455. type = "text",
  456. size = "20"
  457. } ?>
  458. </div>
  459. <div>
  460. <?lsmb PROCESS input element_data = {
  461. label = text('Zip/Post Code:'),
  462. name = "mail_code",
  463. value = mail_code,
  464. type = "text",
  465. size = "20"
  466. } #' ?>
  467. </div>
  468. <div> <!-- TODO: Move to elements.html -CT -->
  469. <?lsmb INCLUDE select element_data = {
  470. text_attr = "name"
  471. value_attr = "id"
  472. default_values = [country]
  473. options = country_list
  474. name = "country"
  475. label = text('Country:')
  476. } ?>
  477. </div>
  478. <div><?lsmb PROCESS button element_data = {
  479. class = "submit"
  480. name = "action"
  481. value = "add_location"
  482. id = "loc_save_location"
  483. text = text('Save Location')
  484. } #' ?>
  485. </div>
  486. </form>
  487. </div>
  488. <div class="container" id="contact_div">
  489. <div class="listtop"><?lsmb text('Contact Information') ?></div>
  490. <table width="100%">
  491. <tr class="listheading">
  492. <th class="contact_class"><?lsmb text('Type:') ?></th>
  493. <th class="contact"><?lsmb text('Contact Info:') ?></th>
  494. <th class="contact_actions"><?lsmb text('Actions:') ?></th>
  495. </tr>
  496. <?lsmb FOREACH ct = contacts ?>
  497. <tr>
  498. <td class="contact_class"><?lsmb ct.class ?></td>
  499. <td class="contact"><?lsmb ct.contact ?></td>
  500. <td class="contact_actions">
  501. <a href="<?lsmb script ?>?entity_id=<?lsmb entity_id
  502. ?>&contact_id=<?lsmb ct.id
  503. ?>&action=edit_contact"
  504. >[<?lsmb text('Edit'); ?>]</a>&nbsp;&nbsp;
  505. <a href="<?lsmb script ?>?entity_id=<?lsmb entity_id
  506. ?>&contact_id=<?lsmb ct.id
  507. ?>&action=delete_contact"
  508. >[<?lsmb text('Delete'); ?>]</a>
  509. </td>
  510. </tr>
  511. <?lsmb END ?>
  512. </table>
  513. <form action="<?lsmb script ?>">
  514. <?lsmb PROCESS input element_data = {
  515. type="hidden"
  516. name="entity_id"
  517. value=entity_id
  518. } ?>
  519. <?lsmb PROCESS input element_data = {
  520. type="hidden"
  521. name="contact_id"
  522. value=contact_id
  523. } ?>
  524. <div><label for="contact_type"><?lsmb text('Type:') ?></label>
  525. <select name="contact_class" id="contact_type">
  526. <?lsmb FOREACH cc = contact_class_list ?>
  527. <option value="<?lsmb cc.id ?>"><?lsmb cc.class ?></option>
  528. <?lsmb END ?>
  529. </select>
  530. <!-- TODO: Move the above select list to elements.html -CT -->
  531. </div>
  532. <div>
  533. <?lsmb PROCESS input element_data = {
  534. label = text('Contact Info:'),
  535. name = "contact"
  536. value = contact
  537. type = "text"
  538. size = "20"
  539. } #' ?>
  540. </div>
  541. <div><?lsmb PROCESS button element_data = {
  542. name = "action",
  543. value = "save_contact",
  544. text = text('Save Contact'),
  545. class = "submit"
  546. } #' ?>
  547. </div>
  548. </form>
  549. </div>
  550. <div class="container" id="bank_div">
  551. <div class="listtop"><?lsmb text('Bank Accounts') ?></div>
  552. <table width="100%">
  553. <tr class="listheading">
  554. <th class="bic"><?lsmb text('BIC/SWIFT Code') ?></th>
  555. <th class="iban"><?lsmb text('Account Number') ?></th>
  556. <th class="actions"><?lsmb text('Actions') ?></th>
  557. </tr>
  558. <?lsmb FOREACH ba = bank_account ?>
  559. <tr>
  560. <td class="bic"><?lsmb ba.bic ?></td>
  561. <td class="iban"><?lsmb ba.iban ?></td>
  562. <td class="actions">
  563. <a href="<?lsmb script ?>?action=edit_bank_acct&entity_id=<?lsmb
  564. entity_id ?>&bank_account_id=<?lsmb ba.id ?>"
  565. >[Edit]</a>
  566. <a href="<?lsmb script ?>?action=delete_bank_acct&entity_id=<?lsmb
  567. entity_id ?>&bank_account_id=<?lsmb ba.id ?>"
  568. >[Delete]</a>
  569. </td>
  570. </tr>
  571. <?lsmb END ?>
  572. </table>
  573. <form name="bank_acct" action="<?lsmb script ?>">
  574. <?lsmb PROCESS input element_data = {
  575. type="hidden"
  576. name="entity_id"
  577. value=entity_id
  578. } ?>
  579. <?lsmb PROCESS input element_data = {
  580. type="hidden"
  581. name="bank_account_id"
  582. value=bank_account_id
  583. } ?>
  584. <div><label for="bic">
  585. <?lsmb INCLUDE input element_data = {
  586. type="text"
  587. label = text('BIC/SWIFT Code:')
  588. name="bic"
  589. value=bic
  590. size=20
  591. } #' ?>
  592. </div>
  593. <div><label for="iban">
  594. <?lsmb PROCESS input element_data = {
  595. type="text"
  596. label = text('Bank Account:')
  597. name="iban"
  598. value=iban
  599. size=20
  600. } #' ?>
  601. </div>
  602. <div><?lsmb PROCESS button element_data = {
  603. name="action"
  604. value="save_bank_account"
  605. class="submit"
  606. text = text('Save')
  607. } ?>
  608. </div>
  609. </form>
  610. </div>
  611. <div id="notes_div">
  612. <div class="listtop"><?lsmb text('Notes') ?></div>
  613. <?lsmb FOREACH n = notes ?>
  614. <div class="note">
  615. <div class="timestamp"><?lsmb text('Entered at: [_1]', n.created) ?></div>
  616. <div class="contents"><?lsmb n.note ?></div>
  617. <?lsmb END ?>
  618. <form action="<?lsmb script ?>" method="post">
  619. <?lsmb PROCESS input element_data = {
  620. type="hidden"
  621. name="entity_id"
  622. value=entity_id
  623. } ?>
  624. <div class="input"><?lsmb PROCESS textarea element_data = {
  625. label = text('Notes:<br />') # '
  626. name = notes
  627. } ?></div>
  628. <div class="input">
  629. <?lsmb PROCESS button element_data = {
  630. text = text('Save')
  631. class = 'submit'
  632. name = 'action'
  633. value = 'save_notes'
  634. } ?>
  635. </form>
  636. </div>
  637. <?lsmb END ?>
  638. </body>
  639. </html>