|
|
|
|
@@ -99,7 +99,7 @@ if ($fulldayevent) {
|
|
|
|
|
$datep = dol_mktime($aphour, $apmin, 0, GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), 'tzuserrel');
|
|
|
|
|
$datef = dol_mktime($p2hour, $p2min, 59, GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), 'tzuserrel');
|
|
|
|
|
}
|
|
|
|
|
$reg = array();
|
|
|
|
|
$reg = [];
|
|
|
|
|
if (GETPOST('datep')) {
|
|
|
|
|
if (GETPOST('datep') == 'now') {
|
|
|
|
|
$datep = dol_now();
|
|
|
|
|
@@ -166,13 +166,20 @@ if ($reshook < 0) {
|
|
|
|
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$TRemindTypes = array();
|
|
|
|
|
$TRemindTypes = [];
|
|
|
|
|
if (getDolGlobalString('AGENDA_REMINDER_BROWSER')) {
|
|
|
|
|
$TRemindTypes['browser'] = array('label' => $langs->trans('BrowserPush'), 'disabled' => (getDolGlobalString('AGENDA_REMINDER_BROWSER') ? 0 : 1));
|
|
|
|
|
}
|
|
|
|
|
if (getDolGlobalString('AGENDA_REMINDER_EMAIL')) {
|
|
|
|
|
$TRemindTypes['email'] = array('label' => $langs->trans('EMail'), 'disabled' => (getDolGlobalString('AGENDA_REMINDER_EMAIL') ? 0 : 1));
|
|
|
|
|
}
|
|
|
|
|
if (getDolGlobalString('AGENDA_REMINDER_SMS')) {
|
|
|
|
|
$langs->load('sms');
|
|
|
|
|
$TRemindTypes['sms'] = [
|
|
|
|
|
'label' => $langs->trans('Sms'),
|
|
|
|
|
'disabled' => (getDolGlobalString('MAIN_SMS_SENDMODE') ? 0 : 1),
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$TDurationTypes = array('y' => $langs->trans('Years'), 'm' => $langs->trans('Month'), 'w' => $langs->trans('Weeks'), 'd' => $langs->trans('Days'), 'h' => $langs->trans('Hours'), 'i' => $langs->trans('Minutes'));
|
|
|
|
|
|
|
|
|
|
@@ -187,7 +194,7 @@ $usercancreate = $user->hasRight('agenda', 'allactions', 'create') || ((empty($o
|
|
|
|
|
|
|
|
|
|
$listUserAssignedUpdated = false;
|
|
|
|
|
$listResourceAssignedUpdated = false;
|
|
|
|
|
$assignedtouser = array();
|
|
|
|
|
$assignedtouser = [];
|
|
|
|
|
|
|
|
|
|
// Remove user to assigned list
|
|
|
|
|
if (empty($reshook) && (GETPOST('removedassigned') || GETPOST('removedassigned') == '0')) {
|
|
|
|
|
@@ -196,7 +203,7 @@ if (empty($reshook) && (GETPOST('removedassigned') || GETPOST('removedassigned')
|
|
|
|
|
if (!empty($_SESSION['assignedtouser'])) {
|
|
|
|
|
$tmpassigneduserids = json_decode($_SESSION['assignedtouser'], true);
|
|
|
|
|
} else {
|
|
|
|
|
$tmpassigneduserids = array();
|
|
|
|
|
$tmpassigneduserids = [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach ($tmpassigneduserids as $key => $val) {
|
|
|
|
|
@@ -223,7 +230,7 @@ if (empty($reshook) && (GETPOST('removedassignedresource') || GETPOST('removedas
|
|
|
|
|
if (!empty($_SESSION['assignedtoresource'])) {
|
|
|
|
|
$tmpassignedresourceids = json_decode($_SESSION['assignedtoresource'], true);
|
|
|
|
|
} else {
|
|
|
|
|
$tmpassignedresourceids = array();
|
|
|
|
|
$tmpassignedresourceids = [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach ($tmpassignedresourceids as $key => $val) {
|
|
|
|
|
@@ -248,7 +255,7 @@ if (empty($reshook) && (GETPOST('removedassignedresource') || GETPOST('removedas
|
|
|
|
|
if (empty($reshook) && (GETPOST('addassignedtouser') || GETPOST('updateassignedtouser'))) {
|
|
|
|
|
// Add a new user
|
|
|
|
|
if (GETPOST('assignedtouser') > 0) {
|
|
|
|
|
$assignedtouser = array();
|
|
|
|
|
$assignedtouser = [];
|
|
|
|
|
if (!empty($_SESSION['assignedtouser'])) {
|
|
|
|
|
$assignedtouser = json_decode($_SESSION['assignedtouser'], true);
|
|
|
|
|
}
|
|
|
|
|
@@ -270,7 +277,7 @@ if (empty($reshook) && (GETPOST('addassignedtouser') || GETPOST('updateassignedt
|
|
|
|
|
if (empty($reshook) && (GETPOST('addassignedtoresource') || GETPOST('updateassignedtoresource'))) {
|
|
|
|
|
// Add a new user
|
|
|
|
|
if (GETPOST('assignedtoresource') > 0) {
|
|
|
|
|
$assignedtoresource = array();
|
|
|
|
|
$assignedtoresource = [];
|
|
|
|
|
if (!empty($_SESSION['assignedtoresource'])) {
|
|
|
|
|
$assignedtoresource = json_decode($_SESSION['assignedtoresource'], true);
|
|
|
|
|
}
|
|
|
|
|
@@ -380,7 +387,7 @@ if (empty($reshook) && $action == 'add' && $usercancreate) {
|
|
|
|
|
$object->type_code = GETPOST('actioncode', 'aZ09');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$listofresourceid = array();
|
|
|
|
|
$listofresourceid = [];
|
|
|
|
|
|
|
|
|
|
if (!$error) {
|
|
|
|
|
// Initialisation of object actioncomm
|
|
|
|
|
@@ -441,7 +448,7 @@ if (empty($reshook) && $action == 'add' && $usercancreate) {
|
|
|
|
|
|
|
|
|
|
$transparency = (GETPOST("transparency") == 'on' ? 1 : 0);
|
|
|
|
|
|
|
|
|
|
$listofuserid = array();
|
|
|
|
|
$listofuserid = [];
|
|
|
|
|
if (!empty($_SESSION['assignedtouser'])) {
|
|
|
|
|
$listofuserid = json_decode($_SESSION['assignedtouser'], true);
|
|
|
|
|
}
|
|
|
|
|
@@ -528,9 +535,9 @@ if (empty($reshook) && $action == 'add' && $usercancreate) {
|
|
|
|
|
$object->recurrule .= (GETPOST('recurrulefreq', 'alpha') == 'MONTHLY') ? "_BYMONTHDAY".((int) $dayinmonth) : "";
|
|
|
|
|
$object->recurrule .= (GETPOST('recurrulefreq', 'alpha') == 'WEEKLY') ? "_BYDAY".((int) $dayinweek) : "";
|
|
|
|
|
|
|
|
|
|
$reg1 = array();
|
|
|
|
|
$reg2 = array();
|
|
|
|
|
$reg3 = array();
|
|
|
|
|
$reg1 = [];
|
|
|
|
|
$reg2 = [];
|
|
|
|
|
$reg3 = [];
|
|
|
|
|
if ($object->recurrule && preg_match('/FREQ=([A-Z]+)/i', $object->recurrule, $reg1)) {
|
|
|
|
|
$selectedrecurrulefreq = $reg1[1];
|
|
|
|
|
}
|
|
|
|
|
@@ -931,7 +938,7 @@ if (empty($reshook) && $action == 'update' && $usercancreate) {
|
|
|
|
|
$object->location = GETPOST('location', "alphanohtml");
|
|
|
|
|
$object->socid = GETPOSTINT("socid");
|
|
|
|
|
$socpeopleassigned = GETPOST("socpeopleassigned", 'array');
|
|
|
|
|
$object->socpeopleassigned = array();
|
|
|
|
|
$object->socpeopleassigned = [];
|
|
|
|
|
foreach ($socpeopleassigned as $cid) {
|
|
|
|
|
$object->socpeopleassigned[$cid] = array('id' => $cid);
|
|
|
|
|
}
|
|
|
|
|
@@ -974,7 +981,7 @@ if (empty($reshook) && $action == 'update' && $usercancreate) {
|
|
|
|
|
$transparency = (GETPOST("transparency") == 'on' ? 1 : 0);
|
|
|
|
|
|
|
|
|
|
// Users
|
|
|
|
|
$listofuserid = array();
|
|
|
|
|
$listofuserid = [];
|
|
|
|
|
if (!empty($_SESSION['assignedtouser'])) { // Now concat assigned users
|
|
|
|
|
// Restore array with key with same value than param 'id'
|
|
|
|
|
$tmplist1 = json_decode($_SESSION['assignedtouser'], true);
|
|
|
|
|
@@ -989,7 +996,7 @@ if (empty($reshook) && $action == 'update' && $usercancreate) {
|
|
|
|
|
$listofuserid[$assignedtouser] = array('id' => $assignedtouser, 'mandatory' => 0, 'transparency' => ($user->id == $assignedtouser ? $transparency : '')); // Owner first
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$object->userassigned = array();
|
|
|
|
|
$object->userassigned = [];
|
|
|
|
|
$object->userownerid = 0; // Clear old content
|
|
|
|
|
$i = 0;
|
|
|
|
|
foreach ($listofuserid as $key => $val) {
|
|
|
|
|
@@ -1103,7 +1110,7 @@ if (empty($reshook) && $action == 'update' && $usercancreate) {
|
|
|
|
|
$reminder->delete($user);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$object->reminders = array();
|
|
|
|
|
$object->reminders = [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Create reminders for every assigned user if reminder is on
|
|
|
|
|
@@ -1497,7 +1504,7 @@ if ($action == 'create') {
|
|
|
|
|
$object->recurrule .= GETPOSTISSET('BYDAY') ? "_BYDAY".GETPOST('BYDAY', 'alpha') : "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$reg = array();
|
|
|
|
|
$reg = [];
|
|
|
|
|
if ($object->recurrule && preg_match('/FREQ=([A-Z]+)/i', $object->recurrule, $reg)) {
|
|
|
|
|
$selectedrecurrulefreq = $reg[1];
|
|
|
|
|
}
|
|
|
|
|
@@ -1574,9 +1581,9 @@ if ($action == 'create') {
|
|
|
|
|
|
|
|
|
|
// Assigned to user
|
|
|
|
|
print '<tr><td class="tdtop nowrap"><span class="fieldrequired">'.$langs->trans("ActionAffectedTo").'</span></td><td>';
|
|
|
|
|
$listofuserid = array();
|
|
|
|
|
$listofcontactid = array();
|
|
|
|
|
$listofotherid = array();
|
|
|
|
|
$listofuserid = [];
|
|
|
|
|
$listofcontactid = [];
|
|
|
|
|
$listofotherid = [];
|
|
|
|
|
|
|
|
|
|
if (empty($donotclearsession)) {
|
|
|
|
|
$assignedtouser = GETPOST("assignedtouser") ? GETPOST("assignedtouser") : (!empty($object->userownerid) && $object->userownerid > 0 ? $object->userownerid : $user->id);
|
|
|
|
|
@@ -1591,7 +1598,7 @@ if ($action == 'create') {
|
|
|
|
|
$listofuserid = json_decode($_SESSION['assignedtouser'], true);
|
|
|
|
|
}
|
|
|
|
|
if (!is_array($listofuserid)) {
|
|
|
|
|
$listofuserid = array();
|
|
|
|
|
$listofuserid = [];
|
|
|
|
|
}
|
|
|
|
|
$firstelem = reset($listofuserid);
|
|
|
|
|
if (isset($listofuserid[$firstelem['id']])) {
|
|
|
|
|
@@ -1599,7 +1606,7 @@ if ($action == 'create') {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
print '<!-- list of user to assign --><div class="assignedtouser">';
|
|
|
|
|
print $form->select_dolusers_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtouser', 1, array(), 0, '', array(), '0', 0, 0, 'u.statut:<>:0', 1, $listofuserid, $listofcontactid, $listofotherid);
|
|
|
|
|
print $form->select_dolusers_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtouser', 1, [], 0, '', [], '0', 0, 0, 'u.statut:<>:0', 1, $listofuserid, $listofcontactid, $listofotherid);
|
|
|
|
|
print '</div>';
|
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
@@ -1619,7 +1626,7 @@ if ($action == 'create') {
|
|
|
|
|
// Resources
|
|
|
|
|
print '<tr><td class="tdtop nowrap">'.$langs->trans("Resource").'</td><td>';
|
|
|
|
|
|
|
|
|
|
$listofresourceid = array();
|
|
|
|
|
$listofresourceid = [];
|
|
|
|
|
if (empty($donotclearsession)) {
|
|
|
|
|
$assignedtoresource = GETPOST("assignedtoresource");
|
|
|
|
|
if ($assignedtoresource) {
|
|
|
|
|
@@ -1631,7 +1638,7 @@ if ($action == 'create') {
|
|
|
|
|
$listofresourceid = json_decode($_SESSION['assignedtoresource'], true);
|
|
|
|
|
}
|
|
|
|
|
if (!is_array($listofresourceid)) {
|
|
|
|
|
$listofresourceid = array();
|
|
|
|
|
$listofresourceid = [];
|
|
|
|
|
}
|
|
|
|
|
$firstelem = reset($listofresourceid);
|
|
|
|
|
if (isset($listofresourceid[$firstelem['id']])) {
|
|
|
|
|
@@ -1639,7 +1646,7 @@ if ($action == 'create') {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
print '<div class="assignedtoresource">';
|
|
|
|
|
print $form->select_dolresources_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtoresource', 1, array(), 0, '', array(), '0', 0, 0, 'AND u.statut != 0', 1, $listofresourceid);
|
|
|
|
|
print $form->select_dolresources_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtoresource', 1, [], 0, '', [], '0', 0, 0, 'AND u.statut != 0', 1, $listofresourceid);
|
|
|
|
|
print '</div>';
|
|
|
|
|
print '</td></tr>';
|
|
|
|
|
}
|
|
|
|
|
@@ -1679,7 +1686,7 @@ if ($action == 'create') {
|
|
|
|
|
print $societe->getNomUrl(1);
|
|
|
|
|
print '<input type="hidden" id="socid" name="socid" value="'.GETPOSTINT('socid').'">';
|
|
|
|
|
} else {
|
|
|
|
|
$events = array();
|
|
|
|
|
$events = [];
|
|
|
|
|
$events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1&token='.currentToken(), 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
|
|
|
|
|
//For external user force the company to user company
|
|
|
|
|
if (!empty($user->socid)) {
|
|
|
|
|
@@ -1712,14 +1719,14 @@ if ($action == 'create') {
|
|
|
|
|
// FIXME Use a select without the "multiple" (not supported when CONTACT_USE_SEARCH_TO_SELECT is on) or allow use only when $object->socid is set...
|
|
|
|
|
/*
|
|
|
|
|
$selected = array_keys($object->socpeopleassigned);
|
|
|
|
|
print $form->select_contact(getDolGlobalString('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT') ? 0 : $object->socid, $selected, 'socpeopleassigned', 1, '', '', 1, 'minwidth300 widthcentpercentminusx', false, 0, 0, array());
|
|
|
|
|
print $form->select_contact(getDolGlobalString('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT') ? 0 : $object->socid, $selected, 'socpeopleassigned', 1, '', '', 1, 'minwidth300 widthcentpercentminusx', false, 0, 0, []);
|
|
|
|
|
*/
|
|
|
|
|
$sav = getDolGlobalString('CONTACT_USE_SEARCH_TO_SELECT');
|
|
|
|
|
$conf->global->CONTACT_USE_SEARCH_TO_SELECT = 0;
|
|
|
|
|
print $form->selectcontacts(GETPOSTISSET('socid') ? GETPOSTINT('socid') : $select_contact_default, $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 widthcentpercentminusxx maxwidth500', 0, 0, 0, array(), 'multiple', 'contactid');
|
|
|
|
|
print $form->selectcontacts(GETPOSTISSET('socid') ? GETPOSTINT('socid') : $select_contact_default, $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 widthcentpercentminusxx maxwidth500', 0, 0, 0, [], 'multiple', 'contactid');
|
|
|
|
|
$conf->global->CONTACT_USE_SEARCH_TO_SELECT = $sav;
|
|
|
|
|
} else {
|
|
|
|
|
print $form->selectcontacts(GETPOSTISSET('socid') ? GETPOSTINT('socid') : $select_contact_default, $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 widthcentpercentminusxx maxwidth500', 0, 0, 0, array(), 'multiple', 'contactid');
|
|
|
|
|
print $form->selectcontacts(GETPOSTISSET('socid') ? GETPOSTINT('socid') : $select_contact_default, $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 widthcentpercentminusxx maxwidth500', 0, 0, 0, [], 'multiple', 'contactid');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
print '</td></tr>';
|
|
|
|
|
@@ -1822,7 +1829,7 @@ if ($action == 'create') {
|
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
// Other attributes
|
|
|
|
|
$parameters = array();
|
|
|
|
|
$parameters = [];
|
|
|
|
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
|
|
|
|
print $hookmanager->resPrint;
|
|
|
|
|
if (empty($reshook)) {
|
|
|
|
|
@@ -2176,7 +2183,7 @@ if ($id > 0 && $action != 'create') {
|
|
|
|
|
print '<tr><td class=""> </td><td></td></tr>';
|
|
|
|
|
|
|
|
|
|
// Assigned to
|
|
|
|
|
$listofuserid = array(); // User assigned
|
|
|
|
|
$listofuserid = []; // User assigned
|
|
|
|
|
if (empty($donotclearsession)) {
|
|
|
|
|
if ($object->userownerid > 0) {
|
|
|
|
|
$listofuserid[$object->userownerid] = array(
|
|
|
|
|
@@ -2209,7 +2216,7 @@ if ($id > 0 && $action != 'create') {
|
|
|
|
|
|
|
|
|
|
print '<tr><td class="tdtop nowrap fieldrequired">'.$langs->trans("ActionAssignedTo").'</td><td>';
|
|
|
|
|
print '<div class="assignedtouser">';
|
|
|
|
|
print $form->select_dolusers_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtouser', 1, array(), 0, '', array(), '0', 0, 0, 'u.statut:<>:0', 1, $listofuserid, $listofcontactid, $listofotherid, (int) $caneditdateorowner);
|
|
|
|
|
print $form->select_dolusers_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtouser', 1, [], 0, '', [], '0', 0, 0, 'u.statut:<>:0', 1, $listofuserid, $listofcontactid, $listofotherid, (int) $caneditdateorowner);
|
|
|
|
|
print '</div>';
|
|
|
|
|
/*if (in_array($user->id,array_keys($listofuserid)))
|
|
|
|
|
{
|
|
|
|
|
@@ -2250,7 +2257,7 @@ if ($id > 0 && $action != 'create') {
|
|
|
|
|
print '<tr><td class="titlefieldcreate">'.$langs->trans("ActionOnCompany").'</td>';
|
|
|
|
|
print '<td>';
|
|
|
|
|
print '<div>';
|
|
|
|
|
$events = array(); // 'method'=parameter action of url, 'url'=url to call that return new list of contacts
|
|
|
|
|
$events = []; // 'method'=parameter action of url, 'url'=url to call that return new list of contacts
|
|
|
|
|
$events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1&token='.currentToken(), 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
|
|
|
|
|
// TODO Refresh also list of project if conf PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY not defined with list linked to socid ?
|
|
|
|
|
// FIXME If we change company, we may get a project that does not match
|
|
|
|
|
@@ -2267,15 +2274,15 @@ if ($id > 0 && $action != 'create') {
|
|
|
|
|
// FIXME Use the select_contact supporting the "multiple"
|
|
|
|
|
/*
|
|
|
|
|
$selected = array_keys($object->socpeopleassigned);
|
|
|
|
|
print $form->select_contact(getDolGlobalString('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT') ? 0 : $object->socid, $selected, 'socpeopleassigned', 1, '', '', 1, 'minwidth300 widthcentpercentminusx', false, 0, 0, array());
|
|
|
|
|
print $form->select_contact(getDolGlobalString('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT') ? 0 : $object->socid, $selected, 'socpeopleassigned', 1, '', '', 1, 'minwidth300 widthcentpercentminusx', false, 0, 0, []);
|
|
|
|
|
*/
|
|
|
|
|
$sav = getDolGlobalString('CONTACT_USE_SEARCH_TO_SELECT');
|
|
|
|
|
$conf->global->CONTACT_USE_SEARCH_TO_SELECT = 0;
|
|
|
|
|
print $form->selectcontacts(getDolGlobalString('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT') ? 0 : ($object->socid > 0 ? $object->socid : -1), array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'minwidth300 widthcentpercentminusx', 0, 0, 0, array(), 'multiple', 'contactid');
|
|
|
|
|
print $form->selectcontacts(getDolGlobalString('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT') ? 0 : ($object->socid > 0 ? $object->socid : -1), array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'minwidth300 widthcentpercentminusx', 0, 0, 0, [], 'multiple', 'contactid');
|
|
|
|
|
$conf->global->CONTACT_USE_SEARCH_TO_SELECT = $sav;
|
|
|
|
|
} else {
|
|
|
|
|
// Warning: MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT will hangs on large databases
|
|
|
|
|
print $form->selectcontacts(getDolGlobalString('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT') ? 0 : $object->socid, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'minwidth300 widthcentpercentminusx', 0, 0, 0, array(), 'multiple', 'contactid');
|
|
|
|
|
print $form->selectcontacts(getDolGlobalString('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT') ? 0 : $object->socid, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'minwidth300 widthcentpercentminusx', 0, 0, 0, [], 'multiple', 'contactid');
|
|
|
|
|
}
|
|
|
|
|
print '</div>';
|
|
|
|
|
print '</td>';
|
|
|
|
|
@@ -2382,7 +2389,7 @@ if ($id > 0 && $action != 'create') {
|
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
// Other attributes
|
|
|
|
|
$parameters = array();
|
|
|
|
|
$parameters = [];
|
|
|
|
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
|
|
|
|
print $hookmanager->resPrint;
|
|
|
|
|
if (empty($reshook)) {
|
|
|
|
|
@@ -2525,11 +2532,11 @@ if ($id > 0 && $action != 'create') {
|
|
|
|
|
|
|
|
|
|
// Clone event
|
|
|
|
|
if ($action == 'clone') {
|
|
|
|
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.GETPOST('id'), $langs->trans('ToClone'), $langs->trans('ConfirmCloneEvent', $object->label), 'confirm_clone', array(), 'yes', 1);
|
|
|
|
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.GETPOST('id'), $langs->trans('ToClone'), $langs->trans('ConfirmCloneEvent', $object->label), 'confirm_clone', [], 'yes', 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Call Hook formConfirm
|
|
|
|
|
$parameters = array();
|
|
|
|
|
$parameters = [];
|
|
|
|
|
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
|
|
|
|
if (empty($reshook)) {
|
|
|
|
|
$formconfirm .= $hookmanager->resPrint;
|
|
|
|
|
@@ -2572,7 +2579,7 @@ if ($id > 0 && $action != 'create') {
|
|
|
|
|
$linkback .= '</a>';
|
|
|
|
|
|
|
|
|
|
// Add more views from hooks
|
|
|
|
|
$parameters = array();
|
|
|
|
|
$parameters = [];
|
|
|
|
|
$reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action);
|
|
|
|
|
if (empty($reshook)) {
|
|
|
|
|
$linkback .= $hookmanager->resPrint;
|
|
|
|
|
@@ -2675,7 +2682,7 @@ if ($id > 0 && $action != 'create') {
|
|
|
|
|
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();
|
|
|
|
|
$reg = [];
|
|
|
|
|
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>';
|
|
|
|
|
}
|
|
|
|
|
@@ -2689,7 +2696,7 @@ if ($id > 0 && $action != 'create') {
|
|
|
|
|
|
|
|
|
|
// Assigned to user
|
|
|
|
|
print '<tr><td class="nowrap">'.$langs->trans("ActionAssignedTo").'</td><td>';
|
|
|
|
|
$listofuserid = array();
|
|
|
|
|
$listofuserid = [];
|
|
|
|
|
if (empty($donotclearsession)) {
|
|
|
|
|
if ($object->userownerid > 0) {
|
|
|
|
|
$listofuserid[$object->userownerid] = array(
|
|
|
|
|
@@ -2715,10 +2722,10 @@ if ($id > 0 && $action != 'create') {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$listofcontactid = array(); // not used yet
|
|
|
|
|
$listofotherid = array(); // not used yet
|
|
|
|
|
$listofcontactid = []; // not used yet
|
|
|
|
|
$listofotherid = []; // not used yet
|
|
|
|
|
print '<div class="assignedtouser">';
|
|
|
|
|
print $form->select_dolusers_forevent('view', 'assignedtouser', 1, array(), 0, '', array(), '0', 0, 0, '', ($object->datep != $object->datef) ? 1 : 0, $listofuserid, $listofcontactid, $listofotherid);
|
|
|
|
|
print $form->select_dolusers_forevent('view', 'assignedtouser', 1, [], 0, '', [], '0', 0, 0, '', ($object->datep != $object->datef) ? 1 : 0, $listofuserid, $listofcontactid, $listofotherid);
|
|
|
|
|
print '</div>';
|
|
|
|
|
/*
|
|
|
|
|
if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid)))
|
|
|
|
|
@@ -2886,7 +2893,7 @@ if ($id > 0 && $action != 'create') {
|
|
|
|
|
*/
|
|
|
|
|
print '<div class="tabsAction">';
|
|
|
|
|
|
|
|
|
|
$parameters = array();
|
|
|
|
|
$parameters = [];
|
|
|
|
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
|
|
|
|
if (empty($reshook)) {
|
|
|
|
|
if ($action != 'edit') {
|
|
|
|
|
@@ -2931,7 +2938,7 @@ if ($id > 0 && $action != 'create') {
|
|
|
|
|
|
|
|
|
|
if (getDolGlobalString('AGENDA_ENABLE_LINKED_ELEMENTS')) {
|
|
|
|
|
// Show links to link elements
|
|
|
|
|
$tmparray = $form->showLinkToObjectBlock($object, array(), array('myobject'), 1);
|
|
|
|
|
$tmparray = $form->showLinkToObjectBlock($object, [], array('myobject'), 1);
|
|
|
|
|
if (is_array($tmparray)) {
|
|
|
|
|
$linktoelem = $tmparray['linktoelem'];
|
|
|
|
|
$htmltoenteralink = $tmparray['htmltoenteralink'];
|
|
|
|
|
|