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 388-393 if ($borrowernumber) { Link Here
388
        $getreserv{transfered}    = 0;
388
        $getreserv{transfered}    = 0;
389
        $getreserv{nottransfered} = 0;
389
        $getreserv{nottransfered} = 0;
390
390
391
        $getreserv{reservedate_sort} = $num_res->{'reservedate'};
391
        $getreserv{reservedate}    = format_date( $num_res->{'reservedate'} );
392
        $getreserv{reservedate}    = format_date( $num_res->{'reservedate'} );
392
        $getreserv{reserve_id}  = $num_res->{'reserve_id'};
393
        $getreserv{reserve_id}  = $num_res->{'reserve_id'};
393
        $getreserv{title}          = $getiteminfo->{'title'};
394
        $getreserv{title}          = $getiteminfo->{'title'};
(-)a/installer/data/mysql/kohastructure.sql (+14 lines)
Lines 3393-3398 CREATE TABLE IF NOT EXISTS marc_modification_template_actions ( Link Here
3393
  CONSTRAINT `mmta_ibfk_1` FOREIGN KEY (`template_id`) REFERENCES `marc_modification_templates` (`template_id`) ON DELETE CASCADE ON UPDATE CASCADE
3393
  CONSTRAINT `mmta_ibfk_1` FOREIGN KEY (`template_id`) REFERENCES `marc_modification_templates` (`template_id`) ON DELETE CASCADE ON UPDATE CASCADE
3394
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
3394
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
3395
3395
3396
--
3397
-- Table structure for table `columns_settings`
3398
--
3399
3400
CREATE TABLE IF NOT EXISTS columns_settings (
3401
    module varchar(255) NOT NULL,
3402
    page varchar(255) NOT NULL,
3403
    tablename varchar(255) NOT NULL,
3404
    columnname varchar(255) NOT NULL,
3405
    cannot_be_toggled int(1) NOT NULL DEFAULT 0,
3406
    is_hidden int(1) NOT NULL DEFAULT 0,
3407
    PRIMARY KEY(module, page, tablename, columnname)
3408
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3409
3396
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3410
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3397
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3411
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3398
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
3412
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
(-)a/installer/data/mysql/updatedatabase.pl (+24 lines)
Lines 7912-7917 if ( CheckVersion($DBversion) ) { Link Here
7912
    SetVersion($DBversion);
7912
    SetVersion($DBversion);
7913
}
7913
}
7914
7914
7915
7916
7917
7918
7919
7920
7921
$DBversion = "3.15.00.XXX";
7922
if ( CheckVersion($DBversion) ) {
7923
    $dbh->do(q{
7924
        CREATE TABLE IF NOT EXISTS columns_settings (
7925
            module varchar(255) NOT NULL,
7926
            page varchar(255) NOT NULL,
7927
            tablename varchar(255) NOT NULL,
7928
            columnname varchar(255) NOT NULL,
7929
            cannot_be_toggled int(1) NOT NULL DEFAULT 0,
7930
            is_hidden int(1) NOT NULL DEFAULT 0,
7931
            PRIMARY KEY(module, page, tablename, columnname)
7932
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8
7933
    });
7934
    print "Upgrade to $DBversion done (Bug 10212 - Create new table columns_settings)\n";
7935
    SetVersion ($DBversion);
7936
}
7937
7938
7915
=head1 FUNCTIONS
7939
=head1 FUNCTIONS
7916
7940
7917
=head2 TableExists($table)
7941
=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 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-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" src="[% themelang %]/js/pages/circulation.js"></script>
28
<script type="text/javascript" src="[% themelang %]/js/pages/circulation.js"></script>
Lines 27-33 var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); Link Here
27
[% IF ( UseTablesortForCirc && dateformat == 'metric' ) %]dt_add_type_uk_date();[% END %]
33
[% IF ( UseTablesortForCirc && dateformat == 'metric' ) %]dt_add_type_uk_date();[% END %]
28
[% IF ( borrowernumber ) %]if($.cookie("holdfor") != [% borrowernumber %]){ $.cookie("holdfor",null, { path: "/", expires: 0 }); }[% ELSE %]$.cookie("holdfor",null, { path: "/", expires: 0 });[% END %]
34
[% IF ( borrowernumber ) %]if($.cookie("holdfor") != [% borrowernumber %]){ $.cookie("holdfor",null, { path: "/", expires: 0 }); }[% ELSE %]$.cookie("holdfor",null, { path: "/", expires: 0 });[% END %]
29
[% UNLESS ( borrowernumber ) %][% UNLESS ( CGIselectborrower ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %]
35
[% UNLESS ( borrowernumber ) %][% UNLESS ( CGIselectborrower ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %]
30
	 $(document).ready(function() {
36
     $(document).ready(function() {
31
        $('#patronlists').tabs([% IF ( UseTablesortForCirc ) %]{
37
        $('#patronlists').tabs([% IF ( UseTablesortForCirc ) %]{
32
            // Correct table sizing for tables hidden in tabs
38
            // Correct table sizing for tables hidden in tabs
33
            // http://www.datatables.net/examples/api/tabs_and_scrolling.html
39
            // http://www.datatables.net/examples/api/tabs_and_scrolling.html
Lines 38-55 var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); Link Here
38
                }
44
                }
39
            }
45
            }
40
        }[% END %]);
46
        }[% END %]);
47
48
41
        [% IF ( UseTablesortForCirc ) %]
49
        [% IF ( UseTablesortForCirc ) %]
42
        $("#issuest").dataTable($.extend(true, {}, dataTablesDefaults, {
50
43
            "sDom": 't',
51
        if ( $("#issuest").length > 0 ) {
44
            "aaSorting": [],
52
            columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issuest', 'json' ) %]
45
            "aoColumnDefs": [
53
            [% UNLESS exports_enabled %]
46
                { "aTargets": [ -1, -2[% IF ( exports_enabled ) %], -3[% END %] ], "bSortable": false, "bSearchable": false }
54
                columns_settings = jQuery.grep(columns_settings, function(column) {
47
            ],
55
                    return column['columnname'] != 'export';
48
            "aoColumns": [
56
                } );
49
                { "sType": "title-string" },{ "sType": "html" },null,{ "sType": "title-string" },null,null,null,null,null,null[% IF ( exports_enabled ) %],null[% END %]
57
            [% END %]
50
            ],
58
            var issuest = KohaTable("#issuest", {
51
            "bPaginate": false
59
                "sDom": 'C<"clearfix">t',
52
        }));
60
                "aaSorting": [],
61
                "aoColumnDefs": [
62
                    { "aTargets": [ -1, -2[% IF ( exports_enabled ) %], -3[% END %] ], "bSortable": false, "bSearchable": false },
63
                ],
64
                "aoColumns": [
65
                    { "sType": "title-string" },{ "sType": "html" },null,{ "sType": "title-string" },null,null,null,null,null,null[% IF ( exports_enabled ) %],null[% END %]
66
                ],
67
                "bPaginate": false,
68
            }, columns_settings);
69
        }
70
71
        if ( $("#holdst").length > 0 ) {
72
            columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'holdst', 'json' ) %]
73
            var holdst = KohaTable("#holdst", {
74
                "sDom": 'C<"clearfix">t',
75
                "aaSorting": [],
76
                "aoColumnDefs": [
77
                    { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
78
                ],
79
                "aoColumns": [
80
                    { "sType": "natural" },{ "sType": "title-string" },{ "sType": "html" },null,null,null,null,null
81
                ],
82
                "bPaginate": false,
83
            }, columns_settings);
84
        }
53
85
54
        $("#relissuest").dataTable($.extend(true, {}, dataTablesDefaults, {
86
        $("#relissuest").dataTable($.extend(true, {}, dataTablesDefaults, {
55
            "sDom": 't',
87
            "sDom": 't',
Lines 1035-1041 No patron matched <span class="ex">[% message %]</span> Link Here
1035
		<tbody>
1067
		<tbody>
1036
        [% FOREACH reservloo IN reservloop %]
1068
        [% FOREACH reservloo IN reservloop %]
1037
        <tr class="[% reservloo.color %]">
1069
        <tr class="[% reservloo.color %]">
1038
                    <td>[% reservloo.reservedate %]</td>
1070
                    <td><span title="[% reservloo.reservedate_sort %]">[% reservloo.reservedate %]</span></td>
1039
                    <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>
1071
                    <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>
1040
                    <td>[% reservloo.itemcallnumber %]</td>
1072
                    <td>[% reservloo.itemcallnumber %]</td>
1041
					<td><em>[% IF ( reservloo.barcodereserv ) %]Item [% reservloo.barcodereserv %]
1073
					<td><em>[% IF ( reservloo.barcodereserv ) %]Item [% reservloo.barcodereserv %]
1042
- 

Return to bug 10212