Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 89c92c1c

Von Hans P. Schlaepfer vor etwa 4 Jahren hinzugefügt

  • ID 89c92c1ce3763e2d135afc6395667937175a15b5
  • Vorgänger ecc9f66c
  • Nachfolger cc1cfde8

Neues Design 2019 Standard-Code templates/webpages/custom_variable_config/form.html

Unterschiede anzeigen:

templates/webpages/custom_variable_config/form.html
5 5

  
6 6
<h1>[% HTML.escape(title) %]</h1>
7 7

  
8
<div class="wrapper">
8 9
<form action="controller.pl" method="post" id="form">
9
 [%- L.hidden_tag("id", SELF.config.id) %]
10

  
11
 <p>
12
  <table>
13
   <tr>
14
    <td align="right">[% 'Module' | $T8 %]</td>
15
    <td>[%- L.select_tag('module', SELF.modules, value_key='module', title_key='description', default=SELF.module, onchange="update_ic_rows();") %]</td>
16
   </tr>
17

  
18
   <tr>
19
    <td align="right">[% 'Variable Name' | $T8 %]<sup><span class="small-text">(1)</span></sup></td>
20
    <td>[%- L.input_tag("config.name", SELF.config.name, class='initial_focus') %]</td>
21
   </tr>
22

  
23
   <tr>
24
    <td align="right">[% 'Variable Description' | $T8 %]<sup><span class="small-text">(2)</span></sup></td>
25
    <td>[%- L.input_tag("config.description", SELF.config.description) %]</td>
26
   </tr>
27

  
28
   <tr>
29
    <td align="right">[% 'Type' | $T8 %]<sup><span class="small-text">(3)</span></sup></td>
30
    <td>[% L.select_tag("config.type", SELF.translated_types, value_key='type', title_key='translation', default=SELF.config.type) %]</td>
31
   </tr>
32

  
33
   <tr>
34
    <td align="right">[% 'Default value' | $T8 %]<sup><span class="small-text">(4)</span></sup></td>
35
    <td>[%- L.input_tag("config.default_value", SELF.config.type == 'number' ? LxERP.format_amount(SELF.config.default_value, 2) : SELF.config.default_value) %]</td>
36
   </tr>
37

  
38
   <tr>
39
    <td align="right">[% 'Options' | $T8 %]<sup><span class="small-text">(5)</span></sup></td>
40
    <td>[%- L.input_tag("config.options", SELF.config.options) %]</td>
41
   </tr>
42

  
43
   <tr>
44
    <td align="right">[% 'Is Searchable' | $T8 %]</td>
45
    <td>
46
     [% L.radio_button_tag('config.searchable', value='1', id='config_searchable_1', label=LxERP.t8('Yes'), checked=(SELF.config.searchable ?  1 : '')) %]
47
     [% L.radio_button_tag('config.searchable', value='0', id='config_searchable_0', label=LxERP.t8('No'),  checked=(SELF.config.searchable ? '' :  1)) %]
48
    </td>
49
   </tr>
50

  
51
   <tr>
52
    <td align="right">[% 'Includeable in reports' | $T8 %]</td>
53
    <td>
54
     [% L.radio_button_tag('config.includeable', value='1', id='config_includeable_1', label=LxERP.t8('Yes'), checked=(SELF.config.includeable ?  1 : ''), onclick='update_included_by_default()') %]
55
     [% L.radio_button_tag('config.includeable', value='0', id='config_includeable_0', label=LxERP.t8('No'),  checked=(SELF.config.includeable ? '' :  1), onclick='update_included_by_default()') %]
56
    </td>
57
   </tr>
58

  
59
   <tr>
60
    <td align="right">[% 'Included in reports by default' | $T8 %]</td>
61
    <td>
62
     [% SET disabled = SELF.config.includeable ? '' : 'disabled' %]
63
     [% L.radio_button_tag('config.included_by_default', value='1', id='config_included_by_default_1', label=LxERP.t8('Yes'), checked=(SELF.config.included_by_default ?  1 : ''), disabled=disabled) %]
64
     [% L.radio_button_tag('config.included_by_default', value='0', id='config_included_by_default_0', label=LxERP.t8('No'),  checked=(SELF.config.included_by_default ? '' :  1), disabled=disabled) %]
