[Koha-patches] [PATCH] Cannot use the same TMPL_VAR to select ALL options.

Joe Atzberger joe.atzberger at liblime.com
Mon Jul 20 22:37:24 CEST 2009


Only one select can be selected in this case.  If preselection of search type is
desired, I recommend a clean implementation w/ jquery instead of adding a conditional
for each select.  Please note, that is the only good way to get multiple preselections,
since the same .inc file will be used in each case.  So a single variable like
    <TMPL_IF NAME="index_bc_selected">
cannot be used, since it would set for ALL (3) advanced search dropdowns.
---
 .../prog/en/includes/search_indexes.inc            |   75 +++++++-------------
 1 files changed, 25 insertions(+), 50 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc
index 087955c..a8e06eb 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc
@@ -1,52 +1,27 @@
 <select name="idx">
-<!-- TMPL_IF NAME="selected" --><option value="kw" selected="selected">Keyword</option><!-- TMPL_ELSE --><option value="kw">Keyword</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="au,wrdl" selected="selected">Author</option><!-- TMPL_ELSE --><option value="au">Author</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="au,phr" selected="selected">&nbsp;&nbsp;&nbsp;&nbsp; Author as Phrase</option><!-- TMPL_ELSE --><option value="au,phr">&nbsp;&nbsp;&nbsp;&nbsp; Author as Phrase</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="cpn,wrdl" selected="selected">&nbsp;&nbsp;&nbsp;&nbsp; Corporate Name</option><!-- TMPL_ELSE --><option value="cpn">&nbsp;&nbsp;&nbsp;&nbsp; Corporate Name</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="cfn,wrdl" selected="selected">&nbsp;&nbsp;&nbsp;&nbsp; Conference Name</option><!-- TMPL_ELSE --><option value="cfn">&nbsp;&nbsp;&nbsp;&nbsp; Conference Name</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="cpn,phr" selected="selected">&nbsp;&nbsp;&nbsp;&nbsp; Corporate Name as Phrase</option><!-- TMPL_ELSE --><option value="cpn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Corporate Name as Phrase</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="cfn,phr" selected="selected">&nbsp;&nbsp;&nbsp;&nbsp; Conference Name as Phrase</option><!-- TMPL_ELSE --><option value="cfn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Conference Name as Phrase</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="pn" selected="selected">&nbsp;&nbsp;&nbsp;&nbsp; Personal Name</option><!-- TMPL_ELSE --><option value="pn">&nbsp;&nbsp;&nbsp;&nbsp; Personal Name</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="pn,phr" selected="selected">&nbsp;&nbsp;&nbsp;&nbsp; Personal Name as Phrase</option><!-- TMPL_ELSE --><option value="pn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Personal Name as Phrase</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="ln" selected="selected">Language</option><!-- TMPL_ELSE --><option value="ln">Language</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="nt" selected="selected">Notes/Comments</option><!-- TMPL_ELSE --><option value="nt">Notes/Comments</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="pb" selected="selected">Publisher</option><!-- TMPL_ELSE --><option value="pb">Publisher</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="pl" selected="selected">Publisher Location</option><!-- TMPL_ELSE --><option value="pl">Publisher Location</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="yr" selected="selected">Publication Date (yyyy)</option><!-- TMPL_ELSE --><option value="yr">Publication Date (yyyy)</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="acqdate" selected="selected">Acquisition Date (yyyy-mm-dd)</option><!-- TMPL_ELSE --><option value="acqdate">Acquisition Date (yyyy-mm-dd)</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="sn" selected="selected">Standard Number</option><!-- TMPL_ELSE --><option value="sn">Standard Number</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="nb" selected="selected">&nbsp;&nbsp;&nbsp;&nbsp; ISBN</option><!-- TMPL_ELSE --><option value="nb">&nbsp;&nbsp;&nbsp;&nbsp; ISBN</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="ns" selected="selected">&nbsp;&nbsp;&nbsp;&nbsp; ISSN</option><!-- TMPL_ELSE --><option value="ns">&nbsp;&nbsp;&nbsp;&nbsp; ISSN</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="lcn,phr" selected="selected">&nbsp;&nbsp;&nbsp;&nbsp; Call Number</option><!-- TMPL_ELSE --><option value="lcn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Call Number</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="su" selected="selected">Subject</option><!-- TMPL_ELSE --><option value="su">Subject</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="su,phr" selected="selected">&nbsp;&nbsp;&nbsp;&nbsp; Subject as Phrase</option><!-- TMPL_ELSE --><option value="su,phr">&nbsp;&nbsp;&nbsp;&nbsp; Subject as Phrase</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="ti" selected="selected">Title</option><!-- TMPL_ELSE --><option value="ti">Title</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="ti,phr" selected="selected">&nbsp;&nbsp;&nbsp;&nbsp; Title as Phrase</option><!-- TMPL_ELSE --><option value="ti,phr">&nbsp;&nbsp;&nbsp;&nbsp; Title as Phrase</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="se" selected="selected">&nbsp;&nbsp;&nbsp;&nbsp; Series Title</option><!-- TMPL_ELSE --><option value="se">&nbsp;&nbsp;&nbsp;&nbsp; Series Title</option><!-- /TMPL_IF -->
-
-<!-- TMPL_IF NAME="selected" --><option value="bc" selected="selected">Barcode</option><!-- TMPL_ELSE --><option value="bc">Barcode</option>
-<!-- /TMPL_IF -->
+    <option value="kw">Keyword</option>
+    <option value="au">Author</option>
+    <option value="au,phr">&nbsp;&nbsp;&nbsp;&nbsp; Author as Phrase</option>
+    <option value="cpn">&nbsp;&nbsp;&nbsp;&nbsp; Corporate Name</option>
+    <option value="cfn">&nbsp;&nbsp;&nbsp;&nbsp; Conference Name</option>
+    <option value="cpn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Corporate Name as Phrase</option>
+    <option value="cfn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Conference Name as Phrase</option>
+    <option value="pn">&nbsp;&nbsp;&nbsp;&nbsp; Personal Name</option>
+    <option value="pn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Personal Name as Phrase</option>
+    <option value="ln">Language</option>
+    <option value="nt">Notes/Comments</option>
+    <option value="pb">Publisher</option>
+    <option value="pl">Publisher Location</option>
+    <option value="yr">Publication Date (yyyy)</option>
+    <option value="acqdate">Acquisition Date (yyyy-mm-dd)</option>
+    <option value="sn">Standard Number</option>
+    <option value="nb">&nbsp;&nbsp;&nbsp;&nbsp; ISBN</option>
+    <option value="ns">&nbsp;&nbsp;&nbsp;&nbsp; ISSN</option>
+    <option value="lcn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Call Number</option>
+    <option value="su">Subject</option>
+    <option value="su,phr">&nbsp;&nbsp;&nbsp;&nbsp; Subject as Phrase</option>
+    <option value="ti">Title</option>
+    <option value="ti,phr">&nbsp;&nbsp;&nbsp;&nbsp; Title as Phrase</option>
+    <option value="se">&nbsp;&nbsp;&nbsp;&nbsp; Series Title</option>
+    <option value="bc">Barcode</option>
 </select>
-- 
1.5.6.5




More information about the Koha-patches mailing list