From d6f0d1fa19a48fa7e7ce4e473e1d249c1d6a2075 Mon Sep 17 00:00:00 2001 From: Brad Shuttleworth Date: Fri, 18 Nov 2005 13:54:43 +0000 Subject: [PATCH] 5 Brad Shuttleworth Fri 2005-11-18 15:55:21 +0200 merge up: 2005-11-18 15:55 --- config/siteMap.inc | 2 +- lib/dispatcher.inc.php | 17 +++++++++++++++++ lib/documentmanagement/Document.inc | 2 +- lib/foldermanagement/Folder.inc | 2 +- lib/templating/kt3template.inc.php | 2 ++ plugins/ktcore/KTAdminNavigation.php | 6 ++++-- plugins/ktcore/KTAdminPlugins.php | 11 +++++++++-- presentation/lookAndFeel/knowledgeTree/administration/admin.php | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------- presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/documentCheckout.php | 133 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/editDocCheckoutBL.php | 78 ------------------------------------------------------------------------------ presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/editDocCheckoutUI.inc | 71 ----------------------------------------------------------------------- presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/listDocumentsBL.php | 60 ------------------------------------------------------------ presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/documentFields.php | 14 ++++++++++---- resources/css/kt-framing.css | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- templates/kt3/admin_items.smarty | 2 +- templates/kt3/standard_page.smarty | 14 ++++++++++++-- templates/ktcore/document/admin/checkoutlisting.smarty | 32 ++++++++++++++++++++++++++++++++ templates/ktcore/document/admin/force_checkin_confirm.smarty | 35 +++++++++++++++++++++++++++++++++++ templates/ktcore/fields/list.smarty | 9 +++++++-- templates/ktcore/metadata/listFieldsets.smarty | 9 +++++---- 20 files changed, 391 insertions(+), 271 deletions(-) create mode 100644 presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/documentCheckout.php delete mode 100644 presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/editDocCheckoutBL.php delete mode 100644 presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/editDocCheckoutUI.inc delete mode 100644 presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/listDocumentsBL.php create mode 100644 templates/ktcore/document/admin/checkoutlisting.smarty create mode 100644 templates/ktcore/document/admin/force_checkin_confirm.smarty diff --git a/config/siteMap.inc b/config/siteMap.inc index 97e285a..d9fa460 100644 --- a/config/siteMap.inc +++ b/config/siteMap.inc @@ -105,7 +105,7 @@ $default->siteMap->addPage("unitManagement", "/presentation/lookAndFeel/knowledg $default->siteMap->addPage("orgManagement", "/presentation/lookAndFeel/knowledgeTree/administration/orgmanagement/listOrgBL.php", "Administration", SysAdmin, _("Organisation Management"), true, 4); $default->siteMap->addPage("doctype", "presentation/lookAndFeel/knowledgeTree/administration/doctypemanagement/documentTypes.php", "Administration", SysAdmin, _("Document Type Management"), true, 5); -$default->siteMap->addPage("docfield", "/presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/documentFields.php", "Administration", SysAdmin, _("Document Field Management"), true, 6); +$default->siteMap->addPage("docfield", "/presentation/lookAndFeel/knowledgeTree/administration/admin.php/documents/fieldmanagement", "Administration", SysAdmin, _("Document Field Management"), true, 6); $default->siteMap->addPage("archivedDocuments", "/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/manageArchivedDocumentsBL.php", "Administration", UnitAdmin, _("Restore Archived Documents"), true, 7); $default->siteMap->addPage("deletedDocuments", "/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/listDeletedDocumentsBL.php", "Administration", UnitAdmin, _("Deleted Documents"), true, 8); diff --git a/lib/dispatcher.inc.php b/lib/dispatcher.inc.php index f1f8ccf..faebd48 100644 --- a/lib/dispatcher.inc.php +++ b/lib/dispatcher.inc.php @@ -179,6 +179,23 @@ class KTStandardDispatcher extends KTDispatcher { $this->oPage->setPageContents($data); $this->oPage->setUser($this->oUser); + // handle errors that were set using KTErrorMessage. + $errors = KTUtil::arrayGet($_SESSION, 'KTErrorMessage', array()); + if (!empty($errors)) { + foreach ($errors as $sError) { + $this->oPage->addError($sError); + } + $_SESSION['KTErrorMessage'] = array(); // clean it out. + } + + // handle notices that were set using KTInfoMessage. + $info = KTUtil::arrayGet($_SESSION, 'KTInfoMessage', array()); + if (!empty($info)) { + foreach ($info as $sInfo) { + $this->oPage->addInfo($sInfo); + } + $_SESSION['KTInfoMessage'] = array(); // clean it out. + } // add last, standard portlets $this->oPage->addPortlet(new KTSearchPortlet()); diff --git a/lib/documentmanagement/Document.inc b/lib/documentmanagement/Document.inc index 38f72db..48319f9 100644 --- a/lib/documentmanagement/Document.inc +++ b/lib/documentmanagement/Document.inc @@ -531,7 +531,7 @@ class Document extends KTEntity { $sFolderPath = Folder::getFolderDisplayPath($this->iFolderID); // #3425 for consistency return ($bDisplayIcon ? $this->getIcon() : "") . - ($sFolderPath == "" ? "Deleted Folder" : $sFolderPath) . " > " . $this->sFileName; + ($sFolderPath == "" ? "Deleted Folder" : $sFolderPath) . " » " . $this->sFileName; } // }}} diff --git a/lib/foldermanagement/Folder.inc b/lib/foldermanagement/Folder.inc index 94c1e21..0553ecb 100644 --- a/lib/foldermanagement/Folder.inc +++ b/lib/foldermanagement/Folder.inc @@ -421,7 +421,7 @@ class Folder extends KTEntity { global $default; $aPathNamesArray = Folder::getFolderPathNamesAsArray($iFolderID); if (count($aPathNamesArray) > 0) { - return implode(" > ", $aPathNamesArray); + return implode(" » ", $aPathNamesArray); } else { return ""; } diff --git a/lib/templating/kt3template.inc.php b/lib/templating/kt3template.inc.php index 6846edb..c5c4763 100644 --- a/lib/templating/kt3template.inc.php +++ b/lib/templating/kt3template.inc.php @@ -21,6 +21,7 @@ class KTPage { /** context-relevant information */ var $errStack = Array(); + var $infoStack = Array(); var $portlets = Array(); /** miscellaneous items */ @@ -167,6 +168,7 @@ class KTPage { } function addError($sError) { array_push($this->errStack, $sError); } + function addInfo($sInfo) { array_push($this->infoStack, $sInfo); } /** no-one cares what a portlet is, but it should be renderable, and have its ->title member set. */ function addPortlet($oPortlet) { diff --git a/plugins/ktcore/KTAdminNavigation.php b/plugins/ktcore/KTAdminNavigation.php index 96c7bfb..b440783 100644 --- a/plugins/ktcore/KTAdminNavigation.php +++ b/plugins/ktcore/KTAdminNavigation.php @@ -18,14 +18,16 @@ class KTAdminNavigationRegistry { // namespace, class, category, title, description // if category is specified, it looks for an item with THAT NAME for its details. function registerLocation($sName, $sClass, $sCategory, $sTitle, $sDescription, $sDispatcherFilePath = null, $sURL = null) { + $sFullname = $sCategory . '/' . $sName; $aInfo = array( "name" => $sName, "class" => $sClass, "title" => $sTitle, "description"=> $sDescription, "filepath" => $sDispatcherFilePath, - "url" => $sURL); - $this->aResources[$sName] = $aInfo; + "url" => $sURL, + "fullname" => $sFullname); + $this->aResources[$sFullname] = $aInfo; // is this a toplevel item? if ($sCategory != null) { if (!array_key_exists($sCategory, $this->aCategories)) { diff --git a/plugins/ktcore/KTAdminPlugins.php b/plugins/ktcore/KTAdminPlugins.php index e1200ab..4626acf 100644 --- a/plugins/ktcore/KTAdminPlugins.php +++ b/plugins/ktcore/KTAdminPlugins.php @@ -7,7 +7,7 @@ $oAdminRegistry =& KTAdminNavigationRegistry::getSingleton(); // set up the categories. $oAdminRegistry->registerCategory("principals", "Users and Groups", " Control which users can log in, and are part of which groups and organisational units from these management panels."); $oAdminRegistry->registerCategory("security", "Security Management", " Assign permissions to users and groups, and specify which permissions are required to interact with various parts of the Document Management System."); -$oAdminRegistry->registerCategory("storage", "Document Storage", "Manage how and where the actual documents will be stored, and work with document archives."); +$oAdminRegistry->registerCategory("storage", "Document Storage", "Manage how and where the actual documents will be stored, work with document archives and deal with other document related problems."); $oAdminRegistry->registerCategory("documents", "Document Type Configuration", "Configure the information that needs to be collected about different kinds of documents."); $oAdminRegistry->registerCategory("collections", "Collections", "Specify how groups of documents are displayed in browse and search mode."); @@ -25,8 +25,15 @@ $oAdminRegistry->registerCategory("collections", "Collections", "Specify how gro // FIXME url traversal DOESN'T WORK // users and groups -$oAdminRegistry->registerLocation("principals/admin",null,"principals", "Add/Remove Users","Add or remove users from the system.",null, "/control.php?action=userManagement") +$oAdminRegistry->registerLocation("admin",null,"principals", "Add/Remove Users","Add or remove users from the system.",null, "/control.php?action=userManagement"); +// documents +$oAdminRegistry->registerLocation("fieldmanagement",'KTDocumentFieldDispatcher','documents', 'Document Fieldsets','Control which kinds of documents have which sets of information associated with them.', KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/documentFields.php', null); + + +// storage +$oAdminRegistry->registerLocation("checkout",'KTCheckoutAdminDispatcher','storage', 'Checked Out Document Control','Override the checked-out status of documents if a user has failed to do so.', KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/documentCheckout.php', null); + ?> \ No newline at end of file diff --git a/presentation/lookAndFeel/knowledgeTree/administration/admin.php b/presentation/lookAndFeel/knowledgeTree/administration/admin.php index dd637ad..d164934 100644 --- a/presentation/lookAndFeel/knowledgeTree/administration/admin.php +++ b/presentation/lookAndFeel/knowledgeTree/administration/admin.php @@ -10,53 +10,62 @@ require_once(KT_DIR . "/plugins/ktcore/KTAdminNavigation.php"); require_once(KT_DIR . "/plugins/ktcore/KTAdminPlugins.php"); class AdminSplashDispatcher extends KTAdminDispatcher { - var $sub_url = ''; - - var $aBreadcrumbs = array( + var $category = ''; + + var $aBreadcrumbs = array( array('action' => 'administration', 'name' => 'Administration'), ); - + function AdminSplashDispatcher() { - parent::KTAdminDispatcher(); - } + parent::KTAdminDispatcher(); + } - function do_main() { - // are we categorised, or not? - $oRegistry =& KTAdminNavigationRegistry::getSingleton(); - $categories = $oRegistry->getCategories(); - - $this->oPage->title = "DMS Administration: "; + function do_main() { + if ($this->category !== '') { + return $this->do_viewCategory(); + }; + + + // are we categorised, or not? + $oRegistry =& KTAdminNavigationRegistry::getSingleton(); + $categories = $oRegistry->getCategories(); + + // we need to investigate sub_url solutions. + + $this->oPage->title = "DMS Administration: "; $oTemplating = new KTTemplating; - $oTemplate = $oTemplating->loadTemplate("kt3/admin_categories"); - $aTemplateData = array( + $oTemplate = $oTemplating->loadTemplate("kt3/admin_categories"); + $aTemplateData = array( "context" => $this, - "categories" => $categories, - ); - return $oTemplate->render($aTemplateData); - } + "categories" => $categories, + "baseurl" => KTUtil::getRequestScriptName($_SERVER), + ); + return $oTemplate->render($aTemplateData); + } function do_viewCategory() { - // are we categorised, or not? - - $category = KTUtil::arrayGet($_REQUEST, "fCategory"); - - $oRegistry =& KTAdminNavigationRegistry::getSingleton(); - $aCategory = $oRegistry->getCategory($category); - - $aItems = $oRegistry->getItemsForCategory($category); - $this->aBreadcrumbs[] = array("name" => $aCategory["title"]); + // are we categorised, or not? + + $category = KTUtil::arrayGet($_REQUEST, "fCategory", $this->category); + + $oRegistry =& KTAdminNavigationRegistry::getSingleton(); + $aCategory = $oRegistry->getCategory($category); + + $aItems = $oRegistry->getItemsForCategory($category); + $this->aBreadcrumbs[] = array("name" => $aCategory["title"]); - - $this->oPage->title = "DMS Administration: " . $aCategory["title"]; + + $this->oPage->title = "DMS Administration: " . $aCategory["title"]; $oTemplating = new KTTemplating; - $oTemplate = $oTemplating->loadTemplate("kt3/admin_items"); - $aTemplateData = array( + $oTemplate = $oTemplating->loadTemplate("kt3/admin_items"); + $aTemplateData = array( "context" => $this, - "category" => $aCategory, - "items" => $aItems, - ); - return $oTemplate->render($aTemplateData); - } + "category" => $aCategory, + "items" => $aItems, + "baseurl" => KTUtil::getRequestScriptName($_SERVER), + ); + return $oTemplate->render($aTemplateData); + } } $sub_url = KTUtil::arrayGet($_SERVER, 'PATH_INFO'); @@ -69,10 +78,18 @@ if (empty($sub_url)) { $oRegistry =& KTAdminNavigationRegistry::getSingleton(); if ($oRegistry->isRegistered($sub_url)) { $oDispatcher = $oRegistry->getDispatcher($sub_url); - } else { - // FIXME (minor) redirect to no-suburl? - $oDispatcher = new AdminSplashDispatcher(); - } + + $aParts = explode('/',$sub_url); + + $oRegistry =& KTAdminNavigationRegistry::getSingleton(); + $aCategory = $oRegistry->getCategory($aParts[0]); + + $oDispatcher->aBreadcrumbs[] = array("name" => $aCategory['title'], "url" => KTUtil::getRequestScriptName($_SERVER) . '/' . $aParts[0]); + } else { + // FIXME (minor) redirect to no-suburl? + $oDispatcher = new AdminSplashDispatcher(); + $oDispatcher->category = $sub_url; + } } $oDispatcher->dispatch(); // we _may_ be redirected at this point (see KTAdminNavigation) diff --git a/presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/documentCheckout.php b/presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/documentCheckout.php new file mode 100644 index 0000000..155bf8f --- /dev/null +++ b/presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/documentCheckout.php @@ -0,0 +1,133 @@ +, Jam Warehouse (Pty) Ltd, South Africa + * @package documentmanagement + */ + +/* boilerplate */ + + +require_once(KT_LIB_DIR . '/dispatcher.inc.php'); +require_once(KT_LIB_DIR . '/templating/kt3template.inc.php'); + + +class KTCheckoutAdminDispatcher extends KTAdminDispatcher { + + // Breadcrumbs base - added to in methods + var $aBreadcrumbs = array( + array('action' => 'administration', 'name' => 'Administration'), + ); + + function check() { + return true; + } + + function do_main() { + $this->aBreadcrumbs[] = array('name' => 'Document Checkout'); + $this->oPage->setBreadcrumbDetails("list checked out documents"); + + $aDocuments = Document::getList("is_checked_out = 1"); + + $oTemplating =& KTTemplating::getSingleton(); + $oTemplate = $oTemplating->loadTemplate('ktcore/document/admin/checkoutlisting'); + $oTemplate->setData(array( + "context" => $this, + "documents" => $aDocuments, + )); + return $oTemplate; + } + + + function do_confirm() { + $this->aBreadcrumbs[] = array('name' => 'Document Checkout'); + $this->oPage->setBreadcrumbDetails("confirm forced check-in"); + + $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); + if (empty($document_id)) { + return $this->errorRedirectToMain('You must select a document to check in first.'); + } + + $oDocument = Document::get($document_id); + if (PEAR::isError($oDocument)) { + return $this->errorRedirectToMain('The document you specified appears to be invalid.'); + } + + $oUser = User::get($oDocument->getCheckedOutUserID()); + // unusually, we could well have an error here: the user may have checked out and then + // been deleted. + if (PEAR::isError($oUser) || ($oUser === false)) { + $oUser = null; + } + + $oTemplating =& KTTemplating::getSingleton(); + $oTemplate = $oTemplating->loadTemplate('ktcore/document/admin/force_checkin_confirm'); + $oTemplate->setData(array( + "context" => $this, + "document" => $oDocument, + "checkout_user" => $oUser, + )); + return $oTemplate; + + } + + function do_checkin() { + global $default; + + $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); + if (empty($document_id)) { + return $this->errorRedirectToMain('You must select a document to check in first.'); + } + + $oDocument = Document::get($document_id); + if (PEAR::isError($oDocument)) { + return $this->errorRedirectToMain('The document you specified appears to be invalid.'); + } + + $this->startTransaction(); + // actually do the checkin. + $oDocument->setIsCheckedOut(0); + $oDocument->setCheckedOutUserID(-1); + if (!$oDocument->update()) { + $this->rollbackTransaction(); + return $this->errorRedirectToMain('Failed to force the document\'s checkin.'); + } + + // checkout cancelled transaction + $oDocumentTransaction = & new DocumentTransaction($oDocument->getID(), "Document checked out cancelled", FORCE_CHECKIN); + if ($oDocumentTransaction->create()) { + $default->log->debug("editDocCheckoutBL.php created forced checkin document transaction for document ID=" . $oDocument->getID()); + } else { + $default->log->error("editDocCheckoutBL.php couldn't create create document transaction for document ID=" . $oDocument->getID()); + } + $this->commitTransaction(); // FIXME do we want to do this if we can't created the document-transaction? + return $this->successRedirectToMain('Successfully forced "'. $oDocument->getName() .'" to be checked in.'); + } + + +} + +// use the new admin framework. +//$d = new KTCheckoutAdminDispatcher(); +//$d->dispatch(); + +?> \ No newline at end of file diff --git a/presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/editDocCheckoutBL.php b/presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/editDocCheckoutBL.php deleted file mode 100644 index 982c882..0000000 --- a/presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/editDocCheckoutBL.php +++ /dev/null @@ -1,78 +0,0 @@ -fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternEditableListFromQuery.inc"); - require_once("editDocCheckoutUI.inc"); - require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); - require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentTransaction.inc"); - require_once("$default->fileSystemRoot/lib/security/Permission.inc"); - require_once("$default->fileSystemRoot/lib/links/Link.inc"); - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); - require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); - require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); - require_once("$default->fileSystemRoot/presentation/Html.inc"); - - global $default; - $oPatternCustom = & new PatternCustom(); - - if (isset($fDocumentID)) { - if (isset($fUpdate)) { - $oDocument = Document::get($fDocumentID); - $oDocument->setIsCheckedOut(0); - $oDocument->setCheckedOutUserID(-1); - if ($oDocument->update()) { - // checkout cancelled transaction - $oDocumentTransaction = & new DocumentTransaction($oDocument->getID(), "Document checked out cancelled", FORCE_CHECKIN); - if ($oDocumentTransaction->create()) { - $default->log->debug("editDocCheckoutBL.php created forced checkin document transaction for document ID=" . $oDocument->getID()); - } else { - $default->log->error("editDocCheckoutBL.php couldn't create create document transaction for document ID=" . $oDocument->getID()); - } - $oPatternCustom->setHtml(getEditCheckoutSuccessPage()); - } else { - $oPatternCustom->setHtml(getErrorPage(_("Error while trying to update the document checkout."))); - } - } else { - $oPatternCustom->addHtml(getEditCheckoutPage($fDocumentID)); - $main->setFormAction($_SERVER["PHP_SELF"]); - } - } else { - // no document selected - $oPatternCustom->setHtml(getErrorPage(_("No document selected to check back in"))); - } - //render the page - $main->setCentralPayload($oPatternCustom); - $main->setHasRequiredFields(true); - $main->render(); -} -?> diff --git a/presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/editDocCheckoutUI.inc b/presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/editDocCheckoutUI.inc deleted file mode 100644 index b093b89..0000000 --- a/presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/editDocCheckoutUI.inc +++ /dev/null @@ -1,71 +0,0 @@ -getCheckedOutUserID()); - $sToRender .= renderHeading(_("Edit Document Checkout")); - $sToRender .= "\n"; - $sToRender .= ""; - $sToRender .= ""; - $sToRender .= ""; - $sToRender .= "\n"; - $sToRender .= "\n"; - $sToRender .= "\n"; - $sToRender .= "\n"; - $sToRender .= "\n"; - $sToRender .= "
" . _("Are you sure you want to Check In the document:") . "
" . _("Path") . "" . $oDocument->getDisplayPath() . "
" . _("Checked Out By") . "" . ($oUser ? $oUser->getName() : _("Unknown")) . "
\n"; - $sToRender .= getUpdateButton(); - $sToRender .= getCancelButton(); - $sToRender .= "
\n"; - return $sToRender; -} - -// gets the updatebutton when a unit is selected -function getUpdateButton() { - global $default; - return "\n"; -} - -// gets the cancel button when a unit is selected -function getCancelButton() { - global $default; - return "rootUrl/control.php?action=listDocs\">\n"; -} - -?> diff --git a/presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/listDocumentsBL.php b/presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/listDocumentsBL.php deleted file mode 100644 index 2b832cd..0000000 --- a/presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/listDocumentsBL.php +++ /dev/null @@ -1,60 +0,0 @@ -fileSystemRoot/lib/documentmanagement/Document.inc"); -require_once("$default->fileSystemRoot/lib/users/User.inc"); -require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); -require_once("$default->fileSystemRoot/lib/visualpatterns/PatternTableSqlQuery.inc"); -require_once("$default->fileSystemRoot/presentation/Html.inc"); - -if (checkSession()) { - - $oPatternCustom = & new PatternCustom(); - $aDocuments = Document::getList("is_checked_out = 1");/*ok*/ - $sToRender .= renderHeading(_("Document Checkout Management")); - $sToRender .= ""; - if (count($aDocuments) > 0) { - for ($i=0; $i"; - $sToRender .= ""); - } - } - } else { - $sToRender .= ""; - } - $sToRender .= "
" . $aDocuments[$i]->getDisplayPath() . "" . generateControllerLink("editDocCheckout", "fDocumentID=" . $aDocuments[$i]->getID(), _("Check In") . "
" . _("There are no checked out documents") . "
"; - - $oPatternCustom->setHtml($sToRender); - - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); - $main->setCentralPayload($oPatternCustom); - $main->setFormAction($_SERVER['PHP_SELF']); - $main->render(); -} -?> diff --git a/presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/documentFields.php b/presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/documentFields.php index 9137a7c..c6372a7 100644 --- a/presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/documentFields.php +++ b/presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/documentFields.php @@ -1,24 +1,29 @@ 'administration', 'name' => 'Administration'), - array('action' => 'docfield', 'name' => 'Document Field Management'), ); // {{{ do_main function do_main () { + $this->aBreadcrumbs[] = array('action' => 'docfield', 'name' => 'Document Field Management'); + $this->oPage->setBreadcrumbDetails("view fieldsets"); + $oTemplating =& KTTemplating::getSingleton(); $oTemplate =& $oTemplating->loadTemplate('ktcore/metadata/listFieldsets'); $oTemplate->setData(array( @@ -487,7 +492,8 @@ class KTDocumentFieldDispatcher extends KTStandardDispatcher { // }}} } -$d =& new KTDocumentFieldDispatcher; -$d->dispatch(); +// use the admin dispatch mechanisms. +//$d =& new KTDocumentFieldDispatcher; +//$d->dispatch(); ?> diff --git a/resources/css/kt-framing.css b/resources/css/kt-framing.css index 602df11..74ae1b7 100644 --- a/resources/css/kt-framing.css +++ b/resources/css/kt-framing.css @@ -536,14 +536,34 @@ a.main_nav_item { color: #db9d09; } +/* block level. */ .ktError { - padding: 0.5em 1em; + padding: 0 1em; border: 1px solid #ffc21e; margin: 0.5em 0; background: #ffdd80; } +.ktError p { + padding-left: 25px; + background: transparent url(/thirdparty/icon-theme/16x16/status/dialog-warning.png) center left no-repeat; +} + +/* block level. */ +.ktInfo +{ + padding: 0 1em; + border: 1px solid #ffc21e; + margin: 0.5em 0; + background: #ffdd80; +} + +.ktInfo p { + padding-left: 25px; + background: transparent url(/thirdparty/icon-theme/16x16/status/dialog-information.png) center left no-repeat; +} + /** portlet stuff. */ #portlet-search-text { @@ -557,4 +577,46 @@ a.main_nav_item { .searchbutton { border: 1px solid black; margin: 0.5em; -} \ No newline at end of file +} + + +/* ========== kt actions + +These are used to mark up various different "actions" (e.g. cut, copy, delete). +Use them as follows: + +Delete + +The text will be hidden for screen view. The generic fahrner-ish approach comes from Plone + + */ + + +.ktAction { + display: block; + text-decoration: none; + overflow: hidden; + border: 0 !important; + margin: 0; + padding: 0; + padding-top: 16px; + height: 0px !important; + height /**/: 16px; + width: 16px; + cursor: pointer; +} + +/* FIXME when available icon-naming-conformant sets have better coverage, make these more accurate. */ +.ktAction.ktDelete { background: transparent url(/thirdparty/icon-theme/16x16/mimetypes/x-directory-trash.png) top left no-repeat; } + +/* =========== standard listings. */ + +.listing td { + padding: 0.5em; +} + +.listing thead th { + border-bottom: 1px solid #888; + text-align: left; +} + diff --git a/templates/kt3/admin_items.smarty b/templates/kt3/admin_items.smarty index 540ae11..68e3d23 100644 --- a/templates/kt3/admin_items.smarty +++ b/templates/kt3/admin_items.smarty @@ -5,7 +5,7 @@ {else}
{foreach item=aItem from=$items} -
{$aItem.title}
+
{$aItem.title}
{$aItem.description}
{/foreach}
diff --git a/templates/kt3/standard_page.smarty b/templates/kt3/standard_page.smarty index e7d0c44..dfc690c 100644 --- a/templates/kt3/standard_page.smarty +++ b/templates/kt3/standard_page.smarty @@ -103,11 +103,21 @@

