Commit 2e2b801a011ae92d9a287d945768767527d40ce8
1 parent
79d4ba97
Little mod to discussion, clean up others.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5486 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
3 changed files
with
39 additions
and
38 deletions
lib/browse/PartialQuery.inc.php
| @@ -370,6 +370,7 @@ class SimpleSearchQuery extends PartialQuery { | @@ -370,6 +370,7 @@ class SimpleSearchQuery extends PartialQuery { | ||
| 370 | $aParams[] = $iBatchSize; | 370 | $aParams[] = $iBatchSize; |
| 371 | 371 | ||
| 372 | $q = array($sQuery, $aParams); | 372 | $q = array($sQuery, $aParams); |
| 373 | + | ||
| 373 | $res = DBUtil::getResultArray($q); | 374 | $res = DBUtil::getResultArray($q); |
| 374 | 375 | ||
| 375 | return $res; | 376 | return $res; |
plugins/ktstandard/KTDiscussion.php
| @@ -228,10 +228,9 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | @@ -228,10 +228,9 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | ||
| 228 | $replyFields[] = new KTStringWidget(_kt("Subject"), _kt("The topic of discussion in this thread"), "subject", "", $this->oPage, true); | 228 | $replyFields[] = new KTStringWidget(_kt("Subject"), _kt("The topic of discussion in this thread"), "subject", "", $this->oPage, true); |
| 229 | $replyFields[] = new KTTextWidget(_kt("Body"), _kt("Your contribution to the discussion in this thread"), "body", "", $this->oPage, true, null, null, array("cols" => 50, "rows" => 10)); | 229 | $replyFields[] = new KTTextWidget(_kt("Body"), _kt("Your contribution to the discussion in this thread"), "body", "", $this->oPage, true, null, null, array("cols" => 50, "rows" => 10)); |
| 230 | 230 | ||
| 231 | - // Fields for closing thread (if user has write permission) | 231 | + // Fields for closing thread (if user has workflow permission) |
| 232 | $closeFields = array(); | 232 | $closeFields = array(); |
| 233 | - | ||
| 234 | - $oPermission =& KTPermission::getByName('ktcore.permissions.write'); | 233 | + $oPermission =& KTPermission::getByName('ktcore.permissions.workflow'); |
| 235 | 234 | ||
| 236 | if (!PEAR::isError($oPermission) && KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPermission, $this->oDocument) && $oThread->getState() != DISCUSSION_CLOSED) { | 235 | if (!PEAR::isError($oPermission) && KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPermission, $this->oDocument) && $oThread->getState() != DISCUSSION_CLOSED) { |
| 237 | $aOptions = array('vocab' => $this->_buildStates($oThread)); | 236 | $aOptions = array('vocab' => $this->_buildStates($oThread)); |
search/simpleSearch.php
| @@ -137,56 +137,57 @@ class SimpleSearchDispatcher extends KTStandardDispatcher { | @@ -137,56 +137,57 @@ class SimpleSearchDispatcher extends KTStandardDispatcher { | ||
| 137 | $aErrorOptions = array( | 137 | $aErrorOptions = array( |
| 138 | "message" => _kt("Please provide a search term"), | 138 | "message" => _kt("Please provide a search term"), |
| 139 | ); | 139 | ); |
| 140 | - $searchable_text = KTUtil::arrayGet($_REQUEST, "fSearchableText"); | 140 | + $searchable_text = KTUtil::arrayGet($_REQUEST, "fSearchableText"); |
| 141 | $this->oValidator->notEmpty($searchable_text, $aErrorOptions); | 141 | $this->oValidator->notEmpty($searchable_text, $aErrorOptions); |
| 142 | 142 | ||
| 143 | - $collection = new DocumentCollection; | ||
| 144 | - $this->browseType = "Folder"; | 143 | + $collection = new DocumentCollection; |
| 144 | + $this->browseType = "Folder"; | ||
| 145 | 145 | ||
| 146 | - //$collection->addColumn(new SelectionColumn("Browse Selection","selection")); | 146 | + //$collection->addColumn(new SelectionColumn("Browse Selection","selection")); |
| 147 | /* | 147 | /* |
| 148 | $t = new SimpleSearchTitleColumn("Test 1 (title)","title"); | 148 | $t = new SimpleSearchTitleColumn("Test 1 (title)","title"); |
| 149 | $t->setOptions(array('documenturl' => $GLOBALS['KTRootUrl'] . '/view.php')); | 149 | $t->setOptions(array('documenturl' => $GLOBALS['KTRootUrl'] . '/view.php')); |
| 150 | $t->setSearch($searchable_text); | 150 | $t->setSearch($searchable_text); |
| 151 | - */ | ||
| 152 | - $t =& new TitleColumn("Test 1 (title)","title"); | ||
| 153 | - $t->setOptions(array('documenturl' => $GLOBALS['KTRootUrl'] . '/view.php', 'direct_folder' => true)); | ||
| 154 | - $collection->addColumn($t); | ||
| 155 | - $collection->addColumn(new DownloadColumn('','download')); | ||
| 156 | - $collection->addColumn(new DateColumn(_kt("Created"),"created", "getCreatedDateTime")); | ||
| 157 | - $collection->addColumn(new DateColumn(_kt("Last Modified"),"modified", "getLastModifiedDate")); | 151 | + */ |
| 152 | + | ||
| 153 | + $t =& new TitleColumn("Test 1 (title)","title"); | ||
| 154 | + $t->setOptions(array('documenturl' => $GLOBALS['KTRootUrl'] . '/view.php', 'direct_folder' => true)); | ||
| 155 | + $collection->addColumn($t); | ||
| 156 | + $collection->addColumn(new DownloadColumn('','download')); | ||
| 157 | + $collection->addColumn(new DateColumn(_kt("Created"),"created", "getCreatedDateTime")); | ||
| 158 | + $collection->addColumn(new DateColumn(_kt("Last Modified"),"modified", "getLastModifiedDate")); | ||
| 158 | $collection->addColumn(new UserColumn(_kt('Creator'),'creator_id','getCreatorID')); | 159 | $collection->addColumn(new UserColumn(_kt('Creator'),'creator_id','getCreatorID')); |
| 159 | - $collection->addColumn(new WorkflowColumn(_kt('Workflow State'),'workflow_state')); | ||
| 160 | - | ||
| 161 | - $batchPage = (int) KTUtil::arrayGet($_REQUEST, "page", 0); | ||
| 162 | - $batchSize = 20; | 160 | + $collection->addColumn(new WorkflowColumn(_kt('Workflow State'),'workflow_state')); |
| 163 | 161 | ||
| 164 | - $resultURL = KTUtil::addQueryStringSelf("fSearchableText=" . $searchable_text); | ||
| 165 | - $collection->setBatching($resultURL, $batchPage, $batchSize); | 162 | + $batchPage = (int) KTUtil::arrayGet($_REQUEST, "page", 0); |
| 163 | + $batchSize = 20; | ||
| 166 | 164 | ||
| 165 | + $resultURL = KTUtil::addQueryStringSelf("fSearchableText=" . $searchable_text); | ||
| 166 | + $collection->setBatching($resultURL, $batchPage, $batchSize); | ||
| 167 | 167 | ||
| 168 | - // ordering. (direction and column) | ||
| 169 | - $displayOrder = KTUtil::arrayGet($_REQUEST, 'sort_order', "asc"); | ||
| 170 | - if ($displayOrder !== "asc") { $displayOrder = "desc"; } | ||
| 171 | - $displayControl = KTUtil::arrayGet($_REQUEST, 'sort_on', "title"); | ||
| 172 | 168 | ||
| 173 | - $collection->setSorting($displayControl, $displayOrder); | 169 | + // ordering. (direction and column) |
| 170 | + $displayOrder = KTUtil::arrayGet($_REQUEST, 'sort_order', "asc"); | ||
| 171 | + if ($displayOrder !== "asc") { $displayOrder = "desc"; } | ||
| 172 | + $displayControl = KTUtil::arrayGet($_REQUEST, 'sort_on', "title"); | ||
| 174 | 173 | ||
| 175 | - // add in the query object. | ||
| 176 | - $qObj = new SimpleSearchQuery($searchable_text); | ||
| 177 | - $collection->setQueryObject($qObj); | 174 | + $collection->setSorting($displayControl, $displayOrder); |
| 178 | 175 | ||
| 179 | - // breadcrumbs | ||
| 180 | - // FIXME handle breadcrumbs | ||
| 181 | - $collection->getResults(); | 176 | + // add in the query object. |
| 177 | + $qObj = new SimpleSearchQuery($searchable_text); | ||
| 178 | + $collection->setQueryObject($qObj); | ||
| 182 | 179 | ||
| 183 | - $oTemplating =& KTTemplating::getSingleton(); | ||
| 184 | - $oTemplate = $oTemplating->loadTemplate("kt3/browse"); | ||
| 185 | - $aTemplateData = array( | ||
| 186 | - "context" => $this, | ||
| 187 | - "collection" => $collection, | ||
| 188 | - ); | ||
| 189 | - return $oTemplate->render($aTemplateData); | 180 | + // breadcrumbs |
| 181 | + // FIXME handle breadcrumbs | ||
| 182 | + $collection->getResults(); | ||
| 183 | + | ||
| 184 | + $oTemplating =& KTTemplating::getSingleton(); | ||
| 185 | + $oTemplate = $oTemplating->loadTemplate("kt3/browse"); | ||
| 186 | + $aTemplateData = array( | ||
| 187 | + "context" => $this, | ||
| 188 | + "collection" => $collection, | ||
| 189 | + ); | ||
| 190 | + return $oTemplate->render($aTemplateData); | ||
| 190 | } | 191 | } |
| 191 | } | 192 | } |
| 192 | 193 |