[1] Restore behavior of the input field for the library
code; when adding a new library, it should be a
a text box; when editing an existing library,
should be a hidden input.
[2] When user attempts to add a new library with the same
code as that of an existing library, populate the form
with what the user entered for the new library, not the
values from the existing library.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
my $error = ModBranch($params);
# if error saving, stay on edit and rise error
if ($error) {
- editbranchform($branchcode,$template);
+ # copy input parameters back to form
+ # FIXME - doing this doesn't preserve any branch group selections, but good enough for now
+ $template->param(%$params);
+ $template->param(branch_name => $params->{branchname});
$template->param( 'heading-branches-add-branch-p' => 1, 'add' => 1, "ERROR$error" => 1 );
} else {
$template->param( else => 1);
<input type="hidden" name="add" value="0" />
<!-- /TMPL_IF -->
<ol><li>
- <!-- TMPL_IF name="heading-branches-add-p" -->
+ <!-- TMPL_IF name="heading-branches-add-branch-p" -->
+ <label for="branchcode">Library code</label>
+ <input type="text" name="branchcode" id="branchcode" size="10" maxlength="10" value="<!-- TMPL_VAR name="branchcode" escape="HTML" -->" />
+ <!-- TMPL_ELSE -->
<span class="label">Library code</span>
<input type="hidden" name="branchcode" value="<!-- TMPL_VAR name="branchcode" escape="HTML" -->" />
<!-- TMPL_VAR name="branchcode" -->
- <!-- TMPL_ELSE -->
- <label for="branchcode">Library code</label>
- <input type="text" name="branchcode" id="branchcode" size="10" maxlength="10" value="<!-- TMPL_VAR name="branchcode" escape="HTML" -->" />
<!-- /TMPL_IF -->
</li>
<li>