{$page->componentLabel}

- +{if (!empty($page->errStack))} +
{foreach item=sError from=$page->errStack} -
{$sError}
+

{$sError}

{/foreach} +
+{/if} +{if (!empty($page->errStack))} +
+ {foreach item=sInfo from=$page->infoStack} +

{$sInfo}

+ {/foreach} +
+{/if} {$page->contents} diff --git a/templates/ktcore/document/admin/checkoutlisting.smarty b/templates/ktcore/document/admin/checkoutlisting.smarty new file mode 100644 index 0000000..e9b8207 --- /dev/null +++ b/templates/ktcore/document/admin/checkoutlisting.smarty @@ -0,0 +1,32 @@ +

Checked Out Documents

+

If a checked-out document has been lost, or the user +who checked a document out has not checked it back in, it may be necessary +to override the "checked-out" status of a document. Use the force checkin +action in the listing below to override the checked-out status.

+ +{if (count($documents) !== 0)} + + + + + + + + + + + {foreach item=oDocument from=$documents} + + + + + + {/foreach} + + +
DocumentLocation 
{$oDocument->getName()}{$oDocument->getDisplayPath()}force checkin
+{else} +
+

No documents are currently checked out.

+
+{/if} diff --git a/templates/ktcore/document/admin/force_checkin_confirm.smarty b/templates/ktcore/document/admin/force_checkin_confirm.smarty new file mode 100644 index 0000000..cbee5dc --- /dev/null +++ b/templates/ktcore/document/admin/force_checkin_confirm.smarty @@ -0,0 +1,35 @@ +

