Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 29ae7e48

Von Werner Hahn vor mehr als 7 Jahren hinzugefügt

  • ID 29ae7e481e9953a0104b284e54691664210f8b10
  • Vorgänger eda89913
  • Nachfolger 56999d70

Shopmodul: FileUploader - Überarbeitet Es kann jeder Controller/action jetzt aufgerufen. Javascript in extra Datei

Conflicts:
SL/Controller/FileUploader.pm
js/kivi.FileUploader.js
js/kivi.ShopOrder.js

Unterschiede anzeigen:

SL/Controller/ShopOrder.pm
1 1
package SL::Controller::ShopOrder;
2
#package SL::Controller::ShopOrder;
2 3
# Controller::ShopOrder
3 4

  
4 5
use strict;
SL/DB/File.pm
2 2
# Feel free to modify it at will; it will not be overwritten automatically.
3 3

  
4 4
package SL::DB::File;
5
#package SL::DB::File;
5 6

  
6 7
use strict;
7 8

  
SL/ShopConnector/Shopware.pm
1 1
package SL::ShopConnector::Shopware;
2 2
#package SL::ShopConnector::Shopware;
3
#package SL::ShopConnector::Shopware;
3 4

  
4 5
use strict;
5 6

  
js/kivi.FileUploader.js
1
//TMP
2
namespace('kivi.FileUploader', function(ns) {
3
  //opens a popupdialog for fileupload
4

  
5
  //id                  = id of the id in the table files
6
  //trans_id            = id of the object (part_id, shoppart_id, project_id,...) where the file belongs to
7
  //modul               = name where the file belongs to like IC, shop_part, CV ....
8
  //controller_action   = Controller/Action wich will be called by button save in popupdialog the todo whatever you want to to with the file(save it to db, save it to webdav)
9
  //                      controller_action is passed to the popup_dialog fileupload form and can/will be called from the form to deal with the uploaded file
10
  //allowed_filetypes   = must be seperated by | like jpg|gif|pdf
11
  ns.add_file = function(id,trans_id,modul,controller_action,allowed_filetypes) {
12
    kivi.popup_dialog({
13
        url :           'controller.pl?action=FileUploader/ajax_add_file',
14
        data:           'id=' + id + '&trans_id=' + trans_id + '&modul=' + modul + '&ca=' + controller_action + '&aft=' + allowed_filetypes,
15
        dialog:         { title: kivi.t8('File upload') }
16
    } );
17
    return true;
18
  };
19

  
20
  ns.delete_file = function(id,controller_action) {
21
    $.post('controller.pl', { action: controller_action, id: id }, function(data) {
22
      kivi.eval_json_result(data);
23
    });
24
  };
25
});
js/kivi.ShopOrder.js
1
//TMP
2
namespace('kivi.ShopOrder', function(ns) {
3
  ns.massTransferInitialize = function() {
4
    kivi.popup_dialog({
5
      id: 'status_mass_transfer',
6
      dialog: {
7
        title: kivi.t8('Status Shoptransfer')
8
      }
9
    });
10
    alert('Hallo');
11
  };
12

  
13
  ns.massTransferStarted = function() {
14
    $('#status_mass_transfer').data('timerId', setInterval(function() {
15
      $.get("controller.pl", {
16
        action: 'ShopOrder/transfer_status',
17
        job_id: $('#smt_job_id').val()
18
      }, kivi.eval_json_result);
19
    }, 5000));
20
  };
21

  
22
  ns.massTransferFinished = function() {
23
    clearInterval($('#status_mass_transfer').data('timerId'));
24
    $('.ui-dialog-titlebar button.ui-dialog-titlebar-close').prop('disabled', '')
25
  };
26

  
27
  ns.setup = function() {
28
    kivi.ShopOrder.massTransferInitialize();
29
    kivi.submit_ajax_form('controller.pl?action=ShopOrder/mass_transfer','[name=shop_orders]');
30
  };
31

  
32
});
33
//$(kivi.ShopOrder.setup);
templates/webpages/common/file_upload.html
1
<!-- TMP -->
1 2
[%- USE LxERP -%][%- USE L -%][%- USE HTML -%][%- USE JavaScript -%][% USE Base64 %]
2 3
[% SET style="width: 500px" %]
3 4
[% SET id_base = "fileupload" %]
templates/webpages/shop_order/show.html
1
<!-- TMP -->
1 2
[%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE T8 -%]
2 3
[% L.stylesheet_tag('webshop') %]
3 4

  
templates/webpages/shop_part/_list_images.html
1
<!-- TMP -->
1 2
[%- USE HTML %][%- USE L -%][%- USE P -%][%- USE LxERP -%]
2 3
[%- USE T8 %][% USE Base64 %]
3 4
[%- USE Dumper %]

Auch abrufbar als: Unified diff