[ 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/ -> 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.25 2005/09/25 22:28:25 eldy Exp $
  20   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/projet/index.php,v $
  21   */
  22  
  23  /**
  24          \file       htdocs/projet/index.php
  25          \ingroup    projet
  26          \brief      Page d'accueil du module projet
  27          \version    $Revision: 1.25 $
  28  */
  29  
  30  require ("./pre.inc.php");
  31  $langs->load("projects");
  32  
  33  if (!$user->rights->projet->lire) accessforbidden();
  34  
  35  // Sécurité accés client
  36  if ($user->societe_id > 0) 
  37  {
  38    $action = '';
  39    $socidp = $user->societe_id;
  40  }
  41  
  42  llxHeader("",$langs->trans("Projects"),"Projet");
  43  
  44  print_fiche_titre($langs->trans("ProjectsArea"));
  45  
  46  print '<table border="0" width="100%" class="notopnoleftnoright">';
  47  print '<tr><td width="30%" valign="top" class="notopnoleft">';
  48  
  49  /*
  50   *
  51   * Affichage de la liste des projets
  52   * 
  53   */
  54  print '<table class="noborder" width="100%">';
  55  print '<tr class="liste_titre">';
  56  print_liste_field_titre($langs->trans("Project"),"index.php","s.nom","","","",$sortfield);
  57  print '<td align="right">'.$langs->trans("NbOpenTasks").'</td>';
  58  print "</tr>\n";
  59  
  60  $sql = "SELECT p.title, p.rowid, count(t.rowid)";
  61  $sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
  62  $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t ON p.rowid = t.fk_projet";
  63  //$sql.= " , ".MAIN_DB_PREFIX."projet_task as t";
  64  //$sql.= " WHERE t.fk_projet = p.rowid";
  65  if ($socidp)
  66  { 
  67    $sql .= " AND p.fk_soc = ".$socidp; 
  68  }
  69  $sql.= " GROUP BY p.rowid";
  70  
  71  $var=true;
  72  $resql = $db->query($sql);
  73  if ( $resql )
  74  {
  75    $num = $db->num_rows($resql);
  76    $i = 0;
  77  
  78    while ($i < $num)
  79      {
  80        $row = $db->fetch_row( $resql);
  81        $var=!$var;
  82        print "<tr $bc[$var]>";
  83        print '<td><a href="'.DOL_URL_ROOT.'/projet/fiche.php?id='.$row[1].'">'.img_object($langs->trans("ShowProject"),"project")." ".$row[0].'</a></td>';
  84        print '<td align="right">'.$row[2].'</td>';
  85        print "</tr>\n";
  86      
  87        $i++;
  88      }
  89    
  90    $db->free($resql);
  91  }
  92  else
  93  {
  94    dolibarr_print_error($db);
  95  }
  96  print "</table>";
  97  
  98  print '</td><td width="70%" valign="top" class="notopnoleft">';
  99  
 100  /*
 101   *
 102   * Affichage de la liste des projets
 103   * 
 104   */
 105  print '<table class="noborder" width="100%">';
 106  print '<tr class="liste_titre">';
 107  print_liste_field_titre($langs->trans("Company"),"index.php","s.nom","","","",$sortfield);
 108  print '<td align="right">'.$langs->trans("Nb").'</td>';
 109  print "</tr>\n";
 110  
 111  $sql = "SELECT s.nom, s.idp, count(p.rowid)";
 112  $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."projet as p";
 113  $sql .= " WHERE p.fk_soc = s.idp";
 114  if ($socidp)
 115  { 
 116    $sql .= " AND s.idp = $socidp"; 
 117  }
 118  $sql .= " GROUP BY s.nom";
 119  //$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset);
 120  
 121  $var=true;
 122  $resql = $db->query($sql);
 123  if ( $resql )
 124  {
 125    $num = $db->num_rows($resql);
 126    $i = 0;
 127  
 128    while ($i < $num)
 129      {
 130        $row = $db->fetch_row( $resql);
 131        $var=!$var;
 132        print "<tr $bc[$var]>";
 133        print '<td><a href="'.DOL_URL_ROOT.'/projet/liste.php?socid='.$row[1].'">'.img_object($langs->trans("ShowCompany"),"company")." ".$row[0].'</a></td>';
 134        print '<td align="right">'.$row[2].'</td>';
 135        print "</tr>\n";
 136      
 137        $i++;
 138      }
 139    
 140    $db->free($resql);
 141  }
 142  else
 143  {
 144    dolibarr_print_error($db);
 145  }
 146  print "</table>";
 147  
 148  print '</td></tr></table>';
 149  
 150  $db->close();
 151  
 152  llxFooter("<em>Derni&egrave;re modification $Date: 2005/09/25 22:28:25 $ r&eacute;vision $Revision: 1.25 $</em>");
 153  ?>


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