- Timestamp:
- 05/16/16 14:03:49 (8 years ago)
- 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 32 32 my %employments; 33 33 my $now = DateTime->now->ymd; 34 my $past = $c->req->param('past'); 34 35 35 36 my $key = $c->req->param('key') || 'department'; … … 53 54 my %keysentry; 54 55 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 } 57 60 58 61 if ($filterobj eq 'user') { … … 80 83 foreach (map { $employments{$_}->{start} } 81 84 grep { $employments{$_}->{start} } (keys %employments)) { 82 $_ gt $now or next; 85 if (!$past) { 86 $_ gt $now or next; 87 } 83 88 my $dt = DateTime->from_epoch( epoch => str2time($_)); 84 89 $dt->set_time_zone( DateTime::TimeZone->new( name => 'local' ) ); … … 88 93 foreach (map { $employments{$_}->{end} } 89 94 grep { $employments{$_}->{end} } (keys %employments)) { 90 $_ gt $now or next; 95 if (!$past) { 96 $_ gt $now or next; 97 } 91 98 my $dt = DateTime->from_epoch( epoch => str2time($_)); 92 99 $dt->set_time_zone( DateTime::TimeZone->new( name => 'local' ) ); -
trunk/LATMOS-Accounts-Web/root/html/summary/employment/index.tt
r1720 r1769 13 13 <input name=filter value=[% c.req.param('filter') | html %]> 14 14 <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') %]> 16 19 <label for=stacked>[% l('Stacked') %]</label> 17 20 <input type=submit> … … 29 32 //async: false, 30 33 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') 33 37 }) %]", 34 38 dataType:"json",
Note: See TracChangeset
for help on using the changeset viewer.