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

(-)a/C4/Utils/DataTables/VirtualShelves.pm (-1 / +1 lines)
Lines 31-37 sub search { Link Here
31
    # But the code is too dirty to refactor...
31
    # But the code is too dirty to refactor...
32
    my $select = q|
32
    my $select = q|
33
        SELECT vs.shelfnumber, vs.shelfname, vs.owner, vs.category AS type,
33
        SELECT vs.shelfnumber, vs.shelfname, vs.owner, vs.category AS type,
34
        vs.creation_time, vs.lastmodified as modification_time,
34
        vs.created_on, vs.lastmodified as modification_time,
35
        bo.surname, bo.firstname, vs.sortfield as sortby,
35
        bo.surname, bo.firstname, vs.sortfield as sortby,
36
        count(vc.biblionumber) as count
36
        count(vc.biblionumber) as count
37
    |;
37
    |;
(-)a/C4/VirtualShelves.pm (-1 / +1 lines)
Lines 322-328 sub AddShelf { Link Here
322
    return -1 unless _CheckShelfName($hashref->{shelfname}, $hashref->{category}, $owner, 0);
322
    return -1 unless _CheckShelfName($hashref->{shelfname}, $hashref->{category}, $owner, 0);
323
323
324
    my $query = q|INSERT INTO virtualshelves
324
    my $query = q|INSERT INTO virtualshelves
325
        (shelfname,owner,category,sortfield,allow_add,allow_delete_own,allow_delete_other, creation_time)
325
        (shelfname,owner,category,sortfield,allow_add,allow_delete_own,allow_delete_other, created_on)
326
        VALUES (?,?,?,?,?,?,?, NOW())
326
        VALUES (?,?,?,?,?,?,?, NOW())
327
    |;
327
    |;
328
328
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 2320-2326 CREATE TABLE `virtualshelves` ( -- information about lists (or virtual shelves) Link Here
2320
  `category` varchar(1) default NULL, -- type of list (private [1], public [2])
2320
  `category` varchar(1) default NULL, -- type of list (private [1], public [2])
2321
  `sortfield` varchar(16) default NULL, -- the field this list is sorted on
2321
  `sortfield` varchar(16) default NULL, -- the field this list is sorted on
2322
  `lastmodified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time the list was last modified
2322
  `lastmodified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time the list was last modified
2323
  `creation_time` TIMESTAMP NOT NULL, -- creation time
2323
  `created_on` TIMESTAMP NOT NULL, -- creation time
2324
  `allow_add` tinyint(1) default 0, -- permission for adding entries to list
2324
  `allow_add` tinyint(1) default 0, -- permission for adding entries to list
2325
  `allow_delete_own` tinyint(1) default 1, -- permission for deleting entries frm list that you added yourself
2325
  `allow_delete_own` tinyint(1) default 1, -- permission for deleting entries frm list that you added yourself
2326
  `allow_delete_other` tinyint(1) default 0, -- permission for deleting entries from list that another person added
2326
  `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 9603-9618 $DBversion = "3.19.00.XXX"; Link Here
9603
if ( CheckVersion($DBversion) ) {
9603
if ( CheckVersion($DBversion) ) {
9604
    $dbh->do(q|
9604
    $dbh->do(q|
9605
        ALTER TABLE virtualshelves
9605
        ALTER TABLE virtualshelves
9606
        ADD COLUMN creation_time TIMESTAMP NOT NULL AFTER lastmodified
9606
        ADD COLUMN created_on TIMESTAMP NOT NULL AFTER lastmodified
9607
    |);
9607
    |);
9608
    # Set creation_time = lastmodified
9608
    # Set created_on = lastmodified
9609
    # I would say it's better than 0000-00-00
9609
    # I would say it's better than 0000-00-00
9610
    # Set modified to the existing value (do not get the current ts!)
9610
    # Set modified to the existing value (do not get the current ts!)
9611
    $dbh->do(q|
9611
    $dbh->do(q|
9612
        UPDATE virtualshelves
9612
        UPDATE virtualshelves
9613
        SET creation_time = lastmodified, lastmodified = lastmodified
9613
        SET created_on = lastmodified, lastmodified = lastmodified
9614
    |);
9614
    |);
9615
    print "Upgrade to $DBversion done (Bug XXXXX: Add DB field virtualshelves.creation_time)\n";
9615
    print "Upgrade to $DBversion done (Bug XXXXX: Add DB field virtualshelves.created_on)\n";
9616
    SetVersion ($DBversion);
9616
    SetVersion ($DBversion);
9617
}
9617
}
9618
9618
(-)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