当前位置: 首页>>代码示例>>PHP>>正文


PHP VT_getSimpleNavigationValues函数代码示例

本文整理汇总了PHP中VT_getSimpleNavigationValues函数的典型用法代码示例。如果您正苦于以下问题:PHP VT_getSimpleNavigationValues函数的具体用法?PHP VT_getSimpleNavigationValues怎么用?PHP VT_getSimpleNavigationValues使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了VT_getSimpleNavigationValues函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render

 public static function render($userInputObject, $user)
 {
     global $list_max_entries_per_page;
     $adb = PearDatabase::getInstance();
     $viewer = new Import_UI_Viewer();
     $ownerId = $userInputObject->get('foruser');
     $owner = new Users();
     $owner->id = $ownerId;
     $owner->retrieve_entity_info($ownerId, 'Users');
     if (!is_admin($user) && $user->id != $owner->id) {
         $viewer->display('OperationNotPermitted.tpl', 'Vtiger');
         exit;
     }
     $userDBTableName = Import_Utils::getDbTableName($owner);
     $moduleName = $userInputObject->get('module');
     $moduleMeta = self::getModuleMeta($moduleName, $user);
     $result = $adb->query('SELECT recordid FROM ' . $userDBTableName . ' WHERE status is NOT NULL AND recordid IS NOT NULL');
     $noOfRecords = $adb->num_rows($result);
     $importedRecordIds = array();
     for ($i = 0; $i < $noOfRecords; ++$i) {
         $importedRecordIds[] = $adb->query_result($result, $i, 'recordid');
     }
     if (count($importedRecordIds) == 0) {
         $importedRecordIds[] = 0;
     }
     $focus = CRMEntity::getInstance($moduleName);
     $queryGenerator = new QueryGenerator($moduleName, $user);
     $customView = new CustomView($moduleName);
     $viewId = $customView->getViewIdByName('All', $moduleName);
     $queryGenerator->initForCustomViewById($viewId);
     $list_query = $queryGenerator->getQuery();
     // Fetch only last imported records
     $list_query .= ' AND ' . $focus->table_name . '.' . $focus->table_index . ' IN (' . implode(',', $importedRecordIds) . ')';
     if (PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true) {
         $count_result = $adb->query(mkCountQuery($list_query));
         $noofrows = $adb->query_result($count_result, 0, "count");
     } else {
         $noofrows = null;
     }
     $start = ListViewSession::getRequestCurrentPage($moduleName, $list_query, $viewId, false);
     $navigation_array = VT_getSimpleNavigationValues($start, $list_max_entries_per_page, $noofrows);
     $limit_start_rec = ($start - 1) * $list_max_entries_per_page;
     $list_result = $adb->pquery($list_query . " LIMIT {$limit_start_rec}, {$list_max_entries_per_page}", array());
     $recordListRangeMsg = getRecordRangeMessage($list_result, $limit_start_rec, $noofrows);
     $viewer->assign('recordListRange', $recordListRangeMsg);
     $controller = new ListViewController($adb, $user, $queryGenerator);
     $listview_header = $controller->getListViewHeader($focus, $moduleName, $url_string, $sorder, $order_by, true);
     $listview_entries = $controller->getListViewEntries($focus, $moduleName, $list_result, $navigation_array, true);
     $viewer->assign('CURRENT_PAGE', $start);
     $viewer->assign('LISTHEADER', $listview_header);
     $viewer->assign('LISTENTITY', $listview_entries);
     $viewer->assign('FOR_MODULE', $moduleName);
     $viewer->assign('FOR_USER', $ownerId);
     $isAjax = $userInputObject->get('ajax');
     if (!empty($isAjax)) {
         echo $viewer->fetch('ListViewEntries.tpl');
     } else {
         $viewer->display('ImportListView.tpl');
     }
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:60,代码来源:Import_ListView_Controller.php

示例2: fixPostgresQuery

        $list_query .= ' ORDER BY ' . $tablename . $order_by . ' ' . $sorder;
    }
}
///Postgres 8 fixes
if ($adb->dbType == "pgsql") {
    $list_query = fixPostgresQuery($list_query, $log, 0);
}
if (PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true) {
    $count_result = $adb->query(mkCountQuery($list_query));
    $noofrows = $adb->query_result($count_result, 0, "count");
} else {
    $noofrows = null;
}
$queryMode = isset($_REQUEST['query']) && $_REQUEST['query'] == 'true';
$start = ListViewSession::getRequestCurrentPage($currentModule, $list_query, $viewid, $queryMode);
$navigation_array = VT_getSimpleNavigationValues($start, $list_max_entries_per_page, $noofrows);
$limit_start_rec = ($start - 1) * $list_max_entries_per_page;
if ($adb->dbType == "pgsql") {
    $list_result = $adb->pquery($list_query . " OFFSET {$limit_start_rec} LIMIT {$list_max_entries_per_page}", array());
} else {
    $list_result = $adb->pquery($list_query . " LIMIT {$limit_start_rec}, {$list_max_entries_per_page}", array());
}
$recordListRangeMsg = getRecordRangeMessage($list_result, $limit_start_rec);
$smarty->assign('recordListRange', $recordListRangeMsg);
//Retreive the List View Table Header
if ($viewid != '') {
    $url_string .= "&viewname=" . $viewid;
}
$listview_header = getListViewHeader($focus, "SalesOrder", $url_string, $sorder, $order_by, "", $oCustomView);
$smarty->assign("LISTHEADER", $listview_header);
$listview_header_search = getSearchListHeaderValues($focus, "SalesOrder", $url_string, $sorder, $order_by, "", $oCustomView);
开发者ID:vtiger-jp,项目名称:vtigercrm-5.1.x-ja,代码行数:31,代码来源:ListView.php

