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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt (-28 / +15 lines)
Lines 77-98 function Check_page2(){ Link Here
77
          return false;
77
          return false;
78
      }
78
      }
79
    [% END %]
79
    [% END %]
80
    if($("#frequency").val().length == 0){
81
        alert(_("You must choose a frequency"));
82
        return false;
83
    }
84
    if($("input[name='startdate']").val().length == 0){
85
        alert(_("You must choose a start date"));
86
        return false;
87
    }
88
    if($("#sublength").val().length == 0 && $("input[name='enddate']").val().length == 0){
80
    if($("#sublength").val().length == 0 && $("input[name='enddate']").val().length == 0){
89
        alert(_("You must choose a subscription length or an end date."));
81
        alert(_("You must choose a subscription length or an end date."));
90
        return false;
82
        return false;
91
    }
83
    }
92
    if($("#numberpattern").val().length == 0){
93
        alert(_("You must choose a numbering pattern"));
94
        return false;
95
    }
96
    if(advancedpatternlocked == 0){
84
    if(advancedpatternlocked == 0){
97
        alert(_("You have modified the advanced prediction pattern. Please save your work or cancel modifications."));
85
        alert(_("You have modified the advanced prediction pattern. Please save your work or cancel modifications."));
98
        return false;
86
        return false;
Lines 109-115 function frequencyload(){ Link Here
109
    $.getJSON("subscription-frequency.pl",{"frequency_id":document.f.frequency.value,ajax:'true'},
97
    $.getJSON("subscription-frequency.pl",{"frequency_id":document.f.frequency.value,ajax:'true'},
110
        function(freqdata){
98
        function(freqdata){
111
            globalfreqdata=freqdata;
99
            globalfreqdata=freqdata;
112
            if ( globalfreqdata.unit.length == 0 ) {
100
            if ( globalfreqdata.unit && globalfreqdata.unit.length == 0 ) {
113
                var option = $("#subtype option[value='issues']");
101
                var option = $("#subtype option[value='issues']");
114
                $(option).attr('selected', 'selected');
102
                $(option).attr('selected', 'selected');
115
                $("#subtype option[value!='issues']").attr('disabled', 'disabled')
103
                $("#subtype option[value!='issues']").attr('disabled', 'disabled')
Lines 473-479 $(document).ready(function() { Link Here
473
    <div id="bd">
461
    <div id="bd">
474
        <div class="yui-g">
462
        <div class="yui-g">
475
            <h1>[% IF ( modify ) %] Modify subscription for <i>[% bibliotitle |html %]</i>[% ELSE %]Add a new subscription[% END %] (<span id="page_number">1/2</span>)</h1>
463
            <h1>[% IF ( modify ) %] Modify subscription for <i>[% bibliotitle |html %]</i>[% ELSE %]Add a new subscription[% END %] (<span id="page_number">1/2</span>)</h1>
476
            <form method="post" name="f" action="/cgi-bin/koha/serials/subscription-add.pl">
464
            <form method="post" name="f" action="/cgi-bin/koha/serials/subscription-add.pl" class="validated" onsubmit="return Check_page2();" >
477
                [% IF ( modify ) %]
465
                [% IF ( modify ) %]
478
                    <input type="hidden" name="op" value="modsubscription" />
466
                    <input type="hidden" name="op" value="modsubscription" />
479
                    <input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />
467
                    <input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />
Lines 634-642 $(document).ready(function() { Link Here
634
                                <legend>Serials planning</legend>
622
                                <legend>Serials planning</legend>
635
                                <ol>
623
                                <ol>
636
                                    <li>
624
                                    <li>
637
                                        <label for="firstacquidate">First issue publication date: (*)</label>
625
                                        <label for="firstacquidate" class="required">First issue publication date:</label>
638
                                        [% UNLESS (more_than_one_serial) %]
626
                                        [% UNLESS (more_than_one_serial) %]
639
                                          <input type="text" size="10" id="acqui_date" name="firstacquidate" value="[% firstacquidate | $KohaDates %]" class="datepicker" readonly="readonly"/>
627
                                          <input type="text" size="10" id="acqui_date" name="firstacquidate" value="[% firstacquidate | $KohaDates %]" class="datepicker required" required="required" />
640
                                        [% ELSE %]
628
                                        [% ELSE %]
641
                                          [% firstacquidate | $KohaDates %]
629
                                          [% firstacquidate | $KohaDates %]
642
                                          <input type="hidden" size="10" id="acqui_date" name="firstacquidate" value="[% firstacquidate | $KohaDates %]"/>
630
                                          <input type="hidden" size="10" id="acqui_date" name="firstacquidate" value="[% firstacquidate | $KohaDates %]"/>
Lines 645-656 $(document).ready(function() { Link Here
645
                                    [% IF (more_than_one_serial) %]
633
                                    [% IF (more_than_one_serial) %]
646
                                      <li>
634
                                      <li>
647
                                        <label for="nextacquidate">Next issue publication date:</label>
635
                                        <label for="nextacquidate">Next issue publication date:</label>
648
                                        <input type="text" size="10" id="nextacquidate" name="nextacquidate" value="[% nextacquidate | $KohaDates %]" class="datepicker" readonly="readonly"/>
636
                                        <input type="text" size="10" id="nextacquidate" name="nextacquidate" value="[% nextacquidate | $KohaDates %]" class="datepicker" />
649
                                      </li>
637
                                      </li>
650
                                    [% END %]
638
                                    [% END %]
651
                                    <li>
639
                                    <li>
652
                                        <label for="frequency">Frequency: (*)</label>
640
                                        <label for="frequency" class="required">Frequency:</label>
653
                                        <select name="frequency" size="1" id="frequency">
641
                                        <select name="frequency" size="1" id="frequency" class="required" required="required">
654
                                            <option value="">-- please choose --</option>
642
                                            <option value="">-- please choose --</option>
655
                                            [% FOREACH frequency IN frequencies %]
643
                                            [% FOREACH frequency IN frequencies %]
656
                                                [% IF (frequency.selected) %]
644
                                                [% IF (frequency.selected) %]
Lines 680-695 $(document).ready(function() { Link Here
680
                                        <input type="hidden" name="issuelengthcount">
668
                                        <input type="hidden" name="issuelengthcount">
681
                                    </li>
669
                                    </li>
682
                                    <li>
670
                                    <li>
683
                                        <label for="startdate"> Subscription start date: (*)</label>
671
                                        <label for="startdate" class="required"> Subscription start date:</label>
684
                                        <input type="text" size="10" id="from" name="startdate" value="[% startdate | $KohaDates %]" class="datepickerfrom" readonly="readonly"/>
672
                                        <input type="text" size="10" id="from" name="startdate" value="[% startdate | $KohaDates %]" class="datepickerfrom required" required="required" />
685
                                    </li>
673
                                    </li>
686
                                    <li>
674
                                    <li>
687
                                        <label for="enddate">Subscription end date:</label>
675
                                        <label for="enddate">Subscription end date:</label>
688
                                        <input type="text" size="10" id="to" name="enddate" value="[% enddate | $KohaDates %]" class="datepickerto" readonly="readonly"/>
676
                                        <input type="text" size="10" id="to" name="enddate" value="[% enddate | $KohaDates %]" class="datepickerto" />
689
                                    </li>
677
                                    </li>
690
                                    <li>
678
                                    <li>
691
                                        <label for="numberpattern">Numbering pattern:</label>
679
                                        <label for="numberpattern" class="required">Numbering pattern:</label>
692
                                        <select name="numbering_pattern" size="1" id="numberpattern">
680
                                        <select name="numbering_pattern" size="1" id="numberpattern" class="required" required="required">
693
                                            <option value="">-- please choose --</option>
681
                                            <option value="">-- please choose --</option>
694
                                            [% FOREACH numberpattern IN numberpatterns %]
682
                                            [% FOREACH numberpattern IN numberpatterns %]
695
                                                [% IF (numberpattern.selected) %]
683
                                                [% IF (numberpattern.selected) %]
Lines 751-758 $(document).ready(function() { Link Here
751
                                    <li><a style="cursor:pointer" onclick="toggleAdvancedPattern();">Show/Hide advanced pattern</a></li>
739
                                    <li><a style="cursor:pointer" onclick="toggleAdvancedPattern();">Show/Hide advanced pattern</a></li>
752
                                    <div id="advancedpredictionpattern" style="display:none">
740
                                    <div id="advancedpredictionpattern" style="display:none">
753
                                      <li>
741
                                      <li>
754
                                        <label for="patternname">Pattern name: (*)</label>
742
                                        <label for="patternname" class="required">Pattern name:</label>
755
                                        <input id="patternname" name="patternname" type="text" readonly="readonly" />
743
                                        <input id="patternname" name="patternname" type="text" readonly="readonly" class="required" required="required" />
756
                                      </li>
744
                                      </li>
757
                                      <li>
745
                                      <li>
758
                                        <label for="numberingmethod">Numbering formula:</label>
746
                                        <label for="numberingmethod">Numbering formula:</label>
Lines 838-844 $(document).ready(function() { Link Here
838
                            <fieldset class="action">
826
                            <fieldset class="action">
839
                                <input type="button" value="<< Previous" onclick="show_page_1();" style="float:left;"/>
827
                                <input type="button" value="<< Previous" onclick="show_page_1();" style="float:left;"/>
840
                                <input id="testpatternbutton" type="button" value="Test prediction pattern" onclick="testPredictionPattern();" />
828
                                <input id="testpatternbutton" type="button" value="Test prediction pattern" onclick="testPredictionPattern();" />
841
                                <input type="button" value="Save subscription" onclick="if (Check_page2()) submit();" style="float:right;" accesskey="w" />
829
                                <input type="submit" value="Save subscription" style="float:right;" accesskey="w" />
842
                            </fieldset>
830
                            </fieldset>
843
                        </div>
831
                        </div>
844
                    </div>
832
                    </div>
845
- 

Return to bug 11386