if (count($this->_activityHolderIds) > $this->_maxActivities) {
CRM_Core_Session::setStatus(ts("The maximum number of Activities you can select to send an email is %1. You have selected %2. Please select fewer Activities from your search results and try again.", array(
1 => $this->_maxActivities,
- 2 => count($this->_activityHolderIds)
+ 2 => count($this->_activityHolderIds),
)), ts("Maximum Exceeded"), "error");
$validate = TRUE;
}
$this->add('select', 'paper_size', ts('Paper Size'),
array(
- 0 => ts('- default -')
+ 0 => ts('- default -'),
) + CRM_Core_BAO_PaperSize::getList(TRUE), FALSE,
array('onChange' => "selectPaper( this.value );")
);
$this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array(
'CRM_Core_BAO_PdfFormat',
- $this->_id
+ $this->_id,
));
$this->addRule('margin_left', ts('Margin must be numeric'), 'numeric');
$this->addRule('margin_right', ts('Margin must be numeric'), 'numeric');
$defaults['editor_id'] = $this->_config->editor_id;
}
if (empty($this->_config->display_name_format)) {
- $defaults['display_name_format'] =
- "{contact.individual_prefix}{ }{contact.first_name}{ }{contact.last_name}{ }{contact.individual_suffix}";
+ $defaults['display_name_format'] = "{contact.individual_prefix}{ }{contact.first_name}{ }{contact.last_name}{ }{contact.individual_suffix}";
}
else {
$defaults['display_name_format'] = $this->_config->display_name_format;
/**
* Get action Links
*
- * @return array
- * (reference) of action links
*/
public function &links() {
}
//added job title
$form->addElement('text', 'job_title', ts('Job Title'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'job_title'));
-
//added internal ID
$form->addElement('text', 'contact_id', ts('Contact ID'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'id'));
$form->addRule('contact_id', ts('Please enter valid Contact ID'), 'positiveInteger');
'uf_group_id',
ts('Search Views'),
array(
- '0' => ts('- default view -')
+ '0' => ts('- default view -'),
) + $searchProfiles
);
CRM_Core_Form_Date::buildDateRange($form, 'deceased_date', 1, '_low', '_high', ts('From'), FALSE, FALSE, 'birth');
-
// radio button for is_deceased
$form->addYesNo('is_deceased', ts('Deceased'), TRUE);
}
/**
* Construct the search query
*/
- function all(
+ public function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
)
);
-
$this->assign('profileTitle', $this->_title);
$this->assign('componentIds', $this->_contactIds);
*/
public function setDefaultValues() {
if (empty($this->_fields)) {
- return;
+ return NULL;
}
$defaults = $sortName = array();
if ($inValidSubtypeCnt) {
CRM_Core_Session::setStatus(ts('Contact Subtype field of 1 contact has not been updated.', array(
'plural' => 'Contact Subtype field of %count contacts has not been updated.',
- 'count' => $inValidSubtypeCnt
+ 'count' => $inValidSubtypeCnt,
)), ts('Invalid Subtype'));
}
}
* @param string $fileName
* The name of the file to save the label in.
*
- * @return null
*/
public static function createLabel(&$contactRows, &$format, $fileName = 'MailingLabels_CiviCRM.pdf') {
$pdf = new CRM_Utils_PDF_Label($format, 'mm');
* @return array
* Array of rows for labels
*/
-
public static function getRows($contactIDs, $locationTypeID, $respectDoNotMail, $mergeSameAddress, $mergeSameHousehold) {
$locName = NULL;
//get the address format sequence from the config file
'email',
'phone',
'im',
- 'openid'
+ 'openid',
))) {
if ($k == 'im') {
$rows[$value][$k] = $v['1']['name'];
$status = array(
ts('%count contact un-tagged', array(
'count' => $removed,
- 'plural' => '%count contacts un-tagged'
- ))
+ 'plural' => '%count contacts un-tagged',
+ )),
);
if ($notRemoved) {
$status[] = ts('1 contact already did not have this tag', array(
'count' => $notRemoved,
- 'plural' => '%count contacts already did not have this tag'
+ 'plural' => '%count contacts already did not have this tag',
));
}
$status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
* Attempt to match header labels with our mapper fields
* FIXME: This is essentially the same function as parent::defaultFromHeader
*
- * @param header
- * @param mapperFields
+ * @param $columnName name of column header
+ * @param $patterns pattern to match for the column
*
* @return string
*/
foreach (array(
'Individual',
'Household',
- 'Organization'
+ 'Organization',
) as $cType) {
$ruleParams = array(
'contact_type' => $cType,
/**
* called when action is browse
*
- * @return null
*/
public function browse() {
*
* @param int $groupId
*
- * @return null
*/
public function edit($groupId = NULL) {
$controller = new CRM_Core_Controller_Simple(
break;
}
- $groupNum =
- CRM_Contact_BAO_GroupContact::getContactGroup($contactID, 'Added', NULL, TRUE, TRUE);
+ $groupNum = CRM_Contact_BAO_GroupContact::getContactGroup($contactID, 'Added', NULL, TRUE, TRUE);
if ($groupNum == 1 &&
$groupStatus == 'Removed' &&
CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME,
/**
* called when action is browse
*
- * @return null
*/
public function browse() {
// do nothing :) we are using datatable for rendering relationship selectors
/**
* called when action is update or new
*
- * @return null
*/
public function edit() {
$controller = new CRM_Core_Controller_Simple('CRM_Contact_Form_Relationship', ts('Contact Relationships'), $this->_action);
/**
* called to delete the relationship of a contact
*
- * @return null
*/
public function delete() {
// calls a function to delete relationship
foreach (array(
'Individual',
'Organization',
- 'Household'
+ 'Household',
) as $contactType) {
if (in_array($contactType, $onBehalfProfile) &&
(in_array('Membership', $onBehalfProfile) ||
foreach (array(
'Individual',
'Organization',
- 'Household'
+ 'Household',
) as $contactType) {
if (in_array($contactType, $postProfile) &&
(in_array('Membership', $postProfile) ||
$unitVals = explode(CRM_Core_DAO::VALUE_SEPARATOR, $frUnits);
// CRM 10860, display text instead of a dropdown if there's only 1 frequency unit
- if (sizeof($unitVals) == 1) {
+ if (count($unitVals) == 1) {
$form->assign('one_frequency_unit', TRUE);
$unit = $unitVals[0];
$form->add('hidden', 'frequency_unit', $unit);
$this->add('text', 'name', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'name'), TRUE);
$this->addRule('name', ts('A product with this name already exists. Please select another name.'), 'objectExists', array(
'CRM_Contribute_DAO_Product',
- $this->_id
+ $this->_id,
));
$this->add('text', 'sku', ts('SKU'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'sku'));
$this->add('select', 'period_type', ts('Period Type'), array(
'' => '- select -',
'rolling' => 'Rolling',
- 'fixed' => 'Fixed'
+ 'fixed' => 'Fixed',
));
$this->add('text', 'fixed_period_start_day', ts('Fixed Period Start Day'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'fixed_period_start_day'));
foreach (array(
'cost',
'price',
- 'min_contribution'
+ 'min_contribution',
) as $f) {
$params[$f] = CRM_Utils_Rule::cleanMoney($params[$f]);
}
// define the fields
$this->addMoney('amount', ts('Recurring Contribution Amount'), TRUE,
array(
- 'size' => 20
+ 'size' => 20,
), TRUE,
'currency', NULL, TRUE
);
if ($this->_subscriptionDetails->installments != $params['installments']) {
$message .= "<br /> " . ts("Recurring contribution installments have been updated from %1 to %2 for this subscription.", array(
1 => $this->_subscriptionDetails->installments,
- 2 => $params['installments']
+ 2 => $params['installments'],
)) . ' ';
}
CRM_Core_Session::setStatus($status, $msgTitle, $msgType);
}
elseif (!$userID) {
- if ($status)
+ if ($status) {
CRM_Utils_System::setUFMessage($status);
+ }
// keep result as 1, since we not displaying anything on the redirected page anyway
return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contribute/subscriptionstatus',
"reset=1&task=update&result=1"));
* @return mixed
* @throws Exception
*/
- function run(
+ public function run(
$fileName,
$seperator = ',',
&$mapper,
* Given a list of the importable field keys that the user has selected
* set the active fields array to this list
*
- * @param array mapped array of values
+ * @param array $fieldKeys mapped array of values
*
* @return void
*/
* @param array $params
* Associated array of submitted fields.
*
- * @return boolean
+ * @return bool
* true if the block has data, otherwise false
*/
public static function dataExists($blockFields, &$params) {
* @param array $params
* Associated array of submitted fields.
*
- * @return boolean
+ * @return bool
* true if the block exits, otherwise false
*/
public static function blockExists($blockName, &$params) {
* (sort function for sortPrimaryFirst)
* @param array $location1
* @param array $location2
- * @return number
+ * @return int
*/
public static function primaryComparison($location1, $location2) {
$l1 = CRM_Utils_Array::value('is_primary', $location1);
*
* @param int $fieldID
* Field whose options are needed.
- * @param bool $inactiveNeededDo we need inactive options ?.
+ * @param bool $inactiveNeeded Do we need inactive options ?.
* Do we need inactive options ?.
*
* @return array
* all active options for fieldId
*/
- static function getCustomOption(
+ public static function getCustomOption(
$fieldID,
$inactiveNeeded = FALSE
) {
case 'Autocomplete-Select':
if (!in_array($dataType, array(
'Boolean',
- 'ContactReference'
+ 'ContactReference',
))
) {
$options = self::valuesByID($fieldId);
* @param array $params
* @param $values
*
- * @return boolean
+ * @return bool
*/
public static function &getValues(&$params, &$values) {
$websites = array();
$cfg = $comp->getConfigObject();
$cfg->add($config, $oldMode);
}
- return;
+ return NULL;
}
/**
*
* @return null
*/
- static function &defaultReturnProperties(
+ public static function &defaultReturnProperties(
$mode,
$includeCustomFields = TRUE
) {
* @param array $tables
* Array of tables.
*
- * @return null
*/
public static function tableNames(&$tables) {
$info = self::_info();
/**
* Constructor
*/
- function __construct() {
+ public function __construct() {
$template = CRM_Core_Smarty::singleton();
parent::__construct($template);
}
* @param string $error
* Error associated with the element.
*
- * @return array
*/
public static function updateAttributes(&$element, $required, $error) {
// lets create an id for all input elements, so we can generate nice label tags
}
$field->setAttribute('data-entity-value', json_encode(array(
'id' => $contact['id'],
- 'text' => implode(' :: ', $view)
+ 'text' => implode(' :: ', $view),
)));
}
}
/**
* @return array
*/
- static
- public function &columns() {
+ static public function &columns() {
static $result = NULL;
if (!$result) {
$result = array(
/**
* @return array
*/
- static
- public function &indices() {
+ static public function &indices() {
static $result = NULL;
if (!$result) {
$result = array(
/**
* @return array
*/
- static
- public function &tables() {
+ static public function &tables() {
static $result = NULL;
if (!$result) {
$result = array_keys(self::columns());
if ($isRecur) {
include_once 'Services/IATS/iats_reoccur.php';
- $iatslink1 = new iatslinkReoccur;
+ $iatslink1 = new iatslinkReoccur();
}
else {
include_once 'Services/IATS/iatslink.php';
- $iatslink1 = new iatslink;
+ $iatslink1 = new iatslink();
}
$iatslink1->setTestMode($this->_profile['mode'] != 'live');
default:
die('Invalid frequency unit!');
- break;
+ break;
}
$endDate = date('Y-m-d', $endTime);
$startDate = date('Y-m-d', $startTime);
*
* @param int $contactID
*
- * @return boolean
+ * @return bool
* true if yes, else false
*/
public function check($str, $contactID = NULL) {
* @param array $array
* The roles to check.
*
- * @return boolean
+ * @return bool
* true if yes, else false
*/
-
public function checkGroupRole($array) {
if (function_exists('user_load') && isset($array)) {
$user = user_load(array('uid' => $GLOBALS['user']->uid));
// set name of Select From Box
$this->_attributesUnselected = array(
'name' => '__' . $selectName,
- 'ondblclick' => "{$this->_jsPrefix}{$this->_jsPostfix}(this.form.elements['__" . $selectName . "'], this.form.elements['_" . $selectName . "'], this.form.elements['" . $selectName . "'], 'add')"
+ 'ondblclick' => "{$this->_jsPrefix}{$this->_jsPostfix}(this.form.elements['__" . $selectName . "'], this.form.elements['_" . $selectName . "'], this.form.elements['" . $selectName . "'], 'add')",
);
$this->_attributesUnselected = array_merge($this->_attributes, $this->_attributesUnselected);
$attrUnselected = $this->_getAttrString($this->_attributesUnselected);
// set name of Select To Box
$this->_attributesSelected = array(
'name' => '_' . $selectName,
- 'ondblclick' => "{$this->_jsPrefix}{$this->_jsPostfix}(this.form.elements['__" . $selectName . "'], this.form.elements['_" . $selectName . "'], this.form.elements['" . $selectName . "'], 'remove')"
+ 'ondblclick' => "{$this->_jsPrefix}{$this->_jsPostfix}(this.form.elements['__" . $selectName . "'], this.form.elements['_" . $selectName . "'], this.form.elements['" . $selectName . "'], 'remove')",
);
$this->_attributesSelected = array_merge($this->_attributes, $this->_attributesSelected);
$attrSelected = $this->_getAttrString($this->_attributesSelected);
// set name of Select hidden Box
$this->_attributesHidden = array(
'name' => $selectName,
- 'style' => 'overflow: hidden; visibility: hidden; width: 1px; height: 0;'
+ 'style' => 'overflow: hidden; visibility: hidden; width: 1px; height: 0;',
);
$this->_attributesHidden = array_merge($this->_attributes, $this->_attributesHidden);
$attrHidden = $this->_getAttrString($this->_attributesHidden);
* This function gets the attribute for the action that
* it matches.
*
- * @param string match the action to match against
- * @param string attribute the attribute to return ( name, link, title )
+ * @param string $match the action to match against
+ * @param string $attribute the attribute to return ( name, link, title )
*
* @return string
* the attribute that matches the action if any
/**
* Getter for the sorting direction for the fields which will be displayed on the form.
*
- * @param string action the action being performed
+ * @param string $action the action being performed
*
* @return array
* the elements that can be sorted along with their properties
* so the display routine needs to not do any work. (The
* parent object takes care of the display)
*
- * @var boolean
+ * @var bool
*/
protected $_embedded = FALSE;
* Are we in print mode? if so we need to modify the display
* functionality to do a minimal display :)
*
- * @var boolean
+ * @var bool
*/
protected $_print = FALSE;
/**
* Should we compute actions dynamically (since they are quite verbose)
*
- * @var boolean
+ * @var bool
*/
protected $_dynamicAction = FALSE;
* @param int $reset
* Are we being reset.
*
- * @return boolean
+ * @return bool
* if the GET params are different from the session params
*/
public function hasChanged($reset) {
/**
* Getter for embedded
*
- * @return boolean
+ * @return bool
* return the embedded value
*/
public function getEmbedded() {
/**
* Getter for print
*
- * @return boolean
+ * @return bool
* return the print value
*/
public function getPrint() {
*/
public static function &singleton() {
if (self::$_singleton === NULL) {
- self::$_singleton = new CRM_Core_Session;
+ self::$_singleton = new CRM_Core_Session();
}
return self::$_singleton;
}
) {
$this->_session[$this->_key] = array();
}
- return;
+ return NULL;
}
/**
$this->_session = array();
}
- return;
+ return NULL;
}
/**
/**
* Set up variables to build the form
*
- * @param null
- *
* @return void
* @acess protected
*/
/**
* Build the form object
*
- * @param null
- *
* @return void
*/
public function buildQuickForm() {
/**
* Process the form when submitted
*
- * @param null
- *
* @return void
*/
public function postProcess() {
*
* gets session variables for group or field id
*
- * @param null
- *
* @return void
*/
public function preProcess() {
/**
* Set the default form values
*
- * @param null
- *
* @return array
* the default array reference
*/
/**
* Build the form object
*
- * @param null
- *
* @return void
*/
public function buildQuickForm() {
else {
$action += CRM_Core_Action::ENABLE;
}
- $scheduleReminder = new CRM_Admin_Page_ScheduleReminders;
+ $scheduleReminder = new CRM_Admin_Page_ScheduleReminders();
$links = $scheduleReminder->links();
$links[CRM_Core_Action::DELETE]['qs'] .= "&context=event&compId={$this->_id}";
$links[CRM_Core_Action::UPDATE]['qs'] .= "&context=event&compId={$this->_id}";
if (is_array($v)) {
foreach (array(
'first_name',
- 'last_name'
+ 'last_name',
) as $name) {
if (isset($v['billing_' . $name]) &&
!isset($v[$name])
}
//passing contribution id is already registered.
- $contribution =
- self::processContribution($this, $value, $result, $contactID, $pending, $isAdditionalAmount);
+ $contribution = self::processContribution($this, $value, $result, $contactID, $pending, $isAdditionalAmount);
$value['contributionID'] = $contribution->id;
$value['contributionTypeID'] = $contribution->financial_type_id;
$value['receive_date'] = $contribution->receive_date;
*
* @return void
*/
- static function processContribution(
+ public static function processContribution(
&$form, $params, $result, $contactID,
$pending = FALSE, $isAdditionalAmount = FALSE
) {
2 => ts('Delete only this participant record.'),
);
-
$this->addRadio('delete_participant', NULL, $deleteParticipants, NULL, '<br />');
$this->setDefaults(array('delete_participant' => 1));
$status = array(
ts('Participant(s) Deleted: %1 (Total Selected: %2)', array(
1 => $deletedParticipants,
- 2 => count($this->_participantIds)
- ))
+ 2 => count($this->_participantIds),
+ )),
);
if (!empty($participantLinks)) {
$status[] = ts('The following participants no longer have an event fee recorded. You can edit their registration and record a replacement contribution by clicking the links below:') . '<br/>' . $participantLinks;
* @param string $queryOperator
*
*/
- static function exportComponents(
+ public static function exportComponents(
$selectAll,
$ids,
$params,
$componentReturnProperties = CRM_Contact_BAO_Query::defaultReturnProperties($queryMode);
if ($queryMode == CRM_Contact_BAO_Query::MODE_CONTRIBUTE) {
// soft credit columns are not automatically populated, because contribution search doesn't require them by default
- $componentReturnProperties =
- array_merge(
+ $componentReturnProperties = array_merge(
$componentReturnProperties,
CRM_Contribute_BAO_Query::softCreditReturnProperties(TRUE));
}
* Example: 'Hello {contact.first_name}' => converted to => '{contact.first_name}'
* i.e 'Hello Alan' => converted to => 'Alan'
*/
- static function _trimNonTokens(
+ public static function _trimNonTokens(
&$parsedString, $defaultGreeting,
$addressMergeGreetings, $greetingType = 'postal_greeting'
) {
CRM_Core_Session::setStatus(ts('Failed to load file (%3) for payment processor (%1) while running "%2"', array(
1 => $info->key,
2 => $method,
- 3 => $file
+ 3 => $file,
)), '', 'error');
return;
}
catch (CRM_Extension_Exception $e) {
CRM_Core_Session::setStatus(ts('Failed to determine file path for payment processor (%1) while running "%2"', array(
1 => $info->key,
- 2 => $method
+ 2 => $method,
)), '', 'error');
return;
}
// Does PP implement this method, and can we call it?
if (method_exists($processorInstance, $method) && is_callable(array(
$processorInstance,
- $method
+ $method,
))
) {
// If so, call it ...
'edit own manual batches',
'edit all manual batches',
),
- 'actionName' => 'edit'
+ 'actionName' => 'edit',
),
CRM_Core_Action::DELETE => array(
'permission' => array(
'delete own manual batches',
'delete all manual batches',
),
- 'actionName' => 'delete'
+ 'actionName' => 'delete',
),
);
* @param int $userContactID
* @param string $actionName
*
- * @return array
* list of errors to be posted back to the form
*/
public function checkPermissions($action, $permissions, $createdID, $userContactID, $actionName) {
if (in_array($pcomponent, array(
'contribute',
- 'event'
+ 'event',
))) {
$values = array();
$params = array('id' => $this->_entityId);
$query->_qill[$grouping][] = ts('Grant Type %2 %1', array(
1 => implode(' ' . ts('or') . ' ', $names),
- 2 => $op
+ 2 => $op,
));
$query->_tables['civicrm_grant'] = $query->_whereTables['civicrm_grant'] = 1;
$query->_qill[$grouping][] = ts('Grant Status %2 %1', array(
1 => implode(' ' . ts('or') . ' ', $names),
- 2 => $op
+ 2 => $op,
));
$query->_tables['civicrm_grant'] = $query->_whereTables['civicrm_grant'] = 1;
*
* @return array|null
*/
- static function defaultReturnProperties(
+ public static function defaultReturnProperties(
$mode,
$includeCustomFields = TRUE
) {
* @param array $self
* An current this object.
*
- * @return boolean
+ * @return bool
* true on successful SMTP handoff
*/
public static function testMail($testParams, $files, $self) {
) {
return array(
'_qf_default' =>
- ts("You can not schedule or send this mailing because there are currently no recipients selected. Click 'Previous' to return to the Select Recipients step, OR click 'Save & Continue Later'."),
+ ts("You can not schedule or send this mailing because there are currently no recipients selected. Click 'Previous' to return to the Select Recipients step, OR click 'Save & Continue Later'."),
);
}
'email' => $email,
'is_primary' => 1,
'location_type_id' => 1,
- )
+ ),
),
);
$contact = CRM_Contact_BAO_Contact::create($params);
'js' => array(
'js/angular-crmMailing.js',
'js/angular-crmMailing/services.js',
- 'js/angular-crmMailing/directives.js'
+ 'js/angular-crmMailing/directives.js',
),
'css' => array('css/angular-crmMailing.css'),
);
'js' => array(
'js/angular-crmMailingAB.js',
'js/angular-crmMailingAB/services.js',
- 'js/angular-crmMailingAB/directives.js'
+ 'js/angular-crmMailingAB/directives.js',
),
'css' => array('css/angular-crmMailingAB.css'),
);
'fromAddress' => array_values($fromAddress['values'][0]['api.OptionValue.get']['values']),
'defaultTestEmail' => civicrm_api3('Contact', 'getvalue', array(
'id' => 'user_contact_id',
- 'return' => 'email'
+ 'return' => 'email',
)),
'visibility' => array(
array('value' => 'Public Pages', 'label' => ts('Public Pages')),
* mail store implementation for processing CiviMail-bound emails
*/
public static function getStore($name = NULL) {
- $dao = new CRM_Core_DAO_MailSettings;
+ $dao = new CRM_Core_DAO_MailSettings();
$dao->domain_id = CRM_Core_Config::domainID();
$name ? $dao->name = $name : $dao->is_default = 1;
if (!$dao->find(TRUE)) {
return array();
}
$mails = array();
- $parser = new ezcMailParser;
+ $parser = new ezcMailParser();
//set property text attachment as file CRM-5408
$parser->options->parseTextAttachmentsAsFiles = TRUE;
foreach (array(
'cur',
'new',
- 'tmp'
+ 'tmp',
) as $sub) {
if (!file_exists($dir . DIRECTORY_SEPARATOR . $sub)) {
if ($this->_debug) {
'CiviMail.ignored',
date('Y'),
date('m'),
- date('d')
+ date('d'),
)));
$this->_processed = $this->maildir(implode(DIRECTORY_SEPARATOR, array(
'CiviMail.processed',
date('Y'),
date('m'),
- date('d')
+ date('d'),
)));
}
}
$set = new ezcMailFileSet(array($file));
- $parser = new ezcMailParser;
+ $parser = new ezcMailParser();
//set property text attachment as file CRM-5408
$parser->options->parseTextAttachmentsAsFiles = TRUE;
// OR the caller will have taken responsibility for updating the line items themselves so we will update using SQL here
$membershipTypeID = civicrm_api3('membership', 'getvalue', array(
'id' => $dao->membership_id,
- 'return' => 'membership_type_id'
+ 'return' => 'membership_type_id',
));
$sql = "UPDATE civicrm_line_item li
LEFT JOIN civicrm_price_field_value pv ON pv.id = li.price_field_value_id
CRM_Core_DAO::executeQuery($sql, array(
1 => array($dao->membership_id, 'Integer'),
2 => array($membershipTypeID, 'Integer'),
- 3 => array($dao->contribution_id, 'Integer')
+ 3 => array($dao->contribution_id, 'Integer'),
));
return $dao;
}
'email',
'external_identifier',
'membership_start_date',
- 'membership_type_id'
+ 'membership_type_id',
);
foreach ($highlightedFieldsArray as $name) {
$highlightedFields[] = $name;
$errors['_qf_default'] = '';
}
$errors['_qf_default'] .= ts('Missing required contact matching fields.') . " $fieldMessage " . ts('(Sum of all weights should be greater than or equal to threshold: %1).', array(
- 1 => $threshold
+ 1 => $threshold,
)) . ' ' . ts('(OR Membership ID if update mode.)') . '<br />';
}
}
$errors['_qf_default'] = '';
}
$errors['_qf_default'] .= ts('Missing required field: %1', array(
- 1 => $title
+ 1 => $title,
)) . '<br />';
}
}
/**
* List memberships for the UF user
*
- * @return null
*/
public function listMemberships() {
$membership = array();
$statusANDType = CRM_Member_BAO_Membership::getStatusANDTypeValues($dao->id);
foreach (array(
'status',
- 'membership_type'
+ 'membership_type',
) as $fld) {
$membership[$dao->id][$fld] = CRM_Utils_Array::value($fld, $statusANDType[$dao->id]);
}
* the main function that is called when the page
* loads, it decides the which action has to be taken for the page.
*
- * @return null
*/
public function run() {
parent::preProcess();
*
* @return \CRM_Member_Selector_Search
*/
- function __construct(
+ public function __construct(
&$queryParams,
$action = CRM_Core_Action::NONE,
$memberClause = NULL,
*
* @return array
*/
- static
- function &links(
+ public static function &links(
$status = 'all',
$isPaymentProcessor = NULL,
$accessContribution = NULL,
foreach (array(
'Pending',
'In Progress',
- 'Overdue'
+ 'Overdue',
) as $name) {
if ($statusId = array_search($name, $pledgeStatuses)) {
$status[] = $statusId;
foreach (array(
'Completed',
'Cancelled',
- 'Failed'
+ 'Failed',
) as $statusKey) {
if ($key = CRM_Utils_Array::key($statusKey, $allStatus)) {
unset($allStatus[$key]);
return civicrm_api3('pledge_payment', 'getcount', array(
'pledge_id' => $pledgeID,
- 'status_id' => array('IN' => self::getTransactionalStatus())
+ 'status_id' => array('IN' => self::getTransactionalStatus()),
));
}
* @return CRM_Pledge_BAO_PledgePayment
*/
public static function retrieve(&$params, &$defaults) {
- $payment = new CRM_Pledge_BAO_PledgePayment;
+ $payment = new CRM_Pledge_BAO_PledgePayment();
$payment->copyValues($params);
if ($payment->find(TRUE)) {
CRM_Core_DAO::storeValues($payment, $defaults);
* @return int
* $newStatus, updated status id (or 0)
*/
- static function updatePledgePaymentStatus(
+ public static function updatePledgePaymentStatus(
$pledgeID,
$paymentIDs = NULL,
$paymentStatusID = NULL,
* , is function being called from bin script?.
*
*/
- static function updatePledgePayments(
+ public static function updatePledgePayments(
$pledgeId,
$paymentStatusId,
$paymentIds = NULL,
/**
* called when action is browse
*
- * @return null
*/
public function listPledges() {
$controller = new CRM_Core_Controller_Simple(
* the main function that is called when the page
* loads, it decides the which action has to be taken for the page.
*
- * @return null
*/
public function run() {
parent::preProcess();
* This is a first version and will be tweaked over a period of time
*
*
- * @return boolean
+ * @return bool
* true if no error found
*/
public function validate() {
$chartType = CRM_Utils_Array::value("charts", $_GET);
if (in_array($chartType, array(
'barChart',
- 'pieChart'
+ 'pieChart',
))) {
$defaults["charts"] = $chartType;
}
foreach ($rows['multiValue'] as $key => $val) {
$graph[$key] = array_combine($dateKeys, $rows['multiValue'][$key]);
}
- $chartData =
- array(
- 'legend' => "$legend " . CRM_Utils_Array::value('legend', $rows, ts('Contribution')) . ' ' . ts('Summary'),
- 'values' => $graph[0],
- 'multiValues' => $graph,
- 'barKeys' => CRM_Utils_Array::value('barKeys', $rows, array()),
- );
+ $chartData = array(
+ 'legend' => "$legend " . CRM_Utils_Array::value('legend', $rows, ts('Contribution')) . ' ' . ts('Summary'),
+ 'values' => $graph[0],
+ 'multiValues' => $graph,
+ 'barKeys' => CRM_Utils_Array::value('barKeys', $rows, array()),
+ );
}
// rotate the x labels.
foreach (array(
'xSize',
'ySize',
- 'divName'
+ 'divName',
) as $f) {
if (!empty($rows[$f])) {
$chartData[$f] = $rows[$f];
foreach (array(
'xSize',
'ySize',
- 'divName'
+ 'divName',
) as $f) {
if (!empty($rows[$f])) {
$chartData[$f] = $rows[$f];
/**
* Logs with an arbitrary level.
*
- * @param mixed $level
- * @param string $message
- * @param array $context
- * @return null
- */
- /**
* @param mixed $level
* @param string $message
* @param array $context
*
- * @return null
*/
public function log($level, $message, array $context = array()) {
if (!isset($context['hostname'])) {
*
* @return array
* Array of newly created membership status property values.
- * {@getfields MembershipStatus_create}
+ * {@getfields MembershipStatus_create}
*/
function civicrm_api3_membership_status_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*
* @return array
* Array of all found membership status property values.
- * {@getfields MembershipStatus_get}
+ * {@getfields MembershipStatus_get}
*/
function civicrm_api3_membership_status_get($params) {
return _civicrm_api3_basic_get('CRM_Member_BAO_MembershipStatus', $params);
*
* @throws API_Exception
*
- * @return Array
+ * @return array
* Array of status id and status name
* @public
*/
*
* @return array
* details of found Option Values
- * {@getfields OptionValue_get}
+ * {@getfields OptionValue_get}
*/
function civicrm_api3_option_value_get($params) {
* @throws API_Exception
* @return array
* Array of newly created option_value property values.
- * {@getfields OptionValue_create}
+ * {@getfields OptionValue_create}
*/
function civicrm_api3_option_value_create($params) {
$result = _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*
* @return array
* Api result
- * {@getfields OptionValue_create}
+ * {@getfields OptionValue_create}
*/
function civicrm_api3_option_value_delete($params) {
// we will get the option group id before deleting so we can flush pseudoconstants
*
* @return array
* apiresult
- * {@getfields participant_create}
+ * {@getfields participant_create}
*/
function civicrm_api3_participant_create($params) {
//check that event id is not an template - should be done @ BAO layer
*
* @return array
* (reference ) array of properties, if error an array with an error id and error message
- * {@getfields participant_get}
+ * {@getfields participant_get}
*/
function civicrm_api3_participant_get($params) {
$mode = CRM_Contact_BAO_Query::MODE_EVENT;
*
* @return array
* participant_status array
- * {@getfields ParticipantStatusType_create}
+ * {@getfields ParticipantStatusType_create}
* @example ParticipantStatusTypeCreate.php
*/
function civicrm_api3_participant_status_type_create($params) {
*
* @return array
* Array of matching participant_statuses
- * {@getfields ParticipantStatusType_get}
+ * {@getfields ParticipantStatusType_get}
* @example ParticipantStatusTypeGet.php
*/
function civicrm_api3_participant_status_type_get($params) {
*
* @return array
* api result array
- * {@getfields ParticipantStatusType_delete}
+ * {@getfields ParticipantStatusType_delete}
* @example ParticipantStatusTypeDelete.php
*/
function civicrm_api3_participant_status_type_delete($params) {
*
* @return array
* api result array
- * {@getfields price_field_create}
+ * {@getfields price_field_create}
*/
function civicrm_api3_price_field_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*
* @return array
* Array of matching price_fields
- * {@getfields price_field_get}
+ * {@getfields price_field_get}
*/
function civicrm_api3_price_field_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*
* @return array
* API result array
- * {@getfields price_field_delete}
+ * {@getfields price_field_delete}
*/
function civicrm_api3_price_field_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
/**
* Retrieve one or more websites
*
- * @param mixed[] (reference ) input parameters
- * {@getfields website_get}
+ * @param array $params
* {@example WebsiteGet.php 0}
* @example WebsiteGet.php
- * @param array $params
- * An associative array of name/value pairs.
*
* @return array
* details of found websites
class CRM_ParticipantProcessor {
/**
*/
- function __construct() {
+ public function __construct() {
$config = CRM_Core_Config::singleton();
//this does not return on failure
* @param int $contributionPageId
* Id of the Contribution Page.
* to be deleted
- * @return boolean
+ * @return bool
* true if Contribution Page deleted, false otherwise
*/
public static function delete($contributionPageId) {
*/
private static function getInstance() {
if (is_null(self::$instance)) {
- self::$instance = new self;
+ self::$instance = new self();
}
return self::$instance;
}
'edit-1-profile-edit',
'edit-1-profile-create',
'edit-1-access-all-custom-data',
- 'edit-1-edit-all-contacts'
+ 'edit-1-edit-all-contacts',
);
$this->changePermissions($permission);