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.
Created attachment 40337 [details] [review] Bug 14324: Set "adultborrower" regardless of guarantor status.
Test plan: 1) Start with an instance of Koha that has borrowers of category type 'A' (Adult) and 'S' (Staff) defined. 2) Search for an adult borrower who has no Guarantees (Children). 3) Navigate to members/moremember.pl -- note that the 'Add Child' button does not appear on the toolbar. 4) Apply the patch 5) Navigate to members/moremember.pl again. The 'Add Child' button should appear. The 'Add Child' button should appear for category type 'A' (Adult) and 'I' (Institution/Organization).
Created attachment 40426 [details] [review] Attachment to Bug 14324 - "Add Child" button missing on moremember.pl Bug 14324: Set "adultborrower" regardless of guarantor status. Signed-off-by: Jason Robb - SEKLS (jrobb@sekls.org)
Barton, Please detail, it seems to work here. The adultborrower flag is set in circ/circulation if the category_type is 'A': 423 $template->param( adultborrower => 1 ) 424 if ( $borrower->{'category_type'} eq 'A' );
Jonathan, The "Add Child" button is not missing in circ/circulation, only in members/moremember.pl. In members/moremember.pl, the adult borrower flag was only being set if the patron had guarantees (i.e. children for parents, professional members for Institutions), and this was causing the 'Add Child' button not to appear on moremember.pl for any adult patrons who did not have children defined.
(In reply to Barton Chittenden from comment #5) > Jonathan, > > The "Add Child" button is not missing in circ/circulation, only in > members/moremember.pl. Oops, sorry about that. I will test again.
Created attachment 40510 [details] [review] Bug 14324: Set "adultborrower" regardless of guarantor status. Signed-off-by: Jason Robb - SEKLS (jrobb@sekls.org) Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Created attachment 40511 [details] [review] Bug 14324: Display "Add Child" for Organisations on circ/circulation.pl On moremember, the button is displayed for Organisations. To be consistent, it should be displayed on the circulation page too. Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Patches pushed to master. Thanks Barton and Jonathan!
Pushed to 3.20.x will be in 3.20.2
Pushed to 3.18.x will be in 3.18.09
Pushed to 3.16.x, will be in 3.16.13
Created attachment 45498 [details] [review] Bug 15324: Do not display 'Waiting holds:" if no holds are waiting Test plan: - Make sure that you have a patron A with waiting holds and a patron B without waiting holds - Go to the checkout page for patron A (Home > Circulation > Checkouts > ...) - At the right, there is a title "Waiting holds:" and a list of holds waiting - Go to the checkout page for patron B => Without this patch "Waiting holds:" is displayed Sign-off on Jonathan's patch Signed-off-by: Marc Véron <veron@veron.ch>
Comment on attachment 45498 [details] [review] Bug 15324: Do not display 'Waiting holds:" if no holds are waiting Sorry, wrong bug number...