diff --git a/browse.php b/browse.php index dd6439c..cdc8738 100755 --- a/browse.php +++ b/browse.php @@ -57,6 +57,19 @@ class KTMassMoveColumn extends TitleColumn { parent::TitleColumn($sLabel, $sName); } + function renderFolderLink($aDataRow) { + $aFolders = $_SESSION['moves'][$this->sMoveCode]['folders']; + if (array_search($aDataRow['folder']->getId(), $aFolders) === false) { + $outStr = ''; + $outStr .= $aDataRow["folder"]->getName(); + $outStr .= ''; + } else { + $outStr = $aDataRow["folder"]->getName() . ' (' . _('you cannot move folders to themselves') . ')'; + } + return $outStr; + + } + function buildFolderLink($aDataRow) { return KTUtil::addQueryStringSelf(sprintf('fMoveCode=%s&fFolderId=%d&action=startMove', $this->sMoveCode, $aDataRow["folder"]->getId())); } @@ -275,6 +288,13 @@ class BrowseDispatcher extends KTStandardDispatcher { $this->errorRedirectToMain(_('No action selected.')); exit(0); } + + $aFolderSelection = KTUtil::arrayGet($_REQUEST, 'selection_f' , array()); + $aDocumentSelection = KTUtil::arrayGet($_REQUEST, 'selection_d' , array()); + if (empty($aFolderSelection) && empty($aDocumentSelection)) { + $this->errorRedirectToMain(_('Please select documents or folders first.')); + exit(0); + } if ($target == 'delete') { return $this->do_startDelete(); @@ -300,18 +320,16 @@ class BrowseDispatcher extends KTStandardDispatcher { $aDocumentSelection = KTUtil::arrayGet($_REQUEST, 'selection_d' , array()); - $sMoveCode = KTUtil::randomString(); $aMoveData = array('folders' => $aFolderSelection, 'documents' => $aDocumentSelection); - var_dump($aMoveData); - $moves = KTUtil::arrayGet($_SESSION, 'moves', array()); $moves = (array) $moves; // ? $moves[$sMoveCode] = $aMoveData; $_SESSION['moves'] = $moves; // ... } - + + $oFolder = Folder::get(KTUtil::arrayGet($_REQUEST, 'fFolderId', 1)); if (PEAR::isError($oFolder)) { $this->errorRedirectToMain(_('Invalid folder selected.')); @@ -355,6 +373,34 @@ class BrowseDispatcher extends KTStandardDispatcher { $aBreadcrumbs[] = array("url" => $url, "name" => $folder_path_names[$index]); } + + // now show the items... + $moveSet = $_SESSION['moves'][$sMoveCode]; + $moveItems = array(); + $moveItems['folders'] = array(); + $moveItems['documents'] = array(); + + $folderStr = ''; + $documentStr = ''; + + if (!empty($moveSet['folders'])) { + $folderStr = '' . _('Folders: ') . ''; + foreach ($moveSet['folders'] as $iFolderId) { + $oF = Folder::get($iFolderId); + $moveItems['folders'][] = $oF->getName(); + } + $folderStr .= implode(', ', $moveItems['folders']); + } + + if (!empty($moveSet['documents'])) { + $documentStr = '' . _('Documents: ') . ''; + foreach ($moveSet['documents'] as $iDocId) { + $oD = Document::get($iDocId); + $moveItems['documents'][] = $oD->getName(); + } + $documentStr .= implode(', ', $moveItems['documents']); + } + $oTemplating = new KTTemplating; $oTemplate = $oTemplating->loadTemplate("ktcore/action/mass_move"); $aTemplateData = array( @@ -363,6 +409,8 @@ class BrowseDispatcher extends KTStandardDispatcher { 'move_code' => $sMoveCode, 'collection' => $collection, 'collection_breadcrumbs' => $aBreadcrumbs, + 'folders' => $folderStr, + 'documents' => $documentStr, ); return $oTemplate->render($aTemplateData); @@ -520,6 +568,33 @@ class BrowseDispatcher extends KTStandardDispatcher { $aFolderSelection = KTUtil::arrayGet($_REQUEST, 'selection_f' , array()); $aDocumentSelection = KTUtil::arrayGet($_REQUEST, 'selection_d' , array()); + + // now show the items... + $delItems = array(); + $delItems['folders'] = array(); + $delItems['documents'] = array(); + + $folderStr = ''; + $documentStr = ''; + + if (!empty($aFolderSelection)) { + $folderStr = '' . _('Folders: ') . ''; + foreach ($aFolderSelection as $iFolderId) { + $oF = Folder::get($iFolderId); + $delItems['folders'][] = $oF->getName(); + } + $folderStr .= implode(', ', $delItems['folders']); + } + + if (!empty($aDocumentSelection)) { + $documentStr = '' . _('Documents: ') . ''; + foreach ($aDocumentSelection as $iDocId) { + $oD = Document::get($iDocId); + $delItems['documents'][] = $oD->getName(); + } + $documentStr .= implode(', ', $delItems['documents']); + } + $aFields = array(); $aFields[] = new KTStringWidget(_('Reason'), _('The reason for the deletion of these documents and folders for historical purposes.'), 'sReason', "", $this->oPage, true); @@ -531,6 +606,8 @@ class BrowseDispatcher extends KTStandardDispatcher { 'form_fields' => $aFields, 'folders' => $aFolderSelection, 'documents' => $aDocumentSelection, + 'folder_string' => $folderStr, + 'document_string' => $documentStr, ); return $oTemplate->render($aTemplateData); } diff --git a/config/config.ini b/config/config.ini index fda0e49..05f4648 100644 --- a/config/config.ini +++ b/config/config.ini @@ -75,7 +75,10 @@ companyLogoTitle = ACME Corporation ; use the additional IE specific GIF theme overrides. ; using this means that arbitrary theme packs may not work without ; having GIF versions available. -ieGIF = true +ieGIF = default + +; do not restrict to searches (e.g. always show_all) on users and groups pages. +alwaysShowAll = default ; ---------------------------------------------------------------- ; These sections are for more esoteric settings - you probably don't diff --git a/config/dmsDefaults.php b/config/dmsDefaults.php index e41d5f9..72a4004 100644 --- a/config/dmsDefaults.php +++ b/config/dmsDefaults.php @@ -381,6 +381,9 @@ $oKTConfig->setdefaultns("tweaks", "genericMetaDataRequired", true); $oKTConfig->setdefaultns("tweaks", "phpErrorLogFile", false); $oKTConfig->setdefaultns("tweaks", "developmentWindowLog", false); +$oKTConfig->setdefaultns("ui", "ieGIF", true); +$oKTConfig->setdefaultns("ui", "alwaysShowAll", false); + $oKTConfig->setdefaultns(null, "logLevel", 'INFO'); $oKTConfig->setdefaultns("import", "unzip", 'unzip'); diff --git a/lib/templating/kt3template.inc.php b/lib/templating/kt3template.inc.php index a550dfb..27d89f2 100644 --- a/lib/templating/kt3template.inc.php +++ b/lib/templating/kt3template.inc.php @@ -238,7 +238,7 @@ class KTPage { /* final render call. */ function render() { - + global $default; if (empty($this->contents)) { $this->contents = ""; } @@ -281,6 +281,7 @@ class KTPage { $oTemplate = $oTemplating->loadTemplate($this->template); $aTemplateData = array( "page" => $this, + "systemversion" => $default->systemVersion, ); // unlike the rest of KT, we use echo here. diff --git a/plugins/ktcore/admin/groupManagement.php b/plugins/ktcore/admin/groupManagement.php index 971e524..3d548e4 100755 --- a/plugins/ktcore/admin/groupManagement.php +++ b/plugins/ktcore/admin/groupManagement.php @@ -21,9 +21,11 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher { $this->oPage->setBreadcrumbDetails(_('select a group')); $this->oPage->setTitle(_("Group Management")); + $KTConfig =& KTConfig::getSingleton(); + $alwaysAll = $KTConfig->get("alwaysShowAll"); $name = KTUtil::arrayGet($_REQUEST, 'name'); - $show_all = KTUtil::arrayGet($_REQUEST, 'show_all', false); + $show_all = KTUtil::arrayGet($_REQUEST, 'show_all', $alwaysAll); $group_id = KTUtil::arrayGet($_REQUEST, 'group_id'); $no_search = true; diff --git a/plugins/ktcore/admin/userManagement.php b/plugins/ktcore/admin/userManagement.php index cb4aa72..e2c484e 100755 --- a/plugins/ktcore/admin/userManagement.php +++ b/plugins/ktcore/admin/userManagement.php @@ -20,9 +20,12 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('User Management')); $this->oPage->setBreadcrumbDetails(_('select a user')); $this->oPage->setTitle(_("User Management")); - + + $KTConfig =& KTConfig::getSingleton(); + $alwaysAll = $KTConfig->get("alwaysShowAll"); + $name = KTUtil::arrayGet($_REQUEST, 'name'); - $show_all = KTUtil::arrayGet($_REQUEST, 'show_all', false); + $show_all = KTUtil::arrayGet($_REQUEST, 'show_all', $alwaysAll); $user_id = KTUtil::arrayGet($_REQUEST, 'user_id'); $no_search = true; diff --git a/templates/kt3/standard_page.smarty b/templates/kt3/standard_page.smarty index a707359..72726fa 100644 --- a/templates/kt3/standard_page.smarty +++ b/templates/kt3/standard_page.smarty @@ -155,7 +155,8 @@ {$page->contents}
-{i18n}© 2006 The Jam Warehouse Software (Pty) Ltd. All Rights Reserved.{/i18n} +{i18n}© 2006 The Jam Warehouse Software (Pty) Ltd. All Rights Reserved{/i18n} +— {i18n arg_version="$systemversion"}KnowledgeTree Version: #version#{/i18n}
diff --git a/templates/ktcore/action/mass_move.smarty b/templates/ktcore/action/mass_move.smarty index ba8e8e1..ac2fbd8 100644 --- a/templates/ktcore/action/mass_move.smarty +++ b/templates/ktcore/action/mass_move.smarty @@ -6,6 +6,13 @@ +
+ +

{i18n}The items that you selected to move.{/i18n}

+{if ($folders)}{$folders}
{/if} +{if ($documents)}{$documents}{/if} +
+

{i18n}Use the folder collection and path below to diff --git a/templates/ktcore/folder/mass_delete.smarty b/templates/ktcore/folder/mass_delete.smarty index 80b1deb..5ab6780 100644 --- a/templates/ktcore/folder/mass_delete.smarty +++ b/templates/ktcore/folder/mass_delete.smarty @@ -18,6 +18,17 @@ will be recorded in the documents' "Transaction History"{/i18n}

{/foreach} + + +
+ +

{i18n}The items that you selected to delete.{/i18n}

+{if ($folder_string)}{$folder_string}
{/if} +{if ($document_string)}{$document_string}{/if} +
+ + + {foreach item=oWidget from=$form_fields} {$oWidget->render()} {/foreach}