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


PHP Products::retrieve方法代码示例

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


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

示例1: ProductLog

 function product_log($id, $status, $bean, $status_action, $old_status)
 {
     $productLog = new ProductLog();
     $product = new Products();
     $product->retrieve($id);
     if ($old_status != $status || empty($product->date_modified)) {
         $productLog->product_name = $product->name;
         $productLog->product_id = $product->id;
         $productLog->from_status = $old_status;
         $product->status = $status;
         $product->save($GLOBALS['check_notify']);
         $productLog->to_status = $product->status;
         var_dump($productLog->object_name);
         var_dump($productLog->object_id);
         $productLog->bean_name = $bean->object_name;
         $productLog->bean_id = $bean->id;
         var_dump($productLog->object_name);
         var_dump($productLog->object_id);
         var_dump($bean->object_name);
         var_dump($bean->object_id);
         $productLog->action = $status_action;
         if (!empty($_REQUEST['status_action'])) {
             $productLog->action = $_REQUEST['status_action'];
         }
         $productLog->save($GLOBALS['check_notify']);
     }
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:27,代码来源:ProductStatus.php

示例2: Products

$xtpl->assign('account_name', $focus->account_name);
$xtpl->assign('account_id', $focus->account_id);
$xtpl->assign('contact_name', $focus->contact_name);
$xtpl->assign('contact_id', $focus->contact_id);
$xtpl->assign('assigned_user_name', $focus->assigned_user_name);
$xtpl->assign('description', nl2br(url2html($focus->description)));
$xtpl->assign('vision', $focus->vision);
$xtpl->assign('period', $app_list_strings['clientorders_period_options'][$focus->period]);
$xtpl->assign('number', $focus->number);
$xtpl->assign('category', $app_list_strings['clientorders_category_options'][$focus->category]);
$xtpl->assign('note', $focus->note);
$xtpl->assign('quantity', $focus->quantity);
$xtpl->assign('status', $app_list_strings['product_status'][$focus->get_status($focus->id)]);
if (!is_null($focus->product_id) && !empty($focus->product_id)) {
    $product = new Products();
    $product->retrieve($focus->product_id);
    $xtpl->assign("pnum", $product->pnum);
    $xtpl->assign("product_name", $product->name);
    $xtpl->assign("product_id", $product->id);
    $xtpl->assign("account_name", $product->account_name);
    $xtpl->assign("account_id", $product->account_id);
    $xtpl->assign("contact_name", $product->contact_name);
    $xtpl->assign("contact_id", $product->contact_id);
}
$clientrequest = $focus->get_client_request($focus->clientrequest_id);
if ($clientrequest != null) {
    $xtpl->assign("clientrequest_id", $clientrequest->id);
    $xtpl->assign("clientrequest_name", $clientrequest->name);
    $xtpl->assign('clientrequest_number', $clientrequest->number);
    $xtpl->assign('clientrequest_assigned_user_name', $clientrequest->assigned_user_name);
    $xtpl->assign('clientrequest_due_date', $clientrequest->due_date);
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:DetailView.php

示例3: ProductEstimate

 * The Original Code is: SugarCRM Open Source
 * The Initial Developer of the Original Code is SugarCRM, Inc.
 * Portions created by SugarCRM are Copyright (C) 2004-2006 SugarCRM, Inc.;
 * All Rights Reserved.
 * Contributor(s): ______________________________________.
 */
require_once 'modules/ProductEstimate/ProductEstimate.php';
require_once 'modules/Products/Products.php';
require_once 'include/formbase.php';
$sugarbean = new ProductEstimate();
$sugarbean = populateFromPost('', $sugarbean);
$sugarbean->status = "uptodate";
if (isset($_REQUEST['email_id'])) {
    $sugarbean->email_id = $_REQUEST['email_id'];
}
if (!$sugarbean->ACLAccess('Save')) {
    ACLController::displayNoAccess(true);
    sugar_cleanup(true);
}
$sugarbean->save($GLOBALS['check_notify']);
$return_id = $sugarbean->id;
$product = new Products();
$product->retrieve($sugarbean->product_id);
//// Status Update
if (isset($_REQUEST['stat_action']) && !empty($_REQUEST['stat_action']) && !is_null($_REQUEST['stat_action'])) {
    $product->status_update('', $product->id, $_REQUEST['stat_action'], '');
} else {
    $product->status_update('', $product->id, '', '');
}
/////////////////
handleRedirect($return_id, 'ProductEstimate');
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:Save.php

示例4: handleSave

 function handleSave($prefix, $redirect = true, $useRequired = false)
 {
     require_once 'modules/Quotes/Quote.php';
     require_once 'modules/QuoteLines/QuoteLine.php';
     require_once 'log4php/LoggerManager.php';
     require_once 'include/formbase.php';
     require_once 'include/TimeDate.php';
     $timedate = new TimeDate();
     $focus = new Quote();
     if ($useRequired && !checkRequired($prefix, array_keys($focus->required_fields))) {
         return null;
     }
     $focus = populateFromPost($prefix, $focus);
     if (!ACLController::checkAccess($focus->module_dir, 'edit', $focus->isOwner($current_user->id))) {
         ACLController::displayNoAccess(true);
     }
     ///// Retrive old status ///////
     $old_bean = new Products();
     $old_bean->retrieve($focus->product_id);
     $old_status = $old_bean->status;
     //////////////////////////////
     /*	if(empty($_REQUEST['status']) || $_REQUEST['status'] == 'off'){
     		$focus->status = 0;	
     	}else{
     		$focus->status= 1;
     	}
     	
     	echo "post length:".count($_POST); 
         echo "product_count:".$count."<br>";
     	echo "cost_price num:".count($_POST["cost_price"])."<br";*/
     $return_id = $focus->save();
     /*$quoteLine1 = new QuoteLine();
     	$quoteLine1->mark_deletedByQuoteid($return_id);
     	$count = count($_POST);
     	$keys = array_keys($_POST);
     	$sum = 0;
     	for($i = 0;$i< $count; $i++) {
     		//echo $keys[$i]."<br>";
     		if(substr_count($keys[$i],"productid_") > 0) {
     			$index = substr($keys[$i],strpos($keys[$i],"_")+1);
     			$product_id = $_POST["productid_".$index];
     			
     			if(!isset($product_id) || empty($product_id))
     				continue;
     			
     			$product_name = $_POST["productname_".$index];
     			$product_num = $_POST["productnum_".$index];
                 $pages = $_POST["pages_".$index];
      			$quantity = $_POST["quantity_".$index];
                 $estp = $_POST["estp_".$index];
                 $price = $_POST["price_".$index];     
                 
     			$quoteLine = new QuoteLine();
                 $quoteLine->price = $price;
                 $quoteLine->estp = $estp;
                 $quoteLine->productid = $product_id;
                 $quoteLine->productname = $product_name;
                 $quoteLine->productnum = $product_num;
                 $quoteLine->pages = $pages;
     			$quoteLine->quantity = $quantity;
     			$quoteLine->quoteid = $return_id;
     			$quoteLine->save();
     		}
     	}
     	$count = $_POST["product_count"];*/
     /*	$component = new ProductComponents;
     	$component->retrieve($sugarbean->component_id);
     	$component->status_update('quoted', $component->id);*/
     //	$GLOBLES['log']->debug("Saved record with id of ".$return_id);
     if ($redirect) {
         $this->handleRedirect($return_id);
     } else {
         return $focus;
     }
     $productstatus = new ProductStatus();
     if (isset($_REQUEST['status_action']) && !empty($_REQUEST['status_action'])) {
         $productstatus->update_product_status($_REQUEST['status_action'], $focus, $old_status);
     } else {
         $productstatus->update_product_status($_REQUEST['status'], $focus, $old_status);
     }
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:81,代码来源:QuoteFormBase.php

示例5: Estimates

 function get_status($id = null)
 {
     if (!is_null($id)) {
         $esteimate = new Estimates();
         $esteimate->retrieve($id);
         $product = new Products();
         $product->retrieve($esteimate->product_id);
         if (!is_null($product->status)) {
             return $product->status;
         }
     }
     return 'new_estimate';
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:13,代码来源:Quote.php

示例6: Products

 * requirements.
 *
 * The Original Code is: SugarCRM Open Source
 * The Initial Developer of the Original Code is SugarCRM, Inc.
 * Portions created by SugarCRM are Copyright (C) 2004-2006 SugarCRM, Inc.;
 * All Rights Reserved.
 * Contributor(s): ______________________________________.
 */
require_once 'modules/Products/Products.php';
$sugarbean = new Products();
// perform the delete if given a record to delete
if (empty($_REQUEST['record'])) {
    $GLOBALS['log']->info('delete called without a record id specified');
} else {
    $record = $_REQUEST['record'];
    $sugarbean->retrieve($record);
    if (!$sugarbean->ACLAccess('Delete')) {
        ACLController::displayNoAccess(true);
        sugar_cleanup(true);
    }
    $GLOBALS['log']->info("deleting record: {$record}");
    $sugarbean->product_update($sugarbean->id);
    $sugarbean->mark_deleted($record);
}
// handle the return location variables
$return_module = empty($_REQUEST['return_module']) ? 'Products' : $_REQUEST['return_module'];
$return_action = empty($_REQUEST['return_action']) ? 'index' : $_REQUEST['return_action'];
$return_id = empty($_REQUEST['return_id']) ? '' : $_REQUEST['return_id'];
$return_location = "index.php?module={$return_module}&action={$return_action}";
// append the return_id if given
if (!empty($return_id)) {
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:Delete.php

示例7: Estimates

    $xtpl->assign('estimate_id', $_REQUEST['estimate_id']);
    $xtpl->assign("PRODUCTROWS", $focus->add_quote_estimate($_REQUEST['estimate_id']));
    $xtpl->parse("main.row1");
    $estimate_id = $_REQUEST['estimate_id'];
}
if (isset($focus->estimate_id) && !empty($focus->estimate_id)) {
    $xtpl->assign('estimate_id', $focus->estimate_id);
    $xtpl->assign("PRODUCTROWS", $focus->add_quote_estimate($focus->estimate_id));
    $xtpl->parse("main.row1");
    $estimate_id = $focus->estimate_id;
}
if (isset($estimate_id) && !empty($estimate_id)) {
    $Estimate = new Estimates();
    $Estimate->retrieve($estimate_id);
    $product = new Products();
    $product->retrieve($Estimate->product_id);
    $xtpl->assign("number", $product->pnum);
    $xtpl->assign("prod_product_name", $product->name);
    $xtpl->assign("prod_product_id", $product->id);
    $xtpl->assign("prod_account_name", $product->account_name);
    $xtpl->assign("prod_account_id", $product->account_id);
    $xtpl->assign("prod_contact_name", $product->contact_name);
    $xtpl->assign("prod_contact_id", $product->contact_id);
    $style_display = '';
    $xtpl->assign("product_readOnly", 'readOnly');
}
if (!is_null($focus->id)) {
    $xtpl_data['ACCOUNT_ID'] = $focus->account_id;
    $xtpl_data['ACCOUNT_NAME'] = $focus->account_name;
    $xtpl_data['BILLTOCONTACTID'] = $focus->contact_id;
    $xtpl_data['BILLTOCONTACTNAME'] = $focus->contact_name;
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:EditView.php

示例8: Products

 function get_status($id = null)
 {
     if (!is_null($id)) {
         $product = new Products();
         $product->retrieve($id);
         if (!is_null($product->status)) {
             return $product->status;
         }
     }
     return;
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:11,代码来源:ProductLog.php

示例9: ClientRequest

 function get_status($id = null)
 {
     if (!is_null($id)) {
         $clientrequest = new ClientRequest();
         $clientrequest->retrieve($id);
         $product = new Products();
         $product->retrieve($clientrequest->product_id);
         if (!is_null($product->status)) {
             //var_dump($clientrequest);
             //var_dump($product->id);
             return $product->status;
         }
     }
     return 'new_client_request';
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:15,代码来源:ClientRequest.php

示例10: ClientOrders

 function get_status($id = null)
 {
     if (!is_null($id)) {
         $esteimate = new ClientOrders();
         $esteimate->retrieve($id);
         $product = new Products();
         $product->retrieve($esteimate->product_id);
         if (!is_null($product->status)) {
             return $product->status;
         }
     }
     return 'new_clientorder';
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:13,代码来源:ClientOrders.php

示例11: get_module_title

 * Contributor(s): ______________________________________.
 */
require_once 'XTemplate/xtpl.php';
require_once 'data/Tracker.php';
require_once 'modules/Products/Products.php';
require_once 'include/time.php';
require_once 'modules/Products/Forms.php';
global $timedate;
global $app_strings;
global $app_list_strings;
global $current_language;
global $current_user;
global $sugar_version, $sugar_config;
$focus = new Products();
if (!empty($_REQUEST['record'])) {
    $focus->retrieve($_REQUEST['record']);
}
echo "\n<p>\n";
echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_MODULE_NAME'] . ": " . $focus->name, true);
echo "\n</p>\n";
global $theme;
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
require_once $theme_path . 'layout_utils.php';
$GLOBALS['log']->info("Products detail view");
$xtpl = new XTemplate('modules/Products/EditView.html');
/// Users Popup
$json = getJSONobj();
$popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'EditView', 'field_to_name_array' => array('id' => 'assigned_user_id', 'user_name' => 'assigned_user_name'));
$xtpl->assign('encoded_users_popup_request_data', $json->encode($popup_request_data));
///Account Popup
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:EditView.php


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