Source of file SendThis_Report_Blacklisted.php
Size: 2,180 Bytes - Last Modified: 2021-12-23T10:05:12+00:00
/var/www/docs.ssmods.com/process/src/code/Reports/SendThis_Report_Blacklisted.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 | <?php /** * Milkyway Mailer Reports * SendThis_Report_Blacklisted.php * * @package milkyway-multimedia/ss-send-this * @subpackage reports * @author Mell - Milkyway Multimedia <mellisa.hankins@me.com> */ if (!class_exists('SS_Report')) { return; } class SendThis_Report_Blacklisted extends SS_Report { protected $title = 'Blacklisted Emails'; protected $description = 'View emails that have been blacklisted in the database. This means they will no longer receive emails originating from this interface.'; protected $dataClass = 'SendThis_Blacklist'; public function sourceRecords(array $params, $sort, $limit) { return DataObject::get($this->dataClass)->sort('Created', 'DESC'); } /** * Which columns to show in the report * * @return array */ public function columns() { return array( 'Email' => [ 'title' => _t('SendThis_Log.EMAIL', 'Email'), ], 'Message' => array( 'casting' => 'HTMLText', 'formatting' => function ($value, $record) { return '<pre>' . print_r($value, true) . '</pre>'; } ), 'Valid' => [ 'casting' => 'HTMLText', 'formatting' => function ($value, $record) { return $value ? '<span class="ui-button-icon-primary ui-icon btn-icon-accept boolean-yes"></span>' : '<span class="ui-button-icon-primary ui-icon btn-icon-decline boolean-no"></span>'; } ], ); } public function getReportField() { $field = parent::getReportField(); $field->Config->addComponents(new GridFieldDeleteAction(), new GridFieldButtonRow('before'), $btn = new GridFieldAddNewButton('buttons-before-left'), new GridFieldDetailForm()); $btn->setButtonName(_t('SendThis.BLACKLIST_AN_EMAIL', 'Blacklist an email')); return $field; } public function canView($member = null) { return Permission::check('ADMIN') || Permission::check('CAN_VIEW_LOGS'); } } |