Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / SL / Controller / TopQuickSearch / Base.pm
1 package SL::Controller::TopQuickSearch::Base;
2
3 use strict;
4 use parent qw(Rose::Object);
5
6 sub auth { die 'must be overwritten' }
7
8 sub name { die 'must be overwritten' }
9
10 sub description_config { die 'must be overwritten' }
11
12 sub description_field { die 'must be overwritten' }
13
14 sub query_autocomplete { die 'must be overwritten' }
15
16 sub select_autocomplete { die 'must be overwritten' }
17
18 sub do_search { die 'must be overwritten' }
19
20 1;
21
22 __END__
23
24 =encoding utf-8
25
26 =head1 NAME
27
28 SL::Controller::TopQuickSearch::Base - base interface class for quick search plugins
29
30 =head1 DESCRIPTION
31
32 see L<SL::Controller::TopQuickSearch>
33
34 =head1 INTERFACE
35
36 An implementation must provide these functions.
37
38 =over 4
39
40 =item C<auth>
41
42 Must return a string used for access checks. Empty string or undef will mean
43 unrestricted access.
44
45 =item C<name>
46
47 Internal name, must be plain ASCII.
48
49 =item C<description_config>
50
51 Localized name used in the configuration.
52
53 =item C<description_field>
54
55 Localized name used in the search field as hint. Should fit into an input of
56 length 20.
57
58 =item C<query_autocomplete>
59
60 Needs to take C<term> from C<$::form> and must return an arrayref of JSON
61 serializable matches fit for jquery autocomplete.
62
63 =item C<select_autocomplete>
64
65 Needs to take C<id> from C<$::form> and must return a redirect string to be
66 used with C<SL::Controller::Base::redirect_to> pointing to a representation of
67 the selected object.
68
69 =item C<do_search>
70
71 Needs to take C<term> from C<$::form> and must return a redirect string to be
72 used with C<SL::Controller::Base::redirect_to> pointing to a representation of
73 the search results. If the search will display only only one match, it should
74 instead return the same result as if that object was selected directly using
75 C<select_autocomplete>.
76
77 =back
78
79 =head1 BUGS
80
81 None yet :)
82
83 =head1 AUTHOR
84
85 Sven Schöling E<lt>s.schoeling@linet-services.deE<gt>
86
87 =cut