Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 93cc0157

Von Moritz Bunkus vor fast 10 Jahren hinzugefügt

  • ID 93cc0157161476f242f3304b1950f80d0ba5ef08
  • Vorgänger 230c9dcf
  • Nachfolger ee745476

Pflichtenheft: nach benutzerdefinierten Variablen suchen können

Unterschiede anzeigen:

SL/Controller/RequirementSpec.pm
30 30
(
31 31
  scalar                  => [ qw(requirement_spec_item visible_item visible_section) ],
32 32
  'scalar --get_set_init' => [ qw(requirement_spec customers types statuses complexities risks projects project_types project_statuses default_project_type default_project_status copy_source js
33
                                  current_text_block_output_position models time_based_units html_template) ],
33
                                  current_text_block_output_position models time_based_units html_template cvar_configs) ],
34 34
);
35 35

  
36 36
__PACKAGE__->run_before('setup');
......
323 323

  
324 324
  $::auth->assert('requirement_spec_edit');
325 325
  $::request->{layout}->use_stylesheet("${_}.css") for qw(jquery.contextMenu requirement_spec);
326
  $::request->{layout}->use_javascript("${_}.js")  for qw(jquery.jstree jquery/jquery.contextMenu jquery/jquery.hotkeys requirement_spec ckeditor/ckeditor ckeditor/adapters/jquery autocomplete_part);
326
  $::request->{layout}->use_javascript("${_}.js")  for qw(jquery.jstree jquery/jquery.contextMenu jquery/jquery.hotkeys requirement_spec ckeditor/ckeditor ckeditor/adapters/jquery autocomplete_part autocomplete_customer);
327 327
  $self->init_visible_section;
328 328

  
329 329
  return 1;
