[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/htdocs/projet/tasks/ -> index.php (source)

   1  <?php
   2  /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   * Copyright (C) 2004-2005 Laurent Destailleur  <eldy@users.sourceforge.net>
   4   *
   5   * This program is free software; you can redistribute it and/or modify
   6   * it under the terms of the GNU General Public License as published by
   7   * the Free Software Foundation; either version 2 of the License, or
   8   * (at your option) any later version.
   9   *
  10   * This program is distributed in the hope that it will be useful,
  11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13   * GNU General Public License for more details.
  14   *
  15   * You should have received a copy of the GNU General Public License
  16   * along with this program; if not, write to the Free Software
  17   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18   *
  19   * $Id: index.php,v 1.2 2005/08/21 12:10:05 rodolphe Exp $
  20   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/projet/tasks/index.php,v $
  21   *
  22   */
  23  
  24  /**
  25     \file       htdocs/projet/index.php
  26     \ingroup    projet
  27     \brief      Page d'accueil du module projet
  28     \version    $Revision: 1.2 $
  29  */
  30  
  31  require ("./pre.inc.php");
  32  
  33  if (!$user->rights->projet->lire) accessforbidden();
  34  
  35  /*
  36   * Sécurité accés client
  37   */
  38  if ($user->societe_id > 0) 
  39  {
  40    $action = '';
  41    $socidp = $user->societe_id;
  42  }
  43  
  44  llxHeader("",$langs->trans("Projects"),"Projet");
  45  
  46  print_titre($langs->trans("ProjectsArea"));
  47  
  48  print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
  49  print '<tr><td width="30%" valign="top">';
  50  
  51  /*
  52   *
  53   * Affichage de la liste des projets
  54   * 
  55   */
  56  print '<table class="noborder" width="100%">';
  57  print '<tr class="liste_titre">';
  58  print_liste_field_titre($langs->trans("Project"),"index.php","s.nom","","","",$sortfield);
  59  print '<td align="center">'.$langs->trans("NbOpenTasks").'</td>';
  60  print "</tr>\n";
  61  
  62  $sql = "SELECT p.title, p.rowid, count(t.rowid)";
  63  $sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
  64  $sql .= " , ".MAIN_DB_PREFIX."projet_task as t";
  65  $sql .= " WHERE t.fk_projet = p.rowid";
  66  
  67  if ($socidp)
  68  { 
  69    $sql .= " AND s.idp = $socidp"; 
  70  }
  71  $sql .= " GROUP BY p.rowid";
  72  
  73  $var=true;
  74  $resql = $db->query($sql);
  75  if ( $resql )
  76  {
  77    $num = $db->num_rows($resql);
  78    $i = 0;
  79  
  80    while ($i < $num)
  81      {
  82        $row = $db->fetch_row( $resql);
  83        $var=!$var;
  84        print "<tr $bc[$var]>";
  85        print '<td><a href="'.DOL_URL_ROOT.'/projet/tasks/fiche.php?id='.$row[1].'">'.$row[0].'</a></td>';
  86        print '<td align="center">'.$row[2].'</td>';
  87        print "</tr>\n";
  88      
  89        $i++;
  90      }
  91    
  92    $db->free($resql);
  93  }
  94  else
  95  {
  96    dolibarr_print_error($db);
  97  }
  98  print "</table>";
  99  
 100  print '</td><td width="70%">';
 101  
 102  /*
 103   *
 104   * Affichage de la liste des projets
 105   * 
 106   */
 107  print '<table class="noborder" width="100%">';
 108  print '<tr class="liste_titre">';
 109  print_liste_field_titre($langs->trans("Company"),"index.php","s.nom","","","",$sortfield);
 110  print '<td>Nb heures</td>';
 111  print "</tr>\n";
 112  
 113  $sql = "SELECT p.title, p.rowid, sum(tt.task_duration)";
 114  $sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
 115  $sql .= " , ".MAIN_DB_PREFIX."projet_task as t";
 116  $sql .= " , ".MAIN_DB_PREFIX."projet_task_time as tt";
 117  $sql .= " WHERE t.fk_projet = p.rowid";
 118  $sql .= " AND tt.fk_task = t.rowid";
 119  
 120  if ($socidp)
 121  { 
 122    $sql .= " AND s.idp = $socidp"; 
 123  }
 124  $sql .= " GROUP BY p.rowid";
 125  
 126  $var=true;
 127  $resql = $db->query($sql);
 128  if ( $resql )
 129  {
 130    $num = $db->num_rows($resql);
 131    $i = 0;
 132  
 133    while ($i < $num)
 134      {
 135        $row = $db->fetch_row( $resql);
 136        $var=!$var;
 137        print "<tr $bc[$var]>";
 138        print '<td><a href="'.DOL_URL_ROOT.'/projet/tasks/fiche.php?id='.$row[1].'">'.$row[0].'</a></td>';
 139        print '<td>'.$row[2].'</td>';
 140        print "</tr>\n";
 141      
 142        $i++;
 143      }
 144    
 145    $db->free($resql);
 146  }
 147  else
 148  {
 149    dolibarr_print_error($db);
 150  }
 151  print "</table>";
 152  
 153  print '</td></tr></table>';
 154  
 155  $db->close();
 156  
 157  llxFooter("<em>Derni&egrave;re modification $Date: 2005/08/21 12:10:05 $ r&eacute;vision $Revision: 1.2 $</em>");
 158  ?>


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics