diff --git a/lib/browse/PartialQuery.inc.php b/lib/browse/PartialQuery.inc.php index 89dbe2e..4f214a1 100644 --- a/lib/browse/PartialQuery.inc.php +++ b/lib/browse/PartialQuery.inc.php @@ -222,7 +222,7 @@ class SimpleSearchQuery extends PartialQuery { function getDocumentCount() { $aOptions = array( - 'select' => 'count(D.id) AS cnt', + 'select' => 'count(DISTINCT D.id) AS cnt', ); $aQuery = $this->getQuery($aOptions); $iRet = DBUtil::getOneResultKey($aQuery, 'cnt'); @@ -236,7 +236,7 @@ class SimpleSearchQuery extends PartialQuery { // we also leak like ---- here, since getting the score is ... fiddly. and expensive. function getDocuments($iBatchSize, $iBatchStart, $sSortColumn, $sSortOrder, $sJoinClause = null, $aJoinParams = null) { $aOptions = array( - 'select' => 'D.id AS id', + 'select' => 'DISTINCT D.id AS id', ); list($sQuery, $aParams) = $this->getQuery($aOptions); @@ -299,7 +299,7 @@ class BooleanSearchQuery extends PartialQuery { function getDocumentCount() { $aOptions = array( - 'select' => 'count(D.id) AS cnt', + 'select' => 'count(DISTINCT D.id) AS cnt', ); $aQuery = $this->getQuery($aOptions); $iRet = DBUtil::getOneResultKey($aQuery, 'cnt'); @@ -313,7 +313,7 @@ class BooleanSearchQuery extends PartialQuery { // we also leak like ---- here, since getting the score is ... fiddly. and expensive. function getDocuments($iBatchSize, $iBatchStart, $sSortColumn, $sSortOrder, $sJoinClause = null, $aJoinParams = null) { $aOptions = array( - 'select' => 'D.id AS id', + 'select' => 'DISTINCT D.id AS id', ); list($sQuery, $aParams) = $this->getQuery($aOptions); diff --git a/lib/widgets/fieldsetDisplay.inc.php b/lib/widgets/fieldsetDisplay.inc.php index dd3f365..7f56432 100644 --- a/lib/widgets/fieldsetDisplay.inc.php +++ b/lib/widgets/fieldsetDisplay.inc.php @@ -55,7 +55,7 @@ function getWidgetForMetadataField($field, $current_value, $page, $errors = null // FIXME we need to somehow handle both value-value and id-value here // extract the lookup. if ($vocab === null) { // allow override - $lookups = MetaData::getEnabledValuesByDocumentField($field); + $lookups = MetaData::getEnabledByDocumentField($field); $fieldOptions["vocab"] = array(); // FIXME handle lookups foreach ($lookups as $md) { $fieldOptions["vocab"][$md->getName()] = $md->getName(); diff --git a/plugins/ktcore/admin/documentFields.php b/plugins/ktcore/admin/documentFields.php index 893ab54..2a74dbe 100755 --- a/plugins/ktcore/admin/documentFields.php +++ b/plugins/ktcore/admin/documentFields.php @@ -57,6 +57,8 @@ class KTDocumentFieldDispatcher extends KTStandardDispatcher { $editFieldset[] = new KTTextWidget('Description', _('A brief description of the information stored in this fieldset.'), 'description', $oFieldset->getDescription(), $this->oPage, true); $createFields = array(); $createFields[] = new KTStringWidget('Name', _('A human-readable name, used in add and edit forms.'), 'name',null, $this->oPage, true); + $createFields[] = new KTTextWidget('Description', _('A brief description of the information stored in this field.'), 'description', null, $this->oPage, true); + // type is a little more complex. $vocab = array(); @@ -118,12 +120,15 @@ class KTDocumentFieldDispatcher extends KTStandardDispatcher { $sName = KTUtil::arrayGet($_REQUEST, 'name'); $sName = $this->oValidator->notEmpty($sName); $sNamespace = KTUtil::arrayGet($_REQUEST, 'namespace'); + $sDescription = KTUtil::arrayGet($_REQUEST, 'description'); + $sDescription = $this->oValidator->notEmpty($sDescription); if (empty($sNamespace)) { $sNamespace = KTUtil::nameToLocalNamespace('fieldsets', $sName); } $res = KTFieldset::createFromArray(array( 'name' => $sName, 'namespace' => $sNamespace, + 'description' => $sDescription, 'mandatory' => false, 'isconditional' => false, 'isgeneric' => $bIsGeneric, @@ -153,6 +158,7 @@ class KTDocumentFieldDispatcher extends KTStandardDispatcher { $oField =& DocumentField::createFromArray(array( 'name' => $_REQUEST['name'], 'datatype' => 'STRING', + 'description' => $_REQUEST['description'], 'haslookup' => $is_lookup, 'haslookuptree' => $is_tree, 'parentfieldset' => $oFieldset->getId(), diff --git a/presentation/lookAndFeel/knowledgeTree/browse.php b/presentation/lookAndFeel/knowledgeTree/browse.php index c6ccb8d..362e50b 100644 --- a/presentation/lookAndFeel/knowledgeTree/browse.php +++ b/presentation/lookAndFeel/knowledgeTree/browse.php @@ -46,7 +46,7 @@ $sectionName = "browse"; class BrowseDispatcher extends KTStandardDispatcher { - + var $oFolder = null; var $sSection = "browse"; var $browse_mode = null; var $query = null; @@ -84,6 +84,7 @@ class BrowseDispatcher extends KTStandardDispatcher { $folder_id = 1; $oFolder =& Folder::get($folder_id); } + $this->oFolder =& $oFolder; // we now have a folder, and need to create the query. $this->oQuery = new BrowseQuery($oFolder->getId()); diff --git a/templates/kt3/notifications/subscriptions.CheckinDocument.smarty b/templates/kt3/notifications/subscriptions.CheckinDocument.smarty index f5ff89f..97de650 100644 --- a/templates/kt3/notifications/subscriptions.CheckinDocument.smarty +++ b/templates/kt3/notifications/subscriptions.CheckinDocument.smarty @@ -1,7 +1,7 @@