10); protected $_fullViewAlias = 'search/parts'; protected function _bindListColumns(Qs_ViewController_List $list) { $this->doc->addScript('js/app/part-list.js'); $this->doc->addInitFunction('App_Part_List.init', array()); $nameColumnOptions = array( 'title' => 'Product', 'params' => array('id', 'title'), 'viewUrl' => Qs_SiteMap::getAliasByItem('Part_') . '/' ); if ($this->_type != 'small') { $nameColumnOptions['orderBy'] = 'number'; } if ($this->doc->acl->isAllowed($this->doc->getAuthData('id'), 'part', 'add')) { $nameColumnOptions['editUrl'] = Qs_SiteMap::getAliasByItem('Part_') . '?action=edit&id='; $nameColumnOptions['editGeneralUrl'] = Qs_SiteMap::getAliasByItem('Part_General_') . '?action=edit&id='; $nameColumnOptions['deleteUrl'] = Qs_SiteMap::getAliasByItem('Part_') . '?action=delete&id='; $nameColumnOptions['duplicateUrl'] = Qs_SiteMap::getAliasByItem('Part_') . '?action=duplicate&id='; } $list->addColumn('image', 'image', array('attribs' => array('width' => 145, 'url' => $nameColumnOptions['viewUrl']))) ->addColumn('text', 'client', array('title' => 'Customer')) ->addColumn('name', 'name', $nameColumnOptions) ->addColumn('weight', 'weight') ->addColumn('text', 'status') ->addColumn('revision', 'revision'); return $this; } protected function _addItem($item, $groupName = null) { $item['query'] = $this->_querySearch; $item['departmentPage'] = Qs_SiteMap::find( null, array('type' => 'Department_'), array('type' => 'landing'), 'fullAlias' ); $item['processPage'] = Qs_SiteMap::find( null, array('type' => 'Process_'), array('type' => 'default'), 'fullAlias' ); $item['partPage'] = Qs_SiteMap::find( null, array('type' => 'Part_'), null, 'fullAlias' ); $item['aclPartAdd'] = $this->doc->acl->isAllowed($this->doc->getAuthData('id'), 'part', 'add'); $item['aclProcessAdd'] = $this->doc->acl->isAllowed($this->doc->getAuthData('id'), 'part', 'add'); return parent::_addItem($item, $groupName = null); } protected function _doListAjax() { $this->_addFilterItem(); $this->_addListItem(null, 'ac-list.tpl'); return $this; } }