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 358-363 if ($borrowernumber) { Link Here
358
        $getreserv{transfered}    = 0;
358
        $getreserv{transfered}    = 0;
359
        $getreserv{nottransfered} = 0;
359
        $getreserv{nottransfered} = 0;
360
360
361
        $getreserv{reservedate_sort} = $num_res->{'reservedate'};
361
        $getreserv{reservedate}    = format_date( $num_res->{'reservedate'} );
362
        $getreserv{reservedate}    = format_date( $num_res->{'reservedate'} );
362
        $getreserv{reservenumber}  = $num_res->{'reservenumber'};
363
        $getreserv{reservenumber}  = $num_res->{'reservenumber'};
363
        $getreserv{title}          = $getiteminfo->{'title'};
364
        $getreserv{title}          = $getiteminfo->{'title'};
(-)a/installer/data/mysql/kohastructure.sql (+11 lines)
Lines 3078-3083 CREATE TABLE IF NOT EXISTS plugin_data ( Link Here
3078
  PRIMARY KEY (plugin_class,plugin_key)
3078
  PRIMARY KEY (plugin_class,plugin_key)
3079
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3079
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3080
3080
3081
3082
CREATE TABLE IF NOT EXISTS columns_settings (
3083
    module varchar(255) NOT NULL,
3084
    page varchar(255) NOT NULL,
3085
    tablename varchar(255) NOT NULL,
3086
    columnname varchar(255) NOT NULL,
3087
    cannot_be_toggled int(1) NOT NULL DEFAULT 0,
3088
    is_hidden int(1) NOT NULL DEFAULT 0,
3089
    PRIMARY KEY(module, page, tablename, columnname)
3090
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3091
3081
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3092
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3082
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3093
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3083
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
3094
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
(-)a/installer/data/mysql/updatedatabase.pl (+16 lines)
Lines 6784-6789 if ( CheckVersion($DBversion) ) { Link Here
6784
    SetVersion ($DBversion);
6784
    SetVersion ($DBversion);
6785
}
6785
}
6786
6786
6787
$DBversion = "3.13.00.XXX";
6788
if ( CheckVersion($DBversion) ) {
6789
    $dbh->do(q{
6790
        CREATE TABLE IF NOT EXISTS columns_settings (
6791
            module varchar(255) NOT NULL,
6792
            page varchar(255) NOT NULL,
6793
            tablename varchar(255) NOT NULL,
6794
            columnname varchar(255) NOT NULL,
6795
            cannot_be_toggled int(1) NOT NULL DEFAULT 0,
6796
            is_hidden int(1) NOT NULL DEFAULT 0,
6797
            PRIMARY KEY(module, page, tablename, columnname)
6798
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8
6799
    });
6800
    print "Upgrade to $DBversion done (Bug 10212 - Create new table columns_settings)\n";
6801
    SetVersion ($DBversion);
6802
}
6787
6803
6788
=head1 FUNCTIONS
6804
=head1 FUNCTIONS
6789
6805
(-)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 (-2 / +3 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
Lines 493-496 jQuery.extend( jQuery.fn.dataTableExt.oSort, { Link Here
493
    "title-string-desc": function ( a, b ) {
493
    "title-string-desc": function ( a, b ) {
494
        return ((a < b) ? 1 : ((a > b) ? -1 : 0));
494
        return ((a < b) ? 1 : ((a > b) ? -1 : 0));
495
    }
495
    }
496
} );
496
} );
497
(-)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-4 Link Here
1
[% USE KohaDates %]
1
[% USE KohaDates %]
2
[% USE ColumnsSettings %]
2
[% IF ( export_remove_fields OR export_with_csv_profile ) %]
3
[% IF ( export_remove_fields OR export_with_csv_profile ) %]
3
   [% SET exports_enabled = 1 %]
4
   [% SET exports_enabled = 1 %]
4
[% END %]
5
[% END %]
Lines 12-21 Link Here
12
</title>
13
</title>
13
[% INCLUDE 'doc-head-close.inc' %]
14
[% INCLUDE 'doc-head-close.inc' %]
14
[% INCLUDE 'calendar.inc' %]
15
[% INCLUDE 'calendar.inc' %]
15
[% IF ( UseTablesortForCirc ) %]<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
16
[% IF ( UseTablesortForCirc ) %]
16
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
17
  <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
17
[% INCLUDE 'datatables-strings.inc' %]
18
  <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.colvis.css" />
18
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>[% END %]
19
  <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
20
  [% INCLUDE 'datatables-strings.inc' %]
21
  <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
22
  <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.colvis.js"></script>
23
  [% INCLUDE 'columns_settings.inc' %]
24
[% END %]
19
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
25
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
20
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script>
26
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script>
21
<script type="text/javascript">
27
<script type="text/javascript">
Lines 23-29 Link Here
23
[% IF ( UseTablesortForCirc && dateformat == 'metric' ) %]dt_add_type_uk_date();[% END %]
29
[% IF ( UseTablesortForCirc && dateformat == 'metric' ) %]dt_add_type_uk_date();[% END %]
24
[% IF ( borrowernumber ) %]if($.cookie("holdfor") != [% borrowernumber %]){ $.cookie("holdfor",null, { path: "/", expires: 0 }); }[% ELSE %]$.cookie("holdfor",null, { path: "/", expires: 0 });[% END %]
30
[% IF ( borrowernumber ) %]if($.cookie("holdfor") != [% borrowernumber %]){ $.cookie("holdfor",null, { path: "/", expires: 0 }); }[% ELSE %]$.cookie("holdfor",null, { path: "/", expires: 0 });[% END %]
25
[% UNLESS ( borrowernumber ) %][% UNLESS ( CGIselectborrower ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %]
31
[% UNLESS ( borrowernumber ) %][% UNLESS ( CGIselectborrower ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %]
26
	 $(document).ready(function() {
32
     $(document).ready(function() {
27
        $('#patronlists').tabs([% IF ( UseTablesortForCirc ) %]{
33
        $('#patronlists').tabs([% IF ( UseTablesortForCirc ) %]{
28
            // Correct table sizing for tables hidden in tabs
34
            // Correct table sizing for tables hidden in tabs
29
            // http://www.datatables.net/examples/api/tabs_and_scrolling.html
35
            // http://www.datatables.net/examples/api/tabs_and_scrolling.html
Lines 34-51 Link Here
34
                }
40
                }
35
            }
41
            }
36
        }[% END %]);
42
        }[% END %]);
43
44
37
        [% IF ( UseTablesortForCirc ) %]
45
        [% IF ( UseTablesortForCirc ) %]
38
        $("#issuest").dataTable($.extend(true, {}, dataTablesDefaults, {
46
39
            "sDom": 't',
47
        if ( $("#issuest").length > 0 ) {
40
            "aaSorting": [],
48
            columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issuest', 'json' ) %]
41
            "aoColumnDefs": [
49
            [% UNLESS exports_enabled %]
42
                { "aTargets": [ -1, -2[% IF ( exports_enabled ) %], -3[% END %] ], "bSortable": false, "bSearchable": false }
50
                columns_settings = jQuery.grep(columns_settings, function(column) {
43
            ],
51
                    return column['columnname'] != 'export';
44
            "aoColumns": [
52
                } );
45
                { "sType": "title-string" },{ "sType": "html" },null,{ "sType": "title-string" },null,null,null,null,null,null[% IF ( exports_enabled ) %],null[% END %]
53
            [% END %]
46
            ],
54
            var issuest = KohaTable("#issuest", {
47
            "bPaginate": false
55
                "sDom": 'C<"clearfix">t',
48
        }));
56
                "aaSorting": [],
57
                "aoColumnDefs": [
58
                    { "aTargets": [ -1, -2[% IF ( exports_enabled ) %], -3[% END %] ], "bSortable": false, "bSearchable": false },
59
                ],
60
                "aoColumns": [
61
                    { "sType": "title-string" },{ "sType": "html" },null,{ "sType": "title-string" },null,null,null,null,null,null[% IF ( exports_enabled ) %],null[% END %]
62
                ],
63
                "bPaginate": false,
64
            }, columns_settings);
65
        }
66
67
        if ( $("#holdst").length > 0 ) {
68
            columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'holdst', 'json' ) %]
69
            var holdst = KohaTable("#holdst", {
70
                "sDom": 'C<"clearfix">t',
71
                "aaSorting": [],
72
                "aoColumnDefs": [
73
                    { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
74
                ],
75
                "aoColumns": [
76
                    { "sType": "title-string" },{ "sType": "html" },null,null,null,null,null
77
                ],
78
                "bPaginate": false,
79
            }, columns_settings);
80
        }
49
81
50
        $("#relissuest").dataTable($.extend(true, {}, dataTablesDefaults, {
82
        $("#relissuest").dataTable($.extend(true, {}, dataTablesDefaults, {
51
            "sDom": 't',
83
            "sDom": 't',
Lines 1110-1116 No patron matched <span class="ex">[% message %]</span> Link Here
1110
		<tbody>
1142
		<tbody>
1111
        [% FOREACH reservloo IN reservloop %]
1143
        [% FOREACH reservloo IN reservloop %]
1112
        <tr class="[% reservloo.color %]">
1144
        <tr class="[% reservloo.color %]">
1113
                    <td>[% reservloo.reservedate %]</td>
1145
                    <td><span title="[% reservloo.reservedate_sort %]">[% reservloo.reservedate %]</span></td>
1114
                    <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% reservloo.biblionumber %]"><strong>[% reservloo.title |html %]</strong></a>[% IF ( reservloo.author ) %], by [% reservloo.author %][% END %]</td>
1146
                    <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% reservloo.biblionumber %]"><strong>[% reservloo.title |html %]</strong></a>[% IF ( reservloo.author ) %], by [% reservloo.author %][% END %]</td>
1115
                    <td>[% reservloo.itemcallnumber %]</td>
1147
                    <td>[% reservloo.itemcallnumber %]</td>
1116
					<td><em>[% IF ( reservloo.barcodereserv ) %]Item [% reservloo.barcodereserv %]
1148
					<td><em>[% IF ( reservloo.barcodereserv ) %]Item [% reservloo.barcodereserv %]
1117
- 

Return to bug 10212