From ee144f32c86f702741fa6cd8f5617e2023b388d8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Mar 2008 18:47:42 +0000 Subject: [PATCH] Suite module action/agenda --- htdocs/actioncomm.class.php | 21 +++- htdocs/admin/agenda.php | 119 ++++++++++++++++++ htdocs/admin/events.php | 11 -- htdocs/admin/modules.php | 2 +- htdocs/admin/phenix.php | 7 +- htdocs/admin/webcalendar.php | 16 ++- htdocs/comm/action/index.php | 91 +++++++++++++- htdocs/comm/action/indexactions.php | 32 ++++- htdocs/comm/action/listactions.php | 105 ++++++++++------ htdocs/comm/index.php | 2 +- htdocs/comm/prospect/index.php | 58 +-------- htdocs/html.form.class.php | 15 +-- .../menus/barre_left/eldy_backoffice.php | 33 ++--- .../menus/barre_left/eldy_frontoffice.php | 24 ++-- htdocs/includes/modules/modAgenda.class.php | 10 +- htdocs/includes/modules/modBookmark.class.php | 7 +- htdocs/includes/modules/modBoutique.class.php | 2 +- .../includes/modules/modOSCommerce2.class.php | 2 +- htdocs/includes/modules/modPhenix.class.php | 3 +- ...ace_modWebcalendar_Webcalsynchro.class.php | 3 +- htdocs/langs/en_US/admin.lang | 20 ++- htdocs/langs/en_US/agenda.lang | 16 ++- htdocs/langs/en_US/commercial.lang | 18 +-- htdocs/langs/fr_FR/admin.lang | 16 ++- htdocs/langs/fr_FR/agenda.lang | 16 ++- htdocs/langs/fr_FR/commercial.lang | 20 +-- htdocs/lib/agenda.lib.php | 40 +++--- htdocs/lib/date.lib.php | 66 ++++++++++ htdocs/lib/functions.inc.php | 11 +- mysql/migration/2.2.0-2.4.0.sql | 1 + 30 files changed, 553 insertions(+), 234 deletions(-) create mode 100644 htdocs/admin/agenda.php create mode 100644 htdocs/lib/date.lib.php diff --git a/htdocs/actioncomm.class.php b/htdocs/actioncomm.class.php index 0b90aa1cad1..ff960cad722 100644 --- a/htdocs/actioncomm.class.php +++ b/htdocs/actioncomm.class.php @@ -94,9 +94,17 @@ class ActionComm global $langs,$conf; // Clean parameters + $this->label=trim($this->label); + $this->note=trim($this->note); if (! $this->percentage) $this->percentage = 0; if (! $this->priority) $this->priority = 0; + if ($this->percentage > 100) $this->percentage = 100; if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date; + if ($this->datep && $this->datef) $this->durationp=($this->datef - $this->datep); + if ($this->date && $this->dateend) $this->durationa=($this->dateend - $this->date); + if ($this->datep && $this->datef && $this->datep > $this->datef) $this->datef=$this->datep; + if ($this->date && $this->dateend && $this->date > $this->dateend) $this->dateend=$this->date; + $now=time(); if (! $this->type_id && $this->type_code) { @@ -113,8 +121,6 @@ class ActionComm return -1; } } - if ($this->datep && $this->datef) $this->durationp=($this->datef - $this->datep); - if ($this->date && $this->dateend) $this->durationa=($this->dateend - $this->date); // Check parameters if (! $this->type_id) @@ -300,8 +306,15 @@ class ActionComm // Clean parameters $this->label=trim($this->label); $this->note=trim($this->note); + if (! $this->percentage) $this->percentage = 0; + if (! $this->priority) $this->priority = 0; if ($this->percentage > 100) $this->percentage = 100; - + if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date; + if ($this->datep && $this->datef) $this->durationp=($this->datef - $this->datep); + if ($this->date && $this->dateend) $this->durationa=($this->dateend - $this->date); + if ($this->datep && $this->datef && $this->datep > $this->datef) $this->datef=$this->datep; + if ($this->date && $this->dateend && $this->date > $this->dateend) $this->dateend=$this->date; + // Check parameters if ($this->percentage == 0 && $this->userdone->id > 0) { @@ -313,7 +326,9 @@ class ActionComm $sql.= " SET percent='".$this->percentage."'"; $sql.= ", label = ".($this->label ? "'".addslashes($this->label)."'":"null"); $sql.= ", datep = ".($this->datep ? "'".$this->db->idate($this->datep)."'" : 'null'); + $sql.= ", datep2 = ".($this->datef ? "'".$this->db->idate($this->datef)."'" : 'null'); $sql.= ", datea = ".($this->date ? "'".$this->db->idate($this->date)."'" : 'null'); + $sql.= ", datea2 = ".($this->dateend ? "'".$this->db->idate($this->dateend)."'" : 'null'); $sql.= ", note = ".($this->note ? "'".addslashes($this->note)."'":"null"); $sql.= ", fk_contact =". ($this->contact->id > 0 ? "'".$this->contact->id."'":"null"); $sql.= ", priority = '".$this->priority."'"; diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php new file mode 100644 index 00000000000..41b57cb24c3 --- /dev/null +++ b/htdocs/admin/agenda.php @@ -0,0 +1,119 @@ + + * + * 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/admin/agenda.php + \ingroup agenda + \brief Page de configuration du module agenda + \version $Id$ +*/ + +require("./pre.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); +require_once(DOL_DOCUMENT_ROOT.'/lib/agenda.lib.php'); + + +if (!$user->admin) + accessforbidden(); + + +$langs->load("admin"); +$langs->load("other"); +$langs->load("agenda"); + +$def = array(); +$actionsave=$_POST["save"]; + +// Sauvegardes parametres +if ($actionsave) +{ + $i=0; + + $db->begin(); + + $i+=dolibarr_set_const($db,'MAIN_PASSWORD_VCALEXPORT',trim($_POST["MAIN_PASSWORD_VCALEXPORT"]),'chaine',0); + + if ($i > 0) + { + $db->commit(); + $mesg = "".$langs->trans("SetupSaved").""; + } + else + { + $db->rollback(); + $mesg = "".$langs->trans("SaveFailed").""; + } +} + + + +/** + * Vies + */ + +llxHeader(); + +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'setup'); +print '
'; + + +print '
'; +print ""; + +print ""; +print ""; +print ""; +//print ""; +print ""; +print ""; + +print ""; +print ""; +print ""; +print ""; +print ""; + +print '
".$langs->trans("Parameter")."".$langs->trans("Value")."".$langs->trans("Examples")." 
".$langs->trans("PasswordTogetVCalExport")."global->MAIN_PASSWORD_VCALEXPORT) . "\" size=\"40\"> 
'; + +print '
'; +print "trans("Save")."\">"; +print "
"; + +print "
\n"; + + +clearstatcache(); + +if ($mesg) print "
$mesg
"; +print "
"; + +// Show message +$message=''; +$urlwithouturlroot=eregi_replace(DOL_URL_ROOT.'$','',$dolibarr_main_url_root); +$urlvcal=''.$urlwithouturlroot.DOL_URL_ROOT.'/comm/action/agendaexport.php?format=vcal&exportkey=...'.''; +$message.=$langs->trans("WebCalUrlForVCalExport",'vcal',$urlvcal); +$message.='
'; +$urlical=''.$urlwithouturlroot.DOL_URL_ROOT.'/comm/action/agendaexport.php?format=ical&type=event&exportkey=...'.''; +$message.=$langs->trans("WebCalUrlForVCalExport",'ical',$urlical); +print info_admin($message); + +$db->close(); + +llxFooter('$Date$ - $Revision$'); +?> diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index e948f4bdb2d..ec39d02d6df 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -136,17 +136,6 @@ print ''; if ($mesg) print "
$mesg
"; print "
"; -// Show message -/* -$message=''; -$urlwithouturlroot=eregi_replace(DOL_URL_ROOT.'$','',$dolibarr_main_url_root); -$urlvcal=''.$urlwithouturlroot.DOL_URL_ROOT.'/webcal/webcalexport.php?format=vcal'.''; -$message.=$langs->trans("WebCalUrlForVCalExport",'vcal',$urlvcal); -$message.='
'; -$urlical=''.$urlwithouturlroot.DOL_URL_ROOT.'/webcal/webcalexport.php?format=ical&type=event'.''; -$message.=$langs->trans("WebCalUrlForVCalExport",'ical',$urlical); -print info_admin($message); -*/ $db->close(); diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 9936c54600d..086650f3b7f 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -334,7 +334,7 @@ foreach ($orders as $key => $value) print "\n"; print ' '; print $objMod->picto?img_object('',$objMod->picto):img_object('','generic'); - print ''.$objMod->getName(); + print ''.$objMod->getName(); print "\n "; print nl2br($objMod->getDesc()); print "\n "; diff --git a/htdocs/admin/phenix.php b/htdocs/admin/phenix.php index 8a9aef1df11..4e601683bc8 100644 --- a/htdocs/admin/phenix.php +++ b/htdocs/admin/phenix.php @@ -15,16 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ */ /** \file htdocs/admin/phenix.php \ingroup phenix \brief Page de configuration du module Phenix - \version $Revision$ + \version $Id$ */ require("./pre.inc.php"); @@ -224,7 +221,7 @@ print ""; print ""; print ""; print ""; -if ($conf->societe->enabled) +if ($conf->aganda->enabled) { $var=!$var; print ''; diff --git a/htdocs/admin/webcalendar.php b/htdocs/admin/webcalendar.php index 4e8bf12c6a7..3e60ac9664b 100644 --- a/htdocs/admin/webcalendar.php +++ b/htdocs/admin/webcalendar.php @@ -1,6 +1,6 @@ - * Copyright (C) 2003 �ric Seigne + * Copyright (C) 2003 Eric Seigne * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier @@ -203,15 +203,21 @@ print ''; print ""; +print ""; +print ""; +print ""; +print ""; +print ""; + print "
".$langs->trans("PhenixSyncro")."
'; print ' 
".$langs->trans("PasswordTogetVCalExport")."global->PHPWEBCALENDAR_PASSWORD_VCALEXPORT) . "\" size=\"40\"> 
"; print "
"; $var=true; print ""; print ""; -print ""; +print ""; print ""; -if ($conf->societe->enabled) +if ($conf->agenda->enabled) { $var=!$var; print ''; @@ -305,10 +311,10 @@ print "
"; // Show message $message=''; $urlwithouturlroot=eregi_replace(DOL_URL_ROOT.'$','',$dolibarr_main_url_root); -$urlvcal=''.$urlwithouturlroot.DOL_URL_ROOT.'/webcal/webcalexport.php?format=vcal'.''; +$urlvcal=''.$urlwithouturlroot.DOL_URL_ROOT.'/webcal/webcalexport.php?format=vcal&exportkey=...'.''; $message.=$langs->trans("WebCalUrlForVCalExport",'vcal',$urlvcal); $message.='
'; -$urlical=''.$urlwithouturlroot.DOL_URL_ROOT.'/webcal/webcalexport.php?format=ical&type=event'.''; +$urlical=''.$urlwithouturlroot.DOL_URL_ROOT.'/webcal/webcalexport.php?format=ical&type=event&exportkey=...'.''; $message.=$langs->trans("WebCalUrlForVCalExport",'ical',$urlical); print info_admin($message); diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 3d26c085ea5..c8cd5ca88d3 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -28,6 +28,7 @@ require_once("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/contact.class.php"); require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php"); +require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php"); $page = $_GET["page"]; $sortfield=$_GET["sortfield"]; @@ -45,6 +46,8 @@ if ($user->societe_id > 0) $socid = $user->societe_id; } +$year=isset($_GET["year"])?$_GET["year"]:date("Y"); +$month=isset($_GET["month"])?$_GET["month"]:date("m"); /* @@ -71,10 +74,96 @@ if ($action=='delete_action') llxHeader(); -print $langs->trans("FeatureNotYetAvailable"); +//print $langs->trans("FeatureNotYetAvailable"); +$now=mktime(0,0,0); + +$prev = dol_get_prev_month($month, $year); +$prev_year = $prev['year']; +$prev_month = $prev['month']; + +$next = dol_get_next_month($month, $year); +$next_year = $next['year']; +$next_month = $next['month']; + +$max_day_in_month = date("t",dolibarr_mktime(0,0,0,$month,1,$year)); +$max_day_in_prev_month = date("t",dolibarr_mktime(0,0,0,$prev_month,1,$prev_year)); + +$day = -date("w",dolibarr_mktime(0,0,0,$month,1,$year))+2; +if ($day > 1) $day -= 7; + +// Show navigation bar +$nav ="".img_previous($langs->trans("Previous"))."\n"; +$nav.=" ".dolibarr_print_date(dolibarr_mktime(0,0,0,$month,1,$year),"%b"); +$nav.=" ".$year.""."\n"; +$nav.=" ".img_next($langs->trans("Next"))."\n"; +print_fiche_titre($langs->trans("Calendar"),$nav,''); + +echo '
".$langs->trans("WebCalSyncro")."".$langs->trans("WebCalSyncro")."
'; +echo ' '; +echo ' \n"; +echo ' \n"; +echo ' \n"; +echo ' \n"; +echo ' \n"; +echo ' \n"; +echo ' \n"; +echo " \n"; + +for($iter_week = 0; $iter_week < 6 ; $iter_week++) +{ + echo " \n"; + for($iter_day = 0; $iter_day < 7; $iter_day++) + { + /* Show days before the beginning of the current month + (previous month) */ + if($day <= 0) + { + $style='cal_other_month'; + echo ' \n"; + } + /* Show days of the current month */ + elseif(($day <= $max_day_in_month)) + { + $curtime = dolibarr_mktime (0, 0, 0, $month, $day, $year); + + if ($curtime < $now) + $style='cal_past_month'; + else if($curtime == $now) + $style='cal_today'; + else + $style='cal_current_month'; + + echo ' \n"; + } + /* Show days after the current month (next month) */ + else + { + $style='cal_other_month'; + echo ' \n"; + } + $day++; + } + echo " \n"; +} +echo "
'.$langs->trans("Monday")."'.$langs->trans("Tuesday")."'.$langs->trans("Wednesday")."'.$langs->trans("Thirday")."'.$langs->trans("Friday")."'.$langs->trans("Saturday")."'.$langs->trans("Sunday")."
'; + show_day_events ($db, $max_day_in_prev_month + $day, $prev_month, $prev_year, $style); + echo " '; + show_day_events ($db, $day, $month, $year, $style); + echo " '; + show_day_events ($db, $day - $max_day_in_month, $next_month, $next_year, $style); + echo "
\n"; $db->close(); llxFooter('$Date$ - $Revision$'); + +function show_day_events($db, $day, $month, $year, $style) +{ + print ''; + print ''; + print ''; + print '
'.$day.'
 
'; +} + ?> diff --git a/htdocs/comm/action/indexactions.php b/htdocs/comm/action/indexactions.php index 725468592f0..4b44cd57b62 100644 --- a/htdocs/comm/action/indexactions.php +++ b/htdocs/comm/action/indexactions.php @@ -82,6 +82,7 @@ print ''; print '
'; // Search actions +/* $var=false; print ''; print ''; @@ -90,13 +91,40 @@ print ''; print ''; print "
'; print $langs->trans("Keyword").':

\n"; +*/ + +$var=true; +print '
'; +print ''; +print ''; +// All my actions +$var=!$var; +print ''; +// Actions i asked +$var=!$var; +print ''; +// Actions affected to me +$var=!$var; +print ''; +// Actions done by me +$var=!$var; +print ''; +// All actions of everybody +$var=!$var; +print ''; +print "
'.$langs->trans("Calendar").'
'; +print img_picto('','object_calendar').' '.$langs->trans("AllMyActions").'
      '; +print img_picto('','object_calendar').' '.$langs->trans("MyActionsAsked").'
      '; +print img_picto('','object_calendar').' '.$langs->trans("MyActionsToDo").'
      '; +print img_picto('','object_calendar').' '.$langs->trans("MyActionsDone").'
'; +print img_picto('','object_calendar').' '.$langs->trans("AllActions").'

\n"; print '
'; -show_array_actions_to_do(0); +if ($conf->agenda->enabled) show_array_actions_to_do(10); -show_array_last_actions_done(5); +if ($conf->agenda->enabled) show_array_last_actions_done(10); print '
'; diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 227cd3bbe9c..722b78e3f7d 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -42,6 +42,8 @@ $sortfield = isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"]; $sortorder = isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"]; $page = isset($_GET["page"])?$_GET["page"]:$_POST["page"]; +$status=isset($_GET["status"])?$_GET["status"]:$_POST["status"]; + // Security check $socid = isset($_GET["socid"])?$_GET["socid"]:''; if ($user->societe_id) $socid=$user->societe_id; @@ -49,23 +51,33 @@ $result = restrictedArea($user, 'societe', $socid,''); $canedit=1; if (! $user->rights->agenda->myactions->read) access_forbidden(); -if (! $user->rights->agenda->allactions->read) +if (! $user->rights->agenda->allactions->read) $canedit=0; +if (! $user->rights->agenda->allactions->read || $_GET["filter"]=='mine') { - $canedit=0; - $filtera="on"; - $filtert="on"; - $filterd="on"; + $filtera=$user->id; + $filtert=$user->id; + $filterd=$user->id; } + if ($page == -1) { $page = 0 ; } $limit = $conf->liste_limit; $offset = $limit * $page ; -if (! $sortorder) $sortorder="DESC"; -if (! $sortfield) $sortfield="a.datep"; - -$status=isset($_GET["status"])?$_GET["status"]:$_POST["status"]; +if (! $sortorder) +{ + $sortorder="ASC"; + if ($status == 'todo') $sortorder="DESC"; + if ($status == 'done') $sortorder="DESC"; +} +if (! $sortfield) +{ + $sortfield="a.percent"; + if ($status == 'todo') $sortfield="a.datep"; + if ($status == 'done') $sortfield="a.datea2"; +} llxHeader(); +$form=new Form($db); /* * Affichage liste des actions @@ -73,7 +85,9 @@ llxHeader(); */ $sql = "SELECT s.nom as societe, s.rowid as socid, s.client,"; -$sql.= " a.id,".$db->pdate("a.datep")." as dp, ".$db->pdate("a.datea")." as da, a.fk_contact, a.note, a.label, a.percent as percent,"; +$sql.= " a.id, ".$db->pdate("a.datep")." as dp, ".$db->pdate("a.datep2")." as dp2,"; +$sql.= " ".$db->pdate("a.datea")." as da, ".$db->pdate("a.datea2")." as da2,"; +$sql.= " a.fk_contact, a.note, a.label, a.percent as percent,"; $sql.= " c.code as acode, c.libelle,"; $sql.= " ua.login as loginauthor, ua.rowid as useridauthor,"; $sql.= " ut.login as logintodo, ut.rowid as useridtodo,"; @@ -92,7 +106,7 @@ if ($_GET["type"]) { $sql .= " AND c.id = ".$_GET["type"]; } -if ($_GET["time"] == "today") +if ($_REQUEST["time"] == "today") { $sql .= " AND date_format(a.datep, '%d%m%Y') = ".strftime("%d%m%Y",time()); } @@ -106,12 +120,12 @@ if (!$user->rights->societe->client->voir && !$socid) //restriction } if ($status == 'done') { $sql.= " AND a.percent = 100"; } if ($status == 'todo') { $sql.= " AND a.percent < 100"; } -if ($filtera || $filtert || $filterd) +if ($filtera > 0 || $filtert > 0 || $filterd > 0) { $sql.= " AND ("; - if ($filtera) $sql.= " a.fk_user_author = ".$user->id; - if ($filtert) $sql.= ($filtera?" OR ":"")." a.fk_user_action = ".$user->id; - if ($filterd) $sql.= ($filtera||$filtert?" OR ":"")." a.fk_user_done = ".$user->id; + if ($filtera > 0) $sql.= " a.fk_user_author = ".$filtera; + if ($filtert > 0) $sql.= ($filtera>0?" OR ":"")." a.fk_user_action = ".$filtert; + if ($filterd > 0) $sql.= ($filtera>0||$filtert>0?" OR ":"")." a.fk_user_done = ".$filterd; $sql.= ")"; } $sql .= " ORDER BY ".$sortfield." ".$sortorder; @@ -142,28 +156,45 @@ if ($resql) print_barre_liste($langs->trans($title), $page, "index.php",$param,$sortfield,$sortorder,'',$num); } - print '
'; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print '
'; - print $langs->trans("Filter"); - print ' '; - print $langs->trans("MyActionsAsked"); - print ' '; - print $langs->trans("MyActionsToDo"); - print ' '; - print $langs->trans("MyActionsDone"); - print ''; - print ''; - print '
'; - print '

'; + //print '
'; + + if ($canedit) + { + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + print '
'; + //print ' '; + print $langs->trans("ActionsAskedBy"); + print ''; + print $form->select_users($filtera,'userasked',1,'',!$canedit); + print ''; + print ''; + print '
'; + //print ' '; + print $langs->trans("ActionsToDoBy"); + print ''; + print $form->select_users($filtert,'usertodo',1,'',!$canedit); + print '
'; + //print ' '; + print $langs->trans("ActionsDoneBy"); + print ''; + print $form->select_users($filterd,'userdone',1,'',!$canedit); + print '
'; + print '

'; + } $i = 0; @@ -171,7 +202,7 @@ if ($resql) print ''; print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"acode",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("DatePlanShort"),$_SERVER["PHP_SELF"],"a.datep",$param,'','',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateRealShort"),$_SERVER["PHP_SELF"],"a.datea",$param,'','',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DateRealShort"),$_SERVER["PHP_SELF"],"a.datea2",$param,'','',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"a.label",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Contact"),$_SERVER["PHP_SELF"],"a.fk_contact",$param,"","",$sortfield,$sortorder); @@ -205,7 +236,7 @@ if ($resql) print ''; print ''; - print dolibarr_print_date($obj->da,"day"); + print dolibarr_print_date($obj->da2,"day"); print ''; // Titre diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 91bc562f213..73239e5edbe 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -283,7 +283,7 @@ print ''; * Actions to do * */ -show_array_actions_to_do(0); +show_array_actions_to_do(10); /* diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index cec367c0854..a925f27cd35 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -16,19 +16,17 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ */ /** \file htdocs/comm/prospect/index.php \ingroup commercial \brief Page accueil de la zone prospection - \version $Revision$ + \version $Id$ */ require("./pre.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/lib/agenda.lib.php"); $langs->load("propal"); @@ -160,57 +158,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire) */ print ''; -if ($conf->agenda->enabled) -{ - $sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, a.fk_user_author, a.percent,"; - $sql.= " c.code, c.libelle,"; - $sql.= " s.nom as sname, s.rowid"; - if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; - $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE c.id = a.fk_action AND a.percent < 100 AND s.rowid = a.fk_soc AND a.fk_user_action = ".$user->id; - if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - $sql .= " ORDER BY a.datea DESC"; - - $resql=$db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - if ($num > 0) - { - $var=true; - - print ''; - print ''; - print ''; - print "\n"; - - $i = 0; - while ($i < $num ) - { - $obj = $db->fetch_object($resql); - $var=!$var; - - print ""; - - // Action - $transcode=$langs->trans("Action".$obj->code); - $libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle); - print ''; - - // Tiers - print ''; - $i++; - } - print "
'.$langs->trans("ActionsToDo").'
".dolibarr_print_date($obj->da)."".img_object($langs->trans("ShowAction"),"task").' '.$libelle.''.img_object($langs->trans("ShowCompany"),"company").' '.$obj->sname.'

"; - } - $db->free($resql); - } - else - { - dolibarr_print_error($db); - } -} +if ($conf->agenda->enabled) show_array_actions_to_do(10); /* * Dernieres propales ouvertes diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index ca385ac2e92..be7c006c896 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -790,13 +790,14 @@ class Form /** - * \brief Retourne la liste déroulante des utilisateurs - * \param selected Id contact pré-sélectionné - * \param htmlname Nom champ formulaire - * \param show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue - * \param exclude Liste des id utilisateurs à exclure + * \brief Retourne la liste déroulante des utilisateurs + * \param selected Id user preselected + * \param htmlname Field name in form + * \param show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue + * \param disabled If select list must be disabled + * \param exclude Liste des id utilisateurs à exclure */ - function select_users($selected='',$htmlname='userid',$show_empty=0,$exclude='') + function select_users($selected='',$htmlname='userid',$show_empty=0,$exclude='',$disabled=0) { // Permettre l'exclusion d'utilisateurs if (is_array($exclude)) @@ -813,7 +814,7 @@ class Form dolibarr_syslog("Form::select_users sql=".$sql); if ($this->db->query($sql)) { - print ''; if ($show_empty) print ''."\n"; $num = $this->db->num_rows(); $i = 0; diff --git a/htdocs/includes/menus/barre_left/eldy_backoffice.php b/htdocs/includes/menus/barre_left/eldy_backoffice.php index dbbafd9385b..d0e55580034 100644 --- a/htdocs/includes/menus/barre_left/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_backoffice.php @@ -271,12 +271,14 @@ class MenuLeft { $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/indexactions.php?leftmenu=agenda", $langs->trans("Actions"), 0, $user->rights->agenda->myactions->read); $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/fiche.php?leftmenu=agenda&action=create", $langs->trans("NewAction"), 1, $user->rights->agenda->myactions->read); $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda", $langs->trans("List"), 1, $user->rights->agenda->myactions->read); - //$newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=todo&filter=mine", $langs->trans("MenuToDoMyActions"),2, $user->rights->agenda->myactions->read); - //$newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=done&filter=mine", $langs->trans("MenuDoneMyActions"),2, $user->rights->agenda->myactions->read); - $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=todo", $langs->trans("MenuToDoActions"),2, $user->rights->agenda->myactions->read); - $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=done", $langs->trans("MenuDoneActions"),2, $user->rights->agenda->myactions->read); - $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&time=today", $langs->trans("Today"), 2, $user->rights->agenda->myactions->read); - $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/rapport/index.php?leftmenu=agenda", $langs->trans("Reportings"), 1, $user->rights->agenda->myactions->read); + $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=todo&filter=mine", $langs->trans("MenuToDoMyActions"),2, $user->rights->agenda->myactions->read); + $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=done&filter=mine", $langs->trans("MenuDoneMyActions"),2, $user->rights->agenda->myactions->read); + if ($user->rights->agenda->allactions->read) + { + $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=todo", $langs->trans("MenuToDoActions"),2, $user->rights->agenda->allactions->read); + $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=done", $langs->trans("MenuDoneActions"),2, $user->rights->agenda->allactions->read); + } + $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/rapport/index.php?leftmenu=agenda", $langs->trans("Reportings"), 1, $user->rights->agenda->allactions->read); } // Prospects @@ -720,22 +722,21 @@ class MenuLeft { { $langs->load("agenda"); - // Calendar - $newmenu->add(DOL_URL_ROOT."/comm/action/index.php?leftmenu=agenda", $langs->trans("Calendar"), 0, $user->rights->agenda->myactions->read); - // Actions $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/indexactions.php?leftmenu=agenda", $langs->trans("Actions"), 0, $user->rights->agenda->myactions->read); $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/fiche.php?leftmenu=agenda&action=create", $langs->trans("NewAction"), 1, $user->rights->agenda->myactions->read); $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda", $langs->trans("List"), 1, $user->rights->agenda->myactions->read); - //$newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=todo&filter=mine", $langs->trans("MenuToDoMyActions"),2, $user->rights->agenda->myactions->read); - //$newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=done&filter=mine", $langs->trans("MenuDoneMyActions"),2, $user->rights->agenda->myactions->read); - $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=todo", $langs->trans("MenuToDoActions"),2, $user->rights->agenda->myactions->read); - $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=done", $langs->trans("MenuDoneActions"),2, $user->rights->agenda->myactions->read); - $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&time=today", $langs->trans("Today"), 2, $user->rights->agenda->myactions->read); + $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=todo&filter=mine", $langs->trans("MenuToDoMyActions"),2, $user->rights->agenda->myactions->read); + $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=done&filter=mine", $langs->trans("MenuDoneMyActions"),2, $user->rights->agenda->myactions->read); + if ($user->rights->agenda->allactions->read) + { + $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=todo", $langs->trans("MenuToDoActions"),2, $user->rights->agenda->allactions->read); + $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=done", $langs->trans("MenuDoneActions"),2, $user->rights->agenda->allactions->read); + } $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/rapport/index.php?leftmenu=agenda", $langs->trans("Reportings"), 1, $user->rights->agenda->myactions->read); - // Events - $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listevents.php?leftmenu=agenda", $langs->trans("Events"), 0, $user->rights->agenda->events->read); + // Calendar + $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/index.php?leftmenu=agenda", $langs->trans("Calendar"), 0, $user->rights->agenda->allactions->read); } } diff --git a/htdocs/includes/menus/barre_left/eldy_frontoffice.php b/htdocs/includes/menus/barre_left/eldy_frontoffice.php index 044dc5fa920..0bc158a81eb 100644 --- a/htdocs/includes/menus/barre_left/eldy_frontoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_frontoffice.php @@ -252,12 +252,14 @@ class MenuLeft { $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/indexactions.php?leftmenu=agenda", $langs->trans("Actions"), 0, $user->rights->agenda->myactions->read); $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/fiche.php?leftmenu=agenda&action=create", $langs->trans("NewAction"), 1, $user->rights->agenda->myactions->read); $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda", $langs->trans("List"), 1, $user->rights->agenda->myactions->read); - //$newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=todo&filter=mine", $langs->trans("MenuToDoMyActions"),2, $user->rights->agenda->myactions->read); - //$newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=done&filter=mine", $langs->trans("MenuDoneMyActions"),2, $user->rights->agenda->myactions->read); - $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=todo", $langs->trans("MenuToDoActions"),2, $user->rights->agenda->myactions->read); - $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=done", $langs->trans("MenuDoneActions"),2, $user->rights->agenda->myactions->read); - $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&time=today", $langs->trans("Today"), 2, $user->rights->agenda->myactions->read); - $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/rapport/index.php?leftmenu=agenda", $langs->trans("Reportings"), 1, $user->rights->agenda->myactions->read); + $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=todo&filter=mine", $langs->trans("MenuToDoMyActions"),2, $user->rights->agenda->myactions->read); + $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=done&filter=mine", $langs->trans("MenuDoneMyActions"),2, $user->rights->agenda->myactions->read); + if ($user->rights->agenda->myactions->read) + { + $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=todo", $langs->trans("MenuToDoActions"),2, $user->rights->agenda->allactions->read); + $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=done", $langs->trans("MenuDoneActions"),2, $user->rights->agenda->allactions->read); + } + $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/rapport/index.php?leftmenu=agenda", $langs->trans("Reportings"), 1, $user->rights->agenda->allactions->read); } // Prospects @@ -692,20 +694,18 @@ class MenuLeft { { $langs->load("agenda"); - // Calendar - $newmenu->add(DOL_URL_ROOT."/comm/action/index.php?leftmenu=agenda", $langs->trans("Calendar"), 0, $user->rights->agenda->myactions->read); - // Actions $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/indexactions.php?leftmenu=agenda", $langs->trans("Actions"), 0, $user->rights->agenda->myactions->read); $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/fiche.php?leftmenu=agenda&action=create", $langs->trans("NewAction"), 1, $user->rights->agenda->myactions->read); $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda", $langs->trans("List"), 1, $user->rights->agenda->myactions->read); + //$newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=todo&filter=mine", $langs->trans("MenuToDoMyActions"),2, $user->rights->agenda->myactions->read); + //$newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=done&filter=mine", $langs->trans("MenuDoneMyActions"),2, $user->rights->agenda->myactions->read); $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=todo", $langs->trans("MenuToDoActions"),2, $user->rights->agenda->myactions->read); $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&status=done", $langs->trans("MenuDoneActions"),2, $user->rights->agenda->myactions->read); - $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listactions.php?leftmenu=agenda&time=today", $langs->trans("Today"), 2, $user->rights->agenda->myactions->read); $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/rapport/index.php?leftmenu=agenda", $langs->trans("Reportings"), 1, $user->rights->agenda->myactions->read); - // Events - $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/listevents.php?leftmenu=agenda", $langs->trans("Events"), 0, $user->rights->agenda->events->read); + // Calendar + $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/index.php?leftmenu=agenda", $langs->trans("Calendar"), 0, $user->rights->agenda->allactions->read); } } */ diff --git a/htdocs/includes/modules/modAgenda.class.php b/htdocs/includes/modules/modAgenda.class.php index c44a3f1041c..dfaa5432876 100644 --- a/htdocs/includes/modules/modAgenda.class.php +++ b/htdocs/includes/modules/modAgenda.class.php @@ -67,7 +67,7 @@ class modAgenda extends DolibarrModules // Config pages //------------- - $this->config_page_url = array(); + $this->config_page_url = array("agenda.php"); // Dependances //------------ @@ -130,14 +130,6 @@ class modAgenda extends DolibarrModules $this->rights[$r][5] = 'create'; $r++; - $this->rights[$r][0] = 2410; - $this->rights[$r][1] = 'Read Dolibarr audit events'; - $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'events'; - $this->rights[$r][5] = 'read'; - $r++; - // Menus //------ $r=0; diff --git a/htdocs/includes/modules/modBookmark.class.php b/htdocs/includes/modules/modBookmark.class.php index 958f6299bfb..2ea04d83023 100644 --- a/htdocs/includes/modules/modBookmark.class.php +++ b/htdocs/includes/modules/modBookmark.class.php @@ -15,13 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** \defgroup bookmark Module Bookmark \brief Module pour g�rer les Bookmarks + \version $Id$ */ /** @@ -50,14 +49,14 @@ class modBookmark extends DolibarrModules $this->db = $DB ; $this->numero = 330; - $this->family = "technic"; + $this->family = "other"; $this->name = "Bookmarks"; $this->description = "Gestion des Bookmarks"; $this->revision = explode(' ','$Revision$'); $this->version = $this->revision[1]; $this->const_name = 'MAIN_MODULE_BOOKMARK'; - $this->special = 0; + $this->special = 2; $this->picto='bookmark'; // Dir diff --git a/htdocs/includes/modules/modBoutique.class.php b/htdocs/includes/modules/modBoutique.class.php index 8c9cda45294..cb3f2f77686 100644 --- a/htdocs/includes/modules/modBoutique.class.php +++ b/htdocs/includes/modules/modBoutique.class.php @@ -51,7 +51,7 @@ class modBoutique extends DolibarrModules $this->numero = 800; $this->family = "products"; - $this->name = "OSCommerce 1"; + $this->name = "OSCommerce direct"; $this->description = "Interface de visualisation d'une boutique OSCommerce"; $this->version = 'experimental'; // 'experimental' or 'dolibarr' or version $this->const_name = 'MAIN_MODULE_BOUTIQUE'; diff --git a/htdocs/includes/modules/modOSCommerce2.class.php b/htdocs/includes/modules/modOSCommerce2.class.php index 781d0e9c849..c12e90b047c 100644 --- a/htdocs/includes/modules/modOSCommerce2.class.php +++ b/htdocs/includes/modules/modOSCommerce2.class.php @@ -52,7 +52,7 @@ class modOSCommerce2 extends DolibarrModules $this->numero = 900; $this->family = "products"; - $this->name = "OSCommerce 2"; + $this->name = "OSCommerce by WS"; $this->description = "Interface de visualisation d'une boutique OSCommerce via des Web services.\nCe module requiert d'installer les composants dans /oscommerce_ws/ws_server sur OSCommerce. Voir fichier README dans /oscommerce_ws/ws_server"; $this->version = 'experimental'; // 'development' or 'experimental' or 'dolibarr' or version $this->const_name = 'MAIN_MODULE_OSCOMMERCEWS'; diff --git a/htdocs/includes/modules/modPhenix.class.php b/htdocs/includes/modules/modPhenix.class.php index f91ad5e3170..a5762a25f5d 100644 --- a/htdocs/includes/modules/modPhenix.class.php +++ b/htdocs/includes/modules/modPhenix.class.php @@ -14,13 +14,12 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** \defgroup phenix Module Phenix \brief Module to include Phenix into Dolibarr and add Dolibarr events directly inside a Phenix database. + \version $Id$ */ /** diff --git a/htdocs/includes/triggers/interface_modWebcalendar_Webcalsynchro.class.php b/htdocs/includes/triggers/interface_modWebcalendar_Webcalsynchro.class.php index f1053a30306..7247ecb635d 100644 --- a/htdocs/includes/triggers/interface_modWebcalendar_Webcalsynchro.class.php +++ b/htdocs/includes/triggers/interface_modWebcalendar_Webcalsynchro.class.php @@ -14,14 +14,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** \file htdocs/includes/triggers/interface_modWebcalendar_webcalsynchro.class.php \ingroup webcalendar \brief Fichier de gestion des triggers webcalendar + \version $Id$ */ include_once(DOL_DOCUMENT_ROOT.'/webcal/webcal.class.php'); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 39ae151fd56..b528d3f7392 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -171,7 +171,7 @@ ModuleFamilyProducts=Products Management ModuleFamilyHr=Human Ressource Management ModuleFamilyProjects=Projects/Collaborative work ModuleFamilyOther=Other -ModuleFamilyTechnic=Tools or System Modules +ModuleFamilyTechnic=Tools mutli-modules ModuleFamilyExperimental=Experimental modules ModuleFamilyFinancial=Financial Modules (Accountancy/Treasury) ModuleFamilyECM=ECM @@ -260,9 +260,9 @@ Module600Name=Notifications Module600Desc=Send notifications (by email) on Dolibarr business events Module700Name=Donations Module700Desc=Donations' management -Module800Name=OSCommerce 1 +Module800Name=OSCommerce direct Module800Desc=Interface to show an OSCommerce shop via direct database access -Module900Name=OSCommerce 2 +Module900Name=OSCommerce by WS Module900Desc=Interface to show an OSCommerce shop via Web services.\nThis module requiere you to install components from /oscommerce_ws/ws_server into your OSCommerce server. See README file in /oscommerce_ws/ws_server. Module1200Name=Mantis Module1200Desc=Mantis integration @@ -273,7 +273,7 @@ Module2200Desc=Gestion du droit de pr Module2300Name=Menus Module2300Desc=Menus' management Module2400Name=Agenda -Module2400Desc=Agenda and actions management +Module2400Desc=Actions/tasks and agenda management Module2500Name=Electronic Content Management Module2500Desc=Save and share documents Permission11=Read invoices @@ -523,7 +523,7 @@ LogEvents=Events Audit=Audit ListEvents=Audit events ListOfEvents=List of events -LogEventDesc=You can enable here log for some common events in the dolibarr event table. +LogEventDesc=You can enable here log for some common events in the Dolibarr events table. Administrators can then see its content via menu System tools - Audit. Warning, this feature can consume a large amount of datas in database. AreaForAdminOnly=Those features can be used by administrator users only. Administrator features and help are identified in Dolibarr by the following picto: SystemInfoDesc=System information is miscellanous technical information you get in read only mode and visible for administrators only. SystemAreaForAdminOnly=This area is available for administrator users only. None of the Dolibarr permissions can reduce this limit. @@ -872,3 +872,13 @@ DeleteMenu=Delete menu entry ConfirmDeleteMenu=Are you sure you want to delete menu entry %s ? DeleteLine=Delete line ConfirmDeleteLine=Are you sure you want to delete this line ? +##### Tax ##### +TaxSetup=Taxes, social contributions and dividends module setup +OptionVatMode=Option d'exigibilité de TVA +OptionVATDefault=Standard +OptionVATDebitOption=Option services sur debit +OptionVatDefaultDesc=L'exigibilité de la TVA est:
- sur livraison pour les biens
- sur paiement pour les services +OptionVatDebitOptionDesc=L'exigibilité de la TVA est:
- sur livraison pour les biens
- sur facturation (débit) pour les services +##### Agenda ##### +AgendaSetup=Actions/Tasks and agenda module setup +PasswordTogetVCalExport=Key to authorize vcal export link diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index b430225bcb0..8ea35f075d6 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -1,5 +1,6 @@ # Dolibarr language file - en_US - agenda -ActionsArea=Actions area +Actions=Actions/Tasks +ActionsArea=Actions/Tasks area Agenda=Agenda Agendas=Agendas Calendar=Calendar @@ -7,7 +8,14 @@ Calendars=Calendars AffectedTo=Affected to DoneBy=Done by Events=Events -SearchAnAction=Search an action -MenuDoneActions=Terminated actions +SearchAnAction=Search an action/task +MenuToDoActions=All uncomplete actions +MenuDoneActions=All terminated actions +MenuToDoMyActions=My incomplete actions +MenuDoneMyActions=My terminated actions ListOfEvents=List of Dolibarr events - +ActionsAskedBy=Actions recorded by +ActionsToDoBy=Actions affected to +ActionsDoneBy=Actions done by +AllMyActions=All my actions/tasks +AllActions=Toutes les actions/tasks diff --git a/htdocs/langs/en_US/commercial.lang b/htdocs/langs/en_US/commercial.lang index 8ef7c40b767..d7d2e3965b0 100644 --- a/htdocs/langs/en_US/commercial.lang +++ b/htdocs/langs/en_US/commercial.lang @@ -7,10 +7,10 @@ Customer=Customer Customers=Customers Prospect=Prospect Prospects=Prospects -DeleteAction=Delete a task -NewAction=New action -AddAction=Add action -AddAnAction=Add an action +DeleteAction=Delete an action/task +NewAction=New action/task +AddAction=Add action/task +AddAnAction=Add an action/task AddActionRendezVous=Add a Rendez-Vous task ConfirmDeleteAction=Are you sure you want to delete this task ? CardAction=Action card @@ -35,11 +35,11 @@ ListOfProspects=List of prospects ListOfCustomers=List of customers LastDoneTasks=Last %s done tasks LastRecordedTasks=Last recorded tasks +LastActionsToDo=Last %s oldest actions not completed DoneAndToDoActionsFor=Done and To do tasks for %s DoneAndToDoActions=Done and To do tasks DoneActions=Done actions DoneActionsFor=Done actions for %s -MenuToDoActions=Uncomplete actions ToDoActions=Uncomplete actions ToDoActionsFor=Uncomplete actions for %s SendPropalRef=Send commercial proposal %s @@ -47,7 +47,7 @@ SendOrderRef=Send order %s NoRecordedProspects=No prospect recorded StatusActionToDo=To do StatusActionDone=Done -MyActionsAsked=Actions I have asked +MyActionsAsked=Actions I have recorded MyActionsToDo=Actions I have to do MyActionsDone=Actions affected to me StatusActionInProcess=In process @@ -57,12 +57,12 @@ LastProspectNeverContacted=Never contacted LastProspectToContact=To contact LastProspectContactInProcess=Contact in process LastProspectContactDone=Contact done -DateActionPlanned=Date planned -DateActionDone=Date done +DateActionPlanned=Date action planned for +DateActionDone=Date action done ActionAskedBy=Action asked by ActionAffectedTo=Action affected to ActionDoneBy=Action done by -ActionUserAsk=Requerent +ActionUserAsk=Recorded by ErrorStatusCantBeZeroIfStarted=If field 'Date done' is filled, action is started (or finished), so field 'Status' can't be 0%%. ActionAC_TEL=Phone call ActionAC_FAX=Send fax diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 6daadf3ba56..ebf99d1759d 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -170,7 +170,7 @@ ModuleFamilyProducts=Gestion produits ModuleFamilyHr=Ressources humaines ModuleFamilyProjects=Projets/Travail collaboratif ModuleFamilyOther=Autre -ModuleFamilyTechnic=Modules outils ou système +ModuleFamilyTechnic=Outils multi-modules ModuleFamilyExperimental=Modules expérimentaux (ne pas utiliser en production) ModuleFamilyFinancial=Modules financiers (Compta/trésorerie) ModuleFamilyECM=GED @@ -259,9 +259,9 @@ Module600Name=Notifications Module600Desc=Envoi de notifications (par mail) sur les évênements métiers Dolibarr Module700Name=Dons Module700Desc=Gestion des dons -Module800Name=OSCommerce 1 +Module800Name=OSCommerce direct Module800Desc=Interface de visualisation d'une boutique OSCommerce par accès direct en base. -Module900Name=OSCommerce 2 +Module900Name=OSCommerce by WS Module900Desc=Interface de visualisation d'une boutique OSCommerce par accès via des Web services.\nCe module requiert d'installer les fichiers de /oscommerce_ws/ws_server sur OSCommerce. Voir fichier README dans /oscommerce_ws/ws_server. Module1200Name=Mantis Module1200Desc=Interface avec le bug tracking Mantis @@ -272,7 +272,7 @@ Module2200Desc=Gestion du droit de pr Module2300Name=Menus Module2300Desc=Administration des menus par base de données Module2400Name=Agenda -Module2400Desc=Gestion de l'agenda et des actions +Module2400Desc=Gestion des actions/taches et de l'agenda Module2500Name=Gestion Electronique de Document Module2500Desc=Permet de stocker et administrer une base de documents Permission11=Consulter les factures @@ -522,7 +522,7 @@ LogEvents=Ev Audit=Audit ListEvents=Audit évènements ListOfEvents=Liste des évènements -LogEventDesc=Vous pouvez activer ici, le traçage de l'historique des evènements dans la table des evènements Dolibarr. +LogEventDesc=Vous pouvez activer ici, le traçage de l'historique des evènements dans la table des evènements Dolibarr. Cet historique est consultable aux administrateurs dans le menu Outils systèmes - Audit. Attention, cette fonctionnalité peut consommer un gros volume de données. AreaForAdminOnly=Ces fonctions ne sont accessibles qu'à un utilisateur administrateur. La fonction d'administrateur et les aides pour les administrateurs sont identifiées dans Dolibarr par le picto suivant: SystemInfoDesc=Les informations systèmes sont des informations techniques diverses accessibles en lecture seule aux administrateurs uniquement. SystemAreaForAdminOnly=Cet espace n'est accessible qu'aux utilisateurs de type administrateurs. Aucune permission Dolibarr ne permet d'étendre le cercle des utilisateurs autorisés à cet espace. @@ -583,7 +583,7 @@ WebCalAddEventOnStatusPropal=Ajouter WebCalAddEventOnStatusContract=Ajouter évênement dans calendrier sur changement de statut des contrats WebCalAddEventOnStatusBill=Ajouter évênement dans calendrier sur changement de statut des factures WebCalAddEventOnStatusMember=Ajouter évênement dans calendrier sur changement de statut des adhérents -WebCalUrlForVCalExport=Un lien d'export du calendrier au format %s sera disponible à l'url: %s +WebCalUrlForVCalExport=Un lien d'export du calendrier au format %s sera disponible à l'url:
%s WebCalCheckWebcalSetup=La configuration du module Webcal est peut-être incorrecte. ##### Invoices ##### BillsSetup=Configuration du module Factures @@ -884,3 +884,7 @@ OptionVATDefault=Standard OptionVATDebitOption=Option services sur debit OptionVatDefaultDesc=L'exigibilité de la TVA est:
- sur livraison pour les biens
- sur paiement pour les services OptionVatDebitOptionDesc=L'exigibilité de la TVA est:
- sur livraison pour les biens
- sur facturation (débit) pour les services +##### Agenda ##### +AgendaSetup=Configuration du module actions/taches et agenda +PasswordTogetVCalExport=Clé pour autoriser export vcal + diff --git a/htdocs/langs/fr_FR/agenda.lang b/htdocs/langs/fr_FR/agenda.lang index 7f764b506f8..fd82c07bb9a 100644 --- a/htdocs/langs/fr_FR/agenda.lang +++ b/htdocs/langs/fr_FR/agenda.lang @@ -1,5 +1,6 @@ # Dolibarr language file - fr_FR - agenda -ActionsArea=Espaces actions +Actions=Actions/Taches +ActionsArea=Espace actions/taches Agenda=Agenda Agendas=Agendas Calendar=Calendrier @@ -7,7 +8,14 @@ Calendars=Calendriers AffectedTo=Affecté à DoneBy=Réalisé par Events=Evênements -SearchAnAction=Rechercher une action -MenuDoneActions=Actions terminées +SearchAnAction=Rechercher une action/tache +MenuToDoActions=Les actions incomplètes +MenuDoneActions=Les actions terminées +MenuToDoMyActions=Mes actions incomplètes +MenuDoneMyActions=Mes actions terminées ListOfEvents=Liste des évènements Dolibarr - +ActionsAskedBy=Actions enregistrées par +ActionsToDoBy=Actions affectées à +ActionsDoneBy=Actions réalisées par +AllMyActions=Toutes mes actions/taches +AllActions=Toutes les actions/taches \ No newline at end of file diff --git a/htdocs/langs/fr_FR/commercial.lang b/htdocs/langs/fr_FR/commercial.lang index 2884ba067f7..a9e2abda71e 100644 --- a/htdocs/langs/fr_FR/commercial.lang +++ b/htdocs/langs/fr_FR/commercial.lang @@ -7,10 +7,10 @@ Customer=Client Customers=Clients Prospect=Prospect Prospects=Prospects -DeleteAction=Effacer une action -NewAction=Nouvelle action -AddAction=Créer action -AddAnAction=Créer une action +DeleteAction=Effacer une action/tache +NewAction=Nouvelle action/tache +AddAction=Créer action/tache +AddAnAction=Créer une action/tache AddActionRendezVous=Créer un Rendez-Vous ConfirmDeleteAction=Êtes-vous sûr de vouloir effacer cet action ? CardAction=Fiche action @@ -34,10 +34,10 @@ ShowProspect=Afficher prospect ListOfProspects=Liste des prospects ListOfCustomers=Liste des clients LastDoneTasks=Les %s dernières actions effectuées +LastActionsToDo=Les %s plus anciennes actions incomplètes LastRecordedTasks=Dernières actions enregistrées DoneActions=Liste des actions réalisées DoneActionsFor=Liste des actions réalisées pour %s -MenuToDoActions=Actions incomplètes ToDoActions=Liste des actions incomplètes ToDoActionsFor=Liste des actions incomplètes pour %s DoneAndToDoActionsFor=Liste des actions réalisées ou à faire pour %s @@ -48,7 +48,7 @@ NoRecordedProspects=Aucun prospect enregistr StatusActionToDo=À faire StatusActionDone=Réalisé StatusActionInProcess=En cours -MyActionsAsked=Actions que j'ai demandées +MyActionsAsked=Actions que j'ai enregistrées MyActionsToDo=Actions qui me sont affectées MyActionsDone=Actions que j'ai faites TasksHistoryForThisContact=Actions vis à vis de contact @@ -57,12 +57,12 @@ LastProspectNeverContacted=Non contact LastProspectToContact=A contacter LastProspectContactInProcess=Contact en cours LastProspectContactDone=Prospects contactés -DateActionPlanned=Date planification -DateActionDone=Date réalisation -ActionAskedBy=Action saisie par +DateActionPlanned=Date réalisation prévue +DateActionDone=Date réalisation effective +ActionAskedBy=Action enregistrée par ActionAffectedTo=Action affectée à ActionDoneBy=Action faite par -ActionUserAsk=Demandeur +ActionUserAsk=Enregistré par ErrorStatusCantBeZeroIfStarted=Si le champ 'Date de réalisation' est renseigné alors l'action est commencée voire finie, aussi le champ 'Etat' ne peut etre 0%%. ActionAC_TEL=Appel téléphonique ActionAC_FAX=Envoi fax diff --git a/htdocs/lib/agenda.lib.php b/htdocs/lib/agenda.lib.php index c4eeb08b4e8..0a3687a0d4b 100644 --- a/htdocs/lib/agenda.lib.php +++ b/htdocs/lib/agenda.lib.php @@ -28,11 +28,14 @@ \brief Show actions to do array \param max Max nb of records */ -function show_array_actions_to_do($max) +function show_array_actions_to_do($max=5) { global $langs, $conf, $user, $db, $bc, $socid; - $sql = "SELECT a.id, a.label, ".$db->pdate("a.datep")." as dp, a.fk_user_author,"; + include_once(DOL_DOCUMENT_ROOT.'/actioncomm.class.php'); + include_once(DOL_DOCUMENT_ROOT.'/client.class.php'); + + $sql = "SELECT a.id, a.label, ".$db->pdate("a.datep")." as dp, a.fk_user_author, a.percent,"; $sql.= " c.code, c.libelle,"; $sql.= " s.nom as sname, s.rowid, s.client"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user"; @@ -45,6 +48,7 @@ function show_array_actions_to_do($max) $sql .= " AND s.rowid = ".$socid; } $sql .= " ORDER BY a.datep DESC, a.id DESC"; + $sql .= $db->plimit($max, 0); $resql=$db->query($sql); if ($resql) @@ -53,11 +57,13 @@ function show_array_actions_to_do($max) if ($num > 0) { print ''; - print ''; + print ''; + print ''; $var = true; $i = 0; - $staticaction=new ActionComm($db); + $staticaction=new ActionComm($db); $customerstatic=new Client($db); while ($i < $num) @@ -94,8 +100,6 @@ function show_array_actions_to_do($max) $i++; } - // TODO Ajouter rappel pour "il y a des contrats à mettre en service" - // TODO Ajouter rappel pour "il y a des contrats qui arrivent à expiration" print "
'.$langs->trans("ActionsToDo").'
'.$langs->trans("LastActionsToDo",$max).''.$langs->trans("FullList").''; + print '

