[ 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/ -> mytasks.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: mytasks.php,v 1.6 2005/12/07 16:22:06 hregis Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/projet/tasks/mytasks.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.6 $
  28  */
  29  
  30  require ("./pre.inc.php");
  31  
  32  if (!$user->rights->projet->lire) accessforbidden();
  33  
  34  $langs->load('projects');
  35  
  36  Function PLines(&$inc, $parent, $lines, &$level, &$var)
  37  {
  38    $form = new Form($db); // $db est null ici mais inutile pour la fonction select_date()
  39    global $bc, $langs;
  40    for ($i = 0 ; $i < sizeof($lines) ; $i++)
  41      {
  42        if ($parent == 0)
  43      {
  44        $level = 0;
  45        $var = !$var;
  46      }
  47  
  48        if ($lines[$i][1] == $parent)
  49      {
  50        print "<tr $bc[$var]>\n<td>";
  51        print '<a href="fiche.php?id='.$lines[$i][5].'">'.$lines[$i][4]."</a></td><td>\n";
  52  
  53        for ($k = 0 ; $k < $level ; $k++)
  54          {
  55            print "&nbsp;&nbsp;&nbsp;";
  56          }
  57  
  58        print '<a href="task.php?id='.$lines[$i][2].'">'.$lines[$i][0]."</a></td>\n";
  59  
  60        $heure = intval($lines[$i][3]);
  61        $minutes = (($lines[$i][3] - $heure) * 60);
  62        $minutes = substr("00"."$minutes", -2);
  63  
  64        print '<td align="right">'.$heure."&nbsp;h&nbsp;".$minutes."</td>\n";
  65        print "</tr>\n";
  66        $inc++;
  67        $level++;
  68        PLines($inc, $lines[$i][2], $lines, $level, $var);
  69        $level--;
  70      }
  71        else
  72      {
  73        //$level--;
  74      }
  75      }
  76  }
  77  
  78  llxHeader("",$langs->trans("Mytasks"),"Projet");
  79  
  80  /*
  81   * Fiche projet en mode visu
  82   *
  83   */
  84  
  85  $h=0;
  86  $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/mytasks.php';
  87  $head[$h][1] = $langs->trans("Mytasks");
  88  $h++;
  89  
  90  dolibarr_fiche_head($head,  $hselected, $langs->trans("Mytasks"));
  91  
  92  /* Liste des tâches */
  93  
  94  $sql = "SELECT t.rowid, t.title, t.fk_task_parent, t.duration_effective";
  95  $sql .= " , p.rowid as prowid, p.title as ptitle";
  96  $sql .= " FROM ".MAIN_DB_PREFIX."projet_task as t";
  97  $sql .= " , ".MAIN_DB_PREFIX."projet_task_actors as a";
  98  $sql .= " , ".MAIN_DB_PREFIX."projet as p";
  99  $sql .= " WHERE p.rowid = t.fk_projet";
 100  $sql .= " AND a.fk_projet_task = t.rowid";
 101  $sql .= " AND a.fk_user = ".$user->id;
 102  $sql .= " ORDER BY p.rowid, t.fk_task_parent";
 103  
 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        $obj = $db->fetch_object($resql);
 113        $tasks[$i][0] = $obj->title; 
 114        $tasks[$i][1] = $obj->fk_task_parent; 
 115        $tasks[$i][2] = $obj->rowid;
 116        $tasks[$i][3] = $obj->duration_effective; 
 117        $tasks[$i][4] = $obj->ptitle;
 118        $tasks[$i][5] = $obj->prowid;
 119        $i++;
 120      }
 121    $db->free();
 122  }
 123  else
 124  {
 125    dolibarr_print_error($db);
 126  }
 127  
 128  print '<table class="noborder" width="100%">';
 129  print '<tr class="liste_titre">';
 130  print '<td>'.$langs->trans("Project").'</td>';
 131  print '<td>'.$langs->trans("Task").'</td>';
 132  print '<td align="right">'.$langs->trans("DurationEffective").'</td>';
 133  print "</tr>\n";      
 134  $var=true;
 135  
 136  PLines($j, 0, $tasks, $level, $var);
 137  
 138  print "</table>";    
 139  print '</div>';
 140  
 141  $db->close();
 142  
 143  llxFooter('$Date: 2005/12/07 16:22:06 $ - $Revision: 1.6 $');
 144  ?>


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