示例3: getPriceBookRelatedServices

 /**	Function to display the Services which are related to the PriceBook
  *	@param string $query - query to get the list of products which are related to the current PriceBook
  *	@param object $focus - PriceBook object which contains all the information of the current PriceBook
  *	@param string $returnset - return_module, return_action and return_id which are sequenced with & to pass to the URL which is optional
  *	return array $return_data which will be formed like array('header'=>$header,'entries'=>$entries_list) where as $header contains all the header columns and $entries_list will contain all the Service entries
  */
 function getPriceBookRelatedServices($query, $focus, $returnset = '')
 {
     global $log;
     $log->debug("Entering getPriceBookRelatedServices(" . $query . "," . get_class($focus) . "," . $returnset . ") method ...");
     global $adb;
     global $app_strings;
     global $current_language, $current_user;
     $current_module_strings = return_module_language($current_language, 'Services');
     global $list_max_entries_per_page;
     global $urlPrefix;
     global $theme;
     $pricebook_id = $_REQUEST['record'];
     $theme_path = "themes/" . $theme . "/";
     $image_path = $theme_path . "images/";
     $computeCount = $_REQUEST['withCount'];
     if (PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true || (bool) $computeCount == true) {
         $noofrows = $adb->query_result($adb->query(mkCountQuery($query)), 0, 'count');
     } else {
         $noofrows = null;
     }
     $module = 'PriceBooks';
     $relatedmodule = 'Services';
     if (!$_SESSION['rlvs'][$module][$relatedmodule]) {
         $modObj = new ListViewSession();
         $modObj->sortby = $focus->default_order_by;
         $modObj->sorder = $focus->default_sort_order;
         $_SESSION['rlvs'][$module][$relatedmodule] = get_object_vars($modObj);
     }
     if (isset($_REQUEST['relmodule']) && $_REQUEST['relmodule'] != '' && $_REQUEST['relmodule'] == $relatedmodule) {
         $relmodule = vtlib_purify($_REQUEST['relmodule']);
         if ($_SESSION['rlvs'][$module][$relmodule]) {
             setSessionVar($_SESSION['rlvs'][$module][$relmodule], $noofrows, $list_max_entries_per_page, $module, $relmodule);
         }
     }
     global $relationId;
     $start = RelatedListViewSession::getRequestCurrentPage($relationId, $query);
     $navigation_array = VT_getSimpleNavigationValues($start, $list_max_entries_per_page, $noofrows);
     $limit_start_rec = ($start - 1) * $list_max_entries_per_page;
     if ($adb->dbType == "pgsql") {
         $list_result = $adb->pquery($query . " OFFSET {$limit_start_rec} LIMIT {$list_max_entries_per_page}", array());
     } else {
         $list_result = $adb->pquery($query . " LIMIT {$limit_start_rec}, {$list_max_entries_per_page}", array());
     }
     $header = array();
     $header[] = $current_module_strings['LBL_LIST_SERVICE_NAME'];
     if (getFieldVisibilityPermission('Services', $current_user->id, 'unit_price') == '0') {
         $header[] = $current_module_strings['LBL_SERVICE_UNIT_PRICE'];
     }
     $header[] = $current_module_strings['LBL_PB_LIST_PRICE'];
     if (isPermitted("PriceBooks", "EditView", "") == 'yes' || isPermitted("PriceBooks", "Delete", "") == 'yes') {
         $header[] = $app_strings['LBL_ACTION'];
     }
     $currency_id = $focus->column_fields['currency_id'];
     $numRows = $adb->num_rows($list_result);
     for ($i = 0; $i < $numRows; $i++) {
         $entity_id = $adb->query_result($list_result, $i, "crmid");
         $unit_price = $adb->query_result($list_result, $i, "unit_price");
         if ($currency_id != null) {
             $prod_prices = getPricesForProducts($currency_id, array($entity_id), 'Services');
             $unit_price = $prod_prices[$entity_id];
         }
         $listprice = $adb->query_result($list_result, $i, "listprice");
         $field_name = $entity_id . "_listprice";
         $entries = array();
         $entries[] = textlength_check($adb->query_result($list_result, $i, "servicename"));
         if (getFieldVisibilityPermission('Services', $current_user->id, 'unit_price') == '0') {
             $entries[] = CurrencyField::convertToUserFormat($unit_price, null, true);
         }
         $entries[] = CurrencyField::convertToUserFormat($listprice, null, true);
         $action = "";
         if (isPermitted("PriceBooks", "EditView", "") == 'yes' && isPermitted('Services', 'EditView', $entity_id) == 'yes') {
             $action .= '<img style="cursor:pointer;" src="themes/images/editfield.gif" border="0" onClick="fnvshobj(this,\'editlistprice\'),editProductListPrice(\'' . $entity_id . '\',\'' . $pricebook_id . '\',\'' . $listprice . '\')" alt="' . $app_strings["LBL_EDIT_BUTTON"] . '" title="' . $app_strings["LBL_EDIT_BUTTON"] . '"/>';
         } else {
             $action .= '<img src="' . vtiger_imageurl('blank.gif', $theme) . '" border="0" />';
         }
         if (isPermitted("PriceBooks", "Delete", "") == 'yes' && isPermitted('Services', 'Delete', $entity_id) == 'yes') {
             if ($action != "") {
                 $action .= '&nbsp;|&nbsp;';
             }
             $action .= '<img src="themes/images/delete.gif" onclick="if(confirm(\'' . $app_strings['ARE_YOU_SURE'] . '\')) deletePriceBookProductRel(' . $entity_id . ',' . $pricebook_id . ');" alt="' . $app_strings["LBL_DELETE"] . '" title="' . $app_strings["LBL_DELETE"] . '" style="cursor:pointer;" border="0">';
         }
         if ($action != "") {
             $entries[] = $action;
         }
         $entries_list[] = $entries;
     }
     $navigationOutput[] = getRecordRangeMessage($list_result, $limit_start_rec, $noofrows);
     $navigationOutput[] = getRelatedTableHeaderNavigation($navigation_array, '', $module, $relatedmodule, $focus->id);
     $return_data = array('header' => $header, 'entries' => $entries_list, 'navigation' => $navigationOutput);
     $log->debug("Exiting getPriceBookRelatedServices method ...");
     return $return_data;
 }
