New: Add property "Event on full day" on agenda

This commit is contained in:
Laurent Destailleur 2010-11-18 22:17:44 +00:00
parent eb55db74c0
commit 0911532d66
8 changed files with 166 additions and 79 deletions

View File

@ -42,6 +42,7 @@ For users:
- New: Option MAIN_INVERT_SENDER_RECIPIENT is available in einstein pdf template. - New: Option MAIN_INVERT_SENDER_RECIPIENT is available in einstein pdf template.
- New: Easier way to define url for clicktodial module. - New: Easier way to define url for clicktodial module.
- New: Add a fckeditor test area in fckeditor module setup. - New: Add a fckeditor test area in fckeditor module setup.
- New: Add property "Event on full day" on agenda
- Perf: Avoid reading database to determine country code after each - Perf: Avoid reading database to determine country code after each
page call. page call.
- Fix: Better Postgresql compatibility. - Fix: Better Postgresql compatibility.

View File

@ -59,6 +59,7 @@ class ActionComm extends CommonObject
//var $dateend; // Date action realise fin (datea2) // deprecated //var $dateend; // Date action realise fin (datea2) // deprecated
//var $durationa = -1; // deprecated //var $durationa = -1; // deprecated
var $priority; var $priority;
var $fulldayevent = 0; // 1=Event on full day
var $punctual = 1; var $punctual = 1;
var $usertodo; // Object user that must do action var $usertodo; // Object user that must do action
@ -100,10 +101,10 @@ class ActionComm extends CommonObject
} }
/** /**
* \brief Add an action into database * Add an action into database
* \param user auteur de la creation de l'action * @param user auteur de la creation de l'action
* \param notrigger 1 ne declenche pas les triggers, 0 sinon * @param notrigger 1 ne declenche pas les triggers, 0 sinon
* \return int id de l'action creee, < 0 if KO * @return int id de l'action creee, < 0 if KO
*/ */
function add($user,$notrigger=0) function add($user,$notrigger=0)
{ {
@ -115,9 +116,10 @@ class ActionComm extends CommonObject
$this->label=dol_trunc(trim($this->label),128); $this->label=dol_trunc(trim($this->label),128);
$this->location=dol_trunc(trim($this->location),128); $this->location=dol_trunc(trim($this->location),128);
$this->note=dol_htmlcleanlastbr(trim($this->note)); $this->note=dol_htmlcleanlastbr(trim($this->note));
if (! $this->percentage) $this->percentage = 0; if (empty($this->percentage)) $this->percentage = 0;
if (! $this->priority) $this->priority = 0; if (empty($this->priority)) $this->priority = 0;
if (! $this->punctual) $this->punctual = 0; if (empty($this->fulldayevent)) $this->fuldayevent = 0;
if (empty($this->punctual)) $this->punctual = 0;
if ($this->percentage > 100) $this->percentage = 100; if ($this->percentage > 100) $this->percentage = 100;
if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date; if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date;
if ($this->datep && $this->datef) $this->durationp=($this->datef - $this->datep); if ($this->datep && $this->datef) $this->durationp=($this->datef - $this->datep);
@ -168,7 +170,7 @@ class ActionComm extends CommonObject
$sql.= "fk_user_author,"; $sql.= "fk_user_author,";
$sql.= "fk_user_action,"; $sql.= "fk_user_action,";
$sql.= "fk_user_done,"; $sql.= "fk_user_done,";
$sql.= "label,percent,priority,location,punctual,"; $sql.= "label,percent,priority,fulldayevent,location,punctual,";
$sql.= "fk_facture,"; $sql.= "fk_facture,";
$sql.= "propalrowid,"; $sql.= "propalrowid,";
$sql.= "fk_commande,"; $sql.= "fk_commande,";
@ -190,7 +192,7 @@ class ActionComm extends CommonObject
$sql.= ($user->id > 0 ? "'".$user->id."'":"null").","; $sql.= ($user->id > 0 ? "'".$user->id."'":"null").",";
$sql.= ($this->usertodo->id > 0?"'".$this->usertodo->id."'":"null").","; $sql.= ($this->usertodo->id > 0?"'".$this->usertodo->id."'":"null").",";
$sql.= ($this->userdone->id > 0?"'".$this->userdone->id."'":"null").","; $sql.= ($this->userdone->id > 0?"'".$this->userdone->id."'":"null").",";
$sql.= "'".addslashes($this->label)."','".$this->percentage."','".$this->priority."','".addslashes($this->location)."','".$this->punctual."',"; $sql.= "'".addslashes($this->label)."','".$this->percentage."','".$this->priority."','".$this->fulldayevent."','".addslashes($this->location)."','".$this->punctual."',";
$sql.= ($this->facid?$this->facid:"null").","; $sql.= ($this->facid?$this->facid:"null").",";
$sql.= ($this->propalrowid?$this->propalrowid:"null").","; $sql.= ($this->propalrowid?$this->propalrowid:"null").",";
$sql.= ($this->orderrowid?$this->orderrowid:"null").","; $sql.= ($this->orderrowid?$this->orderrowid:"null").",";
@ -227,8 +229,8 @@ class ActionComm extends CommonObject
} }
/** /**
* \brief Charge l'objet action depuis la base * Charge l'objet action depuis la base
* \param id id de l'action a recuperer * @param id id de l'action a recuperer
*/ */
function fetch($id) function fetch($id)
{ {
@ -246,7 +248,7 @@ class ActionComm extends CommonObject
$sql.= " a.fk_user_author, a.fk_user_mod,"; $sql.= " a.fk_user_author, a.fk_user_mod,";
$sql.= " a.fk_user_action, a.fk_user_done,"; $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.fk_contact, a.percent as percentage, a.fk_facture, a.fk_commande, a.propalrowid,";
$sql.= " a.priority, a.location,"; $sql.= " a.priority, a.fulldayevent, a.location,";
$sql.= " c.id as type_id, c.code as type_code, c.libelle,"; $sql.= " c.id as type_id, c.code as type_code, c.libelle,";
$sql.= " s.nom as socname,"; $sql.= " s.nom as socname,";
$sql.= " u.firstname, u.name"; $sql.= " u.firstname, u.name";
@ -288,6 +290,7 @@ class ActionComm extends CommonObject
$this->usertodo->id = $obj->fk_user_action; $this->usertodo->id = $obj->fk_user_action;
$this->userdone->id = $obj->fk_user_done; $this->userdone->id = $obj->fk_user_done;
$this->priority = $obj->priority; $this->priority = $obj->priority;
$this->fulldayevent = $obj->fulldayevent;
$this->location = $obj->location; $this->location = $obj->location;
$this->socid = $obj->fk_soc; // To have fetch_thirdparty method working $this->socid = $obj->fk_soc; // To have fetch_thirdparty method working
@ -328,8 +331,8 @@ class ActionComm extends CommonObject
} }
/** /**
* \brief Supprime l'action de la base * Supprime l'action de la base
* \return int <0 si ko, >0 si ok * @return int <0 si ko, >0 si ok
*/ */
function delete() function delete()
{ {
@ -349,17 +352,18 @@ class ActionComm extends CommonObject
} }
/** /**
* \brief Met a jour l'action en base. * Met a jour l'action en base.
* Si percentage = 100, on met a jour date 100% * Si percentage = 100, on met a jour date 100%
* \return int <0 si ko, >0 si ok * @return int <0 si ko, >0 si ok
*/ */
function update($user) function update($user)
{ {
// Clean parameters // Clean parameters
$this->label=trim($this->label); $this->label=trim($this->label);
$this->note=trim($this->note); $this->note=trim($this->note);
if (! $this->percentage) $this->percentage = 0; if (empty($this->percentage)) $this->percentage = 0;
if (! $this->priority) $this->priority = 0; if (empty($this->priority)) $this->priority = 0;
if (empty($this->fulldayevent)) $this->fulldayevent = 0;
if ($this->percentage > 100) $this->percentage = 100; if ($this->percentage > 100) $this->percentage = 100;
if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date; if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date;
if ($this->datep && $this->datef) $this->durationp=($this->datef - $this->datep); if ($this->datep && $this->datef) $this->durationp=($this->datef - $this->datep);
@ -388,6 +392,7 @@ class ActionComm extends CommonObject
$sql.= ", fk_project =". ($this->fk_project > 0 ? "'".$this->fk_project."'":"null"); $sql.= ", fk_project =". ($this->fk_project > 0 ? "'".$this->fk_project."'":"null");
$sql.= ", fk_contact =". ($this->contact->id > 0 ? "'".$this->contact->id."'":"null"); $sql.= ", fk_contact =". ($this->contact->id > 0 ? "'".$this->contact->id."'":"null");
$sql.= ", priority = '".$this->priority."'"; $sql.= ", priority = '".$this->priority."'";
$sql.= ", fulldayevent = '".$this->fulldayevent."'";
$sql.= ", location = ".($this->location ? "'".addslashes($this->location)."'":"null"); $sql.= ", location = ".($this->location ? "'".addslashes($this->location)."'":"null");
$sql.= ", fk_user_mod = '".$user->id."'"; $sql.= ", fk_user_mod = '".$user->id."'";
$sql.= ", fk_user_action=".($this->usertodo->id > 0 ? "'".$this->usertodo->id."'":"null"); $sql.= ", fk_user_action=".($this->usertodo->id > 0 ? "'".$this->usertodo->id."'":"null");

View File

@ -75,22 +75,26 @@ if ($_POST["action"] == 'add_action')
if (! empty($_POST["backtopage"])) $backtopage=$_POST["backtopage"]; if (! empty($_POST["backtopage"])) $backtopage=$_POST["backtopage"];
if (! $backtopage) if (! $backtopage)
{ {
if ($socid) $backtopage = DOL_URL_ROOT.'/comm/fiche.php?socid='.$socid; if ($socid > 0) $backtopage = DOL_URL_ROOT.'/comm/fiche.php?socid='.$socid;
else $backtopage=DOL_URL_ROOT.'/comm/action/index.php'; else $backtopage=DOL_URL_ROOT.'/comm/action/index.php';
} }
header("Location: ".$backtopage); header("Location: ".$backtopage);
exit; exit;
} }
// Clean parameters $fulldayevent=$_POST["fullday"];
$datep=dol_mktime($_POST["aphour"],
$_POST["apmin"], // Clean parameters
$datep=dol_mktime(
$fulldayevent?'00':$_POST["aphour"],
$fulldayevent?'00':$_POST["apmin"],
0, 0,
$_POST["apmonth"], $_POST["apmonth"],
$_POST["apday"], $_POST["apday"],
$_POST["apyear"]); $_POST["apyear"]);
$datep2=dol_mktime($_POST["p2hour"], $datep2=dol_mktime(
$_POST["p2min"], $fulldayevent?'23':$_POST["p2hour"],
$fulldayevent?'59':$_POST["p2min"],
0, 0,
$_POST["p2month"], $_POST["p2month"],
$_POST["p2day"], $_POST["p2day"],
@ -120,6 +124,7 @@ if ($_POST["action"] == 'add_action')
$actioncomm->type_id = $cactioncomm->id; $actioncomm->type_id = $cactioncomm->id;
$actioncomm->type_code = $cactioncomm->code; $actioncomm->type_code = $cactioncomm->code;
$actioncomm->priority = isset($_POST["priority"])?$_POST["priority"]:0; $actioncomm->priority = isset($_POST["priority"])?$_POST["priority"]:0;
$actioncomm->fulldayevent = $_POST["fullday"]?1:0;
$actioncomm->location = isset($_POST["location"])?$_POST["location"]:''; $actioncomm->location = isset($_POST["location"])?$_POST["location"]:'';
$actioncomm->label = trim($_POST["label"]); $actioncomm->label = trim($_POST["label"]);
if (! $_POST["label"]) if (! $_POST["label"])
@ -286,7 +291,9 @@ if (GETPOST("action") == 'update')
{ {
if (! $_POST["cancel"]) if (! $_POST["cancel"])
{ {
// Clean parameters $fulldayevent=$_POST["fullday"];
// Clean parameters
if ($_POST["aphour"] == -1) $_POST["aphour"]='0'; if ($_POST["aphour"] == -1) $_POST["aphour"]='0';
if ($_POST["apmin"] == -1) $_POST["apmin"]='0'; if ($_POST["apmin"] == -1) $_POST["apmin"]='0';
if ($_POST["p2hour"] == -1) $_POST["p2hour"]='0'; if ($_POST["p2hour"] == -1) $_POST["p2hour"]='0';
@ -297,15 +304,17 @@ if (GETPOST("action") == 'update')
$actioncomm = new Actioncomm($db); $actioncomm = new Actioncomm($db);
$actioncomm->fetch($id); $actioncomm->fetch($id);
$datep=dol_mktime($_POST["aphour"], $datep=dol_mktime(
$_POST["apmin"], $fulldayevent?'00':$_POST["aphour"],
$fulldayevent?'00':$_POST["apmin"],
0, 0,
$_POST["apmonth"], $_POST["apmonth"],
$_POST["apday"], $_POST["apday"],
$_POST["apyear"]); $_POST["apyear"]);
$datep2=dol_mktime($_POST["p2hour"], $datep2=dol_mktime(
$_POST["p2min"], $fulldayevent?'23':$_POST["p2hour"],
$fulldayevent?'59':$_POST["p2min"],
0, 0,
$_POST["p2month"], $_POST["p2month"],
$_POST["p2day"], $_POST["p2day"],
@ -334,6 +343,7 @@ if (GETPOST("action") == 'update')
//$actioncomm->dateend = $datea2; //$actioncomm->dateend = $datea2;
$actioncomm->percentage = $_POST["percentage"]; $actioncomm->percentage = $_POST["percentage"];
$actioncomm->priority = $_POST["priority"]; $actioncomm->priority = $_POST["priority"];
$actioncomm->fulldayevent= $_POST["fullday"]?1:0;
$actioncomm->location = isset($_POST["location"])?$_POST["location"]:''; $actioncomm->location = isset($_POST["location"])?$_POST["location"]:'';
$actioncomm->societe->id = $_POST["socid"]; $actioncomm->societe->id = $_POST["socid"];
$actioncomm->contact->id = $_POST["contactid"]; $actioncomm->contact->id = $_POST["contactid"];
@ -418,19 +428,40 @@ if (GETPOST('action') == 'create')
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
{ {
/*
print "\n".'<script type="text/javascript" language="javascript">'; print "\n".'<script type="text/javascript" language="javascript">';
print 'jQuery(document).ready(function () { print 'jQuery(document).ready(function () {
jQuery("#selectsocid").change(function() { function setdatefields()
document.formaction.action.value="create"; {
document.formaction.submit(); if (jQuery("#fullday:checked").val() == null)
{
jQuery(".fulldaystarthour").attr(\'disabled\', false);
jQuery(".fulldaystartmin").attr(\'disabled\', false);
jQuery(".fulldayendhour").attr(\'disabled\', false);
jQuery(".fulldayendmin").attr(\'disabled\', false);
}
else
{
jQuery(".fulldaystarthour").attr(\'disabled\', true);
jQuery(".fulldaystartmin").attr(\'disabled\', true);
jQuery(".fulldayendhour").attr(\'disabled\', true);
jQuery(".fulldayendmin").attr(\'disabled\', true);
jQuery(".fulldaystarthour").val("00");
jQuery(".fulldaystartmin").val("00");
//jQuery(".fulldayendhour").val("00");
//jQuery(".fulldayendmin").val("00");
jQuery(".fulldayendhour").val("23");
jQuery(".fulldayendmin").val("59");
}
}
setdatefields();
jQuery("#fullday").change(function() {
setdatefields();
}); });
})'; })';
print '</script>'."\n"; print '</script>'."\n";
*/
} }
print '<form name="formaction" action="fiche.php" method="POST">'; print '<form name="formaction" action="'.DOL_URL_ROOT.'/comm/action/fiche.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add_action">'; print '<input type="hidden" name="action" value="add_action">';
if (GETPOST("backtopage")) print '<input type="hidden" name="backtopage" value="'.(GETPOST("backtopage") != 1 ? GETPOST("backtopage") : $_SERVER["HTTP_REFERER"]).'">'; if (GETPOST("backtopage")) print '<input type="hidden" name="backtopage" value="'.(GETPOST("backtopage") != 1 ? GETPOST("backtopage") : $_SERVER["HTTP_REFERER"]).'">';
@ -463,17 +494,20 @@ if (GETPOST('action') == 'create')
// Location // Location
print '<tr><td>'.$langs->trans("Location").'</td><td><input type="text" name="location" size="60" value="'.GETPOST('location').'"></td></tr>'; print '<tr><td>'.$langs->trans("Location").'</td><td><input type="text" name="location" size="60" value="'.GETPOST('location').'"></td></tr>';
// Full day
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td><input type="checkbox" id="fullday" name="fullday" '.(GETPOST('fullday')?' checked="checked"':'').'></td></tr>';
// Date start // Date start
print '<tr><td width="30%" nowrap="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").'</span></td><td>'; print '<tr><td width="30%" nowrap="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").'</span></td><td>';
if (GETPOST("afaire") == 1) $html->select_date($actioncomm->datep,'ap',1,1,0,"action",1,1); if (GETPOST("afaire") == 1) $html->select_date($actioncomm->datep,'ap',1,1,0,"action",1,1,0,0,'fulldayend');
else if (GETPOST("afaire") == 2) $html->select_date($actioncomm->datep,'ap',1,1,1,"action",1,1); else if (GETPOST("afaire") == 2) $html->select_date($actioncomm->datep,'ap',1,1,1,"action",1,1,0,0,'fulldayend');
else $html->select_date($actioncomm->datep,'ap',1,1,1,"action",1,1); else $html->select_date($actioncomm->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
print '</td></tr>'; print '</td></tr>';
// Date end // Date end
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td>'; print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td>';
if (GETPOST("afaire") == 1) $html->select_date($actioncomm->datef,'p2',1,1,1,"action",1,1); if (GETPOST("afaire") == 1) $html->select_date($actioncomm->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
else if (GETPOST("afaire") == 2) $html->select_date($actioncomm->datef,'p2',1,1,1,"action",1,1); else if (GETPOST("afaire") == 2) $html->select_date($actioncomm->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
else $html->select_date($actioncomm->datef,'p2',1,1,1,"action",1,1); else $html->select_date($actioncomm->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
print '</td></tr>'; print '</td></tr>';
// Avancement // Avancement
@ -578,9 +612,7 @@ if (GETPOST('action') == 'create')
print "</form>"; print "</form>";
} }
/* // View or edit
* Affichage action en mode edition ou visu
*/
if ($id) if ($id)
{ {
if ($error) if ($error)
@ -638,8 +670,43 @@ if ($id)
if (GETPOST("action") == 'edit') if (GETPOST("action") == 'edit')
{ {
// Fiche action en mode edition if ($conf->use_javascript_ajax)
print '<form name="formaction" action="fiche.php" method="post">'; {
print "\n".'<script type="text/javascript" language="javascript">';
print 'jQuery(document).ready(function () {
function setdatefields()
{
if (jQuery("#fullday:checked").val() == null)
{
jQuery(".fulldaystarthour").attr(\'disabled\', false);
jQuery(".fulldaystartmin").attr(\'disabled\', false);
jQuery(".fulldayendhour").attr(\'disabled\', false);
jQuery(".fulldayendmin").attr(\'disabled\', false);
}
else
{
jQuery(".fulldaystarthour").attr(\'disabled\', true);
jQuery(".fulldaystartmin").attr(\'disabled\', true);
jQuery(".fulldayendhour").attr(\'disabled\', true);
jQuery(".fulldayendmin").attr(\'disabled\', true);
jQuery(".fulldaystarthour").val("00");
jQuery(".fulldaystartmin").val("00");
//jQuery(".fulldayendhour").val("00");
//jQuery(".fulldayendmin").val("00");
jQuery(".fulldayendhour").val("23");
jQuery(".fulldayendmin").val("59");
}
}
setdatefields();
jQuery("#fullday").change(function() {
setdatefields();
});
})';
print '</script>'."\n";
}
// Fiche action en mode edition
print '<form name="formaction" action="'.DOL_URL_ROOT.'/comm/action/fiche.php" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="id" value="'.$id.'">'; print '<input type="hidden" name="id" value="'.$id.'">';
@ -659,17 +726,20 @@ if ($id)
// Location // Location
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" size="50" value="'.$act->location.'"></td></tr>'; print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" size="50" value="'.$act->location.'"></td></tr>';
// Full day event
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3"><input type="checkbox" id="fullday" name="fullday" '.($act->fulldayevent?' checked="true"':'').'></td></tr>';
// Date start // Date start
print '<tr><td nowrap="nowrap" class="fieldrequired">'.$langs->trans("DateActionStart").'</td><td colspan="3">'; print '<tr><td nowrap="nowrap" class="fieldrequired">'.$langs->trans("DateActionStart").'</td><td colspan="3">';
if (GETPOST("afaire") == 1) $html->select_date($act->datep,'ap',1,1,0,"action",1,1); if (GETPOST("afaire") == 1) $html->select_date($act->datep,'ap',1,1,0,"action",1,1,0,0,'fulldaystart');
else if (GETPOST("afaire") == 2) $html->select_date($act->datep,'ap',1,1,1,"action",1,1); else if (GETPOST("afaire") == 2) $html->select_date($act->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
else $html->select_date($act->datep,'ap',1,1,1,"action",1,1); else $html->select_date($act->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
print '</td></tr>'; print '</td></tr>';
// Date end // Date end
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="3">';
if (GETPOST("afaire") == 1) $html->select_date($act->datef,'p2',1,1,1,"action",1,1); if (GETPOST("afaire") == 1) $html->select_date($act->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
else if (GETPOST("afaire") == 2) $html->select_date($act->datef,'p2',1,1,1,"action",1,1); else if (GETPOST("afaire") == 2) $html->select_date($act->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
else $html->select_date($act->datef,'p2',1,1,1,"action",1,1); else $html->select_date($act->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
print '</td></tr>'; print '</td></tr>';
// Status // Status
@ -772,6 +842,9 @@ if ($id)
// Location // Location
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3">'.$act->location.'</td></tr>'; print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3">'.$act->location.'</td></tr>';
// Full day event
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($act->fulldayevent).'</td></tr>';
// Date debut // Date debut
print '<tr><td width="30%">'.$langs->trans("DateActionStart").'</td><td colspan="3">'; print '<tr><td width="30%">'.$langs->trans("DateActionStart").'</td><td colspan="3">';
print dol_print_date($act->datep,'dayhour'); print dol_print_date($act->datep,'dayhour');

View File

@ -485,7 +485,7 @@ class Form
print '</select>'; print '</select>';
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
} }
/** /**
* Output html form to select a third party * Output html form to select a third party
* @param selected Preselected type * @param selected Preselected type
@ -512,7 +512,7 @@ class Form
function select_company($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0) function select_company($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0)
{ {
global $conf,$user,$langs; global $conf,$user,$langs;
$out=''; $out='';
// On recherche les societes // On recherche les societes
@ -594,7 +594,7 @@ class Form
{ {
dol_print_error($this->db); dol_print_error($this->db);
} }
return $out; return $out;
} }
@ -2521,25 +2521,25 @@ class Form
/** /**
* Affiche zone de selection de date * Show a HTML widget to input a date or combo list for daye, month, years and optionnaly hours and minutes
* Liste deroulante pour les jours, mois, annee et eventuellement heurs et minutes * Fields are preselected with :
* Les champs sont pre-selectionnes avec: * - set_time date (Local PHP server timestamps ou date au format YYYY-MM-DD ou YYYY-MM-DD HH:MM)
* - La date set_time (Local PHP server timestamps ou date au format YYYY-MM-DD ou YYYY-MM-DD HH:MM) * - local date of PHP server if set_time is ''
* - La date local du server PHP si set_time vaut '' * - Empty (fields empty) if set_time is -1 (in this case, parameter empty must also have value 1)
* - Aucune date (champs vides) si set_time vaut -1 (dans ce cas empty doit valoir 1)
* @param set_time Pre-selected date (must be a local PHP server timestamp) * @param set_time Pre-selected date (must be a local PHP server timestamp)
* @param prefix Prefix pour nom champ * @param prefix Prefix for fields name
* @param h 1=Affiche aussi les heures * @param h 1=Show also hours
* @param m 1=Affiche aussi les minutes * @param m 1=Show also minutes
* @param empty 0=Champ obligatoire, 1=Permet une saisie vide * @param empty 0=Fields required, 1=Empty input is allowed
* @param form_name Nom du formulaire de provenance. Utilise pour les dates en popup. * @param form_name Form name. Used by popup dates.
* @param d 1=Affiche aussi les jours, mois, annees * @param d 1=Show days, month, years
* @param addnowbutton Add a button "Now" * @param addnowbutton Add a button "Now"
* @param nooutput Do not output html string but return it * @param nooutput Do not output html string but return it
* @param disabled Disable input fields * @param disabled Disable input fields
* @param fullday When a checkbox with this html name is on, hour and day are set with 00:00 or 23:59
* @return nothing or string if nooutput is 1 * @return nothing or string if nooutput is 1
*/ */
function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowbutton=0, $nooutput=0, $disabled=0) function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowbutton=0, $nooutput=0, $disabled=0, $fullday='')
{ {
global $conf,$langs; global $conf,$langs;
@ -2651,7 +2651,7 @@ class Form
} }
/* /*
* Affiche date en select * Show date with combo selects
*/ */
if (! $conf->use_javascript_ajax || ! $conf->use_popup_calendar) if (! $conf->use_javascript_ajax || ! $conf->use_popup_calendar)
{ {
@ -2726,7 +2726,7 @@ class Form
/* /*
* Affiche heure en select * Affiche heure en select
*/ */
$retstring.='<select'.($disabled?' disabled="true"':'').' class="flat" name="'.$prefix.'hour">'; $retstring.='<select'.($disabled?' disabled="true"':'').' class="flat '.($fullday?$fullday.'hour':'').'" name="'.$prefix.'hour">';
if ($empty) $retstring.='<option value="-1">&nbsp;</option>'; if ($empty) $retstring.='<option value="-1">&nbsp;</option>';
for ($hour = 0; $hour < 24; $hour++) for ($hour = 0; $hour < 24; $hour++)
{ {
@ -2752,7 +2752,7 @@ class Form
/* /*
* Affiche min en select * Affiche min en select
*/ */
$retstring.='<select'.($disabled?' disabled="true"':'').' class="flat" name="'.$prefix.'min">'; $retstring.='<select'.($disabled?' disabled="true"':'').' class="flat '.($fullday?$fullday.'min':'').'" name="'.$prefix.'min">';
if ($empty) $retstring.='<option value="-1">&nbsp;</option>'; if ($empty) $retstring.='<option value="-1">&nbsp;</option>';
for ($min = 0; $min < 60 ; $min++) for ($min = 0; $min < 60 ; $min++)
{ {
@ -2773,8 +2773,7 @@ class Form
$retstring.="M\n"; $retstring.="M\n";
} }
// Added by Matelli http://matelli.fr/showcases/patchs-dolibarr/update-date-input-in-action-form.html) // Add a "Now" button
// "Now" button
if ($conf->use_javascript_ajax && $addnowbutton) if ($conf->use_javascript_ajax && $addnowbutton)
{ {
// Script which will be inserted in the OnClick of the "Now" button // Script which will be inserted in the OnClick of the "Now" button
@ -2795,17 +2794,21 @@ class Form
// Generate the hour part // Generate the hour part
if ($h) if ($h)
{ {
if ($fullday) $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); '; $reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
if ($fullday) $reset_scripts .= ' } ';
} }
// Generate the minute part // Generate the minute part
if ($m) if ($m)
{ {
if ($fullday) $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); '; $reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
if ($fullday) $reset_scripts .= ' } ';
} }
// If reset_scripts is not empty, print the button with the reset_scripts in OnClick // If reset_scripts is not empty, print the button with the reset_scripts in OnClick
if ($reset_scripts) if ($reset_scripts)
{ {
$retstring.='<button class="dpInvisibleButtons" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="Maintenant" onClick="'.$reset_scripts.'">'; $retstring.='<button class="dpInvisibleButtons" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="Now" onClick="'.$reset_scripts.'">';
$retstring.=$langs->trans("Now"); $retstring.=$langs->trans("Now");
//print img_refresh($langs->trans("Now")); //print img_refresh($langs->trans("Now"));
$retstring.='</button> '; $retstring.='</button> ';
@ -3224,7 +3227,7 @@ class Form
return $ret; return $ret;
} }
/** /**
* Return select list of groups * Return select list of groups
* @param selected Id group preselected * @param selected Id group preselected
@ -3277,9 +3280,9 @@ class Form
$out.= ' selected="selected"'; $out.= ' selected="selected"';
} }
$out.= '>'; $out.= '>';
$out.= $obj->nom; $out.= $obj->nom;
$out.= '</option>'; $out.= '</option>';
$i++; $i++;
} }
@ -3293,7 +3296,7 @@ class Form
return $out; return $out;
} }
} }
?> ?>

View File

@ -104,3 +104,5 @@ UPDATE llx_societe SET canvas = 'default' WHERE canvas = 'default@thirdparty';
UPDATE llx_societe SET canvas = 'individual' WHERE canvas = 'individual@thirdparty'; UPDATE llx_societe SET canvas = 'individual' WHERE canvas = 'individual@thirdparty';
insert into llx_const (name, value, type, note, visible) values ('MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS','7','chaine','Tolérance de retard avant alerte (en jours) sur commandes fournisseurs non traitées',0); insert into llx_const (name, value, type, note, visible) values ('MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS','7','chaine','Tolérance de retard avant alerte (en jours) sur commandes fournisseurs non traitées',0);
ALTER TABLE llx_actioncomm ADD COLUMN fulldayevent smallint NOT NULL default 0 after priority;

View File

@ -45,6 +45,7 @@ create table llx_actioncomm
fk_user_action integer, -- id de la personne qui doit effectuer l'action fk_user_action integer, -- id de la personne qui doit effectuer l'action
fk_user_done integer, -- id de la personne qui a effectue l'action fk_user_done integer, -- id de la personne qui a effectue l'action
priority smallint, priority smallint,
fulldayevent smallint NOT NULL default 0,
punctual smallint NOT NULL default 1, punctual smallint NOT NULL default 1,
percent smallint NOT NULL default 0, percent smallint NOT NULL default 0,
location varchar(128), location varchar(128),

View File

@ -11,6 +11,7 @@ DoneBy= Done by
Events= Events Events= Events
ListOfActions=List of events ListOfActions=List of events
Location=Location Location=Location
EventOnFullDay=Event on full day
SearchAnAction= Search an action/task SearchAnAction= Search an action/task
MenuToDoActions= All incomplete actions MenuToDoActions= All incomplete actions
MenuDoneActions= All terminated actions MenuDoneActions= All terminated actions

View File

@ -10,6 +10,7 @@ AffectedTo=Affecté à
DoneBy=Réalisé par DoneBy=Réalisé par
Events=Evénements Events=Evénements
ListOfActions=Liste des événements ListOfActions=Liste des événements
EventOnFullDay=Evênement sur la journée
Location=Lieu Location=Lieu
SearchAnAction=Rechercher une action/tâche SearchAnAction=Rechercher une action/tâche
MenuToDoActions=Les actions incomplètes MenuToDoActions=Les actions incomplètes