NEW : Recurrent events on agenda v2
This commit is contained in:
parent
259224c3be
commit
572f1f0fee
@ -414,117 +414,229 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
if (!$error) {
|
if (!$error) {
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$dayoffset = 0;
|
|
||||||
$monthoffset = 0;
|
|
||||||
|
// Creation of action/event
|
||||||
|
$idaction = $object->create($user);
|
||||||
|
|
||||||
|
if ($idaction > 0) {
|
||||||
|
if (!$object->error) {
|
||||||
|
// Category association
|
||||||
|
$categories = GETPOST('categories', 'array');
|
||||||
|
$object->setCategories($categories);
|
||||||
|
|
||||||
|
unset($_SESSION['assignedtouser']);
|
||||||
|
|
||||||
|
$moreparam = '';
|
||||||
|
if ($user->id != $object->userownerid) {
|
||||||
|
$moreparam = "filtert=-1"; // We force to remove filter so created record is visible when going back to per user view.
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create reminders
|
||||||
|
if ($addreminder == 'on') {
|
||||||
|
$actionCommReminder = new ActionCommReminder($db);
|
||||||
|
|
||||||
|
$dateremind = dol_time_plus_duree($datep, -$offsetvalue, $offsetunit);
|
||||||
|
|
||||||
|
$actionCommReminder->dateremind = $dateremind;
|
||||||
|
$actionCommReminder->typeremind = $remindertype;
|
||||||
|
$actionCommReminder->offsetunit = $offsetunit;
|
||||||
|
$actionCommReminder->offsetvalue = $offsetvalue;
|
||||||
|
$actionCommReminder->status = $actionCommReminder::STATUS_TODO;
|
||||||
|
$actionCommReminder->fk_actioncomm = $object->id;
|
||||||
|
if ($remindertype == 'email') {
|
||||||
|
$actionCommReminder->fk_email_template = $modelmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
// the notification must be created for every user assigned to the event
|
||||||
|
foreach ($object->userassigned as $userassigned) {
|
||||||
|
$actionCommReminder->fk_user = $userassigned['id'];
|
||||||
|
$res = $actionCommReminder->create($user);
|
||||||
|
|
||||||
|
if ($res <= 0) {
|
||||||
|
// If error
|
||||||
|
$db->rollback();
|
||||||
|
$langs->load("errors");
|
||||||
|
$error = $langs->trans('ErrorReminderActionCommCreation');
|
||||||
|
setEventMessages($error, null, 'errors');
|
||||||
|
$action = 'create'; $donotclearsession = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Modify $moreparam so we are sure to see the event we have just created, whatever are the default value of filter on next page.
|
||||||
|
/*$moreparam .= ($moreparam ? '&' : '').'search_actioncode=0';
|
||||||
|
$moreparam .= ($moreparam ? '&' : '').'search_status=-1';
|
||||||
|
$moreparam .= ($moreparam ? '&' : '').'search_filtert='.$object->userownerid;
|
||||||
|
*/
|
||||||
|
$moreparam .= ($moreparam ? '&' : '').'disabledefaultvalues=1';
|
||||||
|
|
||||||
|
if ($error) {
|
||||||
|
$db->rollback();
|
||||||
|
} else {
|
||||||
|
$db->commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (!empty($backtopage)) {
|
||||||
|
// dol_syslog("Back to ".$backtopage.($moreparam ? (preg_match('/\?/', $backtopage) ? '&'.$moreparam : '?'.$moreparam) : ''));
|
||||||
|
// header("Location: ".$backtopage.($moreparam ? (preg_match('/\?/', $backtopage) ? '&'.$moreparam : '?'.$moreparam) : ''));
|
||||||
|
// } elseif ($idaction) {
|
||||||
|
// header("Location: ".DOL_URL_ROOT.'/comm/action/card.php?id='.$idaction.($moreparam ? '&'.$moreparam : ''));
|
||||||
|
// } else {
|
||||||
|
// header("Location: ".DOL_URL_ROOT.'/comm/action/index.php'.($moreparam ? '?'.$moreparam : ''));
|
||||||
|
// }
|
||||||
|
// exit;
|
||||||
|
} else {
|
||||||
|
// If error
|
||||||
|
$db->rollback();
|
||||||
|
$langs->load("errors");
|
||||||
|
$error = $langs->trans($object->error);
|
||||||
|
setEventMessages($error, null, 'errors');
|
||||||
|
$action = 'create'; $donotclearsession = 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$db->rollback();
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
$action = 'create'; $donotclearsession = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$selectedrecurrulefreq = 'no';
|
||||||
|
$selectedrecurrulebymonthday = '';
|
||||||
|
$selectedrecurrulebyday = '';
|
||||||
|
$object->recurrule = GETPOSTISSET('recurrulefreq') ? "FREQ=".GETPOST('recurrulefreq', 'alpha') : "";
|
||||||
|
$object->recurrule .= GETPOSTISSET('BYMONTHDAY') ? "_BYMONTHDAY".GETPOST('BYMONTHDAY', 'alpha') : "";
|
||||||
|
$object->recurrule .= GETPOSTISSET('BYDAY') ? "_BYDAY".GETPOST('BYDAY', 'alpha') : "";
|
||||||
|
|
||||||
|
if ($object->recurrule && preg_match('/FREQ=([A-Z]+)/i', $object->recurrule, $reg1)) {
|
||||||
|
$selectedrecurrulefreq = $reg1[1];
|
||||||
|
}
|
||||||
|
if ($object->recurrule && preg_match('/FREQ=MONTHLY.*BYMONTHDAY(\d+)/i', $object->recurrule, $reg2)) {
|
||||||
|
$selectedrecurrulebymonthday = $reg2[1];
|
||||||
|
}
|
||||||
|
if ($object->recurrule && preg_match('/FREQ=WEEKLY.*BYDAY(\d+)/i', $object->recurrule, $reg3)) {
|
||||||
|
$selectedrecurrulebyday = $reg3[1];
|
||||||
|
}
|
||||||
|
|
||||||
// If event is recurrent
|
// If event is recurrent
|
||||||
$userepeatevent = ($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0);
|
$userepeatevent = ($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0);
|
||||||
if ($userepeatevent && GETPOSTISSET('recurrulefreq') && GETPOST('recurrulefreq') != 'no' && GETPOSTISSET("limityear") && GETPOSTISSET("limitmonth") && GETPOSTISSET("limitday")) {
|
if ($userepeatevent && !empty($selectedrecurrulefreq) && $selectedrecurrulefreq != 'no') {
|
||||||
$repeateventlimitdate = dol_mktime('23', '59', '59', GETPOST("limitmonth", 'int'), GETPOST("limitday", 'int'), GETPOST("limityear", 'int') < 2100 ? GETPOST("limityear", 'int') : 2100, $tzforfullday ? $tzforfullday : 'tzuser');
|
// We set first date of recurrence and offsets
|
||||||
if (GETPOST('recurrulefreq') == 'DAILY') {
|
if ($selectedrecurrulefreq == 'WEEKLY' && !empty($selectedrecurrulebyday)) {
|
||||||
$dayoffset = 1;
|
$firstdatearray = dol_get_first_day_week(GETPOST("apday", 'int'), GETPOST("apmonth", 'int'), GETPOST("apyear", 'int'));
|
||||||
} elseif (GETPOST('recurrulefreq') == 'WEEKLY') {
|
$datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), $firstdatearray['month'], $firstdatearray['first_day'], $firstdatearray['year'], $tzforfullday ? $tzforfullday : 'tzuser');
|
||||||
|
$datep = dol_time_plus_duree($datep, $selectedrecurrulebyday + 6, 'd');//We begin the week after
|
||||||
$dayoffset = 7;
|
$dayoffset = 7;
|
||||||
} elseif (GETPOST('recurrulefreq') == 'MONTHLY') {
|
$monthoffset = 0;
|
||||||
|
} elseif ($selectedrecurrulefreq == 'MONTHLY' && !empty($selectedrecurrulebymonthday)) {
|
||||||
|
$firstday = $selectedrecurrulebymonthday;
|
||||||
|
$firstmonth = GETPOST("apday") > $selectedrecurrulebymonthday ? GETPOST("apmonth", 'int') + 1 : GETPOST("apmonth", 'int');//We begin the week after
|
||||||
|
$datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), $firstmonth, $firstday, GETPOST("apyear", 'int'), $tzforfullday ? $tzforfullday : 'tzuser');
|
||||||
|
$dayoffset = 0;
|
||||||
$monthoffset = 1;
|
$monthoffset = 1;
|
||||||
|
} else {
|
||||||
|
$error++;
|
||||||
}
|
}
|
||||||
} else { // If event is not recurrent, limit date is the date of the event
|
// End date
|
||||||
$repeateventlimitdate = $datep;
|
$repeateventlimitdate = dol_mktime('23', '59', '59', GETPOSTISSET("limitmonth", 'int') ? GETPOST("limitmonth", 'int') : 01, GETPOSTISSET("limitday", 'int') ? GETPOST("limitday", 'int') : 01, GETPOSTISSET("limityear", 'int') && GETPOST("limityear", 'int') < 2100 ? GETPOST("limityear", 'int') : 2100, $tzforfullday ? $tzforfullday : 'tzuser');
|
||||||
}
|
// Set date of end of event
|
||||||
|
$deltatime = num_between_day($object->datep, $datep);
|
||||||
|
$datef = dol_time_plus_duree($datef, $deltatime, 'd');
|
||||||
|
|
||||||
while ($datep <= $repeateventlimitdate) {
|
while ($datep <= $repeateventlimitdate && !$error) {
|
||||||
$finalobject = clone $object;
|
$finalobject = clone $object;
|
||||||
|
|
||||||
|
|
||||||
$finalobject->datep = $datep;
|
$finalobject->datep = $datep;
|
||||||
$finalobject->datef = $datef;
|
$finalobject->datef = $datef;
|
||||||
// Creation of action/event
|
// Creation of action/event
|
||||||
$idaction = $finalobject->create($user);
|
$idaction = $finalobject->create($user);
|
||||||
|
|
||||||
if ($idaction > 0) {
|
if ($idaction > 0) {
|
||||||
if (!$finalobject->error) {
|
if (!$finalobject->error) {
|
||||||
// Category association
|
// Category association
|
||||||
$categories = GETPOST('categories', 'array');
|
$categories = GETPOST('categories', 'array');
|
||||||
$finalobject->setCategories($categories);
|
$finalobject->setCategories($categories);
|
||||||
|
|
||||||
unset($_SESSION['assignedtouser']);
|
unset($_SESSION['assignedtouser']);
|
||||||
|
|
||||||
$moreparam = '';
|
$moreparam = '';
|
||||||
if ($user->id != $finalobject->userownerid) {
|
if ($user->id != $finalobject->userownerid) {
|
||||||
$moreparam = "filtert=-1"; // We force to remove filter so created record is visible when going back to per user view.
|
$moreparam = "filtert=-1"; // We force to remove filter so created record is visible when going back to per user view.
|
||||||
}
|
|
||||||
|
|
||||||
// Create reminders
|
|
||||||
if ($addreminder == 'on') {
|
|
||||||
$actionCommReminder = new ActionCommReminder($db);
|
|
||||||
|
|
||||||
$dateremind = dol_time_plus_duree($datep, -$offsetvalue, $offsetunit);
|
|
||||||
|
|
||||||
$actionCommReminder->dateremind = $dateremind;
|
|
||||||
$actionCommReminder->typeremind = $remindertype;
|
|
||||||
$actionCommReminder->offsetunit = $offsetunit;
|
|
||||||
$actionCommReminder->offsetvalue = $offsetvalue;
|
|
||||||
$actionCommReminder->status = $actionCommReminder::STATUS_TODO;
|
|
||||||
$actionCommReminder->fk_actioncomm = $finalobject->id;
|
|
||||||
if ($remindertype == 'email') {
|
|
||||||
$actionCommReminder->fk_email_template = $modelmail;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// the notification must be created for every user assigned to the event
|
// Create reminders
|
||||||
foreach ($finalobject->userassigned as $userassigned) {
|
if ($addreminder == 'on') {
|
||||||
$actionCommReminder->fk_user = $userassigned['id'];
|
$actionCommReminder = new ActionCommReminder($db);
|
||||||
$res = $actionCommReminder->create($user);
|
|
||||||
|
|
||||||
if ($res <= 0) {
|
$dateremind = dol_time_plus_duree($datep, -$offsetvalue, $offsetunit);
|
||||||
// If error
|
|
||||||
$db->rollback();
|
$actionCommReminder->dateremind = $dateremind;
|
||||||
$langs->load("errors");
|
$actionCommReminder->typeremind = $remindertype;
|
||||||
$error = $langs->trans('ErrorReminderActionCommCreation');
|
$actionCommReminder->offsetunit = $offsetunit;
|
||||||
setEventMessages($error, null, 'errors');
|
$actionCommReminder->offsetvalue = $offsetvalue;
|
||||||
$action = 'create'; $donotclearsession = 1;
|
$actionCommReminder->status = $actionCommReminder::STATUS_TODO;
|
||||||
break;
|
$actionCommReminder->fk_actioncomm = $finalobject->id;
|
||||||
|
if ($remindertype == 'email') {
|
||||||
|
$actionCommReminder->fk_email_template = $modelmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
// the notification must be created for every user assigned to the event
|
||||||
|
foreach ($finalobject->userassigned as $userassigned) {
|
||||||
|
$actionCommReminder->fk_user = $userassigned['id'];
|
||||||
|
$res = $actionCommReminder->create($user);
|
||||||
|
|
||||||
|
if ($res <= 0) {
|
||||||
|
// If error
|
||||||
|
$db->rollback();
|
||||||
|
$langs->load("errors");
|
||||||
|
$error = $langs->trans('ErrorReminderActionCommCreation');
|
||||||
|
setEventMessages($error, null, 'errors');
|
||||||
|
$action = 'create'; $donotclearsession = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Modify $moreparam so we are sure to see the event we have just created, whatever are the default value of filter on next page.
|
// Modify $moreparam so we are sure to see the event we have just created, whatever are the default value of filter on next page.
|
||||||
/*$moreparam .= ($moreparam ? '&' : '').'search_actioncode=0';
|
/*$moreparam .= ($moreparam ? '&' : '').'search_actioncode=0';
|
||||||
$moreparam .= ($moreparam ? '&' : '').'search_status=-1';
|
$moreparam .= ($moreparam ? '&' : '').'search_status=-1';
|
||||||
$moreparam .= ($moreparam ? '&' : '').'search_filtert='.$object->userownerid;
|
$moreparam .= ($moreparam ? '&' : '').'search_filtert='.$object->userownerid;
|
||||||
*/
|
*/
|
||||||
$moreparam .= ($moreparam ? '&' : '').'disabledefaultvalues=1';
|
$moreparam .= ($moreparam ? '&' : '').'disabledefaultvalues=1';
|
||||||
|
|
||||||
if ($error) {
|
if ($error) {
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
|
} else {
|
||||||
|
$db->commit();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$db->commit();
|
// If error
|
||||||
|
$db->rollback();
|
||||||
|
$langs->load("errors");
|
||||||
|
$error = $langs->trans($finalobject->error);
|
||||||
|
setEventMessages($error, null, 'errors');
|
||||||
|
$action = 'create'; $donotclearsession = 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// If error
|
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
$langs->load("errors");
|
setEventMessages($finalobject->error, $finalobject->errors, 'errors');
|
||||||
$error = $langs->trans($finalobject->error);
|
|
||||||
setEventMessages($error, null, 'errors');
|
|
||||||
$action = 'create'; $donotclearsession = 1;
|
$action = 'create'; $donotclearsession = 1;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$db->rollback();
|
|
||||||
setEventMessages($finalobject->error, $finalobject->errors, 'errors');
|
|
||||||
$action = 'create'; $donotclearsession = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If event is not recurrent, we stop here
|
// If event is not recurrent, we stop here
|
||||||
if (!($userepeatevent && GETPOSTISSET('recurrulefreq') && GETPOST('recurrulefreq') != 'no' && GETPOSTISSET("limityear") && GETPOSTISSET("limitmonth") && GETPOSTISSET("limitday"))) {
|
if (!($userepeatevent && GETPOSTISSET('recurrulefreq') && GETPOST('recurrulefreq') != 'no' && GETPOSTISSET("limityear") && GETPOSTISSET("limitmonth") && GETPOSTISSET("limitday"))) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// increment date for recurrent events
|
// increment date for recurrent events
|
||||||
$datep = dol_time_plus_duree($datep, $dayoffset, 'd');
|
$datep = dol_time_plus_duree($datep, $dayoffset, 'd');
|
||||||
$datep = dol_time_plus_duree($datep, $monthoffset, 'm');
|
$datep = dol_time_plus_duree($datep, $monthoffset, 'm');
|
||||||
$datef = dol_time_plus_duree($datef, $dayoffset, 'd');
|
$datef = dol_time_plus_duree($datef, $dayoffset, 'd');
|
||||||
$datef = dol_time_plus_duree($datef, $monthoffset, 'm');
|
$datef = dol_time_plus_duree($datef, $monthoffset, 'm');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!empty($backtopage)) {
|
if (!empty($backtopage) && !$error) {
|
||||||
dol_syslog("Back to ".$backtopage.($moreparam ? (preg_match('/\?/', $backtopage) ? '&'.$moreparam : '?'.$moreparam) : ''));
|
dol_syslog("Back to ".$backtopage.($moreparam ? (preg_match('/\?/', $backtopage) ? '&'.$moreparam : '?'.$moreparam) : ''));
|
||||||
header("Location: ".$backtopage.($moreparam ? (preg_match('/\?/', $backtopage) ? '&'.$moreparam : '?'.$moreparam) : ''));
|
header("Location: ".$backtopage.($moreparam ? (preg_match('/\?/', $backtopage) ? '&'.$moreparam : '?'.$moreparam) : ''));
|
||||||
} elseif ($idaction) {
|
} elseif ($idaction) {
|
||||||
@ -1075,35 +1187,78 @@ if ($action == 'create') {
|
|||||||
print ' <div class="opacitymedium inline-block">';
|
print ' <div class="opacitymedium inline-block">';
|
||||||
print img_picto($langs->trans("Recurrence"), 'recurring', 'class="paddingright2"');
|
print img_picto($langs->trans("Recurrence"), 'recurring', 'class="paddingright2"');
|
||||||
print '<input type="hidden" name="recurid" value="'.$object->recurid.'">';
|
print '<input type="hidden" name="recurid" value="'.$object->recurid.'">';
|
||||||
|
|
||||||
$selectedrecurrulefreq = 'no';
|
$selectedrecurrulefreq = 'no';
|
||||||
|
$selectedrecurrulebymonthday = '';
|
||||||
|
$selectedrecurrulebyday = '';
|
||||||
|
$object->recurrule = GETPOSTISSET('recurrulefreq') ? "FREQ=".GETPOST('recurrulefreq', 'alpha') : "";
|
||||||
|
$object->recurrule .= GETPOSTISSET('BYMONTHDAY') ? "_BYMONTHDAY".GETPOST('BYMONTHDAY', 'alpha') : "";
|
||||||
|
$object->recurrule .= GETPOSTISSET('BYDAY') ? "_BYDAY".GETPOST('BYDAY', 'alpha') : "";
|
||||||
|
|
||||||
|
if ($object->recurrule && preg_match('/FREQ=([A-Z]+)/i', $object->recurrule, $reg1)) {
|
||||||
|
$selectedrecurrulefreq = $reg1[1];
|
||||||
|
}
|
||||||
|
if ($object->recurrule && preg_match('/FREQ=MONTHLY.*BYMONTHDAY(\d+)/i', $object->recurrule, $reg2)) {
|
||||||
|
$selectedrecurrulebymonthday = $reg2[1];
|
||||||
|
}
|
||||||
|
if ($object->recurrule && preg_match('/FREQ=WEEKLY.*BYDAY(\d+)/i', $object->recurrule, $reg3)) {
|
||||||
|
$selectedrecurrulebyday = $reg3[1];
|
||||||
|
}
|
||||||
|
|
||||||
print $form->selectarray('recurrulefreq', $arrayrecurrulefreq, $selectedrecurrulefreq, 0, 0, 0, '', 0, 0, 0, '', 'marginrightonly');
|
print $form->selectarray('recurrulefreq', $arrayrecurrulefreq, $selectedrecurrulefreq, 0, 0, 0, '', 0, 0, 0, '', 'marginrightonly');
|
||||||
|
// print '<script>console.log("recurrule: " +'.$object->recurrule.')</script>';
|
||||||
// For recursive event
|
// For recursive event
|
||||||
|
|
||||||
|
|
||||||
|
// If recurrulefreq is MONTHLY
|
||||||
|
print '<div class="hidden marginrightonly inline-block repeateventBYMONTHDAY">';
|
||||||
|
print $langs->trans("DayOfMonth").': <input type="input" size="2" name="BYMONTHDAY" value="'.$selectedrecurrulebymonthday.'">';
|
||||||
|
print '</div>';
|
||||||
|
// If recurrulefreq is WEEKLY
|
||||||
|
print '<div class="hidden marginrightonly inline-block repeateventBYDAY">';
|
||||||
|
print $langs->trans("DayOfWeek").': <input type="input" size="4" name="BYDAY" value="'.$selectedrecurrulebyday.'">';
|
||||||
|
print '</div>';
|
||||||
|
// limit date
|
||||||
$repeateventlimitdate = $repeateventlimitdate ? $repeateventlimitdate : '';
|
$repeateventlimitdate = $repeateventlimitdate ? $repeateventlimitdate : '';
|
||||||
print '<div class="hidden marginrightonly inline-block repeateventlimitdate">';
|
print '<div class="hidden marginrightonly inline-block repeateventlimitdate">';
|
||||||
print $langs->trans("Until")." ";
|
print $langs->trans("Until")." ";
|
||||||
print $form->selectDate($repeateventlimitdate, 'limit', 0, 0, 0, "action", 1, 0, 0, '', '', '', '', 1, '', '', 'tzuserrel');
|
print $form->selectDate($repeateventlimitdate, 'limit', 0, 0, 0, "action", 1, 0, 0, '', '', '', '', 1, '', '', 'tzuserrel');
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|
||||||
print '<script type="text/javascript">
|
print '<script type="text/javascript">
|
||||||
jQuery(document).ready(function() {
|
jQuery(document).ready(function() {
|
||||||
function init_repeat()
|
function init_repeat()
|
||||||
|
{
|
||||||
|
console.log("recurrule: " + "'.$object->recurrule.'");
|
||||||
|
console.log("reg1: " + "'.$selectedrecurrulefreq.'");
|
||||||
|
console.log("reg2: " + "'.$selectedrecurrulebymonthday.'");
|
||||||
|
console.log("reg3: " + "'.$selectedrecurrulebyday.'");
|
||||||
|
console.log("selectedrulefreq: " + "'.$selectedrecurrulefreq.'");
|
||||||
|
if (jQuery("#recurrulefreq").val() == \'MONTHLY\')
|
||||||
{
|
{
|
||||||
if (jQuery("#recurrulefreq").val() == \'MONTHLY\' || jQuery("#recurrulefreq").val() == \'WEEKLY\' || jQuery("#recurrulefreq").val() == \'DAILY\')
|
jQuery(".repeateventBYMONTHDAY").css("display", "inline-block"); /* use this instead of show because we want inline-block and not block */
|
||||||
{
|
jQuery(".repeateventlimitdate").css("display", "inline-block");
|
||||||
jQuery(".repeateventlimitdate").css("display", "inline-block"); /* use this instead of show because we want inline-block and not block */
|
jQuery(".repeateventBYDAY").hide();
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
jQuery(".repeateventlimitdate").hide();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else if (jQuery("#recurrulefreq").val() == \'WEEKLY\')
|
||||||
|
{
|
||||||
|
jQuery(".repeateventBYMONTHDAY").hide();
|
||||||
|
jQuery(".repeateventBYDAY").css("display", "inline-block"); /* use this instead of show because we want inline-block and not block */
|
||||||
|
jQuery(".repeateventlimitdate").css("display", "inline-block");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
jQuery(".repeateventBYMONTHDAY").hide();
|
||||||
|
jQuery(".repeateventBYDAY").hide();
|
||||||
|
jQuery(".repeateventlimitdate").hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
init_repeat();
|
||||||
|
jQuery("#recurrulefreq").change(function() {
|
||||||
init_repeat();
|
init_repeat();
|
||||||
jQuery("#recurrulefreq").change(function() {
|
|
||||||
init_repeat();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
</script>';
|
});
|
||||||
|
</script>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
//print '</td></tr>';
|
//print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user