From d2abea6cbba46789ee17aeaa5fe73b0cc6b59d9e Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Fri, 27 Apr 2012 16:28:12 +0200 Subject: [PATCH] Bug 7290: More granular permissions for order receiving Add branch to aqorders. Add subpermission acquisition => order_receive_all Users with order_receive_all can receive all orders. Users with only order_receive can receive an order if: - order branch is defined and is the same as the current working branch - order branch is not defined, basket branch is defined and basket branch is the same as the current working branch - order branch and basket branch are not defined Replace tablesorter by datatables in parcel.pl This patch needs patch for bug 7295 (for basket branch) Unit tests are available in t/Acquisition/CanUserReceiveBasket.t --- C4/Acquisition.pm | 71 ++++++++ acqui/addorder.pl | 1 + acqui/finishreceive.pl | 16 +- acqui/neworderempty.pl | 8 +- acqui/orderreceive.pl | 14 +- acqui/parcel.pl | 56 ++---- .../data/mysql/de-DE/mandatory/userpermissions.sql | 1 + .../data/mysql/en/mandatory/userpermissions.sql | 1 + .../data/mysql/es-ES/mandatory/userpermissions.sql | 1 + .../mysql/fr-FR/1-Obligatoire/userpermissions.sql | 1 + .../data/mysql/it-IT/necessari/userpermissions.sql | 1 + installer/data/mysql/kohastructure.sql | 5 +- .../mysql/nb-NO/1-Obligatorisk/userpermissions.sql | 1 + .../data/mysql/pl-PL/mandatory/userpermissions.sql | 1 + .../ru-RU/mandatory/permissions_and_user_flags.sql | 1 + .../uk-UA/mandatory/permissions_and_user_flags.sql | 1 + installer/data/mysql/updatedatabase.pl | 16 ++ .../prog/en/modules/acqui/neworderempty.tt | 19 ++ .../prog/en/modules/acqui/orderreceive.tt | 5 + .../intranet-tmpl/prog/en/modules/acqui/parcel.tt | 191 ++++++-------------- 20 files changed, 220 insertions(+), 191 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 62732a3..ad70d19 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -48,6 +48,7 @@ BEGIN { &GetBasketUsers &ModBasketUsers &CanUserManageBasket + &CanUserReceiveOrder &ModBasketHeader @@ -643,6 +644,76 @@ sub CanUserManageBasket { return 1; } +=head3 CanUserReceiveBasket + + my $bool = CanUserReceiveBasket($borrower, $order[, $userflags]); + my $bool = CanUserReceiveBasket($borrowernumber, $orderno[, $userflags]); + +Check if a borrower can receive a order, according to user permissions, current +working branch and order and basket branches. + +First parameter can be either a borrowernumber or a hashref as returned by +C4::Members::GetMember. + +Second parameter can be either a ordernumber or a hashref as returned by +C4::Acquisition::GetOrder. + +The third parameter is optional. If given, it should be a hashref as returned +by C4::Auth::getuserflags. If not, getuserflags is called. + +If user is authorised to receive order, returns 1. +Otherwise returns 0. + +=cut + +sub CanUserReceiveOrder { + my ($borrower, $order, $userflags) = @_; + + if (!ref $borrower) { + $borrower = C4::Members::GetMember(borrowernumber => $borrower); + } + if (!ref $order) { + $order = GetOrder($order); + } + + return 0 unless ($borrower and $order); + + if (!defined $userflags) { + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare("SELECT flags FROM borrowers WHERE borrowernumber = ?"); + $sth->execute($borrower->{borrowernumber}); + my ($flags) = $sth->fetchrow_array; + $sth->finish; + + $userflags = C4::Auth::getuserflags($flags, $borrower->{userid}, $dbh); + } + + my $branch = C4::Context->userenv->{'branch'}; + + unless ($userflags->{superlibrarian} + || (!ref $userflags->{acquisition} && $userflags->{acquisition}) + || (ref $userflags->{acquisition} && $userflags->{acquisition}->{order_receive_all}) ) + { + if (!ref $userflags->{acquisition} && !$userflags->{acquisition}) { + return 0; + } + if (ref $userflags->{acquisition} && !$userflags->{acquisition}->{order_receive}) { + return 0; + } + if (defined $order->{branch} && $order->{branch} ne $branch) { + return 0; + } + if (!defined $order->{branch}) { + my $basket = GetBasket($order->{basketno}); + if (!$basket || (defined $basket->{branch} && $basket->{branch} ne $branch)) { + return 0; + } + } + } + + return 1; +} + #------------------------------------------------------------# =head3 GetBasketsByBasketgroup diff --git a/acqui/addorder.pl b/acqui/addorder.pl index 279084b..f9ae2cc 100755 --- a/acqui/addorder.pl +++ b/acqui/addorder.pl @@ -153,6 +153,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my $orderinfo = $input->Vars; $orderinfo->{'list_price'} ||= 0; $orderinfo->{'uncertainprice'} ||= 0; +$orderinfo->{branch} = undef if (defined $orderinfo->{branch} and $orderinfo->{branch} eq ''); #my $ordernumber = $input->param('ordernumber'); #my $basketno = $input->param('basketno'); #my $booksellerid = $input->param('booksellerid'); diff --git a/acqui/finishreceive.pl b/acqui/finishreceive.pl index d09a40a..c8cc8b5 100755 --- a/acqui/finishreceive.pl +++ b/acqui/finishreceive.pl @@ -35,7 +35,9 @@ use List::MoreUtils qw/any/; my $input=new CGI; my $flagsrequired = {acquisition => 'order_receive'}; -checkauth($input, 0, $flagsrequired, 'intranet'); +my ($userid, $cookie, undef, $userflags) + = checkauth($input, 0, $flagsrequired, 'intranet'); + my $user=$input->remote_user; my $biblionumber = $input->param('biblionumber'); @@ -56,6 +58,18 @@ my $error_url_str; my $ecost = $input->param('ecost'); my $note = $input->param("note"); +my $borrower = C4::Members::GetMember(userid => $userid); +unless (CanUserReceiveOrder($borrower, $ordernumber, $userflags)) { + my $error = "cannot_receive_order"; + $error_url_str = "&error=$error"; + print $input->redirect( + "/cgi-bin/koha/acqui/parcel.pl?invoice=$invoiceno" + . "&booksellerid=$booksellerid&freight=$freight&gst=$gst" + . "&datereceived=$datereceived$error_url_str" + ); + exit; +} + #need old recievedate if we update the order, parcel.pl only shows the right parcel this way FIXME if ($quantityrec > $origquantityrec ) { # now, add items if applicable diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl index 7dc7cb5..ed652ea 100755 --- a/acqui/neworderempty.pl +++ b/acqui/neworderempty.pl @@ -66,8 +66,8 @@ the item's id in the breeding reservoir =cut -use warnings; -use strict; +use Modern::Perl; + use CGI; use C4::Context; use C4::Input; @@ -239,7 +239,7 @@ foreach my $thisbranch ( sort {$branches->{$a}->{'branchname'} cmp $branches->{$ value => $thisbranch, branchname => $branches->{$thisbranch}->{'branchname'}, ); - $row{'selected'} = 1 if( $thisbranch && $data->{branchcode} && $thisbranch eq $data->{branchcode}) ; + $row{'selected'} = 1 if( $thisbranch && $data->{branch} && $thisbranch eq $data->{branch}) ; push @branchloop, \%row; } $template->param( branchloop => \@branchloop ); @@ -380,7 +380,7 @@ $template->param( listprice => sprintf("%.2f", $data->{'listprice'}||$data->{'price'}||$listprice), total => sprintf("%.2f", ($data->{'ecost'}||0)*($data->{'quantity'}||0) ), ecost => $data->{'ecost'}, - unitprice => sprintf("%.2f", $data->{'unitprice'}), + unitprice => sprintf("%.2f", $data->{'unitprice'} || 0), notes => $data->{'notes'}, publishercode => $data->{'publishercode'}, barcode_subfield => $barcode_subfield, diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl index 2b59698..aaf684a 100755 --- a/acqui/orderreceive.pl +++ b/acqui/orderreceive.pl @@ -103,7 +103,7 @@ my $order = GetOrder($ordernumber); my $date = @$results[0]->{'entrydate'}; -my ( $template, $loggedinuser, $cookie ) = get_template_and_user( +my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user( { template_name => "acqui/orderreceive.tmpl", query => $input, @@ -116,6 +116,18 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( # prepare the form for receiving if ( $count == 1 ) { + unless (CanUserReceiveOrder($loggedinuser, $order, $userflags)) { + $template->param( + cannot_receive_order => 1, + ordernumber => $ordernumber, + invoice => $invoice, + booksellerid => $booksellerid, + name => $bookseller->{name} + ); + output_html_with_http_headers $input, $cookie, $template->output; + exit; + } + if (C4::Context->preference('AcqCreateItem') eq 'receiving') { # Check if ACQ framework exists my $marc = GetMarcStructure(1, 'ACQ'); diff --git a/acqui/parcel.pl b/acqui/parcel.pl index 5d0d164..a69d06b 100755 --- a/acqui/parcel.pl +++ b/acqui/parcel.pl @@ -56,8 +56,8 @@ To filter the results list on this given date. =cut -use strict; -#use warnings; FIXME - Bug 2505 +use Modern::Perl; + use C4::Auth; use C4::Acquisition; use C4::Budgets; @@ -76,7 +76,8 @@ my $bookseller=GetBookSellerFromId($booksellerid); my $invoice=$input->param('invoice') || ''; my $freight=$input->param('freight'); -my $input_gst = ($input->param('gst') eq '' ? undef : $input->param('gst')); +my $input_gst = $input->param('gst'); +$input_gst = (!defined $input_gst or $input_gst eq '') ? undef : $input_gst; my $gst= $input_gst // $bookseller->{gstrate} // C4::Context->preference("gist") // 0; my $datereceived = ($input->param('op') eq 'new') ? C4::Dates->new($input->param('datereceived')) : C4::Dates->new($input->param('datereceived'), 'iso') ; @@ -85,12 +86,8 @@ my $code = $input->param('code'); my @rcv_err = $input->param('error'); my @rcv_err_barcode = $input->param('error_bc'); -my $startfrom=$input->param('startfrom'); -my $resultsperpage = $input->param('resultsperpage'); -$resultsperpage = 20 unless ($resultsperpage); -$startfrom=0 unless ($startfrom); - -if($input->param('format') eq "json"){ +my $format = $input->param('format'); +if ($format and $format eq 'json'){ my ($template, $loggedinuser, $cookie) = get_template_and_user({template_name => "acqui/ajax.tmpl", query => $input, @@ -132,7 +129,7 @@ if($input->param('format') eq "json"){ exit; } -my ($template, $loggedinuser, $cookie) +my ($template, $loggedinuser, $cookie, $userflags) = get_template_and_user({template_name => "acqui/parcel.tmpl", query => $input, type => "intranet", @@ -250,50 +247,20 @@ for (my $i = 0 ; $i < $countpendings ; $i++) { $line{biblios} = $countbiblio - 1; $line{left_subscription} = 1 if scalar @subscriptions >= 1; $line{subscriptions} = scalar @subscriptions; - $line{left_holds} = 1 if $holds >= 1; + $line{left_holds} = ($holds >= 1) ? 1 : 0; $line{left_holds_on_order} = 1 if $line{left_holds}==1 && ($line{items} == 0 || $itemholds ); $line{holds} = $holds; $line{holds_on_order} = $itemholds?$itemholds:$holds if $line{left_holds_on_order}; + $line{can_receive} = CanUserReceiveOrder($loggedinuser, $pendingorders->[$i], $userflags); - push @loop_orders, \%line if ($i >= $startfrom and $i < $startfrom + $resultsperpage); + push @loop_orders, \%line; } $freight = $totalfreight unless $freight; my $count = $countpendings; -if ($count>$resultsperpage){ - my $displaynext=0; - my $displayprev=$startfrom; - if(($count - ($startfrom+$resultsperpage)) > 0 ) { - $displaynext = 1; - } - - my @numbers = (); - for (my $i=1; $i<$count/$resultsperpage+1; $i++) { - my $highlight=0; - ($startfrom/$resultsperpage==($i-1)) && ($highlight=1); - push @numbers, { number => $i, - highlight => $highlight , - startfrom => ($i-1)*$resultsperpage}; - } - - my $from = $startfrom*$resultsperpage+1; - my $to; - if($count < (($startfrom+1)*$resultsperpage)){ - $to = $count; - } else { - $to = (($startfrom+1)*$resultsperpage); - } - $template->param(numbers=>\@numbers, - displaynext=>$displaynext, - displayprev=>$displayprev, - nextstartfrom=>(($startfrom+$resultsperpage<$count)?$startfrom+$resultsperpage:$count), - prevstartfrom=>(($startfrom-$resultsperpage>0)?$startfrom-$resultsperpage:0) - ); -} - -#$totalfreight=$freight; +$tototal //= 0; $tototal = $tototal + $freight; $template->param( @@ -321,7 +288,6 @@ $template->param( totalPquantity => $totalPquantity, totalPqtyrcvd => $totalPqtyrcvd, totalPecost => sprintf("%.2f", $totalPecost), - resultsperpage => $resultsperpage, ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/installer/data/mysql/de-DE/mandatory/userpermissions.sql b/installer/data/mysql/de-DE/mandatory/userpermissions.sql index 13e5f24..16d5aad 100644 --- a/installer/data/mysql/de-DE/mandatory/userpermissions.sql +++ b/installer/data/mysql/de-DE/mandatory/userpermissions.sql @@ -16,6 +16,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (11, 'order_manage_all', 'Manage all orders & baskets'), (11, 'group_manage', 'Bestellgruppen vewalten'), (11, 'order_receive', 'Lieferungen verwalten'), + (11, 'order_receive_all', 'Receive all orders'), (11, 'budget_add_del', 'Konten hinzufügen/ändern, aber bestehende nicht ändern'), (13, 'edit_news', 'Nachrichten für OPAC und Dienstoberfläche verfassen'), (13, 'label_creator', 'Etiketten und Barcodes aus Katalog- und Benutzerdaten erstellen'), diff --git a/installer/data/mysql/en/mandatory/userpermissions.sql b/installer/data/mysql/en/mandatory/userpermissions.sql index c4c87c2..e102eb8 100644 --- a/installer/data/mysql/en/mandatory/userpermissions.sql +++ b/installer/data/mysql/en/mandatory/userpermissions.sql @@ -16,6 +16,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (11, 'order_manage_all', 'Manage all orders & baskets'), (11, 'group_manage', 'Manage orders & basketgroups'), (11, 'order_receive', 'Manage orders & basket'), + (11, 'order_receive_all', 'Receive all orders'), (11, 'budget_add_del', 'Add and delete budgets (but cant modify budgets)'), (13, 'edit_news', 'Write news for the OPAC and staff interfaces'), (13, 'label_creator', 'Create printable labels and barcodes from catalog and patron data'), diff --git a/installer/data/mysql/es-ES/mandatory/userpermissions.sql b/installer/data/mysql/es-ES/mandatory/userpermissions.sql index 62d0ee0..00e0d1c 100644 --- a/installer/data/mysql/es-ES/mandatory/userpermissions.sql +++ b/installer/data/mysql/es-ES/mandatory/userpermissions.sql @@ -16,6 +16,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (11, 'order_manage_all', 'Manage all orders & baskets'), (11, 'group_manage', 'Manage orders & basketgroups'), (11, 'order_receive', 'Manage orders & basket'), + (11, 'order_receive_all', 'Receive all orders'), (11, 'budget_add_del', 'Add and delete budgets (but cant modify budgets)'), (13, 'edit_news', 'Write news for the OPAC and staff interfaces'), (13, 'label_creator', 'Create printable labels and barcodes from catalog and patron data'), diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql b/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql index 24d5219..ee4920f 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql @@ -31,6 +31,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (11, 'order_manage_all', 'Gérer toutes les commandes et panier'), (11, 'group_manage', 'Gérer les commandes et les bons de commande'), (11, 'order_receive', 'Gérer les réceptions'), + (11, 'order_receive_all', 'Gérer toutes les réceptions'), (11, 'budget_add_del', 'Ajouter et supprimer les budgets (mais pas modifier)'), (13, 'manage_csv_profiles', 'Gérer les profils d''export CSV'), (13, 'moderate_tags', 'Modérer les tags des adhérents'), diff --git a/installer/data/mysql/it-IT/necessari/userpermissions.sql b/installer/data/mysql/it-IT/necessari/userpermissions.sql index eb0e90c..8e84bcf 100644 --- a/installer/data/mysql/it-IT/necessari/userpermissions.sql +++ b/installer/data/mysql/it-IT/necessari/userpermissions.sql @@ -18,6 +18,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (11, 'order_manage_all', 'Manage all orders & baskets'), (11, 'group_manage', 'Gestisci ordini e raccoglitori raggruppati'), (11, 'order_receive', 'Gestisci arrivi'), + (11, 'order_receive_all', 'Receive all orders'), (11, 'budget_add_del', 'Aggiungi e cancella budgets (senza modificarli)'), (13, 'edit_news', 'Scrivi le news per l\'OPAC e per l\'interfaccia staff'), (13, 'label_creator', 'Crea etichette da stampare e barcodes dal catalogo e dai dati degli utenti'), diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index de0037a..9544d2e 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2761,12 +2761,15 @@ CREATE TABLE `aqorders` ( `uncertainprice` tinyint(1), `claims_count` int(11) default 0, `claimed_date` date default NULL, + branch varchar(10) default NULL, PRIMARY KEY (`ordernumber`), KEY `basketno` (`basketno`), KEY `biblionumber` (`biblionumber`), KEY `budget_id` (`budget_id`), + KEY branch (branch), CONSTRAINT `aqorders_ibfk_1` FOREIGN KEY (`basketno`) REFERENCES `aqbasket` (`basketno`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `aqorders_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE + CONSTRAINT `aqorders_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE, + CONSTRAINT aqorders_ibfk_3 FOREIGN KEY (branch) REFERENCES branches (branchcode) ON UPDATE CASCADE ON DELETE SET NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql b/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql index f2feece..f680b4d 100644 --- a/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql +++ b/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql @@ -37,6 +37,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (11, 'order_manage_all', 'Manage all orders & baskets'), (11, 'group_manage', 'Administrere bestillinger og kurv-grupper'), (11, 'order_receive', 'Administrere bestillinger og kurver'), + (11, 'order_receive_all', 'Receive all orders'), (11, 'budget_add_del', 'Legge til og slette budsjetter (men ikke endre budsjetter)'), (13, 'edit_news', 'Legge ut nyhter i OPACen og det interne grensesnittet'), (13, 'label_creator', 'Lage etiketter og strekkoder basert på bibliografiske poster og lånerdata'), diff --git a/installer/data/mysql/pl-PL/mandatory/userpermissions.sql b/installer/data/mysql/pl-PL/mandatory/userpermissions.sql index 59b9ab4..77e7277 100644 --- a/installer/data/mysql/pl-PL/mandatory/userpermissions.sql +++ b/installer/data/mysql/pl-PL/mandatory/userpermissions.sql @@ -16,6 +16,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (11, 'order_manage_all', 'Manage all orders & baskets'), (11, 'group_manage', 'Manage orders & basketgroups'), (11, 'order_receive', 'Manage orders & basket'), + (11, 'order_receive_all', 'Receive all orders'), (11, 'budget_add_del', 'Add and delete budgets (but cant modify budgets)'), (13, 'edit_news', 'RTworzeniei publikowanie wiadomości w interfejsie bibliotekarza i OPAC'), (13, 'label_creator', 'Create printable labels and barcodes from catalog and patron data'), diff --git a/installer/data/mysql/ru-RU/mandatory/permissions_and_user_flags.sql b/installer/data/mysql/ru-RU/mandatory/permissions_and_user_flags.sql index 15f8c7b..be4861a 100644 --- a/installer/data/mysql/ru-RU/mandatory/permissions_and_user_flags.sql +++ b/installer/data/mysql/ru-RU/mandatory/permissions_and_user_flags.sql @@ -40,6 +40,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (11, 'order_manage_all', 'Manage all orders & baskets'), (11, 'group_manage', 'Manage orders & basketgroups'), (11, 'order_receive', 'Manage orders & basket'), + (11, 'order_receive_all', 'Receive all orders'), (11, 'budget_add_del', 'Add and delete budgets (but cant modify budgets)'), (13, 'edit_news', 'Написание новостей для электронного каталога и интерфейса библиотекарей'), (13, 'label_creator', 'Создание печатных наклеек и штрихкодов из каталога и с данными о пользователях'), diff --git a/installer/data/mysql/uk-UA/mandatory/permissions_and_user_flags.sql b/installer/data/mysql/uk-UA/mandatory/permissions_and_user_flags.sql index 4b0115a..c933b58 100644 --- a/installer/data/mysql/uk-UA/mandatory/permissions_and_user_flags.sql +++ b/installer/data/mysql/uk-UA/mandatory/permissions_and_user_flags.sql @@ -40,6 +40,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (11, 'order_manage_all', 'Manage all orders & baskets'), (11, 'group_manage', 'Manage orders & basketgroups'), (11, 'order_receive', 'Manage orders & basket'), + (11, 'order_receive_all', 'Receive all orders'), (11, 'budget_add_del', 'Add and delete budgets (but cant modify budgets)'), (13, 'edit_news', 'Написання новин для електронного каталогу та інтерфейсу бібліотекарів'), (13, 'label_creator', 'Створення друкованих наклейок і штрих-кодів з каталогу та з даними про користувачів'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 6edd988..d0035b0 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5245,6 +5245,22 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } +$DBversion = "XXX"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do(" + ALTER TABLE aqorders + ADD COLUMN branch VARCHAR(10) DEFAULT NULL, + ADD CONSTRAINT aqorders_ibfk_3 FOREIGN KEY (branch) + REFERENCES branches (branchcode) ON UPDATE CASCADE ON DELETE SET NULL + "); + $dbh->do(" + INSERT INTO permissions (module_bit, code, description) + VALUES (11, 'order_receive_all', 'Receive all orders') + "); + print "Upgrade to $DBversion done (Add aqorders.branch and permission order_receive_all)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt index 8aec465..4ccd2f9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt @@ -203,6 +203,25 @@ $(document).ready(function()
+ Order details +
    +
  1. + Branch: + +
  2. +
+
+ +
Catalog details [% IF ( biblionumber ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt index 97a7223..5e1f274 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt @@ -54,6 +54,10 @@

Receive items from : [% name %] [% IF ( invoice ) %][[% invoice %]] [% END %] (order #[% ordernumber %])

+ [% IF (cannot_receive_order) %] +

You are not authorised to receive this order.

+ [% ELSE %] + [% IF ( count ) %]
@@ -218,6 +222,7 @@
[% END %] +[% END %][%# IF (cannot_receive_order) %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt index a5d3e1a..22eb9fd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -1,136 +1,54 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Acquisitions › [% IF ( date ) %] Receipt summary for [% name %] [% IF ( invoice ) %]invoice [% invoice %][% END %] on [% formatteddatereceived %][% ELSE %]Receive orders from [% name %][% END %] + [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'greybox.inc' %] - + +[% INCLUDE 'datatables-strings.inc' %] +