From 50974b463b269ef022c87db6812d290c4b28b7c4 Mon Sep 17 00:00:00 2001
From: bryndivey
Date: Tue, 5 Sep 2006 10:32:56 +0000
Subject: [PATCH] Moved document move to iframe collection
---
plugins/ktcore/KTDocumentActions.php | 63 +++++++++++++++++++++------------------------------------------
templates/ktcore/action/move.smarty | 14 --------------
2 files changed, 21 insertions(+), 56 deletions(-)
diff --git a/plugins/ktcore/KTDocumentActions.php b/plugins/ktcore/KTDocumentActions.php
index b233fcd..58de510 100644
--- a/plugins/ktcore/KTDocumentActions.php
+++ b/plugins/ktcore/KTDocumentActions.php
@@ -771,16 +771,6 @@ class KTDocumentDeleteAction extends KTDocumentAction {
// }}}
-class KTDocumentMoveColumn extends TitleColumn {
- function KTDocumentMoveColumn($sLabel, $sName, $oDocument) {
- $this->oDocument = $oDocument;
- parent::TitleColumn($sLabel, $sName);
- }
- function buildFolderLink($aDataRow) {
- return KTUtil::addQueryString($_SERVER['PHP_SELF'], sprintf('fDocumentId=%d&fFolderId=%d', $this->oDocument->getId(), $aDataRow["folder"]->getId()));
- }
-}
-
// {{{ KTDocumentMoveAction
class KTDocumentMoveAction extends KTDocumentAction {
var $sName = 'ktcore.actions.document.move';
@@ -825,46 +815,35 @@ class KTDocumentMoveAction extends KTDocumentAction {
$sDocumentName = join(" » ", $aNames);
$move_fields[] = new KTStaticTextWidget(_kt('Document to move'), '', 'fDocumentId', $sDocumentName, $this->oPage, false);
- $collection = new DocumentCollection();
- $collection->addColumn(new KTDocumentMoveColumn("Test 1 (title)","title", $this->oDocument));
+ $collection = new AdvancedCollection();
+ $oCR =& KTColumnRegistry::getSingleton();
+ $col = $oCR->getColumn('ktcore.columns.title');
+ $col->setOptions(array('qs_params'=>array('fMoveCode'=>$sMoveCode,
+ 'fFolderId'=>$oFolder->getId(),
+ 'action'=>'startMove')));
+ $collection->addColumn($col);
+
$qObj = new FolderBrowseQuery($this->oFolder->getId());
$collection->setQueryObject($qObj);
- $batchPage = (int) KTUtil::arrayGet($_REQUEST, "page", 0);
- $batchSize = 20;
-
- $resultURL = KTUtil::addQueryString($_SERVER['PHP_SELF'], sprintf("fDocumentId=%d&fFolderId=%d", $this->oDocument->getId(), $this->oFolder->getId()));
- $collection->setBatching($resultURL, $batchPage, $batchSize);
+ $aOptions = $collection->getEnvironOptions();
+ $collection->setOptions($aOptions);
- // ordering. (direction and column)
- $displayOrder = KTUtil::arrayGet($_REQUEST, 'sort_order', "asc");
- if ($displayOrder !== "asc") { $displayOrder = "desc"; }
- $displayControl = KTUtil::arrayGet($_REQUEST, 'sort_on', "title");
-
- $collection->setSorting($displayControl, $displayOrder);
-
- $collection->getResults();
-
- $aBreadcrumbs = array();
- $folder_path_names = $this->oFolder->getPathArray();
- $folder_path_ids = explode(',', $this->oFolder->getParentFolderIds());
- $folder_path_ids[] = $this->oFolder->getId();
- if ($folder_path_ids[0] == 0) {
- array_shift($folder_path_ids);
- array_shift($folder_path_names);
- }
-
- foreach (range(0, count($folder_path_ids) - 1) as $index) {
- $id = $folder_path_ids[$index];
- $url = KTUtil::addQueryString($_SERVER['PHP_SELF'], sprintf("fDocumentId=%d&fFolderId=%d", $this->oDocument->getId(), $id));
- $aBreadcrumbs[] = array("url" => $url, "name" => $folder_path_names[$index]);
- }
+ $oWF =& KTWidgetFactory::getSingleton();
+ $oWidget = $oWF->get('ktcore.widgets.collection',
+ array('label' => _kt('Target Folder'),
+ 'description' => _kt('Use the folder collection and path below to browse to the folder you wish to move the documents into.'),
+ 'required' => true,
+ 'name' => 'browse',
+ 'folder_id' => $oFolder->getId(),
+ 'collection' => $collection));
+ $move_fields[] = $oWidget;
$oTemplate->setData(array(
'context' => &$this,
'move_fields' => $move_fields,
- 'collection' => $collection,
- 'collection_breadcrumbs' => $aBreadcrumbs,
+ //'collection' => $collection,
+ //'collection_breadcrumbs' => $aBreadcrumbs,
));
return $oTemplate->render();
}
diff --git a/templates/ktcore/action/move.smarty b/templates/ktcore/action/move.smarty
index 66c520c..7a7650a 100644
--- a/templates/ktcore/action/move.smarty
+++ b/templates/ktcore/action/move.smarty
@@ -17,20 +17,6 @@ move.{/i18n}
{$oWidget->render()}
{/foreach}
-
-
-
{i18n}Use the folder collection and path below to
-browse to the folder into which you wish to move the documents.{/i18n}
-
-
-{foreach from=$collection_breadcrumbs item=breadcrumb name=bc}
-
{$breadcrumb.name}
-{if !$smarty.foreach.bc.last}
-»
-{/if}
-{/foreach}
-{$collection->render()}
-
--
libgit2 0.21.4