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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-21 / +18 lines)
Lines 209-215 Link Here
209
                                                    [% ELSE %]
209
                                                    [% ELSE %]
210
                                                        0
210
                                                        0
211
                                                    [% END %]</td>
211
                                                    [% END %]</td>
212
                                                <td>
212
                                                <td data-code="[% c %]">
213
                                                    [% IF c == undef %]
213
                                                    [% IF c == undef %]
214
                                                        <em>All</em>
214
                                                        <em>All</em>
215
                                                    [% ELSE %]
215
                                                    [% ELSE %]
Lines 221-227 Link Here
221
                                                    [% ELSE %]
221
                                                    [% ELSE %]
222
                                                        0
222
                                                        0
223
                                                    [% END %]</td>
223
                                                    [% END %]</td>
224
                                                <td>
224
                                                <td data-code="[% i %]">
225
                                                    [% IF i == undef %]
225
                                                    [% IF i == undef %]
226
                                                        <em>All</em>
226
                                                        <em>All</em>
227
                                                    [% ELSE %]
227
                                                    [% ELSE %]
Lines 252-258 Link Here
252
                                                    [% END %]
252
                                                    [% END %]
253
                                                </td>
253
                                                </td>
254
                                                <td>[% issuelength | html %]</td>
254
                                                <td>[% issuelength | html %]</td>
255
                                                <td>
255
                                                <td data-code="[% daysmode %]">
256
                                                    [% SWITCH daysmode %]
256
                                                    [% SWITCH daysmode %]
257
                                                    [% CASE 'Calendar' %]<span title="Use the calendar to skip days the library is closed">Skip closed days</span>
257
                                                    [% CASE 'Calendar' %]<span title="Use the calendar to skip days the library is closed">Skip closed days</span>
258
                                                    [% CASE 'Datedue' %]<span title="Use the calendar to push the due date to the next open day">Next open day</span>
258
                                                    [% CASE 'Datedue' %]<span title="Use the calendar to push the due date to the next open day">Next open day</span>
Lines 261-267 Link Here
261
                                                    [% CASE %]<span title="Use the system preference 'useDaysMode' as a default value">Default</span>
261
                                                    [% CASE %]<span title="Use the system preference 'useDaysMode' as a default value">Default</span>
262
                                                    [% END %]
262
                                                    [% END %]
263
                                                </td>
263
                                                </td>
264
                                                <td>
264
                                                <td data-code="[% lengthunit %]">
265
                                                    [% IF ( lengthunit == 'days' ) %]
265
                                                    [% IF ( lengthunit == 'days' ) %]
266
                                                        <span>Days</span>
266
                                                        <span>Days</span>
267
                                                    [% ELSIF ( lengthunit == 'hours') %]
267
                                                    [% ELSIF ( lengthunit == 'hours') %]
Lines 270-276 Link Here
270
                                                        <span>Undefined</span>
270
                                                        <span>Undefined</span>
271
                                                    [% END %]
271
                                                    [% END %]
272
                                                </td>
272
                                                </td>
273
                                                <td>
273
                                                <td data-code="[% hardduedatecompare %]">
274
                                                  [% IF ( hardduedate ) %]
274
                                                  [% IF ( hardduedate ) %]
275
                                                    [% IF ( hardduedatecompare == '-1' ) %]
275
                                                    [% IF ( hardduedatecompare == '-1' ) %]
276
                                                      before [% hardduedate | $KohaDates %]
276
                                                      before [% hardduedate | $KohaDates %]
Lines 314-320 Link Here
314
                                                [% END %]
314
                                                [% END %]
315
                                                <td>[% renewalperiod | html %]</td>
315
                                                <td>[% renewalperiod | html %]</td>
316
                                                <td>[% norenewalbefore | html %]</td>
316
                                                <td>[% norenewalbefore | html %]</td>
317
                                                <td>
317
                                                <td data-code="[%- IF auto_renew -%]yes[%- ELSE -%]no[%- END -%]">
318
                                                    [% IF auto_renew %]
318
                                                    [% IF auto_renew %]
319
                                                        <span>Yes</span>
319
                                                        <span>Yes</span>
320
                                                    [% ELSE %]
320
                                                    [% ELSE %]
Lines 344-350 Link Here
344
                                                        <span>Unlimited</span>
344
                                                        <span>Unlimited</span>
345
                                                    [% END %]
345
                                                    [% END %]
346
                                                </td>
346
                                                </td>
347
                                                <td>
347
                                                <td data-code="[% onshelfholds %]">
348
                                                    [% IF onshelfholds == 1 %]
348
                                                    [% IF onshelfholds == 1 %]
349
                                                        <span>Yes</span>
349
                                                        <span>Yes</span>
350
                                                    [% ELSIF onshelfholds == 2 %]
350
                                                    [% ELSIF onshelfholds == 2 %]
Lines 353-359 Link Here
353
                                                        <span>If any unavailable</span>
353
                                                        <span>If any unavailable</span>
354
                                                    [% END %]
354
                                                    [% END %]
355
                                                </td>
355
                                                </td>
356
                                                <td>
356
                                                <td data-code="[% opacitemholds %]">
357
                                                    [% IF opacitemholds == 'F'%]
357
                                                    [% IF opacitemholds == 'F'%]
358
                                                        <span>Force</span>
358
                                                        <span>Force</span>
359
                                                    [% ELSIF opacitemholds == 'Y'%]
359
                                                    [% ELSIF opacitemholds == 'Y'%]
Lines 363-369 Link Here
363
                                                    [% END %]
363
                                                    [% END %]
364
                                                </td>
364
                                                </td>
365
                                                [% IF Koha.Preference('ArticleRequests') %]
