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

(-)a/admin/columns_settings.yml (+76 lines)
Lines 83-88 modules: Link Here
83
        -
83
        -
84
          columnname: actions
84
          columnname: actions
85
85
86
  cataloguing:
87
    additem:
88
      itemst:
89
        # NOTE: These columns are selected from the non-hidden columns that have mappings to MARC
90
        # subfields in the default MARC21 framework (and can thus be displayed in the item editor).
91
        -
92
          columnname: withdrawn
93
        -
94
          columnname: itemlost
95
        -
96
          columnname: cn_source
97
        -
98
          columnname: materials
99
        -
100
          columnname: damaged
101
        -
102
          columnname: restricted
103
        -
104
          columnname: cn_sort
105
        -
106
          columnname: notforloan
107
        -
108
          columnname: ccode
109
        -
110
          columnname: itemnumber
111
        -
112
          columnname: homebranch
113
        -
114
          columnname: holdingbranch
115
        -
116
          columnname: location
117
        -
118
          columnname: dateaccessioned
119
        -
120
          columnname: booksellerid
121
        -
122
          columnname: coded_location_qualifier
123
        -
124
          columnname: price
125
        -
126
          columnname: enumchron
127
        -
128
          columnname: stocknumber
129
        -
130
          columnname: stack
131
        -
132
          columnname: issues
133
        -
134
          columnname: renewals
135
        -
136
          columnname: reserves
137
        -
138
          columnname: itemcallnumber
139
        -
140
          columnname: barcode
141
        -
142
          columnname: onloan
143
        -
144
          columnname: datelastseen
145
        -
146
          columnname: datelastborrowed
147
        -
148
          columnname: copynumber
149
        -
150
          columnname: uri
151
        -
152
          columnname: replacementprice
153
        -
154
          columnname: replacementpricedate
155
        -
156
          columnname: itemnotes_nonpublic
157
        -
158
          columnname: itype
159
        -
160
          columnname: itemnotes
161
86
  members:
162
  members:
87
    member:
163
    member:
88
      memberresultst:
164
      memberresultst:
