Bug 34478: Changes for patron_lists/add-modify

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Marcel de Rooy 2024-02-02 10:06:43 +00:00 committed by Jonathan Druart
parent ee17b3d417
commit 1a887538b9
Signed by: jonathan.druart
GPG key ID: A085E712BEF0E0F0
2 changed files with 3 additions and 1 deletions

View file

@ -80,6 +80,7 @@
</fieldset>
<fieldset class="action">
<input type="hidden" name="op" value="cud-add_modify" />
<input type="hidden" name="patron_list_id" value="[% list.patron_list_id | html %]" />
<input type="submit" class="btn btn-primary" value="Save" />
<a href="lists.pl" class="cancel">Cancel</a>

View file

@ -26,6 +26,7 @@ use C4::Output qw( output_html_with_http_headers );
use Koha::List::Patron qw( AddPatronList GetPatronLists ModPatronList );
my $cgi = CGI->new;
my $op = $cgi->param('op') // q{};
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
@ -45,7 +46,7 @@ if ($id) {
$template->param( list => $list );
}
if ($name) {
if ( $op eq 'cud-add_modify' && $name ) {
if ($id) {
ModPatronList( { patron_list_id => $id, name => $name, shared => $shared } );
print $cgi->redirect('lists.pl');