Commit 664c90890aedd847736d59b18e9ee4284fd4afc1

Authored by Charl Joseph Mert
1 parent c7c468a2

Moved downloadTask.php out of the /bin directory to solve IIS6 issues.

Committed by: Charl Joseph Mert
Reviewed by: Prince Mbekwa
plugins/ktcore/KTBulkActions.php
... ... @@ -1156,7 +1156,7 @@ class KTBrowseBulkExportAction extends KTBulkAction {
1156 1156 if($useQueue){
1157 1157 $result = parent::do_performaction();
1158 1158  
1159   - $url = KTUtil::kt_url() . '/bin/ajaxtasks/downloadTask.php';
  1159 + $url = KTUtil::kt_url() . '/presentation/lookAndFeel/knowledgeTree/bulkdownload/downloadTask.php';
1160 1160  
1161 1161 $oTemplating =& KTTemplating::getSingleton();
1162 1162 $oTemplate = $oTemplating->loadTemplate('ktcore/action/bulk_download');
... ...
plugins/ktstandard/KTBulkExportPlugin.php
... ... @@ -93,7 +93,7 @@ class KTBulkExportAction extends KTFolderAction {
93 93 if($useQueue){
94 94 DownloadQueue::addItem($exportCode, $sCurrentFolderId, $sCurrentFolderId, 'folder');
95 95  
96   - $task_url = KTUtil::kt_url() . '/bin/ajaxtasks/downloadTask.php';
  96 + $task_url = KTUtil::kt_url() . '/presentation/lookAndFeel/knowledgeTree/bulkdownload/downloadTask.php';
97 97  
98 98 $oTemplating =& KTTemplating::getSingleton();
99 99 $oTemplate = $oTemplating->loadTemplate('ktcore/action/bulk_download');
... ...
presentation/lookAndFeel/knowledgeTree/bulkdownload/downloadTask.php 0 → 100644
  1 +<?php
  2 +
  3 +chdir(dirname(__FILE__));
  4 +require_once('../../../../config/dmsDefaults.php');
  5 +require_once(KT_LIB_DIR . '/foldermanagement/compressionArchiveUtil.inc.php');
  6 +
  7 +/**
  8 + * The download task provides 2 pieces of functionality. The first is to process the download queue and the second is to "ping" the download queue.
  9 + * The processing of the download queue will create the archives for the bulk download action and set a flag to indicate their completion.
  10 + * The "ping" will check if the flag has been set and inform the user that the archive is ready for download.
  11 + */
  12 +
  13 +$queue = new DownloadQueue();
  14 +
  15 +// Check for a ping then check if the download is finished
  16 +$ping = isset($_POST['ping']) ? $_POST['ping'] : false;
  17 +if($ping == 'ping'){
  18 +
  19 + $code = $_POST['code'];
  20 + $status = $queue->isDownloadAvailable($code);
  21 +
  22 + if($status === false){
  23 + echo 'wait';
  24 + }else{
  25 + $str = '';
  26 + // display any error messages
  27 + if(!empty($status)){
  28 + $str = '<div><b>'._kt('The following errors occurred during the download').': </><br />';
  29 + $str .= '<table style="padding-top: 5px;" cellspacing="0" cellpadding="5">';
  30 + foreach ($status as $msg){
  31 + $str .= '<tr><td style="border: 1px #888 solid;">'.$msg.'</td></tr>';
  32 + }
  33 + $str .= '</table></div>';
  34 + }
  35 + echo $str;
  36 + }
  37 + exit(0);
  38 +}
  39 +
  40 +if($queue->isLocked()){
  41 + exit(0);
  42 +}
  43 +// Not a ping, process the queue
  44 +$queue->processQueue();
  45 +
  46 +exit(0);
  47 +?>
... ...