protected function Form_Create() { if (!QApplication::$Login) { QApplication::Redirect('/'); } $this->objVariable = ClassVariable::Load(QApplication::PathInfo(0)); if (!$this->objVariable) { throw new Exception('Invalid Variable Id: ' . QApplication::PathInfo(0)); } $this->lblClass = new QLabel($this); $this->lblClass->Text = $this->objVariable->QcodoClass->Name; $this->lblName = new QLabel($this); $this->lblName->Text = $this->objVariable->Variable->Name; $this->lstVariableGroup = new QListBox($this); $this->lstVariableGroup->Name = 'Variable Group/Classification'; foreach (VariableGroup::LoadAll(QQ::Clause(QQ::OrderBy(QQN::VariableGroup()->OrderNumber))) as $objVariableGroup) { $this->lstVariableGroup->AddItem($objVariableGroup->Name, $objVariableGroup->Id, $objVariableGroup->Id == $this->objVariable->VariableGroupId); } $this->ctlVariable = new VariableControl($this, $this->objVariable->Variable, true, false); $this->ctlVariable->Name = 'Variable Information'; $this->btnSave = new QButton($this); $this->btnSave->Text = 'Save'; $this->btnSave->AddAction(new QClickEvent(), new QServerAction('btnSave_Click')); $this->btnSave->CausesValidation = true; $this->btnCancel = new QButton($this); $this->btnCancel->Text = 'Cancel'; $this->btnCancel->AddAction(new QClickEvent(), new QServerAction('btnCancel_Click')); $this->btnCancel->CausesValidation = false; }
protected function dtgVariableGroup_Bind() { // Get Total Count b/c of Pagination $this->dtgVariableGroup->TotalItemCount = VariableGroup::CountAll(); $objClauses = array(); if ($objClause = $this->dtgVariableGroup->OrderByClause) { array_push($objClauses, $objClause); } if ($objClause = $this->dtgVariableGroup->LimitClause) { array_push($objClauses, $objClause); } $this->dtgVariableGroup->DataSource = VariableGroup::LoadAll($objClauses); }
public function __construct(QcodoClass $objQcodoClass, $objParentControl, $strControlId = null) { parent::__construct($objParentControl, $strControlId); // We're looking at ALL Methods/Operations $this->objQcodoClass = $objQcodoClass; $this->strUrl = 'http://' . $_SERVER['HTTP_HOST'] . '/index.php/' . $this->objQcodoClass->Name . '/Variables'; $this->strTemplate = 'VariablePanel.tpl.php'; $objGroupArray = VariableGroup::LoadAll(QQ::Clause(QQ::OrderBy(QQN::VariableGroup()->OrderNumber))); foreach ($objGroupArray as $objGroup) { $objVariableArray = $this->objQcodoClass->GetVariablesForVariableGroupId($objGroup->Id); $this->objVariableGroupArray[$objGroup->Name] = $objVariableArray; } }
protected function Form_Create() { if (!QApplication::$Login) { QApplication::Redirect('/'); } $this->objProperty = ClassProperty::Load(QApplication::PathInfo(0)); if (!$this->objProperty) { throw new Exception('Invalid ClassProperty Id: ' . QApplication::PathInfo(0)); } $this->lblClass = new QLabel($this); $this->lblClass->Text = $this->objProperty->QcodoClass->Name; $this->lblName = new QLabel($this); $this->lblName->Text = $this->objProperty->Variable->Name; $this->lstVariableGroup = new QListBox($this); $this->lstVariableGroup->Name = 'Property Group/Classification'; foreach (VariableGroup::LoadAll(QQ::Clause(QQ::OrderBy(QQN::VariableGroup()->OrderNumber))) as $objVariableGroup) { $this->lstVariableGroup->AddItem($objVariableGroup->Name, $objVariableGroup->Id, $objVariableGroup->Id == $this->objProperty->VariableGroupId); } $this->lstClassVariable = new QListBox($this); $this->lstClassVariable->Name = 'Linked to Member Variable'; $this->lstClassVariable->AddItem('- None -', null); foreach ($this->objProperty->QcodoClass->GetVariablesForVariableGroupId(null) as $objVariable) { switch ($objVariable->InheritenceState) { case InheritenceState::Interited: $this->lstClassVariable->AddItem($objVariable->Variable->Name . '(inherited)', $objVariable->Id, $this->objProperty->ClassVariableId == $objVariable->Id); break; case InheritenceState::Overrides: $this->lstClassVariable->AddItem($objVariable->Variable->Name . '(overrides)', $objVariable->Id, $this->objProperty->ClassVariableId == $objVariable->Id); break; default: $this->lstClassVariable->AddItem($objVariable->Variable->Name, $objVariable->Id, $this->objProperty->ClassVariableId == $objVariable->Id); break; } } $this->lstClassVariable->AddAction(new QChangeEvent(), new QAjaxAction('lstClassVariable_Change')); $this->ctlVariable = new VariableControl($this, $this->objProperty->Variable, true, false); $this->ctlVariable->Name = 'Property Information'; $this->btnSave = new QButton($this); $this->btnSave->Text = 'Save'; $this->btnSave->AddAction(new QClickEvent(), new QServerAction('btnSave_Click')); $this->btnSave->CausesValidation = true; $this->btnCancel = new QButton($this); $this->btnCancel->Text = 'Cancel'; $this->btnCancel->AddAction(new QClickEvent(), new QServerAction('btnCancel_Click')); $this->btnCancel->CausesValidation = false; $this->lstClassVariable_Change(); }
protected function lstVariableGroup_Create() { $this->lstVariableGroup = new QListBox($this); $this->lstVariableGroup->Name = QApplication::Translate('Variable Group'); $this->lstVariableGroup->AddItem(QApplication::Translate('- Select One -'), null); $objVariableGroupArray = VariableGroup::LoadAll(); if ($objVariableGroupArray) { foreach ($objVariableGroupArray as $objVariableGroup) { $objListItem = new QListItem($objVariableGroup->__toString(), $objVariableGroup->Id); if ($this->objClassProperty->VariableGroup && $this->objClassProperty->VariableGroup->Id == $objVariableGroup->Id) { $objListItem->Selected = true; } $this->lstVariableGroup->AddItem($objListItem); } } }