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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt (-11 / +17 lines)
Lines 422-440 $(document).ready(function() { calcNewsuggTotal(); }); Link Here
422
422
423
            <a href="#[% suggestion.suggestiontype %]">
423
            <a href="#[% suggestion.suggestiontype %]">
424
            [% IF ( suggestion.suggestiontypelabel ) %]
424
            [% IF ( suggestion.suggestiontypelabel ) %]
425
                [% IF (suggestion.suggestiontypelabel == "Pending") %]Pending
425
                [% IF (displayby == "STATUS") %]
426
                [% ELSIF (suggestion.suggestiontypelabel == "Accepted") %]Accepted
426
                    [% IF (suggestion.suggestiontypelabel == "Pending") %]Pending
427
                [% ELSIF (suggestion.suggestiontypelabel == "Checked") %]Checked
427
                    [% ELSIF (suggestion.suggestiontypelabel == "Accepted") %]Accepted
428
                [% ELSIF (suggestion.suggestiontypelabel == "Rejected") %]Rejected
428
                    [% ELSIF (suggestion.suggestiontypelabel == "Checked") %]Checked
429
                [% ELSIF (suggestion.suggestiontypelabel == "Available") %]Available
429
                    [% ELSIF (suggestion.suggestiontypelabel == "Rejected") %]Rejected
430
                [% ELSIF (suggestion.suggestiontypelabel == "Ordered") %]Ordered
430
                    [% ELSIF (suggestion.suggestiontypelabel == "Available") %]Available
431
                [% ELSE %][% suggestion.suggestiontypelabel %][% END %]
431
                    [% ELSIF (suggestion.suggestiontypelabel == "Ordered") %]Ordered
432
            [% ELSE %]
432
                    [% ELSIF (suggestion.suggestiontypelabel == "Unknown") %]Unknown
433
                [% IF ( suggestion.suggestiontype ) %]
433
                    [% ELSIF ( suggestion.suggestiontype ) %]
434
                    [% KohaAuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.suggestiontype ) %]
434
                        [% KohaAuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.suggestiontype ) %]
435
                    [% ELSE %]
436
                        Unknown
437
                    [% END %]
435
                [% ELSE %]
438
                [% ELSE %]
436
                    No name
439
                    [% IF (suggestion.suggestiontypelabel == "Any") %]Any library
440
                    [% ELSE %][% suggestion.suggestiontypelabel %][% END %]
437
                [% END %]
441
                [% END %]
442
            [% ELSE %]
443
                Unknown
438
            [% END %]
444
            [% END %]
439
            ([% suggestion.suggestions_loop.size %])</a></li>
445
            ([% suggestion.suggestions_loop.size %])</a></li>
440
446
(-)a/suggestion/suggestion.pl (-5 / +11 lines)
Lines 58-68 sub Init{ Link Here
58
58
59
sub GetCriteriumDesc{
59
sub GetCriteriumDesc{
60
    my ($criteriumvalue,$displayby)=@_;
60
    my ($criteriumvalue,$displayby)=@_;
61
    unless ( grep { /$criteriumvalue/ } qw(ASKED ACCEPTED REJECTED CHECKED ORDERED AVAILABLE) ) {
61
    if ($displayby =~ /status/i ) {
62
        if ( grep { /$criteriumvalue/ } qw(ASKED ACCEPTED REJECTED CHECKED ORDERED AVAILABLE) ) {
63
            return ($criteriumvalue eq 'ASKED'?"Pending":ucfirst(lc( $criteriumvalue)))
64
        }
65
        else {
62
        return GetAuthorisedValueByCode('SUGGEST_STATUS', $criteriumvalue ) || $criteriumvalue;
66
        return GetAuthorisedValueByCode('SUGGEST_STATUS', $criteriumvalue ) || $criteriumvalue;
67
        }
68
    }
69
    if ($displayby =~/branchcode/) {
70
        return (GetBranchName($criteriumvalue)) || "Any";
63
    }
71
    }
64
    return ($criteriumvalue eq 'ASKED'?"Pending":ucfirst(lc( $criteriumvalue))) if ($displayby =~/status/i);
65
    return (GetBranchName($criteriumvalue)) if ($displayby =~/branchcode/);
66
    return (GetSupportName($criteriumvalue)) if ($displayby =~/itemtype/);
72
    return (GetSupportName($criteriumvalue)) if ($displayby =~/itemtype/);
67
    if ($displayby =~/suggestedby/||$displayby =~/managedby/||$displayby =~/acceptedby/){
73
    if ($displayby =~/suggestedby/||$displayby =~/managedby/||$displayby =~/acceptedby/){
68
        my $borr=C4::Members::GetMember(borrowernumber=>$criteriumvalue);
74
        my $borr=C4::Members::GetMember(borrowernumber=>$criteriumvalue);
Lines 86-91 my $returnsuggested = $input->param('returnsuggested'); Link Here
86
my $managedby       = $input->param('managedby');
92
my $managedby       = $input->param('managedby');
87
my $displayby       = $input->param('displayby') || '';
93
my $displayby       = $input->param('displayby') || '';
88
my $tabcode         = $input->param('tabcode');
94
my $tabcode         = $input->param('tabcode');
95
my $branchcodesel  = $input->param('branchcode');
89
96
90
# filter informations which are not suggestion related.
97
# filter informations which are not suggestion related.
91
my $suggestion_ref  = $input->Vars;
98
my $suggestion_ref  = $input->Vars;
Lines 209-215 if ($op=~/else/) { Link Here
209
    my $reasonsloop = GetAuthorisedValues("SUGGEST");
216
    my $reasonsloop = GetAuthorisedValues("SUGGEST");
210
    foreach my $criteriumvalue ( @criteria_dv ) {
217
    foreach my $criteriumvalue ( @criteria_dv ) {
211
        # By default, display suggestions from current working branch
218
        # By default, display suggestions from current working branch
212
        unless ( exists $$suggestion_ref{'branchcode'} ) {
219
        unless ( exists $$suggestion_ref{'branchcode'} || $branchcodesel eq "__ANY__" ) {
213
            $$suggestion_ref{'branchcode'} = C4::Context->userenv->{'branch'};
220
            $$suggestion_ref{'branchcode'} = C4::Context->userenv->{'branch'};
214
        }
221
        }
215
        my $definedvalue = defined $$suggestion_ref{$displayby} && $$suggestion_ref{$displayby} ne "";
222
        my $definedvalue = defined $$suggestion_ref{$displayby} && $$suggestion_ref{$displayby} ne "";
216
- 

Return to bug 10519