Revision 40df0193
Von Bernd Bleßmann vor mehr als 3 Jahren hinzugefügt
SL/Controller/Project.pm | ||
---|---|---|
120 | 120 |
|
121 | 121 |
$::form->{sort_by} = 'customer_and_description'; |
122 | 122 |
|
123 |
my $description_style = ($::form->{description_style} =~ m{both|number|description|full}) |
|
124 |
? $::form->{description_style} |
|
125 |
: 'full'; |
|
126 |
|
|
123 | 127 |
my @hashes = map { |
124 | 128 |
+{ |
125 |
value => $_->full_description(style => 'full'),
|
|
126 |
label => $_->full_description(style => 'full'),
|
|
129 |
value => $_->full_description(style => $description_style),
|
|
130 |
label => $_->full_description(style => $description_style),
|
|
127 | 131 |
id => $_->id, |
128 | 132 |
projectnumber => $_->projectnumber, |
129 | 133 |
description => $_->description, |
SL/Presenter/Project.pm | ||
---|---|---|
39 | 39 |
push @classes, 'project_autocomplete'; |
40 | 40 |
|
41 | 41 |
|
42 |
my %data_params = map { $_ => delete $params{$_} } grep { defined $params{$_} } qw(customer_id active valid); |
|
42 |
my %data_params = map { $_ => delete $params{$_} } grep { defined $params{$_} } qw(customer_id active valid description_style);
|
|
43 | 43 |
|
44 | 44 |
my $ret = |
45 | 45 |
input_tag($name, (ref $value && $value->can('id') ? $value->id : ''), class => "@classes", type => 'hidden', id => $id, |
js/autocomplete_project.js | ||
---|---|---|
93 | 93 |
data['filter.valid'] = 'valid'; // default |
94 | 94 |
} |
95 | 95 |
|
96 |
if (o.description_style) |
|
97 |
data['description_style'] = o.description_style; |
|
98 |
|
|
96 | 99 |
return data; |
97 | 100 |
} |
98 | 101 |
|
templates/webpages/project/test_page.html | ||
---|---|---|
46 | 46 |
[% P.project.picker('project12_id', '', active='both', valid='both',style='width: 300px') %] all (active, inactive, valid, invalid) |
47 | 47 |
<br> |
48 | 48 |
|
49 |
<br> |
|
50 |
[% P.project.picker('project13_id', '', style='width: 300px') %] description style full (default) |
|
51 |
<br> |
|
52 |
|
|
53 |
<br> |
|
54 |
[% P.project.picker('project14_id', '', description_style='full', style='width: 300px') %] description style full (explicit) |
|
55 |
<br> |
|
56 |
|
|
57 |
<br> |
|
58 |
[% P.project.picker('project15_id', '', description_style='both', style='width: 300px') %] description style both |
|
59 |
<br> |
|
60 |
|
|
61 |
<br> |
|
62 |
[% P.project.picker('project16_id', '', description_style='number', style='width: 300px') %] description style number |
|
63 |
<br> |
|
64 |
|
|
65 |
<br> |
|
66 |
[% P.project.picker('project17_id', '', description_style='description', style='width: 300px') %] description style description |
|
67 |
<br> |
|
68 |
|
|
69 |
<br> |
|
70 |
|
|
49 | 71 |
Runtime test:<br> |
50 | 72 |
<div id='runtime_picker'>' |
51 | 73 |
|
Auch abrufbar als: Unified diff
Projekt-Picker: Stil der Beschreibung angeben können
dem Picker kann mit "description_style" mitgegeben werden, wie die
Ergebnisse angezeigt werden. Mögliche Werte: "both", "number",
"description" und "full" (in SL::DB::Project->full_description)
definiert).