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

(-)a/acqui/ajax-getauthvaluedropbox.pl (-1 / +1 lines)
Lines 60-66 $default = C4::Charset::NormalizeString($default); Link Here
60
binmode STDOUT, ':encoding(UTF-8)';
60
binmode STDOUT, ':encoding(UTF-8)';
61
print $input->header(-type => 'text/plain', -charset => 'UTF-8');
61
print $input->header(-type => 'text/plain', -charset => 'UTF-8');
62
my $avs = GetAuthvalueDropbox($category, $default);
62
my $avs = GetAuthvalueDropbox($category, $default);
63
my $html = qq|<select id="$name", name="$name">|;
63
my $html = qq|<select id="$name" name="$name">|;
64
for my $av ( @$avs ) {
64
for my $av ( @$avs ) {
65
    if ( $av->{default} ) {
65
    if ( $av->{default} ) {
66
        $html .= qq|<option value="$av->{value}" selected="selected">$av->{label}</option>|;
66
        $html .= qq|<option value="$av->{value}" selected="selected">$av->{label}</option>|;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt (-47 / +91 lines)
Lines 7-12 Link Here
7
 &rsaquo; Batch list
7
 &rsaquo; Batch list
8
[% END %]
8
[% END %]
9
</title>
9
</title>
10
[% INCLUDE 'greybox.inc' %]
10
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
11
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
11
[% INCLUDE 'doc-head-close.inc' %]
12
[% INCLUDE 'doc-head-close.inc' %]
12
[% INCLUDE 'datatables.inc' %]
13
[% INCLUDE 'datatables.inc' %]
Lines 17-22 Link Here
17
    [% IF (dateformat == 'metric') %]
18
    [% IF (dateformat == 'metric') %]
18
        dt_add_type_uk_date();
19
        dt_add_type_uk_date();
19
    [% END %]
20
    [% END %]
21
20
    $(document).ready(function() {
22
    $(document).ready(function() {
21
        var srlt = $("#files").dataTable($.extend(true, {}, dataTablesDefaults, {
23
        var srlt = $("#files").dataTable($.extend(true, {}, dataTablesDefaults, {
22
            "aoColumnDefs": [
24
            "aoColumnDefs": [
Lines 28-42 Link Here
28
        $("select[name='budget_id']").change(function(){
30
        $("select[name='budget_id']").change(function(){
29
            var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat');
31
            var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat');
30
            var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat');
32
            var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat');
31
            var destination_sort1 = $(this).siblings('span.sort1').find('input[name="sort1"]');
33
            var destination_sort1 = $(this).parents('fieldset').find('li.sort1').find('input[name="sort1"]');
32
            var sort1 = $(destination_sort1).val();
34
            var sort1 = $(destination_sort1).val() || "";
33
            if ( destination_sort1.length < 1 ) {
35
            if ( destination_sort1.length < 1 ) {
34
                destination_sort1 = $(this).siblings('span.sort1').find('select[name="sort1"]');
36
                destination_sort1 = $(this).parents('fieldset').find('li.sort1 > select[name="sort1"]');
35
            }
37
            }
36
            var destination_sort2 = $(this).siblings('span.sort2').find('input[name="sort2"]');
38
            var destination_sort2 = $(this).parents('fieldset').find('li.sort2').find('input[name="sort2"]');
37
            var sort2 = $(destination_sort2).val();
39
            var sort2 = $(destination_sort2).val() || "";
38
            if ( destination_sort2.length < 1 ) {
40
            if ( destination_sort2.length < 1 ) {
39
                destination_sort2 = $(this).siblings('span.sort2').find('select[name="sort2"]');
41
                destination_sort2 = $(this).parents('fieldset').find('li.sort2').find('select[name="sort2"]');
40
            }
42
            }
41
            getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 );
43
            getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 );
42
44
Lines 64-76 Link Here
64
            $(this).parent().siblings('li').find('input[name="sort2"]').attr('name', 'all_sort2');
66
            $(this).parent().siblings('li').find('input[name="sort2"]').attr('name', 'all_sort2');
65
        } );
67
        } );
66
68
69
        $("#records_to_import fieldset.rows ol").hide();
67
        $('input:checkbox[name="import_record_id"]').change(function(){
70
        $('input:checkbox[name="import_record_id"]').change(function(){
71
            var container = $(this).parents("fieldset");
68
            if ( $(this).is(':checked') ) {
72
            if ( $(this).is(':checked') ) {
69
                $(this).parent().addClass("selected");
73
                $(container).addClass("selected");
70
                $(this).parent().removeClass("unselected");
74
                $(container).removeClass("unselected");
75
                $(container).find("ol").toggle();
71
            } else {
76
            } else {
72
                $(this).parent().addClass("unselected");
77
                $(container).addClass("unselected");
73
                $(this).parent().removeClass("selected");
78
                $(container).removeClass("selected");
79
                $(container).find("ol").toggle();
74
            }
80
            }
75
        } );
81
        } );
76
82
Lines 89-94 Link Here
89
            return false;
95
            return false;
90
        });
96
        });
91
97
98
        $("#Aform").on("submit", function(){
99
            if ( $("input:checkbox[name='import_record_id']:checked").length < 1 ) {
100
                alert("There is no record selected");
101
                return false;
102
            }
103
104
            var error = 0;
105
            $("input:checkbox[name='import_record_id']:checked").parents('fieldset').find('input[name="quantity"]').each(function(){
106
                if ( $(this).val().length < 1 || isNaN( $(this).val() ) ) {
107
                    error++;
108
                }
109
            });
110
            if ( error > 0 ) {
111
                alert(error + " quantity values are not filled or not a number");
112
                return false;
113
            }
114
115
            return disableUnchecked($(this));
116
        });
92
    });
117
    });
93
118
94
    function disableUnchecked(form){
119
    function disableUnchecked(form){
Lines 96-102 Link Here
96
            $(this).find('select').attr('disabled', 'disabled');
121
            $(this).find('select').attr('disabled', 'disabled');
97
            $(this).find('input').attr('disabled', 'disabled');
122
            $(this).find('input').attr('disabled', 'disabled');
98
        });
123
        });
99
        form.submit();
124
        return 1;
100
    }
125
    }
101
//]]>
126
//]]>
102
</script>
127
</script>
Lines 114-122 Link Here
114
                    ([% file_name %] staged on [% upload_timestamp %])
139
                    ([% file_name %] staged on [% upload_timestamp %])
115
                </h1>
140
                </h1>
116
                <div>
141
                <div>
142
                  <div id="records_to_import">
117
                    <span class="checkall"><a id="checkAll" href="#">Check All</a></span>
143
                    <span class="checkall"><a id="checkAll" href="#">Check All</a></span>
118
                    <span class="uncheckall"><a id="unCheckAll" href="#">Uncheck All</a></span>
144
                    <span class="uncheckall"><a id="unCheckAll" href="#">Uncheck All</a></span>
119
                    <form action="/cgi-bin/koha/acqui/addorderiso2709.pl" method="post" id="Aform" onsubmit="disableUnchecked(this); return false;">
145
                    <form action="/cgi-bin/koha/acqui/addorderiso2709.pl" method="post" id="Aform">
120
                        <input type="hidden" name="op" value="import_records"/>
146
                        <input type="hidden" name="op" value="import_records"/>
121
                        <input type="hidden" name="basketno" value="[% basketno %]" />
147
                        <input type="hidden" name="basketno" value="[% basketno %]" />
122
                        <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
148
                        <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
Lines 128-157 Link Here
128
                        [% END %]
154
                        [% END %]
129
155
130
                        [% FOREACH biblio IN biblio_list %]
156
                        [% FOREACH biblio IN biblio_list %]
131
                        <div class="biblio unselected" style="border-radius: 5px 5px; -moz-border-radius: 5px; padding: 5px; margin:5px; border-style : solid; border-color : grey; border-width:1px;">
157
                        <fieldset class="biblio unselected rows">
132
                            <input type="checkbox" name="import_record_id" id="record_[% biblio.import_record_id %]" value="[% biblio.import_record_id %]" />
158
                          <legend>
133
                            <input type="hidden" value="[% biblio.rrp %]" name="rrp" />
159
                            <label for="record_[% biblio.import_record_id %]" style="width:auto;">
134
                            <label for="record_[% biblio.import_record_id %]"><span class="citation" style="font-weight:bold;">[% biblio.citation %]</span></label>
160
                              <input type="checkbox" name="import_record_id" id="record_[% biblio.import_record_id %]" value="[% biblio.import_record_id %]" />
135
                            <span class="match" style="display:block;">[% biblio.overlay_status %]</span>
161
                              <span class="citation">[% biblio.citation %]</span>
136
                            [% IF ( biblio.match_biblionumber ) %]
162
                            </label>
137
                                Matches biblio [% biblio.match_biblionumber %] (score = [% biblio.match_score %]): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.match_biblionumber %]">[% biblio.match_citation %]</a>
163
                            ( Show <a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% biblio.import_record_id %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% biblio.import_record_id %]" title="MARC" rel="gb_page_center[600,500]">Card</a> )
138
                            [% END %]
164
139
                            <span class="quantity" style="display:block;">
165
                          </legend>
140
                                Quantity: <input type="text" value="[% biblio.quantity %]" name="quantity" />
166
                          <input type="hidden" value="[% biblio.rrp %]" name="rrp" />
141
                            </span>
167
                          <ol>
142
                            <span class="price" style="display:block;">
168
                            <li class="status">
143
                                Price: <input type="text" value="[% biblio.price %]" name="price" />
169
                              <span class="match">
144
                            </span>
170
                                [% IF biblio.overlay_status == 'no_match' %]
145
                            <span class="discount" style="display:block;">
171
                                    There is no matching biblio for this records.
146
                                Discount: <input type="text" value="[% biblio.discount %]" name="discount" />
172
                                [% ELSE %]
147
                            </span>
173
                                    This record matches existing biblio.
148
                            <span class="budget" style="display:block;">
174
                                [% END %]
175
                                [% IF ( biblio.match_biblionumber ) %]
176
                                  Matches biblio [% biblio.match_biblionumber %] (score = [% biblio.match_score %]): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.match_biblionumber %]">[% biblio.match_citation %]</a>
