From 6266fee9e71b1682f22e17653d70eb1c60d3da7f Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 15 Mar 2017 16:40:41 +0100 Subject: [PATCH] change call for inserting fine uploader template and js code --- views/bootstrap/class.AddDocument.php | 7 +++++-- views/bootstrap/class.AddFile.php | 7 +++++-- views/bootstrap/class.UpdateDocument.php | 16 +++++++++++++--- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/views/bootstrap/class.AddDocument.php b/views/bootstrap/class.AddDocument.php index 9654adbd2..a652c758f 100644 --- a/views/bootstrap/class.AddDocument.php +++ b/views/bootstrap/class.AddDocument.php @@ -34,11 +34,12 @@ class SeedDMS_View_AddDocument extends SeedDMS_Bootstrap_Style { function js() { /* {{{ */ $dropfolderdir = $this->params['dropfolderdir']; $partitionsize = $this->params['partitionsize']; + $maxuploadsize = $this->params['maxuploadsize']; $enablelargefileupload = $this->params['enablelargefileupload']; header('Content-Type: application/javascript; charset=UTF-8'); if($enablelargefileupload) - $this->printFineUploaderJs('../op/op.UploadChunks.php', $partitionsize); + $this->printFineUploaderJs('../op/op.UploadChunks.php', $partitionsize, $maxuploadsize); ?> $(document).ready(function() { $('#new-file').click(function(event) { @@ -146,8 +147,10 @@ $(document).ready(function() { $folderid = $folder->getId(); $this->htmlAddHeader(''."\n", 'js'); - if($enablelargefileupload) + if($enablelargefileupload) { $this->htmlAddHeader(''."\n", 'js'); + $this->htmlAddHeader($this->getFineUploaderTemplate(), 'js'); + } $this->htmlStartPage(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName())))); $this->globalNavigation($folder); diff --git a/views/bootstrap/class.AddFile.php b/views/bootstrap/class.AddFile.php index 8804ee128..063daaf60 100644 --- a/views/bootstrap/class.AddFile.php +++ b/views/bootstrap/class.AddFile.php @@ -34,9 +34,10 @@ class SeedDMS_View_AddFile extends SeedDMS_Bootstrap_Style { function js() { /* {{{ */ $enablelargefileupload = $this->params['enablelargefileupload']; $partitionsize = $this->params['partitionsize']; + $maxuploadsize = $this->params['maxuploadsize']; header('Content-Type: application/javascript'); if($enablelargefileupload) - $this->printFineUploaderJs('../op/op.UploadChunks.php', $partitionsize); + $this->printFineUploaderJs('../op/op.UploadChunks.php', $partitionsize, $maxuploadsize); ?> $(document).ready( function() { @@ -119,8 +120,10 @@ $(document).ready( function() { $enablelargefileupload = $this->params['enablelargefileupload']; $this->htmlAddHeader(''."\n", 'js'); - if($enablelargefileupload) + if($enablelargefileupload) { $this->htmlAddHeader(''."\n", 'js'); + $this->htmlAddHeader($this->getFineUploaderTemplate(), 'js'); + } $this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName())))); $this->globalNavigation($folder); diff --git a/views/bootstrap/class.UpdateDocument.php b/views/bootstrap/class.UpdateDocument.php index d0c2a8bab..1b196cb32 100644 --- a/views/bootstrap/class.UpdateDocument.php +++ b/views/bootstrap/class.UpdateDocument.php @@ -36,13 +36,14 @@ class SeedDMS_View_UpdateDocument extends SeedDMS_Bootstrap_Style { $dropfolderdir = $this->params['dropfolderdir']; $enablelargefileupload = $this->params['enablelargefileupload']; $partitionsize = $this->params['partitionsize']; + $maxuploadsize = $this->params['maxuploadsize']; header('Content-Type: application/javascript'); $this->printDropFolderChooserJs("form1"); $this->printSelectPresetButtonJs(); $this->printInputPresetButtonJs(); $this->printCheckboxPresetButtonJs(); if($enablelargefileupload) - $this->printFineUploaderJs('../op/op.UploadChunks.php', $partitionsize, false); + $this->printFineUploaderJs('../op/op.UploadChunks.php', $partitionsize, $maxuploadsize, false); ?> $(document).ready( function() { jQuery.validator.addMethod("alternatives", function(value, element, params) { @@ -129,6 +130,7 @@ console.log(element); $document = $this->params['document']; $strictformcheck = $this->params['strictformcheck']; $enablelargefileupload = $this->params['enablelargefileupload']; + $maxuploadsize = $this->params['maxuploadsize']; $enableadminrevapp = $this->params['enableadminrevapp']; $enableownerrevapp = $this->params['enableownerrevapp']; $enableselfrevapp = $this->params['enableselfrevapp']; @@ -138,8 +140,10 @@ console.log(element); $documentid = $document->getId(); $this->htmlAddHeader(''."\n", 'js'); - if($enablelargefileupload) + if($enablelargefileupload) { $this->htmlAddHeader(''."\n", 'js'); + $this->htmlAddHeader($this->getFineUploaderTemplate(), 'js'); + } $this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName())))); $this->globalNavigation($folder); @@ -182,8 +186,14 @@ console.log(element); } } - $msg = getMLText("max_upload_size").": ".ini_get( "upload_max_filesize"); if($enablelargefileupload) { + if($maxuploadsize) { + $msg = getMLText("max_upload_size").": ".SeedDMS_Core_File::format_filesize($maxuploadsize); + } + } else { + $msg = getMLText("max_upload_size").": ".ini_get( "upload_max_filesize"); + } + if(0 && $enablelargefileupload) { $msg .= "

".sprintf(getMLText('link_alt_updatedocument'), "out.AddMultiDocument.php?folderid=".$folder->getID()."&showtree=".showtree())."

"; } $this->warningMsg($msg);