365
                                                [% IF Koha.Preference('ArticleRequests') %]
366
                                                <td>
366
                                                <td data-code="[% article_requests %]">
367
                                                    [% IF article_requests == 'no' %]
367
                                                    [% IF article_requests == 'no' %]
368
                                                        <span>No</span>
368
                                                        <span>No</span>
369
                                                    [% ELSIF article_requests == 'yes' %]
369
                                                    [% ELSIF article_requests == 'yes' %]
Lines 379-385 Link Here
379
                                                [% IF Koha.Preference('UseRecalls') %]
379
                                                [% IF Koha.Preference('UseRecalls') %]
380
                                                    <td>[% recalls_allowed | html %]</td>
380
                                                    <td>[% recalls_allowed | html %]</td>
381
                                                    <td>[% recalls_per_record | html %]</td>
381
                                                    <td>[% recalls_per_record | html %]</td>
382
                                                    <td>
382
                                                    <td data-code="[% on_shelf_recalls %]">
383
                                                        [% IF on_shelf_recalls == 'all' %]
383
                                                        [% IF on_shelf_recalls == 'all' %]
384
                                                            <span>If all unavailable</span>
384
                                                            <span>If all unavailable</span>
385
                                                        [% ELSE %]
385
                                                        [% ELSE %]
Lines 1462-1469 Link Here
1462
                $('#default-circulation-rules td').removeClass('highlighted-row');
1462
                $('#default-circulation-rules td').removeClass('highlighted-row');
1463
                $(this).parent().parent().find("td").each(function (i) {
1463
                $(this).parent().parent().find("td").each(function (i) {
1464
                    $(this).addClass('highlighted-row');
1464
                    $(this).addClass('highlighted-row');
1465
                    itm = $(this).text();
1465
                    itm_code = $(this).data('code');
1466
                    itm = itm.replace(/^\s*|\s*$/g,'');
1466
                    itm_text = $(this).text();
1467
                    itm_text = itm_text.replace(/^\s*|\s*$/g,'');
1467
                    var current_column = $("#edit_row td:eq("+i+")");
1468
                    var current_column = $("#edit_row td:eq("+i+")");
1468
                    if ( i == 3 ) {
1469
                    if ( i == 3 ) {
1469
                        // specific processing for the Note column
1470
                        // specific processing for the Note column
Lines 1476-1482 Link Here
1476
                        if (typeof select_value === 'undefined'){
1477
                        if (typeof select_value === 'undefined'){
1477
                            select_value = '-1';
1478
                            select_value = '-1';
1478
                        }else {
1479
                        }else {
1479
                            input_value = itm.split(' ')[1];
1480
                            input_value = itm_text.split(' ')[1];
1480
                        }
1481
                        }
1481
                        $(current_column).find("input[type='text']").val(input_value);
1482
                        $(current_column).find("input[type='text']").val(input_value);
1482
                        $(current_column).find("select").val(select_value);
1483
                        $(current_column).find("select").val(select_value);
Lines 1486-1503 Link Here
1486
                        $('#cap_fine_to_replacement_price').prop('checked', cap_fine_to_replacement_price.is(':checked') );
1487
                        $('#cap_fine_to_replacement_price').prop('checked', cap_fine_to_replacement_price.is(':checked') );
1487
                        $('#overduefinescap').prop('disabled', cap_fine_to_replacement_price.is(':checked') );
1488
                        $('#overduefinescap').prop('disabled', cap_fine_to_replacement_price.is(':checked') );
1488
                    } else {
1489
                    } else {
1489
                        $(current_column).find("input[type='text']").val(itm);
1490
                        $(current_column).find("input[type='text']").val(itm_text);
1490
                        // unformat prices
1491
                        // unformat prices
1491
                        $(current_column).find("input[inputmode='decimal']").each(function() {
1492
                        $(current_column).find("input[inputmode='decimal']").each(function() {
1492
                          $(this).val(itm.unformat_price());
1493
                          $(this).val(itm.unformat_price());
1493
                        });
1494
                        });
1494
                        // select the corresponding option
1495
                        // select the corresponding option
1495
                        $(current_column).find("select option").each(function(){
1496
                        $(current_column).find("select option").each(function(){
1496
                            opt = $(this).text().toLowerCase();
1497
                            opt = $(this).attr('value');
1497
                            opt = opt.replace(/ \(\w*?\)$/,""); //If option is a parent, compare without (All) or the equivalent in other languages
1498
                            if ( opt == itm_code ) {
1498
                            itm = itm.replace(/.*->(.*)/,"$1"); //If item type is part of a group we need to clear the parent description
1499
                            opt = opt.replace(/^\s*|\s*$/g,'');
1500
                            if ( opt == itm.toLowerCase() ) {
1501
                                $(this).attr('selected', 'selected');
1499
                                $(this).attr('selected', 'selected');
1502
                            }
1500
                            }
1503
                        });
1501
                        });
Lines 1520-1526 Link Here
1520
                            //     - "Holds per record (count)"
1518
                            //     - "Holds per record (count)"
1521
                            // The value is "Unlimited" (or an equivalent translated string)
1519
                            // The value is "Unlimited" (or an equivalent translated string)
1522
                            // an it should be set to an empty string
1520
                            // an it should be set to an empty string
1523
                            if( !((parseFloat(itm) == parseInt(itm)) && !isNaN(itm)) ) {
1521
                            if( !((parseFloat(itm_text) == parseInt(itm_text)) && !isNaN(itm_text)) ) {
1524
                                $(current_column).find("input[type='text']").val("");
1522
                                $(current_column).find("input[type='text']").val("");
1525
                            }
1523
                            }
1526
                        }
1524
                        }
1527
- 

Return to bug 34269