'doSummary', 'list' => 'doList', 'cancel' => 'doBack', 'view_email' => 'doViewEmail', ); var $editAlias = 'account/broadcast-email/send'; var $adminEnd = false; var $filterTpl = 'member_filter.tpl'; function _doListBind(&$DB_List) { $DB_List->def_order_by = 'added DESC'; $DB_List->tpl = SiteMap::getPath('BroadcastEmail/tpl/Repository/List/list.tpl'); $DB_List->insertColLast('individual_img', array( 'title'=>'Photo', 'imgW' =>'35', 'imgH' =>'50', 'no_img_url'=>'img/no_forum_photo.jpg', 'tpl'=>'BroadcastEmail/Repository/List/cells/img.tpl', 'params'=>array('individual_img'), )); $DB_List->insertColLast('type', array( 'title'=>'Type', 'order_by'=>'type', 'width'=>70, 'tpl'=>DB_LIST_CELL_TEXT, 'params'=>array('type'), )); $DB_List->insertColLast('subject', array( 'title'=>'Subject', 'order_by'=>'subject', 'width'=>200, 'tpl'=>DB_LIST_CELL_TEXT, 'params'=>array('subject'), )); $DB_List->insertColLast('individual_full_name', array( 'title'=>'Individual Name', 'order_by'=>'individual_full_name', 'width'=>120, 'tpl'=>'BroadcastEmail/Repository/List/cells/individual_name.tpl', 'params'=>array('individual_full_name'), )); $DB_List->insertColLast('company_name', array( 'title'=>'Company Name', 'order_by'=>'company_name', 'width'=>120, 'tpl'=>DB_LIST_CELL_TEXT, 'params'=>array('company_name'), )); $DB_List->insertColLast('added', array( 'title'=>'Date', 'order_by'=>'added', 'width'=>80, 'date_format'=>'%B %d, %Y', 'tpl' => DB_LIST_CELL_DATE, 'params'=> array('added') )); /* $DB_List->insertColLast('options', array( 'title'=>'Options', 'tpl'=>'BroadcastEmail/Repository/List/cells/member_options.tpl', 'view_link'=>BASE_URL.'/'.CURR_PAGE.'?action=view_email&id=', 'params'=>array('id'), ));*/ $DB_List->bind(); return true; } function getFilterForm() { require_once 'class/Form/Form.class.php'; $form = new Form($this->Doc, 'form_search_email', 'get', '', '_self', array('class'=>'form form_search_email')); $form->tpl = SiteMap::getPath('BroadcastEmail/tpl/Repository/'.$this->filterTpl); $form->setRendType(FORM_RENDERER_ARRAY_SMARTY); $listDays = array(1, 3, 5, 7, 15, 30, 60, 90, 120); $listDays = array_combine($listDays, $listDays); $form->addElement('extended_select', 'day_cnt', 'Search emails sent within', array(''=>'') + $listDays, array('style'=>'width:45px;'), array('after'=>' days')); $form->addElement('text', 'subject', '', array('emptybg'=>'img/bg_empty_subject_filter.gif', 'style'=>'width:185px;')); $form->addElement('text', 'sender', '', array('emptybg'=>'img/bg_empty_sender_filter.gif', 'style'=>'width:185px;')); $form->addElement('select', 'id_type', 'Type of Email', array('all'=>'All Types') + (array)$this->DBObj->getDEmailType4Select()); $form->addElement('select', 'subtype_id', 'Transaction Type', array('all'=>'All Types') + (array)$this->DBObj->getDEmailSubType4Select()); $form->addElement('select', 'location_id', 'Location', array('all'=>'All Locations') + (array)$this->DBObj->getDPropertyLocation4Select()); $form->addElement('select', 'primary_use_id', 'Real Estate Type', array('all'=>'All Types') + (array)$this->DBObj->getDPrimaryUse4Select()); $form->addElement('checkbox', 'investment', 'Investment only'); //$form->addElement('select', 'id_specialty', 'Real Estate Type:', array('all'=>'All Types') + (array)$this->DBObj->getDSpecialty4Select('sorter', "profile = 'y'")); //$form->addElement('select', 'subject_radio3', 'Transaction Type:', array('all'=>'All Types', 'lease'=>'Lease', 'sublease'=>'Sublease', 'sale'=>'Sale', 'sale_or_lease'=>'Sale or Lease')); $form->addElement('text', 'property_size', 'Size', array('class'=>'inp_width', 'size'=>'10', 'style'=>'width:150px;')); $form->addElement('text', 'property_size_min', 'Filter By Size of Listing or Requirement', array('class'=>'property_size_min', 'emptybg'=>'img/bg_no_min.gif', 'size'=>'10')); $form->addElement('text', 'property_size_max', 'Filter By Size of Listing or Requirement', array('class'=>'property_size_max', 'emptybg'=>'img/bg_no_max.gif', 'size'=>'10')); $elList = $this->formCreateRadioboxList($form, 'property_unit', array('sf'=>'square feet', 'acres'=>'acres')); $form->addGroup($elList, 'gPropertyUnit', '', '', false); $form->addElement('advcheckbox', 'use_range', '', 'Use a Range', array('id'=>'use_range', 'style'=>'margin-left:5px;'), array('n', 'y')); $form->addElement('hidden', 'query', ''); $form->addElement('submit', 'submit_btn', ' Filter ', array( 'class' => 'btn') ); $form->addElement('button', 'cancel', 'Clear Entries', array( 'class' => 'btn' , 'onclick' => "document.location.href='".Constant::get('BASE_URL').'/'.CURR_PAGE."'" )); $form->addFormRule(array($this, 'validFilterForm')); $form->setAttribute('onsubmit', "return validate_broadcast_email_filter(this);"); return $form; } function renderFilterForm($filterForm) { $filterForm->exec(); $this->Doc->addItemProp('JSs', 'js/jquery.bginput.js'); $this->Doc->addItemProp('JSs', 'js/broadcast_email_form.js'); $this->Doc->addItemProp('initFuncs', 'bginput_init'); $this->Doc->addItemProp('initFuncs', 'initFilterForm'); } function doSummary() { $filterForm = $this->getFilterForm(); $filterForm->setDefaults(array('day_cnt'=>'30', 'property_unit'=>'sf')); $this->renderFilterForm($filterForm); $item = array(); $item['list'] = $this->DBObj->getSummary(); $item['tpl'] = SiteMap::getPath('BroadcastEmail/tpl/Repository/summary.tpl'); $this->Doc->addContent($item); } }