Bugzilla – Attachment 5462 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]
Bug 6390: Implement 'see mine/my branches/all baskets'-syspref
Bug-6390-Implement-see-minemy-branchesall-baskets-.patch (text/plain), 3.62 KB, created by
Katrin Fischer
on 2011-09-19 19:29:51 UTC
(
hide
)
Description:
Bug 6390: Implement 'see mine/my branches/all baskets'-syspref
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2011-09-19 19:29:51 UTC
Size:
3.62 KB
patch
obsolete
>From 6e66d16355bbe13a85f7bd978a90c42ca7f58564 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Fri, 5 Aug 2011 10:13:20 +0200 >Subject: [PATCH] Bug 6390: Implement 'see mine/my branches/all baskets'-syspref >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit >Content-Type: text/plain; charset="utf-8" > >Code written by Edgar Fuà <ef@math.uni-bonn.de>, >Mathematisches Institut der Uniersität Bonn > >Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com> >--- > acqui/booksellers.pl | 20 ++++++++++++-------- > admin/systempreferences.pl | 1 + > .../en/modules/admin/preferences/acquisitions.pref | 7 +++++++ > 3 files changed, 20 insertions(+), 8 deletions(-) > >diff --git a/acqui/booksellers.pl b/acqui/booksellers.pl >index cc5c084..4f1195d 100755 >--- a/acqui/booksellers.pl >+++ b/acqui/booksellers.pl >@@ -59,6 +59,7 @@ use CGI; > 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,26 @@ if ( $supplier_count == 1 ) { > ); > } > >-my $uid; >-if ($loggedinuser) { >- $uid = GetMember( borrowernumber => $loggedinuser )->{userid}; >-} >+my $userenv = C4::Context::userenv; >+my $viewbaskets = C4::Context->preference('AcqViewBaskets'); >+ >+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 && >+ ($branchcache{$authorisedby} || ($branchcache{$authorisedby} = GetMember( borrowernumber => $authorisedby )->{branchcode})) eq $userbranch > ) { > for my $date_field (qw( creationdate closedate)) { > if ( $basket->{$date_field} ) { >diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl >index 87ecac4..78d0768 100755 >--- a/admin/systempreferences.pl >+++ b/admin/systempreferences.pl >@@ -76,6 +76,7 @@ my %tabsysprefs; > $tabsysprefs{AcqCreateItem}="Acquisitions"; > $tabsysprefs{OrderPdfFormat}="Acquisitions"; > $tabsysprefs{CurrencyFormat}="Acquisitions"; >+ $tabsysprefs{AcqViewBaskets}="Acquisitions"; > > # Admin > $tabsysprefs{singleBranchMode} = "Admin"; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref >index 43a7ad5..52da32a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref >@@ -16,6 +16,13 @@ Acquisitions: > 1: always ask for confirmation. > 2: do not ask for confirmation. > - >+ - 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: >-- >1.7.4.1
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