protected function lstEntityQtypeCustomField_Create()
 {
     $this->lstEntityQtypeCustomField = new QListBox($this);
     $this->lstEntityQtypeCustomField->Name = QApplication::Translate('Entity Qtype Custom Field');
     $this->lstEntityQtypeCustomField->Required = true;
     if (!$this->blnEditMode) {
         $this->lstEntityQtypeCustomField->AddItem(QApplication::Translate('- Select One -'), null);
     }
     $objEntityQtypeCustomFieldArray = EntityQtypeCustomField::LoadAll();
     if ($objEntityQtypeCustomFieldArray) {
         foreach ($objEntityQtypeCustomFieldArray as $objEntityQtypeCustomField) {
             $objListItem = new QListItem($objEntityQtypeCustomField->__toString(), $objEntityQtypeCustomField->EntityQtypeCustomFieldId);
             if ($this->objRoleEntityQtypeCustomFieldAuthorization->EntityQtypeCustomField && $this->objRoleEntityQtypeCustomFieldAuthorization->EntityQtypeCustomField->EntityQtypeCustomFieldId == $objEntityQtypeCustomField->EntityQtypeCustomFieldId) {
                 $objListItem->Selected = true;
             }
             $this->lstEntityQtypeCustomField->AddItem($objListItem);
         }
     }
 }
