forked from Wavyzz/dolibarr
Major enhancement of project module
This commit is contained in:
@@ -13,6 +13,7 @@ For users:
|
||||
- New: No limit on free text on PDF generated documents.
|
||||
- New: Can force login value when creating a user from a member.
|
||||
- New: Can clone a commercial proposal.
|
||||
- New: Major enhancement of project module.
|
||||
- Fix: Failed to go on the future view of bank transaction if there is no
|
||||
future bank transaction already wrote.
|
||||
- Fix: Bad ref in supplier list.
|
||||
|
||||
@@ -241,7 +241,7 @@ class FactureFournisseur extends Facture
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
dolibarr_syslog('FactureFournisseur::Fetch Error '.$this->error, LOG_ERROR);
|
||||
dolibarr_syslog('FactureFournisseur::Fetch Error '.$this->error, LOG_ERR);
|
||||
return -3;
|
||||
}
|
||||
return 1;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (c) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
@@ -153,6 +153,102 @@ class FormOther
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Retourn list of project and tasks
|
||||
* \param selected Pre-selected value
|
||||
* \param modeproject 1 to restrict on projects owned by user
|
||||
* \param modetask 1 to restrict on tasks associated to user
|
||||
* \param htmlname Name of html select
|
||||
*/
|
||||
function selectProjectTasks($selected='',$htmlname='task_parent', $modeproject=0, $modetask=0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/project.class.php");
|
||||
|
||||
//print $modeproject.'-'.$modetask;
|
||||
$project=new Project($this->db);
|
||||
$tasksarray=$project->getTasksArray($modetask?$user:0, $modeproject?$user:0);
|
||||
if ($tasksarray)
|
||||
{
|
||||
print '<select class="flat" name="'.$htmlname.'">';
|
||||
print '<option value="0" selected="true"> </option>';
|
||||
$j=0;
|
||||
$level=0;
|
||||
PLineSelect($j, 0, $tasksarray, $level);
|
||||
print '</select>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Enter description here...
|
||||
*
|
||||
* @param unknown_type $inc
|
||||
* @param unknown_type $parent
|
||||
* @param unknown_type $lines
|
||||
* @param unknown_type $level
|
||||
*/
|
||||
function PLineSelect(&$inc, $parent, $lines, &$level)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$lastprojectid=0;
|
||||
|
||||
for ($i = 0 ; $i < sizeof($lines) ; $i++)
|
||||
{
|
||||
if ($parent == 0) $level = 0;
|
||||
|
||||
if ($lines[$i]->fk_parent == $parent)
|
||||
{
|
||||
$var = !$var;
|
||||
|
||||
// Break on a new project
|
||||
if ($parent == 0 && $lines[$i]->projectid != $lastprojectid)
|
||||
{
|
||||
print '<option value="'.$lines[$i]->projectid.'_0">';
|
||||
print $langs->trans("Project").' '.$lines[$i]->projectref;
|
||||
if ($lines[$i]->name || $lines[$i]->fistname)
|
||||
{
|
||||
//print ' ('.$lines[$i]->name.($lines[$i]->name && $lines[$i]->firstname?' ':'').$lines[$i]->firstname.')';
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ('.$langs->trans("SharedProject").')';
|
||||
}
|
||||
//print '-'.$parent.'-'.$lines[$i]->projectid.'-'.$lastprojectid;
|
||||
print "</option>\n";
|
||||
|
||||
$lastprojectid=$lines[$i]->projectid;
|
||||
$inc++;
|
||||
}
|
||||
|
||||
print '<option value="'.$lines[$i]->projectid.'_'.$lines[$i]->id.'">';
|
||||
print $langs->trans("Project").' '.$lines[$i]->projectref;
|
||||
if ($lines[$i]->name || $lines[$i]->fistname)
|
||||
{
|
||||
//print ' ('.$lines[$i]->name.($lines[$i]->name && $lines[$i]->firstname?' ':'').$lines[$i]->firstname.')';
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ('.$langs->trans("SharedProject").')';
|
||||
}
|
||||
if ($lines[$i]->id) print ' > ';
|
||||
for ($k = 0 ; $k < $level ; $k++)
|
||||
{
|
||||
print " ";
|
||||
}
|
||||
print $lines[$i]->title."</option>\n";
|
||||
|
||||
$inc++;
|
||||
|
||||
$level++;
|
||||
if ($lines[$i]->id) PLineSelect($inc, $lines[$i]->id, $lines, $level);
|
||||
$level--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -766,13 +766,19 @@ class MenuLeft {
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/fiche.php?leftmenu=projects&action=create", $langs->trans("NewProject"), 1, $user->rights->projet->creer);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/liste.php?leftmenu=projects", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
|
||||
$newmenu->add(DOL_URL_ROOT."/projet/tasks/index.php", $langs->trans("Tasks"), 0, $user->rights->projet->lire);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php?mode=mine", $langs->trans("MyTasks"), 1, $user->rights->projet->lire);
|
||||
$newmenu->add(DOL_URL_ROOT."/projet/index.php?leftmenu=projects&mode=mine", $langs->trans("MyProjects"), 0, $user->rights->projet->lire);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/fiche.php?leftmenu=projects&action=create&mode=mine", $langs->trans("NewProject"), 1, $user->rights->projet->creer);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/liste.php?leftmenu=projects&mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
|
||||
$newmenu->add(DOL_URL_ROOT."/projet/activity/index.php", $langs->trans("TimeSpent"), 0, $user->rights->projet->lire);
|
||||
$newmenu->add(DOL_URL_ROOT."/projet/activity/index.php", $langs->trans("Activities"), 0, $user->rights->projet->lire);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/activity/list.php", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/activity/index.php?mode=mine", $langs->trans("MyTimeSpent"), 1, $user->rights->projet->lire);
|
||||
|
||||
$newmenu->add(DOL_URL_ROOT."/projet/activity/index.php?mode=mine", $langs->trans("MyActivities"), 0, $user->rights->projet->lire);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create&mode=mine", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php?mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/activity/list.php?mode=mine", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -735,13 +735,19 @@ class MenuLeft {
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/fiche.php?leftmenu=projects&action=create", $langs->trans("NewProject"), 1, $user->rights->projet->creer);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/liste.php?leftmenu=projects", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
|
||||
$newmenu->add(DOL_URL_ROOT."/projet/tasks/index.php", $langs->trans("Tasks"), 0, $user->rights->projet->lire);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php?mode=mine", $langs->trans("MyTasks"), 1, $user->rights->projet->lire);
|
||||
$newmenu->add(DOL_URL_ROOT."/projet/index.php?leftmenu=projects&mode=mine", $langs->trans("MyProjects"), 0, $user->rights->projet->lire);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/fiche.php?leftmenu=projects&action=create&mode=mine", $langs->trans("NewProject"), 1, $user->rights->projet->creer);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/liste.php?leftmenu=projects&mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
|
||||
$newmenu->add(DOL_URL_ROOT."/projet/activity/index.php", $langs->trans("TimeSpent"), 0, $user->rights->projet->lire);
|
||||
$newmenu->add(DOL_URL_ROOT."/projet/activity/index.php", $langs->trans("Activities"), 0, $user->rights->projet->lire);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/activity/list.php", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/activity/index.php?mode=mine", $langs->trans("MyTimeSpent"), 1, $user->rights->projet->lire);
|
||||
|
||||
$newmenu->add(DOL_URL_ROOT."/projet/activity/index.php?mode=mine", $langs->trans("MyActivities"), 0, $user->rights->projet->lire);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create&mode=mine", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php?mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/activity/list.php?mode=mine", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -241,13 +241,33 @@ insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`,
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 2704__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/casoc?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->comptaexpert->comptarapport->lire', '', 0, 0);
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 2705__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyuser.php?leftmenu=ca', 'ByUsers', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->comptaexpert->comptarapport->lire', '', 0, 1);
|
||||
|
||||
$newmenu->add(DOL_URL_ROOT."/projet/activity/index.php", $langs->trans("Activities"), 0, $user->rights->projet->lire);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/activity/list.php", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer);
|
||||
|
||||
$newmenu->add(DOL_URL_ROOT."/projet/activity/index.php?mode=mine", $langs->trans("MyActivities"), 0, $user->rights->projet->lire);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create&mode=mine", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php?mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/projet/activity/list.php?mode=mine", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer);
|
||||
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3600__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/index.php?leftmenu=projects', 'Projects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0);
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/comm/clients.php?leftmenu=projects', 'NewProject', 1, 'projects', '$user->rights->projet->lire', '', 2, 0);
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/liste.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 1);
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/tasks', 'Tasks', 0, 'projects', '$user->rights->projet->lire', '', 2, 1);
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/mytasks.php', 'MyTasks', 1, 'projects', '$user->rights->projet->lire', '', 2, 0);
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3800__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity', 'Activity', 0, 'projects', '$user->rights->projet->lire', '', 2, 2);
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3801__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/activity/myactivity.php', 'MyActivity', 1, 'projects', '$user->rights->projet->lire', '', 2, 0);
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/fiche.php?leftmenu=projects&action=create', 'NewProject', 1, 'projects', '$user->rights->projet->creer', '', 2, 1);
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/liste.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2);
|
||||
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3610__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/index.php?leftmenu=projects&mode=mine', 'MyProjects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0);
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3611__+MAX_llx_menu__, 'project', '', 3610__+MAX_llx_menu__, '/projet/fiche.php?leftmenu=projects&action=create&mode=mine', 'NewProject', 1, 'projects', '$user->rights->projet->creer', '', 2, 1);
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3612__+MAX_llx_menu__, 'project', '', 3610__+MAX_llx_menu__, '/projet/liste.php?leftmenu=projects&mode=mine', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2);
|
||||
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0);
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/fiche.php?leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1);
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/index.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2);
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3703__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/activity/list.php?leftmenu=projects', 'NewTimeSpent', 1, 'projects', '$user->rights->projet->lire', '', 2, 3);
|
||||
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3800__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?leftmenu=projects&mode=mine', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0);
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3801__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/tasks/fiche.php?leftmenu=projects&action=create&mode=mine', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1);
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3802__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/tasks/index.php?leftmenu=projects&mode=mine', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2);
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3803__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/activity/list.php?leftmenu=projects&mode=mine', 'NewTimeSpent', 1, 'projects', '$user->rights->projet->lire', '', 2, 3);
|
||||
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3900__+MAX_llx_menu__, 'tools', '', 8__+MAX_llx_menu__, '/comm/mailing/index.php?leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 0);
|
||||
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3901__+MAX_llx_menu__, 'tools', '', 3900__+MAX_llx_menu__, '/comm/mailing/fiche.php?leftmenu=mailing&action=create', 'NewMailing', 1, 'mails', '$user->rights->mailing->creer', '', 0, 0);
|
||||
|
||||
@@ -406,7 +406,7 @@ if ($_POST["action"] == "set")
|
||||
print $langs->trans("OK");
|
||||
print "</td></tr>";
|
||||
|
||||
dolibarr_install_syslog("etape1: connexion to database ".$conf->db->name.", bu user : ".$conf->db->user." has failed", LOG_ERROR);
|
||||
dolibarr_install_syslog("etape1: connexion to database ".$conf->db->name.", bu user : ".$conf->db->user." has failed", LOG_ERR);
|
||||
print "<tr><td>";
|
||||
print $langs->trans("DatabaseConnection")." : ";
|
||||
print $dolibarr_main_db_name;
|
||||
|
||||
@@ -327,8 +327,8 @@ Permission32=Create/modify products/services
|
||||
Permission33=Command products/services
|
||||
Permission34=Delete products/services
|
||||
Permission36=Export products/services
|
||||
Permission41=Read projects
|
||||
Permission42=Create/modify projects
|
||||
Permission41=Read projects and tasks
|
||||
Permission42=Create/modify projects, edit tasks for my projects
|
||||
Permission44=Delete projects
|
||||
Permission61=Read interventions
|
||||
Permission62=Create/modify interventions
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# Dolibarr language file - en_US - projects
|
||||
Project=Project
|
||||
Projects=Projects
|
||||
SharedProject=Shared project
|
||||
Myprojects=My projects
|
||||
ProjectsArea=Projects area
|
||||
NewProject=New project
|
||||
@@ -30,8 +31,11 @@ NewTask=New task
|
||||
AddTask=Add task
|
||||
AddDuration=Add duration
|
||||
Activity=Activity
|
||||
Activities=Tasks/activities
|
||||
MyActivity=My activity
|
||||
MyActivities=My tasks/activities
|
||||
DurationEffective=Effective duration
|
||||
MyProjects=My projects
|
||||
Time=Time
|
||||
ListProposalsAssociatedProject=Lists of the commercial proposals associated with the project
|
||||
ListOrdersAssociatedProject=Lists of the orders associated with the project
|
||||
@@ -42,4 +46,6 @@ ListContractAssociatedProject=List of contracts associated with the project
|
||||
ActivityOnProjectThisWeek=Activity on project this week
|
||||
ActivityOnProjectThisMonth=Activity on project this month
|
||||
ActivityOnProjectThisYear=Activity on project this year
|
||||
ChildOfTaks=child of task
|
||||
ChildOfTaks=Child of project/task
|
||||
NotOwnerOfProject=Not owner of this private project
|
||||
AffectedTo=Affected to
|
||||
@@ -326,8 +326,8 @@ Permission32=Cr
|
||||
Permission33=Commander les produits/services
|
||||
Permission34=Supprimer les produits/services
|
||||
Permission36=Exporter les produits/services
|
||||
Permission41=Consulter les projets
|
||||
Permission42=Cr<43>er/modifier les projets
|
||||
Permission41=Consulter les projets et t<>ches
|
||||
Permission42=Cr<43>er/modifier les projets, <20>diter t<>ches de mes projets
|
||||
Permission44=Supprimer les projets
|
||||
Permission61=Consulter les interventions
|
||||
Permission62=Cr<43>er/modifier les interventions
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# Dolibarr language file - fr_FR - projects
|
||||
Project=Projet
|
||||
Projects=Projets
|
||||
SharedProject=Projet partag<61>
|
||||
Myprojects=Mes projets
|
||||
ProjectsArea=Espace projet
|
||||
NewProject=Nouveau projet
|
||||
@@ -30,7 +31,10 @@ NewTask=Nouvelle t
|
||||
AddTask=Cr<43>er t<>che
|
||||
AddDuration=Ajouter la dur<75>e
|
||||
Activity=Activit<69>
|
||||
Activities=T<>ches/activit<69>s
|
||||
MyActivity=Mon activit<69>
|
||||
MyActivities=Mes t<>ches/activit<69>s
|
||||
MyProjects=Mes projets
|
||||
DurationEffective=Dur<75>e effective
|
||||
Time=Temps
|
||||
ListProposalsAssociatedProject=Liste des propositions commerciales associ<63>es au projet
|
||||
@@ -42,4 +46,6 @@ ListContractAssociatedProject=Liste des contrats associ
|
||||
ActivityOnProjectThisWeek=Activit<69> sur les projets cette semaine
|
||||
ActivityOnProjectThisMonth=Activit<69> sur les projets ce mois
|
||||
ActivityOnProjectThisYear=Activit<69> sur les projets cette ann<6E>e
|
||||
ChildOfTaks=fille de la tache
|
||||
ChildOfTaks=Fille du projet/t<>che
|
||||
NotOwnerOfProject=Non responsable de ce projet priv<69>
|
||||
AffectedTo=Affect<63> <20>
|
||||
@@ -1717,7 +1717,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite)
|
||||
* \param begin ("" par defaut)
|
||||
* \param options ("" par defaut)
|
||||
* \param td options de l'attribut td ("" par defaut)
|
||||
* \param sortfield nom du champ sur lequel est effectue le tri du tableau
|
||||
* \param sortfield field currently used to sort
|
||||
* \param sortorder ordre du tri
|
||||
*/
|
||||
function print_liste_field_titre($name, $file, $field, $begin="", $options="", $td="", $sortfield="", $sortorder="")
|
||||
@@ -1727,7 +1727,7 @@ function print_liste_field_titre($name, $file, $field, $begin="", $options="", $
|
||||
|
||||
// Le champ de tri est mis en evidence.
|
||||
// Exemple si (sortfield,field)=("nom","xxx.nom") ou (sortfield,field)=("nom","nom")
|
||||
if ($sortfield == $field || $sortfield == ereg_replace("^[^\.]+\.","",$field))
|
||||
if ($field && ($sortfield == $field || $sortfield == ereg_replace("^[^\.]+\.","",$field)))
|
||||
{
|
||||
print '<td class="liste_titre_sel" '. $td.'>';
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@@ -18,12 +18,11 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/lib/project.lib.php
|
||||
\brief Ensemble de fonctions de base pour le module projet
|
||||
\ingroup societe
|
||||
\version $Id$
|
||||
*/
|
||||
|
||||
* \file htdocs/lib/project.lib.php
|
||||
* \brief Ensemble de fonctions de base pour le module projet
|
||||
* \ingroup societe
|
||||
* \version $Id$
|
||||
*/
|
||||
function project_prepare_head($objsoc)
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
@@ -58,12 +57,39 @@ function project_prepare_head($objsoc)
|
||||
|
||||
|
||||
/**
|
||||
\brief Affiche la liste d<>roulante des projets d'une soci<63>t<EFBFBD> donn<6E>e
|
||||
\param socid Id soci<63>t<EFBFBD>
|
||||
\param selected Id projet pr<70>-s<>lectionn<6E>
|
||||
\param htmlname Nom de la zone html
|
||||
\return int Nbre de projet si ok, <0 si ko
|
||||
*/
|
||||
* \file htdocs/lib/project.lib.php
|
||||
* \brief Ensemble de fonctions de base pour le module projet
|
||||
* \ingroup societe
|
||||
* \version $Id$
|
||||
*/
|
||||
function task_prepare_head($object)
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/task.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("TimeSpent");
|
||||
$head[$h][2] = 'tasks';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/who.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Affectations");
|
||||
$head[$h][2] = 'who';
|
||||
$h++;
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \brief Show a combo list with projects qualified for a third party)
|
||||
* \param socid Id third party
|
||||
* \param selected Id project preselected
|
||||
* \param htmlname Nom de la zone html
|
||||
* \return int Nbre de projet si ok, <0 si ko
|
||||
*/
|
||||
function select_projects($socid, $selected='', $htmlname='projectid')
|
||||
{
|
||||
global $db;
|
||||
@@ -109,4 +135,195 @@ function select_projects($socid, $selected='', $htmlname='projectid')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function PLinesb(&$inc, $parent, $lines, &$level, $tasksrole)
|
||||
{
|
||||
global $user, $bc, $langs;
|
||||
global $form;
|
||||
|
||||
$projectstatic = new Project($db);
|
||||
|
||||
$var=true;
|
||||
|
||||
for ($i = 0 ; $i < sizeof($lines) ; $i++)
|
||||
{
|
||||
if ($parent == 0)
|
||||
$level = 0;
|
||||
|
||||
if ($lines[$i]->fk_parent == $parent)
|
||||
{
|
||||
$var = !$var;
|
||||
print "<tr $bc[$var]>\n";
|
||||
|
||||
print "<td>";
|
||||
$projectstatic->id=$lines[$i]->projectid;
|
||||
$projectstatic->ref=$lines[$i]->projectref;
|
||||
print $projectstatic->getNomUrl(1);
|
||||
print "</td>";
|
||||
|
||||
print "<td>".$lines[$i]->id."</td>";
|
||||
|
||||
print "<td>";
|
||||
|
||||
for ($k = 0 ; $k < $level ; $k++)
|
||||
{
|
||||
print " ";
|
||||
}
|
||||
|
||||
print '<a href="'.DOL_URL_ROOT.'/projet/tasks/task.php?id='.$lines[$i]->id.'">'.$lines[$i]->title."</a></td>\n";
|
||||
|
||||
$heure = intval($lines[$i]->duration);
|
||||
$minutes = round((($lines[$i]->duration - $heure) * 60),0);
|
||||
$minutes = substr("00"."$minutes", -2);
|
||||
|
||||
print '<td align="right">'.$heure." h ".$minutes."</td>\n";
|
||||
|
||||
if ($tasksrole[$lines[$i]->id] == 'admin')
|
||||
{
|
||||
print '<td>';
|
||||
print '<input size="4" type="text" class="flat" name="task'.$lines[$i]->id.'" value="">';
|
||||
print ' <input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||
print '</td>';
|
||||
print "<td>";
|
||||
print $form->select_date('',$lines[$i]->id,'','','',"addtime");
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td colspan="2"> </td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
$inc++;
|
||||
$level++;
|
||||
if ($lines[$i]->id) PLinesb($inc, $lines[$i]->id, $lines, $level, $tasksrole);
|
||||
$level--;
|
||||
}
|
||||
else
|
||||
{
|
||||
//$level--;
|
||||
}
|
||||
}
|
||||
|
||||
return $inc;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Enter description here...
|
||||
*
|
||||
* @param unknown_type $inc
|
||||
* @param unknown_type $parent
|
||||
* @param unknown_type $lines
|
||||
* @param unknown_type $level
|
||||
* @param unknown_type $var
|
||||
* @param unknown_type $showproject
|
||||
*/
|
||||
function PLines(&$inc, $parent, $lines, &$level, $var, $showproject=1)
|
||||
{
|
||||
global $user, $bc, $langs;
|
||||
|
||||
$lastprojectid=0;
|
||||
|
||||
$projectstatic = new Project($db);
|
||||
|
||||
for ($i = 0 ; $i < sizeof($lines) ; $i++)
|
||||
{
|
||||
if ($parent == 0) $level = 0;
|
||||
|
||||
if ($lines[$i]->fk_parent == $parent)
|
||||
{
|
||||
// Break on a new project
|
||||
if ($parent == 0 && $lines[$i]->projectid != $lastprojectid)
|
||||
{
|
||||
$var = !$var;
|
||||
$lastprojectid=$lines[$i]->projectid;
|
||||
}
|
||||
|
||||
print "<tr ".$bc[$var].">\n";
|
||||
|
||||
if ($showproject)
|
||||
{
|
||||
print "<td>";
|
||||
$projectstatic->id=$lines[$i]->projectid;
|
||||
$projectstatic->ref=$lines[$i]->projectref;
|
||||
print $projectstatic->getNomUrl(1);
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
print "<td>".$lines[$i]->id."</td>";
|
||||
|
||||
print "<td>";
|
||||
for ($k = 0 ; $k < $level ; $k++)
|
||||
{
|
||||
print " ";
|
||||
}
|
||||
|
||||
print '<a href="task.php?id='.$lines[$i]->id.'">'.$lines[$i]->title."</a></td>\n";
|
||||
|
||||
$heure = intval($lines[$i]->duration);
|
||||
$minutes = round((($lines[$i]->duration - $heure) * 60),0);
|
||||
$minutes = substr("00"."$minutes", -2);
|
||||
|
||||
print '<td align="right">'.$heure." h ".$minutes."</td>\n";
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
$inc++;
|
||||
|
||||
$level++;
|
||||
if ($lines[$i]->id) PLines($inc, $lines[$i]->id, $lines, $level, $var, $showproject);
|
||||
$level--;
|
||||
}
|
||||
else
|
||||
{
|
||||
//$level--;
|
||||
}
|
||||
}
|
||||
|
||||
return $inc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean task not linked to a parent
|
||||
* @param unknown_type $db
|
||||
* @return int Nb of records deleted
|
||||
*/
|
||||
function clean_orphelins($db)
|
||||
{
|
||||
$nb=0;
|
||||
|
||||
// There is orphelins. We clean that
|
||||
$listofid=array();
|
||||
$sql='SELECT rowid from '.MAIN_DB_PREFIX.'projet_task';
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num && $i < 100)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$listofid[]=$obj->rowid;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
if (sizeof($listofid))
|
||||
{
|
||||
// Removed orphelins records
|
||||
print 'Some orphelins were found and restored to be parents so records are visible again.';
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'projet_task set fk_task_parent = 0 where fk_task_parent';
|
||||
$sql.= ' NOT IN ('.join(',',$listofid).')';
|
||||
$resql = $db->query($sql);
|
||||
$nb=$db->affected_rows($sql);
|
||||
}
|
||||
|
||||
return $nb;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -19,18 +19,17 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/project.class.php
|
||||
\ingroup projet
|
||||
\brief Fichier de la classe de gestion des projets
|
||||
\version $Id$
|
||||
*/
|
||||
|
||||
* \file htdocs/project.class.php
|
||||
* \ingroup projet
|
||||
* \brief Fichier de la classe de gestion des projets
|
||||
* \version $Id$
|
||||
*/
|
||||
require_once(DOL_DOCUMENT_ROOT ."/commonobject.class.php");
|
||||
|
||||
/**
|
||||
\class Project
|
||||
\brief Classe permettant la gestion des projets
|
||||
*/
|
||||
* \class Project
|
||||
* \brief Class to manage projects
|
||||
*/
|
||||
class Project extends CommonObject
|
||||
{
|
||||
var $db; //!< To store db handler
|
||||
@@ -287,47 +286,67 @@ class Project extends CommonObject
|
||||
* \param user Id user that create
|
||||
* \param title Title of task
|
||||
* \param parent Id task parent
|
||||
* \param id_resp Id of responsible user
|
||||
* \return int Task id if succes, <0 if KO
|
||||
*/
|
||||
function CreateTask($user, $title, $parent = 0)
|
||||
function CreateTask($user, $title, $parent=0, $id_resp=0)
|
||||
{
|
||||
$result = 0;
|
||||
$task_id = -1;
|
||||
|
||||
if (trim($title))
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task (fk_projet, title, fk_user_creat, fk_task_parent, duration_effective)";
|
||||
$sql.= " VALUES (".$this->id.",'$title', ".$user->id.",".$parent.", 0)";
|
||||
$this->db->begin();
|
||||
|
||||
dolibarr_syslog("Project::CreateTask sql=".$sql,LOG_DEBUG);
|
||||
if ($this->db->query($sql) )
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task (fk_projet, title, fk_user_creat, fk_task_parent, duration_effective)";
|
||||
$sql.= " VALUES (".$this->id.",'".addslashes($title)."', ".$user->id.",".($parent>0?$parent:'0').", 0)";
|
||||
|
||||
dolibarr_syslog("Project::CreateTask sql=".$sql, LOG_DEBUG);
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
$task_id = $this->db->last_insert_id(MAIN_DB_PREFIX."projet_task");
|
||||
$result = 0;
|
||||
$result = $task_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
dolibarr_syslog("Project::CreateTask error -2 ".$this->error,LOG_ERR);
|
||||
$result = -2;
|
||||
$this->error=$this->db->lasterror();
|
||||
dolibarr_syslog("Project::CreateTask error -1 ".$this->error, LOG_ERR);
|
||||
$result = -1;
|
||||
}
|
||||
|
||||
if ($result == 0)
|
||||
if ($result >= 0)
|
||||
{
|
||||
if ($id_resp > 0)
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task_actors (fk_projet_task, fk_user)";
|
||||
$sql.= " VALUES (".$task_id.",".$user->id.")";
|
||||
$sql.= " VALUES (".$task_id.",".($id_resp>0?$id_resp:'null').")";
|
||||
|
||||
dolibarr_syslog("Project::CreateTask sql=".$sql,LOG_DEBUG);
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
$result = 0;
|
||||
$this->db->commit();
|
||||
return $task_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
$this->error=$this->db->lasterror();
|
||||
dolibarr_syslog("Project::CreateTask error -3 ".$this->error,LOG_ERR);
|
||||
$result = -2;
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
else
|
||||
{
|
||||
$this->db->commit();
|
||||
return $task_id;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_syslog("Project::CreateTask error -2 ".$this->error,LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -424,31 +443,39 @@ class Project extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of task for project
|
||||
* @param user Object user to limit task affected to a particular user
|
||||
*
|
||||
* @return unknown
|
||||
* Return list of task for all projects or a particular project
|
||||
* Sort order is on project, TODO then of position of task, and last on title of first level task
|
||||
* @param usert Object user to limit task affected to a particular user
|
||||
* @param userp Object user to limit projects of a particular user
|
||||
* @return array Array of tasks
|
||||
*/
|
||||
function getTasksArray($user=0)
|
||||
function getTasksArray($usert=0,$userp=0)
|
||||
{
|
||||
$tasks = array();
|
||||
|
||||
/* List of tasks */
|
||||
//print $usert.'-'.$userp;
|
||||
|
||||
// List of tasks
|
||||
$sql = "SELECT p.rowid as projectid, p.ref, p.title as ptitle,";
|
||||
$sql.= " t.rowid, t.title, t.fk_task_parent, t.duration_effective";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
if (is_object($user))
|
||||
$sql.= " t.rowid, t.title, t.fk_task_parent, t.duration_effective,";
|
||||
$sql.= " up.name, up.firstname";
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."projet as p";
|
||||
if (is_object($usert)) // Limit to task affected to a user
|
||||
{
|
||||
$sql.= ", ".MAIN_DB_PREFIX."projet_task as t";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."projet_task_actors as ta";
|
||||
$sql.= ")";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql.= ")";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid";
|
||||
}
|
||||
$sql.=" WHERE 1 = 1";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as up on p.fk_user_resp = up.rowid";
|
||||
$sql.= " WHERE 1 = 1";
|
||||
if ($this->id) $sql .= " AND t.fk_projet =".$this->id;
|
||||
if (is_object($user)) $sql .= " AND t.fk_projet = p.rowid AND ta.fk_projet_task = t.rowid AND ta.fk_user =".$user->id;
|
||||
if (is_object($usert)) $sql .= " AND t.fk_projet = p.rowid AND ta.fk_projet_task = t.rowid AND ta.fk_user = ".$usert->id;
|
||||
if (is_object($userp)) $sql .= " AND (p.fk_user_resp = ".$userp->id." OR p.fk_user_resp IS NULL OR p.fk_user_resp = -1)";
|
||||
$sql.= " ORDER BY p.ref, t.title";
|
||||
|
||||
dolibarr_syslog("Project::getTasksArray sql=".$sql, LOG_DEBUG);
|
||||
@@ -467,6 +494,8 @@ class Project extends CommonObject
|
||||
$tasks[$i]->title = $obj->title;
|
||||
$tasks[$i]->fk_parent = $obj->fk_task_parent;
|
||||
$tasks[$i]->duration = $obj->duration_effective;
|
||||
$tasks[$i]->name = $obj->name;
|
||||
$tasks[$i]->firstname = $obj->firstname;
|
||||
$i++;
|
||||
}
|
||||
$this->db->free();
|
||||
@@ -479,6 +508,7 @@ class Project extends CommonObject
|
||||
return $tasks;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Renvoie nom clicable (avec eventuellement le picto)
|
||||
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@@ -22,7 +22,7 @@
|
||||
\ingroup projet
|
||||
\brief Page activite perso du module projet
|
||||
\version $Id$
|
||||
*/
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
|
||||
@@ -43,10 +43,12 @@ $langs->load("projects");
|
||||
* View
|
||||
*/
|
||||
|
||||
$now = time();
|
||||
$now = gmmktime();
|
||||
|
||||
if ($mode == 'mine') $title=$langs->trans("MyActivity");
|
||||
else $title=$langs->trans("Activity");
|
||||
$projectstatic=new Project($db);
|
||||
|
||||
if ($mode == 'mine') $title=$langs->trans("MyActivities");
|
||||
else $title=$langs->trans("Activities");
|
||||
|
||||
llxHeader("",$title);
|
||||
|
||||
@@ -55,18 +57,13 @@ print_fiche_titre($title);
|
||||
print '<table border="0" width="100%" class="notopnoleftnoright">';
|
||||
print '<tr><td width="30%" valign="top" class="notopnoleft">';
|
||||
|
||||
/*
|
||||
*
|
||||
* Affichage de la liste des projets
|
||||
*
|
||||
*/
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Project"),$_SERVER["PHP_SELF"],"s.nom","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Project"),$_SERVER["PHP_SELF"],"","","","",$sortfield,$sortorder);
|
||||
print '<td align="right">'.$langs->trans("NbOpenTasks").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$sql = "SELECT p.title, p.rowid, count(t.rowid)";
|
||||
$sql = "SELECT p.rowid, p.ref, p.title, count(t.rowid) as nb";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."projet_task as t";
|
||||
@@ -91,11 +88,15 @@ if ( $resql )
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $db->fetch_row( $resql);
|
||||
$row = $db->fetch_object($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="right">'.$row[2].'</td>';
|
||||
print '<td>';
|
||||
$projectstatic->id=$row->rowid;
|
||||
$projectstatic->ref=$row->ref;
|
||||
print $projectstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '<td align="right">'.$row->nb.'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$i++;
|
||||
@@ -116,7 +117,7 @@ print '<td width="50%">'.$langs->trans('Today').'</td>';
|
||||
print '<td width="50%" align="right">'.$langs->trans("Time").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$sql = "SELECT p.title, p.rowid, sum(tt.task_duration)";
|
||||
$sql = "SELECT p.rowid, p.ref, p.title, sum(tt.task_duration) as nb";
|
||||
$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";
|
||||
@@ -131,14 +132,18 @@ $total=0;
|
||||
$resql = $db->query($sql);
|
||||
if ( $resql )
|
||||
{
|
||||
while ($row = $db->fetch_row($resql))
|
||||
while ($row = $db->fetch_object($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="right">'.$row[2].'</td>';
|
||||
print '<td>';
|
||||
$projectstatic->id=$row->rowid;
|
||||
$projectstatic->ref=$row->ref;
|
||||
print $projectstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '<td align="right">'.$row->nb.'</td>';
|
||||
print "</tr>\n";
|
||||
$total += $row[2];
|
||||
$total += $row->nb;
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
@@ -160,7 +165,7 @@ print '<td>'.$langs->trans('Yesterday').'</td>';
|
||||
print '<td align="right">'.$langs->trans("Time").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$sql = "SELECT p.title, p.rowid, sum(tt.task_duration)";
|
||||
$sql = "SELECT p.rowid, p.ref, p.title, sum(tt.task_duration) as nb";
|
||||
$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";
|
||||
@@ -175,14 +180,18 @@ $total=0;
|
||||
$resql = $db->query($sql);
|
||||
if ( $resql )
|
||||
{
|
||||
while ($row = $db->fetch_row($resql))
|
||||
while ($row = $db->fetch_object($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="right">'.$row[2].'</td>';
|
||||
print '<td>';
|
||||
$projectstatic->id=$row->rowid;
|
||||
$projectstatic->ref=$row->ref;
|
||||
print $projectstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '<td align="right">'.$row->nb.'</td>';
|
||||
print "</tr>\n";
|
||||
$total += $row[2];
|
||||
$total += $row->nb;
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
@@ -206,7 +215,7 @@ print '<td>'.$langs->trans("ActivityOnProjectThisWeek").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Time").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$sql = "SELECT p.title, p.rowid, sum(tt.task_duration)";
|
||||
$sql = "SELECT p.rowid, p.ref, p.title, sum(tt.task_duration) as nb";
|
||||
$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";
|
||||
@@ -220,14 +229,18 @@ $var=true;
|
||||
$resql = $db->query($sql);
|
||||
if ( $resql )
|
||||
{
|
||||
while ($row = $db->fetch_row( $resql))
|
||||
while ($row = $db->fetch_object($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="right">'.$row[2].'</td>';
|
||||
print '<td>';
|
||||
$projectstatic->id=$row->rowid;
|
||||
$projectstatic->ref=$row->ref;
|
||||
print $projectstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '<td align="right">'.$row->nb.'</td>';
|
||||
print "</tr>\n";
|
||||
$total += $row[2];
|
||||
$total += $row->nb;
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
@@ -249,7 +262,7 @@ print '<td>'.$langs->trans("ActivityOnProjectThisMonth").': '.strftime("%B %Y",
|
||||
print '<td align="right">'.$langs->trans("Time").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$sql = "SELECT p.title, p.rowid, sum(tt.task_duration)";
|
||||
$sql = "SELECT p.rowid, p.ref, p.title, sum(tt.task_duration) as nb";
|
||||
$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";
|
||||
@@ -263,11 +276,15 @@ $var=false;
|
||||
$resql = $db->query($sql);
|
||||
if ( $resql )
|
||||
{
|
||||
while ($row = $db->fetch_row($resql))
|
||||
while ($row = $db->fetch_object($resql))
|
||||
{
|
||||
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="right">'.$row[2].'</td>';
|
||||
print '<td>';
|
||||
$projectstatic->id=$row->rowid;
|
||||
$projectstatic->ref=$row->ref;
|
||||
print $projectstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '<td align="right">'.$row->nb.'</td>';
|
||||
print "</tr>\n";
|
||||
$var=!$var;
|
||||
}
|
||||
@@ -286,7 +303,7 @@ print '<td>'.$langs->trans("ActivityOnProjectThisYear").': '.strftime("%Y", $now
|
||||
print '<td align="right">'.$langs->trans("Time").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$sql = "SELECT p.title, p.rowid, sum(tt.task_duration)";
|
||||
$sql = "SELECT p.rowid, p.ref, p.title, sum(tt.task_duration) as nb";
|
||||
$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";
|
||||
@@ -300,11 +317,15 @@ $var=false;
|
||||
$resql = $db->query($sql);
|
||||
if ( $resql )
|
||||
{
|
||||
while ($row = $db->fetch_row($resql))
|
||||
while ($row = $db->fetch_object($resql))
|
||||
{
|
||||
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="right">'.$row[2].'</td>';
|
||||
print '<td>';
|
||||
$projectstatic->id=$row->rowid;
|
||||
$projectstatic->ref=$row->ref;
|
||||
print $projectstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '<td align="right">'.$row->nb.'</td>';
|
||||
print "</tr>\n";
|
||||
$var=!$var;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -118,7 +118,8 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorde
|
||||
if ($mesg) print $mesg;
|
||||
|
||||
$tasksrole=$projet->getTasksRoleForUser($user);
|
||||
$tasksarray=$projet->getTasksArray();
|
||||
$tasksarray=$projet->getTasksArray(0,0);
|
||||
//var_dump($tasksarray);
|
||||
|
||||
print '<form name="addtime" method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$projet->id.'">';
|
||||
print '<input type="hidden" name="action" value="addtime">';
|
||||
@@ -131,7 +132,7 @@ print '<td>'.$langs->trans("LabelTask").'</td>';
|
||||
print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
|
||||
print '<td colspan="2">'.$langs->trans("AddDuration").'</td>';
|
||||
print "</tr>\n";
|
||||
PLines($j, 0, $tasksarray, $level, $tasksrole);
|
||||
PLinesb($j, 0, $tasksarray, $level, $tasksrole);
|
||||
print '</form>';
|
||||
|
||||
|
||||
@@ -141,75 +142,4 @@ print '</div>';
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
|
||||
|
||||
function PLines(&$inc, $parent, $lines, &$level, $tasksrole)
|
||||
{
|
||||
global $user, $bc, $langs;
|
||||
global $form;
|
||||
|
||||
$projectstatic = new Project($db);
|
||||
|
||||
$var=true;
|
||||
|
||||
for ($i = 0 ; $i < sizeof($lines) ; $i++)
|
||||
{
|
||||
if ($parent == 0)
|
||||
$level = 0;
|
||||
|
||||
if ($lines[$i]->fk_parent == $parent)
|
||||
{
|
||||
$var = !$var;
|
||||
print "<tr $bc[$var]>\n";
|
||||
|
||||
print "<td>";
|
||||
$projectstatic->id=$lines[$i]->projectid;
|
||||
$projectstatic->ref=$lines[$i]->projectref;
|
||||
print $projectstatic->getNomUrl(1);
|
||||
print "</td>";
|
||||
|
||||
print "<td>".$lines[$i]->id."</td>";
|
||||
|
||||
print "<td>";
|
||||
|
||||
for ($k = 0 ; $k < $level ; $k++)
|
||||
{
|
||||
print " ";
|
||||
}
|
||||
|
||||
print '<a href="'.DOL_URL_ROOT.'/projet/tasks/task.php?id='.$lines[$i]->id.'">'.$lines[$i]->title."</a></td>\n";
|
||||
|
||||
$heure = intval($lines[$i]->duration);
|
||||
$minutes = round((($lines[$i]->duration - $heure) * 60),0);
|
||||
$minutes = substr("00"."$minutes", -2);
|
||||
|
||||
print '<td align="right">'.$heure." h ".$minutes."</td>\n";
|
||||
|
||||
if ($tasksrole[$lines[$i]->id] == 'admin')
|
||||
{
|
||||
print '<td>';
|
||||
print '<input size="4" type="text" class="flat" name="task'.$lines[$i]->id.'" value="">';
|
||||
print ' <input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||
print '</td>';
|
||||
print "<td>";
|
||||
print $form->select_date('',$lines[$i]->id,'','','',"addtime");
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td colspan="2"> </td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
$inc++;
|
||||
$level++;
|
||||
if ($lines[$i]->id) PLines($inc, $lines[$i]->id, $lines, $level, $tasksrole);
|
||||
$level--;
|
||||
}
|
||||
else
|
||||
{
|
||||
//$level--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/projet/activity/pre.inc.php
|
||||
\ingroup projet
|
||||
\brief Fichier de gestion du menu gauche du module projet
|
||||
\version $Id$
|
||||
*/
|
||||
* \file htdocs/projet/activity/pre.inc.php
|
||||
* \ingroup projet
|
||||
* \brief Fichier de gestion du menu gauche du module projet
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require ("../../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/project.class.php");
|
||||
@@ -49,13 +49,19 @@ function llxHeader($head = "", $title="", $help_url='')
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/fiche.php?leftmenu=projects&action=create", $langs->trans("NewProject"), 1, $user->rights->projet->creer);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/liste.php?leftmenu=projects", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/projet/tasks/index.php", $langs->trans("Tasks"), 0, $user->rights->projet->lire);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php?mode=mine", $langs->trans("MyTasks"), 1, $user->rights->projet->lire);
|
||||
$menu->add(DOL_URL_ROOT."/projet/index.php?leftmenu=projects&mode=mine", $langs->trans("MyProjects"), 0, $user->rights->projet->lire);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/fiche.php?leftmenu=projects&action=create&mode=mine", $langs->trans("NewProject"), 1, $user->rights->projet->creer);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/liste.php?leftmenu=projects&mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/projet/activity/index.php", $langs->trans("TimeSpent"), 0, $user->rights->projet->lire);
|
||||
$menu->add(DOL_URL_ROOT."/projet/activity/index.php", $langs->trans("Activities"), 0, $user->rights->projet->lire);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/activity/list.php", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/activity/index.php?mode=mine", $langs->trans("MyTimeSpent"), 1, $user->rights->projet->lire);
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/projet/activity/index.php?mode=mine", $langs->trans("MyActivities"), 0, $user->rights->projet->lire);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create&mode=mine", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php?mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/activity/list.php?mode=mine", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer);
|
||||
|
||||
left_menu($menu->liste, $help_url);
|
||||
}
|
||||
|
||||
@@ -64,6 +64,10 @@ $form = new Form($db);
|
||||
$projet = new Project($db);
|
||||
$projet->fetch($_GET["id"],$_GET["ref"]);
|
||||
$projet->societe->fetch($projet->societe->id);
|
||||
if ($projet->user_resp_id > 0)
|
||||
{
|
||||
$result=$projet->fetch_user($projet->user_resp_id);
|
||||
}
|
||||
|
||||
$head=project_prepare_head($projet);
|
||||
dolibarr_fiche_head($head, 'element', $langs->trans("Project"));
|
||||
@@ -82,6 +86,12 @@ if (! empty($projet->societe->id)) print $projet->societe->getNomUrl(1);
|
||||
else print ' ';
|
||||
print '</td></tr>';
|
||||
|
||||
// Project leader
|
||||
print '<tr><td>'.$langs->trans("OfficerProject").'</td><td>';
|
||||
if ($projet->user->id) print $projet->user->getNomUrl(1);
|
||||
else print $langs->trans('SharedProject');
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
@@ -165,7 +165,15 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
|
||||
|
||||
// Responsable du projet
|
||||
print '<tr><td>'.$langs->trans("OfficerProject").'</td><td>';
|
||||
if ($_REQUEST["mode"] != 'mine')
|
||||
{
|
||||
$html->select_users($projet->user_resp_id,'officer_project',1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print $user->getNomUrl(1);
|
||||
print '<input type="hidden" name="officer_project" value="'.$user->id.'">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Create").'"></td></tr>';
|
||||
@@ -184,6 +192,10 @@ else
|
||||
$projet = new Project($db);
|
||||
$projet->fetch($_GET["id"],$_GET["ref"]);
|
||||
$projet->societe->fetch($projet->societe->id);
|
||||
if ($projet->user_resp_id > 0)
|
||||
{
|
||||
$result=$projet->fetch_user($projet->user_resp_id);
|
||||
}
|
||||
|
||||
$head=project_prepare_head($projet);
|
||||
dolibarr_fiche_head($head, 'project', $langs->trans("Project"));
|
||||
@@ -224,11 +236,6 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($projet->user_resp_id > 0)
|
||||
{
|
||||
$result=$projet->fetch_user($projet->user_resp_id);
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
@@ -248,7 +255,7 @@ else
|
||||
// Project leader
|
||||
print '<tr><td>'.$langs->trans("OfficerProject").'</td><td>';
|
||||
if ($projet->user->id) print $projet->user->getNomUrl(1);
|
||||
else print ' ';
|
||||
else print $langs->trans('SharedProject');
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@@ -43,19 +43,16 @@ if ($user->societe_id > 0)
|
||||
|
||||
llxHeader("",$langs->trans("Projects"),"Projet");
|
||||
|
||||
print_fiche_titre($langs->trans("ProjectsArea"));
|
||||
$text=$langs->trans("Projects");
|
||||
if ($_REQUEST["mode"]=='mine') $text=$langs->trans("MyProjects");
|
||||
print_fiche_titre($text);
|
||||
|
||||
print '<table border="0" width="100%" class="notopnoleftnoright">';
|
||||
print '<tr><td width="30%" valign="top" class="notopnoleft">';
|
||||
|
||||
/*
|
||||
*
|
||||
* 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,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Project"),"index.php","","","","",$sortfield,$sortorder);
|
||||
print '<td align="right">'.$langs->trans("NbOpenTasks").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -67,6 +64,7 @@ $sql.= " ".MAIN_DB_PREFIX."projet as p";
|
||||
//$sql.= " , ".MAIN_DB_PREFIX."projet_task as t"; // pourquoi est-ce que c'<27>tait en commentaire ? => Si on laisse ce lien, les projet sans taches se retrouvent invisibles
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t ON p.rowid = t.fk_projet";
|
||||
$sql.= " WHERE 1 = 1";
|
||||
if ($_REQUEST["mode"]=='mine') $sql.=' AND p.fk_user_resp='.$user->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($socid)
|
||||
{
|
||||
@@ -103,11 +101,7 @@ print "</table>";
|
||||
|
||||
print '</td><td width="70%" valign="top" class="notopnoleft">';
|
||||
|
||||
/*
|
||||
*
|
||||
* Affichage de la liste des projets
|
||||
*
|
||||
*/
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Company"),"index.php","s.nom","","","",$sortfield,$sortorder);
|
||||
@@ -119,6 +113,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.f
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."projet as p";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " WHERE p.fk_soc = s.rowid";
|
||||
if ($_REQUEST["mode"]=='mine') $sql.=' AND p.fk_user_resp='.$user->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($socid)
|
||||
{
|
||||
@@ -158,5 +153,5 @@ print '</td></tr></table>';
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
?>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Marc Bariley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2006 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
@@ -20,11 +20,11 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/projet/liste.php
|
||||
\ingroup projet
|
||||
\brief Page liste des projets
|
||||
\version $Id$
|
||||
*/
|
||||
* \file htdocs/projet/liste.php
|
||||
* \ingroup projet
|
||||
* \brief Page liste des projets
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
|
||||
@@ -65,15 +65,18 @@ $pagenext = $page + 1;
|
||||
|
||||
llxHeader();
|
||||
|
||||
$projectstatic = new Project($db);
|
||||
$userstatic = new User($db);
|
||||
$staticsoc=new Societe($db);
|
||||
|
||||
$sql = "SELECT p.rowid as projectid, p.ref, p.title, ".$db->pdate("p.dateo")." as do";
|
||||
$sql .= ", s.nom, s.rowid as socid, s.client";
|
||||
$sql = "SELECT p.rowid as projectid, p.ref, p.title, ".$db->pdate("p.dateo")." as do, p.fk_user_resp,";
|
||||
$sql .= " s.nom, s.rowid as socid, s.client";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||
$sql .= " FROM (".MAIN_DB_PREFIX."projet as p";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= ") LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = p.fk_soc";
|
||||
$sql .= " WHERE 1 = 1 ";
|
||||
if ($_REQUEST["mode"]=='mine') $sql.=' AND p.fk_user_resp='.$user->id;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($socid)
|
||||
{
|
||||
@@ -100,20 +103,23 @@ if ($resql)
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
print_barre_liste($langs->trans("ProjectsList"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num);
|
||||
$text=$langs->trans("Projects");
|
||||
if ($_REQUEST["mode"]=='mine') $text=$langs->trans('MyProjects');
|
||||
print_barre_liste($text, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num);
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),"liste.php","p.ref","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),"liste.php","p.title","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Company"),"liste.php","s.nom","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("OfficerProject"),"liste.php","","","","",$sortfield,$sortorder);
|
||||
print '<td> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<form method="get" action="liste.php">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td valign="right">';
|
||||
print '<input type="text" class="flat" name="search_ref" value="'.$_GET["search_ref"].'">';
|
||||
print '<input type="text" class="flat" name="search_ref" value="'.$_GET["search_ref"].'" size="6">';
|
||||
print '</td>';
|
||||
print '<td valign="right">';
|
||||
print '<input type="text" class="flat" name="search_label" value="'.$_GET["search_label"].'">';
|
||||
@@ -121,7 +127,8 @@ if ($resql)
|
||||
print '<td valign="right">';
|
||||
print '<input type="text" class="flat" name="search_societe" value="'.$_GET["search_societe"].'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="center"><input class="liste_titre" type="image" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">';
|
||||
print '<td> </td>';
|
||||
print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">';
|
||||
print "</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -130,8 +137,17 @@ if ($resql)
|
||||
$objp = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td><a href=\"fiche.php?id=$objp->projectid\">".img_object($langs->trans("ShowProject"),"project")." ".$objp->ref."</a></td>\n";
|
||||
print "<td><a href=\"fiche.php?id=$objp->projectid\">".$objp->title."</a></td>\n";
|
||||
|
||||
print "<td>";
|
||||
$projectstatic->id=$objp->projectid;
|
||||
$projectstatic->ref=$objp->ref;
|
||||
print $projectstatic->getNomUrl(1);
|
||||
print "</td>";
|
||||
|
||||
// Title
|
||||
print '<td>';
|
||||
print dolibarr_trunc($objp->title,24);
|
||||
print '</td>';
|
||||
|
||||
// Company
|
||||
print '<td>';
|
||||
@@ -147,6 +163,14 @@ if ($resql)
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Title
|
||||
$userstatic->id=$objp->fk_user_resp;
|
||||
$userstatic->nom=$objp->fk_user_resp;
|
||||
print '<td align="left">';
|
||||
if ($objp->fk_user_resp > 0) print $userstatic->getNomUrl(1);
|
||||
else print $langs->trans("SharedProject");
|
||||
print '</td>';
|
||||
|
||||
print '<td> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -166,5 +190,4 @@ $db->close();
|
||||
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
|
||||
?>
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/projet/pre.inc.php
|
||||
\ingroup projet
|
||||
\brief Fichier de gestion du menu gauche du module projet
|
||||
\version $Id$
|
||||
*/
|
||||
* \file htdocs/projet/pre.inc.php
|
||||
* \ingroup projet
|
||||
* \brief Fichier de gestion du menu gauche du module projet
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require ("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/project.class.php");
|
||||
@@ -52,13 +52,20 @@ function llxHeader($head = "", $title="", $help_url='')
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/fiche.php?leftmenu=projects&action=create", $langs->trans("NewProject"), 1, $user->rights->projet->creer);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/liste.php?leftmenu=projects", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/projet/tasks/index.php", $langs->trans("Tasks"), 0, $user->rights->projet->lire);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php?mode=mine", $langs->trans("MyTasks"), 1, $user->rights->projet->lire);
|
||||
$menu->add(DOL_URL_ROOT."/projet/index.php?leftmenu=projects&mode=mine", $langs->trans("MyProjects"), 0, $user->rights->projet->lire);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/fiche.php?leftmenu=projects&action=create&mode=mine", $langs->trans("NewProject"), 1, $user->rights->projet->creer);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/liste.php?leftmenu=projects&mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/projet/activity/index.php", $langs->trans("TimeSpent"), 0, $user->rights->projet->lire);
|
||||
$menu->add(DOL_URL_ROOT."/projet/activity/index.php", $langs->trans("Activities"), 0, $user->rights->projet->lire);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/activity/list.php", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/activity/index.php?mode=mine", $langs->trans("MyTimeSpent"), 1, $user->rights->projet->lire);
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/projet/activity/index.php?mode=mine", $langs->trans("MyActivities"), 0, $user->rights->projet->lire);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create&mode=mine", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php?mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/activity/list.php?mode=mine", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer);
|
||||
|
||||
|
||||
left_menu($menu->liste, $help_url);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/project.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formother.class.php");
|
||||
|
||||
$projetid='';
|
||||
$projetid=isset($_REQUEST["id"])?$_REQUEST["id"]:$_POST["projetid"];
|
||||
@@ -61,7 +63,7 @@ if ($_POST["action"] == 'createtask' && empty($_POST["cancel"]) && $user->rights
|
||||
$project = new Project($db);
|
||||
$result = $project->fetch($projectid);
|
||||
|
||||
$result=$project->CreateTask($user, $_POST["task_name"], $task_parent);
|
||||
$result=$project->CreateTask($user, $_POST["task_name"], $task_parent, $_POST["userid"]);
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@@ -115,6 +117,7 @@ if ($_POST["action"] == 'addtime' && $user->rights->projet->creer)
|
||||
*/
|
||||
|
||||
$form=new Form($db);
|
||||
$htmlother=new FormOther($db);
|
||||
|
||||
llxHeader("",$langs->trans("Tasks"),"Tasks");
|
||||
|
||||
@@ -125,15 +128,14 @@ $ref= $_GET['ref'];
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$projet->fetch($_REQUEST["id"],$_GET["ref"]);
|
||||
$projet->societe->fetch($projet->societe->id);
|
||||
if ($projet->societe->id > 0) $result=$projet->societe->fetch($projet->societe->id);
|
||||
if ($projet->user_resp_id > 0) $result=$projet->fetch_user($projet->user_resp_id);
|
||||
}
|
||||
|
||||
if ($_GET["action"] == 'create' && $user->rights->projet->creer)
|
||||
{
|
||||
print_fiche_titre($langs->trans("NewTask"));
|
||||
|
||||
$tasksarray=$projet->getTasksArray();
|
||||
|
||||
if ($mesg) print '<div class="error">'.$mesg.'</div>';
|
||||
|
||||
print '<form action="fiche.php" method="post">';
|
||||
@@ -143,22 +145,19 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td>'.$langs->trans("NewTask").'</td><td colspan="3">';
|
||||
print '<input type="text" size="25" name="task_name" class="flat"> ';
|
||||
if ($tasksarray)
|
||||
{
|
||||
print ' '.$langs->trans("ChildOfTaks").' ';
|
||||
|
||||
print '<select class="flat" name="task_parent">';
|
||||
print '<option value="0" selected="true"> </option>';
|
||||
$j=0;
|
||||
$level=0;
|
||||
PLineSelect($j, 0, $tasksarray, $level);
|
||||
print '</select>';
|
||||
}
|
||||
print '<tr><td>'.$langs->trans("NewTask").'</td><td>';
|
||||
print '<input type="text" size="25" name="task_name" class="flat">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td colspan="4" align="center">';
|
||||
print '<tr><td>'.$langs->trans("ChildOfTaks").'</td><td>';
|
||||
print $htmlother->selectProjectTasks($projet->id, 'task_parent', 1, 0);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("AffectedTo").'</td><td>';
|
||||
print $form->select_users($user->id,'userid',1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td colspan="2" align="center">';
|
||||
print '<input type="submit" class="button" name="add" value="'.$langs->trans("Add").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
@@ -194,14 +193,18 @@ else
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$projet->title.'</td></tr>';
|
||||
print '<td>'.$langs->trans("Company").'</td><td>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td>';
|
||||
if (! empty($projet->societe->id)) print $projet->societe->getNomUrl(1);
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
//print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
$tasksarray=$projet->getTasksArray($_REQUEST["mode"]=='mine'?$user:0);
|
||||
// Project leader
|
||||
print '<tr><td>'.$langs->trans("OfficerProject").'</td><td>';
|
||||
if ($projet->user->id) print $projet->user->getNomUrl(1);
|
||||
else print $langs->trans('SharedProject');
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@@ -211,151 +214,48 @@ else
|
||||
print '</div>';
|
||||
|
||||
|
||||
$tasksarray=$projet->getTasksArray($_REQUEST["mode"]=='mine'?$user:0, 0);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($user->rights->projet->creer)
|
||||
{
|
||||
if (empty($projet->user_resp_id) || $projet->user_resp_id == -1 || $projet->user_resp_id == $user->id)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$projet->id.'&action=create'.$param.'">'.$langs->trans('AddTask').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('AddTask').'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Project").'</td>';
|
||||
if ($projectstatic->id) print '<td>'.$langs->trans("Project").'</td>';
|
||||
print '<td>'.$langs->trans("RefTask").'</td>';
|
||||
print '<td>'.$langs->trans("LabelTask").'</td>';
|
||||
print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
|
||||
print "</tr>\n";
|
||||
$j=0;
|
||||
PLines($j, 0, $tasksarray, $level, true);
|
||||
$nboftaskshown=PLines($j, 0, $tasksarray, $level, true, 0);
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
if ($nboftaskshown < sizeof($tasksarray))
|
||||
{
|
||||
clean_orphelins($db);
|
||||
}
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
|
||||
|
||||
|
||||
// TODO Same function PLines than in fiche.php
|
||||
function PLines(&$inc, $parent, $lines, &$level, $var)
|
||||
{
|
||||
global $user, $bc, $langs;
|
||||
|
||||
$lastprojectid=0;
|
||||
|
||||
$projectstatic = new Project($db);
|
||||
|
||||
for ($i = 0 ; $i < sizeof($lines) ; $i++)
|
||||
{
|
||||
if ($parent == 0) $level = 0;
|
||||
|
||||
if ($lines[$i]->fk_parent == $parent)
|
||||
{
|
||||
// Break on a new project
|
||||
if ($parent == 0 && $lines[$i]->projectid != $lastprojectid)
|
||||
{
|
||||
$var = !$var;
|
||||
$lastprojectid=$lines[$i]->projectid;
|
||||
}
|
||||
|
||||
print "<tr $bc[$var]>\n";
|
||||
|
||||
print "<td>";
|
||||
$projectstatic->id=$lines[$i]->projectid;
|
||||
$projectstatic->ref=$lines[$i]->projectref;
|
||||
print $projectstatic->getNomUrl(1);
|
||||
print "</td>";
|
||||
|
||||
print "<td>".$lines[$i]->id."</td>";
|
||||
|
||||
print "<td>";
|
||||
for ($k = 0 ; $k < $level ; $k++)
|
||||
{
|
||||
print " ";
|
||||
}
|
||||
|
||||
print '<a href="task.php?id='.$lines[$i]->id.'">'.$lines[$i]->title."</a></td>\n";
|
||||
|
||||
$heure = intval($lines[$i]->duration);
|
||||
$minutes = round((($lines[$i]->duration - $heure) * 60),0);
|
||||
$minutes = substr("00"."$minutes", -2);
|
||||
|
||||
print '<td align="right">'.$heure." h ".$minutes."</td>\n";
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
$inc++;
|
||||
|
||||
$level++;
|
||||
if ($lines[$i]->id) PLines($inc, $lines[$i]->id, $lines, $level, $var);
|
||||
$level--;
|
||||
}
|
||||
else
|
||||
{
|
||||
//$level--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Enter description here...
|
||||
*
|
||||
* @param unknown_type $inc
|
||||
* @param unknown_type $parent
|
||||
* @param unknown_type $lines
|
||||
* @param unknown_type $level
|
||||
*/
|
||||
function PLineSelect(&$inc, $parent, $lines, &$level)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$lastprojectid=0;
|
||||
|
||||
for ($i = 0 ; $i < sizeof($lines) ; $i++)
|
||||
{
|
||||
if ($parent == 0) $level = 0;
|
||||
|
||||
if ($lines[$i]->fk_parent == $parent)
|
||||
{
|
||||
$var = !$var;
|
||||
|
||||
// Break on a new project
|
||||
if ($parent == 0 && $lines[$i]->projectid != $lastprojectid)
|
||||
{
|
||||
print '<option value="'.$lines[$i]->projectid.'_0">';
|
||||
print $langs->trans("Project").' '.$lines[$i]->projectref;
|
||||
//print '-'.$parent.'-'.$lines[$i]->projectid.'-'.$lastprojectid;
|
||||
print "</option>\n";
|
||||
|
||||
$lastprojectid=$lines[$i]->projectid;
|
||||
$inc++;
|
||||
}
|
||||
|
||||
print '<option value="'.$lines[$i]->projectid.'_'.$lines[$i]->id.'">';
|
||||
print $langs->trans("Project").' '.$lines[$i]->projectref;
|
||||
if ($lines[$i]->id) print ' > ';
|
||||
for ($k = 0 ; $k < $level ; $k++)
|
||||
{
|
||||
print " ";
|
||||
}
|
||||
print $lines[$i]->title."</option>\n";
|
||||
|
||||
$inc++;
|
||||
|
||||
$level++;
|
||||
if ($lines[$i]->id) PLineSelect($inc, $lines[$i]->id, $lines, $level);
|
||||
$level--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php");
|
||||
|
||||
$mode=$_REQUEST["mode"];
|
||||
|
||||
@@ -86,7 +87,7 @@ print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Project").'</td>';
|
||||
print '<td>'.$langs->trans("Task").'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -110,67 +111,4 @@ print '</div>';
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
|
||||
|
||||
// TODO Same function PLines than in fiche.php
|
||||
function PLines(&$inc, $parent, $lines, &$level, $var)
|
||||
{
|
||||
global $user, $bc, $langs;
|
||||
|
||||
$lastprojectid=0;
|
||||
|
||||
$projectstatic = new Project($db);
|
||||
|
||||
for ($i = 0 ; $i < sizeof($lines) ; $i++)
|
||||
{
|
||||
if ($parent == 0) $level = 0;
|
||||
|
||||
if ($lines[$i]->fk_parent == $parent)
|
||||
{
|
||||
// Break on a new project
|
||||
if ($parent == 0 && $lines[$i]->projectid != $lastprojectid)
|
||||
{
|
||||
$var = !$var;
|
||||
$lastprojectid=$lines[$i]->projectid;
|
||||
}
|
||||
|
||||
print "<tr $bc[$var]>\n";
|
||||
|
||||
print "<td>";
|
||||
$projectstatic->id=$lines[$i]->projectid;
|
||||
$projectstatic->ref=$lines[$i]->projectref;
|
||||
print $projectstatic->getNomUrl(1);
|
||||
print "</td>";
|
||||
|
||||
print "<td>".$lines[$i]->id."</td>";
|
||||
|
||||
print "<td>";
|
||||
for ($k = 0 ; $k < $level ; $k++)
|
||||
{
|
||||
print " ";
|
||||
}
|
||||
|
||||
print '<a href="task.php?id='.$lines[$i]->id.'">'.$lines[$i]->title."</a></td>\n";
|
||||
|
||||
$heure = intval($lines[$i]->duration);
|
||||
$minutes = round((($lines[$i]->duration - $heure) * 60),0);
|
||||
$minutes = substr("00"."$minutes", -2);
|
||||
|
||||
print '<td align="right">'.$heure." h ".$minutes."</td>\n";
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
$inc++;
|
||||
|
||||
$level++;
|
||||
if ($lines[$i]->id) PLines($inc, $lines[$i]->id, $lines, $level, $var);
|
||||
$level--;
|
||||
}
|
||||
else
|
||||
{
|
||||
//$level--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/projet/tasks/pre.inc.php
|
||||
\ingroup projet
|
||||
\brief Fichier de gestion du menu gauche du module projet
|
||||
\version $Id$
|
||||
*/
|
||||
* \file htdocs/projet/tasks/pre.inc.php
|
||||
* \ingroup projet
|
||||
* \brief Fichier de gestion du menu gauche du module projet
|
||||
* \version $Id$
|
||||
*/
|
||||
require ("../../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/project.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/task.class.php");
|
||||
@@ -48,13 +48,20 @@ function llxHeader($head = "", $title="", $help_url='')
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/fiche.php?leftmenu=projects&action=create", $langs->trans("NewProject"), 1, $user->rights->projet->creer);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/liste.php?leftmenu=projects", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/projet/tasks/index.php", $langs->trans("Tasks"), 0, $user->rights->projet->lire);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php?mode=mine", $langs->trans("MyTasks"), 1, $user->rights->projet->lire);
|
||||
$menu->add(DOL_URL_ROOT."/projet/index.php?leftmenu=projects&mode=mine", $langs->trans("MyProjects"), 0, $user->rights->projet->lire);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/fiche.php?leftmenu=projects&action=create&mode=mine", $langs->trans("NewProject"), 1, $user->rights->projet->creer);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/liste.php?leftmenu=projects&mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/projet/activity/index.php", $langs->trans("TimeSpent"), 0, $user->rights->projet->lire);
|
||||
$menu->add(DOL_URL_ROOT."/projet/activity/index.php", $langs->trans("Activities"), 0, $user->rights->projet->lire);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/activity/list.php", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/activity/index.php?mode=mine", $langs->trans("MyTimeSpent"), 1, $user->rights->projet->lire);
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/projet/activity/index.php?mode=mine", $langs->trans("MyActivities"), 0, $user->rights->projet->lire);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create&mode=mine", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php?mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
$menu->add_submenu(DOL_URL_ROOT."/projet/activity/list.php?mode=mine", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer);
|
||||
|
||||
|
||||
left_menu($menu->liste, $help_url);
|
||||
}
|
||||
|
||||
@@ -84,13 +84,9 @@ if ($_GET["id"] > 0)
|
||||
$result=$projet->fetch($task->fk_projet);
|
||||
if (! empty($projet->socid)) $projet->societe->fetch($projet->socid);
|
||||
|
||||
$h=0;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/task.php?id='.$task->id;
|
||||
$head[$h][1] = $langs->trans("Tasks");
|
||||
$head[$h][2] = 'tasks';
|
||||
$h++;
|
||||
$head=task_prepare_head($task);
|
||||
|
||||
dolibarr_fiche_head($head, 'tasks', $langs->trans("Tasks"));
|
||||
dolibarr_fiche_head($head, 'tasks', $langs->trans("Task"));
|
||||
|
||||
if ($mesg) print $mesg.'<br>';
|
||||
|
||||
|
||||
161
htdocs/projet/tasks/who.php
Normal file
161
htdocs/projet/tasks/who.php
Normal file
@@ -0,0 +1,161 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/projet/tasks/task.php
|
||||
* \ingroup projet
|
||||
* \brief Fiche t<>ches d'un projet
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php");
|
||||
|
||||
if (!$user->rights->projet->lire) accessforbidden();
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader("",$langs->trans("Task"));
|
||||
|
||||
$html = new Form($db);
|
||||
|
||||
$projectstatic = new Project($db);
|
||||
$userstatic = new User($db);
|
||||
|
||||
|
||||
if ($_GET["id"] > 0)
|
||||
{
|
||||
/*
|
||||
* Fiche projet en mode visu
|
||||
*
|
||||
*/
|
||||
$task = new Task($db);
|
||||
if ($task->fetch($_GET["id"]) >= 0 )
|
||||
{
|
||||
$projet = new Project($db);
|
||||
$result=$projet->fetch($task->fk_projet);
|
||||
if (! empty($projet->socid)) $projet->societe->fetch($projet->socid);
|
||||
|
||||
$head=task_prepare_head($task);
|
||||
|
||||
dolibarr_fiche_head($head, 'who', $langs->trans("Task"));
|
||||
|
||||
if ($mesg) print $mesg.'<br>';
|
||||
|
||||
print '<form method="POST" action="fiche.php?id='.$projet->id.'">';
|
||||
print '<input type="hidden" name="action" value="createtask">';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">'.$task->id.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$task->title.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Project").'</td><td>';
|
||||
print $projet->getNomUrl(1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<td>'.$langs->trans("Company").'</td><td>';
|
||||
if ($projet->societe->id) print $projet->societe->getNomUrl(1);
|
||||
else print ' ';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
/* Liste des affectations */
|
||||
|
||||
$sql = "SELECT t.title, t.duration_effective, t.fk_task_parent, t.statut,";
|
||||
$sql.= " u.login, u.rowid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet_task as t,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."projet_task_actors as ta,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= " WHERE t.rowid =".$task->id;
|
||||
$sql.= " AND t.rowid = ta.fk_projet_task AND ta.fk_user = u.rowid";
|
||||
|
||||
$lines=array();
|
||||
$var=true;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
$tasks = array();
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $db->fetch_object($resql);
|
||||
$lines[$i] = $row;
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
print '</table></form>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
/*if ($user->rights->projet->creer)
|
||||
{
|
||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?id='.$task->id.'&action=delete">'.$langs->trans('Delete').'</a>';
|
||||
}*/
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<br>';
|
||||
print '<input type="hidden" name="action" value="addtime">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td align="left">'.$langs->trans("User").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
foreach ($lines as $xxx)
|
||||
{
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
$userstatic->id=$xxx->rowid;
|
||||
$userstatic->nom=$xxx->login;
|
||||
print '<td align="left">'.$userstatic->getNomUrl(1).'</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
?>
|
||||
@@ -831,7 +831,7 @@ class Propal extends CommonObject
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
dolibarr_syslog("Propal::Fetch Error ".$this->error, LOG_ERROR);
|
||||
dolibarr_syslog("Propal::Fetch Error ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -451,7 +451,7 @@ insert into `llx_menu` (`rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titr
|
||||
insert into `llx_menu` (`rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, `right`, `target`, `user`, `order`) values (3601, 'project', '', 3600, '/comm/clients.php?leftmenu=projects', 'NewProject', 1, 'projects', '$user->rights->projet->lire', '', 2, 0);
|
||||
insert into `llx_menu` (`rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, `right`, `target`, `user`, `order`) values (3602, 'project', '', 3600, '/projet/liste.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 1);
|
||||
insert into `llx_menu` (`rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, `right`, `target`, `user`, `order`) values (3700, 'project', '', 7, '/projet/tasks', 'Tasks', 0, 'projects', '$user->rights->projet->lire', '', 2, 1);
|
||||
insert into `llx_menu` (`rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, `right`, `target`, `user`, `order`) values (3701, 'project', '', 3700, '/projet/tasks/mytasks.php', 'Mytasks', 1, 'projects', '$user->rights->projet->lire', '', 2, 0);
|
||||
insert into `llx_menu` (`rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, `right`, `target`, `user`, `order`) values (3701, 'project', '', 3700, '/projet/tasks/mytasks.php', 'MyTasks', 1, 'projects', '$user->rights->projet->lire', '', 2, 0);
|
||||
insert into `llx_menu` (`rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, `right`, `target`, `user`, `order`) values (3800, 'project', '', 7, '/projet/activity', 'Activity', 0, 'projects', '$user->rights->projet->lire', '', 2, 2);
|
||||
insert into `llx_menu` (`rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, `right`, `target`, `user`, `order`) values (3801, 'project', '', 3800, '/projet/activity/myactivity.php', 'MyActivity', 1, 'projects', '$user->rights->projet->lire', '', 2, 0);
|
||||
insert into `llx_menu` (`rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, `right`, `target`, `user`, `order`) values (3900, 'tools', '', 8, '/comm/mailing/index.php?leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 0);
|
||||
|
||||
Reference in New Issue
Block a user