X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FMailing%2FSelector%2FBrowse.php;h=fcddb87b4708c5c455919e311efd918fd7addb98;hb=357af5d17f9ce6542bc66142bce67190dbcf9dab;hp=a55777fd6d5cea2cb5fdf56dff15050aadd6ec40;hpb=1fa961e3e8412c4e81d66bc3b8a8b0a850c39f0d;p=civicrm-core.git diff --git a/CRM/Mailing/Selector/Browse.php b/CRM/Mailing/Selector/Browse.php index a55777fd6d..fcddb87b47 100644 --- a/CRM/Mailing/Selector/Browse.php +++ b/CRM/Mailing/Selector/Browse.php @@ -1,7 +1,7 @@ ts('Campaign'), + self::$_columnHeaders[] = array( + 'name' => ts('Campaign'), 'sort' => 'campaign_id', 'direction' => CRM_Utils_Sort::DONTCARE, ); @@ -185,12 +181,12 @@ class CRM_Mailing_Selector_Browse extends CRM_Core_Selector_Base implements CRM_ * * @param * - * @return int Total number of rows - * @access public + * @return int + * Total number of rows */ - function getTotalCount($action) { - $job = CRM_Mailing_BAO_MailingJob::getTableName(); - $mailing = CRM_Mailing_BAO_Mailing::getTableName(); + public function getTotalCount($action) { + $job = CRM_Mailing_BAO_MailingJob::getTableName(); + $mailing = CRM_Mailing_BAO_Mailing::getTableName(); $mailingACL = CRM_Mailing_BAO_Mailing::mailingACL(); //get the where clause. @@ -210,21 +206,27 @@ LEFT JOIN civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul } /** - * returns all the rows in the given offset and rowCount + * Returns all the rows in the given offset and rowCount. * - * @param enum $action the action being performed - * @param int $offset the row number to start from - * @param int $rowCount the number of rows to return - * @param string $sort the sql string that describes the sort order - * @param enum $output what should the result set include (web/email/csv) + * @param string $action + * The action being performed. + * @param int $offset + * The row number to start from. + * @param int $rowCount + * The number of rows to return. + * @param string $sort + * The sql string that describes the sort order. + * @param string $output + * What should the result set include (web/email/csv). * - * @return int the total number of rows for this action + * @return int + * the total number of rows for this action */ - function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { + public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { static $actionLinks = NULL; if (empty($actionLinks)) { - $cancelExtra = ts('Are you sure you want to cancel this mailing?'); - $deleteExtra = ts('Are you sure you want to delete this mailing?'); + $cancelExtra = ts('Are you sure you want to cancel this mailing?'); + $deleteExtra = ts('Are you sure you want to delete this mailing?'); $archiveExtra = ts('Are you sure you want to archive this mailing?'); $actionLinks = array( @@ -356,7 +358,10 @@ LEFT JOIN civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul } } if (in_array($row['status'], array( - 'Scheduled', 'Running', 'Paused'))) { + 'Scheduled', + 'Running', + 'Paused', + ))) { if ($allAccess || ($showApprovalLinks && $showCreateLinks && $showScheduleLinks) ) { @@ -373,7 +378,8 @@ LEFT JOIN civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul } if (in_array($row['status'], array('Complete', 'Canceled')) && - !$row['archived']) { + !$row['archived'] + ) { if ($allAccess || $showCreateLinks) { $actionMask |= CRM_Core_Action::RENEW; } @@ -415,20 +421,22 @@ LEFT JOIN civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul } /** - * name of export file. + * Name of export file. * - * @param string $output type of output + * @param string $output + * Type of output. * - * @return string name of the file + * @return string + * name of the file */ - function getExportFileName($output = 'csv') { + public function getExportFileName($output = 'csv') { return ts('CiviMail Mailings'); } /** * @param $parent */ - function setParent($parent) { + public function setParent($parent) { $this->_parent = $parent; } @@ -438,9 +446,9 @@ LEFT JOIN civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul * * @return int|string */ - function whereClause(&$params, $sortBy = TRUE) { + public function whereClause(&$params, $sortBy = TRUE) { $values = $clauses = array(); - $isFormSubmitted = $this->_parent->get('hidden_find_mailings'); + $isFormSubmitted = $this->_parent->get('hidden_find_mailings'); $title = $this->_parent->get('mailing_name'); if ($title) { @@ -475,7 +483,7 @@ LEFT JOIN civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul $dateClause1[] = 'civicrm_mailing_job.start_date <= %3'; $dateClause2[] = 'civicrm_mailing_job.scheduled_date <= %3'; } - $params[3] = array($to, 'String'); + $params[3] = array($to, 'String'); } $dateClauses = array(); @@ -498,8 +506,8 @@ LEFT JOIN civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul } // get values submitted by form - $isDraft = $this->_parent->get('status_unscheduled'); - $isArchived = $this->_parent->get('is_archived'); + $isDraft = $this->_parent->get('status_unscheduled'); + $isArchived = $this->_parent->get('is_archived'); $mailingStatus = $this->_parent->get('mailing_status'); if (!$isFormSubmitted && $this->_parent->get('scheduled')) { @@ -530,7 +538,8 @@ LEFT JOIN civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul if (isset($isArchived)) { if ($isArchived) { $clauses[] = "civicrm_mailing.is_archived = 1"; - } else { + } + else { $clauses[] = "(civicrm_mailing.is_archived IS NULL OR civicrm_mailing.is_archived = 0)"; } } @@ -579,7 +588,7 @@ LEFT JOIN civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul return implode(' AND ', $clauses); } - function pagerAtoZ() { + public function pagerAtoZ() { $params = array(); $whereClause = $this->whereClause($params, FALSE); @@ -599,5 +608,5 @@ ORDER BY LEFT(name, 1) $aToZBar = CRM_Utils_PagerAToZ::getAToZBar($dao, $this->_parent->_sortByCharacter, TRUE); $this->_parent->assign('aToZ', $aToZBar); } -} +}