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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt (-14 / +7 lines)
Lines 33-39 fieldset.rows li.radio { width: 100%; } /* override staff-global.css */ Link Here
33
<div class="main container-fluid">
33
<div class="main container-fluid">
34
    <div class="row">
34
    <div class="row">
35
            <div class="col-sm-12">
35
            <div class="col-sm-12">
36
                <h1>[% IF ( modify ) %] Modify subscription for <i>[% bibliotitle | html %]</i>[% ELSE %]Add a new subscription[% END %] (<span id="page_number">1/2</span>)</h1>
36
                <h1>[% IF ( modify ) %] Modify subscription for <i>[% bibliotitle | html %]</i>[% ELSE %]Add a new subscription[% END %]</h1>
37
            </div>
37
            </div>
38
            <form method="post" id="subscription_add_form" name="f" action="/cgi-bin/koha/serials/subscription-add.pl" class="validated">
38
            <form method="post" id="subscription_add_form" name="f" action="/cgi-bin/koha/serials/subscription-add.pl" class="validated">
39
                [% IF ( modify ) %]
39
                [% IF ( modify ) %]
Lines 45-52 fieldset.rows li.radio { width: 100%; } /* override staff-global.css */ Link Here
45
                <input type="hidden" name="user" value="[% logged_in_user.userid | html %]" />
45
                <input type="hidden" name="user" value="[% logged_in_user.userid | html %]" />
46
                <input type="hidden" name="irreg_check" value="0" />
46
                <input type="hidden" name="irreg_check" value="0" />
47
47
48
                <div id="page_1">
48
                <div id="section_1">
49
                    <div class="col-md-6">
50
                        <fieldset id="subscription_add_information" class="rows">
49
                        <fieldset id="subscription_add_information" class="rows">
51
                            <legend>Subscription details</legend>
50
                            <legend>Subscription details</legend>
52
                            <ol>
51
                            <ol>
Lines 209-222 fieldset.rows li.radio { width: 100%; } /* override staff-global.css */ Link Here
209
                                </li>
208
                                </li>
210
                            </ol>
209
                            </ol>
211
                        </fieldset>
210
                        </fieldset>
212
                        <fieldset class="action">
213
                            <input type="button" value="Next &gt;&gt;" id="subscription_add_next" style="float:right;" />
214
                        </fieldset>
215
                    </div>
216
                </div>
211
                </div>
217
212
218
                <div id="page_2">
213
                <div id="section_2">
219
                    <div class="col-md-6">
220
                [% IF ( Koha.Preference('Mana') == 1) && !mana_url %]
214
                [% IF ( Koha.Preference('Mana') == 1) && !mana_url %]
221
                    <fieldset>
215
                    <fieldset>
222
                        <p><center>The Mana Knowledge Base can be used to import subscription patterns submitted by other libraries and save you extra work. Ask your system administrator to configure this service and complete the configuration, or remove this message by disabling the system preference
216
                        <p><center>The Mana Knowledge Base can be used to import subscription patterns submitted by other libraries and save you extra work. Ask your system administrator to configure this service and complete the configuration, or remove this message by disabling the system preference
Lines 469-483 fieldset.rows li.radio { width: 100%; } /* override staff-global.css */ Link Here
469
                            <input type="hidden" id="unitsperissue"  name="unitsperissue" value=""/>
463
                            <input type="hidden" id="unitsperissue"  name="unitsperissue" value=""/>
470
                            <input type="hidden" id="issuesperunit"  name="issuesperunit" value=""/>
464
                            <input type="hidden" id="issuesperunit"  name="issuesperunit" value=""/>
471
                            <fieldset class="action">
465
                            <fieldset class="action">
472
                                <input type="button" id="subscription_add_previous" value="&lt;&lt; Previous" style="float:left;"/>
473
                                <input id="testpatternbutton" type="button" value="Test prediction pattern" />
474
                                <input id="save-subscription" type="submit" value="Save subscription" style="float:right;" accesskey="w"/>
466
                                <input id="save-subscription" type="submit" value="Save subscription" style="float:right;" accesskey="w"/>
475
                            </fieldset>
467
                            </fieldset>
476
                        </div>
468
                        </div>
477
                    </div>
469
                        <fieldset id="pattern_error_box">
478
                    <div class="col-md-6">
470
                            Cannot predict pattern due to issues below:
471
                            <ul id="pattern_errors"></ul>
472
                        </fieldset>
479
                        <li id="displayexample"></li>
473
                        <li id="displayexample"></li>
480
                    </div>
481
                </div>
474
                </div>
482
            </form>
475
            </form>
483
        </div>
476
        </div>
