Code: Select all
<?php
function viewjcn()
{
commonHeader();
if ($GLOBALS['jcn'] == '')
{
print(STR_WO_NEEDJCNERR);
return;
}
if ($GLOBALS['seq'] != '')
{
$obj = CreateObject('dcl.htmlWorkOrderDetail');
$obj->Show($GLOBALS['jcn'], $GLOBALS['seq']);
return;
}
$objView = CreateObject('dcl.boView');
$objView->style = 'report';
$objView->title = STR_WO_RESULTSTITLE;
$objView->AddDef('filter', 'jcn', $GLOBALS['jcn']);
if (IsSet($GLOBALS['seq']) && $GLOBALS['seq'] != '')
$objView->AddDef('filter', 'seq', $GLOBALS['seq']);
$objView->AddDef('columns', '',
array('jcn', 'seq', 'dcl_wo_type.type_name', 'products.name', 'priorities.name', 'severities.name', 'responsible.short', 'contact', 'deadlineon', 'summary'));
$objView->AddDef('order', '', array('jcn', 'seq'));
$objView->AddDef('columnhdrs', '',
array(STR_WO_JCN, STR_WO_SEQ, STR_WO_TYPE, STR_WO_PRODUCT, STR_WO_PRIORITY, STR_WO_SEVERITY, STR_WO_RESPONSIBLE, STR_WO_CONTACT, STR_WO_DEADLINE, STR_WO_SUMMARY));
$objHV = CreateObject('dcl.htmlView');
$objHV->Render($objView);
}
?>Code: Select all
<?php
function Render($objView)
{
global $dcl_info;
if (!is_object($objView))
{
print('[htmlView] ' . STR_VW_VIEWOBJECTNOTPASSED);
return;
}
// check to see if we have the method specified
if (!is_object($this->oCallback) || ($this->sCallback == '' && $this->sFilterCallback == ''))
{
$this->oCallback = null;
}
$whatObject = $this->GetClassNameForTable($objView->table);
if ($whatObject == '')
return;
$objDB = CreateObject('dcl.' . $whatObject);
$objDB->Connect();
$bNext = false;
$bPrev = false;
$sForm = '';
$result = 0;
if ($objView->numrows > 0 || $objView->startrow > 0)
{
$url = $objView->GetURL();
$sForm = $this->GetPagerFormElements($objView, $bPrev, $bNext);
$result = $objDB->LimitQuery($objView->GetSQL(), $objView->startrow, $objView->numrows);
}
else
$result = $objDB->Query($objView->GetSQL());
if ($result == -1)
{
print('<center><h4>');
printf(STR_VW_QUERYERR, '');
print('</h4></center>');
return;
}
?>Thanks,
Rand