function estimate_details($id, $details = 'details', $update_estimate = 'update_estimate') { global $current_language, $app_list_strings; $object = new ComponentEstimate(); $mod_strings = return_module_language($current_language, $object->object_name); $object->retrieve($id); $xtpl = new XTemplate('modules/ComponentEstimate/EstimateDetails.html'); $xtpl->assign('MOD', $mod_strings); if ($object->status == "uptodate") { ///////////// DETAILS ///////////// $prepress = $object->prepressEstimate($object->component_id); $press_rate[] = $object->press_rate_a_id; $press_rate[] = $object->press_rate_b_id; $pressestimate = $object->pressEstimate($object->component_id, $press_rate); $paperestimate = $object->paperEstimate($object->component_id, $object->paper_rate_id); $operations = $object->operationsEstimate($object->component_id, true); ///Press $xtpl->assign("press_price_lines", $pressestimate['layout_html']); /// ///Paper & Paperwaste $client_paper = $paperestimate['client_paper']; $xtpl->assign("paper_singleprice", $paperestimate['paper_singleprice']); $xtpl->assign("clean_quantity_qp", $paperestimate['clean_quantity_qp']); $xtpl->assign("paperwaste_qp", $paperestimate['paperwaste_qp']); $xtpl->assign("qp", $paperestimate['qp']); $xtpl->assign("sheets_qp", $paperestimate['sheets_qp']); $xtpl->assign("pages", $paperestimate['pages']); $xtpl->assign("paper_waste_rows", $paperestimate['paperestimate_html']); $xtpl->assign("paper_operation_waste_rows", $paperestimate['operations_html']); $xtpl->assign("client_paper", $app_list_strings['client_paper_options'][$client_paper]); /// ///Prepress $xtpl->assign("prepress_lines", $prepress['html']); /// ///Operations $xtpl->assign("operation_lines", $operations['html']); /// $xtpl->assign("details", $details); //////////////////////////////////// } else { $xtpl->assign("details", $update_estimate); } $xtpl->parse('details'); $xtpl->out('details'); }
*/ require_once 'XTemplate/xtpl.php'; require_once 'data/Tracker.php'; require_once 'modules/ComponentEstimate/ComponentEstimate.php'; require_once 'include/time.php'; require_once 'modules/ComponentEstimate/Forms.php'; require_once 'include/formbase.php'; global $timedate; global $app_strings; global $app_list_strings; global $current_language; global $current_user; global $sugar_version, $sugar_config; $focus = new ComponentEstimate(); if (!empty($_REQUEST['record'])) { $focus->retrieve($_REQUEST['record']); } if (!empty($_REQUEST['component_id']) && isset($_REQUEST['component_id']) && !is_null($_REQUEST['component_id'])) { $component_id = $_REQUEST['component_id']; } if (isset($focus->component_id) && !is_null($focus->component_id)) { $component_id = $focus->component_id; } $press_rate = array(); $press_rate[] = null; $press_rate[] = null; if (isset($_REQUEST['press_rate_a_id']) && !empty($_REQUEST['press_rate_a_id'])) { $press_rate[0] = $_REQUEST['press_rate_a_id']; } if (isset($_REQUEST['press_rate_b_id']) && !empty($_REQUEST['press_rate_b_id'])) { $press_rate[1] = $_REQUEST['press_rate_b_id'];
function component_estimate_details() { global $current_language, $app_list_strings; $object = new ComponentEstimate(); $mod_strings = return_module_language($current_language, $object->object_name); $html = '<br><table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabDetailView"> <tr> <td width="30%" style="text-align:left" class="tabDetailViewDL"><span sugar="slot1">' . $mod_strings["LBL_NAME"] . '</span sugar="slot"></td> <td width="10%" style="text-align:left" class="tabDetailViewDL"><span sugar="slot5">' . $mod_strings["LBL_PREPRESS_TOTAL"] . '</span sugar="slot"></td> <td width="10%" style="text-align:left" class="tabDetailViewDL"><span sugar="slot7">' . $mod_strings["LBL_PRESS_TOTAL"] . '</span sugar="slot"></td> <td width="10%" style="text-align:left" class="tabDetailViewDL"><span sugar="slot5">' . $mod_strings["LBL_PAPER_TOTAL"] . '</span sugar="slot"></td> <td width="40%" style="text-align:left" class="tabDetailViewDL"><span sugar="slot7">' . $mod_strings["LBL_OPERATIONS_TOTAL"] . '</span sugar="slot"></td> </tr></table>'; echo $html; $query = 'SELECT id FROM componentestimate WHERE product_id="' . $this->product_id . '" AND deleted=0 '; $result = $this->db->query($query, true, "Error filling layout fields: "); $i = 0; while (($row = $this->db->fetchByAssoc($result)) != null) { $i = $i + 1; $details = "details_" . $i; $update_estimate = "update_estimate_" . $i; $object->retrieve($row['id']); $html = '<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabDetailView"><tr> <td align="left" width="30%" class="tabDetailViewDF"><span sugar="slot7b"><a href="index.php?module=ComponentEstimate&action=DetailView&record=' . $object->id . '">' . $object->name . '</a></span sugar="slot"></td> <td width="10%" class="tabDetailViewDF"><span sugar="slot5b">' . $object->total_prepress . '</span sugar="slot"></td> <td width="10%" class="tabDetailViewDF"><span sugar="slot7b">' . $object->total_press . '</span sugar="slot"></td> <td width="10%" class="tabDetailViewDF"><span sugar="slot5b">' . $object->total_paper . '</span sugar="slot"></td> <td width="40%" class="tabDetailViewDF"><span sugar="slot7b">' . $object->total_operations . '</span sugar="slot"></td> </tr> </table>'; echo $html; $object->estimate_details($object->id, $details, $update_estimate); } }
* 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/ComponentEstimate/ComponentEstimate.php'; $sugarbean = new ComponentEstimate(); // 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->delete_estimate($record); $sugarbean->mark_deleted($record); } // handle the return location variables $return_module = empty($_REQUEST['return_module']) ? 'ComponentEstimate' : $_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)) {