Ejemplo n.º 1
0
                        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");
        }
    }
} else {
    require_once 'include/Ajax/CommonAjax.php';
    //die("type is not set");
}
Ejemplo n.º 2
0
/**
 * Fuction constructs Todos ListView depends on the view
 * @param   array  $cal            - collection of objects and strings
 * @param   string $check          - string 'listcnt' or empty. if empty means get Todos ListView else get total no. of Todos and no. of pending todos Info.
 * returns  string $todo_list      - total no. of todos and no. of pending todos Info(Eg: Total Todos : 2, 1 Pending).
 */
function getTodosListView($cal, $check = '', $subtab = '')
{
    global $cal_log, $theme;
    $list_view = "";
    $cal_log->debug("Entering getTodosListView() 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 $check value is empty means get Todos list in array format else get the count of total todos and pending todos in array format.
    if ($check != '') {
        $todo_list = getTodoList($cal, $start_date, $end_date, $check);
        $cal_log->debug("Exiting getTodosListView() method...");
        return $todo_list;
    } else {
        $ret_arr = getTodoList($cal, $start_date, $end_date, $check);
        $todo_list = $ret_arr[0];
        $navigation_arr = $ret_arr[1];
    }
    $cal_log->debug("Exiting getTodosListView() method...");
    $list_view .= "<div id='mnuTab2' style='background-color: rgb(255, 255, 215); display:block;'>";
    //To get Todos listView
    $list_view .= constructTodoListView($todo_list, $cal, $subtab, $navigation_arr);
    $list_view .= "</div></div></td></tr></table></td></tr></table>\n\t\t</td></tr></table>\n\t\t</td></tr></table>\n\t\t</td></tr></table>\n\t\t</div>\n\t\t</td>\n\t\t<td valign=top><img src='" . vtiger_imageurl('showPanelTopRight.gif', $theme) . "'></td>\n\t</tr>\n\t</table>\n\n\t";
    echo $list_view;
}