177
                                [% END %]
178
                              </span>
179
                            </li>
180
                            <li class="quantity">
181
                                <label for="quantity_record_[% biblio.import_record_id %]" class="required">Quantity: </label>
182
                                <input id="quantity_record_[% biblio.import_record_id %]" type="text" value="[% biblio.quantity %]" name="quantity" />
183
                            </li>
184
                            <li class="price">
185
                                <label for="price_record_[% biblio.import_record_id %]">Price: </label>
186
                                <input id="price_record_[% biblio.import_record_id %]" type="text" value="[% biblio.price %]" name="price" />
187
                            </li>
188
                            <li class="discount">
189
                                <label for="discount_record_[% biblio.import_record_id %]">Discount: </label>
190
                                <input id="discount_record_[% biblio.import_record_id %]" type="text" value="[% biblio.discount %]" name="discount" />
191
                            </li>
192
                            <li class="budget">
193
                                <label for="fund_record_[% biblio.import_record_id %]">Fund: </label>
149
                                [% IF ( close ) %]
194
                                [% IF ( close ) %]
150
                                <span class="label">Budget: </span>
195
                                  <input type="hidden" size="20" name="budget_id" value="[% budget_id %]" />[% Budget_name %]
151
                                    <input type="hidden" size="20" name="budget_id" value="[% budget_id %]" />[% Budget_name %]
