Flash-Template Macro immer per INCLUDE dazunehmen
[kivitendo-erp.git] / templates / webpages / letter / edit.html
1 [%- USE HTML %]
2 [%- USE T8 %]
3 [%- USE L %]
4 [%- USE P %]
5 [%- USE LxERP %]
6 <h1>[% title | html %]</h1>
7
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 %]">
12
13   [%- INCLUDE 'common/flash.html' %]
14
15   <div id="oe_tabs" class="tabwidget">
16    <ul>
17     <li><a href="#ui-tabs-letter">[% LxERP.t8("Letter") %]</a></li>
18 [%- IF letter.id %]
19     <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Letter&object_id=[% HTML.url(letter.id) %]">[% LxERP.t8("Linked Records") %]</a></li>
20 [%- END %]
21    </ul>
22
23    <div id="ui-tabs-letter">
24
25 <table width=100%>
26 <tr>
27  <td width=50%>
28   <!-- upper left block -->
29    <table width=90%>
30     <tr>
31      <th align='right'>[% 'Customer' | $T8 %]:</th>
32      <td>[% P.customer_vendor_picker('letter.vc_id', letter.vc_id, type='customer') %]
33 [%- IF letter.customer_id %]
34       <input type="button" value="[% 'Details (one letter abbreviation)' | $T8 %]" onclick="show_vc_details('customer')">
35 [%- END %]
36      </td>
37     </tr>
38     <tr>
39      <th align='right'>[% 'Contact Person' | $T8 %]</th>
40      <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>
41     </tr>
42     <tr>
43      <th align='right'>[% 'Your Reference' | $T8 %]:</th>
44      <td><input name='letter.reference' style='width:70%' value='[% letter.reference | html %]'></td>
45     </tr>
46    </table>
47   <!-- /upper left block -->
48  </td>
49  <td width=50%>
50   <!-- upper right block -->
51    <table align=center width=90%>
52     <tr>
53      <th align='right'>[% 'Letternumber' | $T8 %]:</th>
54      <td><input name='letter.letternumber' style='width:70%' value='[% letter.letternumber | html %]'></td>
55     </tr>
56     <tr>
57      <th align='right'>[% 'Date' | $T8 %]:</th>
58       <td>[% L.date_tag('letter.date_as_date', letter.date_as_date, readonly=readonly) %]</td>
59      </td>
60     </tr>
61    </table>
62   <!-- /upper right block -->
63  </td>
64 </tr>
65
66 <tr height=20></tr>
67
68 <tr>
69  <td colspan=2 width=100%>
70   <!-- central block -->
71    <table width=80%>
72     <tr>
73      <th align=right>[% 'Subject' | $T8 %]</th>
74      <td><textarea name='letter.subject' style='width:100%;font-weight:bold' rows=1>[% letter.subject | html %]</textarea></td>
75     </tr>
76      <th align=right>[% 'Greeting' | $T8 %]</th>
77      <td><input name='letter.greeting' style='width:100%;font-weight:bold' value="[% letter.greeting | html %]"></td>
78     </tr>
79     <tr>
80     <tr>
81      <th align=right>[% 'Body' | $T8 %]</th>
82      <td>[% L.textarea_tag('letter.body_as_restricted_html', letter.body_as_restricted_html, style='width:100%', rows=20, class="texteditor") %]</td>
83     </tr>
84     <tr height=10></tr>
85      <th align=right>[% 'Internal Notes' | $T8 %]</th>
86      <td><textarea name='letter.intnotes' style='width:100%' rows=4>[% letter.intnotes | html %]</textarea></td>
87     </tr>
88
89     <tr>
90      <th></th>
91      <td>
92       <table width=90% align='center'>
93        <tr>
94         <td>
95          <table width=100%>
96           <tr>
97            <td>[% 'Employee' | $T8 %]</td>
98           </tr>
99           <tr>
100            <td>
101             [%- L.select_tag('letter.employee_id', employees, default=letter.employee_id, title_key='safe_name', class='bold', allow_empty=1, style='width:70%') %]
102            </td>
103           </tr>
104          </table>
105         </td>
106         <td>
107          <table width=100%>
108           <tr>
109            <td>[% 'Salesman' | $T8 %]</td>
110           </tr>
111           <tr>
112            <td>
113             [%- L.select_tag('letter.salesman_id', employees, default=letter.salesman_id, title_key='safe_name', class='bold', allow_empty=1, style='width:70%') %]
114            </td>
115           </tr>
116          </table>
117         </td>
118         <td>
119         </td>
120        </tr>
121       </table>
122      </td>
123     </tr>
124    </table>
125   <!-- /central block -->
126  </td>
127 </tr>
128 <tr>
129   <td colspan=3><hr size="3" noshade></td>
130 </tr>
131 <tr>
132  <td>
133    [% print_options %]
134  </td>
135 </tr>
136 </table>
137
138  </div>
139  <div id="ui-tabs-1">
140   [%- LxERP.t8("Loading...") %]
141  </div>
142 </div>
143
144 <input type="hidden" name="action" value="Letter/dispatch">
145 <input class="submit" type="submit" name="action_update" id="update_button" value="[% 'Update' | $T8 %]">
146
147 [%- IF letter.letternumber %]
148   <input class="submit" type="submit" name="action_print_letter" value="[% 'Print' | $T8 %]">
149 [% END %]
150
151 <input class="submit" type="submit" name="action_save" value="[% 'Save' | $T8 %]">
152 [% L.submit_tag('action_delete', LxERP.t8('Delete'), confirm=LxERP.t8('Are you sure you want to delete this letter?')) %]
153 <input class="submit" type="submit" name="action_save_letter_draft" value="[% 'Save Draft' | $T8 %]">
154
155 </form>
156
157
158 <script type='text/javascript'>
159   $(function(){
160     $('#letter_vc_id').change(function(){
161       var data = $('form').serializeArray();
162       data.push({ name: 'action_update_contacts', value: 1 });
163       $.post('controller.pl', data, kivi.eval_json_result);
164     })
165   })
166 </script>