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

(-)a/catalogue/search.pl (-3 / +4 lines)
Lines 223-232 if($cgi->cookie("holdforclub")){ Link Here
223
}
223
}
224
224
225
if($cgi->cookie("searchToOrder")){
225
if($cgi->cookie("searchToOrder")){
226
    my ( $basketno, $vendorid ) = split( /\//, $cgi->cookie("searchToOrder") );
226
    my ( $basketno, $vendorid, $ordernumber ) = split( /\//, $cgi->cookie("searchToOrder") );
227
    $template->param(
227
    $template->param(
228
        searchtoorder_basketno => $basketno,
228
        searchtoorder_basketno    => $basketno,
229
        searchtoorder_vendorid => $vendorid
229
        searchtoorder_vendorid    => $vendorid,
230
        searchtoorder_ordernumber => $ordernumber,
230
    );
231
    );
231
}
232
}
232
233
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (+60 lines)
Lines 723-728 Link Here
723
                                                                    <a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber | uri %]&amp;booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]">Modify</a>
723
                                                                    <a href="neworderempty.pl?ordernumber=[% books_loo.ordernumber | uri %]&amp;booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]">Modify</a>
724
                                                                    <br />
724
                                                                    <br />
725
                                                                    <a href="#" class="transfer_order" data-ordernumber="[% books_loo.ordernumber | html %]">Transfer</a>
725
                                                                    <a href="#" class="transfer_order" data-ordernumber="[% books_loo.ordernumber | html %]">Transfer</a>
726
                                                                    <br>
727
                                                                    <a href="#relinkOrder" role="button" class="relink_order" data-toggle="modal" data-ordernumber="[% books_loo.ordernumber | html %]" data-basketname="[% basket.basketname | html %]">Link to different record</a>
726
                                                                [% END %]
728
                                                                [% END %]
727
                                                            </td>
729
                                                            </td>
728
                                                        [% END %]
730
                                                        [% END %]
Lines 885-890 Link Here
885
                                    </div><!-- /.modal#addtoBasket -->
887
                                    </div><!-- /.modal#addtoBasket -->
886
                                [% END # /UNLESS ( closedate ) %]
888
                                [% END # /UNLESS ( closedate ) %]
887
889
890
                                <!-- Modal -->
891
                                <div id="relinkOrder" class="modal" tabindex="-1" role="dialog" aria-labelledby="relinkOrderLabel" aria-hidden="true">
892
                                    <div class="modal-dialog" role="document">
893
                                        <div class="modal-content">
894
                                            <div class="modal-header">
895
                                                <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
896
                                                <h4 class="modal-title" id="relinkOrderLabel">Relink order in basket</h4>
897
                                            </div>
898
                                            <div class="modal-body">
899
                                                <fieldset class="acqui_basket_relink">
900
                                                    <legend class="sr-only">Relink order in basket</legend>
901
                                                    [% IF has_budgets %]
902
                                                        <ul>
903
                                                            <li>
904
                                                                <form action="/cgi-bin/koha/catalogue/search.pl" method="get">
905
                                                                    <label>From an existing record:
906
                                                                        <input type="text" name="q" size="25" />
907
                                                                    </label>
908
                                                                    <input type="submit" class="submit" id="searchtoorder" data-booksellerid="[% booksellerid | html %]" data-basketno="[% basket.basketno | html %]" data-ordernumber="" value="Submit" />
909
                                                                </form>
910
                                                            </li>
911
                                                            <li><a href="/cgi-bin/koha/acqui/newordersuggestion.pl?booksellerid=[% booksellerid | uri %]&amp;basketno=[% basket.basketno | uri %]">From a suggestion</a></li>
912
                                                            <li><a href="/cgi-bin/koha/acqui/newordersubscription.pl?booksellerid=[% booksellerid | uri %]&amp;basketno=[% basket.basketno | uri %]">From a subscription</a></li>
913
                                                            <li><a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% booksellerid | uri %]&amp;basketno=[% basket.basketno | uri %]">From a new (empty) record</a></li>
914
                                                            <li><a href="/cgi-bin/koha/acqui/duplicate_orders.pl?basketno=[% basket.basketno | uri %]">From existing orders (copy)</a></li>
915
                                                            <li><a href="/cgi-bin/koha/acqui/z3950_search.pl?booksellerid=[% booksellerid | uri %]&amp;basketno=[% basket.basketno | uri %]">From an external source</a></li>
916
                                                            [% IF ( CAN_user_tools_stage_marc_import ) %]<li><a href="/cgi-bin/koha/tools/stage-marc-import.pl?basketno=[% basket.basketno | uri %]&amp;booksellerid=[% booksellerid | uri %]"> From a new file</a></li>[% END %]
917
                                                            <li><a href="/cgi-bin/koha/acqui/addorderiso2709.pl?booksellerid=[% booksellerid | uri %]&amp;basketno=[% basket.basketno | uri %]"> From a staged file</a></li>
918
                                                            [% IF ( CAN_user_circulate ) %]<li><a href="/cgi-bin/koha/circ/reserveratios.pl?booksellerid=[% booksellerid | uri %]&amp;basketno=[% basket.basketno | uri %]">From titles with highest hold ratios</a></li>[% END %]
919
                                                        </ul>
920
                                                    [% ELSE %]
921
                                                        <div class="dialog alert">
922
                                                            <p>You can't create any orders unless you first <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">define a budget and a fund</a>.</p>
923
                                                        </div>
924
                                                    [% END %]
925
                                                </fieldset>
926
                                            </div>
927
                                            <div class="modal-footer">
928
                                                <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
929
                                            </div>
930
                                        </div><!-- /.modal-content -->
931
                                    </div><!-- /.modal-dialog -->
932
                                </div><!-- /.modal#relinkOrder -->
933
888
                            [% END # /IF ( delete_confirmed ) %]
934
                            [% END # /IF ( delete_confirmed ) %]
889
                        [% END # /IF ( NO_BOOKSELLER ) %]
935
                        [% END # /IF ( NO_BOOKSELLER ) %]
890
                    [% ELSE %]
936
                    [% ELSE %]
Lines 1106-1111 Link Here
1106
                $(this).find("legend").html(legend);
1152
                $(this).find("legend").html(legend);
1107
                $(this).find("input:text").focus();
1153
                $(this).find("input:text").focus();
1108
            });
1154
            });
1155
1156
            $(".relink_order").click(function(){
1157
                var basket = $(this).data("basketname");
1158
                var ordernumber = $(this).data("ordernumber");
1159
                var legend = _("Relink order no. %s in basket %s").format(ordernumber, basket);
1160
                $("#relinkOrder").find("h4").text( legend );
1161
                $("#relinkOrder").find("legend").html(legend);
1162
                $("#relinkOrder").find("input:text").focus();
1163
                $("#relinkOrder").find("input[id='searchtoorder']").attr("data-ordernumber", ordernumber);
1164
                $("#relinkOrder a").each(function() {
1165
                    var link = $(this).attr("href");
1166
                    $(this).attr("href", link + "&ordernumber=" + ordernumber);
1167
                });
1168
            });
1109
        });
