Commit 0bd501d2f3dc3313fe9faf66afc5c6073854138f

Authored by kevin_fourie
1 parent 45030243

Merged in from DEV trunk...

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