(bug #3651) sending baskets and shelves
authorNahuel ANGELINETTI <nahuel.angelinetti@biblibre.com>
Mon, 21 Sep 2009 13:08:27 +0000 (15:08 +0200)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Mon, 21 Sep 2009 15:04:25 +0000 (17:04 +0200)
this patch restrict the send of baskets and shelves to authenticated users only, and show their surname/firstname in the e-mail, so the receiver will know who sent the list.

koha-tmpl/opac-tmpl/prog/en/modules/opac-sendbasket.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tmpl
opac/opac-sendbasket.pl
opac/opac-sendshelf.pl

index 033c4d2..5513198 100644 (file)
@@ -5,7 +5,7 @@ Your Cart
 <HEADER>
 Hi,
 
-Here is your cart, sent from our online catalog.
+<!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --> sent you a cart from our online catalog.
 
 Please note that the attached file is a MARC biblographic records file
 which can be imported into a Personal Bibliographic Software like EndNote,
index 3f8502e..1d4e4c6 100644 (file)
@@ -5,7 +5,7 @@ Your List : <!-- TMPL_VAR NAME="shelfname" -->
 <HEADER>
 Hi,
 
-Here is your list called <!-- TMPL_VAR NAME="shelfname" -->, sent from our online catalog.
+<!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" -->, sent you from our online catalog, the virtual shelf called :  <!-- TMPL_VAR NAME="shelfname" -->.
 
 Please note that the attached file is a MARC biblographic records file
 which can be imported into a Personal Bibliographic Software like EndNote,
index f06230c..d450758 100755 (executable)
@@ -28,6 +28,7 @@ use C4::Items;
 use C4::Auth;
 use C4::Output;
 use C4::Biblio;
+use C4::Members;
 
 my $query = new CGI;
 
@@ -36,7 +37,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
         template_name   => "opac-sendbasketform.tmpl",
         query           => $query,
         type            => "opac",
-        authnotrequired => 1,
+        authnotrequired => 0,
         flagsrequired   => { borrow => 1 },
     }
 );
@@ -99,10 +100,15 @@ if ( $email_add ) {
     }
 
     my $resultsarray = \@results;
+    
+    my $user = GetMember($borrowernumber); 
+    
     $template2->param(
         BIBLIO_RESULTS => $resultsarray,
         email_sender   => $email_sender,
-        comment        => $comment
+        comment        => $comment,
+        firstname      => $user->{firstname},
+        surname        => $user->{surname},
     );
 
     # Getting template result
index dc9d2b0..86b494b 100755 (executable)
@@ -31,6 +31,7 @@ use C4::Biblio;
 use C4::Items;
 use C4::Output;
 use C4::VirtualShelves;
+use C4::Members;
 
 my $query = new CGI;
 
@@ -97,11 +98,15 @@ if ( $email ) {
         push( @results, $dat );
     }
 
+    my $user = GetMember($borrowernumber); 
+
     $template2->param(
         BIBLIO_RESULTS => \@results,
         email_sender   => $email_from,
         comment        => $comment,
         shelfname      => $shelf[1],
+        firstname      => $user->{firstname},
+        surname        => $user->{surname},
     );
 
     # Getting template result