This item is part of a Rotating Collection and needs to be Transferred to [% collectionBranch %]
+ This item is part of a rotating collection and needs to be transferred to [% collectionBranch %]
[% END %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/addItems.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/addItems.tt
@@ -1,6 +1,13 @@
[% INCLUDE 'doc-head-open.inc' %]
[% IF ( collectionsLoop ) %]
+
Title |
Description |
Holding library |
- |
- |
+ |
+ |
+
+
[% FOREACH collectionsLoo IN collectionsLoop %]
[% collectionsLoo.colTitle %] |
@@ -60,6 +63,7 @@
Delete |
[% END %]
+
[% ELSE %]
There are no collections currently defined.
@@ -99,7 +103,7 @@
- [% IF (editColDescription ) %]
+ [% IF (editColDescription ) %]
[% ELSE %][% END %]
|
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt
@@ -142,12 +142,10 @@
Enter a barcode to generate a printable spine label. For use with dedicated label printers
[% END %]
-
[% IF ( CAN_user_tools_marc_modification_templates ) %]
MARC modification templates
--- a/rotating_collections/addItems.pl
+++ a/rotating_collections/addItems.pl
@@ -16,9 +16,7 @@
# Suite 330, Boston, MA 02111-1307 USA
#
-use strict;
-#use warnings; FIXME - Bug 2505
-require Exporter;
+use Modern::Perl;
use C4::Output;
use C4::Auth;
@@ -29,73 +27,83 @@ use C4::Items;
use CGI;
my $query = new CGI;
-my ($template, $loggedinuser, $cookie)
- = get_template_and_user({template_name => "rotating_collections/addItems.tt",
- query => $query,
- type => "intranet",
- authnotrequired => 0,
- flagsrequired => { tools => 'rotating_collections' },
- debug => 1,
- });
-if ( $query->param('action') eq 'addItem' ) {
- ## Add the given item to the collection
- my $colId = $query->param('colId');
- my $barcode = $query->param('barcode');
- my $removeItem = $query->param('removeItem');
- my $itemnumber = GetItemnumberFromBarcode( $barcode );
-
- my ( $success, $errorCode, $errorMessage );
-
- if ( ! $removeItem ) {
- ( $success, $errorCode, $errorMessage ) = AddItemToCollection( $colId, $itemnumber );
-
- $template->param(
- previousActionAdd => 1,
- addedBarcode => $barcode,
- );
-
- if ( $success ) {
- $template->param( addSuccess => 1 );
- } else {
- $template->param( addFailure => 1 );
- $template->param( failureMessage => $errorMessage );
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ {
+ template_name => "rotating_collections/addItems.tmpl",
+ query => $query,
+ type => "intranet",
+ authnotrequired => 0,
+ flagsrequired => { tools => 'rotating_collections' },
+ debug => 1,
}
- } else {
- ## Remove the given item from the collection
- ( $success, $errorCode, $errorMessage ) = RemoveItemFromCollection( $colId, $itemnumber );
-
- $template->param(
- previousActionRemove => 1,
- removedBarcode => $barcode,
- removeChecked => 1,
- );
-
- if ( $success ) {
- $template->param( removeSuccess => 1 );
- } else {
- $template->param( removeFailure => 1 );
- $template->param( failureMessage => $errorMessage );
+);
+
+if ( $query->param('action') eq 'addItem' ) {
+ ## Add the given item to the collection
+ my $colId = $query->param('colId');
+ my $barcode = $query->param('barcode');
+ my $removeItem = $query->param('removeItem');
+ my $itemnumber = GetItemnumberFromBarcode($barcode);
+
+ my ( $success, $errorCode, $errorMessage );
+
+ if ( !$removeItem ) {
+ ( $success, $errorCode, $errorMessage ) =
+ AddItemToCollection( $colId, $itemnumber );
+
+ $template->param(
+ previousActionAdd => 1,
+ addedBarcode => $barcode,
+ );
+
+ if ($success) {
+ $template->param( addSuccess => 1 );
+ }
+ else {
+ $template->param( addFailure => 1 );
+ $template->param( failureMessage => $errorMessage );
+ }
}
+ else {
+ ## Remove the given item from the collection
+ ( $success, $errorCode, $errorMessage ) =
+ RemoveItemFromCollection( $colId, $itemnumber );
+
+ $template->param(
+ previousActionRemove => 1,
+ removedBarcode => $barcode,
+ removeChecked => 1,
+ );
+
+ if ($success) {
+ $template->param( removeSuccess => 1 );
+ }
+ else {
+ $template->param( removeFailure => 1 );
+ $template->param( failureMessage => $errorMessage );
+ }
- }
+ }
}
-my ( $colId, $colTitle, $colDescription, $colBranchcode ) = GetCollection( $query->param('colId') );
-my $collectionItems = GetItemsInCollection( $colId );
-if ( $collectionItems ) {
- $template->param( collectionItemsLoop => $collectionItems );
+my ( $colId, $colTitle, $colDescription, $colBranchcode ) =
+ GetCollection( $query->param('colId') );
+my $collectionItems = GetItemsInCollection($colId);
+if ($collectionItems) {
+ $template->param( collectionItemsLoop => $collectionItems );
}
$template->param(
- intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
- intranetstylesheet => C4::Context->preference("intranetstylesheet"),
- IntranetNav => C4::Context->preference("IntranetNav"),
-
- colId => $colId,
- colTitle => $colTitle,
- colDescription => $colDescription,
- colBranchcode => $colBranchcode,
- );
+ intranetcolorstylesheet =>
+ C4::Context->preference("intranetcolorstylesheet"),
+ intranetstylesheet => C4::Context->preference("intranetstylesheet"),
+ IntranetNav => C4::Context->preference("IntranetNav"),
+
+ colId => $colId,
+ colTitle => $colTitle,
+ colDescription => $colDescription,
+ colBranchcode => $colBranchcode,
+);
output_html_with_http_headers $query, $cookie, $template->output;
--- a/rotating_collections/editCollections.pl
+++ a/rotating_collections/editCollections.pl
@@ -15,9 +15,8 @@
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
#
-use strict;
-#use warnings; FIXME - Bug 2505
-require Exporter;
+
+use Modern::Perl;
use CGI;
@@ -28,92 +27,100 @@ use C4::Context;
use C4::RotatingCollections;
my $query = new CGI;
-my ($template, $loggedinuser, $cookie)
- = get_template_and_user({template_name => "rotating_collections/editCollections.tt",
- query => $query,
- type => "intranet",
- authnotrequired => 0,
- flagsrequired => { tools => 'rotating_collections' },
- debug => 1,
- });
+
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ {
+ template_name => "rotating_collections/editCollections.tmpl",
+ query => $query,
+ type => "intranet",
+ authnotrequired => 0,
+ flagsrequired => { tools => 'rotating_collections' },
+ debug => 1,
+ }
+);
# Create new Collection
if ( $query->param('action') eq 'create' ) {
- my $title = $query->param('title');
- my $description = $query->param('description');
-
- my ( $createdSuccessfully, $errorCode, $errorMessage ) = CreateCollection( $title, $description );
-
- $template->param(
- previousActionCreate => 1,
- createdTitle => $title,
- );
-
- if ( $createdSuccessfully ) {
- $template->param( createSuccess => 1 );
- } else {
- $template->param( createFailure => 1 );
- $template->param( failureMessage => $errorMessage );
- }
+ my $title = $query->param('title');
+ my $description = $query->param('description');
+
+ my ( $createdSuccessfully, $errorCode, $errorMessage ) =
+ CreateCollection( $title, $description );
+
+ $template->param(
+ previousActionCreate => 1,
+ createdTitle => $title,
+ );
+
+ if ($createdSuccessfully) {
+ $template->param( createSuccess => 1 );
+ }
+ else {
+ $template->param( createFailure => 1 );
+ $template->param( failureMessage => $errorMessage );
+ }
}
## Delete a club or service
elsif ( $query->param('action') eq 'delete' ) {
- my $colId = $query->param('colId');
- my ( $success, $errorCode, $errorMessage ) = DeleteCollection( $colId );
-
- $template->param( previousActionDelete => 1 );
- if ( $success ) {
- $template->param( deleteSuccess => 1 );
- } else {
- $template->param( deleteFailure => 1 );
- $template->param( failureMessage => $errorMessage );
- }
+ my $colId = $query->param('colId');
+ my ( $success, $errorCode, $errorMessage ) = DeleteCollection($colId);
+
+ $template->param( previousActionDelete => 1 );
+ if ($success) {
+ $template->param( deleteSuccess => 1 );
+ }
+ else {
+ $template->param( deleteFailure => 1 );
+ $template->param( failureMessage => $errorMessage );
+ }
}
## Edit a club or service: grab data, put in form.
elsif ( $query->param('action') eq 'edit' ) {
- my $colId = $query->param('colId');
- my ( $colId, $colTitle, $colDesc, $colBranchcode ) = GetCollection( $colId );
-
- $template->param(
- previousActionEdit => 1,
- editColId => $colId,
- editColTitle => $colTitle,
- editColDescription => $colDesc,
- );
+ my $colId = $query->param('colId');
+ my ( $colId, $colTitle, $colDesc, $colBranchcode ) = GetCollection($colId);
+
+ $template->param(
+ previousActionEdit => 1,
+ editColId => $colId,
+ editColTitle => $colTitle,
+ editColDescription => $colDesc,
+ );
}
# Update a Club or Service
elsif ( $query->param('action') eq 'update' ) {
- my $colId = $query->param('colId');
- my $title = $query->param('title');
- my $description = $query->param('description');
-
- my ( $createdSuccessfully, $errorCode, $errorMessage )
- = UpdateCollection( $colId, $title, $description );
-
- $template->param(
- previousActionUpdate => 1,
- updatedTitle => $title,
- );
-
- if ( $createdSuccessfully ) {
- $template->param( updateSuccess => 1 );
- } else {
- $template->param( updateFailure => 1 );
- $template->param( failureMessage => $errorMessage );
- }
+ my $colId = $query->param('colId');
+ my $title = $query->param('title');
+ my $description = $query->param('description');
+
+ my ( $createdSuccessfully, $errorCode, $errorMessage ) =
+ UpdateCollection( $colId, $title, $description );
+
+ $template->param(
+ previousActionUpdate => 1,
+ updatedTitle => $title,
+ );
+
+ if ($createdSuccessfully) {
+ $template->param( updateSuccess => 1 );
+ }
+ else {
+ $template->param( updateFailure => 1 );
+ $template->param( failureMessage => $errorMessage );
+ }
}
-
+
my $collections = GetCollections();
$template->param(
- intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
- intranetstylesheet => C4::Context->preference("intranetstylesheet"),
- IntranetNav => C4::Context->preference("IntranetNav"),
-
- collectionsLoop => $collections,
- );
+ intranetcolorstylesheet =>
+ C4::Context->preference("intranetcolorstylesheet"),
+ intranetstylesheet => C4::Context->preference("intranetstylesheet"),
+ IntranetNav => C4::Context->preference("IntranetNav"),
+
+ collectionsLoop => $collections,
+);
output_html_with_http_headers $query, $cookie, $template->output;
--- a/rotating_collections/rotatingCollections.pl
+++ a/rotating_collections/rotatingCollections.pl
@@ -16,9 +16,7 @@
# Suite 330, Boston, MA 02111-1307 USA
#
-use strict;
-#use warnings; FIXME - Bug 2505
-require Exporter;
+use Modern::Perl;
use CGI;
@@ -28,25 +26,29 @@ use C4::Context;
use C4::RotatingCollections;
my $query = new CGI;
-my ($template, $loggedinuser, $cookie)
- = get_template_and_user({template_name => "rotating_collections/rotatingCollections.tt",
- query => $query,
- type => "intranet",
- authnotrequired => 0,
- flagsrequired => { tools => 'rotating_collections' },
- debug => 1,
- });
+
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ {
+ template_name => "rotating_collections/rotatingCollections.tmpl",
+ query => $query,
+ type => "intranet",
+ authnotrequired => 0,
+ flagsrequired => { tools => 'rotating_collections' },
+ debug => 1,
+ }
+);
my $branchcode = $query->cookie('branch');
my $collections = GetCollections();
$template->param(
- intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
- intranetstylesheet => C4::Context->preference("intranetstylesheet"),
- IntranetNav => C4::Context->preference("IntranetNav"),
-
- collectionsLoop => $collections,
- );
-
+ intranetcolorstylesheet =>
+ C4::Context->preference("intranetcolorstylesheet"),
+ intranetstylesheet => C4::Context->preference("intranetstylesheet"),
+ IntranetNav => C4::Context->preference("IntranetNav"),
+
+ collectionsLoop => $collections,
+);
+
output_html_with_http_headers $query, $cookie, $template->output;
--- a/rotating_collections/transferCollection.pl
+++ a/rotating_collections/transferCollection.pl
@@ -16,9 +16,7 @@
# Suite 330, Boston, MA 02111-1307 USA
#
-use strict;
-#use warnings; FIXME - Bug 2505
-require Exporter;
+use Modern::Perl;
use C4::Output;
use C4::Auth;
@@ -30,55 +28,61 @@ use CGI;
my $query = new CGI;
-my $colId = $query->param('colId');
+my $colId = $query->param('colId');
my $toBranch = $query->param('toBranch');
-my ($template, $loggedinuser, $cookie)
- = get_template_and_user({template_name => "rotating_collections/transferCollection.tt",
- query => $query,
- type => "intranet",
- authnotrequired => 0,
- flagsrequired => { tools => 'rotating_collections' },
- debug => 1,
- });
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ {
+ template_name => "rotating_collections/transferCollection.tmpl",
+ query => $query,
+ type => "intranet",
+ authnotrequired => 0,
+ flagsrequired => { tools => 'rotating_collections' },
+ debug => 1,
+ }
+);
## Transfer collection
my ( $success, $errorCode, $errorMessage );
-if ( $toBranch ) {
- ( $success, $errorCode, $errorMessage ) = TransferCollection( $colId, $toBranch );
+if ($toBranch) {
+ ( $success, $errorCode, $errorMessage ) =
+ TransferCollection( $colId, $toBranch );
- if ( $success ) {
- $template->param( transferSuccess => 1 );
- } else {
- $template->param( transferFailure => 1,
- errorCode => $errorCode,
- errorMessage => $errorMessage
- );
- }
+ if ($success) {
+ $template->param( transferSuccess => 1 );
+ }
+ else {
+ $template->param(
+ transferFailure => 1,
+ errorCode => $errorCode,
+ errorMessage => $errorMessage
+ );
+ }
}
## Set up the toBranch select options
my $branches = GetBranches();
my @branchoptionloop;
-foreach my $br (keys %$branches) {
- my %branch;
- $branch{code}=$br;
- $branch{name}=$branches->{$br}->{'branchname'};
- push (@branchoptionloop, \%branch);
+foreach my $br ( keys %$branches ) {
+ my %branch;
+ $branch{code} = $br;
+ $branch{name} = $branches->{$br}->{'branchname'};
+ push( @branchoptionloop, \%branch );
}
-
+
## Get data about collection
-my ( $colId, $colTitle, $colDesc, $colBranchcode ) = GetCollection( $colId );
+my ( $colId, $colTitle, $colDesc, $colBranchcode ) = GetCollection($colId);
$template->param(
- intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
- intranetstylesheet => C4::Context->preference("intranetstylesheet"),
- IntranetNav => C4::Context->preference("IntranetNav"),
-
- colId => $colId,
- colTitle => $colTitle,
- colDesc => $colDesc,
- colBranchcode => $colBranchcode,
- branchoptionloop => \@branchoptionloop
- );
-
+ intranetcolorstylesheet =>
+ C4::Context->preference("intranetcolorstylesheet"),
+ intranetstylesheet => C4::Context->preference("intranetstylesheet"),
+ IntranetNav => C4::Context->preference("IntranetNav"),
+
+ colId => $colId,
+ colTitle => $colTitle,
+ colDesc => $colDesc,
+ colBranchcode => $colBranchcode,
+ branchoptionloop => \@branchoptionloop
+);
+
output_html_with_http_headers $query, $cookie, $template->output;
--