Bugzilla – Attachment 48012 Details for
Bug 15632
Move the messages related code to Koha::Patron::Messages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15632: Koha::Patron::Messages - Remove DeleteMessage
Bug-15632-KohaPatronMessages---Remove-DeleteMessag.patch (text/plain), 2.70 KB, created by
Kyle M Hall (khall)
on 2016-02-12 19:05:22 UTC
(
hide
)
Description:
Bug 15632: Koha::Patron::Messages - Remove DeleteMessage
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-02-12 19:05:22 UTC
Size:
2.70 KB
patch
obsolete
>From f0d9db44c43069eaf5624cf4721b125b6fa46bf3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 20 Jan 2016 17:57:55 +0000 >Subject: [PATCH] Bug 15632: Koha::Patron::Messages - Remove DeleteMessage >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >The DeleteMessage just deleted and logged if needed. >This is now be done by Koha::Patron::Message->delete. > >Test plan: >1/ Go on the "check out" page of a patron >2/ Delete some messages > >Signed-off-by: Marc Véron <veron@veron.ch> >--- > C4/Members.pm | 24 ------------------------ > circ/del_message.pl | 14 ++++---------- > 2 files changed, 4 insertions(+), 34 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index 57e37ba..8fe2ef8 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -99,7 +99,6 @@ BEGIN { > &GetExpiryDate > &GetUpcomingMembershipExpires > >- &DeleteMessage > &GetMessages > &GetMessagesCount > >@@ -2263,29 +2262,6 @@ sub GetMessagesCount { > return $count; > } > >- >- >-=head2 DeleteMessage >- >- DeleteMessage( $message_id ); >- >-=cut >- >-sub DeleteMessage { >- my ( $message_id ) = @_; >- >- my $dbh = C4::Context->dbh; >- my $query = "SELECT * FROM messages WHERE message_id = ?"; >- my $sth = $dbh->prepare($query); >- $sth->execute( $message_id ); >- my $message = $sth->fetchrow_hashref(); >- >- $query = "DELETE FROM messages WHERE message_id = ?"; >- $sth = $dbh->prepare($query); >- $sth->execute( $message_id ); >- logaction("MEMBERS", "DELCIRCMESSAGE", $message->{'borrowernumber'}, $message->{'message'}) if C4::Context->preference("BorrowersLog"); >-} >- > =head2 IssueSlip > > IssueSlip($branchcode, $borrowernumber, $quickslip) >diff --git a/circ/del_message.pl b/circ/del_message.pl >index 6b8d560..ccce661 100755 >--- a/circ/del_message.pl >+++ b/circ/del_message.pl >@@ -17,20 +17,13 @@ > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >-use strict; >-use warnings; >+use Modern::Perl; > > use CGI qw ( -utf8 ); > >-use C4::Context; > use C4::Auth; > use C4::Output; >-use C4::Members; >-use C4::Accounts; >-use C4::Stats; >-use C4::Koha; >-use C4::Overdues; >-use C4::Branch; # GetBranches >+use Koha::Patron::Messages; > > my $input = new CGI; > >@@ -47,7 +40,8 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > my $borrowernumber = $input->param('borrowernumber'); > my $message_id = $input->param('message_id'); > >-DeleteMessage($message_id); >+my $message = Koha::Patron::Messages->find($message_id); >+$message->delete if $message; > > print $input->redirect( > "/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber"); >-- >2.1.4
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 15632
:
47091
|
47092
|
47093
|
47094
|
47095
|
47096
|
47097
|
47515
|
47516
|
47525
|
47571
|
47572
|
47573
|
47574
|
47575
|
47580
|
47581
|
47582
|
47583
|
47584
|
47585
|
47586
|
47587
|
48004
|
48009
|
48010
|
48011
| 48012 |
48013
|
48014
|
48015
|
48016
|
48017
|
48018
|
48020
|
48422
|
48423
|
48424
|
48425
|
48426
|
48427
|
48591
|
48592
|
48593