本文整理汇总了PHP中CustomView::getCustomViewByCvid方法的典型用法代码示例。如果您正苦于以下问题:PHP CustomView::getCustomViewByCvid方法的具体用法?PHP CustomView::getCustomViewByCvid怎么用?PHP CustomView::getCustomViewByCvid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CustomView
的用法示例。
在下文中一共展示了CustomView::getCustomViewByCvid方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getModuleFilterDetails
protected function getModuleFilterDetails($filterid)
{
global $adb;
$result = $adb->pquery("SELECT * FROM vtiger_customview WHERE cvid=?", array($filterid));
if ($result && $adb->num_rows($result)) {
$resultrow = $adb->fetch_array($result);
$module = $resultrow['entitytype'];
$view = new CustomView($module);
$viewid = $resultrow['cvid'];
$view->getCustomViewByCvid($viewid);
$viewQuery = $view->getModifiedCvListQuery($viewid, getListQuery($module), $module);
$countResult = $adb->pquery(Vtiger_Functions::mkCountQuery($viewQuery), array());
$count = 0;
if ($countResult && $adb->num_rows($countResult)) {
$count = $adb->query_result($countResult, 0, 'count');
}
$filter = $this->prepareFilterDetailUsingResultRow($resultrow);
$filter['userName'] = getUserName($resultrow['userid']);
$filter['count'] = $count;
return $filter;
}
}
示例2: list
$order_by = $focus->getOrderBy();
$_SESSION['SALESORDER_ORDER_BY'] = $order_by;
$_SESSION['SALESORDER_SORT_ORDER'] = $sorder;
//<<<<<<<<<<<<<<<<<<< sorting - stored in session >>>>>>>>>>>>>>>>>>>>
if (isset($_REQUEST['query']) && $_REQUEST['query'] != '' && $_REQUEST['query'] == 'true') {
list($where, $ustring) = split("#@@#", getWhereCondition($currentModule));
// we have a query
$url_string .= "&query=true" . $ustring;
$log->info("Here is the where clause for the list view: {$where}");
$smarty->assign("SEARCH_URL", $url_string);
}
//<<<<cutomview>>>>>>>
$oCustomView = new CustomView("SalesOrder");
$viewid = $oCustomView->getViewId($currentModule);
$customviewcombo_html = $oCustomView->getCustomViewCombo($viewid);
$viewnamedesc = $oCustomView->getCustomViewByCvid($viewid);
//Added to handle approving or denying status-public by the admin in CustomView
$statusdetails = $oCustomView->isPermittedChangeStatus($viewnamedesc['status']);
$smarty->assign("CUSTOMVIEW_PERMISSION", $statusdetails);
//To check if a user is able to edit/delete a customview
$edit_permit = $oCustomView->isPermittedCustomView($viewid, 'EditView', $currentModule);
$delete_permit = $oCustomView->isPermittedCustomView($viewid, 'Delete', $currentModule);
$smarty->assign("CV_EDIT_PERMIT", $edit_permit);
$smarty->assign("CV_DELETE_PERMIT", $delete_permit);
//<<<<<customview>>>>>
$smarty->assign("CHANGE_OWNER", getUserslist());
$smarty->assign("CHANGE_GROUP_OWNER", getGroupslist());
// Buttons and View options
if (isPermitted('SalesOrder', 'Delete', '') == 'yes') {
$other_text['del'] = $app_strings[LBL_MASS_DELETE];
}
示例3: count
$smarty->assign("STDCOLUMNSCOUNT", count($stdfiltercolhtml));
$smarty->assign("STDFILTERCRITERIA", $stdfilterhtml);
$smarty->assign("STDFILTER_JAVASCRIPT", $stdfilterjs);
$advfilterhtml = getAdvCriteriaHTML();
$modulecolumnshtml = getByModule_ColumnsHTML($cv_module, $modulecollist);
$smarty->assign("FOPTION", $advfilterhtml);
$smarty->assign("COLUMNS_BLOCK", $modulecolumnshtml);
$smarty->assign("MANDATORYCHECK", implode(",", array_unique($oCustomView->mandatoryvalues)));
$smarty->assign("SHOWVALUES", implode(",", $oCustomView->showvalues));
$data_type[] = $oCustomView->data_type;
$smarty->assign("DATATYPE", $data_type);
} else {
$oCustomView = new CustomView($cv_module);
$now_action = vtlib_purify($_REQUEST['action']);
if ($oCustomView->isPermittedCustomView($recordid, $now_action, $oCustomView->customviewmodule) == 'yes') {
$customviewdtls = $oCustomView->getCustomViewByCvid($recordid);
$log->info('CustomView :: Successfully got ViewDetails for the Viewid' . $recordid);
$modulecollist = $oCustomView->getModuleColumnsList($cv_module);
$selectedcolumnslist = $oCustomView->getColumnsListByCvid($recordid);
$log->info('CustomView :: Successfully got ColumnsList for the Viewid' . $recordid);
$smarty->assign("VIEWNAME", $customviewdtls["viewname"]);
if ($customviewdtls["setdefault"] == 1) {
$smarty->assign("CHECKED", "checked");
}
if ($customviewdtls["setmetrics"] == 1) {
$smarty->assign("MCHECKED", "checked");
}
$status = $customviewdtls["status"];
$smarty->assign("STATUS", $status);
for ($i = 1; $i < 10; $i++) {
$choosecolslist = getByModule_ColumnsList($cv_module, $modulecollist, $selectedcolumnslist[$i - 1]);
示例4: getUserslist
$smarty->assign('THEME', $theme);
$smarty->assign('IMAGE_PATH', "themes/{$theme}/images/");
$smarty->assign('CHANGE_OWNER', getUserslist());
$smarty->assign('CHANGE_GROUP_OWNER', getGroupslist());
// Enabling Module Search
$url_string = '';
if ($_REQUEST['query'] == 'true') {
list($where, $ustring) = split('#@@#', getWhereCondition($currentModule));
$url_string .= "&query=true{$ustring}";
$smarty->assign('SEARCH_URL', $url_string);
}
// Custom View
$customView = new CustomView($currentModule);
$viewid = $customView->getViewId($currentModule);
$customview_html = $customView->getCustomViewCombo($viewid);
$viewinfo = $customView->getCustomViewByCvid($viewid);
// Feature available from 5.1
if (method_exists($customView, 'isPermittedChangeStatus')) {
// Approving or Denying status-public by the admin in CustomView
$statusdetails = $customView->isPermittedChangeStatus($viewinfo['status']);
// To check if a user is able to edit/delete a CustomView
$edit_permit = $customView->isPermittedCustomView($viewid, 'EditView', $currentModule);
$delete_permit = $customView->isPermittedCustomView($viewid, 'Delete', $currentModule);
$smarty->assign("CUSTOMVIEW_PERMISSION", $statusdetails);
$smarty->assign("CV_EDIT_PERMIT", $edit_permit);
$smarty->assign("CV_DELETE_PERMIT", $delete_permit);
}
// END
$smarty->assign("VIEWID", $viewid);
if ($viewinfo['viewname'] == 'All') {
$smarty->assign('ALL', 'All');
示例5: ListViewReport
$sorder = $focus->getSortOrder();
$order_by = $focus->getOrderBy();
$collectcolumnhtml = true;
$picklistreporthtml = true;
$listviewreport = new ListViewReport($currentModule);
$allcustomreports = $listviewreport->getAllModReportInf();
$allmodulepicklists = $listviewreport->getModulePicklists();
if ($currentModule == 'Products' || $currentModule == 'Faq' || $currentModule == "PriceBooks") {
if (count($allmodulepicklists) + count($allcustomreports) == 0) {
$picklistreporthtml = false;
}
}
//<<<<cutomview>>>>>>>
$oCustomView = new CustomView($currentModule);
$viewid = $oCustomView->getViewId($currentModule);
$viewnamedesc = $oCustomView->getCustomViewByCvid($viewid);
if (isset($_REQUEST['query']) && $_REQUEST['query'] == 'true') {
list($where, $ustring) = explode("#@@#", getWhereCondition($currentModule));
} elseif (isset($_SESSION['LiveViewSearch'][$currentModule])) {
// if($viewid==$_SESSION['LiveViewSearch'][$currentModule][0])
// {
$where = $_SESSION['LiveViewSearch'][$currentModule][1];
// }
}
if ($viewid != "0") {
$customviewdtls = $oCustomView->getCustomViewByCvid($viewid);
if (empty($customviewdtls["collectcolumn"])) {
$collectcolumnhtml = false;
} else {
$collectcolumn = $customviewdtls["collectcolumn"];
$list = explode(":", $collectcolumn);
示例6: execute
function execute($fieldnames, $pagingModel = false)
{
if ($this->moduleName == 'Project') {
// Custom View
include_once 'modules/CustomView/CustomView.php';
include_once 'include/QueryGenerator/QueryGenerator.php';
include_once 'modules/Mobile/api/ws/Controller.php';
include_once 'include/DatabaseUtil.php';
$customView = new CustomView($this->moduleName);
$viewid = $customView->getViewId($this->moduleName);
$customview_html = $customView->getCustomViewCombo($viewid);
$viewinfo = $customView->getCustomViewByCvid($viewid);
global $current_user;
// Required for vtws_update API
$userid = $_SESSION['_authenticated_user_id'];
$current_user = CRMEntity::getInstance('Users');
$current_user = $current_user->retrieveCurrentUserInfoFromFile($userid);
$queryGenerator = new QueryGenerator($this->moduleName, $current_user);
if ($viewid != "0") {
$queryGenerator->initForCustomViewById($viewid);
} else {
$queryGenerator->initForDefaultCustomView();
}
$selectClause = sprintf("SELECT %s", implode(',', $fieldnames) . ",vtiger_project.projectid");
$fromClause = $queryGenerator->getFromClause();
$whereClause = $queryGenerator->getWhereClause();
$orderClause = "";
$groupClause = "";
$limitClause = $pagingModel ? " LIMIT {$pagingModel->currentCount()},{$pagingModel->limit()}" : "";
if (!empty($this->criterias)) {
$_sortCriteria = $this->criterias['_sort'];
if (!empty($_sortCriteria)) {
$orderClause = $_sortCriteria;
}
}
$query = sprintf("%s %s %s %s %s %s;", $selectClause, $fromClause, $whereClause, $orderClause, $groupClause, $limitClause);
global $adb;
$result = $adb->pquery($query, array());
$noofrows = $adb->num_rows($result);
$lstresult = array();
for ($i = 0; $i < $noofrows; $i++) {
$lstresult[$i]['firstname'] = $adb->query_result($result, $i, 'projectname');
$lstresult[$i]['id'] = "31x" . $adb->query_result($result, $i, 'projectid');
}
return $lstresult;
} else {
$selectClause = sprintf("SELECT %s", implode(',', $fieldnames));
$fromClause = sprintf("FROM %s", $this->moduleName);
$whereClause = "";
$orderClause = "";
$groupClause = "";
$limitClause = $pagingModel ? " LIMIT {$pagingModel->currentCount()},{$pagingModel->limit()}" : "";
if (!empty($this->criterias)) {
$_sortCriteria = $this->criterias['_sort'];
if (!empty($_sortCriteria)) {
$orderClause = $_sortCriteria;
}
}
$query = sprintf("%s %s %s %s %s %s;", $selectClause, $fromClause, $whereClause, $orderClause, $groupClause, $limitClause);
return vtws_query($query, $this->getUser());
}
}
示例7: CustomView
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
require_once 'include/logging.php';
require_once 'include/database/PearDatabase.php';
require_once 'modules/CustomView/CustomView.php';
global $adb;
global $current_user;
$cvid = $_REQUEST["record"];
$module = $_REQUEST["dmodule"];
$smodule = $REQUEST["smodule"];
$parenttab = $_REQUEST["parenttab"];
$oCustomView = new CustomView();
$customviewdtls = $oCustomView->getCustomViewByCvid($cvid);
if (!is_admin($current_user)) {
if ($customviewdtls['smownerid'] == 0) {
echo "<script>alert('公共视图不能删除!');history.go(-1);</script>";
die;
}
}
if (isset($cvid) && $cvid != '') {
$deletesql = "delete from ec_customview where cvid =" . $cvid;
$deleteresult = $adb->query($deletesql);
$_SESSION['lvs'][$module]["viewname"] = '';
}
if (isset($smodule) && $smodule != '') {
$smodule_url = "&smodule=" . $smodule;
}
clear_cache_files();
示例8: process
/** END */
function process(Mobile_API_Request $request)
{
global $config_settings, $app_strings, $mod_strings;
$wsResponse = parent::process($request);
if (isset($_REQUEST['delaction'])) {
//delete?
if ($_REQUEST['delaction'] == 'deleteEntity') {
$recordid = vtlib_purify($_REQUEST['record']);
if (trim($recordid) != '') {
//delete record
$delResponse = Mobile_WS_DeleteRecords::process($request);
}
}
}
$current_user = $this->getActiveUser();
$current_language = $this->sessionGet('language');
include_once dirname(__FILE__) . '/../language/' . $current_language . '.lang.php';
$response = false;
if ($wsResponse->hasError()) {
$response = $wsResponse;
} else {
$wsResponseResult = $wsResponse->getResult();
$tabid = getTabid($wsResponseResult['module']);
$CATEGORY = getParentTabFromModule($wsResponseResult['module']);
if ($wsResponseResult['module'] != 'Calendar' && $wsResponseResult['module'] != 'Events') {
$customView = new CustomView($wsResponseResult['module']);
$id1 = $_REQUEST['viewName'];
$id2 = $_REQUEST['view'];
if ($id2 !== "" && $id2 == '1') {
$viewid = $id1;
} else {
$viewid = $customView->getViewId($wsResponseResult['module']);
}
$customview_html = $customView->getCustomViewCombo($viewid);
$customview_html = str_replace("></option>", ">" . $mod_strings['LBL_FILTER'] . "</option>", $customview_html);
$viewinfo = $customView->getCustomViewByCvid($viewid);
$focus = new $wsResponseResult['module']();
$focus->initSortbyField($wsResponseResult['module']);
$order_by = $focus->getOrderBy();
$url_string = '';
} else {
$calendarview_selected = $_REQUEST['viewName'];
//week as default value
if ($calendarview_selected == "") {
if (isset($config_settings['calendarview']) and $config_settings['calendarview'] != '') {
//get the default view from config
$calendarview_selected = $config_settings['calendarview'];
} else {
$calendarview_selected = 'week';
}
}
$CATEGORY = getParentTabFromModule($wsResponseResult['module']);
$customView = new CustomView($wsResponseResult['module']);
$viewid = $customView->getViewId($wsResponseResult['module']);
//special view for Calendar, custom filters are not considered
$customview_arr = array('today' => 'LBL_TODAY', 'week' => 'LBL_WEEK', 'month' => 'LBL_MONTH', 'year' => 'LBL_YEAR');
$customview_html = '';
foreach ($customview_arr as $key => $value) {
if ($key != $calendarview_selected) {
$customview_html .= "<option value=" . $key . ">" . $mod_strings[$value] . "</option>";
} else {
$customview_html .= "<option value=" . $key . " selected='selected'>" . $mod_strings[$value] . "</option>";
}
}
}
$viewer = new Mobile_UI_Viewer();
if ($viewinfo['viewname'] == 'All' || $viewinfo['viewname'] == '') {
$viewer->assign('_ALL', 'ALL');
}
global $current_user, $adb, $list_max_entries_per_page;
$current_user = $this->getActiveUser();
$viewer->assign('_MODULE', $this->cachedModule($wsResponseResult['module']));
$viewer->assign('_MODE', $request->get('mode'));
$viewer->assign('_CATEGORY', $CATEGORY);
$viewer->assign('_CUSTOMVIEW_OPTION', $customview_html);
$viewer->assign('_PAGER', $this->getPagingModel($request));
$viewer->assign('_SEARCH', $request->get('search'));
$viewer->assign('MOD', $mod_strings);
$viewer->assign('LANGUAGE', $current_language);
$viewer->assign('_VIEW', $viewid);
$viewer->assign('_VIEWNAME', $calendarview_selected);
$viewer->assign('CALENDARSELECT', $config_settings['compactcalendar']);
$response = $viewer->process('generic/List.tpl');
}
return $response;
}