Bug 6116: Adding a child patron
When adding a patron who is a child, the default library is not set when defining a guarantor, this patch corrects the problem.
More, for children with no guarantors, the default branch is the editing branch.
BibLibre MT5795
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
(cherry picked from commit 36f526a9a8)
Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
This commit is contained in:
parent
67163e1856
commit
0873aa1255
|
|
@ -6,7 +6,7 @@
|
|||
</style>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
function fillguarantor(id, surname, firstname, streetnumber, address, address2, city, state, zipcode, country) {
|
||||
function fillguarantor(id, surname, firstname, streetnumber, address, address2, city, state, zipcode, country, branchcode) {
|
||||
var $ = window.opener.$;
|
||||
var form = $('#entryform').get(0);
|
||||
|
||||
|
|
@ -35,6 +35,7 @@
|
|||
form.state.value = state;
|
||||
form.zipcode.value = zipcode;
|
||||
form.country.value = country;
|
||||
form.branchcode.value = branchcode;
|
||||
|
||||
form.guarantorsearch.value = 'Change';
|
||||
self.close();
|
||||
|
|
@ -79,7 +80,7 @@
|
|||
<td><p>[% resultsloo.address %] [% resultsloo.address2 %] [% resultsloo.city %] [% resultsloo.state %] [% resultsloo.zipcode %] [% resultsloo.country %]</p></td>
|
||||
<td>
|
||||
<form action="">
|
||||
<input type="button" onclick="fillguarantor('[% resultsloo.borrowernumber %]', '[% resultsloo.surname |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]', '[% resultsloo.firstname |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]', '[% resultsloo.streetnumber |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]', '[% resultsloo.address |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]','[% resultsloo.address2 |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]', '[% resultsloo.city |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]', '[% resultsloo.state |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]','[% resultsloo.zipcode |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]','[% resultsloo.country |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]'); return false;" value="Select"/>
|
||||
<input type="button" onclick="fillguarantor('[% resultsloo.borrowernumber %]', '[% resultsloo.surname |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]', '[% resultsloo.firstname |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]', '[% resultsloo.streetnumber |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]', '[% resultsloo.address |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]','[% resultsloo.address2 |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]', '[% resultsloo.city |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]', '[% resultsloo.state |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]','[% resultsloo.zipcode |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]','[% resultsloo.country |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]','[% resultsloo.branchcode |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]'); return false;" value="Select"/>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -379,7 +379,7 @@ if ($nok or !$nodouble){
|
|||
}
|
||||
if (C4::Context->preference("IndependantBranches")) {
|
||||
my $userenv = C4::Context->userenv;
|
||||
if ($userenv->{flags} % 2 != 1 && $data{branchcode}){
|
||||
if ($userenv->{flags} % 2 != 1 && $data{'branchcode'}){
|
||||
unless ($userenv->{branch} eq $data{'branchcode'}){
|
||||
print $input->redirect("/cgi-bin/koha/members/members-home.pl");
|
||||
exit;
|
||||
|
|
@ -497,7 +497,7 @@ my $borrotitlepopup = CGI::popup_menu(-name=>'title',
|
|||
-default=>$default_borrowertitle
|
||||
);
|
||||
|
||||
my @relationships = split /,|\|/, C4::Context->preference('BorrowerRelationship');
|
||||
my @relationships = split /,|\|/, C4::Context->preference('borrowerRelationship');
|
||||
my @relshipdata;
|
||||
while (@relationships) {
|
||||
my $relship = shift @relationships || '';
|
||||
|
|
@ -553,7 +553,9 @@ if(scalar(@select_branch) > 0){
|
|||
# --------------------------------------------------------------------------------------------------------
|
||||
#in modify mod :default value from $CGIbranch comes from borrowers table
|
||||
#in add mod: default value come from branches table (ip correspendence)
|
||||
$default=$data{'branchcode'} if ($op eq 'modify' || ($op eq 'add' && $category_type eq 'C' && $data{'branchcode'}));
|
||||
if (defined ($data{'branchcode'}) and ( $op eq 'modify' || ( $op eq 'add' && $category_type eq 'C' ) )) {
|
||||
$default = $data{'branchcode'};
|
||||
}
|
||||
$CGIbranch = CGI::scrolling_list(-id => 'branchcode',
|
||||
-name => 'branchcode',
|
||||
-values => \@select_branch,
|
||||
|
|
|
|||
Loading…
Reference in New Issue