function GetNavLinks()
 {
     global $g_oSec;
     if (($id = @DCL_Sanitize::ToInt($_REQUEST['personnel_id'])) === null) {
         trigger_error('Data sanitize failed.');
         return;
     }
     if (!$g_oSec->HasPerm(DCL_ENTITY_CHANGELOG, DCL_PERM_VIEW)) {
         return PrintPermissionDenied();
     }
     $sMethod = explode('.', $_REQUEST['menuAction']);
     $sMethod = $sMethod[1];
     $aRetVal = array();
     array_push($aRetVal, array('link' => menuLink('', 'menuAction=htmlMetrics.show'), 'title' => 'Metrics'));
     array_push($aRetVal, array('link' => menuLink('', 'menuAction=htmlChangeLog.ShowRepositoryCommits&personnel_id=' . $id), 'title' => $this->oPersonnel->short));
     if ($sMethod == 'ShowProjectCommits' || $sMethod == 'ShowFileCommits' || $sMethod == 'ShowVersionCommits') {
         if (($sccs_id = @DCL_Sanitize::ToInt($_REQUEST['dcl_sccs_id'])) === null) {
             trigger_error('Data sanitize failed.');
             return;
         }
         $oRepository = CreateObject('dcl.dbSccsXref');
         $sRepository = $oRepository->ExecuteScalar("select sccs_descr from dcl_sccs where dcl_sccs_id = {$sccs_id}");
         array_push($aRetVal, array('link' => menuLink('', 'menuAction=htmlChangeLog.ShowProjectCommits&dcl_sccs_id=' . $sccs_id . '&personnel_id=' . $id), 'title' => $sRepository));
         if ($sMethod == 'ShowFileCommits' || $sMethod == 'ShowVersionCommits') {
             $sccs_project_path = $_REQUEST['sccs_project_path'];
             array_push($aRetVal, array('link' => menuLink('', 'menuAction=htmlChangeLog.ShowFileCommits&dcl_sccs_id=' . $sccs_id . '&personnel_id=' . $id . '&sccs_project_path=' . rawurlencode($sccs_project_path)), 'title' => $sccs_project_path));
             if ($sMethod == 'ShowVersionCommits') {
                 $sccs_file_name = DCL_Sanitize::IsValidFileName($_REQUEST['sccs_file_name']) ? $_REQUEST['sccs_file_name'] : '';
                 array_push($aRetVal, array('link' => menuLink('', 'menuAction=htmlChangeLog.ShowVersionCommits&dcl_sccs_id=' . $sccs_id . '&personnel_id=' . $id . '&sccs_project_path=' . rawurlencode($sccs_project_path) . '&sccs_file_name=' . rawurlencode($sccs_file_name)), 'title' => $sccs_file_name));
             }
         }
     }
     return $aRetVal;
 }
Example #2
0
function renderDCLMenu()
{
    global $dcl_info, $g_oSec, $g_oSession;
    $sTemplateSet = GetDefaultTemplateSet();
    include DCL_ROOT . 'templates/' . $sTemplateSet . '/navbar.php';
    $t =& CreateSmarty();
    $t->assign('DIR_IMAGES', 'templates/' . $sTemplateSet . '/img');
    $t->assign('DIR_CSS', 'templates/' . $sTemplateSet . '/css');
    $t->assign('DIR_JS', 'js');
    $t->assign('LNK_LOGOFF', menuLink('logout.php'));
    if ($g_oSec->IsPublicUser()) {
        $t->assign('LNK_HOME', menuLink('', 'menuAction=htmlPublicMyDCL.show'));
    } else {
        $t->assign('LNK_HOME', menuLink('', 'menuAction=htmlMyDCL.show'));
    }
    $t->assign('LNK_PREFERENCES', menuLink('', 'menuAction=htmlPreferences.modify'));
    $t->assign('TXT_WORKORDERS', DCL_MENU_WORKORDERS);
    $t->assign('TXT_TICKETS', DCL_MENU_TICKETS);
    $t->assign('TXT_PROJECTS', DCL_MENU_PROJECTS);
    $t->assign('TXT_HOME', DCL_MENU_HOME);
    $t->assign('TXT_PREFERENCES', DCL_MENU_PREFERENCES);
    $t->assign('TXT_LOGOFF', DCL_MENU_LOGOFF);
    $t->assign('PERM_WORKORDERSEARCH', $g_oSec->HasPerm(DCL_ENTITY_WORKORDER, DCL_PERM_SEARCH) || $g_oSec->HasPerm(DCL_ENTITY_WORKORDER, DCL_PERM_VIEW));
    $t->assign('PERM_TICKETSEARCH', $g_oSec->HasPerm(DCL_ENTITY_TICKET, DCL_PERM_SEARCH) || $g_oSec->HasPerm(DCL_ENTITY_TICKET, DCL_PERM_VIEW));
    $t->assign('PERM_PROJECTSEARCH', $g_oSec->HasPerm(DCL_ENTITY_PROJECT, DCL_PERM_SEARCH) || $g_oSec->HasPerm(DCL_ENTITY_PROJECT, DCL_PERM_VIEW));
    $t->assign('PERM_PREFS', $g_oSec->HasPerm(DCL_ENTITY_PREFS, DCL_PERM_MODIFY));
    $t->assign('PERM_WORKSPACE', $g_oSec->HasPerm(DCL_ENTITY_WORKSPACE, DCL_PERM_VIEW));
    $t->assign('VAL_WORKSPACE', $g_oSession->Value('workspace'));
    $t->assign('VAL_DCL_MENU', $GLOBALS['DCL_MENU']);
    $oNav = new DCLNavBar();
    $t->assign('NAV_BOXEN', $oNav->getHtml());
    SmartyDisplay($t, 'menu.tpl');
}
 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();
 }
 function ShowUploadFileForm($obj)
 {
     global $dcl_info, $g_oSec;
     if (!$g_oSec->HasPerm(DCL_ENTITY_TICKET, DCL_PERM_ATTACHFILE, $obj->ticketid)) {
         return PrintPermissionDenied();
     }
     $t = CreateSmarty();
     $t->assign('VAL_MAXUPLOADFILESIZE', $dcl_info['DCL_MAX_UPLOAD_FILE_SIZE']);
     $t->assign('VAL_TICKETID', $obj->ticketid);
     $t->assign('LNK_CANCEL', menuLink('', 'menuAction=boTickets.view&ticketid=' . $obj->ticketid));
     SmartyDisplay($t, 'htmlTicketAddAttachment.tpl');
 }
 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');
 }
/**
 * Smarty escape modifier plugin
 *
 * Type:     modifier<br>
 * Name:     escape<br>
 * Purpose:  Escape the string according to escapement type
 * @link http://smarty.php.net/manual/en/language.modifier.escape.php
 *          escape (Smarty online manual)
 * @param string
 * @param html|htmlall|url|quotes|hex|hexentity|javascript
 * @return string
 */
