require_once 'modules/Layoutline/Layoutline.php';
require_once 'include/time.php';
require_once 'modules/Format/Format.php';
global $timedate;
global $app_strings;
global $app_list_strings;
global $current_language;
global $current_user;
global $sugar_version, $sugar_config;
// Unimplemented until jscalendar language files are fixed
// global $current_language;
// global $default_language;
// global $cal_codes;
$focus = new ProductComponents();
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("ProductComponents detail view");
$xtpl = new XTemplate('modules/ProductComponents/EditView.html');
$xtpl->assign('MOD', $mod_strings);
$xtpl->assign('APP', $app_strings);
///
/// Populate the fields with existing data
///
<?php

if (!defined('sugarEntry') || !sugarEntry) {
    die('Not A Valid Entry Point');
}
require_once 'modules/ProductComponents/ProductComponents.php';
$product = new ProductComponents();
if (!empty($_POST['record'])) {
    $product->retrieve($_POST['record']);
}
////
//// save the fields to the ProductComponents object
////
if (isset($_REQUEST['email_id'])) {
    $product->email_id = $_REQUEST['email_id'];
}
if ($_POST['order_number'] == '') {
    $_POST['order_number'] = '1';
}
foreach ($product->column_fields as $field) {
    if (isset($_REQUEST[$field])) {
        $product->{$field} = $_REQUEST[$field];
    }
    if (!isset($_REQUEST['milestone_flag'])) {
        $product->milestone_flag = 'off';
    }
}
//$product->time_start = str_replace('.',':',$_REQUEST['time_start']);
//$product->time_due = str_replace('.',':',$_REQUEST['time_due']);
// Get GMT clean values
if (!empty($_REQUEST['date_start']) && !empty($_REQUEST['time_start'])) {
 * 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/ComponentEstimate/ComponentEstimate.php';
require_once 'modules/ProductComponents/ProductComponents.php';
require_once 'include/formbase.php';
global $app_list_strings;
$sugarbean = new ComponentEstimate();
$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']);
$component = new ProductComponents();
$component->retrieve($sugarbean->component_id);
//// Status Update
if (isset($_REQUEST['stat_action']) && !empty($_REQUEST['stat_action']) && !is_null($_REQUEST['stat_action'])) {
    $component->status_update('', $component->id, $_REQUEST['stat_action'], '');
} else {
    $component->status_update('', $component->id, '', '');
}
/////////////////
$return_id = $sugarbean->id;
handleRedirect($return_id, 'ComponentEstimate');
 * 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/ProductComponents/ProductComponents.php';
$sugarbean = new ProductComponents();
// 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->mark_deleted($record);
}
// handle the return location variables
$return_module = empty($_REQUEST['return_module']) ? 'ProductComponents' : $_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)) {
    $return_location .= "&record={$return_id}";