protected function Form_PreRender() { $objExpansionMap[UserAccount::ExpandCreatedByObject] = true; $objExpansionMap[UserAccount::ExpandRole] = true; // Get Total Count b/c of Pagination $this->dtgUserAccount->TotalItemCount = UserAccount::CountAll(); if ($this->dtgUserAccount->TotalItemCount == 0) { $this->dtgUserAccount->ShowHeader = false; } else { $objClauses = array(); if ($objClause = $this->dtgUserAccount->OrderByClause) { array_push($objClauses, $objClause); } if ($objClause = $this->dtgUserAccount->LimitClause) { array_push($objClauses, $objClause); } if ($objClause = QQ::Expand(QQN::UserAccount()->CreatedByObject)) { array_push($objClauses, $objClause); } if ($objClause = QQ::Expand(QQN::UserAccount()->Role)) { $this->dtgUserAccount->DataSource = UserAccount::LoadAll($objClauses); } $this->dtgUserAccount->ShowHeader = true; } }
/** * Refresh this MetaControl with Data from the local CustomField object. * @param boolean $blnReload reload CustomField from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objCustomField->Reload(); } if ($this->lblCustomFieldId) { if ($this->blnEditMode) { $this->lblCustomFieldId->Text = $this->objCustomField->CustomFieldId; } } if ($this->lstCustomFieldQtype) { $this->lstCustomFieldQtype->SelectedValue = $this->objCustomField->CustomFieldQtypeId; } if ($this->lblCustomFieldQtypeId) { $this->lblCustomFieldQtypeId->Text = $this->objCustomField->CustomFieldQtypeId ? CustomFieldQtype::$NameArray[$this->objCustomField->CustomFieldQtypeId] : null; } if ($this->lstDefaultCustomFieldValue) { $this->lstDefaultCustomFieldValue->RemoveAllItems(); $this->lstDefaultCustomFieldValue->AddItem(QApplication::Translate('- Select One -'), null); $objDefaultCustomFieldValueArray = CustomFieldValue::LoadAll(); if ($objDefaultCustomFieldValueArray) { foreach ($objDefaultCustomFieldValueArray as $objDefaultCustomFieldValue) { $objListItem = new QListItem($objDefaultCustomFieldValue->__toString(), $objDefaultCustomFieldValue->CustomFieldValueId); if ($this->objCustomField->DefaultCustomFieldValue && $this->objCustomField->DefaultCustomFieldValue->CustomFieldValueId == $objDefaultCustomFieldValue->CustomFieldValueId) { $objListItem->Selected = true; } $this->lstDefaultCustomFieldValue->AddItem($objListItem); } } } if ($this->lblDefaultCustomFieldValueId) { $this->lblDefaultCustomFieldValueId->Text = $this->objCustomField->DefaultCustomFieldValue ? $this->objCustomField->DefaultCustomFieldValue->__toString() : null; } if ($this->txtShortDescription) { $this->txtShortDescription->Text = $this->objCustomField->ShortDescription; } if ($this->lblShortDescription) { $this->lblShortDescription->Text = $this->objCustomField->ShortDescription; } if ($this->chkActiveFlag) { $this->chkActiveFlag->Checked = $this->objCustomField->ActiveFlag; } if ($this->lblActiveFlag) { $this->lblActiveFlag->Text = $this->objCustomField->ActiveFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->chkRequiredFlag) { $this->chkRequiredFlag->Checked = $this->objCustomField->RequiredFlag; } if ($this->lblRequiredFlag) { $this->lblRequiredFlag->Text = $this->objCustomField->RequiredFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->chkAllAssetModelsFlag) { $this->chkAllAssetModelsFlag->Checked = $this->objCustomField->AllAssetModelsFlag; } if ($this->lblAllAssetModelsFlag) { $this->lblAllAssetModelsFlag->Text = $this->objCustomField->AllAssetModelsFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->chkSearchableFlag) { $this->chkSearchableFlag->Checked = $this->objCustomField->SearchableFlag; } if ($this->lblSearchableFlag) { $this->lblSearchableFlag->Text = $this->objCustomField->SearchableFlag ? 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->objCustomField->CreatedByObject && $this->objCustomField->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstCreatedByObject->AddItem($objListItem); } } } if ($this->lblCreatedBy) { $this->lblCreatedBy->Text = $this->objCustomField->CreatedByObject ? $this->objCustomField->CreatedByObject->__toString() : null; } if ($this->calCreationDate) { $this->calCreationDate->DateTime = $this->objCustomField->CreationDate; } if ($this->lblCreationDate) { $this->lblCreationDate->Text = sprintf($this->objCustomField->CreationDate) ? $this->objCustomField->__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->objCustomField->ModifiedByObject && $this->objCustomField->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstModifiedByObject->AddItem($objListItem); } } } if ($this->lblModifiedBy) { $this->lblModifiedBy->Text = $this->objCustomField->ModifiedByObject ? $this->objCustomField->ModifiedByObject->__toString() : null; } if ($this->lblModifiedDate) { if ($this->blnEditMode) { $this->lblModifiedDate->Text = $this->objCustomField->ModifiedDate; } } }
protected function Form_Create() { if (QApplication::QueryString('intDownloadCsv')) { $this->RenderBegin(false); session_cache_limiter('must-revalidate'); // force a "no cache" effect header("Pragma: hack"); // IE chokes on "no cache", so set to something, anything, else. $ExpStr = "Expires: " . gmdate("D, d M Y H:i:s", time()) . " GMT"; header($ExpStr); header('Content-Type: text/csv'); header('Content-Disposition: csv; filename=skipped_records.csv'); $file = fopen(sprintf("%s/%s_contact_skipped.csv", __TRACMOR_TMP__, $_SESSION['intUserAccountId']), "r"); ob_end_clean(); while ($row = fgets($file, 1000)) { print $row; @ob_flush(); flush(); } QApplication::$JavaScriptArray = array(); QApplication::$JavaScriptArrayHighPriority = array(); $this->RenderEnd(false); exit; } // Create the Header Menu $this->ctlHeaderMenu_Create(); //$this->ctlShortcutMenu_Create(); $this->pnlMain_Create(); $this->pnlStepOne_Create(); $this->Buttons_Create(); $this->intStep = 1; $this->intSkippedRecordCount = 0; $this->blnImportEnd = true; $this->btnRemoveArray = array(); $this->arrItemCustomField = array(); $this->Labels_Create(); $this->objDatabase = Asset::GetDatabase(); // Load Custom Field foreach (CustomField::LoadArrayByActiveFlagEntity(1, EntityQtype::Contact) as $objCustomField) { $this->arrItemCustomField[$objCustomField->CustomFieldId] = $objCustomField; } $this->blnError = true; $intRoleId = QApplication::$objUserAccount->RoleId; $objRoleEntityQtypeBuiltInAuthorization = RoleEntityQtypeBuiltInAuthorization::LoadByRoleIdEntityQtypeIdAuthorizationId($intRoleId, EntityQtype::Contact, 2); // Check the user have edit permissions if ($objRoleEntityQtypeBuiltInAuthorization && $objRoleEntityQtypeBuiltInAuthorization->AuthorizedFlag) { $this->blnError = false; } if (isset($intCustomFieldIdArray) && count($intCustomFieldIdArray)) { //QApplication::$Database[1]->EnableProfiling(); // Load restrict permisions for Custom Fields $objConditions = QQ::AndCondition(QQ::Equal(QQN::RoleEntityQtypeCustomFieldAuthorization()->RoleId, (string) $intRoleId), QQ::In(QQN::RoleEntityQtypeCustomFieldAuthorization()->EntityQtypeCustomField->CustomFieldId, $intCustomFieldIdArray), QQ::Equal(QQN::RoleEntityQtypeCustomFieldAuthorization()->AuthorizedFlag, false)); $objClauses = array(); array_push($objClauses, QQ::Expand(QQN::RoleEntityQtypeCustomFieldAuthorization()->EntityQtypeCustomField->EntityQtypeCustomFieldId)); array_push($objClauses, QQ::OrderBy(QQN::RoleEntityQtypeCustomFieldAuthorization()->EntityQtypeCustomFieldId)); $arrRoleEntityQtypeCustomFieldAuthorization = RoleEntityQtypeCustomFieldAuthorization::QueryArray($objConditions, $objClauses); if ($arrRoleEntityQtypeCustomFieldAuthorization) { foreach ($arrRoleEntityQtypeCustomFieldAuthorization as $objRoleAuth) { if (array_key_exists($objRoleAuth->EntityQtypeCustomField->CustomFieldId, $this->arrAssetCustomField)) { unset($this->arrAssetCustomField[$objRoleAuth->EntityQtypeCustomField->CustomFieldId]); } } } //QApplication::$Database[1]->OutputProfiling(); } $this->intUserArray = array(); // Load Users foreach (UserAccount::LoadAll() as $objUser) { $this->intUserArray[strtolower($objUser->Username)] = $objUser->UserAccountId; } $this->strAcceptibleMimeArray = array('text/plain' => 'txt', 'text/comma-separated-values' => 'csv', 'text/csv' => 'csv', 'text/x-comma-separated-values' => 'csv', 'application/vnd.ms-excel' => 'csv', 'application/csv' => 'csv', 'text/x-csv' => 'csv'); }
/** * Refresh this MetaControl with Data from the local CustomFieldValue object. * @param boolean $blnReload reload CustomFieldValue from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objCustomFieldValue->Reload(); } if ($this->lblCustomFieldValueId) { if ($this->blnEditMode) { $this->lblCustomFieldValueId->Text = $this->objCustomFieldValue->CustomFieldValueId; } } if ($this->lstCustomField) { $this->lstCustomField->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstCustomField->AddItem(QApplication::Translate('- Select One -'), null); } $objCustomFieldArray = CustomField::LoadAll(); if ($objCustomFieldArray) { foreach ($objCustomFieldArray as $objCustomField) { $objListItem = new QListItem($objCustomField->__toString(), $objCustomField->CustomFieldId); if ($this->objCustomFieldValue->CustomField && $this->objCustomFieldValue->CustomField->CustomFieldId == $objCustomField->CustomFieldId) { $objListItem->Selected = true; } $this->lstCustomField->AddItem($objListItem); } } } if ($this->lblCustomFieldId) { $this->lblCustomFieldId->Text = $this->objCustomFieldValue->CustomField ? $this->objCustomFieldValue->CustomField->__toString() : null; } if ($this->txtShortDescription) { $this->txtShortDescription->Text = $this->objCustomFieldValue->ShortDescription; } if ($this->lblShortDescription) { $this->lblShortDescription->Text = $this->objCustomFieldValue->ShortDescription; } 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->objCustomFieldValue->CreatedByObject && $this->objCustomFieldValue->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstCreatedByObject->AddItem($objListItem); } } } if ($this->lblCreatedBy) { $this->lblCreatedBy->Text = $this->objCustomFieldValue->CreatedByObject ? $this->objCustomFieldValue->CreatedByObject->__toString() : null; } if ($this->calCreationDate) { $this->calCreationDate->DateTime = $this->objCustomFieldValue->CreationDate; } if ($this->lblCreationDate) { $this->lblCreationDate->Text = sprintf($this->objCustomFieldValue->CreationDate) ? $this->objCustomFieldValue->__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->objCustomFieldValue->ModifiedByObject && $this->objCustomFieldValue->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstModifiedByObject->AddItem($objListItem); } } } if ($this->lblModifiedBy) { $this->lblModifiedBy->Text = $this->objCustomFieldValue->ModifiedByObject ? $this->objCustomFieldValue->ModifiedByObject->__toString() : null; } if ($this->lblModifiedDate) { if ($this->blnEditMode) { $this->lblModifiedDate->Text = $this->objCustomFieldValue->ModifiedDate; } } }
/** * Refresh this MetaControl with Data from the local NotificationUserAccount object. * @param boolean $blnReload reload NotificationUserAccount from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objNotificationUserAccount->Reload(); } if ($this->lblNotificationUserAccountId) { if ($this->blnEditMode) { $this->lblNotificationUserAccountId->Text = $this->objNotificationUserAccount->NotificationUserAccountId; } } if ($this->lstUserAccount) { $this->lstUserAccount->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstUserAccount->AddItem(QApplication::Translate('- Select One -'), null); } $objUserAccountArray = UserAccount::LoadAll(); if ($objUserAccountArray) { foreach ($objUserAccountArray as $objUserAccount) { $objListItem = new QListItem($objUserAccount->__toString(), $objUserAccount->UserAccountId); if ($this->objNotificationUserAccount->UserAccount && $this->objNotificationUserAccount->UserAccount->UserAccountId == $objUserAccount->UserAccountId) { $objListItem->Selected = true; } $this->lstUserAccount->AddItem($objListItem); } } } if ($this->lblUserAccountId) { $this->lblUserAccountId->Text = $this->objNotificationUserAccount->UserAccount ? $this->objNotificationUserAccount->UserAccount->__toString() : null; } if ($this->lstNotification) { $this->lstNotification->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstNotification->AddItem(QApplication::Translate('- Select One -'), null); } $objNotificationArray = Notification::LoadAll(); if ($objNotificationArray) { foreach ($objNotificationArray as $objNotification) { $objListItem = new QListItem($objNotification->__toString(), $objNotification->NotificationId); if ($this->objNotificationUserAccount->Notification && $this->objNotificationUserAccount->Notification->NotificationId == $objNotification->NotificationId) { $objListItem->Selected = true; } $this->lstNotification->AddItem($objListItem); } } } if ($this->lblNotificationId) { $this->lblNotificationId->Text = $this->objNotificationUserAccount->Notification ? $this->objNotificationUserAccount->Notification->__toString() : null; } if ($this->txtLevel) { $this->txtLevel->Text = $this->objNotificationUserAccount->Level; } if ($this->lblLevel) { $this->lblLevel->Text = $this->objNotificationUserAccount->Level; } }
/** * Refresh this MetaControl with Data from the local AssetTransactionCheckout object. * @param boolean $blnReload reload AssetTransactionCheckout from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objAssetTransactionCheckout->Reload(); } if ($this->lblAssetTransactionCheckoutId) { if ($this->blnEditMode) { $this->lblAssetTransactionCheckoutId->Text = $this->objAssetTransactionCheckout->AssetTransactionCheckoutId; } } if ($this->lstAssetTransaction) { $this->lstAssetTransaction->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstAssetTransaction->AddItem(QApplication::Translate('- Select One -'), null); } $objAssetTransactionArray = AssetTransaction::LoadAll(); if ($objAssetTransactionArray) { foreach ($objAssetTransactionArray as $objAssetTransaction) { $objListItem = new QListItem($objAssetTransaction->__toString(), $objAssetTransaction->AssetTransactionId); if ($this->objAssetTransactionCheckout->AssetTransaction && $this->objAssetTransactionCheckout->AssetTransaction->AssetTransactionId == $objAssetTransaction->AssetTransactionId) { $objListItem->Selected = true; } $this->lstAssetTransaction->AddItem($objListItem); } } } if ($this->lblAssetTransactionId) { $this->lblAssetTransactionId->Text = $this->objAssetTransactionCheckout->AssetTransaction ? $this->objAssetTransactionCheckout->AssetTransaction->__toString() : null; } if ($this->lstToContact) { $this->lstToContact->RemoveAllItems(); $this->lstToContact->AddItem(QApplication::Translate('- Select One -'), null); $objToContactArray = Contact::LoadAll(); if ($objToContactArray) { foreach ($objToContactArray as $objToContact) { $objListItem = new QListItem($objToContact->__toString(), $objToContact->ContactId); if ($this->objAssetTransactionCheckout->ToContact && $this->objAssetTransactionCheckout->ToContact->ContactId == $objToContact->ContactId) { $objListItem->Selected = true; } $this->lstToContact->AddItem($objListItem); } } } if ($this->lblToContactId) { $this->lblToContactId->Text = $this->objAssetTransactionCheckout->ToContact ? $this->objAssetTransactionCheckout->ToContact->__toString() : null; } if ($this->lstToUser) { $this->lstToUser->RemoveAllItems(); $this->lstToUser->AddItem(QApplication::Translate('- Select One -'), null); $objToUserArray = UserAccount::LoadAll(); if ($objToUserArray) { foreach ($objToUserArray as $objToUser) { $objListItem = new QListItem($objToUser->__toString(), $objToUser->UserAccountId); if ($this->objAssetTransactionCheckout->ToUser && $this->objAssetTransactionCheckout->ToUser->UserAccountId == $objToUser->UserAccountId) { $objListItem->Selected = true; } $this->lstToUser->AddItem($objListItem); } } } if ($this->lblToUserId) { $this->lblToUserId->Text = $this->objAssetTransactionCheckout->ToUser ? $this->objAssetTransactionCheckout->ToUser->__toString() : null; } if ($this->calDueDate) { $this->calDueDate->DateTime = $this->objAssetTransactionCheckout->DueDate; } if ($this->lblDueDate) { $this->lblDueDate->Text = sprintf($this->objAssetTransactionCheckout->DueDate) ? $this->objAssetTransactionCheckout->__toString($this->strDueDateDateTimeFormat) : null; } 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->objAssetTransactionCheckout->CreatedByObject && $this->objAssetTransactionCheckout->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstCreatedByObject->AddItem($objListItem); } } } if ($this->lblCreatedBy) { $this->lblCreatedBy->Text = $this->objAssetTransactionCheckout->CreatedByObject ? $this->objAssetTransactionCheckout->CreatedByObject->__toString() : null; } if ($this->calCreationDate) { $this->calCreationDate->DateTime = $this->objAssetTransactionCheckout->CreationDate; } if ($this->lblCreationDate) { $this->lblCreationDate->Text = sprintf($this->objAssetTransactionCheckout->CreationDate) ? $this->objAssetTransactionCheckout->__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->objAssetTransactionCheckout->ModifiedByObject && $this->objAssetTransactionCheckout->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstModifiedByObject->AddItem($objListItem); } } } if ($this->lblModifiedBy) { $this->lblModifiedBy->Text = $this->objAssetTransactionCheckout->ModifiedByObject ? $this->objAssetTransactionCheckout->ModifiedByObject->__toString() : null; } if ($this->lblModifiedDate) { if ($this->blnEditMode) { $this->lblModifiedDate->Text = $this->objAssetTransactionCheckout->ModifiedDate; } } }
/** * Refresh this MetaControl with Data from the local Transaction object. * @param boolean $blnReload reload Transaction from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objTransaction->Reload(); } if ($this->lblTransactionId) { if ($this->blnEditMode) { $this->lblTransactionId->Text = $this->objTransaction->TransactionId; } } if ($this->lstEntityQtype) { $this->lstEntityQtype->SelectedValue = $this->objTransaction->EntityQtypeId; } if ($this->lblEntityQtypeId) { $this->lblEntityQtypeId->Text = $this->objTransaction->EntityQtypeId ? EntityQtype::$NameArray[$this->objTransaction->EntityQtypeId] : null; } if ($this->lstTransactionType) { $this->lstTransactionType->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstTransactionType->AddItem(QApplication::Translate('- Select One -'), null); } $objTransactionTypeArray = TransactionType::LoadAll(); if ($objTransactionTypeArray) { foreach ($objTransactionTypeArray as $objTransactionType) { $objListItem = new QListItem($objTransactionType->__toString(), $objTransactionType->TransactionTypeId); if ($this->objTransaction->TransactionType && $this->objTransaction->TransactionType->TransactionTypeId == $objTransactionType->TransactionTypeId) { $objListItem->Selected = true; } $this->lstTransactionType->AddItem($objListItem); } } } if ($this->lblTransactionTypeId) { $this->lblTransactionTypeId->Text = $this->objTransaction->TransactionType ? $this->objTransaction->TransactionType->__toString() : null; } if ($this->txtNote) { $this->txtNote->Text = $this->objTransaction->Note; } if ($this->lblNote) { $this->lblNote->Text = $this->objTransaction->Note; } 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->objTransaction->CreatedByObject && $this->objTransaction->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstCreatedByObject->AddItem($objListItem); } } } if ($this->lblCreatedBy) { $this->lblCreatedBy->Text = $this->objTransaction->CreatedByObject ? $this->objTransaction->CreatedByObject->__toString() : null; } if ($this->calCreationDate) { $this->calCreationDate->DateTime = $this->objTransaction->CreationDate; } if ($this->lblCreationDate) { $this->lblCreationDate->Text = sprintf($this->objTransaction->CreationDate) ? $this->objTransaction->__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->objTransaction->ModifiedByObject && $this->objTransaction->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstModifiedByObject->AddItem($objListItem); } } } if ($this->lblModifiedBy) { $this->lblModifiedBy->Text = $this->objTransaction->ModifiedByObject ? $this->objTransaction->ModifiedByObject->__toString() : null; } if ($this->lblModifiedDate) { if ($this->blnEditMode) { $this->lblModifiedDate->Text = $this->objTransaction->ModifiedDate; } } if ($this->lstReceipt) { $this->lstReceipt->RemoveAllItems(); $this->lstReceipt->AddItem(QApplication::Translate('- Select One -'), null); $objReceiptArray = Receipt::LoadAll(); if ($objReceiptArray) { foreach ($objReceiptArray as $objReceipt) { $objListItem = new QListItem($objReceipt->__toString(), $objReceipt->ReceiptId); if ($objReceipt->TransactionId == $this->objTransaction->TransactionId) { $objListItem->Selected = true; } $this->lstReceipt->AddItem($objListItem); } } // Because Receipt's Receipt is not null, if a value is already selected, it cannot be changed. if ($this->lstReceipt->SelectedValue) { $this->lstReceipt->Enabled = false; } else { $this->lstReceipt->Enabled = true; } } if ($this->lblReceipt) { $this->lblReceipt->Text = $this->objTransaction->Receipt ? $this->objTransaction->Receipt->__toString() : null; } if ($this->lstShipment) { $this->lstShipment->RemoveAllItems(); $this->lstShipment->AddItem(QApplication::Translate('- Select One -'), null); $objShipmentArray = Shipment::LoadAll(); if ($objShipmentArray) { foreach ($objShipmentArray as $objShipment) { $objListItem = new QListItem($objShipment->__toString(), $objShipment->ShipmentId); if ($objShipment->TransactionId == $this->objTransaction->TransactionId) { $objListItem->Selected = true; } $this->lstShipment->AddItem($objListItem); } } // Because Shipment's Shipment is not null, if a value is already selected, it cannot be changed. if ($this->lstShipment->SelectedValue) { $this->lstShipment->Enabled = false; } else { $this->lstShipment->Enabled = true; } } if ($this->lblShipment) { $this->lblShipment->Text = $this->objTransaction->Shipment ? $this->objTransaction->Shipment->__toString() : null; } }
protected function lstUserAccount_Create() { $this->lstUserAccount = new QListBox($this); $this->lstUserAccount->Name = QApplication::Translate('User Account'); $this->lstUserAccount->Required = true; if (!$this->blnEditMode) { $this->lstUserAccount->AddItem(QApplication::Translate('- Select One -'), null); } $objUserAccountArray = UserAccount::LoadAll(); if ($objUserAccountArray) { foreach ($objUserAccountArray as $objUserAccount) { $objListItem = new QListItem($objUserAccount->__toString(), $objUserAccount->UserAccountId); if ($this->objNotificationUserAccount->UserAccount && $this->objNotificationUserAccount->UserAccount->UserAccountId == $objUserAccount->UserAccountId) { $objListItem->Selected = true; } $this->lstUserAccount->AddItem($objListItem); } } }
public function dtgUserAccount_Bind() { $objClauses = array(); if ($objClause = $this->dtgUserAccount->OrderByClause) { array_push($objClauses, $objClause); } $objClause = QQ::Expand(QQN::UserAccount()->CreatedByObject); array_push($objClauses, $objClause); $objClause = QQ::Expand(QQN::UserAccount()->Role); array_push($objClauses, $objClause); $this->strUsername = $this->txtUsername->Text; if ($this->strUsername) { $this->dtgUserAccount->TotalItemCount = UserAccount::QueryCount(QQ::Like(QQN::UserAccount()->Username, '%' . $this->strUsername . '%'), $objClauses); if ($this->dtgUserAccount->TotalItemCount > 0) { $this->dtgUserAccount->ShowHeader = true; // Add the LimitClause information, as well if ($objClause = $this->dtgUserAccount->LimitClause) { array_push($objClauses, $objClause); } $this->dtgUserAccount->DataSource = UserAccount::QueryArray(QQ::Like(QQN::UserAccount()->Username, '%' . $this->strUsername . '%'), $objClauses); } else { $this->dtgUserAccount->ShowHeader = false; } } else { // Get Total Count b/c of Pagination $this->dtgUserAccount->TotalItemCount = UserAccount::CountAll(); if ($this->dtgUserAccount->TotalItemCount == 0) { $this->dtgUserAccount->ShowHeader = false; } else { if ($objClause = $this->dtgUserAccount->LimitClause) { array_push($objClauses, $objClause); } $this->dtgUserAccount->DataSource = UserAccount::LoadAll($objClauses); $this->dtgUserAccount->ShowHeader = true; } } }
/** * 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; } } }
public function dtgUserAccount_Bind() { // Get Total Count b/c of Pagination $this->dtgUserAccount->TotalItemCount = UserAccount::CountAll(); $objClauses = array(); if ($objClause = $this->dtgUserAccount->OrderByClause) { array_push($objClauses, $objClause); } if ($objClause = $this->dtgUserAccount->LimitClause) { array_push($objClauses, $objClause); } $this->dtgUserAccount->DataSource = UserAccount::LoadAll($objClauses); }
/** * Refresh this MetaControl with Data from the local UserAccount object. * @param boolean $blnReload reload UserAccount from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objUserAccount->Reload(); } if ($this->lblUserAccountId) { if ($this->blnEditMode) { $this->lblUserAccountId->Text = $this->objUserAccount->UserAccountId; } } if ($this->txtFirstName) { $this->txtFirstName->Text = $this->objUserAccount->FirstName; } if ($this->lblFirstName) { $this->lblFirstName->Text = $this->objUserAccount->FirstName; } if ($this->txtLastName) { $this->txtLastName->Text = $this->objUserAccount->LastName; } if ($this->lblLastName) { $this->lblLastName->Text = $this->objUserAccount->LastName; } if ($this->txtUsername) { $this->txtUsername->Text = $this->objUserAccount->Username; } if ($this->lblUsername) { $this->lblUsername->Text = $this->objUserAccount->Username; } if ($this->txtPasswordHash) { $this->txtPasswordHash->Text = $this->objUserAccount->PasswordHash; } if ($this->lblPasswordHash) { $this->lblPasswordHash->Text = $this->objUserAccount->PasswordHash; } if ($this->txtEmailAddress) { $this->txtEmailAddress->Text = $this->objUserAccount->EmailAddress; } if ($this->lblEmailAddress) { $this->lblEmailAddress->Text = $this->objUserAccount->EmailAddress; } if ($this->chkActiveFlag) { $this->chkActiveFlag->Checked = $this->objUserAccount->ActiveFlag; } if ($this->lblActiveFlag) { $this->lblActiveFlag->Text = $this->objUserAccount->ActiveFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->chkAdminFlag) { $this->chkAdminFlag->Checked = $this->objUserAccount->AdminFlag; } if ($this->lblAdminFlag) { $this->lblAdminFlag->Text = $this->objUserAccount->AdminFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->chkPortableAccessFlag) { $this->chkPortableAccessFlag->Checked = $this->objUserAccount->PortableAccessFlag; } if ($this->lblPortableAccessFlag) { $this->lblPortableAccessFlag->Text = $this->objUserAccount->PortableAccessFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->txtPortableUserPin) { $this->txtPortableUserPin->Text = $this->objUserAccount->PortableUserPin; } if ($this->lblPortableUserPin) { $this->lblPortableUserPin->Text = $this->objUserAccount->PortableUserPin; } 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->objUserAccount->Role && $this->objUserAccount->Role->RoleId == $objRole->RoleId) { $objListItem->Selected = true; } $this->lstRole->AddItem($objListItem); } } } if ($this->lblRoleId) { $this->lblRoleId->Text = $this->objUserAccount->Role ? $this->objUserAccount->Role->__toString() : null; } 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->objUserAccount->CreatedByObject && $this->objUserAccount->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstCreatedByObject->AddItem($objListItem); } } } if ($this->lblCreatedBy) { $this->lblCreatedBy->Text = $this->objUserAccount->CreatedByObject ? $this->objUserAccount->CreatedByObject->__toString() : null; } if ($this->calCreationDate) { $this->calCreationDate->DateTime = $this->objUserAccount->CreationDate; } if ($this->lblCreationDate) { $this->lblCreationDate->Text = sprintf($this->objUserAccount->CreationDate) ? $this->objUserAccount->__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->objUserAccount->ModifiedByObject && $this->objUserAccount->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstModifiedByObject->AddItem($objListItem); } } } if ($this->lblModifiedBy) { $this->lblModifiedBy->Text = $this->objUserAccount->ModifiedByObject ? $this->objUserAccount->ModifiedByObject->__toString() : null; } if ($this->lblModifiedDate) { if ($this->blnEditMode) { $this->lblModifiedDate->Text = $this->objUserAccount->ModifiedDate; } } }
/** * Refresh this MetaControl with Data from the local Location object. * @param boolean $blnReload reload Location from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objLocation->Reload(); } if ($this->lblLocationId) { if ($this->blnEditMode) { $this->lblLocationId->Text = $this->objLocation->LocationId; } } if ($this->txtShortDescription) { $this->txtShortDescription->Text = $this->objLocation->ShortDescription; } if ($this->lblShortDescription) { $this->lblShortDescription->Text = $this->objLocation->ShortDescription; } if ($this->txtLongDescription) { $this->txtLongDescription->Text = $this->objLocation->LongDescription; } if ($this->lblLongDescription) { $this->lblLongDescription->Text = $this->objLocation->LongDescription; } if ($this->chkEnabledFlag) { $this->chkEnabledFlag->Checked = $this->objLocation->EnabledFlag; } if ($this->lblEnabledFlag) { $this->lblEnabledFlag->Text = $this->objLocation->EnabledFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->chkAssetFlag) { $this->chkAssetFlag->Checked = $this->objLocation->AssetFlag; } if ($this->lblAssetFlag) { $this->lblAssetFlag->Text = $this->objLocation->AssetFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->chkInventoryFlag) { $this->chkInventoryFlag->Checked = $this->objLocation->InventoryFlag; } if ($this->lblInventoryFlag) { $this->lblInventoryFlag->Text = $this->objLocation->InventoryFlag ? 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->objLocation->CreatedByObject && $this->objLocation->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstCreatedByObject->AddItem($objListItem); } } } if ($this->lblCreatedBy) { $this->lblCreatedBy->Text = $this->objLocation->CreatedByObject ? $this->objLocation->CreatedByObject->__toString() : null; } if ($this->calCreationDate) { $this->calCreationDate->DateTime = $this->objLocation->CreationDate; } if ($this->lblCreationDate) { $this->lblCreationDate->Text = sprintf($this->objLocation->CreationDate) ? $this->objLocation->__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->objLocation->ModifiedByObject && $this->objLocation->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstModifiedByObject->AddItem($objListItem); } } } if ($this->lblModifiedBy) { $this->lblModifiedBy->Text = $this->objLocation->ModifiedByObject ? $this->objLocation->ModifiedByObject->__toString() : null; } if ($this->lblModifiedDate) { if ($this->blnEditMode) { $this->lblModifiedDate->Text = $this->objLocation->ModifiedDate; } } }
protected function lstUserCheckedOutReserved_Create() { $this->lstUser = new QListBox($this); $this->lstUser->Name = 'User'; $this->lstUser->AddItem('- Select One -', null); $this->lstCheckedOutBy = new QListBox($this); $this->lstCheckedOutBy->Name = 'Checked Out By'; $this->lstCheckedOutBy->AddItem('- Select One -', null); //$this->lstCheckedOutBy->AddItem('- Any -', 'any'); $this->lstReservedBy = new QListBox($this); $this->lstReservedBy->Name = 'Reserved By'; $this->lstReservedBy->AddItem('- Select One -', null); //$this->lstReservedBy->AddItem('- Any -', 'any'); foreach (UserAccount::LoadAll(QQ::Clause(QQ::OrderBy(QQN::UserAccount()->Username))) as $objUserAccount) { $this->lstUser->AddItem($objUserAccount->Username, $objUserAccount->UserAccountId); $this->lstCheckedOutBy->AddItem($objUserAccount->Username, $objUserAccount->UserAccountId); $this->lstReservedBy->AddItem($objUserAccount->Username, $objUserAccount->UserAccountId); } }
/** * Refresh this MetaControl with Data from the local Address object. * @param boolean $blnReload reload Address from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objAddress->Reload(); } if ($this->lblAddressId) { if ($this->blnEditMode) { $this->lblAddressId->Text = $this->objAddress->AddressId; } } if ($this->lstCompany) { $this->lstCompany->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstCompany->AddItem(QApplication::Translate('- Select One -'), null); } $objCompanyArray = Company::LoadAll(); if ($objCompanyArray) { foreach ($objCompanyArray as $objCompany) { $objListItem = new QListItem($objCompany->__toString(), $objCompany->CompanyId); if ($this->objAddress->Company && $this->objAddress->Company->CompanyId == $objCompany->CompanyId) { $objListItem->Selected = true; } $this->lstCompany->AddItem($objListItem); } } } if ($this->lblCompanyId) { $this->lblCompanyId->Text = $this->objAddress->Company ? $this->objAddress->Company->__toString() : null; } if ($this->txtShortDescription) { $this->txtShortDescription->Text = $this->objAddress->ShortDescription; } if ($this->lblShortDescription) { $this->lblShortDescription->Text = $this->objAddress->ShortDescription; } if ($this->lstCountry) { $this->lstCountry->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstCountry->AddItem(QApplication::Translate('- Select One -'), null); } $objCountryArray = Country::LoadAll(); if ($objCountryArray) { foreach ($objCountryArray as $objCountry) { $objListItem = new QListItem($objCountry->__toString(), $objCountry->CountryId); if ($this->objAddress->Country && $this->objAddress->Country->CountryId == $objCountry->CountryId) { $objListItem->Selected = true; } $this->lstCountry->AddItem($objListItem); } } } if ($this->lblCountryId) { $this->lblCountryId->Text = $this->objAddress->Country ? $this->objAddress->Country->__toString() : null; } if ($this->txtAddress1) { $this->txtAddress1->Text = $this->objAddress->Address1; } if ($this->lblAddress1) { $this->lblAddress1->Text = $this->objAddress->Address1; } if ($this->txtAddress2) { $this->txtAddress2->Text = $this->objAddress->Address2; } if ($this->lblAddress2) { $this->lblAddress2->Text = $this->objAddress->Address2; } if ($this->txtCity) { $this->txtCity->Text = $this->objAddress->City; } if ($this->lblCity) { $this->lblCity->Text = $this->objAddress->City; } if ($this->lstStateProvince) { $this->lstStateProvince->RemoveAllItems(); $this->lstStateProvince->AddItem(QApplication::Translate('- Select One -'), null); $objStateProvinceArray = StateProvince::LoadAll(); if ($objStateProvinceArray) { foreach ($objStateProvinceArray as $objStateProvince) { $objListItem = new QListItem($objStateProvince->__toString(), $objStateProvince->StateProvinceId); if ($this->objAddress->StateProvince && $this->objAddress->StateProvince->StateProvinceId == $objStateProvince->StateProvinceId) { $objListItem->Selected = true; } $this->lstStateProvince->AddItem($objListItem); } } } if ($this->lblStateProvinceId) { $this->lblStateProvinceId->Text = $this->objAddress->StateProvince ? $this->objAddress->StateProvince->__toString() : null; } if ($this->txtPostalCode) { $this->txtPostalCode->Text = $this->objAddress->PostalCode; } if ($this->lblPostalCode) { $this->lblPostalCode->Text = $this->objAddress->PostalCode; } 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->objAddress->CreatedByObject && $this->objAddress->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstCreatedByObject->AddItem($objListItem); } } } if ($this->lblCreatedBy) { $this->lblCreatedBy->Text = $this->objAddress->CreatedByObject ? $this->objAddress->CreatedByObject->__toString() : null; } if ($this->calCreationDate) { $this->calCreationDate->DateTime = $this->objAddress->CreationDate; } if ($this->lblCreationDate) { $this->lblCreationDate->Text = sprintf($this->objAddress->CreationDate) ? $this->objAddress->__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->objAddress->ModifiedByObject && $this->objAddress->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstModifiedByObject->AddItem($objListItem); } } } if ($this->lblModifiedBy) { $this->lblModifiedBy->Text = $this->objAddress->ModifiedByObject ? $this->objAddress->ModifiedByObject->__toString() : null; } if ($this->lblModifiedDate) { if ($this->blnEditMode) { $this->lblModifiedDate->Text = $this->objAddress->ModifiedDate; } } if ($this->lstAddressCustomFieldHelper) { $this->lstAddressCustomFieldHelper->RemoveAllItems(); $this->lstAddressCustomFieldHelper->AddItem(QApplication::Translate('- Select One -'), null); $objAddressCustomFieldHelperArray = AddressCustomFieldHelper::LoadAll(); if ($objAddressCustomFieldHelperArray) { foreach ($objAddressCustomFieldHelperArray as $objAddressCustomFieldHelper) { $objListItem = new QListItem($objAddressCustomFieldHelper->__toString(), $objAddressCustomFieldHelper->AddressId); if ($objAddressCustomFieldHelper->AddressId == $this->objAddress->AddressId) { $objListItem->Selected = true; } $this->lstAddressCustomFieldHelper->AddItem($objListItem); } } // Because AddressCustomFieldHelper's AddressCustomFieldHelper is not null, if a value is already selected, it cannot be changed. if ($this->lstAddressCustomFieldHelper->SelectedValue) { $this->lstAddressCustomFieldHelper->Enabled = false; } else { $this->lstAddressCustomFieldHelper->Enabled = true; } } if ($this->lblAddressCustomFieldHelper) { $this->lblAddressCustomFieldHelper->Text = $this->objAddress->AddressCustomFieldHelper ? $this->objAddress->AddressCustomFieldHelper->__toString() : null; } }
/** * Refresh this MetaControl with Data from the local InventoryTransaction object. * @param boolean $blnReload reload InventoryTransaction from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objInventoryTransaction->Reload(); } if ($this->lblInventoryTransactionId) { if ($this->blnEditMode) { $this->lblInventoryTransactionId->Text = $this->objInventoryTransaction->InventoryTransactionId; } } if ($this->lstInventoryLocation) { $this->lstInventoryLocation->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstInventoryLocation->AddItem(QApplication::Translate('- Select One -'), null); } $objInventoryLocationArray = InventoryLocation::LoadAll(); if ($objInventoryLocationArray) { foreach ($objInventoryLocationArray as $objInventoryLocation) { $objListItem = new QListItem($objInventoryLocation->__toString(), $objInventoryLocation->InventoryLocationId); if ($this->objInventoryTransaction->InventoryLocation && $this->objInventoryTransaction->InventoryLocation->InventoryLocationId == $objInventoryLocation->InventoryLocationId) { $objListItem->Selected = true; } $this->lstInventoryLocation->AddItem($objListItem); } } } if ($this->lblInventoryLocationId) { $this->lblInventoryLocationId->Text = $this->objInventoryTransaction->InventoryLocation ? $this->objInventoryTransaction->InventoryLocation->__toString() : null; } if ($this->lstTransaction) { $this->lstTransaction->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstTransaction->AddItem(QApplication::Translate('- Select One -'), null); } $objTransactionArray = Transaction::LoadAll(); if ($objTransactionArray) { foreach ($objTransactionArray as $objTransaction) { $objListItem = new QListItem($objTransaction->__toString(), $objTransaction->TransactionId); if ($this->objInventoryTransaction->Transaction && $this->objInventoryTransaction->Transaction->TransactionId == $objTransaction->TransactionId) { $objListItem->Selected = true; } $this->lstTransaction->AddItem($objListItem); } } } if ($this->lblTransactionId) { $this->lblTransactionId->Text = $this->objInventoryTransaction->Transaction ? $this->objInventoryTransaction->Transaction->__toString() : null; } if ($this->txtQuantity) { $this->txtQuantity->Text = $this->objInventoryTransaction->Quantity; } if ($this->lblQuantity) { $this->lblQuantity->Text = $this->objInventoryTransaction->Quantity; } if ($this->lstSourceLocation) { $this->lstSourceLocation->RemoveAllItems(); $this->lstSourceLocation->AddItem(QApplication::Translate('- Select One -'), null); $objSourceLocationArray = Location::LoadAll(); if ($objSourceLocationArray) { foreach ($objSourceLocationArray as $objSourceLocation) { $objListItem = new QListItem($objSourceLocation->__toString(), $objSourceLocation->LocationId); if ($this->objInventoryTransaction->SourceLocation && $this->objInventoryTransaction->SourceLocation->LocationId == $objSourceLocation->LocationId) { $objListItem->Selected = true; } $this->lstSourceLocation->AddItem($objListItem); } } } if ($this->lblSourceLocationId) { $this->lblSourceLocationId->Text = $this->objInventoryTransaction->SourceLocation ? $this->objInventoryTransaction->SourceLocation->__toString() : null; } if ($this->lstDestinationLocation) { $this->lstDestinationLocation->RemoveAllItems(); $this->lstDestinationLocation->AddItem(QApplication::Translate('- Select One -'), null); $objDestinationLocationArray = Location::LoadAll(); if ($objDestinationLocationArray) { foreach ($objDestinationLocationArray as $objDestinationLocation) { $objListItem = new QListItem($objDestinationLocation->__toString(), $objDestinationLocation->LocationId); if ($this->objInventoryTransaction->DestinationLocation && $this->objInventoryTransaction->DestinationLocation->LocationId == $objDestinationLocation->LocationId) { $objListItem->Selected = true; } $this->lstDestinationLocation->AddItem($objListItem); } } } if ($this->lblDestinationLocationId) { $this->lblDestinationLocationId->Text = $this->objInventoryTransaction->DestinationLocation ? $this->objInventoryTransaction->DestinationLocation->__toString() : null; } 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->objInventoryTransaction->CreatedByObject && $this->objInventoryTransaction->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstCreatedByObject->AddItem($objListItem); } } } if ($this->lblCreatedBy) { $this->lblCreatedBy->Text = $this->objInventoryTransaction->CreatedByObject ? $this->objInventoryTransaction->CreatedByObject->__toString() : null; } if ($this->calCreationDate) { $this->calCreationDate->DateTime = $this->objInventoryTransaction->CreationDate; } if ($this->lblCreationDate) { $this->lblCreationDate->Text = sprintf($this->objInventoryTransaction->CreationDate) ? $this->objInventoryTransaction->__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->objInventoryTransaction->ModifiedByObject && $this->objInventoryTransaction->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstModifiedByObject->AddItem($objListItem); } } } if ($this->lblModifiedBy) { $this->lblModifiedBy->Text = $this->objInventoryTransaction->ModifiedByObject ? $this->objInventoryTransaction->ModifiedByObject->__toString() : null; } if ($this->lblModifiedDate) { if ($this->blnEditMode) { $this->lblModifiedDate->Text = $this->objInventoryTransaction->ModifiedDate; } } }
/** * Refresh this MetaControl with Data from the local DatagridColumnPreference object. * @param boolean $blnReload reload DatagridColumnPreference from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objDatagridColumnPreference->Reload(); } if ($this->lblDatagridColumnPreferenceId) { if ($this->blnEditMode) { $this->lblDatagridColumnPreferenceId->Text = $this->objDatagridColumnPreference->DatagridColumnPreferenceId; } } if ($this->lstDatagrid) { $this->lstDatagrid->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstDatagrid->AddItem(QApplication::Translate('- Select One -'), null); } $objDatagridArray = Datagrid::LoadAll(); if ($objDatagridArray) { foreach ($objDatagridArray as $objDatagrid) { $objListItem = new QListItem($objDatagrid->__toString(), $objDatagrid->DatagridId); if ($this->objDatagridColumnPreference->Datagrid && $this->objDatagridColumnPreference->Datagrid->DatagridId == $objDatagrid->DatagridId) { $objListItem->Selected = true; } $this->lstDatagrid->AddItem($objListItem); } } } if ($this->lblDatagridId) { $this->lblDatagridId->Text = $this->objDatagridColumnPreference->Datagrid ? $this->objDatagridColumnPreference->Datagrid->__toString() : null; } if ($this->txtColumnName) { $this->txtColumnName->Text = $this->objDatagridColumnPreference->ColumnName; } if ($this->lblColumnName) { $this->lblColumnName->Text = $this->objDatagridColumnPreference->ColumnName; } if ($this->lstUserAccount) { $this->lstUserAccount->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstUserAccount->AddItem(QApplication::Translate('- Select One -'), null); } $objUserAccountArray = UserAccount::LoadAll(); if ($objUserAccountArray) { foreach ($objUserAccountArray as $objUserAccount) { $objListItem = new QListItem($objUserAccount->__toString(), $objUserAccount->UserAccountId); if ($this->objDatagridColumnPreference->UserAccount && $this->objDatagridColumnPreference->UserAccount->UserAccountId == $objUserAccount->UserAccountId) { $objListItem->Selected = true; } $this->lstUserAccount->AddItem($objListItem); } } } if ($this->lblUserAccountId) { $this->lblUserAccountId->Text = $this->objDatagridColumnPreference->UserAccount ? $this->objDatagridColumnPreference->UserAccount->__toString() : null; } if ($this->chkDisplayFlag) { $this->chkDisplayFlag->Checked = $this->objDatagridColumnPreference->DisplayFlag; } if ($this->lblDisplayFlag) { $this->lblDisplayFlag->Text = $this->objDatagridColumnPreference->DisplayFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } }
/** * Refresh this MetaControl with Data from the local InventoryModel object. * @param boolean $blnReload reload InventoryModel from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objInventoryModel->Reload(); } if ($this->lblInventoryModelId) { if ($this->blnEditMode) { $this->lblInventoryModelId->Text = $this->objInventoryModel->InventoryModelId; } } if ($this->lstCategory) { $this->lstCategory->RemoveAllItems(); $this->lstCategory->AddItem(QApplication::Translate('- Select One -'), null); $objCategoryArray = Category::LoadAll(); if ($objCategoryArray) { foreach ($objCategoryArray as $objCategory) { $objListItem = new QListItem($objCategory->__toString(), $objCategory->CategoryId); if ($this->objInventoryModel->Category && $this->objInventoryModel->Category->CategoryId == $objCategory->CategoryId) { $objListItem->Selected = true; } $this->lstCategory->AddItem($objListItem); } } } if ($this->lblCategoryId) { $this->lblCategoryId->Text = $this->objInventoryModel->Category ? $this->objInventoryModel->Category->__toString() : null; } if ($this->lstManufacturer) { $this->lstManufacturer->RemoveAllItems(); $this->lstManufacturer->AddItem(QApplication::Translate('- Select One -'), null); $objManufacturerArray = Manufacturer::LoadAll(); if ($objManufacturerArray) { foreach ($objManufacturerArray as $objManufacturer) { $objListItem = new QListItem($objManufacturer->__toString(), $objManufacturer->ManufacturerId); if ($this->objInventoryModel->Manufacturer && $this->objInventoryModel->Manufacturer->ManufacturerId == $objManufacturer->ManufacturerId) { $objListItem->Selected = true; } $this->lstManufacturer->AddItem($objListItem); } } } if ($this->lblManufacturerId) { $this->lblManufacturerId->Text = $this->objInventoryModel->Manufacturer ? $this->objInventoryModel->Manufacturer->__toString() : null; } if ($this->txtInventoryModelCode) { $this->txtInventoryModelCode->Text = $this->objInventoryModel->InventoryModelCode; } if ($this->lblInventoryModelCode) { $this->lblInventoryModelCode->Text = $this->objInventoryModel->InventoryModelCode; } if ($this->txtShortDescription) { $this->txtShortDescription->Text = $this->objInventoryModel->ShortDescription; } if ($this->lblShortDescription) { $this->lblShortDescription->Text = $this->objInventoryModel->ShortDescription; } if ($this->txtLongDescription) { $this->txtLongDescription->Text = $this->objInventoryModel->LongDescription; } if ($this->lblLongDescription) { $this->lblLongDescription->Text = $this->objInventoryModel->LongDescription; } if ($this->txtImagePath) { $this->txtImagePath->Text = $this->objInventoryModel->ImagePath; } if ($this->lblImagePath) { $this->lblImagePath->Text = $this->objInventoryModel->ImagePath; } if ($this->txtPrice) { $this->txtPrice->Text = $this->objInventoryModel->Price; } if ($this->lblPrice) { $this->lblPrice->Text = $this->objInventoryModel->Price; } 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->objInventoryModel->CreatedByObject && $this->objInventoryModel->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstCreatedByObject->AddItem($objListItem); } } } if ($this->lblCreatedBy) { $this->lblCreatedBy->Text = $this->objInventoryModel->CreatedByObject ? $this->objInventoryModel->CreatedByObject->__toString() : null; } if ($this->calCreationDate) { $this->calCreationDate->DateTime = $this->objInventoryModel->CreationDate; } if ($this->lblCreationDate) { $this->lblCreationDate->Text = sprintf($this->objInventoryModel->CreationDate) ? $this->objInventoryModel->__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->objInventoryModel->ModifiedByObject && $this->objInventoryModel->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstModifiedByObject->AddItem($objListItem); } } } if ($this->lblModifiedBy) { $this->lblModifiedBy->Text = $this->objInventoryModel->ModifiedByObject ? $this->objInventoryModel->ModifiedByObject->__toString() : null; } if ($this->lblModifiedDate) { if ($this->blnEditMode) { $this->lblModifiedDate->Text = $this->objInventoryModel->ModifiedDate; } } if ($this->lstInventoryModelCustomFieldHelper) { $this->lstInventoryModelCustomFieldHelper->RemoveAllItems(); $this->lstInventoryModelCustomFieldHelper->AddItem(QApplication::Translate('- Select One -'), null); $objInventoryModelCustomFieldHelperArray = InventoryModelCustomFieldHelper::LoadAll(); if ($objInventoryModelCustomFieldHelperArray) { foreach ($objInventoryModelCustomFieldHelperArray as $objInventoryModelCustomFieldHelper) { $objListItem = new QListItem($objInventoryModelCustomFieldHelper->__toString(), $objInventoryModelCustomFieldHelper->InventoryModelId); if ($objInventoryModelCustomFieldHelper->InventoryModelId == $this->objInventoryModel->InventoryModelId) { $objListItem->Selected = true; } $this->lstInventoryModelCustomFieldHelper->AddItem($objListItem); } } // Because InventoryModelCustomFieldHelper's InventoryModelCustomFieldHelper is not null, if a value is already selected, it cannot be changed. if ($this->lstInventoryModelCustomFieldHelper->SelectedValue) { $this->lstInventoryModelCustomFieldHelper->Enabled = false; } else { $this->lstInventoryModelCustomFieldHelper->Enabled = true; } } if ($this->lblInventoryModelCustomFieldHelper) { $this->lblInventoryModelCustomFieldHelper->Text = $this->objInventoryModel->InventoryModelCustomFieldHelper ? $this->objInventoryModel->InventoryModelCustomFieldHelper->__toString() : null; } }
/** * Refresh this MetaControl with Data from the local Contact object. * @param boolean $blnReload reload Contact from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objContact->Reload(); } if ($this->lblContactId) { if ($this->blnEditMode) { $this->lblContactId->Text = $this->objContact->ContactId; } } if ($this->lstCompany) { $this->lstCompany->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstCompany->AddItem(QApplication::Translate('- Select One -'), null); } $objCompanyArray = Company::LoadAll(); if ($objCompanyArray) { foreach ($objCompanyArray as $objCompany) { $objListItem = new QListItem($objCompany->__toString(), $objCompany->CompanyId); if ($this->objContact->Company && $this->objContact->Company->CompanyId == $objCompany->CompanyId) { $objListItem->Selected = true; } $this->lstCompany->AddItem($objListItem); } } } if ($this->lblCompanyId) { $this->lblCompanyId->Text = $this->objContact->Company ? $this->objContact->Company->__toString() : null; } if ($this->lstAddress) { $this->lstAddress->RemoveAllItems(); $this->lstAddress->AddItem(QApplication::Translate('- Select One -'), null); $objAddressArray = Address::LoadAll(); if ($objAddressArray) { foreach ($objAddressArray as $objAddress) { $objListItem = new QListItem($objAddress->__toString(), $objAddress->AddressId); if ($this->objContact->Address && $this->objContact->Address->AddressId == $objAddress->AddressId) { $objListItem->Selected = true; } $this->lstAddress->AddItem($objListItem); } } } if ($this->lblAddressId) { $this->lblAddressId->Text = $this->objContact->Address ? $this->objContact->Address->__toString() : null; } if ($this->txtFirstName) { $this->txtFirstName->Text = $this->objContact->FirstName; } if ($this->lblFirstName) { $this->lblFirstName->Text = $this->objContact->FirstName; } if ($this->txtLastName) { $this->txtLastName->Text = $this->objContact->LastName; } if ($this->lblLastName) { $this->lblLastName->Text = $this->objContact->LastName; } if ($this->txtTitle) { $this->txtTitle->Text = $this->objContact->Title; } if ($this->lblTitle) { $this->lblTitle->Text = $this->objContact->Title; } if ($this->txtEmail) { $this->txtEmail->Text = $this->objContact->Email; } if ($this->lblEmail) { $this->lblEmail->Text = $this->objContact->Email; } if ($this->txtPhoneOffice) { $this->txtPhoneOffice->Text = $this->objContact->PhoneOffice; } if ($this->lblPhoneOffice) { $this->lblPhoneOffice->Text = $this->objContact->PhoneOffice; } if ($this->txtPhoneHome) { $this->txtPhoneHome->Text = $this->objContact->PhoneHome; } if ($this->lblPhoneHome) { $this->lblPhoneHome->Text = $this->objContact->PhoneHome; } if ($this->txtPhoneMobile) { $this->txtPhoneMobile->Text = $this->objContact->PhoneMobile; } if ($this->lblPhoneMobile) { $this->lblPhoneMobile->Text = $this->objContact->PhoneMobile; } if ($this->txtFax) { $this->txtFax->Text = $this->objContact->Fax; } if ($this->lblFax) { $this->lblFax->Text = $this->objContact->Fax; } if ($this->txtDescription) { $this->txtDescription->Text = $this->objContact->Description; } if ($this->lblDescription) { $this->lblDescription->Text = $this->objContact->Description; } 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->objContact->CreatedByObject && $this->objContact->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstCreatedByObject->AddItem($objListItem); } } } if ($this->lblCreatedBy) { $this->lblCreatedBy->Text = $this->objContact->CreatedByObject ? $this->objContact->CreatedByObject->__toString() : null; } if ($this->calCreationDate) { $this->calCreationDate->DateTime = $this->objContact->CreationDate; } if ($this->lblCreationDate) { $this->lblCreationDate->Text = sprintf($this->objContact->CreationDate) ? $this->objContact->__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->objContact->ModifiedByObject && $this->objContact->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstModifiedByObject->AddItem($objListItem); } } } if ($this->lblModifiedBy) { $this->lblModifiedBy->Text = $this->objContact->ModifiedByObject ? $this->objContact->ModifiedByObject->__toString() : null; } if ($this->lblModifiedDate) { if ($this->blnEditMode) { $this->lblModifiedDate->Text = $this->objContact->ModifiedDate; } } if ($this->lstContactCustomFieldHelper) { $this->lstContactCustomFieldHelper->RemoveAllItems(); $this->lstContactCustomFieldHelper->AddItem(QApplication::Translate('- Select One -'), null); $objContactCustomFieldHelperArray = ContactCustomFieldHelper::LoadAll(); if ($objContactCustomFieldHelperArray) { foreach ($objContactCustomFieldHelperArray as $objContactCustomFieldHelper) { $objListItem = new QListItem($objContactCustomFieldHelper->__toString(), $objContactCustomFieldHelper->ContactId); if ($objContactCustomFieldHelper->ContactId == $this->objContact->ContactId) { $objListItem->Selected = true; } $this->lstContactCustomFieldHelper->AddItem($objListItem); } } // Because ContactCustomFieldHelper's ContactCustomFieldHelper is not null, if a value is already selected, it cannot be changed. if ($this->lstContactCustomFieldHelper->SelectedValue) { $this->lstContactCustomFieldHelper->Enabled = false; } else { $this->lstContactCustomFieldHelper->Enabled = true; } } if ($this->lblContactCustomFieldHelper) { $this->lblContactCustomFieldHelper->Text = $this->objContact->ContactCustomFieldHelper ? $this->objContact->ContactCustomFieldHelper->__toString() : null; } }
protected function CheckOutTo_Create() { $this->lstCheckOutTo = new QRadioButtonList($this); $this->lstCheckOutTo->AddItem(new QListItem('User', 1, false, null, 'FontSize=12px')); $this->lstCheckOutTo->AddItem(new QListItem('Contact', 2, false, null, 'FontSize=12px')); $this->lstCheckOutTo->SelectedIndex = 0; $this->lstCheckOutTo->AddAction(new QChangeEvent(), new QAjaxAction('lstCheckOutTo_Select')); $this->lstUser = new QListBox($this); $this->lstUser->Name = 'User'; $this->lstUser->AddItem('- Select One -', null); foreach (UserAccount::LoadAll(QQ::Clause(QQ::OrderBy(QQN::UserAccount()->Username))) as $objUser) { $this->lstUser->AddItem(sprintf("%s", $objUser->Username), $objUser->UserAccountId); } $this->lstCheckOutTo_Select(); }
/** * Refresh this MetaControl with Data from the local AssetTransaction object. * @param boolean $blnReload reload AssetTransaction from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objAssetTransaction->Reload(); } if ($this->lblAssetTransactionId) { if ($this->blnEditMode) { $this->lblAssetTransactionId->Text = $this->objAssetTransaction->AssetTransactionId; } } if ($this->lstAsset) { $this->lstAsset->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstAsset->AddItem(QApplication::Translate('- Select One -'), null); } $objAssetArray = Asset::LoadAll(); if ($objAssetArray) { foreach ($objAssetArray as $objAsset) { $objListItem = new QListItem($objAsset->__toString(), $objAsset->AssetId); if ($this->objAssetTransaction->Asset && $this->objAssetTransaction->Asset->AssetId == $objAsset->AssetId) { $objListItem->Selected = true; } $this->lstAsset->AddItem($objListItem); } } } if ($this->lblAssetId) { $this->lblAssetId->Text = $this->objAssetTransaction->Asset ? $this->objAssetTransaction->Asset->__toString() : null; } if ($this->lstTransaction) { $this->lstTransaction->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstTransaction->AddItem(QApplication::Translate('- Select One -'), null); } $objTransactionArray = Transaction::LoadAll(); if ($objTransactionArray) { foreach ($objTransactionArray as $objTransaction) { $objListItem = new QListItem($objTransaction->__toString(), $objTransaction->TransactionId); if ($this->objAssetTransaction->Transaction && $this->objAssetTransaction->Transaction->TransactionId == $objTransaction->TransactionId) { $objListItem->Selected = true; } $this->lstTransaction->AddItem($objListItem); } } } if ($this->lblTransactionId) { $this->lblTransactionId->Text = $this->objAssetTransaction->Transaction ? $this->objAssetTransaction->Transaction->__toString() : null; } if ($this->lstParentAssetTransaction) { $this->lstParentAssetTransaction->RemoveAllItems(); $this->lstParentAssetTransaction->AddItem(QApplication::Translate('- Select One -'), null); $objParentAssetTransactionArray = AssetTransaction::LoadAll(); if ($objParentAssetTransactionArray) { foreach ($objParentAssetTransactionArray as $objParentAssetTransaction) { $objListItem = new QListItem($objParentAssetTransaction->__toString(), $objParentAssetTransaction->AssetTransactionId); if ($this->objAssetTransaction->ParentAssetTransaction && $this->objAssetTransaction->ParentAssetTransaction->AssetTransactionId == $objParentAssetTransaction->AssetTransactionId) { $objListItem->Selected = true; } $this->lstParentAssetTransaction->AddItem($objListItem); } } } if ($this->lblParentAssetTransactionId) { $this->lblParentAssetTransactionId->Text = $this->objAssetTransaction->ParentAssetTransaction ? $this->objAssetTransaction->ParentAssetTransaction->__toString() : null; } if ($this->lstSourceLocation) { $this->lstSourceLocation->RemoveAllItems(); $this->lstSourceLocation->AddItem(QApplication::Translate('- Select One -'), null); $objSourceLocationArray = Location::LoadAll(); if ($objSourceLocationArray) { foreach ($objSourceLocationArray as $objSourceLocation) { $objListItem = new QListItem($objSourceLocation->__toString(), $objSourceLocation->LocationId); if ($this->objAssetTransaction->SourceLocation && $this->objAssetTransaction->SourceLocation->LocationId == $objSourceLocation->LocationId) { $objListItem->Selected = true; } $this->lstSourceLocation->AddItem($objListItem); } } } if ($this->lblSourceLocationId) { $this->lblSourceLocationId->Text = $this->objAssetTransaction->SourceLocation ? $this->objAssetTransaction->SourceLocation->__toString() : null; } if ($this->lstDestinationLocation) { $this->lstDestinationLocation->RemoveAllItems(); $this->lstDestinationLocation->AddItem(QApplication::Translate('- Select One -'), null); $objDestinationLocationArray = Location::LoadAll(); if ($objDestinationLocationArray) { foreach ($objDestinationLocationArray as $objDestinationLocation) { $objListItem = new QListItem($objDestinationLocation->__toString(), $objDestinationLocation->LocationId); if ($this->objAssetTransaction->DestinationLocation && $this->objAssetTransaction->DestinationLocation->LocationId == $objDestinationLocation->LocationId) { $objListItem->Selected = true; } $this->lstDestinationLocation->AddItem($objListItem); } } } if ($this->lblDestinationLocationId) { $this->lblDestinationLocationId->Text = $this->objAssetTransaction->DestinationLocation ? $this->objAssetTransaction->DestinationLocation->__toString() : null; } if ($this->chkNewAssetFlag) { $this->chkNewAssetFlag->Checked = $this->objAssetTransaction->NewAssetFlag; } if ($this->lblNewAssetFlag) { $this->lblNewAssetFlag->Text = $this->objAssetTransaction->NewAssetFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->lstNewAsset) { $this->lstNewAsset->RemoveAllItems(); $this->lstNewAsset->AddItem(QApplication::Translate('- Select One -'), null); $objNewAssetArray = Asset::LoadAll(); if ($objNewAssetArray) { foreach ($objNewAssetArray as $objNewAsset) { $objListItem = new QListItem($objNewAsset->__toString(), $objNewAsset->AssetId); if ($this->objAssetTransaction->NewAsset && $this->objAssetTransaction->NewAsset->AssetId == $objNewAsset->AssetId) { $objListItem->Selected = true; } $this->lstNewAsset->AddItem($objListItem); } } } if ($this->lblNewAssetId) { $this->lblNewAssetId->Text = $this->objAssetTransaction->NewAsset ? $this->objAssetTransaction->NewAsset->__toString() : null; } if ($this->chkScheduleReceiptFlag) { $this->chkScheduleReceiptFlag->Checked = $this->objAssetTransaction->ScheduleReceiptFlag; } if ($this->lblScheduleReceiptFlag) { $this->lblScheduleReceiptFlag->Text = $this->objAssetTransaction->ScheduleReceiptFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->calScheduleReceiptDueDate) { $this->calScheduleReceiptDueDate->DateTime = $this->objAssetTransaction->ScheduleReceiptDueDate; } if ($this->lblScheduleReceiptDueDate) { $this->lblScheduleReceiptDueDate->Text = sprintf($this->objAssetTransaction->ScheduleReceiptDueDate) ? $this->objAssetTransaction->__toString($this->strScheduleReceiptDueDateDateTimeFormat) : null; } 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->objAssetTransaction->CreatedByObject && $this->objAssetTransaction->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstCreatedByObject->AddItem($objListItem); } } } if ($this->lblCreatedBy) { $this->lblCreatedBy->Text = $this->objAssetTransaction->CreatedByObject ? $this->objAssetTransaction->CreatedByObject->__toString() : null; } if ($this->calCreationDate) { $this->calCreationDate->DateTime = $this->objAssetTransaction->CreationDate; } if ($this->lblCreationDate) { $this->lblCreationDate->Text = sprintf($this->objAssetTransaction->CreationDate) ? $this->objAssetTransaction->__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->objAssetTransaction->ModifiedByObject && $this->objAssetTransaction->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstModifiedByObject->AddItem($objListItem); } } } if ($this->lblModifiedBy) { $this->lblModifiedBy->Text = $this->objAssetTransaction->ModifiedByObject ? $this->objAssetTransaction->ModifiedByObject->__toString() : null; } if ($this->lblModifiedDate) { if ($this->blnEditMode) { $this->lblModifiedDate->Text = $this->objAssetTransaction->ModifiedDate; } } if ($this->lstAssetTransactionCheckout) { $this->lstAssetTransactionCheckout->RemoveAllItems(); $this->lstAssetTransactionCheckout->AddItem(QApplication::Translate('- Select One -'), null); $objAssetTransactionCheckoutArray = AssetTransactionCheckout::LoadAll(); if ($objAssetTransactionCheckoutArray) { foreach ($objAssetTransactionCheckoutArray as $objAssetTransactionCheckout) { $objListItem = new QListItem($objAssetTransactionCheckout->__toString(), $objAssetTransactionCheckout->AssetTransactionCheckoutId); if ($objAssetTransactionCheckout->AssetTransactionId == $this->objAssetTransaction->AssetTransactionId) { $objListItem->Selected = true; } $this->lstAssetTransactionCheckout->AddItem($objListItem); } } // Because AssetTransactionCheckout's AssetTransactionCheckout is not null, if a value is already selected, it cannot be changed. if ($this->lstAssetTransactionCheckout->SelectedValue) { $this->lstAssetTransactionCheckout->Enabled = false; } else { $this->lstAssetTransactionCheckout->Enabled = true; } } if ($this->lblAssetTransactionCheckout) { $this->lblAssetTransactionCheckout->Text = $this->objAssetTransaction->AssetTransactionCheckout ? $this->objAssetTransaction->AssetTransactionCheckout->__toString() : null; } }
/** * Refresh this MetaControl with Data from the local Shipment object. * @param boolean $blnReload reload Shipment from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objShipment->Reload(); } if ($this->lblShipmentId) { if ($this->blnEditMode) { $this->lblShipmentId->Text = $this->objShipment->ShipmentId; } } if ($this->txtShipmentNumber) { $this->txtShipmentNumber->Text = $this->objShipment->ShipmentNumber; } if ($this->lblShipmentNumber) { $this->lblShipmentNumber->Text = $this->objShipment->ShipmentNumber; } if ($this->lstTransaction) { $this->lstTransaction->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstTransaction->AddItem(QApplication::Translate('- Select One -'), null); } $objTransactionArray = Transaction::LoadAll(); if ($objTransactionArray) { foreach ($objTransactionArray as $objTransaction) { $objListItem = new QListItem($objTransaction->__toString(), $objTransaction->TransactionId); if ($this->objShipment->Transaction && $this->objShipment->Transaction->TransactionId == $objTransaction->TransactionId) { $objListItem->Selected = true; } $this->lstTransaction->AddItem($objListItem); } } } if ($this->lblTransactionId) { $this->lblTransactionId->Text = $this->objShipment->Transaction ? $this->objShipment->Transaction->__toString() : null; } if ($this->lstFromCompany) { $this->lstFromCompany->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstFromCompany->AddItem(QApplication::Translate('- Select One -'), null); } $objFromCompanyArray = Company::LoadAll(); if ($objFromCompanyArray) { foreach ($objFromCompanyArray as $objFromCompany) { $objListItem = new QListItem($objFromCompany->__toString(), $objFromCompany->CompanyId); if ($this->objShipment->FromCompany && $this->objShipment->FromCompany->CompanyId == $objFromCompany->CompanyId) { $objListItem->Selected = true; } $this->lstFromCompany->AddItem($objListItem); } } } if ($this->lblFromCompanyId) { $this->lblFromCompanyId->Text = $this->objShipment->FromCompany ? $this->objShipment->FromCompany->__toString() : null; } if ($this->lstFromContact) { $this->lstFromContact->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstFromContact->AddItem(QApplication::Translate('- Select One -'), null); } $objFromContactArray = Contact::LoadAll(); if ($objFromContactArray) { foreach ($objFromContactArray as $objFromContact) { $objListItem = new QListItem($objFromContact->__toString(), $objFromContact->ContactId); if ($this->objShipment->FromContact && $this->objShipment->FromContact->ContactId == $objFromContact->ContactId) { $objListItem->Selected = true; } $this->lstFromContact->AddItem($objListItem); } } } if ($this->lblFromContactId) { $this->lblFromContactId->Text = $this->objShipment->FromContact ? $this->objShipment->FromContact->__toString() : null; } if ($this->lstFromAddress) { $this->lstFromAddress->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstFromAddress->AddItem(QApplication::Translate('- Select One -'), null); } $objFromAddressArray = Address::LoadAll(); if ($objFromAddressArray) { foreach ($objFromAddressArray as $objFromAddress) { $objListItem = new QListItem($objFromAddress->__toString(), $objFromAddress->AddressId); if ($this->objShipment->FromAddress && $this->objShipment->FromAddress->AddressId == $objFromAddress->AddressId) { $objListItem->Selected = true; } $this->lstFromAddress->AddItem($objListItem); } } } if ($this->lblFromAddressId) { $this->lblFromAddressId->Text = $this->objShipment->FromAddress ? $this->objShipment->FromAddress->__toString() : null; } if ($this->lstToCompany) { $this->lstToCompany->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstToCompany->AddItem(QApplication::Translate('- Select One -'), null); } $objToCompanyArray = Company::LoadAll(); if ($objToCompanyArray) { foreach ($objToCompanyArray as $objToCompany) { $objListItem = new QListItem($objToCompany->__toString(), $objToCompany->CompanyId); if ($this->objShipment->ToCompany && $this->objShipment->ToCompany->CompanyId == $objToCompany->CompanyId) { $objListItem->Selected = true; } $this->lstToCompany->AddItem($objListItem); } } } if ($this->lblToCompanyId) { $this->lblToCompanyId->Text = $this->objShipment->ToCompany ? $this->objShipment->ToCompany->__toString() : null; } if ($this->lstToContact) { $this->lstToContact->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstToContact->AddItem(QApplication::Translate('- Select One -'), null); } $objToContactArray = Contact::LoadAll(); if ($objToContactArray) { foreach ($objToContactArray as $objToContact) { $objListItem = new QListItem($objToContact->__toString(), $objToContact->ContactId); if ($this->objShipment->ToContact && $this->objShipment->ToContact->ContactId == $objToContact->ContactId) { $objListItem->Selected = true; } $this->lstToContact->AddItem($objListItem); } } } if ($this->lblToContactId) { $this->lblToContactId->Text = $this->objShipment->ToContact ? $this->objShipment->ToContact->__toString() : null; } if ($this->lstToAddress) { $this->lstToAddress->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstToAddress->AddItem(QApplication::Translate('- Select One -'), null); } $objToAddressArray = Address::LoadAll(); if ($objToAddressArray) { foreach ($objToAddressArray as $objToAddress) { $objListItem = new QListItem($objToAddress->__toString(), $objToAddress->AddressId); if ($this->objShipment->ToAddress && $this->objShipment->ToAddress->AddressId == $objToAddress->AddressId) { $objListItem->Selected = true; } $this->lstToAddress->AddItem($objListItem); } } } if ($this->lblToAddressId) { $this->lblToAddressId->Text = $this->objShipment->ToAddress ? $this->objShipment->ToAddress->__toString() : null; } if ($this->lstCourier) { $this->lstCourier->RemoveAllItems(); $this->lstCourier->AddItem(QApplication::Translate('- Select One -'), null); $objCourierArray = Courier::LoadAll(); if ($objCourierArray) { foreach ($objCourierArray as $objCourier) { $objListItem = new QListItem($objCourier->__toString(), $objCourier->CourierId); if ($this->objShipment->Courier && $this->objShipment->Courier->CourierId == $objCourier->CourierId) { $objListItem->Selected = true; } $this->lstCourier->AddItem($objListItem); } } } if ($this->lblCourierId) { $this->lblCourierId->Text = $this->objShipment->Courier ? $this->objShipment->Courier->__toString() : null; } if ($this->txtTrackingNumber) { $this->txtTrackingNumber->Text = $this->objShipment->TrackingNumber; } if ($this->lblTrackingNumber) { $this->lblTrackingNumber->Text = $this->objShipment->TrackingNumber; } if ($this->calShipDate) { $this->calShipDate->DateTime = $this->objShipment->ShipDate; } if ($this->lblShipDate) { $this->lblShipDate->Text = sprintf($this->objShipment->ShipDate) ? $this->objShipment->__toString($this->strShipDateDateTimeFormat) : null; } if ($this->chkShippedFlag) { $this->chkShippedFlag->Checked = $this->objShipment->ShippedFlag; } if ($this->lblShippedFlag) { $this->lblShippedFlag->Text = $this->objShipment->ShippedFlag ? 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->objShipment->CreatedByObject && $this->objShipment->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstCreatedByObject->AddItem($objListItem); } } } if ($this->lblCreatedBy) { $this->lblCreatedBy->Text = $this->objShipment->CreatedByObject ? $this->objShipment->CreatedByObject->__toString() : null; } if ($this->calCreationDate) { $this->calCreationDate->DateTime = $this->objShipment->CreationDate; } if ($this->lblCreationDate) { $this->lblCreationDate->Text = sprintf($this->objShipment->CreationDate) ? $this->objShipment->__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->objShipment->ModifiedByObject && $this->objShipment->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstModifiedByObject->AddItem($objListItem); } } } if ($this->lblModifiedBy) { $this->lblModifiedBy->Text = $this->objShipment->ModifiedByObject ? $this->objShipment->ModifiedByObject->__toString() : null; } if ($this->lblModifiedDate) { if ($this->blnEditMode) { $this->lblModifiedDate->Text = $this->objShipment->ModifiedDate; } } if ($this->lstShipmentCustomFieldHelper) { $this->lstShipmentCustomFieldHelper->RemoveAllItems(); $this->lstShipmentCustomFieldHelper->AddItem(QApplication::Translate('- Select One -'), null); $objShipmentCustomFieldHelperArray = ShipmentCustomFieldHelper::LoadAll(); if ($objShipmentCustomFieldHelperArray) { foreach ($objShipmentCustomFieldHelperArray as $objShipmentCustomFieldHelper) { $objListItem = new QListItem($objShipmentCustomFieldHelper->__toString(), $objShipmentCustomFieldHelper->ShipmentId); if ($objShipmentCustomFieldHelper->ShipmentId == $this->objShipment->ShipmentId) { $objListItem->Selected = true; } $this->lstShipmentCustomFieldHelper->AddItem($objListItem); } } // Because ShipmentCustomFieldHelper's ShipmentCustomFieldHelper is not null, if a value is already selected, it cannot be changed. if ($this->lstShipmentCustomFieldHelper->SelectedValue) { $this->lstShipmentCustomFieldHelper->Enabled = false; } else { $this->lstShipmentCustomFieldHelper->Enabled = true; } } if ($this->lblShipmentCustomFieldHelper) { $this->lblShipmentCustomFieldHelper->Text = $this->objShipment->ShipmentCustomFieldHelper ? $this->objShipment->ShipmentCustomFieldHelper->__toString() : null; } }
/** * Refresh this MetaControl with Data from the local Asset object. * @param boolean $blnReload reload Asset from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objAsset->Reload(); } if ($this->lblAssetId) { if ($this->blnEditMode) { $this->lblAssetId->Text = $this->objAsset->AssetId; } } if ($this->lstParentAsset) { $this->lstParentAsset->RemoveAllItems(); $this->lstParentAsset->AddItem(QApplication::Translate('- Select One -'), null); $objParentAssetArray = Asset::LoadAll(); if ($objParentAssetArray) { foreach ($objParentAssetArray as $objParentAsset) { $objListItem = new QListItem($objParentAsset->__toString(), $objParentAsset->AssetId); if ($this->objAsset->ParentAsset && $this->objAsset->ParentAsset->AssetId == $objParentAsset->AssetId) { $objListItem->Selected = true; } $this->lstParentAsset->AddItem($objListItem); } } } if ($this->lblParentAssetId) { $this->lblParentAssetId->Text = $this->objAsset->ParentAsset ? $this->objAsset->ParentAsset->__toString() : null; } if ($this->lstAssetModel) { $this->lstAssetModel->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstAssetModel->AddItem(QApplication::Translate('- Select One -'), null); } $objAssetModelArray = AssetModel::LoadAll(); if ($objAssetModelArray) { foreach ($objAssetModelArray as $objAssetModel) { $objListItem = new QListItem($objAssetModel->__toString(), $objAssetModel->AssetModelId); if ($this->objAsset->AssetModel && $this->objAsset->AssetModel->AssetModelId == $objAssetModel->AssetModelId) { $objListItem->Selected = true; } $this->lstAssetModel->AddItem($objListItem); } } } if ($this->lblAssetModelId) { $this->lblAssetModelId->Text = $this->objAsset->AssetModel ? $this->objAsset->AssetModel->__toString() : null; } if ($this->lstLocation) { $this->lstLocation->RemoveAllItems(); $this->lstLocation->AddItem(QApplication::Translate('- Select One -'), null); $objLocationArray = Location::LoadAll(); if ($objLocationArray) { foreach ($objLocationArray as $objLocation) { $objListItem = new QListItem($objLocation->__toString(), $objLocation->LocationId); if ($this->objAsset->Location && $this->objAsset->Location->LocationId == $objLocation->LocationId) { $objListItem->Selected = true; } $this->lstLocation->AddItem($objListItem); } } } if ($this->lblLocationId) { $this->lblLocationId->Text = $this->objAsset->Location ? $this->objAsset->Location->__toString() : null; } if ($this->txtAssetCode) { $this->txtAssetCode->Text = $this->objAsset->AssetCode; } if ($this->lblAssetCode) { $this->lblAssetCode->Text = $this->objAsset->AssetCode; } if ($this->txtImagePath) { $this->txtImagePath->Text = $this->objAsset->ImagePath; } if ($this->lblImagePath) { $this->lblImagePath->Text = $this->objAsset->ImagePath; } if ($this->chkCheckedOutFlag) { $this->chkCheckedOutFlag->Checked = $this->objAsset->CheckedOutFlag; } if ($this->lblCheckedOutFlag) { $this->lblCheckedOutFlag->Text = $this->objAsset->CheckedOutFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->chkReservedFlag) { $this->chkReservedFlag->Checked = $this->objAsset->ReservedFlag; } if ($this->lblReservedFlag) { $this->lblReservedFlag->Text = $this->objAsset->ReservedFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->chkLinkedFlag) { $this->chkLinkedFlag->Checked = $this->objAsset->LinkedFlag; } if ($this->lblLinkedFlag) { $this->lblLinkedFlag->Text = $this->objAsset->LinkedFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->chkArchivedFlag) { $this->chkArchivedFlag->Checked = $this->objAsset->ArchivedFlag; } if ($this->lblArchivedFlag) { $this->lblArchivedFlag->Text = $this->objAsset->ArchivedFlag ? 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->objAsset->CreatedByObject && $this->objAsset->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstCreatedByObject->AddItem($objListItem); } } } if ($this->lblCreatedBy) { $this->lblCreatedBy->Text = $this->objAsset->CreatedByObject ? $this->objAsset->CreatedByObject->__toString() : null; } if ($this->calCreationDate) { $this->calCreationDate->DateTime = $this->objAsset->CreationDate; } if ($this->lblCreationDate) { $this->lblCreationDate->Text = sprintf($this->objAsset->CreationDate) ? $this->objAsset->__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->objAsset->ModifiedByObject && $this->objAsset->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstModifiedByObject->AddItem($objListItem); } } } if ($this->lblModifiedBy) { $this->lblModifiedBy->Text = $this->objAsset->ModifiedByObject ? $this->objAsset->ModifiedByObject->__toString() : null; } if ($this->lblModifiedDate) { if ($this->blnEditMode) { $this->lblModifiedDate->Text = $this->objAsset->ModifiedDate; } } if ($this->chkDepreciationFlag) { $this->chkDepreciationFlag->Checked = $this->objAsset->DepreciationFlag; } if ($this->lblDepreciationFlag) { $this->lblDepreciationFlag->Text = $this->objAsset->DepreciationFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->calPurchaseDate) { $this->calPurchaseDate->DateTime = $this->objAsset->PurchaseDate; } if ($this->lblPurchaseDate) { $this->lblPurchaseDate->Text = sprintf($this->objAsset->PurchaseDate) ? $this->objAsset->__toString($this->strPurchaseDateDateTimeFormat) : null; } if ($this->txtPurchaseCost) { $this->txtPurchaseCost->Text = $this->objAsset->PurchaseCost; } if ($this->lblPurchaseCost) { $this->lblPurchaseCost->Text = $this->objAsset->PurchaseCost; } if ($this->lstAssetCustomFieldHelper) { $this->lstAssetCustomFieldHelper->RemoveAllItems(); $this->lstAssetCustomFieldHelper->AddItem(QApplication::Translate('- Select One -'), null); $objAssetCustomFieldHelperArray = AssetCustomFieldHelper::LoadAll(); if ($objAssetCustomFieldHelperArray) { foreach ($objAssetCustomFieldHelperArray as $objAssetCustomFieldHelper) { $objListItem = new QListItem($objAssetCustomFieldHelper->__toString(), $objAssetCustomFieldHelper->AssetId); if ($objAssetCustomFieldHelper->AssetId == $this->objAsset->AssetId) { $objListItem->Selected = true; } $this->lstAssetCustomFieldHelper->AddItem($objListItem); } } // Because AssetCustomFieldHelper's AssetCustomFieldHelper is not null, if a value is already selected, it cannot be changed. if ($this->lstAssetCustomFieldHelper->SelectedValue) { $this->lstAssetCustomFieldHelper->Enabled = false; } else { $this->lstAssetCustomFieldHelper->Enabled = true; } } if ($this->lblAssetCustomFieldHelper) { $this->lblAssetCustomFieldHelper->Text = $this->objAsset->AssetCustomFieldHelper ? $this->objAsset->AssetCustomFieldHelper->__toString() : null; } }
protected function Form_Create() { if (QApplication::QueryString('intDownloadCsv')) { $this->RenderBegin(false); session_cache_limiter('must-revalidate'); // force a "no cache" effect header("Pragma: hack"); // IE chokes on "no cache", so set to something, anything, else. $ExpStr = "Expires: " . gmdate("D, d M Y H:i:s", time()) . " GMT"; header($ExpStr); header('Content-Type: text/csv'); header('Content-Disposition: csv; filename=skipped_records.csv'); $file = fopen(sprintf("%s%s/%s_skipped.csv", __DOCROOT__ . __SUBDIRECTORY__, __TRACMOR_TMP__, $_SESSION['intUserAccountId']), "r"); ob_end_clean(); while ($row = fgets($file, 1000)) { print $row; @ob_flush(); flush(); } QApplication::$JavaScriptArray = array(); QApplication::$JavaScriptArrayHighPriority = array(); $this->RenderEnd(false); exit; } // Create the Header Menu $this->ctlHeaderMenu_Create(); $this->pnlMain_Create(); $this->pnlStepOne_Create(); $this->Buttons_Create(); $this->intStep = 1; $this->intSkippedRecordCount = 0; $this->blnImportEnd = true; $this->btnRemoveArray = array(); $this->arrAssetCustomField = array(); $this->Labels_Create(); $this->objDatabase = Asset::GetDatabase(); // Load Asset Custom Field foreach (CustomField::LoadArrayByActiveFlagEntity(1, 1) as $objCustomField) { $this->arrAssetCustomField[$objCustomField->CustomFieldId] = $objCustomField; } $this->arrAssetModelCustomField = array(); // Load Asset Model Custom Field foreach (CustomField::LoadArrayByActiveFlagEntity(1, 4) as $objCustomField) { $this->arrAssetModelCustomField[$objCustomField->CustomFieldId] = $objCustomField; } $this->intUserArray = array(); // Load Users foreach (UserAccount::LoadAll() as $objUser) { $this->intUserArray[strtolower($objUser->Username)] = $objUser->UserAccountId; } $this->strAcceptibleMimeArray = array('text/plain' => 'txt', 'text/comma-separated-values' => 'csv', 'text/csv' => 'csv', 'text/x-comma-separated-values' => 'csv', 'application/vnd.ms-excel' => 'csv', 'application/csv' => 'csv', 'text/x-csv' => 'csv'); }
protected function lstCheckedOutBy_Create() { $this->lstCheckedOutBy = new QListBox($this); $this->lstCheckedOutBy->Name = 'Checked Out By'; $this->lstCheckedOutBy->AddItem('- Select One -', null, true); $this->lstCheckedOutBy->AddItem('Any', 'any'); $objUserAccountArray = UserAccount::LoadAll(QQ::Clause(QQ::OrderBy(QQN::UserAccount()->Username))); if ($objUserAccountArray) { foreach ($objUserAccountArray as $objUserAccount) { $this->lstCheckedOutBy->AddItem($objUserAccount->__toString(), $objUserAccount->UserAccountId); } } }
/** * Refresh this MetaControl with Data from the local RoleModuleAuthorization object. * @param boolean $blnReload reload RoleModuleAuthorization from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objRoleModuleAuthorization->Reload(); } if ($this->lblRoleModuleAuthorizationId) { if ($this->blnEditMode) { $this->lblRoleModuleAuthorizationId->Text = $this->objRoleModuleAuthorization->RoleModuleAuthorizationId; } } if ($this->lstRoleModule) { $this->lstRoleModule->RemoveAllItems(); $this->lstRoleModule->AddItem(QApplication::Translate('- Select One -'), null); $objRoleModuleArray = RoleModule::LoadAll(); if ($objRoleModuleArray) { foreach ($objRoleModuleArray as $objRoleModule) { $objListItem = new QListItem($objRoleModule->__toString(), $objRoleModule->RoleModuleId); if ($this->objRoleModuleAuthorization->RoleModule && $this->objRoleModuleAuthorization->RoleModule->RoleModuleId == $objRoleModule->RoleModuleId) { $objListItem->Selected = true; } $this->lstRoleModule->AddItem($objListItem); } } } if ($this->lblRoleModuleId) { $this->lblRoleModuleId->Text = $this->objRoleModuleAuthorization->RoleModule ? $this->objRoleModuleAuthorization->RoleModule->__toString() : null; } if ($this->lstAuthorization) { $this->lstAuthorization->RemoveAllItems(); $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->objRoleModuleAuthorization->Authorization && $this->objRoleModuleAuthorization->Authorization->AuthorizationId == $objAuthorization->AuthorizationId) { $objListItem->Selected = true; } $this->lstAuthorization->AddItem($objListItem); } } } if ($this->lblAuthorizationId) { $this->lblAuthorizationId->Text = $this->objRoleModuleAuthorization->Authorization ? $this->objRoleModuleAuthorization->Authorization->__toString() : null; } if ($this->lstAuthorizationLevel) { $this->lstAuthorizationLevel->RemoveAllItems(); $this->lstAuthorizationLevel->AddItem(QApplication::Translate('- Select One -'), null); $objAuthorizationLevelArray = AuthorizationLevel::LoadAll(); if ($objAuthorizationLevelArray) { foreach ($objAuthorizationLevelArray as $objAuthorizationLevel) { $objListItem = new QListItem($objAuthorizationLevel->__toString(), $objAuthorizationLevel->AuthorizationLevelId); if ($this->objRoleModuleAuthorization->AuthorizationLevel && $this->objRoleModuleAuthorization->AuthorizationLevel->AuthorizationLevelId == $objAuthorizationLevel->AuthorizationLevelId) { $objListItem->Selected = true; } $this->lstAuthorizationLevel->AddItem($objListItem); } } } if ($this->lblAuthorizationLevelId) { $this->lblAuthorizationLevelId->Text = $this->objRoleModuleAuthorization->AuthorizationLevel ? $this->objRoleModuleAuthorization->AuthorizationLevel->__toString() : null; } 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->objRoleModuleAuthorization->CreatedByObject && $this->objRoleModuleAuthorization->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstCreatedByObject->AddItem($objListItem); } } } if ($this->lblCreatedBy) { $this->lblCreatedBy->Text = $this->objRoleModuleAuthorization->CreatedByObject ? $this->objRoleModuleAuthorization->CreatedByObject->__toString() : null; } if ($this->calCreationDate) { $this->calCreationDate->DateTime = $this->objRoleModuleAuthorization->CreationDate; } if ($this->lblCreationDate) { $this->lblCreationDate->Text = sprintf($this->objRoleModuleAuthorization->CreationDate) ? $this->objRoleModuleAuthorization->__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->objRoleModuleAuthorization->ModifiedByObject && $this->objRoleModuleAuthorization->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstModifiedByObject->AddItem($objListItem); } } } if ($this->lblModifiedBy) { $this->lblModifiedBy->Text = $this->objRoleModuleAuthorization->ModifiedByObject ? $this->objRoleModuleAuthorization->ModifiedByObject->__toString() : null; } if ($this->lblModifiedDate) { if ($this->blnEditMode) { $this->lblModifiedDate->Text = $this->objRoleModuleAuthorization->ModifiedDate; } } }
/** * Refresh this MetaControl with Data from the local Attachment object. * @param boolean $blnReload reload Attachment from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objAttachment->Reload(); } if ($this->lblAttachmentId) { if ($this->blnEditMode) { $this->lblAttachmentId->Text = $this->objAttachment->AttachmentId; } } if ($this->lstEntityQtype) { $this->lstEntityQtype->SelectedValue = $this->objAttachment->EntityQtypeId; } if ($this->lblEntityQtypeId) { $this->lblEntityQtypeId->Text = $this->objAttachment->EntityQtypeId ? EntityQtype::$NameArray[$this->objAttachment->EntityQtypeId] : null; } if ($this->txtEntityId) { $this->txtEntityId->Text = $this->objAttachment->EntityId; } if ($this->lblEntityId) { $this->lblEntityId->Text = $this->objAttachment->EntityId; } if ($this->txtFilename) { $this->txtFilename->Text = $this->objAttachment->Filename; } if ($this->lblFilename) { $this->lblFilename->Text = $this->objAttachment->Filename; } if ($this->txtTmpFilename) { $this->txtTmpFilename->Text = $this->objAttachment->TmpFilename; } if ($this->lblTmpFilename) { $this->lblTmpFilename->Text = $this->objAttachment->TmpFilename; } if ($this->txtFileType) { $this->txtFileType->Text = $this->objAttachment->FileType; } if ($this->lblFileType) { $this->lblFileType->Text = $this->objAttachment->FileType; } if ($this->txtPath) { $this->txtPath->Text = $this->objAttachment->Path; } if ($this->lblPath) { $this->lblPath->Text = $this->objAttachment->Path; } if ($this->txtSize) { $this->txtSize->Text = $this->objAttachment->Size; } if ($this->lblSize) { $this->lblSize->Text = $this->objAttachment->Size; } if ($this->lstCreatedByObject) { $this->lstCreatedByObject->RemoveAllItems(); if (!$this->blnEditMode) { $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->objAttachment->CreatedByObject && $this->objAttachment->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstCreatedByObject->AddItem($objListItem); } } } if ($this->lblCreatedBy) { $this->lblCreatedBy->Text = $this->objAttachment->CreatedByObject ? $this->objAttachment->CreatedByObject->__toString() : null; } if ($this->calCreationDate) { $this->calCreationDate->DateTime = $this->objAttachment->CreationDate; } if ($this->lblCreationDate) { $this->lblCreationDate->Text = sprintf($this->objAttachment->CreationDate) ? $this->objAttachment->__toString($this->strCreationDateDateTimeFormat) : null; } }
protected function lstModifiedByObject_Create() { $this->lstModifiedByObject = new QListBox($this); $this->lstModifiedByObject->Name = QApplication::Translate('Modified By Object'); $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->objCategory->ModifiedByObject && $this->objCategory->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstModifiedByObject->AddItem($objListItem); } } }
protected function dtgUserAccount_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->dtgUserAccount->TotalItemCount = UserAccount::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->dtgUserAccount->OrderByClause) { array_push($objClauses, $objClause); } // Add the LimitClause information, as well if ($objClause = $this->dtgUserAccount->LimitClause) { array_push($objClauses, $objClause); } // Set the DataSource to be the array of all UserAccount objects, given the clauses above $this->dtgUserAccount->DataSource = UserAccount::LoadAll($objClauses); }