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 33-46 $(document).ready(function(){ Link Here
33
		}
36
		}
34
		});
37
		});
35
38
36
    var itemst = $("#itemst").dataTable($.extend(true, {}, dataTablesDefaults, {
39
    var columns_settings = [% ColumnsSettings.GetColumns( 'cataloguing', 'additem', 'itemst', 'json' ) %]
40
	// Skip the first column
41
	columns_settings.unshift( { cannot_be_toggled: "1" } );
42
43
    var itemst = KohaTable("#itemst", {
37
        "aoColumnDefs": [
44
        "aoColumnDefs": [
38
          { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
45
          { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
39
        ],
46
        ],
40
        'bPaginate': false,
47
        'bPaginate': false,
41
        'bInfo': false,
48
        'bInfo': false,
42
        "bAutoWidth": false
49
        "bAutoWidth": false
43
    } ) );
50
    }, columns_settings);
44
51
45
});
52
});
46
function Check(f) {
53
function Check(f) {
Lines 128-136 function confirm_deletion(biblionumber,itemnumber) { Link Here
128
          <thead>
135
          <thead>
129
            <tr>
136
            <tr>
130
                <th>&nbsp;</th>
137
                <th>&nbsp;</th>
131
                [% FOREACH item_header_loo IN item_header_loop %]
138
                [% FOREACH item_header IN item_header_loop %]
132
                    <th>
139
                    [% IF item_header.column_name %]
133
                        [% item_header_loo.header_value %]
140
                        <th data-colname="[% item_header.column_name %]">
141
                    [% ELSE %]
142
                        <th>
143
                    [% END %]
144
                        [% item_header.header_value %]
134
                    </th>
145
                    </th>
135
                [% END %]
146
                [% END %]
136
            </tr>
147
            </tr>
137
- 

Return to bug 14510