year;
break;
case "m":
$str .= " ".$date_time->get_month_name();
break;
case "d":
$str .= " ".$date_time->get_day();
break;
}
}
}else if($view == 'year') {
$str .= $date_time->year;
}else{
sugar_die("echo_date_info: date not supported");
}
return $str;
}
/**
* Get link to next date range
* @return string
*/
protected function get_next_calendar(){
global $cal_strings,$image_path;
$str = "";
if($_REQUEST['module'] == "Calendar"){
$str .= "";
}else{
$str .= "";
}
$str .= $cal_strings["LBL_NEXT_".strtoupper($this->cal->view)];
$str .= " ".SugarThemeRegistry::current()->getImage("calendar_next", 'align="absmiddle" border="0"' ,null,null,'.gif', '') . ""; //setting alt tag blank on purpose for 508 compliance
return $str;
}
/**
* Get link to previous date range
* @return string
*/
protected function get_previous_calendar(){
global $cal_strings,$image_path;
$str = "";
if($_REQUEST['module'] == "Calendar"){
$str .= "";
}else{
$str .= "";
}
$str .= SugarThemeRegistry::current()->getImage('calendar_previous','align="absmiddle" border="0"', null, null, '.gif', ''); //setting alt tag blank on purpose for 508 compliance
$str .= " ".$cal_strings["LBL_PREVIOUS_".strtoupper($this->cal->view)] . "";
return $str;
}
/**
* display header
* @param boolean $controls display ui contol itmes
*/
public function display_calendar_header($controls = true){
global $cal_strings;
$ss = new Sugar_Smarty();
$ss->assign("MOD",$cal_strings);
$ss->assign("view",$this->cal->view);
$ss->assign('print', $this->cal->isPrint());
if($controls){
$current_date = str_pad($this->cal->date_time->month,2,'0',STR_PAD_LEFT)."/".str_pad($this->cal->date_time->day,2,'0',STR_PAD_LEFT)."/".$this->cal->date_time->year;
$tabs = array('day', 'week', 'month', 'year', 'shared');
$tabs_params = array();
foreach($tabs as $tab){
$tabs_params[$tab]['title'] = $cal_strings["LBL_".strtoupper($tab)];
$tabs_params[$tab]['id'] = $tab . "-tab";
$tabs_params[$tab]['link'] = "window.location.href='".ajaxLink("index.php?module=Calendar&action=index&view=". $tab . $this->cal->date_time->get_date_str())."'";
}
$ss->assign('controls',$controls);
$ss->assign('tabs',$tabs);
$ss->assign('tabs_params',$tabs_params);
$ss->assign('current_date',$current_date);
$ss->assign('start_weekday',$GLOBALS['current_user']->get_first_day_of_week());
$ss->assign('cal_img',SugarThemeRegistry::current()->getImageURL("jscalendar.gif",false));
}
$ss->assign('previous',$this->get_previous_calendar());
$ss->assign('next',$this->get_next_calendar());
$ss->assign('date_info',$this->get_date_info($this->cal->view,$this->cal->date_time));
$header = "custom/modules/Calendar/tpls/header.tpl";
if(!file_exists($header))
$header = "modules/Calendar/tpls/header.tpl";
echo $ss->fetch($header);
}
/**
* display footer
*/
public function display_calendar_footer(){
global $cal_strings;
$ss = new Sugar_Smarty();
$ss->assign("MOD",$cal_strings);
$ss->assign("view",$this->cal->view);
$ss->assign('previous',$this->get_previous_calendar());
$ss->assign('next',$this->get_next_calendar());
$footer = "custom/modules/Calendar/tpls/footer.tpl";
if(!file_exists($footer))
$footer = "modules/Calendar/tpls/footer.tpl";
echo $ss->fetch($footer);
}
/**
* display title
*/
public function display_title(){
global $mod_strings;
//Hack to make this 6.5 compatible until this module is converted to MVC
echo "". $mod_strings['LBL_MODULE_TITLE'] ."
";
}
/**
* display html used in shared view
*/
public function display_shared_html(){
global $app_strings,$cal_strings,$action;
$ss = new Sugar_Smarty();
$ss->assign("APP",$app_strings);
$ss->assign("MOD",$cal_strings);
$ss->assign("UP",SugarThemeRegistry::current()->getImage('uparrow_big', 'border="0" style="margin-bottom: 1px;"', null, null, '.gif', $app_strings['LBL_SORT']));
$ss->assign("DOWN",SugarThemeRegistry::current()->getImage('downarrow_big', 'border="0" style="margin-top: 1px;"', null, null, '.gif', $app_strings['LBL_SORT']));
if(!empty($_REQUEST['edit_shared'])){
$ss->assign("edit_shared",true);
}
$ss->assign("users_options",get_select_options_with_id(get_user_array(false), $this->cal->shared_ids));
$tpl = "modules/Calendar/tpls/shared_users.tpl";
echo $ss->fetch($tpl);
}
}
?>