Bug 32773: Add ability to set biblio_framework.is_fast_add
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> Signed-off-by: Miranda Nero <mnero@oslri.net> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
c11a324468
commit
04a48349be
|
|
@ -54,10 +54,12 @@ if ( $op eq 'add_form' ) {
|
||||||
my $frameworkcode = $input->param('frameworkcode');
|
my $frameworkcode = $input->param('frameworkcode');
|
||||||
my $frameworktext = $input->param('frameworktext');
|
my $frameworktext = $input->param('frameworktext');
|
||||||
my $is_a_modif = $input->param('is_a_modif');
|
my $is_a_modif = $input->param('is_a_modif');
|
||||||
|
my $is_fast_add = $input->param('is_fast_add') // 0;
|
||||||
|
|
||||||
if ($is_a_modif) {
|
if ($is_a_modif) {
|
||||||
my $framework = Koha::BiblioFrameworks->find($frameworkcode);
|
my $framework = Koha::BiblioFrameworks->find($frameworkcode);
|
||||||
$framework->frameworktext($frameworktext);
|
$framework->frameworktext($frameworktext);
|
||||||
|
$framework->is_fast_add($is_fast_add);
|
||||||
eval { $framework->store; };
|
eval { $framework->store; };
|
||||||
if ($@) {
|
if ($@) {
|
||||||
push @messages, { type => 'error', code => 'error_on_update' };
|
push @messages, { type => 'error', code => 'error_on_update' };
|
||||||
|
|
@ -69,6 +71,7 @@ if ( $op eq 'add_form' ) {
|
||||||
{
|
{
|
||||||
frameworkcode => $frameworkcode,
|
frameworkcode => $frameworkcode,
|
||||||
frameworktext => $frameworktext,
|
frameworktext => $frameworktext,
|
||||||
|
is_fast_add => $is_fast_add,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
eval { $framework->store; };
|
eval { $framework->store; };
|
||||||
|
|
@ -127,4 +130,3 @@ $template->param(
|
||||||
);
|
);
|
||||||
|
|
||||||
output_html_with_http_headers $input, $cookie, $template->output;
|
output_html_with_http_headers $input, $cookie, $template->output;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -135,6 +135,14 @@
|
||||||
<input type="text" name="frameworktext" id="description" size="40" maxlength="80" value="[% framework.frameworktext | html %]" required="required" class="required" />
|
<input type="text" name="frameworktext" id="description" size="40" maxlength="80" value="[% framework.frameworktext | html %]" required="required" class="required" />
|
||||||
<span class="required">Required</span>
|
<span class="required">Required</span>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<label for="is_fast_add">Use as a Fast add framework: </label>
|
||||||
|
[% IF framework.is_fast_add %]
|
||||||
|
<input type="checkbox" name="is_fast_add" id="is_fast_add" value="1" checked />
|
||||||
|
[% ELSE %]
|
||||||
|
<input type="checkbox" name="is_fast_add" id="is_fast_add" value="1" />
|
||||||
|
[% END %]
|
||||||
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset class="action">
|
<fieldset class="action">
|
||||||
|
|
@ -292,7 +300,12 @@
|
||||||
[% FOREACH loo IN frameworks %]
|
[% FOREACH loo IN frameworks %]
|
||||||
<tr>
|
<tr>
|
||||||
<td>[% loo.frameworkcode | html %]</td>
|
<td>[% loo.frameworkcode | html %]</td>
|
||||||
<td>[% loo.frameworktext | html %]</td>
|
<td>
|
||||||
|
[% loo.frameworktext | html %]
|
||||||
|
[% IF loo.is_fast_add %]
|
||||||
|
<span class="badge rounded-pill bg-secondary float-end">Fast add</span>
|
||||||
|
[% END %]
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="btn-group dropup">
|
<div class="btn-group dropup">
|
||||||
<a class="btn btn-default btn-xs dropdown-toggle" id="frameworkactions[% loo.frameworkcode | html %]" role="button" data-bs-toggle="dropdown" href="#"> Actions </a>
|
<a class="btn btn-default btn-xs dropdown-toggle" id="frameworkactions[% loo.frameworkcode | html %]" role="button" data-bs-toggle="dropdown" href="#"> Actions </a>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue