diff --git a/ChangeLog b/ChangeLog index e6539a1f1da..928b332a720 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,7 @@ For users: - New: No limit on free text on PDF generated documents. - New: Can force login value when creating a user from a member. - New: Can clone a commercial proposal. +- New: Major enhancement of project module. - Fix: Failed to go on the future view of bank transaction if there is no future bank transaction already wrote. - Fix: Bad ref in supplier list. diff --git a/htdocs/fourn/fournisseur.facture.class.php b/htdocs/fourn/fournisseur.facture.class.php index 20fa887219c..fb0260f1409 100644 --- a/htdocs/fourn/fournisseur.facture.class.php +++ b/htdocs/fourn/fournisseur.facture.class.php @@ -55,7 +55,7 @@ class FactureFournisseur extends Facture var $statut; //! 1 si facture payee COMPLETEMENT, 0 sinon (ce champ ne devrait plus servir car insuffisant) var $paye; - + var $author; var $libelle; 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 .= " 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)."');"; - + dolibarr_syslog("FactureFournisseur::create sql=".$sql, LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) @@ -133,13 +133,13 @@ class FactureFournisseur extends Facture { $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn)'; $sql .= ' VALUES ('.$this->id.');'; - + dolibarr_syslog("FactureFournisseur::create sql=".$sql, LOG_DEBUG); $resql_insert=$this->db->query($sql); if ($resql_insert) { $idligne = $this->db->last_insert_id(MAIN_DB_PREFIX.'facture_fourn_det'); - + $this->updateline($idligne, $this->lignes[$i]->description, $this->lignes[$i]->pu_ht, @@ -241,7 +241,7 @@ class FactureFournisseur extends Facture if ($result < 0) { $this->error=$this->db->error(); - dolibarr_syslog('FactureFournisseur::Fetch Error '.$this->error, LOG_ERROR); + dolibarr_syslog('FactureFournisseur::Fetch Error '.$this->error, LOG_ERR); return -3; } return 1; @@ -263,7 +263,7 @@ class FactureFournisseur extends Facture } } - + /** * \brief Load this->lignes * \return int 1 si ok, < 0 si erreur @@ -319,8 +319,8 @@ class FactureFournisseur extends Facture return -3; } } - - + + /** * \brief Recup�re l'objet fournisseur li� � la facture * @@ -339,7 +339,7 @@ class FactureFournisseur extends Facture function delete($rowid) { $this->db->begin(); - + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn_det WHERE fk_facture_fourn = '.$rowid.';'; dolibarr_syslog("FactureFournisseur sql=".$sql); $resql = $this->db->query($sql); @@ -398,7 +398,7 @@ class FactureFournisseur extends Facture function set_valid($user) { global $conf,$langs; - + $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn"; @@ -410,7 +410,7 @@ class FactureFournisseur extends Facture if ($resql) { $error=0; - + // 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) { @@ -428,7 +428,7 @@ class FactureFournisseur extends Facture } } } - + if ($error == 0) { // Appel des triggers @@ -438,7 +438,7 @@ class FactureFournisseur extends Facture if ($result < 0) { $error++; $this->errors=$interface->errors; } // Fin appel triggers } - + if ($error == 0) { $this->db->commit(); @@ -487,7 +487,7 @@ class FactureFournisseur extends Facture // Nettoyage param�tres if ($txtva == '') $txtva=0; $txtva=price2num($txtva); - + $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn)'; $sql .= ' VALUES ('.$this->id.');'; @@ -560,7 +560,7 @@ class FactureFournisseur extends Facture $result=$product->fetch($idproduct); $product_type=$product->type; } - + $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture_fourn_det '; $sql.= 'SET '; $sql.= 'description =\''.addslashes($label).'\''; @@ -651,7 +651,7 @@ class FactureFournisseur extends Facture dolibarr_print_error($this->db); } } - + /** * \brief Charge indicateurs this->nbtodo et this->nbtodolate de tableau de bord @@ -663,7 +663,7 @@ class FactureFournisseur extends Facture global $conf, $user; $now=gmmktime(); - + $this->nbtodo=$this->nbtodolate=0; $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"; @@ -701,9 +701,9 @@ class FactureFournisseur extends Facture function getNomUrl($withpicto=0,$option='') { global $langs; - + $result=''; - + $lien = ''; $lienfin=''; @@ -712,7 +712,7 @@ class FactureFournisseur extends Facture return $result; } - + /** * \brief Initialise la facture avec valeurs fictives al�atoire * Sert � g�n�rer une facture pour l'aperu des mod�les ou demo @@ -786,7 +786,7 @@ class FactureFournisseur extends Facture $this->total_tva = $xnbp*19.6; $this->total_ttc = $xnbp*119.6; } - + /** * \brief Load an object from its id and create a new one in database * \param fromid Id of object to clone @@ -807,7 +807,7 @@ class FactureFournisseur extends Facture $object->fetch($fromid); $object->id=0; $object->statut=0; - + // Clear fields $object->ref_supplier=$langs->trans("CopyOf").' '.$object->ref_supplier; $object->author = $user->id; @@ -819,7 +819,7 @@ class FactureFournisseur extends Facture $object->ref_client = ''; $object->close_code = ''; $object->close_note = ''; - + // Create clone $result=$object->create($user); @@ -832,9 +832,9 @@ class FactureFournisseur extends Facture if (! $error) { - - - + + + } // End @@ -849,6 +849,6 @@ class FactureFournisseur extends Facture return -1; } } - + } ?> diff --git a/htdocs/html.formother.class.php b/htdocs/html.formother.class.php index 13930a4b6a5..fa13cccc454 100644 --- a/htdocs/html.formother.class.php +++ b/htdocs/html.formother.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Eric Seigne @@ -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 ''; + } + } +} + + +/** + * 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 '\n"; + + $lastprojectid=$lines[$i]->projectid; + $inc++; + } + + print '\n"; + + $inc++; + + $level++; + if ($lines[$i]->id) PLineSelect($inc, $lines[$i]->id, $lines, $level); + $level--; + } + } } ?> diff --git a/htdocs/includes/menus/barre_left/eldy_backoffice.php b/htdocs/includes/menus/barre_left/eldy_backoffice.php index 025594e6670..fff40dc2e38 100644 --- a/htdocs/includes/menus/barre_left/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_backoffice.php @@ -766,13 +766,19 @@ class MenuLeft { $newmenu->add_submenu(DOL_URL_ROOT."/projet/fiche.php?leftmenu=projects&action=create", $langs->trans("NewProject"), 1, $user->rights->projet->creer); $newmenu->add_submenu(DOL_URL_ROOT."/projet/liste.php?leftmenu=projects", $langs->trans("List"), 1, $user->rights->projet->lire); - $newmenu->add(DOL_URL_ROOT."/projet/tasks/index.php", $langs->trans("Tasks"), 0, $user->rights->projet->lire); - $newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer); - $newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php?mode=mine", $langs->trans("MyTasks"), 1, $user->rights->projet->lire); + $newmenu->add(DOL_URL_ROOT."/projet/index.php?leftmenu=projects&mode=mine", $langs->trans("MyProjects"), 0, $user->rights->projet->lire); + $newmenu->add_submenu(DOL_URL_ROOT."/projet/fiche.php?leftmenu=projects&action=create&mode=mine", $langs->trans("NewProject"), 1, $user->rights->projet->creer); + $newmenu->add_submenu(DOL_URL_ROOT."/projet/liste.php?leftmenu=projects&mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire); - $newmenu->add(DOL_URL_ROOT."/projet/activity/index.php", $langs->trans("TimeSpent"), 0, $user->rights->projet->lire); + $newmenu->add(DOL_URL_ROOT."/projet/activity/index.php", $langs->trans("Activities"), 0, $user->rights->projet->lire); + $newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer); + $newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php", $langs->trans("List"), 1, $user->rights->projet->lire); $newmenu->add_submenu(DOL_URL_ROOT."/projet/activity/list.php", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer); - $newmenu->add_submenu(DOL_URL_ROOT."/projet/activity/index.php?mode=mine", $langs->trans("MyTimeSpent"), 1, $user->rights->projet->lire); + + $newmenu->add(DOL_URL_ROOT."/projet/activity/index.php?mode=mine", $langs->trans("MyActivities"), 0, $user->rights->projet->lire); + $newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create&mode=mine", $langs->trans("NewTask"), 1, $user->rights->projet->creer); + $newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php?mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire); + $newmenu->add_submenu(DOL_URL_ROOT."/projet/activity/list.php?mode=mine", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer); } } diff --git a/htdocs/includes/menus/barre_left/eldy_frontoffice.php b/htdocs/includes/menus/barre_left/eldy_frontoffice.php index 648e53a8062..4dbc2dc4d9b 100644 --- a/htdocs/includes/menus/barre_left/eldy_frontoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_frontoffice.php @@ -735,13 +735,19 @@ class MenuLeft { $newmenu->add_submenu(DOL_URL_ROOT."/projet/fiche.php?leftmenu=projects&action=create", $langs->trans("NewProject"), 1, $user->rights->projet->creer); $newmenu->add_submenu(DOL_URL_ROOT."/projet/liste.php?leftmenu=projects", $langs->trans("List"), 1, $user->rights->projet->lire); - $newmenu->add(DOL_URL_ROOT."/projet/tasks/index.php", $langs->trans("Tasks"), 0, $user->rights->projet->lire); - $newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer); - $newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php?mode=mine", $langs->trans("MyTasks"), 1, $user->rights->projet->lire); + $newmenu->add(DOL_URL_ROOT."/projet/index.php?leftmenu=projects&mode=mine", $langs->trans("MyProjects"), 0, $user->rights->projet->lire); + $newmenu->add_submenu(DOL_URL_ROOT."/projet/fiche.php?leftmenu=projects&action=create&mode=mine", $langs->trans("NewProject"), 1, $user->rights->projet->creer); + $newmenu->add_submenu(DOL_URL_ROOT."/projet/liste.php?leftmenu=projects&mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire); - $newmenu->add(DOL_URL_ROOT."/projet/activity/index.php", $langs->trans("TimeSpent"), 0, $user->rights->projet->lire); + $newmenu->add(DOL_URL_ROOT."/projet/activity/index.php", $langs->trans("Activities"), 0, $user->rights->projet->lire); + $newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer); + $newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php", $langs->trans("List"), 1, $user->rights->projet->lire); $newmenu->add_submenu(DOL_URL_ROOT."/projet/activity/list.php", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer); - $newmenu->add_submenu(DOL_URL_ROOT."/projet/activity/index.php?mode=mine", $langs->trans("MyTimeSpent"), 1, $user->rights->projet->lire); + + $newmenu->add(DOL_URL_ROOT."/projet/activity/index.php?mode=mine", $langs->trans("MyActivities"), 0, $user->rights->projet->lire); + $newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create&mode=mine", $langs->trans("NewTask"), 1, $user->rights->projet->creer); + $newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php?mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire); + $newmenu->add_submenu(DOL_URL_ROOT."/projet/activity/list.php?mode=mine", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer); } } diff --git a/htdocs/includes/menus/init_menu_auguria.sql b/htdocs/includes/menus/init_menu_auguria.sql index 56c1f276d54..addbd7b3a82 100644 --- a/htdocs/includes/menus/init_menu_auguria.sql +++ b/htdocs/includes/menus/init_menu_auguria.sql @@ -241,13 +241,33 @@ insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 2704__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/casoc?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->comptaexpert->comptarapport->lire', '', 0, 0); insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 2705__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyuser.php?leftmenu=ca', 'ByUsers', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->comptaexpert->comptarapport->lire', '', 0, 1); + $newmenu->add(DOL_URL_ROOT."/projet/activity/index.php", $langs->trans("Activities"), 0, $user->rights->projet->lire); + $newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer); + $newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php", $langs->trans("List"), 1, $user->rights->projet->lire); + $newmenu->add_submenu(DOL_URL_ROOT."/projet/activity/list.php", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer); + + $newmenu->add(DOL_URL_ROOT."/projet/activity/index.php?mode=mine", $langs->trans("MyActivities"), 0, $user->rights->projet->lire); + $newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/fiche.php?action=create&mode=mine", $langs->trans("NewTask"), 1, $user->rights->projet->creer); + $newmenu->add_submenu(DOL_URL_ROOT."/projet/tasks/index.php?mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire); + $newmenu->add_submenu(DOL_URL_ROOT."/projet/activity/list.php?mode=mine", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer); + insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3600__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/index.php?leftmenu=projects', 'Projects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0); -insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/comm/clients.php?leftmenu=projects', 'NewProject', 1, 'projects', '$user->rights->projet->lire', '', 2, 0); -insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/liste.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 1); -insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/tasks', 'Tasks', 0, 'projects', '$user->rights->projet->lire', '', 2, 1); -insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/mytasks.php', 'MyTasks', 1, 'projects', '$user->rights->projet->lire', '', 2, 0); -insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3800__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity', 'Activity', 0, 'projects', '$user->rights->projet->lire', '', 2, 2); -insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3801__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/activity/myactivity.php', 'MyActivity', 1, 'projects', '$user->rights->projet->lire', '', 2, 0); +insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/fiche.php?leftmenu=projects&action=create', 'NewProject', 1, 'projects', '$user->rights->projet->creer', '', 2, 1); +insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/liste.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2); + +insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3610__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/index.php?leftmenu=projects&mode=mine', 'MyProjects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0); +insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3611__+MAX_llx_menu__, 'project', '', 3610__+MAX_llx_menu__, '/projet/fiche.php?leftmenu=projects&action=create&mode=mine', 'NewProject', 1, 'projects', '$user->rights->projet->creer', '', 2, 1); +insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3612__+MAX_llx_menu__, 'project', '', 3610__+MAX_llx_menu__, '/projet/liste.php?leftmenu=projects&mode=mine', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2); + +insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0); +insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/fiche.php?leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1); +insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/index.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2); +insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3703__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/activity/list.php?leftmenu=projects', 'NewTimeSpent', 1, 'projects', '$user->rights->projet->lire', '', 2, 3); + +insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3800__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?leftmenu=projects&mode=mine', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0); +insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3801__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/tasks/fiche.php?leftmenu=projects&action=create&mode=mine', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1); +insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3802__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/tasks/index.php?leftmenu=projects&mode=mine', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2); +insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3803__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/activity/list.php?leftmenu=projects&mode=mine', 'NewTimeSpent', 1, 'projects', '$user->rights->projet->lire', '', 2, 3); insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3900__+MAX_llx_menu__, 'tools', '', 8__+MAX_llx_menu__, '/comm/mailing/index.php?leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 0); insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3901__+MAX_llx_menu__, 'tools', '', 3900__+MAX_llx_menu__, '/comm/mailing/fiche.php?leftmenu=mailing&action=create', 'NewMailing', 1, 'mails', '$user->rights->mailing->creer', '', 0, 0); diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php index 4b7429d206b..f76702fcbba 100644 --- a/htdocs/install/etape1.php +++ b/htdocs/install/etape1.php @@ -81,9 +81,9 @@ if ($_POST["action"] == "set") { if (! eregi('^db_pass',$cle)) dolibarr_install_syslog("Choice for ".$cle." = ".$valeur); } - + // Show title of step - print '

