#======================================================================
use POSIX qw(strftime);
-use List::Util qw(max);
+use List::Util qw(first max);
use List::MoreUtils qw(any);
use SL::AM;
$form->get_lists('partsgroup' => 'ALL_PARTSGROUPS');
print $form->parse_html_template('ic/search', { %is_xyz,
- dateformat => $myconfig{dateformat},
+ dateformat => $myconfig{dateformat},
limit => $myconfig{vclimit}, });
$lxdebug->leave_sub();
$main::lxdebug->leave_sub();
}
+sub back_to_record {
+ _check_io_auth();
+
+ $::auth->restore_form_from_session($::form->{previousform}, clobber => 1);
+ $::form->{rowcount}--;
+ $::form->{action} = 'display_form';
+ $::form->{callback} = $::form->{script} . '?' . join('&', map { $::form->escape($_) . '=' . $::form->escape($::form->{$_}) } sort keys %{ $::form });
+ $::form->redirect;
+}
+
sub continue { call_sub($form->{"nextsub"}); }
+
+sub dispatcher {
+ my $action = first { $::form->{"action_${_}"} } qw(add back_to_record);
+ $::form->error($::locale->text('No action defined.')) unless $action;
+
+ $::form->{dispatched_action} = $action;
+ call_sub($action);
+}
<h4 class="error">[% 'Item not on file!' | $T8 %]
-
<p>[% 'What type of item is this?' | $T8 %]</h4>
<form method="post" action="ic.pl">
<input type="hidden" name="[% HTML.escape(var.name) %]" value="[% HTML.escape(var.value) %]">
[%- END %]
- <input type="hidden" name="nextsub" value="add">
- <input class="submit" type="submit" name="action" value="[% 'Continue' | $T8 %]">
+ <input type="hidden" name="action" value="dispatcher">
+ <input class="submit" type="submit" name="action_add" value="[% 'Continue' | $T8 %]">
+ <input class="submit" type="submit" name="action_back_to_record" value="[% 'Back' | $T8 %]">
</form>
</body>