View | Details | Raw Unified | Return to bug 3941
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc (-1 lines)
Lines 63-69 Link Here
63
	[% IF ( intranetreadinghistory ) %][% IF ( readingrecordview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrowernumber %]">Circulation History</a></li>[% END %]
63
	[% IF ( intranetreadinghistory ) %][% IF ( readingrecordview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrowernumber %]">Circulation History</a></li>[% END %]
64
	[% IF ( CAN_user_parameters ) %][% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=MEMBERS&amp;modules=circulation&amp;object=[% borrowernumber %]&amp;src=circ">Modification Log</a></li>[% END %]
64
	[% IF ( CAN_user_parameters ) %][% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=MEMBERS&amp;modules=circulation&amp;object=[% borrowernumber %]&amp;src=circ">Modification Log</a></li>[% END %]
65
    [% IF ( EnhancedMessagingPreferences ) %]
65
    [% IF ( EnhancedMessagingPreferences ) %]
66
    [% IF ( messagingview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/messaging.pl?borrowernumber=[% borrowernumber %]">Messaging</a></li>
67
    [% END %]	
66
    [% END %]	
68
	[% IF ( sentnotices ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber %]">Notices</a></li>
67
	[% IF ( sentnotices ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber %]">Notices</a></li>
69
</ul></div>
68
</ul></div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt (-1 lines)
Lines 65-71 in the global namespace %] Link Here
65
	[% IF ( intranetreadinghistory ) %][% IF ( readingrecordview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrower.borrowernumber %]">Circulation History</a></li>[% END %]
65
	[% IF ( intranetreadinghistory ) %][% IF ( readingrecordview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrower.borrowernumber %]">Circulation History</a></li>[% END %]
66
	[% IF ( CAN_user_parameters ) %][% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=MEMBERS&amp;modules=circulation&amp;object=[% borrower.borrowernumber %]&amp;src=circ">Modification Log</a></li>[% END %]
66
	[% IF ( CAN_user_parameters ) %][% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=MEMBERS&amp;modules=circulation&amp;object=[% borrower.borrowernumber %]&amp;src=circ">Modification Log</a></li>[% END %]
67
    [% IF ( EnhancedMessagingPreferences ) %]
67
    [% IF ( EnhancedMessagingPreferences ) %]
68
    [% IF ( messagingview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/messaging.pl?borrowernumber=[% borrower.borrowernumber %]">Messaging</a></li>
69
    [% END %]
68
    [% END %]
70
    [% IF ( sentnotices ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrower.borrowernumber %]">Notices</a></li>
69
    [% IF ( sentnotices ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrower.borrowernumber %]">Notices</a></li>
71
</ul></div>
70
</ul></div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/members-menu.inc (-1 lines)
Lines 8-14 Link Here
8
	[% IF ( intranetreadinghistory ) %][% IF ( readingrecordview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrowernumber %]">Circulation History</a></li>[% END %]
8
	[% IF ( intranetreadinghistory ) %][% IF ( readingrecordview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrowernumber %]">Circulation History</a></li>[% END %]
9
	[% IF ( CAN_user_parameters ) %][% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=MEMBERS&amp;action=MODIFY&amp;object=[% borrowernumber %]">Modification Log</a></li>[% END %]
9
	[% IF ( CAN_user_parameters ) %][% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=MEMBERS&amp;action=MODIFY&amp;object=[% borrowernumber %]">Modification Log</a></li>[% END %]
10
    [% IF ( EnhancedMessagingPreferences ) %]
10
    [% IF ( EnhancedMessagingPreferences ) %]
11
    [% IF ( messagingview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/messaging.pl?borrowernumber=[% borrowernumber %]">Messaging</a></li>
12
    [% END %]
11
    [% END %]
13
	[% IF ( sentnotices ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber %]">Notices</a></li>
12
	[% IF ( sentnotices ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber %]">Notices</a></li>
14
</ul></div>
13
</ul></div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/messaging.tt (-68 lines)
Lines 1-68 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Patrons &rsaquo; [% IF ( unknowuser ) %]Patron does not exist[% ELSE %]Patron Details for [% firstname %] [% surname %] ([% cardnumber %])[% END %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
<body>
6
[% INCLUDE 'header.inc' %]
7
[% INCLUDE 'patron-search.inc' %]
8
9
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; [% IF ( unknowuser ) %]Patron does not exist[% ELSE %]Patron Details for [% firstname %] [% surname %] ([% cardnumber %])[% END %] </div>
10
11
<div id="doc3" class="yui-t2">
12
   
13
   <div id="bd">
14
	<div id="yui-main">
15
	<div class="yui-b">
16
[% INCLUDE 'members-toolbar.inc' %]
17
[% IF ( error ) %]
18
<div class="dialog alert">
19
[% IF ( AUTH_UPDATE_FAILED ) %]
20
<h3>Userid / Password update failed</h3>
21
<strong>Insufficient privileges.</strong>
22
<p>Other fields updated.</p>
23
[% END %]
24
[% IF ( CANT_DELETE_STAFF ) %]
25
<h3>Unable to delete staff user</h3>
26
<p>Insufficient privileges.</p>
27
[% END %]
28
[% IF ( CANT_DELETE_OTHERLIBRARY ) %]
29
<h3>Unable to delete patrons from other libraries with current settings</h3>
30
<p>Insufficient privileges.</p>
31
[% END %]
32
[% IF ( CANT_DELETE ) %]
33
<h3>Unable to delete patron:</h3>
34
<p>Insufficient privileges.</p>
35
[% END %]
36
</div>
37
[% END %]
38
<div class="yui-g">
39
[% IF ( unknowuser ) %]
40
   <div class="dialog message">
41
   	 This patron does not exist.
42
   </div>
43
[% ELSE %]
44
45
<table>
46
  <caption>Message Queue</caption>
47
  <tr><th>Type</th><th>Subject</th><th>Status</th><th>Time Prepared</th></tr>
48
[% IF ( message_queue ) %]
49
  [% FOREACH message_queu IN message_queue %]
50
    <tr><td>[% message_queu.message_transport_type %]</td><td>[% message_queu.subject %]</td><td>[% message_queu.status %]</td><td>[% message_queu.time_queued %]</td></tr>
51
  [% END %]
52
[% ELSE %]
53
  <tr><td colspan="4">There is no record of any messages that have been sent to this patron.</td></tr>
54
[% END %]
55
</table>
56
57
</div>
58
59
[% END %] <!-- unknowuser -->
60
61
62
</div>
63
</div>
64
<div class="yui-b">
65
[% INCLUDE 'circ-menu.inc' %]
66
</div>
67
</div>
68
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt (-11 / +40 lines)
Lines 10-19 Link Here
10
		dateFormat: 'uk'
10
		dateFormat: 'uk'
11
	    [% END %]
11
	    [% END %]
12
	});
12
	});
13
    
14
    $("a.message-title").click(function(e){
15
        $("p.message").hide();
16
        $(this).next("p").show();
17
        e.preventDefault();
18
    });
19
    
13
    });
20
    });
14
//]]>
21
//]]>
15
</script>
22
</script>
16
23
<style type="text/css">
24
    p.message { display: none; }
25
    a.message-title { font-weight: bold; display: block; }
26
</style>
17
</head>
27
</head>
18
<body>
28
<body>
19
[% INCLUDE 'header.inc' %]
29
[% INCLUDE 'header.inc' %]
Lines 22-55 Link Here
22
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Sent notices for [% firstname %] [% surname %]</div>
32
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Sent notices for [% firstname %] [% surname %]</div>
23
33
24
<div id="doc3" class="yui-t2">
34
<div id="doc3" class="yui-t2">
25
   
35
    <div id="bd">
26
   <div id="bd">
36
    <div id="yui-main">
27
	<div id="yui-main">
37
    <div class="yui-b">
28
	<div class="yui-b">
29
[% INCLUDE 'circ-toolbar.inc' %]
38
[% INCLUDE 'circ-toolbar.inc' %]
30
<h1>Sent notices for [% firstname %] [% surname %]</h1>
39
<h1>Sent notices for [% firstname %] [% surname %]</h1>
31
40
41
32
    <table id="noticestable">
42
    <table id="noticestable">
33
	<thead>
43
	<thead>
34
	    <tr>
44
	    <tr>
35
		<th>Subject</th>
45
		<th>Notice</th>
36
		<th>Content</th>
37
		<th>Type</th>
46
		<th>Type</th>
38
		<th>Status</th>
47
		<th>Status</th>
39
		<th>Time</th>
48
		<th>Time</th>
40
	    </tr>
49
	    </tr>
41
	</thead>
50
	</thead>
51
[% IF ( QUEUED_MESSAGES ) %]
42
	<tbody>
52
	<tbody>
43
	    [% FOREACH QUEUED_MESSAGE IN QUEUED_MESSAGES %]
53
	    [% FOREACH QUEUED_MESSAGE IN QUEUED_MESSAGES %]
44
	    <tr>
54
	    <tr>
45
		<td>[% QUEUED_MESSAGE.subject %]</td>
55
		<td>
46
		<td>[% QUEUED_MESSAGE.content %]</td>
56
            <a class="message-title" href="#">[% QUEUED_MESSAGE.subject %]</a>
47
		<td>[% QUEUED_MESSAGE.message_transport_type %]</td>
57
            <p class="message">
48
		<td>[% QUEUED_MESSAGE.status %]</td>
58
                [% QUEUED_MESSAGE.content FILTER html_line_break %]
59
            </p>
60
        </td>
61
		<td>
62
            [% IF ( QUEUED_MESSAGE.message_transport_type == 'email' ) %]email
63
            [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'print' ) %]print
64
            [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'feed' ) %]feed
65
            [% ELSIF ( QUEUED_MESSAGE.message_transport_type == 'sms' ) %]sms
66
            [% ELSE %][% QUEUED_MESSAGE.message_transport_type %][% END %]
67
        </td>
68
		<td>
69
            [% IF ( QUEUED_MESSAGE.status == 'sent' ) %]sent
70
            [% ELSIF ( QUEUED_MESSAGE.status == 'pending' ) %]pending
71
            [% ELSIF ( QUEUED_MESSAGE.status == 'failed' ) %]failed
72
            [% ELSIF ( QUEUED_MESSAGE.status == 'deleted' ) %]deleted
73
            [% ELSE %][% QUEUED_MESSAGE.status %][% END %]
74
        </td>
49
		<td>[% QUEUED_MESSAGE.time_queued %]</td>
75
		<td>[% QUEUED_MESSAGE.time_queued %]</td>
50
	    </tr>
76
	    </tr>
51
	    [% END %]
77
	    [% END %]
52
	</tbody>
78
	</tbody>
79
    [% ELSE %]
80
    <tr><td colspan="4">There is no record of any messages that have been sent to this patron.</td></tr>
81
    [% END %]
53
    </table>
82
    </table>
54
83
55
</div>
84
</div>
(-)a/members/messaging.pl (-102 lines)
Lines 1-102 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2008 LibLime
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
21
use strict;
22
use warnings;
23
24
use CGI;
25
use C4::Context;
26
use C4::Auth;
27
use C4::Output;
28
use C4::Members;
29
use C4::Members::Messaging;
30
use C4::Dates;
31
use C4::Reserves;
32
use C4::Circulation;
33
use C4::Koha;
34
use C4::Letters;
35
use C4::Biblio;
36
use C4::Reserves;
37
use C4::Branch; # GetBranchName
38
39
use Data::Dumper;
40
41
use vars qw($debug);
42
43
BEGIN {
44
	$debug = $ENV{DEBUG} || 0;
45
}
46
47
my $dbh = C4::Context->dbh;
48
49
my $query = CGI->new();
50
51
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
52
    {
53
        template_name   => 'members/messaging.tmpl',
54
        query           => $query,
55
        type            => "intranet",
56
        authnotrequired => 0,
57
        flagsrequired   => { borrowers => 1 },
58
        debug           => 1,
59
    }
60
);
61
my $borrowernumber = $query->param('borrowernumber');
62
my $borrower       = GetMember( 'borrowernumber' => $borrowernumber );
63
my $branch         = C4::Context->userenv->{'branch'};
64
65
$template->param( $borrower );
66
67
$borrower = GetMemberDetails( $borrowernumber );
68
69
70
    if ( $borrower->{'category_type'} eq 'C') {
71
        my  ( $catcodes, $labels ) =  GetborCatFromCatType( 'A', 'WHERE category_type = ?' );
72
        my $cnt = scalar(@$catcodes);
73
        $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1;
74
        $template->param( 'catcode' =>    $catcodes->[0])  if $cnt == 1;
75
    }
76
	
77
my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'});
78
$template->param( picture => 1 ) if $picture;
79
80
# get some recent messages sent to this borrower for display:
81
my $message_queue = C4::Letters::GetQueuedMessages( { borrowernumber => $query->param('borrowernumber') } );
82
83
$template->param( messagingview               => 1,
84
                  message_queue               => $message_queue,
85
                  DHTMLcalendar_dateformat    => C4::Dates->DHTMLcalendar(), 
86
                  borrowernumber              => $borrowernumber,
87
                  branchname		      => GetBranchName($borrower->{'branchcode'}),
88
                  dateformat                  => C4::Context->preference("dateformat"),
89
                  categoryname                => $borrower->{'description'},
90
                  $borrower->{'categorycode'} => 1,
91
);
92
93
#$messaging_preferences->{'SMSnumber'}{'value'} = defined $borrower->{'smsalertnumber'}
94
#  ? $borrower->{'smsalertnumber'} : $borrower->{'mobile'};
95
96
$template->param( %{ $borrower } );
97
$template->param(
98
                  messagingview         => 1,
99
				  is_child        => ($borrower->{'category_type'} eq 'C'),
100
                );
101
102
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/members/notices.pl (-2 / +3 lines)
Lines 56-62 $template->param( %{$borrower} ); Link Here
56
$template->param(
56
$template->param(
57
			QUEUED_MESSAGES 	=> $queued_messages,
57
			QUEUED_MESSAGES 	=> $queued_messages,
58
			borrowernumber 		=> $borrowernumber,
58
			borrowernumber 		=> $borrowernumber,
59
			sentnotices 		=> 1
59
			sentnotices 		=> 1,
60
            branchname          => GetBranchName($borrower->{'branchcode'}),
61
            categoryname        => $borrower->{'description'},
60
		);
62
		);
61
output_html_with_http_headers $input, $cookie, $template->output;
63
output_html_with_http_headers $input, $cookie, $template->output;
62
64
63
- 

Return to bug 3941