diff --git a/htdocs/actioncomm.class.php b/htdocs/actioncomm.class.php
index 2c8cb31adb8..7ee8db98293 100644
--- a/htdocs/actioncomm.class.php
+++ b/htdocs/actioncomm.class.php
@@ -202,8 +202,11 @@ class ActionComm
{
global $langs;
- $sql = "SELECT a.id, ".$this->db->pdate("a.datea")." as datea,";
+ $sql = "SELECT a.id,";
+ $sql.= " ".$this->db->pdate("a.datea")." as datea,";
+ $sql.= " ".$this->db->pdate("a.datea2")." as datea2,";
$sql.= " ".$this->db->pdate("a.datep")." as datep,";
+ $sql.= " ".$this->db->pdate("a.datep2")." as datep2,";
$sql.= " ".$this->db->pdate("a.datec")." as datec, tms as datem,";
$sql.= " a.note, a.label, a.fk_action as type_id,";
$sql.= " a.fk_soc,";
@@ -228,10 +231,13 @@ class ActionComm
$this->type_code = $obj->type_code;
$transcode=$langs->trans("Action".$obj->code);
$type_libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle);
- $this->type = $type_libelle;
- $this->label = $obj->label;
- $this->date = $obj->datea;
- $this->datep = $obj->datep;
+ $this->type = $type_libelle;
+ $this->label = $obj->label;
+ $this->datep = $obj->datep;
+ $this->datef = $obj->datep2;
+ $this->date = $obj->datea;
+ $this->dateend = $obj->datea2;
+
$this->datec = $obj->datec;
$this->datem = $obj->datem;
$this->note =$obj->note;
diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php
index de130e1674a..1da57b7d0c6 100644
--- a/htdocs/comm/action/fiche.php
+++ b/htdocs/comm/action/fiche.php
@@ -73,10 +73,10 @@ if ($_POST["action"] == 'add_action')
// Nettoyage parametres
if ($_POST["aphour"] == -1) $_POST["aphour"]='0';
if ($_POST["apmin"] == -1) $_POST["apmin"]='0';
- if ($_POST["adhour"] == -1) $_POST["adhour"]='0';
- if ($_POST["admin"] == -1) $_POST["admin"]='0';
if ($_POST["p2hour"] == -1) $_POST["p2hour"]='0';
if ($_POST["p2min"] == -1) $_POST["p2min"]='0';
+ if ($_POST["adhour"] == -1) $_POST["adhour"]='0';
+ if ($_POST["admin"] == -1) $_POST["admin"]='0';
if ($_POST["a2hour"] == -1) $_POST["a2hour"]='0';
if ($_POST["a2min"] == -1) $_POST["a2min"]='0';
$datep=dolibarr_mktime($_POST["aphour"],
@@ -85,18 +85,18 @@ if ($_POST["action"] == 'add_action')
$_POST["apmonth"],
$_POST["apday"],
$_POST["apyear"]);
- $datea=dolibarr_mktime($_POST["adhour"],
- $_POST["admin"],
- 0,
- $_POST["admonth"],
- $_POST["adday"],
- $_POST["adyear"]);
$datep2=dolibarr_mktime($_POST["p2hour"],
$_POST["p2min"],
0,
$_POST["p2month"],
$_POST["p2day"],
$_POST["p2year"]);
+ $datea=dolibarr_mktime($_POST["adhour"],
+ $_POST["admin"],
+ 0,
+ $_POST["admonth"],
+ $_POST["adday"],
+ $_POST["adyear"]);
$datea2=dolibarr_mktime($_POST["a2hour"],
$_POST["a2min"],
0,
@@ -105,8 +105,8 @@ if ($_POST["action"] == 'add_action')
$_POST["a2year"]);
// Si param incorrects, mktime renvoi false en PHP 5.1, -1 avant
if (! ($datep > 0)) $datep='';
- if (! ($datea > 0)) $datea='';
if (! ($datep2 > 0)) $datep2='';
+ if (! ($datea > 0)) $datea='';
if (! ($datea2 > 0)) $datea2='';
// Initialisation objet cactioncomm
@@ -138,12 +138,13 @@ if ($_POST["action"] == 'add_action')
{
$actioncomm->label = $langs->trans("Action".$actioncomm->type_code)."\n";
}
+ else $actioncomm->label = $cactioncomm->libelle;
}
}
$actioncomm->datep = $datep;
- $actioncomm->date = $datea;
+ //$actioncomm->date = $datea;
$actioncomm->datef = $datep2;
- $actioncomm->dateend = $datea2;
+ //$actioncomm->dateend = $datea2;
if ($_POST["percentage"] < 100 && ! $actioncomm->datep) $actioncomm->datep=$actioncomm->date;
if ($actioncomm->type_code == 'AC_RDV')
{
@@ -290,18 +291,18 @@ if ($_POST["action"] == 'update')
$_POST["apmonth"],
$_POST["apday"],
$_POST["apyear"]);
- $datea=dolibarr_mktime($_POST["adhour"],
- $_POST["admin"],
- 0,
- $_POST["admonth"],
- $_POST["adday"],
- $_POST["adyear"]);
$datep2=dolibarr_mktime($_POST["p2hour"],
$_POST["p2min"],
0,
$_POST["p2month"],
$_POST["p2day"],
$_POST["p2year"]);
+ $datea=dolibarr_mktime($_POST["adhour"],
+ $_POST["admin"],
+ 0,
+ $_POST["admonth"],
+ $_POST["adday"],
+ $_POST["adyear"]);
$datea2=dolibarr_mktime($_POST["a2hour"],
$_POST["a2min"],
0,
@@ -310,16 +311,16 @@ if ($_POST["action"] == 'update')
$_POST["a2year"]);
// Si param incorrects, mktime renvoi false en PHP 5.1, -1 avant
if (! ($datep > 0)) $datep='';
- if (! ($datea > 0)) $datea='';
if (! ($datep2 > 0)) $datep2='';
+ if (! ($datea > 0)) $datea='';
if (! ($datea2 > 0)) $datea2='';
//print $_POST["apmonth"].",".$_POST["apday"].",".$_POST["apyear"].",".$_POST["aphour"].",".$_POST["apmin"]." \n";
//print $actioncomm->datep;
$actioncomm->label = $_POST["label"];
$actioncomm->datep = $datep;
- $actioncomm->date = $datea;
$actioncomm->datef = $datep2;
+ $actioncomm->date = $datea;
$actioncomm->dateend = $datea2;
$actioncomm->percentage = $_POST["percentage"];
$actioncomm->priority = $_POST["priority"];
@@ -442,30 +443,17 @@ if ($_GET["action"] == 'create')
$html->select_users($_REQUEST["doneby"],'doneby',1);
print '';
- // Date start planed
- print '
'.$langs->trans("DateActionPlannedStart").' ';
- if ($_REQUEST["afaire"] == 1) $html->select_date($actioncomm->datea,'ap',1,1,0,"action");
- else if ($_REQUEST["afaire"] == 2) $html->select_date('','ap',1,1,1,"action");
- else $html->select_date('','ap',1,1,1,"action");
+ // Date start
+ 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");
print ' ';
- // Date end planed
- print ''.$langs->trans("DateActionPlannedEnd").' ';
- if ($_REQUEST["afaire"] == 1) $html->select_date('','p2',1,1,1,"action");
- else if ($_REQUEST["afaire"] == 2) $html->select_date('','p2',1,1,1,"action");
- else $html->select_date('','p2',1,1,1,"action");
- print ' ';
-
- // Date start done
- print ''.$langs->trans("DateActionDoneStart").' ';
- if ($_REQUEST["afaire"] == 1) $html->select_date('','ad',1,1,1,"action");
- else if ($_REQUEST["afaire"] == 2) $html->select_date('','ad',1,1,0,"action");
- else $html->select_date('','ad',1,1,1,"action");
- print ' ';
- // Date end done
- print ''.$langs->trans("DateActionDoneEnd").' ';
- if ($_REQUEST["afaire"] == 1) $html->select_date('','a2',1,1,1,"action");
- else if ($_REQUEST["afaire"] == 2) $html->select_date('','a2',1,1,0,"action");
- else $html->select_date('','a2',1,1,1,"action");
+ // Date end
+ print ' '.$langs->trans("DateActionEnd").' ';
+ if ($_REQUEST["afaire"] == 1) $html->select_date($actioncomm->datef,'p2',1,1,1,"action");
+ else if ($_REQUEST["afaire"] == 2) $html->select_date($actioncomm->datef,'p2',1,1,1,"action");
+ else $html->select_date($actioncomm->datef,'p2',1,1,1,"action");
print ' ';
// Duration
@@ -560,6 +548,34 @@ if ($_GET["action"] == 'create')
$html->select_users($_REQUEST["doneby"]?$_REQUEST["doneby"]:$actioncomm->userdone,'doneby',1);
print '';
+ // Date start
+ 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");
+ print ' ';
+ // Date end
+ print ''.$langs->trans("DateActionEnd").' ';
+ if ($_REQUEST["afaire"] == 1) $html->select_date($actioncomm->datef,'p2',1,1,1,"action");
+ else if ($_REQUEST["afaire"] == 2) $html->select_date($actioncomm->datef,'p2',1,1,1,"action");
+ else $html->select_date($actioncomm->datef,'p2',1,1,1,"action");
+ print ' ';
+
+ // Date start done
+ /*
+ print ''.$langs->trans("DateActionDoneStart").' ';
+ if ($_REQUEST["afaire"] == 1) $html->select_date($actioncomm->date,'ad',1,1,1,"action");
+ else if ($_REQUEST["afaire"] == 2) $html->select_date($actioncomm->date,'ad',1,1,0,"action");
+ else $html->select_date($actioncomm->date,'ad',1,1,1,"action");
+ print ' ';
+ // Date end done
+ print ''.$langs->trans("DateActionDoneEnd").' ';
+ if ($_REQUEST["afaire"] == 1) $html->select_date($actioncomm->dateend,'a2',1,1,1,"action");
+ else if ($_REQUEST["afaire"] == 2) $html->select_date($actioncomm->dateend,'a2',1,1,0,"action");
+ else $html->select_date($actioncomm->dateend,'a2',1,1,1,"action");
+ print ' ';
+ */
+
// Avancement
if ($_REQUEST["afaire"] == 1)
{
@@ -576,32 +592,6 @@ if ($_GET["action"] == 'create')
print ''.$langs->trans("Status").' / '.$langs->trans("Percentage").' % ';
}
- // Date start planed
- print ''.$langs->trans("DateActionPlannedStart").' ';
- 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");
- print ' ';
- // Date end planed
- print ''.$langs->trans("DateActionPlannedEnd").' ';
- if ($_REQUEST["afaire"] == 1) $html->select_date($actioncomm->datef,'p2',1,1,1,"action");
- else if ($_REQUEST["afaire"] == 2) $html->select_date($actioncomm->datef,'p2',1,1,1,"action");
- else $html->select_date($actioncomm->datef,'p2',1,1,1,"action");
- print ' ';
-
- // Date start done
- print ''.$langs->trans("DateActionDoneStart").' ';
- if ($_REQUEST["afaire"] == 1) $html->select_date($actioncomm->date,'ad',1,1,1,"action");
- else if ($_REQUEST["afaire"] == 2) $html->select_date($actioncomm->date,'ad',1,1,0,"action");
- else $html->select_date($actioncomm->date,'ad',1,1,1,"action");
- print ' ';
- // Date end done
- print ''.$langs->trans("DateActionDoneEnd").' ';
- if ($_REQUEST["afaire"] == 1) $html->select_date($actioncomm->dateend,'a2',1,1,1,"action");
- else if ($_REQUEST["afaire"] == 2) $html->select_date($actioncomm->dateend,'a2',1,1,0,"action");
- else $html->select_date($actioncomm->dateend,'a2',1,1,1,"action");
- print ' ';
-
add_row_for_calendar_link();
// Note
@@ -726,18 +716,21 @@ if ($_GET["id"])
$html->select_users($act->userdone->id,'doneby',1);
print '';
- // Date planification
- print ''.$langs->trans("DateActionPlanned").' ';
- $html->select_date(($act->datep?$act->datep:-1),'ap',1,1,1,"action");
- if ($act->percentage < 100 && $act->datep < (time() - $conf->global->MAIN_DELAY_ACTIONS_TODO)) print img_warning($langs->trans("Late"));
+ // Date start
+ print ' '.$langs->trans("DateActionStart").' ';
+ if ($_REQUEST["afaire"] == 1) $html->select_date($act->datep,'ap',1,1,0,"action");
+ else if ($_REQUEST["afaire"] == 2) $html->select_date($act->datep,'ap',1,1,1,"action");
+ else $html->select_date($act->datep,'ap',1,1,1,"action");
+ if ($act->percentage == 0 && $act->datep && $act->datep < (time() - $conf->global->MAIN_DELAY_ACTIONS_TODO)) print img_warning($langs->trans("Late"));
print ' ';
-
- // Date done
- print ''.$langs->trans("DateActionDone").' ';
- $html->select_date(($act->date?$act->date:-1),'ad',1,1,1,"action");
+ // Date end
+ print ' '.$langs->trans("DateActionEnd").' ';
+ if ($_REQUEST["afaire"] == 1) $html->select_date($act->datef,'p2',1,1,1,"action");
+ else if ($_REQUEST["afaire"] == 2) $html->select_date($act->datef,'p2',1,1,1,"action");
+ else $html->select_date($act->datef,'p2',1,1,1,"action");
+ if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < (time() - $conf->global->MAIN_DELAY_ACTIONS_TODO)) print img_warning($langs->trans("Late"));
print ' ';
-
// Status
print ''.$langs->trans("Status").' / '.$langs->trans("Percentage").' % ';
@@ -819,14 +812,17 @@ if ($_GET["id"])
if ($act->userdone->id > 0) print $act->userdone->getNomUrl(1);
print '';
- // Date planification
- print ''.$langs->trans("DateActionPlanned").' ';
+ // Date debut
+ print ' '.$langs->trans("DateActionStart").' ';
print dolibarr_print_date($act->datep,'dayhour');
- if ($act->percentage < 100 && $act->datep < (time() - $conf->global->MAIN_DELAY_ACTIONS_TODO)) print img_warning($langs->trans("Late"));
+ if ($act->percentage == 0 && $act->datep && $act->datep < (time() - $conf->global->MAIN_DELAY_ACTIONS_TODO)) print img_warning($langs->trans("Late"));
print ' ';
- // Date fin real
- print ''.$langs->trans("DateActionDone").' '.dolibarr_print_date($act->date,'dayhour').' ';
+ // Date fin
+ print ''.$langs->trans("DateActionEnd").' ';
+ print dolibarr_print_date($act->datef,'dayhour');
+ if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < (time() - $conf->global->MAIN_DELAY_ACTIONS_TODO)) print img_warning($langs->trans("Late"));
+ print ' ';
// Statut
print ''.$langs->trans("Status").' / '.$langs->trans("Percentage").' ';
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index 64d24130d85..073165ffd76 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -225,8 +225,8 @@ if ($resql)
$action->id=$obj->id;
$action->datep=$obj->datep;
$action->datef=$obj->datep2;
- $action->date=$obj->datea;
- $action->dateend=$obj->datea2;
+ //$action->date=$obj->datea;
+ //$action->dateend=$obj->datea2;
$action->libelle=$obj->label;
$action->percentage=$obj->percent;
@@ -239,9 +239,9 @@ if ($resql)
}
else
{
- $action->date_start_in_calendar=$action->date;
- if ($action->dateend != '' && $action->dateend >= $action->date) $action->date_end_in_calendar=$action->dateend;
- else $action->date_end_in_calendar=$action->date;
+ $action->date_start_in_calendar=$action->datep;
+ if ($action->datef != '' && $action->datef >= $action->datep) $action->date_end_in_calendar=$action->datef;
+ else $action->date_end_in_calendar=$action->datep;
}
// Define ponctuel property
if ($action->date_start_in_calendar == $action->date_end_in_calendar)
diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php
index 7077686afb0..c013c861be3 100644
--- a/htdocs/comm/action/listactions.php
+++ b/htdocs/comm/action/listactions.php
@@ -102,7 +102,7 @@ $form=new Form($db);
$sql = "SELECT s.nom as societe, s.rowid as socid, s.client,";
$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.= " ".$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,";
@@ -231,8 +231,8 @@ if ($resql)
print ' ';
print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"acode",$param,"","",$sortfield,$sortorder);
//print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"a.label",$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.datea2",$param,'','',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("DateStart"),$_SERVER["PHP_SELF"],"a.datep",$param,'','',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"a.datep2",$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);
print_liste_field_titre($langs->trans("ActionUserAsk"),$_SERVER["PHP_SELF"],"ua.login",$param,"","",$sortfield,$sortorder);
@@ -276,7 +276,7 @@ if ($resql)
print '';
print '';
- print dolibarr_print_date($obj->da2,"day");
+ print dolibarr_print_date($obj->dp2,"day");
print ' ';
// Société
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index b3673ca12f0..699234c34f8 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -152,6 +152,7 @@ Next=Next
Cards=Cards
Card=Card
Date=Date
+DateStart=Date start
DateEnd=Date end
DateCreation=Creation date
DateModification=Modification date
diff --git a/htdocs/langs/fr_FR/agenda.lang b/htdocs/langs/fr_FR/agenda.lang
index 61fa472b6d5..c760778fd4e 100644
--- a/htdocs/langs/fr_FR/agenda.lang
+++ b/htdocs/langs/fr_FR/agenda.lang
@@ -34,3 +34,5 @@ DateActionPlannedStart=Date d
DateActionPlannedEnd=Date fin réalisation prévue
DateActionDoneStart=Date début réalisation réelle
DateActionDoneEnd=Date fin réalisation réelle
+DateActionStart=Date début
+DateActionEnd=Date fin
diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang
index 05da8d1ad58..c9b7ada68ba 100644
--- a/htdocs/langs/fr_FR/main.lang
+++ b/htdocs/langs/fr_FR/main.lang
@@ -153,6 +153,7 @@ Next=Suivant
Cards=Fiches
Card=Fiche
Date=Date
+DateStart=Date début
DateEnd=Date fin
DateCreation=Date création
DateModification=Date modification
diff --git a/mysql/migration/2.2.0-2.4.0.sql b/mysql/migration/2.2.0-2.4.0.sql
index ac40c7d5bb5..c0959b9cfe0 100644
--- a/mysql/migration/2.2.0-2.4.0.sql
+++ b/mysql/migration/2.2.0-2.4.0.sql
@@ -228,8 +228,11 @@ 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;
+--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;
+update llx_actioncomm set datep = datea where datep is null and datea is not null;
+update llx_actioncomm set datep = datec where datep is null and datea is null;
+update llx_actioncomm set datep2 = datep where datep2 is null and percent = 100;
alter table llx_projet modify fk_soc integer;