forked from Wavyzz/dolibarr
WIP Recurring events
This commit is contained in:
@@ -2597,11 +2597,6 @@ if ($id > 0) {
|
|||||||
// Full day event
|
// Full day event
|
||||||
print '<tr><td class="titlefieldmiddle">'.$langs->trans("EventOnFullDay").'</td><td>'.yn($object->fulldayevent ? 1 : 0, 3).'</td></tr>';
|
print '<tr><td class="titlefieldmiddle">'.$langs->trans("EventOnFullDay").'</td><td>'.yn($object->fulldayevent ? 1 : 0, 3).'</td></tr>';
|
||||||
|
|
||||||
// Event into a series
|
|
||||||
if ($object->recurid) {
|
|
||||||
print '<tr><td class="titlefieldmiddle">'.$langs->trans("EventIntoASerie").'</td><td>'.dol_escape_htmltag($object->recurid).'</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$rowspan = 4;
|
$rowspan = 4;
|
||||||
if (!getDolGlobalString('AGENDA_DISABLE_LOCATION')) {
|
if (!getDolGlobalString('AGENDA_DISABLE_LOCATION')) {
|
||||||
$rowspan++;
|
$rowspan++;
|
||||||
@@ -2638,6 +2633,17 @@ if ($id > 0) {
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Recurring event (into a series)
|
||||||
|
if ($object->recurid) {
|
||||||
|
print '<tr><td class="titlefieldmiddle">'.$langs->trans("RecurringEvent").'</td><td>';
|
||||||
|
print img_picto($langs->trans("EventPartOfARecurringSerie", $object->recurid), 'recurring', 'class="pictofixedwidth"');
|
||||||
|
$reg = array();
|
||||||
|
if (preg_match('/FREQ=MONTHLY_BYMONTHDAY(\d+)/', $object->recurrule, $reg)) {
|
||||||
|
print $langs->trans("EveryMonth").' <span class="opacitymedium small">('.$langs->trans("DayOfMonth").' '.$reg[1].' - '.$langs->trans("Until").' '.dol_print_date($object->recurdateend, 'day').')</span>';
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
// Location
|
// Location
|
||||||
if (!getDolGlobalString('AGENDA_DISABLE_LOCATION')) {
|
if (!getDolGlobalString('AGENDA_DISABLE_LOCATION')) {
|
||||||
print '<tr><td>'.$langs->trans("Location").'</td><td>'.$object->location.'</td></tr>';
|
print '<tr><td>'.$langs->trans("Location").'</td><td>'.$object->location.'</td></tr>';
|
||||||
@@ -2751,10 +2757,10 @@ if ($id > 0) {
|
|||||||
|
|
||||||
// Object linked (if link is for thirdparty, contact, project it is a recording error. We should not have links in link table
|
// Object linked (if link is for thirdparty, contact, project it is a recording error. We should not have links in link table
|
||||||
// for such objects because there is already a dedicated field into table llx_actioncomm.
|
// for such objects because there is already a dedicated field into table llx_actioncomm.
|
||||||
if (!empty($object->fk_element) && !empty($object->elementtype) && !in_array($object->elementtype, array('societe', 'contact', 'project'))) {
|
if (!empty($object->elementid) && !empty($object->elementtype) && !in_array($object->elementtype, array('societe', 'contact', 'project'))) {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
print '<tr><td>'.$langs->trans("LinkedObject").'</td>';
|
print '<tr><td>'.$langs->trans("LinkedObject").'</td>';
|
||||||
$link = dolGetElementUrl($object->fk_element, $object->elementtype, 1);
|
$link = dolGetElementUrl($object->elementid, $object->elementtype, ($object->elementtype == 'user' ? -1 : 1));
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (empty($link)) {
|
if (empty($link)) {
|
||||||
print '<span class="opacitymedium">'.$langs->trans("ObjectDeleted").'</span>';
|
print '<span class="opacitymedium">'.$langs->trans("ObjectDeleted").'</span>';
|
||||||
|
|||||||
@@ -820,6 +820,7 @@ class ActionComm extends CommonObject
|
|||||||
$sql .= " a.fk_element as elementid, a.elementtype,";
|
$sql .= " a.fk_element as elementid, a.elementtype,";
|
||||||
$sql .= " a.priority, a.fulldayevent, a.location, a.transparency,";
|
$sql .= " a.priority, a.fulldayevent, a.location, a.transparency,";
|
||||||
$sql .= " a.email_msgid, a.email_subject, a.email_from, a.email_sender, a.email_to, a.email_tocc, a.email_tobcc, a.errors_to,";
|
$sql .= " a.email_msgid, a.email_subject, a.email_from, a.email_sender, a.email_to, a.email_tocc, a.email_tobcc, a.errors_to,";
|
||||||
|
$sql .= " a.recurid, a.recurrule, a.recurdateend,";
|
||||||
$sql .= " c.id as type_id, c.type as type_type, c.code as type_code, c.libelle as type_label, c.color as type_color, c.picto as type_picto,";
|
$sql .= " c.id as type_id, c.type as type_type, c.code as type_code, c.libelle as type_label, c.color as type_color, c.picto as type_picto,";
|
||||||
$sql .= " s.nom as socname,";
|
$sql .= " s.nom as socname,";
|
||||||
$sql .= " u.firstname, u.lastname as lastname,";
|
$sql .= " u.firstname, u.lastname as lastname,";
|
||||||
@@ -902,6 +903,10 @@ class ActionComm extends CommonObject
|
|||||||
$this->elementid = $obj->elementid;
|
$this->elementid = $obj->elementid;
|
||||||
$this->elementtype = $obj->elementtype;
|
$this->elementtype = $obj->elementtype;
|
||||||
|
|
||||||
|
$this->recurid = $obj->recurid;
|
||||||
|
$this->recurrule = $obj->recurrule;
|
||||||
|
$this->recurdateend = $this->db->jdate($obj->recurdateend);
|
||||||
|
|
||||||
$this->num_vote = $obj->num_vote;
|
$this->num_vote = $obj->num_vote;
|
||||||
$this->event_paid = $obj->event_paid;
|
$this->event_paid = $obj->event_paid;
|
||||||
$this->status = $obj->status;
|
$this->status = $obj->status;
|
||||||
|
|||||||
@@ -2109,14 +2109,14 @@ function getSoapParams()
|
|||||||
* Return link url to an object
|
* Return link url to an object
|
||||||
*
|
*
|
||||||
* @param int $objectid Id of record
|
* @param int $objectid Id of record
|
||||||
* @param string $objecttype Type of object ('invoice', 'order', 'expedition_bon', 'myobject@mymodule', ...)
|
* @param string $objecttype Type of object ('invoice', 'order', 'expedition_bon', 'user', 'myobject@mymodule', ...)
|
||||||
* @param int $withpicto Picto to show
|
* @param int $withpicto Picto to show
|
||||||
* @param string $option More options
|
* @param string $option More options
|
||||||
* @return string URL of link to object id/type
|
* @return string URL of link to object id/type
|
||||||
*/
|
*/
|
||||||
function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '')
|
function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '')
|
||||||
{
|
{
|
||||||
global $db, $conf, $langs;
|
global $db, $langs;
|
||||||
|
|
||||||
$ret = '';
|
$ret = '';
|
||||||
$regs = array();
|
$regs = array();
|
||||||
|
|||||||
@@ -207,3 +207,5 @@ BookcalBookingTitle=Online appointment
|
|||||||
Transparency = Transparency
|
Transparency = Transparency
|
||||||
ReadMore = Read more
|
ReadMore = Read more
|
||||||
ReadLess = Read less
|
ReadLess = Read less
|
||||||
|
RecurringEvent=Recurring event
|
||||||
|
EventPartOfARecurringSerie=Event is part of a recurring serie with ID %s
|
||||||
|
|||||||
Reference in New Issue
Block a user