本文整理汇总了PHP中commonHeader函数的典型用法代码示例。如果您正苦于以下问题:PHP commonHeader函数的具体用法?PHP commonHeader怎么用?PHP commonHeader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了commonHeader函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayversioninfo
function displayversioninfo()
{
global $dcl_info;
if (!empty($_SERVER)) {
extract($_SERVER);
}
commonHeader();
$Template = CreateTemplate(array('hForm' => 'htmlVersion.tpl'));
$Template->set_var('TXT_TITLE', STR_VER_TITLE);
$Template->set_var('TXT_YOURVER', STR_VER_YOURVER);
$Template->set_var('TXT_DCL', STR_VER_DCL);
$Template->set_var('TXT_SERVEROS', STR_VER_SERVEROS);
$Template->set_var('TXT_SERVERNAME', STR_VER_SERVERNAME);
$Template->set_var('TXT_WEBSERVER', STR_VER_WEBSERVER);
$Template->set_var('TXT_PHPVER', STR_VER_PHPVER);
$Template->set_var('TXT_YOURIP', STR_VER_YOURIP);
$Template->set_var('TXT_YOURBROWSER', STR_VER_YOURBROWSER);
$Template->set_var('VAL_DCLVERSION', $dcl_info['DCL_VERSION']);
$Template->set_var('VAL_SERVERNAME', $SERVER_NAME . '(' . $HTTP_HOST . ')');
$Template->set_var('VAL_SERVERSOFTWARE', $SERVER_SOFTWARE);
$Template->set_var('VAL_PHPVERSION', phpversion());
$Template->set_var('VAL_REMOTEADDR', $REMOTE_ADDR);
$Template->set_var('VAL_HTTPUSERAGENT', $HTTP_USER_AGENT);
if (isset($OSTYPE) && isset($HOSTTYPE)) {
$Template->set_var('VAL_SERVEROS', $OSTYPE . '-' . $HOSTTYPE);
} elseif (isset($OSTYPE)) {
$Template->set_var('VAL_SERVEROS', $OSTYPE);
} elseif (isset($HOSTTYPE)) {
$Template->set_var('VAL_SERVEROS', $HOSTTYPE);
} else {
$Template->set_var('VAL_SERVEROS', '');
}
$Template->pparse('out', 'hForm');
}
示例2: show
function show($orderBy = 'short')
{
global $dcl_info, $g_oSec;
commonHeader();
if (!$g_oSec->HasPerm(DCL_ENTITY_ROLE, DCL_PERM_VIEW)) {
return PrintPermissionDenied();
}
$oView = CreateObject('dcl.boView');
$oView->startrow = 0;
$oView->numrows = 25;
$filterActive = '';
if (isset($_REQUEST['filterActive'])) {
$filterActive = $_REQUEST['filterActive'];
}
$oView->table = 'dcl_role';
$oView->title = 'Browse Roles';
$oView->AddDef('columnhdrs', '', array('ID', 'Active', 'Role'));
$oView->AddDef('columns', '', array('role_id', 'active', 'role_desc'));
$oView->AddDef('order', '', array('role_desc'));
if ($filterActive == 'Y' || $filterActive == 'N') {
$oView->AddDef('filter', 'active', "'{$filterActive}'");
}
$oHtml = CreateObject('dcl.htmlRoleBrowse');
$oHtml->Render($oView);
}
示例3: show
function show()
{
global $dcl_info;
commonHeader();
$this->oDB->query("select a.id, a.short, count(*) from personnel a join dcl_sccs_xref b on a.id = b.personnel_id group by a.id, a.short order by 3 desc");
$aRecords = $this->oDB->FetchAllRows();
$oTable =& CreateObject('dcl.htmlTable');
$oTable->setCaption('ChangeLog Entries');
$oTable->addColumn(STR_CMMN_ID, 'numeric');
$oTable->addColumn('User', 'html');
$oTable->addColumn('Commits', 'numeric');
for ($i = 0; $i < count($aRecords); $i++) {
$aRecords[$i][1] = '<a href="' . menuLink('', 'menuAction=htmlChangeLog.ShowRepositoryCommits&personnel_id=' . $aRecords[$i][0]) . '">' . $aRecords[$i][1] . '</a>';
}
$oTable->setData($aRecords);
$oTable->setShowRownum(true);
$oTable->render();
$this->oDB->FreeResult();
$aTables = array('Personnel' => 'personnel', 'Organizations' => 'dcl_org', 'Contacts' => 'dcl_contact', 'Work Orders' => 'workorders', 'Time Cards' => 'timecards', 'Tickets' => 'tickets', 'Ticket Resolutions' => 'ticketresolutions', 'Projects' => 'dcl_projects', 'Products' => 'products', 'ChangeLog' => 'dcl_sccs_xref');
$oTable =& CreateObject('dcl.htmlTable');
$oTable->setCaption('Table Record Counts');
$oTable->addColumn('Table', 'string');
$oTable->addColumn('Records', 'numeric');
$oTable->setShowRownum(true);
foreach ($aTables as $sName => $sTable) {
$this->oDB->query("select '{$sName}', count(*) from {$sTable}");
if ($this->oDB->next_record()) {
$oTable->addRow(array($this->oDB->f(0), $this->oDB->f(1)));
}
$this->oDB->FreeResult();
}
$oTable->render();
}
示例4: modify
function modify()
{
global $dcl_info, $g_oSession, $g_oSec;
commonHeader();
if (!$g_oSec->HasPerm(DCL_ENTITY_PREFS, DCL_PERM_MODIFY)) {
return PrintPermissionDenied();
}
$t =& CreateSmarty();
$t->assign('PERM_MODIFYCONTACT', $g_oSec->HasPerm(DCL_ENTITY_CONTACT, DCL_PERM_MODIFY) || $g_oSec->HasPerm(DCL_ENTITY_GLOBAL, DCL_PERM_ADMIN));
$t->assign('VAL_CONTACTID', $g_oSession->Value('contact_id'));
// Reuse methods from here for lang and template
$o =& CreateObject('dcl.htmlConfig');
$t->assign('CMB_DEFAULTTEMPLATESET', $o->GetTemplatesCombo('DCL_PREF_TEMPLATE_SET', GetDefaultTemplateSet()));
$lang = $dcl_info['DCL_DEFAULT_LANGUAGE'];
$oPrefs =& CreateObject('dcl.dbPreferences');
$oPrefs->preferences_data = $g_oSession->Value('dcl_preferences');
if (isset($oPrefs->preferences_data) && is_array($oPrefs->preferences_data)) {
if ($oPrefs->Value('DCL_PREF_LANGUAGE') != '') {
$lang = $oPrefs->Value('DCL_PREF_LANGUAGE');
}
$t->assign('VAL_NOTIFYDEFAULT', $oPrefs->Value('DCL_PREF_NOTIFY_DEFAULT'));
$iOption = $oPrefs->Value('DCL_PREF_CREATED_WATCH_OPTION');
if ($iOption == '') {
$iOption = 4;
}
$t->assign('VAL_CREATEDWATCHOPTION', $iOption);
}
$t->assign('CMB_DEFAULTLANGUAGE', $o->GetLangCombo('DCL_PREF_LANGUAGE', $lang));
SmartyDisplay($t, 'htmlPreferences.tpl');
}
示例5: ShowPage
function ShowPage($sPage)
{
global $g_oSec, $dcl_info;
commonHeader();
if (($productid = DCL_Sanitize::ToInt($_REQUEST['id'])) === null) {
trigger_error('Data sanitize failed.');
return;
}
if (!$g_oSec->HasPerm(DCL_ENTITY_PRODUCT, DCL_PERM_VIEW, $productid)) {
return PrintPermissionDenied();
}
$this->oProduct =& CreateObject('dcl.dbProducts');
if ($this->oProduct->Load($productid) == -1) {
trigger_error('Could not find a product with an id of ' . $productid, E_USER_ERROR);
return;
}
$this->oSmarty->assign('VAL_ID', $this->oProduct->id);
$this->oSmarty->assign('VAL_NAME', $this->oProduct->name);
$this->oSmarty->assign('PERM_VIEWWO', $g_oSec->HasPerm(DCL_ENTITY_WORKORDER, DCL_PERM_VIEW));
$this->oSmarty->assign('PERM_VIEWTCK', $g_oSec->HasPerm(DCL_ENTITY_TICKET, DCL_PERM_VIEW));
$this->oSmarty->assign('PERM_WIKI', $dcl_info['DCL_WIKI_ENABLED'] == 'Y' && $g_oSec->HasPerm(DCL_ENTITY_PRODUCT, DCL_PERM_VIEWWIKI));
$this->oSmarty->assign('PERM_EDIT', $g_oSec->HasPerm(DCL_ENTITY_PRODUCT, DCL_PERM_MODIFY));
$this->oSmarty->assign('PERM_DELETE', $g_oSec->HasPerm(DCL_ENTITY_PRODUCT, DCL_PERM_DELETE));
$this->oSmarty->assign('PERM_VERSIONS', $dcl_info['DCL_BUILD_MANAGER_ENABLED'] == 'Y' && $this->oProduct->is_versioned == 'Y');
SmartyDisplay($this->oSmarty, $sPage);
}
示例6: view
function view()
{
global $g_oSec;
commonHeader();
if (($iID = @DCL_Sanitize::ToInt($_REQUEST['id'])) === null) {
trigger_error('Data sanitize failed.');
return;
}
if (!$g_oSec->HasPerm(DCL_ENTITY_PRODUCT, DCL_PERM_VIEW, $iID)) {
return PrintPermissionDenied();
}
$which = isset($_REQUEST['which']) ? $_REQUEST['which'] : '';
if ($which != 'workorders' && $which != 'tickets' && $which != 'modules' && $which != 'release' && $which != 'build') {
$which = null;
}
$versionid = null;
if (isset($_REQUEST['versionid'])) {
$versionid = @DCL_Sanitize::ToInt($_REQUEST['versionid']);
}
$obj =& CreateObject('dcl.htmlProductDetail');
if ($which !== null) {
if ($versionid !== null) {
$obj->Show($iID, $which, $versionid);
} else {
$obj->Show($iID, $which);
}
} else {
$obj->Show($iID);
}
}
示例7: ShowSystemConfig
function ShowSystemConfig()
{
global $g_oSec;
commonHeader();
if (!$g_oSec->HasPerm(DCL_ENTITY_ADMIN, DCL_PERM_VIEW)) {
return PrintPermissionDenied();
}
$obj =& CreateObject('dcl.htmlAdminMain');
$obj->Show();
}
示例8: show
function show()
{
global $g_oSec;
commonHeader();
$t =& CreateSmarty();
$t->assign('PERM_TICKETS', $g_oSec->HasAnyPerm(array(DCL_ENTITY_TICKET => array($g_oSec->PermArray(DCL_PERM_VIEW), $g_oSec->PermArray(DCL_PERM_VIEWACCOUNT), $g_oSec->PermArray(DCL_PERM_VIEWSUBMITTED)))));
$t->assign('PERM_WORKORDERS', $g_oSec->HasAnyPerm(array(DCL_ENTITY_WORKORDER => array($g_oSec->PermArray(DCL_PERM_VIEW), $g_oSec->PermArray(DCL_PERM_VIEWACCOUNT), $g_oSec->PermArray(DCL_PERM_VIEWSUBMITTED)))));
$t->assign('PERM_FAQ', $g_oSec->HasPerm(DCL_ENTITY_FAQ, DCL_PERM_VIEW));
SmartyDisplay($t, 'htmlPublicMyDCL.tpl');
}
示例9: Detail
function Detail()
{
global $g_oSession, $g_oSec, $dcl_info;
commonHeader();
if (!$g_oSec->HasPerm(DCL_ENTITY_SESSION, DCL_PERM_VIEW)) {
return PrintPermissionDenied();
}
echo '<pre>';
print_r($g_oSession->session_data);
echo '</pre>';
}
示例10: ShowResults
function ShowResults()
{
global $g_oSec;
commonHeader();
if (!$g_oSec->HasPerm(DCL_ENTITY_ADMIN, DCL_PERM_MODIFY)) {
return PrintPermissionDenied();
}
$begindate = @DCL_Sanitize::ToDateTime($_REQUEST['begindate'] . ' 00:00:00.00');
$enddate = @DCL_Sanitize::ToDateTime($_REQUEST['enddate'] . ' 23:59:59.99');
$responsible = DCL_Sanitize::ToInt($_REQUEST['responsible']);
if ($begindate === null || $enddate === null) {
commonHeader();
trigger_error(STR_SEC_DATEERR, E_USER_ERROR);
$this->Show(false);
return;
}
$objDBPer =& CreateObject('dcl.dbPersonnel');
$objDBSA =& CreateObject('dcl.dbSecAudit');
$objDB = new DCLDb();
$sCols = 'SA.id, ' . $objDBSA->ConvertTimestamp('SA.actionon', 'actionon') . ', SA.actiontxt, SA.actionparam';
$sCols .= ', ' . $objDBPer->SelectAllColumns('Pers.');
$sQuery = "SELECT {$sCols}\n\t\t\tFROM {$objDBSA->TableName} SA INNER JOIN {$objDBPer->TableName} Pers on \n\t\t\tSA.id = pers.id \n\t\t\tWHERE SA.actionon BETWEEN " . $objDBSA->DisplayToSQL($begindate) . ' and ' . $objDBSA->DisplayToSQL($enddate);
if ($responsible == 0) {
$respname = STR_SEC_ALLUSERS;
} else {
$objDBPer->Load($responsible);
$respname = $objDBPer->short;
$sQuery .= ' AND SA.id=' . $responsible;
}
$sQuery .= ' ORDER BY SA.actionon';
$reportAr = null;
if ($objDB->Query($sQuery) != -1) {
if ($objDB->next_record()) {
$idx = -1;
do {
$idx++;
$reportAr[$idx][] = $objDB->f('short');
$reportAr[$idx][] = $objDB->FormatTimeStampForDisplay($objDB->f('actionon'));
$reportAr[$idx][] = $objDB->f('actiontxt');
$reportAr[$idx][] = $objDB->f('actionparam');
} while ($objDB->next_record());
} else {
trigger_error(STR_SEC_RPTNODATA, E_USER_ERROR);
$this->Show(false);
return;
}
}
$obj =& CreateObject('dcl.htmlSecAudit');
if (!$obj->Render($reportAr, $begindate, $enddate, $respname)) {
trigger_error(STR_SEC_RPTERROR, E_USER_ERROR);
$this->Show(false);
return;
}
}
示例11: modify
function modify()
{
commonHeader();
if (($id = DCL_Sanitize::ToInt($_REQUEST['id'])) === null) {
trigger_error('Data sanitize failed.');
return;
}
$oPersonnel =& CreateObject('dcl.dbPersonnel');
if ($oPersonnel->Load($id) != -1) {
$this->ShowEntryForm($oPersonnel);
}
}
示例12: make404
/**
* Output a page not found message.
*
* @access public
* @return void
*/
function make404()
{
// Send the HTTP header.
header('HTTP/1.0 404 Not Found');
// Output a header for page not found.
commonHeader('404 Not Found');
// Output a message telling the user the page was not found.
echo "<H1>Not Found</H1>\n";
echo "<P>The page <B>" . htmlspecialchars($_SERVER['REQUEST_URI']) . "</B> could not be found.</P>\n";
// Output the footer.
commonFooter();
}
示例13: show
function show()
{
global $dcl_info, $g_oSec;
commonHeader();
if (!$g_oSec->HasPerm(DCL_ENTITY_WORKORDER, DCL_PERM_REPORT)) {
return PrintPermissionDenied();
}
if (($type = DCL_Sanitize::ToInt($_REQUEST['type'])) === null || ($id = DCL_Sanitize::ToInt($_REQUEST['id'])) === null) {
trigger_error('Data sanitize failed.');
return;
}
$oSmarty =& CreateSmarty();
$oAudit =& CreateObject('dcl.boAudit');
switch ($type) {
case DCL_ENTITY_WORKORDER:
if (($id2 = DCL_Sanitize::ToInt($_REQUEST['id2'])) === null) {
trigger_error('Data sanitize failed.');
return;
}
$this->aAudit = $oAudit->LoadDiff('dbWorkorders', array('jcn' => $id, 'seq' => $id2));
$oSmarty->assign('VAL_ID', sprintf('%d-%d', $id, $id2));
$oSmarty->assign('VAL_SUMMARY', $this->oMeta->GetWorkOrder($id, $id2));
$oSmarty->assign('LNK_BACK', menuLink('', "menuAction=boWorkorders.viewjcn&jcn={$id}&seq={$id2}"));
$oAccount =& CreateObject('dcl.dbWorkOrderAccount');
$this->aAuditAccount = $oAccount->AuditWorkOrderList($id, $id2);
$oProject =& CreateObject('dcl.dbProjectmap');
$this->aAuditProject = $oProject->AuditWorkOrderList($id, $id2);
break;
case DCL_ENTITY_PROJECT:
$this->aAudit = $oAudit->LoadDiff('dbProjects', array('projectid' => $id));
$oSmarty->assign('VAL_ID', $id);
$oSmarty->assign('VAL_SUMMARY', $this->oMeta->GetProject($id));
$oSmarty->assign('LNK_BACK', menuLink('', "menuAction=boProjects.viewproject&wostatus=0&project={$id}"));
$oProject =& CreateObject('dcl.dbProjectmap');
$this->aAuditWorkOrder = $oProject->AuditProjectList($id);
break;
case DCL_ENTITY_TICKET:
$this->aAudit = $oAudit->LoadDiff('dbTickets', array('ticketid' => $id));
$oSmarty->assign('VAL_ID', $id);
$oSmarty->assign('VAL_SUMMARY', $this->oMeta->GetTicket($id));
$oSmarty->assign('LNK_BACK', menuLink('', "menuAction=boTickets.view&ticketid={$id}"));
break;
}
$this->prepareForDisplay();
$oSmarty->assign_by_ref('VAL_AUDITTRAIL', $this->aAudit);
$oSmarty->assign_by_ref('VAL_AUDITACCOUNT', $this->aAuditAccount);
$oSmarty->assign_by_ref('VAL_AUDITPROJECT', $this->aAuditProject);
$oSmarty->assign_by_ref('VAL_AUDITWORKORDER', $this->aAuditWorkOrder);
SmartyDisplay($oSmarty, 'htmlAuditTrail.tpl');
}
示例14: PrintAll
function PrintAll($orderBy = 'name')
{
global $g_oSec, $g_oSession;
commonHeader();
if (!$g_oSec->HasPerm(DCL_ENTITY_SAVEDSEARCH, DCL_PERM_VIEW)) {
return PrintPermissionDenied();
}
if ($g_oSession->IsInWorkspace()) {
ShowWarning('You are currently in a workspace. It is possible for results to be mutually exclusive if a search contains a product filter. If you do not see the results you expect, switch to "No Workspace" or another workspace that has the products contained in the search.', '', '', array());
}
$objDB = CreateObject('dcl.dbViews');
$objDB->Query('SELECT viewid,whoid,ispublic,name,tablename FROM views WHERE whoid=' . $GLOBALS['DCLID'] . " OR ispublic='Y' ORDER BY {$orderBy}");
$allRecs = $objDB->FetchAllRows();
$oTable =& CreateObject('dcl.htmlTable');
$oTable->setCaption(sprintf(STR_VW_TITLE, $orderBy));
$oTable->addColumn(STR_VW_ID, 'numeric');
$oTable->addColumn(STR_VW_OWNER, 'string');
$oTable->addColumn(STR_VW_PUBLIC, 'string');
$oTable->addColumn(STR_VW_NAME, 'html');
$oTable->addColumn(STR_VW_TABLE, 'string');
$oTable->addColumn(STR_CMMN_OPTIONS, 'html');
$objDBP = CreateObject('dcl.dbPersonnel');
for ($i = 0; $i < count($allRecs); $i++) {
$allRecs[$i][3] = sprintf('<a href="%s">%s</a>', menuLink('', sprintf('menuAction=boViews.exec&viewid=%d', $allRecs[$i][0])), $allRecs[$i][3]);
$options = '';
if ($allRecs[$i][4] == 'workorders') {
$options .= '<a href="' . menuLink('', 'menuAction=htmlWOSearches.ShowView&id=' . $allRecs[$i][0]) . '">' . STR_VW_SETUP . '</a>';
} else {
if ($allRecs[$i][4] == 'tickets') {
$options .= '<a href="' . menuLink('', 'menuAction=htmlTicketSearches.ShowView&id=' . $allRecs[$i][0]) . '">' . STR_VW_SETUP . '</a>';
}
}
if ($allRecs[$i][1] == $GLOBALS['DCLID'] || $g_oSec->HasPerm(DCL_ENTITY_GLOBAL, DCL_PERM_ADMIN)) {
if ($options != '') {
$options .= ' | ';
}
$options .= '<a href="' . menuLink('', 'menuAction=boViews.delete&id=' . $allRecs[$i][0]) . '">' . STR_CMMN_DELETE . '</a>';
}
if ($options == '') {
$options = ' ';
}
$objDBP->Load($allRecs[$i][1]);
$allRecs[$i][1] = $objDBP->short;
$allRecs[$i][] = $options;
}
$oTable->setData($allRecs);
$oTable->setShowRownum(true);
$oTable->render();
}
示例15: Render
function Render($oView)
{
global $dcl_info, $g_oSec, $g_oSession;
commonHeader();
if (!$g_oSec->HasPerm(DCL_ENTITY_BUILDMANAGER, DCL_PERM_VIEW)) {
return PrintPermissionDenied();
}
$oDB = CreateObject('dcl.dbBuildManager');
if ($oDB->query($oView->GetSQL()) == -1) {
return;
}
$allRecs = $oDB->FetchAllRows();
$oTable =& CreateObject('dcl.htmlTable');
$oTable->setCaption($oView->title);
$oTable->addColumn(STR_CMMN_ID, 'numeric');
$oTable->addColumn(STR_BM_RELEASE_ALIAS_TITLE, 'string');
$oTable->addColumn(STR_CMMN_ACTIVE, 'string');
$oTable->addColumn(STR_BM_RELEASEDATE_DESC, 'string');
$oTable->addColumn('Target Date', 'date');
$oTable->addColumn('Actual Date', 'date');
if (isset($this->ModNav) && ($this->ModNav == 'WO' || $this->ModNav == 'showfiles')) {
$oTable->addToolbar(menuLink('', 'menuAction=boProducts.viewRelease&id=' . $this->id), 'Back');
} else {
$oTable->addToolbar(menuLink('', 'menuAction=boBuildManager.add&which=release&product_id=' . $this->productid . '&add=1'), STR_CMMN_NEW);
}
if (count($allRecs) > 0 && $g_oSec->HasPerm(DCL_ENTITY_GLOBAL, DCL_ENTITY_ADMIN)) {
$oTable->addColumn(STR_CMMN_OPTIONS, 'html');
for ($i = 0; $i < count($allRecs); $i++) {
$options = '';
if (isset($this->ModNav)) {
$options = '<a href="' . menuLink('', 'menuAction=boWorkorders.viewjcn&jcn=' . $allRecs[$i][1] . '&seq=' . $allRecs[$i][2]) . '">' . STR_CMMN_VIEW . '</a>';
} else {
$versionid = $allRecs[$i][0];
$options = '<a href="' . menuLink('', 'menuAction=boProducts.viewBuild&product_version_id=' . $versionid . '&product_id=' . $this->productid) . '">' . STR_CMMN_VIEW . '</a>';
$options .= ' | <a href="' . menuLink('', 'menuAction=htmlBuildManagerReleaseForm.Show&product_version_id=' . $versionid . '&product_id=' . $this->productid . '&which=release') . '">' . STR_CMMN_EDIT . '</a>';
$options .= ' | <a href="' . menuLink('', 'menuAction=boBuildManager.ShowWorkOrders&product_version_id=' . $versionid . '&product_id=' . $this->productid . '&from=version') . '">' . STR_CMMN_SHOWVERSION . '</a>';
$options .= ' | <a href="' . menuLink('', 'menuAction=boBuildManager.ShowFiles&product_version_id=' . $versionid . '&product_id=' . $this->productid . '&from=version') . '">' . STR_CMMN_SHOWFILES . '</a>';
}
$allRecs[$i][6] = $options;
}
}
$oTable->setData($allRecs);
$oTable->setShowRownum(true);
$oTable->render();
}