function smarty_modifier_escape($string, $esc_type = 'html')
{
    switch ($esc_type) {
        case 'html':
            return htmlspecialchars($string, ENT_QUOTES);
        case 'htmlall':
            return htmlentities($string, ENT_QUOTES);
        case 'link':
            $sText = nl2br(htmlspecialchars($string));
            $sRetVal = eregi_replace('(http|ftp|telnet|irc|https)://[^<>[:space:]]+[[:alnum:]/]', '<a target="_blank" href="\\0">\\0</a>', $sText);
            // Pseudo stuff
            $sRetVal = eregi_replace('dcl://workorders/([0-9]+)[-]([0-9]+)', '<a href="' . menuLink() . '?menuAction=boWorkorders.viewjcn&jcn=\\1&seq=\\2">\\0</a>', $sRetVal);
            $sRetVal = eregi_replace('dcl://tickets/([0-9]+)', '<a href="' . menuLink() . '?menuAction=boTickets.view&ticketid=\\1">\\0</a>', $sRetVal);
            $sRetVal = eregi_replace('dcl://projects/([0-9]+)', '<a href="' . menuLink() . '?menuAction=boProjects.viewproject&wostatus=0&project=\\1">\\0</a>', $sRetVal);
            return $sRetVal;
        case 'url':
            return urlencode($string);
        case 'date':
            $o = new dclDB();
            return $o->FormatDateForDisplay($string);
        case 'timestamp':
            $o = new dclDB();
            return $o->FormatTimeStampForDisplay($string);
        case 'rawurl':
            return rawurlencode($string);
        case 'quotes':
            // escape unescaped single quotes
            return preg_replace("%(?<!\\\\)'%", "\\'", $string);
        case 'utf8xml':
            return utf8_encode(htmlspecialchars($string, ENT_NOQUOTES));
        case 'hex':
            // escape every character into hex
            $return = '';
            for ($x = 0; $x < strlen($string); $x++) {
                $return .= '%' . bin2hex($string[$x]);
            }
            return $return;
        case 'hexentity':
            $return = '';
            for ($x = 0; $x < strlen($string); $x++) {
                $return .= '&#x' . bin2hex($string[$x]) . ';';
            }
            return $return;
        case 'javascript':
            // escape quotes and backslashes and newlines
            return strtr($string, array('\\' => '\\\\', "'" => "\\'", '"' => '\\"', "\r" => '\\r', "\n" => '\\n'));
        default:
            return $string;
    }
}
 function ShowAll($orderBy = 'contact_type_name')
 {
     global $dcl_info, $g_oSec;
     commonHeader();
     if (!$g_oSec->HasPerm(DCL_ENTITY_CONTACTTYPE, DCL_PERM_VIEW)) {
         return PrintPermissionDenied();
     }
     $o = CreateObject('dcl.boView');
     $o->table = 'dcl_contact_type';
     $o->title = STR_ADMIN_CONTACTTYPES;
     $o->AddDef('columns', '', array('contact_type_id', 'contact_type_name', 'contact_type_is_main'));
     $o->AddDef('columnhdrs', '', array(STR_CMMN_ID, STR_CMMN_NAME, 'Main'));
     $o->AddDef('order', '', $orderBy);
     $oDB = CreateObject('dcl.dbContactType');
     if ($oDB->query($o->GetSQL()) == -1) {
         return;
     }
     $allRecs = $oDB->FetchAllRows();
     $oTable =& CreateObject('dcl.htmlTable');
     $oTable->setCaption(sprintf(STR_ADMIN_CONTACTTYPES, $orderBy));
     $oTable->addColumn(STR_CMMN_ID, 'numeric');
     $oTable->addColumn(STR_CMMN_NAME, 'string');
     $oTable->addColumn('Main', 'string');
     if ($g_oSec->HasPerm(DCL_ENTITY_CONTACTTYPE, DCL_PERM_ADD)) {
         $oTable->addToolbar(menuLink('', 'menuAction=htmlContactType.add'), STR_CMMN_NEW);
     }
     if ($g_oSec->HasPerm(DCL_ENTITY_ADMIN, DCL_PERM_VIEW)) {
         $oTable->addToolbar(menuLink('', 'menuAction=boAdmin.ShowSystemConfig'), DCL_MENU_SYSTEMSETUP);
     }
     if (count($allRecs) > 0 && $g_oSec->HasAnyPerm(array(DCL_ENTITY_CONTACTTYPE => array($g_oSec->PermArray(DCL_PERM_MODIFY), $g_oSec->PermArray(DCL_PERM_DELETE))))) {
         $oTable->addColumn(STR_CMMN_OPTIONS, 'html');
         for ($i = 0; $i < count($allRecs); $i++) {
             $options = '';
             if ($g_oSec->HasPerm(DCL_ENTITY_CONTACTTYPE, DCL_PERM_MODIFY)) {
                 $options = '<a href="' . menuLink('', 'menuAction=htmlContactType.modify&contact_type_id=' . $allRecs[$i][0]) . '">' . STR_CMMN_EDIT . '</a>';
             }
             if ($g_oSec->HasPerm(DCL_ENTITY_CONTACTTYPE, DCL_PERM_DELETE)) {
                 if ($options != '') {
                     $options .= '&nbsp;|&nbsp;';
                 }
                 $options .= '<a href="' . menuLink('', 'menuAction=htmlContactType.delete&contact_type_id=' . $allRecs[$i][0]) . '">' . STR_CMMN_DELETE . '</a>';
             }
             $allRecs[$i][] = $options;
         }
     }
     $oTable->setData($allRecs);
     $oTable->setShowRownum(true);
     $oTable->render();
 }
 function _DisplayOptions()
 {
     global $dcl_info, $g_oSec;
     $this->_SetVar('hDetailColumnLinkSetLinks', '');
     $id = $this->oDB->f('entity_source_id');
     if ($g_oSec->HasPerm(DCL_ENTITY_SOURCE, DCL_PERM_MODIFY)) {
         $this->_AddDisplayOption(STR_CMMN_EDIT, menuLink('', 'menuAction=htmlEntitySource.modify&entity_source_id=' . $id), false);
     }
     if ($g_oSec->HasPerm(DCL_ENTITY_SOURCE, DCL_PERM_DELETE)) {
         $this->_AddDisplayOption(STR_CMMN_DELETE, menuLink('', 'menuAction=htmlEntitySource.delete&entity_source_id=' . $id), true);
     }
     $this->Template->parse('hDetailColumnLinkSet', 'detailColumnLinkSet');
     $this->Template->parse('hDetailCells', 'detailCells', true);
     // this avoids repeating cells
     $this->_ResetDetailCells();
 }
 function _DisplayOptions()
 {
     global $dcl_info, $g_oSec;
     $this->_SetVar('hDetailColumnLinkSetLinks', '');
     $id = $this->oDB->f('product_module_id');
     if ($g_oSec->HasPerm(DCL_ENTITY_PRODUCTMODULE, DCL_PERM_MODIFY)) {
         $this->_AddDisplayOption(STR_CMMN_EDIT, menuLink('', 'menuAction=htmlProductModules.modify&product_module_id=' . $id));
     }
     if ($g_oSec->HasPerm(DCL_ENTITY_PRODUCTMODULE, DCL_PERM_DELETE)) {
         $this->_AddDisplayOption(STR_CMMN_DELETE, menuLink('', 'menuAction=htmlProductModules.delete&product_module_id=' . $id), true);
     }
     $this->Template->parse('hDetailColumnLinkSet', 'detailColumnLinkSet');
     $this->Template->parse('hDetailCells', 'detailCells', true);
     // this avoids repeating cells
     $this->_ResetDetailCells();
 }
