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 %]">
14 [%- INCLUDE 'common/flash.html' %]
16 <div id="oe_tabs" class="tabwidget">
18 <li><a href="#ui-tabs-letter">[% LxERP.t8("Letter") %]</a></li>
20 [%- IF INSTANCE_CONF.get_webdav %]
21 <li><a href="#ui-tabs-webdav">[% LxERP.t8('WebDAV') %]</a></li>
23 <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Letter&object_id=[% HTML.url(letter.id) %]">[% LxERP.t8("Linked Records") %]</a></li>
27 <div id="ui-tabs-letter">
32 <!-- upper left block -->
35 <th align='right'>[% 'Customer' | $T8 %]:</th>
36 <td>[% P.customer_vendor_picker('letter.vc_id', letter.vc_id, type='customer') %]
37 [%- IF letter.customer_id %]
38 <input type="button" value="[% 'Details (one letter abbreviation)' | $T8 %]" onclick="show_vc_details('customer')">
43 <th align='right'>[% 'Contact Person' | $T8 %]</th>
44 <td>[% L.select_tag('letter.cp_id', letter.vc_id ? letter.customer.contacts : [], value_key='cp_id', title_key='full_name', default=letter.cp_id) %]</td>
47 <th align='right'>[% 'Your Reference' | $T8 %]:</th>
48 <td><input name='letter.reference' style='width:70%' value='[% letter.reference | html %]'></td>
51 <!-- /upper left block -->
54 <!-- upper right block -->
55 <table align=center width=90%>
57 <th align='right'>[% 'Letternumber' | $T8 %]:</th>
58 <td><input name='letter.letternumber' style='width:70%' value='[% letter.letternumber | html %]'></td>
61 <th align='right'>[% 'Date' | $T8 %]:</th>
62 <td>[% L.date_tag('letter.date_as_date', letter.date_as_date, readonly=readonly) %]</td>
66 <!-- /upper right block -->
73 <td colspan=2 width=100%>
74 <!-- central block -->
77 <th align=right>[% 'Subject' | $T8 %]</th>
78 <td><textarea name='letter.subject' style='width:100%;font-weight:bold' rows=1>[% letter.subject | html %]</textarea></td>
80 <th align=right>[% 'Greeting' | $T8 %]</th>
81 <td><input name='letter.greeting' style='width:100%;font-weight:bold' value="[% letter.greeting | html %]"></td>
85 <th align=right>[% 'Body' | $T8 %]</th>
86 <td>[% L.textarea_tag('letter.body_as_restricted_html', letter.body_as_restricted_html, style='width:100%', rows=20, class="texteditor") %]</td>
89 <th align=right>[% 'Internal Notes' | $T8 %]</th>
90 <td><textarea name='letter.intnotes' style='width:100%' rows=4>[% letter.intnotes | html %]</textarea></td>
96 <table width=90% align='center'>
101 <td>[% 'Employee' | $T8 %]</td>
105 [%- L.select_tag('letter.employee_id', employees, default=letter.employee_id, title_key='safe_name', class='bold', allow_empty=1, style='width:70%') %]
113 <td>[% 'Salesman' | $T8 %]</td>
117 [%- L.select_tag('letter.salesman_id', employees, default=letter.salesman_id, title_key='safe_name', class='bold', allow_empty=1, style='width:70%') %]
129 <!-- /central block -->
133 <td colspan=3><hr size="3" noshade></td>
143 [% PROCESS 'webdav/_list.html' %]
145 [%- LxERP.t8("Loading...") %]
149 <input type="hidden" name="action" value="Letter/dispatch">
150 <input class="submit" type="submit" name="action_update" id="update_button" value="[% 'Update' | $T8 %]">
152 [%- IF letter.letternumber %]
153 <input class="submit" type="submit" name="action_edit_email" value="[% 'E-mail' | $T8 %]">
154 <input class="submit" type="submit" name="action_print_letter" value="[% 'Print' | $T8 %]">
157 <input class="submit" type="submit" name="action_save" value="[% 'Save' | $T8 %]">
158 [% L.submit_tag('action_delete', LxERP.t8('Delete'), confirm=LxERP.t8('Are you sure you want to delete this letter?')) %]
159 <input class="submit" type="submit" name="action_save_letter_draft" value="[% 'Save Draft' | $T8 %]">
164 <script type='text/javascript'>
166 $('#letter_vc_id').change(function(){
167 var data = $('form').serializeArray();
168 data.push({ name: 'action_update_contacts', value: 1 });
169 $.post('controller.pl', data, kivi.eval_json_result);