summaryrefslogtreecommitdiff
path: root/UI/Contact/contact.html
blob: 0f3d6af50632e64c1f3f5e59c2d35db8b6751a45 (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. <?lsmb ELSE ?>
  39. <div class="container" id="customer_div">
  40. <?lsmb SWITCH entity_class
  41. ?><?lsmb CASE 1 ?><?lsmb entity_classname = "Vendor"
  42. ?><?lsmb CASE 2 ?><?lsmb entity_classname = "Customer"
  43. ?><?lsmb END ?>
  44. <div class="listtop"><strong><?lsmb text("$operation $entity_classname") ?></strong></div>
  45. <?lsmb FOREACH n = notes ?>
  46. <div class="entity_note"><?lsmb n.note ?></div>
  47. <?lsmb END ?>
  48. <form name="customer" method="POST" action="<?lsmb script ?>">
  49. <?lsmb PROCESS input element_data = {
  50. type = "hidden"
  51. name = "entity_id"
  52. value = entity_id
  53. } ?>
  54. <?lsmb PROCESS input element_data = {
  55. label = text('Name:'),
  56. type= "text",
  57. name = "name",
  58. value = name,
  59. size = "20"
  60. } ?><br/>
  61. <?lsmb PROCESS input element_data = {
  62. label = text('Account Number:'),
  63. type= "text",
  64. name = "meta_number",
  65. value = meta_number,
  66. size = "20"
  67. } ?><br/>
  68. <table>
  69. <tr>
  70. <td>
  71. <?lsmb PROCESS input element_data = {
  72. label = text('Starting Date:'),
  73. name = "startdate",
  74. class = "date",
  75. value = startdate,
  76. type = "text",
  77. size = "12",
  78. maxlength = "10"
  79. } ?>
  80. </td>
  81. <td>
  82. <?lsmb PROCESS input element_data = {
  83. label = text('End Date:'),
  84. name = "enddate",
  85. class = "date",
  86. value = enddate,
  87. type = "text",
  88. size = "12",
  89. maxlength = "10"
  90. } ?>
  91. </td>
  92. </tr>
  93. <tr>
  94. <td>
  95. <?lsmb PROCESS input element_data = {
  96. label = text('Credit Limit:'),
  97. name = "creditlimit",
  98. value = creditlimit,
  99. type = "text",
  100. size = "20"
  101. } ?>
  102. </td>
  103. <td>
  104. <?lsmb PROCESS input element_data = {
  105. label = text('Terms:'),
  106. name = "terms",
  107. value = terms,
  108. type = "text",
  109. size = "5"
  110. } ?> <?lsmb text('days') ?>
  111. </td>
  112. </tr>
  113. <tr>
  114. <td>
  115. <?lsmb PROCESS input element_data = {
  116. label = text('Tax Number/SSN:'),
  117. name = "taxnumber",
  118. value = taxnumber,
  119. type = "text",
  120. size = "19"
  121. } ?>
  122. </td>
  123. <td>
  124. <?lsmb PROCESS input element_data = {
  125. label = text('Subcontract GIFI:'),
  126. name = "gifi_accno",
  127. value = gifi_accno,
  128. type = "text",
  129. size = "19"
  130. } ?>
  131. </td>
  132. </tr>
  133. <tr>
  134. <td>
  135. <?lsmb PROCESS input element_data = {
  136. label = text('Discount:'),
  137. name = "discount",
  138. value = discount,
  139. type = "text",
  140. size = "3",
  141. maxlength = 3
  142. } ?>% /
  143. <?lsmb PROCESS input element_data = {
  144. name = "discount_terms",
  145. value = discount_terms,
  146. type = "text",
  147. size = "3",
  148. maxlength = 3
  149. } ?> <?lsmb text('days') ?>
  150. </td>
  151. <td>
  152. <?lsmb PROCESS input element_data = {
  153. label = text('SIC:'),
  154. name = "sic_code",
  155. value = sic_code,
  156. type = "text",
  157. size = "19",
  158. class = 'sic'
  159. } ?>
  160. </td>
  161. </tr>
  162. <tr>
  163. <tr>
  164. <td>
  165. <!-- TODO: Move to elements.html framework. -CT -->
  166. <label for="notes"><?lsmb text('Notes:') ?></label><br/>
  167. <textarea name="notes" rows="3" cols="40" id="notes"></textarea>
  168. </td>
  169. </tr>
  170. </table>
  171. <hr/>
  172. <?lsmb PROCESS button element_data = {
  173. text = text('Save'),
  174. class="submit"
  175. type="submit"
  176. name="action"
  177. value="save"
  178. accesskey="S"
  179. title="Save [Alt-S]"
  180. } ?>
  181. <?lsmb PROCESS button element_data = {
  182. class="submit"
  183. type="submit"
  184. name="action"
  185. value="add_transaction"
  186. accesskey="A"
  187. title="Transaction [Alt-A]"
  188. text = (entity_class == 1) ? text('AP Transaction') : text('AR Transaction')
  189. } ?>
  190. <?lsmb PROCESS button element_data = {
  191. class="submit"
  192. type="submit"
  193. name="action"
  194. value="add_invoice"
  195. accesskey="I"
  196. title="Invoice [Alt-I]"
  197. text = (entity_class == 1) ? text('Vendor Invoice') : text('Customer Invoice')
  198. } ?>
  199. <?lsmb PROCESS button element_data = {
  200. class="submit"
  201. type="submit"
  202. name="action"
  203. value="add_order"
  204. accesskey="O"
  205. title="Order [Alt-O]"
  206. text = (entity_class == 1) ? text('Purchase Order') : text('Sales Order')
  207. } ?>
  208. <?lsmb PROCESS button element_data = {
  209. class="submit"
  210. type="submit"
  211. name="action"
  212. value="rfq"
  213. accesskey="Q"
  214. title="Quotation [Alt-Q]"
  215. text = (entity_class == 1) ? text('RFQ') : text('Quotation')
  216. } ?>
  217. <?lsmb PROCESS button element_data = {
  218. class="submit"
  219. type="submit"
  220. name="action"
  221. value="pricelist"
  222. accesskey="P"
  223. title="Pricelist [Alt-P]"
  224. text = text('Pricelist')
  225. } ?>
  226. </form>
  227. </div>
  228. <?lsmb END ?>
  229. <?lsmb IF entity_id ?>
  230. <div id="location_div" class="container">
  231. <div class="listtop"><?lsmb text('Locations') ?></div>
  232. <!-- This entire form should probably be optionaly automated with AJAX
  233. in oder to prevent user confusion -->
  234. <form id="location_form" action="<?lsmb script ?>">
  235. <?lsmb PROCESS input element_data = {
  236. type="hidden"
  237. name="entity_id"
  238. value=entity_id
  239. } ?>
  240. <?lsmb PROCESS input element_data = {
  241. type="hidden"
  242. name="location_id"
  243. value=location_id
  244. } ?>
  245. <table width="100%">
  246. <tr class="listheading">
  247. <th class="type"><?lsmb text('Type') ?></th>
  248. <th class="line_one"><?lsmb text('Address1') ?></th>
  249. <th class="city"><?lsmb text('City') ?></th>
  250. <th class="state"><?lsmb text('State/Province') ?></th>
  251. <th class="mail_code"><?lsmb text('ZIP/Post Code') ?></th>
  252. <th class="country"><?lsmb text('Country') ?></th>
  253. <th class="actions"><?lsmb text('Actions') ?></th>
  254. </tr>
  255. <?lsmb FOREACH loc = locations ?>
  256. <tr>
  257. <td class="type"><?lsmb loc.class ?></td>
  258. <td class="line_one"><?lsmb loc.line_one ?></td>
  259. <td class="city"><?lsmb loc.city ?></td>
  260. <td class="state"><?lsmb loc.state ?></td>
  261. <td class="mail_code"><?lsmb loc.mail_code ?></td>
  262. <td class="country"><?lsmb loc.country ?></td>
  263. <td class="actions">
  264. <!-- TODO: Automate links with AJAX -->
  265. <a href="<?lsmb script ?>?action=edit&entity_id=<?lsmb id
  266. ?>&location_id=<?lsmb loc.id ?>">[edit]</a>
  267. <a href="<?lsmb script ?>?action=delete_location&entity_id=<?lsmb
  268. id ?>&location_id=<?lmb loc.id ?>">[delete]</a>
  269. </td>
  270. </tr>
  271. <?lsmb END ?>
  272. </table>
  273. <div> <!-- TODO: Move to elements.html -CT -->
  274. <label for="loc_type"><?lsmb text('Type:') ?></label>
  275. <select id='loc_type' name="location_class">
  276. <?lsmb FOREACH lc = location_class_list ?>
  277. <option value="<?lsmb lc.id ?>"><?lsmb lc.class ?></option>
  278. <?lsmb END ?>
  279. </select>
  280. </div>
  281. <div>
  282. <?lsmb PROCESS input element_data = {
  283. label = text('Address:'),
  284. name = "line_one",
  285. value = line_one,
  286. type = "text",
  287. size = "20"
  288. } ?>
  289. </div>
  290. <div>
  291. <?lsmb PROCESS input element_data = {
  292. name = "line_two",
  293. value = line_two,
  294. type = "text",
  295. size = "20"
  296. } ?>
  297. </div>
  298. <div>
  299. <?lsmb PROCESS input element_data = {
  300. name = "line_three",
  301. value = line_three,
  302. type = "text",
  303. size = "20"
  304. } ?>
  305. </div>
  306. <div>
  307. <?lsmb PROCESS input element_data = {
  308. label = text('City:'),
  309. name = "city",
  310. value = city,
  311. type = "text",
  312. size = "20"
  313. } ?>
  314. </div>
  315. <div>
  316. <?lsmb PROCESS input element_data = {
  317. label = text('State/Province:'),
  318. name = "state",
  319. value = state,
  320. type = "text",
  321. size = "20"
  322. } ?>
  323. </div>
  324. <div>
  325. <?lsmb PROCESS input element_data = {
  326. label = text('Zip/Post Code:'),
  327. name = "mail_code",
  328. value = mail_code,
  329. type = "text",
  330. size = "20"
  331. } ?>
  332. </div>
  333. <div> <!-- TODO: Move to elements.html -CT -->
  334. <label for="country"><?lsmb text('Country:') ?></label>
  335. <select name="country" id="country">
  336. <?lsmb FOREACH c = country_list ?>
  337. <option value="<?lsmb c.id ?>"><?lsmb c.name ?></option>
  338. <?lsmb END ?>
  339. </select>
  340. </div>
  341. <div><?lsmb PROCESS button element_data = {
  342. class = "submit"
  343. name = "action"
  344. value = "add_location"
  345. id = "loc_save_location"
  346. text = text('Save Location')
  347. } ?>
  348. </div>
  349. </form>
  350. </div>
  351. <div class="container" id="contact_div">
  352. <div class="listtop"><?lsmb text('Contact Information') ?></div>
  353. <table width="100%">
  354. <tr class="listheading">
  355. <th class="contact_class"><?lsmb text('Type:') ?></th>
  356. <th class="contact"><?lsmb text('Contact Info:') ?></th>
  357. <th class="contact_actions"><?lsmb text('Actions:') ?></th>
  358. </tr>
  359. <?lsmb FOREACH ct = contacts ?>
  360. <tr>
  361. <td class="contact_class"><?lsmb ct.class ?></td>
  362. <td class="contact"><?lsmb ct.contact ?></td>
  363. <td class="contact_actions">
  364. <a href="<?lsmb script ?>?entity_id=<?lsmb entity_id
  365. ?>&contact_id=<?lsmb ct.id
  366. ?>&action=edit_contact"
  367. >[<?lsmb text('Edit'); ?>]</a>&nbsp;&nbsp;
  368. <a href="<?lsmb script ?>?entity_id=<?lsmb entity_id
  369. ?>&contact_id=<?lsmb ct.id
  370. ?>&action=delete_contact"
  371. >[<?lsmb text('Delete'); ?>]</a>
  372. </td>
  373. </tr>
  374. <?lsmb END ?>
  375. </table>
  376. <form action="<?lsmb script ?>">
  377. <?lsmb PROCESS input element_data = {
  378. type="hidden"
  379. name="entity_id"
  380. value=entity_id
  381. } ?>
  382. <?lsmb PROCESS input element_data = {
  383. type="hidden"
  384. name="contact_id"
  385. value=contact_id
  386. } ?>
  387. <div><label for="contact_type"><?lsmb text('Type:') ?></label>
  388. <select name="contact_class" id="contact_type">
  389. <?lsmb FOREACH cc = contact_class_list ?>
  390. <option value="<?lsmb cc.id ?>"><?lsmb cc.class ?></option>
  391. <?lsmb END ?>
  392. </select>
  393. <!-- TODO: Move the above select list to elements.html -CT -->
  394. </div>
  395. <div>
  396. <?lsmb PROCESS input element_data = {
  397. label = text('Contact Info:'),
  398. name = "contact"
  399. value = contact
  400. type = "text"
  401. size = "20"
  402. } ?>
  403. </div>
  404. <div><?lsmb PROCESS button element_data = {
  405. name = "action",
  406. value = "save_contact",
  407. text = text('Save Contact'),
  408. class = "submit"
  409. } ?>
  410. </div>
  411. </form>
  412. </div>
  413. <div class="container" id="bank_div">
  414. <div class="listtop"><?lsmb text('Bank Accounts') ?></div>
  415. <table width="100%">
  416. <tr class="listheading">
  417. <th class="bic"><?lsmb text('BIC/SWIFT Code') ?></th>
  418. <th class="iban"><?lsmb text('Account Number') ?></th>
  419. <th class="actions"><?lsmb text('Actions') ?></th>
  420. </tr>
  421. <?lsmb FOREACH ba = bank_account ?>
  422. <tr>
  423. <td class="bic"><?lsmb ba.bic ?></td>
  424. <td class="iban"><?lsmb ba.iban ?></td>
  425. <td class="actions">
  426. <a href="<?lsmb script ?>?action=edit_bank_acct&entity_id=<?lsmb
  427. entity_id ?>&bank_account_id=<?lsmb ba.id ?>"
  428. >[Edit]</a>
  429. <a href="<?lsmb script ?>?action=delete_bank_acct&entity_id=<?lsmb
  430. entity_id ?>&bank_account_id=<?lsmb ba.id ?>"
  431. >[Delete]</a>
  432. </td>
  433. </tr>
  434. <?lsmb END ?>
  435. </table>
  436. <form name="bank_acct" action="<?lsmb script ?>">
  437. <?lsmb PROCESS input element_data = {
  438. type="hidden"
  439. name="entity_id"
  440. value=entity_id
  441. } ?>
  442. <?lsmb PROCESS input element_data = {
  443. type="hidden"
  444. name="bank_account_id"
  445. value=bank_account_id
  446. } ?>
  447. <div><label for="bic">
  448. <?lsmb PROCESS input element_data = {
  449. type="text"
  450. label = text('BIC/SWIFT Code:')
  451. name="bic"
  452. value=bic
  453. size=20
  454. } ?>
  455. </div>
  456. <div><label for="iban">
  457. <?lsmb PROCESS input element_data = {
  458. type="text"
  459. label = text('Bank Account:')
  460. name="iban"
  461. value=iban
  462. size=20
  463. } ?>
  464. </div>
  465. <div><?lsmb PROCESS button element_data = {
  466. name="action"
  467. value="save_bank_account"
  468. class="submit"
  469. text = text('Save')
  470. } ?>
  471. </div>
  472. </form>
  473. </div>
  474. <div id="notes_div">
  475. <div class="listtop"><?lsmb text('Notes') ?></div>
  476. <?lsmb FOREACH n = notes ?>
  477. <div class="note">
  478. <div class="timestamp"><?lsmb text('Entered at: [_1]', n.created) ?></div>
  479. <div class="contents"><?lsmb n.note ?></div>
  480. <?lsmb END ?>
  481. <form action="<?lsmb script ?>" method="post">
  482. <?lsmb PROCESS input element_data = {
  483. type="hidden"
  484. name="entity_id"
  485. value=entity_id
  486. } ?>
  487. <div class="input"><?lsmb PROCESS textarea element_data = {
  488. label = text('Notes:')
  489. name = notes
  490. } ?></div>
  491. <div class="input">
  492. <?lsmb PROCESS button element_data = {
  493. text = text('Save')
  494. class = 'submit'
  495. name = 'action'
  496. value = 'save_notes'
  497. } ?>
  498. </form>
  499. </div>
  500. <?lsmb END ?>
  501. </body>
  502. </html>