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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt (-6 / +41 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 479-485 Link Here
479
                                    [% END %]
491
                                    [% END %]
480
                                [% END %]
492
                                [% END %]
481
                            [% END # / IF suggestions_loop %]
493
                            [% END # / IF suggestions_loop %]
482
483
                        [% END # IF op_else %]
494
                        [% END # IF op_else %]
484
                    </div> <!-- / #usersuggestions -->
495
                    </div> <!-- / #usersuggestions -->
485
                </div> <!-- / .col-lg-10 -->
496
                </div> <!-- / .col-lg-10 -->
Lines 490-496 Link Here
490
[% INCLUDE 'opac-bottom.inc' %]
501
[% INCLUDE 'opac-bottom.inc' %]
491
[% BLOCK jsinclude %]
502
[% BLOCK jsinclude %]
492
[% INCLUDE 'datatables.inc' %]
503
[% INCLUDE 'datatables.inc' %]
493
<script>
504
<script> 
505
    // Disable fields if there is a biblionumber
506
    [% IF ( biblionumber ) %]
507
        window.addEventListener("DOMContentLoaded", (event) => {
508
            function disabled() {
509
                const title = document.getElementById('title');
510
                const author = document.getElementById('author');
511
                const copyrightdate = document.getElementById('copyrightdate');
512
                const isbn = document.getElementById('isbn');
513
                const publishercode = document.getElementById('publishercode');
514
                const collectiontitle = document.getElementById('collectiontitle');
515
                const place = document.getElementById('place');
516
517
                title.disabled = true;          
518
                author.disabled = true;
519
                copyrightdate.disabled = true;
520
                isbn.disabled = true;
521
                publishercode.disabled = true;
522
                collectiontitle.disabled = true;
523
                place.disabled = true;
524
            }
525
            disabled();
526
        });
527
    [% END %]
528
494
    [% IF ( loggedinusername ) %]
529
    [% IF ( loggedinusername ) %]
495
        function enableCheckboxActions(){
530
        function enableCheckboxActions(){
496
            // Enable/disable controls if checkboxes are checked
531
            // 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