65
    </td>
66
   </tr>
67

  
68
   <tr data-show-for="IC"[% UNLESS SELF.module == 'IC' %] style="display: none;"[% END %]>
69
    <td align="right">[% 'Editable' | $T8 %]<sup><span class="small-text">(6)</span></sup></td>
70
    <td>
71
     [% L.radio_button_tag('config.flag_editable', value='1', id='config.flag_editable_1', label=LxERP.t8('Yes'), checked=(SELF.flags.editable ?  1 : '')) %]
72
     [% L.radio_button_tag('config.flag_editable', value='0', id='config.flag_editable_0', label=LxERP.t8('No'),  checked=(SELF.flags.editable ? '' :  1)) %]
73
    </td>
74
   </tr>
75
   <tr data-show-for="IC"[% UNLESS SELF.module == 'IC' %] style="display: none;"[% END %]>
76
    <td align="right">[% 'Deactivate by default' | $T8 %]<sup><span class="small-text">(7)</span></sup></td>
77
    <td>
78
     [% L.radio_button_tag('config.flag_defaults_to_invalid', value='1', id='config.flag_defaults_to_invalid_1', label=LxERP.t8('Yes'), checked=(SELF.flags.defaults_to_invalid ?  1 : '')) %]
79
     [% L.radio_button_tag('config.flag_defaults_to_invalid', value='0', id='config.flag_defaults_to_invalid_0', label=LxERP.t8('No'),  checked=(SELF.flags.defaults_to_invalid ? '' :  1)) %]
80
    </td>
81
   </tr>
82
   <tr data-show-for="IC"[% UNLESS SELF.module == 'IC' %] style="display: none;"[% END %]>
83
    <td align="right">[% 'Filter by Partsgroups' | $T8 %]</td>
84
    <td>
85
     [% L.radio_button_tag('config.flag_partsgroup_filter', value='1', id='config_flag_partsgroup_filter_1', label=LxERP.t8('Yes'), checked=(SELF.flags.partsgroup_filter ?  1 : ''), onclick='update_pg_filter_row()') %]
86
     [% L.radio_button_tag('config.flag_partsgroup_filter', value='0', id='config_flag_partsgroup_filter_0', label=LxERP.t8('No'),  checked=(SELF.flags.partsgroup_filter ? '' :  1), onclick='update_pg_filter_row()') %]
87
    </td>
88
   </tr>
89
   <tr data-show-for="IC+PGFILTER"[% UNLESS (SELF.module == 'IC' && SELF.flags.partsgroup_filter) %] style="display: none;"[% END %]>
90
    <td></td>
91
    <td>
92
  [% L.select_tag('config.partsgroups[]',
93
                      all_partsgroups,
94
                      id                => "partsgroups",
95
                      value_key         => "id",
96
                      title_key         => "partsgroup",
97
                      default           => SELF.config.partsgroups,
98
                      default_value_key => "id",
99
                      multiple          => 1) %]
100
      [% L.multiselect2side("partsgroups",
101
                            labelsx => LxERP.t8("All partsgroups"),
102
                            labeldx => LxERP.t8("Partsgroups where variables are shown")) %]
103
    </td>
104
   </tr>
105
  </table>
106
 </p>
107

  
108
 <hr>
109

  
110
 <h3>[% 'Annotations' | $T8 %]</h3>
111

  
112
 <p>
113
  (1) [% 'The variable name must only consist of letters, numbers and underscores. It must begin with a letter. Example: send_christmas_present' | $T8 %]
114
 </p>
115

  
116
 <p>
117
  (2) [% 'The description is shown on the form. Chose something short and descriptive.' | $T8 %]
118
 </p>
119
 <p>
120
  (3) [% 'For type "customer" the perl module JSON is required. Please check this on system level: $ ./scripts/installation_check.pl' | $T8 %]
121
 </p>
122

  
123
 <p>
124
  (4) [% 'The default value depends on the variable type:' | $T8 %]
125
  <br>
126
  <ul>
127
   <li>[%- 'Text, text field and number variables: The default value will be used as-is.' | $T8 %]</li>
