Fake-%::myconfig erstellen
[kivitendo-erp.git] / templates / webpages / amcvar / display_cvar_config_form.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3   <script type='text/javascript'>
4     $(function(){document.Form.name.focus();});
5   </script>
6
7  <style type="text/css">
8   .small {
9     font-size: 0.75em;
10   }
11  </style>
12
13  <div class="listtop">[% title %]</div>
14
15  <form action="amcvar.pl" name="Form" method="post">
16
17   <p>
18    <table>
19     <tr>
20      <td align="right">[% 'Module' | $T8 %]</td>
21      <td>
22       [%- INCLUDE generic/multibox.html
23             name      = 'module',
24             id_key    = 'module',
25             label_key = 'description',
26             DATA      = MODULES,
27             onChange   = "document.getElementById('update_button').click();" %]
28      </td>
29     </tr>
30
31     <tr>
32      <td align="right">[% 'Variable Name' | $T8 %]<sup><span class="small">(1)</span></sup></td>
33      <td><input name="name" value="[% HTML.escape(name) %]"></td>
34     </tr>
35
36     <tr>
37      <td align="right">[% 'Variable Description' | $T8 %]<sup><span class="small">(2)</span></sup></td>
38      <td><input name="description" value="[% HTML.escape(description) %]"></td>
39     </tr>
40
41     <tr>
42      <td align="right">[% 'Type' | $T8 %]<sup><span class="small">(3)</span></sup></td>
43      <td>
44       <select name="type">
45        [%- FOREACH row = TYPES %]
46        <option value="[% HTML.escape(row.type) %]"[% IF row.type == type %] selected[% END %]>[% HTML.escape(row.type_tr) %]</option>
47        [%- END %]
48       </select>
49      </td>
50     </tr>
51
52     <tr>
53      <td align="right">[% 'Default value' | $T8 %]<sup><span class="small">(4)</span></sup></td>
54      <td><input name="default_value" value="[% HTML.escape(default_value) %]"></td>
55     </tr>
56
57     <tr>
58      <td align="right">[% 'Options' | $T8 %]<sup><span class="small">(5)</span></sup></td>
59      <td><input name="options" value="[% HTML.escape(options) %]"></td>
60     </tr>
61
62     <tr>
63      <td align="right">[% 'Is Searchable' | $T8 %]<sup><span class="small"></span></sup></td>
64      <td>
65       <input type="radio" name="searchable" id="searchable_1" value="1"[% IF searchable %] checked[% END %]>
66       <label for="searchable_1">[% 'Yes' | $T8 %]</label>
67       <input type="radio" name="searchable" id="searchable_0" value="0"[% UNLESS searchable %] checked[% END %]>
68       <label for="searchable_0">[% 'No' | $T8 %]</label>
69      </td>
70     </tr>
71
72     <tr>
73      <td align="right">[% 'Includeable in reports' | $T8 %]<sup><span class="small"></span></sup></td>
74      <td>
75       <select name="inclusion">
76        <option value="no"[% UNLESS includeable %] selected[% END %]>[% 'No' | $T8 %]</option>
77        <option value="yes"[% IF includeable && !included_by_default %] selected[% END %]>[% 'Yes' | $T8 %]</option>
78        <option value="yes_default_on"[% IF included_by_default %] selected[% END %]>[% 'Yes, included by default' | $T8 %]</option>
79       </select>
80      </td>
81     </tr>
82
83     [%- IF module == 'IC' %]
84     <tr>
85      <td align="right">[% 'Editable' | $T8 %]<sup><span class="small">(5)</span></sup></td>
86      <td>
87       <input type="radio" name="flag_editable" id="flag_editable_1" value="1"[% IF flag_editable %] checked[% END %]>
88       <label for="flag_editable_1">[% 'Yes' | $T8 %]</label>
89       <input type="radio" name="flag_editable" id="flag_editable_0" value="0"[% UNLESS flag_editable %] checked[% END %]>
90       <label for="flag_editable_0">[% 'No' | $T8 %]</label>
91      </td>
92     </tr>
93     [%- END %]
94    </table>
95   </p>
96
97   <input type="hidden" name="id" value="[% HTML.escape(id) %]">
98
99   <p>
100    <input type="submit" name="action" id="update_button" value="[% 'Update' | $T8 %]">
101    <input type="submit" name="action" value="[% 'Save' | $T8 %]">
102    [%- IF id %]
103    <input type="submit" name="action" value="[% 'Delete' | $T8 %]">
104    [%- END %]
105   </p>
106
107   <hr>
108
109   <h3>[% 'Annotations' | $T8 %]</h3>
110
111   <p>
112    (1) [% 'The variable name must only consist of letters, numbers and underscores. It must begin with a letter. Example: send_christmas_present' | $T8 %]
113   </p>
114
115   <p>
116    (2) [% 'The description is shown on the form. Chose something short and descriptive.' | $T8 %]
117   </p>
118   <p>
119    (3) [% 'For type "customer" the perl module JSON is required. Please check this on system level: $ ./scripts/installation_check.pl' | $T8 %]
120   </p>
121
122   <p>
123    (4) [% 'The default value depends on the variable type:' | $T8 %]
124    <br>
125    <ul>
126     <li>[%- 'Text, text field and number variables: The default value will be used as-is.' | $T8 %]</li>
127     <li>[%- 'Boolean variables: If the default value is non-empty then the checkbox will be checked by default and unchecked otherwise.' | $T8 %]</li>
128     <li>[%- 'Date and timestamp variables: If the default value equals \'NOW\' then the current date/current timestamp will be used. Otherwise the default value is copied as-is.' | $T8 %]</li>
129    </ul>
130   </p>
131
132   <p>
133    (5) [% 'The available options depend on the varibale type:' | $T8 %]
134    <br>
135    <ul>
136     <li>[%- 'Text variables: \'MAXLENGTH=n\' sets the maximum entry length to \'n\'.' | $T8 %]</li>
137     <li>[%- 'Text field variables: \'WIDTH=w HEIGHT=h\' sets the width and height of the text field. They default to 30 and 5 respectively.' | $T8 %]</li>
138     <li>[%- 'Number variables: \'PRECISION=n\' forces numbers to be shown with exactly n decimal places.' | $T8 %]</li>
139     <li>[%- 'Selection fields: The option field must contain the available options for the selection. Options are separated by \'##\', for example \'Early##Normal##Late\'.' | $T8 %]</li>
140    </ul>
141    <br>
142    [% 'Other values are ignored.' | $T8 %]
143   </p>
144
145   [%- IF module == 'IC' %]
146   <p>
147    (6)
148
149    [%- 'A variable marked as \'editable\' can be changed in each quotation, order, invoice etc.' | $T8 %]
150
151    [% 'Otherwise the variable is only available for printing.' | $T8 %]
152   </p>
153   [%- END %]
154
155  </form>
156