Exemplo n.º 1
0
/**
 * Function creates HTML anchor tag to get next-day/week/month/year view
 * @param array  $cal        - collection of objects and strings
 * @param string $viewBox    - string 'listview' or 'hourview' or may be empty. if 'listview' means next link in Events ListView.if 'hourview' means next link in Events HourView. if empty means next link in Todos ListView
 * @param string $subtab     - string 'todo' or 'event' or may be empty. if 'todo' means Todos View. if 'event' means Events View. if empty means small calendar view. 
 * return string $link       - html tags in string format
 */
function get_next_cal(&$cal, $viewBox = '', $subtab = '')
{
    global $mod_strings, $cal_log, $theme;
    $category = getParentTab();
    $cal_log->debug("Entering get_next_cal() method...");
    if (isset($cal['size']) && $cal['size'] == 'small') {
        $link = "<a href='javascript:getMiniCal(\"view=" . $cal['calendar']->view . "" . $cal['calendar']->get_datechange_info('next') . "&parenttab=" . $category . "\")'  ><img src='" . vtiger_imageurl('small_right.gif', $theme) . "' border='0' align='absmiddle' /></a>";
    } else {
        $link = "<a href='index.php?action=index&module=Calendar&view=" . $cal['calendar']->view . "" . $cal['calendar']->get_datechange_info('next') . "&viewOption=" . $viewBox . "&subtab=" . $subtab . "&parenttab=" . $category . "&onlyforuser="******"' onclick='VtigerJS_DialogBox.block();return true;'><img src='" . $cal['IMAGE_PATH'] . "cal_next_nav.gif' border='0' align='absmiddle' /></a>";
    }
    $cal_log->debug("Exiting get_next_cal() method...");
    return $link;
}
Exemplo n.º 2
0
function calendarview_getSelectedUserFilterQuerySuffix()
{
    global $current_user, $adb;
    $only_for_user = calendarview_getSelectedUserId();
    $qcondition = '';
    if (!empty($only_for_user)) {
        if ($only_for_user != 'ALL') {
            // For logged in user include the group records also.
            if ($only_for_user == $current_user->id) {
                $user_group_ids = fetchUserGroupids($current_user->id);
                // User does not belong to any group? Let us reset to non-existent group
                if (!empty($user_group_ids)) {
                    $user_group_ids .= ',';
                } else {
                    $user_group_ids = '';
                }
                $user_group_ids .= $current_user->id;
                $qcondition = " AND vtiger_crmentity.smownerid IN (" . $user_group_ids . ")";
            } else {
                $qcondition = " AND vtiger_crmentity.smownerid = " . $adb->sql_escape_string($only_for_user);
            }
        }
    }
    return $qcondition;
}