function Show($obj = '') { global $dcl_info, $g_oSec; if (!$g_oSec->HasPerm(DCL_ENTITY_LOOKUP, $this->mode == DCL_MODE_EDIT ? DCL_PERM_MODIFY : DCL_PERM_ADD)) { return PrintPermissionDenied(); } $Template = CreateTemplate(array('hForm' => 'htmlLookup.tpl')); $Template->set_var('VAL_FORMACTION', menuLink()); $Template->set_var('BTN_SAVE', STR_CMMN_SAVE); $Template->set_var('BTN_RESET', STR_CMMN_RESET); $Template->set_var('CMB_ACTIVE', GetYesNoCombo($this->active, 'dcl_lookup_active', 0, false)); $Template->set_var('VAL_NAME', htmlspecialchars($this->name)); $Template->set_var('TXT_NAME', STR_LKP_NAME); $Template->set_var('TXT_ACTIVE', STR_LKP_ACTIVE); $Template->set_var('TXT_HIGHLIGHTEDNOTE', STR_CMMN_HIGHLIGHTEDNOTE); if ($this->mode == DCL_MODE_EDIT) { $Template->set_var('TXT_TITLE', STR_LKP_EDITTITLE); $hiddenvars = GetHiddenVar('menuAction', 'boLookup.dbmodify'); $hiddenvars .= GetHiddenVar('dcl_lookup_id', $this->id); } else { $Template->set_var('TXT_TITLE', STR_LKP_ADDTITLE); $hiddenvars = GetHiddenVar('menuAction', 'boLookup.dbadd'); } $Template->set_var('HIDDEN_VARS', $hiddenvars); $Template->pparse('out', 'hForm'); }
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>'; }
} if (!$serverRec->poweredUp) { throw new Exception(sprintf($errServerIsDown, $selectedServer)); } // Get submitted data if (array_key_exists($selectedItemID, $_POST)) { $selectedItem = $_POST[$selectedItemID]; } if (array_key_exists($selectedItemID, $_POST)) { $selectedItem = $_POST[$selectedItemID]; } if (array_key_exists($viewSelectionID, $_POST)) { $viewSelection = $_POST[$viewSelectionID] == 'true'; } // Are we switching to another page? $nextPage = GetHiddenVar(NEXT_PAGE_ID); if ($nextPage != "") { $selectedLog = $selectedItem; SwitchToPage($nextPage); } // Create a ServerAdmin object. $serverAdmin = new MgServerAdmin(); $serverAdmin->Open($selectedServer, $userInfo); // Are we deleting the selected file? if (CheckForDeleteSelection()) { $serverAdmin->DeleteLog($selectedItem); $confirmationMsg = sprintf($confSuccessfulDeletion, $selectedItem); } } catch (MgException $e) { CheckForFatalMgException($e); $errorMsg = $e->GetExceptionMessage();
function CheckForDeleteSelection() { if (GetHiddenVar(DELETE_SELECTION_ID) == "true") { return true; } else { return false; } }
function ShowTree($projectid, $wostatus, $woresponsible) { global $dcl_info, $g_oSec; if (!$g_oSec->HasPerm(DCL_ENTITY_PROJECT, DCL_PERM_VIEW, $projectid)) { return PrintPermissionDenied(); } $obj = CreateObject('dcl.dbProjects'); if ($obj->Load($projectid) == -1) { return; } echo '<center>'; echo '<h3>Tree View of Project: ', $obj->name, '</h3>'; if ($obj->parentprojectid > 0) { $oParent = $obj; $oParent->Load($obj->parentprojectid); echo 'Parent Project: ', $this->GetTreeLink($oParent->projectid, $oParent->name, $wostatus, $woresponsible); } echo '<form action="' . menuLink('') . '" method="post">'; echo GetHiddenVar('project', $projectid); echo GetHiddenVar('menuAction', 'boProjects.showtree'); $objStat = CreateObject('dcl.htmlStatuses'); $objPersonnel = CreateObject('dcl.htmlPersonnel'); echo '<b>', STR_PRJ_FILTERWOBYSTATUS, ':</b>'; echo $objStat->GetCombo($wostatus, 'wostatus'); echo ' <b>', STR_PRJ_FILTERWOBYRESPONSIBLE, ':</b>'; echo $objPersonnel->GetCombo($woresponsible, 'woresponsible', 'short', 0, false, $dcl_info['DCL_HAVE_WO']); echo '<input type="submit" value="', STR_CMMN_FILTER, '"></form><p>'; echo '<table border="0">'; $this->DisplayProjectTasks($projectid, $wostatus, $woresponsible); $this->DisplayChildProjects($projectid, $wostatus, $woresponsible, 1); echo '</table></center>'; }