[Koha-cvs] koha koha-tmpl/intranet-tmpl/prog/en/includes/m...

Antoine Farnault antoine at koha-fr.org
Fri Dec 8 12:24:59 CET 2006


CVSROOT:	/sources/koha
Module name:	koha
Changes by:	Antoine Farnault <toins>	06/12/08 11:24:58

Modified files:
	koha-tmpl/intranet-tmpl/prog/en/includes: menus.inc 
	koha-tmpl/intranet-tmpl/prog/en/reviews: reviewswaiting.tmpl 
	koha-tmpl/opac-tmpl/prog/en: opac-detail.tmpl opac-review.tmpl 
	                             opac-userdetails.tmpl 
	opac           : opac-detail.pl opac-user.pl 
	reviews        : reviewswaiting.pl 

Log message:
	now enable to manage reviews from intranet.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc?cvsroot=koha&only_with_tag=rel_3_0&r1=1.6.2.21&r2=1.6.2.22
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/reviews/reviewswaiting.tmpl?cvsroot=koha&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/opac-tmpl/prog/en/opac-detail.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.6&r2=1.1.2.7
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/opac-tmpl/prog/en/opac-review.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/opac-tmpl/prog/en/opac-userdetails.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.4&r2=1.1.2.5
http://cvs.savannah.gnu.org/viewcvs/koha/opac/opac-detail.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.32.2.6&r2=1.32.2.7
http://cvs.savannah.gnu.org/viewcvs/koha/opac/opac-user.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.23.2.2&r2=1.23.2.3
http://cvs.savannah.gnu.org/viewcvs/koha/reviews/reviewswaiting.pl?cvsroot=koha&r1=1.2&r2=1.3

Patches:
Index: koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc
===================================================================
RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc,v
retrieving revision 1.6.2.21
retrieving revision 1.6.2.22
diff -u -b -r1.6.2.21 -r1.6.2.22
--- koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc	7 Dec 2006 15:42:14 -0000	1.6.2.21
+++ koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc	8 Dec 2006 11:24:58 -0000	1.6.2.22
@@ -31,7 +31,6 @@
            <label for="navmember">Sear<span class="accesskey">c</span>h:&nbsp;</label>
            <input id="navmember" type="text" size="10" name="member" />
            <input type="submit" value="OK" class="submit" />
-
     </form></li></ul></li>
     <!-- /TMPL_IF -->
                 <!-- TMPL_IF NAME="CAN_user_catalogue" -->
@@ -48,6 +47,7 @@
                         </form>
                      </li>
         <li><a href="/cgi-bin/koha/bookshelves/shelves.pl">Virtual Shelves</a></li>
+        <li><a href="/cgi-bin/koha/reviews/reviewswaiting.pl">reviews</a></li>
 </ul></li><!-- /TMPL_IF -->
     <!-- TMPL_IF NAME="CAN_user_editcatalogue" -->
     <li><a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a>

Index: koha-tmpl/intranet-tmpl/prog/en/reviews/reviewswaiting.tmpl
===================================================================
RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/prog/en/reviews/reviewswaiting.tmpl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- koha-tmpl/intranet-tmpl/prog/en/reviews/reviewswaiting.tmpl	17 Jun 2006 22:30:23 -0000	1.2
+++ koha-tmpl/intranet-tmpl/prog/en/reviews/reviewswaiting.tmpl	8 Dec 2006 11:24:58 -0000	1.3
@@ -1,25 +1,49 @@
-<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Reviews waiting for Approval --<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
-<!-- Additions to enable Calendar system -->
-<link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR name="themelang" -->/includes/calendar/calendar-system.css">
-<!-- End of additions --><!-- Additions to enable Calendar system -->
-<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/includes/calendar/calendar.js"></script>
-<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/includes/calendar/calendar-en.js"></script>
-<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/includes/calendar/calendar-setup.js"></script>
-<!-- End of additions -->
-<!-- ------------------------MAIN BODY OF PAGE------------------------ -->
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
+    Reviews waiting for Approval --
+<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+
+<!-- TMPL_INCLUDE NAME="menus.inc" -->
+<!--TMPL_INCLUDE NAME="menu-serials.inc" -->
 
 <h1>Reviews</h1>
 
+<!-- TMPL_IF NAME="reviews" -->
 <table>
+    <tr>
+        <th>
+            Authors
+        </th>
+        <th>
+            On biblio
+        </th>
+        <th>
+            Review
+        </th>
+        <th>
+            &nbsp;
+        </th>
+    </tr>
 <!-- TMPL_LOOP NAME="reviews" -->
