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

(-)a/acqui/neworderempty.pl (-1 / +1 lines)
Lines 255-261 if ( not $ordernumber ) { # create order Link Here
255
}
255
}
256
else {    #modify order
256
else {    #modify order
257
    $data   = GetOrder($ordernumber);
257
    $data   = GetOrder($ordernumber);
258
    $biblionumber = $data->{'biblionumber'};
259
    $budget_id = $data->{'budget_id'};
258
    $budget_id = $data->{'budget_id'};
260
259
261
    $template->param(
260
    $template->param(
Lines 272-277 else { #modify order Link Here
272
        push @order_users, $order_patron if $order_patron;
271
        push @order_users, $order_patron if $order_patron;
273
    }
272
    }
274
}
273
}
274
$biblionumber = $data->{biblionumber};
275
275
276
# We can have:
276
# We can have:
277
# - no ordernumber but a biblionumber: from a subscription, from an existing record
277
# - no ordernumber but a biblionumber: from a subscription, from an existing record
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc (+4 lines)
Lines 33-38 Link Here
33
        [% END %]
33
        [% END %]
34
    [% END %]
34
    [% END %]
35
35
36
    [% IF Koha.Preference('suggestion') %]
37
        <li><a class="btn btn-link btn-lg" href="/cgi-bin/koha/opac-suggestions.pl?op=add&biblionumber=[% biblio.biblionumber | url %]"><i class="fa fa-fw fa-money"></i> New purchase suggestion for this title</a></li>
38
    [% END %]
39
36
    [% IF ( OpacHighlightedWords && query_desc ) %]
40
    [% IF ( OpacHighlightedWords && query_desc ) %]
37
    <li>
41
    <li>
38
        <a href="#" class="highlight_toggle btn btn-link btn-lg" id="highlight_toggle_off"><i class="fa fa-fw fa-pencil"></i> Unhighlight</a>
42
        <a href="#" class="highlight_toggle btn btn-link btn-lg" id="highlight_toggle_off"><i class="fa fa-fw fa-pencil"></i> Unhighlight</a>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt (-4 / +9 lines)
Lines 204-213 Link Here
204
                                </fieldset>
204
                                </fieldset>
205
                                <fieldset class="action">
205
                                <fieldset class="action">
206
                                    <input type="hidden" name="suggested_by_anyone" value="[% suggested_by_anyone | html %]" />
206
                                    <input type="hidden" name="suggested_by_anyone" value="[% suggested_by_anyone | html %]" />
207
                                    <input type="hidden" name="op" value="add_validate" />
207
                                    [% IF need_confirm # Confirm that we want a duplicate %]
208
                                    [% IF ( need_confirm ) %]
208
                                        <input type="hidden" name="op" value="add_confirm" />
209
                                        <input type="submit" onclick="this.form.op.value = 'add_confirm'; this.form.submit();" class="btn" value="Confirm your suggestion" />
209
                                        <input type="submit" class="btn" value="Confirm your suggestion" />
210
                                    [% ELSE %]
210
                                    [% ELSIF biblionumber # Create from an existing title %]
211
                                        <input type="hidden" name="op" value="add_confirm" />
212
                                        <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
213
                                        <input type="submit" class="btn" value="Submit your suggestion" />
214
                                    [% ELSE # Not created from an existing title, search for possible duplicate %]
215
                                        <input type="hidden" name="op" value="add_validate" />
211
                                        <input type="submit" class="btn" value="Submit your suggestion" />
216
                                        <input type="submit" class="btn" value="Submit your suggestion" />
212
                                    [% END %]
217
                                    [% END %]
213
                                    <a class="action" href="/cgi-bin/koha/opac-suggestions.pl">Cancel</a>
218
                                    <a class="action" href="/cgi-bin/koha/opac-suggestions.pl">Cancel</a>
(-)a/opac/opac-suggestions.pl (-2 / +15 lines)
Lines 37-42 use Koha::DateUtils qw( dt_from_string ); Link Here
37
37
38
my $input           = new CGI;
38
my $input           = new CGI;
39
my $op              = $input->param('op');
39
my $op              = $input->param('op');
40
my $biblionumber    = $input->param('biblionumber');
40
my $suggestion      = $input->Vars;
41
my $suggestion      = $input->Vars;
41
my $negcaptcha      = $input->param('negcap');
42
my $negcaptcha      = $input->param('negcap');
42
my $suggested_by_anyone = $input->param('suggested_by_anyone') || 0;
43
my $suggested_by_anyone = $input->param('suggested_by_anyone') || 0;
Lines 116-122 if ( $op eq 'else' ) { Link Here
116
    }
117
    }
117
}
118
}
118
119
119
if ( $op eq "add_validate" ) {
120
if ( $op eq "add_validate" && not $biblionumber ) { # If we are creating the suggestion from an existing record we do not want to search for duplicates
120
    $op = 'add_confirm';
121
    $op = 'add_confirm';
121
    my $biblio = MarcRecordFromNewSuggestion($suggestion);
122
    my $biblio = MarcRecordFromNewSuggestion($suggestion);
122
    if ( my ($duplicatebiblionumber, $duplicatetitle) = FindDuplicate($biblio) ) {
123
    if ( my ($duplicatebiblionumber, $duplicatetitle) = FindDuplicate($biblio) ) {
Lines 229-234 my @mandatoryfields; Link Here
229
    foreach (@mandatoryfields) {
230
    foreach (@mandatoryfields) {
230
        $template->param( $_."_required" => 1);
231
        $template->param( $_."_required" => 1);
231
    }
232
    }
233
    if ( $biblionumber ) {
234
        my $biblio = Koha::Biblios->find($biblionumber);
235
        $template->param(
236
            biblionumber    => $biblio->biblionumber,
237
            title           => $biblio->title,
238
            author          => $biblio->author,
239
            copyrightdate   => $biblio->copyrightdate,
240
            isbn            => $biblio->biblioitem->isbn,
241
            publishercode   => $biblio->biblioitem->publishercode,
242
            collectiontitle => $biblio->biblioitem->collectiontitle,
243
            place           => $biblio->biblioitem->place,
244
        );
245
    }
232
}
246
}
233
247
234
$template->param(
248
$template->param(
235
- 

Return to bug 14963