Lines 135-141
sub SearchSuggestion {
Link Here
|
135 |
if ( C4::Context->preference('IndependentBranches') ) { |
135 |
if ( C4::Context->preference('IndependentBranches') ) { |
136 |
my $userenv = C4::Context->userenv; |
136 |
my $userenv = C4::Context->userenv; |
137 |
if ($userenv) { |
137 |
if ($userenv) { |
138 |
if ( ( $userenv->{flags} % 2 ) != 1 && !$suggestion->{branchcode} ) |
138 |
if ( !C4::Context->IsSuperLibrarian() && !$suggestion->{branchcode} ) |
139 |
{ |
139 |
{ |
140 |
push @sql_params, $$userenv{branch}; |
140 |
push @sql_params, $$userenv{branch}; |
141 |
push @query, q{ |
141 |
push @query, q{ |
Lines 342-348
sub GetSuggestionByStatus {
Link Here
|
342 |
if ( C4::Context->preference("IndependentBranches") || $branchcode ) { |
342 |
if ( C4::Context->preference("IndependentBranches") || $branchcode ) { |
343 |
my $userenv = C4::Context->userenv; |
343 |
my $userenv = C4::Context->userenv; |
344 |
if ($userenv) { |
344 |
if ($userenv) { |
345 |
unless ( $userenv->{flags} % 2 == 1 ) { |
345 |
unless ( C4::Context->IsSuperLibrarian() ) { |
346 |
push @sql_params, $userenv->{branch}; |
346 |
push @sql_params, $userenv->{branch}; |
347 |
$query .= q{ AND (U1.branchcode = ? OR U1.branchcode ='') }; |
347 |
$query .= q{ AND (U1.branchcode = ? OR U1.branchcode ='') }; |
348 |
} |
348 |
} |
Lines 352-358
sub GetSuggestionByStatus {
Link Here
|
352 |
$query .= q{ AND (U1.branchcode = ? OR U1.branchcode ='') }; |
352 |
$query .= q{ AND (U1.branchcode = ? OR U1.branchcode ='') }; |
353 |
} |
353 |
} |
354 |
} |
354 |
} |
355 |
|
355 |
|
356 |
my $sth = $dbh->prepare($query); |
356 |
my $sth = $dbh->prepare($query); |
357 |
$sth->execute(@sql_params); |
357 |
$sth->execute(@sql_params); |
358 |
my $results; |
358 |
my $results; |
Lines 390-396
sub CountSuggestion {
Link Here
|
390 |
my $sth; |
390 |
my $sth; |
391 |
my $userenv = C4::Context->userenv; |
391 |
my $userenv = C4::Context->userenv; |
392 |
if ( C4::Context->preference("IndependentBranches") |
392 |
if ( C4::Context->preference("IndependentBranches") |
393 |
&& $userenv->{flags} % 2 != 1 ) |
393 |
&& !C4::Context->IsSuperLibrarian() ) |
394 |
{ |
394 |
{ |
395 |
my $query = q{ |
395 |
my $query = q{ |
396 |
SELECT count(*) |
396 |
SELECT count(*) |
Lines 436-445
sub NewSuggestion {
Link Here
|
436 |
|
436 |
|
437 |
Modify the suggestion according to the hash passed by ref. |
437 |
Modify the suggestion according to the hash passed by ref. |
438 |
The hash HAS to contain suggestionid |
438 |
The hash HAS to contain suggestionid |
439 |
Data not defined is not updated unless it is a note or sort1 |
439 |
Data not defined is not updated unless it is a note or sort1 |
440 |
Send a mail to notify the user that did the suggestion. |
440 |
Send a mail to notify the user that did the suggestion. |
441 |
|
441 |
|
442 |
Note that there is no function to modify a suggestion. |
442 |
Note that there is no function to modify a suggestion. |
443 |
|
443 |
|
444 |
=cut |
444 |
=cut |
445 |
|
445 |
|
Lines 533-541
sub DelSuggestion {
Link Here
|
533 |
|
533 |
|
534 |
=head2 DelSuggestionsOlderThan |
534 |
=head2 DelSuggestionsOlderThan |
535 |
&DelSuggestionsOlderThan($days) |
535 |
&DelSuggestionsOlderThan($days) |
536 |
|
536 |
|
537 |
Delete all suggestions older than TODAY-$days , that have be accepted or rejected. |
537 |
Delete all suggestions older than TODAY-$days , that have be accepted or rejected. |
538 |
|
538 |
|
539 |
=cut |
539 |
=cut |
540 |
|
540 |
|
541 |
sub DelSuggestionsOlderThan { |
541 |
sub DelSuggestionsOlderThan { |