summaryrefslogtreecommitdiff
path: root/UI/Contact/contact.html
blob: 8ea851e0031c6f44daf5f3bf14515b7c79795923 (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 = "business_id"
  265. options = business_types
  266. default_values = [business_id]
  267. text_attr = "description"
  268. value_attr = "id"
  269. label = text('Business Type:') #'
  270. } ?>
  271. </td>
  272. </td>
  273. </table>
  274. <hr/>
  275. <?lsmb INCLUDE button element_data = {
  276. text = text('Save'),
  277. class="submit"
  278. type="submit"
  279. name="action"
  280. value="save"
  281. accesskey="S"
  282. title="Save [Alt-S]"
  283. } ?>
  284. <?lsmb INCLUDE button element_data = {
  285. class="submit"
  286. type="submit"
  287. name="action"
  288. value="add_transaction"
  289. accesskey="A"
  290. title="Transaction [Alt-A]"
  291. text = (entity_class == 1) ? text('AP Transaction') : text('AR Transaction')
  292. } ?>
  293. <?lsmb INCLUDE button element_data = {
  294. class="submit"
  295. type="submit"
  296. name="action"
  297. value="add_invoice"
  298. accesskey="I"
  299. title="Invoice [Alt-I]"
  300. text = (entity_class == 1) ? text('Vendor Invoice') : text('Customer Invoice')
  301. } ?>
  302. <?lsmb INCLUDE button element_data = {
  303. class="submit"
  304. type="submit"
  305. name="action"
  306. value="add_order"
  307. accesskey="O"
  308. title="Order [Alt-O]"
  309. text = (entity_class == 1) ? text('Purchase Order') : text('Sales Order')
  310. } ?>
  311. <?lsmb INCLUDE button element_data = {
  312. class="submit"
  313. type="submit"
  314. name="action"
  315. value="rfq"
  316. accesskey="Q"
  317. title="Quotation [Alt-Q]"
  318. text = (entity_class == 1) ? text('RFQ') : text('Quotation')
  319. } ?>
  320. <?lsmb INCLUDE button element_data = {
  321. class="submit"
  322. type="submit"
  323. name="action"
  324. value="pricelist"
  325. accesskey="P"
  326. title="Pricelist [Alt-P]"
  327. text = text('Pricelist')
  328. } ?>
  329. </form>
  330. </div>
  331. <?lsmb END ?>
  332. <?lsmb IF entity_id ?>
  333. <div id="location_div" class="container">
  334. <div class="listtop"><?lsmb text('Locations') ?></div>
  335. <!-- This entire form should probably be optionaly automated with AJAX
  336. in order to prevent user confusion -CT -->
  337. <form id="location_form" action="<?lsmb script ?>">
  338. <?lsmb PROCESS input element_data = {
  339. type="hidden"
  340. name="entity_id"
  341. value=entity_id
  342. } ?>
  343. <?lsmb PROCESS input element_data = {
  344. type="hidden"
  345. name="location_id"
  346. value=location_id
  347. } ?>
  348. <table width="100%">
  349. <tr class="listheading">
  350. <th class="type"><?lsmb text('Type') ?></th>
  351. <th class="line_one"><?lsmb text('Address1') ?></th>
  352. <th class="city"><?lsmb text('City') ?></th>
  353. <th class="state"><?lsmb text('State/Province') ?></th>
  354. <th class="mail_code"><?lsmb text('ZIP/Post Code') ?></th>
  355. <th class="country"><?lsmb text('Country') ?></th>
  356. <th class="actions"><?lsmb text('Actions') ?></th>
  357. </tr>
  358. <?lsmb FOREACH loc = locations ?>
  359. <tr>
  360. <td class="type"><?lsmb loc.class ?></td>
  361. <td class="line_one"><?lsmb loc.line_one ?></td>
  362. <td class="city"><?lsmb loc.city ?></td>
  363. <td class="state"><?lsmb loc.state ?></td>
  364. <td class="mail_code"><?lsmb loc.mail_code ?></td>
  365. <td class="country"><?lsmb loc.country ?></td>
  366. <td class="actions">
  367. <!-- TODO: Automate links with AJAX -->
  368. <a href="<?lsmb script ?>?action=edit&entity_id=<?lsmb id
  369. ?>&location_id=<?lsmb loc.id ?>">[edit]</a>
  370. <a href="<?lsmb script ?>?action=delete_location&entity_id=<?lsmb
  371. id ?>&location_id=<?lmb loc.id ?>">[delete]</a>
  372. </td>
  373. </tr>
  374. <?lsmb END ?>
  375. </table>
  376. <div> <!-- TODO: Move to elements.html -CT -->
  377. <label for="loc_type"><?lsmb text('Type:') ?></label>
  378. <select id='loc_type' name="location_class">
  379. <?lsmb FOREACH lc = location_class_list ?>
  380. <option value="<?lsmb lc.id ?>"><?lsmb lc.class ?></option>
  381. <?lsmb END ?>
  382. </select>
  383. </div>
  384. <div>
  385. <?lsmb PROCESS input element_data = {
  386. label = text('Address:'),
  387. name = "line_one",
  388. value = line_one,
  389. type = "text",
  390. size = "20"
  391. } ?>
  392. </div>
  393. <div>
  394. <?lsmb PROCESS input element_data = {
  395. name = "line_two",
  396. value = line_two,
  397. type = "text",
  398. size = "20"
  399. } ?>
  400. </div>
  401. <div>
  402. <?lsmb PROCESS input element_data = {
  403. name = "line_three",
  404. value = line_three,
  405. type = "text",
  406. size = "20"
  407. } ?>
  408. </div>
  409. <div>
  410. <?lsmb PROCESS input element_data = {
  411. label = text('City:'),
  412. name = "city",
  413. value = city,
  414. type = "text",
  415. size = "20"
  416. } ?>
  417. </div>
  418. <div>
  419. <?lsmb PROCESS input element_data = {
  420. label = text('State/Province:'),
  421. name = "state",
  422. value = state,
  423. type = "text",
  424. size = "20"
  425. } ?>
  426. </div>
  427. <div>
  428. <?lsmb PROCESS input element_data = {
  429. label = text('Zip/Post Code:'),
  430. name = "mail_code",
  431. value = mail_code,
  432. type = "text",
  433. size = "20"
  434. } #' ?>
  435. </div>
  436. <div> <!-- TODO: Move to elements.html -CT -->
  437. <?lsmb INCLUDE select element_data = {
  438. text_attr = "name"
  439. value_attr = "id"
  440. default_values = [country]
  441. options = country_list
  442. name = "country"
  443. label = text('Country:')
  444. } ?>
  445. </div>
  446. <div><?lsmb PROCESS button element_data = {
  447. class = "submit"
  448. name = "action"
  449. value = "add_location"
  450. id = "loc_save_location"
  451. text = text('Save Location')
  452. } #' ?>
  453. </div>
  454. </form>
  455. </div>
  456. <div class="container" id="contact_div">
  457. <div class="listtop"><?lsmb text('Contact Information') ?></div>
  458. <table width="100%">
  459. <tr class="listheading">
  460. <th class="contact_class"><?lsmb text('Type:') ?></th>
  461. <th class="contact"><?lsmb text('Contact Info:') ?></th>
  462. <th class="contact_actions"><?lsmb text('Actions:') ?></th>
  463. </tr>
  464. <?lsmb FOREACH ct = contacts ?>
  465. <tr>
  466. <td class="contact_class"><?lsmb ct.class ?></td>
  467. <td class="contact"><?lsmb ct.contact ?></td>
  468. <td class="contact_actions">
  469. <a href="<?lsmb script ?>?entity_id=<?lsmb entity_id
  470. ?>&contact_id=<?lsmb ct.id
  471. ?>&action=edit_contact"
  472. >[<?lsmb text('Edit'); ?>]</a>&nbsp;&nbsp;
  473. <a href="<?lsmb script ?>?entity_id=<?lsmb entity_id
  474. ?>&contact_id=<?lsmb ct.id
  475. ?>&action=delete_contact"
  476. >[<?lsmb text('Delete'); ?>]</a>
  477. </td>
  478. </tr>
  479. <?lsmb END ?>
  480. </table>
  481. <form action="<?lsmb script ?>">
  482. <?lsmb PROCESS input element_data = {
  483. type="hidden"
  484. name="entity_id"
  485. value=entity_id
  486. } ?>
  487. <?lsmb PROCESS input element_data = {
  488. type="hidden"
  489. name="contact_id"
  490. value=contact_id
  491. } ?>
  492. <div><label for="contact_type"><?lsmb text('Type:') ?></label>
  493. <select name="contact_class" id="contact_type">
  494. <?lsmb FOREACH cc = contact_class_list ?>
  495. <option value="<?lsmb cc.id ?>"><?lsmb cc.class ?></option>
  496. <?lsmb END ?>
  497. </select>
  498. <!-- TODO: Move the above select list to elements.html -CT -->
  499. </div>
  500. <div>
  501. <?lsmb PROCESS input element_data = {
  502. label = text('Contact Info:'),
  503. name = "contact"
  504. value = contact
  505. type = "text"
  506. size = "20"
  507. } #' ?>
  508. </div>
  509. <div><?lsmb PROCESS button element_data = {
  510. name = "action",
  511. value = "save_contact",
  512. text = text('Save Contact'),
  513. class = "submit"
  514. } #' ?>
  515. </div>
  516. </form>
  517. </div>
  518. <div class="container" id="bank_div">
  519. <div class="listtop"><?lsmb text('Bank Accounts') ?></div>
  520. <table width="100%">
  521. <tr class="listheading">
  522. <th class="bic"><?lsmb text('BIC/SWIFT Code') ?></th>
  523. <th class="iban"><?lsmb text('Account Number') ?></th>
  524. <th class="actions"><?lsmb text('Actions') ?></th>
  525. </tr>
  526. <?lsmb FOREACH ba = bank_account ?>
  527. <tr>
  528. <td class="bic"><?lsmb ba.bic ?></td>
  529. <td class="iban"><?lsmb ba.iban ?></td>
  530. <td class="actions">
  531. <a href="<?lsmb script ?>?action=edit_bank_acct&entity_id=<?lsmb
  532. entity_id ?>&bank_account_id=<?lsmb ba.id ?>"
  533. >[Edit]</a>
  534. <a href="<?lsmb script ?>?action=delete_bank_acct&entity_id=<?lsmb
  535. entity_id ?>&bank_account_id=<?lsmb ba.id ?>"
  536. >[Delete]</a>
  537. </td>
  538. </tr>
  539. <?lsmb END ?>
  540. </table>
  541. <form name="bank_acct" action="<?lsmb script ?>">
  542. <?lsmb PROCESS input element_data = {
  543. type="hidden"
  544. name="entity_id"
  545. value=entity_id
  546. } ?>
  547. <?lsmb PROCESS input element_data = {
  548. type="hidden"
  549. name="bank_account_id"
  550. value=bank_account_id
  551. } ?>
  552. <div><label for="bic">
  553. <?lsmb INCLUDE input element_data = {
  554. type="text"
  555. label = text('BIC/SWIFT Code:')
  556. name="bic"
  557. value=bic
  558. size=20
  559. } #' ?>
  560. </div>
  561. <div><label for="iban">
  562. <?lsmb PROCESS input element_data = {
  563. type="text"
  564. label = text('Bank Account:')
  565. name="iban"
  566. value=iban
  567. size=20
  568. } #' ?>
  569. </div>
  570. <div><?lsmb PROCESS button element_data = {
  571. name="action"
  572. value="save_bank_account"
  573. class="submit"
  574. text = text('Save')
  575. } ?>
  576. </div>
  577. </form>
  578. </div>
  579. <div id="notes_div">
  580. <div class="listtop"><?lsmb text('Notes') ?></div>
  581. <?lsmb FOREACH n = notes ?>
  582. <div class="note">
  583. <div class="timestamp"><?lsmb text('Entered at: [_1]', n.created) ?></div>
  584. <div class="contents"><?lsmb n.note ?></div>
  585. <?lsmb END ?>
  586. <form action="<?lsmb script ?>" method="post">
  587. <?lsmb PROCESS input element_data = {
  588. type="hidden"
  589. name="entity_id"
  590. value=entity_id
  591. } ?>
  592. <div class="input"><?lsmb PROCESS textarea element_data = {
  593. label = text('Notes:<br />') # '
  594. name = notes
  595. } ?></div>
  596. <div class="input">
  597. <?lsmb PROCESS button element_data = {
  598. text = text('Save')
  599. class = 'submit'
  600. name = 'action'
  601. value = 'save_notes'
  602. } ?>
  603. </form>
  604. </div>
  605. <?lsmb END ?>
  606. </body>
  607. </html>