Add more clear information for project view
BIN
documents/produit/1/0/1/photos/dolibarr_screenshot3.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
|
After Width: | Height: | Size: 17 KiB |
BIN
documents/produit/2/0/2/photos/dolibarr_logo1.jpg
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
documents/produit/2/0/2/photos/dolibarr_screenshot1.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
documents/produit/2/0/2/photos/thumbs/dolibarr_logo1_small.jpg
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 20 KiB |
BIN
documents/produit/temp/1/invoices12m.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
documents/produit/temp/1/invoicessuppliers12m.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
documents/produit/temp/1/orders12m.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
documents/produit/temp/1/propal12m.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
@@ -366,7 +366,7 @@ function PLineSelect(&$inc, $parent, $lines, $level=0, $selected=0)
|
|||||||
print $langs->trans("Project").' '.$lines[$i]->projectref;
|
print $langs->trans("Project").' '.$lines[$i]->projectref;
|
||||||
if (empty($lines[$i]->public))
|
if (empty($lines[$i]->public))
|
||||||
{
|
{
|
||||||
print ' ('.$langs->trans("Private").')';
|
print ' ('.$langs->trans("PrivateProject").')';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -389,7 +389,7 @@ function PLineSelect(&$inc, $parent, $lines, $level=0, $selected=0)
|
|||||||
print $langs->trans("Project").' '.$lines[$i]->projectref;
|
print $langs->trans("Project").' '.$lines[$i]->projectref;
|
||||||
if (empty($lines[$i]->public))
|
if (empty($lines[$i]->public))
|
||||||
{
|
{
|
||||||
print ' ('.$langs->trans("Private").')';
|
print ' ('.$langs->trans("PrivateProject").')';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -98,21 +98,21 @@ class modProjet extends DolibarrModules
|
|||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = 41; // id de la permission
|
$this->rights[$r][0] = 41; // id de la permission
|
||||||
$this->rights[$r][1] = "Lire les projets et taches (publiques ou m'appartenant)"; // libelle de la permission
|
$this->rights[$r][1] = "Lire les projets et taches (partagés ou dont je suis contact)"; // libelle de la permission
|
||||||
$this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
|
$this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
|
||||||
$this->rights[$r][3] = 1; // La permission est-elle une permission par defaut
|
$this->rights[$r][3] = 1; // La permission est-elle une permission par defaut
|
||||||
$this->rights[$r][4] = 'lire';
|
$this->rights[$r][4] = 'lire';
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = 42; // id de la permission
|
$this->rights[$r][0] = 42; // id de la permission
|
||||||
$this->rights[$r][1] = "Creer/modifier les projets et taches (publiques ou m'appartenant)"; // libelle de la permission
|
$this->rights[$r][1] = "Creer/modifier les projets et taches (partagés ou dont je suis contact)"; // libelle de la permission
|
||||||
$this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour)
|
$this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour)
|
||||||
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
|
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
|
||||||
$this->rights[$r][4] = 'creer';
|
$this->rights[$r][4] = 'creer';
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = 44; // id de la permission
|
$this->rights[$r][0] = 44; // id de la permission
|
||||||
$this->rights[$r][1] = "Supprimer les projets et taches (publiques ou m'appartenant)"; // libelle de la permission
|
$this->rights[$r][1] = "Supprimer les projets et taches (partagés ou dont je suis contact)"; // libelle de la permission
|
||||||
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
|
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
|
||||||
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
|
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
|
||||||
$this->rights[$r][4] = 'supprimer';
|
$this->rights[$r][4] = 'supprimer';
|
||||||
|
|||||||
@@ -395,9 +395,9 @@ Permission31=Read products
|
|||||||
Permission32=Create/modify products
|
Permission32=Create/modify products
|
||||||
Permission34=Delete products
|
Permission34=Delete products
|
||||||
Permission38=Export products
|
Permission38=Export products
|
||||||
Permission41=Read projects
|
Permission41=Read projects (shared project and projects i'm contact for)
|
||||||
Permission42=Create/modify projects
|
Permission42=Create/modify projects (shared project and projects i'm contact for)
|
||||||
Permission44=Delete projects
|
Permission44=Delete projects (shared project and projects i'm contact for)
|
||||||
Permission61=Read interventions
|
Permission61=Read interventions
|
||||||
Permission62=Create/modify interventions
|
Permission62=Create/modify interventions
|
||||||
Permission64=Delete interventions
|
Permission64=Delete interventions
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
CHARSET=UTF-8
|
CHARSET=UTF-8
|
||||||
Project=Project
|
Project=Project
|
||||||
Projects=Projects
|
Projects=Projects
|
||||||
SharedProject=Shared project
|
SharedProject=Everybody
|
||||||
|
PrivateProject=Contacts of project
|
||||||
|
MyProjectsDesc=Cette vue projet est restreinte aux projets pour lesquels vous êtes un contact affecté (quelqu'en soit le type).
|
||||||
|
ProjectsDesc=Cette vue présente tous les projets ayant pour visibilité "Tout le monde".
|
||||||
|
MyTasksDesc=Cette vue est restreinte aux projets et taches pour lesquels vous êtes un contact affecté à au moins une tache (quelqu'en soit le type).
|
||||||
|
TasksDesc=Cette vue présente tous les projets ayant pour visibilité "Tout le monde".
|
||||||
Myprojects=My projects
|
Myprojects=My projects
|
||||||
ProjectsArea=Projects area
|
ProjectsArea=Projects area
|
||||||
NewProject=New project
|
NewProject=New project
|
||||||
|
|||||||
@@ -395,9 +395,9 @@ Permission31 = Consulter les produits
|
|||||||
Permission32 = Créer/modifier les produits
|
Permission32 = Créer/modifier les produits
|
||||||
Permission34 = Supprimer les produits
|
Permission34 = Supprimer les produits
|
||||||
Permission38 = Exporter les produits
|
Permission38 = Exporter les produits
|
||||||
Permission41 = Consulter les projets et tâches (publiques ou m'appartenant)
|
Permission41 = Consulter les projets et tâches (partagés ou dont je suis contact)
|
||||||
Permission42 = Créer/modifier les projets et tâches (publiques ou m'appartenant)
|
Permission42 = Créer/modifier les projets et tâches (partagés ou dont je suis contact)
|
||||||
Permission44 = Supprimer les projets et tâches (publiques ou m'appartenant)
|
Permission44 = Supprimer les projets et tâches (partagés ou dont je suis contact)
|
||||||
Permission61 = Consulter les interventions
|
Permission61 = Consulter les interventions
|
||||||
Permission62 = Créer/modifier les interventions
|
Permission62 = Créer/modifier les interventions
|
||||||
Permission64 = Supprimer les interventions
|
Permission64 = Supprimer les interventions
|
||||||
@@ -439,9 +439,9 @@ Permission121 = Consulter les tiers (sociétés) liés à l'utilisateur
|
|||||||
Permission122 = Créer/modifier les tiers (sociétés) liés à l'utilisateur
|
Permission122 = Créer/modifier les tiers (sociétés) liés à l'utilisateur
|
||||||
Permission125 = Supprimer les tiers (sociétés) liés à l'utilisateur
|
Permission125 = Supprimer les tiers (sociétés) liés à l'utilisateur
|
||||||
Permission126 = Exporter les tiers (sociétés)
|
Permission126 = Exporter les tiers (sociétés)
|
||||||
Permission141 = Consulter tous les projets et tâches (y compris privés qui ne me sont pas affectés)
|
Permission141 = Consulter tous les projets et tâches (y compris privés dont je ne suis pas contact)
|
||||||
Permission142 = Créer/modifier tous les projets et tâches (y compris privés qui ne me sont pas affectés)
|
Permission142 = Créer/modifier tous les projets et tâches (y compris privés dont je ne suis pas contact)
|
||||||
Permission144 = Supprimer tous les projets et tâches (y compris privés qui ne me sont pas affectés)
|
Permission144 = Supprimer tous les projets et tâches (y compris privés dont je ne suis pas contact)
|
||||||
Permission146 = Consulter les fournisseurs
|
Permission146 = Consulter les fournisseurs
|
||||||
Permission147 = Consulter les stats
|
Permission147 = Consulter les stats
|
||||||
Permission151 = Consulter les prélèvements
|
Permission151 = Consulter les prélèvements
|
||||||
|
|||||||
@@ -2,7 +2,14 @@
|
|||||||
CHARSET=UTF-8
|
CHARSET=UTF-8
|
||||||
Project=Projet
|
Project=Projet
|
||||||
Projects=Projets
|
Projects=Projets
|
||||||
SharedProject=Projet partagé
|
SharedProject=Tout le monde
|
||||||
|
PrivateProject=Contacts du projet
|
||||||
|
MyProjectsDesc=Cette vue projet est restreinte aux projets pour lesquels vous êtes un contact affecté (quelqu'en soit le type).
|
||||||
|
ProjectsPublicDesc=Cette vue présente tous les projets pour lesquels vous êtes habilités à avoir une visibilité.
|
||||||
|
ProjectsDesc=Cette vue présente tous les projets (vos habilitations vous offrant une vue exhaustive).
|
||||||
|
MyTasksDesc=Cette vue est restreinte aux projets et taches pour lesquels vous êtes un contact affecté à au moins une tache (quelqu'en soit le type).
|
||||||
|
TasksPublicDesc=Cette vue présente tous les projets et taches pour lesquels vous êtes habilités à avoir une visibilité.
|
||||||
|
TasksDesc=Cette vue présente tous les projets et taches (vos habilitations vous offrant une vue exhaustive).
|
||||||
Myprojects=Mes projets
|
Myprojects=Mes projets
|
||||||
ProjectsArea=Espace projet
|
ProjectsArea=Espace projet
|
||||||
NewProject=Nouveau projet
|
NewProject=Nouveau projet
|
||||||
|
|||||||
@@ -147,10 +147,10 @@ function task_prepare_head($object)
|
|||||||
*/
|
*/
|
||||||
function select_projects($socid, $selected='', $htmlname='projectid')
|
function select_projects($socid, $selected='', $htmlname='projectid')
|
||||||
{
|
{
|
||||||
global $db,$conf,$langs;
|
global $db,$user,$conf,$langs;
|
||||||
|
|
||||||
// On recherche les projets
|
// On recherche les projets
|
||||||
$sql = 'SELECT p.rowid, p.ref, p.title, p.fk_soc';
|
$sql = 'SELECT p.rowid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX .'projet as p';
|
$sql.= ' FROM '.MAIN_DB_PREFIX .'projet as p';
|
||||||
$sql.= " WHERE (p.fk_soc='".$socid."' OR p.fk_soc IS NULL)";
|
$sql.= " WHERE (p.fk_soc='".$socid."' OR p.fk_soc IS NULL)";
|
||||||
$sql.= " AND p.entity = ".$conf->entity;
|
$sql.= " AND p.entity = ".$conf->entity;
|
||||||
@@ -170,14 +170,21 @@ function select_projects($socid, $selected='', $htmlname='projectid')
|
|||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
$labeltoshow=dol_trunc($obj->ref,12).' - '.dol_trunc($obj->title,12);
|
$labeltoshow=dol_trunc($obj->ref,12).' - '.dol_trunc($obj->title,12);
|
||||||
if (empty($obj->fk_soc)) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
|
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
|
||||||
if (!empty($selected) && $selected == $obj->rowid)
|
//else $labeltoshow.=' ('.$langs->trans("Private").')';
|
||||||
|
if (!empty($selected) && $selected == $obj->rowid && $obj->fk_statut > 0)
|
||||||
{
|
{
|
||||||
print '<option value="'.$obj->rowid.'" selected="true">'.$labeltoshow.'</option>';
|
print '<option value="'.$obj->rowid.'" selected="true">'.$labeltoshow.'</option>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<option value="'.$obj->rowid.'">'.$labeltoshow.'</option>';
|
print '<option value="'.$obj->rowid.'"';
|
||||||
|
if (! $obj->fk_statut > 0)
|
||||||
|
{
|
||||||
|
print ' disabled="true"';
|
||||||
|
$labeltoshow.=' - '.$langs->trans("Draft");
|
||||||
|
}
|
||||||
|
print '>'.$labeltoshow.'</option>';
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@@ -499,7 +506,84 @@ function clean_orphelins($db)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return HTML table with list of projects and number of opened tasks
|
||||||
|
*
|
||||||
|
* @param unknown_type $db
|
||||||
|
* @param unknown_type $mine
|
||||||
|
* @param unknown_type $socid
|
||||||
|
* @param unknown_type $projectsListId
|
||||||
|
*/
|
||||||
|
function print_projecttasks_array($db,$mine,$socid,$projectsListId)
|
||||||
|
{
|
||||||
|
global $langs,$conf,$user;
|
||||||
|
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/projet/project.class.php");
|
||||||
|
|
||||||
|
$projectstatic=new Project($db);
|
||||||
|
|
||||||
|
$sortfield='';
|
||||||
|
$sortorder='';
|
||||||
|
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print_liste_field_titre($langs->trans("Project"),"index.php","","","","",$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("NbOpenTasks"),"","","","",'align="right"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("Status"),"","","","",'align="right"',$sortfield,$sortorder);
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$sql = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut, count(t.rowid) as nb";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t ON p.rowid = t.fk_projet";
|
||||||
|
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||||
|
if ($mine) $sql.= " AND p.rowid IN (".$projectsListId.")";
|
||||||
|
if ($socid) $sql.= " AND p.fk_soc = ".$socid;
|
||||||
|
$sql.= " GROUP BY p.ref";
|
||||||
|
|
||||||
|
$var=true;
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ( $resql )
|
||||||
|
{
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$objp = $db->fetch_object($resql);
|
||||||
|
|
||||||
|
$projectstatic->id = $objp->projectid;
|
||||||
|
$projectstatic->user_author_id = $objp->fk_user_creat;
|
||||||
|
$projectstatic->public = $objp->public;
|
||||||
|
|
||||||
|
$userAccess = $projectstatic->restrictedProjectArea($user,1);
|
||||||
|
|
||||||
|
if ($userAccess >= 0)
|
||||||
|
{
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr $bc[$var]>";
|
||||||
|
print '<td nowrap="nowrap">';
|
||||||
|
$projectstatic->ref=$objp->ref;
|
||||||
|
print $projectstatic->getNomUrl(1);
|
||||||
|
print ' - '.$objp->title.'</td>';
|
||||||
|
print '<td align="right">'.$objp->nb.'</td>';
|
||||||
|
$projectstatic->statut = $objp->fk_statut;
|
||||||
|
print '<td align="right">'.$projectstatic->getLibStatut(3).'</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->free($resql);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
print "</table>";
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@@ -19,16 +19,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/projet/activity/myactivity.php
|
* \file htdocs/projet/activity/index.php
|
||||||
* \ingroup projet
|
* \ingroup projet
|
||||||
* \brief Page activite perso du module projet
|
* \brief Page activite perso du module projet
|
||||||
* \version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php");
|
||||||
|
|
||||||
$mode=$_REQUEST["mode"];
|
$mine = $_REQUEST['mode']=='mine' ? 1 : 0;
|
||||||
|
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (!$user->rights->projet->lire) accessforbidden();
|
if (!$user->rights->projet->lire) accessforbidden();
|
||||||
@@ -48,7 +48,6 @@ $now = gmmktime();
|
|||||||
|
|
||||||
$projectstatic=new Project($db);
|
$projectstatic=new Project($db);
|
||||||
|
|
||||||
$mine = $_REQUEST['mode']=='mine' ? 1 : 0;
|
|
||||||
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,$mine,1);
|
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,$mine,1);
|
||||||
|
|
||||||
$title=$langs->trans("Activities");
|
$title=$langs->trans("Activities");
|
||||||
@@ -58,70 +57,22 @@ llxHeader("",$title);
|
|||||||
|
|
||||||
print_fiche_titre($title);
|
print_fiche_titre($title);
|
||||||
|
|
||||||
|
if ($mine) print $langs->trans("MyTasksDesc").'<br><br>';
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($user->rights->projet->all->lire && ! $socid) print $langs->trans("TasksDesc").'<br><br>';
|
||||||
|
else print $langs->trans("TasksPublicDesc").'<br><br>';
|
||||||
|
}
|
||||||
|
|
||||||
print '<table border="0" width="100%" class="notopnoleftnoright">';
|
print '<table border="0" width="100%" class="notopnoleftnoright">';
|
||||||
print '<tr><td width="30%" valign="top" class="notopnoleft">';
|
print '<tr><td width="30%" valign="top" class="notopnoleft">';
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print_liste_field_titre($langs->trans("Project"),"index.php","","","","",$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("NbOpenTasks"),"","","","",'align="right"',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("Status"),"","","","",'align="right"',$sortfield,$sortorder);
|
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
$sql = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut, count(t.rowid) as nb";
|
print_projecttasks_array($db,$mine,$socid,$projectsListId);
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."projet_task as t";
|
|
||||||
$sql.= " WHERE t.fk_projet = p.rowid";
|
|
||||||
$sql.= " AND p.entity = ".$conf->entity;
|
|
||||||
if ($mine) $sql.= " AND p.rowid IN (".$projectsListId.")";
|
|
||||||
if ($socid) $sql.= " AND p.fk_soc = ".$socid;
|
|
||||||
$sql.= " GROUP BY p.ref";
|
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ( $resql )
|
|
||||||
{
|
|
||||||
$var=true;
|
|
||||||
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
$i = 0;
|
|
||||||
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$objp = $db->fetch_object($resql);
|
|
||||||
|
|
||||||
$projectstatic->id = $objp->projectid;
|
|
||||||
$projectstatic->user_author_id = $objp->fk_user_creat;
|
|
||||||
$projectstatic->public = $objp->public;
|
|
||||||
|
|
||||||
$userAccess = $projectstatic->restrictedProjectArea($user,1);
|
|
||||||
|
|
||||||
if ($userAccess >= 0)
|
|
||||||
{
|
|
||||||
$var=!$var;
|
|
||||||
print "<tr $bc[$var]>";
|
|
||||||
print '<td nowrap="nowrap">';
|
|
||||||
$projectstatic->ref=$objp->ref;
|
|
||||||
print $projectstatic->getNomUrl(1);
|
|
||||||
print ' - '.$objp->title.'</td>';
|
|
||||||
print '<td align="right">'.$objp->nb.'</td>';
|
|
||||||
$projectstatic->statut = $objp->fk_statut;
|
|
||||||
print '<td align="right">'.$projectstatic->getLibStatut(3).'</td>';
|
|
||||||
print "</tr>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$db->free($resql);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
print "</table>";
|
|
||||||
|
|
||||||
/* Affichage de la liste des projets d'aujourd'hui */
|
/* Affichage de la liste des projets d'aujourd'hui */
|
||||||
print '<br /><table class="noborder" width="100%">';
|
print '<br><table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td width="50%">'.$langs->trans('Today').'</td>';
|
print '<td width="50%">'.$langs->trans('Today').'</td>';
|
||||||
print '<td width="50%" align="right">'.$langs->trans("Time").'</td>';
|
print '<td width="50%" align="right">'.$langs->trans("Time").'</td>';
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
// Visibility
|
// Visibility
|
||||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
||||||
if ($project->public) print $langs->trans('SharedProject');
|
if ($project->public) print $langs->trans('SharedProject');
|
||||||
else print $langs->trans('Private');
|
else print $langs->trans('PrivateProject');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Statut
|
// Statut
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ print '</td></tr>';
|
|||||||
// Visibility
|
// Visibility
|
||||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
||||||
if ($project->public) print $langs->trans('SharedProject');
|
if ($project->public) print $langs->trans('SharedProject');
|
||||||
else print $langs->trans('Private');
|
else print $langs->trans('PrivateProject');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Statut
|
// Statut
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
|
|||||||
|
|
||||||
// Public
|
// Public
|
||||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
||||||
$array=array(0 => $langs->trans("Private"),1 => $langs->trans("SharedProject"));
|
$array=array(0 => $langs->trans("PrivateProject"),1 => $langs->trans("SharedProject"));
|
||||||
$html->select_array('public',$array,$project->public);
|
$html->select_array('public',$array,$project->public);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@@ -370,7 +370,7 @@ else
|
|||||||
|
|
||||||
// Visibility
|
// Visibility
|
||||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
||||||
$array=array(0 => $langs->trans("Private"),1 => $langs->trans("SharedProject"));
|
$array=array(0 => $langs->trans("PrivateProject"),1 => $langs->trans("SharedProject"));
|
||||||
$html->select_array('public',$array,$project->public);
|
$html->select_array('public',$array,$project->public);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@@ -421,7 +421,7 @@ else
|
|||||||
// Visibility
|
// Visibility
|
||||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
||||||
if ($project->public) print $langs->trans('SharedProject');
|
if ($project->public) print $langs->trans('SharedProject');
|
||||||
else print $langs->trans('Private');
|
else print $langs->trans('PrivateProject');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Statut
|
// Statut
|
||||||
|
|||||||
@@ -26,6 +26,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php");
|
||||||
|
|
||||||
|
$mine = $_REQUEST['mode']=='mine' ? 1 : 0;
|
||||||
|
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
@@ -43,7 +47,6 @@ if (!$user->rights->projet->lire) accessforbidden();
|
|||||||
$socstatic=new Societe($db);
|
$socstatic=new Societe($db);
|
||||||
$projectstatic=new Project($db);
|
$projectstatic=new Project($db);
|
||||||
|
|
||||||
$mine = $_REQUEST['mode']=='mine' ? 1 : 0;
|
|
||||||
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,$mine,1);
|
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,$mine,1);
|
||||||
|
|
||||||
llxHeader("",$langs->trans("Projects"),"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos");
|
llxHeader("",$langs->trans("Projects"),"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos");
|
||||||
@@ -53,65 +56,17 @@ if ($mine) $text=$langs->trans("MyProjects");
|
|||||||
|
|
||||||
print_fiche_titre($text);
|
print_fiche_titre($text);
|
||||||
|
|
||||||
|
if ($mine) print $langs->trans("MyProjectsDesc").'<br><br>';
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($user->rights->projet->all->lire && ! $socid) print $langs->trans("ProjectsDesc").'<br><br>';
|
||||||
|
else print $langs->trans("ProjectsPublicDesc").'<br><br>';
|
||||||
|
}
|
||||||
|
|
||||||
print '<table border="0" width="100%" class="notopnoleftnoright">';
|
print '<table border="0" width="100%" class="notopnoleftnoright">';
|
||||||
print '<tr><td width="30%" valign="top" class="notopnoleft">';
|
print '<tr><td width="30%" valign="top" class="notopnoleft">';
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print_projecttasks_array($db,$mine,$socid,$projectsListId);
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print_liste_field_titre($langs->trans("Project"),"index.php","","","","",$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("NbOpenTasks"),"","","","",'align="right"',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("Status"),"","","","",'align="right"',$sortfield,$sortorder);
|
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
$sql = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut, count(t.rowid) as nb";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t ON p.rowid = t.fk_projet";
|
|
||||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
|
||||||
if ($mine) $sql.= " AND p.rowid IN (".$projectsListId.")";
|
|
||||||
if ($socid) $sql.= " AND p.fk_soc = ".$socid;
|
|
||||||
$sql.= " GROUP BY p.ref";
|
|
||||||
|
|
||||||
$var=true;
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ( $resql )
|
|
||||||
{
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
$i = 0;
|
|
||||||
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$objp = $db->fetch_object($resql);
|
|
||||||
|
|
||||||
$projectstatic->id = $objp->projectid;
|
|
||||||
$projectstatic->user_author_id = $objp->fk_user_creat;
|
|
||||||
$projectstatic->public = $objp->public;
|
|
||||||
|
|
||||||
$userAccess = $projectstatic->restrictedProjectArea($user,1);
|
|
||||||
|
|
||||||
if ($userAccess >= 0)
|
|
||||||
{
|
|
||||||
$var=!$var;
|
|
||||||
print "<tr $bc[$var]>";
|
|
||||||
print '<td nowrap="nowrap">';
|
|
||||||
$projectstatic->ref=$objp->ref;
|
|
||||||
print $projectstatic->getNomUrl(1);
|
|
||||||
print ' - '.$objp->title.'</td>';
|
|
||||||
print '<td align="right">'.$objp->nb.'</td>';
|
|
||||||
$projectstatic->statut = $objp->fk_statut;
|
|
||||||
print '<td align="right">'.$projectstatic->getLibStatut(3).'</td>';
|
|
||||||
print "</tr>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$db->free($resql);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
print "</table>";
|
|
||||||
|
|
||||||
print '</td><td width="70%" valign="top" class="notopnoleft">';
|
print '</td><td width="70%" valign="top" class="notopnoleft">';
|
||||||
|
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ if ($resql)
|
|||||||
// Visibility
|
// Visibility
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
if ($objp->public) print $langs->trans('SharedProject');
|
if ($objp->public) print $langs->trans('SharedProject');
|
||||||
else print $langs->trans('Private');
|
else print $langs->trans('PrivateProject');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
// Visibility
|
// Visibility
|
||||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
||||||
if ($project->public) print $langs->trans('SharedProject');
|
if ($project->public) print $langs->trans('SharedProject');
|
||||||
else print $langs->trans('Private');
|
else print $langs->trans('PrivateProject');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Statut
|
// Statut
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ else
|
|||||||
// Visibility
|
// Visibility
|
||||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
||||||
if ($project->public) print $langs->trans('SharedProject');
|
if ($project->public) print $langs->trans('SharedProject');
|
||||||
else print $langs->trans('Private');
|
else print $langs->trans('PrivateProject');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Statut
|
// Statut
|
||||||
|
|||||||