protected function Form_Create()
 {
     // Setup DataGrid Columns
     $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgVariableGroup_EditLinkColumn_Render($_ITEM) ?>');
     $this->colEditLinkColumn->HtmlEntities = false;
     $this->colId = new QDataGridColumn(QApplication::Translate('Id'), '<?= $_ITEM->Id; ?>', array('OrderByClause' => QQ::OrderBy(QQN::VariableGroup()->Id), 'ReverseOrderByClause' => QQ::OrderBy(QQN::VariableGroup()->Id, false)));
     $this->colName = new QDataGridColumn(QApplication::Translate('Name'), '<?= QString::Truncate($_ITEM->Name, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::VariableGroup()->Name), 'ReverseOrderByClause' => QQ::OrderBy(QQN::VariableGroup()->Name, false)));
     $this->colOrderNumber = new QDataGridColumn(QApplication::Translate('Order Number'), '<?= $_ITEM->OrderNumber; ?>', array('OrderByClause' => QQ::OrderBy(QQN::VariableGroup()->OrderNumber), 'ReverseOrderByClause' => QQ::OrderBy(QQN::VariableGroup()->OrderNumber, false)));
     // Setup DataGrid
     $this->dtgVariableGroup = new QDataGrid($this);
     $this->dtgVariableGroup->CellSpacing = 0;
     $this->dtgVariableGroup->CellPadding = 4;
     $this->dtgVariableGroup->BorderStyle = QBorderStyle::Solid;
     $this->dtgVariableGroup->BorderWidth = 1;
     $this->dtgVariableGroup->GridLines = QGridLines::Both;
     // Datagrid Paginator
     $this->dtgVariableGroup->Paginator = new QPaginator($this->dtgVariableGroup);
     $this->dtgVariableGroup->ItemsPerPage = 10;
     // Specify Whether or Not to Refresh using Ajax
     $this->dtgVariableGroup->UseAjax = false;
     // Specify the local databind method this datagrid will use
     $this->dtgVariableGroup->SetDataBinder('dtgVariableGroup_Bind');
     $this->dtgVariableGroup->AddColumn($this->colEditLinkColumn);
     $this->dtgVariableGroup->AddColumn($this->colId);
     $this->dtgVariableGroup->AddColumn($this->colName);
     $this->dtgVariableGroup->AddColumn($this->colOrderNumber);
 }
Esempio n. 2
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;
 }
Esempio n. 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;
     }
 }
Esempio n. 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();
 }
 public function __construct($objParentObject, $strSetEditPanelMethod, $strCloseEditPanelMethod, $strControlId = null)
 {
     // Call the Parent
     try {
         parent::__construct($objParentObject, $strControlId);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     // Record Method Callbacks
     $this->strSetEditPanelMethod = $strSetEditPanelMethod;
     $this->strCloseEditPanelMethod = $strCloseEditPanelMethod;
     // Setup DataGrid Columns
     $this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_CONTROL->ParentControl->dtgVariableGroup_EditLinkColumn_Render($_ITEM) ?>');
     $this->colEditLinkColumn->HtmlEntities = false;
     $this->colId = new QDataGridColumn(QApplication::Translate('Id'), '<?= $_ITEM->Id; ?>', array('OrderByClause' => QQ::OrderBy(QQN::VariableGroup()->Id), 'ReverseOrderByClause' => QQ::OrderBy(QQN::VariableGroup()->Id, false)));
     $this->colName = new QDataGridColumn(QApplication::Translate('Name'), '<?= QString::Truncate($_ITEM->Name, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::VariableGroup()->Name), 'ReverseOrderByClause' => QQ::OrderBy(QQN::VariableGroup()->Name, false)));
     $this->colOrderNumber = new QDataGridColumn(QApplication::Translate('Order Number'), '<?= $_ITEM->OrderNumber; ?>', array('OrderByClause' => QQ::OrderBy(QQN::VariableGroup()->OrderNumber), 'ReverseOrderByClause' => QQ::OrderBy(QQN::VariableGroup()->OrderNumber, false)));
     // Setup DataGrid
     $this->dtgVariableGroup = new QDataGrid($this);
     $this->dtgVariableGroup->CellSpacing = 0;
     $this->dtgVariableGroup->CellPadding = 4;
     $this->dtgVariableGroup->BorderStyle = QBorderStyle::Solid;
     $this->dtgVariableGroup->BorderWidth = 1;
     $this->dtgVariableGroup->GridLines = QGridLines::Both;
     // Datagrid Paginator
     $this->dtgVariableGroup->Paginator = new QPaginator($this->dtgVariableGroup);
     $this->dtgVariableGroup->ItemsPerPage = 10;
     // Specify Whether or Not to Refresh using Ajax
     $this->dtgVariableGroup->UseAjax = true;
     // Specify the local databind method this datagrid will use
     $this->dtgVariableGroup->SetDataBinder('dtgVariableGroup_Bind', $this);
     $this->dtgVariableGroup->AddColumn($this->colEditLinkColumn);
     $this->dtgVariableGroup->AddColumn($this->colId);
     $this->dtgVariableGroup->AddColumn($this->colName);
     $this->dtgVariableGroup->AddColumn($this->colOrderNumber);
     // Setup the Create New button
     $this->btnCreateNew = new QButton($this);
     $this->btnCreateNew->Text = QApplication::Translate('Create a New') . ' ' . QApplication::Translate('VariableGroup');
     $this->btnCreateNew->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCreateNew_Click'));
 }
Esempio n. 6
0
 /**
  * Load a single VariableGroup object,
  * by Id Index(es)
  * @param integer $intId
  * @return VariableGroup
  */
 public static function LoadById($intId)
 {
     return VariableGroup::QuerySingle(QQ::Equal(QQN::VariableGroup()->Id, $intId));
 }