bug_7001: protected are only all libraries letters
authorSrdjan Jankovic <srdjan@catalyst.net.nz>
Mon, 12 Mar 2012 00:00:34 +0000 (13:00 +1300)
committerPaul Poulain <paul.poulain@biblibre.com>
Tue, 13 Mar 2012 11:07:58 +0000 (12:07 +0100)
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
solves my comment 89: when you have a "mandatory" notice defined for a given library, it's not possible to delete it (and switch back to the "default" notification). isn't this a (small) bug ? was it intended ?

thanks!

C4/Letters.pm
tools/letter.pl

index ce21a5d..af1ce82 100644 (file)
@@ -255,7 +255,6 @@ sub findrelatedto ($$) {
 sub SendAlerts {
     my ( $type, $externalid, $letter_code ) = @_;
     my $dbh = C4::Context->dbh;
-    my $strsth;
     if ( $type eq 'issue' ) {
 
         # prepare the letter...
@@ -306,7 +305,7 @@ sub SendAlerts {
 
         # prepare the letter...
         # search the biblionumber
-        $strsth =  $type eq 'claimacquisition'
+        my $strsth =  $type eq 'claimacquisition'
             ? qq{
             SELECT aqorders.*,aqbasket.*,biblio.*,biblioitems.*,aqbooksellers.*
             FROM aqorders
index ae47810..eb9d6a6 100755 (executable)
@@ -325,7 +325,7 @@ sub default_display {
     my $loop_data = [];
     my $protected_letters = protected_letters();
     foreach my $row (@{$results}) {
-        $row->{protected} = $protected_letters->{ $row->{code}};
+        $row->{protected} = !$row->{branchcode} && $protected_letters->{ $row->{code} };
         push @{$loop_data}, $row;
 
     }