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

(-)a/C4/Auth.pm (+2 lines)
Lines 368-373 sub get_template_and_user { Link Here
368
            AllowMultipleCovers         => C4::Context->preference('AllowMultipleCovers'),
368
            AllowMultipleCovers         => C4::Context->preference('AllowMultipleCovers'),
369
            EnableBorrowerFiles         => C4::Context->preference('EnableBorrowerFiles'),
369
            EnableBorrowerFiles         => C4::Context->preference('EnableBorrowerFiles'),
370
            UseKohaPlugins              => C4::Context->preference('UseKohaPlugins'),
370
            UseKohaPlugins              => C4::Context->preference('UseKohaPlugins'),
371
            useDischarge                => C4::Context->preference('useDischarge'),
371
        );
372
        );
372
    }
373
    }
373
    else {
374
    else {
Lines 471-476 sub get_template_and_user { Link Here
471
            OPACLocalCoverImages         => C4::Context->preference("OPACLocalCoverImages"),
472
            OPACLocalCoverImages         => C4::Context->preference("OPACLocalCoverImages"),
472
            PatronSelfRegistration       => C4::Context->preference("PatronSelfRegistration"),
473
            PatronSelfRegistration       => C4::Context->preference("PatronSelfRegistration"),
473
            PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"),
474
            PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"),
475
            useDischarge                 => C4::Context->preference('useDischarge'),
474
        );
476
        );
475
477
476
        $template->param(OpacPublic => '1') if ($user || C4::Context->preference("OpacPublic"));
478
        $template->param(OpacPublic => '1') if ($user || C4::Context->preference("OpacPublic"));
(-)a/C4/Discharges.pm (+100 lines)
Line 0 Link Here
1
package C4::Discharges;
2
3
# Copyright 2013 BibLibre
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
=head1 NAME
21
22
C4::Discharges - functions for discharges
23
24
=head1 DESCRIPTION
25
26
This modules allows to retrieve informations about generated discharges
27
28
=cut
29
30
use Modern::Perl;
31
use File::Basename;
32
33
our $debug;
34
use vars qw(@ISA @EXPORT);
35
BEGIN {
36
    $debug = $ENV{DEBUG} || 0;
37
    require Exporter;
38
    @ISA = qw( Exporter );
39
40
    push @EXPORT, qw(
41
      &GetDischarges
42
      &removeUnprocessedDischarges
43
    );
44
45
46
}
47
48
49
=head1 METHODS
50
51
=head2 GetDischarges($borrowernumber)
52
53
    my @list = GetDischarges($borrowernumber);
54
55
    returns the discharges list for a given borrower.
56
57
=cut
58
59
sub GetDischarges {
60
    my $borrowernumber = shift;
61
    return unless $borrowernumber;
62
63
    my $dischargePath    = C4::Context->preference('dischargePath');
64
    my $dischargeWebPath = C4::Context->preference('dischargeWebPath');
65
    my @return;
66
67
    my $pdf_path = qq{$dischargePath/$borrowernumber/*.pdf};
68
    my @files = <$pdf_path>;
69
    foreach (@files) {
70
        my ($file, $dir, $ext) = fileparse("$_");
71
        push @return, $file;
72
    }
73
74
    return @return;
75
}
76
77
=head2 removeUnprocessedDischarges($borrowernumber)
78
79
    removeUnprocessedDischarges($borrowernumber);
80
81
    Removes all discharges with a pending status, because if the process had been complete, the status would be 'sent'
82
83
=cut
84
85
sub removeUnprocessedDischarges {
86
    my $borrowernumber = shift;
87
    return unless $borrowernumber;
88
89
    my $dbh = C4::Context->dbh;
90
    my $query = q{
91
        DELETE FROM message_queue
92
        WHERE borrowernumber=?
93
            AND letter_code='DISCHARGE'
94
            AND status='pending'
95
    };
96
    my $sth = $dbh->prepare($query);
97
    return $sth->execute($borrowernumber);
98
}
99
100
1;
(-)a/C4/Letters.pm (-6 / +14 lines)
Lines 768-774 sub GetRSSMessages { Link Here
768
768
769
=head2 GetPrintMessages
769
=head2 GetPrintMessages
770
770
771
  my $message_list = GetPrintMessages( { borrowernumber => $borrowernumber } )
771
  my $message_list = GetPrintMessages( { borrowernumber => $borrowernumber [, letter_code => $letter_code] } )
772
772
773
Returns a arrayref of all queued print messages (optionally, for a particular
773
Returns a arrayref of all queued print messages (optionally, for a particular
774
person).
774
person).
Lines 777-786 person). Link Here
777
777
778
sub GetPrintMessages {
778
sub GetPrintMessages {
779
    my $params = shift || {};
779
    my $params = shift || {};
780
    
780
781
    return _get_unsent_messages( { message_transport_type => 'print',
781
    return _get_unsent_messages(
782
                                   borrowernumber         => $params->{'borrowernumber'},
782
        {
783
                                 } );
783
            message_transport_type => 'print',
784
            borrowernumber         => $params->{borrowernumber},
785
            letter_code            => $params->{letter_code},
786
        }
787
    );
784
}
788
}
785
789
786
=head2 GetQueuedMessages ([$hashref])
790
=head2 GetQueuedMessages ([$hashref])
Lines 888-896 ENDSQL Link Here
888
            push @query_params, $params->{'message_transport_type'};
892
            push @query_params, $params->{'message_transport_type'};
889
        }
893
        }
890
        if ( $params->{'borrowernumber'} ) {
894
        if ( $params->{'borrowernumber'} ) {
891
            $statement .= ' AND borrowernumber = ? ';
895
            $statement .= ' AND b.borrowernumber = ? ';
892
            push @query_params, $params->{'borrowernumber'};
896
            push @query_params, $params->{'borrowernumber'};
893
        }
897
        }
898
        if ( $params->{letter_code} ) {
899
            $statement .= ' AND letter_code = ? ';
900
            push @query_params, $params->{letter_code};
901
        }
894
        if ( $params->{'limit'} ) {
902
        if ( $params->{'limit'} ) {
895
            $statement .= ' limit ? ';
903
            $statement .= ' limit ? ';
896
            push @query_params, $params->{'limit'};
904
            push @query_params, $params->{'limit'};
(-)a/C4/Members.pm (-5 / +5 lines)
Lines 2216-2222 sub GetBorrowersNamesAndLatestIssue { Link Here
2216
2216
2217
=head2 DebarMember
2217
=head2 DebarMember
2218
2218
2219
my $success = DebarMember( $borrowernumber, $todate );
2219
my $success = DebarMember( $borrowernumber, $todate, $comment );
2220
2220
2221
marks a Member as debarred, and therefore unable to checkout any more
2221
marks a Member as debarred, and therefore unable to checkout any more
2222
items.
2222
items.
Lines 2227-2241 true on success, false on failure Link Here
2227
=cut
2227
=cut
2228
2228
2229
sub DebarMember {
2229
sub DebarMember {
2230
    my $borrowernumber = shift;
2230
    my ( $borrowernumber, $todate, $comment ) = @_;
2231
    my $todate         = shift;
2232
2231
2233
    return unless defined $borrowernumber;
2232
    return unless defined $borrowernumber;
2234
    return unless $borrowernumber =~ /^\d+$/;
2233
    return unless $borrowernumber =~ /^\d+$/;
2235
2234
2236
    return ModMember(
2235
    return ModMember(
2237
        borrowernumber => $borrowernumber,
2236
        borrowernumber  => $borrowernumber,
2238
        debarred       => $todate
2237
        debarred        => $todate,
2238
        debarredcomment => $comment,
2239
    );
2239
    );
2240
2240
2241
}
2241
}
(-)a/installer/data/mysql/de-DE/mandatory/sample_notices.sql (-1 / +2 lines)
Lines 15-21 VALUES ('circulation','ODUE','Mahnung','Mahnung','Liebe/r <<borrowers.firstname> Link Here
15
('suggestions','ACCEPTED','Anschaffungsvorschlag wurde angenommen', 'Ihr Anschaffungsvorschlag wurde angenommen','Liebe(r) <<borrowers.firstname>> <<borrowers.surname>>,\n\nSie haben der Bibliothek folgendes Medium zur Anschaffung vorgeschlagen: <<suggestions.title>> by <<suggestions.author>>.\n\nDie Bibliothek hat diesen Titel heute recherchiert und wird Ihn sobald wie möglich im Buchhandel bestellen. Sie erhalten Nachricht, sobald die Bestellung abgeschlossen ist und sobald der Titel in der Bibliotek verfügbar ist.\n\nWenn Sie Fragen haben, richten Sie Ihre Mail bitte an: <<branches.branchemail>>.\n\nVielen Dank,\n\n<<branches.branchname>>'),
15
('suggestions','ACCEPTED','Anschaffungsvorschlag wurde angenommen', 'Ihr Anschaffungsvorschlag wurde angenommen','Liebe(r) <<borrowers.firstname>> <<borrowers.surname>>,\n\nSie haben der Bibliothek folgendes Medium zur Anschaffung vorgeschlagen: <<suggestions.title>> by <<suggestions.author>>.\n\nDie Bibliothek hat diesen Titel heute recherchiert und wird Ihn sobald wie möglich im Buchhandel bestellen. Sie erhalten Nachricht, sobald die Bestellung abgeschlossen ist und sobald der Titel in der Bibliotek verfügbar ist.\n\nWenn Sie Fragen haben, richten Sie Ihre Mail bitte an: <<branches.branchemail>>.\n\nVielen Dank,\n\n<<branches.branchname>>'),
16
('suggestions','AVAILABLE','Vorgeschlagenes Medium verfügbar', 'Das vorgeschlagene Medium ist jetzt verfügbar','Liebe(r) <<borrowers.firstname>> <<borrowers.surname>>,\n\nSie haben der Bibliothek folgendes Medium zur Anschaffung vorgeschlagen: <<suggestions.title>> von <<suggestions.author>>.\n\nWir freuen uns Ihnen mitteilen zu können, dass dieser Titel jetzt im Bestand der Bibliothek verfügbar ist.\n\nWenn Sie Fragen haben, richten Sie Ihre Mail bitte an: <<branches.branchemail>>.\n\nVielen Dank,\n\n<<branches.branchname>>'),
16
('suggestions','AVAILABLE','Vorgeschlagenes Medium verfügbar', 'Das vorgeschlagene Medium ist jetzt verfügbar','Liebe(r) <<borrowers.firstname>> <<borrowers.surname>>,\n\nSie haben der Bibliothek folgendes Medium zur Anschaffung vorgeschlagen: <<suggestions.title>> von <<suggestions.author>>.\n\nWir freuen uns Ihnen mitteilen zu können, dass dieser Titel jetzt im Bestand der Bibliothek verfügbar ist.\n\nWenn Sie Fragen haben, richten Sie Ihre Mail bitte an: <<branches.branchemail>>.\n\nVielen Dank,\n\n<<branches.branchname>>'),
17
('suggestions','ORDERED','Vorgeschlagenes Medium bestellt', 'Das vorgeschlagene Medium wurde im Buchhandel bestellt','Liebe(r) <<borrowers.firstname>> <<borrowers.surname>>,\n\nSie haben der Bibliothek folgendes Medium zur Anschaffung vorgeschlaten: <<suggestions.title>> von <<suggestions.author>>.\n\nWir freuen uns Ihnen mitteilen zu können, dass dieser Titel jetzt im Buchhandel bestellt wurde. Nach Eintreffen wird er in unseren Bestand eingearbeitet.\n\nSie erhalten Nachricht, sobald das Medium verfügbar ist.\n\nBei Nachfragen erreichen Sie uns unter der Emailadresse <<branches.branchemail>>.\n\nVielen Dank,\n\n<<branches.branchname>>'),
17
('suggestions','ORDERED','Vorgeschlagenes Medium bestellt', 'Das vorgeschlagene Medium wurde im Buchhandel bestellt','Liebe(r) <<borrowers.firstname>> <<borrowers.surname>>,\n\nSie haben der Bibliothek folgendes Medium zur Anschaffung vorgeschlaten: <<suggestions.title>> von <<suggestions.author>>.\n\nWir freuen uns Ihnen mitteilen zu können, dass dieser Titel jetzt im Buchhandel bestellt wurde. Nach Eintreffen wird er in unseren Bestand eingearbeitet.\n\nSie erhalten Nachricht, sobald das Medium verfügbar ist.\n\nBei Nachfragen erreichen Sie uns unter der Emailadresse <<branches.branchemail>>.\n\nVielen Dank,\n\n<<branches.branchname>>'),
18
('suggestions','REJECTED','Anschaffungsvorschlag nicht angenommen', 'Ihr Anschaffungsvorschlag wurde nicht angenommen','Liebe(r) <<borrowers.firstname>> <<borrowers.surname>>,\n\nSie haven der Bibliothek folgendes Medium zur Anschaffung vorgeschlagen: <<suggestions.title>> von <<suggestions.author>>.\n\nDie Bibliothek hat diesen Titel heute recherchiert und sich gegen eine Anschaffung entschieden.\n\nBegründung: <<suggestions.reason>>\n\nWenn Sie Fragen haben, richten Sie Ihre Mail bitte an: <<branches.branchemail>>.\n\nVielen Dank,\n\n<<branches.branchname>>');
18
('suggestions','REJECTED','Anschaffungsvorschlag nicht angenommen', 'Ihr Anschaffungsvorschlag wurde nicht angenommen','Liebe(r) <<borrowers.firstname>> <<borrowers.surname>>,\n\nSie haven der Bibliothek folgendes Medium zur Anschaffung vorgeschlagen: <<suggestions.title>> von <<suggestions.author>>.\n\nDie Bibliothek hat diesen Titel heute recherchiert und sich gegen eine Anschaffung entschieden.\n\nBegründung: <<suggestions.reason>>\n\nWenn Sie Fragen haben, richten Sie Ihre Mail bitte an: <<branches.branchemail>>.\n\nVielen Dank,\n\n<<branches.branchname>>'),
19
('members', 'DISCHARGE', 'Discharge', 'Discharge for <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Discharge</h1>\r\n\r\nThe library <<borrowers.branchcode>> certifies that the following borrower :\r\n\r\n    <<borrowers.firstname>> <<borrowers.surname>>\r\n   Cardnumber : <<borrowers.cardnumber>>\r\n\r\nreturned all his documents.\r\n\r\n<<today>>');
19
20
20
INSERT INTO `letter` (module, code, name, title, content, is_html)
21
INSERT INTO `letter` (module, code, name, title, content, is_html)
21
VALUES ('circulation','ISSUESLIP','Ausleihquittung (Quittungsdruck)','Ausleihquittung (Quittungsdruck)', '<h3><<branches.branchname>></h3>
22
VALUES ('circulation','ISSUESLIP','Ausleihquittung (Quittungsdruck)','Ausleihquittung (Quittungsdruck)', '<h3><<branches.branchname>></h3>
(-)a/installer/data/mysql/en/mandatory/sample_notices.sql (-1 / +2 lines)
Lines 16-22 VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f Link Here
16
('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
16
('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
17
('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
17
('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
18
('suggestions','ORDERED','Suggestion ordered', 'Suggested item ordered','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <<branches.branchemail>>\n\nThank you,\n\n<<branches.branchname>>'),
18
('suggestions','ORDERED','Suggestion ordered', 'Suggested item ordered','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <<branches.branchemail>>\n\nThank you,\n\n<<branches.branchname>>'),
19
('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>');
19
('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
20
('members', 'DISCHARGE', 'Discharge', 'Discharge for <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Discharge</h1>\r\n\r\nThe library <<borrowers.branchcode>> certifies that the following borrower :\r\n\r\n    <<borrowers.firstname>> <<borrowers.surname>>\r\n   Cardnumber : <<borrowers.cardnumber>>\r\n\r\nreturned all his documents.\r\n\r\n<<today>>');
20
INSERT INTO `letter` (module, code, name, title, content, is_html)
21
INSERT INTO `letter` (module, code, name, title, content, is_html)
21
VALUES ('circulation','ISSUESLIP','Issue Slip','Issue Slip', '<h3><<branches.branchname>></h3>
22
VALUES ('circulation','ISSUESLIP','Issue Slip','Issue Slip', '<h3><<branches.branchname>></h3>
22
Checked out to <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
23
Checked out to <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
(-)a/installer/data/mysql/es-ES/mandatory/sample_notices.sql (-1 / +2 lines)
Lines 15-19 VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f Link Here
15
('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
15
('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
16
('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
16
('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
17
('suggestions','ORDERED','Suggestion ordered', 'Suggested item ordered','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <<branches.branchemail>>\n\nThank you,\n\n<<branches.branchname>>'),
17
('suggestions','ORDERED','Suggestion ordered', 'Suggested item ordered','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <<branches.branchemail>>\n\nThank you,\n\n<<branches.branchname>>'),
18
('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>');
18
('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
19
('members', 'DISCHARGE', 'Discharge', 'Discharge for <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Discharge</h1>\r\n\r\nThe library <<borrowers.branchcode>> certifies that the following borrower :\r\n\r\n    <<borrowers.firstname>> <<borrowers.surname>>\r\n   Cardnumber : <<borrowers.cardnumber>>\r\n\r\nreturned all his documents.\r\n\r\n<<today>>');
19
INSERT INTO `letter` (module, code, name, title, content) VALUES ('circulation','RENEWAL','Item Renewal','Renewals','The following items have been renew:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
20
INSERT INTO `letter` (module, code, name, title, content) VALUES ('circulation','RENEWAL','Item Renewal','Renewals','The following items have been renew:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
(-)a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql (-1 / +2 lines)
Lines 17-21 VALUES Link Here
17
('suggestions','ACCEPTED','Suggestion accceptée', 'Suggestion acceptée','Cher(e) <<borrowers.firstname>> <<borrowers.surname>>,\n\nVous avez crée une suggestion d\'achat au sujet du document <<suggestions.title>> de <<suggestions.author>>.\n\nLa Bibliothèque a reçu votre demande ce jour. Nous donnerons suite à votre demande aussi vite que possible. Vous serez averti par courriel dès que la commande sera envoyée,et quand les documents seront arrivés à la Bibliothèque.\n\nSi vous avez des questions, merci de nous contacter à l\'adresse suivante <<branches.branchemail>>.\n\nMerci,\n\n<<branches.branchname>>'),
17
('suggestions','ACCEPTED','Suggestion accceptée', 'Suggestion acceptée','Cher(e) <<borrowers.firstname>> <<borrowers.surname>>,\n\nVous avez crée une suggestion d\'achat au sujet du document <<suggestions.title>> de <<suggestions.author>>.\n\nLa Bibliothèque a reçu votre demande ce jour. Nous donnerons suite à votre demande aussi vite que possible. Vous serez averti par courriel dès que la commande sera envoyée,et quand les documents seront arrivés à la Bibliothèque.\n\nSi vous avez des questions, merci de nous contacter à l\'adresse suivante <<branches.branchemail>>.\n\nMerci,\n\n<<branches.branchname>>'),
18
('suggestions','AVAILABLE','Suggestion disponible', 'Suggestion d\'achat disponible','cher(e) <<borrowers.firstname>> <<borrowers.surname>>,\n\nVous avez effectué une suggestion d\'achat pour le docuement  <<suggestions.title>> de <<suggestions.author>>.\n\nNous sommes heureux de vous informer que le document que vous aviez demandé est maintenant disponible dans nos collections.\n\nSi vous avez des questions, merci de nous contacter par courriel à l\'adresse <<branches.branchemail>>.\n\nMerci,\n\n<<branches.branchname>>'),
18
('suggestions','AVAILABLE','Suggestion disponible', 'Suggestion d\'achat disponible','cher(e) <<borrowers.firstname>> <<borrowers.surname>>,\n\nVous avez effectué une suggestion d\'achat pour le docuement  <<suggestions.title>> de <<suggestions.author>>.\n\nNous sommes heureux de vous informer que le document que vous aviez demandé est maintenant disponible dans nos collections.\n\nSi vous avez des questions, merci de nous contacter par courriel à l\'adresse <<branches.branchemail>>.\n\nMerci,\n\n<<branches.branchname>>'),
19
('suggestions','ORDERED','Suggestion commandée', 'Suggestion commandée','Cher(e) <<borrowers.firstname>> <<borrowers.surname>>,\n\nVous avez effectué une demande de suggestion d\'achat sur le docuement <<suggestions.title>> de <<suggestions.author>>.\n\nNous sommes heureux de vous informer que le document que vous avez demandé est maintenant en commande. Le document devrait arriver rapidement dans nos collections.\n\nVous serez averti quand le docuement sera disponible.\n\nSi vous avez des questions, merci de nous contacter à l\'adresse <<branches.branchemail>>\n\nMerci,\n\n<<branches.branchname>>'),
19
('suggestions','ORDERED','Suggestion commandée', 'Suggestion commandée','Cher(e) <<borrowers.firstname>> <<borrowers.surname>>,\n\nVous avez effectué une demande de suggestion d\'achat sur le docuement <<suggestions.title>> de <<suggestions.author>>.\n\nNous sommes heureux de vous informer que le document que vous avez demandé est maintenant en commande. Le document devrait arriver rapidement dans nos collections.\n\nVous serez averti quand le docuement sera disponible.\n\nSi vous avez des questions, merci de nous contacter à l\'adresse <<branches.branchemail>>\n\nMerci,\n\n<<branches.branchname>>'),
20
('suggestions','REJECTED','Suggestion rejetée', 'Suggestion d\'achat rejeté','Cher(e) <<borrowers.firstname>> <<borrowers.surname>>,\n\nVous avez fait la demande du document <<suggestions.title>> de <<suggestions.author>>.\n\nla Bibliothèque a examiné votre demande ce jour, et a décidé de ne pas retenir la suggestion pour l\'instant.\n\nLa raison est la suivante: <<suggestions.reason>>\n\nSi vous avez des questions, merci de nous contacter à l\'adresse <<branches.branchemail>>.\n\nMerci,\n\n<<branches.branchname>>');
20
('suggestions','REJECTED','Suggestion rejetée', 'Suggestion d\'achat rejeté','Cher(e) <<borrowers.firstname>> <<borrowers.surname>>,\n\nVous avez fait la demande du document <<suggestions.title>> de <<suggestions.author>>.\n\nla Bibliothèque a examiné votre demande ce jour, et a décidé de ne pas retenir la suggestion pour l\'instant.\n\nLa raison est la suivante: <<suggestions.reason>>\n\nSi vous avez des questions, merci de nous contacter à l\'adresse <<branches.branchemail>>.\n\nMerci,\n\n<<branches.branchname>>'),
21
('members', 'DISCHARGE', 'Quitus', 'Quitus pour <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Quitus</h1>\r\n\r\nLa librairie <<borrowers.branchcode>> certifies que lecteur suivant :\r\n\r\n    <<borrowers.firstname>> <<borrowers.surname>>\r\n   Numéro de carte : <<borrowers.cardnumber>>\r\n\r\na bien retourné tous ses documents.\r\n\r\n<<today>>');
21
INSERT INTO `letter` (module, code, name, title, content) VALUES ('circulation','RENEWAL','Item Renewal','Renewals','Les documents suivants ont été renouvelés\r\n----\r\n<<biblio.title>>\r\n----\r\nMerci, <<branches.branchname>>.');
22
INSERT INTO `letter` (module, code, name, title, content) VALUES ('circulation','RENEWAL','Item Renewal','Renewals','Les documents suivants ont été renouvelés\r\n----\r\n<<biblio.title>>\r\n----\r\nMerci, <<branches.branchname>>.');
(-)a/installer/data/mysql/it-IT/necessari/notices.sql (-1 / +2 lines)
Lines 15-21 VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f Link Here
15
('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
15
('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
16
('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
16
('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
17
('suggestions','ORDERED','Suggestion ordered', 'Suggested item ordered','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <<branches.branchemail>>\n\nThank you,\n\n<<branches.branchname>>'),
17
('suggestions','ORDERED','Suggestion ordered', 'Suggested item ordered','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <<branches.branchemail>>\n\nThank you,\n\n<<branches.branchname>>'),
18
('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>');
18
('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
19
('members', 'DISCHARGE', 'Discharge', 'Discharge for <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Discharge</h1>\r\n\r\nThe library <<borrowers.branchcode>> certifies that the following borrower :\r\n\r\n    <<borrowers.firstname>> <<borrowers.surname>>\r\n   Cardnumber : <<borrowers.cardnumber>>\r\n\r\nreturned all his documents.\r\n\r\n<<today>>');
19
INSERT INTO letter (module, code, name, title, content, is_html)
20
INSERT INTO letter (module, code, name, title, content, is_html)
20
VALUES ('circulation','ISSUESLIP','Issue Slip','Issue Slip', '<h3><<branches.branchname>></h3>
21
VALUES ('circulation','ISSUESLIP','Issue Slip','Issue Slip', '<h3><<branches.branchname>></h3>
21
Checked out to <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
22
Checked out to <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
(-)a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql (-1 / +2 lines)
Lines 36-40 VALUES ('circulation','ODUE','Purring','Purring på dokument','<<borrowers.first Link Here
36
('suggestions','ACCEPTED','Forslag godtatt', 'Innkjøpsforslag godtatt','<<borrowers.firstname>> <<borrowers.surname>>,\n\nDu har foreslått at biblioteket kjøper inn <<suggestions.title>> av <<suggestions.author>>.\n\nBiblioteket har vurdert forslaget i dag. Dokumentet vil bli bestilt så fort det lar seg gjøre. Du vil få en ny melding når bestillingen er gjort, og når dokumentet ankommer biblioteket.\n\nEr det noe du lurer på, vennligst kontakt oss på <<branches.branchemail>>.\n\nVennlig hilsen,\n\n<<branches.branchname>>'),
36
('suggestions','ACCEPTED','Forslag godtatt', 'Innkjøpsforslag godtatt','<<borrowers.firstname>> <<borrowers.surname>>,\n\nDu har foreslått at biblioteket kjøper inn <<suggestions.title>> av <<suggestions.author>>.\n\nBiblioteket har vurdert forslaget i dag. Dokumentet vil bli bestilt så fort det lar seg gjøre. Du vil få en ny melding når bestillingen er gjort, og når dokumentet ankommer biblioteket.\n\nEr det noe du lurer på, vennligst kontakt oss på <<branches.branchemail>>.\n\nVennlig hilsen,\n\n<<branches.branchname>>'),
37
('suggestions','AVAILABLE','Foreslått dokument tilgjengelig', 'Foreslått dokument tilgjengelig','<<borrowers.firstname>> <<borrowers.surname>>,\n\nDu har foreslått at biblioteket kjøper inn <<suggestions.title>> av <<suggestions.author>>.\n\nVi har gleden av å informere deg om at dokumentet nå er innlemmet i samlingen.\n\nEr det noe du lurer på, vennligst kontakt oss på <<branches.branchemail>>.\n\nVennlig hilsen,\n\n<<branches.branchname>>'),
37
('suggestions','AVAILABLE','Foreslått dokument tilgjengelig', 'Foreslått dokument tilgjengelig','<<borrowers.firstname>> <<borrowers.surname>>,\n\nDu har foreslått at biblioteket kjøper inn <<suggestions.title>> av <<suggestions.author>>.\n\nVi har gleden av å informere deg om at dokumentet nå er innlemmet i samlingen.\n\nEr det noe du lurer på, vennligst kontakt oss på <<branches.branchemail>>.\n\nVennlig hilsen,\n\n<<branches.branchname>>'),
38
('suggestions','ORDERED','Innkjøpsforslag i bestilling', 'Innkjøpsforslag i bestilling','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nDu har foreslått at biblioteket kjøper inn <<suggestions.title>> av <<suggestions.author>>.\n\nVi har gleden av å informere deg om at dokumentet du foreslo nå er i bestilling.\n\nDu vil få en ny melding når dokumentet er tilgjengelig.\n\nEr det noe du lurer på, vennligst kontakt oss på <<branches.branchemail>>.\n\nVennlig hilsen,\n\n<<branches.branchname>>'),
38
('suggestions','ORDERED','Innkjøpsforslag i bestilling', 'Innkjøpsforslag i bestilling','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nDu har foreslått at biblioteket kjøper inn <<suggestions.title>> av <<suggestions.author>>.\n\nVi har gleden av å informere deg om at dokumentet du foreslo nå er i bestilling.\n\nDu vil få en ny melding når dokumentet er tilgjengelig.\n\nEr det noe du lurer på, vennligst kontakt oss på <<branches.branchemail>>.\n\nVennlig hilsen,\n\n<<branches.branchname>>'),
39
('suggestions','REJECTED','Innkjøpsforslag avslått', 'Innkjøpsforslag avslått','<<borrowers.firstname>> <<borrowers.surname>>,\n\nDu har foreslått at biblioteket kjøper inn <<suggestions.title>> av <<suggestions.author>>.\n\nBiblioteket har vurdert innkjøpsforslaget ditt i dag, og bestemt seg for å ikke ta det til følge.\n\nBegrunnelse: <<suggestions.reason>>\n\nEr det noe du lurer på, vennligst kontakt oss på <<branches.branchemail>>.\n\nVennlig hilsen,\n\n<<branches.branchname>>');
39
('suggestions','REJECTED','Innkjøpsforslag avslått', 'Innkjøpsforslag avslått','<<borrowers.firstname>> <<borrowers.surname>>,\n\nDu har foreslått at biblioteket kjøper inn <<suggestions.title>> av <<suggestions.author>>.\n\nBiblioteket har vurdert innkjøpsforslaget ditt i dag, og bestemt seg for å ikke ta det til følge.\n\nBegrunnelse: <<suggestions.reason>>\n\nEr det noe du lurer på, vennligst kontakt oss på <<branches.branchemail>>.\n\nVennlig hilsen,\n\n<<branches.branchname>>'),
40
('members', 'DISCHARGE', 'Discharge', 'Discharge for <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Discharge</h1>\r\n\r\nThe library <<borrowers.branchcode>> certifies that the following borrower :\r\n\r\n    <<borrowers.firstname>> <<borrowers.surname>>\r\n   Cardnumber : <<borrowers.cardnumber>>\r\n\r\nreturned all his documents.\r\n\r\n<<today>>');
40
INSERT INTO `letter` (module, code, name, title, content) VALUES ('circulation','RENEWAL','Item Renewal','Renewals','The following items have been renew:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
41
INSERT INTO `letter` (module, code, name, title, content) VALUES ('circulation','RENEWAL','Item Renewal','Renewals','The following items have been renew:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
(-)a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql (-1 / +2 lines)
Lines 17-21 VALUES Link Here
17
('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
17
('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
18
('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
18
('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
19
('suggestions','ORDERED','Suggestion ordered', 'Suggested item ordered','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <<branches.branchemail>>\n\nThank you,\n\n<<branches.branchname>>'),
19
('suggestions','ORDERED','Suggestion ordered', 'Suggested item ordered','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <<branches.branchemail>>\n\nThank you,\n\n<<branches.branchname>>'),
20
('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>');
20
('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
21
('members', 'DISCHARGE', 'Discharge', 'Discharge for <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Discharge</h1>\r\n\r\nThe library <<borrowers.branchcode>> certifies that the following borrower :\r\n\r\n    <<borrowers.firstname>> <<borrowers.surname>>\r\n   Cardnumber : <<borrowers.cardnumber>>\r\n\r\nreturned all his documents.\r\n\r\n<<today>>');
21
INSERT INTO `letter` (module, code, name, title, content) VALUES ('circulation','RENEWAL','Item Renewal','Renewals','The following items have been renew:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
22
INSERT INTO `letter` (module, code, name, title, content) VALUES ('circulation','RENEWAL','Item Renewal','Renewals','The following items have been renew:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
(-)a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql (-1 / +2 lines)
Lines 15-19 VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f Link Here
15
('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
15
('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
16
('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
16
('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
17
('suggestions','ORDERED','Suggestion ordered', 'Suggested item ordered','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <<branches.branchemail>>\n\nThank you,\n\n<<branches.branchname>>'),
17
('suggestions','ORDERED','Suggestion ordered', 'Suggested item ordered','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <<branches.branchemail>>\n\nThank you,\n\n<<branches.branchname>>'),
18
('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>');
18
('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
19
('members', 'DISCHARGE', 'Discharge', 'Discharge for <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Discharge</h1>\r\n\r\nThe library <<borrowers.branchcode>> certifies that the following borrower :\r\n\r\n    <<borrowers.firstname>> <<borrowers.surname>>\r\n   Cardnumber : <<borrowers.cardnumber>>\r\n\r\nreturned all his documents.\r\n\r\n<<today>>');
19
INSERT INTO `letter` (module, code, name, title, content) VALUES ('circulation','RENEWAL','Item Renewal','Renewals','The following items have been renew:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
20
INSERT INTO `letter` (module, code, name, title, content) VALUES ('circulation','RENEWAL','Item Renewal','Renewals','The following items have been renew:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
(-)a/installer/data/mysql/sysprefs.sql (+3 lines)
Lines 423-425 INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( Link Here
423
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('DisplayIconsXSLT', '1', '', 'If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.', 'YesNo');
423
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('DisplayIconsXSLT', '1', '', 'If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.', 'YesNo');
424
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPAC','0','','If on, and a patron is logged into the OPAC, items from his or her home library will be emphasized and shown first in search results and item details.','YesNo');
424
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPAC','0','','If on, and a patron is logged into the OPAC, items from his or her home library will be emphasized and shown first in search results and item details.','YesNo');
425
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPACWhich','PatronBranch','PatronBranch|OpacURLBranch','Decides which branch''s items to emphasize. If PatronBranch, emphasize the logged in user''s library''s items. If OpacURLBranch, highlight the items of the Apache var BRANCHCODE defined in Koha''s Apache configuration file.','Choice')
425
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPACWhich','PatronBranch','PatronBranch|OpacURLBranch','Decides which branch''s items to emphasize. If PatronBranch, emphasize the logged in user''s library''s items. If OpacURLBranch, highlight the items of the Apache var BRANCHCODE defined in Koha''s Apache configuration file.','Choice')
426
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('useDischarge','','Allows librarians to discharge borrowers and borrowers to request a discharge','','YesNo');
427
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('dischargePath','','Sets the upload path for the generated discharges','','');
428
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('dischargeWebPath','','Set the upload path starting from document root for the generated discharges','','');
(-)a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql (-1 / +2 lines)
Lines 14-18 VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f Link Here
14
('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
14
('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
15
('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
15
('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
16
('suggestions','ORDERED','Suggestion ordered', 'Suggested item ordered','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <<branches.branchemail>>\n\nThank you,\n\n<<branches.branchname>>'),
16
('suggestions','ORDERED','Suggestion ordered', 'Suggested item ordered','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <<branches.branchemail>>\n\nThank you,\n\n<<branches.branchname>>'),
17
('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>');
17
('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
18
('members', 'DISCHARGE', 'Discharge', 'Discharge for <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Discharge</h1>\r\n\r\nThe library <<borrowers.branchcode>> certifies that the following borrower :\r\n\r\n    <<borrowers.firstname>> <<borrowers.surname>>\r\n   Cardnumber : <<borrowers.cardnumber>>\r\n\r\nreturned all his documents.\r\n\r\n<<today>>');
18
INSERT INTO `letter` (module, code, name, title, content) VALUES ('circulation','RENEWAL','Item Renewal','Renewals','The following items have been renew:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
19
INSERT INTO `letter` (module, code, name, title, content) VALUES ('circulation','RENEWAL','Item Renewal','Renewals','The following items have been renew:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
(-)a/installer/data/mysql/updatedatabase.pl (+12 lines)
Lines 6749-6754 if ( CheckVersion($DBversion) ) { Link Here
6749
}
6749
}
6750
6750
6751
6751
6752
6753
6754
$DBversion = "3.11.00.XXX";
6755
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
6756
    $dbh->do("INSERT IGNORE INTO `systempreferences` (variable,value,explanation,options,type) VALUES('useDischarge','','Allows librarians to discharge borrowers and borrowers to request a discharge','','YesNo');");
6757
    $dbh->do("INSERT IGNORE INTO `systempreferences` (variable,value,explanation,options,type) VALUES('dischargePath','','Sets the upload path for the generated discharges','','');");
6758
    $dbh->do("INSERT IGNORE INTO `systempreferences` (variable,value,explanation,options,type) VALUES('dischargeWebPath','','Sets the upload path starting from documentroot for the generated discharges','','');");
6759
    $dbh->do("INSERT INTO `letter` (module, code, name, title, content) VALUES('members', 'DISCHARGE', 'Discharge', 'Discharge for <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Discharge</h1>\r\n\r\nThe library <<borrowers.branchcode>> certifies that the following borrower :\r\n\r\n    <<borrowers.firstname>> <<borrowers.surname>>\r\n   Cardnumber : <<borrowers.cardnumber>>\r\n\r\nreturned all his documents.\r\n\r\n<<today>>');");
6760
    print "Upgrade to $DBversion done (Add System Preferences useDischarge, dischargePath, dischargeWebpath and discharge notice)\n";
6761
    SetVersion($DBversion);
6762
}
6763
6752
=head1 FUNCTIONS
6764
=head1 FUNCTIONS
6753
6765
6754
=head2 TableExists($table)
6766
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc (+3 lines)
Lines 83-88 Link Here
83
    [% IF EnableBorrowerFiles %]
83
    [% IF EnableBorrowerFiles %]
84
        [% IF ( borrower_files ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/files.pl?borrowernumber=[% borrowernumber %]">Files</a></li>
84
        [% IF ( borrower_files ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/files.pl?borrowernumber=[% borrowernumber %]">Files</a></li>
85
    [% END %]
85
    [% END %]
86
    [% IF CAN_user_borrowers && useDischarge %]
87
        [% IF dischargeview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/discharge.pl?borrowernumber=[% borrowernumber %]">Discharge</a></li>
88
    [% END %]
86
</ul></div>
89
</ul></div>
87
[% END %]
90
[% END %]
88
91
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt (+4 lines)
Lines 78-83 in the global namespace %] Link Here
78
    [% END %]
78
    [% END %]
79
    [% IF ( sentnotices ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrower.borrowernumber %]">Notices</a></li>
79
    [% IF ( sentnotices ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrower.borrowernumber %]">Notices</a></li>
80
    [% IF (  statisticsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/statistics.pl?borrowernumber=[% borrowernumber %]">Statistics</a></li>
80
    [% IF (  statisticsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/statistics.pl?borrowernumber=[% borrowernumber %]">Statistics</a></li>
81
    [% IF CAN_user_borrowers && useDischarge %]
82
        [% IF dischargeview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/discharge.pl?borrowernumber=[% borrowernumber %]">Discharge</a></li>
83
    [% END %]
84
81
</ul></div>
85
</ul></div>
82
[% END %]
86
[% END %]
83
87
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/members-menu.inc (+3 lines)
Lines 19-24 Link Here
19
    [% IF EnableBorrowerFiles %]
19
    [% IF EnableBorrowerFiles %]
20
        [% IF ( borrower_files ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/files.pl?borrowernumber=[% borrowernumber %]">Files</a></li>
20
        [% IF ( borrower_files ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/files.pl?borrowernumber=[% borrowernumber %]">Files</a></li>
21
    [% END %]
21
    [% END %]
22
    [% IF CAN_user_borrowers && useDischarge %]
23
        [% IF dischargeview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/discharge.pl?borrowernumber=[% borrowernumber %]">Discharge</a></li>
24
    [% END %]
22
  </ul>
25
  </ul>
23
</div>
26
</div>
24
[% END %]
27
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (+14 lines)
Lines 139-141 Patrons: Link Here
139
               yes: Do
139
               yes: Do
140
               no: "Don't"
140
               no: "Don't"
141
         - enable the ability to upload and attach arbitrary files to a borrower record.
141
         - enable the ability to upload and attach arbitrary files to a borrower record.
142
     -
143
         - pref: useDischarge
144
           choices:
145
               yes: Allows
146
               no: "Don't allow"
147
         - librarians to discharge borrowers and borrowers to request a discharge
148
     -
149
         - pref: dischargePath
150
           class: multi
151
         - Sets the upload path for the generated discharges
152
     -
153
         - pref: dischargeWebPath
154
           class: multi
155
         - Sets the upload path starting from documentroot for the generated discharges
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt (+53 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Patrons &rsaquo; [% IF (unknowuser) %]Patron does not exist[% ELSE %]Discharge 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">
10
         <a href="/cgi-bin/koha/mainpage.pl">Home</a>
11
&rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
12
&rsaquo; [% IF (unknowuser) %]Patron does not exist[% ELSE %]Discharge for [% firstname %] [% surname %] ([% cardnumber %])[% END %]
13
</div>
14
15
<div id="doc3" class="yui-t1">
16
   <div id="bd">
17
    <div id="yui-main">
18
    <div class="yui-b">
19
<div class="yui-g">
20
<h3>Discharge</h3>
21
[% IF path_missing %]<p class="warning">The system preferences dischargePath and dischargeWebPath have to be filled.</p>[% END %]
22
[% IF (error) %]<p class="warning">An error has occured while generating the discharge. Please retry later or contact your administrator.</p>[% END %]
23
[% IF (hasissues) %]
24
    <p>Cannot edit discharge: borrower has issues.</p>
25
[% ELSE %]
26
    [% IF (hasreserves) %]
27
        <p>Borrower has reserves: they will be canceled if the discharge is generated.</p>
28
    [% END %]
29
    [% UNLESS path_missing %]
30
        <form method="post">
31
            <input type="Submit" value="Generate discharge" name="generatedischarge" />
32
            <input type="hidden" value="[% borrowernumber %]" name="borrowernumber" />
33
        </form>
34
    [% END %]
35
[% END %]
36
[% IF (dischargeloop) %]
37
    <br /><br /><h3>Generated discharges</h3>
38
    <ul>
39
    [% FOR discharge IN dischargeloop %]
40
        <li><a href="[% discharge.url %]">[% discharge.filename %]</a></li>
41
    [% END %]
42
    </ul>
43
[% END %]
44
</div>
45
46
47
</div>
48
</div>
49
<div class="yui-b">
50
[% INCLUDE 'circ-menu.inc' %]
51
</div>
52
</div>
53
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc (+3 lines)
Lines 32-37 Link Here
32
  [% IF ( virtualshelves ) %] 
32
  [% IF ( virtualshelves ) %] 
33
  [% IF ( listsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">my lists</a></li>
33
  [% IF ( listsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">my lists</a></li>
34
  [% END %]
34
  [% END %]
35
  [% IF useDischarge %]
36
    [% IF dischargeview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/opac-discharge.pl">Discharge</a></li>
37
  [% END %]
35
38
36
</ul>
39
</ul>
37
</div>
40
</div>
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-discharge.tt (+54 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% IF (LibraryNameTitle) %][% LibraryNameTitle %][% ELSE %]Koha Online[% END %] Catalog
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
<body id="opac-search-history">
6
[% IF OpacNav or loggedinusername %]
7
  <div id="doc3" class="yui-t1">
8
[% ELSE %]
9
  <div id="doc3" class="yui-t7">
10
[% END %]
11
<div id="bd">
12
[% INCLUDE 'masthead.inc' %]
13
14
<div id="yui-main">
15
  <div class="yui-b">
16
    <div class="yui-g">
17
      <div id="discharge" class="container">
18
        <h1>Discharge</h1>
19
        [% IF generated %]
20
          [% IF success %]
21
            <p>Your discharge request has been sent. Your discharge will be available on this page within a few days.</p>
22
          [% ELSE %]
23
            <p>Your discharge request could not be sent. Please retry later or contact an administrator.</p>
24
          [% END %]
25
        [% ELSE %]
26
          <h2>What is a discharge?</h2>
27
          <p>This document certifies that you have returned all borrowed items. It is sometimes asked during a file transfer from a school to another. The discharge is sent by us to your school. You will also find it available on your reader account.</p>
28
          <p><strong>Warning</strong>: This request is only valid if you are in good standing with the library. Once the application is made, you can not borrow library materials.</p>
29
          <a href="/cgi-bin/koha/opac-discharge.pl?generate=1">Ask for a discharge</a>
30
        [% END %]
31
        [% IF dischargeloop %]
32
          <h3>Generated discharges</h3>
33
          <ul>
34
            [% FOR discharge IN dischargeloop %]
35
              <li><a href="[% discharge.url %]">[% discharge.filename %]</a></li>
36
            [% END %]
37
          </ul>
38
        [% END %]
39
      </div>
40
    </div>
41
  </div>
42
</div>
43
44
[% IF ( OpacNav || loggedinusername ) %]
45
  <div class="yui-b">
46
    <div class="container">
47
      [% INCLUDE 'navigation.inc' %]
48
      [% INCLUDE 'usermenu.inc' %]
49
    </div>
50
  </div>
51
[% END %]
52
</div>
53
[% INCLUDE 'opac-bottom.inc' %]
54
(-)a/members/discharge.pl (+173 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2013 BibLibre SARL
4
# This file is part of Koha.
5
#
6
# Koha is free software; you can redistribute it and/or modify it under the
7
# terms of the GNU General Public License as published by the Free Software
8
# Foundation; either version 2 of the License, or (at your option) any later
9
# version.
10
#
11
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
12
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License along
16
# with Koha; if not, write to the Free Software Foundation, Inc.,
17
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
19
=head1 NAME
20
21
discharge.pl
22
23
=head1 DESCRIPTION
24
25
Allows librarian to edit and/or manage borrowers' discharges
26
27
=cut
28
29
use Modern::Perl;
30
31
use CGI;
32
use C4::Auth;
33
use C4::Output;
34
use C4::Members;
35
use C4::Reserves;
36
use C4::Letters;
37
use C4::Discharges;
38
39
use Koha::DateUtils;
40
41
my $input = new CGI;
42
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
43
    template_name   => 'members/discharge.tmpl',
44
    query           => $input,
45
    type            => 'intranet',
46
    authnotrequired => 0,
47
    flagsrequired   => { 'borrowers' => '*' },
48
    debug           => 1,
49
} );
50
51
my $dischargePath    = C4::Context->preference('dischargePath');
52
my $dischargeWebPath = C4::Context->preference('dischargeWebPath');
53
54
my $borrowernumber;
55
my $data;
56
if ( $input->param('borrowernumber') ) {
57
    $borrowernumber = $input->param('borrowernumber');
58
59
    # Getting member data
60
    $data = GetMember( borrowernumber => $borrowernumber );
61
62
    # Getting pending issues
63
    my $issues = GetPendingIssues($borrowernumber);
64
    my $hasissues = scalar(@$issues);
65
66
    # Getting reserves
67
    my @reserves = GetReservesFromBorrowernumber($borrowernumber);
68
    my $hasreserves = scalar(@reserves);
69
70
    # Generating discharge if needed
71
    if ($input->param('generatedischarge')) {
72
        # If borrower has pending reserves, we cancel them
73
        foreach (@reserves) {
74
            CancelReserve($_->{'reservenumber'});
75
        }
76
        $hasreserves = 0;
77
78
        # Debarring member
79
        # Getting librarian's name
80
        my $librarian = GetMember('borrowernumber' => $loggedinuser);
81
        my $librarianname = $librarian->{'firstname'} . " " . $librarian->{'surname'};
82
83
        # Getting today's date
84
        my $date = C4::Dates->new()->output();
85
        # (this is quite ugly, but this is how borrowers seems to be permanently debarred)
86
        # FIXME: Perl strings are not translatable atm, so comment is written in english
87
        C4::Members::DebarMember($borrowernumber, '9999-12-31', "Discharge generated by $librarianname on $date");
88
89
        # Creating message
90
        my $letter = C4::Letters::GetPreparedLetter(
91
            module      => 'members',
92
            letter_code => 'DISCHARGE',
93
            tables      => {
94
                borrowers => $borrowernumber,
95
                branches => $data->{branchcode},
96
            },
97
        );
98
        my $today = output_pref(dt_from_string());
99
        $letter->{'title'}   =~ s/<<today>>/$today/g;
100
        $letter->{'content'} =~ s/<<today>>/$today/g;
101
102
        C4::Letters::EnqueueLetter(
103
            {   letter                 => $letter,
104
                borrowernumber         => $borrowernumber,
105
                message_transport_type => 'print',
106
            }
107
        );
108
109
        # Calling gather_print_notices.pl with borrowernumber and css to create html from letter
110
        # We place the generated html in a per-user directory
111
        # We create the per-user directory if it doesn't exist
112
        mkdir "$dischargePath/$borrowernumber" unless -d "$dischargePath/$borrowernumber";
113
        qx{../misc/cronjobs/gather_print_notices.pl -f discharge -l DISCHARGE -b $borrowernumber $dischargePath/$borrowernumber};
114
115
        # Calling printoverdues.pl in this same user directory
116
        qx{../misc/cronjobs/printoverdues.sh $dischargePath/$borrowernumber};
117
118
        # Error handling:
119
        # Check if we really got our discharge as a pdf file
120
        my $todayiso = output_pref(dt_from_string(), 'iso', 1);
121
        # If we don't, then
122
        unless (-e "$dischargePath/$borrowernumber/discharge-$todayiso.pdf") {
123
            # Show an error message to the librarian
124
            $template->param(error => 1);
125
126
            # Remove the possibly generated html file
127
            unlink "$dischargePath/$borrowernumber/discharge-$todayiso.html";
128
129
            # Remove the unprocessed message from message_queue
130
            removeUnprocessedDischarges($borrowernumber);
131
132
        }
133
134
    }
135
136
    # Getting already generated discharges
137
    my @list = GetDischarges($borrowernumber);
138
    my @loop = map {{ url => $dischargeWebPath . "/" . $borrowernumber . "/" . $_, filename => $_ }} @list;
139
    $template->param("dischargeloop" => \@loop) if (@list);
140
141
142
    $template->param(
143
        borrowernumber    => $borrowernumber,
144
        biblionumber      => $data->{'biblionumber'},
145
        title             => $data->{'title'},
146
        initials          => $data->{'initials'},
147
        surname           => $data->{'surname'},
148
        borrowernumber    => $borrowernumber,
149
        firstname         => $data->{'firstname'},
150
        cardnumber        => $data->{'cardnumber'},
151
        categorycode      => $data->{'categorycode'},
152
        category_type     => $data->{'category_type'},
153
        categoryname      => $data->{'description'},
154
        address           => $data->{'address'},
155
        address2          => $data->{'address2'},
156
        city              => $data->{'city'},
157
        zipcode           => $data->{'zipcode'},
158
        country           => $data->{'country'},
159
        phone             => $data->{'phone'},
160
        email             => $data->{'email'},
161
        branchcode        => $data->{'branchcode'},
162
        hasissues         => $hasissues,
163
        hasreserves       => $hasreserves,
164
    );
165
166
}
167
# Send parameters to template
168
$template->param(
169
    dischargeview => 1,
170
    path_missing  => ( $dischargePath and $dischargeWebPath ) ? 0 : 1,
171
);
172
173
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/misc/cronjobs/gather_print_notices.pl (-8 / +14 lines)
Lines 39-45 use Getopt::Long; Link Here
39
39
40
sub usage {
40
sub usage {
41
    print STDERR <<USAGE;
41
    print STDERR <<USAGE;
42
Usage: $0 OUTPUT_DIRECTORY
42
Usage: $0 [ -b borrowernumber ] [ -l letter_code ] [ -f filename] OUTPUT_DIRECTORY
43
  Will print all waiting print notices to
43
  Will print all waiting print notices to
44
  OUTPUT_DIRECTORY/notices-CURRENT_DATE.html .
44
  OUTPUT_DIRECTORY/notices-CURRENT_DATE.html .
45
45
Lines 48-58 USAGE Link Here
48
    exit $_[0];
48
    exit $_[0];
49
}
49
}
50
50
51
my ( $stylesheet, $help, $split );
51
my ( $stylesheet, $help, $split, $borrowernumber, $letter_code, $filename );
52
52
53
GetOptions(
53
GetOptions(
54
    'h|help'  => \$help,
54
    'h|help'  => \$help,
55
    's|split' => \$split,
55
    's|split' => \$split,
56
    'b:i'     => \$borrowernumber,
57
    'l:s'     => \$letter_code,
58
    'f:s'     => \$filename,
56
) || usage(1);
59
) || usage(1);
57
60
58
usage(0) if ($help);
61
usage(0) if ($help);
Lines 65-72 if ( !$output_directory || !-d $output_directory ) { Link Here
65
    usage(1);
68
    usage(1);
66
}
69
}
67
70
71
my $params = {};
72
$params->{'borrowernumber'} = $borrowernumber if ($borrowernumber);
73
$params->{'letter_code'}    = $letter_code    if ($letter_code);
68
my $today        = C4::Dates->new();
74
my $today        = C4::Dates->new();
69
my @all_messages = @{ GetPrintMessages() };
75
my @all_messages = @{ GetPrintMessages( $params ) };
70
exit unless (@all_messages);
76
exit unless (@all_messages);
71
77
72
my $OUTPUT;
78
my $OUTPUT;
Lines 104-112 if ($split) { Link Here
104
    }
110
    }
105
}
111
}
106
else {
112
else {
107
    open $OUTPUT, '>',
113
    my $fn = $filename || "holdnotices";
108
      File::Spec->catdir( $output_directory,
114
    my $file=File::Spec->catdir( $output_directory, $fn . "-" . $today->output('iso') . ".html");
109
        "holdnotices-" . $today->output('iso') . ".html" );
115
    open my $fh, '>', $file or die "Can't open file $file : $!";
110
116
111
    my $template =
117
    my $template =
112
      C4::Templates::gettemplate( 'batch/print-notices.tmpl', 'intranet',
118
      C4::Templates::gettemplate( 'batch/print-notices.tmpl', 'intranet',
Lines 118-130 else { Link Here
118
        messages   => \@all_messages,
124
        messages   => \@all_messages,
119
    );
125
    );
120
126
121
    print $OUTPUT $template->output;
127
    print $fh $template->output;
122
128
123
    foreach my $message (@all_messages) {
129
    foreach my $message (@all_messages) {
124
        C4::Letters::_set_message_status(
130
        C4::Letters::_set_message_status(
125
            { message_id => $message->{'message_id'}, status => 'sent' } );
131
            { message_id => $message->{'message_id'}, status => 'sent' } );
126
    }
132
    }
127
133
128
    close $OUTPUT;
134
    close $fh;
129
135
130
}
136
}
(-)a/opac/opac-discharge.pl (-1 / +81 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
3
# Copyright 2013 BibLibre SARL
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
use Modern::Perl;
21
22
use C4::Auth qw(:DEFAULT get_session);
23
use CGI;
24
use C4::Context;
25
use C4::Output;
26
use C4::Log;
27
use C4::Debug;
28
use C4::Branch;
29
use C4::Members;
30
use C4::Discharges;
31
use Mail::Sendmail;
32
33
my $cgi = new CGI;
34
35
my $dischargePath    = C4::Context->preference('dischargePath');
36
my $dischargeWebPath = C4::Context->preference('dischargeWebPath');
37
38
# Getting the template and auth
39
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
40
    {   template_name   => "opac-discharge.tmpl",
41
        query           => $cgi,
42
        type            => "opac",
43
        debug           => 1,
44
    }
45
);
46
47
# Getting already generated discharges
48
my @list = GetDischarges($loggedinuser);
49
my @loop = map {{ url => $dischargeWebPath . "/" . $loggedinuser . "/" . $_, filename => $_ }} @list;
50
$template->param("dischargeloop" => \@loop) if (@list);
51
52
my $generate = $cgi->param('generate');
53
# Sending an email to the librarian if user requested a discharge
54
if ($generate) {
55
    my $title = "Discharge request";
56
    my $member = GetMember('borrowernumber' => $loggedinuser);
57
    my $membername = $member->{firstname} . " " . $member->{surname} . " (" . $member->{cardnumber} . ")";
58
    my $content = "Discharge request from $membername";
59
    my $branch = GetBranchDetail($member->{'branchcode'});
60
    my $sender_email_address = GetFirstValidEmailAddress($loggedinuser);
61
    $sender_email_address = $branch->{branchemail} unless ($sender_email_address);
62
63
    # Note : perhaps we should use C4::Messages here?
64
    my %mail    = (
65
          To             => $branch->{branchemail},
66
          From           => $sender_email_address,
67
          Subject        => "Discharge request",
68
          Message        => $content,
69
          'Content-Type' => 'text/plain; charset="utf8"',
70
    );
71
72
    my $result = sendmail(%mail);
73
    $template->param(
74
        success   => $result,
75
        generated => 1,
76
    );
77
}
78
79
$template->param( dischargeview => 1 );
80
81
output_html_with_http_headers $cgi, $cookie, $template->output;

Return to bug 8007