From 783f84c9acd4e09cc5ae6b1d02684283380cb293 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 13 May 2013 14:28:28 +1200 Subject: [PATCH] CRM-12595 fix formatting in bin files --- bin/csv/delete.php | 6 +++--- bin/csv/export.php | 2 +- bin/csv/import.php | 6 +++--- bin/deprecated/ParticipantProcessor.php | 6 +++--- bin/deprecated/RespondentProcessor.php | 10 +++++----- bin/deprecated/UpdateGreeting.php | 16 ++++++++-------- bin/deprecated/UpdateMembershipRecord.php | 6 +++--- bin/deprecated/UpdateMembershipReminderDate.php | 10 +++++----- bin/deprecated/UpdatePledgeRecord.php | 8 ++++---- bin/setup.sh | 2 +- bin/setup.sh.txt | 2 +- 11 files changed, 37 insertions(+), 37 deletions(-) diff --git a/bin/csv/delete.php b/bin/csv/delete.php index 406f154d23..147d18b10a 100644 --- a/bin/csv/delete.php +++ b/bin/csv/delete.php @@ -23,13 +23,13 @@ +--------------------------------------------------------------------+ */ -/** +/** * Delete records passed in via a csv file. You must have the record - * id defined in the csv file. + * id defined in the csv file. * * Usage: * php bin/csv/delete.php -e --file /path/to/csv/file [ -s site.org ] - * e.g.: php bin/csv/delete.php -e Contact --file /tmp/delete.csv + * e.g.: php bin/csv/delete.php -e Contact --file /tmp/delete.csv * **/ diff --git a/bin/csv/export.php b/bin/csv/export.php index bad3059b63..c8641baebf 100644 --- a/bin/csv/export.php +++ b/bin/csv/export.php @@ -24,7 +24,7 @@ */ -/** +/** * * Export records in a csv format to standard out. Optionally * limit records by field/value pairs passed as arguments. diff --git a/bin/csv/import.php b/bin/csv/import.php index ea50eed7a8..ba984cf49f 100644 --- a/bin/csv/import.php +++ b/bin/csv/import.php @@ -23,12 +23,12 @@ +--------------------------------------------------------------------+ */ -/** - * Import records from a csv file passed as an argument. +/** + * Import records from a csv file passed as an argument. * * Usage: * php bin/csv/import.php -e --file /path/to/csv/file [ -s site.org ] - * e.g.: php bin/csv/import.php -e Contact --file /tmp/import.csv + * e.g.: php bin/csv/import.php -e Contact --file /tmp/import.csv * **/ require_once (dirname(__DIR__) . '/cli.class.php'); diff --git a/bin/deprecated/ParticipantProcessor.php b/bin/deprecated/ParticipantProcessor.php index 59bfeb65b2..dc54c43e87 100644 --- a/bin/deprecated/ParticipantProcessor.php +++ b/bin/deprecated/ParticipantProcessor.php @@ -28,7 +28,7 @@ /* * This file check and updates the status of all participant records. - * + * * EventParticipantion.php prior to running this script. */ @@ -81,8 +81,8 @@ class CRM_ParticipantProcessor { LEFT JOIN civicrm_event event ON ( event.id = participant.event_id ) WHERE participant.status_id IN {$statusIds} AND (event.end_date > now() OR event.end_date IS NULL) - AND event.is_active = 1 - ORDER BY participant.register_date, participant.id + AND event.is_active = 1 + ORDER BY participant.register_date, participant.id "; $dao = CRM_Core_DAO::executeQuery($query); while ($dao->fetch()) { diff --git a/bin/deprecated/RespondentProcessor.php b/bin/deprecated/RespondentProcessor.php index b8bab74bb8..02de9554f5 100644 --- a/bin/deprecated/RespondentProcessor.php +++ b/bin/deprecated/RespondentProcessor.php @@ -28,7 +28,7 @@ /* * This file check and update the survey respondents. - * + * */ require_once '../civicrm.config.php'; @@ -59,14 +59,14 @@ class CRM_RespondentProcessor { $releasedCount = 0; if ($reserveStatusId && !empty($surveyActivityTypesIds)) { $query = ' - SELECT activity.id as id, + SELECT activity.id as id, activity.activity_date_time as activity_date_time, survey.id as surveyId, survey.release_frequency as release_frequency FROM civicrm_activity activity -INNER JOIN civicrm_survey survey ON ( survey.id = activity.source_record_id ) - WHERE activity.is_deleted = 0 - AND activity.status_id = %1 +INNER JOIN civicrm_survey survey ON ( survey.id = activity.source_record_id ) + WHERE activity.is_deleted = 0 + AND activity.status_id = %1 AND activity.activity_type_id IN ( ' . implode(', ', $surveyActivityTypesIds) . ' )'; $activity = CRM_Core_DAO::executeQuery($query, array(1 => array($reserveStatusId, 'Positive'))); $releasedIds = array(); diff --git a/bin/deprecated/UpdateGreeting.php b/bin/deprecated/UpdateGreeting.php index dd06cdc662..4e02596b2c 100644 --- a/bin/deprecated/UpdateGreeting.php +++ b/bin/deprecated/UpdateGreeting.php @@ -32,10 +32,10 @@ * params for this script * ct=Individual or ct=Household or ct=Organization (ct = contact type) * gt=email_greeting or gt=postal_greeting or gt=addressee (gt = greeting ) - * id=greeting option value + * id=greeting option value * - * IMPORTANT: You must first create valid option value before using via admin interface. - * Check option lists for Email Greetings, Postal Greetings and Addressee + * IMPORTANT: You must first create valid option value before using via admin interface. + * Check option lists for Email Greetings, Postal Greetings and Addressee */ class CRM_UpdateGreeting { function __construct() { @@ -137,9 +137,9 @@ class CRM_UpdateGreeting { if ($idFldName) { $sql = " SELECT DISTINCT id, $idFldName - FROM civicrm_contact - WHERE contact_type = %1 - AND ( {$idFldName} IS NULL OR + FROM civicrm_contact + WHERE contact_type = %1 + AND ( {$idFldName} IS NULL OR ( {$idFldName} IS NOT NULL AND {$displayFldName} IS NULL ) ) "; $dao = CRM_Core_DAO::executeQuery($sql, array(1 => array($contactType, 'String'))); @@ -215,8 +215,8 @@ SELECT DISTINCT id, $idFldName if (!empty($contactIds)) { // need to update greeting _id field. $queryString = " -UPDATE civicrm_contact - SET {$greeting}_id = {$valueID} +UPDATE civicrm_contact + SET {$greeting}_id = {$valueID} WHERE id IN (" . implode(',', $contactIds) . ")"; CRM_Core_DAO::executeQuery($queryString); } diff --git a/bin/deprecated/UpdateMembershipRecord.php b/bin/deprecated/UpdateMembershipRecord.php index 26aba9db73..67303c00cc 100644 --- a/bin/deprecated/UpdateMembershipRecord.php +++ b/bin/deprecated/UpdateMembershipRecord.php @@ -27,12 +27,12 @@ /* - * This file checks and updates the status of all membership records for a given domain using the calc_membership_status and + * This file checks and updates the status of all membership records for a given domain using the calc_membership_status and * update_contact_membership APIs. * It takes the first argument as the domain-id if specified, otherwise takes the domain-id as 1. * - * IMPORTANT: - * We are using the default Domain FROM Name and FROM Email Address as the From email address for emails sent by this script. + * IMPORTANT: + * We are using the default Domain FROM Name and FROM Email Address as the From email address for emails sent by this script. * Verify that this value has been properly set from Administer > Configure > Domain Information * If you want to use some other FROM email address, modify line 125 and set your valid email address. * diff --git a/bin/deprecated/UpdateMembershipReminderDate.php b/bin/deprecated/UpdateMembershipReminderDate.php index ca8848669b..70f2b9f1dc 100644 --- a/bin/deprecated/UpdateMembershipReminderDate.php +++ b/bin/deprecated/UpdateMembershipReminderDate.php @@ -88,14 +88,14 @@ class CRM_UpdateMembershipReminderDate { //membership type has reminder day set. $query = ' - UPDATE civicrm_membership membership -INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id ) + UPDATE civicrm_membership membership +INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id ) INNER JOIN civicrm_membership_type type ON ( type.id = membership.membership_type_id ) - SET membership.reminder_date = DATE_SUB( membership.end_date, INTERVAL type.renewal_reminder_day + 1 DAY ) - WHERE membership.reminder_date IS NULL + SET membership.reminder_date = DATE_SUB( membership.end_date, INTERVAL type.renewal_reminder_day + 1 DAY ) + WHERE membership.reminder_date IS NULL AND contact.is_deleted = 0 AND ( contact.is_deceased IS NULL OR contact.is_deceased = 0 ) - AND type.renewal_reminder_day IS NOT NULL + AND type.renewal_reminder_day IS NOT NULL AND membership.status_id IN ( ' . implode(' , ', $statusIds) . ' )'; CRM_Core_DAO::executeQuery($query); diff --git a/bin/deprecated/UpdatePledgeRecord.php b/bin/deprecated/UpdatePledgeRecord.php index f3e106dceb..bd5523a50e 100644 --- a/bin/deprecated/UpdatePledgeRecord.php +++ b/bin/deprecated/UpdatePledgeRecord.php @@ -29,7 +29,7 @@ /* * This file checks and updates the status of all pledge records for a * given domain using the updatePledgePaymentStatus. - * + * * UpdatePledgeRecord.php prior to running this script. */ @@ -86,12 +86,12 @@ SELECT pledge.contact_id as contact_id, pledge.is_test as is_test, pledge.campaign_id as campaign_id, SUM(payment.scheduled_amount) as amount_due, - ( SELECT sum(civicrm_pledge_payment.actual_amount) - FROM civicrm_pledge_payment + ( SELECT sum(civicrm_pledge_payment.actual_amount) + FROM civicrm_pledge_payment WHERE civicrm_pledge_payment.status_id = 1 AND civicrm_pledge_payment.pledge_id = pledge.id ) as amount_paid - FROM civicrm_pledge pledge, civicrm_pledge_payment payment + FROM civicrm_pledge pledge, civicrm_pledge_payment payment WHERE pledge.id = payment.pledge_id AND payment.status_id IN ( {$statusIds} ) AND pledge.status_id IN ( {$statusIds} ) GROUP By payment.id diff --git a/bin/setup.sh b/bin/setup.sh index 0db06e1665..ef8de70c14 100755 --- a/bin/setup.sh +++ b/bin/setup.sh @@ -99,7 +99,7 @@ fi cd $CALLEDPATH/.. "$PHP5PATH"php bin/cli.php -e System -a flush --triggers 1 --session 1 -# reset config_backend and userFrameworkResourceURL which gets set +# reset config_backend and userFrameworkResourceURL which gets set # when config object is initialized mysql -u$DBUSER $PASSWDSECTION $DBARGS $DBNAME -e "UPDATE civicrm_domain SET config_backend = NULL; UPDATE civicrm_setting SET value = NULL WHERE name = 'userFrameworkResourceURL';" diff --git a/bin/setup.sh.txt b/bin/setup.sh.txt index 84eeddbeeb..89d20cc3d6 100755 --- a/bin/setup.sh.txt +++ b/bin/setup.sh.txt @@ -93,7 +93,7 @@ fi cd $CALLEDPATH/.. "$PHP5PATH"php bin/cli.php -e System -a flush --triggers 1 --session 1 -# reset config_backend and userFrameworkResourceURL which gets set +# reset config_backend and userFrameworkResourceURL which gets set # when config object is initialized mysql -u$DBUSER $PASSWDSECTION $DBARGS $DBNAME -e "UPDATE civicrm_domain SET config_backend = NULL; UPDATE civicrm_setting SET value = NULL WHERE name = 'userFrameworkResourceURL';" -- 2.25.1