);
$this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array(
'CRM_Core_DAO_Mapping',
- $this->_id
+ $this->_id,
));
$this->addElement('text', 'description', ts('Description'),
*
* @return void
*/
- function preProcess() {
+ public function preProcess() {
$values = $this->controller->exportValues('Search');
$this->_task = $values['task'];
*
* @return string
*/
- function all(
+ public function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
if (!empty($groups)) {
$this->addElement('select', 'groups', ts('Add imported records to existing group(s)'), $groups, array(
'multiple' => "multiple",
- 'class' => 'crm-select2'
+ 'class' => 'crm-select2',
));
}
'validPledgePaymentRowCount',
'invalidPledgePaymentRowCount',
'downloadPledgePaymentErrorRecordsUrl',
- 'downloadSoftCreditErrorRecordsUrl'
+ 'downloadSoftCreditErrorRecordsUrl',
);
foreach ($properties as $property) {
$this->assign($property, $this->get($property));
/**
* @return mixed
*/
- static function &indices() {
+ public static function &indices() {
static $result = NULL;
if (!$result) {
$result = unserialize('a:4:{s:20:"civicrm_custom_group";a:1:{s:16:"UI_title_extends";a:4:{s:4:"name";s:16:"UI_title_extends";s:5:"field";a:2:{i:0;s:5:"title";i:1;s:7:"extends";}s:11:"localizable";b:1;s:6:"unique";b:1;}}s:20:"civicrm_custom_field";a:1:{s:24:"UI_label_custom_group_id";a:4:{s:4:"name";s:24:"UI_label_custom_group_id";s:5:"field";a:2:{i:0;s:5:"label";i:1;s:15:"custom_group_id";}s:11:"localizable";b:1;s:6:"unique";b:1;}}s:17:"civicrm_price_set";a:1:{s:8:"UI_title";a:4:{s:4:"name";s:8:"UI_title";s:5:"field";a:1:{i:0;s:5:"title";}s:11:"localizable";b:1;s:6:"unique";b:1;}}s:15:"civicrm_contact";a:5:{s:15:"index_sort_name";a:3:{s:4:"name";s:15:"index_sort_name";s:5:"field";a:1:{i:0;s:9:"sort_name";}s:11:"localizable";b:1;}s:16:"index_first_name";a:3:{s:4:"name";s:16:"index_first_name";s:5:"field";a:1:{i:0;s:10:"first_name";}s:11:"localizable";b:1;}s:15:"index_last_name";a:3:{s:4:"name";s:15:"index_last_name";s:5:"field";a:1:{i:0;s:9:"last_name";}s:11:"localizable";b:1;}s:20:"index_household_name";a:3:{s:4:"name";s:20:"index_household_name";s:5:"field";a:1:{i:0;s:14:"household_name";}s:11:"localizable";b:1;}s:23:"index_organization_name";a:3:{s:4:"name";s:23:"index_organization_name";s:5:"field";a:1:{i:0;s:17:"organization_name";}s:11:"localizable";b:1;}}}');
* @param string $str
* The permission to check.
*
- * @return boolean
+ * @return bool
* true if yes, else false
*/
-
public function check($str) {
return TRUE;
}
*/
function smarty_block_crmRegion($params, $content, &$smarty, &$repeat) {
if ($repeat) {
- return;
+ return NULL;
}
require_once 'CRM/Core/Region.php';
$region = CRM_Core_Region::instance($params['name'], FALSE);
}
$customGroup = array(
- '' => ts('- select -')
- ) + $customGroup;
+ '' => ts('- select -'),
+ ) + $customGroup;
$this->add('select',
'dst_group_id',
ts('Destination'),
2 => array($this->log_date, 'String'),
);
- $logging = new CRM_Logging_Schema;
+ $logging = new CRM_Logging_Schema();
$addressCustomTables = $logging->entityCustomDataLogTables('Address');
$contactIdClause = $join = '';
break;
}
- $dao = new $daos[$table];
+ $dao = new $daos[$table]();
foreach ($dao->fields() as $field) {
$titles[$table][$field['name']] = CRM_Utils_Array::value('title', $field);
*
* @return array|null
*/
- static function defaultReturnProperties(
+ public static function defaultReturnProperties(
$mode,
$includeCustomFields = TRUE
) {
CRM_Core_DAO::commonRetrieveAll('CRM_Price_DAO_PriceField', 'price_set_id', $priceSetId, $pFIDs, $return = array(
'html_type',
'name',
- 'label'
+ 'label',
));
foreach ($pFIDs as $pid => $pValue) {
if ($pValue['html_type'] == 'Radio' && $pValue['name'] == 'membership_amount') {
if (count($this->_memberIds) > $this->_maxMembers) {
CRM_Core_Session::setStatus(ts("The maximum number of members you can select for Batch Update is %1. You have selected %2. Please select fewer members from your search results and try again.", array(
1 => $this->_maxMembers,
- 2 => count($this->_memberIds)
+ 2 => count($this->_memberIds),
)), ts('Batch Update Error'), 'error');
$validate = TRUE;
}
$ufGroupElement = $this->add('select', 'uf_group_id', ts('Select Profile'),
array(
- '' => ts('- select profile -')
+ '' => ts('- select profile -'),
) + $profiles, TRUE
);
$this->addDefaultButtons(ts('Continue'));
/**
* Class constructor
*/
- function __construct($controller, $action = CRM_Core_Action::NONE) {
+ public function __construct($controller, $action = CRM_Core_Action::NONE) {
parent::__construct($controller, $action);
$this->_pages = array();
* @param int $id
* Price Set id.
*
- * @return boolean
+ * @return bool
* false if fields exist for this set, true if the
* set could be deleted
*
*
* @return void
*/
- static function buildPriceSet(&$form) {
+ public static function buildPriceSet(&$form) {
$priceSetId = $form->get('priceSetId');
$userid = $form->getVar('_userID');
if (!$priceSetId) {
$className = CRM_Utils_System::getClassName($form);
if (in_array($className, array(
'CRM_Contribute_Form_Contribution',
- 'CRM_Member_Form_Membership'
+ 'CRM_Member_Form_Membership',
))) {
$validFieldsOnly = FALSE;
}
* check the current Membership
* having end date null.
*/
- static function checkCurrentMembership(&$options, $userid) {
+ public static function checkCurrentMembership(&$options, $userid) {
if (!$userid || empty($options)) {
return;
}
*
* @return array
*/
- static function setDefaultPriceSet(&$form, &$defaults) {
+ public static function setDefaultPriceSet(&$form, &$defaults) {
if (!isset($form->_priceSet) || empty($form->_priceSet['fields'])) {
return $defaults;
}
/**
* Get field ids of a price set
*
- * @param int id Price Set id
+ * @param int $id Price Set id
*
* @return array
* Array of the field ids
*
* @return CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field
*/
- static function copy($id) {
+ public static function copy($id) {
$maxId = CRM_Core_DAO::singleValueQuery("SELECT max(id) FROM civicrm_price_set");
$title = ts('[Copy id %1]', array(1 => $maxId + 1));
*
* @return bool
*/
- function checkPermission($sid) {
+ public function checkPermission($sid) {
if ($sid &&
self::eventPriceSetDomainID()
) {
/**
* Singleton function used to manage this object
*
- * @param string the key to permit session scope's
*
* @return object
*/
$results = array(
'title' => 'CiviCRM InnoDB support',
'severity' => $this::REQUIREMENT_ERROR,
- 'details' => 'Could not determine if MySQL has InnoDB support. Assuming none.'
+ 'details' => 'Could not determine if MySQL has InnoDB support. Assuming none.',
);
$conn = @mysql_connect($db_config['host'], $db_config['username'], $db_config['password']);
* array of properties,
* if error an array with an error id and error message
*
- * {@getfields note_get}
+ * {@getfields note_get}
*/
function civicrm_api3_note_get($params) {
* @return CRM_Contact_Form_Search_Custom_GroupTestDataProvider
*/
public function dataProvider() {
- return new CRM_Contact_Form_Search_Custom_GroupTestDataProvider;
+ return new CRM_Contact_Form_Search_Custom_GroupTestDataProvider();
}
public function setUp() {
*/
private static function getInstance() {
if (is_null(self::$instance)) {
- self::$instance = new self;
+ self::$instance = new self();
}
return self::$instance;
}
$this->contactDelete($this->_indiviContactID);
}
- /* check function add()
- *
- */
+ /**
+ * check function add()
+ *
+ */
public function testAdd() {
$ids = array();
$params = array(
$this->membershipTypeDelete(array('id' => $membershipType->id));
}
- /* check function retrive()
- *
- */
+ /**
+ * check function retrive()
+ *
+ */
public function testRetrieve() {
$ids = array();
$params = array(
$this->membershipTypeDelete(array('id' => $membershipType->id));
}
- /* check function isActive()
- *
- */
+ /**
+ * check function isActive()
+ *
+ */
public function testSetIsActive() {
$ids = array();
$params = array(
$this->membershipTypeDelete(array('id' => $membership->id));
}
- /* check function del()
- *
- */
+ /**
+ * check function del()
+ *
+ */
public function testdel() {
$ids = array();
$params = array(
$this->assertEquals($result, TRUE, 'Verify membership deleted.');
}
- /* check function convertDayFormat( )
- *
- */
+ /**
+ * check function convertDayFormat( )
+ *
+ */
public function testConvertDayFormat() {
$ids = array();
$params = array(
$this->membershipTypeDelete(array('id' => $membership->id));
}
- /* check function getMembershipTypes( )
- *
- */
+ /**
+ * check function getMembershipTypes( )
+ *
+ */
public function testGetMembershipTypes() {
$ids = array();
$params = array(
$this->membershipTypeDelete(array('id' => $membership->id));
}
- /* check function getMembershipTypeDetails( )
- *
- */
+ /**
+ * check function getMembershipTypeDetails( )
+ *
+ */
public function testGetMembershipTypeDetails() {
$ids = array();
$params = array(
$this->membershipTypeDelete(array('id' => $membership->id));
}
- /* check function getDatesForMembershipType( )
- *
- */
+ /**
+ * check function getDatesForMembershipType( )
+ *
+ */
public function testGetDatesForMembershipType() {
$ids = array();
$params = array(
$this->membershipTypeDelete(array('id' => $membership->id));
}
- /* check function getRenewalDatesForMembershipType( )
- *
- */
+ /**
+ * check function getRenewalDatesForMembershipType( )
+ *
+ */
public function testGetRenewalDatesForMembershipType() {
$ids = array();
$params = array(
$this->membershipTypeDelete(array('id' => $membershipType->id));
}
- /* check function getMembershipTypesByOrg( )
- *
- */
+ /**
+ * check function getMembershipTypesByOrg( )
+ *
+ */
public function testGetMembershipTypesByOrg() {
$ids = array();
$params = array(
foreach (array(
'joinDate',
'startDate',
- 'endDate'
+ 'endDate',
) as $date) {
$$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
}
foreach (array(
'joinDate',
'startDate',
- 'endDate'
+ 'endDate',
) as $date) {
$$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
}
)
);
$this->_contactId = $this->individualCreate();
- $op = new PHPUnit_Extensions_Database_Operation_Insert;
+ $op = new PHPUnit_Extensions_Database_Operation_Insert();
$op->execute(
$this->_dbconn,
$this->createFlatXMLDataSet(dirname(__FILE__) . '/dataset/uf_group_test.xml')