コード例 #1
0
ファイル: ActivityAjax.php プロジェクト: latechdirect/vtiger
             } elseif ($calendar_arr['view'] == 'week') {
                 echo getWeekViewLayout($calendar_arr) . "####" . getEventInfo($calendar_arr, 'listcnt');
             } elseif ($calendar_arr['view'] == 'month') {
                 echo getMonthViewLayout($calendar_arr) . "####" . getEventInfo($calendar_arr, 'listcnt');
             } elseif ($calendar_arr['view'] == 'year') {
                 echo getYearViewLayout($calendar_arr) . "####" . getEventInfo($calendar_arr, 'listcnt');
             } else {
                 die("view:" . $view['view'] . " is not defined");
             }
         } elseif ($_REQUEST['viewOption'] == 'listview') {
             $cal_log->debug("going to get calendar Event ListView");
             //To get Events List
             $activity_arr = getEventList($calendar_arr, $start_date, $end_date);
             $activity_list = $activity_arr[0];
             $navigation_arr = $activity_arr[1];
             echo constructEventListView($calendar_arr, $activity_list, $navigation_arr) . "####" . getEventInfo($calendar_arr, 'listcnt');
         }
     } elseif ($subtab == 'todo') {
         $cal_log->debug("going to get calendar Todo ListView");
         //To get Todos List
         $todo_arr = getTodoList($calendar_arr, $start_date, $end_date);
         $todo_list = $todo_arr[0];
         $navigation_arr = $todo_arr[1];
         echo constructTodoListView($todo_list, $calendar_arr, $subtab, $navigation_arr) . "####" . getTodoInfo($calendar_arr, 'listcnt');
     }
 } elseif ($type == 'view') {
     checkFileAccess('modules/Calendar/' . $_REQUEST['file'] . '.php');
     require_once 'modules/Calendar/' . $_REQUEST['file'] . '.php';
 } else {
     die("View option is not defined");
 }
コード例 #2
0
ファイル: calendarLayout.php プロジェクト: p6/VF
/**
 * Fuction constructs Events ListView depends on the view
 * @param   array  $cal            - collection of objects and strings
 * @param   string $mode           - string 'listcnt' or empty. if empty means get Events ListView else get total no. of events and no. of pending events Info.
 * returns  string $activity_list  - total no. of events and no. of pending events Info(Eg: Total Events : 2, 1 Pending).
 */
function getEventListView(&$cal, $mode = '')
{
    global $cal_log, $theme;
    $list_view = "";
    $cal_log->debug("Entering getEventListView() method...");
    if ($cal['calendar']->view == 'day') {
        $start_date = $end_date = $cal['calendar']->date_time->get_formatted_date();
    } elseif ($cal['calendar']->view == 'week') {
        $start_date = $cal['calendar']->slices[0];
        $end_date = $cal['calendar']->slices[6];
    } elseif ($cal['calendar']->view == 'month') {
        $start_date = $cal['calendar']->date_time->getThismonthDaysbyIndex(0);
        $end_date = $cal['calendar']->date_time->getThismonthDaysbyIndex($cal['calendar']->date_time->daysinmonth - 1);
        $start_date = $start_date->get_formatted_date();
        $end_date = $end_date->get_formatted_date();
    } elseif ($cal['calendar']->view == 'year') {
        $start_date = $cal['calendar']->date_time->getThisyearMonthsbyIndex(0);
        $end_date = $cal['calendar']->date_time->get_first_day_of_changed_year('increment');
        $start_date = $start_date->get_formatted_date();
        $end_date = $end_date->get_formatted_date();
    } else {
        die("view:" . $cal['calendar']->view . " is not defined");
    }
    //if $mode value is empty means get Events list in array format else get the count of total events and pending events in array format.
    if ($mode != '') {
        $activity_list = getEventList($cal, $start_date, $end_date, $mode);
        $cal_log->debug("Exiting getEventListView() method...");
        return $activity_list;
    } else {
        $ret_arr = getEventList($cal, $start_date, $end_date, $mode);
        $activity_list = $ret_arr[0];
        $navigation_array = $ret_arr[1];
    }
    //To get Events listView
    $list_view .= "<br><div id='listView'>";
    $list_view .= constructEventListView($cal, $activity_list, $navigation_array);
    $list_view .= "<br></div>\n\t\t</div>";
    $list_view .= "<br></td></tr></table></td></tr></table>\n\t\t\t</td></tr></table>\n\t\t</td></tr></table>\n\t\t</div>\n\t\t</td></tr></table>\n\t\t</td>\n\t\t<td valign=top><img src='" . vtiger_imageurl('showPanelTopRight.gif', $theme) . "'></td>\n\t\t</tr>\n\t</table>\n\t<br>";
    echo $list_view;
    $cal_log->debug("Exiting getEventListView() method...");
}