-<tr>
-<td><!-- TMPL_VAR NAME="review" -->
-</td>
-<td><a href="/cgi-bin/koha/reviews/reviewswaiting.pl?op=approve&reviewid=<!-- TMPL_VAR NAME="reviewid" -->">Approve</a></td>
-<td><a href="/cgi-bin/koha/reviews/reviewswaiting.pl?op=delete&reviewid=<!-- TMPL_VAR NAME="reviewid" -->">Delete</a></td>
-</tr>
+    <tr>
+        <td>
+            <!-- TMPL_VAR NAME="surname" --> 
+            <!-- TMPL_VAR NAME="firstname" -->
+        </td>
+        <td>
+            <!-- TMPL_VAR NAME="bibliotitle" -->
+        </td>
+        <td>
+            <!-- TMPL_VAR NAME="review" -->
+        </td>
+        <td>
+            <a href="/cgi-bin/koha/reviews/reviewswaiting.pl?op=approve&reviewid=<!-- TMPL_VAR NAME="reviewid" -->">Approve</a> | 
+            <a href="/cgi-bin/koha/reviews/reviewswaiting.pl?op=delete&reviewid=<!-- TMPL_VAR NAME="reviewid" -->">Delete</a>
+        </td>
+    </tr>
 <!-- /TMPL_LOOP -->
 </table>
+<!-- TMPL_ELSE -->
+    <b>No reviews has been writed.</b>
+<!-- /TMPL_IF -->
 
 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
-

Index: koha-tmpl/opac-tmpl/prog/en/opac-detail.tmpl
===================================================================
RCS file: /sources/koha/koha/koha-tmpl/opac-tmpl/prog/en/opac-detail.tmpl,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -b -r1.1.2.6 -r1.1.2.7
--- koha-tmpl/opac-tmpl/prog/en/opac-detail.tmpl	7 Dec 2006 16:49:51 -0000	1.1.2.6
+++ koha-tmpl/opac-tmpl/prog/en/opac-detail.tmpl	8 Dec 2006 11:24:58 -0000	1.1.2.7
@@ -168,7 +168,7 @@
             <td><!-- TMPL_VAR NAME="branchname" --> <!-- TMPL_IF NAME="itemcallnumber" --> <!-- TMPL_VAR NAME="itemcallnumber" --><!-- /TMPL_IF --></td>
             <td>
                 <!-- TMPL_IF name="datedue" -->
-                On issue to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="cardnumber" --></a>
+                On issue to <!-- TMPL_VAR NAME="cardnumber" -->
                 <!-- TMPL_ELSE -->
                 <!-- TMPL_IF name="notforloan" -->
                 <!-- TMPL_VAR name="notforloan" -->
@@ -246,6 +246,32 @@
     </div>
     <!-- /TMPL_IF -->
     
+<!-- TMPL_IF NAME="reviews" -->
+<h2>Reviews by members:</h2>
+    <!--TMPL_LOOP NAME="reviews"-->
+    <p>
+        <b>
+            Review by
+            <!--TMPL_VAR NAME="title"-->
+            <!--TMPL_VAR NAME="surname"-->
+            <!--TMPL_VAR NAME="firstname"-->
+        </b>
+        <br />
+        <small>
+            <!--TMPL_VAR NAME="datereviewed"-->
+        </small>
+    </p>
+    <p>
+      <!--TMPL_VAR NAME="review"-->
+    </p>
+    <!--/TMPL_LOOP-->
+<!-- TMPL_ELSE  -->
+    <b>No reviews has been writed on this biblio.</b>
+<!-- /TMPL_IF -->
+    <a href="javascript:Dopop('/cgi-bin/koha/opac-review.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber"-->');">
+        Write or modify your reviews on this biblio.
+    </a>
+    
 <!-- TMPL_IF NAME="AmazonContent" -->
 <!-- Amazon Reviews -->
 <div id="itemReviews">
@@ -261,7 +287,7 @@
             <h4>Rating (from Amazon.com):</h4>
         <div id="starMT"><div id="starFull" style="width:<!-- TMPL_VAR NAME="rating" -->px"></div></div>
 
-        <!-- TMPL_LOOP NAME="REVIEWS" -->
+        <!-- TMPL_LOOP NAME="AMAZONREVIEWS" -->
             <div class="content_set">
             <!-- TMPL_IF NAME="summary" -->
             <h4 class="underline">  <!-- TMPL_VAR NAME="summary" --></h4>
