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

(-)a/admin/preferences.pl (+16 lines)
Lines 29-34 use C4::Log; Link Here
29
use C4::Output;
29
use C4::Output;
30
use C4::Templates;
30
use C4::Templates;
31
use Koha::Acquisition::Currencies;
31
use Koha::Acquisition::Currencies;
32
use Koha::Patron::Attribute::Types;
32
use File::Spec;
33
use File::Spec;
33
use IO::File;
34
use IO::File;
34
use YAML::Syck qw();
35
use YAML::Syck qw();
Lines 375-380 if ( $tab ) { Link Here
375
    );
376
    );
376
}
377
}
377
378
379
$template->param(
380
    additional_db_columns => {
381
        borrowers => {
382
            map {
383
                (
384
                    key         => $_->{code},
385
                    val         => $_->{code},
386
                    description => $_->{description},
387
                    checked     => 0,
388
                  )
389
            } @{ Koha::Patron::Attribute::Types->search->unblessed }
390
        }
391
    }
392
);
393
378
$template->param( TABS => \@TABS );
394
$template->param( TABS => \@TABS );
379
395
380
output_html_with_http_headers $input, $cookie, $template->output;
396
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt (+2 lines)
Lines 1-4 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE To %]
2
[% USE Asset %]
3
[% USE Asset %]
3
[% USE Koha %]
4
[% USE Koha %]
4
[% SET footerjs = 1 %]
5
[% SET footerjs = 1 %]
Lines 239-244 Link Here
239
        var MSG_ALL_VALUE_WARN = _("Note: _ALL_ value will override all other values");
240
        var MSG_ALL_VALUE_WARN = _("Note: _ALL_ value will override all other values");
240
        var MSG_UPD_LOC_FORMAT_WARN = _("The following values are not formatted correctly:");
241
        var MSG_UPD_LOC_FORMAT_WARN = _("The following values are not formatted correctly:");
241
        var MSG_INVALID = _( "Error: presence of invalid data prevent saving. Please make the corrections and try again." );
242
        var MSG_INVALID = _( "Error: presence of invalid data prevent saving. Please make the corrections and try again." );
243
        var additional_db_columns = [% To.json( additional_db_columns ) %];
242
    </script>
244
    </script>
243
    [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
245
    [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
244
    [% Asset.js("js/ajax.js") | $raw %]
246
    [% Asset.js("js/ajax.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js (-1 / +8 lines)
Lines 213-218 $( document ).ready( function () { Link Here
213
        var pref_value = this.value;
213
        var pref_value = this.value;
214
        var prefs = pref_value.split("|");
214
        var prefs = pref_value.split("|");
215
215
216
        var additional_items = [];
217
        if ( additional_db_columns.hasOwnProperty(datasource) ) {
218
            additional_items = additional_db_columns[datasource];
219
        }
216
        $.getJSON( themelang + "/modules/admin/preferences/" + datasource + ".json", function( data ){
220
        $.getJSON( themelang + "/modules/admin/preferences/" + datasource + ".json", function( data ){
217
            var items = [];
221
            var items = [];
218
            var checked = "";
222
            var checked = "";
Lines 224-229 $( document ).ready( function () { Link Here
224
                }
228
                }
225
                items.push('<label><input class="dbcolumn_selection" type="checkbox" id="' + key + '"' + checked + ' name="pref" value="' + val + '" /> ' + key + '</label>');
229
                items.push('<label><input class="dbcolumn_selection" type="checkbox" id="' + key + '"' + checked + ' name="pref" value="' + val + '" /> ' + key + '</label>');
226
            });
230
            });
231
232
            $(additional_items).each(function(){
233
                items.push('<label><input class="dbcolumn_selection" type="checkbox" id="' + this['key'] + '"' + this['checked'] + ' name="pref" value="' + this['val'] + '" /> ' + this['description'] + '</label>');
234
            });
227
            $("<div/>", {
235
            $("<div/>", {
228
                "class": "columns-2",
236
                "class": "columns-2",
229
                html: items.join("")
237
                html: items.join("")
230
- 

Return to bug 22844