function clash_cancel(CAppUI $AppUI)
{
    global $a;
    $a = $_SESSION['add_event_caller'];
    clear_clash();
    $AppUI->setMsg($AppUI->_('Event Cancelled'), UI_MSG_ALERT);
    $AppUI->redirect();
}
示例#2
0
function clash_accept()
{
    global $AppUI, $do_redirect;
    $AppUI->setMsg('Event');
    $obj =& new CEvent();
    $obj->bind($_SESSION['add_event_post']);
    $GLOBALS['a'] = $_SESSION['add_event_caller'];
    $is_new = $obj->event_id == 0;
    if ($msg = $obj->store()) {
        $AppUI->setMsg($msg, UI_MSG_ERROR);
    } else {
        if (isset($_SESSION['add_event_attendees']) && $_SESSION['add_event_attendees']) {
            $obj->updateAssigned(explode(",", $_SESSION['add_event_attendees']));
        }
        if (isset($_SESSION['add_event_mail']) && $_SESSION['add_event_mail'] == 'on') {
            $obj->notify($_SESSION['add_event_attendees'], !$is_new);
        }
        $AppUI->setMsg($is_new ? 'added' : 'updated', UI_MSG_OK, true);
    }
    clear_clash();
    $AppUI->redirect();
}