开发者ID:mslokhat,项目名称:corebos,代码行数:98,代码来源:Services.php

示例4: ceil

 }
 if ($folder_id == $request_folderid) {
     $start[$folder_id] = 1;
     if (!empty($_REQUEST['start'])) {
         $start[$folder_id] = ListViewSession::getRequestStartPage();
         if ($start[$folder_id] == 'last') {
             if ($num_records > 0) {
                 $start[$folder_id] = ceil($num_records / $max_entries_per_page);
             }
         }
         if (!is_numeric($start[$folder_id])) {
             $start[$folder_id] = 1;
         }
     }
 }
 $navigation_array = VT_getSimpleNavigationValues($start[$folder_id], $max_entries_per_page, $num_records);
 if ($folder_id == $request_folderid) {
     if (!is_array($_SESSION['lvs'][$currentModule]['start'])) {
         $_SESSION['lvs'][$currentModule]['start'] = array();
     }
     $_SESSION['lvs'][$currentModule]['start'][$folder_id] = $start[$folder_id];
 }
 $limit_start_rec = ($start[$folder_id] - 1) * $max_entries_per_page;
 if ($adb->dbType == "pgsql") {
     $list_result = $adb->pquery($query . " OFFSET {$limit_start_rec} LIMIT {$max_entries_per_page}", array());
 } else {
     $list_result = $adb->pquery($query . " LIMIT {$limit_start_rec}, {$max_entries_per_page}", array());
 }
 //navigation end
 $folder_details = array();
 $folderid = $adb->query_result($result, $i, "folderid");
