diff --git a/browse.php b/browse.php index 202661e..dd6439c 100755 --- a/browse.php +++ b/browse.php @@ -103,6 +103,10 @@ class BrowseDispatcher extends KTStandardDispatcher { // here we need the folder object to do the breadcrumbs. $oFolder =& Folder::get($folder_id); + + $this->oPage->setTitle(_('Browse')); + $this->oPage->setSecondaryTitle($oFolder->getName()); + $this->oFolder =& $oFolder; if (PEAR::isError($oFolder)) { $this->oPage->addError(_("invalid folder")); @@ -166,6 +170,7 @@ class BrowseDispatcher extends KTStandardDispatcher { $collection->addColumn(new SelectionColumn("Browse Selection","selection")); $collection->addColumn(new TitleColumn("Test 1 (title)","title")); + $collection->addColumn(new DownloadColumn('','download')); $collection->addColumn(new DateColumn(_("Created"),"created", "getCreatedDateTime")); $collection->addColumn(new DateColumn(_("Last Modified"),"modified", "getLastModifiedDate")); $collection->addColumn(new UserColumn(_('Creator'),'creator_id','getCreatorID')); diff --git a/edit.php b/edit.php index bf42bdd..e875c37 100644 --- a/edit.php +++ b/edit.php @@ -62,6 +62,11 @@ class KTEditDocumentDispatcher extends KTStandardDispatcher { ); $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($this->oDocument, $aOptions)); + + if (!is_null($this->oDocument)) { + $this->oPage->setSecondaryTitle($this->oDocument->getName()); + } + } function errorPage($errorMessage) { @@ -81,7 +86,7 @@ class KTEditDocumentDispatcher extends KTStandardDispatcher { } $this->oDocument = $oDocument; - + $this->addPortlets("Edit"); $this->addBreadcrumbs(); $this->oPage->setBreadcrumbDetails(_('Change Document Type')); diff --git a/lib/actions/documentaction.inc.php b/lib/actions/documentaction.inc.php index 74da3cf..ab459ae 100644 --- a/lib/actions/documentaction.inc.php +++ b/lib/actions/documentaction.inc.php @@ -135,6 +135,8 @@ class KTDocumentAction extends KTStandardDispatcher { $oPortlet = new KTActionPortlet(_("Document Actions")); $oPortlet->setActions($actions, $this->sName); $this->oPage->addPortlet($oPortlet); + + $this->oPage->setSecondaryTitle($this->oDocument->getName()); return true; } diff --git a/lib/actions/folderaction.inc.php b/lib/actions/folderaction.inc.php index 449ec88..26ac15d 100644 --- a/lib/actions/folderaction.inc.php +++ b/lib/actions/folderaction.inc.php @@ -139,6 +139,8 @@ class KTFolderAction extends KTStandardDispatcher { $portlet->setActions($aActions,null); $this->oPage->addPortlet($portlet); + $this->oPage->setSecondaryTitle($this->oFolder->getName()); + return true; } diff --git a/lib/browse/BrowseColumns.inc.php b/lib/browse/BrowseColumns.inc.php index d481015..bc10956 100644 --- a/lib/browse/BrowseColumns.inc.php +++ b/lib/browse/BrowseColumns.inc.php @@ -129,6 +129,8 @@ class TitleColumn extends BrowseColumn { } } + + class DateColumn extends BrowseColumn { var $field_function; @@ -295,4 +297,29 @@ class WorkflowColumn extends BrowseColumn { } } +class DownloadColumn extends BrowseColumn { + + function renderHeader($sReturnURL) { + $text = $this->label; + + return $text; + } + + + function renderData($aDataRow) { + $localname = $this->name; + + + // only _ever_ show this folder documents. + if ($aDataRow["type"] === "folder") { + return ' '; + } + + // FIXME at some point we may want to hide this if the user doens't have the download action, but its OK for now. + $link = KTUtil::ktLink('action.php','ktcore.actions.document.view', 'fDocumentId=' . $aDataRow['document']->getId()); + $outStr = sprintf('%s', $link, _('Download Document'), _('Download Document')); + return $outStr; + } +} + ?> diff --git a/lib/dispatcher.inc.php b/lib/dispatcher.inc.php index 4e4ffb0..86c8842 100644 --- a/lib/dispatcher.inc.php +++ b/lib/dispatcher.inc.php @@ -141,7 +141,16 @@ class KTStandardDispatcher extends KTDispatcher { } function permissionDenied () { - print "Permission denied"; + global $default; + + $msg = '

' . _('Permission Denied') . '

'; + $msg .= '

' . _('If you feel that this is incorrect, please report both the action and your username to a system administrator.') . '

'; + + $this->oPage->setPageContents($msg); + $this->oPage->setUser($this->oUser); + $this->oPage->hideSection(); + + $this->oPage->render(); exit(0); } diff --git a/lib/templating/kt3template.inc.php b/lib/templating/kt3template.inc.php index ffcc436..a550dfb 100644 --- a/lib/templating/kt3template.inc.php +++ b/lib/templating/kt3template.inc.php @@ -12,6 +12,9 @@ require_once(KT_LIB_DIR . "/templating/templating.inc.php"); class KTPage { + var $hide_section = false; + var $secondary_title = null; + /** resources are "filename"->1 to allow subcomponents to require items. */ var $js_resources = Array(); var $css_resources = Array(); @@ -230,6 +233,9 @@ class KTPage { function setHasRequiredFields($appendix) { $this->addError($this->deprecationWarning . "called setHasRequiredFields (no-act)"); } function setAdditionalJavascript($appendix) { $this->addError($this->deprecationWarning . "called setAdditionalJavascript (no-act)"); } + function hideSection() { $this->hide_section = true; } + function setSecondaryTitle($sSecondary) { $this->secondary_title = $sSecondary; } + /* final render call. */ function render() { diff --git a/lib/widgets/fieldsetDisplay.inc.php b/lib/widgets/fieldsetDisplay.inc.php index 26959c0..d5a66d4 100644 --- a/lib/widgets/fieldsetDisplay.inc.php +++ b/lib/widgets/fieldsetDisplay.inc.php @@ -111,16 +111,19 @@ class KTFieldsetDisplay { function _mimeHelper($iMimeTypeId) { // FIXME lazy cache this. // FIXME extend mime_types to have something useful to say. - $sQuery = 'SELECT mimetypes FROM mime_types WHERE id = ?'; - $res = DBUtil::getOneResultKey(array($sQuery, array($iMimeTypeId)), 'mimetypes'); + $sQuery = 'SELECT * FROM mime_types WHERE id = ?'; + $res = DBUtil::getOneResult(array($sQuery, array($iMimeTypeId))); if (PEAR::isError($res)) { return _('unknown type'); } - if (empty($res)) { - return _('unknown type'); - } - return $res; + + if (!empty($res['friendly_name'])) { + return _($res['friendly_name']); + } else { + return sprintf('%s File', $res['filetypes']); + } + } @@ -217,8 +220,8 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay { $creation_date = $this->_dateHelper($document->getCreatedDateTime()); // last mod - $last_modified_date = $this->_dateHelper($document->getLastModifiedDate()); - $comparison_last_modified_date = $this->_dateHelper($comparison_document->getLastModifiedDate()); + $last_modified_date = $this->_dateHelper($document->getVersionCreated()); + $comparison_last_modified_date = $this->_dateHelper($comparison_document->getVersionCreated()); // document type // FIXME move this to view.php $document_type = $aDocumentData["document_type"]->getName(); @@ -226,10 +229,12 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay { $modified_user =& User::get($document->getModifiedUserId()); if (PEAR::isError($modified_user)) { - $modified_user = "" . _("Unable to find the document's creator") . ""; + $modified_user = "" . _("Unable to find the document's modifier") . ""; } else { $modified_user = $modified_user->getName(); } + + $comparison_modified_user =& User::get($comparison_document->getModifiedUserId()); if (PEAR::isError($comparison_modified_user)) { @@ -260,8 +265,8 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay { "last_modified_by" => $modified_user, "last_modified_date" => $last_modified_date, - "comparison_last_modified_by" => "fixme extract the last participant", - "comparison_last_modified_date" => $last_modified_date, + "comparison_last_modified_by" => $comparison_modified_user, + "comparison_last_modified_date" => $comparison_last_modified_date, "document_type" => $document_type, "comparison_document_type" => $comparison_document_type, diff --git a/presentation/lookAndFeel/knowledgeTree/noAccess.php b/presentation/lookAndFeel/knowledgeTree/noAccess.php index 4948f20..38f2e0b 100644 --- a/presentation/lookAndFeel/knowledgeTree/noAccess.php +++ b/presentation/lookAndFeel/knowledgeTree/noAccess.php @@ -25,7 +25,13 @@ */ require_once("../../../config/dmsDefaults.php"); -echo "
" . _("You do not have permission to access this page.") . "
"; -echo "" . _("Back") . " OR " . generateControllerLink("logout", "", _("logout")); -echo "
"; +require_once(KT_LIB_DIR . "/dispatcher.inc.php"); + +class BlockDispatcher extends KTStandardDispatcher { + function check() { return false; } +} + +$oD =& new BlockDispatcher(); +$oD->dispatch(); + ?> diff --git a/resources/css/kt-framing.css b/resources/css/kt-framing.css index d95dd87..3ce2e06 100644 --- a/resources/css/kt-framing.css +++ b/resources/css/kt-framing.css @@ -480,6 +480,10 @@ a.main_nav_item { display: block; border-width: 1px; } +.metadata.versioned dd .current.different { + padding-left: 25px; + background: transparent url(../../thirdparty/icon-theme/16x16/status/dialog-information.png) center left no-repeat; +} .document_details .document_history thead th { text-align: left; @@ -633,7 +637,6 @@ a.main_nav_item { margin: 0.5em; } - /* ========== kt actions These are used to mark up various different "actions" (e.g. cut, copy, delete). @@ -691,6 +694,7 @@ The text will be hidden for screen view. The generic fahrner-ish approach comes .ktActionLink.ktAddUser, .ktAction.ktAddUser { background: transparent url(../../thirdparty/icon-theme/16x16/actions/contact-new.png) top left no-repeat; } .ktActionLink.ktAddGroup, .ktAction.ktAddGroup { background: transparent url(../../thirdparty/icon-theme/16x16/actions/group-new.png) top left no-repeat; } .ktActionLink.ktAdd, .ktAction.ktAdd { background: transparent url(../../thirdparty/icon-theme/16x16/actions/add.png) top left no-repeat; } +.ktActionLink.ktDownload, .ktAction.ktDownload { background: transparent url(../../resources/graphics/download.png) top left no-repeat; } /* =========== standard listings. */ diff --git a/templates/kt3/fieldsets/generic_versioned.smarty b/templates/kt3/fieldsets/generic_versioned.smarty index 7c8e9b3..52628fb 100644 --- a/templates/kt3/fieldsets/generic_versioned.smarty +++ b/templates/kt3/fieldsets/generic_versioned.smarty @@ -7,14 +7,18 @@
{i18n}Document Filename{/i18n}
-
{$filename} ({$context->_sizeHelper($document->getSize())})
- + {capture assign="oldval"}{$comparison_filename} ({$context->_sizeHelper($comparison_document->getSize())}){/capture} + {capture assign="newval"}{$filename} ({$context->_sizeHelper($document->getSize())}){/capture} +
{$newval}
+
{i18n}File is a{/i18n}
-
{$context->_mimeHelper($document->getMimeTypeID())}
- + {capture assign="oldval"}{$context->_mimeHelper($comparison_document->getMimeTypeID())}{/capture} + {capture assign="newval"}{$context->_mimeHelper($document->getMimeTypeID())}{/capture} +
{$newval}
+
{i18n}Created by{/i18n}
@@ -24,33 +28,35 @@
{i18n}Last update by{/i18n}
-
{$last_modified_by} ({$last_modified_date})
- + {capture assign="oldval"}{$comparison_last_modified_by} ({$comparison_last_modified_date}){/capture} + {capture assign="newval"}{$last_modified_by} ({$last_modified_date}){/capture} +
{$newval}
+
{i18n}Document Type{/i18n}
-
{$document_type}
- + {capture assign="oldval"}{$comparison_document_type}{/capture} + {capture assign="newval"}{$document_type}{/capture} +
{$newval}
+
{i18n}Workflow status{/i18n}
-
-{if $workflow_state} -{$workflow_state->getName()} + {capture assign="oldval"}{if $comparison_workflow_state} +{$comparison_workflow_state->getName()} {else} {i18n}No workflow{/i18n} -{/if} -
- +{/if}{/capture} +
{$newval}
+
diff --git a/templates/kt3/fieldsets/simple_versioned.smarty b/templates/kt3/fieldsets/simple_versioned.smarty index 5ef9356..58382a1 100644 --- a/templates/kt3/fieldsets/simple_versioned.smarty +++ b/templates/kt3/fieldsets/simple_versioned.smarty @@ -11,7 +11,7 @@
{foreach item=aFieldPair from=$fieldset_values}
{$aFieldPair.field->getName()}
-
+
{if ($aFieldPair.current_value !== null)}{$aFieldPair.current_value} {else}no value in this version{/if}
+{if (!$page->hide_section)} - +{/if}
@@ -128,11 +129,11 @@
- +{if (!$page->hide_section)}

{$page->componentLabel} {if ($page->getHelpURL() != null)} Help {/if}

- +{/if} {if (!empty($page->errStack))}
diff --git a/templates/ktcore/action/addFolder.smarty b/templates/ktcore/action/addFolder.smarty index e9fdb7d..b68ea85 100644 --- a/templates/ktcore/action/addFolder.smarty +++ b/templates/ktcore/action/addFolder.smarty @@ -1,3 +1,5 @@ +

{i18n}Add a folder{/i18n}

+

{i18n}Folders are one way of organising documents in the document management system. Folders provide meaning in the traditional file storage way - through a file path.{/i18n}

diff --git a/view.php b/view.php index 4c30902..7b327e5 100755 --- a/view.php +++ b/view.php @@ -71,6 +71,8 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { return $this->do_error(); } + $this->oPage->setSecondaryTitle($oDocument->getName()); + $aOptions = array( "documentaction" => "viewDocument", "folderaction" => "browse", @@ -167,6 +169,9 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { // fixme check perms $this->oDocument =& $oDocument; + + $this->oPage->setSecondaryTitle($oDocument->getName()); + $aOptions = array("final" => false); $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument, $aOptions)); $this->oPage->setBreadcrumbDetails(_("history")); @@ -191,7 +196,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { // render pass. - $this->oPage->title = _("Document History") . " : " . $oDocument->getName(); + $this->oPage->title = _("Document History"); $oTemplating = new KTTemplating; $oTemplate = $oTemplating->loadTemplate("kt3/view_document_history"); $aTemplateData = array( @@ -221,7 +226,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { return $this->do_error(); } // fixme check perms - + $this->oPage->setSecondaryTitle($oDocument->getName()); $this->oDocument =& $oDocument; $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument)); $this->oPage->setBreadcrumbDetails(_("history")); @@ -234,7 +239,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { } // render pass. - $this->oPage->title = _("Document History") . " : " . $oDocument->getName(); + $this->oPage->title = _("Document History"); $oTemplating = new KTTemplating; $oTemplate = $oTemplating->loadTemplate("kt3/document/metadata_history"); @@ -281,6 +286,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { return $this->do_error(); } $this->oDocument =& $oDocument; + $this->oPage->setSecondaryTitle($oDocument->getName()); $aOptions = array("final" => false); $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument, $aOptions)); $this->oPage->setBreadcrumbDetails(_("compare versions")); @@ -414,6 +420,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { return $this->do_error(); } $this->oDocument =& $oDocument; + $this->oPage->setSecondaryTitle($oDocument->getName()); $aOptions = array("final" => false); $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument, $aOptions)); $this->oPage->setBreadcrumbDetails(_("Select Document Version to compare against"));