[%- USE HTML %]
[%- USE T8 %]
[%- USE L %]
-<body onload="[% onload %]" width=100%>
-
- <div class="listtop">[% title %]</div>
-
- <form action='letter.pl' method='POST'>
+[%- USE P %]
+[%- USE LxERP %]
+[%- SET WEBDAV = SELF.webdav_objects %]
+<h1>[% title | html %]</h1>
+<form action='controller.pl' method='POST' id='form'>
<input type="hidden" name="letter.id" value="[% letter.id | html %]">
- <input type="hidden" name="letter.draft_id" value="[% letter.draft_id | html %]">
- <input type="hidden" name="title" value="[% title | html %]">
+ <input type="hidden" name="draft.id" value="[% draft.id | html %]">
<input type="hidden" name="type" value="[% type | html %]">
- <input type="hidden" name="print_nextsub" value="print_letter">
+ [% L.hidden_tag('is_sales', SELF.is_sales) %]
+ [%- INCLUDE 'common/flash.html' %]
-<p>
- <table width=100%>
- [%- IF SAVED_MESSAGE %]
- <tr>
- <td colspan=2>[% SAVED_MESSAGE %]</td>
- </tr>
- <tr height=10px><td></td></tr>
- [%- END %]
- <tr>
- <td width=50%>
- <!-- upper left block -->
- <table width=90%>
- <tr>
- <th align='right'>[% 'Customer' | $T8 %]:</th>
- <td>
- [%- INCLUDE 'generic/multibox.html'
- name = 'letter.customer',
- style = 'width:60%',
- DATA = ALL_CUSTOMERS,
- id_sub = 'vc_keys',
- label_key = 'name',
- select = vc_select,
- limit = myconfig_vclimit,
- allow_textbox = 1,
- force_textbox = limit_exceeded_all_customer
- onChange = "document.getElementById('update_button').click();" -%]
-[%- IF letter.customer_id %]
- <input type="button" value="[% 'Details (one letter abbreviation)' | $T8 %]" onclick="show_vc_details('customer')">
-[%- END %]
- <input type='hidden' name='letter.oldcustomer' value='[% letter.oldcustomer | html %]'>
- <input type='hidden' name='letter.customer_id' value='[% letter.customer_id | html %]'>
- <input type='hidden' name='customer_id' value='[% customer_id | html %]'>
-[%- UNLESS myconfig_vclimit < ALL_CUSTOMERS.size %]
- <input type="hidden" name="letter.select[% vc %]" value="1">
+ <div id="oe_tabs" class="tabwidget">
+ <ul>
+ <li><a href="#ui-tabs-letter">[% LxERP.t8("Letter") %]</a></li>
+[%- IF letter.id %]
+ [%- IF INSTANCE_CONF.get_webdav %]
+ <li><a href="#ui-tabs-webdav">[% LxERP.t8('WebDAV') %]</a></li>
+ [%- END %]
+ <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Letter&object_id=[% HTML.url(letter.id) %]">[% LxERP.t8("Linked Records") %]</a></li>
[%- END %]
- </tr>
- <tr>
- <th align='right'>[% 'Contact Person' | $T8 %]</th>
- <td>
- [%- INCLUDE 'generic/multibox.html'
- name = 'letter.cp_id',
- style = 'width:100%',
- DATA = ALL_CONTACTS,
- id_key = 'cp_id',
- label_sub = 'ct_labels',
- show_empty = 1 -%]
- </td>
- </tr>
- <tr>
- <th align='right'>[% 'Your Reference' | $T8 %]:</th>
- <td><input name='letter.reference' style='width:70%' value='[% letter.reference %]'></td>
- </tr>
- </table>
- <!-- /upper left block -->
- </td>
- <td width=50%>
- <!-- upper right block -->
- <table align=center width=90%>
- <tr>
- <th align='right'>[% 'Letternumber' | $T8 %]:</th>
- <td><input name='letter.letternumber' style='width:70%' value='[% letter.letternumber %]'></td>
- </tr>
- <tr>
- <th align='right'>[% 'Date' | $T8 %]:</th>
- <td>[% L.date_tag('letter.date', date, readonly=readonly) %]</td>
- </td>
- </tr>
- </table>
- <!-- /upper right block -->
- </td>
- </tr>
+ </ul>
- <tr height=20></tr>
+ <div id="ui-tabs-letter">
- <tr>
- <td colspan=2 width=100%>
- <!-- central block -->
- <table width=80%>
- <tr>
- <th align=right>[% 'Subject' | $T8 %]</th>
- <td><textarea name='letter.subject' style='width:100%;font-weight:bold' rows=1>[% letter.subject %]</textarea></td>
- </tr>
- <th align=right>[% 'Greeting' | $T8 %]</th>
- <td><input name='letter.greeting' style='width:100%;font-weight:bold' value="[% letter.greeting | html %]"></td>
- </tr>
- <tr>
- <tr>
- <th align=right>[% 'Body' | $T8 %]</th>
- <td><textarea name='letter.body' style='width:100%' rows=20>[% letter.body | html %]</textarea></td>
- </tr>
- <tr height=10></tr>
- <th align=right>[% 'Internal Notes' | $T8 %]</th>
- <td><textarea name='letter.intnotes' style='width:100%' rows=4>[% letter.intnotes | html %]</textarea></td>
- </tr>
-
- <tr>
- <th></th>
- <td>
- <table width=90%>
- <tr>
- <td>
- <table width=100%>
- <tr>
- <td>[% 'Employee' | $T8 %]</td>
- </tr>
- <tr>
- <td>
- [%- INCLUDE 'generic/multibox.html'
- name = 'letter.employee_id',
- default = letter.employee_id,
- style = 'width:70%;font-weight:bold',
- DATA = ALL_EMPLOYEES,
- id_key = 'id',
- label_key = 'name',
- limit = vclimit,
- show_empty = 1,
- allow_textbox = 0,
- force_textbox = limit_exceeded_ALL_EMPLOYEES
- onChange = "document.getElementById('update_button').click();" -%]
- </td>
- </tr>
- <!-- tr><td><input name="employee_position" style=width:70% value='[% employee_position %]'></td></tr -->
- </table>
- </td>
- <td>
- <table width=100%>
- <tr>
- <td>[% 'Salesman' | $T8 %]</td>
- </tr>
- <tr>
- <td>
- [%- INCLUDE 'generic/multibox.html'
- name = 'letter.salesman_id',
- default = letter.salesman_id,
- style = 'width:70%;font-weight:bold',
- DATA = ALL_SALESMEN,
- id_key = 'id',
- label_key = 'name',
- limit = vclimit,
- show_empty = 1,
- allow_textbox = 0,
- force_textbox = limit_exceeded_ALL_SALESMAN
- onChange = "document.getElementById('update_button').click();" -%]
- </td>
- </tr>
- </table>
- </td>
- <td>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <!-- /central block -->
- </td>
- </tr>
- <tr>
- <td colspan=3><hr size="3" noshade></td>
- </tr>
- <tr>
- <td>
- [% print_options %]
- </td>
- </tr>
- </table>
-</p>
+<table width=100%>
+<tr>
+ <td width=50%>
+ <!-- upper left block -->
+ <table width=90%>
+[%- IF SELF.is_sales %]
+ <tr>
+ <th align='right'>[% 'Customer' | $T8 %]:</th>
+ <td>[% P.customer_vendor_picker('letter.customer_id', letter.customer_id, type='customer') %]</td>
+ </tr>
+[%- ELSE %]
+ <tr>
+ <th align='right'>[% 'Vendor' | $T8 %]:</th>
+ <td>[% P.customer_vendor_picker('letter.vendor_id', letter.vendor_id, type='vendor') %]</td>
+ </tr>
+[%- END %]
+ <tr>
+ <th align='right'>[% 'Contact Person' | $T8 %]</th>
+ <td>[% L.select_tag('letter.cp_id', letter.customer_vendor_id ? letter.customer_vendor.contacts : [], value_key='cp_id', title_key='full_name', default=letter.cp_id) %]</td>
+ </tr>
+ <tr>
+ <th align='right'>[% 'Your Reference' | $T8 %]:</th>
+ <td><input name='letter.reference' style='width:70%' value='[% letter.reference | html %]'></td>
+ </tr>
+ </table>
+ <!-- /upper left block -->
+ </td>
+ <td width=50%>
+ <!-- upper right block -->
+ <table align=center width=90%>
+ <tr>
+ <th align='right'>[% 'Letternumber' | $T8 %]:</th>
+ <td><input name='letter.letternumber' style='width:70%' value='[% letter.letternumber | html %]'></td>
+ </tr>
+ <tr>
+ <th align='right'>[% 'Date' | $T8 %]:</th>
+ <td>[% L.date_tag('letter.date_as_date', letter.date_as_date, readonly=readonly) %]</td>
+ </td>
+ </tr>
+ </table>
+ <!-- /upper right block -->
+ </td>
+</tr>
-<input type="hidden" name="action" value="dispatcher">
-<input class="submit" type="submit" name="action_update" id="update_button" value="[% 'Update' | $T8 %]">
+<tr height=20></tr>
-[%- IF letter.letternumber %]
- <input class="submit" type="submit" name="action_print" value="[% 'Print' | $T8 %]">
- <input class="submit" type="submit" name="action_e_mail" value="[% 'E-mail' | $T8 %]">
-[% END %]
+<tr>
+ <td colspan=2 width=100%>
+ <!-- central block -->
+ <table width=80%>
+ <tr>
+ <th align=right>[% 'Subject' | $T8 %]</th>
+ <td><textarea name='letter.subject' style='width:100%;font-weight:bold' rows=1>[% letter.subject | html %]</textarea></td>
+ </tr>
+ <th align=right>[% 'Greeting' | $T8 %]</th>
+ <td><input name='letter.greeting' style='width:100%;font-weight:bold' value="[% letter.greeting | html %]"></td>
+ </tr>
+ <tr>
+ <tr>
+ <th align=right>[% 'Body' | $T8 %]</th>
+ <td>[% L.textarea_tag('letter.body_as_restricted_html', letter.body_as_restricted_html, style='width:100%', rows=20, class="texteditor") %]</td>
+ </tr>
+ <tr height=10></tr>
+ <th align=right>[% 'Internal Notes' | $T8 %]</th>
+ <td><textarea name='letter.intnotes' style='width:100%' rows=4>[% letter.intnotes | html %]</textarea></td>
+ </tr>
-<input class="submit" type="submit" name="action_save" value="[% 'Save' | $T8 %]">
-<input class="submit" type="submit" name="action_save_letter_draft" value="[% 'Save Draft' | $T8 %]">
+ <tr>
+ <th></th>
+ <td>
+ <table width=90% align='center'>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr>
+ <td>[% 'Employee' | $T8 %]</td>
+ </tr>
+ <tr>
+ <td>
+ [%- L.select_tag('letter.employee_id', employees, default=letter.employee_id, title_key='safe_name', class='bold', allow_empty=1, style='width:70%') %]
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td>
+ <table width=100%>
+ <tr>
+ <td>[% 'Salesman' | $T8 %]</td>
+ </tr>
+ <tr>
+ <td>
+ [%- L.select_tag('letter.salesman_id', employees, default=letter.salesman_id, title_key='safe_name', class='bold', allow_empty=1, style='width:70%') %]
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ <!-- /central block -->
+ </td>
+</tr>
+</table>
- </form>
+<div id="email_inputs" class="hidden"></div>
+<div id="print_options" class="hidden">
+ [% print_options %]
+</div>
- <script type="text/javascript">
- <!--
- Calendar.setup({ inputField : "date", ifFormat :"[% myconfig_jsc_dateformat %]", align : "BL", button : "date_button" });
- //-->
- </script>
- <script type="text/javascript" src="js/show_vc_details.js"></script>
-</body>
+ </div>
+ [% PROCESS 'webdav/_list.html' %]
+ <div id="ui-tabs-1">
+ [%- LxERP.t8("Loading...") %]
+ </div>
+</div>
+</form>
+<div id="print_dialog" class="hidden">
+ [%- PROCESS 'common/_print_dialog.html' %]
+</div>