function adminMenu()
{
    global $adminlevel, $config;
    if ($adminlevel == "superuser") {
        $html .= menuLink("admins", "administrators");
        $html .= menuLink("groups", "groups");
        $html .= menuLink("users", "users");
        $html .= menuLink("userattributes", "user attributes");
        $req = Sql_Query('select * from attribute where type = "select" or type = "radio" or type = "checkboxgroup"');
        while ($row = Sql_Fetch_Array($req)) {
            $html .= menuLink("editattributes&id=" . $row["id"], "&gt;&nbsp;" . $row["name"]);
        }
        $html .= menuLink("branches", "branch fields", "option=branchfields");
        $html .= menuLink("templates", "templates");
    }
    return $html;
}
 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 .= '&nbsp;|&nbsp;<a href="' . menuLink('', 'menuAction=htmlBuildManagerReleaseForm.Show&product_version_id=' . $versionid . '&product_id=' . $this->productid . '&which=release') . '">' . STR_CMMN_EDIT . '</a>';
                 $options .= '&nbsp;|&nbsp;<a href="' . menuLink('', 'menuAction=boBuildManager.ShowWorkOrders&product_version_id=' . $versionid . '&product_id=' . $this->productid . '&from=version') . '">' . STR_CMMN_SHOWVERSION . '</a>';
                 $options .= '&nbsp;|&nbsp;<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();
 }
 function Show()
 {
     global $dcl_info, $g_oSec;
     commonHeader();
     if (!$g_oSec->HasPerm(DCL_ENTITY_BUILDMANAGER, DCL_PERM_MODIFY)) {
         return PrintPermissionDenied();
     }
     if (($product_id = DCL_Sanitize::ToInt($_REQUEST['product_id'])) === null) {
         return PrintPermissionDenied();
     }
     if (($version_id = DCL_Sanitize::ToInt($_REQUEST['product_version_id'])) === null) {
         return PrintPermissionDenied();
     }
     $oProduct = CreateObject('dcl.dbProducts');
     $oProduct->Load($product_id);
     $oPV = CreateObject('dcl.dbProductVersion');
     if ($oPV->Load(array('product_version_id' => $version_id)) == -1) {
         ShowError('Failed to load version ID ' . $version_id, 'Error');
         return;
     }
     $this->oSmarty->assign('VAL_JSDATEFORMAT', GetJSDateFormat());
     $this->oSmarty->assign('VAL_FORMACTION', menuLink());
     if (isset($GLOBALS['add'])) {
         $this->oSmarty->assign('VAL_MENUACTION', 'boBuildManager.addRelease');
     } else {
         $this->oSmarty->assign('VAL_MENUACTION', 'boBuildManager.modifyRelease');
     }
     $this->oSmarty->assign('TXT_BM_ADD_RELEASE', STR_BM_MOD_RELEASE);
     $this->oSmarty->assign('TXT_BM_PRODUCT', STR_BM_PRODUCT);
     $this->oSmarty->assign('TXT_BM_RELEASE_ALIAS_TITLE', STR_BM_RELEASE_ALIAS_TITLE);
     $this->oSmarty->assign('TXT_BM_RELEASEDATE_DESC', STR_BM_RELEASEDATE_DESC);
     $this->oSmarty->assign('TXT_BM_RELEASEDATE', STR_BM_RELEASEDATE);
     $this->oSmarty->assign('VAL_PRODUCTNAME', $oProduct->name);
     $this->oSmarty->assign('VAL_PRODUCTID', $oProduct->id);
     $this->oSmarty->assign('VAL_VERSIONID', $version_id);
     $this->oSmarty->assign('VAL_VERSIONTEXT', $oPV->product_version_text);
     $this->oSmarty->assign('VAL_VERSIONDESCR', $oPV->product_version_descr);
     $this->oSmarty->assign('VAL_ACTIVE', $oPV->active);
     $this->oSmarty->assign('VAL_VERSIONACTUALDATE', $oPV->product_version_actual_date);
     $this->oSmarty->assign('VAL_VERSIONTARGETDATE', $oPV->product_version_target_date);
     $this->oSmarty->assign('date', $oPV->product_version_target_date);
     $this->oSmarty->assign('VAL_DATEELEMENT', 'product_version_target_date');
     $this->oSmarty->assign('VAL_WHICH', $GLOBALS['which']);
     SmartyDisplay($this->oSmarty, 'htmlBuildManagerReleaseForm.tpl');
 }
 function PrintAll($orderBy = 'name')
 {
     global $dcl_info, $g_oSec;
     if (!$g_oSec->HasPerm(DCL_ENTITY_PRIORITY, DCL_PERM_VIEW)) {
         return PrintPermissionDenied();
     }
     $objDBPriority = CreateObject('dcl.dbPriorities');
     $objDBPriority->Query("SELECT id,active,short,name,weight FROM priorities ORDER BY {$orderBy}");
     $allRecs = $objDBPriority->FetchAllRows();
     $oTable =& CreateObject('dcl.htmlTable');
     $oTable->setCaption(sprintf(STR_PRIO_TABLETITLE, $orderBy));
     $oTable->addColumn(STR_PRIO_ID, 'numeric');
     $oTable->addColumn(STR_PRIO_ACTIVE, 'string');
     $oTable->addColumn(STR_PRIO_SHORT, 'string');
     $oTable->addColumn(STR_PRIO_NAME, 'string');
     $oTable->addColumn(STR_PRIO_WEIGHT, 'numeric');
     if ($g_oSec->HasPerm(DCL_ENTITY_PRIORITY, DCL_PERM_ADD)) {
         $oTable->addToolbar(menuLink('', 'menuAction=boPriorities.add'), STR_CMMN_NEW);
     }
     if ($g_oSec->HasPerm(DCL_ENTITY_ADMIN, DCL_PERM_VIEW)) {
         $oTable->addToolbar(menuLink('', 'menuAction=boAdmin.ShowSystemConfig'), DCL_MENU_SYSTEMSETUP);
     }
     if (count($allRecs) > 0 && $g_oSec->HasAnyPerm(array(DCL_ENTITY_PRIORITY => array($g_oSec->PermArray(DCL_PERM_MODIFY), $g_oSec->PermArray(DCL_PERM_DELETE))))) {
         $oTable->addColumn(STR_PRIO_OPTIONS, 'html');
         $allName[] = STR_PRIO_OPTIONS;
         for ($i = 0; $i < count($allRecs); $i++) {
             $options = '';
             if ($g_oSec->HasPerm(DCL_ENTITY_PRIORITY, DCL_PERM_MODIFY)) {
                 $options = '<a href="' . menuLink('', 'menuAction=boPriorities.modify&id=' . $allRecs[$i][0]) . '">' . htmlentities(STR_CMMN_EDIT) . '</a>';
             }
             if ($g_oSec->HasPerm(DCL_ENTITY_PRIORITY, DCL_PERM_DELETE)) {
                 if ($options != '') {
                     $options .= '&nbsp;|&nbsp;';
                 }
                 $options .= '<a href="' . menuLink('', 'menuAction=boPriorities.delete&id=' . $allRecs[$i][0]) . '">' . htmlentities(STR_CMMN_DELETE) . '</a>';
             }
             $allRecs[$i][] = $options;
         }
     }
     $oTable->setData($allRecs);
     $oTable->setShowRownum(true);
     $oTable->render();
 }
 function PrintAll($orderBy = 'name')
 {
     global $dcl_info, $g_oSec;
     if (!$g_oSec->HasPerm(DCL_ENTITY_STATUS, DCL_PERM_VIEW)) {
         return PrintPermissionDenied();
     }
     $objDBStatus = CreateObject('dcl.dbStatuses');
     $objDBStatus->Query("SELECT a.id,a.active,a.short,a.name,b.dcl_status_type_name FROM statuses a,dcl_status_type b WHERE b.dcl_status_type_id=a.dcl_status_type ORDER BY a.{$orderBy}");
     $allRecs = $objDBStatus->FetchAllRows();
     $oTable =& CreateObject('dcl.htmlTable');
     $oTable->setCaption(sprintf(STR_STAT_TABLETITLE, $orderBy));
     $oTable->addColumn(STR_STAT_ID, 'numeric');
     $oTable->addColumn(STR_STAT_ACTIVE, 'string');
     $oTable->addColumn(STR_STAT_SHORT, 'string');
     $oTable->addColumn(STR_STAT_NAME, 'string');
     $oTable->addColumn(STR_STAT_TYPE, 'string');
     if ($g_oSec->HasPerm(DCL_ENTITY_STATUS, DCL_PERM_ADD)) {
         $oTable->addToolbar(menuLink('', 'menuAction=boStatuses.add'), STR_CMMN_NEW);
     }
     if ($g_oSec->HasPerm(DCL_ENTITY_ADMIN, DCL_PERM_VIEW)) {
         $oTable->addToolbar(menuLink('', 'menuAction=boAdmin.ShowSystemConfig'), DCL_MENU_SYSTEMSETUP);
     }
     if (count($allRecs) > 0 && $g_oSec->HasAnyPerm(array(DCL_ENTITY_STATUS => array($g_oSec->PermArray(DCL_PERM_MODIFY), $g_oSec->PermArray(DCL_PERM_DELETE))))) {
         $oTable->addColumn(STR_CMMN_OPTIONS, 'html');
         for ($i = 0; $i < count($allRecs); $i++) {
             $options = '';
             if ($g_oSec->HasPerm(DCL_ENTITY_STATUS, DCL_PERM_MODIFY)) {
                 $options = '<a href="' . menuLink('', 'menuAction=boStatuses.modify&id=' . $allRecs[$i][0]) . '">' . STR_CMMN_EDIT . '</a>';
             }
             if ($g_oSec->HasPerm(DCL_ENTITY_STATUS, DCL_PERM_DELETE)) {
                 if ($options != '') {
                     $options .= '&nbsp;|&nbsp;';
                 }
                 $options .= '<a href="' . menuLink('', 'menuAction=boStatuses.delete&id=' . $allRecs[$i][0]) . '">' . STR_CMMN_DELETE . '</a>';
             }
             $allRecs[$i][] = $options;
         }
     }
     $oTable->setData($allRecs);
     $oTable->setShowRownum(true);
     $oTable->render();
 }
 function Show($obj)
 {
     global $dcl_info, $g_oSec;
     if (!$g_oSec->HasPerm(DCL_ENTITY_ATTRIBUTESETS, DCL_PERM_VIEW)) {
         return PrintPermissionDenied();
     }
     if (!is_object($obj)) {
         trigger_error('[htmlAttributesets::Show] ' . STR_ATTR_OBJECTNOTPASSED);
         return;
     }
     $t = CreateSmarty();
     $t->assign('VAL_ATTRIBUTESETNAME', $obj->name);
     SmartyDisplay($t, 'htmlAttributesetdetail.tpl');
     $objA = CreateObject('dcl.dbActions');
     $theAttributes = array('actions', 'priorities', 'severities', 'statuses');
     $aTitles = array('actions' => STR_ATTR_ACTIONS, 'priorities' => STR_ATTR_PRIORITIES, 'severities' => STR_ATTR_SEVERITIES, 'statuses' => STR_ATTR_STATUSES);
     for ($cnt = 0; $cnt < count($theAttributes); $cnt++) {
         $typeid = $cnt + 1;
         $section = $theAttributes[$cnt];
         $query = 'SELECT a.name FROM ' . $section . ' a, attributesetsmap b WHERE a.id=b.keyid ';
         $query .= ' AND b.setid=' . $obj->id;
         $query .= ' AND b.typeid=' . $typeid;
         $query .= ' ORDER BY ';
         if ($section == 'priorities' || $section == 'severities') {
             $query .= 'b.weight';
         } else {
             $query .= 'a.name';
         }
         if ($objA->Query($query) != -1) {
             $oTable = CreateObject('dcl.htmlTable');
             $oTable->setCaption($aTitles[$theAttributes[$cnt]]);
             $oTable->setInline(true);
             $oTable->addToolbar(menuLink('', 'menuAction=boAttributesets.showall'), STR_ATTR_ATTRIBUTESET);
             if ($g_oSec->HasPerm(DCL_ENTITY_ATTRIBUTESETS, DCL_PERM_MODIFY)) {
                 $oTable->addToolbar(menuLink('', 'menuAction=boAttributesets.showmapping&setid=' . $obj->id . '&typeid=' . $typeid), STR_ATTR_MAP);
             }
             $oTable->setData($objA->FetchAllRows());
             $oTable->addColumn(STR_CMMN_NAME, 'string');
             $oTable->render();
         }
     }
 }
 function _DisplayOptions()
 {
     global $dcl_info, $g_oSec;
     $id = $this->oDB->f('dcl_chklst_id');
     $this->_SetVar('hDetailColumnLinkSetLinks', '');
     $this->_SetVar('LNK_COLUMNDISABLED', '');
     if ($g_oSec->HasPerm(DCL_ENTITY_FORMS, DCL_PERM_VIEW, $id)) {
         $this->_AddDisplayOption(STR_CMMN_VIEW, menuLink('', 'menuAction=boChecklists.view&dcl_chklst_id=' . $id));
     }
     if ($g_oSec->HasPerm(DCL_ENTITY_FORMS, DCL_PERM_MODIFY, $id)) {
         $this->_AddDisplayOption(STR_CMMN_EDIT, menuLink('', 'menuAction=boChecklists.modify&dcl_chklst_id=' . $id), true);
     }
     if ($g_oSec->HasPerm(DCL_ENTITY_FORMS, DCL_PERM_DELETE, $id)) {
         $this->_AddDisplayOption(STR_CMMN_DELETE, menuLink('', 'menuAction=boChecklists.delete&dcl_chklst_id=' . $id), true);
     }
     $this->Template->parse('hDetailColumnLinkSet', 'detailColumnLinkSet');
     $this->Template->parse('hDetailCells', 'detailCells', true);
     // this avoids repeating cells
     $this->_ResetDetailCells();
 }
 function Show()
 {
     global $dcl_info, $g_oSec, $g_oSession;
     commonHeader();
     if (!$g_oSec->HasPerm(DCL_ENTITY_SESSION, DCL_PERM_VIEW)) {
         return PrintPermissionDenied();
     }
     $oView = CreateObject('dcl.boView');
     $oView->table = 'dcl_session';
     $oView->style = 'report';
     $oView->title = 'DCL Sessions';
     $oView->AddDef('columns', '', array('personnel.short', 'create_date', 'update_date', 'dcl_session_id'));
     $oView->AddDef('order', '', array('personnel.short', 'create_date'));
     $oView->AddDef('columnhdrs', '', array('User', 'Login Date', 'Last Access', 'Session ID'));
     $oDB = CreateObject('dcl.dbSession');
     if ($oDB->query($oView->GetSQL()) == -1) {
         return;
     }
     $allRecs = $oDB->FetchAllRows();
     $oTable =& CreateObject('dcl.htmlTable');
     $oTable->setCaption($oView->title);
     $oTable->addColumn('User', 'string');
     $oTable->addColumn('Login Date', 'string');
     $oTable->addColumn('Last Access', 'string');
     $oTable->addColumn('Session ID', 'string');
     $oTable->addToolbar(menuLink('', 'menuAction=htmlSession.Show'), 'Refresh');
     $oTable->addToolbar(menuLink('', 'menuAction=htmlSession.Detail'), STR_CMMN_VIEW);
     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 ($allRecs[$i][3] != $g_oSession->dcl_session_id) {
                 $options = '<a href="' . menuLink('', 'menuAction=htmlSession.Kill&session_id=' . $allRecs[$i][3]) . '">' . 'Kill' . '</a>';
             }
             $allRecs[$i][] = $options;
         }
     }
     $oTable->setData($allRecs);
     $oTable->setShowRownum(true);
     $oTable->render();
 }
 function _SetActionFormOptions()
 {
     $aLinks = array('New' => menuLink('', 'menuAction=boBuildManager.add&which=release&product_id=' . $this->productid . '&add=1'));
     $aTitle = array('My Information');
     $this->_SetVar('hActionLinkSetLinks', '');
     $bFirst = true;
     foreach ($aLinks as $sText => $sLink) {
         if ($bFirst) {
             $bFirst = false;
         } else {
             $this->Template->parse('hActionLinkSetLinks', 'actionLinkSetSep', true);
         }
         $this->_SetVar('LNK_ACTIONVALUE', $sLink);
         $this->_SetVar('VAL_ACTIONVALUE', $sText);
         foreach ($aTitle as $Title => $sTitle) {
             $this->_SetVar('VAL_ACTIONTITLE', $sTitle);
         }
         $this->Template->parse('hActionLinkSetLinks', 'actionLinkSetLink', true);
     }
     $this->Template->parse('hActionLinkSet', 'actionLinkSet');
     $this->Template->parse('hActions', 'actions');
 }
 function cloud()
 {
     global $g_oSec;
     commonHeader();
     if (!$g_oSec->HasPerm(DCL_ENTITY_WORKORDER, DCL_PERM_SEARCH) && !$g_oSec->HasPerm(DCL_ENTITY_TICKET, DCL_PERM_SEARCH)) {
         PrintPermissionDenied();
         return;
     }
     $oDB = CreateObject('dcl.dbHotlist');
     $oDB->listByPopular();
     $allRecs = $oDB->FetchAllRows();
     $oTable =& CreateObject('dcl.htmlTable');
     $oTable->setCaption('Popular Hotlists');
     $oTable->addColumn(STR_CMMN_TAGS, 'html');
     $oTable->addColumn('Count', 'numeric');
     for ($i = 0; $i < count($allRecs); $i++) {
         $allRecs[$i][0] = '<a href="' . menuLink('', 'menuAction=htmlHotlists.browse&tag=' . urlencode($allRecs[$i][0])) . '">' . htmlspecialchars($allRecs[$i][0]) . '</a>';
     }
     $oTable->setData($allRecs);
     $oTable->setShowRownum(true);
     $oTable->render();
 }
 function _DisplayOptions()
 {
     global $dcl_info, $g_oSec;
     $this->_SetVar('hDetailColumnLinkSetLinks', '');
     $id = $this->oDB->f('dcl_chklst_tpl_id');
     if ($g_oSec->HasPerm(DCL_ENTITY_FORMS, DCL_PERM_ADD)) {
         $this->_AddDisplayOption(STR_CHK_INITIATE, menuLink('', 'menuAction=boChecklists.add&dcl_chklst_tpl_id=' . $id), false, $this->oDB->f('dcl_chklst_tpl_active') != 'Y');
     }
     if ($g_oSec->HasPerm(DCL_ENTITY_FORMTEMPLATES, DCL_PERM_VIEW, $id)) {
         $this->_AddDisplayOption(STR_CMMN_VIEW, menuLink('', 'menuAction=boChecklistTpl.view&dcl_chklst_tpl_id=' . $id), true);
     }
     if ($g_oSec->HasPerm(DCL_ENTITY_FORMTEMPLATES, DCL_PERM_MODIFY, $id)) {
         $this->_AddDisplayOption(STR_CMMN_EDIT, menuLink('', 'menuAction=boChecklistTpl.modify&dcl_chklst_tpl_id=' . $id), true);
     }
     if ($g_oSec->HasPerm(DCL_ENTITY_FORMTEMPLATES, DCL_PERM_DELETE, $id)) {
         $this->_AddDisplayOption(STR_CMMN_DELETE, menuLink('', 'menuAction=boChecklistTpl.delete&dcl_chklst_tpl_id=' . $id), true);
     }
     $this->Template->parse('hDetailColumnLinkSet', 'detailColumnLinkSet');
     $this->Template->parse('hDetailCells', 'detailCells', true);
     // this avoids repeating cells
     $this->_ResetDetailCells();
 }
 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->addColumn(STR_CMMN_ID, 'numeric');
     $oTable->addColumn('Version ID', 'numeric');
     $oTable->addColumn(STR_BM_RELEASEDATE_DESC, 'string');
     $oMeta =& CreateObject('dcl.DCL_MetadataDisplay');
     $oProductVersion = CreateObject('dcl.dbProductVersion');
     $oProductVersion->Load(array('product_version_id' => $this->product_version_id));
     $oTable->setCaption($oView->title . ': ' . $oProductVersion->product_version_text);
     $oTable->addToolbar(menuLink('', 'menuAction=boBuildManager.add&which=build&product_id=' . $this->productid . '&product_version_id=' . $this->product_version_id), STR_CMMN_NEW);
     $oTable->addToolbar(menuLink('', 'menuAction=boProducts.viewRelease&id=' . $this->productid), $oMeta->GetProduct($this->productid));
     $oTable->addToolbar(menuLink('', 'menuAction=boProducts.viewBuild&product_version_id=' . $this->product_version_id . '&product_id=' . $this->productid), STR_CMMN_REFRESH);
     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++) {
             $buildid = $allRecs[$i][0];
             $versionid = $allRecs[$i][1];
             $options = '<a href="' . menuLink('', 'menuAction=htmlBuildManager.ShowWOByBuild&product_build_id=' . $buildid . '&product_id=' . $this->productid) . '">' . STR_CMMN_VIEW . '</a>';
             $options .= '&nbsp;|&nbsp;<a href="' . menuLink('', 'menuAction=htmlBuildManager.ModifyBuildInfo&buildid=' . $buildid . '&product_id=' . $this->productid . '&product_version_id=' . $versionid . '&which=build') . '">' . STR_CMMN_EDIT . '</a>';
             $allRecs[$i][3] = $options;
         }
     }
     $oTable->setData($allRecs);
     $oTable->setShowRownum(true);
     $oTable->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->addColumn(STR_WO_JCN, 'html');
     $oTable->addColumn(STR_WO_SEQ, 'html');
     $oTable->addColumn(STR_WO_SUMMARY, 'string');
     $oTable->addColumn(STR_WO_STATUS, 'string');
     $oTable->setCaption($oView->title);
     if (!$this->buildid) {
         $menuAction = 'menuAction=boproducts.viewRelease&id=' . $this->productid;
     } else {
         $menuAction = 'menuAction=boProducts.viewBuild&product_version_id=' . $this->versionid . '&product_id=' . $this->productid;
     }
     $oTable->addToolbar(menuLink('', $menuAction), 'Back');
     if (count($allRecs) > 0 && $g_oSec->HasPerm(DCL_ENTITY_WORKORDER, DCL_PERM_VIEW)) {
         for ($i = 0; $i < count($allRecs); $i++) {
             $jcn = $allRecs[$i][0];
             $seq = $allRecs[$i][1];
             $allRecs[$i][0] = '<a href="' . menuLink('', 'menuAction=boWorkorders.viewjcn&jcn=' . $jcn . '&seq=' . $seq) . '">' . $jcn . '</a>';
             $allRecs[$i][1] = '<a href="' . menuLink('', 'menuAction=boWorkorders.viewjcn&jcn=' . $jcn . '&seq=' . $seq) . '">' . $seq . '</a>';
         }
     }
     $oTable->setData($allRecs);
     $oTable->setShowRownum(true);
     $oTable->render();
 }