コード例 #2
0
 public function dtgEntityQtypeCustomField_Bind()
 {
     // Get Total Count b/c of Pagination
     $this->dtgEntityQtypeCustomField->TotalItemCount = EntityQtypeCustomField::CountAll();
     $objClauses = array();
     if ($objClause = $this->dtgEntityQtypeCustomField->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     if ($objClause = $this->dtgEntityQtypeCustomField->LimitClause) {
         array_push($objClauses, $objClause);
     }
     $this->dtgEntityQtypeCustomField->DataSource = EntityQtypeCustomField::LoadAll($objClauses);
 }
 /**
  * Refresh this MetaControl with Data from the local RoleEntityQtypeCustomFieldAuthorization object.
  * @param boolean $blnReload reload RoleEntityQtypeCustomFieldAuthorization from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objRoleEntityQtypeCustomFieldAuthorization->Reload();
     }
     if ($this->lblRoleEntityQtypeCustomFieldAuthorizationId) {
         if ($this->blnEditMode) {
             $this->lblRoleEntityQtypeCustomFieldAuthorizationId->Text = $this->objRoleEntityQtypeCustomFieldAuthorization->RoleEntityQtypeCustomFieldAuthorizationId;
         }
     }
     if ($this->lstRole) {
         $this->lstRole->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstRole->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objRoleArray = Role::LoadAll();
         if ($objRoleArray) {
             foreach ($objRoleArray as $objRole) {
                 $objListItem = new QListItem($objRole->__toString(), $objRole->RoleId);
                 if ($this->objRoleEntityQtypeCustomFieldAuthorization->Role && $this->objRoleEntityQtypeCustomFieldAuthorization->Role->RoleId == $objRole->RoleId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstRole->AddItem($objListItem);
             }
         }
     }
     if ($this->lblRoleId) {
         $this->lblRoleId->Text = $this->objRoleEntityQtypeCustomFieldAuthorization->Role ? $this->objRoleEntityQtypeCustomFieldAuthorization->Role->__toString() : null;
     }
     if ($this->lstEntityQtypeCustomField) {
         $this->lstEntityQtypeCustomField->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstEntityQtypeCustomField->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objEntityQtypeCustomFieldArray = EntityQtypeCustomField::LoadAll();
         if ($objEntityQtypeCustomFieldArray) {
             foreach ($objEntityQtypeCustomFieldArray as $objEntityQtypeCustomField) {
                 $objListItem = new QListItem($objEntityQtypeCustomField->__toString(), $objEntityQtypeCustomField->EntityQtypeCustomFieldId);
                 if ($this->objRoleEntityQtypeCustomFieldAuthorization->EntityQtypeCustomField && $this->objRoleEntityQtypeCustomFieldAuthorization->EntityQtypeCustomField->EntityQtypeCustomFieldId == $objEntityQtypeCustomField->EntityQtypeCustomFieldId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstEntityQtypeCustomField->AddItem($objListItem);
             }
         }
     }
     if ($this->lblEntityQtypeCustomFieldId) {
         $this->lblEntityQtypeCustomFieldId->Text = $this->objRoleEntityQtypeCustomFieldAuthorization->EntityQtypeCustomField ? $this->objRoleEntityQtypeCustomFieldAuthorization->EntityQtypeCustomField->__toString() : null;
     }
     if ($this->lstAuthorization) {
         $this->lstAuthorization->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstAuthorization->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objAuthorizationArray = Authorization::LoadAll();
         if ($objAuthorizationArray) {
             foreach ($objAuthorizationArray as $objAuthorization) {
                 $objListItem = new QListItem($objAuthorization->__toString(), $objAuthorization->AuthorizationId);
                 if ($this->objRoleEntityQtypeCustomFieldAuthorization->Authorization && $this->objRoleEntityQtypeCustomFieldAuthorization->Authorization->AuthorizationId == $objAuthorization->AuthorizationId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstAuthorization->AddItem($objListItem);
             }
         }
     }
     if ($this->lblAuthorizationId) {
         $this->lblAuthorizationId->Text = $this->objRoleEntityQtypeCustomFieldAuthorization->Authorization ? $this->objRoleEntityQtypeCustomFieldAuthorization->Authorization->__toString() : null;
     }
     if ($this->chkAuthorizedFlag) {
         $this->chkAuthorizedFlag->Checked = $this->objRoleEntityQtypeCustomFieldAuthorization->AuthorizedFlag;
     }
     if ($this->lblAuthorizedFlag) {
         $this->lblAuthorizedFlag->Text = $this->objRoleEntityQtypeCustomFieldAuthorization->AuthorizedFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
     }
     if ($this->lstCreatedByObject) {
         $this->lstCreatedByObject->RemoveAllItems();
         $this->lstCreatedByObject->AddItem(QApplication::Translate('- Select One -'), null);
         $objCreatedByObjectArray = UserAccount::LoadAll();
         if ($objCreatedByObjectArray) {
             foreach ($objCreatedByObjectArray as $objCreatedByObject) {
                 $objListItem = new QListItem($objCreatedByObject->__toString(), $objCreatedByObject->UserAccountId);
                 if ($this->objRoleEntityQtypeCustomFieldAuthorization->CreatedByObject && $this->objRoleEntityQtypeCustomFieldAuthorization->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstCreatedByObject->AddItem($objListItem);
             }
         }
     }
     if ($this->lblCreatedBy) {
         $this->lblCreatedBy->Text = $this->objRoleEntityQtypeCustomFieldAuthorization->CreatedByObject ? $this->objRoleEntityQtypeCustomFieldAuthorization->CreatedByObject->__toString() : null;
     }
     if ($this->calCreationDate) {
         $this->calCreationDate->DateTime = $this->objRoleEntityQtypeCustomFieldAuthorization->CreationDate;
     }
     if ($this->lblCreationDate) {
         $this->lblCreationDate->Text = sprintf($this->objRoleEntityQtypeCustomFieldAuthorization->CreationDate) ? $this->objRoleEntityQtypeCustomFieldAuthorization->__toString($this->strCreationDateDateTimeFormat) : null;
     }
     if ($this->lstModifiedByObject) {
         $this->lstModifiedByObject->RemoveAllItems();
         $this->lstModifiedByObject->AddItem(QApplication::Translate('- Select One -'), null);
         $objModifiedByObjectArray = UserAccount::LoadAll();
         if ($objModifiedByObjectArray) {
             foreach ($objModifiedByObjectArray as $objModifiedByObject) {
                 $objListItem = new QListItem($objModifiedByObject->__toString(), $objModifiedByObject->UserAccountId);
                 if ($this->objRoleEntityQtypeCustomFieldAuthorization->ModifiedByObject && $this->objRoleEntityQtypeCustomFieldAuthorization->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) {
                     $objListItem->Selected = true;
                 }
                 $this->lstModifiedByObject->AddItem($objListItem);
             }
         }
     }
     if ($this->lblModifiedBy) {
         $this->lblModifiedBy->Text = $this->objRoleEntityQtypeCustomFieldAuthorization->ModifiedByObject ? $this->objRoleEntityQtypeCustomFieldAuthorization->ModifiedByObject->__toString() : null;
     }
     if ($this->lblModifiedDate) {
         if ($this->blnEditMode) {
             $this->lblModifiedDate->Text = $this->objRoleEntityQtypeCustomFieldAuthorization->ModifiedDate;
         }
     }
 }
コード例 #4
0
 protected function dtgEntityQtypeCustomField_Bind()
 {
     // Because we want to enable pagination AND sorting, we need to setup the $objClauses array to send to LoadAll()
     // Remember!  We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below
     $this->dtgEntityQtypeCustomField->TotalItemCount = EntityQtypeCustomField::CountAll();
     // Setup the $objClauses Array
     $objClauses = array();
     // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add
     // the OrderByClause to the $objClauses array
     if ($objClause = $this->dtgEntityQtypeCustomField->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     // Add the LimitClause information, as well
     if ($objClause = $this->dtgEntityQtypeCustomField->LimitClause) {
         array_push($objClauses, $objClause);
     }
     // Set the DataSource to be the array of all EntityQtypeCustomField objects, given the clauses above
     $this->dtgEntityQtypeCustomField->DataSource = EntityQtypeCustomField::LoadAll($objClauses);
 }