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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt (-5 / +40 lines)
Lines 113-119 Link Here
113
                                        [% END %]
113
                                        [% END %]
114
                                        [% UNLESS ( isbn_hidden )%]
114
                                        [% UNLESS ( isbn_hidden )%]
115
                                            <li>
115
                                            <li>
116
                                                [% IF ( isbn_required ) %]
116
                                                [% IF ( biblionumber ) %]
117
                                                    <label for="isbn" class="required">Standard number (ISBN, ISSN or other):</label>
118
                                                    [% isbn | html %]
119
                                                [% ELSIF ( isbn_required ) %]
117
                                                    <label for="isbn" class="required">Standard number (ISBN, ISSN or other):</label>
120
                                                    <label for="isbn" class="required">Standard number (ISBN, ISSN or other):</label>
118
                                                    <input type="text" id="isbn" name="isbn"  maxlength="80" value="[% isbn | html %]" required="required" />
121
                                                    <input type="text" id="isbn" name="isbn"  maxlength="80" value="[% isbn | html %]" required="required" />
119
                                                    <div class="required_label required">Required</div>
122
                                                    <div class="required_label required">Required</div>
Lines 125-131 Link Here
125
                                        [% END %]
128
                                        [% END %]
126
                                        [% UNLESS ( publishercode_hidden ) %]
129
                                        [% UNLESS ( publishercode_hidden ) %]
127
                                            <li>
130
                                            <li>
128
                                                [% IF ( publishercode_required ) %]
131
                                                [% IF ( biblionumber ) %]
132
                                                    <label for="publishercode" class="required">Publisher:</label>
133
                                                    [% publishercode | html %]
134
                                                [% ELSIF ( publishercode_required ) %]
129
                                                    <label for="publishercode" class="required">Publisher:</label>
135
                                                    <label for="publishercode" class="required">Publisher:</label>
130
                                                    <input type="text" id="publishercode" name="publishercode" class="span6" maxlength="80" value="[% publishercode | html %]" required="required" />
136
                                                    <input type="text" id="publishercode" name="publishercode" class="span6" maxlength="80" value="[% publishercode | html %]" required="required" />
131
                                                    <div class="required_label required">Required</div>
137
                                                    <div class="required_label required">Required</div>
Lines 137-143 Link Here
137
                                        [% END %]
143
                                        [% END %]
138
                                        [% UNLESS ( collectiontitle_hidden ) %]
144
                                        [% UNLESS ( collectiontitle_hidden ) %]
139
                                            <li>
145
                                            <li>
140
                                                [% IF ( collectiontitle_required ) %]
146
                                                [% IF ( biblionumber ) %]
147
                                                    <label for="collectiontitle" class="required">Collection title:</label>
148
                                                    [% collectiontitle | html %]
149
                                                [% ELSIF ( collectiontitle_required ) %]
141
                                                    <label for="collectiontitle" class="required">Collection title:</label>
150
                                                    <label for="collectiontitle" class="required">Collection title:</label>
142
                                                    <input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" value="[% collectiontitle | html %]" required="required" />
151
                                                    <input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" value="[% collectiontitle | html %]" required="required" />
143
                                                    <div class="required_label required">Required</div>
152
                                                    <div class="required_label required">Required</div>
Lines 149-155 Link Here
149
                                        [% END %]
158
                                        [% END %]
150
                                        [% UNLESS ( place_hidden ) %]
159
                                        [% UNLESS ( place_hidden ) %]
151
                                            <li>
160
                                            <li>
152
                                                [% IF ( place_required ) %]
161
                                                [% IF ( biblionumber ) %]
162
                                                    <label for="place" class="required">Publication place:</label>
163
                                                    [% place | html %]
164
                                                [% ELSIF ( place_required ) %]
153
                                                    <label for="place" class="required">Publication place:</label>
165
                                                    <label for="place" class="required">Publication place:</label>
154
                                                    <input type="text" id="place" name="place" required="required" maxlength="80" value="[% place | html %]" />
166
                                                    <input type="text" id="place" name="place" required="required" maxlength="80" value="[% place | html %]" />