152
                                [% ELSE %]
196
                                [% ELSE %]
153
                                <label for="budget_id">Budget: </label>
197
                                  <select id="fund_record_[% biblio.import_record_id %]" size="1" name="budget_id">
154
                                <select size="1" name="budget_id">
155
                                    <option value=""></option>
198
                                    <option value=""></option>
156
                                    [% FOREACH budget IN budget_loop %]
199
                                    [% FOREACH budget IN budget_loop %]
157
                                        [% IF ( budget.b_id == biblio.budget_id ) %]
200
                                        [% IF ( budget.b_id == biblio.budget_id ) %]
Lines 160-179 Link Here
160
                                            <option value="[% budget.b_id %]" data-sort1-authcat="[% budget.b_sort1_authcat %]" data-sort2-authcat="[% budget.b_sort2_authcat %]">[% budget.b_txt %]</option>
203
                                            <option value="[% budget.b_id %]" data-sort1-authcat="[% budget.b_sort1_authcat %]" data-sort2-authcat="[% budget.b_sort2_authcat %]">[% budget.b_txt %]</option>
161
                                        [% END %]
204
                                        [% END %]
162
                                    [% END %]
205
                                    [% END %]
163
                                </select>
206
                                  </select>
164
                                [% END %]
207
                                [% END %]
165
                                <span class="sort1">
208
                            </li>
166
                                    <label for="sort1">Planning value1: </label>
209
                            <li class="sort1">
167
                                    <input type="text" id="sort1" size="20" name="sort1" value="[% biblio.sort1 %]" />
210
                                <label for="sort1_record_[% biblio.import_record_id %]">Planning value1: </label>
168
                                </span>
211
                                <input id="sort1_record_[% biblio.import_record_id %]" type="text" id="sort1" size="20" name="sort1" value="[% biblio.sort1 %]" />
169
                                <span class="sort2">
212
                            </li>
170
                                    <label for="sort2">Planning value2: </label>
213
                            <li class="sort2">
171
                                    <input type="text" id="sort2" size="20" name="sort2" value="[% biblio.sort2 %]" />
214
                                <label for="sort2_record_[% biblio.import_record_id %]">Planning value2: </label>
172
                                </span>
215
                                <input id="sort2_record_[% biblio.import_record_id %]" type="text" id="sort2" size="20" name="sort2" value="[% biblio.sort2 %]" />
173
                            </span>
216
                            </li>
174
                        </div>
217
                          </ol>
218
                        </fieldset>
175
                        [% END %]
219
                        [% END %]
176
                        <div>
220
                      </div>
221
                      <div id="import_all">
177
                        <h2>Import All</h2>
222
                        <h2>Import All</h2>
178
                        <p>Import all the lines in the basket with the following parameters:</p>
223
                        <p>Import all the lines in the basket with the following parameters:</p>
179
224
180
- 

Return to bug 7180