use SL::DB::Default;
use SL::DB::Employee;
use SL::DB::Chart;
+use SL::DB::Customer;
+use SL::DB::Part;
+use SL::DB::Vendor;
use SL::DB;
use SL::GenericTranslations;
return $error;
}
+sub displayable_name_specs_by_module {
+ +{
+ 'SL::DB::Customer' => {
+ specs => SL::DB::Customer->displayable_name_specs,
+ prefs => SL::DB::Customer->displayable_name_prefs,
+ },
+ 'SL::DB::Vendor' => {
+ specs => SL::DB::Vendor->displayable_name_specs,
+ prefs => SL::DB::Vendor->displayable_name_prefs,
+ },
+ 'SL::DB::Part' => {
+ specs => SL::DB::Part->displayable_name_specs,
+ prefs => SL::DB::Part->displayable_name_prefs,
+ },
+ };
+}
+
sub save_preferences {
$main::lxdebug->enter_sub();
map { ($_ => $form->{$_}) } SL::DB::AuthUser::CONFIG_VARS(),
});
+ # Displayable name preferences
+ my $displayable_name_specs_by_module = displayable_name_specs_by_module();
+ foreach my $specs (@{ $form->{displayable_name_specs} }) {
+ if (!$specs->{value} || $specs->{value} eq $displayable_name_specs_by_module->{$specs->{module}}->{prefs}->get_default()) {
+ $displayable_name_specs_by_module->{$specs->{module}}->{prefs}->delete($specs->{value});
+ } else {
+ $displayable_name_specs_by_module->{$specs->{module}}->{prefs}->store_value($specs->{value});
+ }
+ }
+
$main::lxdebug->leave_sub();
return 1;
$form->{enabled_quick_searchmodules} = \@{$enabled_quick_search};
$form->{default_quick_searchmodules} = \@quick_search_modules;
+ $form->{displayable_name_specs_by_module} = AM->displayable_name_specs_by_module();
+
$myconfig{show_form_details} = 1 unless (defined($myconfig{show_form_details}));
$form->{CAN_CHANGE_PASSWORD} = $main::auth->can_change_password();
$form->{todo_cfg} = { TODO->get_user_config('login' => $::myconfig{login}) };
[% L.input_tag('form_cvars_nr_cols', MYCONFIG.form_cvars_nr_cols || 3, size = 5) %]
</td>
</tr>
+
<tr>
<th align="right">[% 'Quick Searches that will be shown in the header for this user' | $T8 %]</th>
<td colspan=2>
</div>
</td>
</tr>
+
+ <tr>
+ <th align="right">[% 'Displayable Name Preferences' | $T8 %]</th>
+ <td>
+ <table>
+ [% FOREACH module=displayable_name_specs_by_module.keys.sort %]
+ [%- SET spec=displayable_name_specs_by_module.$module -%]
+ <tr>
+ <td align="right">[% spec.specs.title %]</td>
+ <td>
+ <table>
+ <tr>
+ <th align="left" class="listheading">[% 'Option' | $T8 %]</th>
+ <th align="left" class="listheading">[% 'Name' | $T8 %]</th>
+ </tr>
+ [% FOREACH option=spec.specs.options %]
+ <tr>
+ <td>[% option.title %]</td>
+ <td>[% option.name %]</td>
+ </tr>
+ [% END %]
+ <tr>
+ <th align="left">[% 'Display' | $T8 %]:</th>
+ <td>
+ [% L.hidden_tag("displayable_name_specs[+].module", module) %]
+ [% L.input_tag("displayable_name_specs[].value", spec.prefs.get, size=50) %]
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ [% END %]
+ </table>
+ </td>
+
</table>
</div>