Example #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);
}
Example #2
0
    $bean = new Meeting();
    $type = 'meeting';
    $table_name = 'meetings';
    $jn = "meeting_id_c";
}
$bean->retrieve($_REQUEST['record']);
if (!$bean->ACLAccess('DetailView')) {
    $json_arr = array('succuss' => 'no');
    echo json_encode($json_arr);
    die;
}
if ($bean->ACLAccess('Save')) {
    $editview = 1;
} else {
    $editview = 0;
}
if ($r_id = $bean->id) {
    $bean->retrieve($r_id);
    if (!empty($bean->parent_type) && !empty($bean->parent_id)) {
        require_once $beanFiles[$beanList[$bean->parent_type]];
        $par = new $beanList[$bean->parent_type]();
        $par->retrieve($bean->parent_id);
    }
    global $timedate;
    $start = to_timestamp_from_uf($bean->date_start);
    $json_arr = array('succuss' => 'yes', 'record_name' => html_entity_decode($bean->name, ENT_QUOTES), 'record' => $bean->id, 'type' => $type, 'assigned_user_id' => $bean->assigned_user_id, 'user_id' => '', 'user_name' => $bean->assigned_user_name, 'date_start' => $bean->date_start, 'start' => $start, 'duration_hours' => $bean->duration_hours, 'duration_minutes' => $bean->duration_minutes, 'reminder_time' => $bean->reminder_time, 'status' => $bean->status, 'time_start' => timestamp_to_user_formated2($start, $GLOBALS['timedate']->get_time_format()), 'direction' => $bean->direction, 'location' => $bean->location, 'description' => html_entity_decode($bean->description, ENT_QUOTES), 'parent_type' => $bean->parent_type, 'parent_name' => $par->name, 'parent_id' => $bean->parent_id, 'rec_id_c' => $bean->{$jn}, 'repeat_type_c' => $bean->repeat_type_c, 'repeat_interval_c' => $bean->repeat_interval_c, 'repeat_end_date_c' => $bean->repeat_end_date_c, 'repeat_days_c' => $bean->repeat_days_c, 'editview' => $editview);
} else {
    $json_arr = array('succuss' => 'no');
}
ob_clean();
echo json_encode($json_arr);
Example #3
0
            }
            $hc = check_owt($i, $j, $r_start, $r_end);
            echo "<div class='left_cell " . $hc . "'>" . $innerText . "</div>";
        }
    }
    echo "</div>";
    echo "<div class='week_block'>";
    for ($d = 0; $d < 7; $d++) {
        $curr_time = $week_start_unix + $d * 86400;
        echo "<div class='day_col'>";
        if ($real_today_unix == $curr_time) {
            $headstyle = " today";
        } else {
            $headstyle = "";
        }
        echo "<div class='day_head" . $headstyle . "'><a href='index.php?module=ECalendar&action=index&view=day&hour=0&day=" . timestamp_to_user_formated2($curr_time, 'j') . "&month=" . timestamp_to_user_formated2($curr_time, 'n') . "&year=" . timestamp_to_user_formated2($curr_time, 'Y') . "'>" . $weekday_names[$d] . " " . timestamp_to_user_formated2($curr_time, 'd') . "</a></div>";
        for ($i = 0; $i < 24; $i++) {
            for ($j = 0; $j < 60; $j += $t_step) {
                $hc = check_owt($i, $j, $r_start, $r_end);
                $timestr = timestamp_to_user_formated2($curr_time, $GLOBALS['timedate']->get_time_format());
                echo "<div id='t_" . $curr_time . $un_str . "' class='t_cell " . $hc . "' lang='" . $timestr . "' datetime='" . timestamp_to_user_formated2($curr_time) . "'></div>";
                $curr_time += $t_step * 60;
            }
        }
        echo "</div>";
    }
    echo "</div>";
    echo "</div>";
    $un++;
}
echo "</div>";
Example #4
0
 } else {
     $newAct['editview'] = 0;
 }
 if (empty($beanA->id)) {
     $newAct['detailview'] = 0;
     $newAct['editview'] = 0;
 }
 $newAct['date_start'] = $act->sugar_bean->date_start;
 $date_unix = to_timestamp_from_uf($act->sugar_bean->date_start);
 if ($newAct['type'] == 'task') {
     $newAct['date_start'] = $act->sugar_bean->date_due;
     //$newAct['date_start'] = $timedate->swap_formats($newAct['date_start'],'Y-m-d H:i:s',$timedate->get_date_time_format());
     $date_unix = to_timestamp_from_uf($newAct['date_start']);
 }
 $newAct['start'] = $date_unix;
 $newAct['time_start'] = timestamp_to_user_formated2($newAct['start'], $GLOBALS['timedate']->get_time_format());
 if ($newAct['type'] == 'task') {
     $newAct['duration_hours'] = 0;
     $newAct['duration_minutes'] = 0;
     //$newAct['date_due'] = $act->sugar_bean->date_due;
 } else {
     $newAct['duration_hours'] = $act->sugar_bean->duration_hours;
     $newAct['duration_minutes'] = $act->sugar_bean->duration_minutes;
 }
 if (empty($newAct['duration_hours'])) {
     $newAct['duration_hours'] = 0;
 }
 if (empty($newAct['duration_minutes'])) {
     $newAct['duration_minutes'] = 0;
 }
 if ($newAct['detailview'] == 1) {
Example #5
0
}
?>
			</select>
		</td>			
	</tr>
	<tr>
		<td scope="row">
			<?php 
