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


PHP getPricesForProducts函数代码示例

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


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

示例1: updateListPrices

 function updateListPrices()
 {
     global $log, $adb;
     $log->debug("Entering function updateListPrices...");
     $pricebook_currency = $this->column_fields['currency_id'];
     $prod_res = $adb->pquery("select productid from vtiger_pricebookproductrel where pricebookid=? and usedcurrency != ?", array($this->id, $pricebook_currency));
     $numRows = $adb->num_rows($prod_res);
     $prod_ids = array();
     for ($i = 0; $i < $numRows; $i++) {
         $prod_ids[] = $adb->query_result($prod_res, $i, 'productid');
     }
     if (count($prod_ids) > 0) {
         $prod_price_list = getPricesForProducts($pricebook_currency, $prod_ids);
         for ($i = 0; $i < count($prod_ids); $i++) {
             $product_id = $prod_ids[$i];
             $unit_price = $prod_price_list[$product_id];
             $query = "update vtiger_pricebookproductrel set listprice=?, usedcurrency=? where pricebookid=? and productid=?";
             $params = array($unit_price, $pricebook_currency, $this->id, $product_id);
             $adb->pquery($query, $params);
         }
     }
     $log->debug("Exiting function updateListPrices...");
 }
开发者ID:vtiger-jp,项目名称:vtigercrm-5.1.x-ja,代码行数:23,代码来源:PriceBooks.php

