Changeset 456

Show
Ignore:
Timestamp:
11/18/08 16:12:55 (2 months ago)
Author:
nicolas
Message:

Tableau de bord : ajout couleur pour les demandes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/apps/intranet/modules/homepage/templates/indexSuccess.php

    r452 r456  
    5858<tr> 
    5959  <th><?php echo ucfirst('demandes sans actions') ?></th> 
    60   <td style="text-align:center"><?php echo link_to(count(SearchPeer::doSelectNoHistory(date('Y-m-d', mktime(0, 0, 0, date('m'), date('d')-15, date('Y'))), $user->getAgencyId(), $user->getId())), 'search/nohistory?search_in_by='.$user->getId().'&since='.date('Y-m-d', mktime(0, 0, 0, date('m'), date('d')-15, date('Y')))) ?></td> 
    61   <td style="text-align:center"><?php echo link_to(count(SearchPeer::doSelectNoHistory(date('Y-m-d', mktime(0, 0, 0, date('m'), date('d')-30, date('Y'))),  $user->getAgencyId(), $user->getId())), 'search/nohistory?search_in_by='.$user->getId().'&since='.date('Y-m-d', mktime(0, 0, 0, date('m'), date('d')-30, date('Y')))) ?></td> 
    62   <td style="text-align:center"><?php echo link_to(count(SearchPeer::doSelectNoHistory(date('Y-m-d', mktime(0, 0, 0, date('m'), date('d')-45, date('Y'))),  $user->getAgencyId(), $user->getId())), 'search/nohistory?search_in_by='.$user->getId().'&since='.date('Y-m-d', mktime(0, 0, 0, date('m'), date('d')-45, date('Y')))) ?></td> 
    63   <td style="text-align:center"><?php echo link_to(count(SearchPeer::doSelectNoHistory(date('Y-m-d', mktime(0, 0, 0, date('m'), date('d')-60, date('Y'))),  $user->getAgencyId(), $user->getId())), 'search/nohistory?search_in_by='.$user->getId().'&since='.date('Y-m-d', mktime(0, 0, 0, date('m'), date('d')-60, date('Y')))) ?></td> 
     60  <td style="text-align:center"> 
     61    <?php  
     62      $num = count(SearchPeer::doSelectNoHistory(date('Y-m-d', mktime(0, 0, 0, date('m'), date('d')-15, date('Y'))), $user->getAgencyId(), $user->getId())); 
     63      if($num>0) echo '<span class="highlight">'; 
     64      echo link_to($num, 'search/nohistory?search_in_by='.$user->getId().'&since='.date('Y-m-d', mktime(0, 0, 0, date('m'), date('d')-15, date('Y')))); 
     65      if($num>0) echo '</span>'; 
     66    ?> 
     67  </td> 
     68  <td style="text-align:center"> 
     69    <?php 
     70      $num = count(SearchPeer::doSelectNoHistory(date('Y-m-d', mktime(0, 0, 0, date('m'), date('d')-30, date('Y'))),  $user->getAgencyId(), $user->getId())); 
     71      if($num>0) echo '<span class="highlight">'; 
     72      echo link_to($num, 'search/nohistory?search_in_by='.$user->getId().'&since='.date('Y-m-d', mktime(0, 0, 0, date('m'), date('d')-30, date('Y')))); 
     73      if($num>0) echo '</span>'; 
     74    ?> 
     75  </td> 
     76  <td style="text-align:center"> 
     77    <?php 
     78      $num = count(SearchPeer::doSelectNoHistory(date('Y-m-d', mktime(0, 0, 0, date('m'), date('d')-45, date('Y'))),  $user->getAgencyId(), $user->getId())); 
     79      if($num>0) echo '<span class="highlight">'; 
     80      echo link_to($num, 'search/nohistory?search_in_by='.$user->getId().'&since='.date('Y-m-d', mktime(0, 0, 0, date('m'), date('d')-45, date('Y')))); 
     81      if($num>0) echo '</span>'; 
     82    ?> 
     83  </td> 
     84  <td style="text-align:center"> 
     85    <?php 
     86      $num = count(SearchPeer::doSelectNoHistory(date('Y-m-d', mktime(0, 0, 0, date('m'), date('d')-60, date('Y'))),  $user->getAgencyId(), $user->getId())); 
     87      if($num>0) echo '<span class="highlight">'; 
     88      echo link_to($num, 'search/nohistory?search_in_by='.$user->getId().'&since='.date('Y-m-d', mktime(0, 0, 0, date('m'), date('d')-60, date('Y')))); 
     89      if($num>0) echo '</span>'; 
     90    ?> 
     91  </td> 
    6492</tr> 
    6593</tbody> 
     
    274302$c->addAscendingOrderByColumn(CalendarPeer::DATE_START); 
    275303$calendars = CalendarPeer::doSelect($c); 
     304 
     305$c = new Criteria(); 
     306$c->add(VisitPeer::USER_VISITED_ID, $user_show_id); 
     307$c->add(VisitPeer::VISIT_DATE, date('Y-m-d'), Criteria::GREATER_EQUAL); 
     308$c->setLimit(10); 
     309$c->addAscendingOrderByColumn(VisitPeer::VISIT_DATE); 
     310$visits = VisitPeer::doSelect($c); 
     311 
     312$tmps = array(); 
     313foreach($visits as $visit): 
     314  $tmps[] = array('id' => $visit->getId(), 'type' => 'visit', 'start_at' => $visit->getVisitDate(), 'end_at' => $visit->getEndAt(), 'group' => ucfirst('visite'), 'location' => ($visit->getSales() ? $visit->getSales()->getEstate()->getAddress1().', '.$visit->getSales()->getEstate()->getCityValue() : null), 'description' => ($visit->getContact() ? $visit->getContact()->getLastname().' '.$visit->getContact()->getTelFirst() : null)); 
     315endforeach; 
     316 
     317foreach($calendars as $calendar): 
     318  $tmps[] = array('id' => $calendar->getId(), 'type' => 'calendar', 'start_at' => $calendar->getDateStart(), 'end_at' => $calendar->getDateEnd(), 'group' => $calendar->getCalendar_group(), 'location' => $calendar->getLocation(), 'description' => $calendar->getDescription()); 
     319endforeach; 
    276320?> 
    277321<h3>Rendez-vous à venir</h3> 
    278 <?php if(count($calendars)>0): ?> 
    279 <table class="list homepage_table"> 
     322<?php if(count($tmps)>0): ?> 
     323<table class="list homepage_table2"> 
    280324<tr> 
    281325  <th width="40">&nbsp;</th> 
    282   <th width="260">Date</th> 
     326  <th width="175">Date</th> 
    283327  <th>Objet</th> 
    284328  <th>Lieu</th> 
     
    286330</tr> 
    287331<tbody> 
    288 <?php foreach($calendars as $calendar): ?> 
    289 <tr> 
    290   <td><?php echo link_to(image_tag('tpl_02/button/view_inline_little.png'), 'calendar/edit?id='.$calendar->getId()) ?></td> 
    291   <td><?php echo ucfirst(substr(format_datetime($calendar->getDateStart(), 'dddd'), 0, 4)) ?>. <?php echo format_datetime($calendar->getDateStart(), 'dd MMMM HH:mm') ?> - <?php echo format_datetime($calendar->getDateEnd(), 'HH:mm') ?></td> 
    292   <td><?php echo $calendar->getCalendar_group() ?></td> 
    293   <td><?php echo $calendar->getLocation() ?></td> 
    294   <td><?php echo $calendar->getDescription() ?></td> 
     332<?php foreach($tmps as $tmp): ?> 
     333<tr> 
     334  <?php if($tmp['type']=='visit'): ?> 
     335  <td><?php echo link_to(image_tag('tpl_02/button/view_inline_little.png'), 'visit/edit?id='.$tmp['id']) ?></td> 
     336  <?php else: ?> 
     337  <td><?php echo link_to(image_tag('tpl_02/button/view_inline_little.png'), 'calendar/edit?id='.$tmp['id']) ?></td> 
     338  <?php endif; ?> 
     339  <td><?php echo ucfirst(substr(format_datetime($tmp['start_at'], 'dddd'), 0, 4)) ?>.  
     340      <?php echo format_datetime($tmp['start_at'], 'dd') ?>  
     341      <?php echo ucfirst(substr(format_datetime($tmp['start_at'], 'MMMM'), 0, 4)) ?>.  
     342      <?php echo format_datetime($tmp['start_at'], 'HH:mm') ?> -  
     343      <?php echo format_datetime($tmp['end_at'], 'HH:mm') ?></td> 
     344  <td class="highlight"><?php echo $tmp['group'] ?></td> 
     345  <td><?php echo $tmp['location'] ?></td> 
     346  <td><?php echo $tmp['description'] ?></td> 
    295347</tr> 
    296348<?php endforeach; ?>