From 042fd50313ecc448445ba61d4cd8552bdcc93201 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Thu, 22 Sep 2011 21:32:42 +0200 Subject: [PATCH] Bug 3941 - Combine Notices & Messaging Tabs Changes to notices tab to make it a full replacement for messages tab. Removes messages tab from patron account. - repairs view of patron address in left column (category description, branch) - shows some explanation, when there are no messages for a borrower - makes the notice an expandable field, a click on the subject will expand the field to show the message content - makes message status and message transport type translatable, by moving the possible values into the template - removes the messaging tab from various menus - removes the files that were associated with the messaging tab - preserves the line breaks in message content to improve readability Also fixes Bug 6593 - Some information missing from the "Notices" tab. Signed-off-by: Liz Rea Signed-off-by: Ian Walls Signed-off-by: Chris Cormack --- .../prog/en/includes/circ-menu.inc | 1 - .../prog/en/includes/circ-menu.tt | 1 - .../prog/en/includes/members-menu.inc | 1 - .../prog/en/modules/members/messaging.tt | 68 ------------ .../prog/en/modules/members/notices.tt | 51 +++++++-- members/messaging.pl | 102 ------------------ members/notices.pl | 4 +- 7 files changed, 43 insertions(+), 185 deletions(-) delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/members/messaging.tt delete mode 100755 members/messaging.pl diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc index 129bd66bcc..cf5a67544b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -63,7 +63,6 @@ [% IF ( intranetreadinghistory ) %][% IF ( readingrecordview ) %]
  • [% ELSE %]
  • [% END %]Circulation History
  • [% END %] [% IF ( CAN_user_parameters ) %][% IF ( logview ) %]
  • [% ELSE %]
  • [% END %]Modification Log
  • [% END %] [% IF ( EnhancedMessagingPreferences ) %] - [% IF ( messagingview ) %]
  • [% ELSE %]
  • [% END %]Messaging
  • [% END %] [% IF ( sentnotices ) %]
  • [% ELSE %]
  • [% END %]Notices
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt index 39be1bebc0..8d5e3b80ce 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt @@ -65,7 +65,6 @@ in the global namespace %] [% IF ( intranetreadinghistory ) %][% IF ( readingrecordview ) %]
  • [% ELSE %]
  • [% END %]Circulation History
  • [% END %] [% IF ( CAN_user_parameters ) %][% IF ( logview ) %]
  • [% ELSE %]
  • [% END %]Modification Log
  • [% END %] [% IF ( EnhancedMessagingPreferences ) %] - [% IF ( messagingview ) %]
  • [% ELSE %]
  • [% END %]Messaging
  • [% END %] [% IF ( sentnotices ) %]
  • [% ELSE %]
  • [% END %]Notices
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-menu.inc index a7b77e2f2f..cadd1cbb82 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-menu.inc @@ -8,7 +8,6 @@ [% IF ( intranetreadinghistory ) %][% IF ( readingrecordview ) %]
  • [% ELSE %]
  • [% END %]Circulation History
  • [% END %] [% IF ( CAN_user_parameters ) %][% IF ( logview ) %]
  • [% ELSE %]
  • [% END %]Modification Log
  • [% END %] [% IF ( EnhancedMessagingPreferences ) %] - [% IF ( messagingview ) %]
  • [% ELSE %]
  • [% END %]Messaging
  • [% END %] [% IF ( sentnotices ) %]
  • [% ELSE %]
  • [% END %]Notices
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/messaging.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/messaging.tt deleted file mode 100644 index 2980a53244..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/messaging.tt +++ /dev/null @@ -1,68 +0,0 @@ -[% INCLUDE 'doc-head-open.inc' %] -Koha › Patrons › [% IF ( unknowuser ) %]Patron does not exist[% ELSE %]Patron Details for [% firstname %] [% surname %] ([% cardnumber %])[% END %] -[% INCLUDE 'doc-head-close.inc' %] - - -[% INCLUDE 'header.inc' %] -[% INCLUDE 'patron-search.inc' %] - - - -
    - -
    -
    -
    -[% INCLUDE 'members-toolbar.inc' %] -[% IF ( error ) %] -
    -[% IF ( AUTH_UPDATE_FAILED ) %] -

    Userid / Password update failed

    -Insufficient privileges. -

    Other fields updated.

    -[% END %] -[% IF ( CANT_DELETE_STAFF ) %] -

    Unable to delete staff user

    -

    Insufficient privileges.

    -[% END %] -[% IF ( CANT_DELETE_OTHERLIBRARY ) %] -

    Unable to delete patrons from other libraries with current settings

    -

    Insufficient privileges.

    -[% END %] -[% IF ( CANT_DELETE ) %] -

    Unable to delete patron:

    -

    Insufficient privileges.

    -[% END %] -
    -[% END %] -
    -[% IF ( unknowuser ) %] -
    - This patron does not exist. -
    -[% ELSE %] - - - - -[% IF ( message_queue ) %] - [% FOREACH message_queu IN message_queue %] - - [% END %] -[% ELSE %] - -[% END %] -
    Message Queue
    TypeSubjectStatusTime Prepared
    [% message_queu.message_transport_type %][% message_queu.subject %][% message_queu.status %][% message_queu.time_queued %]
    There is no record of any messages that have been sent to this patron.
    - -
    - -[% END %] - - -
    -
    -
    -[% INCLUDE 'circ-menu.inc' %] -
    -
    -[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt index 2bce08af75..8dcf7d7e65 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt @@ -10,10 +10,20 @@ dateFormat: 'uk' [% END %] }); + + $("a.message-title").click(function(e){ + $("p.message").hide(); + $(this).next("p").show(); + e.preventDefault(); + }); + }); //]]> - + [% INCLUDE 'header.inc' %] @@ -22,34 +32,53 @@
    - -
    -
    -
    +
    +
    +
    [% INCLUDE 'circ-toolbar.inc' %]

    Sent notices for [% firstname %] [% surname %]

    + - - + +[% IF ( QUEUED_MESSAGES ) %] [% FOREACH QUEUED_MESSAGE IN QUEUED_MESSAGES %] - - - - + + + [% END %] + [% ELSE %] + + [% END %]
    SubjectContentNotice Type Status Time
    [% QUEUED_MESSAGE.subject %][% QUEUED_MESSAGE.content %][% QUEUED_MESSAGE.message_transport_type %][% QUEUED_MESSAGE.status %] + [% QUEUED_MESSAGE.subject %] +

    + [% QUEUED_MESSAGE.content FILTER html_line_break %] +

    +
    + [% IF ( QUEUED_MESSAGE.message_transport_type == 'email' ) %]email + [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'print' ) %]print + [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'feed' ) %]feed + [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'sms' ) %]sms + [% ELSE %][% QUEUED_MESSAGE.message_transport_type %][% END %] + + [% IF ( QUEUED_MESSAGE.status == 'sent' ) %]sent + [% ELSIF ( QUEUED_MESSAGE.status == 'pending' ) %]pending + [% ELSIF ( QUEUED_MESSAGE.status == 'failed' ) %]failed + [% ELSIF ( QUEUED_MESSAGE.status == 'deleted' ) %]deleted + [% ELSE %][% QUEUED_MESSAGE.status %][% END %] + [% QUEUED_MESSAGE.time_queued %]
    There is no record of any messages that have been sent to this patron.
    diff --git a/members/messaging.pl b/members/messaging.pl deleted file mode 100755 index 8791dcf69a..0000000000 --- a/members/messaging.pl +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/perl - -# Copyright 2008 LibLime -# -# This file is part of Koha. -# -# Koha is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. -# -# Koha is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with Koha; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - -use strict; -use warnings; - -use CGI; -use C4::Context; -use C4::Auth; -use C4::Output; -use C4::Members; -use C4::Members::Messaging; -use C4::Dates; -use C4::Reserves; -use C4::Circulation; -use C4::Koha; -use C4::Letters; -use C4::Biblio; -use C4::Reserves; -use C4::Branch; # GetBranchName - -use Data::Dumper; - -use vars qw($debug); - -BEGIN { - $debug = $ENV{DEBUG} || 0; -} - -my $dbh = C4::Context->dbh; - -my $query = CGI->new(); - -my ( $template, $loggedinuser, $cookie ) = get_template_and_user( - { - template_name => 'members/messaging.tmpl', - query => $query, - type => "intranet", - authnotrequired => 0, - flagsrequired => { borrowers => 1 }, - debug => 1, - } -); -my $borrowernumber = $query->param('borrowernumber'); -my $borrower = GetMember( 'borrowernumber' => $borrowernumber ); -my $branch = C4::Context->userenv->{'branch'}; - -$template->param( $borrower ); - -$borrower = GetMemberDetails( $borrowernumber ); - - - if ( $borrower->{'category_type'} eq 'C') { - my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE category_type = ?' ); - my $cnt = scalar(@$catcodes); - $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1; - $template->param( 'catcode' => $catcodes->[0]) if $cnt == 1; - } - -my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'}); -$template->param( picture => 1 ) if $picture; - -# get some recent messages sent to this borrower for display: -my $message_queue = C4::Letters::GetQueuedMessages( { borrowernumber => $query->param('borrowernumber') } ); - -$template->param( messagingview => 1, - message_queue => $message_queue, - DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), - borrowernumber => $borrowernumber, - branchname => GetBranchName($borrower->{'branchcode'}), - dateformat => C4::Context->preference("dateformat"), - categoryname => $borrower->{'description'}, - $borrower->{'categorycode'} => 1, -); - -#$messaging_preferences->{'SMSnumber'}{'value'} = defined $borrower->{'smsalertnumber'} -# ? $borrower->{'smsalertnumber'} : $borrower->{'mobile'}; - -$template->param( %{ $borrower } ); -$template->param( - messagingview => 1, - is_child => ($borrower->{'category_type'} eq 'C'), - ); - -output_html_with_http_headers $query, $cookie, $template->output; diff --git a/members/notices.pl b/members/notices.pl index 088d5a85f9..79555814cc 100755 --- a/members/notices.pl +++ b/members/notices.pl @@ -56,7 +56,9 @@ $template->param( %{$borrower} ); $template->param( QUEUED_MESSAGES => $queued_messages, borrowernumber => $borrowernumber, - sentnotices => 1 + sentnotices => 1, + branchname => GetBranchName($borrower->{'branchcode'}), + categoryname => $borrower->{'description'}, ); output_html_with_http_headers $input, $cookie, $template->output; -- 2.39.5