Bug 40105: (QA follow-up): Have a 'additional information' section

This will encompass the 'Notes' field plus custom fields.

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Pedro Amorim 2025-11-12 11:08:07 +00:00 committed by Lucas Gass
parent 5940fb39d5
commit 0af6ad8cd5
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
4 changed files with 36 additions and 34 deletions

View File

@ -103,8 +103,11 @@
[% IF type %]
[% INCLUDE "ill/backends/Standard/shared/forms/${type}.inc" %]
[% END %]
[% INCLUDE "ill/backends/Standard/shared/notes.inc" %]
[% INCLUDE "ill/backends/Standard/shared/custom_fields.inc" %]
<legend>Additional information</legend>
<fieldset class="rows">
[% INCLUDE "ill/backends/Standard/shared/notes.inc" %]
[% INCLUDE "ill/backends/Standard/shared/custom_fields.inc" %]
</fieldset>
[% IF whole.value.other.type && unauthenticated_ill && !logged_in_user %]
<fieldset class="rows" id="illrequest_captcha">
<legend>Verification</legend>

View File

@ -1,34 +1,31 @@
<fieldset class="rows">
<legend>Custom fields</legend>
<ol id="standard-fields">
[% keys = whole.value.other.custom_key.split('\0') %]
[% values = whole.value.other.custom_value.split('\0') %]
[% i = 0 %]
[% FOREACH key IN keys %]
<li class="form-horizontal">
[% IF opac %]
<input type="text" placeholder="key" class="form-control input-fluid custom-field-input custom-name" name="custom_key" value="[% key | html %]" />
<input type="text" placeholder="value" class="form-control input-fluid custom-field-input" name="custom_value" id="custom-value" value="[% values.$i | html %]" />
[% ELSE %]
<input type="text" placeholder="key" class="custom-name" name="custom_key" value="[% key | html %]" />
<input type="text" placeholder="value" name="custom_value" id="custom-value" value="[% values.$i | html %]" />
[% END %]
<button value="[% i | html %]" name="custom_delete" type="submit" class="btn btn-danger btn-sm delete-new-field"> <span class="fa fa-trash"></span> Delete </button>
</li>
[% i = i + 1 %]
[% END %]
</ol>
<div id="custom-warning" style="display:none;margin:1em;" class="error required"></div>
<button type="button" id="add-new-fields" class="btn btn-default">
<span class="fa fa-plus"></span>
Add new field
</button>
</fieldset>
<ol id="standard-fields">
[% keys = whole.value.other.custom_key.split('\0') %]
[% values = whole.value.other.custom_value.split('\0') %]
[% i = 0 %]
[% FOREACH key IN keys %]
<li class="form-horizontal">
<label>&nbsp;</label>
[% IF opac %]
<input type="text" placeholder="key" class="form-control input-fluid custom-field-input custom-name" name="custom_key" value="[% key | html %]" />
<input type="text" placeholder="value" class="form-control input-fluid custom-field-input" name="custom_value" id="custom-value" value="[% values.$i | html %]" />
[% ELSE %]
<input type="text" placeholder="key" class="custom-name" name="custom_key" value="[% key | html %]" />
<input type="text" placeholder="value" name="custom_value" id="custom-value" value="[% values.$i | html %]" />
[% END %]
<button value="[% i | html %]" name="custom_delete" type="submit" class="btn btn-danger btn-sm delete-new-field"> <span class="fa fa-trash"></span> Delete </button>
</li>
[% i = i + 1 %]
[% END %]
</ol>
<div id="custom-warning" style="display:none;margin:1em;" class="error required"></div>
<button type="button" id="add-new-fields" class="btn btn-default">
<span class="fa fa-plus"></span>
Add new field
</button>
<style>
.custom-field-input {
width: 25%;
display: inline-block;
margin-left: 0.5em;
}
</style>

View File

@ -1,5 +1,6 @@
<fieldset class="rows" id="ill-standard-notes">
<legend>Notes</legend>
<label class="sr-only" for="notesopac">Notes:</label>
<textarea name="notesopac" id="notesopac" class="form-control input-fluid">[% whole.value.other.notesopac | html %]</textarea>
</fieldset>
<ol id="standard-opac-notes">
<li>
<label for="notesopac">Notes:</label>
<textarea name="notesopac" id="notesopac" class="form-control input-fluid">[% whole.value.other.notesopac | html %]</textarea>
</li>
</ol>

View File

@ -3,6 +3,7 @@ document.addEventListener("DOMContentLoaded", function () {
e.preventDefault();
var row =
'<li class="form-horizontal">' +
"<label>&nbsp;</label>" +
'<input type="text" class="custom-name ' +
"form-control input-fluid custom-field-input" +
'" name="custom_key" placeholder="' +