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
package SL::Controller::ShopOrder;
#package SL::Controller::ShopOrder;
# Controller::ShopOrder
use strict;
SL/DB/File.pm
# Feel free to modify it at will; it will not be overwritten automatically.
package SL::DB::File;
#package SL::DB::File;
use strict;
SL/ShopConnector/Shopware.pm
package SL::ShopConnector::Shopware;
#package SL::ShopConnector::Shopware;
#package SL::ShopConnector::Shopware;
use strict;
js/kivi.FileUploader.js
//TMP
namespace('kivi.FileUploader', function(ns) {
//opens a popupdialog for fileupload
//id = id of the id in the table files
//trans_id = id of the object (part_id, shoppart_id, project_id,...) where the file belongs to
//modul = name where the file belongs to like IC, shop_part, CV ....
//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)
// controller_action is passed to the popup_dialog fileupload form and can/will be called from the form to deal with the uploaded file
//allowed_filetypes = must be seperated by | like jpg|gif|pdf
ns.add_file = function(id,trans_id,modul,controller_action,allowed_filetypes) {
kivi.popup_dialog({
url : 'controller.pl?action=FileUploader/ajax_add_file',
data: 'id=' + id + '&trans_id=' + trans_id + '&modul=' + modul + '&ca=' + controller_action + '&aft=' + allowed_filetypes,
dialog: { title: kivi.t8('File upload') }
} );
return true;
};
ns.delete_file = function(id,controller_action) {
$.post('controller.pl', { action: controller_action, id: id }, function(data) {
kivi.eval_json_result(data);
});
};
});
js/kivi.ShopOrder.js
//TMP
namespace('kivi.ShopOrder', function(ns) {
ns.massTransferInitialize = function() {
kivi.popup_dialog({
id: 'status_mass_transfer',
dialog: {
title: kivi.t8('Status Shoptransfer')
}
});
alert('Hallo');
};
ns.massTransferStarted = function() {
$('#status_mass_transfer').data('timerId', setInterval(function() {
$.get("controller.pl", {
action: 'ShopOrder/transfer_status',
job_id: $('#smt_job_id').val()
}, kivi.eval_json_result);
}, 5000));
};
ns.massTransferFinished = function() {
clearInterval($('#status_mass_transfer').data('timerId'));
$('.ui-dialog-titlebar button.ui-dialog-titlebar-close').prop('disabled', '')
};
ns.setup = function() {
kivi.ShopOrder.massTransferInitialize();
kivi.submit_ajax_form('controller.pl?action=ShopOrder/mass_transfer','[name=shop_orders]');
};
});
//$(kivi.ShopOrder.setup);
templates/webpages/common/file_upload.html
<!-- TMP -->
[%- USE LxERP -%][%- USE L -%][%- USE HTML -%][%- USE JavaScript -%][% USE Base64 %]
[% SET style="width: 500px" %]
[% SET id_base = "fileupload" %]
templates/webpages/shop_order/show.html
<!-- TMP -->
[%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE T8 -%]
[% L.stylesheet_tag('webshop') %]
templates/webpages/shop_part/_list_images.html
<!-- TMP -->
[%- USE HTML %][%- USE L -%][%- USE P -%][%- USE LxERP -%]
[%- USE T8 %][% USE Base64 %]
[%- USE Dumper %]

Auch abrufbar als: Unified diff