public function createMailQueue() { $ds = new Am_Query($this->getDi()->mailQueueTable); $ds->setOrder('added', true); $g = new Am_Grid_ReadOnly('_mail', ___("E-Mail Queue"), $ds, $this->getRequest(), $this->view); $g->addGridField(new Am_Grid_Field('recipients', ___('Recipients'), true, '', null, '20%')); $g->addGridField(new Am_Grid_Field('added', ___('Added'), true, '', array($this, 'renderTimestamp'), '15%')); $g->addGridField(new Am_Grid_Field('sent', ___('Sent'), true, '', array($this, 'renderTimestamp'), '15%')); $g->addGridField(new Am_Grid_Field('subject', ___('Subject'), true, '', null, '30%'))->setRenderFunction(array($this, 'renderSubject')); $body = new Am_Grid_Field_Expandable('body', ___('Mail'), true, '', null, '20%'); $body->setEscape(true); $body->setGetFunction(array($this, 'renderMail')); $g->addGridField($body); $g->setFilter(new Am_Grid_Filter_Text(___("Filter by subject or recepient"), array('subject' => 'LIKE', 'recipients' => 'LIKE'))); return $g; }
public function createMailQueue() { $ds = new Am_Query($this->getDi()->mailQueueTable); $ds->setOrder('added', true); $g = new Am_Grid_Editable('_mail', ___("E-Mail Queue"), $ds, $this->getRequest(), $this->view); $g->setPermissionId(Am_Auth_Admin::PERM_LOGS_MAIL); $g->addField(new Am_Grid_Field('recipients', ___('Recipients'), true, '', null, '20%')); $g->addField(new Am_Grid_Field_Date('added', ___('Added'), true)); $g->addField(new Am_Grid_Field_Date('sent', ___('Sent'), true)); $g->addField(new Am_Grid_Field('subject', ___('Subject'), true, '', null, '30%'))->setRenderFunction(array($this, 'renderSubject')); $body = new Am_Grid_Field_Expandable('body', ___('Mail'), true, '', null, '20%'); $body->setEscape(true); $body->setGetFunction(array($this, 'renderMail')); $g->addField($body); $g->setFilter(new Am_Grid_Filter_Text(___("Filter by subject or recepient"), array('subject' => 'LIKE', 'recipients' => 'LIKE'))); $g->actionsClear(); $g->actionAdd(new Am_Grid_Action_MailRetry('retry')); if ($this->getDi()->authAdmin->getUser()->isSuper()) { $g->actionAdd(new Am_Grid_Action_Delete()); $g->actionAdd(new Am_Grid_Action_Group_Delete()); } return $g; }
protected function createActionCustomize() { $stateTitleField = new Am_Grid_Field('state_title', ___('State Title'), false); $stateTitleField->setGetFunction(array($this, 'getStateTitle')); $countryTitleField = new Am_Grid_Field('country_title', ___('Country Title'), false); $countryTitleField->setGetFunction(array($this, 'getCountryTitle')); $lastSigninInfoField = new Am_Grid_Field('last_signin', ___('Last Signin Info'), false); $lastSigninInfoField->setGetFunction(array($this, 'getLastSigninInfo')); $gravatarField = new Am_Grid_Field('gravatar', ___('Gravatar'), false, null, array($this, 'renderGravatar'), '1%'); $expireField = new Am_Grid_Field_Date('expire', ___('Expire'), false); $expireField->setFormatDate(); $productsField = new Am_Grid_Field_Expandable('products', ___('Active Subscriptions')); $productsField->setPlaceholder(Am_Grid_Field_Expandable::PLACEHOLDER_SELF_TRUNCATE_END)->setMaxLength(50); $userGroupField = new Am_Grid_Field('ugroup', ___('User Groups'), false); $userGroupField->setRenderFunction(array($this, 'renderUGroup')); $action = new Am_Grid_Action_Customize(); $action->addField(new Am_Grid_Field('user_id', '#', true, '', null, '1%'))->addField(new Am_Grid_Field('name_f', ___('First Name')))->addField(new Am_Grid_Field('name_l', ___('Last Name')))->addField(new Am_Grid_Field('street', ___('Street')))->addField(new Am_Grid_Field('street2', ___('Street (Second Line)')))->addField(new Am_Grid_Field('city', ___('City')))->addField(new Am_Grid_Field('state', ___('State')))->addField($stateTitleField)->addField(new Am_Grid_Field('zip', ___('ZIP Code')))->addField(new Am_Grid_Field('country', ___('Country')))->addField($countryTitleField)->addField(new Am_Grid_Field('phone', ___('Phone')))->addField(new Am_Grid_Field_Date('added', ___('Added')))->addField($productsField)->addField($userGroupField)->addField(new Am_Grid_Field('status', ___('Status')))->addField(new Am_Grid_Field('unsubscribed', ___('Unsubscribed')))->addField(new Am_Grid_Field('lang', ___('Language')))->addField(new Am_Grid_Field('is_locked', ___('Is Locked')))->addField(new Am_Grid_Field('comment', ___('Comment')))->addField(new Am_Grid_Field('aff_id', ___('Affiliate Id#')))->addField($expireField)->addField($lastSigninInfoField)->addField($gravatarField); //Additional Fields foreach ($this->getDi()->userTable->customFields()->getAll() as $field) { if (isset($field->from_config) && $field->from_config) { $f = $field->sql ? new Am_Grid_Field($field->name, $field->title) : new Am_Grid_Field_Data($field->name, $field->title, false); $f->addDecorator(new Am_Grid_Field_Decorator_Additional($field)); $f->setRenderFunction(array($this, 'renderAdditional')); $action->addField($f); } } return $action; }