Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8608184d

Von Werner Hahn vor mehr als 6 Jahren hinzugefügt

  • ID 8608184d41fca27d9ecf1aff9cc781c87aeb8103
  • Vorgänger 4369213f
  • Nachfolger 6b55ec18

Shopmodul: Nach Umbennenung Dateien mit Verweis richtig gestellt

Unterschiede anzeigen:

SL/Controller/Part.pm
637 637

  
638 638
sub _set_javascript {
639 639
  my ($self) = @_;
640
  $::request->layout->use_javascript("${_}.js")  for qw(kivi.Part kivi.File kivi.PriceRule ckeditor/ckeditor ckeditor/adapters/jquery kivi.shop_part);
640
  $::request->layout->use_javascript("${_}.js")  for qw(kivi.Part kivi.File kivi.PriceRule ckeditor/ckeditor ckeditor/adapters/jquery kivi.ShopPart);
641 641
  $::request->layout->add_javascripts_inline("\$(function(){kivi.PriceRule.load_price_rules_for_part(@{[ $self->part->id ]})});") if $self->part->id;
642 642
}
643 643

  
SL/Controller/ShopPart.pm
11 11
use SL::DB::ShopPart;
12 12
use SL::DB::File;
13 13
use SL::DB::ShopImage;
14
use SL::Controller::FileUploader;
15 14
use SL::DB::Default;
16 15
use SL::Helper::Flash;
17 16
use MIME::Base64;
......
94 93

  
95 94
  $self->js
96 95
    ->dialog->close('#jqueryui_popup_dialog')
97
    ->run('kivi.shop_part.show_images',$self->file->trans_id)
96
    ->run('kivi.ShopPart.show_images',$self->file->trans_id)
98 97
    ->render();
99 98
}
100 99

  
......
123 122

  
124 123
  $self->js
125 124
    ->dialog->close('#jqueryui_popup_dialog')
126
    ->run('kivi.shop_part.show_images',$self->file->trans_id)
125
    ->run('kivi.ShopPart.show_images',$self->file->trans_id)
127 126
    ->render();
128 127
}
129 128

  
......
132 131
  $self->file->delete;
133 132

  
134 133
  $self->js
135
    ->run('kivi.shop_part.show_images',$self->file->trans_id)
134
    ->run('kivi.ShopPart.show_images',$self->file->trans_id)
136 135
    ->render();
137 136
}
138 137

  
......
146 145

  
147 146
  $self->js
148 147
    ->run(
149
      'kivi.shop_part.shop_part_dialog',
148
      'kivi.ShopPart.shop_part_dialog',
150 149
      t8('Shopcategories'),
151 150
      $self->render('shop_part/categories', { output => 0 }, CATEGORIES => $categories )
152 151
    )
......
239 238
           ->html('#shop_part_active_' . $self->shop_part->id, $self->shop_part->active)
240 239
           ->html('#price_' . $self->shop_part->id, $::form->format_amount(\%::myconfig,$price,2))
241 240
           ->html('#active_price_source_' . $self->shop_part->id, $price_src_str)
242
           ->run('kivi.shop_part.close_dialog')
241
           ->run('kivi.ShopPart.close_dialog')
243 242
           ->flash('info', t8("Updated shop part"))
244 243
           ->render;
245 244
}
......
251 250
  # or a new shop_part with only part_id and shop_id set
252 251
  $self->js
253 252
    ->run(
254
      'kivi.shop_part.shop_part_dialog',
253
      'kivi.ShopPart.shop_part_dialog',
255 254
      t8('Shop part'),
256 255
      $self->render('shop_part/edit', { output => 0 }) #, shop_part => $self->shop_part)
257 256
    )
......
286 285

  
287 286
  flash('info', t8('The categories has been saved.'));
288 287

  
289
  $self->js->run('kivi.shop_part.close_dialog')
288
  $self->js->run('kivi.ShopPart.close_dialog')
290 289
           ->flash('info', t8("Updated categories"))