......
340 340
sub init_statuses               { SL::DB::Manager::RequirementSpecStatus->get_all_sorted      }
341 341
sub init_time_based_units       { SL::DB::Manager::Unit->time_based_units                     }
342 342
sub init_types                  { SL::DB::Manager::RequirementSpecType->get_all_sorted        }
343
sub init_cvar_configs           { SL::DB::Manager::CustomVariableConfig->get_all_sorted(where => [ module => 'RequirementSpecs' ]) }
343 344

  
344 345
sub init_customers {
345 346
  my ($self) = @_;
SL/DB/Manager/RequirementSpec.pm
5 5
use SL::DB::Helper::Manager;
6 6
use base qw(SL::DB::Helper::Manager);
7 7

  
8
use SL::DB::Helper::Filtered;
8 9
use SL::DB::Helper::Paginated;
9 10
use SL::DB::Helper::Sorted;
10 11

  
templates/webpages/common/render_cvar_filter_input.html
1
[%- USE HTML -%][%- USE L -%][%- USE LxERP -%][%- USE T8 -%]
2
[%- SET id__    = cvar_cfg.id
3
        name__  = 'filter.cvar.' _ id__
4
        value__ = filter.cvar.$id__ %]
5
[%- IF cvar_cfg.type == 'bool' %]
6
 [%- L.select_tag(name__, [ '', [ 1, LxERP.t8('Yes') ], [ 0, LxERP.t8('No') ] ], default=value__, class=cvar_class) %]
7

  
8
[%- ELSIF cvar_cfg.type == 'number' %]
9
 [% L.select_tag(name__ _ '::', [ [ 'eq', '==' ], [ 'ne', '=/=' ], [ 'gt', '>' ], [ 'ge', '>=' ], [ 'lt', '<' ], [ 'le', '<=' ] ]) %]
10
 [% L.input_tag(name__, value__, class=cvar_class) %]
11

  
12
[%- ELSIF cvar_cfg.type == 'date' %]
13
 [% L.select_tag(name__ _ '::', [ [ 'eq', '==' ], [ 'ne', '=/=' ], [ 'gt', '>' ], [ 'ge', '>=' ], [ 'lt', '<' ], [ 'le', '<=' ] ]) %]
14
 [% L.date_tag(name__, value__, class=cvar_class) %]
15

  
16
[% ELSIF cvar_cfg.type == 'select' %]
17
 [% options__ = [ '' ];
18
    options__ = options__.import(cvar_cfg.processed_options);
19
    L.select_tag(name__, options__, default=value__, class=cvar_class) %]
20

  
21
[% ELSIF cvar_cfg.type == 'customer' %]
22
 [%- L.customer_vendor_picker(name__, value__, type='customer', class=cvar_class) %]
23

  
24
[% ELSIF cvar_cfg.type == 'vendor' %]
25
 [%- L.customer_vendor_picker(name__, value__, type='vendor', class=cvar_class) %]
26

  
27
[% ELSIF cvar_cfg.type == 'part' %]
28
 [%- L.part_picker(name__, value__, class=cvar_class) %]
29

  
30
[%- ELSE %]
31
 [% SET value_name__ = id__ _ '_substr__ilike'
32
        value__      = filter.cvar.$value_name__ %]
33
 [%- L.input_tag(name__ _ ':substr::ilike', value__, maxlength=cvar_cfg.maxlength, class=cvar_class) %]
34

  
35
[%- END %]
templates/webpages/requirement_spec/_filter.html
11 11
  [%- L.hidden_tag("is_template", is_template) %]
12 12

  
13 13
  <p>
14
   <table class="rs_input_field">
14
   <table>
15 15
    <tr>
16 16
     <th align="right">[% LxERP.t8("Title") %]</th>
17
     <td>[% L.input_tag('filter.title:substr::ilike', filter.title_substr__ilike) %]</td>
17
     <td>[% L.input_tag('filter.title:substr::ilike', filter.title_substr__ilike, class="rs_input_field") %]</td>
18 18
    </tr>
19 19

  
20 20
[%- UNLESS is_template %]
21 21
    <tr>
22 22
     <th align="right">[% LxERP.t8("Customer") %]</th>
23
     <td>[% L.input_tag('filter.customer.name:substr::ilike', filter.customer.name_substr__ilike) %]</td>
23
     <td>[% L.input_tag('filter.customer.name:substr::ilike', filter.customer.name_substr__ilike, class="rs_input_field") %]</td>
24 24
    </tr>
25 25

  
26 26
    <tr>
27 27
     <th align="right">[% LxERP.t8("Customer Number") %]</th>
28
     <td>[% L.input_tag('filter.customer.customernumber:substr::ilike', filter.customer.customernumber_substr__ilike) %]</td>
28
     <td>[% L.input_tag('filter.customer.customernumber:substr::ilike', filter.customer.customernumber_substr__ilike, class="rs_input_field") %]</td>
29 29
    </tr>
30 30

  
31 31
    <tr>
32 32
     <th align="right">[% LxERP.t8("Requirement Spec Type") %]</th>
33
     <td>[% L.select_tag('filter.type_id', SELF.types, default=filter.type_id, title_key="description", with_empty=1) %]</td>
33
     <td>[% L.select_tag('filter.type_id', SELF.types, default=filter.type_id, title_key="description", with_empty=1, class="rs_input_field") %]</td>
34 34
    </tr>
35 35

  
36 36
    <tr>
37 37
     <th align="right">[% LxERP.t8("Requirement Spec Status") %]</th>
38
     <td>[% L.select_tag('filter.status_id[]', SELF.statuses, default=filter.status_id_, title_key="description", multiple=1) %][%# NOTE: the trailing '_' is NOT a mistake -- look at SL::Controller::Helper::Filtered for the explanation! %]</td>
38
     <td>[% L.select_tag('filter.status_id[]', SELF.statuses, default=filter.status_id_, title_key="description", multiple=1, class="rs_input_field") %][%# NOTE: the trailing '_' is NOT a mistake -- look at SL::Controller::Helper::Filtered for the explanation! %]</td>
39 39
    </tr>
40 40

  
41 41
    <tr>
42 42
     <th align="right">[% LxERP.t8("Project Number") %]</th>
43
     <td>[% L.input_tag('filter.project.projectnumber:substr::ilike', filter.project.projectnumber_substr__ilike) %]</td>
43
     <td>[% L.input_tag('filter.project.projectnumber:substr::ilike', filter.project.projectnumber_substr__ilike, class="rs_input_field") %]</td>
44 44
    </tr>
45 45
    <tr>
46 46
     <th align="right">[% LxERP.t8("Project Description") %]</th>
47
     <td>[% L.input_tag('filter.project.description:substr::ilike', filter.project.description_substr__ilike) %]</td>
47
     <td>[% L.input_tag('filter.project.description:substr::ilike', filter.project.description_substr__ilike, class="rs_input_field") %]</td>
48 48
    </tr>
49

  
50
    [% FOREACH cvar_cfg = SELF.cvar_configs %]
51
     [%- IF cvar_cfg.searchable %]
52
      <tr>
53
       <th align="right">[% HTML.escape(cvar_cfg.description) %]</th>
54
       <td>[% INCLUDE 'common/render_cvar_filter_input.html' cvar_cfg=cvar_cfg cvar_class="rs_input_field" %]</td>
55
      </tr>
56
     [% END %]
57
    [% END %]
49 58
[%- END %]
50 59
   </table>
51 60
  </p>

Auch abrufbar als: Unified diff