Changeset 1769 for trunk


Ignore:
Timestamp:
05/16/16 14:03:49 (8 years ago)
Author:
nanardon
Message:

Permettre le graph des status passé

Location:
trunk/LATMOS-Accounts-Web
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Json/Employment.pm

    r1758 r1769  
    3232    my %employments; 
    3333    my $now = DateTime->now->ymd; 
     34    my $past = $c->req->param('past'); 
    3435 
    3536    my $key = $c->req->param('key') || 'department'; 
     
    5354    my %keysentry; 
    5455    foreach my $emp (keys %start) { 
    55         # We filter pasted employment 
    56         next if ($end{$emp}[0] && $end{$emp}[0] lt $now); 
     56        if (!$past) { 
     57            # We filter pasted employment 
     58            next if ($end{$emp}[0] && $end{$emp}[0] lt $now); 
     59        } 
    5760 
    5861        if ($filterobj eq 'user') { 
     
    8083    foreach (map { $employments{$_}->{start}  } 
    8184             grep { $employments{$_}->{start} } (keys %employments)) { 
    82              $_ gt $now or next; 
     85             if (!$past) { 
     86                $_ gt $now or next; 
     87             } 
    8388             my $dt = DateTime->from_epoch( epoch => str2time($_)); 
    8489             $dt->set_time_zone( DateTime::TimeZone->new( name => 'local' ) ); 
     
    8893    foreach (map { $employments{$_}->{end}  } 
    8994             grep { $employments{$_}->{end} } (keys %employments)) { 
    90              $_ gt $now or next; 
     95             if (!$past) { 
     96                $_ gt $now or next; 
     97             } 
    9198             my $dt = DateTime->from_epoch( epoch => str2time($_)); 
    9299             $dt->set_time_zone( DateTime::TimeZone->new( name => 'local' ) ); 
  • trunk/LATMOS-Accounts-Web/root/html/summary/employment/index.tt

    r1720 r1769  
    1313<input name=filter value=[% c.req.param('filter') | html %]> 
    1414<br> 
    15 <input name=stacked type=checkbox value=on [% 'checked' IF c.req.param('stacked') %]> 
     15<input name=past type=checkbox value=on id=past [% 'checked' IF c.req.param('past') %]> 
     16<label for=past>Afficher les dates passées</label> 
     17<br> 
     18<input name=stacked id=stacked type=checkbox value=on [% 'checked' IF c.req.param('stacked') %]> 
    1619<label for=stacked>[% l('Stacked') %]</label> 
    1720<input type=submit> 
     
    2932      //async: false, 
    3033      url: "[% c.uri_for('/json/employment', { 
    31             key => c.req.param('key'), filter 
    32             => c.req.param('filter') 
     34            key => c.req.param('key'),  
     35            filter => c.req.param('filter') 
     36            past => c.req.param('past') 
    3337        }) %]", 
    3438      dataType:"json", 
Note: See TracChangeset for help on using the changeset viewer.