'.$langs->trans("ConfigurationFile").'

'; + print '

'.$langs->trans("ConfigurationFile").'

'; print ''; // Check parameter main_dir @@ -92,7 +92,7 @@ if ($_POST["action"] == "set") if (! is_dir($main_dir)) { dolibarr_install_syslog("etape1: Repertoire '".$main_dir."' inexistant ou non accessible"); - + print ""; } } - + $db->close(); } else @@ -280,7 +280,7 @@ if ($_POST["action"] == "set") print ''; print ''; print ''; - + // Affiche aide diagnostique print ''; - + $error++; } } } // Fin si "creation utilisateur" - - + + /* * If database creation is asked, we create it */ @@ -312,7 +312,7 @@ if ($_POST["action"] == "set") print $dolibarr_main_db_name; print ''; print ""; - + $check1=$db->getDefaultCharacterSetDatabase(); $check2=$db->getDefaultCollationDatabase(); 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 ""; - 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 "'; print ''; print "\n"; -$sql = "SELECT p.title, p.rowid, sum(tt.task_duration)"; +$sql = "SELECT p.rowid, p.ref, p.title, sum(tt.task_duration) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql .= " , ".MAIN_DB_PREFIX."projet_task as t"; $sql .= " , ".MAIN_DB_PREFIX."projet_task_time as tt"; @@ -175,21 +180,25 @@ $total=0; $resql = $db->query($sql); if ( $resql ) { - while ($row = $db->fetch_row($resql)) - { - $var=!$var; - print ""; - print ''; - print ''; - print "\n"; - $total += $row[2]; - } - - $db->free($resql); + while ($row = $db->fetch_object($resql)) + { + $var=!$var; + print ""; + print ''; + print ''; + print "\n"; + $total += $row->nb; + } + + $db->free($resql); } else { - dolibarr_print_error($db); + dolibarr_print_error($db); } print ''; print ''; @@ -206,7 +215,7 @@ print ''; print ''; print "\n"; -$sql = "SELECT p.title, p.rowid, sum(tt.task_duration)"; +$sql = "SELECT p.rowid, p.ref, p.title, sum(tt.task_duration) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql .= " , ".MAIN_DB_PREFIX."projet_task as t"; $sql .= " , ".MAIN_DB_PREFIX."projet_task_time as tt"; @@ -220,21 +229,25 @@ $var=true; $resql = $db->query($sql); if ( $resql ) { - while ($row = $db->fetch_row( $resql)) - { - $var=!$var; - print ""; - print ''; - print ''; - print "\n"; - $total += $row[2]; - } - - $db->free($resql); + while ($row = $db->fetch_object($resql)) + { + $var=!$var; + print ""; + print ''; + print ''; + print "\n"; + $total += $row->nb; + } + + $db->free($resql); } else { - dolibarr_print_error($db); + dolibarr_print_error($db); } print ''; print ''; @@ -249,7 +262,7 @@ print ''; print "\n"; -$sql = "SELECT p.title, p.rowid, sum(tt.task_duration)"; +$sql = "SELECT p.rowid, p.ref, p.title, sum(tt.task_duration) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql .= " , ".MAIN_DB_PREFIX."projet_task as t"; $sql .= " , ".MAIN_DB_PREFIX."projet_task_time as tt"; @@ -263,19 +276,23 @@ $var=false; $resql = $db->query($sql); if ( $resql ) { - while ($row = $db->fetch_row($resql)) - { - print ""; - print ''; - print ''; - print "\n"; - $var=!$var; - } - $db->free($resql); + while ($row = $db->fetch_object($resql)) + { + print ""; + print ''; + print ''; + print "\n"; + $var=!$var; + } + $db->free($resql); } else { - dolibarr_print_error($db); + dolibarr_print_error($db); } print "
"; print $langs->trans("ErrorDirDoesNotExists",$main_dir).'
'; print $langs->trans("ErrorWrongValueForParameter",$langs->trans("WebPagesDirectory")).'
'; @@ -108,7 +108,7 @@ if ($_POST["action"] == "set") if (! $error) { dolibarr_install_syslog("etape1: Directory '".$main_dir."' exists"); - + require_once($main_dir."/lib/databases/".$_POST["db_type"].".lib.php"); } @@ -125,7 +125,7 @@ if ($_POST["action"] == "set") { create_exdir($main_data_dir); } - + if (! is_dir($main_data_dir)) { print "
".$langs->trans("ErrorDirDoesNotExists",$main_data_dir); @@ -148,7 +148,7 @@ if ($_POST["action"] == "set") $dir[6] = "$main_data_dir/rapport"; $dir[7] = "$main_data_dir/rss"; $dir[8] = "$main_data_dir/logo"; - + // Boucle sur chaque répertoire de dir[] pour les créer s'ils nexistent pas for ($i = 0 ; $i < sizeof($dir) ; $i++) { @@ -190,14 +190,14 @@ if ($_POST["action"] == "set") { $error+=write_conf_file($conffile); } - + /** * Create database and admin user database */ if (! $error) { conf($dolibarr_main_document_root); - + $userroot=isset($_POST["db_user_root"])?$_POST["db_user_root"]:""; $passroot=isset($_POST["db_pass_root"])?$_POST["db_pass_root"]:""; @@ -223,16 +223,16 @@ if ($_POST["action"] == "set") { $databasefortest='mssql'; } - + // Creation handler de base, verification du support et connexion $db = new DoliDb($conf->db->type,$conf->db->host,$userroot,$passroot,$databasefortest,$conf->db->port); if ($db->error) - { + { print '
'.$db->error.'
'; $error++; } - + if (! $error) { if ($db->connected) @@ -241,7 +241,7 @@ if ($_POST["action"] == "set") if ($result > 0) { - + print '
'; print $langs->trans("UserCreation").' : '; print $dolibarr_main_db_user; @@ -269,7 +269,7 @@ if ($_POST["action"] == "set") print ''.$langs->trans("Error").' '.$db->error()."
'.$langs->trans("Error").'

