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

(-)a/C4/Utils/DataTables/ColumnsSettings.pm (+123 lines)
Line 0 Link Here
1
package C4::Utils::DataTables::ColumnsSettings;
2
3
use Modern::Perl;
4
use List::Util qw( first );
5
use C4::Context;
6
7
sub get_yaml {
8
    my $yml_path = C4::Context->config('intranetdir') . '/admin/columns_settings.yml';
9
    my $yaml = eval { YAML::LoadFile( $yml_path ) };
10
    warn "ERROR: the yaml file for DT::ColumnsSettings is not correctly formated: $@" if $@;
11
    return $yaml;
12
}
13
sub get_tables {
14
    my ( $module, $page ) = @_;
15
    my $list = get_yaml;
16
    return $list->{modules}{$module}{$page};
17
}
18
19
sub get_excluded {
20
    my ( $module, $page, $table ) = @_;
21
22
    my $list = get_yaml;
23
    return $list->{modules}{$module}{$page}{$table}{cannot_be_toggled};
24
}
25
26
sub get_columns {
27
    my ( $module, $page, $tablename ) = @_;
28
29
    my $list = get_yaml;
30
31
    my $dbh = C4::Context->dbh;
32
    my $sth = $dbh->prepare(q{
33
        SELECT *
34
        FROM columns_settings
35
        WHERE module = ?
36
            AND page = ?
37
            AND tablename = ?
38
    });
39
40
    $sth->execute( $module, $page, $tablename );
41
42
    while ( my $c = $sth->fetchrow_hashref ) {
43
        my $column = first { $c->{columnname} eq $_->{columnname} }
44
            @{ $list->{modules}{$c->{module}}{$c->{page}}{$c->{tablename}} };
45
        $column->{is_hidden} = $c->{is_hidden};
46
        $column->{cannot_be_toggled} = $c->{cannot_be_toggled};
47
    }
48
49
    return $list->{modules}{$module}{$page}{$tablename};
50
}
51
52
sub get_modules {
53
    my $list = get_yaml;
54
55
    my $dbh = C4::Context->dbh;
56
    my $sth = $dbh->prepare(q{
57
        SELECT *
58
        FROM columns_settings
59
    });
60
61
    $sth->execute;
62
    while ( my $c = $sth->fetchrow_hashref ) {
63
        my $column = first { $c->{columnname} eq $_->{columnname} }
64
            @{ $list->{modules}{$c->{module}}{$c->{page}}{$c->{tablename}} };
65
        $column->{is_hidden} = $c->{is_hidden};
66
        $column->{cannot_be_toggled} = $c->{cannot_be_toggled};
67
    }
68
69
    return $list->{modules};
70
}
71
72
sub update_columns {
73
    my ( $params ) = @_;
74
    my $columns = $params->{columns};
75
    my $dbh = C4::Context->dbh;
76
    my $sth_check = $dbh->prepare(q{
77
        SELECT COUNT(*)
78
        FROM columns_settings
79
        WHERE module = ?
80
            AND page = ?
81
            AND tablename = ?
82
            AND columnname = ?
83
    });
84
    my $sth_update = $dbh->prepare(q{
85
        UPDATE columns_settings
86
        SET is_hidden = ?, cannot_be_toggled = ?
87
        WHERE module = ?
88
            AND page = ?
89
            AND tablename = ?
90
            AND columnname = ?
91
    });
92
93
    my $sth_insert = $dbh->prepare(q{
94
        INSERT INTO columns_settings (is_hidden, cannot_be_toggled, module, page, tablename, columnname )
95
        VALUES ( ?, ?, ?, ?, ?, ? )
96
    });
97
98
99
    for my $c ( @$columns ) {
100
        $sth_check->execute( $c->{module}, $c->{page}, $c->{tablename}, $c->{columnname} );
101
        if ( $sth_check->fetchrow ) {
102
            $sth_update->execute(
103
                $c->{is_hidden},
104
                $c->{cannot_be_toggled},
105
                $c->{module},
106
                $c->{page},
107
                $c->{tablename},
108
                $c->{columnname}
109
            );
110
        } else {
111
            $sth_insert->execute(
112
                $c->{is_hidden},
113
                $c->{cannot_be_toggled},
114
                $c->{module},
115
                $c->{page},
116
                $c->{tablename},
117
                $c->{columnname}
118
            );
119
        }
120
    }
121
}
122
123
1;
(-)a/Koha/Template/Plugin/ColumnsSettings.pm (+67 lines)
Line 0 Link Here
1
package Koha::Template::Plugin::ColumnsSettings;
2
3
# Copyright BibLibre 2013
4
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Template::Plugin;
23
use base qw( Template::Plugin );
24
25
use YAML qw( LoadFile );
26
use JSON qw( to_json );
27
28
use C4::Context qw( config );
29
use C4::Utils::DataTables::ColumnsSettings;
30
31
=pod
32
33
This plugin allows to get the column configuration for a table.
34
35
First, include the line '[% USE Tables %]' at the top
36
of the template to enable the plugin.
37
38
To use, call ColumnsSettings.GetTables with the module and the page where the template is called.
39
40
For example: [% ColumnsSettings.GetTables( 'circ', 'circulation' ) %]
41
42
=cut
43
44
sub GetTables {
45
    my ( $self, $module, $page, $format ) = @_;
46
    $format //= q{};
47
48
    my $columns = C4::Utils::DataTables::ColumnsSettings::get_tables( $module, $page );
49
50
    return $format eq 'json'
51
        ? to_json( $columns )
52
        : $columns
53
}
54
55
sub GetColumns {
56
    my ( $self, $module, $page, $table, $format ) = @_;
57
    $format //= q{};
58
59
    my $columns = C4::Utils::DataTables::ColumnsSettings::get_columns( $module, $page, $table );
60
61
    return $format eq 'json'
62
        ? to_json( $columns )
63
        : $columns
64
}
65
66
1;
67
(-)a/admin/columns_settings.pl (+59 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
use Modern::Perl;
4
use CGI;
5
use YAML qw( LoadFile );
6
use C4::Auth;
7
use C4::Context;
8
use C4::Output;
9
use C4::Utils::DataTables::ColumnsSettings qw( get_modules );
10
my $input = new CGI;
11
12
my ($template, $loggedinuser, $cookie)
13
    = get_template_and_user({template_name => "admin/columns_settings.tt",
14
            query => $input,
15
            type => "intranet",
16
            authnotrequired => 0,
17
            flagsrequired => {parameters => 'parameters_remaining_permissions'},
18
            debug => 1,
19
    });
20
21
22
my $action = $input->param('action') // 'list';
23
24
if ( $action eq 'save' ) {
25
    my $module = $input->param("module");
26
27
    my @columnids = $input->param("columnid");
28
    my @columns;
29
    for my $columnid ( @columnids ) {
30
        next unless $columnid =~ m|^([^_]*)_([^_]*)_(.*)$|;
31
        my $is_hidden = $input->param($columnid.'_hidden') // 0;
32
        my $cannot_be_toggled = $input->param($columnid.'_cannot_be_toggled') // 0;
33
        push @columns,
34
            {
35
                module => $module,
36
                page => $1,
37
                tablename => $2,
38
                columnname => $3,
39
                is_hidden => $is_hidden,
40
                cannot_be_toggled => $cannot_be_toggled,
41
            };
42
    }
43
44
45
    C4::Utils::DataTables::ColumnsSettings::update_columns(
46
        {
47
            columns => \@columns,
48
        }
49
    );
50
51
    $action = 'list';
52
}
53
54
if ( $action eq 'list' ) {
55
    my $modules = C4::Utils::DataTables::ColumnsSettings::get_modules;
56
    $template->param( modules => $modules );
57
}
58
59
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/admin/columns_settings.yml (+52 lines)
Line 0 Link Here
1
modules:
2
  circ:
3
    circulation:
4
      issuest:
5
        -
6
          columnname: due_date
7
        -
8
          columnname: title
9
        -
10
          columnname: item_type
11
        -
12
          columnname: checked_out_on
13
        -
14
          columnname: checked_out_from
15
        -
16
          columnname: call_no
17
        -
18
          columnname: charge
19
        -
20
          columnname: price
21
        -
22
          columnname: renew
23
          cannot_be_toggled: 1
24
          cannot_be_modified: 1
25
        -
26
          columnname: check_in
27
          cannot_be_toggled: 1
28
          cannot_be_modified: 1
29
        -
30
          columnname: export
31
          cannot_be_toggled: 1
32
          cannot_be_modified: 1
33
34
      holdst:
35
        -
36
          columnname: hold_date
37
        -
38
          columnname: title
39
        -
40
          columnname: call_number
41
        -
42
          columnname: barcode
43
        -
44
          columnname: priority
45
        -
46
          columnname: delete
47
          cannot_be_toggled: 1
48
          cannot_be_modified: 1
49
        -
50
          columnname: info
51
          cannot_be_toggled: 1
52
          cannot_be_modified: 1
(-)a/circ/circulation.pl (+1 lines)
Lines 387-392 if ($borrowernumber) { Link Here
387
        $getreserv{transfered}    = 0;
387
        $getreserv{transfered}    = 0;
388
        $getreserv{nottransfered} = 0;
388
        $getreserv{nottransfered} = 0;
389
389
390
        $getreserv{reservedate_sort} = $num_res->{'reservedate'};
390
        $getreserv{reservedate}    = format_date( $num_res->{'reservedate'} );
391
        $getreserv{reservedate}    = format_date( $num_res->{'reservedate'} );
391
        $getreserv{reserve_id}  = $num_res->{'reserve_id'};
392
        $getreserv{reserve_id}  = $num_res->{'reserve_id'};
392
        $getreserv{title}          = $getiteminfo->{'title'};
393
        $getreserv{title}          = $getiteminfo->{'title'};
(-)a/installer/data/mysql/kohastructure.sql (+14 lines)
Lines 3379-3384 CREATE TABLE IF NOT EXISTS marc_modification_template_actions ( Link Here
3379
  CONSTRAINT `mmta_ibfk_1` FOREIGN KEY (`template_id`) REFERENCES `marc_modification_templates` (`template_id`) ON DELETE CASCADE ON UPDATE CASCADE
3379
  CONSTRAINT `mmta_ibfk_1` FOREIGN KEY (`template_id`) REFERENCES `marc_modification_templates` (`template_id`) ON DELETE CASCADE ON UPDATE CASCADE
3380
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
3380
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
3381
3381
3382
--
3383
-- Table structure for table `columns_settings`
3384
--
3385
3386
CREATE TABLE IF NOT EXISTS columns_settings (
3387
    module varchar(255) NOT NULL,
3388
    page varchar(255) NOT NULL,
3389
    tablename varchar(255) NOT NULL,
3390
    columnname varchar(255) NOT NULL,
3391
    cannot_be_toggled int(1) NOT NULL DEFAULT 0,
3392
    is_hidden int(1) NOT NULL DEFAULT 0,
3393
    PRIMARY KEY(module, page, tablename, columnname)
3394
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3395
3382
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3396
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3383
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3397
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3384
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
3398
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
(-)a/installer/data/mysql/updatedatabase.pl (+23 lines)
Lines 8202-8207 if ( CheckVersion($DBversion) ) { Link Here
8202
    SetVersion($DBversion);
8202
    SetVersion($DBversion);
8203
}
8203
}
8204
8204
8205
8206
8207
8208
8209
8210
$DBversion = "3.15.00.XXX";
8211
if ( CheckVersion($DBversion) ) {
8212
    $dbh->do(q{
8213
        CREATE TABLE IF NOT EXISTS columns_settings (
8214
            module varchar(255) NOT NULL,
8215
            page varchar(255) NOT NULL,
8216
            tablename varchar(255) NOT NULL,
8217
            columnname varchar(255) NOT NULL,
8218
            cannot_be_toggled int(1) NOT NULL DEFAULT 0,
8219
            is_hidden int(1) NOT NULL DEFAULT 0,
8220
            PRIMARY KEY(module, page, tablename, columnname)
8221
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8
8222
    });
8223
    print "Upgrade to $DBversion done (Bug 10212 - Create new table columns_settings)\n";
8224
    SetVersion ($DBversion);
8225
}
8226
8227
8205
=head1 FUNCTIONS
8228
=head1 FUNCTIONS
8206
8229
8207
=head2 TableExists($table)
8230
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc (+27 lines)
Line 0 Link Here
1
[% USE ColumnsSettings %]
2
3
<script type="text/javascript">
4
function KohaTable(selector, dt_parameters, columns_settings) {
5
    var id = 0;
6
    var hidden_ids = [];
7
    var excluded_ids = [];
8
    $(columns_settings).each( function() {
9
        if ( this['is_hidden'] == "1" ) {
10
            hidden_ids.push( id );
11
        }
12
        if ( this['cannot_be_toggled'] == "1" ) {
13
            excluded_ids.push( id );
14
        }
15
        id++;
16
    });
17
    dt_parameters[ "oColVis" ] = { "aiExclude": excluded_ids };
18
    var table = $(selector).dataTable($.extend(true, {}, dataTablesDefaults, dt_parameters));
19
20
    $(hidden_ids).each(function(index, value) {
21
        table.fnSetColumnVis( value, false );
22
    });
23
24
    return table;
25
}
26
27
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js (-1 / +1 lines)
Lines 23-29 var dataTablesDefaults = { Link Here
23
        "sSearch"           : window.MSG_DT_SEARCH || "Search:",
23
        "sSearch"           : window.MSG_DT_SEARCH || "Search:",
24
        "sZeroRecords"      : window.MSG_DT_ZERO_RECORDS || "No matching records found"
24
        "sZeroRecords"      : window.MSG_DT_ZERO_RECORDS || "No matching records found"
25
    },
25
    },
26
    "sDom": '<"top pager"ilpf>t<"bottom pager"ip>',
26
    "sDom": 'C<"top pager"ilpf>t<"bottom pager"ip>',
27
    "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, window.MSG_DT_ALL || "All"]],
27
    "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, window.MSG_DT_ALL || "All"]],
28
    "iDisplayLength": 20
28
    "iDisplayLength": 20
29
};
29
};
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt (+2 lines)
Lines 104-109 Link Here
104
	<dd>Define which servers to query for MARC data in the integrated Z39.50 client.</dd>
104
	<dd>Define which servers to query for MARC data in the integrated Z39.50 client.</dd>
105
    <dt><a href="/cgi-bin/koha/admin/didyoumean.pl">Did you mean?</a></dt>
105
    <dt><a href="/cgi-bin/koha/admin/didyoumean.pl">Did you mean?</a></dt>
106
    <dd>Choose which plugins to use to suggest searches to patrons and staff.</dd>
106
    <dd>Choose which plugins to use to suggest searches to patrons and staff.</dd>
107
    <dt><a href="/cgi-bin/koha/admin/columns_settings.pl">Configure columns</a></dt>
108
    <dd>Hide or show columns for tables.</dd>
107
</dl>
109
</dl>
108
</div>
110
</div>
109
111
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt (+131 lines)
Line 0 Link Here
1
[% BLOCK pagelist %]
2
<div class="pagelist">
3
  <form method="post" action="/cgi-bin/koha/admin/columns_settings.pl">
4
    <input type="hidden" name="action" value="save" />
5
    <input type="hidden" name="module" value="[% modulename %]" />
6
    [% FOR pagename IN module.keys %]
7
      <h5>[% pagename %]</h5>
8
      [% SET tables = module %]
9
      [% FOR tablename IN tables.$pagename.keys.sort %]
10
        <table>
11
          <caption>[% tablename %]</caption>
12
          <thead><tr><th>Column name</th><th>Is Hidden by default</th><th>Cannot be toggled</th></tr></thead>
13
          <tbody>
14
          [% FOR column IN tables.$pagename.$tablename %]
15
            <tr>
16
              <td>
17
                [% column.columnname %]
18
                <input type="hidden" name="columnid" value="[% pagename %]_[% tablename %]_[% column.columnname %]" />
19
              </td>
20
              <td>
21
                [% IF column.is_hidden %]
22
                  [% IF column.cannot_be_modified %]
23
                    <input type="checkbox" name="[% pagename %]_[% tablename %]_[% column.columnname %]_hidden" value="1" checked="checked" disabled="disabled" />
24
                    <input type="hidden" name="[% pagename %]_[% tablename %]_[% column.columnname %]_hidden" value="1" />
25
                  [% ELSE %]
26
                    <input type="checkbox" name="[% pagename %]_[% tablename %]_[% column.columnname %]_hidden" value="1" checked="checked" />
27
                  [% END %]
28
                [% ELSE %]
29
                  [% IF column.cannot_be_modified %]
30
                    <input type="checkbox" name="[% pagename %]_[% tablename %]_[% column.columnname %]_hidden" value="1" disabled="disabled" />
31
                    <input type="hidden" name="[% pagename %]_[% tablename %]_[% column.columnname %]_hidden" value="0" />
32
                  [% ELSE %]
33
                    <input type="checkbox" name="[% pagename %]_[% tablename %]_[% column.columnname %]_hidden" value="1" />
34
                  [% END %]
35
                [% END %]
36
              </td>
37
              <td>
38
                [% IF column.cannot_be_toggled %]
39
                  [% IF column.cannot_be_modified %]
40
                    <input type="checkbox" name="[% pagename %]_[% tablename %]_[% column.columnname %]_cannot_be_toggled" value="1" checked="checked" disabled="disabled" />
41
                    <input type="hidden" name="[% pagename %]_[% tablename %]_[% column.columnname %]_cannot_be_toggled" value="1" />
42
                  [% ELSE %]
43
                    <input type="checkbox" name="[% pagename %]_[% tablename %]_[% column.columnname %]_cannot_be_toggled" value="1" checked="checked" />
44
                  [% END %]
45
                [% ELSE %]
46
                  [% IF column.cannot_be_modified %]
47
                    <input type="checkbox" name="[% pagename %]_[% tablename %]_[% column.columnname %]_cannot_be_toggled" value="1" disabled="disabled" />
48
                    <input type="hidden" name="[% pagename %]_[% tablename %]_[% column.columnname %]_cannot_be_toggled" value="0" />
49
                  [% ELSE %]
50
                    <input type="checkbox" name="[% pagename %]_[% tablename %]_[% column.columnname %]_cannot_be_toggled" value="1" />
51
                  [% END %]
52
                [% END %]
53
              </td>
54
            </tr>
55
          [% END %]
56
          </tbody>
57
        </table>
58
      [% END %]
59
    [% END %]
60
    <input type="submit" value="Save" />
61
  </form>
62
</div>
63
[% END %]
64
65
[% INCLUDE 'doc-head-open.inc' %]
66
<title>Koha &rsaquo; Administration &rsaquo; Tables</title>
67
[% INCLUDE 'doc-head-close.inc' %]
68
<script type="text/javascript">
69
    $(document).ready( function() {
70
        $( "#modules" ).accordion({
71
            collapsible: true,
72
            autoHeight: false
73
        });
74
    });
75
</script>
76
</head>
77
<body id="admin_tables" class="admin">
78
[% INCLUDE 'header.inc' %]
79
[% INCLUDE 'cat-search.inc' %]
80
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; Columns settings</div>
81
82
<div id="doc3" class="yui-t2">
83
  <div id="bd">
84
    <div id="yui-main">
85
      <div class="yui-b">
86
        <h2>Columns settings</h2>
87
        <div id="modules">
88
          <h3><a href="#acqui">Acquisition</a></h3>
89
          <div id="acqui">
90
            Acquisition tables
91
          </div>
92
93
          <h3><a href="#admin">Administration</a></h3>
94
          <div id="admin">
95
            Administration tables
96
          </div>
97
98
          <h3><a href="#authorities">Authorities</a></h3>
99
          <div id="authorities">
100
            Authorities tables
101
          </div>
102
103
          <h3><a href="#acqui">Acquisition</a></h3>
104
          <div id="acqui">
105
            Acquisition tables
106
          </div>
107
108
          <h3><a href="#catalogue">Catalogue</a></h3>
109
          <div id="catalogue">
110
            Catalogue tables
111
          </div>
112
113
          <h3><a href="#cataloguing">Cataloguing</a></h3>
114
          <div id="cataloguing">
115
            Cataloguing tables
116
          </div>
117
118
          <h3><a href="#circulation">Circulation</a></h3>
119
          <div id="circulation">
120
            <h4>Circulation tables</h4>
121
            [% PROCESS pagelist module=modules.circ modulename="circ" %]
122
          </div>
123
        </div>
124
      </div>
125
    </div>
126
127
    <div class="yui-b">
128
      [% INCLUDE 'admin-menu.inc' %]
129
    </div>
130
  </div>
131
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-16 / +46 lines)
Lines 1-5 Link Here
1
[% USE Branches %]
1
[% USE Branches %]
2
[% USE KohaDates %]
2
[% USE KohaDates %]
3
[% USE ColumnsSettings %]
3
[% IF ( export_remove_fields OR export_with_csv_profile ) %]
4
[% IF ( export_remove_fields OR export_with_csv_profile ) %]
4
   [% SET exports_enabled = 1 %]
