View | Details | Raw Unified | Return to bug 22800
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt (-2 / +2 lines)
Lines 339-347 Link Here
339
          return true;
339
          return true;
340
        });
340
        });
341
        [% END %]
341
        [% END %]
342
        [% IF ( op_add && mandatoryfields ) %]
342
        [% IF ( op_add && mandatoryfields.size ) %]
343
        {
343
        {
344
            var FldsRequired = [[% mandatoryfields | $raw %]];
344
            var FldsRequired = ['[% mandatoryfields.join("','") | html %]'];
345
            for (var i = 0; i < FldsRequired.length; i++) {
345
            for (var i = 0; i < FldsRequired.length; i++) {
346
                var rq_input = $('#' + FldsRequired[i]);
346
                var rq_input = $('#' + FldsRequired[i]);
347
                if (rq_input.length != 1) continue;
347
                if (rq_input.length != 1) continue;
(-)a/opac/opac-suggestions.pl (-4 / +3 lines)
Lines 208-218 if ( C4::Context->preference("AllowPurchaseSuggestionBranchChoice") ) { Link Here
208
    $template->param( branchcode => $branchcode );
208
    $template->param( branchcode => $branchcode );
209
}
209
}
210
210
211
my $mandatoryfields = '';
211
my @mandatoryfields;
212
{
212
{
213
    last unless ($op eq 'add');
213
    last unless ($op eq 'add');
214
    my $fldsreq_sp = C4::Context->preference("OPACSuggestionMandatoryFields") || 'title';
214
    my $fldsreq_sp = C4::Context->preference("OPACSuggestionMandatoryFields") || 'title';
215
    $mandatoryfields = join(', ', (map { '"'.$_.'"'; } sort split(/\s*\,\s*/, $fldsreq_sp)));
215
    @mandatoryfields = sort split(/\s*\,\s*/, $fldsreq_sp);
216
}
216
}
217
217
218
$template->param(
218
$template->param(
Lines 224-230 $template->param( Link Here
224
    messages              => \@messages,
224
    messages              => \@messages,
225
    suggestionsview       => 1,
225
    suggestionsview       => 1,
226
    suggested_by_anyone   => $suggested_by_anyone,
226
    suggested_by_anyone   => $suggested_by_anyone,
227
    mandatoryfields       => $mandatoryfields,
227
    mandatoryfields       => \@mandatoryfields,
228
    patrons_pending_suggestions_count => $patrons_pending_suggestions_count,
228
    patrons_pending_suggestions_count => $patrons_pending_suggestions_count,
229
);
229
);
230
230
231
- 

Return to bug 22800