Commit ac64d8986c8e7a2bd9dbc6e0c2404db09991fa54
1 parent
12b1e162
KTS-2447
"Remove search dashets" Updated. Removed general metadata dashlet. Commited By: Conrad Vermeulen Reviewed By: Kevin Fourie git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7319 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
4 changed files
with
0 additions
and
294 deletions
plugins/generalmetadata/GeneralMetadataDashlet.php deleted
| 1 | -<?php | ||
| 2 | - | ||
| 3 | -/* | ||
| 4 | - * The contents of this file are subject to the KnowledgeTree Public | ||
| 5 | - * License Version 1.1.2 ("License"); You may not use this file except in | ||
| 6 | - * compliance with the License. You may obtain a copy of the License at | ||
| 7 | - * http://www.knowledgetree.com/KPL | ||
| 8 | - * | ||
| 9 | - * Software distributed under the License is distributed on an "AS IS" | ||
| 10 | - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | ||
| 11 | - * See the License for the specific language governing rights and | ||
| 12 | - * limitations under the License. | ||
| 13 | - * | ||
| 14 | - * All copies of the Covered Code must include on each user interface screen: | ||
| 15 | - * (i) the "Powered by KnowledgeTree" logo and | ||
| 16 | - * (ii) the KnowledgeTree copyright notice | ||
| 17 | - * in the same form as they appear in the distribution. See the License for | ||
| 18 | - * requirements. | ||
| 19 | - * | ||
| 20 | - * The Original Code is: KnowledgeTree Open Source | ||
| 21 | - * | ||
| 22 | - * The Initial Developer of the Original Code is The Jam Warehouse Software | ||
| 23 | - * (Pty) Ltd, trading as KnowledgeTree. | ||
| 24 | - * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright | ||
| 25 | - * (C) 2007 The Jam Warehouse Software (Pty) Ltd; | ||
| 26 | - * All Rights Reserved. | ||
| 27 | - * Contributor( s): ______________________________________ | ||
| 28 | - * | ||
| 29 | - */ | ||
| 30 | - | ||
| 31 | - | ||
| 32 | -require_once(KT_LIB_DIR . '/browse/browseutil.inc.php'); | ||
| 33 | -require_once(KT_LIB_DIR . '/plugins/pluginregistry.inc.php'); | ||
| 34 | -require_once(KT_LIB_DIR . '/plugins/plugin.inc.php'); | ||
| 35 | - | ||
| 36 | -class GeneralMetadataDashlet extends KTBaseDashlet { | ||
| 37 | - var $oUser; | ||
| 38 | - var $sClass = 'ktBlock'; | ||
| 39 | - | ||
| 40 | - /** | ||
| 41 | - * Constructor method | ||
| 42 | - * | ||
| 43 | - * @return GeneralMetadataDashlet | ||
| 44 | - */ | ||
| 45 | - function GeneralMetadataDashlet(){ | ||
| 46 | - $this->sTitle = _kt('General Metadata Search'); | ||
| 47 | - } | ||
| 48 | - | ||
| 49 | - /** | ||
| 50 | - * Check to see if user is active | ||
| 51 | - * | ||
| 52 | - * @param object $oUser | ||
| 53 | - * @return boolean | ||
| 54 | - */ | ||
| 55 | - function is_active($oUser) { | ||
| 56 | - $this->oUser = $oUser; | ||
| 57 | - return true; | ||
| 58 | - } | ||
| 59 | - | ||
| 60 | - /** | ||
| 61 | - * Render function for template | ||
| 62 | - * | ||
| 63 | - * @return unknown | ||
| 64 | - */ | ||
| 65 | - function render() { | ||
| 66 | - $oTemplating =& KTTemplating::getSingleton(); | ||
| 67 | - $oTemplate = $oTemplating->loadTemplate('GeneralMetadata/dashlet'); | ||
| 68 | - | ||
| 69 | - $oRegistry =& KTPluginRegistry::getSingleton(); | ||
| 70 | - $oPlugin =& $oRegistry->getPlugin('ktcore.generalmetadata.plugin'); | ||
| 71 | - $url = $oPlugin->getPagePath('GeneralMetadataPage'); | ||
| 72 | - | ||
| 73 | - $aTemplateData = array( | ||
| 74 | - 'context' => $this, | ||
| 75 | - 'url' => $url, | ||
| 76 | - ); | ||
| 77 | - return $oTemplate->render($aTemplateData); | ||
| 78 | - } | ||
| 79 | -} | ||
| 80 | -?> |
plugins/generalmetadata/GeneralMetadataPage.php deleted
| 1 | -<?php | ||
| 2 | - | ||
| 3 | -/* | ||
| 4 | - * The contents of this file are subject to the KnowledgeTree Public | ||
| 5 | - * License Version 1.1.2 ("License"); You may not use this file except in | ||
| 6 | - * compliance with the License. You may obtain a copy of the License at | ||
| 7 | - * http://www.knowledgetree.com/KPL | ||
| 8 | - * | ||
| 9 | - * Software distributed under the License is distributed on an "AS IS" | ||
| 10 | - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | ||
| 11 | - * See the License for the specific language governing rights and | ||
| 12 | - * limitations under the License. | ||
| 13 | - * | ||
| 14 | - * All copies of the Covered Code must include on each user interface screen: | ||
| 15 | - * (i) the "Powered by KnowledgeTree" logo and | ||
| 16 | - * (ii) the KnowledgeTree copyright notice | ||
| 17 | - * in the same form as they appear in the distribution. See the License for | ||
| 18 | - * requirements. | ||
| 19 | - * | ||
| 20 | - * The Original Code is: KnowledgeTree Open Source | ||
| 21 | - * | ||
| 22 | - * The Initial Developer of the Original Code is The Jam Warehouse Software | ||
| 23 | - * (Pty) Ltd, trading as KnowledgeTree. | ||
| 24 | - * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright | ||
| 25 | - * (C) 2007 The Jam Warehouse Software (Pty) Ltd; | ||
| 26 | - * All Rights Reserved. | ||
| 27 | - * Contributor( s): ______________________________________ | ||
| 28 | - * | ||
| 29 | - */ | ||
| 30 | - | ||
| 31 | -require_once(KT_LIB_DIR . '/plugins/plugin.inc.php'); | ||
| 32 | -require_once(KT_LIB_DIR . '/plugins/pluginregistry.inc.php'); | ||
| 33 | -require_once(KT_LIB_DIR . "/templating/templating.inc.php"); | ||
| 34 | -require_once(KT_LIB_DIR . "/database/dbutil.inc"); | ||
| 35 | -require_once(KT_LIB_DIR . "/util/ktutil.inc"); | ||
| 36 | -require_once(KT_LIB_DIR . "/dispatcher.inc.php"); | ||
| 37 | -require_once(KT_LIB_DIR . "/browse/Criteria.inc"); | ||
| 38 | -require_once(KT_LIB_DIR . "/search/savedsearch.inc.php"); | ||
| 39 | -require_once(KT_LIB_DIR . "/search/searchutil.inc.php"); | ||
| 40 | - | ||
| 41 | -require_once(KT_LIB_DIR . "/browse/DocumentCollection.inc.php"); | ||
| 42 | -require_once(KT_LIB_DIR . "/browse/BrowseColumns.inc.php"); | ||
| 43 | -require_once(KT_LIB_DIR . "/browse/PartialQuery.inc.php"); | ||
| 44 | - | ||
| 45 | -require_once(KT_LIB_DIR . '/widgets/fieldWidgets.php'); | ||
| 46 | -require_once(KT_LIB_DIR . '/actions/bulkaction.php'); | ||
| 47 | - | ||
| 48 | -class GeneralMetadataPage extends KTStandardDispatcher { | ||
| 49 | - | ||
| 50 | - function do_main() { | ||
| 51 | - $searchable_text = KTUtil::arrayGet($_POST, "fSearchableText"); | ||
| 52 | - | ||
| 53 | - // set breadcrumbs | ||
| 54 | - $this->aBreadcrumbs[] = array('url' => 'dashboard.php', 'name' => _kt('Dashboard')); | ||
| 55 | - $this->aBreadcrumbs[] = array('name' => _kt('General Metadata Search')); | ||
| 56 | - | ||
| 57 | - $sTitle = _kt('Search Results'); | ||
| 58 | - $this->oPage->setBreadcrumbDetails($sTitle); | ||
| 59 | - | ||
| 60 | - | ||
| 61 | - $aCriteriaSet = array( | ||
| 62 | - 'join'=>'AND', | ||
| 63 | - 'subgroup'=>array( | ||
| 64 | - 0=>array( | ||
| 65 | - 'join'=>'AND', | ||
| 66 | - 'values'=>array( | ||
| 67 | - 1=>array( | ||
| 68 | - 'data'=>array( | ||
| 69 | - 'ktcore.criteria.generalmetadata'=>$searchable_text, | ||
| 70 | - 'ktcore.criteria.generalmetadata_not'=>0 | ||
| 71 | - ), | ||
| 72 | - 'type'=>'ktcore.criteria.generalmetadata' | ||
| 73 | - ) | ||
| 74 | - ) | ||
| 75 | - ) | ||
| 76 | - ) | ||
| 77 | - ); | ||
| 78 | - | ||
| 79 | - | ||
| 80 | - $this->browseType = "Folder"; | ||
| 81 | - $sSearch = md5(serialize($aCriteriaSet)); | ||
| 82 | - $_SESSION['boolean_search'][$sSearch] = $aCriteriaSet; | ||
| 83 | - | ||
| 84 | - $collection = new AdvancedCollection; | ||
| 85 | - $oColumnRegistry = KTColumnRegistry::getSingleton(); | ||
| 86 | - $aColumns = $oColumnRegistry->getColumnsForView('ktcore.views.search'); | ||
| 87 | - $collection->addColumns($aColumns); | ||
| 88 | - | ||
| 89 | - // set a view option | ||
| 90 | - $aTitleOptions = array( | ||
| 91 | - 'documenturl' => $GLOBALS['KTRootUrl'] . '/view.php', | ||
| 92 | - ); | ||
| 93 | - $collection->setColumnOptions('ktcore.columns.title', $aTitleOptions); | ||
| 94 | - $collection->setColumnOptions('ktcore.columns.selection', array( | ||
| 95 | - 'rangename' => 'selection', | ||
| 96 | - 'show_folders' => true, | ||
| 97 | - 'show_documents' => true, | ||
| 98 | - )); | ||
| 99 | - | ||
| 100 | - $aOptions = $collection->getEnvironOptions(); // extract data from the environment | ||
| 101 | - | ||
| 102 | - $aOptions['return_url'] = KTUtil::addQueryStringSelf("action=performSearch&boolean_search_id=" . urlencode($sSearch)); | ||
| 103 | - $aOptions['empty_message'] = _kt("No documents or folders match this query."); | ||
| 104 | - $aOptions['is_browse'] = true; | ||
| 105 | - | ||
| 106 | - $collection->setOptions($aOptions); | ||
| 107 | - $collection->setQueryObject(new BooleanSearchQuery($aCriteriaSet)); | ||
| 108 | - | ||
| 109 | - $oTemplating =& KTTemplating::getSingleton(); | ||
| 110 | - $oTemplate = $oTemplating->loadTemplate("kt3/browse"); | ||
| 111 | - $aTemplateData = array( | ||
| 112 | - "context" => $this, | ||
| 113 | - "collection" => $collection, | ||
| 114 | - "custom_title" => $sTitle, | ||
| 115 | - "params" => $aParams, | ||
| 116 | - "joins" => $aJoins, | ||
| 117 | - 'isEditable' => true, | ||
| 118 | - "boolean_search" => $sSearch, | ||
| 119 | - 'bulkactions' => KTBulkActionUtil::getAllBulkActions(), | ||
| 120 | - 'browseutil' => new KTBrowseUtil(), | ||
| 121 | - 'returnaction' => 'booleanSearch', | ||
| 122 | - 'returndata' => $sSearch, | ||
| 123 | - | ||
| 124 | - ); | ||
| 125 | - return $oTemplate->render($aTemplateData); | ||
| 126 | - } | ||
| 127 | -} | ||
| 128 | -?> | ||
| 129 | \ No newline at end of file | 0 | \ No newline at end of file |
plugins/generalmetadata/GeneralMetadataPlugin.php deleted
| 1 | -<?php | ||
| 2 | - | ||
| 3 | -/* | ||
| 4 | - * The contents of this file are subject to the KnowledgeTree Public | ||
| 5 | - * License Version 1.1.2 ("License"); You may not use this file except in | ||
| 6 | - * compliance with the License. You may obtain a copy of the License at | ||
| 7 | - * http://www.knowledgetree.com/KPL | ||
| 8 | - * | ||
| 9 | - * Software distributed under the License is distributed on an "AS IS" | ||
| 10 | - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | ||
| 11 | - * See the License for the specific language governing rights and | ||
| 12 | - * limitations under the License. | ||
| 13 | - * | ||
| 14 | - * All copies of the Covered Code must include on each user interface screen: | ||
| 15 | - * (i) the "Powered by KnowledgeTree" logo and | ||
| 16 | - * (ii) the KnowledgeTree copyright notice | ||
| 17 | - * in the same form as they appear in the distribution. See the License for | ||
| 18 | - * requirements. | ||
| 19 | - * | ||
| 20 | - * The Original Code is: KnowledgeTree Open Source | ||
| 21 | - * | ||
| 22 | - * The Initial Developer of the Original Code is The Jam Warehouse Software | ||
| 23 | - * (Pty) Ltd, trading as KnowledgeTree. | ||
| 24 | - * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright | ||
| 25 | - * (C) 2007 The Jam Warehouse Software (Pty) Ltd; | ||
| 26 | - * All Rights Reserved. | ||
| 27 | - * Contributor( s): ______________________________________ | ||
| 28 | - * | ||
| 29 | - */ | ||
| 30 | - | ||
| 31 | -require_once(KT_LIB_DIR . '/plugins/plugin.inc.php'); | ||
| 32 | -require_once(KT_LIB_DIR . '/plugins/pluginregistry.inc.php'); | ||
| 33 | -require_once('GeneralMetadataPage.php'); | ||
| 34 | -require_once(KT_LIB_DIR . '/templating/templating.inc.php'); | ||
| 35 | - | ||
| 36 | - /** | ||
| 37 | - * Tag Cloud Plugin class | ||
| 38 | - * | ||
| 39 | - */ | ||
| 40 | - class GeneralMetadataPlugin extends KTPlugin{ | ||
| 41 | - | ||
| 42 | - var $sNamespace = 'ktcore.generalmetadata.plugin'; | ||
| 43 | - | ||
| 44 | - /** | ||
| 45 | - * Constructor method for plugin | ||
| 46 | - * | ||
| 47 | - * @param string $sFilename | ||
| 48 | - * @return GeneralMetadataPlugin | ||
| 49 | - */ | ||
| 50 | - function GeneralMetadataPlugin($sFilename = null) { | ||
| 51 | - $res = parent::KTPlugin($sFilename); | ||
| 52 | - $this->sFriendlyName = _kt('General Metadata Search Plugin'); | ||
| 53 | - return $res; | ||
| 54 | - } | ||
| 55 | - | ||
| 56 | - /** | ||
| 57 | - * Setup function for plugin | ||
| 58 | - * | ||
| 59 | - */ | ||
| 60 | - function setup() { | ||
| 61 | - // Register plugin components | ||
| 62 | - $this->registerCriterion('GeneralMetadataCriterion', 'ktcore.criteria.generalmetadata', KT_LIB_DIR . '/browse/Criteria.inc'); | ||
| 63 | - $this->registerDashlet('GeneralMetadataDashlet', 'ktcore.generalmetadata.dashlet', 'GeneralMetadataDashlet.php'); | ||
| 64 | - $this->registerPage('GeneralMetadataPage', 'GeneralMetadataPage', __FILE__); | ||
| 65 | - | ||
| 66 | - $oTemplating =& KTTemplating::getSingleton(); | ||
| 67 | - $oTemplating->addLocation('General Metadata Search', '/plugins/generalmetadata/templates'); | ||
| 68 | - } | ||
| 69 | - } | ||
| 70 | -$oPluginRegistry =& KTPluginRegistry::getSingleton(); | ||
| 71 | -$oPluginRegistry->registerPlugin('GeneralMetadataPlugin', 'ktcore.generalmetadata.plugin', __FILE__); | ||
| 72 | \ No newline at end of file | 0 | \ No newline at end of file |
plugins/generalmetadata/templates/GeneralMetadata/dashlet.smarty deleted
| 1 | -<form action="{$url}" method="POST"> | ||
| 2 | -<input onclick="this.focus()" type="text" name="fSearchableText" id="dashlet-search-text" | ||
| 3 | -size="15" /><input type="submit" value="{i18n}search{/i18n}" | ||
| 4 | -class="searchbutton frontpage" /> | ||
| 5 | -</form> | ||
| 6 | -{if (!empty($saved_searches))} | ||
| 7 | -<hr /> | ||
| 8 | -<h3>{i18n}Saved Searches{/i18n}</h3> | ||
| 9 | -{foreach item=oSearch from=$saved_searches} | ||
| 10 | -<span class="descriptiveText">{i18n}Saved Search{/i18n}: </span><a | ||
| 11 | -href="{"booleanSearch"|generateControllerUrl}&qs[action]=performSearch&qs[fSavedSearchId]={$oSearch->getId()}">{$oSearch->getName()}</a><br /> | ||
| 12 | -{/foreach} | ||
| 13 | - | ||
| 14 | - | ||
| 15 | -{/if} | ||
| 16 | \ No newline at end of file | 0 | \ No newline at end of file |