(-)a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js (-16 / +19 lines)
Lines 45-51 function Clear(id) { Link Here
45
    $("#"+id).val('');
45
    $("#"+id).val('');
46
}
46
}
47
47
48
function Check_page1() {
48
function Check_page(){
49
    if ( $("#aqbooksellerid").val().length == 0) {
49
    if ( $("#aqbooksellerid").val().length == 0) {
50
        input_box = confirm( MSG_LINK_TO_VENDOR );
50
        input_box = confirm( MSG_LINK_TO_VENDOR );
51
        if (input_box==false) {
51
        if (input_box==false) {
Lines 57-66 function Check_page1() { Link Here
57
        return false;
57
        return false;
58
    }
58
    }
59
59
60
    return true;
61
}
62
63
function Check_page2(){
64
    if( more_than_one_serial == "" ){
60
    if( more_than_one_serial == "" ){
65
        if($("#acqui_date").val().length == 0){
61
        if($("#acqui_date").val().length == 0){
66
            alert( MSG_REQUIRED_PUB_DATE );
62
            alert( MSG_REQUIRED_PUB_DATE );
Lines 260-284 function testPredictionPattern() { Link Here
260
    var error = 0;
256
    var error = 0;
261
    var error_msg = "";
257
    var error_msg = "";
262
    if(frequencyid == undefined || frequencyid == ""){
258
    if(frequencyid == undefined || frequencyid == ""){
263
        error_msg += "- " + MSG_FREQUENCY_UNDEFINED + "\n";
259
        error_msg += "<li>" + MSG_FREQUENCY_UNDEFINED + "</li>";
264
        error ++;
260
        error ++;
265
    }
261
    }
266
    acquidate = $("#acqui_date").val();
262
    acquidate = $("#acqui_date").val();
267
    if(acquidate == undefined || acquidate == ""){
263
    if(acquidate == undefined || acquidate == ""){
268
        error_msg += "-" + MSG_PUB_DATE_UNDEFINED + "\n";
264
        error_msg += "<li>" + MSG_PUB_DATE_UNDEFINED + "</li>";
269
        error ++;
265
        error ++;
270
    }
266
    }
271
    if( more_than_one_serial !== "" ){
267
    if( more_than_one_serial !== "" ){
272
        var nextacquidate = $("#nextacquidate").val();
268
        var nextacquidate = $("#nextacquidate").val();
273
        if(nextacquidate == undefined || nextacquidate == ""){
269
        if(nextacquidate == undefined || nextacquidate == ""){
274
            error_msg += "-" + MSG_NEXT_ISSUE_UNDEFINED + "\n";
270
            error_msg += "<li>" + MSG_NEXT_ISSUE_UNDEFINED + "</li>";
275
            error ++;
271
            error ++;
276
        }
272
        }
277
    }
273
    }
278
274
279
    if(error){
275
    if(error){
280
        alert( MSG_PATTERN_TEST_FAILED.format(error_msg) );
276
        $("#pattern_error_box").show();
277
        $("#pattern_errors").html( error_msg );
278
        $("#displayexample").hide();
279
       // alert( MSG_PATTERN_TEST_FAILED.format(error_msg) );
281
        return false;
280
        return false;
281
    } else {
282
        $("#pattern_error_box").hide();
283
        $("#pattern_errors").html("");
282
    }
284
    }
283
285
284
    var custompattern = 0;
286
    var custompattern = 0;
Lines 382-388 function saveAdvancedPattern() { Link Here
382
function show_page_1() {
384
function show_page_1() {
383
    $("#page_1").show();
385
    $("#page_1").show();
384
    $("#page_2").hide();
386
    $("#page_2").hide();
385
    $("#page_number").text("1/2");
386
}
387
}
387
388
388
function show_page_2() {
389
function show_page_2() {
Lines 615-625 $(document).ready(function() { Link Here
615
        });
616
        });
616
    }
617
    }
617
618
618
    $("#mana_search").hide();
619
    //$("#mana_search").hide();
619
620
620
    show_page_1();
621
    //show_page_1();
622
    testPredictionPattern();
621
    $("#subscription_add_form").on("submit",function(){
623
    $("#subscription_add_form").on("submit",function(){
622
        return Check_page2();
624
        return Check_page();
623
    });
625
    });
624
    $("#vendor_search").on("click",function(e){
626
    $("#vendor_search").on("click",function(e){
625
        e.preventDefault();
627
        e.preventDefault();
Lines 665-672 $(document).ready(function() { Link Here
665
        e.preventDefault();
667
        e.preventDefault();
666
        saveAdvancedPattern();
668
        saveAdvancedPattern();
667
    });
669
    });
668
    $("#testpatternbutton").on("click",function(e){
670
    $("#frequency, #acqui_date, #nextacquidate, #numberpattern, #moreoptionst input").on("change input",function(e){
669
        e.preventDefault();
671
        console.log("trig");
672
        //e.preventDefault();
673
        numberpatternload();
670
        testPredictionPattern();
674
        testPredictionPattern();
671
    });
675
    });
672
    $('#save-subscription').on("click", function(e){
676
    $('#save-subscription').on("click", function(e){
673
- 

Return to bug 22779