protected function dtgCourier_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->dtgCourier->TotalItemCount = Courier::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->dtgCourier->OrderByClause) { array_push($objClauses, $objClause); } // Add the LimitClause information, as well if ($objClause = $this->dtgCourier->LimitClause) { array_push($objClauses, $objClause); } // Set the DataSource to be the array of all Courier objects, given the clauses above $this->dtgCourier->DataSource = Courier::LoadAll($objClauses); }
protected function lstCourier_Create() { $this->lstCourier = new QListBox($this); $this->lstCourier->Name = QApplication::Translate('Courier'); $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); } } }
/** * 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; } }
protected function lstCourier_Create() { $this->lstCourier = new QListBox($this); $this->lstCourier->Name = QApplication::Translate('Courier'); $this->lstCourier->Required = true; //if (!$this->blnEditMode) $this->lstCourier->AddItem('- Select One -', null); $objCourierArray = Courier::LoadAll(QQ::Clause(QQ::OrderBy(QQN::Courier()->ShortDescription))); if ($objCourierArray) { foreach ($objCourierArray as $objCourier) { if ($objCourier->ActiveFlag) { $objListItem = new QListItem($objCourier->__toString(), $objCourier->CourierId); if ($this->objShipment->CourierId && $this->objShipment->CourierId == $objCourier->CourierId) { $objListItem->Selected = true; } $this->lstCourier->AddItem($objListItem); } } } if ($this->blnEditMode && !$this->objShipment->CourierId) { $this->lstCourier->AddItem('Other', null, true); } else { $this->lstCourier->AddItem('Other', null); } $this->lstCourier->TabIndex = 7; }
protected function Form_PreRender() { $this->dtgCourier->TotalItemCount = Courier::CountAll(); if ($this->dtgCourier->TotalItemCount == 0) { $this->dtgCourier->ShowHeader = false; } else { $objClauses = array(); if ($objClause = $this->dtgCourier->OrderByClause) { array_push($objClauses, $objClause); } if ($objClause = $this->dtgCourier->LimitClause) { array_push($objClauses, $objClause); } $this->dtgCourier->DataSource = Courier::LoadAll($objClauses); $this->dtgCourier->ShowHeader = true; } }
protected function lstCourier_Create() { $this->lstCourier = new QListBox($this); $this->lstCourier->Name = 'Courier'; $this->lstCourier->AddItem('- Select One -', null, true); $objCourierArray = Courier::LoadAll(); if ($objCourierArray) { foreach ($objCourierArray as $objCourier) { $this->lstCourier->AddItem($objCourier->__toString(), $objCourier->CourierId); } } }
protected function lstCourier_Create() { $this->lstCourier = new QListBox($this, 'Courier'); $this->lstCourier->Name = QApplication::Translate('Courier'); $this->lstCourier->Required = true; $this->lstCourier->AddItem('- Select One -', null); $objCourierArray = Courier::LoadAll(QQ::Clause(QQ::OrderBy(QQN::Courier()->ShortDescription))); if ($objCourierArray) { foreach ($objCourierArray as $objCourier) { if ($objCourier->ActiveFlag) { $objListItem = new QListItem($objCourier->__toString(), $objCourier->CourierId); $this->lstCourier->AddItem($objListItem); } } } $this->lstCourier->AddItem('Other', null); }
public function dtgCourier_Bind() { // Get Total Count b/c of Pagination $this->dtgCourier->TotalItemCount = Courier::CountAll(); $objClauses = array(); if ($objClause = $this->dtgCourier->OrderByClause) { array_push($objClauses, $objClause); } if ($objClause = $this->dtgCourier->LimitClause) { array_push($objClauses, $objClause); } $this->dtgCourier->DataSource = Courier::LoadAll($objClauses); }
protected function Form_PreRender() { $objExpansionMap[ShippingAccount::ExpandCourier] = true; // Get Total Count b/c of Pagination $this->dtgShippingAccount->TotalItemCount = ShippingAccount::CountAll(); if ($this->dtgShippingAccount->TotalItemCount == 0) { $this->dtgShippingAccount->ShowHeader = false; } else { $objClauses = array(); if ($objClause = $this->dtgShippingAccount->OrderByClause) { array_push($objClauses, $objClause); } if ($objClause = $this->dtgShippingAccount->LimitClause) { array_push($objClauses, $objClause); } if ($objClause = QQ::Expand(QQN::ShippingAccount()->Courier)) { array_push($objClauses, $objClause); } $this->dtgShippingAccount->DataSource = ShippingAccount::LoadAll($objClauses); $this->dtgShippingAccount->ShowHeader = true; } $this->dtgCourier->TotalItemCount = Courier::CountAll(); if ($this->dtgCourier->TotalItemCount == 0) { $this->dtgCourier->ShowHeader = false; } else { $objClauses = array(); if ($objClause = $this->dtgCourier->OrderByClause) { array_push($objClauses, $objClause); } if ($objClause = $this->dtgCourier->LimitClause) { array_push($objClauses, $objClause); } $this->dtgCourier->DataSource = Courier::LoadAll($objClauses); $this->dtgCourier->ShowHeader = true; } }