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

(-)a/installer/data/mysql/atomicupdate/bug12310_added_DigitSeparator.sql (+2 lines)
Line 0 Link Here
1
INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
2
('DigitSeparator',  ',.', NULL ,  'The separator between entire and decimal part',  'Free');
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 138-143 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
138
('DefaultToLoggedInLibraryNoticesSlips',  '0', NULL ,  'If enabled,slips and notices editor will default to the logged in library''s rules, rather than the ''all libraries'' rules.',  'YesNo'),
138
('DefaultToLoggedInLibraryNoticesSlips',  '0', NULL ,  'If enabled,slips and notices editor will default to the logged in library''s rules, rather than the ''all libraries'' rules.',  'YesNo'),
139
('DefaultToLoggedInLibraryOverdueTriggers',  '0', NULL ,  'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.',  'YesNo'),
139
('DefaultToLoggedInLibraryOverdueTriggers',  '0', NULL ,  'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.',  'YesNo'),
140
('delimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'),
140
('delimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'),
141
('DigitSeparator',  '.,', NULL ,  'The separator between entire and decimal part',  'Free'),
141
('Display856uAsImage','OFF','OFF|Details|Results|Both','Display the URI in the 856u field as an image, the corresponding Staff Client XSLT option must be on','Choice'),
142
('Display856uAsImage','OFF','OFF|Details|Results|Both','Display the URI in the 856u field as an image, the corresponding Staff Client XSLT option must be on','Choice'),
142
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
143
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
143
('displayFacetCount','0',NULL,NULL,'YesNo'),
144
('displayFacetCount','0',NULL,NULL,'YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/price-conversion-message.inc (+14 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% INCLUDE 'prices.inc' %]
3
4
    <span class="hint">
5
        [% IF Koha.Preference('DigitSeparator') %]Please use any of the following character(s) "[% Koha.Preference('DigitSeparator').substr(0,1) %]" as separator : ex "XX[% Koha.Preference('DigitSeparator').substr(0,1) %]XX".</span>
6
            [% IF CAN_user_parameters %]
7
                <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=DigitSeparator">Edit Separator </a>
8
            [% END %]
9
        [% ELSE %]
10
            [% IF CAN_user_parameters %]
11
                No Digit separator defined <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=DigitSeparator">Chose one</a>
12
            [% END %]
13
       [% END %]
14
    </span>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/prices.inc (+25 lines)
Line 0 Link Here
1
[% USE Koha %]
2
<script type="text/javascript">
3
//<![CDATA[
4
5
function isPrice(string){
6
    var reg ="[% Koha.Preference('DigitSeparator') %]";
7
    reg = "[0-9]{1,}(["+reg+"][0-9]{1,}|)";
8
    var prix = new RegExp(reg);
9
    if (!prix.test(string)) {
10
        return false;
11
    }
12
    return true;
13
}
14
15
function Price_from_string(string){
16
    if (!isPrice(string)) {
17
        return false;
18
    }
19
    string = string.replace(/[^0-9[% Koha.Preference('DigitSeparator') %]]/g, '');
20
    string = string.replace(/[[% Koha.Preference('DigitSeparator') %]]/g, '.');
21
    return string;
22
}
23
24
//]]>
25
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt (-2 / +165 lines)
Lines 1-6 Link Here
1
[% USE KohaDates %]
1
[% USE KohaDates %]
2
[% USE Price %]
2
[% USE Price %]
3
[% SET footerjs = 1 %]
3
[% SET footerjs = 1 %]
4
[% USE Koha %]
5
4
[%- BLOCK action_menu %]
6
[%- BLOCK action_menu %]
5
    <div class="dropdown">
7
    <div class="dropdown">
6
        <a class="btn btn-default btn-xs dropdown-toggle" id="budgetmenu_[% block_budget.budget_period_id %]" role="button" data-toggle="dropdown" href="#">
8
        <a class="btn btn-default btn-xs dropdown-toggle" id="budgetmenu_[% block_budget.budget_period_id %]" role="button" data-toggle="dropdown" href="#">
Lines 33-44 Link Here
33
[% END -%]
35
[% END -%]
34
36
35
[% INCLUDE 'doc-head-open.inc' %]
37
[% INCLUDE 'doc-head-open.inc' %]
38
[% INCLUDE 'prices.inc' %]
39
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
36
[% INCLUDE 'doc-head-close.inc' %]
40
[% INCLUDE 'doc-head-close.inc' %]
37
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
41
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
38
[% IF close_form %]
42
[% IF close_form %]
39
    <link href="[% interface %]/lib/jquery/plugins/treetable/stylesheets/jquery.treetable_[% KOHA_VERSION %].css" rel="stylesheet" type="text/css" />
43
    <link href="[% interface %]/lib/jquery/plugins/treetable/stylesheets/jquery.treetable_[% KOHA_VERSION %].css" rel="stylesheet" type="text/css" />
40
[% END %]
44
[% END %]
41
45
46
<script type="text/javascript" src="[% interface %]/[% theme %]/js/acq.js"></script>
47
<script type="text/javascript">
48
// #################################################################################
49
// Javascript
50
// #################################################################################
51
    function CheckDuplicateForm(f){
52
            var ok=1;
53
            var _alertString="";
54
            var alertString="";
55
            if(!(isNotNull(f.budget_period_startdate,1))){
56
              _alertString += "\n- " + _("Start date missing");
57
            }
58
            if (!(isNotNull(f.budget_period_enddate,1))){
59
              _alertString += "\n- " + _("End date missing");
60
            }
61
            if( f.budget_period_startdate > f.budget_period_enddate ) {
62
              _alertString += "\n- " + _("Start date must be before end date");
63
            }
64
            if (!(isNotNull(f.budget_period_description,1))){
65
              _alertString += "\n- " + _("Budget description missing");
66
            }
67
68
            if(_alertString.length==0){
69
              f.submit();
70
            } else {
71
              alertString += _("Form not submitted because of the following problem(s)");
72
              alertString += "\n-----------------------------------------\n";
73
              alertString += _alertString;
74
              alert(alertString);
75
            }
76
    }
77
    function CheckTot(f){
78
        var ok=1;
79
        var _alertString="";
80
        var alertString2;
81
        if (!(isPrice(f.value))) {
82
            _alertString += "\n- " + _("Amount must be a valid number, or empty");
83
        }else{
84
            f.value=Price_from_string(f.value);
85
        }
86
        if (_alertString.length==0) {
87
            return true;
88
        } else {
89
            alertString2  = _("Form not submitted because of the following problem(s)");
90
            alertString2 += "\n------------------------------------------------------------------------------------\n";
91
            alertString2 += _alertString;
92
            alert(alertString2);
93
            return false;
94
        }
95
    }
96
    function Check(f) {
97
            var ok=1;
98
            var _alertString="";
99
            var alertString2;
100
101
            if (!(isNotNull(f.budget_period_startdate,1))) {
102
                    _alertString += "\n- " + _("Start date missing");
103
            }
104
105
            if (!(isNotNull(f.budget_period_enddate,1))) {
106
                    _alertString += "\n- " + _("End date missing");
107
            }
108
109
            if ( f.budget_period_startdate >   f.budget_period_enddate )  {
110
                    _alertString += "\n- " + _("Start date must be before end date");
111
            }
112
113
            if (!(isNotNull(f.budget_period_description,1))) {
114
                    _alertString += "\n- " + _("Description missing");
115
            }
116
117
            if (!(isNum(f.budget_period_total))) {
118
                    _alertString += "\n- " + _("Amount must be a valid number, or empty");
119
            }
120
121
/*
122
			checkBudgetTotal(f) {
123
			}
124
*/
125
126
            if (_alertString.length==0) {
127
                    f.submit();
128
            } else {
129
                    alertString2  = _("Form not submitted because of the following problem(s)");
130
                    alertString2 += "\n------------------------------------------------------------------------------------\n";
131
                    alertString2 += _alertString;
132
                    alert(alertString2);
133
            }
134
    }
135
136
    $(document).ready(function() {
137
        var tabs = $('#budgetsTabs').tabs();
138
        [% IF ( tab ) %]
139
            tabs.tabs("option", "active", [% tab %]);
140
        [% END %]
141
        $("#activeperiodst,#inactiveperiodst").dataTable($.extend(true, {}, dataTablesDefaults, {
142
            "aoColumnDefs": [
143
                { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
144
                { "sType": "title-string", "aTargets" : [ "title-string" ] }
145
            ],
146
            "sPaginationType": "four_button",
147
            'bAutoWidth': false
148
        } ) );
149
150
        [% IF close_form %]
151
          $("#budgeth").dataTable($.extend(true, {}, dataTablesDefaults, {
152
            sDom: "t"
153
          }));
154
          $("#move_form").submit(function(){
155
            var budget_from = "[% budget_period_description %]";
156
            var budget_to = $("#to_budget_period_id").find("option:selected").html();
157
            var alert_message = _("You have chosen to move all unreceived orders from '%s' to '%s'.").format(budget_from, budget_to);
158
            alert_message += "\n" + _("This action cannot be reversed. Do you wish to continue?");
159
            return confirm ( alert_message );
160
          });
161
        [% END %]
162
        [% IF closed %]
163
          var oTable = $("#closed_report").dataTable($.extend(true, {}, dataTablesDefaults, {
164
            // The following is a c/p from aqbudgets.tt and is a candidate for refactoring.
165
            "fnDrawCallback": function ( oSettings ) {
166
                if ( oSettings.aiDisplay.length == 0 )
167
                {
168
                    return;
169
                }
170
171
                var nTrs = $('#closed_report tbody tr');
172
                var iColspan = nTrs[1].getElementsByTagName('td').length;
173
                var sLastGroup = "";
174
                for ( var i=0 ; i<nTrs.length ; i++ )
175
                {
176
                    var iDisplayIndex = oSettings._iDisplayStart + i;
177
                    var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[0];
178
                    if ( sGroup != sLastGroup )
179
                    {
180
                        var nGroup = document.createElement( 'tr' );
181
                        var nCell = document.createElement( 'td' );
182
                        nCell.colSpan = iColspan;
183
                        nCell.className = "group";
184
                        nCell.innerHTML = sGroup;
185
                        nGroup.appendChild( nCell );
186
                        nTrs[i].parentNode.insertBefore( nGroup, nTrs[i] );
187
                        sLastGroup = sGroup;
188
                    }
189
                }
190
            },
191
            "aoColumnDefs": [
192
                { "bVisible": false, "aTargets": [ 0, 1 ] },
193
                { "bSortable": false, "aTargets": ["_all"] }
194
            ],
195
            'bSort': true,
196
            'aaSortingFixed': [[ 1, 'asc' ]],
197
            "bAutoWidth": false,
198
            "sPaginationType": "full_numbers"
199
          }));
200
        [% END %]
201
    });
202
</script>
203
42
<title>
204
<title>
43
    Koha &rsaquo; Administration &rsaquo; Budgets
205
    Koha &rsaquo; Administration &rsaquo; Budgets
44
206
Lines 221-227 Link Here
221
        <!-- ############################## -->
383
        <!-- ############################## -->
222
        <label for="budget_period_total">Total amount: </label>
384
        <label for="budget_period_total">Total amount: </label>
223
        <input type="text" id="budget_period_total" name="budget_period_total"
385
        <input type="text" id="budget_period_total" name="budget_period_total"
224
        size="10" maxlength="80" value="[% budget_period_total | $Price on_editing => 1 %]" />
386
        size="10" maxlength="80" value="[% budget_period_total | $Price on_editing => 1 %]" onchange="CheckTot(budget_period_total)" />
387
        [% INCLUDE 'price-conversion-message.inc' %]
225
    </li>
388
    </li>
226
389
227
    <li>
390
    <li>
Lines 243-249 Link Here
243
    <fieldset class="action">
406
    <fieldset class="action">
244
        <!-- "save changes" button -->
407
        <!-- "save changes" button -->
245
        <!-- ###################################### -->
408
        <!-- ###################################### -->
246
        <input type="button" value="Save"  onclick="Check(this.form)" />
409
        <input type="button" value="Save" onclick="Check(this.form)" />
247
        <!--             <input type="submit" value="Save Changes"  />  -->
410
        <!--             <input type="submit" value="Save Changes"  />  -->
248
        [% IF ( budget_period_id ) %]
411
        [% IF ( budget_period_id ) %]
249
            <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]" class="cancel">Cancel</a>
412
            <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]" class="cancel">Cancel</a>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt (-6 / +296 lines)
