/** * Create and setup QListBox lstCommunicationListEntry * @param string $strControlId optional ControlId to use * @param QQCondition $objConditions override the default condition of QQ::All() to the query, itself * @param QQClause[] $objOptionalClauses additional optional QQClause object or array of QQClause objects for the query * @return QListBox */ public function lstCommunicationListEntry_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstCommunicationListEntry = new QListBox($this->objParentObject, $strControlId); $this->lstCommunicationListEntry->Name = QApplication::Translate('Communication List Entry'); $this->lstCommunicationListEntry->AddItem(QApplication::Translate('- Select One -'), null); // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objCommunicationListEntryCursor = CommunicationListEntry::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objCommunicationListEntry = CommunicationListEntry::InstantiateCursor($objCommunicationListEntryCursor)) { $objListItem = new QListItem($objCommunicationListEntry->__toString(), $objCommunicationListEntry->Id); if ($this->objEmailMessageRoute->CommunicationListEntry && $this->objEmailMessageRoute->CommunicationListEntry->Id == $objCommunicationListEntry->Id) { $objListItem->Selected = true; } $this->lstCommunicationListEntry->AddItem($objListItem); } // Return the QListBox return $this->lstCommunicationListEntry; }
/** * Create and setup QListBox lstCommunicationListEntries * @param string $strControlId optional ControlId to use * @param QQCondition $objConditions override the default condition of QQ::All() to the query, itself * @param QQClause[] $objOptionalClauses additional optional QQClause object or array of QQClause objects for the query * @return QListBox */ public function lstCommunicationListEntries_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstCommunicationListEntries = new QListBox($this->objParentObject, $strControlId); $this->lstCommunicationListEntries->Name = QApplication::Translate('Communication List Entries'); $this->lstCommunicationListEntries->SelectionMode = QSelectionMode::Multiple; // We need to know which items to "Pre-Select" $objAssociatedArray = $this->objCommunicationList->GetCommunicationListEntryArray(); // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objCommunicationListEntryCursor = CommunicationListEntry::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objCommunicationListEntry = CommunicationListEntry::InstantiateCursor($objCommunicationListEntryCursor)) { $objListItem = new QListItem($objCommunicationListEntry->__toString(), $objCommunicationListEntry->Id); foreach ($objAssociatedArray as $objAssociated) { if ($objAssociated->Id == $objCommunicationListEntry->Id) { $objListItem->Selected = true; } } $this->lstCommunicationListEntries->AddItem($objListItem); } // Return the QListControl return $this->lstCommunicationListEntries; }