291 290
           ->render;
292 291
}
......
324 323
  my $html    = $self->render('shop_part/_upload_status', { output => 0 }, job => $job);
325 324

  
326 325
  $self->js->html('#status_mass_upload', $html);
327
  $self->js->run('kivi.shop_part.massUploadFinished') if $job->data_as_hash->{status} == SL::BackgroundJob::ShopPartMassUpload->DONE();
326
  $self->js->run('kivi.ShopPart.massUploadFinished') if $job->data_as_hash->{status} == SL::BackgroundJob::ShopPartMassUpload->DONE();
328 327
  $self->js->render;
329 328
}
330 329

  
......
350 349

  
351 350
   $self->js
352 351
      ->html('#status_mass_upload', $html)
353
      ->run('kivi.shop_part.massUploadStarted')
352
      ->run('kivi.ShopPart.massUploadStarted')
354 353
      ->render;
355 354
}
356 355

  
......
358 357
# internal stuff
359 358
#
360 359
sub add_javascripts  {
361
  $::request->{layout}->add_javascripts(qw(kivi.shop_part.js));
360
  $::request->{layout}->add_javascripts(qw(kivi.ShopPart.js));
362 361
}
363 362

  
364 363
sub load_pricesources {
js/kivi.ShopPart.js
1
namespace('kivi.shop_part', function(ns) {
1
namespace('kivi.ShopPart', function(ns) {
2 2
  var $dialog;
3 3

  
4 4
  // this is called by sub render, with a certain prerendered html (edit.html,categories.html)
......
159 159

  
160 160

  
161 161
  ns.setup = function() {
162
    kivi.shop_part.massUploadInitialize();
162
    kivi.ShopPart.massUploadInitialize();
163 163
    kivi.submit_ajax_form('controller.pl?action=ShopPart/mass_upload','[name=shop_parts]');
164 164
  };
165 165

  
templates/webpages/ic/tabs/_shop.html
1
[%- USE HTML %][%- USE L -%][%- USE P -%][%- USE LxERP -%]
2
[%- USE Dumper %]
3
[%- USE JavaScript -%]
4
<div id="shop_variables">
5
 <h2>[% LxERP.t8("Active shops:") %]</h2>
6
 <table width="100%">
7
  <thead>
8
  <tr class="listheading">
9
   <th>[% LxERP.t8("Shop") %]</th>
10
   <th>[% LxERP.t8("Active") %]</th>
11
   <th>[% LxERP.t8("Shop part") %]</th>
12
   <th>[% LxERP.t8("Price source") %]</th>
13
   <th>[% LxERP.t8("Price") %]</th>
14
   <th>[% LxERP.t8("Stock Local/Shop") %]</th>
15
   <th>[% LxERP.t8("Last update") %]</th>
16
   <th>[% LxERP.t8("Action") %]</th>
17
   <th>[% LxERP.t8("Action") %]</th>
18
   <th>[% LxERP.t8("Action") %]</th>
19
  </tr>
20
  </thead>
21

  
22
  [%- FOREACH shop_part = SHOP_PARTS %]
23
  <tr class="listrow">
24
   <td>[% HTML.escape( shop_part.shop.description ) %]</td>
25
   <td>[% L.html_tag('span', shop_part.active, id => 'shop_part_active_' _ shop_part.id ) %]</td>
26
   <td>[% L.html_tag('span', shop_part.shop_description, id => 'shop_part_description_' _ shop_part.id ) %]</td>
27
   <td> [% L.html_tag('span',LxERP.t8(), id => 'active_price_source_' _ shop_part.id) %] </td>
28
   <td>[% L.html_tag('span','Price', id => 'price_' _ shop_part.id) %]</td>
29
   <td>[% L.html_tag('span','Stock', id => 'stock_' _ shop_part.id) %]</td>
30
   <td>[% L.html_tag('span', shop_part.last_update.to_kivitendo('precision' => 'minute'), id => 'shop_part_last_update_' _ shop_part.id ) %]</td>
31
   <td>[% L.button_tag("kivi.shop_part.edit_shop_part(" _ shop_part.id _ ")", LxERP.t8("Edit"))  %]</td>
32
   <td>[% L.button_tag("kivi.shop_part.update_shop_part(" _ shop_part.id _ ")", LxERP.t8("Upload"))  %]</td>
33
   <td>[% L.button_tag("kivi.shop_part.get_all_categories(" _ shop_part.id _ ")", LxERP.t8("Shopcategories"))  %]</td>
34
  </tr>
35
  <script type="text/javascript">
36
    $(function() {
37
      kivi.shop_part.update_price_n_price_source([% shop_part.id %],'[% shop_part.active_price_source %]');
38
      kivi.shop_part.update_stock([% shop_part.id %]);
39
    });
40
  </script>
41
  [%- END %]
42
  [%- FOREACH shop = SHOPS_NOT_ASSIGNED %]
43
  <tr>
44
   <td>[% HTML.escape( shop.description ) %]</td>
45
   <td></td>
46
   <td></td>
47
   <td></td>
48
   <td></td>
49
   <td></td>
50
   <td></td>
51
   <td>[% L.button_tag("kivi.shop_part.create_shop_part(" _ id _ ", " _ shop.id _ ")", LxERP.t8("Add"))  %]</td>
52
   <td></td>
53
  </tr>
54
  [%- END %]
55
</table>
56

  
57

  
58
[% # L.dump(shop_part) %]
59
<h2>[% LxERP.t8("Shopvariables and Images - valid for all shops") %]</h2>
60
  [%- IF CUSTOM_VARIABLES.size %]
61
[%  # L.dump(CUSTOM_VARIABLES) %]
62
  <div id="shop_custom_variables">
63
   <p>
64
    <table>
65
     [%- FOREACH var = CUSTOM_VARIABLES %]
66
      [%- IF var.name.match('^shop_') %]
67
       <tr>
68
        [% # IF !var.partsgroup_filtered %]
69
          <td align="right" valign="top">[% HTML.escape(var.description) %]</td>
70
        [% # END %]
71
      <td align="right" valign="top">[% var.VALID_BOX %]</td>
72
        <td valign="top">[% var.HTML_CODE %]</td>
73
       </tr>
74
      [%- END %]
75
     [%- END %]
76
    </table>
77
   </p>
78
  </div>
79
  [%- END %]
80
  [%- IF shop_part.part_id %]
81
    <script type="text/javascript">
82
      $(function() {
83
        kivi.shop_part.show_images([% shop_part.part_id %]);
84
      });
85
    </script>
86
    <div id="shop_images" border=1 ></div>
87
  [%- ELSE %]
88
    <div id="shop_images" border=1 >[% LxERP.t8('To upload images: Please create shoppart first') %]</div>
89
  [%- END %]
90
</div>
templates/webpages/part/_shop.html
29 29
   <td>[% L.html_tag('span','Price', id => 'price_' _ shop_part.id) %]</td>
30 30
   <td>[% L.html_tag('span','Stock', id => 'stock_' _ shop_part.id) %]</td>
31 31
   <td>[% L.html_tag('span', shop_part.last_update.to_kivitendo('precision' => 'minute'), id => 'shop_part_last_update_' _ shop_part.id ) %]</td>
32
   <td>[% L.button_tag("kivi.shop_part.edit_shop_part(" _ shop_part.id _ ")", LxERP.t8("Edit"))  %]</td>
33
   <td>[% L.button_tag("kivi.shop_part.update_shop_part(" _ shop_part.id _ ")", LxERP.t8("Upload"))  %]</td>
34
   <td>[% L.button_tag("kivi.shop_part.get_all_categories(" _ shop_part.id _ ")", LxERP.t8("Shopcategories"))  %]<br>[% HTML.escape(shop_part.part.partsgroup.partsgroup) %]</td>
32
   <td>[% L.button_tag("kivi.ShopPart.edit_shop_part(" _ shop_part.id _ ")", LxERP.t8("Edit"))  %]</td>
33
   <td>[% L.button_tag("kivi.ShopPart.update_shop_part(" _ shop_part.id _ ")", LxERP.t8("Upload"))  %]</td>
34
   <td>[% L.button_tag("kivi.ShopPart.get_all_categories(" _ shop_part.id _ ")", LxERP.t8("Shopcategories"))  %]<br>[% HTML.escape(shop_part.part.partsgroup.partsgroup) %]</td>
35 35
  </tr>
36 36
  <script type="text/javascript">
37 37
    $(function() {
38
      kivi.shop_part.update_price_n_price_source([% shop_part.id %],'[% shop_part.active_price_source %]');
39
      kivi.shop_part.update_stock([% shop_part.id %]);
38
      kivi.ShopPart.update_price_n_price_source([% shop_part.id %],'[% shop_part.active_price_source %]');
39
      kivi.ShopPart.update_stock([% shop_part.id %]);
40 40
    });
41 41
  </script>
42 42
  [% END %]
......
49 49
   <td></td>
50 50
   <td></td>
51 51
   <td></td>
52
   <td>[% L.button_tag("kivi.shop_part.create_shop_part(" _ id _ ", " _ shop.id _ ")", LxERP.t8("Add"))  %]</td>
52
   <td>[% L.button_tag("kivi.ShopPart.create_shop_part(" _ id _ ", " _ shop.id _ ")", LxERP.t8("Add"))  %]</td>
53 53
  </tr>
54 54
  </thead>
55 55
  [%- END %]
......
61 61
  [%- IF shop_part.part_id %]
62 62
    <script type="text/javascript">
63 63
      $(function() {
64
        kivi.shop_part.show_images([% shop_part.part_id %]);
64
        kivi.ShopPart.show_images([% shop_part.part_id %]);
65 65
      });
66 66
    </script>
67 67
    <div id="shop_images" border=1 ></div>
templates/webpages/shop_part/_list_articles.html
75 75
      </td>
76 76
      <td style="vertical-align:middle;text-align:center;">
77 77
        [% IF shop_part.active %]
78
        <div id="toogle_[% shop_part.id %]" style="background-image:url(image/gruener_punkt.gif);background-repeat:no-repeat;witdh:15px;height:15px;" onclick="kivi.shop_part.part_toggle_active([% shop_part.id %] ,[% shop_part.active %]);" onMouseOver="this.style.cursor='pointer'">&nbsp; </div>
78
        <div id="toogle_[% shop_part.id %]" style="background-image:url(image/gruener_punkt.gif);background-repeat:no-repeat;witdh:15px;height:15px;" onclick="kivi.ShopPart.part_toggle_active([% shop_part.id %] ,[% shop_part.active %]);" onMouseOver="this.style.cursor='pointer'">&nbsp; </div>
79 79
        [% ELSE %]
80
        <div id="toogle_[% shop_part.id %]" style="background-image:url(image/roter_punkt.gif);background-repeat:no-repeat;witdh:15px;height:15px;" onclick="kivi.shop_part.part_toggle_active([% shop_part.id %] ,[% shop_part.active %]);" onMouseOver="this.style.cursor='pointer'">&nbsp; </div>
80
        <div id="toogle_[% shop_part.id %]" style="background-image:url(image/roter_punkt.gif);background-repeat:no-repeat;witdh:15px;height:15px;" onclick="kivi.ShopPart.part_toggle_active([% shop_part.id %] ,[% shop_part.active %]);" onMouseOver="this.style.cursor='pointer'">&nbsp; </div>
81 81
        [% END %]
82 82
      </td>
83 83
      <td>[% L.html_tag('span',LxERP.t8(), id => 'active_price_source_' _ shop_part.id) %] </td>
......
104 104
      </td>
105 105
    <script type="text/javascript">
106 106
      $(function() {
107
         kivi.shop_part.update_price_n_price_source([% shop_part.id %],'[% shop_part.active_price_source %]');
108
         kivi.shop_part.update_stock([% shop_part.id %]);
107
         kivi.ShopPart.update_price_n_price_source([% shop_part.id %],'[% shop_part.active_price_source %]');
108
         kivi.ShopPart.update_stock([% shop_part.id %]);
109 109
      });
110 110
    </script>
111 111
    </tr>
......
119 119
    [% L.radio_button_tag('upload_todo', value='price', label= LxERP.t8('Only Price')) %]
120 120
    [% L.radio_button_tag('upload_todo', value='stock', label= LxERP.t8('Only Stock')) %]
121 121
    [% L.radio_button_tag('upload_todo', value='price_stock', checked=1, label= LxERP.t8('Price and Stock')) %]
122
    [% L.button_tag("kivi.shop_part.setup();", LxERP.t8("Upload all marked"), id="mass_transfer") %]
122
    [% L.button_tag("kivi.ShopPart.setup();", LxERP.t8("Upload all marked"), id="mass_transfer") %]
123 123
  </div>
124 124
  <div id="status_mass_upload" style="display: none;">
125 125
    [%- INCLUDE 'shop_part/_upload_status.html' %]
templates/webpages/shop_part/_list_images.html
31 31

  
32 32
[% L.sortable_element('#images_list tbody', url=SELF.url_for(action='reorder'), with='image_id') %]
33 33
<p>
34
[% L.button_tag("kivi.shop_part.imageUpload(" _ FORM.id _ ",'shop_image','image','Upload shopimage',0);", LxERP.t8('Upload shopimage') ) %]
34
[% L.button_tag("kivi.ShopPart.imageUpload(" _ FORM.id _ ",'shop_image','image','Upload shopimage',0);", LxERP.t8('Upload shopimage') ) %]
35 35
</p>
templates/webpages/shop_part/categories.html
50 50
        [% END %]
51 51
      [% END %]
52 52
  </div>
53
    [% L.button_tag("kivi.shop_part.save_categories(" _ SELF.shop_part.id _", " _ SELF.shop_part.shop.id _")", LxERP.t8("Save"))  %]</td>
53
    [% L.button_tag("kivi.ShopPart.save_categories(" _ SELF.shop_part.id _", " _ SELF.shop_part.shop.id _")", LxERP.t8("Save"))  %]</td>
54 54
</form>
55 55

  
templates/webpages/shop_part/edit.html
64 64
    [% # L.dump(SELF.shop_part) %]
65 65

  
66 66
    [% IF SELF.shop_part.id %]
67
    [% L.button_tag("kivi.shop_part.save_shop_part(" _ SELF.shop_part.id _ ")", LxERP.t8("Save"))  %]</td>
67
    [% L.button_tag("kivi.ShopPart.save_shop_part(" _ SELF.shop_part.id _ ")", LxERP.t8("Save"))  %]</td>
68 68
    [% ELSE %]
69
    [% L.button_tag("kivi.shop_part.add_shop_part(" _ FORM.part_id _", " _ FORM.shop_id _")", LxERP.t8("Save"))  %]</td>
69
    [% L.button_tag("kivi.ShopPart.add_shop_part(" _ FORM.part_id _", " _ FORM.shop_id _")", LxERP.t8("Save"))  %]</td>
70 70
    [% END %]
71
    [% # L.button_tag("kivi.shop_part.update_partnumber()", LxERP.t8("Update Partnumber"))  %]</td>
71
    [% # L.button_tag("kivi.ShopPart.update_partnumber()", LxERP.t8("Update Partnumber"))  %]</td>
72 72

  
73 73
    [% # L.hidden_tag("action", "ShopPart/dispatch") %]
74 74
    [% # L.submit_tag('action_update', LxERP.t8('Save')) %]

Auch abrufbar als: Unified diff