(-)a/cataloguing/additem.pl (+7 lines)
Lines 803-808 for my $row ( @big_array ) { Link Here
803
foreach my $subfield_code (sort keys(%witness)) {
803
foreach my $subfield_code (sort keys(%witness)) {
804
    my %header_value;
804
    my %header_value;
805
    $header_value{header_value} = $witness{$subfield_code};
805
    $header_value{header_value} = $witness{$subfield_code};
806
807
	my $subfieldlib = $tagslib->{$itemtagfield}->{$subfield_code};
808
    my $kohafield = $subfieldlib->{kohafield};
809
    if ( $kohafield && $kohafield =~ /items.(.+)/ ) {
810
        $header_value{column_name} = $1;
811
    }
812
806
    push(@header_value_loop, \%header_value);
813
    push(@header_value_loop, \%header_value);
807
}
814
}
808
815
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc (-2 / +5 lines)
Lines 9-19 function KohaTable(selector, dt_parameters, columns_settings) { Link Here
9
    var hidden_ids = [];
9
    var hidden_ids = [];
10
    var excluded_ids = [];
10
    var excluded_ids = [];
11
    $(columns_settings).each( function() {
11
    $(columns_settings).each( function() {
12
		var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( 'th' );
13
		var used_id = named_id == -1 ? id : named_id;
14
12
        if ( this['is_hidden'] == "1" ) {
15
        if ( this['is_hidden'] == "1" ) {
13
            hidden_ids.push( id );
16
            hidden_ids.push( used_id );
14
        }
17
        }
15
        if ( this['cannot_be_toggled'] == "1" ) {
18
        if ( this['cannot_be_toggled'] == "1" ) {
16
            excluded_ids.push( id );
19
            excluded_ids.push( used_id );
17
        }
20
        }
18
        id++;
21
        id++;
19
    });
22
    });
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt (+5 lines)
Lines 12-21 Link Here
12
        [% SET tables = module %]
12
        [% SET tables = module %]
13
        [% IF tables.$pagename.keys and tables.$pagename.keys.size > 0 %]
13
        [% IF tables.$pagename.keys and tables.$pagename.keys.size > 0 %]
14
          [% FOR tablename IN tables.$pagename.keys.sort %]
14
          [% FOR tablename IN tables.$pagename.keys.sort %]
15
			[% IF pagename == 'additem' AND tablename == 'itemst' %]
16
			  <div class="alert">Saving changes to column visibility here will override framework visibility settings for the table of items.</div>
17
			[% END %]
15
            <table>
18
            <table>
16
              <caption>
19
              <caption>
17
                [% IF tablename == 'currencies-table' %]
20
                [% IF tablename == 'currencies-table' %]
18
                  Currency
21
                  Currency
22
				[% ELSIF pagename == 'additem' AND tablename == 'itemst' %]
23
                  Items Editor
19
                [% END %]
24
                [% END %]
20
                (id=[% tablename %])
25
                (id=[% tablename %])
21
              </caption>
26
              </caption>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-6 / +16 lines)
Lines 1-9 Link Here
1
[% USE ColumnsSettings %]
2
1
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Cataloging &rsaquo; [% title |html %] [% IF ( author ) %] by [% author %][% END %] (Record #[% biblionumber %]) &rsaquo; Items</title>
4
<title>Koha &rsaquo; Cataloging &rsaquo; [% title |html %] [% IF ( author ) %] by [% author %][% END %] (Record #[% biblionumber %]) &rsaquo; Items</title>
3
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
5
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
4
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'datatables.inc' %]
7
[% INCLUDE 'datatables.inc' %]
6
<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
8
<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
9
[% INCLUDE 'columns_settings.inc' %]
7
[% INCLUDE 'browser-strings.inc' %]
10
[% INCLUDE 'browser-strings.inc' %]
8
<!--[if lt IE 9]>
11
<!--[if lt IE 9]>
9
<script type="text/javascript" src="[% interface %]/lib/shims/json2.min.js"></script>
12
<script type="text/javascript" src="[% interface %]/lib/shims/json2.min.js"></script>
Lines 45-58 $(document).ready(function(){ Link Here
45
                });
48
                });
46
            });
49
            });
47
50
48
    var itemst = $("#itemst").dataTable($.extend(true, {}, dataTablesDefaults, {
51
    var columns_settings = [% ColumnsSettings.GetColumns( 'cataloguing', 'additem', 'itemst', 'json' ) %]
52
	// Skip the first column
53
	columns_settings.unshift( { cannot_be_toggled: "1" } );
54
55
    var itemst = KohaTable("#itemst", {
49
        "aoColumnDefs": [
56
        "aoColumnDefs": [
50
          { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
57
          { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
51
        ],
58
        ],
52
        'bPaginate': false,
59
        'bPaginate': false,
53
        'bInfo': false,
60
        'bInfo': false,
54
        "bAutoWidth": false
61
        "bAutoWidth": false
55
    } ) );
62
    }, columns_settings);
56
63
57
});
64
});
58
function Check(f) {
65
function Check(f) {
Lines 134-142 function confirm_deletion() { Link Here
134
          <thead>
141
          <thead>
135
            <tr>
142
            <tr>
136
                <th>&nbsp;</th>
143
                <th>&nbsp;</th>
137
                [% FOREACH item_header_loo IN item_header_loop %]
144
                [% FOREACH item_header IN item_header_loop %]
138
                    <th>
145
                    [% IF item_header.column_name %]
139
                        [% item_header_loo.header_value %]
146
                        <th data-colname="[% item_header.column_name %]">
147
                    [% ELSE %]
148
                        <th>
149
                    [% END %]
150
                        [% item_header.header_value %]
140
                    </th>
151
                    </th>
141
                [% END %]
152
                [% END %]
142
            </tr>
153
            </tr>
143
- 

Return to bug 14510