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

(-)a/C4/Search.pm (-1 / +1 lines)
Lines 2662-2668 sub GetDistinctValues { Link Here
2662
			my ($table,$column)=split /\./, $fieldname;
2662
			my ($table,$column)=split /\./, $fieldname;
2663
			my $dbh = C4::Context->dbh;
2663
			my $dbh = C4::Context->dbh;
2664
			warn "select DISTINCT($column) as value, count(*) as cnt from $table group by lib order by $column " if $DEBUG;
2664
			warn "select DISTINCT($column) as value, count(*) as cnt from $table group by lib order by $column " if $DEBUG;
2665
			my $sth = $dbh->prepare("select DISTINCT($column) as value, count(*) as cnt from $table ".($string?" where $column like \"$string%\"":"")."group by value order by $column ");
2665
			my $sth = $dbh->prepare("select DISTINCT($column) as value, count(*) as cnt from $table where $column is not null ".($string?" and $column like \"$string%\"":"")." group by value order by $column ");
2666
			$sth->execute;
2666
			$sth->execute;
2667
			my $elements=$sth->fetchall_arrayref({});
2667
			my $elements=$sth->fetchall_arrayref({});
2668
			return $elements;
2668
			return $elements;
(-)a/suggestion/suggestion.pl (-2 / +24 lines)
Lines 56-62 sub GetCriteriumDesc{ Link Here
56
    return ($criteriumvalue eq 'ASKED'?"Pending":ucfirst(lc( $criteriumvalue))) if ($displayby =~/status/i);
56
    return ($criteriumvalue eq 'ASKED'?"Pending":ucfirst(lc( $criteriumvalue))) if ($displayby =~/status/i);
57
    return (GetBranchName($criteriumvalue)) if ($displayby =~/branchcode/);
57
    return (GetBranchName($criteriumvalue)) if ($displayby =~/branchcode/);
58
    return (GetSupportName($criteriumvalue)) if ($displayby =~/itemtype/);
58
    return (GetSupportName($criteriumvalue)) if ($displayby =~/itemtype/);
59
    if ($displayby =~/managedby/||$displayby =~/acceptedby/){
59
    if ( $displayby =~ /managedby/ || $displayby =~ /acceptedby/ || $displayby =~ /suggestedby/) {
60
        my $borr=C4::Members::GetMember(borrowernumber=>$criteriumvalue);
60
        my $borr=C4::Members::GetMember(borrowernumber=>$criteriumvalue);
61
        return "" unless $borr;
61
        return "" unless $borr;
62
        return $$borr{firstname} . ", " . $$borr{surname};
62
        return $$borr{firstname} . ", " . $$borr{surname};
Lines 125-130 elsif ($op=~/edit/) { Link Here
125
    #Edit suggestion  
125
    #Edit suggestion  
126
    $suggestion_ref=&GetSuggestion($$suggestion_ref{'suggestionid'});
126
    $suggestion_ref=&GetSuggestion($$suggestion_ref{'suggestionid'});
127
    Init($suggestion_ref);
127
    Init($suggestion_ref);
128
<<<<<<< HEAD
128
    $op ='save';
129
    $op ='save';
129
}  
130
}  
130
elsif ($op eq "change" ) {
131
elsif ($op eq "change" ) {
Lines 146-151 elsif ($op eq "change" ) { Link Here
146
 	foreach (keys %$suggestion_ref){
147
 	foreach (keys %$suggestion_ref){
147
		delete $$suggestion_ref{$_} unless ($$suggestion_ref{$_});
148
		delete $$suggestion_ref{$_} unless ($$suggestion_ref{$_});
148
	}
149
	}
150
=======
151
    $op = 'save';
152
} elsif ( $op eq "change" ) {
153
    if ( $$suggestion_ref{"STATUS"} ) {
154
        if ( my $tmpstatus = lc( $$suggestion_ref{"STATUS"} ) =~ /ACCEPTED|REJECTED/i ) {
155
            $$suggestion_ref{ lc( $$suggestion_ref{"STATUS"}) . "date" } = C4::Dates->today;
156
            $$suggestion_ref{ lc( $$suggestion_ref{"STATUS"}) . "by" }   = C4::Context->userenv->{number};
157
        }
158
        $$suggestion_ref{"manageddate"} = C4::Dates->today;
159
        $$suggestion_ref{"managedby"}   = C4::Context->userenv->{number};
160
    }
161
    if ( my $reason = $$suggestion_ref{"reason$tabcode"} ) {
162
        if ( $reason eq "other" ) {
163
            $reason = $$suggestion_ref{"other_reason$tabcode"};
164
        }
165
        $$suggestion_ref{'reason'} = $reason;
166
    }
167
    delete $$suggestion_ref{$_} foreach ( "reason$tabcode", "other_reason$tabcode" );
168
    foreach ( keys %$suggestion_ref ) {
169
        delete $$suggestion_ref{$_} unless ( $$suggestion_ref{$_} );
170
    }
171
>>>>>>> (BUG #4811) suggestion.pl: display borrowers name in suggestion information filters (Suggested By, Managed by, Accepted by)
149
    foreach my $suggestionid (@editsuggestions) {
172
    foreach my $suggestionid (@editsuggestions) {
150
        next unless $suggestionid;
173
        next unless $suggestionid;
151
        $$suggestion_ref{'suggestionid'}=$suggestionid;
174
        $$suggestion_ref{'suggestionid'}=$suggestionid;
152
- 

Return to bug 4811