File: tutorialdata

package info (click to toggle)
request-tracker5 5.0.7%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 79,580 kB
  • sloc: javascript: 191,835; perl: 87,099; sh: 1,412; makefile: 487; python: 37; php: 15
file content (98 lines) | stat: -rw-r--r-- 3,165 bytes parent folder | download | duplicates (7)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@Users = (
    {  Name         => 'asset-tutorial-staff',
       RealName     => 'Asset Staff User',
       Password     => 'password',
       EmailAddress => "asset-tutorial-staff\@localhost",
       Comments     => "Sample Staff user for Assets tutorial",
       Privileged   => '1',
    },
    {  Name         => 'asset-tutorial-user1',
       RealName     => 'Asset End User',
       Password     => 'password',
       EmailAddress => "asset-tutorial-user1\@localhost",
       Comments     => "Sample end user for Assets tutorial",
    },
);

@CustomFields = (
    {   Name       => 'Serial Number',
        Type       => 'FreeformSingle',
        LookupType => 'RT::Catalog-RT::Asset',
        ApplyTo    => 'General assets',
    },
    {   Name       => 'Tracking Number',
        Type       => 'FreeformSingle',
        LookupType => 'RT::Catalog-RT::Asset',
        ApplyTo    => 'General assets',
    },
    {   Name       => 'Manufacturer',
        Type       => 'SelectSingle',
        LookupType => 'RT::Catalog-RT::Asset',
        ApplyTo    => 'General assets',
        MaxValues  => 1,
        RenderType => 'Dropdown',
        Values      => [
            { Name => 'Apple', SortOrder => 1 },
            { Name => 'Dell', SortOrder => 2 }, ],
    },
    {   Name       => 'Type',
        Type       => 'SelectSingle',
        LookupType => 'RT::Catalog-RT::Asset',
        ApplyTo    => 'General assets',
        MaxValues  => 1,
        RenderType => 'Dropdown',
        Values      => [
            { Name => 'Desktop Computer', SortOrder => 1 },
            { Name => 'Laptop Computer', SortOrder => 2 },
            { Name => 'Server', SortOrder => 3 },
            { Name => 'Mobile Phone', SortOrder => 4 },
            { Name => 'Software', SortOrder => 5 },
            { Name => 'Other', SortOrder => 6 }, ],
    },
    {   Name    => 'Issue Date',
        Type    => 'Date',
        LookupType => 'RT::Catalog-RT::Asset',
        ApplyTo    => 'General assets',
    },
    {   Name    => 'Support Expiration',
        Type    => 'Date',
        LookupType => 'RT::Catalog-RT::Asset',
        ApplyTo    => 'General assets',
    },
);

push @ACL,
        {
            Right       => 'ShowAssetsMenu',
            GroupDomain => 'SystemInternal',
            GroupType   => 'Privileged',
        };

push @ACL, map {
        {
            Right       => $_,
            GroupDomain => 'SystemInternal',
            GroupType   => 'Privileged',
            ObjectType  => 'RT::Catalog',
            ObjectId    => 'General assets',
        }
    } qw(ShowAsset ShowCatalog SeeCustomField CreateAsset
         ModifyAsset ModifyCustomField);

push @ACL, map {
        {
            Right       => $_,
            GroupDomain => 'RT::System-Role',
            GroupType   => 'HeldBy',
        }
    } qw(ShowAsset ShowCatalog);

push @Final, sub {
    # Update default catalog name
    my $catalog = RT::Catalog->new(RT->SystemUser);
    my ($ret, $msg) = $catalog->Load('General assets');
    RT::Logger->error("Unable to load General assets catalog: $msg")
        unless $ret;
    $catalog->SetName('IT Department Assets');
    return;
};