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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-18 / +24 lines)
Lines 914-939 legend:hover { Link Here
914
                                        <li>
914
                                        <li>
915
                                            <label for="categorycode_entry" class="required">Category: </label>
915
                                            <label for="categorycode_entry" class="required">Category: </label>
916
                                            <select id="categorycode_entry" name="categorycode">
916
                                            <select id="categorycode_entry" name="categorycode">
917
                                                [% FOREACH typeloo IN typeloop %]
917
                                                [% FOREACH category_type IN patron_categories.keys %]
918
                                                    [% FOREACH categoryloo IN typeloo.categoryloop %]
918
                                                    [% SWITCH category_type %]
919
                                                        [% IF ( loop.first ) %]
919
                                                    [% CASE 'C' %]
920
                                                            [% IF ( typeloo.typename_C ) %]<optgroup label="Child">[% END %]
920
                                                        <optgroup label="Child">
921
                                                            [% IF ( typeloo.typename_A ) %]<optgroup label="Adult">[% END %]
921
                                                    [% CASE 'A' %]
922
                                                            [% IF ( typeloo.typename_S ) %]<optgroup label="Staff">[% END %]
922
                                                        <optgroup label="Adult">
923
                                                            [% IF ( typeloo.typename_I ) %]<optgroup label="Organization">[% END %]
923
                                                    [% CASE 'S' %]
924
                                                            [% IF ( typeloo.typename_P ) %]<optgroup label="Professional">[% END %]
924
                                                        <optgroup label="Staff">
925
                                                            [% IF ( typeloo.typename_X ) %]<optgroup label="Statistical">[% END %]
925
                                                    [% CASE 'I' %]
926
                                                        [% END %]
926
                                                        <optgroup label="Organization">
927
                                                        [% IF ( categoryloo.categorycodeselected ) %]
927
                                                    [% CASE 'P' %]
928
                                                            <option value="[% categoryloo.categorycode | html %]" selected="selected" data-pwd-length="[% categoryloo.effective_min_password_length | html %]" data-pwd-strong="[% categoryloo.effective_require_strong_password | html %]" data-typename="[% typeloo.typename | html %]">[% categoryloo.categoryname | html %]</option>
928
                                                        <optgroup label="Professional">
929
                                                    [% CASE 'X' %]
930
                                                        <optgroup label="Statistical">
931
                                                    [% CASE %]
932
                                                        <optgroup label="Unknown">
933
                                                    [% END %]
934
                                                    [% FOREACH category IN patron_categories.$category_type %]
935
                                                        [% IF category.categorycode == patron_category.categorycode %]
936
                                                            <option value="[% category.categorycode | html %]" selected="selected" data-pwd-length="[% category.effective_min_password_length | html %]" data-pwd-strong="[% category.effective_require_strong_password | html %]" data-typename="[% category_type | html %]">[% category.description | html %]</option>
929
                                                        [% ELSE %]
937
                                                        [% ELSE %]
930
                                                            <option value="[% categoryloo.categorycode | html %]" data-pwd-length="[% categoryloo.effective_min_password_length | html %]" data-pwd-strong="[% categoryloo.effective_require_strong_password | html %]" data-typename="[% typeloo.typename | html %]">[% categoryloo.categoryname | html %]</option>
938
                                                            <option value="[% category.categorycode | html %]" data-pwd-length="[% category.effective_min_password_length | html %]" data-pwd-strong="[% category.effective_require_strong_password | html %]" data-typename="[% category_type | html %]">[% category.description | html %]</option>
931
                                                        [% END %]
932
                                                        [% IF ( loop.last ) %]
933
                                                            </optgroup>
934
                                                        [% END %]
939
                                                        [% END %]
935
                                                    [% END # /FOREACH categoryloo %]
940
                                                    [% END %]
936
                                                [% END # /FOREACH typeloo %]
941
                                                        </optgroup>
942
                                                [% END %]
937
                                            </select>
943
                                            </select>
938
                                            <span class="required">Required</span>
944
                                            <span class="required">Required</span>
939
                                        </li>
945
                                        </li>
(-)a/members/memberentry.pl (-30 / +16 lines)
Lines 668-704 if(!defined($data{'sex'})){ Link Here
668
##Now all the data to modify a member.
668
##Now all the data to modify a member.
669
669
670
my @typeloop;
670
my @typeloop;
671
my $no_categories = 1;
671
my $categories_limits = { category_type => [qw(C A S P I X) ] };
672
my $no_add;
672
$categories_limits->{canbeguarantee} = 1 if ($guarantor_id);
673
foreach my $category_type (qw(C A S P I X)) {
673
my $patron_categories = Koha::Patron::Categories->search_with_library_limits(
674
    my $categories_limits = { category_type => $category_type };
674
    {
675
    $categories_limits->{canbeguarantee} = 1 if ($guarantor_id);
675
        category_type => [qw(C A S P I X)],
676
    my $patron_categories = Koha::Patron::Categories->search_with_library_limits( $categories_limits, {order_by => ['categorycode']} );
676
        ( $guarantor_id ? ( canbeguarantee => 1 ) : () )
677
    $no_categories = 0 if $patron_categories->count > 0;
677
    },
678
678
    { order_by => ['categorycode'] }
679
    my @categoryloop;
679
);
680
    while ( my $patron_category = $patron_categories->next ) {
680
my $no_categories = ! $patron_categories->count;
681
        push @categoryloop,
681
my $categories = {};
682
          { 'categorycode' => $patron_category->categorycode,
682
foreach my $patron_category ($patron_categories->as_list ) {
683
            'categoryname' => $patron_category->description,
683
    push @{ $categories->{ $patron_category->category_type } }, $patron_category;
684
            'effective_min_password_length' => $patron_category->effective_min_password_length,
685
            'effective_require_strong_password' => $patron_category->effective_require_strong_password,
686
            'categorycodeselected' =>
687
              ( defined($categorycode) && $patron_category->categorycode eq $categorycode ),
688
          };
689
    }
690
    my %typehash;
691
    $typehash{'typename'} = $category_type;
692
    my $typedescription = "typename_" . $typehash{'typename'};
693
    $typehash{'categoryloop'} = \@categoryloop;
694
    push @typeloop,
695
      { 'typename'       => $category_type,
696
        $typedescription => 1,
697
        'categoryloop'   => \@categoryloop
698
      };
699
}
684
}
685
700
$template->param(
686
$template->param(
701
    typeloop      => \@typeloop,
687
    patron_categories => $categories,
702
    no_categories => $no_categories,
688
    no_categories => $no_categories,
703
);
689
);
704
690
Lines 760-765 if (defined ($data{'branchcode'}) and ( $op eq 'modify' || $op eq 'duplicate' || Link Here
760
}
746
}
761
$template->param( userbranch => $userbranch );
747
$template->param( userbranch => $userbranch );
762
748
749
my $no_add;
763
if ( Koha::Libraries->search->count < 1 ){
750
if ( Koha::Libraries->search->count < 1 ){
764
    $no_add = 1;
751
    $no_add = 1;
765
    $template->param(no_branches => 1);
752
    $template->param(no_branches => 1);
766
- 

Return to bug 30874