[ 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/ -> task.php (source)

   1  <?php
   2  /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   *
   4   * This program is free software; you can redistribute it and/or modify
   5   * it under the terms of the GNU General Public License as published by
   6   * the Free Software Foundation; either version 2 of the License, or
   7   * (at your option) any later version.
   8   *
   9   * This program is distributed in the hope that it will be useful,
  10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12   * GNU General Public License for more details.
  13   *
  14   * You should have received a copy of the GNU General Public License
  15   * along with this program; if not, write to the Free Software
  16   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17   *
  18   * $Id: task.php,v 1.1 2005/08/21 12:39:11 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/projet/tasks/task.php,v $
  20   *
  21   */
  22  
  23  /**
  24     \file       htdocs/projet/tasks/fiche.php
  25     \ingroup    projet
  26     \brief      Fiche tâches d'un projet
  27     \version    $Revision: 1.1 $
  28  */
  29  
  30  require ("./pre.inc.php");
  31  
  32  if (!$user->rights->projet->lire) accessforbidden();
  33  
  34  
  35  llxHeader("",$langs->trans("Task"));
  36  
  37  if ($_GET["id"] > 0)
  38  {
  39    
  40    /*
  41     * Fiche projet en mode visu
  42     *
  43     */
  44    $task = new Task($db);
  45    if ($task->fetch($_GET["id"]) == 0 )
  46      {
  47        $projet = new Project($db);
  48        $projet->fetch($task->projet_id);
  49        $projet->societe->fetch($projet->societe->id);
  50        
  51        $h=0;
  52        $head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id;
  53        $head[$h][1] = $langs->trans("Project");
  54        $h++;
  55        
  56        $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/fiche.php?id='.$projet->id;
  57        $head[$h][1] = $langs->trans("Tasks");
  58        $hselected=$h;
  59        $h++;
  60        
  61        if ($conf->propal->enabled)
  62      {
  63        $langs->load("propal");
  64        $head[$h][0] = DOL_URL_ROOT.'/projet/propal.php?id='.$projet->id;
  65        $head[$h][1] = $langs->trans("Proposals");
  66        $h++;
  67      }  
  68        
  69        if ($conf->commande->enabled)
  70      {
  71        $langs->load("orders");
  72        $head[$h][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id;
  73        $head[$h][1] = $langs->trans("Orders");
  74        $h++;
  75      }
  76        
  77        if ($conf->facture->enabled)
  78      {
  79        $langs->load("bills");
  80        $head[$h][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id;
  81        $head[$h][1] = $langs->trans("Bills");
  82        $h++;
  83      }
  84        
  85        dolibarr_fiche_head($head,  $hselected, $langs->trans("Project").": ".$projet->ref);
  86        
  87        print '<form method="POST" action="fiche.php?id='.$projet->id.'">';
  88        print '<input type="hidden" name="action" value="createtask">';
  89        print '<table class="border" width="100%">';
  90        print '<tr><td>'.$langs->trans("Project").'</td><td>'.$projet->title.'</td>';
  91        print '<td>'.$langs->trans("Company").'</td><td>'.$projet->societe->nom_url.'</td></tr>';
  92        print '<tr><td>'.$langs->trans("Task").'</td><td colspan="3">'.$task->title.'</td></tr>';
  93        
  94        /* Liste des tâches */
  95        
  96        $sql = "SELECT t.task_date, t.task_duration, t.fk_user, u.code";
  97        $sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t";
  98        $sql .= " , ".MAIN_DB_PREFIX."user as u";
  99        $sql .= " WHERE t.fk_task =".$task->id;
 100        $sql .= " AND t.fk_user = u.rowid";
 101        $sql .= " ORDER BY t.task_date DESC";
 102        
 103        $var=true;
 104        $resql = $db->query($sql);
 105        if ($resql)
 106      {
 107        $num = $db->num_rows($resql);
 108        $i = 0;
 109        $tasks = array();      
 110        while ($i < $num)
 111          {
 112            $row = $db->fetch_row($resql);
 113            $tasks[$i] = $row; 
 114            $i++;
 115          }
 116        $db->free();
 117      }
 118        else
 119      {
 120        dolibarr_print_error($db);
 121      }
 122        
 123        
 124        /* Nouvelle tâche */          
 125        print '</table></form><br />';
 126  
 127        print '<input type="hidden" name="action" value="addtime">';
 128        print '<table class="noborder" width="100%">';
 129        print '<tr class="liste_titre">';
 130        print '<td>'.$langs->trans("Task").'</td>';
 131        print '<td align="right">'.$langs->trans("DurationEffective").'</td>';
 132        print '<td colspan="2">'.$langs->trans("AddDuration").'</td>';
 133        print "</tr>\n";      
 134        
 135        foreach ($tasks as $task_time)
 136      {
 137        print "<tr $bc[$var]>";
 138        print '<td>'.$task_time[0].'</td>';
 139        print '<td>'.$task_time[1].'</td>';
 140        print '<td>'.$task_time[3].'</td>';
 141        print "</tr>\n";
 142      }
 143              
 144        print "</table>";    
 145        print '</div>';
 146      }    
 147  }
 148  
 149  $db->close();
 150  
 151  llxFooter('$Date: 2005/08/21 12:39:11 $ - $Revision: 1.1 $');
 152  ?>


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