[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] koha authorities/authorities-home.pl authoritie... [rel_3_0]
From: |
Henri-Damien LAURENT |
Subject: |
[Koha-cvs] koha authorities/authorities-home.pl authoritie... [rel_3_0] |
Date: |
Fri, 02 Feb 2007 18:07:42 +0000 |
CVSROOT: /cvsroot/koha
Module name: koha
Branch: rel_3_0
Changes by: Henri-Damien LAURENT <hdl> 07/02/02 18:07:42
Modified files:
authorities : authorities-home.pl authorities.pl
C4 : AuthoritiesMarc.pm
koha-tmpl/intranet-tmpl/prog/en/authorities: auth_finder.tmpl
authorities-home.tmpl
authorities.tmpl
searchresultlist-auth.tmpl
Log message:
Sorting and searching for exact term now works.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/authorities/authorities-home.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.14.2.3&r2=1.14.2.4
http://cvs.savannah.gnu.org/viewcvs/koha/authorities/authorities.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.15.2.8&r2=1.15.2.9
http://cvs.savannah.gnu.org/viewcvs/koha/C4/AuthoritiesMarc.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.28.2.15&r2=1.28.2.16
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/authorities/auth_finder.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.3&r2=1.1.2.4
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/authorities/authorities-home.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.1&r2=1.1.2.2
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/authorities/authorities.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.2.2.3&r2=1.2.2.4
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/authorities/searchresultlist-auth.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.4&r2=1.1.2.5
Patches:
Index: authorities/authorities-home.pl
===================================================================
RCS file: /cvsroot/koha/koha/authorities/authorities-home.pl,v
retrieving revision 1.14.2.3
retrieving revision 1.14.2.4
diff -u -b -r1.14.2.3 -r1.14.2.4
--- authorities/authorities-home.pl 18 Dec 2006 16:35:17 -0000 1.14.2.3
+++ authorities/authorities-home.pl 2 Feb 2007 18:07:42 -0000 1.14.2.4
@@ -56,6 +56,7 @@
my @and_or = $query->param('and_or');
my @excluding = $query->param('excluding');
my @operator = $query->param('operator');
+ my $orderby = $query->param('orderby');
my @value = $query->param('value');
my $startfrom = $query->param('startfrom') || 1;
@@ -70,7 +71,8 @@
address@hidden,
($startfrom - 1)*$resultsperpage,
$resultsperpage,
- $authtypecode
+ $authtypecode,
+ $orderby
);
($template, $loggedinuser, $cookie)
@@ -112,7 +114,8 @@
{term => 'resultsperpage', val => $resultsperpage},
{term => 'type' , val => 'intranet'},
{term => 'op' , val => 'do_search'},
- {term => 'authtypecode' , val => $authtypecode}
+ {term => 'authtypecode' , val => $authtypecode},
+ {term => 'orderby' , val => $orderby},
)
)
;
Index: authorities/authorities.pl
===================================================================
RCS file: /cvsroot/koha/koha/authorities/authorities.pl,v
retrieving revision 1.15.2.8
retrieving revision 1.15.2.9
diff -u -b -r1.15.2.8 -r1.15.2.9
--- authorities/authorities.pl 24 Jan 2007 15:13:27 -0000 1.15.2.8
+++ authorities/authorities.pl 2 Feb 2007 18:07:42 -0000 1.15.2.9
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Id: authorities.pl,v 1.15.2.8 2007/01/24 15:13:27 hdl Exp $
+# $Id: authorities.pl,v 1.15.2.9 2007/02/02 18:07:42 hdl Exp $
# Copyright 2000-2002 Katipo Communications
#
@@ -413,7 +413,6 @@
# }
exit;
} else {
-warn "duplicate";
# it may be a duplicate, warn the user and do nothing
build_tabs ($template, $record, $dbh,$encoding);
build_hidden_data;
Index: C4/AuthoritiesMarc.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/AuthoritiesMarc.pm,v
retrieving revision 1.28.2.15
retrieving revision 1.28.2.16
diff -u -b -r1.28.2.15 -r1.28.2.16
--- C4/AuthoritiesMarc.pm 24 Jan 2007 10:17:47 -0000 1.28.2.15
+++ C4/AuthoritiesMarc.pm 2 Feb 2007 18:07:42 -0000 1.28.2.16
@@ -66,7 +66,7 @@
return ($tagfield,$tagsubfield);
}
sub authoritysearch {
- my ($dbh, $tags, $and_or, $excluding, $operator, $value,
$offset,$length,$authtypecode) = @_;
+ my ($dbh, $tags, $and_or, $excluding, $operator, $value,
$offset,$length,$authtypecode,$sortby) = @_;
my $query;
my $attr;
# the marclist may contain "mainentry". In this case, search the
tag_to_report, that depends on
@@ -91,7 +91,6 @@
my $q2;
for(my $i = 0 ; $i <= $#{$value} ; $i++)
{
-
if (@$value[$i]){
##If mainentry search $a tag
if (@$tags[$i] eq "mainmainentry") {
@@ -101,22 +100,25 @@
}else{
$attr =" address@hidden 1=Any ";
}
- if (@$operator[$i] eq 'phrase') {
- $attr.=" address@hidden 4=1 address@hidden 5=100 address@hidden
6=2 ";##Phrase, No truncation,all of subfield field must match
+ if (@$operator[$i] eq 'is') {
+ $attr.=" address@hidden 4=1 address@hidden 5=100 ";##Phrase, No
truncation,all of subfield field must match
}elsif (@$operator[$i] eq "="){
- $attr.=" address@hidden 4=107 ";#Phrase, No truncation,all of
subfield field must
+ $attr.=" address@hidden 4=107 "; #Number Exact match
+ }elsif (@$operator[$i] eq "start"){
+ $attr.=" address@hidden 4=1 address@hidden 5=1 ";#Phrase, Right
truncated
} else {
- $attr .=" address@hidden 4=6 address@hidden 5=1 ";## Word list,
right truncated, anywhere
+ $attr .=" address@hidden 5=1 ";## Word list, right truncated,
anywhere
}
$and .=" address@hidden " ;
$attr =$attr."\""address@hidden"\"";
$q2 .=$attr;
$dosearch=1;
}#if value
-
}
##Add how many queries generated
$query= $and.$query.$q2;
+$query=' @or @attr 7=1 @attr 1=Heading 0 '.$query if ($sortby eq
"HeadingAsc");
+$query=' @or @attr 7=2 @attr 1=Heading 0 '.$query if ($sortby eq
"HeadingDsc");
warn $query;
$offset=0 unless $offset;
@@ -944,8 +946,11 @@
=cut
-# $Id: AuthoritiesMarc.pm,v 1.28.2.15 2007/01/24 10:17:47 hdl Exp $
+# $Id: AuthoritiesMarc.pm,v 1.28.2.16 2007/02/02 18:07:42 hdl Exp $
# $Log: AuthoritiesMarc.pm,v $
+# Revision 1.28.2.16 2007/02/02 18:07:42 hdl
+# Sorting and searching for exact term now works.
+#
# Revision 1.28.2.15 2007/01/24 10:17:47 hdl
# FindDuplicate Now works.
# Be AWARE that it needs a change ccl.properties.
Index: koha-tmpl/intranet-tmpl/prog/en/authorities/auth_finder.tmpl
===================================================================
RCS file:
/cvsroot/koha/koha/koha-tmpl/intranet-tmpl/prog/en/authorities/auth_finder.tmpl,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -b -r1.1.2.3 -r1.1.2.4
--- koha-tmpl/intranet-tmpl/prog/en/authorities/auth_finder.tmpl 30 Jan
2007 10:04:37 -0000 1.1.2.3
+++ koha-tmpl/intranet-tmpl/prog/en/authorities/auth_finder.tmpl 2 Feb
2007 18:07:42 -0000 1.1.2.4
@@ -15,6 +15,7 @@
<label class="label100">Authority type</label>
<!-- TMPL_VAR NAME="authtypecode" -->
<input type="hidden" name="authtypecode" value="<!--
TMPL_VAR NAME="authtypecode" -->">
+ <input type="hidden" name="index" value="<!-- TMPL_VAR
NAME="index" -->">
</p>
<p>
<label class="label100">Main entry ($a
only)</label><input type="text" name="value" value="<!-- TMPL_VAR
name="resultstring" -->">
@@ -22,34 +23,40 @@
<input type="hidden" name="and_or" value="and">
<input type="hidden" name="excluding" value="">
<select name="operator">
- <option value="start">start by</option>
<option value="contains">contains</option>
+ <option value="start">starts by</option>
+ <option value="is">is exactly</option>
</select>
- <input type="hidden" name="index" value="<!-- TMPL_VAR
NAME="index" -->">
+ <input id="value_mainmainentry" type="text" name="value" value="<!--
TMPL_VAR NAME="resultstring" -->">
</p>
<p>
- <label class="label100">Main entry</label><input
type="text" name="value" value="<!-- TMPL_VAR name="resultstring" -->">
+ <label for="value_mainentry">Main entry</label>
<input type="hidden" name="marclist" value="mainentry">
<input type="hidden" name="and_or" value="and">
<input type="hidden" name="excluding" value="">
<select name="operator">
- <option value="start">start by</option>
<option value="contains">contains</option>
+ <option value="start">starts by</option>
</select>
- <input type="hidden" name="index" value="<!-- TMPL_VAR
NAME="index" -->">
+ <input id="value_mainentry" type="text" name="value" value="<!--
TMPL_VAR NAME="value" -->">
</p>
<p>
- <label class="label100">Anywhere</label><input
type="text" name="value">
+ <label for="value_anywhere">Anywhere</label>
<input type="hidden" name="marclist" value="">
<input type="hidden" name="and_or" value="and">
<input type="hidden" name="excluding" value="">
<select name="operator">
<option value="contains">contains</option>
- <option value="start">start by</option>
+ <option value="start">starts by</option>
</select>
- <input type="hidden" name="index" value="<!-- TMPL_VAR
NAME="index" -->">
+ <input id="value_anywhere" type="text" name="value" value="<!--
TMPL_VAR NAME="value" -->">
</p>
<p>
+ Sort by <select name="orderby">
+ <option value="">No order</option>
+ <option value="HeadingAsc">Heading Ascendant</option>
+ <option value="HeadingDsc">Heading Descendant</option>
+ </select>
<input type="submit" value="Start search" class="button
authority">
</p>
</div>
Index: koha-tmpl/intranet-tmpl/prog/en/authorities/authorities-home.tmpl
===================================================================
RCS file:
/cvsroot/koha/koha/koha-tmpl/intranet-tmpl/prog/en/authorities/authorities-home.tmpl,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -b -r1.1.2.1 -r1.1.2.2
--- koha-tmpl/intranet-tmpl/prog/en/authorities/authorities-home.tmpl 12 Oct
2006 22:04:47 -0000 1.1.2.1
+++ koha-tmpl/intranet-tmpl/prog/en/authorities/authorities-home.tmpl 2 Feb
2007 18:07:42 -0000 1.1.2.2
@@ -39,6 +39,7 @@
<select name="operator">
<option value="contains">contains</option>
<option value="start">start by</option>
+ <option value="is">is exactly</option>
</select>
</td>
<td>
@@ -56,6 +57,7 @@
<select name="operator">
<option value="contains">contains</option>
<option value="start">start by</option>
+ <option value="is">is exactly</option>
</select>
</td>
<td>
@@ -74,6 +76,7 @@
<select name="operator">
<option value="contains">contains</option>
<option value="start">start by</option>
+ <option value="is">is exactly</option>
</select>
</td>
<td>
@@ -83,6 +86,11 @@
</table>
<div id="action">
+ Order by :<select name="orderby">
+ <option value="">None</option>
+ <option value="HeadingAsc">Heading Ascendant</option>
+ <option value="HeadingDsc">Heading Descendant</option>
+ </select>
<input type="submit" value="Start search">
</div>
</form>
Index: koha-tmpl/intranet-tmpl/prog/en/authorities/authorities.tmpl
===================================================================
RCS file:
/cvsroot/koha/koha/koha-tmpl/intranet-tmpl/prog/en/authorities/authorities.tmpl,v
retrieving revision 1.2.2.3
retrieving revision 1.2.2.4
diff -u -b -r1.2.2.3 -r1.2.2.4
--- koha-tmpl/intranet-tmpl/prog/en/authorities/authorities.tmpl 24 Jan
2007 15:13:27 -0000 1.2.2.3
+++ koha-tmpl/intranet-tmpl/prog/en/authorities/authorities.tmpl 2 Feb
2007 18:07:42 -0000 1.2.2.4
@@ -85,6 +85,13 @@
<input type="hidden" name="subfield" value="<!--
TMPL_VAR NAME="oldauthtypetagsubfield" -->">
<input type="hidden" name="field_value" value="<!--
TMPL_VAR NAME="authtypecode" -->">
<!-- /TMPL_IF -->
+ <div id="action">
+<!-- TMPL_IF name="authid" -->
+ <input type="button" value="Save" onClick="Check(this.form)"
accesskey="w">
+<!-- TMPL_ELSE -->
+ <input type="button" value="Add authority" onClick="Check(this.form)"
accesskey="w">
+<!-- /TMPL_IF -->
+ </div>
</form>
</fieldset>
Index: koha-tmpl/intranet-tmpl/prog/en/authorities/searchresultlist-auth.tmpl
===================================================================
RCS file:
/cvsroot/koha/koha/koha-tmpl/intranet-tmpl/prog/en/authorities/searchresultlist-auth.tmpl,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -b -r1.1.2.4 -r1.1.2.5
--- koha-tmpl/intranet-tmpl/prog/en/authorities/searchresultlist-auth.tmpl
30 Jan 2007 10:04:44 -0000 1.1.2.4
+++ koha-tmpl/intranet-tmpl/prog/en/authorities/searchresultlist-auth.tmpl
2 Feb 2007 18:07:42 -0000 1.1.2.5
@@ -21,8 +21,9 @@
<input type="hidden" name="and_or" value="and">
<input type="hidden" name="excluding" value="">
<select name="operator">
- <option value="start">start by</option>
<option value="contains">contains</option>
+ <option value="start">starts by</option>
+ <option value="is">is exactly</option>
</select>
<input type="hidden" name="index" value="<!-- TMPL_VAR
NAME="index" -->">
</p>
@@ -32,8 +33,9 @@
<input type="hidden" name="and_or" value="and">
<input type="hidden" name="excluding" value="">
<select name="operator">
- <option value="start">start by</option>
<option value="contains">contains</option>
+ <option value="start">starts by</option>
+ <option value="is">is exactly</option>
</select>
<input type="hidden" name="index" value="<!-- TMPL_VAR
NAME="index" -->">
</p>
@@ -44,7 +46,8 @@
<input type="hidden" name="excluding" value="">
<select name="operator">
<option value="contains">contains</option>
- <option value="start">start by</option>
+ <option value="start">starts by</option>
+ <option value="is">is exactly</option>
</select>
<input type="hidden" name="index" value="<!-- TMPL_VAR
NAME="index" -->">
</p>
@@ -113,21 +116,21 @@
<div id="resultnumber">
<p>
<!-- TMPL_IF name="displayprev" -->
- <a href="auth_finder.pl?startfrom=<!-- TMPL_VAR
NAME="startfromprev" -->&<!-- TMPL_LOOP NAME="searchdata" --><!-- TMPL_VAR
NAME="term" -->=<!-- TMPL_VAR NAME="val" ESCAPE=URL -->&<!-- /TMPL_LOOP
-->resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&authtypecode=<!--
TMPL_VAR name="authtypecode" -->&op=do_search&type=intranet">
- <img
src="/intranet-tmpl/default/images/numbers/prev.gif" border="0">
+ <a href="auth_finder.pl?startfrom=<!-- TMPL_VAR
NAME="startfromprev" -->&&authtypecode=<!-- TMPL_VAR
name="authtypecode" --><!-- TMPL_LOOP name="searchdata"-->&<!-- TMPL_VAR
name="term" -->=<!-- TMPL_VAR name="val"--><!-- /TMPL_LOOP
-->&op=do_search&type=intranet&index=<!-- TMPL_VAR name="index" -->&tagid=<!--
TMPL_VAR name="tagid" -->">
+ <<
</a>
<!-- /TMPL_IF -->
<!-- TMPL_LOOP NAME="numbers" -->
<!-- TMPL_IF name="highlight" -->
- <img src="/intranet-tmpl/default/images/numbers/<!--
TMPL_VAR NAME="number" -->-highlight.gif">
+ <!-- TMPL_VAR NAME="number" -->
<!-- TMPL_ELSE -->
- <a href="auth_finder.pl?startfrom=<!-- TMPL_VAR
NAME="startfrom" -->&<!-- TMPL_LOOP NAME="searchdata" --><!-- TMPL_VAR
NAME="term" -->=<!-- TMPL_VAR NAME="val" ESCAPE=URL -->&<!-- /TMPL_LOOP
-->resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&authtypecode=<!--
TMPL_VAR name="authtypecode" -->&op=do_search&type=intranet">
- <img
src="/intranet-tmpl/default/images/numbers/<!-- TMPL_VAR NAME="number" -->.gif"
border="0"></a>
+ <a href="auth_finder.pl?startfrom=<!-- TMPL_VAR
NAME="startfrom" -->&authtypecode=<!-- TMPL_VAR name="authtypecode" --><!--
TMPL_LOOP name="searchdata"-->&<!-- TMPL_VAR name="term" -->=<!-- TMPL_VAR
name="val"--><!-- /TMPL_LOOP -->&op=do_search&type=intranet&index=<!-- TMPL_VAR
name="index" -->&tagid=<!-- TMPL_VAR name="tagid" -->">
+ <!-- TMPL_VAR NAME="number" --></a>
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
<!-- TMPL_IF name="displaynext" -->
- <a href="auth_finder.pl?startfrom=<!-- TMPL_VAR
NAME="startfromnext" -->&<!-- TMPL_LOOP NAME="searchdata" --><!-- TMPL_VAR
NAME="term" -->=<!-- TMPL_VAR NAME="val" ESCAPE=URL -->&<!-- /TMPL_LOOP
-->resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&authtypecode=<!--
TMPL_VAR name="authtypecode" -->&op=do_search&type=intranet">
- <img
src="/intranet-tmpl/default/images/numbers/next.gif" border="0"></a>
+ <a href="auth_finder.pl?startfrom=<!-- TMPL_VAR
NAME="startfromnext" -->&&authtypecode=<!-- TMPL_VAR
name="authtypecode" --><!-- TMPL_LOOP name="searchdata"-->&<!-- TMPL_VAR
name="term" -->=<!-- TMPL_VAR name="val"--><!-- /TMPL_LOOP
-->&op=do_search&type=intranet&index=<!-- TMPL_VAR name="index" -->&tagid=<!--
TMPL_VAR name="tagid" -->">
+ >></a>
<!-- /TMPL_IF -->
</p>
</div>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] koha authorities/authorities-home.pl authoritie... [rel_3_0],
Henri-Damien LAURENT <=