[Koha-cvs] koha authorities/detail.pl C4/AuthoritiesMarc.p... [rel_2_2]

paul poulain paul at koha-fr.org
Wed Aug 2 12:17:09 CEST 2006


CVSROOT:	/cvsroot/koha
Module name:	koha
Branch:		rel_2_2
Changes by:	paul poulain <tipaul>	06/08/02 10:17:09

Modified files:
	authorities    : detail.pl 
	C4             : AuthoritiesMarc.pm 
	koha-tmpl/intranet-tmpl/default/en/authorities: detail.tmpl 

Log message:
	some improvements in buildHerarchies (unimarc hierarchies)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/authorities/detail.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.2.2.5&r2=1.2.2.6
http://cvs.savannah.gnu.org/viewcvs/koha/C4/AuthoritiesMarc.pm?cvsroot=koha&only_with_tag=rel_2_2&r1=1.9.2.20&r2=1.9.2.21
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/default/en/authorities/detail.tmpl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.3.2.5&r2=1.3.2.6

Patches:
Index: authorities/detail.pl
===================================================================
RCS file: /cvsroot/koha/koha/authorities/detail.pl,v
retrieving revision 1.2.2.5
retrieving revision 1.2.2.6
diff -u -b -r1.2.2.5 -r1.2.2.6
--- authorities/detail.pl	31 Jul 2006 10:15:42 -0000	1.2.2.5
+++ authorities/detail.pl	2 Aug 2006 10:17:09 -0000	1.2.2.6
@@ -89,7 +89,7 @@
       my %cell;
       my $elementdata = AUTHgetauthority($dbh,$element);
       $record= $elementdata if ($authid==$element);
-      push @loophierarchy, BuildUnimarcHierarchy($elementdata,"child".$cnt);
+      push @loophierarchy, BuildUnimarcHierarchy($elementdata,"child".$cnt, $authid);
       $cnt++;
     }
     push @loophierarchies, { 'loopelement' =>\@loophierarchy};

Index: C4/AuthoritiesMarc.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/AuthoritiesMarc.pm,v
retrieving revision 1.9.2.20
retrieving revision 1.9.2.21
diff -u -b -r1.9.2.20 -r1.9.2.21
--- C4/AuthoritiesMarc.pm	31 Jul 2006 13:29:14 -0000	1.9.2.20
+++ C4/AuthoritiesMarc.pm	2 Aug 2006 10:17:09 -0000	1.9.2.21
@@ -1255,6 +1255,7 @@
 sub BuildUnimarcHierarchy{
 	my $record = shift @_;
     my $class = shift @_;
+    my $authid_constructed = shift @_;
 	my $authid=$record->subfield('250','3');
     my %cell;
 	my $parents=""; my $children="";
@@ -1274,7 +1275,8 @@
     $cell{"loopparents"}=\@loopparents if (scalar(@loopparents)>0);
     $cell{"loopchildren"}=\@loopchildren if (scalar(@loopchildren)>0);
     $cell{"class"}=$class;
-    $cell{"authid"}=$authid;
+    $cell{"loopauthid"}=$authid;
+    $cell{"current_value"} =1 if $authid eq $authid_constructed;
     $cell{"value"}=$record->subfield('250',"a");
 	return \%cell;
 }
@@ -1310,8 +1312,11 @@
 
 =cut
 
-# $Id: AuthoritiesMarc.pm,v 1.9.2.20 2006/07/31 13:29:14 tipaul Exp $
+# $Id: AuthoritiesMarc.pm,v 1.9.2.21 2006/08/02 10:17:09 tipaul Exp $
 # $Log: AuthoritiesMarc.pm,v $
+# Revision 1.9.2.21  2006/08/02 10:17:09  tipaul
+# some improvements in buildHerarchies (unimarc hierarchies)
+#
 # Revision 1.9.2.20  2006/07/31 13:29:14  tipaul
 # - adding a 3rd option to authority search (search on $a of on all subfields of main entry)
 # - removing automatic % add at the end of a search & adding a warning for the user

Index: koha-tmpl/intranet-tmpl/default/en/authorities/detail.tmpl
===================================================================
RCS file: /cvsroot/koha/koha/koha-tmpl/intranet-tmpl/default/en/authorities/detail.tmpl,v
retrieving revision 1.3.2.5
retrieving revision 1.3.2.6
diff -u -b -r1.3.2.5 -r1.3.2.6
--- koha-tmpl/intranet-tmpl/default/en/authorities/detail.tmpl	31 Jul 2006 13:02:37 -0000	1.3.2.5
+++ koha-tmpl/intranet-tmpl/default/en/authorities/detail.tmpl	2 Aug 2006 10:17:09 -0000	1.3.2.6
@@ -29,18 +29,21 @@
 <!--TMPL_LOOP Name="loophierarchies" -->
   <div class="hierarchy">
   <!--TMPL_LOOP Name="loopelement" -->
-    <div id="<!--TMPL_VAR Name="authid" -->" class="<!--TMPL_VAR Name="class" -->">
+    <div id="<!--TMPL_VAR Name="loopauthid" -->" class="<!--TMPL_VAR Name="class" -->">
     <!--TMPL_IF Name="ifparents" -->
       <!--TMPL_LOOP Name="loopparents" -->
-        <div name="<!--TMPL_VAR Name="authid" -->p" class="parent"> <a href="detail.pl?authid=<!--TMPL_VAR Name="parentauthid" -->"><!--TMPL_VAR Name="parentvalue" --></a></div>     
+        <div name="<!--TMPL_VAR Name="loopauthid" -->p" class="parent"> <a href="detail.pl?authid=<!--TMPL_VAR Name="parentauthid" -->"><!--TMPL_VAR Name="parentvalue" --></a></div>
       <!--/TMPL_LOOP-->
-      <sup><a class="parents" href="JavaScript:showParents('<!--TMPL_VAR Name="authid" -->');">+</a></sup>
     <!--/TMPL_IF -->
-    <a href="detail.pl?authid=<!--TMPL_VAR Name="authid" -->"><!--TMPL_VAR Name="value" --></a>
+    <!-- TMPL_IF name="current_value" -->
+        <!--TMPL_VAR Name="value" -->
+    <!-- TMPL_ELSE -->
+        <a href="detail.pl?authid=<!--TMPL_VAR Name="loopauthid" -->" title="Term"><!--TMPL_VAR Name="value" --></a>
+    <!-- /TMPL_IF -->
     <!--TMPL_IF Name="ifchildren" -->
-      <sub><a class="parents" href="JavaScript:showChildren('<!--TMPL_VAR Name="authid" -->');">+</a></sub><br/>
+      <sub><a class="parents" title="Narrower terms" href="JavaScript:showChildren('<!--TMPL_VAR Name="loopauthid" -->');">+</a></sub><br/>
       <!--TMPL_LOOP Name="loopchildren" -->
-        <div name="<!--TMPL_VAR Name="authid" -->c" class="child"> <a href="detail.pl?authid=<!--TMPL_VAR Name="childauthid" -->"><!--TMPL_VAR Name="childvalue" --></a></div>
+        <div name="<!--TMPL_VAR Name="loopauthid" -->c" class="child"> <a href="detail.pl?authid=<!--TMPL_VAR Name="childauthid" -->"><!--TMPL_VAR Name="childvalue" --></a></div>
       <!--/TMPL_LOOP-->
     <!-- /TMPL_IF -->
     </div>





More information about the Koha-cvs mailing list