"; } $db->free($resql); @@ -111,11 +115,11 @@ function show_array_actions_to_do($max) \brief Show last actions array \param max Max nb of records */ -function show_array_last_actions_done($max) +function show_array_last_actions_done($max=5) { global $langs, $conf, $user, $db, $bc, $socid; - $sql = "SELECT a.id, a.percent, ".$db->pdate("a.datea")." as da, a.fk_user_author,"; + $sql = "SELECT a.id, a.percent, ".$db->pdate("a.datea")." as da, ".$db->pdate("a.datea2")." as da2, a.fk_user_author, a.label,"; $sql.= " c.code, c.libelle,"; $sql.= " s.rowid, s.nom as sname, s.client"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user"; @@ -130,7 +134,7 @@ function show_array_last_actions_done($max) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; } - $sql .= " ORDER BY a.datea DESC"; + $sql .= " ORDER BY a.datea2 DESC"; $sql .= $db->plimit($max, 0); $resql=$db->query($sql); @@ -139,7 +143,9 @@ function show_array_last_actions_done($max) $num = $db->num_rows($resql); print ''; - print ''; + print ''; + print ''; $var = true; $i = 0; @@ -152,11 +158,13 @@ function show_array_last_actions_done($max) $var=!$var; print ""; - print "'; + + $staticaction->code=$obj->code; + $staticaction->libelle=$obj->libelle; + $staticaction->id=$obj->id; + print ''; + + print ''; $customerstatic->id=$obj->rowid; $customerstatic->nom=$obj->sname; @@ -164,7 +172,7 @@ function show_array_last_actions_done($max) print ''; // Date - print '"; // Statut diff --git a/htdocs/lib/date.lib.php b/htdocs/lib/date.lib.php new file mode 100644 index 00000000000..08d072bd9c0 --- /dev/null +++ b/htdocs/lib/date.lib.php @@ -0,0 +1,66 @@ + + * + * 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. + * or see http://www.gnu.org/ + */ + +/** + \file htdocs/lib/date.lib.php + \brief Ensemble de fonctions de base de dolibarr sous forme d'include + \version $Id$ +*/ + + +/** \brief Return previous month + * \param month Month + * \param year Year + * \return array Previous year,month + */ +function dol_get_prev_month($month, $year) +{ + if ($month == 1) + { + $prev_month = 12; + $prev_year = $year - 1; + } + else + { + $prev_month = $month-1; + $prev_year = $year; + } + return array('year' => $prev_year, 'month' => $prev_month); +} + +/** \brief Return next month + * \param month Month + * \param year Year + * \return array Next year,mont + */ +function dol_get_next_month ($month, $year) +{ + if ($month == 12) + { + $next_month = 1; + $next_year = $year + 1; + } + else + { + $next_month = $month + 1; + $next_year = $year; + } + return array('year' => $next_year, 'month' => $next_month); +} +?> \ No newline at end of file diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index b8fceeb30e5..1e6723cf2a8 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -565,6 +565,7 @@ function dolibarr_mktime($hour,$minute,$second,$month,$day,$year,$gm=0,$check=1) } + /** \brief Returns formated date \param fmt Format (Exemple: 'Y-m-d H:i:s') @@ -1753,11 +1754,11 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so } /** - \brief Fonction servant a afficher les fleches de navigation dans les pages de listes - \param page numéro de la page - \param file lien - \param options autres parametres d'url a propager dans les liens ("" par defaut) - \param nextpage faut-il une page suivante + \brief Fonction servant a afficher les fleches de navigation dans les pages de listes + \param page Numéro de la page + \param file Lien + \param options Autres parametres d'url a propager dans les liens ("" par defaut) + \param nextpage Faut-il une page suivante */ function print_fleche_navigation($page,$file,$options='',$nextpage) { diff --git a/mysql/migration/2.2.0-2.4.0.sql b/mysql/migration/2.2.0-2.4.0.sql index 79db861f2ae..c75336fdfb4 100644 --- a/mysql/migration/2.2.0-2.4.0.sql +++ b/mysql/migration/2.2.0-2.4.0.sql @@ -220,4 +220,5 @@ insert into llx_c_prospectlevel (code,label,sortorder) values ('PL_HIGH', ' alter table llx_societe add column fk_prospectlevel varchar(12) after fournisseur; update llx_actioncomm set datea = datep where datea is null and percent = 100; +update llx_actioncomm set datea2 = datea where datea2 is null and percent = 100;
'.$langs->trans("LastDoneTasks",$max).'
'.$langs->trans("LastDoneTasks",$max).''.$langs->trans("FullList").''; + print '
id\">".img_object($langs->trans("ShowTask"),"task"); - $transcode=$langs->trans("Action".$obj->code); - $libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle); - print $libelle; - print ''.$staticaction->getNomUrl(1,12).''.dolibarr_trunc($obj->label,24).''.$customerstatic->getNomUrl(1,'',24).''.dolibarr_print_date($obj->da,'day'); + print ''.dolibarr_print_date($obj->da2,'day'); print "