Revision 0ff43ab4
Von Bernd Bleßmann vor etwa 6 Jahren hinzugefügt
SL/AM.pm | ||
---|---|---|
47 | 47 |
use SL::DB::Default; |
48 | 48 |
use SL::DB::Employee; |
49 | 49 |
use SL::DB::Chart; |
50 |
use SL::DB::Customer; |
|
51 |
use SL::DB::Part; |
|
52 |
use SL::DB::Vendor; |
|
50 | 53 |
use SL::DB; |
51 | 54 |
use SL::GenericTranslations; |
52 | 55 |
|
... | ... | |
507 | 510 |
return $error; |
508 | 511 |
} |
509 | 512 |
|
513 |
sub displayable_name_specs_by_module { |
|
514 |
+{ |
|
515 |
'SL::DB::Customer' => { |
|
516 |
specs => SL::DB::Customer->displayable_name_specs, |
|
517 |
prefs => SL::DB::Customer->displayable_name_prefs, |
|
518 |
}, |
|
519 |
'SL::DB::Vendor' => { |
|
520 |
specs => SL::DB::Vendor->displayable_name_specs, |
|
521 |
prefs => SL::DB::Vendor->displayable_name_prefs, |
|
522 |
}, |
|
523 |
'SL::DB::Part' => { |
|
524 |
specs => SL::DB::Part->displayable_name_specs, |
|
525 |
prefs => SL::DB::Part->displayable_name_prefs, |
|
526 |
}, |
|
527 |
}; |
|
528 |
} |
|
529 |
|
|
510 | 530 |
sub save_preferences { |
511 | 531 |
$main::lxdebug->enter_sub(); |
512 | 532 |
|
... | ... | |
522 | 542 |
map { ($_ => $form->{$_}) } SL::DB::AuthUser::CONFIG_VARS(), |
523 | 543 |
}); |
524 | 544 |
|
545 |
# Displayable name preferences |
|
546 |
my $displayable_name_specs_by_module = displayable_name_specs_by_module(); |
|
547 |
foreach my $specs (@{ $form->{displayable_name_specs} }) { |
|
548 |
if (!$specs->{value} || $specs->{value} eq $displayable_name_specs_by_module->{$specs->{module}}->{prefs}->get_default()) { |
|
549 |
$displayable_name_specs_by_module->{$specs->{module}}->{prefs}->delete($specs->{value}); |
|
550 |
} else { |
|
551 |
$displayable_name_specs_by_module->{$specs->{module}}->{prefs}->store_value($specs->{value}); |
|
552 |
} |
|
553 |
} |
|
554 |
|
|
525 | 555 |
$main::lxdebug->leave_sub(); |
526 | 556 |
|
527 | 557 |
return 1; |
bin/mozilla/am.pl | ||
---|---|---|
659 | 659 |
$form->{enabled_quick_searchmodules} = \@{$enabled_quick_search}; |
660 | 660 |
$form->{default_quick_searchmodules} = \@quick_search_modules; |
661 | 661 |
|
662 |
$form->{displayable_name_specs_by_module} = AM->displayable_name_specs_by_module(); |
|
663 |
|
|
662 | 664 |
$myconfig{show_form_details} = 1 unless (defined($myconfig{show_form_details})); |
663 | 665 |
$form->{CAN_CHANGE_PASSWORD} = $main::auth->can_change_password(); |
664 | 666 |
$form->{todo_cfg} = { TODO->get_user_config('login' => $::myconfig{login}) }; |
templates/webpages/am/config.html | ||
---|---|---|
163 | 163 |
[% L.input_tag('form_cvars_nr_cols', MYCONFIG.form_cvars_nr_cols || 3, size = 5) %] |
164 | 164 |
</td> |
165 | 165 |
</tr> |
166 |
|
|
166 | 167 |
<tr> |
167 | 168 |
<th align="right">[% 'Quick Searches that will be shown in the header for this user' | $T8 %]</th> |
168 | 169 |
<td colspan=2> |
... | ... | |
179 | 180 |
</div> |
180 | 181 |
</td> |
181 | 182 |
</tr> |
183 |
|
|
184 |
<tr> |
|
185 |
<th align="right">[% 'Displayable Name Preferences' | $T8 %]</th> |
|
186 |
<td> |
|
187 |
<table> |
|
188 |
[% FOREACH module=displayable_name_specs_by_module.keys.sort %] |
|
189 |
[%- SET spec=displayable_name_specs_by_module.$module -%] |
|
190 |
<tr> |
|
191 |
<td align="right">[% spec.specs.title %]</td> |
|
192 |
<td> |
|
193 |
<table> |
|
194 |
<tr> |
|
195 |
<th align="left" class="listheading">[% 'Option' | $T8 %]</th> |
|
196 |
<th align="left" class="listheading">[% 'Name' | $T8 %]</th> |
|
197 |
</tr> |
|
198 |
[% FOREACH option=spec.specs.options %] |
|
199 |
<tr> |
|
200 |
<td>[% option.title %]</td> |
|
201 |
<td>[% option.name %]</td> |
|
202 |
</tr> |
|
203 |
[% END %] |
|
204 |
<tr> |
|
205 |
<th align="left">[% 'Display' | $T8 %]:</th> |
|
206 |
<td> |
|
207 |
[% L.hidden_tag("displayable_name_specs[+].module", module) %] |
|
208 |
[% L.input_tag("displayable_name_specs[].value", spec.prefs.get, size=50) %] |
|
209 |
</td> |
|
210 |
</tr> |
|
211 |
</table> |
|
212 |
</td> |
|
213 |
</tr> |
|
214 |
[% END %] |
|
215 |
</table> |
|
216 |
</td> |
|
217 |
|
|
182 | 218 |
</table> |
183 | 219 |
</div> |
184 | 220 |
|
Auch abrufbar als: Unified diff
DisplayableNamePrefs: Benutzereinstellungen