Bugzilla – Attachment 9697 Details for
Bug 8063
Hold print notices do not sort by branch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8063 - Followup - Make C4/Letters.pm conform to PBP
Bug-8063---Followup---Make-C4Letterspm-conform-to-.patch (text/plain), 5.97 KB, created by
Kyle M Hall
on 2012-05-22 12:07:22 UTC
(
hide
)
Description:
Bug 8063 - Followup - Make C4/Letters.pm conform to PBP
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2012-05-22 12:07:22 UTC
Size:
5.97 KB
patch
obsolete
>From 34beaa26bf50a0522c227b2f5fcc6c66f72b3fba Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 22 May 2012 08:05:05 -0400 >Subject: [PATCH] Bug 8063 - Followup - Make C4/Letters.pm conform to PBP > >Perlcritic reported the following errors: >Subroutine prototypes used at line 96, column 1. See page 194 of PBP. (Severity: 5) >Subroutine prototypes used at line 120, column 1. See page 194 of PBP. (Severity: 5) >Subroutine prototypes used at line 152, column 1. See page 194 of PBP. (Severity: 5) >Subroutine prototypes used at line 173, column 1. See page 194 of PBP. (Severity: 5) >Subroutine prototypes used at line 190, column 1. See page 194 of PBP. (Severity: 5) >Subroutine prototypes used at line 227, column 1. See page 194 of PBP. (Severity: 5) >"return" statement with explicit "undef" at line 228, column 31. See page 199 of PBP. (Severity: 5) >"return" statement with explicit "undef" at line 229, column 31. See page 199 of PBP. (Severity: 5) >"return" statement with explicit "undef" at line 236, column 9. See page 199 of PBP. (Severity: 5) >Subroutine prototypes used at line 668, column 1. See page 194 of PBP. (Severity: 5) >"return" statement with explicit "undef" at line 669, column 27. See page 199 of PBP. (Severity: 5) >Subroutine prototypes used at line 719, column 1. See page 194 of PBP. (Severity: 5) >Subroutine prototypes used at line 865, column 1. See page 194 of PBP. (Severity: 5) >Subroutine prototypes used at line 899, column 1. See page 194 of PBP. (Severity: 5) >Subroutine prototypes used at line 981, column 1. See page 194 of PBP. (Severity: 5) >"return" statement with explicit "undef" at line 982, column 28. See page 199 of PBP. (Severity: 5) >Subroutine prototypes used at line 1000, column 1. See page 194 of PBP. (Severity: 5) >"return" statement with explicit "undef" at line 1001, column 27. See page 199 of PBP. (Severity: 5) >"return" statement with explicit "undef" at line 1004, column 9. See page 199 of PBP. (Severity: 5) >--- > C4/Letters.pm | 38 +++++++++++++++++++------------------- > 1 files changed, 19 insertions(+), 19 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index cfc919d..94478eb 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -93,7 +93,7 @@ $template->param(LETTERLOOP => \@letterloop); > > =cut > >-sub GetLetters (;$) { >+sub GetLetters { > > # returns a reference to a hash of references to ALL letters... > my $cat = shift; >@@ -117,7 +117,7 @@ sub GetLetters (;$) { > } > > my %letter; >-sub getletter ($$$) { >+sub getletter { > my ( $module, $code, $branchcode ) = @_; > > if (C4::Context->preference('IndependantBranches') && $branchcode){ >@@ -149,7 +149,7 @@ sub getletter ($$$) { > > =cut > >-sub addalert ($$$) { >+sub addalert { > my ( $borrowernumber, $type, $externalid ) = @_; > my $dbh = C4::Context->dbh; > my $sth = >@@ -170,7 +170,7 @@ sub addalert ($$$) { > > =cut > >-sub delalert ($) { >+sub delalert { > my $alertid = shift or die "delalert() called without valid argument (alertid)"; # it's gonna die anyway. > $debug and warn "delalert: deleting alertid $alertid"; > my $sth = C4::Context->dbh->prepare("delete from alert where alertid=?"); >@@ -187,7 +187,7 @@ sub delalert ($) { > > =cut > >-sub getalert (;$$$) { >+sub getalert { > my ( $borrowernumber, $type, $externalid ) = @_; > my $dbh = C4::Context->dbh; > my $query = "SELECT a.*, b.branchcode FROM alert a JOIN borrowers b USING(borrowernumber) WHERE"; >@@ -224,16 +224,16 @@ sub getalert (;$$$) { > # outmoded POD: > # When type=virtual, the id is related to a virtual shelf and this sub returns the name of the sub > >-sub findrelatedto ($$) { >- my $type = shift or return undef; >- my $externalid = shift or return undef; >+sub findrelatedto { >+ my $type = shift or return; >+ my $externalid = shift or return; > my $q = ($type eq 'issue' ) ? > "select title as result from subscription left join biblio on subscription.biblionumber=biblio.biblionumber where subscriptionid=?" : > ($type eq 'borrower') ? > "select concat(firstname,' ',surname) from borrowers where borrowernumber=?" : undef; > unless ($q) { > warn "findrelatedto(): Illegal type '$type'"; >- return undef; >+ return; > } > my $sth = C4::Context->dbh->prepare($q); > $sth->execute($externalid); >@@ -665,8 +665,8 @@ return true on success > > =cut > >-sub EnqueueLetter ($) { >- my $params = shift or return undef; >+sub EnqueueLetter { >+ my $params = shift or return; > > return unless exists $params->{'letter'}; > return unless exists $params->{'borrowernumber'}; >@@ -716,7 +716,7 @@ returns number of messages sent. > > =cut > >-sub SendQueuedMessages (;$) { >+sub SendQueuedMessages { > my $params = shift; > > my $unsent_messages = _get_unsent_messages(); >@@ -862,7 +862,7 @@ sub _add_attachments { > > } > >-sub _get_unsent_messages (;$) { >+sub _get_unsent_messages { > my $params = shift; > > my $dbh = C4::Context->dbh(); >@@ -896,7 +896,7 @@ ENDSQL > return $sth->fetchall_arrayref({}); > } > >-sub _send_message_by_email ($;$$$) { >+sub _send_message_by_email { > my $message = shift or return; > my ($username, $password, $method) = @_; > >@@ -978,8 +978,8 @@ $content > EOS > } > >-sub _send_message_by_sms ($) { >- my $message = shift or return undef; >+sub _send_message_by_sms { >+ my $message = shift or return; > my $member = C4::Members::GetMember( 'borrowernumber' => $message->{'borrowernumber'} ); > return unless $member->{'smsalertnumber'}; > >@@ -997,11 +997,11 @@ sub _update_message_to_address { > $dbh->do('UPDATE message_queue SET to_address=? WHERE message_id=?',undef,($to,$id)); > } > >-sub _set_message_status ($) { >- my $params = shift or return undef; >+sub _set_message_status { >+ my $params = shift or return; > > foreach my $required_parameter ( qw( message_id status ) ) { >- return undef unless exists $params->{ $required_parameter }; >+ return unless exists $params->{ $required_parameter }; > } > > my $dbh = C4::Context->dbh(); >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8063
:
9489
|
9514
|
9696
|
9697
|
9912
|
9913
|
9953
|
10786