set_strings();
//var_dump($focus);
if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) {
$focus->retrieve_entity_info($_REQUEST['record'],"Accounts");
$focus->id = $_REQUEST['record'];
$focus->name=$focus->column_fields['accountname'];
$vtlog->logthis("id is ".$focus->id,'debug');
$vtlog->logthis("name is ".$focus->name,'debug');
}
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
$focus->id = "";
}
global $theme;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
require_once($theme_path.'layout_utils.php');
$log->info("Account detail view");
$xtpl=new XTemplate ('modules/Accounts/DetailView.html');
$xtpl->assign("MOD", $mod_strings);
$xtpl->assign("APP", $app_strings);
$xtpl->assign("THEME", $theme);
$xtpl->assign("IMAGE_PATH", $image_path);
$xtpl->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
if (isset($focus->name)) $xtpl->assign("NAME", $focus->name);
else $xtpl->assign("NAME", "");
//get Block 1 Information
$block_1_header = getBlockTableHeader("LBL_ACCOUNT_INFORMATION");
$block_1 = getDetailBlockInformation("Accounts",1,$focus->column_fields);
$xtpl->assign("BLOCK1_HEADER", $block_1_header);
$xtpl->assign("BLOCK1", $block_1);
//get Address Information
$block_2_header = getBlockTableHeader("LBL_ADDRESS_INFORMATION");
$block_2 = getDetailBlockInformation("Accounts",2,$focus->column_fields);
$xtpl->assign("BLOCK2_HEADER", $block_2_header);
$xtpl->assign("BLOCK2", $block_2);
//get Description Information
$block_3_header = getBlockTableHeader("LBL_DESCRIPTION_INFORMATION");
$block_3 = getDetailBlockInformation("Accounts",3,$focus->column_fields);
$xtpl->assign("BLOCK3_HEADER", $block_3_header);
$xtpl->assign("BLOCK3", $block_3);
$block_5 = getDetailBlockInformation("Accounts",5,$focus->column_fields);
if(trim($block_5) != '')
{
$cust_fld = '
';
$cust_fld .= '
';
}
$xtpl->assign("CUSTOMFIELD", $cust_fld);
$xtpl->assign("ID", $_REQUEST['record']);
/*
if ($focus->annual_revenue != '') $xtpl->assign("ANNUAL_REVENUE", $language['LBL_CURRENCY_SYMBOL'].$focus->annual_revenue);
$xtpl->assign("DATE_MODIFIED", substr($focus->date_modified,0,16));
$xtpl->assign("DATE_ENTERED", substr($focus->date_entered,0,16));
//Assigning Custom Field Values
$custfld = CustomFieldDetailView($focus->id, "Accounts", "accountcf", "accountid");
$xtpl->assign("CUSTOMFIELD", $custfld);
*/
$permissionData = $_SESSION['action_permission_set'];
if(isPermitted("Accounts",1,$_REQUEST['record']) == 'yes')
{
$xtpl->assign("EDITBUTTON"," | ");
$xtpl->assign("DUPLICATEBUTTON"," | ");
}
if(isPermitted("Accounts",2,$_REQUEST['record']) == 'yes')
{
$xtpl->assign("DELETEBUTTON"," | ");
}
//$browser = getenv("HTTP_USER_AGENT");
//$pos1 = strrpos($testString,'Windows');
//$local=explode(';',$browser);
//$test=strrpos($local[2],"Windows");
//if($test == true)
if(isPermitted("Accounts",8,'') == 'yes')
{
$xtpl->assign("MERGEBUTTON","");
require_once('modules/Users/UserInfoUtil.php');
$wordTemplateResult = fetchWordTemplateList("Accounts");
//$tempCount = mysql_num_rows($wordTemplateResult);
//$tempVal = mysql_fetch_array($wordTemplateResult);
$tempCount = $adb->num_rows($wordTemplateResult);
$tempVal = $adb->fetch_array($wordTemplateResult);
for($templateCount=0;$templateCount<$tempCount;$templateCount++)
{
$optionString .="";
$tempVal = $adb->fetch_array($wordTemplateResult);
//$tempVal = mysql_fetch_array($wordTemplateResult);
}
$xtpl->assign("WORDTEMPLATEOPTIONS"," ".$app_strings['LBL_SELECT_TEMPLATE_TO_MAIL_MERGE']."");
}
/*if($_ENV['HOME'] == '')
{
$xtpl->assign("MERGEBUTTON"," | ");
}
*/
$xtpl->parse("main");
$xtpl->out("main");
echo "
\n";
//Security check for related list
global $profile_id;
$tab_per_Data = getAllTabsPermission($profile_id);
$permissionData = $_SESSION['action_permission_set'];
getRelatedLists("Accounts",$focus);
/*
//Constructing the Related Lists from here
include('modules/Accounts/RenderRelatedListUI.php');
// Now get the list of opportunities that match this one.
if($tab_per_Data[2] == 0)
{
if($permissionData[2][3] == 0)
{
$focus_list = & $focus->get_opportunities($focus->id);
}
}
if($tab_per_Data[4] == 0)
{
if($permissionData[4][3] == 0)
{
$focus_list = & $focus->get_contacts($focus->id);
}
}
if($tab_per_Data[9] == 0)
{
if($permissionData[9][3] == 0)
{
$focus_activities_list = & $focus->get_activities($focus->id);
}
}
$focus_history_list = & $focus->get_history($focus->id);
if($tab_per_Data[8] == 0)
{
if($permissionData[8][3] == 0)
{
$focus_attachments_list = & $focus->get_attachments($focus->id);
}
}
*/
?>