Commit 668e2c58a95619a41bc23a4a1b887e3d723683f4

Authored by Conrad Vermeulen
1 parent b9463512

KTS-3376

"The "recent search list" that shows up in the search portlet is sharing everyone's recent searches"
Fixed.

Committed By: Conrad Vermeulen
Reviewed By: Megan Watson

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@8922 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/templating/smartytemplate.inc.php
... ... @@ -8,31 +8,31 @@
8 8 * Document Management Made Simple
9 9 * Copyright (C) 2008 KnowledgeTree Inc.
10 10 * Portions copyright The Jam Warehouse Software (Pty) Limited
11   - *
  11 + *
12 12 * This program is free software; you can redistribute it and/or modify it under
13 13 * the terms of the GNU General Public License version 3 as published by the
14 14 * Free Software Foundation.
15   - *
  15 + *
16 16 * This program is distributed in the hope that it will be useful, but WITHOUT
17 17 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 18 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19 19 * details.
20   - *
  20 + *
21 21 * You should have received a copy of the GNU General Public License
22 22 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23   - *
24   - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
  23 + *
  24 + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
25 25 * California 94120-7775, or email info@knowledgetree.com.
26   - *
  26 + *
27 27 * The interactive user interfaces in modified source and object code versions
28 28 * of this program must display Appropriate Legal Notices, as required under
29 29 * Section 5 of the GNU General Public License version 3.
30   - *
  30 + *
31 31 * In accordance with Section 7(b) of the GNU General Public License version 3,
32 32 * these Appropriate Legal Notices must retain the display of the "Powered by
33   - * KnowledgeTree" logo and retain the original copyright notice. If the display of the
  33 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
34 34 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
35   - * must display the words "Powered by KnowledgeTree" and retain the original
  35 + * must display the words "Powered by KnowledgeTree" and retain the original
36 36 * copyright notice.
37 37 * Contributor( s): ______________________________________
38 38 */
... ... @@ -104,6 +104,8 @@ class KTSmartyTemplate extends KTTemplate {
104 104 $_SESSION['search2_quickQuery'] = '';
105 105 }
106 106  
  107 + $smarty->assign('search2_anonymous', !array_key_exists('userID', $_SESSION) || ($_SESSION['userID'] == -2));
  108 + $smarty->assign('search2_user', $_SESSION['userId']);
107 109 $smarty->assign('search2_quick', $search2_quick);
108 110 $smarty->assign('search2_general', $search2_general);
109 111 $smarty->assign('search2_quickQuery', $search2_quickQuery);
... ...
templates/ktcore/search2/search_portlet.smarty
... ... @@ -4,7 +4,9 @@
4 4 <ul class="actionlist">
5 5 <li><a href="{$rootUrl}/search2.php?action=guiBuilder">{i18n}Advanced Search{/i18n}</a></li>
6 6 <li><a href="{$rootUrl}/search2.php?action=queryBuilder">{i18n}Search Criteria Editor{/i18n}</a></li>
  7 +{if !$search2_anonymous}
7 8 <li><a href="{$rootUrl}/search2.php?action=manage"><nobr>{i18n}Manage Saved Search{/i18n}</a></li>
  9 +{/if}
8 10 </ul>
9 11  
10 12 {if (count($savedSearches) > 0)}
... ...
templates/ktcore/search2/search_results.smarty
... ... @@ -13,7 +13,7 @@
13 13 {/capture}
14 14 {i18n arg_options=$options}Use the #options# to extend your search criteria.{/i18n}
15 15 {/if}
16   -{if !empty($iSavedID)}
  16 +{if !$search2_anonymous && !empty($iSavedID)}
17 17 {capture assign=options}
18 18 <a href="{addQS}action=queryBuilder&fSavedSearchId={$iSavedID}{/addQS}">Query Editor</a>
19 19 {/capture}
... ... @@ -22,7 +22,7 @@
22 22 <font color=brown><div id="savedSearch" style="display: none">{i18n}The search criteria has been saved.{/i18n}</div></font>
23 23 </fieldset>
24 24 <br>
25   -{if !empty($iSavedID)}
  25 +{if !$search2_anonymous && !empty($iSavedID)}
26 26 <fieldset>
27 27 <legend>{i18n}Saved Search{/i18n}</legend>
28 28 {i18n}This is the saved search criteria:{/i18n} {$txtSavedName}. <br/>
... ... @@ -98,7 +98,7 @@ function onShowAll(showall)
98 98 {/literal}
99 99 </div>
100 100 </div>
101   -{if empty($iSavedID)}
  101 +{if !$search2_anonymous && empty($iSavedID)}
102 102 <div id="saveSearch">
103 103 <fieldset>
104 104 <legend>{i18n}You can save this search:{/i18n}</legend>
... ...