开发者ID:latechdirect,项目名称:vtiger,代码行数:31,代码来源:ListView.php

示例5: vtws_getSearchResults

function vtws_getSearchResults($query, $search_onlyin, $restrictionids, $user)
{
    global $adb, $log, $current_user;
    $res = array();
    // security restrictions
    if (empty($query) or empty($restrictionids) or !is_array($restrictionids)) {
        return serialize($res);
    }
    if (empty($restrictionids['userId']) or empty($restrictionids['accountId']) or empty($restrictionids['contactId'])) {
        return serialize($res);
    }
    list($void, $accountId) = explode('x', $restrictionids['accountId']);
    list($void, $contactId) = explode('x', $restrictionids['contactId']);
    list($void, $userId) = explode('x', $restrictionids['userId']);
    $current_user->retrieveCurrentUserInfoFromFile($userId);
    // if connected user does not have admin privileges > user must be the connected user
    if ($user->is_admin != 'on' and $user->id != $userId) {
        return serialize($res);
    }
    // connected user must have access to account and contact > this will be restricted by the coreBOS system and the rest of the code
    // start work
    require_once 'modules/CustomView/CustomView.php';
    require_once 'include/utils/utils.php';
    // Was the search limited by user for specific modules?
    $search_onlyin = empty($search_onlyin) ? array() : explode(',', $search_onlyin);
    $object_array = getSearchModules($search_onlyin);
    $total_record_count = 0;
    $i = 0;
    $j = 0;
    $moduleRecordCount = array();
    foreach ($object_array as $module => $object_name) {
        $listquery = getListQuery($module);
        $oCustomView = new CustomView($module);
        //Instead of getting current customview id, use cvid of All so that all entities will be found
        $cv_res = $adb->pquery("select cvid from vtiger_customview where viewname='All' and entitytype=?", array($module));
        $viewid = $adb->query_result($cv_res, 0, 'cvid');
        $listquery = $oCustomView->getModifiedCvListQuery($viewid, $listquery, $module);
        if (!empty($accountId) and !empty($contactId)) {
            switch ($module) {
                case 'Products':
                    // FIXME:  add inner join on relations to accounts and contacts
                    break;
                case 'Services':
                    // FIXME:  add inner join on relations to accounts and contacts
                    break;
                case 'Documents':
                    $listquery = str_replace(' WHERE ', " inner join vtiger_senotesrel on vtiger_senotesrel.notesid=vtiger_notes.notesid and (vtiger_senotesrel.crmid={$accountId} or vtiger_senotesrel.crmid={$contactId}) WHERE ", $listquery);
                    break;
            }
        }
        $where = getUnifiedWhere($listquery, $module, $query);
        if ($where != '') {
            $listquery .= ' and (' . $where . ')';
        }
        if (!empty($accountId) and !empty($contactId)) {
            $cond = evvt_PortalModuleRestrictions($module, $accountId, $contactId);
            if ($cond != '') {
                $listquery .= ' and (' . $cond . ')';
            }
        }
        $count_result = $adb->query($listquery);
        $noofrows = $adb->num_rows($count_result);
        $moduleRecordCount[$module]['count'] = $noofrows;
        $navigation_array = VT_getSimpleNavigationValues(1, 100, $noofrows);
        $list_result = $adb->query($listquery);
        $focus = CRMEntity::getInstance($module);
        $listview_entries = getSearchingListViewEntries($focus, $module, $list_result, $navigation_array, "", "", "", "", $oCustomView, "", "", "", true);
        $total_record_count = $total_record_count + $noofrows;
        if (!empty($listview_entries)) {
            foreach ($listview_entries as $key => $element) {
                $res[$j] = $element;
                $j++;
            }
        }
        $i++;
    }
    $result = serialize($res);
    return $result;
}
开发者ID:kikojover,项目名称:corebos,代码行数:79,代码来源:CustomerPortalWS.php

