';
if($act->sugar_bean->object_name == 'Call') {
if ( isset($app_list_strings['call_status_dom'][$act->sugar_bean->status]) ) {
$callStatus = $app_list_strings['call_status_dom'][$act->sugar_bean->status];
}
else {
$callStatus = '';
}
echo '' . SugarThemeRegistry::current()->getImage('Calls','alt="'.$callStatus.': '.$act->sugar_bean->name.'"') . ' |
' . $callStatus . ': ' . $act->sugar_bean->name . ' | ';
} else if($act->sugar_bean->object_name == 'Meeting') {
if ( isset($app_list_strings['meeting_status_dom'][$act->sugar_bean->status]) ) {
$meetingStatus = $app_list_strings['meeting_status_dom'][$act->sugar_bean->status];
}
else {
$meetingStatus = '';
}
$out = '' . SugarThemeRegistry::current()->getImage('Meetings','alt="'.$meetingStatus.': '.$act->sugar_bean->name.'"') . ' |
' . $meetingStatus . ': ' . $act->sugar_bean->name .'';
///////////////////////////////////////////////////////////////
//// MEETING INTEGRATION
if(method_exists($act->sugar_bean, 'hasIntegratedMeeting')) {
if($act->sugar_bean->hasIntegratedMeeting()) {
$out .= $act->sugar_bean->miIcon;
}
}
//// END MEETING INTEGRATION
///////////////////////////////////////////////////////////////
$out .= " | ";
echo $out;
} else if($act->sugar_bean->object_name == 'Task') {
if ( isset($app_list_strings['task_status_dom'][$act->sugar_bean->status]) )
{
$taskStatus = $app_list_strings['task_status_dom'][$act->sugar_bean->status];
}
else
{
$taskStatus = '';
}
echo '' . SugarThemeRegistry::current()->getImage('Tasks','alt="'.$taskStatus.': '.$act->sugar_bean->name.'"') . ' |
'.$taskStatus.': ' . $act->sugar_bean->name . ' | ';
}
echo '
';
}
}
function template_echo_slice_activities_shared($args) {
global $app_list_strings;
global $shared_user, $timedate;
$count = 0;
if(empty($args['slice']->acts_arr[$shared_user->id])) {
return;
}
$out = '';
foreach($args['slice']->acts_arr[$shared_user->id] as $act) {
$count ++;
echo "
";
}
}
/////////////////////////////////
// template
/////////////////////////////////
function template_cal_day_slice($args) {
/*
echo "cale:".$args['calendar']->view;
echo "cal1:".$args['calendar']->date_time->month;
echo "cal3:".$args['slice']->date_time->month;
*/
if($args['calendar']->show_only_current_slice == false || $args['calendar']->date_time->month == $args['slice']->start_time->month) {
template_echo_slice_date($args);
if($args['calendar']->show_activities == true) {
template_echo_slice_activities($args);
}
}
}
/////////////////////////////////
// template
/////////////////////////////////
function template_calendar($args) {
global $timedate;
if(isset($args['size']) && $args['size'] == 'small') {
$args['calendar']->show_activities = false;
$args['calendar']->show_week_on_month_view = false;
}
$newargs = array();
$newargs['view'] = $args['view'];
$newargs['calendar'] = $args['calendar'];
if(!isset($args['size']) || $args['size'] != 'small') {
template_cal_tabs($newargs);
}
if(isset($_REQUEST['view']) && $_REQUEST['view'] == 'shared') {
global $ids;
global $current_user;
global $mod_strings;
global $app_list_strings, $current_language, $currentModule, $action, $app_strings;
$current_module_strings = return_module_language($current_language, 'Calendar');
$ids = array();
$user_ids = $current_user->getPreference('shared_ids');
//get list of user ids for which to display data
if(!empty($user_ids) && count($user_ids) != 0 && !isset($_REQUEST['shared_ids'])) {
$ids = $user_ids;
}
elseif(isset($_REQUEST['shared_ids']) && count($_REQUEST['shared_ids']) > 0) {
$ids = $_REQUEST['shared_ids'];
$current_user->setPreference('shared_ids', $_REQUEST['shared_ids']);
} else {
//$ids = get_user_array(false);
//$ids = array_keys($ids);
$ids = array($current_user->id);
}
//get team id for which to display user list
$tools = '
';
echo get_form_header($mod_strings['LBL_SHARED_CAL_TITLE'], $tools, false);
if(empty($_SESSION['shared_ids']))
$_SESSION['shared_ids'] = "";
echo "
";
} // end "shared" view
echo "
";
if(isset($_REQUEST['edit']) && $_REQUEST['edit'])
echo " ";
echo "
|
view == 'month') {
template_calendar_month($args);
} else
if($args['calendar']->view == 'year') {
template_calendar_year($args);
} else
if($args['calendar']->view == 'shared') {
global $current_user, $shared_user;
$shared_args = array();
foreach($args as $key => $val) {
$shared_args[$key] = $val;
}
$shared_args['calendar'] = $args['calendar'];
$shared_user = new User();
foreach($ids as $member) {
$shared_user->retrieve($member);
$shared_args['calendar']->show_tasks = true;
$shared_args['calendar']->add_activities($shared_user);
$shared_args['show_link'] = 'off';
if(($shared_user->id == $current_user->id))
$shared_args['show_link'] = 'on';
echo ''.$shared_user->full_name.'';
template_calendar_horizontal($shared_args);
}
} else {
template_calendar_vertical($args);
}
?>
|
|
get_start_slice_idx();
$end_slice_idx = $args['calendar']->get_end_slice_idx();
$cur_slice_idx = 1;
for($cur_slice_idx = $start_slice_idx; $cur_slice_idx <= $end_slice_idx; $cur_slice_idx ++) {
$calendar = $args['calendar'];
$args['slice'] = $calendar->slice_hash[$calendar->slices_arr[$cur_slice_idx]];
?>
";
// need to change these values after we find out what activities
// occur outside of these values
$start_slice_idx = $args['calendar']->get_start_slice_idx();
$end_slice_idx = $args['calendar']->get_end_slice_idx();
$cur_slice_idx = 1;
for($cur_slice_idx = $start_slice_idx; $cur_slice_idx <= $end_slice_idx; $cur_slice_idx ++) {
$calendar = $args['calendar'];
$args['slice'] = $calendar->slice_hash[$calendar->slices_arr[$cur_slice_idx]];
template_cal_horizontal_slice($args);
}
echo "
";
}
function template_cal_vertical_slice($args) {
global $timedate;
?>
|
getFormBody('', 'Calls', 'inlineCal'.template_echo_daily_view_24_hour($args).'CallSave', $timedate->to_display_date($args['calendar']->date_time->get_mysql_date(), false), $timedate->to_display_time(template_echo_daily_view_24_hour($args).':00:00', true, false))." ";
?>
|
";
if($args['show_link'] == 'on') {
template_echo_slice_date($args);
} else {
template_echo_slice_date_nolink($args);
}
template_echo_slice_activities_shared($args);
echo "";
}
function template_calendar_year($args) {
$count = 0;
?>
slice_hash[$args['calendar']->slices_arr[$count]];
?>
|
|
get_start_slice_idx();
$end_slice_idx = $args['calendar']->get_end_slice_idx();
$cur_slice_idx = 1;
*/
$count = 0;
if($args['calendar']->slice_hash[$args['calendar']->slices_arr[35]]->start_time->month != $args['calendar']->date_time->month) {
$rows = 5;
} else {
$rows = 6;
}
?>
slice_hash[$args['calendar']->slices_arr[$i]];
?>
start_time->get_day_of_week_short(); ?> |
slice_hash[$args['calendar']->slices_arr[$count]];
?>
class="weekEnd"> |
start_time->get_mysql_date() == $timedate->nowDbDate()) {
return true;
}
return false;
}
function template_echo_daily_view_hour($args) {
$slice = $args['slice'];
$hour = $slice->start_time->get_hour();
return $hour;
}
function template_echo_daily_view_24_hour($args) {
$slice = $args['slice'];
$hour = $slice->start_time->get_24_hour();
return $hour;
}
function template_echo_slice_date($args) {
global $mod_strings;
global $timedate;
$slice = $args['slice'];
if($slice->view != 'hour') {
if($slice->start_time->get_day_of_week_short() == 'Sun' || $slice->start_time->get_day_of_week_short() == 'Sat') {
echo "
get_view().$slice->start_time->get_date_str()."\" ";
} else {
echo "get_view().$slice->start_time->get_date_str()."\" ";
}
}
if($slice->view == 'day' &&($args['calendar']->view == 'week')) {
echo ">";
echo $slice->start_time->get_day_of_week_short();
echo " ";
echo $slice->start_time->get_day();
}
elseif($args['calendar']->view == 'shared') {
echo ">";
echo $slice->start_time->get_day_of_week_short();
echo " ";
echo $slice->start_time->get_day();
} else
if($slice->view == 'day') {
echo ">";
if($slice->start_time->get_month() == $args['calendar']->date_time->get_month()) {
echo $slice->start_time->get_day();
}
//echo $slice->start_time->get_day();
} else
if($slice->view == 'month') {
echo ">";
echo $slice->start_time->get_month_name();
} else
if($slice->view == 'hour') {
if($args['calendar']->toggle_appt == true) {
echo '';
}
//Bug 13324, We are now using the users time format instead of a custom AM/PM setting
echo $timedate->to_display_time($slice->start_time->get_24_hour() . ":00:00", true, false);
} else {
sugar_die("template_echo_slice_date: view not supported");
}
echo "";
}
function template_echo_slice_date_nolink($args) {
global $mod_strings;
$slice = $args['slice'];
echo $slice->start_time->get_day_of_week_short();
echo " ";
echo $slice->start_time->get_day();
}
function template_echo_date_info($view, $date_time) {
global $current_user;
$dateFormat = $current_user->getUserDateTimePreferences();
if($view == 'month') {
for($i=0; $i
year;
break;
case "m":
echo " ".$date_time->get_month_name();
break;
}
}
} else
if($view == 'week' || $view == 'shared') {
$first_day = $date_time->get_day_by_index_this_week(0);
$last_day = $date_time->get_day_by_index_this_week(6);
for($i=0; $iyear;
break;
case "m":
echo " ".$first_day->get_month_name();
break;
case "d":
echo " ".$first_day->get_day();
break;
}
}
echo " - ";
for($i=0; $iyear;
break;
case "m":
echo " ".$last_day->get_month_name();
break;
case "d":
echo " ".$last_day->get_day();
break;
}
}
} else
if($view == 'day') {
echo $date_time->get_day_of_week()." ";
for($i=0; $iyear;
break;
case "m":
echo " ".$date_time->get_month_name();
break;
case "d":
echo " ".$date_time->get_day();
break;
}
}
} else
if($view == 'year') {
echo $date_time->year;
} else {
sugar_die("echo_date_info: date not supported");
}
}
function template_get_next_calendar($args) {
global $mod_strings;
?>
get_view_name($args['calendar']->view)]; ?> getImage('calendar_next','alt="'. $mod_strings["LBL_NEXT_".$args['calendar']->get_view_name($args['calendar']->view)].'" align="absmiddle" border="0"'); ?>
getImage('calendar_previous','alt="'. $mod_strings["LBL_PREVIOUS_".$args['calendar']->get_view_name($args['calendar']->view)].'" align="absmiddle" border="0"'); ?> get_view_name($args['calendar']->view)]; ?>