mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-06 17:13:03 +01:00
New: Enhance agenda module to reach RFC2445 (add busy information).
This commit is contained in:
@@ -29,6 +29,7 @@ For users:
|
||||
and a delay.
|
||||
- New: Can define a different clicktodial setup per user.
|
||||
- New: Add option INVOICE_CAN_NEVER_BE_REMOVED.
|
||||
- New: Enhance agenda module to reach RFC2445 (add busy information).
|
||||
- First change to prepare feature click to print for PDF.
|
||||
|
||||
For translators:
|
||||
|
||||
@@ -59,7 +59,7 @@ class ActionComm extends CommonObject
|
||||
var $punctual = 1; // Milestone
|
||||
var $percentage; // Percentage
|
||||
var $location; // Location
|
||||
|
||||
var $transparency; // Transparency (ical standard). Used to say if people assigned to event are busy or not by event. 0=available, 1=busy, 2=busy (refused events)
|
||||
var $priority; // Free text ('' By default)
|
||||
var $note; // Description
|
||||
|
||||
@@ -121,6 +121,7 @@ class ActionComm extends CommonObject
|
||||
if (empty($this->priority)) $this->priority = 0;
|
||||
if (empty($this->fulldayevent)) $this->fulldayevent = 0;
|
||||
if (empty($this->punctual)) $this->punctual = 0;
|
||||
if (empty($this->transparency)) $this->transparency = 0;
|
||||
if ($this->percentage > 100) $this->percentage = 100;
|
||||
if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date;
|
||||
if (! empty($this->datep) && ! empty($this->datef)) $this->durationp=($this->datef - $this->datep);
|
||||
@@ -178,6 +179,7 @@ class ActionComm extends CommonObject
|
||||
$sql.= "fk_user_action,";
|
||||
$sql.= "fk_user_done,";
|
||||
$sql.= "label,percent,priority,fulldayevent,location,punctual,";
|
||||
$sql.= "transparency,";
|
||||
$sql.= "fk_element,";
|
||||
$sql.= "elementtype,";
|
||||
$sql.= "entity";
|
||||
@@ -196,6 +198,7 @@ class ActionComm extends CommonObject
|
||||
$sql.= (isset($this->usertodo->id) && $this->usertodo->id > 0?"'".$this->usertodo->id."'":"null").",";
|
||||
$sql.= (isset($this->userdone->id) && $this->userdone->id > 0?"'".$this->userdone->id."'":"null").",";
|
||||
$sql.= "'".$this->db->escape($this->label)."','".$this->percentage."','".$this->priority."','".$this->fulldayevent."','".$this->db->escape($this->location)."','".$this->punctual."',";
|
||||
$sql.= "'".$this->transparency."',";
|
||||
$sql.= (! empty($this->fk_element)?$this->fk_element:"null").",";
|
||||
$sql.= (! empty($this->elementtype)?"'".$this->elementtype."'":"null").",";
|
||||
$sql.= $conf->entity;
|
||||
@@ -282,7 +285,7 @@ class ActionComm extends CommonObject
|
||||
$sql.= " a.fk_user_action, a.fk_user_done,";
|
||||
$sql.= " a.fk_contact, a.percent as percentage,";
|
||||
$sql.= " a.fk_element, a.elementtype,";
|
||||
$sql.= " a.priority, a.fulldayevent, a.location,";
|
||||
$sql.= " a.priority, a.fulldayevent, a.location, a.transparency,";
|
||||
$sql.= " c.id as type_id, c.code as type_code, c.libelle,";
|
||||
$sql.= " s.nom as socname,";
|
||||
$sql.= " u.firstname, u.lastname as lastname";
|
||||
@@ -331,6 +334,7 @@ class ActionComm extends CommonObject
|
||||
$this->priority = $obj->priority;
|
||||
$this->fulldayevent = $obj->fulldayevent;
|
||||
$this->location = $obj->location;
|
||||
$this->transparency = $obj->transparency;
|
||||
|
||||
$this->socid = $obj->fk_soc; // To have fetch_thirdparty method working
|
||||
$this->societe->id = $obj->fk_soc;
|
||||
@@ -437,6 +441,7 @@ class ActionComm extends CommonObject
|
||||
$this->note=trim($this->note);
|
||||
if (empty($this->percentage)) $this->percentage = 0;
|
||||
if (empty($this->priority)) $this->priority = 0;
|
||||
if (empty($this->transparency)) $this->transparency = 0;
|
||||
if (empty($this->fulldayevent)) $this->fulldayevent = 0;
|
||||
if ($this->percentage > 100) $this->percentage = 100;
|
||||
if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date;
|
||||
@@ -471,6 +476,7 @@ class ActionComm extends CommonObject
|
||||
$sql.= ", priority = '".$this->priority."'";
|
||||
$sql.= ", fulldayevent = '".$this->fulldayevent."'";
|
||||
$sql.= ", location = ".($this->location ? "'".$this->db->escape($this->location)."'":"null");
|
||||
$sql.= ", transparency = '".$this->transparency."'";
|
||||
$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");
|
||||
@@ -952,7 +958,7 @@ class ActionComm extends CommonObject
|
||||
$event['priority']=$obj->priority;
|
||||
$event['fulldayevent']=$obj->fulldayevent;
|
||||
$event['location']=$obj->location;
|
||||
$event['transparency']='TRANSPARENT'; // OPAQUE (busy) or TRANSPARENT (not busy)
|
||||
$event['transparency']=(($obj->transparency > 0)?'OPAQUE':'TRANSPARENT'); // OPAQUE (busy) or TRANSPARENT (not busy)
|
||||
$event['category']=$obj->libelle; // libelle type action
|
||||
// Define $urlwithroot
|
||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
|
||||
@@ -1058,6 +1064,7 @@ class ActionComm extends CommonObject
|
||||
$this->punctual=0;
|
||||
$this->percentage=0;
|
||||
$this->location='Location';
|
||||
$this->transparency=0;
|
||||
$this->priority='Priority X';
|
||||
$this->note = 'Note';
|
||||
}
|
||||
|
||||
@@ -136,6 +136,7 @@ if ($action == 'add_action')
|
||||
$actioncomm->priority = GETPOST("priority")?GETPOST("priority"):0;
|
||||
$actioncomm->fulldayevent = (! empty($fulldayevent)?1:0);
|
||||
$actioncomm->location = GETPOST("location");
|
||||
$actioncomm->transparency = (GETPOST("transparency")=='on'?1:0);
|
||||
$actioncomm->label = trim(GETPOST('label'));
|
||||
if (! GETPOST('label'))
|
||||
{
|
||||
@@ -313,7 +314,7 @@ if ($action == 'update')
|
||||
$actioncomm->percentage = $percentage;
|
||||
$actioncomm->priority = $_POST["priority"];
|
||||
$actioncomm->fulldayevent= $_POST["fullday"]?1:0;
|
||||
$actioncomm->location = isset($_POST["location"])?$_POST["location"]:'';
|
||||
$actioncomm->location = GETPOST('location');
|
||||
$actioncomm->societe->id = $_POST["socid"];
|
||||
$actioncomm->contact->id = $_POST["contactid"];
|
||||
$actioncomm->fk_project = $_POST["projectid"];
|
||||
@@ -333,6 +334,8 @@ if ($action == 'update')
|
||||
$usertodo->fetch($_POST["affectedto"]);
|
||||
}
|
||||
$actioncomm->usertodo = $usertodo;
|
||||
$actioncomm->transparency=(GETPOST("transparency")=='on'?1:0);
|
||||
|
||||
$userdone=new User($db);
|
||||
if ($_POST["doneby"])
|
||||
{
|
||||
@@ -509,16 +512,24 @@ if ($action == 'create')
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Affected by
|
||||
// Assigned to
|
||||
$var=false;
|
||||
print '<tr><td width="30%" nowrap="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td>';
|
||||
$form->select_users(GETPOST("affectedto")?GETPOST("affectedto"):(! empty($actioncomm->usertodo->id) && $actioncomm->usertodo->id > 0 ? $actioncomm->usertodo->id : $user->id),'affectedto',1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Busy
|
||||
print '<tr><td width="30%" nowrap="nowrap">'.$langs->trans("Busy").'</td><td>';
|
||||
print '<input id="transparency" type="checkbox" name="transparency" value="'.$actioncomm->transparency.'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Realised by
|
||||
print '<tr><td nowrap>'.$langs->trans("ActionDoneBy").'</td><td>';
|
||||
$form->select_users(GETPOST("doneby")?GETPOST("doneby"):(! empty($actioncomm->userdone->id) && $percent==100?$actioncomm->userdone->id:0),'doneby',1);
|
||||
print '</td></tr>';
|
||||
if ($conf->global->AGENDA_ENABLE_DONEBY)
|
||||
{
|
||||
print '<tr><td nowrap>'.$langs->trans("ActionDoneBy").'</td><td>';
|
||||
$form->select_users(GETPOST("doneby")?GETPOST("doneby"):(! empty($actioncomm->userdone->id) && $percent==100?$actioncomm->userdone->id:0),'doneby',1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '<br><br>';
|
||||
@@ -745,21 +756,23 @@ if ($id > 0)
|
||||
|
||||
print '</table><br><br><table class="border" width="100%">';
|
||||
|
||||
// Input by
|
||||
$var=false;
|
||||
print '<tr><td width="30%" nowrap="nowrap">'.$langs->trans("ActionAskedBy").'</td><td colspan="3">';
|
||||
print $act->author->getNomUrl(1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Affected to
|
||||
print '<tr><td nowrap="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td colspan="3">';
|
||||
// Assigned to
|
||||
print '<tr><td width="30%" nowrap="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td colspan="3">';
|
||||
print $form->select_dolusers($act->usertodo->id>0?$act->usertodo->id:-1,'affectedto',1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Busy
|
||||
print '<tr><td nowrap="nowrap">'.$langs->trans("Busy").'</td><td>';
|
||||
print '<input id="transparency" type="checkbox" name="transparency"'.($act->transparency?' checked="checked"':'').'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Realised by
|
||||
print '<tr><td nowrap="nowrap">'.$langs->trans("ActionDoneBy").'</td><td colspan="3">';
|
||||
print $form->select_dolusers($act->userdone->id> 0?$act->userdone->id:-1,'doneby',1);
|
||||
print '</td></tr>';
|
||||
if ($conf->global->AGENDA_ENABLE_DONEBY)
|
||||
{
|
||||
print '<tr><td nowrap="nowrap">'.$langs->trans("ActionDoneBy").'</td><td colspan="3">';
|
||||
print $form->select_dolusers($act->userdone->id> 0?$act->userdone->id:-1,'doneby',1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table><br><br>';
|
||||
|
||||
@@ -909,23 +922,24 @@ if ($id > 0)
|
||||
|
||||
print '</table><br><br><table class="border" width="100%">';
|
||||
|
||||
// Input by
|
||||
$var=false;
|
||||
print '<tr><td width="30%" nowrap="nowrap">'.$langs->trans("ActionAskedBy").'</td><td colspan="3">';
|
||||
if ($act->author->id > 0) print $act->author->getNomUrl(1);
|
||||
else print ' ';
|
||||
print '</td></tr>';
|
||||
|
||||
// Affecte a
|
||||
print '<tr><td nowrap="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td colspan="3">';
|
||||
// Assigned to
|
||||
print '<tr><td width="30%" nowrap="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td colspan="3">';
|
||||
if ($act->usertodo->id > 0) print $act->usertodo->getNomUrl(1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Done by
|
||||
print '<tr><td nowrap="nowrap">'.$langs->trans("ActionDoneBy").'</td><td colspan="3">';
|
||||
if ($act->userdone->id > 0) print $act->userdone->getNomUrl(1);
|
||||
// Busy
|
||||
print '<tr><td nowrap="nowrap">'.$langs->trans("Busy").'</td><td colspan="3">';
|
||||
print yn(($act->transparency > 0)?1:0);
|
||||
print '</td></tr>';
|
||||
|
||||
// Done by
|
||||
if ($conf->global->AGENDA_ENABLE_DONEBY)
|
||||
{
|
||||
print '<tr><td nowrap="nowrap">'.$langs->trans("ActionDoneBy").'</td><td colspan="3">';
|
||||
if ($act->userdone->id > 0) print $act->userdone->getNomUrl(1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table><br><br><table class="border" width="100%">';
|
||||
|
||||
// Third party - Contact
|
||||
|
||||
@@ -227,3 +227,6 @@ ALTER TABLE llx_socpeople ADD COLUMN ref_ext varchar(128) after entity;
|
||||
ALTER TABLE llx_socpeople ADD COLUMN note_public text after note;
|
||||
ALTER TABLE llx_societe ADD COLUMN note_public text after note;
|
||||
|
||||
ALTER TABLE llx_actioncomm ADD COLUMN transparency integer after fk_user_action;
|
||||
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ create table llx_actioncomm
|
||||
fk_parent integer NOT NULL default 0,
|
||||
|
||||
fk_user_action integer, -- id de la personne qui doit effectuer l'action
|
||||
transparency integer, -- transparency (ical standard). used to say if people assigned to event are busy or not by event.
|
||||
fk_user_done integer, -- id de la personne qui a effectue l'action
|
||||
priority smallint,
|
||||
fulldayevent smallint NOT NULL default 0,
|
||||
|
||||
Reference in New Issue
Block a user