@@ -287,7 +313,7 @@
     }
     function confirm_deletion() {
         var is_confirmed = confirm('Are you sure you want to delete this biblio?');
-        if (is_confirmed) {
+        if ( is_confirmed ) {
             window.location="/cgi-bin/koha/cataloguing/addbiblio.pl?op=delete&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->";
         }
     }

Index: koha-tmpl/opac-tmpl/prog/en/opac-review.tmpl
===================================================================
RCS file: /sources/koha/koha/koha-tmpl/opac-tmpl/prog/en/Attic/opac-review.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/opac-tmpl/prog/en/opac-review.tmpl	7 Dec 2006 18:09:01 -0000	1.1.2.1
+++ koha-tmpl/opac-tmpl/prog/en/opac-review.tmpl	8 Dec 2006 11:24:58 -0000	1.1.2.2
@@ -1,17 +1,15 @@
 <!-- TMPL_INCLUDE name="doc-head-open.inc" --><!-- TMPL_VAR NAME="LibraryName" --> Catalog -- Library Home for  <!-- TMPL_LOOP name="BORROWER_INFO" --><!-- TMPL_VAR name="firstname" --> <!-- TMPL_VAR name="surname" --><!-- /TMPL_LOOP -->
 <!-- TMPL_INCLUDE name="doc-head-close.inc" -->
 
-<!-- TMPL_INCLUDE name="masthead.inc" -->
-<!-- TMPL_INCLUDE name="navigation.inc" -->
-
+<div> <!-- main -->
 
 <h3> Review of: <!--TMPL_VAR NAME="title" --></h3>
 
 <form action="/cgi-bin/koha/opac-review.pl" method="post"> 
-<input type="hidden" name="biblionumber" value="<!--TMPL_VAR NAME="biblionumber"-->">
-<input type="hidden" name="type" value="<TMPL_VAR NAME="type">">
+    <input type="hidden" name="biblionumber" value="<!--TMPL_VAR NAME="biblionumber"-->">
+    <input type="hidden" name="type" value="<TMPL_VAR NAME="type">">
 
-<table>
+    <table>
     <tr>
         <th>
             Review
@@ -25,6 +23,7 @@
     </td></tr>
     </table>
 </form>
-
+    <p>
+    Note : Your review must be approved by a librarian before.
+    </p>
 <!-- TMPL_INCLUDE NAME="opac-bottom.inc"-->
-

Index: koha-tmpl/opac-tmpl/prog/en/opac-userdetails.tmpl
===================================================================
RCS file: /sources/koha/koha/koha-tmpl/opac-tmpl/prog/en/opac-userdetails.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/opac-tmpl/prog/en/opac-userdetails.tmpl	7 Dec 2006 15:42:15 -0000	1.1.2.4
+++ koha-tmpl/opac-tmpl/prog/en/opac-userdetails.tmpl	8 Dec 2006 11:24:58 -0000	1.1.2.5
@@ -50,7 +50,6 @@
 <!-- TMPL_IF NAME="joiningbranch" --><tr><th>Joining Branch:</th><td><!-- TMPL_VAR NAME="joiningbranch" --></td></tr><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></table>
 
 
-
 <h3>Identity Details</h3>
 
 <table><tr><th scope="row">DoB:</th><td> <!-- TMPL_IF NAME="dateofbirth" --><!-- TMPL_VAR NAME="dateofbirth" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></td></tr>
@@ -76,5 +75,4 @@
 <input type="submit" name="Modify" value="Modify Your Record" />
 </form>
 
-</body>
-</html>
\ No newline at end of file
+<!-- TMPL_INCLUDE NAME="opac-bottom.inc"-->

Index: opac/opac-detail.pl
===================================================================
RCS file: /sources/koha/koha/opac/opac-detail.pl,v
retrieving revision 1.32.2.6
retrieving revision 1.32.2.7
diff -u -b -r1.32.2.6 -r1.32.2.7
--- opac/opac-detail.pl	7 Dec 2006 15:42:15 -0000	1.32.2.6
+++ opac/opac-detail.pl	8 Dec 2006 11:24:58 -0000	1.32.2.7
@@ -17,7 +17,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: opac-detail.pl,v 1.32.2.6 2006/12/07 15:42:15 toins Exp $
+# $Id: opac-detail.pl,v 1.32.2.7 2006/12/08 11:24:58 toins Exp $
 
 use strict;
 require Exporter;
@@ -29,6 +29,8 @@
 use C4::Amazon;
 use C4::Review;
 use C4::Serials;
+use C4::Members;
+
 
 my $query = new CGI;
 my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
@@ -97,6 +99,16 @@
     $template->param( "$_" => $dat->{$_} . "" );
 }
 
