[Koha-patches] [PATCH] (bug #3651) sending baskets and shelves

Nahuel ANGELINETTI nahuel.angelinetti at biblibre.com
Mon Sep 21 15:09:56 CEST 2009


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.
---
 .../opac-tmpl/prog/en/modules/opac-sendbasket.tmpl |    2 +-
 .../opac-tmpl/prog/en/modules/opac-sendshelf.tmpl  |    2 +-
 opac/opac-sendbasket.pl                            |   10 ++++++++--
 opac/opac-sendshelf.pl                             |    5 +++++
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendbasket.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendbasket.tmpl
index b55760a..5d95063 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendbasket.tmpl
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendbasket.tmpl
@@ -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,
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tmpl
index 61ae453..3d150e3 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tmpl
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tmpl
@@ -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,
diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl
index f17bb71..846cd5e 100755
--- a/opac/opac-sendbasket.pl
+++ b/opac/opac-sendbasket.pl
@@ -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 },
     }
 );
@@ -92,10 +93,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
diff --git a/opac/opac-sendshelf.pl b/opac/opac-sendshelf.pl
index 7fe25af..13eef9f 100755
--- a/opac/opac-sendshelf.pl
+++ b/opac/opac-sendshelf.pl
@@ -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
-- 
1.6.0.4




More information about the Koha-patches mailing list