Abteilungen bei Ansprechpersonen: Freitext-Feld und/oder Auswahlliste
[kivitendo-erp.git] / templates / webpages / customer_vendor / tabs / contacts.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3 [%- USE LxERP %]
4 [%- USE L %]
5
6 <div id="contacts">
7   <table>
8     <tr>
9       <th align="right">[% 'Contacts' | $T8 %]</th>
10
11       <td>
12         [%
13           L.select_tag(
14             'contact.cp_id',
15             SELF.contacts,
16             default = SELF.contact.cp_id,
17             with_empty = 1,
18             empty_title = LxERP.t8('New contact'),
19             value_key = 'cp_id',
20             title_key = 'full_name',
21             onchange = "kivi.CustomerVendor.selectContact({onFormSet: function(){ contactsMapWidget.testInputs(); kivi.reinit_widgets(); }});",
22           )
23         %]
24       </td>
25     </tr>
26     <tr>
27       <th align="right" nowrap>[% 'Main Contact Person' | $T8 %]</th>
28       <td>[% L.yes_no_tag('contact.cp_main', SELF.contact.cp_main) %]</td>
29     </tr>
30     <tr>
31       <th align="right" nowrap>[% 'Gender' | $T8 %]</th>
32
33       <td>
34         [%
35           L.select_tag(
36             'contact.cp_gender',
37             [['m', LxERP.t8('male')], ['f', LxERP.t8('female')]],
38             default = SELF.contact.cp_gender
39           )
40         %]
41       </td>
42     </tr>
43
44     <tr>
45       <th align="right" nowrap>[% 'Title' | $T8 %]</th>
46
47       <td>
48         [%- IF INSTANCE_CONF.get_contact_titles_use_textfield -%]
49           [% L.input_tag('contact.cp_title', SELF.contact.cp_title, size = 40) %]
50           [% L.select_tag('contact_cp_title_select', SELF.all_contact_titles, default = SELF.contact.cp_title, value_key = 'description', title_key = 'description', with_empty = 1, onchange = '$("#contact_cp_title").val(this.value);') %]
51         [%- ELSE -%]
52           [% L.select_tag('contact.cp_title', SELF.all_contact_titles, default = SELF.contact.cp_title, value_key = 'description', title_key = 'description', with_empty = 1) %]
53         [%- END -%]
54       </td>
55     </tr>
56
57     <tr>
58       <th align="right" nowrap>[% 'Department' | $T8 %]</th>
59
60       <td>
61         [%- IF INSTANCE_CONF.get_contact_departments_use_textfield -%]
62           [% L.input_tag('contact.cp_abteilung', SELF.contact.cp_abteilung, size = 40) %]
63           [% L.select_tag('contact_cp_abteilung_select', SELF.all_contact_departments, default = SELF.contact.cp_abteilung, value_key = 'description', title_key = 'description', with_empty = 1, onchange = '$("#contact_cp_abteilung").val(this.value);') %]
64         [%- ELSE -%]
65           [% L.select_tag('contact.cp_abteilung', SELF.all_contact_departments, default = SELF.contact.cp_abteilung, value_key = 'description', title_key = 'description', with_empty = 1) %]
66         [%- END -%]
67       </td>
68     </tr>
69
70     <tr>
71       <th align="right" nowrap>[% 'Function/position' | $T8 %]</th>
72
73       <td>
74         [% L.input_tag('contact.cp_position', SELF.contact.cp_position, size = 40) %]
75       </td>
76     </tr>
77
78     <tr>
79       <th align="right" nowrap>[% 'Given Name' | $T8 %]</th>
80
81       <td>
82         [% L.input_tag('contact.cp_givenname', SELF.contact.cp_givenname, size = 40) %]
83       </td>
84     </tr>
85
86     <tr>
87       <th align="right" nowrap>[% 'Surname' | $T8 %]</th>
88
89       <td>
90         [% L.input_tag('contact.cp_name', SELF.contact.cp_name, size = 40) %]
91       </td>
92     </tr>
93
94     <tr>
95       <th align="right" nowrap>[% 'E-mail' | $T8 %]</th>
96
97       <td>
98         [% L.input_tag('contact.cp_email', SELF.contact.cp_email, size = 40) %]
99       </td>
100     </tr>
101
102     <tr>
103       <th align="right" nowrap>[% 'Phone1' | $T8 %]</th>
104
105       <td>
106         [% L.input_tag('contact.cp_phone1', SELF.contact.cp_phone1, size = 40) %]
107       </td>
108     </tr>
109
110     <tr>
111       <th align="right" nowrap>[% 'Phone2' | $T8 %]</th>
112
113       <td>
114         [% L.input_tag('contact.cp_phone2', SELF.contact.cp_phone2, size = 40) %]
115       </td>
116     </tr>
117
118     <tr>
119       <th align="right" nowrap>[% 'Fax' | $T8 %]</th>
120
121       <td>
122         [% L.input_tag('contact.cp_fax', SELF.contact.cp_fax, size = 40) %]
123       </td>
124     </tr>
125
126     <tr>
127       <th align="right" nowrap>[% 'Mobile1' | $T8 %]</th>
128
129       <td>
130         [% L.input_tag('contact.cp_mobile1', SELF.contact.cp_mobile1, size = 40) %]
131       </td>
132     </tr>
133
134     <tr>
135       <th align="right" nowrap>[% 'Mobile2' | $T8 %]</th>
136
137       <td>
138         [% L.input_tag('contact.cp_mobile2', SELF.contact.cp_mobile2, size = 40) %]
139       </td>
140     </tr>
141
142     <tr>
143       <th align="right" nowrap>[% 'Sat. Phone' | $T8 %]</th>
144
145       <td>
146         [% L.input_tag('contact.cp_satphone', SELF.contact.cp_satphone, size = 40) %]
147       </td>
148     </tr>
149
150     <tr>
151       <th align="right" nowrap>[% 'Sat. Fax' | $T8 %]</th>
152
153       <td>
154         [% L.input_tag('contact.cp_satfax', SELF.contact.cp_satfax, size = 40) %]
155       </td>
156     </tr>
157
158     <tr>
159       <th align="right" nowrap>[% 'Project' | $T8 %]</th>
160
161       <td>
162         [% L.input_tag('contact.cp_project', SELF.contact.cp_project, size = 40) %]
163       </td>
164     </tr>
165
166     <tr>
167       <th align="right" nowrap>[% 'Street' | $T8 %]</th>
168
169       <td>
170         [% L.input_tag('contact.cp_street', SELF.contact.cp_street, size = 40) %]
171         <span id="contact_map"></span>
172         <script type="text/javascript">
173           var contactsMapWidget = new kivi.CustomerVendor.MapWidget('contact_cp_');
174           $(function() {
175             contactsMapWidget.render($('#contact_map'));
176           });
177         </script>
178       </td>
179     </tr>
180
181     <tr>
182       <th align="right" nowrap>[% 'Zip, City' | $T8 %]</th>
183
184       <td>
185         [% L.input_tag('contact.cp_zipcode', SELF.contact.cp_zipcode, size = 5) %]
186         [% L.input_tag('contact.cp_city', SELF.contact.cp_city, size = 25) %]
187       </td>
188     </tr>
189
190     <tr>
191       <th align="right" nowrap>[% 'Private Phone' | $T8 %]</th>
192
193       <td>
194         [% L.input_tag('contact.cp_privatphone', SELF.contact.cp_privatphone, size = 40) %]
195       </td>
196     </tr>
197
198     <tr>
199       <th align="right" nowrap>[% 'Private E-mail' | $T8 %]</th>
200
201       <td>
202         [% L.input_tag('contact.cp_privatemail', SELF.contact.cp_privatemail, size = 40) %]
203       </td>
204     </tr>
205
206     <tr>
207       <th align="right" nowrap>[% 'Birthday' | $T8 %]</th>
208
209       <td>
210         [% L.date_tag('contact.cp_birthday', SELF.contact.cp_birthday) %]
211       </td>
212     </tr>
213
214     [% contact_cvars = SELF.contact.cvars_by_config %]
215
216     [% IF ( contact_cvars.size ) %]
217       <tr>
218         <td colspan="2">
219           <hr>
220         </td>
221       </tr>
222
223       [% FOREACH var = contact_cvars %]
224         <tr>
225           <th align="right" valign="top" nowrap>[% var.config.description | html %]</th>
226
227           <td valign="top">
228             [% INCLUDE 'common/render_cvar_input.html'
229                        cvar_name_prefix = 'contact_cvars.'
230             %]
231           </td>
232         </tr>
233       [% END %]
234     [% END %]
235
236   </table>
237
238   [% L.button_tag('submitInputButton("delete_contact");', LxERP.t8('Delete Contact'), id = 'action_delete_contact', class = 'submit') %]
239   [% IF ( !SELF.contact.cp_id ) %]
240     <script type="text/javascript">
241       $('#action_delete_contact').hide();
242     </script>
243   [% END %]
244 </div>