'sorter ASC'); protected $_reorderTitleColumn = 'name'; protected function _bindListColumns(Qs_Sys_ViewController_List $list) { $list->addColumn( 'image', 'image', array('attribs' => array('width' => 100)) ); $list->addColumn( 'text', 'name', array( 'attribs' => array('width' => 150), 'orderBy' => 'name' ) ); $list->addColumn( 'text', 'jobTitle', array( 'attribs' => array('width' => 150), 'orderBy' => 'jobTitle' ) ); $list->addColumn( 'text', 'group' ); $list->addColumn( 'options', 'options', array ( 'attribs' => array('width' => 100, 'align' => 'center')) ); return $this; } protected function _bindFormFields(Qs_Form $form) { $form->addElement( 'extendedImage', 'image', array( 'label' => 'Image', 'resize' => self::IMAGE_WIDTH . 'x' . self::IMAGE_HEIGHT ) ); $form->addElement( 'select', 'groupId', array( 'label' => 'Group', 'required' => true, 'multioptions' => $this->dataObj->getPeopleGroup4Select() ) ); $form->addElement( 'text', 'name', array( 'label' => 'Name', 'required' => true ) ); $form->addElement( 'text', 'jobTitle', array( 'label' => 'Job Title', 'required' => true ) ); $form->addElement( 'text', 'email', array('label' => 'Email') ); $form->email->addValidator('EmailAddress'); $emailValidator = new Qs_Validate_Unique($this->dataObj->table, 'email', $this->dataObj->getPrimaryKey()); $emailValidator->setMessage('Email must be unique', Qs_Validate_Unique::NOT_UNIQUE); $form->email->addValidator($emailValidator); $form->addElement('phone', 'phone', array('label' => 'Phone Number')); $form->addElement('phone', 'fax', array('label' => 'Fax Number')); $form->addElement( 'htmlEditor', 'fullBio', array( 'label' => 'Full Bio' ) ); $form->image->addValidator('File_IsImage'); $form->addElement( 'text', 'url', array( 'label' => 'Profile Url', 'class' => 'text', 'filters' => array('StringTrim'), 'validators' => array('Url'), 'description' => 'Example: http://www.linkedin.com/in/username') ); $form->addElement( 'checkbox', 'show', array( 'label' => 'Show', 'checkedValue' => 'y', 'uncheckedValue' => 'n', 'decoration' => 'simple' ) ); $form->addElement( 'checkbox', 'territoryLeader', array( 'label' => 'Territory Leader', 'checkedValue' => 'y', 'uncheckedValue' => 'n', 'decoration' => 'simple', 'onclick' => "$('dl:first', this.form).toggleClass('territoryArea', $(this).is(':checked'));" ) ); $form->addElement( 'multiCheckbox', 'areaId', array( 'label' => 'Area', 'columns' => 5, 'multioptions' => $this->dataObj->getDTerritoryMap4Select() ) ); $form->addElement( 'htmlEditor', 'territoryLeaderInfo', array( 'label' => 'Territory Leader Info', 'required' => false, 'ToolbarSet' => 'Basic' ) ); $territoryLeader = $this->_getData('territoryLeader', $this->getFormDefaults('territoryLeader')); if ('y' === $territoryLeader) { $form->getDecorator('HtmlTag')->setOption('class', 'people-form_elements territoryArea'); } return $this; } protected function _getDefaultLinks() { $links = parent::_getDefaultLinks(); $fullAlias = Qs_SiteMap::findFirst(null, array('type' => 'People_Group_Admin'), null, 'fullAlias'); if (false !== $fullAlias) { $link = array('title' => 'Manage People Groups', 'url' => $fullAlias); array_unshift($links, $link); } return $links; } }