128
   <li>[%- 'Boolean variables: If the default value is non-empty then the checkbox will be checked by default and unchecked otherwise.' | $T8 %]</li>
129
   <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>
130
  </ul>
131
 </p>
132

  
133
 <p>
134
  (5) [% 'The available options depend on the varibale type:' | $T8 %]
135
  <br>
136
  <ul>
137
   <li>[%- 'Text variables: \'MAXLENGTH=n\' sets the maximum entry length to \'n\'.' | $T8 %]</li>
138
   <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>
139
   <li>[%- 'Number variables: \'PRECISION=n\' forces numbers to be shown with exactly n decimal places.' | $T8 %]</li>
140
   <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>
141
  </ul>
142
  <br>
143
  [% 'Other values are ignored.' | $T8 %]
144
 </p>
145

  
146
 <p data-show-for="IC"[% UNLESS SELF.module == 'IC' %] style="display: none;"[% END %]>
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

  
154
 <p data-show-for="IC"[% UNLESS SELF.module == 'IC' %] style="display: none;"[% END %]>
155
  (7)
156

  
157
  [%- 'A variable marked as \'Deactivate by default\' isn\'t automatically added to all articles, and has to be explicitly added for each desired article in its master data tab. Only then can the variable be used for that article in the records.' | $T8 %]
158
 </p>
10
 [% L.hidden_tag("id", SELF.config.id) %]
11

  
12
<table class="tbl-horizontal">
13
  <caption>[% 'Custom Variable' | $T8 %]</caption>
14
  <colgroup><col class="wi-normal"><col class="wi-wider"></colgroup>
15
  <tbody>
16
    <tr>
17
      <th>[% 'Module' | $T8 %]</th>
18
      <td>[% L.select_tag('module', SELF.modules, value_key='module', title_key='description', default=SELF.module, onchange="update_ic_rows();", class="wi-wider") %]</td>
19
    </tr>
20
    <tr>
21
      <th>[% 'Variable Name' | $T8 %]<sup>(1)</sup></th>
22
      <td>[% L.input_tag("config.name", SELF.config.name, class='initial_focus', class='wi-wider') %]</td>
23
    </tr>
24
    <tr>
25
      <th>[% 'Variable Description' | $T8 %]<sup>(2)</sup></th>
26
      <td>[% L.input_tag("config.description", SELF.config.description, class='wi-wider') %]</td>
27
    </tr>
28
    <tr>
29
      <th>[% 'Type' | $T8 %]<sup>(3)</sup></th>
30
      <td>[% L.select_tag("config.type", SELF.translated_types, value_key='type', title_key='translation', default=SELF.config.type, class='wi-normal') %]</td>
31
    </tr>
32
    <tr>
33
      <th>[% 'Default value' | $T8 %]<sup>(4)</sup></th>
34
      <td>[% L.input_tag("config.default_value", SELF.config.type == 'number' ? LxERP.format_amount(SELF.config.default_value, 2) : SELF.config.default_value, class='wi-wider') %]</td>
35
    </tr>
36
    <tr>
37
      <th>[% 'Options' | $T8 %]<sup>(5)</sup></th>
38
      <td>
39
        <textarea name="[% config.options %]" id="[% config.options %]" class="wi-wider" cols="5" rows="3">[% SELF.config.options %]</textarea>
