<?php if (!defined('sugarEntry') || !sugarEntry) { die('Not A Valid Entry Point'); } require_once 'modules/EstimateComponents/EstimateComponents.php'; if (isset($_REQUEST['paper_id']) && !empty($_REQUEST['paper_id'])) { $paperid = $_REQUEST['paper_id']; } $focus = new EstimateComponents(); $paper_data = $focus->get_paper_info($paperid); echo '<input name="x" id="x" value=' . $paper_data['size_h'] . '>'; echo '<input name="y" id="y" value=' . $paper_data['size_w'] . '>'; echo '<input name="weight" id="weight" value=' . $paper_data['weight'] . '>'; echo '<input name="type" id="type" value=' . $paper_data['chrome'] . '>'; echo '<input name="texture" id="texture" value=' . $paper_data['texture'] . '>'; echo '<input name="color" id="color" value=' . $paper_data['color'] . '>'; echo '<input name="absorbtion" id="absorbtion" value=' . $paper_data['absorbtion'] . '>'; echo '<input name="side" id="side" value=' . $paper_data['side'] . '>';
$bodyHtml .= $pdf->genCells($mod_strings["LBL_COLORS_A"]); $bodyHtml .= $pdf->genCells($mod_strings["LBL_COLORS_B"], false, false, true); $bodyHtml .= $pdf->CompRows($list); $bodyHtml .= "</table>"; $bodyHtml .= "<newpage>"; //Get the components' ids $list = null; $query = "SELECT id FROM `estimates_components` WHERE parent_id='" . $focus->id . "' AND deleted=0 AND parent_bean = 'ClientRequest'"; //$query = "SELECT id FROM `estimates_components` WHERE deleted=0 AND parent_bean = 'ClientRequest'"; $result = $focus->db->query($query, true, "Error filling layout fields: "); while ($row = $focus->db->fetchByAssoc($result)) { $list[] = $row['id']; } //Initializing of EstimateComponents object needs to be done for every record for ($i = 0; $i < count($list); $i++) { $RqComps = new EstimateComponents(); $RqComps->retrieve($list[$i]); //get the $mod_strings from EstimateComponents module $mod_strings = return_module_language($current_language, "EstimateComponents"); //shortcut variables $format = $RqComps->fsize_h . "x" . $RqComps->fsize_w; $runFormat = $RqComps->run_size_x . "x" . $RqComps->run_size_y; $bleed = $RqComps->bleed_size_x . "x" . $RqComps->bleed_size_y; $baseFormat = $RqComps->base_x . "x" . $RqComps->base_y; $compsHtml .= "<br />"; $compsHtml .= $pdf->sectionHeading($mod_strings["LBL_COMPONENTS_PDF_TITLE"], $RqComps->name, $RqComps->number); $compsHtml .= $pdf->createHeading($mod_strings["LBL_GENERAL"]); $compsHtml .= $pdf->createTr(false, $mod_strings["LBL_NUMBER"], $RqComps->number, $mod_strings["LBL_QUANTITY"], $RqComps->quantity); $compsHtml .= $pdf->createTr(false, $mod_strings["LBL_VOLUME"], $RqComps->volume); $compsHtml .= $pdf->createTr(true, $mod_strings["LBL_DESCRIPTION"], $RqComps->description, null, null, true); $compsHtml .= $pdf->createHeading($mod_strings["LBL_COMPONENT_FORMATS"]);
require_once 'include/time.php'; require_once 'modules/Format/Format.php'; require_once 'modules/Paperformat/Paperformat.php'; require_once 'modules/Pressformat/Pressformat.php'; require_once 'modules/Childformat/Childformat.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 EstimateComponents(); $format = new Paperformat(); $pressformat = new Pressformat(); $childformat = new Childformat(); if (!empty($_REQUEST['record'])) { $focus->retrieve($_REQUEST['record']); } echo "\n<p>\n"; if ($focus->parent_bean == 'ClientRequest') { $mod_strings['LBL_MODULE_NAME'] = $mod_strings['LBL_CLIENTREQUEST_MODULE_NAME']; } if ($focus->parent_bean == 'Estimates') { $mod_strings['LBL_MODULE_NAME'] = $mod_strings['LBL_ESTIMATES_MODULE_NAME']; } echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_MODULE_NAME'] . ": " . $focus->name, true); echo "\n</p>\n";
//$focus->status = $ClientRequest->status; $focus->period = $ClientRequest->periodic; $focus->samples = $ClientRequest->samples; $focus->file = $ClientRequest->files; $focus->note = $ClientRequest->special_requirements; $focus->description = $ClientRequest->description; $focus->operation_description = $ClientRequest->operation_description; //To Do: add operations : temp done. //Transport //Pack $focus->save($GLOBALS['check_notify']); $focus->retrieve(); $Components = new EstimateComponents(); $components_array = $Components->get_full_list("id", "parent_id='" . $ClientRequest->id . "'"); for ($i = 0; $i < count($components_array); $i++) { $EstimateComponents = new EstimateComponents(); $fields = $components_array[$i]->column_fields; foreach ($fields as $field) { $EstimateComponents->{$field} = $components_array[$i]->{$field}; } $EstimateComponents->id = null; $EstimateComponents->date_entered = null; $EstimateComponents->date_modified = null; $EstimateComponents->created_by = null; $EstimateComponents->modified_user_id = null; $EstimateComponents->assigned_user_id = null; $EstimateComponents->assigned_user_name = null; $EstimateComponents->parent_bean = 'Estimates'; $EstimateComponents->parent_id = $focus->id; $EstimateComponents->parent_name = $focus->name; $EstimateComponents->number = $EstimateComponents->generate_number('number', 'estimates_components', $focus->id, $focus->table_name);
* License. * * All copies of the Covered Code must include on each user interface screen: * (i) the "Powered by SugarCRM" logo and * (ii) the SugarCRM copyright notice * in the same form as they appear in the distribution. See full license for * 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/EstimateComponents/EstimateComponents.php'; $sugarbean = new EstimateComponents(); // 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']) ? 'EstimateComponents' : $_REQUEST['return_module'];
function getEstimateComponentsRows() { $return_array = array(); if ($this->id != "") { $estimateComponent = new EstimateComponents(); $return_array = $estimateComponent->get_full_list("id", "parent_id='" . $this->id . "'"); } return $return_array; }
$bodyHtml .= $pdf->genCells($mod_strings["LBL_COMP_NUMBER"]); $bodyHtml .= $pdf->genCells($mod_strings["LBL_COMP_PAPER"], false, false, false, "25%"); $bodyHtml .= $pdf->genCells($mod_strings["LBL_COMP_FSIZE_H"]); $bodyHtml .= $pdf->genCells($mod_strings["LBL_COMP_FSIZE_W"], false, false, true); $bodyHtml .= $pdf->CompRows($list); $bodyHtml .= "</table>"; $bodyHtml .= "<newpage>"; $list = null; $query = "SELECT id FROM `estimates_components` WHERE parent_id='" . $focus->id . "' AND deleted=0"; $result = $focus->db->query($query, true, "Error filling layout fields: "); while ($row = $focus->db->fetchByAssoc($result)) { $list[] = $row['id']; } //Initializing of EstimateComponents object, needs to be done for every record for ($i = 0; $i < count($list); $i++) { $estComps = new EstimateComponents(); $estComps->retrieve($list[$i]); //get the $mod_strings from EstimateComponents module $comp_mod_strings = return_module_language($current_language, "EstimateComponents"); $description = nl2br(url2html($estComps->description)); $type = $app_list_strings['type_options'][$estComps->type]; $color = $estComps->color_side_a . "x" . $estComps->color_side_b; $fsize = $estComps->fsize_h . "x" . $estComps->fsize_w; $base = $estComps->base_x . "x" . $estComps->base_y; $bleed_size = $estComps->bleed_size_x . "x" . $estComps->bleed_size_y; $child = $estComps->child_x . "x" . $estComps->child_y; $run_size = $estComps->run_size_x . "x" . $estComps->run_size_y; $pressformat = $estComps->pressformat_x . "x" . $estComps->pressformat_y; $colorSideA = $comp_mod_strings["LBL_COLOR_SIDE_A"] . "(" . $estComps->color_side_a . ")"; $colorSideB = $comp_mod_strings["LBL_COLOR_SIDE_B"] . "(" . $estComps->color_side_b . ")"; $ink_rows = $estComps->getInkRows();
* 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/ComponentEstimateCalc/ComponentEstimateCalc.php'; require_once 'modules/EstimateComponents/EstimateComponents.php'; require_once 'include/formbase.php'; global $app_list_strings; $sugarbean = new ComponentEstimateCalc(); $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 EstimateComponents(); $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, 'ComponentEstimateCalc');