示例6: getTodoList

/**
 * Function to get todos list scheduled between specified dates
 * @param array   $calendar              -  collection of objects and strings
 * @param string  $start_date            -  date string
 * @param string  $end_date              -  date string
 * @param string  $info                  -  string 'listcnt' or empty string. if 'listcnt' means it returns no. of todos and no. of pending todos in array format else it returns todos list in array format
 * return array   $Entries               -  todolists in array format
 */
function getTodoList(&$calendar, $start_date, $end_date, $info = '')
{
    global $log, $app_strings, $theme;
    $Entries = array();
    $category = getParentTab();
    global $adb, $current_user, $mod_strings, $cal_log, $list_max_entries_per_page;
    $cal_log->debug("Entering getTodoList() method...");
    require 'user_privileges/user_privileges_' . $current_user->id . '.php';
    require 'user_privileges/sharing_privileges_' . $current_user->id . '.php';
    $userNameSql = getSqlForNameInDisplayFormat(array('first_name' => 'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');
    $query = "SELECT vtiger_groups.groupname, {$userNameSql} as user_name, vtiger_crmentity.crmid, vtiger_cntactivityrel.contactid,\n\t\t\t\tvtiger_activity.* FROM vtiger_activity\n                INNER JOIN vtiger_crmentity\n\t\t\t\t\tON vtiger_crmentity.crmid = vtiger_activity.activityid\n                LEFT JOIN vtiger_cntactivityrel\n\t\t\t\t\tON vtiger_cntactivityrel.activityid = vtiger_activity.activityid\n\t\t\t\tLEFT JOIN vtiger_groups\n\t\t\t\t\tON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_users\n\t\t\t\t\tON vtiger_users.id = vtiger_crmentity.smownerid";
    $query .= getNonAdminAccessControlQuery('Calendar', $current_user);
    $query .= "WHERE vtiger_crmentity.deleted = 0 AND vtiger_activity.activitytype = 'Task'" . " AND ((CAST(CONCAT(date_start,' ',time_start) AS DATETIME) >= ? AND CAST(CONCAT(date_start,' ',time_start) AS DATETIME) <= ?)\n\t\t\t\t\t\t\tOR\t(CAST(CONCAT(due_date,' ',time_end) AS DATETIME) >= ? AND CAST(CONCAT(due_date,' ',time_end) AS DATETIME) <= ? )\n\t\t\t\t\t\t\tOR\t(CAST(CONCAT(date_start,' ',time_start) AS DATETIME) <= ? AND CAST(CONCAT(due_date,' ',time_end) AS DATETIME) >= ?)\n\t\t\t\t\t\t)";
    $list_query = $query . " AND vtiger_crmentity.smownerid = " . $current_user->id;
    $startDate = new DateTimeField($start_date . ' 00:00');
    $endDate = new DateTimeField($end_date . ' 23:59');
    $params = $info_params = array($startDate->getDBInsertDateTimeValue(), $endDate->getDBInsertDateTimeValue(), $startDate->getDBInsertDateTimeValue(), $endDate->getDBInsertDateTimeValue(), $startDate->getDBInsertDateTimeValue(), $endDate->getDBInsertDateTimeValue());
    if ($info != '') {
        //added to fix #4816
        $groupids = explode(",", fetchUserGroupids($current_user->id));
        if (count($groupids) > 0 && !is_admin($current_user)) {
            $com_q = " AND (vtiger_crmentity.smownerid = ?\n\t\t\t\t\tOR vtiger_groups.groupid in (" . generateQuestionMarks($groupids) . "))";
            array_push($info_params, $current_user->id);
            array_push($info_params, $groupids);
        } elseif (!is_admin($current_user)) {
            $com_q = " AND vtiger_crmentity.smownerid = ?";
            array_push($info_params, $current_user->id);
        }
        //end
        $pending_query = $query . " AND (vtiger_activity.status != 'Completed')" . $com_q;
        $total_q = $query . "" . $com_q;
        $total_res = $adb->pquery($total_q, $info_params);
        $total = $adb->num_rows($total_res);
        $res = $adb->pquery($pending_query, $info_params);
        $pending_rows = $adb->num_rows($res);
        $cal_log->debug("Exiting getTodoList() method...");
        return array('totaltodo' => $total, 'pendingtodo' => $pending_rows);
    }
    $group_cond = '';
    $group_cond .= " ORDER BY vtiger_activity.date_start,vtiger_activity.time_start ASC";
    if (isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
        $start = vtlib_purify($_REQUEST['start']);
    } else {
        $start = 1;
    }
    //T6477 changes
    if (PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true) {
        $count_res = $adb->pquery(mkCountQuery($query), $params);
        $total_rec_count = $adb->query_result($count_res, 0, 'count');
    } else {
        $total_rec_count = null;
    }
    $navigation_array = VT_getSimpleNavigationValues($start, $list_max_entries_per_page, $total_rec_count);
    $start_rec = ($start - 1) * $list_max_entries_per_page;
    $end_rec = $navigation_array['end_val'];
    $list_query = $adb->convert2Sql($query, $params);
    $_SESSION['Calendar_listquery'] = $list_query;
    if ($start_rec < 0) {
        $start_rec = 0;
    }
    //ends
    $query .= $group_cond . " limit {$start_rec},{$list_max_entries_per_page}";
    $result = $adb->pquery($query, $params);
    $rows = $adb->num_rows($result);
    $c = 0;
    if ($start > 1) {
        $c = ($start - 1) * $list_max_entries_per_page;
    }
    for ($i = 0; $i < $rows; $i++) {
        $element = array();
        $contact_name = '';
        $element['no'] = $c + 1;
        $more_link = "";
        $start_time = $adb->query_result($result, $i, "time_start");
        $date_start = $adb->query_result($result, $i, "date_start");
        $due_date = $adb->query_result($result, $i, "due_date");
        $date = new DateTimeField($date_start . ' ' . $start_time);
        $endDate = new DateTimeField($due_date);
        if (!empty($start_time)) {
            $start_time = $date->getDisplayTime();
        }
        $format = $calendar['calendar']->hour_format;
        $value = getaddEventPopupTime($start_time, $start_time, $format);
        $element['starttime'] = $value['starthour'] . ':' . $value['startmin'] . '' . $value['startfmt'];
        $element['startdate'] = $date->getDisplayDate();
        $element['duedate'] = $endDate->getDisplayDate();
        $id = $adb->query_result($result, $i, "activityid");
        $subject = $adb->query_result($result, $i, "subject");
        $more_link = "<a href='index.php?action=DetailView&module=Calendar&record=" . $id . "&activity_mode=Task&viewtype=calendar&parenttab=" . $category . "' class='webMnu'>" . $subject . "</a>";
        $element['tododetail'] = $more_link;
        if (getFieldVisibilityPermission('Calendar', $current_user->id, 'taskstatus') == '0') {
            $taskstatus = $adb->query_result($result, $i, "status");
//.........这里部分代码省略.........
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:101,代码来源:calendarLayout.php

示例7: process


//.........这里部分代码省略.........
                             }
                         }
                         if ($search_module != '' || $search_tag != '') {
                             //This is for Tag search
                             $where = getTagWhere($search_val, $current_user->id);
                             $search_msg = $app_strings['LBL_TAG_SEARCH'];
                             $search_msg .= "<b>" . to_html($search_val) . "</b>";
                         } else {
                             //This is for Global search
                             $where = getUnifiedWhere($listquery, $module, $search_val);
                             $search_msg = $app_strings['LBL_SEARCH_RESULTS_FOR'];
                             $search_msg .= "<b>" . htmlentities($search_val, ENT_QUOTES, $default_charset) . "</b>";
                         }
                         if ($where != '') {
                             $listquery .= ' and (' . $where . ')';
                         }
                         if (!(isset($_REQUEST['ajax']) && $_REQUEST['ajax'] != '')) {
                             $count_result = $adb->query($listquery);
                             $noofrows = $adb->num_rows($count_result);
                         } else {
                             $noofrows = vtlib_purify($_REQUEST['recordCount']);
                         }
                         $moduleRecordCount[$module]['count'] = $noofrows;
                         global $list_max_entries_per_page;
                         if (!empty($_REQUEST['start'])) {
                             $start = $_REQUEST['start'];
                             if ($start == 'last') {
                                 $count_result = $adb->query(mkCountQuery($listquery));
                                 $noofrows = $adb->query_result($count_result, 0, "count");
                                 if ($noofrows > 0) {
                                     $start = ceil($noofrows / $list_max_entries_per_page);
                                 }
                             }
                             if (!is_numeric($start)) {
                                 $start = 1;
                             } elseif ($start < 0) {
                                 $start = 1;
                             }
                             $start = ceil($start);
                         } else {
                             $start = 1;
                         }
                         $navigation_array = VT_getSimpleNavigationValues($start, $list_max_entries_per_page, $noofrows);
                         $limitStartRecord = ($navigation_array['start'] - 1) * $list_max_entries_per_page;
                         if ($adb->dbType == "pgsql") {
                             $listquery = $listquery . " OFFSET {$limitStartRecord} LIMIT {$list_max_entries_per_page}";
                         } else {
                             $listquery = $listquery . " LIMIT {$limitStartRecord}, {$list_max_entries_per_page}";
                         }
                         $list_result = $adb->query($listquery);
                         $listview_entries = $adb->pquery($listquery, array());
                         $entity = "select id from vtiger_ws_entity where ismodule=1 and name =?";
                         $ws_entity = $adb->pquery($entity, array($module));
                         $ws_entity2 = $adb->query_result($ws_entity, 0, 'id');
                         $filde = "select fieldname,entityidfield from vtiger_entityname where modulename =?";
                         $ws_entity1 = $adb->pquery($filde, array($module));
                         $fieldname = $adb->query_result($ws_entity1, 0, 'fieldname');
                         $entityidfield = $adb->query_result($ws_entity1, 0, 'entityidfield');
                         $firstname = explode(',', $fieldname);
                         $noofrows = $adb->num_rows($listview_entries);
                         //for new GUI
                         for ($i = 0; $i < $noofrows; $i++) {
                             $lstcontent[$module][$i]['firstname'] = $adb->query_result($listview_entries, $i, $firstname[0]);
                             $lstcontent[$module][$i]['lastname'] = $adb->query_result($listview_entries, $i, $firstname[1]);
                             if ($module == 'Calendar') {
                                 $eventtask = $adb->query_result($listview_entries, $i, 'activitytype');
                                 if ($acttype != 'Task') {
                                     $ws_entity2 = 18;
                                 } else {
                                     $ws_entity2 = 1;
                                 }
                             }
                             $lstcontent[$module][$i]['id'] = $ws_entity2 . "x" . $adb->query_result($listview_entries, $i, 'crmid');
                         }
                         //get translated module name
                         $modullabel[$module] = $this->cachedModule($module)->label();
                         $i++;
                     }
                 }
             }
             //Added to display the Total record count
         }
         //end search
         $viewer = new Mobile_UI_Viewer();
         $viewer->assign("MOD", $mod_strings);
         $viewer->assign("MODULE", $module);
         $viewer->assign("TAG_SEARCH", $search_tag);
         $viewer->assign("SEARCH_MODULE", vtlib_purify($_REQUEST['search_module']));
         $viewer->assign("SINGLE_MOD", $module);
         $viewer->assign("SEARCH_STRING", htmlentities($search_val, ENT_QUOTES, $default_charset));
         $viewer->assign('_MODULES', $modules);
         $viewer->assign('LISTHEADER', $listview_header);
         $viewer->assign('LISTENTITY', $lstcontent);
         $viewer->assign('MODLABEL', $modullabel);
         $viewer->assign('HEADERCOUNT', count($listview_header));
         $viewer->assign("SEARCH_CRITERIA", "( {$noofrows} )" . $search_msg);
         $response = $viewer->process('generic/GlobalSearch.tpl');
     }
     return $response;
 }
