);
$js = array('onclick' => "return activityStatus(" . json_encode($message) . ");");
$this->addButtons(array(
- array(
- 'type' => 'upload',
- 'name' => ts('Save'),
- 'js' => $js,
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'upload',
+ 'name' => ts('Save'),
+ 'js' => $js,
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
}
if ($this->_activityTypeFile) {
*/
public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) {
$this->addButtons(array(
- array(
- 'type' => $nextType,
- 'name' => $title,
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => $backType,
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => $nextType,
+ 'name' => $title,
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => $backType,
+ 'name' => ts('Cancel'),
+ ),
+ ));
}
}
$this->_fields = array_slice($this->_fields, 0, $this->_maxFields);
$this->addButtons(array(
- array(
- 'type' => 'submit',
- 'name' => ts('Update Activities'),
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'submit',
+ 'name' => ts('Update Activities'),
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
$this->assign('profileTitle', $this->_title);
$this->assign('componentIds', $this->_activityHolderIds);
//validations
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),
- )), ts("Maximum Exceeded"), "error");
+ 1 => $this->_maxActivities,
+ 2 => count($this->_activityHolderIds),
+ )), ts("Maximum Exceeded"), "error");
$validate = TRUE;
}
// then redirect
// Validations.
if (count($this->_activityHolderIds) > $this->_maxActivities) {
CRM_Core_Session::setStatus(ts("The maximum number of activities you can select for Update multiple activities 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),
- )), ts('Maximum Exceeded'), 'error');
+ 1 => $this->_maxActivities,
+ 2 => count($this->_activityHolderIds),
+ )), ts('Maximum Exceeded'), 'error');
$validate = TRUE;
}
// just need to add a javacript to popup the window for printing
$this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => ts('Print Activities'),
- 'js' => array('onclick' => 'window.print()'),
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'back',
- 'name' => ts('Done'),
- ),
- )
- );
+ array(
+ 'type' => 'next',
+ 'name' => ts('Print Activities'),
+ 'js' => array('onclick' => 'window.print()'),
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'back',
+ 'name' => ts('Done'),
+ ),
+ ));
}
}
$status = array(
ts('%count activity un-tagged', array(
- 'count' => $removed,
- 'plural' => '%count activities un-tagged',
- )),
+ 'count' => $removed,
+ 'plural' => '%count activities un-tagged',
+ )),
);
if ($notRemoved) {
$status[] = ts('1 activity already did not have this tag', array(
- 'count' => $notRemoved,
- 'plural' => '%count activities already did not have this tag',
- ));
+ 'count' => $notRemoved,
+ 'plural' => '%count activities already did not have this tag',
+ ));
}
$status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
CRM_Core_Session::setStatus($status, ts("Removed Tag <em>%1</em>", array(1 => $this->_tags[$key])), 'success', array('expires' => 0));
*/
public function buildQuickForm() {
$this->addButtons(array(
- array(
- 'type' => 'done',
- 'name' => ts('Done'),
- 'isDefault' => TRUE,
- ),
- )
- );
+ array(
+ 'type' => 'done',
+ 'name' => ts('Done'),
+ 'isDefault' => TRUE,
+ ),
+ ));
}
}
$contactType = $contactType == 'Contact' ? '' : $contactType;
switch ($row['source']) {
case 'caseRel':
- $row['actions'] = '<a href="#editCaseRoleDialog" title="' . ts('Reassign %1', array(1 => $typeLabel)) . '" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="' . $row['relation_type'] . '_' . $row['relationship_direction'] . '" data-cid="' . '" data-rel_id="' . $row['rel_id'] . '"data-key="' . CRM_Core_Key::get('civicrm/ajax/relation') . '">' .
+ $row['actions'] = '<a href="#editCaseRoleDialog" title="' . ts('Reassign %1', array(1 => $typeLabel)) . '" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="' . $row['relation_type'] . '_' . $row['relationship_direction'] . '" data-cid="' . '" data-rel_id="' . $row['rel_id'] . '"data-key="' . CRM_Core_Key::get('civicrm/ajax/relation') . '">' .
'<i class="crm-i fa-pencil"></i>' .
'</a>' .
'<a href="#deleteCaseRoleDialog" title="' . ts('Remove %1', array(1 => $typeLabel)) . '" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="' . $row['relation_type'] . '_' . $row['relationship_direction'] . '" data-cid="' . $row['cid'] . '" data-key="' . CRM_Core_Key::get('civicrm/ajax/delcaserole') . '">' .
}
else {
$otherActivity->subject = ts('(Filed on case %1)', array(
- 1 => $params['caseID'],
- )) . ' ' . $otherActivity->subject;
+ 1 => $params['caseID'],
+ )) . ' ' . $otherActivity->subject;
}
$otherActivity->activity_date_time = $actDateTime;
$otherActivity->save();
// handle {birth,deceased}_date
foreach (array(
- 'birth_date',
- 'deceased_date',
- ) as $date) {
+ 'birth_date',
+ 'deceased_date',
+ ) as $date) {
if (!empty($fields[$date])) {
$flat[$date] = $fields[$date];
if (is_array($flat[$date])) {
$eidRefs = self::eidRefs();
$cpTables = self::cpTables();
$paymentTables = self::paymentTables();
- $membershipMerge = FALSE; // CRM-12695
+ // CRM-12695:
+ $membershipMerge = FALSE;
$affected = array_merge(array_keys($cidRefs), array_keys($eidRefs));
if ($tables !== FALSE) {
// retrieve main contact's related table(s)
$activeMainRelTables = CRM_Dedupe_Merger::getActiveRelTables($mainId);
// check if membership table exists in main contact's related table(s)
+ // set membership flag - CRM-12695
if (in_array('rel_table_memberships', $activeMainRelTables)) {
- $membershipMerge = TRUE; // set membership flag - CRM-12695
+ $membershipMerge = TRUE;
}
}
//get the membership status and type values.
$statusANDType = self::getStatusANDTypeValues($membership->id);
foreach (array(
- 'status',
- 'membership_type',
- ) as $fld) {
+ 'status',
+ 'membership_type',
+ ) as $fld) {
$defaults[$fld] = CRM_Utils_Array::value($fld, $statusANDType[$membership->id]);
}
if (!empty($statusANDType[$membership->id]['is_current_member'])) {
//1. membership with status : PENDING/CANCELLED (CRM-2395)
//2. Paylater/IPN renew. CRM-4556.
if ($pending || in_array($currentMembership['status_id'], array(
- array_search('Pending', $allStatus),
- // CRM-15475
- array_search('Cancelled', CRM_Member_PseudoConstant::membershipStatus(NULL, " name = 'Cancelled' ", 'name', FALSE, TRUE)),
- ))
- ) {
+ array_search('Pending', $allStatus),
+ // CRM-15475
+ array_search('Cancelled', CRM_Member_PseudoConstant::membershipStatus(NULL, " name = 'Cancelled' ", 'name', FALSE, TRUE)),
+ ))) {
$membership = new CRM_Member_DAO_Membership();
$membership->id = $currentMembership['id'];
$membership->find(TRUE);
WHERE pv.membership_type_id = %2
AND contribution_id = %3";
CRM_Core_DAO::executeQuery($sql, array(
- 1 => array($dao->membership_id, 'Integer'),
- 2 => array($membership_type_id, 'Integer'),
- 3 => array($dao->contribution_id, 'Integer'),
- ));
+ 1 => array($dao->membership_id, 'Integer'),
+ 2 => array($membership_type_id, 'Integer'),
+ 3 => array($dao->contribution_id, 'Integer'),
+ ));
return $dao;
}
$findMembersURL = CRM_Utils_System::url('civicrm/member/search', 'reset=1');
$deleteURL = CRM_Utils_System::url('civicrm/contact/search/advanced', 'reset=1');
$message .= '<br/>' . ts('%3. There are some contacts who have this membership type assigned to them. Search for contacts with this membership type from <a href=\'%1\'>Find Members</a>. If you are still getting this message after deleting these memberships, there may be contacts in the Trash (deleted) with this membership type. Try using <a href="%2">Advanced Search</a> and checking "Search in Trash".', array(
- 1 => $findMembersURL,
- 2 => $deleteURL,
- 3 => $cnt,
- ));
+ 1 => $findMembersURL,
+ 2 => $deleteURL,
+ 3 => $cnt,
+ ));
$cnt++;
}
if (in_array('MembershipBlock', $status)) {
$deleteURL = CRM_Utils_System::url('civicrm/admin/contribute', 'reset=1');
$message .= ts('%2. This Membership Type is used in an <a href=\'%1\'>Online Contribution page</a>. Uncheck this membership type in the Memberships tab.', array(
- 1 => $deleteURL,
- 2 => $cnt,
- ));
+ 1 => $deleteURL,
+ 2 => $cnt,
+ ));
throw new CRM_Core_Exception($message);
}
}
// Convert all dates to 'Y-m-d' format.
foreach (array(
- 'joinDate',
- 'startDate',
- 'endDate',
- ) as $dateParam) {
+ 'joinDate',
+ 'startDate',
+ 'endDate',
+ ) as $dateParam) {
if (!empty($$dateParam)) {
$$dateParam = CRM_Utils_Date::processDate($$dateParam, NULL, FALSE, 'Y-m-d');
}
if ($this->_action & CRM_Core_Action::RENEW) {
$this->addButtons(array(
- array(
- 'type' => 'upload',
- 'name' => ts('Renew'),
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'upload',
+ 'name' => ts('Renew'),
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
}
elseif ($this->_action & CRM_Core_Action::DELETE) {
$this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => ts('Delete'),
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'next',
+ 'name' => ts('Delete'),
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
}
else {
$this->addButtons(array(
- array(
- 'type' => 'upload',
- 'name' => ts('Save'),
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'upload',
- 'name' => ts('Save and New'),
- 'subName' => 'new',
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'upload',
+ 'name' => ts('Save'),
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'upload',
+ 'name' => ts('Save and New'),
+ 'subName' => 'new',
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
}
}
if ($this->_action & CRM_Core_Action::DELETE) {
$this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => ts('Delete'),
- 'spacing' => ' ',
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'next',
+ 'name' => ts('Delete'),
+ 'spacing' => ' ',
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
return;
}
if ($this->_context == 'standalone') {
$this->addEntityRef('contact_id', ts('Contact'), array(
- 'create' => TRUE,
- 'api' => array('extra' => array('email')),
- ), TRUE);
+ 'create' => TRUE,
+ 'api' => array('extra' => array('email')),
+ ), TRUE);
}
$selOrgMemType[0][0] = $selMemTypeOrg[0] = ts('- select -');
$pFIDs = array();
if ($priceSetId) {
CRM_Core_DAO::commonRetrieveAll('CRM_Price_DAO_PriceField', 'price_set_id', $priceSetId, $pFIDs, $return = array(
- 'html_type',
- 'name',
- 'label',
- ));
+ 'html_type',
+ 'name',
+ 'label',
+ ));
foreach ($pFIDs as $pid => $pValue) {
if ($pValue['html_type'] == 'Radio' && $pValue['name'] == 'membership_amount') {
$defaults['mem_price_field_id'] = $pValue['id'];
$single = $session->get('singleForm');
if ($single) {
$this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => ts('Save'),
- 'spacing' => ' ',
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'next',
+ 'name' => ts('Save'),
+ 'spacing' => ' ',
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
}
else {
parent::buildQuickForm();
public function buildQuickForm() {
if ($this->_action & CRM_Core_Action::RENEW) {
$this->addButtons(array(
- array(
- 'type' => 'upload',
- 'name' => ts('Renew'),
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'upload',
+ 'name' => ts('Renew'),
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
}
elseif ($this->_action & CRM_Core_Action::DELETE) {
$this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => ts('Delete'),
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'next',
+ 'name' => ts('Delete'),
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
}
else {
$this->addButtons(array(
- array(
- 'type' => 'upload',
- 'name' => ts('Save'),
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'upload',
- 'name' => ts('Save and New'),
- 'subName' => 'new',
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'upload',
+ 'name' => ts('Save'),
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'upload',
+ 'name' => ts('Save and New'),
+ 'subName' => 'new',
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
}
}
if ($this->endDate) {
$statusMsg .= ' ' . ts('The new membership End Date is %1.', array(
- 1 => CRM_Utils_Date::customFormat(substr($this->endDate, 0, 8)),
+ 1 => CRM_Utils_Date::customFormat(substr($this->endDate, 0, 8)),
));
}
if ($this->isMailSent) {
$statusMsg .= ' ' . ts('A renewal confirmation and receipt has been sent to %1.', array(
- 1 => $this->_contributorEmail,
+ 1 => $this->_contributorEmail,
));
return $statusMsg;
}
*/
public function buildQuickForm() {
$this->addButtons(array(
- array(
- 'type' => 'cancel',
- 'name' => ts('Done'),
- 'spacing' => ' ',
- 'isDefault' => TRUE,
- ),
- )
- );
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Done'),
+ 'spacing' => ' ',
+ 'isDefault' => TRUE,
+ ),
+ ));
}
}
*/
public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) {
$this->addButtons(array(
- array(
- 'type' => $nextType,
- 'name' => $title,
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => $backType,
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => $nextType,
+ 'name' => $title,
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => $backType,
+ 'name' => ts('Cancel'),
+ ),
+ ));
}
}
$this->_fields = array_slice($this->_fields, 0, $this->_maxFields);
$this->addButtons(array(
- array(
- 'type' => 'submit',
- 'name' => ts('Update Members(s)'),
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'submit',
+ 'name' => ts('Update Members(s)'),
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
$this->assign('profileTitle', $this->_title);
$this->assign('componentIds', $this->_memberIds);
if ($isPerMembership) {
$labelRows = array();
$memberships = civicrm_api3('membership', 'get', array(
- 'id' => array('IN' => $this->_memberIds),
- 'return' => 'contact_id',
- ));
+ 'id' => array('IN' => $this->_memberIds),
+ 'return' => 'contact_id',
+ ));
foreach ($memberships['values'] as $id => $membership) {
$labelRows[$id] = $rows[$membership['contact_id']];
}
//validations
if (count($this->_memberIds) > $this->_maxMembers) {
CRM_Core_Session::setStatus(ts("The maximum number of members you can select for Update multiple memberships 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),
- )), ts('Update multiple records error'), 'error');
+ 1 => $this->_maxMembers,
+ 2 => count($this->_memberIds),
+ )), ts('Update multiple records error'), 'error');
$validate = TRUE;
}
// just need to add a javacript to popup the window for printing
//
$this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => ts('Print Members'),
- 'js' => array('onclick' => 'window.print()'),
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'back',
- 'name' => ts('Done'),
- ),
- )
- );
+ array(
+ 'type' => 'next',
+ 'name' => ts('Print Members'),
+ 'js' => array('onclick' => 'window.print()'),
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'back',
+ 'name' => ts('Done'),
+ ),
+ ));
}
/**
*/
public function buildQuickForm() {
$this->addButtons(array(
- array(
- 'type' => 'done',
- 'name' => ts('Done'),
- 'isDefault' => TRUE,
- ),
- )
- );
+ array(
+ 'type' => 'done',
+ 'name' => ts('Done'),
+ 'isDefault' => TRUE,
+ ),
+ ));
}
}
*/
public function buildQuickForm() {
$this->addButtons(array(
- array(
- 'type' => 'done',
- 'name' => ts('Done'),
- 'isDefault' => TRUE,
- ),
- )
- );
+ array(
+ 'type' => 'done',
+ 'name' => ts('Done'),
+ 'isDefault' => TRUE,
+ ),
+ ));
}
}
$this->setDefaults($defaults);
$this->addButtons(array(
- array(
- 'type' => 'back',
- 'name' => ts('Previous'),
- ),
- array(
- 'type' => 'next',
- 'name' => ts('Continue'),
- 'spacing' => ' ',
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'back',
+ 'name' => ts('Previous'),
+ ),
+ array(
+ 'type' => 'next',
+ 'name' => ts('Continue'),
+ 'spacing' => ' ',
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
}
/**
}
$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,
- )) . ' ' . ts('(OR Membership ID if update mode.)') . '<br />';
+ )) . ' ' . ts('(OR Membership ID if update mode.)') . '<br />';
}
}
else {
}
$errors['_qf_default'] .= ts('Missing required field: %1', array(
1 => $title,
- )) . '<br />';
+ )) . '<br />';
}
}
}
if ($this->_invalidRowCount) {
// removed view url for invlaid contacts
$headers = array_merge(array(
- ts('Line Number'),
- ts('Reason'),
- ),
- $customHeaders
- );
+ ts('Line Number'),
+ ts('Reason'),
+ ), $customHeaders);
$this->_errorFileName = self::errorFileName(self::ERROR);
self::exportCSV($this->_errorFileName, $headers, $this->_errors);
}
if ($this->_conflictCount) {
$headers = array_merge(array(
- ts('Line Number'),
- ts('Reason'),
- ),
- $customHeaders
- );
+ ts('Line Number'),
+ ts('Reason'),
+ ), $customHeaders);
$this->_conflictFileName = self::errorFileName(self::CONFLICT);
self::exportCSV($this->_conflictFileName, $headers, $this->_conflicts);
}
if ($this->_duplicateCount) {
$headers = array_merge(array(
- ts('Line Number'),
- ts('View Membership URL'),
- ),
- $customHeaders
- );
+ ts('Line Number'),
+ ts('View Membership URL'),
+ ), $customHeaders);
$this->_duplicateFileName = self::errorFileName(self::DUPLICATE);
self::exportCSV($this->_duplicateFileName, $headers, $this->_duplicates);
$membership[$dao->id]['auto_renew'] = 0;
}
- // if relevant, count related memberships
- if (CRM_Utils_Array::value('is_current_member', $statusANDType[$dao->id]) // membership is active
- && CRM_Utils_Array::value('relationship_type_id', $statusANDType[$dao->id]) // membership type allows inheritance
+ // if relevant--membership is active and type allows inheritance--count related memberships
+ if (CRM_Utils_Array::value('is_current_member', $statusANDType[$dao->id])
+ && CRM_Utils_Array::value('relationship_type_id', $statusANDType[$dao->id])
&& empty($dao->owner_membership_id)
) {
// not an related membership
$num_related = CRM_Core_DAO::singleValueQuery($query);
$max_related = CRM_Utils_Array::value('max_related', $membership[$dao->id]);
$membership[$dao->id]['related_count'] = ($max_related == '' ? ts('%1 created', array(1 => $num_related)) : ts('%1 out of %2', array(
- 1 => $num_related,
- 2 => $max_related,
- ))
- );
+ 1 => $num_related,
+ 2 => $max_related,
+ )));
}
else {
$membership[$dao->id]['related_count'] = ts('N/A');
//get the membership status and type values.
$statusANDType = CRM_Member_BAO_Membership::getStatusANDTypeValues($dao->id);
foreach (array(
- 'status',
- 'membership_type',
- ) as $fld) {
+ 'status',
+ 'membership_type',
+ ) as $fld) {
$membership[$dao->id][$fld] = CRM_Utils_Array::value($fld, $statusANDType[$dao->id]);
}
if (!empty($statusANDType[$dao->id]['is_current_member'])) {
return;
}
+ // FIXME: `select('e.*')` seems too broad.
$e->query
- ->select('e.*') // FIXME: seems too broad.
+ ->select('e.*')
->select('mt.minimum_fee as fee, e.id as id , e.join_date, e.start_date, e.end_date, ms.name as status, mt.name as type')
->join('mt', "!casMailingJoinType civicrm_membership_type mt ON e.membership_type_id = mt.id")
->join('ms', "!casMailingJoinType civicrm_membership_status ms ON e.status_id = ms.id");
$qf->assign('invoicing', $invoicing);
}
$priceVal = implode($seperator, array(
- $customOption[$optionKey][$valueFieldName] + $taxAmount,
- $count,
- $max_value,
- ));
+ $customOption[$optionKey][$valueFieldName] + $taxAmount,
+ $count,
+ $max_value,
+ ));
$extra = array();
if (!empty($qf->_membershipBlock) && !empty($qf->_quickConfig) && $field->name == 'other_amount' && empty($qf->_contributionAmount)) {
AND option_value.label = %2";
$dao = CRM_Core_DAO::executeQuery($query, array(
- 1 => array($optionGroupName, 'String'),
- 2 => array($optionLabel, 'String'),
- ));
+ 1 => array($optionGroupName, 'String'),
+ 2 => array($optionLabel, 'String'),
+ ));
while ($dao->fetch()) {
return $dao->id;
$query .= ' AND s.financial_type_id IN (' . $types . ') AND v.financial_type_id IN (' . $types . ') ';
}
else {
- $query .= " AND 0 "; // Do not display any price sets
+ // Do not display any price sets
+ $query .= " AND 0 ";
}
$query .= " GROUP BY s.id";
$dao = CRM_Core_DAO::executeQuery($query);
*/
public function buildQuickForm() {
$this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => ts('Delete Price Field'),
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'next',
+ 'name' => ts('Delete Price Field'),
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
}
/**
public function buildQuickForm() {
$this->assign('title', $this->_title);
$this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => ts('Delete Price Set'),
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'next',
+ 'name' => ts('Delete Price Set'),
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
}
/**
// add buttons
$this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => ts('Save'),
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'next',
- 'name' => ts('Save and New'),
- 'subName' => 'new',
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'next',
+ 'name' => ts('Save'),
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'next',
+ 'name' => ts('Save and New'),
+ 'subName' => 'new',
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
// is public?
$this->add('select', 'visibility_id', ts('Visibility'), CRM_Core_PseudoConstant::visibility());
}
if ($this->_action == CRM_Core_Action::DELETE) {
$this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => ts('Delete'),
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'next',
+ 'name' => ts('Delete'),
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
return NULL;
}
else {
$this->assign('showMember', TRUE);
$membershipTypes = CRM_Member_PseudoConstant::membershipType();
$this->add('select', 'membership_type_id', ts('Membership Type'), array(
- '' => ' ',
- ) + $membershipTypes, FALSE,
- array('onClick' => "calculateRowValues( );")
- );
+ '' => ' ',
+ ) + $membershipTypes, FALSE,
+ array('onClick' => "calculateRowValues( );"));
$this->add('text', 'membership_num_terms', ts('Number of Terms'), $attributes['membership_num_terms']);
}
else {
}
// add buttons
$this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => ts('Save'),
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'next',
+ 'name' => ts('Save'),
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
// if view mode pls freeze it with the done button.
if ($this->_action & CRM_Core_Action::VIEW) {
$this->freeze();
$this->addButtons(array(
- array(
- 'type' => 'cancel',
- 'name' => ts('Done'),
- 'isDefault' => TRUE,
- ),
- )
- );
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Done'),
+ 'isDefault' => TRUE,
+ ),
+ ));
}
}
}
$this->addButtons(array(
- array(
- 'type' => 'cancel',
- 'name' => ts('Done with Preview'),
- 'isDefault' => TRUE,
- ),
- )
- );
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Done with Preview'),
+ 'isDefault' => TRUE,
+ ),
+ ));
}
}
$this->addElement('checkbox', 'is_active', ts('Is this Price Set active?'));
$this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => ts('Save'),
- 'spacing' => ' ',
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'next',
+ 'name' => ts('Save'),
+ 'spacing' => ' ',
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
$this->addFormRule(array('CRM_Price_Form_Set', 'formRule'));
// Jump directly to adding a field if popups are disabled
$action = CRM_Core_Resources::singleton()->ajaxPopupsEnabled ? 'browse' : 'add';
$url = CRM_Utils_System::url('civicrm/admin/price/field', array(
- 'reset' => 1,
- 'action' => $action,
- 'sid' => $set->id,
- 'new' => 1,
- ));
+ 'reset' => 1,
+ 'action' => $action,
+ 'sid' => $set->id,
+ 'new' => 1,
+ ));
CRM_Core_Session::setStatus(ts("Your Set '%1' has been added. You can add fields to this set now.",
array(1 => $set->title)
), ts('Saved'), 'success');
}
elseif (!empty($this->_multiRecordFields)
&& (!$this->_multiRecord || !in_array($this->_multiRecord, array(
- CRM_Core_Action::DELETE,
- CRM_Core_Action::UPDATE,
- )))
+ CRM_Core_Action::DELETE,
+ CRM_Core_Action::UPDATE,
+ )))
) {
CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js', 1, 'html-header');
//multirecord listing page
$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 />',
- ));
+ 'count' => count($contactLinks['rows']),
+ '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.',
- ));
+ 'count' => count($contactLinks['rows']),
+ '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.',
- ));
+ 'count' => count($contactLinks['rows']),
+ 'plural' => 'You can View or Edit the existing contacts.',
+ ));
}
$duplicateContactsLinks .= '</div>';
$duplicateContactsLinks .= '<table class="matching-contacts-actions">';
*/
public function buildQuickForm() {
$this->addButtons(array(
- array(
- 'type' => 'upload',
- 'name' => ts('Save'),
- 'isDefault' => TRUE,
- ),
- )
- );
+ array(
+ 'type' => 'upload',
+ 'name' => ts('Save'),
+ 'isDefault' => TRUE,
+ ),
+ ));
// also add a hidden element for to trick drupal
$this->addElement('hidden', "edit[civicrm_dummy_field]", "CiviCRM Dummy Field for Drupal");
$this->_isPermissionedChecksum = $allowPermission = FALSE;
$permissionType = CRM_Core_Permission::VIEW;
if (CRM_Core_Permission::check('administer users') || CRM_Core_Permission::check('view all contacts') || CRM_Contact_BAO_Contact_Permission::allow($this->_id)) {
- $allowPermission = TRUE;
+ $allowPermission = TRUE;
}
if ($this->_id != $userID) {
// do not allow edit for anon users in joomla frontend, CRM-4668, unless u have checksum CRM-5228
$this->preProcess();
$this->assign('recentlyViewed', FALSE);
- $this->assign('ufGroupName', 'unknown'); // override later (if possible)
+ // override later (if possible):
+ $this->assign('ufGroupName', 'unknown');
if ($this->_gid) {
$ufgroupDAO = new CRM_Core_DAO_UFGroup();
FALSE,
$op,
'customValue',
- $fieldId // not ideal, but the one thing not sent in $actionParams
+ $fieldId
);
}
}
$groups = array();
foreach (array(
- 'name',
- 'group_id',
- 'is_sms',
- ) as $n) {
+ 'name',
+ 'group_id',
+ 'is_sms',
+ ) as $n) {
if (!empty($values[$n])) {
$params[$n] = $values[$n];
}
// delete previous includes/excludes, if mailing already existed
foreach (array(
- 'groups',
- 'mailings',
- ) as $entity) {
+ 'groups',
+ 'mailings',
+ ) as $entity) {
$mg = new CRM_Mailing_DAO_MailingGroup();
$mg->mailing_id = $ids['mailing_id'];
$mg->entity_table = ($entity == 'groups') ? $groupTableName : $mailingTableName;
parent::buildQuickForm();
$this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => $this->_action & CRM_Core_Action::DELETE ? ts('Delete') : ts('Save'),
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'next',
+ 'name' => $this->_action & CRM_Core_Action::DELETE ? ts('Delete') : ts('Save'),
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
if ($this->_action & CRM_Core_Action::DELETE) {
return;
);
$this->addRule('title', ts('This Title already exists in Database.'), 'objectExists', array(
- 'CRM_SMS_DAO_Provider',
- $this->_id,
- ));
+ 'CRM_SMS_DAO_Provider',
+ $this->_id,
+ ));
$this->add('text', 'username', ts('Username'),
$attributes['username'], TRUE
if (!empty($dataErrors)) {
$errors['textFile'] = ts('The following errors were detected in %1:', array(
1 => $name,
- )) . ' <ul>' . implode('', $dataErrors) . '</ul>';
+ )) . ' <ul>' . implode('', $dataErrors) . '</ul>';
}
}
public function buildQuickForm() {
if ($this->_action & CRM_Core_Action::DELETE) {
$this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => ts('Delete Profile Field'),
- 'spacing' => ' ',
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'next',
+ 'name' => ts('Delete Profile Field'),
+ 'spacing' => ' ',
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
return;
}
// add buttons
$this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => ts('Save'),
- 'isDefault' => TRUE,
- 'js' => $js,
- ),
- array(
- 'type' => 'next',
- 'name' => ts('Save and New'),
- 'subName' => 'new',
- 'js' => $js,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'next',
+ 'name' => ts('Save'),
+ 'isDefault' => TRUE,
+ 'js' => $js,
+ ),
+ array(
+ 'type' => 'next',
+ 'name' => ts('Save and New'),
+ 'subName' => 'new',
+ 'js' => $js,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
$this->addFormRule(array('CRM_UF_Form_Field', 'formRule'), $this);
$config = CRM_Core_Config::singleton();
$showBestResult = FALSE;
if (in_array($ufField->field_name, array(
- 'country',
- 'state_province',
- )) && count($config->countryLimit) > 1
+ 'country',
+ 'state_province',
+ )) && count($config->countryLimit) > 1
) {
// get state or country field weight if exists
$field = 'state_province';
}
if ($in_selector && in_array($entityName, array(
- 'Contribution',
- 'Participant',
- 'Membership',
- 'Activity',
- ))
+ 'Contribution',
+ 'Participant',
+ 'Membership',
+ 'Activity',
+ ))
) {
$errors['in_selector'] = ts("'In Selector' cannot be checked for %1 fields.", array(1 => $entityName));
}
if (CRM_Contact_BAO_ContactType::isaSubType($profileType)) {
if ($fieldType != $profileType) {
$errors['field_name'] = ts('Cannot add or update profile field type "%1" with combination of "%2".', array(
- 1 => $fieldType,
- 2 => $profileType,
- ));
+ 1 => $fieldType,
+ 2 => $profileType,
+ ));
}
}
else {
$profileType != 'Contact'
) {
$errors['field_name'] = ts('Cannot add or update profile field type "%1" with combination of "%2".', array(
- 1 => $fieldType,
- 2 => $profileType,
- ));
+ 1 => $fieldType,
+ 2 => $profileType,
+ ));
}
}
}
$display = 'Delete Profile';
}
$this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => $display,
- 'spacing' => ' ',
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'next',
+ 'name' => $display,
+ 'spacing' => ' ',
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
return;
}
$this->applyFilter('__ALL__', 'trim');
}
$this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => ts('Save'),
- 'spacing' => ' ',
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ array(
+ 'type' => 'next',
+ 'name' => ts('Save'),
+ 'spacing' => ' ',
+ 'isDefault' => TRUE,
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ),
+ ));
// views are implemented as frozen form
if ($this->_action & CRM_Core_Action::VIEW) {
parent::buildQuickForm();
$this->addButtons(array(
- array(
- 'type' => 'cancel',
- 'name' => ts('Done with Preview'),
- 'isDefault' => TRUE,
- ),
- )
- );
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Done with Preview'),
+ 'isDefault' => TRUE,
+ ),
+ ));
}
}
public static function convertCiviModelToBackboneModel($extends, $title, $availableFields) {
$locationFields = CRM_Core_BAO_UFGroup::getLocationFields();
+ // schema in format array($fieldName => $fieldSchema)
+ // sections in format array($sectionName => $section)
$result = array(
- 'schema' => array(), // array($fieldName => $fieldSchema)
- 'sections' => array(), // array($sectionName => $section)
+ 'schema' => array(),
+ 'sections' => array(),
);
// build field list
continue 2;
}
}
+ // FIXME: type set to "Text"
$result['schema'][$fieldName] = array(
- 'type' => 'Text', // FIXME,
+ 'type' => 'Text',
'title' => $field['title'],
'civiFieldType' => $field['field_type'],
);