diff --git a/htdocs/actioncomm.class.php b/htdocs/actioncomm.class.php
index 334964660f2..3fd80919ac9 100644
--- a/htdocs/actioncomm.class.php
+++ b/htdocs/actioncomm.class.php
@@ -96,8 +96,9 @@ class ActionComm
// Clean parameters
$this->label=trim($this->label);
- $this->note=trim($this->note);
- if (! $this->percentage) $this->percentage = 0;
+ $this->location=trim($this->location);
+ $this->note=trim($this->note);
+ if (! $this->percentage) $this->percentage = 0;
if (! $this->priority) $this->priority = 0;
if (! $this->punctual) $this->punctual = 0;
if ($this->percentage > 100) $this->percentage = 100;
@@ -147,7 +148,7 @@ class ActionComm
$sql.= "fk_user_author,";
$sql.= "fk_user_action,";
$sql.= "fk_user_done,";
- $sql.= "label,percent,priority,punctual,";
+ $sql.= "label,percent,priority,location,punctual,";
$sql.= "fk_facture,propalrowid,fk_commande)";
$sql.= " VALUES (";
$sql.= "'".$this->db->idate($now)."',";
@@ -162,7 +163,7 @@ class ActionComm
$sql.= ($user->id > 0 ? "'".$user->id."'":"null").",";
$sql.= ($this->usertodo->id > 0?"'".$this->usertodo->id."'":"null").",";
$sql.= ($this->userdone->id > 0?"'".$this->userdone->id."'":"null").",";
- $sql.= "'".addslashes($this->label)."','".$this->percentage."','".$this->priority."','".$this->punctual."',";
+ $sql.= "'".addslashes($this->label)."','".$this->percentage."','".$this->priority."','".addslashes($this->location)."','".$this->punctual."',";
$sql.= ($this->facid?$this->facid:"null").",";
$sql.= ($this->propalrowid?$this->propalrowid:"null").",";
$sql.= ($this->orderrowid?$this->orderrowid:"null");
@@ -215,7 +216,7 @@ class ActionComm
$sql.= " a.fk_user_author, a.fk_user_mod,";
$sql.= " a.fk_user_action, a.fk_user_done,";
$sql.= " a.fk_contact, a.percent as percentage, a.fk_facture, a.fk_commande, a.propalrowid,";
- $sql.= " a.priority,";
+ $sql.= " a.priority, a.location,";
$sql.= " c.id as type_id, c.code as type_code, c.libelle";
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c";
$sql.= " WHERE a.id=".$id." AND a.fk_action=c.id";
@@ -252,7 +253,8 @@ class ActionComm
$this->usertodo->id = $obj->fk_user_action;
$this->userdone->id = $obj->fk_user_done;
$this->priority = $obj->priority;
-
+ $this->location = $obj->location;
+
$this->societe->id = $obj->fk_soc;
$this->contact->id = $obj->fk_contact;
@@ -297,6 +299,7 @@ class ActionComm
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm";
$sql.= " WHERE id=".$this->id;
+ dolibarr_syslog("ActionComm::delete sql=".$sql, LOG_DEBUG);
if ($this->db->query($sql))
{
return 1;
@@ -346,6 +349,7 @@ class ActionComm
$sql.= ", fk_soc =". ($this->societe->id > 0 ? "'".$this->societe->id."'":"null");
$sql.= ", fk_contact =". ($this->contact->id > 0 ? "'".$this->contact->id."'":"null");
$sql.= ", priority = '".$this->priority."'";
+ $sql.= ", location = ".($this->location ? "'".addslashes($this->location)."'":"null");
$sql.= ", fk_user_mod = '".$user->id."'";
$sql.= ", fk_user_action=".($this->usertodo->id > 0 ? "'".$this->usertodo->id."'":"null");
$sql.= ", fk_user_done=".($this->userdone->id > 0 ? "'".$this->userdone->id."'":"null");
@@ -595,7 +599,7 @@ class ActionComm
$sql.= " a.fk_user_author, a.fk_user_mod,";
$sql.= " a.fk_user_action, a.fk_user_done,";
$sql.= " a.fk_contact, a.fk_facture, a.percent as percentage, a.fk_commande,";
- $sql.= " a.priority,";
+ $sql.= " a.priority,a.location,";
$sql.= " c.id as type_id, c.code as type_code, c.libelle";
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c";
$sql.= " WHERE a.fk_action=c.id";
@@ -657,20 +661,22 @@ class ActionComm
$datestart=$obj->datep;
$dateend=$obj->datep2;
$duration=$obj->durationp;
+ $event['summary']=$obj->label;
+ $event['desc']=$obj->note;
$event['startdate']=$datestart;
$event['duration']=$duration; // Not required with type 'journal'
$event['enddate']=$dateend; // Not required with type 'journal'
- $event['summary']=$obj->label;
- $event['desc']=$obj->note;
- $event['category']=$obj->libelle;
$event['author']=$obj->fk_user_author;
+ $event['priority']=$obj->priority;
+ $event['location']=$obj->location;
$event['transparency']='TRANSPARENT'; // TRANSPARENT or OPAQUE
+ $event['category']=$obj->libelle; // libelle type action
$url=$dolibarr_main_url_root;
if (! eregi('\/$',$url)) $url.='/';
$url.='comm/action/fiche.php?id='.$obj->id;
$event['url']=$url;
- if ($qualified)
+ if ($qualified && $datestart)
{
$eventarray[$datestart]=$event;
}
diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php
index a83525b2848..30043f2485e 100644
--- a/htdocs/comm/action/fiche.php
+++ b/htdocs/comm/action/fiche.php
@@ -97,13 +97,13 @@ if ($_POST["action"] == 'add_action')
$_POST["p2month"],
$_POST["p2day"],
$_POST["p2year"]);
- $datea=dolibarr_mktime($_POST["adhour"],
+ $datea=dolibarr_mktime($_POST["adhour"], // deprecated
$_POST["admin"],
0,
$_POST["admonth"],
$_POST["adday"],
$_POST["adyear"]);
- $datea2=dolibarr_mktime($_POST["a2hour"],
+ $datea2=dolibarr_mktime($_POST["a2hour"], // deprecated
$_POST["a2min"],
0,
$_POST["a2month"],
@@ -126,6 +126,7 @@ if ($_POST["action"] == 'add_action')
$actioncomm->type_id = $cactioncomm->id;
$actioncomm->type_code = $cactioncomm->code;
$actioncomm->priority = isset($_POST["priority"])?$_POST["priority"]:0;
+ $actioncomm->location = isset($_POST["location"])?$_POST["location"]:'';
$actioncomm->label = trim($_POST["label"]);
if (! $_POST["label"])
{
@@ -191,7 +192,13 @@ if ($_POST["action"] == 'add_action')
if ($_POST["add_webcal"] == 'on' && $conf->webcal->enabled) $actioncomm->use_webcal=1;
if ($_POST["add_phenix"] == 'on' && $conf->phenix->enabled) $actioncomm->use_phenix=1;
-
+ // Check parameters
+ if ($actioncomm->type_code == 'AC_RDV' && ($datep == '' || $datep2 == ''))
+ {
+ $error=1;
+ $_GET["action"] = 'create';
+ $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DateEnd")).'
';
+ }
if ($datea && $_POST["percentage"] == 0)
{
$error=1;
@@ -325,7 +332,8 @@ if ($_POST["action"] == 'update')
$actioncomm->dateend = $datea2;
$actioncomm->percentage = $_POST["percentage"];
$actioncomm->priority = $_POST["priority"];
- $actioncomm->societe->id = $_POST["socid"];
+ $actioncomm->location = isset($_POST["location"])?$_POST["location"]:'';
+ $actioncomm->societe->id = $_POST["socid"];
$actioncomm->contact->id = $_POST["contactid"];
$actioncomm->note = $_POST["note"];
@@ -416,9 +424,9 @@ if ($_GET["action"] == 'create')
else print "
";
print '';
+ print '
';
+ print '';
+
// Societe, contact
- print '| '.$langs->trans("ActionOnCompany").' | ';
+ print ' |
| '.$langs->trans("ActionOnCompany").' | ';
if ($_REQUEST["socid"] > 0)
{
$societe = new Societe($db);
@@ -466,13 +482,17 @@ if ($_GET["action"] == 'create')
$html->select_users($_REQUEST["doneby"]?$_REQUEST["doneby"]:$actioncomm->userdone,'doneby',1);
print ' |
';
+ print '
';
+ print '
';
+ print '';
+
if (! empty($_GET["datep"]) && eregi('^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$',$_GET["datep"],$reg))
{
$actioncomm->datep=dolibarr_mktime(0,0,0,$reg[2],$reg[3],$reg[1]);
}
// Date start
- print '| '.$langs->trans("DateActionStart").' | ';
+ print ' |
| '.$langs->trans("DateActionStart").' | ';
if ($_REQUEST["afaire"] == 1) $html->select_date($actioncomm->datep,'ap',1,1,0,"action");
else if ($_REQUEST["afaire"] == 2) $html->select_date($actioncomm->datep,'ap',1,1,1,"action");
else $html->select_date($actioncomm->datep,'ap',1,1,1,"action");
@@ -618,9 +638,20 @@ if ($_GET["id"])
if (! empty($_REQUEST["backtopage"])) print '';
print '';
+
+ // Ref
print '| '.$langs->trans("Ref").' | '.$act->id.' | ';
+
+ // Type
print '| '.$langs->trans("Type").' | '.$act->type.' | ';
+
+ // Title
print '| '.$langs->trans("Title").' | | ';
+
+ // Location
+ print '| '.$langs->trans("Location").' | | ';
+
+ // Company
print '| '.$langs->trans("Company").' | ';
print '';
print $html->select_societes($act->societe->id,'socid',1,1);
@@ -712,10 +743,13 @@ if ($_GET["id"])
// Type
print ' | | '.$langs->trans("Type").' | '.$act->type.' | ';
- // Libelle
+ // Title
print '| '.$langs->trans("Title").' | '.$act->label.' | ';
-
- // Societe - contact
+
+ // Location
+ print '| '.$langs->trans("Location").' | '.$act->location.' | ';
+
+ // Societe - contact
print '| '.$langs->trans("Company").' | '.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None")).' | ';
print ''.$langs->trans("Contact").' | ';
print '';
diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang
index 1e8db697af5..7fb9d05a278 100644
--- a/htdocs/langs/en_US/agenda.lang
+++ b/htdocs/langs/en_US/agenda.lang
@@ -8,6 +8,7 @@ Calendars = Calendars
AffectedTo = Affected to
DoneBy = Done by
Events = Events
+Location=Location
SearchAnAction = Search an action/task
MenuToDoActions = All uncomplete actions
MenuDoneActions = All terminated actions
diff --git a/htdocs/langs/fr_FR/agenda.lang b/htdocs/langs/fr_FR/agenda.lang
index d023ba89763..b375385448d 100644
--- a/htdocs/langs/fr_FR/agenda.lang
+++ b/htdocs/langs/fr_FR/agenda.lang
@@ -8,6 +8,7 @@ Calendars=Calendriers
AffectedTo=Affecté à
DoneBy=Réalisé par
Events=Evênements
+Location=Lieu
SearchAnAction=Rechercher une action/tache
MenuToDoActions=Les actions incomplètes
MenuDoneActions=Les actions terminées
diff --git a/htdocs/lib/xcal.lib.php b/htdocs/lib/xcal.lib.php
index 1acf1f06b22..8b2e5add843 100644
--- a/htdocs/lib/xcal.lib.php
+++ b/htdocs/lib/xcal.lib.php
@@ -67,7 +67,7 @@ function build_calfile($format='vcal',$title,$desc,$events_array,$outputfile,$fi
if ($eventqualified)
{
// See http://fr.wikipedia.org/wiki/ICalendar for format
- //$uid = dolibarr_print_date($now,'dayhourxcard',true).'-'.$event['uid']."-export@".$_SERVER["SERVER_NAME"];
+ // See http://www.ietf.org/rfc/rfc2445.txt for RFC
$uid = $event['uid'];
$type = $event['type'];
$startdate = $event['startdate'];
@@ -78,7 +78,7 @@ function build_calfile($format='vcal',$title,$desc,$events_array,$outputfile,$fi
$location = $event['location'];
$email = $event['email'];
$url = $event['url'];
- $transparency = $event['transparency'];
+ $transparency = $event['transparency']; // OPAQUE or TRANSPARENT
$description=eregi_replace(' ',"\n",$event['desc']);
$description=clean_html($description,0); // Remove html tags
@@ -134,9 +134,7 @@ function build_calfile($format='vcal',$title,$desc,$events_array,$outputfile,$fi
/ "CANCELLED" ;Indicates journal is removed.
;Status values for "VJOURNAL".
*/
- if (! empty($category)) fwrite($calfileh,"CATEGORIES:".$encoding.$category."\n");
if (! empty($location)) fwrite($calfileh,"LOCATION:".$encoding.$location."\n");
- //fwrite($calfileh,"TRANSP:".$transparency."\n");
//fwrite($calfileh,"CLASS:PUBLIC\n"); // PUBLIC, PRIVATE, CONFIDENTIAL
// Date must be GMT dates
@@ -146,6 +144,9 @@ function build_calfile($format='vcal',$title,$desc,$events_array,$outputfile,$fi
if (empty($enddate)) $enddate=$startdate+$duration;
$enddatef = dolibarr_print_date($enddate,'dayhourxcard',true);
fwrite($calfileh,"DTEND:".$enddatef."\n");
+
+ if (! empty($transparency)) fwrite($calfileh,"TRANSP:".$transparency."\n");
+ if (! empty($category)) fwrite($calfileh,"CATEGORIES:".$encoding.$category."\n");
fwrite($calfileh,"END:VEVENT\n");
}
diff --git a/mysql/migration/2.4.0-2.5.0.sql b/mysql/migration/2.4.0-2.5.0.sql
index 98929dc3d6b..e4caf1e921a 100644
--- a/mysql/migration/2.4.0-2.5.0.sql
+++ b/mysql/migration/2.4.0-2.5.0.sql
@@ -1,8 +1,9 @@
--
-- $Id$
--
--- Attention à l ordre des requetes.
--- Ce fichier doit être chargé sur une version 2.4.0
+-- Be carefull to requests order.
+-- This file must be loaded by calling /install/index.php page
+-- when current version is 2.4.0 or higher.
--
alter table llx_product add column price_min double(24,8) DEFAULT 0;
@@ -16,3 +17,7 @@ alter table llx_societe add column gencod varchar(255);
delete from llx_user_param where page <> '';
alter table llx_expedition add tracking_number varchar(50) after fk_expedition_methode;
+
+alter table llx_actioncomm add column location varchar(128) after percent;
+
+
diff --git a/mysql/tables/llx_actioncomm.sql b/mysql/tables/llx_actioncomm.sql
index 1ce9451faf8..c2f55bb02f8 100644
--- a/mysql/tables/llx_actioncomm.sql
+++ b/mysql/tables/llx_actioncomm.sql
@@ -25,9 +25,9 @@ create table llx_actioncomm
(
id integer AUTO_INCREMENT PRIMARY KEY,
datep datetime, -- date debut planifiee
- datep2 datetime, -- date fin planifiee si action non ponctuelle
+ datep2 datetime, -- deprecated
datea datetime, -- date debut realisation
- datea2 datetime, -- date fin realisation si action non ponctuelle
+ datea2 datetime, -- deprecated
fk_action integer, -- type de l'action
label varchar(50) NOT NULL, -- libelle de l'action
@@ -47,8 +47,9 @@ create table llx_actioncomm
priority smallint,
punctual smallint NOT NULL default 1,
percent smallint NOT NULL default 0,
+ location varchar(128),
durationp real, -- duree planifiee
- durationa real, -- duree reellement passee
+ durationa real, -- deprecated
note text,
propalrowid integer,
| |