';
+ 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();
@@ -834,7 +882,7 @@ function add_row_for_calendar_link()
global $conf,$langs,$user;
$nbtr=0;
- // Lien avec calendrier si module activ�
+ // Lien avec calendrier si module active
if ($conf->webcal->enabled)
{
if ($conf->global->PHPWEBCALENDAR_SYNCRO != 'never')
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index 127c7a3a302..64d24130d85 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -112,11 +112,16 @@ $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));
-
+$max_day_in_month = date("t",dolibarr_mktime(0,0,0,$month,1,$year));
$day = -date("w",dolibarr_mktime(0,0,0,$month,1,$year))+2;
if ($day > 1) $day -= 7;
+$firstdaytoshow=dolibarr_mktime(0,0,0,$prev_month,$max_day_in_prev_month+$day,$prev_year);
+$next_day=7-($max_day_in_month+1-$day)%7;
+if ($next_day < 6) $next_day+=7;
+$lastdaytoshow=dolibarr_mktime(0,0,0,$next_month,$next_day,$next_year);
+//print dolibarr_print_date($firstdaytoshow,'day');
+//print dolibarr_print_date($lastdaytoshow,'day');
$title=$langs->trans("DoneAndToDoActions");
if ($status == 'done') $title=$langs->trans("DoneActions");
@@ -205,6 +210,7 @@ if ($filtera > 0 || $filtert > 0 || $filterd > 0)
}
if ($status == 'done') { $sql.= " AND a.percent = 100"; }
if ($status == 'todo') { $sql.= " AND a.percent < 100"; }
+// \TODO Add filters on dates
//echo "$sql ";
$actionarray=array();
@@ -224,23 +230,31 @@ if ($resql)
$action->libelle=$obj->label;
$action->percentage=$obj->percent;
+ // Defined date_start_in_calendar and date_end_in_calendar property
if ($action->percentage <= 0)
{
- $action->date_to_show_in_calendar=$action->datep;
- // Add days until datep2
+ $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;
}
- else if ($action->percentage > 0)
+ else
{
- $action->date_to_show_in_calendar=$action->date;
- // Add days until dateend
-
+ $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;
+ }
+ // Define ponctuel property
+ if ($action->date_start_in_calendar == $action->date_end_in_calendar)
+ {
+ $action->ponctuel=1;
}
- //var_dump($action);
- $actionarray[]=$action;
+ // Add an entry in action array for each day
+ // \TODO
+ $daykey=$action->date_start_in_calendar;
+ $actionarray[$daykey]=$action;
$i++;
}
- //echo $num;
}
else
{
@@ -323,15 +337,15 @@ function show_day_events($db, $day, $month, $year, $style, $actionarray)
//$curtime = dolibarr_mktime (0, 0, 0, $month, $day, $year);
$i=0;
- foreach ($actionarray as $action)
+ foreach ($actionarray as $daykey => $action)
{
- $annee = date('Y',$action->date_to_show_in_calendar);
- $mois = date('m',$action->date_to_show_in_calendar);
- $jour = date('d',$action->date_to_show_in_calendar);
+ $annee = date('Y',$action->date_start_in_calendar);
+ $mois = date('m',$action->date_start_in_calendar);
+ $jour = date('d',$action->date_start_in_calendar);
if ($day==$jour && $month==$mois && $year==$annee)
{
if ($i) print " ";
- print $action->getNomUrl(1,10)." ".$action->getLibStatut(3);
+ print $action->getNomUrl(1,9).$action->getLibStatut(3);
$i++;
}
}
diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php
index 2ef2bb4d564..a266eee3145 100644
--- a/htdocs/html.form.class.php
+++ b/htdocs/html.form.class.php
@@ -572,7 +572,7 @@ class Form
$arraylist[0]=' ';
asort($arraylist);
- $this->select_array($htmlname, $arraylist, 0);
+ $this->select_array($htmlname, $arraylist, $selected);
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
}
@@ -2728,7 +2728,7 @@ class Form
\brief Affiche un select à partir d'un tableau
\param htmlname Nom de la zone select
\param array Tableau de key+valeur
- \param id Key pré-sélectionnée
+ \param id Preselected key
\param show_empty 1 si il faut ajouter une valeur vide dans la liste, 0 sinon
\param key_in_label 1 pour afficher la key dans la valeur "[key] value"
\param value_as_key 1 pour utiliser la valeur comme clé
diff --git a/htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php b/htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php
index dd5607e7e34..50ffb4095a6 100644
--- a/htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php
+++ b/htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php
@@ -120,6 +120,7 @@ class InterfaceActionsAuto
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("other");
+ $langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actionmsg2=$langs->transnoentities("NewCompanyToDolibarr",$object->nom);
@@ -138,6 +139,7 @@ class InterfaceActionsAuto
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("contracts");
+ $langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actionmsg2=$langs->transnoentities("ContractValidatedInDolibarr",$object->ref);
@@ -152,6 +154,7 @@ class InterfaceActionsAuto
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("propal");
+ $langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actionmsg2=$langs->transnoentities("PropalValidatedInDolibarr",$object->ref);
@@ -167,6 +170,7 @@ class InterfaceActionsAuto
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("propal");
+ $langs->load("agenda");
$ok=1;
// Parameters $object->xxx defined by caller
@@ -175,6 +179,7 @@ class InterfaceActionsAuto
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("propal");
+ $langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actionmsg2=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref);
@@ -190,6 +195,7 @@ class InterfaceActionsAuto
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("propal");
+ $langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actionmsg2=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref);
@@ -205,7 +211,8 @@ class InterfaceActionsAuto
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("orders");
-
+ $langs->load("agenda");
+
$object->actiontypecode='AC_OTH';
$object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref);
@@ -220,6 +227,7 @@ class InterfaceActionsAuto
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("orders");
+ $langs->load("agenda");
$ok=1;
// Parameters $object->xxx defined by caller
@@ -228,6 +236,7 @@ class InterfaceActionsAuto
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("bills");
+ $langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
@@ -243,6 +252,7 @@ class InterfaceActionsAuto
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("bills");
+ $langs->load("agenda");
$ok=1;
// Parameters $object->xxx defined by caller
@@ -251,6 +261,7 @@ class InterfaceActionsAuto
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("bills");
+ $langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actionmsg2=$langs->transnoentities("InvoicePayedInDolibarr",$object->ref);
@@ -266,6 +277,7 @@ class InterfaceActionsAuto
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("bills");
+ $langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actionmsg2=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang
index 12fbcf517ee..71954385c32 100644
--- a/htdocs/langs/en_US/agenda.lang
+++ b/htdocs/langs/en_US/agenda.lang
@@ -25,4 +25,8 @@ ViewWithPredefinedFilters=View with predefined filters
AutoActions=Automatic creation of actions
AgendaAutoActionDesc=Define here events for which you want Dolibarr to create automatically an action in agenda. If nothing is checked (by default), only manual actions will be included in agenda.
AgendaSetupOtherDesc=This page allows to configure other parameters of agenda module.
-ActionsEvents=Events for which create an action
\ No newline at end of file
+ActionsEvents=Events for which create an action
+PropalValidatedInDolibarr=Proposal validated
+InvoiceValidatedInDolibarr=Invoice validated
+OrderValidatedInDolibarr=Order validated
+NewCompanyToDolibarr=Third party created
diff --git a/htdocs/langs/fr_FR/agenda.lang b/htdocs/langs/fr_FR/agenda.lang
index 2f7e4135251..61fa472b6d5 100644
--- a/htdocs/langs/fr_FR/agenda.lang
+++ b/htdocs/langs/fr_FR/agenda.lang
@@ -25,4 +25,12 @@ ViewWithPredefinedFilters=Vues avec filtres pr
AutoActions=Création automatiques des actions
AgendaAutoActionDesc=Définissez dans cet onglet les évènements pour lesquels dolibarr créera automatiquement une action dans l'agenda. Si aucune case n'est cochée (par défaut), seules les actions manuelles seront incluses dans l'agenda.
AgendaSetupOtherDesc=Cette page permet de configurer les autres paramètres du module agenda.
-ActionsEvents=Evènements pour lesquels creer une action
\ No newline at end of file
+ActionsEvents=Evènements pour lesquels creer une action
+PropalValidatedInDolibarr=Proposition validée
+InvoiceValidatedInDolibarr=Facture validée
+OrderValidatedInDolibarr=Commande validée
+NewCompanyToDolibarr=Tiers créé
+DateActionPlannedStart=Date début réalisation prévue
+DateActionPlannedEnd=Date fin réalisation prévue
+DateActionDoneStart=Date début réalisation réelle
+DateActionDoneEnd=Date fin réalisation réelle
diff --git a/htdocs/langs/fr_FR/commercial.lang b/htdocs/langs/fr_FR/commercial.lang
index c7a4a3edeb8..d9dbec5f4eb 100644
--- a/htdocs/langs/fr_FR/commercial.lang
+++ b/htdocs/langs/fr_FR/commercial.lang
@@ -63,7 +63,7 @@ ActionAskedBy=Action enregistr
ActionAffectedTo=Action affectée à
ActionDoneBy=Action faite par
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%%.
+ErrorStatusCantBeZeroIfStarted=Si le champ 'Date début réalisation réelle' 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
ActionAC_PROP=Envoi proposition par mail