Revision 2504ebe1
Von Sven Schöling vor mehr als 11 Jahren hinzugefügt
SL/Controller/Part.pm | ||
---|---|---|
3 | 3 |
use strict; |
4 | 4 |
use parent qw(SL::Controller::Base); |
5 | 5 |
|
6 |
use Clone qw(clone); |
|
6 | 7 |
use SL::DB::Part; |
8 |
use SL::Controller::Helper::GetModels; |
|
9 |
use SL::Controller::Helper::Filtered; |
|
10 |
use SL::Controller::Helper::Sorted; |
|
11 |
use SL::Controller::Helper::Paginated; |
|
12 |
use SL::Controller::Helper::Filtered; |
|
13 |
use SL::Locale::String qw(t8); |
|
14 |
|
|
15 |
use Rose::Object::MakeMethods::Generic ( |
|
16 |
'scalar --get_set_init' => [ qw(parts) ], |
|
17 |
); |
|
7 | 18 |
|
8 | 19 |
# safety |
9 | 20 |
__PACKAGE__->run_before(sub { $::auth->assert('part_service_assembly_edit') }); |
10 | 21 |
|
22 |
__PACKAGE__->make_filtered( |
|
23 |
ONLY => [ qw(part_picker_search part_picker_result) ], |
|
24 |
LAUNDER_TO => 'filter', |
|
25 |
); |
|
26 |
__PACKAGE__->make_paginated( |
|
27 |
ONLY => [ qw(part_picker_search part_picker_result) ], |
|
28 |
); |
|
29 |
|
|
30 |
__PACKAGE__->make_sorted( |
|
31 |
ONLY => [ qw(part_picker_search part_picker_result) ], |
|
32 |
|
|
33 |
DEFAULT_BY => 'partnumber', |
|
34 |
DEFAULT_DIR => 1, |
|
35 |
|
|
36 |
partnumber => t8('Partnumber'), |
|
37 |
); |
|
38 |
|
|
11 | 39 |
sub action_ajax_autocomplete { |
12 | 40 |
my ($self, %params) = @_; |
13 | 41 |
|
... | ... | |
26 | 54 |
$self->render('part/ajax_autocomplete', { layout => 0, type => 'json' }); |
27 | 55 |
} |
28 | 56 |
|
57 |
sub action_test_page { |
|
58 |
$::request->{layout}->add_javascripts('autocomplete_part.js'); |
|
59 |
|
|
60 |
$_[0]->render('part/test_page'); |
|
61 |
} |
|
62 |
|
|
63 |
sub action_part_picker_search { |
|
64 |
$_[0]->render('part/part_picker_search', { layout => 0 }, parts => $_[0]->parts); |
|
65 |
} |
|
66 |
|
|
67 |
sub action_part_picker_result { |
|
68 |
$_[0]->render('part/_part_picker_result', { layout => 0 }); |
|
69 |
} |
|
70 |
|
|
71 |
sub init_parts { |
|
72 |
$_[0]->get_models; |
|
73 |
} |
|
29 | 74 |
|
30 | 75 |
1; |
Auch abrufbar als: Unified diff
Part Picker