+my $reviews = getreviews( $biblionumber, 1 );
+foreach ( @$reviews ) {
+    my $borrower_number_review = $_->{borrowernumber};
+    my $borrowerData           = GetMember('',$borrower_number_review);
+    # setting some borrower info into this hash
+    $_->{title}     = $borrowerData->{'title'};
+    $_->{surname}   = $borrowerData->{'surname'};
+    $_->{firstname} = $borrowerData->{'firstname'};
+}
+
 $template->param(
     ITEM_RESULTS        => \@items,
     subscriptionsnumber => $subscriptionsnumber,
@@ -106,7 +118,7 @@
     LibraryName         => C4::Context->preference("LibraryName"),
     suggestion          => C4::Context->preference("suggestion"),
     virtualshelves      => C4::Context->preference("virtualshelves"),
-    reviewson           => C4::Context->preference("marc"),
+    reviews             => $reviews
 );
 ## Amazon.com stuff
 #not used unless preference set
@@ -146,6 +158,6 @@
         }
     }
     $template->param( SIMILAR_PRODUCTS => \@products );
-    $template->param( REVIEWS          => \@reviews );
+    $template->param( AMAZONREVIEWS    => \@reviews );
 }
 output_html_with_http_headers $query, $cookie, $template->output;

Index: opac/opac-user.pl
===================================================================
RCS file: /sources/koha/koha/opac/opac-user.pl,v
retrieving revision 1.23.2.2
retrieving revision 1.23.2.3
diff -u -b -r1.23.2.2 -r1.23.2.3
--- opac/opac-user.pl	7 Dec 2006 15:42:15 -0000	1.23.2.2
+++ opac/opac-user.pl	8 Dec 2006 11:24:58 -0000	1.23.2.3
@@ -15,7 +15,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: opac-user.pl,v 1.23.2.2 2006/12/07 15:42:15 toins Exp $
+# $Id: opac-user.pl,v 1.23.2.3 2006/12/08 11:24:58 toins Exp $
 
 use strict;
 require Exporter;
@@ -90,7 +90,6 @@
     if ( $restype ) {
         $issue->{'reserved'} = 1;
     }
-    warn "reserves1=>" . Data::Dumper::Dumper($res);
     
     my ( $numaccts, $accts, $total ) = getboracctrecord( undef, $borr );
     my $charges = 0;
@@ -137,7 +136,6 @@
 
 # now the reserved items....
 my ( $rcount, $reserves ) = FindReserves( undef, $borrowernumber );
-warn "reserves2=>" . Data::Dumper::Dumper($reserves);
 foreach my $res (@$reserves) {
     $res->{'reservedate'} = format_date( $res->{'reservedate'} );
     my $publictype = $res->{'publictype'};
@@ -167,9 +165,8 @@
 $template->param( WAITING => \@waiting );
 
 # current alert subscriptions
-warn " B : $borrowernumber";
 my $alerts = getalert($borrowernumber);
-foreach (@$alerts) {
+foreach ( @$alerts ) {
     $_->{ $_->{type} } = 1;
     $_->{relatedto} = findrelatedto( $_->{type}, $_->{externalid} );
 }

Index: reviews/reviewswaiting.pl
===================================================================
RCS file: /sources/koha/koha/reviews/reviewswaiting.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- reviews/reviewswaiting.pl	17 Jun 2006 22:29:37 -0000	1.2
+++ reviews/reviewswaiting.pl	8 Dec 2006 11:24:58 -0000	1.3
@@ -1,13 +1,29 @@
 #!/usr/bin/perl
 
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
 use strict;
 use CGI;
 use C4::Auth;
 use C4::Output;
 use C4::Interface::CGI::Output;
 use C4::Context;
-use HTML::Template;
 use C4::Review;
+use C4::Members;
+use C4::Biblio;
 
 my $query = new CGI;
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
@@ -32,6 +48,17 @@
 }
 
 my $reviews = getallreviews(0);
+
+foreach ( @$reviews ) {
+    my $borrowernumber = $_->{borrowernumber};
+    my $borrowerData   = GetMember('',$borrowernumber);
+    my $biblioData     = GetBiblioData($_->{biblionumber});
+    # setting some borrower info into this hash
+    $_->{bibliotitle} = $biblioData->{'title'};
+    $_->{surname}     = $borrowerData->{'surname'};
+    $_->{firstname}   = $borrowerData->{'firstname'};
+}
+
 $template->param( reviews => $reviews );
 
 output_html_with_http_headers $query, $cookie, $template->output;





More information about the Koha-cvs mailing list