X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=templates%2Fwebpages%2Fgeneric%2Fmultibox.html;h=b26f86f0dd138c1724ef6fc2fe882040079a1465;hb=4bbb5dbe9a272bc31d5f059b3ece3e230c2a6642;hp=5d8e8632115376a97fdb7a942051f48e19559870;hpb=91ab1ef646193de9359076a876a33a74d7691145;p=kivitendo-erp.git diff --git a/templates/webpages/generic/multibox.html b/templates/webpages/generic/multibox.html index 5d8e86321..b26f86f0d 100644 --- a/templates/webpages/generic/multibox.html +++ b/templates/webpages/generic/multibox.html @@ -6,59 +6,68 @@ 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: INCLUDE generic/multibox.html var = var, var2 = .... options and variables: - name : name of the select/textfield - id : id of the select/textfield, optional, defaults to name - default : entered/selected value. defaults to a dereference of name, since it is usually set to that for update mechanisms - id_key : key that holds the id in each row. - id_sub : name of a perl sub that calculates the id for each row. will be called with a hashref. - label_key : key that holds the label in each row. - label_sub : name of a perl sub that calculates the label for each row. will be called with a hashref. - DATA : the actual data, expected to be arrayref of hashrefs, usually what's returned by the all_vc routines. - limit : defines the limit of entries, after which a textbox is generated. defaults to vclimit, or, failing to find that, 50. - show_empty : show an empty first line in select boxes. defaults to false - style : additional style information - onChange : java magic on change - select : java function call for a selection popup or other magic + name : name of the select/textfield + id : id of the select/textfield, optional, defaults to name + default : entered/selected value. defaults to a dereference of name, since it is usually set to that for update mechanisms + id_key : key that holds the id in each row. + id_sub : name of a perl sub that calculates the id for each row. will be called with a hashref. + label_key : key that holds the label in each row. + label_sub : name of a perl sub that calculates the label for each row. will be called with a hashref. + DATA : the actual data, expected to be arrayref of hashrefs, usually what's returned by the all_vc routines. + show_empty : show an empty first line in select boxes. defaults to false + style : additional style information + onChange : java magic on change + 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 -%] -[%- DEFAULT - limit = limit != '' ? limit : 50 - id = id != '' ? id : name +[%- DEFAULT + limit = limit != '' ? limit : vclimit != '' ? vclimit : 200 + show_text = allow_textbox and DATA.size and limit < DATA.size ? 1 : 0 + id = id != '' ? id : name default = default != '' ? default : $name -%] +[%- + name = (select_name != '' and ! 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.label = row.$label_key != '' ? row.$label_key + : $label_sub(row) != '' ? $label_sub(row) : row.id row.selected = default == row.id -%] [%- END -%] -[%- IF DATA.size and limit < DATA.size %] - -[%~ IF select %] - -[% END ~%] +[%- IF show_text %] + +[%- IF select -%] + +[%- END -%] [%- ELSE %] - [%- IF show_empty %] [%- END %] [%- FOREACH row = DATA %] - + [%- END %] [%- END %]