* Set default values for the form. Note that in edit/view mode
* the default values are retrieved from the database
*
- * @param null
- *
* @return array
* array of default values
*/
/**
* Build the form object
*
- * @param null
- *
* @return void
*/
public function buildQuickForm() {
/**
* Process the form
*
- * @param null
- *
* @return void
*/
public function postProcess() {
if (!$this->_reportId && $survey->id && !empty($params['create_report'])) {
$activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
$activityStatus = array_flip($activityStatus);
- $this->_params =
- array(
- 'name' => "survey_{$survey->id}",
- 'title' => $params['report_title'] ? $params['report_title'] : $this->_values['title'],
- 'status_id_op' => 'eq',
- 'status_id_value' => $activityStatus['Scheduled'], // reserved status
- 'survey_id_value' => array($survey->id),
- 'description' => ts('Detailed report for canvassing, phone-banking, walk lists or other surveys.'),
- );
+ $this->_params = array(
+ 'name' => "survey_{$survey->id}",
+ 'title' => $params['report_title'] ? $params['report_title'] : $this->_values['title'],
+ 'status_id_op' => 'eq',
+ 'status_id_value' => $activityStatus['Scheduled'], // reserved status
+ 'survey_id_value' => array($survey->id),
+ 'description' => ts('Detailed report for canvassing, phone-banking, walk lists or other surveys.'),
+ );
//Default value of order by
- $this->_params['order_bys'] =
- array(
- 1 => array(
- 'column' => 'sort_name',
- 'order' => 'ASC',
- ),
- );
+ $this->_params['order_bys'] = array(
+ 1 => array(
+ 'column' => 'sort_name',
+ 'order' => 'ASC',
+ ),
+ );
// for WalkList or default
$displayFields = array(
'id',
if (CRM_Core_OptionGroup::getValue('activity_type', 'WalkList') ==
$this->_values['activity_type_id']
) {
- $this->_params['order_bys'] =
- array(
- 1 => array(
- 'column' => 'street_name',
- 'order' => 'ASC',
- ),
- 2 => array(
- 'column' => 'street_number_odd_even',
- 'order' => 'ASC',
- ),
- 3 => array(
- 'column' => 'street_number',
- 'order' => 'ASC',
- ),
- 4 => array(
- 'column' => 'sort_name',
- 'order' => 'ASC',
- ),
- );
+ $this->_params['order_bys'] = array(
+ 1 => array(
+ 'column' => 'street_name',
+ 'order' => 'ASC',
+ ),
+ 2 => array(
+ 'column' => 'street_number_odd_even',
+ 'order' => 'ASC',
+ ),
+ 3 => array(
+ 'column' => 'street_number',
+ 'order' => 'ASC',
+ ),
+ 4 => array(
+ 'column' => 'sort_name',
+ 'order' => 'ASC',
+ ),
+ );
}
elseif (CRM_Core_OptionGroup::getValue('activity_type', 'PhoneBank') ==
$this->_values['activity_type_id']
/**
* 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();
$form->addSelect("email[$blockId][location_type_id]", array(
'entity' => 'email',
'class' => 'eight',
- 'placeholder' => NULL
+ 'placeholder' => NULL,
));
$multipleBulk = CRM_Core_BAO_Email::isMultipleBulkMail();
/**
* Construct the search query
*/
- function all(
+ public function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
$this->add('select', 'relationship_type_id', ts('Relationship Type'),
array(
- '' => ts('- select -')
+ '' => ts('- select -'),
) +
CRM_Contact_BAO_Relationship::getRelationType("Household"), TRUE
);
'count' => $valid,
'plural' => '%count %2 %3 relationships created',
2 => $relationship,
- 3 => $house
- ))
+ 3 => $house,
+ )),
);
if ($duplicate) {
$status[] = ts('%count was skipped because the contact is already %2 %3', array(
'count' => $duplicate,
'plural' => '%count were skipped because the contacts are already %2 %3',
2 => $relationship,
- 3 => $house
+ 3 => $house,
));
}
if ($invalid) {
$status[] = ts('%count relationship was not created because the contact is not of the right type for this relationship', array(
'count' => $invalid,
- 'plural' => '%count relationships were not created because the contact is not of the right type for this relationship'
+ 'plural' => '%count relationships were not created because the contact is not of the right type for this relationship',
));
}
$status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
CRM_Core_Session::setStatus($status, ts('Relationship created.', array(
'count' => $valid,
- 'plural' => 'Relationships created.'
+ 'plural' => 'Relationships created.',
)), 'success', array('expires' => 0));
}
}
$contact_type = '<img src="' . $config->resourceBase . 'i/contact_';
- $searchRows[$contactID]['type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ?
- $result->contact_sub_type : $result->contact_type
+ $searchRows[$contactID]['type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? $result->contact_sub_type : $result->contact_type
);
}
'=',
1,
0,
- 0
+ 0,
);
}
}
*
* @return void
*/
- function preProcess() {
+ public function preProcess() {
$this->_id = NULL;
// get the submitted values of the search form
CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Group', 'title'), TRUE
);
-
$this->addElement('textarea', 'description', ts('Description'),
CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Group', 'description')
);
*
* @return void
*/
- function view() {
+ public function view() {
$recur = new CRM_Contribute_DAO_ContributionRecur();
$recur->id = $this->_id;
if ($recur->find(TRUE)) {
* @return string
* the html string
*/
- static function formLink(
+ public static function formLink(
$links,
$mask,
$values,
/**
* Get the mask for a permission (view, edit or null)
*
- * @param string the permission
- *
* @return int
* the mask for the above permission
*/
}
/**
- * @return boolean
+ * @return bool
*/
public function getActive() {
return $this->isActive;
$angularModules = array();
$angularModules['angularFileUpload'] = array(
'ext' => 'civicrm',
- 'js' => array('bower_components/angular-file-upload/angular-file-upload.min.js')
+ 'js' => array('bower_components/angular-file-upload/angular-file-upload.min.js'),
);
$angularModules['crmApp'] = array('ext' => 'civicrm', 'js' => array('js/angular-crmApp.js'));
$angularModules['crmAttachment'] = array(
'ext' => 'civicrm',
'js' => array('js/angular-crmAttachment.js'),
- 'css' => array('css/angular-crmAttachment.css')
+ 'css' => array('css/angular-crmAttachment.css'),
);
$angularModules['crmUi'] = array(
'ext' => 'civicrm',
- 'js' => array('js/angular-crm-ui.js', 'packages/ckeditor/ckeditor.js')
+ 'js' => array('js/angular-crm-ui.js', 'packages/ckeditor/ckeditor.js'),
);
$angularModules['crmUtil'] = array('ext' => 'civicrm', 'js' => array('js/angular-crm-util.js'));
// https://github.com/jwstadler/angular-jquery-dialog-service
$angularModules['dialogService'] = array(
'ext' => 'civicrm',
- 'js' => array('bower_components/angular-jquery-dialog-service/dialog-service.js')
+ 'js' => array('bower_components/angular-jquery-dialog-service/dialog-service.js'),
);
$angularModules['ngSanitize'] = array('ext' => 'civicrm', 'js' => array('js/angular-sanitize.js'));
$angularModules['ui.utils'] = array(
'ext' => 'civicrm',
- 'js' => array('bower_components/angular-ui-utils/ui-utils.min.js')
+ 'js' => array('bower_components/angular-ui-utils/ui-utils.min.js'),
);
$angularModules['ui.sortable'] = array(
'ext' => 'civicrm',
- 'js' => array('bower_components/angular-ui-sortable/sortable.min.js')
+ 'js' => array('bower_components/angular-ui-sortable/sortable.min.js'),
);
$angularModules['unsavedChanges'] = array(
'ext' => 'civicrm',
- 'js' => array('bower_components/angular-unsavedChanges/dist/unsavedChanges.min.js')
+ 'js' => array('bower_components/angular-unsavedChanges/dist/unsavedChanges.min.js'),
);
foreach (CRM_Core_Component::getEnabledComponents() as $component) {
*
* @return string
*/
-
- abstract function getBAOName();
+ abstract protected function getBAOName();
/**
* An array of action links
* @return array
* (reference)
*/
- abstract function &links();
+ abstract protected function &links();
/**
* Name of the edit form class
*
* @return string
*/
- abstract function editForm();
+ abstract protected function editForm();
/**
* Name of the form
*
* @return string
*/
- abstract function editName();
+ abstract protected function editName();
/**
* UserContext to pop back to
*
* @return string
*/
- abstract function userContext($mode = NULL);
+ abstract protected function userContext($mode = NULL);
/**
* Get userContext params
if (!empty($values['name']) && in_array($values['name'], array(
'encounter_medium',
'case_type',
- 'case_status'
+ 'case_status',
))
) {
static $caseCount = NULL;
* WARY of this when coding
*
* -----------------------------------------------------------------------------------------------
- **/
+ */
class CRM_Core_Payment_Elavon extends CRM_Core_Payment {
// (not used, implicit in the API, might need to convert?)
const
* If an result of class error is returned it is treated as a failure
*
* -----------------------------------------------------------------------------------------------
- **/
+ */
/**
* From Payment processor documentation
*/
static private $_singleton = NULL;
- /**********************************************************
+ /**
* Constructor
*
* @param string $mode
$this->_paymentProcessor = $paymentProcessor;
}
- /**********************************************************
+ /**
* This function is set up and put here to make the mapping of fields
* from the params object as visually clear as possible for easy editing
*
* Comment out irrelevant fields
- **********************************************************/
+ */
public function mapProcessorFieldstoParams($params) {
/*concatenate full customer name first - code from EWAY gateway
*/
return $requestFields;
}
- /**********************************************************
+ /**
* This function sends request and receives response from
* the processor
- **********************************************************/
+ */
public function doDirectPayment(&$params) {
if ($params['is_recur'] == TRUE) {
CRM_Core_Error::fatal(ts('%1 - recurring payments not implemented', array(1 => $paymentProcessor)));
return $contribution->find();
}
- /**************************************************
+ /**
* Produces error message and returns from class
- **************************************************/
+ */
public function &errorExit($errorCode = NULL, $errorMessage = NULL) {
$e = CRM_Core_Error::singleton();
return $e;
}
- /**************************************************
+ /**
* NOTE: 'doTransferCheckout' not implemented
- **************************************************/
+ */
public function doTransferCheckout(&$params, $component) {
CRM_Core_Error::fatal(ts('This function is not implemented'));
}
- /********************************************************************************************
+ /**
* This public function checks to see if we have the right processor config values set
*
* NOTE: Called by Events and Contribute to check config params are set prior to trying
*
* returns string $errorMsg if any errors found - null if OK
*
- ******************************************************************************************
+ * function checkConfig( $mode ) CiviCRM V1.9 Declaration
+ * CiviCRM V2.0 Declaration
*/
- // function checkConfig( $mode ) // CiviCRM V1.9 Declaration
- // CiviCRM V2.0 Declaration
public function checkConfig() {
$errorMsg = array();
* @param array $ids
* @param array $objects
* @param bool $first
- * @return void|boolean
+ * @return void|bool
*/
public function recur(&$input, &$ids, &$objects, $first) {
if (!isset($input['txnType'])) {
case 'recurring_payment_profile_created':
if (in_array($recur->contribution_status_id, array(
array_search('Pending', $contributionStatuses),
- array_search('In Progress', $contributionStatuses)
+ array_search('In Progress', $contributionStatuses),
))
&& !empty($recur->processor_id)
) {
* (with the input parameters) & call this & all will be done
*
* @todo the references to POST throughout this class need to be removed
- * @return void|boolean
+ * @return void|bool
*/
public function main() {
CRM_Core_Error::debug_var('GET', $_GET, TRUE, TRUE);
CRM_Core_Error::debug_var('POST', $_POST, TRUE, TRUE);
if ($this->_isPaymentExpress) {
$this->handlePaymentExpress();
- return;
+ return NULL;
}
$objects = $ids = $input = array();
$this->_component = $input['component'] = self::getValue('m');
$contributionRecur = civicrm_api3('contribution_recur', 'getsingle', array(
'return' => 'contact_id, id',
- 'invoice_id' => $input['invoice']
+ 'invoice_id' => $input['invoice'],
));
$ids['contact'] = $contributionRecur['contact_id'];
$ids['contributionRecur'] = $contributionRecur['id'];
$ids['contributionPage'] = CRM_Core_DAO::singleValueQuery("SELECT contribution_page_id FROM civicrm_contribution WHERE invoice_id = %1", array(
1 => array(
$ids['contribution'],
- 'Integer'
- )
+ 'Integer',
+ ),
));
// only handle component at this stage - not terribly sure how a recurring event payment would arise
// & suspec main function may be a victom of copy & paste
/**
* @param array $params
*
- * @return $this|null
+ * @return this|null
*/
public static function add(&$params) {
if (empty($params)) {
return NULL;
}
- $dao = new CRM_Event_DAO_ParticipantStatusType;
+ $dao = new CRM_Event_DAO_ParticipantStatusType();
$dao->copyValues($params);
return $dao->save();
}
/**
* @param array $params
*
- * @return $this|null
+ * @return this|null
*/
public static function &create(&$params) {
$transaction = new CRM_Core_Transaction();
*/
public static function deleteParticipantStatusType($id) {
// return early if there are participants with this status
- $participant = new CRM_Event_DAO_Participant;
+ $participant = new CRM_Event_DAO_Participant();
$participant->status_id = $id;
if ($participant->find()) {
return FALSE;
CRM_Utils_Weight::delWeight('CRM_Event_DAO_ParticipantStatusType', $id);
- $dao = new CRM_Event_DAO_ParticipantStatusType;
+ $dao = new CRM_Event_DAO_ParticipantStatusType();
$dao->id = $id;
$dao->find(TRUE);
$dao->delete();
public static function retrieve(&$params, &$defaults) {
$result = NULL;
- $dao = new CRM_Event_DAO_ParticipantStatusType;
+ $dao = new CRM_Event_DAO_ParticipantStatusType();
$dao->copyValues($params);
if ($dao->find(TRUE)) {
CRM_Core_DAO::storeValues($dao, $defaults);
'cap' => 'round',
'join' => 'round',
'dash' => '2,2',
- 'color' => array(0, 0, 200)
+ 'color' => array(0, 0, 200),
);
$this->format = '5160';
$this->imgExtension = 'png';
*
* @param array $participants
*
- * @return null
+ * @return;
*/
public function run(&$participants) {
// fetch the 1st participant, and take her event to retrieve its attributes
'cap' => 'round',
'join' => 'round',
'dash' => '2,10',
- 'color' => array(255, 0, 0)
- )
+ 'color' => array(255, 0, 0),
+ ),
));
}
$img = $this->getImageFileName($this->event->id, $img);
/**
* This is supposed to be overrided
- **/
+ */
public function generateLabel($participant) {
$txt = "{$this->event['title']}
{$participant['display_name']}
*
* @param array $participants
*
- * @return null
+ * @return;
*/
public function createLabels(&$participants) {
ts('Allow Online Registration'),
NULL,
array(
- 'onclick' => "return showHideByValue('is_online_registration'," .
- "''," .
- "'registration_blocks'," .
- "'block'," .
- "'radio'," .
- "false );",
+ 'onclick' => "return showHideByValue('is_online_registration'," .
+ "''," .
+ "'registration_blocks'," .
+ "'block'," .
+ "'radio'," .
+ "false );",
)
);
'downloadDuplicateRecordsUrl',
'downloadMismatchRecordsUrl',
'groupAdditions',
- 'unMatchCount'
+ 'unMatchCount',
);
foreach ($properties as $property) {
$this->assign($property, $this->get($property));
*
* @return Object
*/
- static function mailingQuery(
+ public static function mailingQuery(
$mailingID,
$offset = NULL, $limit = NULL
) {
* Consider mailings that were completed not more than $maxDays ago.
*
* @return void
- **/
+ */
public static function updateEmailResetDate($minDays = 3, $maxDays = 7) {
$dao = new CRM_Core_Dao();
* @param array $values
* The array of values belonging to this line.
*
- * @return boolean
+ * @return bool
*/
public function mapField(&$values) {
return CRM_Import_Parser::VALID;
* @param array $values
* The array of values belonging to this line.
*
- * @return boolean
+ * @return bool
* the result of this processing
*/
public function preview(&$values) {
* @param array $values
* The array of values belonging to this line.
*
- * @return boolean
+ * @return bool
* the result of this processing
*/
public function summary(&$values) {
* @param array $values
* The array of values belonging to this line.
*
- * @return boolean
+ * @return bool
* the result of this processing
*/
public function import($onDuplicate, &$values) {
*
* @param $formatted
*
- * @return Array
+ * @return;
* formatted containing date values
*/
public function formattedDates($calcDates, &$formatted) {
* @param int $id
* Campaign page id.
*
- * @return null
+ * @return;
*/
public static function deleteById($id) {
CRM_Utils_Hook::pre('delete', 'Campaign', $id, CRM_Core_DAO::$_nullArray);
*
* @param $is_active
*
- * @return null
+ * @return;
*/
public static function setIsActive($id, $is_active) {
switch ($is_active) {
* @param int $id
* Pcp block id.
*
- * @return Boolean
+ * @return Bool
*/
public static function getPcpBlockInUse($id) {
$query = "
* @param int $profileId
* Supporter's profile id.
*
- * @return boolean
+ * @return bool
*/
public static function checkEmailProfile($profileId) {
$query = "
* @param int $pcpId
* @param $component
*
- * @return String
+ * @return string
*/
public static function getPcpBlockEntityId($pcpId, $component) {
$entity_table = self::getPcpEntityTable($component);
*
* @param $component
*
- * @return String
+ * @return string
*/
public static function getPcpEntityTable($component) {
$entity_table_map = array(
$this->add('select', 'target_entity_id',
ts('Online Contribution Page'),
array(
- '' => ts('- select -')
+ '' => ts('- select -'),
) +
CRM_Contribute_PseudoConstant::contributionPage()
);
if (!empty($pcpBlock->id) && CRM_PCP_BAO_PCP::getPcpBlockInUse($pcpBlock->id)) {
foreach (array(
'target_entity_type',
- 'target_entity_id'
+ 'target_entity_id',
) as $element_name) {
$element = $this->getElement($element_name);
$element->freeze();
if (!empty($fieldOptions['is_full'])) {
$element->freeze();
}
- return;
+ return NULL;
}
/**
$priceVal = implode($seperator, array(
$customOption[$optionKey][$valueFieldName] + $taxAmount,
$count,
- $max_value
+ $max_value,
));
$extra = array();
if (!empty($qf->_membershipBlock) && !empty($qf->_quickConfig) && $field->name == 'other_amount' && empty($qf->_contributionAmount)) {
$useRequired = 0;
}
- elseif (!empty($fieldOptions[$optionKey]['label'])) { //check for label.
+ elseif (!empty($fieldOptions[$optionKey]['label'])) {
+ //check for label.
$label = $fieldOptions[$optionKey]['label'];
}
$element = &$qf->add('select', $elementName, $label,
array(
- '' => ts('- select -')
+ '' => ts('- select -'),
) + $selectOption,
$useRequired && $field->is_required,
array('price' => json_encode($priceVal))
$dao = CRM_Core_DAO::executeQuery($query, array(
1 => array($optionGroupName, 'String'),
- 2 => array($optionLabel, 'String')
+ 2 => array($optionLabel, 'String'),
));
while ($dao->fetch()) {
* @param int $id
* Field Id.
*
- * @return boolean
+ * @return bool
*
*/
public static function deleteField($id) {
* @param bool $allowNoneSelection
*
*/
-
public static function priceSetValidation($priceSetId, $fields, &$error, $allowNoneSelection = FALSE) {
// check for at least one positive
// amount price field should be selected.
elseif (!empty($this->_multiRecordFields)
&& (!$this->_multiRecord || !in_array($this->_multiRecord, array(
CRM_Core_Action::DELETE,
- CRM_Core_Action::UPDATE
+ CRM_Core_Action::UPDATE,
)))
) {
CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js', 1, 'html-header');
) {
$return = TRUE;
if (!$statusMessage) {
- $statusMessage =
- ts("This profile is configured for contact type '%1'. It cannot be used to edit contacts of other types.",
+ $statusMessage = ts("This profile is configured for contact type '%1'. It cannot be used to edit contacts of other types.",
array(1 => $profileSubType ? $profileSubType : $profileType));
}
}
$duplicateContactsLinks = '<div class="matching-contacts-found">';
$duplicateContactsLinks .= ts('One matching contact was found. ', array(
'count' => count($contactLinks['rows']),
- 'plural' => '%count matching contacts were found.<br />'
+ 'plural' => '%count matching contacts were found.<br />',
));
if ($contactLinks['msg'] == 'view') {
$duplicateContactsLinks .= ts('You can View the existing contact.', array(
'count' => count($contactLinks['rows']),
- 'plural' => 'You can View the existing contacts.'
+ 'plural' => 'You can View the existing contacts.',
));
}
else {
$duplicateContactsLinks .= ts('You can View or Edit the existing contact.', array(
'count' => count($contactLinks['rows']),
- 'plural' => 'You can View or Edit the existing contacts.'
+ 'plural' => 'You can View or Edit the existing contacts.',
));
}
$duplicateContactsLinks .= '</div>';
$duplicateContactsLinks .= '<table class="matching-contacts-actions">';
$row = '';
- for ($i = 0; $i < sizeof($contactLinks['rows']); $i++) {
+ for ($i = 0; $i < count($contactLinks['rows']); $i++) {
$row .= ' <tr> ';
$row .= ' <td class="matching-contacts-name"> ';
$row .= $contactLinks['rows'][$i]['display_name'];
/**
*/
public function __construct() {
- $logging = new CRM_Logging_Schema;
+ $logging = new CRM_Logging_Schema();
$this->tables[] = 'civicrm_contribution';
$this->tables = array_merge($this->tables, array_keys($logging->customDataLogTables()));
// are grouped together across price sets but there may be a separate need to group
// by id so that entries in one price set are distinct from others. Not quite sure what
// to call the distinction for end users benefit
- array(
- 'price_field_value_label' => array(
- 'title' => ts('Price Field Value Label'),
- 'name' => 'label',
- ),
+ array(
+ 'price_field_value_label' => array(
+ 'title' => ts('Price Field Value Label'),
+ 'name' => 'label',
),
+ ),
),
);
}
'filters' => array(
'id' => array(
'title' => ts('Contact ID'),
- )
- ,
+ ),
'sort_name' => array(
'title' => ts('Contact Name'),
),
*/
public function alterNickName($value, &$row) {
if (empty($row['civicrm_contact_id'])) {
- return;
+ return NULL;
}
$contactID = $row['civicrm_contact_id'];
return "<div id=contact-{$contactID} class='crm-entity'>
*/
public function alterParticipantStatus($value) {
if (empty($value)) {
- return;
+ return NULL;
}
return CRM_Event_PseudoConstant::participantStatus($value, FALSE, 'label');
}
*/
public function alterParticipantRole($value) {
if (empty($value)) {
- return;
+ return NULL;
}
$roles = explode(CRM_Core_DAO::VALUE_SEPARATOR, $value);
$value = array();
* @param array $array
* (optional) Array to be checked for emptiness.
*
- * @return boolean
+ * @return bool
* True if the array is empty.
*/
public static function crmIsEmptyArray($array = array()) {
* @return array
* Each item is a distinct combination of values from $dimensions.
*
- * For example, the product of
- * {
+ * For example, the product of
+ * {
* fg => {red, blue},
* bg => {white, black}
- * }
- * would be
- * {
+ * }
+ * would be
+ * {
* {fg => red, bg => white},
* {fg => red, bg => black},
* {fg => blue, bg => white},
* {fg => blue, bg => black}
- * }
+ * }
*/
public static function product($dimensions, $template = array()) {
if (empty($dimensions)) {
* 'day' => '25', 'month' => '10',
* 'year' => '2007' );
*
- * @param array $dayParamsArray of the day, month, year.
+ * @param array $dayParams of the day, month, year.
* Array of the day, month, year.
* values.
* @param string $format
$from['Y'] = $now['year'];
$from['H'] = 00;
$from['i'] = $to['s'] = 00;
- $to = self::intervalAdd('month', +1, $from);
+ $to = self::intervalAdd('month', 1, $from);
$to = self::intervalAdd('second', -1, $to);
break;
}
$from['M'] = $now['mon'];
$from['Y'] = $now['year'];
$from = self::intervalAdd('day', -1 * ($now['wday']) + 7, $from);
- $to = self::intervalAdd('day', +6, $from);
+ $to = self::intervalAdd('day', 6, $from);
break;
case 'starting':
$from['Y'] = $now['year'];
$from['H'] = 00;
$from['i'] = $to['s'] = 00;
- $to = self::intervalAdd('day', +7, $from);
+ $to = self::intervalAdd('day', 7, $from);
$to = self::intervalAdd('second', -1, $to);
break;
}
$to['d'] = $now['mday'];
$to['M'] = $now['mon'];
$to['Y'] = $now['year'];
- $to = self::intervalAdd('day', +1, $to);
+ $to = self::intervalAdd('day', 1, $to);
$from['d'] = $to['d'];
$from['M'] = $to['M'];
$from['Y'] = $to['Y'];
foreach (array(
'from',
- 'to'
+ 'to',
) as $item) {
if (!empty($$item)) {
$dateRange[$item] = self::format($$item);
'Individual',
'Organization',
'Household',
- 'Case'
+ 'Case',
))) {
if ($object->extends == 'Event') {
$key = 'event_type';
return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/api/explorer'));
}
- /** used to load a template "inline", eg. for ajax, without having to build a menu for each template */
- static function loadTemplate() {
+ /**
+ * used to load a template "inline", eg. for ajax, without having to build a menu for each template
+ */
+ public static function loadTemplate() {
$request = CRM_Utils_Request::retrieve('q', 'String');
if (FALSE !== strpos($request, '..')) {
die ("SECURITY FATAL: the url can't contain '..'. Please report the issue on the forum at civicrm.org");
}
}
- /** This is a wrapper so you can call an api via json (it returns json too)
+ /**
+ * This is a wrapper so you can call an api via json (it returns json too)
* http://example.org/civicrm/api/json?entity=Contact&action=Get"&json={"contact_type":"Individual","email.get.email":{}} to take all the emails from individuals
* works for POST & GET (POST recommended)
- **/
+ */
public static function ajaxJson() {
$requestParams = CRM_Utils_Request::exportValues();
if (!is_array($params)) {
CRM_Utils_JSON::output(array(
'is_error' => 1,
- 'error_message',
- 'invalid json format: ?{"param_with_double_quote":"value"}'
+ 'error_message' => 'invalid json format: ?{"param_with_double_quote":"value"}',
));
}
* @return string
* Formatted url.
*/
- function languageNegotiationURL(
+ public function languageNegotiationURL(
$url,
$addLanguagePart = TRUE,
$removeLanguagePart = FALSE
* @param string $username
*
* @throws CRM_Core_Exception
- * @return int|NULL
+ * @return;
*/
public function getUfId($username) {
$className = get_class($this);
* @param string $dir
*
* @return array
- * - $url, (Joomla - non admin url)
- * - $siteName,
- * - $siteRoot
+ * - $url, (Joomla - non admin url)
+ * - $siteName,
+ * - $siteRoot
*/
public function getDefaultSiteSettings($dir) {
$config = CRM_Core_Config::singleton();
/**
* Get currently logged in user uf id.
*
- * @return int
+ * @return;
* $userID logged in user uf id.
*/
public function getLoggedInUfID() {
/**
* Get currently logged in user unique identifier - this tends to be the email address or user name.
*
- * @return string
+ * @return;
* logged in user unique identifier
*/
public function getLoggedInUniqueIdentifier() {
* @return void
*/
public function setTitle($title, $pageTitle) {
- return;
+ return NULL;
}
/**
* @param string $str
* The permission to check.
*
- * @return boolean
+ * @return bool
* true if yes, else false
*/
public function checkPermission($str) {
* @return void
*/
public function appendBreadCrumb($title, $url) {
- return;
+ return NULL;
}
/**
* @return void
*/
public function addHTMLHead($head) {
- return;
+ return NULL;
}
/**
/**
* Figure out the post url for the form
*
- * @param the default action if one is pre-specified
- *
* @return string
* the url to post the form
*/
* If present, add destination to querystring (works for Drupal only).
*
* @throws Exception
- * @return string
+ * @return;
* loginURL for the current CMS
*/
public function getLoginURL($destination = '') {
* @return \Civi\Core\Transaction\Frame
*/
public function getBaseFrame() {
- if (empty($this->frames)) return NULL;
+ if (empty($this->frames)) {
+ return NULL;
+ }
return $this->frames[count($this->frames) - 1];
}
$defLocType = CRM_Core_BAO_LocationType::getDefault();
$params['email'] = array(
1 => array(
- 'email' => $email,
+ 'email' => $email,
'is_primary' => 1,
'location_type_id' => ($defLocType->id) ? $defLocType->id : 1,
),
if (!empty($params['home_url'])) {
$websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
$params['website'] = array(
- 1 => array(
- 'website_type_id' => key($websiteTypes),
+ 1 => array(
+ 'website_type_id' => key($websiteTypes),
'url' => $params['home_url'],
),
);
/**
* Retrieve one or more contacts, given a set of search params
*
- * @param array input parameters
- *
* @return array
* API Result Array
*/
if ($listCurrentEmployer && !empty($currEmpDetails)) {
$contactList = array(
array(
- 'data' => $currEmpDetails['data'],
+ 'data' => $currEmpDetails['data'],
'id' => $currEmpDetails['id'],
),
);
*
* @return array
* api result array
- * {@getfields uf_match_create}
+ * {@getfields uf_match_create}
*/
function civicrm_api3_uf_match_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*
* @return array
* api result array
- * {@getfields uf_match_create}
+ * {@getfields uf_match_create}
*/
function civicrm_api3_uf_match_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*/
private static function getInstance() {
if (is_null(self::$instance)) {
- self::$instance = new self;
+ self::$instance = new self();
}
return self::$instance;
}
* @package CiviCRM
*/
class CRM_Bridge_OG_DrupalTest extends CiviUnitTestCase {
- /*
+ /**
* Test that one (ane only one) role (option value) is deleted by the updateCiviACLRole function
*/
public function testACLRoleDeleteFunctionality() {
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);
}
$test = $this;
$this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl,
function () use ($test) {
- $test->select('membership_type_id_0', 'value=1');
+ $test->select('membership_type_id_0', 'value=1');
}
);
}
)
);
$this->_apiversion = 3;
- $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')