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


PHP CustomView::getCustomViewCombo方法代码示例

本文整理汇总了PHP中CustomView::getCustomViewCombo方法的典型用法代码示例。如果您正苦于以下问题:PHP CustomView::getCustomViewCombo方法的具体用法?PHP CustomView::getCustomViewCombo怎么用?PHP CustomView::getCustomViewCombo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CustomView的用法示例。


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

示例1: list

$sorder = $focus->getSortOrder();
$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];
开发者ID:vtiger-jp,项目名称:vtigercrm-5.1.x-ja,代码行数:31,代码来源:ListView.php

示例2: getUserslist

$smarty->assign('CHECK', $tool_buttons);
$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') {
开发者ID:jmangarret,项目名称:vtigercrm,代码行数:31,代码来源:ListView.php

示例3: getTopQuotes

/**	function used to get the top 5 quotes from the ListView query
 *	@return array $values - array with the title, header and entries like  Array('Title'=>$title,'Header'=>$listview_header,'Entries'=>$listview_entries) where as listview_header and listview_entries are arrays of header and entity values which are returned from function getListViewHeader and getListViewEntries
 */
function getTopQuotes($maxval, $calCnt)
{
    require_once "data/Tracker.php";
    require_once 'modules/Quotes/Quotes.php';
    require_once 'include/logging.php';
    require_once 'include/ListView/ListView.php';
    require_once 'include/utils/utils.php';
    require_once 'modules/CustomView/CustomView.php';
    global $app_strings, $current_language, $current_user;
    $current_module_strings = return_module_language($current_language, 'Quotes');
    global $list_max_entries_per_page, $adb, $theme, $mod_strings;
    $log = LoggerManager::getLogger('quote_list');
    $url_string = '';
    $sorder = '';
    $oCustomView = new CustomView("Quotes");
    $customviewcombo_html = $oCustomView->getCustomViewCombo();
    if (isset($_REQUEST['viewname']) == false || $_REQUEST['viewname'] == '') {
        if ($oCustomView->setdefaultviewid != "") {
            $viewid = $oCustomView->setdefaultviewid;
        } else {
            $viewid = "0";
        }
    }
    $theme_path = "themes/" . $theme . "/";
    $image_path = $theme_path . "images/";
    //Retreive the list from Database
    //<<<<<<<<<customview>>>>>>>>>
    $date_var = date('Y-m-d');
    $currentModule = 'Quotes';
    $viewId = getCvIdOfAll($currentModule);
    $queryGenerator = new QueryGenerator($currentModule, $current_user);
    $queryGenerator->initForCustomViewById($viewId);
    $meta = $queryGenerator->getMeta($currentModule);
    $accessibleFieldNameList = array_keys($meta->getModuleFields());
    $customViewFields = $queryGenerator->getCustomViewFields();
    $fields = $queryGenerator->getFields();
    $newFields = array_diff($fields, $customViewFields);
    $widgetFieldsList = array('subject', 'potential_id', 'account_id', 'total');
    $widgetFieldsList = array_intersect($accessibleFieldNameList, $widgetFieldsList);
    $widgetSelectedFields = array_chunk(array_intersect($customViewFields, $widgetFieldsList), 2);
    //select the first chunk of two fields
    $widgetSelectedFields = $widgetSelectedFields[0];
    if (count($widgetSelectedFields) < 2) {
        $widgetSelectedFields = array_chunk(array_merge($widgetSelectedFields, $accessibleFieldNameList), 2);
        //select the first chunk of two fields
        $widgetSelectedFields = $widgetSelectedFields[0];
    }
    $newFields = array_merge($newFields, $widgetSelectedFields);
    $queryGenerator->setFields($newFields);
    $_REQUEST = getTopQuotesSearch($_REQUEST, array('assigned_user_id' => $current_user->column_fields['user_name'], 'validtill' => $date_var, 'quotestage.Rejected' => $current_module_strings['Rejected'], 'quotestage.Accepted' => $current_module_strings['Accepted']));
    $queryGenerator->addUserSearchConditions($_REQUEST);
    $search_qry = '&query=true' . getSearchURL($_REQUEST);
    $query = $queryGenerator->getQuery();
    //<<<<<<<<customview>>>>>>>>>
    $query .= " LIMIT " . $adb->sql_escape_string($maxval);
    if ($calCnt == 'calculateCnt') {
        $list_result_rows = $adb->query(mkCountQuery($query));
        return $adb->query_result($list_result_rows, 0, 'count');
    }
    $list_result = $adb->query($query);
    //Retreiving the no of rows
    $noofrows = $adb->num_rows($list_result);
    //Retreiving the start value from request
    if (isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
        $start = vtlib_purify($_REQUEST['start']);
    } else {
        $start = 1;
    }
    //Retreive the Navigation array
    $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
    if ($navigation_array['start'] == 1) {
        if ($noofrows != 0) {
            $start_rec = $navigation_array['start'];
        } else {
            $start_rec = 0;
        }
        if ($noofrows > $list_max_entries_per_page) {
            $end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1;
        } else {
            $end_rec = $noofrows;
        }
    } else {
        if ($navigation_array['next'] > $list_max_entries_per_page) {
            $start_rec = $navigation_array['next'] - $list_max_entries_per_page;
            $end_rec = $navigation_array['next'] - 1;
        } else {
            $start_rec = $navigation_array['prev'] + $list_max_entries_per_page;
            $end_rec = $noofrows;
        }
    }
    $focus = new Quotes();
    $title = array('TopOpenQuotes.gif', $current_module_strings['LBL_MY_TOP_QUOTE'], 'home_mytopquote');
    //Retreive the List View Table Header
    $controller = new ListViewController($adb, $current_user, $queryGenerator);
    $controller->setHeaderSorting(false);
    $header = $controller->getListViewHeader($focus, $currentModule, $url_string, $sorder, $order_by, true);
    $entries = $controller->getListViewEntries($focus, $currentModule, $list_result, $navigation_array, true);
//.........这里部分代码省略.........
开发者ID:latechdirect,项目名称:vtiger,代码行数:101,代码来源:ListTopQuotes.php

示例4: getTopInvoice

function getTopInvoice($maxval, $calCnt)
{
    require_once "data/Tracker.php";
    require_once 'modules/Invoice/Invoice.php';
    require_once 'include/logging.php';
    require_once 'include/ListView/ListView.php';
    require_once 'include/utils/utils.php';
    require_once 'modules/CustomView/CustomView.php';
    global $app_strings, $current_language, $current_user, $adb, $list_max_entries_per_page, $theme;
    $current_module_strings = return_module_language($current_language, 'Invoice');
    $log = LoggerManager::getLogger('invoice_list');
    $url_string = '';
    $sorder = '';
    $oCustomView = new CustomView("Invoice");
    $customviewcombo_html = $oCustomView->getCustomViewCombo();
    if (isset($_REQUEST['viewname']) == false || $_REQUEST['viewname'] == '') {
        if ($oCustomView->setdefaultviewid != "") {
            $viewid = $oCustomView->setdefaultviewid;
        } else {
            $viewid = "0";
        }
    }
    $theme_path = "themes/" . $theme . "/";
    $image_path = $theme_path . "images/";
    //Retreive the list from Database
    //<<<<<<<<<customview>>>>>>>>>
    $date_var = date('Y-m-d');
    //Changed for Patch 2 by Don
    $where = ' and vtiger_crmentity.smownerid=' . $current_user->id . ' and  vtiger_invoice.invoicestatus != \'Paid\'';
    $query = getListQuery("Invoice", $where);
    $query .= " ORDER BY total DESC";
    //<<<<<<<<customview>>>>>>>>>
    $query .= " LIMIT " . $adb->sql_escape_string($maxval);
    if ($calCnt == 'calculateCnt') {
        $list_result_rows = $adb->query(mkCountQuery($query));
        return $adb->query_result($list_result_rows, 0, 'count');
    }
    $list_result = $adb->query($query);
    //Retreiving the no of rows
    $noofrows = $adb->num_rows($list_result);
    //Retreiving the start value from request
    if (isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
        $start = vtlib_purify($_REQUEST['start']);
    } else {
        $start = 1;
    }
    //Retreive the Navigation array
    $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
    if ($navigation_array['start'] == 1) {
        if ($noofrows != 0) {
            $start_rec = $navigation_array['start'];
        } else {
            $start_rec = 0;
        }
        if ($noofrows > $list_max_entries_per_page) {
            $end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1;
        } else {
            $end_rec = $noofrows;
        }
    } else {
        if ($navigation_array['next'] > $list_max_entries_per_page) {
            $start_rec = $navigation_array['next'] - $list_max_entries_per_page;
            $end_rec = $navigation_array['next'] - 1;
        } else {
            $start_rec = $navigation_array['prev'] + $list_max_entries_per_page;
            $end_rec = $noofrows;
        }
    }
    $focus = new Invoice();
    $title = array('myTopInvoices.gif', $current_module_strings['LBL_MY_TOP_INVOICE'], 'home_mytopinv');
    //Retreive the List View Table Header
    $listview_header = getListViewHeader($focus, "Invoice", $url_string, $sorder, $order_by, "HomePage", $oCustomView);
    $header = array($listview_header[1], $listview_header[2]);
    $listview_entries = getListViewEntries($focus, "Invoice", $list_result, $navigation_array, "HomePage", "", "EditView", "Delete", $oCustomView);
    foreach ($listview_entries as $crmid => $valuearray) {
        $entries[$crmid] = array($valuearray[1], $valuearray[2]);
    }
    $search_qry = "&query=true&Fields0=vtiger_invoice.invoicestatus&Condition0=isn&Srch_value0=Paid&Fields1=vtiger_crmentity.smownerid&Condition1=is&Srch_value1=" . $current_user->column_fields['user_name'] . "&searchtype=advance&search_cnt=2&matchtype=all";
    $values = array('ModuleName' => 'Invoice', 'Title' => $title, 'Header' => $header, 'Entries' => $entries, 'search_qry' => $search_qry);
    if ($display_empty_home_blocks && $noofrows == 0 || $noofrows > 0) {
        return $values;
    }
}
开发者ID:vtiger-jp,项目名称:vtigercrm-5.1.x-ja,代码行数:83,代码来源:ListTopInvoice.php

示例5: array

 /**
  * Function to get Campaign related Leads
  * @param  integer   $id      - campaignid
  * returns related Leads record in array format
  */
 function get_leads($id, $cur_tab_id, $rel_tab_id, $actions = false)
 {
     global $log, $singlepane_view, $currentModule;
     $log->debug("Entering get_leads(" . $id . ") method ...");
     $this_module = $currentModule;
     $related_module = vtlib_getModuleNameById($rel_tab_id);
     require_once "modules/{$related_module}/{$related_module}.php";
     $other = new $related_module();
     $is_CampaignStatusAllowed = false;
     global $current_user;
     if (getFieldVisibilityPermission('Leads', $current_user->id, 'campaignrelstatus') == '0') {
         $other->list_fields['Status'] = array('vtiger_campaignrelstatus' => 'campaignrelstatus');
         $other->list_fields_name['Status'] = 'campaignrelstatus';
         $other->sortby_fields[] = 'campaignrelstatus';
         $is_CampaignStatusAllowed = getFieldVisibilityPermission('Leads', $current_user->id, 'campaignrelstatus', 'readwrite') == '0' ? true : false;
     }
     vtlib_setup_modulevars($related_module, $other);
     $singular_modname = vtlib_toSingular($related_module);
     $parenttab = getParentTab();
     if ($singlepane_view == 'true') {
         $returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
     } else {
         $returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
     }
     $button = '';
     // Send mail button for selected Leads
     $button .= "<input title='" . getTranslatedString('LBL_SEND_MAIL_BUTTON') . "' class='crmbutton small edit' value='" . getTranslatedString('LBL_SEND_MAIL_BUTTON') . "' type='button' name='button' onclick='rel_eMail(\"{$this_module}\",this,\"{$related_module}\")'>";
     $button .= '&nbsp;&nbsp;&nbsp;&nbsp';
     /* To get Leads CustomView -START */
     require_once 'modules/CustomView/CustomView.php';
     $lhtml = "<select id='" . $related_module . "_cv_list' class='small'><option value='None'>-- " . getTranslatedString('Select One') . " --</option>";
     $oCustomView = new CustomView($related_module);
     $viewid = $oCustomView->getViewId($related_module);
     $customviewcombo_html = $oCustomView->getCustomViewCombo($viewid, false);
     $lhtml .= $customviewcombo_html;
     $lhtml .= "</select>";
     /* To get Leads CustomView -END */
     $button .= $lhtml . "<input title='" . getTranslatedString('LBL_LOAD_LIST', $this_module) . "' class='crmbutton small edit' value='" . getTranslatedString('LBL_LOAD_LIST', $this_module) . "' type='button' name='button' onclick='loadCvList(\"{$related_module}\",\"{$id}\")'>";
     $button .= '&nbsp;&nbsp;';
     $button .= "<input title='" . getTranslatedString('LBL_EMPTY_LIST', $this_module) . "' class='crmbutton small edit' value='" . getTranslatedString('LBL_EMPTY_LIST', $this_module) . "' type='button' name='button' onclick='emptyCvList(\"{$related_module}\",\"{$id}\")'>";
     $button .= '&nbsp;&nbsp;&nbsp;&nbsp;';
     if ($actions) {
         if (is_string($actions)) {
             $actions = explode(',', strtoupper($actions));
         }
         if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') {
             $button .= "<input title='" . getTranslatedString('LBL_SELECT') . " " . getTranslatedString($related_module) . "' class='crmbutton small edit' type='button' onclick=\"return window.open('index.php?module={$related_module}&return_module={$currentModule}&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid={$id}&parenttab={$parenttab}','test','width=640,height=602,resizable=0,scrollbars=0');\" value='" . getTranslatedString('LBL_SELECT') . " " . getTranslatedString($related_module) . "'>&nbsp;";
         }
         if (in_array('ADD', $actions) && isPermitted($related_module, 1, '') == 'yes') {
             $button .= "<input type='hidden' name='createmode' id='createmode' value='link' />" . "<input title='" . getTranslatedString('LBL_ADD_NEW') . " " . getTranslatedString($singular_modname) . "' class='crmbutton small create'" . " onclick='this.form.action.value=\"EditView\";this.form.module.value=\"{$related_module}\"' type='submit' name='button'" . " value='" . getTranslatedString('LBL_ADD_NEW') . " " . getTranslatedString($singular_modname) . "'>&nbsp;";
         }
     }
     $userNameSql = getSqlForNameInDisplayFormat(array('first_name' => 'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');
     $query = "SELECT vtiger_leaddetails.*, vtiger_crmentity.crmid,vtiger_leadaddress.phone,vtiger_leadsubdetails.website,\n\t\t\t\tCASE when (vtiger_users.user_name not like '') then {$userNameSql} else vtiger_groups.groupname end as user_name,\n\t\t\t\tvtiger_crmentity.smownerid, vtiger_campaignrelstatus.*\n\t\t\t\tFROM vtiger_leaddetails\n\t\t\t\tINNER JOIN vtiger_campaignleadrel ON vtiger_campaignleadrel.leadid=vtiger_leaddetails.leadid\n\t\t\t\tINNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_leaddetails.leadid\n\t\t\t\tINNER JOIN vtiger_leadsubdetails  ON vtiger_leadsubdetails.leadsubscriptionid = vtiger_leaddetails.leadid\n\t\t\t\tINNER JOIN vtiger_leadaddress ON vtiger_leadaddress.leadaddressid = vtiger_leadsubdetails.leadsubscriptionid\n\t\t\t\tLEFT JOIN vtiger_users ON vtiger_crmentity.smownerid = vtiger_users.id\n\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid=vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_campaignrelstatus ON vtiger_campaignrelstatus.campaignrelstatusid = vtiger_campaignleadrel.campaignrelstatusid\n\t\t\t\tWHERE vtiger_crmentity.deleted=0 AND vtiger_campaignleadrel.campaignid = " . $id;
     $return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
     if ($return_value == null) {
         $return_value = array();
     } else {
         if ($is_CampaignStatusAllowed) {
             $statusPos = count($return_value['header']) - 2;
             // Last column is for Actions, exclude that. Also the index starts from 0, so reduce one more count.
             $return_value = $this->add_status_popup($return_value, $statusPos, 'Leads');
         }
     }
     $return_value['CUSTOM_BUTTON'] = $button;
     $log->debug("Exiting get_leads method ...");
     return $return_value;
 }
开发者ID:kikojover,项目名称:corebos,代码行数:73,代码来源:Campaigns.php

示例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());
     }
 }
