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 389-394 if ($borrowernumber) { Link Here
389
        $getreserv{transfered}    = 0;
389
        $getreserv{transfered}    = 0;
390
        $getreserv{nottransfered} = 0;
390
        $getreserv{nottransfered} = 0;
391
391
392
        $getreserv{reservedate_sort} = $num_res->{'reservedate'};
392
        $getreserv{reservedate}    = format_date( $num_res->{'reservedate'} );
393
        $getreserv{reservedate}    = format_date( $num_res->{'reservedate'} );
393
        $getreserv{reserve_id}  = $num_res->{'reserve_id'};
394
        $getreserv{reserve_id}  = $num_res->{'reserve_id'};
394
        $getreserv{title}          = $getiteminfo->{'title'};
395
        $getreserv{title}          = $getiteminfo->{'title'};
(-)a/installer/data/mysql/kohastructure.sql (+11 lines)
Lines 3231-3236 CREATE TABLE IF NOT EXISTS plugin_data ( Link Here
3231
  PRIMARY KEY (plugin_class,plugin_key)
3231
  PRIMARY KEY (plugin_class,plugin_key)
3232
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3232
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3233
3233
3234
3235
CREATE TABLE IF NOT EXISTS columns_settings (
3236
    module varchar(255) NOT NULL,
3237
    page varchar(255) NOT NULL,
3238
    tablename varchar(255) NOT NULL,
3239
    columnname varchar(255) NOT NULL,
3240
    cannot_be_toggled int(1) NOT NULL DEFAULT 0,
3241
    is_hidden int(1) NOT NULL DEFAULT 0,
3242
    PRIMARY KEY(module, page, tablename, columnname)
3243
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3244
3234
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3245
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3235
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3246
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3236
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
3247
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
(-)a/installer/data/mysql/updatedatabase.pl (+25 lines)
Lines 7139-7144 if ( CheckVersion($DBversion) ) { Link Here
7139
    SetVersion ($DBversion);
7139
    SetVersion ($DBversion);
7140
}
7140
}
7141
7141
7142
7143
7144
7145
7146
7147
7148
7149
$DBversion = "3.13.00.XXX";
7150
if ( CheckVersion($DBversion) ) {
7151
    $dbh->do(q{
7152
        CREATE TABLE IF NOT EXISTS columns_settings (
7153
            module varchar(255) NOT NULL,
7154
            page varchar(255) NOT NULL,
7155
            tablename varchar(255) NOT NULL,
7156
            columnname varchar(255) NOT NULL,
7157
            cannot_be_toggled int(1) NOT NULL DEFAULT 0,
7158
            is_hidden int(1) NOT NULL DEFAULT 0,
7159
            PRIMARY KEY(module, page, tablename, columnname)
7160
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8
7161
    });
7162
    print "Upgrade to $DBversion done (Bug 10212 - Create new table columns_settings)\n";
7163
    SetVersion ($DBversion);
7164
}
7165
7166
7142
=head1 FUNCTIONS
7167
=head1 FUNCTIONS
7143
7168
7144
=head2 TableExists($table)
7169
=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
};
27
};
28
28
29
29
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt (+2 lines)
Lines 107-112 Link Here
107
	<dd>Define which servers to query for MARC data in the integrated Z39.50 client.</dd>
107
	<dd>Define which servers to query for MARC data in the integrated Z39.50 client.</dd>
108
    <dt><a href="/cgi-bin/koha/admin/didyoumean.pl">Did you mean?</a></dt>
108
    <dt><a href="/cgi-bin/koha/admin/didyoumean.pl">Did you mean?</a></dt>
109
    <dd>Choose which plugins to use to suggest searches to patrons and staff.</dd>
109
    <dd>Choose which plugins to use to suggest searches to patrons and staff.</dd>
110
    <dt><a href="/cgi-bin/koha/admin/columns_settings.pl">Configure columns</a></dt>
111
    <dd>Hide or show columns for tables.</dd>
110
</dl>
112
</dl>
111
</div>
113
</div>
112
114
(-)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 (-18 / +49 lines)
Lines 1-5 Link Here
1
[% USE KohaBranchName %]
1
[% USE KohaBranchName %]
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-22 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
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
18
  <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
18
[% INCLUDE 'datatables-strings.inc' %]
19
  <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.colvis.css" />
19
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>[% END %]
20
  <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
21
  [% INCLUDE 'datatables-strings.inc' %]
22
  <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
23
  <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.colvis.js"></script>
24
  [% INCLUDE 'columns_settings.inc' %]
25
[% END %]
20
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
26
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
21
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script>
27
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script>
22
<script type="text/javascript">
28
<script type="text/javascript">
Lines 24-30 Link Here
24
[% IF ( UseTablesortForCirc && dateformat == 'metric' ) %]dt_add_type_uk_date();[% END %]
30
[% IF ( UseTablesortForCirc && dateformat == 'metric' ) %]dt_add_type_uk_date();[% END %]
25
[% IF ( borrowernumber ) %]if($.cookie("holdfor") != [% borrowernumber %]){ $.cookie("holdfor",null, { path: "/", expires: 0 }); }[% ELSE %]$.cookie("holdfor",null, { path: "/", expires: 0 });[% END %]
31
[% IF ( borrowernumber ) %]if($.cookie("holdfor") != [% borrowernumber %]){ $.cookie("holdfor",null, { path: "/", expires: 0 }); }[% ELSE %]$.cookie("holdfor",null, { path: "/", expires: 0 });[% END %]
26
[% UNLESS ( borrowernumber ) %][% UNLESS ( CGIselectborrower ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %]
32
[% UNLESS ( borrowernumber ) %][% UNLESS ( CGIselectborrower ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %]
27
	 $(document).ready(function() {
33
     $(document).ready(function() {
28
        $('#patronlists').tabs([% IF ( UseTablesortForCirc ) %]{
34
        $('#patronlists').tabs([% IF ( UseTablesortForCirc ) %]{
29
            // Correct table sizing for tables hidden in tabs
35
            // Correct table sizing for tables hidden in tabs
30
            // http://www.datatables.net/examples/api/tabs_and_scrolling.html
36
            // http://www.datatables.net/examples/api/tabs_and_scrolling.html
Lines 35-52 Link Here
35
                }
41
                }
36
            }
42
            }
37
        }[% END %]);
43
        }[% END %]);
44
45
38
        [% IF ( UseTablesortForCirc ) %]
46
        [% IF ( UseTablesortForCirc ) %]
39
        $("#issuest").dataTable($.extend(true, {}, dataTablesDefaults, {
47
40
            "sDom": 't',
48
        if ( $("#issuest").length > 0 ) {
41
            "aaSorting": [],
49
            columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issuest', 'json' ) %]
42
            "aoColumnDefs": [
50
            [% UNLESS exports_enabled %]
43
                { "aTargets": [ -1, -2[% IF ( exports_enabled ) %], -3[% END %] ], "bSortable": false, "bSearchable": false }
51
                columns_settings = jQuery.grep(columns_settings, function(column) {
44
            ],
52
                    return column['columnname'] != 'export';
45
            "aoColumns": [
53
                } );
46
                { "sType": "title-string" },{ "sType": "html" },null,{ "sType": "title-string" },null,null,null,null,null,null[% IF ( exports_enabled ) %],null[% END %]
54
            [% END %]
47
            ],
55
            var issuest = KohaTable("#issuest", {
48
            "bPaginate": false
56
                "sDom": 'C<"clearfix">t',
49
        }));
57
                "aaSorting": [],
58
                "aoColumnDefs": [
59
                    { "aTargets": [ -1, -2[% IF ( exports_enabled ) %], -3[% END %] ], "bSortable": false, "bSearchable": false },
60
                ],
61
                "aoColumns": [
62
                    { "sType": "title-string" },{ "sType": "html" },null,{ "sType": "title-string" },null,null,null,null,null,null[% IF ( exports_enabled ) %],null[% END %]
63
                ],
64
                "bPaginate": false,
65
            }, columns_settings);
66
        }
67
68
        if ( $("#holdst").length > 0 ) {
69
            columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'holdst', 'json' ) %]
70
            var holdst = KohaTable("#holdst", {
71
                "sDom": 'C<"clearfix">t',
72
                "aaSorting": [],
73
                "aoColumnDefs": [
74
                    { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
75
                ],
76
                "aoColumns": [
77
                    { "sType": "natural" },{ "sType": "title-string" },{ "sType": "html" },null,null,null,null,null
78
                ],
79
                "bPaginate": false,
80
            }, columns_settings);
81
        }
50
82
51
        $("#relissuest").dataTable($.extend(true, {}, dataTablesDefaults, {
83
        $("#relissuest").dataTable($.extend(true, {}, dataTablesDefaults, {
52
            "sDom": 't',
84
            "sDom": 't',
Lines 1137-1143 No patron matched <span class="ex">[% message %]</span> Link Here
1137
		<tbody>
1169
		<tbody>
1138
        [% FOREACH reservloo IN reservloop %]
1170
        [% FOREACH reservloo IN reservloop %]
1139
        <tr class="[% reservloo.color %]">
1171
        <tr class="[% reservloo.color %]">
1140
                    <td>[% reservloo.reservedate %]</td>
1172
                    <td><span title="[% reservloo.reservedate_sort %]">[% reservloo.reservedate %]</span></td>
1141
                    <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>
1173
                    <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>
1142
                    <td>[% reservloo.itemcallnumber %]</td>
1174
                    <td>[% reservloo.itemcallnumber %]</td>
1143
					<td><em>[% IF ( reservloo.barcodereserv ) %]Item [% reservloo.barcodereserv %]
1175
					<td><em>[% IF ( reservloo.barcodereserv ) %]Item [% reservloo.barcodereserv %]
1144
- 

Return to bug 10212