Revision 976b1ddf
Von Kivitendo Admin vor fast 10 Jahren hinzugefügt
SL/Presenter/Part.pm | ||
---|---|---|
100 | 100 |
overwritten with C<$params{id}>). |
101 | 101 |
|
102 | 102 |
An additional dummy input will be generated which is used to find |
103 |
parts. For a detailed description of it's behaviour, see section
|
|
103 |
parts. For a detailed description of its behaviour, see section |
|
104 | 104 |
C<PART PICKER SPECIFICATION>. |
105 | 105 |
|
106 | 106 |
C<$value> can be a parts id or a C<Rose::DB:Object> instance. |
... | ... | |
116 | 116 |
If C<%params> contains C<convertible_unit> only parts with a unit |
117 | 117 |
that's convertible to unit will be used for autocompletion. |
118 | 118 |
|
119 |
Obsolete parts will by default not displayed for selection. However they are |
|
119 |
Obsolete parts will by default not be displayed for selection. However they are
|
|
120 | 120 |
accepted as default values and can persist during updates. As with other |
121 | 121 |
selectors though, they are not selectable once overridden. |
122 | 122 |
|
... | ... | |
167 | 167 |
|
168 | 168 |
=item * |
169 | 169 |
|
170 |
Should not be constraint to exact matches
|
|
170 |
Should not be constrained to exact matches
|
|
171 | 171 |
|
172 | 172 |
=back |
173 | 173 |
|
... | ... | |
196 | 196 |
|
197 | 197 |
=item 5 |
198 | 198 |
|
199 |
An internal status of the part picker, indicating wether id input and dummy |
|
199 |
An internal status of the part picker, indicating whether id input and dummy
|
|
200 | 200 |
input are consistent. After leaving the dummy input the part picker must |
201 | 201 |
place itself in a consistent status. |
202 | 202 |
|
SL/Presenter/Record.pm | ||
---|---|---|
570 | 570 |
=item C<with_columns> |
571 | 571 |
|
572 | 572 |
Can be set by the caller to indicate additional columns to |
573 |
list. Currently supported:
|
|
573 |
be listed. Currently supported:
|
|
574 | 574 |
|
575 | 575 |
=over 2 |
576 | 576 |
|
577 | 577 |
=item C<record_link_destination> |
578 | 578 |
|
579 |
The record link destination. Requires that the records to list have
|
|
579 |
The record link destination. Requires that the records to be listed have
|
|
580 | 580 |
been retrieved via the L<SL::DB::Helper::LinkedRecords> helper. |
581 | 581 |
|
582 | 582 |
=back |
... | ... | |
584 | 584 |
=item C<edit_record_links> |
585 | 585 |
|
586 | 586 |
If trueish additional controls will be rendered that allow the user to |
587 |
remove and add record links. Requires that the records to list have
|
|
587 |
remove and add record links. Requires that the records to be listed have
|
|
588 | 588 |
been retrieved via the L<SL::DB::Helper::LinkedRecords> helper. |
589 | 589 |
|
590 | 590 |
=back |
SL/Presenter/Tag.pm | ||
---|---|---|
222 | 222 |
|
223 | 223 |
=head1 SYNOPSIS |
224 | 224 |
|
225 |
Usage from a template:
|
|
225 |
Usage in a template:
|
|
226 | 226 |
|
227 | 227 |
[% USE P %] |
228 | 228 |
|
... | ... | |
230 | 230 |
|
231 | 231 |
[% P.select_tag('direction', [ { direction => 'left', display => 'To the left' }, |
232 | 232 |
{ direction => 'right', display => 'To the right' } ], |
233 |
value_key => 'direction', title_key => 'display', default => 'right')) %]
|
|
233 |
value_key => 'direction', title_key => 'display', default => 'right') %] |
|
234 | 234 |
|
235 | 235 |
[% P.select_tag('direction', [ { direction => 'left', display => 'To the left' }, |
236 | 236 |
{ direction => 'right', display => 'To the right', selected => 1 } ], |
237 |
value_key => 'direction', title_key => 'display')) %]
|
|
237 |
value_key => 'direction', title_key => 'display') %] |
|
238 | 238 |
|
239 |
# Use an RDBO object and it's n:m relatioship as the default
|
|
240 |
# values. For example, a user can be a member in many groups. "All
|
|
239 |
# Use an RDBO object and its n:m relationship as the default
|
|
240 |
# values. For example, a user can be a member of many groups. "All
|
|
241 | 241 |
# groups" is therefore the full collection and "$user->groups" is a |
242 | 242 |
# list of RDBO AuthGroup objects whose IDs must match the ones in |
243 | 243 |
# "All groups". This could look like the following: |
... | ... | |
316 | 316 |
|
317 | 317 |
=item C<select_tag $name, \@collection, %attributes> |
318 | 318 |
|
319 |
Creates a HTML 'select' tag named C<$name> with the contents of one |
|
319 |
Creates an HTML 'select' tag named C<$name> with the contents of one
|
|
320 | 320 |
'E<lt>optionE<gt>' tag for each element in C<\@collection> and with arbitrary |
321 | 321 |
HTML attributes from C<%attributes>. The value |
322 | 322 |
to use and the title to display are extracted from the elements in |
... | ... | |
387 | 387 |
|
388 | 388 |
=back |
389 | 389 |
|
390 |
5. also applies for single RDBO instances (due to 'wantarray'
|
|
391 |
shenanigangs assigning RDBO's relationships to a hash key will result
|
|
390 |
5. also applies to single RDBO instances (due to 'wantarray'
|
|
391 |
shenanigans assigning RDBO's relationships to a hash key will result |
|
392 | 392 |
in a single RDBO object being assigned instead of an array reference |
393 | 393 |
containing that single RDBO object). |
394 | 394 |
|
395 | 395 |
If the option C<with_optgroups> is set then this function expects |
396 | 396 |
C<\@collection> to be one level deeper. The upper-most level is |
397 |
translated into a HTML C<optgroup> tag. So the structure becomes: |
|
397 |
translated into an HTML C<optgroup> tag. So the structure becomes:
|
|
398 | 398 |
|
399 | 399 |
=over 4 |
400 | 400 |
|
401 | 401 |
=item 1. Array of array references. Each element in the |
402 | 402 |
C<\@collection> is converted into an optgroup. |
403 | 403 |
|
404 |
=item 2. The optgroup's C<label> attribute will be set to the the
|
|
404 |
=item 2. The optgroup's C<label> attribute will be set to the |
|
405 | 405 |
first element in the array element. The second array element is then |
406 |
converted to a list of C<option> tags like it is described above.
|
|
406 |
converted to a list of C<option> tags as described above.
|
|
407 | 407 |
|
408 | 408 |
=back |
409 | 409 |
|
... | ... | |
411 | 411 |
|
412 | 412 |
# First in a controller: |
413 | 413 |
my @collection = ( |
414 |
[ t8("First optgroup with two items"),
|
|
414 |
[ t8("First optgroup with three items"),
|
|
415 | 415 |
[ { id => 42, name => "item one" }, |
416 | 416 |
{ id => 54, name => "second item" }, |
417 | 417 |
{ id => 23, name => "and the third one" }, |
Auch abrufbar als: Unified diff
Typos in Doku/perlpod