[Koha-bugs] [Bug 14324] New: "Add Child" button missing on moremember.pl
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Wed Jun 3 19:32:08 CEST 2015
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14324
Bug ID: 14324
Summary: "Add Child" button missing on moremember.pl
Change sponsored?: ---
Product: Koha
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P5 - low
Component: Patrons
Assignee: koha-bugs at lists.koha-community.org
Reporter: barton at bywatersolutions.com
QA Contact: testopia at bugs.koha-community.org
CC: gmcharlt at gmail.com, kyle.m.hall at gmail.com
The code which adds the "Add child" button is in
koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc
at line 151:
149 [% IF ( CAN_user_borrowers ) %]
150 [% IF ( adultborrower AND activeBorrowerRelationship ) %]
151 <a id="addchild" class="btn btn-small"
href="/cgi-bin/koha/members/memberentry.pl?op=add&guarantorid=[%
borrowernumber %]&category_type=C"><i class="icon-plus"></i> Add child</a>
152 [% END %]
153 [% IF ( CAN_user_borrowers ) %]
154 <a id="changepassword" class="btn btn-small"
href="/cgi-bin/koha/members/member-password.pl?member=[% borrowernumber %]"><i
class="icon-lock"></i> Change password</a>
155 [% END %]
156 <a id="duplicate" class="btn btn-small"
href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&borrowernumber=[%
borrowernumber %]&category_type=[% category_type %]"><i
class="icon-copy"></i>Duplicate</a>
157 [% END %]
I added code to dump CAN_user_borrowers, adultborrower and
activeBorrowerRelationship, and found that adultborrower was not set, even for
a borrower whose borrower's category type is 'A'.
'adultborrower' is set in moremember.pl at line 192, but *only if $count
returned by GetGuarantees is not 0*.
172 my ( $count, $guarantees ) = GetGuarantees( $data->{'borrowernumber'} );
173 if ( $count ) {
174 $template->param( isguarantee => 1 );
175
176 # FIXME
177 # It looks like the $i is only being returned to handle walking through
178 # the array, which is probably better done as a foreach loop.
179 #
180 my @guaranteedata;
181 for ( my $i = 0 ; $i < $count ; $i++ ) {
182 push(@guaranteedata,
183 {
184 borrowernumber => $guarantees->[$i]->{'borrowernumber'},
185 cardnumber => $guarantees->[$i]->{'cardnumber'},
186 name => $guarantees->[$i]->{'firstname'} . " "
187 . $guarantees->[$i]->{'surname'}
188 }
189 );
190 }
191 $template->param( guaranteeloop => \@guaranteedata );
192 ( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A'
|| $category_type eq 'I' );
193 }
In other words, you can't add children unless you already have children.
--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
More information about the Koha-bugs
mailing list