aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/1.47_add_option_resources_hide_past_single_dates.php
blob: 1e442f8c3513e0a70704e944b1e8add64fa1b0e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?
class AddOptionResourcesHidePastSingleDates extends Migration
{
    function description ()
    {
        return 'add config option RESOURCES_HIDE_PAST_SINGLE_DATES and RESOURCES_ALLOW_ROOM_REQUESTS_ALL_ROOMS';
    }

    function up ()
    {
        $db = DBManager::get();
        $db->exec("
            INSERT IGNORE INTO `config` (
            `config_id` ,
            `parent_id` ,
            `field` ,
            `value` ,
            `is_default` ,
            `type` ,
            `range` ,
            `section` ,
            `position` ,
            `mkdate` ,
            `chdate` ,
            `description` ,
            `comment` ,
            `message_template`
            )
            VALUES (
            MD5( 'RESOURCES_HIDE_PAST_SINGLE_DATES' ) , '', 'RESOURCES_HIDE_PAST_SINGLE_DATES', '1', '1', 'boolean', 'global', '', '0', UNIX_TIMESTAMP( ) , UNIX_TIMESTAMP( ) , 'Schaltet in der Ressourcenverwaltung ein,ob bereits vergangene Terminen bei der Buchung und Planung brücksichtigt werden sollen', '', ''
            )
            ");
         $db->exec("INSERT IGNORE INTO `config` (
            `config_id` ,
            `parent_id` ,
            `field` ,
            `value` ,
            `is_default` ,
            `type` ,
            `range` ,
            `section` ,
            `position` ,
            `mkdate` ,
            `chdate` ,
            `description` ,
            `comment` ,
            `message_template`
            )
            VALUES (
            MD5( 'RESOURCES_ALLOW_ROOM_REQUESTS_ALL_ROOMS' ) , '', 'RESOURCES_ALLOW_ROOM_REQUESTS_ALL_ROOMS', '1', '1', 'boolean', 'global', '', '0', UNIX_TIMESTAMP( ) , UNIX_TIMESTAMP( ) , 'Schaltet in der Ressourcenverwaltung ein,ob alle Räume gewünscht werden können, oder nur eigene und ''Global'' gesetzte', '', ''
            )
            ");
    }

    function down ()
    {
        $db = DBManager::get();

        $db->exec("DELETE FROM config WHERE field IN('RESOURCES_HIDE_PAST_SINGLE_DATES','RESOURCES_ALLOW_ROOM_REQUESTS_ALL_ROOMS')");
    }
}
?>