Nouveau fichier
This commit is contained in:
parent
d6660662d1
commit
4edd205321
230
htdocs/projet/activity/index.php
Normal file
230
htdocs/projet/activity/index.php
Normal file
@ -0,0 +1,230 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/projet/index.php
|
||||
\ingroup projet
|
||||
\brief Page d'accueil du module projet
|
||||
\version $Revision$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
|
||||
if (!$user->rights->projet->lire) accessforbidden();
|
||||
|
||||
/*
|
||||
* Sécurité accés client
|
||||
*/
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$action = '';
|
||||
$socidp = $user->societe_id;
|
||||
}
|
||||
|
||||
llxHeader("",$langs->trans("Activity"));
|
||||
|
||||
$now = time();
|
||||
|
||||
print_titre($langs->trans("Activity"));
|
||||
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<tr><td width="30%" valign="top">';
|
||||
|
||||
/*
|
||||
*
|
||||
* Affichage de la liste des projets
|
||||
*
|
||||
*/
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Project"),"index.php","s.nom","","","",$sortfield);
|
||||
print '<td align="center">'.$langs->trans("NbOpenTasks").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$sql = "SELECT p.title, p.rowid, count(t.rowid)";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
$sql .= " , ".MAIN_DB_PREFIX."projet_task as t";
|
||||
$sql .= " WHERE t.fk_projet = p.rowid";
|
||||
|
||||
$sql .= " GROUP BY p.rowid";
|
||||
|
||||
$var=true;
|
||||
$resql = $db->query($sql);
|
||||
if ( $resql )
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $db->fetch_row( $resql);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/projet/tasks/fiche.php?id='.$row[1].'">'.$row[0].'</a></td>';
|
||||
print '<td align="center">'.$row[2].'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
print "</table>";
|
||||
|
||||
print '</td><td width="70%" valign="top">';
|
||||
|
||||
/* Affichage de la liste des projets du mois */
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="50%">Activité sur les projets cette semaine</td>';
|
||||
print '<td width="50%" align="center">Temps</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$sql = "SELECT p.title, p.rowid, sum(tt.task_duration)";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
$sql .= " , ".MAIN_DB_PREFIX."projet_task as t";
|
||||
$sql .= " , ".MAIN_DB_PREFIX."projet_task_time as tt";
|
||||
$sql .= " WHERE t.fk_projet = p.rowid";
|
||||
$sql .= " AND tt.fk_task = t.rowid";
|
||||
$sql .= " AND week(task_date) = ".strftime("%W",time());
|
||||
$sql .= " GROUP BY p.rowid";
|
||||
|
||||
$var=true;
|
||||
$resql = $db->query($sql);
|
||||
if ( $resql )
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $db->fetch_row( $resql);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/projet/tasks/fiche.php?id='.$row[1].'">'.$row[0].'</a></td>';
|
||||
print '<td align="center">'.$row[2].'</td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
print "</table><br />";
|
||||
|
||||
/* Affichage de la liste des projets du mois */
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="50%">'.$langs->trans("Project").' ce mois : '.strftime("%B %Y", $now).'</td>';
|
||||
print '<td width="50%" align="center">Nb heures</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$sql = "SELECT p.title, p.rowid, sum(tt.task_duration)";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
$sql .= " , ".MAIN_DB_PREFIX."projet_task as t";
|
||||
$sql .= " , ".MAIN_DB_PREFIX."projet_task_time as tt";
|
||||
$sql .= " WHERE t.fk_projet = p.rowid";
|
||||
$sql .= " AND tt.fk_task = t.rowid";
|
||||
$sql .= " AND month(task_date) = ".strftime("%m",$now);
|
||||
$sql .= " GROUP BY p.rowid";
|
||||
|
||||
$var=true;
|
||||
$resql = $db->query($sql);
|
||||
if ( $resql )
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $db->fetch_row( $resql);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/projet/tasks/fiche.php?id='.$row[1].'">'.$row[0].'</a></td>';
|
||||
print '<td align="center">'.$row[2].'</td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
print "</table>";
|
||||
|
||||
/* Affichage de la liste des projets du mois */
|
||||
print '<br /><table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="50%">'.$langs->trans("Project").' cette année : '.strftime("%Y", $now).'</td>';
|
||||
print '<td width="50%" align="center">Nb heures</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$sql = "SELECT p.title, p.rowid, sum(tt.task_duration)";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
$sql .= " , ".MAIN_DB_PREFIX."projet_task as t";
|
||||
$sql .= " , ".MAIN_DB_PREFIX."projet_task_time as tt";
|
||||
$sql .= " WHERE t.fk_projet = p.rowid";
|
||||
$sql .= " AND tt.fk_task = t.rowid";
|
||||
$sql .= " AND YEAR(task_date) = ".strftime("%Y",$now);
|
||||
$sql .= " GROUP BY p.rowid";
|
||||
|
||||
$var=true;
|
||||
$resql = $db->query($sql);
|
||||
if ( $resql )
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $db->fetch_row( $resql);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/projet/tasks/fiche.php?id='.$row[1].'">'.$row[0].'</a></td>';
|
||||
print '<td align="center">'.$row[2].'</td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
print "</table>";
|
||||
|
||||
print '</td></tr></table>';
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
?>
|
||||
61
htdocs/projet/activity/pre.inc.php
Normal file
61
htdocs/projet/activity/pre.inc.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
|
||||
/*!
|
||||
\file htdocs/projet/pre.inc.php
|
||||
\ingroup projet
|
||||
\brief Fichier de gestion du menu gauche du module projet
|
||||
\version $Revision$
|
||||
*/
|
||||
|
||||
require ("../../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/project.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/task.class.php");
|
||||
|
||||
$langs->load("projects");
|
||||
$langs->load("companies");
|
||||
|
||||
$user->getrights('projet');
|
||||
|
||||
function llxHeader($head = "", $title="", $help_url='')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
top_menu($head, $title);
|
||||
|
||||
$menu = new Menu();
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/comm/clients.php", $langs->trans("Customers"));
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/projet/", $langs->trans("Projects"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/liste.php", $langs->trans("List"));
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/projet/tasks/", $langs->trans("Tasks"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/tasks/mytasks.php", $langs->trans("Mytasks"));
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/projet/activity/", $langs->trans("Activity"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/activity/myactivity.php", $langs->trans("Myactivity"));
|
||||
|
||||
left_menu($menu->liste, $help_url);
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user