diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/rotating-collections-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/rotating-collections-toolbar.inc
index f8f8ab552f..b395d41031 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/rotating-collections-toolbar.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/rotating-collections-toolbar.inc
@@ -1,6 +1,6 @@
[% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tt
index 46168d9df2..f687e9bc2f 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tt
@@ -4,9 +4,9 @@
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
[% FILTER collapse %]
- [% IF ( action == "new" ) %]
+ [% IF ( op == "new" ) %]
[% t("Add a new collection") | html %]
- [% ELSIF ( action == "delete" ) %]
+ [% ELSIF ( op == "cud-delete" ) %]
[% t("Collection deleted") | html %]
[% ELSE %]
[% t("Edit collection") | html %] ›
@@ -32,11 +32,11 @@
Rotating collections
[% END %]
- [%- IF ( action == "new" ) %]
+ [%- IF ( op == "new" ) %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
Add a new collection
[% END %]
- [% ELSIF ( action == "delete" ) %]
+ [% ELSIF ( op == "cud-delete" ) %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
Collection deleted
[% END %]
@@ -116,7 +116,7 @@
- [% IF action == "new" || action == "edit" %]
+ [% IF op == "new" || op == "edit" %]
[% IF ( previousActionEdit ) %]
Edit collection [% editColTitle | html %]
[% ELSE %]
@@ -126,10 +126,10 @@
diff --git a/koha-tmpl/intranet-tmpl/prog/js/rotating-collections.js b/koha-tmpl/intranet-tmpl/prog/js/rotating-collections.js
index 78197ac2f7..5879ca917e 100644
--- a/koha-tmpl/intranet-tmpl/prog/js/rotating-collections.js
+++ b/koha-tmpl/intranet-tmpl/prog/js/rotating-collections.js
@@ -6,6 +6,7 @@ $(document).ready(function(){
$(".confirmdelete").click(function(){
$(this).parents('tr').addClass("warn");
if(confirm(__("Are you sure you want to delete this rotating collection?"))){
+ $(this).parents('form').submit();
return true;
} else {
$(this).parents('tr').removeClass("warn");
diff --git a/rotating_collections/editCollections.pl b/rotating_collections/editCollections.pl
index 6433e0106c..0d473e49e5 100755
--- a/rotating_collections/editCollections.pl
+++ b/rotating_collections/editCollections.pl
@@ -38,10 +38,11 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
);
my $action = $query->param('action');
-$template->param( action => $action );
+my $op = $query->param('op');
+$template->param( op => $op );
# Create new Collection
-if ( $action eq 'create' ) {
+if ( $op eq 'cud-create' ) {
my $title = $query->param('title');
my $description = $query->param('description');
@@ -63,7 +64,7 @@ if ( $action eq 'create' ) {
}
## Delete a club or service
-elsif ( $action eq 'cud-delete' ) {
+elsif ( $op eq 'cud-delete' ) {
my $colId = $query->param('colId');
my ( $success, $errorCode, $errorMessage ) = DeleteCollection($colId);
@@ -78,7 +79,7 @@ elsif ( $action eq 'cud-delete' ) {
}
## Edit a club or service: grab data, put in form.
-elsif ( $action eq 'cud-edit' ) {
+elsif ( $op eq 'edit' ) {
my ( $colId, $colTitle, $colDesc, $colBranchcode ) = GetCollection( $query->param('colId') );
$template->param(
@@ -90,7 +91,7 @@ elsif ( $action eq 'cud-edit' ) {
}
# Update a Club or Service
-elsif ( $action eq 'cud-update' ) {
+elsif ( $op eq 'cud-update' ) {
my $colId = $query->param('colId');
my $title = $query->param('title');
my $description = $query->param('description');
@@ -112,4 +113,6 @@ elsif ( $action eq 'cud-update' ) {
}
}
+# Else, this should be 'new' and a blank form
+
output_html_with_http_headers $query, $cookie, $template->output;