6 [%- SET WEBDAV = SELF.webdav_objects %]
7 <h1>[% title | html %]</h1>
9 <form action='controller.pl' method='POST'>
10 <input type="hidden" name="letter.id" value="[% letter.id | html %]">
11 <input type="hidden" name="draft.id" value="[% draft.id | html %]">
12 <input type="hidden" name="type" value="[% type | html %]">
13 [% L.hidden_tag('is_sales', SELF.is_sales) %]
15 [%- INCLUDE 'common/flash.html' %]
17 <div id="oe_tabs" class="tabwidget">
19 <li><a href="#ui-tabs-letter">[% LxERP.t8("Letter") %]</a></li>
21 [%- IF INSTANCE_CONF.get_webdav %]
22 <li><a href="#ui-tabs-webdav">[% LxERP.t8('WebDAV') %]</a></li>
24 <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Letter&object_id=[% HTML.url(letter.id) %]">[% LxERP.t8("Linked Records") %]</a></li>
28 <div id="ui-tabs-letter">
33 <!-- upper left block -->
35 [%- IF SELF.is_sales %]
37 <th align='right'>[% 'Customer' | $T8 %]:</th>
38 <td>[% P.customer_vendor_picker('letter.customer_id', letter.customer_id, type='customer') %]</td>
42 <th align='right'>[% 'Vendor' | $T8 %]:</th>
43 <td>[% P.customer_vendor_picker('letter.vendor_id', letter.vendor_id, type='vendor') %]</td>
47 <th align='right'>[% 'Contact Person' | $T8 %]</th>
48 <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>
51 <th align='right'>[% 'Your Reference' | $T8 %]:</th>
52 <td><input name='letter.reference' style='width:70%' value='[% letter.reference | html %]'></td>
55 <!-- /upper left block -->
58 <!-- upper right block -->
59 <table align=center width=90%>
61 <th align='right'>[% 'Letternumber' | $T8 %]:</th>
62 <td><input name='letter.letternumber' style='width:70%' value='[% letter.letternumber | html %]'></td>
65 <th align='right'>[% 'Date' | $T8 %]:</th>
66 <td>[% L.date_tag('letter.date_as_date', letter.date_as_date, readonly=readonly) %]</td>
70 <!-- /upper right block -->
77 <td colspan=2 width=100%>
78 <!-- central block -->
81 <th align=right>[% 'Subject' | $T8 %]</th>
82 <td><textarea name='letter.subject' style='width:100%;font-weight:bold' rows=1>[% letter.subject | html %]</textarea></td>
84 <th align=right>[% 'Greeting' | $T8 %]</th>
85 <td><input name='letter.greeting' style='width:100%;font-weight:bold' value="[% letter.greeting | html %]"></td>
89 <th align=right>[% 'Body' | $T8 %]</th>
90 <td>[% L.textarea_tag('letter.body_as_restricted_html', letter.body_as_restricted_html, style='width:100%', rows=20, class="texteditor") %]</td>
93 <th align=right>[% 'Internal Notes' | $T8 %]</th>
94 <td><textarea name='letter.intnotes' style='width:100%' rows=4>[% letter.intnotes | html %]</textarea></td>
100 <table width=90% align='center'>
105 <td>[% 'Employee' | $T8 %]</td>
109 [%- L.select_tag('letter.employee_id', employees, default=letter.employee_id, title_key='safe_name', class='bold', allow_empty=1, style='width:70%') %]
117 <td>[% 'Salesman' | $T8 %]</td>
121 [%- L.select_tag('letter.salesman_id', employees, default=letter.salesman_id, title_key='safe_name', class='bold', allow_empty=1, style='width:70%') %]
133 <!-- /central block -->
137 <td colspan=3><hr size="3" noshade></td>
147 [% PROCESS 'webdav/_list.html' %]
149 [%- LxERP.t8("Loading...") %]
153 <input type="hidden" name="action" value="Letter/dispatch">
154 <input class="submit" type="submit" name="action_update" id="update_button" value="[% 'Update' | $T8 %]">
156 [%- IF letter.letternumber %]
157 <input class="submit" type="submit" name="action_edit_email" value="[% 'E-mail' | $T8 %]">
158 <input class="submit" type="submit" name="action_print_letter" value="[% 'Print' | $T8 %]">
161 <input class="submit" type="submit" name="action_save" value="[% 'Save' | $T8 %]">
162 [% L.submit_tag('action_delete', LxERP.t8('Delete'), confirm=LxERP.t8('Are you sure you want to delete this letter?')) %]
163 <input class="submit" type="submit" name="action_save_letter_draft" value="[% 'Save Draft' | $T8 %]">
168 <script type='text/javascript'>
170 $('#letter_customer_id').change(function(){
171 var data = $('form').serializeArray();
172 data.push({ name: 'action_update_contacts', value: 1 });
173 $.post('controller.pl', data, kivi.eval_json_result);
175 $('#letter_vendor_id').change(function(){
176 var data = $('form').serializeArray();
177 data.push({ name: 'action_update_contacts', value: 1 });
178 $.post('controller.pl', data, kivi.eval_json_result);