Commit b1014fc40358c43770b5b6a7ccb7ec065b651dc0

Authored by Megan Watson
1 parent 8dc4a506

KTC-529

"Conflicting messages when attempting to cancel the checkout for a document via the KnowledgeTree web interface."
Fixed. Added in the cancel_url.

Committed by: Megan Watson
Reviewed by: Conrad Vermeulen



git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@8883 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 22 additions and 21 deletions
lib/actions/bulkaction.php
@@ -7,31 +7,31 @@ @@ -7,31 +7,31 @@
7 * Document Management Made Simple 7 * Document Management Made Simple
8 * Copyright (C) 2008 KnowledgeTree Inc. 8 * Copyright (C) 2008 KnowledgeTree Inc.
9 * Portions copyright The Jam Warehouse Software (Pty) Limited 9 * Portions copyright The Jam Warehouse Software (Pty) Limited
10 - * 10 + *
11 * This program is free software; you can redistribute it and/or modify it under 11 * This program is free software; you can redistribute it and/or modify it under
12 * the terms of the GNU General Public License version 3 as published by the 12 * the terms of the GNU General Public License version 3 as published by the
13 * Free Software Foundation. 13 * Free Software Foundation.
14 - * 14 + *
15 * This program is distributed in the hope that it will be useful, but WITHOUT 15 * This program is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18 * details. 18 * details.
19 - * 19 + *
20 * You should have received a copy of the GNU General Public License 20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>. 21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 - *  
23 - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, 22 + *
  23 + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
