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: No limit on free text on PDF generated documents.
|
||||||
- New: Can force login value when creating a user from a member.
|
- New: Can force login value when creating a user from a member.
|
||||||
- New: Can clone a commercial proposal.
|
- 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
|
- Fix: Failed to go on the future view of bank transaction if there is no
|
||||||
future bank transaction already wrote.
|
future bank transaction already wrote.
|
||||||
- Fix: Bad ref in supplier list.
|
- Fix: Bad ref in supplier list.
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class FactureFournisseur extends Facture
|
|||||||
var $statut;
|
var $statut;
|
||||||
//! 1 si facture payee COMPLETEMENT, 0 sinon (ce champ ne devrait plus servir car insuffisant)
|
//! 1 si facture payee COMPLETEMENT, 0 sinon (ce champ ne devrait plus servir car insuffisant)
|
||||||
var $paye;
|
var $paye;
|
||||||
|
|
||||||
var $author;
|
var $author;
|
||||||
var $libelle;
|
var $libelle;
|
||||||
var $date;
|
var $date;
|
||||||
@@ -123,7 +123,7 @@ class FactureFournisseur extends Facture
|
|||||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn (facnumber, libelle, fk_soc, datec, datef, note, fk_user_author, date_lim_reglement) ';
|
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn (facnumber, libelle, fk_soc, datec, datef, note, fk_user_author, date_lim_reglement) ';
|
||||||
$sql .= " VALUES ('".addslashes($number)."','".addslashes($this->libelle)."',";
|
$sql .= " VALUES ('".addslashes($number)."','".addslashes($this->libelle)."',";
|
||||||
$sql .= $this->socid.", ".$this->db->idate(mktime()).",'".$this->db->idate($this->date)."','".addslashes($this->note)."', ".$user->id.",'".$this->db->idate($this->date_echeance)."');";
|
$sql .= $this->socid.", ".$this->db->idate(mktime()).",'".$this->db->idate($this->date)."','".addslashes($this->note)."', ".$user->id.",'".$this->db->idate($this->date_echeance)."');";
|
||||||
|
|
||||||
dolibarr_syslog("FactureFournisseur::create sql=".$sql, LOG_DEBUG);
|
dolibarr_syslog("FactureFournisseur::create sql=".$sql, LOG_DEBUG);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
@@ -133,13 +133,13 @@ class FactureFournisseur extends Facture
|
|||||||
{
|
{
|
||||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn)';
|
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn)';
|
||||||
$sql .= ' VALUES ('.$this->id.');';
|
$sql .= ' VALUES ('.$this->id.');';
|
||||||
|
|
||||||
dolibarr_syslog("FactureFournisseur::create sql=".$sql, LOG_DEBUG);
|
dolibarr_syslog("FactureFournisseur::create sql=".$sql, LOG_DEBUG);
|
||||||
$resql_insert=$this->db->query($sql);
|
$resql_insert=$this->db->query($sql);
|
||||||
if ($resql_insert)
|
if ($resql_insert)
|
||||||
{
|
{
|
||||||
$idligne = $this->db->last_insert_id(MAIN_DB_PREFIX.'facture_fourn_det');
|
$idligne = $this->db->last_insert_id(MAIN_DB_PREFIX.'facture_fourn_det');
|
||||||
|
|
||||||
$this->updateline($idligne,
|
$this->updateline($idligne,
|
||||||
$this->lignes[$i]->description,
|
$this->lignes[$i]->description,
|
||||||
$this->lignes[$i]->pu_ht,
|
$this->lignes[$i]->pu_ht,
|
||||||
@@ -241,7 +241,7 @@ class FactureFournisseur extends Facture
|
|||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error();
|
$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 -3;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
@@ -263,7 +263,7 @@ class FactureFournisseur extends Facture
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Load this->lignes
|
* \brief Load this->lignes
|
||||||
* \return int 1 si ok, < 0 si erreur
|
* \return int 1 si ok, < 0 si erreur
|
||||||
@@ -319,8 +319,8 @@ class FactureFournisseur extends Facture
|
|||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Recup<75>re l'objet fournisseur li<6C> <20> la facture
|
* \brief Recup<75>re l'objet fournisseur li<6C> <20> la facture
|
||||||
*
|
*
|
||||||
@@ -339,7 +339,7 @@ class FactureFournisseur extends Facture
|
|||||||
function delete($rowid)
|
function delete($rowid)
|
||||||
{
|
{
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn_det WHERE fk_facture_fourn = '.$rowid.';';
|
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn_det WHERE fk_facture_fourn = '.$rowid.';';
|
||||||
dolibarr_syslog("FactureFournisseur sql=".$sql);
|
dolibarr_syslog("FactureFournisseur sql=".$sql);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
@@ -398,7 +398,7 @@ class FactureFournisseur extends Facture
|
|||||||
function set_valid($user)
|
function set_valid($user)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn";
|
||||||
@@ -410,7 +410,7 @@ class FactureFournisseur extends Facture
|
|||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
// Si activé on décrémente le produit principal et ses composants à la validation de facture
|
// Si activé on décrémente le produit principal et ses composants à la validation de facture
|
||||||
if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)
|
if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)
|
||||||
{
|
{
|
||||||
@@ -428,7 +428,7 @@ class FactureFournisseur extends Facture
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error == 0)
|
if ($error == 0)
|
||||||
{
|
{
|
||||||
// Appel des triggers
|
// Appel des triggers
|
||||||
@@ -438,7 +438,7 @@ class FactureFournisseur extends Facture
|
|||||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||||
// Fin appel triggers
|
// Fin appel triggers
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error == 0)
|
if ($error == 0)
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
@@ -487,7 +487,7 @@ class FactureFournisseur extends Facture
|
|||||||
// Nettoyage param<61>tres
|
// Nettoyage param<61>tres
|
||||||
if ($txtva == '') $txtva=0;
|
if ($txtva == '') $txtva=0;
|
||||||
$txtva=price2num($txtva);
|
$txtva=price2num($txtva);
|
||||||
|
|
||||||
|
|
||||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn)';
|
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn)';
|
||||||
$sql .= ' VALUES ('.$this->id.');';
|
$sql .= ' VALUES ('.$this->id.');';
|
||||||
@@ -560,7 +560,7 @@ class FactureFournisseur extends Facture
|
|||||||
$result=$product->fetch($idproduct);
|
$result=$product->fetch($idproduct);
|
||||||
$product_type=$product->type;
|
$product_type=$product->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture_fourn_det ';
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture_fourn_det ';
|
||||||
$sql.= 'SET ';
|
$sql.= 'SET ';
|
||||||
$sql.= 'description =\''.addslashes($label).'\'';
|
$sql.= 'description =\''.addslashes($label).'\'';
|
||||||
@@ -651,7 +651,7 @@ class FactureFournisseur extends Facture
|
|||||||
dolibarr_print_error($this->db);
|
dolibarr_print_error($this->db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Charge indicateurs this->nbtodo et this->nbtodolate de tableau de bord
|
* \brief Charge indicateurs this->nbtodo et this->nbtodolate de tableau de bord
|
||||||
@@ -663,7 +663,7 @@ class FactureFournisseur extends Facture
|
|||||||
global $conf, $user;
|
global $conf, $user;
|
||||||
|
|
||||||
$now=gmmktime();
|
$now=gmmktime();
|
||||||
|
|
||||||
$this->nbtodo=$this->nbtodolate=0;
|
$this->nbtodo=$this->nbtodolate=0;
|
||||||
$sql = 'SELECT ff.rowid, ff.date_lim_reglement as datefin';
|
$sql = 'SELECT ff.rowid, ff.date_lim_reglement as datefin';
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||||
@@ -701,9 +701,9 @@ class FactureFournisseur extends Facture
|
|||||||
function getNomUrl($withpicto=0,$option='')
|
function getNomUrl($withpicto=0,$option='')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$result='';
|
$result='';
|
||||||
|
|
||||||
$lien = '<a href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$this->id.'">';
|
$lien = '<a href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$this->id.'">';
|
||||||
$lienfin='</a>';
|
$lienfin='</a>';
|
||||||
|
|
||||||
@@ -712,7 +712,7 @@ class FactureFournisseur extends Facture
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Initialise la facture avec valeurs fictives al<61>atoire
|
* \brief Initialise la facture avec valeurs fictives al<61>atoire
|
||||||
* Sert <20> g<>n<EFBFBD>rer une facture pour l'aperu des mod<6F>les ou demo
|
* Sert <20> g<>n<EFBFBD>rer une facture pour l'aperu des mod<6F>les ou demo
|
||||||
@@ -786,7 +786,7 @@ class FactureFournisseur extends Facture
|
|||||||
$this->total_tva = $xnbp*19.6;
|
$this->total_tva = $xnbp*19.6;
|
||||||
$this->total_ttc = $xnbp*119.6;
|
$this->total_ttc = $xnbp*119.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Load an object from its id and create a new one in database
|
* \brief Load an object from its id and create a new one in database
|
||||||
* \param fromid Id of object to clone
|
* \param fromid Id of object to clone
|
||||||
@@ -807,7 +807,7 @@ class FactureFournisseur extends Facture
|
|||||||
$object->fetch($fromid);
|
$object->fetch($fromid);
|
||||||
$object->id=0;
|
$object->id=0;
|
||||||
$object->statut=0;
|
$object->statut=0;
|
||||||
|
|
||||||
// Clear fields
|
// Clear fields
|
||||||
$object->ref_supplier=$langs->trans("CopyOf").' '.$object->ref_supplier;
|
$object->ref_supplier=$langs->trans("CopyOf").' '.$object->ref_supplier;
|
||||||
$object->author = $user->id;
|
$object->author = $user->id;
|
||||||
@@ -819,7 +819,7 @@ class FactureFournisseur extends Facture
|
|||||||
$object->ref_client = '';
|
$object->ref_client = '';
|
||||||
$object->close_code = '';
|
$object->close_code = '';
|
||||||
$object->close_note = '';
|
$object->close_note = '';
|
||||||
|
|
||||||
// Create clone
|
// Create clone
|
||||||
$result=$object->create($user);
|
$result=$object->create($user);
|
||||||
|
|
||||||
@@ -832,9 +832,9 @@ class FactureFournisseur extends Facture
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// End
|
// End
|
||||||
@@ -849,6 +849,6 @@ class FactureFournisseur extends Facture
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (c) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* 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 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* 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/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_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(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/tasks/fiche.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
|
$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/tasks/index.php?mode=mine", $langs->trans("MyTasks"), 1, $user->rights->projet->lire);
|
$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/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/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_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(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/tasks/fiche.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
|
$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/tasks/index.php?mode=mine", $langs->trans("MyTasks"), 1, $user->rights->projet->lire);
|
$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/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', 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);
|
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', 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', 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, 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', 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', 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', 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', 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', 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', 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', 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);
|
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);
|
||||||
|
|||||||
@@ -81,9 +81,9 @@ if ($_POST["action"] == "set")
|
|||||||
{
|
{
|
||||||
if (! eregi('^db_pass',$cle)) dolibarr_install_syslog("Choice for ".$cle." = ".$valeur);
|
if (! eregi('^db_pass',$cle)) dolibarr_install_syslog("Choice for ".$cle." = ".$valeur);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show title of step
|
// Show title of step
|
||||||
print '<h3>'.$langs->trans("ConfigurationFile").'</h3>';
|
print '<h3>'.$langs->trans("ConfigurationFile").'</h3>';
|
||||||
print '<table cellspacing="0" width="100%" cellpadding="1" border="0">';
|
print '<table cellspacing="0" width="100%" cellpadding="1" border="0">';
|
||||||
|
|
||||||
// Check parameter main_dir
|
// Check parameter main_dir
|
||||||
@@ -92,7 +92,7 @@ if ($_POST["action"] == "set")
|
|||||||
if (! is_dir($main_dir))
|
if (! is_dir($main_dir))
|
||||||
{
|
{
|
||||||
dolibarr_install_syslog("etape1: Repertoire '".$main_dir."' inexistant ou non accessible");
|
dolibarr_install_syslog("etape1: Repertoire '".$main_dir."' inexistant ou non accessible");
|
||||||
|
|
||||||
print "<tr><td>";
|
print "<tr><td>";
|
||||||
print $langs->trans("ErrorDirDoesNotExists",$main_dir).'<br>';
|
print $langs->trans("ErrorDirDoesNotExists",$main_dir).'<br>';
|
||||||
print $langs->trans("ErrorWrongValueForParameter",$langs->trans("WebPagesDirectory")).'<br>';
|
print $langs->trans("ErrorWrongValueForParameter",$langs->trans("WebPagesDirectory")).'<br>';
|
||||||
@@ -108,7 +108,7 @@ if ($_POST["action"] == "set")
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
dolibarr_install_syslog("etape1: Directory '".$main_dir."' exists");
|
dolibarr_install_syslog("etape1: Directory '".$main_dir."' exists");
|
||||||
|
|
||||||
require_once($main_dir."/lib/databases/".$_POST["db_type"].".lib.php");
|
require_once($main_dir."/lib/databases/".$_POST["db_type"].".lib.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ if ($_POST["action"] == "set")
|
|||||||
{
|
{
|
||||||
create_exdir($main_data_dir);
|
create_exdir($main_data_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! is_dir($main_data_dir))
|
if (! is_dir($main_data_dir))
|
||||||
{
|
{
|
||||||
print "<tr><td>".$langs->trans("ErrorDirDoesNotExists",$main_data_dir);
|
print "<tr><td>".$langs->trans("ErrorDirDoesNotExists",$main_data_dir);
|
||||||
@@ -148,7 +148,7 @@ if ($_POST["action"] == "set")
|
|||||||
$dir[6] = "$main_data_dir/rapport";
|
$dir[6] = "$main_data_dir/rapport";
|
||||||
$dir[7] = "$main_data_dir/rss";
|
$dir[7] = "$main_data_dir/rss";
|
||||||
$dir[8] = "$main_data_dir/logo";
|
$dir[8] = "$main_data_dir/logo";
|
||||||
|
|
||||||
// Boucle sur chaque r<>pertoire de dir[] pour les cr<63>er s'ils nexistent pas
|
// Boucle sur chaque r<>pertoire de dir[] pour les cr<63>er s'ils nexistent pas
|
||||||
for ($i = 0 ; $i < sizeof($dir) ; $i++)
|
for ($i = 0 ; $i < sizeof($dir) ; $i++)
|
||||||
{
|
{
|
||||||
@@ -190,14 +190,14 @@ if ($_POST["action"] == "set")
|
|||||||
{
|
{
|
||||||
$error+=write_conf_file($conffile);
|
$error+=write_conf_file($conffile);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create database and admin user database
|
* Create database and admin user database
|
||||||
*/
|
*/
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
conf($dolibarr_main_document_root);
|
conf($dolibarr_main_document_root);
|
||||||
|
|
||||||
$userroot=isset($_POST["db_user_root"])?$_POST["db_user_root"]:"";
|
$userroot=isset($_POST["db_user_root"])?$_POST["db_user_root"]:"";
|
||||||
$passroot=isset($_POST["db_pass_root"])?$_POST["db_pass_root"]:"";
|
$passroot=isset($_POST["db_pass_root"])?$_POST["db_pass_root"]:"";
|
||||||
|
|
||||||
@@ -223,16 +223,16 @@ if ($_POST["action"] == "set")
|
|||||||
{
|
{
|
||||||
$databasefortest='mssql';
|
$databasefortest='mssql';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Creation handler de base, verification du support et connexion
|
// Creation handler de base, verification du support et connexion
|
||||||
|
|
||||||
$db = new DoliDb($conf->db->type,$conf->db->host,$userroot,$passroot,$databasefortest,$conf->db->port);
|
$db = new DoliDb($conf->db->type,$conf->db->host,$userroot,$passroot,$databasefortest,$conf->db->port);
|
||||||
if ($db->error)
|
if ($db->error)
|
||||||
{
|
{
|
||||||
print '<div class="error">'.$db->error.'</div>';
|
print '<div class="error">'.$db->error.'</div>';
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
if ($db->connected)
|
if ($db->connected)
|
||||||
@@ -241,7 +241,7 @@ if ($_POST["action"] == "set")
|
|||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print $langs->trans("UserCreation").' : ';
|
print $langs->trans("UserCreation").' : ';
|
||||||
print $dolibarr_main_db_user;
|
print $dolibarr_main_db_user;
|
||||||
@@ -269,7 +269,7 @@ if ($_POST["action"] == "set")
|
|||||||
print '<td>'.$langs->trans("Error").' '.$db->error()."</td></tr>";
|
print '<td>'.$langs->trans("Error").' '.$db->error()."</td></tr>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -280,7 +280,7 @@ if ($_POST["action"] == "set")
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>'.$langs->trans("Error").'</td>';
|
print '<td>'.$langs->trans("Error").'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Affiche aide diagnostique
|
// Affiche aide diagnostique
|
||||||
print '<tr><td colspan="2"><br>';
|
print '<tr><td colspan="2"><br>';
|
||||||
print $langs->trans("YouAskDatabaseCreationSoDolibarrNeedToConnect",$dolibarr_main_db_user,$dolibarr_main_db_host,$userroot);
|
print $langs->trans("YouAskDatabaseCreationSoDolibarrNeedToConnect",$dolibarr_main_db_user,$dolibarr_main_db_host,$userroot);
|
||||||
@@ -288,13 +288,13 @@ if ($_POST["action"] == "set")
|
|||||||
print $langs->trans("BecauseConnectionFailedParametersMayBeWrong").'<br><br>';
|
print $langs->trans("BecauseConnectionFailedParametersMayBeWrong").'<br><br>';
|
||||||
print $langs->trans("ErrorGoBackAndCorrectParameters").'<br><br>';
|
print $langs->trans("ErrorGoBackAndCorrectParameters").'<br><br>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // Fin si "creation utilisateur"
|
} // Fin si "creation utilisateur"
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If database creation is asked, we create it
|
* If database creation is asked, we create it
|
||||||
*/
|
*/
|
||||||
@@ -312,7 +312,7 @@ if ($_POST["action"] == "set")
|
|||||||
print $dolibarr_main_db_name;
|
print $dolibarr_main_db_name;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "<td>".$langs->trans("OK")."</td></tr>";
|
print "<td>".$langs->trans("OK")."</td></tr>";
|
||||||
|
|
||||||
$check1=$db->getDefaultCharacterSetDatabase();
|
$check1=$db->getDefaultCharacterSetDatabase();
|
||||||
$check2=$db->getDefaultCollationDatabase();
|
$check2=$db->getDefaultCollationDatabase();
|
||||||
dolibarr_install_syslog('etape1: Note that default server was charset='.$check1.' collation='.$check2, LOG_DEBUG);
|
dolibarr_install_syslog('etape1: Note that default server was charset='.$check1.' collation='.$check2, LOG_DEBUG);
|
||||||
@@ -406,7 +406,7 @@ if ($_POST["action"] == "set")
|
|||||||
print $langs->trans("OK");
|
print $langs->trans("OK");
|
||||||
print "</td></tr>";
|
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 "<tr><td>";
|
||||||
print $langs->trans("DatabaseConnection")." : ";
|
print $langs->trans("DatabaseConnection")." : ";
|
||||||
print $dolibarr_main_db_name;
|
print $dolibarr_main_db_name;
|
||||||
@@ -464,7 +464,7 @@ function write_conf_file($conffile)
|
|||||||
global $dolibarr_smarty_libs_dir,$dolibarr_smarty_compile,$dolibarr_smarty_cache;
|
global $dolibarr_smarty_libs_dir,$dolibarr_smarty_compile,$dolibarr_smarty_cache;
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
$fp = fopen("$conffile", "w");
|
$fp = fopen("$conffile", "w");
|
||||||
if($fp)
|
if($fp)
|
||||||
{
|
{
|
||||||
@@ -482,34 +482,34 @@ function write_conf_file($conffile)
|
|||||||
|
|
||||||
fputs($fp, '$dolibarr_main_url_root="'.$_POST["main_url"].'";');
|
fputs($fp, '$dolibarr_main_url_root="'.$_POST["main_url"].'";');
|
||||||
fputs($fp,"\n");
|
fputs($fp,"\n");
|
||||||
|
|
||||||
fputs($fp, '$dolibarr_main_document_root="'.$main_dir.'";');
|
fputs($fp, '$dolibarr_main_document_root="'.$main_dir.'";');
|
||||||
fputs($fp,"\n");
|
fputs($fp,"\n");
|
||||||
|
|
||||||
fputs($fp, '$dolibarr_main_data_root="'.$main_data_dir.'";');
|
fputs($fp, '$dolibarr_main_data_root="'.$main_data_dir.'";');
|
||||||
fputs($fp,"\n");
|
fputs($fp,"\n");
|
||||||
|
|
||||||
fputs($fp, '$dolibarr_main_db_host="'.$_POST["db_host"].'";');
|
fputs($fp, '$dolibarr_main_db_host="'.$_POST["db_host"].'";');
|
||||||
fputs($fp,"\n");
|
fputs($fp,"\n");
|
||||||
|
|
||||||
fputs($fp, '$dolibarr_main_db_port="'.$_POST["db_port"].'";');
|
fputs($fp, '$dolibarr_main_db_port="'.$_POST["db_port"].'";');
|
||||||
fputs($fp,"\n");
|
fputs($fp,"\n");
|
||||||
|
|
||||||
fputs($fp, '$dolibarr_main_db_name="'.$_POST["db_name"].'";');
|
fputs($fp, '$dolibarr_main_db_name="'.$_POST["db_name"].'";');
|
||||||
fputs($fp,"\n");
|
fputs($fp,"\n");
|
||||||
|
|
||||||
fputs($fp, '$dolibarr_main_db_user="'.$_POST["db_user"].'";');
|
fputs($fp, '$dolibarr_main_db_user="'.$_POST["db_user"].'";');
|
||||||
fputs($fp,"\n");
|
fputs($fp,"\n");
|
||||||
|
|
||||||
fputs($fp, '$dolibarr_main_db_pass="'.$_POST["db_pass"].'";');
|
fputs($fp, '$dolibarr_main_db_pass="'.$_POST["db_pass"].'";');
|
||||||
fputs($fp,"\n");
|
fputs($fp,"\n");
|
||||||
|
|
||||||
fputs($fp, '$dolibarr_main_db_type="'.$_POST["db_type"].'";');
|
fputs($fp, '$dolibarr_main_db_type="'.$_POST["db_type"].'";');
|
||||||
fputs($fp,"\n");
|
fputs($fp,"\n");
|
||||||
|
|
||||||
fputs($fp, '$dolibarr_main_db_character_set="'.$_POST["dolibarr_main_db_character_set"].'";');
|
fputs($fp, '$dolibarr_main_db_character_set="'.$_POST["dolibarr_main_db_character_set"].'";');
|
||||||
fputs($fp,"\n");
|
fputs($fp,"\n");
|
||||||
|
|
||||||
fputs($fp, '$dolibarr_main_db_collation="'.$_POST["dolibarr_main_db_collation"].'";');
|
fputs($fp, '$dolibarr_main_db_collation="'.$_POST["dolibarr_main_db_collation"].'";');
|
||||||
fputs($fp,"\n");
|
fputs($fp,"\n");
|
||||||
|
|
||||||
@@ -527,17 +527,17 @@ function write_conf_file($conffile)
|
|||||||
/* Preparation integration SMARTY */
|
/* Preparation integration SMARTY */
|
||||||
fputs($fp, '$dolibarr_smarty_libs_dir="";');
|
fputs($fp, '$dolibarr_smarty_libs_dir="";');
|
||||||
fputs($fp,"\n");
|
fputs($fp,"\n");
|
||||||
|
|
||||||
fputs($fp, '$dolibarr_smarty_compile="";');
|
fputs($fp, '$dolibarr_smarty_compile="";');
|
||||||
fputs($fp,"\n");
|
fputs($fp,"\n");
|
||||||
|
|
||||||
fputs($fp, '$dolibarr_smarty_cache="";');
|
fputs($fp, '$dolibarr_smarty_cache="";');
|
||||||
fputs($fp,"\n");
|
fputs($fp,"\n");
|
||||||
/* Fin Smarty*/
|
/* Fin Smarty*/
|
||||||
|
|
||||||
fputs($fp, '?>');
|
fputs($fp, '?>');
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|
||||||
if (file_exists("$conffile"))
|
if (file_exists("$conffile"))
|
||||||
{
|
{
|
||||||
include("$conffile"); // On force rechargement. Ne pas mettre include_once !
|
include("$conffile"); // On force rechargement. Ne pas mettre include_once !
|
||||||
@@ -554,7 +554,7 @@ function write_conf_file($conffile)
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $error;
|
return $error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -327,8 +327,8 @@ Permission32=Create/modify products/services
|
|||||||
Permission33=Command products/services
|
Permission33=Command products/services
|
||||||
Permission34=Delete products/services
|
Permission34=Delete products/services
|
||||||
Permission36=Export products/services
|
Permission36=Export products/services
|
||||||
Permission41=Read projects
|
Permission41=Read projects and tasks
|
||||||
Permission42=Create/modify projects
|
Permission42=Create/modify projects, edit tasks for my projects
|
||||||
Permission44=Delete projects
|
Permission44=Delete projects
|
||||||
Permission61=Read interventions
|
Permission61=Read interventions
|
||||||
Permission62=Create/modify interventions
|
Permission62=Create/modify interventions
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# Dolibarr language file - en_US - projects
|
# Dolibarr language file - en_US - projects
|
||||||
Project=Project
|
Project=Project
|
||||||
Projects=Projects
|
Projects=Projects
|
||||||
|
SharedProject=Shared project
|
||||||
Myprojects=My projects
|
Myprojects=My projects
|
||||||
ProjectsArea=Projects area
|
ProjectsArea=Projects area
|
||||||
NewProject=New project
|
NewProject=New project
|
||||||
@@ -30,8 +31,11 @@ NewTask=New task
|
|||||||
AddTask=Add task
|
AddTask=Add task
|
||||||
AddDuration=Add duration
|
AddDuration=Add duration
|
||||||
Activity=Activity
|
Activity=Activity
|
||||||
|
Activities=Tasks/activities
|
||||||
MyActivity=My activity
|
MyActivity=My activity
|
||||||
|
MyActivities=My tasks/activities
|
||||||
DurationEffective=Effective duration
|
DurationEffective=Effective duration
|
||||||
|
MyProjects=My projects
|
||||||
Time=Time
|
Time=Time
|
||||||
ListProposalsAssociatedProject=Lists of the commercial proposals associated with the project
|
ListProposalsAssociatedProject=Lists of the commercial proposals associated with the project
|
||||||
ListOrdersAssociatedProject=Lists of the orders 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
|
ActivityOnProjectThisWeek=Activity on project this week
|
||||||
ActivityOnProjectThisMonth=Activity on project this month
|
ActivityOnProjectThisMonth=Activity on project this month
|
||||||
ActivityOnProjectThisYear=Activity on project this year
|
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
|
Permission33=Commander les produits/services
|
||||||
Permission34=Supprimer les produits/services
|
Permission34=Supprimer les produits/services
|
||||||
Permission36=Exporter les produits/services
|
Permission36=Exporter les produits/services
|
||||||
Permission41=Consulter les projets
|
Permission41=Consulter les projets et t<>ches
|
||||||
Permission42=Cr<43>er/modifier les projets
|
Permission42=Cr<43>er/modifier les projets, <20>diter t<>ches de mes projets
|
||||||
Permission44=Supprimer les projets
|
Permission44=Supprimer les projets
|
||||||
Permission61=Consulter les interventions
|
Permission61=Consulter les interventions
|
||||||
Permission62=Cr<43>er/modifier les interventions
|
Permission62=Cr<43>er/modifier les interventions
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# Dolibarr language file - fr_FR - projects
|
# Dolibarr language file - fr_FR - projects
|
||||||
Project=Projet
|
Project=Projet
|
||||||
Projects=Projets
|
Projects=Projets
|
||||||
|
SharedProject=Projet partag<61>
|
||||||
Myprojects=Mes projets
|
Myprojects=Mes projets
|
||||||
ProjectsArea=Espace projet
|
ProjectsArea=Espace projet
|
||||||
NewProject=Nouveau projet
|
NewProject=Nouveau projet
|
||||||
@@ -30,7 +31,10 @@ NewTask=Nouvelle t
|
|||||||
AddTask=Cr<43>er t<>che
|
AddTask=Cr<43>er t<>che
|
||||||
AddDuration=Ajouter la dur<75>e
|
AddDuration=Ajouter la dur<75>e
|
||||||
Activity=Activit<69>
|
Activity=Activit<69>
|
||||||
|
Activities=T<>ches/activit<69>s
|
||||||
MyActivity=Mon activit<69>
|
MyActivity=Mon activit<69>
|
||||||
|
MyActivities=Mes t<>ches/activit<69>s
|
||||||
|
MyProjects=Mes projets
|
||||||
DurationEffective=Dur<75>e effective
|
DurationEffective=Dur<75>e effective
|
||||||
Time=Temps
|
Time=Temps
|
||||||
ListProposalsAssociatedProject=Liste des propositions commerciales associ<63>es au projet
|
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
|
ActivityOnProjectThisWeek=Activit<69> sur les projets cette semaine
|
||||||
ActivityOnProjectThisMonth=Activit<69> sur les projets ce mois
|
ActivityOnProjectThisMonth=Activit<69> sur les projets ce mois
|
||||||
ActivityOnProjectThisYear=Activit<69> sur les projets cette ann<6E>e
|
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>
|
||||||
@@ -125,7 +125,7 @@ function dol_string_unaccent($str)
|
|||||||
OOOOOUUUY
|
OOOOOUUUY
|
||||||
aaaaaceeee
|
aaaaaceeee
|
||||||
iiiidnooooo
|
iiiidnooooo
|
||||||
uuuyy");
|
uuuyy");
|
||||||
$string = strtr($string, array("\xC4"=>"Ae", "\xC6"=>"AE", "\xD6"=>"Oe", "\xDC"=>"Ue", "\xDE"=>"TH", "\xDF"=>"ss", "\xE4"=>"ae", "\xE6"=>"ae", "\xF6"=>"oe", "\xFC"=>"ue", "\xFE"=>"th"));
|
$string = strtr($string, array("\xC4"=>"Ae", "\xC6"=>"AE", "\xD6"=>"Oe", "\xDC"=>"Ue", "\xDE"=>"TH", "\xDF"=>"ss", "\xE4"=>"ae", "\xE6"=>"ae", "\xF6"=>"oe", "\xFC"=>"ue", "\xFE"=>"th"));
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
@@ -185,7 +185,7 @@ function dol_syslog($message, $level=LOG_INFO)
|
|||||||
// If adding log inside HTML page is required
|
// If adding log inside HTML page is required
|
||||||
if (! empty($_REQUEST['logtohtml']) && ! empty($conf->global->MAIN_LOGTOHTML))
|
if (! empty($_REQUEST['logtohtml']) && ! empty($conf->global->MAIN_LOGTOHTML))
|
||||||
{
|
{
|
||||||
$conf->logbuffer[]=strftime("%Y-%m-%d %H:%M:%S",time())." ".$message;
|
$conf->logbuffer[]=strftime("%Y-%m-%d %H:%M:%S",time())." ".$message;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If syslog module enabled
|
// If syslog module enabled
|
||||||
@@ -395,7 +395,7 @@ function dol_print_date($time,$format='',$to_gmt=false,$outputlangs='')
|
|||||||
|
|
||||||
// If date undefined or "", we return ""
|
// If date undefined or "", we return ""
|
||||||
if (strlen($time) == 0) return ''; // $time=0 allowed (it means 01/01/1970 00:00:00)
|
if (strlen($time) == 0) return ''; // $time=0 allowed (it means 01/01/1970 00:00:00)
|
||||||
|
|
||||||
// Analyse de la date (deprecated)
|
// Analyse de la date (deprecated)
|
||||||
if (eregi('^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?',$time,$reg))
|
if (eregi('^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?',$time,$reg))
|
||||||
{
|
{
|
||||||
@@ -672,7 +672,7 @@ function dol_print_size($size)
|
|||||||
function dol_print_url($url,$target='_blank',$max=32)
|
function dol_print_url($url,$target='_blank',$max=32)
|
||||||
{
|
{
|
||||||
if (empty($url)) return '';
|
if (empty($url)) return '';
|
||||||
|
|
||||||
$link='<a href="';
|
$link='<a href="';
|
||||||
if (! eregi('^http',$url)) $link.='http://';
|
if (! eregi('^http',$url)) $link.='http://';
|
||||||
$link.=$url;
|
$link.=$url;
|
||||||
@@ -695,13 +695,13 @@ function dol_print_url($url,$target='_blank',$max=32)
|
|||||||
function dol_print_email($email,$cid=0,$socid=0,$addlink=0,$max=64)
|
function dol_print_email($email,$cid=0,$socid=0,$addlink=0,$max=64)
|
||||||
{
|
{
|
||||||
global $conf,$user,$langs;
|
global $conf,$user,$langs;
|
||||||
|
|
||||||
$newemail=$email;
|
$newemail=$email;
|
||||||
|
|
||||||
if (empty($email)) return ' ';
|
if (empty($email)) return ' ';
|
||||||
|
|
||||||
if (! ValidEmail($email)) return "Bad email";
|
if (! ValidEmail($email)) return "Bad email";
|
||||||
|
|
||||||
if (! empty($addlink))
|
if (! empty($addlink))
|
||||||
{
|
{
|
||||||
$newemail='<a href="';
|
$newemail='<a href="';
|
||||||
@@ -710,7 +710,7 @@ function dol_print_email($email,$cid=0,$socid=0,$addlink=0,$max=64)
|
|||||||
$newemail.='">';
|
$newemail.='">';
|
||||||
$newemail.=dol_trunc($email,$max);
|
$newemail.=dol_trunc($email,$max);
|
||||||
$newemail.='</a>';
|
$newemail.='</a>';
|
||||||
|
|
||||||
if (($cid || $socid) && $conf->agenda->enabled && $user->rights->agenda->myactions->create)
|
if (($cid || $socid) && $conf->agenda->enabled && $user->rights->agenda->myactions->create)
|
||||||
{
|
{
|
||||||
$type='AC_EMAIL';
|
$type='AC_EMAIL';
|
||||||
@@ -718,7 +718,7 @@ function dol_print_email($email,$cid=0,$socid=0,$addlink=0,$max=64)
|
|||||||
$newemail='<table class="nobordernopadding"><tr><td>'.$newemail.' </td><td> '.$link.'</td></tr></table>';
|
$newemail='<table class="nobordernopadding"><tr><td>'.$newemail.' </td><td> '.$link.'</td></tr></table>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $newemail;
|
return $newemail;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -741,7 +741,7 @@ function dolibarr_print_phone($phone,$country="FR",$cid=0,$socid=0,$addlink=0,$s
|
|||||||
function dol_print_phone($phone,$country="FR",$cid=0,$socid=0,$addlink=0,$separ=" ")
|
function dol_print_phone($phone,$country="FR",$cid=0,$socid=0,$addlink=0,$separ=" ")
|
||||||
{
|
{
|
||||||
global $conf,$user,$langs;
|
global $conf,$user,$langs;
|
||||||
|
|
||||||
// Clean phone parameter
|
// Clean phone parameter
|
||||||
$phone = ereg_replace("[ .-]","",trim($phone));
|
$phone = ereg_replace("[ .-]","",trim($phone));
|
||||||
if (empty($phone)) { return ''; }
|
if (empty($phone)) { return ''; }
|
||||||
@@ -770,14 +770,14 @@ function dol_print_phone($phone,$country="FR",$cid=0,$socid=0,$addlink=0,$separ=
|
|||||||
$newphone=substr($newphone,0,4).$separ.substr($newphone,4,2).$separ.substr($newphone,6,2).$separ.substr($newphone,8,2).$separ.substr($newphone,10,2);
|
$newphone=substr($newphone,0,4).$separ.substr($newphone,4,2).$separ.substr($newphone,6,2).$separ.substr($newphone,8,2).$separ.substr($newphone,10,2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($addlink))
|
if (! empty($addlink))
|
||||||
{
|
{
|
||||||
if ($conf->clicktodial->enabled)
|
if ($conf->clicktodial->enabled)
|
||||||
{
|
{
|
||||||
if (empty($user->clicktodial_loaded)) $user->fetch_clicktodial();
|
if (empty($user->clicktodial_loaded)) $user->fetch_clicktodial();
|
||||||
|
|
||||||
if (empty($conf->global->CLICKTODIAL_URL)) $urlmask='ErrorClickToDialModuleNotConfigured';
|
if (empty($conf->global->CLICKTODIAL_URL)) $urlmask='ErrorClickToDialModuleNotConfigured';
|
||||||
else $urlmask=$conf->global->CLICKTODIAL_URL;
|
else $urlmask=$conf->global->CLICKTODIAL_URL;
|
||||||
$url = sprintf($urlmask, urlencode($phone), urlencode($user->clicktodial_poste), urlencode($user->clicktodial_login), urlencode($user->clicktodial_password));
|
$url = sprintf($urlmask, urlencode($phone), urlencode($user->clicktodial_poste), urlencode($user->clicktodial_login), urlencode($user->clicktodial_password));
|
||||||
$newphone='<a href="'.$url.'">'.$newphone.'</a>';
|
$newphone='<a href="'.$url.'">'.$newphone.'</a>';
|
||||||
@@ -806,7 +806,7 @@ function dol_print_phone($phone,$country="FR",$cid=0,$socid=0,$addlink=0,$separ=
|
|||||||
function dol_strlen($string,$stringencoding='')
|
function dol_strlen($string,$stringencoding='')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
if (empty($stringencoding)) $stringencoding=$langs->charset_output;
|
if (empty($stringencoding)) $stringencoding=$langs->charset_output;
|
||||||
|
|
||||||
$ret='';
|
$ret='';
|
||||||
@@ -833,7 +833,7 @@ function dol_strlen($string,$stringencoding='')
|
|||||||
function dol_substr($string,$start,$length,$stringencoding='')
|
function dol_substr($string,$start,$length,$stringencoding='')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
if (empty($stringencoding)) $stringencoding=$langs->charset_output;
|
if (empty($stringencoding)) $stringencoding=$langs->charset_output;
|
||||||
|
|
||||||
$ret='';
|
$ret='';
|
||||||
@@ -1101,8 +1101,8 @@ function img_delete($alt = "default")
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Affiche logo help avec curseur "?"
|
* \brief Affiche logo help avec curseur "?"
|
||||||
* \param usehelpcursor
|
* \param usehelpcursor
|
||||||
* \param usealttitle
|
* \param usealttitle
|
||||||
* \return string Retourne tag img
|
* \return string Retourne tag img
|
||||||
*/
|
*/
|
||||||
function img_help($usehelpcursor=1,$usealttitle=1)
|
function img_help($usehelpcursor=1,$usealttitle=1)
|
||||||
@@ -1111,7 +1111,7 @@ function img_help($usehelpcursor=1,$usealttitle=1)
|
|||||||
$s ='<img ';
|
$s ='<img ';
|
||||||
if ($usehelpcursor) $s.='style="cursor: help;" ';
|
if ($usehelpcursor) $s.='style="cursor: help;" ';
|
||||||
$s.='src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/info.png" border="0"';
|
$s.='src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/info.png" border="0"';
|
||||||
if ($usealttitle)
|
if ($usealttitle)
|
||||||
{
|
{
|
||||||
if (is_string($usealttitle)) $s.=' alt="'.$usealttitle.'" title="'.$usealttitle.'"';
|
if (is_string($usealttitle)) $s.=' alt="'.$usealttitle.'" title="'.$usealttitle.'"';
|
||||||
else $s.=' alt="'.$langs->trans("Info").'" title="'.$langs->trans("Info").'"';
|
else $s.=' alt="'.$langs->trans("Info").'" title="'.$langs->trans("Info").'"';
|
||||||
@@ -1567,8 +1567,8 @@ function dol_print_error($db='',$error='')
|
|||||||
if ($_SERVER['DOCUMENT_ROOT']) // Mode web
|
if ($_SERVER['DOCUMENT_ROOT']) // Mode web
|
||||||
{
|
{
|
||||||
print $langs->trans("DolibarrHasDetectedError").".<br>\n";
|
print $langs->trans("DolibarrHasDetectedError").".<br>\n";
|
||||||
if (! empty($conf->global->MAIN_FEATURES_LEVEL))
|
if (! empty($conf->global->MAIN_FEATURES_LEVEL))
|
||||||
print "You use an experimental level of features, so please do NOT report any bugs, anywhere, until going back to MAIN_FEATURES_LEVEL = 0.<br>\n";
|
print "You use an experimental level of features, so please do NOT report any bugs, anywhere, until going back to MAIN_FEATURES_LEVEL = 0.<br>\n";
|
||||||
print $langs->trans("InformationToHelpDiagnose").":<br><br>\n";
|
print $langs->trans("InformationToHelpDiagnose").":<br><br>\n";
|
||||||
|
|
||||||
print "<b>".$langs->trans("Dolibarr").":</b> ".DOL_VERSION."<br>\n";;
|
print "<b>".$langs->trans("Dolibarr").":</b> ".DOL_VERSION."<br>\n";;
|
||||||
@@ -1612,7 +1612,7 @@ function dol_print_error($db='',$error='')
|
|||||||
if ($error)
|
if ($error)
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
|
|
||||||
if (is_array($error)) $errors=$error;
|
if (is_array($error)) $errors=$error;
|
||||||
else $errors=array($error);
|
else $errors=array($error);
|
||||||
|
|
||||||
@@ -1630,7 +1630,7 @@ function dol_print_error($db='',$error='')
|
|||||||
$syslog.=", msg=".$msg;
|
$syslog.=", msg=".$msg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dolibarr_syslog("Error ".$syslog, LOG_ERR);
|
dolibarr_syslog("Error ".$syslog, LOG_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1717,7 +1717,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite)
|
|||||||
* \param begin ("" par defaut)
|
* \param begin ("" par defaut)
|
||||||
* \param options ("" par defaut)
|
* \param options ("" par defaut)
|
||||||
* \param td options de l'attribut td ("" 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
|
* \param sortorder ordre du tri
|
||||||
*/
|
*/
|
||||||
function print_liste_field_titre($name, $file, $field, $begin="", $options="", $td="", $sortfield="", $sortorder="")
|
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.
|
// Le champ de tri est mis en evidence.
|
||||||
// Exemple si (sortfield,field)=("nom","xxx.nom") ou (sortfield,field)=("nom","nom")
|
// 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.'>';
|
print '<td class="liste_titre_sel" '. $td.'>';
|
||||||
}
|
}
|
||||||
@@ -1829,7 +1829,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '<table width="100%" border="0" class="notopnoleftnoright" style="margin-bottom: 2px;"><tr>';
|
print '<table width="100%" border="0" class="notopnoleftnoright" style="margin-bottom: 2px;"><tr>';
|
||||||
|
|
||||||
$pagelist = '';
|
$pagelist = '';
|
||||||
|
|
||||||
// Left
|
// Left
|
||||||
@@ -2109,17 +2109,17 @@ function price2num($amount,$rounding='',$alreadysqlnb=-1)
|
|||||||
// Convert value to universal number format (no thousand separator, '.' as decimal separator)
|
// Convert value to universal number format (no thousand separator, '.' as decimal separator)
|
||||||
if ($alreadysqlnb != 1) // If not a PHP number or unknown, we change format
|
if ($alreadysqlnb != 1) // If not a PHP number or unknown, we change format
|
||||||
{
|
{
|
||||||
//print 'ZZ'.$nbofdec.'=>'.$amount.'<br>';
|
//print 'ZZ'.$nbofdec.'=>'.$amount.'<br>';
|
||||||
|
|
||||||
// Convert amount to format with dolibarr dec and thousand (this is because PHP convert a number
|
// Convert amount to format with dolibarr dec and thousand (this is because PHP convert a number
|
||||||
// to format defined by LC_NUMERIC after a calculation and we want source format to be like defined by Dolibarr setup.
|
// to format defined by LC_NUMERIC after a calculation and we want source format to be like defined by Dolibarr setup.
|
||||||
if (is_numeric($amount))
|
if (is_numeric($amount))
|
||||||
{
|
{
|
||||||
$nbofdec=max(0,strlen($amount-intval($amount))-2);
|
$nbofdec=max(0,strlen($amount-intval($amount))-2);
|
||||||
$amount=number_format($amount,$nbofdec,$dec,$thousand);
|
$amount=number_format($amount,$nbofdec,$dec,$thousand);
|
||||||
}
|
}
|
||||||
//print "QQ".$amount.'<br>';
|
//print "QQ".$amount.'<br>';
|
||||||
|
|
||||||
// Now make replace (the main goal of function)
|
// Now make replace (the main goal of function)
|
||||||
if ($thousand != ',' && $thousand != '.') $amount=str_replace(',','.',$amount); // To accept 2 notations for french users
|
if ($thousand != ',' && $thousand != '.') $amount=str_replace(',','.',$amount); // To accept 2 notations for french users
|
||||||
$amount=str_replace(' ','',$amount); // To avoid spaces
|
$amount=str_replace(' ','',$amount); // To avoid spaces
|
||||||
@@ -2133,12 +2133,12 @@ function price2num($amount,$rounding='',$alreadysqlnb=-1)
|
|||||||
$nbofdectoround='';
|
$nbofdectoround='';
|
||||||
if ($rounding == 'MU') $nbofdectoround=$conf->global->MAIN_MAX_DECIMALS_UNIT;
|
if ($rounding == 'MU') $nbofdectoround=$conf->global->MAIN_MAX_DECIMALS_UNIT;
|
||||||
elseif ($rounding == 'MT') $nbofdectoround=$conf->global->MAIN_MAX_DECIMALS_TOT;
|
elseif ($rounding == 'MT') $nbofdectoround=$conf->global->MAIN_MAX_DECIMALS_TOT;
|
||||||
elseif ($rounding == 'MS') $nbofdectoround=$conf->global->MAIN_MAX_DECIMALS_SHOWN;
|
elseif ($rounding == 'MS') $nbofdectoround=$conf->global->MAIN_MAX_DECIMALS_SHOWN;
|
||||||
elseif ($rounding == '2') $nbofdectoround=2; // For admin info page
|
elseif ($rounding == '2') $nbofdectoround=2; // For admin info page
|
||||||
if (strlen($nbofdectoround)) $amount = round($amount,$nbofdectoround); // $nbofdectoround can be 0.
|
if (strlen($nbofdectoround)) $amount = round($amount,$nbofdectoround); // $nbofdectoround can be 0.
|
||||||
else return 'ErrorBadParameterProvidedToFunction';
|
else return 'ErrorBadParameterProvidedToFunction';
|
||||||
//print 'ZZ'.$nbofdec.'-'.$nbofdectoround.'=>'.$amount.'<br>';
|
//print 'ZZ'.$nbofdec.'-'.$nbofdectoround.'=>'.$amount.'<br>';
|
||||||
|
|
||||||
// Convert amount to format with dolibarr dec and thousand (this is because PHP convert a number
|
// Convert amount to format with dolibarr dec and thousand (this is because PHP convert a number
|
||||||
// to format defined by LC_NUMERIC after a calculation and we want source format to be defined by Dolibarr setup.
|
// to format defined by LC_NUMERIC after a calculation and we want source format to be defined by Dolibarr setup.
|
||||||
if (is_numeric($amount))
|
if (is_numeric($amount))
|
||||||
@@ -2155,7 +2155,7 @@ function price2num($amount,$rounding='',$alreadysqlnb=-1)
|
|||||||
$amount=str_replace($thousand,'',$amount); // Replace of thousand before replace of dec to avoid pb if thousand is .
|
$amount=str_replace($thousand,'',$amount); // Replace of thousand before replace of dec to avoid pb if thousand is .
|
||||||
$amount=str_replace($dec,'.',$amount);
|
$amount=str_replace($dec,'.',$amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $amount;
|
return $amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2384,7 +2384,7 @@ function clean_url($url,$http=1)
|
|||||||
//print $url." -> ".$proto." - ".$domain." - ".$port;
|
//print $url." -> ".$proto." - ".$domain." - ".$port;
|
||||||
//$url = dol_string_nospecial(trim($url));
|
//$url = dol_string_nospecial(trim($url));
|
||||||
$url = trim($url);
|
$url = trim($url);
|
||||||
|
|
||||||
// Si http: defini on supprime le http (Si https on ne supprime pas)
|
// Si http: defini on supprime le http (Si https on ne supprime pas)
|
||||||
$newproto=$proto;
|
$newproto=$proto;
|
||||||
if ($http==0)
|
if ($http==0)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -18,12 +18,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/lib/project.lib.php
|
* \file htdocs/lib/project.lib.php
|
||||||
\brief Ensemble de fonctions de base pour le module projet
|
* \brief Ensemble de fonctions de base pour le module projet
|
||||||
\ingroup societe
|
* \ingroup societe
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function project_prepare_head($objsoc)
|
function project_prepare_head($objsoc)
|
||||||
{
|
{
|
||||||
global $langs, $conf, $user;
|
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
|
* \file htdocs/lib/project.lib.php
|
||||||
\param socid Id soci<63>t<EFBFBD>
|
* \brief Ensemble de fonctions de base pour le module projet
|
||||||
\param selected Id projet pr<70>-s<>lectionn<6E>
|
* \ingroup societe
|
||||||
\param htmlname Nom de la zone html
|
* \version $Id$
|
||||||
\return int Nbre de projet si ok, <0 si ko
|
*/
|
||||||
*/
|
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')
|
function select_projects($socid, $selected='', $htmlname='projectid')
|
||||||
{
|
{
|
||||||
global $db;
|
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
|
* \file htdocs/project.class.php
|
||||||
\ingroup projet
|
* \ingroup projet
|
||||||
\brief Fichier de la classe de gestion des projets
|
* \brief Fichier de la classe de gestion des projets
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT ."/commonobject.class.php");
|
require_once(DOL_DOCUMENT_ROOT ."/commonobject.class.php");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\class Project
|
* \class Project
|
||||||
\brief Classe permettant la gestion des projets
|
* \brief Class to manage projects
|
||||||
*/
|
*/
|
||||||
class Project extends CommonObject
|
class Project extends CommonObject
|
||||||
{
|
{
|
||||||
var $db; //!< To store db handler
|
var $db; //!< To store db handler
|
||||||
@@ -47,9 +46,9 @@ class Project extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Constructeur de la classe
|
* \brief Constructeur de la classe
|
||||||
* \param DB handler acc<63>s base de donn<6E>es
|
* \param DB handler acc<63>s base de donn<6E>es
|
||||||
*/
|
*/
|
||||||
function Project($DB)
|
function Project($DB)
|
||||||
{
|
{
|
||||||
$this->db = $DB;
|
$this->db = $DB;
|
||||||
@@ -57,10 +56,10 @@ class Project extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* \brief Cree un projet en base
|
* \brief Cree un projet en base
|
||||||
* \param user Id utilisateur qui cree
|
* \param user Id utilisateur qui cree
|
||||||
* \return int <0 si ko, id du projet cree si ok
|
* \return int <0 si ko, id du projet cree si ok
|
||||||
*/
|
*/
|
||||||
function create($user)
|
function create($user)
|
||||||
{
|
{
|
||||||
// Check parameters
|
// Check parameters
|
||||||
@@ -176,10 +175,10 @@ class Project extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Return list of projects
|
* \brief Return list of projects
|
||||||
* \param id_societe To filter on a particular third party
|
* \param id_societe To filter on a particular third party
|
||||||
* \return array Liste of projects
|
* \return array Liste of projects
|
||||||
*/
|
*/
|
||||||
function liste_array($id_societe='')
|
function liste_array($id_societe='')
|
||||||
{
|
{
|
||||||
$projets = array();
|
$projets = array();
|
||||||
@@ -216,10 +215,10 @@ class Project extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Return list of elements for type linked to project
|
* \brief Return list of elements for type linked to project
|
||||||
* \param type 'propal','order','invoice','order_supplier','invoice_supplier'
|
* \param type 'propal','order','invoice','order_supplier','invoice_supplier'
|
||||||
* \return array List of orders linked to project, <0 if error
|
* \return array List of orders linked to project, <0 if error
|
||||||
*/
|
*/
|
||||||
function get_element_list($type)
|
function get_element_list($type)
|
||||||
{
|
{
|
||||||
$elements = array();
|
$elements = array();
|
||||||
@@ -262,9 +261,9 @@ class Project extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Supprime le projet dans la base
|
* \brief Supprime le projet dans la base
|
||||||
* \param Utilisateur
|
* \param Utilisateur
|
||||||
*/
|
*/
|
||||||
function delete($user)
|
function delete($user)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -283,51 +282,71 @@ class Project extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Create a task into project
|
* \brief Create a task into project
|
||||||
* \param user Id user that create
|
* \param user Id user that create
|
||||||
* \param title Title of task
|
* \param title Title of task
|
||||||
* \param parent Id task parent
|
* \param parent Id task parent
|
||||||
*/
|
* \param id_resp Id of responsible user
|
||||||
function CreateTask($user, $title, $parent = 0)
|
* \return int Task id if succes, <0 if KO
|
||||||
|
*/
|
||||||
|
function CreateTask($user, $title, $parent=0, $id_resp=0)
|
||||||
{
|
{
|
||||||
$result = 0;
|
$result = 0;
|
||||||
|
$task_id = -1;
|
||||||
|
|
||||||
if (trim($title))
|
if (trim($title))
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task (fk_projet, title, fk_user_creat, fk_task_parent, duration_effective)";
|
$this->db->begin();
|
||||||
$sql.= " VALUES (".$this->id.",'$title', ".$user->id.",".$parent.", 0)";
|
|
||||||
|
|
||||||
dolibarr_syslog("Project::CreateTask sql=".$sql,LOG_DEBUG);
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task (fk_projet, title, fk_user_creat, fk_task_parent, duration_effective)";
|
||||||
if ($this->db->query($sql) )
|
$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");
|
$task_id = $this->db->last_insert_id(MAIN_DB_PREFIX."projet_task");
|
||||||
$result = 0;
|
$result = $task_id;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error();
|
$this->error=$this->db->lasterror();
|
||||||
dolibarr_syslog("Project::CreateTask error -2 ".$this->error,LOG_ERR);
|
dolibarr_syslog("Project::CreateTask error -1 ".$this->error, LOG_ERR);
|
||||||
$result = -2;
|
$result = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result == 0)
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task_actors (fk_projet_task, fk_user)";
|
if ($id_resp > 0)
|
||||||
$sql.= " VALUES (".$task_id.",".$user->id.")";
|
|
||||||
|
|
||||||
dolibarr_syslog("Project::CreateTask sql=".$sql,LOG_DEBUG);
|
|
||||||
if ($this->db->query($sql) )
|
|
||||||
{
|
{
|
||||||
$result = 0;
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task_actors (fk_projet_task, fk_user)";
|
||||||
|
$sql.= " VALUES (".$task_id.",".($id_resp>0?$id_resp:'null').")";
|
||||||
|
|
||||||
|
dolibarr_syslog("Project::CreateTask sql=".$sql,LOG_DEBUG);
|
||||||
|
if ($this->db->query($sql) )
|
||||||
|
{
|
||||||
|
$this->db->commit();
|
||||||
|
return $task_id;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
dolibarr_syslog("Project::CreateTask error -3 ".$this->error,LOG_ERR);
|
||||||
|
$this->db->rollback();
|
||||||
|
return -3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error();
|
$this->db->commit();
|
||||||
dolibarr_syslog("Project::CreateTask error -3 ".$this->error,LOG_ERR);
|
return $task_id;
|
||||||
$result = -2;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dolibarr_syslog("Project::CreateTask error -2 ".$this->error,LOG_ERR);
|
||||||
|
$this->db->rollback();
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -340,11 +359,11 @@ class Project extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Cree une tache dans le projet
|
* \brief Cree une tache dans le projet
|
||||||
* \param user Id utilisateur qui cree
|
* \param user Id utilisateur qui cree
|
||||||
* \param title titre de la tache
|
* \param title titre de la tache
|
||||||
* \param parent tache parente
|
* \param parent tache parente
|
||||||
*/
|
*/
|
||||||
function TaskAddTime($user, $task, $time, $date)
|
function TaskAddTime($user, $task, $time, $date)
|
||||||
{
|
{
|
||||||
$result = 0;
|
$result = 0;
|
||||||
@@ -424,31 +443,39 @@ class Project extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of task for project
|
* Return list of task for all projects or a particular project
|
||||||
* @param user Object user to limit task affected to a particular user
|
* 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
|
||||||
* @return unknown
|
* @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();
|
$tasks = array();
|
||||||
|
|
||||||
/* List of tasks */
|
//print $usert.'-'.$userp;
|
||||||
|
|
||||||
|
// List of tasks
|
||||||
$sql = "SELECT p.rowid as projectid, p.ref, p.title as ptitle,";
|
$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.= " t.rowid, t.title, t.fk_task_parent, t.duration_effective,";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
$sql.= " up.name, up.firstname";
|
||||||
if (is_object($user))
|
$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 as t";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."projet_task_actors as ta";
|
$sql.= ", ".MAIN_DB_PREFIX."projet_task_actors as ta";
|
||||||
|
$sql.= ")";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$sql.= ")";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid";
|
$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 ($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";
|
$sql.= " ORDER BY p.ref, t.title";
|
||||||
|
|
||||||
dolibarr_syslog("Project::getTasksArray sql=".$sql, LOG_DEBUG);
|
dolibarr_syslog("Project::getTasksArray sql=".$sql, LOG_DEBUG);
|
||||||
@@ -463,10 +490,12 @@ class Project extends CommonObject
|
|||||||
$tasks[$i]->projectid = $obj->projectid;
|
$tasks[$i]->projectid = $obj->projectid;
|
||||||
$tasks[$i]->projectref = $obj->ref;
|
$tasks[$i]->projectref = $obj->ref;
|
||||||
$tasks[$i]->projectlabel = $obj->title;
|
$tasks[$i]->projectlabel = $obj->title;
|
||||||
$tasks[$i]->id = $obj->rowid;
|
$tasks[$i]->id = $obj->rowid;
|
||||||
$tasks[$i]->title = $obj->title;
|
$tasks[$i]->title = $obj->title;
|
||||||
$tasks[$i]->fk_parent = $obj->fk_task_parent;
|
$tasks[$i]->fk_parent = $obj->fk_task_parent;
|
||||||
$tasks[$i]->duration = $obj->duration_effective;
|
$tasks[$i]->duration = $obj->duration_effective;
|
||||||
|
$tasks[$i]->name = $obj->name;
|
||||||
|
$tasks[$i]->firstname = $obj->firstname;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$this->db->free();
|
$this->db->free();
|
||||||
@@ -479,6 +508,7 @@ class Project extends CommonObject
|
|||||||
return $tasks;
|
return $tasks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Renvoie nom clicable (avec eventuellement le picto)
|
* \brief Renvoie nom clicable (avec eventuellement le picto)
|
||||||
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||||
|
|||||||
@@ -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-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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -18,11 +18,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/projet/activity/myactivity.php
|
\file htdocs/projet/activity/myactivity.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");
|
||||||
|
|
||||||
@@ -31,9 +31,9 @@ $mode=$_REQUEST["mode"];
|
|||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (!$user->rights->projet->lire) accessforbidden();
|
if (!$user->rights->projet->lire) accessforbidden();
|
||||||
if ($user->societe_id > 0)
|
if ($user->societe_id > 0)
|
||||||
{
|
{
|
||||||
$socid = $user->societe_id;
|
$socid = $user->societe_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
@@ -43,10 +43,12 @@ $langs->load("projects");
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$now = time();
|
$now = gmmktime();
|
||||||
|
|
||||||
if ($mode == 'mine') $title=$langs->trans("MyActivity");
|
$projectstatic=new Project($db);
|
||||||
else $title=$langs->trans("Activity");
|
|
||||||
|
if ($mode == 'mine') $title=$langs->trans("MyActivities");
|
||||||
|
else $title=$langs->trans("Activities");
|
||||||
|
|
||||||
llxHeader("",$title);
|
llxHeader("",$title);
|
||||||
|
|
||||||
@@ -55,18 +57,13 @@ print_fiche_titre($title);
|
|||||||
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">';
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Affichage de la liste des projets
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
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 '<td align="right">'.$langs->trans("NbOpenTasks").'</td>';
|
||||||
print "</tr>\n";
|
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";
|
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p,";
|
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p,";
|
||||||
$sql .= " ".MAIN_DB_PREFIX."projet_task as t";
|
$sql .= " ".MAIN_DB_PREFIX."projet_task as t";
|
||||||
@@ -75,8 +72,8 @@ if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFI
|
|||||||
$sql .= " WHERE t.fk_projet = p.rowid";
|
$sql .= " WHERE t.fk_projet = p.rowid";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$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)
|
if ($socid)
|
||||||
{
|
{
|
||||||
$sql .= " AND p.fk_soc = ".$socid;
|
$sql .= " AND p.fk_soc = ".$socid;
|
||||||
}
|
}
|
||||||
if ($mode == 'mine') $sql.=" AND t.rowid = pta.fk_projet_task";
|
if ($mode == 'mine') $sql.=" AND t.rowid = pta.fk_projet_task";
|
||||||
if ($mode == 'mine') $sql.=" AND pta.fk_user = ".$user->id;
|
if ($mode == 'mine') $sql.=" AND pta.fk_user = ".$user->id;
|
||||||
@@ -86,26 +83,30 @@ $var=true;
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ( $resql )
|
if ( $resql )
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$row = $db->fetch_row( $resql);
|
$row = $db->fetch_object($resql);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$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>';
|
||||||
print '<td align="right">'.$row[2].'</td>';
|
$projectstatic->id=$row->rowid;
|
||||||
print "</tr>\n";
|
$projectstatic->ref=$row->ref;
|
||||||
|
print $projectstatic->getNomUrl(1);
|
||||||
$i++;
|
print '</td>';
|
||||||
}
|
print '<td align="right">'.$row->nb.'</td>';
|
||||||
|
print "</tr>\n";
|
||||||
$db->free($resql);
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
@@ -116,7 +117,7 @@ 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>';
|
||||||
print "</tr>\n";
|
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 .= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||||
$sql .= " , ".MAIN_DB_PREFIX."projet_task as t";
|
$sql .= " , ".MAIN_DB_PREFIX."projet_task as t";
|
||||||
$sql .= " , ".MAIN_DB_PREFIX."projet_task_time as tt";
|
$sql .= " , ".MAIN_DB_PREFIX."projet_task_time as tt";
|
||||||
@@ -131,26 +132,30 @@ $total=0;
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ( $resql )
|
if ( $resql )
|
||||||
{
|
{
|
||||||
while ($row = $db->fetch_row($resql))
|
while ($row = $db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$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>';
|
||||||
print '<td align="right">'.$row[2].'</td>';
|
$projectstatic->id=$row->rowid;
|
||||||
print "</tr>\n";
|
$projectstatic->ref=$row->ref;
|
||||||
$total += $row[2];
|
print $projectstatic->getNomUrl(1);
|
||||||
}
|
print '</td>';
|
||||||
|
print '<td align="right">'.$row->nb.'</td>';
|
||||||
$db->free($resql);
|
print "</tr>\n";
|
||||||
|
$total += $row->nb;
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
print '<tr class="liste_total">';
|
print '<tr class="liste_total">';
|
||||||
print '<td>'.$langs->trans('Total').'</td>';
|
print '<td>'.$langs->trans('Total').'</td>';
|
||||||
print '<td align="right">'.$total.'</td>';
|
print '<td align="right">'.$total.'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
/* Affichage de la liste des projets d'hier */
|
/* Affichage de la liste des projets d'hier */
|
||||||
@@ -160,7 +165,7 @@ print '<td>'.$langs->trans('Yesterday').'</td>';
|
|||||||
print '<td align="right">'.$langs->trans("Time").'</td>';
|
print '<td align="right">'.$langs->trans("Time").'</td>';
|
||||||
print "</tr>\n";
|
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 .= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||||
$sql .= " , ".MAIN_DB_PREFIX."projet_task as t";
|
$sql .= " , ".MAIN_DB_PREFIX."projet_task as t";
|
||||||
$sql .= " , ".MAIN_DB_PREFIX."projet_task_time as tt";
|
$sql .= " , ".MAIN_DB_PREFIX."projet_task_time as tt";
|
||||||
@@ -175,21 +180,25 @@ $total=0;
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ( $resql )
|
if ( $resql )
|
||||||
{
|
{
|
||||||
while ($row = $db->fetch_row($resql))
|
while ($row = $db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$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>';
|
||||||
print '<td align="right">'.$row[2].'</td>';
|
$projectstatic->id=$row->rowid;
|
||||||
print "</tr>\n";
|
$projectstatic->ref=$row->ref;
|
||||||
$total += $row[2];
|
print $projectstatic->getNomUrl(1);
|
||||||
}
|
print '</td>';
|
||||||
|
print '<td align="right">'.$row->nb.'</td>';
|
||||||
$db->free($resql);
|
print "</tr>\n";
|
||||||
|
$total += $row->nb;
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
print '<tr class="liste_total">';
|
print '<tr class="liste_total">';
|
||||||
print '<td>'.$langs->trans('Total').'</td>';
|
print '<td>'.$langs->trans('Total').'</td>';
|
||||||
@@ -206,7 +215,7 @@ print '<td>'.$langs->trans("ActivityOnProjectThisWeek").'</td>';
|
|||||||
print '<td align="right">'.$langs->trans("Time").'</td>';
|
print '<td align="right">'.$langs->trans("Time").'</td>';
|
||||||
print "</tr>\n";
|
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 .= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||||
$sql .= " , ".MAIN_DB_PREFIX."projet_task as t";
|
$sql .= " , ".MAIN_DB_PREFIX."projet_task as t";
|
||||||
$sql .= " , ".MAIN_DB_PREFIX."projet_task_time as tt";
|
$sql .= " , ".MAIN_DB_PREFIX."projet_task_time as tt";
|
||||||
@@ -220,21 +229,25 @@ $var=true;
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ( $resql )
|
if ( $resql )
|
||||||
{
|
{
|
||||||
while ($row = $db->fetch_row( $resql))
|
while ($row = $db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr ".$bc[$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>';
|
||||||
print '<td align="right">'.$row[2].'</td>';
|
$projectstatic->id=$row->rowid;
|
||||||
print "</tr>\n";
|
$projectstatic->ref=$row->ref;
|
||||||
$total += $row[2];
|
print $projectstatic->getNomUrl(1);
|
||||||
}
|
print '</td>';
|
||||||
|
print '<td align="right">'.$row->nb.'</td>';
|
||||||
$db->free($resql);
|
print "</tr>\n";
|
||||||
|
$total += $row->nb;
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
print '<tr class="liste_total">';
|
print '<tr class="liste_total">';
|
||||||
print '<td>'.$langs->trans('Total').'</td>';
|
print '<td>'.$langs->trans('Total').'</td>';
|
||||||
@@ -249,7 +262,7 @@ print '<td>'.$langs->trans("ActivityOnProjectThisMonth").': '.strftime("%B %Y",
|
|||||||
print '<td align="right">'.$langs->trans("Time").'</td>';
|
print '<td align="right">'.$langs->trans("Time").'</td>';
|
||||||
print "</tr>\n";
|
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 .= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||||
$sql .= " , ".MAIN_DB_PREFIX."projet_task as t";
|
$sql .= " , ".MAIN_DB_PREFIX."projet_task as t";
|
||||||
$sql .= " , ".MAIN_DB_PREFIX."projet_task_time as tt";
|
$sql .= " , ".MAIN_DB_PREFIX."projet_task_time as tt";
|
||||||
@@ -263,19 +276,23 @@ $var=false;
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ( $resql )
|
if ( $resql )
|
||||||
{
|
{
|
||||||
while ($row = $db->fetch_row($resql))
|
while ($row = $db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
print "<tr $bc[$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>';
|
||||||
print '<td align="right">'.$row[2].'</td>';
|
$projectstatic->id=$row->rowid;
|
||||||
print "</tr>\n";
|
$projectstatic->ref=$row->ref;
|
||||||
$var=!$var;
|
print $projectstatic->getNomUrl(1);
|
||||||
}
|
print '</td>';
|
||||||
$db->free($resql);
|
print '<td align="right">'.$row->nb.'</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
$var=!$var;
|
||||||
|
}
|
||||||
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
@@ -286,7 +303,7 @@ print '<td>'.$langs->trans("ActivityOnProjectThisYear").': '.strftime("%Y", $now
|
|||||||
print '<td align="right">'.$langs->trans("Time").'</td>';
|
print '<td align="right">'.$langs->trans("Time").'</td>';
|
||||||
print "</tr>\n";
|
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 .= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||||
$sql .= " , ".MAIN_DB_PREFIX."projet_task as t";
|
$sql .= " , ".MAIN_DB_PREFIX."projet_task as t";
|
||||||
$sql .= " , ".MAIN_DB_PREFIX."projet_task_time as tt";
|
$sql .= " , ".MAIN_DB_PREFIX."projet_task_time as tt";
|
||||||
@@ -300,19 +317,23 @@ $var=false;
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ( $resql )
|
if ( $resql )
|
||||||
{
|
{
|
||||||
while ($row = $db->fetch_row($resql))
|
while ($row = $db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
print "<tr $bc[$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>';
|
||||||
print '<td align="right">'.$row[2].'</td>';
|
$projectstatic->id=$row->rowid;
|
||||||
print "</tr>\n";
|
$projectstatic->ref=$row->ref;
|
||||||
$var=!$var;
|
print $projectstatic->getNomUrl(1);
|
||||||
}
|
print '</td>';
|
||||||
$db->free($resql);
|
print '<td align="right">'.$row->nb.'</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
$var=!$var;
|
||||||
|
}
|
||||||
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* 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>
|
* Copyright (C) 2005-2007 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
|
||||||
@@ -68,7 +68,7 @@ if ($_POST["action"] == 'addtime' && $user->rights->projet->creer)
|
|||||||
{
|
{
|
||||||
$post=intval($post)+(($post-intval($post))*(1+2/3));
|
$post=intval($post)+(($post-intval($post))*(1+2/3));
|
||||||
$post=price2num($post);
|
$post=price2num($post);
|
||||||
|
|
||||||
$id = ereg_replace("task","",$key);
|
$id = ereg_replace("task","",$key);
|
||||||
|
|
||||||
$task=new Task($db);
|
$task=new Task($db);
|
||||||
@@ -76,7 +76,7 @@ if ($_POST["action"] == 'addtime' && $user->rights->projet->creer)
|
|||||||
|
|
||||||
$project = new Project($db);
|
$project = new Project($db);
|
||||||
$result = $project->fetch($task->fk_projet);
|
$result = $project->fetch($task->fk_projet);
|
||||||
|
|
||||||
$date = dolibarr_mktime(12,0,0,$_POST["$id"."month"],$_POST["$id"."day"],$_POST["$id"."year"]);
|
$date = dolibarr_mktime(12,0,0,$_POST["$id"."month"],$_POST["$id"."day"],$_POST["$id"."year"]);
|
||||||
$project->TaskAddTime($user, $id , $post, $date);
|
$project->TaskAddTime($user, $id , $post, $date);
|
||||||
}
|
}
|
||||||
@@ -118,7 +118,8 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorde
|
|||||||
if ($mesg) print $mesg;
|
if ($mesg) print $mesg;
|
||||||
|
|
||||||
$tasksrole=$projet->getTasksRoleForUser($user);
|
$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 '<form name="addtime" method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$projet->id.'">';
|
||||||
print '<input type="hidden" name="action" value="addtime">';
|
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 align="right">'.$langs->trans("TimeSpent").'</td>';
|
||||||
print '<td colspan="2">'.$langs->trans("AddDuration").'</td>';
|
print '<td colspan="2">'.$langs->trans("AddDuration").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
PLines($j, 0, $tasksarray, $level, $tasksrole);
|
PLinesb($j, 0, $tasksarray, $level, $tasksrole);
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|
||||||
@@ -141,75 +142,4 @@ print '</div>';
|
|||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
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
|
* \file htdocs/projet/activity/pre.inc.php
|
||||||
\ingroup projet
|
* \ingroup projet
|
||||||
\brief Fichier de gestion du menu gauche du module projet
|
* \brief Fichier de gestion du menu gauche du module projet
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require ("../../main.inc.php");
|
require ("../../main.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/project.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/project.class.php");
|
||||||
@@ -39,25 +39,31 @@ $langs->load("companies");
|
|||||||
*/
|
*/
|
||||||
function llxHeader($head = "", $title="", $help_url='')
|
function llxHeader($head = "", $title="", $help_url='')
|
||||||
{
|
{
|
||||||
global $langs, $user;
|
global $langs, $user;
|
||||||
|
|
||||||
top_menu($head, $title);
|
top_menu($head, $title);
|
||||||
|
|
||||||
$menu = new Menu();
|
$menu = new Menu();
|
||||||
|
|
||||||
$menu->add(DOL_URL_ROOT."/projet/index.php?leftmenu=projects", $langs->trans("Projects"), 0, $user->rights->projet->lire);
|
$menu->add(DOL_URL_ROOT."/projet/index.php?leftmenu=projects", $langs->trans("Projects"), 0, $user->rights->projet->lire);
|
||||||
$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/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_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(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("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/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_submenu(DOL_URL_ROOT."/projet/tasks/index.php", $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_submenu(DOL_URL_ROOT."/projet/activity/list.php", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer);
|
$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);
|
|
||||||
|
|
||||||
left_menu($menu->liste, $help_url);
|
$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 = new Project($db);
|
||||||
$projet->fetch($_GET["id"],$_GET["ref"]);
|
$projet->fetch($_GET["id"],$_GET["ref"]);
|
||||||
$projet->societe->fetch($projet->societe->id);
|
$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);
|
$head=project_prepare_head($projet);
|
||||||
dolibarr_fiche_head($head, 'element', $langs->trans("Project"));
|
dolibarr_fiche_head($head, 'element', $langs->trans("Project"));
|
||||||
@@ -75,13 +79,19 @@ print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
|
|||||||
print $form->showrefnav($projet,'ref','',1,'ref','ref');
|
print $form->showrefnav($projet,'ref','',1,'ref','ref');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$projet->title.'</td></tr>';
|
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$projet->title.'</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Company").'</td><td>';
|
print '<tr><td>'.$langs->trans("Company").'</td><td>';
|
||||||
if (! empty($projet->societe->id)) print $projet->societe->getNomUrl(1);
|
if (! empty($projet->societe->id)) print $projet->societe->getNomUrl(1);
|
||||||
else print ' ';
|
else print ' ';
|
||||||
print '</td></tr>';
|
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 '</table>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
|
|||||||
print_fiche_titre($langs->trans("NewProject"));
|
print_fiche_titre($langs->trans("NewProject"));
|
||||||
|
|
||||||
if ($mesg) print $mesg.'<br>';
|
if ($mesg) print $mesg.'<br>';
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||||
//if ($_REQUEST["socid"]) print '<input type="hidden" name="socid" value="'.$_REQUEST["socid"].'">';
|
//if ($_REQUEST["socid"]) print '<input type="hidden" name="socid" value="'.$_REQUEST["socid"].'">';
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
@@ -165,7 +165,15 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
|
|||||||
|
|
||||||
// Responsable du projet
|
// Responsable du projet
|
||||||
print '<tr><td>'.$langs->trans("OfficerProject").'</td><td>';
|
print '<tr><td>'.$langs->trans("OfficerProject").'</td><td>';
|
||||||
$html->select_users($projet->user_resp_id,'officer_project',1);
|
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 '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Create").'"></td></tr>';
|
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Create").'"></td></tr>';
|
||||||
@@ -180,10 +188,14 @@ else
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if ($mesg) print $mesg;
|
if ($mesg) print $mesg;
|
||||||
|
|
||||||
$projet = new Project($db);
|
$projet = new Project($db);
|
||||||
$projet->fetch($_GET["id"],$_GET["ref"]);
|
$projet->fetch($_GET["id"],$_GET["ref"]);
|
||||||
$projet->societe->fetch($projet->societe->id);
|
$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);
|
$head=project_prepare_head($projet);
|
||||||
dolibarr_fiche_head($head, 'project', $langs->trans("Project"));
|
dolibarr_fiche_head($head, 'project', $langs->trans("Project"));
|
||||||
@@ -224,31 +236,26 @@ else
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($projet->user_resp_id > 0)
|
|
||||||
{
|
|
||||||
$result=$projet->fetch_user($projet->user_resp_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
|
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
|
||||||
print $html->showrefnav($projet,'ref','',1,'ref','ref');
|
print $html->showrefnav($projet,'ref','',1,'ref','ref');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$projet->title.'</td></tr>';
|
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$projet->title.'</td></tr>';
|
||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
print '<tr><td>'.$langs->trans("Company").'</td><td>';
|
print '<tr><td>'.$langs->trans("Company").'</td><td>';
|
||||||
if ($projet->societe->id > 0) print $projet->societe->getNomUrl(1);
|
if ($projet->societe->id > 0) print $projet->societe->getNomUrl(1);
|
||||||
else print' ';
|
else print' ';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Project leader
|
// Project leader
|
||||||
print '<tr><td>'.$langs->trans("OfficerProject").'</td><td>';
|
print '<tr><td>'.$langs->trans("OfficerProject").'</td><td>';
|
||||||
if ($projet->user->id) print $projet->user->getNomUrl(1);
|
if ($projet->user->id) print $projet->user->getNomUrl(1);
|
||||||
else print ' ';
|
else print $langs->trans('SharedProject');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ $langs->load("projects");
|
|||||||
if (!$user->rights->projet->lire) accessforbidden();
|
if (!$user->rights->projet->lire) accessforbidden();
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->societe_id > 0)
|
||||||
{
|
{
|
||||||
$socid = $user->societe_id;
|
$socid = $user->societe_id;
|
||||||
}
|
}
|
||||||
@@ -43,19 +43,16 @@ if ($user->societe_id > 0)
|
|||||||
|
|
||||||
llxHeader("",$langs->trans("Projects"),"Projet");
|
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 '<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">';
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Affichage de la liste des projets
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
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 '<td align="right">'.$langs->trans("NbOpenTasks").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
@@ -67,10 +64,11 @@ $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.= " , ".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.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t ON p.rowid = t.fk_projet";
|
||||||
$sql.= " WHERE 1 = 1";
|
$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 (!$user->rights->societe->client->voir && !$socid) $sql .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
if ($socid)
|
if ($socid)
|
||||||
{
|
{
|
||||||
$sql .= " AND p.fk_soc = ".$socid;
|
$sql .= " AND p.fk_soc = ".$socid;
|
||||||
}
|
}
|
||||||
$sql.= " GROUP BY p.rowid";
|
$sql.= " GROUP BY p.rowid";
|
||||||
|
|
||||||
@@ -78,36 +76,32 @@ $var=true;
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ( $resql )
|
if ( $resql )
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$row = $db->fetch_row( $resql);
|
$row = $db->fetch_row( $resql);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print '<td nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/projet/fiche.php?id='.$row[1].'">'.img_object($langs->trans("ShowProject"),"project")." ".$row[0].'</a></td>';
|
print '<td nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/projet/fiche.php?id='.$row[1].'">'.img_object($langs->trans("ShowProject"),"project")." ".$row[0].'</a></td>';
|
||||||
print '<td align="right">'.$row[2].'</td>';
|
print '<td align="right">'.$row[2].'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
print '</td><td width="70%" valign="top" class="notopnoleft">';
|
print '</td><td width="70%" valign="top" class="notopnoleft">';
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Affichage de la liste des projets
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans("Company"),"index.php","s.nom","","","",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Company"),"index.php","s.nom","","","",$sortfield,$sortorder);
|
||||||
@@ -119,10 +113,11 @@ 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";
|
$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";
|
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql .= " WHERE p.fk_soc = s.rowid";
|
$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 (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
if ($socid)
|
if ($socid)
|
||||||
{
|
{
|
||||||
$sql .= " AND s.rowid = ".$socid;
|
$sql .= " AND s.rowid = ".$socid;
|
||||||
}
|
}
|
||||||
$sql .= " GROUP BY s.nom";
|
$sql .= " GROUP BY s.nom";
|
||||||
//$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset);
|
//$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset);
|
||||||
@@ -131,26 +126,26 @@ $var=true;
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ( $resql )
|
if ( $resql )
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$row = $db->fetch_row( $resql);
|
$row = $db->fetch_row( $resql);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print '<td nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/projet/liste.php?socid='.$row[1].'">'.img_object($langs->trans("ShowCompany"),"company")." ".$row[0].'</a></td>';
|
print '<td nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/projet/liste.php?socid='.$row[1].'">'.img_object($langs->trans("ShowCompany"),"company")." ".$row[0].'</a></td>';
|
||||||
print '<td align="right">'.$row[2].'</td>';
|
print '<td align="right">'.$row[2].'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
@@ -158,5 +153,5 @@ print '</td></tr></table>';
|
|||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
llxFooter('$Date$ - $Revision$');
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -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) 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 Marc Bariley / Ocebo <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2006 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2006 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
@@ -20,11 +20,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/projet/liste.php
|
* \file htdocs/projet/liste.php
|
||||||
\ingroup projet
|
* \ingroup projet
|
||||||
\brief Page liste des projets
|
* \brief Page liste des projets
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
|
||||||
@@ -39,9 +39,9 @@ if ($user->societe_id > 0) $socid = $user->societe_id;
|
|||||||
|
|
||||||
if ($socid > 0)
|
if ($socid > 0)
|
||||||
{
|
{
|
||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
$soc->fetch($socid);
|
$soc->fetch($socid);
|
||||||
$title .= ' (<a href="liste.php">'.$soc->nom.'</a>)';
|
$title .= ' (<a href="liste.php">'.$soc->nom.'</a>)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -65,31 +65,34 @@ $pagenext = $page + 1;
|
|||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
|
$projectstatic = new Project($db);
|
||||||
|
$userstatic = new User($db);
|
||||||
$staticsoc=new Societe($db);
|
$staticsoc=new Societe($db);
|
||||||
|
|
||||||
$sql = "SELECT p.rowid as projectid, p.ref, p.title, ".$db->pdate("p.dateo")." as do";
|
$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";
|
$sql .= " s.nom, s.rowid as socid, s.client";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user";
|
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||||
$sql .= " FROM (".MAIN_DB_PREFIX."projet as p";
|
$sql .= " FROM (".MAIN_DB_PREFIX."projet as p";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
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 .= ") LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = p.fk_soc";
|
||||||
$sql .= " WHERE 1 = 1 ";
|
$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 (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
if ($socid)
|
if ($socid)
|
||||||
{
|
{
|
||||||
$sql .= " AND s.rowid = ".$socid;
|
$sql .= " AND s.rowid = ".$socid;
|
||||||
}
|
}
|
||||||
if ($_GET["search_ref"])
|
if ($_GET["search_ref"])
|
||||||
{
|
{
|
||||||
$sql .= " AND p.ref LIKE '%".addslashes($_GET["search_ref"])."%'";
|
$sql .= " AND p.ref LIKE '%".addslashes($_GET["search_ref"])."%'";
|
||||||
}
|
}
|
||||||
if ($_GET["search_label"])
|
if ($_GET["search_label"])
|
||||||
{
|
{
|
||||||
$sql .= " AND p.title LIKE '%".addslashes($_GET["search_label"])."%'";
|
$sql .= " AND p.title LIKE '%".addslashes($_GET["search_label"])."%'";
|
||||||
}
|
}
|
||||||
if ($_GET["search_societe"])
|
if ($_GET["search_societe"])
|
||||||
{
|
{
|
||||||
$sql .= " AND s.nom LIKE '%".addslashes($_GET["search_societe"])."%'";
|
$sql .= " AND s.nom LIKE '%".addslashes($_GET["search_societe"])."%'";
|
||||||
}
|
}
|
||||||
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
|
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
|
||||||
|
|
||||||
@@ -97,67 +100,88 @@ $var=true;
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$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 '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans("Ref"),"liste.php","p.ref","","","",$sortfield,$sortorder);
|
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("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("Company"),"liste.php","s.nom","","","",$sortfield,$sortorder);
|
||||||
print '<td> </td>';
|
print_liste_field_titre($langs->trans("OfficerProject"),"liste.php","","","","",$sortfield,$sortorder);
|
||||||
print "</tr>\n";
|
print '<td> </td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<form method="get" action="liste.php">';
|
print '<form method="get" action="liste.php">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td valign="right">';
|
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"].'">';
|
|
||||||
print '</td>';
|
|
||||||
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>";
|
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$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";
|
|
||||||
|
|
||||||
// Company
|
|
||||||
print '<td>';
|
|
||||||
if ($objp->socid)
|
|
||||||
{
|
|
||||||
$staticsoc->id=$objp->socid;
|
|
||||||
$staticsoc->nom=$objp->nom;
|
|
||||||
print $staticsoc->getNomUrl(1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print ' ';
|
|
||||||
}
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
print '<td valign="right">';
|
||||||
|
print '<input type="text" class="flat" name="search_label" value="'.$_GET["search_label"].'">';
|
||||||
|
print '</td>';
|
||||||
|
print '<td valign="right">';
|
||||||
|
print '<input type="text" class="flat" name="search_societe" value="'.$_GET["search_societe"].'">';
|
||||||
|
print '</td>';
|
||||||
|
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";
|
||||||
|
|
||||||
print '<td> </td>';
|
while ($i < $num)
|
||||||
print "</tr>\n";
|
{
|
||||||
|
$objp = $db->fetch_object($resql);
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
$i++;
|
print "<td>";
|
||||||
}
|
$projectstatic->id=$objp->projectid;
|
||||||
|
$projectstatic->ref=$objp->ref;
|
||||||
|
print $projectstatic->getNomUrl(1);
|
||||||
|
print "</td>";
|
||||||
|
|
||||||
$db->free($resql);
|
// Title
|
||||||
|
print '<td>';
|
||||||
|
print dolibarr_trunc($objp->title,24);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Company
|
||||||
|
print '<td>';
|
||||||
|
if ($objp->socid)
|
||||||
|
{
|
||||||
|
$staticsoc->id=$objp->socid;
|
||||||
|
$staticsoc->nom=$objp->nom;
|
||||||
|
print $staticsoc->getNomUrl(1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print ' ';
|
||||||
|
}
|
||||||
|
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";
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
@@ -166,5 +190,4 @@ $db->close();
|
|||||||
|
|
||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
llxFooter('$Date$ - $Revision$');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -18,11 +18,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/projet/pre.inc.php
|
* \file htdocs/projet/pre.inc.php
|
||||||
\ingroup projet
|
* \ingroup projet
|
||||||
\brief Fichier de gestion du menu gauche du module projet
|
* \brief Fichier de gestion du menu gauche du module projet
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require ("../main.inc.php");
|
require ("../main.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/project.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/project.class.php");
|
||||||
@@ -42,24 +42,31 @@ $langs->load("commercial");
|
|||||||
*/
|
*/
|
||||||
function llxHeader($head = "", $title="", $help_url='')
|
function llxHeader($head = "", $title="", $help_url='')
|
||||||
{
|
{
|
||||||
global $langs, $user;
|
global $langs, $user;
|
||||||
|
|
||||||
top_menu($head, $title);
|
top_menu($head, $title);
|
||||||
|
|
||||||
$menu = new Menu();
|
$menu = new Menu();
|
||||||
|
|
||||||
$menu->add(DOL_URL_ROOT."/projet/index.php?leftmenu=projects", $langs->trans("Projects"), 0, $user->rights->projet->lire);
|
$menu->add(DOL_URL_ROOT."/projet/index.php?leftmenu=projects", $langs->trans("Projects"), 0, $user->rights->projet->lire);
|
||||||
$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/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_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(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("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/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_submenu(DOL_URL_ROOT."/projet/tasks/index.php", $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_submenu(DOL_URL_ROOT."/projet/activity/list.php", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer);
|
$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);
|
|
||||||
|
|
||||||
left_menu($menu->liste, $help_url);
|
$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("./pre.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.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='';
|
||||||
$projetid=isset($_REQUEST["id"])?$_REQUEST["id"]:$_POST["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);
|
$project = new Project($db);
|
||||||
$result = $project->fetch($projectid);
|
$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)
|
if (! $error)
|
||||||
@@ -115,6 +117,7 @@ if ($_POST["action"] == 'addtime' && $user->rights->projet->creer)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
|
$htmlother=new FormOther($db);
|
||||||
|
|
||||||
llxHeader("",$langs->trans("Tasks"),"Tasks");
|
llxHeader("",$langs->trans("Tasks"),"Tasks");
|
||||||
|
|
||||||
@@ -125,15 +128,14 @@ $ref= $_GET['ref'];
|
|||||||
if ($id > 0 || ! empty($ref))
|
if ($id > 0 || ! empty($ref))
|
||||||
{
|
{
|
||||||
$projet->fetch($_REQUEST["id"],$_GET["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)
|
if ($_GET["action"] == 'create' && $user->rights->projet->creer)
|
||||||
{
|
{
|
||||||
print_fiche_titre($langs->trans("NewTask"));
|
print_fiche_titre($langs->trans("NewTask"));
|
||||||
|
|
||||||
$tasksarray=$projet->getTasksArray();
|
|
||||||
|
|
||||||
if ($mesg) print '<div class="error">'.$mesg.'</div>';
|
if ($mesg) print '<div class="error">'.$mesg.'</div>';
|
||||||
|
|
||||||
print '<form action="fiche.php" method="post">';
|
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 '<table class="border" width="100%">';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("NewTask").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("NewTask").'</td><td>';
|
||||||
print '<input type="text" size="25" name="task_name" class="flat"> ';
|
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 '</td></tr>';
|
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 '<input type="submit" class="button" name="add" value="'.$langs->trans("Add").'">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
@@ -194,14 +193,18 @@ else
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$projet->title.'</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);
|
if (! empty($projet->societe->id)) print $projet->societe->getNomUrl(1);
|
||||||
else print ' ';
|
else print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
//print '<td> </td>';
|
|
||||||
print '</tr>';
|
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>';
|
print '</table>';
|
||||||
|
|
||||||
@@ -211,6 +214,9 @@ else
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|
||||||
|
$tasksarray=$projet->getTasksArray($_REQUEST["mode"]=='mine'?$user:0, 0);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
@@ -218,7 +224,14 @@ else
|
|||||||
|
|
||||||
if ($user->rights->projet->creer)
|
if ($user->rights->projet->creer)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$projet->id.'&action=create'.$param.'">'.$langs->trans('AddTask').'</a>';
|
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 '</div>';
|
||||||
@@ -226,136 +239,23 @@ else
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
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("RefTask").'</td>';
|
||||||
print '<td>'.$langs->trans("LabelTask").'</td>';
|
print '<td>'.$langs->trans("LabelTask").'</td>';
|
||||||
print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
|
print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$j=0;
|
$j=0;
|
||||||
PLines($j, 0, $tasksarray, $level, true);
|
$nboftaskshown=PLines($j, 0, $tasksarray, $level, true, 0);
|
||||||
print "</table>";
|
print "</table>";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
if ($nboftaskshown < sizeof($tasksarray))
|
||||||
|
{
|
||||||
|
clean_orphelins($db);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
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("./pre.inc.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php");
|
||||||
|
|
||||||
$mode=$_REQUEST["mode"];
|
$mode=$_REQUEST["mode"];
|
||||||
|
|
||||||
@@ -86,7 +87,7 @@ print '<table class="noborder" width="100%">';
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Project").'</td>';
|
print '<td>'.$langs->trans("Project").'</td>';
|
||||||
print '<td>'.$langs->trans("Task").'</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 '<td align="right">'.$langs->trans("TimeSpent").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
@@ -110,67 +111,4 @@ print '</div>';
|
|||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
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
|
* \file htdocs/projet/tasks/pre.inc.php
|
||||||
\ingroup projet
|
* \ingroup projet
|
||||||
\brief Fichier de gestion du menu gauche du module projet
|
* \brief Fichier de gestion du menu gauche du module projet
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
require ("../../main.inc.php");
|
require ("../../main.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/project.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/project.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/task.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/task.class.php");
|
||||||
@@ -38,25 +38,32 @@ $langs->load("companies");
|
|||||||
*/
|
*/
|
||||||
function llxHeader($head = "", $title="", $help_url='')
|
function llxHeader($head = "", $title="", $help_url='')
|
||||||
{
|
{
|
||||||
global $langs, $user;
|
global $langs, $user;
|
||||||
|
|
||||||
top_menu($head, $title);
|
top_menu($head, $title);
|
||||||
|
|
||||||
$menu = new Menu();
|
$menu = new Menu();
|
||||||
|
|
||||||
$menu->add(DOL_URL_ROOT."/projet/index.php?leftmenu=projects", $langs->trans("Projects"), 0, $user->rights->projet->lire);
|
$menu->add(DOL_URL_ROOT."/projet/index.php?leftmenu=projects", $langs->trans("Projects"), 0, $user->rights->projet->lire);
|
||||||
$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/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_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(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("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/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_submenu(DOL_URL_ROOT."/projet/tasks/index.php", $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_submenu(DOL_URL_ROOT."/projet/activity/list.php", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer);
|
$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);
|
|
||||||
|
|
||||||
left_menu($menu->liste, $help_url);
|
$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,22 +84,18 @@ if ($_GET["id"] > 0)
|
|||||||
$result=$projet->fetch($task->fk_projet);
|
$result=$projet->fetch($task->fk_projet);
|
||||||
if (! empty($projet->socid)) $projet->societe->fetch($projet->socid);
|
if (! empty($projet->socid)) $projet->societe->fetch($projet->socid);
|
||||||
|
|
||||||
$h=0;
|
$head=task_prepare_head($task);
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/task.php?id='.$task->id;
|
|
||||||
$head[$h][1] = $langs->trans("Tasks");
|
|
||||||
$head[$h][2] = 'tasks';
|
|
||||||
$h++;
|
|
||||||
|
|
||||||
dolibarr_fiche_head($head, 'tasks', $langs->trans("Tasks"));
|
dolibarr_fiche_head($head, 'tasks', $langs->trans("Task"));
|
||||||
|
|
||||||
if ($mesg) print $mesg.'<br>';
|
if ($mesg) print $mesg.'<br>';
|
||||||
|
|
||||||
if ($_GET["action"] == 'delete')
|
if ($_GET["action"] == 'delete')
|
||||||
{
|
{
|
||||||
$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteATask"),$langs->trans("ConfirmDeleteATask"),"confirm_delete");
|
$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteATask"),$langs->trans("ConfirmDeleteATask"),"confirm_delete");
|
||||||
print "<br>";
|
print "<br>";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<form method="POST" action="fiche.php?id='.$projet->id.'">';
|
print '<form method="POST" action="fiche.php?id='.$projet->id.'">';
|
||||||
print '<input type="hidden" name="action" value="createtask">';
|
print '<input type="hidden" name="action" value="createtask">';
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
@@ -148,19 +144,19 @@ if ($_GET["id"] > 0)
|
|||||||
print '</table></form>';
|
print '</table></form>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
if ($user->rights->projet->creer)
|
if ($user->rights->projet->creer)
|
||||||
{
|
{
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?id='.$task->id.'&action=delete">'.$langs->trans('Delete').'</a>';
|
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?id='.$task->id.'&action=delete">'.$langs->trans('Delete').'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<input type="hidden" name="action" value="addtime">';
|
print '<input type="hidden" name="action" value="addtime">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
@@ -183,7 +179,7 @@ if ($_GET["id"] > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
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
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error();
|
$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;
|
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 (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 (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 (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 (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 (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);
|
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