5
   [% SET exports_enabled = 1 %]
5
[% END %]
6
[% END %]
Lines 13-20 Link Here
13
</title>
14
</title>
14
[% INCLUDE 'doc-head-close.inc' %]
15
[% INCLUDE 'doc-head-close.inc' %]
15
[% INCLUDE 'calendar.inc' %]
16
[% INCLUDE 'calendar.inc' %]
16
[% IF ( UseTablesortForCirc ) %]<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
17
[% IF ( UseTablesortForCirc ) %]
17
[% INCLUDE 'datatables.inc' %][% END %]
18
  <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
19
  [% INCLUDE 'datatables.inc' %]
20
  <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.colvis.css" />
21
  <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.colvis.js"></script>
22
  [% INCLUDE 'columns_settings.inc' %]
23
[% END %]
18
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
24
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
19
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script>
25
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script>
20
[% INCLUDE 'timepicker.inc' %]
26
[% INCLUDE 'timepicker.inc' %]
Lines 26-32 var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); Link Here
26
[% IF ( UseTablesortForCirc && dateformat == 'metric' ) %]dt_add_type_uk_date();[% END %]
32
[% IF ( UseTablesortForCirc && dateformat == 'metric' ) %]dt_add_type_uk_date();[% END %]
27
[% IF ( borrowernumber ) %]if($.cookie("holdfor") != [% borrowernumber %]){ $.cookie("holdfor",null, { path: "/", expires: 0 }); }[% ELSE %]$.cookie("holdfor",null, { path: "/", expires: 0 });[% END %]
33
[% IF ( borrowernumber ) %]if($.cookie("holdfor") != [% borrowernumber %]){ $.cookie("holdfor",null, { path: "/", expires: 0 }); }[% ELSE %]$.cookie("holdfor",null, { path: "/", expires: 0 });[% END %]
28
[% UNLESS ( borrowernumber ) %][% UNLESS ( CGIselectborrower ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %]
34
[% UNLESS ( borrowernumber ) %][% UNLESS ( CGIselectborrower ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %]
29
	 $(document).ready(function() {
35
     $(document).ready(function() {
30
        $('#patronlists').tabs([% IF ( UseTablesortForCirc ) %]{
36
        $('#patronlists').tabs([% IF ( UseTablesortForCirc ) %]{
31
            // Correct table sizing for tables hidden in tabs
37
            // Correct table sizing for tables hidden in tabs
32
            // http://www.datatables.net/examples/api/tabs_and_scrolling.html
38
            // http://www.datatables.net/examples/api/tabs_and_scrolling.html
Lines 37-54 var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); Link Here
37
                }
43
                }
38
            }
44
            }
39
        }[% END %]);
45
        }[% END %]);
46
47
40
        [% IF ( UseTablesortForCirc ) %]
48
        [% IF ( UseTablesortForCirc ) %]
41
        $("#issuest").dataTable($.extend(true, {}, dataTablesDefaults, {
49
        if ( $("#issuest").length > 0 ) {
42
            "sDom": 't',
50
            columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issuest', 'json' ) %]
43
            "aaSorting": [],
51
            [% UNLESS exports_enabled %]
44
            "aoColumnDefs": [
52
                columns_settings = jQuery.grep(columns_settings, function(column) {
45
                { "aTargets": [ -1, -2[% IF ( exports_enabled ) %], -3[% END %] ], "bSortable": false, "bSearchable": false }
53
                    return column['columnname'] != 'export';
46
            ],
54
                } );
47
            "aoColumns": [
55
            [% END %]
48
                { "sType": "title-string" },{ "sType": "anti-the" },null,{ "sType": "title-string" },null,null,null,null,null,null[% IF ( exports_enabled ) %],null[% END %]
56
            var issuest = KohaTable("#issuest", {
49
            ],
57
                "sDom": 'C<"clearfix">t',
50
            "bPaginate": false
58
                "aaSorting": [],
51
        }));
59
                "aoColumnDefs": [
60
                    { "aTargets": [ -1, -2[% IF ( exports_enabled ) %], -3[% END %] ], "bSortable": false, "bSearchable": false },
61
                ],
62
                "aoColumns": [
63
                    { "sType": "title-string" },{ "sType": "anti-the" },null,{ "sType": "title-string" },null,null,null,null,null,null[% IF ( exports_enabled ) %],null[% END %]
64
                ],
65
                "bPaginate": false,
66
            }, columns_settings);
67
        }
68
69
        if ( $("#holdst").length > 0 ) {
70
            columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'holdst', 'json' ) %]
