Example #1
0
 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);
 }
Example #3
0
 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;
     }
 }
Example #4
0
 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 SetupVariableGroup()
 {
     // Lookup Object PK information from Query String (if applicable)
     // Set mode to Edit or New depending on what's found
     $intId = QApplication::QueryString('intId');
     if ($intId) {
         $this->objVariableGroup = VariableGroup::Load($intId);
         if (!$this->objVariableGroup) {
             throw new Exception('Could not find a VariableGroup object with PK arguments: ' . $intId);
         }
         $this->strTitleVerb = QApplication::Translate('Edit');
         $this->blnEditMode = true;
     } else {
         $this->objVariableGroup = new VariableGroup();
         $this->strTitleVerb = QApplication::Translate('Create');
         $this->blnEditMode = false;
     }
 }
 public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects)
 {
     if ($objObject->objQcodoClass) {
         $objObject->objQcodoClass = QcodoClass::GetSoapObjectFromObject($objObject->objQcodoClass, false);
     } else {
         if (!$blnBindRelatedObjects) {
             $objObject->intQcodoClassId = null;
         }
     }
     if ($objObject->objVariableGroup) {
         $objObject->objVariableGroup = VariableGroup::GetSoapObjectFromObject($objObject->objVariableGroup, false);
     } else {
         if (!$blnBindRelatedObjects) {
             $objObject->intVariableGroupId = null;
         }
     }
     if ($objObject->objVariable) {
         $objObject->objVariable = Variable::GetSoapObjectFromObject($objObject->objVariable, false);
     } else {
         if (!$blnBindRelatedObjects) {
             $objObject->intVariableId = null;
         }
     }
     return $objObject;
 }
 public static function GetSoapArrayFromArray($objArray)
 {
     if (!$objArray) {
         return null;
     }
     $objArrayToReturn = array();
     foreach ($objArray as $objObject) {
         array_push($objArrayToReturn, VariableGroup::GetSoapObjectFromObject($objObject, true));
     }
     return unserialize(serialize($objArrayToReturn));
 }
 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);
         }
     }
 }