X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=templates%2Fwebpages%2Fgeneric%2Fmultibox.html;h=28ff8370fbb76dfc4255aade0cd9f1ee429fb181;hb=9bf9acdff05a8047d0561c68cdd93b0a03deb568;hp=b1c615ecd4e0a4e954dd9f563ac576a674052d36;hpb=018e340ac9f0fc9c4b0bd180bd195e7c0fbd3c0e;p=kivitendo-erp.git diff --git a/templates/webpages/generic/multibox.html b/templates/webpages/generic/multibox.html index b1c615ecd..28ff8370f 100644 --- a/templates/webpages/generic/multibox.html +++ b/templates/webpages/generic/multibox.html @@ -6,7 +6,7 @@ decides wether it should be a text field or a drop down box, generates the HTML code, and fixes everything just right. - call: INCLUDE generic/multibox.html var = var, var2 = .... + call: PROCESS generic/multibox.html var = var, var2 = .... options and variables: name : name of the select/textfield @@ -23,43 +23,50 @@ select : java function call for a selection popup or other magic allow_textbox : allow to display a textbox instead of a drop down box if there are more entries than 'limit' entries. limit : defines the limit of entries, after which a textbox is generated. defaults to vclimit, or, failing to find that, 200. + select_name : if a select is displayed, use a different name. ex.: department for textinput, but department_id for selects + readonly : softly prevents modification + class : CSS class names (optional) -%] -[%- DEFAULT - limit = limit != '' ? limit : vclimit != '' ? vclimit : 200 - id = id != '' ? id : name - default = default != '' ? default : $name +[%- + Multibox__limit = limit != '' ? limit : vclimit != '' ? vclimit : 200 + Multibox__show_text = allow_textbox and DATA.size and Multibox__limit < DATA.size ? 1 : 0 + Multibox__id = id != '' && id * 1 != id ? id : name + Multibox__default = default != '' ? default : $name + Multibox__name = (select_name != '' and ! Multibox__show_text) ? select_name : name -%] -[%- FOREACH row = DATA %] - [%- - row.id = row.$id_key != '' ? row.$id_key : $id_sub(row) - row.label = row.$label_key != '' ? row.$label_key - : $label_sub(row) != '' ? $label_sub(row) - : row.id - row.selected = default == row.id - -%] -[%- END -%] -[%- IF allow_textbox and DATA.size and limit < DATA.size %] +[%- IF Multibox__show_text %] -[%- IF select %] + [%- IF Multibox__name %] name="[% Multibox__name | html %]"[% END -%] + [%- IF Multibox__id %] id="[% Multibox__id | html %]"[% END -%] + [%- IF Multibox__default %] value="[% Multibox__default | html %]"[% END -%] + [%- IF style %] style="[% style | html %]"[% END -%] + [%- IF class %] class="[% class | html %]"[% END -%] + [%- IF readonly %] readonly[% END -%] +[%- -%]> +[%- IF select -%] -[% END %] +[%- END -%] [%- ELSE %] [%- END %]