Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 959ec023

Von Werner Hahn vor mehr als 8 Jahren hinzugefügt

  • ID 959ec023c4e702259bba7eeac2d5f5bc65e8bf89
  • Vorgänger 70672226
  • Nachfolger 81d283b4

Shoppart: Shopkategorien sind zugeordnet und werden mit checkbox angezeigt

Unterschiede anzeigen:

SL/Controller/ShopPart.pm
55 55

  
56 56
sub action_show_files {
57 57
  my ($self) = @_;
58
$main::lxdebug->dump(0, 'WH: Show_Files',\$::form);
58

  
59 59
  require SL::DB::File;
60 60
  my $images = SL::DB::Manager::File->get_all_sorted( where => [ trans_id => $::form->{id}, modul => $::form->{modul}, file_content_type => { like => 'image/%' } ], sort_by => 'position' );
61
  $main::lxdebug->dump(0, 'WH: ',\$images);
62
  #my $html = $self->render('shop_part/_list_images', { output => 0 }, IMAGES => $images);
63
  $self->render('shop_part/_list_images', { header => 0 }, IMAGES => $images);
64
  #$main::lxdebug->dump(0, 'WH: ',\$html);
65

  
66
  #$self->js->html('#shop_images', $html);
67
  #$self->js->render;
68

  
69
  # $self->render('customer_vendor_turnover/count_open_items_by_year', { layout => 0 });
70 61

  
62
  $self->render('shop_part/_list_images', { header => 0 }, IMAGES => $images);
71 63

  
72 64
}
73 65

  
74 66
sub action_get_categories {
75 67
  my ($self) = @_;
76 68

  
77
  my $shop_part = SL::DB::Manager::ShopPart->find_by(id => $::form->{shop_part_id});
78
  die unless $shop_part;
69
#  my $shop_part = SL::DB::Manager::ShopPart->find_by(id => $::form->{shop_part_id});
70
#  die unless $shop_part;
79 71
  require SL::Shop;
80
  my $shop = SL::Shop->new( config => $shop_part->shop );
72
  my $shop = SL::Shop->new( config => $self->shop_part->shop );
81 73
  my $categories = $shop->connector->get_categories;
82 74

  
83 75
  $self->js
templates/webpages/shop_part/categories.html
7 7

  
8 8
[%  LxERP.t8("Part") %]: [% HTML.escape(SELF.shop_part.part.displayable_name) %]<br>
9 9
[%  LxERP.t8("Shop") %]: [% HTML.escape(SELF.shop_part.shop.description) %]
10

  
11
[% #  Dumper.dump_html(CATEGORIES) %]
10
<br>
11
[%   Dumper.dump_html(SELF.shop_part.shop_category) %]
12 12

  
13 13
<form action="controller.pl" method="post">
14 14
  [% BLOCK recurse %]
15 15
    [% FOREACH obj = data %]
16 16
      <ul>
17
        <li>[% L.checkbox_tag('categories[]',value=obj.name) %][% HTML.escape(obj.name) %]</li>
17
        <li>
18
        [% checked = '' %]
19
        [% IF SELF.shop_part.shop_category.grep(obj.name).size %]
20
          [% checked = 'checked' %]
21
        [% END %]
22
          [% L.checkbox_tag('categories[]',value=obj.name, checked=checked) %][% HTML.escape(obj.name) %]</li>
18 23
        [% IF obj.childrenCount >= 1 %]
19 24
          [% INCLUDE recurse data=obj.children %]
20 25
        [% END %]
templates/webpages/shop_part/edit.html
42 42
     <td>[% LxERP.t8("Meta Tags") %]</td>
43 43
     <td>[% L.input_tag("shop_part.meta_tags", SELF.shop_part.meta_tags, size=2) %]</td>
44 44
    </tr>
45
    <tr>
46
     <td>[% LxERP.t8("Shop Category") %]</td>
47
     <td>[% L.input_tag("shop_part.shop_category", SELF.shop_part.category, size=2) %]</td>
48
    </tr>
49 45
    </table>
50 46
    [% # L.dump(SELF.shop_part) %]
51 47

  

Auch abrufbar als: Unified diff