开发者ID:kduqi,项目名称:corebos,代码行数:101,代码来源:globalsearch.php

示例8: process


//.........这里部分代码省略.........
                         $listquery = $oCustomView->getModifiedCvListQuery($viewid, $listquery, $module);
                         if ($module == "Calendar") {
                             if (!isset($oCustomView->list_fields['Close'])) {
                                 $oCustomView->list_fields['Close'] = array('activity' => 'status');
                             }
                             if (!isset($oCustomView->list_fields_name['Close'])) {
                                 $oCustomView->list_fields_name['Close'] = 'status';
                             }
                         }
                         if ($search_module != '' || $search_tag != '') {
                             //This is for Tag search
                             $where = getTagWhere($search_val, $current_user->id);
                             $search_msg = $app_strings['LBL_TAG_SEARCH'];
                             $search_msg .= "<b>" . to_html($search_val) . "</b>";
                         } else {
                             //This is for Global search
                             $where = getUnifiedWhere($listquery, $module, $search_val);
                             $search_msg = $app_strings['LBL_SEARCH_RESULTS_FOR'];
                             $search_msg .= "<b>" . htmlentities($search_val, ENT_QUOTES, $default_charset) . "</b>";
                         }
                         if ($where != '') {
                             $listquery .= ' and (' . $where . ')';
                         }
                         if (!(isset($_REQUEST['ajax']) && $_REQUEST['ajax'] != '')) {
                             $count_result = $adb->query($listquery);
                             $noofrows = $adb->num_rows($count_result);
                         } else {
                             $noofrows = vtlib_purify($_REQUEST['recordCount']);
                         }
                         $moduleRecordCount[$module]['count'] = $noofrows;
                         global $list_max_entries_per_page;
                         if (!empty($_REQUEST['start'])) {
                             $start = $_REQUEST['start'];
                             if ($start == 'last') {
                                 $count_result = $adb->query(mkCountQuery($listquery));
                                 $noofrows = $adb->query_result($count_result, 0, "count");
                                 if ($noofrows > 0) {
                                     $start = ceil($noofrows / $list_max_entries_per_page);
                                 }
                             }
                             if (!is_numeric($start)) {
                                 $start = 1;
                             } elseif ($start < 0) {
                                 $start = 1;
                             }
                             $start = ceil($start);
                         } else {
                             $start = 1;
                         }
                         $navigation_array = VT_getSimpleNavigationValues($start, $list_max_entries_per_page, $noofrows);
                         $limitStartRecord = ($navigation_array['start'] - 1) * $list_max_entries_per_page;
                         if ($adb->dbType == "pgsql") {
                             $listquery = $listquery . " OFFSET {$limitStartRecord} LIMIT {$list_max_entries_per_page}";
                         } else {
                             $listquery = $listquery . " LIMIT {$limitStartRecord}, {$list_max_entries_per_page}";
                         }
                         $list_result = $adb->query($listquery);
                         $listview_entries = $adb->pquery($listquery, array());
                         $entity = "select id from vtiger_ws_entity where ismodule=1 and name =?";
                         $ws_entity = $adb->pquery($entity, array($module));
                         $ws_entity2 = $adb->query_result($ws_entity, 0, 'id');
                         $filde = "select fieldname,entityidfield from vtiger_entityname where modulename =?";
                         $ws_entity1 = $adb->pquery($filde, array($module));
                         $fieldname = $adb->query_result($ws_entity1, 0, 'fieldname');
                         $entityidfield = $adb->query_result($ws_entity1, 0, 'entityidfield');
                         $firstname = explode(',', $fieldname);
                         $noofrows = $adb->num_rows($listview_entries);
                         $lstresult = array();
                         for ($i = 0; $i < $noofrows; $i++) {
                             $lstresult[$i]['firstname'] = $adb->query_result($listview_entries, $i, $firstname[0]);
                             $lstresult[$i]['lastname'] = $adb->query_result($listview_entries, $i, $firstname[1]);
                             $lstresult[$i]['id'] = $ws_entity2 . "x" . $adb->query_result($listview_entries, $i, 'crmid');
                         }
                         //Do not display the Header if there are no entires in listview_entries
                         if (count($listview_entries) > 0) {
                             $display_header = 1;
                         } else {
                             $display_header = 0;
                         }
                         $smarty->assign("LISTHEADER", $listview_header);
                         $smarty->assign("LISTENTITY", $lstresult);
                         $smarty->assign("DISPLAYHEADER", $display_header);
                         $smarty->assign("HEADERCOUNT", count($listview_header));
                         $smarty->assign("searchstring", $query_string);
                         $smarty->assign("SEARCH_CRITERIA", "( {$noofrows} )" . $search_msg);
                         $smarty->display("UnifiedSearchAjax1.tpl");
                         unset($_SESSION['lvs'][$module]);
                         $i++;
                     }
                 }
             }
             //Added to display the Total record count
         }
         //end search
         $viewer = new Mobile_UI_Viewer();
         $viewer->assign('_MODULE', $this->cachedModule($wsResponseResult['module']));
         $viewer->assign('_RECORDS', Mobile_UI_ModuleRecordModel::buildModelsFromResponse($wsResponseResult['records']));
     }
     return $response;
 }
开发者ID:kduqi,项目名称:corebos,代码行数:101,代码来源:globalsearch.php


注:本文中的VT_getSimpleNavigationValues函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。