'; 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").'

'; print $langs->trans("ErrorGoBackAndCorrectParameters").'

'; print '
".$langs->trans("OK")."
"; print $langs->trans("DatabaseConnection")." : "; 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; $error=0; - + $fp = fopen("$conffile", "w"); if($fp) { @@ -482,34 +482,34 @@ function write_conf_file($conffile) fputs($fp, '$dolibarr_main_url_root="'.$_POST["main_url"].'";'); fputs($fp,"\n"); - + fputs($fp, '$dolibarr_main_document_root="'.$main_dir.'";'); fputs($fp,"\n"); - + fputs($fp, '$dolibarr_main_data_root="'.$main_data_dir.'";'); fputs($fp,"\n"); - + fputs($fp, '$dolibarr_main_db_host="'.$_POST["db_host"].'";'); fputs($fp,"\n"); - + fputs($fp, '$dolibarr_main_db_port="'.$_POST["db_port"].'";'); fputs($fp,"\n"); fputs($fp, '$dolibarr_main_db_name="'.$_POST["db_name"].'";'); fputs($fp,"\n"); - + fputs($fp, '$dolibarr_main_db_user="'.$_POST["db_user"].'";'); fputs($fp,"\n"); - + fputs($fp, '$dolibarr_main_db_pass="'.$_POST["db_pass"].'";'); fputs($fp,"\n"); - + fputs($fp, '$dolibarr_main_db_type="'.$_POST["db_type"].'";'); fputs($fp,"\n"); fputs($fp, '$dolibarr_main_db_character_set="'.$_POST["dolibarr_main_db_character_set"].'";'); fputs($fp,"\n"); - + fputs($fp, '$dolibarr_main_db_collation="'.$_POST["dolibarr_main_db_collation"].'";'); fputs($fp,"\n"); @@ -527,17 +527,17 @@ function write_conf_file($conffile) /* Preparation integration SMARTY */ fputs($fp, '$dolibarr_smarty_libs_dir="";'); fputs($fp,"\n"); - + fputs($fp, '$dolibarr_smarty_compile="";'); fputs($fp,"\n"); fputs($fp, '$dolibarr_smarty_cache="";'); fputs($fp,"\n"); /* Fin Smarty*/ - + fputs($fp, '?>'); fclose($fp); - + if (file_exists("$conffile")) { include("$conffile"); // On force rechargement. Ne pas mettre include_once ! @@ -554,7 +554,7 @@ function write_conf_file($conffile) $error++; } } - + return $error; } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index e80f1551a04..9c079b06104 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -327,8 +327,8 @@ Permission32=Create/modify products/services Permission33=Command products/services Permission34=Delete products/services Permission36=Export products/services -Permission41=Read projects -Permission42=Create/modify projects +Permission41=Read projects and tasks +Permission42=Create/modify projects, edit tasks for my projects Permission44=Delete projects Permission61=Read interventions Permission62=Create/modify interventions diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 20a2cb71570..f33f7586d2e 100755 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -1,6 +1,7 @@ # Dolibarr language file - en_US - projects Project=Project Projects=Projects +SharedProject=Shared project Myprojects=My projects ProjectsArea=Projects area NewProject=New project @@ -30,8 +31,11 @@ NewTask=New task AddTask=Add task AddDuration=Add duration Activity=Activity +Activities=Tasks/activities MyActivity=My activity +MyActivities=My tasks/activities DurationEffective=Effective duration +MyProjects=My projects Time=Time ListProposalsAssociatedProject=Lists of the commercial proposals associated with the project ListOrdersAssociatedProject=Lists of the orders associated with the project @@ -42,4 +46,6 @@ ListContractAssociatedProject=List of contracts associated with the project ActivityOnProjectThisWeek=Activity on project this week ActivityOnProjectThisMonth=Activity on project this month ActivityOnProjectThisYear=Activity on project this year -ChildOfTaks=child of task \ No newline at end of file +ChildOfTaks=Child of project/task +NotOwnerOfProject=Not owner of this private project +AffectedTo=Affected to \ No newline at end of file diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index b5b26ec54f8..68767d9282f 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -326,8 +326,8 @@ Permission32=Cr Permission33=Commander les produits/services Permission34=Supprimer les produits/services Permission36=Exporter les produits/services -Permission41=Consulter les projets -Permission42=Créer/modifier les projets +Permission41=Consulter les projets et tâches +Permission42=Créer/modifier les projets, éditer tâches de mes projets Permission44=Supprimer les projets Permission61=Consulter les interventions Permission62=Créer/modifier les interventions diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index fa801071ba1..e26b44255ee 100755 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -1,6 +1,7 @@ # Dolibarr language file - fr_FR - projects Project=Projet Projects=Projets +SharedProject=Projet partagé Myprojects=Mes projets ProjectsArea=Espace projet NewProject=Nouveau projet @@ -30,7 +31,10 @@ NewTask=Nouvelle t AddTask=Créer tâche AddDuration=Ajouter la durée Activity=Activité +Activities=Tâches/activités MyActivity=Mon activité +MyActivities=Mes tâches/activités +MyProjects=Mes projets DurationEffective=Durée effective Time=Temps ListProposalsAssociatedProject=Liste des propositions commerciales associées au projet @@ -42,4 +46,6 @@ ListContractAssociatedProject=Liste des contrats associ ActivityOnProjectThisWeek=Activité sur les projets cette semaine ActivityOnProjectThisMonth=Activité sur les projets ce mois ActivityOnProjectThisYear=Activité sur les projets cette année -ChildOfTaks=fille de la tache \ No newline at end of file +ChildOfTaks=Fille du projet/tâche +NotOwnerOfProject=Non responsable de ce projet privé +AffectedTo=Affecté à \ No newline at end of file diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 1c6de18a1c1..d570b858be6 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -125,7 +125,7 @@ function dol_string_unaccent($str) OOOOOUUUY aaaaaceeee 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")); return $string; } @@ -185,7 +185,7 @@ function dol_syslog($message, $level=LOG_INFO) // If adding log inside HTML page is required 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 @@ -395,7 +395,7 @@ function dol_print_date($time,$format='',$to_gmt=false,$outputlangs='') // If date undefined or "", we return "" if (strlen($time) == 0) return ''; // $time=0 allowed (it means 01/01/1970 00:00:00) - + // Analyse de la date (deprecated) 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) { if (empty($url)) return ''; - + $link='agenda->enabled && $user->rights->agenda->myactions->create) { $type='AC_EMAIL'; @@ -718,7 +718,7 @@ function dol_print_email($email,$cid=0,$socid=0,$addlink=0,$max=64) $newemail='
'.$newemail.'  '.$link.'
'; } } - + 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=" ") { global $conf,$user,$langs; - + // Clean phone parameter $phone = ereg_replace("[ .-]","",trim($phone)); 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); } } - + if (! empty($addlink)) { if ($conf->clicktodial->enabled) { 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; $url = sprintf($urlmask, urlencode($phone), urlencode($user->clicktodial_poste), urlencode($user->clicktodial_login), urlencode($user->clicktodial_password)); $newphone='
'.$newphone.''; @@ -806,7 +806,7 @@ function dol_print_phone($phone,$country="FR",$cid=0,$socid=0,$addlink=0,$separ= function dol_strlen($string,$stringencoding='') { global $langs; - + if (empty($stringencoding)) $stringencoding=$langs->charset_output; $ret=''; @@ -833,7 +833,7 @@ function dol_strlen($string,$stringencoding='') function dol_substr($string,$start,$length,$stringencoding='') { global $langs; - + if (empty($stringencoding)) $stringencoding=$langs->charset_output; $ret=''; @@ -1101,8 +1101,8 @@ function img_delete($alt = "default") /** * \brief Affiche logo help avec curseur "?" - * \param usehelpcursor - * \param usealttitle + * \param usehelpcursor + * \param usealttitle * \return string Retourne tag img */ function img_help($usehelpcursor=1,$usealttitle=1) @@ -1111,7 +1111,7 @@ function img_help($usehelpcursor=1,$usealttitle=1) $s ='theme.'/img/info.png" border="0"'; - if ($usealttitle) + if ($usealttitle) { if (is_string($usealttitle)) $s.=' alt="'.$usealttitle.'" title="'.$usealttitle.'"'; 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 { print $langs->trans("DolibarrHasDetectedError").".
\n"; - 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.
\n"; + 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.
\n"; print $langs->trans("InformationToHelpDiagnose").":

\n"; print "".$langs->trans("Dolibarr").": ".DOL_VERSION."
\n";; @@ -1612,7 +1612,7 @@ function dol_print_error($db='',$error='') if ($error) { $langs->load("errors"); - + if (is_array($error)) $errors=$error; else $errors=array($error); @@ -1630,7 +1630,7 @@ function dol_print_error($db='',$error='') $syslog.=", msg=".$msg; } } - + 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 options ("" par defaut) * \param td options de l'attribut td ("" par defaut) - * \param sortfield nom du champ sur lequel est effectue le tri du tableau + * \param sortfield field currently used to sort * \param sortorder ordre du tri */ function print_liste_field_titre($name, $file, $field, $begin="", $options="", $td="", $sortfield="", $sortorder="") @@ -1727,7 +1727,7 @@ function print_liste_field_titre($name, $file, $field, $begin="", $options="", $ // Le champ de tri est mis en evidence. // Exemple si (sortfield,field)=("nom","xxx.nom") ou (sortfield,field)=("nom","nom") - if ($sortfield == $field || $sortfield == ereg_replace("^[^\.]+\.","",$field)) + if ($field && ($sortfield == $field || $sortfield == ereg_replace("^[^\.]+\.","",$field))) { print '
'; } @@ -1829,7 +1829,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so } print ''; - + $pagelist = ''; // Left @@ -2109,17 +2109,17 @@ function price2num($amount,$rounding='',$alreadysqlnb=-1) // 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 { - //print 'ZZ'.$nbofdec.'=>'.$amount.'
'; - + //print 'ZZ'.$nbofdec.'=>'.$amount.'
'; + // 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. - if (is_numeric($amount)) + if (is_numeric($amount)) { $nbofdec=max(0,strlen($amount-intval($amount))-2); $amount=number_format($amount,$nbofdec,$dec,$thousand); } //print "QQ".$amount.'
'; - + // Now make replace (the main goal of function) if ($thousand != ',' && $thousand != '.') $amount=str_replace(',','.',$amount); // To accept 2 notations for french users $amount=str_replace(' ','',$amount); // To avoid spaces @@ -2133,12 +2133,12 @@ function price2num($amount,$rounding='',$alreadysqlnb=-1) $nbofdectoround=''; if ($rounding == 'MU') $nbofdectoround=$conf->global->MAIN_MAX_DECIMALS_UNIT; 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 if (strlen($nbofdectoround)) $amount = round($amount,$nbofdectoround); // $nbofdectoround can be 0. else return 'ErrorBadParameterProvidedToFunction'; - //print 'ZZ'.$nbofdec.'-'.$nbofdectoround.'=>'.$amount.'
'; - + //print 'ZZ'.$nbofdec.'-'.$nbofdectoround.'=>'.$amount.'
'; + // 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. 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($dec,'.',$amount); } - + return $amount; } @@ -2384,7 +2384,7 @@ function clean_url($url,$http=1) //print $url." -> ".$proto." - ".$domain." - ".$port; //$url = dol_string_nospecial(trim($url)); $url = trim($url); - + // Si http: defini on supprime le http (Si https on ne supprime pas) $newproto=$proto; if ($http==0) diff --git a/htdocs/lib/project.lib.php b/htdocs/lib/project.lib.php index 61f2a68b161..ed18c860c93 100644 --- a/htdocs/lib/project.lib.php +++ b/htdocs/lib/project.lib.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2006-2009 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,12 +18,11 @@ */ /** - \file htdocs/lib/project.lib.php - \brief Ensemble de fonctions de base pour le module projet - \ingroup societe - \version $Id$ -*/ - + * \file htdocs/lib/project.lib.php + * \brief Ensemble de fonctions de base pour le module projet + * \ingroup societe + * \version $Id$ + */ function project_prepare_head($objsoc) { global $langs, $conf, $user; @@ -58,12 +57,39 @@ function project_prepare_head($objsoc) /** - \brief Affiche la liste d�roulante des projets d'une soci�t� donn�e - \param socid Id soci�t� - \param selected Id projet pr�-s�lectionn� - \param htmlname Nom de la zone html - \return int Nbre de projet si ok, <0 si ko -*/ + * \file htdocs/lib/project.lib.php + * \brief Ensemble de fonctions de base pour le module projet + * \ingroup societe + * \version $Id$ + */ +function task_prepare_head($object) +{ + global $langs, $conf, $user; + $h = 0; + $head = array(); + + $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/task.php?id='.$object->id; + $head[$h][1] = $langs->trans("TimeSpent"); + $head[$h][2] = 'tasks'; + $h++; + + $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/who.php?id='.$object->id; + $head[$h][1] = $langs->trans("Affectations"); + $head[$h][2] = 'who'; + $h++; + + return $head; +} + + + +/** + * \brief Show a combo list with projects qualified for a third party) + * \param socid Id third party + * \param selected Id project preselected + * \param htmlname Nom de la zone html + * \return int Nbre de projet si ok, <0 si ko + */ function select_projects($socid, $selected='', $htmlname='projectid') { global $db; @@ -109,4 +135,195 @@ function select_projects($socid, $selected='', $htmlname='projectid') } } + + +function PLinesb(&$inc, $parent, $lines, &$level, $tasksrole) +{ + global $user, $bc, $langs; + global $form; + + $projectstatic = new Project($db); + + $var=true; + + for ($i = 0 ; $i < sizeof($lines) ; $i++) + { + if ($parent == 0) + $level = 0; + + if ($lines[$i]->fk_parent == $parent) + { + $var = !$var; + print "\n"; + + print ""; + + print ""; + + print "\n"; + + $heure = intval($lines[$i]->duration); + $minutes = round((($lines[$i]->duration - $heure) * 60),0); + $minutes = substr("00"."$minutes", -2); + + print '\n"; + + if ($tasksrole[$lines[$i]->id] == 'admin') + { + print ''; + print "'; + } + else + { + print ''; + } + print "\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 "\n"; + + if ($showproject) + { + print ""; + } + + print ""; + + print "\n"; + + $heure = intval($lines[$i]->duration); + $minutes = round((($lines[$i]->duration - $heure) * 60),0); + $minutes = substr("00"."$minutes", -2); + + print '\n"; + + print "\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; +} + ?> \ No newline at end of file diff --git a/htdocs/project.class.php b/htdocs/project.class.php index 2f77b801072..774b63136f0 100644 --- a/htdocs/project.class.php +++ b/htdocs/project.class.php @@ -19,18 +19,17 @@ */ /** - \file htdocs/project.class.php - \ingroup projet - \brief Fichier de la classe de gestion des projets - \version $Id$ -*/ - + * \file htdocs/project.class.php + * \ingroup projet + * \brief Fichier de la classe de gestion des projets + * \version $Id$ + */ require_once(DOL_DOCUMENT_ROOT ."/commonobject.class.php"); /** - \class Project - \brief Classe permettant la gestion des projets -*/ + * \class Project + * \brief Class to manage projects + */ class Project extends CommonObject { var $db; //!< To store db handler @@ -47,9 +46,9 @@ class Project extends CommonObject /** - * \brief Constructeur de la classe - * \param DB handler acc�s base de donn�es - */ + * \brief Constructeur de la classe + * \param DB handler acc�s base de donn�es + */ function Project($DB) { $this->db = $DB; @@ -57,10 +56,10 @@ class Project extends CommonObject } /* - * \brief Cree un projet en base - * \param user Id utilisateur qui cree - * \return int <0 si ko, id du projet cree si ok - */ + * \brief Cree un projet en base + * \param user Id utilisateur qui cree + * \return int <0 si ko, id du projet cree si ok + */ function create($user) { // Check parameters @@ -176,10 +175,10 @@ class Project extends CommonObject } /** - * \brief Return list of projects - * \param id_societe To filter on a particular third party - * \return array Liste of projects - */ + * \brief Return list of projects + * \param id_societe To filter on a particular third party + * \return array Liste of projects + */ function liste_array($id_societe='') { $projets = array(); @@ -216,10 +215,10 @@ class Project extends CommonObject } /** - * \brief Return list of elements for type linked to project - * \param type 'propal','order','invoice','order_supplier','invoice_supplier' - * \return array List of orders linked to project, <0 if error - */ + * \brief Return list of elements for type linked to project + * \param type 'propal','order','invoice','order_supplier','invoice_supplier' + * \return array List of orders linked to project, <0 if error + */ function get_element_list($type) { $elements = array(); @@ -262,9 +261,9 @@ class Project extends CommonObject } /** - * \brief Supprime le projet dans la base - * \param Utilisateur - */ + * \brief Supprime le projet dans la base + * \param Utilisateur + */ function delete($user) { @@ -283,51 +282,71 @@ class Project extends CommonObject } /** - * \brief Create a task into project - * \param user Id user that create - * \param title Title of task - * \param parent Id task parent - */ - function CreateTask($user, $title, $parent = 0) + * \brief Create a task into project + * \param user Id user that create + * \param title Title of task + * \param parent Id task parent + * \param id_resp Id of responsible user + * \return int Task id if succes, <0 if KO + */ + function CreateTask($user, $title, $parent=0, $id_resp=0) { $result = 0; + $task_id = -1; + if (trim($title)) { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task (fk_projet, title, fk_user_creat, fk_task_parent, duration_effective)"; - $sql.= " VALUES (".$this->id.",'$title', ".$user->id.",".$parent.", 0)"; + $this->db->begin(); - dolibarr_syslog("Project::CreateTask sql=".$sql,LOG_DEBUG); - if ($this->db->query($sql) ) + $sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task (fk_projet, title, fk_user_creat, fk_task_parent, duration_effective)"; + $sql.= " VALUES (".$this->id.",'".addslashes($title)."', ".$user->id.",".($parent>0?$parent:'0').", 0)"; + + dolibarr_syslog("Project::CreateTask sql=".$sql, LOG_DEBUG); + if ($this->db->query($sql)) { $task_id = $this->db->last_insert_id(MAIN_DB_PREFIX."projet_task"); - $result = 0; + $result = $task_id; } else { - $this->error=$this->db->error(); - dolibarr_syslog("Project::CreateTask error -2 ".$this->error,LOG_ERR); - $result = -2; + $this->error=$this->db->lasterror(); + dolibarr_syslog("Project::CreateTask error -1 ".$this->error, LOG_ERR); + $result = -1; } - if ($result == 0) + if ($result >= 0) { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task_actors (fk_projet_task, fk_user)"; - $sql.= " VALUES (".$task_id.",".$user->id.")"; - - dolibarr_syslog("Project::CreateTask sql=".$sql,LOG_DEBUG); - if ($this->db->query($sql) ) + if ($id_resp > 0) { - $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 { - $this->error=$this->db->error(); - dolibarr_syslog("Project::CreateTask error -3 ".$this->error,LOG_ERR); - $result = -2; + $this->db->commit(); + return $task_id; } } - - + else + { + dolibarr_syslog("Project::CreateTask error -2 ".$this->error,LOG_ERR); + $this->db->rollback(); + return -2; + } } else { @@ -340,11 +359,11 @@ class Project extends CommonObject /** - * \brief Cree une tache dans le projet - * \param user Id utilisateur qui cree - * \param title titre de la tache - * \param parent tache parente - */ + * \brief Cree une tache dans le projet + * \param user Id utilisateur qui cree + * \param title titre de la tache + * \param parent tache parente + */ function TaskAddTime($user, $task, $time, $date) { $result = 0; @@ -424,31 +443,39 @@ class Project extends CommonObject } /** - * Return list of task for project - * @param user Object user to limit task affected to a particular user - * - * @return unknown + * Return list of task for all projects or a particular project + * Sort order is on project, TODO then of position of task, and last on title of first level task + * @param usert Object user to limit task affected to a particular user + * @param userp Object user to limit projects of a particular user + * @return array Array of tasks */ - function getTasksArray($user=0) + function getTasksArray($usert=0,$userp=0) { $tasks = array(); - /* List of tasks */ + //print $usert.'-'.$userp; + + // List of tasks $sql = "SELECT p.rowid as projectid, p.ref, p.title as ptitle,"; - $sql.= " t.rowid, t.title, t.fk_task_parent, t.duration_effective"; - $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; - if (is_object($user)) + $sql.= " t.rowid, t.title, t.fk_task_parent, t.duration_effective,"; + $sql.= " up.name, up.firstname"; + $sql.= " FROM (".MAIN_DB_PREFIX."projet as p"; + if (is_object($usert)) // Limit to task affected to a user { $sql.= ", ".MAIN_DB_PREFIX."projet_task as t"; $sql.= ", ".MAIN_DB_PREFIX."projet_task_actors as ta"; + $sql.= ")"; } else { + $sql.= ")"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid"; } - $sql.=" WHERE 1 = 1"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as up on p.fk_user_resp = up.rowid"; + $sql.= " WHERE 1 = 1"; if ($this->id) $sql .= " AND t.fk_projet =".$this->id; - if (is_object($user)) $sql .= " AND t.fk_projet = p.rowid AND ta.fk_projet_task = t.rowid AND ta.fk_user =".$user->id; + if (is_object($usert)) $sql .= " AND t.fk_projet = p.rowid AND ta.fk_projet_task = t.rowid AND ta.fk_user = ".$usert->id; + if (is_object($userp)) $sql .= " AND (p.fk_user_resp = ".$userp->id." OR p.fk_user_resp IS NULL OR p.fk_user_resp = -1)"; $sql.= " ORDER BY p.ref, t.title"; dolibarr_syslog("Project::getTasksArray sql=".$sql, LOG_DEBUG); @@ -463,10 +490,12 @@ class Project extends CommonObject $tasks[$i]->projectid = $obj->projectid; $tasks[$i]->projectref = $obj->ref; $tasks[$i]->projectlabel = $obj->title; - $tasks[$i]->id = $obj->rowid; - $tasks[$i]->title = $obj->title; - $tasks[$i]->fk_parent = $obj->fk_task_parent; - $tasks[$i]->duration = $obj->duration_effective; + $tasks[$i]->id = $obj->rowid; + $tasks[$i]->title = $obj->title; + $tasks[$i]->fk_parent = $obj->fk_task_parent; + $tasks[$i]->duration = $obj->duration_effective; + $tasks[$i]->name = $obj->name; + $tasks[$i]->firstname = $obj->firstname; $i++; } $this->db->free(); @@ -479,6 +508,7 @@ class Project extends CommonObject return $tasks; } + /** * \brief Renvoie nom clicable (avec eventuellement le picto) * \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index bfd3d35e3e6..dc2b72eed70 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2006-2008 Laurent Destailleur + * Copyright (C) 2006-2009 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,11 +18,11 @@ */ /** - \file htdocs/projet/activity/myactivity.php - \ingroup projet - \brief Page activite perso du module projet - \version $Id$ -*/ + \file htdocs/projet/activity/myactivity.php + \ingroup projet + \brief Page activite perso du module projet + \version $Id$ + */ require("./pre.inc.php"); @@ -31,9 +31,9 @@ $mode=$_REQUEST["mode"]; // Security check 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"); @@ -43,10 +43,12 @@ $langs->load("projects"); * View */ -$now = time(); +$now = gmmktime(); -if ($mode == 'mine') $title=$langs->trans("MyActivity"); -else $title=$langs->trans("Activity"); +$projectstatic=new Project($db); + +if ($mode == 'mine') $title=$langs->trans("MyActivities"); +else $title=$langs->trans("Activities"); llxHeader("",$title); @@ -55,18 +57,13 @@ print_fiche_titre($title); print '
"; + $projectstatic->id=$lines[$i]->projectid; + $projectstatic->ref=$lines[$i]->projectref; + print $projectstatic->getNomUrl(1); + print "".$lines[$i]->id.""; + + for ($k = 0 ; $k < $level ; $k++) + { + print "   "; + } + + print ''.$lines[$i]->title."'.$heure." h ".$minutes."'; + print ''; + print ' '; + print '"; + print $form->select_date('',$lines[$i]->id,'','','',"addtime"); + print ' 
"; + $projectstatic->id=$lines[$i]->projectid; + $projectstatic->ref=$lines[$i]->projectref; + print $projectstatic->getNomUrl(1); + print "".$lines[$i]->id.""; + for ($k = 0 ; $k < $level ; $k++) + { + print "   "; + } + + print ''.$lines[$i]->title."'.$heure." h ".$minutes."
'; print ''; print ''; print "\n"; -$sql = "SELECT p.title, p.rowid, sum(tt.task_duration)"; +$sql = "SELECT p.rowid, p.ref, p.title, sum(tt.task_duration) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql .= " , ".MAIN_DB_PREFIX."projet_task as t"; $sql .= " , ".MAIN_DB_PREFIX."projet_task_time as tt"; @@ -131,26 +132,30 @@ $total=0; $resql = $db->query($sql); if ( $resql ) { - while ($row = $db->fetch_row($resql)) - { - $var=!$var; - print ""; - print ''; - print ''; - print "\n"; - $total += $row[2]; - } - - $db->free($resql); + while ($row = $db->fetch_object($resql)) + { + $var=!$var; + print ""; + print ''; + print ''; + print "\n"; + $total += $row->nb; + } + + $db->free($resql); } else { - dolibarr_print_error($db); + dolibarr_print_error($db); } print ''; print ''; print ''; -print "\n"; +print "\n"; print "
'; -/* - * - * Affichage de la liste des projets - * - */ print ''; print ''; -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 ''; print "\n"; -$sql = "SELECT p.title, p.rowid, count(t.rowid)"; +$sql = "SELECT p.rowid, p.ref, p.title, count(t.rowid) as nb"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."projet as p,"; $sql .= " ".MAIN_DB_PREFIX."projet_task as t"; @@ -75,8 +72,8 @@ if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFI $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 ($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 pta.fk_user = ".$user->id; @@ -86,26 +83,30 @@ $var=true; $resql = $db->query($sql); if ( $resql ) { - $num = $db->num_rows($resql); - $i = 0; + $num = $db->num_rows($resql); + $i = 0; - while ($i < $num) - { - $row = $db->fetch_row( $resql); - $var=!$var; - print ""; - print ''; - print ''; - print "\n"; - - $i++; - } - - $db->free($resql); + while ($i < $num) + { + $row = $db->fetch_object($resql); + $var=!$var; + print ""; + print ''; + print ''; + print "\n"; + + $i++; + } + + $db->free($resql); } else { - dolibarr_print_error($db); + dolibarr_print_error($db); } print "
'.$langs->trans("NbOpenTasks").'
'.$row[0].''.$row[2].'
'; + $projectstatic->id=$row->rowid; + $projectstatic->ref=$row->ref; + print $projectstatic->getNomUrl(1); + print ''.$row->nb.'
"; @@ -116,7 +117,7 @@ print '
'.$langs->trans('Today').''.$langs->trans("Time").'
'.$row[0].''.$row[2].'
'; + $projectstatic->id=$row->rowid; + $projectstatic->ref=$row->ref; + print $projectstatic->getNomUrl(1); + print ''.$row->nb.'
'.$langs->trans('Total').''.$total.'
"; /* Affichage de la liste des projets d'hier */ @@ -160,7 +165,7 @@ print '
'.$langs->trans('Yesterday').''.$langs->trans("Time").'
'.$row[0].''.$row[2].'
'; + $projectstatic->id=$row->rowid; + $projectstatic->ref=$row->ref; + print $projectstatic->getNomUrl(1); + print ''.$row->nb.'
'.$langs->trans('Total').''.$langs->trans("ActivityOnProjectThisWeek").''.$langs->trans("Time").'
'.$row[0].''.$row[2].'
'; + $projectstatic->id=$row->rowid; + $projectstatic->ref=$row->ref; + print $projectstatic->getNomUrl(1); + print ''.$row->nb.'
'.$langs->trans('Total').''.$langs->trans("ActivityOnProjectThisMonth").': '.strftime("%B %Y", print ''.$langs->trans("Time").'
'.$row[0].''.$row[2].'
'; + $projectstatic->id=$row->rowid; + $projectstatic->ref=$row->ref; + print $projectstatic->getNomUrl(1); + print ''.$row->nb.'
"; @@ -286,7 +303,7 @@ print ''.$langs->trans("ActivityOnProjectThisYear").': '.strftime("%Y", $now print ''.$langs->trans("Time").''; print "\n"; -$sql = "SELECT p.title, p.rowid, sum(tt.task_duration)"; +$sql = "SELECT p.rowid, p.ref, p.title, sum(tt.task_duration) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql .= " , ".MAIN_DB_PREFIX."projet_task as t"; $sql .= " , ".MAIN_DB_PREFIX."projet_task_time as tt"; @@ -300,19 +317,23 @@ $var=false; $resql = $db->query($sql); if ( $resql ) { - while ($row = $db->fetch_row($resql)) - { - print ""; - print ''.$row[0].''; - print ''.$row[2].''; - print "\n"; - $var=!$var; - } - $db->free($resql); + while ($row = $db->fetch_object($resql)) + { + print ""; + print ''; + $projectstatic->id=$row->rowid; + $projectstatic->ref=$row->ref; + print $projectstatic->getNomUrl(1); + print ''; + print ''.$row->nb.''; + print "\n"; + $var=!$var; + } + $db->free($resql); } else { - dolibarr_print_error($db); + dolibarr_print_error($db); } print ""; diff --git a/htdocs/projet/activity/list.php b/htdocs/projet/activity/list.php index 637f5b63a57..aa0e0532a72 100644 --- a/htdocs/projet/activity/list.php +++ b/htdocs/projet/activity/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2007 Regis Houssin * * 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=price2num($post); - + $id = ereg_replace("task","",$key); $task=new Task($db); @@ -76,7 +76,7 @@ if ($_POST["action"] == 'addtime' && $user->rights->projet->creer) $project = new Project($db); $result = $project->fetch($task->fk_projet); - + $date = dolibarr_mktime(12,0,0,$_POST["$id"."month"],$_POST["$id"."day"],$_POST["$id"."year"]); $project->TaskAddTime($user, $id , $post, $date); } @@ -118,7 +118,8 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorde if ($mesg) print $mesg; $tasksrole=$projet->getTasksRoleForUser($user); -$tasksarray=$projet->getTasksArray(); +$tasksarray=$projet->getTasksArray(0,0); +//var_dump($tasksarray); print '
'; print ''; @@ -131,7 +132,7 @@ print ''.$langs->trans("LabelTask").''; print ''.$langs->trans("TimeSpent").''; print ''.$langs->trans("AddDuration").''; print "\n"; -PLines($j, 0, $tasksarray, $level, $tasksrole); +PLinesb($j, 0, $tasksarray, $level, $tasksrole); print '
'; @@ -141,75 +142,4 @@ print ''; $db->close(); llxFooter('$Date$ - $Revision$'); - - -function PLines(&$inc, $parent, $lines, &$level, $tasksrole) -{ - global $user, $bc, $langs; - global $form; - - $projectstatic = new Project($db); - - $var=true; - - for ($i = 0 ; $i < sizeof($lines) ; $i++) - { - if ($parent == 0) - $level = 0; - - if ($lines[$i]->fk_parent == $parent) - { - $var = !$var; - print "\n"; - - print ""; - $projectstatic->id=$lines[$i]->projectid; - $projectstatic->ref=$lines[$i]->projectref; - print $projectstatic->getNomUrl(1); - print ""; - - print "".$lines[$i]->id.""; - - print ""; - - for ($k = 0 ; $k < $level ; $k++) - { - print "   "; - } - - print ''.$lines[$i]->title."\n"; - - $heure = intval($lines[$i]->duration); - $minutes = round((($lines[$i]->duration - $heure) * 60),0); - $minutes = substr("00"."$minutes", -2); - - print ''.$heure." h ".$minutes."\n"; - - if ($tasksrole[$lines[$i]->id] == 'admin') - { - print ''; - print ''; - print ' '; - print ''; - print ""; - print $form->select_date('',$lines[$i]->id,'','','',"addtime"); - print ''; - } - else - { - print ' '; - } - print "\n"; - $inc++; - $level++; - if ($lines[$i]->id) PLines($inc, $lines[$i]->id, $lines, $level, $tasksrole); - $level--; - } - else - { - //$level--; - } - } -} - ?> diff --git a/htdocs/projet/activity/pre.inc.php b/htdocs/projet/activity/pre.inc.php index 38eebf82946..23e37735717 100644 --- a/htdocs/projet/activity/pre.inc.php +++ b/htdocs/projet/activity/pre.inc.php @@ -17,11 +17,11 @@ */ /** - \file htdocs/projet/activity/pre.inc.php - \ingroup projet - \brief Fichier de gestion du menu gauche du module projet - \version $Id$ -*/ + * \file htdocs/projet/activity/pre.inc.php + * \ingroup projet + * \brief Fichier de gestion du menu gauche du module projet + * \version $Id$ + */ require ("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/project.class.php"); @@ -39,25 +39,31 @@ $langs->load("companies"); */ 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_submenu(DOL_URL_ROOT."/projet/fiche.php?leftmenu=projects&action=create", $langs->trans("NewProject"), 1, $user->rights->projet->creer); $menu->add_submenu(DOL_URL_ROOT."/projet/liste.php?leftmenu=projects", $langs->trans("List"), 1, $user->rights->projet->lire); - $menu->add(DOL_URL_ROOT."/projet/tasks/index.php", $langs->trans("Tasks"), 0, $user->rights->projet->lire); + $menu->add(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/index.php?mode=mine", $langs->trans("MyTasks"), 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/tasks/index.php", $langs->trans("List"), 1, $user->rights->projet->lire); $menu->add_submenu(DOL_URL_ROOT."/projet/activity/list.php", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer); - $menu->add_submenu(DOL_URL_ROOT."/projet/activity/index.php?mode=mine", $langs->trans("MyTimeSpent"), 1, $user->rights->projet->lire); - 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); } ?> diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 288a8bb6073..3dd6fe43c02 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -64,6 +64,10 @@ $form = new Form($db); $projet = new Project($db); $projet->fetch($_GET["id"],$_GET["ref"]); $projet->societe->fetch($projet->societe->id); +if ($projet->user_resp_id > 0) +{ + $result=$projet->fetch_user($projet->user_resp_id); +} $head=project_prepare_head($projet); dolibarr_fiche_head($head, 'element', $langs->trans("Project")); @@ -75,13 +79,19 @@ print ''.$langs->trans("Ref").''; print $form->showrefnav($projet,'ref','',1,'ref','ref'); print ''; -print ''.$langs->trans("Label").''.$projet->title.''; +print ''.$langs->trans("Label").''.$projet->title.''; print ''.$langs->trans("Company").''; if (! empty($projet->societe->id)) print $projet->societe->getNomUrl(1); else print ' '; print ''; +// Project leader +print ''.$langs->trans("OfficerProject").''; +if ($projet->user->id) print $projet->user->getNomUrl(1); +else print $langs->trans('SharedProject'); +print ''; + print ''; print ''; diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php index f8616fb560b..03ca41e5bcd 100644 --- a/htdocs/projet/fiche.php +++ b/htdocs/projet/fiche.php @@ -145,7 +145,7 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer) print_fiche_titre($langs->trans("NewProject")); if ($mesg) print $mesg.'
'; - + print '
'; //if ($_REQUEST["socid"]) print ''; print ''; @@ -165,7 +165,15 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer) // Responsable du projet print ''; print ''; @@ -180,10 +188,14 @@ else */ if ($mesg) print $mesg; - + $projet = new Project($db); $projet->fetch($_GET["id"],$_GET["ref"]); $projet->societe->fetch($projet->societe->id); + if ($projet->user_resp_id > 0) + { + $result=$projet->fetch_user($projet->user_resp_id); + } $head=project_prepare_head($projet); dolibarr_fiche_head($head, 'project', $langs->trans("Project")); @@ -224,31 +236,26 @@ else } else { - if ($projet->user_resp_id > 0) - { - $result=$projet->fetch_user($projet->user_resp_id); - } - print '
'.$langs->trans("OfficerProject").''; - $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 ''; + } print '
'; - + // Ref print ''; - + // Label print ''; - + // Third party print ''; - + // Project leader print ''; print '
'.$langs->trans("Ref").''; print $html->showrefnav($projet,'ref','',1,'ref','ref'); print '
'.$langs->trans("Label").''.$projet->title.'
'.$langs->trans("Company").''; if ($projet->societe->id > 0) print $projet->societe->getNomUrl(1); else print' '; print '
'.$langs->trans("OfficerProject").''; if ($projet->user->id) print $projet->user->getNomUrl(1); - else print ' '; + else print $langs->trans('SharedProject'); print '
'; diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index dc2e2f2f02e..159a99241a5 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -31,7 +31,7 @@ $langs->load("projects"); if (!$user->rights->projet->lire) accessforbidden(); // Security check -if ($user->societe_id > 0) +if ($user->societe_id > 0) { $socid = $user->societe_id; } @@ -43,19 +43,16 @@ if ($user->societe_id > 0) llxHeader("",$langs->trans("Projects"),"Projet"); -print_fiche_titre($langs->trans("ProjectsArea")); +$text=$langs->trans("Projects"); +if ($_REQUEST["mode"]=='mine') $text=$langs->trans("MyProjects"); +print_fiche_titre($text); print ''; print '
'; -/* - * - * Affichage de la liste des projets - * - */ print ''; print ''; -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 ''; print "\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'était en commentaire ? => Si on laisse ce lien, les projet sans taches se retrouvent invisibles $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t ON p.rowid = t.fk_projet"; $sql.= " WHERE 1 = 1"; +if ($_REQUEST["mode"]=='mine') $sql.=' AND p.fk_user_resp='.$user->id; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) -{ - $sql .= " AND p.fk_soc = ".$socid; +{ + $sql .= " AND p.fk_soc = ".$socid; } $sql.= " GROUP BY p.rowid"; @@ -78,36 +76,32 @@ $var=true; $resql = $db->query($sql); if ( $resql ) { - $num = $db->num_rows($resql); - $i = 0; + $num = $db->num_rows($resql); + $i = 0; - while ($i < $num) - { - $row = $db->fetch_row( $resql); - $var=!$var; - print ""; - print ''; - print ''; - print "\n"; - - $i++; - } - - $db->free($resql); + while ($i < $num) + { + $row = $db->fetch_row( $resql); + $var=!$var; + print ""; + print ''; + print ''; + print "\n"; + + $i++; + } + + $db->free($resql); } else { - dolibarr_print_error($db); + dolibarr_print_error($db); } print "
'.$langs->trans("NbOpenTasks").'
'.img_object($langs->trans("ShowProject"),"project")." ".$row[0].''.$row[2].'
'.img_object($langs->trans("ShowProject"),"project")." ".$row[0].''.$row[2].'
"; print '
'; -/* - * - * Affichage de la liste des projets - * - */ + print ''; print ''; 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"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE p.fk_soc = s.rowid"; +if ($_REQUEST["mode"]=='mine') $sql.=' AND p.fk_user_resp='.$user->id; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) -{ - $sql .= " AND s.rowid = ".$socid; +{ + $sql .= " AND s.rowid = ".$socid; } $sql .= " GROUP BY s.nom"; //$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset); @@ -131,26 +126,26 @@ $var=true; $resql = $db->query($sql); if ( $resql ) { - $num = $db->num_rows($resql); - $i = 0; + $num = $db->num_rows($resql); + $i = 0; - while ($i < $num) - { - $row = $db->fetch_row( $resql); - $var=!$var; - print ""; - print ''; - print ''; - print "\n"; - - $i++; - } - - $db->free($resql); + while ($i < $num) + { + $row = $db->fetch_row( $resql); + $var=!$var; + print ""; + print ''; + print ''; + print "\n"; + + $i++; + } + + $db->free($resql); } else { - dolibarr_print_error($db); + dolibarr_print_error($db); } print "
'.img_object($langs->trans("ShowCompany"),"company")." ".$row[0].''.$row[2].'
'.img_object($langs->trans("ShowCompany"),"company")." ".$row[0].''.$row[2].'
"; @@ -158,5 +153,5 @@ print '
'; $db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/projet/liste.php b/htdocs/projet/liste.php index 571307a560f..fc6180e7421 100644 --- a/htdocs/projet/liste.php +++ b/htdocs/projet/liste.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005 Marc Bariley / Ocebo * Copyright (C) 2005-2006 Regis Houssin * @@ -20,11 +20,11 @@ */ /** - \file htdocs/projet/liste.php - \ingroup projet - \brief Page liste des projets - \version $Id$ -*/ + * \file htdocs/projet/liste.php + * \ingroup projet + * \brief Page liste des projets + * \version $Id$ + */ require("./pre.inc.php"); @@ -39,9 +39,9 @@ if ($user->societe_id > 0) $socid = $user->societe_id; if ($socid > 0) { - $soc = new Societe($db); - $soc->fetch($socid); - $title .= ' ('.$soc->nom.')'; + $soc = new Societe($db); + $soc->fetch($socid); + $title .= ' ('.$soc->nom.')'; } @@ -65,31 +65,34 @@ $pagenext = $page + 1; llxHeader(); +$projectstatic = new Project($db); +$userstatic = new User($db); $staticsoc=new Societe($db); -$sql = "SELECT p.rowid as projectid, p.ref, p.title, ".$db->pdate("p.dateo")." as do"; -$sql .= ", s.nom, s.rowid as socid, s.client"; +$sql = "SELECT p.rowid as projectid, p.ref, p.title, ".$db->pdate("p.dateo")." as do, p.fk_user_resp,"; +$sql .= " s.nom, s.rowid as socid, s.client"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user"; $sql .= " FROM (".MAIN_DB_PREFIX."projet as p"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= ") LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = p.fk_soc"; $sql .= " WHERE 1 = 1 "; +if ($_REQUEST["mode"]=='mine') $sql.=' AND p.fk_user_resp='.$user->id; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) { - $sql .= " AND s.rowid = ".$socid; + $sql .= " AND s.rowid = ".$socid; } 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"]) { - $sql .= " AND p.title LIKE '%".addslashes($_GET["search_label"])."%'"; + $sql .= " AND p.title LIKE '%".addslashes($_GET["search_label"])."%'"; } 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); @@ -97,67 +100,88 @@ $var=true; $resql = $db->query($sql); if ($resql) { - $num = $db->num_rows($resql); - $i = 0; + $num = $db->num_rows($resql); + $i = 0; - print_barre_liste($langs->trans("ProjectsList"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num); + $text=$langs->trans("Projects"); + if ($_REQUEST["mode"]=='mine') $text=$langs->trans('MyProjects'); + print_barre_liste($text, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num); - print ''; - print ''; - print_liste_field_titre($langs->trans("Ref"),"liste.php","p.ref","","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"),"liste.php","p.title","","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"),"liste.php","s.nom","","","",$sortfield,$sortorder); - print ''; - print "\n"; + print '
 
'; + print ''; + print_liste_field_titre($langs->trans("Ref"),"liste.php","p.ref","","","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Label"),"liste.php","p.title","","","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Company"),"liste.php","s.nom","","","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("OfficerProject"),"liste.php","","","","",$sortfield,$sortorder); + print ''; + print "\n"; - print ''; - print ''; - print ''; - print ''; - print ''; - print '"; - print "\n"; - - while ($i < $num) - { - $objp = $db->fetch_object($resql); - $var=!$var; - print ""; - print "\n"; - print "\n"; - - // Company - print ''; + print ''; + print ''; + print ''; + print ''; + print '"; + print "\n"; - print ''; - print "\n"; + while ($i < $num) + { + $objp = $db->fetch_object($resql); + $var=!$var; + print ""; - $i++; - } + print ""; - $db->free($resql); + // Title + print ''; + + // Company + print ''; + + // Title + $userstatic->id=$objp->fk_user_resp; + $userstatic->nom=$objp->fk_user_resp; + print ''; + + print ''; + print "\n"; + + $i++; + } + + $db->free($resql); } else { - dolibarr_print_error($db); + dolibarr_print_error($db); } print "
 
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "
projectid\">".img_object($langs->trans("ShowProject"),"project")." ".$objp->ref."projectid\">".$objp->title."'; - if ($objp->socid) - { - $staticsoc->id=$objp->socid; - $staticsoc->nom=$objp->nom; - print $staticsoc->getNomUrl(1); - } - else - { - print ' '; - } + print ''; + print '
'; + print ''; print ''; + print ''; + print ''; + print ''; + print ' '; + print "
 
"; + $projectstatic->id=$objp->projectid; + $projectstatic->ref=$objp->ref; + print $projectstatic->getNomUrl(1); + print "'; + print dolibarr_trunc($objp->title,24); + print ''; + if ($objp->socid) + { + $staticsoc->id=$objp->socid; + $staticsoc->nom=$objp->nom; + print $staticsoc->getNomUrl(1); + } + else + { + print ' '; + } + print ''; + if ($objp->fk_user_resp > 0) print $userstatic->getNomUrl(1); + else print $langs->trans("SharedProject"); + print ' 
"; @@ -166,5 +190,4 @@ $db->close(); llxFooter('$Date$ - $Revision$'); - ?> diff --git a/htdocs/projet/pre.inc.php b/htdocs/projet/pre.inc.php index 5a681c51f5f..76021b88454 100644 --- a/htdocs/projet/pre.inc.php +++ b/htdocs/projet/pre.inc.php @@ -18,11 +18,11 @@ */ /** - \file htdocs/projet/pre.inc.php - \ingroup projet - \brief Fichier de gestion du menu gauche du module projet - \version $Id$ -*/ + * \file htdocs/projet/pre.inc.php + * \ingroup projet + * \brief Fichier de gestion du menu gauche du module projet + * \version $Id$ + */ require ("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/project.class.php"); @@ -42,24 +42,31 @@ $langs->load("commercial"); */ 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_submenu(DOL_URL_ROOT."/projet/fiche.php?leftmenu=projects&action=create", $langs->trans("NewProject"), 1, $user->rights->projet->creer); $menu->add_submenu(DOL_URL_ROOT."/projet/liste.php?leftmenu=projects", $langs->trans("List"), 1, $user->rights->projet->lire); - $menu->add(DOL_URL_ROOT."/projet/tasks/index.php", $langs->trans("Tasks"), 0, $user->rights->projet->lire); + $menu->add(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/index.php?mode=mine", $langs->trans("MyTasks"), 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/tasks/index.php", $langs->trans("List"), 1, $user->rights->projet->lire); $menu->add_submenu(DOL_URL_ROOT."/projet/activity/list.php", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer); - $menu->add_submenu(DOL_URL_ROOT."/projet/activity/index.php?mode=mine", $langs->trans("MyTimeSpent"), 1, $user->rights->projet->lire); - 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); } ?> diff --git a/htdocs/projet/tasks/fiche.php b/htdocs/projet/tasks/fiche.php index 0f392b963fe..a94c329087c 100644 --- a/htdocs/projet/tasks/fiche.php +++ b/htdocs/projet/tasks/fiche.php @@ -27,6 +27,8 @@ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/project.class.php"); +require_once(DOL_DOCUMENT_ROOT."/html.formother.class.php"); $projetid=''; $projetid=isset($_REQUEST["id"])?$_REQUEST["id"]:$_POST["projetid"]; @@ -61,7 +63,7 @@ if ($_POST["action"] == 'createtask' && empty($_POST["cancel"]) && $user->rights $project = new Project($db); $result = $project->fetch($projectid); - $result=$project->CreateTask($user, $_POST["task_name"], $task_parent); + $result=$project->CreateTask($user, $_POST["task_name"], $task_parent, $_POST["userid"]); } if (! $error) @@ -115,6 +117,7 @@ if ($_POST["action"] == 'addtime' && $user->rights->projet->creer) */ $form=new Form($db); +$htmlother=new FormOther($db); llxHeader("",$langs->trans("Tasks"),"Tasks"); @@ -125,15 +128,14 @@ $ref= $_GET['ref']; if ($id > 0 || ! empty($ref)) { $projet->fetch($_REQUEST["id"],$_GET["ref"]); - $projet->societe->fetch($projet->societe->id); + if ($projet->societe->id > 0) $result=$projet->societe->fetch($projet->societe->id); + if ($projet->user_resp_id > 0) $result=$projet->fetch_user($projet->user_resp_id); } if ($_GET["action"] == 'create' && $user->rights->projet->creer) { print_fiche_titre($langs->trans("NewTask")); - $tasksarray=$projet->getTasksArray(); - if ($mesg) print '
'.$mesg.'
'; print ''; @@ -143,22 +145,19 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer) print ''; - print ''; - print ''; + + print ''; + + print ''; print ''; - print ''; - //print ''; print ''; - $tasksarray=$projet->getTasksArray($_REQUEST["mode"]=='mine'?$user:0); + // Project leader + print ''; print '
'.$langs->trans("NewTask").''; - print ' '; - if ($tasksarray) - { - print '   '.$langs->trans("ChildOfTaks").'   '; - - print ''; - } + print '
'.$langs->trans("NewTask").''; + print ''; print '
'; + print '
'.$langs->trans("ChildOfTaks").''; + print $htmlother->selectProjectTasks($projet->id, 'task_parent', 1, 0); + print '
'.$langs->trans("AffectedTo").''; + print $form->select_users($user->id,'userid',1); + print '
'; print ''; print '     '; print ''; @@ -194,14 +193,18 @@ else print '
'.$langs->trans("Label").''.$projet->title.'
'.$langs->trans("Company").''; + + print '
'.$langs->trans("Company").''; if (! empty($projet->societe->id)) print $projet->societe->getNomUrl(1); else print ' '; print ' 
'.$langs->trans("OfficerProject").''; + if ($projet->user->id) print $projet->user->getNomUrl(1); + else print $langs->trans('SharedProject'); + print '
'; @@ -211,6 +214,9 @@ else print ''; + $tasksarray=$projet->getTasksArray($_REQUEST["mode"]=='mine'?$user:0, 0); + + /* * Actions */ @@ -218,7 +224,14 @@ else if ($user->rights->projet->creer) { - print ''.$langs->trans('AddTask').''; + if (empty($projet->user_resp_id) || $projet->user_resp_id == -1 || $projet->user_resp_id == $user->id) + { + print ''.$langs->trans('AddTask').''; + } + else + { + print ''.$langs->trans('AddTask').''; + } } print ''; @@ -226,136 +239,23 @@ else print '
'; print ''; print ''; - print ''; + if ($projectstatic->id) print ''; print ''; print ''; print ''; print "\n"; $j=0; - PLines($j, 0, $tasksarray, $level, true); + $nboftaskshown=PLines($j, 0, $tasksarray, $level, true, 0); print "
'.$langs->trans("Project").''.$langs->trans("Project").''.$langs->trans("RefTask").''.$langs->trans("LabelTask").''.$langs->trans("TimeSpent").'
"; print ''; + if ($nboftaskshown < sizeof($tasksarray)) + { + clean_orphelins($db); + } } $db->close(); llxFooter('$Date$ - $Revision$'); - - - -// TODO Same function PLines than in fiche.php -function PLines(&$inc, $parent, $lines, &$level, $var) -{ - global $user, $bc, $langs; - - $lastprojectid=0; - - $projectstatic = new Project($db); - - for ($i = 0 ; $i < sizeof($lines) ; $i++) - { - if ($parent == 0) $level = 0; - - if ($lines[$i]->fk_parent == $parent) - { - // Break on a new project - if ($parent == 0 && $lines[$i]->projectid != $lastprojectid) - { - $var = !$var; - $lastprojectid=$lines[$i]->projectid; - } - - print "\n"; - - print ""; - $projectstatic->id=$lines[$i]->projectid; - $projectstatic->ref=$lines[$i]->projectref; - print $projectstatic->getNomUrl(1); - print ""; - - print "".$lines[$i]->id.""; - - print ""; - for ($k = 0 ; $k < $level ; $k++) - { - print "   "; - } - - print ''.$lines[$i]->title."\n"; - - $heure = intval($lines[$i]->duration); - $minutes = round((($lines[$i]->duration - $heure) * 60),0); - $minutes = substr("00"."$minutes", -2); - - print ''.$heure." h ".$minutes."\n"; - - print "\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 '\n"; - - $lastprojectid=$lines[$i]->projectid; - $inc++; - } - - print '\n"; - - $inc++; - - $level++; - if ($lines[$i]->id) PLineSelect($inc, $lines[$i]->id, $lines, $level); - $level--; - } - } -} - ?> diff --git a/htdocs/projet/tasks/index.php b/htdocs/projet/tasks/index.php index 46e33c7e1b6..713d1ea43ca 100644 --- a/htdocs/projet/tasks/index.php +++ b/htdocs/projet/tasks/index.php @@ -25,6 +25,7 @@ */ require("./pre.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php"); $mode=$_REQUEST["mode"]; @@ -86,7 +87,7 @@ print ''; print ''; print ''; print ''; -print ''; +print ''; print ''; print "\n"; @@ -110,67 +111,4 @@ print ''; $db->close(); llxFooter('$Date$ - $Revision$'); - - -// TODO Same function PLines than in fiche.php -function PLines(&$inc, $parent, $lines, &$level, $var) -{ - global $user, $bc, $langs; - - $lastprojectid=0; - - $projectstatic = new Project($db); - - for ($i = 0 ; $i < sizeof($lines) ; $i++) - { - if ($parent == 0) $level = 0; - - if ($lines[$i]->fk_parent == $parent) - { - // Break on a new project - if ($parent == 0 && $lines[$i]->projectid != $lastprojectid) - { - $var = !$var; - $lastprojectid=$lines[$i]->projectid; - } - - print "\n"; - - print ""; - - print ""; - - print "\n"; - - $heure = intval($lines[$i]->duration); - $minutes = round((($lines[$i]->duration - $heure) * 60),0); - $minutes = substr("00"."$minutes", -2); - - print '\n"; - - print "\n"; - - $inc++; - - $level++; - if ($lines[$i]->id) PLines($inc, $lines[$i]->id, $lines, $level, $var); - $level--; - } - else - { - //$level--; - } - } -} - ?> diff --git a/htdocs/projet/tasks/pre.inc.php b/htdocs/projet/tasks/pre.inc.php index 28c3ceb5272..2c88ac7a421 100644 --- a/htdocs/projet/tasks/pre.inc.php +++ b/htdocs/projet/tasks/pre.inc.php @@ -17,11 +17,11 @@ */ /** - \file htdocs/projet/tasks/pre.inc.php - \ingroup projet - \brief Fichier de gestion du menu gauche du module projet - \version $Id$ -*/ + * \file htdocs/projet/tasks/pre.inc.php + * \ingroup projet + * \brief Fichier de gestion du menu gauche du module projet + * \version $Id$ + */ require ("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/project.class.php"); require_once(DOL_DOCUMENT_ROOT."/task.class.php"); @@ -38,25 +38,32 @@ $langs->load("companies"); */ 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_submenu(DOL_URL_ROOT."/projet/fiche.php?leftmenu=projects&action=create", $langs->trans("NewProject"), 1, $user->rights->projet->creer); $menu->add_submenu(DOL_URL_ROOT."/projet/liste.php?leftmenu=projects", $langs->trans("List"), 1, $user->rights->projet->lire); - $menu->add(DOL_URL_ROOT."/projet/tasks/index.php", $langs->trans("Tasks"), 0, $user->rights->projet->lire); + $menu->add(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/index.php?mode=mine", $langs->trans("MyTasks"), 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/tasks/index.php", $langs->trans("List"), 1, $user->rights->projet->lire); $menu->add_submenu(DOL_URL_ROOT."/projet/activity/list.php", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer); - $menu->add_submenu(DOL_URL_ROOT."/projet/activity/index.php?mode=mine", $langs->trans("MyTimeSpent"), 1, $user->rights->projet->lire); - 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); } ?> diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 6b51a7679fb..fbe1c3556ae 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -84,22 +84,18 @@ if ($_GET["id"] > 0) $result=$projet->fetch($task->fk_projet); if (! empty($projet->socid)) $projet->societe->fetch($projet->socid); - $h=0; - $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/task.php?id='.$task->id; - $head[$h][1] = $langs->trans("Tasks"); - $head[$h][2] = 'tasks'; - $h++; + $head=task_prepare_head($task); - dolibarr_fiche_head($head, 'tasks', $langs->trans("Tasks")); + dolibarr_fiche_head($head, 'tasks', $langs->trans("Task")); if ($mesg) print $mesg.'
'; - + if ($_GET["action"] == 'delete') { $html->form_confirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteATask"),$langs->trans("ConfirmDeleteATask"),"confirm_delete"); print "
"; } - + print ''; print ''; print '
'.$langs->trans("Project").''.$langs->trans("Task").' '.$langs->trans("Label").''.$langs->trans("TimeSpent").'
"; - $projectstatic->id=$lines[$i]->projectid; - $projectstatic->ref=$lines[$i]->projectref; - print $projectstatic->getNomUrl(1); - print "".$lines[$i]->id.""; - for ($k = 0 ; $k < $level ; $k++) - { - print "   "; - } - - print ''.$lines[$i]->title."'.$heure." h ".$minutes."
'; @@ -148,19 +144,19 @@ if ($_GET["id"] > 0) print '
'; print ''; - + /* * Actions */ print '
'; - + if ($user->rights->projet->creer) { print ''.$langs->trans('Delete').''; } - - print '
'; - + + print ''; + print '
'; print ''; print ''; @@ -183,7 +179,7 @@ if ($_GET["id"] > 0) } print "
"; - + } } diff --git a/htdocs/projet/tasks/who.php b/htdocs/projet/tasks/who.php new file mode 100644 index 00000000000..9ec31a82e18 --- /dev/null +++ b/htdocs/projet/tasks/who.php @@ -0,0 +1,161 @@ + + * Copyright (C) 2006-2009 Laurent Destailleur + * + * 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.'
'; + + print '
'; + print ''; + print ''; + + print ''; + print ''; + + print ''; + + print ''; + + + /* 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 '
'.$langs->trans("Ref").''.$task->id.'
'.$langs->trans("Label").''.$task->title.'
'.$langs->trans("Project").''; + print $projet->getNomUrl(1); + print '
'.$langs->trans("Company").''; + if ($projet->societe->id) print $projet->societe->getNomUrl(1); + else print ' '; + print '
'; + print ''; + + + /* + * Actions + */ + print '
'; + + /*if ($user->rights->projet->creer) + { + print ''.$langs->trans('Delete').''; + }*/ + + print '
'; + + + print '
'; + print ''; + print ''; + print ''; + print ''; + print "\n"; + + foreach ($lines as $xxx) + { + $var=!$var; + print ""; + $userstatic->id=$xxx->rowid; + $userstatic->nom=$xxx->login; + print ''; + + print "\n"; + } + + print "
'.$langs->trans("User").'
'.$userstatic->getNomUrl(1).'
"; + + } +} + +$db->close(); + +llxFooter('$Date$ - $Revision$'); +?> diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index ff16145af37..63e94dfdd7f 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -831,7 +831,7 @@ class Propal extends CommonObject else { $this->error=$this->db->error(); - dolibarr_syslog("Propal::Fetch Error ".$this->error, LOG_ERROR); + dolibarr_syslog("Propal::Fetch Error ".$this->error, LOG_ERR); return -1; } diff --git a/mysql/migration/2.1.0-2.2.0.sql b/mysql/migration/2.1.0-2.2.0.sql index a96fe90f72e..6305c4fdab8 100644 --- a/mysql/migration/2.1.0-2.2.0.sql +++ b/mysql/migration/2.1.0-2.2.0.sql @@ -451,7 +451,7 @@ insert into `llx_menu` (`rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titr insert into `llx_menu` (`rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, `right`, `target`, `user`, `order`) values (3601, 'project', '', 3600, '/comm/clients.php?leftmenu=projects', 'NewProject', 1, 'projects', '$user->rights->projet->lire', '', 2, 0); insert into `llx_menu` (`rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, `right`, `target`, `user`, `order`) values (3602, 'project', '', 3600, '/projet/liste.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 1); insert into `llx_menu` (`rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, `right`, `target`, `user`, `order`) values (3700, 'project', '', 7, '/projet/tasks', 'Tasks', 0, 'projects', '$user->rights->projet->lire', '', 2, 1); -insert into `llx_menu` (`rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, `right`, `target`, `user`, `order`) values (3701, 'project', '', 3700, '/projet/tasks/mytasks.php', 'Mytasks', 1, 'projects', '$user->rights->projet->lire', '', 2, 0); +insert into `llx_menu` (`rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, `right`, `target`, `user`, `order`) values (3701, 'project', '', 3700, '/projet/tasks/mytasks.php', 'MyTasks', 1, 'projects', '$user->rights->projet->lire', '', 2, 0); insert into `llx_menu` (`rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, `right`, `target`, `user`, `order`) values (3800, 'project', '', 7, '/projet/activity', 'Activity', 0, 'projects', '$user->rights->projet->lire', '', 2, 2); insert into `llx_menu` (`rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, `right`, `target`, `user`, `order`) values (3801, 'project', '', 3800, '/projet/activity/myactivity.php', 'MyActivity', 1, 'projects', '$user->rights->projet->lire', '', 2, 0); insert into `llx_menu` (`rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, `right`, `target`, `user`, `order`) values (3900, 'tools', '', 8, '/comm/mailing/index.php?leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 0);