Commit 627ecd4d3078c6b4fd8de62cee39a109f99e3a16
1 parent
7f6aef9f
KTS-2790
"CLONE -Backslashes appear before every quote and double quote throughout our version of knowledgetree(SUP-532)" Fixed. Added an upgrade script to remove the backslashes. Committed by: Megan Watson Reviewed by: Conrad Vermeulen KTS-2653 "Change the text at the end of a bulk export" Fixed. Changed the display at the end of both ways of bulk exporting. Committed By:Yusuf Davids Reviewed By:Jalaloedien Abrahams KTS-2456 "Dropdown in search bar and search portlet needs to be aligned correctly" Fixed. Patched to work with IE Committed By: Conrad Vermeulen Reviewed By: Megan Watson KTS-2301 "Number of characters allowed in a field is not 250 as is mostly specified" Fixed. Changed version, filename and comment fields variable types. Committed By: Jonathan Byrne Reviewed By: Jalaloedien Abrahams KTS-2833 "Text in Search Portlet overruns the width of the portlet" Fixed. Committed By: Conrad Vermeulen Reviewed By: Megan Watson KTS-2827 "Search by created/modified/checkout date returns wrong results" Fixed. Rendering in IE was not working because of missing close of TD element Committed By: Conrad Vermeulen Reviewed By: Megan Watson KTS-2456 "Dropdown in search bar and search portlet needs to be aligned correctly" Fixed. Updated so IE does not complain Committed By: Conrad Vermeulen Reviewed By: Megan Watson KTS-2831 "CLONE -End line characters in discussions and disclaimers being displayed as html tags (SUP-546)" Fixed. Removed the calls to sanitiseForSQL before inserting into the database. Committed by: Megan Watson Reviewed by: Conrad Vermeulen KTS-2831 "CLONE -End line characters in discussions and disclaimers being displayed as html tags (SUP-546)" Fixed. Replaced the \r\n with <br> Committed by: Megan Watson Reviewed by: Conrad Vermeulen KTS-2772 "CLONE -LDAP / Active Directory Authentication incorrect fields returned(SUP-521)" Fixed. Rearranged the attributes retrieved from either directory to match the user's fields correctly. Committed by: Megan Watson Reviewed by: Conrad Vermeulen KTS-2790 "CLONE -Backslashes appear before every quote and double quote throughout our version of knowledgetree(SUP-532)" Updated. Added upgrade line items to upgrades table. Committed by: Kevin Fourie Reviewed by: Conrad Vermeulen git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@7915 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
30 changed files
with
520 additions
and
341 deletions
ktapi/KTAPIDocument.inc.php
| @@ -1109,6 +1109,7 @@ class KTAPI_Document extends KTAPI_FolderItem | @@ -1109,6 +1109,7 @@ class KTAPI_Document extends KTAPI_FolderItem | ||
| 1109 | */ | 1109 | */ |
| 1110 | function update_sysdata($sysdata) | 1110 | function update_sysdata($sysdata) |
| 1111 | { | 1111 | { |
| 1112 | + global $default; | ||
| 1112 | if (empty($sysdata)) | 1113 | if (empty($sysdata)) |
| 1113 | { | 1114 | { |
| 1114 | return; | 1115 | return; |
| @@ -1182,10 +1183,12 @@ class KTAPI_Document extends KTAPI_FolderItem | @@ -1182,10 +1183,12 @@ class KTAPI_Document extends KTAPI_FolderItem | ||
| 1182 | $value = DBUtil::getResultArray($sql); | 1183 | $value = DBUtil::getResultArray($sql); |
| 1183 | if (PEAR::isError($value)) | 1184 | if (PEAR::isError($value)) |
| 1184 | { | 1185 | { |
| 1186 | + $default->log->error("Problem resolving mime type '$value' for document id $this->documentid. Reason: " . $value->getMessage()); | ||
| 1185 | return $value; | 1187 | return $value; |
| 1186 | } | 1188 | } |
| 1187 | if (count($value) == 0) | 1189 | if (count($value) == 0) |
| 1188 | { | 1190 | { |
| 1191 | + $default->log->error("Problem resolving mime type '$value' for document id $this->documentid. None found."); | ||
| 1189 | break; | 1192 | break; |
| 1190 | } | 1193 | } |
| 1191 | $value = $value[0]['id']; | 1194 | $value = $value[0]['id']; |
| @@ -1198,6 +1201,7 @@ class KTAPI_Document extends KTAPI_FolderItem | @@ -1198,6 +1201,7 @@ class KTAPI_Document extends KTAPI_FolderItem | ||
| 1198 | $userId = DBUtil::getResultArray($sql); | 1201 | $userId = DBUtil::getResultArray($sql); |
| 1199 | if (PEAR::isError($userId)) | 1202 | if (PEAR::isError($userId)) |
| 1200 | { | 1203 | { |
| 1204 | + $default->log->error("Problem resolving user '$value' for document id $this->documentid. Reason: " . $userId->getMessage()); | ||
| 1201 | return $userId; | 1205 | return $userId; |
| 1202 | } | 1206 | } |
| 1203 | if (empty($userId)) | 1207 | if (empty($userId)) |
| @@ -1206,11 +1210,13 @@ class KTAPI_Document extends KTAPI_FolderItem | @@ -1206,11 +1210,13 @@ class KTAPI_Document extends KTAPI_FolderItem | ||
| 1206 | $userId = DBUtil::getResultArray($sql); | 1210 | $userId = DBUtil::getResultArray($sql); |
| 1207 | if (PEAR::isError($userId)) | 1211 | if (PEAR::isError($userId)) |
| 1208 | { | 1212 | { |
| 1213 | + $default->log->error("Problem resolving username '$value' for document id $this->documentid. Reason: " . $userId->getMessage()); | ||
| 1209 | return $userId; | 1214 | return $userId; |
| 1210 | } | 1215 | } |
| 1211 | } | 1216 | } |
| 1212 | if (empty($userId)) | 1217 | if (empty($userId)) |
| 1213 | { | 1218 | { |
| 1219 | + $default->log->error("Problem resolving user based on '$value' for document id $this->documentid. No user found"); | ||
| 1214 | // if not found, not much we can do | 1220 | // if not found, not much we can do |
| 1215 | break; | 1221 | break; |
| 1216 | } | 1222 | } |
| @@ -1221,6 +1227,7 @@ class KTAPI_Document extends KTAPI_FolderItem | @@ -1221,6 +1227,7 @@ class KTAPI_Document extends KTAPI_FolderItem | ||
| 1221 | $documents[$name] = $userId; | 1227 | $documents[$name] = $userId; |
| 1222 | break; | 1228 | break; |
| 1223 | default: | 1229 | default: |
| 1230 | + $default->log->error("Problem updating field '$name' with value '$value' for document id $this->documentid. Field is unknown."); | ||
| 1224 | // TODO: we should do some logging | 1231 | // TODO: we should do some logging |
| 1225 | //return new PEAR_Error('Unexpected field: ' . $name); | 1232 | //return new PEAR_Error('Unexpected field: ' . $name); |
| 1226 | } | 1233 | } |
| @@ -1272,7 +1279,15 @@ class KTAPI_Document extends KTAPI_FolderItem | @@ -1272,7 +1279,15 @@ class KTAPI_Document extends KTAPI_FolderItem | ||
| 1272 | if (!is_null($indexContent)) | 1279 | if (!is_null($indexContent)) |
| 1273 | { | 1280 | { |
| 1274 | $indexer = Indexer::get(); | 1281 | $indexer = Indexer::get(); |
| 1275 | - $indexer->updateDocumentIndex($this->documentid, $indexContent); | 1282 | + $result = $indexer->diagnose(); |
| 1283 | + if (empty($result)) | ||
| 1284 | + { | ||
| 1285 | + $indexer->updateDocumentIndex($this->documentid, $indexContent); | ||
| 1286 | + } | ||
| 1287 | + else | ||
| 1288 | + { | ||
| 1289 | + $default->log->error("Problem updating index with value '$value' for document id $this->documentid. Problem with indexer."); | ||
| 1290 | + } | ||
| 1276 | } | 1291 | } |
| 1277 | } | 1292 | } |
| 1278 | 1293 |
lib/discussions/DiscussionComment.inc
| @@ -7,38 +7,38 @@ | @@ -7,38 +7,38 @@ | ||
| 7 | * KnowledgeTree Open Source Edition | 7 | * KnowledgeTree Open Source Edition |
| 8 | * Document Management Made Simple | 8 | * Document Management Made Simple |
| 9 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited | 9 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited |
| 10 | - * | 10 | + * |
| 11 | * This program is free software; you can redistribute it and/or modify it under | 11 | * This program is free software; you can redistribute it and/or modify it under |
| 12 | * the terms of the GNU General Public License version 3 as published by the | 12 | * the terms of the GNU General Public License version 3 as published by the |
| 13 | * Free Software Foundation. | 13 | * Free Software Foundation. |
| 14 | - * | 14 | + * |
| 15 | * This program is distributed in the hope that it will be useful, but WITHOUT | 15 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 16 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 16 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 17 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | 17 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 18 | * details. | 18 | * details. |
| 19 | - * | 19 | + * |
| 20 | * You should have received a copy of the GNU General Public License | 20 | * You should have received a copy of the GNU General Public License |
| 21 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 21 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 22 | - * | 22 | + * |
| 23 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, | 23 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, |
| 24 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. | 24 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. |
| 25 | - * | 25 | + * |
| 26 | * The interactive user interfaces in modified source and object code versions | 26 | * The interactive user interfaces in modified source and object code versions |
| 27 | * of this program must display Appropriate Legal Notices, as required under | 27 | * of this program must display Appropriate Legal Notices, as required under |
| 28 | * Section 5 of the GNU General Public License version 3. | 28 | * Section 5 of the GNU General Public License version 3. |
| 29 | - * | 29 | + * |
| 30 | * In accordance with Section 7(b) of the GNU General Public License version 3, | 30 | * In accordance with Section 7(b) of the GNU General Public License version 3, |
| 31 | * these Appropriate Legal Notices must retain the display of the "Powered by | 31 | * these Appropriate Legal Notices must retain the display of the "Powered by |
| 32 | - * KnowledgeTree" logo and retain the original copyright notice. If the display of the | 32 | + * KnowledgeTree" logo and retain the original copyright notice. If the display of the |
| 33 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices | 33 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices |
| 34 | - * must display the words "Powered by KnowledgeTree" and retain the original | ||
| 35 | - * copyright notice. | 34 | + * must display the words "Powered by KnowledgeTree" and retain the original |
| 35 | + * copyright notice. | ||
| 36 | * Contributor( s): ______________________________________ | 36 | * Contributor( s): ______________________________________ |
| 37 | */ | 37 | */ |
| 38 | 38 | ||
| 39 | class DiscussionComment extends KTEntity { | 39 | class DiscussionComment extends KTEntity { |
| 40 | var $_bUsePearError = true; | 40 | var $_bUsePearError = true; |
| 41 | - | 41 | + |
| 42 | var $iThreadId; | 42 | var $iThreadId; |
| 43 | var $iUserId; | 43 | var $iUserId; |
| 44 | var $sSubject; | 44 | var $sSubject; |
| @@ -66,12 +66,12 @@ class DiscussionComment extends KTEntity { | @@ -66,12 +66,12 @@ class DiscussionComment extends KTEntity { | ||
| 66 | 66 | ||
| 67 | function getThreadId(){ return $this->iThreadId; } | 67 | function getThreadId(){ return $this->iThreadId; } |
| 68 | function setThreadId($iThreadId){ $this->iThreadId = $iThreadId; } | 68 | function setThreadId($iThreadId){ $this->iThreadId = $iThreadId; } |
| 69 | - function getUserId(){ return $this->iUserId; } | 69 | + function getUserId(){ return $this->iUserId; } |
| 70 | function setUserId($iNewUserId){ $this->iUserId = $iNewUserId; } | 70 | function setUserId($iNewUserId){ $this->iUserId = $iNewUserId; } |
| 71 | - function getSubject(){ return sanitizeForSQLtoHTML($this->sSubject); } | ||
| 72 | - function setSubject($sNewSubject){ $this->sSubject = sanitizeForSQL($sNewSubject); } | ||
| 73 | - function getBody(){ return sanitizeForSQLtoHTML($this->sBody); } | ||
| 74 | - function setBody($sNewBody){ $this->sBody = sanitizeForSQL($sNewBody); } | 71 | + function getSubject(){ return $this->sSubject; } |
| 72 | + function setSubject($sNewSubject){ $this->sSubject = $sNewSubject; } | ||
| 73 | + function getBody(){ return $this->sBody; } | ||
| 74 | + function setBody($sNewBody){ $this->sBody = $sNewBody; } | ||
| 75 | function getDate(){ return $this->dDate; } | 75 | function getDate(){ return $this->dDate; } |
| 76 | function getInReplyTo(){ return $this->iInReplyTo; } | 76 | function getInReplyTo(){ return $this->iInReplyTo; } |
| 77 | function setInReplyTo($sNewCommentId){ $this->iInReplyTo = $sNewCommentId; } | 77 | function setInReplyTo($sNewCommentId){ $this->iInReplyTo = $sNewCommentId; } |
lib/templating/kt3template.inc.php
| @@ -104,7 +104,13 @@ class KTPage { | @@ -104,7 +104,13 @@ class KTPage { | ||
| 104 | $aCSS = Array( | 104 | $aCSS = Array( |
| 105 | "resources/css/kt-framing.css", | 105 | "resources/css/kt-framing.css", |
| 106 | "resources/css/kt-contenttypes.css", | 106 | "resources/css/kt-contenttypes.css", |
| 107 | - "resources/css/kt-headings.css" | 107 | + "resources/css/kt-headings.css", |
| 108 | +// "thirdpartyjs/extjs/resources/css/xtheme-kt.css", | ||
| 109 | + "thirdpartyjs/extjs/resources/css/ext-all.css", | ||
| 110 | + "thirdpartyjs/extjs/examples/examples.css", | ||
| 111 | + // "thirdpartyjs/extjs/examples/menu/menu.css", | ||
| 112 | + "thirdpartyjs/extjs/examples/lib.css", | ||
| 113 | +// "skins/kt-toolbar.css" | ||
| 108 | ); | 114 | ); |
| 109 | $this->requireCSSResources($aCSS); | 115 | $this->requireCSSResources($aCSS); |
| 110 | 116 | ||
| @@ -134,9 +140,12 @@ class KTPage { | @@ -134,9 +140,12 @@ class KTPage { | ||
| 134 | $aJS[] = 'thirdpartyjs/curvycorners/rounded_corners.inc.js'; | 140 | $aJS[] = 'thirdpartyjs/curvycorners/rounded_corners.inc.js'; |
| 135 | $aJS[] = 'resources/js/loader.js'; | 141 | $aJS[] = 'resources/js/loader.js'; |
| 136 | $aJS[] = 'thirdpartyjs/yui/tools/tools.js'; | 142 | $aJS[] = 'thirdpartyjs/yui/tools/tools.js'; |
| 137 | - $aJS[] = 'thirdpartyjs/yui/connection/connection.js'; | ||
| 138 | - | 143 | + $aJS[] = 'thirdpartyjs/yui/connection/connection-min.js'; |
| 139 | 144 | ||
| 145 | + $aJS[] = 'thirdpartyjs/extjs/adapter/ext/ext-base.js'; | ||
| 146 | + $aJS[] = 'thirdpartyjs/extjs/ext-all.js'; | ||
| 147 | + $aJS[] = 'thirdpartyjs/extjs/examples/examples.js'; | ||
| 148 | + $aJS[] = 'resources/js/search2widget.js'; | ||
| 140 | 149 | ||
| 141 | //$aJS[] = 'thirdpartyjs/MochiKit/.js'; | 150 | //$aJS[] = 'thirdpartyjs/MochiKit/.js'; |
| 142 | //$aJS[] = 'resources/js/translate.js'; | 151 | //$aJS[] = 'resources/js/translate.js'; |
lib/templating/smartytemplate.inc.php
| @@ -90,14 +90,14 @@ class KTSmartyTemplate extends KTTemplate { | @@ -90,14 +90,14 @@ class KTSmartyTemplate extends KTTemplate { | ||
| 90 | $search2_quickQuery = trim($_SESSION['search2_quickQuery']); | 90 | $search2_quickQuery = trim($_SESSION['search2_quickQuery']); |
| 91 | if ($search2_quickQuery == '') | 91 | if ($search2_quickQuery == '') |
| 92 | { | 92 | { |
| 93 | - $search2_quickQuery = _kt('Enter search criteria'); | 93 | + $search2_quickQuery = ''; |
| 94 | } | 94 | } |
| 95 | } | 95 | } |
| 96 | else | 96 | else |
| 97 | { | 97 | { |
| 98 | $search2_quick=0; | 98 | $search2_quick=0; |
| 99 | $search2_general=1; | 99 | $search2_general=1; |
| 100 | - $search2_quickQuery = _kt('Enter search criteria'); | 100 | + $search2_quickQuery = ''; |
| 101 | $_SESSION['search2_quick'] = $search2_quick; | 101 | $_SESSION['search2_quick'] = $search2_quick; |
| 102 | $_SESSION['search2_general'] = $search2_general; | 102 | $_SESSION['search2_general'] = $search2_general; |
| 103 | $_SESSION['search2_quickQuery'] = ''; | 103 | $_SESSION['search2_quickQuery'] = ''; |
plugins/housekeeper/FolderUsageDashlet.inc.php
| @@ -151,7 +151,15 @@ class FolderUsageDashlet extends KTBaseDashlet | @@ -151,7 +151,15 @@ class FolderUsageDashlet extends KTBaseDashlet | ||
| 151 | $oRegistry =& KTPluginRegistry::getSingleton(); | 151 | $oRegistry =& KTPluginRegistry::getSingleton(); |
| 152 | $oPlugin =& $oRegistry->getPlugin('ktcore.housekeeper.plugin'); | 152 | $oPlugin =& $oRegistry->getPlugin('ktcore.housekeeper.plugin'); |
| 153 | 153 | ||
| 154 | + $config = KTConfig::getSingleton(); | ||
| 155 | + $rootUrl = $config->get('KnowledgeTree/rootUrl'); | ||
| 156 | + | ||
| 154 | $dispatcherURL = $oPlugin->getURLPath('HouseKeeperDispatcher.php'); | 157 | $dispatcherURL = $oPlugin->getURLPath('HouseKeeperDispatcher.php'); |
| 158 | + if (!empty($rootUrl)) $dispatcherURL .= $rootUrl . $dispatcherURL; | ||
| 159 | + if (substr($dispatcherURL, 0,1 ) == '/') | ||
| 160 | + { | ||
| 161 | + $dispatcherURL = substr($dispatcherURL,1); | ||
| 162 | + } | ||
| 155 | 163 | ||
| 156 | $this->getUsage(); | 164 | $this->getUsage(); |
| 157 | 165 |
plugins/ktcore/KTBulkActions.php
| @@ -606,9 +606,9 @@ class KTBrowseBulkExportAction extends KTBulkAction { | @@ -606,9 +606,9 @@ class KTBrowseBulkExportAction extends KTBulkAction { | ||
| 606 | $this->commitTransaction(); | 606 | $this->commitTransaction(); |
| 607 | 607 | ||
| 608 | $url = KTUtil::addQueryStringSelf(sprintf('action=downloadZipFile&fFolderId=%d&exportcode=%s', $this->oFolder->getId(), $sExportCode)); | 608 | $url = KTUtil::addQueryStringSelf(sprintf('action=downloadZipFile&fFolderId=%d&exportcode=%s', $this->oFolder->getId(), $sExportCode)); |
| 609 | - $str = sprintf('<p>' . _kt('Go <a href="%s">here</a> to download the zip file if you are not automatically redirected there') . "</p>\n", $url); | 609 | + $str = sprintf('<p>' . _kt('Your download will begin shortly. If you are not automatically redirected to your download, please click <a href="%s">here</a> ') . "</p>\n", $url); |
| 610 | $folderurl = KTBrowseUtil::getUrlForFolder($this->oFolder); | 610 | $folderurl = KTBrowseUtil::getUrlForFolder($this->oFolder); |
| 611 | - $str .= sprintf('<p>' . _kt('Once downloaded, return to the original <a href="%s">folder</a>') . "</p>\n", $folderurl); | 611 | + $str .= sprintf('<p>' . _kt('Once your download is complete, click <a href="%s">here</a> to return to the original folder') . "</p>\n", $folderurl); |
| 612 | //$str .= sprintf("</div></div></body></html>\n"); | 612 | //$str .= sprintf("</div></div></body></html>\n"); |
| 613 | $str .= sprintf('<script language="JavaScript"> | 613 | $str .= sprintf('<script language="JavaScript"> |
| 614 | function kt_bulkexport_redirect() { | 614 | function kt_bulkexport_redirect() { |
plugins/ktstandard/KTBulkExportPlugin.php
| @@ -154,7 +154,7 @@ class KTBulkExportAction extends KTFolderAction { | @@ -154,7 +154,7 @@ class KTBulkExportAction extends KTFolderAction { | ||
| 154 | )); | 154 | )); |
| 155 | 155 | ||
| 156 | $url = KTUtil::addQueryStringSelf(sprintf('action=downloadZipFile&fFolderId=%d&exportcode=%s', $this->oFolder->getId(), $sExportCode)); | 156 | $url = KTUtil::addQueryStringSelf(sprintf('action=downloadZipFile&fFolderId=%d&exportcode=%s', $this->oFolder->getId(), $sExportCode)); |
| 157 | - printf('<p>' . _kt('Your download will begin shortly. If you are not automatically redirected to download the zip file, click <a href="%s">here</a> ') . "</p>\n", $url); | 157 | + printf('<p>' . _kt('Your download will begin shortly. If you are not automatically redirected to your download, please click <a href="%s">here</a> ') . "</p>\n", $url); |
| 158 | $folderurl = KTBrowseUtil::getUrlForFolder($this->oFolder); | 158 | $folderurl = KTBrowseUtil::getUrlForFolder($this->oFolder); |
| 159 | printf('<p>' . _kt('Once your download is complete, click <a href="%s">here</a> to return to the original folder') . "</p>\n", $folderurl); | 159 | printf('<p>' . _kt('Once your download is complete, click <a href="%s">here</a> to return to the original folder') . "</p>\n", $folderurl); |
| 160 | printf("</div></div></body></html>\n"); | 160 | printf("</div></div></body></html>\n"); |
plugins/ktstandard/KTDisclaimers.php
| @@ -5,32 +5,32 @@ | @@ -5,32 +5,32 @@ | ||
| 5 | * KnowledgeTree Open Source Edition | 5 | * KnowledgeTree Open Source Edition |
| 6 | * Document Management Made Simple | 6 | * Document Management Made Simple |
| 7 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited | 7 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited |
| 8 | - * | 8 | + * |
| 9 | * This program is free software; you can redistribute it and/or modify it under | 9 | * This program is free software; you can redistribute it and/or modify it under |
| 10 | * the terms of the GNU General Public License version 3 as published by the | 10 | * the terms of the GNU General Public License version 3 as published by the |
| 11 | * Free Software Foundation. | 11 | * Free Software Foundation. |
| 12 | - * | 12 | + * |
| 13 | * This program is distributed in the hope that it will be useful, but WITHOUT | 13 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | 15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 16 | * details. | 16 | * details. |
| 17 | - * | 17 | + * |
| 18 | * You should have received a copy of the GNU General Public License | 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 | - * | 20 | + * |
| 21 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, | 21 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, |
| 22 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. | 22 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. |
| 23 | - * | 23 | + * |
| 24 | * The interactive user interfaces in modified source and object code versions | 24 | * The interactive user interfaces in modified source and object code versions |
| 25 | * of this program must display Appropriate Legal Notices, as required under | 25 | * of this program must display Appropriate Legal Notices, as required under |
| 26 | * Section 5 of the GNU General Public License version 3. | 26 | * Section 5 of the GNU General Public License version 3. |
| 27 | - * | 27 | + * |
| 28 | * In accordance with Section 7(b) of the GNU General Public License version 3, | 28 | * In accordance with Section 7(b) of the GNU General Public License version 3, |
| 29 | * these Appropriate Legal Notices must retain the display of the "Powered by | 29 | * these Appropriate Legal Notices must retain the display of the "Powered by |
| 30 | - * KnowledgeTree" logo and retain the original copyright notice. If the display of the | 30 | + * KnowledgeTree" logo and retain the original copyright notice. If the display of the |
| 31 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices | 31 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices |
| 32 | - * must display the words "Powered by KnowledgeTree" and retain the original | ||
| 33 | - * copyright notice. | 32 | + * must display the words "Powered by KnowledgeTree" and retain the original |
| 33 | + * copyright notice. | ||
| 34 | * Contributor( s): ______________________________________ | 34 | * Contributor( s): ______________________________________ |
| 35 | * | 35 | * |
| 36 | */ | 36 | */ |
| @@ -50,7 +50,7 @@ class KTDisclaimersPlugin extends KTPlugin { | @@ -50,7 +50,7 @@ class KTDisclaimersPlugin extends KTPlugin { | ||
| 50 | $res = parent::KTPlugin($sFilename); | 50 | $res = parent::KTPlugin($sFilename); |
| 51 | $this->sFriendlyName = _kt('Disclaimers Plugin'); | 51 | $this->sFriendlyName = _kt('Disclaimers Plugin'); |
| 52 | return $res; | 52 | return $res; |
| 53 | - } | 53 | + } |
| 54 | 54 | ||
| 55 | function setup() { | 55 | function setup() { |
| 56 | $this->setupAdmin(); | 56 | $this->setupAdmin(); |
| @@ -67,25 +67,25 @@ class KTDisclaimersPlugin extends KTPlugin { | @@ -67,25 +67,25 @@ class KTDisclaimersPlugin extends KTPlugin { | ||
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | function getDisclaimer($sLocation) { | 69 | function getDisclaimer($sLocation) { |
| 70 | - $sDisclaimer = false; | 70 | + $sDisclaimer = false; |
| 71 | + | ||
| 72 | + if($this->isRegistered()) { | ||
| 73 | + $aHelp = KTHelp::getHelpInfo($sLocation); | ||
| 71 | 74 | ||
| 72 | - if($this->isRegistered()) { | ||
| 73 | - $aHelp = KTHelp::getHelpInfo($sLocation); | ||
| 74 | - | ||
| 75 | - if(!PEAR::isError($aHelp) && strlen(trim($aHelp['body']))) { | ||
| 76 | - $sDisclaimer = $aHelp['body']; | ||
| 77 | - } | ||
| 78 | - } | 75 | + if(!PEAR::isError($aHelp) && strlen(trim($aHelp['body']))) { |
| 76 | + $sDisclaimer = str_replace('\r\n', '<br>', $aHelp['body']); | ||
| 77 | + } | ||
| 78 | + } | ||
| 79 | 79 | ||
| 80 | - return $sDisclaimer; | 80 | + return $sDisclaimer; |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | function getPageDisclaimer() { | 83 | function getPageDisclaimer() { |
| 84 | - return $this->getDisclaimer($this->aDisclaimers['page']['path']); | 84 | + return $this->getDisclaimer($this->aDisclaimers['page']['path']); |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | function getLoginDisclaimer() { | 87 | function getLoginDisclaimer() { |
| 88 | - return $this->getDisclaimer($this->aDisclaimers['login']['path']); | 88 | + return $this->getDisclaimer($this->aDisclaimers['login']['path']); |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | } | 91 | } |
plugins/ktstandard/KTDiscussion.php
| @@ -5,32 +5,32 @@ | @@ -5,32 +5,32 @@ | ||
| 5 | * KnowledgeTree Open Source Edition | 5 | * KnowledgeTree Open Source Edition |
| 6 | * Document Management Made Simple | 6 | * Document Management Made Simple |
| 7 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited | 7 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited |
| 8 | - * | 8 | + * |
| 9 | * This program is free software; you can redistribute it and/or modify it under | 9 | * This program is free software; you can redistribute it and/or modify it under |
| 10 | * the terms of the GNU General Public License version 3 as published by the | 10 | * the terms of the GNU General Public License version 3 as published by the |
| 11 | * Free Software Foundation. | 11 | * Free Software Foundation. |
| 12 | - * | 12 | + * |
| 13 | * This program is distributed in the hope that it will be useful, but WITHOUT | 13 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | 15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 16 | * details. | 16 | * details. |
| 17 | - * | 17 | + * |
| 18 | * You should have received a copy of the GNU General Public License | 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 | - * | 20 | + * |
| 21 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, | 21 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, |
| 22 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. | 22 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. |
| 23 | - * | 23 | + * |
| 24 | * The interactive user interfaces in modified source and object code versions | 24 | * The interactive user interfaces in modified source and object code versions |
| 25 | * of this program must display Appropriate Legal Notices, as required under | 25 | * of this program must display Appropriate Legal Notices, as required under |
| 26 | * Section 5 of the GNU General Public License version 3. | 26 | * Section 5 of the GNU General Public License version 3. |
| 27 | - * | 27 | + * |
| 28 | * In accordance with Section 7(b) of the GNU General Public License version 3, | 28 | * In accordance with Section 7(b) of the GNU General Public License version 3, |
| 29 | * these Appropriate Legal Notices must retain the display of the "Powered by | 29 | * these Appropriate Legal Notices must retain the display of the "Powered by |
| 30 | - * KnowledgeTree" logo and retain the original copyright notice. If the display of the | 30 | + * KnowledgeTree" logo and retain the original copyright notice. If the display of the |
| 31 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices | 31 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices |
| 32 | - * must display the words "Powered by KnowledgeTree" and retain the original | ||
| 33 | - * copyright notice. | 32 | + * must display the words "Powered by KnowledgeTree" and retain the original |
| 33 | + * copyright notice. | ||
| 34 | * Contributor( s): ______________________________________ | 34 | * Contributor( s): ______________________________________ |
| 35 | * | 35 | * |
| 36 | */ | 36 | */ |
| @@ -136,12 +136,12 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | @@ -136,12 +136,12 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | ||
| 136 | $fields[] = new KTStringWidget(_kt("Subject"), _kt("The topic of discussion in this thread"), "subject", "", $this->oPage, true); | 136 | $fields[] = new KTStringWidget(_kt("Subject"), _kt("The topic of discussion in this thread"), "subject", "", $this->oPage, true); |
| 137 | $fields[] = new KTTextWidget(_kt("Body"), _kt("Your contribution to the discussion in this thread"), "body", "", $this->oPage, true, null, null, array("cols" => 50, "rows" => 10)); | 137 | $fields[] = new KTTextWidget(_kt("Body"), _kt("Your contribution to the discussion in this thread"), "body", "", $this->oPage, true, null, null, array("cols" => 50, "rows" => 10)); |
| 138 | 138 | ||
| 139 | - $bIncludeClosed = KTUtil::arrayGet($_REQUEST, 'fIncludeClosed', false); | 139 | + $bIncludeClosed = KTUtil::arrayGet($_REQUEST, 'fIncludeClosed', false); |
| 140 | 140 | ||
| 141 | - $sQuery = sprintf('document_id = %d', $this->oDocument->getId()); | ||
| 142 | - if(!$bIncludeClosed) { | ||
| 143 | - $sQuery .= sprintf(' AND state != %d', DISCUSSION_CLOSED); | ||
| 144 | - } | 141 | + $sQuery = sprintf('document_id = %d', $this->oDocument->getId()); |
| 142 | + if(!$bIncludeClosed) { | ||
| 143 | + $sQuery .= sprintf(' AND state != %d', DISCUSSION_CLOSED); | ||
| 144 | + } | ||
| 145 | 145 | ||
| 146 | $threads = DiscussionThread::getList($sQuery); | 146 | $threads = DiscussionThread::getList($sQuery); |
| 147 | $sQuery2 = sprintf('document_id = %d AND state = %d', $this->oDocument->getId(), DISCUSSION_CLOSED); | 147 | $sQuery2 = sprintf('document_id = %d AND state = %d', $this->oDocument->getId(), DISCUSSION_CLOSED); |
| @@ -183,8 +183,8 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | @@ -183,8 +183,8 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | ||
| 183 | $oComment = DiscussionComment::createFromArray(array( | 183 | $oComment = DiscussionComment::createFromArray(array( |
| 184 | 'threadid' => $oThread->getId(), | 184 | 'threadid' => $oThread->getId(), |
| 185 | 'userid' => $this->oUser->getId(), | 185 | 'userid' => $this->oUser->getId(), |
| 186 | - 'subject' => sanitizeForSQL($sSubject), | ||
| 187 | - 'body' => sanitizeForSQL(KTUtil::formatPlainText($sBody)), | 186 | + 'subject' => $sSubject, |
| 187 | + 'body' => KTUtil::formatPlainText($sBody), | ||
| 188 | )); | 188 | )); |
| 189 | $aErrorOptions['message'] = _kt("There was an error adding the comment to the thread"); | 189 | $aErrorOptions['message'] = _kt("There was an error adding the comment to the thread"); |
| 190 | $this->oValidator->notError($oComment, $aErrorOptions); | 190 | $this->oValidator->notError($oComment, $aErrorOptions); |
| @@ -315,8 +315,8 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | @@ -315,8 +315,8 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | ||
| 315 | $oComment = DiscussionComment::createFromArray(array( | 315 | $oComment = DiscussionComment::createFromArray(array( |
| 316 | 'threadid' => $oThread->getId(), | 316 | 'threadid' => $oThread->getId(), |
| 317 | 'userid' => $this->oUser->getId(), | 317 | 'userid' => $this->oUser->getId(), |
| 318 | - 'subject' => sanitizeForSQL($sSubject), | ||
| 319 | - 'body' => sanitizeForSQL(KTUtil::formatPlainText($sBody)), | 318 | + 'subject' => $sSubject, |
| 319 | + 'body' => KTUtil::formatPlainText($sBody), | ||
| 320 | )); | 320 | )); |
| 321 | $aErrorOptions['message'] = _kt("There was an error adding the comment to the thread"); | 321 | $aErrorOptions['message'] = _kt("There was an error adding the comment to the thread"); |
| 322 | $this->oValidator->notError($oComment, $aErrorOptions); | 322 | $this->oValidator->notError($oComment, $aErrorOptions); |
| @@ -378,7 +378,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | @@ -378,7 +378,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | ||
| 378 | ); | 378 | ); |
| 379 | 379 | ||
| 380 | $oPermission =& KTPermission::getByName('ktcore.permissions.workflow'); | 380 | $oPermission =& KTPermission::getByName('ktcore.permissions.workflow'); |
| 381 | - $sRedirectTo = implode('&', $aErrorOptions['redirect_to']); | 381 | + $sRedirectTo = implode('&', $aErrorOptions['redirect_to']); |
| 382 | 382 | ||
| 383 | if (PEAR::isError($oPermission)) { | 383 | if (PEAR::isError($oPermission)) { |
| 384 | $this->errorRedirectTo($sRedirectTo, _kt("Error getting permission")); | 384 | $this->errorRedirectTo($sRedirectTo, _kt("Error getting permission")); |
| @@ -389,30 +389,30 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | @@ -389,30 +389,30 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | ||
| 389 | exit(0); | 389 | exit(0); |
| 390 | } | 390 | } |
| 391 | 391 | ||
| 392 | - $iStateId = KTUtil::arrayGet($_REQUEST, 'state'); | ||
| 393 | - if(!in_array($iStateId, $this->aTransitions[$oThread->getState()])) { | ||
| 394 | - $this->errorRedirectTo($sRedirectTo, _kt("Invalid transition")); | ||
| 395 | - exit(0); | ||
| 396 | - } | 392 | + $iStateId = KTUtil::arrayGet($_REQUEST, 'state'); |
| 393 | + if(!in_array($iStateId, $this->aTransitions[$oThread->getState()])) { | ||
| 394 | + $this->errorRedirectTo($sRedirectTo, _kt("Invalid transition")); | ||
| 395 | + exit(0); | ||
| 396 | + } | ||
| 397 | 397 | ||
| 398 | - $aErrorOptions['message'] = _kt("No reason provided"); | ||
| 399 | - $sReason = sanitizeForSQL($this->oValidator->validateString(KTUtil::arrayGet($_REQUEST, 'reason'), $aErrorOptions)); | 398 | + $aErrorOptions['message'] = _kt("No reason provided"); |
| 399 | + $sReason = $this->oValidator->validateString(KTUtil::arrayGet($_REQUEST, 'reason'), $aErrorOptions); | ||
| 400 | 400 | ||
| 401 | - if($iStateId > $oThread->getState()) { | ||
| 402 | - $sTransactionNamespace = 'ktcore.transactions.collaboration_step_approve'; | ||
| 403 | - } else { | ||
| 404 | - $sTransactionNamespace = 'ktcore.transactions.collaboration_step_rollback'; | ||
| 405 | - } | 401 | + if($iStateId > $oThread->getState()) { |
| 402 | + $sTransactionNamespace = 'ktcore.transactions.collaboration_step_approve'; | ||
| 403 | + } else { | ||
| 404 | + $sTransactionNamespace = 'ktcore.transactions.collaboration_step_rollback'; | ||
| 405 | + } | ||
| 406 | 406 | ||
| 407 | // Start the transaction comment creation | 407 | // Start the transaction comment creation |
| 408 | $this->startTransaction(); | 408 | $this->startTransaction(); |
| 409 | 409 | ||
| 410 | $oThread->setState($iStateId); | 410 | $oThread->setState($iStateId); |
| 411 | - if($iStateId == DISCUSSION_CLOSED) { | ||
| 412 | - $oThread->setCloseMetadataVersion($this->oDocument->getMetadataVersion()); | ||
| 413 | - } else if($iStateId == DISCUSSION_CONCLUSION) { | ||
| 414 | - $oThread->setCloseReason($sReason); | ||
| 415 | - } | 411 | + if($iStateId == DISCUSSION_CLOSED) { |
| 412 | + $oThread->setCloseMetadataVersion($this->oDocument->getMetadataVersion()); | ||
| 413 | + } else if($iStateId == DISCUSSION_CONCLUSION) { | ||
| 414 | + $oThread->setCloseReason($sReason); | ||
| 415 | + } | ||
| 416 | 416 | ||
| 417 | $oDocumentTransaction = new DocumentTransaction($this->oDocument, $sReason, $sTransactionNamespace); | 417 | $oDocumentTransaction = new DocumentTransaction($this->oDocument, $sReason, $sTransactionNamespace); |
| 418 | $oDocumentTransaction->create(); | 418 | $oDocumentTransaction->create(); |
| @@ -429,9 +429,6 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | @@ -429,9 +429,6 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | ||
| 429 | exit(0); | 429 | exit(0); |
| 430 | } | 430 | } |
| 431 | 431 | ||
| 432 | - | ||
| 433 | - | ||
| 434 | - | ||
| 435 | function &_buildStates(&$oThread) { | 432 | function &_buildStates(&$oThread) { |
| 436 | $iCurState = $oThread->getState(); | 433 | $iCurState = $oThread->getState(); |
| 437 | $aTransitions = $this->aTransitions[$iCurState]; | 434 | $aTransitions = $this->aTransitions[$iCurState]; |
| @@ -450,3 +447,4 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | @@ -450,3 +447,4 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | ||
| 450 | 447 | ||
| 451 | 448 | ||
| 452 | } | 449 | } |
| 450 | +?> | ||
| 453 | \ No newline at end of file | 451 | \ No newline at end of file |
plugins/ktstandard/contents/BaseIndexer.php
| @@ -147,6 +147,7 @@ class KTBaseIndexerTrigger { | @@ -147,6 +147,7 @@ class KTBaseIndexerTrigger { | ||
| 147 | $cmdline[] = $sFilename; | 147 | $cmdline[] = $sFilename; |
| 148 | 148 | ||
| 149 | $aOptions = array(); | 149 | $aOptions = array(); |
| 150 | + $aOptions['exec_wait'] = 'true'; | ||
| 150 | if ($this->use_pipes) { | 151 | if ($this->use_pipes) { |
| 151 | $aOptions["append"] = $sTempFilename; | 152 | $aOptions["append"] = $sTempFilename; |
| 152 | } else { | 153 | } else { |
plugins/ktstandard/contents/OpenDocumentIndexer.php
| @@ -118,7 +118,10 @@ class KTOpenDocumentIndexerTrigger extends KTBaseIndexerTrigger { | @@ -118,7 +118,10 @@ class KTOpenDocumentIndexerTrigger extends KTBaseIndexerTrigger { | ||
| 118 | if (empty($sUnzipCommand)) { | 118 | if (empty($sUnzipCommand)) { |
| 119 | return; | 119 | return; |
| 120 | } | 120 | } |
| 121 | - $this->sTmpPath = tempnam('/tmp', 'opendocumentextract'); | 121 | + $oKTConfig =& KTConfig::getSingleton(); |
| 122 | + $sBasedir = $oKTConfig->get("urls/tmpDirectory"); | ||
| 123 | + | ||
| 124 | + $this->sTmpPath = tempnam($sBasedir, 'opendocumentextract'); | ||
| 122 | if ($this->sTmpPath === false) { | 125 | if ($this->sTmpPath === false) { |
| 123 | return; | 126 | return; |
| 124 | } | 127 | } |
| @@ -131,14 +134,20 @@ class KTOpenDocumentIndexerTrigger extends KTBaseIndexerTrigger { | @@ -131,14 +134,20 @@ class KTOpenDocumentIndexerTrigger extends KTBaseIndexerTrigger { | ||
| 131 | "-d", $this->sTmpPath, | 134 | "-d", $this->sTmpPath, |
| 132 | $sFilename, | 135 | $sFilename, |
| 133 | ); | 136 | ); |
| 134 | - KTUtil::pexec($sCmd); | 137 | + KTUtil::pexec($sCmd, array('exec_wait' => 'true')); |
| 135 | 138 | ||
| 136 | $sManifest = sprintf("%s/%s", $this->sTmpPath, "META-INF/manifest.xml"); | 139 | $sManifest = sprintf("%s/%s", $this->sTmpPath, "META-INF/manifest.xml"); |
| 140 | + if (OS_WINDOWS) { | ||
| 141 | + $sManifest = str_replace( '/','\\',$sManifest); | ||
| 142 | + } | ||
| 137 | if (!file_exists($sManifest)) { | 143 | if (!file_exists($sManifest)) { |
| 138 | $this->cleanup(); | 144 | $this->cleanup(); |
| 139 | return; | 145 | return; |
| 140 | } | 146 | } |
| 141 | $sContentFile = sprintf("%s/%s", $this->sTmpPath, "content.xml"); | 147 | $sContentFile = sprintf("%s/%s", $this->sTmpPath, "content.xml"); |
| 148 | + if (OS_WINDOWS) { | ||
| 149 | + $sContentFile = str_replace( '/','\\',$sContentFile ); | ||
| 150 | + } | ||
| 142 | if (!file_exists($sContentFile)) { | 151 | if (!file_exists($sContentFile)) { |
| 143 | $this->cleanup(); | 152 | $this->cleanup(); |
| 144 | return; | 153 | return; |
| @@ -152,7 +161,8 @@ class KTOpenDocumentIndexerTrigger extends KTBaseIndexerTrigger { | @@ -152,7 +161,8 @@ class KTOpenDocumentIndexerTrigger extends KTBaseIndexerTrigger { | ||
| 152 | } | 161 | } |
| 153 | 162 | ||
| 154 | function cleanup() { | 163 | function cleanup() { |
| 155 | - KTUtil::deleteDirectory($this->sTmpPath); | 164 | + return; |
| 165 | + //KTUtil::deleteDirectory($this->sTmpPath); | ||
| 156 | } | 166 | } |
| 157 | } | 167 | } |
| 158 | 168 |
plugins/ktstandard/contents/WordIndexer.php
| @@ -51,12 +51,35 @@ class KTWordIndexerTrigger extends KTBaseIndexerTrigger { | @@ -51,12 +51,35 @@ class KTWordIndexerTrigger extends KTBaseIndexerTrigger { | ||
| 51 | $this->command = 'c:\antiword\antiword.exe'; | 51 | $this->command = 'c:\antiword\antiword.exe'; |
| 52 | $this->commandconfig = 'indexer/antiword'; | 52 | $this->commandconfig = 'indexer/antiword'; |
| 53 | $this->args = array(); | 53 | $this->args = array(); |
| 54 | + } | ||
| 55 | + putenv('LANG=en_US.UTF-8'); | ||
| 56 | + | ||
| 57 | + $sCommand = KTUtil::findCommand($this->commandconfig, $this->command); | ||
| 58 | + if (empty($sCommand)) { | ||
| 59 | + return false; | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + if (OS_WINDOWS) { | ||
| 63 | + $sDir = dirname(dirname($sCommand)); | ||
| 64 | + putenv('HOME=' . $sDir); | ||
| 54 | 65 | ||
| 55 | - $sCommand = KTUtil::findCommand($this->commandconfig, $this->command); | ||
| 56 | - $sDir = dirname(dirname($sCommand)); | ||
| 57 | - putenv('HOME=' . $sDir); | 66 | + $cmdline = array($sCommand); |
| 67 | + $cmdline = kt_array_merge($cmdline, $this->args); | ||
| 68 | + $cmdline[] = $sFilename; | ||
| 69 | + | ||
| 70 | + $sCmd = KTUtil::safeShellString($cmdline); | ||
| 71 | + $sCmd .= " >> " . escapeshellarg($sTempFilename); | ||
| 72 | + | ||
| 73 | + $sCmd = str_replace( '/','\\',$sCmd); | ||
| 74 | + | ||
| 75 | + $sCmd = "start /b \"kt\" " . $sCmd; | ||
| 76 | + | ||
| 77 | + pclose(popen($sCmd, 'r')); | ||
| 78 | + | ||
| 79 | + $this->aCommandOutput = 1; | ||
| 80 | + $contents = file_get_contents($sTempFilename); | ||
| 81 | + return $contents; | ||
| 58 | } | 82 | } |
| 59 | - putenv('LANG=en_US.UTF-8'); | ||
| 60 | return parent::extract_contents($sFilename, $sTempFilename); | 83 | return parent::extract_contents($sFilename, $sTempFilename); |
| 61 | } | 84 | } |
| 62 | 85 |
plugins/ktstandard/ldap/activedirectoryauthenticationprovider.inc.php
| @@ -5,32 +5,32 @@ | @@ -5,32 +5,32 @@ | ||
| 5 | * KnowledgeTree Open Source Edition | 5 | * KnowledgeTree Open Source Edition |
| 6 | * Document Management Made Simple | 6 | * Document Management Made Simple |
| 7 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited | 7 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited |
| 8 | - * | 8 | + * |
| 9 | * This program is free software; you can redistribute it and/or modify it under | 9 | * This program is free software; you can redistribute it and/or modify it under |
| 10 | * the terms of the GNU General Public License version 3 as published by the | 10 | * the terms of the GNU General Public License version 3 as published by the |
| 11 | * Free Software Foundation. | 11 | * Free Software Foundation. |
| 12 | - * | 12 | + * |
| 13 | * This program is distributed in the hope that it will be useful, but WITHOUT | 13 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | 15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 16 | * details. | 16 | * details. |
| 17 | - * | 17 | + * |
| 18 | * You should have received a copy of the GNU General Public License | 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 | - * | 20 | + * |
| 21 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, | 21 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, |
| 22 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. | 22 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. |
| 23 | - * | 23 | + * |
| 24 | * The interactive user interfaces in modified source and object code versions | 24 | * The interactive user interfaces in modified source and object code versions |
| 25 | * of this program must display Appropriate Legal Notices, as required under | 25 | * of this program must display Appropriate Legal Notices, as required under |
| 26 | * Section 5 of the GNU General Public License version 3. | 26 | * Section 5 of the GNU General Public License version 3. |
| 27 | - * | 27 | + * |
| 28 | * In accordance with Section 7(b) of the GNU General Public License version 3, | 28 | * In accordance with Section 7(b) of the GNU General Public License version 3, |
| 29 | * these Appropriate Legal Notices must retain the display of the "Powered by | 29 | * these Appropriate Legal Notices must retain the display of the "Powered by |
| 30 | - * KnowledgeTree" logo and retain the original copyright notice. If the display of the | 30 | + * KnowledgeTree" logo and retain the original copyright notice. If the display of the |
| 31 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices | 31 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices |
| 32 | - * must display the words "Powered by KnowledgeTree" and retain the original | ||
| 33 | - * copyright notice. | 32 | + * must display the words "Powered by KnowledgeTree" and retain the original |
| 33 | + * copyright notice. | ||
| 34 | * Contributor( s): ______________________________________ | 34 | * Contributor( s): ______________________________________ |
| 35 | * | 35 | * |
| 36 | */ | 36 | */ |
| @@ -40,20 +40,21 @@ require_once(KT_LIB_DIR . '/authentication/Authenticator.inc'); | @@ -40,20 +40,21 @@ require_once(KT_LIB_DIR . '/authentication/Authenticator.inc'); | ||
| 40 | require_once(KT_DIR . '/plugins/ktstandard/ldap/ldapbaseauthenticationprovider.inc.php'); | 40 | require_once(KT_DIR . '/plugins/ktstandard/ldap/ldapbaseauthenticationprovider.inc.php'); |
| 41 | 41 | ||
| 42 | class KTActiveDirectoryAuthenticationProvider extends KTLDAPBaseAuthenticationProvider { | 42 | class KTActiveDirectoryAuthenticationProvider extends KTLDAPBaseAuthenticationProvider { |
| 43 | - var $sNamespace = "ktstandard.authentication.adprovider"; | 43 | + var $sNamespace = 'ktstandard.authentication.adprovider'; |
| 44 | 44 | ||
| 45 | var $bGroupSource = true; | 45 | var $bGroupSource = true; |
| 46 | 46 | ||
| 47 | - var $sAuthenticatorClass = "KTActiveDirectoryAuthenticator"; | ||
| 48 | - var $aAttributes = array ("cn", "samaccountname", "givenname", "sn", "userprincipalname", "telephonenumber"); | 47 | + var $sAuthenticatorClass = 'KTActiveDirectoryAuthenticator'; |
| 48 | + var $aAttributes = array ('cn', 'samaccountname', 'givenname', 'sn', 'mail', 'telephonenumber', 'userprincipalname'); | ||
| 49 | 49 | ||
| 50 | function KTActiveDirectoryAuthenticationProvider() { | 50 | function KTActiveDirectoryAuthenticationProvider() { |
| 51 | - $this->sName = _kt("ActiveDirectory authentication provider"); | 51 | + $this->sName = _kt('ActiveDirectory authentication provider'); |
| 52 | parent::KTLDAPBaseAuthenticationProvider(); | 52 | parent::KTLDAPBaseAuthenticationProvider(); |
| 53 | } | 53 | } |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | class KTActiveDirectoryAuthenticator extends KTLDAPBaseAuthenticator { | 56 | class KTActiveDirectoryAuthenticator extends KTLDAPBaseAuthenticator { |
| 57 | - var $aAttributes = array ("cn", "samaccountname", "givenname", "sn", "userprincipalname", "telephonenumber"); | 57 | + var $aAttributes = array ('cn', 'samaccountname', 'givenname', 'sn', 'mail', 'telephonenumber', 'userprincipalname'); |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | +?> | ||
| 60 | \ No newline at end of file | 61 | \ No newline at end of file |
plugins/ktstandard/ldap/ldapauthenticationprovider.inc.php
| @@ -5,32 +5,32 @@ | @@ -5,32 +5,32 @@ | ||
| 5 | * KnowledgeTree Open Source Edition | 5 | * KnowledgeTree Open Source Edition |
| 6 | * Document Management Made Simple | 6 | * Document Management Made Simple |
| 7 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited | 7 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited |
| 8 | - * | 8 | + * |
| 9 | * This program is free software; you can redistribute it and/or modify it under | 9 | * This program is free software; you can redistribute it and/or modify it under |
| 10 | * the terms of the GNU General Public License version 3 as published by the | 10 | * the terms of the GNU General Public License version 3 as published by the |
| 11 | * Free Software Foundation. | 11 | * Free Software Foundation. |
| 12 | - * | 12 | + * |
| 13 | * This program is distributed in the hope that it will be useful, but WITHOUT | 13 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | 15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 16 | * details. | 16 | * details. |
| 17 | - * | 17 | + * |
| 18 | * You should have received a copy of the GNU General Public License | 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 | - * | 20 | + * |
| 21 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, | 21 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, |
| 22 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. | 22 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. |
| 23 | - * | 23 | + * |
| 24 | * The interactive user interfaces in modified source and object code versions | 24 | * The interactive user interfaces in modified source and object code versions |
| 25 | * of this program must display Appropriate Legal Notices, as required under | 25 | * of this program must display Appropriate Legal Notices, as required under |
| 26 | * Section 5 of the GNU General Public License version 3. | 26 | * Section 5 of the GNU General Public License version 3. |
| 27 | - * | 27 | + * |
| 28 | * In accordance with Section 7(b) of the GNU General Public License version 3, | 28 | * In accordance with Section 7(b) of the GNU General Public License version 3, |
| 29 | * these Appropriate Legal Notices must retain the display of the "Powered by | 29 | * these Appropriate Legal Notices must retain the display of the "Powered by |
| 30 | - * KnowledgeTree" logo and retain the original copyright notice. If the display of the | 30 | + * KnowledgeTree" logo and retain the original copyright notice. If the display of the |
| 31 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices | 31 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices |
| 32 | - * must display the words "Powered by KnowledgeTree" and retain the original | ||
| 33 | - * copyright notice. | 32 | + * must display the words "Powered by KnowledgeTree" and retain the original |
| 33 | + * copyright notice. | ||
| 34 | * Contributor( s): ______________________________________ | 34 | * Contributor( s): ______________________________________ |
| 35 | * | 35 | * |
| 36 | */ | 36 | */ |
| @@ -41,19 +41,20 @@ require_once('Net/LDAP.php'); | @@ -41,19 +41,20 @@ require_once('Net/LDAP.php'); | ||
| 41 | require_once(KT_DIR . '/plugins/ktstandard/ldap/ldapbaseauthenticationprovider.inc.php'); | 41 | require_once(KT_DIR . '/plugins/ktstandard/ldap/ldapbaseauthenticationprovider.inc.php'); |
| 42 | 42 | ||
| 43 | class KTLDAPAuthenticationProvider extends KTLDAPBaseAuthenticationProvider { | 43 | class KTLDAPAuthenticationProvider extends KTLDAPBaseAuthenticationProvider { |
| 44 | - var $sNamespace = "ktstandard.authentication.ldapprovider"; | 44 | + var $sNamespace = 'ktstandard.authentication.ldapprovider'; |
| 45 | 45 | ||
| 46 | - var $aAttributes = array ("cn", "uid", "givenname", "sn", "mail", "mobile"); | ||
| 47 | - var $sAuthenticatorClass = "KTLDAPAuthenticator"; | 46 | + var $aAttributes = array ('cn', 'samaccountname', 'givenname', 'sn', 'mail', 'mobile', 'userprincipalname', 'uid'); |
| 47 | + var $sAuthenticatorClass = 'KTLDAPAuthenticator'; | ||
| 48 | 48 | ||
| 49 | function KTLDAPAuthenticationProvider() { | 49 | function KTLDAPAuthenticationProvider() { |
| 50 | - $this->sName = _kt("LDAP authentication provider"); | 50 | + $this->sName = _kt('LDAP authentication provider'); |
| 51 | parent::KTLDAPBaseAuthenticationProvider(); | 51 | parent::KTLDAPBaseAuthenticationProvider(); |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | class KTLDAPAuthenticator extends KTLDAPBaseAuthenticator { | 56 | class KTLDAPAuthenticator extends KTLDAPBaseAuthenticator { |
| 57 | - var $aAttributes = array ("cn", "uid", "givenname", "sn", "mail", "mobile"); | 57 | + var $aAttributes = array ('cn', 'samaccountname', 'givenname', 'sn', 'mail', 'mobile', 'userprincipalname', 'uid'); |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | +?> | ||
| 60 | \ No newline at end of file | 61 | \ No newline at end of file |
plugins/ktstandard/ldap/ldapbaseauthenticationprovider.inc.php
| @@ -39,11 +39,11 @@ require_once(KT_LIB_DIR . '/authentication/authenticationprovider.inc.php'); | @@ -39,11 +39,11 @@ require_once(KT_LIB_DIR . '/authentication/authenticationprovider.inc.php'); | ||
| 39 | require_once(KT_LIB_DIR . '/authentication/Authenticator.inc'); | 39 | require_once(KT_LIB_DIR . '/authentication/Authenticator.inc'); |
| 40 | 40 | ||
| 41 | class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { | 41 | class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { |
| 42 | - var $sName = "LDAP authentication provider"; | ||
| 43 | - var $sNamespace = "ktstandard.authentication.ldapprovider"; | 42 | + var $sName = 'LDAP authentication provider'; |
| 43 | + var $sNamespace = 'ktstandard.authentication.ldapprovider'; | ||
| 44 | 44 | ||
| 45 | - var $aAttributes = array ("cn", "uid", "givenname", "sn", "mail", "mobile"); | ||
| 46 | - var $aMembershipAttributes = array ("memberOf"); | 45 | + var $aAttributes = array ('cn', 'samaccountname', 'givenname', 'sn', 'mail', 'mobile', 'userprincipalname', 'uid'); |
| 46 | + var $aMembershipAttributes = array ('memberOf'); | ||
| 47 | 47 | ||
| 48 | // {{{ KTLDAPBaseAuthenticationProvider | 48 | // {{{ KTLDAPBaseAuthenticationProvider |
| 49 | function KTLDAPBaseAuthenticationProvider() { | 49 | function KTLDAPBaseAuthenticationProvider() { |
| @@ -281,10 +281,13 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { | @@ -281,10 +281,13 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { | ||
| 281 | $this->oValidator->notError($aResults); | 281 | $this->oValidator->notError($aResults); |
| 282 | 282 | ||
| 283 | $sUserName = $aResults[$this->aAttributes[1]]; | 283 | $sUserName = $aResults[$this->aAttributes[1]]; |
| 284 | - // With LDAP, if the 'uid' is null then try using the 'givenname' instead. | ||
| 285 | - // See activedirectoryauthenticationprovider.inc.php and ldapauthenticationprovider.inc.php for details. | ||
| 286 | - if($this->sAuthenticatorClass == "KTLDAPAuthenticator" && empty($sUserName)) { | ||
| 287 | - $sUserName = strtolower($aResults[$this->aAttributes[2]]); | 284 | + |
| 285 | + // If the SAMAccountName is empty then use the UserPrincipalName (UPN) to find the username. | ||
| 286 | + // The UPN is normally the username @ the internet domain | ||
| 287 | + if(empty($sUserName)) { | ||
| 288 | + $sUpn = $aResults[$this->aAttributes[6]]; | ||
| 289 | + $aUpn = explode('@', $sUpn); | ||
| 290 | + $sUserName = $aUpn[0]; | ||
| 288 | } | 291 | } |
| 289 | 292 | ||
| 290 | $fields = array(); | 293 | $fields = array(); |
| @@ -447,12 +450,12 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { | @@ -447,12 +450,12 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { | ||
| 447 | } | 450 | } |
| 448 | $aSearchDNs[$k] = "'".$aSearchResults[$k]['dn']."'"; | 451 | $aSearchDNs[$k] = "'".$aSearchResults[$k]['dn']."'"; |
| 449 | } | 452 | } |
| 450 | - | 453 | + |
| 451 | $sDNs = implode(',', $aSearchDNs); | 454 | $sDNs = implode(',', $aSearchDNs); |
| 452 | $query = "SELECT id, authentication_details_s1 AS dn FROM users | 455 | $query = "SELECT id, authentication_details_s1 AS dn FROM users |
| 453 | WHERE authentication_details_s1 IN ($sDNs)"; | 456 | WHERE authentication_details_s1 IN ($sDNs)"; |
| 454 | $aCurUsers = DBUtil::getResultArray($query); | 457 | $aCurUsers = DBUtil::getResultArray($query); |
| 455 | - | 458 | + |
| 456 | // If the user has already been added, then remove from the list | 459 | // If the user has already been added, then remove from the list |
| 457 | if(!PEAR::isError($aCurUsers) && !empty($aCurUsers)){ | 460 | if(!PEAR::isError($aCurUsers) && !empty($aCurUsers)){ |
| 458 | foreach($aCurUsers as $item){ | 461 | foreach($aCurUsers as $item){ |
| @@ -961,3 +964,4 @@ class KTLDAPBaseAuthenticator extends Authenticator { | @@ -961,3 +964,4 @@ class KTLDAPBaseAuthenticator extends Authenticator { | ||
| 961 | } | 964 | } |
| 962 | } | 965 | } |
| 963 | 966 | ||
| 967 | +?> | ||
| 964 | \ No newline at end of file | 968 | \ No newline at end of file |
resources/js/search2widget.js
0 โ 100644
| 1 | +Ext.onReady(function(){ | ||
| 2 | + | ||
| 3 | +var bSearchOptionMetadataAndContent = true; | ||
| 4 | + | ||
| 5 | +Ext.BLANK_IMAGE_URL = '../../thirdpartyjs/extjs/resources/images/default/s.gif'; | ||
| 6 | + | ||
| 7 | +function doAdvancedSearch() | ||
| 8 | +{ | ||
| 9 | + document.location=rootURL + "/search2.php?action=guiBuilder"; | ||
| 10 | +} | ||
| 11 | + | ||
| 12 | +function doViewPreviousSearchResults() | ||
| 13 | +{ | ||
| 14 | + document.location=rootURL + "/search2.php?action=searchResults"; | ||
| 15 | +} | ||
| 16 | + | ||
| 17 | +function onMetadataAndContentClick() | ||
| 18 | +{ | ||
| 19 | + bSearchOptionMetadataAndContent = true; | ||
| 20 | + Ext.example.msg(sSearchTranslations[0], sSearchTranslations[1]); /* Quick Search Options, Searches will now search both content and metadata */ | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | +function onMetadataClick() | ||
| 24 | +{ | ||
| 25 | + bSearchOptionMetadataAndContent = false; | ||
| 26 | + Ext.example.msg(sSearchTranslations[0], sSearchTranslations[2]); /* Quick Search Options, Searches will now only search metadata */ | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +function onSavedSearchClick(item) | ||
| 30 | +{ | ||
| 31 | + id = item.id.substr(11); | ||
| 32 | + document.location=rootURL + "/search2.php?action=processSaved&fSavedSearchId=" + id; | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +function onSearchClick(sender) | ||
| 36 | +{ | ||
| 37 | + | ||
| 38 | + var suffix = sender.id.substring(12); | ||
| 39 | + | ||
| 40 | + var text = Ext.get('txtSearchBar' + suffix).getValue(false); | ||
| 41 | + | ||
| 42 | + if (text == sSearchTranslations[12] || text == '') | ||
| 43 | + { | ||
| 44 | + Ext.example.msg(sSearchTranslations[3], sSearchTranslations[4]); /* Hint, Please enter some search criteria! */ | ||
| 45 | + return; | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + var sq = document.getElementById('txtQuery'); | ||
| 49 | + var qg = document.getElementById('cbQuickGeneral'); | ||
| 50 | + | ||
| 51 | + text = text.replace(/\"/g, "'"); | ||
| 52 | + | ||
| 53 | + if (bSearchOptionMetadataAndContent) | ||
| 54 | + { | ||
| 55 | + sq.value = '(GeneralText contains "' + text + '")'; | ||
| 56 | + } | ||
| 57 | + else | ||
| 58 | + { | ||
| 59 | + sq.value = '(Metadata contains "' + text + '")'; | ||
| 60 | + } | ||
| 61 | + qg.value = bSearchOptionMetadataAndContent?1:0; | ||
| 62 | + | ||
| 63 | + var frm = document.getElementById('frmQuickSearch'); | ||
| 64 | + frm.submit(); | ||
| 65 | + | ||
| 66 | +} | ||
| 67 | + | ||
| 68 | +function populateSavedSearch(menu) | ||
| 69 | +{ | ||
| 70 | + if (aSavedSearches.length == 0) | ||
| 71 | + { | ||
| 72 | + return; | ||
| 73 | + } | ||
| 74 | + var item = menu.addMenuItem({ | ||
| 75 | + text: sSearchTranslations[5], /*Saved Searches*/ | ||
| 76 | + menu: { | ||
| 77 | + items: [] | ||
| 78 | + } | ||
| 79 | + }); | ||
| 80 | + | ||
| 81 | + for(i=0;i<aSavedSearches.length;i++) | ||
| 82 | + { | ||
| 83 | + var search = aSavedSearches[i]; | ||
| 84 | + var name = search.name; | ||
| 85 | + | ||
| 86 | + item.menu.addMenuItem({ | ||
| 87 | + text: name, | ||
| 88 | + id: 'miSavedItem' + search.id, | ||
| 89 | + handler: onSavedSearchClick | ||
| 90 | + }); | ||
| 91 | + } | ||
| 92 | +} | ||
| 93 | + | ||
| 94 | + | ||
| 95 | + | ||
| 96 | +function createSearchBar(div, suffix) | ||
| 97 | +{ | ||
| 98 | + var x = Ext.get(div); | ||
| 99 | + if (x == null) | ||
| 100 | + { | ||
| 101 | + return; | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + var button; | ||
| 105 | + | ||
| 106 | + if (suffix == 1) | ||
| 107 | + { | ||
| 108 | + var menu = new Ext.menu.Menu({ | ||
| 109 | + items: [ | ||
| 110 | + { | ||
| 111 | + text: sSearchTranslations[6], /* Advanced Search */ | ||
| 112 | + handler: doAdvancedSearch | ||
| 113 | + }, | ||
| 114 | + { | ||
| 115 | + text: sSearchTranslations[7], /* Previous Search Results */ | ||
| 116 | + handler: doViewPreviousSearchResults | ||
| 117 | + }, | ||
| 118 | + { | ||
| 119 | + text: sSearchTranslations[8] , /*Quick Search Options*/ | ||
| 120 | + menu: { | ||
| 121 | + items: [ | ||
| 122 | + new Ext.menu.CheckItem({ | ||
| 123 | + text: sSearchTranslations[9], /* content and metadata */ | ||
| 124 | + id: 'cbSearchOptionContentMetadata' + suffix, | ||
| 125 | + checked: bSearchOptionMetadataAndContent, | ||
| 126 | + group: 'options', | ||
| 127 | + handler: onMetadataAndContentClick | ||
| 128 | + }), | ||
| 129 | + new Ext.menu.CheckItem({ | ||
| 130 | + text: sSearchTranslations[10], /* metadata */ | ||
| 131 | + checked: !bSearchOptionMetadataAndContent, | ||
| 132 | + id: 'cbSearchOptionMetadata' + suffix, | ||
| 133 | + group: 'options', | ||
| 134 | + handler: onMetadataClick | ||
| 135 | + }) | ||
| 136 | + ] | ||
| 137 | + } | ||
| 138 | + } | ||
| 139 | + ] | ||
| 140 | + }); | ||
| 141 | + | ||
| 142 | + | ||
| 143 | + button = new Ext.Toolbar.MenuButton({ | ||
| 144 | + text: sSearchTranslations[11], /* search */ | ||
| 145 | + handler: onSearchClick, | ||
| 146 | + id: 'searchButton' + suffix, | ||
| 147 | + //cls: 'x-btn-text-icon blist', | ||
| 148 | + menu : menu | ||
| 149 | + }); | ||
| 150 | + | ||
| 151 | + populateSavedSearch(menu); | ||
| 152 | + | ||
| 153 | + | ||
| 154 | + | ||
| 155 | + | ||
| 156 | + } | ||
| 157 | + else | ||
| 158 | + { | ||
| 159 | + menu = null; | ||
| 160 | + button = new Ext.Toolbar.Button({ | ||
| 161 | + text: sSearchTranslations[11], /* search */ | ||
| 162 | + pressed: true, | ||
| 163 | + handler: onSearchClick, | ||
| 164 | + id: 'searchButton' + suffix | ||
| 165 | + //cls: 'x-btn-text-icon blist', | ||
| 166 | + | ||
| 167 | + }); | ||
| 168 | + } | ||
| 169 | + | ||
| 170 | + var tb = new Ext.Toolbar(div); | ||
| 171 | + | ||
| 172 | + | ||
| 173 | + | ||
| 174 | + tb.add(new Ext.form.TextField({ | ||
| 175 | + emptyText: sSearchTranslations[12], /* Enter search criteria... */ | ||
| 176 | + value: quickQuery, | ||
| 177 | + selectOnFocus:true, | ||
| 178 | + id:'txtSearchBar' + suffix, | ||
| 179 | + width: 110 | ||
| 180 | + }), button); | ||
| 181 | + | ||
| 182 | + var map = new Ext.KeyMap("txtSearchBar" + suffix, | ||
| 183 | + { | ||
| 184 | + key: Ext.EventObject.ENTER, | ||
| 185 | + fn: function() { | ||
| 186 | + onSearchClick(Ext.get('txtSearchBar' + suffix)); | ||
| 187 | + } | ||
| 188 | + }); | ||
| 189 | + | ||
| 190 | + var el = Ext.get(div); | ||
| 191 | + if (suffix == 1) | ||
| 192 | + { | ||
| 193 | + el.applyStyles('position:relative; top: -3px'); | ||
| 194 | + } | ||
| 195 | + else | ||
| 196 | + { | ||
| 197 | + el.applyStyles('position:relative; left: 20px; top: 10px'); | ||
| 198 | + } | ||
| 199 | + | ||
| 200 | + return menu; | ||
| 201 | +} | ||
| 202 | + | ||
| 203 | +/* create the top search widget */ | ||
| 204 | +var menu = createSearchBar('newSearchQuery',1); | ||
| 205 | + | ||
| 206 | +/* create the search portlet if possible */ | ||
| 207 | +createSearchBar('searchPortletCriteria',2); | ||
| 208 | + | ||
| 209 | +}); | ||
| 0 | \ No newline at end of file | 210 | \ No newline at end of file |
search2/search/fields/CheckedOutDeltaField.inc.php
| @@ -59,7 +59,7 @@ class CheckedOutDeltaField extends DBFieldExpr | @@ -59,7 +59,7 @@ class CheckedOutDeltaField extends DBFieldExpr | ||
| 59 | 59 | ||
| 60 | public function modifyValue($value) | 60 | public function modifyValue($value) |
| 61 | { | 61 | { |
| 62 | - return "cast(cast($this->modifiedName as date) + $value as date)"; | 62 | + return "adddate(cast($this->modifiedName as date), interval '$value' day)"; |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | public function getInputRequirements() | 65 | public function getInputRequirements() |
search2/search/fields/CreatedDeltaField.inc.php
| @@ -59,7 +59,7 @@ class CreatedDeltaField extends DBFieldExpr | @@ -59,7 +59,7 @@ class CreatedDeltaField extends DBFieldExpr | ||
| 59 | 59 | ||
| 60 | public function modifyValue($value) | 60 | public function modifyValue($value) |
| 61 | { | 61 | { |
| 62 | - return "cast(cast($this->modifiedName as date) + $value as date)"; | 62 | + return "adddate(cast($this->modifiedName as date), interval '$value' day)"; |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | public function getInputRequirements() | 65 | public function getInputRequirements() |
search2/search/fields/ModifiedDeltaField.inc.php
| @@ -58,7 +58,7 @@ class ModifiedDeltaField extends DBFieldExpr | @@ -58,7 +58,7 @@ class ModifiedDeltaField extends DBFieldExpr | ||
| 58 | 58 | ||
| 59 | public function modifyValue($value) | 59 | public function modifyValue($value) |
| 60 | { | 60 | { |
| 61 | - return "cast(cast($this->modifiedName as date) + $value as date)"; | 61 | + return "adddate(cast($this->modifiedName as date), interval '$value' day)"; |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | public function getInputRequirements() | 64 | public function getInputRequirements() |
sql/mysql/install/data.sql
No preview for this file type
sql/mysql/install/structure.sql
| @@ -474,12 +474,12 @@ CREATE TABLE `document_transaction_types_lookup` ( | @@ -474,12 +474,12 @@ CREATE TABLE `document_transaction_types_lookup` ( | ||
| 474 | CREATE TABLE `document_transactions` ( | 474 | CREATE TABLE `document_transactions` ( |
| 475 | `id` int(11) NOT NULL default '0', | 475 | `id` int(11) NOT NULL default '0', |
| 476 | `document_id` int(11) default NULL, | 476 | `document_id` int(11) default NULL, |
| 477 | - `version` varchar(50) default NULL, | 477 | + `version` float default NULL, |
| 478 | `user_id` int(11) default NULL, | 478 | `user_id` int(11) default NULL, |
| 479 | `datetime` datetime NOT NULL default '0000-00-00 00:00:00', | 479 | `datetime` datetime NOT NULL default '0000-00-00 00:00:00', |
| 480 | `ip` varchar(15) default NULL, | 480 | `ip` varchar(15) default NULL, |
| 481 | - `filename` varchar(255) NOT NULL default '', | ||
| 482 | - `comment` varchar(1024) NOT NULL default '', | 481 | + `filename` mediumtext NOT NULL default '', |
| 482 | + `comment` mediumtext NOT NULL default '', | ||
| 483 | `transaction_namespace` varchar(255) NOT NULL default 'ktcore.transactions.event', | 483 | `transaction_namespace` varchar(255) NOT NULL default 'ktcore.transactions.event', |
| 484 | `session_id` int(11) default NULL, | 484 | `session_id` int(11) default NULL, |
| 485 | `admin_mode` tinyint(1) NOT NULL default '0', | 485 | `admin_mode` tinyint(1) NOT NULL default '0', |
sql/mysql/upgrade/3.5.2/document_transactions.sql
| 1 | -alter table document_transactions change version version varchar(50); | 1 | +alter table document_transactions change version version float default NULL; |
| 2 | alter table document_transactions change ip ip varchar(15); | 2 | alter table document_transactions change ip ip varchar(15); |
| 3 | -alter table document_transactions change filename filename mediumtext; | ||
| 4 | -alter table document_transactions change comment comment mediumtext; | 3 | +alter table document_transactions change filename filename mediumtext NOT NULL default ''; |
| 4 | +alter table document_transactions change comment comment mediumtext NOT NULL default ''; | ||
| 5 | alter table document_transactions change transaction_namespace transaction_namespace varchar(255); | 5 | alter table document_transactions change transaction_namespace transaction_namespace varchar(255); |
| 6 | alter table document_transactions add index (`datetime`,`transaction_namespace`); | 6 | alter table document_transactions add index (`datetime`,`transaction_namespace`); |
| 7 | \ No newline at end of file | 7 | \ No newline at end of file |
templates/kt3/standard_page.smarty
| @@ -53,6 +53,8 @@ | @@ -53,6 +53,8 @@ | ||
| 53 | <!-- Standalone Javascript. --> | 53 | <!-- Standalone Javascript. --> |
| 54 | {foreach item=sJavascript from=$page->getJSStandalone()} | 54 | {foreach item=sJavascript from=$page->getJSStandalone()} |
| 55 | <script type="text/javascript"> | 55 | <script type="text/javascript"> |
| 56 | + var rootURL = "{$absoluteRootUrl}"; | ||
| 57 | + var quickQuery = "{$search2_quickQuery}"; | ||
| 56 | {$sJavascript} | 58 | {$sJavascript} |
| 57 | </script> | 59 | </script> |
| 58 | {/foreach} | 60 | {/foreach} |
| @@ -90,123 +92,40 @@ | @@ -90,123 +92,40 @@ | ||
| 90 | <li><div id="menu_divider"></div></li> | 92 | <li><div id="menu_divider"></div></li> |
| 91 | {/foreach} | 93 | {/foreach} |
| 92 | 94 | ||
| 93 | - {literal} | 95 | + |
| 94 | <script language="javascript"> | 96 | <script language="javascript"> |
| 95 | 97 | ||
| 96 | - function search(elname) | ||
| 97 | - { | ||
| 98 | - var sc = document.getElementById(elname); | ||
| 99 | - var val = sc.value; | ||
| 100 | - | ||
| 101 | - if (val == "{/literal}{i18n}Enter search criteria{/i18n}{literal}" || val == "") | ||
| 102 | - { | ||
| 103 | - alert('{/literal}{i18n}Please enter some search criteria{/i18n}{literal}'); | ||
| 104 | - return; | ||
| 105 | - } | ||
| 106 | - var sq = document.getElementById('txtQuery'); | ||
| 107 | - | ||
| 108 | - var so = document.getElementById('searchOptions'); | ||
| 109 | - | ||
| 110 | - val = val.replace(/\"/g, "'"); | ||
| 111 | - | ||
| 112 | - if (so.value == 's') | ||
| 113 | - { | ||
| 114 | - sq.value = '(GeneralText contains "' + val + '")'; | ||
| 115 | - } | ||
| 116 | - else | ||
| 117 | - { | ||
| 118 | - sq.value = '(Metadata contains "' + val + '")'; | ||
| 119 | - } | ||
| 120 | - | ||
| 121 | - var frm = document.getElementById('frmQuickSearch'); | ||
| 122 | - frm.submit(); | ||
| 123 | - } | ||
| 124 | - function processSearchEnter(event, elname) | ||
| 125 | - { | ||
| 126 | - var sc = document.getElementById(elname); | ||
| 127 | - if(event && event.which) | ||
| 128 | - { | ||
| 129 | - characterCode = event.which; | ||
| 130 | - } | ||
| 131 | - else | ||
| 132 | - { | ||
| 133 | - characterCode = event.keyCode; | ||
| 134 | - } | ||
| 135 | - | ||
| 136 | - if (characterCode.toString() == '13') | ||
| 137 | - search(elname); | ||
| 138 | - | ||
| 139 | - if (sc.value == "{/literal}{i18n}Enter search criteria{/i18n}{literal}") | ||
| 140 | - { | ||
| 141 | - sc.value = ''; | ||
| 142 | - } | ||
| 143 | - | ||
| 144 | - return true; | ||
| 145 | - } | ||
| 146 | - function searchGotFocus(elname) | ||
| 147 | - { | ||
| 148 | - var sc = document.getElementById(elname); | ||
| 149 | - if (sc.value == "{/literal}{i18n}Enter search criteria{/i18n}{literal}") | ||
| 150 | - { | ||
| 151 | - sc.value = ""; | ||
| 152 | - } | ||
| 153 | - } | ||
| 154 | - function searchLostFocus(elname) | ||
| 155 | - { | ||
| 156 | - var sc = document.getElementById(elname); | ||
| 157 | - if (sc.value == "") | ||
| 158 | - { | ||
| 159 | - sc.value = "{/literal}{i18n}Enter search criteria{/i18n}{literal}"; | ||
| 160 | - } | ||
| 161 | - } | ||
| 162 | - | ||
| 163 | - | ||
| 164 | - function updateSelect(el, idx, value, name) | ||
| 165 | - { | ||
| 166 | - var elOptNew = new Option(name, value); | ||
| 167 | - | ||
| 168 | - var elOptOld = el.options[idx]; | ||
| 169 | - try | ||
| 170 | - { | ||
| 171 | - el.add(elOptNew, elOptOld); // standards compliant; doesn't work in IE | ||
| 172 | - } | ||
| 173 | - catch(ex) | ||
| 174 | - { | ||
| 175 | - el.add(elOptNew, idx); // IE only | ||
| 176 | - } | ||
| 177 | - el.remove(idx+1); | ||
| 178 | - } | ||
| 179 | - | ||
| 180 | - function searchOptionSelect(elname) | ||
| 181 | - { | ||
| 182 | - var so = document.getElementById(elname); | ||
| 183 | - switch(so.value) | ||
| 184 | - { | ||
| 185 | - case '': | ||
| 186 | - break | ||
| 187 | - case 's': | ||
| 188 | - updateSelect(so, 1, 's', "{/literal}{i18n}content and metadata{/i18n}{literal} *"); | ||
| 189 | - updateSelect(so, 2, 'm', "{/literal}{i18n}metadata{/i18n}{literal}"); | ||
| 190 | - $('cbQuickGeneral').value = 1; | ||
| 191 | - break | ||
| 192 | - case 'm': | ||
| 193 | - updateSelect(so, 1, 's', "{/literal}{i18n}content and metadata{/i18n}{literal}"); | ||
| 194 | - updateSelect(so, 2, 'm', "{/literal}{i18n}metadata{/i18n}{literal} *"); | ||
| 195 | - $('cbQuickGeneral').value = 0; | ||
| 196 | - break; | ||
| 197 | - case 'A': | ||
| 198 | - document.location="{/literal}{$rootUrl}{literal}/search2.php?action=guiBuilder"; | ||
| 199 | - break; | ||
| 200 | - case 'R': | ||
| 201 | - document.location="{/literal}{$rootUrl}{literal}/search2.php?action=searchResults"; | ||
| 202 | - break; | ||
| 203 | - default: | ||
| 204 | - document.location="{/literal}{$rootUrl}{literal}/search2.php?action=processSaved&fSavedSearchId=" + so.value + ""; | ||
| 205 | - break; | ||
| 206 | - } | ||
| 207 | - } | 98 | + var sSearchTranslations = |
| 99 | + [ | ||
| 100 | + | ||
| 101 | + /* 0 */ "{i18n}Quick Search Options{/i18n}", | ||
| 102 | + /* 1 */ "{i18n}Searches will now search both content and metadata{/i18n}", | ||
| 103 | + /* 2 */ "{i18n}Searches will now only search metadata{/i18n}", | ||
| 104 | + /* 3 */ "{i18n}Hint{/i18n}", | ||
| 105 | + /* 4 */ "{i18n}Please enter some search criteria!{/i18n}", | ||
| 106 | + /* 5 */ "{i18n}Saved Searches{/i18n}", | ||
| 107 | + /* 6 */ "{i18n}Advanced Search{/i18n}", | ||
| 108 | + /* 7 */ "{i18n}Previous Search Results{/i18n}", | ||
| 109 | + /* 8 */ "{i18n}Quick Search Options{/i18n}", | ||
| 110 | + /* 9 */ "{i18n}content and metadata{/i18n}", | ||
| 111 | + /* 10 */ "{i18n}metadata{/i18n}", | ||
| 112 | + /* 11 */ "{i18n}search{/i18n}", | ||
| 113 | + /* 12 */ "{i18n}Enter search criteria...{/i18n}" | ||
| 114 | + | ||
| 115 | + ]; | ||
| 116 | + | ||
| 117 | + var aSavedSearches = [ | ||
| 118 | + {assign var=count value=0} | ||
| 119 | + {foreach item=searchitem from=$savedSearches} | ||
| 120 | + {if $count>0},{/if} | ||
| 121 | + {literal}{{/literal}id:{$searchitem.id},name:'{$searchitem.name|sanitize}'{literal}}{/literal} | ||
| 122 | + {assign var=count value=$count+1} | ||
| 123 | + {/foreach} | ||
| 124 | + ]; | ||
| 208 | </script> | 125 | </script> |
| 209 | - {/literal} | 126 | + {literal} |
| 127 | + | ||
| 128 | + {/literal} | ||
| 210 | <!-- user menu --> | 129 | <!-- user menu --> |
| 211 | <li class="pref"> | 130 | <li class="pref"> |
| 212 | {if ($page->user)} | 131 | {if ($page->user)} |
| @@ -231,28 +150,18 @@ | @@ -231,28 +150,18 @@ | ||
| 231 | 150 | ||
| 232 | <li class="pref"> | 151 | <li class="pref"> |
| 233 | <div style="position: absolute;"> | 152 | <div style="position: absolute;"> |
| 234 | - <input id=searchCriteria value="{$search2_quickQuery|sanitize}" style="width:129px; font-size:12px; position:relative; top: -2px; left: -180px; z-index: 11" | ||
| 235 | - onfocus="searchGotFocus('searchCriteria')" onblur="searchLostFocus('searchCriteria')" onkeypress="return processSearchEnter(event,'searchCriteria')" > | ||
| 236 | - <img onclick="search('searchCriteria')" src="resources/tango-icons/system-search.png" border="0" style="position: relative; left: -183px; top: 4px; z-index: 11" /> | ||
| 237 | - <select id=searchOptions style="width:170px; font-size:12px; position:absolute; left: -180px; z-index: 10" onchange="searchOptionSelect('searchOptions')"> | ||
| 238 | - <option value="">--- {i18n}quick search{/i18n} --- | ||
| 239 | - <option value="s" {if $search2_general==1}selected{/if}>{i18n}content and metadata{/i18n} {if $search2_general==1}*{/if} | ||
| 240 | - <option value="m" {if $search2_general==0}selected{/if}>{i18n}metadata{/i18n} {if $search2_general==0}*{/if} | ||
| 241 | - <option value="">--- {i18n}search{/i18n} --- | ||
| 242 | - <option value="A">{i18n}Advanced Search{/i18n} | ||
| 243 | - <option value="R">{i18n}Previous Results{/i18n} | ||
| 244 | - {if count($savedSearches) > 0} | ||
| 245 | - <option value="">--- {i18n}saved searches{/i18n} --- | ||
| 246 | - {foreach item=searchitem from=$savedSearches} | ||
| 247 | - <option value="{$searchitem.id}">{$searchitem.name|sanitize} | ||
| 248 | - {/foreach} | ||
| 249 | - {/if} | ||
| 250 | - </select> | 153 | + |
| 154 | + | ||
| 251 | <form id=frmQuickSearch method=post action="{$rootUrl}/search2.php?action=process"> | 155 | <form id=frmQuickSearch method=post action="{$rootUrl}/search2.php?action=process"> |
| 252 | <input id=txtQuery name=txtQuery type=hidden> | 156 | <input id=txtQuery name=txtQuery type=hidden> |
| 253 | <input type=hidden name="cbQuickQuery" id="cbQuickQuery" value="1"> | 157 | <input type=hidden name="cbQuickQuery" id="cbQuickQuery" value="1"> |
| 254 | <input type=hidden name="cbQuickGeneral" id="cbQuickGeneral" value="1"></form> | 158 | <input type=hidden name="cbQuickGeneral" id="cbQuickGeneral" value="1"></form> |
| 255 | </div> | 159 | </div> |
| 160 | + | ||
| 161 | + <div id="newSearchQuery"/> | ||
| 162 | + | ||
| 163 | + | ||
| 164 | + | ||
| 256 | </li> | 165 | </li> |
| 257 | 166 | ||
| 258 | </ul> | 167 | </ul> |
| @@ -332,13 +241,13 @@ | @@ -332,13 +241,13 @@ | ||
| 332 | <div class="error_dashlet_rightrepeat_bottom"></div> | 241 | <div class="error_dashlet_rightrepeat_bottom"></div> |
| 333 | <div class="error_dashlet_leftrepeat_bottom"></div> | 242 | <div class="error_dashlet_leftrepeat_bottom"></div> |
| 334 | {foreach item=sError from=$page->errStack} | 243 | {foreach item=sError from=$page->errStack} |
| 335 | - | 244 | + |
| 336 | {if ($page->booleanLink == '0')} | 245 | {if ($page->booleanLink == '0')} |
| 337 | <p>{$sError|sanitize}</p> | 246 | <p>{$sError|sanitize}</p> |
| 338 | {else} | 247 | {else} |
| 339 | <p>{$sError}</p> | 248 | <p>{$sError}</p> |
| 340 | - {/if} | ||
| 341 | - | 249 | + {/if} |
| 250 | + | ||
| 342 | {/foreach} | 251 | {/foreach} |
| 343 | <div class="error_dashlet_topleft_small"></div> | 252 | <div class="error_dashlet_topleft_small"></div> |
| 344 | <div class="error_dashlet_toprepeat_small"></div> | 253 | <div class="error_dashlet_toprepeat_small"></div> |
templates/ktcore/assist/assist_notification.smarty
| @@ -13,11 +13,11 @@ | @@ -13,11 +13,11 @@ | ||
| 13 | | | 13 | | |
| 14 | </div> | 14 | </div> |
| 15 | 15 | ||
| 16 | - <a href="{ktLink base="notify.php" query="id=`$notify_id`¬ify_action=clear"} | 16 | + <a href='{ktLink base="notify.php" query="id=`$notify_id`¬ify_action=clear"}' |
| 17 | kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}" | 17 | kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}" |
| 18 | class="ktAction ktInline ktDelete" style="position: relative;" >{i18n}Clear Alert{/i18n}</a> | 18 | class="ktAction ktInline ktDelete" style="position: relative;" >{i18n}Clear Alert{/i18n}</a> |
| 19 | 19 | ||
| 20 | - <a href="{ktLink base="notify.php" query="id=`$notify_id`¬ify_action=clear"} | 20 | + <a href='{ktLink base="notify.php" query="id=`$notify_id`¬ify_action=clear"}' |
| 21 | kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}"">{i18n}Clear Alert{/i18n}</a> | 21 | kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}"">{i18n}Clear Alert{/i18n}</a> |
| 22 | </div> | 22 | </div> |
| 23 | </dd> | 23 | </dd> |
templates/ktcore/assist/assist_notification_details.smarty
| @@ -13,15 +13,15 @@ | @@ -13,15 +13,15 @@ | ||
| 13 | 13 | ||
| 14 | <div class="actionoptions"> | 14 | <div class="actionoptions"> |
| 15 | <div style="float:left; position: relative;"> | 15 | <div style="float:left; position: relative;"> |
| 16 | - <a href="{ktLink base="notify.php" query="id=`$notify_id`¬ify_action=view"}">{i18n}View Document{/i18n}</a> | 16 | + <a href='{ktLink base="notify.php" query="id=`$notify_id`¬ify_action=view"}'>{i18n}View Document{/i18n}</a> |
| 17 | | | 17 | | |
| 18 | </div> | 18 | </div> |
| 19 | 19 | ||
| 20 | - <a href="{ktLink base="notify.php" query="id=`$notify_id`¬ify_action=clear"} | 20 | + <a href='{ktLink base="notify.php" query="id=`$notify_id`¬ify_action=clear"}' |
| 21 | kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}" | 21 | kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}" |
| 22 | class="ktAction ktInline ktDelete" style="position: relative;" >{i18n}Clear Alert{/i18n}</a> | 22 | class="ktAction ktInline ktDelete" style="position: relative;" >{i18n}Clear Alert{/i18n}</a> |
| 23 | 23 | ||
| 24 | - <a href="{ktLink base="notify.php" query="id=`$notify_id`¬ify_action=clear"} | 24 | + <a href='{ktLink base="notify.php" query="id=`$notify_id`¬ify_action=clear"}' |
| 25 | kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}"">{i18n}Clear Alert{/i18n}</a> | 25 | kt:deleteMessage="{i18n}Are you sure you wish to clear the notification?{/i18n}"">{i18n}Clear Alert{/i18n}</a> |
| 26 | </div> | 26 | </div> |
| 27 | 27 |
templates/ktcore/search2/adv_query_builder.smarty
| 1 | -{$context->oPage->requireCSSResource("thirdpartyjs/extjs/resources/css/ext-all.css")} | ||
| 2 | - | ||
| 3 | -{$context->oPage->requireJSResource("thirdpartyjs/extjs/adapter/ext/ext-base.js")} | ||
| 4 | -{$context->oPage->requireJSResource("thirdpartyjs/extjs/ext-all.js")} | ||
| 5 | 1 | ||
| 6 | 2 | ||
| 7 | {literal} | 3 | {literal} |
| @@ -320,7 +316,7 @@ function createFilesize(groupid, fid) | @@ -320,7 +316,7 @@ function createFilesize(groupid, fid) | ||
| 320 | html += "<option>{/literal}{i18n}megabytes{/i18n}{literal}"; | 316 | html += "<option>{/literal}{i18n}megabytes{/i18n}{literal}"; |
| 321 | html += "<option>{/literal}{i18n}gigabytes{/i18n}{literal}"; | 317 | html += "<option>{/literal}{i18n}gigabytes{/i18n}{literal}"; |
| 322 | html += "</SELECT>"; | 318 | html += "</SELECT>"; |
| 323 | - html += "<input style=\"display: none\" value=\"1\" id=\"field" + groupid + "_" + fid + "start\">"; | 319 | + html += "<input style=\"display: none\" value=\"0\" id=\"field" + groupid + "_" + fid + "start\">"; |
| 324 | html += "<td width=\"100%\"> "; | 320 | html += "<td width=\"100%\"> "; |
| 325 | 321 | ||
| 326 | html += "</table>"; | 322 | html += "</table>"; |
| @@ -329,11 +325,11 @@ function createFilesize(groupid, fid) | @@ -329,11 +325,11 @@ function createFilesize(groupid, fid) | ||
| 329 | 325 | ||
| 330 | function createDateDiff(groupid, fid) | 326 | function createDateDiff(groupid, fid) |
| 331 | { | 327 | { |
| 332 | - var html = "<table><tr><td width=\"140\""; | 328 | + var html = "<table><tr><td width=\"140\">"; |
| 333 | 329 | ||
| 334 | html += "<SELECT style=\"width: 140px\" id=\"field" + groupid + "_" + fid + "op\">"; | 330 | html += "<SELECT style=\"width: 140px\" id=\"field" + groupid + "_" + fid + "op\">"; |
| 335 | - html += "<option value=\"is\">{/literal}{i18n}is{/i18n}{literal}"; | ||
| 336 | - html += "<option value=\"is not\">{/literal}{i18n}is not{/i18n}{literal}"; | 331 | + html += "<option value=\"\<\">{/literal}{i18n}less than{/i18n}{literal}"; |
| 332 | + html += "<option value=\"\>\">{/literal}{i18n}greater than{/i18n}{literal}"; | ||
| 337 | html += "</SELECT>" | 333 | html += "</SELECT>" |
| 338 | 334 | ||
| 339 | 335 |
templates/ktcore/search2/search_portlet.smarty
| 1 | -<div style="position: absolute; left: 10px"> | ||
| 2 | -<input id=searchPortletCriteria value="{$search2_quickQuery|sanitize}" style="width:150px; font-size:12px; position:relative; top: -2px; z-index: 11" | ||
| 3 | - onfocus="searchGotFocus('searchPortletCriteria')" onblur="searchLostFocus('searchPortletCriteria')" onkeypress="return processSearchEnter(event,'searchPortletCriteria')" > | ||
| 4 | -<img onclick="search('searchPortletCriteria')" src="resources/tango-icons/system-search.png" border="0" style="position: relative; left: -25px; top: 4px; z-index: 11" /> | ||
| 5 | -<select id=searchPortletOptions style="width:170px; font-size:12px; position:absolute; left: -0px; z-index: 10" onchange="searchOptionSelect('searchPortletOptions')"> | ||
| 6 | - <option value="s">--- {i18n}quick search{/i18n} --- | ||
| 7 | - <option value="s" {if $search2_general==1}selected{/if}>{i18n}content and metadata{/i18n} {if $search2_general==1}*{/if} | ||
| 8 | - <option value="m" {if $search2_general==0}selected{/if}>{i18n}metadata{/i18n} {if $search2_general==0}*{/if} | ||
| 9 | - </select> | ||
| 10 | -</div> | 1 | + |
| 2 | +<div id=searchPortletCriteria></div> | ||
| 3 | + | ||
| 11 | <ul class="actionlist"> | 4 | <ul class="actionlist"> |
| 12 | <li><a href="{$rootUrl}/search2.php?action=guiBuilder">{i18n}Advanced Search{/i18n}</a></li> | 5 | <li><a href="{$rootUrl}/search2.php?action=guiBuilder">{i18n}Advanced Search{/i18n}</a></li> |
| 13 | <li><a href="{$rootUrl}/search2.php?action=queryBuilder">{i18n}Search Criteria Editor{/i18n}</a></li> | 6 | <li><a href="{$rootUrl}/search2.php?action=queryBuilder">{i18n}Search Criteria Editor{/i18n}</a></li> |
| 14 | -<li><a href="{$rootUrl}/search2.php?action=manage"><nobr>{i18n}Manage Saved Search Criteria{/i18n}</a></li> | 7 | +<li><a href="{$rootUrl}/search2.php?action=manage"><nobr>{i18n}Manage Saved Search{/i18n}</a></li> |
| 15 | </ul> | 8 | </ul> |
| 16 | 9 | ||
| 17 | {if (count($savedSearches) > 0)} | 10 | {if (count($savedSearches) > 0)} |
templates/ktstandard/action/discussion_comment_list_item.smarty
| @@ -7,14 +7,14 @@ | @@ -7,14 +7,14 @@ | ||
| 7 | {/if} | 7 | {/if} |
| 8 | 8 | ||
| 9 | <dt> | 9 | <dt> |
| 10 | - <span class="subject">{$comment->getSubject()|sanitize_input}</span> | 10 | + <span class="subject">{$comment->getSubject()}</span> |
| 11 | by | 11 | by |
| 12 | <span class="author">{$creator->getName()}</span> | 12 | <span class="author">{$creator->getName()}</span> |
| 13 | <span class="date">({$comment->getDate()})</span> | 13 | <span class="date">({$comment->getDate()})</span> |
| 14 | 14 | ||
| 15 | </dt> | 15 | </dt> |
| 16 | 16 | ||
| 17 | - <dd>{$comment->getBody()|sanitize_input}</dd> | 17 | + <dd>{$comment->getBody()}</dd> |
| 18 | 18 | ||
| 19 | </dl> | 19 | </dl> |
| 20 | 20 |
templates/ktstandard/authentication/ldapadduser.smarty
| @@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
| 10 | <input type="hidden" name="dn" value="{$dn}" /> | 10 | <input type="hidden" name="dn" value="{$dn}" /> |
| 11 | <input type="hidden" name="samaccountname" value="{$samaccountname}" /> | 11 | <input type="hidden" name="samaccountname" value="{$samaccountname}" /> |
| 12 | <div class="form_actions"> | 12 | <div class="form_actions"> |
| 13 | - <input type="submit" name="submit[create]" value="{i18n}create user{/i18n}" /> | 13 | + <input type="submit" name="submit[create]" value="{i18n}Create user{/i18n}" /> |
| 14 | <input type="submit" name="kt_cancel[]" value="{i18n}Cancel{/i18n}" /> | 14 | <input type="submit" name="kt_cancel[]" value="{i18n}Cancel{/i18n}" /> |
| 15 | </div> | 15 | </div> |
| 16 | </fieldset> | 16 | </fieldset> |
thirdpartyjs/extjs/ext-all.js
| 1 | -/* | ||
| 2 | - * Ext JS Library 1.1 Beta 1 | ||
| 3 | - * Copyright(c) 2006-2007, Ext JS, LLC. | ||
| 4 | - * licensing@extjs.com | ||
| 5 | - * | ||
| 6 | - * http://www.extjs.com/license | ||
| 7 | - */ | ||
| 8 | - | 1 | +/* |
| 2 | + * Ext JS Library 1.1 Beta 1 | ||
| 3 | + * Copyright(c) 2006-2007, Ext JS, LLC. | ||
| 4 | + * licensing@extjs.com | ||
| 5 | + * | ||
| 6 | + * http://www.extjs.com/license | ||
| 7 | + */ | ||
| 8 | + | ||
| 9 | 9 | ||
| 10 | Ext.DomHelper=function(){var _1=null;var _2=/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i;var _3=function(o){if(typeof o=="string"){return o;}var b="";if(!o.tag){o.tag="div";}b+="<"+o.tag;for(var _6 in o){if(_6=="tag"||_6=="children"||_6=="cn"||_6=="html"||typeof o[_6]=="function"){continue;}if(_6=="style"){var s=o["style"];if(typeof s=="function"){s=s.call();}if(typeof s=="string"){b+=" style=\""+s+"\"";}else{if(typeof s=="object"){b+=" style=\"";for(var _8 in s){if(typeof s[_8]!="function"){b+=_8+":"+s[_8]+";";}}b+="\"";}}}else{if(_6=="cls"){b+=" class=\""+o["cls"]+"\"";}else{if(_6=="htmlFor"){b+=" for=\""+o["htmlFor"]+"\"";}else{b+=" "+_6+"=\""+o[_6]+"\"";}}}}if(_2.test(o.tag)){b+="/>";}else{b+=">";var cn=o.children||o.cn;if(cn){if(cn instanceof Array){for(var i=0,_b=cn.length;i<_b;i++){b+=_3(cn[i],b);}}else{b+=_3(cn,b);}}if(o.html){b+=o.html;}b+="</"+o.tag+">";}return b;};var _c=function(o,_e){var el=document.createElement(o.tag);var _10=el.setAttribute?true:false;for(var _11 in o){if(_11=="tag"||_11=="children"||_11=="cn"||_11=="html"||_11=="style"||typeof o[_11]=="function"){continue;}if(_11=="cls"){el.className=o["cls"];}else{if(_10){el.setAttribute(_11,o[_11]);}else{el[_11]=o[_11];}}}Ext.DomHelper.applyStyles(el,o.style);var cn=o.children||o.cn;if(cn){if(cn instanceof Array){for(var i=0,len=cn.length;i<len;i++){_c(cn[i],el);}}else{_c(cn,el);}}if(o.html){el.innerHTML=o.html;}if(_e){_e.appendChild(el);}return el;};var _15=function(_16,s,h,e){_1.innerHTML=[s,h,e].join("");var i=-1,el=_1;while(++i<_16){el=el.firstChild;}return el;};var ts="<table>",te="</table>",tbs=ts+"<tbody>",tbe="</tbody>"+te,trs=tbs+"<tr>",tre="</tr>"+tbe;var _22=function(tag,_24,el,_26){if(!_1){_1=document.createElement("div");}var _27;var _28=null;if(tag=="td"){if(_24=="afterbegin"||_24=="beforeend"){return;}if(_24=="beforebegin"){_28=el;el=el.parentNode;}else{_28=el.nextSibling;el=el.parentNode;}_27=_15(4,trs,_26,tre);}else{if(tag=="tr"){if(_24=="beforebegin"){_28=el;el=el.parentNode;_27=_15(3,tbs,_26,tbe);}else{if(_24=="afterend"){_28=el.nextSibling;el=el.parentNode;_27=_15(3,tbs,_26,tbe);}else{if(_24=="afterbegin"){_28=el.firstChild;}_27=_15(4,trs,_26,tre);}}}else{if(tag=="tbody"){if(_24=="beforebegin"){_28=el;el=el.parentNode;_27=_15(2,ts,_26,te);}else{if(_24=="afterend"){_28=el.nextSibling;el=el.parentNode;_27=_15(2,ts,_26,te);}else{if(_24=="afterbegin"){_28=el.firstChild;}_27=_15(3,tbs,_26,tbe);}}}else{if(_24=="beforebegin"||_24=="afterend"){return;}if(_24=="afterbegin"){_28=el.firstChild;}_27=_15(2,ts,_26,te);}}}el.insertBefore(_27,_28);return _27;};return{useDom:false,markup:function(o){return _3(o);},applyStyles:function(el,_2b){if(_2b){el=Ext.fly(el);if(typeof _2b=="string"){var re=/\s?([a-z\-]*)\:\s?([^;]*);?/gi;var _2d;while((_2d=re.exec(_2b))!=null){el.setStyle(_2d[1],_2d[2]);}}else{if(typeof _2b=="object"){for(var _2e in _2b){el.setStyle(_2e,_2b[_2e]);}}else{if(typeof _2b=="function"){Ext.DomHelper.applyStyles(el,_2b.call());}}}}},insertHtml:function(_2f,el,_31){_2f=_2f.toLowerCase();if(el.insertAdjacentHTML){var tag=el.tagName.toLowerCase();if(tag=="table"||tag=="tbody"||tag=="tr"||tag=="td"){var rs;if(rs=_22(tag,_2f,el,_31)){return rs;}}switch(_2f){case"beforebegin":el.insertAdjacentHTML(_2f,_31);return el.previousSibling;case"afterbegin":el.insertAdjacentHTML(_2f,_31);return el.firstChild;case"beforeend":el.insertAdjacentHTML(_2f,_31);return el.lastChild;case"afterend":el.insertAdjacentHTML(_2f,_31);return el.nextSibling;}throw"Illegal insertion point -> \""+_2f+"\"";}var _34=el.ownerDocument.createRange();var _35;switch(_2f){case"beforebegin":_34.setStartBefore(el);_35=_34.createContextualFragment(_31);el.parentNode.insertBefore(_35,el);return el.previousSibling;case"afterbegin":if(el.firstChild){_34.setStartBefore(el.firstChild);_35=_34.createContextualFragment(_31);el.insertBefore(_35,el.firstChild);return el.firstChild;}else{el.innerHTML=_31;return el.firstChild;}case"beforeend":if(el.lastChild){_34.setStartAfter(el.lastChild);_35=_34.createContextualFragment(_31);el.appendChild(_35);return el.lastChild;}else{el.innerHTML=_31;return el.lastChild;}case"afterend":_34.setStartAfter(el);_35=_34.createContextualFragment(_31);el.parentNode.insertBefore(_35,el.nextSibling);return el.nextSibling;}throw"Illegal insertion point -> \""+_2f+"\"";},insertBefore:function(el,o,_38){return this.doInsert(el,o,_38,"beforeBegin");},insertAfter:function(el,o,_3b){return this.doInsert(el,o,_3b,"afterEnd","nextSibling");},insertFirst:function(el,o,_3e){return this.doInsert(el,o,_3e,"afterBegin");},doInsert:function(el,o,_41,pos,_43){el=Ext.getDom(el);var _44;if(this.useDom){_44=_c(o,null);el.parentNode.insertBefore(_44,_43?el[_43]:el);}else{var _45=_3(o);_44=this.insertHtml(pos,el,_45);}return _41?Ext.get(_44,true):_44;},append:function(el,o,_48){el=Ext.getDom(el);var _49;if(this.useDom){_49=_c(o,null);el.appendChild(_49);}else{var _4a=_3(o);_49=this.insertHtml("beforeEnd",el,_4a);}return _48?Ext.get(_49,true):_49;},overwrite:function(el,o,_4d){el=Ext.getDom(el);el.innerHTML=_3(o);return _4d?Ext.get(el.firstChild,true):el.firstChild;},createTemplate:function(o){var _4f=_3(o);return new Ext.Template(_4f);}};}(); | 10 | Ext.DomHelper=function(){var _1=null;var _2=/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i;var _3=function(o){if(typeof o=="string"){return o;}var b="";if(!o.tag){o.tag="div";}b+="<"+o.tag;for(var _6 in o){if(_6=="tag"||_6=="children"||_6=="cn"||_6=="html"||typeof o[_6]=="function"){continue;}if(_6=="style"){var s=o["style"];if(typeof s=="function"){s=s.call();}if(typeof s=="string"){b+=" style=\""+s+"\"";}else{if(typeof s=="object"){b+=" style=\"";for(var _8 in s){if(typeof s[_8]!="function"){b+=_8+":"+s[_8]+";";}}b+="\"";}}}else{if(_6=="cls"){b+=" class=\""+o["cls"]+"\"";}else{if(_6=="htmlFor"){b+=" for=\""+o["htmlFor"]+"\"";}else{b+=" "+_6+"=\""+o[_6]+"\"";}}}}if(_2.test(o.tag)){b+="/>";}else{b+=">";var cn=o.children||o.cn;if(cn){if(cn instanceof Array){for(var i=0,_b=cn.length;i<_b;i++){b+=_3(cn[i],b);}}else{b+=_3(cn,b);}}if(o.html){b+=o.html;}b+="</"+o.tag+">";}return b;};var _c=function(o,_e){var el=document.createElement(o.tag);var _10=el.setAttribute?true:false;for(var _11 in o){if(_11=="tag"||_11=="children"||_11=="cn"||_11=="html"||_11=="style"||typeof o[_11]=="function"){continue;}if(_11=="cls"){el.className=o["cls"];}else{if(_10){el.setAttribute(_11,o[_11]);}else{el[_11]=o[_11];}}}Ext.DomHelper.applyStyles(el,o.style);var cn=o.children||o.cn;if(cn){if(cn instanceof Array){for(var i=0,len=cn.length;i<len;i++){_c(cn[i],el);}}else{_c(cn,el);}}if(o.html){el.innerHTML=o.html;}if(_e){_e.appendChild(el);}return el;};var _15=function(_16,s,h,e){_1.innerHTML=[s,h,e].join("");var i=-1,el=_1;while(++i<_16){el=el.firstChild;}return el;};var ts="<table>",te="</table>",tbs=ts+"<tbody>",tbe="</tbody>"+te,trs=tbs+"<tr>",tre="</tr>"+tbe;var _22=function(tag,_24,el,_26){if(!_1){_1=document.createElement("div");}var _27;var _28=null;if(tag=="td"){if(_24=="afterbegin"||_24=="beforeend"){return;}if(_24=="beforebegin"){_28=el;el=el.parentNode;}else{_28=el.nextSibling;el=el.parentNode;}_27=_15(4,trs,_26,tre);}else{if(tag=="tr"){if(_24=="beforebegin"){_28=el;el=el.parentNode;_27=_15(3,tbs,_26,tbe);}else{if(_24=="afterend"){_28=el.nextSibling;el=el.parentNode;_27=_15(3,tbs,_26,tbe);}else{if(_24=="afterbegin"){_28=el.firstChild;}_27=_15(4,trs,_26,tre);}}}else{if(tag=="tbody"){if(_24=="beforebegin"){_28=el;el=el.parentNode;_27=_15(2,ts,_26,te);}else{if(_24=="afterend"){_28=el.nextSibling;el=el.parentNode;_27=_15(2,ts,_26,te);}else{if(_24=="afterbegin"){_28=el.firstChild;}_27=_15(3,tbs,_26,tbe);}}}else{if(_24=="beforebegin"||_24=="afterend"){return;}if(_24=="afterbegin"){_28=el.firstChild;}_27=_15(2,ts,_26,te);}}}el.insertBefore(_27,_28);return _27;};return{useDom:false,markup:function(o){return _3(o);},applyStyles:function(el,_2b){if(_2b){el=Ext.fly(el);if(typeof _2b=="string"){var re=/\s?([a-z\-]*)\:\s?([^;]*);?/gi;var _2d;while((_2d=re.exec(_2b))!=null){el.setStyle(_2d[1],_2d[2]);}}else{if(typeof _2b=="object"){for(var _2e in _2b){el.setStyle(_2e,_2b[_2e]);}}else{if(typeof _2b=="function"){Ext.DomHelper.applyStyles(el,_2b.call());}}}}},insertHtml:function(_2f,el,_31){_2f=_2f.toLowerCase();if(el.insertAdjacentHTML){var tag=el.tagName.toLowerCase();if(tag=="table"||tag=="tbody"||tag=="tr"||tag=="td"){var rs;if(rs=_22(tag,_2f,el,_31)){return rs;}}switch(_2f){case"beforebegin":el.insertAdjacentHTML(_2f,_31);return el.previousSibling;case"afterbegin":el.insertAdjacentHTML(_2f,_31);return el.firstChild;case"beforeend":el.insertAdjacentHTML(_2f,_31);return el.lastChild;case"afterend":el.insertAdjacentHTML(_2f,_31);return el.nextSibling;}throw"Illegal insertion point -> \""+_2f+"\"";}var _34=el.ownerDocument.createRange();var _35;switch(_2f){case"beforebegin":_34.setStartBefore(el);_35=_34.createContextualFragment(_31);el.parentNode.insertBefore(_35,el);return el.previousSibling;case"afterbegin":if(el.firstChild){_34.setStartBefore(el.firstChild);_35=_34.createContextualFragment(_31);el.insertBefore(_35,el.firstChild);return el.firstChild;}else{el.innerHTML=_31;return el.firstChild;}case"beforeend":if(el.lastChild){_34.setStartAfter(el.lastChild);_35=_34.createContextualFragment(_31);el.appendChild(_35);return el.lastChild;}else{el.innerHTML=_31;return el.lastChild;}case"afterend":_34.setStartAfter(el);_35=_34.createContextualFragment(_31);el.parentNode.insertBefore(_35,el.nextSibling);return el.nextSibling;}throw"Illegal insertion point -> \""+_2f+"\"";},insertBefore:function(el,o,_38){return this.doInsert(el,o,_38,"beforeBegin");},insertAfter:function(el,o,_3b){return this.doInsert(el,o,_3b,"afterEnd","nextSibling");},insertFirst:function(el,o,_3e){return this.doInsert(el,o,_3e,"afterBegin");},doInsert:function(el,o,_41,pos,_43){el=Ext.getDom(el);var _44;if(this.useDom){_44=_c(o,null);el.parentNode.insertBefore(_44,_43?el[_43]:el);}else{var _45=_3(o);_44=this.insertHtml(pos,el,_45);}return _41?Ext.get(_44,true):_44;},append:function(el,o,_48){el=Ext.getDom(el);var _49;if(this.useDom){_49=_c(o,null);el.appendChild(_49);}else{var _4a=_3(o);_49=this.insertHtml("beforeEnd",el,_4a);}return _48?Ext.get(_49,true):_49;},overwrite:function(el,o,_4d){el=Ext.getDom(el);el.innerHTML=_3(o);return _4d?Ext.get(el.firstChild,true):el.firstChild;},createTemplate:function(o){var _4f=_3(o);return new Ext.Template(_4f);}};}(); |
| 11 | 11 | ||
| @@ -119,7 +119,7 @@ Ext.Button=function(_1,_2){Ext.apply(this,_2);this.addEvents({"click":true,"togg | @@ -119,7 +119,7 @@ Ext.Button=function(_1,_2){Ext.apply(this,_2);this.addEvents({"click":true,"togg | ||
| 119 | 119 | ||
| 120 | Ext.MenuButton=function(_1,_2){Ext.MenuButton.superclass.constructor.call(this,_1,_2);this.addEvents({"arrowclick":true});};Ext.extend(Ext.MenuButton,Ext.Button,{render:function(_3){var _4=new Ext.Template("<table cellspacing=\"0\" class=\"x-btn-menu-wrap x-btn\"><tr><td>","<table cellspacing=\"0\" class=\"x-btn-wrap x-btn-menu-text-wrap\"><tbody>","<tr><td class=\"x-btn-left\"><i> </i></td><td class=\"x-btn-center\"><button class=\"x-btn-text\" type=\"{1}\">{0}</button></td></tr>","</tbody></table></td><td>","<table cellspacing=\"0\" class=\"x-btn-wrap x-btn-menu-arrow-wrap\"><tbody>","<tr><td class=\"x-btn-center\"><button class=\"x-btn-menu-arrow-el\" type=\"button\"> </button></td><td class=\"x-btn-right\"><i> </i></td></tr>","</tbody></table></td></tr></table>");var _5=_4.append(_3,[this.text,this.type],true);if(this.cls){_5.addClass(this.cls);}if(this.icon){_5.child("button").setStyle("background-image","url("+this.icon+")");}this.el=_5;if(this.handleMouseEvents){_5.on("mouseover",this.onMouseOver,this);_5.on("mouseout",this.onMouseOut,this);_5.on("mousedown",this.onMouseDown,this);_5.on("mouseup",this.onMouseUp,this);}_5.on(this.clickEvent,this.onClick,this);if(this.tooltip){var _6=_5.child("button:first");if(typeof this.tooltip=="object"){Ext.QuickTips.tips(Ext.apply({target:_6.id},this.tooltip));}else{_6.dom[this.tooltipType]=this.tooltip;}}if(this.arrowTooltip){var _6=_5.child("button:nth(2)");_6.dom[this.tooltipType]=this.arrowTooltip;}if(this.hidden){this.hide();}if(this.disabled){this.disable();}if(Ext.isIE&&!Ext.isIE7){this.autoWidth.defer(1,this);}else{this.autoWidth();}if(this.menu){this.menu.on("show",this.onMenuShow,this);this.menu.on("hide",this.onMenuHide,this);}},autoWidth:function(){if(this.el){var _7=this.el.child("table:first");var _8=this.el.child("table:last");this.el.setWidth("auto");_7.setWidth("auto");if(Ext.isIE7&&Ext.isStrict){var ib=this.el.child("button:first");if(ib&&ib.getWidth()>20){ib.clip();ib.setWidth(Ext.util.TextMetrics.measure(ib,this.text).width+ib.getFrameWidth("lr"));}}if(this.minWidth){if(this.hidden){this.el.beginMeasure();}if((_7.getWidth()+_8.getWidth())<this.minWidth){_7.setWidth(this.minWidth-_8.getWidth());}if(this.hidden){this.el.endMeasure();}}this.el.setWidth(_7.getWidth()+_8.getWidth());}},setHandler:function(_a,_b){this.handler=_a;this.scope=_b;},setArrowHandler:function(_c,_d){this.arrowHandler=_c;this.scope=_d;},focus:function(){if(this.el){this.el.child("button:first").focus();}},onClick:function(e){e.preventDefault();if(!this.disabled){if(e.getTarget(".x-btn-menu-arrow-wrap")){if(this.menu&&!this.menu.isVisible()){this.menu.show(this.el,this.menuAlign);}this.fireEvent("arrowclick",this,e);if(this.arrowHandler){this.arrowHandler.call(this.scope||this,this,e);}}else{this.fireEvent("click",this,e);if(this.handler){this.handler.call(this.scope||this,this,e);}}}},onMouseDown:function(e){if(!this.disabled){Ext.fly(e.getTarget("table")).addClass("x-btn-click");}},onMouseUp:function(e){Ext.fly(e.getTarget("table")).removeClass("x-btn-click");}}); | 120 | Ext.MenuButton=function(_1,_2){Ext.MenuButton.superclass.constructor.call(this,_1,_2);this.addEvents({"arrowclick":true});};Ext.extend(Ext.MenuButton,Ext.Button,{render:function(_3){var _4=new Ext.Template("<table cellspacing=\"0\" class=\"x-btn-menu-wrap x-btn\"><tr><td>","<table cellspacing=\"0\" class=\"x-btn-wrap x-btn-menu-text-wrap\"><tbody>","<tr><td class=\"x-btn-left\"><i> </i></td><td class=\"x-btn-center\"><button class=\"x-btn-text\" type=\"{1}\">{0}</button></td></tr>","</tbody></table></td><td>","<table cellspacing=\"0\" class=\"x-btn-wrap x-btn-menu-arrow-wrap\"><tbody>","<tr><td class=\"x-btn-center\"><button class=\"x-btn-menu-arrow-el\" type=\"button\"> </button></td><td class=\"x-btn-right\"><i> </i></td></tr>","</tbody></table></td></tr></table>");var _5=_4.append(_3,[this.text,this.type],true);if(this.cls){_5.addClass(this.cls);}if(this.icon){_5.child("button").setStyle("background-image","url("+this.icon+")");}this.el=_5;if(this.handleMouseEvents){_5.on("mouseover",this.onMouseOver,this);_5.on("mouseout",this.onMouseOut,this);_5.on("mousedown",this.onMouseDown,this);_5.on("mouseup",this.onMouseUp,this);}_5.on(this.clickEvent,this.onClick,this);if(this.tooltip){var _6=_5.child("button:first");if(typeof this.tooltip=="object"){Ext.QuickTips.tips(Ext.apply({target:_6.id},this.tooltip));}else{_6.dom[this.tooltipType]=this.tooltip;}}if(this.arrowTooltip){var _6=_5.child("button:nth(2)");_6.dom[this.tooltipType]=this.arrowTooltip;}if(this.hidden){this.hide();}if(this.disabled){this.disable();}if(Ext.isIE&&!Ext.isIE7){this.autoWidth.defer(1,this);}else{this.autoWidth();}if(this.menu){this.menu.on("show",this.onMenuShow,this);this.menu.on("hide",this.onMenuHide,this);}},autoWidth:function(){if(this.el){var _7=this.el.child("table:first");var _8=this.el.child("table:last");this.el.setWidth("auto");_7.setWidth("auto");if(Ext.isIE7&&Ext.isStrict){var ib=this.el.child("button:first");if(ib&&ib.getWidth()>20){ib.clip();ib.setWidth(Ext.util.TextMetrics.measure(ib,this.text).width+ib.getFrameWidth("lr"));}}if(this.minWidth){if(this.hidden){this.el.beginMeasure();}if((_7.getWidth()+_8.getWidth())<this.minWidth){_7.setWidth(this.minWidth-_8.getWidth());}if(this.hidden){this.el.endMeasure();}}this.el.setWidth(_7.getWidth()+_8.getWidth());}},setHandler:function(_a,_b){this.handler=_a;this.scope=_b;},setArrowHandler:function(_c,_d){this.arrowHandler=_c;this.scope=_d;},focus:function(){if(this.el){this.el.child("button:first").focus();}},onClick:function(e){e.preventDefault();if(!this.disabled){if(e.getTarget(".x-btn-menu-arrow-wrap")){if(this.menu&&!this.menu.isVisible()){this.menu.show(this.el,this.menuAlign);}this.fireEvent("arrowclick",this,e);if(this.arrowHandler){this.arrowHandler.call(this.scope||this,this,e);}}else{this.fireEvent("click",this,e);if(this.handler){this.handler.call(this.scope||this,this,e);}}}},onMouseDown:function(e){if(!this.disabled){Ext.fly(e.getTarget("table")).addClass("x-btn-click");}},onMouseUp:function(e){Ext.fly(e.getTarget("table")).removeClass("x-btn-click");}}); |
| 121 | 121 | ||
| 122 | -Ext.Toolbar=function(_1,_2,_3){if(_1 instanceof Array){_2=_1;_3=_2;_1=null;}Ext.apply(this,_3);this.buttons=_2;if(_1){this.render(_1);}};Ext.Toolbar.prototype={render:function(ct){this.el=Ext.get(ct);if(this.cls){this.el.addClass(this.cls);}this.el.update("<div class=\"x-toolbar x-small-editor\"><table cellspacing=\"0\"><tr></tr></table></div>");this.tr=this.el.child("tr",true);var _5=0;this.items=new Ext.util.MixedCollection(false,function(o){return o.id||("item"+(++_5));});if(this.buttons){this.add.apply(this,this.buttons);delete this.buttons;}},add:function(){var a=arguments,l=a.length;for(var i=0;i<l;i++){var el=a[i];if(el.applyTo){this.addField(el);}else{if(el.render){this.addItem(el);}else{if(typeof el=="string"){if(el=="separator"||el=="-"){this.addSeparator();}else{if(el==" "){this.addSpacer();}else{if(el=="->"){this.addFill();}else{this.addText(el);}}}}else{if(el.tagName){this.addElement(el);}else{if(typeof el=="object"){this.addButton(el);}}}}}}},getEl:function(){return this.el;},addSeparator:function(){return this.addItem(new Ext.Toolbar.Separator());},addSpacer:function(){return this.addItem(new Ext.Toolbar.Spacer());},addFill:function(){return this.addItem(new Ext.Toolbar.Fill());},addElement:function(el){return this.addItem(new Ext.Toolbar.Item(el));},addItem:function(_c){var td=this.nextBlock();_c.render(td);this.items.add(_c);return _c;},addButton:function(_e){if(_e instanceof Array){var _f=[];for(var i=0,len=_e.length;i<len;i++){_f.push(this.addButton(_e[i]));}return _f;}var b=_e;if(!(_e instanceof Ext.Toolbar.Button)){b=new Ext.Toolbar.Button(_e);}var td=this.nextBlock();b.render(td);this.items.add(b);return b;},addText:function(_14){return this.addItem(new Ext.Toolbar.TextItem(_14));},insertButton:function(_15,_16){if(_16 instanceof Array){var _17=[];for(var i=0,len=_16.length;i<len;i++){_17.push(this.insertButton(_15+i,_16[i]));}return _17;}if(!(_16 instanceof Ext.Toolbar.Button)){_16=new Ext.Toolbar.Button(_16);}var td=document.createElement("td");this.tr.insertBefore(td,this.tr.childNodes[_15]);_16.render(td);this.items.insert(_15,_16);return _16;},addDom:function(_1b,_1c){var td=this.nextBlock();Ext.DomHelper.overwrite(td,_1b);var ti=new Ext.Toolbar.Item(td.firstChild);ti.render(td);this.items.add(ti);return ti;},addField:function(_1f){var td=this.nextBlock();_1f.render(td);var ti=new Ext.Toolbar.Item(td.firstChild);ti.render(td);this.items.add(ti);return ti;},nextBlock:function(){var td=document.createElement("td");this.tr.appendChild(td);return td;},destroy:function(){if(this.items){Ext.destroy.apply(Ext,this.items.items);}Ext.Element.uncache(this.el,this.tr);}};Ext.Toolbar.Item=function(el){this.el=Ext.getDom(el);this.id=Ext.id(this.el);this.hidden=false;};Ext.Toolbar.Item.prototype={getEl:function(){return this.el;},render:function(td){this.td=td;td.appendChild(this.el);},destroy:function(){this.td.parentNode.removeChild(this.td);},show:function(){this.hidden=false;this.td.style.display="";},hide:function(){this.hidden=true;this.td.style.display="none";},setVisible:function(_25){if(_25){this.show();}else{this.hide();}},focus:function(){Ext.fly(this.el).focus();},disable:function(){Ext.fly(this.td).addClass("x-item-disabled");this.disabled=true;this.el.disabled=true;},enable:function(){Ext.fly(this.td).removeClass("x-item-disabled");this.disabled=false;this.el.disabled=false;}};Ext.Toolbar.Separator=function(){var s=document.createElement("span");s.className="ytb-sep";Ext.Toolbar.Separator.superclass.constructor.call(this,s);};Ext.extend(Ext.Toolbar.Separator,Ext.Toolbar.Item,{enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.Toolbar.Spacer=function(){var s=document.createElement("div");s.className="ytb-spacer";Ext.Toolbar.Spacer.superclass.constructor.call(this,s);};Ext.extend(Ext.Toolbar.Spacer,Ext.Toolbar.Item,{enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.Toolbar.Fill=Ext.extend(Ext.Toolbar.Spacer,{render:function(td){td.style.width="100%";Ext.Toolbar.Fill.superclass.render.call(this,td);}});Ext.Toolbar.TextItem=function(_29){var s=document.createElement("span");s.className="ytb-text";s.innerHTML=_29;Ext.Toolbar.TextItem.superclass.constructor.call(this,s);};Ext.extend(Ext.Toolbar.TextItem,Ext.Toolbar.Item,{enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.Toolbar.Button=function(_2b){Ext.Toolbar.Button.superclass.constructor.call(this,null,_2b);};Ext.extend(Ext.Toolbar.Button,Ext.Button,{render:function(td){this.td=td;Ext.Toolbar.Button.superclass.render.call(this,td);},destroy:function(){Ext.Toolbar.Button.superclass.destroy.call(this);this.td.parentNode.removeChild(this.td);},show:function(){this.hidden=false;this.td.style.display="";},hide:function(){this.hidden=true;this.td.style.display="none";},disable:function(){Ext.fly(this.td).addClass("x-item-disabled");this.disabled=true;},enable:function(){Ext.fly(this.td).removeClass("x-item-disabled");this.disabled=false;}});Ext.ToolbarButton=Ext.Toolbar.Button;Ext.Toolbar.MenuButton=function(_2d){Ext.Toolbar.MenuButton.superclass.constructor.call(this,null,_2d);};Ext.extend(Ext.Toolbar.MenuButton,Ext.MenuButton,{render:function(td){this.td=td;Ext.Toolbar.MenuButton.superclass.render.call(this,td);},destroy:function(){Ext.Toolbar.MenuButton.superclass.destroy.call(this);this.td.parentNode.removeChild(this.td);},show:function(){this.hidden=false;this.td.style.display="";},hide:function(){this.hidden=true;this.td.style.display="none";}}); | 122 | +Ext.Toolbar=function(_1,_2,_3){if(_1 instanceof Array){_2=_1;_3=_2;_1=null;}Ext.apply(this,_3);this.buttons=_2;if(_1){this.render(_1);}};Ext.Toolbar.prototype={render:function(ct){this.el=Ext.get(ct);if(this.cls){this.el.addClass(this.cls);}this.el.update("<div class=\""+this.cls+" x-small-editor\"><table cellspacing=\"0\"><tr></tr></table></div>");this.tr=this.el.child("tr",true);var _5=0;this.items=new Ext.util.MixedCollection(false,function(o){return o.id||("item"+(++_5));});if(this.buttons){this.add.apply(this,this.buttons);delete this.buttons;}},add:function(){var a=arguments,l=a.length;for(var i=0;i<l;i++){var el=a[i];if(el.applyTo){this.addField(el);}else{if(el.render){this.addItem(el);}else{if(typeof el=="string"){if(el=="separator"||el=="-"){this.addSeparator();}else{if(el==" "){this.addSpacer();}else{if(el=="->"){this.addFill();}else{this.addText(el);}}}}else{if(el.tagName){this.addElement(el);}else{if(typeof el=="object"){this.addButton(el);}}}}}}},getEl:function(){return this.el;},addSeparator:function(){return this.addItem(new Ext.Toolbar.Separator());},addSpacer:function(){return this.addItem(new Ext.Toolbar.Spacer());},addFill:function(){return this.addItem(new Ext.Toolbar.Fill());},addElement:function(el){return this.addItem(new Ext.Toolbar.Item(el));},addItem:function(_c){var td=this.nextBlock();_c.render(td);this.items.add(_c);return _c;},addButton:function(_e){if(_e instanceof Array){var _f=[];for(var i=0,len=_e.length;i<len;i++){_f.push(this.addButton(_e[i]));}return _f;}var b=_e;if(!(_e instanceof Ext.Toolbar.Button)){b=new Ext.Toolbar.Button(_e);}var td=this.nextBlock();b.render(td);this.items.add(b);return b;},addText:function(_14){return this.addItem(new Ext.Toolbar.TextItem(_14));},insertButton:function(_15,_16){if(_16 instanceof Array){var _17=[];for(var i=0,len=_16.length;i<len;i++){_17.push(this.insertButton(_15+i,_16[i]));}return _17;}if(!(_16 instanceof Ext.Toolbar.Button)){_16=new Ext.Toolbar.Button(_16);}var td=document.createElement("td");this.tr.insertBefore(td,this.tr.childNodes[_15]);_16.render(td);this.items.insert(_15,_16);return _16;},addDom:function(_1b,_1c){var td=this.nextBlock();Ext.DomHelper.overwrite(td,_1b);var ti=new Ext.Toolbar.Item(td.firstChild);ti.render(td);this.items.add(ti);return ti;},addField:function(_1f){var td=this.nextBlock();_1f.render(td);var ti=new Ext.Toolbar.Item(td.firstChild);ti.render(td);this.items.add(ti);return ti;},nextBlock:function(){var td=document.createElement("td");this.tr.appendChild(td);return td;},destroy:function(){if(this.items){Ext.destroy.apply(Ext,this.items.items);}Ext.Element.uncache(this.el,this.tr);}};Ext.Toolbar.Item=function(el){this.el=Ext.getDom(el);this.id=Ext.id(this.el);this.hidden=false;};Ext.Toolbar.Item.prototype={getEl:function(){return this.el;},render:function(td){this.td=td;td.appendChild(this.el);},destroy:function(){this.td.parentNode.removeChild(this.td);},show:function(){this.hidden=false;this.td.style.display="";},hide:function(){this.hidden=true;this.td.style.display="none";},setVisible:function(_25){if(_25){this.show();}else{this.hide();}},focus:function(){Ext.fly(this.el).focus();},disable:function(){Ext.fly(this.td).addClass("x-item-disabled");this.disabled=true;this.el.disabled=true;},enable:function(){Ext.fly(this.td).removeClass("x-item-disabled");this.disabled=false;this.el.disabled=false;}};Ext.Toolbar.Separator=function(){var s=document.createElement("span");s.className="ytb-sep";Ext.Toolbar.Separator.superclass.constructor.call(this,s);};Ext.extend(Ext.Toolbar.Separator,Ext.Toolbar.Item,{enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.Toolbar.Spacer=function(){var s=document.createElement("div");s.className="ytb-spacer";Ext.Toolbar.Spacer.superclass.constructor.call(this,s);};Ext.extend(Ext.Toolbar.Spacer,Ext.Toolbar.Item,{enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.Toolbar.Fill=Ext.extend(Ext.Toolbar.Spacer,{render:function(td){td.style.width="100%";Ext.Toolbar.Fill.superclass.render.call(this,td);}});Ext.Toolbar.TextItem=function(_29){var s=document.createElement("span");s.className="ytb-text";s.innerHTML=_29;Ext.Toolbar.TextItem.superclass.constructor.call(this,s);};Ext.extend(Ext.Toolbar.TextItem,Ext.Toolbar.Item,{enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.Toolbar.Button=function(_2b){Ext.Toolbar.Button.superclass.constructor.call(this,null,_2b);};Ext.extend(Ext.Toolbar.Button,Ext.Button,{render:function(td){this.td=td;Ext.Toolbar.Button.superclass.render.call(this,td);},destroy:function(){Ext.Toolbar.Button.superclass.destroy.call(this);this.td.parentNode.removeChild(this.td);},show:function(){this.hidden=false;this.td.style.display="";},hide:function(){this.hidden=true;this.td.style.display="none";},disable:function(){Ext.fly(this.td).addClass("x-item-disabled");this.disabled=true;},enable:function(){Ext.fly(this.td).removeClass("x-item-disabled");this.disabled=false;}});Ext.ToolbarButton=Ext.Toolbar.Button;Ext.Toolbar.MenuButton=function(_2d){Ext.Toolbar.MenuButton.superclass.constructor.call(this,null,_2d);};Ext.extend(Ext.Toolbar.MenuButton,Ext.MenuButton,{render:function(td){this.td=td;Ext.Toolbar.MenuButton.superclass.render.call(this,td);},destroy:function(){Ext.Toolbar.MenuButton.superclass.destroy.call(this);this.td.parentNode.removeChild(this.td);},show:function(){this.hidden=false;this.td.style.display="";},hide:function(){this.hidden=true;this.td.style.display="none";}}); |
| 123 | 123 | ||
| 124 | Ext.PagingToolbar=function(el,ds,_3){Ext.PagingToolbar.superclass.constructor.call(this,el,null,_3);this.ds=ds;this.cursor=0;this.renderButtons(this.el);this.bind(ds);};Ext.extend(Ext.PagingToolbar,Ext.Toolbar,{pageSize:20,displayMsg:"Displaying {0} - {1} of {2}",emptyMsg:"No data to display",beforePageText:"Page",afterPageText:"of {0}",firstText:"First Page",prevText:"Previous Page",nextText:"Next Page",lastText:"Last Page",refreshText:"Refresh",renderButtons:function(el){Ext.PagingToolbar.superclass.render.call(this,el);this.first=this.addButton({tooltip:this.firstText,cls:"x-btn-icon x-grid-page-first",disabled:true,handler:this.onClick.createDelegate(this,["first"])});this.prev=this.addButton({tooltip:this.prevText,cls:"x-btn-icon x-grid-page-prev",disabled:true,handler:this.onClick.createDelegate(this,["prev"])});this.addSeparator();this.add(this.beforePageText);this.field=Ext.get(this.addDom({tag:"input",type:"text",size:"3",value:"1",cls:"x-grid-page-number"}).el);this.field.on("keydown",this.onPagingKeydown,this);this.field.on("focus",function(){this.dom.select();});this.afterTextEl=this.addText(String.format(this.afterPageText,1));this.field.setHeight(18);this.addSeparator();this.next=this.addButton({tooltip:this.nextText,cls:"x-btn-icon x-grid-page-next",disabled:true,handler:this.onClick.createDelegate(this,["next"])});this.last=this.addButton({tooltip:this.lastText,cls:"x-btn-icon x-grid-page-last",disabled:true,handler:this.onClick.createDelegate(this,["last"])});this.addSeparator();this.loading=this.addButton({tooltip:this.refreshText,cls:"x-btn-icon x-grid-loading",disabled:true,handler:this.onClick.createDelegate(this,["refresh"])});if(this.displayInfo){this.displayEl=Ext.fly(this.el.dom.firstChild).createChild({cls:"x-paging-info"});}},updateInfo:function(){if(this.displayEl){var _5=this.ds.getCount();var _6=_5==0?this.emptyMsg:String.format(this.displayMsg,this.cursor+1,this.cursor+_5,this.ds.getTotalCount());this.displayEl.update(_6);}},onLoad:function(ds,r,o){this.cursor=o.params?o.params.start:0;var d=this.getPageData(),ap=d.activePage,ps=d.pages;this.afterTextEl.el.innerHTML=String.format(this.afterPageText,d.pages);this.field.dom.value=ap;this.first.setDisabled(ap==1);this.prev.setDisabled(ap==1);this.next.setDisabled(ap==ps);this.last.setDisabled(ap==ps);this.loading.enable();this.updateInfo();},getPageData:function(){var _d=this.ds.getTotalCount();return{total:_d,activePage:Math.ceil((this.cursor+this.pageSize)/this.pageSize),pages:_d<this.pageSize?1:Math.ceil(_d/this.pageSize)};},onLoadError:function(){this.loading.enable();},onPagingKeydown:function(e){var k=e.getKey();var d=this.getPageData();if(k==e.RETURN){var v=this.field.dom.value,_12;if(!v||isNaN(_12=parseInt(v,10))){this.field.dom.value=d.activePage;return;}_12=Math.min(Math.max(1,_12),d.pages)-1;this.ds.load({params:{start:_12*this.pageSize,limit:this.pageSize}});e.stopEvent();}else{if(k==e.HOME||(k==e.UP&&e.ctrlKey)||(k==e.PAGEUP&&e.ctrlKey)||(k==e.RIGHT&&e.ctrlKey)||k==e.END||(k==e.DOWN&&e.ctrlKey)||(k==e.LEFT&&e.ctrlKey)||(k==e.PAGEDOWN&&e.ctrlKey)){var _12=(k==e.HOME||(k==e.DOWN&&e.ctrlKey)||(k==e.LEFT&&e.ctrlKey)||(k==e.PAGEDOWN&&e.ctrlKey))?1:d.pages;this.field.dom.value=_12;this.ds.load({params:{start:(_12-1)*this.pageSize,limit:this.pageSize}});e.stopEvent();}else{if(k==e.UP||k==e.RIGHT||k==e.PAGEUP||k==e.DOWN||k==e.LEFT||k==e.PAGEDOWN){var v=this.field.dom.value,_12;var _13=(e.shiftKey)?10:1;if(k==e.DOWN||k==e.LEFT||k==e.PAGEDOWN){_13*=-1;}if(!v||isNaN(_12=parseInt(v,10))){this.field.dom.value=d.activePage;return;}else{if(parseInt(v,10)+_13>=1&parseInt(v,10)+_13<=d.pages){this.field.dom.value=parseInt(v,10)+_13;_12=Math.min(Math.max(1,_12+_13),d.pages)-1;this.ds.load({params:{start:_12*this.pageSize,limit:this.pageSize}});}}e.stopEvent();}}}},beforeLoad:function(){if(this.loading){this.loading.disable();}},onClick:function(_14){var ds=this.ds;switch(_14){case"first":ds.load({params:{start:0,limit:this.pageSize}});break;case"prev":ds.load({params:{start:Math.max(0,this.cursor-this.pageSize),limit:this.pageSize}});break;case"next":ds.load({params:{start:this.cursor+this.pageSize,limit:this.pageSize}});break;case"last":var _16=ds.getTotalCount();var _17=_16%this.pageSize;var _18=_17?(_16-_17):_16-this.pageSize;ds.load({params:{start:_18,limit:this.pageSize}});break;case"refresh":ds.load({params:{start:this.cursor,limit:this.pageSize}});break;}},unbind:function(ds){ds.un("beforeload",this.beforeLoad,this);ds.un("load",this.onLoad,this);ds.un("loadexception",this.onLoadError,this);this.ds=undefined;},bind:function(ds){ds.on("beforeload",this.beforeLoad,this);ds.on("load",this.onLoad,this);ds.on("loadexception",this.onLoadError,this);this.ds=ds;}}); | 124 | Ext.PagingToolbar=function(el,ds,_3){Ext.PagingToolbar.superclass.constructor.call(this,el,null,_3);this.ds=ds;this.cursor=0;this.renderButtons(this.el);this.bind(ds);};Ext.extend(Ext.PagingToolbar,Ext.Toolbar,{pageSize:20,displayMsg:"Displaying {0} - {1} of {2}",emptyMsg:"No data to display",beforePageText:"Page",afterPageText:"of {0}",firstText:"First Page",prevText:"Previous Page",nextText:"Next Page",lastText:"Last Page",refreshText:"Refresh",renderButtons:function(el){Ext.PagingToolbar.superclass.render.call(this,el);this.first=this.addButton({tooltip:this.firstText,cls:"x-btn-icon x-grid-page-first",disabled:true,handler:this.onClick.createDelegate(this,["first"])});this.prev=this.addButton({tooltip:this.prevText,cls:"x-btn-icon x-grid-page-prev",disabled:true,handler:this.onClick.createDelegate(this,["prev"])});this.addSeparator();this.add(this.beforePageText);this.field=Ext.get(this.addDom({tag:"input",type:"text",size:"3",value:"1",cls:"x-grid-page-number"}).el);this.field.on("keydown",this.onPagingKeydown,this);this.field.on("focus",function(){this.dom.select();});this.afterTextEl=this.addText(String.format(this.afterPageText,1));this.field.setHeight(18);this.addSeparator();this.next=this.addButton({tooltip:this.nextText,cls:"x-btn-icon x-grid-page-next",disabled:true,handler:this.onClick.createDelegate(this,["next"])});this.last=this.addButton({tooltip:this.lastText,cls:"x-btn-icon x-grid-page-last",disabled:true,handler:this.onClick.createDelegate(this,["last"])});this.addSeparator();this.loading=this.addButton({tooltip:this.refreshText,cls:"x-btn-icon x-grid-loading",disabled:true,handler:this.onClick.createDelegate(this,["refresh"])});if(this.displayInfo){this.displayEl=Ext.fly(this.el.dom.firstChild).createChild({cls:"x-paging-info"});}},updateInfo:function(){if(this.displayEl){var _5=this.ds.getCount();var _6=_5==0?this.emptyMsg:String.format(this.displayMsg,this.cursor+1,this.cursor+_5,this.ds.getTotalCount());this.displayEl.update(_6);}},onLoad:function(ds,r,o){this.cursor=o.params?o.params.start:0;var d=this.getPageData(),ap=d.activePage,ps=d.pages;this.afterTextEl.el.innerHTML=String.format(this.afterPageText,d.pages);this.field.dom.value=ap;this.first.setDisabled(ap==1);this.prev.setDisabled(ap==1);this.next.setDisabled(ap==ps);this.last.setDisabled(ap==ps);this.loading.enable();this.updateInfo();},getPageData:function(){var _d=this.ds.getTotalCount();return{total:_d,activePage:Math.ceil((this.cursor+this.pageSize)/this.pageSize),pages:_d<this.pageSize?1:Math.ceil(_d/this.pageSize)};},onLoadError:function(){this.loading.enable();},onPagingKeydown:function(e){var k=e.getKey();var d=this.getPageData();if(k==e.RETURN){var v=this.field.dom.value,_12;if(!v||isNaN(_12=parseInt(v,10))){this.field.dom.value=d.activePage;return;}_12=Math.min(Math.max(1,_12),d.pages)-1;this.ds.load({params:{start:_12*this.pageSize,limit:this.pageSize}});e.stopEvent();}else{if(k==e.HOME||(k==e.UP&&e.ctrlKey)||(k==e.PAGEUP&&e.ctrlKey)||(k==e.RIGHT&&e.ctrlKey)||k==e.END||(k==e.DOWN&&e.ctrlKey)||(k==e.LEFT&&e.ctrlKey)||(k==e.PAGEDOWN&&e.ctrlKey)){var _12=(k==e.HOME||(k==e.DOWN&&e.ctrlKey)||(k==e.LEFT&&e.ctrlKey)||(k==e.PAGEDOWN&&e.ctrlKey))?1:d.pages;this.field.dom.value=_12;this.ds.load({params:{start:(_12-1)*this.pageSize,limit:this.pageSize}});e.stopEvent();}else{if(k==e.UP||k==e.RIGHT||k==e.PAGEUP||k==e.DOWN||k==e.LEFT||k==e.PAGEDOWN){var v=this.field.dom.value,_12;var _13=(e.shiftKey)?10:1;if(k==e.DOWN||k==e.LEFT||k==e.PAGEDOWN){_13*=-1;}if(!v||isNaN(_12=parseInt(v,10))){this.field.dom.value=d.activePage;return;}else{if(parseInt(v,10)+_13>=1&parseInt(v,10)+_13<=d.pages){this.field.dom.value=parseInt(v,10)+_13;_12=Math.min(Math.max(1,_12+_13),d.pages)-1;this.ds.load({params:{start:_12*this.pageSize,limit:this.pageSize}});}}e.stopEvent();}}}},beforeLoad:function(){if(this.loading){this.loading.disable();}},onClick:function(_14){var ds=this.ds;switch(_14){case"first":ds.load({params:{start:0,limit:this.pageSize}});break;case"prev":ds.load({params:{start:Math.max(0,this.cursor-this.pageSize),limit:this.pageSize}});break;case"next":ds.load({params:{start:this.cursor+this.pageSize,limit:this.pageSize}});break;case"last":var _16=ds.getTotalCount();var _17=_16%this.pageSize;var _18=_17?(_16-_17):_16-this.pageSize;ds.load({params:{start:_18,limit:this.pageSize}});break;case"refresh":ds.load({params:{start:this.cursor,limit:this.pageSize}});break;}},unbind:function(ds){ds.un("beforeload",this.beforeLoad,this);ds.un("load",this.onLoad,this);ds.un("loadexception",this.onLoadError,this);this.ds=undefined;},bind:function(ds){ds.on("beforeload",this.beforeLoad,this);ds.on("load",this.onLoad,this);ds.on("loadexception",this.onLoadError,this);this.ds=ds;}}); |
| 125 | 125 |