Bugzilla – Attachment 4778 Details for
Bug 6390
Basket only visible for librarian who created it
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Implement ``see mine/my branches/all baskets''-syspref
viewbaskets.patch (text/plain), 2.82 KB, created by
Edgar Fuß
on 2011-07-31 13:52:27 UTC
(
hide
)
Description:
Implement ``see mine/my branches/all baskets''-syspref
Filename:
MIME Type:
Creator:
Edgar Fuß
Created:
2011-07-31 13:52:27 UTC
Size:
2.82 KB
patch
obsolete
>--- koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref.orig 2011-07-25 13:29:06.000000000 +0200 >+++ koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref 2011-07-30 18:01:54.000000000 +0200 >@@ -9,6 +9,13 @@ > receiving: receiving an order. > cataloguing: cataloging the record. > - >+ - Allow a user to view baskets created >+ - pref: AcqViewBaskets >+ choices: >+ user: by him only >+ branch: at his branch >+ all: by anyone >+ - > - Display currencies using the following format > - pref: CurrencyFormat > choices: >--- admin/systempreferences.pl.orig 2011-07-27 18:21:34.000000000 +0200 >+++ admin/systempreferences.pl 2011-07-30 17:52:08.000000000 +0200 >@@ -76,6 +76,7 @@ > $tabsysprefs{AcqCreateItem}="Acquisitions"; > $tabsysprefs{OrderPdfFormat}="Acquisitions"; > $tabsysprefs{CurrencyFormat}="Acquisitions"; >+ $tabsysprefs{AcqViewBaskets}="Acquisitions"; > > # Admin > $tabsysprefs{singleBranchMode} = "Admin"; >--- acqui/booksellers.pl.orig 2011-07-27 18:21:34.000000000 +0200 >+++ acqui/booksellers.pl 2011-07-31 15:13:55.000000000 +0200 >@@ -59,6 +59,7 @@ > use C4::Dates qw/format_date/; > use C4::Bookseller qw/ GetBookSellerFromId GetBookSeller /; > use C4::Members qw/GetMember/; >+use C4::Context; > > my $query = CGI->new; > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >@@ -90,23 +91,30 @@ > ); > } > >-my $uid; >-if ($loggedinuser) { >- $uid = GetMember( borrowernumber => $loggedinuser )->{userid}; >-} >+my $userenv = C4::Context::userenv; >+my $viewbaskets = C4::Context->preference('AcqViewBaskets'); >+ >+#my $uid = $userenv->{id}; >+# $loggedinuser == $userenv->{number} >+my $userbranch = $userenv->{branch}; > > #build result page > my $loop_suppliers = []; > >+my %branchcache; >+ > for my $vendor (@suppliers) { > my $baskets = get_vendors_baskets( $vendor->{id} ); > > my $loop_basket = []; > for my $basket ( @{$baskets} ) { >- if (( $basket->{authorisedby} >- && $basket->{authorisedby} eq $loggedinuser >- ) >- || haspermission( $uid, { flagsrequired => { acquisition => q{*} } } ) >+ my $authorisedby = $basket->{authorisedby}; >+ if ($authorisedby && $authorisedby == $loggedinuser >+ || $viewbaskets eq 'all' >+ || $viewbaskets eq 'branch' && $authorisedby && >+# GetMember( borrowernumber => $authorisedby )->{branchcode} eq $userbranch >+ ($branchcache{$authorisedby} || ($branchcache{$authorisedby} = GetMember( borrowernumber => $authorisedby )->{branchcode})) eq $userbranch >+# || haspermission( $uid, { acquisition => q{*} } ) > ) { > for my $date_field (qw( creationdate closedate)) { > if ( $basket->{$date_field} ) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6390
:
4778
|
4782
|
4853
|
5323
|
5324
|
5461
|
5462
|
5463
|
5464
|
5518
|
5802
|
5862
|
5863
|
5935
|
5963
|
5966