24 * California 94120-7775, or email info@knowledgetree.com. 24 * California 94120-7775, or email info@knowledgetree.com.
25 - * 25 + *
26 * The interactive user interfaces in modified source and object code versions 26 * The interactive user interfaces in modified source and object code versions
27 * of this program must display Appropriate Legal Notices, as required under 27 * of this program must display Appropriate Legal Notices, as required under
28 * Section 5 of the GNU General Public License version 3. 28 * Section 5 of the GNU General Public License version 3.
29 - * 29 + *
30 * In accordance with Section 7(b) of the GNU General Public License version 3, 30 * In accordance with Section 7(b) of the GNU General Public License version 3,
31 * these Appropriate Legal Notices must retain the display of the "Powered by 31 * these Appropriate Legal Notices must retain the display of the "Powered by
32 - * KnowledgeTree" logo and retain the original copyright notice. If the display of the 32 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
33 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices 33 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
34 - * must display the words "Powered by KnowledgeTree" and retain the original 34 + * must display the words "Powered by KnowledgeTree" and retain the original
35 * copyright notice. 35 * copyright notice.
36 * Contributor( s): ______________________________________ 36 * Contributor( s): ______________________________________
37 * 37 *
@@ -188,12 +188,12 @@ class KTBulkAction extends KTStandardDispatcher { @@ -188,12 +188,12 @@ class KTBulkAction extends KTStandardDispatcher {
188 while (!empty($aRemainingFolders)) { 188 while (!empty($aRemainingFolders)) {
189 $iFolderId = array_pop($aRemainingFolders); 189 $iFolderId = array_pop($aRemainingFolders);
190 $oFolder = Folder::get($iFolderId); 190 $oFolder = Folder::get($iFolderId);
191 - 191 +
192 if(count($oFolder->getSymbolicLinks()) > 0){ 192 if(count($oFolder->getSymbolicLinks()) > 0){
193 $symlinksPresent = true; 193 $symlinksPresent = true;
194 break; 194 break;
195 } 195 }
196 - 196 +
197 $aChildDocs = Document::getList(array('folder_id = ?',array($iFolderId))); 197 $aChildDocs = Document::getList(array('folder_id = ?',array($iFolderId)));
198 foreach ($aChildDocs as $oDoc) { 198 foreach ($aChildDocs as $oDoc) {
199 if(count($oDoc->getSymbolicLinks()) > 0){ 199 if(count($oDoc->getSymbolicLinks()) > 0){
@@ -201,7 +201,7 @@ class KTBulkAction extends KTStandardDispatcher { @@ -201,7 +201,7 @@ class KTBulkAction extends KTStandardDispatcher {
201 break; 201 break;
202 } 202 }
203 } 203 }
204 - 204 +
205 $aCFIds = Folder::getList(array('parent_id = ?', array($iFolderId)), array('ids' => true)); 205 $aCFIds = Folder::getList(array('parent_id = ?', array($iFolderId)), array('ids' => true));
206 $aRemainingFolders = kt_array_merge($aRemainingFolders, $aCFIds); 206 $aRemainingFolders = kt_array_merge($aRemainingFolders, $aCFIds);
207 } 207 }
@@ -209,16 +209,16 @@ class KTBulkAction extends KTStandardDispatcher { @@ -209,16 +209,16 @@ class KTBulkAction extends KTStandardDispatcher {
209 } 209 }
210 return $symlinksPresent; 210 return $symlinksPresent;
211 } 211 }
212 - 212 +
213 /** 213 /**
214 * checks a folderList for shortcuts and queries the repositories for all folders 214 * checks a folderList for shortcuts and queries the repositories for all folders
215 - * that are somehow connected to these folders. 215 + * that are somehow connected to these folders.
216 */ 216 */
217 function getLinkingEntities($aFolderList){ 217 function getLinkingEntities($aFolderList){
218 $aSearchFolders = array(); 218 $aSearchFolders = array();
219 if(!empty($aFolderList)){ 219 if(!empty($aFolderList)){
220 foreach($aFolderList as $oFolderItem){ 220 foreach($aFolderList as $oFolderItem){
221 - if(Permission::userHasFolderReadPermission($oFolderItem)){ 221 + if(Permission::userHasFolderReadPermission($oFolderItem)){
222 // If it is a shortcut, we should do some more searching 222 // If it is a shortcut, we should do some more searching
223 if($oFolderItem->isSymbolicLink()){ 223 if($oFolderItem->isSymbolicLink()){
224 $oFolderItem = $oFolderItem->getLinkedFolder(); 224 $oFolderItem = $oFolderItem->getLinkedFolder();
@@ -244,20 +244,20 @@ class KTBulkAction extends KTStandardDispatcher { @@ -244,20 +244,20 @@ class KTBulkAction extends KTStandardDispatcher {
244 if($oFolderItem->isSymbolicLink()){ 244 if($oFolderItem->isSymbolicLink()){
245 $oFolderItem = $oFolderItem->getLinkedFolder(); 245 $oFolderItem = $oFolderItem->getLinkedFolder();
246 } 246 }
247 - if(Permission::userHasFolderReadPermission($oFolderItem)){ 247 + if(Permission::userHasFolderReadPermission($oFolderItem)){
248 if($aSearchCompletedFolders[$oFolderItem->getID()] != true){ 248 if($aSearchCompletedFolders[$oFolderItem->getID()] != true){
249 $aSearchFolders[] = $oFolderItem->getID(); 249 $aSearchFolders[] = $oFolderItem->getID();
250 $aSearchCompletedFolders[$oFolderItem->getID()] = true; 250 $aSearchCompletedFolders[$oFolderItem->getID()] = true;
251 } 251 }
252 } 252 }
253 - } 253 + }
254 if(!isset($aLinkingFolders[$oFolder->getId()])){ 254 if(!isset($aLinkingFolders[$oFolder->getId()])){
255 $aLinkingFolders[$oFolder->getId()] = $oFolder; 255 $aLinkingFolders[$oFolder->getId()] = $oFolder;
256 } 256 }
257 } 257 }
258 return $aLinkingFolders; 258 return $aLinkingFolders;
259 } 259 }
260 - 260 +
261 // doesn't actually do checks, as they have to be performed per-entity 261 // doesn't actually do checks, as they have to be performed per-entity
262 function check() { 262 function check() {
263 // not necessarily coming from a folder... 263 // not necessarily coming from a folder...
@@ -347,13 +347,13 @@ class KTBulkAction extends KTStandardDispatcher { @@ -347,13 +347,13 @@ class KTBulkAction extends KTStandardDispatcher {
347 } 347 }
348 348
349 $res = $this->perform_action($oDocument); 349 $res = $this->perform_action($oDocument);
350 - 350 +
351 //check for shortcut notice 351 //check for shortcut notice
352 $notice = null; 352 $notice = null;
353 if($oDocument->isSymbolicLink()){ 353 if($oDocument->isSymbolicLink()){
354 $notice = _kt("Shortcut"); 354 $notice = _kt("Shortcut");
355 } 355 }
356 - 356 +
357 if(PEAR::isError($res)) { 357 if(PEAR::isError($res)) {
358 $this->aActionResults['documents'][] = array($sName, $res->getMessage(), $notice); 358 $this->aActionResults['documents'][] = array($sName, $res->getMessage(), $notice);
359 } else { 359 } else {
@@ -376,7 +376,7 @@ class KTBulkAction extends KTStandardDispatcher { @@ -376,7 +376,7 @@ class KTBulkAction extends KTStandardDispatcher {
376 if($oFolder->isSymbolicLink()){ 376 if($oFolder->isSymbolicLink()){
377 $notice = _kt("Shortcut"); 377 $notice = _kt("Shortcut");
378 } 378 }
379 - 379 +
380 if(PEAR::isError($res)) { 380 if(PEAR::isError($res)) {
381 $this->aActionResults['folders'][] = array($sName, $res->getMessage(), $notice); 381 $this->aActionResults['folders'][] = array($sName, $res->getMessage(), $notice);
382 } else { 382 } else {
@@ -418,6 +418,7 @@ class KTBulkAction extends KTStandardDispatcher { @@ -418,6 +418,7 @@ class KTBulkAction extends KTStandardDispatcher {
418 'targeturl' => $this->getURL(), 418 'targeturl' => $this->getURL(),
419 'action' => 'collectinfo', 419 'action' => 'collectinfo',
420 'fail_action' => 'main', 420 'fail_action' => 'main',
  421 + 'cancel_url' => KTBrowseUtil::getUrlForFolder($this->oFolder),
421 'noframe' => true, 422 'noframe' => true,
422 'extraargs' => array('fListCode' => $sListCode, 423 'extraargs' => array('fListCode' => $sListCode,
423 'fActiveListCode' => $sActiveListCode, 424 'fActiveListCode' => $sActiveListCode,