'doList', 'cancel' => 'doBack', 'new' => 'doNew', 'insert' => 'doInsert', ); function _doListBind(DB_List $list) { $list->def_order_by = 'event_date DESC'; $list->tableAttribs['id'] = 'member-ce-credit-history-grid'; $list->insertColLast( 'event_date', array( 'title' => 'Date of Event', 'order_by'=> 'event_date', 'width' => 120, 'tpl' => DB_LIST_CELL_DATE, 'params' => array('event_date'), ) ); $list->insertColLast( 'name', array( 'title' => 'Name', 'order_by'=> 'name', 'width' => 220, 'tpl' => BASE_PATH . '/tpl/Member/CECreditHistory/List/cells/text.tpl', 'params' => array('name', 'eventformreqid'), ) ); $list->insertColLast( 'certificate', array( 'title' => 'CE Certificate', 'order_by' => 'certificate', 'width' => 100, 'fullAlias' => App_Event_Certificate_Obj::FULL_ALIAS, 'tpl' => 'Event/Certificate/cells/download.tpl', 'params' => array('allowed' => 'certificate_allowed', 'id' => 'registration_id'), ) ); $list->insertColLast( 'credits', array( 'title' => 'Credits Earned', 'order_by'=> 'credits', 'width' => 170, 'tpl' => DB_LIST_CELL_TEXT_CENTER, 'params' => array('credits'), ) ); $list->bind(); return true; } function addLink() { $link = BASE_URL . '/' . CURR_PAGE_FULL; $addLink = array( 'tpl' => 'center_link.tpl', 'link_list' => array( array('title' => 'Add '.$this->DBObj->itemName, 'link' => $link . '?action=new'), ), ); $this->Doc->addContent($addLink); } function getFilterForm() { require_once 'class/Form/Form.class.php'; $form = new Form($this->Doc, 'form_search_ce_credit', 'get', '', '_self', array('class'=>'form form_search_ce_credit')); $form->tpl = SiteMap::getPath('Member/tpl/CECreditHistory/filter.tpl'); $form->setRendType(FORM_RENDERER_ARRAY_SMARTY); $period = $periodOptions = null; if (($periodsInfo = $this->DBObj->getPeriodsInfo())) { list($period, $periodOptions) = $periodsInfo; } if (!empty($periodOptions)) { $form->addElement( 'select', 'period', 'Choose the period to see your CE Credits', array('' => 'Show All') + (array) $periodOptions, array('onchange' => 'this.form.submit()') ); $defaults = array_merge(array('period' => $period), $_GET); $form->setDefaults($defaults); } return $form; } function doList() { $this->addLink(); $filterForm = $this->getFilterForm(); $this->DBObj->addFilter($filterForm->exportValues()); $filterForm->exec(); $this->_saveBackUrl(); require_once('class/DB/List/List.php'); $DB_List = new DB_List($this->Doc, $this->DBObj, $this->functionalFields); if(!empty($this->DBObj->filter)) $DB_List->urlVarNames = array_keys($this->DBObj->filter); $DB_List->urlVarNames[] = 'ipp'; $DB_List->urlVarNames[] = 'period'; $DB_List->tpl = BASE_PATH.'/tpl/Member/CECreditHistory/List/list.tpl'; $DB_List->total4period = $this->DBObj->getTotal4Period(); $this->_doListBind($DB_List); $DB_List->exec(); return true; } function doListAjax() { $filterForm = $this->getFilterForm(); $filterForm->exec(); $this->DBObj->setFilter($filterForm->exportValues()); $item = $this->DBObj->getList4Grid(array('ipp'=>3, 'order_by'=>'event_date DESC')); $item['total4period'] = $this->DBObj->getTotal4Period(); $this->displayJSON($item); } function doNew() { parent::doNew(); if ($this->defaultAction != 'list') { $listUrl = BASE_URL . '/' . SiteMap::getAliasByItem('Member/CECreditHistory/Show', 'list'); $this->setBackUrl($listUrl); } } function renderForm(&$form) { $form->setTpl(BASE_PATH.'/tpl/Member/CECreditHistory/member-form.tpl'); $form->return_form_arr = true; $form->setRendType(FORM_RENDERER_ARRAY_SMARTY); $item = $form->exec(); $this->Doc->content['ITEMS'] = array(); $this->Doc->addContent($item); } }