From 9e7c644a7fffbe0244a554fb858e32b8368b35de Mon Sep 17 00:00:00 2001 From: Liz Rea Date: Thu, 14 Mar 2013 11:35:23 +1300 Subject: [PATCH] Bug 7883 - Save and continue editing for cataloging Patch reworked from Elliot Davis' original patch - but using bootstrap instead of YUI. This patch adds the ability for catalogers to save and continue editing when adding new biblios. To Test: Select an existing item or create a new item in cataloging using your favorite framework. Edit the bib From the save menu in the dropdown, select the new option of "Save and continue editing" If you are missing required fields you should still be prompted to fill them in before saving Once all required fields are in place you should be allowed to save, and you will be redirected to tab 0. The original patch claims to redirect to the original tab, but I never observed that behaviour from it - this patch merely takes what was in the original and makes it boostrap. --- cataloguing/addbiblio.pl | 7 +++++-- .../prog/en/modules/cataloguing/addbiblio.tt | 7 +++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 3314f1a..72447e5 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -872,7 +872,7 @@ if ( $op eq "addbiblio" ) { else { ( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode ); } - if ($redirect eq "items" || ($mode ne "popup" && !$is_a_modif && $redirect ne "view")){ + if ($redirect eq "items" || ($mode ne "popup" && !$is_a_modif && $redirect ne "view" && $redirect ne "just_save")){ if ($frameworkcode eq 'FA'){ print $input->redirect( '/cgi-bin/koha/cataloguing/additem.pl?' @@ -893,7 +893,7 @@ if ( $op eq "addbiblio" ) { exit; } } - elsif($is_a_modif || $redirect eq "view"){ + elsif(($is_a_modif || $redirect eq "view") && $redirect ne "just_save"){ my $defaultview = C4::Context->preference('IntranetBiblioDefaultView'); my $views = { C4::Search::enabled_staff_search_views }; if ($defaultview eq 'isbd' && $views->{can_view_ISBD}) { @@ -908,6 +908,9 @@ if ( $op eq "addbiblio" ) { exit; } + elsif ($redirect eq "just_save"){ + print $input->redirect("/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=$biblionumber&framework=$frameworkcode"); + } else { $template->param( biblionumber => $biblionumber, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt index 7e439bf..b11058c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -53,6 +53,12 @@ redirect("items"); return false; }); + $("#saveandcontinue").click(function(){ + $(".btn-group").removeClass("open"); + redirect("just_save"); + return false; + }); + }); function redirect(dest){ @@ -361,6 +367,7 @@ function Changefwk(FwkList) { [% END %] -- 1.7.9.5