/**
* Saves the typed content item
*/
function save($option, $task)
{
    global $database, $my, $mosConfig_offset;
    josSpoofCheck();
    $nullDate = $database->getNullDate();
    $menu = strval(mosGetParam($_POST, 'menu', 'mainmenu'));
    $menuid = intval(mosGetParam($_POST, 'menuid', 0));
    $row = new mosContent($database);
    if (!$row->bind($_POST)) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    if ($row->id) {
        $row->modified = date('Y-m-d H:i:s');
        $row->modified_by = $my->id;
    }
    $row->created_by = $row->created_by ? $row->created_by : $my->id;
    if ($row->created && strlen(trim($row->created)) <= 10) {
        $row->created .= ' 00:00:00';
    }
    $row->created = $row->created ? mosFormatDate($row->created, _CURRENT_SERVER_TIME_FORMAT, -$mosConfig_offset) : date('Y-m-d H:i:s');
    if (strlen(trim($row->publish_up)) <= 10) {
        $row->publish_up .= ' 00:00:00';
    }
    $row->publish_up = mosFormatDate($row->publish_up, _CURRENT_SERVER_TIME_FORMAT, -$mosConfig_offset);
    if (trim($row->publish_down) == 'Never' || trim($row->publish_down) == '') {
        $row->publish_down = $nullDate;
    } else {
        if (strlen(trim($row->publish_down)) <= 10) {
            $row->publish_down .= ' 00:00:00';
        }
        $row->publish_down = mosFormatDate($row->publish_down, _CURRENT_SERVER_TIME_FORMAT, -$mosConfig_offset);
    }
    $row->state = intval(mosGetParam($_REQUEST, 'published', 0));
    // Save Parameters
    $params = mosGetParam($_POST, 'params', '');
    if (is_array($params)) {
        $txt = array();
        foreach ($params as $k => $v) {
            $txt[] = "{$k}={$v}";
        }
        $row->attribs = implode("\n", $txt);
    }
    // code cleaner for xhtml transitional compliance
    $row->introtext = str_replace('<br>', '<br />', $row->introtext);
    $row->title = ampReplace($row->title);
    if (!$row->check()) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    if (!$row->store()) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    $row->checkin();
    // clean any existing cache files
    mosCache::cleanCache('com_content');
    switch ($task) {
        case 'go2menu':
            mosRedirect('index2.php?option=com_menus&menutype=' . $menu);
            break;
        case 'go2menuitem':
            mosRedirect('index2.php?option=com_menus&menutype=' . $menu . '&task=edit&hidemainmenu=1&id=' . $menuid);
            break;
        case 'menulink':
            menuLink($option, $row->id);
            break;
        case 'resethits':
            resethits($option, $row->id);
            break;
        case 'save':
            $msg = 'Typed Content Item saved';
            mosRedirect('index2.php?option=' . $option, $msg);
            break;
        case 'apply':
        default:
            $msg = 'Changes to Typed Content Item saved';
            mosRedirect('index2.php?option=' . $option . '&task=edit&hidemainmenu=1&id=' . $row->id, $msg);
            break;
    }
}
 function ShowEntryForm($obj = '')
 {
     global $dcl_info, $g_oSec;
     $isEdit = is_object($obj);
     if (!$isEdit) {
         if (!$g_oSec->HasPerm(DCL_ENTITY_ORG, DCL_PERM_MODIFY)) {
             return PrintPermissionDenied();
         }
     } else {
         if (!$g_oSec->HasPerm(DCL_ENTITY_ORG, DCL_PERM_ADD)) {
             return PrintPermissionDenied();
         }
     }
     $oSmarty =& CreateSmarty();
     if (isset($_REQUEST['return_to'])) {
         $oSmarty->assign('return_to', $_REQUEST['return_to']);
         $oSmarty->assign('URL_BACK', menuLink('', $_REQUEST['return_to']));
     } else {
         $oSmarty->assign('URL_BACK', menuLink('', 'menuAction=htmlOrgBrowse.show&filterActive=Y'));
     }
     if (isset($_REQUEST['hideMenu'])) {
         $oSmarty->assign('hideMenu', $_REQUEST['hideMenu']);
     }
     if ($isEdit) {
         $oSmarty->assign('VAL_MENUACTION', 'htmlOrgForm.submitModify');
         $oSmarty->assign('VAL_NAME', $obj->name);
         $oSmarty->assign('VAL_ORGID', $obj->org_id);
         $oSmarty->assign('VAL_ACTIVE', $obj->active);
         $oSmarty->assign('TXT_FUNCTION', 'Edit Organization');
         $oOrgType =& CreateObject('dcl.dbOrgType');
         $oSmarty->assign('orgTypes', $oOrgType->GetTypes($obj->org_id));
         SmartyDisplay($oSmarty, 'htmlOrgForm.tpl');
     } else {
         $oSmarty->assign('TXT_FUNCTION', 'Add New Organization');
         $oSmarty->assign('VAL_MENUACTION', 'htmlOrgForm.submitAdd');
         $oAddrType = CreateObject('dcl.htmlAddrType');
         $oSmarty->assign('CMB_ADDRTYPE', $oAddrType->GetCombo());
         $oEmailType = CreateObject('dcl.htmlEmailType');
         $oSmarty->assign('CMB_EMAILTYPE', $oEmailType->GetCombo());
         $oPhoneType = CreateObject('dcl.htmlPhoneType');
         $oSmarty->assign('CMB_PHONETYPE', $oPhoneType->GetCombo());
         $oUrlType = CreateObject('dcl.htmlUrlType');
         $oSmarty->assign('CMB_URLTYPE', $oUrlType->GetCombo());
         $oOrgType =& CreateObject('dcl.dbOrgType');
         $oSmarty->assign('orgTypes', $oOrgType->GetTypes());
         SmartyDisplay($oSmarty, 'htmlNewOrgForm.tpl');
     }
 }
 function show($id, $file, $bIsView = false)
 {
     global $g_oSec;
     commonHeader();
     if (!$g_oSec->HasPerm(DCL_ENTITY_FORMS, DCL_PERM_VIEW)) {
         return PrintPermissionDenied();
     }
     $this->xml = CreateObject('dcl.xmlDoc');
     $this->xml->ParseFile($file);
     $t =& CreateSmarty();
     $t->assign_by_ref('root', $this->xml->root);
     SmartyDisplay($t, 'htmlChecklistForm.tpl');
     echo '<form class="styled" method="post" action="' . menuLink() . '">';
     if (!$bIsView) {
         echo GetHiddenVar('menuAction', 'boChecklists.dbmodify');
         echo GetHiddenVar('dcl_chklst_id', $id);
     }
     $this->bFirstState = true;
     $this->bIsView = $bIsView;
     $this->RenderNode($this->xml->root);
     if (!$this->bFirstState) {
         echo '</fieldset>';
     }
     echo '<fieldset><div class="submit">';
     if (!$bIsView) {
         echo '<input type="submit" value="' . STR_CMMN_SAVE . '">';
     }
     echo '<input type="button" value="' . STR_CMMN_CANCEL . '" onclick="location.href=\'' . menuLink('', 'menuAction=boChecklists.show') . '\';"></div></fieldset></form>';
 }
 function PrintAll($orderBy = 'name')
 {
     global $g_oSec, $g_oSession;
     commonHeader();
     if (!$g_oSec->HasPerm(DCL_ENTITY_PRODUCT, DCL_PERM_VIEW)) {
         return PrintPermissionDenied();
     }
     $filterLead = @DCL_Sanitize::ToInt($_REQUEST['filterLead']);
     $objDBProduct = CreateObject('dcl.dbProducts');
     $query = 'SELECT a.id,a.active,a.short,a.name,b.short,c.short,d.name,e.name,a.is_versioned,a.is_public,a.is_project_required ';
     $query .= 'FROM products a,personnel b,personnel c,attributesets d,attributesets e ';
     $query .= 'WHERE a.reportto=b.id AND a.ticketsto=c.id ';
     $query .= 'AND a.wosetid=d.id AND a.tcksetid=e.id';
     if ($filterLead !== null) {
         $query .= ' AND (a.reportto=' . $filterLead . ' OR a.ticketsto=' . $filterLead . ')';
     }
     if ($g_oSec->IsPublicUser()) {
         $query .= " AND is_public = 'Y'";
     }
     if ($g_oSec->IsOrgUser() || $g_oSession->IsInWorkspace()) {
         $query .= ' AND a.id IN (' . join(',', $g_oSession->GetProductFilter()) . ')';
     }
     $query .= " ORDER BY a.{$orderBy}";
     $objDBProduct->Query($query);
     $allRecs = $objDBProduct->FetchAllRows();
     $oTable =& CreateObject('dcl.htmlTable');
     $oTable->setCaption('Products');
     $oTable->addColumn(STR_PROD_ID, 'numeric');
     $oTable->addColumn(STR_PROD_ACTIVEABB, 'string');
     $oTable->addColumn(STR_PROD_SHORT, 'string');
     $oTable->addColumn(STR_PROD_NAME, 'string');
     $oTable->addColumn(STR_PROD_REPORTTO, 'string');
     $oTable->addColumn(STR_PROD_TICKETSTO, 'string');
     $oTable->addColumn(STR_PROD_WOATTR, 'string');
     $oTable->addColumn(STR_PROD_TCKATTR, 'string');
     $oTable->addColumn(STR_PROD_VERSIONED, 'string');
     $oTable->addColumn(STR_CMMN_PUBLIC, 'string');
     $oTable->addColumn('Project Req', 'string');
     $oTable->addColumn(STR_CMMN_OPTIONS, 'html');
     if ($g_oSec->HasPerm(DCL_ENTITY_PRODUCT, DCL_PERM_ADD)) {
         $oTable->addToolbar(menuLink('', 'menuAction=htmlProducts.add'), STR_CMMN_NEW);
     }
     $oTable->addToolbar(menuLink('', 'menuAction=htmlProductDashboard.ShowAll'), 'Dashboard');
     if ($g_oSec->HasPerm(DCL_ENTITY_ADMIN, DCL_PERM_VIEW)) {
         $oTable->addToolbar(menuLink('', 'menuAction=boAdmin.ShowSystemConfig'), DCL_MENU_SYSTEMSETUP);
     }
     for ($i = 0; $i < count($allRecs); $i++) {
         $allRecs[$i][1] = $allRecs[$i][1] == 'Y' ? STR_CMMN_YES : STR_CMMN_NO;
         $allRecs[$i][8] = $allRecs[$i][8] == 'Y' ? STR_CMMN_YES : STR_CMMN_NO;
         $allRecs[$i][9] = $allRecs[$i][9] == 'Y' ? STR_CMMN_YES : STR_CMMN_NO;
         $allRecs[$i][10] = $allRecs[$i][10] == 'Y' ? STR_CMMN_YES : STR_CMMN_NO;
         $options = '<a href="' . menuLink('', 'menuAction=boProducts.view&id=' . $allRecs[$i][0]) . '">' . STR_CMMN_VIEW . '</a>';
         if ($g_oSec->HasPerm(DCL_ENTITY_PRODUCT, DCL_PERM_VIEWWIKI)) {
             $options .= '&nbsp;|&nbsp;<a href="' . menuLink('', 'menuAction=htmlWiki.show&name=FrontPage&type=4&id=' . $allRecs[$i][0]) . '">' . STR_CMMN_WIKI . '</a>';
         }
         $allRecs[$i][] = $options;
     }
     $oTable->setData($allRecs);
     $oTable->setShowRownum(true);
     $oTable->render();
 }
 function ShowEntryForm($obj = '')
 {
     global $dcl_info, $g_oSec;
     $isEdit = is_object($obj);
     if (!$g_oSec->HasPerm(DCL_ENTITY_CONTACT, DCL_PERM_MODIFY)) {
         return PrintPermissionDenied();
     }
     if (($id = DCL_Sanitize::ToInt($_REQUEST['contact_id'])) === null) {
         trigger_error('Data sanitize failed.');
         return;
     }
     $oSmarty =& CreateSmarty();
     $oAddrType =& CreateObject('dcl.htmlAddrType');
     $oSmarty->assign('URL_BACK', menuLink('', 'menuAction=htmlContactDetail.show&contact_id=' . $id));
     $oContact = CreateObject('dcl.dbContact');
     $oContact->Load($_REQUEST['contact_id']);
     $oSmarty->assign('VAL_FIRSTNAME', $oContact->first_name);
     $oSmarty->assign('VAL_LASTNAME', $oContact->last_name);
     $oSmarty->assign('VAL_CONTACTID', $oContact->contact_id);
     if ($isEdit) {
         $oSmarty->assign('VAL_MENUACTION', 'htmlContactAddress.submitModify');
         $oSmarty->assign('VAL_CONTACTADDRID', $obj->contact_addr_id);
         $oSmarty->assign('VAL_ADD1', $obj->add1);
         $oSmarty->assign('VAL_ADD2', $obj->add2);
         $oSmarty->assign('VAL_CITY', $obj->city);
         $oSmarty->assign('VAL_STATE', $obj->state);
         $oSmarty->assign('VAL_ZIP', $obj->zip);
         $oSmarty->assign('VAL_COUNTRY', $obj->country);
         $oSmarty->assign('VAL_PREFERRED', $obj->preferred);
         $oSmarty->assign('CMB_ADDRTYPE', $oAddrType->GetCombo($obj->addr_type_id));
         $oSmarty->assign('TXT_FUNCTION', 'Edit Contact Address');
     } else {
         $oSmarty->assign('TXT_FUNCTION', 'Add New Contact Address');
         $oSmarty->assign('VAL_MENUACTION', 'htmlContactAddress.submitAdd');
         $oSmarty->assign('CMB_ADDRTYPE', $oAddrType->GetCombo());
     }
     SmartyDisplay($oSmarty, 'htmlAddrForm.tpl');
 }
 function SubmitSelectedWO($selected)
 {
     commonHeader();
     global $dcl_info;
     $Template = CreateTemplate(array('hForm' => 'htmlBuildManagerEntry.tpl'));
     $Template->set_var('COLOR_LIGHT', $dcl_info['DCL_COLOR_LIGHT']);
     $Template->set_var('VAL_FORMACTION', menuLink());
     $Template->set_var('TXT_BM_ADD_RELEASE', STR_BM_ADDBUILD_TITLE);
     $Template->set_var('TXT_BM_VERSIONNAME', STR_BM_VERSIONNAME);
     $Template->set_var('TXT_BM_BUILDNAME', STR_BM_BUILDNAME);
     $Template->set_var('CMB_PRODUCT', $this->GetCombo($_REQUEST['DCLID'], 'project', 'name'));
     $Template->set_var('BTN_SUBMIT', STR_BM_SUBMIT);
     $Template->pparse('out', 'hForm');
     $objWO = CreateObject('dcl.dbWorkorders');
     $objWO->Connect();
     while (list($key, $jcnseq) = each($selected)) {
         list($jcn, $seq) = explode('.', $jcnseq);
         $sql = "SELECT jcn,seq,status,summary FROM workorders where jcn={$jcn} and seq={$seq}";
         $objWO->Query($sql);
         while ($objWO->next_record()) {
             echo $objWO->f(3);
             echo "<BR>";
         }
     }
 }
 function _DisplayDetailHeader()
 {
     global $dcl_info;
     if (!$this->bNeedsHeader) {
         return;
     }
     $this->_SetVar('hDetailHeader', '');
     $this->_SetVar('hDetailHeaderCells', '');
     $this->_ResetDetailHeaderCells();
     if (count($this->oView->groups) > 0) {
         $this->_SetVar('VAL_DETAILHEADERPADDING', (count($this->oView->groups) + 1) * 20);
         $this->Template->parse('hDetailHeaderPadding', 'detailHeaderPadding');
         $this->Template->parse('hDetailHeaderCells', 'detailHeaderCells', true);
         // this avoids repeating cells
         $this->_ResetDetailHeaderCells();
     }
     $iOffset = 0;
     for ($i = count($this->oView->groups); $i < count($this->oView->groups) + count($this->oView->columns) + $iOffset; $i++) {
         if (count($this->oView->columnhdrs) > 0) {
             $sHdr = $this->oView->columnhdrs[$i];
         } else {
             $sHdr = $this->oDB->GetFieldName($i);
         }
         $this->_SetVar('VAL_COLUMNHEADER', $sHdr);
         if ($this->bColumnSort) {
             $this->oView->ClearDef('order');
             $this->oView->AddDef('order', $this->oView->columns[$i - count($this->oView->groups)], '');
             $this->_SetVar('LNK_COLUMNHEADER', menuLink('', 'menuAction=' . $this->sPagingMenuAction . '&' . $this->oView->GetURL()));
             $this->Template->parse('hDetailHeaderColumnLink', 'detailHeaderColumnLink');
         } else {
             $this->Template->parse('hDetailHeaderColumnText', 'detailHeaderColumnText');
         }
         $this->Template->parse('hDetailHeaderCells', 'detailHeaderCells', true);
         // this avoids repeating cells
         $this->_ResetDetailHeaderCells();
     }
     if ($this->sColumnTitle != '') {
         $this->_SetVar('VAL_COLUMNHEADER', $this->sColumnTitle);
         $this->Template->parse('hDetailHeaderColumnText', 'detailHeaderColumnText');
         $this->Template->parse('hDetailHeaderCells', 'detailHeaderCells', true);
     }
     $this->bNeedsHeader = false;
     $row = 0;
     $this->Template->parse('hDetailHeader', 'detailHeader');
 }
function &CreateSmarty()
{
    require_once DCL_ROOT . 'inc/Smarty.class.php';
    $sDefaultTemplateSet = GetDefaultTemplateSet();
    $oSmarty = new Smarty();
    $oSmarty->assign('DIR_JS', DCL_WWW_ROOT . "js/");
    $oSmarty->assign('DIR_CSS', DCL_WWW_ROOT . "templates/{$sDefaultTemplateSet}/css/");
    $oSmarty->assign('DIR_IMG', DCL_WWW_ROOT . "templates/{$sDefaultTemplateSet}/img/");
    $oSmarty->assign('WWW_ROOT', DCL_WWW_ROOT);
    $oSmarty->assign('URL_MAIN_PHP', menuLink());
    return $oSmarty;
}