/** * Create and setup QListBox lstUser * @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 lstUser_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstUser = new QListBox($this->objParentObject, $strControlId); $this->lstUser->Name = QApplication::Translate('User'); $this->lstUser->AddItem(QApplication::Translate('- Select One -'), null); // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objUserCursor = NarroUser::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objUser = NarroUser::InstantiateCursor($objUserCursor)) { $objListItem = new QListItem($objUser->__toString(), $objUser->UserId); if ($this->objNarroLog->User && $this->objNarroLog->User->UserId == $objUser->UserId) { $objListItem->Selected = true; } $this->lstUser->AddItem($objListItem); } // Return the QListBox return $this->lstUser; }