Beispiel #1
0
function create_clone($bean, $cur_date, $jn)
{
    $obj = clone_rec($bean);
    $obj->date_start = timestamp_to_user_formated2($cur_date);
    $obj->date_end = timestamp_to_user_formated2($cur_date);
    $obj->{$jn} = $bean->id;
    //$obj->save();
    invitees_filling($obj, false);
    $obj_id = $obj->id;
    $date_unix = $cur_date;
    return array('record' => $obj_id, 'start' => $date_unix);
}
Beispiel #2
0
$bean->status = $_REQUEST['status'];
$bean->assigned_user_id = $_REQUEST['assigned_user_id'];
$bean->parent_type = $_REQUEST['parent_type'];
$bean->parent_id = $_REQUEST['parent_id'];
$bean->description = $_REQUEST['description'];
if (empty($_REQUEST['rec_id_c']) && empty($_REQUEST['no_recurence'])) {
    $bean->repeat_type_c = $_REQUEST['repeat_type_c'];
    $bean->repeat_interval_c = $_REQUEST['repeat_interval_c'];
    $bean->repeat_end_date_c = $_REQUEST['repeat_end_date_c'];
    $bean->repeat_days_c = $_REQUEST['repeat_days_c'];
}
if (empty($_REQUEST['record']) && strpos($_POST['user_invitees'], $bean->assigned_user_id) === false) {
    $_POST['user_invitees'] .= "," . $bean->assigned_user_id;
}
// fill invites and save the entry
invitees_filling($bean);
//$bean->save($GLOBALS['check_notify']);
if ($r_id = $bean->id) {
    $u = new User();
    $u->retrieve($bean->assigned_user_id);
    /*if(empty($_POST['user_invitees'])){
    		$bean->set_accept_status($u, 'none');
    		$_POST['user_invitees'] = $bean->assigned_user_id;
    	}*/
    $arr_rec = array();
    if (empty($_REQUEST['rec_id_c']) && empty($_REQUEST['no_recurence']) && $_REQUEST['repeat_type_c'] != '') {
        include "modules/ECalendar/SaveReccurence.php";
    }
    if (empty($_REQUEST['rec_id_c']) && $_REQUEST['repeat_type_c'] == '') {
        remove_recurence($bean, $table_name, $jn, $bean->id);
    }