71
            var holdst = KohaTable("#holdst", {
72
                "sDom": 'C<"clearfix">t',
73
                "aaSorting": [],
74
                "aoColumnDefs": [
75
                    { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
76
                ],
77
                "aoColumns": [
78
                    { "sType": "natural" },{ "sType": "title-string" },{ "sType": "html" },null,null,null,null,null
79
                ],
80
                "bPaginate": false,
81
            }, columns_settings);
82
        }
52
83
53
        $("#relissuest").dataTable($.extend(true, {}, dataTablesDefaults, {
84
        $("#relissuest").dataTable($.extend(true, {}, dataTablesDefaults, {
54
            "sDom": 't',
85
            "sDom": 't',
Lines 1062-1068 No patron matched <span class="ex">[% message %]</span> Link Here
1062
		<tbody>
1093
		<tbody>
1063
        [% FOREACH reservloo IN reservloop %]
1094
        [% FOREACH reservloo IN reservloop %]
1064
        <tr class="[% reservloo.color %]">
1095
        <tr class="[% reservloo.color %]">
1065
                    <td>[% reservloo.reservedate %]</td>
1096
                    <td><span title="[% reservloo.reservedate_sort %]">[% reservloo.reservedate %]</span></td>
1066
                    <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% reservloo.biblionumber %]"><strong>[% reservloo.title |html %][% FOREACH subtitl IN reservloo.subtitle %] [% subtitl.subfield %][% END %]</strong></a>[% IF ( reservloo.author ) %], by [% reservloo.author %][% END %]</td>
1097
                    <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% reservloo.biblionumber %]"><strong>[% reservloo.title |html %][% FOREACH subtitl IN reservloo.subtitle %] [% subtitl.subfield %][% END %]</strong></a>[% IF ( reservloo.author ) %], by [% reservloo.author %][% END %]</td>
1067
                    <td>[% reservloo.itemcallnumber %]</td>
1098
                    <td>[% reservloo.itemcallnumber %]</td>
1068
					<td><em>[% IF ( reservloo.barcodereserv ) %]Item [% reservloo.barcodereserv %]
1099
					<td><em>[% IF ( reservloo.barcodereserv ) %]Item [% reservloo.barcodereserv %]
1069
- 

Return to bug 10212