Lines 2-12 Link Here
2
[% USE Branches %]
2
[% USE Branches %]
3
[% USE Price %]
3
[% USE Price %]
4
[% SET footerjs = 1 %]
4
[% SET footerjs = 1 %]
5
[% USE Koha %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
6
<title>Koha &rsaquo; Administration &rsaquo; Funds[% IF op == 'add_form' %] &rsaquo; [% IF ( budget_id ) %]Modify fund[% IF ( budget_name ) %] '[% budget_name %]'[% END %][% ELSE %]Add fund [% END %][% END %]</title>
7
<title>Koha &rsaquo; Administration &rsaquo; Funds[% IF op == 'add_form' %] &rsaquo; [% IF ( budget_id ) %]Modify fund[% IF ( budget_name ) %] '[% budget_name %]'[% END %][% ELSE %]Add fund [% END %][% END %]</title>
7
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
8
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
8
<link href="[% interface %]/lib/jquery/plugins/treetable/stylesheets/jquery.treetable_[% KOHA_VERSION %].css" rel="stylesheet" type="text/css" />
9
<link href="[% interface %]/lib/jquery/plugins/treetable/stylesheets/jquery.treetable_[% KOHA_VERSION %].css" rel="stylesheet" type="text/css" />
9
[% INCLUDE 'doc-head-close.inc' %]
10
[% INCLUDE 'doc-head-close.inc' %]
11
12
<script type="text/javascript">
13
//<![CDATA[
14
var MSG_BUDGET_PARENT_ALLOCATION = "- " + _("Fund amount exceeds parent allocation") + "\n";
15
var MSG_BUDGET_PERIOD_ALLOCATION = "- " + _("Fund amount exceeds period allocation") + "\n";
16
var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") + "\n";
17
//]]>
18
</script>
19
20
<script type="text/javascript" src="[% interface %]/[% theme %]/js/acq.js"></script>
21
[% IF op == 'add_form' %]
22
[% INCLUDE 'prices.inc' %]
23
<script type="text/javascript">
24
//<![CDATA[
25
26
    function userPopup() {
27
        window.open("/cgi-bin/koha/admin/add_user_search.pl?selection_type=add",
28
            'PatronPopup',
29
            'width=740,height=450,location=yes,toolbar=no,'
30
            + 'scrollbars=yes,resize=yes'
31
        );
32
    }
33
34
    function ownerPopup() {
35
        window.open("/cgi-bin/koha/admin/add_user_search.pl?selection_type=select",
36
            'PatronPopup',
37
            'width=740,height=450,location=yes,toolbar=no,'
38
            + 'scrollbars=yes,resize=yes'
39
        );
40
    }
41
42
    function select_user(borrowernumber, borrower) {
43
        ownerRemove();
44
        var borrowername = borrower.firstname + ' ' + borrower.surname
45
        if (borrowernumber) {
46
            var ownerlink = '<a href="/cgi-bin/koha/members/moremember.pl'
47
                + '?borrowernumber=' + borrowernumber + '">'
48
                + borrowername + '</a>';
49
            $('#budget_owner_name').html(ownerlink);
50
            $('#budget_owner_id').val(borrowernumber);
51
        }
52
    }
53
54
    function ownerRemove() {
55
        $('#budget_owner_name').empty();
56
        $('#budget_owner_id').val('');
57
    }
58
59
    function add_user(borrowernumber, borrowername) {
60
        var ids = $("#budget_users_id").val().split(':');
61
        if(borrowernumber && ids.indexOf(borrowernumber) == -1) {
62
            var li = '<li id="user_' + borrowernumber + '">'
63
                + '<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber='
64
                + borrowernumber + '">' + borrowername + '</a> '
65
                + ' &bull; <a data-borrowernumber=" + borrowernumber +" class="del_user" href="#"><i class="fa fa-trash"></i> Remove</a> '
66
                + '</li>';
67
            $("#budget_users").prepend(li);
68
            ids.push(borrowernumber);
69
            $("#budget_users_id").val(ids.join(':'));
70
        } else {
71
            return -1;
72
        }
73
        return 0;
74
    }
75
76
    function del_user(borrowernumber) {
77
        var ids = $("#budget_users_id").val().split(':');
78
        if (borrowernumber) {
79
            var idx = ids.indexOf(borrowernumber+'');
80
            if (idx != -1) {
81
                ids.splice(idx, 1);
82
                $("#budget_users_id").val(ids.join(':'));
83
                $("li#user_" + borrowernumber).remove();
84
            }
85
        }
86
    }
87
88
    function Check(f) {
89
        var ok=1;
90
        var _alertString="";
91
        var alertString2;
92
93
        if (!(isNotNull(f.budget_code,1))) {
94
            _alertString += _("- Budget code cannot be blank") + "\n";
95
        }
96
97
        if (!(isNotNull(f.budget_name,1))) {
98
            _alertString += _("- Budget name cannot be blank") + "\n";
99
        }
100
101
        if (!(isNotNull(f.budget_amount,1))) {
102
            _alertString += _("- Budget amount cannot be blank") + "\n";
103
        }
104
105
        var budgetId;
106
        if   (typeof(f.budget_id ) != "undefined")  {
107
            budgetId = f.budget_id.value
108
        }
109
110
        var newBudgetParent;
111
112
//  hack to test if selected parent_id in scrolling-list...
113
//  if value == 'undef' its got a selected_parent :/
114
        if(f.budget_parent_id){
115
            var chkAdd   =  f.budget_parent_id.value ;
116
            if  (     typeof(chkAdd ) != "undefined") {
117
                newBudgetParent  =  f.budget_parent_id.value
118
            } else {
119
                newBudgetParent  =  f.budget_parent_id.item(0).value
120
            }
121
122
            if   (budgetId  > 0)  {  ; //its a mod ...
123
                // if parent == curent-budget, fail...
124
                if ( newBudgetParent  ==  budgetId     ) {
125
                        _alertString += _("- Budget parent is current budget") + "\n";
126
                }
127
128
                else if (newBudgetParent) {
129
                    var result = checkBudgetParent(  budgetId , newBudgetParent   );
130
                    if (result) {
131
                        _alertString += result;
132
                    }
133
                }
134
            }
135
        }
136
137
         // else do lookup
138
        var budgetTotal = Math.abs(f.budget_amount.value);
139
        var result =   budgetExceedsParent  (budgetTotal, budgetId, newBudgetParent, f.budget_period_id.value)
140
        if (result) {
141
            _alertString += result;
142
        }
143
144
        if (_alertString.length==0) {
145
            document.Aform.submit();
146
        } else {
147
            alertString2 = _("Form not submitted because of the following problem(s)");
148
            alertString2 += "\n------------------------------------------------------------------------------------\n\n";
149
            alertString2 += _alertString;
150
            alert(alertString2);
151
        }
152
    }
153
154
155
    $(document).ready(function(){
156
        $('#budget_expend').on('change', function(){CheckAmount(this)});
157
        $('#budget_amount').on('change', function(){CheckAmount(this)});
158
        function CheckAmount(f){
159
            var ok=1;
160
            var _alertString="";
161
            var alertString2;
162
            if (!(isPrice(f.value))) {
163
                _alertString += "\n- " + _("Amount must be a valid number, or empty");
164
            }else{
165
                f.value=Price_from_string(f.value);
166
167
            }
168
            if (_alertString.length==0) {
169
                return true;
170
            } else {
171
                alertString2  = _("Form not submitted because of the following problem(s)");
172
                alertString2 += "\n------------------------------------------------------------------------------------\n";
173
                alertString2 += _alertString;
174
                alert(alertString2);
175
                return false;
176
            }
177
        }
178
179
        $("#remove_owner").on("click",function(e){
180
            e.preventDefault();
181
            ownerRemove();
182
        });
183
        $("#edit_owner").on("click",function(e){
184
            e.preventDefault();
185
            ownerPopup();
186
        });
187
        $("body").on("click",".del_user",function(e){
188
            e.preventDefault();
189
            var borrowernumber = $(this).data("borrowernumber");
190
            del_user(borrowernumber);
191
        });
192
        $("#add_user_button").on("click",function(e){
193
            e.preventDefault();
194
            userPopup();
195
        });
196
        $("#edit_fund").on("submit",function(e){
197
            e.preventDefault();
198
            Check(this);
199
        });
200
    });
201
//]]>
202
</script>
203
[% ELSIF op == 'list' %]
204
    <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
205
    [% INCLUDE 'datatables.inc' %]
206
    <link href="[% interface %]/lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css" rel="stylesheet" type="text/css" />
207
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/treetable/jquery.treetable.js"></script>
208
209
<script type="text/javascript">
210
//<![CDATA[
211
    //
212
    $(document).ready(function() {
213
214
215
        var oTable = $("#budgeth").dataTable($.extend(true, {}, dataTablesDefaults, {
216
            "fnDrawCallback": function ( oSettings ) {
217
                if ( oSettings.aiDisplay.length == 0 )
218
                {
219
                    return;
220
                }
221
222
                var nTrs = $('#budgeth tbody tr');
223
                var iColspan = nTrs[0].getElementsByTagName('td').length;
224
                var sLastGroup = "";
225
                for ( var i=0 ; i<nTrs.length ; i++ )
226
                {
227
                    var iDisplayIndex = oSettings._iDisplayStart + i;
228
                    var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[1];
229
                    if ( sGroup != sLastGroup )
230
                    {
231
                        var nGroup = document.createElement( 'tr' );
232
                        var nCell = document.createElement( 'td' );
233
                        nCell.colSpan = iColspan;
234
                        nCell.className = "group";
235
                        nCell.innerHTML = sGroup;
236
                        nGroup.appendChild( nCell );
237
                        nTrs[i].parentNode.insertBefore( nGroup, nTrs[i] );
238
                        sLastGroup = sGroup;
239
                    }
240
                }
241
            },
242
            "footerCallback": function ( row, data, start, end, display ) {
243
                var api = this.api(), data;
244
                footer_column_sum( api, [ 4, 6, 8, 10 ], 2 );
245
            },
246
            "aoColumnDefs": [
247
                { "bVisible": false, "aTargets": [ 0, 1 ] },
248
                { "bSortable": false, "aTargets": ["_all"] }
249
            ],
250
            'dom': '<"top pager"ilpf>tr<"bottom pager"ip>',
251
            'bSort': true,
252
            'aaSortingFixed': [[ 1, 'asc' ]],
253
            'bPaginate': false,
254
            "bAutoWidth": false
255
        }));
256
257
        $(oTable).treetable({
258
            expandable: true
259
        });
260
        $(oTable).treetable('expandAll');
261
        $("#expand_all").click(function(e){
262
            e.preventDefault();
263
            $(oTable).treetable('expandAll');
264
        });
265
        $("#collapse_all").click(function(e){
266
            e.preventDefault();
267
            $(oTable).treetable('collapseAll');
268
        });
269
270
        [% UNLESS budget_period_id %]
271
          $("#hide_inactive").click(function(e){
272
            e.preventDefault();
273
            oTable.fnFilter( 1, 0 ); // Show only active=1
274
          });
275
          $("#show_inactive").click(function(e){
276
            e.preventDefault();
277
            oTable.fnFilter( '', 0 );
278
          });
279
          $("#hide_inactive").click();
280
        [% END %]
281
        oTable.fnAddFilters("filter", 750);
282
283
        $("#filterbutton").click(function() {
284
            $("#fundfilters").slideToggle(0);
285
        });
286
287
        $(".deletefund-disabled").tooltip().on("click", function(e){
288
            e.preventDefault();
289
            alert(_("This fund has children. It cannot be deleted."));
290
        });
291
    });
292
//]]>
293
</script>
294
[% END %]
295
10
</head>
296
</head>
11
297
12
<body id="admin_aqbudgets" class="admin">
298
<body id="admin_aqbudgets" class="admin">
Lines 232-249 Link Here
232
    <li>
518
    <li>
233
    <label style="white-space: nowrap;" for="budget_amount" class="required">Amount: </label>
519
    <label style="white-space: nowrap;" for="budget_amount" class="required">Amount: </label>
234
    <input type="text" name="budget_amount" id="budget_amount" value="[% budget_amount | $Price on_editing => 1 %]" size="8" />
520
    <input type="text" name="budget_amount" id="budget_amount" value="[% budget_amount | $Price on_editing => 1 %]" size="8" />
521
    [% INCLUDE 'price-conversion-message.inc' %]
235
    </li>
522
    </li>
236
523
237
    <li>
524
    <li>
238
      <label for="budget_encumb">Warning at (%): </label>
525
    <label for="budget_encumb">Warning at (%): </label>
239
      <input type="text" name="budget_encumb" id="budget_encumb" value="[% budget_encumb %]" size="10" />
526
    <input type="text" name="budget_encumb" id="budget_encumb" value="[% budget_encumb %]" size="10" />
240
      <span class="hint">0 to disable</span>
527
    <span class="hint">0 to disable</span>
241
    </li>
528
    </li>
242
529
243
    <li>
530
    <li>
244
      <label for="budget_expend">Warning at (amount): </label>
531
    <label for="budget_expend">Warning at (amount): </label>
245
      <input type="text" name="budget_expend" id="budget_expend" value="[% budget_expend | $Price on_editing => 1 %]" size="10" />
532
    <input type="text" name="budget_expend" id="budget_expend" value="[% budget_expend | $Price on_editing => 1 %]" size="10" />
246
      <span class="hint">0 to disable</span>
533
534
    <span class="hint">0 to disable.</span>
535
    [% INCLUDE 'price-conversion-message.inc' %]
536
247
    </li>
537
    </li>
248
538
249
    <li>
539
    <li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref (+4 lines)
Lines 66-68 I18N/L10N: Link Here
66
              no: "Don't allow"
66
              no: "Don't allow"
67
        - notices to be translated.
67
        - notices to be translated.
68
        - If set, notices will be translatable from the "Notices and Slips" interface. The language used to send a notice to a patron will be the one defined for the patron.
68
        - If set, notices will be translatable from the "Notices and Slips" interface. The language used to send a notice to a patron will be the one defined for the patron.
69
    -
70
        - "Any of this characters can be used as separator between integer or decimal part in the price fields. It you want to format price output, please use the system preference 'CurrencyFormat'"
71
        - pref: DigitSeparator
72
          class: long
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt (-1 / +33 lines)
Lines 3-8 Link Here
3
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Koha &rsaquo; Patrons &rsaquo; Create manual credit</title>
4
<title>Koha &rsaquo; Patrons &rsaquo; Create manual credit</title>
5
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
6
7
[% INCLUDE 'prices.inc' %]
8
<script type="text/javascript">
9
//<![CDATA[
10
$(document).ready(function(){
11
        $('#mancredit').preventDoubleFormSubmit();
12
        $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
13
        $('#amount').on('change', function(){Check(this)});
14
        function Check(f){
15
            var ok=1;
16
            var _alertString="";
17
            var alertString2;
18
            if (!(isPrice(f.value))) {
19
                _alertString += "\n- " + _("Amount must be a valid number, or empty");
20
            }else{
21
                f.value=Price_from_string(f.value);
22
            }
23
            if (_alertString.length==0) {
24
                return true;
25
            } else {
26
                alertString2  = _("Error: ");
27
                alertString2 += "\n------------------------------------------------------------------------------------\n";
28
                alertString2 += _alertString;
29
                alert(alertString2);
30
                return false;
31
            }
32
        }
33
});
34
</script>
6
</head>
35
</head>
7
36
8
<body id="pat_mancredit" class="pat">
37
<body id="pat_mancredit" class="pat">
Lines 40-46 Link Here
40
	<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
69
	<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
41
	<li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li>
70
	<li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li>
42
    <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
71
    <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
43
    <li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li>
72
    <li><label for="amount">Amount: </label><input name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00
73
        [% INCLUDE 'price-conversion-message.inc' %]
74
    </li>
75
44
</ol></fieldset>
76
</ol></fieldset>
45
77
46
<fieldset class="action"><input type="submit" name="add" value="Add credit" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a></fieldset>
78
<fieldset class="action"><input type="submit" name="add" value="Add credit" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a></fieldset>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt (-1 / +29 lines)
Lines 53-59 Link Here
53
	<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
53
	<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
54
	<li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" /></li>
54
	<li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" /></li>
55
    <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
55
    <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
56
    <li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li>
56
    <li><label for="amount">Amount: </label><input type="text" name="amount" id="amount" required="required"/>
57
        [% INCLUDE 'price-conversion-message.inc' %]
58
    </li>
57
	</ol></fieldset>
59
	</ol></fieldset>
58
<fieldset class="action"><input type="submit" name="add" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a></fieldset>
60
<fieldset class="action"><input type="submit" name="add" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a></fieldset>
59
</form>
61
</form>
Lines 87-90 Link Here
87
    </script>
89
    </script>
88
[% END %]
90
[% END %]
89
91
92
93
[% INCLUDE 'prices.inc' %]
94
95
<script type="text/javascript">
96
$('#amount').on('change', function(){Check(this)});
97
function Check(f){
98
    var ok=1;
99
    var _alertString="";
100
    var alertString2;
101
    if (!(isPrice(f.value))) {
102
        _alertString += "\n- " + _("Amount must be a valid number, or empty");
103
    }else{
104
        f.value=Price_from_string(f.value);
105
    }
106
    if (_alertString.length==0) {
107
        return true;
108
    } else {
109
        alertString2  = _("Form not submitted because of the following problem(s)");
110
        alertString2 += "\n------------------------------------------------------------------------------------\n";
111
        alertString2 += _alertString;
112
        alert(alertString2);
113
        return false;
114
    }
115
}
116
</script>
117
90
[% INCLUDE 'intranet-bottom.inc' %]
118
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt (-3 / +64 lines)
Lines 4-9 Link Here
4
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Koha &rsaquo; Patrons &rsaquo; Collect fine payment for  [% patron.firstname %] [% patron.surname %]</title>
5
<title>Koha &rsaquo; Patrons &rsaquo; Collect fine payment for  [% patron.firstname %] [% patron.surname %]</title>
6
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
7
8
<script type= "text/javascript">
9
//<![CDATA[
10
$(document).ready(function() {
11
    $('#payindivfine, #woindivfine, #payfine').preventDoubleFormSubmit();
12
    $("#paid").on("change",function(){
13
        moneyFormat( this );
14
    });
15
});
16
17
function moneyFormat(textObj) {
18
    var newValue = textObj.value;
19
    var decAmount = "";
20
    var dolAmount = "";
21
    var decFlag   = false;
22
    var aChar     = "";
23
24
    for(i=0; i < newValue.length; i++) {
25
        aChar = newValue.substring(i, i+1);
26
        if (aChar >= "0" && aChar <= "9") {
27
            if(decFlag) {
28
                decAmount = "" + decAmount + aChar;
29
            }
30
            else {
31
                dolAmount = "" + dolAmount + aChar;
32
            }
33
        }
34
        if (aChar == ".") {
35
            if (decFlag) {
36
                dolAmount = "";
37
                break;
38
            }
39
            decFlag = true;
40
        }
41
    }
42
</script>
43
44
[% INCLUDE 'prices.inc' %]
45
46
<script type="text/javascript">
47
function Check(f){
48
    var ok=1;
49
    var _alertString="";
50
    var alertString2;
51
    if (!(isPrice(f.value))) {
52
        _alertString += "\n- " + _("Amount must be a valid number, or empty");
53
    }else{
54
        f.value=Price_from_string(f.value);
55
    }
56
    if (_alertString.length==0) {
57
        return true;
58
    } else {
59
        alertString2  = _("Form not submitted because of the following problem(s)");
60
        alertString2 += "\n------------------------------------------------------------------------------------\n";
61
        alertString2 += _alertString;
62
        alert(alertString2);
63
        return false;
64
    }
65
}
66
</script>
67
7
</head>
68
</head>
8
69
9
<body id="pat_paycollect" class="pat">
70
<body id="pat_paycollect" class="pat">
Lines 83-89 Link Here
83
    <li>
144
    <li>
84
        <label for="paid">Collect from patron: </label>
145
        <label for="paid">Collect from patron: </label>
85
            <!-- default to paying all -->
146
            <!-- default to paying all -->
86
        <input name="paid" id="paid" value="[% amountoutstanding %]" />
147
        <input name="paid" id="paid" value="[% amountoutstanding %]" onchange="Check(document.payindivfine.paid)"/>
87
    </li>
148
    </li>
88
</ol>
149
</ol>
89
</fieldset>
150
</fieldset>
Lines 150-156 Link Here
150
    <li>
211
    <li>
151
        <label for="paid">Collect from patron: </label>
212
        <label for="paid">Collect from patron: </label>
152
        <!-- default to paying all -->
213
        <!-- default to paying all -->
153
        <input name="paid" id="paid" value="[% total | format('%.2f') %]" />
214
        <input name="paid" id="paid" value="[% total | format('%.2f') %]" onchange="Check(document.payfine.paid)"/>
215
        [% INCLUDE 'price-conversion-message.inc' %]
154
    </li>
216
    </li>
155
    <li>
217
    <li>
156
        <label for="selected_accts_notes">Note: </label>
218
        <label for="selected_accts_notes">Note: </label>
157
- 

Return to bug 12310