Confirm Forced Check-in

+

Please confirm that this is the document that you wish to checkin.

+ +
+

Document Details

+ +
+ +
+ + +
+ + +

Cancel

+
+
\ No newline at end of file diff --git a/templates/ktcore/fields/list.smarty b/templates/ktcore/fields/list.smarty index 247cbd1..4b94994 100644 --- a/templates/ktcore/fields/list.smarty +++ b/templates/ktcore/fields/list.smarty @@ -6,7 +6,7 @@ - + @@ -14,8 +14,13 @@ {foreach from=$fieldsets item=oFieldset} +
NameName Generic Fields
+ Delete + - { $oFieldset->getName() } + + + { $oFieldset->getName() } diff --git a/templates/ktcore/metadata/listFieldsets.smarty b/templates/ktcore/metadata/listFieldsets.smarty index 216a516..653650c 100644 --- a/templates/ktcore/metadata/listFieldsets.smarty +++ b/templates/ktcore/metadata/listFieldsets.smarty @@ -3,10 +3,10 @@ { if $fieldsets}

Existing document fieldsets

- +
- + @@ -14,9 +14,10 @@ {foreach from=$fieldsets item=oFieldset} + -- libgit2 0.21.4
NameName Generic Fields
+ Delete + - { $oFieldset->getName() }