diff --git a/lib/foldermanagement/compressionArchiveUtil.inc.php b/lib/foldermanagement/compressionArchiveUtil.inc.php index bddf3cf..5db6082 100644 --- a/lib/foldermanagement/compressionArchiveUtil.inc.php +++ b/lib/foldermanagement/compressionArchiveUtil.inc.php @@ -602,11 +602,11 @@ class DownloadQueue foreach ($download as $item){ if($item['object_type'] == 'document'){ $docId = $item['object_id']; - $this->addDocument($zip, $docId); + $this->addDocument($zip, $docId, false); } if($item['object_type'] == 'folder'){ $folderId = $item['object_id']; - $this->addFolder($zip, $folderId); + $this->addFolder($zip, $folderId, false); } } @@ -668,9 +668,10 @@ class DownloadQueue * * @param unknown_type $zip * @param unknown_type $docId + * @param boolean $alerts * @return unknown */ - public function addDocument(&$zip, $docId) + public function addDocument(&$zip, $docId, $alerts = true) { $oDocument = Document::get($docId); @@ -685,7 +686,7 @@ class DownloadQueue } // fire subscription alerts for the downloaded document - if global config is set - if($this->bNotifications){ + if($this->bNotifications && $alerts){ $oSubscriptionEvent = new SubscriptionEvent(); $oFolder = Folder::get($oDocument->getFolderID()); $oSubscriptionEvent->DownloadDocument($oDocument, $oFolder); @@ -699,9 +700,10 @@ class DownloadQueue * * @param unknown_type $zip * @param unknown_type $folderId + * @param boolean $alerts * @return unknown */ - public function addFolder(&$zip, $folderId) + public function addFolder(&$zip, $folderId, $alerts = true) { $oFolder = Folder::get($folderId); @@ -781,7 +783,7 @@ class DownloadQueue } // fire subscription alerts for the downloaded document - if($this->bNotifications){ + if($this->bNotifications && $alerts) { $oSubscriptionEvent = new SubscriptionEvent(); $oSubscriptionEvent->DownloadDocument($oDocument, $oFolder); } diff --git a/plugins/ktcore/KTBulkActions.php b/plugins/ktcore/KTBulkActions.php index 01e285d..13ed4f3 100644 --- a/plugins/ktcore/KTBulkActions.php +++ b/plugins/ktcore/KTBulkActions.php @@ -1194,7 +1194,6 @@ class KTBrowseBulkExportAction extends KTBulkAction { * */ function perform_action($oEntity) { - // TODO find a way to do bulk email $exportCode = $_SESSION['exportcode']; $this->oZip = ZipFolder::get($exportCode); @@ -1213,7 +1212,7 @@ class KTBrowseBulkExportAction extends KTBulkAction { if($useQueue){ DownloadQueue::addItem($this->sExportCode, $this->oFolder->getId(), $oDocument->iId, 'document'); }else{ - $oQueue->addDocument($this->oZip, $oDocument->iId); + $oQueue->addDocument($this->oZip, $oDocument->iId, false); } diff --git a/plugins/ktcore/admin/manageBranding.php b/plugins/ktcore/admin/manageBranding.php index 8313f57..75ba5b7 100755 --- a/plugins/ktcore/admin/manageBranding.php +++ b/plugins/ktcore/admin/manageBranding.php @@ -96,10 +96,11 @@ class ManageBrandDispatcher extends KTAdminDispatcher { 'encoding' => 'multipart/form-data', 'context' => &$this, 'extraargs' => $this->meldPersistQuery("","",true), - 'description' => _kt('You can set the branding details.') + 'description' => _kt('You can set the branding details.') )); $oWF =& KTWidgetFactory::getSingleton(); + $oVF =& KTValidatorFactory::getSingleton(); $widgets = array(); $validators = array(); @@ -126,6 +127,13 @@ class ManageBrandDispatcher extends KTAdminDispatcher { 'value' => $logoUrl, 'description' => _kt("This is the website address you will be redirected to after clicking the logo. The url should include the protocol e.g. http://www.knowledgetree.com . If no protocol is given the url is treated as a relative link."), )); + + + // Adding the url widget + $validators[] = $oVF->get('ktcore.widgets.string', array( + 'test' => 'logo_url', + 'output' => 'logo_url', + )); $oForm->setWidgets($widgets); $oForm->setValidators($validators); @@ -428,9 +436,6 @@ class ManageBrandDispatcher extends KTAdminDispatcher { return $oForm; } - - - /* * Action responsible for setting the logo details @@ -443,12 +448,12 @@ class ManageBrandDispatcher extends KTAdminDispatcher { $config =& KTConfig::getSingleton(); $logoUrl = $_REQUEST['data']['logo_url']; $logoTitle = $_REQUEST['data']['logo_title']; + + $aOptions = array('redirect_to' => 'main'); - if(!preg_match('/([a-z])|([A-Z])|([0-9])/', $logoTitle)){ - $this->errorRedirectTo('main', _kt("You have entered an invalid character in the logo title. You may use only letters and numbers.")); + if ($logoTitle != '') { + $this->oValidator->validateIllegalCharacters($logoTitle, $aOptions); } - - $logoTitle = addslashes(htmlentities($logoTitle)); if ($config->set('ui/companyLogoUrl', $logoUrl) && $config->set('ui/companyLogoTitle', $logoTitle)) { $this->successRedirectTo('main', _kt('Logo fields have been successfully updated.')); @@ -458,8 +463,6 @@ class ManageBrandDispatcher extends KTAdminDispatcher { } - - /* * Action responsible for uploading the logo * diff --git a/plugins/ktstandard/KTBulkExportPlugin.php b/plugins/ktstandard/KTBulkExportPlugin.php index 7f78763..65c5aae 100644 --- a/plugins/ktstandard/KTBulkExportPlugin.php +++ b/plugins/ktstandard/KTBulkExportPlugin.php @@ -70,6 +70,16 @@ class KTBulkExportAction extends KTFolderAction { return _kt('Bulk Download'); } + /** + * Deal with bulk actions + */ + function do_notification($objects, $eventAction, $targetFolder) { + if ($targetFolder && count($objects) > 0 && $eventAction != '') { // Make sure there were documents/folders affected + $oSubscriptionEvent = new SubscriptionEvent(); + $oSubscriptionEvent->notifyBulkDocumentAction($objects, $eventAction, $targetFolder); + } + } + function do_main() { $config = KTConfig::getSingleton(); $useQueue = $config->get('export/useDownloadQueue', true); @@ -91,13 +101,22 @@ class KTBulkExportAction extends KTFolderAction { $folderurl = KTBrowseUtil::getUrlForFolder($this->oFolder); if($useQueue){ + $aDocList = array(); + $originalFolder =& Folder::get($sCurrentFolderId); + $docIds = $originalFolder->getDocumentIDs($sCurrentFolderId); + $docIds = split(",", $docIds); + foreach ($docIds as $dId) { + $aDocList[] = & Document::get($dId); + } + $this->do_notification($aDocList, "DownloadDocument", $originalFolder); // Send off notifications about bulk action + DownloadQueue::addItem($exportCode, $sCurrentFolderId, $sCurrentFolderId, 'folder'); $task_url = KTUtil::kt_url() . '/presentation/lookAndFeel/knowledgeTree/bulkdownload/downloadTask.php'; - $oTemplating =& KTTemplating::getSingleton(); $oTemplate = $oTemplating->loadTemplate('ktcore/action/bulk_download'); + $aParams = array( 'folder_url' => $folderurl, 'url' => $task_url, @@ -176,12 +195,6 @@ class KTBulkExportAction extends KTFolderAction { $oDocumentTransaction->create(); } - // fire subscription alerts for the downloaded document - if($bNotifications){ - //$oSubscriptionEvent = new SubscriptionEvent(); - //$oSubscriptionEvent->DownloadDocument($oDocument, $oFolder); - } - $this->oZip->addDocumentToZip($oDocument, $oFolder); } } diff --git a/plugins/multiselect/BulkImport.php b/plugins/multiselect/BulkImport.php index d3985a4..b86bcac 100755 --- a/plugins/multiselect/BulkImport.php +++ b/plugins/multiselect/BulkImport.php @@ -71,7 +71,7 @@ class InetBulkImportFolderMultiSelectAction extends KTFolderAction { if (method_exists($oPage, 'requireJSResources')) { $oPage->requireJSResources($aJavascript); } - return $js._kt('Import from Server Location'); + return _kt('Import from Server Location') . $js; } else { diff --git a/plugins/multiselect/BulkUpload.php b/plugins/multiselect/BulkUpload.php index 11f3f18..e1c51cf 100755 --- a/plugins/multiselect/BulkUpload.php +++ b/plugins/multiselect/BulkUpload.php @@ -75,7 +75,7 @@ class InetBulkUploadFolderAction extends KTFolderAction { } $js = ""; - return $js._kt('Bulk Upload'); + return _kt('Bulk Upload') .$js; } else { diff --git a/plugins/multiselect/MultiSelectPlugin.php b/plugins/multiselect/MultiSelectPlugin.php index 2b6f00d..707e9c3 100644 --- a/plugins/multiselect/MultiSelectPlugin.php +++ b/plugins/multiselect/MultiSelectPlugin.php @@ -126,6 +126,7 @@ class MultiSelectPlugin extends KTPlugin { 'InetdocumentFieldsv2.php', null); } } + $oPluginRegistry =& KTPluginRegistry::getSingleton(); $oPluginRegistry->registerPlugin('MultiSelectPlugin', 'inet.multiselect.lookupvalue.plugin', __FILE__); ?> \ No newline at end of file