示例2: array

    $smarty->assign("ASSOCIATEDPRODUCTS", $associated_prod);
    $smarty->assign("AVAILABLE_PRODUCTS", 'true');
    $smarty->assign("MODE", $focus->mode);
    $result = $adb->pquery('select vendor_id from vtiger_products where productid=?', array($_REQUEST['product_id']));
    if ($result and $adb->num_rows($result) > 0) {
        $_REQUEST['vendor_id'] = $adb->query_result($result, 0, 'vendor_id');
    }
}
if (!empty($_REQUEST['parent_id']) && !empty($_REQUEST['return_module'])) {
    if ($_REQUEST['return_module'] == 'Services') {
        $focus->column_fields['product_id'] = vtlib_purify($_REQUEST['parent_id']);
        $log->debug("Service Id from the request is " . vtlib_purify($_REQUEST['parent_id']));
        $associated_prod = getAssociatedProducts("Services", $focus, $focus->column_fields['product_id']);
        for ($i = 1; $i <= count($associated_prod); $i++) {
            $associated_prod_id = $associated_prod[$i]['hdnProductId' . $i];
            $associated_prod_prices = getPricesForProducts($currencyid, array($associated_prod_id), 'Services');
            $associated_prod[$i]['listPrice' . $i] = $associated_prod_prices[$associated_prod_id];
        }
        $smarty->assign("ASSOCIATEDPRODUCTS", $associated_prod);
        $smarty->assign("AVAILABLE_PRODUCTS", 'true');
    }
}
if (isset($_REQUEST['vendor_id']) && $_REQUEST['vendor_id'] != '' && $_REQUEST['record'] == '') {
    require_once 'modules/Vendors/Vendors.php';
    $vend_focus = new Vendors();
    $vend_focus->retrieve_entity_info($_REQUEST['vendor_id'], "Vendors");
    $focus->column_fields['bill_city'] = $vend_focus->column_fields['city'];
    $focus->column_fields['ship_city'] = $vend_focus->column_fields['city'];
    $focus->column_fields['bill_street'] = $vend_focus->column_fields['street'];
    $focus->column_fields['ship_street'] = $vend_focus->column_fields['street'];
    $focus->column_fields['bill_state'] = $vend_focus->column_fields['state'];
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:31,代码来源:EditView.php

示例3: transferProductCurrency

function transferProductCurrency($old_cur, $new_cur)
{
    global $log, $adb;
    $log->debug("Entering function updateProductCurrency...");
    $prod_res = $adb->pquery("select productid from vtiger_products where currency_id = ?", array($old_cur));
    $numRows = $adb->num_rows($prod_res);
    $prod_ids = array();
    for ($i = 0; $i < $numRows; $i++) {
        $prod_ids[] = $adb->query_result($prod_res, $i, 'productid');
    }
    if (count($prod_ids) > 0) {
        $prod_price_list = getPricesForProducts($new_cur, $prod_ids);
        for ($i = 0; $i < count($prod_ids); $i++) {
            $product_id = $prod_ids[$i];
            $unit_price = $prod_price_list[$product_id];
            $query = "update vtiger_products set currency_id=?, unit_price=? where productid=?";
            $params = array($new_cur, $unit_price, $product_id);
            $adb->pquery($query, $params);
        }
    }
    $log->debug("Exiting function updateProductCurrency...");
}
开发者ID:yunter,项目名称:crm,代码行数:22,代码来源:utils.php

示例4: array

$list_header .= '<td class="lvtCol">' . $mod_strings['LBL_PB_LIST_PRICE'] . '</td>';
$list_header .= '</tr>';
$smarty->assign("LISTHEADER", $list_header);
//if the product is not associated already then we should display that products
$new_prod_array = array();
$unit_price_array = array();
$field_name_array = array();
$entity_id_array = array();
for ($i = 0; $i < $num_rows; $i++) {
    $entity_id = $adb->query_result($list_result, $i, "crmid");
    if (!array_key_exists($entity_id, $prod_array)) {
        $new_prod_array[] = $entity_id;
    }
    $entity_id_array[$entity_id] = $i;
}
$prod_price_list = getPricesForProducts($currency_id, $new_prod_array);
$list_body = '';
for ($i = 0; $i < count($new_prod_array); $i++) {
    $log->info("Products :: Showing the List of products to be added in price book");
    $entity_id = $new_prod_array[$i];
    $list_body .= '<tr class="lvtColData" onmouseover="this.className=\'lvtColDataHover\'" onmouseout="this.className=\'lvtColData\'" bgcolor="white">';
    $unit_price = $prod_price_list[$entity_id];
    $field_name = $entity_id . "_listprice";
    $unit_price_array[] = '"' . CurrencyField::convertToUserFormat($unit_price, null, true) . '"';
    $field_name_array[] = "'" . $field_name . "'";
    $list_body .= '<td><INPUT type=checkbox NAME="selected_id" id="check_' . $entity_id . '" value= ' . $entity_id . ' onClick=\'toggleSelectAll(this.name,"selectall");updateListPriceForField("' . $field_name . '",this)\'></td>';
    $list_body .= '<td>' . $adb->query_result($list_result, $entity_id_array[$entity_id], "productname") . '</td>';
    if (getFieldVisibilityPermission('Products', $current_user->id, 'productcode') == '0') {
        $list_body .= '<td>' . $adb->query_result($list_result, $entity_id_array[$entity_id], "productcode") . '</td>';
    }
    if (getFieldVisibilityPermission('Products', $current_user->id, 'unit_price') == '0') {
开发者ID:hbsman,项目名称:vtigercrm-5.3.0-ja,代码行数:31,代码来源:AddProductsToPriceBook.php

示例5: 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

示例6: getValue


//.........这里部分代码省略.........
                            } else {
                                $value = '<a href="javascript:window.close();" onclick=\'set_return_specific("' . $entity_id . '", "' . nl2br(decode_html($slashes_temp_val)) . '");\'>' . $temp_val . '</a>';
                            }
                        }
                    } elseif ($popuptype == "detailview") {
                        if ($colname == "lastname" && ($module == 'Contacts' || $module == 'Leads')) {
                            $temp_val = getFullNameFromQResult($list_result, $list_result_count, $module);
                        }
                        $slashes_temp_val = popup_from_html($temp_val);
                        $slashes_temp_val = htmlspecialchars($slashes_temp_val, ENT_QUOTES, $default_charset);
                        $focus->record_id = $_REQUEST['recordid'];
                        if ($_REQUEST['return_module'] == "Calendar") {
                            $value = '<a href="javascript:window.close();" id="calendarCont' . $entity_id . '" LANGUAGE=javascript onclick=\'add_data_to_relatedlist_incal("' . $entity_id . '","' . decode_html($slashes_temp_val) . '");\'>' . $temp_val . '</a>';
                        } else {
                            $value = '<a href="javascript:window.close();" onclick=\'add_data_to_relatedlist("' . $entity_id . '","' . $focus->record_id . '","' . $module . '");\'>' . $temp_val . '</a>';
                        }
                    } elseif ($popuptype == "formname_specific") {
                        $slashes_temp_val = popup_from_html($temp_val);
                        $slashes_temp_val = htmlspecialchars($slashes_temp_val, ENT_QUOTES, $default_charset);
                        $value = '<a href="javascript:window.close();" onclick=\'set_return_formname_specific("' . $_REQUEST['form'] . '", "' . $entity_id . '", "' . nl2br(decode_html($slashes_temp_val)) . '");\'>' . $temp_val . '</a>';
                    } elseif ($popuptype == "inventory_prod") {
                        $row_id = $_REQUEST['curr_row'];
                        //To get all the tax types and values and pass it to product details
                        $tax_str = '';
                        $tax_details = getAllTaxes();
                        for ($tax_count = 0; $tax_count < count($tax_details); $tax_count++) {
                            $tax_str .= $tax_details[$tax_count]['taxname'] . '=' . $tax_details[$tax_count]['percentage'] . ',';
                        }
                        $tax_str = trim($tax_str, ',');
                        $rate = $user_info['conv_rate'];
                        if (getFieldVisibilityPermission('Products', $current_user->id, 'unit_price') == '0') {
                            $unitprice = $adb->query_result($list_result, $list_result_count, 'unit_price');
                            if ($_REQUEST['currencyid'] != null) {
                                $prod_prices = getPricesForProducts($_REQUEST['currencyid'], array($entity_id));
                                $unitprice = $prod_prices[$entity_id];
                            }
                        } else {
                            $unit_price = '';
                        }
                        $sub_products = '';
                        $sub_prod = '';
                        $sub_prod_query = $adb->pquery("SELECT vtiger_products.productid,vtiger_products.productname,vtiger_products.qtyinstock,vtiger_crmentity.description from vtiger_products INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid=vtiger_products.productid INNER JOIN vtiger_seproductsrel on vtiger_seproductsrel.crmid=vtiger_products.productid WHERE vtiger_seproductsrel.productid=? and vtiger_seproductsrel.setype='Products'", array($entity_id));
                        for ($i = 0; $i < $adb->num_rows($sub_prod_query); $i++) {
                            //$sub_prod=array();
                            $id = $adb->query_result($sub_prod_query, $i, "productid");
                            $str_sep = '';
                            if ($i > 0) {
                                $str_sep = ":";
                            }
                            $sub_products .= $str_sep . $id;
                            $sub_prod .= $str_sep . " - " . $adb->query_result($sub_prod_query, $i, "productname");
                        }
                        $sub_det = $sub_products . "::" . str_replace(":", "<br>", $sub_prod);
                        $qty_stock = $adb->query_result($list_result, $list_result_count, 'qtyinstock');
                        //fix for T6943
                        $slashes_temp_val = popup_from_html($field_val);
                        $slashes_temp_val = htmlspecialchars($slashes_temp_val, ENT_QUOTES, $default_charset);
                        $description = popup_from_html($adb->query_result($list_result, $list_result_count, 'description'));
                        $slashes_temp_desc = decode_html(htmlspecialchars($description, ENT_QUOTES, $default_charset));
                        $slashes_desc = str_replace(array("\r", "\n"), array('\\r', '\\n'), $slashes_temp_desc);
                        $tmp_arr = array("entityid" => $entity_id, "prodname" => "" . stripslashes(decode_html(nl2br($slashes_temp_val))) . "", "unitprice" => "{$unitprice}", "qtyinstk" => "{$qty_stock}", "taxstring" => "{$tax_str}", "rowid" => "{$row_id}", "desc" => "{$slashes_desc}", "subprod_ids" => "{$sub_det}");
                        require_once 'include/Zend/Json.php';
                        $prod_arr = Zend_Json::encode($tmp_arr);
                        $value = '<a href="javascript:window.close();" id=\'popup_product_' . $entity_id . '\' onclick=\'set_return_inventory("' . $entity_id . '", "' . decode_html(nl2br($slashes_temp_val)) . '", "' . $unitprice . '", "' . $qty_stock . '","' . $tax_str . '","' . $row_id . '","' . $slashes_desc . '","' . $sub_det . '");\' vt_prod_arr=\'' . $prod_arr . '\' >' . $temp_val . '</a>';
                    } elseif ($popuptype == "inventory_prod_po") {
                        $row_id = $_REQUEST['curr_row'];
开发者ID:latechdirect,项目名称:vtiger,代码行数:67,代码来源:ListViewUtils.php

示例7: explode

<?php

/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
 *
 ********************************************************************************/
global $theme, $log;
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$currencyid = $_REQUEST['currencyid'];
$products_list = $_REQUEST['productsList'];
$product_ids = explode("::", $products_list);
$price_list = array();
if (count($product_ids) > 0) {
    $product_prices = getPricesForProducts($currencyid, $product_ids);
}
// To get the Price Values in the same order as the Products
for ($i = 0; $i < count($product_ids); ++$i) {
    $product_id = $product_ids[$i];
    $price_list[] = $product_prices[$product_id];
}
$price_values = implode("::", $price_list);
echo "SUCCESS\$" . $price_values;
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:28,代码来源:InventoryPriceAjax.php

示例8: getPricesForProducts

 /**
  * Function to get prices for specified products with specific currency
  * @param <Integer> $currenctId
  * @param <Array> $productIdsList
  * @return <Array>
  */
 public function getPricesForProducts($currencyId, $productIdsList)
 {
     return getPricesForProducts($currencyId, $productIdsList, $this->getName());
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:10,代码来源:Module.php

示例9: getPriceBookRelatedProducts

/**	Function to display the Products 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 Product entries
 */
function getPriceBookRelatedProducts($query, $focus, $returnset = '')
{
    global $log;
    $log->debug("Entering getPriceBookRelatedProducts(" . $query . "," . get_class($focus) . "," . $returnset . ") method ...");
    global $adb;
    global $app_strings;
    global $mod_strings;
    global $current_language, $current_user;
    $current_module_strings = return_module_language($current_language, 'PriceBook');
    global $list_max_entries_per_page;
    global $urlPrefix;
    global $theme;
    $pricebook_id = vtlib_purify($_REQUEST['record']);
    $theme_path = "themes/" . $theme . "/";
    $image_path = $theme_path . "images/";
    $noofrows = $adb->query_result($adb->query(mkCountQuery($query)), 0, 'count');
    $module = 'PriceBooks';
    $relatedmodule = 'Products';
    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);
        }
    }
    $start = $_SESSION['rlvs'][$module][$relatedmodule]['start'];
    $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
    $start_rec = $navigation_array['start'];
    $end_rec = $navigation_array['end_val'];
    //limiting the query
    if ($start_rec == 0) {
        $limit_start_rec = 0;
    } else {
        $limit_start_rec = $start_rec - 1;
    }
    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[] = $mod_strings['LBL_LIST_PRODUCT_NAME'];
    if (getFieldVisibilityPermission('Products', $current_user->id, 'productcode') == '0') {
        $header[] = $mod_strings['LBL_PRODUCT_CODE'];
    }
    if (getFieldVisibilityPermission('Products', $current_user->id, 'unit_price') == '0') {
        $header[] = $mod_strings['LBL_PRODUCT_UNIT_PRICE'];
    }
    $header[] = $mod_strings['LBL_PB_LIST_PRICE'];
    if (isPermitted("PriceBooks", "EditView", "") == 'yes' || isPermitted("PriceBooks", "Delete", "") == 'yes') {
        $header[] = $mod_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));
            $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, "productname"));
        if (getFieldVisibilityPermission('Products', $current_user->id, 'productcode') == '0') {
            $entries[] = $adb->query_result($list_result, $i, "productcode");
        }
        if (getFieldVisibilityPermission('Products', $current_user->id, 'unit_price') == '0') {
            $entries[] = $unit_price;
        }
        $entries[] = $listprice;
        $action = "";
        if (isPermitted("PriceBooks", "EditView", "") == 'yes') {
            $action .= '<img style="cursor:pointer;" src="' . vtiger_imageurl('editfield.gif', $theme) . '" border="0" onClick="fnvshobj(this,\'editlistprice\'),editProductListPrice(\'' . $entity_id . '\',\'' . $pricebook_id . '\',\'' . $listprice . '\')" alt="' . $app_strings["LBL_EDIT_BUTTON"] . '" title="' . $app_strings["LBL_EDIT_BUTTON"] . '"/>';
        }
        if (isPermitted("PriceBooks", "Delete", "") == 'yes') {
            if ($action != "") {
                $action .= '&nbsp;|&nbsp;';
            }
            $action .= '<img src="' . vtiger_imageurl('delete.gif', $theme) . '" 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;
    }
    if ($numRows > 0) {
        $module_rel = "{$module}&relmodule={$relatedmodule}&record=" . $focus->id;
//.........这里部分代码省略.........
开发者ID:vtiger-jp,项目名称:vtigercrm-5.1.x-ja,代码行数:101,代码来源:RelatedListView.php

示例10: explode

<?php

/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
 *
 ********************************************************************************/
global $theme, $log;
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$currencyid = $_REQUEST['currencyid'];
$products_list = $_REQUEST['productsList'];
$product_ids = explode("::", $products_list);
$price_list = array();
if (count($product_ids) > 0) {
    $prices_for_products = getPricesForProducts($currencyid, $product_ids);
    $prices_for_services = getPricesForProducts($currencyid, $product_ids, 'Services');
}
// To get the Price Values in the same order as the Products
for ($i = 0; $i < count($product_ids); ++$i) {
    $product_id = $product_ids[$i];
    // Pick the price for the product_id from service prices/ product prices based on which array it is set.
    $price_list[] = empty($prices_for_services[$product_id]) ? $prices_for_products[$product_id] : $prices_for_services[$product_id];
}
$price_values = implode("::", $price_list);
echo "SUCCESS\$" . $price_values;
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:30,代码来源:InventoryPriceAjax.php


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