)->save();
CVar->save_custom_variables(
- dbh => $self->part->db->dbh,
- module => 'IC',
- trans_id => $self->part->id,
- variables => $::form, # $::form->{cvar} would be nicer
- always_valid => 1,
+ dbh => $self->part->db->dbh,
+ module => 'IC',
+ trans_id => $self->part->id,
+ variables => $::form, # $::form->{cvar} would be nicer
+ save_validity => 1,
);
1;
%assembly_vars = %{ $self->prepare_assembly_render_vars } if $self->part->is_assembly;
$params{CUSTOM_VARIABLES} = CVar->get_custom_variables(module => 'IC', trans_id => $self->part->id);
- $_->{valid} = 1 for @{ $params{CUSTOM_VARIABLES} };
CVar->render_inputs('variables' => $params{CUSTOM_VARIABLES}, show_disabled_message => 1, partsgroup_id => $self->part->partsgroup_id)
if (scalar @{ $params{CUSTOM_VARIABLES} });
}
sub action_show_multi_items_dialog {
+ my ($self) = @_;
+
+ my $search_term = $self->models->filtered->laundered->{all_substr_multi__ilike};
+ $search_term ||= $self->models->filtered->laundered->{all_with_makemodel_substr_multi__ilike};
+ $search_term ||= $self->models->filtered->laundered->{all_with_customer_partnumber_substr_multi__ilike};
+
$_[0]->render('part/_multi_items_dialog', { layout => 0 },
- all_partsgroups => SL::DB::Manager::PartsGroup->get_all
+ all_partsgroups => SL::DB::Manager::PartsGroup->get_all,
+ search_term => $search_term
);
}
sub action_multi_items_update_result {
my $max_count = 100;
- $::form->{multi_items}->{filter}->{obsolete} = 0;
-
my $count = $_[0]->multi_items_models->count;
if ($count == 0) {
# since we need a second get models instance with different filters for that,
# we only modify the original filter temporarily in place
if ($::form->{prefer_exact}) {
- local $::form->{filter}{'all::ilike'} = delete local $::form->{filter}{'all:substr:multi::ilike'};
+ local $::form->{filter}{'all::ilike'} = delete local $::form->{filter}{'all:substr:multi::ilike'};
+ local $::form->{filter}{'all_with_makemodel::ilike'} = delete local $::form->{filter}{'all_with_makemodel:substr:multi::ilike'};
+ local $::form->{filter}{'all_with_customer_partnumber::ilike'} = delete local $::form->{filter}{'all_with_customer_partnumber:substr:multi::ilike'};
my $exact_models = SL::Controller::Helper::GetModels->new(
controller => $self,
}
sub action_part_picker_search {
- $_[0]->render('part/part_picker_search', { layout => 0 });
+ my ($self) = @_;
+
+ my $search_term = $self->models->filtered->laundered->{all_substr_multi__ilike};
+ $search_term ||= $self->models->filtered->laundered->{all_with_makemodel_substr_multi__ilike};
+ $search_term ||= $self->models->filtered->laundered->{all_with_customer_partnumber_substr_multi__ilike};
+
+ $_[0]->render('part/part_picker_search', { layout => 0 }, search_term => $search_term);
}
sub action_part_picker_result {