6 <h1>[% title | html %]</h1>
8 <form action='controller.pl' method='POST'>
9 <input type="hidden" name="letter.id" value="[% letter.id | html %]">
10 <input type="hidden" name="draft.id" value="[% draft.id | html %]">
11 <input type="hidden" name="type" value="[% type | html %]">
13 [%- PROCESS 'common/flash.html' %]
18 <!-- upper left block -->
21 <th align='right'>[% 'Customer' | $T8 %]:</th>
22 <td>[% P.customer_vendor_picker('letter.vc_id', letter.vc_id, type='customer') %]
23 [%- IF letter.customer_id %]
24 <input type="button" value="[% 'Details (one letter abbreviation)' | $T8 %]" onclick="show_vc_details('customer')">
29 <th align='right'>[% 'Contact Person' | $T8 %]</th>
30 <td>[% L.select_tag('letter.cp_id', letter.cp_id ? letter.customer.contacts : [], value_key='cp_id', title_key='full_name', default=letter.cp_id) %]</td>
33 <th align='right'>[% 'Your Reference' | $T8 %]:</th>
34 <td><input name='letter.reference' style='width:70%' value='[% letter.reference | html %]'></td>
37 <!-- /upper left block -->
40 <!-- upper right block -->
41 <table align=center width=90%>
43 <th align='right'>[% 'Letternumber' | $T8 %]:</th>
44 <td><input name='letter.letternumber' style='width:70%' value='[% letter.letternumber | html %]'></td>
47 <th align='right'>[% 'Date' | $T8 %]:</th>
48 <td>[% L.date_tag('letter.date_as_date', letter.date_as_date, readonly=readonly) %]</td>
52 <!-- /upper right block -->
59 <td colspan=2 width=100%>
60 <!-- central block -->
63 <th align=right>[% 'Subject' | $T8 %]</th>
64 <td><textarea name='letter.subject' style='width:100%;font-weight:bold' rows=1>[% letter.subject | html %]</textarea></td>
66 <th align=right>[% 'Greeting' | $T8 %]</th>
67 <td><input name='letter.greeting' style='width:100%;font-weight:bold' value="[% letter.greeting | html %]"></td>
71 <th align=right>[% 'Body' | $T8 %]</th>
72 <td>[% L.textarea_tag('letter.body_as_restricted_html', letter.body_as_restricted_html, style='width:100%', rows=20, class="texteditor") %]</td>
75 <th align=right>[% 'Internal Notes' | $T8 %]</th>
76 <td><textarea name='letter.intnotes' style='width:100%' rows=4>[% letter.intnotes | html %]</textarea></td>
82 <table width=90% align='center'>
87 <td>[% 'Employee' | $T8 %]</td>
91 [%- L.select_tag('letter.employee_id', employees, default=letter.employee_id, title_key='safe_name', class='bold', allow_empty=1, style='width:70%') %]
99 <td>[% 'Salesman' | $T8 %]</td>
103 [%- L.select_tag('letter.salesman_id', employees, default=letter.salesman_id, title_key='safe_name', class='bold', allow_empty=1, style='width:70%') %]
115 <!-- /central block -->
119 <td colspan=3><hr size="3" noshade></td>
128 <input type="hidden" name="action" value="Letter/dispatch">
129 <input class="submit" type="submit" name="action_update" id="update_button" value="[% 'Update' | $T8 %]">
131 [%- IF letter.letternumber %]
132 <input class="submit" type="submit" name="action_print_letter" value="[% 'Print' | $T8 %]">
135 <input class="submit" type="submit" name="action_save" value="[% 'Save' | $T8 %]">
136 [% L.submit_tag('action_delete', LxERP.t8('Delete'), confirm=LxERP.t8('Are you sure you want to delete this letter?')) %]
137 <input class="submit" type="submit" name="action_save_letter_draft" value="[% 'Save Draft' | $T8 %]">
142 <script type='text/javascript'>
144 $('#letter_vc_id').change(function(){
145 var data = $('form').serializeArray();
146 data.push({ name: 'action_update_contacts', value: 1 });
147 $.post('controller.pl', data, kivi.eval_json_result);