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

(-)a/C4/Utils/DataTables/VirtualShelves.pm (-1 / +1 lines)
Lines 32-38 sub search { Link Here
32
    # But the code is too dirty to refactor...
32
    # But the code is too dirty to refactor...
33
    my $select = q|
33
    my $select = q|
34
        SELECT vs.shelfnumber, vs.shelfname, vs.owner, vs.category AS type,
34
        SELECT vs.shelfnumber, vs.shelfname, vs.owner, vs.category AS type,
35
        vs.creation_time, vs.lastmodified as modification_time,
35
        vs.created_on, vs.lastmodified as modification_time,
36
        bo.surname, bo.firstname, vs.sortfield as sortby,
36
        bo.surname, bo.firstname, vs.sortfield as sortby,
37
        count(vc.biblionumber) as count
37
        count(vc.biblionumber) as count
38
    |;
38
    |;
(-)a/C4/VirtualShelves.pm (-1 / +1 lines)
Lines 318-324 sub AddShelf { Link Here
318
    return -1 unless _CheckShelfName($hashref->{shelfname}, $hashref->{category}, $owner, 0);
318
    return -1 unless _CheckShelfName($hashref->{shelfname}, $hashref->{category}, $owner, 0);
319
319
320
    my $query = q|INSERT INTO virtualshelves
320
    my $query = q|INSERT INTO virtualshelves
321
        (shelfname,owner,category,sortfield,allow_add,allow_delete_own,allow_delete_other, creation_time)
321
        (shelfname,owner,category,sortfield,allow_add,allow_delete_own,allow_delete_other, created_on)
322
        VALUES (?,?,?,?,?,?,?, NOW())
322
        VALUES (?,?,?,?,?,?,?, NOW())
323
    |;
323
    |;
324
324
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 2311-2317 CREATE TABLE `virtualshelves` ( -- information about lists (or virtual shelves) Link Here
2311
  `category` varchar(1) default NULL, -- type of list (private [1], public [2])
2311
  `category` varchar(1) default NULL, -- type of list (private [1], public [2])
2312
  `sortfield` varchar(16) default NULL, -- the field this list is sorted on
2312
  `sortfield` varchar(16) default NULL, -- the field this list is sorted on
2313
  `lastmodified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time the list was last modified
2313
  `lastmodified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time the list was last modified
2314
  `creation_time` TIMESTAMP NOT NULL, -- creation time
2314
  `created_on` TIMESTAMP NOT NULL, -- creation time
2315
  `allow_add` tinyint(1) default 0, -- permission for adding entries to list
2315
  `allow_add` tinyint(1) default 0, -- permission for adding entries to list
2316
  `allow_delete_own` tinyint(1) default 1, -- permission for deleting entries frm list that you added yourself
2316
  `allow_delete_own` tinyint(1) default 1, -- permission for deleting entries frm list that you added yourself
2317
  `allow_delete_other` tinyint(1) default 0, -- permission for deleting entries from list that another person added
2317
  `allow_delete_other` tinyint(1) default 0, -- permission for deleting entries from list that another person added
(-)a/installer/data/mysql/updatedatabase.pl (-4 / +4 lines)
Lines 10319-10334 $DBversion = "3.19.00.XXX"; Link Here
10319
if ( CheckVersion($DBversion) ) {
10319
if ( CheckVersion($DBversion) ) {
10320
    $dbh->do(q|
10320
    $dbh->do(q|
10321
        ALTER TABLE virtualshelves
10321
        ALTER TABLE virtualshelves
10322
        ADD COLUMN creation_time TIMESTAMP NOT NULL AFTER lastmodified
10322
        ADD COLUMN created_on TIMESTAMP NOT NULL AFTER lastmodified
10323
    |);
10323
    |);
10324
    # Set creation_time = lastmodified
10324
    # Set created_on = lastmodified
10325
    # I would say it's better than 0000-00-00
10325
    # I would say it's better than 0000-00-00
10326
    # Set modified to the existing value (do not get the current ts!)
10326
    # Set modified to the existing value (do not get the current ts!)
10327
    $dbh->do(q|
10327
    $dbh->do(q|
10328
        UPDATE virtualshelves
10328
        UPDATE virtualshelves
10329
        SET creation_time = lastmodified, lastmodified = lastmodified
10329
        SET created_on = lastmodified, lastmodified = lastmodified
10330
    |);
10330
    |);
10331
    print "Upgrade to $DBversion done (Bug XXXXX: Add DB field virtualshelves.creation_time)\n";
10331
    print "Upgrade to $DBversion done (Bug XXXXX: Add DB field virtualshelves.created_on)\n";
10332
    SetVersion ($DBversion);
10332
    SetVersion ($DBversion);
10333
}
10333
}
10334
10334
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt (-1 / +1 lines)
Lines 54-60 $(document).ready(function(){ Link Here
54
            { 'mDataProp': 'dt_count' },
54
            { 'mDataProp': 'dt_count' },
55
            { 'mDataProp': 'dt_owner' },
55
            { 'mDataProp': 'dt_owner' },
56
            { 'mDataProp': 'dt_sortby' },
56
            { 'mDataProp': 'dt_sortby' },
57
            { 'mDataProp': 'dt_creation_time' },
57
            { 'mDataProp': 'dt_created_on' },
58
            { 'mDataProp': 'dt_modification_time' },
58
            { 'mDataProp': 'dt_modification_time' },
59
            { 'mDataProp': 'dt_action', 'bSortable': false }
59
            { 'mDataProp': 'dt_action', 'bSortable': false }
60
        ],
60
        ],
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt (-3 / +2 lines)
Lines 16-23 Link Here
16
                    "<a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.owner %]'>[% data.firstname %] [% data.surname %]</a>",
16
                    "<a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.owner %]'>[% data.firstname %] [% data.surname %]</a>",
17
                "dt_sortby":
17
                "dt_sortby":
18
                    [% IF data.sortby == "author" %]"Author"[% ELSIF data.sortby == "copyrightdate" %]"Year"[% ELSIF data.sortby == "itemcallnumber" %]"Call number"[% ELSE %]"Title"[% END %],
18
                    [% IF data.sortby == "author" %]"Author"[% ELSIF data.sortby == "copyrightdate" %]"Year"[% ELSIF data.sortby == "itemcallnumber" %]"Call number"[% ELSE %]"Title"[% END %],
19
                "dt_creation_time":
19
                "dt_created_on":
20
                    "[% data.creation_time | $KohaDates %]",
20
                    "[% data.created_on | $KohaDates %]",
21
                "dt_modification_time":
21
                "dt_modification_time":
22
                    "[% data.modification_time | $KohaDates %]",
22
                    "[% data.modification_time | $KohaDates %]",
23
                "dt_action":
23
                "dt_action":
24
- 

Return to bug 13421