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

(-)a/circ/add_message.pl (-2 / +2 lines)
Lines 51-55 Koha::Patron::Message->new( Link Here
51
    }
51
    }
52
)->store;
52
)->store;
53
53
54
print $input->redirect(
54
my $url = $input->referer() // "/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber";
55
    "/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
55
print $input->redirect($url);
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/member-add-message.inc (+33 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% USE Branches %]
3
[% USE AuthorisedValues %]
4
5
<form method="post" action="/cgi-bin/koha/circ/add_message.pl" id="message_form" name="message_f">
6
    <fieldset id="borrower_messages" class="brief">
7
        <legend>Leave a message</legend>
8
        <ol>
9
            <li>
10
                <label for="message_type">Add a message for:</label>
11
                <select name="message_type" id="message_type">
12
                    <option value="L">Staff - Internal note</option>
13
                    <option value="B">OPAC - [% firstname %] [% surname %]</option>
14
                </select>
15
            </li>
16
            [% IF ( canned_bor_notes_loop ) %]
17
                <li>
18
                    <label for="type">Predefined notes: </label>
19
                    <select name="type" id="type" onchange="this.form.borrower_message.value=this.options[this.selectedIndex].value;">
20
                        <option value="">Select note</option>
21
                        [% FOREACH canned_bor_notes_loo IN canned_bor_notes_loop %]
22
                            <option value="[% canned_bor_notes_loo.lib %]">[% canned_bor_notes_loo.lib %]</option>
23
                        [% END %]
24
                    </select>
25
                </li>
26
            [% END %]
27
            <li>
28
                <textarea rows="3" cols="60" name="borrower_message" id="borrower_message" ></textarea>
29
            </li>
30
        </ol>
31
        <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
32
        <input type="hidden" name="branchcode" value="[% branch %]" />
33
    </fieldset>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc (+14 lines)
Lines 170-175 function searchToHold(){ Link Here
170
        <a id="searchtohold" class="btn btn-small" href="#"><i class="fa fa-search"></i> Search to hold</a>
170
        <a id="searchtohold" class="btn btn-small" href="#"><i class="fa fa-search"></i> Search to hold</a>
171
    [% END %]
171
    [% END %]
172
172
173
    <a id="addnewmessageLabel" href="#add_message_form" data-toggle="modal" class="btn btn-small"><i class="fa fa-comment-o"></i> Add message</a>
174
173
         <div class="btn-group">
175
         <div class="btn-group">
174
        <button class="btn btn-small dropdown-toggle" data-toggle="dropdown">More <span class="caret"></span></button>
176
        <button class="btn btn-small dropdown-toggle" data-toggle="dropdown">More <span class="caret"></span></button>
175
            <ul class="dropdown-menu">
177
            <ul class="dropdown-menu">
Lines 209-211 function searchToHold(){ Link Here
209
            </ul>
211
            </ul>
210
    </div>
212
    </div>
211
</div>
213
</div>
214
215
<!-- Modal -->
216
<div id="add_message_form" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="addnewmessageLabel" aria-hidden="true">
217
    <div class="modal-body">
218
        [% INCLUDE 'member-add-message.inc' %]
219
    </div>
220
    <div class="modal-footer">
221
        <fieldset class="action">
222
            <input type="submit" value="Save" /> </form><a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
223
        </fieldset>
224
    </div>
225
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-38 / +13 lines)
Lines 45-51 var relatives_borrowernumbers = new Array(); Link Here
45
    relatives_borrowernumbers.push("[% b %]");
45
    relatives_borrowernumbers.push("[% b %]");
46
[% END %]
46
[% END %]
47
47
48
var MSG_ADD_MESSAGE = _("Add a new message");
49
var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
48
var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
50
49
51
columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) %]
50
columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) %]
Lines 158-200 $(document).ready(function() { Link Here
158
[% END %]
157
[% END %]
159
158
160
<!--  INITIAL BLOC : PARAMETERS & BORROWER INFO -->
159
<!--  INITIAL BLOC : PARAMETERS & BORROWER INFO -->
161
<div style="display: none;" id="add_message_form">
162
<form method="post" action="/cgi-bin/koha/circ/add_message.pl" id="message_form" name="message_f">
163
<fieldset id="borrower_messages" class="brief">
164
<legend>Leave a message</legend>
165
	<ol>
166
    <li>
167
            <label for="message_type">Add a message for:</label>
168
          <select name="message_type" id="message_type">
169
            <option value="L">Staff - Internal note</option>
170
            <option value="B">OPAC - [% firstname %] [% surname %]</option>
171
        </select>
172
    </li>
173
    [% IF ( canned_bor_notes_loop ) %]
174
        <li>
175
                <label for="type">Predefined notes: </label>
176
                <select name="type" id="type" onchange="this.form.borrower_message.value=this.options[this.selectedIndex].value;">
177
                    <option value="">Select note</option>
178
                    [% FOREACH canned_bor_notes_loo IN canned_bor_notes_loop %]
179
                    <option value="[% canned_bor_notes_loo.lib %]">[% canned_bor_notes_loo.lib %]</option>
180
                    [% END %]
181
                </select>
182
        </li>
183
    [% END %]
184
    <li>
185
        <textarea rows="3" cols="60" name="borrower_message" id="borrower_message" ></textarea>
186
    </li>
187
	</ol>
188
    <fieldset class="action">
189
        <input type="submit" value="Save" /> <a href="#" class="cancel">Cancel</a>
190
    </fieldset>
191
192
        <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
193
        <input type="hidden" name="branchcode" value="[% branch %]" />
194
</fieldset>
195
</form>
196
</div>
197
198
[% IF ( was_renewed ) %]<div class="dialog message">Patron's account has been renewed until [% expiry | $KohaDates %]</div>[% END %]
160
[% IF ( was_renewed ) %]<div class="dialog message">Patron's account has been renewed until [% expiry | $KohaDates %]</div>[% END %]
199
161
200
[% IF additional_materials %]
162
[% IF additional_materials %]
Lines 855-860 No patron matched <span class="ex">[% message %]</span> Link Here
855
                [% END %]</li>
817
                [% END %]</li>
856
            [% END %]
818
            [% END %]
857
        </ul>
819
        </ul>
820
        <a id="addnewmessageLabel" href="#add_message_form" data-toggle="modal">Add a new message</a>
821
822
          <!-- Modal -->
823
          <div id="add_message_form" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="addnewmessageLabel" aria-hidden="true">
824
              <div class="modal-body">
825
                  [% INCLUDE 'member-add-message.inc' %]
826
              </div>
827
              <div class="modal-footer">
828
                  <fieldset class="action">
829
                      <input type="submit" value="Save" /> </form><a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
830
                  </fieldset>
831
              </div>
832
          </div>
858
    </div>
833
    </div>
859
834
860
</div>
835
</div>
(-)a/members/boraccount.pl (+8 lines)
Lines 33-38 use C4::Branch; Link Here
33
use C4::Accounts;
33
use C4::Accounts;
34
use C4::Members::Attributes qw(GetBorrowerAttributes);
34
use C4::Members::Attributes qw(GetBorrowerAttributes);
35
use Koha::Patron::Images;
35
use Koha::Patron::Images;
36
use C4::Koha;
36
37
37
my $input=new CGI;
38
my $input=new CGI;
38
39
Lines 105-113 if (C4::Context->preference('ExtendedPatronAttributes')) { Link Here
105
    );
106
    );
106
}
107
}
107
108
109
my $branch = C4::Context->userenv->{'branch'};
110
111
# get authorised values with type of BOR_NOTES
112
my $canned_notes = GetAuthorisedValues("BOR_NOTES");
113
108
$template->param(%$data);
114
$template->param(%$data);
109
115
110
$template->param(
116
$template->param(
117
    canned_bor_notes_loop => $canned_notes,
118
    branch              => $branch,
111
    finesview           => 1,
119
    finesview           => 1,
112
    borrowernumber      => $borrowernumber,
120
    borrowernumber      => $borrowernumber,
113
    branchname          => GetBranchName($data->{'branchcode'}),
121
    branchname          => GetBranchName($data->{'branchcode'}),
(-)a/members/files.pl (+8 lines)
Lines 28-33 use C4::Output; Link Here
28
use C4::Members;
28
use C4::Members;
29
use C4::Members::Attributes qw(GetBorrowerAttributes);
29
use C4::Members::Attributes qw(GetBorrowerAttributes);
30
use C4::Debug;
30
use C4::Debug;
31
use C4::Koha;
31
32
32
use Koha::DateUtils;
33
use Koha::DateUtils;
33
use Koha::Patron::Files;
34
use Koha::Patron::Files;
Lines 119-125 else { Link Here
119
    my $patron_image = Koha::Patron::Images->find($data->{borrowernumber});
120
    my $patron_image = Koha::Patron::Images->find($data->{borrowernumber});
120
    $template->param( picture => 1 ) if $patron_image;
121
    $template->param( picture => 1 ) if $patron_image;
121
122
123
    my $branch = C4::Context->userenv->{'branch'};
124
125
    # get authorised values with type of BOR_NOTES
126
    my $canned_notes = GetAuthorisedValues("BOR_NOTES");
127
122
    $template->param(
128
    $template->param(
129
        branch => $branch,
130
        canned_bor_notes_loop => $canned_notes,
123
        files => Koha::Patron::Files->new( borrowernumber => $borrowernumber )
131
        files => Koha::Patron::Files->new( borrowernumber => $borrowernumber )
124
          ->GetFilesInfo(),
132
          ->GetFilesInfo(),
125
133
(-)a/members/mancredit.pl (+8 lines)
Lines 35-40 use C4::Accounts; Link Here
35
use C4::Items;
35
use C4::Items;
36
use C4::Members::Attributes qw(GetBorrowerAttributes);
36
use C4::Members::Attributes qw(GetBorrowerAttributes);
37
use Koha::Patron::Images;
37
use Koha::Patron::Images;
38
use C4::Koha;
38
39
39
my $input=new CGI;
40
my $input=new CGI;
40
my $flagsrequired = { borrowers => 1, updatecharges => 1 };
41
my $flagsrequired = { borrowers => 1, updatecharges => 1 };
Lines 92-100 if ($add){ Link Here
92
        );
93
        );
93
    }
94
    }
94
95
96
    my $branch = C4::Context->userenv->{'branch'};
97
98
    # get authorised values with type of BOR_NOTES
99
    my $canned_notes = GetAuthorisedValues("BOR_NOTES");
100
95
    $template->param(%$data);
101
    $template->param(%$data);
96
102
97
    $template->param(
103
    $template->param(
104
        branch         => $branch,
105
        canned_bor_notes_loop => $canned_notes,
98
        finesview      => 1,
106
        finesview      => 1,
99
        borrowernumber => $borrowernumber,
107
        borrowernumber => $borrowernumber,
100
        categoryname   => $data->{'description'},
108
        categoryname   => $data->{'description'},
(-)a/members/maninvoice.pl (+8 lines)
Lines 34-39 use C4::Items; Link Here
34
use C4::Branch;
34
use C4::Branch;
35
use C4::Members::Attributes qw(GetBorrowerAttributes);
35
use C4::Members::Attributes qw(GetBorrowerAttributes);
36
use Koha::Patron::Images;
36
use Koha::Patron::Images;
37
use C4::Koha;
37
38
38
my $input=new CGI;
39
my $input=new CGI;
39
my $flagsrequired = { borrowers => 1 };
40
my $flagsrequired = { borrowers => 1 };
Lines 118-125 if ($add){ Link Here
118
        );
119
        );
119
    }
120
    }
120
121
122
    my $branch = C4::Context->userenv->{'branch'};
123
124
    # get authorised values with type of BOR_NOTES
125
    my $canned_notes = GetAuthorisedValues("BOR_NOTES");
126
121
    $template->param(%$data);
127
    $template->param(%$data);
122
    $template->param(
128
    $template->param(
129
        canned_bor_notes_loop => $canned_notes,
130
        branch         => $branch,
123
        finesview      => 1,
131
        finesview      => 1,
124
        borrowernumber => $borrowernumber,
132
        borrowernumber => $borrowernumber,
125
        categoryname   => $data->{'description'},
133
        categoryname   => $data->{'description'},
(-)a/members/member-flags.pl (+8 lines)
Lines 18-23 use C4::Members::Attributes qw(GetBorrowerAttributes); Link Here
18
18
19
use C4::Output;
19
use C4::Output;
20
use Koha::Patron::Images;
20
use Koha::Patron::Images;
21
use C4::Koha;
21
22
22
my $input = new CGI;
23
my $input = new CGI;
23
24
Lines 169-175 if (C4::Context->preference('ExtendedPatronAttributes')) { Link Here
169
    );
170
    );
170
}
171
}
171
172
173
my $branch = C4::Context->userenv->{'branch'};
174
175
# get authorised values with type of BOR_NOTES
176
my $canned_notes = GetAuthorisedValues("BOR_NOTES");
177
172
$template->param(
178
$template->param(
179
    branch => $branch,
180
    canned_bor_notes_loop => $canned_notes,
173
		borrowernumber => $bor->{'borrowernumber'},
181
		borrowernumber => $bor->{'borrowernumber'},
174
    cardnumber => $bor->{'cardnumber'},
182
    cardnumber => $bor->{'cardnumber'},
175
		surname => $bor->{'surname'},
183
		surname => $bor->{'surname'},
(-)a/members/member-password.pl (+8 lines)
Lines 17-22 use C4::Circulation; Link Here
17
use CGI qw ( -utf8 );
17
use CGI qw ( -utf8 );
18
use C4::Members::Attributes qw(GetBorrowerAttributes);
18
use C4::Members::Attributes qw(GetBorrowerAttributes);
19
use Koha::Patron::Images;
19
use Koha::Patron::Images;
20
use C4::Koha;
20
21
21
use Digest::MD5 qw(md5_base64);
22
use Digest::MD5 qw(md5_base64);
22
23
Lines 112-118 if ( C4::Context->preference('ExtendedPatronAttributes') ) { Link Here
112
    );
113
    );
113
}
114
}
114
115
116
my $branch = C4::Context->userenv->{'branch'};
117
118
# get authorised values with type of BOR_NOTES
119
my $canned_notes = GetAuthorisedValues("BOR_NOTES");
120
115
$template->param(
121
$template->param(
122
    branch                     => $branch,
123
    canned_bor_notes_loop      => $canned_notes,
116
    othernames                 => $bor->{'othernames'},
124
    othernames                 => $bor->{'othernames'},
117
    surname                    => $bor->{'surname'},
125
    surname                    => $bor->{'surname'},
118
    firstname                  => $bor->{'firstname'},
126
    firstname                  => $bor->{'firstname'},
(-)a/members/moremember.pl (+5 lines)
Lines 310-318 if (C4::Context->preference('EnhancedMessagingPreferences')) { Link Here
310
    $template->param(TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification"));
310
    $template->param(TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification"));
311
}
311
}
312
312
313
# get authorised values with type of BOR_NOTES
314
315
my $canned_notes = GetAuthorisedValues("BOR_NOTES");
316
313
# in template <TMPL_IF name="I"> => instutitional (A for Adult, C for children) 
317
# in template <TMPL_IF name="I"> => instutitional (A for Adult, C for children) 
314
$template->param( $data->{'categorycode'} => 1 ); 
318
$template->param( $data->{'categorycode'} => 1 ); 
315
$template->param(
319
$template->param(
320
    canned_bor_notes_loop => $canned_notes,
316
    detailview => 1,
321
    detailview => 1,
317
    borrowernumber  => $borrowernumber,
322
    borrowernumber  => $borrowernumber,
318
    othernames      => $data->{'othernames'},
323
    othernames      => $data->{'othernames'},
(-)a/members/notices.pl (+8 lines)
Lines 29-34 use C4::Branch; Link Here
29
use C4::Letters;
29
use C4::Letters;
30
use C4::Members::Attributes qw(GetBorrowerAttributes);
30
use C4::Members::Attributes qw(GetBorrowerAttributes);
31
use Koha::Patron::Images;
31
use Koha::Patron::Images;
32
use C4::Koha;
32
33
33
my $input=new CGI;
34
my $input=new CGI;
34
35
Lines 73-81 if (C4::Context->preference('ExtendedPatronAttributes')) { Link Here
73
    );
74
    );
74
}
75
}
75
76
77
my $branch = C4::Context->userenv->{'branch'};
78
79
# get authorised values with type of BOR_NOTES
80
my $canned_notes = GetAuthorisedValues("BOR_NOTES");
81
76
$template->param(%$borrower);
82
$template->param(%$borrower);
77
83
78
$template->param(
84
$template->param(
85
    canned_bor_notes_loop => $canned_notes,
86
    branch             => $branch,
79
    QUEUED_MESSAGES    => $queued_messages,
87
    QUEUED_MESSAGES    => $queued_messages,
80
    borrowernumber     => $borrowernumber,
88
    borrowernumber     => $borrowernumber,
81
    sentnotices        => 1,
89
    sentnotices        => 1,
(-)a/members/pay.pl (+6 lines)
Lines 103-109 for (@names) { Link Here
103
    }
103
    }
104
}
104
}
105
105
106
# get authorised values with type of BOR_NOTES
107
108
my $canned_notes = GetAuthorisedValues("BOR_NOTES");
109
106
$template->param(
110
$template->param(
111
    branch => $branch,
112
    canned_bor_notes_loop => $canned_notes,
107
    finesview => 1,
113
    finesview => 1,
108
    activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
114
    activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
109
    RoutingSerials => C4::Context->preference('RoutingSerials'),
115
    RoutingSerials => C4::Context->preference('RoutingSerials'),
(-)a/members/paycollect.pl (+5 lines)
Lines 143-151 if ( $total_paid and $total_paid ne '0.00' ) { Link Here
143
143
144
borrower_add_additional_fields($borrower, $template);
144
borrower_add_additional_fields($borrower, $template);
145
145
146
# get authorised values with type of BOR_NOTES
147
my $canned_notes = GetAuthorisedValues("BOR_NOTES");
148
146
$template->param(%$borrower);
149
$template->param(%$borrower);
147
150
148
$template->param(
151
$template->param(
152
    canned_bor_notes_loop => $canned_notes,
153
    branch        => $branch,
149
    borrowernumber => $borrowernumber,    # some templates require global
154
    borrowernumber => $borrowernumber,    # some templates require global
150
    borrower      => $borrower,
155
    borrower      => $borrower,
151
    total         => $total_due,
156
    total         => $total_due,
(-)a/members/readingrec.pl (+7 lines)
Lines 33-38 use List::MoreUtils qw/any uniq/; Link Here
33
use Koha::DateUtils;
33
use Koha::DateUtils;
34
use C4::Members::Attributes qw(GetBorrowerAttributes);
34
use C4::Members::Attributes qw(GetBorrowerAttributes);
35
use Koha::Patron::Images;
35
use Koha::Patron::Images;
36
use C4::Koha;
36
37
37
my $input = CGI->new;
38
my $input = CGI->new;
38
39
Lines 119-129 if (C4::Context->preference('ExtendedPatronAttributes')) { Link Here
119
    );
120
    );
120
}
121
}
121
122
123
my $branch = C4::Context->userenv->{'branch'};
124
125
# get authorised values with type of BOR_NOTES
126
my $canned_notes = GetAuthorisedValues("BOR_NOTES");
122
127
123
$template->param(%$data);
128
$template->param(%$data);
124
129
125
$template->param(
130
$template->param(
131
    canned_bor_notes_loop => $canned_notes,
126
    readingrecordview => 1,
132
    readingrecordview => 1,
133
    branch            => $branch,
127
    borrowernumber    => $borrowernumber,
134
    borrowernumber    => $borrowernumber,
128
    privacy           => $data->{'privacy'},
135
    privacy           => $data->{'privacy'},
129
    categoryname      => $data->{description},
136
    categoryname      => $data->{description},
(-)a/members/routing-lists.pl (+4 lines)
Lines 29-34 use C4::Context; Link Here
29
use C4::Serials;
29
use C4::Serials;
30
use Koha::Patron::Images;
30
use Koha::Patron::Images;
31
use CGI::Session;
31
use CGI::Session;
32
use C4::Koha;
32
33
33
my $query = new CGI;
34
my $query = new CGI;
34
35
Lines 101-110 if ($borrowernumber) { Link Here
101
102
102
##################################################################################
103
##################################################################################
103
104
105
# get authorised values with type of BOR_NOTES
106
my $canned_notes = GetAuthorisedValues("BOR_NOTES");
104
107
105
$template->param(%$borrower);
108
$template->param(%$borrower);
106
109
107
$template->param(
110
$template->param(
111
    canned_bor_notes_loop => $canned_notes,
108
    findborrower      => $findborrower,
112
    findborrower      => $findborrower,
109
    borrower          => $borrower,
113
    borrower          => $borrower,
110
    borrowernumber    => $borrowernumber,
114
    borrowernumber    => $borrowernumber,
(-)a/members/statistics.pl (-1 / +8 lines)
Lines 33-38 use C4::Members::Statistics; Link Here
33
use C4::Members::Attributes qw(GetBorrowerAttributes);
33
use C4::Members::Attributes qw(GetBorrowerAttributes);
34
use C4::Output;
34
use C4::Output;
35
use Koha::Patron::Images;
35
use Koha::Patron::Images;
36
use C4::Koha;
36
37
37
my $input = new CGI;
38
my $input = new CGI;
38
39
Lines 97-105 if (C4::Context->preference('ExtendedPatronAttributes')) { Link Here
97
my $patron_image = Koha::Patron::Images->find($borrower->{borrowernumber});
98
my $patron_image = Koha::Patron::Images->find($borrower->{borrowernumber});
98
$template->param( picture => 1 ) if $patron_image;
99
$template->param( picture => 1 ) if $patron_image;
99
100
101
my $branch = C4::Context->userenv->{'branch'};
102
103
# get authorised values with type of BOR_NOTES
104
my $canned_notes = GetAuthorisedValues("BOR_NOTES");
105
100
$template->param(%$borrower);
106
$template->param(%$borrower);
101
107
102
$template->param(
108
$template->param(
109
    canned_bor_notes_loop => $canned_notes,
110
    branch             => $branch,
103
    statisticsview     => 1,
111
    statisticsview     => 1,
104
    datas              => $datas,
112
    datas              => $datas,
105
    column_names       => \@statistic_column_names,
113
    column_names       => \@statistic_column_names,
106
- 

Return to bug 3669