1169
        });
1110
    </script>
1170
    </script>
1111
1171
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (+4 lines)
Lines 590-596 Link Here
590
590
591
                                                    [% IF ( CAN_user_acquisition_order_manage ) %]
591
                                                    [% IF ( CAN_user_acquisition_order_manage ) %]
592
                                                        [% IF ( searchtoorder_basketno && searchtoorder_vendorid ) %]
592
                                                        [% IF ( searchtoorder_basketno && searchtoorder_vendorid ) %]
593
                                                            [% IF searchtoorder_ordernumber %]
594
                                                            | <a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% searchtoorder_vendorid | uri %]&amp;basketno=[% searchtoorder_basketno | uri %]&amp;biblionumber=[% SEARCH_RESULT.biblionumber | uri %]&amp;ordernumber=[% searchtoorder_ordernumber | uri %]">Relink to order</a>
595
                                                            [% ELSE %]
593
                                                            | <a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% searchtoorder_vendorid | uri %]&amp;basketno=[% searchtoorder_basketno | uri %]&amp;biblionumber=[% SEARCH_RESULT.biblionumber | uri %]">Add order</a>
596
                                                            | <a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% searchtoorder_vendorid | uri %]&amp;basketno=[% searchtoorder_basketno | uri %]&amp;biblionumber=[% SEARCH_RESULT.biblionumber | uri %]">Add order</a>
597
                                                            [% END %]
594
                                                        [% END %]
598
                                                        [% END %]
595
                                                    [% END %]
599
                                                    [% END %]
596
600
(-)a/koha-tmpl/intranet-tmpl/prog/js/acquisitions-menu.js (-3 / +6 lines)
Lines 1-8 Link Here
1
function searchToOrder( basketno, vendorid ){
1
function searchToOrder( basketno, vendorid, ordernumber ){
2
    var date = new Date();
2
    var date = new Date();
3
    var cookieData = "";
3
    var cookieData = "";
4
    date.setTime(date.getTime() + (10 * 60 * 1000));
4
    date.setTime(date.getTime() + (10 * 60 * 1000));
5
    cookieData += basketno + "/" + vendorid;
5
    cookieData += basketno + "/" + vendorid;
6
    if ( ordernumber ) {
7
        cookieData += "/" + ordernumber;
8
    }
6
    Cookies.set("searchToOrder", cookieData, { path: "/", expires: date, sameSite: 'Lax'  });
9
    Cookies.set("searchToOrder", cookieData, { path: "/", expires: date, sameSite: 'Lax'  });
7
}
10
}
8
11
Lines 15-20 $(document).ready(function() { Link Here
15
    $("body").on("click", "#searchtoorder", function(){
18
    $("body").on("click", "#searchtoorder", function(){
16
        var vendorid = $(this).data("booksellerid");
19
        var vendorid = $(this).data("booksellerid");
17
        var basketno = $(this).data("basketno");
20
        var basketno = $(this).data("basketno");
18
        searchToOrder( basketno, vendorid );
21
        var ordernumber = $(this).data("ordernumber");
22
        searchToOrder( basketno, vendorid, ordernumber );
19
    });
23
    });
20
});
24
});
21
- 

Return to bug 27063