echo $GLOBALS['mod_strings']['LBL_REPEAT_END_DATE'] . ":";
?>
	
		</td>
		<td>
			<?php 
$default_end_date = $today_unix + 24 * 60 * 60 * date("t", $today_unix - date('Z'));
$default_end_date = timestamp_to_user_formated2($default_end_date, $GLOBALS['timedate']->get_date_format());
?>
			<input autocomplete="off" name="repeat_end_date" id="repeat_end_date" value="<?php 
echo $default_end_date;
?>
" title="" tabindex="105" size="11" maxlength="10" type="text">
			<img src="themes/default/images/jscalendar.gif" alt="Enter Date" id="repeat_end_date_trigger" align="absmiddle" border="0">
			<script type="text/javascript">
			Calendar.setup ({
			inputField : "repeat_end_date",
			daFormat : "<?php 
echo $CALENDAR_FORMAT;
?>
",
			button : "repeat_end_date_trigger",
			singleClick : true,
Example #6
0
 echo '<table id="daily_cal_table" cellspacing="1" cellpadding="0" border="0" width="100%">';
 echo '<tr class="monthCalBodyTH">';
 for ($d = 0; $d < 7; $d++) {
     echo '<th width="14%">' . $weekday_names[$d + 1] . '</th>';
 }
 echo '</tr>';
 $curr_time_g = $week_start_unix;
 $w = 0;
 while ($curr_time_g < $month_end_unix) {
     echo '<tr class="monthViewDayHeight yearViewDayHeight">';
     for ($d = 0; $d < 7; $d++) {
         $curr_time = $week_start_unix + $d * 86400 + $w * 60 * 60 * 24 * 7;
         if ($curr_time < $month_start_unix || $curr_time >= $month_end_unix) {
             $monC = "";
         } else {
             $monC = '<a href="index.php?module=ECalendar&action=index&view=day&hour=0&day=' . timestamp_to_user_formated2($curr_time, 'j') . '&month=' . timestamp_to_user_formated2($curr_time, 'n') . '&year=' . timestamp_to_user_formated2($curr_time, 'Y') . '">' . timestamp_to_user_formated2($curr_time, 'j') . '</a>';
         }
         if ($d == $weekEnd1 || $d == $weekEnd2) {
             echo "<td class='weekEnd monthCalBodyWeekEnd'>";
         } else {
             echo "<td class='monthCalBodyWeekDay'>";
         }
         echo $monC;
         echo "</td>";
     }
     echo "</tr>";
     $curr_time_g += 60 * 60 * 24 * 7;
     $w++;
 }
 echo '</table>';
 echo '</td>';