diff --git a/browse.php b/browse.php
index 6472642..4d7904b 100755
--- a/browse.php
+++ b/browse.php
@@ -137,6 +137,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
$collection->addColumn(new DateColumn(_("Created"),"created", "getCreatedDateTime"));
$collection->addColumn(new DateColumn(_("Last Modified"),"modified", "getLastModifiedDate"));
$collection->addColumn(new UserColumn(_('Creator'),'creator_id','getCreatorID'));
+ $collection->addColumn(new WorkflowColumn(_('Workflow State'),'workflow_state'));
// setup the folderside add actions
diff --git a/lib/actions/folderaction.inc.php b/lib/actions/folderaction.inc.php
index f4b3f65..310dda5 100644
--- a/lib/actions/folderaction.inc.php
+++ b/lib/actions/folderaction.inc.php
@@ -11,6 +11,8 @@ class KTFolderAction extends KTStandardDispatcher {
var $_sShowPermission;
var $_sDisablePermission;
+
+ var $_adminAlwaysAvailable = false;
var $_bDisabled;
var $_sDisabledText = null;
@@ -44,7 +46,7 @@ class KTFolderAction extends KTStandardDispatcher {
if (PEAR::isError($oPermission)) {
return true;
}
- return KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPermission, $this->oFolder);
+ return (KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPermission, $this->oFolder) || (($this->_adminAlwaysAvailable) && (Permission::userIsSystemAdministrator($this->oUser->getId()))));
}
function _disable() {
@@ -115,7 +117,7 @@ class KTFolderAction extends KTStandardDispatcher {
if (!is_null($this->_sShowPermission)) {
$oPermission =& KTPermission::getByName($this->_sShowPermission);
if (!PEAR::isError($oPermission)) {
- $res = KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPermission, $this->oFolder);
+ $res = (KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPermission, $this->oFolder) || (($this->_adminAlwaysAvailable) && (Permission::userIsSystemAdministrator($this->oUser->getId()))));
if (!$res) {
return false;
}
diff --git a/lib/browse/BrowseColumns.inc.php b/lib/browse/BrowseColumns.inc.php
index 30f8b3b..8fb5574 100644
--- a/lib/browse/BrowseColumns.inc.php
+++ b/lib/browse/BrowseColumns.inc.php
@@ -14,6 +14,10 @@
require_once(KT_LIB_DIR . "/database/dbutil.inc");
require_once(KT_LIB_DIR . '/users/User.inc');
+
+require_once(KT_LIB_DIR . '/workflow/workflowutil.inc.php');
+
+
class BrowseColumn {
var $label = null;
var $sort_on = false;
@@ -252,4 +256,35 @@ class SelectionColumn extends BrowseColumn {
}
}
+
+class WorkflowColumn extends BrowseColumn {
+
+ function renderHeader($sReturnURL) {
+ $text = $this->label;
+ $href = $sReturnURL . "&sort_on=" . $this->name . "&sort_order=";
+ $href .= $this->sort_direction == "asc" ? "desc" : "asc" ;
+
+ return ''.$text.'';
+ }
+
+ // use inline, since its just too heavy to even _think_ about using smarty.
+ function renderData($aDataRow) {
+ $localname = $this->name;
+
+
+ // only _ever_ show this folder documents.
+ if ($aDataRow["type"] === "folder") {
+ return ' ';
+ }
+
+ $oWorkflow = KTWorkflowUtil::getWorkflowForDocument($aDataRow['document']);
+ $oState = KTWorkflowUtil::getWorkflowStateForDocument($aDataRow['document']);
+ if (($oState == null) || ($oWorkflow == null)) {
+ return '—';
+ } else {
+ return $oState->getName() . ' (' . $oWorkflow->getName() . ')';
+ }
+ }
+}
+
?>
diff --git a/lib/validation/dispatchervalidation.inc.php b/lib/validation/dispatchervalidation.inc.php
index 7f169f0..94c4338 100644
--- a/lib/validation/dispatchervalidation.inc.php
+++ b/lib/validation/dispatchervalidation.inc.php
@@ -311,8 +311,9 @@ class KTDispatcherValidation {
$aNewOptions = $aOptions;
$aNewOptions['message'] = KTUtil::arrayGet($aOptions, 'message', _("No name was given for the $sHumanEntityTypeName"));
+ // FIXME BD: don't you mean $sName = $this->validateString ...
$this->validateString($sName, $aNewOptions);
- $this->validateDuplicateName($sEntityTypeName, $sHumanEntityTypeName, $sName, $aOptions);
+ return $this->validateDuplicateName($sEntityTypeName, $sHumanEntityTypeName, $sName, $aOptions);
}
diff --git a/lib/widgets/fieldsetDisplay.inc.php b/lib/widgets/fieldsetDisplay.inc.php
index 7f56432..a4639e7 100644
--- a/lib/widgets/fieldsetDisplay.inc.php
+++ b/lib/widgets/fieldsetDisplay.inc.php
@@ -275,7 +275,7 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay {
function renderEdit($document_data) {
global $main; // FIXME remove direct access to $main
$oField = new KTBaseWidget("Document Title",
- _("The document title is used as the main name of a document through the KnowledgeTree."),
+ _("The document title is used as the main name of a document throughout KnowledgeTree™."),
"generic_title", $document_data["document"]->getName(), $main, true, null, array());
$aFields = array($oField); // its the only one editable from the basic set (currently).
@@ -285,7 +285,7 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay {
"context" => $this,
"fields" => $aFields,
"title" => "Generic Document Information",
- "description" => _("The information in this section is stored by the KnowledgeTree™ for every document."),
+ "description" => _("The information in this section is stored by KnowledgeTree™ for every document."),
);
return $oTemplate->render($aTemplateData);
}
diff --git a/plugins/ktcore/KTFolderActions.php b/plugins/ktcore/KTFolderActions.php
index a79291f..603c527 100644
--- a/plugins/ktcore/KTFolderActions.php
+++ b/plugins/ktcore/KTFolderActions.php
@@ -58,6 +58,7 @@ class KTFolderPermissionsAction extends KTFolderAction {
var $sName = 'ktcore.actions.folder.permissions';
var $_sShowPermission = "ktcore.permissions.write";
+ var $_adminAlwaysAvailable = true;
var $bAutomaticTransaction = true;
function do_main() {
diff --git a/plugins/ktcore/admin/documentFields.php b/plugins/ktcore/admin/documentFields.php
index c6820db..b1f5ebc 100755
--- a/plugins/ktcore/admin/documentFields.php
+++ b/plugins/ktcore/admin/documentFields.php
@@ -155,6 +155,10 @@ class KTDocumentFieldDispatcher extends KTStandardDispatcher {
// {{{ do_newfield
function do_newfield() {
+ $aErrorOptions = array(
+ 'redirect_to' => array('edit','fFieldsetId=' . $_REQUEST['fFieldsetId']),
+ );
+
$is_lookup = false;
$is_tree = false;
if ($_REQUEST['type'] === "lookup") {
@@ -164,11 +168,18 @@ class KTDocumentFieldDispatcher extends KTStandardDispatcher {
$is_lookup = true;
$is_tree = true;
}
+
+ $sName = $this->oValidator->validateEntityName("DocumentField", "field", KTUtil::arrayGet($_REQUEST, 'name'), $aErrorOptions);
+
+ $sDescription = $this->oValidator->validateString(KTUtil::arrayGet($_REQUEST, 'description'),
+ KTUtil::meldOptions($aErrorOptions, array('message' => "You must provide a description")));
+
+
$oFieldset = KTFieldset::get($_REQUEST['fFieldsetId']);
$oField =& DocumentField::createFromArray(array(
'name' => $_REQUEST['name'],
'datatype' => 'STRING',
- 'description' => $_REQUEST['description'],
+ 'description' => $sDescription,
'haslookup' => $is_lookup,
'haslookuptree' => $is_tree,
'parentfieldset' => $oFieldset->getId(),
diff --git a/plugins/ktcore/admin/userManagement.php b/plugins/ktcore/admin/userManagement.php
index b8b2238..4b62e34 100755
--- a/plugins/ktcore/admin/userManagement.php
+++ b/plugins/ktcore/admin/userManagement.php
@@ -63,7 +63,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
$add_fields = array();
- $add_fields[] = new KTStringWidget(_('Username'),_('The username the user will enter to gain access to the KnowledgeTree. e.g. jsmith'), 'username', null, $this->oPage, true, null, null, $aOptions);
+ $add_fields[] = new KTStringWidget(_('Username'),_('The username the user will enter to gain access to KnowledgeTree. e.g. jsmith'), 'username', null, $this->oPage, true, null, null, $aOptions);
$add_fields[] = new KTStringWidget(_('Name'),_('The full name of the user. This is shown in reports and listings. e.g. John Smith'), 'name', null, $this->oPage, true, null, null, $aOptions);
$add_fields[] = new KTStringWidget(_('Email Address'), _('The email address of the user. Notifications and alerts are mailed to this address if email notifications is set below. e.g. jsmith@acme.com'), 'email_address', null, $this->oPage, false, null, null, $aOptions);
$add_fields[] = new KTCheckboxWidget(_('Email Notifications'), _("If this is specified then the user will have notifications sent to the email address entered above. If it isn't set, then the user will only see notifications on the Dashboard"), 'email_notifications', true, $this->oPage, false, null, null, $aOptions);
@@ -117,7 +117,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
$this->aBreadcrumbs[] = array('name' => $oUser->getName());
$edit_fields = array();
- $edit_fields[] = new KTStringWidget(_('Username'),_('The username the user will enter to gain access to the KnowledgeTree. e.g. jsmith'), 'username', $oUser->getUsername(), $this->oPage, true);
+ $edit_fields[] = new KTStringWidget(_('Username'),_('The username the user will enter to gain access to KnowledgeTree. e.g. jsmith'), 'username', $oUser->getUsername(), $this->oPage, true);
$edit_fields[] = new KTStringWidget(_('Name'), _('The full name of the user. This is shown in reports and listings. e.g. John Smith'), 'name', $oUser->getName(), $this->oPage, true);
$edit_fields[] = new KTStringWidget(_('Email Address'),_('The email address of the user. Notifications and alerts are mailed to this address if email notifications is set below. e.g. jsmith@acme.com'), 'email_address', $oUser->getEmail(), $this->oPage, false);
$edit_fields[] = new KTCheckboxWidget(_('Email Notifications'), _('If this is specified then the user will have notifications sent to the email address entered above. If it is not set, then the user will only see notifications on the Dashboard'), 'email_notifications', $oUser->getEmailNotification(), $this->oPage, false);
diff --git a/plugins/ktcore/folder/addDocument.php b/plugins/ktcore/folder/addDocument.php
index e1319bf..a3a4a11 100644
--- a/plugins/ktcore/folder/addDocument.php
+++ b/plugins/ktcore/folder/addDocument.php
@@ -41,7 +41,7 @@ class KTFolderAddDocumentAction extends KTFolderAction {
$oTemplate =& $this->oValidator->validateTemplate('ktcore/document/add');
$add_fields = array();
$add_fields[] = new KTFileUploadWidget(_('File'), _('The contents of the document to be added to the document management system.'), 'file', "", $this->oPage, true);
- $add_fields[] = new KTStringWidget(_('Title'), _('The document title is used as the main name of a document through the KnowledgeTree.'), 'title', "", $this->oPage, true);
+ $add_fields[] = new KTStringWidget(_('Title'), _('The document title is used as the main name of a document throughout KnowledgeTree.'), 'title', "", $this->oPage, true);
$aVocab = array();
diff --git a/plugins/ktstandard/ldap/ldapauthenticationprovider.inc.php b/plugins/ktstandard/ldap/ldapauthenticationprovider.inc.php
index 5474541..3595d07 100644
--- a/plugins/ktstandard/ldap/ldapauthenticationprovider.inc.php
+++ b/plugins/ktstandard/ldap/ldapauthenticationprovider.inc.php
@@ -137,7 +137,7 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider {
$fields = array();
$fields[] = new KTStaticTextWidget(_('LDAP DN'), _('The location of the user within the LDAP directory.'), 'dn', $aResults[$aAttributes[0]], $this->oPage);
- $fields[] = new KTStringWidget(_('Username'), _('The username the user will enter to gain access to the KnowledgeTree. e.g. jsmith'), 'ldap_username', $aResults[$aAttributes[1]], $this->oPage, true);
+ $fields[] = new KTStringWidget(_('Username'), _('The username the user will enter to gain access to KnowledgeTree. e.g. jsmith'), 'ldap_username', $aResults[$aAttributes[1]], $this->oPage, true);
$fields[] = new KTStringWidget(_('Name'), _('The full name of the user. This is shown in reports and listings. e.g. John Smith'), 'name', join(" ", array($aResults[$aAttributes[2]], $aResults[$aAttributes[3]])), $this->oPage, true);
$fields[] = new KTStringWidget(_('Email Address'), _('The email address of the user. Notifications and alerts are mailed to this address if email notifications is set below. e.g. jsmith@acme.com'), 'email_address', $aResults[$aAttributes[4]], $this->oPage, false);
$fields[] = new KTCheckboxWidget(_('Email Notifications'), _('If this is specified then the user will have notifications sent to the email address entered above. If it is not set, then the user will only see notifications on the Dashboard'), 'email_notifications', true, $this->oPage, false);
diff --git a/resources/css/kt-contenttypes.css b/resources/css/kt-contenttypes.css
index 2c39af6..291c0e7 100644
--- a/resources/css/kt-contenttypes.css
+++ b/resources/css/kt-contenttypes.css
@@ -10,6 +10,7 @@
padding-left: 25px;
padding-top: 5px;
padding-bottom: 5px;
+ margin-right: 25px;
}
.contenttype.ms-presentation { background-image: url(../../resources/mimetypes/powerp.gif); }
diff --git a/resources/css/kt-framing.css b/resources/css/kt-framing.css
index 80cc1c7..6e5ebed 100644
--- a/resources/css/kt-framing.css
+++ b/resources/css/kt-framing.css
@@ -432,6 +432,7 @@ a.main_nav_item {
}
.metadata.versioned dd div {
+
padding: 0.2em 0.5em;
border-style: solid;
border-color: #ccc;
@@ -507,11 +508,13 @@ a.main_nav_item {
.kt_collection
{
width: 100%;
+ white-space: nowrap !important;
}
.kt_collection thead th {
border-bottom: 1px solid #888;
text-align: left;
+ white-space: nowrap !important;
}
.kt_collection th.sort_on.sort_asc {
@@ -531,6 +534,8 @@ a.main_nav_item {
.kt_collection th,
.kt_collection td {
padding: 0.25em 0.5em;
+ white-space: nowrap !important;
+ overflow: hidden;
}
.kt_collection td.sort_on {
diff --git a/resources/js/toggleselect.js b/resources/js/toggleselect.js
new file mode 100644
index 0000000..090b945
--- /dev/null
+++ b/resources/js/toggleselect.js
@@ -0,0 +1,17 @@
+function toggleSelectFor(source, nameprefix) {
+ var content = getElement('content');
+
+ var state = source.checked;
+
+ // now: find other items like the stated one (IN id=content)
+ var inputs = content.getElementsByTagName('INPUT');
+ for (var i=0; i= nameprefix.length) && (nameprefix == n.substring(0,nameprefix.length))) {
+ c.checked = state;
+ }
+ }
+ }
+}
diff --git a/search/booleanSearch.php b/search/booleanSearch.php
index 52c6715..9fee5df 100755
--- a/search/booleanSearch.php
+++ b/search/booleanSearch.php
@@ -25,7 +25,7 @@ class BooleanSearchDispatcher extends KTStandardDispatcher {
}
function do_main() {
- $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _("Boolean search"));
+ $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _("Advanced Search"));
$this->oPage->setBreadcrumbDetails(_('defining search'));
$oTemplating = new KTTemplating;
$oTemplate = $oTemplating->loadTemplate("ktcore/boolean_search");
@@ -40,7 +40,7 @@ class BooleanSearchDispatcher extends KTStandardDispatcher {
}
function do_performSearch() {
- $title = _('Advanced Search Results');
+ $title = null;
$datavars = KTUtil::arrayGet($_REQUEST, 'boolean_search');
if (!is_array($datavars)) {
$datavars = unserialize($datavars);
@@ -53,7 +53,7 @@ class BooleanSearchDispatcher extends KTStandardDispatcher {
if (!empty($iSavedSearchId)) {
$oSearch = KTSavedSearch::get($iSavedSearchId);
$datavars = $oSearch->getSearch();
- $title = _('Saved Search: ') . $oSearch->getName();
+ $title = $oSearch->getName();
}
if (empty($datavars)) {
@@ -66,12 +66,16 @@ class BooleanSearchDispatcher extends KTStandardDispatcher {
}
function handleCriteriaSet($aCriteriaSet, $iStartIndex, $sTitle=null) {
- $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _("Boolean search"));
+
if ($sTitle == null) {
- $this->oPage->setBreadcrumbDetails(_('searching'));
+ $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Advanced Search'));
+ $sTitle = _('Search Results');
} else {
- $this->oPage->setBreadcrumbDetails($sTitle);
+ $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Saved Search'));
+ $this->oPage->setTitle(_('Saved Search: ') . $sTitle);
}
+ $this->oPage->setBreadcrumbDetails($sTitle);
+
$collection = new DocumentCollection;
$this->browseType = "Folder";
diff --git a/templates/ktcore/folder/mass_delete.smarty b/templates/ktcore/folder/mass_delete.smarty
new file mode 100644
index 0000000..fbe83ff
--- /dev/null
+++ b/templates/ktcore/folder/mass_delete.smarty
@@ -0,0 +1,29 @@
+