开发者ID:kduqi,项目名称:corebos,代码行数:62,代码来源:SearchFilter.php

示例7: 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;
 }
开发者ID:kduqi,项目名称:corebos,代码行数:87,代码来源:ListModuleRecords.php

示例8: getParentTab

 /**
  * Function to get Campaign related Leads
  * @param  integer   $id      - campaignid
  * returns related Leads record in array format
  */
 function get_leads($id, $cur_tab_id, $rel_tab_id, $actions = false)
 {
     global $log, $singlepane_view, $currentModule;
     $log->debug("Entering get_leads(" . $id . ") method ...");
     $this_module = $currentModule;
     $related_module = vtlib_getModuleNameById($rel_tab_id);
     require_once "modules/{$related_module}/{$related_module}.php";
     $other = new $related_module();
     vtlib_setup_modulevars($related_module, $other);
     $singular_modname = vtlib_toSingular($related_module);
     $parenttab = getParentTab();
     if ($singlepane_view == 'true') {
         $returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
     } else {
         $returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
     }
     $button = '';
     // Send mail button for selected Leads
     $button .= "<input title='" . getTranslatedString('LBL_SEND_MAIL_BUTTON') . "' class='crmbutton small edit' value='" . getTranslatedString('LBL_SEND_MAIL_BUTTON') . "' type='button' name='button' onclick='rel_eMail(\"{$this_module}\",this,\"{$related_module}\")'>";
     $button .= '&nbsp;&nbsp;&nbsp;&nbsp';
     /* To get Leads CustomView -START */
     require_once 'modules/CustomView/CustomView.php';
     $lhtml = "<select id='lead_cv_list' class='small'><option value='None'>-- " . getTranslatedString('Select One') . " --</option>";
     $oCustomView = new CustomView($related_module);
     $viewid = $oCustomView->getViewId($related_module);
     $customviewcombo_html = $oCustomView->getCustomViewCombo($viewid, false);
     $lhtml .= $customviewcombo_html;
     $lhtml .= "</select>";
     /* To get Leads CustomView -END */
     $button .= $lhtml . "<input title='" . getTranslatedString('LBL_LOAD_LIST', $this_module) . "' class='crmbutton small edit' value='" . getTranslatedString('LBL_LOAD_LIST', $this_module) . "' type='button' name='button' onclick='loadCvList(\"{$related_module}\",\"{$id}\")'>";
     $button .= '&nbsp;&nbsp;&nbsp;&nbsp';
     if ($actions) {
         if (is_string($actions)) {
             $actions = explode(',', strtoupper($actions));
         }
         if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') {
             $button .= "<input title='" . getTranslatedString('LBL_SELECT') . " " . getTranslatedString($related_module) . "' class='crmbutton small edit' type='button' onclick=\"return window.open('index.php?module={$related_module}&return_module={$currentModule}&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid={$id}&parenttab={$parenttab}','test','width=640,height=602,resizable=0,scrollbars=0');\" value='" . getTranslatedString('LBL_SELECT') . " " . getTranslatedString($related_module) . "'>&nbsp;";
         }
         if (in_array('ADD', $actions) && isPermitted($related_module, 1, '') == 'yes') {
             $button .= "<input title='" . getTranslatedString('LBL_ADD_NEW') . " " . getTranslatedString($singular_modname) . "' class='crmbutton small create'" . " onclick='this.form.action.value=\"EditView\";this.form.module.value=\"{$related_module}\"' type='submit' name='button'" . " value='" . getTranslatedString('LBL_ADD_NEW') . " " . getTranslatedString($singular_modname) . "'>&nbsp;";
         }
     }
     $query = "SELECT vtiger_leaddetails.*, vtiger_crmentity.crmid,vtiger_leadaddress.phone,vtiger_leadsubdetails.website, \n\t\t\t\t\tCASE when (vtiger_users.user_name not like '') then vtiger_users.user_name else vtiger_groups.groupname end as user_name, \n\t\t\t\t\tvtiger_crmentity.smownerid FROM vtiger_leaddetails      \n\t\t\t\t\tINNER JOIN vtiger_campaignleadrel ON vtiger_campaignleadrel.leadid=vtiger_leaddetails.leadid\n\t\t\t\t\tINNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_leaddetails.leadid\n\t\t\t\t\tINNER JOIN vtiger_leadsubdetails  ON vtiger_leadsubdetails.leadsubscriptionid = vtiger_leaddetails.leadid \t\t\t\n\t\t\t\t\tINNER JOIN vtiger_leadaddress ON vtiger_leadaddress.leadaddressid = vtiger_leadsubdetails.leadsubscriptionid\n\t\t\t\t\tLEFT JOIN vtiger_users ON vtiger_crmentity.smownerid = vtiger_users.id\n\t\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid=vtiger_crmentity.smownerid\n\t\t\t\t\tWHERE vtiger_crmentity.deleted=0 AND vtiger_campaignleadrel.campaignid = " . $id;
     $return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
     if ($return_value == null) {
         $return_value = array();
     }
     $return_value['CUSTOM_BUTTON'] = $button;
     $log->debug("Exiting get_leads method ...");
     return $return_value;
 }
开发者ID:vtiger-jp,项目名称:vtigercrm-5.1.x-ja,代码行数:56,代码来源:Campaigns.php


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