processSugarBean ( "ECMPRICES", $focus, $offset ); if ($result == null) { sugar_die ( $app_strings ['ERROR_NO_RECORD'] ); } $focus = $result; } else { header ( "Location: index.php?module={EcmPrices}&action=index" ); } if (isset ( $_REQUEST ['isDuplicate'] ) && $_REQUEST ['isDuplicate'] == 'true') { $focus->id = ""; } echo "\n

\n"; echo get_module_title ( $mod_strings ['LBL_MODULE_ID'], $mod_strings ['LBL_MODULE_NAME'] . ": " . $focus->name, true ); echo "\n

\n"; global $theme; $theme_path = "themes/" . $theme . "/"; $image_path = $theme_path . "images/"; require_once ($theme_path . 'layout_utils.php'); if(!$_SESSION['pricebook_check'][$_REQUEST['pricebook_id']]['all']){ $result = $GLOBALS['db']->query("select id from ecmprices_ecmproducts"); $checkc=''; while($ro=$GLOBALS['db']->fetchByAssoc($result)){ $_SESSION['pricebook_check'][$_REQUEST['pricebook_id']][$ro['id']]="true"; } $_SESSION['pricebook_check'][$_REQUEST['pricebook_id']]['all']="true"; } $_SESSION['pricebook_check'][$_REQUEST['record']]['all']="true"; $GLOBALS ['log']->info ( "EcmPrices detail view" ); $focus->format_all_fields (); $xtpl = new XTemplate ( 'modules/EcmPrices/DetailView.html' ); $xtpl->assign ( "MOD", $mod_strings ); $xtpl->assign ( "APP", $app_strings ); $xtpl->assign ( "THEME", $theme ); $xtpl->assign ( "GRIDLINE", $gridline ); $xtpl->assign ( "IMAGE_PATH", $image_path ); $xtpl->assign ( "PRINT_URL", "index.php?" . $GLOBALS ['request_string'] ); $xtpl->assign ( "ID", $focus->id ); $xtpl->assign ( "ASSIGNED_TO", $focus->assigned_user_name ); $xtpl->assign ( "NAME", $focus->name ); $xtpl->assign ( "DATE_ENTERED", $focus->date_entered ); $xtpl->assign ( "DATE_MODIFIED", $focus->date_modified ); include ("modules/EcmDocs/Pagination.php"); $xtpl->assign ( "PAGINATION1", getPagination ( "ecmprices", "EcmPrices", $_REQUEST ['record'] ) ); if ($focus->active == '1') $xtpl->assign ( 'ACTIVE', "Active" ); elseif ($focus->active == '2') $xtpl->assign ( 'ACTIVE', "Inactive" ); if ($focus->archived == '1') $xtpl->assign ( 'ARCHIVED', "checked" ); $xtpl->assign ( "DESCRIPTION", nl2br ( url2html ( $focus->description ) ) ); $r = $db->fetchByAssoc ( $db->query ( "select name from ecmproductexchangerates where id='" . $focus->exchange_rate_id . "'" ) ); $focus->exchange_rate_name = $r ['name']; $desc = ''; $desc .= ''; $desc .= ''; $xtpl->assign ( "CATALOGUE", $desc ); $xtpl->assign ( "EXCHANGE_RATE_NAME", $focus->exchange_rate_name ); $xtpl->assign ( "EXCHANGE_RATE_ID", $focus->exchange_rate_id ); $xtpl->assign ( "ACCOUNT_NAME", $focus->account_name ); $xtpl->assign ( "ACCOUNT_ID", $focus->account_id ); $xtpl->assign ( "LEAD_NAME", $focus->lead_name ); $xtpl->assign ( "LEAD_ID", $focus->lead_id ); if ($focus->name == "leobitepl" || $focus->name == "www.e5" || $focus->name == "getmir") { // $xtpl->assign("NAME_style", 'style="display:none;"'); if ($focus->name == "leobitepl") { $addrl = "leobite.pl"; $shop = "leobite"; } elseif ($focus->name == "getmir") { $addrl = "getmir.com"; $shop = "Getmir shop"; } else { $addrl = "e5.pl"; $shop = "e5 shop PL"; } $xtpl->assign ( "LEOBITE", '' ); } if ($focus->name == "www.e5") { $addrl = "shop-en.e5.pl"; $shop = "e5 shop EN"; $xtpl->assign ( "LEOBITEEN", '' ); } /* $xtpl->assign ( "SHOWPDF", '' ); */ $xtpl->assign ( "SORT_ORDER", '' ); require_once ('modules/Currencies/Currency.php'); $currency = new Currency (); if (isset ( $focus->exchange_rate_id ) && ! empty ( $focus->exchange_rate_id )) { $currency->retrieve ( $focus->exchange_rate_id ); if ($currency->deleted != 1) { $xtpl->assign ( "CURRENCY", $currency->iso4217 . ' ' . $currency->symbol ); } else $xtpl->assign ( "CURRENCY", $currency->getDefaultISO4217 () . ' ' . $currency->getDefaultCurrencySymbol () ); } else { $xtpl->assign ( "CURRENCY", $currency->getDefaultISO4217 () . ' ' . $currency->getDefaultCurrencySymbol () ); } if ($_SESSION ['pricebook_images'] == "true") $xtpl->assign ( "IMAGES_CHECKED", "checked" ); global $current_user; if (is_admin ( $current_user ) && $_REQUEST ['module'] != 'DynamicLayout' && ! empty ( $_SESSION ['editinplace'] )) { $xtpl->assign ( "ADMIN_EDIT", "" . get_image ( $image_path . "EditLayout", "border='0' alt='Edit Layout' align='bottom'" ) . "" ); } $result = $db->query ( "select ecmproduct_id,price from ecmprices_ecmproducts where ecmprice_id='" . $_REQUEST ['record'] . "' and deleted='0'" ); $products = ""; while ( ($row = $db->fetchByAssoc ( $result )) != null ) { $row1 = $db->fetchByAssoc ( $db->query ( "select name from ecmproducts where id='" . $row ['ecmproduct_id'] . "' and deleted='0'" ) ); $products .= $row1 ['name'] . ", price: " . $row ['price'] . "
"; } $xtpl->assign ( "PRODUCTS", $products ); $result = $db->query ( "select id,name from ecmprices_customview where name!='' order by name asc" ); if (! $_COOKIE ['customview_id'] || $_COOKIE ['customview_id'] == "select" || $_COOKIE ['customview_id'] == "Select") { $rrr = $GLOBALS ['db']->fetchByAssoc ( $GLOBALS ['db']->query ( "select id,name from ecmprices_customview where name!='' order by name asc" ) ); setcookie ( "customview_id", $rrr ['id'], time () + 3600 * 24 * 60 ); $_COOKIE ['customview_id'] = $rrr ['id']; } $products = ""; $cv_select = ' ' . $mod_strings ['LBL_CV_EDIT'] . ' | ' . $mod_strings ['LBL_CV_DELETE'] . ' | ' . $mod_strings ['LBL_CV_CREATE'] . ''; $xtpl->assign ( "CUSTOMVIEW_SELECT", $cv_select ); $xtpl->assign ( "CURRENCY_VALUE", $focus->currency_value ); $xtpl->assign ( "CREATED_BY", $focus->created_by_name ); $xtpl->assign ( "MODIFIED_BY", $focus->modified_by_name ); $desc=''; $desc.=''; $desc .= ''; $xtpl->assign ("PDFGEN",$desc); $desc=''; $desc.=''; $desc .= '