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 @@
{$info.title}
- The document "{$info.object_name}" has been checked in, in the folder "{info.location_name}". + The document "{$info.object_name}" has been checked in, in the folder "{$info.location_name}".
{i18n}View Document{/i18n} {i18n}Clear Alert{/i18n} diff --git a/templates/kt3/notifications/subscriptions.CheckoutDocument.smarty b/templates/kt3/notifications/subscriptions.CheckoutDocument.smarty index b1441c9..b18484b 100644 --- a/templates/kt3/notifications/subscriptions.CheckoutDocument.smarty +++ b/templates/kt3/notifications/subscriptions.CheckoutDocument.smarty @@ -1,7 +1,7 @@
{$info.title}
- The document "{$info.object_name}" has been checked out, in the folder "{info.location_name}". + The document "{$info.object_name}" has been checked out, in the folder "{$info.location_name}".
{i18n}View Document{/i18n} {i18n}Clear Alert{/i18n} diff --git a/templates/kt3/notifications/subscriptions.ModifyDocument.smarty b/templates/kt3/notifications/subscriptions.ModifyDocument.smarty index 421e6ee..9e5ce14 100644 --- a/templates/kt3/notifications/subscriptions.ModifyDocument.smarty +++ b/templates/kt3/notifications/subscriptions.ModifyDocument.smarty @@ -1,7 +1,7 @@
{$info.title}
- The document "{$info.object_name}" has been changed in the folder "{info.location_name}". + The document "{$info.object_name}" has been changed in the folder "{$info.location_name}".
{i18n}View Document{/i18n} {i18n}Clear Alert{/i18n} diff --git a/templates/kt3/notifications/subscriptions.MoveDocument.smarty b/templates/kt3/notifications/subscriptions.MoveDocument.smarty index aa564e5..9397a05 100644 --- a/templates/kt3/notifications/subscriptions.MoveDocument.smarty +++ b/templates/kt3/notifications/subscriptions.MoveDocument.smarty @@ -1,7 +1,7 @@
{$info.title}
- The document "{$info.object_name}" has been moved to the folder "{info.location_name}". + The document "{$info.object_name}" has been moved to the folder "{$info.location_name}".
{i18n}View New Location{/i18n} {i18n}Clear Alert{/i18n} diff --git a/templates/kt3/notifications/subscriptions.RemoveChildDocument.smarty b/templates/kt3/notifications/subscriptions.RemoveChildDocument.smarty index ecf84f2..6790440 100644 --- a/templates/kt3/notifications/subscriptions.RemoveChildDocument.smarty +++ b/templates/kt3/notifications/subscriptions.RemoveChildDocument.smarty @@ -1,7 +1,7 @@
{$info.title}
- The document "{$info.object_name}" has been removed from the folder "{info.location_name}", to which you are subscribed. + The document "{$info.object_name}" has been removed from the folder "{$info.location_name}", to which you are subscribed.
{i18n}View Folder{/i18n} {i18n}Clear Alert{/i18n} diff --git a/templates/ktstandard/subscriptions/manage.smarty b/templates/ktstandard/subscriptions/manage.smarty index e2fd56d..1909b8e 100644 --- a/templates/ktstandard/subscriptions/manage.smarty +++ b/templates/ktstandard/subscriptions/manage.smarty @@ -21,7 +21,7 @@ subscribe.{/i18n}

{/if} {if $aDocumentSubscriptions} -{entity_checkboxes name="documentsubscriptions" entities=$aFolderSubscriptions method=getContentLink assign=aCheckboxes} +{entity_checkboxes name="documentsubscriptions" entities=$aDocumentSubscriptions method=getContentLink assign=aCheckboxes} {foreach from=$aCheckboxes item=oCheckbox} {$oCheckbox}
{/foreach}