Bug 34478: serials/routing-preview.pl

Not totally done, still need the "save and preview"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2024-03-01 10:46:41 +01:00
parent 18b046598c
commit 8a20c96b6f
Signed by: jonathan.druart
GPG key ID: A085E712BEF0E0F0
2 changed files with 27 additions and 13 deletions

View file

@ -32,10 +32,6 @@
<h1>Preview routing list for <em>[% title | html %]</em></h1>
<form method="post" action="routing-preview.pl">
[% INCLUDE 'csrf-token.inc' %]
<input type="hidden" id="subscriptionid" name="subscriptionid" value="[% subscriptionid | html %]" />
<input type="hidden" id="issue_escaped" name="issue_escaped" value="[% issue_escaped | html %]" />
<fieldset class="rows">
<ol>
<li><span class="label">Issue:</span>[% issue | html %]</li>
@ -50,9 +46,29 @@
</fieldset>
<fieldset class="action">
<input type="submit" name="ok" id="save_and_preview" class="btn btn-primary" value="Save and preview routing slip" />
<input type="submit" name="edit" class="btn btn-primary" value="Edit" />
<input type="submit" name="delete" class="btn btn-primary" value="Delete" /></fieldset>
<form method="post" action="routing-preview.pl">
[% INCLUDE 'csrf-token.inc' %]
<input type="hidden" id="subscriptionid" name="subscriptionid" value="[% subscriptionid | html %]" />
<input type="hidden" id="issue_escaped" name="issue_escaped" value="[% issue_escaped | html %]" />
<input type="hidden" name="op" value="cud-save_and_preview" />
<input id="save_and_preview" type="submit" class="btn btn-primary" value="Save and preview routing slip" />
</form>
<form method="post" action="routing-preview.pl">
[% INCLUDE 'csrf-token.inc' %]
<input type="hidden" id="subscriptionid" name="subscriptionid" value="[% subscriptionid | html %]" />
<input type="hidden" id="issue_escaped" name="issue_escaped" value="[% issue_escaped | html %]" />
<input type="hidden" name="op" value="cud-edit" />
<input type="submit" class="btn btn-primary" value="Edit" />
</form>
<form method="post" action="routing-preview.pl">
[% INCLUDE 'csrf-token.inc' %]
<input type="hidden" id="subscriptionid" name="subscriptionid" value="[% subscriptionid | html %]" />
<input type="hidden" id="issue_escaped" name="issue_escaped" value="[% issue_escaped | html %]" />
<input type="hidden" name="op" value="cud-delete" />
<input type="submit" class="btn btn-primary" value="Delete" />
</form>
</form>
</main>

View file

@ -36,19 +36,17 @@ my $query = CGI->new;
my $subscriptionid = $query->param('subscriptionid');
my $issue = $query->param('issue');
my $routingid;
my $ok = $query->param('ok');
my $edit = $query->param('cud-edit');
my $delete = $query->param('cud-delete');
my $op = $query->param('op') || q{};
my $dbh = C4::Context->dbh;
if($delete){
if($op eq 'cud-delete'){
delroutingmember($routingid,$subscriptionid);
my $sth = $dbh->prepare("UPDATE serial SET routingnotes = NULL WHERE subscriptionid = ?");
$sth->execute($subscriptionid);
print $query->redirect("routing.pl?subscriptionid=$subscriptionid&op=new");
}
if($edit){
if($op eq 'cud-edit'){
print $query->redirect("routing.pl?subscriptionid=$subscriptionid");
}
@ -58,7 +56,7 @@ my ($tmp ,@serials) = GetSerials($subscriptionid);
my ($template, $loggedinuser, $cookie);
my $library;
if($ok){
if($op eq 'cud-save_and_preview'){
# get biblio information....
my $biblionumber = $subs->{'bibnum'};