Commit 7e8c8317 authored by Seamus Lee's avatar Seamus Lee

(NFC) Update CRM/Friend CRM/Grant CRM/Group CRM/Mailing to be up to date to a future coder version

parent fb1a4c6f
...@@ -219,18 +219,17 @@ class CRM_Friend_Form extends CRM_Core_Form { ...@@ -219,18 +219,17 @@ class CRM_Friend_Form extends CRM_Core_Form {
} }
$this->addButtons([ $this->addButtons([
[ [
'type' => 'submit', 'type' => 'submit',
'name' => ts('Send Your Message'), 'name' => ts('Send Your Message'),
'spacing' => '         ', 'spacing' => '         ',
'isDefault' => TRUE, 'isDefault' => TRUE,
], ],
[ [
'type' => 'cancel', 'type' => 'cancel',
'name' => ts('Cancel'), 'name' => ts('Cancel'),
], ],
] ]);
);
$this->addFormRule(['CRM_Friend_Form', 'formRule']); $this->addFormRule(['CRM_Friend_Form', 'formRule']);
} }
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
* *
*/ */
class CRM_Grant_BAO_Query extends CRM_Core_BAO_Query { class CRM_Grant_BAO_Query extends CRM_Core_BAO_Query {
/** /**
* @return array * @return array
*/ */
......
...@@ -155,18 +155,17 @@ class CRM_Grant_Form_Grant extends CRM_Core_Form { ...@@ -155,18 +155,17 @@ class CRM_Grant_Form_Grant extends CRM_Core_Form {
if ($this->_action & CRM_Core_Action::DELETE) { if ($this->_action & CRM_Core_Action::DELETE) {
$this->addButtons([ $this->addButtons([
[ [
'type' => 'next', 'type' => 'next',
'name' => ts('Delete'), 'name' => ts('Delete'),
'spacing' => '         ', 'spacing' => '         ',
'isDefault' => TRUE, 'isDefault' => TRUE,
], ],
[ [
'type' => 'cancel', 'type' => 'cancel',
'name' => ts('Cancel'), 'name' => ts('Cancel'),
], ],
] ]);
);
return; return;
} }
...@@ -208,23 +207,22 @@ class CRM_Grant_Form_Grant extends CRM_Core_Form { ...@@ -208,23 +207,22 @@ class CRM_Grant_Form_Grant extends CRM_Core_Form {
// make this form an upload since we dont know if the custom data injected dynamically // make this form an upload since we dont know if the custom data injected dynamically
// is of type file etc $uploadNames = $this->get( 'uploadNames' ); // is of type file etc $uploadNames = $this->get( 'uploadNames' );
$this->addButtons([ $this->addButtons([
[ [
'type' => 'upload', 'type' => 'upload',
'name' => ts('Save'), 'name' => ts('Save'),
'isDefault' => TRUE, 'isDefault' => TRUE,
], ],
[ [
'type' => 'upload', 'type' => 'upload',
'name' => ts('Save and New'), 'name' => ts('Save and New'),
'js' => ['onclick' => "return verify( );"], 'js' => ['onclick' => "return verify( );"],
'subName' => 'new', 'subName' => 'new',
], ],
[ [
'type' => 'cancel', 'type' => 'cancel',
'name' => ts('Cancel'), 'name' => ts('Cancel'),
], ],
] ]);
);
if ($this->_context == 'standalone') { if ($this->_context == 'standalone') {
$this->addEntityRef('contact_id', ts('Applicant'), ['create' => TRUE], TRUE); $this->addEntityRef('contact_id', ts('Applicant'), ['create' => TRUE], TRUE);
......
...@@ -132,14 +132,13 @@ class CRM_Grant_Form_GrantView extends CRM_Core_Form { ...@@ -132,14 +132,13 @@ class CRM_Grant_Form_GrantView extends CRM_Core_Form {
*/ */
public function buildQuickForm() { public function buildQuickForm() {
$this->addButtons([ $this->addButtons([
[ [
'type' => 'cancel', 'type' => 'cancel',
'name' => ts('Done'), 'name' => ts('Done'),
'spacing' => '         ', 'spacing' => '         ',
'isDefault' => TRUE, 'isDefault' => TRUE,
], ],
] ]);
);
} }
} }
...@@ -59,6 +59,7 @@ class CRM_Grant_Form_Search extends CRM_Core_Form_Search { ...@@ -59,6 +59,7 @@ class CRM_Grant_Form_Search extends CRM_Core_Form_Search {
/** /**
* Prefix for the controller. * Prefix for the controller.
* @var string
*/ */
protected $_prefix = "grant_"; protected $_prefix = "grant_";
......
...@@ -138,17 +138,16 @@ class CRM_Grant_Form_Task extends CRM_Core_Form_Task { ...@@ -138,17 +138,16 @@ class CRM_Grant_Form_Task extends CRM_Core_Form_Task {
*/ */
public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) {
$this->addButtons([ $this->addButtons([
[ [
'type' => $nextType, 'type' => $nextType,
'name' => $title, 'name' => $title,
'isDefault' => TRUE, 'isDefault' => TRUE,
], ],
[ [
'type' => $backType, 'type' => $backType,
'name' => ts('Cancel'), 'name' => ts('Cancel'),
], ],
] ]);
);
} }
} }
...@@ -78,18 +78,17 @@ class CRM_Grant_Form_Task_Print extends CRM_Grant_Form_Task { ...@@ -78,18 +78,17 @@ class CRM_Grant_Form_Task_Print extends CRM_Grant_Form_Task {
// just need to add a javacript to popup the window for printing // just need to add a javacript to popup the window for printing
// //
$this->addButtons([ $this->addButtons([
[ [
'type' => 'next', 'type' => 'next',
'name' => ts('Print Grant List'), 'name' => ts('Print Grant List'),
'js' => ['onclick' => 'window.print()'], 'js' => ['onclick' => 'window.print()'],
'isDefault' => TRUE, 'isDefault' => TRUE,
], ],
[ [
'type' => 'back', 'type' => 'back',
'name' => ts('Done'), 'name' => ts('Done'),
], ],
] ]);
);
} }
/** /**
......
...@@ -71,13 +71,12 @@ class CRM_Grant_Form_Task_Result extends CRM_Grant_Form_Task { ...@@ -71,13 +71,12 @@ class CRM_Grant_Form_Task_Result extends CRM_Grant_Form_Task {
*/ */
public function buildQuickForm() { public function buildQuickForm() {
$this->addButtons([ $this->addButtons([
[ [
'type' => 'done', 'type' => 'done',
'name' => ts('Done'), 'name' => ts('Done'),
'isDefault' => TRUE, 'isDefault' => TRUE,
], ],
] ]);
);
} }
} }
...@@ -79,13 +79,12 @@ INNER JOIN civicrm_contact ct ON ( grt.contact_id = ct.id ) ...@@ -79,13 +79,12 @@ INNER JOIN civicrm_contact ct ON ( grt.contact_id = ct.id )
*/ */
public function buildQuickForm() { public function buildQuickForm() {
$this->addButtons([ $this->addButtons([
[ [
'type' => 'done', 'type' => 'done',
'name' => ts('Done'), 'name' => ts('Done'),
'isDefault' => TRUE, 'isDefault' => TRUE,
], ],
] ]);
);
} }
} }
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
class CRM_Grant_Info extends CRM_Core_Component_Info { class CRM_Grant_Info extends CRM_Core_Component_Info {
/** /**
* @var string
* @inheritDoc * @inheritDoc
*/ */
protected $keyword = 'grant'; protected $keyword = 'grant';
...@@ -57,7 +58,6 @@ class CRM_Grant_Info extends CRM_Core_Component_Info { ...@@ -57,7 +58,6 @@ class CRM_Grant_Info extends CRM_Core_Component_Info {
]; ];
} }
/** /**
* @inheritDoc * @inheritDoc
* @param bool $getAllUnconditionally * @param bool $getAllUnconditionally
......
...@@ -44,7 +44,7 @@ class CRM_Grant_Page_Tab extends CRM_Contact_Page_View { ...@@ -44,7 +44,7 @@ class CRM_Grant_Page_Tab extends CRM_Contact_Page_View {
* *
* @var array * @var array
*/ */
static $_links = NULL; public static $_links = NULL;
public $_permission = NULL; public $_permission = NULL;
public $_contactId = NULL; public $_contactId = NULL;
......
...@@ -46,20 +46,20 @@ class CRM_Grant_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co ...@@ -46,20 +46,20 @@ class CRM_Grant_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co
* *
* @var array * @var array
*/ */
static $_links = NULL; public static $_links = NULL;
/** /**
* We use desc to remind us what that column is, name is used in the tpl * We use desc to remind us what that column is, name is used in the tpl
* *
* @var array * @var array
*/ */
static $_columnHeaders; public static $_columnHeaders;
/** /**
* Properties of contact we're interested in displaying * Properties of contact we're interested in displaying
* @var array * @var array
*/ */
static $_properties = [ public static $_properties = [
'contact_id', 'contact_id',
'contact_type', 'contact_type',
'sort_name', 'sort_name',
......
...@@ -40,11 +40,15 @@ ...@@ -40,11 +40,15 @@
*/ */
class CRM_Grant_Task extends CRM_Core_Task { class CRM_Grant_Task extends CRM_Core_Task {
const /**
// Grant Tasks * Grant Tasks
UPDATE_GRANTS = 701; */
const UPDATE_GRANTS = 701;
static $objectType = 'grant'; /**
* @var string
*/
public static $objectType = 'grant';
/** /**
* These tasks are the core set of tasks that the user can perform * These tasks are the core set of tasks that the user can perform
......
...@@ -215,17 +215,16 @@ class CRM_Group_Form_Edit extends CRM_Core_Form { ...@@ -215,17 +215,16 @@ class CRM_Group_Form_Edit extends CRM_Core_Form {
public function buildQuickForm() { public function buildQuickForm() {
if ($this->_action == CRM_Core_Action::DELETE) { if ($this->_action == CRM_Core_Action::DELETE) {
$this->addButtons(array( $this->addButtons(array(
array( array(
'type' => 'next', 'type' => 'next',
'name' => ts('Delete Group'), 'name' => ts('Delete Group'),
'isDefault' => TRUE, 'isDefault' => TRUE,
), ),
array( array(
'type' => 'cancel', 'type' => 'cancel',
'name' => ts('Cancel'), 'name' => ts('Cancel'),
), ),
) ));
);
return; return;
} }
...@@ -274,17 +273,16 @@ class CRM_Group_Form_Edit extends CRM_Core_Form { ...@@ -274,17 +273,16 @@ class CRM_Group_Form_Edit extends CRM_Core_Form {
CRM_Custom_Form_CustomData::buildQuickForm($this); CRM_Custom_Form_CustomData::buildQuickForm($this);
$this->addButtons(array( $this->addButtons(array(
array( array(
'type' => 'upload', 'type' => 'upload',
'name' => ($this->_action == CRM_Core_Action::ADD) ? ts('Continue') : ts('Save'), 'name' => ($this->_action == CRM_Core_Action::ADD) ? ts('Continue') : ts('Save'),
'isDefault' => TRUE, 'isDefault' => TRUE,
), ),
array( array(
'type' => 'cancel', 'type' => 'cancel',
'name' => ts('Cancel'), 'name' => ts('Cancel'),
), ),
) ));
);
$doParentCheck = FALSE; $doParentCheck = FALSE;
if (CRM_Core_Permission::isMultisiteEnabled()) { if (CRM_Core_Permission::isMultisiteEnabled()) {
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
* This class contains the functions that are called using AJAX (jQuery) * This class contains the functions that are called using AJAX (jQuery)
*/ */
class CRM_Group_Page_AJAX { class CRM_Group_Page_AJAX {
/** /**
* Get list of groups. * Get list of groups.
*/ */
......
...@@ -34,8 +34,9 @@ class CRM_Mailing_BAO_BouncePattern extends CRM_Mailing_DAO_BouncePattern { ...@@ -34,8 +34,9 @@ class CRM_Mailing_BAO_BouncePattern extends CRM_Mailing_DAO_BouncePattern {
/** /**
* Pseudo-constant pattern array. * Pseudo-constant pattern array.
* @var array
*/ */
static $_patterns = NULL; public static $_patterns = NULL;
/** /**
* Class constructor. * Class constructor.
......
...@@ -41,6 +41,7 @@ class CRM_Mailing_BAO_Mailing extends CRM_Mailing_DAO_Mailing { ...@@ -41,6 +41,7 @@ class CRM_Mailing_BAO_Mailing extends CRM_Mailing_DAO_Mailing {
* An array that holds the complete templates * An array that holds the complete templates
* including any headers or footers that need to be prepended * including any headers or footers that need to be prepended
* or appended to the body. * or appended to the body.
* @var array
*/ */
private $preparedTemplates = NULL; private $preparedTemplates = NULL;
...@@ -48,41 +49,49 @@ class CRM_Mailing_BAO_Mailing extends CRM_Mailing_DAO_Mailing { ...@@ -48,41 +49,49 @@ class CRM_Mailing_BAO_Mailing extends CRM_Mailing_DAO_Mailing {
* An array that holds the complete templates * An array that holds the complete templates
* including any headers or footers that need to be prepended * including any headers or footers that need to be prepended
* or appended to the body. * or appended to the body.
* @var array
*/ */
private $templates = NULL; private $templates = NULL;
/** /**
* An array that holds the tokens that are specifically found in our text and html bodies. * An array that holds the tokens that are specifically found in our text and html bodies.
* @var array
*/ */
private $tokens = NULL; private $tokens = NULL;
/** /**
* An array that holds the tokens that are specifically found in our text and html bodies. * An array that holds the tokens that are specifically found in our text and html bodies.
* @var array
*/ */
private $flattenedTokens = NULL; private $flattenedTokens = NULL;
/** /**
* The header associated with this mailing. * The header associated with this mailing.
* @var string
*/ */
private $header = NULL; private $header = NULL;
/** /**
* The footer associated with this mailing. * The footer associated with this mailing.
* @var string
*/ */
private $footer = NULL; private $footer = NULL;
/** /**
* The HTML content of the message. * The HTML content of the message.
* @var string
*/ */
private $html = NULL; private $html = NULL;
/** /**
* The text content of the message. * The text content of the message.
* @var string
*/ */
private $text = NULL; private $text = NULL;
/** /**
* Cached BAO for the domain. * Cached BAO for the domain.
* @var int
*/ */
private $_domain = NULL; private $_domain = NULL;
...@@ -607,10 +616,10 @@ class CRM_Mailing_BAO_Mailing extends CRM_Mailing_DAO_Mailing { ...@@ -607,10 +616,10 @@ class CRM_Mailing_BAO_Mailing extends CRM_Mailing_DAO_Mailing {
$this->preparedTemplates = []; $this->preparedTemplates = [];
foreach ([ foreach ([
'html', 'html',
'text', 'text',
'subject', 'subject',
] as $key) { ] as $key) {
if (!isset($templates[$key])) { if (!isset($templates[$key])) {
continue; continue;
} }
...@@ -809,14 +818,13 @@ class CRM_Mailing_BAO_Mailing extends CRM_Mailing_DAO_Mailing { ...@@ -809,14 +818,13 @@ class CRM_Mailing_BAO_Mailing extends CRM_Mailing_DAO_Mailing {
public function getTestRecipients($testParams) { public function getTestRecipients($testParams) {
if (!empty($testParams['test_group']) && array_key_exists($testParams['test_group'], CRM_Core_PseudoConstant::group())) { if (!empty($testParams['test_group']) && array_key_exists($testParams['test_group'], CRM_Core_PseudoConstant::group())) {
$contacts = civicrm_api('contact', 'get', [ $contacts = civicrm_api('contact', 'get', [
'version' => 3, 'version' => 3,
'group' => $testParams['test_group'], 'group' => $testParams['test_group'],
'return' => 'id', 'return' => 'id',
'options' => [ 'options' => [
'limit' => 100000000000, 'limit' => 100000000000,
], ],
] ]);
);
foreach (array_keys($contacts['values']) as $groupContact) { foreach (array_keys($contacts['values']) as $groupContact) {
$query = " $query = "
...@@ -1742,7 +1750,7 @@ ORDER BY civicrm_email.is_bulkmail DESC ...@@ -1742,7 +1750,7 @@ ORDER BY civicrm_email.is_bulkmail DESC
* 'include' or 'exclude'. * 'include' or 'exclude'.
* @param string $entity * @param string $entity
* 'groups' or 'mailings'. * 'groups' or 'mailings'.
* @param array <int> $entityIds * @param array $entityIds
* @throws CiviCRM_API3_Exception * @throws CiviCRM_API3_Exception
*/ */
public static function replaceGroups($mailingId, $type, $entity, $entityIds) { public static function replaceGroups($mailingId, $type, $entity, $entityIds) {
...@@ -2176,7 +2184,8 @@ ORDER BY civicrm_email.is_bulkmail DESC ...@@ -2176,7 +2184,8 @@ ORDER BY civicrm_email.is_bulkmail DESC
break; break;
case 'opened': case 'opened':
$reportFilter .= "&distinct=0"; // do not use group by clause in report, because same report used for total and unique open // do not use group by clause in report, because same report used for total and unique open
$reportFilter .= "&distinct=0";
case 'opened_unique': case 'opened_unique':
$url = "mailing/opened"; $url = "mailing/opened";
$searchFilter .= "&mailing_open_status=Y"; $searchFilter .= "&mailing_open_status=Y";
...@@ -2957,7 +2966,7 @@ ORDER BY civicrm_mailing.name"; ...@@ -2957,7 +2966,7 @@ ORDER BY civicrm_mailing.name";
* Array of mailings for a contact * Array of mailings for a contact
* *
*/ */
static public function getContactMailings(&$params) { public static function getContactMailings(&$params) {
$params['version'] = 3; $params['version'] = 3;
$params['offset'] = ($params['page'] - 1) * $params['rp'];