commit 8608184d41fca27d9ecf1aff9cc781c87aeb8103
Author: Werner Hahn <wh@futureworldsearch.net>
Date:   Thu May 18 12:45:14 2017 +0200

    Shopmodul: Nach Umbennenung Dateien mit Verweis richtig gestellt

diff --git a/SL/Controller/Part.pm b/SL/Controller/Part.pm
index 6f2da7e88..f152e0844 100644
--- a/SL/Controller/Part.pm
+++ b/SL/Controller/Part.pm
@@ -637,7 +637,7 @@ sub add {
 
 sub _set_javascript {
   my ($self) = @_;
-  $::request->layout->use_javascript("${_}.js")  for qw(kivi.Part kivi.File kivi.PriceRule ckeditor/ckeditor ckeditor/adapters/jquery kivi.shop_part);
+  $::request->layout->use_javascript("${_}.js")  for qw(kivi.Part kivi.File kivi.PriceRule ckeditor/ckeditor ckeditor/adapters/jquery kivi.ShopPart);
   $::request->layout->add_javascripts_inline("\$(function(){kivi.PriceRule.load_price_rules_for_part(@{[ $self->part->id ]})});") if $self->part->id;
 }
 
diff --git a/SL/Controller/ShopPart.pm b/SL/Controller/ShopPart.pm
index 05ebfdb7f..cb99f6ed1 100644
--- a/SL/Controller/ShopPart.pm
+++ b/SL/Controller/ShopPart.pm
@@ -11,7 +11,6 @@ use SL::Locale::String qw(t8);
 use SL::DB::ShopPart;
 use SL::DB::File;
 use SL::DB::ShopImage;
-use SL::Controller::FileUploader;
 use SL::DB::Default;
 use SL::Helper::Flash;
 use MIME::Base64;
@@ -94,7 +93,7 @@ sub action_ajax_upload_file{
 
   $self->js
     ->dialog->close('#jqueryui_popup_dialog')
-    ->run('kivi.shop_part.show_images',$self->file->trans_id)
+    ->run('kivi.ShopPart.show_images',$self->file->trans_id)
     ->render();
 }
 
@@ -123,7 +122,7 @@ sub action_ajax_update_file{
 
   $self->js
     ->dialog->close('#jqueryui_popup_dialog')
-    ->run('kivi.shop_part.show_images',$self->file->trans_id)
+    ->run('kivi.ShopPart.show_images',$self->file->trans_id)
     ->render();
 }
 
@@ -132,7 +131,7 @@ sub action_ajax_delete_file {
   $self->file->delete;
 
   $self->js
-    ->run('kivi.shop_part.show_images',$self->file->trans_id)
+    ->run('kivi.ShopPart.show_images',$self->file->trans_id)
     ->render();
 }
 
@@ -146,7 +145,7 @@ sub action_get_categories {
 
   $self->js
     ->run(
-      'kivi.shop_part.shop_part_dialog',
+      'kivi.ShopPart.shop_part_dialog',
       t8('Shopcategories'),
       $self->render('shop_part/categories', { output => 0 }, CATEGORIES => $categories )
     )
@@ -239,7 +238,7 @@ sub create_or_update {
            ->html('#shop_part_active_' . $self->shop_part->id, $self->shop_part->active)
            ->html('#price_' . $self->shop_part->id, $::form->format_amount(\%::myconfig,$price,2))
            ->html('#active_price_source_' . $self->shop_part->id, $price_src_str)
-           ->run('kivi.shop_part.close_dialog')
+           ->run('kivi.ShopPart.close_dialog')
            ->flash('info', t8("Updated shop part"))
            ->render;
 }
@@ -251,7 +250,7 @@ sub render_shop_part_edit_dialog {
   # or a new shop_part with only part_id and shop_id set
   $self->js
     ->run(
-      'kivi.shop_part.shop_part_dialog',
+      'kivi.ShopPart.shop_part_dialog',
       t8('Shop part'),
       $self->render('shop_part/edit', { output => 0 }) #, shop_part => $self->shop_part)
     )
@@ -286,7 +285,7 @@ sub action_save_categories {
 
   flash('info', t8('The categories has been saved.'));
 
-  $self->js->run('kivi.shop_part.close_dialog')
+  $self->js->run('kivi.ShopPart.close_dialog')
            ->flash('info', t8("Updated categories"))
            ->render;
 }
@@ -324,7 +323,7 @@ sub action_upload_status {
   my $html    = $self->render('shop_part/_upload_status', { output => 0 }, job => $job);
 
   $self->js->html('#status_mass_upload', $html);
-  $self->js->run('kivi.shop_part.massUploadFinished') if $job->data_as_hash->{status} == SL::BackgroundJob::ShopPartMassUpload->DONE();
+  $self->js->run('kivi.ShopPart.massUploadFinished') if $job->data_as_hash->{status} == SL::BackgroundJob::ShopPartMassUpload->DONE();
   $self->js->render;
 }
 
@@ -350,7 +349,7 @@ sub action_mass_upload {
 
    $self->js
       ->html('#status_mass_upload', $html)
-      ->run('kivi.shop_part.massUploadStarted')
+      ->run('kivi.ShopPart.massUploadStarted')
       ->render;
 }
 
@@ -358,7 +357,7 @@ sub action_mass_upload {
 # internal stuff
 #
 sub add_javascripts  {
-  $::request->{layout}->add_javascripts(qw(kivi.shop_part.js));
+  $::request->{layout}->add_javascripts(qw(kivi.ShopPart.js));
 }
 
 sub load_pricesources {
diff --git a/js/kivi.ShopPart.js b/js/kivi.ShopPart.js
index 40b309a0f..8f2248b95 100644
--- a/js/kivi.ShopPart.js
+++ b/js/kivi.ShopPart.js
@@ -1,4 +1,4 @@
-namespace('kivi.shop_part', function(ns) {
+namespace('kivi.ShopPart', function(ns) {
   var $dialog;
 
   // this is called by sub render, with a certain prerendered html (edit.html,categories.html)
@@ -159,7 +159,7 @@ namespace('kivi.shop_part', function(ns) {
 
 
   ns.setup = function() {
-    kivi.shop_part.massUploadInitialize();
+    kivi.ShopPart.massUploadInitialize();
     kivi.submit_ajax_form('controller.pl?action=ShopPart/mass_upload','[name=shop_parts]');
   };
 
diff --git a/templates/webpages/ic/tabs/_shop.html b/templates/webpages/ic/tabs/_shop.html
deleted file mode 100644
index 5c9a5782a..000000000
--- a/templates/webpages/ic/tabs/_shop.html
+++ /dev/null
@@ -1,90 +0,0 @@
-[%- USE HTML %][%- USE L -%][%- USE P -%][%- USE LxERP -%]
-[%- USE Dumper %]
-[%- USE JavaScript -%]
-<div id="shop_variables">
- <h2>[% LxERP.t8("Active shops:") %]</h2>
- <table width="100%">
-  <thead>
-  <tr class="listheading">
-   <th>[% LxERP.t8("Shop") %]</th>
-   <th>[% LxERP.t8("Active") %]</th>
-   <th>[% LxERP.t8("Shop part") %]</th>
-   <th>[% LxERP.t8("Price source") %]</th>
-   <th>[% LxERP.t8("Price") %]</th>
-   <th>[% LxERP.t8("Stock Local/Shop") %]</th>
-   <th>[% LxERP.t8("Last update") %]</th>
-   <th>[% LxERP.t8("Action") %]</th>
-   <th>[% LxERP.t8("Action") %]</th>
-   <th>[% LxERP.t8("Action") %]</th>
-  </tr>
-  </thead>
-
-  [%- FOREACH shop_part = SHOP_PARTS %]
-  <tr class="listrow">
-   <td>[% HTML.escape( shop_part.shop.description ) %]</td>
-   <td>[% L.html_tag('span', shop_part.active, id => 'shop_part_active_' _ shop_part.id ) %]</td>
-   <td>[% L.html_tag('span', shop_part.shop_description, id => 'shop_part_description_' _ shop_part.id ) %]</td>
-   <td> [% L.html_tag('span',LxERP.t8(), id => 'active_price_source_' _ shop_part.id) %] </td>
-   <td>[% L.html_tag('span','Price', id => 'price_' _ shop_part.id) %]</td>
-   <td>[% L.html_tag('span','Stock', id => 'stock_' _ shop_part.id) %]</td>
-   <td>[% L.html_tag('span', shop_part.last_update.to_kivitendo('precision' => 'minute'), id => 'shop_part_last_update_' _ shop_part.id ) %]</td>
-   <td>[% L.button_tag("kivi.shop_part.edit_shop_part(" _ shop_part.id _ ")", LxERP.t8("Edit"))  %]</td>
-   <td>[% L.button_tag("kivi.shop_part.update_shop_part(" _ shop_part.id _ ")", LxERP.t8("Upload"))  %]</td>
-   <td>[% L.button_tag("kivi.shop_part.get_all_categories(" _ shop_part.id _ ")", LxERP.t8("Shopcategories"))  %]</td>
-  </tr>
-  <script type="text/javascript">
-    $(function() {
-      kivi.shop_part.update_price_n_price_source([% shop_part.id %],'[% shop_part.active_price_source %]');
-      kivi.shop_part.update_stock([% shop_part.id %]);
-    });
-  </script>
-  [%- END %]
-  [%- FOREACH shop = SHOPS_NOT_ASSIGNED %]
-  <tr>
-   <td>[% HTML.escape( shop.description ) %]</td>
-   <td></td>
-   <td></td>
-   <td></td>
-   <td></td>
-   <td></td>
-   <td></td>
-   <td>[% L.button_tag("kivi.shop_part.create_shop_part(" _ id _ ", " _ shop.id _ ")", LxERP.t8("Add"))  %]</td>
-   <td></td>
-  </tr>
-  [%- END %]
-</table>
-
-
-[% # L.dump(shop_part) %]
-<h2>[% LxERP.t8("Shopvariables and Images - valid for all shops") %]</h2>
-  [%- IF CUSTOM_VARIABLES.size %]
-[%  # L.dump(CUSTOM_VARIABLES) %]
-  <div id="shop_custom_variables">
-   <p>
-    <table>
-     [%- FOREACH var = CUSTOM_VARIABLES %]
-      [%- IF var.name.match('^shop_') %]
-       <tr>
-        [% # IF !var.partsgroup_filtered %]
-          <td align="right" valign="top">[% HTML.escape(var.description) %]</td>
-        [% # END %]
-      <td align="right" valign="top">[% var.VALID_BOX %]</td>
-        <td valign="top">[% var.HTML_CODE %]</td>
-       </tr>
-      [%- END %]
-     [%- END %]
-    </table>
-   </p>
-  </div>
-  [%- END %]
-  [%- IF shop_part.part_id %]
-    <script type="text/javascript">
-      $(function() {
-        kivi.shop_part.show_images([% shop_part.part_id %]);
-      });
-    </script>
-    <div id="shop_images" border=1 ></div>
-  [%- ELSE %]
-    <div id="shop_images" border=1 >[% LxERP.t8('To upload images: Please create shoppart first') %]</div>
-  [%- END %]
-</div>
diff --git a/templates/webpages/part/_shop.html b/templates/webpages/part/_shop.html
index 1ca644181..d5df18a99 100644
--- a/templates/webpages/part/_shop.html
+++ b/templates/webpages/part/_shop.html
@@ -29,14 +29,14 @@
    <td>[% L.html_tag('span','Price', id => 'price_' _ shop_part.id) %]</td>
    <td>[% L.html_tag('span','Stock', id => 'stock_' _ shop_part.id) %]</td>
    <td>[% L.html_tag('span', shop_part.last_update.to_kivitendo('precision' => 'minute'), id => 'shop_part_last_update_' _ shop_part.id ) %]</td>
-   <td>[% L.button_tag("kivi.shop_part.edit_shop_part(" _ shop_part.id _ ")", LxERP.t8("Edit"))  %]</td>
-   <td>[% L.button_tag("kivi.shop_part.update_shop_part(" _ shop_part.id _ ")", LxERP.t8("Upload"))  %]</td>
-   <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>
+   <td>[% L.button_tag("kivi.ShopPart.edit_shop_part(" _ shop_part.id _ ")", LxERP.t8("Edit"))  %]</td>
+   <td>[% L.button_tag("kivi.ShopPart.update_shop_part(" _ shop_part.id _ ")", LxERP.t8("Upload"))  %]</td>
+   <td>[% L.button_tag("kivi.ShopPart.get_all_categories(" _ shop_part.id _ ")", LxERP.t8("Shopcategories"))  %]<br>[% HTML.escape(shop_part.part.partsgroup.partsgroup) %]</td>
   </tr>
   <script type="text/javascript">
     $(function() {
-      kivi.shop_part.update_price_n_price_source([% shop_part.id %],'[% shop_part.active_price_source %]');
-      kivi.shop_part.update_stock([% shop_part.id %]);
+      kivi.ShopPart.update_price_n_price_source([% shop_part.id %],'[% shop_part.active_price_source %]');
+      kivi.ShopPart.update_stock([% shop_part.id %]);
     });
   </script>
   [% END %]
@@ -49,7 +49,7 @@
    <td></td>
    <td></td>
    <td></td>
-   <td>[% L.button_tag("kivi.shop_part.create_shop_part(" _ id _ ", " _ shop.id _ ")", LxERP.t8("Add"))  %]</td>
+   <td>[% L.button_tag("kivi.ShopPart.create_shop_part(" _ id _ ", " _ shop.id _ ")", LxERP.t8("Add"))  %]</td>
   </tr>
   </thead>
   [%- END %]
@@ -61,7 +61,7 @@
   [%- IF shop_part.part_id %]
     <script type="text/javascript">
       $(function() {
-        kivi.shop_part.show_images([% shop_part.part_id %]);
+        kivi.ShopPart.show_images([% shop_part.part_id %]);
       });
     </script>
     <div id="shop_images" border=1 ></div>
diff --git a/templates/webpages/shop_part/_list_articles.html b/templates/webpages/shop_part/_list_articles.html
index e80dd73af..f8dc379e1 100644
--- a/templates/webpages/shop_part/_list_articles.html
+++ b/templates/webpages/shop_part/_list_articles.html
@@ -75,9 +75,9 @@
       </td>
       <td style="vertical-align:middle;text-align:center;">
         [% IF shop_part.active %]
-        <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>
+        <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>
         [% ELSE %]
-        <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>
+        <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>
         [% END %]
       </td>
       <td>[% L.html_tag('span',LxERP.t8(), id => 'active_price_source_' _ shop_part.id) %] </td>
@@ -104,8 +104,8 @@
       </td>
     <script type="text/javascript">
       $(function() {
-         kivi.shop_part.update_price_n_price_source([% shop_part.id %],'[% shop_part.active_price_source %]');
-         kivi.shop_part.update_stock([% shop_part.id %]);
+         kivi.ShopPart.update_price_n_price_source([% shop_part.id %],'[% shop_part.active_price_source %]');
+         kivi.ShopPart.update_stock([% shop_part.id %]);
       });
     </script>
     </tr>
@@ -119,7 +119,7 @@
     [% L.radio_button_tag('upload_todo', value='price', label= LxERP.t8('Only Price')) %]
     [% L.radio_button_tag('upload_todo', value='stock', label= LxERP.t8('Only Stock')) %]
     [% L.radio_button_tag('upload_todo', value='price_stock', checked=1, label= LxERP.t8('Price and Stock')) %]
-    [% L.button_tag("kivi.shop_part.setup();", LxERP.t8("Upload all marked"), id="mass_transfer") %]
+    [% L.button_tag("kivi.ShopPart.setup();", LxERP.t8("Upload all marked"), id="mass_transfer") %]
   </div>
   <div id="status_mass_upload" style="display: none;">
     [%- INCLUDE 'shop_part/_upload_status.html' %]
diff --git a/templates/webpages/shop_part/_list_images.html b/templates/webpages/shop_part/_list_images.html
index 69ea803f8..d60ccbf1f 100644
--- a/templates/webpages/shop_part/_list_images.html
+++ b/templates/webpages/shop_part/_list_images.html
@@ -31,5 +31,5 @@
 
 [% L.sortable_element('#images_list tbody', url=SELF.url_for(action='reorder'), with='image_id') %]
 <p>
-[% L.button_tag("kivi.shop_part.imageUpload(" _ FORM.id _ ",'shop_image','image','Upload shopimage',0);", LxERP.t8('Upload shopimage') ) %]
+[% L.button_tag("kivi.ShopPart.imageUpload(" _ FORM.id _ ",'shop_image','image','Upload shopimage',0);", LxERP.t8('Upload shopimage') ) %]
 </p>
diff --git a/templates/webpages/shop_part/categories.html b/templates/webpages/shop_part/categories.html
index fcf680386..80676eb9b 100644
--- a/templates/webpages/shop_part/categories.html
+++ b/templates/webpages/shop_part/categories.html
@@ -50,6 +50,6 @@
         [% END %]
       [% END %]
   </div>
-    [% L.button_tag("kivi.shop_part.save_categories(" _ SELF.shop_part.id _", " _ SELF.shop_part.shop.id _")", LxERP.t8("Save"))  %]</td>
+    [% L.button_tag("kivi.ShopPart.save_categories(" _ SELF.shop_part.id _", " _ SELF.shop_part.shop.id _")", LxERP.t8("Save"))  %]</td>
 </form>
 
diff --git a/templates/webpages/shop_part/edit.html b/templates/webpages/shop_part/edit.html
index 089bfc6aa..3ecc0cc1b 100644
--- a/templates/webpages/shop_part/edit.html
+++ b/templates/webpages/shop_part/edit.html
@@ -64,11 +64,11 @@
     [% # L.dump(SELF.shop_part) %]
 
     [% IF SELF.shop_part.id %]
-    [% L.button_tag("kivi.shop_part.save_shop_part(" _ SELF.shop_part.id _ ")", LxERP.t8("Save"))  %]</td>
+    [% L.button_tag("kivi.ShopPart.save_shop_part(" _ SELF.shop_part.id _ ")", LxERP.t8("Save"))  %]</td>
     [% ELSE %]
-    [% L.button_tag("kivi.shop_part.add_shop_part(" _ FORM.part_id _", " _ FORM.shop_id _")", LxERP.t8("Save"))  %]</td>
+    [% L.button_tag("kivi.ShopPart.add_shop_part(" _ FORM.part_id _", " _ FORM.shop_id _")", LxERP.t8("Save"))  %]</td>
     [% END %]
-    [% # L.button_tag("kivi.shop_part.update_partnumber()", LxERP.t8("Update Partnumber"))  %]</td>
+    [% # L.button_tag("kivi.ShopPart.update_partnumber()", LxERP.t8("Update Partnumber"))  %]</td>
 
     [% # L.hidden_tag("action", "ShopPart/dispatch") %]
     [% # L.submit_tag('action_update', LxERP.t8('Save')) %]