40
        [% #L.input_tag("config.options", SELF.config.options, class='wi-wider') %]
41
      </td>
42
    </tr>
43
    <tr>
44
      <th>[% 'Is Searchable' | $T8 %]</th>
45
      <td class="horizontal">
46
        [% L.radio_button_tag('config.searchable', value='1', id='config_searchable_1', label=LxERP.t8('Yes'), checked=(SELF.config.searchable ?  1 : '')) %]
47
        [% L.radio_button_tag('config.searchable', value='0', id='config_searchable_0', label=LxERP.t8('No'),  checked=(SELF.config.searchable ? '' :  1)) %]
48
      </td>
49
    </tr>
50
    <tr>
51
      <th>[% 'Includeable in reports' | $T8 %]</th>
52
      <td class="horizontal">
53
        [% L.radio_button_tag('config.includeable', value='1', id='config_includeable_1', label=LxERP.t8('Yes'), checked=(SELF.config.includeable ?  1 : ''), onclick='update_included_by_default()') %]
54
        [% L.radio_button_tag('config.includeable', value='0', id='config_includeable_0', label=LxERP.t8('No'),  checked=(SELF.config.includeable ? '' :  1), onclick='update_included_by_default()') %]
55
      </td>
56
    </tr>
57
    <tr>
58
      <th>[% 'Included in reports by default' | $T8 %]</th>
59
      <td class="horizontal">
60
        [% SET disabled = SELF.config.includeable ? '' : 'disabled' %]
61
        [% L.radio_button_tag('config.included_by_default', value='1', id='config_included_by_default_1', label=LxERP.t8('Yes'), checked=(SELF.config.included_by_default ?  1 : ''), disabled=disabled) %]
62
        [% L.radio_button_tag('config.included_by_default', value='0', id='config_included_by_default_0', label=LxERP.t8('No'),  checked=(SELF.config.included_by_default ? '' :  1), disabled=disabled) %]
63
      </td>
64
    </tr>
65
    <tr data-show-for="IC"[% UNLESS SELF.module == 'IC' %] style="display: none;"[% END %]>
66
      <th>[% 'Editable' | $T8 %]<sup>(6)</sup></th>
67
      <td class="horizontal">
68
        [% L.radio_button_tag('config.flag_editable', value='1', id='config.flag_editable_1', label=LxERP.t8('Yes'), checked=(SELF.flags.editable ?  1 : '')) %]
69
        [% L.radio_button_tag('config.flag_editable', value='0', id='config.flag_editable_0', label=LxERP.t8('No'),  checked=(SELF.flags.editable ? '' :  1)) %]
70
      </td>
71
    </tr>
72
    <tr data-show-for="IC"[% UNLESS SELF.module == 'IC' %] style="display: none;"[% END %]>
73
      <th>[% 'Deactivate by default' | $T8 %]<sup>(7)</sup></th>
74
      <td class="horizontal">
75
        [% L.radio_button_tag('config.flag_defaults_to_invalid', value='1', id='config.flag_defaults_to_invalid_1', label=LxERP.t8('Yes'), checked=(SELF.flags.defaults_to_invalid ?  1 : '')) %]
76
        [% L.radio_button_tag('config.flag_defaults_to_invalid', value='0', id='config.flag_defaults_to_invalid_0', label=LxERP.t8('No'),  checked=(SELF.flags.defaults_to_invalid ? '' :  1)) %]
77
      </td>
78
    </tr>
79
    <tr data-show-for="IC"[% UNLESS SELF.module == 'IC' %] style="display: none;"[% END %]>
80
      <th>[% 'Filter by Partsgroups' | $T8 %]</th>
81
      <td class="horizontal">
82
        [% L.radio_button_tag('config.flag_partsgroup_filter', value='1', id='config_flag_partsgroup_filter_1', label=LxERP.t8('Yes'), checked=(SELF.flags.partsgroup_filter ?  1 : ''), onclick='update_pg_filter_row()') %]
83
        [% L.radio_button_tag('config.flag_partsgroup_filter', value='0', id='config_flag_partsgroup_filter_0', label=LxERP.t8('No'),  checked=(SELF.flags.partsgroup_filter ? '' :  1), onclick='update_pg_filter_row()') %]
84
      </td>
85
    </tr>
86
    <tr data-show-for="IC+PGFILTER"[% UNLESS (SELF.module == 'IC' && SELF.flags.partsgroup_filter) %] style="display: none;"[% END %]>
87
      <th></th>
88
      <td>[% L.select_tag(
89
                'config.partsgroups[]',
90
                all_partsgroups,
91
                id                => "partsgroups",
92
                value_key         => "id",
93
                title_key         => "partsgroup",
94
                default           => SELF.config.partsgroups,
95
                default_value_key => "id",
96
                multiple          => 1)
97
          %]
98
          [% L.multiselect2side(
99
                "partsgroups",
100
                labelsx => LxERP.t8("All partsgroups"),
101
                labeldx => LxERP.t8("Partsgroups where variables are shown"))
102
          %]
103
      </td>
104
    </tr>
105
  </tbody>
106
</table>
107

  
108
<div class="col" style="width:40.0em;">
109
<h3 class="caption">[% 'Annotations' | $T8 %]</h3>
110
<div class="long-description">
111

  
112
<ul class="footnotes">
113
  <li><sup>(1)</sup> [% 'The variable name must only consist of letters, numbers and underscores. It must begin with a letter. Example: send_christmas_present' | $T8 %]</li>
114
  <li><sup>(2)</sup> [% 'The description is shown on the form. Chose something short and descriptive.' | $T8 %]</li>
115
  <li><sup>(3)</sup> [% 'For type "customer" the perl module JSON is required. Please check this on system level: $ ./scripts/installation_check.pl' | $T8 %]</li>
116
  <li><sup>(4)</sup> [% 'The default value depends on the variable type:' | $T8 %]
117
    <ul>
118
      <li>[% 'Text, text field and number variables: The default value will be used as-is.' | $T8 %]</li>
119
      <li>[% 'Boolean variables: If the default value is non-empty then the checkbox will be checked by default and unchecked otherwise.' | $T8 %]</li>
120
      <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>
121
    </ul>
122
  </li>
123
  <li><sup>(5)</sup> [% 'The available options depend on the varibale type:' | $T8 %]
124
    <ul>
125
      <li>[% 'Text variables: \'MAXLENGTH=n\' sets the maximum entry length to \'n\'.' | $T8 %]</li>
126
      <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>
127
      <li>[% 'Number variables: \'PRECISION=n\' forces numbers to be shown with exactly n decimal places.' | $T8 %]</li>
128
      <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>
129
    </ul>
130
  [% 'Other values are ignored.' | $T8 %]</li>
131
</ul>
132

  
133
<!--
134
<p><sup>(1)</sup> [% 'The variable name must only consist of letters, numbers and underscores. It must begin with a letter. Example: send_christmas_present' | $T8 %]</p>
135
<p><sup>(2)</sup> [% 'The description is shown on the form. Chose something short and descriptive.' | $T8 %]</p>
136
<p><sup>(3)</sup> [% 'For type "customer" the perl module JSON is required. Please check this on system level: $ ./scripts/installation_check.pl' | $T8 %]</p>
137
<p><sup>(4)</sup> [% 'The default value depends on the variable type:' | $T8 %]</p>
138
<ul>
139
<li>[% 'Text, text field and number variables: The default value will be used as-is.' | $T8 %]</li>
140
<li>[% 'Boolean variables: If the default value is non-empty then the checkbox will be checked by default and unchecked otherwise.' | $T8 %]</li>
141
<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>
142
</ul>
143
<p><sup>(5)</sup> [% 'The available options depend on the varibale type:' | $T8 %]</p>
144
<ul>
145
<li>[% 'Text variables: \'MAXLENGTH=n\' sets the maximum entry length to \'n\'.' | $T8 %]</li>
146
<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>
147
<li>[% 'Number variables: \'PRECISION=n\' forces numbers to be shown with exactly n decimal places.' | $T8 %]</li>
148
<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>
149
</ul>
150
<p>[% 'Other values are ignored.' | $T8 %]</p>
151

  
152
<div data-show-for="IC"[% UNLESS SELF.module == 'IC' %] style="display: none;"[% END %]>
153
  <p><sup>(6)</sup> [% 'A variable marked as \'editable\' can be changed in each quotation, order, invoice etc.' | $T8 %] [% 'Otherwise the variable is only available for printing.' | $T8 %]</p>
154
</div>
155
<div data-show-for="IC"[% UNLESS SELF.module == 'IC' %] style="display: none;"[% END %]>
156
  <p><sup>(7)</sup> [% 'A variable marked as \'Deactivate by default\' isn\'t automatically added to all articles, and has to be explicitly added for each desired article in its master data tab. Only then can the variable be used for that article in the records.' | $T8 %]</p>
157
</div>
158
 -->
159

  
160
</div><!-- /.long-description -->
161
</div><!-- /.col -->
159 162

  
160 163
</form>
164
</div><!-- /.wrapper -->
165

  
166

  
161 167

  
162 168
<script type="text/javascript">
163 169
<!--

Auch abrufbar als: Unified diff