Changeset 1303 for trunk/LATMOS-Accounts


Ignore:
Timestamp:
03/27/15 15:17:51 (9 years ago)
Author:
nanardon
Message:

add Services object (step to Itil)

Location:
trunk/LATMOS-Accounts
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm

    r1300 r1303  
    103103    $info->{exported}   = { inline => 1, formtype => 'CHECKBOX', hide => 1, monitored => 1 }; 
    104104    $info->{unexported} = { inline => 1, formtype => 'CHECKBOX', }; 
     105    $info->{services}   = { inline => 1, ro => 1, }; 
    105106 
    106107    $info 
     
    250251    if ($field eq 'unexported') { 
    251252        return $self->get_field('exported') ? undef : 1; 
     253    } 
     254    if ($field eq 'services') { 
     255        my @services; 
     256        my $sth = $self->db->prepare_cached( 
     257            q{ select name from service join service_attributes 
     258               on okey = ikey 
     259               where service_attributes.attr = 'dependOn' and value = ? 
     260               }); 
     261        $sth->execute($self->type . '.' . $self->id); 
     262        while(my $res = $sth->fetchrow_hashref) { 
     263            push(@services, $res->{name}); 
     264        } 
     265        return \@services;  
    252266    } 
    253267    my $attr = $self->attribute($field) or return; 
  • trunk/LATMOS-Accounts/sqldata/attributes.csv

    r1302 r1303  
    112112"aliases","comment","Comment" 
    113113"nethost","related","Machine en relation" 
     114"service","dependOn", "Dépend de" 
     115"service","manager", "Gestionnaire" 
     116"service","description", "" 
     117"service","comment", "" 
Note: See TracChangeset for help on using the changeset viewer.