155
                                                    <div class="required_label required">Required</div>
167
                                                    <div class="required_label required">Required</div>
Lines 480-486 Link Here
480
                                    [% END %]
492
                                    [% END %]
481
                                [% END %]
493
                                [% END %]
482
                            [% END # / IF suggestions_loop %]
494
                            [% END # / IF suggestions_loop %]
483
484
                        [% END # IF op_else %]
495
                        [% END # IF op_else %]
485
                    </div> <!-- / #usersuggestions -->
496
                    </div> <!-- / #usersuggestions -->
486
                </div> <!-- / .col-lg-10 -->
497
                </div> <!-- / .col-lg-10 -->
Lines 492-497 Link Here
492
[% BLOCK jsinclude %]
503
[% BLOCK jsinclude %]
493
[% INCLUDE 'datatables.inc' %]
504
[% INCLUDE 'datatables.inc' %]
494
<script>
505
<script>
506
    // Disable fields if there is a biblionumber
507
    [% IF ( biblionumber ) %]
508
        window.addEventListener("DOMContentLoaded", (event) => {
509
            function disabled() {
510
                const title = document.getElementById('title');
511
                const author = document.getElementById('author');
512
                const copyrightdate = document.getElementById('copyrightdate');
513
                const isbn = document.getElementById('isbn');
514
                const publishercode = document.getElementById('publishercode');
515
                const collectiontitle = document.getElementById('collectiontitle');
516
                const place = document.getElementById('place');
517
518
                title.disabled = true;
519
                author.disabled = true;
520
                copyrightdate.disabled = true;
521
                isbn.disabled = true;
522
                publishercode.disabled = true;
523
                collectiontitle.disabled = true;
524
                place.disabled = true;
525
            }
526
            disabled();
527
        });
528
    [% END %]
529
495
    [% IF ( loggedinusername ) %]
530
    [% IF ( loggedinusername ) %]
496
        function enableCheckboxActions(){
531
        function enableCheckboxActions(){
497
            // Enable/disable controls if checkboxes are checked
532
            // Enable/disable controls if checkboxes are checked
(-)a/opac/opac-suggestions.pl (-3 / +12 lines)
Lines 192-197 if ( $op eq "add_confirm" ) { Link Here
192
        $suggestion->{suggesteddate} = dt_from_string;
192
        $suggestion->{suggesteddate} = dt_from_string;
193
        $suggestion->{branchcode} = $input->param('branchcode') || C4::Context->userenv->{"branch"};
193
        $suggestion->{branchcode} = $input->param('branchcode') || C4::Context->userenv->{"branch"};
194
        $suggestion->{STATUS} = 'ASKED';
194
        $suggestion->{STATUS} = 'ASKED';
195
        if ( $biblionumber ) {
196
            my $biblio = Koha::Biblios->find($biblionumber);
197
            $suggestion->{biblionumber} = $biblio->biblionumber;
198
            $suggestion->{title} = $biblio->title;
199
            $suggestion->{author} = $biblio->author;
200
            $suggestion->{copyrightdate} = $biblio->copyrightdate;
201
            $suggestion->{isbn} = $biblio->biblioitem->isbn;
202
            $suggestion->{publishercode} = $biblio->biblioitem->publishercode;
203
            $suggestion->{collectiontitle} = $biblio->biblioitem->collectiontitle;
204
            $suggestion->{place} = $biblio->biblioitem->place;
205
        }
195
206
196
        &NewSuggestion($suggestion);
207
        &NewSuggestion($suggestion);
197
        $patrons_pending_suggestions_count++;
208
        $patrons_pending_suggestions_count++;
Lines 292-296 $template->param( Link Here
292
    patrons_total_suggestions_count => $patrons_total_suggestions_count,
303
    patrons_total_suggestions_count => $patrons_total_suggestions_count,
293
);
304
);
294
305
295
output_html_with_http_headers $input, $cookie, $template->output, undef, { force_no_caching => 1 };
306
output_html_with_http_headers $input, $cookie, $template->output, undef, { force_no_caching => 1 };
296
297
- 

Return to bug 29311