INFRA-132 - CRM/ - PHPStorm cleanup
authorTim Otten <totten@civicrm.org>
Sat, 10 Jan 2015 04:15:06 +0000 (20:15 -0800)
committerTim Otten <totten@civicrm.org>
Sat, 10 Jan 2015 04:15:06 +0000 (20:15 -0800)
853 files changed:
CRM/ACL/BAO/ACL.php
CRM/ACL/BAO/Cache.php
CRM/ACL/Form/ACL.php
CRM/ACL/Form/ACLBasic.php
CRM/ACL/Form/WordPress/Permissions.php
CRM/ACL/Page/ACL.php
CRM/ACL/Page/ACLBasic.php
CRM/ACL/Page/EntityRole.php
CRM/Activity/BAO/ActivityContact.php
CRM/Activity/BAO/ICalendar.php
CRM/Activity/BAO/Query.php
CRM/Activity/Form/Activity.php
CRM/Activity/Form/ActivityView.php
CRM/Activity/Form/Search.php
CRM/Activity/Form/Task.php
CRM/Activity/Form/Task/AddToTag.php
CRM/Activity/Form/Task/FileOnCase.php
CRM/Activity/Form/Task/PickOption.php
CRM/Activity/Form/Task/PickProfile.php
CRM/Activity/Form/Task/RemoveFromTag.php
CRM/Activity/Import/Form/DataSource.php
CRM/Activity/Import/Form/MapField.php
CRM/Activity/Import/Form/Preview.php
CRM/Activity/Import/Form/Summary.php
CRM/Activity/Import/Parser.php
CRM/Activity/Import/Parser/Activity.php
CRM/Activity/Page/AJAX.php
CRM/Activity/Page/Tab.php
CRM/Activity/Selector/Activity.php
CRM/Activity/Selector/Search.php
CRM/Activity/Task.php
CRM/Admin/Form.php
CRM/Admin/Form/ContactType.php
CRM/Admin/Form/Extensions.php
CRM/Admin/Form/Job.php
CRM/Admin/Form/LocationType.php
CRM/Admin/Form/MailSettings.php
CRM/Admin/Form/Mapping.php
CRM/Admin/Form/MessageTemplates.php
CRM/Admin/Form/Navigation.php
CRM/Admin/Form/OptionGroup.php
CRM/Admin/Form/Options.php
CRM/Admin/Form/PaymentProcessor.php
CRM/Admin/Form/PaymentProcessorType.php
CRM/Admin/Form/PdfFormats.php
CRM/Admin/Form/Persistent.php
CRM/Admin/Form/Preferences.php
CRM/Admin/Form/Preferences/Address.php
CRM/Admin/Form/Preferences/Contribute.php
CRM/Admin/Form/Preferences/Display.php
CRM/Admin/Form/Preferences/Event.php
CRM/Admin/Form/Preferences/Multisite.php
CRM/Admin/Form/PreferencesDate.php
CRM/Admin/Form/RelationshipType.php
CRM/Admin/Form/ScheduleReminders.php
CRM/Admin/Form/Setting.php
CRM/Admin/Form/Setting/Debugging.php
CRM/Admin/Form/Setting/Localization.php
CRM/Admin/Form/Setting/Mail.php
CRM/Admin/Form/Setting/Miscellaneous.php
CRM/Admin/Form/Setting/Path.php
CRM/Admin/Form/Setting/Search.php
CRM/Admin/Form/Setting/Smtp.php
CRM/Admin/Form/Setting/UpdateConfigBackend.php
CRM/Admin/Form/Setting/Url.php
CRM/Admin/Form/Tag.php
CRM/Admin/Form/WordReplacements.php
CRM/Admin/Page/AJAX.php
CRM/Admin/Page/Admin.php
CRM/Admin/Page/CMSUser.php
CRM/Admin/Page/EventTemplate.php
CRM/Admin/Page/Extensions.php
CRM/Admin/Page/Job.php
CRM/Admin/Page/JobLog.php
CRM/Admin/Page/MessageTemplates.php
CRM/Admin/Page/Options.php
CRM/Admin/Page/ParticipantStatusType.php
CRM/Admin/Page/PaymentProcessor.php
CRM/Badge/BAO/Badge.php
CRM/Badge/Form/Layout.php
CRM/Badge/Page/AJAX.php
CRM/Batch/BAO/Batch.php
CRM/Batch/Form/Entry.php
CRM/Batch/Page/AJAX.php
CRM/Bridge/OG/CiviCRM.php
CRM/Bridge/OG/Drupal.php
CRM/Campaign/BAO/Campaign.php
CRM/Campaign/BAO/Query.php
CRM/Campaign/BAO/Survey.php
CRM/Campaign/Config.php
CRM/Campaign/Form/Campaign.php
CRM/Campaign/Form/Petition.php
CRM/Campaign/Form/Petition/Signature.php
CRM/Campaign/Form/Search.php
CRM/Campaign/Form/Search/Campaign.php
CRM/Campaign/Form/Search/Petition.php
CRM/Campaign/Form/Search/Survey.php
CRM/Campaign/Form/Survey.php
CRM/Campaign/Form/Survey/Main.php
CRM/Campaign/Form/Survey/Questions.php
CRM/Campaign/Form/Survey/Results.php
CRM/Campaign/Form/Survey/TabHeader.php
CRM/Campaign/Form/SurveyType.php
CRM/Campaign/Form/Task.php
CRM/Campaign/Form/Task/Interview.php
CRM/Campaign/Form/Task/Release.php
CRM/Campaign/Form/Task/Reserve.php
CRM/Campaign/Info.php
CRM/Campaign/Page/AJAX.php
CRM/Campaign/Page/DashBoard.php
CRM/Campaign/Page/Petition/Confirm.php
CRM/Campaign/Page/Petition/ThankYou.php
CRM/Campaign/Page/Survey.php
CRM/Campaign/Page/SurveyType.php
CRM/Campaign/Page/Vote.php
CRM/Campaign/PseudoConstant.php
CRM/Campaign/Selector/Search.php
CRM/Campaign/Task.php
CRM/Case/Audit/Audit.php
CRM/Case/BAO/Query.php
CRM/Case/Config.php
CRM/Case/Form/Activity.php
CRM/Case/Form/Activity/ChangeCaseStartDate.php
CRM/Case/Form/Activity/ChangeCaseStatus.php
CRM/Case/Form/Activity/ChangeCaseType.php
CRM/Case/Form/Activity/OpenCase.php
CRM/Case/Form/ActivityView.php
CRM/Case/Form/Case.php
CRM/Case/Form/CaseView.php
CRM/Case/Form/CustomData.php
CRM/Case/Form/EditClient.php
CRM/Case/Form/Report.php
CRM/Case/Form/Search.php
CRM/Case/Form/Task.php
CRM/Case/Form/Task/SearchTaskHookSample.php
CRM/Case/Info.php
CRM/Case/Page/AJAX.php
CRM/Case/Page/CaseDetails.php
CRM/Case/Page/DashBoard.php
CRM/Case/Page/Tab.php
CRM/Case/Selector/Search.php
CRM/Case/XMLProcessor/Process.php
CRM/Case/XMLProcessor/Report.php
CRM/Case/XMLRepository.php
CRM/Contact/BAO/Contact/Location.php
CRM/Contact/BAO/Contact/Optimizer.php
CRM/Contact/BAO/Contact/Permission.php
CRM/Contact/BAO/Contact/Utils.php
CRM/Contact/BAO/ContactType.php
CRM/Contact/BAO/DashboardContact.php
CRM/Contact/BAO/Group.php
CRM/Contact/BAO/GroupContact.php
CRM/Contact/BAO/GroupContactCache.php
CRM/Contact/BAO/GroupNesting.php
CRM/Contact/BAO/GroupNestingCache.php
CRM/Contact/BAO/Individual.php
CRM/Contact/BAO/ProximityQuery.php
CRM/Contact/BAO/Query/Hook.php
CRM/Contact/BAO/Relationship.php
CRM/Contact/BAO/RelationshipType.php
CRM/Contact/BAO/SavedSearch.php
CRM/Contact/BAO/SearchCustom.php
CRM/Contact/Controller/Search.php
CRM/Contact/DAO/Factory.php
CRM/Contact/Form/Contact.php
CRM/Contact/Form/CustomData.php
CRM/Contact/Form/DedupeRules.php
CRM/Contact/Form/Domain.php
CRM/Contact/Form/Edit/Address.php
CRM/Contact/Form/Edit/CommunicationPreferences.php
CRM/Contact/Form/Edit/Email.php
CRM/Contact/Form/Edit/IM.php
CRM/Contact/Form/Edit/Organization.php
CRM/Contact/Form/Edit/Phone.php
CRM/Contact/Form/Edit/TagsAndGroups.php
CRM/Contact/Form/GroupContact.php
CRM/Contact/Form/Inline.php
CRM/Contact/Form/Inline/ContactInfo.php
CRM/Contact/Form/Inline/ContactName.php
CRM/Contact/Form/Inline/Email.php
CRM/Contact/Form/Inline/IM.php
CRM/Contact/Form/Inline/OpenID.php
CRM/Contact/Form/Inline/Phone.php
CRM/Contact/Form/Location.php
CRM/Contact/Form/Merge.php
CRM/Contact/Form/ProfileContact.php
CRM/Contact/Form/RelatedContact.php
CRM/Contact/Form/Relationship.php
CRM/Contact/Form/Search.php
CRM/Contact/Form/Search/Advanced.php
CRM/Contact/Form/Search/Basic.php
CRM/Contact/Form/Search/Builder.php
CRM/Contact/Form/Search/Criteria.php
CRM/Contact/Form/Search/Custom.php
CRM/Contact/Form/Search/Custom/ActivitySearch.php
CRM/Contact/Form/Search/Custom/Base.php
CRM/Contact/Form/Search/Custom/Basic.php
CRM/Contact/Form/Search/Custom/DateAdded.php
CRM/Contact/Form/Search/Custom/EventAggregate.php
CRM/Contact/Form/Search/Custom/FullText.php
CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php
CRM/Contact/Form/Search/Custom/FullText/Contribution.php
CRM/Contact/Form/Search/Custom/FullText/Membership.php
CRM/Contact/Form/Search/Custom/FullText/Participant.php
CRM/Contact/Form/Search/Custom/Group.php
CRM/Contact/Form/Search/Custom/MultipleValues.php
CRM/Contact/Form/Search/Custom/PostalMailing.php
CRM/Contact/Form/Search/Custom/PriceSet.php
CRM/Contact/Form/Search/Custom/Proximity.php
CRM/Contact/Form/Search/Custom/RandomSegment.php
CRM/Contact/Form/Search/Custom/Sample.php
CRM/Contact/Form/Search/Custom/ZipCodeRange.php
CRM/Contact/Form/Task.php
CRM/Contact/Form/Task/AddToGroup.php
CRM/Contact/Form/Task/AddToHousehold.php
CRM/Contact/Form/Task/AddToOrganization.php
CRM/Contact/Form/Task/AddToTag.php
CRM/Contact/Form/Task/AlterPreferences.php
CRM/Contact/Form/Task/Batch.php
CRM/Contact/Form/Task/Delete.php
CRM/Contact/Form/Task/Email.php
CRM/Contact/Form/Task/EmailCommon.php
CRM/Contact/Form/Task/Label.php
CRM/Contact/Form/Task/LabelCommon.php
CRM/Contact/Form/Task/Map.php
CRM/Contact/Form/Task/Merge.php
CRM/Contact/Form/Task/PDFLetterCommon.php
CRM/Contact/Form/Task/PickProfile.php
CRM/Contact/Form/Task/Print.php
CRM/Contact/Form/Task/ProximityCommon.php
CRM/Contact/Form/Task/RemoveFromGroup.php
CRM/Contact/Form/Task/RemoveFromTag.php
CRM/Contact/Form/Task/Result.php
CRM/Contact/Form/Task/SMSCommon.php
CRM/Contact/Form/Task/SaveSearch.php
CRM/Contact/Form/Task/Unhold.php
CRM/Contact/Form/Task/Useradd.php
CRM/Contact/Import/Form/DataSource.php
CRM/Contact/Import/Form/MapField.php
CRM/Contact/Import/Form/Preview.php
CRM/Contact/Import/Form/Summary.php
CRM/Contact/Import/ImportJob.php
CRM/Contact/Import/Parser.php
CRM/Contact/Page/AJAX.php
CRM/Contact/Page/DashBoard.php
CRM/Contact/Page/DedupeException.php
CRM/Contact/Page/DedupeFind.php
CRM/Contact/Page/Inline/CustomData.php
CRM/Contact/Page/Inline/Website.php
CRM/Contact/Page/SavedSearch.php
CRM/Contact/Page/View.php
CRM/Contact/Page/View/CustomData.php
CRM/Contact/Page/View/GroupContact.php
CRM/Contact/Page/View/Log.php
CRM/Contact/Page/View/Note.php
CRM/Contact/Page/View/Print.php
CRM/Contact/Page/View/Relationship.php
CRM/Contact/Page/View/Summary.php
CRM/Contact/Page/View/UserDashBoard.php
CRM/Contact/Page/View/Vcard.php
CRM/Contact/Selector.php
CRM/Contact/Selector/Custom.php
CRM/Contribute/BAO/Contribution.php
CRM/Contribute/BAO/Contribution/Utils.php
CRM/Contribute/BAO/ContributionPage.php
CRM/Contribute/BAO/ContributionRecur.php
CRM/Contribute/BAO/ContributionSoft.php
CRM/Contribute/BAO/Query.php
CRM/Contribute/BAO/Widget.php
CRM/Contribute/Config.php
CRM/Contribute/Exception/InactiveContributionPageException.php
CRM/Contribute/Form/AbstractEditPayment.php
CRM/Contribute/Form/AdditionalInfo.php
CRM/Contribute/Form/AdditionalPayment.php
CRM/Contribute/Form/CancelSubscription.php
CRM/Contribute/Form/Contribution.php
CRM/Contribute/Form/Contribution/Main.php
CRM/Contribute/Form/Contribution/OnBehalfOf.php
CRM/Contribute/Form/Contribution/ThankYou.php
CRM/Contribute/Form/ContributionBase.php
CRM/Contribute/Form/ContributionCharts.php
CRM/Contribute/Form/ContributionPage.php
CRM/Contribute/Form/ContributionPage/AddProduct.php
CRM/Contribute/Form/ContributionPage/Amount.php
CRM/Contribute/Form/ContributionPage/Custom.php
CRM/Contribute/Form/ContributionPage/Delete.php
CRM/Contribute/Form/ContributionPage/Premium.php
CRM/Contribute/Form/ContributionPage/Settings.php
CRM/Contribute/Form/ContributionPage/TabHeader.php
CRM/Contribute/Form/ContributionPage/Widget.php
CRM/Contribute/Form/ContributionView.php
CRM/Contribute/Form/ManagePremiums.php
CRM/Contribute/Form/Search.php
CRM/Contribute/Form/SearchContribution.php
CRM/Contribute/Form/SoftCredit.php
CRM/Contribute/Form/Task.php
CRM/Contribute/Form/Task/Delete.php
CRM/Contribute/Form/Task/Invoice.php
CRM/Contribute/Form/Task/PDF.php
CRM/Contribute/Form/Task/PDFLetter.php
CRM/Contribute/Form/Task/PDFLetterCommon.php
CRM/Contribute/Form/Task/PickProfile.php
CRM/Contribute/Form/Task/Status.php
CRM/Contribute/Form/UpdateBilling.php
CRM/Contribute/Form/UpdateSubscription.php
CRM/Contribute/Import/Form/DataSource.php
CRM/Contribute/Import/Form/MapField.php
CRM/Contribute/Import/Form/Preview.php
CRM/Contribute/Import/Form/Summary.php
CRM/Contribute/Import/Parser.php
CRM/Contribute/Import/Parser/Contribution.php
CRM/Contribute/Info.php
CRM/Contribute/Page/ContributionPage.php
CRM/Contribute/Page/ContributionRecur.php
CRM/Contribute/Page/DashBoard.php
CRM/Contribute/Page/ManagePremiums.php
CRM/Contribute/Page/Premium.php
CRM/Contribute/Page/SubscriptionStatus.php
CRM/Contribute/Page/Tab.php
CRM/Contribute/Page/UserDashboard.php
CRM/Contribute/PseudoConstant.php
CRM/Contribute/Selector/Search.php
CRM/Core/Action.php
CRM/Core/BAO/ActionSchedule.php
CRM/Core/BAO/Address.php
CRM/Core/BAO/Block.php
CRM/Core/BAO/CMSUser.php
CRM/Core/BAO/CustomGroup.php
CRM/Core/BAO/CustomOption.php
CRM/Core/BAO/CustomQuery.php
CRM/Core/BAO/CustomValue.php
CRM/Core/BAO/CustomValueTable.php
CRM/Core/BAO/Dashboard.php
CRM/Core/BAO/Discount.php
CRM/Core/BAO/Domain.php
CRM/Core/BAO/Email.php
CRM/Core/BAO/EntityTag.php
CRM/Core/BAO/File.php
CRM/Core/BAO/FinancialTrxn.php
CRM/Core/BAO/IM.php
CRM/Core/BAO/LabelFormat.php
CRM/Core/BAO/Location.php
CRM/Core/BAO/Log.php
CRM/Core/BAO/MailSettings.php
CRM/Core/BAO/Mapping.php
CRM/Core/BAO/MessageTemplate.php
CRM/Core/BAO/Navigation.php
CRM/Core/BAO/Note.php
CRM/Core/BAO/OpenID.php
CRM/Core/BAO/OptionValue.php
CRM/Core/BAO/PaperSize.php
CRM/Core/BAO/PdfFormat.php
CRM/Core/BAO/Phone.php
CRM/Core/BAO/Preferences.php
CRM/Core/BAO/PrevNextCache.php
CRM/Core/BAO/RecurringEntity.php
CRM/Core/BAO/SchemaHandler.php
CRM/Core/BAO/Setting.php
CRM/Core/BAO/Tag.php
CRM/Core/BAO/UFField.php
CRM/Core/BAO/UFJoin.php
CRM/Core/BAO/UFMatch.php
CRM/Core/BAO/Website.php
CRM/Core/BAO/WordReplacement.php
CRM/Core/Block.php
CRM/Core/CodeGen/Config.php
CRM/Core/CodeGen/Main.php
CRM/Core/CodeGen/Specification.php
CRM/Core/Component.php
CRM/Core/Component/Config.php
CRM/Core/Component/Info.php
CRM/Core/Config.php
CRM/Core/Config/Defaults.php
CRM/Core/Config/Variables.php
CRM/Core/Controller.php
CRM/Core/DAO.php
CRM/Core/DAO/Factory.php
CRM/Core/DAO/permissions.php
CRM/Core/EntityReference.php
CRM/Core/Error.php
CRM/Core/Exception.php
CRM/Core/FileSearchInterface.php
CRM/Core/Form.php
CRM/Core/Form/Date.php
CRM/Core/Form/RecurringEntity.php
CRM/Core/Form/Renderer.php
CRM/Core/I18n.php
CRM/Core/I18n/Form.php
CRM/Core/I18n/Schema.php
CRM/Core/I18n/SchemaStructure_2_2_0.php
CRM/Core/I18n/SchemaStructure_3_0_alpha1.php
CRM/Core/I18n/SchemaStructure_3_1_alpha1.php
CRM/Core/I18n/SchemaStructure_4_2_alpha1.php
CRM/Core/I18n/SchemaStructure_4_3_1.php
CRM/Core/I18n/SchemaStructure_4_5_alpha1.php
CRM/Core/I18n/SchemaStructure_4_5_beta2.php
CRM/Core/IDS.php
CRM/Core/Invoke.php
CRM/Core/JobManager.php
CRM/Core/Key.php
CRM/Core/ManagedEntities.php
CRM/Core/Menu.php
CRM/Core/OptionGroup.php
CRM/Core/OptionValue.php
CRM/Core/Page.php
CRM/Core/Page/AJAX/Location.php
CRM/Core/Page/AJAX/RecurringEntity.php
CRM/Core/Page/Angular.php
CRM/Core/Page/Basic.php
CRM/Core/Page/File.php
CRM/Core/Payment.php
CRM/Core/Payment/AuthorizeNet.php
CRM/Core/Payment/AuthorizeNetIPN.php
CRM/Core/Payment/BaseIPN.php
CRM/Core/Payment/Dummy.php
CRM/Core/Payment/Elavon.php
CRM/Core/Payment/FirstData.php
CRM/Core/Payment/Form.php
CRM/Core/Payment/Google.php
CRM/Core/Payment/GoogleIPN.php
CRM/Core/Payment/IATS.php
CRM/Core/Payment/Moneris.php
CRM/Core/Payment/PayJunction.php
CRM/Core/Payment/PayPalIPN.php
CRM/Core/Payment/PayPalImpl.php
CRM/Core/Payment/PayPalProIPN.php
CRM/Core/Payment/PayflowPro.php
CRM/Core/Payment/PaymentExpressIPN.php
CRM/Core/Payment/ProcessorForm.php
CRM/Core/Payment/Realex.php
CRM/Core/Payment/eWAY.php
CRM/Core/Permission/Base.php
CRM/Core/Permission/DrupalBase.php
CRM/Core/Permission/WordPress.php
CRM/Core/PseudoConstant.php
CRM/Core/QuickForm/Action/Upload.php
CRM/Core/QuickForm/GroupMultiSelect.php
CRM/Core/Reference/Dynamic.php
CRM/Core/Reference/OptionValue.php
CRM/Core/Region.php
CRM/Core/Report/Excel.php
CRM/Core/Resources.php
CRM/Core/ScheduledJob.php
CRM/Core/SelectValues.php
CRM/Core/Selector/Controller.php
CRM/Core/Session.php
CRM/Core/ShowHideBlocks.php
CRM/Core/Smarty.php
CRM/Core/Smarty/plugins/block.edit.php
CRM/Core/Smarty/plugins/block.htxt.php
CRM/Core/Smarty/plugins/block.localize.php
CRM/Core/Smarty/plugins/block.serialize.php
CRM/Core/Smarty/plugins/block.ts.php
CRM/Core/Smarty/plugins/function.crmKey.php
CRM/Core/Smarty/plugins/function.crmNavigationMenu.php
CRM/Core/Smarty/plugins/function.docURL.php
CRM/Core/Smarty/plugins/function.help.php
CRM/Core/Smarty/plugins/function.sectionTotal.php
CRM/Core/Smarty/plugins/function.simpleActivityContacts.php
CRM/Core/Smarty/plugins/modifier.crmAddClass.php
CRM/Core/Smarty/plugins/modifier.crmBtnType.php
CRM/Core/Smarty/plugins/modifier.crmDate.php
CRM/Core/Smarty/plugins/modifier.crmDelete.php
CRM/Core/Smarty/plugins/modifier.crmICalDate.php
CRM/Core/Smarty/plugins/modifier.crmICalText.php
CRM/Core/Smarty/plugins/modifier.crmInsert.php
CRM/Core/Smarty/plugins/modifier.crmMoney.php
CRM/Core/Smarty/plugins/modifier.crmNumberFormat.php
CRM/Core/Smarty/plugins/modifier.crmReplace.php
CRM/Core/Smarty/plugins/modifier.crmStripAlternatives.php
CRM/Core/Smarty/plugins/modifier.htmlize.php
CRM/Core/Smarty/plugins/modifier.json.php
CRM/Core/Smarty/plugins/modifier.mb_truncate.php
CRM/Core/Smarty/plugins/prefilter.resetExtScope.php
CRM/Core/TableHierarchy.php
CRM/Custom/Form/ChangeFieldType.php
CRM/Custom/Form/Field.php
CRM/Custom/Form/Group.php
CRM/Custom/Form/MoveField.php
CRM/Custom/Form/Option.php
CRM/Custom/Form/Preview.php
CRM/Custom/Import/Form/DataSource.php
CRM/Custom/Import/Form/MapField.php
CRM/Custom/Import/Form/Preview.php
CRM/Custom/Import/Parser.php
CRM/Custom/Import/Parser/Api.php
CRM/Custom/Page/Group.php
CRM/Custom/Page/Option.php
CRM/Dashlet/Page/AllCases.php
CRM/Dashlet/Page/CaseDashboard.php
CRM/Dashlet/Page/MyCases.php
CRM/Dedupe/BAO/QueryBuilder.php
CRM/Dedupe/BAO/QueryBuilder/IndividualGeneral.php
CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php
CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php
CRM/Dedupe/BAO/Rule.php
CRM/Dedupe/BAO/RuleGroup.php
CRM/Dedupe/Finder.php
CRM/Dedupe/Merger.php
CRM/Event/BAO/Event.php
CRM/Event/BAO/ParticipantPayment.php
CRM/Event/BAO/ParticipantStatusType.php
CRM/Event/BAO/Query.php
CRM/Event/Badge.php
CRM/Event/Badge/Logo.php
CRM/Event/Badge/Logo5395.php
CRM/Event/Badge/NameTent.php
CRM/Event/Cart/BAO/Cart.php
CRM/Event/Cart/BAO/Conference.php
CRM/Event/Cart/BAO/EventInCart.php
CRM/Event/Cart/Form/Cart.php
CRM/Event/Cart/Form/Checkout/ConferenceEvents.php
CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php
CRM/Event/Cart/Form/Checkout/Payment.php
CRM/Event/Cart/Form/MerParticipant.php
CRM/Event/Cart/Page/AddToCart.php
CRM/Event/Cart/Page/CheckoutAJAX.php
CRM/Event/Cart/Page/RemoveFromCart.php
CRM/Event/Cart/StateMachine/Checkout.php
CRM/Event/Config.php
CRM/Event/Form/EventFees.php
CRM/Event/Form/ManageEvent.php
CRM/Event/Form/ManageEvent/Conference.php
CRM/Event/Form/ManageEvent/Delete.php
CRM/Event/Form/ManageEvent/EventInfo.php
CRM/Event/Form/ManageEvent/Fee.php
CRM/Event/Form/ManageEvent/Location.php
CRM/Event/Form/ManageEvent/Registration.php
CRM/Event/Form/ManageEvent/Repeat.php
CRM/Event/Form/ManageEvent/TabHeader.php
CRM/Event/Form/Participant.php
CRM/Event/Form/ParticipantFeeSelection.php
CRM/Event/Form/ParticipantView.php
CRM/Event/Form/Registration.php
CRM/Event/Form/Registration/AdditionalParticipant.php
CRM/Event/Form/Registration/Confirm.php
CRM/Event/Form/Registration/ParticipantConfirm.php
CRM/Event/Form/Registration/Register.php
CRM/Event/Form/Registration/ThankYou.php
CRM/Event/Form/Search.php
CRM/Event/Form/SearchEvent.php
CRM/Event/Form/Task.php
CRM/Event/Form/Task/AddToGroup.php
CRM/Event/Form/Task/Badge.php
CRM/Event/Form/Task/Batch.php
CRM/Event/Form/Task/Delete.php
CRM/Event/Form/Task/ParticipantStatus.php
CRM/Event/Form/Task/PickProfile.php
CRM/Event/Import/Form/DataSource.php
CRM/Event/Import/Form/MapField.php
CRM/Event/Import/Form/Preview.php
CRM/Event/Import/Form/Summary.php
CRM/Event/Import/Parser.php
CRM/Event/Import/Parser/Participant.php
CRM/Event/Page/EventInfo.php
CRM/Event/Page/ICalendar.php
CRM/Event/Page/ManageEvent.php
CRM/Event/Page/ParticipantListing.php
CRM/Event/Page/ParticipantListing/NameStatusAndDate.php
CRM/Event/Page/ParticipantListing/Simple.php
CRM/Event/Page/Tab.php
CRM/Event/PseudoConstant.php
CRM/Event/Selector/Search.php
CRM/Event/StateMachine/Registration.php
CRM/Event/Task.php
CRM/Export/BAO/Export.php
CRM/Export/Form/Select.php
CRM/Extension/Browser.php
CRM/Extension/Downloader.php
CRM/Extension/Info.php
CRM/Extension/Manager.php
CRM/Extension/Manager/Payment.php
CRM/Extension/Manager/Report.php
CRM/Extension/Manager/Search.php
CRM/Financial/BAO/ExportFormat.php
CRM/Financial/BAO/ExportFormat/CSV.php
CRM/Financial/BAO/FinancialAccount.php
CRM/Financial/BAO/FinancialItem.php
CRM/Financial/BAO/FinancialType.php
CRM/Financial/BAO/FinancialTypeAccount.php
CRM/Financial/BAO/PaymentProcessor.php
CRM/Financial/Form/BatchTransaction.php
CRM/Financial/Form/FinancialAccount.php
CRM/Financial/Form/FinancialBatch.php
CRM/Financial/Form/FinancialTypeAccount.php
CRM/Financial/Form/Search.php
CRM/Financial/Page/AJAX.php
CRM/Financial/Page/BatchTransaction.php
CRM/Financial/Page/FinancialAccount.php
CRM/Financial/Page/FinancialBatch.php
CRM/Financial/Page/FinancialType.php
CRM/Financial/Page/FinancialTypeAccount.php
CRM/Friend/BAO/Friend.php
CRM/Friend/Form.php
CRM/Grant/BAO/Grant.php
CRM/Grant/BAO/Query.php
CRM/Grant/Config.php
CRM/Grant/Form/Grant.php
CRM/Grant/Form/GrantView.php
CRM/Grant/Form/Search.php
CRM/Grant/Form/Task.php
CRM/Grant/Info.php
CRM/Grant/Page/Tab.php
CRM/Grant/Selector/Search.php
CRM/Grant/Task.php
CRM/Group/Form/Edit.php
CRM/Group/Form/Search.php
CRM/Group/Page/AJAX.php
CRM/Import/DataSource/CSV.php
CRM/Import/Form/MapField.php
CRM/Import/Parser.php
CRM/Logging/Differ.php
CRM/Logging/ReportDetail.php
CRM/Logging/Reverter.php
CRM/Logging/Schema.php
CRM/Mailing/BAO/Mailing.php
CRM/Mailing/BAO/MailingAB.php
CRM/Mailing/BAO/MailingJob.php
CRM/Mailing/BAO/Query.php
CRM/Mailing/BAO/TrackableURL.php
CRM/Mailing/Event/BAO/Bounce.php
CRM/Mailing/Event/BAO/Confirm.php
CRM/Mailing/Event/BAO/Delivered.php
CRM/Mailing/Event/BAO/Opened.php
CRM/Mailing/Event/BAO/Queue.php
CRM/Mailing/Event/BAO/Subscribe.php
CRM/Mailing/Event/BAO/TrackableURLOpen.php
CRM/Mailing/Event/BAO/Unsubscribe.php
CRM/Mailing/Form/Approve.php
CRM/Mailing/Form/Browse.php
CRM/Mailing/Form/Component.php
CRM/Mailing/Form/ForwardMailing.php
CRM/Mailing/Form/Group.php
CRM/Mailing/Form/Optout.php
CRM/Mailing/Form/Schedule.php
CRM/Mailing/Form/Search.php
CRM/Mailing/Form/Subscribe.php
CRM/Mailing/Form/Task.php
CRM/Mailing/Form/Test.php
CRM/Mailing/Form/Unsubscribe.php
CRM/Mailing/Form/Upload.php
CRM/Mailing/Info.php
CRM/Mailing/MailStore.php
CRM/Mailing/MailStore/Imap.php
CRM/Mailing/MailStore/Localdir.php
CRM/Mailing/MailStore/Maildir.php
CRM/Mailing/MailStore/Mbox.php
CRM/Mailing/MailStore/Pop3.php
CRM/Mailing/Page/AJAX.php
CRM/Mailing/Page/Browse.php
CRM/Mailing/Page/Common.php
CRM/Mailing/Page/Confirm.php
CRM/Mailing/Page/Report.php
CRM/Mailing/Page/Tab.php
CRM/Mailing/Page/View.php
CRM/Mailing/PseudoConstant.php
CRM/Mailing/Selector/Browse.php
CRM/Mailing/Selector/Event.php
CRM/Mailing/Selector/Search.php
CRM/Member/BAO/Membership.php
CRM/Member/BAO/MembershipBlock.php
CRM/Member/BAO/MembershipPayment.php
CRM/Member/BAO/MembershipStatus.php
CRM/Member/BAO/MembershipType.php
CRM/Member/Config.php
CRM/Member/Form.php
CRM/Member/Form/Membership.php
CRM/Member/Form/MembershipBlock.php
CRM/Member/Form/MembershipRenewal.php
CRM/Member/Form/MembershipStatus.php
CRM/Member/Form/MembershipType.php
CRM/Member/Form/Search.php
CRM/Member/Form/Task.php
CRM/Member/Form/Task/Batch.php
CRM/Member/Form/Task/Label.php
CRM/Member/Form/Task/PickProfile.php
CRM/Member/Import/Form/DataSource.php
CRM/Member/Import/Form/MapField.php
CRM/Member/Import/Form/Preview.php
CRM/Member/Import/Form/Summary.php
CRM/Member/Import/Parser.php
CRM/Member/Import/Parser/Membership.php
CRM/Member/Info.php
CRM/Member/Page/DashBoard.php
CRM/Member/Page/Tab.php
CRM/Member/Page/UserDashboard.php
CRM/Member/PseudoConstant.php
CRM/Member/Selector/Search.php
CRM/Note/Form/Note.php
CRM/PCP/BAO/PCP.php
CRM/PCP/Form/Campaign.php
CRM/PCP/Form/Contribute.php
CRM/PCP/Form/Event.php
CRM/PCP/Form/PCP.php
CRM/PCP/Form/PCPAccount.php
CRM/PCP/Page/PCP.php
CRM/PCP/Page/PCPInfo.php
CRM/Pledge/BAO/Pledge.php
CRM/Pledge/BAO/PledgeBlock.php
CRM/Pledge/BAO/PledgePayment.php
CRM/Pledge/BAO/Query.php
CRM/Pledge/Config.php
CRM/Pledge/Form/Payment.php
CRM/Pledge/Form/Pledge.php
CRM/Pledge/Form/Search.php
CRM/Pledge/Form/Task.php
CRM/Pledge/Form/Task/Delete.php
CRM/Pledge/Info.php
CRM/Pledge/Page/AJAX.php
CRM/Pledge/Page/DashBoard.php
CRM/Pledge/Page/Tab.php
CRM/Pledge/Selector/Search.php
CRM/Pledge/Task.php
CRM/Price/BAO/LineItem.php
CRM/Price/BAO/PriceField.php
CRM/Price/BAO/PriceFieldValue.php
CRM/Price/BAO/PriceSet.php
CRM/Price/Form/DeleteSet.php
CRM/Price/Form/Field.php
CRM/Price/Form/Option.php
CRM/Price/Form/Preview.php
CRM/Price/Form/Set.php
CRM/Price/Page/Field.php
CRM/Price/Page/Option.php
CRM/Price/Page/Set.php
CRM/Profile/Form.php
CRM/Profile/Form/Edit.php
CRM/Profile/Form/Search.php
CRM/Profile/Page/Dynamic.php
CRM/Profile/Page/Listings.php
CRM/Profile/Page/MultipleRecordFieldsListing.php
CRM/Profile/Page/View.php
CRM/Profile/Selector/Listings.php
CRM/Queue/ErrorPolicy.php
CRM/Queue/Queue/Memory.php
CRM/Report/BAO/Hook.php
CRM/Report/BAO/ReportInstance.php
CRM/Report/Config.php
CRM/Report/Form.php
CRM/Report/Form/Activity.php
CRM/Report/Form/ActivitySummary.php
CRM/Report/Form/Contact/CurrentEmployer.php
CRM/Report/Form/Contact/LoggingDetail.php
CRM/Report/Form/Contact/LoggingSummary.php
CRM/Report/Form/Contact/Relationship.php
CRM/Report/Form/Contribute/Bookkeeping.php
CRM/Report/Form/Contribute/HouseholdSummary.php
CRM/Report/Form/Contribute/LoggingDetail.php
CRM/Report/Form/Contribute/Lybunt.php
CRM/Report/Form/Contribute/Recur.php
CRM/Report/Form/Contribute/Repeat.php
CRM/Report/Form/Contribute/Sybunt.php
CRM/Report/Form/Contribute/TopDonor.php
CRM/Report/Form/Event/Income.php
CRM/Report/Form/Instance.php
CRM/Report/Form/Mailing/Summary.php
CRM/Report/Form/Pledge/Detail.php
CRM/Report/Form/Register.php
CRM/Report/Page/Instance.php
CRM/Report/Page/InstanceList.php
CRM/Report/Page/Options.php
CRM/Report/Page/TemplateList.php
CRM/Report/Utils/Get.php
CRM/Report/Utils/Report.php
CRM/SMS/BAO/Provider.php
CRM/SMS/Form/Group.php
CRM/SMS/Form/Provider.php
CRM/SMS/Form/Schedule.php
CRM/SMS/Form/Upload.php
CRM/SMS/Page/Callback.php
CRM/SMS/Page/Provider.php
CRM/SMS/Provider.php
CRM/UF/Form/AdvanceSetting.php
CRM/UF/Form/Field.php
CRM/UF/Form/Group.php
CRM/UF/Page/Field.php
CRM/UF/Page/ProfileEditor.php
CRM/Upgrade/Form.php
CRM/Upgrade/Headless.php
CRM/Upgrade/Incremental/Legacy.php
CRM/Upgrade/Incremental/php/FourFive.php
CRM/Upgrade/Incremental/php/FourFour.php
CRM/Upgrade/Incremental/php/FourSix.php
CRM/Upgrade/Incremental/php/FourThree.php
CRM/Upgrade/Incremental/php/FourTwo.php
CRM/Upgrade/Incremental/php/ThreeFour.php
CRM/Upgrade/Incremental/php/ThreeThree.php
CRM/Upgrade/Incremental/php/ThreeTwo.php
CRM/Upgrade/Page/Cleanup.php
CRM/Upgrade/Page/Upgrade.php
CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php
CRM/Upgrade/Snapshot/V4p2/Price/BAO/LineItem.php
CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php
CRM/Upgrade/Snapshot/V4p2/Price/DAO/Field.php
CRM/Upgrade/Snapshot/V4p2/Price/DAO/FieldValue.php
CRM/Upgrade/Snapshot/V4p2/Price/DAO/LineItem.php
CRM/Upgrade/Snapshot/V4p2/Price/DAO/Set.php
CRM/Upgrade/Snapshot/V4p2/Price/DAO/SetEntity.php
CRM/Utils/API/HTMLInputCoder.php
CRM/Utils/Address.php
CRM/Utils/Address/BatchUpdate.php
CRM/Utils/Address/USPS.php
CRM/Utils/Cache/APCcache.php
CRM/Utils/Cache/Memcache.php
CRM/Utils/Cache/Memcached.php
CRM/Utils/Cache/NoCache.php
CRM/Utils/Cache/SerializeCache.php
CRM/Utils/Cache/SqlGroup.php
CRM/Utils/Check/Case.php
CRM/Utils/Check/Security.php
CRM/Utils/Crypt.php
CRM/Utils/Date.php
CRM/Utils/DeprecatedUtils.php
CRM/Utils/File.php
CRM/Utils/Hook.php
CRM/Utils/Hook/Joomla.php
CRM/Utils/Hook/WordPress.php
CRM/Utils/JSON.php
CRM/Utils/Mail.php
CRM/Utils/Mail/EmailProcessor.php
CRM/Utils/Mail/Incoming.php
CRM/Utils/Migrate/Export.php
CRM/Utils/Migrate/ExportJSON.php
CRM/Utils/Migrate/Import.php
CRM/Utils/Migrate/ImportJSON.php
CRM/Utils/Money.php
CRM/Utils/OpenFlashChart.php
CRM/Utils/PDF/Utils.php
CRM/Utils/Pager.php
CRM/Utils/PagerAToZ.php
CRM/Utils/REST.php
CRM/Utils/ReCAPTCHA.php
CRM/Utils/Recent.php
CRM/Utils/Rule.php
CRM/Utils/Sort.php
CRM/Utils/String.php
CRM/Utils/Sunlight.php
CRM/Utils/System.php
CRM/Utils/System/Base.php
CRM/Utils/System/Drupal.php
CRM/Utils/System/Drupal6.php
CRM/Utils/System/Drupal8.php
CRM/Utils/System/DrupalBase.php
CRM/Utils/System/Joomla.php
CRM/Utils/System/WordPress.php
CRM/Utils/Token.php
CRM/Utils/Tree.php
CRM/Utils/Type.php
CRM/Utils/Verp.php
CRM/Utils/VersionCheck.php
CRM/Utils/Weight.php
CRM/Utils/Wrapper.php
CRM/Utils/XML.php

index 042c2113eaca5a4d72bd13f34afb3d8d179ae10f..c4aed716cd90fa0214d23e7ca16abfba8dd7f568 100644 (file)
@@ -258,8 +258,8 @@ class CRM_ACL_BAO_ACL extends CRM_ACL_DAO_ACL {
 
     $dao->query($union);
 
-    $allow    = array(0);
-    $deny     = array(0);
+    $allow = array(0);
+    $deny = array(0);
     $override = array();
 
     while ($dao->fetch()) {
@@ -333,8 +333,8 @@ class CRM_ACL_BAO_ACL extends CRM_ACL_DAO_ACL {
    * @static
    */
   public static function getClause($table, $id, &$tables) {
-    $table       = CRM_Utils_Type::escape($table, 'String');
-    $id          = CRM_Utils_Type::escape($id, 'Integer');
+    $table = CRM_Utils_Type::escape($table, 'String');
+    $id = CRM_Utils_Type::escape($id, 'Integer');
     $whereTables = array();
 
     $ssTable = CRM_Contact_BAO_SavedSearch::getTableName();
@@ -408,10 +408,10 @@ class CRM_ACL_BAO_ACL extends CRM_ACL_DAO_ACL {
 
     $rule = new CRM_ACL_BAO_ACL();
 
-    $acl     = self::getTableName();
+    $acl = self::getTableName();
     $contact = CRM_Contact_BAO_Contact::getTableName();
-    $c2g     = CRM_Contact_BAO_GroupContact::getTableName();
-    $group   = CRM_Contact_BAO_Group::getTableName();
+    $c2g = CRM_Contact_BAO_GroupContact::getTableName();
+    $group = CRM_Contact_BAO_Group::getTableName();
 
     $query = " SELECT      $acl.*
                         FROM        $acl ";
@@ -468,12 +468,12 @@ class CRM_ACL_BAO_ACL extends CRM_ACL_DAO_ACL {
 
     $rule = new CRM_ACL_BAO_ACL();
 
-    $acl         = self::getTableName();
-    $aclRole     = 'civicrm_acl_role';
+    $acl = self::getTableName();
+    $aclRole = 'civicrm_acl_role';
     $aclRoleJoin = CRM_ACL_DAO_EntityRole::getTableName();
-    $contact     = CRM_Contact_BAO_Contact::getTableName();
-    $c2g         = CRM_Contact_BAO_GroupContact::getTableName();
-    $group       = CRM_Contact_BAO_Group::getTableName();
+    $contact = CRM_Contact_BAO_Contact::getTableName();
+    $c2g = CRM_Contact_BAO_GroupContact::getTableName();
+    $group = CRM_Contact_BAO_Group::getTableName();
 
     $query = "   SELECT          $acl.*
                         FROM            $acl
@@ -532,9 +532,9 @@ class CRM_ACL_BAO_ACL extends CRM_ACL_DAO_ACL {
 
     $rule = new CRM_ACL_BAO_ACL();
 
-    $acl     = self::getTableName();
-    $c2g     = CRM_Contact_BAO_GroupContact::getTableName();
-    $group   = CRM_Contact_BAO_Group::getTableName();
+    $acl = self::getTableName();
+    $c2g = CRM_Contact_BAO_GroupContact::getTableName();
+    $group = CRM_Contact_BAO_Group::getTableName();
     $results = array();
 
     if ($contact_id) {
@@ -581,7 +581,7 @@ SELECT      $acl.*
     $aclRole = 'civicrm_acl_role';
 
     $aclER = CRM_ACL_DAO_EntityRole::getTableName();
-    $c2g   = CRM_Contact_BAO_GroupContact::getTableName();
+    $c2g = CRM_Contact_BAO_GroupContact::getTableName();
     $group = CRM_Contact_BAO_Group::getTableName();
 
     $query = "   SELECT          $acl.*
@@ -779,7 +779,7 @@ SELECT g.*
  WHERE g.id IN ( $ids )
  AND   g.is_active = 1
 ";
-        $dao            = CRM_Core_DAO::executeQuery($query);
+        $dao = CRM_Core_DAO::executeQuery($query);
         $staticGroupIDs = array();
         $cachedGroupIDs = array();
         while ($dao->fetch()) {
@@ -806,13 +806,13 @@ SELECT g.*
               $tmpTables = array();
               foreach (unserialize($dao->where_tables) as $tmpName => $tmpInfo) {
                 if ($tmpName == '`civicrm_group_contact-' . $dao->id . '`') {
-                  $tmpName          = '`civicrm_group_contact-ACL`';
-                  $tmpInfo          = str_replace('civicrm_group_contact-' . $dao->id, 'civicrm_group_contact-ACL', $tmpInfo);
+                  $tmpName = '`civicrm_group_contact-ACL`';
+                  $tmpInfo = str_replace('civicrm_group_contact-' . $dao->id, 'civicrm_group_contact-ACL', $tmpInfo);
                   $staticGroupIDs[] = $dao->id;
                 }
                 elseif ($tmpName == '`civicrm_group_contact_cache_' . $dao->id . '`') {
-                  $tmpName          = '`civicrm_group_contact_cache-ACL`';
-                  $tmpInfo          = str_replace('civicrm_group_contact_cache_' . $dao->id, 'civicrm_group_contact_cache-ACL', $tmpInfo);
+                  $tmpName = '`civicrm_group_contact_cache-ACL`';
+                  $tmpInfo = str_replace('civicrm_group_contact_cache_' . $dao->id, 'civicrm_group_contact_cache-ACL', $tmpInfo);
                   $cachedGroupIDs[] = $dao->id;
                 }
                 $tmpTables[$tmpName] = $tmpInfo;
@@ -822,7 +822,8 @@ SELECT g.*
           }
 
           if (($dao->saved_search_id || $dao->children || $dao->parents) &&
-            $dao->cache_date == NULL) {
+            $dao->cache_date == NULL
+          ) {
             CRM_Contact_BAO_GroupContactCache::load($dao);
           }
         }
index 56c8bd5d01a8769723db1fcb1ccaac7128c518c5..8771235220e2d292f8073075850ce76916b514ec 100644 (file)
@@ -165,7 +165,7 @@ WHERE  modified_date IS NULL
     // CRM_Core_DAO::singleValueQuery("TRUNCATE TABLE civicrm_acl_contact_cache"); // No, force-commits transaction
     // CRM_Core_DAO::singleValueQuery("DELETE FROM civicrm_acl_contact_cache"); // Transaction-safe
     if (CRM_Core_Transaction::isActive()) {
-      CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_COMMIT, function() {
+      CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_COMMIT, function () {
         CRM_Core_DAO::singleValueQuery("TRUNCATE TABLE civicrm_acl_contact_cache");
       });
     }
index cc6c182c2857e1a9aaa36e3a3ca521a76345d088..1769504d64931565479997bf905890b9e3d6811c 100644 (file)
@@ -156,30 +156,30 @@ class CRM_ACL_Form_ACL extends CRM_Admin_Form {
 
     $label = ts('Role');
     $role = array(
-      '-1' => ts('- select role -'),
-      '0' => ts('Everyone'),
-    ) + CRM_Core_OptionGroup::values('acl_role');
+        '-1' => ts('- select role -'),
+        '0' => ts('Everyone'),
+      ) + CRM_Core_OptionGroup::values('acl_role');
     $this->add('select', 'entity_id', $label, $role, TRUE);
 
     $group = array(
-      '-1' => ts('- select -'),
-      '0' => ts('All Groups'),
-    ) + CRM_Core_PseudoConstant::group();
+        '-1' => ts('- select -'),
+        '0' => ts('All Groups'),
+      ) + CRM_Core_PseudoConstant::group();
 
     $customGroup = array(
-      '-1' => ts('- select -'),
-      '0' => ts('All Custom Groups'),
-    ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_CustomField', 'custom_group_id');
+        '-1' => ts('- select -'),
+        '0' => ts('All Custom Groups'),
+      ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_CustomField', 'custom_group_id');
 
     $ufGroup = array(
-      '-1' => ts('- select -'),
-      '0' => ts('All Profiles'),
-    ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id');
+        '-1' => ts('- select -'),
+        '0' => ts('All Profiles'),
+      ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id');
 
     $event = array(
-      '-1' => ts('- select -'),
-      '0' => ts('All Events'),
-    ) + CRM_Event_PseudoConstant::event(NULL, FALSE, "( is_template IS NULL OR is_template != 1 )");
+        '-1' => ts('- select -'),
+        '0' => ts('All Events'),
+      ) + CRM_Event_PseudoConstant::event(NULL, FALSE, "( is_template IS NULL OR is_template != 1 )");
 
     $this->add('select', 'group_id', ts('Group'), $group);
     $this->add('select', 'custom_group_id', ts('Custom Data'), $customGroup);
index 1a00bb9103a4d9fd5bd6b57adad31a84fac078dd..d38cc2735c2bd1e8d9433d263648c4d20932dd5c 100644 (file)
@@ -95,9 +95,9 @@ SELECT object_table
 
     $label = ts('Role');
     $role = array(
-    '-1' => ts('- select role -'),
-      '0' => ts('Everyone'),
-    ) + CRM_Core_OptionGroup::values('acl_role');
+        '-1' => ts('- select role -'),
+        '0' => ts('Everyone'),
+      ) + CRM_Core_OptionGroup::values('acl_role');
     $entityID = &$this->add('select', 'entity_id', $label, $role, TRUE);
 
     if ($this->_id) {
index 230d215e0827f05750c63ab7c02194ae357c16b0..f4c3e14fd095938f394dcd3cffbb9e8f72869143 100644 (file)
@@ -88,10 +88,11 @@ class CRM_ACL_Form_WordPress_Permissions extends CRM_Core_Form {
     $this->addButtons(
       array(
         array(
-          'type'      => 'next',
-          'name'      => ts('Save'),
-          'spacing'   => '',
-          'isDefault' => FALSE  ),
+          'type' => 'next',
+          'name' => ts('Save'),
+          'spacing' => '',
+          'isDefault' => FALSE
+        ),
       )
     );
 
@@ -141,7 +142,10 @@ class CRM_ACL_Form_WordPress_Permissions extends CRM_Core_Form {
         }
         if (!empty($warningPermissionNames)) {
           CRM_Core_Session::setStatus(
-            ts('The %1 role was assigned one or more permissions that may prove dangerous for users of that role to have. Please reconsider assigning %2 to them.', array(1 => $wp_roles->role_names[$role], 2 => implode(', ', $warningPermissionNames))),
+            ts('The %1 role was assigned one or more permissions that may prove dangerous for users of that role to have. Please reconsider assigning %2 to them.', array(
+                1 => $wp_roles->role_names[$role],
+                2 => implode(', ', $warningPermissionNames)
+              )),
             ts('Unsafe Permission Settings')
           );
         }
index b232e99fe5393afb6f76a436b1f02babc7dddab4..b711625c5e85e7b179f0d5cadcda6aa531e54fac 100644 (file)
@@ -121,12 +121,14 @@ class CRM_ACL_Page_ACL extends CRM_Core_Page_Basic {
     );
 
     // set breadcrumb to append to admin/access
-    $breadCrumb = array(array(
-    'title' => ts('Access Control'),
+    $breadCrumb = array(
+      array(
+        'title' => ts('Access Control'),
         'url' => CRM_Utils_System::url('civicrm/admin/access',
           'reset=1'
         ),
-      ));
+      )
+    );
     CRM_Utils_System::appendBreadCrumb($breadCrumb);
     // what action to take ?
     if ($action & (CRM_Core_Action::ADD | CRM_Core_Action::DELETE)) {
@@ -173,22 +175,22 @@ ORDER BY entity_id
     $roles = CRM_Core_OptionGroup::values('acl_role');
 
     $group = array(
-    '-1' => ts('- select -'),
-      '0' => ts('All Groups'),
-    ) + CRM_Core_PseudoConstant::group();
+        '-1' => ts('- select -'),
+        '0' => ts('All Groups'),
+      ) + CRM_Core_PseudoConstant::group();
     $customGroup = array(
-    '-1' => ts('- select -'),
-      '0' => ts('All Custom Groups'),
-    ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_CustomField', 'custom_group_id');
+        '-1' => ts('- select -'),
+        '0' => ts('All Custom Groups'),
+      ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_CustomField', 'custom_group_id');
     $ufGroup = array(
-    '-1' => ts('- select -'),
-      '0' => ts('All Profiles'),
-    ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id');
+        '-1' => ts('- select -'),
+        '0' => ts('All Profiles'),
+      ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id');
 
     $event = array(
-    '-1' => ts('- select -'),
-      '0' => ts('All Events'),
-    ) + CRM_Event_PseudoConstant::event();
+        '-1' => ts('- select -'),
+        '0' => ts('All Events'),
+      ) + CRM_Event_PseudoConstant::event();
 
     while ($dao->fetch()) {
       $acl[$dao->id] = array();
index 2fc65be571666596e4eae463322fe76ec5c81d07..ad580950f034030d56df0a8079ed6219aeb24280 100644 (file)
@@ -109,10 +109,12 @@ class CRM_ACL_Page_ACLBasic extends CRM_Core_Page_Basic {
     );
 
     // set breadcrumb to append to admin/access
-    $breadCrumb = array(array(
-    'title' => ts('Access Control'),
+    $breadCrumb = array(
+      array(
+        'title' => ts('Access Control'),
         'url' => CRM_Utils_System::url('civicrm/admin/access', 'reset=1'),
-      ));
+      )
+    );
     CRM_Utils_System::appendBreadCrumb($breadCrumb);
 
     // what action to take ?
index 0ce29ba23051364e382e0f22933e4de9be83a751..aaaa9d4f721ad3a40dddfadbc31e7c77a173a6f7 100644 (file)
@@ -121,12 +121,14 @@ class CRM_ACL_Page_EntityRole extends CRM_Core_Page_Basic {
     );
 
     // set breadcrumb to append to admin/access
-    $breadCrumb = array(array(
-    'title' => ts('Access Control'),
+    $breadCrumb = array(
+      array(
+        'title' => ts('Access Control'),
         'url' => CRM_Utils_System::url('civicrm/admin/access',
           'reset=1'
         ),
-      ));
+      )
+    );
     CRM_Utils_System::appendBreadCrumb($breadCrumb);
     CRM_Utils_System::setTitle(ts('Assign Users to Roles'));
 
index 6f186b9427776cb91c907aaa22bb86b972fdd957..329f14f8ed2959c05a24223cac9f6872ad2aa260 100644 (file)
@@ -76,7 +76,7 @@ class CRM_Activity_BAO_ActivityContact extends CRM_Activity_DAO_ActivityContact
    */
   public static function getNames($activityID, $recordTypeID, $alsoIDs = FALSE) {
     $names = array();
-    $ids   = array();
+    $ids = array();
 
     if (empty($activityID)) {
       return $alsoIDs ? array($names, $ids) : $names;
@@ -115,7 +115,8 @@ AND        contact_a.is_deleted = 0
   public static function retrieveContactIdsByActivityId($activityID, $recordTypeID) {
     $activityContact = array();
     if (!CRM_Utils_Rule::positiveInteger($activityID) ||
-        !CRM_Utils_Rule::positiveInteger($recordTypeID)) {
+      !CRM_Utils_Rule::positiveInteger($recordTypeID)
+    ) {
       return $activityContact;
     }
 
index d81317c0276f1b8702203f59237da70b465b8088..582a3220139f48b803e3830e2bf154c1c0433b46 100644 (file)
@@ -97,7 +97,7 @@ class CRM_Activity_BAO_ICalendar {
             'fileName' => $icsFileName,
             'cleanName' => $icsFileName,
             'fullPath' => $this->icsfile,
-           );
+          );
           return 'activity_ics';
         }
       }
index 2685b8baf6ffbcb99c3e3f47d730114e415c78d7..243200697c958cf189d381d3cd26785e25da9f46 100644 (file)
@@ -202,7 +202,10 @@ class CRM_Activity_BAO_Query {
         $types = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE);
         //get the component activity types.
         $compActTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE, TRUE);
-        $activityTypeIds = self::buildWhereAndQill($query, $value, $types, $op, $grouping, array('Activity Type', 'civicrm_activity.activity_type_id'));
+        $activityTypeIds = self::buildWhereAndQill($query, $value, $types, $op, $grouping, array(
+            'Activity Type',
+            'civicrm_activity.activity_type_id'
+          ));
 
         foreach ($activityTypeIds as $activityTypeId) {
           if (array_key_exists($activityTypeId, $compActTypes)) {
@@ -258,7 +261,10 @@ class CRM_Activity_BAO_Query {
       case 'activity_status':
         $status = CRM_Core_PseudoConstant::activityStatus();
 
-        $activityTypeIds = self::buildWhereAndQill($query, $value, $status, $op, $grouping, array('Activity Status', 'civicrm_activity.status_id'));
+        $activityTypeIds = self::buildWhereAndQill($query, $value, $status, $op, $grouping, array(
+            'Activity Status',
+            'civicrm_activity.status_id'
+          ));
         break;
 
       case 'activity_subject':
@@ -285,7 +291,7 @@ class CRM_Activity_BAO_Query {
       case 'activity_test':
         // We dont want to include all tests for sql OR CRM-7827
         if (!$value || $query->getOperator() != 'OR') {
-            $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause("civicrm_activity.is_test", $op, $value, "Boolean");
+          $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause("civicrm_activity.is_test", $op, $value, "Boolean");
           if ($value) {
             $query->_qill[$grouping][] = ts('Activity is a Test');
           }
@@ -360,7 +366,7 @@ class CRM_Activity_BAO_Query {
       case 'activity_result':
         if (is_array($value)) {
           $safe = NULL;
-          while (list(,$k) = each($value)) {
+          while (list(, $k) = each($value)) {
             $safe[] = "'" . CRM_Utils_Type::escape($k, 'String') . "'";
           }
           $query->_where[$grouping][] = "civicrm_activity.result IN (" . implode(',', $safe) . ")";
@@ -386,7 +392,7 @@ class CRM_Activity_BAO_Query {
         }
         elseif ($value == 2) {
           $query->_where[$grouping][] = "civicrm_activity.parent_id IS NULL";
-         $query->_qill[$grouping][] = ts('Activities which are not Followup Activities');
+          $query->_qill[$grouping][] = ts('Activities which are not Followup Activities');
         }
         break;
     }
@@ -545,14 +551,14 @@ class CRM_Activity_BAO_Query {
       $form->addSelect('activity_engagement_level', array('entity' => 'activity', 'context' => 'search'));
 
       // Add survey result field.
-      $optionGroups  = CRM_Campaign_BAO_Survey::getResultSets('name');
+      $optionGroups = CRM_Campaign_BAO_Survey::getResultSets('name');
       $resultOptions = array();
       foreach ($optionGroups as $gid => $name) {
         if ($name) {
           $value = array();
           $value = CRM_Core_OptionGroup::values($name);
           if (!empty($value)) {
-            while (list($k,$v) = each($value)) {
+            while (list($k, $v) = each($value)) {
               $resultOptions[$v] = $v;
             }
           }
index 66039852feabecc0494daabb22aedab1bdaca692..bbecf8f4dc5c6927f317aebae5a7879fed513ab0 100644 (file)
@@ -175,12 +175,20 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
       'assignee_contact_id' => array(
         'type' => 'entityRef',
         'label' => ts('Assigned to'),
-        'attributes' => array('multiple' => TRUE, 'create' => TRUE, 'api' => array('params' => array('is_deceased' => 0))),
+        'attributes' => array(
+          'multiple' => TRUE,
+          'create' => TRUE,
+          'api' => array('params' => array('is_deceased' => 0))
+        ),
       ),
       'followup_assignee_contact_id' => array(
         'type' => 'entityRef',
         'label' => ts('Assigned to'),
-        'attributes' => array('multiple' => TRUE, 'create' => TRUE, 'api' => array('params' => array('is_deceased' => 0))),
+        'attributes' => array(
+          'multiple' => TRUE,
+          'create' => TRUE,
+          'api' => array('params' => array('is_deceased' => 0))
+        ),
       ),
       'followup_activity_type_id' => array(
         'type' => 'select',
@@ -432,10 +440,11 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
         $urlString = 'civicrm/contact/search/advanced';
       }
       elseif ($path == 'civicrm/group/search'
-    || $path == 'civicrm/contact/search'
+        || $path == 'civicrm/contact/search'
         || $path == 'civicrm/contact/search/advanced'
         || $path == 'civicrm/contact/search/custom'
-        || $path == 'civicrm/group/search') {
+        || $path == 'civicrm/group/search'
+      ) {
         $urlString = $path;
       }
       else {
@@ -629,7 +638,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
     //enable form element (ActivityLinks sets this true)
     $this->assign('suppressForm', FALSE);
 
-    $element = & $this->add('select', 'activity_type_id', ts('Activity Type'),
+    $element = &$this->add('select', 'activity_type_id', ts('Activity Type'),
       $this->_fields['followup_activity_type_id']['attributes'],
       FALSE, array(
         'onchange' => "CRM.buildCustomData( 'Activity', this.value );",
@@ -980,8 +989,8 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
     unset($params['id']);
     $linkedEntities = array(
       array(
-        'table'         => 'civicrm_activity_contact',
-        'findCriteria'  => array(
+        'table' => 'civicrm_activity_contact',
+        'findCriteria' => array(
           'activity_id' => $this->_activityId,
         ),
         'linkedColumns' => array('activity_id'),
@@ -1062,7 +1071,8 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
     $mailStatus = '';
 
     if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
-        'activity_assignee_notification')) {
+      'activity_assignee_notification')
+    ) {
       $activityIDs = array($activity->id);
       if ($followupActivity) {
         $activityIDs = array_merge($activityIDs, array($followupActivity->id));
index 4c354edca908fae1821b40e703d4aaa5aec3b473..cee07678301018e018c67f5e675c38c897ce885a 100644 (file)
@@ -47,8 +47,8 @@ class CRM_Activity_Form_ActivityView extends CRM_Core_Form {
   public function preProcess() {
     //get the activity values
     $activityId = CRM_Utils_Request::retrieve('id', 'Positive', $this);
-    $context    = CRM_Utils_Request::retrieve('context', 'String', $this);
-    $cid        = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
+    $context = CRM_Utils_Request::retrieve('context', 'String', $this);
+    $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
 
     //check for required permissions, CRM-6264
     if ($activityId &&
@@ -59,7 +59,11 @@ class CRM_Activity_Form_ActivityView extends CRM_Core_Form {
 
     $session = CRM_Core_Session::singleton();
     if (!in_array($context, array(
-      'home', 'dashlet', 'dashletFullscreen'))) {
+      'home',
+      'dashlet',
+      'dashletFullscreen'
+    ))
+    ) {
       $url = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=activity");
     }
     else {
index 009e575210617859a6b81521a334e3422a75ed7f..f1b566bd3876419bf136dacff6c656cab2b9959b 100644 (file)
@@ -93,9 +93,9 @@ class CRM_Activity_Form_Search extends CRM_Core_Form_Search {
 
     // we allow the controller to set force/reset externally, useful when we are being
     // driven by the wizard framework
-    $this->_reset   = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
-    $this->_force   = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE);
-    $this->_limit   = CRM_Utils_Request::retrieve('limit', 'Positive', $this);
+    $this->_reset = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
+    $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE);
+    $this->_limit = CRM_Utils_Request::retrieve('limit', 'Positive', $this);
     $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'search');
 
     $this->assign("context", $this->_context);
index f748a9bf40ac0578c076184f152192d00049d003..e53688dd492a38b211a02a034441184a0e11379b 100644 (file)
@@ -143,8 +143,8 @@ class CRM_Activity_Form_Task extends CRM_Core_Form {
     }
     else {
       $session->replaceUserContext(CRM_Utils_System::url("civicrm/contact/search/$searchFormName",
-          $urlParams
-        ));
+        $urlParams
+      ));
     }
   }
 
index d75d6262af3f75352849bc0655055a23ad561ab1..b7d825aac1ccc35ec679c26ee2d24bcffa6ccbb6 100644 (file)
@@ -147,7 +147,10 @@ class CRM_Activity_Form_Task_AddToTag extends CRM_Activity_Form_Task {
 
       $status = array(ts('%count activities tagged', array('count' => $added, 'plural' => '%count activities tagged')));
       if ($notAdded) {
-        $status[] = ts('%count activities already had this tag', array('count' => $notAdded, 'plural' => '%count activities already had this tag'));
+        $status[] = ts('%count activities already had this tag', array(
+            'count' => $notAdded,
+            'plural' => '%count activities already had this tag'
+          ));
       }
       $status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
       CRM_Core_Session::setStatus($status, ts("Added Tag <em>%1</em>", array(1 => $this->_tags[$key])), 'success', array('expires' => 0));
index e81bdf14affaeffa88b62f6a5d843852257cb7bc..a3f5663e3bc849d83f1238fedcf151a2985949a8 100644 (file)
@@ -96,8 +96,8 @@ class CRM_Activity_Form_Task_FileOnCase extends CRM_Activity_Form_Task {
    */
 
   public function postProcess() {
-    $formparams      = $this->exportValues();
-    $caseId          = $formparams['unclosed_case_id'];
+    $formparams = $this->exportValues();
+    $caseId = $formparams['unclosed_case_id'];
     $filedActivities = 0;
     foreach ($this->_activityHolderIds as $key => $id) {
       $targetContactValues = $defaults = array();
@@ -130,8 +130,9 @@ class CRM_Activity_Form_Task_FileOnCase extends CRM_Activity_Form_Task {
       }
       else {
         CRM_Core_Session::setStatus(ts('Not permitted to file activity %1 %2.', array(
-          1 => empty($defaults['subject']) ? '' : $defaults['subject'],
-          2 => $defaults['activity_date_time'])),
+            1 => empty($defaults['subject']) ? '' : $defaults['subject'],
+            2 => $defaults['activity_date_time']
+          )),
           ts("Error"), "error");
       }
     }
index b88216f1fdcbc26da611a320f8369906319d804e..08821a46583d54b6a862b8c6e95a0f6d82d35d07 100644 (file)
@@ -79,7 +79,10 @@ class CRM_Activity_Form_Task_PickOption extends CRM_Activity_Form_Task {
     $validate = FALSE;
     //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");
+      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");
       $validate = TRUE;
     }
     // then redirect
index 36e160453cb8928f2b26c066fbd7e075c8ab8bbc..6590fb817f82551a1731fc8154aace9abcd34cc0 100755 (executable)
@@ -74,7 +74,10 @@ class CRM_Activity_Form_Task_PickProfile extends CRM_Activity_Form_Task {
     $validate = FALSE;
     //validations
     if (count($this->_activityHolderIds) > $this->_maxActivities) {
-      CRM_Core_Session::setStatus(ts("The maximum number of Activities you can select for Batch Update 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');
+      CRM_Core_Session::setStatus(ts("The maximum number of Activities you can select for Batch Update 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');
       $validate = TRUE;
     }
 
@@ -126,7 +129,8 @@ class CRM_Activity_Form_Task_PickProfile extends CRM_Activity_Form_Task {
 
     $ufGroupElement = $this->add('select', 'uf_group_id', ts('Select Profile'),
       array(
-        '' => ts('- select profile -')) + $profiles, TRUE
+        '' => ts('- select profile -')
+      ) + $profiles, TRUE
     );
     $this->addDefaultButtons(ts('Continue'));
   }
index 031a13ea5250eb112f2c7537ff0bbffafd3d5269..c97fb65285881532dc98416ca91f63a5e67a9c1f 100644 (file)
@@ -134,9 +134,17 @@ class CRM_Activity_Form_Task_RemoveFromTag extends CRM_Activity_Form_Task {
 
       list($total, $removed, $notRemoved) = CRM_Core_BAO_EntityTag::removeEntitiesFromTag($this->_activityHolderIds, $key, 'civicrm_activity');
 
-      $status = array(ts('%count activities un-tagged', array('count' => $removed, 'plural' => '%count activities un-tagged')));
+      $status = array(
+        ts('%count activities un-tagged', array(
+            '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'));
+        $status[] = ts('1 activity already did not have this tag', array(
+            '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));
index a1987ad0c9fcada8d7a4e1c159b78c1c9c79fc2f..bd20b21593022a7ee8d36c0c04f3b507f744917a 100644 (file)
@@ -65,7 +65,10 @@ class CRM_Activity_Import_Form_DataSource extends CRM_Core_Form {
     $this->assign('uploadSize', $uploadSize);
     $this->setMaxFileSize($uploadFileSize);
     $this->add('File', 'uploadFile', ts('Import Data File'), 'size=30 maxlength=255', TRUE);
-    $this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(1 => $uploadSize, 2 => $uploadFileSize)), 'maxfilesize', $uploadFileSize);
+    $this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(
+          1 => $uploadSize,
+          2 => $uploadFileSize
+        )), 'maxfilesize', $uploadFileSize);
     $this->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile');
     $this->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File');
 
@@ -88,9 +91,9 @@ class CRM_Activity_Import_Form_DataSource extends CRM_Core_Form {
 
     //get the saved mapping details
     $mappingArray = CRM_Core_BAO_Mapping::getMappings(CRM_Core_OptionGroup::getValue('mapping_type',
-        'Import Activity',
-        'name'
-      ));
+      'Import Activity',
+      'name'
+    ));
     $this->assign('savedMapping', $mappingArray);
     $this->add('select', 'savedMapping', ts('Mapping Option'), array('' => ts('- select -')) + $mappingArray);
 
@@ -101,7 +104,7 @@ class CRM_Activity_Import_Form_DataSource extends CRM_Core_Form {
 
     $this->setDefaults(array(
       'onDuplicate' => CRM_Import_Parser::DUPLICATE_SKIP,
-      ));
+    ));
 
     //build date formats
     CRM_Core_Form_Date::buildAllowedDateFormats($this);
@@ -129,11 +132,11 @@ class CRM_Activity_Import_Form_DataSource extends CRM_Core_Form {
   public function postProcess() {
     $this->controller->resetPage('MapField');
 
-    $fileName         = $this->controller->exportValue($this->_name, 'uploadFile');
+    $fileName = $this->controller->exportValue($this->_name, 'uploadFile');
     $skipColumnHeader = $this->controller->exportValue($this->_name, 'skipColumnHeader');
-    $onDuplicate      = $this->controller->exportValue($this->_name, 'onDuplicate');
-    $dateFormats      = $this->controller->exportValue($this->_name, 'dateFormats');
-    $savedMapping     = $this->controller->exportValue($this->_name, 'savedMapping');
+    $onDuplicate = $this->controller->exportValue($this->_name, 'onDuplicate');
+    $dateFormats = $this->controller->exportValue($this->_name, 'dateFormats');
+    $savedMapping = $this->controller->exportValue($this->_name, 'savedMapping');
 
     $this->set('onDuplicate', $onDuplicate);
     $this->set('dateFormats', $dateFormats);
index 87baedbc390ca5e74e3720b8717ef425145e17cd..e10d2fff805c330d1e9f359d277a399b26c3ebe9 100644 (file)
@@ -39,8 +39,6 @@
 class CRM_Activity_Import_Form_MapField extends CRM_Import_Form_MapField {
 
 
-
-
   /**
    * Set variables up before form is built
    *
@@ -69,7 +67,13 @@ class CRM_Activity_Import_Form_MapField extends CRM_Import_Form_MapField {
       $this->assign('rowDisplayCount', 2);
     }
     $highlightedFields = array();
-    $requiredFields = array('activity_date_time', 'activity_type_id', 'activity_label', 'target_contact_id', 'activity_subject');
+    $requiredFields = array(
+      'activity_date_time',
+      'activity_type_id',
+      'activity_label',
+      'target_contact_id',
+      'activity_subject'
+    );
     foreach ($requiredFields as $val) {
       $highlightedFields[] = $val;
     }
@@ -96,17 +100,17 @@ class CRM_Activity_Import_Form_MapField extends CRM_Import_Form_MapField {
       list($mappingName, $mappingContactType, $mappingLocation, $mappingPhoneType, $mappingRelation) = CRM_Core_BAO_Mapping::getMappingFields($savedMapping);
 
       //get loaded Mapping Fields
-      $mappingName        = CRM_Utils_Array::value('1', $mappingName);
+      $mappingName = CRM_Utils_Array::value('1', $mappingName);
       $mappingContactType = CRM_Utils_Array::value('1', $mappingContactType);
-      $mappingLocation    = CRM_Utils_Array::value('1', $mappingLocation);
-      $mappingPhoneType   = CRM_Utils_Array::value('1', $mappingPhoneType);
-      $mappingRelation    = CRM_Utils_Array::value('1', $mappingRelation);
+      $mappingLocation = CRM_Utils_Array::value('1', $mappingLocation);
+      $mappingPhoneType = CRM_Utils_Array::value('1', $mappingPhoneType);
+      $mappingRelation = CRM_Utils_Array::value('1', $mappingRelation);
 
       $this->assign('loadedMapping', $savedMapping);
       $this->set('loadedMapping', $savedMapping);
 
-      $params         = array('id' => $savedMapping);
-      $temp           = array();
+      $params = array('id' => $savedMapping);
+      $temp = array();
       $mappingDetails = CRM_Core_BAO_Mapping::retrieve($params, $temp);
 
       $this->assign('savedName', $mappingDetails->name);
@@ -128,9 +132,9 @@ class CRM_Activity_Import_Form_MapField extends CRM_Import_Form_MapField {
     $defaults = array();
     $mapperKeys = array_keys($this->_mapperFields);
 
-    $hasHeaders       = !empty($this->_columnHeaders);
-    $headerPatterns   = $this->get('headerPatterns');
-    $dataPatterns     = $this->get('dataPatterns');
+    $hasHeaders = !empty($this->_columnHeaders);
+    $headerPatterns = $this->get('headerPatterns');
+    $dataPatterns = $this->get('dataPatterns');
     $hasLocationTypes = $this->get('fieldTypes');
 
     /* Initialize all field usages to false */
@@ -191,7 +195,8 @@ class CRM_Activity_Import_Form_MapField extends CRM_Import_Form_MapField {
             $defaults["mapper[$i]"] = array(
               $this->defaultFromHeader($this->_columnHeaders[$i],
                 $headerPatterns
-              ));
+              )
+            );
           }
           else {
             $defaults["mapper[$i]"] = array($this->defaultFromData($dataPatterns, $i));
@@ -292,7 +297,7 @@ class CRM_Activity_Import_Form_MapField extends CRM_Import_Form_MapField {
       );
 
       $params = array(
-        'used'         => 'Unsupervised',
+        'used' => 'Unsupervised',
         'contact_type' => 'Individual',
       );
       list($ruleFields, $threshold) = CRM_Dedupe_BAO_RuleGroup::dedupeRuleFieldsWeight($params);
@@ -324,10 +329,10 @@ class CRM_Activity_Import_Form_MapField extends CRM_Import_Form_MapField {
             }
             else {
               $errors['_qf_default'] .= ts('Missing required field: Provide %1 or %2',
-                array(
-                  1 => $title,
-                  2 => 'Activity Type Label',
-                )) . '<br />';
+                  array(
+                    1 => $title,
+                    2 => 'Activity Type Label',
+                  )) . '<br />';
             }
           }
           else {
@@ -386,11 +391,11 @@ class CRM_Activity_Import_Form_MapField extends CRM_Import_Form_MapField {
     $config = CRM_Core_Config::singleton();
     $seperator = $config->fieldSeparator;
 
-    $mapperKeys      = array();
-    $mapper          = array();
-    $mapperKeys      = $this->controller->exportValue($this->_name, 'mapper');
-    $mapperKeysMain  = array();
-    $mapperLocType   = array();
+    $mapperKeys = array();
+    $mapper = array();
+    $mapperKeys = $this->controller->exportValue($this->_name, 'mapper');
+    $mapperKeysMain = array();
+    $mapperLocType = array();
     $mapperPhoneType = array();
 
     for ($i = 0; $i < $this->_columnCount; $i++) {
index 4263c463e177ed4dda473919014db260a6928a75..55146a1d00562a3a034e9eb9f6220a29a45d9d0b 100644 (file)
@@ -48,11 +48,11 @@ class CRM_Activity_Import_Form_Preview extends CRM_Import_Form_Preview {
     $skipColumnHeader = $this->controller->exportValue('DataSource', 'skipColumnHeader');
 
     //get the data from the session
-    $dataValues       = $this->get('dataValues');
-    $mapper           = $this->get('mapper');
-    $invalidRowCount  = $this->get('invalidRowCount');
+    $dataValues = $this->get('dataValues');
+    $mapper = $this->get('mapper');
+    $invalidRowCount = $this->get('invalidRowCount');
     $conflictRowCount = $this->get('conflictRowCount');
-    $mismatchCount    = $this->get('unMatchCount');
+    $mismatchCount = $this->get('unMatchCount');
 
     //get the mapping name displayed if the mappingId is set
     $mappingId = $this->get('loadMappingId');
@@ -89,9 +89,12 @@ class CRM_Activity_Import_Form_Preview extends CRM_Import_Form_Preview {
 
     $properties = array(
       'mapper',
-      'dataValues', 'columnCount',
-      'totalRowCount', 'validRowCount',
-      'invalidRowCount', 'conflictRowCount',
+      'dataValues',
+      'columnCount',
+      'totalRowCount',
+      'validRowCount',
+      'invalidRowCount',
+      'conflictRowCount',
       'downloadErrorRecordsUrl',
       'downloadConflictRecordsUrl',
       'downloadMismatchRecordsUrl',
@@ -109,11 +112,11 @@ class CRM_Activity_Import_Form_Preview extends CRM_Import_Form_Preview {
    * @return void
    */
   public function postProcess() {
-    $fileName         = $this->controller->exportValue('DataSource', 'uploadFile');
+    $fileName = $this->controller->exportValue('DataSource', 'uploadFile');
     $skipColumnHeader = $this->controller->exportValue('DataSource', 'skipColumnHeader');
-    $invalidRowCount  = $this->get('invalidRowCount');
+    $invalidRowCount = $this->get('invalidRowCount');
     $conflictRowCount = $this->get('conflictRowCount');
-    $onDuplicate      = $this->get('onDuplicate');
+    $onDuplicate = $this->get('onDuplicate');
 
     $config = CRM_Core_Config::singleton();
     $seperator = $config->fieldSeparator;
index 42c1a33c93863005ab0b871db575d074fa52e730..6a33eb5cff67623768ea10f1af0d265417834d91 100644 (file)
@@ -94,7 +94,19 @@ class CRM_Activity_Import_Form_Summary extends CRM_Import_Form_Summary {
     }
     $this->assign('dupeActionString', $dupeActionString);
 
-    $properties = array('totalRowCount', 'validRowCount', 'invalidRowCount', 'conflictRowCount', 'downloadConflictRecordsUrl', 'downloadErrorRecordsUrl', 'duplicateRowCount', 'downloadDuplicateRecordsUrl', 'downloadMismatchRecordsUrl', 'groupAdditions', 'unMatchCount');
+    $properties = array(
+      'totalRowCount',
+      'validRowCount',
+      'invalidRowCount',
+      'conflictRowCount',
+      'downloadConflictRecordsUrl',
+      'downloadErrorRecordsUrl',
+      'duplicateRowCount',
+      'downloadDuplicateRecordsUrl',
+      'downloadMismatchRecordsUrl',
+      'groupAdditions',
+      'unMatchCount'
+    );
     foreach ($properties as $property) {
       $this->assign($property, $this->get($property));
     }
index 259cfa25ae580a4ed22ade2dd5425a7e62d55a55..47a1aaae267799f219dccf4b3b5032a1dabd6642 100644 (file)
@@ -32,8 +32,6 @@
  * $Id$
  *
  */
-
-
 abstract class CRM_Activity_Import_Parser extends CRM_Import_Parser {
 
   protected $_fileName;
@@ -241,7 +239,8 @@ abstract class CRM_Activity_Import_Parser extends CRM_Import_Parser {
       }
       if ($this->_invalidRowCount) {
         // removed view url for invlaid contacts
-        $headers = array_merge(array(ts('Line Number'),
+        $headers = array_merge(array(
+            ts('Line Number'),
             ts('Reason'),
           ),
           $customHeaders
@@ -250,7 +249,8 @@ abstract class CRM_Activity_Import_Parser extends CRM_Import_Parser {
         self::exportCSV($this->_errorFileName, $headers, $this->_errors);
       }
       if ($this->_conflictCount) {
-        $headers = array_merge(array(ts('Line Number'),
+        $headers = array_merge(array(
+            ts('Line Number'),
             ts('Reason'),
           ),
           $customHeaders
@@ -259,7 +259,8 @@ abstract class CRM_Activity_Import_Parser extends CRM_Import_Parser {
         self::exportCSV($this->_conflictFileName, $headers, $this->_conflicts);
       }
       if ($this->_duplicateCount) {
-        $headers = array_merge(array(ts('Line Number'),
+        $headers = array_merge(array(
+            ts('Line Number'),
             ts('View Activity History URL'),
           ),
           $customHeaders
index 31e25b906c201a7a4059a68a3b6ab1381745c32d..da723f0ec1262beb5e7d93677be456bc52537cba 100644 (file)
@@ -162,9 +162,9 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser {
    */
   public function summary(&$values) {
     $erroneousField = NULL;
-    $response       = $this->setActiveFieldValues($values, $erroneousField);
-    $index          = -1;
-    $errorRequired  = FALSE;
+    $response = $this->setActiveFieldValues($values, $erroneousField);
+    $index = -1;
+    $errorRequired = FALSE;
 
     if ($this->_activityTypeIndex > -1 && $this->_activityLabelIndex > -1) {
       array_unshift($values, ts('Please select either Activity Type ID OR Activity Type Label.'));
@@ -332,7 +332,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser {
         // Using new Dedupe rule.
         $ruleParams = array(
           'contact_type' => 'Individual',
-          'used'         => 'Unsupervised',
+          'used' => 'Unsupervised',
         );
         $fieldsArray = CRM_Dedupe_BAO_Rule::dedupeRuleFields($ruleParams);
 
index 5d35324ae3588b78c2972fd270a57f469696394c..7bb5f47e3dc539d2af395b709efe26911d0053c5 100644 (file)
  */
 class CRM_Activity_Page_AJAX {
   public static function getCaseActivity() {
-    $caseID    = CRM_Utils_Type::escape($_GET['caseID'], 'Integer');
+    $caseID = CRM_Utils_Type::escape($_GET['caseID'], 'Integer');
     $contactID = CRM_Utils_Type::escape($_GET['cid'], 'Integer');
-    $userID    = CRM_Utils_Type::escape($_GET['userID'], 'Integer');
-    $context   = CRM_Utils_Type::escape(CRM_Utils_Array::value('context', $_GET), 'String');
+    $userID = CRM_Utils_Type::escape($_GET['userID'], 'Integer');
+    $context = CRM_Utils_Type::escape(CRM_Utils_Array::value('context', $_GET), 'String');
 
     $sortMapper = array(
       0 => 'display_date',
-    1 => 'ca.subject',
-    2 => 'ca.activity_type_id',
+      1 => 'ca.subject',
+      2 => 'ca.activity_type_id',
       3 => 'acc.sort_name',
-    4 => 'cc.sort_name',
-    5 => 'ca.status_id',
+      4 => 'cc.sort_name',
+      5 => 'ca.status_id',
     );
 
-    $sEcho     = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
-    $offset    = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
-    $rowCount  = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
-    $sort      = isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : NULL;
+    $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
+    $offset = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
+    $rowCount = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
+    $sort = isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : NULL;
     $sortOrder = isset($_REQUEST['sSortDir_0']) ? CRM_Utils_Type::escape($_REQUEST['sSortDir_0'], 'String') : 'asc';
 
     $params = $_POST;
@@ -69,7 +69,16 @@ class CRM_Activity_Page_AJAX {
     $activities = CRM_Case_BAO_Case::getCaseActivity($caseID, $params, $contactID, $context, $userID);
 
     $iFilteredTotal = $iTotal = $params['total'];
-    $selectorElements = array('display_date', 'subject', 'type', 'with_contacts', 'reporter', 'status', 'links', 'class');
+    $selectorElements = array(
+      'display_date',
+      'subject',
+      'type',
+      'with_contacts',
+      'reporter',
+      'status',
+      'links',
+      'class'
+    );
 
     echo CRM_Utils_JSON::encodeDataTableSelector($activities, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
     CRM_Utils_System::civiExit();
@@ -78,14 +87,14 @@ class CRM_Activity_Page_AJAX {
   public static function getCaseGlobalRelationships() {
     $sortMapper = array(
       0 => 'sort_name',
-    1 => 'phone',
-    2 => 'email',
+      1 => 'phone',
+      2 => 'email',
     );
 
-    $sEcho     = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
-    $offset    = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
-    $rowCount  = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
-    $sort      = isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : NULL;
+    $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
+    $offset = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
+    $rowCount = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
+    $sort = isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : NULL;
     $sortOrder = isset($_REQUEST['sSortDir_0']) ? CRM_Utils_Type::escape($_REQUEST['sSortDir_0'], 'String') : 'asc';
 
     $params = $_POST;
@@ -111,20 +120,20 @@ class CRM_Activity_Page_AJAX {
   }
 
   public static function getCaseClientRelationships() {
-    $caseID    = CRM_Utils_Type::escape($_GET['caseID'], 'Integer');
+    $caseID = CRM_Utils_Type::escape($_GET['caseID'], 'Integer');
     $contactID = CRM_Utils_Type::escape($_GET['cid'], 'Integer');
 
     $sortMapper = array(
       0 => 'relation',
-    1 => 'name',
-    2 => 'phone',
-    3 => 'email',
+      1 => 'name',
+      2 => 'phone',
+      3 => 'email',
     );
 
-    $sEcho     = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
-    $offset    = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
-    $rowCount  = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
-    $sort      = isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : 'relation';
+    $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
+    $offset = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
+    $rowCount = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
+    $sort = isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : 'relation';
     $sortOrder = isset($_REQUEST['sSortDir_0']) ? CRM_Utils_Type::escape($_REQUEST['sSortDir_0'], 'String') : 'asc';
 
     $params = $_POST;
@@ -151,7 +160,7 @@ class CRM_Activity_Page_AJAX {
 
     // sort clientRelationships array using jquery call params
     foreach ($clientRelationships as $key => $row) {
-      $sortArray[$key]  = $row[$sort];
+      $sortArray[$key] = $row[$sort];
     }
     $sort_type = "SORT_" . strtoupper($sortOrder);
     array_multisort($sortArray, constant($sort_type), $clientRelationships);
@@ -163,7 +172,7 @@ class CRM_Activity_Page_AJAX {
     // after sort we can update username fields to be a url
     foreach ($clientRelationships as $key => $value) {
       $clientRelationships[$key]['name'] = '<a href=' . CRM_Utils_System::url('civicrm/contact/view',
-       'action=view&reset=1&cid=' . $clientRelationships[$key]['cid']) . '>' . $clientRelationships[$key]['name'] . '</a>';
+          'action=view&reset=1&cid=' . $clientRelationships[$key]['cid']) . '>' . $clientRelationships[$key]['name'] . '</a>';
     }
 
     $iFilteredTotal = $iTotal = $params['total'] = count($allClientRelationships);
@@ -175,21 +184,21 @@ class CRM_Activity_Page_AJAX {
 
 
   public static function getCaseRoles() {
-    $caseID    = CRM_Utils_Type::escape($_GET['caseID'], 'Integer');
+    $caseID = CRM_Utils_Type::escape($_GET['caseID'], 'Integer');
     $contactID = CRM_Utils_Type::escape($_GET['cid'], 'Integer');
 
     $sortMapper = array(
       0 => 'relation',
-    1 => 'name',
-    2 => 'phone',
-    3 => 'email',
-    4 => 'actions',
+      1 => 'name',
+      2 => 'phone',
+      3 => 'email',
+      4 => 'actions',
     );
 
-    $sEcho     = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
-    $offset    = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
-    $rowCount  = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
-    $sort      = isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : 'relation';
+    $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
+    $offset = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
+    $rowCount = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
+    $sort = isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : 'relation';
     $sortOrder = isset($_REQUEST['sSortDir_0']) ? CRM_Utils_Type::escape($_REQUEST['sSortDir_0'], 'String') : 'asc';
 
     $params = $_POST;
@@ -200,7 +209,7 @@ class CRM_Activity_Page_AJAX {
     $caseRelationships = CRM_Case_BAO_Case::getCaseRoles($contactID, $caseID);
     $caseTypeName = CRM_Case_BAO_Case::getCaseType($caseID, 'name');
     $xmlProcessor = new CRM_Case_XMLProcessor_Process();
-    $caseRoles    = $xmlProcessor->get($caseTypeName, 'CaseRoles');
+    $caseRoles = $xmlProcessor->get($caseTypeName, 'CaseRoles');
 
     $hasAccessToAllCases = CRM_Core_Permission::check('access all cases and activities');
 
@@ -252,7 +261,7 @@ class CRM_Activity_Page_AJAX {
 
     // sort clientRelationships array using jquery call params
     foreach ($caseRelationships as $key => $row) {
-      $sortArray[$key]  = $row[$sort];
+      $sortArray[$key] = $row[$sort];
     }
 
     $sort_type = "SORT_" . strtoupper($sortOrder);
@@ -271,7 +280,7 @@ class CRM_Activity_Page_AJAX {
       // view user links
       if (!empty($row['cid'])) {
         $row['name'] = '<a class="view-contact" title="' . ts('View Contact') . '" href=' . CRM_Utils_System::url('civicrm/contact/view',
-          'action=view&reset=1&cid=' . $row['cid']) . '>' . $row['name'] . '</a>';
+            'action=view&reset=1&cid=' . $row['cid']) . '>' . $row['name'] . '</a>';
       }
       // email column links/icon
       if ($row['email']) {
@@ -285,19 +294,19 @@ class CRM_Activity_Page_AJAX {
         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'] . '" data-rel_id="' . $row['rel_id'] . '"data-key="' . CRM_Core_Key::get('civicrm/ajax/relation') . '">' .
+              '<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'] . '" data-rel_id="' . $row['rel_id'] . '"data-key="' . CRM_Core_Key::get('civicrm/ajax/relation') . '">' .
               '<span class="icon ui-icon-pencil"></span>' .
-            '</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'] . '" data-key="' . CRM_Core_Key::get('civicrm/ajax/delcaserole') . '">' .
+              '</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'] . '" data-key="' . CRM_Core_Key::get('civicrm/ajax/delcaserole') . '">' .
               '<span class="icon delete-icon"></span>' .
-            '</a>';
+              '</a>';
             break;
 
           case 'caseRoles':
             $row['actions'] =
-            '<a href="#editCaseRoleDialog" title="' . ts('Assign %1', array(1 => $typeLabel)) . '" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="' . $row['relation_type'] . '" data-key="' . CRM_Core_Key::get('civicrm/ajax/relation') . '">' .
+              '<a href="#editCaseRoleDialog" title="' . ts('Assign %1', array(1 => $typeLabel)) . '" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="' . $row['relation_type'] . '" data-key="' . CRM_Core_Key::get('civicrm/ajax/relation') . '">' .
               '<span class="icon ui-icon-pencil"></span>' .
-            '</a>';
+              '</a>';
             break;
         }
       }
@@ -365,7 +374,9 @@ class CRM_Activity_Page_AJAX {
      */
 
     if (in_array($params['mode'], array(
-      'move', 'file'))) {
+      'move',
+      'file'
+    ))) {
       $caseActivity = new CRM_Case_DAO_CaseActivity();
       $caseActivity->case_id = $params['caseID'];
       $caseActivity->activity_id = $otherActivity->id;
@@ -521,9 +532,15 @@ class CRM_Activity_Page_AJAX {
 
     $iFilteredTotal = $iTotal = $params['total'];
     $selectorElements = array(
-      'activity_type', 'subject', 'source_contact',
-      'target_contact', 'assignee_contact',
-      'activity_date', 'status', 'links', 'class',
+      'activity_type',
+      'subject',
+      'source_contact',
+      'target_contact',
+      'assignee_contact',
+      'activity_date',
+      'status',
+      'links',
+      'class',
     );
 
     echo CRM_Utils_JSON::encodeDataTableSelector($activities, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
index 01e25eb1df9f0739b12406afa4a93f7aba7962db..6686de71d0d7149592073d8ef3c48cc6ddf7350a 100644 (file)
@@ -162,9 +162,9 @@ class CRM_Activity_Page_Tab extends CRM_Core_Page {
    * @return void
    */
   public function run() {
-    $context   = CRM_Utils_Request::retrieve('context', 'String', $this);
+    $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
-    $action    = CRM_Utils_Request::retrieve('action', 'String', $this);
+    $action = CRM_Utils_Request::retrieve('action', 'String', $this);
     $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
 
     //do check for view/edit operation.
@@ -203,7 +203,9 @@ class CRM_Activity_Page_Tab extends CRM_Core_Page {
       );
 
       if (in_array($activityTypeId, array(
-        $emailTypeValue, $letterTypeValue))) {
+        $emailTypeValue,
+        $letterTypeValue
+      ))) {
         return;
       }
     }
index ebcccca1042b16c6ac8ab70720ea32e2397f31f3..37172af2afb6d327b853924d3ad4261abef6fe14 100644 (file)
@@ -126,7 +126,7 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
       $extraParams .= "&compContext={$compContext}";
     }
 
-    $showView   = TRUE;
+    $showView = TRUE;
     $showUpdate = $showDelete = FALSE;
     $qsUpdate = NULL;
 
@@ -175,7 +175,7 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
 
       case 'Email':
       case 'Bulk Email':
-        $url    = 'civicrm/activity/view';
+        $url = 'civicrm/activity/view';
         $delUrl = 'civicrm/activity';
         $qsView = "atype={$activityTypeId}&action=view&reset=1&id=%%id%%&cid=%%cid%%&context=%%cxt%%{$extraParams}";
         if ($activityTypeName == 'Email') {
@@ -193,15 +193,15 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
       case 'Change Case Status':
       case 'Change Case Start Date':
         $showUpdate = $showDelete = FALSE;
-        $url        = 'civicrm/activity';
-        $qsView     = "atype={$activityTypeId}&action=view&reset=1&id=%%id%%&cid=%%cid%%&context=%%cxt%%{$extraParams}";
-        $qsUpdate   = "atype={$activityTypeId}&action=update&reset=1&id=%%id%%&cid=%%cid%%&context=%%cxt%%{$extraParams}";
+        $url = 'civicrm/activity';
+        $qsView = "atype={$activityTypeId}&action=view&reset=1&id=%%id%%&cid=%%cid%%&context=%%cxt%%{$extraParams}";
+        $qsUpdate = "atype={$activityTypeId}&action=update&reset=1&id=%%id%%&cid=%%cid%%&context=%%cxt%%{$extraParams}";
         break;
 
       default:
-        $url      = 'civicrm/activity';
+        $url = 'civicrm/activity';
         $showView = $showDelete = $showUpdate = TRUE;
-        $qsView   = "atype={$activityTypeId}&action=view&reset=1&id=%%id%%&cid=%%cid%%&context=%%cxt%%{$extraParams}";
+        $qsView = "atype={$activityTypeId}&action=view&reset=1&id=%%id%%&cid=%%cid%%&context=%%cxt%%{$extraParams}";
         $qsUpdate = "atype={$activityTypeId}&action=update&reset=1&id=%%id%%&cid=%%cid%%&context=%%cxt%%{$extraParams}";
 
         //when type is not available lets hide view and update.
@@ -216,13 +216,15 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
     $actionLinks = array();
 
     if ($showView) {
-      $actionLinks += array(CRM_Core_Action::
-      VIEW => array(
-      'name' => ts('View'),
-        'url' => $url,
-        'qs' => $qsView,
-        'title' => ts('View Activity'),
-      ));
+      $actionLinks += array(
+        CRM_Core_Action::
+        VIEW => array(
+          'name' => ts('View'),
+          'url' => $url,
+          'qs' => $qsView,
+          'title' => ts('View Activity'),
+        )
+      );
     }
 
     if ($showUpdate) {
@@ -234,13 +236,15 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
         $updateUrl = 'civicrm/activity/pdf/add';
       }
       if (CRM_Activity_BAO_Activity::checkPermission($activityId, CRM_Core_Action::UPDATE)) {
-        $actionLinks += array(CRM_Core_Action::
-        UPDATE => array(
-        'name' => ts('Edit'),
-          'url' => $updateUrl,
-          'qs' => $qsUpdate,
-          'title' => ts('Update Activity'),
-        ));
+        $actionLinks += array(
+          CRM_Core_Action::
+          UPDATE => array(
+            'name' => ts('Edit'),
+            'url' => $updateUrl,
+            'qs' => $qsUpdate,
+            'title' => ts('Update Activity'),
+          )
+        );
       }
     }
 
@@ -248,36 +252,42 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
       $activityTypeName &&
       CRM_Case_BAO_Case::checkPermission($activityId, 'File On Case', $activityTypeId)
     ) {
-      $actionLinks += array(CRM_Core_Action::
-      ADD => array(
-      'name' => ts('File on Case'),
-        'url' => '#',
-        'extra' => 'onclick="javascript:fileOnCase( \'file\', \'%%id%%\', null, this ); return false;"',
-        'title' => ts('File on Case'),
-      ));
+      $actionLinks += array(
+        CRM_Core_Action::
+        ADD => array(
+          'name' => ts('File on Case'),
+          'url' => '#',
+          'extra' => 'onclick="javascript:fileOnCase( \'file\', \'%%id%%\', null, this ); return false;"',
+          'title' => ts('File on Case'),
+        )
+      );
     }
 
     if ($showDelete) {
       if (!isset($delUrl) || !$delUrl) {
         $delUrl = $url;
       }
-      $actionLinks += array(CRM_Core_Action::
-      DELETE => array(
-      'name' => ts('Delete'),
-        'url' => $delUrl,
-        'qs' => $qsDelete,
-        'title' => ts('Delete Activity'),
-      ));
+      $actionLinks += array(
+        CRM_Core_Action::
+        DELETE => array(
+          'name' => ts('Delete'),
+          'url' => $delUrl,
+          'qs' => $qsDelete,
+          'title' => ts('Delete Activity'),
+        )
+      );
     }
 
     if ($accessMailingReport) {
-      $actionLinks += array(CRM_Core_Action::
-      BROWSE => array(
-      'name' => ts('Mailing Report'),
-        'url' => 'civicrm/mailing/report',
-        'qs' => "mid={$sourceRecordId}&reset=1&cid=%%cid%%&context=activitySelector",
-        'title' => ts('View Mailing Report'),
-      ));
+      $actionLinks += array(
+        CRM_Core_Action::
+        BROWSE => array(
+          'name' => ts('Mailing Report'),
+          'url' => 'civicrm/mailing/report',
+          'qs' => "mid={$sourceRecordId}&reset=1&cid=%%cid%%&context=activitySelector",
+          'title' => ts('View Mailing Report'),
+        )
+      );
     }
 
     return $actionLinks;
@@ -290,9 +300,9 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
    * @param array $params
    */
   public function getPagerParams($action, &$params) {
-    $params['status']    = ts('Activities %%StatusMessage%%');
+    $params['status'] = ts('Activities %%StatusMessage%%');
     $params['csvString'] = NULL;
-    $params['rowCount']  = CRM_Utils_Pager::ROWCOUNT;
+    $params['rowCount'] = CRM_Utils_Pager::ROWCOUNT;
 
     $params['buttonTop'] = 'PagerTopButton';
     $params['buttonBottom'] = 'PagerBottomButton';
@@ -505,17 +515,17 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
     if (!isset(self::$_columnHeaders)) {
       self::$_columnHeaders = array(
         array(
-      'name' => ts('Type'),
+          'name' => ts('Type'),
           'sort' => 'activity_type',
           'direction' => CRM_Utils_Sort::DONTCARE,
         ),
         array(
-      'name' => ts('Subject'),
+          'name' => ts('Subject'),
           'sort' => 'subject',
           'direction' => CRM_Utils_Sort::DONTCARE,
         ),
         array(
-      'name' => ts('Added By'),
+          'name' => ts('Added By'),
           'sort' => 'source_contact_name',
           'direction' => CRM_Utils_Sort::DONTCARE,
         ),
index 1cc43cf9a83b60b3e817525ab614fc8567011119..bd06e3bff62c7695b18555d2a226ebf675d38d62 100644 (file)
@@ -169,9 +169,9 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM
     // submitted form values
     $this->_queryParams = &$queryParams;
 
-    $this->_single      = $single;
-    $this->_limit       = $limit;
-    $this->_context     = $context;
+    $this->_single = $single;
+    $this->_limit = $limit;
+    $this->_context = $context;
     $this->_compContext = $compContext;
 
     $this->_activityClause = $activityClause;
@@ -245,8 +245,8 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM
       FALSE,
       $this->_activityClause
     );
-    $rows           = array();
-    $mailingIDs     = CRM_Mailing_BAO_Mailing::mailingACLIDs();
+    $rows = array();
+    $mailingIDs = CRM_Mailing_BAO_Mailing::mailingACLIDs();
     $accessCiviMail = CRM_Core_Permission::check('access CiviMail');
 
     //get all campaigns.
@@ -280,7 +280,7 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM
         $contactId = CRM_Utils_Array::value('source_contact_id', $row);
       }
 
-      $row['target_contact_name']   = CRM_Activity_BAO_ActivityContact::getNames($row['activity_id'], $targetID);
+      $row['target_contact_name'] = CRM_Activity_BAO_ActivityContact::getNames($row['activity_id'], $targetID);
       $row['assignee_contact_name'] = CRM_Activity_BAO_ActivityContact::getNames($row['activity_id'], $assigneeID);
       list($row['source_contact_name'], $row['source_contact_id']) = CRM_Activity_BAO_ActivityContact::getNames($row['activity_id'], $sourceID, TRUE);
       $row['source_contact_name'] = implode(',', array_values($row['source_contact_name']));
@@ -292,7 +292,7 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM
       $row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? $result->contact_sub_type : $result->contact_type, FALSE, $result->contact_id
       );
       $accessMailingReport = FALSE;
-      $activityTypeId      = $row['activity_type_id'];
+      $activityTypeId = $row['activity_type_id'];
       if ($row['activity_is_test']) {
         $row['activity_type'] = $row['activity_type'] . " (test)";
       }
index 3b47f1f476db49cdabcec42c8da1eb0c658d9734..5148e57630d9d4949e7b178a7eeec9501e9af478 100644 (file)
@@ -127,7 +127,8 @@ class CRM_Activity_Task {
       $config = CRM_Core_Config::singleton();
       if (in_array('CiviCase', $config->enableComponents)) {
         if (CRM_Core_Permission::check('access all cases and activities') ||
-          CRM_Core_Permission::check('access my cases and activities')) {
+          CRM_Core_Permission::check('access my cases and activities')
+        ) {
           self::$_tasks[6] = array(
             'title' => ts('File on Case'),
             'class' => 'CRM_Activity_Form_Task_FileOnCase',
index 3f9cbafaec8d65c1bbe372f315abd2616f9e7f13..520e895ee71aadb443d63efe6a60116bca1a0df4 100644 (file)
@@ -63,9 +63,9 @@ class CRM_Admin_Form extends CRM_Core_Form {
    * Basic setup
    */
   public function preProcess() {
-    $this->_id      = $this->get('id');
+    $this->_id = $this->get('id');
     $this->_BAOName = $this->get('BAOName');
-    $this->_values  = array();
+    $this->_values = array();
     if (isset($this->_id)) {
       $params = array('id' => $this->_id);
       // this is needed if the form is outside the CRM name space
index 91824e02ba2c560fac11c523d67f293e818ae0b1..bf6a2f4d39087d56cb1a94a7f68985fe43ba5dbb 100644 (file)
@@ -150,8 +150,8 @@ class CRM_Admin_Form_ContactType extends CRM_Admin_Form {
     }
     $contactType = CRM_Contact_BAO_ContactType::add($params);
     CRM_Core_Session::setStatus(ts("The Contact Type '%1' has been saved.",
-        array(1 => $contactType->label)
-      ), ts('Saved'), 'success');
+      array(1 => $contactType->label)
+    ), ts('Saved'), 'success');
   }
 
 }
index d5a7d7031135e0cf250b3d99dee09371a8c0015b..9f786e31065042364ba6175064c8c4637c19fd65 100644 (file)
@@ -68,7 +68,7 @@ class CRM_Admin_Form_Extensions extends CRM_Admin_Form {
         break;
 
       case CRM_Core_Action::UPDATE:
-        if (! CRM_Extension_System::singleton()->getBrowser()->isEnabled()) {
+        if (!CRM_Extension_System::singleton()->getBrowser()->isEnabled()) {
           CRM_Core_Error::fatal(ts('The system administrator has disabled this feature.'));
         }
         $info = CRM_Extension_System::singleton()->getBrowser()->getExtension($this->_key);
@@ -206,7 +206,7 @@ class CRM_Admin_Form_Extensions extends CRM_Admin_Form {
         'version' => 3,
         'key' => $this->_key,
       ));
-      if (! CRM_Utils_Array::value('is_error', $result, FALSE)) {
+      if (!CRM_Utils_Array::value('is_error', $result, FALSE)) {
         CRM_Core_Session::setStatus("", ts('Extension Upgraded'), "success");
       }
       else {
index be4d4542ca60855af607a4127229abfc94442c5a..114e3efa68dd20ebf76733ff39c063224a5f71eb 100644 (file)
@@ -81,7 +81,10 @@ class CRM_Admin_Form_Job extends CRM_Admin_Form {
       $attributes['name'], TRUE
     );
 
-    $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array('CRM_Core_DAO_Job', $this->_id));
+    $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array(
+        'CRM_Core_DAO_Job',
+        $this->_id
+      ));
 
     $this->add('text', 'description', ts('Description'),
       $attributes['description']
@@ -148,8 +151,8 @@ class CRM_Admin_Form_Job extends CRM_Admin_Form {
     }
     $domainID = CRM_Core_Config::domainID();
 
-    $dao            = new CRM_Core_DAO_Job();
-    $dao->id        = $this->_id;
+    $dao = new CRM_Core_DAO_Job();
+    $dao->id = $this->_id;
     $dao->domain_id = $domainID;
     if (!$dao->find(TRUE)) {
       return $defaults;
@@ -188,15 +191,15 @@ class CRM_Admin_Form_Job extends CRM_Admin_Form {
 
     $dao = new CRM_Core_DAO_Job();
 
-    $dao->id            = $this->_id;
-    $dao->domain_id     = $domainID;
+    $dao->id = $this->_id;
+    $dao->domain_id = $domainID;
     $dao->run_frequency = $values['run_frequency'];
-    $dao->parameters    = $values['parameters'];
-    $dao->name          = $values['name'];
-    $dao->api_entity    = $values['api_entity'];
-    $dao->api_action    = $values['api_action'];
-    $dao->description   = $values['description'];
-    $dao->is_active     = CRM_Utils_Array::value('is_active', $values, 0);
+    $dao->parameters = $values['parameters'];
+    $dao->name = $values['name'];
+    $dao->api_entity = $values['api_entity'];
+    $dao->api_action = $values['api_action'];
+    $dao->description = $values['description'];
+    $dao->is_active = CRM_Utils_Array::value('is_active', $values, 0);
 
     $dao->save();
 
index 654015b0055ea7bc84fd9d937fbe8d76494b97f1..a347b5007ee4b17e3236cd2597272fd2f02d8f52 100644 (file)
@@ -122,8 +122,8 @@ class CRM_Admin_Form_LocationType extends CRM_Admin_Form {
     $locationType->save();
 
     CRM_Core_Session::setStatus(ts("The location type '%1' has been saved.",
-        array(1 => $locationType->name)
-      ), ts('Saved'), 'success');
+      array(1 => $locationType->name)
+    ), ts('Saved'), 'success');
   }
 
 }
index 5b331db125e98015523a3d7340677eff15bcc7e1..a3de9c5d0bf7281d64a946c40e2ee4528836243b 100644 (file)
@@ -85,7 +85,7 @@ class CRM_Admin_Form_MailSettings extends CRM_Admin_Form {
     $this->add('checkbox', 'is_ssl', ts('Use SSL?'));
 
     $usedfor = array(
-    1 => ts('Bounce Processing'),
+      1 => ts('Bounce Processing'),
       0 => ts('Email-to-Activity Processing'),
     );
     $this->add('select', 'is_default', ts('Used For?'), $usedfor);
@@ -156,7 +156,9 @@ class CRM_Admin_Form_MailSettings extends CRM_Admin_Form {
     $params = array();
     foreach ($fields as $f) {
       if (in_array($f, array(
-        'is_default', 'is_ssl'))) {
+        'is_default',
+        'is_ssl'
+      ))) {
         $params[$f] = CRM_Utils_Array::value($f, $formValues, FALSE);
       }
       else {
index 4304651d278febe6722c39d9b858432bc65d2f22..ed1a99e5a9833097f5b959aaba2a4c99ebadd257 100644 (file)
@@ -65,7 +65,10 @@ class CRM_Admin_Form_Mapping extends CRM_Admin_Form {
       $this->add('text', 'name', ts('Name'),
         CRM_Core_DAO::getAttribute('CRM_Core_DAO_Mapping', 'name'), TRUE
       );
-      $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array('CRM_Core_DAO_Mapping', $this->_id));
+      $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array(
+          'CRM_Core_DAO_Mapping',
+          $this->_id
+        ));
 
       $this->addElement('text', 'description', ts('Description'),
         CRM_Core_DAO::getAttribute('CRM_Core_DAO_Mapping', 'description')
index dc7acc076545527ea991d25c98199c65b33c9922..0f24a14b88263efa8fe7d87e6088d830fad7e8ff 100644 (file)
@@ -75,8 +75,8 @@ class CRM_Admin_Form_MessageTemplates extends CRM_Admin_Form {
       //set the context for redirection after form submit or cancel
       $session = CRM_Core_Session::singleton();
       $session->replaceUserContext(CRM_Utils_System::url('civicrm/admin/messageTemplates',
-          'selectedChild=user&reset=1'
-        ));
+        'selectedChild=user&reset=1'
+      ));
     }
 
     // FIXME: we need to fix the Cancel button here as we don’t know whether it’s a workflow template in buildQuickForm()
@@ -138,12 +138,14 @@ class CRM_Admin_Form_MessageTemplates extends CRM_Admin_Form {
       return;
     }
 
-    $breadCrumb = array(array(
-    'title' => ts('Message Templates'),
+    $breadCrumb = array(
+      array(
+        'title' => ts('Message Templates'),
         'url' => CRM_Utils_System::url('civicrm/admin/messageTemplates',
           'action=browse&reset=1'
         ),
-      ));
+      )
+    );
     CRM_Utils_System::appendBreadCrumb($breadCrumb);
 
     $this->applyFilter('__ALL__', 'trim');
@@ -174,7 +176,7 @@ class CRM_Admin_Form_MessageTemplates extends CRM_Admin_Form {
       $this->addWysiwyg('msg_html', ts('HTML Message'),
         array(
           'cols' => '80',
-      'rows' => '8',
+          'rows' => '8',
           'onkeyup' => "return verify(this)",
         )
       );
@@ -186,7 +188,8 @@ class CRM_Admin_Form_MessageTemplates extends CRM_Admin_Form {
 
     $this->add('select', 'pdf_format_id', ts('PDF Page Format'),
       array(
-        'null' => ts('- default -')) + CRM_Core_BAO_PdfFormat::getList(TRUE), FALSE
+        'null' => ts('- default -')
+      ) + CRM_Core_BAO_PdfFormat::getList(TRUE), FALSE
     );
 
     $this->add('checkbox', 'is_active', ts('Enabled?'));
index 220febde664db647bc4a3fd6300f8f448999fbec..2ab93c48f96c40e977f187cf03e9c35b495487af 100644 (file)
@@ -162,7 +162,7 @@ class CRM_Admin_Form_Navigation extends CRM_Admin_Form {
     CRM_Core_BAO_Navigation::resetNavigation();
 
     CRM_Core_Session::setStatus(ts('Menu \'%1\' has been saved.',
-        array(1 => $navigation->label)
-      ), ts('Saved'), 'success');
+      array(1 => $navigation->label)
+    ), ts('Saved'), 'success');
   }
 }
index 6aaa367fd6ce19cc85d18c17864ae4218a0bc8ba..bb8c5e6a971658367ee1420a6890370fe700a940 100644 (file)
@@ -79,7 +79,10 @@ class CRM_Admin_Form_OptionGroup extends CRM_Admin_Form {
     $element = $this->add('checkbox', 'is_active', ts('Enabled?'));
     if ($this->_action & CRM_Core_Action::UPDATE) {
       if (in_array($this->_values['name'], array(
-        'encounter_medium', 'case_type', 'case_status'))) {
+        'encounter_medium',
+        'case_type',
+        'case_status'
+      ))) {
         static $caseCount = NULL;
         if (!isset($caseCount)) {
           $caseCount = CRM_Case_BAO_Case::caseCount(NULL, FALSE);
index c2e653bc39d3e9a60cb8765171112ca077d2b4e3..9ee6bcef0b0a57dc33457038967556b4c757960e 100644 (file)
@@ -81,21 +81,24 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
       'name'
     );
     $this->_gLabel = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $this->_gid, 'title');
-    $url          = "civicrm/admin/options/{$this->_gName}";
-    $params       = "reset=1";
+    $url = "civicrm/admin/options/{$this->_gName}";
+    $params = "reset=1";
 
     if (($this->_action & CRM_Core_Action::DELETE) &&
       in_array($this->_gName, array('email_greeting', 'postal_greeting', 'addressee'))
     ) {
       // Don't allow delete if the option value belongs to addressee, postal or email greetings and is in use.
-      $findValue  = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $this->_id, 'value');
+      $findValue = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $this->_id, 'value');
       $queryParam = array(1 => array($findValue, 'Integer'));
       $columnName = $this->_gName . "_id";
-      $sql        = "SELECT count(id) FROM civicrm_contact WHERE " . $columnName . " = %1";
-      $isInUse    = CRM_Core_DAO::singleValueQuery($sql, $queryParam);
+      $sql = "SELECT count(id) FROM civicrm_contact WHERE " . $columnName . " = %1";
+      $isInUse = CRM_Core_DAO::singleValueQuery($sql, $queryParam);
       if ($isInUse) {
         $scriptURL = "<a href='" . CRM_Utils_System::docURL2('Update Greetings and Address Data for Contacts', TRUE, NULL, NULL, NULL, "wiki") . "'>" . ts('Learn more about a script that can automatically update contact addressee and greeting options.') . "</a>";
-        CRM_Core_Session::setStatus(ts('The selected %1 option has <strong>not been deleted</strong> because it is currently in use. Please update these contacts to use a different format before deleting this option. %2', array(1 => $this->_gLabel, 2 => $scriptURL)), ts('Sorry'), 'error');
+        CRM_Core_Session::setStatus(ts('The selected %1 option has <strong>not been deleted</strong> because it is currently in use. Please update these contacts to use a different format before deleting this option. %2', array(
+              1 => $this->_gLabel,
+              2 => $scriptURL
+            )), ts('Sorry'), 'error');
         $redirect = CRM_Utils_System::url($url, $params);
         CRM_Utils_System::redirect($redirect);
       }
@@ -129,7 +132,10 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
 
     //setDefault of contact types for email greeting, postal greeting, addressee, CRM-4575
     if (in_array($this->_gName, array(
-      'email_greeting', 'postal_greeting', 'addressee'))) {
+      'email_greeting',
+      'postal_greeting',
+      'addressee'
+    ))) {
       $defaults['contactOptions'] = (CRM_Utils_Array::value('filter', $defaults)) ? $defaults['filter'] : NULL;
     }
     // CRM-11516
@@ -167,7 +173,11 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
     );
 
     if (!in_array($this->_gName, array(
-      'email_greeting', 'postal_greeting', 'addressee')) && !$isReserved) {
+        'email_greeting',
+        'postal_greeting',
+        'addressee'
+      )) && !$isReserved
+    ) {
       $this->addRule('label',
         ts('This Label already exists in the database for this option group. Please select a different Value.'),
         'optionExists',
@@ -177,7 +187,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
 
     if ($this->_gName == 'case_status') {
       $classes = array(
-      'Opened' => ts('Opened'),
+        'Opened' => ts('Opened'),
         'Closed' => ts('Closed'),
       );
 
@@ -294,9 +304,13 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
 
     //get contact type for which user want to create a new greeting/addressee type, CRM-4575
     if (in_array($this->_gName, array(
-      'email_greeting', 'postal_greeting', 'addressee')) && !$isReserved) {
+        'email_greeting',
+        'postal_greeting',
+        'addressee'
+      )) && !$isReserved
+    ) {
       $values = array(
-      1 => ts('Individual'),
+        1 => ts('Individual'),
         2 => ts('Household'),
         3 => ts('Organization'),
         4 => ts('Multiple Contact Merge'),
@@ -338,10 +352,15 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
       $errors['grouping'] = ts('Status class is a required field');
     }
 
-    if (in_array($self->_gName, array('email_greeting', 'postal_greeting', 'addressee')) && empty($self->_defaultValues['is_reserved'])) {
-      $label               = $fields['label'];
-      $condition           = " AND v.label = '{$label}' ";
-      $values              = CRM_Core_OptionGroup::values($self->_gName, FALSE, FALSE, FALSE, $condition, 'filter');
+    if (in_array($self->_gName, array(
+          'email_greeting',
+          'postal_greeting',
+          'addressee'
+        )) && empty($self->_defaultValues['is_reserved'])
+    ) {
+      $label = $fields['label'];
+      $condition = " AND v.label = '{$label}' ";
+      $values = CRM_Core_OptionGroup::values($self->_gName, FALSE, FALSE, FALSE, $condition, 'filter');
       $checkContactOptions = TRUE;
 
       if ($self->_id && ($self->_defaultValues['contactOptions'] == $fields['contactOptions'])) {
@@ -437,7 +456,10 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
         CRM_Financial_BAO_FinancialTypeAccount::add($params);
       }
 
-      CRM_Core_Session::setStatus(ts('The %1 \'%2\' has been saved.', array(1 => $this->_gLabel, 2 => $optionValue->label)), ts('Saved'), 'success');
+      CRM_Core_Session::setStatus(ts('The %1 \'%2\' has been saved.', array(
+            1 => $this->_gLabel,
+            2 => $optionValue->label
+          )), ts('Saved'), 'success');
     }
   }
 
index 95fabcbf230e89d6b8eafbcb26c7e83d6a2806d5..1afa4544c8d046fc3796df495e5d674cdd2085a8 100644 (file)
@@ -181,7 +181,10 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form {
       $attributes['name'], TRUE
     );
 
-    $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array('CRM_Financial_DAO_PaymentProcessor', $this->_id));
+    $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array(
+        'CRM_Financial_DAO_PaymentProcessor',
+        $this->_id
+      ));
 
     $this->add('text', 'description', ts('Description'),
       $attributes['description']
@@ -239,8 +242,9 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form {
     $errors = array();
 
     if (!(self::checkSection($fields, $errors) ||
-        self::checkSection($fields, $errors, 'test')
-      )) {
+      self::checkSection($fields, $errors, 'test')
+    )
+    ) {
       $errors['_qf_default'] = ts('You must have at least the test or live section filled');
     }
 
@@ -306,7 +310,7 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form {
     $domainID = CRM_Core_Config::domainID();
 
     $dao = new CRM_Financial_DAO_PaymentProcessor();
-    $dao->id        = $this->_id;
+    $dao->id = $this->_id;
     $dao->domain_id = $domainID;
     if (!$dao->find(TRUE)) {
       return $defaults;
@@ -316,8 +320,8 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form {
 
     // now get testID
     $testDAO = new CRM_Financial_DAO_PaymentProcessor();
-    $testDAO->name      = $dao->name;
-    $testDAO->is_test   = 1;
+    $testDAO->name = $dao->name;
+    $testDAO->is_test = 1;
     $testDAO->domain_id = $domainID;
     if ($testDAO->find(TRUE)) {
       $this->_testID = $testDAO->id;
@@ -372,9 +376,9 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form {
   public function updatePaymentProcessor(&$values, $domainID, $test) {
     $dao = new CRM_Financial_DAO_PaymentProcessor();
 
-    $dao->id         = $test ? $this->_testID : $this->_id;
-    $dao->domain_id  = $domainID;
-    $dao->is_test    = $test;
+    $dao->id = $test ? $this->_testID : $this->_id;
+    $dao->domain_id = $domainID;
+    $dao->is_test = $test;
     $dao->is_default = CRM_Utils_Array::value('is_default', $values, 0);
 
     $dao->is_active = CRM_Utils_Array::value('is_active', $values, 0);
@@ -392,9 +396,9 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form {
     }
 
     // also copy meta fields from the info DAO
-    $dao->is_recur     = $this->_ppDAO->is_recur;
+    $dao->is_recur = $this->_ppDAO->is_recur;
     $dao->billing_mode = $this->_ppDAO->billing_mode;
-    $dao->class_name   = $this->_ppDAO->class_name;
+    $dao->class_name = $this->_ppDAO->class_name;
     $dao->payment_type = $this->_ppDAO->payment_type;
 
     $dao->save();
index 56ac6a9aa8e356d99484d41f37a7590b086bdce2..2f4d62183be0218ade039cd259ce24c4ec7e8ebb 100644 (file)
@@ -228,10 +228,10 @@ UPDATE civicrm_payment_processor SET is_default = 0";
 
     $dao = new CRM_Financial_DAO_PaymentProcessorType();
 
-    $dao->id         = $this->_id;
+    $dao->id = $this->_id;
     $dao->is_default = CRM_Utils_Array::value('is_default', $values, 0);
-    $dao->is_active  = CRM_Utils_Array::value('is_active', $values, 0);
-    $dao->is_recur   = CRM_Utils_Array::value('is_recur', $values, 0);
+    $dao->is_active = CRM_Utils_Array::value('is_active', $values, 0);
+    $dao->is_recur = CRM_Utils_Array::value('is_recur', $values, 0);
 
     $dao->name = $values['name'];
     $dao->description = $values['description'];
index 15c50218f2abf3c539cd95a472d72d9f0dbbfbec..5daa96f03c976eff82ee3ea54f0a64239bcd781b 100644 (file)
@@ -66,7 +66,8 @@ class CRM_Admin_Form_PdfFormats extends CRM_Admin_Form {
 
     $this->add('select', 'paper_size', ts('Paper Size'),
       array(
-        0 => ts('- default -')) + CRM_Core_BAO_PaperSize::getList(TRUE), FALSE,
+        0 => ts('- default -')
+      ) + CRM_Core_BAO_PaperSize::getList(TRUE), FALSE,
       array('onChange' => "selectPaper( this.value );")
     );
 
@@ -83,7 +84,10 @@ class CRM_Admin_Form_PdfFormats extends CRM_Admin_Form {
     $this->add('text', 'margin_bottom', ts('Bottom Margin'), array('size' => 8, 'maxlength' => 8), TRUE);
     $this->add('text', 'weight', ts('Order'), CRM_Core_DAO::getAttribute('CRM_Core_BAO_PdfFormat', 'weight'), TRUE);
 
-    $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array('CRM_Core_BAO_PdfFormat', $this->_id));
+    $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array(
+        'CRM_Core_BAO_PdfFormat',
+        $this->_id
+      ));
     $this->addRule('margin_left', ts('Margin must be numeric'), 'numeric');
     $this->addRule('margin_right', ts('Margin must be numeric'), 'numeric');
     $this->addRule('margin_top', ts('Margin must be numeric'), 'numeric');
index c0014595e7703bbb6abd9b2893d96f0faeed2229..232fc52e7303d3b025e8c6018955dde6deabd6d6 100644 (file)
@@ -40,8 +40,8 @@ class CRM_Admin_Form_Persistent extends CRM_Core_Form {
 
   public function preProcess() {
     $this->_indexID = CRM_Utils_Request::retrieve('id', 'Integer', $this, FALSE);
-    $this->_config  = CRM_Utils_Request::retrieve('config', 'Integer', $this, 0);
-    $this->_action  = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE);
+    $this->_config = CRM_Utils_Request::retrieve('config', 'Integer', $this, 0);
+    $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE);
 
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/admin/tplstrings', 'reset=1'));
index 44ec82f3487e420e4fa60d1106763c467af16abb..d6ac61dade3dbb67b4c17d18a0650f26719499c0 100644 (file)
@@ -265,8 +265,8 @@ class CRM_Admin_Form_Preferences extends CRM_Core_Form {
               is_array($this->_params[$settingName])
             ) {
               $this->_config->$settingName = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,
-                array_keys($this->_params[$settingName])
-              ) . CRM_Core_DAO::VALUE_SEPARATOR;
+                  array_keys($this->_params[$settingName])
+                ) . CRM_Core_DAO::VALUE_SEPARATOR;
             }
             else {
               $this->_config->$settingName = NULL;
index b6e447417b64332dce4fab367c2dc88ffb2da315..1b2eac7a0b5d306e49386f53cee412f5b12f67ee 100644 (file)
@@ -43,7 +43,8 @@ class CRM_Admin_Form_Preferences_Address extends CRM_Admin_Form_Preferences {
 
     // Address Standardization
     $addrProviders = array(
-      '' => '- select -') + CRM_Core_SelectValues::addressProvider();
+        '' => '- select -'
+      ) + CRM_Core_SelectValues::addressProvider();
 
     $this->_varNames = array(
       CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME => array(
index 76f464c255d03e4c0e08ab2900cc062d352b863b..e474e28a49764401a59bc480660d2e870b4b3094 100644 (file)
@@ -16,69 +16,69 @@ class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences {
     CRM_Utils_System::setTitle(ts('CiviContribute Component Settings'));
     $this->_varNames = array(
       CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME => array(
-          'invoice_prefix' => array(
-            'html_type' => 'text',
-            'title' => ts('Invoice Prefix'),
-            'weight' => 1,
-            'description' => ts('Enter prefix to be display on PDF for invoice'),
-          ),
-          'credit_notes_prefix' => array(
-            'html_type' => 'text',
-            'title' => ts('Credit Notes Prefix'),
-            'weight' => 2,
-            'description' => ts('Enter prefix to be display on PDF for credit notes.'),
-          ),
-          'due_date' => array(
-            'html_type' => 'text',
-            'title' => ts('Due Date'),
-            'weight' => 3,
-          ),
-          'due_date_period' => array(
-            'html_type' => 'select',
-            'title' => ts('For transmission'),
-            'weight' => 4,
-            'description' => ts('Select the interval for due date.'),
-            'option_values' => array(
-              'select' => ts('- select -'),
-              'days' => ts('Days'),
-              'months' => ts('Months'),
-              'years' => ts('Years'),
-            ),
-          ),
-          'notes' => array(
-            'html_type' => 'wysiwyg',
-            'title' => ts('Notes or Standard Terms'),
-            'weight' => 5,
-            'description' => ts('Enter note or message to be displayed on PDF invoice or credit notes '),
-            'attributes' => array('rows' => 2, 'cols' => 40),
-          ),
-          'is_email_pdf' => array(
-            'html_type' => 'checkbox',
-            'title' => ts('Automatically email invoice when user purchases online'),
-            'weight' => 6,
-          ),
-          'tax_term' => array(
-            'html_type' => 'text',
-            'title' => ts('Tax Term'),
-            'weight' => 7,
+        'invoice_prefix' => array(
+          'html_type' => 'text',
+          'title' => ts('Invoice Prefix'),
+          'weight' => 1,
+          'description' => ts('Enter prefix to be display on PDF for invoice'),
+        ),
+        'credit_notes_prefix' => array(
+          'html_type' => 'text',
+          'title' => ts('Credit Notes Prefix'),
+          'weight' => 2,
+          'description' => ts('Enter prefix to be display on PDF for credit notes.'),
+        ),
+        'due_date' => array(
+          'html_type' => 'text',
+          'title' => ts('Due Date'),
+          'weight' => 3,
+        ),
+        'due_date_period' => array(
+          'html_type' => 'select',
+          'title' => ts('For transmission'),
+          'weight' => 4,
+          'description' => ts('Select the interval for due date.'),
+          'option_values' => array(
+            'select' => ts('- select -'),
+            'days' => ts('Days'),
+            'months' => ts('Months'),
+            'years' => ts('Years'),
           ),
-          'tax_display_settings' => array(
-            'html_type' => 'select',
-            'title' => ts('Tax Display Settings'),
-            'weight' => 8,
-            'option_values' => array(
-              'Do_not_show' => ts('Do not show breakdown, only show total -i.e ' .
-                $config->defaultCurrencySymbol . '120.00'),
-              'Inclusive' => ts('Show [tax term] inclusive price - i.e. ' .
-                $config->defaultCurrencySymbol .
-                '120.00 (includes [tax term] of ' .
-                $config->defaultCurrencySymbol . '20.00)'),
-              'Exclusive' => ts('Show [tax term] exclusive price - i.e. ' .
-                $config->defaultCurrencySymbol . '100.00 + ' .
-                $config->defaultCurrencySymbol . '20.00 [tax term]'),
-            ),
+        ),
+        'notes' => array(
+          'html_type' => 'wysiwyg',
+          'title' => ts('Notes or Standard Terms'),
+          'weight' => 5,
+          'description' => ts('Enter note or message to be displayed on PDF invoice or credit notes '),
+          'attributes' => array('rows' => 2, 'cols' => 40),
+        ),
+        'is_email_pdf' => array(
+          'html_type' => 'checkbox',
+          'title' => ts('Automatically email invoice when user purchases online'),
+          'weight' => 6,
+        ),
+        'tax_term' => array(
+          'html_type' => 'text',
+          'title' => ts('Tax Term'),
+          'weight' => 7,
+        ),
+        'tax_display_settings' => array(
+          'html_type' => 'select',
+          'title' => ts('Tax Display Settings'),
+          'weight' => 8,
+          'option_values' => array(
+            'Do_not_show' => ts('Do not show breakdown, only show total -i.e ' .
+              $config->defaultCurrencySymbol . '120.00'),
+            'Inclusive' => ts('Show [tax term] inclusive price - i.e. ' .
+              $config->defaultCurrencySymbol .
+              '120.00 (includes [tax term] of ' .
+              $config->defaultCurrencySymbol . '20.00)'),
+            'Exclusive' => ts('Show [tax term] exclusive price - i.e. ' .
+              $config->defaultCurrencySymbol . '100.00 + ' .
+              $config->defaultCurrencySymbol . '20.00 [tax term]'),
           ),
         ),
+      ),
     );
     parent::preProcess();
   }
index 2e828005d2c4e6cfe662a06daf4034e4a3f6b315..fcfa3b6292420200a1926759660bf175424cee5d 100644 (file)
@@ -173,8 +173,8 @@ class CRM_Admin_Form_Preferences_Display extends CRM_Admin_Form_Preferences {
         cj("#crm-preferences-display-form-block-wysiwyg_input_format").hide()
       }';
 
-      $formats           = filter_formats();
-      $format_options    = array();
+      $formats = filter_formats();
+      $format_options = array();
       foreach ($formats as $id => $format) {
         $format_options[$id] = $format->name;
       }
index 6af7cbd18d741235e63ea6ad66d3e3ccb6fcfeb2..978b585d3fa8635ddfc992e1fc2411c18fdf86fe 100644 (file)
@@ -54,7 +54,7 @@ class CRM_Admin_Form_Preferences_Event extends CRM_Admin_Form_Preferences {
           'title' => ts('Use Shopping Cart Style Event Registration'),
           'weight' => 1,
           'description' => ts('This feature allows users to register for more than one event at a time. When enabled, users will add event(s) to a "cart" and then pay for them all at once. Enabling this setting will affect online registration for all active events. The code is an alpha state, and you will potentially need to have developer resources to debug and fix sections of the codebase while testing and deploying it. %1',
-                              array(1 => $docLink)),
+            array(1 => $docLink)),
         ),
         'show_events' => array(
           'html_type' => 'select',
index 855d374d114be81785e2fe33a019e30a46829de2..93e8456ce23fef38282a1d1ddf81f18aea5337d4 100644 (file)
@@ -50,12 +50,12 @@ class CRM_Admin_Form_Preferences_Multisite extends CRM_Admin_Form_Preferences {
           'description' => ts('Make CiviCRM aware of multiple domains. You should configure a domain group if enabled') . ' ' . $msDoc,
         ),
         /** Remove this checkbox until some one knows what this setting does
-          'uniq_email_per_site' => array(
-          'html_type' => 'checkbox',
-          'title' => ts('Ensure multi sites have a unique email per site'),
-          'weight' => 2,
-          'description' => NULL,
-        ),
+         * 'uniq_email_per_site' => array(
+         * 'html_type' => 'checkbox',
+         * 'title' => ts('Ensure multi sites have a unique email per site'),
+         * 'weight' => 2,
+         * 'description' => NULL,
+         * ),
          */
         'domain_group_id' => array(
           'html_type' => 'entity_reference',
@@ -65,13 +65,13 @@ class CRM_Admin_Form_Preferences_Multisite extends CRM_Admin_Form_Preferences {
           'description' => ts('Contacts created on this site are added to this group'),
         ),
         /** Remove this checkbox until some one knows what this setting does
-        'event_price_set_domain_id' => array(
-          'html_type' => 'text',
-          'title' => ts('Domain for event price sets'),
-          'weight' => 4,
-          'description' => NULL,
-        ),
-        */
+         * 'event_price_set_domain_id' => array(
+         * 'html_type' => 'text',
+         * 'title' => ts('Domain for event price sets'),
+         * 'weight' => 4,
+         * 'description' => NULL,
+         * ),
+         */
       ),
     );
 
index ab904d0ecc413e14e61036e5a66699c9639231d7..9037b956f9233b3a49c9c97d76d7b8ce7aa2e39b 100644 (file)
@@ -124,18 +124,18 @@ class CRM_Admin_Form_PreferencesDate extends CRM_Admin_Form {
     $params = $this->controller->exportValues($this->_name);
 
     // action is taken depending upon the mode
-    $dao              = new CRM_Core_DAO_PreferencesDate();
-    $dao->id          = $this->_id;
+    $dao = new CRM_Core_DAO_PreferencesDate();
+    $dao->id = $this->_id;
     $dao->description = $params['description'];
-    $dao->start       = $params['start'];
-    $dao->end         = $params['end'];
+    $dao->start = $params['start'];
+    $dao->end = $params['end'];
     $dao->date_format = $params['date_format'];
     $dao->time_format = $params['time_format'];
 
     $dao->save();
 
     CRM_Core_Session::setStatus(ts("The date type '%1' has been saved.",
-        array(1 => $params['name'])
-      ), ts('Saved'), 'success');
+      array(1 => $params['name'])
+    ), ts('Saved'), 'success');
   }
 }
index f6a74c554126b4f2ebeb60f8f1d02ed24f5fd847..d9572b6c31d818d8180c7136c62f98dc675c101b 100644 (file)
@@ -78,11 +78,13 @@ class CRM_Admin_Form_RelationshipType extends CRM_Admin_Form {
     // add select for contact type
     $contactTypeA = &$this->add('select', 'contact_types_a', ts('Contact Type A') . ' ',
       array(
-        '' => ts('All Contacts')) + $contactTypes
+        '' => ts('All Contacts')
+      ) + $contactTypes
     );
     $contactTypeB = &$this->add('select', 'contact_types_b', ts('Contact Type B') . ' ',
       array(
-        '' => ts('All Contacts')) + $contactTypes
+        '' => ts('All Contacts')
+      ) + $contactTypes
     );
 
     $isActive = &$this->add('checkbox', 'is_active', ts('Enabled?'));
index 352d35a99d15e2c658ad4eca71c30459680b85c2..ffef831dcb7117249aecaa67cd05cc7935ee4eb3 100644 (file)
@@ -113,14 +113,14 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form {
         CRM_Core_Error::fatal('Could not find mapping for scheduled reminders.');
       }
 
-      $sel = & $this->add(
+      $sel = &$this->add(
         'hierselect',
-          'entity',
-          ts('Entity'),
-          array(
-            'name' => 'entity[0]',
-            'style' => 'vertical-align: top;',
-          ),
+        'entity',
+        ts('Entity'),
+        array(
+          'name' => 'entity[0]',
+          'style' => 'vertical-align: top;',
+        ),
         TRUE
       );
       $sel->setOptions(array($sel1, $sel2, $sel3));
@@ -183,7 +183,7 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form {
     $this->add('select', 'start_action_unit', ts('Frequency'), $freqUnitsDisplay, TRUE);
 
     $condition = array(
-    'before' => ts('before'),
+      'before' => ts('before'),
       'after' => ts('after'),
     );
     //reminder_action
@@ -261,6 +261,7 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form {
 
     $this->setPageTitle(ts('Scheduled Reminder'));
   }
+
   /**
    * Global form rule
    *
@@ -464,7 +465,7 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form {
     }
 
     if (!empty($this->_mappingID) && !empty($this->_compId)) {
-      $params['mapping_id']   = $this->_mappingID;
+      $params['mapping_id'] = $this->_mappingID;
       $params['entity_value'] = $this->_compId;
       $params['entity_status'] = implode(CRM_Core_DAO::VALUE_SEPARATOR, $values['entity']);
     }
@@ -512,8 +513,10 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form {
     //TODO: handle postprocessing of SMS and/or Email info based on $modePrefixes
 
     $composeFields = array(
-      'template', 'saveTemplate',
-      'updateTemplate', 'saveTemplateName',
+      'template',
+      'saveTemplate',
+      'updateTemplate',
+      'saveTemplateName',
     );
     $msgTemplate = NULL;
     //mail template is composed
@@ -597,7 +600,7 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form {
     if ($this->_action) {
       if ($this->_action & CRM_Core_Action::UPDATE) {
         $status = ts("Your Reminder titled %1 has been updated.",
-                  array(1 => "<strong>{$values['title']}</strong>")
+          array(1 => "<strong>{$values['title']}</strong>")
         );
       }
 
index ca40d9c33a25bb5d2f1bc5344bc2d512774d438e..35a60e44c8e3bb6cca068419ff8c8d0c13accd50 100644 (file)
@@ -52,8 +52,8 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form {
   public function setDefaultValues() {
     if (!$this->_defaults) {
       $this->_defaults = array();
-      $formArray       = array('Component', 'Localization');
-      $formMode        = FALSE;
+      $formArray = array('Component', 'Localization');
+      $formMode = FALSE;
       if (in_array($this->_name, $formArray)) {
         $formMode = TRUE;
       }
@@ -63,12 +63,12 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form {
       CRM_Core_Config_Defaults::setValues($this->_defaults, $formMode);
 
       $list = array_flip(CRM_Core_OptionGroup::values('contact_autocomplete_options',
-          FALSE, FALSE, TRUE, NULL, 'name'
-        ));
+        FALSE, FALSE, TRUE, NULL, 'name'
+      ));
 
       $cRlist = array_flip(CRM_Core_OptionGroup::values('contact_reference_options',
-          FALSE, FALSE, TRUE, NULL, 'name'
-        ));
+        FALSE, FALSE, TRUE, NULL, 'name'
+      ));
 
       $listEnabled = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
         'contact_autocomplete_options'
@@ -89,18 +89,20 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form {
 
       //Set defaults for autocomplete and contact reference options
       $this->_defaults['autocompleteContactSearch'] = array(
-        '1' => 1) + $autoSearchFields;
+          '1' => 1
+        ) + $autoSearchFields;
       $this->_defaults['autocompleteContactReference'] = array(
-        '1' => 1) + $cRSearchFields;
+          '1' => 1
+        ) + $cRSearchFields;
 
       // we can handle all the ones defined in the metadata here. Others to be converted
       foreach ($this->_settings as $setting => $group) {
         $settingMetaData = civicrm_api('setting', 'getfields', array('version' => 3, 'name' => $setting));
         $this->_defaults[$setting] = civicrm_api('setting', 'getvalue', array(
-          'version' => 3,
-          'name' => $setting,
-          'group' => $group,
-          'default_value' => CRM_Utils_Array::value('default', $settingMetaData['values'][$setting]),
+            'version' => 3,
+            'name' => $setting,
+            'group' => $group,
+            'default_value' => CRM_Utils_Array::value('default', $settingMetaData['values'][$setting]),
           )
         );
       }
@@ -187,8 +189,8 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form {
     // save autocomplete search options
     if (!empty($params['autocompleteContactSearch'])) {
       $value = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,
-        array_keys($params['autocompleteContactSearch'])
-      ) . CRM_Core_DAO::VALUE_SEPARATOR;
+          array_keys($params['autocompleteContactSearch'])
+        ) . CRM_Core_DAO::VALUE_SEPARATOR;
 
       CRM_Core_BAO_Setting::setItem($value,
         CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
@@ -201,8 +203,8 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form {
     // save autocomplete contact reference options
     if (!empty($params['autocompleteContactReference'])) {
       $value = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,
-        array_keys($params['autocompleteContactReference'])
-      ) . CRM_Core_DAO::VALUE_SEPARATOR;
+          array_keys($params['autocompleteContactReference'])
+        ) . CRM_Core_DAO::VALUE_SEPARATOR;
 
       CRM_Core_BAO_Setting::setItem($value,
         CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
index 55128f0cae01bee0fb5e44b80e2d8c4a219bedda..401219d22a11f990d33fcf654cc957caaf46b833 100644 (file)
@@ -45,6 +45,7 @@ class CRM_Admin_Form_Setting_Debugging extends CRM_Admin_Form_Setting {
     'fatalErrorTemplate' => CRM_Core_BAO_Setting::DEVELOPER_PREFERENCES_NAME,
     'fatalErrorHandler' => CRM_Core_BAO_Setting::DEVELOPER_PREFERENCES_NAME,
   );
+
   /**
    * Build the form object
    *
index ee08eba60a7d5804292b0293a67044b7ad2be1f7..d922123c45c4e2119e443e52ef424cd311bf7a76 100644 (file)
@@ -251,8 +251,9 @@ class CRM_Admin_Form_Setting_Localization extends CRM_Admin_Form_Setting {
       $values['currencyLimit'] = array($values['defaultCurrency']);
     }
     elseif (!in_array($values['defaultCurrency'],
-        $values['currencyLimit']
-      )) {
+      $values['currencyLimit']
+    )
+    ) {
       $values['currencyLimit'][] = $values['defaultCurrency'];
     }
 
index 47b3f8bfe69cf311538ab732a946353ec3f6197f..4e0c02b56ef4902fafa1a77389fed4ffb04cc2d7 100644 (file)
@@ -79,7 +79,8 @@ class CRM_Admin_Form_Setting_Mail extends CRM_Admin_Form_Setting {
         $errors['mailerJobSize'] = ts('The job size must be at least 1000 or set to 0 (unlimited).');
       }
       elseif (CRM_Utils_Array::value('mailerJobSize', $fields) <
-        CRM_Utils_Array::value('mailerBatchLimit', $fields)) {
+        CRM_Utils_Array::value('mailerBatchLimit', $fields)
+      ) {
         $errors['mailerJobSize'] = ts('A job size smaller than the batch limit will negate the effect of the batch limit.');
       }
     }
index bce3279a8145c6c40bb70b3c4bf2ff9b02d3773e..a078bc89633b24d97b5b7edde3011f3e911daf53 100644 (file)
@@ -60,7 +60,7 @@ class CRM_Admin_Form_Setting_Miscellaneous extends CRM_Admin_Form_Setting {
    */
 
   public function preProcess() {
-    $config     = CRM_Core_Config::singleton();
+    $config = CRM_Core_Config::singleton();
     $this->_uploadMaxSize = (int) ini_get('upload_max_filesize');
     // check for post max size
     CRM_Core_Config_Defaults::formatUnitSize(ini_get('post_max_size'), TRUE);
index fecceb069e7da87c234b95941e6615ba8bb8bc3c..3d4408201714c52b6c70e67f6c042ad893381620 100644 (file)
@@ -48,7 +48,7 @@ class CRM_Admin_Form_Setting_Path extends CRM_Admin_Form_Setting {
     CRM_Utils_System::setTitle(ts('Settings - Upload Directories'));
 
     $directories = array(
-    'uploadDir' => ts('Temporary Files'),
+      'uploadDir' => ts('Temporary Files'),
       'imageUploadDir' => ts('Images'),
       'customFileUploadDir' => ts('Custom Files'),
       'customTemplateDir' => ts('Custom Templates'),
index 7c716e141cb4d72143a8ef857e4ac8646b08e631..8e7868031565cbb128d2f4575c5a9f1f2f3179b6 100644 (file)
@@ -72,7 +72,8 @@ class CRM_Admin_Form_Setting_Search extends CRM_Admin_Form_Setting {
 
     // Autocomplete for Contact Search (quick search etc.)
     $options = array(
-      ts('Contact Name') => 1) + array_flip(CRM_Core_OptionGroup::values('contact_autocomplete_options',
+        ts('Contact Name') => 1
+      ) + array_flip(CRM_Core_OptionGroup::values('contact_autocomplete_options',
         FALSE, FALSE, TRUE
       ));
     $this->addCheckBox('autocompleteContactSearch', ts('Autocomplete Contact Search'), $options,
@@ -83,7 +84,8 @@ class CRM_Admin_Form_Setting_Search extends CRM_Admin_Form_Setting {
 
     // Autocomplete for Contact Reference (custom fields)
     $optionsCR = array(
-      ts('Contact Name') => 1) + array_flip(CRM_Core_OptionGroup::values('contact_reference_options',
+        ts('Contact Name') => 1
+      ) + array_flip(CRM_Core_OptionGroup::values('contact_reference_options',
         FALSE, FALSE, TRUE
       ));
     $this->addCheckBox('autocompleteContactReference', ts('Contact Reference Options'), $optionsCR,
index 943c8a8bddf0b5d082d1fb3b3c8b39a4b61766a2..3ce97c290d893feac78d2c53e68a6c247a7c10b6 100644 (file)
@@ -116,9 +116,12 @@ class CRM_Admin_Form_Setting_Smtp extends CRM_Admin_Form_Setting {
           $toDisplayName = $toEmail;
         }
 
-        $to                = '"' . $toDisplayName . '"' . "<$toEmail>";
-        $from              = '"' . $domainEmailName . '" <' . $domainEmailAddress . '>';
-        $testMailStatusMsg = ts('Sending test email. FROM: %1 TO: %2.<br />', array(1 => $domainEmailAddress, 2 => $toEmail));
+        $to = '"' . $toDisplayName . '"' . "<$toEmail>";
+        $from = '"' . $domainEmailName . '" <' . $domainEmailAddress . '>';
+        $testMailStatusMsg = ts('Sending test email. FROM: %1 TO: %2.<br />', array(
+            1 => $domainEmailAddress,
+            2 => $toEmail
+          ));
 
         $params = array();
         if ($formValues['outBound_option'] == CRM_Mailing_Config::OUTBOUND_OPTION_SMTP) {
@@ -131,7 +134,7 @@ class CRM_Admin_Form_Setting_Smtp extends CRM_Admin_Form_Setting {
           if ($formValues['smtpAuth']) {
             $params['username'] = $formValues['smtpUsername'];
             $params['password'] = $formValues['smtpPassword'];
-            $params['auth']     = TRUE;
+            $params['auth'] = TRUE;
           }
           else {
             $params['auth'] = FALSE;
@@ -154,8 +157,8 @@ class CRM_Admin_Form_Setting_Smtp extends CRM_Admin_Form_Setting {
           $mailerName = 'sendmail';
         }
         elseif ($formValues['outBound_option'] == CRM_Mailing_Config::OUTBOUND_OPTION_MAIL) {
-          $subject    = "Test for PHP mail settings";
-          $message    = "mail settings are correct.";
+          $subject = "Test for PHP mail settings";
+          $message = "mail settings are correct.";
           $mailerName = 'mail';
         }
 
index d9eaea95c174680cbc18b0cbb4ba9e6c30132a66..000ef9c2435e69e702e70243f39888a1a9ff7633 100644 (file)
@@ -54,7 +54,7 @@ class CRM_Admin_Form_Setting_UpdateConfigBackend extends CRM_Admin_Form_Setting
       $this->_oldBaseURL,
       $this->_oldBaseDir,
       $this->_oldSiteName
-    ) = CRM_Core_BAO_ConfigSetting::getConfigSettings();
+      ) = CRM_Core_BAO_ConfigSetting::getConfigSettings();
 
     $this->assign('oldBaseURL', $this->_oldBaseURL);
     $this->assign('oldBaseDir', $this->_oldBaseDir);
@@ -84,7 +84,7 @@ class CRM_Admin_Form_Setting_UpdateConfigBackend extends CRM_Admin_Form_Setting
         $this->_defaults['newBaseURL'],
         $this->_defaults['newBaseDir'],
         $this->_defaults['newSiteName']
-      ) = CRM_Core_BAO_ConfigSetting::getBestGuessSettings();
+        ) = CRM_Core_BAO_ConfigSetting::getBestGuessSettings();
     }
 
     return $this->_defaults;
@@ -146,7 +146,8 @@ class CRM_Admin_Form_Setting_UpdateConfigBackend extends CRM_Admin_Form_Setting
     }
 
     $from = array($this->_oldBaseURL, $this->_oldBaseDir);
-    $to = array(trim($params['newBaseURL']),
+    $to = array(
+      trim($params['newBaseURL']),
       trim($params['newBaseDir']),
     );
     if ($this->_oldSiteName &&
index cfb5a4d706f53e4c7d6e035d064dfefbbb4fb511..d16a5e8839580bcee78e8ea59581be4ce3d5d2e6 100644 (file)
@@ -42,6 +42,7 @@ class CRM_Admin_Form_Setting_Url extends CRM_Admin_Form_Setting {
     'cvv_backoffice_required' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
     'disable_core_css' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
   );
+
   /**
    * Build the form object
    *
index 56eea109760f9a7f3af6c6aca1f4aebc6a615f5b..af478be545c8c11b2f96169e6afdfdd7a28c7868 100644 (file)
@@ -92,7 +92,10 @@ class CRM_Admin_Form_Tag extends CRM_Admin_Form {
       $this->add('text', 'name', ts('Name'),
         CRM_Core_DAO::getAttribute('CRM_Core_DAO_Tag', 'name'), TRUE
       );
-      $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array('CRM_Core_DAO_Tag', $this->_id));
+      $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array(
+          'CRM_Core_DAO_Tag',
+          $this->_id
+        ));
 
       $this->add('text', 'description', ts('Description'),
         CRM_Core_DAO::getAttribute('CRM_Core_DAO_Tag', 'description')
index 773eda2ae64493292802e7fb6edd29535a100c82..5d632ef332db43aecaef0ba5bf3341cc1a722aeb 100644 (file)
@@ -51,10 +51,12 @@ class CRM_Admin_Form_WordReplacements extends CRM_Core_Form {
     $breadCrumbUrl = CRM_Utils_System::url('civicrm/admin/options/wordreplacements',
       "reset=1"
     );
-    $breadCrumb = array(array(
-    'title' => ts('Word Replacements'),
+    $breadCrumb = array(
+      array(
+        'title' => ts('Word Replacements'),
         'url' => $breadCrumbUrl,
-      ));
+      )
+    );
     CRM_Utils_System::appendBreadCrumb($breadCrumb);
   }
 
@@ -117,8 +119,8 @@ class CRM_Admin_Form_WordReplacements extends CRM_Core_Form {
    * @return void
    */
   public function buildQuickForm() {
-    $config    = CRM_Core_Config::singleton();
-    $values    = $config->localeCustomStrings[$config->lcMessages];
+    $config = CRM_Core_Config::singleton();
+    $values = $config->localeCustomStrings[$config->lcMessages];
 
     //CRM-14179
     $instances = 0;
@@ -187,9 +189,9 @@ class CRM_Admin_Form_WordReplacements extends CRM_Core_Form {
   public static function formRule($values) {
     $errors = array();
 
-    $oldValues  = CRM_Utils_Array::value('old', $values);
-    $newValues  = CRM_Utils_Array::value('new', $values);
-    $enabled    = CRM_Utils_Array::value('enabled', $values);
+    $oldValues = CRM_Utils_Array::value('old', $values);
+    $newValues = CRM_Utils_Array::value('new', $values);
+    $enabled = CRM_Utils_Array::value('enabled', $values);
     $exactMatch = CRM_Utils_Array::value('cb', $values);
 
     foreach ($oldValues as $k => $v) {
@@ -276,8 +278,8 @@ class CRM_Admin_Form_WordReplacements extends CRM_Core_Form {
 
       CRM_Core_Session::setStatus("", ts("Settings Saved"), "success");
       CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/options/wordreplacements',
-          "reset=1"
-        ));
+        "reset=1"
+      ));
     }
   }
 }
index 812e5c6c88bf1ca59a740cb9b99bc08ed45da3a8..35d7aa9e2c8f1e5b59a397b6428eb43d8232f4a5 100644 (file)
@@ -74,7 +74,7 @@ class CRM_Admin_Page_AJAX {
    */
   public static function getStatusMsg() {
     require_once 'api/v3/utils.php';
-    $recordID  = CRM_Utils_Type::escape($_GET['id'], 'Integer');
+    $recordID = CRM_Utils_Type::escape($_GET['id'], 'Integer');
     $entity = CRM_Utils_Type::escape($_GET['entity'], 'String');
     $ret = array();
 
@@ -113,9 +113,10 @@ class CRM_Admin_Page_AJAX {
             $template->assign('contexts', $contexts);
 
             $ret['illegal'] = TRUE;
-            $table  = $template->fetch('CRM/Price/Page/table.tpl');
+            $table = $template->fetch('CRM/Price/Page/table.tpl');
             $ret['content'] = ts('Unable to disable the \'%1\' price set - it is currently in use by one or more active events, contribution pages or contributions.', array(
-              1 => $priceSet)) . "<br/> $table";
+                1 => $priceSet
+              )) . "<br/> $table";
           }
           else {
             $ret['content'] = ts('Are you sure you want to disable \'%1\' Price Set?', array(1 => $priceSet));
index 40df721971dceea746d7846178bbe84d5475286a..07fa772e739504a96fe40fb61915cbe7061f3c83 100644 (file)
@@ -58,7 +58,7 @@ class CRM_Admin_Page_Admin extends CRM_Core_Page {
     }
 
     $groups = array(
-    'Customize Data and Screens' => ts('Customize Data and Screens'),
+      'Customize Data and Screens' => ts('Customize Data and Screens'),
       'Communications' => ts('Communications'),
       'Localization' => ts('Localization'),
       'Users and Permissions' => ts('Users and Permissions'),
index 3758fbafb62f80f3dd63f5c607416a0562566cfb..8379019219232bc60ccc358c317e3dfa02c83238 100644 (file)
@@ -50,8 +50,9 @@ class CRM_Admin_Page_CMSUser extends CRM_Core_Page {
   public function run() {
     //if javascript is enabled
     if (CRM_Utils_Request::retrieve('confirmed', 'Boolean',
-        $this, '', '', 'GET'
-      )) {
+      $this, '', '', 'GET'
+    )
+    ) {
       CRM_Core_BAO_CMSUser::synchronize();
       return;
     }
index 5cc3b81cdf4599d9c367bde899d30f2b5609741d..70f42ce5821a727f11e7472c33a0a2572c6c94f6 100644 (file)
@@ -96,8 +96,8 @@ class CRM_Admin_Page_EventTemplate extends CRM_Core_Page_Basic {
 
     $eventTemplate = new CRM_Event_DAO_Event();
 
-    $eventTypes          = CRM_Event_PseudoConstant::eventType();
-    $participantRoles    = CRM_Event_PseudoConstant::participantRole();
+    $eventTypes = CRM_Event_PseudoConstant::eventType();
+    $participantRoles = CRM_Event_PseudoConstant::participantRole();
     $participantListings = CRM_Event_PseudoConstant::participantListing();
 
     //find all event templates.
@@ -138,8 +138,8 @@ class CRM_Admin_Page_EventTemplate extends CRM_Core_Page_Basic {
 
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url(CRM_Utils_System::currentPath(),
-        'reset=1&action=browse'
-      ));
+      'reset=1&action=browse'
+    ));
   }
 
   /**
index 5e77ae71dc34988d1feeb4a9bb186e9cb3b8fd02..2cc2726f900b259f9c1e60ddea6d733af6992e89 100644 (file)
@@ -55,7 +55,7 @@ class CRM_Admin_Page_Extensions extends CRM_Core_Page_Basic {
   public function preProcess() {
     CRM_Utils_System::setTitle(ts('CiviCRM Extensions'));
     $destination = CRM_Utils_System::url('civicrm/admin/extensions',
-                                              'reset=1');
+      'reset=1');
 
     $destination = urlencode($destination);
     $this->assign('destination', $destination);
index 50cfd0d4f4cb7a6b8640be4960b3a5c58d41c753..02d86e0e3d9b24e96dc3f051a1130f217c40ddc1 100644 (file)
@@ -116,12 +116,14 @@ class CRM_Admin_Page_Job extends CRM_Core_Page_Basic {
   public function run() {
     // set title and breadcrumb
     CRM_Utils_System::setTitle(ts('Settings - Scheduled Jobs'));
-    $breadCrumb = array(array(
-    'title' => ts('Scheduled Jobs'),
+    $breadCrumb = array(
+      array(
+        'title' => ts('Scheduled Jobs'),
         'url' => CRM_Utils_System::url('civicrm/admin',
           'reset=1'
         ),
-      ));
+      )
+    );
     CRM_Utils_System::appendBreadCrumb($breadCrumb);
 
     $this->_id = CRM_Utils_Request::retrieve('id', 'String',
index 0c9984b74a40ba2cbba0a62d4ff631962ddf2add..889e0699f2a67520a9a9b008658e6b3bc4fe8d6a 100644 (file)
@@ -78,12 +78,14 @@ class CRM_Admin_Page_JobLog extends CRM_Core_Page_Basic {
   public function run() {
     // set title and breadcrumb
     CRM_Utils_System::setTitle(ts('Settings - Scheduled Jobs Log'));
-    $breadCrumb = array(array(
-    'title' => ts('Administration'),
+    $breadCrumb = array(
+      array(
+        'title' => ts('Administration'),
         'url' => CRM_Utils_System::url('civicrm/admin',
           'reset=1'
         ),
-      ));
+      )
+    );
     CRM_Utils_System::appendBreadCrumb($breadCrumb);
     return parent::run();
   }
index 5321f75ab48ed0bf61ff65bc3f9a2654bd208ced..75f5a57effbf7677d89ad14cce589523e6fab40c 100644 (file)
@@ -165,7 +165,7 @@ class CRM_Admin_Page_MessageTemplates extends CRM_Core_Page_Basic {
 
       // rebuild the action links HTML, as we need to handle %%orig_id%% for revertible templates
       $values['action'] = CRM_Core_Action::formLink($links, $action, array(
-        'id' => $object->id,
+          'id' => $object->id,
           'orig_id' => CRM_Utils_Array::value($object->id, $this->_revertible),
         ),
         ts('more'),
index 418a69841f5b5702dad22549a094801064634007..252e3b4255788b2e7801216c610664fbfb61e540 100644 (file)
@@ -124,27 +124,34 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
     if (self::$_gName == 'acl_role') {
       CRM_Utils_System::setTitle(ts('Manage ACL Roles'));
       // set breadcrumb to append to admin/access
-      $breadCrumb = array(array(
-      'title' => ts('Access Control'),
+      $breadCrumb = array(
+        array(
+          'title' => ts('Access Control'),
           'url' => CRM_Utils_System::url('civicrm/admin/access',
             'reset=1'
           ),
-        ));
+        )
+      );
       CRM_Utils_System::appendBreadCrumb($breadCrumb);
     }
     else {
       CRM_Utils_System::setTitle(ts("%1 Options", array(1 => self::$_gLabel)));
     }
     if (in_array(self::$_gName,
-        array(
-          'from_email_address', 'email_greeting',
-          'postal_greeting', 'addressee',
-          'communication_style',
-          'case_status', 'encounter_medium',
-          'case_type', 'payment_instrument',
-          'soft_credit_type', 'website_type',
-        )
-      )) {
+      array(
+        'from_email_address',
+        'email_greeting',
+        'postal_greeting',
+        'addressee',
+        'communication_style',
+        'case_status',
+        'encounter_medium',
+        'case_type',
+        'payment_instrument',
+        'soft_credit_type',
+        'website_type',
+      )
+    )) {
       $this->assign('showIsDefault', TRUE);
     }
 
@@ -208,7 +215,8 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
             'url' => 'civicrm/contact/search/custom',
             'qs' => 'reset=1&csid=%%value%%',
             'title' => ts('Run %1', array(1 => self::$_gName)),
-          ));
+          )
+        );
         self::$_links = $runLink + self::$_links;
       }
     }
@@ -238,8 +246,8 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
     }
     $groupParams = array('name' => self::$_gName);
     $optionValue = CRM_Core_OptionValue::getRows($groupParams, $this->links(), 'component_id,weight');
-    $gName       = self::$_gName;
-    $returnURL   = CRM_Utils_System::url("civicrm/admin/options/$gName",
+    $gName = self::$_gName;
+    $returnURL = CRM_Utils_System::url("civicrm/admin/options/$gName",
       "reset=1&group=$gName"
     );
     $filter = "option_group_id = " . self::$_gId;
index 70fbc9daa54630ae7047d435a9e8b098bcc728c1..b4d931f6a18937a69086efdd04797113464f76b7 100644 (file)
@@ -87,7 +87,13 @@ class CRM_Admin_Page_ParticipantStatusType extends CRM_Core_Page_Basic {
     $visibilities = CRM_Core_PseudoConstant::visibility();
 
     // these statuses are reserved, but disabled by default - so should be disablable after being enabled
-    $disablable = array('On waitlist', 'Awaiting approval', 'Pending from waitlist', 'Pending from approval', 'Rejected');
+    $disablable = array(
+      'On waitlist',
+      'Awaiting approval',
+      'Pending from waitlist',
+      'Pending from approval',
+      'Rejected'
+    );
 
     while ($dao->fetch()) {
       CRM_Core_DAO::storeValues($dao, $statusTypes[$dao->id]);
index 6964e218ed4ad0b45a4b129b825b1b33cd4e6bb4..9734efbce220f10bed8d8e67b159c6ae2fa8e4ca 100644 (file)
@@ -105,14 +105,19 @@ class CRM_Admin_Page_PaymentProcessor extends CRM_Core_Page_Basic {
     // set title and breadcrumb
     CRM_Utils_System::setTitle(ts('Settings - Payment Processor'));
     //CRM-15546
-    $paymentProcessorTypes = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_PaymentProcessor', 'payment_processor_type_id', array('labelColumn' => 'name', 'flip' => 1));
+    $paymentProcessorTypes = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_PaymentProcessor', 'payment_processor_type_id', array(
+        'labelColumn' => 'name',
+        'flip' => 1
+      ));
     $this->assign('defaultPaymentProcessorType', $paymentProcessorTypes['PayPal']);
-    $breadCrumb = array(array(
-    'title' => ts('Administration'),
+    $breadCrumb = array(
+      array(
+        'title' => ts('Administration'),
         'url' => CRM_Utils_System::url('civicrm/admin',
-        'reset=1'
+          'reset=1'
         ),
-      ));
+      )
+    );
     CRM_Utils_System::appendBreadCrumb($breadCrumb);
     return parent::run();
   }
@@ -129,8 +134,8 @@ class CRM_Admin_Page_PaymentProcessor extends CRM_Core_Page_Basic {
     // get all custom groups sorted by weight
     $paymentProcessor = array();
     $dao = new CRM_Financial_DAO_PaymentProcessor();
-    $dao->is_test     = 0;
-    $dao->domain_id   = CRM_Core_Config::domainID();
+    $dao->is_test = 0;
+    $dao->domain_id = CRM_Core_Config::domainID();
     $dao->orderBy('name');
     $dao->find();
 
index deb7bd0c42c6afe2e159b3c3ba228ef365fc02c5..c5752a8ce014d48ad76c09679a52401a03ec106d 100644 (file)
@@ -200,7 +200,8 @@ class CRM_Badge_BAO_Badge {
     }
 
     if ((CRM_Utils_Array::value('height_image_1', $formattedRow) >
-      CRM_Utils_Array::value('height_image_2', $formattedRow)) && !empty($formattedRow['height_image_1'])) {
+        CRM_Utils_Array::value('height_image_2', $formattedRow)) && !empty($formattedRow['height_image_1'])
+    ) {
       $startOffset = CRM_Utils_Array::value('height_image_1', $formattedRow);
     }
     elseif (!empty($formattedRow['height_image_2'])) {
index 8b6d074d99e79e877114640517abbd63c85c435a..0559403951de10c9a72498135d729a6a5d8e0d6a 100644 (file)
@@ -40,6 +40,7 @@
 class CRM_Badge_Form_Layout extends CRM_Admin_Form {
 
   const FIELD_ROWCOUNT = 6;
+
   /**
    * Build the form object
    *
index 5019e9a1909d1e7f825c41d907404a471cf58063..a69a01578e20e97482d9f3143f4c1d8f6d12a350 100644 (file)
@@ -31,7 +31,6 @@
  * @copyright CiviCRM LLC (c) 2004-2014
  *
  */
-
 class CRM_Badge_Page_AJAX {
   public static function getImageProp() {
     $img = $_GET['img'];
index 56194b60bb7ac01341caffaa8f30fbc884b867fd..2b37cc3c3341051b5b95f99e15687550850d98fe 100755 (executable)
@@ -434,45 +434,45 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch {
     if ($context == 'financialBatch') {
       $links = array(
         'transaction' => array(
-          'name'  => ts('Transactions'),
-          'url'   => 'civicrm/batchtransaction',
-          'qs'    => 'reset=1&bid=%%id%%',
+          'name' => ts('Transactions'),
+          'url' => 'civicrm/batchtransaction',
+          'qs' => 'reset=1&bid=%%id%%',
           'title' => ts('View/Add Transactions to Batch'),
         ),
         'edit' => array(
-          'name'  => ts('Edit'),
-          'url'   => 'civicrm/financial/batch',
-          'qs'    => 'reset=1&action=update&id=%%id%%&context=1',
+          'name' => ts('Edit'),
+          'url' => 'civicrm/financial/batch',
+          'qs' => 'reset=1&action=update&id=%%id%%&context=1',
           'title' => ts('Edit Batch'),
         ),
         'close' => array(
-          'name'  => ts('Close'),
+          'name' => ts('Close'),
           'title' => ts('Close Batch'),
-          'url'   => '#',
+          'url' => '#',
           'extra' => 'rel="close"',
         ),
         'export' => array(
-          'name'  => ts('Export'),
+          'name' => ts('Export'),
           'title' => ts('Export Batch'),
-          'url'   => '#',
+          'url' => '#',
           'extra' => 'rel="export"',
         ),
         'reopen' => array(
-          'name'  => ts('Re-open'),
+          'name' => ts('Re-open'),
           'title' => ts('Re-open Batch'),
-          'url'   => '#',
+          'url' => '#',
           'extra' => 'rel="reopen"',
         ),
         'delete' => array(
-          'name'  => ts('Delete'),
+          'name' => ts('Delete'),
           'title' => ts('Delete Batch'),
-          'url'   => '#',
+          'url' => '#',
           'extra' => 'rel="delete"',
         ),
         'download' => array(
-          'name'  => ts('Download'),
-          'url'   => 'civicrm/file',
-          'qs'    => 'reset=1&id=%%fid%%&eid=%%eid%%',
+          'name' => ts('Download'),
+          'url' => 'civicrm/file',
+          'qs' => 'reset=1&id=%%fid%%&eid=%%eid%%',
           'title' => ts('Download Batch'),
         ),
       );
@@ -526,7 +526,6 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch {
   }
 
 
-
   /**
    * Calculate sum of all entries in a batch
    * Used to validate and update item_count and total when closing an accounting batch
@@ -554,8 +553,8 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch {
   /**
    * Format markup for comparing two totals
    *
-   * @param $actual: calculated total
-   * @param $expected: user-entered total
+   * @param $actual : calculated total
+   * @param $expected : user-entered total
    * @return array
    */
   public static function displayTotals($actual, $expected) {
index ce8e5d04d463f0d139bca85185558224851bfd96..165ec1114d0554b3272329840c3c5c13d412129a 100755 (executable)
@@ -84,6 +84,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form {
    * @var array
    */
   public $_fields = array();
+
   /**
    * Build all the data structures needed to build the form
    *
@@ -105,10 +106,10 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form {
       $this->_profileId = CRM_Batch_BAO_Batch::getProfileId($this->_batchInfo['type_id']);
     }
     CRM_Core_Resources::singleton()
-    ->addScriptFile('civicrm', 'templates/CRM/Batch/Form/Entry.js', 1, 'html-header')
-    ->addSetting(array('batch' => array('type_id' => $this->_batchInfo['type_id'])))
-    ->addSetting(array('setting' => array('monetaryThousandSeparator' => CRM_Core_Config::singleton()->monetaryThousandSeparator)))
-    ->addSetting(array('setting' => array('monetaryDecimalPoint' => CRM_Core_Config::singleton()->monetaryDecimalPoint)));
+      ->addScriptFile('civicrm', 'templates/CRM/Batch/Form/Entry.js', 1, 'html-header')
+      ->addSetting(array('batch' => array('type_id' => $this->_batchInfo['type_id'])))
+      ->addSetting(array('setting' => array('monetaryThousandSeparator' => CRM_Core_Config::singleton()->monetaryThousandSeparator)))
+      ->addSetting(array('setting' => array('monetaryDecimalPoint' => CRM_Core_Config::singleton()->monetaryDecimalPoint)));
 
   }
 
@@ -187,7 +188,9 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form {
 
     $fileFieldExists = FALSE;
     $preserveDefaultsArray = array(
-      'first_name', 'last_name', 'middle_name',
+      'first_name',
+      'last_name',
+      'middle_name',
       'organization_name',
       'household_name',
     );
@@ -197,7 +200,10 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form {
     $config = CRM_Core_Config::singleton();
 
     for ($rowNumber = 1; $rowNumber <= $this->_batchInfo['item_count']; $rowNumber++) {
-      $this->addEntityRef("primary_contact_id[{$rowNumber}]", '', array('create' => TRUE, 'placeholder' => ts('- select -')));
+      $this->addEntityRef("primary_contact_id[{$rowNumber}]", '', array(
+          'create' => TRUE,
+          'placeholder' => ts('- select -')
+        ));
 
       // special field specific to membership batch udpate
       if ($this->_batchInfo['type_id'] == 2) {
@@ -243,11 +249,12 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form {
 
     $this->assign('fields', $this->_fields);
     CRM_Core_Resources::singleton()
-    ->addSetting(array(
-    'contact' => array(
-      'return' => implode(',', $contactReturnProperties),
-      'fieldmap' => array_flip($contactReturnProperties),
-    )));
+      ->addSetting(array(
+        'contact' => array(
+          'return' => implode(',', $contactReturnProperties),
+          'fieldmap' => array_flip($contactReturnProperties),
+        )
+      ));
 
     // don't set the status message when form is submitted.
     $buttonName = $this->controller->getButtonName('submit');
@@ -810,7 +817,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form {
           $domainEmail = "$domainEmail[0] <$domainEmail[1]>";
 
           $value['from_email_address'] = $domainEmail;
-          $value['membership_id']      = $membership->id;
+          $value['membership_id'] = $membership->id;
           $value['contribution_id'] = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipPayment', $membership->id, 'contribution_id', 'membership_id');
           CRM_Member_Form_Membership::emailReceipt($this, $value, $membership);
         }
index 57d01df038de202400105534a52f25d9821faf54..98263c5f9aba4da27f5229e8738d2f6609101ae7 100644 (file)
@@ -64,16 +64,16 @@ class CRM_Batch_Page_AJAX {
       5 => '',
     );
 
-    $sEcho     = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
-    $offset    =
+    $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
+    $offset =
       isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
-    $rowCount  =
+    $rowCount =
       isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
-    $sort      =
+    $sort =
       isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : NULL;
     $sortOrder =
       isset($_REQUEST['sSortDir_0']) ? CRM_Utils_Type::escape($_REQUEST['sSortDir_0'], 'String') : 'asc';
-    $context   =
+    $context =
       isset($_REQUEST['context']) ? CRM_Utils_Type::escape($_REQUEST['context'], 'String') : NULL;
 
     $params = $_REQUEST;
index 86461962300e72d59b6af109f32b50058f5fcf84..843ddced70c3044a14465906e2672118c33684c9 100644 (file)
@@ -61,9 +61,9 @@ class CRM_Bridge_OG_CiviCRM {
     }
 
     global $user;
-    $node->uid    = $user->uid;
-    $node->title  = $group->title;
-    $node->type   = 'og';
+    $node->uid = $user->uid;
+    $node->title = $group->title;
+    $node->type = 'og';
     $node->status = 1;
 
     // set the og values
index f6f4cd3cf13df98170188e406c4b76f5365c81e2..3acaeb810ae37214d20a006e9bd2e1d69a61a0d0 100644 (file)
@@ -75,9 +75,9 @@ class CRM_Bridge_OG_Drupal {
    * @param null $groupType
    */
   public static function updateCiviGroup(&$params, $op, $groupType = NULL) {
-    $abort             = FALSE;
+    $abort = FALSE;
     $params['version'] = 3;
-    $params['id']      = CRM_Bridge_OG_Utils::groupID($params['source'], $params['title'], $abort);
+    $params['id'] = CRM_Bridge_OG_Utils::groupID($params['source'], $params['title'], $abort);
 
     if ($op == 'add') {
       if ($groupType) {
@@ -156,7 +156,7 @@ SELECT v.id
    AND v.description     = %2
 ";
     $queryParams = array(
-    1 => array($optionGroupID, 'Integer'),
+      1 => array($optionGroupID, 'Integer'),
       2 => array($params['source'], 'String'),
     );
     $dao->id = CRM_Core_DAO::singleValueQuery($query, $queryParams);
@@ -204,8 +204,8 @@ SELECT v.id
     $dao->find(TRUE);
 
     $dao->entity_table = 'civicrm_acl_role';
-    $dao->entity_id    = $params['acl_role_id'];
-    $dao->operation    = 'Edit';
+    $dao->entity_id = $params['acl_role_id'];
+    $dao->operation = 'Edit';
 
     $dao->is_active = TRUE;
     $dao->save();
index 8fa0bcae4a81db8761dfa6d7c808af2aa36f2ef0..a573d57c9ec02e4d4bc03698d530d8903291c882 100644 (file)
@@ -78,11 +78,11 @@ class CRM_Campaign_BAO_Campaign extends CRM_Campaign_DAO_Campaign {
 
     if (isset($params['groups']) && !empty($params['groups']['include']) && is_array($params['groups']['include'])) {
       foreach ($params['groups']['include'] as $entityId) {
-        $dao               = new CRM_Campaign_DAO_CampaignGroup();
-        $dao->campaign_id  = $campaign->id;
+        $dao = new CRM_Campaign_DAO_CampaignGroup();
+        $dao->campaign_id = $campaign->id;
         $dao->entity_table = $groupTableName;
-        $dao->entity_id    = $entityId;
-        $dao->group_type   = 'Include';
+        $dao->entity_id = $entityId;
+        $dao->group_type = 'Include';
         $dao->save();
         $dao->free();
       }
@@ -167,8 +167,12 @@ class CRM_Campaign_BAO_Campaign extends CRM_Campaign_DAO_Campaign {
     static $campaigns;
     $cacheKey = 0;
     $cacheKeyParams = array(
-      'includeId', 'excludeId', 'onlyActive',
-      'onlyCurrent', 'appendDatesToTitle', 'forceAll',
+      'includeId',
+      'excludeId',
+      'onlyActive',
+      'onlyCurrent',
+      'appendDatesToTitle',
+      'forceAll',
     );
     foreach ($cacheKeyParams as $param) {
       $cacheParam = $$param;
@@ -248,8 +252,14 @@ Order By  camp.title";
   ) {
     $cacheKey = 0;
     $cachekeyParams = array(
-      'includeId', 'excludeId', 'onlyActive', 'onlyCurrent',
-      'appendDatesToTitle', 'doCheckForComponent', 'doCheckForPermissions', 'forceAll',
+      'includeId',
+      'excludeId',
+      'onlyActive',
+      'onlyCurrent',
+      'appendDatesToTitle',
+      'doCheckForComponent',
+      'doCheckForPermissions',
+      'forceAll',
     );
     foreach ($cachekeyParams as $param) {
       $cacheKeyParam = $$param;
@@ -263,7 +273,7 @@ Order By  camp.title";
     if (!isset($validCampaigns[$cacheKey])) {
       $isValid = TRUE;
       $campaigns = array(
-      'campaigns' => array(),
+        'campaigns' => array(),
         'hasAccessCampaign' => FALSE,
         'isCampaignEnabled' => FALSE,
       );
@@ -378,13 +388,13 @@ INNER JOIN civicrm_option_group grp ON ( campaign_type.option_group_id = grp.id
       $queryParams[3] = array('%' . trim($params['title']) . '%', 'String');
     }
     if (!empty($params['start_date'])) {
-      $startDate      = CRM_Utils_Date::processDate($params['start_date']);
-      $where[]        = "( campaign.start_date >= %4 OR campaign.start_date IS NULL )";
+      $startDate = CRM_Utils_Date::processDate($params['start_date']);
+      $where[] = "( campaign.start_date >= %4 OR campaign.start_date IS NULL )";
       $queryParams[4] = array($startDate, 'String');
     }
     if (!empty($params['end_date'])) {
-      $endDate        = CRM_Utils_Date::processDate($params['end_date'], '235959');
-      $where[]        = "( campaign.end_date <= %5 OR campaign.end_date IS NULL )";
+      $endDate = CRM_Utils_Date::processDate($params['end_date'], '235959');
+      $where[] = "( campaign.end_date <= %5 OR campaign.end_date IS NULL )";
       $queryParams[5] = array($endDate, 'String');
     }
     if (!empty($params['description'])) {
@@ -635,9 +645,9 @@ INNER JOIN  civicrm_group grp ON ( grp.id = campgrp.entity_id )
    * @param string $elementName
    */
   public static function addCampaignInComponentSearch(&$form, $elementName = 'campaign_id') {
-    $campaignInfo    = array();
+    $campaignInfo = array();
     $campaignDetails = self::getPermissionedCampaigns(NULL, NULL, FALSE, FALSE, FALSE, TRUE);
-    $fields          = array('campaigns', 'hasAccessCampaign', 'isCampaignEnabled');
+    $fields = array('campaigns', 'hasAccessCampaign', 'isCampaignEnabled');
     foreach ($fields as $fld) {
       $$fld = CRM_Utils_Array::value($fld, $campaignDetails);
     }
@@ -645,8 +655,8 @@ INNER JOIN  civicrm_group grp ON ( grp.id = campgrp.entity_id )
     if ($isCampaignEnabled && $hasAccessCampaign && !empty($campaigns)) {
       //get the current campaign only.
       $currentCampaigns = self::getCampaigns(NULL, NULL, FALSE);
-      $pastCampaigns    = array_diff($campaigns, $currentCampaigns);
-      $allCampaigns     = array();
+      $pastCampaigns = array_diff($campaigns, $currentCampaigns);
+      $allCampaigns = array();
       if (!empty($currentCampaigns)) {
         $allCampaigns = array('crm_optgroup_current_campaign' => ts('Current Campaigns')) + $currentCampaigns;
       }
index 9ab392da249ffd8a21f6c0ebbf8939673ae34a64..c4d6594187b69bbfbc947919fc5970129e068a63 100755 (executable)
@@ -90,7 +90,7 @@ class CRM_Campaign_BAO_Query {
     // CRM-13810 Translate campaign_id to label for search builder
     // CRM-14238 Only translate when we are in contact mode
     // Other modes need the untranslated data for export and other functions
-    if (is_array($query->_select)  && $query->_mode == CRM_Contact_BAO_Query::MODE_CONTACTS) {
+    if (is_array($query->_select) && $query->_mode == CRM_Contact_BAO_Query::MODE_CONTACTS) {
       foreach ($query->_select as $field => $queryString) {
         if (substr($field, -11) == 'campaign_id') {
           $query->_pseudoConstantsSelect[$field] = array(
@@ -241,8 +241,8 @@ class CRM_Campaign_BAO_Query {
 
       case self::CIVICRM_ACTIVITY:
         $surveyActivityTypes = CRM_Campaign_PseudoConstant::activityType();
-        $surveyKeys          = "(" . implode(',', array_keys($surveyActivityTypes)) . ")";
-        $from                = " INNER JOIN civicrm_activity ON ( civicrm_activity.id = civicrm_activity_target.activity_id
+        $surveyKeys = "(" . implode(',', array_keys($surveyActivityTypes)) . ")";
+        $from = " INNER JOIN civicrm_activity ON ( civicrm_activity.id = civicrm_activity_target.activity_id
                                  AND civicrm_activity.activity_type_id IN $surveyKeys ) ";
         break;
 
@@ -409,7 +409,9 @@ INNER JOIN  civicrm_custom_group grp on fld.custom_group_id = grp.id
     $customSearchFields = array();
     while ($dao->fetch()) {
       foreach (array(
-        'ward', 'precinct') as $name) {
+                 'ward',
+                 'precinct'
+               ) as $name) {
         if (stripos($name, $dao->label) !== FALSE) {
           $fieldId = $dao->id;
           $fieldName = 'custom_' . $dao->id;
@@ -467,7 +469,7 @@ INNER JOIN  civicrm_custom_group grp on fld.custom_group_id = grp.id
     if (!is_array($params) || empty($params)) {
       return $voterClause;
     }
-    $surveyId       = CRM_Utils_Array::value('campaign_survey_id', $params);
+    $surveyId = CRM_Utils_Array::value('campaign_survey_id', $params);
     $searchVoterFor = CRM_Utils_Array::value('campaign_search_voter_for', $params);
 
     //get the survey activities.
@@ -510,8 +512,8 @@ INNER JOIN  civicrm_custom_group grp on fld.custom_group_id = grp.id
               $values['status_id'] == $completedStatusId
             ) {
               $recontactIntSeconds = $numOfDays * 24 * 3600;
-              $actDateTimeSeconds  = CRM_Utils_Date::unixTime($values['activity_date_time']);
-              $totalSeconds        = $recontactIntSeconds + $actDateTimeSeconds;
+              $actDateTimeSeconds = CRM_Utils_Date::unixTime($values['activity_date_time']);
+              $totalSeconds = $recontactIntSeconds + $actDateTimeSeconds;
               //don't consider completed survey activity
               //unless it fulfill recontact interval criteria.
               if ($totalSeconds <= time()) {
@@ -576,10 +578,10 @@ INNER JOIN  civicrm_custom_group grp on fld.custom_group_id = grp.id
    *
    **/
   public static function componentSearchClause(&$params, &$query) {
-    $op        = CRM_Utils_Array::value('op', $params, '=');
-    $campaign  = CRM_Utils_Array::value('campaign', $params);
+    $op = CRM_Utils_Array::value('op', $params, '=');
+    $campaign = CRM_Utils_Array::value('campaign', $params);
     $tableName = CRM_Utils_Array::value('tableName', $params);
-    $grouping  = CRM_Utils_Array::value('grouping', $params);
+    $grouping = CRM_Utils_Array::value('grouping', $params);
     if (CRM_Utils_System::isNull($campaign) || empty($tableName)) {
       return;
     }
@@ -588,7 +590,9 @@ INNER JOIN  civicrm_custom_group grp on fld.custom_group_id = grp.id
     // an integer, not an array
     if (is_array($campaign)) {
       foreach (array(
-        'current_campaign', 'past_campaign') as $ignore) {
+                 'current_campaign',
+                 'past_campaign'
+               ) as $ignore) {
         $index = array_search($ignore, $campaign);
         if ($index !== FALSE) {
           unset($campaign[$index]);
@@ -619,8 +623,8 @@ INNER JOIN  civicrm_custom_group grp on fld.custom_group_id = grp.id
       }
     }
     $query->_qill[$grouping][] = ts('Campaigns %1',
-      array(1 => $op)
-    ) . ' ' . implode(' ' . ts('or') . ' ', $campaignTitles);
+        array(1 => $op)
+      ) . ' ' . implode(' ' . ts('or') . ' ', $campaignTitles);
     $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause("{$tableName}.campaign_id",
       $op,
       $campaignIds,
index ce1221c03d614bc333373d31e4beb7e4fad055de..db05a074759be57092685290447639dde7214ae8 100644 (file)
@@ -217,8 +217,16 @@ SELECT  survey.id                         as id,
 
     $surveys = array();
     $properties = array(
-      'id', 'title', 'campaign_id', 'is_active', 'is_default', 'result_id', 'activity_type_id',
-      'release_frequency', 'max_number_of_contacts', 'default_number_of_contacts',
+      'id',
+      'title',
+      'campaign_id',
+      'is_active',
+      'is_default',
+      'result_id',
+      'activity_type_id',
+      'release_frequency',
+      'max_number_of_contacts',
+      'default_number_of_contacts',
     );
 
     $survey = CRM_Core_DAO::executeQuery($query, $queryParams);
@@ -438,18 +446,20 @@ SELECT  survey.id    as id,
         'contact_autocomplete_options'
       );
       $returnProperties = array_fill_keys(array_merge(array(
-        'contact_type',
-            'contact_sub_type',
-            'sort_name',
-          ),
-          array_keys($autocompleteContactSearch)
-        ), 1);
+          'contact_type',
+          'contact_sub_type',
+          'sort_name',
+        ),
+        array_keys($autocompleteContactSearch)
+      ), 1);
     }
 
     $select = $from = array();
     foreach ($returnProperties as $property => $ignore) {
       $value = (in_array($property, array(
-        'city', 'street_address'))) ? 'address' : $property;
+        'city',
+        'street_address'
+      ))) ? 'address' : $property;
       switch ($property) {
         case 'sort_name':
         case 'contact_type':
@@ -479,9 +489,9 @@ SELECT  survey.id    as id,
 
     //finally retrieve contact details.
     if (!empty($select) && !empty($from)) {
-      $fromClause   = implode(' ', $from);
+      $fromClause = implode(' ', $from);
       $selectClause = implode(', ', $select);
-      $whereClause  = "contact.id IN (" . implode(',', $voterIds) . ')';
+      $whereClause = "contact.id IN (" . implode(',', $voterIds) . ')';
 
       $query = "
   SELECT  contact.id as contactId, $selectClause
@@ -524,7 +534,7 @@ Group By  contact.id";
    */
   static function voterActivityDetails(
     $surveyId, $voterIds, $interviewerId = NULL,
-                                       $statusIds = array()) {
+    $statusIds = array()) {
     $activityDetails = array();
     if (!$surveyId ||
       !is_array($voterIds) || empty($voterIds)
@@ -653,7 +663,7 @@ INNER JOIN  civicrm_contact contact_a ON ( activityTarget.contact_id = contact_a
             $whereClause";
 
     $params = array(
-    1 => array($surveyId, 'Integer'),
+      1 => array($surveyId, 'Integer'),
       2 => array($actTypeId, 'Integer'),
     );
 
@@ -731,8 +741,8 @@ INNER JOIN  civicrm_contact contact_a ON ( activityTarget.contact_id = contact_a
     $resultSets = array();
     $valueColumnName = CRM_Utils_Type::escape($valueColumnName, 'String');
 
-    $query      = "SELECT id, {$valueColumnName} FROM civicrm_option_group WHERE name LIKE 'civicrm_survey_%' AND is_active=1";
-    $dao        = CRM_Core_DAO::executeQuery($query);
+    $query = "SELECT id, {$valueColumnName} FROM civicrm_option_group WHERE name LIKE 'civicrm_survey_%' AND is_active=1";
+    $dao = CRM_Core_DAO::executeQuery($query);
     while ($dao->fetch()) {
       $resultSets[$dao->id] = $dao->$valueColumnName;
     }
@@ -847,11 +857,11 @@ INNER JOIN  civicrm_contact contact_a ON ( activityTarget.contact_id = contact_a
       if ($reportID) {
         $voterLinks['report'] =
           array(
-                'name' => 'report',
-                'url'  => "civicrm/report/instance/{$reportID}",
-                'qs'   => 'reset=1',
-                'title' => ts('View Survey Report'),
-                );
+            'name' => 'report',
+            'url' => "civicrm/report/instance/{$reportID}",
+            'qs' => 'reset=1',
+            'title' => ts('View Survey Report'),
+          );
       }
     }
 
@@ -1140,8 +1150,8 @@ UPDATE  civicrm_activity
    * @see CRM_Core_DAO::buildOptions
    *
    * @param string $fieldName
-   * @param string $context: @see CRM_Core_DAO::buildOptionsContext
-   * @param array $props: whatever is known about this dao object
+   * @param string $context : @see CRM_Core_DAO::buildOptionsContext
+   * @param array $props : whatever is known about this dao object
    *
    * @return array|bool
    */
index 75efaab469e44f0f61f7f96a6ec1dca4f78b0746..f0d87aa467d89455336023c63791a2171d27fca5 100644 (file)
@@ -35,4 +35,5 @@
  * $Id$
  *
  */
-class CRM_Campaign_Config extends CRM_Core_Component_Config {}
+class CRM_Campaign_Config extends CRM_Core_Component_Config {
+}
index ae7673791d776bd9279b80859da874fb4f7a0399..937fc03ae577a4d88e17592385c8af7b5326acd2 100644 (file)
@@ -147,20 +147,20 @@ class CRM_Campaign_Form_Campaign extends CRM_Core_Form {
     if (isset($defaults['start_date'])) {
       list($defaults['start_date'],
         $defaults['start_date_time']
-      ) = CRM_Utils_Date::setDateDefaults($defaults['start_date'],
+        ) = CRM_Utils_Date::setDateDefaults($defaults['start_date'],
         'activityDateTime'
       );
     }
     else {
       list($defaults['start_date'],
         $defaults['start_date_time']
-      ) = CRM_Utils_Date::setDateDefaults();
+        ) = CRM_Utils_Date::setDateDefaults();
     }
 
     if (isset($defaults['end_date'])) {
       list($defaults['end_date'],
         $defaults['end_date_time']
-      ) = CRM_Utils_Date::setDateDefaults($defaults['end_date'],
+        ) = CRM_Utils_Date::setDateDefaults($defaults['end_date'],
         'activityDateTime'
       );
     }
@@ -267,8 +267,8 @@ class CRM_Campaign_Form_Campaign extends CRM_Core_Form {
     $this->addWysiwyg('goal_general', ts('Campaign Goals'), array('rows' => 2, 'cols' => 40));
     $this->add('text', 'goal_revenue', ts('Revenue Goal'), array('size' => 8, 'maxlength' => 12));
     $this->addRule('goal_revenue', ts('Please enter a valid money value (e.g. %1).',
-        array(1 => CRM_Utils_Money::format('99.99', ' '))
-      ), 'money');
+      array(1 => CRM_Utils_Money::format('99.99', ' '))
+    ), 'money');
 
     // is this Campaign active
     $this->addElement('checkbox', 'is_active', ts('Is Active?'));
@@ -351,9 +351,9 @@ class CRM_Campaign_Form_Campaign extends CRM_Core_Form {
     $params['groups'] = $groups;
 
     // delete previous includes/excludes, if campaign already existed
-    $groupTableName    = CRM_Contact_BAO_Group::getTableName();
-    $dao               = new CRM_Campaign_DAO_CampaignGroup();
-    $dao->campaign_id  = $this->_campaignId;
+    $groupTableName = CRM_Contact_BAO_Group::getTableName();
+    $dao = new CRM_Campaign_DAO_CampaignGroup();
+    $dao->campaign_id = $this->_campaignId;
     $dao->entity_table = $groupTableName;
     $dao->find();
     while ($dao->fetch()) {
index 418d7a12a7dcff44d072f8890756f4d05c080bb3..86ee1ccda2797998fc5c5724a622523850397a91 100644 (file)
@@ -37,7 +37,6 @@
  * This class generates form components for adding a petition
  *
  */
-
 class CRM_Campaign_Form_Petition extends CRM_Core_Form {
 
   /**
@@ -200,7 +199,8 @@ class CRM_Campaign_Form_Petition extends CRM_Core_Form {
     // custom group id
     $this->add('select', 'contact_profile_id', ts('Contact Profile'),
       array(
-        '' => ts('- select -')) + $customContactProfiles, TRUE
+        '' => ts('- select -')
+      ) + $customContactProfiles, TRUE
     );
 
     $customProfiles = CRM_Core_BAO_UFGroup::getProfiles(array('Activity'));
index a948de77d82c35a338afae93aad1f5495c4a90dd..b694f76ae68a72b7837f1a27334f612ec69557c3 100644 (file)
@@ -59,7 +59,7 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form {
   /**
    * The contact type
    *
-     * @var string ("Individual"/"Household"/"Organization"). Never been tested for something else than Individual
+   * @var string ("Individual"/"Household"/"Organization"). Never been tested for something else than Individual
    */
   protected $_ctype = 'Individual';
 
@@ -400,9 +400,9 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form {
       $ids = CRM_Dedupe_Finder::dupesByParams($dedupeParams, $params['contact_type']);
     }
 
-        $petition_params['id'] = $this->_surveyId;
-        $petition = array();
-        CRM_Campaign_BAO_Survey::retrieve($petition_params, $petition);
+    $petition_params['id'] = $this->_surveyId;
+    $petition = array();
+    CRM_Campaign_BAO_Survey::retrieve($petition_params, $petition);
 
     switch (count($ids)) {
       case 0:
@@ -417,10 +417,10 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form {
           $params['statusId'] = 2;
         }
         else {
-        $this->_sendEmailMode = self::EMAIL_CONFIRM;
+          $this->_sendEmailMode = self::EMAIL_CONFIRM;
 
-        // Set status for signature activity to scheduled until email is verified
-        $params['statusId'] = 1;
+          // Set status for signature activity to scheduled until email is verified
+          $params['statusId'] = 1;
         }
         break;
 
@@ -440,9 +440,9 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form {
 
         // dedupe matched single contact, check for 'unconfirmed' tag
         if ($tag_name) {
-          $tag            = new CRM_Core_DAO_EntityTag();
+          $tag = new CRM_Core_DAO_EntityTag();
           $tag->entity_id = $this->_contactId;
-          $tag->tag_id    = $this->_tagId;
+          $tag->tag_id = $this->_tagId;
 
           if (!($tag->find())) {
             // send thank you email directly, the user is known and validated
@@ -476,9 +476,9 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form {
         }
 
         if ($tag_name) {
-          $tag            = new CRM_Core_DAO_EntityTag();
+          $tag = new CRM_Core_DAO_EntityTag();
           $tag->entity_id = $this->_contactId;
-          $tag->tag_id    = $this->_tagId;
+          $tag->tag_id = $this->_tagId;
 
           if (!($tag->find())) {
             // send thank you email
@@ -497,7 +497,6 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form {
     }
 
 
-
     $transaction = new CRM_Core_Transaction();
 
     $addToGroupID = isset($this->_addToGroupID) ? $this->_addToGroupID : NULL;
@@ -658,7 +657,8 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form {
     if (isset($this->thankyou)) {
       return ('CRM/Campaign/Page/Petition/ThankYou.tpl');
     }
-    else {}
+    else {
+    }
     return parent::getTemplateFileName();
   }
 
index 7cb09b82ff8fee8f1058f904f688b9c4f2312247..a36fb93d6d35d643104b83dc2ceac7b9b8e2fc2a 100755 (executable)
@@ -85,16 +85,20 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form_Search {
 
     //we allow the controller to set force/reset externally,
     //useful when we are being driven by the wizard framework
-    $this->_limit   = CRM_Utils_Request::retrieve('limit', 'Positive', $this);
-    $this->_force   = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE);
+    $this->_limit = CRM_Utils_Request::retrieve('limit', 'Positive', $this);
+    $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE);
     $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'search');
-    $this->_reset   = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
+    $this->_reset = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
 
     //operation for state machine.
     $this->_operation = CRM_Utils_Request::retrieve('op', 'String', $this, FALSE, 'reserve');
     //validate operation.
     if (!in_array($this->_operation, array(
-      'reserve', 'release', 'interview'))) {
+      'reserve',
+      'release',
+      'interview'
+    ))
+    ) {
       $this->_operation = 'reserve';
       $this->set('op', $this->_operation);
     }
@@ -228,7 +232,8 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form_Search {
         $taskValue = array(
           $currentTaskValue => ts('Record %1 Responses',
             array(1 => $activityTypes[$surveyTypeId])
-          ));
+          )
+        );
       }
 
       $this->addTaskMenu($taskValue);
@@ -350,7 +355,10 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form_Search {
     //apply filter of survey contact type for search.
     $contactType = CRM_Campaign_BAO_Survey::getSurveyContactType(CRM_Utils_Array::value('campaign_survey_id', $this->_formValues));
     if ($contactType && in_array($this->_operation, array(
-      'reserve', 'interview'))) {
+        'reserve',
+        'interview'
+      ))
+    ) {
       $this->_formValues['contact_type'][$contactType] = 1;
     }
 
@@ -367,7 +375,9 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form_Search {
         $groups = CRM_Utils_Array::value('group', $this->_formValues);
         if ($campaignId && CRM_Utils_System::isNull($groups)) {
           $campGroups = CRM_Campaign_BAO_Campaign::getCampaignGroups($campaignId);
-          foreach ($campGroups as $id => $title) $this->_formValues['group'][$id] = 1;
+          foreach ($campGroups as $id => $title) {
+            $this->_formValues['group'][$id] = 1;
+          }
         }
 
         //carry servey id w/ this.
index 971acddc33e9e6c9811000d1d4581b5b31bed497..c210b70c95792aed240b7c248f8e6bb0c318fb19 100755 (executable)
@@ -51,8 +51,8 @@ class CRM_Campaign_Form_Search_Campaign extends CRM_Core_Form {
    * @return void
    */
   function preProcess() {
-    $this->_search    = CRM_Utils_Array::value('search', $_GET);
-    $this->_force     = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE, FALSE);
+    $this->_search = CRM_Utils_Array::value('search', $_GET);
+    $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE, FALSE);
     $this->_searchTab = CRM_Utils_Request::retrieve('type', 'String', $this, FALSE, 'campaign');
 
     //when we do load tab, lets load the default objects.
@@ -95,7 +95,8 @@ class CRM_Campaign_Form_Search_Campaign extends CRM_Core_Form {
     $campaignTypes = CRM_Campaign_PseudoConstant::campaignType();
     $this->add('select', 'campaign_type_id', ts('Campaign Type'),
       array(
-        '' => ts('- select -')) + $campaignTypes
+        '' => ts('- select -')
+      ) + $campaignTypes
     );
 
     $this->set('campaignTypes', $campaignTypes);
@@ -105,7 +106,8 @@ class CRM_Campaign_Form_Search_Campaign extends CRM_Core_Form {
     $campaignStatus = CRM_Campaign_PseudoConstant::campaignStatus();
     $this->addElement('select', 'status_id', ts('Campaign Status'),
       array(
-        '' => ts('- select -')) + $campaignStatus
+        '' => ts('- select -')
+      ) + $campaignStatus
     );
     $this->set('campaignStatus', $campaignStatus);
     $this->assign('campaignStatus', json_encode($campaignStatus));
index 975cca62b1d634c7cf62781d849d9ec177f64d01..98becd18f21234d4fc2aac45514663cfcbdf75e2 100755 (executable)
@@ -51,8 +51,8 @@ class CRM_Campaign_Form_Search_Petition extends CRM_Core_Form {
    * @return void
    */
   function preProcess() {
-    $this->_search    = CRM_Utils_Array::value('search', $_GET);
-    $this->_force     = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE, FALSE);
+    $this->_search = CRM_Utils_Array::value('search', $_GET);
+    $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE, FALSE);
     $this->_searchTab = CRM_Utils_Request::retrieve('type', 'String', $this, FALSE, 'petition');
 
     //when we do load tab, lets load the default objects.
index 044ba72e00769f356c0aa9826643e3fdef80192f..0b6195b2ec1334f4f8c069b2a8b3036ad1d0d0b8 100755 (executable)
@@ -51,8 +51,8 @@ class CRM_Campaign_Form_Search_Survey extends CRM_Core_Form {
    * @return void
    */
   function preProcess() {
-    $this->_search    = CRM_Utils_Array::value('search', $_GET);
-    $this->_force     = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE, FALSE);
+    $this->_search = CRM_Utils_Array::value('search', $_GET);
+    $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE, FALSE);
     $this->_searchTab = CRM_Utils_Request::retrieve('type', 'String', $this, FALSE, 'survey');
 
     //when we do load tab, lets load the default objects.
@@ -86,7 +86,8 @@ class CRM_Campaign_Form_Search_Survey extends CRM_Core_Form {
     $surveyTypes = CRM_Campaign_BAO_Survey::getSurveyActivityType();
     $this->add('select', 'activity_type_id',
       ts('Activity Type'), array(
-        '' => ts('- select -')) + $surveyTypes
+        '' => ts('- select -')
+      ) + $surveyTypes
     );
     $this->set('surveyTypes', $surveyTypes);
     $this->assign('surveyTypes', json_encode($surveyTypes));
index a3357b49a34607ef36c0e47934dfee7cf040b8d0..4d6e5075f41df2aa0a85c92924ca79015ea999fb 100644 (file)
@@ -65,7 +65,7 @@ class CRM_Campaign_Form_Survey extends CRM_Core_Form {
       CRM_Utils_System::permissionDenied();
     }
 
-    $this->_action   = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add', 'REQUEST');
+    $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add', 'REQUEST');
     $this->_surveyId = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE);
 
     if ($this->_surveyId) {
@@ -130,9 +130,9 @@ class CRM_Campaign_Form_Survey extends CRM_Core_Form {
     }
     $buttons[] =
       array(
-            'type' => 'cancel',
-            'name' => ts('Cancel'),
-            );
+        'type' => 'cancel',
+        'name' => ts('Cancel'),
+      );
     $this->addButtons($buttons);
 
     $url = CRM_Utils_System::url('civicrm/campaign', 'reset=1&subPage=survey');
@@ -146,14 +146,14 @@ class CRM_Campaign_Form_Survey extends CRM_Core_Form {
       if ($tabTitle == 'Main') {
         $tabTitle = 'Main settings';
       }
-      $subPage   = strtolower($className);
+      $subPage = strtolower($className);
       CRM_Core_Session::setStatus(ts("'%1' have been saved.", array(1 => $tabTitle)), ts('Saved'), 'success');
 
       $this->postProcessHook();
 
       if ($this->_action & CRM_Core_Action::ADD)
         CRM_Utils_System::redirect(CRM_Utils_System::url("civicrm/survey/configure/questions",
-                                                         "action=update&reset=1&id={$this->_surveyId}"));
+          "action=update&reset=1&id={$this->_surveyId}"));
 
       if ($this->controller->getButtonName('submit') == "_qf_{$className}_upload_done") {
         CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/campaign', 'reset=1&subPage=survey'));
@@ -161,11 +161,11 @@ class CRM_Campaign_Form_Survey extends CRM_Core_Form {
       elseif ($this->controller->getButtonName('submit') == "_qf_{$className}_upload_next") {
         $subPage = CRM_Campaign_Form_Survey_TabHeader::getNextTab($this);
         CRM_Utils_System::redirect(CRM_Utils_System::url("civicrm/survey/configure/{$subPage}",
-                                                         "action=update&reset=1&id={$this->_surveyId}"));
+          "action=update&reset=1&id={$this->_surveyId}"));
       }
       else {
         CRM_Utils_System::redirect(CRM_Utils_System::url("civicrm/survey/configure/{$subPage}",
-                                                         "action=update&reset=1&id={$this->_surveyId}"));
+          "action=update&reset=1&id={$this->_surveyId}"));
       }
     }
   }
index 1164ef1e7093a447632d76bcf0f9c93c45d2bc10..84ab2f6a47a464657c17c56b1a5ff47862bb1fe6 100644 (file)
@@ -224,11 +224,13 @@ class CRM_Campaign_Form_Survey_Main extends CRM_Campaign_Form_Survey {
 
     if (!empty($this->_values['result_id'])) {
       $query = "SELECT COUNT(*) FROM civicrm_survey WHERE result_id = %1";
-      $countSurvey = (int)CRM_Core_DAO::singleValueQuery($query,
+      $countSurvey = (int) CRM_Core_DAO::singleValueQuery($query,
         array(
-          1 => array($this->_values['result_id'],
+          1 => array(
+            $this->_values['result_id'],
             'Positive',
-          ))
+          )
+        )
       );
       // delete option group if no any survey is using it.
       if (!$countSurvey) {
index eecf3b19adc9f868f287be4f13b975dbe92557c9..078f3bc4afaa1c7aca3c1385353b1497cca06cfd 100644 (file)
@@ -118,9 +118,9 @@ class CRM_Campaign_Form_Survey_Questions extends CRM_Campaign_Form_Survey {
     // also update the ProfileModule tables
     $ufJoinParams = array(
       'is_active' => 1,
-      'module'    => 'CiviCampaign',
+      'module' => 'CiviCampaign',
       'entity_table' => 'civicrm_survey',
-      'entity_id'    => $this->_surveyId,
+      'entity_id' => $this->_surveyId,
     );
 
     // first delete all past entries
index b389ff3b69b6900b722d823bdc2a13f4f202065a..70e49c6571781bfeeecdc804251359d0bc9821da 100644 (file)
@@ -199,9 +199,9 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey {
     }
 
     $this->addFormRule(array(
-        'CRM_Campaign_Form_Survey_Results',
-        'formRule',
-      ), $this);
+      'CRM_Campaign_Form_Survey_Results',
+      'formRule',
+    ), $this);
 
     parent::buildQuickForm();
   }
@@ -486,11 +486,11 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey {
 
       $query = "SELECT MAX(id) FROM civicrm_report_instance WHERE name = %1";
       $reportID = CRM_Core_DAO::singleValueQuery($query, array(
-          1 => array(
-            "survey_{$survey->id}",
-            'String',
-          ),
-        ));
+        1 => array(
+          "survey_{$survey->id}",
+          'String',
+        ),
+      ));
       if ($reportID) {
         $url = CRM_Utils_System::url("civicrm/report/instance/{$reportID}", 'reset=1');
         $status = ts("A Survey Detail Report <a href='%1'>%2</a> has been created.",
index 940e2a6cc7ade9ba456255cd6c653a1f3184a1c3..a37f81dd18cf3fb90da9f98460f31e2af1675cb2 100644 (file)
@@ -94,10 +94,10 @@ class CRM_Campaign_Form_Survey_TabHeader {
       ),
     );
 
-    $surveyID  = $form->getVar('_surveyId');
-    $class     = $form->getVar('_name');
-    $class     = CRM_Utils_String::getClassName($class);
-    $class     = strtolower($class);
+    $surveyID = $form->getVar('_surveyId');
+    $class = $form->getVar('_name');
+    $class = CRM_Utils_String::getClassName($class);
+    $class = strtolower($class);
 
     if (array_key_exists($class, $tabs)) {
       $tabs[$class]['current'] = TRUE;
index 011a0ed6d969343853fff09086c8d2b05f509423..feef6008857e3cc4d547bd90b3ca6066e091563e 100644 (file)
@@ -80,8 +80,8 @@ class CRM_Campaign_Form_SurveyType extends CRM_Admin_Form {
     $this->assign('id', $this->_id);
 
     $this->_BAOName = 'CRM_Core_BAO_OptionValue';
-    $this->_gName   = 'activity_type';
-    $this->_gid     = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $this->_gName, 'id', 'name');
+    $this->_gName = 'activity_type';
+    $this->_gid = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $this->_gName, 'id', 'name');
 
     $session = CRM_Core_Session::singleton();
     $url = CRM_Utils_System::url('civicrm/admin/campaign/surveyType', 'reset=1');
index cde042f94a13bf614758ff1e7852d58dfa6b257f..3fcab21335c564615a2af1df5b87f291df7d404b 100755 (executable)
@@ -84,9 +84,9 @@ class CRM_Campaign_Form_Task extends CRM_Core_Form {
   function preProcess() {
     $values = $this->controller->exportValues('Search');
 
-    $this->_task   = $values['task'];
+    $this->_task = $values['task'];
     $campaignTasks = CRM_Campaign_Task::tasks();
-    $taskName      = CRM_Utils_Array::value($this->_task, $campaignTasks);
+    $taskName = CRM_Utils_Array::value($this->_task, $campaignTasks);
     $this->assign('taskName', $taskName);
 
     $ids = array();
@@ -98,9 +98,9 @@ class CRM_Campaign_Form_Task extends CRM_Core_Form {
       }
     }
     else {
-      $qfKey    = CRM_Utils_Request::retrieve('qfKey', 'String', $this);
+      $qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $this);
       $cacheKey = "civicrm search {$qfKey}";
-      $allCids  = CRM_Core_BAO_PrevNextCache::getSelection($cacheKey, "getall");
+      $allCids = CRM_Core_BAO_PrevNextCache::getSelection($cacheKey, "getall");
       $ids = array_keys($allCids[$cacheKey]);
       $this->assign('totalSelectedVoters', count($ids));
     }
@@ -114,8 +114,8 @@ class CRM_Campaign_Form_Task extends CRM_Core_Form {
     $this->assign('totalSelectedContacts', count($this->_contactIds));
 
     //set the context for redirection for any task actions
-    $session   = CRM_Core_Session::singleton();
-    $qfKey     = CRM_Utils_Request::retrieve('qfKey', 'String', $this);
+    $session = CRM_Core_Session::singleton();
+    $qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $this);
     $urlParams = 'force=1';
     if (CRM_Utils_Rule::qfKey($qfKey)) {
       $urlParams .= '&qfKey=' . $qfKey;
index 617b887863d8061139b6e9e5900f3aca6ebc3825..20425cbfc907e32d7ec0ca30f4463d9e5781db5a 100755 (executable)
@@ -79,7 +79,10 @@ class CRM_Campaign_Form_Task_Interview extends CRM_Campaign_Form_Task {
     if ($this->_reserveToInterview || $this->_votingTab) {
       //user came from voting tab / reserve form.
       foreach (array(
-                 'surveyId', 'contactIds', 'interviewerId') as $fld) {
+                 'surveyId',
+                 'contactIds',
+                 'interviewerId'
+               ) as $fld) {
         $this->{"_$fld"} = $this->get($fld);
       }
       //get the target voter ids.
@@ -100,7 +103,7 @@ class CRM_Campaign_Form_Task_Interview extends CRM_Campaign_Form_Task {
     }
 
     $orderClause = FALSE;
-    $buttonName  = $this->controller->getButtonName();
+    $buttonName = $this->controller->getButtonName();
     if ($buttonName == '_qf_Interview_submit_orderBy' && !empty($_POST['order_bys'])) {
       $orderByParams = CRM_Utils_Array::value('order_bys', $_POST);
     }
@@ -109,7 +112,7 @@ class CRM_Campaign_Form_Task_Interview extends CRM_Campaign_Form_Task {
         array(
           1 => array(
             'column' => 'civicrm_address.street_name',
-            'order'  => 'ASC',
+            'order' => 'ASC',
           ),
           2 => array(
             'column' => 'civicrm_address.street_number%2',
@@ -141,7 +144,7 @@ class CRM_Campaign_Form_Task_Interview extends CRM_Campaign_Form_Task {
     $this->_contactIds = array_unique($this->_contactIds);
     if (!empty($this->_contactIds) && $orderClause) {
       $clause = 'contact_a.id IN ( ' . implode(',', $this->_contactIds) . ' ) ';
-      $sql    = "
+      $sql = "
 SELECT contact_a.id
 FROM civicrm_contact contact_a
 LEFT JOIN civicrm_address ON contact_a.id = civicrm_address.contact_id
@@ -176,8 +179,8 @@ WHERE {$clause}
 
     $activityIds = array();
     foreach ($this->_contactIds as $key => $voterId) {
-      $actVals    = CRM_Utils_Array::value($voterId, $this->_surveyActivityIds);
-      $statusId   = CRM_Utils_Array::value('status_id', $actVals);
+      $actVals = CRM_Utils_Array::value($voterId, $this->_surveyActivityIds);
+      $statusId = CRM_Utils_Array::value('status_id', $actVals);
       $activityId = CRM_Utils_Array::value('activity_id', $actVals);
       if ($activityId &&
         $statusId &&
@@ -256,7 +259,7 @@ WHERE {$clause}
 
   public function validateIds() {
     $required = array(
-    'surveyId' => ts('Could not find Survey.'),
+      'surveyId' => ts('Could not find Survey.'),
       'interviewerId' => ts('Could not find Interviewer.'),
       'contactIds' => ts('No respondents are currently reserved for you to interview.'),
       'resultOptions' => ts('Oops. It looks like there is no response option configured.'),
@@ -287,15 +290,18 @@ WHERE {$clause}
 
     $options =
       array(
-    '' => ' - none - ',
-        'civicrm_address.street_name'     => 'Street Name',
+        '' => ' - none - ',
+        'civicrm_address.street_name' => 'Street Name',
         'civicrm_address.street_number%2' => 'Odd / Even Street Number',
-        'civicrm_address.street_number'   => 'Street Number',
-        'contact_a.sort_name'             => 'Respondent Name',
+        'civicrm_address.street_number' => 'Street Number',
+        'contact_a.sort_name' => 'Respondent Name',
       );
     for ($i = 1; $i < count($options); $i++) {
       $this->addElement('select', "order_bys[{$i}][column]", ts('Order by Column'), $options);
-      $this->addElement('select', "order_bys[{$i}][order]", ts('Order by Order'), array('ASC' => 'Ascending', 'DESC' => 'Descending'));
+      $this->addElement('select', "order_bys[{$i}][order]", ts('Order by Order'), array(
+          'ASC' => 'Ascending',
+          'DESC' => 'Descending'
+        ));
     }
 
     //pickup the uf fields.
@@ -315,8 +321,9 @@ WHERE {$clause}
       if (!empty($this->_resultOptions)) {
         $this->add('select', "field[$contactId][result]", ts('Result'),
           array(
-            '' => ts('- select -')) +
-            array_combine($this->_resultOptions, $this->_resultOptions)
+            '' => ts('- select -')
+          ) +
+          array_combine($this->_resultOptions, $this->_resultOptions)
         );
       }
 
@@ -339,11 +346,12 @@ WHERE {$clause}
 
     $buttons = array(
       array(
-    'type' => 'cancel',
+        'type' => 'cancel',
         'name' => ts('Done'),
         'subName' => 'interview',
         'isDefault' => TRUE,
-      ));
+      )
+    );
 
     $buttons[] = array(
       'type' => 'submit',
@@ -404,7 +412,7 @@ WHERE {$clause}
         array(
           1 => array(
             'column' => 'civicrm_address.street_name',
-            'order'  => 'ASC',
+            'order' => 'ASC',
           ),
           2 => array(
             'column' => 'civicrm_address.street_number%2',
@@ -424,10 +432,10 @@ WHERE {$clause}
       $defaults['order_bys'] =
         array(
           1 =>
-          array(
-            'column' => 'contact_a.sort_name',
-            'order' => 'ASC',
-          ),
+            array(
+              'column' => 'contact_a.sort_name',
+              'order' => 'ASC',
+            ),
         );
     }
     return $defaults;
@@ -448,7 +456,10 @@ WHERE {$clause}
     elseif ($buttonName == '_qf_Interview_next_interviewToRelease') {
       //get ready to jump to release form.
       foreach (array(
-                 'surveyId', 'contactIds', 'interviewerId') as $fld) {
+                 'surveyId',
+                 'contactIds',
+                 'interviewerId'
+               ) as $fld) {
         $this->controller->set($fld, $this->{"_$fld"});
       }
       $this->controller->set('interviewToRelease', TRUE);
@@ -576,8 +587,8 @@ WHERE {$clause}
     }
     if (!$this->_surveyId) {
       // use default survey id
-      $dao             = new CRM_Campaign_DAO_Survey();
-      $dao->is_active  = 1;
+      $dao = new CRM_Campaign_DAO_Survey();
+      $dao->is_active = 1;
       $dao->is_default = 1;
       $dao->find(TRUE);
       $this->_surveyId = $dao->id;
index 661a84f0ff065ab37a69e03a92f298e0ba572749..bbb84df5e2f6493f9069479c185a7f722f99f8a2 100644 (file)
@@ -72,7 +72,10 @@ class CRM_Campaign_Form_Task_Release extends CRM_Campaign_Form_Task {
     if ($this->_interviewToRelease) {
       //user came from interview form.
       foreach (array(
-        'surveyId', 'contactIds', 'interviewerId') as $fld) {
+                 'surveyId',
+                 'contactIds',
+                 'interviewerId'
+               ) as $fld) {
         $this->{"_$fld"} = $this->get($fld);
       }
 
@@ -104,7 +107,8 @@ class CRM_Campaign_Form_Task_Release extends CRM_Campaign_Form_Task {
     $activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
     $statusIds = array();
     foreach (array(
-      'Scheduled') as $name) {
+               'Scheduled'
+             ) as $name) {
       if ($statusId = array_search($name, $activityStatus)) {
         $statusIds[] = $statusId;
       }
index caa0fdc87580b750310c6f7eef824839e7eb0069..05cc122df6e48d294e225db92fb5f2b0c273cba1 100644 (file)
@@ -95,7 +95,8 @@ class CRM_Campaign_Form_Task_Reserve extends CRM_Campaign_Form_Task {
     $activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
     $statusIds = array();
     foreach (array(
-      'Scheduled') as $name) {
+               'Scheduled'
+             ) as $name) {
       if ($statusId = array_search($name, $activityStatus)) {
         $statusIds[] = $statusId;
       }
@@ -174,11 +175,12 @@ class CRM_Campaign_Form_Task_Reserve extends CRM_Campaign_Form_Task {
 
     $buttons = array(
       array(
-    'type' => 'done',
+        'type' => 'done',
         'name' => ts('Reserve'),
         'subName' => 'reserve',
         'isDefault' => TRUE,
-      ));
+      )
+    );
 
     if (CRM_Core_Permission::check('manage campaign') ||
       CRM_Core_Permission::check('administer CiviCampaign') ||
@@ -216,13 +218,13 @@ class CRM_Campaign_Form_Task_Reserve extends CRM_Campaign_Form_Task {
     $errors = array();
     $invalidGroupName = FALSE;
     if (!empty($fields['newGroupName'])) {
-      $title  = trim($fields['newGroupName']);
-      $name   = CRM_Utils_String::titleToVar($title);
-      $query  = 'select count(*) from civicrm_group where name like %1 OR title like %2';
+      $title = trim($fields['newGroupName']);
+      $name = CRM_Utils_String::titleToVar($title);
+      $query = 'select count(*) from civicrm_group where name like %1 OR title like %2';
       $grpCnt = CRM_Core_DAO::singleValueQuery($query, array(
-      1 => array($name, 'String'),
-          2 => array($title, 'String'),
-        ));
+        1 => array($name, 'String'),
+        2 => array($title, 'String'),
+      ));
       if ($grpCnt) {
         $invalidGroupName = TRUE;
         $errors['newGroupName'] = ts('Group \'%1\' already exists.', array(1 => $fields['newGroupName']));
@@ -241,17 +243,17 @@ class CRM_Campaign_Form_Task_Reserve extends CRM_Campaign_Form_Task {
    */
   public function postProcess() {
     //add reservation.
-    $countVoters    = 0;
-    $maxVoters      = CRM_Utils_Array::value('max_number_of_contacts', $this->_surveyDetails);
+    $countVoters = 0;
+    $maxVoters = CRM_Utils_Array::value('max_number_of_contacts', $this->_surveyDetails);
     $activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
-    $statusHeld     = array_search('Scheduled', $activityStatus);
+    $statusHeld = array_search('Scheduled', $activityStatus);
 
     $reservedVoterIds = array();
     foreach ($this->_contactIds as $cid) {
-      $subject        = ts('%1', array(1 => $this->_surveyDetails['title'])) . ' - ' . ts('Respondent Reservation');
-      $session        = CRM_Core_Session::singleton();
+      $subject = ts('%1', array(1 => $this->_surveyDetails['title'])) . ' - ' . ts('Respondent Reservation');
+      $session = CRM_Core_Session::singleton();
       $activityParams = array(
-      'source_contact_id' => $session->get('userID'),
+        'source_contact_id' => $session->get('userID'),
         'assignee_contact_id' => array($this->_interviewerId),
         'target_contact_id' => array($cid),
         'source_record_id' => $this->_surveyId,
@@ -280,8 +282,8 @@ class CRM_Campaign_Form_Task_Reserve extends CRM_Campaign_Form_Task {
       $status = '<p>' . ts("%1 Contact(s) have been reserved.", array(1 => $countVoters)) . '</p>';
       if ($groupAdditions) {
         $status .= '<p>' . ts('Respondent(s) has been added to %1 group(s).',
-          array(1 => implode(', ', $groupAdditions))
-        ) . '</p>';
+            array(1 => implode(', ', $groupAdditions))
+          ) . '</p>';
       }
       CRM_Core_Session::setStatus($status, ts('Reservation Added'), 'success');
     }
@@ -315,8 +317,8 @@ class CRM_Campaign_Form_Task_Reserve extends CRM_Campaign_Form_Task {
       return $groupAdditions;
     }
 
-    $params       = $this->controller->exportValues($this->_name);
-    $groups       = CRM_Utils_Array::value('groups', $params, array());
+    $params = $this->controller->exportValues($this->_name);
+    $groups = CRM_Utils_Array::value('groups', $params, array());
     $newGroupName = CRM_Utils_Array::value('newGroupName', $params);
     $newGroupDesc = CRM_Utils_Array::value('newGroupDesc', $params);
 
index 2f1162f4841a5294327b4ce84bfbf24f61b56d26..07a838bd9bcb438d348396363502ab9c33ddd5d8 100644 (file)
@@ -127,18 +127,18 @@ class CRM_Campaign_Info extends CRM_Core_Component_Info {
     ) {
       $shortCuts = array_merge($shortCuts, array(
         array(
-      'path' => 'civicrm/campaign/add',
-            'query' => "reset=1&action=add",
-            'ref' => 'new-campaign',
-            'title' => ts('Campaign'),
-          ),
-          array(
-            'path' => 'civicrm/survey/add',
-            'query' => "reset=1&action=add",
-            'ref' => 'new-survey',
-            'title' => ts('Survey'),
-          ),
-        ));
+          'path' => 'civicrm/campaign/add',
+          'query' => "reset=1&action=add",
+          'ref' => 'new-campaign',
+          'title' => ts('Campaign'),
+        ),
+        array(
+          'path' => 'civicrm/survey/add',
+          'query' => "reset=1&action=add",
+          'ref' => 'new-survey',
+          'title' => ts('Survey'),
+        ),
+      ));
     }
   }
 }
index 79c76a31c8333e5606c83a224d1fe7960eaf0beb..b8cf42de6d5eefeccd5809a8fa6629b2773cc4dc 100644 (file)
@@ -53,8 +53,8 @@ class CRM_Campaign_Page_AJAX {
       $params[$fld] = CRM_Utils_Array::value($fld, $_POST);
     }
     $params['details'] = CRM_Utils_Array::value('note', $_POST);
-    $voterId           = $params['voter_id'];
-    $activityId        = $params['activity_id'];
+    $voterId = $params['voter_id'];
+    $activityId = $params['activity_id'];
 
     $customKey = "field_{$voterId}_custom";
     foreach ($_POST as $key => $value) {
@@ -106,8 +106,8 @@ class CRM_Campaign_Page_AJAX {
 
   public static function loadOptionGroupDetails() {
 
-    $id       = CRM_Utils_Array::value('option_group_id', $_POST);
-    $status   = 'fail';
+    $id = CRM_Utils_Array::value('option_group_id', $_POST);
+    $status = 'fail';
     $opValues = array();
 
     if ($id) {
@@ -117,8 +117,8 @@ class CRM_Campaign_Page_AJAX {
 
     $surveyId = CRM_Utils_Array::value('survey_id', $_POST);
     if ($surveyId) {
-      $survey            = new CRM_Campaign_DAO_Survey();
-      $survey->id        = $surveyId;
+      $survey = new CRM_Campaign_DAO_Survey();
+      $survey->id = $surveyId;
       $survey->result_id = $id;
       if ($survey->find(TRUE)) {
         if ($survey->recontact_interval) {
@@ -157,7 +157,9 @@ class CRM_Campaign_Page_AJAX {
 
     //format multi-select group and contact types.
     foreach (array(
-      'group', 'contact_type') as $param) {
+               'group',
+               'contact_type'
+             ) as $param) {
       $paramValue = CRM_Utils_Array::value($param, $params);
       if ($paramValue) {
         unset($params[$param]);
@@ -170,7 +172,10 @@ class CRM_Campaign_Page_AJAX {
 
     $voterClauseParams = array();
     foreach (array(
-      'campaign_survey_id', 'survey_interviewer_id', 'campaign_search_voter_for') as $fld) {
+               'campaign_survey_id',
+               'survey_interviewer_id',
+               'campaign_search_voter_for'
+             ) as $fld) {
       $voterClauseParams[$fld] = CRM_Utils_Array::value($fld, $params);
     }
 
@@ -229,7 +234,7 @@ class CRM_Campaign_Page_AJAX {
     // get the data table params.
     $dataTableParams = array(
       'sEcho' => array(
-    'name' => 'sEcho',
+        'name' => 'sEcho',
         'type' => 'Integer',
         'default' => 0,
       ),
@@ -286,8 +291,12 @@ class CRM_Campaign_Page_AJAX {
     $iTotal = $searchCount;
 
     $selectorCols = array(
-      'contact_type', 'sort_name', 'street_address',
-      'street_name', 'street_number', 'street_unit',
+      'contact_type',
+      'sort_name',
+      'street_address',
+      'street_name',
+      'street_number',
+      'street_unit',
     );
 
     $extraVoterColName = 'is_interview_conducted';
@@ -332,15 +341,15 @@ class CRM_Campaign_Page_AJAX {
           $voterExtraColHtml .= "&nbsp;<span id='success_msg_{$contactID}' class='ok' style='display:none;'>$msg</span>";
         }
         elseif ($searchVoterFor == 'gotv') {
-          $surveyActId       = $result->survey_activity_id;
+          $surveyActId = $result->survey_activity_id;
           $voterExtraColHtml = '<input type="checkbox" id="survey_activity[' . $surveyActId . ']" name="survey_activity[' . $surveyActId . ']" value=' . $surveyActId . ' onClick="processVoterData( this, \'gotv\' );" />';
-          $msg               = ts('Vote Recorded.');
+          $msg = ts('Vote Recorded.');
           $voterExtraColHtml .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span id='success_msg_{$surveyActId}' class='ok' style='display:none;'>$msg</span>";
         }
         else {
-          $surveyActId       = $result->survey_activity_id;
+          $surveyActId = $result->survey_activity_id;
           $voterExtraColHtml = '<input type="checkbox" id="survey_activity[' . $surveyActId . ']" name="survey_activity[' . $surveyActId . ']" value=' . $surveyActId . ' onClick="processVoterData( this, \'release\' );" />';
-          $msg               = ts('Vote Recorded.');
+          $msg = ts('Vote Recorded.');
           $voterExtraColHtml .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span id='success_msg_{$surveyActId}' class='ok' style='display:none;'>$msg</span>";
         }
         $searchRows[$contactID][$extraVoterColName] = $voterExtraColHtml;
@@ -406,8 +415,8 @@ class CRM_Campaign_Page_AJAX {
         }
       }
       if ($createActivity) {
-        $isReserved        = CRM_Utils_String::strtoboolstr(CRM_Utils_Type::escape($_POST['isReserved'], 'String'));
-        $activityStatus    = CRM_Core_PseudoConstant::activityStatus('name');
+        $isReserved = CRM_Utils_String::strtoboolstr(CRM_Utils_Type::escape($_POST['isReserved'], 'String'));
+        $activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
         $scheduledStatusId = array_search('Scheduled', $activityStatus);
         if ($isReserved) {
           $surveyValues = array();
@@ -485,12 +494,13 @@ class CRM_Campaign_Page_AJAX {
 
   public function allActiveCampaigns() {
     $currentCampaigns = CRM_Campaign_BAO_Campaign::getCampaigns();
-    $campaigns        = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, TRUE, FALSE, TRUE);
-    $options          = array(
+    $campaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, TRUE, FALSE, TRUE);
+    $options = array(
       array(
-    'value' => '',
+        'value' => '',
         'title' => ts('- select -'),
-      ));
+      )
+    );
     foreach ($campaigns as $value => $title) {
       $class = NULL;
       if (!array_key_exists($value, $currentCampaigns)) {
@@ -534,9 +544,10 @@ class CRM_Campaign_Page_AJAX {
     }
     $groups = array(
       array(
-    'value' => '',
+        'value' => '',
         'title' => ts('- select -'),
-      ));
+      )
+    );
     foreach ($campGroups as $grpId => $title) {
       $groups[] = array(
         'value' => $grpId,
@@ -586,7 +597,7 @@ class CRM_Campaign_Page_AJAX {
     // get the data table params.
     $dataTableParams = array(
       'sEcho' => array(
-    'name' => 'sEcho',
+        'name' => 'sEcho',
         'type' => 'Integer',
         'default' => 0,
       ),
@@ -621,13 +632,17 @@ class CRM_Campaign_Page_AJAX {
       }
     }
     foreach (array(
-      'sort', 'offset', 'rowCount', 'sortOrder') as $sortParam) {
+               'sort',
+               'offset',
+               'rowCount',
+               'sortOrder'
+             ) as $sortParam) {
       $params[$sortParam] = $$sortParam;
     }
 
     $searchCount = CRM_Campaign_BAO_Campaign::getCampaignSummary($params, TRUE);
-    $campaigns   = CRM_Campaign_Page_DashBoard::getCampaignSummary($params);
-    $iTotal      = $searchCount;
+    $campaigns = CRM_Campaign_Page_DashBoard::getCampaignSummary($params);
+    $iTotal = $searchCount;
 
     if ($searchCount > 0) {
       if ($searchCount < $offset) {
@@ -685,7 +700,7 @@ class CRM_Campaign_Page_AJAX {
     // get the data table params.
     $dataTableParams = array(
       'sEcho' => array(
-    'name' => 'sEcho',
+        'name' => 'sEcho',
         'type' => 'Integer',
         'default' => 0,
       ),
@@ -720,13 +735,17 @@ class CRM_Campaign_Page_AJAX {
       }
     }
     foreach (array(
-      'sort', 'offset', 'rowCount', 'sortOrder') as $sortParam) {
+               'sort',
+               'offset',
+               'rowCount',
+               'sortOrder'
+             ) as $sortParam) {
       $params[$sortParam] = $$sortParam;
     }
 
-    $surveys     = CRM_Campaign_Page_DashBoard::getSurveySummary($params);
+    $surveys = CRM_Campaign_Page_DashBoard::getSurveySummary($params);
     $searchCount = CRM_Campaign_BAO_Survey::getSurveySummary($params, TRUE);
-    $iTotal      = $searchCount;
+    $iTotal = $searchCount;
 
     if ($searchCount > 0) {
       if ($searchCount < $offset) {
@@ -779,7 +798,7 @@ class CRM_Campaign_Page_AJAX {
     // get the data table params.
     $dataTableParams = array(
       'sEcho' => array(
-    'name' => 'sEcho',
+        'name' => 'sEcho',
         'type' => 'Integer',
         'default' => 0,
       ),
@@ -814,13 +833,17 @@ class CRM_Campaign_Page_AJAX {
       }
     }
     foreach (array(
-      'sort', 'offset', 'rowCount', 'sortOrder') as $sortParam) {
+               'sort',
+               'offset',
+               'rowCount',
+               'sortOrder'
+             ) as $sortParam) {
       $params[$sortParam] = $$sortParam;
     }
 
-    $petitions   = CRM_Campaign_Page_DashBoard::getPetitionSummary($params);
+    $petitions = CRM_Campaign_Page_DashBoard::getPetitionSummary($params);
     $searchCount = CRM_Campaign_BAO_Petition::getPetitionSummary($params, TRUE);
-    $iTotal      = $searchCount;
+    $iTotal = $searchCount;
 
     if ($searchCount > 0) {
       if ($searchCount < $offset) {
index a9e3f84b7c9e4533a6113ea45429eff4153ec8fa..eb0d701606886cd8d21d72cd9451b4006456b9c9 100644 (file)
@@ -154,14 +154,14 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page {
         'qs' => 'sid=%%id%%&reset=1',
         'title' => ts('Sign Petition'),
         'fe' => TRUE,
-      //CRM_Core_Action::PROFILE is used because there isn't a specific action for sign
+        //CRM_Core_Action::PROFILE is used because there isn't a specific action for sign
       );
       self::$_petitionActionLinks[CRM_Core_Action::BROWSE] = array(
         'name' => ts('Signatures'),
         'url' => 'civicrm/activity/search',
         'qs' => 'survey=%%id%%&force=1',
         'title' => ts('List the signatures'),
-      //CRM_Core_Action::PROFILE is used because there isn't a specific action for sign
+        //CRM_Core_Action::PROFILE is used because there isn't a specific action for sign
       );
     }
 
@@ -205,12 +205,19 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page {
     //get the campaigns.
     $campaigns = CRM_Campaign_BAO_Campaign::getCampaignSummary($params);
     if (!empty($campaigns)) {
-      $config         = CRM_Core_Config::singleton();
-      $campaignType   = CRM_Campaign_PseudoConstant::campaignType();
+      $config = CRM_Core_Config::singleton();
+      $campaignType = CRM_Campaign_PseudoConstant::campaignType();
       $campaignStatus = CRM_Campaign_PseudoConstant::campaignStatus();
-      $properties     = array(
-        'id', 'name', 'title', 'status_id', 'description',
-        'campaign_type_id', 'is_active', 'start_date', 'end_date',
+      $properties = array(
+        'id',
+        'name',
+        'title',
+        'status_id',
+        'description',
+        'campaign_type_id',
+        'is_active',
+        'start_date',
+        'end_date',
       );
       foreach ($campaigns as $cmpid => $campaign) {
         foreach ($properties as $prop) {
@@ -466,9 +473,10 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page {
     CRM_Core_Resources::singleton()
       ->addScriptFile('civicrm', 'templates/CRM/common/TabHeader.js', 1, 'html-header')
       ->addSetting(array(
-    'tabSettings' => array(
-        'active' => strtolower(CRM_Utils_Array::value('subPage', $_GET, 'campaign')),
-      )));
+        'tabSettings' => array(
+          'active' => strtolower(CRM_Utils_Array::value('subPage', $_GET, 'campaign')),
+        )
+      ));
   }
 
   /**
index 80360a287f69a6b41d00408f0bac0642bc104685..50a95f43f12dd1761a222d4d4e9ed99e20dc021e 100644 (file)
@@ -40,13 +40,13 @@ class CRM_Campaign_Page_Petition_Confirm extends CRM_Core_Page {
   public function run() {
     CRM_Utils_System::addHTMLHead('<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">');
 
-    $contact_id   = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject);
+    $contact_id = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject);
     $subscribe_id = CRM_Utils_Request::retrieve('sid', 'Integer', CRM_Core_DAO::$_nullObject);
-    $hash         = CRM_Utils_Request::retrieve('h', 'String', CRM_Core_DAO::$_nullObject);
-    $activity_id  = CRM_Utils_Request::retrieve('a', 'String', CRM_Core_DAO::$_nullObject);
-    $petition_id  = CRM_Utils_Request::retrieve('pid', 'String', CRM_Core_DAO::$_nullObject);
+    $hash = CRM_Utils_Request::retrieve('h', 'String', CRM_Core_DAO::$_nullObject);
+    $activity_id = CRM_Utils_Request::retrieve('a', 'String', CRM_Core_DAO::$_nullObject);
+    $petition_id = CRM_Utils_Request::retrieve('pid', 'String', CRM_Core_DAO::$_nullObject);
     if (!$petition_id) {
-      $petition_id  = CRM_Utils_Request::retrieve('p', 'String', CRM_Core_DAO::$_nullObject);
+      $petition_id = CRM_Utils_Request::retrieve('p', 'String', CRM_Core_DAO::$_nullObject);
     }
 
     if (!$contact_id ||
@@ -72,7 +72,7 @@ class CRM_Campaign_Page_Petition_Confirm extends CRM_Core_Page {
 
     $this->assign('survey_id', $petition_id);
 
-    $pparams['id']   = $petition_id;
+    $pparams['id'] = $petition_id;
     $this->petition = array();
     CRM_Campaign_BAO_Survey::retrieve($pparams, $this->petition);
     $this->assign('is_share', CRM_Utils_Array::value('is_share', $this->petition));
index 1c4b1a0dbeced4753deb186fa81a9b18c74a5daf..a6ff4f0655ad28d2f82bbdb1a581adf915490e50 100644 (file)
@@ -37,9 +37,9 @@ class CRM_Campaign_Page_Petition_ThankYou extends CRM_Core_Page {
    * @return string
    */
   public function run() {
-    $id             = CRM_Utils_Request::retrieve('id', 'Positive', $this);
-    $petition_id    = CRM_Utils_Request::retrieve('pid', 'Positive', $this);
-    $params['id']   = $petition_id;
+    $id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
+    $petition_id = CRM_Utils_Request::retrieve('pid', 'Positive', $this);
+    $params['id'] = $petition_id;
     $this->petition = array();
     CRM_Campaign_BAO_Survey::retrieve($params, $this->petition);
     $this->assign('petitionTitle', $this->petition['title']);
index b7addf9e23a02ca697f6987a97e994ec1c516f58..99ab30099df8fc6d8f06cafa85167423a4462c76 100644 (file)
@@ -83,8 +83,8 @@ class CRM_Campaign_Page_Survey extends CRM_Core_Page {
 
     if (!empty($surveys)) {
 
-      $surveyType    = CRM_Campaign_BAO_Survey::getSurveyActivityType();
-      $campaigns     = CRM_Campaign_BAO_Campaign::getAllCampaign();
+      $surveyType = CRM_Campaign_BAO_Survey::getSurveyActivityType();
+      $campaigns = CRM_Campaign_BAO_Campaign::getAllCampaign();
       $activityTypes = CRM_Core_OptionGroup::values('activity_type', FALSE, FALSE, FALSE, FALSE, 'name');
       foreach ($surveys as $sid => $survey) {
         $surveys[$sid]['campaign_id'] = $campaigns[$survey['campaign_id']];
index 21c9a281e0556b6cac3b505a9b035f59c85caff1..44456cd1b4ce867bc44fbb1a3b4cc03f47bcd6c9 100644 (file)
@@ -157,8 +157,8 @@ class CRM_Campaign_Page_SurveyType extends CRM_Core_Page_Basic {
    */
   public function browse() {
     $campaingCompId = CRM_Core_Component::getComponentID('CiviCampaign');
-    $groupParams    = array('name' => $this->_gName);
-    $optionValues   = CRM_Core_OptionValue::getRows($groupParams, $this->links(), 'component_id,weight');
+    $groupParams = array('name' => $this->_gName);
+    $optionValues = CRM_Core_OptionValue::getRows($groupParams, $this->links(), 'component_id,weight');
 
     foreach ($optionValues as $key => $optionValue) {
       if (CRM_Utils_Array::value('component_id', $optionValue) != $campaingCompId) {
index 9550d2b1a90014f722c1112ab08b231c28685429..c322e9cd3b26c9ad2136699e0ada1dbec9bded70 100644 (file)
@@ -73,7 +73,7 @@ class CRM_Campaign_Page_Vote extends CRM_Core_Page {
 
   public function browse() {
     $this->_tabs = array(
-    'reserve' => ts('Reserve Respondents'),
+      'reserve' => ts('Reserve Respondents'),
       'interview' => ts('Interview Respondents'),
     );
 
@@ -96,9 +96,10 @@ class CRM_Campaign_Page_Vote extends CRM_Core_Page {
     CRM_Core_Resources::singleton()
       ->addScriptFile('civicrm', 'templates/CRM/common/TabHeader.js', 1, 'html-header')
       ->addSetting(array(
-    'tabSettings' => array(
-        'active' => strtolower(CRM_Utils_Array::value('subPage', $_GET, 'reserve')),
-      )));
+        'tabSettings' => array(
+          'active' => strtolower(CRM_Utils_Array::value('subPage', $_GET, 'reserve')),
+        )
+      ));
   }
 
   /**
@@ -114,7 +115,14 @@ class CRM_Campaign_Page_Vote extends CRM_Core_Page {
     $allTabs = array();
     foreach ($this->_tabs as $name => $title) {
       // check for required permissions.
-      if (!CRM_Core_Permission::check(array(array('manage campaign', 'administer CiviCampaign', "{$name} campaign contacts")))) {
+      if (!CRM_Core_Permission::check(array(
+          array(
+            'manage campaign',
+            'administer CiviCampaign',
+            "{$name} campaign contacts"
+          )
+        ))
+      ) {
         continue;
       }
 
index 0f06ded249d0ffbced0ade0048426b7d491d6488..0ce3f80f3f2f9376eaf1b84baba177476c30ff80 100755 (executable)
@@ -161,6 +161,6 @@ class CRM_Campaign_PseudoConstant extends CRM_Core_PseudoConstant {
   public static function flush($name = 'cache') {
     if (isset(self::$$name)) {
       self::$$name = NULL;
-   }
+    }
   }
 }
index 90d2be1a63dcdcea492d0ccf64146f06b98b1334..4460958edfbe119ff73799f2732681e1608965d1 100755 (executable)
@@ -160,8 +160,8 @@ class CRM_Campaign_Selector_Search extends CRM_Core_Selector_Base implements CRM
     // submitted form values
     $this->_queryParams = &$queryParams;
 
-    $this->_single  = $single;
-    $this->_limit   = $limit;
+    $this->_single = $single;
+    $this->_limit = $limit;
     $this->_context = $context;
 
     $this->_campaignClause = $surveyClause;
@@ -334,29 +334,29 @@ FROM {$from}
     if (!$this->_single) {
       $contactDetails = array(
         array(
-      'name' => ts('Contact Name'),
+          'name' => ts('Contact Name'),
           'sort' => 'sort_name',
           'direction' => CRM_Utils_Sort::ASCENDING,
         ),
         array(
-      'name' => ts('Street Number'),
+          'name' => ts('Street Number'),
           'sort' => 'street_number',
         ),
         array(
-      'name' => ts('Street Name'),
+          'name' => ts('Street Name'),
           'sort' => 'street_name',
         ),
         array('name' => ts('Street Address')),
         array(
-      'name' => ts('City'),
+          'name' => ts('City'),
           'sort' => 'city',
         ),
         array(
-      'name' => ts('Postal Code'),
+          'name' => ts('Postal Code'),
           'sort' => 'postal_code',
         ),
         array(
-      'name' => ts('State'),
+          'name' => ts('State'),
           'sort' => 'state_province_name',
         ),
         array('name' => ts('Country')),
index e44f3d85c0f2c5973aa239328fbcd5653b86c8a0..a453dee24ae5dd45808b5ede4c8db2877f00fd7b 100755 (executable)
@@ -69,8 +69,8 @@ class CRM_Campaign_Task {
   public static function &tasks() {
     if (!(self::$_tasks)) {
       self::$_tasks = array(
-      1 => array(
-        'title' => ts('Record Respondents Interview'),
+        1 => array(
+          'title' => ts('Record Respondents Interview'),
           'class' => array(
             'CRM_Campaign_Form_Task_Interview',
             'CRM_Campaign_Form_Task_Release',
index 630be4d9b0e620300a23d5a87cd61c676b242821..e607f4d020ec0b068791463175dcb75223da0819 100644 (file)
@@ -49,11 +49,11 @@ class CRM_Case_Audit_Audit {
 
         $ifBlankReplacements = array();
 
-        $completed  = FALSE;
+        $completed = FALSE;
         $sortValues = array('1970-01-01');
-        $category   = '';
+        $category = '';
         $fieldindex = 1;
-        $fields     = $activity->getElementsByTagName("Field");
+        $fields = $activity->getElementsByTagName("Field");
         foreach ($fields as $field) {
           $datatype_elements = $field->getElementsByTagName("Type");
           $datatype = $datatype_elements->item(0)->nodeValue;
@@ -99,7 +99,10 @@ class CRM_Case_Audit_Audit {
               //CRM-4570
               if ($printReport) {
                 if (!in_array($label, array(
-                  'Activity Type', 'Status'))) {
+                  'Activity Type',
+                  'Status'
+                ))
+                ) {
                   $caseActivities[$activityindex][$fieldindex] = array();
                   $caseActivities[$activityindex][$fieldindex]['label'] = $label;
                   $caseActivities[$activityindex][$fieldindex]['datatype'] = $datatype;
@@ -198,7 +201,7 @@ class CRM_Case_Audit_Audit {
     }
 
     if ($aval < $bval) {
-      return - 1;
+      return -1;
     }
     elseif ($aval > $bval) {
       return 1;
index 49ec82f2b56a3f9f50681504d64709a75424a5fe..53d3b5281748de2d6001b2c70a5f44f8c96fd176 100644 (file)
@@ -573,8 +573,8 @@ class CRM_Case_BAO_Query {
 
       case 'case_relationship':
         $session = CRM_Core_Session::singleton();
-        $userID  = $session->get('userID');
-        $from   .= " $side JOIN civicrm_relationship case_relationship ON ( case_relationship.contact_id_a = civicrm_case_contact.contact_id AND case_relationship.contact_id_b = {$userID} AND case_relationship.case_id = civicrm_case.id )";
+        $userID = $session->get('userID');
+        $from .= " $side JOIN civicrm_relationship case_relationship ON ( case_relationship.contact_id_a = civicrm_case_contact.contact_id AND case_relationship.contact_id_b = {$userID} AND case_relationship.case_id = civicrm_case.id )";
         break;
 
       case 'case_relation_type':
index 67ba166229cf3f76d233792e4ae37e812ba29420..5481d502722c8a479e8fa839cdbccaaad5b09946 100644 (file)
@@ -36,4 +36,5 @@
  * $Id$
  *
  */
-class CRM_Case_Config extends CRM_Core_Component_Config {}
+class CRM_Case_Config extends CRM_Core_Component_Config {
+}
index 9847be50c9239e99758e538eafeeab19c04cafa4..f470d46bf66a60c4a13df35031d4b6ff59abca0b 100644 (file)
@@ -191,8 +191,8 @@ class CRM_Case_Form_Activity extends CRM_Activity_Form_Activity {
             if ($activityInst[$this->_activityTypeName] == 1) {
               $atArray = array('activity_type_id' => $this->_activityTypeId);
               $activities = CRM_Case_BAO_Case::getCaseActivity($caseId,
-              $atArray,
-              $this->_currentUserId
+                $atArray,
+                $this->_currentUserId
               );
               $activities = array_keys($activities);
               $activities = $activities[0];
@@ -693,8 +693,8 @@ class CRM_Case_Form_Activity extends CRM_Activity_Form_Activity {
 
         if ($followupActivity) {
           $caseParams = array(
-             'activity_id' => $followupActivity->id,
-             'case_id' => $vval['case_id'],
+            'activity_id' => $followupActivity->id,
+            'case_id' => $vval['case_id'],
           );
           CRM_Case_BAO_Case::processCaseActivity($caseParams);
           $followupStatus = ts("A followup activity has been scheduled.");
index c9af2a21e8ee718b603a4c9ee57d71d4e5b56b6b..cf626fa3c49e6bcf8ff8a805291a1844bb13d968 100644 (file)
@@ -171,10 +171,10 @@ class CRM_Case_Form_Activity_ChangeCaseStartDate {
 
     // 1. save activity subject with new start date
     $currentStartDate = CRM_Utils_Date::customFormat(CRM_Core_DAO::getFieldValue('CRM_Case_DAO_Case',
-        $caseId, 'start_date'
-      ), $config->dateformatFull);
-    $newStartDate      = CRM_Utils_Date::customFormat(CRM_Utils_Date::mysqlToIso($params['start_date']), $config->dateformatFull);
-    $subject           = 'Change Case Start Date from ' . $currentStartDate . ' to ' . $newStartDate;
+      $caseId, 'start_date'
+    ), $config->dateformatFull);
+    $newStartDate = CRM_Utils_Date::customFormat(CRM_Utils_Date::mysqlToIso($params['start_date']), $config->dateformatFull);
+    $subject = 'Change Case Start Date from ' . $currentStartDate . ' to ' . $newStartDate;
     $activity->subject = $subject;
     $activity->save();
     // 2. initiate xml processor
@@ -197,10 +197,10 @@ class CRM_Case_Form_Activity_ChangeCaseStartDate {
     // Multiple steps since revisioned
     if ($form->openCaseActivityId) {
 
-      $abao                = new CRM_Activity_BAO_Activity();
-      $oldParams           = array('id' => $form->openCaseActivityId);
+      $abao = new CRM_Activity_BAO_Activity();
+      $oldParams = array('id' => $form->openCaseActivityId);
       $oldActivityDefaults = array();
-      $oldActivity         = $abao->retrieve($oldParams, $oldActivityDefaults);
+      $oldActivity = $abao->retrieve($oldParams, $oldActivityDefaults);
 
       // save the old values
       require_once 'api/v3/utils.php';
index bb27d4209fca63f605a0b615d7f80ffacedd3c75..d82f8c354f75312e85f28d5303af1ac5c1bfbf68 100644 (file)
@@ -154,7 +154,7 @@ class CRM_Case_Form_Activity_ChangeCaseStatus {
         $query = 'UPDATE civicrm_relationship SET end_date=%2 WHERE id=%1';
         foreach ($rels as $relId => $relData) {
           $relParams = array(
-          1 => array($relId, 'Integer'),
+            1 => array($relId, 'Integer'),
             2 => array($params['end_date'], 'Timestamp'),
           );
           CRM_Core_DAO::executeQuery($query, $relParams);
index ce5f053877096715562da9191ae129ef2182ecba..7820a9583b604492bbb2dd4a7c900b3f486598b5 100644 (file)
@@ -176,7 +176,7 @@ class CRM_Case_Form_Activity_ChangeCaseType {
     if ($activity->subject == 'null') {
       $activity->subject = ts('Case type changed from %1 to %2',
         array(
-      1 => CRM_Utils_Array::value($form->_defaults['case_type_id'], $allCaseTypes),
+          1 => CRM_Utils_Array::value($form->_defaults['case_type_id'], $allCaseTypes),
           2 => CRM_Utils_Array::value($params['case_type_id'], $allCaseTypes),
         )
       );
index 95e83b96de39667d3dff37c07692e6a8cd995163..afca55a4900aa71a562ef0dff409780058fb1e61 100644 (file)
@@ -149,7 +149,10 @@ class CRM_Case_Form_Activity_OpenCase {
       return;
     }
     if ($form->_context == 'standalone') {
-      $form->addEntityRef('client_id', ts('Client'), array('create' => TRUE, 'multiple' => $form->_allowMultiClient), TRUE);
+      $form->addEntityRef('client_id', ts('Client'), array(
+          'create' => TRUE,
+          'multiple' => $form->_allowMultiClient
+        ), TRUE);
     }
 
     $caseTypes = CRM_Case_PseudoConstant::caseType();
@@ -356,13 +359,13 @@ class CRM_Case_Form_Activity_OpenCase {
     if ($buttonName == $form->getButtonName('upload', 'new')) {
       if ($form->_context == 'standalone') {
         $session->replaceUserContext(CRM_Utils_System::url('civicrm/case/add',
-            'reset=1&action=add&context=standalone'
-          ));
+          'reset=1&action=add&context=standalone'
+        ));
       }
       else {
         $session->replaceUserContext(CRM_Utils_System::url('civicrm/contact/view/case',
-            "reset=1&action=add&context=case&cid={$form->_contactID}"
-          ));
+          "reset=1&action=add&context=case&cid={$form->_contactID}"
+        ));
       }
     }
   }
index 6fa94a50fe4372b2895dc3d5e38b54ef214c1085..314cbd3da2a076af9967bf7e776820447fd7ff54 100644 (file)
@@ -46,10 +46,10 @@ class CRM_Case_Form_ActivityView extends CRM_Core_Form {
    * @return void
    */
   public function preProcess() {
-    $contactID       = CRM_Utils_Request::retrieve('cid', 'Integer', $this, TRUE);
-    $activityID      = CRM_Utils_Request::retrieve('aid', 'Integer', $this, TRUE);
-    $revs            = CRM_Utils_Request::retrieve('revs', 'Boolean', CRM_Core_DAO::$_nullObject);
-    $caseID          = CRM_Utils_Request::retrieve('caseID', 'Boolean', CRM_Core_DAO::$_nullObject);
+    $contactID = CRM_Utils_Request::retrieve('cid', 'Integer', $this, TRUE);
+    $activityID = CRM_Utils_Request::retrieve('aid', 'Integer', $this, TRUE);
+    $revs = CRM_Utils_Request::retrieve('revs', 'Boolean', CRM_Core_DAO::$_nullObject);
+    $caseID = CRM_Utils_Request::retrieve('caseID', 'Boolean', CRM_Core_DAO::$_nullObject);
     $activitySubject = CRM_Core_DAO::getFieldValue('CRM_Activity_DAO_Activity',
       $activityID,
       'subject'
index 6f37d0c04997c6ec7ce718027976ce3e0acc6feb..ce75a40b6ec1f28b8527b8cd89cdccbffd803eeb 100644 (file)
@@ -122,7 +122,7 @@ class CRM_Case_Form_Case extends CRM_Core_Form {
 
     if (!$this->_caseId) {
       $caseAttributes = array(
-      'case_type' => CRM_Case_PseudoConstant::caseType(),
+        'case_type' => CRM_Case_PseudoConstant::caseType(),
         'case_status' => CRM_Case_PseudoConstant::caseStatus(),
         'encounter_medium' => CRM_Case_PseudoConstant::encounterMedium(),
       );
@@ -130,8 +130,8 @@ class CRM_Case_Form_Case extends CRM_Core_Form {
       foreach ($caseAttributes as $key => $values) {
         if (empty($values)) {
           CRM_Core_Error::fatal(ts('You do not have any active %1',
-              array(1 => str_replace('_', ' ', $key))
-            ));
+            array(1 => str_replace('_', ' ', $key))
+          ));
           break;
         }
       }
@@ -261,7 +261,8 @@ class CRM_Case_Form_Case extends CRM_Core_Form {
     }
     $this->add('text', 'activity_subject', ts('Subject'),
       array_merge($s, array(
-        'maxlength' => '128')), TRUE
+        'maxlength' => '128'
+      )), TRUE
     );
 
     CRM_Core_BAO_Tag::getTags('civicrm_case', $tags, NULL,
index d68e9cc794a091904ae76baaf203120c88d3bcd6..94e4978c53added6907aef7a76a803c46591984d 100644 (file)
@@ -61,8 +61,8 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form {
     if ($this->_showRelatedCases) {
       $relatedCases = $this->get('relatedCases');
       if (!isset($relatedCases)) {
-        $cId          = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject);
-        $caseId       = CRM_Utils_Request::retrieve('id', 'Integer', CRM_Core_DAO::$_nullObject);
+        $cId = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject);
+        $caseId = CRM_Utils_Request::retrieve('id', 'Integer', CRM_Core_DAO::$_nullObject);
         $relatedCases = CRM_Case_BAO_Case::getRelatedCases($caseId, $cId);
       }
       $this->assign('relatedCases', $relatedCases);
@@ -91,8 +91,8 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form {
 
     //validate case id.
     $this->_userCases = array();
-    $session          = CRM_Core_Session::singleton();
-    $userID           = $session->get('userID');
+    $session = CRM_Core_Session::singleton();
+    $userID = $session->get('userID');
     if (!$this->_hasAccessToAllCases) {
       $this->_userCases = CRM_Case_BAO_Case::getCases(FALSE, $userID, 'any');
       if (!array_key_exists($this->_caseID, $this->_userCases)) {
@@ -112,9 +112,9 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form {
     $returnProperties = array('case_type_id', 'subject', 'status_id', 'start_date');
     CRM_Core_DAO::commonRetrieve('CRM_Case_BAO_Case', $params, $values, $returnProperties);
 
-    $statuses     = CRM_Case_PseudoConstant::caseStatus('label', FALSE);
+    $statuses = CRM_Case_PseudoConstant::caseStatus('label', FALSE);
     $caseTypeName = CRM_Case_BAO_Case::getCaseType($this->_caseID, 'name');
-    $caseType     = CRM_Case_BAO_Case::getCaseType($this->_caseID);
+    $caseType = CRM_Case_BAO_Case::getCaseType($this->_caseID);
 
     $this->_caseDetails = array(
       'case_type' => $caseType,
@@ -168,7 +168,10 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form {
     }
     $this->assign('hasRelatedCases', (bool) $relatedCases);
     if ($relatedCases) {
-      $this->assign('relatedCaseLabel', ts('%1 Related Case', array('count' => count($relatedCases), 'plural' => '%1 Related Cases')));
+      $this->assign('relatedCaseLabel', ts('%1 Related Case', array(
+            'count' => count($relatedCases),
+            'plural' => '%1 Related Cases'
+          )));
       $this->assign('relatedCaseUrl', CRM_Utils_System::url('civicrm/contact/view/case', array(
         'id' => $this->_caseID,
         'cid' => $this->_contactID,
@@ -218,8 +221,8 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form {
       ->addScriptFile('civicrm', 'templates/CRM/Case/Form/CaseView.js', 2, 'html-header');
 
     $xmlProcessor = new CRM_Case_XMLProcessor_Process();
-    $caseRoles    = $xmlProcessor->get($this->_caseType, 'CaseRoles');
-    $reports      = $xmlProcessor->get($this->_caseType, 'ActivitySets');
+    $caseRoles = $xmlProcessor->get($this->_caseType, 'CaseRoles');
+    $reports = $xmlProcessor->get($this->_caseType, 'ActivitySets');
 
     //adding case manager.CRM-4510.
     $managerRoleId = $xmlProcessor->getCaseManagerRoleId($this->_caseType);
@@ -309,7 +312,8 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form {
         $this->add('select', 'merge_case_id',
           ts('Select Case for Merge'),
           array(
-            '' => ts('- select case -')) + $otherCases,
+            '' => ts('- select case -')
+          ) + $otherCases,
           FALSE,
           array('class' => 'crm-select2 huge')
         );
@@ -374,8 +378,8 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form {
     $this->assign('globalGroupInfo', $globalGroupInfo);
 
     // List of relationship types
-    $baoRel    = new CRM_Contact_BAO_Relationship();
-    $relType   = $baoRel->getRelationType('Individual');
+    $baoRel = new CRM_Contact_BAO_Relationship();
+    $relType = $baoRel->getRelationType('Individual');
     $roleTypes = array();
     foreach ($relType as $k => $v) {
       $roleTypes[substr($k, 0, strpos($k, '_'))] = $v;
@@ -455,9 +459,9 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form {
     $session->pushUserContext($url);
 
     if (!empty($params['timeline_id']) && !empty($_POST['_qf_CaseView_next'])) {
-      $session            = CRM_Core_Session::singleton();
-      $this->_uid         = $session->get('userID');
-      $xmlProcessor       = new CRM_Case_XMLProcessor_Process();
+      $session = CRM_Core_Session::singleton();
+      $this->_uid = $session->get('userID');
+      $xmlProcessor = new CRM_Case_XMLProcessor_Process();
       $xmlProcessorParams = array(
         'clientID' => $this->_contactID,
         'creatorID' => $this->_uid,
@@ -471,7 +475,7 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form {
       $reports = $xmlProcessor->get($this->_caseType, 'ActivitySets');
 
       CRM_Core_Session::setStatus(ts('Activities from the %1 activity set have been added to this case.',
-          array(1 => $reports[$params['timeline_id']])
+        array(1 => $reports[$params['timeline_id']])
       ), ts('Done'), 'success');
     }
     elseif ($this->_mergeCases &&
index 4441ce1e83ae6537b1cb03d97a47d86f9843a3e0..4a352c861c904d8c7b648c28106d41bfdc72b0e5 100644 (file)
@@ -74,8 +74,8 @@ class CRM_Case_Form_CustomData extends CRM_Core_Form {
    * @return void
    */
   public function preProcess() {
-    $this->_groupID   = CRM_Utils_Request::retrieve('groupID', 'Positive', $this, TRUE);
-    $this->_entityID  = CRM_Utils_Request::retrieve('entityID', 'Positive', $this, TRUE);
+    $this->_groupID = CRM_Utils_Request::retrieve('groupID', 'Positive', $this, TRUE);
+    $this->_entityID = CRM_Utils_Request::retrieve('entityID', 'Positive', $this, TRUE);
     $this->_subTypeID = CRM_Utils_Request::retrieve('subType', 'Positive', $this, TRUE);
     $this->_contactID = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
 
@@ -150,7 +150,7 @@ class CRM_Case_Form_CustomData extends CRM_Core_Form {
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/contact/view/case', "reset=1&id={$this->_entityID}&cid={$this->_contactID}&action=view"));
 
-    $session        = CRM_Core_Session::singleton();
+    $session = CRM_Core_Session::singleton();
     $activityTypeID = CRM_Core_OptionGroup::getValue('activity_type', 'Change Custom Data', 'name');
     $activityParams = array(
       'activity_type_id' => $activityTypeID,
index 10c8c152e6db54d86a6c0396ef3abe5783652206..0253bc94eb0de056ae33976bdc801347a0c21aef 100644 (file)
@@ -67,7 +67,9 @@ class CRM_Case_Form_EditClient extends CRM_Core_Form {
       $url = CRM_Utils_System::url('civicrm/case', 'reset=1');
     }
     elseif (in_array($context, array(
-      'dashlet', 'dashletFullscreen'))) {
+      'dashlet',
+      'dashletFullscreen'
+    ))) {
       $url = CRM_Utils_System::url('civicrm/dashboard', 'reset=1');
     }
     $session = CRM_Core_Session::singleton();
index e563b211d95c9d6bae6a08844a94e82ddede57ab..935d5e7f56b29ad3716bb5b0bb93e0b0bda7b868 100644 (file)
@@ -85,7 +85,7 @@ class CRM_Case_Form_Report extends CRM_Core_Form {
     }
 
     $includeActivites = array(
-    1 => ts('All Activities'),
+      1 => ts('All Activities'),
       2 => ts('Exclude Completed Activities'),
     );
     $includeActivitesGroup = $this->addRadio('include_activities',
index b509a9c2d15addc7b2a408772cfd2d9522b0fbc2..74cd7ba4b7de50aa4f4091d2a7ee17077d9d77ac 100644 (file)
@@ -100,9 +100,9 @@ class CRM_Case_Form_Search extends CRM_Core_Form_Search {
          * driven by the wizard framework
          */
 
-    $this->_reset   = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
-    $this->_force   = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE);
-    $this->_limit   = CRM_Utils_Request::retrieve('limit', 'Positive', $this);
+    $this->_reset = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
+    $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE);
+    $this->_limit = CRM_Utils_Request::retrieve('limit', 'Positive', $this);
     $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'search');
 
     $this->assign('context', $this->_context);
index 7fd46c836e7e2fa79f45a9dec385e70e0c23c760..1996ba56e52b174a62fd31168fa8d268d467e330 100644 (file)
@@ -133,8 +133,8 @@ class CRM_Case_Form_Task extends CRM_Core_Form {
     }
     else {
       $session->replaceUserContext(CRM_Utils_System::url("civicrm/contact/search/$searchFormName",
-          $urlParams
-        ));
+        $urlParams
+      ));
     }
   }
 
index f17c04db65562e54d70c724c454ce830bd1a4184..19466d0d6ab438d811ee2f8ae634fbb339e3bd8d 100644 (file)
@@ -47,9 +47,9 @@ class CRM_Case_Form_Task_SearchTaskHookSample extends CRM_Case_Form_Task {
     parent::preProcess();
     $rows = array();
     // display name and email of all contact ids
-    $caseIDs  = implode(',', $this->_caseIds);
+    $caseIDs = implode(',', $this->_caseIds);
     $statusId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'case_status', 'id', 'name');
-    $query    = "
+    $query = "
 SELECT ct.display_name as display_name,
        cs.start_date   as start_date,
        ov.label as status
index 1b0db3c88feef319e9dcc65f5eef3cc4c017bf16..d24104ccf1662ec317776e6810707e08e847797e 100644 (file)
@@ -153,7 +153,7 @@ class CRM_Case_Info extends CRM_Core_Component_Info {
    */
   public function registerTab() {
     return array(
-    'title' => ts('Cases'),
+      'title' => ts('Cases'),
       'url' => 'case',
       'weight' => 50,
     );
@@ -165,7 +165,7 @@ class CRM_Case_Info extends CRM_Core_Component_Info {
    */
   public function registerAdvancedSearchPane() {
     return array(
-    'title' => ts('Cases'),
+      'title' => ts('Cases'),
       'weight' => 50,
     );
   }
@@ -193,11 +193,12 @@ class CRM_Case_Info extends CRM_Core_Component_Info {
       if ($atype) {
         $shortCuts = array_merge($shortCuts, array(
           array(
-        'path' => 'civicrm/case/add',
-              'query' => "reset=1&action=add&atype=$atype&context=standalone",
-              'ref' => 'new-case',
-              'title' => ts('Case'),
-            )));
+            'path' => 'civicrm/case/add',
+            'query' => "reset=1&action=add&atype=$atype&context=standalone",
+            'ref' => 'new-case',
+            'title' => ts('Case'),
+          )
+        ));
       }
     }
   }
index 44ae2aab00c8f9462c9bbb897be5256c5bf5de9d..87e03e31263dee87a2b2227ef60fc6d77638e452 100644 (file)
@@ -130,16 +130,16 @@ class CRM_Case_Page_AJAX {
       CRM_Utils_System::permissionDenied();
     }
 
-    $sql       = "SELECT civicrm_case.*, civicrm_case_type.title as case_type
+    $sql = "SELECT civicrm_case.*, civicrm_case_type.title as case_type
         FROM civicrm_case
         INNER JOIN civicrm_case_type ON civicrm_case.case_type_id = civicrm_case_type.id
         WHERE civicrm_case.id = %1";
-    $dao       = CRM_Core_DAO::executeQuery($sql, array(1 => array($caseId, 'Integer')));
+    $dao = CRM_Core_DAO::executeQuery($sql, array(1 => array($caseId, 'Integer')));
 
     if ($dao->fetch()) {
       $caseStatuses = CRM_Case_PseudoConstant::caseStatus();
-      $cs           = $caseStatuses[$dao->status_id];
-      $caseDetails  = "<table><tr><td>" . ts('Case Subject') . "</td><td>{$dao->subject}</td></tr>
+      $cs = $caseStatuses[$dao->status_id];
+      $caseDetails = "<table><tr><td>" . ts('Case Subject') . "</td><td>{$dao->subject}</td></tr>
                                     <tr><td>" . ts('Case Type') . "</td><td>{$dao->case_type}</td></tr>
                                     <tr><td>" . ts('Case Status') . "</td><td>{$cs}</td></tr>
                                     <tr><td>" . ts('Case Start Date') . "</td><td>" . CRM_Utils_Date::customFormat($dao->start_date) . "</td></tr>
@@ -201,7 +201,7 @@ class CRM_Case_Page_AJAX {
    * Delete relationships specific to case and relationship type
    */
   public static function deleteCaseRoles() {
-    $caseId  = CRM_Utils_Type::escape($_POST['case_id'], 'Positive');
+    $caseId = CRM_Utils_Type::escape($_POST['case_id'], 'Positive');
     $relType = CRM_Utils_Type::escape($_POST['rel_type'], 'Positive');
 
     if (!$relType || !CRM_Case_BAO_Case::accessCase($caseId)) {
index 15cd39920b010050d690e4ea19ff542b7ff0176a..60e520ba400a64f22479d42e946bc24b9eb5e4f2 100644 (file)
@@ -41,9 +41,9 @@ class CRM_Case_Page_CaseDetails extends CRM_Core_Page {
    * return null
    */
   public function run() {
-    $this->_action  = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
+    $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
     $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
-    $type           = CRM_Utils_Request::retrieve('type', 'String', CRM_Core_DAO::$_nullObject);
+    $type = CRM_Utils_Request::retrieve('type', 'String', CRM_Core_DAO::$_nullObject);
 
     $this->assign('action', $this->_action);
     $this->assign('context', $this->_context);
index 58b2c82a758beb658416401fc1e0f93917ef924d..892bffd7b134e491256e65c9c6b3bd4928f3dc29 100644 (file)
@@ -85,9 +85,9 @@ class CRM_Case_Page_DashBoard extends CRM_Core_Page {
     ) {
       $this->assign('newClient', TRUE);
     }
-    $summary  = CRM_Case_BAO_Case::getCasesSummary($allCases, $userID);
+    $summary = CRM_Case_BAO_Case::getCasesSummary($allCases, $userID);
     $upcoming = CRM_Case_BAO_Case::getCases($allCases, $userID, 'upcoming');
-    $recent   = CRM_Case_BAO_Case::getCases($allCases, $userID, 'recent');
+    $recent = CRM_Case_BAO_Case::getCases($allCases, $userID, 'recent');
 
     foreach ($upcoming as $key => $value) {
       if (strtotime($value['case_scheduled_activity_date']) < time()) {
index 0cde99ac2c2afad124b9a6f4ebb0b2e98fdcfc8b..dfdaa28282d7b5b3f04e57953db3bc07d0ecfee5 100644 (file)
@@ -116,8 +116,8 @@ class CRM_Case_Page_Tab extends CRM_Core_Page {
     $controller->run();
 
     $this->assign('caseId', $this->_id);
-    $output     = CRM_Core_Selector_Controller::SESSION;
-    $selector   = new CRM_Activity_Selector_Activity($this->_contactId, $this->_permission, FALSE, 'case');
+    $output = CRM_Core_Selector_Controller::SESSION;
+    $selector = new CRM_Activity_Selector_Activity($this->_contactId, $this->_permission, FALSE, 'case');
     $controller =
       new CRM_Core_Selector_Controller(
         $selector,
@@ -292,7 +292,7 @@ class CRM_Case_Page_Tab extends CRM_Core_Page {
         break;
 
       case 'fulltext':
-        $action    = CRM_Utils_Request::retrieve('action', 'String', $this);
+        $action = CRM_Utils_Request::retrieve('action', 'String', $this);
         $urlParams = 'force=1';
         $urlString = 'civicrm/contact/search/custom';
         if ($action == CRM_Core_Action::RENEW) {
index 0886e09556d54113c94e952f8dfe348da841b19d..8efdef6aa39156598535e138151c65b1e452a949 100644 (file)
@@ -156,8 +156,8 @@ class CRM_Case_Selector_Search extends CRM_Core_Selector_Base {
     // submitted form values
     $this->_queryParams = &$queryParams;
 
-    $this->_single  = $single;
-    $this->_limit   = $limit;
+    $this->_single = $single;
+    $this->_limit = $limit;
     $this->_context = $context;
 
     $this->_additionalClause = $additionalClause;
index e129ca7d63d31ea138b690fa317ba2a0016ed4bb..d434104b185eb5dfe350c30358b5e5a9fd495d04 100644 (file)
@@ -45,8 +45,8 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor {
     if ($xml === FALSE) {
       $docLink = CRM_Utils_System::docURL2("user/case-management/setup");
       CRM_Core_Error::fatal(ts("Configuration file could not be retrieved for case type = '%1' %2.",
-          array(1 => $caseType, 2 => $docLink)
-        ));
+        array(1 => $caseType, 2 => $docLink)
+      ));
       return FALSE;
     }
 
@@ -70,8 +70,8 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor {
     if ($xml === FALSE) {
       $docLink = CRM_Utils_System::docURL2("user/case-management/setup");
       CRM_Core_Error::fatal(ts("Unable to load configuration file for the referenced case type: '%1' %2.",
-          array(1 => $caseType, 2 => $docLink)
-        ));
+        array(1 => $caseType, 2 => $docLink)
+      ));
       return FALSE;
     }
 
@@ -95,7 +95,7 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor {
    */
   public function process($xml, &$params) {
     $standardTimeline = CRM_Utils_Array::value('standardTimeline', $params);
-    $activitySetName  = CRM_Utils_Array::value('activitySetName', $params);
+    $activitySetName = CRM_Utils_Array::value('activitySetName', $params);
     $activityTypeName = CRM_Utils_Array::value('activityTypeName', $params);
 
     if ('Open Case' == CRM_Utils_Array::value('activityTypeName', $params)) {
@@ -104,8 +104,9 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor {
         foreach ($caseRoleXML->RelationshipType as $relationshipTypeXML) {
           if ((int ) $relationshipTypeXML->creator == 1) {
             if (!$this->createRelationships((string ) $relationshipTypeXML->name,
-                $params
-              )) {
+              $params
+            )
+            ) {
               CRM_Core_Error::fatal();
               return FALSE;
             }
@@ -146,7 +147,8 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor {
    */
   public function processStandardTimeline($activitySetXML, &$params) {
     if ('Change Case Type' == CRM_Utils_Array::value('activityTypeName', $params)
-      && CRM_Utils_Array::value('resetTimeline', $params, TRUE)) {
+      && CRM_Utils_Array::value('resetTimeline', $params, TRUE)
+    ) {
       // delete all existing activities which are non-empty
       $this->deleteEmptyActivity($params);
     }
@@ -216,8 +218,8 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor {
     if ($relationshipTypeID === FALSE) {
       $docLink = CRM_Utils_System::docURL2("user/case-management/setup");
       CRM_Core_Error::fatal(ts('Relationship type %1, found in case configuration file, is not present in the database %2',
-          array(1 => $relationshipTypeName, 2 => $docLink)
-        ));
+        array(1 => $relationshipTypeName, 2 => $docLink)
+      ));
       return FALSE;
     }
 
@@ -273,7 +275,7 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor {
     foreach ($activityTypesXML as $activityTypeXML) {
       foreach ($activityTypeXML as $recordXML) {
         $activityTypeName = (string ) $recordXML->name;
-        $maxInstances     = (string ) $recordXML->max_instances;
+        $maxInstances = (string ) $recordXML->max_instances;
         $activityTypeInfo = CRM_Utils_Array::value($activityTypeName, $activityTypes);
 
         if ($activityTypeInfo['id']) {
@@ -390,7 +392,7 @@ AND        a.is_deleted = 0
 ";
 
     $sqlParams = array(
-    1 => array($params['activityTypeID'], 'Integer'),
+      1 => array($params['activityTypeID'], 'Integer'),
       2 => array($params['caseID'], 'Integer'),
     );
     $count = CRM_Core_DAO::singleValueQuery($query, $sqlParams);
@@ -412,14 +414,14 @@ AND        a.is_deleted = 0
    */
   public function createActivity($activityTypeXML, &$params) {
     $activityTypeName = (string) $activityTypeXML->name;
-    $activityTypes    = &$this->allActivityTypes(TRUE, TRUE);
+    $activityTypes = &$this->allActivityTypes(TRUE, TRUE);
     $activityTypeInfo = CRM_Utils_Array::value($activityTypeName, $activityTypes);
 
     if (!$activityTypeInfo) {
       $docLink = CRM_Utils_System::docURL2("user/case-management/setup");
       CRM_Core_Error::fatal(ts('Activity type %1, found in case configuration file, is not present in the database %2',
-          array(1 => $activityTypeName, 2 => $docLink)
-        ));
+        array(1 => $activityTypeName, 2 => $docLink)
+      ));
       return FALSE;
     }
 
index 0b4e3600efd4f11666d9b2a20a1757fcba9117e0..d5dded61d2b288bebfe1e3f57c6941a0ed6cf761 100644 (file)
@@ -67,7 +67,9 @@ class CRM_Case_XMLProcessor_Report extends CRM_Case_XMLProcessor {
 
   public function &getRedactionRules() {
     foreach (array(
-      'redactionStringRules', 'redactionRegexRules') as $key => $rule) {
+               'redactionStringRules',
+               'redactionRegexRules'
+             ) as $key => $rule) {
       $$rule = CRM_Case_PseudoConstant::redactionRule($key);
 
       if (!empty($$rule)) {
@@ -126,9 +128,9 @@ class CRM_Case_XMLProcessor_Report extends CRM_Case_XMLProcessor {
     $dao = new CRM_Case_DAO_Case();
     $dao->id = $caseID;
     if ($dao->find(TRUE)) {
-      $case['subject']    = $dao->subject;
+      $case['subject'] = $dao->subject;
       $case['start_date'] = $dao->start_date;
-      $case['end_date']   = $dao->end_date;
+      $case['end_date'] = $dao->end_date;
       // FIXME: when we resolve if case_type_is single or multi-select
       if (strpos($dao->case_type_id, CRM_Core_DAO::VALUE_SEPARATOR) !== FALSE) {
         $caseTypeID = substr($dao->case_type_id, 1, -1);
@@ -320,7 +322,10 @@ WHERE      a.id = %1
     if ($clientID) {
       $clientID = CRM_Utils_Type::escape($clientID, 'Integer');
       if (!in_array($activityTypeInfo['name'], array(
-        'Email', 'Inbound Email'))) {
+        'Email',
+        'Inbound Email'
+      ))
+      ) {
         $activity['editURL'] = CRM_Utils_System::url('civicrm/case/activity',
           "reset=1&cid={$clientID}&caseid={$activityDAO->caseID}&action=update&atype={$activityDAO->activity_type_id}&id={$activityDAO->id}"
         );
@@ -356,9 +361,9 @@ WHERE      a.id = %1
     if (!empty($activityDAO->targetID)) {
       // Re-lookup the target ID since the DAO only has the first recipient if there are multiple.
       // Maybe not the best solution.
-      $targetNames   = CRM_Activity_BAO_ActivityContact::getNames($activityDAO->id, $targetID);
+      $targetNames = CRM_Activity_BAO_ActivityContact::getNames($activityDAO->id, $targetID);
       $processTarget = FALSE;
-      $label         = ts('With Contact(s)');
+      $label = ts('With Contact(s)');
       if (in_array($activityTypeInfo['name'], array('Email', 'Inbound Email'))) {
         $processTarget = TRUE;
         $label = ts('Recipient');
@@ -438,7 +443,7 @@ WHERE      a.id = %1
       );
 
       $reporterSortName = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact',
-       $source_contact_id,
+        $source_contact_id,
         'sort_name'
       );
       if (!array_key_exists($reporterSortName, $this->_redactionStringRules)) {
@@ -629,9 +634,11 @@ AND    cg.extends = 'Activity'";
       }
       $query .= "ORDER BY cg.weight, cf.weight";
       $params = array(
-        1 => array($activityTypeID,
+        1 => array(
+          $activityTypeID,
           'Integer',
-        ));
+        )
+      );
       $dao = CRM_Core_DAO::executeQuery($query, $params);
 
       $result = $options = $sql = $groupTitle = array();
@@ -788,7 +795,7 @@ LIMIT  1
 
     // next get activity set Informtion
     $activitySet = array(
-    'label' => $form->getActivitySetLabel($xml, $activitySetName),
+      'label' => $form->getActivitySetLabel($xml, $activitySetName),
       'includeActivities' => 'All',
       'redact' => 'false',
     );
@@ -805,13 +812,13 @@ LIMIT  1
   }
 
   public static function printCaseReport() {
-    $caseID            = CRM_Utils_Request::retrieve('caseID', 'Positive', CRM_Core_DAO::$_nullObject);
-    $clientID          = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject);
-    $activitySetName   = CRM_Utils_Request::retrieve('asn', 'String', CRM_Core_DAO::$_nullObject);
-    $isRedact          = CRM_Utils_Request::retrieve('redact', 'Boolean', CRM_Core_DAO::$_nullObject);
+    $caseID = CRM_Utils_Request::retrieve('caseID', 'Positive', CRM_Core_DAO::$_nullObject);
+    $clientID = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject);
+    $activitySetName = CRM_Utils_Request::retrieve('asn', 'String', CRM_Core_DAO::$_nullObject);
+    $isRedact = CRM_Utils_Request::retrieve('redact', 'Boolean', CRM_Core_DAO::$_nullObject);
     $includeActivities = CRM_Utils_Request::retrieve('all', 'Positive', CRM_Core_DAO::$_nullObject);
-    $params            = $otherRelationships = $globalGroupInfo = array();
-    $report            = new CRM_Case_XMLProcessor_Report($isRedact);
+    $params = $otherRelationships = $globalGroupInfo = array();
+    $report = new CRM_Case_XMLProcessor_Report($isRedact);
     if ($includeActivities) {
       $params['include_activities'] = 1;
     }
index 8ec73aabfef4655a6ecbf56a14db450aae77d3a3..b2111ec8ea79472f661c925a3bba17f1670bc250 100644 (file)
@@ -65,7 +65,7 @@ class CRM_Case_XMLRepository {
   }
 
   /**
-   * @param array<String,SimpleXMLElement> $xml
+   * @param array <String,SimpleXMLElement> $xml
    */
   public function __construct($allCaseTypes = NULL, $xml = array()) {
     $this->allCaseTypes = $allCaseTypes;
index 595310b4910b711cf53c4ff83a6ad7cd028d106e..d32bbf829ff114ff15335c0fa14f2ec60a499d66 100644 (file)
@@ -200,7 +200,7 @@ AND civicrm_contact.id IN $idString ";
       $location['url'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $dao->contact_id);
       $location['location_type'] = $dao->location_type;
       $location['image'] = CRM_Contact_BAO_Contact_Utils::getImage(isset($dao->contact_sub_type) ?
-        $dao->contact_sub_type : $dao->contact_type, $imageUrlOnly, $dao->contact_id
+          $dao->contact_sub_type : $dao->contact_type, $imageUrlOnly, $dao->contact_id
       );
       $locations[] = $location;
     }
index 4f4042200d34c0b27062da0945ea00a8610c57ff..fd736ab5fe82ead8505ea23b5f5188c85349a4c8 100644 (file)
@@ -62,14 +62,14 @@ class CRM_Contact_BAO_Contact_Optimizer {
     $old = $new = array();
 
     foreach ($oldWebsiteValues as $idx => $value) {
-      if (! empty($value['url'])) {
+      if (!empty($value['url'])) {
         $oldEmpty = FALSE;
         $old[] = array('website_type_id' => $value['website_type_id'], 'url' => $value['url']);
       }
     }
 
     foreach ($newWebsiteValues as $idx => $value) {
-      if (! empty($value['url'])) {
+      if (!empty($value['url'])) {
         $newEmpty = FALSE;
         $new[] = array('website_type_id' => $value['website_type_id'], 'url' => $value['url']);
       }
@@ -97,7 +97,7 @@ class CRM_Contact_BAO_Contact_Optimizer {
           unset($new[$newID]);
           break;
         }
-        if (! $found) {
+        if (!$found) {
           return;
         }
       }
@@ -125,31 +125,31 @@ class CRM_Contact_BAO_Contact_Optimizer {
     $old = $new = array();
 
     foreach ($oldEmailValues as $idx => $value) {
-      if (! empty($value['email'])) {
+      if (!empty($value['email'])) {
         $oldEmpty = FALSE;
         $old[] = array(
-          'email'            => $value['email'],
+          'email' => $value['email'],
           'location_type_id' => $value['location_type_id'],
-          'on_hold'          => $value['on_hold']     ? 1 : 0,
-          'is_primary'       => $value['is_primary']  ? 1 : 0,
-          'is_bulkmail'      => $value['is_bulkmail'] ? 1 : 0,
-          'signature_text'   => $value['signature_text'] ? $value['signature_text'] : '',
-          'signature_html'   => $value['signature_html'] ? $value['signature_html'] : '',
+          'on_hold' => $value['on_hold'] ? 1 : 0,
+          'is_primary' => $value['is_primary'] ? 1 : 0,
+          'is_bulkmail' => $value['is_bulkmail'] ? 1 : 0,
+          'signature_text' => $value['signature_text'] ? $value['signature_text'] : '',
+          'signature_html' => $value['signature_html'] ? $value['signature_html'] : '',
         );
       }
     }
 
     foreach ($newEmailValues as $idx => $value) {
-      if (! empty($value['email'])) {
+      if (!empty($value['email'])) {
         $newEmpty = FALSE;
         $new[] = array(
-          'email'            => $value['email'],
+          'email' => $value['email'],
           'location_type_id' => $value['location_type_id'],
-          'on_hold'          => $value['on_hold']     ? 1 : 0,
-          'is_primary'       => $value['is_primary']  ? 1 : 0,
-          'is_bulkmail'      => $value['is_bulkmail'] ? 1 : 0,
-          'signature_text'   => $value['signature_text'] ? $value['signature_text'] : '',
-          'signature_html'   => $value['signature_html'] ? $value['signature_html'] : '',
+          'on_hold' => $value['on_hold'] ? 1 : 0,
+          'is_primary' => $value['is_primary'] ? 1 : 0,
+          'is_bulkmail' => $value['is_bulkmail'] ? 1 : 0,
+          'signature_text' => $value['signature_text'] ? $value['signature_text'] : '',
+          'signature_html' => $value['signature_html'] ? $value['signature_html'] : '',
         );
       }
     }
@@ -176,7 +176,7 @@ class CRM_Contact_BAO_Contact_Optimizer {
           unset($new[$newID]);
           break;
         }
-        if (! $found) {
+        if (!$found) {
           return;
         }
       }
index 5e15d510223c921a5258b7af2ace563e1b37ee2b..6b540804f164397fc45dc6dd044ba9f990c190f3 100644 (file)
@@ -328,7 +328,7 @@ WHERE  (( contact_id_a = %1 AND contact_id_b = %2 AND is_permission_a_b = 1 ) OR
 ";
       }
       $params = array(
-      1 => array($contactID, 'Integer'),
+        1 => array($contactID, 'Integer'),
         2 => array($selectedContactID, 'Integer'),
       );
       return CRM_Core_DAO::singleValueQuery($query, $params);
@@ -346,8 +346,9 @@ WHERE  (( contact_id_a = %1 AND contact_id_b = %2 AND is_permission_a_b = 1 ) OR
   public static function validateOnlyChecksum($contactID, &$form, $redirect = TRUE) {
     // check if this is of the format cs=XXX
     if (!CRM_Contact_BAO_Contact_Utils::validChecksum($contactID,
-        CRM_Utils_Request::retrieve('cs', 'String', $form, FALSE)
-      )) {
+      CRM_Utils_Request::retrieve('cs', 'String', $form, FALSE)
+    )
+    ) {
       if ($redirect) {
         // also set a message in the UF framework
         $message = ts('You do not have permission to edit this contact record. Contact the site administrator if you need assistance.');
index a5eaf5c8bf9cf0e421ca9f5e9cec69b89acb16cb..c7068f3b360da98aadbc14673b1a3280ecc62ecc 100644 (file)
@@ -336,7 +336,7 @@ UNION
       );
       list($valid, $invalid, $duplicate,
         $saved, $relationshipIds
-      ) = CRM_Contact_BAO_Relationship::createMultiple($relationshipParams, $cid);
+        ) = CRM_Contact_BAO_Relationship::createMultiple($relationshipParams, $cid);
 
 
       // In case we change employer, clean previous employer related records.
@@ -512,7 +512,7 @@ WHERE id={$contactId}; ";
         break;
 
       case 'Household':
-        $form->add('text', 'household_name', ts('Household Name'),  $attributes['household_name']);
+        $form->add('text', 'household_name', ts('Household Name'), $attributes['household_name']);
         break;
 
       default:
@@ -613,7 +613,9 @@ UPDATE civicrm_contact
 
       // check permission on acl basis.
       if (in_array($task, array(
-        'view', 'edit'))) {
+        'view',
+        'edit'
+      ))) {
         $aclPermission = CRM_Core_Permission::VIEW;
         if ($task == 'edit') {
           $aclPermission = CRM_Core_Permission::EDIT;
@@ -663,9 +665,9 @@ LEFT JOIN  civicrm_email ce ON ( ce.contact_id=c.id AND ce.is_primary = 1 )
         }
       }
       if (!empty($originalId) && array_key_exists('merge', $hasPermissions)) {
-        $rgBao               = new CRM_Dedupe_BAO_RuleGroup();
+        $rgBao = new CRM_Dedupe_BAO_RuleGroup();
         $rgBao->contact_type = $dao->contact_type;
-        $rgBao->used         = 'Supervised';
+        $rgBao->used = 'Supervised';
         if ($rgBao->find(TRUE)) {
           $rgid = $rgBao->id;
         }
@@ -708,8 +710,8 @@ LEFT JOIN  civicrm_email ce ON ( ce.contact_id=c.id AND ce.is_primary = 1 )
         'contact_autocomplete_options'
       );
       $returnProperties = array_fill_keys(array_merge(array('sort_name'),
-          array_keys($autocompleteContactSearch)
-        ), 1);
+        array_keys($autocompleteContactSearch)
+      ), 1);
     }
 
     $compTable = NULL;
@@ -730,7 +732,9 @@ LEFT JOIN  civicrm_email ce ON ( ce.contact_id=c.id AND ce.is_primary = 1 )
     $select = $from = array();
     foreach ($returnProperties as $property => $ignore) {
       $value = (in_array($property, array(
-        'city', 'street_address'))) ? 'address' : $property;
+        'city',
+        'street_address'
+      ))) ? 'address' : $property;
       switch ($property) {
         case 'sort_name':
           if ($componentName == 'Activity') {
@@ -787,9 +791,9 @@ INNER JOIN civicrm_contact contact_target ON ( contact_target.id = act.contact_i
 
     //finally retrieve contact details.
     if (!empty($select) && !empty($from)) {
-      $fromClause   = implode(' ', $from);
+      $fromClause = implode(' ', $from);
       $selectClause = implode(', ', $select);
-      $whereClause  = "{$compTable}.id IN (" . implode(',', $componentIds) . ')';
+      $whereClause = "{$compTable}.id IN (" . implode(',', $componentIds) . ')';
 
       $query = "
   SELECT  contact.id as contactId, $compTable.id as componentId, $selectClause
@@ -855,15 +859,15 @@ Group By  componentId";
       foreach ($values as $field => $submittedValue) {
         if (!in_array($field, $skipFields)) {
           if (isset($masterAddress->$field)) {
-          $values[$field] = $masterAddress->$field;
+            $values[$field] = $masterAddress->$field;
           }
           else {
             $values[$field] = '';
+          }
         }
       }
     }
   }
-  }
 
   /**
    * Get the list of contact name give address associated array
@@ -935,10 +939,10 @@ Group By  componentId";
    */
   public static function updateGreeting($params) {
     $contactType = $params['ct'];
-    $greeting    = $params['gt'];
-    $valueID     = $id = CRM_Utils_Array::value('id', $params);
-    $force       = CRM_Utils_Array::value('force', $params);
-    $limit       = CRM_Utils_Array::value('limit', $params);
+    $greeting = $params['gt'];
+    $valueID = $id = CRM_Utils_Array::value('id', $params);
+    $force = CRM_Utils_Array::value('force', $params);
+    $limit = CRM_Utils_Array::value('limit', $params);
 
     // if valueID is not passed use default value
     if (!$valueID) {
index cf0235eb7c092aedae5f0105f992a01c2bce3aec..74fc006e6dfdd362fd9d9cc91640ea61b63912f5 100644 (file)
@@ -421,12 +421,12 @@ AND   ( p.is_active = 1 OR p.id IS NULL )
         $dao = CRM_Core_DAO::executeQuery($sql);
         while ($dao->fetch()) {
           if (!empty($dao->parent_id)) {
-            $key   = $isSeparator ? $dao->parent_name . $separator . $dao->child_name : $dao->child_name;
+            $key = $isSeparator ? $dao->parent_name . $separator . $dao->child_name : $dao->child_name;
             $label = "- {$dao->child_label}";
             $pName = $dao->parent_name;
           }
           else {
-            $key   = $dao->child_name;
+            $key = $dao->child_name;
             $label = $dao->child_label;
             $pName = $dao->child_name;
           }
@@ -469,7 +469,7 @@ AND   ( p.is_active = 1 OR p.id IS NULL )
   /**
    * Retrieve the basic contact type associated with given subType.
    *
-   * @param array/string $subType contact subType.
+   * @param array /string $subType contact subType.
    * @return array/string of basicTypes.
    * @static
    */
@@ -665,8 +665,8 @@ WHERE name = %1";
     $contactType->save();
     if ($contactType->find(TRUE)) {
       $contactName = $contactType->name;
-      $contact     = ucfirst($contactType->label);
-      $active      = $contactType->is_active;
+      $contact = ucfirst($contactType->label);
+      $active = $contactType->is_active;
     }
 
     if (!empty($params['id'])) {
@@ -819,8 +819,8 @@ WHERE name = %1";
   public static function hasRelationships($contactId, $contactType) {
     $subTypeClause = NULL;
     if (self::isaSubType($contactType)) {
-      $subType       = $contactType;
-      $contactType   = self::getBasicType($subType);
+      $subType = $contactType;
+      $contactType = self::getBasicType($subType);
       $subTypeClause = " AND ( ( crt.contact_type_a = '{$contactType}' AND crt.contact_sub_type_a = '{$subType}') OR
                                      ( crt.contact_type_b = '{$contactType}' AND crt.contact_sub_type_b = '{$subType}')  ) ";
     }
@@ -859,8 +859,8 @@ LIMIT 1";
 
     $customSet = $subTypeClause = array();
     foreach ($subtypeSet as $subtype) {
-      $subtype         = CRM_Utils_Type::escape($subtype, 'String');
-      $subType         = CRM_Core_DAO::VALUE_SEPARATOR . $subtype . CRM_Core_DAO::VALUE_SEPARATOR;
+      $subtype = CRM_Utils_Type::escape($subtype, 'String');
+      $subType = CRM_Core_DAO::VALUE_SEPARATOR . $subtype . CRM_Core_DAO::VALUE_SEPARATOR;
       $subTypeClause[] = "extends_entity_column_value LIKE '%{$subtype}%' ";
     }
     $query = "SELECT table_name
index d4ddda8a5d04d9ece2b90e997c17556583676989..27ecfcea0763c922749cdf75c9ce0f5e35fd6716 100644 (file)
@@ -1,34 +1,34 @@
 <?php
-  /*
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  | CiviCRM is free software; you can copy, modify, and distribute it  |
  | under the terms of the GNU Affero General Public License           |
  | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
  |                                                                    |
  | CiviCRM is distributed in the hope that it will be useful, but     |
  | WITHOUT ANY WARRANTY; without even the implied warranty of         |
  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
  | See the GNU Affero General Public License for more details.        |
  |                                                                    |
  | You should have received a copy of the GNU Affero General Public   |
  | License and the CiviCRM Licensing Exception along                  |
  | with this program; if not, contact CiviCRM LLC                     |
  | at info[AT]civicrm[DOT]org. If you have questions about the        |
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-  */
+/*
+ +--------------------------------------------------------------------+
+ | CiviCRM version 4.6                                                |
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
+ +--------------------------------------------------------------------+
+ | This file is a part of CiviCRM.                                    |
+ |                                                                    |
+ | CiviCRM is free software; you can copy, modify, and distribute it  |
+ | under the terms of the GNU Affero General Public License           |
+ | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
+ |                                                                    |
+ | CiviCRM is distributed in the hope that it will be useful, but     |
+ | WITHOUT ANY WARRANTY; without even the implied warranty of         |
+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
+ | See the GNU Affero General Public License for more details.        |
+ |                                                                    |
+ | You should have received a copy of the GNU Affero General Public   |
+ | License and the CiviCRM Licensing Exception along                  |
+ | with this program; if not, contact CiviCRM LLC                     |
+ | at info[AT]civicrm[DOT]org. If you have questions about the        |
+ | GNU Affero General Public License or the licensing of CiviCRM,     |
+ | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
+ +--------------------------------------------------------------------+
+*/
 
-  /**
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  */
+/**
+ * @package CRM
+ * @copyright CiviCRM LLC (c) 2004-2014
+ * $Id$
+ */
 class CRM_Contact_BAO_DashboardContact extends CRM_Contact_DAO_DashboardContact {
 }
index 57e727032dacdc0957aa461f787f12bae869d626..f991b47a8919d96cfdb1aa0b3c93d13dd7083e31 100644 (file)
@@ -118,8 +118,9 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group {
     CRM_Core_DAO::executeQuery($query, $params);
 
     if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME,
-        'is_enabled'
-      )) {
+      'is_enabled'
+    )
+    ) {
       // clear any descendant groups cache if exists
       CRM_Core_BAO_Cache::deleteGroup('descendant groups for an org');
     }
@@ -372,8 +373,8 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group {
     if (isset($params['group_type'])) {
       if (is_array($params['group_type'])) {
         $params['group_type'] = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,
-          array_keys($params['group_type'])
-        ) . CRM_Core_DAO::VALUE_SEPARATOR;
+            array_keys($params['group_type'])
+          ) . CRM_Core_DAO::VALUE_SEPARATOR;
       }
     }
     else {
@@ -400,8 +401,8 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group {
     // we need the $params one to be in it's original form & we are not sure what test coverage we have on that
     if (isset($group->parents) && is_array($group->parents)) {
       $group->parents = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,
-        array_keys($group->parents)
-      ) . CRM_Core_DAO::VALUE_SEPARATOR;
+          array_keys($group->parents)
+        ) . CRM_Core_DAO::VALUE_SEPARATOR;
     }
     if (empty($params['id']) &&
       !$nameParam
@@ -663,10 +664,10 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group {
       //save the mapping for search builder
       if (!$ssId) {
         //save record in mapping table
-        $temp          = array();
+        $temp = array();
         $mappingParams = array('mapping_type' => 'Search Builder');
-        $mapping       = CRM_Core_BAO_Mapping::add($mappingParams, $temp);
-        $mappingId     = $mapping->id;
+        $mapping = CRM_Core_BAO_Mapping::add($mappingParams, $temp);
+        $mappingId = $mapping->id;
       }
       else {
         //get the mapping id from saved search
@@ -730,9 +731,9 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group {
    */
   static public function getGroupListSelector(&$params) {
     // format the params
-    $params['offset']   = ($params['page'] - 1) * $params['rp'];
+    $params['offset'] = ($params['page'] - 1) * $params['rp'];
     $params['rowCount'] = $params['rp'];
-    $params['sort']     = CRM_Utils_Array::value('sortBy', $params);
+    $params['sort'] = CRM_Utils_Array::value('sortBy', $params);
 
     // get groups
     $groups = CRM_Contact_BAO_Group::getGroupList($params);
@@ -1167,9 +1168,9 @@ WHERE {$whereClause}";
     if ($groupType) {
       $types = explode(',', $groupType);
       if (!empty($types)) {
-        $clauses[]  = 'groups.group_type LIKE %2';
+        $clauses[] = 'groups.group_type LIKE %2';
         $typeString = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR, $types) . CRM_Core_DAO::VALUE_SEPARATOR;
-        $params[2]  = array($typeString, 'String', TRUE);
+        $params[2] = array($typeString, 'String', TRUE);
       }
     }
 
index 34d12ab7bd8828957d40f59001a4cec8a0856dc2..fd717dbb505eb1003a666866fe316ef209c5a921 100644 (file)
@@ -146,7 +146,7 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact {
 
     list($numContactsAdded,
       $numContactsNotAdded
-    ) = self::bulkAddContactsToGroup($contactIds,
+      ) = self::bulkAddContactsToGroup($contactIds,
       $groupId,
       $method,
       $status,
index dabeebe47cbcb8c7a4fb4ec058c660b37124fdbb..32eef80a54d9422f4fac1aa810c311575790f1d1 100644 (file)
@@ -119,7 +119,7 @@ AND     ( g.cache_date IS NULL OR
    * Check to see if we have cache entries for this group
    * if not, regenerate, else return
    *
-   * @param int/array $groupID groupID of group that we are checking against
+   * @param int /array $groupID groupID of group that we are checking against
    *                           if empty, all groups are checked
    * @param int $limit
    *   Limits the number of groups we evaluate.
@@ -177,7 +177,7 @@ AND     ( g.cache_date IS NULL OR
 
     if (!empty($refreshGroupIDs)) {
       $refreshGroupIDString = CRM_Core_DAO::escapeString(implode(', ', $refreshGroupIDs));
-      $time  = CRM_Utils_Date::getUTCTime(self::smartGroupCacheTimeout() * 60);
+      $time = CRM_Utils_Date::getUTCTime(self::smartGroupCacheTimeout() * 60);
       $query = "
 UPDATE civicrm_group g
 SET    g.refresh_date = $time
@@ -237,9 +237,9 @@ AND    g.refresh_date IS NULL
     // to avoid long strings, lets do BULK_INSERT_COUNT values at a time
     while (!empty($values)) {
       $processed = TRUE;
-      $input     = array_splice($values, 0, CRM_Core_DAO::BULK_INSERT_COUNT);
-      $str       = implode(',', $input);
-      $sql       = "INSERT IGNORE INTO civicrm_group_contact_cache (group_id,contact_id) VALUES $str;";
+      $input = array_splice($values, 0, CRM_Core_DAO::BULK_INSERT_COUNT);
+      $str = implode(',', $input);
+      $sql = "INSERT IGNORE INTO civicrm_group_contact_cache (group_id,contact_id) VALUES $str;";
       CRM_Core_DAO::executeQuery($sql);
     }
     self::updateCacheTime($groupID, $processed);
@@ -257,11 +257,11 @@ AND    g.refresh_date IS NULL
     if ($processed) {
       // also update the group with cache date information
       //make sure to give original timezone settings again.
-      $now     = CRM_Utils_Date::getUTCTime();
+      $now = CRM_Utils_Date::getUTCTime();
       $refresh = 'null';
     }
     else {
-      $now     = 'null';
+      $now = 'null';
       $refresh = 'null';
     }
 
@@ -319,10 +319,10 @@ WHERE  id IN ( $groupIDs )
     }
 
     $refresh = NULL;
-    $params  = array();
+    $params = array();
     $smartGroupCacheTimeout = self::smartGroupCacheTimeout();
 
-    $now         = CRM_Utils_Date::getUTCTime();
+    $now = CRM_Utils_Date::getUTCTime();
     $refreshTime = CRM_Utils_Date::getUTCTime($smartGroupCacheTimeout * 60);
 
     if (!isset($groupID)) {
@@ -459,8 +459,8 @@ WHERE  id = %1
       return;
     }
 
-    $sql         = NULL;
-    $idName      = 'id';
+    $sql = NULL;
+    $idName = 'id';
     $customClass = NULL;
     if ($savedSearchID) {
       $ssParams = CRM_Contact_BAO_SavedSearch::getSearchParams($savedSearchID);
@@ -501,18 +501,18 @@ WHERE  id = %1
             FALSE,
             CRM_Utils_Array::value('display_relationship_type', $formValues),
             CRM_Utils_Array::value('operator', $formValues, 'AND')
-        );
+          );
         $query->_useDistinct = FALSE;
-        $query->_useGroupBy  = FALSE;
-        $searchSQL           =
+        $query->_useGroupBy = FALSE;
+        $searchSQL =
           $query->searchQuery(
             0, 0, NULL,
-          FALSE, FALSE,
-          FALSE, TRUE,
-          TRUE,
-          NULL, NULL, NULL,
-          TRUE
-        );
+            FALSE, FALSE,
+            FALSE, TRUE,
+            TRUE,
+            NULL, NULL, NULL,
+            TRUE
+          );
       }
       $groupID = CRM_Utils_Type::escape($groupID, 'Integer');
       $sql = $searchSQL . " AND contact_a.id NOT IN (
@@ -536,7 +536,7 @@ WHERE  civicrm_group_contact.status = 'Added'
     $groupIDs = array($groupID);
     self::remove($groupIDs);
     $processed = FALSE;
-    $tempTable = 'civicrm_temp_group_contact_cache' . rand(0,2000);
+    $tempTable = 'civicrm_temp_group_contact_cache' . rand(0, 2000);
     foreach (array($sql, $sqlB) as $selectSql) {
       if (!$selectSql) {
         continue;
@@ -595,7 +595,8 @@ AND  civicrm_group_contact.group_id = $groupID ";
     if (
       isset($config->smartGroupCacheTimeout) &&
       is_numeric($config->smartGroupCacheTimeout) &&
-      $config->smartGroupCacheTimeout > 0) {
+      $config->smartGroupCacheTimeout > 0
+    ) {
       return $config->smartGroupCacheTimeout;
     }
 
index 78c9816dec245d2190077fef64981ab6cc0d4f54..af8b73c5b68c3cfcf40f083b48ef67afce151119 100644 (file)
@@ -113,9 +113,9 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen
       $this->valid() &&
       !$this->_alreadyStyled
     ) {
-      $styledGroup  = clone($this->_current);
+      $styledGroup = clone($this->_current);
       $nestingLevel = $this->getCurrentNestingLevel();
-      $indent       = '';
+      $indent = '';
       while ($nestingLevel--) {
         $indent .= $this->_styleIndent;
       }
@@ -158,7 +158,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen
       $nextGroup = $this->_getNextSiblingGroup($currentGroup);
       if (!$nextGroup) {
         // no sibling, find an ancestor w/ a sibling
-        for (;;) {
+        for (; ;) {
           // since we pop this array everytime, we should be
           // reasonably safe from infinite loops, I think :)
           $ancestor = array_pop($this->_parentStack);
@@ -197,7 +197,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen
    */
   public function _getNextParentlessGroup(&$group = NULL) {
     $lastParentlessGroup = $this->_lastParentlessGroup;
-    $nextGroup           = new CRM_Contact_BAO_Group();
+    $nextGroup = new CRM_Contact_BAO_Group();
     $nextGroup->order_by = 'title ' . self::$_sortOrder;
     $nextGroup->find();
     if ($group == NULL) {
index d363bc16b9c572cd7b0009ef670a85b60ee547bc..e16644e14e4d001f596aa44d96db3fb79a56a501 100644 (file)
@@ -82,11 +82,11 @@ SET    parents  = null,
 
     $values = array();
     foreach (array_keys($tree) as $id) {
-      $parents  = implode(',', $tree[$id]['parents']);
+      $parents = implode(',', $tree[$id]['parents']);
       $children = implode(',', $tree[$id]['children']);
-      $parents  = $parents == NULL ? 'null' : "'$parents'";
+      $parents = $parents == NULL ? 'null' : "'$parents'";
       $children = $children == NULL ? 'null' : "'$children'";
-      $sql      = "
+      $sql = "
 UPDATE civicrm_group
 SET    parents  = $parents ,
        children = $children
index c62456aef3162a9e52ef27058fae796ba6117083..4d6394edfabb705268556415a37efc4653a260ec 100644 (file)
@@ -68,13 +68,13 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact {
       }
     }
 
-    $sortName   = $displayName = '';
-    $firstName  = CRM_Utils_Array::value('first_name', $params, '');
+    $sortName = $displayName = '';
+    $firstName = CRM_Utils_Array::value('first_name', $params, '');
     $middleName = CRM_Utils_Array::value('middle_name', $params, '');
-    $lastName   = CRM_Utils_Array::value('last_name', $params, '');
-    $nickName   = CRM_Utils_Array::value('nick_name', $params, '');
-    $prefix_id  = CRM_Utils_Array::value('prefix_id', $params, '');
-    $suffix_id  = CRM_Utils_Array::value('suffix_id', $params, '');
+    $lastName = CRM_Utils_Array::value('last_name', $params, '');
+    $nickName = CRM_Utils_Array::value('nick_name', $params, '');
+    $prefix_id = CRM_Utils_Array::value('prefix_id', $params, '');
+    $suffix_id = CRM_Utils_Array::value('suffix_id', $params, '');
     $formalTitle = CRM_Utils_Array::value('formal_title', $params, '');
 
     // get prefix and suffix names
@@ -127,12 +127,12 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact {
 
         foreach (array('last', 'middle', 'first', 'nick') as $name) {
           $phpName = "{$name}Name";
-          $dbName  = "{$name}_name";
-          $value   = $individual->$dbName;
+          $dbName = "{$name}_name";
+          $value = $individual->$dbName;
           if (in_array($name, $useDBNames)) {
-            $params[$dbName]  = $value;
+            $params[$dbName] = $value;
             $contact->$dbName = $value;
-            $$phpName         = $value;
+            $$phpName = $value;
           }
           elseif (array_key_exists($dbName, $params)) {
             $$phpName = $params[$dbName];
@@ -143,7 +143,7 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact {
         }
 
         foreach (array('prefix', 'suffix') as $name) {
-          $dbName  = "{$name}_id";
+          $dbName = "{$name}_id";
 
           $value = $individual->$dbName;
           if (in_array($name, $useDBNames)) {
@@ -169,8 +169,8 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact {
 
         if (in_array('formal_title', $useDBNames)) {
           $params['formal_title'] = $individual->formal_title;
-          $contact->formal_title  = $individual->formal_title;
-          $formalTitle            = $individual->formal_title;
+          $contact->formal_title = $individual->formal_title;
+          $formalTitle = $individual->formal_title;
         }
         elseif (array_key_exists('formal_title', $params)) {
           $formalTitle = $params['formal_title'];
@@ -274,7 +274,9 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact {
     $format = CRM_Utils_Date::getDateFormat('birth');
     if ($date = CRM_Utils_Array::value('birth_date', $params)) {
       if (in_array($format, array(
-        'dd-mm', 'mm/dd'))) {
+        'dd-mm',
+        'mm/dd'
+      ))) {
         $separator = '/';
         if ($format == 'dd-mm') {
           $separator = '-';
@@ -282,15 +284,18 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact {
         $date = $date . $separator . '1902';
       }
       elseif (in_array($format, array(
-        'yy-mm'))) {
+        'yy-mm'
+      ))) {
         $date = $date . '-01';
       }
       elseif (in_array($format, array(
-        'M yy'))) {
+        'M yy'
+      ))) {
         $date = $date . '-01';
       }
       elseif (in_array($format, array(
-        'yy'))) {
+        'yy'
+      ))) {
         $date = $date . '-01-01';
       }
       $contact->birth_date = CRM_Utils_Date::processDate($date);
@@ -301,7 +306,9 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact {
 
     if ($date = CRM_Utils_Array::value('deceased_date', $params)) {
       if (in_array($format, array(
-        'dd-mm', 'mm/dd'))) {
+        'dd-mm',
+        'mm/dd'
+      ))) {
         $separator = '/';
         if ($format == 'dd-mm') {
           $separator = '-';
@@ -309,15 +316,18 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact {
         $date = $date . $separator . '1902';
       }
       elseif (in_array($format, array(
-        'yy-mm'))) {
+        'yy-mm'
+      ))) {
         $date = $date . '-01';
       }
       elseif (in_array($format, array(
-        'M yy'))) {
+        'M yy'
+      ))) {
         $date = $date . '-01';
       }
       elseif (in_array($format, array(
-        'yy'))) {
+        'yy'
+      ))) {
         $date = $date . '-01-01';
       }
 
@@ -365,8 +375,8 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact {
     }
 
     // query for the affected individuals
-    $fieldValue          = CRM_Utils_Type::escape($fieldValue, 'Integer');
-    $contact             = new CRM_Contact_BAO_Contact();
+    $fieldValue = CRM_Utils_Type::escape($fieldValue, 'Integer');
+    $contact = new CRM_Contact_BAO_Contact();
     $contact->$fieldName = $fieldValue;
     $contact->find();
 
index f6106a189bc017f89ee445d7490371de67e42bb5..bf769928fe7cb7fafae006390f14013e0981dd9c 100644 (file)
@@ -44,12 +44,10 @@ class CRM_Contact_BAO_ProximityQuery {
    * All function arguments and return values measure distances in metres
    * and angles in degrees.  The ellipsoid model is from the WGS-84 datum.
    * Ka-Ping Yee, 2003-08-11
-
    * earth_radius_semimajor = 6378137.0;
    * earth_flattening = 1/298.257223563;
    * earth_radius_semiminor = $earth_radius_semimajor * (1 - $earth_flattening);
    * earth_eccentricity_sq = 2*$earth_flattening - pow($earth_flattening, 2);
-
    * This library is an implementation of UCB CS graduate student, Ka-Ping Yee (http://www.zesty.ca).
    * This version has been taken from Drupal's location module: http://drupal.org/project/location
    **/
@@ -101,9 +99,9 @@ class CRM_Contact_BAO_ProximityQuery {
     $lat = deg2rad($latitude);
 
     $cosLong = cos($long);
-    $cosLat  = cos($lat);
+    $cosLat = cos($lat);
     $sinLong = sin($long);
-    $sinLat  = sin($lat);
+    $sinLat = sin($lat);
 
     $radius = self::$_earthRadiusSemiMajor / sqrt(1 - self::$_earthEccentricitySQ * $sinLat * $sinLat);
 
@@ -125,16 +123,16 @@ class CRM_Contact_BAO_ProximityQuery {
    * Estimate the min and max longitudes within $distance of a given location.
    */
   public static function earthLongitudeRange($longitude, $latitude, $distance) {
-    $long   = deg2rad($longitude);
-    $lat    = deg2rad($latitude);
+    $long = deg2rad($longitude);
+    $lat = deg2rad($latitude);
     $radius = self::earthRadius($latitude);
 
-    $angle   = $distance / $radius;
-    $diff    = asin(sin($angle) / cos($lat));
+    $angle = $distance / $radius;
+    $diff = asin(sin($angle) / cos($lat));
     $minLong = $long - $diff;
     $maxLong = $long + $diff;
 
-    if ($minLong < - pi()) {
+    if ($minLong < -pi()) {
       $minLong = $minLong + pi() * 2;
     }
 
@@ -142,7 +140,8 @@ class CRM_Contact_BAO_ProximityQuery {
       $maxLong = $maxLong - pi() * 2;
     }
 
-    return array(rad2deg($minLong),
+    return array(
+      rad2deg($minLong),
       rad2deg($maxLong),
     );
   }
@@ -151,17 +150,17 @@ class CRM_Contact_BAO_ProximityQuery {
    * Estimate the min and max latitudes within $distance of a given location.
    */
   public static function earthLatitudeRange($longitude, $latitude, $distance) {
-    $long   = deg2rad($longitude);
-    $lat    = deg2rad($latitude);
+    $long = deg2rad($longitude);
+    $lat = deg2rad($latitude);
     $radius = self::earthRadius($latitude);
 
-    $angle      = $distance / $radius;
-    $minLat     = $lat - $angle;
-    $maxLat     = $lat + $angle;
+    $angle = $distance / $radius;
+    $minLat = $lat - $angle;
+    $maxLat = $lat + $angle;
     $rightangle = pi() / 2.0;
 
     // wrapped around the south pole
-    if ($minLat < - $rightangle) {
+    if ($minLat < -$rightangle) {
       $overshoot = -$minLat - $rightangle;
       $minLat = -$rightangle + $overshoot;
       if ($minLat > $maxLat) {
@@ -180,7 +179,8 @@ class CRM_Contact_BAO_ProximityQuery {
       $maxLat = $rightangle;
     }
 
-    return array(rad2deg($minLat),
+    return array(
+      rad2deg($minLat),
       rad2deg($maxLat),
     );
   }
index b5ae9f0e51fc18005e3d6edf480e76a8a6553358..a47bdb6a5da0985e0338a3e000545c202cb22f2e 100644 (file)
@@ -57,12 +57,12 @@ class CRM_Contact_BAO_Query_Hook {
     return $singleton;
   }
 
- /**
-  * Get or build the list of search objects (via hook)
-  *
-  * @return array
 /**
+   * Get or build the list of search objects (via hook)
+   *
+   * @return array
    *   of CRM_Contact_BAO_Query_Interface objects
-  */
+   */
   public function getSearchQueryObjects() {
     if ($this->_queryObjects === NULL) {
       $this->_queryObjects = array();
index 3feadfd4931871b85b19ea1e0ccb8b840f87cb4f..fc4cfc78cc51b466e7e481cc7ed8a1f03f94cb4f 100644 (file)
@@ -318,11 +318,11 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship {
         //let's load the missing ids here since other things tend to rely on them.
         $fieldsToFill = array('contact_id_a', 'contact_id_b', 'relationship_type_id');
         $result = CRM_Core_DAO::executeQuery("SELECT " . implode(',', $fieldsToFill) . " FROM civicrm_relationship WHERE id = %1", array(
-            1 => array(
-              $params['id'],
-              'Integer',
-            ),
-          ));
+          1 => array(
+            $params['id'],
+            'Integer',
+          ),
+        ));
         while ($result->fetch()) {
           foreach ($fieldsToFill as $field) {
             $params[$field] = !empty($params[$field]) ? $params[$field] : $result->$field;
@@ -1729,9 +1729,9 @@ AND cc.sort_name LIKE '%$name%'";
    */
   public static function membershipTypeToRelationshipTypes(&$params, $direction = NULL) {
     $membershipType = civicrm_api3('membership_type', 'getsingle', array(
-        'id' => $params['membership_type_id'],
-        'return' => 'relationship_type_id, relationship_direction',
-      ));
+      'id' => $params['membership_type_id'],
+      'return' => 'relationship_type_id, relationship_direction',
+    ));
     $relationshipTypes = $membershipType['relationship_type_id'];
     if (empty($relationshipTypes)) {
       return;
index cdcf3717a7fbd500f9c2c4e5895ad433e11cf9d4..11f1c93979fa15e97696826b1e4cc03422b8c747 100644 (file)
@@ -165,7 +165,12 @@ UPDATE civicrm_membership_type
   SET  relationship_type_id = NULL
  WHERE relationship_type_id = %1
 ";
-    $params = array(1 => array(CRM_Core_DAO::VALUE_SEPARATOR . $relationshipTypeId . CRM_Core_DAO::VALUE_SEPARATOR, 'String'));
+    $params = array(
+      1 => array(
+        CRM_Core_DAO::VALUE_SEPARATOR . $relationshipTypeId . CRM_Core_DAO::VALUE_SEPARATOR,
+        'String'
+      )
+    );
     CRM_Core_DAO::executeQuery($query, $params);
 
     //fixed for CRM-3323
index 31c70839f234553ab90bc8e7d7da70c0996f1646..3fdfcf8508c034578fc34a277b6d8ef3faf32a65 100644 (file)
@@ -171,8 +171,8 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch {
         // this has not yet been implemented
       }
       else {
-      return CRM_Contact_BAO_Query::getWhereClause($params, NULL, $tables, $whereTables);
-    }
+        return CRM_Contact_BAO_Query::getWhereClause($params, NULL, $tables, $whereTables);
+      }
     }
     return NULL;
   }
@@ -215,8 +215,8 @@ WHERE  $where";
       }
       else {
         $tables = $whereTables = array('civicrm_contact' => 1, 'civicrm_email' => 1);
-        $where  = CRM_Contact_BAO_SavedSearch::whereClause($id, $tables, $whereTables);
-        $from   = CRM_Contact_BAO_Query::fromClause($whereTables);
+        $where = CRM_Contact_BAO_SavedSearch::whereClause($id, $tables, $whereTables);
+        $from = CRM_Contact_BAO_Query::fromClause($whereTables);
         return array($from, $where);
       }
     }
index fd7d6e3779bded8a545e29c217373b15a28a278c..1ea22a7d2d5a26c7f96e79196c2a4031cb9aa19c 100644 (file)
@@ -82,9 +82,9 @@ class CRM_Contact_BAO_SearchCustom {
 
     if (!$ext->isExtensionKey($customSearchClass)) {
       $customSearchFile = str_replace('_',
-        DIRECTORY_SEPARATOR,
-        $customSearchClass
-      ) . '.php';
+          DIRECTORY_SEPARATOR,
+          $customSearchClass
+        ) . '.php';
     }
     else {
       $customSearchFile = $ext->keyToPath($customSearchClass);
index 64eab805ba3ec457aa20d8c593d0e2ad1b69f804..728c4d2dca70839aebedc83d622caa3edb4513d0 100644 (file)
@@ -75,7 +75,7 @@ class CRM_Contact_Controller_Search extends CRM_Core_Controller {
     // see if we can figure out the url and redirect to the right search form
     // note that this happens really early on, so we cant use any of the form or controller
     // variables
-    $config  = CRM_Core_Config::singleton();
+    $config = CRM_Core_Config::singleton();
     $qString = $_GET[$config->userFrameworkURLVar];
     $args = "reset=1";
     $path = 'civicrm/contact/search/advanced';
index e26ad410e8865bad6c1a6ab7ea6b471db55dae06..5f4432c2b50fd3298cdc4d312bfcdd376aaf61bc 100644 (file)
@@ -40,7 +40,7 @@ class CRM_Contact_DAO_Factory {
     $file = self::$_prefix[$type] . $className;
     $class = str_replace('/', '_', $file);
 
-    require_once ($file . self::$_suffix);
+    require_once($file . self::$_suffix);
 
     if ($type == 'singleton') {
       $newObj = $class::singleton();
index 495a042896056a950b5c81b1fde0ab05b8fcb7a5..19d52d4cf396b2897b0ffb1fa8958af4327d4698 100644 (file)
@@ -149,8 +149,9 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
         $this, TRUE, NULL, 'REQUEST'
       );
       if (!in_array($this->_contactType,
-          array('Individual', 'Household', 'Organization')
-        )) {
+        array('Individual', 'Household', 'Organization')
+      )
+      ) {
         CRM_Core_Error::statusBounce(ts('Could not get a contact id and/or contact type'));
       }
 
@@ -161,7 +162,8 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
 
       if (
         $this->_contactSubType &&
-        !(CRM_Contact_BAO_ContactType::isExtendsContactType($this->_contactSubType, $this->_contactType, TRUE))) {
+        !(CRM_Contact_BAO_ContactType::isExtendsContactType($this->_contactSubType, $this->_contactType, TRUE))
+      ) {
         CRM_Core_Error::statusBounce(ts("Could not get a valid contact subtype for contact type '%1'", array(1 => $this->_contactType)));
       }
 
@@ -174,7 +176,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
         FALSE, NULL, 'GET'
       );
       $typeLabel = CRM_Contact_BAO_ContactType::contactTypePairs(TRUE, $this->_contactSubType ?
-        $this->_contactSubType : $this->_contactType
+          $this->_contactSubType : $this->_contactType
       );
       $typeLabel = implode(' / ', $typeLabel);
 
@@ -189,8 +191,8 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
       }
 
       if ($this->_contactId) {
-        $defaults          = array();
-        $params            = array('id' => $this->_contactId);
+        $defaults = array();
+        $params = array('id' => $this->_contactId);
         $returnProperities = array('id', 'contact_type', 'contact_sub_type', 'modified_date');
         CRM_Core_DAO::commonRetrieve('CRM_Contact_DAO_Contact', $params, $defaults, $returnProperities);
 
@@ -470,8 +472,8 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
     // get default phone and im provider id.
     $defPhoneTypeId = key(CRM_Core_OptionGroup::values('phone_type', FALSE, FALSE, FALSE, ' AND is_default = 1'));
     $defIMProviderId = key(CRM_Core_OptionGroup::values('instant_messenger_service',
-        FALSE, FALSE, FALSE, ' AND is_default = 1'
-      ));
+      FALSE, FALSE, FALSE, ' AND is_default = 1'
+    ));
     $defWebsiteTypeId = key(CRM_Core_OptionGroup::values('website_type',
       FALSE, FALSE, FALSE, ' AND is_default = 1'
     ));
@@ -640,7 +642,10 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
               $hasPrimary[] = $instance;
               if (!$primaryID &&
                 in_array($name, array(
-                  'email', 'openid')) && !empty($blockValues[$name])) {
+                  'email',
+                  'openid'
+                )) && !empty($blockValues[$name])
+              ) {
                 $primaryID = $blockValues[$name];
               }
             }
@@ -651,9 +656,9 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
           }
 
           if ($name == 'openid' && !empty($blockValues[$name])) {
-            $oid         = new CRM_Core_DAO_OpenID();
+            $oid = new CRM_Core_DAO_OpenID();
             $oid->openid = $openIds[$instance] = CRM_Utils_Array::value($name, $blockValues);
-            $cid         = isset($contactId) ? $contactId : 0;
+            $cid = isset($contactId) ? $contactId : 0;
             if ($oid->find(TRUE) && ($oid->contact_id != $cid)) {
               $errors["{$name}[$instance][openid]"] = ts('%1 already exist.', array(1 => $blocks['OpenID']));
             }
@@ -703,7 +708,9 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
 
         if (!empty($invalidStreetNumbers)) {
           $first = $invalidStreetNumbers[0];
-          foreach ($invalidStreetNumbers as & $num) $num = CRM_Contact_Form_Contact::ordinalNumber($num);
+          foreach ($invalidStreetNumbers as & $num) {
+            $num = CRM_Contact_Form_Contact::ordinalNumber($num);
+          }
           $errors["address[$first][street_number]"] = ts('The street number you entered for the %1 address block(s) is not in an expected format. Street numbers may include numeric digit(s) followed by other characters. You can still enter the complete street address (unparsed) by clicking "Edit Complete Street Address".', array(1 => implode(', ', $invalidStreetNumbers)));
         }
       }
@@ -728,13 +735,13 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
       $deleteExtra = ts('Are you sure you want to delete contact image.');
       $deleteURL = array(
         CRM_Core_Action::DELETE =>
-        array(
-          'name' => ts('Delete Contact Image'),
-          'url' => 'civicrm/contact/image',
-          'qs' => 'reset=1&cid=%%id%%&action=delete',
-          'extra' =>
-          'onclick = "if (confirm( \'' . $deleteExtra . '\' ) ) this.href+=\'&amp;confirmed=1\'; else return false;"',
-        ),
+          array(
+            'name' => ts('Delete Contact Image'),
+            'url' => 'civicrm/contact/image',
+            'qs' => 'reset=1&cid=%%id%%&action=delete',
+            'extra' =>
+              'onclick = "if (confirm( \'' . $deleteExtra . '\' ) ) this.href+=\'&amp;confirmed=1\'; else return false;"',
+          ),
       );
       $deleteURL = CRM_Core_Action::formLink($deleteURL,
         CRM_Core_Action::DELETE,
@@ -1071,7 +1078,15 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
       return FALSE;
     }
 
-    static $skipFields = array('location_type_id', 'is_primary', 'phone_type_id', 'provider_id', 'country_id', 'website_type_id', 'master_id');
+    static $skipFields = array(
+      'location_type_id',
+      'is_primary',
+      'phone_type_id',
+      'provider_id',
+      'country_id',
+      'website_type_id',
+      'master_id'
+    );
     foreach ($fields as $name => $value) {
       $skipField = FALSE;
       foreach ($skipFields as $skip) {
@@ -1123,12 +1138,21 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
         $contactLinks = CRM_Contact_BAO_Contact_Utils::formatContactIDSToLinks($ids, TRUE, TRUE, $contactID);
 
         $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 />'));
+        $duplicateContactsLinks .= ts('One matching contact was found. ', array(
+            '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'));
+          $duplicateContactsLinks .= ts('You can View the existing contact', array(
+              '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'));
+          $duplicateContactsLinks .= ts('You can View or Edit the existing contact', array(
+              'count' => count($contactLinks['rows']),
+              'plural' => 'You can View or Edit the existing contacts'
+            ));
         }
         if ($contactLinks['msg'] == 'merge') {
           // We should also get a merge link if this is for an existing contact
@@ -1160,7 +1184,6 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
         $errors['_qf_default'] = $duplicateContactsLinks;
 
 
-
         // let smarty know that there are duplicates
         $template = CRM_Core_Smarty::singleton();
         $template->assign('isDuplicate', 1);
@@ -1213,7 +1236,10 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
       $buildStreetAddress = FALSE;
       $parseFieldName = 'street_address';
       foreach (array(
-        'street_number', 'street_name', 'street_unit') as $fld) {
+                 'street_number',
+                 'street_name',
+                 'street_unit'
+               ) as $fld) {
         if (!empty($address[$fld])) {
           $parseFieldName = 'street_number';
           $buildStreetAddress = TRUE;
@@ -1242,9 +1268,15 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
 
         $streetAddress = NULL;
         foreach (array(
-          'street_number', 'street_number_suffix', 'street_name', 'street_unit') as $fld) {
+                   'street_number',
+                   'street_number_suffix',
+                   'street_name',
+                   'street_unit'
+                 ) as $fld) {
           if (in_array($fld, array(
-            'street_name', 'street_unit'))) {
+            'street_name',
+            'street_unit'
+          ))) {
             $streetAddress .= ' ';
           }
           $streetAddress .= CRM_Utils_Array::value($fld, $address);
@@ -1358,12 +1390,13 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
    */
   public function updateMembershipStatus($deceasedParams) {
     $updateMembershipMsg = NULL;
-    $contactId           = CRM_Utils_Array::value('contact_id', $deceasedParams);
-    $deceasedDate        = CRM_Utils_Array::value('deceased_date', $deceasedParams);
+    $contactId = CRM_Utils_Array::value('contact_id', $deceasedParams);
+    $deceasedDate = CRM_Utils_Array::value('deceased_date', $deceasedParams);
 
     // process to set membership status to deceased for both active/inactive membership
     if ($contactId &&
-      $this->_contactType == 'Individual' && !empty($deceasedParams['is_deceased'])) {
+      $this->_contactType == 'Individual' && !empty($deceasedParams['is_deceased'])
+    ) {
 
       $session = CRM_Core_Session::singleton();
       $userId = $session->get('userID');
@@ -1390,7 +1423,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
       $dao->whereAdd("status_id != $deceasedStatusId");
       $dao->find();
       $activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, FALSE, FALSE, 'name');
-      $allStatus     = CRM_Member_PseudoConstant::membershipStatus();
+      $allStatus = CRM_Member_PseudoConstant::membershipStatus();
       $memCount = 0;
       while ($dao->fetch()) {
         // update status to deceased (for both active/inactive membership )
index 9e805a5a514ccc2e9da425d979ec640db9366912..6334991867709c4ee57fa8e15b9d447f660a8ecd 100644 (file)
@@ -102,6 +102,7 @@ class CRM_Contact_Form_CustomData extends CRM_Core_Form {
   public $_multiRecordDisplay;
 
   public $_copyValueId;
+
   /**
    * Pre processing work done here.
    *
@@ -306,7 +307,8 @@ class CRM_Contact_Form_CustomData extends CRM_Core_Form {
     $cgcount += 1;
     $buttonName = $this->controller->getButtonName();
     if ($buttonName == $this->getButtonName('upload', 'new')) {
-      CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url('civicrm/contact/view/cd/edit', "reset=1&type={$this->_contactType}&groupID={$this->_groupID}&entityID={$this->_tableID}&cgcount={$cgcount}&multiRecordDisplay=single&mode=add"));
+      CRM_Core_Session::singleton()
+        ->pushUserContext(CRM_Utils_System::url('civicrm/contact/view/cd/edit', "reset=1&type={$this->_contactType}&groupID={$this->_groupID}&entityID={$this->_tableID}&cgcount={$cgcount}&multiRecordDisplay=single&mode=add"));
     }
     // reset the group contact cache for this group
     CRM_Contact_BAO_GroupContactCache::remove();
index 670c7cb265612cb3d9e26b03a5437813364845f6..d37cdf0d3f4354acedef481a5b0a733e5aabb95f 100644 (file)
@@ -218,11 +218,11 @@ UPDATE civicrm_dedupe_rule_group
       $rgDao->id = $this->_rgid;
     }
 
-    $rgDao->title        = $values['title'];
-    $rgDao->is_reserved  = CRM_Utils_Array::value('is_reserved', $values, FALSE);
-    $rgDao->used         = $values['used'];
+    $rgDao->title = $values['title'];
+    $rgDao->is_reserved = CRM_Utils_Array::value('is_reserved', $values, FALSE);
+    $rgDao->used = $values['used'];
     $rgDao->contact_type = $this->_contactType;
-    $rgDao->threshold    = $values['threshold'];
+    $rgDao->threshold = $values['threshold'];
     $rgDao->save();
 
     // make sure name is set only during insert
@@ -285,7 +285,15 @@ UPDATE civicrm_dedupe_rule_group
 
         if ($dao->fetch()) {
           // set the length to null for all the fields where prefix length is not supported. eg. int,tinyint,date,enum etc dataTypes.
-          if ($dao->COLUMN_NAME == $field && !in_array($dao->DATA_TYPE, array('char', 'varchar', 'binary', 'varbinary', 'text', 'blob'))) {
+          if ($dao->COLUMN_NAME == $field && !in_array($dao->DATA_TYPE, array(
+                'char',
+                'varchar',
+                'binary',
+                'varbinary',
+                'text',
+                'blob'
+              ))
+          ) {
             $length = NULL;
           }
           elseif ($dao->COLUMN_NAME == $field && !empty($dao->CHARACTER_MAXIMUM_LENGTH) && ($length > $dao->CHARACTER_MAXIMUM_LENGTH)) {
index 603cfaa20d4d9864e9041ba2f7e54bfa1cc82b99..124ca0f8b1b7779012520230f6a4571a76e2303f 100644 (file)
@@ -109,8 +109,8 @@ class CRM_Contact_Form_Domain extends CRM_Core_Form {
    * @return array
    */
   public function setDefaultValues() {
-    $defaults  = array();
-    $params    = array();
+    $defaults = array();
+    $params = array();
 
     if (isset($this->_id)) {
       $params['id'] = $this->_id;
@@ -167,17 +167,17 @@ class CRM_Contact_Form_Domain extends CRM_Core_Form {
     CRM_Contact_Form_Location::buildQuickForm($this);
 
     $this->addButtons(array(
-        array(
-          'type' => 'next',
-          'name' => ts('Save'),
-          'subName' => 'view',
-          'isDefault' => TRUE,
-        ),
-        array(
-          'type' => 'cancel',
-          'name' => ts('Cancel'),
-        ),
-      ));
+      array(
+        'type' => 'next',
+        'name' => ts('Save'),
+        'subName' => 'view',
+        'isDefault' => TRUE,
+      ),
+      array(
+        'type' => 'cancel',
+        'name' => ts('Cancel'),
+      ),
+    ));
 
     if ($this->_action & CRM_Core_Action::VIEW) {
       $this->freeze();
@@ -267,9 +267,9 @@ class CRM_Contact_Form_Domain extends CRM_Core_Form {
 
     $params += array('contact_id' => $this->_contactId);
     $contactParams = array(
-      'sort_name'    => $domain->name,
+      'sort_name' => $domain->name,
       'display_name' => $domain->name,
-      'legal_name'   => $domain->name,
+      'legal_name' => $domain->name,
       'organization_name' => $domain->name,
       'contact_id' => $this->_contactId,
       'contact_type' => 'Organization',
index c3885983d1bc321e4a52faa0b5f27b259ec57b01..c7aa121d1ea3415ba30719a8da41a96ca05b928c 100644 (file)
@@ -73,7 +73,10 @@ class CRM_Contact_Form_Edit_Address {
     }
 
     //make location type required for inline edit
-    $form->addSelect("address[$blockId][location_type_id]", array('entity' => 'address', 'class' => 'eight') + $js, $inlineEdit);
+    $form->addSelect("address[$blockId][location_type_id]", array(
+        'entity' => 'address',
+        'class' => 'eight'
+      ) + $js, $inlineEdit);
 
     if (!$inlineEdit) {
       $js = array('id' => 'Address_' . $blockId . '_IsPrimary', 'onClick' => 'singleSelect( this.id );');
@@ -113,8 +116,16 @@ class CRM_Contact_Form_Edit_Address {
       'supplemental_address_1' => array(ts('Supplemental Address 1'), $attributes['supplemental_address_1'], NULL),
       'supplemental_address_2' => array(ts('Supplemental Address 2'), $attributes['supplemental_address_2'], NULL),
       'city' => array(ts('City'), $attributes['city'], NULL),
-      'postal_code' => array(ts('Zip / Postal Code'), array_merge($attributes['postal_code'], array('class' => 'crm_postal_code')), NULL),
-      'postal_code_suffix' => array(ts('Postal Code Suffix'), array('size' => 4, 'maxlength' => 12, 'class' => 'crm_postal_code_suffix'), NULL),
+      'postal_code' => array(
+        ts('Zip / Postal Code'),
+        array_merge($attributes['postal_code'], array('class' => 'crm_postal_code')),
+        NULL
+      ),
+      'postal_code_suffix' => array(
+        ts('Postal Code Suffix'),
+        array('size' => 4, 'maxlength' => 12, 'class' => 'crm_postal_code_suffix'),
+        NULL
+      ),
       'country_id' => array(ts('Country'), $attributes['country_id'], 'country'),
       'state_province_id' => array(ts('State/Province'), $attributes['state_province_id'], NULL),
       'county_id' => array(ts('County'), $attributes['county_id'], NULL),
@@ -132,7 +143,11 @@ class CRM_Contact_Form_Edit_Address {
       if (empty($addressOptions[$nameWithoutID])) {
         $continue = TRUE;
         if (in_array($nameWithoutID, array(
-          'street_number', 'street_name', 'street_unit')) && !empty($addressOptions['street_address_parsing'])) {
+            'street_number',
+            'street_name',
+            'street_unit'
+          )) && !empty($addressOptions['street_address_parsing'])
+        ) {
           $continue = FALSE;
         }
         if ($continue) {
@@ -233,7 +248,7 @@ class CRM_Contact_Form_Edit_Address {
         CRM_Contact_Form_Edit_Address::storeRequiredCustomDataInfo($form, $groupTree);
       }
 
-      $template     = CRM_Core_Smarty::singleton();
+      $template = CRM_Core_Smarty::singleton();
       $tplGroupTree = $template->get_template_vars('address_groupTree');
       $tplGroupTree = empty($tplGroupTree) ? array() : $tplGroupTree;
 
@@ -248,7 +263,11 @@ class CRM_Contact_Form_Edit_Address {
       $form->addElement('checkbox', "address[$blockId][use_shared_address]", NULL, ts('Use another contact\'s address'));
 
       // Override the default profile links to add address form
-      $profileLinks = CRM_Core_BAO_UFGroup::getCreateLinks(array('new_individual', 'new_organization', 'new_household'), 'shared_address');
+      $profileLinks = CRM_Core_BAO_UFGroup::getCreateLinks(array(
+          'new_individual',
+          'new_organization',
+          'new_household'
+        ), 'shared_address');
       $form->addEntityRef("address[$blockId][master_contact_id]", ts('Share With'), array('create' => $profileLinks));
     }
   }
@@ -340,7 +359,10 @@ class CRM_Contact_Form_Edit_Address {
           $sharedAddresses[$key]['shared_address_display'] = array(
             'address' => $addressValue['display'],
             'name' => $shareAddressContactNames[$addressValue['master_id']]['name'],
-            'options' => CRM_Core_BAO_Address::getValues(array('entity_id' => $master_cid, 'contact_id' => $master_cid)),
+            'options' => CRM_Core_BAO_Address::getValues(array(
+                'entity_id' => $master_cid,
+                'contact_id' => $master_cid
+              )),
             'master_id' => $addressValue['master_id'],
           );
           $defaults['address'][$key]['master_contact_id'] = $master_cid;
@@ -364,9 +386,15 @@ class CRM_Contact_Form_Edit_Address {
         foreach ($defaults['address'] as $cnt => & $address) {
           $streetAddress = NULL;
           foreach (array(
-            'street_number', 'street_number_suffix', 'street_name', 'street_unit') as $fld) {
+                     'street_number',
+                     'street_number_suffix',
+                     'street_name',
+                     'street_unit'
+                   ) as $fld) {
             if (in_array($fld, array(
-              'street_name', 'street_unit'))) {
+              'street_name',
+              'street_unit'
+            ))) {
               $streetAddress .= ' ';
             }
             $streetAddress .= CRM_Utils_Array::value($fld, $address);
index 3343286fd16c6a2c92bb59971d69f5ae8f1bf199..7c88999b4d496f12f94286faef21aeab612c024e 100644 (file)
@@ -120,7 +120,8 @@ class CRM_Contact_Form_Edit_CommunicationPreferences {
       if (!empty($greetingTokens)) {
         $form->addElement('select', $fields['field'], $fields['label'],
           array(
-            '' => ts('- select -')) + $greetingTokens
+            '' => ts('- select -')
+          ) + $greetingTokens
         );
         //custom addressee
         $form->addElement('text', $fields['customField'], $fields['customLabel'],
index 91953302ace09ed5155f2d9077eaa18a29689089..d778fe6a031e9959410ef7e37b6f9d911d60d3c3 100644 (file)
@@ -67,7 +67,11 @@ class CRM_Contact_Form_Edit_Email {
     $form->addRule("email[$blockId][email]", ts('Email is not valid.'), 'email');
     if (isset($form->_contactType) || $blockEdit) {
       //Block type
-      $form->addSelect("email[$blockId][location_type_id]", array('entity' => 'email', 'class' => 'eight', 'placeholder' => NULL));
+      $form->addSelect("email[$blockId][location_type_id]", array(
+          'entity' => 'email',
+          'class' => 'eight',
+          'placeholder' => NULL
+        ));
 
       $multipleBulk = CRM_Core_BAO_Email::isMultipleBulkMail();
 
index 32e0eae755d39827e71e3350bd44b88a6e2f0c80..d5176ea24ba6fd62e161d6bc0bf3b0a2d944ce32 100644 (file)
@@ -64,7 +64,11 @@ class CRM_Contact_Form_Edit_IM {
     $form->addSelect("im[$blockId][provider_id]", array('entity' => 'im', 'class' => 'eight', 'placeholder' => NULL));
 
     //Block type select
-    $form->addSelect("im[$blockId][location_type_id]", array('entity' => 'im', 'class' => 'eight', 'placeholder' => NULL));
+    $form->addSelect("im[$blockId][location_type_id]", array(
+        'entity' => 'im',
+        'class' => 'eight',
+        'placeholder' => NULL
+      ));
 
     //IM box
     $form->addElement('text', "im[$blockId][name]", ts('Instant Messenger'),
index da17b87dd3ec66e4fb68ac66f41f77fe33151018..5d808b4797fb219d753bc2c9981e9ec41658e8d0 100644 (file)
@@ -40,7 +40,7 @@
  */
 class CRM_Contact_Form_Edit_Organization {
 
- /**
 /**
    * This function provides the HTML form elements that are specific
    * to the Organization Contact Type
    *
index 3ee9b6d99e3e6d9682826bb62cd1fed6594b5b5c..68da6e976fddaa2b27f438a8848612340daad4a5 100644 (file)
@@ -63,7 +63,11 @@ class CRM_Contact_Form_Edit_Phone {
     $form->applyFilter('__ALL__', 'trim');
 
     //phone type select
-    $form->addSelect("phone[$blockId][phone_type_id]", array('entity' => 'phone', 'class' => 'eight', 'placeholder' => NULL));
+    $form->addSelect("phone[$blockId][phone_type_id]", array(
+        'entity' => 'phone',
+        'class' => 'eight',
+        'placeholder' => NULL
+      ));
 
     //main phone number with crm_phone class
     $form->add('text', "phone[$blockId][phone]", ts('Phone'), array_merge(CRM_Core_DAO::getAttribute('CRM_Core_DAO_Phone', 'phone'), array('class' => 'crm_phone twelve')));
@@ -72,7 +76,11 @@ class CRM_Contact_Form_Edit_Phone {
 
     if (isset($form->_contactType) || $blockEdit) {
       //Block type select
-      $form->addSelect("phone[$blockId][location_type_id]", array('entity' => 'phone', 'class' => 'eight', 'placeholder' => NULL));
+      $form->addSelect("phone[$blockId][location_type_id]", array(
+          'entity' => 'phone',
+          'class' => 'eight',
+          'placeholder' => NULL
+        ));
 
       //is_Primary radio
       $js = array('id' => 'Phone_' . $blockId . '_IsPrimary', 'onClick' => 'singleSelect( this.id );');
index c59ed345d9f39ab22856ea1c6d301a09361721ba..81e20e53ed00f4e9f7a9591902a6531b2a1f73de 100644 (file)
@@ -188,8 +188,8 @@ class CRM_Contact_Form_Edit_TagsAndGroups {
   public static function climbtree($form, $tree, &$elements) {
     foreach ($tree as $tagID => $varValue) {
       $tagAttribute = array(
-      'onclick' => "return changeRowColor(\"rowidtag_$tagID\")",
-      'id' => "tag_{$tagID}",
+        'onclick' => "return changeRowColor(\"rowidtag_$tagID\")",
+        'id' => "tag_{$tagID}",
       );
 
       $elements[$tagID] = $form->createElement('checkbox', $tagID, '', '', $tagAttribute);
index dd0a16e2b72c59ec66c7c98fcc0d65387335147f..d803a9335d1a5638d9f904183cf2d5ec83b6990e 100644 (file)
@@ -101,7 +101,10 @@ class CRM_Contact_Form_GroupContact extends CRM_Core_Form {
         $msg = ts('Add to a group');
       }
 
-      $this->add('select', 'group_id', '', $groupSelect, TRUE, array('class' => 'crm-select2 crm-action-menu action-icon-plus', 'placeholder' => $msg));
+      $this->add('select', 'group_id', '', $groupSelect, TRUE, array(
+          'class' => 'crm-select2 crm-action-menu action-icon-plus',
+          'placeholder' => $msg
+        ));
 
       $this->addButtons(array(
           array(
@@ -120,8 +123,8 @@ class CRM_Contact_Form_GroupContact extends CRM_Core_Form {
    */
   public function postProcess() {
     $contactID = array($this->_contactId);
-    $groupId   = $this->controller->exportValue('GroupContact', 'group_id');
-    $method    = ($this->_context == 'user') ? 'Web' : 'Admin';
+    $groupId = $this->controller->exportValue('GroupContact', 'group_id');
+    $method = ($this->_context == 'user') ? 'Web' : 'Admin';
 
     $session = CRM_Core_Session::singleton();
     $userID = $session->get('userID');
index e7a8227c0fe491a1bea70d2f4c6a695cb37b89c8..20db671923e2067458e04bcd00ee96c271060844 100644 (file)
@@ -153,8 +153,8 @@ abstract class CRM_Contact_Form_Inline extends CRM_Core_Form {
     $this->ajaxResponse = array_merge(
       array(
         'changeLog' => array(
-         'count' => CRM_Contact_BAO_Contact::getCountComponent('log', $this->_contactId),
-         'markup' => $smarty->fetch('CRM/common/contactFooter.tpl'),
+          'count' => CRM_Contact_BAO_Contact::getCountComponent('log', $this->_contactId),
+          'markup' => $smarty->fetch('CRM/common/contactFooter.tpl'),
         ),
       ),
       $this->ajaxResponse,
index 30c486823e75b5cc2841a835875f6276013dad12..0bc5ff71af6b12858875a656f1b27cbe1a285cec 100644 (file)
@@ -70,7 +70,7 @@ class CRM_Contact_Form_Inline_ContactInfo extends CRM_Contact_Form_Inline {
 
     // Process / save contact info
     $params['contact_type'] = $this->_contactType;
-    $params['contact_id']   = $this->_contactId;
+    $params['contact_id'] = $this->_contactId;
 
     if (!empty($this->_contactSubType)) {
       $params['contact_sub_type'] = $this->_contactSubType;
index 9895863da378603e8c6a2f0a1c61c1f20a5ccbcf..7c700877531f64dd381a06c1f201612a39e47b68 100644 (file)
@@ -61,7 +61,7 @@ class CRM_Contact_Form_Inline_ContactName extends CRM_Contact_Form_Inline {
 
     // Process / save contact info
     $params['contact_type'] = $this->_contactType;
-    $params['contact_id']   = $this->_contactId;
+    $params['contact_id'] = $this->_contactId;
 
     if (!empty($this->_contactSubType)) {
       $params['contact_sub_type'] = $this->_contactSubType;
index 72bf2f1a464d5a22243323bc33c0ff6254ac1bd6..a0efe9980ba5d15147f29c1dcc8c55933cfb6a27 100644 (file)
@@ -74,9 +74,9 @@ class CRM_Contact_Form_Inline_Email extends CRM_Contact_Form_Inline {
     if (count($this->_emails) > 1) {
       $actualBlockCount = $totalBlocks = count($this->_emails);
       if ($totalBlocks < $this->_blockCount) {
-      $additionalBlocks = $this->_blockCount - $totalBlocks;
-      $totalBlocks += $additionalBlocks;
-    }
+        $additionalBlocks = $this->_blockCount - $totalBlocks;
+        $totalBlocks += $additionalBlocks;
+      }
       else {
         $actualBlockCount++;
         $totalBlocks++;
@@ -116,9 +116,9 @@ class CRM_Contact_Form_Inline_Email extends CRM_Contact_Form_Inline {
           $hasData[] = $instance;
           if (!empty($blockValues['is_primary'])) {
             $hasPrimary[] = $instance;
-            }
           }
         }
+      }
 
 
       if (empty($hasPrimary) && !empty($hasData)) {
index dfed03861770d904079ebccff9ddabbb875a1522..2bcb95c63658b5dbd74f45779c703990f78a01b1 100644 (file)
@@ -117,7 +117,7 @@ class CRM_Contact_Form_Inline_IM extends CRM_Contact_Form_Inline {
           if (!empty($blockValues['is_primary'])) {
             $hasPrimary[] = $instance;
             if (!$primaryID && !empty($blockValues['im'])) {
-                $primaryID = $blockValues['im'];
+              $primaryID = $blockValues['im'];
             }
           }
         }
index 4b0c3828d5294b704804e1e1e316c38db52358c4..c1d77bb93ea1f1e022f7723f892c48c065b9aea1 100644 (file)
@@ -117,7 +117,7 @@ class CRM_Contact_Form_Inline_OpenID extends CRM_Contact_Form_Inline {
           if (!empty($blockValues['is_primary'])) {
             $hasPrimary[] = $instance;
             if (!$primaryID && !empty($blockValues['openid'])) {
-                $primaryID = $blockValues['openid'];
+              $primaryID = $blockValues['openid'];
             }
           }
         }
index 9f2f96f979cd13e1e26d5090f0df995f660372a1..544bf4872b1167305cf63630b80c926f6d605499 100644 (file)
@@ -74,9 +74,9 @@ class CRM_Contact_Form_Inline_Phone extends CRM_Contact_Form_Inline {
     if (count($this->_phones) > 1) {
       $actualBlockCount = $totalBlocks = count($this->_phones);
       if ($totalBlocks < $this->_blockCount) {
-      $additionalBlocks = $this->_blockCount - $totalBlocks;
-      $totalBlocks += $additionalBlocks;
-    }
+        $additionalBlocks = $this->_blockCount - $totalBlocks;
+        $totalBlocks += $additionalBlocks;
+      }
       else {
         $actualBlockCount++;
         $totalBlocks++;
@@ -118,7 +118,7 @@ class CRM_Contact_Form_Inline_Phone extends CRM_Contact_Form_Inline {
           if (!empty($blockValues['is_primary'])) {
             $hasPrimary[] = $instance;
             if (!$primaryID && !empty($blockValues['phone'])) {
-                $primaryID = $blockValues['phone'];
+              $primaryID = $blockValues['phone'];
             }
           }
         }
index 77a2ed0350bccc51427e8f24c21dab61d0d50c18..008291f0418eb7525c1863f2a5e853a93842e6cc 100644 (file)
@@ -55,7 +55,9 @@ class CRM_Contact_Form_Location {
 
     $className = CRM_Utils_System::getClassName($form);
     if (in_array($className, array(
-      'CRM_Event_Form_ManageEvent_Location', 'CRM_Contact_Form_Domain'))) {
+      'CRM_Event_Form_ManageEvent_Location',
+      'CRM_Contact_Form_Domain'
+    ))) {
       $form->_blocks = array(
         'Address' => ts('Address'),
         'Email' => ts('Email'),
index 4141d06aaa48659817e95b8df5b900ab31343892..ba367123caef37cadafe0b62fd43f6ec1cb06915 100644 (file)
@@ -63,12 +63,12 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form {
     }
 
     $rows = array();
-    $cid  = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
-    $oid  = CRM_Utils_Request::retrieve('oid', 'Positive', $this, TRUE);
+    $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
+    $oid = CRM_Utils_Request::retrieve('oid', 'Positive', $this, TRUE);
     $flip = CRM_Utils_Request::retrieve('flip', 'Positive', $this, FALSE);
 
-    $this->_rgid    = $rgid = CRM_Utils_Request::retrieve('rgid', 'Positive', $this, FALSE);
-    $this->_gid     = $gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this, FALSE);
+    $this->_rgid = $rgid = CRM_Utils_Request::retrieve('rgid', 'Positive', $this, FALSE);
+    $this->_gid = $gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this, FALSE);
     $this->_mergeId = CRM_Utils_Request::retrieve('mergeId', 'Positive', $this, FALSE);
 
     // Sanity check
@@ -94,8 +94,9 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form {
 
     // Block access if user does not have EDIT permissions for both contacts.
     if (!(CRM_Contact_BAO_Contact_Permission::allow($cid, CRM_Core_Permission::EDIT) &&
-        CRM_Contact_BAO_Contact_Permission::allow($oid, CRM_Core_Permission::EDIT)
-      )) {
+      CRM_Contact_BAO_Contact_Permission::allow($oid, CRM_Core_Permission::EDIT)
+    )
+    ) {
       CRM_Utils_System::permissionDenied();
     }
 
@@ -129,7 +130,9 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form {
 
     $this->prev = $this->next = NULL;
     foreach (array(
-      'prev', 'next') as $position) {
+               'prev',
+               'next'
+             ) as $position) {
       if (!empty($pos[$position])) {
         if ($pos[$position]['id1'] && $pos[$position]['id2']) {
           $urlParam = "reset=1&cid={$pos[$position]['id1']}&oid={$pos[$position]['id2']}&mergeId={$pos[$position]['mergeId']}&action=update";
@@ -206,9 +209,9 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form {
     $this->assign('other_cid', $other['contact_id']);
     $this->assign('rgid', $rgid);
 
-    $this->_cid         = $cid;
-    $this->_oid         = $oid;
-    $this->_rgid        = $rgid;
+    $this->_cid = $cid;
+    $this->_oid = $oid;
+    $this->_rgid = $rgid;
     $this->_contactType = $main['contact_type'];
     $this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('class' => 'select-rows'));
 
@@ -341,7 +344,7 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form {
       );
       CRM_Utils_System::redirect($lisitingURL);
     }
-     if (!empty($formValues['_qf_Merge_done'])) {
+    if (!empty($formValues['_qf_Merge_done'])) {
       CRM_Utils_System::redirect($url);
     }
 
index 2dd022f0b2ce94949271a836ac82e77fa69801ac..b860cf7c0b72ed8c3512bc6afca1b903a2bccac0 100644 (file)
@@ -89,11 +89,11 @@ class CRM_Contact_Form_ProfileContact {
 
     $prefix = 'honor';
     $honoreeProfileFields = CRM_Core_BAO_UFGroup::getFields($form->_honoreeProfileId, FALSE, NULL,
-        NULL, NULL,
-        FALSE, NULL,
-        TRUE, NULL,
-        CRM_Core_Permission::CREATE
-      );
+      NULL, NULL,
+      FALSE, NULL,
+      TRUE, NULL,
+      CRM_Core_Permission::CREATE
+    );
     $form->addElement('hidden', 'honoree_profile_id', $form->_honoreeProfileId);
     $form->assign('honoreeProfileFields', $honoreeProfileFields);
 
index ce80a97f2459b023d8f08e2610850fc7b62c55fa..5ef9d24927f54ca00cac521a040a29c75c5a35fc 100644 (file)
@@ -76,8 +76,8 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form {
     );
     $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
 
-    $rcid    = CRM_Utils_Request::retrieve('rcid', 'Positive', $this);
-    $rcid    = $rcid ? "&id={$rcid}" : '';
+    $rcid = CRM_Utils_Request::retrieve('rcid', 'Positive', $this);
+    $rcid = $rcid ? "&id={$rcid}" : '';
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/user', "reset=1{$rcid}"));
 
@@ -119,9 +119,9 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form {
    * @return void
    */
   public function buildQuickForm() {
-    $params       = array();
+    $params = array();
     $params['id'] = $params['contact_id'] = $this->_contactId;
-    $contact      = CRM_Contact_BAO_Contact::retrieve($params, $this->_defaults);
+    $contact = CRM_Contact_BAO_Contact::retrieve($params, $this->_defaults);
 
     $countryID = '';
     $stateID = '';
@@ -141,16 +141,16 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form {
     );
 
     $this->addButtons(array(
-        array(
-          'type' => 'next',
-          'name' => ts('Save'),
-          'isDefault' => TRUE,
-        ),
-        array(
-          'type' => 'cancel',
-          'name' => ts('Cancel'),
-        ),
-      ));
+      array(
+        'type' => 'next',
+        'name' => ts('Save'),
+        'isDefault' => TRUE,
+      ),
+      array(
+        'type' => 'cancel',
+        'name' => ts('Cancel'),
+      ),
+    ));
   }
 
   /**
@@ -165,7 +165,10 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form {
 
     $locType = CRM_Core_BAO_LocationType::getDefault();
     foreach (array(
-      'phone', 'email', 'address') as $locFld) {
+               'phone',
+               'email',
+               'address'
+             ) as $locFld) {
       if (!empty($this->_defaults[$locFld]) && $this->_defaults[$locFld][1]['location_type_id']) {
         $params[$locFld][1]['is_primary'] = $this->_defaults[$locFld][1]['is_primary'];
         $params[$locFld][1]['location_type_id'] = $this->_defaults[$locFld][1]['location_type_id'];
index a2a937849d3fddfd75db17f12a4bb84c4f8c80e6..dbd0edf5b7a4da525280ee0a14a26c66e3680804 100644 (file)
@@ -350,7 +350,10 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form {
     );
 
     $label = $this->_action & CRM_Core_Action::ADD ? ts('Contact(s)') : ts('Contact');
-    $contactField = $this->addEntityRef('related_contact_id', $label, array('multiple' => TRUE, 'create' => TRUE), TRUE);
+    $contactField = $this->addEntityRef('related_contact_id', $label, array(
+        'multiple' => TRUE,
+        'create' => TRUE
+      ), TRUE);
     // This field cannot be updated
     if ($this->_action & CRM_Core_Action::UPDATE) {
       $contactField->freeze();
@@ -466,13 +469,28 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form {
     }
 
     if ($valid) {
-      CRM_Core_Session::setStatus(ts('Relationship created.', array('count' => $valid, 'plural' => '%count relationships created.')), ts('Saved'), 'success');
+      CRM_Core_Session::setStatus(ts('Relationship created.', array(
+            'count' => $valid,
+            'plural' => '%count relationships created.'
+          )), ts('Saved'), 'success');
     }
     if ($invalid) {
-      CRM_Core_Session::setStatus(ts('%count relationship record was not created due to an invalid contact type.', array('count' => $invalid, 'plural' => '%count relationship records were not created due to invalid contact types.')), ts('%count invalid relationship record', array('count' => $invalid, 'plural' => '%count invalid relationship records')));
+      CRM_Core_Session::setStatus(ts('%count relationship record was not created due to an invalid contact type.', array(
+            'count' => $invalid,
+            'plural' => '%count relationship records were not created due to invalid contact types.'
+          )), ts('%count invalid relationship record', array(
+            'count' => $invalid,
+            'plural' => '%count invalid relationship records'
+          )));
     }
     if ($duplicate) {
-      CRM_Core_Session::setStatus(ts('One relationship was not created because it already exists.', array('count' => $duplicate, 'plural' => '%count relationships were not created because they already exist.')), ts('%count duplicate relationship', array('count' => $duplicate, 'plural' => '%count duplicate relationships')));
+      CRM_Core_Session::setStatus(ts('One relationship was not created because it already exists.', array(
+            'count' => $duplicate,
+            'plural' => '%count relationships were not created because they already exist.'
+          )), ts('%count duplicate relationship', array(
+            'count' => $duplicate,
+            'plural' => '%count duplicate relationships'
+          )));
     }
     if ($saved) {
       CRM_Core_Session::setStatus(ts('Relationship record has been updated.'), ts('Saved'), 'success');
index 0a4aa1043889cec2d4624f7879b9bd4269ee7d17..30df4e6823be698687144ddbf22530890b76c6c5 100644 (file)
@@ -417,8 +417,8 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
 
     // add the go button for the action form, note it is of type 'next' rather than of type 'submit'
     if ($this->_context === 'amtg') {
-        // check if _groupID exists, it might not if
-        // we are displaying a hidden group
+      // check if _groupID exists, it might not if
+      // we are displaying a hidden group
       if (!isset($this->_group[$this->_amtgID])) {
         $this->assign('permissionedForGroup', FALSE);
         $this->_group[$this->_amtgID] =
@@ -603,11 +603,17 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
         // FIXME: we should generalise in a way that components could inject url-filters
         // just like they build their own form elements
         foreach (array(
-          'mailing_id', 'mailing_delivery_status', 'mailing_open_status',
-          'mailing_click_status', 'mailing_reply_status', 'mailing_optout',
-          'mailing_forward', 'mailing_unsubscribe', 'mailing_date_low',
-          'mailing_date_high',
-          ) as $mailingFilter) {
+                   'mailing_id',
+                   'mailing_delivery_status',
+                   'mailing_open_status',
+                   'mailing_click_status',
+                   'mailing_reply_status',
+                   'mailing_optout',
+                   'mailing_forward',
+                   'mailing_unsubscribe',
+                   'mailing_date_low',
+                   'mailing_date_high',
+                 ) as $mailingFilter) {
           $type = 'String';
           if ($mailingFilter == 'mailing_id' &&
             $filterVal = CRM_Utils_Request::retrieve('mailing_id', 'Positive', $this)
@@ -740,7 +746,8 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
     $crmPID = CRM_Utils_Request::retrieve('crmPID', 'Integer', CRM_Core_DAO::$_nullObject);
 
     if (array_key_exists($this->_searchButtonName, $_POST) ||
-      ($this->_force && !$crmPID)) {
+      ($this->_force && !$crmPID)
+    ) {
       //reset the cache table for new search
       $cacheKey = "civicrm search {$this->controller->_key}";
       CRM_Core_BAO_PrevNextCache::deleteItem(NULL, $cacheKey);
index d7fd33607100ea0168bc5c670071d83a2d428719..530c9284a6bd1315cccd5fde3d70a9ba5ba31de1 100644 (file)
@@ -246,7 +246,9 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search {
       // FIXME: so leaving this as a dependency for now
       if (array_key_exists('contribution_amount_low', $this->_formValues)) {
         foreach (array(
-          'contribution_amount_low', 'contribution_amount_high') as $f) {
+                   'contribution_amount_low',
+                   'contribution_amount_high'
+                 ) as $f) {
           $this->_formValues[$f] = CRM_Utils_Rule::cleanMoney($this->_formValues[$f]);
         }
       }
@@ -278,7 +280,11 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search {
         !$this->_force
       ) {
         foreach (array(
-          'case_type_id', 'case_status_id', 'case_deleted', 'case_tags') as $caseCriteria) {
+                   'case_type_id',
+                   'case_status_id',
+                   'case_deleted',
+                   'case_tags'
+                 ) as $caseCriteria) {
           if (!empty($this->_formValues[$caseCriteria])) {
             $allCases = TRUE;
             $this->_formValues['case_owner'] = 1;
index 9a5716143f0621d5997115fa1561b18b2ecbb698..13dd608ef7778023c302d21060b4ab7fb3d1c844 100644 (file)
@@ -83,13 +83,23 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search {
 
     // add select for groups
     if (!empty($searchOptions['groups'])) {
-      $this->addSelect('group', array('entity' => 'group_contact', 'label' => ts('in'), 'context' => 'search', 'placeholder' => ts('- any group -')));
+      $this->addSelect('group', array(
+          'entity' => 'group_contact',
+          'label' => ts('in'),
+          'context' => 'search',
+          'placeholder' => ts('- any group -')
+        ));
     }
 
     if (!empty($searchOptions['tags'])) {
       // tag criteria
       if (!empty($this->_tag)) {
-        $this->addSelect('tag', array('entity' => 'entity_tag', 'label' => ts('with'), 'context' => 'search', 'placeholder' => ts('- any tag -')));
+        $this->addSelect('tag', array(
+            'entity' => 'entity_tag',
+            'label' => ts('with'),
+            'context' => 'search',
+            'placeholder' => ts('- any tag -')
+          ));
       }
     }
 
index 18338dc46526d449faea3b929352293b0ad54fea..5dbb773d0b408329192fdbc5719d8324be8adf4c 100644 (file)
@@ -160,7 +160,8 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search {
         $v[2] = self::checkArrayKeyEmpty($v[2]);
 
         if (in_array($v[1], array('IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY')) &&
-          !empty($v[2])) {
+          !empty($v[2])
+        ) {
           $errorMsg["value[$v[3]][$v[4]]"] = ts('Please clear your value if you want to use %1 operator.', array(1 => $v[1]));
         }
         elseif (($v[0] == 'group' || $v[0] == 'tag') && !empty($v[2])) {
@@ -212,7 +213,9 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search {
 
             // hack to handle custom data of type state and country
             if (in_array($type, array(
-              'Country', 'StateProvince'))) {
+              'Country',
+              'StateProvince'
+            ))) {
               $type = "Integer";
             }
           }
@@ -229,7 +232,8 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search {
             $type = CRM_Utils_Type::typeToString($fldType);
             // Check Empty values for Integer Or Boolean Or Date type For operators other than IS NULL and IS NOT NULL.
             if (!in_array($v[1],
-                array('IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY'))) {
+              array('IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY'))
+            ) {
               if ((($type == 'Int' || $type == 'Boolean') && !is_array($v[2]) && !trim($v[2])) && $v[2] != '0') {
                 $errorMsg["value[$v[3]][$v[4]]"] = ts("Please enter a value.");
               }
@@ -339,7 +343,7 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search {
       $addMore = CRM_Utils_Array::value('addMore', $params);
       for ($x = 1; $x <= $this->_blockCount; $x++) {
         if (!empty($addMore[$x])) {
-          $this->set('newBlock',  $x);
+          $this->set('newBlock', $x);
           $this->_columnCount[$x] = $this->_columnCount[$x] + 5;
           $this->set('columnCount', $this->_columnCount);
           $this->set('showSearchForm', TRUE);
@@ -438,7 +442,17 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search {
       'member_is_pay_later' => 'yesno',
       'is_override' => 'yesno',
     );
-    $entities = array('contact', 'address', 'activity', 'participant', 'pledge', 'member', 'contribution', 'case', 'grant');
+    $entities = array(
+      'contact',
+      'address',
+      'activity',
+      'participant',
+      'pledge',
+      'member',
+      'contribution',
+      'case',
+      'grant'
+    );
     CRM_Contact_BAO_Query_Hook::singleton()->alterSearchBuilderOptions($entities, $options);
     foreach ($entities as $entity) {
       $fields = civicrm_api3($entity, 'getfields');
@@ -453,7 +467,11 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search {
         elseif (!empty($info['data_type']) && in_array($info['data_type'], array('StateProvince', 'Country'))) {
           $options[$field] = $entity;
         }
-        elseif (in_array(substr($field, 0, 3), array('is_', 'do_')) || CRM_Utils_Array::value('data_type', $info) == 'Boolean') {
+        elseif (in_array(substr($field, 0, 3), array(
+              'is_',
+              'do_'
+            )) || CRM_Utils_Array::value('data_type', $info) == 'Boolean'
+        ) {
           $options[$field] = 'yesno';
           if ($entity != 'contact') {
             $options[$entity . '_' . $field] = 'yesno';
index 68fd674444a7ad2e469b5d1b9dc6bfe70a242d66..00d7caa030a5364451437a7aebbf4baf42797725 100644 (file)
@@ -66,7 +66,7 @@ class CRM_Contact_Form_Search_Criteria {
         $form->add('select', 'group_type', ts('Group Types'), $groupOptions, FALSE,
           array('id' => 'group_type', 'multiple' => 'multiple', 'class' => 'crm-select2')
         );
-        $form->add('hidden','group_search_selected','group');
+        $form->add('hidden', 'group_search_selected', 'group');
       }
     }
 
@@ -100,7 +100,7 @@ class CRM_Contact_Form_Search_Criteria {
       $tagTypesText = implode(" or ", $tagsTypes);
       if ($showAllTagTypes) {
         $form->add('checkbox', 'all_tag_types', ts('Include tags used for %1', array(1 => $tagTypesText)));
-        $form->add('hidden','tag_types_text', $tagTypesText);
+        $form->add('hidden', 'tag_types_text', $tagTypesText);
       }
     }
 
@@ -158,7 +158,8 @@ class CRM_Contact_Form_Search_Criteria {
       'uf_group_id',
       ts('Search Views'),
       array(
-        '0' => ts('- default view -')) + $searchProfiles
+        '0' => ts('- default view -')
+      ) + $searchProfiles
     );
 
     $componentModes = CRM_Contact_Form_Search::getModeSelect();
@@ -312,8 +313,8 @@ class CRM_Contact_Form_Search_Criteria {
       list($title, $attributes, $select, $multiSelect) = $v;
 
       if (in_array($name,
-          array('street_number', 'street_name', 'street_unit')
-        )) {
+        array('street_number', 'street_name', 'street_unit')
+      )) {
         if (!$parseStreetAddress) {
           continue;
         }
index 283819d2c79d1fb9d18de99d77f013831c77be1a..7c4edc51724dd59638dc09d683c24b210404bf3a 100644 (file)
@@ -49,7 +49,7 @@ class CRM_Contact_Form_Search_Custom extends CRM_Contact_Form_Search {
       $this->_customSearchID,
       $this->_customSearchClass,
       $formValues
-    ) = CRM_Contact_BAO_SearchCustom::details($csID, $ssID, $gID);
+      ) = CRM_Contact_BAO_SearchCustom::details($csID, $ssID, $gID);
 
     if (!$this->_customSearchID) {
       CRM_Core_Error::fatal('Could not get details for custom search.');
@@ -64,12 +64,14 @@ class CRM_Contact_Form_Search_Custom extends CRM_Contact_Form_Search {
     }
 
     // set breadcrumb to return to Custom Search listings page
-    $breadCrumb = array(array(
+    $breadCrumb = array(
+      array(
         'title' => ts('Custom Searches'),
         'url' => CRM_Utils_System::url('civicrm/contact/search/custom/list',
           'reset=1'
         ),
-      ));
+      )
+    );
     CRM_Utils_System::appendBreadCrumb($breadCrumb);
 
     // use the custom selector
@@ -85,7 +87,8 @@ class CRM_Contact_Form_Search_Custom extends CRM_Contact_Form_Search {
 
     // CRM-12747
     if (isset($this->_customClass->_permissionedComponent) &&
-      !self::isPermissioned($this->_customClass->_permissionedComponent)) {
+      !self::isPermissioned($this->_customClass->_permissionedComponent)
+    ) {
       CRM_Utils_System::permissionDenied();
     }
   }
index b94cd426ff6a7b6bd018d201e547da5308e416d0..c518532a9df803c0eb56a281cd4e148029af988c 100644 (file)
@@ -138,9 +138,14 @@ class CRM_Contact_Form_Search_Custom_ActivitySearch implements CRM_Contact_Form_
      * for the search form.
      */
     $form->assign('elements', array(
-      'contact_type', 'activity_subject', 'activity_type_id',
-        'activity_status_id', 'start_date', 'end_date', 'sort_name',
-      ));
+      'contact_type',
+      'activity_subject',
+      'activity_type_id',
+      'activity_status_id',
+      'start_date',
+      'end_date',
+      'sort_name',
+    ));
   }
 
   /**
@@ -289,9 +294,9 @@ ORDER BY contact_a.sort_name';
     // add contact name search; search on primary name, source contact, assignee
     $contactname = $this->_formValues['sort_name'];
     if (!empty($contactname)) {
-      $dao         = new CRM_Core_DAO();
+      $dao = new CRM_Core_DAO();
       $contactname = $dao->escape($contactname);
-      $clauses[]   = "(contact_a.sort_name LIKE '%{$contactname}%' OR
+      $clauses[] = "(contact_a.sort_name LIKE '%{$contactname}%' OR
                            contact_b.sort_name LIKE '%{$contactname}%' OR
                            contact_c.display_name LIKE '%{$contactname}%')";
     }
@@ -303,8 +308,8 @@ ORDER BY contact_a.sort_name';
     }
 
     if (!empty($subject)) {
-      $dao       = new CRM_Core_DAO();
-      $subject   = $dao->escape($subject);
+      $dao = new CRM_Core_DAO();
+      $subject = $dao->escape($subject);
       $clauses[] = "activity.subject LIKE '%{$subject}%'";
     }
 
index cbad293b1f19ab6b163cd7360e84a611b58bbec3..227c58efb26ec520edab052f577f607f4bc5f270 100644 (file)
@@ -197,16 +197,16 @@ class CRM_Contact_Form_Search_Custom_Base {
     foreach ($includeStrings as $string) {
       if (stripos($sql, $string) === FALSE) {
         CRM_Core_Error::fatal(ts('Could not find \'%1\' string in SQL clause.',
-            array(1 => $string)
-          ));
+          array(1 => $string)
+        ));
       }
     }
 
     foreach ($excludeStrings as $string) {
       if (preg_match('/(\s' . $string . ')|(' . $string . '\s)/i', $sql)) {
         CRM_Core_Error::fatal(ts('Found illegal \'%1\' string in SQL clause.',
-            array(1 => $string)
-          ));
+          array(1 => $string)
+        ));
       }
     }
   }
index 06e492a73733a59fdcc2a1916dfc3c419a4c9280..e2c7d55d24b280ac3e8f70e27c7f78ec2e14e502 100644 (file)
@@ -68,7 +68,13 @@ class CRM_Contact_Form_Search_Custom_Basic extends CRM_Contact_Form_Search_Custo
 
     foreach ($this->_columns as $name => $field) {
       if (in_array($field, array(
-        'street_address', 'city', 'state_province', 'postal_code', 'country')) && empty($addressOptions[$field])) {
+          'street_address',
+          'city',
+          'state_province',
+          'postal_code',
+          'country'
+        )) && empty($addressOptions[$field])
+      ) {
         unset($this->_columns[$name]);
         continue;
       }
index 1adb3d454c240e14e53b4dde404704e0ee852f87..0075f3f05fcb6203aacf8dc8b8b37130465c162d 100644 (file)
@@ -213,8 +213,8 @@ class CRM_Contact_Form_Search_Custom_DateAdded extends CRM_Contact_Form_Search_C
     // CRM-6356
     if ($this->_groups) {
       //block for Group search
-      $smartGroup       = array();
-      $group            = new CRM_Contact_DAO_Group();
+      $smartGroup = array();
+      $group = new CRM_Contact_DAO_Group();
       $group->is_active = 1;
       $group->find();
       while ($group->fetch()) {
index 06f71fa0f69ab714e663e6b4a6d4f5c41f8eae0e..1c38c06f3d7bc299f19509575d6218cf7057e49a 100644 (file)
@@ -90,7 +90,14 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea
      * If you are using the sample template, this array tells the template fields to render
      * for the search form.
      */
-    $form->assign('elements', array('paid_online', 'start_date', 'end_date', 'show_payees', 'event_type_id', 'event_id'));
+    $form->assign('elements', array(
+        'paid_online',
+        'start_date',
+        'end_date',
+        'show_payees',
+        'event_type_id',
+        'event_id'
+      ));
   }
 
   /**
@@ -206,7 +213,7 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea
 
     $clauses[] = "civicrm_participant.status_id in ( 1 )";
     $clauses[] = "civicrm_contribution.is_test = 0";
-    $onLine    = CRM_Utils_Array::value('paid_online',
+    $onLine = CRM_Utils_Array::value('paid_online',
       $this->_formValues
     );
     if ($onLine) {
index 16c9846d5eeb338c1972852a96bbbfe7ce91e3be..d36d8a1a17cde5864de2b98eb0109dd6c157c4d3 100644 (file)
@@ -194,7 +194,6 @@ class CRM_Contact_Form_Search_Custom_FullText implements CRM_Contact_Form_Search
       'membership_end_date' => 'datetime',
       'membership_source' => 'varchar(255)',
       'membership_status' => 'varchar(255)',
-
       // We may have multiple files to list on one record.
       // The temporary-table approach can't store full details for all of them
       'file_ids' => 'varchar(255)', // comma-separate id listing
index 128d6a3e3b7b46e7e42d7948afd6c82ed8b79f1c..a1f3153f859a16bb007c39eeb61edccc5f94e73d 100644 (file)
@@ -161,9 +161,9 @@ $sqlStatement
           }
 
           $query = $tableValues + array(
-            'text' => CRM_Utils_QueryFormatter::singleton()
-              ->format($queryText, CRM_Utils_QueryFormatter::LANG_SOLR),
-          );
+              'text' => CRM_Utils_QueryFormatter::singleton()
+                ->format($queryText, CRM_Utils_QueryFormatter::LANG_SOLR),
+            );
           list($intLimit, $intOffset) = $this->parseLimitOffset($limit);
           $files = $searcher->search($query, $intLimit, $intOffset);
           $matches = array();
index 9f7bfdb2d551905a909b834c783a38242d8b496d..20a27eafe4aa1f52f196bca59a3d283b8f090b95 100644 (file)
@@ -41,7 +41,7 @@ class CRM_Contact_Form_Search_Custom_FullText_Contribution extends CRM_Contact_F
   public function isActive() {
     $config = CRM_Core_Config::singleton();
     return in_array('CiviContribute', $config->enableComponents) &&
-      CRM_Core_Permission::check('access CiviContribute');
+    CRM_Core_Permission::check('access CiviContribute');
   }
 
   /**
index 341df71ea4991b201f2db69558a8d34bdb18792d..5c3298cf5ff5838d02601620493807a1d0b1e41f 100644 (file)
@@ -41,7 +41,7 @@ class CRM_Contact_Form_Search_Custom_FullText_Membership extends CRM_Contact_For
   public function isActive() {
     $config = CRM_Core_Config::singleton();
     return in_array('CiviMember', $config->enableComponents) &&
-      CRM_Core_Permission::check('access CiviMember');
+    CRM_Core_Permission::check('access CiviMember');
   }
 
   /**
index ecc0d7297d41d09285d53ca832f6f2eb2e64208c..8ceebbd9155389257e27a118d35408b4e49009c2 100644 (file)
@@ -41,7 +41,7 @@ class CRM_Contact_Form_Search_Custom_FullText_Participant extends CRM_Contact_Fo
   public function isActive() {
     $config = CRM_Core_Config::singleton();
     return in_array('CiviEvent', $config->enableComponents) &&
-      CRM_Core_Permission::check('view event participants');
+    CRM_Core_Permission::check('view event participants');
   }
 
   /**
index 07d55c8034fbdf3e14a9b3a18fe4ff144ced5d5c..4e55632257d053c3db8076784c9ddccb00584200 100644 (file)
@@ -65,9 +65,9 @@ class CRM_Contact_Form_Search_Custom_Group
 
     //define variables
     $this->_allSearch = FALSE;
-    $this->_groups    = FALSE;
-    $this->_tags      = FALSE;
-    $this->_andOr     = CRM_Utils_Array::value('andOr', $this->_formValues);
+    $this->_groups = FALSE;
+    $this->_tags = FALSE;
+    $this->_andOr = CRM_Utils_Array::value('andOr', $this->_formValues);
 
 
     //make easy to check conditions for groups and tags are
index 0e2bb5fc9ee710058c8a1ccbf61119479a20c96a..9df1ad8b4175626a6afc1177d9b91cbb11a1386e 100644 (file)
@@ -227,10 +227,10 @@ contact_a.sort_name    as sort_name,
    * @return string
    */
   public function where($includeContactIDs = FALSE) {
-    $count  = 1;
+    $count = 1;
     $clause = array();
     $params = array();
-    $name   = CRM_Utils_Array::value('sort_name',
+    $name = CRM_Utils_Array::value('sort_name',
       $this->_formValues
     );
     if ($name != NULL) {
@@ -292,10 +292,10 @@ contact_a.sort_name    as sort_name,
     foreach ($this->_options as $fieldID => $values) {
       $customVal = $valueSeparatedArray = array();
       if (in_array($values['attributes']['html_type'],
-          array('Radio', 'Select', 'Autocomplete-Select')
-        )) {
+        array('Radio', 'Select', 'Autocomplete-Select')
+      )) {
         if ($values['attributes']['data_type'] == 'ContactReference' && $row["custom_{$fieldID}"]) {
-          $row["custom_{$fieldID}"] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', (int)$row["custom_{$fieldID}"], 'display_name');
+          $row["custom_{$fieldID}"] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', (int) $row["custom_{$fieldID}"], 'display_name');
         }
         elseif ($row["custom_{$fieldID}"] &&
           array_key_exists($row["custom_{$fieldID}"],
@@ -306,8 +306,8 @@ contact_a.sort_name    as sort_name,
         }
       }
       elseif (in_array($values['attributes']['html_type'],
-          array('CheckBox', 'Multi-Select', 'AdvMulti-Select')
-        )) {
+        array('CheckBox', 'Multi-Select', 'AdvMulti-Select')
+      )) {
         $valueSeparatedArray = array_filter(explode(CRM_Core_DAO::VALUE_SEPARATOR, $row["custom_{$fieldID}"]));
         foreach ($valueSeparatedArray as $val) {
           $customVal[] = $values[$val];
@@ -315,8 +315,8 @@ contact_a.sort_name    as sort_name,
         $row["custom_{$fieldID}"] = implode(', ', $customVal);
       }
       elseif (in_array($values['attributes']['html_type'],
-          array('Multi-Select State/Province', 'Select State/Province')
-        )) {
+        array('Multi-Select State/Province', 'Select State/Province')
+      )) {
         $valueSeparatedArray = array_filter(explode(CRM_Core_DAO::VALUE_SEPARATOR, $row["custom_{$fieldID}"]));
         $stateName = CRM_Core_PseudoConstant::stateProvince();
         foreach ($valueSeparatedArray as $val) {
@@ -325,8 +325,8 @@ contact_a.sort_name    as sort_name,
         $row["custom_{$fieldID}"] = implode(', ', $customVal);
       }
       elseif (in_array($values['attributes']['html_type'],
-          array('Multi-Select Country', 'Select Country')
-        )) {
+        array('Multi-Select Country', 'Select Country')
+      )) {
         $valueSeparatedArray = array_filter(explode(CRM_Core_DAO::VALUE_SEPARATOR, $row["custom_{$fieldID}"]));
         CRM_Core_PseudoConstant::populate($countryNames, 'CRM_Core_DAO_Country',
           TRUE, 'name', 'is_active'
index fded896cd01a345a9d7830301b806b132885c5b1..58d036604153470978cc6562adf1385ac59cb74f 100644 (file)
@@ -120,8 +120,8 @@ LEFT JOIN civicrm_state_province state_province ON  state_province.id = address.
   public function where($includeContactIDs = FALSE) {
     $params = array();
 
-    $count   = 1;
-    $clause  = array();
+    $count = 1;
+    $clause = array();
     $groupID = CRM_Utils_Array::value('group_id',
       $this->_formValues
     );
index fb54e9984158979cab740e7543e7212bc3feb7b2..ae6fd34e6e3864916ce6457d4f73e4b9a26e29b6 100644 (file)
@@ -70,9 +70,9 @@ class CRM_Contact_Form_Search_Custom_PriceSet extends CRM_Contact_Form_Search_Cu
   }
 
   public function buildTempTable() {
-    $randomNum        = md5(uniqid());
+    $randomNum = md5(uniqid());
     $this->_tableName = "civicrm_temp_custom_{$randomNum}";
-    $sql              = "
+    $sql = "
 CREATE TEMPORARY TABLE {$this->_tableName} (
   id int unsigned NOT NULL AUTO_INCREMENT,
   contact_id int unsigned NOT NULL,
@@ -82,9 +82,9 @@ CREATE TEMPORARY TABLE {$this->_tableName} (
     foreach ($this->_columns as $dontCare => $fieldName) {
       if (in_array($fieldName, array(
         'contact_id',
-            'participant_id',
-            'display_name',
-          ))) {
+        'participant_id',
+        'display_name',
+      ))) {
         continue;
       }
       $sql .= "{$fieldName} int default 0,\n";
@@ -290,9 +290,9 @@ contact_a.display_name   as display_name";
 
       foreach ($this->_columns as $dontCare => $fieldName) {
         if (in_array($fieldName, array(
-              'contact_id',
-              'display_name',
-            ))) {
+          'contact_id',
+          'display_name',
+        ))) {
           continue;
         }
         $selectClause .= ",\ntempTable.{$fieldName} as {$fieldName}";
index ffa29d149c74ccaf1121cbc02f7c9b1637c3913f..de7bb987d4258407c5355ddf8bd36a0813800fc6 100644 (file)
@@ -150,15 +150,15 @@ class CRM_Contact_Form_Search_Custom_Proximity extends CRM_Contact_Form_Search_C
      */
     $form->assign('elements', array(
       'distance',
-        'prox_distance_unit',
-        'street_address',
-        'city',
-        'postal_code',
-        'country_id',
-        'state_province_id',
-        'group',
-        'tag',
-      ));
+      'prox_distance_unit',
+      'street_address',
+      'city',
+      'postal_code',
+      'country_id',
+      'state_province_id',
+      'group',
+      'tag',
+    ));
   }
 
   /**
index 6b37c6b050f8cac12fcd74beee9c5122f4636317..2ec16741fcf9d9f6274e70b5c5a549e67bf133e9 100644 (file)
@@ -160,8 +160,8 @@ class CRM_Contact_Form_Search_Custom_RandomSegment extends CRM_Contact_Form_Sear
     $this->_tableName = "civicrm_temp_custom_{$randomNum}";
 
     //block for Group search
-    $smartGroup       = array();
-    $group            = new CRM_Contact_DAO_Group();
+    $smartGroup = array();
+    $group = new CRM_Contact_DAO_Group();
     $group->is_active = 1;
     $group->find();
     while ($group->fetch()) {
@@ -308,8 +308,8 @@ class CRM_Contact_Form_Search_Custom_RandomSegment extends CRM_Contact_Form_Sear
     if (substr($this->_segmentSize, -1) == '%') {
       $countSql = "SELECT DISTINCT contact_a.id $from $fromTail
                          WHERE " . $this->where();
-      $dao        = CRM_Core_DAO::executeQuery($countSql);
-      $totalSize  = $dao->N;
+      $dao = CRM_Core_DAO::executeQuery($countSql);
+      $totalSize = $dao->N;
       $multiplier = substr($this->_segmentSize, 0, strlen($this->_segmentSize) - 1);
       $multiplier /= 100;
       $this->_segmentSize = round($totalSize * $multiplier);
index 93169bcd0365c45b44b623afb933046f8d205f38..627a74913927df5a8cfe2c5fefd81ad1dc5bdd15 100644 (file)
@@ -152,9 +152,9 @@ LEFT JOIN civicrm_state_province state_province ON state_province.id = address.s
     $params = array();
     $where = "contact_a.contact_type   = 'Household'";
 
-    $count  = 1;
+    $count = 1;
     $clause = array();
-    $name   = CRM_Utils_Array::value('household_name',
+    $name = CRM_Utils_Array::value('household_name',
       $this->_formValues
     );
     if ($name != NULL) {
index 767eec099ba5419ba392306b305a21012ccf6cf7..966eb4ba9d625e87080bd07649e6e4ab0562e84a 100644 (file)
@@ -156,7 +156,7 @@ LEFT JOIN civicrm_email   email   ON ( email.contact_id = contact_a.id AND
 
     $where = "ROUND(address.postal_code) >= %1 AND ROUND(address.postal_code) <= %2";
     $params = array(
-    1 => array(trim($low), 'Integer'),
+      1 => array(trim($low), 'Integer'),
       2 => array(trim($high), 'Integer'),
     );
 
index 2b4da5af5121240ccb3605a331fe664cb11d79c0..134c6965207b79df788610b5b7f7e86fb95eb2c1 100644 (file)
@@ -434,15 +434,15 @@ class CRM_Contact_Form_Task extends CRM_Core_Form {
       }
 
       // Find related households.
-      $relationSelect      = "SELECT contact_household.id as household_id, {$contactA} as refContact ";
+      $relationSelect = "SELECT contact_household.id as household_id, {$contactA} as refContact ";
       $relationFrom = " FROM civicrm_contact contact_household
               INNER JOIN civicrm_relationship crel ON crel.{$contactB} = contact_household.id AND crel.relationship_type_id = {$id} ";
 
       // Check for active relationship status only.
-      $today               = date('Ymd');
-      $relationActive      = " AND (crel.is_active = 1 AND ( crel.end_date is NULL OR crel.end_date >= {$today} ) )";
-      $relationWhere       = " WHERE contact_household.is_deleted = 0  AND crel.{$contactA} IN ( {$relID} ) {$relationActive}";
-      $relationGroupBy     = " GROUP BY crel.{$contactA}";
+      $today = date('Ymd');
+      $relationActive = " AND (crel.is_active = 1 AND ( crel.end_date is NULL OR crel.end_date >= {$today} ) )";
+      $relationWhere = " WHERE contact_household.is_deleted = 0  AND crel.{$contactA} IN ( {$relID} ) {$relationActive}";
+      $relationGroupBy = " GROUP BY crel.{$contactA}";
       $relationQueryString = "$relationSelect $relationFrom $relationWhere $relationGroupBy";
 
       $householdsDAO = CRM_Core_DAO::executeQuery($relationQueryString);
index 10852e63da22aa94f57a48a9792abca9f615c8bf..976ab1694f72a26b7b558cda9d3746d46b4dd924 100644 (file)
@@ -214,8 +214,8 @@ class CRM_Contact_Form_Task_AddToGroup extends CRM_Contact_Form_Task {
       $groupParams['visibility'] = "User and User Admin Only";
       if (array_key_exists('group_type', $params) && is_array($params['group_type'])) {
         $groupParams['group_type'] = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,
-          array_keys($params['group_type'])
-        ) . CRM_Core_DAO::VALUE_SEPARATOR;
+            array_keys($params['group_type'])
+          ) . CRM_Core_DAO::VALUE_SEPARATOR;
       }
       else {
         $groupParams['group_type'] = '';
@@ -223,26 +223,39 @@ class CRM_Contact_Form_Task_AddToGroup extends CRM_Contact_Form_Task {
       $groupParams['is_active'] = 1;
 
       $createdGroup = CRM_Contact_BAO_Group::create($groupParams);
-      $groupID      = $createdGroup->id;
-      $groupName    = $groupParams['title'];
+      $groupID = $createdGroup->id;
+      $groupName = $groupParams['title'];
     }
     else {
-      $groupID   = $params['group_id'];
-      $group     = CRM_Core_PseudoConstant::group();
+      $groupID = $params['group_id'];
+      $group = CRM_Core_PseudoConstant::group();
       $groupName = $group[$groupID];
     }
 
     list($total, $added, $notAdded) = CRM_Contact_BAO_GroupContact::addContactsToGroup($this->_contactIds, $groupID);
 
-    $status = array(ts('%count contact added to group', array('count' => $added, 'plural' => '%count contacts added to group')));
+    $status = array(
+      ts('%count contact added to group', array(
+          'count' => $added,
+          'plural' => '%count contacts added to group'
+        ))
+    );
     if ($notAdded) {
-      $status[] = ts('%count contact was already in group', array('count' => $notAdded, 'plural' => '%count contacts were already in group'));
+      $status[] = ts('%count contact was already in group', array(
+          'count' => $notAdded,
+          'plural' => '%count contacts were already in group'
+        ));
     }
     $status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
-    CRM_Core_Session::setStatus($status, ts('Added Contact to %1', array(1 => $groupName, 'count' => $added, 'plural' => 'Added Contacts to %1')), 'success', array('expires' => 0));
+    CRM_Core_Session::setStatus($status, ts('Added Contact to %1', array(
+          1 => $groupName,
+          'count' => $added,
+          'plural' => 'Added Contacts to %1'
+        )), 'success', array('expires' => 0));
 
     if ($this->_context === 'amtg') {
-      CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url('civicrm/group/search', "reset=1&force=1&context=smog&gid=$groupID"));
+      CRM_Core_Session::singleton()
+        ->pushUserContext(CRM_Utils_System::url('civicrm/group/search', "reset=1&force=1&context=smog&gid=$groupID"));
     }
   }
 }
index 0490eb929e3fadb3241e9a180e8f3b941d60d508..c4c11ed02d45128383fbe0dbd454dfb200b9de50 100644 (file)
@@ -65,7 +65,8 @@ class CRM_Contact_Form_Task_AddToHousehold extends CRM_Contact_Form_Task {
 
     $this->add('select', 'relationship_type_id', ts('Relationship Type'),
       array(
-        '' => ts('- select -')) +
+        '' => ts('- select -')
+      ) +
       CRM_Contact_BAO_Relationship::getRelationType("Household"), TRUE
     );
 
@@ -145,10 +146,11 @@ class CRM_Contact_Form_Task_AddToHousehold extends CRM_Contact_Form_Task {
         }
 
         if (CRM_Contact_BAO_Relationship::checkDuplicateRelationship($params,
-            CRM_Utils_Array::value('contact', $ids),
-            // step 2
-            $params['contact_check']
-          )) {
+          CRM_Utils_Array::value('contact', $ids),
+          // step 2
+          $params['contact_check']
+        )
+        ) {
           $duplicate++;
           continue;
         }
@@ -160,15 +162,33 @@ class CRM_Contact_Form_Task_AddToHousehold extends CRM_Contact_Form_Task {
       list($rtype, $a_b) = explode('_', $data['relationship_type_id'], 2);
       $relationship = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_RelationshipType', $rtype, "label_$a_b");
 
-      $status = array(ts('%count %2 %3 relationship created', array('count' => $valid, 'plural' => '%count %2 %3 relationships created', 2 => $relationship, 3 => $house)));
+      $status = array(
+        ts('%count %2 %3 relationship created', array(
+            'count' => $valid,
+            'plural' => '%count %2 %3 relationships created',
+            2 => $relationship,
+            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));
+        $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
+          ));
       }
       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'));
+        $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'
+          ));
       }
       $status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
-      CRM_Core_Session::setStatus($status, ts('Relationship created.', array('count' => $valid, 'plural' => 'Relationships created.')), 'success', array('expires' => 0));
+      CRM_Core_Session::setStatus($status, ts('Relationship created.', array(
+            'count' => $valid,
+            'plural' => 'Relationships created.'
+          )), 'success', array('expires' => 0));
     }
   }
 
@@ -235,8 +255,8 @@ class CRM_Contact_Form_Task_AddToHousehold extends CRM_Contact_Form_Task {
     }
 
     // get the count of contact
-    $contactBAO  = new CRM_Contact_BAO_Contact();
-    $query       = new CRM_Contact_BAO_Query($searchValues);
+    $contactBAO = new CRM_Contact_BAO_Contact();
+    $query = new CRM_Contact_BAO_Query($searchValues);
     $searchCount = $query->searchQuery(0, 0, NULL, TRUE);
     $form->set('searchCount', $searchCount);
     if ($searchCount <= 50) {
@@ -269,7 +289,7 @@ class CRM_Contact_Form_Task_AddToHousehold extends CRM_Contact_Form_Task {
         $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
+            $result->contact_sub_type : $result->contact_type
         );
       }
 
index 5c39564c35c065e16295fd2737b0987b4420c0be..1a3a3951a4f3337bdfc02c1aa697651d5477d83b 100644 (file)
@@ -63,7 +63,8 @@ class CRM_Contact_Form_Task_AddToOrganization extends CRM_Contact_Form_Task {
       'relationship_type_id',
       ts('Relationship Type'),
       array(
-        '' => ts('- select -')) +
+        '' => ts('- select -')
+      ) +
       CRM_Contact_BAO_Relationship::getRelationType("Organization"), TRUE
     );
 
@@ -145,10 +146,11 @@ class CRM_Contact_Form_Task_AddToOrganization extends CRM_Contact_Form_Task {
         }
 
         if (CRM_Contact_BAO_Relationship::checkDuplicateRelationship($params,
-            CRM_Utils_Array::value('contact', $ids),
-            // step 2
-            $params['contact_check']
-          )) {
+          CRM_Utils_Array::value('contact', $ids),
+          // step 2
+          $params['contact_check']
+        )
+        ) {
           $duplicate++;
           continue;
         }
@@ -159,15 +161,33 @@ class CRM_Contact_Form_Task_AddToOrganization extends CRM_Contact_Form_Task {
       list($rtype, $a_b) = explode('_', $data['relationship_type_id'], 2);
       $relationship = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_RelationshipType', $rtype, "label_$a_b");
 
-      $status = array(ts('%count %2 %3 relationship created', array('count' => $valid, 'plural' => '%count %2 %3 relationships created', 2 => $relationship, 3 => $org)));
+      $status = array(
+        ts('%count %2 %3 relationship created', array(
+            'count' => $valid,
+            'plural' => '%count %2 %3 relationships created',
+            2 => $relationship,
+            3 => $org
+          ))
+      );
       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 => $org));
+        $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 => $org
+          ));
       }
       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'));
+        $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'
+          ));
       }
       $status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
-      CRM_Core_Session::setStatus($status, ts('Relationship created.', array('count' => $valid, 'plural' => 'Relationships created.')), 'success', array('expires' => 0));
+      CRM_Core_Session::setStatus($status, ts('Relationship created.', array(
+            'count' => $valid,
+            'plural' => 'Relationships created.'
+          )), 'success', array('expires' => 0));
     }
   }
 
index e6e4f15d595d15443edd1b7fb03c4b2d20e0f14b..91811916f29ce55b26af3630c855d2c592c7d529 100644 (file)
@@ -146,7 +146,10 @@ class CRM_Contact_Form_Task_AddToTag extends CRM_Contact_Form_Task {
 
       $status = array(ts('%count contact tagged', array('count' => $added, 'plural' => '%count contacts tagged')));
       if ($notAdded) {
-        $status[] = ts('%count contact already had this tag', array('count' => $notAdded, 'plural' => '%count contacts already had this tag'));
+        $status[] = ts('%count contact already had this tag', array(
+            'count' => $notAdded,
+            'plural' => '%count contacts already had this tag'
+          ));
       }
       $status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
       CRM_Core_Session::setStatus($status, ts("Added Tag <em>%1</em>", array(1 => $this->_tags[$key])), 'success', array('expires' => 0));
index beb116ce8f4ab23655db157c05fdc284b225948c..f8c4c746b83e69cc6c79dc71a9f5da3e3ac2ac7b 100644 (file)
@@ -45,7 +45,7 @@ class CRM_Contact_Form_Task_AlterPreferences extends CRM_Contact_Form_Task {
    *
    * @return void
    */
-   public function buildQuickForm() {
+  public function buildQuickForm() {
     // add select for preferences
 
     $options = array(ts('Add Selected Options'), ts('Remove selected options'));
index f56373ce8bec606db9a3a9e068e1f2002268698b..75f10ff0f854172fe4c77546bd85fdbda543be59 100644 (file)
@@ -130,8 +130,12 @@ class CRM_Contact_Form_Task_Batch extends CRM_Contact_Form_Task {
     // if below fields are missing we should not reset sort name / display name
     // CRM-6794
     $preserveDefaultsArray = array(
-      'first_name', 'last_name', 'middle_name',
-      'organization_name', 'prefix_id', 'suffix_id',
+      'first_name',
+      'last_name',
+      'middle_name',
+      'organization_name',
+      'prefix_id',
+      'suffix_id',
       'household_name',
     );
 
@@ -226,8 +230,8 @@ class CRM_Contact_Form_Task_Batch extends CRM_Contact_Form_Task {
   public function postProcess() {
     $params = $this->exportValues();
 
-    $ufGroupId         = $this->get('ufGroupId');
-    $notify            = NULL;
+    $ufGroupId = $this->get('ufGroupId');
+    $notify = NULL;
     $inValidSubtypeCnt = 0;
     //send profile notification email if 'notify' field is set
     $notify = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $ufGroupId, 'notify');
@@ -254,7 +258,10 @@ class CRM_Contact_Form_Task_Batch extends CRM_Contact_Form_Task {
 
     CRM_Core_Session::setStatus('', ts("Updates Saved"), 'success');
     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)), ts('Invalid Subtype'));
+      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
+          )), ts('Invalid Subtype'));
     }
   }
 
index 264508fef053cefa0aa31faec10cfa028a5cc581..2c85b7e38a05cfa94ebdd820f98e523d39badf0f 100644 (file)
@@ -67,9 +67,9 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task {
     $this->_searchKey = CRM_Utils_Request::retrieve('key', 'String', $this);
 
     // sort out whether it’s a delete-to-trash, delete-into-oblivion or restore (and let the template know)
-    $values              = $this->controller->exportValues();
+    $values = $this->controller->exportValues();
     $this->_skipUndelete = (CRM_Core_Permission::check('access deleted contacts') and (CRM_Utils_Request::retrieve('skip_undelete', 'Boolean', $this) or CRM_Utils_Array::value('task', $values) == CRM_Contact_Task::DELETE_PERMANENTLY));
-    $this->_restore      = (CRM_Utils_Request::retrieve('restore', 'Boolean', $this) or CRM_Utils_Array::value('task', $values) == CRM_Contact_Task::RESTORE);
+    $this->_restore = (CRM_Utils_Request::retrieve('restore', 'Boolean', $this) or CRM_Utils_Array::value('task', $values) == CRM_Contact_Task::RESTORE);
 
     if ($this->_restore && !CRM_Core_Permission::check('access deleted contacts')) {
       CRM_Core_Error::fatal(ts('You do not have permission to access this contact.'));
@@ -126,11 +126,17 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task {
       if ($sharedAddressCount > 0) {
         if (count($this->_contactIds) > 1) {
           // more than one contact deleted
-          $message = ts('One of the selected contacts has an address record that is shared with 1 other contact.', array('plural' => 'One or more selected contacts have address records which are shared with %count other contacts.', 'count' => $sharedAddressCount));
+          $message = ts('One of the selected contacts has an address record that is shared with 1 other contact.', array(
+              'plural' => 'One or more selected contacts have address records which are shared with %count other contacts.',
+              'count' => $sharedAddressCount
+            ));
         }
         else {
           // only one contact deleted
-          $message = ts('This contact has an address record which is shared with 1 other contact.', array('plural' => 'This contact has an address record which is shared with %count other contacts.', 'count' => $sharedAddressCount));
+          $message = ts('This contact has an address record which is shared with 1 other contact.', array(
+              'plural' => 'This contact has an address record which is shared with %count other contacts.',
+              'count' => $sharedAddressCount
+            ));
         }
         CRM_Core_Session::setStatus($message . ' ' . ts('Shared addresses will not be removed or altered but will no longer be shared.'), ts('Shared Addesses Owner'));
       }
@@ -161,8 +167,8 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task {
 
       $session = CRM_Core_Session::singleton();
       $session->replaceUserContext(CRM_Utils_System::url('civicrm/contact/view',
-          'reset=1&cid=' . $this->_contactIds[0] . $urlParams
-        ));
+        'reset=1&cid=' . $this->_contactIds[0] . $urlParams
+      ));
       $this->addDefaultButtons($label, 'done', 'cancel');
     }
     else {
@@ -204,7 +210,7 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task {
     $session = CRM_Core_Session::singleton();
     $currentUserId = $session->get('userID');
 
-    $context   = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'basic');
+    $context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'basic');
     $urlParams = 'force=1';
     $urlString = "civicrm/contact/search/$context";
 
@@ -249,13 +255,25 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task {
       $title = ts('Deleted');
       if ($this->_restore) {
         $title = ts('Restored');
-        $status = ts('%1 has been restored from the trash.', array(1 => $name, 'plural' => '%count contacts restored from trash.', 'count' => $deleted));
+        $status = ts('%1 has been restored from the trash.', array(
+            1 => $name,
+            'plural' => '%count contacts restored from trash.',
+            'count' => $deleted
+          ));
       }
       elseif ($this->_skipUndelete) {
-        $status = ts('%1 has been permanently deleted.', array(1 => $name, 'plural' => '%count contacts permanently deleted.', 'count' => $deleted));
+        $status = ts('%1 has been permanently deleted.', array(
+            1 => $name,
+            'plural' => '%count contacts permanently deleted.',
+            'count' => $deleted
+          ));
       }
       else {
-        $status = ts('%1 has been moved to the trash.', array(1 => $name, 'plural' => '%count contacts moved to trash.', 'count' => $deleted));
+        $status = ts('%1 has been moved to the trash.', array(
+            1 => $name,
+            'plural' => '%count contacts moved to trash.',
+            'count' => $deleted
+          ));
       }
       $session->setStatus($status, $title, 'success');
     }
index e5a89b4c643d41e53cf17600d973446ddee85daa..a31bceb0a01863c9e0acc15fd8bc7d607ae07171 100644 (file)
@@ -118,7 +118,7 @@ class CRM_Contact_Form_Task_Email extends CRM_Contact_Form_Task {
     }
 
     if ($cid) {
-      $cid = explode(',',$cid);
+      $cid = explode(',', $cid);
       $displayName = array();
 
       foreach ($cid as $val) {
index 2b8850654c4b47402cde0a7d62830f8d71d388f2..9907ea8f58d2cd1399f7fdae782e7c6f72db4c13 100644 (file)
@@ -152,8 +152,8 @@ class CRM_Contact_Form_Task_EmailCommon {
     $emailAttributes = array(
       'class' => 'huge',
     );
-    $to  = $form->add('text', 'to', ts('To'), $emailAttributes, TRUE);
-    $cc  = $form->add('text', 'cc_id', ts('CC'), $emailAttributes);
+    $to = $form->add('text', 'to', ts('To'), $emailAttributes, TRUE);
+    $cc = $form->add('text', 'cc_id', ts('CC'), $emailAttributes);
     $bcc = $form->add('text', 'bcc_id', ts('BCC'), $emailAttributes);
 
     $setDefaults = TRUE;
@@ -357,16 +357,16 @@ class CRM_Contact_Form_Task_EmailCommon {
   public static function postProcess(&$form) {
     if (count($form->_contactIds) > self::MAX_EMAILS_KILL_SWITCH) {
       CRM_Core_Error::fatal(ts('Please do not use this task to send a lot of emails (greater than %1). We recommend using CiviMail instead.',
-          array(1 => self::MAX_EMAILS_KILL_SWITCH)
-        ));
+        array(1 => self::MAX_EMAILS_KILL_SWITCH)
+      ));
     }
 
     // check and ensure that
     $formValues = $form->controller->exportValues($form->getName());
 
     $fromEmail = $formValues['fromEmailAddress'];
-    $from      = CRM_Utils_Array::value($fromEmail, $form->_emails);
-    $subject   = $formValues['subject'];
+    $from = CRM_Utils_Array::value($fromEmail, $form->_emails);
+    $subject = $formValues['subject'];
 
     // CRM-13378: Append CC and BCC information at the end of Activity Details and format cc and bcc fields
     $elements = array('cc_id', 'bcc_id');
@@ -451,8 +451,8 @@ class CRM_Contact_Form_Task_EmailCommon {
       // we should allow same emails for different contacts
       $emailKey = "{$contactId}::{$email}";
       if (!in_array($emailKey, $tempEmails)) {
-        $tempEmails[]     = $emailKey;
-        $details          = $form->_contactDetails[$contactId];
+        $tempEmails[] = $emailKey;
+        $details = $form->_contactDetails[$contactId];
         $details['email'] = $email;
         unset($details['email_id']);
         $formattedContactDetails[] = $details;
@@ -477,7 +477,10 @@ class CRM_Contact_Form_Task_EmailCommon {
 
     if ($sent) {
       $count_success = count($form->_toContactDetails);
-      CRM_Core_Session::setStatus(ts('One message was sent successfully.', array('plural' => '%count messages were sent successfully.', 'count' => $count_success)), ts('Message Sent', array('plural' => 'Messages Sent', 'count' => $count_success)), 'success');
+      CRM_Core_Session::setStatus(ts('One message was sent successfully.', array(
+            'plural' => '%count messages were sent successfully.',
+            'count' => $count_success
+          )), ts('Message Sent', array('plural' => 'Messages Sent', 'count' => $count_success)), 'success');
     }
 
     // Display the name and number of contacts for those email is not sent.
@@ -489,13 +492,16 @@ class CRM_Contact_Form_Task_EmailCommon {
     if ($emailsNotSent) {
       $not_sent = array();
       foreach ($emailsNotSent as $contactId => $values) {
-        $displayName    = $values['display_name'];
-        $email          = $values['email'];
+        $displayName = $values['display_name'];
+        $email = $values['email'];
         $contactViewUrl = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid=$contactId");
         $not_sent[] = "<a href='$contactViewUrl' title='$email'>$displayName</a>" . ($values['on_hold'] ? '(' . ts('on hold') . ')' : '');
       }
       $status = '(' . ts('because no email address on file or communication preferences specify DO NOT EMAIL or Contact is deceased or Primary email address is On Hold') . ')<ul><li>' . implode('</li><li>', $not_sent) . '</li></ul>';
-      CRM_Core_Session::setStatus($status, ts('One Message Not Sent', array('count' => count($emailsNotSent), 'plural' => '%count Messages Not Sent')), 'info');
+      CRM_Core_Session::setStatus($status, ts('One Message Not Sent', array(
+            'count' => count($emailsNotSent),
+            'plural' => '%count Messages Not Sent'
+          )), 'info');
     }
 
     if (isset($form->_caseId)) {
index 431cecb2701235cf0130bcb6eacb1b65c03e06dd..9240375488d5bdb8dc65ad2007d21c0fb0098d21 100644 (file)
@@ -67,7 +67,8 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task {
     // add select for Location Type
     $this->addElement('select', 'location_type_id', ts('Select Location'),
       array(
-        '' => ts('Primary')) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'), TRUE
+        '' => ts('Primary')
+      ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'), TRUE
     );
 
     // checkbox for SKIP contacts with Do Not Mail privacy option
@@ -113,8 +114,8 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task {
    * @return void
    */
   public function postProcess() {
-    $fv      = $this->controller->exportValues($this->_name);
-    $config  = CRM_Core_Config::singleton();
+    $fv = $this->controller->exportValues($this->_name);
+    $config = CRM_Core_Config::singleton();
     $locName = NULL;
     //get the address format sequence from the config file
     $mailingFormat = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
@@ -182,11 +183,11 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task {
     //get the contacts information
     $params = array();
     if (!empty($fv['location_type_id'])) {
-      $locType          = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
-      $locName          = $locType[$fv['location_type_id']];
-      $location         = array('location' => array("{$locName}" => $address));
+      $locType = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
+      $locName = $locType[$fv['location_type_id']];
+      $location = array('location' => array("{$locName}" => $address));
       $returnProperties = array_merge($returnProperties, $location);
-      $params[]         = array('location_type', '=', array($fv['location_type_id'] => 1), 0, 0);
+      $params[] = array('location_type', '=', array($fv['location_type_id'] => 1), 0, 0);
     }
     else {
       $returnProperties = array_merge($returnProperties, $address);
@@ -197,7 +198,10 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task {
     foreach ($this->_contactIds as $key => $contactID) {
       $params[] = array(
         CRM_Core_Form::CB_PREFIX . $contactID,
-        '=', 1, 0, 0,
+        '=',
+        1,
+        0,
+        0,
       );
     }
 
@@ -218,8 +222,8 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task {
 
     //get the total number of contacts to fetch from database.
     $numberofContacts = count($this->_contactIds);
-    $query            = new CRM_Contact_BAO_Query($params, $returnProperties);
-    $details          = $query->apiQuery($params, $returnProperties, NULL, NULL, 0, $numberofContacts);
+    $query = new CRM_Contact_BAO_Query($params, $returnProperties);
+    $details = $query->apiQuery($params, $returnProperties, NULL, NULL, 0, $numberofContacts);
 
     $messageToken = CRM_Utils_Token::getTokens($mailingFormat);
 
@@ -279,11 +283,16 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task {
         $valuesothers = CRM_Core_BAO_Location::getValues($paramsothers, $valuesothers);
         if (!empty($fv['location_type_id'])) {
           foreach ($valuesothers as $vals) {
-                        if (CRM_Utils_Array::value('location_type_id', $vals) ==
-                             CRM_Utils_Array::value('location_type_id', $fv)) {
+            if (CRM_Utils_Array::value('location_type_id', $vals) ==
+              CRM_Utils_Array::value('location_type_id', $fv)
+            ) {
               foreach ($vals as $k => $v) {
                 if (in_array($k, array(
-                  'email', 'phone', 'im', 'openid'))) {
+                  'email',
+                  'phone',
+                  'im',
+                  'openid'
+                ))) {
                   if ($k == 'im') {
                     $rows[$value][$k] = $v['1']['name'];
                   }
@@ -324,7 +333,7 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task {
     // format the addresses according to CIVICRM_ADDRESS_FORMAT (CRM-1327)
     foreach ($rows as $id => $row) {
       if ($commMethods = CRM_Utils_Array::value('preferred_communication_method', $row)) {
-        $val  = array_filter(explode(CRM_Core_DAO::VALUE_SEPARATOR, $commMethods));
+        $val = array_filter(explode(CRM_Core_DAO::VALUE_SEPARATOR, $commMethods));
         $comm = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'preferred_communication_method');
         $temp = array();
         foreach ($val as $vals) {
@@ -366,12 +375,13 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task {
   public static function tokenIsFound($contact, $mailingFormatProperties, $tokenFields) {
     foreach (array_merge($mailingFormatProperties, array_fill_keys($tokenFields, 1)) as $key => $dontCare) {
       //we should not consider addressee for data exists, CRM-6025
-       if ($key != 'addressee' && !empty($contact[$key])) {
+      if ($key != 'addressee' && !empty($contact[$key])) {
         return TRUE;
       }
     }
     return FALSE;
   }
+
   /**
    * Create labels (pdf)
    *
index ff309d5b1803a1c38a533d48e28d3aaed2a91d21..77b009a42e479bdabbbdafcc9819a3006945e504 100644 (file)
@@ -125,7 +125,10 @@ class CRM_Contact_Form_Task_LabelCommon {
     foreach ($contactIDs as $key => $contactID) {
       $params[] = array(
         CRM_Core_Form::CB_PREFIX . $contactID,
-        '=', 1, 0, 0,
+        '=',
+        1,
+        0,
+        0,
       );
     }
 
@@ -137,11 +140,11 @@ class CRM_Contact_Form_Task_LabelCommon {
     $params[] = array('is_deceased', '=', 0, 0, 0);
 
     if ($locationTypeID) {
-      $locType          = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
-      $locName          = $locType[$locationTypeID];
-      $location         = array('location' => array("{$locName}" => $addressReturnProperties));
+      $locType = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
+      $locName = $locType[$locationTypeID];
+      $location = array('location' => array("{$locName}" => $addressReturnProperties));
       $returnProperties = array_merge($returnProperties, $location);
-      $params[]         = array('location_type', '=', array($locationTypeID => 1), 0, 0);
+      $params[] = array('location_type', '=', array($locationTypeID => 1), 0, 0);
     }
     else {
       $returnProperties = array_merge($returnProperties, $addressReturnProperties);
@@ -158,8 +161,8 @@ class CRM_Contact_Form_Task_LabelCommon {
     $numberofContacts = count($contactIDs);
     //this does the same as calling civicrm_api3('contact, get, array('id' => array('IN' => $this->_contactIds)
     // except it also handles multiple locations
-    $query            = new CRM_Contact_BAO_Query($params, $returnProperties);
-    $details          = $query->apiQuery($params, $returnProperties, NULL, NULL, 0, $numberofContacts);
+    $query = new CRM_Contact_BAO_Query($params, $returnProperties);
+    $details = $query->apiQuery($params, $returnProperties, NULL, NULL, 0, $numberofContacts);
 
     $messageToken = CRM_Utils_Token::getTokens($mailingFormat);
     $details = $details[0];
@@ -204,10 +207,15 @@ class CRM_Contact_Form_Task_LabelCommon {
         if ($locationTypeID) {
           foreach ($valuesothers as $vals) {
             if (CRM_Utils_Array::value('location_type_id', $vals) ==
-              $locationTypeID) {
+              $locationTypeID
+            ) {
               foreach ($vals as $k => $v) {
                 if (in_array($k, array(
-                  'email', 'phone', 'im', 'openid'))) {
+                  'email',
+                  'phone',
+                  'im',
+                  'openid'
+                ))) {
                   if ($k == 'im') {
                     $rows[$value][$k] = $v['1']['name'];
                   }
@@ -285,7 +293,7 @@ class CRM_Contact_Form_Task_LabelCommon {
       NULL,
       $messageToken,
       'CRM_Contact_Form_Task_LabelCommon'
-     );
+    );
 
     CRM_Utils_Hook::tokens($tokens);
 
@@ -318,19 +326,19 @@ class CRM_Contact_Form_Task_LabelCommon {
 
     # exclude individuals belonging to selected households
     foreach ($households as $household_id => $row) {
-    $dao = new CRM_Contact_DAO_Relationship();
-    $dao->contact_id_b = $household_id;
-    $dao->find();
-    while ($dao->fetch()) {
-    $individual_id = $dao->contact_id_a;
-    if (array_key_exists($individual_id, $individuals)) {
-    unset($individuals[$individual_id]);
-    }
-    }
+      $dao = new CRM_Contact_DAO_Relationship();
+      $dao->contact_id_b = $household_id;
+      $dao->find();
+      while ($dao->fetch()) {
+        $individual_id = $dao->contact_id_a;
+        if (array_key_exists($individual_id, $individuals)) {
+          unset($individuals[$individual_id]);
+        }
+      }
     }
 
     # merge back individuals and households
     $rows = array_merge($individuals, $households);
     return $rows;
-    }
+  }
 }
index c1f4e8541fe28046055138710181c1d11db55177..0a225a2ab597a665331cf2975427176dfbaadabb 100644 (file)
@@ -211,7 +211,7 @@ class CRM_Contact_Form_Task_Map extends CRM_Contact_Form_Task {
 
     $sumLat = $sumLng = 0;
     $maxLat = $maxLng = -400;
-    $minLat = $minLng = 400;
+    $minLat = $minLng = 400;
     foreach ($locations as $location) {
       $sumLat += $location['lat'];
       $sumLng += $location['lng'];
@@ -236,8 +236,8 @@ class CRM_Contact_Form_Task_Map extends CRM_Contact_Form_Task {
       'lng' => (float ) $sumLng / count($locations),
     );
     $span = array(
-      'lat' => (float )($maxLat - $minLat),
-      'lng' => (float )($maxLng - $minLng),
+      'lat' => (float ) ($maxLat - $minLat),
+      'lng' => (float ) ($maxLng - $minLng),
     );
     $page->assign_by_ref('center', $center);
     $page->assign_by_ref('span', $span);
index 93b01e366279aff24201524231c3030800801cf0..c8099dce4da6cb56aef74b33a3c61423af651da1 100644 (file)
@@ -63,7 +63,7 @@ class CRM_Contact_Form_Task_Merge extends CRM_Contact_Form_Task {
       while ($contact->fetch()) {
         $contactTypes[$contact->contact_type] = TRUE;
         if (count($contactTypes) > 1)
-        break;
+          break;
       }
       if (count($contactTypes) > 1) {
         $statusMsg = ts('Selected records must all be the same contact type (i.e. all Individuals).');
index 8ebdc65f10692a95dbeac795cae656dad6bbf066..b6a6b55c51e0be767fb88ef025cd3a6015e3cf99 100644 (file)
@@ -47,9 +47,9 @@ class CRM_Contact_Form_Task_PDFLetterCommon {
    * @return void
    */
   public static function preProcess(&$form) {
-    $messageText    = array();
+    $messageText = array();
     $messageSubject = array();
-    $dao            = new CRM_Core_BAO_MessageTemplate();
+    $dao = new CRM_Core_BAO_MessageTemplate();
     $dao->is_active = 1;
     $dao->find();
     while ($dao->fetch()) {
@@ -370,10 +370,10 @@ class CRM_Contact_Form_Task_PDFLetterCommon {
    */
   public static function createActivities($form, $html_message, $contactIds) {
     //Added for CRM-12682: Add activity subject and campaign fields
-    $formValues     = $form->controller->exportValues($form->getName());
+    $formValues = $form->controller->exportValues($form->getName());
 
-    $session        = CRM_Core_Session::singleton();
-    $userID         = $session->get('userID');
+    $session = CRM_Core_Session::singleton();
+    $userID = $session->get('userID');
     $activityTypeID = CRM_Core_OptionGroup::getValue(
       'activity_type',
       'Print PDF Letter',
@@ -439,8 +439,8 @@ class CRM_Contact_Form_Task_PDFLetterCommon {
         $matches = array();
         if (preg_match('/^(&nbsp;)+/', $msg, $matches)) {
           $spaceLen = strlen($matches[0]) / 6;
-          $trimMsg  = ltrim($msg, '&nbsp; ');
-          $charLen  = strlen($trimMsg);
+          $trimMsg = ltrim($msg, '&nbsp; ');
+          $charLen = strlen($trimMsg);
           $totalLen = $charLen + $spaceLen;
           if ($totalLen > 100) {
             $spacesCount = 10;
index c59a397687bc9d70157174df78b3e43df3bdc108..b2cc75dfb4f605f1f355a62cc4cd9e41584218a9 100644 (file)
@@ -77,7 +77,10 @@ class CRM_Contact_Form_Task_PickProfile extends CRM_Contact_Form_Task {
     $validate = FALSE;
     //validations
     if (count($this->_contactIds) > $this->_maxContacts) {
-      CRM_Core_Session::setStatus(ts("The maximum number of contacts you can select for Batch Update is %1. You have selected %2. Please select fewer contacts from your search results and try again.", array(1 => $this->_maxContacts, 2 => count($this->_contactIds))), ts('Maximum Exceeded'), 'error');
+      CRM_Core_Session::setStatus(ts("The maximum number of contacts you can select for Batch Update is %1. You have selected %2. Please select fewer contacts from your search results and try again.", array(
+            1 => $this->_maxContacts,
+            2 => count($this->_contactIds)
+          )), ts('Maximum Exceeded'), 'error');
       $validate = TRUE;
     }
 
index 11747d38b8ef8709626db7c3523d697da0db7d31..0b4995e53da58d80090ebe3802826b399cc8513c 100644 (file)
@@ -56,12 +56,15 @@ class CRM_Contact_Form_Task_Print extends CRM_Contact_Form_Task {
     if (!empty($this->_contactIds)) {
       //using _contactIds field for creating params for query so that multiple selections on multiple pages
       //can be printed.
-    foreach ($this->_contactIds as $contactId) {
+      foreach ($this->_contactIds as $contactId) {
         $params[] = array(
           CRM_Core_Form::CB_PREFIX . $contactId,
           '=',
-          1, 0, 0);
-    }
+          1,
+          0,
+          0
+        );
+      }
     }
 
     // create the selector, controller and run - store results in session
@@ -85,13 +88,13 @@ class CRM_Contact_Form_Task_Print extends CRM_Contact_Form_Task {
 
     $returnP = isset($returnPropeties) ? $returnPropeties : "";
     $customSearchClass = $this->get('customSearchClass');
-    $selector   = new $selectorName($customSearchClass,
-                 $fv,
-                 $params,
-                 $returnP,
-                 $this->_action,
-                 $includeContactIds
-      );
+    $selector = new $selectorName($customSearchClass,
+      $fv,
+      $params,
+      $returnP,
+      $this->_action,
+      $includeContactIds
+    );
     $controller = new CRM_Core_Selector_Controller($selector,
       NULL,
       $sortID,
index 54313f2765d5e46e86996a3b50901df9ddf4dcb4..fea9dbe3afc70fe4910d23cb47eb164a3fc15488 100644 (file)
@@ -144,8 +144,8 @@ class CRM_Contact_Form_Task_ProximityCommon extends CRM_Contact_Form_Task {
    *   the default array reference
    */
   public function setDefaultValues($form) {
-    $defaults       = array();
-    $config         = CRM_Core_Config::singleton();
+    $defaults = array();
+    $config = CRM_Core_Config::singleton();
     $countryDefault = $config->defaultContactCountry;
 
     if ($countryDefault) {
index c07fb53dc85fffea0d33d22f21a86beae905a31b..f96c4141a0e0aca0bc17616520a1ab2faf6f3620 100644 (file)
@@ -83,11 +83,23 @@ class CRM_Contact_Form_Task_RemoveFromGroup extends CRM_Contact_Form_Task {
 
     list($total, $removed, $notRemoved) = CRM_Contact_BAO_GroupContact::removeContactsFromGroup($this->_contactIds, $groupId);
 
-    $status = array(ts("%count contact removed from '%2'", array('count' => $removed, 'plural' => "%count contacts removed from '%2'", 2 => $group[$groupId])));
+    $status = array(
+      ts("%count contact removed from '%2'", array(
+          'count' => $removed,
+          'plural' => "%count contacts removed from '%2'",
+          2 => $group[$groupId]
+        ))
+    );
     if ($notRemoved) {
-      $status[] = ts('1 contact was already not in this group', array('count' => $notRemoved, 'plural' => '%count contacts were already not in this group'));
+      $status[] = ts('1 contact was already not in this group', array(
+          'count' => $notRemoved,
+          'plural' => '%count contacts were already not in this group'
+        ));
     }
     $status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
-    CRM_Core_Session::setStatus($status, ts("Removed Contact From Group", array('plural' => "Removed Contacts From Group", 'count' => $removed)), 'success', array('expires' => 0));
+    CRM_Core_Session::setStatus($status, ts("Removed Contact From Group", array(
+          'plural' => "Removed Contacts From Group",
+          'count' => $removed
+        )), 'success', array('expires' => 0));
   }
 }
index cc1cf3954b8384cb3827ea2e24b2d6ccf93be3b1..0c19f2109d9f6e4c4e1b2f292e160d2e068a5fdf 100644 (file)
@@ -134,9 +134,17 @@ class CRM_Contact_Form_Task_RemoveFromTag extends CRM_Contact_Form_Task {
 
       list($total, $removed, $notRemoved) = CRM_Core_BAO_EntityTag::removeEntitiesFromTag($this->_contactIds, $key);
 
-      $status = array(ts('%count contact un-tagged', array('count' => $removed, 'plural' => '%count contacts un-tagged')));
+      $status = array(
+        ts('%count contact un-tagged', array(
+            'count' => $removed,
+            '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'));
+        $status[] = ts('1 contact already did not have this tag', array(
+            'count' => $notRemoved,
+            'plural' => '%count contacts 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));
index 60d03f90bec2999a6e8c109b07cd65648d77c7ba..3696721a679e67de78956c4d56921c874a224b8c 100644 (file)
@@ -53,7 +53,9 @@ class CRM_Contact_Form_Task_Result extends CRM_Contact_Form_Task {
 
     $context = $this->get('context');
     if (in_array($context, array(
-      'smog', 'amtg'))) {
+      'smog',
+      'amtg'
+    ))) {
       $urlParams = 'reset=1&force=1&context=smog&gid=';
       $urlParams .= ($context == 'smog') ? $this->get('gid') : $this->get('amtgID');
       $session->replaceUserContext(CRM_Utils_System::url('civicrm/group/search', $urlParams));
index e1bca8a50e0dd9a661e627ebdc977415e9558eb9..23aa32eb7a9fff87a0b42e19595f17aabc21cb26 100644 (file)
@@ -76,8 +76,8 @@ class CRM_Contact_Form_Task_SMSCommon {
       }
       if ($activityCheck == count($form->_activityHolderIds)) {
         CRM_Core_Error::statusBounce(ts("The Reply SMS Could only be sent for activities with '%1' subject.",
-            array(1 => self::RECIEVED_SMS_ACTIVITY_SUBJECT)
-          ));
+          array(1 => self::RECIEVED_SMS_ACTIVITY_SUBJECT)
+        ));
       }
     }
   }
@@ -161,14 +161,16 @@ class CRM_Contact_Form_Task_SMSCommon {
         $errorMess = "";
         if ($extendTargetContacts) {
           $errorMess = ts('One selected activity consists of more than one target contact.', array(
-                           'count' => $extendTargetContacts,
-                           'plural' => '%count selected activities consist of more than one target contact.'));
+            'count' => $extendTargetContacts,
+            'plural' => '%count selected activities consist of more than one target contact.'
+          ));
         }
         if ($invalidActivity) {
           $errorMess = ($errorMess ? ' ' : '');
           $errorMess .= ts('The selected activity is invalid.', array(
-                          'count' => $invalidActivity,
-                          'plural' => '%count selected activities are invalid.'));
+            'count' => $invalidActivity,
+            'plural' => '%count selected activities are invalid.'
+          ));
         }
         CRM_Core_Error::statusBounce(ts("%1: SMS Reply will not be sent.", array(1 => $errorMess)));
       }
@@ -214,12 +216,13 @@ class CRM_Contact_Form_Task_SMSCommon {
 
           //if phone is not primary check if non-primary phone is "Mobile"
           if (!empty($value['phone'])
-            && $value['phone_type_id'] != CRM_Utils_Array::value('Mobile', $phoneTypes) && empty($value['is_deceased'])) {
+            && $value['phone_type_id'] != CRM_Utils_Array::value('Mobile', $phoneTypes) && empty($value['is_deceased'])
+          ) {
             $filter = array('do_not_sms' => 0);
             $contactPhones = CRM_Core_BAO_Phone::allPhones($contactId, FALSE, 'Mobile', $filter);
             if (count($contactPhones) > 0) {
               $mobilePhone = CRM_Utils_Array::retrieveValueRecursive($contactPhones, 'phone');
-              $form->_contactDetails[$contactId]['phone_id'] =  CRM_Utils_Array::retrieveValueRecursive($contactPhones, 'id');
+              $form->_contactDetails[$contactId]['phone_id'] = CRM_Utils_Array::retrieveValueRecursive($contactPhones, 'id');
               $form->_contactDetails[$contactId]['phone'] = $mobilePhone;
               $form->_contactDetails[$contactId]['phone_type_id'] = CRM_Utils_Array::value('Mobile', $phoneTypes);
             }
@@ -402,7 +405,10 @@ class CRM_Contact_Form_Task_SMSCommon {
     );
 
     if ($countSuccess > 0) {
-      CRM_Core_Session::setStatus(ts('One message was sent successfully.', array('plural' => '%count messages were sent successfully.', 'count' => $countSuccess)), ts('Message Sent', array('plural' => 'Messages Sent', 'count' => $countSuccess)), 'success');
+      CRM_Core_Session::setStatus(ts('One message was sent successfully.', array(
+            'plural' => '%count messages were sent successfully.',
+            'count' => $countSuccess
+          )), ts('Message Sent', array('plural' => 'Messages Sent', 'count' => $countSuccess)), 'success');
     }
 
     if (is_array($sent)) {
@@ -413,7 +419,10 @@ class CRM_Contact_Form_Task_SMSCommon {
         $status .= '<li>' . $errMsg . '</li>';
       }
       $status .= '</ul>';
-      CRM_Core_Session::setStatus($status, ts('One Message Not Sent', array('count' => count($sent), 'plural' => '%count Messages Not Sent')), 'info');
+      CRM_Core_Session::setStatus($status, ts('One Message Not Sent', array(
+            'count' => count($sent),
+            'plural' => '%count Messages Not Sent'
+          )), 'info');
     }
     else {
       //Display the name and number of contacts for those sms is not sent.
@@ -422,8 +431,8 @@ class CRM_Contact_Form_Task_SMSCommon {
       if (!empty($smsNotSent)) {
         $not_sent = array();
         foreach ($smsNotSent as $index => $contactId) {
-          $displayName    = $form->_allContactDetails[$contactId]['display_name'];
-          $phone          = $form->_allContactDetails[$contactId]['phone'];
+          $displayName = $form->_allContactDetails[$contactId]['display_name'];
+          $phone = $form->_allContactDetails[$contactId]['phone'];
           $contactViewUrl = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid=$contactId");
           $not_sent[] = "<a href='$contactViewUrl' title='$phone'>$displayName</a>";
         }
@@ -432,7 +441,10 @@ class CRM_Contact_Form_Task_SMSCommon {
           $status .= ' ' . ts("or the contact is not part of the activity '%1'", array(1 => self::RECIEVED_SMS_ACTIVITY_SUBJECT));
         }
         $status .= ')<ul><li>' . implode('</li><li>', $not_sent) . '</li></ul>';
-        CRM_Core_Session::setStatus($status, ts('One Message Not Sent', array('count' => count($smsNotSent), 'plural' => '%count Messages Not Sent')), 'info');
+        CRM_Core_Session::setStatus($status, ts('One Message Not Sent', array(
+              'count' => count($smsNotSent),
+              'plural' => '%count Messages Not Sent'
+            )), 'info');
       }
     }
   }
index ee5150566c3a38875a74790e3a85ca3dff6595ac..935409a302ea733425a23ba773f5cbfa0982fee6 100644 (file)
@@ -164,9 +164,9 @@ class CRM_Contact_Form_Task_SaveSearch extends CRM_Contact_Form_Task {
       if (!$this->_id) {
         //save record in mapping table
         $mappingParams = array('mapping_type' => 'Search Builder');
-        $temp          = array();
-        $mapping       = CRM_Core_BAO_Mapping::add($mappingParams, $temp);
-        $mappingId     = $mapping->id;
+        $temp = array();
+        $mapping = CRM_Core_BAO_Mapping::add($mappingParams, $temp);
+        $mappingId = $mapping->id;
       }
       else {
         //get the mapping id from saved search
@@ -199,8 +199,8 @@ class CRM_Contact_Form_Task_SaveSearch extends CRM_Contact_Form_Task {
       is_array($formValues['group_type'])
     ) {
       $params['group_type'] = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,
-        array_keys($formValues['group_type'])
-      ) . CRM_Core_DAO::VALUE_SEPARATOR;
+          array_keys($formValues['group_type'])
+        ) . CRM_Core_DAO::VALUE_SEPARATOR;
     }
     else {
       $params['group_type'] = '';
index 8fc69e313c47bcd1899f8f21f081861969495044..05ec941b34e435f9dd0b56591624453e539dcb14 100644 (file)
@@ -29,10 +29,16 @@ WHERE on_hold = 1 AND hold_date is not null AND contact_id in (" . implode(",",
       $sql = "SELECT ROW_COUNT( )";
       $result = CRM_Core_DAO::singleValueQuery($sql);
       if ($result) {
-        CRM_Core_Session::setStatus(ts('%count email was found on hold and updated.', array('count' => $result, 'plural' => '%count emails were found on hold and updated.')), ts('Emails Restored'), 'success');
+        CRM_Core_Session::setStatus(ts('%count email was found on hold and updated.', array(
+              'count' => $result,
+              'plural' => '%count emails were found on hold and updated.'
+            )), ts('Emails Restored'), 'success');
       }
       else {
-        CRM_Core_Session::setStatus(ts('The selected contact does not have an email on hold.', array('count' => $result, 'plural' => 'None of the selected contacts have an email on hold.')), ts('No Emails to Restore'), 'info');
+        CRM_Core_Session::setStatus(ts('The selected contact does not have an email on hold.', array(
+              'count' => $result,
+              'plural' => 'None of the selected contacts have an email on hold.'
+            )), ts('No Emails to Restore'), 'info');
       }
     }
     else {
index 401f06532c25dea2be559407fad62c85fb235346..1a015edc1dd8d475e5b9961256b1c3969e64a7f7 100755 (executable)
@@ -55,11 +55,11 @@ class CRM_Contact_Form_Task_Useradd extends CRM_Core_Form {
   public function preProcess() {
     $params = $defaults = $ids = array();
 
-    $this->_contactId   = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
-    $params['id']       = $params['contact_id'] = $this->_contactId;
-    $contact            = CRM_Contact_BAO_Contact::retrieve($params, $defaults, $ids);
+    $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
+    $params['id'] = $params['contact_id'] = $this->_contactId;
+    $contact = CRM_Contact_BAO_Contact::retrieve($params, $defaults, $ids);
     $this->_displayName = $contact->display_name;
-    $this->_email       = $contact->email;
+    $this->_email = $contact->email;
     CRM_Utils_System::setTitle(ts('Create User Record for %1', array(1 => $this->_displayName)));
   }
 
index 43191809b41eda08872d904e07503395d12e875c..59a269beed69df504e4a05148d0401ec74a15492 100644 (file)
@@ -66,9 +66,9 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form {
       CRM_Core_Error::fatal(ts('Database Configuration Error: Insufficient permissions. Import requires that the CiviCRM database user has permission to create temporary tables. Contact your site administrator for assistance.'));
     }
 
-    $results    = array();
-    $config     = CRM_Core_Config::singleton();
-    $handler    = opendir($config->uploadDir);
+    $results = array();
+    $config = CRM_Core_Config::singleton();
+    $handler = opendir($config->uploadDir);
     $errorFiles = array('sqlImport.errors', 'sqlImport.conflicts', 'sqlImport.duplicates', 'sqlImport.mismatch');
 
     // check for post max size avoid when called twice
@@ -86,7 +86,10 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form {
     }
     closedir($handler);
     if (!empty($results)) {
-      CRM_Core_Error::fatal(ts('<b>%1</b> file(s) in %2 directory are not writable. Listed file(s) might be used during the import to log the errors occurred during Import process. Contact your site administrator for assistance.', array(1 => implode(', ', $results), 2 => $config->uploadDir)));
+      CRM_Core_Error::fatal(ts('<b>%1</b> file(s) in %2 directory are not writable. Listed file(s) might be used during the import to log the errors occurred during Import process. Contact your site administrator for assistance.', array(
+            1 => implode(', ', $results),
+            2 => $config->uploadDir
+          )));
     }
 
     $this->_dataSourceIsValid = FALSE;
@@ -170,9 +173,9 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form {
     );
 
     $mappingArray = CRM_Core_BAO_Mapping::getMappings(CRM_Core_OptionGroup::getValue('mapping_type',
-        'Import Contact',
-        'name'
-      ));
+      'Import Contact',
+      'name'
+    ));
 
     $this->assign('savedMapping', $mappingArray);
     $this->addElement('select', 'savedMapping', ts('Mapping Option'), array('' => ts('- select -')) + $mappingArray);
@@ -266,9 +269,9 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form {
    */
   private function _getDataSources() {
     // Open the data source dir and scan it for class files
-    $config        = CRM_Core_Config::singleton();
+    $config = CRM_Core_Config::singleton();
     $dataSourceDir = $config->importDataSourceDir;
-    $dataSources   = array();
+    $dataSources = array();
     if (!is_dir($dataSourceDir)) {
       CRM_Core_Error::fatal("Import DataSource directory $dataSourceDir does not exist");
     }
@@ -285,7 +288,7 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form {
         $dataSourceClass = "CRM_Import_DataSource_" . $matches[1];
         require_once $dataSourceDir . DIRECTORY_SEPARATOR . $dataSourceFile;
         $object = new $dataSourceClass;
-        $info   = $object->getInfo();
+        $info = $object->getInfo();
         $dataSources[$dataSourceClass] = $info['title'];
       }
     }
@@ -340,8 +343,8 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form {
 
       // We should have the data in the DB now, parse it
       $importTableName = $this->get('importTableName');
-      $fieldNames      = $this->_prepareImportTable($db, $importTableName);
-      $mapper          = array();
+      $fieldNames = $this->_prepareImportTable($db, $importTableName);
+      $mapper = array();
 
       $parser = new CRM_Contact_Import_Parser_Contact($mapper);
       $parser->setMaxLinesToProcess(100);
index 3d9d87c9495d1043b94fdb4bd7c2ab6c399b4648..ec64bea5127a3753bfc7d3bb2b4ef4a7c84c0fca 100644 (file)
@@ -107,7 +107,7 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
     //format custom field names, CRM-2676
     switch ($this->get('contactType')) {
       case CRM_Import_Parser::CONTACT_INDIVIDUAL:
-        $contactType         = 'Individual';
+        $contactType = 'Individual';
         $highlightedFields[] = 'first_name';
         $highlightedFields[] = 'last_name';
         break;
@@ -133,10 +133,13 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
     if ($this->_onDuplicate != CRM_Import_Parser::DUPLICATE_NOCHECK) {
       //Mark Dedupe Rule Fields as required, since it's used in matching contact
       foreach (array(
-        'Individual', 'Household', 'Organization') as $cType) {
+                 'Individual',
+                 'Household',
+                 'Organization'
+               ) as $cType) {
         $ruleParams = array(
           'contact_type' => $cType,
-          'used'         => 'Unsupervised',
+          'used' => 'Unsupervised',
         );
         $this->_dedupeFields[$cType] = CRM_Dedupe_BAO_Rule::dedupeRuleFields($ruleParams);
       }
@@ -214,19 +217,19 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
       list($mappingName, $mappingContactType, $mappingLocation, $mappingPhoneType, $mappingImProvider, $mappingRelation, $mappingOperator, $mappingValue, $mappingWebsiteType) = CRM_Core_BAO_Mapping::getMappingFields($savedMapping);
 
       //get loaded Mapping Fields
-      $mappingName        = CRM_Utils_Array::value(1, $mappingName);
+      $mappingName = CRM_Utils_Array::value(1, $mappingName);
       $mappingContactType = CRM_Utils_Array::value(1, $mappingContactType);
-      $mappingLocation    = CRM_Utils_Array::value(1, $mappingLocation);
-      $mappingPhoneType   = CRM_Utils_Array::value(1, $mappingPhoneType);
-      $mappingImProvider  = CRM_Utils_Array::value(1, $mappingImProvider);
-      $mappingRelation    = CRM_Utils_Array::value(1, $mappingRelation);
+      $mappingLocation = CRM_Utils_Array::value(1, $mappingLocation);
+      $mappingPhoneType = CRM_Utils_Array::value(1, $mappingPhoneType);
+      $mappingImProvider = CRM_Utils_Array::value(1, $mappingImProvider);
+      $mappingRelation = CRM_Utils_Array::value(1, $mappingRelation);
       $mappingWebsiteType = CRM_Utils_Array::value(1, $mappingWebsiteType);
 
       $this->assign('loadedMapping', $savedMapping);
       $this->set('loadedMapping', $savedMapping);
 
-      $params         = array('id' => $savedMapping);
-      $temp           = array();
+      $params = array('id' => $savedMapping);
+      $temp = array();
       $mappingDetails = CRM_Core_BAO_Mapping::retrieve($params, $temp);
 
       $this->assign('savedName', $mappingDetails->name);
@@ -245,11 +248,11 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
 
     //-------- end of saved mapping stuff ---------
 
-    $defaults         = array();
-    $mapperKeys       = array_keys($this->_mapperFields);
-    $hasColumnNames   = !empty($this->_columnNames);
-    $columnPatterns   = $this->get('columnPatterns');
-    $dataPatterns     = $this->get('dataPatterns');
+    $defaults = array();
+    $mapperKeys = array_keys($this->_mapperFields);
+    $hasColumnNames = !empty($this->_columnNames);
+    $columnPatterns = $this->get('columnPatterns');
+    $dataPatterns = $this->get('dataPatterns');
     $hasLocationTypes = $this->get('fieldTypes');
 
     $this->_location_types = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
@@ -270,8 +273,8 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
     $sel1 = $this->_mapperFields;
     $sel2[''] = NULL;
 
-    $phoneTypes   = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
-    $imProviders  = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
+    $phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
+    $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
     $websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
 
     foreach ($this->_location_types as $key => $value) {
@@ -444,9 +447,9 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
               }
 
               $contactDetails = strtolower(str_replace(" ", "_", $mappingName[$i]));
-              $websiteTypeId  = isset($mappingWebsiteType[$i]) ? $mappingWebsiteType[$i] : NULL;
-              $locationId     = isset($mappingLocation[$i]) ? $mappingLocation[$i] : 0;
-              $phoneType      = isset($mappingPhoneType[$i]) ? $mappingPhoneType[$i] : NULL;
+              $websiteTypeId = isset($mappingWebsiteType[$i]) ? $mappingWebsiteType[$i] : NULL;
+              $locationId = isset($mappingLocation[$i]) ? $mappingLocation[$i] : 0;
+              $phoneType = isset($mappingPhoneType[$i]) ? $mappingPhoneType[$i] : NULL;
               //get provider id from saved mappings
               $imProvider = isset($mappingImProvider[$i]) ? $mappingImProvider[$i] : NULL;
 
@@ -488,8 +491,8 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
             else {
               $mappingHeader = array_keys($this->_mapperFields, $mappingName[$i]);
               $websiteTypeId = isset($mappingWebsiteType[$i]) ? $mappingWebsiteType[$i] : NULL;
-              $locationId    = isset($mappingLocation[$i]) ? $mappingLocation[$i] : 0;
-              $phoneType     = isset($mappingPhoneType[$i]) ? $mappingPhoneType[$i] : NULL;
+              $locationId = isset($mappingLocation[$i]) ? $mappingLocation[$i] : 0;
+              $phoneType = isset($mappingPhoneType[$i]) ? $mappingPhoneType[$i] : NULL;
               // get IM service provider id
               $imProvider = isset($mappingImProvider[$i]) ? $mappingImProvider[$i] : NULL;
 
@@ -599,20 +602,20 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
     $this->setDefaults($defaults);
 
     $this->addButtons(array(
-      array(
-        'type' => 'back',
-        'name' => ts('Previous'),
-      ),
-       array(
-         'type' => 'next',
-         'name' => ts('Continue'),
-         'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
-         'isDefault' => TRUE,
-       ),
-       array(
-         'type' => 'cancel',
-         'name' => ts('Cancel'),
-       ),
+        array(
+          'type' => 'back',
+          'name' => ts('Previous'),
+        ),
+        array(
+          'type' => 'next',
+          'name' => ts('Continue'),
+          'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
+          'isDefault' => TRUE,
+        ),
+        array(
+          'type' => 'cancel',
+          'name' => ts('Cancel'),
+        ),
       )
     );
   }
@@ -673,14 +676,14 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
       return;
     }
 
-    $mapper         = array();
-    $mapperKeys     = array();
-    $mapperKeys     = $this->controller->exportValue($this->_name, 'mapper');
+    $mapper = array();
+    $mapperKeys = array();
+    $mapperKeys = $this->controller->exportValue($this->_name, 'mapper');
     $mapperKeysMain = array();
 
-    $phoneTypes    = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
-    $imProviders   = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
-    $websiteTypes  = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
+    $phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
+    $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
+    $websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
     $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
 
     //these mapper params need to set key as array and val as null.
@@ -710,11 +713,11 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
         $$mapperParam = NULL;
       }
 
-      $fldName            = CRM_Utils_Array::value(0, $mapperKeys[$i]);
-      $selOne             = CRM_Utils_Array::value(1, $mapperKeys[$i]);
-      $selTwo             = CRM_Utils_Array::value(2, $mapperKeys[$i]);
-      $selThree           = CRM_Utils_Array::value(3, $mapperKeys[$i]);
-      $mapper[$i]         = $this->_mapperFields[$mapperKeys[$i][0]];
+      $fldName = CRM_Utils_Array::value(0, $mapperKeys[$i]);
+      $selOne = CRM_Utils_Array::value(1, $mapperKeys[$i]);
+      $selTwo = CRM_Utils_Array::value(2, $mapperKeys[$i]);
+      $selThree = CRM_Utils_Array::value(3, $mapperKeys[$i]);
+      $mapper[$i] = $this->_mapperFields[$mapperKeys[$i][0]];
       $mapperKeysMain[$i] = $fldName;
 
       //need to differentiate non location elements.
@@ -789,8 +792,12 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
 
     //set related contact propeties.
     $relProperties = array(
-      'related', 'relatedContactType', 'relatedContactDetails',
-      'relatedContactLocType', 'relatedContactPhoneType', 'relatedContactImProvider',
+      'related',
+      'relatedContactType',
+      'relatedContactDetails',
+      'relatedContactLocType',
+      'relatedContactPhoneType',
+      'relatedContactImProvider',
       'relatedContactWebsiteType',
     );
     foreach ($relProperties as $relProperty) {
@@ -823,9 +830,9 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
         $updateMappingFields->column_number = $i;
 
         $mapperKeyParts = explode('_', $mapperKeys[$i][0], 3);
-        $id             = isset($mapperKeyParts[0]) ? $mapperKeyParts[0] : NULL;
-        $first          = isset($mapperKeyParts[1]) ? $mapperKeyParts[1] : NULL;
-        $second         = isset($mapperKeyParts[2]) ? $mapperKeyParts[2] : NULL;
+        $id = isset($mapperKeyParts[0]) ? $mapperKeyParts[0] : NULL;
+        $first = isset($mapperKeyParts[1]) ? $mapperKeyParts[1] : NULL;
+        $second = isset($mapperKeyParts[2]) ? $mapperKeyParts[2] : NULL;
         if (($first == 'a' && $second == 'b') || ($first == 'b' && $second == 'a')) {
           $updateMappingFields->relationship_type_id = $id;
           $updateMappingFields->relationship_direction = "{$first}_{$second}";
@@ -904,9 +911,9 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
         $saveMappingFields->column_number = $i;
 
         $mapperKeyParts = explode('_', $mapperKeys[$i][0], 3);
-        $id             = isset($mapperKeyParts[0]) ? $mapperKeyParts[0] : NULL;
-        $first          = isset($mapperKeyParts[1]) ? $mapperKeyParts[1] : NULL;
-        $second         = isset($mapperKeyParts[2]) ? $mapperKeyParts[2] : NULL;
+        $id = isset($mapperKeyParts[0]) ? $mapperKeyParts[0] : NULL;
+        $first = isset($mapperKeyParts[1]) ? $mapperKeyParts[1] : NULL;
+        $second = isset($mapperKeyParts[2]) ? $mapperKeyParts[2] : NULL;
         if (($first == 'a' && $second == 'b') || ($first == 'b' && $second == 'a')) {
           $saveMappingFields->name = ucwords(str_replace("_", " ", $mapperKeys[$i][1]));
           $saveMappingFields->relationship_type_id = $id;
index f8957025339dea243b38d4d78dd379ccfe2d9e39..f09c2528f3c30d14ed694c234ffccab3a34bf7a9 100644 (file)
@@ -46,12 +46,12 @@ class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview {
    */
   public function preProcess() {
     //get the data from the session
-    $dataValues       = $this->get('dataValues');
-    $mapper           = $this->get('mapper');
-    $invalidRowCount  = $this->get('invalidRowCount');
+    $dataValues = $this->get('dataValues');
+    $mapper = $this->get('mapper');
+    $invalidRowCount = $this->get('invalidRowCount');
     $conflictRowCount = $this->get('conflictRowCount');
-    $mismatchCount    = $this->get('unMatchCount');
-    $columnNames      = $this->get('columnNames');
+    $mismatchCount = $this->get('unMatchCount');
+    $columnNames = $this->get('columnNames');
 
     //assign column names
     $this->assign('columnNames', $columnNames);
@@ -92,15 +92,25 @@ class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview {
     }
 
     $properties = array(
-      'mapper', 'locations', 'phones', 'ims',
-      'dataValues', 'columnCount',
-      'totalRowCount', 'validRowCount',
-      'invalidRowCount', 'conflictRowCount',
+      'mapper',
+      'locations',
+      'phones',
+      'ims',
+      'dataValues',
+      'columnCount',
+      'totalRowCount',
+      'validRowCount',
+      'invalidRowCount',
+      'conflictRowCount',
       'downloadErrorRecordsUrl',
       'downloadConflictRecordsUrl',
       'downloadMismatchRecordsUrl',
-      'related', 'relatedContactDetails', 'relatedContactLocType',
-      'relatedContactPhoneType', 'relatedContactImProvider', 'websites',
+      'related',
+      'relatedContactDetails',
+      'relatedContactLocType',
+      'relatedContactPhoneType',
+      'relatedContactImProvider',
+      'websites',
       'relatedContactWebsiteType',
     );
 
@@ -137,7 +147,10 @@ class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview {
     $groups = $this->get('groups');
 
     if (!empty($groups)) {
-      $this->addElement('select', 'groups', ts('Add imported records to existing group(s)'), $groups, array('multiple' => "multiple", 'class' => 'crm-select2'));
+      $this->addElement('select', 'groups', ts('Add imported records to existing group(s)'), $groups, array(
+          'multiple' => "multiple",
+          'class' => 'crm-select2'
+        ));
     }
 
     //display new tag
@@ -204,8 +217,9 @@ class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview {
 
     if (!empty($fields['newTagName'])) {
       if (!CRM_Utils_Rule::objectExists(trim($fields['newTagName']),
-          array('CRM_Core_DAO_Tag')
-        )) {
+        array('CRM_Core_DAO_Tag')
+      )
+      ) {
         $errors['newTagName'] = ts('Tag \'%1\' already exists.',
           array(1 => $fields['newTagName'])
         );
@@ -214,9 +228,9 @@ class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview {
     }
 
     if (!empty($fields['newGroupName'])) {
-      $title  = trim($fields['newGroupName']);
-      $name   = CRM_Utils_String::titleToVar($title);
-      $query  = 'select count(*) from civicrm_group where name like %1 OR title like %2';
+      $title = trim($fields['newGroupName']);
+      $name = CRM_Utils_String::titleToVar($title);
+      $query = 'select count(*) from civicrm_group where name like %1 OR title like %2';
       $grpCnt = CRM_Core_DAO::singleValueQuery(
         $query,
         array(
@@ -338,17 +352,17 @@ class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview {
   public function postProcessOld() {
 
     $doGeocodeAddress = $this->controller->exportValue('DataSource', 'doGeocodeAddress');
-    $invalidRowCount  = $this->get('invalidRowCount');
+    $invalidRowCount = $this->get('invalidRowCount');
     $conflictRowCount = $this->get('conflictRowCount');
-    $onDuplicate      = $this->get('onDuplicate');
-    $newGroupName     = $this->controller->exportValue($this->_name, 'newGroupName');
-    $newGroupDesc     = $this->controller->exportValue($this->_name, 'newGroupDesc');
-    $groups           = $this->controller->exportValue($this->_name, 'groups');
-    $allGroups        = $this->get('groups');
-    $newTagName       = $this->controller->exportValue($this->_name, 'newTagName');
-    $newTagDesc       = $this->controller->exportValue($this->_name, 'newTagDesc');
-    $tag              = $this->controller->exportValue($this->_name, 'tag');
-    $allTags          = $this->get('tag');
+    $onDuplicate = $this->get('onDuplicate');
+    $newGroupName = $this->controller->exportValue($this->_name, 'newGroupName');
+    $newGroupDesc = $this->controller->exportValue($this->_name, 'newGroupDesc');
+    $groups = $this->controller->exportValue($this->_name, 'groups');
+    $allGroups = $this->get('groups');
+    $newTagName = $this->controller->exportValue($this->_name, 'newTagName');
+    $newTagDesc = $this->controller->exportValue($this->_name, 'newTagDesc');
+    $tag = $this->controller->exportValue($this->_name, 'tag');
+    $allTags = $this->get('tag');
 
     $mapper = $this->controller->exportValue('MapField', 'mapper');
 
@@ -519,8 +533,8 @@ class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview {
         'description' => $newTagDesc,
         'is_active' => TRUE,
       );
-      $id                 = array();
-      $addedTag           = CRM_Core_BAO_Tag::add($tagParams, $id);
+      $id = array();
+      $addedTag = CRM_Core_BAO_Tag::add($tagParams, $id);
       $tag[$addedTag->id] = 1;
     }
     //add Tag to Import
index 3bf9f8a72ae9e0615c45383a5bad0088a79b8e6c..4522a0e363f31d49af3e98a55f284e7d2bd65d72 100644 (file)
@@ -100,7 +100,21 @@ class CRM_Contact_Import_Form_Summary extends CRM_Import_Form_Summary {
 
     $this->assign('dupeActionString', $dupeActionString);
 
-    $properties = array('totalRowCount', 'validRowCount', 'invalidRowCount', 'conflictRowCount', 'downloadConflictRecordsUrl', 'downloadErrorRecordsUrl', 'duplicateRowCount', 'downloadDuplicateRecordsUrl', 'downloadMismatchRecordsUrl', 'groupAdditions', 'tagAdditions', 'unMatchCount', 'unparsedAddressCount');
+    $properties = array(
+      'totalRowCount',
+      'validRowCount',
+      'invalidRowCount',
+      'conflictRowCount',
+      'downloadConflictRecordsUrl',
+      'downloadErrorRecordsUrl',
+      'duplicateRowCount',
+      'downloadDuplicateRecordsUrl',
+      'downloadMismatchRecordsUrl',
+      'groupAdditions',
+      'tagAdditions',
+      'unMatchCount',
+      'unparsedAddressCount'
+    );
     foreach ($properties as $property) {
       $this->assign($property, $this->get($property));
     }
index 84e2a176dd7977e286ee5508ea55da9f91186ae0..6b3269d7f6505b306febc0abe6f6180d9b502e06 100644 (file)
@@ -168,11 +168,11 @@ class CRM_Contact_Import_ImportJob {
    * @param int $timeout
    */
   public function runImport(&$form, $timeout = 55) {
-    $mapper        = $this->_mapper;
-    $mapperFields  = array();
-    $phoneTypes    = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
-    $imProviders   = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
-    $websiteTypes  = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
+    $mapper = $this->_mapper;
+    $mapperFields = array();
+    $phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
+    $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
+    $websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
     $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
 
     //initialize mapper perperty value.
@@ -226,9 +226,9 @@ class CRM_Contact_Import_ImportJob {
       }
 
       $fldNameParts = explode('_', $fldName, 3);
-      $id           = $fldNameParts[0];
-      $first        = isset($fldNameParts[1]) ? $fldNameParts[1] : NULL;
-      $second       = isset($fldNameParts[2]) ? $fldNameParts[2] : NULL;
+      $id = $fldNameParts[0];
+      $first = isset($fldNameParts[1]) ? $fldNameParts[1] : NULL;
+      $second = isset($fldNameParts[2]) ? $fldNameParts[2] : NULL;
       if (($first == 'a' && $second == 'b') ||
         ($first == 'b' && $second == 'a')
       ) {
@@ -456,9 +456,9 @@ class CRM_Contact_Import_ImportJob {
    * @return array
    */
   public static function getIncompleteImportTables() {
-    $dao      = new CRM_Core_DAO();
+    $dao = new CRM_Core_DAO();
     $database = $dao->database();
-    $query    = "SELECT   TABLE_NAME FROM INFORMATION_SCHEMA
+    $query = "SELECT   TABLE_NAME FROM INFORMATION_SCHEMA
                   WHERE    TABLE_SCHEMA = ? AND
                            TABLE_NAME LIKE 'civicrm_import_job_%'
                   ORDER BY TABLE_NAME";
index 288ba58ccde3dd6b6cad0ce94c8f55ad9ad81221..fddfc8f8bbd211ede749e412253387a14ab04624 100644 (file)
@@ -32,8 +32,6 @@
  * $Id$
  *
  */
-
-
 abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
 
   protected $_tableName;
@@ -347,7 +345,8 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
 
       if ($this->_invalidRowCount) {
         // removed view url for invlaid contacts
-        $headers = array_merge(array(ts('Line Number'),
+        $headers = array_merge(array(
+            ts('Line Number'),
             ts('Reason'),
           ),
           $customHeaders
@@ -356,7 +355,8 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
         self::exportCSV($this->_errorFileName, $headers, $this->_errors);
       }
       if ($this->_conflictCount) {
-        $headers = array_merge(array(ts('Line Number'),
+        $headers = array_merge(array(
+            ts('Line Number'),
             ts('Reason'),
           ),
           $customHeaders
@@ -365,7 +365,8 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
         self::exportCSV($this->_conflictFileName, $headers, $this->_conflicts);
       }
       if ($this->_duplicateCount) {
-        $headers = array_merge(array(ts('Line Number'),
+        $headers = array_merge(array(
+            ts('Line Number'),
             ts('View Contact URL'),
           ),
           $customHeaders
@@ -375,7 +376,8 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
         self::exportCSV($this->_duplicateFileName, $headers, $this->_duplicates);
       }
       if ($this->_unMatchCount) {
-        $headers = array_merge(array(ts('Line Number'),
+        $headers = array_merge(array(
+            ts('Line Number'),
             ts('Reason'),
           ),
           $customHeaders
@@ -385,7 +387,8 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
         self::exportCSV($this->_misMatchFilemName, $headers, $this->_unMatch);
       }
       if ($this->_unparsedAddressCount) {
-        $headers = array_merge(array(ts('Line Number'),
+        $headers = array_merge(array(
+            ts('Line Number'),
             ts('Contact Edit URL'),
           ),
           $customHeaders
@@ -552,9 +555,9 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
 
           $value = array(
             $this->_activeFields[$i]->_name =>
-            $this->_activeFields[$i]->_value,
+              $this->_activeFields[$i]->_value,
             'location_type_id' =>
-            $this->_activeFields[$i]->_hasLocationType,
+              $this->_activeFields[$i]->_hasLocationType,
           );
 
           if (isset($this->_activeFields[$i]->_phoneType)) {
@@ -595,7 +598,8 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
 
           if (isset($this->_activeFields[$i]->_relatedContactLocType) && !empty($this->_activeFields[$i]->_value)) {
             if (!empty($params[$this->_activeFields[$i]->_related][$this->_activeFields[$i]->_relatedContactDetails]) &&
-              !is_array($params[$this->_activeFields[$i]->_related][$this->_activeFields[$i]->_relatedContactDetails])) {
+              !is_array($params[$this->_activeFields[$i]->_related][$this->_activeFields[$i]->_relatedContactDetails])
+            ) {
               $params[$this->_activeFields[$i]->_related][$this->_activeFields[$i]->_relatedContactDetails] = array();
             }
             $value = array(
index e7ddfec6b35c3f86edada88d58462c4dcd982eef..9d1580f5c823c3e6c1de81fd9025366e794bd578 100644 (file)
@@ -135,8 +135,8 @@ class CRM_Contact_Page_AJAX {
     }
 
     $list = array_keys(CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
-        'contact_reference_options'
-      ), '1');
+      'contact_reference_options'
+    ), '1');
 
     $return = array_unique(array_merge(array('sort_name'), $list));
 
@@ -148,7 +148,21 @@ class CRM_Contact_Page_AJAX {
     }
 
     if (!empty($action)) {
-      $excludeGet = array('reset', 'key', 'className', 'fnName', 'json', 'reset', 'context', 'timestamp', 'limit', 'id', 's', 'q', 'action');
+      $excludeGet = array(
+        'reset',
+        'key',
+        'className',
+        'fnName',
+        'json',
+        'reset',
+        'context',
+        'timestamp',
+        'limit',
+        'id',
+        's',
+        'q',
+        'action'
+      );
       foreach ($_GET as $param => $val) {
         if (empty($val) ||
           in_array($param, $excludeGet) ||
@@ -199,8 +213,8 @@ class CRM_Contact_Page_AJAX {
    * Fetch PCP ID by PCP Supporter sort_name, also displays PCP title and associated Contribution Page title
    */
   public static function getPCPList() {
-    $name  = CRM_Utils_Array::value('s', $_GET);
-    $name  = CRM_Utils_Type::escape($name, 'String');
+    $name = CRM_Utils_Array::value('s', $_GET);
+    $name = CRM_Utils_Type::escape($name, 'String');
     $limit = '10';
 
     $where = ' AND pcp.page_id = cp.id AND pcp.contact_id = cc.id';
@@ -320,10 +334,10 @@ class CRM_Contact_Page_AJAX {
    * Fetch the custom field help
    */
   public static function customField() {
-    $fieldId          = CRM_Utils_Type::escape($_REQUEST['id'], 'Integer');
-    $params           = array('id' => $fieldId);
+    $fieldId = CRM_Utils_Type::escape($_REQUEST['id'], 'Integer');
+    $params = array('id' => $fieldId);
     $returnProperties = array('help_pre', 'help_post');
-    $values           = array();
+    $values = array();
 
     CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomField', $params, $values, $returnProperties);
     CRM_Utils_JSON::output($values);
@@ -368,8 +382,8 @@ class CRM_Contact_Page_AJAX {
       $relType = NULL;
       if (isset($_GET['rel'])) {
         $relation = explode('_', $_GET['rel']);
-        $relType  = CRM_Utils_Type::escape($relation[0], 'Integer');
-        $rel      = CRM_Utils_Type::escape($relation[2], 'String');
+        $relType = CRM_Utils_Type::escape($relation[0], 'Integer');
+        $rel = CRM_Utils_Type::escape($relation[2], 'String');
       }
 
       //shared household info
@@ -403,8 +417,8 @@ class CRM_Contact_Page_AJAX {
         $splitName = explode(' :: ', $name);
         if ($splitName) {
           $contactName = trim(CRM_Utils_Array::value('0', $splitName));
-          $street      = trim(CRM_Utils_Array::value('1', $splitName));
-          $city        = trim(CRM_Utils_Array::value('2', $splitName));
+          $street = trim(CRM_Utils_Array::value('1', $splitName));
+          $city = trim(CRM_Utils_Array::value('2', $splitName));
         }
         else {
           $contactName = $name;
@@ -484,7 +498,7 @@ ORDER BY sort_name ";
         while ($dao->fetch()) {
           if ($json) {
             $elements[] = array(
-            'name' => addslashes($dao->sort_name),
+              'name' => addslashes($dao->sort_name),
               'id' => $dao->id,
             );
           }
@@ -540,8 +554,8 @@ ORDER BY sort_name ";
    * Perform enable / disable actions on record.
    */
   public static function enableDisable() {
-    $op        = CRM_Utils_Type::escape($_REQUEST['op'], 'String');
-    $recordID  = CRM_Utils_Type::escape($_REQUEST['recordID'], 'Positive');
+    $op = CRM_Utils_Type::escape($_REQUEST['op'], 'String');
+    $recordID = CRM_Utils_Type::escape($_REQUEST['recordID'], 'Positive');
     $recordBAO = CRM_Utils_Type::escape($_REQUEST['recordBAO'], 'String');
 
     $isActive = NULL;
@@ -626,7 +640,7 @@ ORDER BY sort_name ";
       }
       list($displayName,
         $userEmail
-      ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($contactID);
+        ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($contactID);
       if ($userEmail) {
         echo $userEmail;
       }
@@ -878,8 +892,8 @@ LIMIT {$offset}, {$rowCount}
    */
   public static function getSignature() {
     $emailID = CRM_Utils_Type::escape($_REQUEST['emailID'], 'Positive');
-    $query   = "SELECT signature_text, signature_html FROM civicrm_email WHERE id = {$emailID}";
-    $dao     = CRM_Core_DAO::executeQuery($query);
+    $query = "SELECT signature_text, signature_html FROM civicrm_email WHERE id = {$emailID}";
+    $dao = CRM_Core_DAO::executeQuery($query);
 
     $signatures = array();
     while ($dao->fetch()) {
@@ -897,8 +911,8 @@ LIMIT {$offset}, {$rowCount}
    */
   public static function processDupes() {
     $oper = CRM_Utils_Type::escape($_REQUEST['op'], 'String');
-    $cid  = CRM_Utils_Type::escape($_REQUEST['cid'], 'Positive');
-    $oid  = CRM_Utils_Type::escape($_REQUEST['oid'], 'Positive');
+    $cid = CRM_Utils_Type::escape($_REQUEST['cid'], 'Positive');
+    $oid = CRM_Utils_Type::escape($_REQUEST['oid'], 'Positive');
 
     if (!$oper || !$cid || !$oid) {
       return;
@@ -926,21 +940,21 @@ LIMIT {$offset}, {$rowCount}
 
   public static function getDedupes() {
 
-    $sEcho     = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
-    $offset    = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
-    $rowCount  = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
-    $sort      = 'sort_name';
+    $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
+    $offset = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
+    $rowCount = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
+    $sort = 'sort_name';
     $sortOrder = isset($_REQUEST['sSortDir_0']) ? CRM_Utils_Type::escape($_REQUEST['sSortDir_0'], 'String') : 'asc';
 
-    $gid         = isset($_REQUEST['gid']) ? CRM_Utils_Type::escape($_REQUEST['gid'], 'Integer') : 0;
-    $rgid        = isset($_REQUEST['rgid']) ? CRM_Utils_Type::escape($_REQUEST['rgid'], 'Integer') : 0;
+    $gid = isset($_REQUEST['gid']) ? CRM_Utils_Type::escape($_REQUEST['gid'], 'Integer') : 0;
+    $rgid = isset($_REQUEST['rgid']) ? CRM_Utils_Type::escape($_REQUEST['rgid'], 'Integer') : 0;
     $contactType = '';
     if ($rgid) {
       $contactType = CRM_Core_DAO::getFieldValue('CRM_Dedupe_DAO_RuleGroup', $rgid, 'contact_type');
     }
 
-    $cacheKeyString   = "merge {$contactType}_{$rgid}_{$gid}";
-    $searchRows       = array();
+    $cacheKeyString = "merge {$contactType}_{$rgid}_{$gid}";
+    $searchRows = array();
     $selectorElements = array('src', 'dst', 'weight', 'actions');
 
     $join = "LEFT JOIN civicrm_dedupe_exception de ON ( pn.entity_id1 = de.contact_id1 AND
@@ -997,9 +1011,9 @@ LIMIT {$offset}, {$rowCount}
   }
 
   public static function selectUnselectContacts() {
-    $name         = CRM_Utils_Array::value('name', $_REQUEST);
-    $cacheKey     = CRM_Utils_Array::value('qfKey', $_REQUEST);
-    $state        = CRM_Utils_Array::value('state', $_REQUEST, 'checked');
+    $name = CRM_Utils_Array::value('name', $_REQUEST);
+    $cacheKey = CRM_Utils_Array::value('qfKey', $_REQUEST);
+    $state = CRM_Utils_Array::value('state', $_REQUEST, 'checked');
     $variableType = CRM_Utils_Array::value('variableType', $_REQUEST, 'single');
 
     $actionToPerform = CRM_Utils_Array::value('action', $_REQUEST, 'select');
@@ -1080,10 +1094,10 @@ LIMIT {$offset}, {$rowCount}
       10 => '',
     );
 
-    $sEcho     = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
-    $offset    = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
-    $rowCount  = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
-    $sort      = isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : NULL;
+    $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
+    $offset = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
+    $rowCount = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
+    $sort = isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : NULL;
     $sortOrder = isset($_REQUEST['sSortDir_0']) ? CRM_Utils_Type::escape($_REQUEST['sSortDir_0'], 'String') : 'asc';
 
     $params = $_POST;
index 2466d9f8bb7e05e14867db1df55403b1bf96a0a8..7c695f8652bb8b8d8decccd592d1b0f4e4b62884 100644 (file)
@@ -72,8 +72,8 @@ class CRM_Contact_Page_DashBoard extends CRM_Core_Page {
     }
 
     //check that default FROM email address, owner (domain) organization name and default mailbox are configured.
-    $fromEmailOK      = TRUE;
-    $ownerOrgOK       = TRUE;
+    $fromEmailOK = TRUE;
+    $ownerOrgOK = TRUE;
     $defaultMailboxOK = TRUE;
 
     // Don't put up notices if user doesn't have administer CiviCRM permission
index 64801beaec642a82316dd18d1c55d734f3fd166e..db0e324281429ecc08d638da6a8bb64390581e1a 100644 (file)
@@ -57,14 +57,14 @@ class CRM_Contact_Page_DedupeException extends CRM_Core_Page {
       $contactIds[$exception->contact_id1] = $exception->contact_id1;
       $contactIds[$exception->contact_id2] = $exception->contact_id2;
       $dedupeExceptions[$key] = array(
-      'main' => array('id' => $exception->contact_id1),
+        'main' => array('id' => $exception->contact_id1),
         'other' => array('id' => $exception->contact_id2),
       );
     }
     //get the dupe contacts display names.
     if (!empty($dedupeExceptions)) {
-      $sql          = 'select id, display_name from civicrm_contact where id IN ( ' . implode(', ', $contactIds) . ' )';
-      $contact      = CRM_Core_DAO::executeQuery($sql);
+      $sql = 'select id, display_name from civicrm_contact where id IN ( ' . implode(', ', $contactIds) . ' )';
+      $contact = CRM_Core_DAO::executeQuery($sql);
       $displayNames = array();
       while ($contact->fetch()) {
         $displayNames[$contact->id] = $contact->display_name;
index 2acdf69d2dae312f50b1a47a9de35f548e4e645a..36c93485075bb9cd7985071b55b3ed0baf320c2a 100644 (file)
@@ -63,8 +63,8 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic {
    * @return void
    */
   public function run() {
-    $gid     = CRM_Utils_Request::retrieve('gid', 'Positive', $this, FALSE, 0);
-    $action  = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 0);
+    $gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this, FALSE, 0);
+    $action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 0);
     $context = CRM_Utils_Request::retrieve('context', 'String', $this);
 
     $session = CRM_Core_Session::singleton();
@@ -98,8 +98,8 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic {
 
       $skippedCount = CRM_Utils_Request::retrieve('skipped', 'Positive', $this, FALSE, 0);
       $skippedCount = $skippedCount + count($result['skipped']);
-      $mergedCount  = CRM_Utils_Request::retrieve('merged', 'Positive', $this, FALSE, 0);
-      $mergedCount  = $mergedCount + count($result['merged']);
+      $mergedCount = CRM_Utils_Request::retrieve('merged', 'Positive', $this, FALSE, 0);
+      $mergedCount = $mergedCount + count($result['merged']);
 
       if (empty($result['merged']) && empty($result['skipped'])) {
         $message = '';
@@ -138,8 +138,8 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic {
     if ($action & CRM_Core_Action::UPDATE ||
       $action & CRM_Core_Action::BROWSE
     ) {
-      $cid          = CRM_Utils_Request::retrieve('cid', 'Positive', $this, FALSE, 0);
-      $rgid         = CRM_Utils_Request::retrieve('rgid', 'Positive', $this, FALSE, 0);
+      $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, FALSE, 0);
+      $rgid = CRM_Utils_Request::retrieve('rgid', 'Positive', $this, FALSE, 0);
       $this->action = CRM_Core_Action::UPDATE;
 
       //calculate the $contactType
@@ -211,8 +211,8 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic {
             $cids[$dupe[1]] = 1;
           }
           $cidString = implode(', ', array_keys($cids));
-          $sql       = "SELECT id, display_name FROM civicrm_contact WHERE id IN ($cidString) ORDER BY sort_name";
-          $dao       = new CRM_Core_DAO();
+          $sql = "SELECT id, display_name FROM civicrm_contact WHERE id IN ($cidString) ORDER BY sort_name";
+          $dao = new CRM_Core_DAO();
           $dao->query($sql);
           $displayNames = array();
           while ($dao->fetch()) {
@@ -224,8 +224,8 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic {
           // (also, consider sorting by dupe count first)
           // lobo - change the sort to by threshold value
           // so the more likely dupes are sorted first
-          $session      = CRM_Core_Session::singleton();
-          $userId       = $session->get('userID');
+          $session = CRM_Core_Session::singleton();
+          $userId = $session->get('userID');
           $mainContacts = $permission = array();
 
           foreach ($foundDupes as $dupes) {
@@ -240,14 +240,14 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic {
              * Eliminate this since it introduces 3 queries PER merge row
              * and hence is very expensive
              * CRM-8822
-             if ( !array_key_exists( $srcID, $permission ) ) {
-             $permission[$srcID] = CRM_Contact_BAO_Contact_Permission::allow( $srcID, CRM_Core_Permission::EDIT );
-             }
-             if ( !array_key_exists( $dstID, $permission ) ) {
-             $permission[$dstID] = CRM_Contact_BAO_Contact_Permission::allow( $dstID, CRM_Core_Permission::EDIT );
-             }
-
-             $canMerge = ( $permission[$dstID] && $permission[$srcID] );
+             if ( !array_key_exists( $srcID, $permission ) ) {
+             $permission[$srcID] = CRM_Contact_BAO_Contact_Permission::allow( $srcID, CRM_Core_Permission::EDIT );
+             }
+             if ( !array_key_exists( $dstID, $permission ) ) {
+             $permission[$dstID] = CRM_Contact_BAO_Contact_Permission::allow( $dstID, CRM_Core_Permission::EDIT );
+             }
+             *
+             $canMerge = ( $permission[$dstID] && $permission[$srcID] );
              *
              */
 
@@ -279,13 +279,13 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic {
           $session = CRM_Core_Session::singleton();
           if ($this->_cid) {
             $session->pushUserContext(CRM_Utils_System::url('civicrm/contact/deduperules',
-                "action=update&rgid={$this->_rgid}&gid={$this->_gid}&cid={$this->_cid}"
-              ));
+              "action=update&rgid={$this->_rgid}&gid={$this->_gid}&cid={$this->_cid}"
+            ));
           }
           else {
             $session->pushUserContext(CRM_Utils_System::url('civicrm/contact/dedupefind',
-                "reset=1&action=update&rgid={$this->_rgid}"
-              ));
+              "reset=1&action=update&rgid={$this->_rgid}"
+            ));
           }
         }
       }
index 90735344e20474bf8fe971bb7b192f4cc4d59027..820ccc92700a740b4d4bc5d6b5c90a48d48eae91 100644 (file)
@@ -54,11 +54,11 @@ class CRM_Contact_Page_Inline_CustomData extends CRM_Core_Page {
     $cgcount = CRM_Utils_Request::retrieve('cgcount', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, 1, $_REQUEST);
 
     //custom groups Inline
-    $entityType    = CRM_Contact_BAO_Contact::getContactType($contactId);
+    $entityType = CRM_Contact_BAO_Contact::getContactType($contactId);
     $entitySubType = CRM_Contact_BAO_Contact::getContactSubType($contactId);
-    $groupTree     = &CRM_Core_BAO_CustomGroup::getTree($entityType, $this, $contactId,
+    $groupTree = &CRM_Core_BAO_CustomGroup::getTree($entityType, $this, $contactId,
       $cgId, $entitySubType
-      );
+    );
     $details = CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree);
     //get the fields of single custom group record
     if ($customRecId == 1) {
index 50b5af159fd57938b17e85833fd21236f5e873b0..301d3af81655604d861b2a5ca2f94077c41e20f0 100644 (file)
@@ -52,7 +52,7 @@ class CRM_Contact_Page_Inline_Website extends CRM_Core_Page {
 
     $websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
 
-    $params   = array('contact_id' => $contactId);
+    $params = array('contact_id' => $contactId);
     $websites = CRM_Core_BAO_Website::getValues($params, CRM_Core_DAO::$_nullArray);
     if (!empty($websites)) {
       foreach ($websites as $key => & $value) {
index a513e09df2b524d83527955e47978c8bd58729ea..ca861385a5f549027ea9da1033a5c2c2535e3002 100644 (file)
@@ -96,13 +96,13 @@ class CRM_Contact_Page_SavedSearch extends CRM_Core_Page {
           $row['name'] = $group->title;
           $row['description'] = $group->description;
 
-          $row['id']           = $savedSearch->id;
-          $formValues          = unserialize($savedSearch->form_values);
-          $query               = new CRM_Contact_BAO_Query($formValues);
+          $row['id'] = $savedSearch->id;
+          $formValues = unserialize($savedSearch->form_values);
+          $query = new CRM_Contact_BAO_Query($formValues);
           $row['query_detail'] = $query->qill();
 
-          $action        = array_sum(array_keys(self::links()));
-          $action        = $action & CRM_Core_Action::mask($permissions);
+          $action = array_sum(array_keys(self::links()));
+          $action = $action & CRM_Core_Action::mask($permissions);
           $row['action'] = CRM_Core_Action::formLink(
             self::links(),
             $action,
index c33f3c8ac269144a5e7cc66aad13502ab8c48a35..7c90bf2987af0df20b5260fff89ebe76248245a1 100644 (file)
@@ -182,7 +182,7 @@ class CRM_Contact_Page_View extends CRM_Core_Page {
 
     list($displayName, $contactImage,
       $contactType, $contactSubtype, $contactImageUrl
-    ) = self::getContactDetails($this->_contactId);
+      ) = self::getContactDetails($this->_contactId);
     $this->assign('displayName', $displayName);
 
     $this->set('contactType', $contactType);
@@ -265,7 +265,7 @@ class CRM_Contact_Page_View extends CRM_Core_Page {
       $contactType,
       $contactSubtype,
       $contactImageUrl
-    ) = CRM_Contact_BAO_Contact::getDisplayAndImage($contactId,
+      ) = CRM_Contact_BAO_Contact::getDisplayAndImage($contactId,
       TRUE,
       TRUE
     );
index 511bd859eca376bd6c242173c03ff720484da467..7f0f8b8817f5170ed1e5c7b6c4d3bcdc376dec3a 100644 (file)
@@ -111,9 +111,9 @@ class CRM_Contact_Page_View_CustomData extends CRM_Core_Page {
 
     if ($this->_action == CRM_Core_Action::BROWSE) {
       //Custom Groups Inline
-      $entityType    = CRM_Contact_BAO_Contact::getContactType($this->_contactId);
+      $entityType = CRM_Contact_BAO_Contact::getContactType($this->_contactId);
       $entitySubType = CRM_Contact_BAO_Contact::getContactSubType($this->_contactId);
-      $groupTree     = &CRM_Core_BAO_CustomGroup::getTree($entityType, $this, $this->_contactId,
+      $groupTree = &CRM_Core_BAO_CustomGroup::getTree($entityType, $this, $this->_contactId,
         $this->_groupId, $entitySubType
       );
 
index 3310b10660d671209a8bb118d645de874b2d8cdb..01d5c7cdf15c922fc71a57c3520dc3ea69c94476 100644 (file)
@@ -43,9 +43,9 @@ class CRM_Contact_Page_View_GroupContact extends CRM_Core_Page {
 
     $count = CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId, NULL, NULL, TRUE);
 
-    $in      = CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId, 'Added');
+    $in = CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId, 'Added');
     $pending = CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId, 'Pending');
-    $out     = CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId, 'Removed');
+    $out = CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId, 'Removed');
 
     // keep track of all 'added' contact groups so we can remove them from the smart group
     // section
index 9e857fb8d11c0923fe0e41d968c10a770509bf33..3b8da83952a4356350c88962783289dcc08a6fb9 100644 (file)
@@ -45,8 +45,8 @@ class CRM_Contact_Page_View_Log extends CRM_Core_Page {
 
     if ($loggingReport) {
       $this->assign('instanceUrl',
-                    CRM_Utils_System::url("civicrm/report/instance/{$loggingReport}",
-                                          "reset=1&force=1&snippet=4&section=2&altered_contact_id_op=eq&altered_contact_id_value={$this->_contactId}&cid={$this->_contactId}", FALSE, NULL, FALSE));
+        CRM_Utils_System::url("civicrm/report/instance/{$loggingReport}",
+          "reset=1&force=1&snippet=4&section=2&altered_contact_id_op=eq&altered_contact_id_value={$this->_contactId}&cid={$this->_contactId}", FALSE, NULL, FALSE));
       return;
     }
 
index 83c2ef243b3105cdb92036d4ff8a1f4cbf03adf4..2906018d68a53069a672c61bae0ecc5f869095e4 100644 (file)
@@ -87,9 +87,9 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page {
    * return null
    */
   public function browse() {
-    $note               = new CRM_Core_DAO_Note();
+    $note = new CRM_Core_DAO_Note();
     $note->entity_table = 'civicrm_contact';
-    $note->entity_id    = $this->_contactId;
+    $note->entity_id = $this->_contactId;
 
     $note->orderBy('modified_date desc');
 
@@ -103,7 +103,7 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page {
     $mask = CRM_Core_Action::mask($permissions);
 
     $values = array();
-    $links  = self::links();
+    $links = self::links();
     $action = array_sum(array_keys($links)) & $mask;
 
     $note->find();
@@ -177,8 +177,9 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page {
     $session->pushUserContext($url);
 
     if (CRM_Utils_Request::retrieve('confirmed', 'Boolean',
-        CRM_Core_DAO::$_nullObject
-      )) {
+      CRM_Core_DAO::$_nullObject
+    )
+    ) {
       CRM_Core_BAO_Note::del($this->_id);
       CRM_Utils_System::redirect($url);
     }
index d28510a5433343351777dd9adcb32e9ac2122924..eac69366ddae96af8f3ac6b59c2e04176d851824 100644 (file)
@@ -61,9 +61,9 @@ class CRM_Contact_Page_View_Print extends CRM_Contact_Page_View_Summary {
    * @return void
    */
   public function view() {
-    $params   = array();
+    $params = array();
     $defaults = array();
-    $ids      = array();
+    $ids = array();
 
     $params['id'] = $params['contact_id'] = $this->_contactId;
     $contact = CRM_Contact_BAO_Contact::retrieve($params, $defaults, $ids);
index ed73699a9ae1f413f225ba6d7068927ec7185adb..2fdd80530d9d91443f515f976e731cf5edc2112e 100644 (file)
@@ -165,8 +165,9 @@ class CRM_Contact_Page_View_Relationship extends CRM_Core_Page {
     $session->pushUserContext($url);
 
     if (CRM_Utils_Request::retrieve('confirmed', 'Boolean',
-        CRM_Core_DAO::$_nullObject
-      )) {
+      CRM_Core_DAO::$_nullObject
+    )
+    ) {
       if ($this->_caseId) {
         //create an activity for case role removal.CRM-4480
         CRM_Case_BAO_Case::createCaseRoleActivity($this->_caseId, $this->_id);
index 24eb69dd2a673906a84d412efe2321e923189a92..169a9766e9d58b05793d474c316923377c0f05b9 100644 (file)
@@ -141,9 +141,9 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View {
     $url = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $this->_contactId);
     $session->pushUserContext($url);
 
-    $params   = array();
+    $params = array();
     $defaults = array();
-    $ids      = array();
+    $ids = array();
 
     $params['id'] = $params['contact_id'] = $this->_contactId;
     $params['noRelationships'] = $params['noNotes'] = $params['noGroups'] = TRUE;
@@ -360,14 +360,14 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View {
     foreach ($rest as $k => $v) {
       if ($accessCiviCRM && !empty($this->_viewOptions[$k])) {
         $allTabs[] = $v + array(
-          'id' => $k,
-          'url' => CRM_Utils_System::url(
-            "civicrm/contact/view/$k",
-            "reset=1&cid={$this->_contactId}"
-          ),
-          'weight' => $weight,
-          'count' => CRM_Contact_BAO_Contact::getCountComponent($k, $this->_contactId),
-        );
+            'id' => $k,
+            'url' => CRM_Utils_System::url(
+              "civicrm/contact/view/$k",
+              "reset=1&cid={$this->_contactId}"
+            ),
+            'weight' => $weight,
+            'count' => CRM_Contact_BAO_Contact::getCountComponent($k, $this->_contactId),
+          );
         $weight += 10;
       }
     }
index 3b1db775721d1faca5e75ff8ecb9c3e9e8060ed2..fdc49338e2d1e8014af488ecef22e8bb79c0e41c 100644 (file)
@@ -240,13 +240,13 @@ class CRM_Contact_Page_View_UserDashBoard extends CRM_Core_Page {
       if (CRM_Core_Permission::check('access CiviCRM')) {
         self::$_links = array_merge(self::$_links, array(
           CRM_Core_Action::DISABLE => array(
-              'name' => ts('Disable'),
-              'url' => 'civicrm/contact/view/rel',
-              'qs' => 'action=disable&reset=1&cid=%%cid%%&id=%%id%%&rtype=%%rtype%%&selectedChild=rel&context=dashboard',
-              'extra' => 'onclick = "return confirm(\'' . $disableExtra . '\');"',
-              'title' => ts('Disable Relationship'),
-            ),
-          ));
+            'name' => ts('Disable'),
+            'url' => 'civicrm/contact/view/rel',
+            'qs' => 'action=disable&reset=1&cid=%%cid%%&id=%%id%%&rtype=%%rtype%%&selectedChild=rel&context=dashboard',
+            'extra' => 'onclick = "return confirm(\'' . $disableExtra . '\');"',
+            'title' => ts('Disable Relationship'),
+          ),
+        ));
       }
     }
 
index a697d348cce1e63249d237f07e61317d31a75544..88e2eaa3f703b797df83bc45e53d0c193fa2b970 100644 (file)
@@ -51,9 +51,9 @@ class CRM_Contact_Page_View_Vcard extends CRM_Contact_Page_View {
   public function run() {
     $this->preProcess();
 
-    $params   = array();
+    $params = array();
     $defaults = array();
-    $ids      = array();
+    $ids = array();
 
     $params['id'] = $params['contact_id'] = $this->_contactId;
     $contact = CRM_Contact_BAO_Contact::retrieve($params, $defaults, $ids);
@@ -111,9 +111,9 @@ class CRM_Contact_Page_View_Vcard extends CRM_Contact_Page_View {
         if (!empty($location['supplemental_address_2'])) {
           $extend .= ', ' . $location['supplemental_address_2'];
         }
-        $street   = CRM_Utils_Array::value('street_address', $location);
+        $street = CRM_Utils_Array::value('street_address', $location);
         $locality = CRM_Utils_Array::value('city', $location);
-        $region   = NULL;
+        $region = NULL;
         if (!empty($location['state_province_id'])) {
           $region = $stateProvices[CRM_Utils_Array::value('state_province_id', $location)];
         }
index f2914c6506e8f0d10f22b0dc5d73b6eff2603307..3c37792145937ee9295ded9444c7847c198d40e6 100644 (file)
@@ -63,12 +63,25 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
    * @static
    */
   static $_properties = array(
-    'contact_id', 'contact_type', 'contact_sub_type',
-    'sort_name', 'street_address',
-    'city', 'state_province', 'postal_code', 'country',
-    'geo_code_1', 'geo_code_2', 'is_deceased',
-    'email', 'on_hold', 'phone', 'status',
-    'do_not_email', 'do_not_phone', 'do_not_mail',
+    'contact_id',
+    'contact_type',
+    'contact_sub_type',
+    'sort_name',
+    'street_address',
+    'city',
+    'state_province',
+    'postal_code',
+    'country',
+    'geo_code_1',
+    'geo_code_2',
+    'is_deceased',
+    'email',
+    'on_hold',
+    'phone',
+    'status',
+    'do_not_email',
+    'do_not_phone',
+    'do_not_mail',
   );
 
   /**
@@ -299,9 +312,9 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
    * @param array $params
    */
   public function getPagerParams($action, &$params) {
-    $params['status']    = ts('Contact %%StatusMessage%%');
+    $params['status'] = ts('Contact %%StatusMessage%%');
     $params['csvString'] = NULL;
-    $params['rowCount']  = CRM_Utils_Pager::ROWCOUNT;
+    $params['rowCount'] = CRM_Utils_Pager::ROWCOUNT;
 
     $params['buttonTop'] = 'PagerTopButton';
     $params['buttonBottom'] = 'PagerBottomButton';
@@ -374,7 +387,8 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
       $direction = CRM_Utils_Sort::ASCENDING;
       $empty = TRUE;
       if (!self::$_columnHeaders) {
-        self::$_columnHeaders = array(array('name' => ''),
+        self::$_columnHeaders = array(
+          array('name' => ''),
           array(
             'name' => ts('Name'),
             'sort' => 'sort_name',
@@ -399,7 +413,10 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
               }
 
               if (in_array($fieldName, array(
-                'phone', 'im', 'email'))) {
+                'phone',
+                'im',
+                'email'
+              ))) {
                 if ($type) {
                   $name = "`$locationTypeName-$fieldName-$type`";
                 }
@@ -438,7 +455,8 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
       $headers = self::$_columnHeaders;
     }
     elseif (!empty($this->_returnProperties)) {
-      self::$_columnHeaders = array(array('name' => ''),
+      self::$_columnHeaders = array(
+        array('name' => ''),
         array(
           'name' => ts('Name'),
           'sort' => 'sort_name',
@@ -576,7 +594,10 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
 
             $locationTypeName = str_replace(' ', '_', $locationTypeName);
             if (in_array($fieldName, array(
-              'phone', 'im', 'email'))) {
+              'phone',
+              'im',
+              'email'
+            ))) {
               if ($type) {
                 $names[] = "{$locationTypeName}-{$fieldName}-{$type}";
               }
@@ -651,14 +672,17 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
         elseif (strpos($property, '-im')) {
           $row[$property] = $result->$property;
           if (!empty($result->$property)) {
-            $imProviders    = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
-            $providerId     = $property . "-provider_id";
-            $providerName   = $imProviders[$result->$providerId];
+            $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
+            $providerId = $property . "-provider_id";
+            $providerName = $imProviders[$result->$providerId];
             $row[$property] = $result->$property . " ({$providerName})";
           }
         }
         elseif (in_array($property, array(
-          'addressee', 'email_greeting', 'postal_greeting'))) {
+          'addressee',
+          'email_greeting',
+          'postal_greeting'
+        ))) {
           $greeting = $property . '_display';
           $row[$property] = $result->$greeting;
         }
@@ -675,9 +699,9 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
           $websiteFld = $websiteKey . '-' . array_pop($propertyArray);
           if (!empty($result->$websiteFld)) {
             $websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
-            $websiteType  = $websiteTypes[$result->{"$websiteKey-website_type_id"}];
+            $websiteType = $websiteTypes[$result->{"$websiteKey-website_type_id"}];
             $websiteValue = $result->$websiteFld;
-            $websiteUrl   = "<a href=\"{$websiteValue}\">{$websiteValue}  ({$websiteType})</a>";
+            $websiteUrl = "<a href=\"{$websiteValue}\">{$websiteValue}  ({$websiteType})</a>";
           }
           $row[$property] = $websiteUrl;
         }
@@ -799,7 +823,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
         );
 
         $row['contact_type_orig'] = $result->contact_sub_type ? $result->contact_sub_type : $result->contact_type;
-        $row['contact_sub_type']  = $result->contact_sub_type ? CRM_Contact_BAO_ContactType::contactTypePairs(FALSE, $result->contact_sub_type, ', ') : $result->contact_sub_type;
+        $row['contact_sub_type'] = $result->contact_sub_type ? CRM_Contact_BAO_ContactType::contactTypePairs(FALSE, $result->contact_sub_type, ', ') : $result->contact_sub_type;
         $row['contact_id'] = $result->contact_id;
         $row['sort_name'] = $result->sort_name;
         if (array_key_exists('id', $row)) {
@@ -1077,8 +1101,8 @@ SELECT DISTINCT 'civicrm_contact', contact_a.id, contact_a.id, '$cacheKey', cont
    * Given the current formValues, gets the query in local
    * language
    *
-   * @param array(
-  reference)   $formValues   submitted formValues
+   * @param array (
+   * reference)   $formValues   submitted formValues
    *
    * @return array
    *   which contains an array of strings
index e8dee4b0a8f765c8c85221fa800fa01865daa517..b4ad66c504adfdef4fe758760a7af234569e313e 100644 (file)
@@ -209,9 +209,9 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
    * @param array $params
    */
   public function getPagerParams($action, &$params) {
-    $params['status']    = ts('Contact %%StatusMessage%%');
+    $params['status'] = ts('Contact %%StatusMessage%%');
     $params['csvString'] = NULL;
-    $params['rowCount']  = CRM_Utils_Pager::ROWCOUNT;
+    $params['rowCount'] = CRM_Utils_Pager::ROWCOUNT;
 
     $params['buttonTop'] = 'PagerTopButton';
     $params['buttonBottom'] = 'PagerBottomButton';
@@ -296,15 +296,16 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
     // contact query object used for creating $sql
     $contactQueryObj = NULL;
     if (method_exists($this->_search, 'getQueryObj') &&
-      is_a($this->_search->getQueryObj(), 'CRM_Contact_BAO_Query')) {
+      is_a($this->_search->getQueryObj(), 'CRM_Contact_BAO_Query')
+    ) {
       $contactQueryObj = $this->_search->getQueryObj();
     }
 
     $dao = CRM_Core_DAO::executeQuery($sql, CRM_Core_DAO::$_nullArray);
 
-    $columns     = $this->_search->columns();
+    $columns = $this->_search->columns();
     $columnNames = array_values($columns);
-    $links       = self::links($this->_key);
+    $links = self::links($this->_key);
 
     $permissions = array(CRM_Core_Permission::getPermission());
     if (CRM_Core_Permission::check('delete contacts')) {
@@ -314,8 +315,8 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
 
     $alterRow = FALSE;
     if (method_exists($this->_customSearchClass,
-        'alterRow'
-      )) {
+      'alterRow'
+    )) {
       $alterRow = TRUE;
     }
     $image = FALSE;
@@ -377,8 +378,8 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
    * Given the current formValues, gets the query in local
    * language
    *
-   * @param array(
-  reference)   $formValues   submitted formValues
+   * @param array (
+   * reference)   $formValues   submitted formValues
    *
    * @return array
    *   which contains an array of strings
index 57b00994aca0de3dee383b96a22cb3c2e5a2d88f..6d83725beffb90dd2358c66acb752fcf9c2be34e 100644 (file)
@@ -3160,9 +3160,9 @@ WHERE  contribution_id = %1 ";
 
     if (!in_array($contributionStatuses[$fields['contribution_status_id']], $checkStatus[$contributionStatuses[$values['contribution_status_id']]])) {
       $errors['contribution_status_id'] = ts("Cannot change contribution status from %1 to %2.", array(
-          1 => $contributionStatuses[$values['contribution_status_id']],
-          2 => $contributionStatuses[$fields['contribution_status_id']],
-        ));
+        1 => $contributionStatuses[$values['contribution_status_id']],
+        2 => $contributionStatuses[$fields['contribution_status_id']],
+      ));
     }
   }
 
index fc85bb7b972b3e227ae06ab252e5dcb3af5642ed..1d9b7a55275e9df873c2360a1a136ac36a894e28 100644 (file)
@@ -283,8 +283,8 @@ class CRM_Contribute_BAO_Contribution_Utils {
       if ($component !== 'membership') {
         CRM_Core_Error::displaySessionError($result);
         CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contribute/transact',
-            "_qf_Main_display=true&qfKey={$form->_params['qfKey']}"
-          ));
+          "_qf_Main_display=true&qfKey={$form->_params['qfKey']}"
+        ));
       }
       $membershipResult[1] = $result;
     }
@@ -354,7 +354,7 @@ class CRM_Contribute_BAO_Contribution_Utils {
       $form->_values['contribution_id'] = $contribution->id;
       CRM_Contribute_BAO_ContributionPage::sendMail($contactID,
         $form->_values, $contribution->is_test,
-      FALSE, $fieldTypes
+        FALSE, $fieldTypes
       );
     }
   }
@@ -374,6 +374,7 @@ class CRM_Contribute_BAO_Contribution_Utils {
     return FALSE;
 
   }
+
   /**
    * Get the contribution details by month
    * of the year
@@ -511,9 +512,10 @@ INNER JOIN   civicrm_contact contact ON ( contact.id = contrib.contact_id )
     if (!CRM_Utils_System::isNull($params['email'])) {
       $params['email'] = array(
         1 => array(
-      'email' => $params['email'],
+          'email' => $params['email'],
           'location_type_id' => $billingLocTypeId,
-        ));
+        )
+      );
     }
 
     if (isset($transaction['trxn_id'])) {
@@ -567,7 +569,11 @@ INNER JOIN   civicrm_contact contact ON ( contact.id = contrib.contact_id )
     $type = strtolower($type);
 
     if (!in_array($type, array(
-      'paypal', 'google', 'csv'))) {
+      'paypal',
+      'google',
+      'csv'
+    ))
+    ) {
       // return the params as is
       return $apiParams;
     }
index 389aafd036b0799473a2b742f82a7d882263c6e4..77729652e307020aa71287c84c858347fabef578 100644 (file)
@@ -633,60 +633,60 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio
       ),
     );
     $copy = &CRM_Core_DAO::copyGeneric('CRM_Contribute_DAO_ContributionPage', array(
-        'id' => $id,
-      ), NULL, $fieldsFix);
+      'id' => $id,
+    ), NULL, $fieldsFix);
 
     //copying all the blocks pertaining to the contribution page
     $copyPledgeBlock = &CRM_Core_DAO::copyGeneric('CRM_Pledge_DAO_PledgeBlock', array(
-        'entity_id' => $id,
-        'entity_table' => 'civicrm_contribution_page',
-      ), array(
-        'entity_id' => $copy->id,
-      ));
+      'entity_id' => $id,
+      'entity_table' => 'civicrm_contribution_page',
+    ), array(
+      'entity_id' => $copy->id,
+    ));
 
     $copyMembershipBlock = &CRM_Core_DAO::copyGeneric('CRM_Member_DAO_MembershipBlock', array(
-        'entity_id' => $id,
-        'entity_table' => 'civicrm_contribution_page',
-      ), array(
-        'entity_id' => $copy->id,
-      ));
+      'entity_id' => $id,
+      'entity_table' => 'civicrm_contribution_page',
+    ), array(
+      'entity_id' => $copy->id,
+    ));
 
     $copyUFJoin = &CRM_Core_DAO::copyGeneric('CRM_Core_DAO_UFJoin', array(
-        'entity_id' => $id,
-        'entity_table' => 'civicrm_contribution_page',
-      ), array(
-        'entity_id' => $copy->id,
-      ));
+      'entity_id' => $id,
+      'entity_table' => 'civicrm_contribution_page',
+    ), array(
+      'entity_id' => $copy->id,
+    ));
 
     $copyWidget = &CRM_Core_DAO::copyGeneric('CRM_Contribute_DAO_Widget', array(
-        'contribution_page_id' => $id,
-      ), array(
-        'contribution_page_id' => $copy->id,
-      ));
+      'contribution_page_id' => $id,
+    ), array(
+      'contribution_page_id' => $copy->id,
+    ));
 
     //copy price sets
     CRM_Price_BAO_PriceSet::copyPriceSet('civicrm_contribution_page', $id, $copy->id);
 
     $copyTellFriend = &CRM_Core_DAO::copyGeneric('CRM_Friend_DAO_Friend', array(
-        'entity_id' => $id,
-        'entity_table' => 'civicrm_contribution_page',
-      ), array(
-        'entity_id' => $copy->id,
-      ));
+      'entity_id' => $id,
+      'entity_table' => 'civicrm_contribution_page',
+    ), array(
+      'entity_id' => $copy->id,
+    ));
 
     $copyPersonalCampaignPages = &CRM_Core_DAO::copyGeneric('CRM_PCP_DAO_PCPBlock', array(
-        'entity_id' => $id,
-        'entity_table' => 'civicrm_contribution_page',
-      ), array(
-        'entity_id' => $copy->id,
-      ));
+      'entity_id' => $id,
+      'entity_table' => 'civicrm_contribution_page',
+    ), array(
+      'entity_id' => $copy->id,
+    ));
 
     $copyPremium = &CRM_Core_DAO::copyGeneric('CRM_Contribute_DAO_Premium', array(
-        'entity_id' => $id,
-        'entity_table' => 'civicrm_contribution_page',
-      ), array(
-        'entity_id' => $copy->id,
-      ));
+      'entity_id' => $id,
+      'entity_table' => 'civicrm_contribution_page',
+    ), array(
+      'entity_id' => $copy->id,
+    ));
     $premiumQuery = "
 SELECT id
 FROM civicrm_premiums
@@ -696,7 +696,7 @@ WHERE entity_table = 'civicrm_contribution_page'
     $premiumDao = CRM_Core_DAO::executeQuery($premiumQuery, CRM_Core_DAO::$_nullArray);
     while ($premiumDao->fetch()) {
       if ($premiumDao->id) {
-        $copyPremiumProduct = & CRM_Core_DAO::copyGeneric('CRM_Contribute_DAO_PremiumsProduct', array(
+        $copyPremiumProduct = &CRM_Core_DAO::copyGeneric('CRM_Contribute_DAO_PremiumsProduct', array(
           'premiums_id' => $premiumDao->id,
         ), array(
           'premiums_id' => $copyPremium->id,
@@ -818,8 +818,8 @@ LEFT JOIN  civicrm_premiums            ON ( civicrm_premiums.entity_id = civicrm
    * @see CRM_Core_DAO::buildOptions
    *
    * @param string $fieldName
-   * @param string $context: @see CRM_Core_DAO::buildOptionsContext
-   * @param array $props: whatever is known about this dao object
+   * @param string $context : @see CRM_Core_DAO::buildOptionsContext
+   * @param array $props : whatever is known about this dao object
    *
    * @return array|bool
    */
@@ -831,7 +831,7 @@ LEFT JOIN  civicrm_premiums            ON ( civicrm_premiums.entity_id = civicrm
         // Fixme - this is going to ignore context, better to get conditions, add params, and call PseudoConstant::get
         return CRM_Financial_BAO_FinancialType::getIncomeFinancialType();
 
-      break;
+        break;
     }
     return CRM_Core_PseudoConstant::get(__CLASS__, $fieldName, $params, $context);
   }
@@ -839,8 +839,8 @@ LEFT JOIN  civicrm_premiums            ON ( civicrm_premiums.entity_id = civicrm
   /**
    * Get or Set multilingually affected honor params for processing module_data or setting default values.
    *
-   * @param string $params:
-   * @param bool $setDefault: If yes then returns array to used for setting default value afterward
+   * @param string $params :
+   * @param bool $setDefault : If yes then returns array to used for setting default value afterward
    *
    * @return array|string
    */
@@ -938,7 +938,11 @@ LEFT JOIN  civicrm_premiums            ON ( civicrm_premiums.entity_id = civicrm
    *   isSeparateMembershipPayment
    */
   public static function getIsMembershipPayment($id) {
-    $membershipBlocks = civicrm_api3('membership_block', 'get', array('entity_table' => 'civicrm_contribution_page', 'entity_id' => $id, 'sequential' => TRUE));
+    $membershipBlocks = civicrm_api3('membership_block', 'get', array(
+        'entity_table' => 'civicrm_contribution_page',
+        'entity_id' => $id,
+        'sequential' => TRUE
+      ));
     if (!$membershipBlocks['count']) {
       return FALSE;
     }
index 153fa200dd40e6dc08b5c0555af8a39eaba7dcf8..ccfef2f84e311ad884bc3a39ce0fdaed8d8a3440 100644 (file)
@@ -117,8 +117,8 @@ class CRM_Contribute_BAO_ContributionRecur extends CRM_Contribute_DAO_Contributi
    * static
    */
   public static function checkDuplicate($params, &$duplicates) {
-    $id         = CRM_Utils_Array::value('id', $params);
-    $trxn_id    = CRM_Utils_Array::value('trxn_id', $params);
+    $id = CRM_Utils_Array::value('id', $params);
+    $trxn_id = CRM_Utils_Array::value('trxn_id', $params);
     $invoice_id = CRM_Utils_Array::value('invoice_id', $params);
 
     $clause = array();
@@ -144,8 +144,8 @@ class CRM_Contribute_BAO_ContributionRecur extends CRM_Contribute_DAO_Contributi
       $params[3] = array($id, 'Integer');
     }
 
-    $query  = "SELECT id FROM civicrm_contribution_recur WHERE $clause";
-    $dao    = CRM_Core_DAO::executeQuery($query, $params);
+    $query = "SELECT id FROM civicrm_contribution_recur WHERE $clause";
+    $dao = CRM_Core_DAO::executeQuery($query, $params);
     $result = FALSE;
     while ($dao->fetch()) {
       $duplicates[] = $dao->id;
@@ -219,9 +219,9 @@ SELECT r.payment_processor_id
       return $result;
     }
 
-    $recur     = new CRM_Contribute_DAO_ContributionRecur();
+    $recur = new CRM_Contribute_DAO_ContributionRecur();
     $recur->id = $recurId;
-    $result    = $recur->delete();
+    $result = $recur->delete();
 
     return $result;
   }
@@ -246,9 +246,9 @@ SELECT r.payment_processor_id
     }
 
     $contributionStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name');
-    $canceledId         = array_search('Cancelled', $contributionStatus);
-    $recur              = new CRM_Contribute_DAO_ContributionRecur();
-    $recur->id          = $recurId;
+    $canceledId = array_search('Cancelled', $contributionStatus);
+    $recur = new CRM_Contribute_DAO_ContributionRecur();
+    $recur->id = $recurId;
     $recur->whereAdd("contribution_status_id != $canceledId");
 
     if ($recur->find(TRUE)) {
@@ -266,15 +266,15 @@ SELECT r.payment_processor_id
         if ($dao->auto_renew && $dao->membership_id) {
           // its auto-renewal membership mode
           $membershipTypes = CRM_Member_PseudoConstant::membershipType();
-          $membershipType  = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', $dao->membership_id, 'membership_type_id');
-          $membershipType  = CRM_Utils_Array::value($membershipType, $membershipTypes);
+          $membershipType = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', $dao->membership_id, 'membership_type_id');
+          $membershipType = CRM_Utils_Array::value($membershipType, $membershipTypes);
           $details .= '
 <br/>' . ts('Automatic renewal of %1 membership cancelled.', array(1 => $membershipType));
         }
         else {
           $details .= '
 <br/>' . ts('The recurring contribution of %1, every %2 %3 has been cancelled.', array(
-          1 => $dao->amount,
+              1 => $dao->amount,
               2 => $dao->frequency_interval,
               3 => $dao->frequency_unit,
             ));
index f27bc3cb7ef26e8ce4225156f05af2715ad4d904..e654b3185773cf5bd43cb0b4bd7c72c9c711ab6a 100644 (file)
@@ -114,8 +114,9 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio
     GROUP BY currency';
 
     $params = array(
-    1 => array($contact_id, 'Integer'),
-      2 => array($isTest, 'Integer'));
+      1 => array($contact_id, 'Integer'),
+      2 => array($isTest, 'Integer')
+    );
 
     $cs = CRM_Core_DAO::executeQuery($query, $params);
 
index 4c8e4c9671d173729fdade64f0b611b41c47b0ed..a4448dd253bddd966c939f9784f53b8cfed64578 100644 (file)
@@ -81,7 +81,7 @@ class CRM_Contribute_BAO_Query {
 
     // get financial_type
     if (!empty($query->_returnProperties['financial_type'])) {
-      $query->_select['financial_type']  = "civicrm_financial_type.name as financial_type";
+      $query->_select['financial_type'] = "civicrm_financial_type.name as financial_type";
       $query->_element['financial_type'] = 1;
       $query->_tables['civicrm_contribution'] = 1;
       $query->_tables['civicrm_financial_type'] = 1;
@@ -89,7 +89,7 @@ class CRM_Contribute_BAO_Query {
 
     // get accounting code
     if (!empty($query->_returnProperties['accounting_code'])) {
-      $query->_select['accounting_code']  = "civicrm_financial_account.accounting_code as accounting_code";
+      $query->_select['accounting_code'] = "civicrm_financial_account.accounting_code as accounting_code";
       $query->_element['accounting_code'] = 1;
       $query->_tables['civicrm_accounting_code'] = 1;
       $query->_tables['civicrm_financial_account'] = 1;
@@ -150,7 +150,7 @@ class CRM_Contribute_BAO_Query {
       $query->_element['contribution_soft_credit_name'] = 1;
 
       // also include contact id. Will help build hyperlinks
-      $query->_select['contribution_soft_credit_contact_id']  = "civicrm_contact_d.id as contribution_soft_credit_contact_id";
+      $query->_select['contribution_soft_credit_contact_id'] = "civicrm_contact_d.id as contribution_soft_credit_contact_id";
       $query->_element['contribution_soft_credit_contact_id'] = 1;
 
       $query->_tables['civicrm_contribution'] = 1;
@@ -419,7 +419,7 @@ class CRM_Contribute_BAO_Query {
           $scTypes = $value;
           $names[] = $softCreditTypes[$value];
         }
-        $query->_qill[$grouping][]  = ts('Soft Credit Type %1', array(1 => $op)) . " '" . implode("' " . ts('or') . " '", $names) . "'";
+        $query->_qill[$grouping][] = ts('Soft Credit Type %1', array(1 => $op)) . " '" . implode("' " . ts('or') . " '", $names) . "'";
         $query->_where[$grouping][] =
           CRM_Contact_BAO_Query::buildClause(
             "civicrm_contribution_soft.soft_credit_type_id",
@@ -642,7 +642,7 @@ class CRM_Contribute_BAO_Query {
 
       default:
         //all other elements are handle in this case
-        $fldName    = substr($name, 13);
+        $fldName = substr($name, 13);
         if (!isset($fields[$fldName])) {
           // CRM-12597
           CRM_Core_Session::setStatus(ts(
@@ -653,7 +653,7 @@ class CRM_Contribute_BAO_Query {
           return;
         }
         $whereTable = $fields[$fldName];
-        $value      = trim($value);
+        $value = trim($value);
 
         //contribution fields (decimal fields) which don't require a quote in where clause.
         $moneyFields = array('non_deductible_amount', 'fee_amount', 'net_amount');
@@ -695,15 +695,15 @@ class CRM_Contribute_BAO_Query {
   public static function from($name, $mode, $side) {
     $from = NULL;
     switch ($name) {
-    case 'civicrm_contribution':
-      $from = " $side JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id ";
-      if (in_array(self::$_contribOrSoftCredit, array("only_scredits", "both_related", "both"))) {
-        // switch the from table if its only soft credit search
-        $from  = " $side JOIN contribution_search_scredit_combined ON contribution_search_scredit_combined.contact_id = contact_a.id ";
-        $from .= " $side JOIN civicrm_contribution ON civicrm_contribution.id = contribution_search_scredit_combined.id ";
-        $from .= " $side JOIN civicrm_contribution_soft ON civicrm_contribution_soft.id = contribution_search_scredit_combined.scredit_id";
-      }
-      break;
+      case 'civicrm_contribution':
+        $from = " $side JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id ";
+        if (in_array(self::$_contribOrSoftCredit, array("only_scredits", "both_related", "both"))) {
+          // switch the from table if its only soft credit search
+          $from = " $side JOIN contribution_search_scredit_combined ON contribution_search_scredit_combined.contact_id = contact_a.id ";
+          $from .= " $side JOIN civicrm_contribution ON civicrm_contribution.id = contribution_search_scredit_combined.id ";
+          $from .= " $side JOIN civicrm_contribution_soft ON civicrm_contribution_soft.id = contribution_search_scredit_combined.scredit_id";
+        }
+        break;
 
       case 'civicrm_contribution_recur':
         if ($mode == 1) {
@@ -761,7 +761,7 @@ class CRM_Contribute_BAO_Query {
         break;
 
       case 'contribution_softcredit_type':
-        $from  = " $side JOIN civicrm_option_group option_group_contribution_softcredit_type ON
+        $from = " $side JOIN civicrm_option_group option_group_contribution_softcredit_type ON
           (option_group_contribution_softcredit_type.name = 'soft_credit_type')";
         $from .= " $side JOIN civicrm_option_value contribution_softcredit_type ON
           ( civicrm_contribution_soft.soft_credit_type_id = contribution_softcredit_type.value
@@ -856,10 +856,10 @@ class CRM_Contribute_BAO_Query {
     }
     if (in_array(self::$_contribOrSoftCredit,
       array("only_scredits", "both_related", "both"))) {
-        if (!$tempTableFilled) {
-          // build a temp table which is union of contributions and soft credits
-          // note: group-by in first part ensures uniqueness in counts
-          $tempQuery = "
+      if (!$tempTableFilled) {
+        // build a temp table which is union of contributions and soft credits
+        // note: group-by in first part ensures uniqueness in counts
+        $tempQuery = "
             CREATE TEMPORARY TABLE IF NOT EXISTS contribution_search_scredit_combined AS
                SELECT con.id as id, con.contact_id, cso.id as filter_id, NULL as scredit_id
                  FROM civicrm_contribution con
@@ -868,11 +868,11 @@ class CRM_Contribute_BAO_Query {
             UNION ALL
                SELECT scredit.contribution_id as id, scredit.contact_id, scredit.id as filter_id, scredit.id as scredit_id
                  FROM civicrm_contribution_soft as scredit";
-          CRM_Core_DAO::executeQuery($tempQuery);
-          $tempTableFilled = TRUE;
-        }
-        return TRUE;
+        CRM_Core_DAO::executeQuery($tempQuery);
+        $tempTableFilled = TRUE;
       }
+      return TRUE;
+    }
     return FALSE;
   }
 
@@ -881,11 +881,11 @@ class CRM_Contribute_BAO_Query {
    *
    * @return array
    */
-  public static function softCreditReturnProperties($isExportMode = False) {
+  public static function softCreditReturnProperties($isExportMode = FALSE) {
     $properties = array(
-      'contribution_soft_credit_name'   => 1,
+      'contribution_soft_credit_name' => 1,
       'contribution_soft_credit_amount' => 1,
-      'contribution_soft_credit_type'   => 1,
+      'contribution_soft_credit_type' => 1,
     );
     if ($isExportMode) {
       $properties['contribution_soft_credit_contribution_id'] = 1;
@@ -982,7 +982,8 @@ class CRM_Contribute_BAO_Query {
     $form->add('select', 'contribution_currency_type',
       ts('Currency Type'),
       array(
-        '' => ts('- any -')) +
+        '' => ts('- any -')
+      ) +
       CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', array('labelColumn' => 'name')),
       FALSE, array('class' => 'crm-select2')
     );
@@ -995,7 +996,8 @@ class CRM_Contribute_BAO_Query {
     $form->add('select', 'contribution_page_id',
       ts('Contribution Page'),
       array(
-        '' => ts('- any -')) +
+        '' => ts('- any -')
+      ) +
       CRM_Contribute_PseudoConstant::contributionPage(),
       FALSE, array('class' => 'crm-select2')
     );
@@ -1004,7 +1006,8 @@ class CRM_Contribute_BAO_Query {
     $form->add('select', 'contribution_payment_instrument_id',
       ts('Payment Instrument'),
       array(
-        '' => ts('- any -')) +
+        '' => ts('- any -')
+      ) +
       CRM_Contribute_PseudoConstant::paymentInstrument(),
       FALSE, array('class' => 'crm-select2')
     );
@@ -1012,7 +1015,8 @@ class CRM_Contribute_BAO_Query {
     $form->add('select', 'contribution_pcp_made_through_id',
       ts('Personal Campaign Page'),
       array(
-        '' => ts('- any -')) +
+        '' => ts('- any -')
+      ) +
       CRM_Contribute_PseudoConstant::pcPage(),
       FALSE, array('class' => 'crm-select2')
     );
@@ -1059,17 +1063,17 @@ class CRM_Contribute_BAO_Query {
     $options = array(
       'only_contribs' => ts('Contributions Only'),
       'only_scredits' => ts('Soft Credits Only'),
-      'both_related'  => ts('Soft Credits with related Hard Credit'),
-      'both'          => ts('Both'),
+      'both_related' => ts('Soft Credits with related Hard Credit'),
+      'both' => ts('Both'),
     );
     $form->add('select', 'contribution_or_softcredits', ts('Contributions OR Soft Credits?'), $options, FALSE, array('class' => "crm-select2"));
     $form->addSelect(
       'contribution_soft_credit_type_id',
       array(
-        'entity'      => 'contribution_soft',
-        'field'       => 'soft_credit_type_id',
-        'multiple'    => TRUE,
-        'context'     => 'search',
+        'entity' => 'contribution_soft',
+        'field' => 'soft_credit_type_id',
+        'multiple' => TRUE,
+        'context' => 'search',
       )
     );
 
index e2f2c98e872ca0d64f5f9c153688922f87e869c8..731660dd9dfb702635fbe22c6daa86da9ea5d0e9 100644 (file)
@@ -89,8 +89,8 @@ class CRM_Contribute_BAO_Widget extends CRM_Contribute_DAO_Widget {
     $params = array(1 => array($contributionPageID, 'Integer'));
     $dao = CRM_Core_DAO::executeQuery($query, $params);
     if ($dao->fetch()) {
-      $data['num_donors'] = (int)$dao->count;
-      $data['money_raised'] = (int)$dao->amount;
+      $data['num_donors'] = (int) $dao->count;
+      $data['money_raised'] = (int) $dao->amount;
     }
     else {
       $data['num_donors'] = $data['money_raised'] = $data->money_raised = 0;
@@ -106,7 +106,7 @@ class CRM_Contribute_BAO_Widget extends CRM_Contribute_DAO_Widget {
     $data['campaign_start'] = '';
     $startDate = NULL;
     if ($dao->fetch()) {
-      $data['money_target'] = (int)$dao->goal_amount;
+      $data['money_target'] = (int) $dao->goal_amount;
 
       // conditions that needs to be handled
       // 1. Campaign is not active - no text
@@ -126,8 +126,9 @@ class CRM_Contribute_BAO_Widget extends CRM_Contribute_DAO_Widget {
             $data['is_active'] = FALSE;
             $data['campaign_start'] = ts('Campaign starts on %1', array(
               1 => CRM_Utils_Date::customFormat($dao->start_date,
-                  $config->dateformatFull
-                )));
+                $config->dateformatFull
+              )
+            ));
           }
         }
 
@@ -139,20 +140,23 @@ class CRM_Contribute_BAO_Widget extends CRM_Contribute_DAO_Widget {
             $data['is_active'] = FALSE;
             $data['campaign_start'] = ts('Campaign ended on %1', array(
               1 => CRM_Utils_Date::customFormat($dao->end_date,
-                  $config->dateformatFull
-                )));
+                $config->dateformatFull
+              )
+            ));
           }
           elseif ($startDate >= $now) {
             $data['campaign_start'] = ts('Campaign starts on %1', array(
               1 => CRM_Utils_Date::customFormat($dao->start_date,
-                  $config->dateformatFull
-                )));
+                $config->dateformatFull
+              )
+            ));
           }
           else {
             $data['campaign_start'] = ts('Campaign ends on %1', array(
               1 => CRM_Utils_Date::customFormat($dao->end_date,
-                  $config->dateformatFull
-                )));
+                $config->dateformatFull
+              )
+            ));
           }
         }
       }
@@ -169,15 +173,18 @@ class CRM_Contribute_BAO_Widget extends CRM_Contribute_DAO_Widget {
       $percent = $data['money_raised'] / $data['money_target'];
       $data['money_raised_percentage'] = (round($percent, 2)) * 100 . "%";
       $data['money_target_display'] = CRM_Utils_Money::format($data['money_target']);
-      $data['money_raised'] = ts('Raised %1 of %2', array(1 => CRM_Utils_Money::format($data['money_raised']), 2 => $data['money_target_display']));
+      $data['money_raised'] = ts('Raised %1 of %2', array(
+          1 => CRM_Utils_Money::format($data['money_raised']),
+          2 => $data['money_target_display']
+        ));
     }
     else {
       $data['money_raised'] = ts('Raised %1', array(1 => CRM_Utils_Money::format($data['money_raised'])));
     }
 
-    $data['money_low']  = 0;
+    $data['money_low'] = 0;
     $data['num_donors'] = $data['num_donors'] . " " . ts('Donors');
-    $data['home_url']   = "<a href='{$config->userFrameworkBaseURL}' class='crm-home-url' style='color:" . $widget->color_homepage_link . "'>" . ts('Learn more.') . "</a>";
+    $data['home_url'] = "<a href='{$config->userFrameworkBaseURL}' class='crm-home-url' style='color:" . $widget->color_homepage_link . "'>" . ts('Learn more.') . "</a>";
 
     // if is_active is false, show this link and hide the contribute button
     $data['homepage_link'] = $widget->url_homepage;
index d91601fb00b32ec9290e55959aea8c16e2880767..b90b21013f9d568f73e094e68e01e8b884a0f12a 100644 (file)
@@ -36,4 +36,5 @@
  * $Id$
  *
  */
-class CRM_Contribute_Config extends CRM_Core_Component_Config {}
+class CRM_Contribute_Config extends CRM_Core_Component_Config {
+}
index 788ac732c40be9d56bfa28e5602daeb541ddb90b..742d1b0b374a580e1fac7920fb84204313c08d0c 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * Created by PhpStorm.
  * User: eileen
@@ -7,6 +8,7 @@
  */
 class CRM_Contribute_Exception_InactiveContributionPageException extends Exception {
   private $id;
+
   public function __construct($message, $id) {
     parent::__construct(ts($message));
     $this->id = $id;
index 55dd114c9d4b9ae86206230d77c5c82330bdbc66..f515b9ab05710b2c2efa2d2e92e13c6762936c63 100644 (file)
@@ -329,11 +329,11 @@ LEFT JOIN  civicrm_contribution on (civicrm_contribution.contact_id = civicrm_co
           $endDate = CRM_Utils_Array::value('membership_end_date', $updateResult);
           if ($endDate) {
             $statusMsg .= "<br />" . ts("Membership for %1 has been updated. The membership End Date is %2.",
-              array(
-                1 => $userDisplayName,
-                2 => $endDate,
-              )
-            );
+                array(
+                  1 => $userDisplayName,
+                  2 => $endDate,
+                )
+              );
           }
         }
       }
@@ -418,7 +418,7 @@ LEFT JOIN  civicrm_contribution on (civicrm_contribution.contact_id = civicrm_co
       if (empty($this->_paymentProcessors)) {
         throw new CRM_Core_Exception(ts('You will need to configure the %1 settings for your Payment Processor before you can submit a credit card transactions.', array(1 => $this->_mode)));
       }
-      $this->_processors  = array();
+      $this->_processors = array();
       foreach ($this->_paymentProcessors as $id => $processor) {
         $this->_processors[$id] = ts($processor['name']);
       }
index 5d1c072e30ce51a5d864eabdb238865e7aabd5cb..31ec73c698d450cc332e823c38bcae02677d9fca 100644 (file)
@@ -66,7 +66,7 @@ class CRM_Contribute_Form_AdditionalInfo {
     }
     $form->_options = $sel2;
     $form->assign('mincontribution', $min_amount);
-    $sel = & $form->addElement('hierselect', "product_name", ts('Premium'), 'onclick="showMinContrib();"');
+    $sel = &$form->addElement('hierselect', "product_name", ts('Premium'), 'onclick="showMinContrib();"');
     $js = "<script type='text/javascript'>\n";
     $formName = 'document.forms.' . $form->getName();
 
@@ -101,31 +101,31 @@ class CRM_Contribute_Form_AdditionalInfo {
     $form->addDateTime('thankyou_date', ts('Thank-you Sent'), FALSE, array('formatType' => 'activityDateTime'));
 
     // add various amounts
-    $nonDeductAmount = & $form->add('text', 'non_deductible_amount', ts('Non-deductible Amount'),
-               $attributes['non_deductible_amount']
+    $nonDeductAmount = &$form->add('text', 'non_deductible_amount', ts('Non-deductible Amount'),
+      $attributes['non_deductible_amount']
     );
     $form->addRule('non_deductible_amount', ts('Please enter a valid monetary value for Non-deductible Amount.'), 'money');
 
     if ($form->_online) {
       $nonDeductAmount->freeze();
     }
-    $feeAmount = & $form->add('text', 'fee_amount', ts('Fee Amount'),
-               $attributes['fee_amount']
+    $feeAmount = &$form->add('text', 'fee_amount', ts('Fee Amount'),
+      $attributes['fee_amount']
     );
     $form->addRule('fee_amount', ts('Please enter a valid monetary value for Fee Amount.'), 'money');
     if ($form->_online) {
       $feeAmount->freeze();
     }
 
-    $netAmount = & $form->add('text', 'net_amount', ts('Net Amount'),
-               $attributes['net_amount']
+    $netAmount = &$form->add('text', 'net_amount', ts('Net Amount'),
+      $attributes['net_amount']
     );
     $form->addRule('net_amount', ts('Please enter a valid monetary value for Net Amount.'), 'money');
     if ($form->_online) {
       $netAmount->freeze();
     }
-    $element = & $form->add('text', 'invoice_id', ts('Invoice ID'),
-               $attributes['invoice_id']
+    $element = &$form->add('text', 'invoice_id', ts('Invoice ID'),
+      $attributes['invoice_id']
     );
     if ($form->_online) {
       $element->freeze();
@@ -205,7 +205,7 @@ class CRM_Contribute_Form_AdditionalInfo {
     $dao->contribution_id = $contributionID;
     $dao->product_id = $params['product_name'][0];
     $dao->fulfilled_date = CRM_Utils_Date::processDate($params['fulfilled_date'], NULL, TRUE);
-    $isDeleted = False;
+    $isDeleted = FALSE;
     //CRM-11106
     $premiumParams = array(
       'id' => $params['product_name'][0],
@@ -480,17 +480,17 @@ class CRM_Contribute_Form_AdditionalInfo {
       $form->assign('receive_date', CRM_Utils_Date::processDate($params['receive_date']));
     }
 
-     $template = CRM_Core_Smarty::singleton();
-     $taxAmt = $template->get_template_vars('dataArray');
-     $eventTaxAmt = $template->get_template_vars('totalTaxAmount');
-     $prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
-     $invoicing = CRM_Utils_Array::value('invoicing', $prefixValue);
-     if ((!empty($taxAmt) || isset($eventTaxAmt)) && (isset($invoicing) && isset($prefixValue['is_email_pdf']))) {
-       $isEmailPdf = True;
-     }
-     else {
-       $isEmailPdf = False;
-     }
+    $template = CRM_Core_Smarty::singleton();
+    $taxAmt = $template->get_template_vars('dataArray');
+    $eventTaxAmt = $template->get_template_vars('totalTaxAmount');
+    $prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+    $invoicing = CRM_Utils_Array::value('invoicing', $prefixValue);
+    if ((!empty($taxAmt) || isset($eventTaxAmt)) && (isset($invoicing) && isset($prefixValue['is_email_pdf']))) {
+      $isEmailPdf = TRUE;
+    }
+    else {
+      $isEmailPdf = FALSE;
+    }
 
     list($sendReceipt, $subject, $message, $html) = CRM_Core_BAO_MessageTemplate::sendTemplate(
       array(
index 7aaff931d6d911c22508bd73a98182b6736ccdd2..96aa20b062f476da45305cf235119a9de1f0d70d 100644 (file)
@@ -184,7 +184,7 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract
     if (empty($defaults['trxn_date']) && empty($defaults['trxn_date_time'])) {
       list($defaults['trxn_date'],
         $defaults['trxn_date_time']
-      ) = CRM_Utils_Date::setDateDefaults(
+        ) = CRM_Utils_Date::setDateDefaults(
         CRM_Utils_Array::value('register_date', $defaults), 'activityDateTime'
       );
     }
@@ -401,8 +401,8 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract
 
       $session = CRM_Core_Session::singleton();
       $session->replaceUserContext(CRM_Utils_System::url('civicrm/contact/view',
-          "reset=1&cid={$this->_contactId}&selectedChild=participant"
-        ));
+        "reset=1&cid={$this->_contactId}&selectedChild=participant"
+      ));
     }
   }
 
@@ -430,7 +430,7 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract
     //get the payment processor id as per mode.
     //@todo unclear relevance of mode - seems like a lot of duplicated params here!
     $this->_params['payment_processor'] = $params['payment_processor_id'] =
-    $this->_params['payment_processor_id'] = $submittedValues['payment_processor_id'] = $this->_paymentProcessor['id'];
+      $this->_params['payment_processor_id'] = $submittedValues['payment_processor_id'] = $this->_paymentProcessor['id'];
 
     $now = date('YmdHis');
     $fields = array();
@@ -439,7 +439,7 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract
     if ($this->_context == 'standalone' && !empty($submittedValues['is_email_receipt'])) {
       list($this->userDisplayName,
         $this->userEmail
-      ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contactId);
+        ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contactId);
       $this->assign('displayName', $this->userDisplayName);
     }
 
@@ -621,8 +621,8 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract
 
       CRM_Core_Session::setStatus($statusMsg, ts('Complete'), 'success');
       $session->replaceUserContext(CRM_Utils_System::url('civicrm/contact/view',
-          "reset=1&cid={$this->_contactId}&selectedChild=participant"
-        ));
+        "reset=1&cid={$this->_contactId}&selectedChild=participant"
+      ));
     }
   }
 
index c627af535ab1ab656ed17258f0948bafd753faaa..99553db3cbf26047cd6ac1499ca4cfcfc29c935b 100644 (file)
@@ -58,7 +58,7 @@ class CRM_Contribute_Form_CancelSubscription extends CRM_Core_Form {
    * @return void
    */
   public function preProcess() {
-    $this->_mid  = CRM_Utils_Request::retrieve('mid',  'Integer', $this, FALSE);
+    $this->_mid = CRM_Utils_Request::retrieve('mid', 'Integer', $this, FALSE);
 
     $this->_crid = CRM_Utils_Request::retrieve('crid', 'Integer', $this, FALSE);
     if ($this->_crid) {
@@ -139,7 +139,7 @@ class CRM_Contribute_Form_CancelSubscription extends CRM_Core_Form {
     // Determine if we can cancel recurring contribution via API with this processor
     $cancelSupported = $this->_paymentProcessorObj->isSupported('cancelSubscription');
     if ($cancelSupported) {
-      $searchRange   = array();
+      $searchRange = array();
       $searchRange[] = $this->createElement('radio', NULL, NULL, ts('Yes'), '1');
       $searchRange[] = $this->createElement('radio', NULL, NULL, ts('No'), '0');
 
@@ -203,9 +203,9 @@ class CRM_Contribute_Form_CancelSubscription extends CRM_Core_Form {
    * @return void
    */
   public function postProcess() {
-    $status             = $message = NULL;
+    $status = $message = NULL;
     $cancelSubscription = TRUE;
-    $params             = $this->controller->exportValues($this->_name);
+    $params = $this->controller->exportValues($this->_name);
 
     if ($this->_selfService) {
       // for self service force sending-request & notify
@@ -292,16 +292,16 @@ class CRM_Contribute_Form_CancelSubscription extends CRM_Core_Form {
           // send notification
           $sendTemplateParams =
             array(
-                  'groupName' => $this->_mode == 'auto_renew' ? 'msg_tpl_workflow_membership' : 'msg_tpl_workflow_contribution',
-                  'valueName' => $this->_mode == 'auto_renew' ? 'membership_autorenew_cancelled' : 'contribution_recurring_cancelled',
-                  'contactId' => $this->_subscriptionDetails->contact_id,
-                  'tplParams' => $tplParams,
-                  //'isTest'    => $isTest, set this from _objects
-                  'PDFFilename' => 'receipt.pdf',
-                  'from' => $receiptFrom,
-                  'toName' => $this->_donorDisplayName,
-                  'toEmail' => $this->_donorEmail,
-                  );
+              'groupName' => $this->_mode == 'auto_renew' ? 'msg_tpl_workflow_membership' : 'msg_tpl_workflow_contribution',
+              'valueName' => $this->_mode == 'auto_renew' ? 'membership_autorenew_cancelled' : 'contribution_recurring_cancelled',
+              'contactId' => $this->_subscriptionDetails->contact_id,
+              'tplParams' => $tplParams,
+              //'isTest'    => $isTest, set this from _objects
+              'PDFFilename' => 'receipt.pdf',
+              'from' => $receiptFrom,
+              'toName' => $this->_donorDisplayName,
+              'toEmail' => $this->_donorEmail,
+            );
           list($sent) = CRM_Core_BAO_MessageTemplate::sendTemplate($sendTemplateParams);
         }
       }
@@ -323,7 +323,7 @@ class CRM_Contribute_Form_CancelSubscription extends CRM_Core_Form {
     }
 
     $session = CRM_Core_Session::singleton();
-    $userID  = $session->get('userID');
+    $userID = $session->get('userID');
     if ($userID && $status) {
       $session->setStatus($status, $msgTitle, $msgType);
     }
@@ -332,7 +332,7 @@ class CRM_Contribute_Form_CancelSubscription extends CRM_Core_Form {
         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=cancel&result=1"));
+        "reset=1&task=cancel&result=1"));
     }
   }
 }
index 08d07b3ebc60170e372fdf660b0e8661a8b507cd..7f762ea420a1dd6a6e6e40fc0e1aa2289db671f0 100644 (file)
@@ -189,7 +189,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
    *
    * @var array
    */
-   public $_paymentFields = array();
+  public $_paymentFields = array();
   /**
    * Logged in user's email
    * @var string
@@ -222,6 +222,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
    * @var string
    */
   public $userDisplayName;
+
   /**
    * Set variables up before form is built
    *
@@ -497,7 +498,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
 
     // build price set form.
     $buildPriceSet = FALSE;
-    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,'contribution_invoice_settings');
+    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
     $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
     $this->assign('invoicing', $invoicing);
 
@@ -660,7 +661,10 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
     $this->assign('entityID', $this->_id);
 
     if ($this->_context == 'standalone') {
-      $this->addEntityRef('contact_id', ts('Contact'), array('create' => TRUE, 'api' => array('extra' => array('email'))), TRUE);
+      $this->addEntityRef('contact_id', ts('Contact'), array(
+          'create' => TRUE,
+          'api' => array('extra' => array('email'))
+        ), TRUE);
     }
 
     $attributes = CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Contribution');
@@ -972,7 +976,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
     }
 
     //FIXME FOR NEW DATA FLOW http://wiki.civicrm.org/confluence/display/CRM/CiviAccounts+4.3+Data+Flow
-     if (!empty($fields['fee_amount']) && $financialType = CRM_Contribute_BAO_Contribution::validateFinancialType($fields['financial_type_id'])) {
+    if (!empty($fields['fee_amount']) && $financialType = CRM_Contribute_BAO_Contribution::validateFinancialType($fields['financial_type_id'])) {
       $errors['financial_type_id'] = ts("Financial Account of account relationship of 'Expense Account is' is not configured for Financial Type : ") . $financialType;
     }
 
@@ -981,7 +985,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
       $queryParams = array(1 => array($fields['trxn_id'], 'String'));
       $query = 'select count(*) from civicrm_contribution where trxn_id = %1';
       if ($self->_id) {
-        $queryParams[2] = array((int)$self->_id, 'Integer');
+        $queryParams[2] = array((int) $self->_id, 'Integer');
         $query .= ' and id !=%2';
       }
       $tCnt = CRM_Core_DAO::singleValueQuery($query, $queryParams);
@@ -1350,7 +1354,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
       // assign tax calculation for contribution receipts
       $taxRate = array();
       $getTaxDetails = FALSE;
-      $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,'contribution_invoice_settings');
+      $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
       $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
       if ($invoicing) {
         if ($this->_action & CRM_Core_Action::ADD) {
@@ -1449,7 +1453,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
           $updatePledgePaymentStatus = TRUE;
         }
         elseif ($this->_action & CRM_Core_Action::UPDATE && (($this->_defaults['contribution_status_id'] != $formValues['contribution_status_id']) ||
-          ($this->_defaults['total_amount'] != $formValues['total_amount']))
+            ($this->_defaults['total_amount'] != $formValues['total_amount']))
         ) {
           $updatePledgePaymentStatus = TRUE;
         }
index 61a5d49dffed0f03a9b09f3277de8b7687e4855b..b15df4ed90390aca4b4da218ed82ef3ed0587c42 100644 (file)
@@ -81,7 +81,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
 
     // make sure we have right permission to edit this user
     $csContactID = $this->getContactID();
-    $reset       = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
+    $reset = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
     $mainDisplay = CRM_Utils_Request::retrieve('_qf_Main_display', 'Boolean', CRM_Core_DAO::$_nullObject);
 
     if ($reset) {
@@ -155,7 +155,10 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
       if ($onBehalfProfileID) {
         $onBehalfProfile = CRM_Core_BAO_UFGroup::profileGroups($onBehalfProfileID);
         foreach (array(
-            'Individual', 'Organization', 'Household') as $contactType) {
+                   'Individual',
+                   'Organization',
+                   'Household'
+                 ) as $contactType) {
           if (in_array($contactType, $onBehalfProfile) &&
             (in_array('Membership', $onBehalfProfile) ||
               in_array('Contribution', $onBehalfProfile)
@@ -169,7 +172,10 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
       if ($postID = CRM_Utils_Array::value('custom_post_id', $this->_values)) {
         $postProfile = CRM_Core_BAO_UFGroup::profileGroups($postID);
         foreach (array(
-            'Individual', 'Organization', 'Household') as $contactType) {
+                   'Individual',
+                   'Organization',
+                   'Household'
+                 ) as $contactType) {
           if (in_array($contactType, $postProfile) &&
             (in_array('Membership', $postProfile) ||
               in_array('Contribution', $postProfile)
@@ -485,7 +491,8 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
       $this->set('priceSetId', $this->_priceSetId);
       CRM_Price_BAO_PriceSet::buildPriceSet($this);
       if ($this->_values['is_monetary'] &&
-        $this->_values['is_recur'] && empty($this->_values['pledge_id'])) {
+        $this->_values['is_recur'] && empty($this->_values['pledge_id'])
+      ) {
         self::buildRecur($this);
       }
     }
@@ -574,9 +581,9 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
           array('onclick' => "showHideByValue('pcp_display_in_roll','','nameID|nickID|personalNoteID','block','radio',false); pcpAnonymous( );")
         );
         $extraOption = array('onclick' => "return pcpAnonymous( );");
-        $elements    = array();
-        $elements[]  = &$this->createElement('radio', NULL, '', ts('Include my name and message'), 0, $extraOption);
-        $elements[]  = &$this->createElement('radio', NULL, '', ts('List my contribution anonymously'), 1, $extraOption);
+        $elements = array();
+        $elements[] = &$this->createElement('radio', NULL, '', ts('Include my name and message'), 0, $extraOption);
+        $elements[] = &$this->createElement('radio', NULL, '', ts('List my contribution anonymously'), 1, $extraOption);
         $this->addGroup($elements, 'pcp_is_anonymous', NULL, '&nbsp;&nbsp;&nbsp;');
         $this->setDefaults(array('pcp_display_in_roll' => 1));
         $this->setDefaults(array('pcp_is_anonymous' => 1));
@@ -768,27 +775,29 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
         }
         if ($priceField->name == 'other_amount') {
           if ($self->_quickConfig && empty($fields["price_{$priceField->id}"]) &&
-            array_key_exists("price_{$previousId}", $fields) && isset($fields["price_{$previousId}"]) && $self->_values['fee'][$previousId]['name'] == 'contribution_amount' && empty($fields["price_{$previousId}"])) {
+            array_key_exists("price_{$previousId}", $fields) && isset($fields["price_{$previousId}"]) && $self->_values['fee'][$previousId]['name'] == 'contribution_amount' && empty($fields["price_{$previousId}"])
+          ) {
             $otherAmount = $priceField->id;
           }
           elseif (!empty($fields["price_{$priceField->id}"])) {
             $otherAmountVal = CRM_Utils_Rule::cleanMoney($fields["price_{$priceField->id}"]);
-            $min            = CRM_Utils_Array::value('min_amount', $self->_values);
-            $max            = CRM_Utils_Array::value('max_amount', $self->_values);
+            $min = CRM_Utils_Array::value('min_amount', $self->_values);
+            $max = CRM_Utils_Array::value('max_amount', $self->_values);
             if ($min && $otherAmountVal < $min) {
               $errors["price_{$priceField->id}"] = ts('Contribution amount must be at least %1',
-                                                   array(1 => $min)
+                array(1 => $min)
               );
             }
             if ($max && $otherAmountVal > $max) {
               $errors["price_{$priceField->id}"] = ts('Contribution amount cannot be more than %1.',
-                                                   array(1 => $max)
+                array(1 => $max)
               );
             }
           }
         }
         if (!empty($fields["price_{$priceField->id}"]) || ($previousId == $priceField->id && isset($fields["price_{$previousId}"])
-            && empty($fields["price_{$previousId}"]))) {
+            && empty($fields["price_{$previousId}"]))
+        ) {
           $check[] = $priceField->id;
         }
       }
@@ -816,14 +825,16 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
           if ($fieldValue['html_type'] != 'Text' && CRM_Utils_Array::value('price_' . $fieldKey, $fields)) {
             if (!is_array($fields['price_' . $fieldKey])) {
               if (array_key_exists('membership_type_id', $fieldValue['options'][$fields['price_' . $fieldKey]])
-                && in_array($fieldValue['options'][$fields['price_' . $fieldKey]]['membership_type_id'], $currentMemberships)) {
+                && in_array($fieldValue['options'][$fields['price_' . $fieldKey]]['membership_type_id'], $currentMemberships)
+              ) {
                 $errors['price_' . $fieldKey] = ts($errorText, array(1 => CRM_Member_PseudoConstant::membershipType($fieldValue['options'][$fields['price_' . $fieldKey]]['membership_type_id'])));
               }
             }
             else {
               foreach ($fields['price_' . $fieldKey] as $key => $ignore) {
                 if (array_key_exists('membership_type_id', $fieldValue['options'][$key])
-                  && in_array($fieldValue['options'][$key]['membership_type_id'], $currentMemberships)) {
+                  && in_array($fieldValue['options'][$key]['membership_type_id'], $currentMemberships)
+                ) {
                   $errors['price_' . $fieldKey] = ts($errorText, array(1 => CRM_Member_PseudoConstant::membershipType($fieldValue['options'][$key]['membership_type_id'])));
                 }
               }
@@ -834,7 +845,8 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
 
       // CRM-12233
       if ($membershipIsActive && !$self->_membershipBlock['is_required']
-        && $self->_values['amount_block_is_active']) {
+        && $self->_values['amount_block_is_active']
+      ) {
         $membershipFieldId = $contributionFieldId = $errorKey = $otherFieldId = NULL;
         foreach ($self->_values['fee'] as $fieldKey => $fieldValue) {
           // if 'No thank you' membership is selected then set $membershipFieldId
@@ -944,7 +956,8 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
     }
 
     if (isset($fields['selectProduct']) &&
-      $fields['selectProduct'] != 'no_thanks') {
+      $fields['selectProduct'] != 'no_thanks'
+    ) {
       $productDAO = new CRM_Contribute_DAO_Product();
       $productDAO->id = $fields['selectProduct'];
       $productDAO->find(TRUE);
@@ -966,7 +979,8 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
     }
 
     if (!empty($fields['is_recur']) &&
-      CRM_Utils_Array::value('payment_processor', $fields) == 0) {
+      CRM_Utils_Array::value('payment_processor', $fields) == 0
+    ) {
       $errors['_qf_default'] = ts('You cannot set up a recurring contribution if you are not paying online by credit card.');
     }
 
@@ -1074,7 +1088,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
         $customizedValue = CRM_Core_OptionGroup::getValue($greeting, 'Customized', 'name');
         if ($customizedValue == $greetingType && empty($fielse[$greeting . '_custom'])) {
           $errors[$greeting . '_custom'] = ts('Custom %1 is a required field if %1 is of type Customized.',
-                                           array(1 => ucwords(str_replace('_', " ", $greeting)))
+            array(1 => ucwords(str_replace('_', " ", $greeting)))
           );
         }
       }
@@ -1186,7 +1200,8 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
     if (($this->_values['is_pay_later'] &&
         empty($this->_paymentProcessor) &&
         !array_key_exists('hidden_processor', $params)) ||
-      (!empty($params['payment_processor']) && $params['payment_processor'] == 0)) {
+      (!empty($params['payment_processor']) && $params['payment_processor'] == 0)
+    ) {
       $params['is_pay_later'] = 1;
     }
     else {
@@ -1228,10 +1243,10 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
       if ($is_quick_config) {
         foreach ($this->_priceSet['fields'] as $fieldKey => $fieldVal) {
           if ($fieldVal['name'] == 'membership_amount' && !empty($params['price_' . $fieldKey])) {
-            $fieldId     = $fieldVal['id'];
+            $fieldId = $fieldVal['id'];
             $fieldOption = $params['price_' . $fieldId];
             $proceFieldAmount += $fieldVal['options'][$this->_submitValues['price_' . $fieldId]]['amount'];
-            $memPresent  = TRUE;
+            $memPresent = TRUE;
           }
           else {
             if (!empty($params['price_' . $fieldKey]) && $memPresent && ($fieldVal['name'] == 'other_amount' || $fieldVal['name'] == 'contribution_amount')) {
@@ -1259,11 +1274,11 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
       $is_quick_config = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config');
       if ($is_quick_config) {
         foreach ($this->_values['fee'] as $key => & $val) {
-          if ($val['name'] == 'other_amount' && $val['html_type'] == 'Text' && array_key_exists('price_'.$key, $params) ) {
+          if ($val['name'] == 'other_amount' && $val['html_type'] == 'Text' && array_key_exists('price_' . $key, $params)) {
             $params['price_' . $key] = CRM_Utils_Rule::cleanMoney($params['price_' . $key]); //Clean out any currency symbols
-            if ($params['price_'.$key] != 0) {
+            if ($params['price_' . $key] != 0) {
               foreach ($val['options'] as $optionKey => & $options) {
-                $options['amount'] = CRM_Utils_Array::value('price_'.$key, $params);
+                $options['amount'] = CRM_Utils_Array::value('price_' . $key, $params);
                 break;
               }
             }
@@ -1322,10 +1337,11 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
         $buttonName = $this->controller->getButtonName();
         if (in_array($buttonName,
             array($this->_expressButtonName, $this->_expressButtonName . '_x', $this->_expressButtonName . '_y')
-          ) && empty($params['is_pay_later'])) {
+          ) && empty($params['is_pay_later'])
+        ) {
           $this->set('contributeMode', 'express');
 
-          $donateURL           = CRM_Utils_System::url('civicrm/contribute', '_qf_Contribute_display=1');
+          $donateURL = CRM_Utils_System::url('civicrm/contribute', '_qf_Contribute_display=1');
           $params['cancelURL'] = CRM_Utils_System::url('civicrm/contribute/transact', "_qf_Main_display=1&qfKey={$params['qfKey']}", TRUE, NULL, FALSE);
           $params['returnURL'] = CRM_Utils_System::url('civicrm/contribute/transact', "_qf_Confirm_display=1&rfp=1&qfKey={$params['qfKey']}", TRUE, NULL, FALSE);
           $params['invoiceID'] = $invoiceID;
index 3670d508d85417043ed1777b73772be06a5b2306..1a1f11059c46d5b7ca75f9ac853805315014d4b3 100644 (file)
@@ -154,9 +154,9 @@ class CRM_Contribute_Form_Contribution_OnBehalfOf {
       NULL, FALSE, NULL, FALSE, NULL,
       CRM_Core_Permission::CREATE, NULL
     );
-    $fieldTypes     = array('Contact', 'Organization');
+    $fieldTypes = array('Contact', 'Organization');
     $contactSubType = CRM_Contact_BAO_ContactType::subTypes('Organization');
-    $fieldTypes     = array_merge($fieldTypes, $contactSubType);
+    $fieldTypes = array_merge($fieldTypes, $contactSubType);
 
     if (is_array($form->_membershipBlock) && !empty($form->_membershipBlock)) {
       $fieldTypes = array_merge($fieldTypes, array('Membership'));
index 931324b4f76ff73014b362acdb5b77d68901b699..b1dafd2d17e35dabbad2b5f7bd7601ed97d185de 100644 (file)
@@ -51,9 +51,9 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont
   public function preProcess() {
     parent::preProcess();
 
-    $this->_params   = $this->get('params');
+    $this->_params = $this->get('params');
     $this->_lineItem = $this->get('lineItem');
-    $is_deductible   = $this->get('is_deductible');
+    $is_deductible = $this->get('is_deductible');
     $this->assign('is_deductible', $is_deductible);
     $this->assign('thankyou_title', CRM_Utils_Array::value('thankyou_title', $this->_values));
     $this->assign('thankyou_text', CRM_Utils_Array::value('thankyou_text', $this->_values));
@@ -94,8 +94,8 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont
    */
   public function buildQuickForm() {
     $this->assignToTemplate();
-    $productID        = $this->get('productID');
-    $option           = $this->get('option');
+    $productID = $this->get('productID');
+    $option = $this->get('option');
     $membershipTypeID = $this->get('membershipTypeID');
     $this->assign('receiptFromEmail', CRM_Utils_Array::value('receipt_from_email', $this->_values));
 
@@ -143,7 +143,7 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont
       CRM_Contribute_BAO_ContributionSoft::formatHonoreeProfileFields($this, $params['honor'], $params['honoree_profile_id']);
 
       $fieldTypes = array('Contact');
-      $fieldTypes[]  = CRM_Core_BAO_UFGroup::getContactType($params['honoree_profile_id']);
+      $fieldTypes[] = CRM_Core_BAO_UFGroup::getContactType($params['honoree_profile_id']);
       $this->buildCustom($params['honoree_profile_id'], 'honoreeProfileFields', TRUE, 'honor', $fieldTypes);
     }
 
@@ -153,7 +153,11 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont
       $qParams .= "&amp;pcpId={$this->_pcpId}";
       $this->assign('pcpBlock', TRUE);
       foreach (array(
-        'pcp_display_in_roll', 'pcp_is_anonymous', 'pcp_roll_nickname', 'pcp_personal_note') as $val) {
+                 'pcp_display_in_roll',
+                 'pcp_is_anonymous',
+                 'pcp_roll_nickname',
+                 'pcp_personal_note'
+               ) as $val) {
         if (!empty($this->_params[$val])) {
           $this->assign($val, $this->_params[$val]);
         }
@@ -163,9 +167,9 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont
     $this->assign('qParams', $qParams);
 
     if ($membershipTypeID) {
-      $transactionID    = $this->get('membership_trx_id');
+      $transactionID = $this->get('membership_trx_id');
       $membershipAmount = $this->get('membership_amount');
-      $renewalMode      = $this->get('renewal_mode');
+      $renewalMode = $this->get('renewal_mode');
       $this->assign('membership_trx_id', $transactionID);
       $this->assign('membership_amount', $membershipAmount);
       $this->assign('renewal_mode', $renewalMode);
@@ -194,9 +198,9 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont
       $OnBehalfProfile = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
       $profileId = $OnBehalfProfile[0];
 
-      $fieldTypes     = array('Contact', 'Organization');
+      $fieldTypes = array('Contact', 'Organization');
       $contactSubType = CRM_Contact_BAO_ContactType::subTypes('Organization');
-      $fieldTypes     = array_merge($fieldTypes, $contactSubType);
+      $fieldTypes = array_merge($fieldTypes, $contactSubType);
       if (is_array($this->_membershipBlock) && !empty($this->_membershipBlock)) {
         $fieldTypes = array_merge($fieldTypes, array('Membership'));
       }
@@ -235,7 +239,12 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont
             $defaults[$timeField] = $contact[$timeField];
           }
         }
-        elseif (in_array($name, array('addressee', 'email_greeting', 'postal_greeting')) && !empty($contact[$name . '_custom'])) {
+        elseif (in_array($name, array(
+              'addressee',
+              'email_greeting',
+              'postal_greeting'
+            )) && !empty($contact[$name . '_custom'])
+        ) {
           $defaults[$name . '_custom'] = $contact[$name . '_custom'];
         }
       }
index 26cba8ce6a55cb9521f87a0afb7e44ce388eb2b5..152e371f6dee00572ea7dc2fcc2308e4cdab3bdb 100644 (file)
@@ -177,10 +177,10 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
   public $_action;
 
   /**
-  * Is honor block is enabled for this contribution?
-  *
-  * @var boolean
-  */
+   * Is honor block is enabled for this contribution?
+   *
+   * @var boolean
+   */
   public $_honor_block_is_active = FALSE;
 
   /**
@@ -196,6 +196,7 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
   public $_useForMember;
 
   public $_isBillingAddressRequiredForPayLater;
+
   /**
    * Set variables up before form is built
    *
@@ -433,10 +434,10 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
     // Handle PCP
     $pcpId = CRM_Utils_Request::retrieve('pcpId', 'Positive', $this);
     if ($pcpId) {
-      $pcp             = CRM_PCP_BAO_PCP::handlePcp($pcpId, 'contribute', $this->_values);
-      $this->_pcpId    = $pcp['pcpId'];
+      $pcp = CRM_PCP_BAO_PCP::handlePcp($pcpId, 'contribute', $this->_values);
+      $this->_pcpId = $pcp['pcpId'];
       $this->_pcpBlock = $pcp['pcpBlock'];
-      $this->_pcpInfo  = $pcp['pcpInfo'];
+      $this->_pcpInfo = $pcp['pcpInfo'];
     }
 
     // Link (button) for users to create their own Personal Campaign page
@@ -545,17 +546,22 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
 
     $this->assign('paymentProcessor', $this->_paymentProcessor);
     $vars = array(
-      'amount', 'currencyID',
-      'credit_card_type', 'trxn_id', 'amount_level',
+      'amount',
+      'currencyID',
+      'credit_card_type',
+      'trxn_id',
+      'amount_level',
     );
 
     $config = CRM_Core_Config::singleton();
     if (isset($this->_values['is_recur']) && !empty($this->_paymentProcessor['is_recur'])) {
       $this->assign('is_recur_enabled', 1);
       $vars = array_merge($vars, array(
-        'is_recur', 'frequency_interval', 'frequency_unit',
-          'installments',
-        ));
+        'is_recur',
+        'frequency_interval',
+        'frequency_unit',
+        'installments',
+      ));
     }
 
     if (in_array('CiviPledge', $config->enableComponents) &&
@@ -565,10 +571,10 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
 
       $vars = array_merge($vars, array(
         'is_pledge',
-          'pledge_frequency_interval',
-          'pledge_frequency_unit',
-          'pledge_installments',
-        ));
+        'pledge_frequency_interval',
+        'pledge_frequency_unit',
+        'pledge_installments',
+      ));
     }
 
     if (isset($this->_params['amount_other']) || isset($this->_params['selectMembership'])) {
@@ -639,7 +645,7 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
         $date = CRM_Utils_Date::mysqlToIso($date);
         $this->assign('credit_card_exp_date', $date);
         $this->assign('credit_card_number',
-                      CRM_Utils_System::mungeCreditCard(CRM_Utils_array::value('credit_card_number', $this->_params))
+          CRM_Utils_System::mungeCreditCard(CRM_Utils_array::value('credit_card_number', $this->_params))
         );
       }
     }
@@ -726,7 +732,14 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
 
           if ($profileContactType) {
             //Since we are showing honoree name separately so we are removing it from honoree profile just for display
-            $honoreeNamefields = array('prefix_id', 'first_name', 'last_name', 'suffix_id', 'organization_name', 'household_name');
+            $honoreeNamefields = array(
+              'prefix_id',
+              'first_name',
+              'last_name',
+              'suffix_id',
+              'organization_name',
+              'household_name'
+            );
             if ($profileContactType == 'honor' && in_array($field['name'], $honoreeNamefields)) {
               unset($fields[$field['name']]);
               continue;
@@ -829,14 +842,15 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
     $contactID = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
 
     //get pledge status and contact id
-    $pledgeValues     = array();
-    $pledgeParams     = array('id' => $this->_values['pledge_id']);
+    $pledgeValues = array();
+    $pledgeParams = array('id' => $this->_values['pledge_id']);
     $returnProperties = array('contact_id', 'status_id');
     CRM_Core_DAO::commonRetrieve('CRM_Pledge_DAO_Pledge', $pledgeParams, $pledgeValues, $returnProperties);
 
     //get all status
     $allStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name');
-    $validStatus = array(array_search('Pending', $allStatus),
+    $validStatus = array(
+      array_search('Pending', $allStatus),
       array_search('In Progress', $allStatus),
       array_search('Overdue', $allStatus),
     );
index 41bdba22c69a5edae8414c1eb8b61562e7b9c420..156a8b5fb43794a904f5287bdb9a64ba67e43530 100644 (file)
@@ -94,7 +94,7 @@ class CRM_Contribute_Form_ContributionCharts extends CRM_Core_Form {
     $this->addElement('select', 'select_year', ts('Select Year (for monthly breakdown)'), $years);
     $this->setDefaults(array(
       'select_year' => ($this->_year) ? $this->_year : $currentYear,
-      ));
+    ));
   }
 
   /**
@@ -194,18 +194,18 @@ class CRM_Contribute_Form_ContributionCharts extends CRM_Core_Form {
         $urlParams = NULL;
         if ($chartKey == 'by_month') {
           $monthPosition = array_search($index, $abbrMonthNames);
-          $startDate     = CRM_Utils_Date::format(array('Y' => $selectedYear, 'M' => $monthPosition));
-          $endDate       = date('Ymd', mktime(0, 0, 0, $monthPosition + 1, 0, $selectedYear));
-          $urlParams     = "reset=1&force=1&status=1&start={$startDate}&end={$endDate}&test=0";
+          $startDate = CRM_Utils_Date::format(array('Y' => $selectedYear, 'M' => $monthPosition));
+          $endDate = date('Ymd', mktime(0, 0, 0, $monthPosition + 1, 0, $selectedYear));
+          $urlParams = "reset=1&force=1&status=1&start={$startDate}&end={$endDate}&test=0";
         }
         elseif ($chartKey == 'by_year') {
           if (!empty($config->fiscalYearStart) && ($config->fiscalYearStart['M'] != 1 || $config->fiscalYearStart['d'] != 1)) {
             $startDate = date('Ymd', mktime(0, 0, 0, $config->fiscalYearStart['M'], $config->fiscalYearStart['d'], substr($index, 0, 4)));
-            $endDate   = date('Ymd', mktime(0, 0, 0, $config->fiscalYearStart['M'], $config->fiscalYearStart['d'], (substr($index, 0, 4)) + 1));
+            $endDate = date('Ymd', mktime(0, 0, 0, $config->fiscalYearStart['M'], $config->fiscalYearStart['d'], (substr($index, 0, 4)) + 1));
           }
           else {
             $startDate = CRM_Utils_Date::format(array('Y' => substr($index, 0, 4)));
-            $endDate   = date('Ymd', mktime(0, 0, 0, 13, 0, substr($index, 0, 4)));
+            $endDate = date('Ymd', mktime(0, 0, 0, 13, 0, substr($index, 0, 4)));
           }
           $urlParams = "reset=1&force=1&status=1&start={$startDate}&end={$endDate}&test=0";
         }
index 20d768532e51ed3799c8f63f14dd57f9e23b4a36..0172e5c760bf15c167a450475cb29e049a67518d 100644 (file)
@@ -266,16 +266,18 @@ class CRM_Contribute_Form_ContributionPage extends CRM_Core_Form {
         $defaults['is_pledge_active'] = TRUE;
       }
       $pledgeBlock = array(
-        'is_pledge_interval', 'max_reminders',
-        'initial_reminder_day', 'additional_reminder_day',
+        'is_pledge_interval',
+        'max_reminders',
+        'initial_reminder_day',
+        'additional_reminder_day',
       );
       foreach ($pledgeBlock as $key) {
         $defaults[$key] = CRM_Utils_Array::value($key, $pledgeBlockDefaults);
       }
       if (!empty($pledgeBlockDefaults['pledge_frequency_unit'])) {
         $defaults['pledge_frequency_unit'] = array_fill_keys(explode(CRM_Core_DAO::VALUE_SEPARATOR,
-            $pledgeBlockDefaults['pledge_frequency_unit']
-          ), '1');
+          $pledgeBlockDefaults['pledge_frequency_unit']
+        ), '1');
       }
 
       // fix the display of the monetary value, CRM-4038
@@ -311,8 +313,8 @@ class CRM_Contribute_Form_ContributionPage extends CRM_Core_Form {
 
     if (!empty($defaults['recur_frequency_unit'])) {
       $defaults['recur_frequency_unit'] = array_fill_keys(explode(CRM_Core_DAO::VALUE_SEPARATOR,
-          $defaults['recur_frequency_unit']
-        ), '1');
+        $defaults['recur_frequency_unit']
+      ), '1');
     }
     else {
       # CRM 10860
@@ -357,17 +359,17 @@ class CRM_Contribute_Form_ContributionPage extends CRM_Core_Form {
       //this is quite painful because StateMachine is full of protected variables
       //so we have to retrieve all pages, find current page, and then retrieve next
       $stateMachine = new CRM_Contribute_StateMachine_ContributionPage($this);
-      $states       = $stateMachine->getStates();
-      $statesList   = array_keys($states);
-      $currKey      = array_search($className, $statesList);
-      $nextPage     = (array_key_exists($currKey + 1, $statesList)) ? $statesList[$currKey + 1] : '';
+      $states = $stateMachine->getStates();
+      $statesList = array_keys($states);
+      $currKey = array_search($className, $statesList);
+      $nextPage = (array_key_exists($currKey + 1, $statesList)) ? $statesList[$currKey + 1] : '';
 
       //unfortunately, some classes don't map to subpage names, so we alter the exceptions
 
       switch ($className) {
         case 'Contribute':
-          $attributes  = $this->getVar('_attributes');
-          $subPage     = strtolower(basename(CRM_Utils_Array::value('action', $attributes)));
+          $attributes = $this->getVar('_attributes');
+          $subPage = strtolower(basename(CRM_Utils_Array::value('action', $attributes)));
           $subPageName = ucfirst($subPage);
           if ($subPage == 'friend') {
             $nextPage = 'custom';
@@ -378,15 +380,15 @@ class CRM_Contribute_Form_ContributionPage extends CRM_Core_Form {
           break;
 
         case 'MembershipBlock':
-          $subPage     = 'membership';
+          $subPage = 'membership';
           $subPageName = 'MembershipBlock';
-          $nextPage    = 'thankyou';
+          $nextPage = 'thankyou';
           break;
 
         default:
-          $subPage     = strtolower($className);
+          $subPage = strtolower($className);
           $subPageName = $className;
-          $nextPage    = strtolower($nextPage);
+          $nextPage = strtolower($nextPage);
 
           if ($subPage == 'amount') {
             $nextPage = 'membership';
@@ -398,26 +400,26 @@ class CRM_Contribute_Form_ContributionPage extends CRM_Core_Form {
       }
 
       CRM_Core_Session::setStatus(ts("'%1' information has been saved.",
-          array(1 => $subPageName)
-        ), ts('Saved'), 'success');
+        array(1 => $subPageName)
+      ), ts('Saved'), 'success');
 
       $this->postProcessHook();
 
       if ($this->controller->getButtonName('submit') == "_qf_{$className}_next") {
         CRM_Utils_System::redirect(CRM_Utils_System::url("civicrm/admin/contribute/{$subPage}",
-            "action=update&reset=1&id={$this->_id}"
-          ));
+          "action=update&reset=1&id={$this->_id}"
+        ));
       }
       elseif ($this->controller->getButtonName('submit') == "_qf_{$className}_submit_savenext") {
         if ($nextPage) {
           CRM_Utils_System::redirect(CRM_Utils_System::url("civicrm/admin/contribute/{$nextPage}",
-              "action=update&reset=1&id={$this->_id}"
-            ));
+            "action=update&reset=1&id={$this->_id}"
+          ));
         }
         else {
           CRM_Utils_System::redirect(CRM_Utils_System::url("civicrm/admin/contribute",
-              "reset=1"
-            ));
+            "reset=1"
+          ));
         }
       }
       else {
index 53e781accdac6720b443529d347aafc2a20ee111..e628ae7d86039b99a613f5f54a11473e05e83cad 100644 (file)
@@ -82,7 +82,7 @@ class CRM_Contribute_Form_ContributionPage_AddProduct extends CRM_Contribute_For
       $dao->id = $this->_pid;
       $dao->find(TRUE);
       $defaults['product_id'] = $dao->product_id;
-      $defaults['financial_type_id']   = $dao->financial_type_id;
+      $defaults['financial_type_id'] = $dao->financial_type_id;
       $defaults['weight'] = $dao->weight;
     }
     else {
@@ -95,15 +95,15 @@ class CRM_Contribute_Form_ContributionPage_AddProduct extends CRM_Contribute_For
       $pageID = CRM_Utils_Request::retrieve('id', 'Positive',
         $this, FALSE, 0
       );
-      $dao               = new CRM_Contribute_DAO_Premium();
+      $dao = new CRM_Contribute_DAO_Premium();
       $dao->entity_table = 'civicrm_contribution_page';
-      $dao->entity_id    = $pageID;
+      $dao->entity_id = $pageID;
       $dao->find(TRUE);
       $premiumID = $dao->id;
 
-      $sql    = 'SELECT max( weight ) as max_weight FROM civicrm_premiums_product WHERE premiums_id = %1';
+      $sql = 'SELECT max( weight ) as max_weight FROM civicrm_premiums_product WHERE premiums_id = %1';
       $params = array(1 => array($premiumID, 'Integer'));
-      $dao    = CRM_Core_DAO::executeQuery($sql, $params);
+      $dao = CRM_Core_DAO::executeQuery($sql, $params);
       $dao->fetch();
       $defaults['weight'] = $dao->max_weight + 1;
     }
@@ -122,8 +122,9 @@ class CRM_Contribute_Form_ContributionPage_AddProduct extends CRM_Contribute_For
       $url = CRM_Utils_System::url($urlParams, 'reset=1&action=update&id=' . $this->_id);
       $session->pushUserContext($url);
       if (CRM_Utils_Request::retrieve('confirmed', 'Boolean',
-          CRM_Core_DAO::$_nullObject, '', '', 'GET'
-        )) {
+        CRM_Core_DAO::$_nullObject, '', '', 'GET'
+      )
+      ) {
         $dao = new CRM_Contribute_DAO_PremiumsProduct();
         $dao->id = $this->_pid;
         $dao->delete();
@@ -238,16 +239,16 @@ class CRM_Contribute_Form_ContributionPage_AddProduct extends CRM_Contribute_For
     $urlParams = 'civicrm/admin/contribute/premium';
     if ($this->_action & CRM_Core_Action::PREVIEW) {
       $session = CRM_Core_Session::singleton();
-      $url     = CRM_Utils_System::url($urlParams, 'reset=1&action=update&id=' . $this->_id);
-      $single  = $session->get('singleForm');
+      $url = CRM_Utils_System::url($urlParams, 'reset=1&action=update&id=' . $this->_id);
+      $single = $session->get('singleForm');
       CRM_Utils_System::redirect($url);
       return;
     }
 
     if ($this->_action & CRM_Core_Action::DELETE) {
       $session = CRM_Core_Session::singleton();
-      $url     = CRM_Utils_System::url($urlParams, 'reset=1&action=update&id=' . $this->_id);
-      $dao     = new CRM_Contribute_DAO_PremiumsProduct();
+      $url = CRM_Utils_System::url($urlParams, 'reset=1&action=update&id=' . $this->_id);
+      $dao = new CRM_Contribute_DAO_PremiumsProduct();
       $dao->id = $this->_pid;
       $dao->delete();
       CRM_Core_Session::setStatus(ts('Selected Premium Product has been removed from this Contribution Page.'), ts('Saved'), 'success');
@@ -259,9 +260,9 @@ class CRM_Contribute_Form_ContributionPage_AddProduct extends CRM_Contribute_For
       if ($this->_pid) {
         $params['id'] = $this->_pid;
       }
-      $dao               = new CRM_Contribute_DAO_Premium();
+      $dao = new CRM_Contribute_DAO_Premium();
       $dao->entity_table = 'civicrm_contribution_page';
-      $dao->entity_id    = $this->_id;
+      $dao->entity_id = $this->_id;
       $dao->find(TRUE);
       $premiumID = $dao->id;
       $params['premiums_id'] = $premiumID;
index f33dc4e93d33cd874d62909253111ff5cd34c159..67b20df3ea3f96487dd281eeee0c7cea326559be 100644 (file)
@@ -152,7 +152,8 @@ SELECT id
     }
     $this->add('select', 'price_set_id', ts('Price Set'),
       array(
-        '' => ts('- none -')) + $price,
+        '' => ts('- none -')
+      ) + $price,
       NULL, array('onchange' => "showHideAmountBlock( this.value, 'price_set_id' );")
     );
     //CiviPledge fields.
@@ -203,9 +204,14 @@ SELECT id
         if ($isQuick = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config')) {
           $this->assign('isQuick', $isQuick);
           //$priceField = CRM_Core_DAO::getFieldValue( 'CRM_Price_DAO_PriceField', $priceSetId, 'id', 'price_set_id' );
-          $options          = $pFIDs = array();
+          $options = $pFIDs = array();
           $priceFieldParams = array('price_set_id' => $priceSetId);
-          $priceFields      = CRM_Core_DAO::commonRetrieveAll('CRM_Price_DAO_PriceField', 'price_set_id', $priceSetId, $pFIDs, $return = array('html_type', 'name', 'is_active', 'label'));
+          $priceFields = CRM_Core_DAO::commonRetrieveAll('CRM_Price_DAO_PriceField', 'price_set_id', $priceSetId, $pFIDs, $return = array(
+              'html_type',
+              'name',
+              'is_active',
+              'label'
+            ));
           foreach ($priceFields as $priceField) {
             if ($priceField['id'] && $priceField['html_type'] == 'Radio' && $priceField['name'] == 'contribution_amount') {
               $defaults['price_field_id'] = $priceField['id'];
@@ -261,8 +267,8 @@ SELECT id
 
     if (!empty($defaults['payment_processor'])) {
       $defaults['payment_processor'] = array_fill_keys(explode(CRM_Core_DAO::VALUE_SEPARATOR,
-          $defaults['payment_processor']
-        ), '1');
+        $defaults['payment_processor']
+      ), '1');
     }
     return $defaults;
   }
@@ -416,10 +422,10 @@ SELECT id
 
     if (array_key_exists('payment_processor', $params)) {
       if (array_key_exists(CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessor', 'AuthNet',
-            'id', 'payment_processor_type_id'
-          ),
-          CRM_Utils_Array::value('payment_processor', $params)
-        )) {
+          'id', 'payment_processor_type_id'
+        ),
+        CRM_Utils_Array::value('payment_processor', $params)
+      )) {
         CRM_Core_Session::setStatus(ts(' Please note that the Authorize.net payment processor only allows recurring contributions and auto-renew memberships with payment intervals from 7-365 days or 1-12 months (i.e. not greater than 1 year).'), '', 'alert');
       }
     }
@@ -459,7 +465,9 @@ SELECT id
       }
 
       if (in_array($field, array(
-        'min_amount', 'max_amount'))) {
+        'min_amount',
+        'max_amount'
+      ))) {
         $val = CRM_Utils_Rule::cleanMoney($val);
       }
 
@@ -517,8 +525,8 @@ SELECT id
           // process contribution amount block
           $deleteAmountBlk = FALSE;
 
-          $labels  = CRM_Utils_Array::value('label', $params);
-          $values  = CRM_Utils_Array::value('value', $params);
+          $labels = CRM_Utils_Array::value('label', $params);
+          $values = CRM_Utils_Array::value('value', $params);
           $default = CRM_Utils_Array::value('default', $params);
 
           $options = array();
@@ -527,7 +535,7 @@ SELECT id
               (strlen(trim($values[$i])) > 0)
             ) {
               $options[] = array(
-              'label' => trim($labels[$i]),
+                'label' => trim($labels[$i]),
                 'value' => CRM_Utils_Rule::cleanMoney(trim($values[$i])),
                 'weight' => $i,
                 'is_active' => 1,
@@ -623,8 +631,8 @@ SELECT id
             }
             if (!empty($params['is_allow_other_amount']) && empty($params['price_field_other'])) {
               $editedFieldParams = array(
-                 'price_set_id' => $priceSetId,
-                 'name' => 'other_amount',
+                'price_set_id' => $priceSetId,
+                'name' => 'other_amount',
               );
               $editedResults = array();
 
@@ -701,8 +709,10 @@ SELECT id
               $pledgeBlockParams['id'] = $this->_pledgeBlockID;
             }
             $pledgeBlock = array(
-              'pledge_frequency_unit', 'max_reminders',
-              'initial_reminder_day', 'additional_reminder_day',
+              'pledge_frequency_unit',
+              'max_reminders',
+              'initial_reminder_day',
+              'additional_reminder_day',
             );
             foreach ($pledgeBlock as $key) {
               $pledgeBlockParams[$key] = CRM_Utils_Array::value($key, $params);
index db41f6df36235db91e5cec07f735efbd3980611e..189390b43aeafdcc5b217a5f9bba5d37b7eb7c3b 100644 (file)
@@ -56,13 +56,21 @@ class CRM_Contribute_Form_ContributionPage_Custom extends CRM_Contribute_Form_Co
     $allowCoreTypes[] = 'Contribution';
     //CRM-15427
     $allowSubTypes['ContributionType'] = array($financialTypeId);
-    $entities[] = array('entity_name' => 'contribution_1', 'entity_type' => 'ContributionModel', 'entity_sub_type' => '*');
+    $entities[] = array(
+      'entity_name' => 'contribution_1',
+      'entity_type' => 'ContributionModel',
+      'entity_sub_type' => '*'
+    );
 
     // If applicable, register 'membership_1'
     $member = CRM_Member_BAO_Membership::getMembershipBlock($this->_id);
     if ($member && $member['is_active']) {
       //CRM-15427
-      $entities[] = array('entity_name' => 'membership_1', 'entity_type' => 'MembershipModel', 'entity_sub_type' => '*');
+      $entities[] = array(
+        'entity_name' => 'membership_1',
+        'entity_type' => 'MembershipModel',
+        'entity_sub_type' => '*'
+      );
       $allowCoreTypes[] = 'Membership';
       $allowSubTypes['MembershipType'] = explode(',', $member['membership_types']);
     }
@@ -172,9 +180,9 @@ class CRM_Contribute_Form_ContributionPage_Custom extends CRM_Contribute_Form_Co
     $preProfileType = $postProfileType = NULL;
     // for membership profile make sure Membership section is enabled
     // get membership section for this contribution page
-    $dao               = new CRM_Member_DAO_MembershipBlock();
+    $dao = new CRM_Member_DAO_MembershipBlock();
     $dao->entity_table = 'civicrm_contribution_page';
-    $dao->entity_id    = $contributionPageId;
+    $dao->entity_id = $contributionPageId;
 
     $membershipEnable = FALSE;
 
index 147429315fe7ff521eeeecf61866bd5e77b11bc5..e620ce44d5a80d35ba832d56087ce8ac07048c7b 100644 (file)
@@ -121,15 +121,15 @@ class CRM_Contribute_Form_ContributionPage_Delete extends CRM_Contribute_Form_Co
     $dao->delete();
 
     //next delete the membership block fields
-    $dao               = new CRM_Member_DAO_MembershipBlock();
+    $dao = new CRM_Member_DAO_MembershipBlock();
     $dao->entity_table = 'civicrm_contribution_page';
-    $dao->entity_id    = $this->_id;
+    $dao->entity_id = $this->_id;
     $dao->delete();
 
     //next delete the pcp block fields
-    $dao               = new CRM_PCP_DAO_PCPBlock();
+    $dao = new CRM_PCP_DAO_PCPBlock();
     $dao->entity_table = 'civicrm_contribution_page';
-    $dao->entity_id    = $this->_id;
+    $dao->entity_id = $this->_id;
     $dao->delete();
 
     // need to delete premiums. CRM-4586
index 7af17b2d36d2fe65b0be17d11b149260b4bf1385..bcfb797af6f6918131c21ffa8f97409d8a1707b5 100644 (file)
@@ -50,9 +50,9 @@ class CRM_Contribute_Form_ContributionPage_Premium extends CRM_Contribute_Form_C
     if (isset($this->_id)) {
       $title = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $this->_id, 'title');
       CRM_Utils_System::setTitle(ts('Premiums') . " ($title)");
-      $dao               = new CRM_Contribute_DAO_Premium();
+      $dao = new CRM_Contribute_DAO_Premium();
       $dao->entity_table = 'civicrm_contribution_page';
-      $dao->entity_id    = $this->_id;
+      $dao->entity_id = $this->_id;
       $dao->find(TRUE);
       CRM_Core_DAO::storeValues($dao, $defaults);
     }
@@ -138,9 +138,9 @@ class CRM_Contribute_Form_ContributionPage_Premium extends CRM_Contribute_Form_C
 
     // we do this in case the user has hit the forward/back button
 
-    $dao               = new CRM_Contribute_DAO_Premium();
+    $dao = new CRM_Contribute_DAO_Premium();
     $dao->entity_table = 'civicrm_contribution_page';
-    $dao->entity_id    = $this->_id;
+    $dao->entity_id = $this->_id;
     $dao->find(TRUE);
     $premiumID = $dao->id;
     if ($premiumID) {
index 699ccfc56d261dceccbed6f669ff5df5283a834f..60a074e41b43473dadf36aeb8f8baee7cc6d090b 100644 (file)
@@ -139,7 +139,10 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_
     // is on behalf of an organization ?
     $this->addElement('checkbox', 'is_organization', ts('Allow individuals to contribute and / or signup for membership on behalf of an organization?'), NULL, array('onclick' => "showHideByValue('is_organization',true,'for_org_text','table-row','radio',false);showHideByValue('is_organization',true,'for_org_option','table-row','radio',false);"));
 
-    $allowCoreTypes = array_merge(array('Contact', 'Organization'), CRM_Contact_BAO_ContactType::subTypes('Organization'));
+    $allowCoreTypes = array_merge(array(
+        'Contact',
+        'Organization'
+      ), CRM_Contact_BAO_ContactType::subTypes('Organization'));
     $allowSubTypes = array();
     $entities = array(
       array(
@@ -150,7 +153,7 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_
 
     $this->addProfileSelector('onbehalf_profile_id', ts('Organization Profile'), $allowCoreTypes, $allowSubTypes, $entities);
 
-    $options   = array();
+    $options = array();
     $options[] = $this->createElement('radio', NULL, NULL, ts('Optional'), 1);
     $options[] = $this->createElement('radio', NULL, NULL, ts('Required'), 2);
     $this->addGroup($options, 'is_for_organization', ts(''));
@@ -191,7 +194,12 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_
       ),
     );
 
-    $allowCoreTypes = array_merge(array('Contact', 'Individual', 'Organization', 'Household'), CRM_Contact_BAO_ContactType::subTypes('Individual'));
+    $allowCoreTypes = array_merge(array(
+        'Contact',
+        'Individual',
+        'Organization',
+        'Household'
+      ), CRM_Contact_BAO_ContactType::subTypes('Individual'));
     $allowSubTypes = array();
 
     $this->addProfileSelector('honoree_profile', ts('Honoree Profile'), $allowCoreTypes, $allowSubTypes, $entities);
@@ -266,7 +274,7 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_
 
       list($contributionProfiles['custom_pre_id'],
         $contributionProfiles['custom_post_id']
-      ) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
+        ) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
 
       $conProfileType = NULL;
       if ($contributionProfiles['custom_pre_id']) {
@@ -279,7 +287,7 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_
       if ($contributionProfiles['custom_post_id']) {
         $postProfileType = CRM_Core_BAO_UFField::getProfileType($contributionProfiles['custom_post_id']);
         if ($postProfileType == 'Membership') {
-          $conProfileType  = empty($conProfileType) ? "'Includes Profile (bottom of page)'" : "{$conProfileType} and 'Includes Profile (bottom of page)'";
+          $conProfileType = empty($conProfileType) ? "'Includes Profile (bottom of page)'" : "{$conProfileType} and 'Includes Profile (bottom of page)'";
         }
       }
       if (!empty($conProfileType)) {
@@ -385,8 +393,8 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_
         $url = 'civicrm/admin/contribute';
         $urlParams = 'reset=1';
         CRM_Core_Session::setStatus(ts("'%1' information has been saved.",
-            array(1 => $this->getTitle())
-          ), ts('Saved'), 'success');
+          array(1 => $this->getTitle())
+        ), ts('Saved'), 'success');
       }
 
       CRM_Utils_System::redirect(CRM_Utils_System::url($url, $urlParams));
index d0398713f3ec51dbd6e978f3632259ee31adc0fe..5f73c80864b2439cdfb83ecf34e17efb14494370 100644 (file)
@@ -52,9 +52,10 @@ class CRM_Contribute_Form_ContributionPage_TabHeader {
     CRM_Core_Resources::singleton()
       ->addScriptFile('civicrm', 'templates/CRM/common/TabHeader.js', 1, 'html-header')
       ->addSetting(array(
-    'tabSettings' => array(
-        'active' => self::getCurrentTab($tabs),
-      )));
+        'tabSettings' => array(
+          'active' => self::getCurrentTab($tabs),
+        )
+      ));
     return $tabs;
   }
 
@@ -70,63 +71,63 @@ class CRM_Contribute_Form_ContributionPage_TabHeader {
 
     $tabs = array(
       'settings' => array(
-    'title' => ts('Title'),
+        'title' => ts('Title'),
         'link' => NULL,
         'valid' => FALSE,
         'active' => FALSE,
         'current' => FALSE,
       ),
       'amount' => array(
-    'title' => ts('Amounts'),
+        'title' => ts('Amounts'),
         'link' => NULL,
         'valid' => FALSE,
         'active' => FALSE,
         'current' => FALSE,
       ),
       'membership' => array(
-    'title' => ts('Memberships'),
+        'title' => ts('Memberships'),
         'link' => NULL,
         'valid' => FALSE,
         'active' => FALSE,
         'current' => FALSE,
       ),
       'thankyou' => array(
-    'title' => ts('Receipt'),
+        'title' => ts('Receipt'),
         'link' => NULL,
         'valid' => FALSE,
         'active' => FALSE,
         'current' => FALSE,
       ),
       'friend' => array(
-    'title' => ts('Tell a Friend'),
+        'title' => ts('Tell a Friend'),
         'link' => NULL,
         'valid' => FALSE,
         'active' => FALSE,
         'current' => FALSE,
       ),
       'custom' => array(
-    'title' => ts('Profiles'),
+        'title' => ts('Profiles'),
         'link' => NULL,
         'valid' => FALSE,
         'active' => FALSE,
         'current' => FALSE,
       ),
       'premium' => array(
-    'title' => ts('Premiums'),
+        'title' => ts('Premiums'),
         'link' => NULL,
         'valid' => FALSE,
         'active' => FALSE,
         'current' => FALSE,
       ),
       'widget' => array(
-    'title' => ts('Widgets'),
+        'title' => ts('Widgets'),
         'link' => NULL,
         'valid' => FALSE,
         'active' => FALSE,
         'current' => FALSE,
       ),
       'pcp' => array(
-    'title' => ts('Personal Campaigns'),
+        'title' => ts('Personal Campaigns'),
         'link' => NULL,
         'valid' => FALSE,
         'active' => FALSE,
@@ -135,8 +136,8 @@ class CRM_Contribute_Form_ContributionPage_TabHeader {
     );
 
     $contribPageId = $form->getVar('_id');
-    $fullName      = $form->getVar('_name');
-    $className     = CRM_Utils_String::getClassName($fullName);
+    $fullName = $form->getVar('_name');
+    $className = CRM_Utils_String::getClassName($fullName);
 
     // Hack for special cases.
     switch ($className) {
@@ -173,8 +174,8 @@ class CRM_Contribute_Form_ContributionPage_TabHeader {
         $tabs[$key]['link'] =
           CRM_Utils_System::url(
             "civicrm/admin/contribute/{$key}",
-          "{$reset}action=update&id={$contribPageId}{$tabs[$key]['qfKey']}"
-        );
+            "{$reset}action=update&id={$contribPageId}{$tabs[$key]['qfKey']}"
+          );
         $tabs[$key]['active'] = $tabs[$key]['valid'] = TRUE;
       }
       //get all section info.
index 2a34d9f25751d94fc28ca436a7c722a128aac50a..fd9cb7b4b887cb1d3ff6c8c6970a3648a94c2c24 100644 (file)
@@ -64,17 +64,20 @@ class CRM_Contribute_Form_ContributionPage_Widget extends CRM_Contribute_Form_Co
     );
 
     $this->_fields = array(
-    'title' => array(ts('Title'),
+      'title' => array(
+        ts('Title'),
         'text',
         FALSE,
         $title,
       ),
-      'url_logo' => array(ts('URL to Logo Image'),
+      'url_logo' => array(
+        ts('URL to Logo Image'),
         'text',
         FALSE,
         NULL,
       ),
-      'button_title' => array(ts('Button Title'),
+      'button_title' => array(
+        ts('Button Title'),
         'text',
         FALSE,
         ts('Contribute!'),
@@ -82,47 +85,56 @@ class CRM_Contribute_Form_ContributionPage_Widget extends CRM_Contribute_Form_Co
     );
 
     $this->_colorFields = array(
-    'color_title' => array(ts('Title Text Color'),
+      'color_title' => array(
+        ts('Title Text Color'),
         'text',
         FALSE,
         '#2786C2',
       ),
-      'color_bar' => array(ts('Progress Bar Color'),
+      'color_bar' => array(
+        ts('Progress Bar Color'),
         'text',
         FALSE,
         '#FFFFFF',
       ),
-      'color_main_text' => array(ts('Additional Text Color'),
+      'color_main_text' => array(
+        ts('Additional Text Color'),
         'text',
         FALSE,
         '#FFFFFF',
       ),
-      'color_main' => array(ts('Background Color'),
+      'color_main' => array(
+        ts('Background Color'),
         'text',
         FALSE,
         '#96C0E7',
       ),
-      'color_main_bg' => array(ts('Background Color Top Area'),
+      'color_main_bg' => array(
+        ts('Background Color Top Area'),
         'text',
         FALSE,
         '#B7E2FF',
       ),
-      'color_bg' => array(ts('Border Color'),
+      'color_bg' => array(
+        ts('Border Color'),
         'text',
         FALSE,
         '#96C0E7',
       ),
-      'color_about_link' => array(ts('Button Link Color'),
+      'color_about_link' => array(
+        ts('Button Link Color'),
         'text',
         FALSE,
         '#556C82',
       ),
-      'color_button' => array(ts('Button Background Color'),
+      'color_button' => array(
+        ts('Button Background Color'),
         'text',
         FALSE,
         '#FFFFFF',
       ),
-      'color_homepage_link' => array(ts('Homepage Link Color'),
+      'color_homepage_link' => array(
+        ts('Homepage Link Color'),
         'text',
         FALSE,
         '#FFFFFF',
index a20189bddd02c1d462b1f90d3da7f282af0554ad..bbed6f48918539f7f69b982f5b5de8a6ecd21b53 100644 (file)
@@ -45,9 +45,9 @@ class CRM_Contribute_Form_ContributionView extends CRM_Core_Form {
    * @return void
    */
   public function preProcess() {
-    $id      = $this->get('id');
-    $values  = $ids = array();
-    $params  = array('id' => $id);
+    $id = $this->get('id');
+    $values = $ids = array();
+    $params = array('id' => $id);
     $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $this->assign('context', $context);
 
@@ -76,9 +76,9 @@ class CRM_Contribute_Form_ContributionView extends CRM_Core_Form {
     }
 
     if (!empty($values['contribution_recur_id'])) {
-      $sql    = "SELECT  installments, frequency_interval, frequency_unit FROM civicrm_contribution_recur WHERE id = %1";
+      $sql = "SELECT  installments, frequency_interval, frequency_unit FROM civicrm_contribution_recur WHERE id = %1";
       $params = array(1 => array($values['contribution_recur_id'], 'Integer'));
-      $dao    = CRM_Core_DAO::executeQuery($sql, $params);
+      $dao = CRM_Core_DAO::executeQuery($sql, $params);
       if ($dao->fetch()) {
         $values['recur_installments'] = $dao->installments;
         $values['recur_frequency_unit'] = $dao->frequency_unit;
index d72cb47b3eea4d7712c4d5f6914912dfd5a334e5..569683da342ae4cc6be50a7ec75a136c804a5368 100644 (file)
@@ -104,7 +104,10 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form {
 
     $this->applyFilter('__ALL__', 'trim');
     $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->addRule('name', ts('A product with this name already exists. Please select another name.'), 'objectExists', array(
+        'CRM_Contribute_DAO_Product',
+        $this->_id
+      ));
     $this->add('text', 'sku', ts('SKU'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'sku'));
 
     $this->add('textarea', 'description', ts('Description'), 'rows=3, cols=60');
@@ -133,7 +136,11 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form {
 
     $this->add('textarea', 'options', ts('Options'), 'rows=3, cols=60');
 
-    $this->add('select', 'period_type', ts('Period Type'), array('' => '- select -', 'rolling' => 'Rolling', 'fixed' => 'Fixed'));
+    $this->add('select', 'period_type', ts('Period Type'), array(
+        '' => '- select -',
+        'rolling' => 'Rolling',
+        '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'));
 
@@ -284,7 +291,7 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form {
       CRM_Core_Session::setStatus(ts('Selected Premium Product type has been deleted.'), ts('Deleted'), 'info');
     }
     else {
-      $params    = $this->controller->exportValues($this->_name);
+      $params = $this->controller->exportValues($this->_name);
       $imageFile = CRM_Utils_Array::value('uploadFile', $params);
       $imageFile = $imageFile['name'];
 
@@ -335,7 +342,10 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form {
 
       // fix the money fields
       foreach (array(
-        'cost', 'price', 'min_contribution') as $f) {
+                 'cost',
+                 'price',
+                 'min_contribution'
+               ) as $f) {
         $params[$f] = CRM_Utils_Rule::cleanMoney($params[$f]);
       }
 
@@ -373,7 +383,7 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form {
     if ($imageInfo['mime'] == 'image/gif') {
       $source = imagecreatefromgif($filename);
     }
-    elseif($imageInfo['mime'] == 'image/png') {
+    elseif ($imageInfo['mime'] == 'image/png') {
       $source = imagecreatefrompng($filename);
     }
     else {
index 1be52e0b303a8beae122ab1a1c5d9a75317b74fc..5e85dc1e5f8ee64e214c54fcfdf84c8e0c15cdff 100644 (file)
@@ -92,9 +92,9 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search {
      * driven by the wizard framework
      */
 
-    $this->_reset   = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
-    $this->_force   = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE);
-    $this->_limit   = CRM_Utils_Request::retrieve('limit', 'Positive', $this);
+    $this->_reset = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
+    $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE);
+    $this->_limit = CRM_Utils_Request::retrieve('limit', 'Positive', $this);
     $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'search');
 
     $this->assign("context", $this->_context);
@@ -259,7 +259,9 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search {
     }
 
     foreach (array(
-      'contribution_amount_low', 'contribution_amount_high') as $f) {
+               'contribution_amount_low',
+               'contribution_amount_high'
+             ) as $f) {
       if (isset($this->_formValues[$f])) {
         $this->_formValues[$f] = CRM_Utils_Rule::cleanMoney($this->_formValues[$f]);
       }
index a822ea569e6407d06e8c5b33ba38b6e47f066932..3ae25079db745b2744f1488835983988edcf527c 100644 (file)
@@ -54,12 +54,12 @@ class CRM_Contribute_Form_SearchContribution extends CRM_Core_Form {
     CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch($this);
 
     $this->addButtons(array(
-        array(
-          'type' => 'refresh',
-          'name' => ts('Search'),
-          'isDefault' => TRUE,
-        ),
-      ));
+      array(
+        'type' => 'refresh',
+        'name' => ts('Search'),
+        'isDefault' => TRUE,
+      ),
+    ));
   }
 
   public function postProcess() {
index 7d6b6f85ef8ac1e50ca19dba6768b49384071873..1068c45260a9b7dd55b5370b48a1a4c25c7d8c4d 100644 (file)
@@ -130,7 +130,11 @@ class CRM_Contribute_Form_SoftCredit {
 
       $form->addMoney("soft_credit_amount[{$rowNumber}]", ts('Amount'), FALSE, NULL, FALSE);
 
-      $form->addSelect("soft_credit_type[{$rowNumber}]", array('entity' => 'contribution_soft', 'field' => 'soft_credit_type_id', 'label' => ts('Type')));
+      $form->addSelect("soft_credit_type[{$rowNumber}]", array(
+          'entity' => 'contribution_soft',
+          'field' => 'soft_credit_type_id',
+          'label' => ts('Type')
+        ));
       if (!empty($form->_softCreditInfo['soft_credit'][$rowNumber]['soft_credit_id'])) {
         $form->add('hidden', "soft_credit_id[{$rowNumber}]",
           $form->_softCreditInfo['soft_credit'][$rowNumber]['soft_credit_id']);
@@ -222,7 +226,8 @@ class CRM_Contribute_Form_SoftCredit {
             $errors["soft_credit_contact[$key]"] = ts('You cannot enter multiple soft credits for the same contact.');
           }
           if ($self->_action == CRM_Core_Action::ADD && $fields['soft_credit_amount'][$key]
-            && (CRM_Utils_Rule::cleanMoney($fields['soft_credit_amount'][$key]) > CRM_Utils_Rule::cleanMoney($fields['total_amount']))) {
+            && (CRM_Utils_Rule::cleanMoney($fields['soft_credit_amount'][$key]) > CRM_Utils_Rule::cleanMoney($fields['total_amount']))
+          ) {
             $errors["soft_credit_amount[$key]"] = ts('Soft credit amount cannot be more than the total amount.');
           }
           if (empty($fields['soft_credit_amount'][$key])) {
index 2fd0a3565f9147f4965e12361d6e59901a84242c..a46fb96ec69024027b5bd0dba7603126849cc994 100644 (file)
@@ -123,7 +123,7 @@ class CRM_Contribute_Form_Task extends CRM_Core_Form {
     else {
       $queryParams = $form->get('queryParams');
       $sortOrder = NULL;
-      if ($form->get(CRM_Utils_Sort::SORT_ORDER )) {
+      if ($form->get(CRM_Utils_Sort::SORT_ORDER)) {
         $sortOrder = $form->get(CRM_Utils_Sort::SORT_ORDER);
       }
 
@@ -178,8 +178,8 @@ class CRM_Contribute_Form_Task extends CRM_Core_Form {
     }
     else {
       $session->replaceUserContext(CRM_Utils_System::url("civicrm/contact/search/$searchFormName",
-          $urlParams
-        ));
+        $urlParams
+      ));
     }
   }
 
index cf40e241edf5f7a0bcf33930d64c4a41c8e31c07..0cf8ff2dcb7963111ef61522e9727177e766ac32 100644 (file)
@@ -84,7 +84,10 @@ class CRM_Contribute_Form_Task_Delete extends CRM_Contribute_Form_Task {
         $deletedContributions++;
       }
     }
-    $status = ts('Deleted Contribution(s): %1 (Total Selected: %2) ', array(1 => $deletedContributions, 2 => count($this->_contributionIds)));
+    $status = ts('Deleted Contribution(s): %1 (Total Selected: %2) ', array(
+        1 => $deletedContributions,
+        2 => count($this->_contributionIds)
+      ));
     CRM_Core_Session::setStatus($status, '', 'info');
   }
 }
index 22975e53b21537a127318be7a877cdf9b6de4a71..73b30e31c6008d247e9a07f7f1f541880c8c3297 100644 (file)
@@ -280,7 +280,7 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task {
         CRM_Core_Error::fatal();
       }
 
-      $contribution = & $objects['contribution'];
+      $contribution = &$objects['contribution'];
 
       $input['amount'] = $contribution->total_amount;
       $input['invoice_id'] = $contribution->invoice_id;
index 08dd4aafc5d03fd2705b70f29aee31909960783c..3affd3bfcfc80b7fedae98bb626087396866db63 100644 (file)
@@ -92,9 +92,10 @@ AND    {$this->_componentClause}";
     $url = CRM_Utils_System::url('civicrm/contribute/search', $urlParams);
     $breadCrumb = array(
       array(
-    'url' => $url,
+        'url' => $url,
         'title' => ts('Search Results'),
-      ));
+      )
+    );
 
     CRM_Utils_System::appendBreadCrumb($breadCrumb);
     CRM_Utils_System::setTitle(ts('Print Contribution Receipts'));
@@ -182,12 +183,12 @@ AND    {$this->_componentClause}";
       $contribution = &$objects['contribution'];
 
       // set some fake input values so we can reuse IPN code
-      $input['amount']     = $contribution->total_amount;
-      $input['is_test']    = $contribution->is_test;
+      $input['amount'] = $contribution->total_amount;
+      $input['is_test'] = $contribution->is_test;
       $input['fee_amount'] = $contribution->fee_amount;
       $input['net_amount'] = $contribution->net_amount;
-      $input['trxn_id']    = $contribution->trxn_id;
-      $input['trxn_date']  = isset($contribution->trxn_date) ? $contribution->trxn_date : NULL;
+      $input['trxn_id'] = $contribution->trxn_id;
+      $input['trxn_date'] = isset($contribution->trxn_date) ? $contribution->trxn_date : NULL;
 
       // CRM_Contribute_BAO_Contribution::composeMessageArray expects mysql formatted date
       $objects['contribution']->receive_date = CRM_Utils_Date::isoToMysql($objects['contribution']->receive_date);
@@ -262,18 +263,19 @@ AND    {$this->_componentClause}";
 
     $pdfElements['createPdf'] = FALSE;
     if (!empty($pdfElements['params']['output']) &&
-      ($pdfElements['params']['output'] == "pdf_invoice" || $pdfElements['params']['output'] == "pdf_receipt")) {
+      ($pdfElements['params']['output'] == "pdf_invoice" || $pdfElements['params']['output'] == "pdf_receipt")
+    ) {
       $pdfElements['createPdf'] = TRUE;
     }
 
     $excludeContactIds = array();
     if (!$pdfElements['createPdf']) {
       $returnProperties = array(
-                                'email' => 1,
-                                'do_not_email' => 1,
-                                'is_deceased' => 1,
-                                'on_hold' => 1,
-                                );
+        'email' => 1,
+        'do_not_email' => 1,
+        'is_deceased' => 1,
+        'on_hold' => 1,
+      );
 
       list($contactDetails) = CRM_Utils_Token::getTokenDetails($contactIds, $returnProperties, FALSE, FALSE);
       $pdfElements['suppressedEmails'] = 0;
@@ -282,7 +284,8 @@ AND    {$this->_componentClause}";
         if (empty($values['email']) ||
           (empty($params['override_privacy']) && !empty($values['do_not_email']))
           || CRM_Utils_Array::value('is_deceased', $values)
-          || !empty($values['on_hold'])) {
+          || !empty($values['on_hold'])
+        ) {
           $suppressedEmails++;
           $pdfElements['suppressedEmails'] = $suppressedEmails;
           $excludeContactIds[] = $values['contact_id'];
index f1311255a0333dc51c944e847971821d70143e29..e64ef5ec535040b1a6443efa5e327b3e11b55f01 100644 (file)
@@ -139,7 +139,7 @@ class CRM_Contribute_Form_Task_PDFLetter extends CRM_Contribute_Form_Task {
       'email' => ts('Send emails where possible. Generate printable PDFs for contacts who cannot receive email.'),
       'both' => ts('Send emails where possible. Generate printable PDFs for all contacts.'),
     );
-    if (CRM_Core_Config::singleton()->doNotAttachPDFReceipt)  {
+    if (CRM_Core_Config::singleton()->doNotAttachPDFReceipt) {
       $emailOptions['pdfemail'] = ts('Send emails with an attached PDF where possible. Generate printable PDFs for contacts who cannot receive email.');
       $emailOptions['pdfemail_both'] = ts('Send emails with an attached PDF where possible. Generate printable PDFs for all contacts.');
     }
index c89b77962ff104cebc98a309aca30008c7aa6151..d4f6e98d46a2259e42fedbc8fc5624cee56d1e82 100644 (file)
@@ -21,7 +21,7 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF
     if (!empty($formValues['email_options'])) {
       $returnProperties['email'] = $returnProperties['on_hold'] = $returnProperties['is_deceased'] = $returnProperties['do_not_email'] = 1;
       $emailParams = array(
-        'subject'   => $formValues['subject'],
+        'subject' => $formValues['subject'],
       );
       // We need display_name for emailLetter() so add to returnProperties here
       $returnProperties['display_name'] = 1;
@@ -30,11 +30,11 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF
       }
     }
     // update dates ?
-    $receipt_update  = isset($formValues['receipt_update']) ? $formValues['receipt_update'] : FALSE;
+    $receipt_update = isset($formValues['receipt_update']) ? $formValues['receipt_update'] : FALSE;
     $thankyou_update = isset($formValues['thankyou_update']) ? $formValues['thankyou_update'] : FALSE;
-    $nowDate         = date('YmdHis');
+    $nowDate = date('YmdHis');
     $receipts = $thanks = $emailed = 0;
-    $updateStatus    = '';
+    $updateStatus = '';
     $task = 'CRM_Contribution_Form_Task_PDFLetterCommon';
     $realSeparator = ', ';
     //the original thinking was mutliple options - but we are going with only 2 (comma & td) for now in case
@@ -143,7 +143,8 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF
     foreach ($relevantEntities as $entity) {
       if (isset($tokens[$entity]) && is_array($tokens[$entity])) {
         foreach ($tokens[$entity] as $token) {
-          if (!self::isHtmlTokenInTableCell($token, $entity, $html)) {;
+          if (!self::isHtmlTokenInTableCell($token, $entity, $html)) {
+            ;
             return FALSE;
           }
         }
@@ -285,7 +286,7 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF
   public static function combineContributions($existing, $contribution, $separator) {
     foreach ($contribution as $field => $value) {
       $existing[$field] = isset($existing[$field]) ? $existing[$field] . $separator : '';
-      $existing[$field]  .= $value;
+      $existing[$field] .= $value;
     }
     return $existing;
   }
@@ -304,7 +305,8 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF
       return;
     }
     CRM_Core_Smarty::singleton()->assign('contact_aggregate', $contact['contact_aggregate']);
-    CRM_Core_Smarty::singleton()->assign('contributions', array_intersect_key($contributions, $contact['contribution_ids'][$groupBy][$groupByID]));
+    CRM_Core_Smarty::singleton()
+      ->assign('contributions', array_intersect_key($contributions, $contact['contribution_ids'][$groupBy][$groupByID]));
     CRM_Core_Smarty::singleton()->assign('contribution_aggregate', $contact['aggregates'][$groupBy][$groupByID]);
 
   }
index 30c3aec438d8d286bfe6f20ff54374bcd8de3c79..351022604c6a94adce51b67fc2bc253dbb68876b 100644 (file)
@@ -73,7 +73,10 @@ class CRM_Contribute_Form_Task_PickProfile extends CRM_Contribute_Form_Task {
     $validate = FALSE;
     //validations
     if (count($this->_contributionIds) > $this->_maxContributions) {
-      CRM_Core_Session::setStatus(ts("The maximum number of contributions you can select for Batch Update is %1. You have selected %2. Please select fewer contributions from your search results and try again.", array(1 => $this->_maxContributions, 2 => count($this->_contributionIds))), ts('Batch Update Error'), 'error');
+      CRM_Core_Session::setStatus(ts("The maximum number of contributions you can select for Batch Update is %1. You have selected %2. Please select fewer contributions from your search results and try again.", array(
+            1 => $this->_maxContributions,
+            2 => count($this->_contributionIds)
+          )), ts('Batch Update Error'), 'error');
       $validate = TRUE;
     }
 
@@ -101,7 +104,8 @@ class CRM_Contribute_Form_Task_PickProfile extends CRM_Contribute_Form_Task {
 
     $ufGroupElement = $this->add('select', 'uf_group_id', ts('Select Profile'),
       array(
-        '' => ts('- select profile -')) + $profiles, TRUE
+        '' => ts('- select profile -')
+      ) + $profiles, TRUE
     );
     $this->addDefaultButtons(ts('Continue'));
   }
index 86b42506f60f0edffffbe69404fe7577dca58752..911c23a1ab4d68521c736eba7376bcf84848f3e3 100644 (file)
@@ -122,10 +122,10 @@ AND    co.id IN ( $contribIDs )";
     );
 
     // build a row for each contribution id
-    $this->_rows   = array();
-    $attributes    = CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Contribution');
-    $defaults      = array();
-    $now           = date("m/d/Y");
+    $this->_rows = array();
+    $attributes = CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Contribution');
+    $defaults = array();
+    $now = date("m/d/Y");
     $paidByOptions = array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::paymentInstrument();
 
     while ($dao->fetch()) {
@@ -228,8 +228,8 @@ AND    co.id IN ( $contribIDs )";
 
     // get the missing pieces for each contribution
     $contribIDs = implode(',', $this->_contributionIds);
-    $details    = self::getDetails($contribIDs);
-    $template   = CRM_Core_Smarty::singleton();
+    $details = self::getDetails($contribIDs);
+    $template = CRM_Core_Smarty::singleton();
 
     // for each contribution id, we just call the baseIPN stuff
     foreach ($this->_rows as $row) {
@@ -268,7 +268,8 @@ AND    co.id IN ( $contribIDs )";
       // status is not pending
       if ($contribution->contribution_status_id != array_search('Pending',
           $contributionStatuses
-        )) {
+        )
+      ) {
         $transaction->commit();
         continue;
       }
index 41cf44531484eb922d6fe208e4eff4ad30772fb1..6e12590737dfce6ef2d80aac36eca3d10a88d52f 100644 (file)
@@ -106,8 +106,8 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form {
 
     if (!$this->_paymentProcessor['object']->isSupported('updateSubscriptionBillingInfo')) {
       CRM_Core_Error::fatal(ts("%1 processor doesn't support updating subscription billing details.",
-          array(1 => $this->_paymentProcessor['object']->_processorName)
-        ));
+        array(1 => $this->_paymentProcessor['object']->_processorName)
+      ));
     }
     $this->assign('paymentProcessor', $this->_paymentProcessor);
 
@@ -145,10 +145,16 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form {
     $this->_defaults = array();
 
     if ($this->_subscriptionDetails->contact_id) {
-      $fields  = array();
-      $names   = array(
-        'first_name', 'middle_name', 'last_name', "street_address-{$this->_bltID}", "city-{$this->_bltID}",
-        "postal_code-{$this->_bltID}", "country_id-{$this->_bltID}", "state_province_id-{$this->_bltID}",
+      $fields = array();
+      $names = array(
+        'first_name',
+        'middle_name',
+        'last_name',
+        "street_address-{$this->_bltID}",
+        "city-{$this->_bltID}",
+        "postal_code-{$this->_bltID}",
+        "country_id-{$this->_bltID}",
+        "state_province_id-{$this->_bltID}",
       );
       foreach ($names as $name) {
         $fields[$name] = 1;
@@ -419,7 +425,7 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form {
     }
 
     $session = CRM_Core_Session::singleton();
-    $userID  = $session->get('userID');
+    $userID = $session->get('userID');
     if ($userID && $status) {
       $session->setStatus($status, $msgTitle, $msgType);
     }
@@ -430,7 +436,7 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form {
       if (isset($tplParams))
         $session->set('resultParams', $tplParams);
       return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contribute/subscriptionstatus',
-                                                              "reset=1&task=billing&result={$result}"));
+        "reset=1&task=billing&result={$result}"));
     }
   }
 }
index f604f3450553165957e04a582ef93de74335726b..7f86dcd1cf50a5c35b94c42b5185febc02edc643 100644 (file)
@@ -104,7 +104,7 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Core_Form {
 
     if (!$this->_paymentProcessorObj->isSupported('changeSubscriptionAmount')) {
       $userAlert = "<span class='font-red'>" . ts('Updates made using this form will change the recurring contribution information stored in your CiviCRM database, but will NOT be sent to the payment processor. You must enter the same changes using the payment processor web site.',
-        array(1 => $this->_paymentProcessorObj->_processorName)) . '</span>';
+          array(1 => $this->_paymentProcessorObj->_processorName)) . '</span>';
       CRM_Core_Session::setStatus($userAlert, ts('Warning'), 'alert');
     }
 
@@ -149,7 +149,8 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Core_Form {
     // define the fields
     $this->addMoney('amount', ts('Recurring Contribution Amount'), TRUE,
       array(
-        'size' => 20), TRUE,
+        'size' => 20
+      ), TRUE,
       'currency', NULL, TRUE
     );
 
@@ -201,112 +202,115 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Core_Form {
     $params['subscriptionId'] = $this->_subscriptionDetails->subscription_id;
     $updateSubscription = TRUE;
     if ($this->_paymentProcessorObj->isSupported('changeSubscriptionAmount')) {
-        $updateSubscription = $this->_paymentProcessorObj->changeSubscriptionAmount($message, $params);
+      $updateSubscription = $this->_paymentProcessorObj->changeSubscriptionAmount($message, $params);
     }
     if (is_a($updateSubscription, 'CRM_Core_Error')) {
-        CRM_Core_Error::displaySessionError($updateSubscription);
-        $status = ts('Could not update the Recurring contribution details');
-        $msgTitle = ts('Update Error');
-        $msgType = 'error';
+      CRM_Core_Error::displaySessionError($updateSubscription);
+      $status = ts('Could not update the Recurring contribution details');
+      $msgTitle = ts('Update Error');
+      $msgType = 'error';
     }
     elseif ($updateSubscription) {
-        // save the changes
-        $result = CRM_Contribute_BAO_ContributionRecur::add($params);
-        $status = ts('Recurring contribution has been updated to: %1, every %2 %3(s) for %4 installments.',
-                     array(
-                           1 => CRM_Utils_Money::format($params['amount'], $this->_subscriptionDetails->currency),
-                           2 => $this->_subscriptionDetails->frequency_interval,
-                           3 => $this->_subscriptionDetails->frequency_unit,
-                           4 => $params['installments'],
-                           )
-                     );
-
-    $msgTitle = ts('Update Success');
-    $msgType = 'success';
-
-        $contactID = $this->_subscriptionDetails->contact_id;
-
-        if ($this->_subscriptionDetails->amount != $params['amount']) {
-            $message .= "<br /> " . ts("Recurring contribution amount has been updated from %1 to %2 for this subscription.",
-              array(
-                1 => CRM_Utils_Money::format($this->_subscriptionDetails->amount, $this->_subscriptionDetails->currency),
-                2 => CRM_Utils_Money::format($params['amount'], $this->_subscriptionDetails->currency),
-              )) . ' ';
-        }
-
-        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'])) . ' ';
-        }
+      // save the changes
+      $result = CRM_Contribute_BAO_ContributionRecur::add($params);
+      $status = ts('Recurring contribution has been updated to: %1, every %2 %3(s) for %4 installments.',
+        array(
+          1 => CRM_Utils_Money::format($params['amount'], $this->_subscriptionDetails->currency),
+          2 => $this->_subscriptionDetails->frequency_interval,
+          3 => $this->_subscriptionDetails->frequency_unit,
+          4 => $params['installments'],
+        )
+      );
+
+      $msgTitle = ts('Update Success');
+      $msgType = 'success';
+
+      $contactID = $this->_subscriptionDetails->contact_id;
+
+      if ($this->_subscriptionDetails->amount != $params['amount']) {
+        $message .= "<br /> " . ts("Recurring contribution amount has been updated from %1 to %2 for this subscription.",
+            array(
+              1 => CRM_Utils_Money::format($this->_subscriptionDetails->amount, $this->_subscriptionDetails->currency),
+              2 => CRM_Utils_Money::format($params['amount'], $this->_subscriptionDetails->currency),
+            )) . ' ';
+      }
 
-        $activityParams = array(
-            'source_contact_id' => $contactID,
-            'activity_type_id' => CRM_Core_OptionGroup::getValue('activity_type',
-            'Update Recurring Contribution',
-            'name'
-          ),
-          'subject' => ts('Recurring Contribution Updated'),
-          'details' => $message,
-          'activity_date_time' => date('YmdHis'),
-          'status_id' => CRM_Core_OptionGroup::getValue('activity_status',
-            'Completed',
-            'name'
-          ),
-        );
-        $session = CRM_Core_Session::singleton();
-        $cid = $session->get('userID');
+      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']
+            )) . ' ';
+      }
 
-        if ($cid) {
-          $activityParams['target_contact_id'][] = $activityParams['source_contact_id'];
-          $activityParams['source_contact_id'] = $cid;
-        }
-        CRM_Activity_BAO_Activity::create($activityParams);
-
-        if (!empty($params['is_notify'])) {
-          // send notification
-          if ($this->_subscriptionDetails->contribution_page_id) {
-            CRM_Core_DAO::commonRetrieveAll('CRM_Contribute_DAO_ContributionPage', 'id',
-              $this->_subscriptionDetails->contribution_page_id, $value, array(
-                'title',
-                'receipt_from_name',
-                'receipt_from_email',
-              )
-            );
-            $receiptFrom = '"' . CRM_Utils_Array::value('receipt_from_name', $value[$this->_subscriptionDetails->contribution_page_id]) . '" <' . $value[$this->_subscriptionDetails->contribution_page_id]['receipt_from_email'] . '>';
-          }
-          else {
-            $domainValues = CRM_Core_BAO_Domain::getNameAndEmail();
-            $receiptFrom = "$domainValues[0] <$domainValues[1]>";
-          }
-
-          list($donorDisplayName, $donorEmail) = CRM_Contact_BAO_Contact::getContactDetails($contactID);
-
-          $tplParams = array(
-            'recur_frequency_interval' => $this->_subscriptionDetails->frequency_interval,
-            'recur_frequency_unit' => $this->_subscriptionDetails->frequency_unit,
-            'amount' => CRM_Utils_Money::format($params['amount']),
-            'installments' => $params['installments'],
-          );
+      $activityParams = array(
+        'source_contact_id' => $contactID,
+        'activity_type_id' => CRM_Core_OptionGroup::getValue('activity_type',
+          'Update Recurring Contribution',
+          'name'
+        ),
+        'subject' => ts('Recurring Contribution Updated'),
+        'details' => $message,
+        'activity_date_time' => date('YmdHis'),
+        'status_id' => CRM_Core_OptionGroup::getValue('activity_status',
+          'Completed',
+          'name'
+        ),
+      );
+      $session = CRM_Core_Session::singleton();
+      $cid = $session->get('userID');
 
-          $tplParams['contact'] = array('display_name' => $donorDisplayName);
-          $tplParams['receipt_from_email'] = $receiptFrom;
-
-          $sendTemplateParams = array(
-            'groupName' => 'msg_tpl_workflow_contribution',
-            'valueName' => 'contribution_recurring_edit',
-            'contactId' => $contactID,
-            'tplParams' => $tplParams,
-            'isTest' => $this->_subscriptionDetails->is_test,
-            'PDFFilename' => 'receipt.pdf',
-            'from' => $receiptFrom,
-            'toName' => $donorDisplayName,
-            'toEmail' => $donorEmail,
+      if ($cid) {
+        $activityParams['target_contact_id'][] = $activityParams['source_contact_id'];
+        $activityParams['source_contact_id'] = $cid;
+      }
+      CRM_Activity_BAO_Activity::create($activityParams);
+
+      if (!empty($params['is_notify'])) {
+        // send notification
+        if ($this->_subscriptionDetails->contribution_page_id) {
+          CRM_Core_DAO::commonRetrieveAll('CRM_Contribute_DAO_ContributionPage', 'id',
+            $this->_subscriptionDetails->contribution_page_id, $value, array(
+              'title',
+              'receipt_from_name',
+              'receipt_from_email',
+            )
           );
-          list($sent) = CRM_Core_BAO_MessageTemplate::sendTemplate($sendTemplateParams);
+          $receiptFrom = '"' . CRM_Utils_Array::value('receipt_from_name', $value[$this->_subscriptionDetails->contribution_page_id]) . '" <' . $value[$this->_subscriptionDetails->contribution_page_id]['receipt_from_email'] . '>';
+        }
+        else {
+          $domainValues = CRM_Core_BAO_Domain::getNameAndEmail();
+          $receiptFrom = "$domainValues[0] <$domainValues[1]>";
         }
+
+        list($donorDisplayName, $donorEmail) = CRM_Contact_BAO_Contact::getContactDetails($contactID);
+
+        $tplParams = array(
+          'recur_frequency_interval' => $this->_subscriptionDetails->frequency_interval,
+          'recur_frequency_unit' => $this->_subscriptionDetails->frequency_unit,
+          'amount' => CRM_Utils_Money::format($params['amount']),
+          'installments' => $params['installments'],
+        );
+
+        $tplParams['contact'] = array('display_name' => $donorDisplayName);
+        $tplParams['receipt_from_email'] = $receiptFrom;
+
+        $sendTemplateParams = array(
+          'groupName' => 'msg_tpl_workflow_contribution',
+          'valueName' => 'contribution_recurring_edit',
+          'contactId' => $contactID,
+          'tplParams' => $tplParams,
+          'isTest' => $this->_subscriptionDetails->is_test,
+          'PDFFilename' => 'receipt.pdf',
+          'from' => $receiptFrom,
+          'toName' => $donorDisplayName,
+          'toEmail' => $donorEmail,
+        );
+        list($sent) = CRM_Core_BAO_MessageTemplate::sendTemplate($sendTemplateParams);
       }
+    }
 
     $session = CRM_Core_Session::singleton();
-    $userID  = $session->get('userID');
+    $userID = $session->get('userID');
     if ($userID && $status) {
       CRM_Core_Session::setStatus($status, $msgTitle, $msgType);
     }
@@ -315,7 +319,7 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Core_Form {
         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"));
+        "reset=1&task=update&result=1"));
     }
   }
 }
index 640b63b2699519a9544a9c7588809dcd4889b7da..fe1ece4e0ce40b550b3e4dce83670b11bc880b85 100644 (file)
@@ -66,7 +66,10 @@ class CRM_Contribute_Import_Form_DataSource extends CRM_Core_Form {
 
     $this->add('File', 'uploadFile', ts('Import Data File'), 'size=30 maxlength=255', TRUE);
     $this->setMaxFileSize($uploadFileSize);
-    $this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(1 => $uploadSize, 2 => $uploadFileSize)), 'maxfilesize', $uploadFileSize);
+    $this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(
+          1 => $uploadSize,
+          2 => $uploadFileSize
+        )), 'maxfilesize', $uploadFileSize);
     $this->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile');
     $this->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File');
 
@@ -85,9 +88,9 @@ class CRM_Contribute_Import_Form_DataSource extends CRM_Core_Form {
 
     //get the saved mapping details
     $mappingArray = CRM_Core_BAO_Mapping::getMappings(CRM_Core_OptionGroup::getValue('mapping_type',
-        'Import Contribution',
-        'name'
-      ));
+      'Import Contribution',
+      'name'
+    ));
     $this->assign('savedMapping', $mappingArray);
     $this->add('select', 'savedMapping', ts('Mapping Option'), array('' => ts('- select -')) + $mappingArray);
     $this->addElement('submit', 'loadMapping', ts('Load Mapping'), NULL, array('onclick' => 'checkSelect()'));
@@ -100,7 +103,7 @@ class CRM_Contribute_Import_Form_DataSource extends CRM_Core_Form {
     $this->setDefaults(array(
       'onDuplicate' =>
         CRM_Import_Parser::DUPLICATE_SKIP,
-      ));
+    ));
 
     //contact types option
     $contactOptions = array();
@@ -127,7 +130,7 @@ class CRM_Contribute_Import_Form_DataSource extends CRM_Core_Form {
     $this->setDefaults(array(
       'contactType' =>
         CRM_Import_Parser::CONTACT_INDIVIDUAL,
-      ));
+    ));
 
     //build date formats
     CRM_Core_Form_Date::buildAllowedDateFormats($this);
@@ -155,12 +158,12 @@ class CRM_Contribute_Import_Form_DataSource extends CRM_Core_Form {
   public function postProcess() {
     $this->controller->resetPage('MapField');
 
-    $fileName         = $this->controller->exportValue($this->_name, 'uploadFile');
+    $fileName = $this->controller->exportValue($this->_name, 'uploadFile');
     $skipColumnHeader = $this->controller->exportValue($this->_name, 'skipColumnHeader');
-    $onDuplicate      = $this->controller->exportValue($this->_name, 'onDuplicate');
-    $contactType      = $this->controller->exportValue($this->_name, 'contactType');
-    $dateFormats      = $this->controller->exportValue($this->_name, 'dateFormats');
-    $savedMapping     = $this->controller->exportValue($this->_name, 'savedMapping');
+    $onDuplicate = $this->controller->exportValue($this->_name, 'onDuplicate');
+    $contactType = $this->controller->exportValue($this->_name, 'contactType');
+    $dateFormats = $this->controller->exportValue($this->_name, 'dateFormats');
+    $savedMapping = $this->controller->exportValue($this->_name, 'savedMapping');
 
     $this->set('onDuplicate', $onDuplicate);
     $this->set('contactType', $contactType);
index f9d84d3a4a767a31be69ba84174a4ba9075054fa..1f98ebf986f4c8240aa32776d1f8a7ce896e0ed0 100644 (file)
@@ -39,8 +39,6 @@
 class CRM_Contribute_Import_Form_MapField extends CRM_Import_Form_MapField {
 
 
-
-
   /**
    * Set variables up before form is built
    *
@@ -79,14 +77,23 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Import_Form_MapField {
 
       //modify field title only for update mode. CRM-3245
       foreach (array(
-        'contribution_id', 'invoice_id', 'trxn_id') as $key) {
+                 'contribution_id',
+                 'invoice_id',
+                 'trxn_id'
+               ) as $key) {
         $this->_mapperFields[$key] .= ' (match to contribution record)';
         $highlightedFields[] = $key;
       }
     }
     elseif ($this->_onDuplicate == CRM_Import_Parser::DUPLICATE_SKIP) {
       unset($this->_mapperFields['contribution_id']);
-      $highlightedFieldsArray = array('contribution_contact_id', 'email', 'first_name', 'last_name', 'external_identifier');
+      $highlightedFieldsArray = array(
+        'contribution_contact_id',
+        'email',
+        'first_name',
+        'last_name',
+        'external_identifier'
+      );
       foreach ($highlightedFieldsArray as $name) {
         $highlightedFields[] = $name;
       }
@@ -214,7 +221,7 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Import_Form_MapField {
     $warning = 0;
 
     for ($i = 0; $i < $this->_columnCount; $i++) {
-      $sel = & $this->addElement('hierselect', "mapper[$i]", ts('Mapper for Field %1', array(1 => $i)), NULL);
+      $sel = &$this->addElement('hierselect', "mapper[$i]", ts('Mapper for Field %1', array(1 => $i)), NULL);
       $jsSet = FALSE;
       if ($this->get('savedMapping')) {
         if (isset($mappingName[$i])) {
index 1877a10c18533a84d0d232e429e84229e57f31a2..9276f7fb77c490d4d5beff069740dd2de09b0f5a 100644 (file)
@@ -48,13 +48,13 @@ class CRM_Contribute_Import_Form_Preview extends CRM_Import_Form_Preview {
     $skipColumnHeader = $this->controller->exportValue('DataSource', 'skipColumnHeader');
 
     //get the data from the session
-    $dataValues           = $this->get('dataValues');
-    $mapper               = $this->get('mapper');
-    $softCreditFields     = $this->get('softCreditFields');
+    $dataValues = $this->get('dataValues');
+    $mapper = $this->get('mapper');
+    $softCreditFields = $this->get('softCreditFields');
     $mapperSoftCreditType = $this->get('mapperSoftCreditType');
-    $invalidRowCount      = $this->get('invalidRowCount');
-    $conflictRowCount     = $this->get('conflictRowCount');
-    $mismatchCount        = $this->get('unMatchCount');
+    $invalidRowCount = $this->get('invalidRowCount');
+    $conflictRowCount = $this->get('conflictRowCount');
+    $mismatchCount = $this->get('unMatchCount');
 
     //get the mapping name displayed if the mappingId is set
     $mappingId = $this->get('loadMappingId');
@@ -90,11 +90,15 @@ class CRM_Contribute_Import_Form_Preview extends CRM_Import_Form_Preview {
     }
 
     $properties = array(
-      'mapper', 'softCreditFields',
+      'mapper',
+      'softCreditFields',
       'mapperSoftCreditType',
-      'dataValues', 'columnCount',
-      'totalRowCount', 'validRowCount',
-      'invalidRowCount', 'conflictRowCount',
+      'dataValues',
+      'columnCount',
+      'totalRowCount',
+      'validRowCount',
+      'invalidRowCount',
+      'conflictRowCount',
       'downloadErrorRecordsUrl',
       'downloadConflictRecordsUrl',
       'downloadMismatchRecordsUrl',
@@ -112,11 +116,11 @@ class CRM_Contribute_Import_Form_Preview extends CRM_Import_Form_Preview {
    * @return void
    */
   public function postProcess() {
-    $fileName         = $this->controller->exportValue('DataSource', 'uploadFile');
+    $fileName = $this->controller->exportValue('DataSource', 'uploadFile');
     $skipColumnHeader = $this->controller->exportValue('DataSource', 'skipColumnHeader');
-    $invalidRowCount  = $this->get('invalidRowCount');
+    $invalidRowCount = $this->get('invalidRowCount');
     $conflictRowCount = $this->get('conflictRowCount');
-    $onDuplicate      = $this->get('onDuplicate');
+    $onDuplicate = $this->get('onDuplicate');
     $mapperSoftCreditType = $this->get('mapperSoftCreditType');
 
     $config = CRM_Core_Config::singleton();
index 9b8ee3da51dc1cf821b055b423153cd1bb58a5c7..0dd9e0bbbe0a55313c7e55fc5f21c93bad936e32 100644 (file)
@@ -105,7 +105,25 @@ class CRM_Contribute_Import_Form_Summary extends CRM_Import_Form_Summary {
     }
     $this->assign('dupeActionString', $dupeActionString);
 
-    $properties = array('totalRowCount', 'validRowCount', 'invalidRowCount', 'validSoftCreditRowCount', 'invalidSoftCreditRowCount', 'conflictRowCount', 'downloadConflictRecordsUrl', 'downloadErrorRecordsUrl', 'duplicateRowCount', 'downloadDuplicateRecordsUrl', 'downloadMismatchRecordsUrl', 'groupAdditions', 'unMatchCount', 'validPledgePaymentRowCount', 'invalidPledgePaymentRowCount', 'downloadPledgePaymentErrorRecordsUrl', 'downloadSoftCreditErrorRecordsUrl');
+    $properties = array(
+      'totalRowCount',
+      'validRowCount',
+      'invalidRowCount',
+      'validSoftCreditRowCount',
+      'invalidSoftCreditRowCount',
+      'conflictRowCount',
+      'downloadConflictRecordsUrl',
+      'downloadErrorRecordsUrl',
+      'duplicateRowCount',
+      'downloadDuplicateRecordsUrl',
+      'downloadMismatchRecordsUrl',
+      'groupAdditions',
+      'unMatchCount',
+      'validPledgePaymentRowCount',
+      'invalidPledgePaymentRowCount',
+      'downloadPledgePaymentErrorRecordsUrl',
+      'downloadSoftCreditErrorRecordsUrl'
+    );
     foreach ($properties as $property) {
       $this->assign($property, $this->get($property));
     }
index c886e59b4d8a2f20c960b604263a5ca267d04d2a..cba249edf45911c8ae97aa90d51781b3ac63465d 100644 (file)
@@ -32,7 +32,6 @@
  * $Id$
  *
  */
-
 abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser {
 
   /**
@@ -345,7 +344,8 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser {
       }
       if ($this->_invalidRowCount) {
         // removed view url for invlaid contacts
-        $headers = array_merge(array(ts('Line Number'),
+        $headers = array_merge(array(
+            ts('Line Number'),
             ts('Reason'),
           ),
           $customHeaders
@@ -356,7 +356,8 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser {
 
       if ($this->_invalidPledgePaymentRowCount) {
         // removed view url for invlaid contacts
-        $headers = array_merge(array(ts('Line Number'),
+        $headers = array_merge(array(
+            ts('Line Number'),
             ts('Reason'),
           ),
           $customHeaders
@@ -367,7 +368,8 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser {
 
       if ($this->_invalidSoftCreditRowCount) {
         // removed view url for invlaid contacts
-        $headers = array_merge(array(ts('Line Number'),
+        $headers = array_merge(array(
+            ts('Line Number'),
             ts('Reason'),
           ),
           $customHeaders
@@ -377,7 +379,8 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser {
       }
 
       if ($this->_conflictCount) {
-        $headers = array_merge(array(ts('Line Number'),
+        $headers = array_merge(array(
+            ts('Line Number'),
             ts('Reason'),
           ),
           $customHeaders
@@ -386,7 +389,8 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser {
         self::exportCSV($this->_conflictFileName, $headers, $this->_conflicts);
       }
       if ($this->_duplicateCount) {
-        $headers = array_merge(array(ts('Line Number'),
+        $headers = array_merge(array(
+            ts('Line Number'),
             ts('View Contribution URL'),
           ),
           $customHeaders
index 67e5daf67da79d7dbfb2cd01ca014a0c78921a35..3ac33c18556f6771736abdfbc4162d9eb5913d7b 100644 (file)
@@ -273,16 +273,16 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa
     foreach ($params as $key => $val) {
       if ($val) {
         switch ($key) {
-        case 'receive_date':
-        case 'cancel_date':
-        case 'receipt_date':
-        case 'thankyou_date':
-          $params[$key] = CRM_Utils_Date::formatDate($params[$key], $dateType);
-          break;
+          case 'receive_date':
+          case 'cancel_date':
+          case 'receipt_date':
+          case 'thankyou_date':
+            $params[$key] = CRM_Utils_Date::formatDate($params[$key], $dateType);
+            break;
 
-        case 'pledge_payment':
-          $params[$key] = CRM_Utils_String::strtobool($val);
-          break;
+          case 'pledge_payment':
+            $params[$key] = CRM_Utils_String::strtobool($val);
+            break;
 
         }
         if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($key)) {
@@ -501,7 +501,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa
         // Using new Dedupe rule.
         $ruleParams = array(
           'contact_type' => $this->_contactType,
-          'used'         => 'Unsupervised',
+          'used' => 'Unsupervised',
         );
         $fieldsArray = CRM_Dedupe_BAO_Rule::dedupeRuleFields($ruleParams);
         $disp = NULL;
index 36af5e6983e5ac4b6273ca535bc36d7581e3c618..3523be51657b4a0adedc93544974227e1f1faacd 100644 (file)
@@ -119,7 +119,7 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info {
    */
   public function getUserDashboardElement() {
     return array(
-    'name' => ts('Contributions'),
+      'name' => ts('Contributions'),
       'title' => ts('Your Contribution(s)'),
       'perm' => array('make online contributions'),
       'weight' => 10,
@@ -139,7 +139,7 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info {
    */
   public function registerTab() {
     return array(
-    'title' => ts('Contributions'),
+      'title' => ts('Contributions'),
       'url' => 'contribution',
       'weight' => 20,
     );
index 357c214e084e3c882417edac17a8fcae0699563c..f5c9f504c78209916dc23c9f2dfb702c282e64ab 100644 (file)
@@ -288,19 +288,21 @@ class CRM_Contribute_Page_ContributionPage extends CRM_Core_Page {
     );
 
     // set breadcrumb to append to 2nd layer pages
-    $breadCrumb = array(array(
-    'title' => ts('Manage Contribution Pages'),
+    $breadCrumb = array(
+      array(
+        'title' => ts('Manage Contribution Pages'),
         'url' => CRM_Utils_System::url(CRM_Utils_System::currentPath(),
           'reset=1'
         ),
-      ));
+      )
+    );
 
     // what action to take ?
     if ($action & CRM_Core_Action::ADD) {
       $session = CRM_Core_Session::singleton();
       $session->pushUserContext(CRM_Utils_System::url(CRM_Utils_System::currentPath(),
-          'action=browse&reset=1'
-        ));
+        'action=browse&reset=1'
+      ));
 
       $controller = new CRM_Contribute_Controller_ContributionPage(NULL, $action);
       CRM_Utils_System::setTitle(ts('Manage Contribution Page'));
@@ -331,8 +333,8 @@ class CRM_Contribute_Page_ContributionPage extends CRM_Core_Page {
 
       $session = CRM_Core_Session::singleton();
       $session->pushUserContext(CRM_Utils_System::url(CRM_Utils_System::currentPath(),
-          'reset=1&action=browse'
-        ));
+        'reset=1&action=browse'
+      ));
 
       $id = CRM_Utils_Request::retrieve('id', 'Positive',
         $this, FALSE, 0
@@ -564,8 +566,8 @@ ORDER BY title asc
    */
   public function whereClause(&$params, $sortBy = TRUE) {
     // @todo Unused local variable can be safely removed.
-    $values    = $clauses = array();
-    $title     = $this->get('title');
+    $values = $clauses = array();
+    $title = $this->get('title');
     $createdId = $this->get('cid');
 
     if ($createdId) {
index 0f85bac363d48784fff4cb6dbcd76f25423019fd..624f6faa967d0fdd85c98e26574f300148c1baa8 100644 (file)
@@ -72,9 +72,9 @@ class CRM_Contribute_Page_ContributionRecur extends CRM_Core_Page {
   }
 
   public function preProcess() {
-    $context          = CRM_Utils_Request::retrieve('context', 'String', $this);
-    $this->_action    = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'view');
-    $this->_id        = CRM_Utils_Request::retrieve('id', 'Positive', $this);
+    $context = CRM_Utils_Request::retrieve('context', 'String', $this);
+    $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'view');
+    $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
     $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
     $this->assign('contactId', $this->_contactId);
 
index 10c23d773a9439d66ea04d1f6417657b84850bf1..3a8030d3cd8abef97b6f164f2103374936240bcc 100644 (file)
@@ -47,15 +47,18 @@ class CRM_Contribute_Page_DashBoard extends CRM_Core_Page {
   public function preProcess() {
     CRM_Utils_System::setTitle(ts('CiviContribute'));
 
-    $status      = array('Valid', 'Cancelled');
-    $prefixes    = array('start', 'month', 'year');
-    $startDate   = NULL;
+    $status = array('Valid', 'Cancelled');
+    $prefixes = array('start', 'month', 'year');
+    $startDate = NULL;
     $startToDate = $monthToDate = $yearToDate = array();
 
     //get contribution dates.
     $dates = CRM_Contribute_BAO_Contribution::getContributionDates();
     foreach (array(
-      'now', 'yearDate', 'monthDate') as $date) {
+               'now',
+               'yearDate',
+               'monthDate'
+             ) as $date) {
       $$date = $dates[$date];
     }
     // fiscal years end date
@@ -124,7 +127,8 @@ class CRM_Contribute_Page_DashBoard extends CRM_Core_Page {
     $chartForm->setEmbedded(TRUE);
     $chartForm->process();
     $chartForm->run();
-    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'templates/CRM/Contribute/Page/DashBoard.js', 1, 'html-header');
+    CRM_Core_Resources::singleton()
+      ->addScriptFile('civicrm', 'templates/CRM/Contribute/Page/DashBoard.js', 1, 'html-header');
 
     return parent::run();
   }
index 56850757bccc93905e7777e4e87483803650481c..139d38c3adc28162eef73b10a43b9a3abdc08ec2 100644 (file)
@@ -171,7 +171,7 @@ class CRM_Contribute_Page_ManagePremiums extends CRM_Core_Page_Basic {
         $dao->id
       );
       //Financial Type
-      if (!empty($dao->financial_type_id) ) {
+      if (!empty($dao->financial_type_id)) {
         require_once 'CRM/Core/DAO.php';
         $premiums[$dao->id]['financial_type_id'] = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialType', $dao->financial_type_id, 'name');
       }
index e9f450866a3109ccc3414756f079f4c1e1c54442..b669f78960c99800ba8c8d745587042e56453d20 100644 (file)
@@ -136,9 +136,9 @@ class CRM_Contribute_Page_Premium extends CRM_Core_Page_Basic {
     $pageID = CRM_Utils_Request::retrieve('id', 'Positive',
       $this, FALSE, 0
     );
-    $dao               = new CRM_Contribute_DAO_Premium();
+    $dao = new CRM_Contribute_DAO_Premium();
     $dao->entity_table = 'civicrm_contribution_page';
-    $dao->entity_id    = $pageID;
+    $dao->entity_id = $pageID;
     $dao->find(TRUE);
     $premiumID = $dao->id;
     $this->assign('products', FALSE);
index 6482600b67e99fc18535ad9d4f9e1014ba9649cc..a691613d9839641f99942d8e3f5830ab20d3bf39 100644 (file)
@@ -32,7 +32,6 @@
  * $Id$
  *
  */
-
 class CRM_Contribute_Page_SubscriptionStatus extends CRM_Core_Page {
 
   /**
@@ -42,14 +41,14 @@ class CRM_Contribute_Page_SubscriptionStatus extends CRM_Core_Page {
    * return null
    */
   public function run() {
-    $task    = CRM_Utils_Request::retrieve('task', 'String', CRM_Core_DAO::$_nullObject);
-    $result  = CRM_Utils_Request::retrieve('result', 'Integer', CRM_Core_DAO::$_nullObject);
+    $task = CRM_Utils_Request::retrieve('task', 'String', CRM_Core_DAO::$_nullObject);
+    $result = CRM_Utils_Request::retrieve('result', 'Integer', CRM_Core_DAO::$_nullObject);
 
     $this->assign('task', $task);
     $this->assign('result', $result);
 
     if ($task == 'billing') {
-      $session   = CRM_Core_Session::singleton();
+      $session = CRM_Core_Session::singleton();
       $tplParams = $session->get('resultParams');
       foreach ($tplParams as $key => $val) {
         $this->assign($key, $val);
index fce3a03764003808cdd9592a26fa019b52a5cb57..e65a9248120afb7942297900c7a07bfe2cd79d09 100644 (file)
@@ -90,7 +90,7 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page {
       }
       if (is_object($paymentProcessorObj) && $paymentProcessorObj->isSupported('updateSubscriptionBillingInfo')) {
         self::$_links[CRM_Core_Action::RENEW] = array(
-        'name' => ts('Change Billing Details'),
+          'name' => ts('Change Billing Details'),
           'title' => ts('Change Billing Details'),
           'url' => 'civicrm/contribute/updatebilling',
           'qs' => "reset=1&crid=%%crid%%&cid=%%cid%%&context={$context}",
@@ -113,7 +113,7 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page {
     list($annual['count'],
       $annual['amount'],
       $annual['avg']
-    ) = CRM_Contribute_BAO_Contribution::annual($this->_contactId);
+      ) = CRM_Contribute_BAO_Contribution::annual($this->_contactId);
     $this->assign('annual', $annual);
 
     $controller = new CRM_Core_Controller_Simple(
@@ -184,7 +184,7 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page {
       list($softCreditTotals['amount'],
         $softCreditTotals['avg'],
         $softCreditTotals['currency']
-      ) = CRM_Contribute_BAO_ContributionSoft::getSoftContributionTotals($this->_contactId, $isTest);
+        ) = CRM_Contribute_BAO_ContributionSoft::getSoftContributionTotals($this->_contactId, $isTest);
 
       $this->assign('softCredit', TRUE);
       $this->assign('softCreditRows', $softCreditList);
@@ -241,9 +241,9 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page {
   }
 
   public function preProcess() {
-    $context       = CRM_Utils_Request::retrieve('context', 'String', $this);
+    $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
-    $this->_id     = CRM_Utils_Request::retrieve('id', 'Positive', $this);
+    $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
 
     if ($context == 'standalone') {
       $this->_action = CRM_Core_Action::ADD;
@@ -251,7 +251,10 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page {
     else {
       $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, empty($this->_id));
       if (empty($this->_contactId)) {
-        $this->_contactId = civicrm_api3('contribution', 'getvalue', array('id' => $this->_id, 'return' => 'contact_id'));
+        $this->_contactId = civicrm_api3('contribution', 'getvalue', array(
+            'id' => $this->_id,
+            'return' => 'contact_id'
+          ));
       }
       $this->assign('contactId', $this->_contactId);
 
@@ -431,7 +434,7 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page {
         break;
 
       case 'fulltext':
-        $keyName   = '&qfKey';
+        $keyName = '&qfKey';
         $urlParams = 'force=1';
         $urlString = 'civicrm/contact/search/custom';
         if ($this->_action == CRM_Core_Action::UPDATE) {
index 1a63c013b8f776e08d5c3d78bfc53c572a8785a2..b403d2463e821a07397d1cfa68db4936855a16d0 100644 (file)
@@ -65,9 +65,9 @@ class CRM_Contribute_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBo
       $this->assign('honor', TRUE);
     }
 
-    $recur             = new CRM_Contribute_DAO_ContributionRecur();
+    $recur = new CRM_Contribute_DAO_ContributionRecur();
     $recur->contact_id = $this->_contactId;
-    $recur->is_test    = 0;
+    $recur->is_test = 0;
     $recur->find();
 
     $config = CRM_Core_Config::singleton();
index 8128236b90205eb6db5e0d746dc7eceefb7d595f..386975cb40326f32555f3479cf7aad4136aafd68 100644 (file)
@@ -62,10 +62,10 @@ class CRM_Contribute_PseudoConstant extends CRM_Core_PseudoConstant {
   private static $financialAccount;
 
   /**
-     * Contribution pages
-     * @var array
-     * @static
-     */
+   * Contribution pages
+   * @var array
+   * @static
+   */
   private static $contributionPageActive = NULL;
 
   /**
@@ -196,7 +196,7 @@ class CRM_Contribute_PseudoConstant extends CRM_Core_PseudoConstant {
   public static function flush($name = 'cache') {
     if (isset(self::$$name)) {
       self::$$name = NULL;
-   }
+    }
   }
 
   /**
@@ -279,8 +279,8 @@ class CRM_Contribute_PseudoConstant extends CRM_Core_PseudoConstant {
    * @static
    */
   public static function products($pageID = NULL) {
-    $products       = array();
-    $dao            = new CRM_Contribute_DAO_Product();
+    $products = array();
+    $dao = new CRM_Contribute_DAO_Product();
     $dao->is_active = 1;
     $dao->orderBy('id');
     $dao->find();
@@ -289,9 +289,9 @@ class CRM_Contribute_PseudoConstant extends CRM_Core_PseudoConstant {
       $products[$dao->id] = $dao->name;
     }
     if ($pageID) {
-      $dao               = new CRM_Contribute_DAO_Premium();
+      $dao = new CRM_Contribute_DAO_Premium();
       $dao->entity_table = 'civicrm_contribution_page';
-      $dao->entity_id    = $pageID;
+      $dao->entity_id = $pageID;
       $dao->find(TRUE);
       $premiumID = $dao->id;
 
index aed61ada1c2eea0dbdf28e100c42006b6482daf0..38f877bb645c873efd7158eb1a87f7f590672484 100644 (file)
@@ -180,9 +180,9 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C
     // submitted form values
     $this->_queryParams = &$queryParams;
 
-    $this->_single      = $single;
-    $this->_limit       = $limit;
-    $this->_context     = $context;
+    $this->_single = $single;
+    $this->_limit = $limit;
+    $this->_context = $context;
     $this->_compContext = $compContext;
 
     $this->_contributionClause = $contributionClause;
@@ -342,9 +342,9 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C
     $qfKey = $this->_key;
     $componentId = $componentContext = NULL;
     if ($this->_context != 'contribute') {
-      $qfKey            = CRM_Utils_Request::retrieve('key', 'String', CRM_Core_DAO::$_nullObject);
-      $componentId      = CRM_Utils_Request::retrieve('id', 'Positive', CRM_Core_DAO::$_nullObject);
-      $componentAction  = CRM_Utils_Request::retrieve('action', 'String', CRM_Core_DAO::$_nullObject);
+      $qfKey = CRM_Utils_Request::retrieve('key', 'String', CRM_Core_DAO::$_nullObject);
+      $componentId = CRM_Utils_Request::retrieve('id', 'Positive', CRM_Core_DAO::$_nullObject);
+      $componentAction = CRM_Utils_Request::retrieve('action', 'String', CRM_Core_DAO::$_nullObject);
       $componentContext = CRM_Utils_Request::retrieve('compContext', 'String', CRM_Core_DAO::$_nullObject);
 
       if (!$componentContext &&
@@ -477,7 +477,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C
         array(
           array(
             'name' => ts('Type'),
-            'sort'      => 'financial_type',
+            'sort' => 'financial_type',
             'direction' => CRM_Utils_Sort::DONTCARE,
           ),
           array(
index 353df9efc58adb49c17c0ef12e027689dee0b21e..c8960740497d2e78eeef0302fb9aecf2cb7f047a 100644 (file)
@@ -63,9 +63,9 @@ class CRM_Core_Action {
     RENEW = 32768,
     DETACH = 65536,
     REVERT = 131072,
-    CLOSE        = 262144,
-    REOPEN       = 524288,
-    MAX_ACTION   = 1048575;
+    CLOSE = 262144,
+    REOPEN = 524288,
+    MAX_ACTION = 1048575;
 
   //make sure MAX_ACTION = 2^n - 1 ( n = total number of actions )
 
@@ -74,7 +74,7 @@ class CRM_Core_Action {
    * bit manipulation operations so we can perform multiple
    * actions on the same object if needed
    *
-   * @var array $_names  type of variable name to action constant
+   * @var array $_names type of variable name to action constant
    *
    * @static
    */
@@ -94,8 +94,8 @@ class CRM_Core_Action {
     'renew' => self::RENEW,
     'detach' => self::DETACH,
     'revert' => self::REVERT,
-                           'close'         => self::CLOSE,
-                           'reopen'        => self::REOPEN,
+    'close' => self::CLOSE,
+    'reopen' => self::REOPEN,
   );
 
   /**
index ff5e4935e85e009f3501b2ecdc28541068c10916..db0f7be77b116d2e50b6706adfe3463d876c2e8f 100644 (file)
@@ -96,7 +96,7 @@ class CRM_Core_BAO_ActionSchedule extends CRM_Core_DAO_ActionSchedule {
   public static function getSelection($id = NULL) {
     $mapping = self::getMapping();
     $activityStatus = CRM_Core_PseudoConstant::activityStatus();
-    $activityType   = CRM_Core_PseudoConstant::activityType(TRUE, TRUE);
+    $activityType = CRM_Core_PseudoConstant::activityType(TRUE, TRUE);
 
     $participantStatus = CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label');
     $event = CRM_Event_PseudoConstant::event(NULL, FALSE, "( is_template IS NULL OR is_template != 1 )");
@@ -431,13 +431,13 @@ AND   cas.entity_value = $id AND
     $schedule = new CRM_Core_DAO_ActionSchedule();
     $schedule->id = $scheduleID;
 
-    $domain     = CRM_Core_BAO_Domain::getDomain();
-    $result     = NULL;
+    $domain = CRM_Core_BAO_Domain::getDomain();
+    $result = NULL;
     $hookTokens = array();
 
     if ($schedule->find(TRUE)) {
-      $body_text    = $schedule->body_text;
-      $body_html    = $schedule->body_html;
+      $body_text = $schedule->body_text;
+      $body_html = $schedule->body_html;
       $sms_body_text = $schedule->sms_body_text;
       $body_subject = $schedule->subject;
       if (!$body_text) {
@@ -489,7 +489,10 @@ AND   cas.entity_value = $id AND
 
       $smarty = CRM_Core_Smarty::singleton();
       foreach (array(
-          'text', 'html', 'sms_text') as $elem) {
+                 'text',
+                 'html',
+                 'sms_text'
+               ) as $elem) {
         $$elem = $smarty->fetch("string:{$$elem}");
       }
 
@@ -525,7 +528,11 @@ AND   cas.entity_value = $id AND
       if ($schedule->mode == 'SMS' or $schedule->mode == 'User_Preference') {
         $session = CRM_Core_Session::singleton();
         $userID = $session->get('userID') ? $session->get('userID') : $contactId;
-        $smsParams = array('To' => $phoneNumber, 'provider_id' => $schedule->sms_provider_id, 'activity_subject' => $messageSubject);
+        $smsParams = array(
+          'To' => $phoneNumber,
+          'provider_id' => $schedule->sms_provider_id,
+          'activity_subject' => $messageSubject
+        );
         $activityTypeID = CRM_Core_OptionGroup::getValue('activity_type',
           'SMS',
           'name'
@@ -716,12 +723,12 @@ AND   cas.entity_value = $id AND
         $tokenEntity = 'activity';
         $tokenFields = array('activity_id', 'activity_type', 'subject', 'details', 'activity_date_time');
         $extraSelect = ', ov.label as activity_type, e.id as activity_id';
-        $extraJoin   = "
+        $extraJoin = "
 INNER JOIN civicrm_option_group og ON og.name = 'activity_type'
 INNER JOIN civicrm_option_value ov ON e.activity_type_id = ov.value AND ov.option_group_id = og.id";
         $extraOn = ' AND e.is_current_revision = 1 AND e.is_deleted = 0 ';
         if ($actionSchedule->limit_to == 0) {
-          $extraJoin   = "
+          $extraJoin = "
 LEFT JOIN civicrm_option_group og ON og.name = 'activity_type'
 LEFT JOIN civicrm_option_value ov ON e.activity_type_id = ov.value AND ov.option_group_id = og.id";
         }
@@ -737,10 +744,25 @@ LEFT JOIN civicrm_option_value ov ON e.activity_type_id = ov.value AND ov.option
 
       if ($mapping->entity == 'civicrm_participant') {
         $tokenEntity = 'event';
-        $tokenFields = array('event_type', 'title', 'event_id', 'start_date', 'end_date', 'summary', 'description', 'location', 'info_url', 'registration_url', 'fee_amount', 'contact_email', 'contact_phone', 'balance');
+        $tokenFields = array(
+          'event_type',
+          'title',
+          'event_id',
+          'start_date',
+          'end_date',
+          'summary',
+          'description',
+          'location',
+          'info_url',
+          'registration_url',
+          'fee_amount',
+          'contact_email',
+          'contact_phone',
+          'balance'
+        );
         $extraSelect = ', ov.label as event_type, ev.title, ev.id as event_id, ev.start_date, ev.end_date, ev.summary, ev.description, address.street_address, address.city, address.state_province_id, address.postal_code, email.email as contact_email, phone.phone as contact_phone ';
 
-        $extraJoin   = "
+        $extraJoin = "
 INNER JOIN civicrm_event ev ON e.event_id = ev.id
 INNER JOIN civicrm_option_group og ON og.name = 'event_type'
 INNER JOIN civicrm_option_value ov ON ev.event_type_id = ov.value AND ov.option_group_id = og.id
@@ -750,7 +772,7 @@ LEFT  JOIN civicrm_email email ON email.id = lb.email_id
 LEFT  JOIN civicrm_phone phone ON phone.id = lb.phone_id
 ";
         if ($actionSchedule->limit_to == 0) {
-          $extraJoin   = "
+          $extraJoin = "
 LEFT JOIN civicrm_event ev ON e.event_id = ev.id
 LEFT JOIN civicrm_option_group og ON og.name = 'event_type'
 LEFT JOIN civicrm_option_value ov ON ev.event_type_id = ov.value AND ov.option_group_id = og.id
@@ -766,12 +788,12 @@ LEFT JOIN civicrm_phone phone ON phone.id = lb.phone_id
         $tokenEntity = 'membership';
         $tokenFields = array('fee', 'id', 'join_date', 'start_date', 'end_date', 'status', 'type');
         $extraSelect = ', 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';
-        $extraJoin   = '
+        $extraJoin = '
  INNER JOIN civicrm_membership_type mt ON e.membership_type_id = mt.id
  INNER JOIN civicrm_membership_status ms ON e.status_id = ms.id';
 
         if ($actionSchedule->limit_to == 0) {
-          $extraJoin   = '
+          $extraJoin = '
  LEFT JOIN civicrm_membership_type mt ON e.membership_type_id = mt.id
  LEFT JOIN civicrm_membership_status ms ON e.status_id = ms.id';
         }
@@ -843,7 +865,7 @@ WHERE reminder.action_schedule_id = %1 AND reminder.action_date_time IS NULL
           }
         }
 
-        $isError  = 0;
+        $isError = 0;
         $errorMsg = $toEmail = $toPhoneNumber = '';
 
         if ($actionSchedule->mode == 'SMS' or $actionSchedule->mode == 'User_Preference') {
@@ -897,7 +919,7 @@ WHERE reminder.action_schedule_id = %1 AND reminder.action_date_time IS NULL
             'subject' => $actionSchedule->title,
             'details' => $actionSchedule->body_html,
             'source_contact_id' =>
-            $session->get('userID') ? $session->get('userID') : $dao->contactID,
+              $session->get('userID') ? $session->get('userID') : $dao->contactID,
             'target_contact_id' => $dao->contactID,
             'activity_date_time' => date('YmdHis'),
             'status_id' => $activityStatusID,
@@ -1246,7 +1268,7 @@ LEFT JOIN {$reminderJoinClause}
       $isSendToAdditionalContacts = (!is_null($limitTo) && $limitTo == 0 && (!empty($addGroup) || !empty($addWhere))) ? TRUE : FALSE;
       if ($isSendToAdditionalContacts) {
         $contactTable = "civicrm_contact c";
-        $addSelect  = "SELECT c.id as contact_id, c.id as entity_id, 'civicrm_contact' as entity_table, {$actionSchedule->id} as action_schedule_id";
+        $addSelect = "SELECT c.id as contact_id, c.id as entity_id, 'civicrm_contact' as entity_table, {$actionSchedule->id} as action_schedule_id";
         $additionReminderClause = "civicrm_action_log reminder ON reminder.contact_id = c.id AND
           reminder.entity_id          = c.id AND
           reminder.entity_table       = 'civicrm_contact' AND
@@ -1313,7 +1335,12 @@ INNER JOIN {$reminderJoinClause}
 {$groupByClause}
 {$havingClause}";
 
-        $valsqlInsertValues = CRM_Core_DAO::executeQuery($sqlInsertValues, array(1 => array($actionSchedule->id, 'Integer')));
+        $valsqlInsertValues = CRM_Core_DAO::executeQuery($sqlInsertValues, array(
+            1 => array(
+              $actionSchedule->id,
+              'Integer'
+            )
+          ));
 
         $arrValues = array();
         while ($valsqlInsertValues->fetch()) {
index ec898336edc92776fd937602e0ca24b2948f692e..27edbc01cdfbf2bb68d7dd8637e279dc08afbd24 100644 (file)
@@ -380,7 +380,11 @@ class CRM_Core_BAO_Address extends CRM_Core_DAO_Address {
 
       if ($parseStreetAddress && !empty($params['street_address'])) {
         foreach (array(
-          'street_number', 'street_name', 'street_unit', 'street_number_suffix') as $fld) {
+                   'street_number',
+                   'street_name',
+                   'street_unit',
+                   'street_number_suffix'
+                 ) as $fld) {
           unset($params[$fld]);
         }
         // main parse string.
@@ -418,7 +422,14 @@ class CRM_Core_BAO_Address extends CRM_Core_DAO_Address {
     $config = CRM_Core_Config::singleton();
     foreach ($params as $name => $value) {
       if (in_array($name, array(
-        'is_primary', 'location_type_id', 'id', 'contact_id', 'is_billing', 'display', 'master_id'))) {
+        'is_primary',
+        'location_type_id',
+        'id',
+        'contact_id',
+        'is_billing',
+        'display',
+        'master_id'
+      ))) {
         continue;
       }
       elseif (!CRM_Utils_System::isNull($value)) {
@@ -500,7 +511,11 @@ class CRM_Core_BAO_Address extends CRM_Core_DAO_Address {
       // deprecate reference.
       if ($count > 1) {
         foreach (array(
-          'state', 'state_name', 'country', 'world_region') as $fld) {
+                   'state',
+                   'state_name',
+                   'country',
+                   'world_region'
+                 ) as $fld) {
           if (isset($address->$fld)) {
             unset($address->$fld);
           }
@@ -688,7 +703,7 @@ ORDER BY civicrm_address.is_primary DESC, civicrm_address.location_type_id DESC,
         $addressSequence[$key] = 'city_postal_code';
       }
       elseif (
-        in_array($field, array('country', 'state_province', 'city', 'postal_code'))
+      in_array($field, array('country', 'state_province', 'city', 'postal_code'))
       ) {
         unset($addressSequence[$key]);
       }
@@ -747,7 +762,10 @@ ORDER BY civicrm_address.is_primary DESC, civicrm_address.location_type_id DESC,
 
     $matches = array();
     if (in_array($locale, array(
-      'en_CA', 'fr_CA')) && preg_match('/^([A-Za-z0-9]+)[ ]*\-[ ]*/', $streetAddress, $matches)) {
+        'en_CA',
+        'fr_CA'
+      )) && preg_match('/^([A-Za-z0-9]+)[ ]*\-[ ]*/', $streetAddress, $matches)
+    ) {
       $parseFields['street_unit'] = $matches[1];
       // unset from rest of street address
       $streetAddress = preg_replace('/^([A-Za-z0-9]+)[ ]*\-[ ]*/', '', $streetAddress);
@@ -794,18 +812,53 @@ ORDER BY civicrm_address.is_primary DESC, civicrm_address.location_type_id DESC,
     // now get the street unit.
     // supportable street unit formats.
     $streetUnitFormats = array(
-      'APT', 'APARTMENT', 'BSMT', 'BASEMENT', 'BLDG', 'BUILDING',
-      'DEPT', 'DEPARTMENT', 'FL', 'FLOOR', 'FRNT', 'FRONT',
-      'HNGR', 'HANGER', 'LBBY', 'LOBBY', 'LOWR', 'LOWER',
-      'OFC', 'OFFICE', 'PH', 'PENTHOUSE', 'TRLR', 'TRAILER',
-      'UPPR', 'RM', 'ROOM', 'SIDE', 'SLIP', 'KEY',
-      'LOT', 'PIER', 'REAR', 'SPC', 'SPACE',
-      'STOP', 'STE', 'SUITE', 'UNIT', '#',
+      'APT',
+      'APARTMENT',
+      'BSMT',
+      'BASEMENT',
+      'BLDG',
+      'BUILDING',
+      'DEPT',
+      'DEPARTMENT',
+      'FL',
+      'FLOOR',
+      'FRNT',
+      'FRONT',
+      'HNGR',
+      'HANGER',
+      'LBBY',
+      'LOBBY',
+      'LOWR',
+      'LOWER',
+      'OFC',
+      'OFFICE',
+      'PH',
+      'PENTHOUSE',
+      'TRLR',
+      'TRAILER',
+      'UPPR',
+      'RM',
+      'ROOM',
+      'SIDE',
+      'SLIP',
+      'KEY',
+      'LOT',
+      'PIER',
+      'REAR',
+      'SPC',
+      'SPACE',
+      'STOP',
+      'STE',
+      'SUITE',
+      'UNIT',
+      '#',
     );
 
     // overwriting $streetUnitFormats for 'en_CA' and 'fr_CA' locale
     if (in_array($locale, array(
-      'en_CA', 'fr_CA'))) {
+      'en_CA',
+      'fr_CA'
+    ))) {
       $streetUnitFormats = array('APT', 'APP', 'SUITE', 'BUREAU', 'UNIT');
     }
     //@todo per CRM-14459 this regex picks up words with the string in them - e.g APT picks up
@@ -994,7 +1047,7 @@ SELECT is_primary,
     foreach (array_keys($rows) as $rowID) {
       // load complete address as array key
       $address =
-      trim($rows[$rowID]['street_address']) . trim($rows[$rowID]['city']) . trim($rows[$rowID]['state_province']) . trim($rows[$rowID]['postal_code']) . trim($rows[$rowID]['country']);
+        trim($rows[$rowID]['street_address']) . trim($rows[$rowID]['city']) . trim($rows[$rowID]['state_province']) . trim($rows[$rowID]['postal_code']) . trim($rows[$rowID]['country']);
       if (isset($rows[$rowID]['last_name'])) {
         $name = $rows[$rowID]['last_name'];
       }
@@ -1126,7 +1179,7 @@ SELECT is_primary,
 
     list($valid, $invalid, $duplicate,
       $saved, $relationshipIds
-    ) = CRM_Contact_BAO_Relationship::createMultiple($relationshipParams, $cid);
+      ) = CRM_Contact_BAO_Relationship::createMultiple($relationshipParams, $cid);
   }
 
   /**
@@ -1255,7 +1308,7 @@ SELECT is_primary,
       case 'world_region':
         return CRM_Core_PseudoConstant::worldRegion();
 
-      break;
+        break;
     }
     return CRM_Core_PseudoConstant::get(__CLASS__, $fieldName, $params, $context);
   }
index 64e77630f836bb1671432a209443d7870bc3c499..72043e6528c60111baee7c954c87dd429fe54781 100644 (file)
@@ -85,8 +85,8 @@ class CRM_Core_BAO_Block {
       $count = 1;
       foreach ($blockIds as $blockId) {
         $block = new $BAOString();
-        $block->id        = $blockId['id'];
-        $getBlocks        = self::retrieveBlock($block, $blockName);
+        $block->id = $blockId['id'];
+        $getBlocks = self::retrieveBlock($block, $blockName);
         $blocks[$count++] = array_pop($getBlocks);
       }
     }
@@ -233,9 +233,9 @@ class CRM_Core_BAO_Block {
       return NULL;
     }
 
-    $name           = ucfirst($blockName);
-    $contactId      = NULL;
-    $isPrimary      = $isBilling = TRUE;
+    $name = ucfirst($blockName);
+    $contactId = NULL;
+    $isPrimary = $isBilling = TRUE;
     $entityElements = $blocks = array();
 
     if ($entity) {
index 6339f9f12f39e73312933868c2ae98a770ab9790..a69e086e23e01594b0c27398857bf3eca3e1b466 100644 (file)
@@ -64,7 +64,7 @@ class CRM_Core_BAO_CMSUser {
     // Build an array of rows from UF users table.
     $rows = array();
     if ($config->userSystem->is_drupal == '1') {
-      $id   = 'uid';
+      $id = 'uid';
       $mail = 'mail';
       $name = 'name';
 
@@ -82,7 +82,7 @@ class CRM_Core_BAO_CMSUser {
       }
     }
     elseif ($config->userFramework == 'Joomla') {
-      $id   = 'id';
+      $id = 'id';
       $mail = 'email';
       $name = 'name';
       // TODO: Insert code here to populate $rows for Joomla;
@@ -98,13 +98,13 @@ class CRM_Core_BAO_CMSUser {
     set_time_limit(300);
 
     if ($config->userSystem->is_drupal == '1') {
-      $user            = new StdClass();
-      $uf              = $config->userFramework;
-      $contactCount    = 0;
-      $contactCreated  = 0;
+      $user = new StdClass();
+      $uf = $config->userFramework;
+      $contactCount = 0;
+      $contactCreated = 0;
       $contactMatching = 0;
       foreach ($rows as $row) {
-        $user->$id   = $row[$id];
+        $user->$id = $row[$id];
         $user->$mail = $row[$mail];
         $user->$name = $row[$name];
         $contactCount++;
@@ -132,24 +132,25 @@ class CRM_Core_BAO_CMSUser {
       $db->setQuery($query, 0, $limit);
       $users = $db->loadObjectList();
 
-      $user            = new StdClass();
-      $uf              = $config->userFramework;
-      $contactCount    = 0;
-      $contactCreated  = 0;
+      $user = new StdClass();
+      $uf = $config->userFramework;
+      $contactCount = 0;
+      $contactCreated = 0;
       $contactMatching = 0;
       for ($i = 0; $i < count($users); $i++) {
-        $user->$id   = $users[$i]->$id;
+        $user->$id = $users[$i]->$id;
         $user->$mail = $users[$i]->$mail;
         $user->$name = $users[$i]->$name;
         $contactCount++;
         if ($match = CRM_Core_BAO_UFMatch::synchronizeUFMatch($user,
-            $users[$i]->$id,
-            $users[$i]->$mail,
-            $uf,
-            1,
-            'Individual',
-            TRUE
-          )) {
+          $users[$i]->$id,
+          $users[$i]->$mail,
+          $uf,
+          1,
+          'Individual',
+          TRUE
+        )
+        ) {
           $contactCreated++;
         }
         else {
@@ -161,9 +162,9 @@ class CRM_Core_BAO_CMSUser {
       }
     }
     elseif ($config->userFramework == 'WordPress') {
-      $uf              = $config->userFramework;
-      $contactCount    = 0;
-      $contactCreated  = 0;
+      $uf = $config->userFramework;
+      $contactCount = 0;
+      $contactCreated = 0;
       $contactMatching = 0;
 
       global $wpdb;
@@ -173,13 +174,14 @@ class CRM_Core_BAO_CMSUser {
         $wpUserData = get_userdata($wpUserId);
         $contactCount++;
         if ($match = CRM_Core_BAO_UFMatch::synchronizeUFMatch($wpUserData,
-            $wpUserData->$id,
-            $wpUserData->$mail,
-            $uf,
-            1,
-            'Individual',
-            TRUE
-          )) {
+          $wpUserData->$id,
+          $wpUserData->$mail,
+          $uf,
+          1,
+          'Individual',
+          TRUE
+        )
+        ) {
           $contactCreated++;
         }
         else {
@@ -195,26 +197,26 @@ class CRM_Core_BAO_CMSUser {
     if ($is_interactive) {
       $status = ts('Synchronize Users to Contacts completed.');
       $status .= ' ' . ts('Checked one user record.',
-        array(
-          'count' => $contactCount,
-          'plural' => 'Checked %count user records.',
-        )
-      );
-      if ($contactMatching) {
-        $status .= ' ' . ts('Found one matching contact record.',
           array(
-            'count' => $contactMatching,
-            'plural' => 'Found %count matching contact records.',
+            'count' => $contactCount,
+            'plural' => 'Checked %count user records.',
           )
         );
+      if ($contactMatching) {
+        $status .= ' ' . ts('Found one matching contact record.',
+            array(
+              'count' => $contactMatching,
+              'plural' => 'Found %count matching contact records.',
+            )
+          );
       }
 
       $status .= ' ' . ts('Created one new contact record.',
-        array(
-          'count' => $contactCreated,
-          'plural' => 'Created %count new contact records.',
-        )
-      );
+          array(
+            'count' => $contactCreated,
+            'plural' => 'Created %count new contact records.',
+          )
+        );
       CRM_Core_Session::setStatus($status, ts('Saved'), 'success');
       CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin', 'reset=1'));
     }
@@ -242,9 +244,9 @@ class CRM_Core_BAO_CMSUser {
       isset($params['contactID'])
     ) {
       // create the UF Match record
-      $ufmatch['uf_id']      = $ufID;
+      $ufmatch['uf_id'] = $ufID;
       $ufmatch['contact_id'] = $params['contactID'];
-      $ufmatch['uf_name']    = $params[$mail];
+      $ufmatch['uf_name'] = $params[$mail];
       CRM_Core_BAO_UFMatch::create($ufmatch);
     }
 
@@ -269,8 +271,8 @@ class CRM_Core_BAO_CMSUser {
     $config = CRM_Core_Config::singleton();
     $showCMS = FALSE;
 
-    $isDrupal    = $config->userSystem->is_drupal;
-    $isJoomla    = ucfirst($config->userFramework) == 'Joomla' ? TRUE : FALSE;
+    $isDrupal = $config->userSystem->is_drupal;
+    $isJoomla = ucfirst($config->userFramework) == 'Joomla' ? TRUE : FALSE;
     $isWordPress = $config->userFramework == 'WordPress' ? TRUE : FALSE;
 
     //if CMS is configured for not to allow creating new CMS user,
@@ -356,8 +358,8 @@ class CRM_Core_BAO_CMSUser {
 
     $config = CRM_Core_Config::singleton();
 
-    $isDrupal    = $config->userSystem->is_drupal;
-    $isJoomla    = ucfirst($config->userFramework) == 'Joomla' ? TRUE : FALSE;
+    $isDrupal = $config->userSystem->is_drupal;
+    $isJoomla = ucfirst($config->userFramework) == 'Joomla' ? TRUE : FALSE;
     $isWordPress = $config->userFramework == 'WordPress' ? TRUE : FALSE;
 
     $errors = array();
@@ -431,8 +433,8 @@ class CRM_Core_BAO_CMSUser {
   public static function userExists(&$contact) {
     $config = CRM_Core_Config::singleton();
 
-    $isDrupal    = $config->userSystem->is_drupal;
-    $isJoomla    = ucfirst($config->userFramework) == 'Joomla' ? TRUE : FALSE;
+    $isDrupal = $config->userSystem->is_drupal;
+    $isJoomla = ucfirst($config->userFramework) == 'Joomla' ? TRUE : FALSE;
     $isWordPress = $config->userFramework == 'WordPress' ? TRUE : FALSE;
 
     if (!$isDrupal && !$isJoomla && !$isWordPress) {
@@ -501,8 +503,8 @@ class CRM_Core_BAO_CMSUser {
       $session = CRM_Core_Session::singleton();
       $session->pushUserContext(CRM_Utils_System::url('civicrm/admin', 'reset=1'));
       CRM_Core_Error::statusBounce(ts("Cannot connect to UF db via %1. Please check the CIVICRM_UF_DSN value in your civicrm.settings.php file",
-          array(1 => $db_uf->getMessage())
-        ));
+        array(1 => $db_uf->getMessage())
+      ));
     }
     $db_uf->query('/*!40101 SET NAMES utf8 */');
     return $db_uf;
index acbba504d391c35f2b9ac6b4ba74ea20be667229..5e4bb8c3014682e4c0c8d986f60082b6353112ee 100644 (file)
@@ -95,9 +95,9 @@ class CRM_Core_BAO_CustomGroup extends CRM_Core_DAO_CustomGroup {
       $extendsChildType = implode(CRM_Core_DAO::VALUE_SEPARATOR, $extendsChildType);
       if (CRM_Utils_Array::value(0, $params['extends']) == 'Relationship') {
         $extendsChildType = str_replace(array('_a_b', '_b_a'), array(
-            '',
-            '',
-          ), $extendsChildType);
+          '',
+          '',
+        ), $extendsChildType);
       }
       if (substr($extendsChildType, 0, 1) != CRM_Core_DAO::VALUE_SEPARATOR) {
         $extendsChildType = CRM_Core_DAO::VALUE_SEPARATOR . $extendsChildType .
@@ -2086,8 +2086,8 @@ SELECT IF( EXISTS(SELECT name FROM civicrm_contact_type WHERE name like %1), 1,
           $retValue = $value;
           break;
         }
-        // note that if its not text / textarea, the code falls thru and executes
-        // the below case also
+      // note that if its not text / textarea, the code falls thru and executes
+      // the below case also
       case 'StateProvince':
       case 'Country':
         $options = array();
index 7eb2998c563f536ebbfb86aba6f10c31f65e0973..7dd9eb4dcc3cb7f1eef4ced7031f346539797312 100644 (file)
@@ -155,7 +155,10 @@ WHERE  id = %1
       case 'Radio':
       case 'Autocomplete-Select':
         if (!in_array($dataType, array(
-          'Boolean', 'ContactReference'))) {
+          'Boolean',
+          'ContactReference'
+        ))
+        ) {
           $options = self::valuesByID($fieldId);
         }
     }
@@ -188,8 +191,8 @@ AND    g.id    = v.option_group_id";
     $dao = CRM_Core_DAO::executeQuery($query, $params);
     if ($dao->fetch()) {
       if (in_array($dao->dataType,
-          array('Int', 'Float', 'Money', 'Boolean')
-        )) {
+        array('Int', 'Float', 'Money', 'Boolean')
+      )) {
         $value = 0;
       }
       else {
@@ -255,7 +258,8 @@ WHERE  id = %2";
             $dataType = $dao->dataType;
           }
           $queryParams = array(
-            1 => array($params['value'],
+            1 => array(
+              $params['value'],
               $dataType,
             ),
             2 => array(
@@ -270,11 +274,11 @@ WHERE  id = %2";
         case 'CheckBox':
           $oldString = CRM_Core_DAO::VALUE_SEPARATOR . $oldValue . CRM_Core_DAO::VALUE_SEPARATOR;
           $newString = CRM_Core_DAO::VALUE_SEPARATOR . $params['value'] . CRM_Core_DAO::VALUE_SEPARATOR;
-          $query     = "
+          $query = "
 UPDATE {$dao->tableName}
 SET    {$dao->columnName} = REPLACE( {$dao->columnName}, %1, %2 )";
           $queryParams = array(
-          1 => array($oldString, 'String'),
+            1 => array($oldString, 'String'),
             2 => array($newString, 'String'),
           );
           break;
index dd6c1feedf67e0189583de45f2746ef93a722e8a..35fee5df4c0a2c3ff723ee1876c1b7af5f1ab41d 100644 (file)
@@ -146,13 +146,13 @@ class CRM_Core_BAO_CustomQuery {
     $this->_ids = &$ids;
     $this->_locationSpecificCustomFields = $locationSpecificFields;
 
-    $this->_select      = array();
-    $this->_element     = array();
-    $this->_tables      = array();
+    $this->_select = array();
+    $this->_element = array();
+    $this->_tables = array();
     $this->_whereTables = array();
-    $this->_where       = array();
-    $this->_qill        = array();
-    $this->_options     = array();
+    $this->_where = array();
+    $this->_qill = array();
+    $this->_options = array();
 
     $this->_fields = array();
     $this->_contactSearch = $contactSearch;
@@ -164,7 +164,7 @@ class CRM_Core_BAO_CustomQuery {
     // initialize the field array
     $tmpArray = array_keys($this->_ids);
     $idString = implode(',', $tmpArray);
-    $query    = "
+    $query = "
 SELECT f.id, f.label, f.data_type,
        f.html_type, f.is_search_range,
        f.option_group_id, f.custom_group_id,
@@ -357,7 +357,10 @@ SELECT label, value
         if (is_array($value) && !$field['is_search_range']) {
           $isSerialized = CRM_Core_BAO_CustomField::isSerialized($field);
           $wildcard = $isSerialized ? $wildcard : TRUE;
-          $options = CRM_Utils_Array::value('values', civicrm_api3('contact', 'getoptions', array('field' => $name, 'context' => 'search'), array()));
+          $options = CRM_Utils_Array::value('values', civicrm_api3('contact', 'getoptions', array(
+                'field' => $name,
+                'context' => 'search'
+              ), array()));
           $qillValue = '';
           $sqlOP = $wildcard ? ' OR ' : ' AND ';
           $sqlValue = array();
@@ -406,7 +409,7 @@ SELECT label, value
               if ($wildcard) {
                 $val = $strtolower(CRM_Core_DAO::escapeString($val));
                 $val = "%$val%";
-                $op  = 'LIKE';
+                $op = 'LIKE';
               }
 
               //FIX for custom data query fired against no value(NULL/NOT NULL)
@@ -577,7 +580,8 @@ SELECT label, value
       }
     }
 
-    return array(implode(' , ', $this->_select),
+    return array(
+      implode(' , ', $this->_select),
       implode(' ', $this->_tables),
       $whereStr,
     );
index d11d107200571e55cd05bfecd206a93eca92a711..0ae0c30f478829d7141a8ce33e23b7291834799d 100644 (file)
@@ -86,10 +86,10 @@ class CRM_Core_BAO_CustomValue extends CRM_Core_DAO {
         $mulValues = explode(',', $value);
         foreach ($mulValues as $key => $state) {
           $valid = array_key_exists(strtolower(trim($state)),
-            array_change_key_case(array_flip(CRM_Core_PseudoConstant::stateProvinceAbbreviation()), CASE_LOWER)
-          ) || array_key_exists(strtolower(trim($state)),
-            array_change_key_case(array_flip(CRM_Core_PseudoConstant::stateProvince()), CASE_LOWER)
-          );
+              array_change_key_case(array_flip(CRM_Core_PseudoConstant::stateProvinceAbbreviation()), CASE_LOWER)
+            ) || array_key_exists(strtolower(trim($state)),
+              array_change_key_case(array_flip(CRM_Core_PseudoConstant::stateProvince()), CASE_LOWER)
+            );
           if (!$valid) {
             break;
           }
@@ -103,10 +103,10 @@ class CRM_Core_BAO_CustomValue extends CRM_Core_DAO {
         $mulValues = explode(',', $value);
         foreach ($mulValues as $key => $country) {
           $valid = array_key_exists(strtolower(trim($country)),
-            array_change_key_case(array_flip(CRM_Core_PseudoConstant::countryIsoCode()), CASE_LOWER)
-          ) || array_key_exists(strtolower(trim($country)),
-            array_change_key_case(array_flip(CRM_Core_PseudoConstant::country()), CASE_LOWER)
-          );
+              array_change_key_case(array_flip(CRM_Core_PseudoConstant::countryIsoCode()), CASE_LOWER)
+            ) || array_key_exists(strtolower(trim($country)),
+              array_change_key_case(array_flip(CRM_Core_PseudoConstant::country()), CASE_LOWER)
+            );
           if (!$valid) {
             break;
           }
index 55e93630a58e6a33dee7c1912a9ac436441c07a2..69f2106e6b4ff8f3f2e53920d482704722803141 100644 (file)
@@ -48,29 +48,29 @@ class CRM_Core_BAO_CustomValueTable {
 
     foreach ($customParams as $tableName => $tables) {
       foreach ($tables as $index => $fields) {
-        $sqlOP      = NULL;
-        $hookID     = NULL;
-        $hookOP     = NULL;
-        $entityID   = NULL;
+        $sqlOP = NULL;
+        $hookID = NULL;
+        $hookOP = NULL;
+        $entityID = NULL;
         $isMultiple = FALSE;
-        $set        = array();
-        $params     = array();
-        $count      = 1;
+        $set = array();
+        $params = array();
+        $count = 1;
         foreach ($fields as $field) {
           if (!$sqlOP) {
-            $entityID   = $field['entity_id'];
-            $hookID     = $field['custom_group_id'];
+            $entityID = $field['entity_id'];
+            $hookID = $field['custom_group_id'];
             $isMultiple = $field['is_multiple'];
             if (array_key_exists('id', $field)) {
-              $sqlOP          = "UPDATE $tableName ";
-              $where          = " WHERE  id = %{$count}";
+              $sqlOP = "UPDATE $tableName ";
+              $where = " WHERE  id = %{$count}";
               $params[$count] = array($field['id'], 'Integer');
               $count++;
               $hookOP = 'edit';
             }
             else {
-              $sqlOP  = "INSERT INTO $tableName ";
-              $where  = NULL;
+              $sqlOP = "INSERT INTO $tableName ";
+              $where = NULL;
               $hookOP = 'create';
             }
           }
@@ -227,9 +227,9 @@ class CRM_Core_BAO_CustomValueTable {
             $params[$count] = array($entityID, 'Integer');
             $count++;
 
-            $fieldNames  = implode(',', array_keys($set));
+            $fieldNames = implode(',', array_keys($set));
             $fieldValues = implode(',', array_values($set));
-            $query       = "$sqlOP ( $fieldNames ) VALUES ( $fieldValues )";
+            $query = "$sqlOP ( $fieldNames ) VALUES ( $fieldValues )";
             // for multiple values we dont do on duplicate key update
             if (!$isMultiple) {
               $query .= " ON DUPLICATE KEY UPDATE $setClause";
@@ -518,8 +518,8 @@ AND    $cond
         $fieldID = (int ) $customFieldInfo[0];
         if (CRM_Utils_Type::escape($fieldID, 'Integer', FALSE) === NULL) {
           return CRM_Core_Error::createAPIError(ts('field ID needs to be of type Integer for index %1',
-              array(1 => $fieldID)
-            ));
+            array(1 => $fieldID)
+          ));
         }
         if (!array_key_exists($fieldID, $fieldValues)) {
           $fieldValues[$fieldID] = array();
@@ -582,11 +582,11 @@ AND    cf.id IN ( $fieldIDList )
         // Ensure that value is of the right data type
         elseif (CRM_Utils_Type::escape($fieldValue['value'], $dataType, FALSE) === NULL) {
           return CRM_Core_Error::createAPIError(ts('value: %1 is not of the right field data type: %2',
-              array(
-                1 => $fieldValue['value'],
-                2 => $dao->data_type,
-              )
-            ));
+            array(
+              1 => $fieldValue['value'],
+              2 => $dao->data_type,
+            )
+          ));
         }
 
         $cvParam = array(
@@ -667,8 +667,8 @@ AND    cf.id IN ( $fieldIDList )
         $idx = substr($n, 7);
         if (CRM_Utils_Type::escape($idx, 'Integer', FALSE) === NULL) {
           return CRM_Core_Error::createAPIError(ts('field ID needs to be of type Integer for index %1',
-              array(1 => $idx)
-            ));
+            array(1 => $idx)
+          ));
         }
         $fieldIDs[] = (int ) $idx;
       }
index d725b8c3e1be0a8431d92f44292a6b4eadb40419..5cc3ee42189eb6475ca742fcfe61451074b4b4fd 100644 (file)
@@ -160,7 +160,10 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard {
    */
   public static function initializeDashlets() {
     $dashlets = array();
-    $getDashlets = civicrm_api3("Dashboard", "get", array('domain_id' => CRM_Core_Config::domainID(), 'option.limit' => 0));
+    $getDashlets = civicrm_api3("Dashboard", "get", array(
+        'domain_id' => CRM_Core_Config::domainID(),
+        'option.limit' => 0
+      ));
     $contactID = CRM_Core_Session::singleton()->get('userID');
     $allDashlets = CRM_Utils_Array::index(array('name'), $getDashlets['values']);
     $defaultDashlets = array();
@@ -177,7 +180,8 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard {
       foreach ($defaultDashlets as $id => $defaultDashlet) {
         $dashboard_id = $defaultDashlet['dashboard_id'];
         if (!self::checkPermission($getDashlets['values'][$dashboard_id]['permission'],
-                                   $getDashlets['values'][$dashboard_id]['permission_operator'])) {
+          $getDashlets['values'][$dashboard_id]['permission_operator'])
+        ) {
           continue;
         }
         else {
@@ -224,7 +228,10 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard {
 
         // hack to handle case permissions
         if (!$componentName && in_array($key, array(
-          'access my cases and activities', 'access all cases and activities'))) {
+            'access my cases and activities',
+            'access all cases and activities'
+          ))
+        ) {
           $componentName = 'CiviCase';
         }
 
@@ -287,8 +294,8 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard {
     // build the content
     $dao = new CRM_Contact_DAO_DashboardContact();
 
-    $session           = CRM_Core_Session::singleton();
-    $dao->contact_id   = $session->get('userID');
+    $session = CRM_Core_Session::singleton();
+    $dao->contact_id = $session->get('userID');
     $dao->dashboard_id = $dashletID;
     $dao->find(TRUE);
 
@@ -474,10 +481,11 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard {
     }
     return $url;
   }
+
   /**
    * Update contact dashboard with new dashlet
    *
-   * @param object: $dashlet
+   * @param object : $dashlet
    *
    * @return void
    * @static
index a1777447581519042ffe173c94784d933a1c8379..875e202c24f1f4c7769e519b64eb365e1d088e77 100644 (file)
@@ -53,7 +53,7 @@ class CRM_Core_BAO_Discount extends CRM_Core_DAO_Discount {
   public static function del($entityId, $entityTable) {
     // delete all discount records with the selected discounted id
     $discount = new CRM_Core_DAO_Discount();
-    $discount->entity_id    = $entityId;
+    $discount->entity_id = $entityId;
     $discount->entity_table = $entityTable;
     if ($discount->delete()) {
       return TRUE;
@@ -94,9 +94,9 @@ class CRM_Core_BAO_Discount extends CRM_Core_DAO_Discount {
    *   option group Ids associated with discount
    */
   public static function getOptionGroup($entityId, $entityTable) {
-    $optionGroupIDs    = array();
+    $optionGroupIDs = array();
     $dao = new CRM_Core_DAO_Discount();
-    $dao->entity_id    = $entityId;
+    $dao->entity_id = $entityId;
     $dao->entity_table = $entityTable;
     $dao->find();
     while ($dao->fetch()) {
@@ -125,7 +125,7 @@ class CRM_Core_BAO_Discount extends CRM_Core_DAO_Discount {
     }
 
     $dao = new CRM_Core_DAO_Discount();
-    $dao->entity_id    = $entityID;
+    $dao->entity_id = $entityID;
     $dao->entity_table = $entityTable;
     $dao->find();
 
index 32e2e2da570c7d81b7b2dc51d6a70c1ec69585c8..e0e432e5aa47f8eba8d1d3cee02ea37ced207bb0 100644 (file)
@@ -211,9 +211,9 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain {
     $fromEmailAddress = CRM_Core_OptionGroup::values('from_email_address', NULL, NULL, NULL, ' AND is_default = 1');
     if (!empty($fromEmailAddress)) {
       foreach ($fromEmailAddress as $key => $value) {
-        $email     = CRM_Utils_Mail::pluckEmailFromHeader($value);
+        $email = CRM_Utils_Mail::pluckEmailFromHeader($value);
         $fromArray = explode('"', $value);
-        $fromName  = CRM_Utils_Array::value(1, $fromArray);
+        $fromName = CRM_Utils_Array::value(1, $fromArray);
         break;
       }
       return array($fromName, $email);
index a02b2cb5dc0b7a1eab9123857ff8c7f3f8db6168..d81621b0da728d6a0189234927c69741bf4bc2ad 100644 (file)
@@ -162,8 +162,8 @@ ORDER BY  civicrm_email.is_primary DESC, email_id ASC ";
     );
 
     $emails = $values = array();
-    $dao    = CRM_Core_DAO::executeQuery($query, $params);
-    $count  = 1;
+    $dao = CRM_Core_DAO::executeQuery($query, $params);
+    $count = 1;
     while ($dao->fetch()) {
       $values = array(
         'locationType' => $dao->locationType,
@@ -269,8 +269,8 @@ AND    reset_date IS NULL
 ";
         if (CRM_Core_DAO::singleValueQuery($sql, $params)) {
           //set reset date only if it is not set and if hold date is set
-          $email->on_hold    = FALSE;
-          $email->hold_date  = 'null';
+          $email->on_hold = FALSE;
+          $email->hold_date = 'null';
           $email->reset_date = date('YmdHis');
         }
       }
@@ -291,8 +291,8 @@ AND    reset_date IS NULL
    * @static
    */
   public static function getFromEmail() {
-    $session         = CRM_Core_Session::singleton();
-    $contactID       = $session->get('userID');
+    $session = CRM_Core_Session::singleton();
+    $contactID = $session->get('userID');
     $fromEmailValues = array();
 
     // add all configured FROM email addresses
index 374f99be01c0f2ec6b5875e956a5b8ffaea3ead1..a43d0978d7bd75984eb43634a15e7962ab3f9ebe 100644 (file)
@@ -46,7 +46,7 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag {
    *   Name of the entity table usually 'civicrm_contact'.
    *
    * @return array(
-  ) reference $tag array of category id's the contact belongs to.
+   * ) reference $tag array of category id's the contact belongs to.
    *
    * @static
    */
@@ -146,15 +146,15 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag {
    * @static
    */
   public static function addEntitiesToTag(&$entityIds, $tagId, $entityTable = 'civicrm_contact') {
-    $numEntitiesAdded    = 0;
+    $numEntitiesAdded = 0;
     $numEntitiesNotAdded = 0;
-    $entityIdsAdded      = array();
+    $entityIdsAdded = array();
 
     foreach ($entityIds as $entityId) {
       $tag = new CRM_Core_DAO_EntityTag();
 
-      $tag->entity_id    = $entityId;
-      $tag->tag_id       = $tagId;
+      $tag->entity_id = $entityId;
+      $tag->tag_id = $tagId;
       $tag->entity_table = $entityTable;
       if (!$tag->find()) {
         $tag->save();
@@ -199,8 +199,8 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag {
     foreach ($entityIds as $entityId) {
       $tag = new CRM_Core_DAO_EntityTag();
 
-      $tag->entity_id    = $entityId;
-      $tag->tag_id       = $tagId;
+      $tag->entity_id = $entityId;
+      $tag->tag_id = $tagId;
       $tag->entity_table = $entityTable;
       if ($tag->find()) {
         $tag->delete();
@@ -348,14 +348,14 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag {
    */
   public function mergeTags($tagAId, $tagBId) {
     $queryParams = array(
-    1 => array($tagBId, 'Integer'),
+      1 => array($tagBId, 'Integer'),
       2 => array($tagAId, 'Integer'),
     );
 
     // re-compute used_for field
     $query = "SELECT id, name, used_for FROM civicrm_tag WHERE id IN (%1, %2)";
-    $dao   = CRM_Core_DAO::executeQuery($query, $queryParams);
-    $tags  = array();
+    $dao = CRM_Core_DAO::executeQuery($query, $queryParams);
+    $tags = array();
     while ($dao->fetch()) {
       $label = ($dao->id == $tagAId) ? 'tagA' : 'tagB';
       $tags[$label] = $dao->name;
index d66a57b8072fba3e29c4c85c13c54576cd1e6ed1..14121a1807200e9623bb9554975356087777bed3 100644 (file)
@@ -211,11 +211,11 @@ class CRM_Core_BAO_File extends CRM_Core_DAO_File {
   /**
    * The $useWhere is used so that the signature matches the parent class
    *
-  public function delete($useWhere = FALSE) {
-    list($fileID, $entityID, $fieldID) = func_get_args();
-
-    self::deleteFileReferences($fileID, $entityID, $fieldID);
-  } */
+   * public function delete($useWhere = FALSE) {
+   * list($fileID, $entityID, $fieldID) = func_get_args();
+   *
+   * self::deleteFileReferences($fileID, $entityID, $fieldID);
+   * } */
 
   /**
    * Delete all the files and associated object associated with this
index a46997d38b529eb37b72a5834b57fb905d97e304..e0c039b543af91ea993f0311bd110388c3ce8c12 100644 (file)
@@ -32,7 +32,6 @@
  * $Id$
  *
  */
-
 class CRM_Core_BAO_FinancialTrxn extends CRM_Financial_DAO_FinancialTrxn {
   /**
    * Class constructor
@@ -79,10 +78,10 @@ class CRM_Core_BAO_FinancialTrxn extends CRM_Financial_DAO_FinancialTrxn {
 
     if (!empty($trxnEntityTable)) {
       $entityFinancialTrxnParams['entity_table'] = $trxnEntityTable['entity_table'];
-      $entityFinancialTrxnParams['entity_id']    = $trxnEntityTable['entity_id'];
+      $entityFinancialTrxnParams['entity_id'] = $trxnEntityTable['entity_id'];
     }
     else {
-      $entityFinancialTrxnParams['entity_id'] =  $params['contribution_id'];
+      $entityFinancialTrxnParams['entity_id'] = $params['contribution_id'];
     }
 
     $entityTrxn = new CRM_Financial_DAO_EntityFinancialTrxn();
@@ -283,7 +282,7 @@ LEFT JOIN civicrm_line_item AS lt ON lt.id = fi.entity_id AND lt.entity_table =
 WHERE lt.entity_id = %1 ";
 
     $sqlParams = array(1 => array($entity_id, 'Integer'), 2 => array($entity_table, 'String'));
-    $dao =  CRM_Core_DAO::executeQuery($query, $sqlParams);
+    $dao = CRM_Core_DAO::executeQuery($query, $sqlParams);
     while ($dao->fetch()) {
       $result[$dao->financial_trxn_id][$dao->id] = $dao->amount;
     }
@@ -395,8 +394,8 @@ WHERE ceft.entity_id = %1";
     $params['trxnParams']['to_financial_account_id'] = $financialAccount;
     $params['trxnParams']['total_amount'] = $amount;
     $params['trxnParams']['fee_amount'] =
-      $params['trxnParams']['net_amount'] = 0;
-    $params['trxnParams']['status_id'] = CRM_Core_OptionGroup::getValue('contribution_status','Completed','name');
+    $params['trxnParams']['net_amount'] = 0;
+    $params['trxnParams']['status_id'] = CRM_Core_OptionGroup::getValue('contribution_status', 'Completed', 'name');
     $params['trxnParams']['contribution_id'] = $contributionId;
     $trxn = self::create($params['trxnParams']);
     if (empty($params['entity_id'])) {
@@ -411,7 +410,7 @@ WHERE ceft.entity_id = %1";
         'transaction_date' => date('YmdHis'),
         'amount' => $amount,
         'description' => 'Fee',
-        'status_id' => CRM_Core_OptionGroup::getValue('financial_item_status','Paid','name'),
+        'status_id' => CRM_Core_OptionGroup::getValue('financial_item_status', 'Paid', 'name'),
         'entity_table' => 'civicrm_financial_trxn',
         'entity_id' => $params['entity_id'],
         'currency' => $params['trxnParams']['currency'],
@@ -482,7 +481,7 @@ WHERE pp.participant_id = {$entityId} AND ft.to_financial_account_id != {$toFina
         if ($returnType) {
           $value = array();
           if ($paymentVal < 0) {
-            $value['refund_due']  = $paymentVal;
+            $value['refund_due'] = $paymentVal;
           }
           elseif ($paymentVal > 0) {
             $value['amount_owed'] = $paymentVal;
index 382abb86c406a8dc0a65c88a7164c79ea8572c3a..86d13f75813f7d81876e279293f533edc048b842 100644 (file)
@@ -103,8 +103,8 @@ ORDER BY
   civicrm_im.is_primary DESC, im_id ASC ";
     $params = array(1 => array($id, 'Integer'));
 
-    $ims   = $values = array();
-    $dao   = CRM_Core_DAO::executeQuery($query, $params);
+    $ims = $values = array();
+    $dao = CRM_Core_DAO::executeQuery($query, $params);
     $count = 1;
     while ($dao->fetch()) {
       $values = array(
index f9df000f4c1e5fdc9eb8772c15c1627713ac01b0..33ab43de2af0f409bcb22b7dc4ca592ea6fa7de6 100644 (file)
@@ -414,7 +414,7 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue {
     if (array_key_exists($field, self::$optionValueFields)) {
       switch (self::$optionValueFields[$field]['type']) {
         case CRM_Utils_Type::T_INT:
-          return (int)CRM_Utils_Array::value($field, $values, $default);
+          return (int) CRM_Utils_Array::value($field, $values, $default);
 
         case CRM_Utils_Type::T_FLOAT:
           // Round float values to three decimal places and trim trailing zeros.
@@ -422,7 +422,7 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue {
           $f = sprintf('%05.3f', $values[$field]);
           $f = rtrim($f, '0');
           $f = rtrim($f, '.');
-          return (float)(empty($f) ? '0' : $f);
+          return (float) (empty($f) ? '0' : $f);
       }
       return CRM_Utils_Array::value($field, $values, $default);
     }
@@ -510,9 +510,11 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue {
     }
     else {
       // new record
-      $list = self::getList(TRUE,$groupName);
+      $list = self::getList(TRUE, $groupName);
       $cnt = 1;
-      while (array_key_exists("custom_$cnt", $list)) $cnt++;
+      while (array_key_exists("custom_$cnt", $list)) {
+        $cnt++;
+      }
       $values['name'] = "custom_$cnt";
       $values['grouping'] = self::customGroupName();
     }
index 48b425ee9baa02edfe09e3839dc6befd6d68bf81..693d5e81c5f91afccaacf5144e1a0bbd91755f1f 100644 (file)
@@ -107,7 +107,11 @@ class CRM_Core_BAO_Location extends CRM_Core_DAO {
     }
 
     foreach (array(
-      'phone', 'email', 'im', 'address') as $loc) {
+               'phone',
+               'email',
+               'im',
+               'address'
+             ) as $loc) {
       $locBlock["{$loc}_id"] = !empty($location["$loc"][0]) ? $location["$loc"][0]->id : NULL;
       $locBlock["{$loc}_2_id"] = !empty($location["$loc"][1]) ? $location["$loc"][1]->id : NULL;
     }
@@ -134,9 +138,9 @@ class CRM_Core_BAO_Location extends CRM_Core_DAO {
    * @static
    */
   public static function findExisting($entityElements) {
-    $eid    = $entityElements['entity_id'];
+    $eid = $entityElements['entity_id'];
     $etable = $entityElements['entity_table'];
-    $query  = "
+    $query = "
 SELECT e.loc_block_id as locId
 FROM {$etable} e
 WHERE e.id = %1";
@@ -330,8 +334,8 @@ WHERE e.id = %1";
     //copy all location blocks (email, phone, address, etc)
     foreach ($defaults as $key => $value) {
       if ($key != 'id') {
-        $tbl          = explode("_", $key);
-        $name         = ucfirst($tbl[0]);
+        $tbl = explode("_", $key);
+        $name = ucfirst($tbl[0]);
         $updateParams = NULL;
         if ($updateId = CRM_Utils_Array::value($key, $updateValues)) {
           $updateParams = array('id' => $updateId);
@@ -368,7 +372,12 @@ WHERE e.id = %1";
     $nonPrimaryBlockIds = CRM_Contact_BAO_Contact::getLocBlockIds($contactId, array('is_primary' => 0));
 
     foreach (array(
-      'Email', 'IM', 'Phone', 'Address', 'OpenID') as $block) {
+               'Email',
+               'IM',
+               'Phone',
+               'Address',
+               'OpenID'
+             ) as $block) {
       $name = strtolower($block);
       if (array_key_exists($name, $primaryLocBlockIds) &&
         !CRM_Utils_System::isNull($primaryLocBlockIds[$name])
@@ -421,13 +430,13 @@ WHERE e.id = %1";
 
       // Format for js
       else {
-       // Option-groups for multiple categories
+        // Option-groups for multiple categories
         if ($result && count($values) > 1) {
           $elements[] = array(
             'value' => CRM_Core_PseudoConstant::$valueType($val, FALSE),
             'children' => array(),
           );
-          $list = & $elements[count($elements) - 1]['children'];
+          $list = &$elements[count($elements) - 1]['children'];
         }
         foreach ($result as $id => $name) {
           $list[] = array(
index e342a6486b366726296cad4884a62ca3ba41845c..21ce5415122b5ba8f8dc47445e494adf5b37fc9e 100644 (file)
@@ -133,11 +133,11 @@ class CRM_Core_BAO_Log extends CRM_Core_DAO_Log {
 
     $logData = "$tableName,$tableID";
     if (!$log->id) {
-      $log->entity_table  = 'civicrm_contact';
-      $log->entity_id     = $contactID;
-      $log->modified_id   = $userID;
+      $log->entity_table = 'civicrm_contact';
+      $log->entity_id = $contactID;
+      $log->modified_id = $userID;
       $log->modified_date = date("YmdHis");
-      $log->data          = $logData;
+      $log->data = $logData;
       $log->save();
     }
     else {
index aabd0337506b49a9353aaf9d076ebc4aee78c617..6a42745d8614d6de088fd167e05b3c23ee8336da 100644 (file)
@@ -55,7 +55,7 @@ class CRM_Core_BAO_MailSettings extends CRM_Core_DAO_MailSettings {
     if (empty($mailSettings[$domainID]) || $reset) {
       $dao = new self;
       $dao->is_default = 1;
-      $dao->domain_id  = $domainID;
+      $dao->domain_id = $domainID;
       $dao->find(TRUE);
       $mailSettings[$domainID] = $dao;
     }
@@ -204,9 +204,9 @@ class CRM_Core_BAO_MailSettings extends CRM_Core_DAO_MailSettings {
     $results = NULL;
     $transaction = new CRM_Core_Transaction();
 
-    $mailSettings     = new CRM_Core_DAO_MailSettings();
+    $mailSettings = new CRM_Core_DAO_MailSettings();
     $mailSettings->id = $id;
-    $results          = $mailSettings->delete();
+    $results = $mailSettings->delete();
 
     $transaction->commit();
 
index 567073d793fcdb19a508e6db4a61216f106699f8..3f1c33bc1fa3d95e5ebd6c207082922b0d60ee1c 100644 (file)
@@ -189,8 +189,15 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
     }
 
     return array(
-      $mappingName, $mappingContactType, $mappingLocation, $mappingPhoneType,
-      $mappingImProvider, $mappingRelation, $mappingOperator, $mappingValue, $mappingWebsiteType,
+      $mappingName,
+      $mappingContactType,
+      $mappingLocation,
+      $mappingPhoneType,
+      $mappingImProvider,
+      $mappingRelation,
+      $mappingOperator,
+      $mappingValue,
+      $mappingWebsiteType,
     );
   }
 
@@ -282,8 +289,8 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
       else {
         $form->assign('loadedMapping', $mappingId);
 
-        $params         = array('id' => $mappingId);
-        $temp           = array();
+        $params = array('id' => $mappingId);
+        $temp = array();
         $mappingDetails = CRM_Core_BAO_Mapping::retrieve($params, $temp);
 
         $form->assign('savedName', $mappingDetails->name);
@@ -305,10 +312,10 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
       );
     }
 
-    $defaults         = array();
+    $defaults = array();
     $hasLocationTypes = array();
     $hasRelationTypes = array();
-    $fields           = array();
+    $fields = array();
 
     if ($mappingType == 'Export') {
       $required = TRUE;
@@ -361,7 +368,10 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
     //we need to unset groups, tags, notes for component export
     if ($exportMode != CRM_Export_Form_Select::CONTACT_EXPORT) {
       foreach (array(
-        'groups', 'tags', 'notes') as $value) {
+                 'groups',
+                 'tags',
+                 'notes'
+               ) as $value) {
         unset($fields['Individual'][$value]);
         unset($fields['Household'][$value]);
         unset($fields['Organization'][$value]);
@@ -375,15 +385,18 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
         if (!empty($fields['Household'][$key]) && !empty($fields['Organization'][$key])) {
           $fields['Contact'][$key] = $value;
           unset($fields['Organization'][$key],
-                $fields['Household'][$key],
-                $fields['Individual'][$key]);
+            $fields['Household'][$key],
+            $fields['Individual'][$key]);
         }
       }
       if (array_key_exists('note', $fields['Contact'])) {
         $noteTitle = $fields['Contact']['note']['title'];
         $fields['Contact']['note']['title'] = $noteTitle . ': ' . ts('Body and Subject');
-        $fields['Contact']['note_body']    = array('title' => $noteTitle . ': ' . ts('Body Only'),    'name' => 'note_body');
-        $fields['Contact']['note_subject'] = array('title' => $noteTitle . ': ' . ts('Subject Only'), 'name' => 'note_subject');
+        $fields['Contact']['note_body'] = array('title' => $noteTitle . ': ' . ts('Body Only'), 'name' => 'note_body');
+        $fields['Contact']['note_subject'] = array(
+          'title' => $noteTitle . ': ' . ts('Subject Only'),
+          'name' => 'note_subject'
+        );
       }
     }
 
@@ -468,7 +481,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
       if ($mappingType == 'Export') {
         $subTypeRelationshipTypes =
           CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, NULL, NULL, $val['parent'],
-                                                                   FALSE, 'label', TRUE, $subType);
+            FALSE, 'label', TRUE, $subType);
 
         foreach ($subTypeRelationshipTypes as $key => $var) {
           if (!array_key_exists($key, $fields[$val['parent']])) {
@@ -561,9 +574,9 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
       }
     }
 
-    $sel3['']    = NULL;
-    $sel5['']    = NULL;
-    $phoneTypes  = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
+    $sel3[''] = NULL;
+    $sel5[''] = NULL;
+    $phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
     $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
     asort($phoneTypes);
 
@@ -610,11 +623,11 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
               if ($relationshipType->find(TRUE)) {
                 $direction = "contact_sub_type_$second";
                 if (isset($relationshipType->$direction)) {
-                  $relatedFields = array_merge((array)$relatedMapperFields[$relationshipType->$direction], (array)$relationshipCustomFields);
+                  $relatedFields = array_merge((array) $relatedMapperFields[$relationshipType->$direction], (array) $relationshipCustomFields);
                 }
                 else {
                   $target_type = 'contact_type_' . $second;
-                  $relatedFields = array_merge((array)$relatedMapperFields[$relationshipType->$target_type], (array)$relationshipCustomFields);
+                  $relatedFields = array_merge((array) $relatedMapperFields[$relationshipType->$target_type], (array) $relationshipCustomFields);
                 }
               }
               $relationshipType->free();
@@ -656,9 +669,19 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
 
     //special fields that have location, hack for primary location
     $specialFields = array(
-      'street_address', 'supplemental_address_1', 'supplemental_address_2',
-      'city', 'postal_code', 'postal_code_suffix', 'geo_code_1', 'geo_code_2',
-      'state_province', 'country', 'phone', 'email', 'im',
+      'street_address',
+      'supplemental_address_1',
+      'supplemental_address_2',
+      'city',
+      'postal_code',
+      'postal_code_suffix',
+      'geo_code_1',
+      'geo_code_2',
+      'state_province',
+      'country',
+      'phone',
+      'email',
+      'im',
     );
 
     if (isset($mappingId)) {
@@ -666,7 +689,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
 
       list($mappingName, $mappingContactType, $mappingLocation, $mappingPhoneType, $mappingImProvider,
         $mappingRelation, $mappingOperator, $mappingValue
-      ) = CRM_Core_BAO_Mapping::getMappingFields($mappingId);
+        ) = CRM_Core_BAO_Mapping::getMappingFields($mappingId);
 
       $blkCnt = count($mappingName);
       if ($blkCnt >= $blockCount) {
@@ -863,9 +886,9 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
     $js = "<script type='text/javascript'>\n";
     $formName = "document.{$name}";
     if (!empty($nullArray)) {
-      $js      .= "var nullArray = [";
+      $js .= "var nullArray = [";
       $elements = array();
-      $seen     = array();
+      $seen = array();
       foreach ($nullArray as $element) {
         $key = "{$element[0]}, {$element[1]}, {$element[2]}";
         if (!isset($seen[$key])) {
@@ -884,9 +907,9 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
 ";
     }
     if (!empty($noneArray)) {
-      $js      .= "var noneArray = [";
+      $js .= "var noneArray = [";
       $elements = array();
-      $seen     = array();
+      $seen = array();
       foreach ($noneArray as $element) {
         $key = "{$element[0]}, {$element[1]}, {$element[2]}";
         if (!isset($seen[$key])) {
@@ -984,8 +1007,8 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
         if (in_array($v[0], $types)) {
           if ($contactType && $contactType != $v[0]) {
             CRM_Core_Error::fatal(ts("Cannot have two clauses with different types: %1, %2",
-                array(1 => $contactType, 2 => $v[0])
-              ));
+              array(1 => $contactType, 2 => $v[0])
+            ));
           }
           $contactType = $v[0];
         }
@@ -1015,7 +1038,8 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
           }
 
           if ($v[0] == 'Contribution' && substr($fldName, 0, 7) != 'custom_'
-            && substr($fldName, 0, 10) != 'financial_') {
+            && substr($fldName, 0, 10) != 'financial_'
+          ) {
             if (substr($fldName, 0, 13) != 'contribution_') {
               $fldName = 'contribution_' . $fldName;
             }
@@ -1046,10 +1070,10 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
           }
 
           // CRM-14983: verify if values are comma separated convert to array
-          if (!is_array($value) && (strpos($value,',') !== FALSE || strstr($value, '(')) && empty($isCustomField) && $params['operator'][$key][$k] == 'IN') {
+          if (!is_array($value) && (strpos($value, ',') !== FALSE || strstr($value, '(')) && empty($isCustomField) && $params['operator'][$key][$k] == 'IN') {
             preg_match('#\((.*?)\)#', $value, $match);
             $tmpArray = explode(',', $match[1]);
-            $value = array_combine(array_values($tmpArray),array_values($tmpArray));
+            $value = array_combine(array_values($tmpArray), array_values($tmpArray));
           }
 
           if ($row) {
index 95e4689489eff938f295e328758be8dfa0eecbf2..d8ba0e606523c66b24ae94abfdf9b96a8d581f9d 100644 (file)
@@ -168,13 +168,13 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
     $messageTemplates = new CRM_Core_DAO_MessageTemplate();
     $messageTemplates->id = $messageTemplateID;
 
-    $domain     = CRM_Core_BAO_Domain::getDomain();
-    $result     = NULL;
+    $domain = CRM_Core_BAO_Domain::getDomain();
+    $result = NULL;
     $hookTokens = array();
 
     if ($messageTemplates->find(TRUE)) {
-      $body_text    = $messageTemplates->msg_text;
-      $body_html    = $messageTemplates->msg_html;
+      $body_text = $messageTemplates->msg_text;
+      $body_html = $messageTemplates->msg_html;
       $body_subject = $messageTemplates->msg_subject;
       if (!$body_text) {
         $body_text = CRM_Utils_String::htmlToText($body_html);
@@ -194,8 +194,8 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
 
       // get tokens to be replaced
       $tokens = array_merge(CRM_Utils_Token::getTokens($body_text),
-                            CRM_Utils_Token::getTokens($body_html),
-                            CRM_Utils_Token::getTokens($body_subject));
+        CRM_Utils_Token::getTokens($body_html),
+        CRM_Utils_Token::getTokens($body_subject));
 
       // get replacement text for these tokens
       $returnProperties = array("preferred_mail_format" => 1);
@@ -205,10 +205,10 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
         }
       }
       list($details) = CRM_Utils_Token::getTokenDetails(array($contactId),
-                                                        $returnProperties,
-                                                        NULL, NULL, FALSE,
-                                                        $tokens,
-                                                        'CRM_Core_BAO_MessageTemplate');
+        $returnProperties,
+        NULL, NULL, FALSE,
+        $tokens,
+        'CRM_Core_BAO_MessageTemplate');
       $contact = reset($details);
 
       // call token hook
@@ -233,7 +233,9 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
 
       $smarty = CRM_Core_Smarty::singleton();
       foreach (array(
-        'text', 'html') as $elem) {
+                 'text',
+                 'html'
+               ) as $elem) {
         $$elem = $smarty->fetch("string:{$$elem}");
       }
 
@@ -261,7 +263,8 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
       }
       if ($html && ($contact['preferred_mail_format'] == 'HTML' ||
           $contact['preferred_mail_format'] == 'Both'
-        )) {
+        )
+      ) {
         $mailParams['html'] = $html;
       }
 
@@ -289,7 +292,7 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
       CRM_Core_Error::fatal(ts('Did not find a message template with id of %1.', array(1 => $id)));
     }
 
-    $orig              = new self;
+    $orig = new self;
     $orig->workflow_id = $diverted->workflow_id;
     $orig->is_reserved = 1;
     $orig->find(1);
@@ -379,14 +382,17 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
         CRM_Core_Error::fatal(ts('No such message template: id=%1.', array(1 => $params['messageTemplateID'])));
       }
       else {
-        CRM_Core_Error::fatal(ts('No such message template: option group %1, option value %2.', array(1 => $params['groupName'], 2 => $params['valueName'])));
+        CRM_Core_Error::fatal(ts('No such message template: option group %1, option value %2.', array(
+              1 => $params['groupName'],
+              2 => $params['valueName']
+            )));
       }
     }
 
     $subject = $dao->subject;
-    $text    = $dao->text;
-    $html    = $dao->html;
-    $format  = $dao->format;
+    $text = $dao->text;
+    $html = $dao->html;
+    $format = $dao->format;
     $dao->free();
 
     // add the test banner (if requested)
@@ -400,18 +406,18 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
       $testDao->fetch();
 
       $subject = $testDao->subject . $subject;
-      $text    = $testDao->text . $text;
-      $html    = preg_replace('/<body(.*)$/im', "<body\\1\n{$testDao->html}", $html);
+      $text = $testDao->text . $text;
+      $html = preg_replace('/<body(.*)$/im', "<body\\1\n{$testDao->html}", $html);
       $testDao->free();
     }
 
     // replace tokens in the three elements (in subject as if it was the text body)
-    $domain             = CRM_Core_BAO_Domain::getDomain();
-    $hookTokens         = array();
-    $mailing            = new CRM_Mailing_BAO_Mailing;
+    $domain = CRM_Core_BAO_Domain::getDomain();
+    $hookTokens = array();
+    $mailing = new CRM_Mailing_BAO_Mailing;
     $mailing->body_text = $text;
     $mailing->body_html = $html;
-    $tokens             = $mailing->getTokens();
+    $tokens = $mailing->getTokens();
     CRM_Utils_Hook::tokens($hookTokens);
     $categories = array_keys($hookTokens);
 
@@ -443,13 +449,13 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
     }
 
     $subject = CRM_Utils_Token::replaceDomainTokens($subject, $domain, FALSE, $tokens['text'], TRUE);
-    $text    = CRM_Utils_Token::replaceDomainTokens($text, $domain, FALSE, $tokens['text'], TRUE);
-    $html    = CRM_Utils_Token::replaceDomainTokens($html, $domain, TRUE, $tokens['html'], TRUE);
+    $text = CRM_Utils_Token::replaceDomainTokens($text, $domain, FALSE, $tokens['text'], TRUE);
+    $html = CRM_Utils_Token::replaceDomainTokens($html, $domain, TRUE, $tokens['html'], TRUE);
 
     if ($contactID) {
       $subject = CRM_Utils_Token::replaceContactTokens($subject, $contact, FALSE, $tokens['text'], FALSE, TRUE);
-      $text    = CRM_Utils_Token::replaceContactTokens($text, $contact, FALSE, $tokens['text'], FALSE, TRUE);
-      $html    = CRM_Utils_Token::replaceContactTokens($html, $contact, FALSE, $tokens['html'], FALSE, TRUE);
+      $text = CRM_Utils_Token::replaceContactTokens($text, $contact, FALSE, $tokens['text'], FALSE, TRUE);
+      $html = CRM_Utils_Token::replaceContactTokens($html, $contact, FALSE, $tokens['html'], FALSE, TRUE);
 
 
       $contactArray = array($contactID => $contact);
@@ -463,8 +469,8 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
       $contact = $contactArray[$contactID];
 
       $subject = CRM_Utils_Token::replaceHookTokens($subject, $contact, $categories, TRUE);
-      $text    = CRM_Utils_Token::replaceHookTokens($text, $contact, $categories, TRUE);
-      $html    = CRM_Utils_Token::replaceHookTokens($html, $contact, $categories, TRUE);
+      $text = CRM_Utils_Token::replaceHookTokens($text, $contact, $categories, TRUE);
+      $html = CRM_Utils_Token::replaceHookTokens($html, $contact, $categories, TRUE);
     }
 
     // strip whitespace from ends and turn into a single line
@@ -478,7 +484,10 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
       $smarty->assign($name, $value);
     }
     foreach (array(
-      'subject', 'text', 'html') as $elem) {
+               'subject',
+               'text',
+               'html'
+             ) as $elem) {
       $$elem = $smarty->fetch("string:{$$elem}");
     }
 
@@ -487,8 +496,8 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
 
     // create the params array
     $params['subject'] = $subject;
-    $params['text']    = $text;
-    $params['html']    = $html;
+    $params['text'] = $text;
+    $params['html'] = $html;
 
     if ($params['toEmail']) {
       $contactParams = array(array('email', 'LIKE', $params['toEmail'], 0, 1));
index efb46b1c823fb459315752f975186d7b6ba1815f..274fa2080aef11f687a83fa6e13bbc03f8f2287e 100644 (file)
@@ -318,7 +318,8 @@ ORDER BY parent_id, weight";
           'parentID' => $navigation->parent_id,
           'navID' => $navigation->id,
           'active' => $navigation->is_active,
-        ));
+        )
+      );
       self::buildNavigationTree($navigationTree[$navigation->id]['child'], $navigation->id, $navigationMenu);
     }
 
@@ -480,15 +481,15 @@ ORDER BY parent_id, weight";
     // want to use ts() as it would throw the ts-extractor off
     $i18n = CRM_Core_I18n::singleton();
 
-    $name       = $i18n->crm_translate($value['attributes']['label'], array('context' => 'menu'));
-    $url        = $value['attributes']['url'];
+    $name = $i18n->crm_translate($value['attributes']['label'], array('context' => 'menu'));
+    $url = $value['attributes']['url'];
     $permission = $value['attributes']['permission'];
-    $operator   = $value['attributes']['operator'];
-    $parentID   = $value['attributes']['parentID'];
-    $navID      = $value['attributes']['navID'];
-    $active     = $value['attributes']['active'];
-    $menuName   = $value['attributes']['name'];
-    $target     = CRM_Utils_Array::value('target', $value['attributes']);
+    $operator = $value['attributes']['operator'];
+    $parentID = $value['attributes']['parentID'];
+    $navID = $value['attributes']['navID'];
+    $active = $value['attributes']['active'];
+    $menuName = $value['attributes']['name'];
+    $target = CRM_Utils_Array::value('target', $value['attributes']);
 
     if (in_array($parentID, $skipMenuItems) || !$active) {
       $skipMenuItems[] = $navID;
@@ -497,7 +498,9 @@ ORDER BY parent_id, weight";
 
     //we need to check core view/edit or supported acls.
     if (in_array($menuName, array(
-      'Search...', 'Contacts'))) {
+      'Search...',
+      'Contacts'
+    ))) {
       if (!CRM_Core_Permission::giveMeAllACLs()) {
         $skipMenuItems[] = $navID;
         return FALSE;
@@ -693,11 +696,11 @@ ORDER BY parent_id, weight";
    * @static
    */
   public static function processNavigation(&$params) {
-    $nodeID      = (int)str_replace("node_", "", $params['id']);
-    $referenceID = (int)str_replace("node_", "", $params['ref_id']);
-    $position    = $params['ps'];
-    $type        = $params['type'];
-    $label       = CRM_Utils_Array::value('data', $params);
+    $nodeID = (int) str_replace("node_", "", $params['id']);
+    $referenceID = (int) str_replace("node_", "", $params['ref_id']);
+    $position = $params['ps'];
+    $type = $params['type'];
+    $label = CRM_Utils_Array::value('data', $params);
 
     switch ($type) {
       case "move":
@@ -749,14 +752,14 @@ ORDER BY parent_id, weight";
     }
 
     $incrementOtherNodes = TRUE;
-    $sql    = "SELECT weight from civicrm_navigation WHERE {$parentClause} ORDER BY weight LIMIT %1, 1";
+    $sql = "SELECT weight from civicrm_navigation WHERE {$parentClause} ORDER BY weight LIMIT %1, 1";
     $params = array(1 => array($position, 'Positive'));
     $newWeight = CRM_Core_DAO::singleValueQuery($sql, $params);
 
     // this means node is moved to last position, so you need to get the weight of last element + 1
     if (!$newWeight) {
       $lastPosition = $position - 1;
-      $sql    = "SELECT weight from civicrm_navigation WHERE {$parentClause} ORDER BY weight LIMIT %1, 1";
+      $sql = "SELECT weight from civicrm_navigation WHERE {$parentClause} ORDER BY weight LIMIT %1, 1";
       $params = array(1 => array($lastPosition, 'Positive'));
       $newWeight = CRM_Core_DAO::singleValueQuery($sql, $params);
 
@@ -815,9 +818,9 @@ ORDER BY parent_id, weight";
    * @static
    */
   public static function getNavigationInfo($navigationID) {
-    $query  = "SELECT parent_id, weight FROM civicrm_navigation WHERE id = %1";
+    $query = "SELECT parent_id, weight FROM civicrm_navigation WHERE id = %1";
     $params = array($navigationID, 'Integer');
-    $dao    = CRM_Core_DAO::executeQuery($query, array(1 => $params));
+    $dao = CRM_Core_DAO::executeQuery($query, array(1 => $params));
     $dao->fetch();
     return array(
       'parent_id' => $dao->parent_id,
index d3d51138cec39b4b31705d1736ca99d5811ecdf4..4a70cf516c0b29b8617cbfb7996bbb89a4f99740 100644 (file)
@@ -257,8 +257,8 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
     if (empty($params)) {
       return NULL;
     }
-    $note               = new CRM_Core_BAO_Note();
-    $note->entity_id    = $params['contact_id'];
+    $note = new CRM_Core_BAO_Note();
+    $note->entity_id = $params['contact_id'];
     $note->entity_table = 'civicrm_contact';
 
     // get the total count of notes
@@ -299,9 +299,9 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
    * @static
    */
   public static function del($id, $showStatus = TRUE) {
-    $return   = NULL;
-    $recent   = array($id);
-    $note     = new CRM_Core_DAO_Note();
+    $return = NULL;
+    $recent = array($id);
+    $note = new CRM_Core_DAO_Note();
     $note->id = $id;
     $note->find();
     $note->fetch();
@@ -350,9 +350,9 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
    */
   public static function deleteContact($id) {
     // need to delete for both entity_id
-    $dao               = new CRM_Core_DAO_Note();
+    $dao = new CRM_Core_DAO_Note();
     $dao->entity_table = 'civicrm_contact';
-    $dao->entity_id    = $id;
+    $dao->entity_id = $id;
     $dao->delete();
 
     // and the creator contact id
@@ -407,8 +407,8 @@ ORDER BY  modified_date desc";
    * @static
    */
   public static function getContactNoteCount($contactID) {
-    $note               = new CRM_Core_DAO_Note();
-    $note->entity_id    = $contactID;
+    $note = new CRM_Core_DAO_Note();
+    $note->entity_id = $contactID;
     $note->entity_table = 'civicrm_contact';
     $note->find();
     $count = 0;
@@ -451,9 +451,9 @@ ORDER BY  modified_date desc";
    * @static
    */
   public static function getChildCount($id) {
-    $note               = new CRM_Core_DAO_Note();
+    $note = new CRM_Core_DAO_Note();
     $note->entity_table = 'civicrm_note';
-    $note->entity_id    = $id;
+    $note->entity_id = $id;
     $note->find();
     $count = 0;
     while ($note->fetch()) {
@@ -488,9 +488,9 @@ ORDER BY  modified_date desc";
     }
 
     // get direct children of given parentId note
-    $note               = new CRM_Core_DAO_Note();
+    $note = new CRM_Core_DAO_Note();
     $note->entity_table = 'civicrm_note';
-    $note->entity_id    = $parentId;
+    $note->entity_id = $parentId;
     $note->orderBy('modified_date asc');
     $note->find();
     while ($note->fetch()) {
@@ -499,7 +499,7 @@ ORDER BY  modified_date desc";
         CRM_Core_DAO::storeValues($note, $tree[$note->id]);
 
         // get name of user that created this note
-        $contact     = new CRM_Contact_DAO_Contact();
+        $contact = new CRM_Contact_DAO_Contact();
         $createdById = $note->contact_id;
         $contact->id = $createdById;
         $contact->find();
@@ -548,9 +548,9 @@ ORDER BY  modified_date desc";
    */
   public static function getDescendentIds($parentId, &$ids = array()) {
     // get direct children of given parentId note
-    $note               = new CRM_Core_DAO_Note();
+    $note = new CRM_Core_DAO_Note();
     $note->entity_table = 'civicrm_note';
-    $note->entity_id    = $parentId;
+    $note->entity_id = $parentId;
     $note->find();
     while ($note->fetch()) {
       // foreach child, add to ids list, and recurse
index 619aa13e6587f4ca412e594b74a19928edbdf928..7615f5bfc11da53a31acdf6b2941c62938f088aa 100644 (file)
@@ -123,8 +123,8 @@ ORDER BY
     $params = array(1 => array($id, 'Integer'));
 
     $openids = $values = array();
-    $dao     = CRM_Core_DAO::executeQuery($query, $params);
-    $count   = 1;
+    $dao = CRM_Core_DAO::executeQuery($query, $params);
+    $count = 1;
     while ($dao->fetch()) {
       $values = array(
         'locationType' => $dao->locationType,
index 0f62fe48b8e3f33ee6f74398991b73c2803e97f0..6824ae847455b98ffbb737f815326880335e2b47 100644 (file)
@@ -60,6 +60,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
     }
     return CRM_Core_BAO_OptionValue::add($params, $ids);
   }
+
   /**
    * Set default Parameters
    * This functions sets default parameters if not set:
@@ -100,7 +101,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
    */
   public static function getDefaultWeight($params) {
     return (int) CRM_Utils_Weight::getDefaultWeight('CRM_Core_DAO_OptionValue',
-          array('option_group_id' => $params['option_group_id']));
+      array('option_group_id' => $params['option_group_id']));
   }
 
   /**
@@ -111,17 +112,18 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
    * @param array $params
    */
   public static function getDefaultValue($params) {
-     $bao = new CRM_Core_BAO_OptionValue();
-     $bao->option_group_id = $params['option_group_id'];
-     if (isset($params['domain_id'])) {
-       $bao->domain_id = $params['domain_id'];
-     }
-     $bao->selectAdd();
-     $bao->whereAdd("value REGEXP '^[0-9]+$'");
-     $bao->selectAdd('(ROUND(COALESCE(MAX(CONVERT(value, UNSIGNED)),0)) +1) as nextvalue');
-     $bao->find(TRUE);
-     return $bao->nextvalue;
+    $bao = new CRM_Core_BAO_OptionValue();
+    $bao->option_group_id = $params['option_group_id'];
+    if (isset($params['domain_id'])) {
+      $bao->domain_id = $params['domain_id'];
+    }
+    $bao->selectAdd();
+    $bao->whereAdd("value REGEXP '^[0-9]+$'");
+    $bao->selectAdd('(ROUND(COALESCE(MAX(CONVERT(value, UNSIGNED)),0)) +1) as nextvalue');
+    $bao->find(TRUE);
+    return $bao->nextvalue;
   }
+
   /**
    * Fetch object based on array of properties
    *
@@ -316,13 +318,14 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
       'gender' => 'gender_id',
       'individual_prefix' => 'prefix_id',
       'individual_suffix' => 'suffix_id',
-      'communication_style' => 'communication_style_id', // Not only Individuals -- but the code seems to be generic for all contact types, despite the naming...
+      'communication_style' => 'communication_style_id',
+      // Not only Individuals -- but the code seems to be generic for all contact types, despite the naming...
     );
     $contributions = array('payment_instrument' => 'payment_instrument_id');
-    $activities    = array('activity_type' => 'activity_type_id');
-    $participant   = array('participant_role' => 'role_id');
-    $eventType     = array('event_type' => 'event_type_id');
-    $aclRole       = array('acl_role' => 'acl_role_id');
+    $activities = array('activity_type' => 'activity_type_id');
+    $participant = array('participant_role' => 'role_id');
+    $eventType = array('event_type' => 'event_type_id');
+    $aclRole = array('acl_role' => 'acl_role_id');
 
     $all = array_merge($individuals, $contributions, $activities, $participant, $eventType, $aclRole);
     $fieldName = '';
@@ -457,8 +460,8 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
    */
   public static function getOptionValuesArray($optionGroupID) {
     // check if we can get the field values from the system cache
-    $cacheKey     = "CRM_Core_BAO_OptionValue_OptionGroupID_{$optionGroupID}";
-    $cache        = CRM_Utils_Cache::singleton();
+    $cacheKey = "CRM_Core_BAO_OptionValue_OptionGroupID_{$optionGroupID}";
+    $cache = CRM_Utils_Cache::singleton();
     $optionValues = $cache->get($cacheKey);
     if (empty($optionValues)) {
       $dao = new CRM_Core_DAO_OptionValue();
@@ -498,6 +501,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
     }
     return $options;
   }
+
   /**
    * Get the values of all option values given an option group Name as a key => value pair
    * Use above cached function to make it super efficient
index 485dccde17948a7072fa23b181a029631e9a6de9..ca7405b2247558220521a9360b754b8b5ada576e 100644 (file)
@@ -219,7 +219,7 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue {
     if (array_key_exists($field, self::$optionValueFields)) {
       switch (self::$optionValueFields[$field]['type']) {
         case CRM_Utils_Type::T_INT:
-          return (int)CRM_Utils_Array::value($field, $values, $default);
+          return (int) CRM_Utils_Array::value($field, $values, $default);
 
         case CRM_Utils_Type::T_FLOAT:
           // Round float values to three decimal places and trim trailing zeros.
@@ -227,7 +227,7 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue {
           $f = sprintf('%05.3f', $values[$field]);
           $f = rtrim($f, '0');
           $f = rtrim($f, '.');
-          return (float)(empty($f) ? '0' : $f);
+          return (float) (empty($f) ? '0' : $f);
       }
       return CRM_Utils_Array::value($field, $values, $default);
     }
index a858a1dcd17932df7af7624aa4390bda9b950ee3..4162f3bd37fbc0cb6bc18485f0404072ea8cae58 100644 (file)
@@ -280,7 +280,7 @@ class CRM_Core_BAO_PdfFormat extends CRM_Core_DAO_OptionValue {
     if (array_key_exists($field, self::$optionValueFields)) {
       switch (self::$optionValueFields[$field]['type']) {
         case CRM_Utils_Type::T_INT:
-          return (int)CRM_Utils_Array::value($field, $values, $default);
+          return (int) CRM_Utils_Array::value($field, $values, $default);
 
         case CRM_Utils_Type::T_FLOAT:
           // Round float values to three decimal places and trim trailing zeros.
@@ -288,7 +288,7 @@ class CRM_Core_BAO_PdfFormat extends CRM_Core_DAO_OptionValue {
           $f = sprintf('%05.3f', $values[$field]);
           $f = rtrim($f, '0');
           $f = rtrim($f, '.');
-          return (float)(empty($f) ? '0' : $f);
+          return (float) (empty($f) ? '0' : $f);
       }
       return CRM_Utils_Array::value($field, $values, $default);
     }
index b6563d059d11edba257caa10150ea2d765ac9f69..534a55a3303f7a5f46ca0b783db49a09b6c1e0c1 100644 (file)
@@ -158,8 +158,8 @@ ORDER BY civicrm_phone.is_primary DESC,  phone_id ASC ";
     );
 
     $numbers = $values = array();
-    $dao     = CRM_Core_DAO::executeQuery($query, $params);
-    $count   = 1;
+    $dao = CRM_Core_DAO::executeQuery($query, $params);
+    $count = 1;
     while ($dao->fetch()) {
       $values = array(
         'locationType' => $dao->locationType,
index ecfa4d9c72ef3814e7e3643ab30c8c1536f2266c..1b1900af9596bc11148ff2902bfde218e8504b61 100644 (file)
@@ -54,7 +54,7 @@ AND    v.is_active = 1
 
     $dirParams = array();
     $urlParams = array();
-    $dao       = CRM_Core_DAO::executeQuery($sql);
+    $dao = CRM_Core_DAO::executeQuery($sql);
     while ($dao->fetch()) {
       if (!isset($params[$dao->valueName])) {
         continue;
index d1ddbb4253dc7b5231be2eedb25b79216631eee3..00c0882de633a90120368a39b1d3ba9d28e54916 100644 (file)
@@ -86,9 +86,9 @@ WHERE  cacheKey     = %3 AND
         1 => array($mergeId, 'Integer'),
         2 => array($cacheKey, 'String'),
       );
-      $sql       = "SELECT pn.id, pn.entity_id1, pn.entity_id2, pn.data FROM civicrm_prevnext_cache pn {$join} ";
+      $sql = "SELECT pn.id, pn.entity_id1, pn.entity_id2, pn.data FROM civicrm_prevnext_cache pn {$join} ";
       $wherePrev = " WHERE pn.id < %1 AND pn.cacheKey = %2 {$where} ORDER BY ID DESC LIMIT 1";
-      $sqlPrev   = $sql . $wherePrev;
+      $sqlPrev = $sql . $wherePrev;
 
 
       $dao = CRM_Core_DAO::executeQuery($sqlPrev, $p);
@@ -148,9 +148,9 @@ WHERE  cacheKey     = %3 AND
     $params = array(1 => array($entityTable, 'String'));
 
     $pair =
-      ! $isViceVersa ?
-      "entity_id1 = %2 AND entity_id2 = %3" :
-      "(entity_id1 = %2 AND entity_id2 = %3) OR (entity_id1 = %3 AND entity_id2 = %2)";
+      !$isViceVersa ?
+        "entity_id1 = %2 AND entity_id2 = %3" :
+        "(entity_id1 = %2 AND entity_id2 = %3) OR (entity_id1 = %3 AND entity_id2 = %2)";
     $sql .= " AND ( {$pair} )";
     $params[2] = array($id1, 'Integer');
     $params[3] = array($id2, 'Integer');
@@ -289,8 +289,8 @@ WHERE cacheKey $op %1
         $cids[$dupe[1]] = 1;
       }
       $cidString = implode(', ', array_keys($cids));
-      $sql       = "SELECT id, display_name FROM civicrm_contact WHERE id IN ($cidString) ORDER BY sort_name";
-      $dao       = new CRM_Core_DAO();
+      $sql = "SELECT id, display_name FROM civicrm_contact WHERE id IN ($cidString) ORDER BY sort_name";
+      $dao = new CRM_Core_DAO();
       $dao->query($sql);
       while ($dao->fetch()) {
         $displayNames[$dao->id] = $dao->display_name;
@@ -480,7 +480,7 @@ WHERE  cacheKey LIKE %1
       $params['rowCount'] = CRM_Utils_Pager::ROWCOUNT;
     }
 
-    $qfKey = CRM_Utils_Request::retrieve('qfKey','String', $form);
+    $qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $form);
     $cacheKey = "civicrm search {$qfKey}";
 
     $query = "
index 35913c0511cc68a8325d24ee102523fe259de6c5..9fd18cf64fb48766f9b3ba2a84658c9d6ac8d8ac 100644 (file)
@@ -86,41 +86,41 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
 
   static $_tableDAOMapper =
     array(
-      'civicrm_event'       => 'CRM_Event_DAO_Event',
+      'civicrm_event' => 'CRM_Event_DAO_Event',
       'civicrm_price_set_entity' => 'CRM_Price_DAO_PriceSetEntity',
-      'civicrm_uf_join'     => 'CRM_Core_DAO_UFJoin',
+      'civicrm_uf_join' => 'CRM_Core_DAO_UFJoin',
       'civicrm_tell_friend' => 'CRM_Friend_DAO_Friend',
-      'civicrm_pcp_block'   => 'CRM_PCP_DAO_PCPBlock',
-      'civicrm_activity'    => 'CRM_Activity_DAO_Activity',
-      'civicrm_activity_contact'  => 'CRM_Activity_DAO_ActivityContact',
+      'civicrm_pcp_block' => 'CRM_PCP_DAO_PCPBlock',
+      'civicrm_activity' => 'CRM_Activity_DAO_Activity',
+      'civicrm_activity_contact' => 'CRM_Activity_DAO_ActivityContact',
     );
 
   static $_updateSkipFields =
     array(
-      'civicrm_event'       => array('start_date', 'end_date'),
+      'civicrm_event' => array('start_date', 'end_date'),
       'civicrm_tell_friend' => array('entity_id'),
-      'civicrm_pcp_block'   => array('entity_id'),
-      'civicrm_activity'    => array('activity_date_time'),
+      'civicrm_pcp_block' => array('entity_id'),
+      'civicrm_activity' => array('activity_date_time'),
     );
 
   static $_linkedEntitiesInfo =
     array(
       'civicrm_tell_friend' => array(
-        'entity_id_col'    => 'entity_id',
+        'entity_id_col' => 'entity_id',
         'entity_table_col' => 'entity_table'
       ),
       'civicrm_price_set_entity' => array(
-        'entity_id_col'    => 'entity_id',
+        'entity_id_col' => 'entity_id',
         'entity_table_col' => 'entity_table',
-        'is_multirecord'   => TRUE,
+        'is_multirecord' => TRUE,
       ),
       'civicrm_uf_join' => array(
-        'entity_id_col'    => 'entity_id',
+        'entity_id_col' => 'entity_id',
         'entity_table_col' => 'entity_table',
-        'is_multirecord'   => TRUE,
+        'is_multirecord' => TRUE,
       ),
       'civicrm_pcp_block' => array(
-        'entity_id_col'    => 'entity_id',
+        'entity_id_col' => 'entity_id',
         'entity_table_col' => 'entity_table'
       ),
     );
@@ -132,6 +132,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
   public static function setStatus($status) {
     self::$status = $status;
   }
+
   /**
    * Save records in civicrm_recujrring_entity table
    *
@@ -181,8 +182,8 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
   public static function quickAdd($parentId, $entityId, $entityTable) {
     $params =
       array(
-        'parent_id'    => $parentId,
-        'entity_id'    => $entityId,
+        'parent_id' => $parentId,
+        'entity_id' => $entityId,
         'entity_table' => $entityTable
       );
     return self::add($params);
@@ -255,7 +256,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
   public function generateEntities() {
     self::setStatus(self::RUNNING);
 
-    $newEntities  = array();
+    $newEntities = array();
     $findCriteria = array();
     if (!empty($this->recursionDates)) {
       if ($this->entity_id) {
@@ -329,7 +330,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
       $exRangeStart = $exRangeEnd = NULL;
       if (!empty($this->excludeDateRangeColumns)) {
         $exRangeStart = $this->excludeDateRangeColumns[0];
-        $exRangeEnd   = $this->excludeDateRangeColumns[1];
+        $exRangeEnd = $this->excludeDateRangeColumns[1];
       }
 
       $count = 1;
@@ -351,7 +352,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
         }
         if ($exRangeStart) {
           $exRangeStartDate = CRM_Utils_Date::processDate($recursionDates[$count][$exRangeStart], NULL, FALSE, 'Ymd');
-          $exRangeEndDate   = CRM_Utils_Date::processDate($recursionDates[$count][$exRangeEnd], NULL, FALSE, 'Ymd');
+          $exRangeEndDate = CRM_Utils_Date::processDate($recursionDates[$count][$exRangeEnd], NULL, FALSE, 'Ymd');
         }
 
         foreach ($this->excludeDates as $exDate) {
@@ -419,7 +420,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
     }
 
     $queryParams = array(
-      1 => array($parentId,    'Integer'),
+      1 => array($parentId, 'Integer'),
       2 => array($entityTable, 'String'),
       3 => array($initiatorId, 'Integer'),
     );
@@ -546,7 +547,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
     $newObject = CRM_Core_DAO::copyGeneric($daoName, $fromCriteria, $newParams);
 
     if (is_a($newObject, 'CRM_Core_DAO') && $newObject->id && $createRecurringEntity) {
-      $object = new $daoName( );
+      $object = new $daoName();
       foreach ($fromCriteria as $key => $value) {
         $object->$key = $value;
       }
@@ -609,7 +610,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
       $processedEntities[$key] = 1;
 
       if (array_key_exists($entityTable, self::$_tableDAOMapper)) {
-        $daoName  = self::$_tableDAOMapper[$entityTable];
+        $daoName = self::$_tableDAOMapper[$entityTable];
 
         $skipData = array();
         if (array_key_exists($entityTable, self::$_updateSkipFields)) {
@@ -681,14 +682,15 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
     if (empty($hasaRecurringRecord)) {
       // check if its a linked entity
       if (array_key_exists($obj->__table, self::$_linkedEntitiesInfo) &&
-        !CRM_Utils_Array::value('is_multirecord', self::$_linkedEntitiesInfo[$obj->__table])) {
+        !CRM_Utils_Array::value('is_multirecord', self::$_linkedEntitiesInfo[$obj->__table])
+      ) {
         $linkedDAO = new self::$_tableDAOMapper[$obj->__table]();
         $linkedDAO->id = $obj->id;
         if ($linkedDAO->find(TRUE)) {
           $idCol = self::$_linkedEntitiesInfo[$obj->__table]['entity_id_col'];
           $tableCol = self::$_linkedEntitiesInfo[$obj->__table]['entity_table_col'];
 
-          $pEntityID    = $linkedDAO->$idCol;
+          $pEntityID = $linkedDAO->$idCol;
           $pEntityTable = $linkedDAO->$tableCol;
 
           // find all parent recurring entity set
@@ -719,7 +721,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
               else {
                 // linked entity doesn't exist. lets create them
                 $newCriteria = array(
-                  $idCol    => $val['id'],
+                  $idCol => $val['id'],
                   $tableCol => $val['table']
                 );
                 $linkedObj = CRM_Core_BAO_RecurringEntity::copyCreateEntity($obj->__table,
@@ -884,7 +886,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
       }
       if ($formParams['repeats_by'] == 2) {
         if (CRM_Utils_Array::value('entity_status_1', $formParams) && CRM_Utils_Array::value('entity_status_2', $formParams)) {
-          $dbParams['entity_status'] = $formParams['entity_status_1']." ".$formParams['entity_status_2'];
+          $dbParams['entity_status'] = $formParams['entity_status_1'] . " " . $formParams['entity_status_2'];
         }
       }
     }
@@ -976,7 +978,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
         if ($repetition_frequency_unit == "day") {
           $repetition_frequency_unit = "dai";
         }
-        $repetition_frequency_unit = $repetition_frequency_unit.'ly';
+        $repetition_frequency_unit = $repetition_frequency_unit . 'ly';
         $r->recur($start, $repetition_frequency_unit);
       }
 
@@ -1005,27 +1007,27 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
         if ($scheduleReminderDetails['entity_status']) {
           $startActionDate = explode(" ", $scheduleReminderDetails['entity_status']);
           switch ($startActionDate[0]) {
-          case 'first':
-            $startActionDate1 = 1;
-            break;
+            case 'first':
+              $startActionDate1 = 1;
+              break;
 
-          case 'second':
-            $startActionDate1 = 2;
-            break;
+            case 'second':
+              $startActionDate1 = 2;
+              break;
 
-          case 'third':
-            $startActionDate1 = 3;
-            break;
+            case 'third':
+              $startActionDate1 = 3;
+              break;
 
-          case 'fourth':
-            $startActionDate1 = 4;
-            break;
+            case 'fourth':
+              $startActionDate1 = 4;
+              break;
 
-          case 'last':
-            $startActionDate1 = -1;
-            break;
+            case 'last':
+              $startActionDate1 = -1;
+              break;
           }
-          $concatStartActionDateBits = $startActionDate1.strtoupper(substr($startActionDate[1], 0, 2));
+          $concatStartActionDateBits = $startActionDate1 . strtoupper(substr($startActionDate[1], 0, 2));
           $r->byday(array($concatStartActionDateBits));
         }
         elseif ($scheduleReminderDetails['limit_to']) {
@@ -1043,7 +1045,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
 
       if (CRM_Utils_Array::value('absolute_date', $scheduleReminderDetails)) {
         $absoluteDate = CRM_Utils_Date::setDateDefaults($scheduleReminderDetails['absolute_date']);
-        $endDate = new DateTime($absoluteDate[0].' '.$absoluteDate[1]);
+        $endDate = new DateTime($absoluteDate[0] . ' ' . $absoluteDate[1]);
         $endDate->modify('+1 day');
         $r->until($endDate);
       }
@@ -1075,7 +1077,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
   static public function getInterval($startDate, $endDate) {
     if ($startDate && $endDate) {
       $startDate = new DateTime($startDate);
-      $endDate   = new DateTime($endDate);
+      $endDate = new DateTime($endDate);
       return $startDate->diff($endDate);
     }
   }
@@ -1122,7 +1124,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
    */
   public static function updateModeLinkedEntity($entityId, $linkedEntityTable, $mainEntityTable) {
     $result = array();
-    if ( $entityId && $linkedEntityTable && $mainEntityTable ) {
+    if ($entityId && $linkedEntityTable && $mainEntityTable) {
       if (CRM_Utils_Array::value($linkedEntityTable, self::$_tableDAOMapper)) {
         $dao = self::$_tableDAOMapper[$linkedEntityTable];
       }
@@ -1132,9 +1134,9 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
       }
       $entityTable = $linkedEntityTable;
       $params = array(
-                      'entity_id' => $entityId,
-                      'entity_table' => $mainEntityTable
-                    );
+        'entity_id' => $entityId,
+        'entity_table' => $mainEntityTable
+      );
       $defaults = array();
       CRM_Core_DAO::commonRetrieve($dao, $params, $defaults);
       if (CRM_Utils_Array::value('id', $defaults)) {
index 9e03d4781120e1bd217f435f21cbc459d3e02558..2969bfab3a6ebb56fadb626c007924e50fa0de34 100644 (file)
  * structure, similar to what is used in GenCode.php
  *
  * $table = array(
   'name'       => TABLE_NAME,
* 'name'       => TABLE_NAME,
  *                'attributes' => ATTRIBUTES,
  *                'fields'     => array(
  *                                      array(
   'name'          => FIELD_NAME,
* 'name'          => FIELD_NAME,
  *                                             'type'          => FIELD_SQL_TYPE,
- // can be field, index, constraint
// can be field, index, constraint
  *                                             'class'         => FIELD_CLASS_TYPE,
  *                                             'primary'       => BOOLEAN,
  *                                             'required'      => BOOLEAN,
@@ -437,7 +437,12 @@ ADD UNIQUE INDEX `unique_entity_id` ( `entity_id` )";
         $lengthName = isset($substrLenghts[$table][$field]) ? "_{$substrLenghts[$table][$field]}" : '';
         $lengthSize = isset($substrLenghts[$table][$field]) ? "({$substrLenghts[$table][$field]})" : '';
 
-        $names = array("index_{$field}{$lengthName}", "FK_{$table}_{$field}{$lengthName}", "UI_{$field}{$lengthName}", "{$createIndexPrefix}_{$field}{$lengthName}");
+        $names = array(
+          "index_{$field}{$lengthName}",
+          "FK_{$table}_{$field}{$lengthName}",
+          "UI_{$field}{$lengthName}",
+          "{$createIndexPrefix}_{$field}{$lengthName}"
+        );
 
         // skip to the next $field if one of the above $names exists; handle multilingual for CRM-4126
         foreach ($names as $name) {
@@ -515,12 +520,12 @@ MODIFY      {$columnName} varchar( $length )
     }
     else {
       CRM_Core_Error::fatal(ts('Could Not Find Custom Field Details for %1, %2, %3',
-          array(
-            1 => $tableName,
-            2 => $columnName,
-            3 => $customFieldID,
-          )
-        ));
+        array(
+          1 => $tableName,
+          2 => $columnName,
+          3 => $customFieldID,
+        )
+      ));
     }
   }
 }
index 584c60fd06c5f2387a8e208eddf5c9391a9a423f..185274762d1cd673b3d167f44f2e0635a4c86afb 100644 (file)
@@ -114,10 +114,11 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
 
     return isset(self::$_cache[$cacheKey]) ? $cacheKey : NULL;
   }
+
   /**
-  * Allow key o be cleared
-  * @param string $cacheKey
-  */
+   * Allow key o be cleared
+   * @param string $cacheKey
+   */
   public static function flushCache($cacheKey) {
     unset(self::$_cache[$cacheKey]);
     $globalCache = CRM_Utils_Cache::singleton();
@@ -183,7 +184,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
     $dao->name = $name;
     $dao->component_id = $componentID;
     if (empty($domainID)) {
-      $dao->domain_id  = CRM_Core_Config::domainID();
+      $dao->domain_id = CRM_Core_Config::domainID();
     }
     else {
       $dao->domain_id = $domainID;
@@ -293,12 +294,13 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
       foreach ($fieldsToGet as $name => $value) {
         if (!empty($fields['values'][$name]['prefetch'])) {
           if (isset($params['filters']) && isset($params['filters']['prefetch'])
-            && $params['filters']['prefetch'] == 0) {
+            && $params['filters']['prefetch'] == 0
+          ) {
             // we are filtering out the prefetches from the return array
             // so we will skip
             continue;
           }
-          $configKey = CRM_Utils_Array::value('config_key', $fields['values'][$name],  $name);
+          $configKey = CRM_Utils_Array::value('config_key', $fields['values'][$name], $name);
           if (isset($config->$configKey)) {
             $setting = $config->$configKey;
           }
@@ -306,13 +308,13 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
         else {
           $setting =
             CRM_Core_BAO_Setting::getItem(
-            $fields['values'][$name]['group_name'],
-            $name,
-            CRM_Utils_Array::value('component_id', $params),
-            NULL,
-            CRM_Utils_Array::value('contact_id', $params),
-            $domainID
-          );
+              $fields['values'][$name]['group_name'],
+              $name,
+              CRM_Utils_Array::value('component_id', $params),
+              NULL,
+              CRM_Utils_Array::value('contact_id', $params),
+              $domainID
+            );
         }
         if (!is_null($setting)) {
           // we won't return if not set - helps in return all scenario - otherwise we can't indentify the missing ones
@@ -562,7 +564,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
       list($name) = array_keys($settingParams);
       $getFieldsParams['name'] = $name;
     }
-    $fields = civicrm_api3('setting','getfields', $getFieldsParams);
+    $fields = civicrm_api3('setting', 'getfields', $getFieldsParams);
     $invalidParams = (array_diff_key($settingParams, $fields['values']));
     if (!empty($invalidParams)) {
       throw new api_Exception(implode(',', array_keys($invalidParams)) . " not valid settings");
@@ -585,14 +587,14 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
    */
   public static function validateSetting(&$value, $fieldSpec) {
     if ($fieldSpec['type'] == 'String' && is_array($value)) {
-      $value = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,$value) . CRM_Core_DAO::VALUE_SEPARATOR;
+      $value = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR, $value) . CRM_Core_DAO::VALUE_SEPARATOR;
     }
     if (empty($fieldSpec['validate_callback'])) {
       return TRUE;
     }
     else {
-      list($class,$fn) = explode('::',$fieldSpec['validate_callback']);
-      if (!$class::$fn($value,$fieldSpec)) {
+      list($class, $fn) = explode('::', $fieldSpec['validate_callback']);
+      if (!$class::$fn($value, $fieldSpec)) {
         throw new api_Exception("validation failed for {$fieldSpec['name']} = $value  based on callback {$fieldSpec['validate_callback']}");
       }
     }
@@ -669,7 +671,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
         $metaDataFolders = array($civicrm_root . '/settings');
         CRM_Utils_Hook::alterSettingsFolders($metaDataFolders);
         $settingsMetadata = self::loadSettingsMetaDataFolders($metaDataFolders);
-        CRM_Core_BAO_Cache::setItem($settingsMetadata,'CiviCRM setting Spec', 'All', $componentID);
+        CRM_Core_BAO_Cache::setItem($settingsMetadata, 'CiviCRM setting Spec', 'All', $componentID);
       }
       $cached = 0;
     }
@@ -721,7 +723,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
       $settings = include $file;
       $settingMetaData = array_merge($settingMetaData, $settings);
     }
-    CRM_Core_BAO_Cache::setItem($settingMetaData,'CiviCRM setting Spec', 'All');
+    CRM_Core_BAO_Cache::setItem($settingMetaData, 'CiviCRM setting Spec', 'All');
     return $settingMetaData;
   }
 
@@ -916,8 +918,8 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
 
       if (!empty($cbValues)) {
         $optionValue = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,
-          array_keys($cbValues)
-        ) . CRM_Core_DAO::VALUE_SEPARATOR;
+            array_keys($cbValues)
+          ) . CRM_Core_DAO::VALUE_SEPARATOR;
       }
       else {
         $optionValue = NULL;
index 60eb5fe2513aec79ad20fe6fc43d6c523e527986..3fb43ecee8ee8dee4ea5cb3a631fc14a4f32b01f 100644 (file)
@@ -128,10 +128,11 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag {
    * @return array
    */
   public static function getTagsUsedFor($usedFor = array(
-    'civicrm_contact'),
-    $buildSelect = TRUE,
-    $all = FALSE,
-    $parentId = NULL
+      'civicrm_contact'
+    ),
+                                        $buildSelect = TRUE,
+                                        $all = FALSE,
+                                        $parentId = NULL
   ) {
     $tags = array();
 
@@ -247,7 +248,7 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag {
           'prefix' => '',
           'name' => $dao->name,
           'idPrefix' => $idPrefix,
-          );
+        );
       }
       else {
         $rows[] = array(
@@ -256,7 +257,7 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag {
           'name' => $dao->name,
           'parent_id' => $dao->parent_id,
           'idPrefix' => $idPrefix,
-         );
+        );
       }
     }
 
@@ -267,14 +268,14 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag {
     // iterate through because we must modify the unplaced nodes list
     // during the loop.
     while (count($roots)) {
-      $new_roots         = array();
-      $current_rows      = $rows;
-      $root              = array_shift($roots);
+      $new_roots = array();
+      $current_rows = $rows;
+      $root = array_shift($roots);
       $tags[$root['id']] = array(
         $root['prefix'],
         $root['name'],
         $root['idPrefix'],
-        );
+      );
 
       // As you find the children, append them to the end of the new set
       // of roots (maintain alphabetical ordering). Also remove the node
@@ -287,7 +288,7 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag {
               'prefix' => $tags[$root['id']][0] . $separator,
               'name' => $row['name'],
               'idPrefix' => $row['idPrefix'],
-              );
+            );
             unset($rows[$key]);
           }
         }
@@ -384,8 +385,8 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag {
 
     // save creator id and time
     if (!$tag->id) {
-      $session           = CRM_Core_Session::singleton();
-      $tag->created_id   = $session->get('userID');
+      $session = CRM_Core_Session::singleton();
+      $tag->created_id = $session->get('userID');
       $tag->created_date = date('YmdHis');
     }
 
@@ -396,7 +397,7 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag {
     if ($tag->parent_id === 'null') {
       CRM_Core_DAO::executeQuery("UPDATE civicrm_tag SET used_for=%1 WHERE parent_id = %2",
         array(
-      1 => array($params['used_for'], 'String'),
+          1 => array($params['used_for'], 'String'),
           2 => array($tag->id, 'Integer'),
         )
       );
@@ -438,7 +439,12 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag {
     $tagSets = array();
     $query = "SELECT name, id FROM civicrm_tag
               WHERE is_tagset=1 AND parent_id IS NULL and used_for LIKE %1";
-    $dao = CRM_Core_DAO::executeQuery($query, array(1 => array('%' . $entityTable . '%', 'String')), TRUE, NULL, FALSE, FALSE);
+    $dao = CRM_Core_DAO::executeQuery($query, array(
+        1 => array(
+          '%' . $entityTable . '%',
+          'String'
+        )
+      ), TRUE, NULL, FALSE, FALSE);
     while ($dao->fetch()) {
       $tagSets[$dao->id] = $dao->name;
     }
index 935abc51435842794d8ea094ea80359617b558a1..e9a005ad3378b3c3f4544945ead72f714b7ade1c 100644 (file)
@@ -812,11 +812,12 @@ SELECT  id
 
     $profileFields = civicrm_api3('uf_field', 'get', array_merge($profileFilter,
       array(
-    'is_active' => 1,
-    'return' => 'field_name, is_required',
-    'options' => array(
-        'limit' => 0,
-      ))
+        'is_active' => 1,
+        'return' => 'field_name, is_required',
+        'options' => array(
+          'limit' => 0,
+        )
+      )
     ));
     //check for valid fields ( fields that are present in billing block )
     $validBillingFields = array(
@@ -848,30 +849,31 @@ SELECT  id
     }
 
     if (!empty($index) && (
-      // it's empty so we set it OR
-      !CRM_Utils_array::value($prefixName, $profileAddressFields)
+        // it's empty so we set it OR
+        !CRM_Utils_array::value($prefixName, $profileAddressFields)
         //we are dealing with billing id (precedence)
         || $index == $billing_id
         // we are dealing with primary & billing not set
         || ($index == 'Primary' && $profileAddressFields[$prefixName] != $billing_id)
         || ($index == CRM_Core_BAO_LocationType::getDefault()->id
-        && $profileAddressFields[$prefixName] != $billing_id
-        && $profileAddressFields[$prefixName] != 'Primary'
+          && $profileAddressFields[$prefixName] != $billing_id
+          && $profileAddressFields[$prefixName] != 'Primary'
+        )
       )
-    )
     ) {
       $profileAddressFields[$prefixName] = $index;
     }
 
     $potentiallyMissingRequiredFields = array_diff($requiredBillingFields, $requiredProfileFields);
-    CRM_Core_Resources::singleton()->addSetting(array('billing' => array('billingProfileIsHideable' => empty($potentiallyMissingRequiredFields))));
+    CRM_Core_Resources::singleton()
+      ->addSetting(array('billing' => array('billingProfileIsHideable' => empty($potentiallyMissingRequiredFields))));
   }
 
   /**
    * Get a list of fields which can be added to profiles
    *
-   * @param int $gid: UF group ID
-   * @param array $defaults: Form defaults
+   * @param int $gid : UF group ID
+   * @param array $defaults : Form defaults
    * @return array, multidimensional; e.g. $result['FieldGroup']['field_name']['label']
    * @static
    */
index 3cbe698ea41cc7367058365f7f5df7fd77a5902b..47fbdd855127c32c3fc7c8caac81538d91df9774 100644 (file)
@@ -70,9 +70,9 @@ class CRM_Core_BAO_UFJoin extends CRM_Core_DAO_UFJoin {
    * @param array $params
    */
   public static function deleteAll(&$params) {
-    $module      = CRM_Utils_Array::value('module', $params);
+    $module = CRM_Utils_Array::value('module', $params);
     $entityTable = CRM_Utils_Array::value('entity_table', $params);
-    $entityID    = CRM_Utils_Array::value('entity_id', $params);
+    $entityID = CRM_Utils_Array::value('entity_id', $params);
 
     if (empty($entityTable) ||
       empty($entityID) ||
@@ -81,10 +81,10 @@ class CRM_Core_BAO_UFJoin extends CRM_Core_DAO_UFJoin {
       return;
     }
 
-    $dao               = new CRM_Core_DAO_UFJoin();
-    $dao->module       = $module;
+    $dao = new CRM_Core_DAO_UFJoin();
+    $dao->module = $module;
     $dao->entity_table = $entityTable;
-    $dao->entity_id    = $entityID;
+    $dao->entity_id = $entityID;
     $dao->delete();
   }
 
@@ -142,8 +142,8 @@ class CRM_Core_BAO_UFJoin extends CRM_Core_DAO_UFJoin {
     $dao = new CRM_Core_DAO_UFJoin();
 
     $dao->entity_table = CRM_Utils_Array::value('entity_table', $params);
-    $dao->entity_id    = CRM_Utils_Array::value('entity_id', $params);
-    $dao->weight       = CRM_Utils_Array::value('weight', $params);
+    $dao->entity_id = CRM_Utils_Array::value('entity_id', $params);
+    $dao->weight = CRM_Utils_Array::value('weight', $params);
     if ($dao->find(TRUE)) {
       return $dao->uf_group_id;
     }
index 4c63a4d41b86b20eb2593c3ed9caabdc2cdba6b2..b3aa1ce8ee6589b4e99af1a17d059d38add81ac9 100644 (file)
@@ -129,16 +129,16 @@ class CRM_Core_BAO_UFMatch extends CRM_Core_DAO_UFMatch {
     }
 
     //make sure we have session w/ consistent ids.
-    $ufID     = $ufmatch->uf_id;
-    $userID   = $ufmatch->contact_id;
+    $ufID = $ufmatch->uf_id;
+    $userID = $ufmatch->contact_id;
     $ufUniqID = '';
     if ($isUserLoggedIn) {
       $loggedInUserUfID = CRM_Utils_System::getLoggedInUfID();
       //are we processing logged in user.
       if ($loggedInUserUfID && $loggedInUserUfID != $ufID) {
-        $userIds  = self::getUFValues($loggedInUserUfID);
-        $ufID     = CRM_Utils_Array::value('uf_id', $userIds, '');
-        $userID   = CRM_Utils_Array::value('contact_id', $userIds, '');
+        $userIds = self::getUFValues($loggedInUserUfID);
+        $ufID = CRM_Utils_Array::value('uf_id', $userIds, '');
+        $userID = CRM_Utils_Array::value('contact_id', $userIds, '');
         $ufUniqID = CRM_Utils_Array::value('uf_name', $userIds, '');
       }
     }
@@ -202,9 +202,9 @@ class CRM_Core_BAO_UFMatch extends CRM_Core_DAO_UFMatch {
     $newContact = FALSE;
 
     // make sure that a contact id exists for this user id
-    $ufmatch            = new CRM_Core_DAO_UFMatch();
+    $ufmatch = new CRM_Core_DAO_UFMatch();
     $ufmatch->domain_id = CRM_Core_Config::domainID();
-    $ufmatch->uf_id     = $userKey;
+    $ufmatch->uf_id = $userKey;
 
     if (!$ufmatch->find(TRUE)) {
       $transaction = new CRM_Core_Transaction();
@@ -261,9 +261,9 @@ AND    domain_id = %2
         $conflict = CRM_Core_DAO::singleValueQuery($sql, $params);
 
         if (!$conflict) {
-          $found               = TRUE;
+          $found = TRUE;
           $ufmatch->contact_id = $dao->contact_id;
-          $ufmatch->uf_name    = $uniqId;
+          $ufmatch->uf_name = $uniqId;
         }
       }
 
@@ -310,9 +310,9 @@ AND    domain_id = %2
           }
         }
 
-        $contactId           = CRM_Contact_BAO_Contact::createProfileContact($params, CRM_Core_DAO::$_nullArray);
+        $contactId = CRM_Contact_BAO_Contact::createProfileContact($params, CRM_Core_DAO::$_nullArray);
         $ufmatch->contact_id = $contactId;
-        $ufmatch->uf_name    = $uniqId;
+        $ufmatch->uf_name = $uniqId;
       }
 
       // check that there are not two CMS IDs matching the same CiviCRM contact - this happens when a civicrm
@@ -385,9 +385,9 @@ AND    domain_id    = %4
     $update = FALSE;
 
     // 1.do check for contact Id.
-    $ufmatch             = new CRM_Core_DAO_UFMatch();
+    $ufmatch = new CRM_Core_DAO_UFMatch();
     $ufmatch->contact_id = $contactId;
-    $ufmatch->domain_id  = CRM_Core_Config::domainID();
+    $ufmatch->domain_id = CRM_Core_Config::domainID();
     if (!$ufmatch->find(TRUE)) {
       return;
     }
@@ -431,9 +431,9 @@ AND    domain_id    = %4
     $strtolower = function_exists('mb_strtolower') ? 'mb_strtolower' : 'strtolower';
     $emailAddress = $strtolower($emailAddress);
 
-    $ufmatch             = new CRM_Core_DAO_UFMatch();
+    $ufmatch = new CRM_Core_DAO_UFMatch();
     $ufmatch->contact_id = $contactId;
-    $ufmatch->domain_id  = CRM_Core_Config::domainID();
+    $ufmatch->domain_id = CRM_Core_Config::domainID();
     if ($ufmatch->find(TRUE)) {
       // Save the email in UF Match table
       $ufmatch->uf_name = $emailAddress;
@@ -458,10 +458,10 @@ AND    domain_id    = %4
       }
       else {
         //else insert a new email record
-        $email             = new CRM_Core_DAO_Email();
+        $email = new CRM_Core_DAO_Email();
         $email->contact_id = $contactId;
         $email->is_primary = 1;
-        $email->email      = $emailAddress;
+        $email->email = $emailAddress;
         $email->save();
         $emailID = $email->id;
       }
@@ -648,8 +648,8 @@ AND    domain_id    = %4
 
     static $ufValues;
     if ($ufID && !isset($ufValues[$ufID])) {
-      $ufmatch            = new CRM_Core_DAO_UFMatch();
-      $ufmatch->uf_id     = $ufID;
+      $ufmatch = new CRM_Core_DAO_UFMatch();
+      $ufmatch->uf_id = $ufID;
       $ufmatch->domain_id = CRM_Core_Config::domainID();
       if ($ufmatch->find(TRUE)) {
         $ufValues[$ufID] = array(
index c0c29093d0b6f550d5122f460ca0691b3c692417..868382130e6630450a0792561fd8cebede022a53 100644 (file)
@@ -139,8 +139,8 @@ class CRM_Core_BAO_Website extends CRM_Core_DAO_Website {
    * @static
    */
   public static function &getValues(&$params, &$values) {
-    $websites            = array();
-    $website             = new CRM_Core_DAO_Website();
+    $websites = array();
+    $website = new CRM_Core_DAO_Website();
     $website->contact_id = $params['contact_id'];
     $website->find();
 
@@ -180,8 +180,8 @@ SELECT  id, website_type_id
     $params = array(1 => array($id, 'Integer'));
 
     $websites = $values = array();
-    $dao      = CRM_Core_DAO::executeQuery($query, $params);
-    $count    = 1;
+    $dao = CRM_Core_DAO::executeQuery($query, $params);
+    $count = 1;
     while ($dao->fetch()) {
       $values = array(
         'id' => $dao->id,
index 3f6493d262e27c239e839b333683bcfb8e7fe34b..fa182559efcf022fa7ece07b5609ed3eb26e4fa0 100644 (file)
@@ -48,6 +48,7 @@ class CRM_Core_BAO_WordReplacement extends CRM_Core_DAO_WordReplacement {
   public function __construct() {
     parent::__construct();
   }
+
   /**
    * Takes a bunch of params that are needed to match certain criteria and
    * retrieves the relevant objects.
@@ -235,8 +236,8 @@ WHERE  domain_id = %1
     $wordReplacementCreateParams = array();
     // get all domains
     $result = civicrm_api3('domain', 'get', array(
-                                                  'return' => array('locale_custom_strings'),
-                                                  ));
+      'return' => array('locale_custom_strings'),
+    ));
     if (!empty($result["values"])) {
       foreach ($result["values"] as $value) {
         $params = array();
index 0422e4964fd2b460cf69a133f7c36fdae412fea9..f697b0f9aaf097586b76a9325be1ba8459134a50 100644 (file)
@@ -240,7 +240,9 @@ class CRM_Core_Block {
     foreach (self::properties() as $id => $value) {
       if ($value['active']) {
         if (in_array($id, array(
-          self::ADD, self::CREATE_NEW))) {
+          self::ADD,
+          self::CREATE_NEW
+        ))) {
           $hasAccess = TRUE;
           if (!CRM_Core_Permission::check('add contacts') &&
             !CRM_Core_Permission::check('edit groups')
@@ -304,7 +306,7 @@ class CRM_Core_Block {
         $defaultLocation = CRM_Core_BAO_LocationType::getDefault();
         $defaultPrimaryLocationId = $defaultLocation->id;
         $values = array(
-        'postURL' => CRM_Utils_System::url('civicrm/contact/add', 'reset=1&ct=Individual'),
+          'postURL' => CRM_Utils_System::url('civicrm/contact/add', 'reset=1&ct=Individual'),
           'primaryLocationType' => $defaultPrimaryLocationId,
         );
 
@@ -328,7 +330,8 @@ class CRM_Core_Block {
         $urlArray = array(
           'fullTextSearchID' => CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue',
             'CRM_Contact_Form_Search_Custom_FullText', 'value', 'name'
-          ));
+          )
+        );
         self::setProperty(self::FULLTEXT_SEARCH, 'templateValues', $urlArray);
         break;
 
@@ -367,7 +370,8 @@ class CRM_Core_Block {
           'query' => 'action=add&reset=1&context=standalone',
           'ref' => 'new-activity',
           'title' => ts('Activity'),
-        )));
+        )
+      ));
 
       $components = CRM_Core_Component::getEnabledComponents();
 
@@ -385,30 +389,33 @@ class CRM_Core_Block {
       // new email (select recipients)
       $shortCuts = array_merge($shortCuts, array(
         array(
-      'path' => 'civicrm/activity/email/add',
-            'query' => 'atype=3&action=add&reset=1&context=standalone',
-            'ref' => 'new-email',
-            'title' => ts('Email'),
-          )));
+          'path' => 'civicrm/activity/email/add',
+          'query' => 'atype=3&action=add&reset=1&context=standalone',
+          'ref' => 'new-email',
+          'title' => ts('Email'),
+        )
+      ));
 
       if (CRM_Core_Permission::check('edit groups')) {
         $shortCuts = array_merge($shortCuts, array(
           array(
-        'path' => 'civicrm/group/add',
-              'query' => 'reset=1',
-              'ref' => 'new-group',
-              'title' => ts('Group'),
-            )));
+            'path' => 'civicrm/group/add',
+            'query' => 'reset=1',
+            'ref' => 'new-group',
+            'title' => ts('Group'),
+          )
+        ));
       }
 
       if (CRM_Core_Permission::check('administer CiviCRM')) {
         $shortCuts = array_merge($shortCuts, array(
           array(
-        'path' => 'civicrm/admin/tag',
-              'query' => 'reset=1&action=add',
-              'ref' => 'new-tag',
-              'title' => ts('Tag'),
-            )));
+            'path' => 'civicrm/admin/tag',
+            'query' => 'reset=1&action=add',
+            'ref' => 'new-tag',
+            'title' => ts('Tag'),
+          )
+        ));
       }
 
       if (empty($shortCuts)) {
@@ -453,7 +460,7 @@ class CRM_Core_Block {
       $value['url'] = CRM_Utils_System::url($short['path'], $short['query'], FALSE);
     }
     $value['title'] = $short['title'];
-    $value['ref']   = $short['ref'];
+    $value['ref'] = $short['ref'];
     if (!empty($short['shortCuts'])) {
       foreach ($short['shortCuts'] as $shortCut) {
         $value['shortCuts'][] = self::setShortcutValues($shortCut);
@@ -472,10 +479,11 @@ class CRM_Core_Block {
     if (CRM_Core_Permission::check('access Contact Dashboard')) {
       $dashboardLinks = array(
         array(
-      'path' => 'civicrm/user',
+          'path' => 'civicrm/user',
           'query' => 'reset=1',
           'title' => ts('My Contact Dashboard'),
-        ));
+        )
+      );
     }
 
     if (empty($dashboardLinks)) {
@@ -492,8 +500,8 @@ class CRM_Core_Block {
         $value['url'] = CRM_Utils_System::url($dash['path'], $dash['query'], FALSE);
       }
       $value['title'] = $dash['title'];
-      $value['key']   = CRM_Utils_Array::value('key', $dash);
-      $values[]       = $value;
+      $value['key'] = CRM_Utils_Array::value('key', $dash);
+      $values[] = $value;
     }
     self::setProperty(self::DASHBOARD, 'templateValues', array('dashboardLinks' => $values));
   }
@@ -509,7 +517,7 @@ class CRM_Core_Block {
     if (!($shortCuts)) {
       $shortCuts = array(
         array(
-      'path' => 'civicrm/mailing/send',
+          'path' => 'civicrm/mailing/send',
           'query' => 'reset=1',
           'title' => ts('Send Mailing'),
         ),
@@ -523,10 +531,10 @@ class CRM_Core_Block {
 
     $values = array();
     foreach ($shortCuts as $short) {
-      $value          = array();
-      $value['url']   = CRM_Utils_System::url($short['path'], $short['query']);
+      $value = array();
+      $value['url'] = CRM_Utils_System::url($short['path'], $short['query']);
       $value['title'] = $short['title'];
-      $values[]       = $value;
+      $values[] = $value;
     }
     self::setProperty(self::MAIL, 'templateValues', array('shortCuts' => $values));
   }
@@ -635,9 +643,9 @@ class CRM_Core_Block {
       return NULL;
     }
 
-    $block            = array();
-    $block['name']    = 'block-civicrm';
-    $block['id']      = $block['name'] . '_' . $id;
+    $block = array();
+    $block['name'] = 'block-civicrm';
+    $block['id'] = $block['name'] . '_' . $id;
     $block['subject'] = self::fetch($id, 'Subject.tpl',
       array('subject' => self::getProperty($id, 'subject'))
     );
index 086169ff5264670ca210f16821b85e118cb82803..82b87dad28c4389f23eecdc2207bfc1825585685 100644 (file)
@@ -16,7 +16,11 @@ class CRM_Core_CodeGen_Config extends CRM_Core_CodeGen_BaseTask {
 
   public function setupCms() {
     if (!in_array($this->config->cms, array(
-      'drupal', 'joomla', 'wordpress'))) {
+      'drupal',
+      'joomla',
+      'wordpress'
+    ))
+    ) {
       echo "Config file for '{$this->config->cms}' not known.";
       exit();
     }
index fe7009f43cbe3792a7838a6aba9a30b0f8bbbc8f..dc47ad99fcce9fc7f5a8dbf112b9127142920ff7 100644 (file)
@@ -49,9 +49,9 @@ class CRM_Core_CodeGen_Main {
 
     CRM_Core_CodeGen_Util_Smarty::singleton()->setPluginDirs($smartyPluginDirs);
 
-    $versionFile        = "version.xml";
-    $versionXML         = CRM_Core_CodeGen_Util_Xml::parse($versionFile);
-    $this->db_version         = $versionXML->version_no;
+    $versionFile = "version.xml";
+    $versionXML = CRM_Core_CodeGen_Util_Xml::parse($versionFile);
+    $this->db_version = $versionXML->version_no;
     $this->buildVersion = preg_replace('/^(\d{1,2}\.\d{1,2})\.(\d{1,2}|\w{4,7})$/i', '$1', $this->db_version);
     if (isset($argVersion)) {
       // change the version to that explicitly passed, if any
index b15d3208d867cd83ac056ebc6d7a08281a561988..f6f09d398064c9ad2bf94f89e4c272bdf1e3bff9 100644 (file)
@@ -282,9 +282,9 @@ class CRM_Core_CodeGen_Specification {
    * @param $fields
    */
   public function getField(&$fieldXML, &$fields) {
-    $name  = trim((string ) $fieldXML->name);
+    $name = trim((string ) $fieldXML->name);
     $field = array('name' => $name, 'localizable' => $fieldXML->localizable);
-    $type  = (string ) $fieldXML->type;
+    $type = (string ) $fieldXML->type;
     switch ($type) {
       case 'varchar':
       case 'char':
@@ -303,7 +303,7 @@ class CRM_Core_CodeGen_Specification {
         $field['cols'] = isset($fieldXML->html) ? $this->value('cols', $fieldXML->html) : NULL;
         break;
 
-      break;
+        break;
 
       case 'datetime':
         $field['sqlType'] = $field['phpType'] = $type;
@@ -344,10 +344,10 @@ class CRM_Core_CodeGen_Specification {
     }
 
     $field['required'] = $this->value('required', $fieldXML);
-    $field['collate']  = $this->value('collate', $fieldXML);
-    $field['comment']  = $this->value('comment', $fieldXML);
-    $field['default']  = $this->value('default', $fieldXML);
-    $field['import']   = $this->value('import', $fieldXML);
+    $field['collate'] = $this->value('collate', $fieldXML);
+    $field['comment'] = $this->value('comment', $fieldXML);
+    $field['default'] = $this->value('default', $fieldXML);
+    $field['import'] = $this->value('import', $fieldXML);
     if ($this->value('export', $fieldXML)) {
       $field['export'] = $this->value('export', $fieldXML);
     }
@@ -477,8 +477,8 @@ class CRM_Core_CodeGen_Specification {
 
     $index = array();
     // empty index name is fine
-    $indexName      = trim((string) $indexXML->name);
-    $index['name']  = $indexName;
+    $indexName = trim((string) $indexXML->name);
+    $index['name'] = $indexName;
     $index['field'] = array();
 
     // populate fields
index ddd9138a2bcc8b29091e228b046426338da02af4..a24414581806d7c887fcb9702ba73af8e91be183 100644 (file)
@@ -275,8 +275,8 @@ class CRM_Core_Component {
     $fields = array();
     foreach ($info as $name => $comp) {
       if ($comp->usesSearch()) {
-        $bqr    = $comp->getBAOQueryObject();
-        $flds   = $bqr->getFields();
+        $bqr = $comp->getBAOQueryObject();
+        $flds = $bqr->getFields();
         $fields = array_merge($fields, $flds);
       }
     }
index 31e4d51032ff6b53678f7276e0bed2c499d9ccb2..2833538d5cf7ecbbc6835dccbfabb8f26377dfc0 100644 (file)
@@ -34,7 +34,6 @@
  * $Id$
  *
  */
-
 abstract class CRM_Core_Component_Config {
 
   /**
index e7c7b8099c2c0476f48afbc70e199e0998d528df..9145675271d364de0e5eda3d8f1c6148a05f3c0a 100644 (file)
@@ -34,7 +34,6 @@
  * $Id$
  *
  */
-
 abstract class CRM_Core_Component_Info {
 
   /**
@@ -105,10 +104,10 @@ abstract class CRM_Core_Component_Info {
    * @param int $componentID
    */
   public function __construct($name, $namespace, $componentID) {
-    $this->name        = $name;
-    $this->namespace   = $namespace;
+    $this->name = $name;
+    $this->namespace = $namespace;
     $this->componentID = $componentID;
-    $this->info        = $this->getInfo();
+    $this->info = $this->getInfo();
     $this->info['url'] = $this->getKeyword();
   }
 
index 404bd0f4ce7ea5162e4d46339bf538545721b54d..049fdbc87aacbc5dff7fd2626f6d2754bcc02ffe 100644 (file)
@@ -654,7 +654,12 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
 
     // Whether we delete/create or simply preserve directories, we should
     // certainly make sure the restrictions are enforced.
-    foreach (array($this->templateCompileDir, $this->uploadDir, $this->configAndLogDir, $this->customFileUploadDir) as $dir) {
+    foreach (array(
+               $this->templateCompileDir,
+               $this->uploadDir,
+               $this->configAndLogDir,
+               $this->customFileUploadDir
+             ) as $dir) {
       if ($dir && is_dir($dir)) {
         CRM_Utils_File::restrictAccess($dir);
       }
index 666a9d7ad9e1cf23dbcfb9ecdfaae5a8bb1a6339..212ec85ee7b3c9630bb64b9cf4e88f32afd6130a 100644 (file)
@@ -162,14 +162,15 @@ class CRM_Core_Config_Defaults {
         global $civicrm_root;
         $cmsPath = $config->userSystem->cmsRootPath();
         $defaults['userFrameworkResourceURL'] = $baseURL . str_replace("$cmsPath/", '',
-          str_replace('\\', '/', $civicrm_root)
-        );
+            str_replace('\\', '/', $civicrm_root)
+          );
 
         if (strpos($civicrm_root,
             DIRECTORY_SEPARATOR . 'sites' .
             DIRECTORY_SEPARATOR . 'all' .
             DIRECTORY_SEPARATOR . 'modules'
-          ) === FALSE) {
+          ) === FALSE
+        ) {
           $startPos = strpos($civicrm_root,
             DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR
           );
index ac4c29b2e1281ffe5a38fcf7107b7b2dddf66935..cae11fbefa2ae25f98ff39efe244c9e1507725f0 100644 (file)
@@ -342,8 +342,12 @@ class CRM_Core_Config_Variables extends CRM_Core_Config_Defaults {
    * @var array
    */
   public $enableComponents = array(
-    'CiviContribute', 'CiviPledge', 'CiviMember',
-    'CiviEvent', 'CiviMail', 'CiviReport',
+    'CiviContribute',
+    'CiviPledge',
+    'CiviMember',
+    'CiviEvent',
+    'CiviMail',
+    'CiviReport',
   );
   public $enableComponentIDs = array(1, 6, 2, 3, 4, 8);
 
index 4a2bce9ece78db27b78e1e0ce2c8af454b84436c..6bcc5661a0f4a7dcb2cae9194cc7fbd8889a8f21 100644 (file)
@@ -205,7 +205,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
       // definitely different for different forms
       $name = $scope;
     }
-    $name         = $name . '_' . $this->key($name, $addSequence, $ignoreKey);
+    $name = $name . '_' . $this->key($name, $addSequence, $ignoreKey);
     $this->_title = $title;
     if ($scope) {
       $this->_scope = $scope;
@@ -220,8 +220,8 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
     if (!empty($this->_key)) {
       CRM_Core_Session::registerAndRetrieveSessionObjects(array(
         "_{$name}_container",
-          array('CiviCRM', $this->_scope),
-        ));
+        array('CiviCRM', $this->_scope),
+      ));
     }
 
     $this->HTML_QuickForm_Controller($name, $modal);
@@ -280,7 +280,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
 
   public function fini() {
     CRM_Core_BAO_Cache::storeSessionToCache(array(
-      "_{$this->_name}_container",
+        "_{$this->_name}_container",
         array('CiviCRM', $this->_scope),
       ),
       TRUE
@@ -443,8 +443,8 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
     $pages = $stateMachine->getPages();
     foreach ($pages as $name => $value) {
       $className = CRM_Utils_Array::value('className', $value, $name);
-      $title     = CRM_Utils_Array::value('title', $value);
-      $options   = CRM_Utils_Array::value('options', $value);
+      $title = CRM_Utils_Array::value('title', $value);
+      $options = CRM_Utils_Array::value('options', $value);
       $stateName = CRM_Utils_String::getClassName($className);
       if (!empty($value['className'])) {
         $formName = $name;
@@ -536,7 +536,6 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
    * @param string $name
    *   : name of the variable.
    *
-
    *
    * @return mixed
    */
@@ -554,9 +553,9 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
    * @return array
    */
   public function wizardHeader($currentPageName) {
-    $wizard          = array();
+    $wizard = array();
     $wizard['steps'] = array();
-    $count           = 0;
+    $count = 0;
     foreach ($this->_pages as $name => $page) {
       $count++;
       $wizard['steps'][] = array(
index eb8c70d806adf4ff30ef5e816ad390589d044884..a51e857b5c1a00637a25cf2a51867b20c9d4070e 100644 (file)
@@ -52,16 +52,16 @@ class CRM_Core_DAO extends DB_DataObject {
 
   static $_dbColumnValueCache = NULL;
   const NOT_NULL = 1, IS_NULL = 2,
-  DB_DAO_NOTNULL = 128,
-  VALUE_SEPARATOR = "\ 1",
-  BULK_INSERT_COUNT = 200,
-  BULK_INSERT_HIGH_COUNT = 200,
-  // special value for mail bulk inserts to avoid
-  // potential duplication, assuming a smaller number reduces number of queries
-  // by some factor, so some tradeoff. CRM-8678
-  BULK_MAIL_INSERT_COUNT = 10,
-  QUERY_FORMAT_WILDCARD = 1,
-  QUERY_FORMAT_NO_QUOTES = 2;
+    DB_DAO_NOTNULL = 128,
+    VALUE_SEPARATOR = "\ 1",
+    BULK_INSERT_COUNT = 200,
+    BULK_INSERT_HIGH_COUNT = 200,
+    // special value for mail bulk inserts to avoid
+    // potential duplication, assuming a smaller number reduces number of queries
+    // by some factor, so some tradeoff. CRM-8678
+    BULK_MAIL_INSERT_COUNT = 10,
+    QUERY_FORMAT_WILDCARD = 1,
+    QUERY_FORMAT_NO_QUOTES = 2;
 
   /*
    * Define entities that shouldn't be created or deleted when creating/ deleting
@@ -412,7 +412,7 @@ class CRM_Core_DAO extends DB_DataObject {
    *
    * @return array
    */
-   static function &fields() {
+  static function &fields() {
     $result = NULL;
     return $result;
   }
@@ -492,10 +492,10 @@ class CRM_Core_DAO extends DB_DataObject {
       return;
     }
 
-    $dao                = new CRM_Core_DAO_Log();
-    $dao->entity_table  = $this->getTableName();
-    $dao->entity_id     = $this->id;
-    $dao->modified_id   = $cid;
+    $dao = new CRM_Core_DAO_Log();
+    $dao->entity_table = $this->getTableName();
+    $dao->entity_id = $this->id;
+    $dao->modified_id = $cid;
     $dao->modified_date = date("YmdHis");
     $dao->insert();
   }
@@ -602,7 +602,7 @@ class CRM_Core_DAO extends DB_DataObject {
           $cols = 80;
         }
 
-        $attributes         = array();
+        $attributes = array();
         $attributes['rows'] = $rows;
         $attributes['cols'] = $cols;
         return $attributes;
@@ -631,7 +631,7 @@ class CRM_Core_DAO extends DB_DataObject {
    * @static
    */
   public static function getAttribute($class, $fieldName = NULL) {
-    $object = new $class( );
+    $object = new $class();
     $fields = &$object->fields();
     if ($fieldName != NULL) {
       $field = CRM_Utils_Array::value($fieldName, $fields);
@@ -680,7 +680,7 @@ class CRM_Core_DAO extends DB_DataObject {
    * @static
    */
   public static function objectExists($value, $daoName, $daoID, $fieldName = 'name') {
-    $object = new $daoName( );
+    $object = new $daoName();
     $object->$fieldName = $value;
 
     $config = CRM_Core_Config::singleton();
@@ -712,7 +712,7 @@ FROM $tableName
 LIKE %1
 ";
     $params = array(1 => array($columnName, 'String'));
-    $dao    = CRM_Core_DAO::executeQuery($query, $params, TRUE, NULL, FALSE, $i18nRewrite);
+    $dao = CRM_Core_DAO::executeQuery($query, $params, TRUE, NULL, FALSE, $i18nRewrite);
     $result = $dao->fetch() ? TRUE : FALSE;
     $dao->free();
     return $result;
@@ -872,7 +872,7 @@ LIKE %1
     }
     $constraint = "`FK_{$tableName}_{$columnName}`";
     $pattern = "/\bCONSTRAINT\b\s+%s\s+\bFOREIGN\s+KEY\b\s/i";
-    return preg_match(sprintf($pattern, $constraint),$show[$tableName]) ? TRUE : FALSE;
+    return preg_match(sprintf($pattern, $constraint), $show[$tableName]) ? TRUE : FALSE;
   }
 
   /**
@@ -887,8 +887,8 @@ LIKE %1
    * @static
    */
   public static function checkFieldHasAlwaysValue($tableName, $columnName, $columnValue) {
-    $query  = "SELECT * FROM $tableName WHERE $columnName != '$columnValue'";
-    $dao    = CRM_Core_DAO::executeQuery($query);
+    $query = "SELECT * FROM $tableName WHERE $columnName != '$columnValue'";
+    $dao = CRM_Core_DAO::executeQuery($query);
     $result = $dao->fetch() ? FALSE : TRUE;
     $dao->free();
     return $result;
@@ -905,8 +905,8 @@ LIKE %1
    * @static
    */
   public static function checkFieldIsAlwaysNull($tableName, $columnName) {
-    $query  = "SELECT * FROM $tableName WHERE $columnName IS NOT NULL";
-    $dao    = CRM_Core_DAO::executeQuery($query);
+    $query = "SELECT * FROM $tableName WHERE $columnName IS NOT NULL";
+    $dao = CRM_Core_DAO::executeQuery($query);
     $result = $dao->fetch() ? FALSE : TRUE;
     $dao->free();
     return $result;
@@ -1000,7 +1000,7 @@ FROM   civicrm_domain
     }
 
     if (!array_key_exists($cacheKey, self::$_dbColumnValueCache) || $force) {
-      $object   = new $daoName( );
+      $object = new $daoName();
       $object->$searchColumn = $searchValue;
       $object->selectAdd();
       $object->selectAdd($returnColumn);
@@ -1035,7 +1035,7 @@ FROM   civicrm_domain
    * @static
    */
   public static function setFieldValue($daoName, $searchValue, $setColumn, $setValue, $searchColumn = 'id') {
-    $object = new $daoName( );
+    $object = new $daoName();
     $object->selectAdd();
     $object->selectAdd("$searchColumn, $setColumn");
     $object->$searchColumn = $searchValue;
@@ -1094,7 +1094,7 @@ FROM   civicrm_domain
    * @static
    */
   public static function commonRetrieve($daoName, &$params, &$defaults, $returnProperities = NULL) {
-    $object = new $daoName( );
+    $object = new $daoName();
     $object->copyValues($params);
 
     // return only specific fields if returnproperties are sent
@@ -1122,7 +1122,7 @@ FROM   civicrm_domain
    * @static
    */
   public static function deleteEntityContact($daoName, $contactId) {
-    $object = new $daoName( );
+    $object = new $daoName();
 
     $object->entity_table = 'civicrm_contact';
     $object->entity_id = $contactId;
@@ -1147,11 +1147,11 @@ FROM   civicrm_domain
    */
   static function &executeQuery(
     $query,
-    $params        = array(),
-    $abort         = TRUE,
-    $daoName       = NULL,
-    $freeDAO       = FALSE,
-    $i18nRewrite   = TRUE,
+    $params = array(),
+    $abort = TRUE,
+    $daoName = NULL,
+    $freeDAO = FALSE,
+    $i18nRewrite = TRUE,
     $trapException = FALSE
   ) {
     $queryStr = self::composeQuery($query, $params, $abort);
@@ -1160,7 +1160,7 @@ FROM   civicrm_domain
       $dao = new CRM_Core_DAO();
     }
     else {
-      $dao = new $daoName( );
+      $dao = new $daoName();
     }
 
     if ($trapException) {
@@ -1197,8 +1197,8 @@ FROM   civicrm_domain
    */
   static function &singleValueQuery(
     $query,
-    $params      = array(),
-    $abort       = TRUE,
+    $params = array(),
+    $abort = TRUE,
     $i18nRewrite = TRUE
   ) {
     $queryStr = self::composeQuery($query, $params, $abort);
@@ -1326,7 +1326,7 @@ FROM   civicrm_domain
    * @return (reference )                   the newly created copy of the object
    */
   static function &copyGeneric($daoName, $criteria, $newData = NULL, $fieldsFix = NULL, $blockCopyOfDependencies = NULL) {
-    $object = new $daoName( );
+    $object = new $daoName();
     if (!$newData) {
       $object->id = $criteria['id'];
     }
@@ -1346,12 +1346,12 @@ FROM   civicrm_domain
         break;
       }
 
-      $newObject   = new $daoName( );
+      $newObject = new $daoName();
 
       $fields = &$object->fields();
       if (!is_array($fieldsFix)) {
-        $fieldsToPrefix  = array();
-        $fieldsToSuffix  = array();
+        $fieldsToPrefix = array();
+        $fieldsToSuffix = array();
         $fieldsToReplace = array();
       }
       if (!empty($fieldsFix['prefix'])) {
@@ -1399,11 +1399,11 @@ FROM   civicrm_domain
   }
 
   public static function cascadeUpdate($daoName, $fromId, $toId, $newData = array()) {
-    $object = new $daoName( );
+    $object = new $daoName();
     $object->id = $fromId;
 
     if ($object->find(TRUE)) {
-      $newObject = new $daoName( );
+      $newObject = new $daoName();
       $newObject->id = $toId;
 
       if ($newObject->find(TRUE)) {
@@ -1479,8 +1479,8 @@ SELECT contact_id
    * @static
    */
   public static function commonRetrieveAll($daoName, $fieldIdName = 'id', $fieldId, &$details, $returnProperities = NULL) {
-    require_once (str_replace('_', DIRECTORY_SEPARATOR, $daoName) . ".php");
-    $object = new $daoName( );
+    require_once(str_replace('_', DIRECTORY_SEPARATOR, $daoName) . ".php");
+    $object = new $daoName();
     $object->$fieldIdName = $fieldId;
 
     // return only specific fields if returnproperties are sent
@@ -1582,7 +1582,8 @@ SELECT contact_id
     // note that mysql does not escape these characters
     if ($string && in_array($string,
         array('%', '_', '%%', '_%')
-      )) {
+      )
+    ) {
       return '\\' . $string;
     }
 
@@ -1618,7 +1619,8 @@ SELECT contact_id
       'CRM_Core_DAO_StateProvince',
       'CRM_Core_DAO_Country',
       'CRM_Core_DAO_Domain',
-      'CRM_Financial_DAO_FinancialType'//because valid ones exist & we use pick them due to pseudoconstant can't reliably create & delete these
+      'CRM_Financial_DAO_FinancialType'
+      //because valid ones exist & we use pick them due to pseudoconstant can't reliably create & delete these
     );
 
     // Prefer to instantiate BAO's instead of DAO's (when possible)
@@ -1634,7 +1636,7 @@ SELECT contact_id
       /** @var CRM_Core_DAO $object */
       $object = new $daoName();
 
-      $fields = & $object->fields();
+      $fields = &$object->fields();
       foreach ($fields as $fieldName => $fieldDef) {
         $dbName = $fieldDef['name'];
         $FKClassName = CRM_Utils_Array::value('FKClassName', $fieldDef);
@@ -1708,7 +1710,8 @@ SELECT contact_id
           && ($required || $dbName == 'contact_id')
           //I'm a bit stuck on this one - we might need to change the singleValueAlter so that the entities don't share a contact
           // to make this test process pass - line below makes pass for now
-          && $dbName != 'member_of_contact_id') {
+          && $dbName != 'member_of_contact_id'
+        ) {
           $deletions[] = array($FKClassName, array('id' => $object->$dbName)); // x
         }
       }
@@ -1718,7 +1721,7 @@ SELECT contact_id
 
     foreach ($deletions as $deletion) {
       CRM_Core_DAO::deleteTestObjects($deletion[0], $deletion[1]);
-  }
+    }
   }
 
   /**
@@ -1976,11 +1979,11 @@ SELECT contact_id
       }
       foreach ($tables as $eventName => $events) {
         foreach ($events as $whenName => $parts) {
-          $varString   = implode("\n", $parts['variables']);
-          $sqlString   = implode("\n", $parts['sql']);
-          $validName   = CRM_Core_DAO::shortenSQLName($tableName, 48, TRUE);
+          $varString = implode("\n", $parts['variables']);
+          $sqlString = implode("\n", $parts['sql']);
+          $validName = CRM_Core_DAO::shortenSQLName($tableName, 48, TRUE);
           $triggerName = "{$validName}_{$whenName}_{$eventName}";
-          $triggerSQL  = "CREATE TRIGGER $triggerName $whenName $eventName ON $tableName FOR EACH ROW BEGIN $varString $sqlString END";
+          $triggerSQL = "CREATE TRIGGER $triggerName $whenName $eventName ON $tableName FOR EACH ROW BEGIN $varString $sqlString END";
 
           CRM_Core_DAO::executeQuery("DROP TRIGGER IF EXISTS $triggerName");
           CRM_Core_DAO::executeQuery(
@@ -2295,7 +2298,7 @@ SELECT contact_id
 
           default:
             if (!$returnSanitisedArray) {
-              return(sprintf('%s %s "%s"', $fieldName, $operator, CRM_Core_DAO::escapeString($criteria)));
+              return (sprintf('%s %s "%s"', $fieldName, $operator, CRM_Core_DAO::escapeString($criteria)));
             }
             else {
               return NULL; // not yet implemented (tests required to implement)
@@ -2311,7 +2314,23 @@ SELECT contact_id
    * @return array
    */
   public static function acceptedSQLOperators() {
-    return array('=', '<=', '>=', '>', '<', 'LIKE', "<>", "!=", "NOT LIKE", 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN', 'IS NOT NULL', 'IS NULL');
+    return array(
+      '=',
+      '<=',
+      '>=',
+      '>',
+      '<',
+      'LIKE',
+      "<>",
+      "!=",
+      "NOT LIKE",
+      'IN',
+      'NOT IN',
+      'BETWEEN',
+      'NOT BETWEEN',
+      'IS NOT NULL',
+      'IS NULL'
+    );
   }
 
   /**
@@ -2353,6 +2372,7 @@ SELECT contact_id
   /**
    * @param array $params
    */
-  public function setApiFilter(&$params) {}
+  public function setApiFilter(&$params) {
+  }
 
 }
index a40b31d0342fbf5354465de3b9462025570564f7..99242f9d38dfd9c24d1ad22205de702f22c212f4 100644 (file)
@@ -37,7 +37,7 @@ class CRM_Core_DAO_Factory {
     $file = self::$_prefix[$type] . $className;
     $class = str_replace('/', '_', $file);
 
-    require_once ($file . self::$_suffix);
+    require_once($file . self::$_suffix);
 
     if ($type == 'singleton') {
       $newObj = $class::singleton();
index ddf4353043916e82b4b9394cba096d8ca919463d..6df46c033a9e4d2cbeed7ef06083e0b53203dfb0 100644 (file)
  * Decide what permissions to check for an api call
  * The contact must have all of the returned permissions for the api call to be allowed
  *
- * @param $entity: (str) api entity
- * @param $action: (str) api action
- * @param $params: (array) api params
+ * @param $entity : (str) api entity
+ * @param $action : (str) api action
+ * @param $params : (array) api params
  *
  * @return array
  *   of permissions to check for this entity-action combo
+ *   of permissions to check for this entity-action combo
  */
 function _civicrm_api3_permissions($entity, $action, &$params) {
   $entity = _civicrm_api_get_entity_name_from_camel($entity);
index e493da6988dadedfa247c821433a60095178746b..0d3a48ed6be5c824d944e05559de68a7440df9a2 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * This is included for backward compatibility with DAO's generated before 4.5.
  *
index a1605e02fb068936297e333cc28a5c834545fc90..f9c4ec35d322f044a91a637b95887710a0f745ce 100644 (file)
@@ -62,7 +62,7 @@ class CRM_Exception extends PEAR_Exception {
    * @param int $code
    * @param Exception $previous
    */
-  public function __construct($message = NULL, $code = 0, Exception$previous = NULL) {
+  public function __construct($message = NULL, $code = 0, Exception $previous = NULL) {
     parent::__construct($message, $code, $previous);
   }
 }
@@ -188,15 +188,15 @@ class CRM_Core_Error extends PEAR_ErrorStack {
     }
 
     // create the error array
-    $error               = array();
-    $error['callback']   = $pearError->getCallback();
-    $error['code']       = $pearError->getCode();
-    $error['message']    = $pearError->getMessage();
-    $error['mode']       = $pearError->getMode();
+    $error = array();
+    $error['callback'] = $pearError->getCallback();
+    $error['code'] = $pearError->getCode();
+    $error['message'] = $pearError->getMessage();
+    $error['mode'] = $pearError->getMode();
     $error['debug_info'] = $pearError->getDebugInfo();
-    $error['type']       = $pearError->getType();
-    $error['user_info']  = $pearError->getUserInfo();
-    $error['to_string']  = $pearError->toString();
+    $error['type'] = $pearError->getType();
+    $error['user_info'] = $pearError->getUserInfo();
+    $error['to_string'] = $pearError->toString();
     if (function_exists('mysql_error') &&
       mysql_error()
     ) {
@@ -259,15 +259,15 @@ class CRM_Core_Error extends PEAR_ErrorStack {
   public static function simpleHandler($pearError) {
 
     // create the error array
-    $error               = array();
-    $error['callback']   = $pearError->getCallback();
-    $error['code']       = $pearError->getCode();
-    $error['message']    = $pearError->getMessage();
-    $error['mode']       = $pearError->getMode();
+    $error = array();
+    $error['callback'] = $pearError->getCallback();
+    $error['code'] = $pearError->getCode();
+    $error['message'] = $pearError->getMessage();
+    $error['mode'] = $pearError->getMode();
     $error['debug_info'] = $pearError->getDebugInfo();
-    $error['type']       = $pearError->getType();
-    $error['user_info']  = $pearError->getUserInfo();
-    $error['to_string']  = $pearError->toString();
+    $error['type'] = $pearError->getType();
+    $error['user_info'] = $pearError->getUserInfo();
+    $error['to_string'] = $pearError->toString();
 
     // ensure that debug does not check permissions since we are in bootstrap
     // mode and need to print a decent message to help the user
@@ -727,7 +727,7 @@ class CRM_Core_Error extends PEAR_ErrorStack {
 
       if (!empty($trace['args'])) {
         foreach ($trace['args'] as $arg) {
-          if (! $showArgs || $skipArgs) {
+          if (!$showArgs || $skipArgs) {
             $args[] = '(' . gettype($arg) . ')';
             continue;
           }
index c66707f37a7c7b1d3149d5ac114644ec5062c4cb..4d12f3aba9204c5676522aff9232a35fed5951ba 100644 (file)
@@ -38,7 +38,6 @@
  * @param array $data
  *   Extra params to return. eg an extra array of ids. It is not mandatory, but can help the computer using the api. Keep in mind the api consumer isn't to be trusted. eg. the database password is NOT a good extra data.
  */
-
 class CRM_Core_Exception extends PEAR_Exception {
   private $errorData = array();
 
index 5d910474dc5851a97154280858408d51806fe5a1..274f2b019e5eca28db0261e138b9046adcafb1d8 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+
 interface CRM_Core_FileSearchInterface {
   const DEFAULT_SEARCH_LIMIT = 20;
   const DEFAULT_SEARCH_OFFSET = 0;
index 82b2d6dc8c2a727ca12897883aa58584fee83c52..b1dd6f1d32dd5a78992ca2b359d917d1c17d703e 100644 (file)
@@ -221,14 +221,31 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
    */
   public function registerRules() {
     static $rules = array(
-      'title', 'longTitle', 'variable', 'qfVariable',
-      'phone', 'integer', 'query',
-      'url', 'wikiURL',
-      'domain', 'numberOfDigit',
-      'date', 'currentDate',
-      'asciiFile', 'htmlFile', 'utf8File',
-      'objectExists', 'optionExists', 'postalCode', 'money', 'positiveInteger',
-      'xssString', 'fileExists', 'autocomplete', 'validContact',
+      'title',
+      'longTitle',
+      'variable',
+      'qfVariable',
+      'phone',
+      'integer',
+      'query',
+      'url',
+      'wikiURL',
+      'domain',
+      'numberOfDigit',
+      'date',
+      'currentDate',
+      'asciiFile',
+      'htmlFile',
+      'utf8File',
+      'objectExists',
+      'optionExists',
+      'postalCode',
+      'money',
+      'positiveInteger',
+      'xssString',
+      'fileExists',
+      'autocomplete',
+      'validContact',
     );
 
     foreach ($rules as $rule) {
@@ -329,7 +346,11 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
     $this->postProcessHook();
 
     // Respond with JSON if in AJAX context (also support legacy value '6')
-    if ($allowAjax && !empty($_REQUEST['snippet']) && in_array($_REQUEST['snippet'], array(CRM_Core_Smarty::PRINT_JSON, 6))) {
+    if ($allowAjax && !empty($_REQUEST['snippet']) && in_array($_REQUEST['snippet'], array(
+          CRM_Core_Smarty::PRINT_JSON,
+          6
+        ))
+    ) {
       $this->ajaxResponse['buttonName'] = str_replace('_qf_' . $this->getAttribute('id') . '_', '', $this->controller->getButtonName());
       $this->ajaxResponse['action'] = $this->_action;
       if (isset($this->_id) || isset($this->id)) {
@@ -469,10 +490,10 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
 
     //Set html data-attribute to enable warning user of unsaved changes
     if ($this->unsavedChangesWarn === TRUE
-        || (!isset($this->unsavedChangesWarn)
-           && ($this->_action & CRM_Core_Action::ADD || $this->_action & CRM_Core_Action::UPDATE)
-           )
-        ) {
+      || (!isset($this->unsavedChangesWarn)
+        && ($this->_action & CRM_Core_Action::ADD || $this->_action & CRM_Core_Action::UPDATE)
+      )
+    ) {
       $this->setAttribute('data-warn-changes', 'true');
     }
   }
@@ -689,9 +710,9 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
     }
     else {
       $tplname = str_replace('_',
-        DIRECTORY_SEPARATOR,
-        CRM_Utils_System::getClassName($this)
-      ) . '.tpl';
+          DIRECTORY_SEPARATOR,
+          CRM_Utils_System::getClassName($this)
+        ) . '.tpl';
     }
     return $tplname;
   }
@@ -873,7 +894,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
    */
   public function addYesNo($id, $title, $allowClear = FALSE, $required = NULL, $attributes = array()) {
     $attributes += array('id_suffix' => $id);
-    $choice   = array();
+    $choice = array();
     $choice[] = $this->createElement('radio', NULL, '11', ts('Yes'), '1', $attributes);
     $choice[] = $this->createElement('radio', NULL, '11', ts('No'), '0', $attributes);
 
@@ -1112,8 +1133,8 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
       'editor_id'
     );
     $editor = strtolower(CRM_Utils_Array::value($editorID,
-        CRM_Core_OptionGroup::values('wysiwyg_editor')
-      ));
+      CRM_Core_OptionGroup::values('wysiwyg_editor')
+    ));
     if (!$editor || $forceTextarea) {
       $editor = 'textarea';
     }
@@ -1152,7 +1173,8 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
   public function addCountry($id, $title, $required = NULL, $extra = NULL) {
     $this->addElement('select', $id, $title,
       array(
-        '' => ts('- select -')) + CRM_Core_PseudoConstant::country(), $extra
+        '' => ts('- select -')
+      ) + CRM_Core_PseudoConstant::country(), $extra
     );
     if ($required) {
       $this->addRule($id, ts('Please select %1', array(1 => $title)), 'required');
@@ -1487,8 +1509,8 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
       if (!empty($params[$fieldName])) {
         $params[$fieldName] = CRM_Utils_Date::isoToMysql(
           CRM_Utils_Date::processDate(
-          $params[$fieldName],
-          CRM_Utils_Array::value("{$fieldName}_time", $params), TRUE)
+            $params[$fieldName],
+            CRM_Utils_Array::value("{$fieldName}_time", $params), TRUE)
         );
       }
       else {
@@ -1623,21 +1645,24 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
    */
   public function addAutoSelector($profiles = array(), $autoCompleteField = array()) {
     $autoCompleteField = array_merge(array(
-        'id_field' => 'select_contact_id',
-        'placeholder' => ts('Select someone else ...'),
-        'show_hide' => TRUE,
-        'api' => array('params' => array('contact_type' => 'Individual')),
-      ), $autoCompleteField);
+      'id_field' => 'select_contact_id',
+      'placeholder' => ts('Select someone else ...'),
+      'show_hide' => TRUE,
+      'api' => array('params' => array('contact_type' => 'Individual')),
+    ), $autoCompleteField);
 
     if ($this->canUseAjaxContactLookups()) {
       $this->assign('selectable', $autoCompleteField['id_field']);
-      $this->addEntityRef($autoCompleteField['id_field'], NULL, array('placeholder' => $autoCompleteField['placeholder'], 'api' => $autoCompleteField['api']));
+      $this->addEntityRef($autoCompleteField['id_field'], NULL, array(
+          'placeholder' => $autoCompleteField['placeholder'],
+          'api' => $autoCompleteField['api']
+        ));
 
       CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/AlternateContactSelector.js', 1, 'html-header')
-      ->addSetting(array(
-      'form' => array('autocompletes' => $autoCompleteField),
-      'ids' => array('profile' => $profiles),
-      ));
+        ->addSetting(array(
+          'form' => array('autocompletes' => $autoCompleteField),
+          'ids' => array('profile' => $profiles),
+        ));
     }
   }
 
@@ -1645,7 +1670,8 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
    */
   public function canUseAjaxContactLookups() {
     if (0 < (civicrm_api3('contact', 'getcount', array('check_permissions' => 1))) &&
-      CRM_Core_Permission::check(array(array('access AJAX API', 'access CiviCRM')))) {
+      CRM_Core_Permission::check(array(array('access AJAX API', 'access CiviCRM')))
+    ) {
       return TRUE;
     }
   }
@@ -1750,7 +1776,12 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
    */
   public function addChainSelect($elementName, $settings = array()) {
     $props = $settings += array(
-      'control_field' => str_replace(array('state_province', 'StateProvince', 'county', 'County'), array('country', 'Country', 'state_province', 'StateProvince'), $elementName),
+      'control_field' => str_replace(array('state_province', 'StateProvince', 'county', 'County'), array(
+          'country',
+          'Country',
+          'state_province',
+          'StateProvince'
+        ), $elementName),
       'data-callback' => strpos($elementName, 'rovince') ? 'civicrm/ajax/jqState' : 'civicrm/ajax/jqCounty',
       'label' => strpos($elementName, 'rovince') ? ts('State/Province') : ts('County'),
       'data-empty-prompt' => strpos($elementName, 'rovince') ? ts('Choose country first') : ts('Choose state first'),
index 35ad735a6756a1f2e0f696df7e8ca6565d41af1b..f52e21afefc65f80da0e66e8f8e4f645ac3a3489 100644 (file)
@@ -145,41 +145,34 @@ class CRM_Core_Form_Date {
         'previous_2.month' => ts('Previous 2 Months'),
         'previous_2.week' => ts('Previous 2 Weeks'),
         'previous_2.day' => ts('Previous 2 Days'),
-
         'previous_before.year' => ts('Prior to Previous Year'),
         'previous_before.quarter' => ts('Prior to Previous Quarter'),
         'previous_before.month' => ts('Prior to Previous Month'),
         'previous_before.week' => ts('Prior to Previous Week'),
         'previous_before.day' => ts('Prior to Previous Day'),
-
         'previous.year' => ts('Previous Year'),
         'previous.fiscal_year' => ts('Previous Fiscal Year'),
         'previous.quarter' => ts('Previous Quarter'),
         'previous.month' => ts('Previous Month'),
         'previous.week' => ts('Previous Week'),
-
         'earlier.year' => ts('To End of Previous Year'),
         'earlier.quarter' => ts('To End of Previous Quarter'),
         'earlier.month' => ts('To End of Previous Month'),
         'earlier.week' => ts('To End of Previous Week'),
         'earlier.day' => ts('To End of Previous Day'),
-
         'greater_previous.year' => ts('From End of Previous Year'),
         'greater_previous.quarter' => ts('From End of Previous Quarter'),
         'greater_previous.month' => ts('From End of Previous Month'),
         'greater_previous.week' => ts('From End of Previous Week'),
-
         'greater.year' => ts('From Start of Current Year'),
         'greater.quarter' => ts('From Start of Current Quarter'),
         'greater.month' => ts('From Start of Current Month'),
         'greater.week' => ts('From Start of Current Week'),
         'greater.day' => ts('From Start of Current Day'),
-
         'current.year' => ts('Current Year to-date'),
         'current.quarter' => ts('Current Quarter to-date'),
         'current.month' => ts('Current Month to-date'),
         'current.week' => ts('Current Week to-date'),
-
         'ending_3.year' => ts('Last 3 Years'),
         'ending_2.year' => ts('Last 2 Years'),
         'ending.year' => ts('Last 12 Months'),
@@ -187,24 +180,20 @@ class CRM_Core_Form_Date {
         'ending.month' => ts('Last Month'),
         'ending.week' => ts('Last 7 days'),
         'previous.day' => ts('Yesterday'),
-
         'this.year' => ts('This Year'),
         'this.fiscal_year' => ts('This Fiscal Year'),
         'this.quarter' => ts('This Quarter'),
         'this.month' => ts('This Month'),
         'this.week' => ts('This Week'),
         'this.day' => ts('Today'),
-
         'starting.day' => ts('Tomorrow'),
         'starting.week' => ts('Upcoming 7 days'),
         'starting.month' => ts('Upcoming Month'),
         'starting.year' => ts('Upcoming 12 Months'),
-
         'less.year' => ts('To End of Current Year'),
         'less.quarter' => ts('To End of Current Quarter'),
         'less.month' => ts('To End of Current Month'),
         'less.week' => ts('To End of Current Week'),
-
         'next.week' => ts('Next Week'),
         'next.month' => ts('Next Month'),
         'next.quarter' => ts('Next Quarter'),
@@ -252,7 +241,7 @@ class CRM_Core_Form_Date {
       $selector,
       $required,
       array('class' => 'crm-select2')
-      );
+    );
 
     $form->addDateRange($fieldName, $from, $to, $fromLabel, $dateFormat, FALSE, $displayTime);
   }
index 54d4798b308c7e5b6229b419fd73e1a6f7bb25ff..11d11270efafbd1114a97dab96b5316331836d4d 100644 (file)
@@ -33,6 +33,7 @@
  * $Id$
  *
  */
+
 /**
  * This class generates form components for processing Entity
  *
@@ -167,14 +168,14 @@ class CRM_Core_Form_RecurringEntity {
     }
     // echo "<pre>";print_r($freqUnitsDisplay);
     $dayOfTheWeek = array(
-    'monday'   => 'Monday',
-                          'tuesday'   => 'Tuesday',
-                          'wednesday' => 'Wednesday',
-                          'thursday'  => 'Thursday',
-                          'friday'    => 'Friday',
-                          'saturday'  => 'Saturday',
-                          'sunday'    => 'Sunday',
-                         );
+      'monday' => 'Monday',
+      'tuesday' => 'Tuesday',
+      'wednesday' => 'Wednesday',
+      'thursday' => 'Thursday',
+      'friday' => 'Friday',
+      'saturday' => 'Saturday',
+      'sunday' => 'Sunday',
+    );
     $form->add('select', 'repetition_frequency_unit', ts('Repeats:'), $freqUnitsDisplay);
     $numericOptions = CRM_Core_SelectValues::getNumericOptions(1, 30);
     $form->add('select', 'repetition_frequency_interval', ts('Repeats every:'), $numericOptions, '', array('style' => 'width:55px;'));
@@ -184,31 +185,34 @@ class CRM_Core_Form_RecurringEntity {
     }
     $form->addGroup($startActionCondition, 'start_action_condition', ts('Repeats on'));
     $roptionTypes = array(
-    '1' => ts('day of the month'),
-        '2' => ts('day of the week'),
-      );
+      '1' => ts('day of the month'),
+      '2' => ts('day of the week'),
+    );
     $form->addRadio('repeats_by', ts("Repeats By:"), $roptionTypes, array(), NULL);
     $getMonths = CRM_Core_SelectValues::getNumericOptions(1, 31);
     $form->add('select', 'limit_to', '', $getMonths, FALSE, array('style' => 'width:55px;'));
     $dayOfTheWeekNo = array(
-    'first'  => 'First',
-                            'second' => 'Second',
-                            'third' => 'Third',
-                            'fourth' => 'Fourth',
-                            'last'  => 'Last',
-                         );
+      'first' => 'First',
+      'second' => 'Second',
+      'third' => 'Third',
+      'fourth' => 'Fourth',
+      'last' => 'Last',
+    );
     $form->add('select', 'entity_status_1', ts(''), $dayOfTheWeekNo);
     $form->add('select', 'entity_status_2', ts(''), $dayOfTheWeek);
     $eoptionTypes = array(
-    '1' => ts('After'),
-        '2' => ts('On'),
-      );
+      '1' => ts('After'),
+      '2' => ts('On'),
+    );
     $form->addRadio('ends', ts("Ends:"), $eoptionTypes, array(), NULL);
     $form->add('text', 'start_action_offset', ts(''), array('size' => 3, 'maxlength' => 2));
     $form->addFormRule(array('CRM_Core_Form_RecurringEntity', 'formRule'));
     $form->addDate('repeat_absolute_date', ts('On'), FALSE, array('formatType' => 'mailing'));
     $form->addDate('exclude_date', ts('Exclude Date(s)'), FALSE);
-    $select = $form->add('select', 'exclude_date_list', ts(''), self::$_excludeDateInfo, FALSE, array('style' => 'width:150px;', 'size' => 4));
+    $select = $form->add('select', 'exclude_date_list', ts(''), self::$_excludeDateInfo, FALSE, array(
+        'style' => 'width:150px;',
+        'size' => 4
+      ));
     $select->setMultiple(TRUE);
     $form->addElement('button', 'add_to_exclude_list', '>>', 'onClick="addToExcludeList(document.getElementById(\'exclude_date\').value);"');
     $form->addElement('button', 'remove_from_exclude_list', '<<', 'onClick="removeFromExcludeList(\'exclude_date_list\')"');
@@ -359,35 +363,35 @@ class CRM_Core_Form_RecurringEntity {
 
           //Check if there exists any values for this option group
           $optionGroupIdExists = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup',
-              $type . '_repeat_exclude_dates_' . $params['parent_entity_id'],
-              'id',
-              'name'
-            );
+            $type . '_repeat_exclude_dates_' . $params['parent_entity_id'],
+            'id',
+            'name'
+          );
           if ($optionGroupIdExists) {
             CRM_Core_BAO_OptionGroup::del($optionGroupIdExists);
           }
           $optionGroupParams =
-              array(
-                'name'        => $type . '_repeat_exclude_dates_' . $actionScheduleObj->entity_value,
-                'title'       => $type . ' recursion',
-                'is_reserved' => 0,
-                'is_active'   => 1,
-              );
+            array(
+              'name' => $type . '_repeat_exclude_dates_' . $actionScheduleObj->entity_value,
+              'title' => $type . ' recursion',
+              'is_reserved' => 0,
+              'is_active' => 1,
+            );
           $opGroup = CRM_Core_BAO_OptionGroup::add($optionGroupParams);
           if ($opGroup->id) {
             $oldWeight = 0;
             $fieldValues = array('option_group_id' => $opGroup->id);
             foreach ($excludeDates as $val) {
               $optionGroupValue =
-                  array(
-                    'option_group_id' => $opGroup->id,
-                    'label'           => CRM_Utils_Date::processDate($val),
-                    'value'           => CRM_Utils_Date::processDate($val),
-                    'name'            => $opGroup->name,
-                    'description'     => 'Used for recurring ' . $type,
-                    'weight'          => CRM_Utils_Weight::updateOtherWeights('CRM_Core_DAO_OptionValue', $oldWeight, CRM_Utils_Array::value('weight', $params), $fieldValues),
-                    'is_active'       => 1,
-                  );
+                array(
+                  'option_group_id' => $opGroup->id,
+                  'label' => CRM_Utils_Date::processDate($val),
+                  'value' => CRM_Utils_Date::processDate($val),
+                  'name' => $opGroup->name,
+                  'description' => 'Used for recurring ' . $type,
+                  'weight' => CRM_Utils_Weight::updateOtherWeights('CRM_Core_DAO_OptionValue', $oldWeight, CRM_Utils_Array::value('weight', $params), $fieldValues),
+                  'is_active' => 1,
+                );
               $excludeDateList[] = $optionGroupValue['value'];
               CRM_Core_BAO_OptionValue::add($optionGroupValue);
             }
@@ -404,15 +408,18 @@ class CRM_Core_Form_RecurringEntity {
         if ($params['entity_id']) {
           //If entity has any pre delete function, consider that first
           if (CRM_Utils_Array::value('pre_delete_func', CRM_Core_BAO_RecurringEntity::$_recurringEntityHelper[$params['entity_table']]) &&
-              CRM_Utils_Array::value('helper_class', CRM_Core_BAO_RecurringEntity::$_recurringEntityHelper[$params['entity_table']])) {
+            CRM_Utils_Array::value('helper_class', CRM_Core_BAO_RecurringEntity::$_recurringEntityHelper[$params['entity_table']])
+          ) {
             call_user_func(array(
                 CRM_Core_BAO_RecurringEntity::$_recurringEntityHelper[$params['entity_table']]['helper_class'],
-                call_user_func_array(CRM_Core_BAO_RecurringEntity::$_recurringEntityHelper[$params['entity_table']]['pre_delete_func'], array($params['entity_id'])))
-              );
+                call_user_func_array(CRM_Core_BAO_RecurringEntity::$_recurringEntityHelper[$params['entity_table']]['pre_delete_func'], array($params['entity_id']))
+              )
+            );
           }
           //Ready to execute delete on entities if it has delete function set
           if (CRM_Utils_Array::value('delete_func', CRM_Core_BAO_RecurringEntity::$_recurringEntityHelper[$params['entity_table']]) &&
-            CRM_Utils_Array::value('helper_class', CRM_Core_BAO_RecurringEntity::$_recurringEntityHelper[$params['entity_table']])) {
+            CRM_Utils_Array::value('helper_class', CRM_Core_BAO_RecurringEntity::$_recurringEntityHelper[$params['entity_table']])
+          ) {
             //Check if pre delete function has some ids to be deleted
             if (!empty(CRM_Core_BAO_RecurringEntity::$_entitiesToBeDeleted)) {
               foreach (CRM_Core_BAO_RecurringEntity::$_entitiesToBeDeleted as $eid) {
@@ -456,8 +463,8 @@ class CRM_Core_Form_RecurringEntity {
         }
 
         $recursion = new CRM_Core_BAO_RecurringEntity();
-        $recursion->dateColumns  = $params['dateColumns'];
-        $recursion->scheduleId   = $actionScheduleObj->id;
+        $recursion->dateColumns = $params['dateColumns'];
+        $recursion->scheduleId = $actionScheduleObj->id;
 
         if (!empty($excludeDateList)) {
           $recursion->excludeDates = $excludeDateList;
index 890b5ca58c9d3c1ccc2d17608060aeaf5b8369a0..3d129acabe13a252f9ca50a42884a2928f5e623d 100644 (file)
@@ -290,7 +290,10 @@ class CRM_Core_Form_Renderer extends HTML_QuickForm_Renderer_ArraySmarty {
             $view[] = $contact[$fld];
           }
         }
-        $field->setAttribute('data-entity-value', json_encode(array('id' => $contact['id'], 'text' => implode(' :: ', $view))));
+        $field->setAttribute('data-entity-value', json_encode(array(
+              'id' => $contact['id'],
+              'text' => implode(' :: ', $view)
+            )));
       }
     }
   }
index b2a3706490ed2b3f21b2be1e0c1f1c4205da015d..825b00ca72c5da7babe66dfe4c288550fd37d188 100644 (file)
@@ -95,7 +95,7 @@ class CRM_Core_I18n {
 
       $mo_file = $config->gettextResourceDir . $locale . DIRECTORY_SEPARATOR . 'LC_MESSAGES' . DIRECTORY_SEPARATOR . 'civicrm.mo';
 
-      if (! file_exists($mo_file)) {
+      if (!file_exists($mo_file)) {
         // fallback to pre-4.5 mode
         $mo_file = $config->gettextResourceDir . $locale . DIRECTORY_SEPARATOR . 'civicrm.mo';
       }
@@ -152,7 +152,7 @@ class CRM_Core_I18n {
         if ($code == 'en_US') {
           continue;
         }
-        if (!in_array($code, $codes))unset($all[$code]);
+        if (!in_array($code, $codes)) unset($all[$code]);
       }
     }
 
@@ -259,7 +259,7 @@ class CRM_Core_I18n {
 
     // gettext domain for extensions
     $domain_changed = FALSE;
-    if (! empty($params['domain']) && $this->_phpgettext) {
+    if (!empty($params['domain']) && $this->_phpgettext) {
       if ($this->setGettextDomain($params['domain'])) {
         $domain_changed = TRUE;
       }
@@ -287,9 +287,9 @@ class CRM_Core_I18n {
       !$exactMatch &&
       isset($stringTable['enabled']['wildcardMatch'])
     ) {
-      $search  = array_keys($stringTable['enabled']['wildcardMatch']);
+      $search = array_keys($stringTable['enabled']['wildcardMatch']);
       $replace = array_values($stringTable['enabled']['wildcardMatch']);
-      $text    = str_replace($search, $replace, $text);
+      $text = str_replace($search, $replace, $text);
     }
 
     // dont translate if we've done exactMatch already
@@ -416,12 +416,12 @@ class CRM_Core_I18n {
    */
   public function setGettextDomain($key) {
     /* No domain changes for en_US */
-    if (! $this->_phpgettext) {
+    if (!$this->_phpgettext) {
       return FALSE;
     }
 
     // It's only necessary to find/bind once
-    if (! isset($this->_extensioncache[$key])) {
+    if (!isset($this->_extensioncache[$key])) {
       $config = CRM_Core_Config::singleton();
 
       try {
@@ -507,7 +507,7 @@ class CRM_Core_I18n {
  *   Array an array of additional parameters.
  *
  * @return string
  *   the translated string
+ *   the translated string
  */
 function ts($text, $params = array()) {
   static $config = NULL;
index 4107d889aac4064636ca8f1a6990088b5bfb949e..43dc06485d956ca74f88bef34c8c079de5608c86 100644 (file)
@@ -39,9 +39,9 @@ class CRM_Core_I18n_Form extends CRM_Core_Form {
     $this->_locales = array_keys($config->languageLimit);
 
     // get the part of the database we want to edit and validate it
-    $table            = CRM_Utils_Request::retrieve('table', 'String', $this);
-    $field            = CRM_Utils_Request::retrieve('field', 'String', $this);
-    $id               = CRM_Utils_Request::retrieve('id', 'Int', $this);
+    $table = CRM_Utils_Request::retrieve('table', 'String', $this);
+    $field = CRM_Utils_Request::retrieve('field', 'String', $this);
+    $id = CRM_Utils_Request::retrieve('id', 'Int', $this);
     $this->_structure = CRM_Core_I18n_SchemaStructure::columns();
     if (!isset($this->_structure[$table][$field])) {
       CRM_Core_Error::fatal("$table.$field is not internationalized.");
@@ -93,24 +93,24 @@ class CRM_Core_I18n_Form extends CRM_Core_Form {
 
   public function postProcess() {
     $values = $this->exportValues();
-    $table  = $values['table'];
-    $field  = $values['field'];
+    $table = $values['table'];
+    $field = $values['field'];
 
     // validate table and field
     if (!isset($this->_structure[$table][$field])) {
       CRM_Core_Error::fatal("$table.$field is not internationalized.");
     }
 
-    $cols   = array();
+    $cols = array();
     $params = array(array($values['id'], 'Int'));
-    $i      = 1;
+    $i = 1;
     foreach ($this->_locales as $locale) {
       $cols[] = "{$field}_{$locale} = %$i";
       $params[$i] = array($values["{$field}_{$locale}"], 'String');
       $i++;
     }
     $query = "UPDATE $table SET " . implode(', ', $cols) . " WHERE id = %0";
-    $dao   = new CRM_Core_DAO();
+    $dao = new CRM_Core_DAO();
     $query = CRM_Core_DAO::composeQuery($query, $params, TRUE);
     $dao->query($query, FALSE);
   }
index 79def54a8025d74ac5993db16b32aa6a5b23fa4a..61f5dc211285df1decd5547a1c7bd9af302480bd 100644 (file)
@@ -223,17 +223,17 @@ class CRM_Core_I18n_Schema {
 
     if (!empty($triggers)) {
       if (CRM_Core_Config::isUpgradeMode()) {
-      foreach ($triggers as $triggerInfo) {
-        $when = $triggerInfo['when'];
-        $event = $triggerInfo['event'];
-        $triggerName = "{$table}_{$when}_{$event}";
-        CRM_Core_DAO::executeQuery("DROP TRIGGER IF EXISTS {$triggerName}");
+        foreach ($triggers as $triggerInfo) {
+          $when = $triggerInfo['when'];
+          $event = $triggerInfo['event'];
+          $triggerName = "{$table}_{$when}_{$event}";
+          CRM_Core_DAO::executeQuery("DROP TRIGGER IF EXISTS {$triggerName}");
+        }
       }
-    }
 
-    // invoke the meta trigger creation call
-    CRM_Core_DAO::triggerRebuild($table);
-  }
+      // invoke the meta trigger creation call
+      CRM_Core_DAO::triggerRebuild($table);
+    }
   }
 
   /**
@@ -316,7 +316,7 @@ class CRM_Core_I18n_Schema {
       $class = 'CRM_Core_I18n_SchemaStructure';
     }
     $indices =& $class::indices();
-    $tables  =& $class::tables();
+    $tables =& $class::tables();
     $queries = array();
     $dao = new CRM_Core_DAO;
 
@@ -397,7 +397,7 @@ class CRM_Core_I18n_Schema {
         // class loader look for file like - CRM/Core/I18n/SchemaStructure/4/1/0.php which is not what we want to be loaded
         require_once "CRM/Core/I18n/SchemaStructure_{$latest}.php";
         $class = "CRM_Core_I18n_SchemaStructure_{$latest}";
-        $tables  =& $class::tables();
+        $tables =& $class::tables();
       }
       else {
         $tables = CRM_Core_I18n_SchemaStructure::tables();
@@ -562,7 +562,8 @@ class CRM_Core_I18n_Schema {
         foreach ($locales as $old) {
           $trigger[] = "ELSEIF NEW.{$column}_{$old} IS NOT NULL THEN";
           foreach (array_merge($locales, array(
-            $locale)) as $loc) {
+            $locale
+          )) as $loc) {
             if ($loc == $old) {
               continue;
             }
@@ -592,7 +593,8 @@ class CRM_Core_I18n_Schema {
         foreach ($locales as $old) {
           $trigger[] = "ELSEIF NEW.{$column}_{$old} IS NOT NULL THEN";
           foreach (array_merge($locales, array(
-            $locale)) as $loc) {
+            $locale
+          )) as $loc) {
             if ($loc == $old) {
               continue;
             }
index 0e92af40a67569e21a093226a36fd89e16c71f0a..73ddecbb0109295c730ee3fae5fa2036852f8bee 100644 (file)
@@ -47,7 +47,7 @@ class CRM_Core_I18n_SchemaStructure_2_2_0 {
   /**
    * @return mixed
    */
-  static  function &indices() {
+  static function &indices() {
     static $result = NULL;
     if (!$result) {
       $result = unserialize('a:4:{s:20:"civicrm_custom_group";a:1:{s:16:"UI_title_extends";a:4:{s:4:"name";s:16:"UI_title_extends";s:5:"field";a:2:{i:0;s:5:"title";i:1;s:7:"extends";}s:11:"localizable";b:1;s:6:"unique";b:1;}}s:20:"civicrm_custom_field";a:1:{s:24:"UI_label_custom_group_id";a:4:{s:4:"name";s:24:"UI_label_custom_group_id";s:5:"field";a:2:{i:0;s:5:"label";i:1;s:15:"custom_group_id";}s:11:"localizable";b:1;s:6:"unique";b:1;}}s:17:"civicrm_price_set";a:1:{s:8:"UI_title";a:4:{s:4:"name";s:8:"UI_title";s:5:"field";a:1:{i:0;s:5:"title";}s:11:"localizable";b:1;s:6:"unique";b:1;}}s:15:"civicrm_contact";a:5:{s:15:"index_sort_name";a:3:{s:4:"name";s:15:"index_sort_name";s:5:"field";a:1:{i:0;s:9:"sort_name";}s:11:"localizable";b:1;}s:16:"index_first_name";a:3:{s:4:"name";s:16:"index_first_name";s:5:"field";a:1:{i:0;s:10:"first_name";}s:11:"localizable";b:1;}s:15:"index_last_name";a:3:{s:4:"name";s:15:"index_last_name";s:5:"field";a:1:{i:0;s:9:"last_name";}s:11:"localizable";b:1;}s:20:"index_household_name";a:3:{s:4:"name";s:20:"index_household_name";s:5:"field";a:1:{i:0;s:14:"household_name";}s:11:"localizable";b:1;}s:23:"index_organization_name";a:3:{s:4:"name";s:23:"index_organization_name";s:5:"field";a:1:{i:0;s:17:"organization_name";}s:11:"localizable";b:1;}}}');
index 78ce590620a5f7380ecab7954c72e16454da622b..60923ce4a096b1b34d62a117f1a7553bae09e358 100644 (file)
@@ -240,7 +240,7 @@ class CRM_Core_I18n_SchemaStructure_3_0_alpha1 {
   /**
    * @return array
    */
-  static  function &tables() {
+  static function &tables() {
     static $result = NULL;
     if (!$result) {
       $result = array_keys(self::columns());
index 271f5e7773d1cc63d801513a698044952ab6bd84..09ce51c5fd4ef5766ea6656244aaa82c835c6361 100644 (file)
@@ -36,7 +36,7 @@ class CRM_Core_I18n_SchemaStructure_3_1_alpha1 {
   /**
    * @return array
    */
-  static  function &columns() {
+  static function &columns() {
     static $result = NULL;
     if (!$result) {
       $result = array(
index dc9dd9a542cbb171f6c5a8e31de4e7d4d420aab3..ce3981009827c0df4f6296c4f28658e8426f9395 100644 (file)
@@ -24,6 +24,7 @@
 | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
 +--------------------------------------------------------------------+
 */
+
 /**
  *
  * @package CRM
@@ -40,71 +41,71 @@ class CRM_Core_I18n_SchemaStructure_4_2_alpha1 {
     if (!$result) {
       $result = array(
         'civicrm_location_type' => array(
-        'display_name' => "varchar(64)",
-        ) ,
+          'display_name' => "varchar(64)",
+        ),
         'civicrm_option_group' => array(
-           'title' => "varchar(255)",
-           'description' => "varchar(255)",
-        ) ,
+          'title' => "varchar(255)",
+          'description' => "varchar(255)",
+        ),
         'civicrm_contact_type' => array(
-           'label' => "varchar(64)",
-           'description' => "text",
-        ) ,
+          'label' => "varchar(64)",
+          'description' => "text",
+        ),
         'civicrm_premiums' => array(
           'premiums_intro_title' => "varchar(255)",
           'premiums_intro_text' => "text",
-        ) ,
+        ),
         'civicrm_product' => array(
           'name' => "varchar(255)",
           'description' => "text",
           'options' => "text",
-        ) ,
+        ),
         'civicrm_membership_status' => array(
           'label' => "varchar(128)",
-        ) ,
+        ),
         'civicrm_survey' => array(
           'thankyou_title' => "varchar(255)",
           'thankyou_text' => "text",
-        ) ,
-         'civicrm_participant_status_type' => array(
-            'label' => "varchar(255)",
-        ) ,
+        ),
+        'civicrm_participant_status_type' => array(
+          'label' => "varchar(255)",
+        ),
         'civicrm_tell_friend' => array(
           'title' => "varchar(255)",
           'intro' => "text",
           'suggested_message' => "text",
           'thankyou_title' => "varchar(255)",
           'thankyou_text' => "text",
-        ) ,
+        ),
         'civicrm_price_set' => array(
           'title' => "varchar(255)",
           'help_pre' => "text",
           'help_post' => "text",
-        ) ,
+        ),
         'civicrm_batch' => array(
           'title' => "varchar(64)",
           'description' => "text",
-        ) ,
+        ),
         'civicrm_custom_group' => array(
           'title' => "varchar(64)",
           'help_pre' => "text",
           'help_post' => "text",
-        ) ,
+        ),
         'civicrm_custom_field' => array(
           'label' => "varchar(255)",
           'help_pre' => "text",
           'help_post' => "text",
-        ) ,
+        ),
         'civicrm_dashboard' => array(
           'label' => "varchar(255)",
-        ) ,
-         'civicrm_option_value' => array(
-           'label' => "varchar(255)",
-           'description' => "text",
-        ) ,
+        ),
+        'civicrm_option_value' => array(
+          'label' => "varchar(255)",
+          'description' => "text",
+        ),
         'civicrm_group' => array(
           'title' => "varchar(64)",
-        ) ,
+        ),
         'civicrm_contribution_page' => array(
           'title' => "varchar(255)",
           'intro_text' => "text",
@@ -119,39 +120,39 @@ class CRM_Core_I18n_SchemaStructure_4_2_alpha1 {
           'footer_text' => "text",
           'honor_block_title' => "varchar(255)",
           'honor_block_text' => "text",
-        ) ,
+        ),
         'civicrm_price_field' => array(
           'label' => "varchar(255)",
           'help_pre' => "text",
           'help_post' => "text",
-        ) ,
+        ),
         'civicrm_uf_group' => array(
           'title' => "varchar(64)",
           'help_pre' => "text",
           'help_post' => "text",
-        ) ,
+        ),
         'civicrm_uf_field' => array(
           'help_post' => "text",
           'help_pre' => "text",
           'label' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_membership_type' => array(
           'name' => "varchar(128)",
           'description' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_membership_block' => array(
           'new_title' => "varchar(255)",
           'new_text' => "text",
           'renewal_title' => "varchar(255)",
           'renewal_text' => "text",
-        ) ,
+        ),
         'civicrm_price_field_value' => array(
           'label' => "varchar(255)",
           'description' => "text",
-        ) ,
+        ),
         'civicrm_pcp_block' => array(
           'link_text' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_event' => array(
           'title' => "varchar(255)",
           'summary' => "text",
@@ -174,11 +175,11 @@ class CRM_Core_I18n_SchemaStructure_4_2_alpha1 {
           'waitlist_text' => "text",
           'approval_req_text' => "text",
           'template_title' => "varchar(255)",
-         ) ,
-        );
-        }
-        return $result;
+        ),
+      );
     }
+    return $result;
+  }
 
   /**
    * @return array
@@ -193,29 +194,29 @@ class CRM_Core_I18n_SchemaStructure_4_2_alpha1 {
             'field' => array(
               'title',
               'extends',
-            ) ,
+            ),
             'unique' => 1,
-         ,
-        ) ,
+          ),
+        ),
         'civicrm_custom_field' => array(
           'UI_label_custom_group_id' => array(
             'name' => 'UI_label_custom_group_id',
             'field' => array(
               'label',
               'custom_group_id',
-             ) ,
+            ),
             'unique' => 1,
-          ) ,
-        ) ,
+          ),
+        ),
         'civicrm_group' => array(
           'UI_title' => array(
             'name' => 'UI_title',
             'field' => array(
               'title',
-            ) ,
+            ),
             'unique' => 1,
-           ) ,
-         ) ,
+          ),
+        ),
       );
     }
     return $result;
index b376a521b9d67bbe3111f82586f16f6dff5d0455..0587fa208526036ae52a73f290830768d3ff7b64 100644 (file)
@@ -24,6 +24,7 @@
 | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
 +--------------------------------------------------------------------+
 */
+
 /**
  *
  * @package CRM
@@ -41,58 +42,58 @@ class CRM_Core_I18n_SchemaStructure_4_3_1 {
       $result = array(
         'civicrm_location_type' => array(
           'display_name' => "varchar(64)",
-        ) ,
+        ),
         'civicrm_option_group' => array(
           'title' => "varchar(255)",
           'description' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_contact_type' => array(
           'label' => "varchar(64)",
           'description' => "text",
-        ) ,
+        ),
         'civicrm_batch' => array(
           'title' => "varchar(64)",
           'description' => "text",
-        ) ,
+        ),
         'civicrm_premiums' => array(
           'premiums_intro_title' => "varchar(255)",
           'premiums_intro_text' => "text",
           'premiums_nothankyou_label' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_membership_status' => array(
           'label' => "varchar(128)",
-        ) ,
+        ),
         'civicrm_survey' => array(
           'thankyou_title' => "varchar(255)",
           'thankyou_text' => "text",
-        ) ,
+        ),
         'civicrm_participant_status_type' => array(
           'label' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_tell_friend' => array(
           'title' => "varchar(255)",
           'intro' => "text",
           'suggested_message' => "text",
           'thankyou_title' => "varchar(255)",
           'thankyou_text' => "text",
-        ) ,
+        ),
         'civicrm_custom_group' => array(
           'title' => "varchar(64)",
           'help_pre' => "text",
           'help_post' => "text",
-        ) ,
+        ),
         'civicrm_custom_field' => array(
           'label' => "varchar(255)",
           'help_pre' => "text",
           'help_post' => "text",
-        ) ,
+        ),
         'civicrm_option_value' => array(
           'label' => "varchar(255)",
           'description' => "text",
-        ) ,
+        ),
         'civicrm_group' => array(
           'title' => "varchar(64)",
-        ) ,
+        ),
         'civicrm_contribution_page' => array(
           'title' => "varchar(255)",
           'intro_text' => "text",
@@ -109,52 +110,52 @@ class CRM_Core_I18n_SchemaStructure_4_3_1 {
           'footer_text' => "text",
           'honor_block_title' => "varchar(255)",
           'honor_block_text' => "text",
-        ) ,
+        ),
         'civicrm_product' => array(
           'name' => "varchar(255)",
           'description' => "text",
           'options' => "text",
-        ) ,
+        ),
         'civicrm_membership_type' => array(
           'name' => "varchar(128)",
           'description' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_membership_block' => array(
           'new_title' => "varchar(255)",
           'new_text' => "text",
           'renewal_title' => "varchar(255)",
           'renewal_text' => "text",
-        ) ,
+        ),
         'civicrm_price_set' => array(
           'title' => "varchar(255)",
           'help_pre' => "text",
           'help_post' => "text",
-        ) ,
+        ),
         'civicrm_dashboard' => array(
           'label' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_uf_group' => array(
           'title' => "varchar(64)",
           'help_pre' => "text",
           'help_post' => "text",
-        ) ,
+        ),
         'civicrm_uf_field' => array(
           'help_post' => "text",
           'help_pre' => "text",
           'label' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_price_field' => array(
           'label' => "varchar(255)",
           'help_pre' => "text",
           'help_post' => "text",
-        ) ,
+        ),
         'civicrm_price_field_value' => array(
           'label' => "varchar(255)",
           'description' => "text",
-        ) ,
+        ),
         'civicrm_pcp_block' => array(
           'link_text' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_event' => array(
           'title' => "varchar(255)",
           'summary' => "text",
@@ -179,7 +180,7 @@ class CRM_Core_I18n_SchemaStructure_4_3_1 {
           'waitlist_text' => "text",
           'approval_req_text' => "text",
           'template_title' => "varchar(255)",
-        ) ,
+        ),
       );
     }
     return $result;
@@ -198,29 +199,29 @@ class CRM_Core_I18n_SchemaStructure_4_3_1 {
             'field' => array(
               'title',
               'extends',
-            ) ,
+            ),
             'unique' => 1,
-          ) ,
-        ) ,
+          ),
+        ),
         'civicrm_custom_field' => array(
           'UI_label_custom_group_id' => array(
             'name' => 'UI_label_custom_group_id',
             'field' => array(
               'label',
               'custom_group_id',
-            ) ,
+            ),
             'unique' => 1,
-          ) ,
-        ) ,
+          ),
+        ),
         'civicrm_group' => array(
           'UI_title' => array(
             'name' => 'UI_title',
             'field' => array(
               'title',
-            ) ,
+            ),
             'unique' => 1,
-          ) ,
-        ) ,
+          ),
+        ),
       );
     }
     return $result;
index 586fd0de931bda8067158f1e1519c6c9d21a0a98..7eaeaad7d2400168d3303131864c462d845384d8 100644 (file)
@@ -24,6 +24,7 @@
 | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
 +--------------------------------------------------------------------+
 */
+
 /**
  *
  * @package CRM
@@ -42,60 +43,60 @@ class CRM_Core_I18n_SchemaStructure_4_5_alpha1 {
       $result = array(
         'civicrm_location_type' => array(
           'display_name' => "varchar(64)",
-        ) ,
+        ),
         'civicrm_option_group' => array(
           'title' => "varchar(255)",
           'description' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_contact_type' => array(
           'label' => "varchar(64)",
           'description' => "text",
-        ) ,
+        ),
         'civicrm_batch' => array(
           'title' => "varchar(64)",
           'description' => "text",
-        ) ,
+        ),
         'civicrm_premiums' => array(
           'premiums_intro_title' => "varchar(255)",
           'premiums_intro_text' => "text",
           'premiums_nothankyou_label' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_membership_status' => array(
           'label' => "varchar(128)",
-        ) ,
+        ),
         'civicrm_survey' => array(
           'title' => "varchar(255)",
           'instructions' => "text",
           'thankyou_title' => "varchar(255)",
           'thankyou_text' => "text",
-        ) ,
+        ),
         'civicrm_participant_status_type' => array(
           'label' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_tell_friend' => array(
           'title' => "varchar(255)",
           'intro' => "text",
           'suggested_message' => "text",
           'thankyou_title' => "varchar(255)",
           'thankyou_text' => "text",
-        ) ,
+        ),
         'civicrm_custom_group' => array(
           'title' => "varchar(64)",
           'help_pre' => "text",
           'help_post' => "text",
-        ) ,
+        ),
         'civicrm_custom_field' => array(
           'label' => "varchar(255)",
           'help_pre' => "text",
           'help_post' => "text",
-        ) ,
+        ),
         'civicrm_option_value' => array(
           'label' => "varchar(255)",
           'description' => "text",
-        ) ,
+        ),
         'civicrm_group' => array(
           'title' => "varchar(64)",
-        ) ,
+        ),
         'civicrm_contribution_page' => array(
           'title' => "varchar(255)",
           'intro_text' => "text",
@@ -110,52 +111,52 @@ class CRM_Core_I18n_SchemaStructure_4_5_alpha1 {
           'receipt_from_name' => "varchar(255)",
           'receipt_text' => "text",
           'footer_text' => "text",
-        ) ,
+        ),
         'civicrm_product' => array(
           'name' => "varchar(255)",
           'description' => "text",
           'options' => "text",
-        ) ,
+        ),
         'civicrm_membership_type' => array(
           'name' => "varchar(128)",
           'description' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_membership_block' => array(
           'new_title' => "varchar(255)",
           'new_text' => "text",
           'renewal_title' => "varchar(255)",
           'renewal_text' => "text",
-        ) ,
+        ),
         'civicrm_price_set' => array(
           'title' => "varchar(255)",
           'help_pre' => "text",
           'help_post' => "text",
-        ) ,
+        ),
         'civicrm_dashboard' => array(
           'label' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_uf_group' => array(
           'title' => "varchar(64)",
           'help_pre' => "text",
           'help_post' => "text",
-        ) ,
+        ),
         'civicrm_uf_field' => array(
           'help_post' => "text",
           'help_pre' => "text",
           'label' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_price_field' => array(
           'label' => "varchar(255)",
           'help_pre' => "text",
           'help_post' => "text",
-        ) ,
+        ),
         'civicrm_price_field_value' => array(
           'label' => "varchar(255)",
           'description' => "text",
-        ) ,
+        ),
         'civicrm_pcp_block' => array(
           'link_text' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_event' => array(
           'title' => "varchar(255)",
           'summary' => "text",
@@ -180,7 +181,7 @@ class CRM_Core_I18n_SchemaStructure_4_5_alpha1 {
           'waitlist_text' => "text",
           'approval_req_text' => "text",
           'template_title' => "varchar(255)",
-        ) ,
+        ),
       );
     }
     return $result;
@@ -199,29 +200,29 @@ class CRM_Core_I18n_SchemaStructure_4_5_alpha1 {
             'field' => array(
               'title',
               'extends',
-            ) ,
+            ),
             'unique' => 1,
-          ) ,
-        ) ,
+          ),
+        ),
         'civicrm_custom_field' => array(
           'UI_label_custom_group_id' => array(
             'name' => 'UI_label_custom_group_id',
             'field' => array(
               'label',
               'custom_group_id',
-            ) ,
+            ),
             'unique' => 1,
-          ) ,
-        ) ,
+          ),
+        ),
         'civicrm_group' => array(
           'UI_title' => array(
             'name' => 'UI_title',
             'field' => array(
               'title',
-            ) ,
+            ),
             'unique' => 1,
-          ) ,
-        ) ,
+          ),
+        ),
       );
     }
     return $result;
index f9a91ad68eb19a42d489ae6568df60312bc30a6d..fcba447e5ce4bf1b0190f799f894d47f94efc727 100644 (file)
@@ -24,6 +24,7 @@
 | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
 +--------------------------------------------------------------------+
 */
+
 /**
  *
  * @package CRM
@@ -39,64 +40,64 @@ class CRM_Core_I18n_SchemaStructure_4_5_beta2 {
       $result = array(
         'civicrm_location_type' => array(
           'display_name' => "varchar(64)",
-        ) ,
+        ),
         'civicrm_option_group' => array(
           'title' => "varchar(255)",
           'description' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_contact_type' => array(
           'label' => "varchar(64)",
           'description' => "text",
-        ) ,
+        ),
         'civicrm_batch' => array(
           'title' => "varchar(64)",
           'description' => "text",
-        ) ,
+        ),
         'civicrm_premiums' => array(
           'premiums_intro_title' => "varchar(255)",
           'premiums_intro_text' => "text",
           'premiums_nothankyou_label' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_membership_status' => array(
           'label' => "varchar(128)",
-        ) ,
+        ),
         'civicrm_survey' => array(
           'title' => "varchar(255)",
           'instructions' => "text",
           'thankyou_title' => "varchar(255)",
           'thankyou_text' => "text",
-        ) ,
+        ),
         'civicrm_participant_status_type' => array(
           'label' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_case_type' => array(
           'title' => "varchar(64)",
           'description' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_tell_friend' => array(
           'title' => "varchar(255)",
           'intro' => "text",
           'suggested_message' => "text",
           'thankyou_title' => "varchar(255)",
           'thankyou_text' => "text",
-        ) ,
+        ),
         'civicrm_custom_group' => array(
           'title' => "varchar(64)",
           'help_pre' => "text",
           'help_post' => "text",
-        ) ,
+        ),
         'civicrm_custom_field' => array(
           'label' => "varchar(255)",
           'help_pre' => "text",
           'help_post' => "text",
-        ) ,
+        ),
         'civicrm_option_value' => array(
           'label' => "varchar(255)",
           'description' => "text",
-        ) ,
+        ),
         'civicrm_group' => array(
           'title' => "varchar(64)",
-        ) ,
+        ),
         'civicrm_contribution_page' => array(
           'title' => "varchar(255)",
           'intro_text' => "text",
@@ -111,52 +112,52 @@ class CRM_Core_I18n_SchemaStructure_4_5_beta2 {
           'receipt_from_name' => "varchar(255)",
           'receipt_text' => "text",
           'footer_text' => "text",
-        ) ,
+        ),
         'civicrm_product' => array(
           'name' => "varchar(255)",
           'description' => "text",
           'options' => "text",
-        ) ,
+        ),
         'civicrm_membership_type' => array(
           'name' => "varchar(128)",
           'description' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_membership_block' => array(
           'new_title' => "varchar(255)",
           'new_text' => "text",
           'renewal_title' => "varchar(255)",
           'renewal_text' => "text",
-        ) ,
+        ),
         'civicrm_price_set' => array(
           'title' => "varchar(255)",
           'help_pre' => "text",
           'help_post' => "text",
-        ) ,
+        ),
         'civicrm_dashboard' => array(
           'label' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_uf_group' => array(
           'title' => "varchar(64)",
           'help_pre' => "text",
           'help_post' => "text",
-        ) ,
+        ),
         'civicrm_uf_field' => array(
           'help_post' => "text",
           'help_pre' => "text",
           'label' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_price_field' => array(
           'label' => "varchar(255)",
           'help_pre' => "text",
           'help_post' => "text",
-        ) ,
+        ),
         'civicrm_price_field_value' => array(
           'label' => "varchar(255)",
           'description' => "text",
-        ) ,
+        ),
         'civicrm_pcp_block' => array(
           'link_text' => "varchar(255)",
-        ) ,
+        ),
         'civicrm_event' => array(
           'title' => "varchar(255)",
           'summary' => "text",
@@ -181,11 +182,12 @@ class CRM_Core_I18n_SchemaStructure_4_5_beta2 {
           'waitlist_text' => "text",
           'approval_req_text' => "text",
           'template_title' => "varchar(255)",
-        ) ,
+        ),
       );
     }
     return $result;
   }
+
   public static function &indices() {
     static $result = NULL;
     if (!$result) {
@@ -196,33 +198,34 @@ class CRM_Core_I18n_SchemaStructure_4_5_beta2 {
             'field' => array(
               'title',
               'extends',
-            ) ,
+            ),
             'unique' => 1,
-          ) ,
-        ) ,
+          ),
+        ),
         'civicrm_custom_field' => array(
           'UI_label_custom_group_id' => array(
             'name' => 'UI_label_custom_group_id',
             'field' => array(
               'label',
               'custom_group_id',
-            ) ,
+            ),
             'unique' => 1,
-          ) ,
-        ) ,
+          ),
+        ),
         'civicrm_group' => array(
           'UI_title' => array(
             'name' => 'UI_title',
             'field' => array(
               'title',
-            ) ,
+            ),
             'unique' => 1,
-          ) ,
-        ) ,
+          ),
+        ),
       );
     }
     return $result;
   }
+
   public static function &tables() {
     static $result = NULL;
     if (!$result) {
index df9bf7d3975873f7fd112a64d85cefad0d86e283..8737ed3b641045630842f3e60b3ed86c211b4c93 100644 (file)
@@ -76,14 +76,14 @@ class CRM_Core_IDS {
     require_once 'IDS/Init.php';
     try {
       $init = IDS_Init::init($configFile);
-      $ids  = new IDS_Monitor($_REQUEST, $init);
+      $ids = new IDS_Monitor($_REQUEST, $init);
     }
     catch (Exception $e) {
       // might be an old stale copy of Config.IDS.ini
       // lets try to rebuild it again and see if it works
       $configFile = self::createConfigFile(TRUE);
       $init = IDS_Init::init($configFile);
-      $ids  = new IDS_Monitor($_REQUEST, $init);
+      $ids = new IDS_Monitor($_REQUEST, $init);
     }
 
     $result = $ids->run();
@@ -258,9 +258,9 @@ class CRM_Core_IDS {
 
     $path = implode('/', $args);
     if (in_array(
-        $path,
-        array("civicrm/ajax/rest", "civicrm/api/json")
-      )) {
+      $path,
+      array("civicrm/ajax/rest", "civicrm/api/json")
+    )) {
       require_once "api/v3/utils.php";
       $error = civicrm_api3_create_error(
         $msg,
index add454bd06c55f0cdf82c3d789bbb59fd47a3854..78c1af696319a8009f886221d9bc448340047ead 100644 (file)
@@ -99,6 +99,7 @@ class CRM_Core_Invoke {
       }
     }
   }
+
   /**
    * Hackish support /civicrm/menu/rebuild
    *
@@ -213,9 +214,9 @@ class CRM_Core_Invoke {
     if ($item) {
       // CRM-7656 - make sure we send a clean sanitized path to create printer friendly url
       $printerFriendly = CRM_Utils_System::makeURL(
-        'snippet', FALSE, FALSE,
-        CRM_Utils_Array::value('path', $item)
-      ) . '2';
+          'snippet', FALSE, FALSE,
+          CRM_Utils_Array::value('path', $item)
+        ) . '2';
       $template->assign('printerFriendly', $printerFriendly);
 
       if (!array_key_exists('page_callback', $item)) {
index c6d5944b29d67e88d1577fbc62ab5ff9b44d7c28..7445d4c51dc8a2e9988d44be5ba85f2eb1cb764c 100644 (file)
@@ -138,7 +138,7 @@ class CRM_Core_JobManager {
     try {
       $result = civicrm_api($job->api_entity, $job->api_action, $params);
     }
-    catch(Exception$e) {
+    catch (Exception$e) {
       $this->logEntry('Error while executing ' . $job->name . ': ' . $e->getMessage());
     }
     $this->logEntry('Finished execution of ' . $job->name . ' with result: ' . $this->_apiResultToMessage($result));
@@ -188,8 +188,8 @@ class CRM_Core_JobManager {
     if (is_null($id) && is_null($action)) {
       CRM_Core_Error::fatal('You need to provide either id or name to use this method');
     }
-    $dao             = new CRM_Core_DAO_Job();
-    $dao->id         = $id;
+    $dao = new CRM_Core_DAO_Job();
+    $dao->id = $id;
     $dao->api_entity = $entity;
     $dao->api_action = $action;
     $dao->find();
@@ -230,10 +230,10 @@ class CRM_Core_JobManager {
       $dao->description .= " (...)";
     }
     if ($this->currentJob) {
-      $dao->job_id  = $this->currentJob->id;
-      $dao->name    = $this->currentJob->name;
+      $dao->job_id = $this->currentJob->id;
+      $dao->name = $this->currentJob->name;
       $dao->command = ts("Entity:") . " " . $this->currentJob->api_entity . " " . ts("Action:") . " " . $this->currentJob->api_action;
-      $data         = "";
+      $data = "";
       if (!empty($this->currentJob->parameters)) {
         $data .= "\n\nParameters raw (from db settings): \n" . $this->currentJob->parameters;
       }
@@ -260,8 +260,8 @@ class CRM_Core_JobManager {
    */
   private function _apiResultToMessage($apiResult) {
     $status = $apiResult['is_error'] ? ts('Failure') : ts('Success');
-    $msg    = CRM_Utils_Array::value('error_message', $apiResult, 'empty error_message!');
-    $vals   = CRM_Utils_Array::value('values', $apiResult, 'empty values!');
+    $msg = CRM_Utils_Array::value('error_message', $apiResult, 'empty error_message!');
+    $vals = CRM_Utils_Array::value('values', $apiResult, 'empty values!');
     if (is_array($msg)) {
       $msg = serialize($msg);
     }
index b7ab0805aef61605d963d5c91c67cc6366ab489b..6f8aaabac1d72f232060ef1e76b460a14140570d 100644 (file)
@@ -85,8 +85,8 @@ class CRM_Core_Key {
    */
   public static function get($name, $addSequence = FALSE) {
     $privateKey = self::privateKey();
-    $sessionID  = self::sessionID();
-    $key        = md5($sessionID . $name . $privateKey);
+    $sessionID = self::sessionID();
+    $key = md5($sessionID . $name . $privateKey);
 
     if ($addSequence) {
       // now generate a random number between 1 and 100K and add it to the key
index 36c5a1be152e47c5189271d0a8bb14943417108c..08f909d10bc3712c75f02f46b649056aeb4d0f3d 100644 (file)
@@ -230,7 +230,7 @@ class CRM_Core_ManagedEntities {
       $params = array_merge($defaults, $todo['params']);
       $result = civicrm_api($dao->entity_type, 'create', $params);
       if ($result['is_error']) {
-        $this->onApiError($dao->entity_type, 'create',$params, $result);
+        $this->onApiError($dao->entity_type, 'create', $params, $result);
       }
     }
 
@@ -257,7 +257,7 @@ class CRM_Core_ManagedEntities {
       );
       $result = civicrm_api($dao->entity_type, 'create', $params);
       if ($result['is_error']) {
-        $this->onApiError($dao->entity_type, 'create',$params, $result);
+        $this->onApiError($dao->entity_type, 'create', $params, $result);
       }
     }
   }
index 1ca3cfa4315beadd69b71fbd7fd51f91e53cf772..65d8c1ceae81911503af872bfe94dea4854eabe4 100644 (file)
@@ -277,8 +277,8 @@ class CRM_Core_Menu {
     $config = CRM_Core_Config::singleton();
 
     foreach ($menuArray as $path => $item) {
-      $menu            = new CRM_Core_DAO_Menu();
-      $menu->path      = $path;
+      $menu = new CRM_Core_DAO_Menu();
+      $menu->path = $path;
       $menu->domain_id = CRM_Core_Config::domainID();
 
       $menu->find(TRUE);
@@ -317,19 +317,19 @@ class CRM_Core_Menu {
         'title' => $item['title'],
         'desc' => CRM_Utils_Array::value('desc', $item),
         'id' => strtr($item['title'], array(
-          '(' => '_',
-      ')' => '',
-      ' ' => '',
+            '(' => '_',
+            ')' => '',
+            ' ' => '',
             ',' => '_',
-      '/' => '_',
+            '/' => '_',
           )
         ),
         'url' => CRM_Utils_System::url($path, $query,
-            FALSE, // absolute
-            NULL, // fragment
-            TRUE, // htmlize
-            FALSE, // frontend
-            TRUE // forceBackend; CRM-14439 work-around; acceptable for now because we don't display breadcrumbs on frontend
+          FALSE, // absolute
+          NULL, // fragment
+          TRUE, // htmlize
+          FALSE, // frontend
+          TRUE // forceBackend; CRM-14439 work-around; acceptable for now because we don't display breadcrumbs on frontend
         ),
         'icon' => CRM_Utils_Array::value('icon', $item),
         'extra' => CRM_Utils_Array::value('extra', $item),
@@ -392,7 +392,8 @@ class CRM_Core_Menu {
     foreach ($values as $index => $item) {
       if (strpos(CRM_Utils_Array::value($config->userFrameworkURLVar, $_REQUEST),
           $item['path']
-        ) === 0) {
+        ) === 0
+      ) {
         $values[$index]['active'] = 'class="active"';
       }
       else {
@@ -622,14 +623,14 @@ class CRM_Core_Menu {
 
     $elements = array();
     while (!empty($args)) {
-      $string     = implode('/', $args);
-      $string     = CRM_Core_DAO::escapeString($string);
+      $string = implode('/', $args);
+      $string = CRM_Core_DAO::escapeString($string);
       $elements[] = "'{$string}'";
       array_pop($args);
     }
 
-    $queryString       = implode(', ', $elements);
-    $domainID          = CRM_Core_Config::domainID();
+    $queryString = implode(', ', $elements);
+    $domainID = CRM_Core_Config::domainID();
     $domainWhereClause = " AND domain_id = $domainID ";
     if ($config->isUpgradeMode() &&
       !CRM_Core_DAO::checkFieldExists('civicrm_menu', 'domain_id')
@@ -741,7 +742,7 @@ UNION (
           $urlToSession[$count]['sessionVar'],
           $urlToSession[$count]['type'],
           $urlToSession[$count]['default']
-        ) = explode(':', $keyVal);
+          ) = explode(':', $keyVal);
         $count++;
       }
       $arr['urlToSession'] = $urlToSession;
index 0a268cb7dec417c225bfda0b07283edd9740a4d0..aeb793693f3ed86fc1a37cd06c2ab0dad1274280 100644 (file)
@@ -304,14 +304,14 @@ WHERE  v.option_group_id = g.id
           }
 
           if ($flip) {
-            $p        = array(1 => array($postValue, 'String'));
+            $p = array(1 => array($postValue, 'String'));
             $lookupBy = 'v.label= %1';
-            $select   = "v.value";
+            $select = "v.value";
           }
           else {
-            $p        = array(1 => array($postValue, 'Integer'));
+            $p = array(1 => array($postValue, 'Integer'));
             $lookupBy = 'v.value = %1';
-            $select   = "v.label";
+            $select = "v.label";
           }
 
           $p[2] = array($value['groupName'], 'String');
@@ -358,7 +358,7 @@ WHERE  v.option_group_id = g.id
       $query .= " AND  v.is_active = 1 ";
     }
     $p = array(
-    1 => array($groupName, 'String'),
+      1 => array($groupName, 'String'),
       2 => array($value, 'Integer'),
     );
     $dao = CRM_Core_DAO::executeQuery($query, $p);
@@ -400,7 +400,7 @@ WHERE  v.option_group_id = g.id
 ";
 
     $p = array(
-    1 => array($groupName, 'String'),
+      1 => array($groupName, 'String'),
       2 => array($label, $labelType),
     );
     $dao = CRM_Core_DAO::executeQuery($query, $p);
@@ -475,11 +475,11 @@ WHERE  v.option_group_id = g.id
   public static function createAssoc($groupName, &$values, &$defaultID, $groupTitle = NULL) {
     self::deleteAssoc($groupName);
     if (!empty($values)) {
-      $group              = new CRM_Core_DAO_OptionGroup();
-      $group->name        = $groupName;
-      $group->title       = empty($groupTitle) ? $groupName : $groupTitle;
+      $group = new CRM_Core_DAO_OptionGroup();
+      $group->name = $groupName;
+      $group->title = empty($groupTitle) ? $groupName : $groupTitle;
       $group->is_reserved = 1;
-      $group->is_active   = 1;
+      $group->is_active = 1;
       $group->save();
 
       foreach ($values as $v) {
@@ -584,7 +584,7 @@ SELECT v.label
    AND g.name  = %1
    AND v.value = %2";
     $params = array(
-    1 => array($groupName, 'String'),
+      1 => array($groupName, 'String'),
       2 => array($value, 'String'),
     );
     return CRM_Core_DAO::singleValueQuery($query, $params);
@@ -618,7 +618,7 @@ WHERE  v.option_group_id = g.id
     }
 
     $p = array(
-    1 => array($groupName, 'String'),
+      1 => array($groupName, 'String'),
       2 => array($fieldValue, $fieldType),
     );
     $dao = CRM_Core_DAO::executeQuery($query, $p);
@@ -626,7 +626,13 @@ WHERE  v.option_group_id = g.id
 
     if ($dao->fetch()) {
       foreach (array(
-        'id', 'name', 'value', 'label', 'weight', 'description') as $fld) {
+                 'id',
+                 'name',
+                 'value',
+                 'label',
+                 'weight',
+                 'description'
+               ) as $fld) {
         $row[$fld] = $dao->$fld;
       }
     }
index b67d01c75d92c44a1597a0df3efdfb1f5d799355..09b71d7b0c8e0f80d49e9c9925b29ed43abe377d 100644 (file)
@@ -199,9 +199,9 @@ class CRM_Core_OptionValue {
     // if the corresponding group doesn't exist, create one, provided $groupParams has 'name' in it.
     if (!$optionGroup->id) {
       if ($groupParams['name']) {
-        $newOptionGroup   = CRM_Core_BAO_OptionGroup::add($groupParams, $defaults);
+        $newOptionGroup = CRM_Core_BAO_OptionGroup::add($groupParams, $defaults);
         $params['weight'] = 1;
-        $optionGroupID    = $newOptionGroup->id;
+        $optionGroupID = $newOptionGroup->id;
       }
     }
     else {
@@ -307,7 +307,11 @@ class CRM_Core_OptionValue {
         //the fields email greeting and postal greeting are meant only for Individual and Household
         //the field addressee is meant for all contact types, CRM-4575
         if (in_array($contactType, array(
-          'Individual', 'Household', 'Organization', 'All'))) {
+          'Individual',
+          'Household',
+          'Organization',
+          'All'
+        ))) {
           $nameTitle = array(
             'addressee' => array(
               'name' => 'addressee',
index 5045352543f78428866cf64602085f11366d293a..d9de5db6bdca9bd78aae2347b9260da6e8027d39 100644 (file)
@@ -128,9 +128,9 @@ class CRM_Core_Page {
    * @return CRM_Core_Page
    */
   public function __construct($title = NULL, $mode = NULL) {
-    $this->_name  = CRM_Utils_System::getClassName($this);
+    $this->_name = CRM_Utils_System::getClassName($this);
     $this->_title = $title;
-    $this->_mode  = $mode;
+    $this->_mode = $mode;
 
     // let the constructor initialize this, should happen only once
     if (!isset(self::$_template)) {
@@ -184,8 +184,12 @@ class CRM_Core_Page {
     CRM_Utils_Hook::pageRun($this);
 
     if ($this->_print) {
-      if (in_array($this->_print, array(CRM_Core_Smarty::PRINT_SNIPPET,
-        CRM_Core_Smarty::PRINT_PDF, CRM_Core_Smarty::PRINT_NOFORM, CRM_Core_Smarty::PRINT_JSON))) {
+      if (in_array($this->_print, array(
+        CRM_Core_Smarty::PRINT_SNIPPET,
+        CRM_Core_Smarty::PRINT_PDF,
+        CRM_Core_Smarty::PRINT_NOFORM,
+        CRM_Core_Smarty::PRINT_JSON
+      ))) {
         $content = self::$_template->fetch('CRM/common/snippet.tpl');
       }
       else {
@@ -222,8 +226,8 @@ class CRM_Core_Page {
     CRM_Utils_Check::singleton()->showPeriodicAlerts();
 
     if ($this->useLivePageJS &&
-      CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajaxPopupsEnabled', NULL, TRUE))
-    {
+      CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajaxPopupsEnabled', NULL, TRUE)
+    {
       CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js', 1, 'html-header');
       $this->assign('includeWysiwygEditor', TRUE);
     }
index 2bd4241b9aa1b926eed42ed69172db129128881f..6dba0c1470148930d31638d294840951536151e2 100644 (file)
@@ -50,7 +50,8 @@ class CRM_Core_Page_AJAX_Location {
     $ufId = CRM_Utils_Request::retrieve('ufId', 'Integer', CRM_Core_DAO::$_nullObject, TRUE);
 
     // Verify user id
-    $user = CRM_Utils_Request::retrieve('uid', 'Integer', CRM_Core_DAO::$_nullObject, FALSE, CRM_Core_Session::singleton()->get('userID'));
+    $user = CRM_Utils_Request::retrieve('uid', 'Integer', CRM_Core_DAO::$_nullObject, FALSE, CRM_Core_Session::singleton()
+        ->get('userID'));
     if (empty($user) || (CRM_Utils_Request::retrieve('cs', 'String', $form, FALSE) && !CRM_Contact_BAO_Contact_Permission::validateChecksumContact($user, CRM_Core_DAO::$_nullObject, FALSE))
     ) {
       CRM_Utils_System::civiExit();
@@ -62,16 +63,16 @@ class CRM_Core_Page_AJAX_Location {
       CRM_Utils_System::civiExit();
     }
 
-    $values      = array();
+    $values = array();
     $entityBlock = array('contact_id' => $cid);
-    $location    = CRM_Core_BAO_Location::getValues($entityBlock);
+    $location = CRM_Core_BAO_Location::getValues($entityBlock);
 
     $config = CRM_Core_Config::singleton();
     $addressSequence = array_flip($config->addressSequence());
 
     $profileFields = CRM_Core_BAO_UFGroup::getFields($ufId, FALSE, CRM_Core_Action::VIEW, NULL, NULL, FALSE,
-        NULL, FALSE, NULL, CRM_Core_Permission::CREATE, NULL
-      );
+      NULL, FALSE, NULL, CRM_Core_Permission::CREATE, NULL
+    );
     $website = CRM_Core_BAO_Website::getValues($entityBlock, $values);
 
     foreach ($location as $fld => $values) {
@@ -79,29 +80,29 @@ class CRM_Core_Page_AJAX_Location {
         $locType = $values[1]['location_type_id'];
         if ($fld == 'email') {
           $elements["onbehalf_{$fld}-{$locType}"] = array(
-              'type' => 'Text',
-              'value' => $location[$fld][1][$fld],
-            );
+            'type' => 'Text',
+            'value' => $location[$fld][1][$fld],
+          );
           unset($profileFields["{$fld}-{$locType}"]);
         }
         elseif ($fld == 'phone') {
           $phoneTypeId = $values[1]['phone_type_id'];
           $elements["onbehalf_{$fld}-{$locType}-{$phoneTypeId}"] = array(
-              'type' => 'Text',
-              'value' => $location[$fld][1][$fld],
-            );
+            'type' => 'Text',
+            'value' => $location[$fld][1][$fld],
+          );
           unset($profileFields["{$fld}-{$locType}-{$phoneTypeId}"]);
         }
         elseif ($fld == 'im') {
           $providerId = $values[1]['provider_id'];
           $elements["onbehalf_{$fld}-{$locType}"] = array(
-              'type' => 'Text',
-              'value' => $location[$fld][1][$fld],
-            );
+            'type' => 'Text',
+            'value' => $location[$fld][1][$fld],
+          );
           $elements["onbehalf_{$fld}-{$locType}provider_id"] = array(
-              'type' => 'Select',
-              'value' => $location[$fld][1]['provider_id'],
-            );
+            'type' => 'Select',
+            'value' => $location[$fld][1]['provider_id'],
+          );
           unset($profileFields["{$fld}-{$locType}-{$providerId}"]);
         }
       }
@@ -111,28 +112,28 @@ class CRM_Core_Page_AJAX_Location {
       foreach ($website as $key => $val) {
         $websiteTypeId = $values[1]['website_type_id'];
         $elements["onbehalf_url-1"] = array(
-            'type' => 'Text',
-            'value' => $website[1]['url'],
-          );
+          'type' => 'Text',
+          'value' => $website[1]['url'],
+        );
         $elements["onbehalf_url-1-website_type_id"] = array(
-            'type' => 'Select',
-            'value' => $website[1]['website_type_id'],
-          );
+          'type' => 'Select',
+          'value' => $website[1]['website_type_id'],
+        );
         unset($profileFields["url-1"]);
       }
     }
 
     $locTypeId = isset($location['address'][1]) ? $location['address'][1]['location_type_id'] : NULL;
     $addressFields = array(
-        'street_address',
-        'supplemental_address_1',
-        'supplemental_address_2',
-        'city',
-        'postal_code',
-        'county',
-        'state_province',
-        'country',
-      );
+      'street_address',
+      'supplemental_address_1',
+      'supplemental_address_2',
+      'city',
+      'postal_code',
+      'county',
+      'state_province',
+      'country',
+    );
 
     foreach ($addressFields as $field) {
       if (array_key_exists($field, $addressSequence)) {
@@ -143,9 +144,9 @@ class CRM_Core_Page_AJAX_Location {
           $type = 'Select';
         }
         $elements["onbehalf_{$field}-{$locTypeId}"] = array(
-            'type' => $type,
-            'value' => isset($location['address'][1]) ? $location['address'][1][$addField] : NULL,
-          );
+          'type' => $type,
+          'value' => isset($location['address'][1]) ? $location['address'][1][$addField] : NULL,
+        );
         unset($profileFields["{$field}-{$locTypeId}"]);
       }
     }
@@ -227,9 +228,15 @@ class CRM_Core_Page_AJAX_Location {
     // lets output only required fields.
     foreach ($addressOptions as $element => $isSet) {
       if ($isSet && (!in_array($element, array(
-        'im', 'openid')))) {
+          'im',
+          'openid'
+        )))
+      ) {
         if (in_array($element, array(
-          'country', 'state_province', 'county'))) {
+          'country',
+          'state_province',
+          'county'
+        ))) {
           $element .= '_id';
         }
         elseif ($element == 'address_name') {
@@ -239,19 +246,28 @@ class CRM_Core_Page_AJAX_Location {
         $value = CRM_Utils_Array::value($element, $location['address'][1]);
         $value = $value ? $value : "";
         $result[str_replace(array(
-          '][', '[', "]"), array('_', '_', ''), $fld)] = $value;
+          '][',
+          '[',
+          "]"
+        ), array('_', '_', ''), $fld)] = $value;
       }
     }
 
     foreach (array(
-      'email', 'phone_type_id', 'phone') as $element) {
+               'email',
+               'phone_type_id',
+               'phone'
+             ) as $element) {
       $block = ($element == 'phone_type_id') ? 'phone' : $element;
       for ($i = 1; $i < 3; $i++) {
         $fld = "{$block}[{$i}][{$element}]";
         $value = CRM_Utils_Array::value($element, $location[$block][$i]);
         $value = $value ? $value : "";
         $result[str_replace(array(
-          '][', '[', "]"), array('_', '_', ''), $fld)] = $value;
+          '][',
+          '[',
+          "]"
+        ), array('_', '_', ''), $fld)] = $value;
       }
     }
 
index c45a7fbb6a2e93eaa97f687cd1a659a890a572f2..259d2825f2f826ff2125a5c1c534bab5836115a7 100644 (file)
@@ -11,7 +11,6 @@
  *
  * @author Priyanka
  */
-
 class CRM_Core_Page_AJAX_RecurringEntity {
 
   public static function updateMode() {
@@ -54,13 +53,14 @@ class CRM_Core_Page_AJAX_RecurringEntity {
     $params = $formValues = $genericResult = array();
     $formValues = $_REQUEST;
     if (!empty($formValues) &&
-        CRM_Utils_Array::value('entity_table', $formValues)) {
+      CRM_Utils_Array::value('entity_table', $formValues)
+    ) {
       $startDateColumnName = CRM_Core_BAO_RecurringEntity::$_dateColumns[$formValues['entity_table']]['dateColumns'][0];
       $endDateColumnName = CRM_Core_BAO_RecurringEntity::$_dateColumns[$formValues['entity_table']]['intervalDateColumns'][0];
 
       $recursion = new CRM_Core_BAO_RecurringEntity();
       if (CRM_Utils_Array::value('dateColumns', CRM_Core_BAO_RecurringEntity::$_dateColumns[$formValues['entity_table']])) {
-        $recursion->dateColumns  = CRM_Core_BAO_RecurringEntity::$_dateColumns[$formValues['entity_table']]['dateColumns'];
+        $recursion->dateColumns = CRM_Core_BAO_RecurringEntity::$_dateColumns[$formValues['entity_table']]['dateColumns'];
       }
       $recursion->scheduleFormValues = $formValues;
       if (!empty($formValues['exclude_date_list'])) {
@@ -82,7 +82,7 @@ class CRM_Core_Page_AJAX_RecurringEntity {
           $endDate = CRM_Core_DAO::getFieldValue($daoName, $parentEventId, $endDateColumnName);
         }
         if ($endDate) {
-          $interval  = $recursion->getInterval($startDate, $endDate);
+          $interval = $recursion->getInterval($startDate, $endDate);
           $recursion->intervalDateColumns = array($endDateColumnName => $interval);
         }
       }
index dcb938f6229fd630d71287da3b86f88f640af375..017f2c219de080ba72535f40b789de3732c8b7b6 100644 (file)
@@ -69,17 +69,39 @@ class CRM_Core_Page_Angular extends CRM_Core_Page {
    */
   public static function getAngularModules() {
     $angularModules = array();
-    $angularModules['angularFileUpload'] = array('ext' => 'civicrm', 'js' => array('bower_components/angular-file-upload/angular-file-upload.min.js'));
+    $angularModules['angularFileUpload'] = array(
+      'ext' => 'civicrm',
+      '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'));
-    $angularModules['crmUi'] = array('ext' => 'civicrm', 'js' => array('js/angular-crm-ui.js', 'packages/ckeditor/ckeditor.js'));
+    $angularModules['crmAttachment'] = array(
+      'ext' => 'civicrm',
+      'js' => array('js/angular-crmAttachment.js'),
+      'css' => array('css/angular-crmAttachment.css')
+    );
+    $angularModules['crmUi'] = array(
+      'ext' => 'civicrm',
+      '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'));
+    $angularModules['dialogService'] = array(
+      'ext' => 'civicrm',
+      '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'));
-    $angularModules['ui.sortable'] = array('ext' => 'civicrm', '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'));
+    $angularModules['ui.utils'] = array(
+      'ext' => 'civicrm',
+      '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')
+    );
+    $angularModules['unsavedChanges'] = array(
+      'ext' => 'civicrm',
+      'js' => array('bower_components/angular-unsavedChanges/dist/unsavedChanges.min.js')
+    );
 
     foreach (CRM_Core_Component::getEnabledComponents() as $component) {
       $angularModules = array_merge($angularModules, $component->getAngularModules());
index 7fe2ba19a16c2a0fa568bba13428212a3dd6093a..8cd76450a840be72ac6f72c05cccc3d922fa0953 100644 (file)
  * $Id$
  *
  */
-
-
-
-
 abstract class CRM_Core_Page_Basic extends CRM_Core_Page {
 
   protected $_action;
@@ -146,10 +142,10 @@ abstract class CRM_Core_Page_Basic extends CRM_Core_Page {
     // CRM-9034
     // dont see args or pageArgs being used, so we should
     // consider eliminating them in a future version
-    $n        = func_num_args();
-    $args     = ($n > 0) ? func_get_arg(0) : NULL;
+    $n = func_num_args();
+    $args = ($n > 0) ? func_get_arg(0) : NULL;
     $pageArgs = ($n > 1) ? func_get_arg(1) : NULL;
-    $sort     = ($n > 2) ? func_get_arg(2) : NULL;
+    $sort = ($n > 2) ? func_get_arg(2) : NULL;
     // what action do we want to perform ? (store it for smarty too.. :)
 
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
@@ -199,10 +195,10 @@ abstract class CRM_Core_Page_Basic extends CRM_Core_Page {
    * @return void
    */
   public function browse() {
-    $n      = func_num_args();
+    $n = func_num_args();
     $action = ($n > 0) ? func_get_arg(0) : NULL;
-    $sort   = ($n > 0) ? func_get_arg(1) : NULL;
-    $links  = &$this->links();
+    $sort = ($n > 0) ? func_get_arg(1) : NULL;
+    $links = &$this->links();
     if ($action == NULL) {
       if (!empty($links)) {
         $action = array_sum(array_keys($links));
@@ -301,11 +297,15 @@ abstract class CRM_Core_Page_Basic extends CRM_Core_Page {
    */
   public function action(&$object, $action, &$values, &$links, $permission, $forceAction = FALSE) {
     $values['class'] = '';
-    $newAction       = $action;
-    $hasDelete       = $hasDisable = TRUE;
+    $newAction = $action;
+    $hasDelete = $hasDisable = TRUE;
 
     if (!empty($values['name']) && in_array($values['name'], array(
-      'encounter_medium', 'case_type', 'case_status'))) {
+        'encounter_medium',
+        'case_type',
+        'case_status'
+      ))
+    ) {
       static $caseCount = NULL;
       if (!isset($caseCount)) {
         $caseCount = CRM_Case_BAO_Case::caseCount(NULL, FALSE);
index 61e5c7d023c97ae91b99b2cb6e31f09d64fa4c00..3803a611238bdad6fd04a9453478a164d1a2f259 100644 (file)
 class CRM_Core_Page_File extends CRM_Core_Page {
 
   public function run() {
-    $eid    = CRM_Utils_Request::retrieve('eid', 'Positive', $this, TRUE);
-    $fid    = CRM_Utils_Request::retrieve('fid', 'Positive', $this, FALSE);
-    $id     = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE);
-    $quest  = CRM_Utils_Request::retrieve('quest', 'String', $this);
+    $eid = CRM_Utils_Request::retrieve('eid', 'Positive', $this, TRUE);
+    $fid = CRM_Utils_Request::retrieve('fid', 'Positive', $this, FALSE);
+    $id = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE);
+    $quest = CRM_Utils_Request::retrieve('quest', 'String', $this);
     $action = CRM_Utils_Request::retrieve('action', 'String', $this);
 
     list($path, $mimeType) = CRM_Core_BAO_File::path($id, $eid, NULL, $quest);
index d9550928d8d6055281255a2c776fb1affc4eff95..10fe9c1608d3c8bce2a30280e1e2899c7d0db120 100644 (file)
@@ -26,6 +26,7 @@
 */
 
 use Civi\Payment\System;
+
 /**
  *
  * @package CRM
@@ -33,7 +34,6 @@ use Civi\Payment\System;
  * $Id$
  *
  */
-
 abstract class CRM_Core_Payment {
 
   /**
@@ -67,7 +67,7 @@ abstract class CRM_Core_Payment {
     RECURRING_PAYMENT_START = 'START',
     RECURRING_PAYMENT_END = 'END';
 
-   protected $_paymentProcessor;
+  protected $_paymentProcessor;
 
   /**
    * Singleton function used to manage this object
@@ -96,7 +96,7 @@ abstract class CRM_Core_Payment {
     }
     //we use two lines because we can't remove the '&singleton' without risking breakage
     //of extension classes that extend this one
-    $object =  Civi\Payment\System::singleton()->getByProcessor($paymentProcessor);
+    $object = Civi\Payment\System::singleton()->getByProcessor($paymentProcessor);
     return $object;
   }
 
@@ -303,7 +303,8 @@ abstract class CRM_Core_Payment {
             'rule_message' => ts('Please enter a valid value for your card security code. This is usually the last 3-4 digits on the card\'s signature panel.'),
             'rule_name' => 'integer',
             'rule_parameters' => NULL,
-        )),
+          )
+        ),
       ),
       'credit_card_exp_date' => array(
         'htmlType' => 'date',
@@ -317,7 +318,8 @@ abstract class CRM_Core_Payment {
             'rule_message' => ts('Card expiration date cannot be a past date.'),
             'rule_name' => 'currentDate',
             'rule_parameters' => TRUE,
-          )),
+          )
+        ),
       ),
       'credit_card_type' => array(
         'htmlType' => 'select',
@@ -355,7 +357,8 @@ abstract class CRM_Core_Payment {
             'rule_message' => ts('Please enter a valid Bank Identification Number (value must not contain punctuation characters).'),
             'rule_name' => 'nopunctuation',
             'rule_parameters' => NULL,
-        )),
+          )
+        ),
         'is_required' => TRUE,
       ),
       //e.g. SWIFT-BIC can have maxlength of 11 digits
@@ -375,7 +378,8 @@ abstract class CRM_Core_Payment {
             'rule_message' => ts('Please enter a valid Bank Identification Number (value must not contain punctuation characters).'),
             'rule_name' => 'nopunctuation',
             'rule_parameters' => NULL,
-        )),
+          )
+        ),
       ),
       'bank_name' => array(
         'htmlType' => 'text',
@@ -618,11 +622,11 @@ abstract class CRM_Core_Payment {
         break;
     }
 
-    $session       = CRM_Core_Session::singleton();
-    $userId        = $session->get('userID');
-    $contactID     = 0;
+    $session = CRM_Core_Session::singleton();
+    $userId = $session->get('userID');
+    $contactID = 0;
     $checksumValue = '';
-    $entityArg     = '';
+    $entityArg = '';
 
     // Find related Contact
     if ($entityID) {
index 824265d999447eecb5cb162d5bea98def8fb2b27..eedf98ed355366064f499b46a20b9d1fadb93885 100644 (file)
@@ -175,11 +175,11 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment {
     // hence treat that also as test mode transaction
     // fix for CRM-2566
     if (($this->_mode == 'test') || $response_fields[6] == 0) {
-      $query             = "SELECT MAX(trxn_id) FROM civicrm_contribution WHERE trxn_id RLIKE 'test[0-9]+'";
-      $p                 = array();
-      $trxn_id           = strval(CRM_Core_DAO::singleValueQuery($query, $p));
-      $trxn_id           = str_replace('test', '', $trxn_id);
-      $trxn_id           = intval($trxn_id) + 1;
+      $query = "SELECT MAX(trxn_id) FROM civicrm_contribution WHERE trxn_id RLIKE 'test[0-9]+'";
+      $p = array();
+      $trxn_id = strval(CRM_Core_DAO::singleValueQuery($query, $p));
+      $trxn_id = str_replace('test', '', $trxn_id);
+      $trxn_id = intval($trxn_id) + 1;
       $params['trxn_id'] = sprintf('test%08d', $trxn_id);
     }
     else {
@@ -332,7 +332,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment {
    */
   public function _getAuthorizeNetFields() {
     $amount = $this->_getParam('total_amount');//Total amount is from the form contribution field
-    if (empty($amount)){//CRM-9894 would this ever be the case??
+    if (empty($amount)) {//CRM-9894 would this ever be the case??
       $amount = $this->_getParam('amount');
     }
     $fields = array();
@@ -349,7 +349,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment {
     $fields['x_customer_ip'] = $this->_getParam('ip_address');
     $fields['x_email'] = $this->_getParam('email');
     $fields['x_invoice_num'] = substr($this->_getParam('invoiceID'), 0, 20);
-    $fields['x_amount']         = $amount;
+    $fields['x_amount'] = $amount;
     $fields['x_currency_code'] = $this->_getParam('currencyID');
     $fields['x_description'] = $this->_getParam('description');
     $fields['x_cust_id'] = $this->_getParam('contactID');
@@ -413,9 +413,9 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment {
       if (strlen($key) > $b) {
         $key = pack("H*", md5($key));
       }
-      $key    = str_pad($key, $b, chr(0x00));
-      $ipad   = str_pad('', $b, chr(0x36));
-      $opad   = str_pad('', $b, chr(0x5c));
+      $key = str_pad($key, $b, chr(0x00));
+      $ipad = str_pad('', $b, chr(0x36));
+      $opad = str_pad('', $b, chr(0x5c));
       $k_ipad = $key ^ $ipad;
       $k_opad = $key ^ $opad;
       return md5($k_opad . pack("H*", md5($k_ipad . $data)));
@@ -443,9 +443,9 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment {
     if (empty($md5Hash)) {
       return TRUE;
     }
-    $loginid    = $this->_getParam('apiLogin');
+    $loginid = $this->_getParam('apiLogin');
     $hashString = $ipn ? ($md5Hash . $transaction_id . $amount) : ($md5Hash . $loginid . $transaction_id . $amount);
-    $result     = strtoupper(md5($hashString));
+    $result = strtoupper(md5($hashString));
 
     if ($result == $responseMD5) {
       return TRUE;
@@ -462,12 +462,12 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment {
    *   fingerprint
    **/
   public function CalculateFP() {
-    $x_tran_key  = $this->_getParam('paymentKey');
-    $loginid     = $this->_getParam('apiLogin');
-    $sequence    = $this->_getParam('sequence');
-    $timestamp   = $this->_getParam('timestamp');
-    $amount      = $this->_getParam('amount');
-    $currency    = $this->_getParam('currencyID');
+    $x_tran_key = $this->_getParam('paymentKey');
+    $loginid = $this->_getParam('apiLogin');
+    $sequence = $this->_getParam('sequence');
+    $timestamp = $this->_getParam('timestamp');
+    $amount = $this->_getParam('amount');
+    $currency = $this->_getParam('currencyID');
     $transaction = "$loginid^$sequence^$timestamp^$amount^$currency";
     return $this->hmac($x_tran_key, $transaction);
   }
@@ -520,10 +520,10 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment {
    *   refId, resultCode, code, text, subscriptionId
    */
   public function _parseArbReturn($content) {
-    $refId          = $this->_substring_between($content, '<refId>', '</refId>');
-    $resultCode     = $this->_substring_between($content, '<resultCode>', '</resultCode>');
-    $code           = $this->_substring_between($content, '<code>', '</code>');
-    $text           = $this->_substring_between($content, '<text>', '</text>');
+    $refId = $this->_substring_between($content, '<refId>', '</refId>');
+    $resultCode = $this->_substring_between($content, '<resultCode>', '</resultCode>');
+    $code = $this->_substring_between($content, '<code>', '</code>');
+    $text = $this->_substring_between($content, '<text>', '</text>');
     $subscriptionId = $this->_substring_between($content, '<subscriptionId>', '</subscriptionId>');
     return array(
       'refId' => $refId,
index f8614955249f00e19c57efa65e321c3948c19525..5e3012bfbfc3cccb79180d26dbebd3f1ef5c1a29 100644 (file)
@@ -136,7 +136,7 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN {
       // create a contribution and then get it processed
       $contribution = new CRM_Contribute_BAO_Contribution();
       $contribution->contact_id = $ids['contact'];
-      $contribution->financial_type_id  = $objects['contributionType']->id;
+      $contribution->financial_type_id = $objects['contributionType']->id;
       $contribution->contribution_page_id = $ids['contributionPage'];
       $contribution->contribution_recur_id = $ids['contributionRecur'];
       $contribution->receive_date = $now;
index d0b2baf46270729f46d1d6b635bc4bb4cba22c92..53e7b01a11aa25022f51d9e193cbce2062840d39 100644 (file)
@@ -46,6 +46,7 @@ class CRM_Core_Payment_BaseIPN {
   protected $_isRecurring = FALSE;
 
   protected $_isFirstOrLastRecurringPayment = FALSE;
+
   /**
    * Constructor
    */
@@ -66,6 +67,7 @@ class CRM_Core_Payment_BaseIPN {
     }
     $this->_inputParameters = $parameters;
   }
+
   /**
    * Validate incoming data. This function is intended to ensure that incoming data matches
    * It provides a form of pseudo-authentication - by checking the calling fn already knows
@@ -159,13 +161,13 @@ class CRM_Core_Payment_BaseIPN {
     try {
       $success = $contribution->loadRelatedObjects($input, $ids, $required);
     }
-    catch(Exception $e) {
+    catch (Exception $e) {
       $success = FALSE;
       if (!empty($error_handling['log_error'])) {
         CRM_Core_Error::debug_log_message($e->getMessage());
       }
       if (!empty($error_handling['echo_error'])) {
-        echo ($e->getMessage());
+        echo($e->getMessage());
       }
       if (!empty($error_handling['return_error'])) {
         return array(
@@ -202,7 +204,10 @@ class CRM_Core_Payment_BaseIPN {
     $participant = &$objects['participant'];
 
     //CRM-15546
-    $contributionStatuses = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'contribution_status_id', array('labelColumn' => 'name', 'flip' => 1));
+    $contributionStatuses = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'contribution_status_id', array(
+        'labelColumn' => 'name',
+        'flip' => 1
+      ));
     $contribution->receive_date = CRM_Utils_Date::isoToMysql($contribution->receive_date);
     $contribution->receipt_date = CRM_Utils_Date::isoToMysql($contribution->receipt_date);
     $contribution->thankyou_date = CRM_Utils_Date::isoToMysql($contribution->thankyou_date);
@@ -224,7 +229,10 @@ class CRM_Core_Payment_BaseIPN {
     if (empty($input['skipComponentSync'])) {
       if (!empty($memberships)) {
         // if transaction is failed then set "Cancelled" as membership status
-        $membershipStatuses = CRM_Core_PseudoConstant::get('CRM_Member_DAO_Membership', 'status_id', array('labelColumn' => 'name', 'flip' => 1));
+        $membershipStatuses = CRM_Core_PseudoConstant::get('CRM_Member_DAO_Membership', 'status_id', array(
+            'labelColumn' => 'name',
+            'flip' => 1
+          ));
         foreach ($memberships as $membership) {
           if ($membership) {
             $membership->status_id = $membershipStatuses['Cancelled'];
@@ -238,7 +246,10 @@ class CRM_Core_Payment_BaseIPN {
       }
 
       if ($participant) {
-        $participantStatuses = CRM_Core_PseudoConstant::get('CRM_Event_DAO_Participant', 'status_id', array('labelColumn' => 'name', 'flip' => 1));
+        $participantStatuses = CRM_Core_PseudoConstant::get('CRM_Event_DAO_Participant', 'status_id', array(
+            'labelColumn' => 'name',
+            'flip' => 1
+          ));
         $participant->status_id = $participantStatuses['Cancelled'];
         $participant->save();
       }
@@ -282,7 +293,10 @@ class CRM_Core_Payment_BaseIPN {
     if (empty($contribution->id)) {
       $addLineItems = TRUE;
     }
-    $contributionStatuses = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'contribution_status_id', array('labelColumn' => 'name', 'flip' => 1));
+    $contributionStatuses = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'contribution_status_id', array(
+        'labelColumn' => 'name',
+        'flip' => 1
+      ));
     $contribution->contribution_status_id = $contributionStatuses['Cancelled'];
     $contribution->cancel_date = self::$_now;
     $contribution->cancel_reason = CRM_Utils_Array::value('reasonCode', $input);
@@ -305,7 +319,10 @@ class CRM_Core_Payment_BaseIPN {
 
     if (empty($input['skipComponentSync'])) {
       if (!empty($memberships)) {
-        $membershipStatuses = CRM_Core_PseudoConstant::get('CRM_Member_DAO_Membership', 'status_id', array('labelColumn' => 'name', 'flip' => 1));
+        $membershipStatuses = CRM_Core_PseudoConstant::get('CRM_Member_DAO_Membership', 'status_id', array(
+            'labelColumn' => 'name',
+            'flip' => 1
+          ));
         foreach ($memberships as $membership) {
           if ($membership) {
             $membership->status_id = $membershipStatuses['Cancelled'];
@@ -319,7 +336,10 @@ class CRM_Core_Payment_BaseIPN {
       }
 
       if ($participant) {
-        $participantStatuses = CRM_Core_PseudoConstant::get('CRM_Event_DAO_Participant', 'status_id', array('labelColumn' => 'name', 'flip' => 1));
+        $participantStatuses = CRM_Core_PseudoConstant::get('CRM_Event_DAO_Participant', 'status_id', array(
+            'labelColumn' => 'name',
+            'flip' => 1
+          ));
         $participant->status_id = $participantStatuses['Cancelled'];
         $participant->save();
       }
@@ -359,9 +379,9 @@ class CRM_Core_Payment_BaseIPN {
     if (is_numeric($memberships)) {
       $memberships = array($objects['membership']);
     }
-    $participant  = &$objects['participant'];
-    $event        = &$objects['event'];
-    $changeToday  = CRM_Utils_Array::value('trxn_date', $input, self::$_now);
+    $participant = &$objects['participant'];
+    $event = &$objects['event'];
+    $changeToday = CRM_Utils_Array::value('trxn_date', $input, self::$_now);
     $recurContrib = &$objects['contributionRecur'];
 
     $values = array();
@@ -453,7 +473,7 @@ LIMIT 1;";
             );
 
             $formatedParams = array(
-            'status_id' => CRM_Utils_Array::value('id', $calcStatus, 2),
+              'status_id' => CRM_Utils_Array::value('id', $calcStatus, 2),
               'join_date' => CRM_Utils_Date::customFormat(CRM_Utils_Array::value('join_date', $dates), $format),
               'start_date' => CRM_Utils_Date::customFormat(CRM_Utils_Array::value('start_date', $dates), $format),
               'end_date' => CRM_Utils_Date::customFormat(CRM_Utils_Array::value('end_date', $dates), $format),
@@ -515,13 +535,13 @@ LIMIT 1;";
 
       $ufJoinParams = array(
         'entity_table' => 'civicrm_event',
-        'entity_id'    => $ids['event'],
-        'module'       => 'CiviEvent',
+        'entity_id' => $ids['event'],
+        'module' => 'CiviEvent',
       );
 
       list($custom_pre_id,
-           $custom_post_ids
-           ) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
+        $custom_post_ids
+        ) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
 
       $values['custom_pre_id'] = $custom_pre_id;
       $values['custom_post_id'] = $custom_post_ids;
@@ -536,7 +556,10 @@ LIMIT 1;";
         $values['is_email_receipt'] = 1;
       }
       if (empty($input['skipComponentSync'])) {
-        $participantStatuses = CRM_Core_PseudoConstant::get('CRM_Event_DAO_Participant', 'status_id', array('labelColumn' => 'name', 'flip' => 1));
+        $participantStatuses = CRM_Core_PseudoConstant::get('CRM_Event_DAO_Participant', 'status_id', array(
+            'labelColumn' => 'name',
+            'flip' => 1
+          ));
         $participant->status_id = $participantStatuses['Registered'];
       }
       $participant->save();
@@ -551,7 +574,10 @@ LIMIT 1;";
     if (empty($contribution->id)) {
       $addLineItems = TRUE;
     }
-    $contributionStatuses = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'contribution_status_id', array('labelColumn' => 'name', 'flip' => 1));
+    $contributionStatuses = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'contribution_status_id', array(
+        'labelColumn' => 'name',
+        'flip' => 1
+      ));
     $contribution->contribution_status_id = $contributionStatuses['Completed'];
     $contribution->is_test = $input['is_test'];
     $contribution->fee_amount = CRM_Utils_Array::value('fee_amount', $input, 0);
@@ -614,8 +640,11 @@ LIMIT 1;";
     // From a lot of code reading /debugging I'm still not sure the intent WRT first & subsequent payments in this code
     // it would be good if someone added some comments or refactored this
     if ($contribution->id) {
-      $contributionStatuses = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'contribution_status_id', array('labelColumn' => 'name', 'flip' => 1));
-      if ((empty($input['prevContribution']) && $paymentProcessorId) || (!$input['prevContribution']->is_pay_later && - $input['prevContribution']->contribution_status_id == $contributionStatuses['Pending'])) {
+      $contributionStatuses = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'contribution_status_id', array(
+          'labelColumn' => 'name',
+          'flip' => 1
+        ));
+      if ((empty($input['prevContribution']) && $paymentProcessorId) || (!$input['prevContribution']->is_pay_later && -$input['prevContribution']->contribution_status_id == $contributionStatuses['Pending'])) {
         $input['payment_processor'] = $paymentProcessorId;
       }
       $input['contribution_status_id'] = $contributionStatuses['Completed'];
@@ -767,9 +796,9 @@ LIMIT 1;";
    */
   public function updateContributionStatus(&$params) {
     // get minimum required values.
-    $statusId       = CRM_Utils_Array::value('contribution_status_id', $params);
-    $componentId    = CRM_Utils_Array::value('component_id', $params);
-    $componentName  = CRM_Utils_Array::value('componentName', $params);
+    $statusId = CRM_Utils_Array::value('contribution_status_id', $params);
+    $componentId = CRM_Utils_Array::value('component_id', $params);
+    $componentName = CRM_Utils_Array::value('componentName', $params);
     $contributionId = CRM_Utils_Array::value('contribution_id', $params);
 
     if (!$contributionId || !$componentId || !$componentName || !$statusId) {
@@ -821,7 +850,10 @@ LIMIT 1;";
 
     $contribution = &$objects['contribution'];
 
-    $contributionStatuses = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'contribution_status_id', array('labelColumn' => 'name', 'flip' => 1));
+    $contributionStatuses = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'contribution_status_id', array(
+        'labelColumn' => 'name',
+        'flip' => 1
+      ));
     $input['skipComponentSync'] = CRM_Utils_Array::value('skipComponentSync', $params);
     if ($statusId == $contributionStatuses['Cancelled']) {
       $baseIPN->cancelled($objects, $transaction, $input);
@@ -842,7 +874,10 @@ LIMIT 1;";
 
     //set values for ipn code.
     foreach (array(
-      'fee_amount', 'check_number', 'payment_instrument_id') as $field) {
+               'fee_amount',
+               'check_number',
+               'payment_instrument_id'
+             ) as $field) {
       if (!$input[$field] = CRM_Utils_Array::value($field, $params)) {
         $input[$field] = $contribution->$field;
       }
@@ -886,11 +921,12 @@ LIMIT 1;";
    */
   public function updateRecurLinkedPledge(&$contribution) {
     $returnProperties = array('id', 'pledge_id');
-    $paymentDetails   = $paymentIDs = array();
+    $paymentDetails = $paymentIDs = array();
 
     if (CRM_Core_DAO::commonRetrieveAll('CRM_Pledge_DAO_PledgePayment', 'contribution_id', $contribution->id,
-        $paymentDetails, $returnProperties
-      )) {
+      $paymentDetails, $returnProperties
+    )
+    ) {
       foreach ($paymentDetails as $key => $value) {
         $paymentIDs[] = $value['id'];
         $pledgeId = $value['pledge_id'];
@@ -963,7 +999,10 @@ LIMIT 1;";
         $lineSets[$priceField->price_set_id][] = $value;
         if ($value['entity_table'] == 'civicrm_membership') {
           try {
-            civicrm_api3('membership_payment', 'create', array('membership_id' => $value['entity_id'], 'contribution_id' => $contribution->id));
+            civicrm_api3('membership_payment', 'create', array(
+                'membership_id' => $value['entity_id'],
+                'contribution_id' => $contribution->id
+              ));
           }
           catch (CiviCRM_API3_Exception $e) {
             // we are catching & ignoring errors as an extra precaution since lost IPNs may be more serious that lost membership_payment data
@@ -1011,13 +1050,13 @@ LIMIT 1;";
         }
 
         foreach ($table as $tableName => $tableColumns) {
-          $insert          = 'INSERT INTO ' . $tableName . ' (' . implode(', ', $tableColumns) . ') ';
+          $insert = 'INSERT INTO ' . $tableName . ' (' . implode(', ', $tableColumns) . ') ';
           $tableColumns[0] = $targetContributionId;
-          $select          = 'SELECT ' . implode(', ', $tableColumns);
-          $from            = ' FROM ' . $tableName;
-          $where           = " WHERE {$tableName}.entity_id = {$sourceContributionId}";
-          $query           = $insert . $select . $from . $where;
-          $dao             = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+          $select = 'SELECT ' . implode(', ', $tableColumns);
+          $from = ' FROM ' . $tableName;
+          $where = " WHERE {$tableName}.entity_id = {$sourceContributionId}";
+          $query = $insert . $select . $from . $where;
+          $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
         }
       }
     }
index 1364467027dcbf398824fbeed27fa19391611a89..a5ae736c3040642e2ce5aa96392783e3c4611a72 100644 (file)
@@ -84,19 +84,19 @@ class CRM_Core_Payment_Dummy extends CRM_Core_Payment {
       return $this->_doDirectPaymentResult;
     }
     if ($this->_mode == 'test') {
-      $query             = "SELECT MAX(trxn_id) FROM civicrm_contribution WHERE trxn_id LIKE 'test\\_%'";
-      $p                 = array();
-      $trxn_id           = strval(CRM_Core_Dao::singleValueQuery($query, $p));
-      $trxn_id           = str_replace('test_', '', $trxn_id);
-      $trxn_id           = intval($trxn_id) + 1;
+      $query = "SELECT MAX(trxn_id) FROM civicrm_contribution WHERE trxn_id LIKE 'test\\_%'";
+      $p = array();
+      $trxn_id = strval(CRM_Core_Dao::singleValueQuery($query, $p));
+      $trxn_id = str_replace('test_', '', $trxn_id);
+      $trxn_id = intval($trxn_id) + 1;
       $params['trxn_id'] = sprintf('test_%08d', $trxn_id);
     }
     else {
-      $query             = "SELECT MAX(trxn_id) FROM civicrm_contribution WHERE trxn_id LIKE 'live_%'";
-      $p                 = array();
-      $trxn_id           = strval(CRM_Core_Dao::singleValueQuery($query, $p));
-      $trxn_id           = str_replace('live_', '', $trxn_id);
-      $trxn_id           = intval($trxn_id) + 1;
+      $query = "SELECT MAX(trxn_id) FROM civicrm_contribution WHERE trxn_id LIKE 'live_%'";
+      $p = array();
+      $trxn_id = strval(CRM_Core_Dao::singleValueQuery($query, $p));
+      $trxn_id = str_replace('live_', '', $trxn_id);
+      $trxn_id = intval($trxn_id) + 1;
       $params['trxn_id'] = sprintf('live_%08d', $trxn_id);
     }
     $params['gross_amount'] = $params['amount'];
index 8e1b720504a23f20c45c8727fa6154911004497d..ad682c9762dcaa7bcfbafdfb79b655310ce85f5c 100644 (file)
 */
 
 /**
- -----------------------------------------------------------------------------------------------
- The basic functionality of this processor is that variables from the $params object are transformed
- into xml. The xml is submitted to the processor's https site
- using curl and the response is translated back into an array using the processor's function.
-
- If an array ($params) is returned to the calling function the values from
- the array are merged into the calling functions array.
-
- If an result of class error is returned it is treated as a failure. No error denotes a success. Be
- WARY of this when coding
-
- -----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
The basic functionality of this processor is that variables from the $params object are transformed
into xml. The xml is submitted to the processor's https site
using curl and the response is translated back into an array using the processor's function.
+ *
If an array ($params) is returned to the calling function the values from
the array are merged into the calling functions array.
+ *
If an result of class error is returned it is treated as a failure. No error denotes a success. Be
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
-  CHARSET = 'UFT-8';
+    CHARSET = 'UFT-8';
 
   /**
    * We only need one instance of this object. So we use the singleton
@@ -227,7 +227,7 @@ class CRM_Core_Payment_Elavon extends CRM_Core_Payment {
     }
 
     /**********************************************************
-     // If gateway returned no data - tell 'em and bail out
+     // If gateway returned no data - tell 'em and bail out
      **********************************************************/
     if (empty($responseData)) {
       curl_close($ch);
@@ -235,7 +235,7 @@ class CRM_Core_Payment_Elavon extends CRM_Core_Payment {
     }
 
     /**********************************************************
-     // Success so far - close the curl and check the data
+     // Success so far - close the curl and check the data
      **********************************************************/
     curl_close($ch);
 
@@ -254,11 +254,11 @@ class CRM_Core_Payment_Elavon extends CRM_Core_Payment {
     }
     if ($processorResponse['ssl_result_message'] == "APPROVED") {
       if ($this->_mode == 'test') {
-        $query             = "SELECT MAX(trxn_id) FROM civicrm_contribution WHERE trxn_id LIKE 'test%'";
-        $p                 = array();
-        $trxn_id           = strval(CRM_Core_Dao::singleValueQuery($query, $p));
-        $trxn_id           = str_replace('test', '', $trxn_id);
-        $trxn_id           = intval($trxn_id) + 1;
+        $query = "SELECT MAX(trxn_id) FROM civicrm_contribution WHERE trxn_id LIKE 'test%'";
+        $p = array();
+        $trxn_id = strval(CRM_Core_Dao::singleValueQuery($query, $p));
+        $trxn_id = str_replace('test', '', $trxn_id);
+        $trxn_id = intval($trxn_id) + 1;
         $params['trxn_id'] = sprintf('test%08d', $trxn_id);
         return $params;
       }
@@ -276,7 +276,8 @@ class CRM_Core_Payment_Elavon extends CRM_Core_Payment {
              * Success !
              */
 
-      if ($this->_mode == 'test') {}
+      if ($this->_mode == 'test') {
+      }
       else {
         // 'trxn_id' is varchar(255) field. returned value is length 37
         $params['trxn_id'] = $processorResponse['ssl_txn_id'];
index be6fa7689b80849530cd3570332fcec7b849d295..4dff25c42d3dcd0ef1b6afe951dfaf943c05c69a 100644 (file)
 */
 
 /**
- Note that in order to use FirstData / LinkPoint you need a certificate (.pem) file issued by them
- and a store number. You can configure the path to the certificate and the store number
- through the front end of civiCRM. The path is as seen by the server not the url
- -----------------------------------------------------------------------------------------------
- The basic functionality of this processor is that variables from the $params object are transformed
- into xml using a function provided by the processor. The xml is submitted to the processor's https site
- using curl and the response is translated back into an array using the processor's function.
-
- If an array ($params) is returned to the calling function it is treated as a success and the values from
- the array are merged into the calling functions array.
-
- If an result of class error is returned it is treated as a failure
-
- -----------------------------------------------------------------------------------------------
Note that in order to use FirstData / LinkPoint you need a certificate (.pem) file issued by them
and a store number. You can configure the path to the certificate and the store number
through the front end of civiCRM. The path is as seen by the server not the url
-----------------------------------------------------------------------------------------------
The basic functionality of this processor is that variables from the $params object are transformed
into xml using a function provided by the processor. The xml is submitted to the processor's https site
using curl and the response is translated back into an array using the processor's function.
+ *
If an array ($params) is returned to the calling function it is treated as a success and the values from
the array are merged into the calling functions array.
+ *
If an result of class error is returned it is treated as a failure
+ *
-----------------------------------------------------------------------------------------------
  **/
 
 /**
index cd42687044e3d77ab06b365cd7d8b3e8d1f3f8c6..4556e3676b2ddd5727a011844291704c365ae3c5 100644 (file)
@@ -69,7 +69,7 @@ class CRM_Core_Payment_Form {
     // @todo - replace this section with one similar to above per discussion - probably use a manual processor shell class to stand in for that capability
     //return without adding billing fields if billing_mode = 4 (@todo - more the ability to set that to the payment processor)
     // or payment processor is NULL (pay later)
-    if (($processor == NULL && !$forceBillingFieldsForPayLater) ||  CRM_Utils_Array::value('billing_mode', $processor) == 4) {
+    if (($processor == NULL && !$forceBillingFieldsForPayLater) || CRM_Utils_Array::value('billing_mode', $processor) == 4) {
       return;
     }
     //@todo setPaymentFields defines the billing fields - this should be moved to the processor class & renamed getBillingFields
@@ -159,8 +159,9 @@ class CRM_Core_Payment_Form {
       'title' => ts('Country'),
       'cc_field' => TRUE,
       'attributes' => array(
-        '' => ts('- select -')) +
-      CRM_Core_PseudoConstant::country(),
+          '' => ts('- select -')
+        ) +
+        CRM_Core_PseudoConstant::country(),
       'is_required' => TRUE,
     );
     //CRM-15509 working towards giving control over billing fields to payment processors. For now removing tpl hard-coding
@@ -278,7 +279,6 @@ class CRM_Core_Payment_Form {
    * @param CRM_Core_Form $form
    * @param array $paymentFields
    *   Array of properties including 'object' as loaded from CRM_Financial_BAO_PaymentProcessor::getPaymentProcessors.
-
    * @param $paymentFields
    */
   protected static function addRules(&$form, $paymentFields) {
index e16428036e449ce5e3026b5cb5deda1382c4d885..09c0b3bf49858d86006d280924ec9b7fc2d61ebd 100644 (file)
@@ -175,13 +175,13 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment {
     $merchant_key = $this->_paymentProcessor['password'];
     $server_type = ($this->_mode == 'test') ? 'sandbox' : '';
 
-    $itemName     = CRM_Utils_Array::value('item_name', $params);
-    $description  = CRM_Utils_Array::value('description', $params);
-    $amount       = CRM_Utils_Array::value('amount', $params);
+    $itemName = CRM_Utils_Array::value('item_name', $params);
+    $description = CRM_Utils_Array::value('description', $params);
+    $amount = CRM_Utils_Array::value('amount', $params);
     $installments = CRM_Utils_Array::value('installments', $params);
 
-    $cart              = new GoogleCart($merchant_id, $merchant_key, $server_type, $params['currencyID']);
-    $item              = new GoogleItem($itemName, $description, 1, $amount);
+    $cart = new GoogleCart($merchant_id, $merchant_key, $server_type, $params['currencyID']);
+    $item = new GoogleItem($itemName, $description, 1, $amount);
     $subscription_item = new GoogleSubscription("merchant", $intervalUnit, $amount, $installments);
 
     $item->SetSubscription($subscription_item);
@@ -277,8 +277,8 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment {
 
     if ($request->getResponseCode() != 302) {
       CRM_Core_Error::fatal(ts('Invalid response code received from Google Checkout: %1',
-          array(1 => $request->getResponseCode())
-        ));
+        array(1 => $request->getResponseCode())
+      ));
     }
     CRM_Utils_System::redirect($request->getResponseHeader('location'));
     CRM_Utils_System::civiExit();
@@ -291,9 +291,9 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment {
    * returns an associtive array containing the response from the server.
    */
   public function invokeAPI($paymentProcessor, $searchParams) {
-    $merchantID  = $paymentProcessor['user_name'];
+    $merchantID = $paymentProcessor['user_name'];
     $merchantKey = $paymentProcessor['password'];
-    $siteURL     = rtrim(str_replace('https://', '', $paymentProcessor['url_site']), '/');
+    $siteURL = rtrim(str_replace('https://', '', $paymentProcessor['url_site']), '/');
 
     $url = "https://{$merchantID}:{$merchantKey}@{$siteURL}/api/checkout/v2/reports/Merchant/{$merchantID}";
     $xml = self::buildXMLQuery($searchParams);
@@ -385,8 +385,8 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment {
   public static function getArrayFromXML($xmlData) {
     require_once 'Google/library/xml-processing/gc_xmlparser.php';
     $xmlParser = new gc_XmlParser($xmlData);
-    $root      = $xmlParser->GetRoot();
-    $data      = $xmlParser->GetData();
+    $root = $xmlParser->GetRoot();
+    $data = $xmlParser->GetData();
 
     return array($root, $data);
   }
@@ -424,13 +424,13 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment {
   public function cancelSubscription(&$message = '', $params = array()) {
     $orderNo = CRM_Utils_Array::value('subscriptionId', $params);
 
-    $merchant_id  = $this->_paymentProcessor['user_name'];
+    $merchant_id = $this->_paymentProcessor['user_name'];
     $merchant_key = $this->_paymentProcessor['password'];
-    $server_type  = ($this->_mode == 'test') ? 'sandbox' : '';
+    $server_type = ($this->_mode == 'test') ? 'sandbox' : '';
 
     $googleRequest = new GoogleRequest($merchant_id, $merchant_key, $server_type);
-    $result        = $googleRequest->SendCancelItems($orderNo, array(), 'Cancelled by admin', '');
-    $message       = "{$result[0]}: {$result[1]}";
+    $result = $googleRequest->SendCancelItems($orderNo, array(), 'Cancelled by admin', '');
+    $message = "{$result[0]}: {$result[1]}";
 
     if ($result[0] != 200) {
       return self::error($result[0], $result[1]);
index 8d12bdc93fce63b63fbb74dd27f4e8498392fa68..0326dda87b6d360806a0e2f0abe785979319f287 100644 (file)
@@ -33,7 +33,6 @@
   */
 
 
-
 define('GOOGLE_DEBUG_PP', 0);
 
 /**
@@ -123,9 +122,9 @@ class CRM_Core_Payment_GoogleIPN extends CRM_Core_Payment_BaseIPN {
 
     $ids['contributionRecur'] = $ids['contributionPage'] = NULL;
     if ($input['component'] == "event") {
-      $ids['event']       = self::retrieve('eventID', 'Integer', $privateData, TRUE);
+      $ids['event'] = self::retrieve('eventID', 'Integer', $privateData, TRUE);
       $ids['participant'] = self::retrieve('participantID', 'Integer', $privateData, TRUE);
-      $ids['membership']  = NULL;
+      $ids['membership'] = NULL;
     }
     else {
       $ids['membership'] = self::retrieve('membershipID', 'Integer', $privateData, FALSE);
@@ -175,7 +174,7 @@ class CRM_Core_Payment_GoogleIPN extends CRM_Core_Payment_BaseIPN {
           // create a contribution and then get it processed
           $contribution = new CRM_Contribute_DAO_Contribution();
           $contribution->contact_id = $ids['contact'];
-          $contribution->financial_type_id  = $objects['contributionType']->id;
+          $contribution->financial_type_id = $objects['contributionType']->id;
           $contribution->contribution_page_id = $objects['contribution']->contribution_page_id;
           $contribution->contribution_recur_id = $ids['contributionRecur'];
           $contribution->receive_date = date('YmdHis');
@@ -299,11 +298,14 @@ class CRM_Core_Payment_GoogleIPN extends CRM_Core_Payment_BaseIPN {
       $ids['onbehalf_dupe_alert'] = NULL;
       if ($contribution->trxn_id) {
         list($ids['membership'], $ids['related_contact'], $ids['onbehalf_dupe_alert']) = explode(CRM_Core_DAO::VALUE_SEPARATOR,
-        $contribution->trxn_id
+          $contribution->trxn_id
         );
       }
       foreach (array(
-        'membership', 'related_contact', 'onbehalf_dupe_alert') as $fld) {
+                 'membership',
+                 'related_contact',
+                 'onbehalf_dupe_alert'
+               ) as $fld) {
         if (!is_numeric($ids[$fld])) {
           unset($ids[$fld]);
         }
@@ -328,11 +330,11 @@ class CRM_Core_Payment_GoogleIPN extends CRM_Core_Payment_BaseIPN {
       return $this->failed($objects, $transaction);
     }
 
-    $input['amount']     = $contribution->total_amount;
+    $input['amount'] = $contribution->total_amount;
     $input['fee_amount'] = NULL;
     $input['net_amount'] = NULL;
-    $input['trxn_id']    = $ids['contributionRecur'] ? $serial : $dataRoot['google-order-number']['VALUE'];
-    $input['is_test']    = $contribution->is_test;
+    $input['trxn_id'] = $ids['contributionRecur'] ? $serial : $dataRoot['google-order-number']['VALUE'];
+    $input['is_test'] = $contribution->is_test;
 
     $recur = NULL;
     if ($ids['contributionRecur']) {
@@ -350,8 +352,8 @@ class CRM_Core_Payment_GoogleIPN extends CRM_Core_Payment_BaseIPN {
    */
   public function completeRecur($input, $ids, $objects) {
     if ($ids['contributionRecur']) {
-      $recur               = &$objects['contributionRecur'];
-      $contributionCount   = CRM_Core_DAO::singleValueQuery("
+      $recur = &$objects['contributionRecur'];
+      $contributionCount = CRM_Core_DAO::singleValueQuery("
 SELECT count(*)
 FROM   civicrm_contribution
 WHERE  contribution_recur_id = {$ids['contributionRecur']}
@@ -548,12 +550,13 @@ WHERE  contribution_recur_id = {$ids['contributionRecur']}
       $privateData = $data[$root]['shopping-cart']['merchant-private-data']['VALUE'];
     }
     if (empty($privateData) && array_key_exists('order-summary', $data[$root])
-        && array_key_exists('shopping-cart', $data[$root]['order-summary'])) {
+      && array_key_exists('shopping-cart', $data[$root]['order-summary'])
+    ) {
       $privateData = $data[$root]['order-summary']['shopping-cart']['merchant-private-data']['VALUE'];
     }
     $privateData = $privateData ? self::stringToArray($privateData) : '';
-    $orderNo     = $data[$root]['google-order-number']['VALUE'];
-    $serial      = $data[$root]['serial-number'];
+    $orderNo = $data[$root]['google-order-number']['VALUE'];
+    $serial = $data[$root]['serial-number'];
 
     // a dummy object to call get context and a parent function inside it.
     $ipn = new CRM_Core_Payment_GoogleIPN('live', $dummyProcessor);
@@ -585,13 +588,13 @@ WHERE  contribution_recur_id = {$ids['contributionRecur']}
       case "merchant-calculation-callback":
         break;
 
-      case "new-order-notification":{
+      case "new-order-notification": {
         $response->SendAck($serial, FALSE);
         $ipn->newOrderNotify($data[$root], $privateData, $module);
         break;
-        }
+      }
 
-      case "order-state-change-notification":{
+      case "order-state-change-notification": {
         $response->SendAck($serial, FALSE);
         $new_financial_state = $data[$root]['new-financial-order-state']['VALUE'];
         $new_fulfillment_order = $data[$root]['new-fulfillment-order-state']['VALUE'];
@@ -615,9 +618,9 @@ WHERE  contribution_recur_id = {$ids['contributionRecur']}
             break;
         }
         break;
-        }
+      }
 
-      case "authorization-amount-notification":{
+      case "authorization-amount-notification": {
         $response->SendAck($serial, FALSE);
         $new_financial_state = $data[$root]['order-summary']['financial-order-state']['VALUE'];
         $new_fulfillment_order = $data[$root]['order-summary']['fulfillment-order-state']['VALUE'];
@@ -644,7 +647,7 @@ WHERE  contribution_recur_id = {$ids['contributionRecur']}
             break;
         }
         break;
-        }
+      }
 
       case "charge-amount-notification":
       case "chargeback-amount-notification":
index dcf3f7a7e44c44b71ef658beb959e4adae134aa6..b646542e07cbbcbce5fac5f033f0c190ad98867d 100644 (file)
@@ -189,7 +189,7 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment {
         case 'week':
           $scheduleType = 'WEEKLY';
           $scheduleDate = $date['wday'] + 1;
-          $endTime      = $startTime + ($paymentsRecur * 7 * 24 * 60 * 60);
+          $endTime = $startTime + ($paymentsRecur * 7 * 24 * 60 * 60);
           break;
 
         case 'month':
@@ -205,7 +205,7 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment {
 
         default:
           die('Invalid frequency unit!');
-        break;
+          break;
       }
       $endDate = date('Y-m-d', $endTime);
       $startDate = date('Y-m-d', $startTime);
@@ -227,9 +227,9 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment {
       // this just means we got some kind of answer, not necessarily approved
       $result = $iatslink1->getAuthorizationResult();
       //return self::error($result);
-      $result      = explode(':', $result, 2);
+      $result = explode(':', $result, 2);
       $trxn_result = trim($result[0]);
-      $trxn_id     = trim($result[1]);
+      $trxn_id = trim($result[1]);
       if ($trxn_result == 'OK') {
         $params['trxn_id'] = $trxn_id . ':' . time();
         $params['gross_amount'] = $amount;
index a4ba734a621463ac3bca019d30f962bea6674d9d..9f8e000e8869f259ea6ce09d9a9d0732795a42cf 100644 (file)
@@ -148,10 +148,10 @@ class CRM_Core_Payment_Moneris extends CRM_Core_Payment {
     // add a recurring payment if requested
     if ($params['is_recur'] && $params['installments'] > 1) {
       //Recur Variables
-      $recurUnit     = $params['frequency_unit'];
+      $recurUnit = $params['frequency_unit'];
       $recurInterval = $params['frequency_interval'];
-      $next          = time();
-      $day           = 60 * 60 * 24;
+      $next = time();
+      $day = 60 * 60 * 24;
       switch ($recurUnit) {
         case 'day':
           $next += $recurInterval * $day;
index 58ce4cfce50c6c6de377a5167436e9985607d5c8..8218141b9ccee4aa47807025cd2c80d2f306dee4 100644 (file)
@@ -63,7 +63,7 @@ class CRM_Core_Payment_PayJunction extends CRM_Core_Payment {
    * @abstract
    */
   public function doDirectPayment(&$params) {
-    $logon    = $this->_paymentProcessor['user_name'];
+    $logon = $this->_paymentProcessor['user_name'];
     $password = $this->_paymentProcessor['password'];
     $url_site = $this->_paymentProcessor['url_site'];
 
@@ -122,9 +122,9 @@ class CRM_Core_Payment_PayJunction extends CRM_Core_Payment {
 
       // Recur Variables
       $dc_schedule_create = $params['is_recur'];
-      $recurUnit          = $params['frequency_unit'];
-      $recurInterval      = $params['frequency_interval'];
-      $dc_schedule_start  = $params['dc_schedule_start'];
+      $recurUnit = $params['frequency_unit'];
+      $recurInterval = $params['frequency_interval'];
+      $dc_schedule_start = $params['dc_schedule_start'];
 
       // next payment in moneris required format
       $startDate = date("Y/m/d", $next);
index ae915749c82a2aff7e3244d67f9425f8cbb7545b..635adf86299b9c92a8f4b1e09ed02b9cd9be5a8b 100644 (file)
@@ -202,7 +202,7 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN {
       }
 
       $contribution->contact_id = $ids['contact'];
-      $contribution->financial_type_id  = $objects['contributionType']->id;
+      $contribution->financial_type_id = $objects['contributionType']->id;
       $contribution->contribution_page_id = $ids['contributionPage'];
       $contribution->contribution_recur_id = $ids['contributionRecur'];
       $contribution->receive_date = $now;
@@ -369,9 +369,9 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN {
       $input[$name] = $value ? $value : NULL;
     }
 
-    $input['is_test']    = self::retrieve('test_ipn', 'Integer', 'POST', FALSE);
+    $input['is_test'] = self::retrieve('test_ipn', 'Integer', 'POST', FALSE);
     $input['fee_amount'] = self::retrieve('mc_fee', 'Money', 'POST', FALSE);
     $input['net_amount'] = self::retrieve('settle_amount', 'Money', 'POST', FALSE);
-    $input['trxn_id']    = self::retrieve('txn_id', 'String', 'POST', FALSE);
+    $input['trxn_id'] = self::retrieve('txn_id', 'String', 'POST', FALSE);
   }
 }
index 0074366d06f9915203c9f020ea0def5e585ee382..afab2f4f7144a3bc66eb1ccc3ae984f090b5c9e5 100644 (file)
@@ -85,6 +85,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment {
     }
     return FALSE;
   }
+
   /**
    * Express checkout code. Check PayPal documentation for more information
    *
@@ -282,12 +283,12 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment {
    * @param $method
    */
   public function initialize(&$args, $method) {
-    $args['user']      = $this->_paymentProcessor['user_name'];
-    $args['pwd']       = $this->_paymentProcessor['password'];
-    $args['version']   = 3.0;
+    $args['user'] = $this->_paymentProcessor['user_name'];
+    $args['pwd'] = $this->_paymentProcessor['password'];
+    $args['version'] = 3.0;
     $args['signature'] = $this->_paymentProcessor['signature'];
-    $args['subject']   = CRM_Utils_Array::value('subject', $this->_paymentProcessor);
-    $args['method']    = $method;
+    $args['subject'] = CRM_Utils_Array::value('subject', $this->_paymentProcessor);
+    $args['method'] = $method;
   }
 
   /**
@@ -449,8 +450,8 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment {
       $this->initialize($args, 'ManageRecurringPaymentsProfileStatus');
 
       $args['PROFILEID'] = CRM_Utils_Array::value('subscriptionId', $params);
-      $args['ACTION']    = 'Cancel';
-      $args['NOTE']      = CRM_Utils_Array::value('reason', $params);
+      $args['ACTION'] = 'Cancel';
+      $args['NOTE'] = CRM_Utils_Array::value('reason', $params);
 
       $result = $this->invokeAPI($args);
       if (is_a($result, 'CRM_Core_Error')) {
@@ -482,13 +483,13 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment {
       $args['EXPDATE'] = sprintf('%02d', $params['month']) . $params['year'];
       $args['CVV2'] = $params['cvv2'];
 
-      $args['FIRSTNAME']   = $params['first_name'];
-      $args['LASTNAME']    = $params['last_name'];
-      $args['STREET']      = $params['street_address'];
-      $args['CITY']        = $params['city'];
-      $args['STATE']       = $params['state_province'];
+      $args['FIRSTNAME'] = $params['first_name'];
+      $args['LASTNAME'] = $params['last_name'];
+      $args['STREET'] = $params['street_address'];
+      $args['CITY'] = $params['city'];
+      $args['STATE'] = $params['state_province'];
       $args['COUNTRYCODE'] = $params['postal_code'];
-      $args['ZIP']         = $params['country'];
+      $args['ZIP'] = $params['country'];
 
       $result = $this->invokeAPI($args);
       if (is_a($result, 'CRM_Core_Error')) {
@@ -562,8 +563,8 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment {
       }
     }
 
-    $url       = ($component == 'event') ? 'civicrm/event/register' : 'civicrm/contribute/transact';
-    $cancel    = ($component == 'event') ? '_qf_Register_display' : '_qf_Main_display';
+    $url = ($component == 'event') ? 'civicrm/event/register' : 'civicrm/contribute/transact';
+    $cancel = ($component == 'event') ? '_qf_Register_display' : '_qf_Main_display';
     $returnURL = CRM_Utils_System::url($url,
       "_qf_ThankYou_display=1&qfKey={$params['qfKey']}",
       TRUE, NULL, FALSE
@@ -655,9 +656,9 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment {
 
       $paypalParams += array(
         'cmd' => '_xclick-subscriptions',
-        'a3'  => $params['amount'],
-        'p3'  => $params['frequency_interval'],
-        't3'  => ucfirst(substr($params['frequency_unit'], 0, 1)),
+        'a3' => $params['amount'],
+        'p3' => $params['frequency_interval'],
+        't3' => ucfirst(substr($params['frequency_unit'], 0, 1)),
         'src' => 1,
         'sra' => 1,
         'srt' => CRM_Utils_Array::value('installments', $params),
@@ -691,9 +692,9 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment {
       $uri .= "&{$key}={$value}";
     }
 
-    $uri       = substr($uri, 1);
-    $url       = $this->_paymentProcessor['url_site'];
-    $sub       = empty($params['is_recur']) ? 'cgi-bin/webscr' : 'subscriptions';
+    $uri = substr($uri, 1);
+    $url = $this->_paymentProcessor['url_site'];
+    $sub = empty($params['is_recur']) ? 'cgi-bin/webscr' : 'subscriptions';
     $paypalURL = "{$url}{$sub}?$uri";
 
     CRM_Utils_System::redirect($paypalURL);
index c1bc92e0356f2fc8a93716c30e3f9ab0b6236428..be6bfb3eaf2dec98a0cea511431e9054bc6956cb 100644 (file)
@@ -225,8 +225,12 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN {
     $contributionStatuses = $contributionStatuses['values'];
     switch ($txnType) {
       case 'recurring_payment_profile_created':
-        if (in_array($recur->contribution_status_id, array(array_search('Pending', $contributionStatuses), array_search('In Progress', $contributionStatuses)))
-        && !empty($recur->processor_id)) {
+        if (in_array($recur->contribution_status_id, array(
+              array_search('Pending', $contributionStatuses),
+              array_search('In Progress', $contributionStatuses)
+            ))
+          && !empty($recur->processor_id)
+        ) {
           echo "already handled";
           return;
         }
@@ -300,7 +304,7 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN {
       }
 
       $contribution->contact_id = $recur->contact_id;
-      $contribution->financial_type_id  = $objects['contributionType']->id;
+      $contribution->financial_type_id = $objects['contributionType']->id;
       $contribution->contribution_page_id = $ids['contributionPage'];
       $contribution->contribution_recur_id = $ids['contributionRecur'];
       $contribution->currency = $objects['contribution']->currency;
@@ -395,7 +399,7 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN {
       return;
     }
     $objects = $ids = $input = array();
-    $this->_component  = $input['component'] = self::getValue('m');
+    $this->_component = $input['component'] = self::getValue('m');
     $input['invoice'] = self::getValue('i', TRUE);
     // get the contribution and contact ids from the GET params
     $ids['contact'] = self::getValue('c', TRUE);
@@ -427,7 +431,7 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr
      WHERE m.contribution_recur_id = %2
      LIMIT 1";
       $sqlParams = array(
-      1 => array($ids['contribution'], 'Integer'),
+        1 => array($ids['contribution'], 'Integer'),
         2 => array($ids['contributionRecur'], 'Integer'),
       );
       if ($membershipId = CRM_Core_DAO::singleValueQuery($sql, $sqlParams)) {
@@ -498,10 +502,10 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr
       $input[$name] = $value ? $value : NULL;
     }
 
-    $input['is_test']    = self::retrieve('test_ipn', 'Integer', 'POST', FALSE);
+    $input['is_test'] = self::retrieve('test_ipn', 'Integer', 'POST', FALSE);
     $input['fee_amount'] = self::retrieve('mc_fee', 'Money', 'POST', FALSE);
     $input['net_amount'] = self::retrieve('settle_amount', 'Money', 'POST', FALSE);
-    $input['trxn_id']    = self::retrieve('txn_id', 'String', 'POST', FALSE);
+    $input['trxn_id'] = self::retrieve('txn_id', 'String', 'POST', FALSE);
     $input['payment_date'] = self::retrieve('payment_date', 'String', 'POST', FALSE);
   }
 
@@ -525,7 +529,7 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr
     // as membership id etc can be derived by the load objects fn
     $objects = $ids = $input = array();
     $isFirst = FALSE;
-    $input['txnType']  = $this->retrieve('txn_type', 'String');
+    $input['txnType'] = $this->retrieve('txn_type', 'String');
     if ($input['txnType'] != 'recurring_payment') {
       throw new CRM_Core_Exception('Paypal IPNS not handled other than recurring_payments');
     }
@@ -535,7 +539,10 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr
       throw new CRM_Core_Exception('This transaction has already been processed');
     }
 
-    $contributionRecur = civicrm_api3('contribution_recur', 'getsingle', array('return' => 'contact_id, id', 'invoice_id' => $input['invoice']));
+    $contributionRecur = civicrm_api3('contribution_recur', 'getsingle', array(
+        'return' => 'contact_id, id',
+        'invoice_id' => $input['invoice']
+      ));
     $ids['contact'] = $contributionRecur['contact_id'];
     $ids['contributionRecur'] = $contributionRecur['id'];
     $result = civicrm_api3('contribution', 'getsingle', array('invoice_id' => $input['invoice']));
@@ -546,11 +553,16 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr
       $isFirst = TRUE;
     }
     // arg api won't get this - fix it
-    $ids['contributionPage'] = CRM_Core_DAO::singleValueQuery("SELECT contribution_page_id FROM civicrm_contribution WHERE invoice_id = %1", array(1 => array($ids['contribution'], 'Integer')));
+    $ids['contributionPage'] = CRM_Core_DAO::singleValueQuery("SELECT contribution_page_id FROM civicrm_contribution WHERE invoice_id = %1", array(
+        1 => array(
+          $ids['contribution'],
+          '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
     // membership would be an easy add - but not relevant to my customer...
-    $this->_component  = $input['component'] = 'contribute';
+    $this->_component = $input['component'] = 'contribute';
     $input['trxn_date'] = date('Y-m-d-H-i-s', strtotime(self::retrieve('time_created', 'String')));
     $paymentProcessorID = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessorType',
       'PayPal', 'id', 'name'
@@ -570,7 +582,8 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr
     if (CRM_Core_DAO::singleValueQuery("SELECT count(*) FROM civicrm_contribution WHERE trxn_id = %1",
       array(
         1 => array($trxn_id, 'String'),
-      ))) {
+      ))
+    ) {
       return TRUE;
     }
   }
index 2f5a15972399e997e1bee9b964ea1b5110fdef96..adbc43bcd427f5d6e0dd4566e4662584bd2e0c86 100644 (file)
@@ -15,7 +15,7 @@
 class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment {
   // (not used, implicit in the API, might need to convert?)
   const
-  CHARSET = 'UFT-8';
+    CHARSET = 'UFT-8';
 
   /**
    * We only need one instance of this object. So we use the singleton
@@ -310,7 +310,6 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment {
          * the cvv check, the avs check. This is stored in
          * CiviCRM as part of the transact
          * but not further processing is done. Business rules would need to be defined
-
          *******************************************************/
         $params['trxn_id'] = $nvpArray['PNREF'] . $nvpArray['TRXPNREF'];
         //'trxn_id' is varchar(255) field. returned value is length 12
index de4b32457be1b9294e05765a6b70fc081a9fcea1..021755c4c512f2762cabe46adea369b0ac0a59f4 100644 (file)
@@ -121,9 +121,9 @@ class CRM_Core_Payment_PaymentExpressIPN extends CRM_Core_Payment_BaseIPN {
     $ids['contribution'] = self::retrieve('contributionID', 'Integer', $privateData, TRUE);
 
     if ($input['component'] == "event") {
-      $ids['event']       = self::retrieve('eventID', 'Integer', $privateData, TRUE);
+      $ids['event'] = self::retrieve('eventID', 'Integer', $privateData, TRUE);
       $ids['participant'] = self::retrieve('participantID', 'Integer', $privateData, TRUE);
-      $ids['membership']  = NULL;
+      $ids['membership'] = NULL;
     }
     else {
       $ids['membership'] = self::retrieve('membershipID', 'Integer', $privateData, FALSE);
@@ -139,10 +139,10 @@ class CRM_Core_Payment_PaymentExpressIPN extends CRM_Core_Payment_BaseIPN {
     }
 
     // make sure the invoice is valid and matches what we have in the contribution record
-    $input['invoice']    = $privateData['invoiceID'];
+    $input['invoice'] = $privateData['invoiceID'];
     $input['newInvoice'] = $transactionReference;
-    $contribution        = &$objects['contribution'];
-    $input['trxn_id']    = $transactionReference;
+    $contribution = &$objects['contribution'];
+    $input['trxn_id'] = $transactionReference;
 
     if ($contribution->invoice_id != $input['invoice']) {
       CRM_Core_Error::debug_log_message("Invoice values dont match between database and IPN request");
@@ -188,8 +188,8 @@ class CRM_Core_Payment_PaymentExpressIPN extends CRM_Core_Payment_BaseIPN {
   }
 
   /**
-
-  /**
+   *
+   * /**
    * The function returns the component(Event/Contribute..)and whether it is Test or not
    *
    * @param array $privateData
@@ -206,8 +206,8 @@ class CRM_Core_Payment_PaymentExpressIPN extends CRM_Core_Payment_BaseIPN {
     $component = NULL;
     $isTest = NULL;
 
-    $contributionID   = $privateData['contributionID'];
-    $contribution     = new CRM_Contribute_DAO_Contribution();
+    $contributionID = $privateData['contributionID'];
+    $contribution = new CRM_Contribute_DAO_Contribution();
     $contribution->id = $contributionID;
 
     if (!$contribution->find(TRUE)) {
@@ -281,40 +281,40 @@ class CRM_Core_Payment_PaymentExpressIPN extends CRM_Core_Payment_BaseIPN {
 
     if ($dps_method == "pxpay") {
       $processResponse = CRM_Core_Payment_PaymentExpressUtils::_valueXml(array(
-          'PxPayUserId' => $dps_user,
-          'PxPayKey' => $dps_key,
-          'Response' => $_GET['result'],
-        ));
+        'PxPayUserId' => $dps_user,
+        'PxPayKey' => $dps_key,
+        'Response' => $_GET['result'],
+      ));
       $processResponse = CRM_Core_Payment_PaymentExpressUtils::_valueXml('ProcessResponse', $processResponse);
 
       fwrite($message_log, sprintf("\n\r%s:- %s\n", date("D M j G:i:s T Y"),
-          $processResponse
-        ));
+        $processResponse
+      ));
 
       // Send the XML-formatted validation request to DPS so that we can receive a decrypted XML response which contains the transaction results
       $curl = CRM_Core_Payment_PaymentExpressUtils::_initCURL($processResponse, $dps_url);
 
       fwrite($message_log, sprintf("\n\r%s:- %s\n", date("D M j G:i:s T Y"),
-          $curl
-        ));
+        $curl
+      ));
       $success = FALSE;
       if ($response = curl_exec($curl)) {
         fwrite($message_log, sprintf("\n\r%s:- %s\n", date("D M j G:i:s T Y"),
-            $response
-          ));
+          $response
+        ));
         curl_close($curl);
 
         // Assign the returned XML values to variables
-        $valid             = CRM_Core_Payment_PaymentExpressUtils::_xmlAttribute($response, 'valid');
-        $success           = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, 'Success');
-        $txnId             = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, 'TxnId');
-        $responseText      = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, 'ResponseText');
-        $authCode          = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, 'AuthCode');
-        $DPStxnRef         = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, 'DpsTxnRef');
-        $qfKey             = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, "TxnData1");
-        $privateData       = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, "TxnData2");
-        list($component, $paymentProcessorID,)  = explode(',', CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, "TxnData3"));
-        $amount            = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, "AmountSettlement");
+        $valid = CRM_Core_Payment_PaymentExpressUtils::_xmlAttribute($response, 'valid');
+        $success = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, 'Success');
+        $txnId = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, 'TxnId');
+        $responseText = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, 'ResponseText');
+        $authCode = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, 'AuthCode');
+        $DPStxnRef = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, 'DpsTxnRef');
+        $qfKey = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, "TxnData1");
+        $privateData = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, "TxnData2");
+        list($component, $paymentProcessorID,) = explode(',', CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, "TxnData3"));
+        $amount = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, "AmountSettlement");
         $merchantReference = CRM_Core_Payment_PaymentExpressUtils::_xmlElement($response, "MerchantReference");
       }
       else {
@@ -332,13 +332,13 @@ class CRM_Core_Payment_PaymentExpressIPN extends CRM_Core_Payment_BaseIPN {
       #which encapsulates all the response data
       $rsp = $pxaccess->getResponse($rawPostData);
 
-      $qfKey             = $rsp->getTxnData1();
-      $privateData       = $rsp->getTxnData2();
-      list($component, $paymentProcessorID)  = explode(',', $rsp->getTxnData3());
-      $success           = $rsp->getSuccess();
-      $authCode          = $rsp->getAuthCode();
-      $DPStxnRef         = $rsp->getDpsTxnRef();
-      $amount            = $rsp->getAmountSettlement();
+      $qfKey = $rsp->getTxnData1();
+      $privateData = $rsp->getTxnData2();
+      list($component, $paymentProcessorID) = explode(',', $rsp->getTxnData3());
+      $success = $rsp->getSuccess();
+      $authCode = $rsp->getAuthCode();
+      $DPStxnRef = $rsp->getDpsTxnRef();
+      $amount = $rsp->getAmountSettlement();
       $MerchantReference = $rsp->getMerchantReference();
     }
 
index 4161479355a94bc5b1de4a8c665d7ba163e0b124..1d5a08a5dae116ccb8611a16469938a4a89f354d 100644 (file)
@@ -83,7 +83,8 @@ class CRM_Core_Payment_ProcessorForm {
 
     // make sure we have a valid payment class, else abort
     if (!empty($form->_values['is_monetary']) &&
-      !$form->_paymentProcessor['class_name'] && empty($form->_values['is_pay_later'])) {
+      !$form->_paymentProcessor['class_name'] && empty($form->_values['is_pay_later'])
+    ) {
       CRM_Core_Error::fatal(ts('Payment processor is not set for this page'));
     }
 
index 5708060918e8fdabf1b4d210470df32dca6f53de..90c6f85b9390000f6954f408bf1569e8366cd1b6 100644 (file)
@@ -142,9 +142,9 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment {
     }
 
     // Create sha1 hash for request
-    $hashme   = "{$this->_getParam('timestamp')}.{$this->_getParam('merchant_ref')}.{$this->_getParam('order_id')}.{$this->_getParam('amount')}.{$this->_getParam('currency')}.{$this->_getParam('card_number')}";
+    $hashme = "{$this->_getParam('timestamp')}.{$this->_getParam('merchant_ref')}.{$this->_getParam('order_id')}.{$this->_getParam('amount')}.{$this->_getParam('currency')}.{$this->_getParam('card_number')}";
     $sha1hash = sha1($hashme);
-    $hashme   = "$sha1hash.{$this->_getParam('secret')}";
+    $hashme = "$sha1hash.{$this->_getParam('secret')}";
     $sha1hash = sha1($hashme);
 
     // Generate the request xml that is send to Realex Payments.
@@ -228,9 +228,9 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment {
     }
 
     // Check the response hash
-    $hashme   = "{$this->_getParam('timestamp')}.{$this->_getParam('merchant_ref')}.{$this->_getParam('order_id')}.{$response['RESULT']}.{$response['MESSAGE']}.{$response['PASREF']}.{$response['AUTHCODE']}";
+    $hashme = "{$this->_getParam('timestamp')}.{$this->_getParam('merchant_ref')}.{$this->_getParam('order_id')}.{$response['RESULT']}.{$response['MESSAGE']}.{$response['PASREF']}.{$response['AUTHCODE']}";
     $sha1hash = sha1($hashme);
-    $hashme   = "$sha1hash.{$this->_getParam('secret')}";
+    $hashme = "$sha1hash.{$this->_getParam('secret')}";
     $sha1hash = sha1($hashme);
 
     if ($response['SHA1HASH'] != $sha1hash) {
@@ -409,7 +409,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment {
     // Format the expiry date to MMYY
     $expmonth = (string) $params['month'];
     $expmonth = (strlen($expmonth) === 1) ? '0' . $expmonth : $expmonth;
-    $expyear  = substr((string) $params['year'], 2, 2);
+    $expyear = substr((string) $params['year'], 2, 2);
     $this->_setParam('exp_date', $expmonth . $expyear);
 
     if (isset($params['credit_card_start_date']) && (strlen($params['credit_card_start_date']['M']) !== 0) &&
@@ -417,7 +417,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment {
     ) {
       $startmonth = (string) $params['credit_card_start_date']['M'];
       $startmonth = (strlen($startmonth) === 1) ? '0' . $startmonth : $startmonth;
-      $startyear  = substr((string) $params['credit_card_start_date']['Y'], 2, 2);
+      $startyear = substr((string) $params['credit_card_start_date']['Y'], 2, 2);
       $this->_setParam('start_date', $startmonth . $startyear);
     }
 
index 7dca6225480a439aea34b493ba5818288f0c02ea..71457de839318fb0df9410358449dafe609165bd 100644 (file)
 */
 
 /**
- -----------------------------------------------------------------------------------------------
- From the eWAY supplied 'Web.config' dated 25-Sep-2006 - check date and update links if required
- -----------------------------------------------------------------------------------------------
-
- LIVE gateway with CVN
- https://www.eway.com.au/gateway_cvn/xmlpayment.asp
-
- LIVE gateway without CVN
- https://www.eway.com.au/gateway/xmlpayment.asp
-
-
- Test gateway with CVN
- https://www.eway.com.au/gateway_cvn/xmltest/TestPage.asp
-
- Test gateway without CVN
- https://www.eway.com.au/gateway/xmltest/TestPage.asp
-
-
- LIVE gateway for Stored Transactions
- https://www.eway.com.au/gateway/xmlstored.asp
-
-
- -----------------------------------------------------------------------------------------------
- From the eWAY web-site - http://www.eway.com.au/Support/Developer/PaymentsRealTime.aspx
- -----------------------------------------------------------------------------------------------
- The test Customer ID is 87654321 - this is the only ID that will work on the test gateway.
- The test Credit Card number is 4444333322221111
- - this is the only credit card number that will work on the test gateway.
- The test Total Amount should end in 00 or 08 to get a successful response (e.g. $10.00 or $10.08)
- ie - all other amounts will return a failed response.
-
- -----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
From the eWAY supplied 'Web.config' dated 25-Sep-2006 - check date and update links if required
-----------------------------------------------------------------------------------------------
+ *
LIVE gateway with CVN
https://www.eway.com.au/gateway_cvn/xmlpayment.asp
+ *
LIVE gateway without CVN
https://www.eway.com.au/gateway/xmlpayment.asp
+ *
+ *
Test gateway with CVN
https://www.eway.com.au/gateway_cvn/xmltest/TestPage.asp
+ *
Test gateway without CVN
https://www.eway.com.au/gateway/xmltest/TestPage.asp
+ *
+ *
LIVE gateway for Stored Transactions
https://www.eway.com.au/gateway/xmlstored.asp
+ *
+ *
-----------------------------------------------------------------------------------------------
From the eWAY web-site - http://www.eway.com.au/Support/Developer/PaymentsRealTime.aspx
-----------------------------------------------------------------------------------------------
The test Customer ID is 87654321 - this is the only ID that will work on the test gateway.
The test Credit Card number is 4444333322221111
- this is the only credit card number that will work on the test gateway.
The test Total Amount should end in 00 or 08 to get a successful response (e.g. $10.00 or $10.08)
ie - all other amounts will return a failed response.
+ *
-----------------------------------------------------------------------------------------------
  **/
 class CRM_Core_Payment_eWAY extends CRM_Core_Payment {
   # (not used, implicit in the API, might need to convert?)
@@ -170,7 +170,7 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment {
     // Prepare some composite data from _paymentProcessor fields
     //-------------------------------------------------------------
     $fullAddress = $params['street_address'] . ", " . $params['city'] . ", " . $params['state_province'] . ".";
-    $expireYear  = substr($params['year'], 2, 2);
+    $expireYear = substr($params['year'], 2, 2);
     $expireMonth = sprintf('%02d', (int) $params['month']);
     // CiviCRM V1.9 - Picks up reasonable description
     //$description = $params['amount_level'];
@@ -539,12 +539,12 @@ The CiviCRM eWAY Payment Processor Module
     $params = array();
 
     $params['groupName'] = 'eWay Email Sender';
-    $params['from']      = $from;
-    $params['toName']    = $toName;
-    $params['toEmail']   = $toEmail;
-    $params['subject']   = $subject;
-    $params['cc']        = $cc;
-    $params['text']      = $message;
+    $params['from'] = $from;
+    $params['toName'] = $toName;
+    $params['toEmail'] = $toEmail;
+    $params['subject'] = $subject;
+    $params['cc'] = $cc;
+    $params['text'] = $message;
 
     CRM_Utils_Mail::send($params);
   }
index a5e98cdbc7d34930cf916ae638a1ec72decef539..4f1ed1f76712df476599a0d9431468f72b6ff6e2 100644 (file)
@@ -96,6 +96,7 @@ class CRM_Core_Permission_Base {
   public function whereClause($type, &$tables, &$whereTables) {
     return '( 1 )';
   }
+
   /**
    * Get the permissioned where clause for the user when trying to see groups
    *
index f479f5187a7a88ebf14cefe6ee2d2a3fa81a587e..eedf271ac8860a119b4adddeaddcfab44fc33542 100644 (file)
@@ -174,8 +174,8 @@ class CRM_Core_Permission_DrupalBase extends CRM_Core_Permission_Base {
           $group->id = $id;
           if ($group->find(TRUE) && $group->saved_search_id) {
             $clause = CRM_Contact_BAO_SavedSearch::whereClause($group->saved_search_id,
-                $tables,
-                $whereTables
+              $tables,
+              $whereTables
             );
             if (trim($clause)) {
               $clauses[] = $clause;
index abfdc3445699c7b2b6e87fe5b9e2268fcb998975..354dda8af4eb3b9271a440d0743657388971ff9c 100644 (file)
@@ -90,6 +90,7 @@ class CRM_Core_Permission_WordPress extends CRM_Core_Permission_Base {
     }
     return FALSE;
   }
+
   /**
    * {@inheritDoc}
    */
index 2afe385da27c0fc83f1a3eb9bd85693af734eb08..33b02226816ba3f0e98287a6b74d353c8c130879 100644 (file)
@@ -228,7 +228,7 @@ class CRM_Core_PseudoConstant {
    * - orderColumn string the column to use for sorting, defaults to 'weight' column if one exists, else defaults to labelColumn
    * - onlyActive boolean return only the action option values
    * - fresh      boolean ignore cache entries and go back to DB
-   * @param string $context: Context string
+   * @param string $context : Context string
    *
    * @return Array|bool - array on success, FALSE on error.
    *
@@ -380,9 +380,9 @@ class CRM_Core_PseudoConstant {
             $wheres[] = 'domain_id = ' . CRM_Core_Config::domainID();
           }
           $queryParams = array(
-             1 => array($params['keyColumn'], 'String', CRM_Core_DAO::QUERY_FORMAT_NO_QUOTES),
-             2 => array($params['labelColumn'], 'String', CRM_Core_DAO::QUERY_FORMAT_NO_QUOTES),
-             3 => array($pseudoconstant['table'], 'String', CRM_Core_DAO::QUERY_FORMAT_NO_QUOTES),
+            1 => array($params['keyColumn'], 'String', CRM_Core_DAO::QUERY_FORMAT_NO_QUOTES),
+            2 => array($params['labelColumn'], 'String', CRM_Core_DAO::QUERY_FORMAT_NO_QUOTES),
+            3 => array($pseudoconstant['table'], 'String', CRM_Core_DAO::QUERY_FORMAT_NO_QUOTES),
           );
           // Add orderColumn param
           if (!empty($params['orderColumn'])) {
@@ -570,8 +570,8 @@ class CRM_Core_PseudoConstant {
     $force = NULL
   ) {
     $cacheKey = "CRM_PC_{$name}_{$all}_{$key}_{$retrieve}_{$filter}_{$condition}_{$orderby}";
-    $cache    = CRM_Utils_Cache::singleton();
-    $var      = $cache->get($cacheKey);
+    $cache = CRM_Utils_Cache::singleton();
+    $var = $cache->get($cacheKey);
     if ($var && empty($force)) {
       return $var;
     }
@@ -718,8 +718,8 @@ class CRM_Core_PseudoConstant {
       $config = CRM_Core_Config::singleton();
       if ($limit) {
         $countryIsoCodes = self::countryIsoCode();
-        $limitCodes      = $config->provinceLimit();
-        $limitIds        = array();
+        $limitCodes = $config->provinceLimit();
+        $limitIds = array();
         foreach ($limitCodes as $code) {
           $limitIds = array_merge($limitIds, array_keys($countryIsoCodes, $code));
         }
@@ -737,8 +737,8 @@ class CRM_Core_PseudoConstant {
       if ($tsLocale != '' and $tsLocale != 'en_US') {
         $i18n = CRM_Core_I18n::singleton();
         $i18n->localizeArray(self::$stateProvince, array(
-            'context' => 'province',
-          ));
+          'context' => 'province',
+        ));
         self::$stateProvince = CRM_Utils_Array::asort(self::$stateProvince);
       }
     }
@@ -788,10 +788,10 @@ WHERE  id = %1";
       $whereClause = FALSE;
 
       if ($limit) {
-        $config          = CRM_Core_Config::singleton();
+        $config = CRM_Core_Config::singleton();
         $countryIsoCodes = self::countryIsoCode();
-        $limitCodes      = $config->provinceLimit();
-        $limitIds        = array();
+        $limitCodes = $config->provinceLimit();
+        $limitIds = array();
         foreach ($limitCodes as $code) {
           $tmpArray = array_keys($countryIsoCodes, $code);
 
@@ -880,8 +880,8 @@ WHERE  id = %1";
       if ($tsLocale != '' and $tsLocale != 'en_US') {
         $i18n = CRM_Core_I18n::singleton();
         $i18n->localizeArray(self::$country, array(
-            'context' => 'country',
-          ));
+          'context' => 'country',
+        ));
         self::$country = CRM_Utils_Array::asort(self::$country);
       }
     }
@@ -1779,7 +1779,10 @@ WHERE  id = %1
   public static function &greetingDefaults() {
     if (!self::$greetingDefaults) {
       $defaultGreetings = array();
-      $contactTypes = self::get('CRM_Contact_DAO_Contact', 'contact_type', array('keyColumn' => 'id', 'labelColumn' => 'name'));
+      $contactTypes = self::get('CRM_Contact_DAO_Contact', 'contact_type', array(
+          'keyColumn' => 'id',
+          'labelColumn' => 'name'
+        ));
 
       foreach ($contactTypes as $filter => $contactType) {
         $filterCondition = " AND (v.filter = 0 OR v.filter = $filter) AND v.is_default = 1 ";
index 7d398c3a49383b235a460d71056700114e0f6f09..05db31e4e94cfcf9cdda4f6119dab2c2b6431983 100644 (file)
@@ -100,7 +100,10 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action {
         $newName = CRM_Utils_File::makeFileName($value['name']);
         $status = $element->moveUploadedFile($this->_uploadDir, $newName);
         if (!$status) {
-          CRM_Core_Error::statusBounce(ts('We could not move the uploaded file %1 to the upload directory %2. Please verify that the \'Temporary Files\' setting points to a valid path which is writable by your web server.', array(1 => $value['name'], 2 => $this->_uploadDir)));
+          CRM_Core_Error::statusBounce(ts('We could not move the uploaded file %1 to the upload directory %2. Please verify that the \'Temporary Files\' setting points to a valid path which is writable by your web server.', array(
+                1 => $value['name'],
+                2 => $this->_uploadDir
+              )));
         }
         if (!empty($data['values'][$pageName][$uploadName]['name'])) {
           @unlink($this->_uploadDir . $data['values'][$pageName][$uploadName]);
index 2bd502623c0c749fac10983d02294415f498748c..c2e7193063cd77b2082b3101b363d3608ebf8140 100644 (file)
@@ -45,8 +45,8 @@ class CRM_Core_QuickForm_GroupMultiSelect extends CRM_Core_QuickForm_NestedAdvMu
       return $this->getFrozenHtml();
     }
 
-    $tabs    = $this->_getTabs();
-    $tab     = $this->_getTab();
+    $tabs = $this->_getTabs();
+    $tab = $this->_getTab();
     $strHtml = '';
 
     if ($this->getComment() != '') {
@@ -86,10 +86,10 @@ class CRM_Core_QuickForm_GroupMultiSelect extends CRM_Core_QuickForm_NestedAdvMu
       }
       $strHtmlSelected .= $tab . '</div>' . PHP_EOL;
 
-      $strHtmlHidden     = '';
+      $strHtmlHidden = '';
       $strHtmlUnselected = '';
-      $strHtmlAdd        = '';
-      $strHtmlRemove     = '';
+      $strHtmlAdd = '';
+      $strHtmlRemove = '';
 
       // build the select all button with all its attributes
       $attributes = array('onclick' => "{$this->_jsPrefix}{$this->_jsPostfix}('" . $this->getName() . "', 1);");
@@ -116,17 +116,26 @@ class CRM_Core_QuickForm_GroupMultiSelect extends CRM_Core_QuickForm_NestedAdvMu
       // ... or a dual multi-select
 
       // 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')");
+      $this->_attributesUnselected = array(
+        'name' => '__' . $selectName,
+        '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')");
+      $this->_attributesSelected = array(
+        'name' => '_' . $selectName,
+        '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;');
+      $this->_attributesHidden = array(
+        'name' => $selectName,
+        'style' => 'overflow: hidden; visibility: hidden; width: 1px; height: 0;'
+      );
       $this->_attributesHidden = array_merge($this->_attributes, $this->_attributesHidden);
       $attrHidden = $this->_getAttrString($this->_attributesHidden);
 
@@ -251,7 +260,7 @@ class CRM_Core_QuickForm_GroupMultiSelect extends CRM_Core_QuickForm_NestedAdvMu
     // render extra labels, if any
     if (is_array($labels)) {
       foreach ($labels as $key => $text) {
-        $key     = is_int($key) ? $key + 2 : $key;
+        $key = is_int($key) ? $key + 2 : $key;
         $strHtml = str_replace("{label_{$key}}", $text, $strHtml);
         $strHtml = str_replace("<!-- BEGIN label_{$key} -->", '', $strHtml);
         $strHtml = str_replace("<!-- END label_{$key} -->", '', $strHtml);
@@ -263,18 +272,32 @@ class CRM_Core_QuickForm_GroupMultiSelect extends CRM_Core_QuickForm_NestedAdvMu
     }
 
     $placeHolders = array(
-      '{stylesheet}', '{javascript}', '{class}',
-      '{unselected}', '{selected}',
-      '{add}', '{remove}',
-      '{all}', '{none}', '{toggle}',
-      '{moveup}', '{movedown}',
+      '{stylesheet}',
+      '{javascript}',
+      '{class}',
+      '{unselected}',
+      '{selected}',
+      '{add}',
+      '{remove}',
+      '{all}',
+      '{none}',
+      '{toggle}',
+      '{moveup}',
+      '{movedown}',
     );
     $htmlElements = array(
-      $this->getElementCss(FALSE), $this->getElementJs(FALSE), $this->_tableAttributes,
-      $strHtmlUnselected, $strHtmlSelected . $strHtmlHidden,
-      $strHtmlAdd, $strHtmlRemove,
-      $strHtmlAll, $strHtmlNone, $strHtmlToggle,
-      $strHtmlMoveUp, $strHtmlMoveDown,
+      $this->getElementCss(FALSE),
+      $this->getElementJs(FALSE),
+      $this->_tableAttributes,
+      $strHtmlUnselected,
+      $strHtmlSelected . $strHtmlHidden,
+      $strHtmlAdd,
+      $strHtmlRemove,
+      $strHtmlAll,
+      $strHtmlNone,
+      $strHtmlToggle,
+      $strHtmlMoveUp,
+      $strHtmlMoveDown,
     );
 
     $strHtml = str_replace($placeHolders, $htmlElements, $strHtml);
index 863018d9ad3fca4618bfa7663a8b34df6c1db3d5..eaa88057c520a83933fb3dab6f96b1417de06a66 100644 (file)
@@ -29,7 +29,6 @@ class CRM_Core_Reference_Dynamic extends CRM_Core_Reference_Basic {
 
     $params = array(
       1 => array($targetDao->$targetColumn, 'String'),
-
       // If anyone complains about $targetDao::getTableName(), then could use
       // "{get_class($targetDao)}::getTableName();"
       2 => array($targetDao::getTableName(), 'String'),
@@ -56,7 +55,6 @@ EOS;
     $targetColumn = $this->getTargetKey();
     $params = array(
       1 => array($targetDao->$targetColumn, 'String'),
-
       // If anyone complains about $targetDao::getTableName(), then could use
       // "{get_class($targetDao)}::getTableName();"
       2 => array($targetDao::getTableName(), 'String'),
index 98a5b2df29c9f5c1bfda237880821012a8966cf0..c6aa514286d479a1c58e2ef4d60f66d7b89e1911 100644 (file)
@@ -33,7 +33,7 @@ class CRM_Core_Reference_OptionValue extends CRM_Core_Reference_Basic {
    * @throws CRM_Core_Exception
    */
   public function findReferences($targetDao) {
-    if (! ($targetDao instanceof CRM_Core_DAO_OptionValue)) {
+    if (!($targetDao instanceof CRM_Core_DAO_OptionValue)) {
       throw new CRM_Core_Exception("Mismatched reference: expected OptionValue but received " . get_class($targetDao));
     }
     if ($targetDao->option_group_id == $this->getTargetOptionGroupId()) {
@@ -51,7 +51,7 @@ class CRM_Core_Reference_OptionValue extends CRM_Core_Reference_Basic {
    * @throws CRM_Core_Exception
    */
   public function getReferenceCount($targetDao) {
-    if (! ($targetDao instanceof CRM_Core_DAO_OptionValue)) {
+    if (!($targetDao instanceof CRM_Core_DAO_OptionValue)) {
       throw new CRM_Core_Exception("Mismatched reference: expected OptionValue but received " . get_class($targetDao));
     }
     if ($targetDao->option_group_id == $this->getTargetOptionGroupId()) {
index c920250e03be40a588e9f69d2553ee7643e11af7..2de943d216f2a08a7cb48f88b6d780040d907dd7 100644 (file)
@@ -15,7 +15,7 @@ class CRM_Core_Region {
    * @return CRM_Core_Region
    */
   public static function &instance($name, $autocreate = TRUE) {
-    if ($autocreate && ! isset(self::$_instances[$name])) {
+    if ($autocreate && !isset(self::$_instances[$name])) {
       self::$_instances[$name] = new CRM_Core_Region($name);
     }
     return self::$_instances[$name];
@@ -198,7 +198,7 @@ class CRM_Core_Region {
 
         case 'jquery':
           $snippet['script'] = sprintf("CRM.\$(function(\$) {\n%s\n});", $snippet['jquery']);
-          // no break - continue processing as script
+        // no break - continue processing as script
         case 'script':
           if (!$allowCmsOverride || !$cms->addScript($snippet['script'], $this->_name)) {
             $html .= sprintf("<script type=\"text/javascript\">\n%s\n</script>\n", $snippet['script']);
@@ -220,7 +220,7 @@ class CRM_Core_Region {
         default:
           require_once 'CRM/Core/Error.php';
           CRM_Core_Error::fatal(ts('Snippet type %1 is unrecognized',
-                     array(1 => $snippet['type'])));
+            array(1 => $snippet['type'])));
       }
     }
     return $html;
@@ -255,14 +255,14 @@ class CRM_Core_Region {
    * @param string $markup
    *   HTML.
    *
-  public function addMarkup($markup) {
-  return $this->add(array(
-  'type' => 'markup',
-  'markup' => $markup,
-  ));
-  }
-
-  /**
+   * public function addMarkup($markup) {
+   * return $this->add(array(
+   * 'type' => 'markup',
+   * 'markup' => $markup,
+   * ));
+   * }
+   *
+   * /**
    * Add a Smarty template file to a region
    *
    * Note: File is not evaluated until the page is rendered
@@ -270,26 +270,26 @@ class CRM_Core_Region {
    * @param string $template
    *   Path to the Smarty template file.
    *
-  public function addTemplate($template) {
-  return $this->add(array(
-  'type' => 'template',
-  'template' => $template,
-  ));
-  }
-
-  /**
+   * public function addTemplate($template) {
+   * return $this->add(array(
+   * 'type' => 'template',
+   * 'template' => $template,
+   * ));
+   * }
+   *
+   * /**
    * Use a callback function to extend a region
    *
    * @param mixed $callback
    * @param array $arguments
    *   Optional, array of parameters for callback; if omitted, the default arguments are ($snippetSpec, $html).
    *
-  public function addCallback($callback, $arguments = FALSE) {
-  return $this->add(array(
-  'type' => 'callback',
-  'callback' => $callback,
-  'arguments' => $arguments,
-  ));
-  }
-  */
+   * public function addCallback($callback, $arguments = FALSE) {
+   * return $this->add(array(
+   * 'type' => 'callback',
+   * 'callback' => $callback,
+   * 'arguments' => $arguments,
+   * ));
+   * }
+   */
 }
index 0ae0eca5f6123c348774f4799423d50fe17fe821..83aeaa1584fbf89e61f592cce8b1c8ed55f4369c 100644 (file)
@@ -59,10 +59,10 @@ class CRM_Core_Report_Excel {
 
     $result = '';
 
-    $config        = CRM_Core_Config::singleton();
-    $seperator     = $config->fieldSeparator;
-    $enclosed      = '"';
-    $escaped       = $enclosed;
+    $config = CRM_Core_Config::singleton();
+    $seperator = $config->fieldSeparator;
+    $enclosed = '"';
+    $escaped = $enclosed;
     $add_character = "\015\012";
 
     $schema_insert = '';
index 10e4f404606f25e2d44a84a74e4c4289d6b85258..7c361855c05c663e5b0465536fd74774009921ed 100644 (file)
@@ -160,7 +160,7 @@ class CRM_Core_Resources {
    *   relative weight within a given region.
    * @param string $region
    *   location within the file; 'html-header', 'page-header', 'page-footer'.
-   * @param $translate, whether to parse this file for strings enclosed in ts()
+   * @param $translate , whether to parse this file for strings enclosed in ts()
    *
    * @return CRM_Core_Resources
    */
@@ -258,9 +258,9 @@ class CRM_Core_Resources {
       $region = self::isAjaxMode() ? 'ajax-snippet' : 'html-header';
       $resources = $this;
       CRM_Core_Region::instance($region)->add(array(
-      'callback' => function(&$snippet, &$html) use ($resources) {
-        $html .= "\n" . $resources->renderSetting();
-      },
+        'callback' => function (&$snippet, &$html) use ($resources) {
+          $html .= "\n" . $resources->renderSetting();
+        },
         'weight' => -100000,
       ));
       $this->addedSettings = TRUE;
@@ -530,10 +530,11 @@ class CRM_Core_Resources {
 
       // Add global settings
       $settings = array(
-      'config' => array(
-        'ajaxPopupsEnabled' => $this->ajaxPopupsEnabled,
-        'isFrontend' => $config->userFrameworkFrontend,
-      ));
+        'config' => array(
+          'ajaxPopupsEnabled' => $this->ajaxPopupsEnabled,
+          'isFrontend' => $config->userFrameworkFrontend,
+        )
+      );
       // Disable profile creation if user lacks permission
       if (!CRM_Core_Permission::check('edit all contacts') && !CRM_Core_Permission::check('add contacts')) {
         $settings['config']['entityRef']['contactCreate'] = FALSE;
@@ -650,30 +651,19 @@ class CRM_Core_Resources {
       "packages/jquery/jquery-1.11.1$min.js",
       "packages/jquery/jquery-ui/jquery-ui$min.js",
       "packages/jquery/jquery-ui/jquery-ui$min.css",
-
       "packages/backbone/lodash.compat$min.js",
-
       "packages/jquery/plugins/jquery.mousewheel$min.js",
-
       "packages/jquery/plugins/select2/select2$min.js",
       "packages/jquery/plugins/select2/select2.css",
-
       "packages/jquery/plugins/jquery.tableHeader.js",
-
       "packages/jquery/plugins/jquery.textarearesizer.js",
-
       "packages/jquery/plugins/jquery.form$min.js",
-
       "packages/jquery/plugins/jquery.timeentry$min.js",
-
       "packages/jquery/plugins/jquery.blockUI$min.js",
-
       "packages/jquery/plugins/DataTables/media/js/jquery.dataTables$min.js",
       "packages/jquery/plugins/DataTables/media/css/jquery.dataTables$min.css",
-
       "packages/jquery/plugins/jquery.validate$min.js",
       "packages/jquery/plugins/jquery.ui.datepicker.validation.pack.js",
-
       "js/Common.js",
       "js/crm.ajax.js",
     );
@@ -722,7 +712,11 @@ class CRM_Core_Resources {
    *   is this page request an ajax snippet?
    */
   public static function isAjaxMode() {
-    return in_array(CRM_Utils_Array::value('snippet', $_REQUEST), array(CRM_Core_Smarty::PRINT_SNIPPET, CRM_Core_Smarty::PRINT_NOFORM, CRM_Core_Smarty::PRINT_JSON));
+    return in_array(CRM_Utils_Array::value('snippet', $_REQUEST), array(
+        CRM_Core_Smarty::PRINT_SNIPPET,
+        CRM_Core_Smarty::PRINT_NOFORM,
+        CRM_Core_Smarty::PRINT_JSON
+      ));
   }
 
   /**
@@ -737,14 +731,15 @@ class CRM_Core_Resources {
     $filters['event'] = array(
       array('key' => 'event_type_id', 'value' => ts('Event Type')),
       array(
-    'key' => 'start_date',
-    'value' => ts('Start Date'),
-    'options' => array(
-        array('key' => '{">":"now"}', 'value' => ts('Upcoming')),
-        array('key' => '{"BETWEEN":["now - 3 month","now"]}', 'value' => ts('Past 3 Months')),
-        array('key' => '{"BETWEEN":["now - 6 month","now"]}', 'value' => ts('Past 6 Months')),
-        array('key' => '{"BETWEEN":["now - 1 year","now"]}', 'value' => ts('Past Year')),
-      )),
+        'key' => 'start_date',
+        'value' => ts('Start Date'),
+        'options' => array(
+          array('key' => '{">":"now"}', 'value' => ts('Upcoming')),
+          array('key' => '{"BETWEEN":["now - 3 month","now"]}', 'value' => ts('Past 3 Months')),
+          array('key' => '{"BETWEEN":["now - 6 month","now"]}', 'value' => ts('Past 6 Months')),
+          array('key' => '{"BETWEEN":["now - 1 year","now"]}', 'value' => ts('Past Year')),
+        )
+      ),
     );
 
     $filters['activity'] = array(
index fc96115de5b11e396099b20b2ec5f342a66e42f3..effe8582290c06c69c3df4c5c382b08e0aad6c5d 100644 (file)
@@ -80,8 +80,8 @@ class CRM_Core_ScheduledJob {
    * @param null $date
    */
   public function saveLastRun($date = NULL) {
-    $dao           = new CRM_Core_DAO_Job();
-    $dao->id       = $this->id;
+    $dao = new CRM_Core_DAO_Job();
+    $dao->id = $this->id;
     $dao->last_run = ($date == NULL) ? CRM_Utils_Date::currentDBDate() : CRM_Utils_Date::currentDBDate($date);
     $dao->save();
   }
@@ -101,7 +101,7 @@ class CRM_Core_ScheduledJob {
         return TRUE;
 
       case 'Hourly':
-        $now     = CRM_Utils_Date::currentDBDate();
+        $now = CRM_Utils_Date::currentDBDate();
         $hourAgo = strtotime('-1 hour', strtotime($now));
         $lastRun = strtotime($this->last_run);
         if ($lastRun < $hourAgo) {
@@ -109,8 +109,8 @@ class CRM_Core_ScheduledJob {
         }
 
       case 'Daily':
-        $now     = CRM_Utils_Date::currentDBDate();
-        $dayAgo  = strtotime('-1 day', strtotime($now));
+        $now = CRM_Utils_Date::currentDBDate();
+        $dayAgo = strtotime('-1 day', strtotime($now));
         $lastRun = strtotime($this->last_run);
         if ($lastRun < $dayAgo) {
           return TRUE;
index 4839aa84648d34d86f622bd6d975f2b55af2da49..5a31958955d7d79d8ac90bba503a8d3d13b82f54 100644 (file)
@@ -357,7 +357,7 @@ class CRM_Core_SelectValues {
    */
   public static function mailingComponents() {
     return array(
-    'Header' => ts('Header'),
+      'Header' => ts('Header'),
       'Footer' => ts('Footer'),
       'Reply' => ts('Reply Auto-responder'),
       'OptOut' => ts('Opt-out Message'),
@@ -571,7 +571,7 @@ class CRM_Core_SelectValues {
     static $tokens = NULL;
     if (!$tokens) {
       $additionalFields = array(
-      'checksum' => array('title' => ts('Checksum')),
+        'checksum' => array('title' => ts('Checksum')),
         'contact_id' => array('title' => ts('Internal Contact ID')),
       );
       $exportFields = array_merge(CRM_Contact_BAO_Contact::exportableFields(), $additionalFields);
@@ -581,8 +581,16 @@ class CRM_Core_SelectValues {
 
       //FIXME:skipping some tokens for time being.
       $skipTokens = array(
-        'is_bulkmail', 'group', 'tag', 'contact_sub_type', 'note',
-        'is_deceased', 'deceased_date', 'legal_identifier', 'contact_sub_type', 'user_unique_id',
+        'is_bulkmail',
+        'group',
+        'tag',
+        'contact_sub_type',
+        'note',
+        'is_deceased',
+        'deceased_date',
+        'legal_identifier',
+        'contact_sub_type',
+        'user_unique_id',
       );
 
       $customFields = CRM_Core_BAO_CustomField::getFields(array('Individual', 'Address'));
@@ -645,8 +653,14 @@ class CRM_Core_SelectValues {
 
       // skipping some tokens for time being.
       $skipTokens = array(
-        'event_id', 'participant_is_pay_later', 'participant_is_test', 'participant_contact_id',
-        'participant_fee_currency', 'participant_campaign_id', 'participant_status', 'participant_discount_name',
+        'event_id',
+        'participant_is_pay_later',
+        'participant_is_test',
+        'participant_contact_id',
+        'participant_fee_currency',
+        'participant_campaign_id',
+        'participant_status',
+        'participant_discount_name',
       );
 
       $customFields = CRM_Core_BAO_CustomField::getFields('Participant');
@@ -879,9 +893,9 @@ class CRM_Core_SelectValues {
    */
   public static function getWordReplacementMatchType() {
     return array(
-        'exactMatch' => ts('Exact Match'),
-        'wildcardMatch' => ts('Wildcard Match'),
-      );
+      'exactMatch' => ts('Exact Match'),
+      'wildcardMatch' => ts('Wildcard Match'),
+    );
   }
 
   /**
@@ -924,7 +938,8 @@ class CRM_Core_SelectValues {
     static $scheduleReminderFrequencyUnits = NULL;
     if (!$scheduleReminderFrequencyUnits) {
       $scheduleReminderFrequencyUnits = array(
-          'hour' => ts('hour')) + CRM_Core_OptionGroup::values('recur_frequency_units');
+          'hour' => ts('hour')
+        ) + CRM_Core_OptionGroup::values('recur_frequency_units');
     }
 
     return $scheduleReminderFrequencyUnits;
index 534cef9eb49c1a613cc031ba4359c588ef37e8de..457d4cac3100ab4843ba01e2407bdaf292034b9e 100644 (file)
@@ -48,7 +48,7 @@ class CRM_Core_Selector_Controller {
    */
   // move the values from the session to the template
   const SESSION = 1, TEMPLATE = 2,
-  TRANSFER = 4, EXPORT = 8, SCREEN = 16, PDF = 32;
+    TRANSFER = 4, EXPORT = 8, SCREEN = 16, PDF = 32;
 
   /**
    * A CRM Object that implements CRM_Core_Selector_API
@@ -201,10 +201,10 @@ class CRM_Core_Selector_Controller {
     $this->_pageID = $pageID ? $pageID : 1;
     $this->_sortID = $sortID ? $sortID : NULL;
     $this->_action = $action;
-    $this->_store  = $store;
+    $this->_store = $store;
     $this->_output = $output;
     $this->_prefix = $prefix;
-    $this->_case   = $case;
+    $this->_case = $case;
 
     // fix sortID
     if ($this->_sortID && strpos($this->_sortID, '_') === FALSE) {
@@ -342,8 +342,8 @@ class CRM_Core_Selector_Controller {
       $rows = self::getRows($this);
       CRM_Utils_Hook::searchColumns($contextName, $columnHeaders, $rows, $this);
       $rowsEmpty = count($rows) ? FALSE : TRUE;
-      $qill      = $this->getQill();
-      $summary   = $this->getSummary();
+      $qill = $this->getQill();
+      $summary = $this->getSummary();
       // if we need to store in session, lets update session
       if ($this->_output & self::SESSION) {
         $this->_store->set("{$this->_prefix}columnHeaders", $columnHeaders);
index 0c9133346f0eb6db3d26580141291e5c4b40252d..458fe56cdff7d14df684faf54729b7855f7a851e 100644 (file)
@@ -125,7 +125,7 @@ class CRM_Core_Session {
         // FIXME: This belongs in CRM_Utils_System_*
         if ($config->userSystem->is_drupal && function_exists('drupal_session_start')) {
           // https://issues.civicrm.org/jira/browse/CRM-14356
-          if (! (isset($GLOBALS['lazy_session']) && $GLOBALS['lazy_session'] == TRUE)) {
+          if (!(isset($GLOBALS['lazy_session']) && $GLOBALS['lazy_session'] == TRUE)) {
             drupal_session_start();
           }
           $_SESSION = array();
index 887ea1b8e36528c5e3a7d9b74c7008de88ab53bf..161732998788ff4680aa380291bcd37cc0293d7c 100644 (file)
@@ -196,7 +196,7 @@ class CRM_Core_ShowHideBlocks {
     $hideCode = "cj('#id_{$prefix}').hide(); cj('#id_{$prefix}_show').show(); return false;";
 
     self::setIcons();
-    $values         = array();
+    $values = array();
     $values['show'] = self::linkHtml("${prefix}_show", "#${prefix}_hide", self::$_showIcon . $showLinkText, "onclick=\"$showCode\"");
     $values['hide'] = self::linkHtml("${prefix}_hide", "#${prefix}", self::$_hideIcon . $hideLinkText, "onclick=\"$hideCode\"");
 
index 5ff43aca84e96264efc3326526114f45d8d2d52d..928036aadf3ea5de09bf4ca333904e2e3b94e6bd 100644 (file)
@@ -120,10 +120,10 @@ class CRM_Core_Smarty extends Smarty {
     if (isset($config->customPHPPathDir)) {
       $customPluginsDir =
         $config->customPHPPathDir . DIRECTORY_SEPARATOR .
-        'CRM'                     . DIRECTORY_SEPARATOR .
-        'Core'                    . DIRECTORY_SEPARATOR .
-        'Smarty'                  . DIRECTORY_SEPARATOR .
-        'plugins'                 . DIRECTORY_SEPARATOR;
+        'CRM' . DIRECTORY_SEPARATOR .
+        'Core' . DIRECTORY_SEPARATOR .
+        'Smarty' . DIRECTORY_SEPARATOR .
+        'plugins' . DIRECTORY_SEPARATOR;
       if (!file_exists($customPluginsDir)) {
         $customPluginsDir = NULL;
       }
index a39a478a0dd58ba7e2efba56c4d6af31a70a88e3..851e724b9425901df2e8a46b211301afc76f74e1 100644 (file)
@@ -49,7 +49,7 @@
  *   The Smarty object.
  *
  * @return string
  *   the string, translated by gettext
+ *   the string, translated by gettext
  */
 function smarty_block_edit($params, $text, &$smarty) {
   $action = $smarty->_tpl_vars['action'];
index a87f7e85b9c1a30d8b22bf7a1004c7b65a27b974..d228479aee90972dea40e80e8472d56b39cc8bc2 100644 (file)
@@ -45,7 +45,7 @@
  *   The Smarty object.
  *
  * @return string
  *   the string, translated by gettext
+ *   the string, translated by gettext
  */
 function smarty_block_htxt($params, $text, &$smarty) {
   $id = $params['id'];
index 198df317c7824ae73db4c3814d2afa5c4edcd94e..8e0bed30bc9062769a48e1390827a49c1b7b8ea5 100644 (file)
@@ -46,7 +46,7 @@
  *   The Smarty object.
  *
  * @return string
  *   multilingualized query
+ *   multilingualized query
  */
 function smarty_block_localize($params, $text, &$smarty) {
   if (!$smarty->_tpl_vars['multilingual']) {
index 64a1ad80aa759bb09025dd3afe69c38d4614867e..1092629b189fb9960e992de06f2ab21ed0da85f2 100644 (file)
@@ -47,7 +47,7 @@
  *   The Smarty object.
  *
  * @return string
  *   the string, translated by gettext
+ *   the string, translated by gettext
  */
 function smarty_block_serialize($params, $text, &$smarty) {
   return serialize($text);
index 14c535e9f8c13e9a5214ebfc32bc53a5aef12ace..092363eda2e6376bb95868b8fc755afe103adf82 100644 (file)
@@ -48,7 +48,7 @@
  *   The Smarty object.
  *
  * @return string
  *   the string, translated by gettext
+ *   the string, translated by gettext
  */
 function smarty_block_ts($params, $text, &$smarty) {
   if (!isset($params['domain'])) {
index ea8f01754e235dfdc4b6f8989e5c0554d404b6c3..47d2e40a56b26e94e7b62881af475d82219ddd69 100644 (file)
@@ -42,7 +42,7 @@
  *   The Smarty object.
  *
  * @return string
  *   the generated key
+ *   the generated key
  */
 function smarty_function_crmKey($params, &$smarty) {
   return
index 252cdf08c694a858a949ea245080144fdabff115..b5bfba1315bd8666c2ec1f1f5065c4a4569beb10 100644 (file)
@@ -42,7 +42,7 @@
  *   The Smarty object.
  *
  * @return string
  *   HTML
+ *   HTML
  */
 function smarty_function_crmNavigationMenu($params, &$smarty) {
   $config = CRM_Core_Config::singleton();
index 17a0e6057a2b929697332a89dd39d3e42a521993..84d9bbc0509366f244b776cdd8f972477ddafc9a 100644 (file)
@@ -43,7 +43,7 @@
  *   Reference to the smarty object.
  *
  * @return string
  *   HTML code of a link to documentation
+ *   HTML code of a link to documentation
  */
 function smarty_function_docURL($params, &$smarty) {
   if (!isset($smarty)) {
index bf93bddf162fca33d97d7f6a253de0b2f86d4297..fce651c2369c4657131db5f936a1320bb7dbf756 100644 (file)
@@ -42,7 +42,7 @@
  *   Reference to the smarty object.
  *
  * @return string
  *   the help html to be inserted
+ *   the help html to be inserted
  */
 function smarty_function_help($params, &$smarty) {
   if (!isset($params['id']) || !isset($smarty->_tpl_vars['config'])) {
index 11cf42ac95c5b9c21863c034bd17c355b249779b..9d1e03fdc32a7e2ef91dd5eacc60484586466bfb 100644 (file)
@@ -49,7 +49,7 @@
  *   The Smarty object.
  *
  * @return string
  *   the string, translated by gettext
+ *   the string, translated by gettext
  */
 function smarty_function_sectionTotal($params, &$smarty) {
   /* section totals are stored in template variable 'sectionTotals',
index 22c64acc41354693824ecee24366bfd84f148ec8..59459c5e4a023e8aeb0e044c5858af51e005de25 100644 (file)
@@ -39,11 +39,11 @@ function smarty_function_simpleActivityContacts($params, &$smarty) {
   require_once 'api/api.php';
   require_once 'api/v3/utils.php';
   $activity = civicrm_api('activity', 'getsingle', array(
-      'version' => 3,
-      'id' => $params['activity_id'],
-      'return.target_contact_id' => 1,
-      'return.assignee_contact_id' => 1,
-    ));
+    'version' => 3,
+    'id' => $params['activity_id'],
+    'return.target_contact_id' => 1,
+    'return.assignee_contact_id' => 1,
+  ));
 
   $baseContactParams = array('version' => 3);
   foreach (explode(',', $params['return']) as $field) {
@@ -51,7 +51,9 @@ function smarty_function_simpleActivityContacts($params, &$smarty) {
   }
 
   foreach (array(
-    'target', 'assignee') as $role) {
+             'target',
+             'assignee'
+           ) as $role) {
     $contact = array();
     if (!empty($activity[$role . '_contact_id'])) {
       $contact_id = array_shift($activity[$role . '_contact_id']);
index eab0a5df6a8b17a58da1bd88eba3fdf63d67e171..ebecda445277b5443a14b97660d0853cff91d370 100644 (file)
@@ -42,7 +42,7 @@
  *   The new class or classes to add (separate with a space).
  *
  * @return string
  *   the new modified html string
+ *   the new modified html string
  */
 function smarty_modifier_crmAddClass($string, $class) {
   // Standardize white space
index 5021647e41fc466150abd333fa1a8e8d1692f2f5..6cb0b34198308455ec765440064e47e3861fe062 100644 (file)
@@ -39,7 +39,7 @@
  * @param string $btnName
  *
  * @return string
  *   button type, one of: 'upload', 'next', 'back', 'cancel', 'refresh'
+ *   button type, one of: 'upload', 'next', 'back', 'cancel', 'refresh'
  *                                      'submit', 'done', 'display', 'jump' 'process'
  */
 function smarty_modifier_crmBtnType($btnName) {
index ff045b67a62dfd8950f0668ec89453b27f828240..68476745872a1a0a7ebb51255fc11f42d7710592 100644 (file)
@@ -43,7 +43,7 @@
  * @param bool $onlyTime
  *
  * @return string
  *   human readable date format | invalid date message
+ *   human readable date format | invalid date message
  */
 function smarty_modifier_crmDate($dateString, $dateFormat = NULL, $onlyTime = FALSE) {
   if ($dateString) {
index e4b5f10f1b7fc0b395edddd209c5958f4ebff22a..57dc27cc18332d4ca86b38fcfb078377526945dc 100644 (file)
@@ -45,7 +45,7 @@
  *   The attribute to modify.
  *
  * @return string
  *   the new modified html string
+ *   the new modified html string
  */
 function smarty_modifier_crmDelete($string, $attribute) {
   static $endOfElement = '/>';
index fb4c8b2f2f4dc994a0fab86e5712fd6916554182..0751831c95e5e9c1ab9756968a3ab5a8cda23851 100644 (file)
@@ -41,7 +41,7 @@
  * @param bool $gdata
  *
  * @return string
  *   formatted text
+ *   formatted text
  */
 function smarty_modifier_crmICalDate($str, $gdata = FALSE) {
   return CRM_Utils_ICalendar::formatDate($str, $gdata);
index e629e019536e49b50f6bc2012ae6e19b2be6482a..5e3828dd9655e2da47515d931a64f3a6c59cc9fb 100644 (file)
@@ -39,7 +39,7 @@
  * @param string $str
  *
  * @return string
  *   formatted text
+ *   formatted text
  */
 function smarty_modifier_crmICalText($str) {
   return CRM_Utils_ICalendar::formatText($str);
index 8c8ad733909d4ea833e6a0ee9f9f7668dd67d4b2..9eb279573e827083b923c04a86be0180f918d62b 100644 (file)
@@ -49,7 +49,7 @@
  *   The string before which we want this tag inserted.
  *
  * @return string
  *   the new modified html string
+ *   the new modified html string
  */
 function smarty_modifier_crmInsert($string, $attribute, $value, $insertBefore = '/>') {
   return str_replace($insertBefore, ' ' . $attribute . '="' . $value . '"' . $insertBefore, $string);
index 227ad3f77e7c68bea3955eb31d2ce06975d4effe..9de1095e5842fdb87cc2217bf50862d145730cc5 100644 (file)
@@ -45,7 +45,7 @@
  * @param bool $onlyNumber
  *
  * @return string
  *   formatted monetary amount
+ *   formatted monetary amount
  */
 function smarty_modifier_crmMoney($amount, $currency = NULL, $format = NULL, $onlyNumber = FALSE) {
   return CRM_Utils_Money::format($amount, $currency, $format, $onlyNumber);
index fa810c250d42de6ac95377175ef5bfcffc8fc3f2..0c847f9139a787c73893f8b7c7f55a224c7960ef 100644 (file)
@@ -47,7 +47,7 @@
  *   Thousands sep character (if other than ",").
  *
  * @return string
  *   the formatted string
+ *   the formatted string
  *
  * For alternate decimal point and thousands separator, delimit values with single quotes in the template.
  * EXAMPLE:   {$number|crmNumberFormat:2:',':' '} for French notation - 1234.56 becomes 1 234,56
@@ -57,8 +57,8 @@ function smarty_modifier_crmNumberFormat($number, $decimals = NULL, $dec_point =
     // Both dec_point AND thousands_sep are required if one is not specified
     // then use the config defaults
     if (!$dec_point || !$thousands_sep) {
-      $config        = CRM_Core_Config::singleton();
-      $dec_point     = $config->monetaryDecimalPoint;
+      $config = CRM_Core_Config::singleton();
+      $dec_point = $config->monetaryDecimalPoint;
       $thousands_sep = $config->monetaryThousandSeparator;
     }
 
index cd572a89b110393bd8f0b6766fae86c67fe11926..330299ce98815e1b8372b3690020a28ebdcfb336 100644 (file)
@@ -47,7 +47,7 @@
  *   The new attribute value.
  *
  * @return string
  *   the new modified html string
+ *   the new modified html string
  */
 function smarty_modifier_crmReplace($string, $attribute, $value) {
   // we need to search and replace the string: $attribute=XXX or $attribute="XXX"
index 76da47c45c68d7184b1f5b8f1704b070bc69fc74..5cfe8df3f8b0ba64b92c7462f72f75282cf22fff 100644 (file)
@@ -41,7 +41,7 @@
  *   All alternatives as a long string (or some other text).
  *
  * @return string
  *   only the first alternative found (or the text without alternatives)
+ *   only the first alternative found (or the text without alternatives)
  */
 function smarty_modifier_crmStripAlternatives($full) {
   return CRM_Utils_String::stripAlternatives($full);
index 5b2ae4b2bc0712cef02bb1630bdd4317715a7d17..6f6ae44eb802031c1de81c1d47573a5b7daee54b 100644 (file)
@@ -40,7 +40,7 @@
  *   Text to HTML-ize.
  *
  * @return string
  *   HTML-ized version of $text
+ *   HTML-ized version of $text
  */
 function smarty_modifier_htmlize($text) {
   $text = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([-\w/_\.]*(\?\S+)?)?)?)@', '<a href="$1">$1</a>', $text);
index 9e03697dc882684d82d0fff9de8f101df0f5f4ad..7530d778248d296ecc0a69f4d484d509974fde25 100644 (file)
@@ -41,7 +41,7 @@
  * @param mixed $data
  *
  * @return string
  *   JSON
+ *   JSON
  */
 function smarty_modifier_json($data) {
   return json_encode($data);
index 8d8e3e56c2605b4a72ed555d48fc2487d3681c2f..997da1c479020f5f8805e487ee9d35a5d4518e3d 100644 (file)
@@ -58,7 +58,7 @@
  * @return string
  */
 function smarty_modifier_mb_truncate($string, $length = 80, $etc = '...',
-  $break_words = FALSE
+                                     $break_words = FALSE
 ) {
   if (function_exists('mb_internal_encoding') and function_exists('mb_strlen') and function_exists('mb_substr')) {
     mb_internal_encoding('UTF-8');
index 2415b84ce8dd9aecbe31c1713139325200749dfc..e7b6501e7b91a5dcc91f3b4df7f11d801f4d7466 100644 (file)
@@ -8,5 +8,5 @@ function smarty_prefilter_resetExtScope($tpl_source, &$smarty) {
   return
     '{crmScope extensionKey=""}'
     . $tpl_source
-     . '{/crmScope}';
+    . '{/crmScope}';
 }
index c5a8d72658009ce93fa8af340ed96b7303dacfda..dc07c3890841ea9b2517d0dc02c664354cfdbec0 100644 (file)
@@ -58,7 +58,7 @@ class CRM_Core_TableHierarchy {
     'civicrm_entity_tag' => '22',
     'civicrm_note' => '23',
     'civicrm_contribution' => '24',
-    'civicrm_financial_type'    => '25',
+    'civicrm_financial_type' => '25',
     'civicrm_participant' => '26',
     'civicrm_event' => '27',
     'civicrm_worldregion' => '28',
index d6f45443742edf51e8ec79b8d483e4631eb3146f..06d26d3da630ff691563591e90a4bf8f11988728 100644 (file)
@@ -85,8 +85,8 @@ class CRM_Custom_Form_ChangeFieldType extends CRM_Core_Form {
     $session->pushUserContext($url);
 
     CRM_Utils_System::setTitle(ts('Change Field Type: %1',
-        array(1 => $this->_values['label'])
-      ));
+      array(1 => $this->_values['label'])
+    ));
   }
 
   /**
@@ -112,7 +112,8 @@ class CRM_Custom_Form_ChangeFieldType extends CRM_Core_Form {
       'dst_html_type',
       ts('New HTML Type'),
       array(
-        '' => ts('- select -')) + $this->_htmlTypeTransitions,
+        '' => ts('- select -')
+      ) + $this->_htmlTypeTransitions,
       TRUE
     );
 
@@ -165,7 +166,11 @@ class CRM_Custom_Form_ChangeFieldType extends CRM_Core_Form {
     $customField->find(TRUE);
 
     if ($dstHtmlType == 'Text' && in_array($srcHtmlType, array(
-      'Select', 'Radio', 'Autocomplete-Select'))) {
+        'Select',
+        'Radio',
+        'Autocomplete-Select'
+      ))
+    ) {
       $customField->option_group_id = "NULL";
       CRM_Core_BAO_CustomField::checkOptionGroup($this->_values['option_group_id']);
     }
@@ -188,8 +193,8 @@ class CRM_Custom_Form_ChangeFieldType extends CRM_Core_Form {
     CRM_Core_BAO_Cache::deleteGroup('contact fields');
 
     CRM_Core_Session::setStatus(ts('Input type of custom field \'%1\' has been successfully changed to \'%2\'.',
-        array(1 => $this->_values['label'], 2 => $dstHtmlType)
-      ), ts('Field Type Changed'), 'success');
+      array(1 => $this->_values['label'], 2 => $dstHtmlType)
+    ), ts('Field Type Changed'), 'success');
   }
 
   /**
@@ -266,14 +271,14 @@ class CRM_Custom_Form_ChangeFieldType extends CRM_Core_Form {
   public function firstValueToFlatten($table, $column) {
     $selectSql = "SELECT id, $column FROM $table WHERE $column IS NOT NULL";
     $updateSql = "UPDATE $table SET $column = %1 WHERE id = %2";
-    $dao       = CRM_Core_DAO::executeQuery($selectSql);
+    $dao = CRM_Core_DAO::executeQuery($selectSql);
     while ($dao->fetch()) {
       if (!$dao->{$column}) {
         continue;
       }
       $value = CRM_Core_DAO::VALUE_SEPARATOR . $dao->{$column} . CRM_Core_DAO::VALUE_SEPARATOR;
       $params = array(
-      1 => array((string) $value, 'String'),
+        1 => array((string) $value, 'String'),
         2 => array($dao->id, 'Integer'),
       );
       CRM_Core_DAO::executeQuery($updateSql, $params);
@@ -287,11 +292,11 @@ class CRM_Custom_Form_ChangeFieldType extends CRM_Core_Form {
   public function flattenToFirstValue($table, $column) {
     $selectSql = "SELECT id, $column FROM $table WHERE $column IS NOT NULL";
     $updateSql = "UPDATE $table SET $column = %1 WHERE id = %2";
-    $dao       = CRM_Core_DAO::executeQuery($selectSql);
+    $dao = CRM_Core_DAO::executeQuery($selectSql);
     while ($dao->fetch()) {
       $values = self::explode($dao->{$column});
       $params = array(
-      1 => array((string) array_shift($values), 'String'),
+        1 => array((string) array_shift($values), 'String'),
         2 => array($dao->id, 'Integer'),
       );
       CRM_Core_DAO::executeQuery($updateSql, $params);
index de9ea04349eacf1f99a5893dc7a2845208900fb9..922246b88afeff12cc2a233ed4c439a3589ac059 100644 (file)
@@ -133,27 +133,27 @@ class CRM_Custom_Form_Field extends CRM_Core_Form {
     if (self::$_dataToLabels == NULL) {
       self::$_dataToLabels = array(
         array(
-      'Text' => ts('Text'),
-      'Select' => ts('Select'),
+          'Text' => ts('Text'),
+          'Select' => ts('Select'),
           'Radio' => ts('Radio'),
-      'CheckBox' => ts('CheckBox'),
-      'Multi-Select' => ts('Multi-Select'),
+          'CheckBox' => ts('CheckBox'),
+          'Multi-Select' => ts('Multi-Select'),
           'AdvMulti-Select' => ts('Adv Multi-Select (obsolete)'),
           'Autocomplete-Select' => ts('Autocomplete-Select'),
         ),
         array(
-      'Text' => ts('Text'),
-      'Select' => ts('Select'),
+          'Text' => ts('Text'),
+          'Select' => ts('Select'),
           'Radio' => ts('Radio'),
         ),
         array(
-      'Text' => ts('Text'),
-      'Select' => ts('Select'),
+          'Text' => ts('Text'),
+          'Select' => ts('Select'),
           'Radio' => ts('Radio'),
         ),
         array(
-      'Text' => ts('Text'),
-      'Select' => ts('Select'),
+          'Text' => ts('Text'),
+          'Select' => ts('Select'),
           'Radio' => ts('Radio'),
         ),
         array('TextArea' => ts('TextArea'), 'RichTextEditor' => ts('Rich Text Editor')),
@@ -268,7 +268,8 @@ class CRM_Custom_Form_Field extends CRM_Core_Form {
       $this->assign('dontShowLink', $dontShowLink);
     }
     if ($this->_action & CRM_Core_Action::ADD &&
-      CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $this->_gid, 'is_multiple', 'id')) {
+      CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $this->_gid, 'is_multiple', 'id')
+    ) {
       $defaults['in_selector'] = 1;
     }
 
@@ -334,7 +335,7 @@ class CRM_Custom_Form_Field extends CRM_Core_Form {
     }
     else {
       $optionTypes = array(
-      '1' => ts('Create a new set of options'),
+        '1' => ts('Create a new set of options'),
         '2' => ts('Reuse an existing set'),
       );
 
@@ -342,7 +343,8 @@ class CRM_Custom_Form_Field extends CRM_Core_Form {
         'option_group_id',
         ts('Multiple Choice Option Sets'),
         array(
-          '' => ts('- select -')) + $optionGroups
+          '' => ts('- select -')
+        ) + $optionGroups
       );
     }
 
@@ -350,7 +352,8 @@ class CRM_Custom_Form_Field extends CRM_Core_Form {
       ts('Option Type'),
       $optionTypes,
       array(
-        'onclick' => "showOptionSelect();"), '<br/>'
+        'onclick' => "showOptionSelect();"
+      ), '<br/>'
     );
 
     $contactGroups = CRM_Core_PseudoConstant::group();
@@ -523,7 +526,7 @@ class CRM_Custom_Form_Field extends CRM_Core_Form {
     );
 
     // is searchable by range?
-    $searchRange   = array();
+    $searchRange = array();
     $searchRange[] = $this->createElement('radio', NULL, NULL, ts('Yes'), '1');
     $searchRange[] = $this->createElement('radio', NULL, NULL, ts('No'), '0');
 
@@ -583,16 +586,16 @@ class CRM_Custom_Form_Field extends CRM_Core_Form {
     $errors = array();
 
     //validate field label as well as name.
-    $title  = $fields['label'];
-    $name   = CRM_Utils_String::munge($title, '_', 64);
-    $gId    = $self->_gid;  // CRM-7564
-    $query  = 'select count(*) from civicrm_custom_field where ( name like %1 OR label like %2 ) and id != %3 and custom_group_id = %4';
+    $title = $fields['label'];
+    $name = CRM_Utils_String::munge($title, '_', 64);
+    $gId = $self->_gid;  // CRM-7564
+    $query = 'select count(*) from civicrm_custom_field where ( name like %1 OR label like %2 ) and id != %3 and custom_group_id = %4';
     $fldCnt = CRM_Core_DAO::singleValueQuery($query, array(
-    1 => array($name, 'String'),
-        2 => array($title, 'String'),
-        3 => array((int) $self->_id, 'Integer'),
-        4 => array($gId, 'Integer'),
-      ));
+      1 => array($name, 'String'),
+      2 => array($title, 'String'),
+      3 => array((int) $self->_id, 'Integer'),
+      4 => array($gId, 'Integer'),
+    ));
     if ($fldCnt) {
       $errors['label'] = ts('Custom field \'%1\' already exists in Database.', array(1 => $title));
     }
@@ -704,8 +707,8 @@ SELECT count(*)
      *  Incomplete row checking is also required.
      */
     $_flagOption = $_rowError = 0;
-    $_showHide   = new CRM_Core_ShowHideBlocks('', '');
-    $dataType    = self::$_dataTypeKeys[$fields['data_type'][0]];
+    $_showHide = new CRM_Core_ShowHideBlocks('', '');
+    $dataType = self::$_dataTypeKeys[$fields['data_type'][0]];
     if (isset($fields['data_type'][1])) {
       $dataField = $fields['data_type'][1];
     }
@@ -835,7 +838,8 @@ FROM   civicrm_custom_field
 WHERE  data_type != %1
 AND    option_group_id = %2";
         $params = array(
-          1 => array(self::$_dataTypeKeys[$fields['data_type'][0]],
+          1 => array(
+            self::$_dataTypeKeys[$fields['data_type'][0]],
             'String',
           ),
           2 => array($fields['option_group_id'], 'Integer'),
@@ -907,19 +911,23 @@ AND    option_group_id = %2";
     // store the submitted values in an array
     $params = $this->controller->exportValues($this->_name);
     if ($this->_action == CRM_Core_Action::UPDATE) {
-      $dataTypeKey         = $this->_defaultDataType[0];
+      $dataTypeKey = $this->_defaultDataType[0];
       $params['data_type'] = self::$_dataTypeKeys[$this->_defaultDataType[0]];
       $params['html_type'] = self::$_dataToHTML[$this->_defaultDataType[0]][$this->_defaultDataType[1]];
     }
     else {
-      $dataTypeKey         = $params['data_type'][0];
+      $dataTypeKey = $params['data_type'][0];
       $params['html_type'] = self::$_dataToHTML[$params['data_type'][0]][$params['data_type'][1]];
       $params['data_type'] = self::$_dataTypeKeys[$params['data_type'][0]];
     }
 
     //fix for 'is_search_range' field.
     if (in_array($dataTypeKey, array(
-      1, 2, 3, 5))) {
+      1,
+      2,
+      3,
+      5
+    ))) {
       if (empty($params['is_searchable'])) {
         $params['is_search_range'] = 0;
       }
@@ -1008,13 +1016,13 @@ SELECT id
     if ($buttonName == $this->getButtonName('next', 'new')) {
       $msg .= '<p>' . ts("Ready to add another.") . '</p>';
       $session->replaceUserContext(CRM_Utils_System::url('civicrm/admin/custom/group/field/add',
-          'reset=1&action=add&gid=' . $this->_gid
-        ));
+        'reset=1&action=add&gid=' . $this->_gid
+      ));
     }
     else {
       $session->replaceUserContext(CRM_Utils_System::url('civicrm/admin/custom/group/field',
-          'reset=1&action=browse&gid=' . $this->_gid
-        ));
+        'reset=1&action=browse&gid=' . $this->_gid
+      ));
     }
     $session->setStatus($msg, ts('Saved'), 'success');
 
index 87d0a94fe5ebed69da1507db45894d8c79443536..26d651981d0e37c29fe975f7217d822f1bfa1b4f 100644 (file)
@@ -121,14 +121,14 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
     $errors = array();
 
     //validate group title as well as name.
-    $title  = $fields['title'];
-    $name   = CRM_Utils_String::munge($title, '_', 64);
-    $query  = 'select count(*) from civicrm_custom_group where ( name like %1 OR title like %2 ) and id != %3';
+    $title = $fields['title'];
+    $name = CRM_Utils_String::munge($title, '_', 64);
+    $query = 'select count(*) from civicrm_custom_group where ( name like %1 OR title like %2 ) and id != %3';
     $grpCnt = CRM_Core_DAO::singleValueQuery($query, array(
-    1 => array($name, 'String'),
-        2 => array($title, 'String'),
-        3 => array((int) $self->_id, 'Integer'),
-      ));
+      1 => array($name, 'String'),
+      2 => array($title, 'String'),
+      3 => array((int) $self->_id, 'Integer'),
+    ));
     if ($grpCnt) {
       $errors['title'] = ts('Custom group \'%1\' already exists in Database.', array(1 => $title));
     }
@@ -202,18 +202,18 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
     $contactTypes = array('Contact', 'Individual', 'Household', 'Organization');
     $this->assign('contactTypes', json_encode($contactTypes));
 
-    $sel1         = array("" => "- select -") + CRM_Core_SelectValues::customGroupExtends();
-    $sel2         = array();
+    $sel1 = array("" => "- select -") + CRM_Core_SelectValues::customGroupExtends();
+    $sel2 = array();
     $activityType = CRM_Core_PseudoConstant::activityType(FALSE, TRUE, FALSE, 'label', TRUE);
 
-    $eventType       = CRM_Core_OptionGroup::values('event_type');
-    $grantType       = CRM_Core_OptionGroup::values('grant_type');
-    $campaignTypes   = CRM_Campaign_PseudoConstant::campaignType();
-    $membershipType  = CRM_Member_BAO_MembershipType::getMembershipTypes(FALSE);
+    $eventType = CRM_Core_OptionGroup::values('event_type');
+    $grantType = CRM_Core_OptionGroup::values('grant_type');
+    $campaignTypes = CRM_Campaign_PseudoConstant::campaignType();
+    $membershipType = CRM_Member_BAO_MembershipType::getMembershipTypes(FALSE);
     $participantRole = CRM_Core_OptionGroup::values('participant_role');
-    $relTypeInd      = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Individual');
-    $relTypeOrg      = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Organization');
-    $relTypeHou      = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Household');
+    $relTypeInd = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Individual');
+    $relTypeOrg = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Organization');
+    $relTypeHou = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Household');
 
     ksort($sel1);
     asort($activityType);
@@ -257,11 +257,13 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
         if ($main == 'Relationship') {
           $relName = self::getFormattedList($sel2[$main]);
           $sel2[$main] = array(
-            '' => ts("- Any -")) + $relName;
+              '' => ts("- Any -")
+            ) + $relName;
         }
         else {
           $sel2[$main] = array(
-            '' => ts("- Any -")) + $sel2[$main];
+              '' => ts("- Any -")
+            ) + $sel2[$main];
         }
       }
     }
@@ -274,7 +276,8 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
         $contactSubTypes[$key] = $key;
       }
       $sel2['Contact'] = array(
-        "" => "-- Any --") + $contactSubTypes;
+          "" => "-- Any --"
+        ) + $contactSubTypes;
     }
     else {
       if (!isset($this->_id)) {
@@ -493,8 +496,8 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
       $action = CRM_Core_Resources::singleton()->ajaxPopupsEnabled ? '' : '/add';
       $url = CRM_Utils_System::url("civicrm/admin/custom/group/field$action", 'reset=1&new=1&gid=' . $group->id . '&action=' . ($action ? 'add' : 'browse'));
       CRM_Core_Session::setStatus(ts("Your custom field set '%1' has been added. You can add custom fields now.",
-          array(1 => $group->title)
-        ), ts('Saved'), 'success');
+        array(1 => $group->title)
+      ), ts('Saved'), 'success');
       $session = CRM_Core_Session::singleton();
       $session->replaceUserContext($url);
     }
@@ -505,7 +508,7 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
     if (is_array($db_prefix) && $config->userSystem->is_drupal && module_exists('views')) {
       // get table_name for each custom group
       $tables = array();
-      $sql    = "SELECT table_name FROM civicrm_custom_group WHERE is_active = 1";
+      $sql = "SELECT table_name FROM civicrm_custom_group WHERE is_active = 1";
       $result = CRM_Core_DAO::executeQuery($sql);
       while ($result->fetch()) {
         $tables[$result->table_name] = $result->table_name;
@@ -516,8 +519,8 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
 
       if (!empty($missingTableNames)) {
         CRM_Core_Session::setStatus(ts("To ensure that all of your custom data groups are available to Views, you may need to add the following key(s) to the db_prefix array in your settings.php file: '%1'.",
-            array(1 => implode(', ', $missingTableNames))
-          ), ts('Note'), 'info');
+          array(1 => implode(', ', $missingTableNames))
+        ), ts('Note'), 'info');
       }
     }
   }
index f3f24ad9436450d0e615b72362685b357d939fc9..fcfb6913fd94da3e40b565e5ee75653da53a4b97 100644 (file)
@@ -95,8 +95,8 @@ class CRM_Custom_Form_MoveField extends CRM_Core_Form {
     );
 
     CRM_Utils_System::setTitle(ts('Custom Field Move: %1',
-        array(1 => $this->_srcFieldLabel)
-      ));
+      array(1 => $this->_srcFieldLabel)
+    ));
 
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/admin/custom/group/field', "reset=1&action=browse&gid={$this->_srcGID}"));
@@ -116,7 +116,8 @@ class CRM_Custom_Form_MoveField extends CRM_Core_Form {
     }
 
     $customGroup = array(
-      '' => ts('- select -')) + $customGroup;
+        '' => ts('- select -')
+      ) + $customGroup;
     $this->add('select',
       'dst_group_id',
       ts('Destination'),
@@ -149,8 +150,8 @@ class CRM_Custom_Form_MoveField extends CRM_Core_Form {
    */
   public static function formRule($fields, $files, $self) {
     $self->_dstGID = $fields['dst_group_id'];
-    $tmp           = CRM_Core_BAO_CustomField::_moveFieldValidate($self->_srcFID, $self->_dstGID);
-    $errors        = array();
+    $tmp = CRM_Core_BAO_CustomField::_moveFieldValidate($self->_srcFID, $self->_dstGID);
+    $errors = array();
     if ($tmp['newGroupID']) {
       $errors['dst_group_id'] = $tmp['newGroupID'];
     }
@@ -172,9 +173,9 @@ class CRM_Custom_Form_MoveField extends CRM_Core_Form {
     $srcUrl = CRM_Utils_System::url('civicrm/admin/custom/group/field', "reset=1&action=browse&gid={$this->_dstGID}");
     CRM_Core_Session::setStatus(ts("%1 has been moved to the custom set <a href='%3'>%2</a>.",
       array(
-      1 => $this->_srcFieldLabel,
-          2 => $dstGroup,
+        1 => $this->_srcFieldLabel,
+        2 => $dstGroup,
         3 => $srcUrl,
-        )), '', 'success');
+      )), '', 'success');
   }
 }
index 3405e1249bb1b7734782dda8f8057bc1a9977fc7..e1da4cc6c2a855988c5cb6fff111f26006e29b3e 100644 (file)
@@ -250,9 +250,9 @@ class CRM_Custom_Form_Option extends CRM_Core_Form {
    * @static
    */
   public static function formRule($fields, $files, $form) {
-    $optionLabel   = $fields['label'];
-    $optionValue   = $fields['value'];
-    $fieldId       = $form->_fid;
+    $optionLabel = $fields['label'];
+    $optionValue = $fields['value'];
+    $fieldId = $form->_fid;
     $optionGroupId = $form->_optionGroupID;
 
     $temp = array();
index 982369092ab252738c2f7da55d05be8729e827a8..d5347b3b4a843690125765c155d354fd56c878af 100644 (file)
@@ -66,7 +66,7 @@ class CRM_Custom_Form_Preview extends CRM_Core_Form {
     if ($this->_fieldId) {
       // field preview
       $defaults = array();
-      $params   = array('id' => $this->_fieldId);
+      $params = array('id' => $this->_fieldId);
       $fieldDAO = new CRM_Core_DAO_CustomField();
       CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomField', $params, $defaults);
 
index a8c0d3662dd5a9750258b91eec83e17a22a3ce6a..64c9c7564f8746e9edc66c4af5b125496cce585a 100644 (file)
@@ -95,7 +95,10 @@ class CRM_Custom_Import_Form_DataSource extends CRM_Core_Form {
     $this->assign('uploadSize', $uploadSize);
     $this->add('File', 'uploadFile', ts('Import Data File'), 'size=30 maxlength=255', TRUE);
     $this->setMaxFileSize($uploadFileSize);
-    $this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(1 => $uploadSize, 2 => $uploadFileSize)), 'maxfilesize', $uploadFileSize);
+    $this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(
+          1 => $uploadSize,
+          2 => $uploadFileSize
+        )), 'maxfilesize', $uploadFileSize);
     $this->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile');
     $this->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File');
 
@@ -103,9 +106,9 @@ class CRM_Custom_Import_Form_DataSource extends CRM_Core_Form {
 
     //get the saved mapping details
     $mappingArray = CRM_Core_BAO_Mapping::getMappings(CRM_Core_OptionGroup::getValue('mapping_type',
-        'Import Multi value custom data',
-        'name'
-      ));
+      'Import Multi value custom data',
+      'name'
+    ));
     $this->assign('savedMapping', $mappingArray);
     $this->add('select', 'savedMapping', ts('Mapping Option'), array('' => ts('- select -')) + $mappingArray);
 
@@ -138,7 +141,7 @@ class CRM_Custom_Import_Form_DataSource extends CRM_Core_Form {
 
     $this->setDefaults(array(
       'contactType' => CRM_Import_Parser::CONTACT_INDIVIDUAL,
-      ));
+    ));
 
     //build date formats
     CRM_Core_Form_Date::buildAllowedDateFormats($this);
@@ -166,11 +169,11 @@ class CRM_Custom_Import_Form_DataSource extends CRM_Core_Form {
   public function postProcess() {
     $this->controller->resetPage('MapField');
 
-    $fileName         = $this->controller->exportValue($this->_name, 'uploadFile');
+    $fileName = $this->controller->exportValue($this->_name, 'uploadFile');
     $skipColumnHeader = $this->controller->exportValue($this->_name, 'skipColumnHeader');
-    $contactType      = $this->controller->exportValue($this->_name, 'contactType');
-    $dateFormats      = $this->controller->exportValue($this->_name, 'dateFormats');
-    $savedMapping     = $this->controller->exportValue($this->_name, 'savedMapping');
+    $contactType = $this->controller->exportValue($this->_name, 'contactType');
+    $dateFormats = $this->controller->exportValue($this->_name, 'dateFormats');
+    $savedMapping = $this->controller->exportValue($this->_name, 'savedMapping');
     $multipleCustomData = $this->controller->exportValue($this->_name, 'multipleCustomData');
 
     $this->set('contactType', $contactType);
index 1958eebde79e5c6dd26b3e4cc3583edd9dc48c78..2634b7dfc3292c9f115f848eabe3fccbca61ace0 100644 (file)
@@ -12,6 +12,7 @@ class CRM_Custom_Import_Form_MapField extends CRM_Contact_Import_Form_MapField {
    * @var string
    */
   protected $_entity;
+
   /**
    * Set variables up before form is built
    *
@@ -31,7 +32,7 @@ class CRM_Custom_Import_Form_MapField extends CRM_Contact_Import_Form_MapField {
     $this->assign('dataValues', $dataValues);
 
     $this->_entity = $this->_multipleCustomData = $this->get('multipleCustomData');
-    $skipColumnHeader   = $this->controller->exportValue('DataSource', 'skipColumnHeader');
+    $skipColumnHeader = $this->controller->exportValue('DataSource', 'skipColumnHeader');
     $this->_onDuplicate = $this->get('onDuplicate');
     if ($skipColumnHeader) {
       //showColNames needs to be true to show "Column Names" column
@@ -142,9 +143,9 @@ class CRM_Custom_Import_Form_MapField extends CRM_Contact_Import_Form_MapField {
     $config = CRM_Core_Config::singleton();
     $separator = $config->fieldSeparator;
 
-    $mapperKeys     = array();
-    $mapper         = array();
-    $mapperKeys     = $this->controller->exportValue($this->_name, 'mapper');
+    $mapperKeys = array();
+    $mapper = array();
+    $mapperKeys = $this->controller->exportValue($this->_name, 'mapper');
     $mapperKeysMain = array();
 
     for ($i = 0; $i < $this->_columnCount; $i++) {
@@ -178,9 +179,9 @@ class CRM_Custom_Import_Form_MapField extends CRM_Contact_Import_Form_MapField {
         $updateMappingFields->column_number = $i;
 
         $explodedValues = explode('_', $mapperKeys[$i][0]);
-        $id             = CRM_Utils_Array::value(0, $explodedValues);
-        $first          = CRM_Utils_Array::value(1, $explodedValues);
-        $second         = CRM_Utils_Array::value(2, $explodedValues);
+        $id = CRM_Utils_Array::value(0, $explodedValues);
+        $first = CRM_Utils_Array::value(1, $explodedValues);
+        $second = CRM_Utils_Array::value(2, $explodedValues);
 
         $updateMappingFields->name = $mapper[$i];
         $updateMappingFields->save();
@@ -205,9 +206,9 @@ class CRM_Custom_Import_Form_MapField extends CRM_Contact_Import_Form_MapField {
         $saveMappingFields->column_number = $i;
 
         $explodedValues = explode('_', $mapperKeys[$i][0]);
-        $id             = CRM_Utils_Array::value(0, $explodedValues);
-        $first          = CRM_Utils_Array::value(1, $explodedValues);
-        $second         = CRM_Utils_Array::value(2, $explodedValues);
+        $id = CRM_Utils_Array::value(0, $explodedValues);
+        $first = CRM_Utils_Array::value(1, $explodedValues);
+        $second = CRM_Utils_Array::value(2, $explodedValues);
 
         $saveMappingFields->name = $mapper[$i];
         $saveMappingFields->save();
index d21fd2a11e33f45a1799ab9dd1cd147c566cde8e..c7911d072a183fc520cdeac843c7848534670dda 100644 (file)
@@ -6,6 +6,7 @@
 class CRM_Custom_Import_Form_Preview extends CRM_Import_Form_Preview {
   public $_parser = 'CRM_Custom_Import_Parser_Api';
   protected $_importParserUrl = '&parser=CRM_Custom_Import_Parser';
+
   /**
    * Set variables up before form is built
    *
@@ -15,12 +16,12 @@ class CRM_Custom_Import_Form_Preview extends CRM_Import_Form_Preview {
     $skipColumnHeader = $this->controller->exportValue('DataSource', 'skipColumnHeader');
 
     //get the data from the session
-    $dataValues       = $this->get('dataValues');
-    $mapper           = $this->get('mapper');
-    $invalidRowCount  = $this->get('invalidRowCount');
+    $dataValues = $this->get('dataValues');
+    $mapper = $this->get('mapper');
+    $invalidRowCount = $this->get('invalidRowCount');
     $conflictRowCount = $this->get('conflictRowCount');
-    $mismatchCount    = $this->get('unMatchCount');
-    $entity    = $this->get('_entity');
+    $mismatchCount = $this->get('unMatchCount');
+    $entity = $this->get('_entity');
 
     //get the mapping name displayed if the mappingId is set
     $mappingId = $this->get('loadMappingId');
@@ -57,9 +58,12 @@ class CRM_Custom_Import_Form_Preview extends CRM_Import_Form_Preview {
 
     $properties = array(
       'mapper',
-      'dataValues', 'columnCount',
-      'totalRowCount', 'validRowCount',
-      'invalidRowCount', 'conflictRowCount',
+      'dataValues',
+      'columnCount',
+      'totalRowCount',
+      'validRowCount',
+      'invalidRowCount',
+      'conflictRowCount',
       'downloadErrorRecordsUrl',
       'downloadConflictRecordsUrl',
       'downloadMismatchRecordsUrl',
@@ -77,12 +81,12 @@ class CRM_Custom_Import_Form_Preview extends CRM_Import_Form_Preview {
    * @return void
    */
   public function postProcess() {
-    $fileName         = $this->controller->exportValue('DataSource', 'uploadFile');
+    $fileName = $this->controller->exportValue('DataSource', 'uploadFile');
     $skipColumnHeader = $this->controller->exportValue('DataSource', 'skipColumnHeader');
-    $invalidRowCount  = $this->get('invalidRowCount');
+    $invalidRowCount = $this->get('invalidRowCount');
     $conflictRowCount = $this->get('conflictRowCount');
-    $onDuplicate      = $this->get('onDuplicate');
-    $entity           = $this->get('_entity');
+    $onDuplicate = $this->get('onDuplicate');
+    $entity = $this->get('_entity');
 
     $config = CRM_Core_Config::singleton();
     $separator = $config->fieldSeparator;
index f378a70445eb2a7f62c4d1154a580fab47a9b904..0be813e09be49e08b089ae9fa1faf2e57b2aa4e8 100644 (file)
@@ -32,8 +32,6 @@
  * $Id$
  *
  */
-
-
 abstract class CRM_Custom_Import_Parser extends CRM_Contact_Import_Parser {
 
   protected $_fileName;
@@ -255,7 +253,8 @@ abstract class CRM_Custom_Import_Parser extends CRM_Contact_Import_Parser {
       }
       if ($this->_invalidRowCount) {
         // removed view url for invlaid contacts
-        $headers = array_merge(array(ts('Line Number'),
+        $headers = array_merge(array(
+            ts('Line Number'),
             ts('Reason'),
           ),
           $customHeaders
@@ -264,7 +263,8 @@ abstract class CRM_Custom_Import_Parser extends CRM_Contact_Import_Parser {
         self::exportCSV($this->_errorFileName, $headers, $this->_errors);
       }
       if ($this->_conflictCount) {
-        $headers = array_merge(array(ts('Line Number'),
+        $headers = array_merge(array(
+            ts('Line Number'),
             ts('Reason'),
           ),
           $customHeaders
@@ -273,7 +273,8 @@ abstract class CRM_Custom_Import_Parser extends CRM_Contact_Import_Parser {
         self::exportCSV($this->_conflictFileName, $headers, $this->_conflicts);
       }
       if ($this->_duplicateCount) {
-        $headers = array_merge(array(ts('Line Number'),
+        $headers = array_merge(array(
+            ts('Line Number'),
             ts('View Activity History URL'),
           ),
           $customHeaders
index 9e2a3fc204bea6548d6ff1853436c1ddf742b969..b5bf3d615d7f15e7ccf8e94e5b0fa8b7640e2f42 100644 (file)
@@ -16,6 +16,7 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser {
    * @var array
    */
   protected $_params = array();
+
   /**
    * Class constructor
    */
@@ -23,10 +24,14 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser {
     parent::__construct();
     $this->_mapperKeys = &$mapperKeys;
   }
+
   public function setFields() {
     $customGroupID = $this->_multipleCustomData;
     $importableFields = $this->getGroupFieldsForImport($customGroupID, $this);
-    $this->_fields = array_merge(array('do_not_import' => array('title' => ts('- do not import -')), 'contact_id' => array('title' => ts('Contact ID'))), $importableFields);
+    $this->_fields = array_merge(array(
+        'do_not_import' => array('title' => ts('- do not import -')),
+        'contact_id' => array('title' => ts('Contact ID'))
+      ), $importableFields);
   }
 
   /**
@@ -85,7 +90,7 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser {
    */
   public function summary(&$values) {
     $erroneousField = NULL;
-    $response      = $this->setActiveFieldValues($values, $erroneousField);
+    $response = $this->setActiveFieldValues($values, $erroneousField);
     $errorRequired = FALSE;
     $missingField = '';
     $this->_params = &$this->getActiveFieldParams();
@@ -168,7 +173,7 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser {
     try {
       civicrm_api3('custom_value', 'create', $this->_params);
     }
-    catch(CiviCRM_API3_Exception $e) {
+    catch (CiviCRM_API3_Exception $e) {
       $error = $e->getMessage();
       array_unshift($values, $error);
       return CRM_Import_Parser::ERROR;
index 2737323aa3c1a4d82915c146d86b33ea0922d0e1..2003d472f05e31f0517574a436b691c6406284dd 100644 (file)
@@ -288,8 +288,8 @@ class CRM_Custom_Page_Group extends CRM_Core_Page {
 
     foreach ($customGroup as $key => $values) {
       $subValue = CRM_Utils_Array::value('extends_entity_column_value', $customGroup[$key]);
-      $subName  = CRM_Utils_Array::value('extends_entity_column_id', $customGroup[$key]);
-      $type     = CRM_Utils_Array::value('extends', $customGroup[$key]);
+      $subName = CRM_Utils_Array::value('extends_entity_column_id', $customGroup[$key]);
+      $type = CRM_Utils_Array::value('extends', $customGroup[$key]);
       if ($subValue) {
         $subValue = explode(CRM_Core_DAO::VALUE_SEPARATOR,
           substr($subValue, 1, -1)
index 3dea06a14622489fb787260bcfa2a42584f34fd5..bbf3a05389fe5e072b175a1932bc4f0c41b45005 100644 (file)
@@ -143,7 +143,7 @@ SELECT id, label
 FROM   civicrm_custom_field
 WHERE  option_group_id = %1";
     $params = array(
-    1 => array($optionGroupID, 'Integer'),
+      1 => array($optionGroupID, 'Integer'),
       2 => array($this->_fid, 'Integer'),
     );
     $dao = CRM_Core_DAO::executeQuery($query, $params);
@@ -170,8 +170,8 @@ ORDER BY weight, label
     $dao = CRM_Core_DAO::executeQuery($query, $params);
 
     $customOption = array();
-    $fields       = array('label', 'value', 'is_active', 'weight');
-    $config       = CRM_Core_Config::singleton();
+    $fields = array('label', 'value', 'is_active', 'weight');
+    $config = CRM_Core_Config::singleton();
     while ($dao->fetch()) {
       $customOption[$dao->id] = array();
       foreach ($fields as $field) {
@@ -251,8 +251,8 @@ ORDER BY weight, label
     // set the userContext stack
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/admin/custom/group/field/option',
-        "reset=1&action=browse&fid={$this->_fid}&gid={$this->_gid}"
-      ));
+      "reset=1&action=browse&fid={$this->_fid}&gid={$this->_gid}"
+    ));
     $controller->setEmbedded(TRUE);
     $controller->process();
     $controller->run();
@@ -284,10 +284,12 @@ ORDER BY weight, label
     }
 
     //as url contain $gid so append breadcrumb dynamically.
-    $breadcrumb = array(array(
-    'title' => ts('Custom Data Fields'),
+    $breadcrumb = array(
+      array(
+        'title' => ts('Custom Data Fields'),
         'url' => CRM_Utils_System::url('civicrm/admin/custom/group/field', 'reset=1&gid=' . $this->_gid),
-      ));
+      )
+    );
     CRM_Utils_System::appendBreadCrumb($breadcrumb);
 
     if ($this->_fid) {
index 5e0f90f9ac2e40e77eb397ff7357e15ef26e07b7..d3a7b3eb477a16a515a796041696e611e623697d 100644 (file)
@@ -53,8 +53,8 @@ class CRM_Dashlet_Page_AllCases extends CRM_Core_Page {
       CRM_Core_Error::fatal(ts('You are not authorized to access this page.'));
     }
 
-    $session  = CRM_Core_Session::singleton();
-    $userID   = $session->get('userID');
+    $session = CRM_Core_Session::singleton();
+    $userID = $session->get('userID');
     $upcoming = CRM_Case_BAO_Case::getCases(TRUE, $userID, 'upcoming', $context);
 
     if (!empty($upcoming)) {
index 16d78b4eb4bdab6699bf3b7bf84e88346eaed197..e7be5280fc36a2adcae10cfdbea5d38a59d5d544 100644 (file)
@@ -52,7 +52,7 @@ class CRM_Dashlet_Page_CaseDashboard extends CRM_Core_Page {
     }
 
     $session = &CRM_Core_Session::singleton();
-    $userID  = $session->get('userID');
+    $userID = $session->get('userID');
     $summary = CRM_Case_BAO_Case::getCasesSummary(TRUE, $userID);
 
     if (!empty($summary)) {
index 284cc2b854db484ef714563def425e341fa6225d..b121d03573c36e232734fcaf69f27143dddb1f8c 100644 (file)
@@ -53,8 +53,8 @@ class CRM_Dashlet_Page_MyCases extends CRM_Core_Page {
       CRM_Core_Error::fatal(ts('You are not authorized to access this page.'));
     }
 
-    $session  = CRM_Core_Session::singleton();
-    $userID   = $session->get('userID');
+    $session = CRM_Core_Session::singleton();
+    $userID = $session->get('userID');
     $upcoming = CRM_Case_BAO_Case::getCases(FALSE, $userID, 'upcoming', $context);
 
     if (!empty($upcoming)) {
index 686cda71d9911d716ae5ae94ba4e9f79390342f8..393a4dab49e202b9e47cb646c38e870d42c8c4c8 100644 (file)
@@ -22,4 +22,6 @@ class CRM_Dedupe_BAO_QueryBuilder {
       return "($strID1 < $strID2)";
     }
   }
-};
+}
+
+;
index 2d90f02e21e8577ffca2c84f1ad88de8a87af7ca..f65884c162daa28d46860f2e315d5d5b9026cff3 100644 (file)
@@ -15,8 +15,8 @@ class CRM_Dedupe_BAO_QueryBuilder_IndividualGeneral extends CRM_Dedupe_BAO_Query
     $civicrm_address = CRM_Utils_Array::value('civicrm_address', $rg->params);
 
     // Since definitely have first and last name, escape them upfront.
-    $first_name     = CRM_Core_DAO::escapeString(CRM_Utils_Array::value('first_name', $civicrm_contact, ''));
-    $last_name      = CRM_Core_DAO::escapeString(CRM_Utils_Array::value('last_name', $civicrm_contact, ''));
+    $first_name = CRM_Core_DAO::escapeString(CRM_Utils_Array::value('first_name', $civicrm_contact, ''));
+    $last_name = CRM_Core_DAO::escapeString(CRM_Utils_Array::value('last_name', $civicrm_contact, ''));
     $street_address = CRM_Core_DAO::escapeString(CRM_Utils_Array::value('street_address', $civicrm_address, ''));
 
     $query = "
index 080f3df0cb53dbc9dbaaa7ec78eb79bd9b56eeed..905aef6fe2ad7791f9651d6d1092b0aedef98b49 100644 (file)
@@ -54,4 +54,6 @@ class CRM_Dedupe_BAO_QueryBuilder_IndividualSupervised extends CRM_Dedupe_BAO_Qu
               AND " . self::internalFilters($rg);
     return array("civicrm_contact.{$rg->name}.{$rg->threshold}" => $query);
   }
-};
+}
+
+;
index fc05be3f70f025415fc88584fa32d99fe2d27814..07c7bb797d58e07092b51f1cf793c2c919e83b25 100644 (file)
@@ -107,4 +107,6 @@ AND    " . self::internalFilters($rg);
 
     return array("civicrm_contact.{$rg->name}.{$rg->threshold}" => $query);
   }
-};
+}
+
+;
index e513d0c3cce07461f35bb45e56143302314d97de..767d715e29769053fcf1af0e2f2364d71dc01fdd 100644 (file)
@@ -71,7 +71,7 @@ class CRM_Dedupe_BAO_Rule extends CRM_Dedupe_DAO_Rule {
     // $using are arrays of required field matchings (for substring and
     // full matches, respectively)
     $where = array();
-    $on    = array("SUBSTR(t1.{$this->rule_field}, 1, {$this->rule_length}) = SUBSTR(t2.{$this->rule_field}, 1, {$this->rule_length})");
+    $on = array("SUBSTR(t1.{$this->rule_field}, 1, {$this->rule_length}) = SUBSTR(t2.{$this->rule_field}, 1, {$this->rule_length})");
     $using = array($this->rule_field);
 
     switch ($this->rule_table) {
@@ -90,8 +90,8 @@ class CRM_Dedupe_BAO_Rule extends CRM_Dedupe_DAO_Rule {
         break;
 
       case 'civicrm_address':
-        $id      = 'contact_id';
-        $on[]    = 't1.location_type_id = t2.location_type_id';
+        $id = 'contact_id';
+        $on[] = 't1.location_type_id = t2.location_type_id';
         $using[] = 'location_type_id';
         if ($this->params['civicrm_address']['location_type_id']) {
           $locTypeId = CRM_Utils_Type::escape($this->params['civicrm_address']['location_type_id'], 'Integer', FALSE);
@@ -193,8 +193,8 @@ class CRM_Dedupe_BAO_Rule extends CRM_Dedupe_DAO_Rule {
    * @return rule fields array associated to rule group
    */
   public static function dedupeRuleFields($params) {
-    $rgBao               = new CRM_Dedupe_BAO_RuleGroup();
-    $rgBao->used         = $params['used'];
+    $rgBao = new CRM_Dedupe_BAO_RuleGroup();
+    $rgBao->used = $params['used'];
     $rgBao->contact_type = $params['contact_type'];
     $rgBao->find(TRUE);
 
index 744e118c6a6d0088369926c944dfe99d64b21993..bd7d5ec87cc0c81293af714907c24bdbcd313003 100644 (file)
@@ -80,8 +80,13 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup {
       );
       // the table names we support in dedupe rules - a filter for importableFields()
       $supportedTables = array(
-        'civicrm_address', 'civicrm_contact', 'civicrm_email',
-        'civicrm_im', 'civicrm_note', 'civicrm_openid', 'civicrm_phone',
+        'civicrm_address',
+        'civicrm_contact',
+        'civicrm_email',
+        'civicrm_im',
+        'civicrm_note',
+        'civicrm_openid',
+        'civicrm_phone',
       );
 
       foreach (array('Individual', 'Organization', 'Household') as $ctype) {
@@ -137,7 +142,7 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup {
       CRM_Utils_File::isIncludable("CRM/Dedupe/BAO/QueryBuilder/{$this->name}.php")
     ) {
       include_once "CRM/Dedupe/BAO/QueryBuilder/{$this->name}.php";
-      $class   = "CRM_Dedupe_BAO_QueryBuilder_{$this->name}";
+      $class = "CRM_Dedupe_BAO_QueryBuilder_{$this->name}";
       $command = empty($this->params) ? 'internal' : 'record';
       $queries = call_user_func(array($class, $command), $this);
     }
@@ -182,15 +187,15 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup {
 
     if ($this->params && !$this->noRules) {
       $tempTableQuery = "CREATE TEMPORARY TABLE dedupe (id1 int, weight int, UNIQUE UI_id1 (id1)) ENGINE=MyISAM";
-      $insertClause   = "INSERT INTO dedupe (id1, weight)";
-      $groupByClause  = "GROUP BY id1";
-      $dupeCopyJoin   = " JOIN dedupe_copy ON dedupe_copy.id1 = t1.column WHERE ";
+      $insertClause = "INSERT INTO dedupe (id1, weight)";
+      $groupByClause = "GROUP BY id1";
+      $dupeCopyJoin = " JOIN dedupe_copy ON dedupe_copy.id1 = t1.column WHERE ";
     }
     else {
       $tempTableQuery = "CREATE TEMPORARY TABLE dedupe (id1 int, id2 int, weight int, UNIQUE UI_id1_id2 (id1, id2)) ENGINE=MyISAM";
-      $insertClause   = "INSERT INTO dedupe (id1, id2, weight)";
-      $groupByClause  = "GROUP BY id1, id2";
-      $dupeCopyJoin   = " JOIN dedupe_copy ON dedupe_copy.id1 = t1.column AND dedupe_copy.id2 = t2.column WHERE ";
+      $insertClause = "INSERT INTO dedupe (id1, id2, weight)";
+      $groupByClause = "GROUP BY id1, id2";
+      $dupeCopyJoin = " JOIN dedupe_copy ON dedupe_copy.id1 = t1.column AND dedupe_copy.id2 = t2.column WHERE ";
     }
     $patternColumn = '/t1.(\w+)/';
     $exclWeightSum = array();
@@ -215,7 +220,7 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup {
           // extract the next query ( and weight ) to be executed
           $fieldWeight = array_keys($tableQueries);
           $fieldWeight = $fieldWeight[0];
-          $query       = array_shift($tableQueries);
+          $query = array_shift($tableQueries);
 
           if ($searchWithinDupes) {
             // get prepared to search within already found dupes if $searchWithinDupes flag is set
@@ -251,8 +256,8 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup {
         // since queries are already sorted by weights, we can continue as is
         $fieldWeight = array_keys($tableQueries);
         $fieldWeight = $fieldWeight[0];
-        $query       = array_shift($tableQueries);
-        $query       = "{$insertClause} {$query} {$groupByClause} ON DUPLICATE KEY UPDATE weight = weight + VALUES(weight)";
+        $query = array_shift($tableQueries);
+        $query = "{$insertClause} {$query} {$groupByClause} ON DUPLICATE KEY UPDATE weight = weight + VALUES(weight)";
         $dao->query($query);
         if ($dao->affectedRows() >= 1) {
           $exclWeightSum[] = substr($fieldWeight, strrpos($fieldWeight, '.') + 1);
@@ -384,7 +389,7 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup {
    * @access public
    */
   public static function dedupeRuleFieldsWeight($params) {
-    $rgBao               = new CRM_Dedupe_BAO_RuleGroup();
+    $rgBao = new CRM_Dedupe_BAO_RuleGroup();
     $rgBao->contact_type = $params['contact_type'];
     if (CRM_Utils_Array::value('id', $params)) {
       // accept an ID if provided
index 451c552667a4a98c4e6fd209b085ffcc608ce173..094b3996219717a193105830f0f20ca9d14e18dc 100644 (file)
@@ -52,8 +52,8 @@ class CRM_Dedupe_Finder {
    *   array of (cid1, cid2, weight) dupe triples
    */
   public static function dupes($rgid, $cids = array()) {
-    $rgBao             = new CRM_Dedupe_BAO_RuleGroup();
-    $rgBao->id         = $rgid;
+    $rgBao = new CRM_Dedupe_BAO_RuleGroup();
+    $rgBao->id = $rgid;
     $rgBao->contactIds = $cids;
     if (!$rgBao->find(TRUE)) {
       CRM_Core_Error::fatal("Dedupe rule not found for selected contacts");
@@ -109,8 +109,8 @@ class CRM_Dedupe_Finder {
 
     $foundByID = FALSE;
     if ($ruleGroupID) {
-      $rgBao               = new CRM_Dedupe_BAO_RuleGroup();
-      $rgBao->id           = $ruleGroupID;
+      $rgBao = new CRM_Dedupe_BAO_RuleGroup();
+      $rgBao->id = $ruleGroupID;
       $rgBao->contact_type = $ctype;
       if ($rgBao->find(TRUE)) {
         $foundByID = TRUE;
@@ -118,9 +118,9 @@ class CRM_Dedupe_Finder {
     }
 
     if (!$foundByID) {
-      $rgBao               = new CRM_Dedupe_BAO_RuleGroup();
+      $rgBao = new CRM_Dedupe_BAO_RuleGroup();
       $rgBao->contact_type = $ctype;
-      $rgBao->used         = $used;
+      $rgBao->used = $used;
       if (!$rgBao->find(TRUE)) {
         CRM_Core_Error::fatal("$used rule for $ctype does not exist");
       }
@@ -183,8 +183,8 @@ class CRM_Dedupe_Finder {
       }
       $ctype = $dao->contact_type;
     }
-    $rgBao               = new CRM_Dedupe_BAO_RuleGroup();
-    $rgBao->used         = $used;
+    $rgBao = new CRM_Dedupe_BAO_RuleGroup();
+    $rgBao->used = $used;
     $rgBao->contact_type = $ctype;
     if (!$rgBao->find(TRUE)) {
       CRM_Core_Error::fatal("$used rule for $ctype does not exist");
@@ -235,7 +235,9 @@ class CRM_Dedupe_Finder {
 
     // 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])) {
@@ -306,9 +308,9 @@ class CRM_Dedupe_Finder {
           // FIXME: we also need to do some hacking for id and name fields, see CRM-3902’s comments
           $fixes = array(
             'address_name' => 'name',
-          'country' => 'country_id',
+            'country' => 'country_id',
             'state_province' => 'state_province_id',
-          'county' => 'county_id',
+            'county' => 'county_id',
           );
           foreach ($fixes as $orig => $target) {
             if (!empty($flat[$orig])) {
index 8d7e2fc55872a87c366c76f9d23a9e8ddcf40f59..3d0da9030f55310ea3ed40d403a8a9b28dfa6129 100644 (file)
@@ -621,7 +621,7 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
    * @static
    */
   public static function merge($dupePairs = array(), $cacheParams = array(), $mode = 'safe',
-    $autoFlip = TRUE, $redirectForPerformance = FALSE
+                               $autoFlip = TRUE, $redirectForPerformance = FALSE
   ) {
     $cacheKeyString = CRM_Utils_Array::value('cache_key_string', $cacheParams);
     $resultStats = array('merged' => array(), 'skipped' => array());
@@ -726,7 +726,8 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
       }
       elseif ((in_array(substr($key, 5), CRM_Dedupe_Merger::getContactFields()) or
           substr($key, 0, 12) == 'move_custom_'
-        ) and $val != NULL) {
+        ) and $val != NULL
+      ) {
         // Rule: if both main-contact has other-contact, let $mode decide if to merge a
         // particular field or not
         if (!empty($migrationInfo['rows'][$key]['main'])) {
@@ -751,7 +752,8 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
         if ($fieldName == 'address') {
           $mainNewLocTypeId = $migrationInfo['location'][$fieldName][$fieldCount]['locTypeId'];
           if (!empty($migrationInfo['main_loc_address']) &&
-              array_key_exists("main_{$mainNewLocTypeId}", $migrationInfo['main_loc_address'])) {
+            array_key_exists("main_{$mainNewLocTypeId}", $migrationInfo['main_loc_address'])
+          ) {
             // main loc already has some address for the loc-type. Its a overwrite situation.
 
             // look for next available loc-type
@@ -824,7 +826,11 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
 
     // Fetch contacts
     foreach (array('main' => $mainId, 'other' => $otherId) as $moniker => $cid) {
-      $params = array('contact_id' => $cid, 'version' => 3, 'return' => array_merge(array('display_name'), self::getContactFields()));
+      $params = array(
+        'contact_id' => $cid,
+        'version' => 3,
+        'return' => array_merge(array('display_name'), self::getContactFields())
+      );
       $result = civicrm_api('contact', 'get', $params);
 
       if (empty($result['values'][$cid]['contact_type'])) {
@@ -856,10 +862,10 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
       }
       $names = array(
         'preferred_communication_method' =>
-        array(
-          'newName' => 'preferred_communication_method_display',
-          'groupName' => 'preferred_communication_method',
-        ),
+          array(
+            'newName' => 'preferred_communication_method_display',
+            'groupName' => 'preferred_communication_method',
+          ),
       );
       CRM_Core_OptionGroup::lookupValues($specialValues[$moniker], $names);
 
@@ -1058,8 +1064,11 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
             $js = array('onChange' => "mergeBlock('$name', this, $count );");
           }
           $elements[] = array(
-            'select', "location[{$name}][$count][locTypeId]", NULL,
-            $defaultLocType + $locTypeValues, $js,
+            'select',
+            "location[{$name}][$count][locTypeId]",
+            NULL,
+            $defaultLocType + $locTypeValues,
+            $js,
           );
           // keep location-type-id same as that of other-contact
           $migrationInfo['location'][$name][$count]['locTypeId'] = $locTypeId;
@@ -1229,7 +1238,7 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
         $value = '0';
       }
       if ((in_array(substr($key, 5), CRM_Dedupe_Merger::getContactFields()) ||
-        substr($key, 0, 12) == 'move_custom_') &&
+          substr($key, 0, 12) == 'move_custom_') &&
         $value != NULL
       ) {
         $submitted[substr($key, 5)] = $value;
@@ -1426,10 +1435,13 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
                 //keep state and country as array format.
                 //for checkbox and m-select format w/ VALUE_SEPARATOR
                 if (in_array($htmlType, array(
-                  'CheckBox', 'Multi-Select', 'AdvMulti-Select'))) {
+                  'CheckBox',
+                  'Multi-Select',
+                  'AdvMulti-Select'
+                ))) {
                   $submitted[$key] = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,
-                    $mergeValue
-                  ) . CRM_Core_DAO::VALUE_SEPARATOR;
+                      $mergeValue
+                    ) . CRM_Core_DAO::VALUE_SEPARATOR;
                 }
                 else {
                   $submitted[$key] = $mergeValue;
@@ -1437,7 +1449,9 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
               }
             }
             elseif (in_array($htmlType, array(
-              'Multi-Select Country', 'Multi-Select State/Province'))) {
+              'Multi-Select Country',
+              'Multi-Select State/Province'
+            ))) {
               //we require submitted values should be in array format
               if ($value) {
                 $mergeValueArray = explode(CRM_Core_DAO::VALUE_SEPARATOR, $value);
@@ -1497,7 +1511,8 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
       if (CRM_Core_DAO::singleValueQuery("
         SELECT id
         FROM civicrm_entity_file
-        WHERE entity_table = '{$tableName}' AND file_id = {$fileIds[$otherId]}")) {
+        WHERE entity_table = '{$tableName}' AND file_id = {$fileIds[$otherId]}")
+      ) {
         $sql = "
           UPDATE civicrm_entity_file
           SET entity_id = {$mainId}
@@ -1599,8 +1614,18 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
    */
   public static function getContactFields() {
     $contactFields = CRM_Contact_DAO_Contact::fields();
-    $invalidFields = array('api_key', 'contact_is_deleted', 'created_date', 'display_name', 'hash', 'id', 'modified_date',
-      'primary_contact_id', 'sort_name', 'user_unique_id');
+    $invalidFields = array(
+      'api_key',
+      'contact_is_deleted',
+      'created_date',
+      'display_name',
+      'hash',
+      'id',
+      'modified_date',
+      'primary_contact_id',
+      'sort_name',
+      'user_unique_id'
+    );
     foreach ($contactFields as $field => $value) {
       if (in_array($field, $invalidFields)) {
         unset($contactFields[$field]);
index 8bbb8c8282bab3b0b4c182a921aaf44e86a5f4c9..0a6fba66a2bc8d03f703cb9aed071e80b12ba15b 100644 (file)
@@ -269,9 +269,9 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event {
    */
   static function getEvents(
     $all = 0,
-                            $id = FALSE,
-                            $isActive = TRUE,
-                            $checkPermission = TRUE
+    $id = FALSE,
+    $isActive = TRUE,
+    $checkPermission = TRUE
   ) {
     $query = "
 SELECT `id`, `title`, `start_date`
@@ -602,10 +602,10 @@ $event_summary_limit
    */
   public static function getParticipantCount(
     $eventId,
-                                             $considerStatus = TRUE,
-                                             $status = TRUE,
-                                             $considerRole = TRUE,
-                                             $role = TRUE
+    $considerStatus = TRUE,
+    $status = TRUE,
+    $considerRole = TRUE,
+    $role = TRUE
   ) {
 
     // consider both role and status for counted participants, CRM-4924.
@@ -702,9 +702,9 @@ WHERE civicrm_address.geo_code_1 IS NOT NULL
       $params = array('entity_id' => $id, 'entity_table' => 'civicrm_event');
       $addressValues = CRM_Core_BAO_Location::getValues($params, TRUE);
       $location['address'] = str_replace(array(
-          "\r",
-          "\n",
-        ), '', addslashes(nl2br($addressValues['address'][1]['display_text'])));
+        "\r",
+        "\n",
+      ), '', addslashes(nl2br($addressValues['address'][1]['display_text'])));
 
       $location['url'] = CRM_Utils_System::url('civicrm/event/register', 'reset=1&id=' . $dao->event_id);
       $location['location_type'] = $dao->location_type;
@@ -2232,7 +2232,7 @@ LEFT  JOIN  civicrm_price_field_value value ON ( value.id = lineItem.price_field
         // Fixme - this is going to ignore context, better to get conditions, add params, and call PseudoConstant::get
         return CRM_Financial_BAO_FinancialType::getIncomeFinancialType();
 
-      break;
+        break;
     }
     return CRM_Core_PseudoConstant::get(__CLASS__, $fieldName, $params, $context);
   }
index 6a203bf90898cfd024e9a1ed82fdc48dd67848ae..101448314977aa04618af718ae62b740236bd5c8 100644 (file)
@@ -74,12 +74,20 @@ class CRM_Event_BAO_ParticipantPayment extends CRM_Event_DAO_ParticipantPayment
 
     //generally if people are creating participant_payments via the api they won't be setting the line item correctly - we can't help them if they are doing complex transactions
     // but if they have a single line item for the contribution we can assume it should refer to the participant line
-    $lineItemCount = CRM_Core_DAO::singleValueQuery("select count(*) FROM civicrm_line_item WHERE contribution_id = %1", array(1 => array($participantPayment->contribution_id, 'Integer')));
+    $lineItemCount = CRM_Core_DAO::singleValueQuery("select count(*) FROM civicrm_line_item WHERE contribution_id = %1", array(
+        1 => array(
+          $participantPayment->contribution_id,
+          'Integer'
+        )
+      ));
     if ($lineItemCount == 1) {
       $sql = "UPDATE civicrm_line_item li
       SET entity_table = 'civicrm_participant', entity_id = %1
       WHERE contribution_id = %2 AND entity_table = 'civicrm_contribution'";
-      CRM_Core_DAO::executeQuery($sql, array(1 => array($participantPayment->participant_id, 'Integer'), 2 => array($participantPayment->contribution_id, 'Integer')));
+      CRM_Core_DAO::executeQuery($sql, array(
+          1 => array($participantPayment->participant_id, 'Integer'),
+          2 => array($participantPayment->contribution_id, 'Integer')
+        ));
     }
 
     return $participantPayment;
index 23797561ecad9078b5632cd7327d746ec5c31e23..86439c42a723a15daed575e10897c65cdea32870 100644 (file)
@@ -197,9 +197,9 @@ LEFT JOIN  civicrm_event event ON ( event.id = participant.event_id )
             //lets get the transaction mechanism.
             $transaction = new CRM_Core_Transaction();
 
-            $ids       = array($participantId);
+            $ids = array($participantId);
             $expiredId = array_search('Expired', $expiredStatuses);
-            $results   = CRM_Event_BAO_Participant::transitionParticipants($ids, $expiredId, $values['status_id'], TRUE, TRUE);
+            $results = CRM_Event_BAO_Participant::transitionParticipants($ids, $expiredId, $values['status_id'], TRUE, TRUE);
             $transaction->commit();
 
             if (!empty($results)) {
index c343efef6e6d4c12ec27b9e5294d7c11951b18fb..ca8f7550a7be94d6c066d69e13c34bb18c6a756e 100644 (file)
@@ -432,7 +432,7 @@ class CRM_Event_BAO_Query {
             "[[:>:]]' ";
 
           $query->_tables['civicrm_participant'] =
-            $query->_whereTables['civicrm_participant'] = 1;
+          $query->_whereTables['civicrm_participant'] = 1;
         }
         return;
 
index 5baee3d5a4955b6c137e0c8d7652747fb3520a4c..f5e59dad35d39d94cf9814cb2e359dd55fb3f2fb 100644 (file)
@@ -46,11 +46,17 @@ class CRM_Event_Badge {
   /**
    */
   public function __construct() {
-    $this->style        = array('width' => 0.1, 'cap' => 'round', 'join' => 'round', 'dash' => '2,2', 'color' => array(0, 0, 200));
-    $this->format       = '5160';
+    $this->style = array(
+      'width' => 0.1,
+      'cap' => 'round',
+      'join' => 'round',
+      'dash' => '2,2',
+      'color' => array(0, 0, 200)
+    );
+    $this->format = '5160';
     $this->imgExtension = 'png';
-    $this->imgRes       = 300;
-    $this->event        = NULL;
+    $this->imgRes = 300;
+    $this->event = NULL;
     $this->setDebug(FALSE);
   }
 
@@ -79,7 +85,7 @@ class CRM_Event_Badge {
   public function run(&$participants) {
     // fetch the 1st participant, and take her event to retrieve its attributes
     $participant = reset($participants);
-    $eventID     = $participant['event_id'];
+    $eventID = $participant['event_id'];
     $this->event = self::retrieveEvent($eventID);
     //call function to create labels
     self::createLabels($participants);
@@ -142,7 +148,15 @@ class CRM_Event_Badge {
     $x = $this->pdf->GetAbsX();
     $y = $this->pdf->GetY();
     if ($this->debug) {
-      $this->pdf->Rect($x, $y, $this->pdf->width, $this->pdf->height, 'D', array('all' => array('width' => 1, 'cap' => 'round', 'join' => 'round', 'dash' => '2,10', 'color' => array(255, 0, 0))));
+      $this->pdf->Rect($x, $y, $this->pdf->width, $this->pdf->height, 'D', array(
+          'all' => array(
+            'width' => 1,
+            'cap' => 'round',
+            'join' => 'round',
+            'dash' => '2,10',
+            'color' => array(255, 0, 0)
+          )
+        ));
     }
     $img = $this->getImageFileName($this->event->id, $img);
     if ($img) {
index 575631f22f768eb7be9936492b8f763e2df89f38..016979c6da550aae78f2c3dad2bdbb15be3ba144 100644 (file)
@@ -9,23 +9,23 @@ class CRM_Event_Badge_Logo extends CRM_Event_Badge {
   public function __construct() {
     parent::__construct();
     // A4
-    $pw           = 210;
-    $ph           = 297;
-    $h            = 50;
-    $w            = 75;
+    $pw = 210;
+    $ph = 297;
+    $h = 50;
+    $w = 75;
     $this->format = array(
       'name' => 'Sigel 3C',
-    'paper-size' => 'A4',
-    'metric' => 'mm',
-    'lMargin' => ($pw - $w * 2) / 2,
+      'paper-size' => 'A4',
+      'metric' => 'mm',
+      'lMargin' => ($pw - $w * 2) / 2,
       'tMargin' => ($ph - $h * 5) / 2,
-    'NX' => 2,
-    'NY' => 5,
-    'SpaceX' => 0,
-    'SpaceY' => 0,
+      'NX' => 2,
+      'NY' => 5,
+      'SpaceX' => 0,
+      'SpaceY' => 0,
       'width' => $w,
-    'height' => $h,
-    'font-size' => 12,
+      'height' => $h,
+      'font-size' => 12,
     );
     $this->lMarginLogo = 20;
     $this->tMarginName = 20;
@@ -39,7 +39,13 @@ class CRM_Event_Badge_Logo extends CRM_Event_Badge {
     $x = $this->pdf->GetAbsX();
     $y = $this->pdf->GetY();
     $this->printBackground(TRUE);
-    $this->pdf->SetLineStyle(array('width' => 0.1, 'cap' => 'round', 'join' => 'round', 'dash' => '2,2', 'color' => array(0, 0, 200)));
+    $this->pdf->SetLineStyle(array(
+        'width' => 0.1,
+        'cap' => 'round',
+        'join' => 'round',
+        'dash' => '2,2',
+        'color' => array(0, 0, 200)
+      ));
 
     $this->pdf->SetFontSize(8);
     $this->pdf->MultiCell($this->pdf->width - $this->lMarginLogo, 0, $participant['event_title'], $this->border, "L", 0, 1, $x + $this->lMarginLogo, $y);
index 9fb927d4d992d2879a7e45c6c4da6ae0089024bc..59d1d18231c30a0d8968176921426934679d3aca 100644 (file)
@@ -9,23 +9,23 @@ class CRM_Event_Badge_Logo5395 extends CRM_Event_Badge {
   public function __construct() {
     parent::__construct();
     // A4
-    $pw           = 210;
-    $ph           = 297;
-    $h            = 59.2;
-    $w            = 85.7;
+    $pw = 210;
+    $ph = 297;
+    $h = 59.2;
+    $w = 85.7;
     $this->format = array(
       'name' => 'Avery 5395',
-    'paper-size' => 'A4',
-    'metric' => 'mm',
-    'lMargin' => 13.5,
+      'paper-size' => 'A4',
+      'metric' => 'mm',
+      'lMargin' => 13.5,
       'tMargin' => 3,
-    'NX' => 2,
-    'NY' => 4,
-    'SpaceX' => 15,
-    'SpaceY' => 8.5,
+      'NX' => 2,
+      'NY' => 4,
+      'SpaceX' => 15,
+      'SpaceY' => 8.5,
       'width' => $w,
-    'height' => $h,
-    'font-size' => 12,
+      'height' => $h,
+      'font-size' => 12,
     );
     $this->lMarginLogo = 20;
     $this->tMarginName = 20;
@@ -39,7 +39,13 @@ class CRM_Event_Badge_Logo5395 extends CRM_Event_Badge {
     $x = $this->pdf->GetAbsX();
     $y = $this->pdf->GetY();
     $this->printBackground(TRUE);
-    $this->pdf->SetLineStyle(array('width' => 0.1, 'cap' => 'round', 'join' => 'round', 'dash' => '2,2', 'color' => array(0, 0, 200)));
+    $this->pdf->SetLineStyle(array(
+        'width' => 0.1,
+        'cap' => 'round',
+        'join' => 'round',
+        'dash' => '2,2',
+        'color' => array(0, 0, 200)
+      ));
 
     $this->pdf->SetFontSize(9);
     $this->pdf->MultiCell($this->pdf->width - $this->lMarginLogo, 0, $participant['event_title'], $this->border, "L", 0, 1, $x + $this->lMarginLogo, $y);
index 6345be427c6434de3759d6e7701ed07a26835ea9..3bca8a13a2d613c949fce41e3f905a3d04452e06 100644 (file)
@@ -43,25 +43,25 @@ class CRM_Event_Badge_NameTent extends CRM_Event_Badge {
   public function __construct() {
     parent::__construct();
     // A4
-    $pw            = 297;
-    $ph            = 210;
+    $pw = 297;
+    $ph = 210;
     $this->lMargin = 10;
     $this->tMargin = 0;
-    $w             = $pw - 2 * $this->lMargin;
-    $h             = $ph - 2 * $this->tMargin;
-    $this->format  = array(
+    $w = $pw - 2 * $this->lMargin;
+    $h = $ph - 2 * $this->tMargin;
+    $this->format = array(
       'name' => 'A4 horiz',
-    'paper-size' => 'A4',
-    'metric' => 'mm',
-    'lMargin' => 0,
+      'paper-size' => 'A4',
+      'metric' => 'mm',
+      'lMargin' => 0,
       'tMargin' => 0,
-    'NX' => 1,
-    'NY' => 1,
-    'SpaceX' => 0,
-    'SpaceY' => 0,
+      'NX' => 1,
+      'NY' => 1,
+      'SpaceX' => 0,
+      'SpaceY' => 0,
       'width' => $w,
-    'height' => $h,
-    'font-size' => 36,
+      'height' => $h,
+      'font-size' => 36,
     );
     //      $this->setDebug ();
   }
index c14cbaf4aa5f4b293363139642a78d994cdbc4bc..f6841d258cffdaf8bf79b90cccede49475cffd7c 100644 (file)
@@ -104,10 +104,10 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart {
    * @return $this|bool|CRM_Event_Cart_BAO_Cart
    */
   public static function find_or_create_for_current_session() {
-    $session       = CRM_Core_Session::singleton();
+    $session = CRM_Core_Session::singleton();
     $event_cart_id = $session->get('event_cart_id');
-    $userID        = $session->get('userID');
-    $cart          = FALSE;
+    $userID = $session->get('userID');
+    $cart = FALSE;
     if (!is_null($event_cart_id)) {
       $cart = self::find_uncompleted_by_id($event_cart_id);
       if ($cart && $userID) {
@@ -308,7 +308,7 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart {
         $index++;
       }
     }
-    return - 1;
+    return -1;
   }
 
   /**
index b207e6c7d5f99dad0318397ba129bd45d60229c7..d96f36aaec1c96b546c6cebde3bb7fc0399c86e8 100644 (file)
@@ -28,8 +28,8 @@ SELECT sub_event.* FROM civicrm_participant main_participant
       slot.weight,
       sub_event.start_date
 EOS;
-    $sql_args        = array(1 => array($main_event_participant_id, 'Integer'));
-    $dao             = CRM_Core_DAO::executeQuery($sql, $sql_args);
+    $sql_args = array(1 => array($main_event_participant_id, 'Integer'));
+    $dao = CRM_Core_DAO::executeQuery($sql, $sql_args);
     $smarty_sessions = array();
     while ($dao->fetch()) {
       $smarty_sessions[] = get_object_vars($dao);
index f1cbf8562a3473be03cbdef02b8c62030e2074ff..b9f661a0d906e4435f637d6818d44a9b0d34f170 100644 (file)
@@ -52,8 +52,8 @@ class CRM_Event_Cart_BAO_EventInCart extends CRM_Event_Cart_DAO_EventInCart impl
     $this->load_associations();
     $contacts_to_delete = array();
     foreach ($this->participants as $participant) {
-      $defaults          = array();
-      $params            = array('id' => $participant->contact_id);
+      $defaults = array();
+      $params = array('id' => $participant->contact_id);
       $temporary_contact = CRM_Contact_BAO_Contact::retrieve($params, $defaults);
 
       if ($temporary_contact->is_deleted) {
index ef67dbfb8de55f84317680496c61a53ba970bff9..c227a3c8293bd1339f44f85a4d76bc8c686fa458 100644 (file)
@@ -50,9 +50,9 @@ class CRM_Event_Cart_Form_Cart extends CRM_Core_Form {
     foreach ($this->cart->get_main_events_in_carts() as $event_in_cart) {
       if (empty($event_in_cart->participants)) {
         $participant_params = array(
-            'cart_id' => $this->cart->id,
-            'event_id' => $event_in_cart->event_id,
-            'contact_id' => self::find_or_create_contact($this->getContactID()),
+          'cart_id' => $this->cart->id,
+          'event_id' => $event_in_cart->event_id,
+          'contact_id' => self::find_or_create_contact($this->getContactID()),
         );
         $participant = CRM_Event_Cart_BAO_MerParticipant::create($participant_params);
         $participant->save();
index 7f8c70d5d7569786717ab5cfae6170204e257235..b6c6a2057e0e714555f2ec4cabf245fb73210263 100644 (file)
@@ -64,10 +64,10 @@ EOS;
       $slot_buttons = array();
       $group_name = "slot_$slot_index";
       foreach ($events as $event) {
-        $seats_available   = $this->checkEventCapacity($event->id);
-        $event_is_full     = ($seats_available === NULL) ? FALSE : ($seats_available < 1);
-        $radio             = $this->createElement('radio', NULL, NULL, $event->title, $event->id);
-        $slot_buttons[]    = $radio;
+        $seats_available = $this->checkEventCapacity($event->id);
+        $event_is_full = ($seats_available === NULL) ? FALSE : ($seats_available < 1);
+        $radio = $this->createElement('radio', NULL, NULL, $event->title, $event->id);
+        $slot_buttons[] = $radio;
         $event_description = ($event_is_full ? $event->event_full_text . "<p>" : '') . $event->description;
 
         $session_options[$radio->getAttribute('id')] = array(
@@ -136,9 +136,9 @@ EOS;
 
       $values = array();
       CRM_Core_DAO::storeValues($this->main_participant, $values);
-      $values['id']       = NULL;
+      $values['id'] = NULL;
       $values['event_id'] = $event_in_cart->event_id;
-      $participant        = CRM_Event_Cart_BAO_MerParticipant::create($values);
+      $participant = CRM_Event_Cart_BAO_MerParticipant::create($values);
       $participant->save();
       $event_in_cart->add_participant($participant);
     }
index 897f8478db7c81673e6b3d3c7f6ffe8160820932..608c1e239922a4972ebfee7fa1b549f3aeeb8567 100644 (file)
@@ -42,8 +42,8 @@ class CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices extends CRM_Event_Cart_
     );
 
     if ($this->cid) {
-      $params         = array('id' => $this->cid);
-      $contact        = CRM_Contact_BAO_Contact::retrieve($params, $defaults);
+      $params = array('id' => $this->cid);
+      $contact = CRM_Contact_BAO_Contact::retrieve($params, $defaults);
       $contact_values = array();
       CRM_Core_DAO::storeValues($contact, $contact_values);
       $this->assign('contact', $contact_values);
@@ -76,8 +76,8 @@ class CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices extends CRM_Event_Cart_
     $price_set_id = CRM_Price_BAO_PriceSet::getFor('civicrm_event', $event->id);
     if ($price_set_id) {
       $price_sets = CRM_Price_BAO_PriceSet::getSetDetail($price_set_id, TRUE, TRUE);
-      $price_set  = $price_sets[$price_set_id];
-      $index      = -1;
+      $price_set = $price_sets[$price_set_id];
+      $index = -1;
       foreach ($price_set['fields'] as $field) {
         $index++;
         $field_name = "event_{$event->id}_price_{$field['id']}";
@@ -143,7 +143,11 @@ class CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices extends CRM_Event_Cart_
           while ($participant->fetch()) {
             if (array_key_exists($participant->status_id, $statusTypes)) {
               $form = $mer_participant->get_form();
-              $this->_errors[$form->html_field_name('email')] = ts("The participant %1 is already registered for %2 (%3).", array(1 => $participant_fields['email'], 2 => $event_in_cart->event->title, 3 => $event_in_cart->event->start_date));
+              $this->_errors[$form->html_field_name('email')] = ts("The participant %1 is already registered for %2 (%3).", array(
+                  1 => $participant_fields['email'],
+                  2 => $event_in_cart->event->title,
+                  3 => $event_in_cart->event->start_date
+                ));
             }
           }
         }
@@ -202,8 +206,8 @@ class CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices extends CRM_Event_Cart_
 
         $participant = $this->cart->get_event_in_cart_by_event_id($event_id)->get_participant_by_id($participant_id);
         if ($participant->contact_id && $contact_id != $participant->contact_id) {
-          $defaults          = array();
-          $params            = array('id' => $participant->contact_id);
+          $defaults = array();
+          $params = array('id' => $participant->contact_id);
           $temporary_contact = CRM_Contact_BAO_Contact::retrieve($params, $defaults);
 
           foreach ($this->cart->get_subparticipants($participant) as $subparticipant) {
index c433ca8e7d4ca618be37c939f3b4ea8d95076027..38b7b9c7b2f4822819f2f8648268a7d649f38cfb 100644 (file)
@@ -175,8 +175,8 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart {
 
   public function buildQuickForm() {
 
-    $this->line_items    = array();
-    $this->sub_total     = 0;
+    $this->line_items = array();
+    $this->sub_total = 0;
     $this->_price_values = $this->getValuesForPage('ParticipantsAndPrices');
 
     // iterate over each event in cart
@@ -239,7 +239,7 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart {
    * @param null $class
    */
   public function process_event_line_item(&$event_in_cart, $class = NULL) {
-    $cost         = 0;
+    $cost = 0;
     $price_set_id = CRM_Price_BAO_PriceSet::getFor("civicrm_event", $event_in_cart->event_id);
     $amount_level = NULL;
     if ($price_set_id) {
@@ -249,12 +249,12 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart {
           $event_price_values[$matches[1]] = $value;
         }
       }
-      $price_sets       = CRM_Price_BAO_PriceSet::getSetDetail($price_set_id, TRUE);
-      $price_set        = $price_sets[$price_set_id];
+      $price_sets = CRM_Price_BAO_PriceSet::getSetDetail($price_set_id, TRUE);
+      $price_set = $price_sets[$price_set_id];
       $price_set_amount = array();
       CRM_Price_BAO_PriceSet::processAmount($price_set['fields'], $event_price_values, $price_set_amount);
-      $cost            = $event_price_values['amount'];
-      $amount_level    = $event_price_values['amount_level'];
+      $cost = $event_price_values['amount'];
+      $amount_level = $event_price_values['amount_level'];
       $price_details[$price_set_id] = $price_set_amount;
     }
 
@@ -316,8 +316,8 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart {
    * @param array $params
    */
   public function emailReceipt($events_in_cart, $params) {
-    $contact_details    = CRM_Contact_BAO_Contact::getContactDetails($this->payer_contact_id);
-    $state_province     = new CRM_Core_DAO_StateProvince();
+    $contact_details = CRM_Contact_BAO_Contact::getContactDetails($this->payer_contact_id);
+    $state_province = new CRM_Core_DAO_StateProvince();
     $state_province->id = $params["billing_state_province_id-{$this->_bltID}"];
     $state_province->find();
     $state_province->fetch();
@@ -429,13 +429,13 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart {
 
     $transaction = new CRM_Core_Transaction();
     $trxnDetails = NULL;
-    $params      = $this->_submitValues;
+    $params = $this->_submitValues;
 
     $main_participants = $this->cart->get_main_event_participants();
     foreach ($main_participants as $participant) {
-      $defaults            = array();
-      $ids                 = array('contact_id' => $participant->contact_id);
-      $contact             = CRM_Contact_BAO_Contact::retrieve($ids, $defaults);
+      $defaults = array();
+      $ids = array('contact_id' => $participant->contact_id);
+      $contact = CRM_Contact_BAO_Contact::retrieve($ids, $defaults);
       $contact->is_deleted = 0;
       $contact->save();
     }
@@ -443,11 +443,11 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart {
     $trxn_prefix = 'VR';
     if (array_key_exists('billing_contact_email', $params)) {
       $this->payer_contact_id = self::find_or_create_contact($this->getContactID(), array(
-          'email' => $params['billing_contact_email'],
-          'first_name' => $params['billing_first_name'],
-          'last_name' => $params['billing_last_name'],
-          'is_deleted' => FALSE,
-        ));
+        'email' => $params['billing_contact_email'],
+        'first_name' => $params['billing_first_name'],
+        'last_name' => $params['billing_last_name'],
+        'is_deleted' => FALSE,
+      ));
 
       $ctype = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact',
         $this->payer_contact_id,
@@ -580,8 +580,8 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart {
     $payment = &CRM_Core_Payment::singleton($this->_mode, $this->_paymentProcessor, $this);
     CRM_Core_Payment_Form::mapParams($this->_bltID, $params, $params, TRUE);
     $params['month'] = $params['credit_card_exp_date']['M'];
-    $params['year']  = $params['credit_card_exp_date']['Y'];
-    $result          = &$payment->doDirectPayment($params);
+    $params['year'] = $params['credit_card_exp_date']['Y'];
+    $result = &$payment->doDirectPayment($params);
     if (is_a($result, 'CRM_Core_Error')) {
       CRM_Core_Error::displaySessionError($result);
       CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/event/cart_checkout', "_qf_Payment_display=1&qfKey={$this->controller->_key}", TRUE, NULL, FALSE));
index f67fef80769a92ed1d57466450729339bfbe4047..b483498281e476335d5c0f86f45fc52ea57bc94b 100644 (file)
@@ -25,7 +25,7 @@ class CRM_Event_Cart_Form_MerParticipant extends CRM_Core_Form {
     list(
       $custom_fields_pre,
       $custom_fields_post
-    ) = $this->get_participant_custom_data_fields($this->participant->event_id);
+      ) = $this->get_participant_custom_data_fields($this->participant->event_id);
 
     foreach ($custom_fields_pre as $key => $field) {
       CRM_Core_BAO_UFGroup::buildProfile($form, $field, CRM_Profile_Form::MODE_CREATE, $this->participant->id);
@@ -35,10 +35,10 @@ class CRM_Event_Cart_Form_MerParticipant extends CRM_Core_Form {
     }
     $custom = CRM_Utils_Array::value('custom', $form->getTemplate()->_tpl_vars, array());
     $form->assign('custom', array_merge($custom, array(
-          $this->html_field_name('customPre') => $custom_fields_pre,
-          $this->html_field_name('customPost') => $custom_fields_post,
-          $this->html_field_name('number') => $this->name(),
-        )));
+      $this->html_field_name('customPre') => $custom_fields_pre,
+      $this->html_field_name('customPost') => $custom_fields_post,
+      $this->html_field_name('number') => $this->name(),
+    )));
   }
 
   /**
index 327029bf7f7452504941e8144b78d4828fc32a86..1aabf6919a4ba5fe88210523b31f0c4f09fa6380 100644 (file)
@@ -16,7 +16,10 @@ class CRM_Event_Cart_Page_AddToCart extends CRM_Core_Page {
     $event_in_cart = $cart->add_event($this->_id);
 
     $url = CRM_Utils_System::url('civicrm/event/view_cart');
-    CRM_Utils_System::setUFMessage(ts("<b>%1</b> has been added to your cart. <a href='%2'>View your cart.</a>", array(1 => $event_in_cart->event->title, 2 => $url)));
+    CRM_Utils_System::setUFMessage(ts("<b>%1</b> has been added to your cart. <a href='%2'>View your cart.</a>", array(
+          1 => $event_in_cart->event->title,
+          2 => $url
+        )));
 
     $transaction->commit();
 
index 8b85bf6e80c1cc1fb002a04b6e0b446bf5dc944a..194f8b50fb63ae8882ab5e958d3cc73f87f6b3fd 100644 (file)
@@ -11,7 +11,11 @@ class CRM_Event_Cart_Page_CheckoutAJAX {
 
     $cart = CRM_Event_Cart_BAO_Cart::find_by_id($cart_id);
 
-    $params_array = array('cart_id' => $cart->id, 'contact_id' => CRM_Event_Cart_Form_Cart::find_or_create_contact(), 'event_id' => $event_id);
+    $params_array = array(
+      'cart_id' => $cart->id,
+      'contact_id' => CRM_Event_Cart_Form_Cart::find_or_create_contact(),
+      'event_id' => $event_id
+    );
 
     //XXX security?
     $participant = CRM_Event_Cart_BAO_MerParticipant::create($params_array);
index 72e3298a6eea148cff7700de7172f8027c4d6a03..06ea46b528bee86acd9ffaea94369d83c3de70ec 100644 (file)
@@ -6,11 +6,11 @@
 class CRM_Event_Cart_Page_RemoveFromCart extends CRM_Core_Page {
   public function run() {
     $transaction = new CRM_Core_Transaction();
-    $this->_id   = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE);
-    $cart        = CRM_Event_Cart_BAO_Cart::find_or_create_for_current_session();
+    $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE);
+    $cart = CRM_Event_Cart_BAO_Cart::find_or_create_for_current_session();
     $cart->load_associations();
-    $event_in_cart       = $cart->get_event_in_cart_by_event_id($this->_id);
-    $removed_event       = $cart->remove_event_in_cart($event_in_cart->id);
+    $event_in_cart = $cart->get_event_in_cart_by_event_id($this->_id);
+    $removed_event = $cart->remove_event_in_cart($event_in_cart->id);
     $removed_event_title = $removed_event->event->title;
     CRM_Core_Session::setStatus(ts("<b>%1</b> has been removed from your cart.", array(1 => $removed_event_title)), '', 'success');
     $transaction->commit();
index d56d42ede9f1c075d23cc86c9b715fca04bf0425..c6d58689a906c65b6239c3c90f9c216148768ffb 100644 (file)
@@ -17,8 +17,8 @@ class CRM_Event_Cart_StateMachine_Checkout extends CRM_Core_StateMachine {
       CRM_Core_Error::statusBounce(ts("You don't have any events in you cart. Please add some events."), CRM_Utils_System::url('civicrm/event'));
     }
 
-    $pages         = array();
-    $is_monetary   = FALSE;
+    $pages = array();
+    $is_monetary = FALSE;
     $is_conference = FALSE;
     foreach ($cart->events_in_carts as $event_in_cart) {
       if ($event_in_cart->event->is_monetary) {
index 91c15903c9ddb274edfcc4862f1c2c5ef570f29b..b60823435fb77343605625ef696acbf266679097 100644 (file)
@@ -35,4 +35,5 @@
  * $Id$
  *
  */
-class CRM_Event_Config extends CRM_Core_Component_Config {}
+class CRM_Event_Config extends CRM_Core_Component_Config {
+}
index 477b056e3201f715389ecfaf7817d17e54754999..e5628f00e75cbbdc7ac8455fa3ddc22274c19037 100644 (file)
@@ -184,12 +184,12 @@ class CRM_Event_Form_EventFees {
     if ($priceSetId) {
       // get price set default values, CRM-4090
       if (in_array(get_class($form),
-          array(
-            'CRM_Event_Form_Participant',
-            'CRM_Event_Form_Registration_Register',
-            'CRM_Event_Form_Registration_AdditionalParticipant',
-          )
-        )) {
+        array(
+          'CRM_Event_Form_Participant',
+          'CRM_Event_Form_Registration_Register',
+          'CRM_Event_Form_Registration_AdditionalParticipant',
+        )
+      )) {
         $priceSetValues = self::setDefaultPriceSet($form->_pId, $form->_eventId);
         if (!empty($priceSetValues)) {
           $defaults[$form->_pId] = array_merge($defaults[$form->_pId], $priceSetValues);
@@ -234,7 +234,13 @@ class CRM_Event_Form_EventFees {
       $contribution = new CRM_Contribute_DAO_Contribution();
       $contribution->id = $contriId;
       $contribution->find(TRUE);
-      foreach (array('financial_type_id', 'payment_instrument_id', 'contribution_status_id', 'receive_date', 'total_amount') as $f) {
+      foreach (array(
+                 'financial_type_id',
+                 'payment_instrument_id',
+                 'contribution_status_id',
+                 'receive_date',
+                 'total_amount'
+               ) as $f) {
         if ($f == 'receive_date') {
           list($defaults[$form->_pId]['receive_date']) = CRM_Utils_Date::setDateDefaults($contribution->$f);
         }
@@ -356,8 +362,9 @@ SELECT  id, html_type
 
     if ($form->_pId) {
       if (CRM_Core_DAO::getFieldValue('CRM_Event_DAO_ParticipantPayment',
-          $form->_pId, 'contribution_id', 'participant_id'
-        )) {
+        $form->_pId, 'contribution_id', 'participant_id'
+      )
+      ) {
         $form->_online = TRUE;
       }
     }
@@ -394,7 +401,8 @@ SELECT  id, html_type
         $element = $form->add('select', 'discount_id',
           ts('Discount Set'),
           array(
-            0 => ts('- select -')) + $discounts,
+            0 => ts('- select -')
+          ) + $discounts,
           FALSE,
           array('onchange' => "buildFeeBlock( {$form->_eventId}, this.value );")
         );
@@ -484,7 +492,7 @@ SELECT  id, html_type
       if ($form->_contactId) {
         list($form->_contributorDisplayName,
           $form->_contributorEmail
-        ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($form->_contactId);
+          ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($form->_contactId);
         $form->assign('email', $form->_contributorEmail);
       }
       else {
index 7e1e55a5c0fbb5654cdc891ef28ee43c43d85d34..53644e22878f1e9a27b35afaaa9a2e49b4d9f913 100644 (file)
@@ -206,18 +206,22 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
         $this->_doneUrl = CRM_Utils_System::url('civicrm/event/manage',
           'reset=1'
         );
-        $breadCrumb = array(array(
-        'title' => ts('Manage Events'),
+        $breadCrumb = array(
+          array(
+            'title' => ts('Manage Events'),
             'url' => $this->_doneUrl,
-          ));
+          )
+        );
       }
     }
     else {
       $this->_doneUrl = CRM_Utils_System::url('civicrm/admin/eventTemplate', 'reset=1');
-      $breadCrumb = array(array(
-      'title' => ts('Manage Event Templates'),
+      $breadCrumb = array(
+        array(
+          'title' => ts('Manage Event Templates'),
           'url' => $this->_doneUrl,
-        ));
+        )
+      );
     }
     CRM_Utils_System::appendBreadCrumb($breadCrumb);
   }
@@ -351,8 +355,8 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
       }
 
       CRM_Core_Session::setStatus(ts("'%1' information has been saved.",
-          array(1 => CRM_Utils_Array::value('title', CRM_Utils_Array::value($subPage, $this->get('tabHeader')), $className))
-        ), ts('Saved'), 'success');
+        array(1 => CRM_Utils_Array::value('title', CRM_Utils_Array::value($subPage, $this->get('tabHeader')), $className))
+      ), ts('Saved'), 'success');
 
       $config = CRM_Core_Config::singleton();
       if (in_array('CiviCampaign', $config->enableComponents)) {
@@ -366,7 +370,8 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
       $this->postProcessHook();
       if ($this->controller->getButtonName('submit') == "_qf_{$className}_upload_done") {
         if ($this->_isTemplate) {
-          CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url('civicrm/admin/eventTemplate', 'reset=1'));
+          CRM_Core_Session::singleton()
+            ->pushUserContext(CRM_Utils_System::url('civicrm/admin/eventTemplate', 'reset=1'));
         }
         else {
           CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url('civicrm/event/manage', 'reset=1'));
@@ -374,8 +379,8 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
       }
       else {
         CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url("civicrm/event/manage/{$subPage}",
-            "action=update&reset=1&id={$this->_id}"
-          ));
+          "action=update&reset=1&id={$this->_id}"
+        ));
       }
     }
   }
index ad967dbea79663fc2e787eedf152e66f1c3c701e..a1ba39b20e25264f4985751c7a0dc8854938c613 100644 (file)
@@ -54,8 +54,8 @@ class CRM_Event_Form_ManageEvent_Conference extends CRM_Event_Form_ManageEvent {
   public function setDefaultValues() {
     $parentDefaults = parent::setDefaultValues();
 
-    $eventId  = $this->_id;
-    $params   = array();
+    $eventId = $this->_id;
+    $params = array();
     $defaults = array();
     if (isset($eventId)) {
       $params = array('id' => $eventId);
@@ -81,7 +81,8 @@ class CRM_Event_Form_ManageEvent_Conference extends CRM_Event_Form_ManageEvent {
       'slot_label_id',
       ts('Conference Slot'),
       array(
-        '' => ts('- select -')) + $slots,
+        '' => ts('- select -')
+      ) + $slots,
       FALSE
     );
 
index f18783abdec083eac60d87f6586eef1687073b38..2507a7cc84012aa4607d59aa0176c43b03f21865 100644 (file)
@@ -99,8 +99,8 @@ class CRM_Event_Form_ManageEvent_Delete extends CRM_Event_Form_ManageEvent {
     if ($participant->find()) {
       $searchURL = CRM_Utils_System::url('civicrm/event/search', 'reset=1');
       CRM_Core_Session::setStatus(ts('This event cannot be deleted because there are participant records linked to it. If you want to delete this event, you must first find the participants linked to this event and delete them. You can use use <a href=\'%1\'> CiviEvent >> Find Participants page </a>.',
-          array(1 => $searchURL)
-        ), ts('Deletion Error'), 'error');
+        array(1 => $searchURL)
+      ), ts('Deletion Error'), 'error');
       return;
     }
     CRM_Event_BAO_Event::del($this->_id);
index 74b04386cd173974132c214917d28c86bebc79a1..86a0bc70c612865523ebc60d4ae0443778ba7fdf 100644 (file)
@@ -324,8 +324,8 @@ class CRM_Event_Form_ManageEvent_EventInfo extends CRM_Event_Form_ManageEvent {
         $url = 'civicrm/event/manage';
         $urlParams = 'reset=1';
         CRM_Core_Session::setStatus(ts("'%1' information has been saved.",
-            array(1 => $this->getTitle())
-          ), ts('Saved'), 'success');
+          array(1 => $this->getTitle())
+        ), ts('Saved'), 'success');
       }
 
       CRM_Utils_System::redirect(CRM_Utils_System::url($url, $urlParams));
@@ -360,8 +360,8 @@ class CRM_Event_Form_ManageEvent_EventInfo extends CRM_Event_Form_ManageEvent {
     }
 
     // pull template custom data as a default for event, CRM-5596
-    $groupTree    = CRM_Core_BAO_CustomGroup::getTree($this->_type, $this, $templateId, NULL, $this->_subType);
-    $groupTree    = CRM_Core_BAO_CustomGroup::formatGroupTree($groupTree, $this->_groupCount, $this);
+    $groupTree = CRM_Core_BAO_CustomGroup::getTree($this->_type, $this, $templateId, NULL, $this->_subType);
+    $groupTree = CRM_Core_BAO_CustomGroup::formatGroupTree($groupTree, $this->_groupCount, $this);
     $customValues = array();
     CRM_Core_BAO_CustomGroup::setDefaults($groupTree, $customValues);
     foreach ($customValues as $key => $val) {
index 1685248f2ad5380d60126e8c1a9ed930bc7a5d10..4e25a57bb5a77ab278b93166c25b7d67526f18db 100644 (file)
@@ -78,8 +78,8 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
   public function setDefaultValues() {
     $parentDefaults = parent::setDefaultValues();
 
-    $eventId  = $this->_id;
-    $params   = array();
+    $eventId = $this->_id;
+    $params = array();
     $defaults = array();
     if (isset($eventId)) {
       $params = array('id' => $eventId);
@@ -130,10 +130,10 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
 
         list($defaults["discount_start_date[$i]"]) = CRM_Utils_Date::setDateDefaults(CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Discount', $optionGroupId,
           'start_date', 'price_set_id'
-          ));
+        ));
         list($defaults["discount_end_date[$i]"]) = CRM_Utils_Date::setDateDefaults(CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Discount', $optionGroupId,
           'end_date', 'price_set_id'
-          ));
+        ));
         $defaultDiscounts[] = CRM_Price_BAO_PriceSet::getSetDetail($optionGroupId);
         $i++;
       }
@@ -241,7 +241,7 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
     if (!empty($defaults['payment_processor'])) {
       $defaults['payment_processor'] = array_fill_keys(explode(CRM_Core_DAO::VALUE_SEPARATOR,
         $defaults['payment_processor']
-        ), '1');
+      ), '1');
     }
     return $defaults;
   }
@@ -297,7 +297,8 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
     }
     $this->add('select', 'price_set_id', ts('Price Set'),
       array(
-        '' => ts('- none -')) + $price,
+        '' => ts('- none -')
+      ) + $price,
       NULL, array('onchange' => "return showHideByValue('price_set_id', '', 'map-field', 'block', 'select', false);")
     );
     $default = array($this->createElement('radio', NULL, NULL, NULL, 0));
@@ -414,8 +415,8 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
   public static function formRule($values) {
     $errors = array();
     if (!empty($values['is_discount'])) {
-      $occurDiscount   = array_count_values($values['discount_name']);
-      $countemptyrows  = 0;
+      $occurDiscount = array_count_values($values['discount_name']);
+      $countemptyrows = 0;
       $countemptyvalue = 0;
       for ($i = 1; $i <= self::NUM_DISCOUNT; $i++) {
         $start_date = $end_date = NULL;
@@ -556,7 +557,7 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
    */
   public function postProcess() {
     $eventTitle = '';
-    $params     = $this->exportValues();
+    $params = $this->exportValues();
 
     $this->set('discountSection', 0);
 
@@ -605,15 +606,15 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
       }
       else {
         // if there are label / values, create custom options for them
-        $labels  = CRM_Utils_Array::value('label', $params);
-        $values  = CRM_Utils_Array::value('value', $params);
+        $labels = CRM_Utils_Array::value('label', $params);
+        $values = CRM_Utils_Array::value('value', $params);
         $default = CRM_Utils_Array::value('default', $params);
         $options = array();
         if (!CRM_Utils_System::isNull($labels) && !CRM_Utils_System::isNull($values)) {
           for ($i = 1; $i < self::NUM_OPTION; $i++) {
             if (!empty($labels[$i]) && !CRM_Utils_System::isNull($values[$i])) {
               $options[] = array(
-              'label' => trim($labels[$i]),
+                'label' => trim($labels[$i]),
                 'value' => CRM_Utils_Rule::cleanMoney(trim($values[$i])),
                 'weight' => $i,
                 'is_active' => 1,
@@ -678,12 +679,12 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
         }
 
         $discountPriceSets = !empty($this->_defaultValues['discount_price_set']) ? $this->_defaultValues['discount_price_set'] : array();
-        $discountFieldIDs  = !empty($this->_defaultValues['discount_option_id']) ? $this->_defaultValues['discount_option_id'] : array();
+        $discountFieldIDs = !empty($this->_defaultValues['discount_option_id']) ? $this->_defaultValues['discount_option_id'] : array();
         if (CRM_Utils_Array::value('is_discount', $params) == 1) {
           // if there are discounted set of label / values,
           // create custom options for them
-          $labels  = CRM_Utils_Array::value('discounted_label', $params);
-          $values  = CRM_Utils_Array::value('discounted_value', $params);
+          $labels = CRM_Utils_Array::value('discounted_label', $params);
+          $values = CRM_Utils_Array::value('discounted_value', $params);
           $default = CRM_Utils_Array::value('discounted_default', $params);
 
           if (!CRM_Utils_System::isNull($labels) && !CRM_Utils_System::isNull($values)) {
@@ -774,7 +775,7 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
                   'price_set_id' => $priceSetID,
                   'start_date' => CRM_Utils_Date::processDate($params['discount_start_date'][$j]),
                   'end_date' => CRM_Utils_Date::processDate($params['discount_end_date'][$j]),
-                  );
+                );
                 CRM_Core_BAO_Discount::add($discountParams);
               }
             }
index ceb4cb239d5118e6acc40074825d356fb210b99b..25588f5cb2bf1077fb1c5c8b3fa86e6c536e25e3 100644 (file)
@@ -198,7 +198,7 @@ class CRM_Event_Form_ManageEvent_Location extends CRM_Event_Form_ManageEvent {
     if (!empty($locationEvents)) {
       $this->assign('locEvents', TRUE);
       $optionTypes = array(
-      '1' => ts('Create new location'),
+        '1' => ts('Create new location'),
         '2' => ts('Use existing location'),
       );
 
@@ -206,7 +206,8 @@ class CRM_Event_Form_ManageEvent_Location extends CRM_Event_Form_ManageEvent {
 
       if (!isset($locationEvents[$this->_oldLocBlockId]) || (!$this->_oldLocBlockId)) {
         $locationEvents = array(
-          '' => ts('- select -')) + $locationEvents;
+            '' => ts('- select -')
+          ) + $locationEvents;
       }
       $this->add('select', 'loc_event_id', ts('Use Location'), $locationEvents);
     }
@@ -258,7 +259,10 @@ class CRM_Event_Form_ManageEvent_Location extends CRM_Event_Form_ManageEvent {
 
     $defaultLocationType = CRM_Core_BAO_LocationType::getDefault();
     foreach (array(
-      'address', 'phone', 'email') as $block) {
+               'address',
+               'phone',
+               'email'
+             ) as $block) {
       if (empty($params[$block]) || !is_array($params[$block])) {
         continue;
       }
index 010168182b3c3ee59c5a57dad91d8470cd5b3f26..7714a34d6dccb82a24c5a5caa1e20c4f55c9f031 100644 (file)
@@ -116,7 +116,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
 
       list($defaults['custom_pre_id'],
         $defaults['custom_post']
-      ) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
+        ) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
 
       // Get the id for the event registration profile
       $eventRegistrationIdParams = $eventRegistrationIdDefaults = array(
@@ -154,7 +154,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
 
         list($defaults['additional_custom_pre_id'],
           $defaults['additional_custom_post']
-        ) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinAddParams);
+          ) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinAddParams);
 
         if (isset($defaults['additional_custom_post']) && is_numeric($defaults['additional_custom_post'])) {
           $defaults['additional_custom_post_id'] = $defaults['additional_custom_post'];
@@ -185,7 +185,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
     if (!empty($defaults['registration_start_date'])) {
       list($defaults['registration_start_date'],
         $defaults['registration_start_date_time']
-      ) = CRM_Utils_Date::setDateDefaults($defaults['registration_start_date'],
+        ) = CRM_Utils_Date::setDateDefaults($defaults['registration_start_date'],
         'activityDateTime'
       );
     }
@@ -193,7 +193,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
     if (!empty($defaults['registration_end_date'])) {
       list($defaults['registration_end_date'],
         $defaults['registration_end_date_time']
-      ) = CRM_Utils_Date::setDateDefaults($defaults['registration_end_date'],
+        ) = CRM_Utils_Date::setDateDefaults($defaults['registration_end_date'],
         'activityDateTime'
       );
     }
@@ -265,7 +265,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
     }
 
     $params = array(
-      'used'         => 'Supervised',
+      'used' => 'Supervised',
       'contact_type' => 'Individual',
     );
     $dedupeRuleFields = CRM_Dedupe_BAO_Rule::dedupeRuleFields($params);
@@ -375,19 +375,26 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
       'profileEntities' => array(),
     );
 
-    $configs['allowCoreTypes'] = array_merge(array('Contact', 'Individual'), CRM_Contact_BAO_ContactType::subTypes('Individual'));
+    $configs['allowCoreTypes'] = array_merge(array(
+        'Contact',
+        'Individual'
+      ), CRM_Contact_BAO_ContactType::subTypes('Individual'));
     $configs['allowCoreTypes'][] = 'Participant';
     //CRM-15427
     $id = CRM_Utils_Request::retrieve('id', 'Integer');
     if ($id) {
       $participantEventType = CRM_Core_DAO::getFieldValue("CRM_Event_DAO_Event", $id, 'event_type_id', 'id');
-      $participantRole  = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $id, 'default_role_id');
+      $participantRole = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $id, 'default_role_id');
       $configs['allowSubTypes']['ParticipantEventName'] = array($id);
       $configs['allowSubTypes']['ParticipantEventType'] = array($participantEventType);
       $configs['allowSubTypes']['ParticipantRole'] = array($participantRole);
     }
     $configs['profileEntities'][] = array('entity_name' => 'contact_1', 'entity_type' => 'IndividualModel');
-    $configs['profileEntities'][] = array('entity_name' => 'participant_1', 'entity_type' => 'ParticipantModel', 'entity_sub_type' => '*');
+    $configs['profileEntities'][] = array(
+      'entity_name' => 'participant_1',
+      'entity_type' => 'ParticipantModel',
+      'entity_sub_type' => '*'
+    );
 
     return $configs;
   }
@@ -507,7 +514,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
         isset($values['registration_end_date'])
       ) {
         $start = CRM_Utils_Date::processDate($values['registration_start_date']);
-        $end   = CRM_Utils_Date::processDate($values['registration_end_date']);
+        $end = CRM_Utils_Date::processDate($values['registration_end_date']);
         if ($end < $start) {
           $errorMsg['registration_end_date'] = ts('Registration end date should be after Registration start date');
         }
@@ -903,7 +910,8 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
           $ufAdd[1] = $params['custom_pre_id'];
           $wtAdd = 1;
         }
-        elseif (CRM_Utils_Array::value('additional_custom_pre_id', $params) == 'none') {}
+        elseif (CRM_Utils_Array::value('additional_custom_pre_id', $params) == 'none') {
+        }
         else {
           $ufAdd[1] = $params['additional_custom_pre_id'];
           $wtAdd = 1;
@@ -914,7 +922,8 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
         if (empty($params['additional_custom_post_id'])) {
           $ufAdd[2] = $params['custom_post_id'];
         }
-        elseif (CRM_Utils_Array::value('additional_custom_post_id', $params) == 'none') {}
+        elseif (CRM_Utils_Array::value('additional_custom_post_id', $params) == 'none') {
+        }
         else {
           $ufAdd[2] = $params['additional_custom_post_id'];
         }
index d6f7ee2370230e151cbfd3b2f7cf92daf28d036a..b4188553481743c9d5481a27e4ab674ccf154f7e 100644 (file)
@@ -33,8 +33,8 @@ class CRM_Event_Form_ManageEvent_Repeat extends CRM_Event_Form_ManageEvent {
     //If this ID has parent, send parent id
     if ($checkParentExistsForThisId) {
       /**
-     * Get connected event information list
-     */
+       * Get connected event information list
+       */
       //Get all connected event ids
       $allEventIdsArray = CRM_Core_BAO_RecurringEntity::getEntitiesForParent($checkParentExistsForThisId, 'civicrm_event');
       $allEventIds = array();
@@ -114,36 +114,36 @@ class CRM_Event_Form_ManageEvent_Repeat extends CRM_Event_Form_ManageEvent {
 
       $linkedEntities = array(
         array(
-          'table'         => 'civicrm_price_set_entity',
-          'findCriteria'  => array(
-            'entity_id'    => $this->_id,
+          'table' => 'civicrm_price_set_entity',
+          'findCriteria' => array(
+            'entity_id' => $this->_id,
             'entity_table' => 'civicrm_event',
           ),
           'linkedColumns' => array('entity_id'),
           'isRecurringEntityRecord' => FALSE,
         ),
         array(
-          'table'         => 'civicrm_uf_join',
-          'findCriteria'  => array(
-            'entity_id'    => $this->_id,
+          'table' => 'civicrm_uf_join',
+          'findCriteria' => array(
+            'entity_id' => $this->_id,
             'entity_table' => 'civicrm_event',
           ),
           'linkedColumns' => array('entity_id'),
           'isRecurringEntityRecord' => FALSE,
         ),
         array(
-          'table'         => 'civicrm_tell_friend',
-          'findCriteria'  => array(
-            'entity_id'    => $this->_id,
+          'table' => 'civicrm_tell_friend',
+          'findCriteria' => array(
+            'entity_id' => $this->_id,
             'entity_table' => 'civicrm_event',
           ),
           'linkedColumns' => array('entity_id'),
           'isRecurringEntityRecord' => TRUE,
         ),
         array(
-          'table'         => 'civicrm_pcp_block',
-          'findCriteria'  => array(
-            'entity_id'    => $this->_id,
+          'table' => 'civicrm_pcp_block',
+          'findCriteria' => array(
+            'entity_id' => $this->_id,
             'entity_table' => 'civicrm_event',
           ),
           'linkedColumns' => array('entity_id'),
@@ -171,7 +171,7 @@ class CRM_Event_Form_ManageEvent_Repeat extends CRM_Event_Form_ManageEvent {
    */
   static public function getParticipantCountforEvent($listOfRelatedEntities = array()) {
     if (!empty($listOfRelatedEntities)) {
-      $implodeRelatedEntities = implode(',', array_map(function($entity) {
+      $implodeRelatedEntities = implode(',', array_map(function ($entity) {
         return $entity['id'];
       }, $listOfRelatedEntities));
       if ($implodeRelatedEntities) {
index edd9177eea298eef38c5d7815a5e49392580c2df..54198ece0aa669e990b3846de67394c10b41e8b7 100644 (file)
@@ -53,9 +53,10 @@ class CRM_Event_Form_ManageEvent_TabHeader {
     CRM_Core_Resources::singleton()
       ->addScriptFile('civicrm', 'templates/CRM/common/TabHeader.js', 1, 'html-header')
       ->addSetting(array(
-    'tabSettings' => array(
-        'active' => self::getCurrentTab($tabs),
-      )));
+        'tabSettings' => array(
+          'active' => self::getCurrentTab($tabs),
+        )
+      ));
     CRM_Event_Form_ManageEvent::addProfileEditScripts();
     return $tabs;
   }
@@ -148,9 +149,9 @@ WHERE      e.id = %1
     CRM_Utils_Hook::tabset('civicrm/event/manage', $tabs,
       array('event_id' => $eventID));
 
-    $fullName  = $form->getVar('_name');
+    $fullName = $form->getVar('_name');
     $className = CRM_Utils_String::getClassName($fullName);
-    $new       = '';
+    $new = '';
 
     // hack for special cases.
     switch ($className) {
index 4a247eca19145bd84558709d2416cf0342d216ff..a750a125321f58ebc5fab58697e634a2f69e0167 100644 (file)
@@ -200,9 +200,9 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
     $this->assign('feeBlockPaid', FALSE);
 
     $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
-    $this->_mode      = CRM_Utils_Request::retrieve('mode', 'String', $this);
-    $this->_eID       = CRM_Utils_Request::retrieve('eid', 'Positive', $this);
-    $this->_context   = CRM_Utils_Request::retrieve('context', 'String', $this);
+    $this->_mode = CRM_Utils_Request::retrieve('mode', 'String', $this);
+    $this->_eID = CRM_Utils_Request::retrieve('eid', 'Positive', $this);
+    $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $this->assign('context', $this->_context);
 
     if ($this->_contactId) {
@@ -220,7 +220,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
     if (
       strpos($path, 'civicrm/contact/search') === 0 ||
       strpos($path, 'civicrm/group/search') === 0
-      ) {
+    ) {
       $this->_id = NULL;
     }
     else {
@@ -286,18 +286,20 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
       $this->_single = TRUE;
       $this->assign('urlPath', 'civicrm/contact/view/participant');
       if (!$this->_id && !$this->_contactId) {
-        $breadCrumbs = array(array(
-        'title' => ts('CiviEvent Dashboard'),
+        $breadCrumbs = array(
+          array(
+            'title' => ts('CiviEvent Dashboard'),
             'url' => CRM_Utils_System::url('civicrm/event', 'reset=1'),
-          ));
+          )
+        );
 
         CRM_Utils_System::appendBreadCrumb($breadCrumbs);
       }
     }
     else {
       //set the appropriate action
-      $context       = $this->get('context');
-      $urlString     = 'civicrm/contact/search';
+      $context = $this->get('context');
+      $urlString = 'civicrm/contact/search';
       $this->_action = CRM_Core_Action::BASIC;
       switch ($context) {
         case 'advanced':
@@ -530,7 +532,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
 
     list($defaults[$this->_id]['register_date'],
       $defaults[$this->_id]['register_date_time']
-    ) = CRM_Utils_Date::setDateDefaults(
+      ) = CRM_Utils_Date::setDateDefaults(
       CRM_Utils_Array::value('register_date', $defaults[$this->_id]), 'activityDateTime'
     );
 
@@ -614,7 +616,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
           )) - 1;
         if ($additionalParticipant) {
           $deleteParticipants = array(
-          1 => ts('Delete this participant record along with associated participant record(s).'),
+            1 => ts('Delete this participant record along with associated participant record(s).'),
             2 => ts('Delete only this participant record.'),
           );
           $this->addRadio('delete_participant', NULL, $deleteParticipants, NULL, '<br />');
@@ -639,7 +641,10 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
     }
 
     if ($this->_single && $this->_context == 'standalone') {
-      $this->addEntityRef('contact_id', ts('Contact'), array('create' => TRUE, 'api' => array('extra' => array('email'))), TRUE);
+      $this->addEntityRef('contact_id', ts('Contact'), array(
+          'create' => TRUE,
+          'api' => array('extra' => array('email'))
+        ), TRUE);
     }
 
     $eventFieldParams = array(
@@ -661,8 +666,9 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
     //frozen the field fix for CRM-4171
     if ($this->_action & CRM_Core_Action::UPDATE && $this->_id) {
       if (CRM_Core_DAO::getFieldValue('CRM_Event_DAO_ParticipantPayment',
-          $this->_id, 'contribution_id', 'participant_id'
-        )) {
+        $this->_id, 'contribution_id', 'participant_id'
+      )
+      ) {
         $element->freeze();
       }
     }
@@ -698,7 +704,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
       );
       $checkCancelledJs = array(
         'onchange' =>
-        "checkCancelled( this.value, {$cancelledparticipantStatusId},{$cancelledContributionStatusId});",
+          "checkCancelled( this.value, {$cancelledparticipantStatusId},{$cancelledContributionStatusId});",
       );
 
       $participantStatusId = array_search('Pending from pay later',
@@ -734,7 +740,10 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
       }
     }
 
-    $this->addSelect('status_id', $checkCancelledJs + array('options' => $statusOptions, 'option_url' => 'civicrm/admin/participant_status'), TRUE);
+    $this->addSelect('status_id', $checkCancelledJs + array(
+        'options' => $statusOptions,
+        'option_url' => 'civicrm/admin/participant_status'
+      ), TRUE);
 
     $this->addElement('checkbox', 'is_notify', ts('Send Notification'), NULL);
 
@@ -996,7 +1005,8 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
         $params['fee_level'] = $params['amount_level'];
         $contributionParams['total_amount'] = $params['amount'];
         if ($this->_quickConfig && !empty($params['total_amount']) &&
-          $params['status_id'] != array_search('Partially paid', $participantStatus)) {
+          $params['status_id'] != array_search('Partially paid', $participantStatus)
+        ) {
           $params['fee_amount'] = $params['total_amount'];
         }
         else {
@@ -1009,8 +1019,8 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
         if (!empty($lineItem[0])) {
           $this->set('lineItem', $lineItem);
 
-          $this->_lineItem  = $lineItem;
-          $lineItem         = array_merge($lineItem, $additionalParticipantDetails);
+          $this->_lineItem = $lineItem;
+          $lineItem = array_merge($lineItem, $additionalParticipantDetails);
 
           $participantCount = array();
           foreach ($lineItem as $k) {
@@ -1051,7 +1061,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
     $userID = $session->get('userID');
     list($userName,
       $userEmail
-    ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($userID);
+      ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($userID);
 
     if ($this->_contactId) {
       list($this->_contributorDisplayName, $this->_contributorEmail, $this->_toDoNotEmail) = CRM_Contact_BAO_Contact::getContactDetails($this->_contactId);
@@ -1078,7 +1088,10 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
 
       // set source if not set
       if (empty($params['source'])) {
-        $this->_params['participant_source'] = ts('Offline Registration for Event: %2 by: %1', array(1 => $userName, 2 => $eventTitle));
+        $this->_params['participant_source'] = ts('Offline Registration for Event: %2 by: %1', array(
+            1 => $userName,
+            2 => $eventTitle
+          ));
       }
       else {
         $this->_params['participant_source'] = $params['source'];
@@ -1192,8 +1205,8 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
       if (is_a($result, 'CRM_Core_Error')) {
         CRM_Core_Error::displaySessionError($result);
         CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contact/view/participant',
-            "reset=1&action=add&cid={$this->_contactId}&context=participant&mode={$this->_mode}"
-          ));
+          "reset=1&action=add&cid={$this->_contactId}&context=participant&mode={$this->_mode}"
+        ));
       }
 
       if ($result) {
@@ -1308,7 +1321,10 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
         //build contribution params
         if (!$this->_onlinePendingContributionId) {
           if (empty($params['source'])) {
-            $contributionParams['source'] = ts('%1 : Offline registration (by %2)', array(1 => $eventTitle, 2 => $userName));
+            $contributionParams['source'] = ts('%1 : Offline registration (by %2)', array(
+                1 => $eventTitle,
+                2 => $userName
+              ));
           }
           else {
             $contributionParams['source'] = $params['source'];
@@ -1319,10 +1335,15 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
         $contributionParams['non_deductible_amount'] = 'null';
         $contributionParams['receipt_date'] = !empty($params['send_receipt']) ? CRM_Utils_Array::value('receive_date', $params) : 'null';
 
-        $recordContribution = array('contact_id', 'financial_type_id',
-          'payment_instrument_id', 'trxn_id',
-          'contribution_status_id', 'receive_date',
-          'check_number', 'campaign_id',
+        $recordContribution = array(
+          'contact_id',
+          'financial_type_id',
+          'payment_instrument_id',
+          'trxn_id',
+          'contribution_status_id',
+          'receive_date',
+          'check_number',
+          'campaign_id',
         );
 
         foreach ($recordContribution as $f) {
@@ -1442,7 +1463,8 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
     $updateStatusMsg = NULL;
     //send mail when participant status changed, CRM-4326
     if ($this->_id && $this->_statusId &&
-      $this->_statusId != CRM_Utils_Array::value('status_id', $params) && !empty($params['is_notify'])) {
+      $this->_statusId != CRM_Utils_Array::value('status_id', $params) && !empty($params['is_notify'])
+    ) {
 
       $updateStatusMsg = CRM_Event_BAO_Participant::updateStatusMessage($this->_id,
         $params['status_id'],
@@ -1672,8 +1694,8 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
         $template = CRM_Core_Smarty::singleton();
         $taxAmt = $template->get_template_vars('dataArray');
         $contributionId = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_ParticipantPayment',
-                                                      $this->_id, 'contribution_id', 'participant_id'
-                                                      );
+          $this->_id, 'contribution_id', 'participant_id'
+        );
         $prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
         $invoicing = CRM_Utils_Array::value('invoicing', $prefixValue);
         if (count($taxAmt) > 0 && (isset($invoicing) && isset($prefixValue['is_email_pdf']))) {
@@ -1745,14 +1767,14 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
       }
       else {
         $session->replaceUserContext(CRM_Utils_System::url('civicrm/contact/view',
-            "reset=1&cid={$this->_contactId}&selectedChild=participant"
-          ));
+          "reset=1&cid={$this->_contactId}&selectedChild=participant"
+        ));
       }
     }
     elseif ($buttonName == $this->getButtonName('upload', 'new')) {
       $session->replaceUserContext(CRM_Utils_System::url('civicrm/contact/view/participant',
-          "reset=1&action=add&context={$this->_context}&cid={$this->_contactId}"
-        ));
+        "reset=1&action=add&context={$this->_context}&cid={$this->_contactId}"
+      ));
     }
   }
 }
index 44eafbc624e8479c7703ae26207b789751da7c19..0e0be7404a44abc0027feee6f66d0cac0d1182b3 100644 (file)
@@ -181,7 +181,8 @@ class CRM_Event_Form_ParticipantFeeSelection extends CRM_Core_Form {
     $statusOptions = CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label');
     $this->add('select', 'status_id', ts('Participant Status'),
       array(
-        '' => ts('- select -')) + $statusOptions,
+        '' => ts('- select -')
+      ) + $statusOptions,
       TRUE
     );
 
@@ -265,8 +266,8 @@ class CRM_Event_Form_ParticipantFeeSelection extends CRM_Core_Form {
     if ($buttonName == $this->getButtonName('upload', 'new')) {
       $session = CRM_Core_Session::singleton();
       $session->pushUserContext(CRM_Utils_System::url('civicrm/payment/add',
-          "reset=1&action=add&component=event&id={$this->_participantId}&cid={$this->_contactId}"
-        ));
+        "reset=1&action=add&component=event&id={$this->_participantId}&cid={$this->_contactId}"
+      ));
     }
   }
 
index 43510502fe32e7e3f4a70358c165bc6492fc9fa3..e14f071acb374610a100bb2dd3db138b590f3635 100644 (file)
@@ -47,10 +47,10 @@ class CRM_Event_Form_ParticipantView extends CRM_Core_Form {
    * @return void
    */
   public function preProcess() {
-    $values        = $ids = array();
+    $values = $ids = array();
     $participantID = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE);
-    $contactID     = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
-    $params        = array('id' => $participantID);
+    $contactID = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
+    $params = array('id' => $participantID);
 
     CRM_Event_BAO_Participant::getValues($params,
       $values,
@@ -76,8 +76,9 @@ class CRM_Event_Form_ParticipantView extends CRM_Core_Form {
     $this->assign('hasPayment', $paymentId);
 
     if ($parentParticipantId = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Participant',
-          $participantID, 'registered_by_id'
-      )) {
+      $participantID, 'registered_by_id'
+    )
+    ) {
       $parentHasPayment = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_ParticipantPayment',
         $parentParticipantId, 'id', 'participant_id'
       );
@@ -132,11 +133,11 @@ class CRM_Event_Form_ParticipantView extends CRM_Core_Form {
       $eventGroupTree = &CRM_Core_BAO_CustomGroup::getTree('Participant', $this, $participantID, NULL,
         $values[$participantID]['event_id'], $eventNameCustomDataTypeID
       );
-      $eventTypeID        = CRM_Core_DAO::getFieldValue("CRM_Event_DAO_Event", $values[$participantID]['event_id'], 'event_type_id', 'id');
+      $eventTypeID = CRM_Core_DAO::getFieldValue("CRM_Event_DAO_Event", $values[$participantID]['event_id'], 'event_type_id', 'id');
       $eventTypeGroupTree = CRM_Core_BAO_CustomGroup::getTree('Participant', $this, $participantID, NULL, $eventTypeID, $eventTypeCustomDataTypeID);
-      $groupTree          = CRM_Utils_Array::crmArrayMerge($roleGroupTree, $eventGroupTree);
-      $groupTree          = CRM_Utils_Array::crmArrayMerge($groupTree, $eventTypeGroupTree);
-      $groupTree          = CRM_Utils_Array::crmArrayMerge($groupTree, CRM_Core_BAO_CustomGroup::getTree('Participant', $this, $participantID));
+      $groupTree = CRM_Utils_Array::crmArrayMerge($roleGroupTree, $eventGroupTree);
+      $groupTree = CRM_Utils_Array::crmArrayMerge($groupTree, $eventTypeGroupTree);
+      $groupTree = CRM_Utils_Array::crmArrayMerge($groupTree, CRM_Core_BAO_CustomGroup::getTree('Participant', $this, $participantID));
       foreach ($groupTree as $treeId => $trees) {
         $finalTree[$treeId] = $trees;
       }
index d901357cf488c16a8f36f7479e2d02fb44c9479a..e58bfb6c5d8d7cd54eff5592ee9aafa7962b13ef 100644 (file)
@@ -346,7 +346,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
       );
       list($this->_values['custom_pre_id'],
         $this->_values['custom_post_id']
-      ) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
+        ) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
 
       // set profiles for additional participants
       if ($this->_values['event']['is_multiple_registrations']) {
@@ -355,7 +355,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
 
         list($this->_values['additional_custom_pre_id'],
           $this->_values['additional_custom_post_id'], $preActive, $postActive
-        ) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
+          ) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
 
         // CRM-4377: we need to maintain backward compatibility, hence if there is profile for main contact
         // set same profile for additional contacts.
@@ -429,8 +429,8 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
     // Handle PCP
     $pcpId = CRM_Utils_Request::retrieve('pcpId', 'Positive', $this);
     if ($pcpId) {
-      $pcp             = CRM_PCP_BAO_PCP::handlePcp($pcpId, 'event', $this->_values['event']);
-      $this->_pcpId    = $pcp['pcpId'];
+      $pcp = CRM_PCP_BAO_PCP::handlePcp($pcpId, 'event', $this->_values['event']);
+      $this->_pcpId = $pcp['pcpId'];
       $this->_values['event']['intro_text'] = CRM_Utils_Array::value('intro_text', $pcp['pcpInfo']);
     }
 
@@ -485,8 +485,12 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
     $this->set('name', $name);
 
     $vars = array(
-      'amount', 'currencyID', 'credit_card_type',
-      'trxn_id', 'amount_level', 'receive_date',
+      'amount',
+      'currencyID',
+      'credit_card_type',
+      'trxn_id',
+      'amount_level',
+      'receive_date',
     );
 
     foreach ($vars as $v) {
@@ -564,9 +568,9 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
    */
   public function buildCustom($id, $name, $viewOnly = FALSE) {
     if ($id) {
-      $button    = substr($this->controller->getButtonName(), -4);
-      $cid       = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
-      $session   = CRM_Core_Session::singleton();
+      $button = substr($this->controller->getButtonName(), -4);
+      $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
+      $session = CRM_Core_Session::singleton();
       $contactID = $session->get('userID');
 
       // we don't allow conflicting fields to be
@@ -637,7 +641,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
             $field['is_required'] = FALSE;
           }
           // CRM-11316 Is ReCAPTCHA enabled for this profile AND is this an anonymous visitor
-          elseif ($field['add_captcha']  && !$contactID) {
+          elseif ($field['add_captcha'] && !$contactID) {
             // only add captcha for first page
             $addCaptcha = TRUE;
           }
@@ -679,7 +683,8 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
     }
 
     if (property_exists($form, '_context') && ($form->_context == 'standalone'
-      || $form->_context == 'participant')) {
+        || $form->_context == 'participant')
+    ) {
       $discountedEvent = CRM_Core_BAO_Discount::getOptionGroup($eventID, 'civicrm_event');
       if (is_array($discountedEvent)) {
         foreach ($discountedEvent as $key => $priceSetId) {
@@ -790,7 +795,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
       $this->_params['contactID'] = $contactID;
 
       if (array_key_exists('email-5', $this->_params)) {
-      $mail = 'email-5';
+        $mail = 'email-5';
       }
       else {
         foreach ($this->_params as $name => $dontCare) {
@@ -807,7 +812,8 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
       // 3. waiting list participant.
       // 4. require approval participant.
       if (!empty($this->_params['is_pay_later']) ||
-        $this->_allowWaitlist || $this->_requireApproval || empty($this->_values['event']['is_monetary'])) {
+        $this->_allowWaitlist || $this->_requireApproval || empty($this->_values['event']['is_monetary'])
+      ) {
         $mail = 'email-Primary';
       }
 
@@ -944,9 +950,9 @@ WHERE  v.option_group_id = g.id
       return $totalCount;
     }
 
-    $priceSetId          = $form->get('priceSetId');
-    $addParticipantNum   = substr($form->_name, 12);
-    $priceSetFields      = $priceSetDetails = array();
+    $priceSetId = $form->get('priceSetId');
+    $addParticipantNum = substr($form->_name, 12);
+    $priceSetFields = $priceSetDetails = array();
     $hasPriceFieldsCount = FALSE;
     if ($priceSetId) {
       $priceSetDetails = $form->get('priceSet');
@@ -1088,8 +1094,8 @@ WHERE  v.option_group_id = g.id
    * @return array
    */
   public static function getPriceSetOptionCount(&$form) {
-    $params     = $form->get('params');
-    $priceSet   = $form->get('priceSet');
+    $params = $form->get('params');
+    $priceSet = $form->get('priceSet');
     $priceSetId = $form->get('priceSetId');
 
     $optionsCount = array();
@@ -1345,9 +1351,9 @@ WHERE  v.option_group_id = g.id
 
     // also set the allow confirmation stuff
     if (array_key_exists(
-        $this->_values['participant']['status_id'],
-        CRM_Event_PseudoConstant::participantStatus(NULL, "class = 'Pending'")
-      )) {
+      $this->_values['participant']['status_id'],
+      CRM_Event_PseudoConstant::participantStatus(NULL, "class = 'Pending'")
+    )) {
       $this->_allowConfirmation = TRUE;
       $this->set('allowConfirmation', TRUE);
     }
@@ -1379,8 +1385,8 @@ WHERE  v.option_group_id = g.id
 
     $now = date('YmdHis');
     $startDate = CRM_Utils_Date::processDate(CRM_Utils_Array::value('registration_start_date',
-        $this->_values['event']
-      ));
+      $this->_values['event']
+    ));
 
     if (
       $startDate &&
@@ -1390,8 +1396,8 @@ WHERE  v.option_group_id = g.id
     }
 
     $endDate = CRM_Utils_Date::processDate(CRM_Utils_Array::value('registration_end_date',
-        $this->_values['event']
-      ));
+      $this->_values['event']
+    ));
     $eventEndDate = CRM_Utils_Date::processDate(CRM_Utils_Array::value('event_end_date', $this->_values['event']));
     if (
       $endDate &&
index 9b86dfcd3c846d380bcec0611fc9f73b6e13c6b2..e69ae49be0e7c77dbf8966e2453b2af9131a3d1b 100644 (file)
@@ -130,9 +130,9 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
     //CRM-4320, setdefault additional participant values.
     if ($this->_allowConfirmation && $this->_additionalParticipantId) {
       //hack to get set default from eventFees.php
-      $this->_discountId   = $discountId;
-      $this->_pId          = $this->_additionalParticipantId;
-      $this->_contactId    = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Participant', $this->_additionalParticipantId, 'contact_id');
+      $this->_discountId = $discountId;
+      $this->_pId = $this->_additionalParticipantId;
+      $this->_contactId = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Participant', $this->_additionalParticipantId, 'contact_id');
       $participantDefaults = CRM_Event_Form_EventFees::setDefaultValues($this);
       $participantDefaults = array_merge($this->_defaults, $participantDefaults);
       // use primary email address if billing email address is empty
@@ -177,13 +177,17 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
     $first_name = $last_name = NULL;
     $pre = $post = array();
     foreach (array(
-      'pre', 'post') as $keys) {
+               'pre',
+               'post'
+             ) as $keys) {
       if (isset($this->_values['additional_custom_' . $keys . '_id'])) {
         $this->buildCustom($this->_values['additional_custom_' . $keys . '_id'], 'additionalCustom' . ucfirst($keys), TRUE);
         $$keys = CRM_Core_BAO_UFGroup::getFields($this->_values['additional_custom_' . $keys . '_id']);
       }
       foreach (array(
-        'first_name', 'last_name') as $name) {
+                 'first_name',
+                 'last_name'
+               ) as $name) {
         if (array_key_exists($name, $$keys) &&
           CRM_Utils_Array::value('is_required', CRM_Utils_Array::value($name, $$keys))
         ) {
@@ -252,14 +256,23 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
           $this->_allowWaitlist = FALSE;
           $this->set('allowWaitlist', $this->_allowWaitlist);
           if ($this->_requireApproval) {
-            $statusMessage = ts("It looks like you are now registering a group of %1 participants. The event has %2 available spaces (you will not be wait listed). Registration for this event requires approval. You will receive an email once your registration has been reviewed.", array(1 => ++$processedCnt, 2 => $spaces));
+            $statusMessage = ts("It looks like you are now registering a group of %1 participants. The event has %2 available spaces (you will not be wait listed). Registration for this event requires approval. You will receive an email once your registration has been reviewed.", array(
+                1 => ++$processedCnt,
+                2 => $spaces
+              ));
           }
           else {
-            $statusMessage = ts("It looks like you are now registering a group of %1 participants. The event has %2 available spaces (you will not be wait listed).", array(1 => ++$processedCnt, 2 => $spaces));
+            $statusMessage = ts("It looks like you are now registering a group of %1 participants. The event has %2 available spaces (you will not be wait listed).", array(
+                1 => ++$processedCnt,
+                2 => $spaces
+              ));
           }
         }
         else {
-          $statusMessage = ts("It looks like you are now registering a group of %1 participants. The event has %2 available spaces (you will not be wait listed). Please go back to the main registration page and reduce the number of additional people. You will also need to complete payment information.", array(1 => ++$processedCnt, 2 => $spaces));
+          $statusMessage = ts("It looks like you are now registering a group of %1 participants. The event has %2 available spaces (you will not be wait listed). Please go back to the main registration page and reduce the number of additional people. You will also need to complete payment information.", array(
+              1 => ++$processedCnt,
+              2 => $spaces
+            ));
           $allowToProceed = FALSE;
         }
         CRM_Core_Session::setStatus($statusMessage, ts('Registration Error'), 'error');
@@ -336,7 +349,7 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
     //CRM-4320
     if ($allowToProceed) {
       $buttons = array_merge($buttons, array(
-        array(
+          array(
             'type' => 'next',
             'name' => ts('Continue'),
             'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
@@ -347,12 +360,13 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
       );
       if ($includeSkipButton) {
         $buttons = array_merge($buttons, array(
-          array(
-            'type' => 'next',
-            'name' => ts('Skip Participant'),
-            'subName' => 'skip',
-            'icon' => 'seek-next',
-          ))
+            array(
+              'type' => 'next',
+              'name' => ts('Skip Participant'),
+              'subName' => 'skip',
+              'icon' => 'seek-next',
+            )
+          )
         );
       }
     }
@@ -471,7 +485,10 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
           if (!$self->_allowConfirmation && empty($self->_values['event']['has_waitlist']) &&
             $totalParticipants > $self->_availableRegistrations
           ) {
-            $errors['_qf_default'] = ts('It looks like event has only %2 seats available and you are trying to register %1 participants, so could you please select price options accordingly.', array(1 => $totalParticipants, 2 => $self->_availableRegistrations));
+            $errors['_qf_default'] = ts('It looks like event has only %2 seats available and you are trying to register %1 participants, so could you please select price options accordingly.', array(
+                1 => $totalParticipants,
+                2 => $self->_availableRegistrations
+              ));
           }
         }
       }
@@ -828,7 +845,10 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
       return;
     }
     foreach (array(
-      'constantValues', 'submitValues', 'defaultValues') as $val) {
+               'constantValues',
+               'submitValues',
+               'defaultValues'
+             ) as $val) {
       $values = &$this->{"_$val"};
       if (!is_array($values) || empty($values)) {
         continue;
index 37997cc45cbaf8ba5eb677edfb4c1c3ef5a76729..b901947c09d7b8e1aeda354888c3a184ff0fc0bd 100644 (file)
@@ -166,7 +166,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
         $registerParams["billing_country-{$this->_bltID}"] = CRM_Core_PseudoConstant::countryIsoCode($registerParams["billing_country_id-{$this->_bltID}"]);
       }
       if (isset($registerParams['credit_card_exp_date'])) {
-        $registerParams['year']  = CRM_Core_Payment_Form::getCreditCardExpirationYear($registerParams);
+        $registerParams['year'] = CRM_Core_Payment_Form::getCreditCardExpirationYear($registerParams);
         $registerParams['month'] = CRM_Core_Payment_Form::getCreditCardExpirationMonth($registerParams);
       }
       if ($this->_values['event']['is_monetary']) {
@@ -238,7 +238,9 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
         $taxAmount += $v['tax_amount'];
         if (is_array($v)) {
           foreach (array(
-            'first_name', 'last_name') as $name) {
+                     'first_name',
+                     'last_name'
+                   ) as $name) {
             if (isset($v['billing_' . $name]) &&
               !isset($v[$name])
             ) {
@@ -416,6 +418,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
     }
     return empty($errors) ? TRUE : $errors;
   }
+
   /**
    * Process the form submission
    *
@@ -423,7 +426,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
    * @return void
    */
   public function postProcess() {
-    $now           = date('YmdHis');
+    $now = date('YmdHis');
 
     $this->_params = $this->get('params');
     if (!empty($this->_params[0]['contact_id'])) {
@@ -647,7 +650,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
           $value['contributionTypeID'] = $contribution->financial_type_id;
         }
         $value['contactID'] = $contactID;
-        $value['eventID']   = $this->_eventId;
+        $value['eventID'] = $this->_eventId;
         $value['item_name'] = $value['description'];
       }
 
@@ -827,8 +830,8 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
             }
 
             if (!empty($this->_lineItem)) {
-              $lineItems  = $this->_lineItem;
-              $lineItem   = array();
+              $lineItems = $this->_lineItem;
+              $lineItem = array();
               if ($lineItemValue = CRM_Utils_Array::value($participantNum, $lineItems)) {
                 $lineItem[] = $lineItemValue;
               }
@@ -920,8 +923,8 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
             $this->assign('amounts', $amount);
           }
           if ($this->_lineItem) {
-            $lineItems  = $this->_lineItem;
-            $lineItem   = array();
+            $lineItems = $this->_lineItem;
+            $lineItem = array();
             if ($lineItemValue = CRM_Utils_Array::value($participantNum, $lineItems)) {
               $lineItem[] = $lineItemValue;
             }
@@ -961,7 +964,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
   ) {
     $transaction = new CRM_Core_Transaction();
 
-    $now         = date('YmdHis');
+    $now = date('YmdHis');
     $receiptDate = NULL;
 
     if (!empty($form->_values['event']['is_email_confirm'])) {
@@ -974,7 +977,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
 
     $contribParams = array(
       'contact_id' => $contactID,
-      'financial_type_id'     => !empty($form->_values['event']['financial_type_id']) ? $form->_values['event']['financial_type_id'] : $params['financial_type_id'],
+      'financial_type_id' => !empty($form->_values['event']['financial_type_id']) ? $form->_values['event']['financial_type_id'] : $params['financial_type_id'],
       'receive_date' => $now,
       'total_amount' => $params['amount'],
       'tax_amount' => $params['tax_amount'],
@@ -1105,7 +1108,8 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
         !$form->_values['event']['is_monetary'] ||
         $form->_allowWaitlist ||
         $form->_requireApproval
-      ) && !empty($params["email-{$form->_bltID}"])) {
+      ) && !empty($params["email-{$form->_bltID}"])
+    ) {
       $params['email-Primary'] = $params["email-{$form->_bltID}"];
     }
   }
@@ -1215,7 +1219,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
   public static function assignProfiles(&$form) {
     $participantParams = $form->_params;
     $formattedValues = $profileFields = array();
-    $count             = 1;
+    $count = 1;
     foreach ($participantParams as $participantNum => $participantValue) {
       if ($participantNum) {
         $prefix1 = 'additional';
index 6d3ca4c6a30f4d6b7f073c9f23c3719b794f10b1..581b48ae34c624dc2df948d314421b0c2255f958 100644 (file)
@@ -106,12 +106,12 @@ class CRM_Event_Form_Registration_ParticipantConfirm extends CRM_Event_Form_Regi
 
     $statusMsg = NULL;
     if (array_key_exists($this->_participantStatusId,
-        CRM_Event_PseudoConstant::participantStatus(NULL, "class = 'Pending'")
-      )) {
+      CRM_Event_PseudoConstant::participantStatus(NULL, "class = 'Pending'")
+    )) {
 
       //need to confirm that though participant confirming
       //registration - but is there enough space to confirm.
-      $emptySeats   = CRM_Event_BAO_Participant::pendingToConfirmSpaces($this->_eventId);
+      $emptySeats = CRM_Event_BAO_Participant::pendingToConfirmSpaces($this->_eventId);
       $additonalIds = CRM_Event_BAO_Participant::getAdditionalParticipantIds($this->_participantId);
       $requireSpace = 1 + count($additonalIds);
       if ($emptySeats !== NULL && ($requireSpace > $emptySeats)) {
@@ -120,34 +120,38 @@ class CRM_Event_Form_Registration_ParticipantConfirm extends CRM_Event_Form_Regi
       else {
         if ($this->_cc == 'fail') {
           $statusMsg = '<div class="bold">' . ts('Your Credit Card transaction was not successful. No money has yet been charged to your card.') . '</div><div><br />' . ts('Click the "Confirm Registration" button to complete your registration in %1, or click "Cancel Registration" if you are no longer interested in attending this event.', array(
-            1 => $values['title'])) . '</div>';
+              1 => $values['title']
+            )) . '</div>';
         }
         else {
           $statusMsg = '<div class="bold">' . ts('Confirm your registration for %1.', array(
-            1 => $values['title'])) . '</div><div><br />' . ts('Click the "Confirm Registration" button to begin, or click "Cancel Registration" if you are no longer interested in attending this event.') . '</div>';
+              1 => $values['title']
+            )) . '</div><div><br />' . ts('Click the "Confirm Registration" button to begin, or click "Cancel Registration" if you are no longer interested in attending this event.') . '</div>';
         }
         $buttons = array_merge($buttons, array(
           array(
-        'type' => 'next',
-              'name' => ts('Confirm Registration'),
-              'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
-              'isDefault' => TRUE,
-            )));
+            'type' => 'next',
+            'name' => ts('Confirm Registration'),
+            'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
+            'isDefault' => TRUE,
+          )
+        ));
       }
     }
 
     // status class other than Negative should be able to cancel registration.
     if (array_key_exists($this->_participantStatusId,
-        CRM_Event_PseudoConstant::participantStatus(NULL, "class != 'Negative'")
-      )) {
+      CRM_Event_PseudoConstant::participantStatus(NULL, "class != 'Negative'")
+    )) {
       $cancelConfirm = ts('Are you sure you want to cancel your registration for this event?');
       $buttons = array_merge($buttons, array(
         array(
-      'type' => 'submit',
-            'name' => ts('Cancel Registration'),
-            'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
-            'js' => array('onclick' => 'return confirm(\'' . $cancelConfirm . '\');'),
-          )));
+          'type' => 'submit',
+          'name' => ts('Cancel Registration'),
+          'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
+          'js' => array('onclick' => 'return confirm(\'' . $cancelConfirm . '\');'),
+        )
+      ));
       if (!$statusMsg) {
         $statusMsg = ts('You can cancel your registration for %1 by clicking "Cancel Registration".', array(1 => $values['title']));
       }
@@ -170,7 +174,7 @@ class CRM_Event_Form_Registration_ParticipantConfirm extends CRM_Event_Form_Regi
    */
   public function postProcess() {
     //get the button.
-    $buttonName    = $this->controller->getButtonName();
+    $buttonName = $this->controller->getButtonName();
     $participantId = $this->_participantId;
 
     if ($buttonName == '_qf_ParticipantConfirm_next') {
index 0e28ad18099cb3251a5aa8100db566a8f8038623..25ab5a0bb681554d500ad5bd314592700cd24d50 100644 (file)
@@ -246,8 +246,8 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
           );
 
           $this->_defaults['amount'] = key(array_slice($this->_values['discount'][$discountId],
-              $discountKey - 1, $discountKey, TRUE
-            ));
+            $discountKey - 1, $discountKey, TRUE
+          ));
         }
       }
     }
@@ -372,7 +372,8 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
         $this->_priceSetId
       ) &&
       !$this->_allowConfirmation &&
-      is_numeric($this->_availableRegistrations) && !empty($this->_values['event']['has_waitlist'])) {
+      is_numeric($this->_availableRegistrations) && !empty($this->_values['event']['has_waitlist'])
+    ) {
       $bypassPayment = TRUE;
       //case might be group become as a part of waitlist.
       //If not waitlist then they require admin approve.
@@ -709,7 +710,8 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
     }
     if (!$priceSetId ||
       !is_array($priceSet) ||
-      empty($priceSet) || empty($priceSet['optionsMaxValueTotal'])) {
+      empty($priceSet) || empty($priceSet['optionsMaxValueTotal'])
+    ) {
       return;
     }
 
@@ -744,10 +746,10 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
         continue;
       }
       foreach ($field['options'] as & $option) {
-        $optId             = $option['id'];
-        $count             = CRM_Utils_Array::value('count', $option, 0);
-        $maxValue          = CRM_Utils_Array::value('max_value', $option, 0);
-        $dbTotalCount      = CRM_Utils_Array::value($optId, $recordedOptionsCount, 0);
+        $optId = $option['id'];
+        $count = CRM_Utils_Array::value('count', $option, 0);
+        $maxValue = CRM_Utils_Array::value('max_value', $option, 0);
+        $dbTotalCount = CRM_Utils_Array::value($optId, $recordedOptionsCount, 0);
         $currentTotalCount = CRM_Utils_Array::value($optId, $currentOptionsCount, 0);
 
 
@@ -979,7 +981,8 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
     $params['is_primary'] = 1;
 
     if ($this->_values['event']['is_pay_later']
-      && (!array_key_exists('hidden_processor', $params) || $params['payment_processor'] == 0)) {
+      && (!array_key_exists('hidden_processor', $params) || $params['payment_processor'] == 0)
+    ) {
       $params['is_pay_later'] = 1;
     }
     else {
index 95e10de7666750d2633fdb474169ddccebfe6f4f..6e33d880abeb44f45105773edfee98b6e0a3c20c 100644 (file)
@@ -47,13 +47,13 @@ class CRM_Event_Form_Registration_ThankYou extends CRM_Event_Form_Registration {
    */
   public function preProcess() {
     parent::preProcess();
-    $this->_params      = $this->get('params');
-    $this->_lineItem    = $this->get('lineItem');
-    $this->_part        = $this->get('part');
+    $this->_params = $this->get('params');
+    $this->_lineItem = $this->get('lineItem');
+    $this->_part = $this->get('part');
     $this->_totalAmount = $this->get('totalAmount');
     $this->_receiveDate = $this->get('receiveDate');
-    $this->_trxnId      = $this->get('trxnId');
-    $finalAmount        = $this->get('finalAmount');
+    $this->_trxnId = $this->get('trxnId');
+    $finalAmount = $this->get('finalAmount');
     $this->assign('finalAmount', $finalAmount);
     $participantInfo = $this->get('participantInfo');
     $this->assign('part', $this->_part);
@@ -95,7 +95,7 @@ class CRM_Event_Form_Registration_ThankYou extends CRM_Event_Form_Registration {
     }
     $this->assignToTemplate();
 
-    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,'contribution_invoice_settings');
+    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
     $taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings);
     $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
     $getTaxDetails = FALSE;
@@ -217,10 +217,10 @@ class CRM_Event_Form_Registration_ThankYou extends CRM_Event_Form_Registration {
     $this->assign('isRequireApproval', $isRequireApproval);
 
     // find pcp info
-    $dao               = new CRM_PCP_DAO_PCPBlock();
+    $dao = new CRM_PCP_DAO_PCPBlock();
     $dao->entity_table = 'civicrm_event';
-    $dao->entity_id    = $this->_eventId;
-    $dao->is_active    = 1;
+    $dao->entity_id = $this->_eventId;
+    $dao->is_active = 1;
     $dao->find(TRUE);
 
     if ($dao->id) {
index 1cdb4b31898585aeb455a8cf2b0faba88b3b0cdb..12baa8350c1f1574ecb1886b64ff5c72d74b4520 100644 (file)
@@ -98,11 +98,11 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search {
      * we allow the controller to set force/reset externally, useful when we are being
      * driven by the wizard framework
      */
-    $this->_reset   = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
-    $this->_force   = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE);
-    $this->_limit   = CRM_Utils_Request::retrieve('limit', 'Positive', $this);
+    $this->_reset = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
+    $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE);
+    $this->_limit = CRM_Utils_Request::retrieve('limit', 'Positive', $this);
     $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'search');
-    $this->_ssID    = CRM_Utils_Request::retrieve('ssID', 'Positive', $this);
+    $this->_ssID = CRM_Utils_Request::retrieve('ssID', 'Positive', $this);
     $this->assign("context", $this->_context);
 
     // get user submitted values
index 3e3087e0ec15fd1b1f6e5a2d94e048e4ec81a610..a0a2cd6be403b49e95b2b1ec5a99e18201221806 100644 (file)
@@ -77,12 +77,12 @@ class CRM_Event_Form_SearchEvent extends CRM_Core_Form {
     CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch($this);
 
     $this->addButtons(array(
-        array(
-          'type' => 'refresh',
-          'name' => ts('Search'),
-          'isDefault' => TRUE,
-        ),
-      ));
+      array(
+        'type' => 'refresh',
+        'name' => ts('Search'),
+        'isDefault' => TRUE,
+      ),
+    ));
   }
 
   public function postProcess() {
index 95eee70f72aa3d000569c31408d224ebea84006e..2cc7538dcf2aa533a3d2e9ddd3d2f671f21253ab 100644 (file)
@@ -139,8 +139,8 @@ class CRM_Event_Form_Task extends CRM_Core_Form {
     }
     else {
       $session->replaceUserContext(CRM_Utils_System::url("civicrm/contact/search/$searchFormName",
-          $urlParams
-        ));
+        $urlParams
+      ));
     }
   }
 
index 0d390a77d82d2201ccb2ae418eeff7c45537538a..9660e63565ce8d1e5e56fa2fd1f71447ea050c54 100644 (file)
@@ -214,8 +214,8 @@ class CRM_Event_Form_Task_AddToGroup extends CRM_Event_Form_Task {
       $groupParams['visibility'] = "User and User Admin Only";
       if (array_key_exists('group_type', $params) && is_array($params['group_type'])) {
         $groupParams['group_type'] = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,
-          array_keys($params['group_type'])
-        ) . CRM_Core_DAO::VALUE_SEPARATOR;
+            array_keys($params['group_type'])
+          ) . CRM_Core_DAO::VALUE_SEPARATOR;
       }
       else {
         $groupParams['group_type'] = '';
@@ -223,22 +223,34 @@ class CRM_Event_Form_Task_AddToGroup extends CRM_Event_Form_Task {
       $groupParams['is_active'] = 1;
 
       $createdGroup = CRM_Contact_BAO_Group::create($groupParams);
-      $groupID      = $createdGroup->id;
-      $groupName    = $groupParams['title'];
+      $groupID = $createdGroup->id;
+      $groupName = $groupParams['title'];
     }
     else {
-      $groupID   = $params['group_id'];
-      $group     = CRM_Core_PseudoConstant::group();
+      $groupID = $params['group_id'];
+      $group = CRM_Core_PseudoConstant::group();
       $groupName = $group[$groupID];
     }
 
     list($total, $added, $notAdded) = CRM_Contact_BAO_GroupContact::addContactsToGroup($this->_contactIds, $groupID);
 
-    $status = array(ts('%count contact added to group', array('count' => $added, 'plural' => '%count contacts added to group')));
+    $status = array(
+      ts('%count contact added to group', array(
+          'count' => $added,
+          'plural' => '%count contacts added to group'
+        ))
+    );
     if ($notAdded) {
-      $status[] = ts('%count contact was already in group', array('count' => $notAdded, 'plural' => '%count contacts were already in group'));
+      $status[] = ts('%count contact was already in group', array(
+          'count' => $notAdded,
+          'plural' => '%count contacts were already in group'
+        ));
     }
     $status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
-    CRM_Core_Session::setStatus($status, ts('Added Contact to %1', array(1 => $groupName, 'count' => $added, 'plural' => 'Added Contacts to %1')), 'success', array('expires' => 0));
+    CRM_Core_Session::setStatus($status, ts('Added Contact to %1', array(
+          1 => $groupName,
+          'count' => $added,
+          'plural' => 'Added Contacts to %1'
+        )), 'success', array('expires' => 0));
   }
 }
index 4819649cb5bfdc3da37b143b1bb6cb7a709533e6..b55c05c6cd620531392ccb92863b5ea170ee3183 100644 (file)
@@ -73,8 +73,8 @@ class CRM_Event_Form_Task_Badge extends CRM_Event_Form_Task {
       // also set the user context to send back to view page
       $session = CRM_Core_Session::singleton();
       $session->pushUserContext(CRM_Utils_System::url('civicrm/contact/view/participant',
-          "reset=1&action=view&id={$participantID}&cid={$contactID}"
-        ));
+        "reset=1&action=view&id={$participantID}&cid={$contactID}"
+      ));
     }
     else {
       parent::preProcess();
@@ -97,7 +97,8 @@ class CRM_Event_Form_Task_Badge extends CRM_Event_Form_Task {
       'badge_id',
       ts('Name Badge Format'),
       array(
-        '' => ts('- select -')) + $label, TRUE
+        '' => ts('- select -')
+      ) + $label, TRUE
     );
 
     $next = 'next';
index 50e93a14ffeb256d8ffaeab5a30afe6736e31164..f5d9d01710a9c83929fc27e01a39032c4987ded5 100644 (file)
@@ -66,9 +66,9 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task {
    * @return void
    */
   public function preProcess() {
-   /*
-    * initialize the task and row fields
-    */
+    /*
+     * initialize the task and row fields
+     */
     parent::preProcess();
 
     //get the contact read only fields to display.
index 24a3b4c79c742d78f00adef6dbd1dabc3e224d10..7269f6665fda8b0064833419427eeef433098558 100644 (file)
@@ -124,7 +124,12 @@ class CRM_Event_Form_Task_Delete extends CRM_Event_Form_Task {
       $deletedParticipants += $additionalCount;
     }
 
-    $status = array(ts('Participant(s) Deleted: %1 (Total Selected: %2)', array(1 => $deletedParticipants, 2 => count($this->_participantIds))));
+    $status = array(
+      ts('Participant(s) Deleted: %1 (Total Selected: %2)', array(
+          1 => $deletedParticipants,
+          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;
     }
index 25f68f10e635b38d811b1b8e5376f6c08f85581d..f27f0d818bd52a9b3d409eaf4d74d0da9d2a65b6 100644 (file)
@@ -45,7 +45,8 @@ class CRM_Event_Form_Task_ParticipantStatus extends CRM_Event_Form_Task_Batch {
     asort($statuses, SORT_STRING);
     $this->add('select', 'status_change', ts('Change All Statuses'),
       array(
-        '' => ts('- select status -')) + $statuses
+        '' => ts('- select status -')
+      ) + $statuses
     );
 
     $this->assign('context', 'statusChange');
index 932b05b95c13c0687ccaad2db9f87a76cecd0b30..1d73c1383f1d0ac10ba98c61b16d097ddc60134e 100644 (file)
@@ -99,7 +99,8 @@ class CRM_Event_Form_Task_PickProfile extends CRM_Event_Form_Task {
 
     $ufGroupElement = $this->add('select', 'uf_group_id', ts('Select Profile'),
       array(
-        '' => ts('- select profile -')) + $profiles, TRUE
+        '' => ts('- select profile -')
+      ) + $profiles, TRUE
     );
     $this->addDefaultButtons(ts('Continue'));
   }
index fda54b9f0400c8ed022e8957f7c70e214685d46a..dae3c5a63f6e5cedb111e1f83f0aefc8ef396f16 100644 (file)
@@ -66,7 +66,10 @@ class CRM_Event_Import_Form_DataSource extends CRM_Core_Form {
 
     $this->add('File', 'uploadFile', ts('Import Data File'), 'size=30 maxlength=255', TRUE);
     $this->setMaxFileSize($uploadFileSize);
-    $this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(1 => $uploadSize, 2 => $uploadFileSize)), 'maxfilesize', $uploadFileSize);
+    $this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(
+          1 => $uploadSize,
+          2 => $uploadFileSize
+        )), 'maxfilesize', $uploadFileSize);
     $this->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile');
     $this->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File');
 
@@ -92,9 +95,9 @@ class CRM_Event_Import_Form_DataSource extends CRM_Core_Form {
 
     //get the saved mapping details
     $mappingArray = CRM_Core_BAO_Mapping::getMappings(CRM_Core_OptionGroup::getValue('mapping_type',
-        'Import Participant',
-        'name'
-      ));
+      'Import Participant',
+      'name'
+    ));
     $this->assign('savedMapping', $mappingArray);
     $this->add('select', 'savedMapping', ts('Mapping Option'), array('' => ts('- select -')) + $mappingArray);
 
@@ -106,7 +109,7 @@ class CRM_Event_Import_Form_DataSource extends CRM_Core_Form {
     $this->setDefaults(array(
       'onDuplicate' =>
         CRM_Import_Parser::DUPLICATE_SKIP,
-      ));
+    ));
 
     //contact types option
     $contactOptions = array();
@@ -128,7 +131,7 @@ class CRM_Event_Import_Form_DataSource extends CRM_Core_Form {
     $this->addGroup($contactOptions, 'contactType', ts('Contact Type'));
 
     $this->setDefaults(array(
-      'contactType' => CRM_Import_Parser::CONTACT_INDIVIDUAL,
+        'contactType' => CRM_Import_Parser::CONTACT_INDIVIDUAL,
       )
     );
 
@@ -158,12 +161,12 @@ class CRM_Event_Import_Form_DataSource extends CRM_Core_Form {
   public function postProcess() {
     $this->controller->resetPage('MapField');
 
-    $fileName         = $this->controller->exportValue($this->_name, 'uploadFile');
+    $fileName = $this->controller->exportValue($this->_name, 'uploadFile');
     $skipColumnHeader = $this->controller->exportValue($this->_name, 'skipColumnHeader');
-    $onDuplicate      = $this->controller->exportValue($this->_name, 'onDuplicate');
-    $contactType      = $this->controller->exportValue($this->_name, 'contactType');
-    $dateFormats      = $this->controller->exportValue($this->_name, 'dateFormats');
-    $savedMapping     = $this->controller->exportValue($this->_name, 'savedMapping');
+    $onDuplicate = $this->controller->exportValue($this->_name, 'onDuplicate');
+    $contactType = $this->controller->exportValue($this->_name, 'contactType');
+    $dateFormats = $this->controller->exportValue($this->_name, 'dateFormats');
+    $savedMapping = $this->controller->exportValue($this->_name, 'savedMapping');
 
     $this->set('onDuplicate', $onDuplicate);
     $this->set('contactType', $contactType);
index 9134670257902a45e1d6ea637576d4bacfa14fec..b34e74590af02bbeee13bde221e37c6ead1b9a88 100644 (file)
@@ -39,8 +39,6 @@
 class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField {
 
 
-
-
   /**
    * Set variables up before form is built
    *
@@ -55,9 +53,9 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField {
     $this->_dataValues = $this->get('dataValues');
     $this->assign('dataValues', $this->_dataValues);
 
-    $skipColumnHeader   = $this->controller->exportValue('DataSource', 'skipColumnHeader');
+    $skipColumnHeader = $this->controller->exportValue('DataSource', 'skipColumnHeader');
     $this->_onDuplicate = $this->get('onDuplicate');
-    $highlightedFields  = array();
+    $highlightedFields = array();
     if ($skipColumnHeader) {
       $this->assign('skipColumnHeader', $skipColumnHeader);
       $this->assign('rowDisplayCount', 3);
@@ -82,7 +80,15 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField {
       $this->_onDuplicate == CRM_Import_Parser::DUPLICATE_NOCHECK
     ) {
       unset($this->_mapperFields['participant_id']);
-      $highlightedFieldsArray = array('participant_contact_id', 'event_id', 'email', 'first_name', 'last_name', 'external_identifier', 'participant_status_id');
+      $highlightedFieldsArray = array(
+        'participant_contact_id',
+        'event_id',
+        'email',
+        'first_name',
+        'last_name',
+        'external_identifier',
+        'participant_status_id'
+      );
       foreach ($highlightedFieldsArray as $name) {
         $highlightedFields[] = $name;
       }
@@ -109,16 +115,16 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField {
 
       list($mappingName, $mappingContactType, $mappingLocation, $mappingPhoneType, $mappingRelation) = CRM_Core_BAO_Mapping::getMappingFields($savedMapping);
 
-      $mappingName        = $mappingName[1];
+      $mappingName = $mappingName[1];
       $mappingContactType = $mappingContactType[1];
-      $mappingLocation    = CRM_Utils_Array::value('1', $mappingLocation);
-      $mappingPhoneType   = CRM_Utils_Array::value('1', $mappingPhoneType);
-      $mappingRelation    = CRM_Utils_Array::value('1', $mappingRelation);
+      $mappingLocation = CRM_Utils_Array::value('1', $mappingLocation);
+      $mappingPhoneType = CRM_Utils_Array::value('1', $mappingPhoneType);
+      $mappingRelation = CRM_Utils_Array::value('1', $mappingRelation);
 
       //mapping is to be loaded from database
 
-      $params         = array('id' => $savedMapping);
-      $temp           = array();
+      $params = array('id' => $savedMapping);
+      $temp = array();
       $mappingDetails = CRM_Core_BAO_Mapping::retrieve($params, $temp);
 
       $this->assign('loadedMapping', $mappingDetails->name);
@@ -146,11 +152,11 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField {
 
     $this->addFormRule(array('CRM_Event_Import_Form_MapField', 'formRule'), $this);
 
-    $defaults         = array();
-    $mapperKeys       = array_keys($this->_mapperFields);
-    $hasHeaders       = !empty($this->_columnHeaders);
-    $headerPatterns   = $this->get('headerPatterns');
-    $dataPatterns     = $this->get('dataPatterns');
+    $defaults = array();
+    $mapperKeys = array_keys($this->_mapperFields);
+    $hasHeaders = !empty($this->_columnHeaders);
+    $headerPatterns = $this->get('headerPatterns');
+    $dataPatterns = $this->get('dataPatterns');
     $hasLocationTypes = $this->get('fieldTypes');
 
 
@@ -163,7 +169,7 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField {
     $sel1 = $this->_mapperFields;
 
     $sel2[''] = NULL;
-    $js       = "<script type='text/javascript'>\n";
+    $js = "<script type='text/javascript'>\n";
     $formName = 'document.forms.' . $this->_name;
 
     //used to warn for mismatch column count or mismatch mapping
@@ -311,7 +317,7 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField {
         CRM_Import_Parser::CONTACT_ORGANIZATION => 'Organization',
       );
       $params = array(
-        'used'         => 'Unsupervised',
+        'used' => 'Unsupervised',
         'contact_type' => $contactTypes[$contactTypeId],
       );
       list($ruleFields, $threshold) = CRM_Dedupe_BAO_RuleGroup::dedupeRuleFieldsWeight($params);
@@ -338,13 +344,14 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField {
             }
             else {
               $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 Provide Contact ID or External ID.') . '<br />';
+                  1 => $threshold
+                )) . ' ' . ts('Or Provide Contact ID or External ID.') . '<br />';
             }
           }
           elseif (!in_array('event_title', $importKeys)) {
             $errors['_qf_default'] .= ts('Missing required field: Provide %1 or %2',
-              array(1 => $title, 2 => 'Event Title')
-            ) . '<br />';
+                array(1 => $title, 2 => 'Event Title')
+              ) . '<br />';
           }
         }
       }
@@ -404,9 +411,9 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField {
     $config = CRM_Core_Config::singleton();
     $seperator = $config->fieldSeparator;
 
-    $mapperKeys     = array();
-    $mapper         = array();
-    $mapperKeys     = $this->controller->exportValue($this->_name, 'mapper');
+    $mapperKeys = array();
+    $mapper = array();
+    $mapperKeys = $this->controller->exportValue($this->_name, 'mapper');
     $mapperKeysMain = array();
 
     for ($i = 0; $i < $this->_columnCount; $i++) {
@@ -440,9 +447,9 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField {
         $updateMappingFields->column_number = $i;
 
         $explodedValues = explode('_', $mapperKeys[$i][0]);
-        $id             = CRM_Utils_Array::value(0, $explodedValues);
-        $first          = CRM_Utils_Array::value(1, $explodedValues);
-        $second         = CRM_Utils_Array::value(2, $explodedValues);
+        $id = CRM_Utils_Array::value(0, $explodedValues);
+        $first = CRM_Utils_Array::value(1, $explodedValues);
+        $second = CRM_Utils_Array::value(2, $explodedValues);
 
         $updateMappingFields->name = $mapper[$i];
         $updateMappingFields->save();
@@ -467,9 +474,9 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField {
         $saveMappingFields->column_number = $i;
 
         $explodedValues = explode('_', $mapperKeys[$i][0]);
-        $id             = CRM_Utils_Array::value(0, $explodedValues);
-        $first          = CRM_Utils_Array::value(1, $explodedValues);
-        $second         = CRM_Utils_Array::value(2, $explodedValues);
+        $id = CRM_Utils_Array::value(0, $explodedValues);
+        $first = CRM_Utils_Array::value(1, $explodedValues);
+        $second = CRM_Utils_Array::value(2, $explodedValues);
 
         $saveMappingFields->name = $mapper[$i];
         $saveMappingFields->save();
index 6165752302432db1d25e271267eec0f743206741..45b98456e109b595eb87241b682c7e5269642487 100644 (file)
@@ -48,11 +48,11 @@ class CRM_Event_Import_Form_Preview extends CRM_Import_Form_Preview {
     $skipColumnHeader = $this->controller->exportValue('DataSource', 'skipColumnHeader');
 
     //get the data from the session
-    $dataValues       = $this->get('dataValues');
-    $mapper           = $this->get('mapper');
-    $invalidRowCount  = $this->get('invalidRowCount');
+    $dataValues = $this->get('dataValues');
+    $mapper = $this->get('mapper');
+    $invalidRowCount = $this->get('invalidRowCount');
     $conflictRowCount = $this->get('conflictRowCount');
-    $mismatchCount    = $this->get('unMatchCount');
+    $mismatchCount = $this->get('unMatchCount');
 
     //get the mapping name displayed if the mappingId is set
     $mappingId = $this->get('loadMappingId');
@@ -89,9 +89,12 @@ class CRM_Event_Import_Form_Preview extends CRM_Import_Form_Preview {
 
     $properties = array(
       'mapper',
-      'dataValues', 'columnCount',
-      'totalRowCount', 'validRowCount',
-      'invalidRowCount', 'conflictRowCount',
+      'dataValues',
+      'columnCount',
+      'totalRowCount',
+      'validRowCount',
+      'invalidRowCount',
+      'conflictRowCount',
       'downloadErrorRecordsUrl',
       'downloadConflictRecordsUrl',
       'downloadMismatchRecordsUrl',
@@ -109,11 +112,11 @@ class CRM_Event_Import_Form_Preview extends CRM_Import_Form_Preview {
    * @return void
    */
   public function postProcess() {
-    $fileName         = $this->controller->exportValue('DataSource', 'uploadFile');
+    $fileName = $this->controller->exportValue('DataSource', 'uploadFile');
     $skipColumnHeader = $this->controller->exportValue('DataSource', 'skipColumnHeader');
-    $invalidRowCount  = $this->get('invalidRowCount');
+    $invalidRowCount = $this->get('invalidRowCount');
     $conflictRowCount = $this->get('conflictRowCount');
-    $onDuplicate      = $this->get('onDuplicate');
+    $onDuplicate = $this->get('onDuplicate');
 
     $config = CRM_Core_Config::singleton();
     $seperator = $config->fieldSeparator;
index 34cbf8fadee63d08fdbf04feb5c839424fec814b..8cb666679a953ee44e1b8a5429d6f8317e6f7a6c 100644 (file)
@@ -93,7 +93,19 @@ class CRM_Event_Import_Form_Summary extends CRM_Import_Form_Summary {
     }
     $this->assign('dupeActionString', $dupeActionString);
 
-    $properties = array('totalRowCount', 'validRowCount', 'invalidRowCount', 'conflictRowCount', 'downloadConflictRecordsUrl', 'downloadErrorRecordsUrl', 'duplicateRowCount', 'downloadDuplicateRecordsUrl', 'downloadMismatchRecordsUrl', 'groupAdditions', 'unMatchCount');
+    $properties = array(
+      'totalRowCount',
+      'validRowCount',
+      'invalidRowCount',
+      'conflictRowCount',
+      'downloadConflictRecordsUrl',
+      'downloadErrorRecordsUrl',
+      'duplicateRowCount',
+      'downloadDuplicateRecordsUrl',
+      'downloadMismatchRecordsUrl',
+      'groupAdditions',
+      'unMatchCount'
+    );
     foreach ($properties as $property) {
       $this->assign($property, $this->get($property));
     }
index 0cf77ddf379b9733ca221468a42e65a623d3673a..c33ba68b8a3aeea8f9b5cec89832b73c66efe0bb 100644 (file)
@@ -32,8 +32,6 @@
  * $Id$
  *
  */
-
-
 abstract class CRM_Event_Import_Parser extends CRM_Import_Parser {
 
   protected $_fileName;
@@ -257,7 +255,8 @@ abstract class CRM_Event_Import_Parser extends CRM_Import_Parser {
 
       if ($this->_invalidRowCount) {
         // removed view url for invlaid contacts
-        $headers = array_merge(array(ts('Line Number'),
+        $headers = array_merge(array(
+            ts('Line Number'),
             ts('Reason'),
           ),
           $customHeaders
@@ -266,7 +265,8 @@ abstract class CRM_Event_Import_Parser extends CRM_Import_Parser {
         self::exportCSV($this->_errorFileName, $headers, $this->_errors);
       }
       if ($this->_conflictCount) {
-        $headers = array_merge(array(ts('Line Number'),
+        $headers = array_merge(array(
+            ts('Line Number'),
             ts('Reason'),
           ),
           $customHeaders
@@ -275,7 +275,8 @@ abstract class CRM_Event_Import_Parser extends CRM_Import_Parser {
         self::exportCSV($this->_conflictFileName, $headers, $this->_conflicts);
       }
       if ($this->_duplicateCount) {
-        $headers = array_merge(array(ts('Line Number'),
+        $headers = array_merge(array(
+            ts('Line Number'),
             ts('View Participant URL'),
           ),
           $customHeaders
index b9de5545094f54281655b82a7128e3c2537a609d..84a05665d057c77fddc8eb11cc0984b6bf1d69af 100644 (file)
@@ -159,9 +159,9 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser {
   public function summary(&$values) {
     $erroneousField = NULL;
 
-    $response      = $this->setActiveFieldValues($values, $erroneousField);
+    $response = $this->setActiveFieldValues($values, $erroneousField);
     $errorRequired = FALSE;
-    $index         = -1;
+    $index = -1;
 
     if ($this->_eventIndex > -1 && $this->_eventTitleIndex > -1) {
       array_unshift($values, ts('Select either EventID OR Event Title'));
@@ -229,7 +229,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser {
         else {
           foreach ($val as $role) {
             if (!CRM_Contact_Import_Parser_Contact::in_value(trim($role), $roleIDs)) {
-                CRM_Contact_Import_Parser_Contact::addToErrorMsg('Participant Role', $errorMessage);
+              CRM_Contact_Import_Parser_Contact::addToErrorMsg('Participant Role', $errorMessage);
               break;
             }
           }
@@ -282,10 +282,10 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser {
     if ($response != CRM_Import_Parser::VALID) {
       return $response;
     }
-    $params       = &$this->getActiveFieldParams();
-    $session      = CRM_Core_Session::singleton();
-    $dateType     = $session->get('dateTypes');
-    $formatted    = array('version' => 3);
+    $params = &$this->getActiveFieldParams();
+    $session = CRM_Core_Session::singleton();
+    $dateType = $session->get('dateTypes');
+    $formatted = array('version' => 3);
     $customFields = CRM_Core_BAO_CustomField::getFields(CRM_Utils_Array::value('contact_type', $params));
 
     // don't add to recent items, CRM-4399
@@ -419,7 +419,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser {
         // Using new Dedupe rule.
         $ruleParams = array(
           'contact_type' => $this->_contactType,
-          'used'         => 'Unsupervised',
+          'used' => 'Unsupervised',
         );
         $fieldsArray = CRM_Dedupe_BAO_Rule::dedupeRuleFields($ruleParams);
 
@@ -466,9 +466,9 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser {
     if (is_array($newParticipant) && civicrm_error($newParticipant)) {
       if ($onDuplicate == CRM_Import_Parser::DUPLICATE_SKIP) {
 
-        $contactID     = CRM_Utils_Array::value('contactID', $newParticipant);
+        $contactID = CRM_Utils_Array::value('contactID', $newParticipant);
         $participantID = CRM_Utils_Array::value('participantID', $newParticipant);
-        $url           = CRM_Utils_System::url('civicrm/contact/view/participant',
+        $url = CRM_Utils_System::url('civicrm/contact/view/participant',
           "reset=1&id={$participantID}&cid={$contactID}&action=view", TRUE
         );
         if (is_array($newParticipant['error_message']) &&
index 42a761cbed31daa145e121df29cfd32df271e18f..ead0bcf0ae2ae6902795da9d6c56ab48045a4220 100644 (file)
@@ -53,8 +53,9 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page {
     $config = CRM_Core_Config::singleton();
     // ensure that the user has permission to see this page
     if (!CRM_Core_Permission::event(CRM_Core_Permission::VIEW,
-        $this->_id, 'view event info'
-      )) {
+      $this->_id, 'view event info'
+    )
+    ) {
       CRM_Utils_System::setUFMessage(ts('You do not have permission to view this event'));
       return CRM_Utils_System::permissionDenied();
     }
@@ -167,7 +168,7 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page {
         $this->assign('isPriceSet', 1);
         $this->assign('isQuickConfig', $setDetails[$priceSetId]['is_quick_config']);
       }
-        }
+    }
 
     $params = array('entity_id' => $this->_id, 'entity_table' => 'civicrm_event');
     $values['location'] = CRM_Core_BAO_Location::getValues($params, TRUE);
@@ -194,7 +195,7 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page {
       $this->assign('mapKey', $config->mapAPIKey);
       $sumLat = $sumLng = 0;
       $maxLat = $maxLng = -400;
-      $minLat = $minLng = + 400;
+      $minLat = $minLng = +400;
       foreach ($locations as $location) {
         $sumLat += $location['lat'];
         $sumLng += $location['lng'];
@@ -219,8 +220,8 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page {
         'lng' => (float ) $sumLng / count($locations),
       );
       $span = array(
-        'lat' => (float )($maxLat - $minLat),
-        'lng' => (float )($maxLng - $minLng),
+        'lat' => (float ) ($maxLat - $minLat),
+        'lng' => (float ) ($maxLng - $minLng),
       );
       $this->assign_by_ref('center', $center);
       $this->assign_by_ref('span', $span);
index accb70a185346ff6592f81bf6c67b8a69c4cebaa..3d11809c87b492c2c6c514ef4c22a4ea876e02f1 100644 (file)
@@ -49,14 +49,14 @@ class CRM_Event_Page_ICalendar extends CRM_Core_Page {
    * @return void
    */
   public function run() {
-    $id       = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, NULL, 'GET');
-    $type     = CRM_Utils_Request::retrieve('type', 'Positive', $this, FALSE, 0);
-    $start    = CRM_Utils_Request::retrieve('start', 'Positive', $this, FALSE, 0);
-    $end      = CRM_Utils_Request::retrieve('end', 'Positive', $this, FALSE, 0);
+    $id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, NULL, 'GET');
+    $type = CRM_Utils_Request::retrieve('type', 'Positive', $this, FALSE, 0);
+    $start = CRM_Utils_Request::retrieve('start', 'Positive', $this, FALSE, 0);
+    $end = CRM_Utils_Request::retrieve('end', 'Positive', $this, FALSE, 0);
     $iCalPage = CRM_Utils_Request::retrieve('list', 'Positive', $this, FALSE, 0);
-    $gData    = CRM_Utils_Request::retrieve('gData', 'Positive', $this, FALSE, 0);
-    $html     = CRM_Utils_Request::retrieve('html', 'Positive', $this, FALSE, 0);
-    $rss      = CRM_Utils_Request::retrieve('rss', 'Positive', $this, FALSE, 0);
+    $gData = CRM_Utils_Request::retrieve('gData', 'Positive', $this, FALSE, 0);
+    $html = CRM_Utils_Request::retrieve('html', 'Positive', $this, FALSE, 0);
+    $rss = CRM_Utils_Request::retrieve('rss', 'Positive', $this, FALSE, 0);
 
     $info = CRM_Event_BAO_Event::getCompleteInfo($start, $type, $id, $end);
     $this->assign('events', $info);
index f69d7070f01173bcd3fdcc6614a3392616996c15..a202ddd46b2caf8b15b630f0fb98fa30d877641c 100644 (file)
@@ -138,12 +138,12 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page {
           'field' => 'is_online_registration',
         );
       if (CRM_Core_Permission::check('administer CiviCRM')) {
-      self::$_tabLinks[$cacheKey]['reminder'] =
-        array(
-          'title' => ts('Schedule Reminders'),
-          'url' => 'civicrm/event/manage/reminder',
-          'field' => 'reminder',
-        );
+        self::$_tabLinks[$cacheKey]['reminder'] =
+          array(
+            'title' => ts('Schedule Reminders'),
+            'url' => 'civicrm/event/manage/reminder',
+            'field' => 'reminder',
+          );
       }
       self::$_tabLinks[$cacheKey]['conference'] =
         array(
@@ -211,10 +211,12 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page {
     }
 
     if (!$this->_isTemplate && $id) {
-      $breadCrumb = array(array(
+      $breadCrumb = array(
+        array(
           'title' => ts('Manage Events'),
           'url' => CRM_Utils_System::url(CRM_Utils_System::currentPath(), 'reset=1'),
-        ));
+        )
+      );
       CRM_Utils_System::appendBreadCrumb($breadCrumb);
     }
 
@@ -441,9 +443,9 @@ ORDER BY start_date desc
    * @return string
    */
   public function whereClause(&$params, $sortBy = TRUE, $force) {
-    $values    = array();
-    $clauses   = array();
-    $title     = $this->get('title');
+    $values = array();
+    $clauses = array();
+    $title = $this->get('title');
     $createdId = $this->get('cid');
 
     if ($createdId) {
index eca8e14d2b5e48c69a70309de63acf31627fb045..d5c9c387b41cd1e46c9813ea0280f976fc08e81e 100644 (file)
@@ -41,6 +41,7 @@ class CRM_Event_Page_ParticipantListing extends CRM_Core_Page {
   protected $_eventTitle;
 
   protected $_pager;
+
   public function preProcess() {
     $this->_id = CRM_Utils_Request::retrieve('id', 'Integer', $this, TRUE);
 
@@ -77,14 +78,14 @@ class CRM_Event_Page_ParticipantListing extends CRM_Core_Page {
 
     if ($className == 'CRM_Event_Page_ParticipantListing') {
       CRM_Core_Error::fatal(ts("Participant listing code file cannot be '%1'",
-          array(1 => $className)
-        ));
+        array(1 => $className)
+      ));
     }
 
     $classFile = str_replace('_',
-      DIRECTORY_SEPARATOR,
-      $className
-    ) . '.php';
+        DIRECTORY_SEPARATOR,
+        $className
+      ) . '.php';
     $error = include_once $classFile;
     if ($error == FALSE) {
       CRM_Core_Error::fatal('Participant listing code file: ' . $classFile . ' does not exist. Please verify your custom particpant listing settings in CiviCRM administrative panel.');
index c9d124268e2129242d2279a72d6f7dbbb79b3e03..6bf6fa8bee61327da9c3bd06cbffc26940521e04 100644 (file)
@@ -98,8 +98,8 @@ SELECT   civicrm_contact.id                as contact_id    ,
 ORDER BY $orderBy
 LIMIT    $offset, $rowCount";
 
-    $rows         = array();
-    $object       = CRM_Core_DAO::executeQuery($query, $params);
+    $rows = array();
+    $object = CRM_Core_DAO::executeQuery($query, $params);
     $statusLookup = CRM_Event_PseudoConstant::participantStatus();
     while ($object->fetch()) {
       $status = CRM_Utils_Array::value($object->status_id, $statusLookup);
@@ -156,17 +156,17 @@ SELECT count( civicrm_contact.id )
     if (!$headers) {
       $headers = array();
       $headers[1] = array(
-      'name' => ts('Name'),
+        'name' => ts('Name'),
         'sort' => 'civicrm_contact.sort_name',
         'direction' => CRM_Utils_Sort::ASCENDING,
       );
       $headers[2] = array(
-      'name' => ts('Status'),
+        'name' => ts('Status'),
         'sort' => 'civicrm_participant.status_id',
         'direction' => CRM_Utils_Sort::DONTCARE,
       );
       $headers[3] = array(
-      'name' => ts('Register Date'),
+        'name' => ts('Register Date'),
         'sort' => 'civicrm_participant.register_date',
         'direction' => CRM_Utils_Sort::DONTCARE,
       );
index 63cd3b8d896b94b1fc6e1e6b32dce4db0fab0f0f..61cc97d58267f7e78bd84d1a56a87eadbacd362a 100644 (file)
@@ -144,13 +144,13 @@ SELECT count( civicrm_contact.id )
     if (!$headers) {
       $headers = array();
       $headers[1] = array(
-      'name' => ts('Name'),
+        'name' => ts('Name'),
         'sort' => 'civicrm_contact.sort_name',
         'direction' => CRM_Utils_Sort::ASCENDING,
       );
       if ($this->_participantListingType == 'Name and Email') {
         $headers[2] = array(
-        'name' => ts('Email'),
+          'name' => ts('Email'),
           'sort' => 'civicrm_email.email',
           'direction' => CRM_Utils_Sort::DONTCARE,
         );
index d249a63d8e3a48e8c1ca05934ec205fc6d53b0a9..f5cd976faa955eea7432cd3ba354176a0737a072 100644 (file)
@@ -121,9 +121,9 @@ class CRM_Event_Page_Tab extends CRM_Core_Page {
   }
 
   public function preProcess() {
-    $context       = CRM_Utils_Request::retrieve('context', 'String', $this);
+    $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
-    $this->_id     = CRM_Utils_Request::retrieve('id', 'Positive', $this);
+    $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
 
     if ($context == 'standalone') {
       $this->_action = CRM_Core_Action::ADD;
@@ -172,7 +172,8 @@ class CRM_Event_Page_Tab extends CRM_Core_Page {
     elseif ($this->_action & (CRM_Core_Action::UPDATE |
         CRM_Core_Action::ADD |
         CRM_Core_Action::DELETE
-      )) {
+      )
+    ) {
       $this->edit();
     }
     else {
@@ -247,7 +248,7 @@ class CRM_Event_Page_Tab extends CRM_Core_Page {
         break;
 
       case 'fulltext':
-        $keyName   = '&qfKey';
+        $keyName = '&qfKey';
         $urlParams = 'force=1';
         $urlString = 'civicrm/contact/search/custom';
         if ($this->_action == CRM_Core_Action::UPDATE) {
index 425759b5593e3ed6cc47eaf5fcb5ff4581fb8922..ad2e89c26ca31c8f24b74871ed137de7095a8a2e 100644 (file)
@@ -302,7 +302,7 @@ class CRM_Event_PseudoConstant extends CRM_Core_PseudoConstant {
   public static function flush($name = 'cache') {
     if (isset(self::$$name)) {
       self::$$name = NULL;
-   }
+    }
   }
 
   /**
index 24e23b36a808f15dfe8021dcf4bb98c2bc51f227..c5ffb4b783c6630fc161d6c9d1f7c824b8e3f492 100644 (file)
@@ -173,9 +173,9 @@ class CRM_Event_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co
     // submitted form values
     $this->_queryParams = &$queryParams;
 
-    $this->_single      = $single;
-    $this->_limit       = $limit;
-    $this->_context     = $context;
+    $this->_single = $single;
+    $this->_limit = $limit;
+    $this->_context = $context;
     $this->_compContext = $compContext;
 
     $this->_eventClause = $eventClause;
@@ -329,10 +329,10 @@ class CRM_Event_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co
     }
     $mask = CRM_Core_Action::mask($permissions);
 
-    $statusTypes      = CRM_Event_PseudoConstant::participantStatus();
-    $statusClasses    = CRM_Event_PseudoConstant::participantStatusClass();
+    $statusTypes = CRM_Event_PseudoConstant::participantStatus();
+    $statusClasses = CRM_Event_PseudoConstant::participantStatusClass();
     $participantRoles = CRM_Event_PseudoConstant::participantRole();
-    $sep              = CRM_Core_DAO::VALUE_SEPARATOR;
+    $sep = CRM_Core_DAO::VALUE_SEPARATOR;
 
     //get all campaigns.
     $allCampaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, FALSE, FALSE, FALSE, TRUE);
@@ -454,7 +454,7 @@ class CRM_Event_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co
     if (!isset(self::$_columnHeaders)) {
       self::$_columnHeaders = array(
         array(
-      'name' => ts('Event'),
+          'name' => ts('Event'),
           'sort' => 'event_title',
           'direction' => CRM_Utils_Sort::DONTCARE,
         ),
index 66a47a62ff23c3a7d7bb62c4cb36e2044dbca80d..c52bd1253a31e3e2d7853f2613610e9633f15f77 100644 (file)
@@ -91,7 +91,7 @@ class CRM_Event_StateMachine_Registration extends CRM_Core_StateMachine {
     $pages = array_merge($pages, $additionalPages);
 
     // CRM-11182 - Optional confirmation screen
-    if (!$is_confirm_enabled  && !$is_monetary) {
+    if (!$is_confirm_enabled && !$is_monetary) {
       unset($pages['CRM_Event_Form_Registration_Confirm']);
     }
 
index 9621d61e11edbcc96ffd63f42b5df2b1535e9a43..72bd59245b586985b5ed15a241d366e53ea29179 100644 (file)
@@ -41,9 +41,9 @@
 class CRM_Event_Task {
   // Value for SAVE_SEARCH is set to 13 in accordance with CRM_Contact_Task::SAVE_SEARCH
   const DELETE_EVENTS = 1, PRINT_EVENTS = 2, EXPORT_EVENTS = 3, BATCH_EVENTS = 4, CANCEL_REGISTRATION = 5, EMAIL_CONTACTS = 6,
-  // Value for LABEL_CONTACTS is set to 16 in accordance with CRM_Contact_Task::LABEL_CONTACTS
-  SAVE_SEARCH = 13, SAVE_SEARCH_UPDATE = 14, PARTICIPANT_STATUS = 15,
-  LABEL_CONTACTS = 16, GROUP_CONTACTS = 20;
+    // Value for LABEL_CONTACTS is set to 16 in accordance with CRM_Contact_Task::LABEL_CONTACTS
+    SAVE_SEARCH = 13, SAVE_SEARCH_UPDATE = 14, PARTICIPANT_STATUS = 15,
+    LABEL_CONTACTS = 16, GROUP_CONTACTS = 20;
 
   /**
    * The task array
@@ -72,8 +72,8 @@ class CRM_Event_Task {
   public static function &tasks() {
     if (!(self::$_tasks)) {
       self::$_tasks = array(
-      1 => array(
-        'title' => ts('Delete Participants'),
+        1 => array(
+          'title' => ts('Delete Participants'),
           'class' => 'CRM_Event_Form_Task_Delete',
           'result' => FALSE,
         ),
index f7693dac625d090376b3de5b438e0e45857c72f0..2870248123c7adb632152f5d2930b63994c2e564 100644 (file)
@@ -1695,7 +1695,7 @@ WHERE  id IN ( $deleteIDString )
    */
   static function _trimNonTokens(
     &$parsedString, $defaultGreeting,
-                                 $addressMergeGreetings, $greetingType = 'postal_greeting'
+    $addressMergeGreetings, $greetingType = 'postal_greeting'
   ) {
     if (!empty($addressMergeGreetings[$greetingType])) {
       $greetingLabel = $addressMergeGreetings[$greetingType];
index d71207aa35c053ed028fae235b9d310afcc71c28..d6352d5fa645147a078fb12b8e909877070d9494 100644 (file)
@@ -104,11 +104,11 @@ class CRM_Export_Form_Select extends CRM_Core_Form {
     }
     else {
       // we need to determine component export
-      $stateMachine  = $this->controller->getStateMachine();
+      $stateMachine = $this->controller->getStateMachine();
 
-      $formName      = CRM_Utils_System::getClassName($stateMachine);
+      $formName = CRM_Utils_System::getClassName($stateMachine);
       $componentName = explode('_', $formName);
-      $components    = array('Contribute', 'Member', 'Event', 'Pledge', 'Case', 'Grant', 'Activity');
+      $components = array('Contribute', 'Member', 'Event', 'Pledge', 'Case', 'Grant', 'Activity');
 
       if (in_array($componentName[1], $components)) {
         switch ($componentName[1]) {
@@ -200,8 +200,8 @@ class CRM_Export_Form_Select extends CRM_Core_Form {
     $this->_task = $values['task'];
     if ($this->_exportMode == self::CONTACT_EXPORT) {
       $contactTasks = CRM_Contact_Task::taskTitles();
-      $taskName     = $contactTasks[$this->_task];
-      $component    = FALSE;
+      $taskName = $contactTasks[$this->_task];
+      $component = FALSE;
       CRM_Contact_Form_Task::preProcessCommon($this, TRUE);
     }
     else {
@@ -317,8 +317,8 @@ FROM   {$this->_componentTable}
 
     $this->setDefaults(array(
       'exportOption' => self::EXPORT_ALL,
-        'mergeOption' => self::EXPORT_MERGE_DO_NOT_MERGE,
-      ));
+      'mergeOption' => self::EXPORT_MERGE_DO_NOT_MERGE,
+    ));
 
     $this->addButtons(array(
         array(
@@ -380,9 +380,9 @@ FROM   {$this->_componentTable}
    * @return void
    */
   public function postProcess() {
-    $params             = $this->controller->exportValues($this->_name);
-    $exportOption       = $params['exportOption'];
-    $mergeSameAddress   = CRM_Utils_Array::value('mergeOption', $params) == self::EXPORT_MERGE_SAME_ADDRESS ? 1 : 0;
+    $params = $this->controller->exportValues($this->_name);
+    $exportOption = $params['exportOption'];
+    $mergeSameAddress = CRM_Utils_Array::value('mergeOption', $params) == self::EXPORT_MERGE_SAME_ADDRESS ? 1 : 0;
     $mergeSameHousehold = CRM_Utils_Array::value('mergeOption', $params) == self::EXPORT_MERGE_HOUSEHOLD ? 1 : 0;
 
     $this->set('mergeSameAddress', $mergeSameAddress);
index ce632b2052b1d9bb4ac84e3b9af3e3a3606d0bea..43bfcb8acb2b9efd8a66daa6d03a24ec201002c2 100644 (file)
@@ -263,10 +263,10 @@ class CRM_Extension_Browser {
     if (empty($exts)) {
       $config = CRM_Core_Config::singleton();
       CRM_Core_Session::setStatus(ts('There are currently no extensions on the CiviCRM public extension directory which are compatible with version %2 (<a href="%1">requested extensions from here</a>). If you want to install an extension which is not marked as compatible, you may be able to <a href="%3">download and install extensions manually</a> (depending on access to your web server).<br />', array(
-            1 => $this->getRepositoryUrl(),
-            2 => $config->civiVersion,
-            3 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Extensions',
-          )), ts('No Extensions Available for this Version'), 'info');
+        1 => $this->getRepositoryUrl(),
+        2 => $config->civiVersion,
+        3 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Extensions',
+      )), ts('No Extensions Available for this Version'), 'info');
     }
 
     ini_restore('allow_url_fopen');
index d3f6322bb1d72ed9f7042ac92a0c79b727545d06..a3c31d7a4638ae91a007e6948210086b12e5b7f0 100644 (file)
@@ -87,7 +87,7 @@ class CRM_Extension_Downloader {
       );
     }
 
-    if (empty($errors) && ! CRM_Utils_HttpClient::singleton()->isRedirectSupported()) {
+    if (empty($errors) && !CRM_Utils_HttpClient::singleton()->isRedirectSupported()) {
       CRM_Core_Session::setStatus(ts('WARNING: The downloader may be unable to download files which require HTTP redirection. This may be a configuration issue with PHP\'s open_basedir or safe_mode.'));
       CRM_Core_Error::debug_log_message('WARNING: The downloader may be unable to download files which require HTTP redirection. This may be a configuration issue with PHP\'s open_basedir or safe_mode.');
     }
@@ -114,16 +114,16 @@ class CRM_Extension_Downloader {
       CRM_Core_Error::fatal('Cannot install this extension - downloadUrl is not set!');
     }
 
-    if (! $this->fetch($downloadUrl, $filename)) {
+    if (!$this->fetch($downloadUrl, $filename)) {
       return FALSE;
     }
 
     $extractedZipPath = $this->extractFiles($key, $filename);
-    if (! $extractedZipPath) {
+    if (!$extractedZipPath) {
       return FALSE;
     }
 
-    if (! $this->validateFiles($key, $extractedZipPath)) {
+    if (!$this->validateFiles($key, $extractedZipPath)) {
       return FALSE;
     }
 
index 8ae387d2894fb22ac504078d151ee10e103acecf..6e1b7da41473f07c9234c9d5d081b243f6397f84 100644 (file)
@@ -88,11 +88,11 @@ class CRM_Extension_Info {
    * @param null $file
    */
   public function __construct($key = NULL, $type = NULL, $name = NULL, $label = NULL, $file = NULL) {
-    $this->key       = $key;
-    $this->type      = $type;
-    $this->name      = $name;
-    $this->label     = $label;
-    $this->file      = $file;
+    $this->key = $key;
+    $this->type = $type;
+    $this->name = $name;
+    $this->label = $label;
+    $this->file = $file;
   }
 
   /**
@@ -102,9 +102,9 @@ class CRM_Extension_Info {
    * @return void
    */
   public function parse($info) {
-    $this->key   = (string) $info->attributes()->key;
-    $this->type  = (string) $info->attributes()->type;
-    $this->file  = (string) $info->file;
+    $this->key = (string) $info->attributes()->key;
+    $this->type = (string) $info->attributes()->type;
+    $this->file = (string) $info->file;
     $this->label = (string) $info->name;
 
     // Convert first level variables to CRM_Core_Extension properties
index 0eefba9fb66c095b1ea9a5a49631d67ed5dbac88..dc9109ed172398a1915f207172db3f0198b8db2c 100644 (file)
@@ -125,7 +125,7 @@ class CRM_Extension_Manager {
    * @throws CRM_Extension_Exception
    */
   public function replace($tmpCodeDir) {
-    if (! $this->defaultContainer) {
+    if (!$this->defaultContainer) {
       throw new CRM_Extension_Exception("Default extension container is not configured");
     }
 
@@ -140,7 +140,7 @@ class CRM_Extension_Manager {
         // There is an old copy of the extension. Try to install in the same place -- but it must go somewhere in the default-container
         list ($oldInfo, $typeManager) = $this->_getInfoTypeHandler($newInfo->key); // throws Exception
         $tgtPath = $this->fullContainer->getPath($newInfo->key);
-        if (! CRM_Utils_File::isChildPath($this->defaultContainer->getBaseDir(), $tgtPath)) {
+        if (!CRM_Utils_File::isChildPath($this->defaultContainer->getBaseDir(), $tgtPath)) {
           // force installation in the default-container
           $oldPath = $tgtPath;
           $tgtPath = $this->defaultContainer->getBaseDir() . DIRECTORY_SEPARATOR . $newInfo->key;
@@ -352,7 +352,7 @@ class CRM_Extension_Manager {
         case self::STATUS_INSTALLED_MISSING:
           throw new CRM_Extension_Exception("Cannot uninstall extension; disable it first: $key");
 
-        break;
+          break;
         case self::STATUS_DISABLED:
           list ($info, $typeManager) = $this->_getInfoTypeHandler($key); // throws Exception
           $typeManager->onPreUninstall($info);
index 6eac34c6fcac42b3f2db885d077ba9ffbe76640a..51c57cfe987aa51e281fab237ec3546ceb23aac2 100644 (file)
@@ -65,10 +65,10 @@ class CRM_Extension_Manager_Payment extends CRM_Extension_Manager_Base {
 
     $dao = new CRM_Financial_DAO_PaymentProcessorType();
 
-    $dao->is_active   = 1;
-    $dao->class_name  = trim($info->key);
-    $dao->title       = trim($info->name) . ' (' . trim($info->key) . ')';
-    $dao->name        = trim($info->name);
+    $dao->is_active = 1;
+    $dao->class_name = trim($info->key);
+    $dao->title = trim($info->name) . ' (' . trim($info->key) . ')';
+    $dao->name = trim($info->name);
     $dao->description = trim($info->description);
 
     $dao->user_name_label = trim($info->typeInfo['userNameLabel']);
@@ -193,8 +193,12 @@ class CRM_Extension_Manager_Payment extends CRM_Extension_Manager_Base {
     try {
       $paymentClass = $this->mapper->keyToClass($info->key, 'payment');
       $file = $this->mapper->classToPath($paymentClass);
-      if (! file_exists($file)) {
-        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)), '', 'error');
+      if (!file_exists($file)) {
+        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
+            )), '', 'error');
         return;
       }
       else {
@@ -202,7 +206,10 @@ class CRM_Extension_Manager_Payment extends CRM_Extension_Manager_Base {
       }
     }
     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)), '', 'error');
+      CRM_Core_Session::setStatus(ts('Failed to determine file path for payment processor (%1) while running "%2"', array(
+            1 => $info->key,
+            2 => $method
+          )), '', 'error');
       return;
     }
 
@@ -217,10 +224,11 @@ class CRM_Extension_Manager_Payment extends CRM_Extension_Manager_Base {
                  WHERE ext.type = 'payment'
                    AND ext.full_name = %1
         ",
-        array(
-          1 => array($info->key, 'String'),
-        )
-      )) {
+      array(
+        1 => array($info->key, 'String'),
+      )
+    )
+    ) {
       // If so, load params in the usual way ..
       $paymentProcessor = CRM_Financial_BAO_PaymentProcessor::getPayment($processor_id, NULL);
     }
@@ -279,7 +287,10 @@ class CRM_Extension_Manager_Payment extends CRM_Extension_Manager_Base {
 
         // Does PP implement this method, and can we call it?
         if (method_exists($processorInstance, $method) && is_callable(array(
-          $processorInstance, $method))) {
+            $processorInstance,
+            $method
+          ))
+        ) {
           // If so, call it ...
           $processorInstance->$method();
         }
@@ -287,8 +298,8 @@ class CRM_Extension_Manager_Payment extends CRM_Extension_Manager_Base {
 
       default:
         CRM_Core_Session::setStatus(ts("Unrecognized payment hook (%1) in %2::%3",
-                        array(1 => $method, 2 => __CLASS__ , 3 => __METHOD__)),
-                        '', 'error');
+            array(1 => $method, 2 => __CLASS__, 3 => __METHOD__)),
+          '', 'error');
     }
   }
 }
index b1d9313a4c65466adc5ee95afa2ad8a4df1faa32..54311b8473d14c88f259c43e8ea31f295dfcce5f 100644 (file)
@@ -99,8 +99,8 @@ class CRM_Extension_Manager_Report extends CRM_Extension_Manager_Base {
     //        }
 
     $customReports = $this->getCustomReportsByName();
-    $cr          = $this->getCustomReportsById();
-    $id          = $cr[$customReports[$info->key]];
+    $cr = $this->getCustomReportsById();
+    $id = $cr[$customReports[$info->key]];
     $optionValue = CRM_Core_BAO_OptionValue::del($id);
 
     return $optionValue ? TRUE : FALSE;
@@ -111,8 +111,8 @@ class CRM_Extension_Manager_Report extends CRM_Extension_Manager_Base {
    */
   public function onPreDisable(CRM_Extension_Info $info) {
     $customReports = $this->getCustomReportsByName();
-    $cr          = $this->getCustomReportsById();
-    $id          = $cr[$customReports[$info->key]];
+    $cr = $this->getCustomReportsById();
+    $id = $cr[$customReports[$info->key]];
     $optionValue = CRM_Core_BAO_OptionValue::setIsActive($id, 0);
   }
 
@@ -121,8 +121,8 @@ class CRM_Extension_Manager_Report extends CRM_Extension_Manager_Base {
    */
   public function onPreEnable(CRM_Extension_Info $info) {
     $customReports = $this->getCustomReportsByName();
-    $cr          = $this->getCustomReportsById();
-    $id          = $cr[$customReports[$info->key]];
+    $cr = $this->getCustomReportsById();
+    $id = $cr[$customReports[$info->key]];
     $optionValue = CRM_Core_BAO_OptionValue::setIsActive($id, 1);
   }
 
index 311f57f1e9e7fe513e1341d3a5d06153b38e8bc1..b371e514ed72c55bb24caf96116d28becb9b6a64 100644 (file)
@@ -92,8 +92,8 @@ class CRM_Extension_Manager_Search extends CRM_Extension_Manager_Base {
       CRM_Core_Error::fatal('This custom search is not registered.');
     }
 
-    $cs          = $this->getCustomSearchesById();
-    $id          = $cs[$customSearchesByName[$info->key]];
+    $cs = $this->getCustomSearchesById();
+    $id = $cs[$customSearchesByName[$info->key]];
     $optionValue = CRM_Core_BAO_OptionValue::del($id);
 
     return TRUE;
@@ -104,8 +104,8 @@ class CRM_Extension_Manager_Search extends CRM_Extension_Manager_Base {
    */
   public function onPreDisable(CRM_Extension_Info $info) {
     $customSearchesByName = $this->getCustomSearchesByName();
-    $cs          = $this->getCustomSearchesById();
-    $id          = $cs[$customSearchesByName[$info->key]];
+    $cs = $this->getCustomSearchesById();
+    $id = $cs[$customSearchesByName[$info->key]];
     $optionValue = CRM_Core_BAO_OptionValue::setIsActive($id, 0);
   }
 
@@ -114,8 +114,8 @@ class CRM_Extension_Manager_Search extends CRM_Extension_Manager_Base {
    */
   public function onPreEnable(CRM_Extension_Info $info) {
     $customSearchesByName = $this->getCustomSearchesByName();
-    $cs          = $this->getCustomSearchesById();
-    $id          = $cs[$customSearchesByName[$info->key]];
+    $cs = $this->getCustomSearchesById();
+    $id = $cs[$customSearchesByName[$info->key]];
     $optionValue = CRM_Core_BAO_OptionValue::setIsActive($id, 1);
   }
 
index b7af63b929b0e42c02e4f5e958914d1a0f084a91..d664af865a3efec31d5c396c59d3ba307bb37d69 100644 (file)
@@ -38,7 +38,6 @@
  * Create a subclass for a specific format.
  * @see http://wiki.civicrm.org/confluence/display/CRM/CiviAccounts+Specifications+-++Batches#CiviAccountsSpecifications-Batches-%C2%A0Overviewofimplementation
  */
-
 class CRM_Financial_BAO_ExportFormat {
 
   /*
index 393c9a33f90531e839acbdbd63c1dfe0770df674..207a595cc5ef68a2046e77dc3326928b45878d67 100644 (file)
@@ -175,7 +175,7 @@ class CRM_Financial_BAO_ExportFormat_CSV extends CRM_Financial_BAO_ExportFormat
       $this->_batchIds = $batchId;
       while ($dao->fetch()) {
         $creditAccountName = $creditAccountType =
-          $creditAccount = NULL;
+        $creditAccount = NULL;
         if ($dao->credit_account) {
           $creditAccountName = $dao->credit_account_name;
           $creditAccountType = $dao->credit_account_type_code;
index 50025c8bb59c53cf1244e2e18499f406f7781d2c..017efe54cf55a37ff54e8f04d228218b8df6daf0 100644 (file)
@@ -33,7 +33,6 @@
  * $Id$
  *
  */
-
 class CRM_Financial_BAO_FinancialAccount extends CRM_Financial_DAO_FinancialAccount {
 
   /**
@@ -134,7 +133,7 @@ class CRM_Financial_BAO_FinancialAccount extends CRM_Financial_DAO_FinancialAcco
     $dependancy = array(
       array('Core', 'FinancialTrxn', 'to_financial_account_id'),
       array('Financial', 'FinancialTypeAccount', 'financial_account_id'),
-      );
+    );
     foreach ($dependancy as $name) {
       require_once str_replace('_', DIRECTORY_SEPARATOR, "CRM_" . $name[0] . "_BAO_" . $name[1]) . ".php";
       $className = "CRM_{$name[0]}_BAO_{$name[1]}";
index ade03e298b01b4edcc26b904e9038c3c3ead8986..6b2d0d38acf1ec332493ecaa455ab5e91fb1c6e6 100644 (file)
@@ -32,7 +32,6 @@
  * $Id$
  *
  */
-
 class CRM_Financial_BAO_FinancialItem extends CRM_Financial_DAO_FinancialItem {
 
   /**
@@ -80,25 +79,27 @@ class CRM_Financial_BAO_FinancialItem extends CRM_Financial_DAO_FinancialItem {
     $financialItemStatus = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_FinancialItem', 'status_id');
     $itemStatus = NULL;
     if ($contribution->contribution_status_id == array_search('Completed', $contributionStatuses)
-      || $contribution->contribution_status_id == array_search('Pending refund', $contributionStatuses)) {
+      || $contribution->contribution_status_id == array_search('Pending refund', $contributionStatuses)
+    ) {
       $itemStatus = array_search('Paid', $financialItemStatus);
     }
     elseif ($contribution->contribution_status_id == array_search('Pending', $contributionStatuses)
-      || $contribution->contribution_status_id == array_search('In Progress', $contributionStatuses)) {
+      || $contribution->contribution_status_id == array_search('In Progress', $contributionStatuses)
+    ) {
       $itemStatus = array_search('Unpaid', $financialItemStatus);
     }
     elseif ($contribution->contribution_status_id == array_search('Partially paid', $contributionStatuses)) {
       $itemStatus = array_search('Partially paid', $financialItemStatus);
     }
     $params = array(
-      'transaction_date'  => CRM_Utils_Date::isoToMysql($contribution->receive_date),
-      'contact_id'        => $contribution->contact_id,
-      'amount'            => $lineItem->line_total,
-      'currency'          => $contribution->currency,
-      'entity_table'      => 'civicrm_line_item',
-      'entity_id'         => $lineItem->id,
-      'description'       => ($lineItem->qty != 1 ? $lineItem->qty . ' of ' : ''). ' ' . $lineItem->label,
-      'status_id'         => $itemStatus,
+      'transaction_date' => CRM_Utils_Date::isoToMysql($contribution->receive_date),
+      'contact_id' => $contribution->contact_id,
+      'amount' => $lineItem->line_total,
+      'currency' => $contribution->currency,
+      'entity_table' => 'civicrm_line_item',
+      'entity_id' => $lineItem->id,
+      'description' => ($lineItem->qty != 1 ? $lineItem->qty . ' of ' : '') . ' ' . $lineItem->label,
+      'status_id' => $itemStatus,
     );
 
     if ($taxTrxnID) {
@@ -113,8 +114,8 @@ class CRM_Financial_BAO_FinancialItem extends CRM_Financial_DAO_FinancialItem {
     }
     if ($lineItem->financial_type_id) {
       $searchParams = array(
-        'entity_table'         => 'civicrm_financial_type',
-        'entity_id'            => $lineItem->financial_type_id,
+        'entity_table' => 'civicrm_financial_type',
+        'entity_id' => $lineItem->financial_type_id,
         'account_relationship' => $accountRel,
       );
 
@@ -159,10 +160,10 @@ class CRM_Financial_BAO_FinancialItem extends CRM_Financial_DAO_FinancialItem {
     $financialItem->save();
     if (!empty($trxnIds['id'])) {
       $entity_financial_trxn_params = array(
-        'entity_table'      => "civicrm_financial_item",
-        'entity_id'         => $financialItem->id,
+        'entity_table' => "civicrm_financial_item",
+        'entity_id' => $financialItem->id,
         'financial_trxn_id' => $trxnIds['id'],
-        'amount'            => $params['amount'],
+        'amount' => $params['amount'],
       );
 
       $entity_trxn = new CRM_Financial_DAO_EntityFinancialTrxn();
@@ -219,11 +220,11 @@ class CRM_Financial_BAO_FinancialItem extends CRM_Financial_DAO_FinancialItem {
     $financialItem->find();
     while ($financialItem->fetch()) {
       $financialItems[$financialItem->id] = array(
-        'id'                => $financialItem->id,
-        'entity_table'      => $financialItem->entity_table,
-        'entity_id'         => $financialItem->entity_id,
+        'id' => $financialItem->id,
+        'entity_table' => $financialItem->entity_table,
+        'entity_id' => $financialItem->entity_id,
         'financial_trxn_id' => $financialItem->financial_trxn_id,
-        'amount'            => $financialItem->amount,
+        'amount' => $financialItem->amount,
       );
     }
     if (!empty($financialItems)) {
index 8fe113f6b2a8f2f27136a8788b347190a7162d56..69a6fc7ef088810f8b967aa2ec9c3a2af9dada92 100644 (file)
@@ -33,7 +33,6 @@
  * $Id$
  *
  */
-
 class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType {
 
   /**
index ed86a631483594eeb7047bedf558a3ec8b067ac6..05d30add3cac051146cfe0ad9297d02be8add776 100644 (file)
@@ -32,7 +32,6 @@
  * $Id$
  *
  */
-
 class CRM_Financial_BAO_FinancialTypeAccount extends CRM_Financial_DAO_EntityFinancialAccount {
 
   /**
index d32fde8ffab3704a78bbb437905236d274624d29..2558a784355a60ba53d3a7f9b62090a3f1b5a8e4 100644 (file)
@@ -194,8 +194,8 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces
       CRM_Core_Error::fatal(ts('Invalid value passed to getPayment function'));
     }
 
-    $dao            = new CRM_Financial_DAO_PaymentProcessor();
-    $dao->id        = $paymentProcessorID;
+    $dao = new CRM_Financial_DAO_PaymentProcessor();
+    $dao->id = $paymentProcessorID;
     $dao->is_active = 1;
     if (!$dao->find(TRUE)) {
       return NULL;
@@ -203,9 +203,9 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces
 
     if ($mode == 'test') {
       $testDAO = new CRM_Financial_DAO_PaymentProcessor();
-      $testDAO->name      = $dao->name;
+      $testDAO->name = $dao->name;
       $testDAO->is_active = 1;
-      $testDAO->is_test   = 1;
+      $testDAO->is_test = 1;
       if (!$testDAO->find(TRUE)) {
         CRM_Core_Error::fatal(ts('Could not retrieve payment processor details'));
       }
@@ -268,10 +268,23 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces
    */
   public static function buildPayment($dao, $mode) {
     $fields = array(
-      'id', 'name', 'payment_processor_type_id', 'user_name', 'password',
-      'signature', 'url_site', 'url_api', 'url_recur', 'url_button',
-      'subject', 'class_name', 'is_recur', 'billing_mode', 'is_test',
-      'payment_type', 'is_default',
+      'id',
+      'name',
+      'payment_processor_type_id',
+      'user_name',
+      'password',
+      'signature',
+      'url_site',
+      'url_api',
+      'url_recur',
+      'url_button',
+      'subject',
+      'class_name',
+      'is_recur',
+      'billing_mode',
+      'is_test',
+      'payment_type',
+      'is_default',
     );
     $result = array();
     foreach ($fields as $name) {
@@ -295,16 +308,20 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces
    * @return array
    */
   public static function getAllPaymentProcessors($mode, $reset = FALSE) {
-   /**
-   * $cacheKey = 'CRM_Financial_BAO_Payment_Processor_' . ($mode ? 'test' : 'all');
-   if (!$reset) {
-     $processors = CRM_Utils_Cache::singleton()->get($cacheKey);
-     if (!empty($processors)) {
-       return $processors;
-     }
-   }
+    /**
+     * $cacheKey = 'CRM_Financial_BAO_Payment_Processor_' . ($mode ? 'test' : 'all');
+     * if (!$reset) {
+     $processors = CRM_Utils_Cache::singleton()->get($cacheKey);
+     if (!empty($processors)) {
+     * return $processors;
+     }
+     * }
      * */
-    $retrievalParameters = array('is_active' => TRUE, 'options' => array('sort' => 'is_default DESC, name'), 'api.payment_processor_type.getsingle' => 1);
+    $retrievalParameters = array(
+      'is_active' => TRUE,
+      'options' => array('sort' => 'is_default DESC, name'),
+      'api.payment_processor_type.getsingle' => 1
+    );
     if ($mode == 'test') {
       $retrievalParameters['is_test'] = 1;
     }
@@ -407,7 +424,11 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces
   public static function getProcessorForEntity($entityID, $component = 'contribute', $type = 'id') {
     $result = NULL;
     if (!in_array($component, array(
-      'membership', 'contribute', 'recur'))) {
+      'membership',
+      'contribute',
+      'recur'
+    ))
+    ) {
       return $result;
     }
     //FIXME:
index 2cfd7adf1b89633d4605eabca74022e35b38d883..3f9d3f030cbbdd80f55f35b9cd807c2d192436cf 100644 (file)
@@ -72,6 +72,7 @@ class CRM_Financial_Form_BatchTransaction extends CRM_Contribute_Form {
       $this->assign('columnHeaders', $columnHeaders);
     }
   }
+
   /**
    * Build the form object
    *
@@ -134,7 +135,7 @@ class CRM_Financial_Form_BatchTransaction extends CRM_Contribute_Form {
     $this->addButtons(
       array(
         array(
-    'type' => 'submit',
+          'type' => 'submit',
           'name' => ts('Search'),
           'isDefault' => TRUE,
         ),
@@ -178,15 +179,15 @@ class CRM_Financial_Form_BatchTransaction extends CRM_Contribute_Form {
   public function &links() {
     if (!(self::$_links)) {
       self::$_links = array(
-        'view'  => array(
-          'name'  => ts('View'),
-          'url'   => 'civicrm/contact/view/contribution',
-          'qs'    => 'reset=1&id=%%contid%%&cid=%%cid%%&action=view&context=contribution&selectedChild=contribute',
+        'view' => array(
+          'name' => ts('View'),
+          'url' => 'civicrm/contact/view/contribution',
+          'qs' => 'reset=1&id=%%contid%%&cid=%%cid%%&action=view&context=contribution&selectedChild=contribute',
           'title' => ts('View Contribution'),
         ),
         'assign' => array(
-          'name'  => ts('Assign'),
-          'ref'   => 'disable-action',
+          'name' => ts('Assign'),
+          'ref' => 'disable-action',
           'title' => ts('Assign Transaction'),
           'extra' => 'onclick = "assignRemove( %%id%%,\'' . 'assign' . '\' );"',
         ),
index e60ac153c32bb92e9fb981caa7681b9f52caa073..e1a7bf2f1313f7a50452c357fa2da7192bc3108e 100644 (file)
@@ -63,7 +63,8 @@ class CRM_Financial_Form_FinancialAccount extends CRM_Contribute_Form {
       $financialAccountType = CRM_Core_PseudoConstant::accountOptionValues('financial_account_type');
       if ($financialAccount->financial_account_type_id == array_search('Asset', $financialAccountType)
         && strtolower($financialAccount->account_type_code) == 'ar'
-        && !CRM_Financial_BAO_FinancialAccount::getARAccounts($this->_id, array_search('Asset', $financialAccountType))) {
+        && !CRM_Financial_BAO_FinancialAccount::getARAccounts($this->_id, array_search('Asset', $financialAccountType))
+      ) {
         $this->_isARFlag = TRUE;
         if ($this->_action & CRM_Core_Action::DELETE) {
           $msg = ts("The selected financial account cannot be deleted because at least one Accounts Receivable type account is required (to ensure that accounting transactions are in balance).");
@@ -95,7 +96,10 @@ class CRM_Financial_Form_FinancialAccount extends CRM_Contribute_Form {
     $this->add('text', 'description', ts('Description'), $attributes['description']);
     $this->add('text', 'accounting_code', ts('Accounting Code'), $attributes['accounting_code']);
     $elementAccounting = $this->add('text', 'account_type_code', ts('Account Type Code'), $attributes['account_type_code']);
-    $this->addEntityRef('contact_id', ts('Owner'), array('api' => array('params' => array('contact_type' => 'Organization')), 'create' => TRUE));
+    $this->addEntityRef('contact_id', ts('Owner'), array(
+        'api' => array('params' => array('contact_type' => 'Organization')),
+        'create' => TRUE
+      ));
     $this->add('text', 'tax_rate', ts('Tax Rate'), $attributes['tax_rate']);
     $this->add('checkbox', 'is_deductible', ts('Tax-Deductible?'));
     $elementActive = $this->add('checkbox', 'is_active', ts('Enabled?'));
@@ -119,7 +123,8 @@ class CRM_Financial_Form_FinancialAccount extends CRM_Contribute_Form {
     }
 
     if ($this->_action == CRM_Core_Action::UPDATE &&
-      CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialAccount', $this->_id, 'is_reserved')) {
+      CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialAccount', $this->_id, 'is_reserved')
+    ) {
       $this->freeze(array('name', 'description', 'is_active'));
     }
     $this->addFormRule(array('CRM_Financial_Form_FinancialAccount', 'formRule'), $this);
@@ -158,7 +163,7 @@ class CRM_Financial_Form_FinancialAccount extends CRM_Contribute_Form {
       if (!(isset($values['is_tax']))) {
         $relationshipId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Sales Tax Account is' "));
         $params = array(
-          'financial_account_id'  => $self->_id,
+          'financial_account_id' => $self->_id,
           'account_relationship' => $relationshipId,
         );
         $result = CRM_Financial_BAO_FinancialTypeAccount::retrieve($params, $defaults);
index 4e611b9cb9513f38f7780021175154296a972193..8967ce4bc89d6b9b5f95804bf43d63452e124508 100644 (file)
@@ -64,13 +64,15 @@ class CRM_Financial_Form_FinancialBatch extends CRM_Contribute_Form {
             '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'
+        ),
       );
 
       $createdID = CRM_Core_DAO::getFieldValue('CRM_Batch_DAO_Batch', $this->_id, 'created_id');
@@ -275,7 +277,8 @@ class CRM_Financial_Form_FinancialBatch extends CRM_Contribute_Form {
       $session->replaceUserContext(CRM_Utils_System::url('civicrm', 'reset=1'));
     }
     elseif (($buttonName == $this->getButtonName('next') & $this->_action == CRM_Core_Action::UPDATE) ||
-      ($buttonName == $this->getButtonName('next') & $this->_action == CRM_Core_Action::ADD & $context == 1)) {
+      ($buttonName == $this->getButtonName('next') & $this->_action == CRM_Core_Action::ADD & $context == 1)
+    ) {
       $session->replaceUserContext(CRM_Utils_System::url('civicrm/financial/financialbatches',
         "reset=1&batchStatus=1"));
     }
index 3af2b89b484bd6b8d8b62b4be0348f0bd1be22db..f1d1e64515fd9ff0563919ee85ce8d8f542794f9 100644 (file)
@@ -111,7 +111,7 @@ class CRM_Financial_Form_FinancialTypeAccount extends CRM_Contribute_Form {
 
     $breadCrumb = array(
       array(
-    'title' => ts('Financial Type Accounts'),
+        'title' => ts('Financial Type Accounts'),
         'url' => $url,
       ),
     );
@@ -165,14 +165,14 @@ class CRM_Financial_Form_FinancialTypeAccount extends CRM_Contribute_Form {
     if ($this->_action == CRM_Core_Action::ADD) {
       if (!empty($this->_submitValues['account_relationship']) || !empty($this->_submitValues['financial_account_id'])) {
         $financialAccountType = array(
-           '5' => 5, //expense
-           '3' => 1, //AR relation
-           '1' => 3, //revenue
-           '6' => 1, //Asset
-           '7' => 4, //cost of sales
-           '8' => 1, //premium inventory
-           '9' => 3 //discount account is,
-          );
+          '5' => 5, //expense
+          '3' => 1, //AR relation
+          '1' => 3, //revenue
+          '6' => 1, //Asset
+          '7' => 4, //cost of sales
+          '8' => 1, //premium inventory
+          '9' => 3 //discount account is,
+        );
 
         $financialAccountType = CRM_Utils_Array::value($this->_submitValues['account_relationship'], $financialAccountType);
         $result = CRM_Contribute_PseudoConstant::financialAccount(NULL, $financialAccountType);
@@ -181,8 +181,8 @@ class CRM_Financial_Form_FinancialTypeAccount extends CRM_Contribute_Form {
       }
       else {
         $financialAccountSelect = array(
-          'select' => ts('- select -'),
-        ) + CRM_Contribute_PseudoConstant::financialAccount();
+            'select' => ts('- select -'),
+          ) + CRM_Contribute_PseudoConstant::financialAccount();
       }
     }
     if ($this->_action == CRM_Core_Action::UPDATE) {
@@ -194,7 +194,7 @@ class CRM_Financial_Form_FinancialTypeAccount extends CRM_Contribute_Form {
         '7' => 4, //cost of sales
         '8' => 1, //premium inventory
         '9' => 3 //discount account is,
-       );
+      );
 
       $financialAccountType = $financialAccountType[$this->_defaultValues['account_relationship']];
       $result = CRM_Contribute_PseudoConstant::financialAccount(NULL, $financialAccountType);
@@ -210,20 +210,21 @@ class CRM_Financial_Form_FinancialTypeAccount extends CRM_Contribute_Form {
     );
 
     $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'),
+        )
+      )
     );
     $this->addFormRule(array('CRM_Financial_Form_FinancialTypeAccount', 'formRule'), $this);
   }
@@ -265,7 +266,7 @@ class CRM_Financial_Form_FinancialTypeAccount extends CRM_Contribute_Form {
     if (!empty($values['account_relationship']) && !empty($values['financial_account_id'])) {
       $params = array(
         'account_relationship' => $values['account_relationship'],
-        'entity_id'            => $self->_aid,
+        'entity_id' => $self->_aid,
       );
       $defaults = array();
       if ($self->_action == CRM_Core_Action::ADD) {
index d136309f3a6d4756a130cb19edafdab383ea8eb8..d56c502170efc0425156203cc848bbf9dbc30118 100644 (file)
@@ -55,7 +55,8 @@ class CRM_Financial_Form_Search extends CRM_Core_Form {
   }
 
   public function buildQuickForm() {
-    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'packages/jquery/plugins/jquery.redirect.min.js', 0, 'html-header');
+    CRM_Core_Resources::singleton()
+      ->addScriptFile('civicrm', 'packages/jquery/plugins/jquery.redirect.min.js', 0, 'html-header');
     $attributes = CRM_Core_DAO::getAttribute('CRM_Batch_DAO_Batch');
     $attributes['total']['class'] = $attributes['item_count']['class'] = 'number';
     $this->add('text', 'title', ts('Batch Name'), $attributes['title']);
index 78e57f2b739376e959be5da78fefda555743f031..e2a61eb09d13bcf1a04c3d425a351d6d5835f0a4 100644 (file)
@@ -47,7 +47,8 @@ class CRM_Financial_Page_AJAX {
    */
   public static function jqFinancial($config) {
     if (!isset($_GET['_value']) ||
-      empty($_GET['_value'])) {
+      empty($_GET['_value'])
+    ) {
       CRM_Utils_System::civiExit();
     }
     $defaultId = NULL;
@@ -73,7 +74,7 @@ class CRM_Financial_Page_AJAX {
     }
     $elements = array(
       array(
-        'name'  => ts('- select -'),
+        'name' => ts('- select -'),
         'value' => 'select',
       ),
     );
@@ -85,9 +86,9 @@ class CRM_Financial_Page_AJAX {
           $selectedArray['selected'] = 'Selected';
         }
         $elements[] = array(
-          'name'  => $name,
-          'value' => $id,
-        ) + $selectedArray;
+            'name' => $name,
+            'value' => $id,
+          ) + $selectedArray;
       }
     }
     CRM_Utils_JSON::output($elements);
@@ -98,7 +99,8 @@ class CRM_Financial_Page_AJAX {
    */
   public static function jqFinancialRelation($config) {
     if (!isset($_GET['_value']) ||
-      empty($_GET['_value'])) {
+      empty($_GET['_value'])
+    ) {
       CRM_Utils_System::civiExit();
     }
 
@@ -118,7 +120,7 @@ class CRM_Financial_Page_AJAX {
 
     $elements = array(
       array(
-        'name'  => ts('- Select Financial Account Relationship -'),
+        'name' => ts('- Select Financial Account Relationship -'),
         'value' => 'select',
       ),
     );
@@ -126,24 +128,24 @@ class CRM_Financial_Page_AJAX {
     $countResult = count($financialAccountType[$financialAccountTypeId]);
     if (!empty($result)) {
       foreach ($result as $id => $name) {
-        if (in_array($id, $financialAccountType[$financialAccountTypeId])  && $_GET['_value'] != 'select') {
+        if (in_array($id, $financialAccountType[$financialAccountTypeId]) && $_GET['_value'] != 'select') {
           if ($countResult != 1) {
             $elements[] = array(
-              'name'  => $name,
+              'name' => $name,
               'value' => $id,
             );
           }
           else {
             $elements[] = array(
-              'name'     => $name,
-              'value'    => $id,
+              'name' => $name,
+              'value' => $id,
               'selected' => 'Selected',
             );
           }
         }
         elseif ($_GET['_value'] == 'select') {
           $elements[] = array(
-            'name'  => $name,
+            'name' => $name,
             'value' => $id,
           );
         }
@@ -156,8 +158,9 @@ class CRM_Financial_Page_AJAX {
    * @param $config
    */
   public static function jqFinancialType($config) {
-    if (! isset($_GET['_value']) ||
-      empty($_GET['_value'])) {
+    if (!isset($_GET['_value']) ||
+      empty($_GET['_value'])
+    ) {
       CRM_Utils_System::civiExit();
     }
 
@@ -178,7 +181,7 @@ class CRM_Financial_Page_AJAX {
       }
     }
 
-    $entityID  = CRM_Utils_Array::value('entityID', $_POST);
+    $entityID = CRM_Utils_Array::value('entityID', $_POST);
     $methods = array(
       'assign' => 'addBatchEntity',
       'remove' => 'removeBatchEntity',
@@ -262,26 +265,26 @@ class CRM_Financial_Page_AJAX {
     $sortMapper =
       array(
         0 => '',
-    1 => '',
-    2 => 'sort_name',
+        1 => '',
+        2 => 'sort_name',
         3 => 'amount',
-    4 => 'trxn_id',
-    5 => 'transaction_date',
-    6 => 'payment_method',
-    7 => 'status',
-    8 => 'name',
+        4 => 'trxn_id',
+        5 => 'transaction_date',
+        6 => 'payment_method',
+        7 => 'status',
+        8 => 'name',
       );
 
-    $sEcho     = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
-    $offset    = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
-    $rowCount  = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
-    $sort      = isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : NULL;
+    $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
+    $offset = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
+    $rowCount = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
+    $sort = isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : NULL;
     $sortOrder = isset($_REQUEST['sSortDir_0']) ? CRM_Utils_Type::escape($_REQUEST['sSortDir_0'], 'String') : 'asc';
-    $context   = isset($_REQUEST['context']) ? CRM_Utils_Type::escape($_REQUEST['context'], 'String') : NULL;
-    $entityID  = isset($_REQUEST['entityID']) ? CRM_Utils_Type::escape($_REQUEST['entityID'], 'String') : NULL;
+    $context = isset($_REQUEST['context']) ? CRM_Utils_Type::escape($_REQUEST['context'], 'String') : NULL;
+    $entityID = isset($_REQUEST['entityID']) ? CRM_Utils_Type::escape($_REQUEST['entityID'], 'String') : NULL;
     $notPresent = isset($_REQUEST['notPresent']) ? CRM_Utils_Type::escape($_REQUEST['notPresent'], 'String') : NULL;
-    $statusID  = isset($_REQUEST['statusID']) ? CRM_Utils_Type::escape($_REQUEST['statusID'], 'String') : NULL;
-    $search    = isset($_REQUEST['search']) ? TRUE : FALSE;
+    $statusID = isset($_REQUEST['statusID']) ? CRM_Utils_Type::escape($_REQUEST['statusID'], 'String') : NULL;
+    $search = isset($_REQUEST['search']) ? TRUE : FALSE;
 
     $params = $_POST;
     if ($sort && $sortOrder) {
@@ -309,11 +312,11 @@ class CRM_Financial_Page_AJAX {
       array(
         'contact_type' => '',
         'sort_name' => ts('Contact Name'),
-        'amount'   => ts('Amount'),
-        'trxn_id'  => ts('Trxn ID'),
+        'amount' => ts('Amount'),
+        'trxn_id' => ts('Trxn ID'),
         'transaction_date' => ts('Received'),
         'payment_method' => ts('Payment Method'),
-        'status'  => ts('Status'),
+        'status' => ts('Status'),
         'name' => ts('Type'),
       );
 
@@ -325,10 +328,10 @@ class CRM_Financial_Page_AJAX {
     $params['rp'] = $rowCount;
 
     $params['context'] = $context;
-    $params['offset']   = ($params['page'] - 1) * $params['rp'];
+    $params['offset'] = ($params['page'] - 1) * $params['rp'];
     $params['rowCount'] = $params['rp'];
-    $params['sort']     = CRM_Utils_Array::value('sortBy', $params);
-    $params['total']    = 0;
+    $params['sort'] = CRM_Utils_Array::value('sortBy', $params);
+    $params['total'] = 0;
 
     // get batch list
     if (isset($notPresent)) {
@@ -450,8 +453,16 @@ class CRM_Financial_Page_AJAX {
     $iFilteredTotal = $iTotal = $params['total'];
     $selectorElements =
       array(
-        'check', 'contact_type', 'sort_name',
-        'amount', 'trxn_id', 'transaction_date', 'payment_method', 'status', 'name', 'action',
+        'check',
+        'contact_type',
+        'sort_name',
+        'amount',
+        'trxn_id',
+        'transaction_date',
+        'payment_method',
+        'status',
+        'name',
+        'action',
       );
 
     echo CRM_Utils_JSON::encodeDataTableSelector($financialitems, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
@@ -461,7 +472,7 @@ class CRM_Financial_Page_AJAX {
   public static function bulkAssignRemove() {
     $checkIDs = $_REQUEST['ID'];
     $entityID = CRM_Utils_Type::escape($_REQUEST['entityID'], 'String');
-    $action   = CRM_Utils_Type::escape($_REQUEST['action'], 'String');
+    $action = CRM_Utils_Type::escape($_REQUEST['action'], 'String');
     foreach ($checkIDs as $key => $value) {
       if ((substr($value, 0, 7) == "mark_x_" && $action == 'Assign') || (substr($value, 0, 7) == "mark_y_" && $action == 'Remove')) {
         $contributions = explode("_", $value);
@@ -473,7 +484,7 @@ class CRM_Financial_Page_AJAX {
     $paymentInstrument = CRM_Core_OptionGroup::getLabel('payment_instrument', $batchPID);
     foreach ($cIDs as $key => $value) {
       $recordPID = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialTrxn', $value, 'payment_instrument_id');
-      if ($action == 'Remove' || ($recordPID == $batchPID && $action == 'Assign')  || !isset($batchPID)) {
+      if ($action == 'Remove' || ($recordPID == $batchPID && $action == 'Assign') || !isset($batchPID)) {
         $params =
           array(
             'entity_id' => $value,
index 9b755a7e245d74297758e8a7f1ec0ace19c544ef..57f55f87601a0becc2400e17ffd4d1e246891107 100644 (file)
@@ -49,6 +49,7 @@ class CRM_Financial_Page_BatchTransaction extends CRM_Core_Page_Basic {
 
   static $_columnHeader = NULL;
   static $_returnvalues = NULL;
+
   /**
    * Get BAO Name
    *
@@ -68,14 +69,14 @@ class CRM_Financial_Page_BatchTransaction extends CRM_Core_Page_Basic {
   public function &links() {
     if (!(self::$_links)) {
       self::$_links = array(
-        'view'  => array(
-          'name'  => ts('View'),
-          'url'   => 'civicrm/contact/view/contribution',
-          'qs'    => 'reset=1&id=%%contid%%&cid=%%cid%%&action=view&context=contribution&selectedChild=contribute',
+        'view' => array(
+          'name' => ts('View'),
+          'url' => 'civicrm/contact/view/contribution',
+          'qs' => 'reset=1&id=%%contid%%&cid=%%cid%%&action=view&context=contribution&selectedChild=contribute',
           'title' => ts('View Contribution'),
         ),
-        'remove'  => array(
-          'name'  => ts('Remove'),
+        'remove' => array(
+          'name' => ts('Remove'),
           'title' => ts('Remove Transaction'),
           'extra' => 'onclick = "assignRemove( %%id%%,\'' . 'remove' . '\' );"',
         ),
index 85016d9dcd6c15714a10c94df69d48f70ff6c565..4cf2d9aab7eda4af86bd7705a57a8381524f7ed0 100644 (file)
@@ -66,26 +66,26 @@ class CRM_Financial_Page_FinancialAccount extends CRM_Core_Page_Basic {
   public function &links() {
     if (!(self::$_links)) {
       self::$_links = array(
-        CRM_Core_Action::UPDATE  => array(
-          'name'  => ts('Edit'),
-          'url'   => 'civicrm/admin/financial/financialAccount',
-          'qs'    => 'action=update&id=%%id%%&reset=1',
+        CRM_Core_Action::UPDATE => array(
+          'name' => ts('Edit'),
+          'url' => 'civicrm/admin/financial/financialAccount',
+          'qs' => 'action=update&id=%%id%%&reset=1',
           'title' => ts('Edit Financial Type'),
         ),
         CRM_Core_Action::DISABLE => array(
-          'name'  => ts('Disable'),
+          'name' => ts('Disable'),
           'ref' => 'crm-enable-disable',
           'title' => ts('Disable Financial Type'),
         ),
-        CRM_Core_Action::ENABLE  => array(
-          'name'  => ts('Enable'),
+        CRM_Core_Action::ENABLE => array(
+          'name' => ts('Enable'),
           'ref' => 'crm-enable-disable',
           'title' => ts('Enable Financial Type'),
         ),
-        CRM_Core_Action::DELETE  => array(
-          'name'  => ts('Delete'),
-          'url'   => 'civicrm/admin/financial/financialAccount',
-          'qs'    => 'action=delete&id=%%id%%',
+        CRM_Core_Action::DELETE => array(
+          'name' => ts('Delete'),
+          'url' => 'civicrm/admin/financial/financialAccount',
+          'qs' => 'action=delete&id=%%id%%',
           'title' => ts('Delete Financial Type'),
         ),
       );
index 69f16a72cdb6409905c414e13ceec750ba1b211e..afd44cafd0fc7013f6e96ea80782484154a96a6a 100644 (file)
@@ -90,7 +90,8 @@ class CRM_Financial_Page_FinancialBatch extends CRM_Core_Page_Basic {
         CRM_Core_Action::ADD |
         CRM_Core_Action::CLOSE |
         CRM_Core_Action::REOPEN |
-        CRM_Core_Action::EXPORT)) {
+        CRM_Core_Action::EXPORT)
+    ) {
       $this->edit($action, $id);
     }
     // parent run
index 3a9eff56422a4353aaba51bc002e32a185b9b7b9..56563405b88b475e91fb2ade22dac476d7870785 100644 (file)
@@ -66,32 +66,32 @@ class CRM_Financial_Page_FinancialType extends CRM_Core_Page_Basic {
   public function &links() {
     if (!(self::$_links)) {
       self::$_links = array(
-        CRM_Core_Action::BROWSE  => array(
-          'name'  => ts('Accounts'),
-          'url'   => 'civicrm/admin/financial/financialType/accounts',
-          'qs'    => 'reset=1&action=browse&aid=%%id%%',
+        CRM_Core_Action::BROWSE => array(
+          'name' => ts('Accounts'),
+          'url' => 'civicrm/admin/financial/financialType/accounts',
+          'qs' => 'reset=1&action=browse&aid=%%id%%',
           'title' => ts('Accounts'),
         ),
-        CRM_Core_Action::UPDATE  => array(
-          'name'  => ts('Edit'),
-          'url'   => 'civicrm/admin/financial/financialType',
-          'qs'    => 'action=update&id=%%id%%&reset=1',
+        CRM_Core_Action::UPDATE => array(
+          'name' => ts('Edit'),
+          'url' => 'civicrm/admin/financial/financialType',
+          'qs' => 'action=update&id=%%id%%&reset=1',
           'title' => ts('Edit Financial Type'),
         ),
         CRM_Core_Action::DISABLE => array(
-          'name'  => ts('Disable'),
-          'ref'   => 'crm-enable-disable',
+          'name' => ts('Disable'),
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Financial Type'),
         ),
-        CRM_Core_Action::ENABLE  => array(
-          'name'  => ts('Enable'),
-          'ref'   => 'crm-enable-disable',
+        CRM_Core_Action::ENABLE => array(
+          'name' => ts('Enable'),
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Financial Type'),
         ),
-        CRM_Core_Action::DELETE  => array(
-          'name'  => ts('Delete'),
-          'url'   => 'civicrm/admin/financial/financialType',
-          'qs'    => 'action=delete&id=%%id%%',
+        CRM_Core_Action::DELETE => array(
+          'name' => ts('Delete'),
+          'url' => 'civicrm/admin/financial/financialType',
+          'qs' => 'action=delete&id=%%id%%',
           'title' => ts('Delete Financial Type'),
         ),
       );
index b8d4ef470001f0861999704f3031a09f9b7a9e7f..aa64938088858f482d3209c738c5da62ced52094 100644 (file)
@@ -72,13 +72,13 @@ class CRM_Financial_Page_FinancialTypeAccount extends CRM_Core_Page {
   public function &links() {
     if (!(self::$_links)) {
       self::$_links = array(
-        CRM_Core_Action::UPDATE  => array(
+        CRM_Core_Action::UPDATE => array(
           'name' => ts('Edit'),
           'url' => 'civicrm/admin/financial/financialType/accounts',
           'qs' => 'action=update&id=%%id%%&aid=%%aid%%&reset=1',
           'title' => ts('Edit Financial Type Account'),
         ),
-        CRM_Core_Action::DELETE  => array(
+        CRM_Core_Action::DELETE => array(
           'name' => ts('Delete'),
           'url' => 'civicrm/admin/financial/financialType/accounts',
           'qs' => 'action=delete&id=%%id%%&aid=%%aid%%',
index f9141f7b38076709ff4009dafab63c7a40546ae8..933bf930cc77f5acc5bf4f5e020469b6608529e9 100644 (file)
@@ -156,7 +156,7 @@ class CRM_Friend_BAO_Friend extends CRM_Friend_DAO_Friend {
       // attempt to save activity targets
       $targetParams = array(
         'activity_id' => $activity->id,
-        'contact_id'  => $contact,
+        'contact_id' => $contact,
         'record_type_id' => $targetID,
       );
 
index 4337dd04151186a266ba8838c3207d8d5db762c9..4ae16be265c598dbf4372176c973968375824953 100644 (file)
@@ -74,14 +74,16 @@ class CRM_Friend_Form extends CRM_Core_Form {
     $pcomponent = CRM_Utils_Request::retrieve('pcomponent', 'String', $this, TRUE);
 
     if (in_array($pcomponent, array(
-      'contribute', 'event'))) {
+      'contribute',
+      'event'
+    ))) {
       $values = array();
       $params = array('id' => $this->_entityId);
       CRM_Core_DAO::commonRetrieve('CRM_Contribute_DAO_ContributionPage',
         $params, $values, array('title', 'campaign_id', 'is_share')
       );
-      $this->_title       = CRM_Utils_Array::value('title', $values);
-      $this->_campaignId  = CRM_Utils_Array::value('campaign_id', $values);
+      $this->_title = CRM_Utils_Array::value('title', $values);
+      $this->_campaignId = CRM_Utils_Array::value('campaign_id', $values);
       $this->_entityTable = 'civicrm_contribution_page';
       if ($pcomponent == 'event') {
         $this->_entityTable = 'civicrm_event';
@@ -310,9 +312,9 @@ class CRM_Friend_Form extends CRM_Core_Form {
       require_once 'CRM/PCP/BAO/PCP.php';
       if ($linkText = CRM_PCP_BAO_PCP::getPcpBlockStatus($defaults['entity_id'], $defaults['entity_table'])) {
         $linkTextUrl = CRM_Utils_System::url('civicrm/contribute/campaign',
-                                                      "action=add&reset=1&pageId={$defaults['entity_id']}&component=event",
-                                                      FALSE, NULL, TRUE,
-                                                      TRUE);
+          "action=add&reset=1&pageId={$defaults['entity_id']}&component=event",
+          FALSE, NULL, TRUE,
+          TRUE);
         $this->assign('linkTextUrl', $linkTextUrl);
         $this->assign('linkText', $linkText);
       }
index 4b5764d104c81cba483ac5ff56fd5cce5ca0f573..8049eda709e481a94e1cf023de9e19e7c8dc2c88 100644 (file)
@@ -404,11 +404,12 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
 
       $fields = CRM_Grant_DAO_Grant::export();
       $grantNote = array(
-      'grant_note' => array(
-      'title' => ts('Grant Note'),
+        'grant_note' => array(
+          'title' => ts('Grant Note'),
           'name' => 'grant_note',
           'data_type' => CRM_Utils_Type::T_TEXT,
-        ));
+        )
+      );
       $fields = array_merge($fields, $grantFields, $grantNote,
         CRM_Core_BAO_CustomField::getFieldsForImport('Grant')
       );
index cf29d36424dadc13a47f497e99349f964424e2df..b13da2a976d595d7bc5f9783c94abace3c7a0023 100644 (file)
@@ -211,7 +211,10 @@ class CRM_Grant_BAO_Query {
 
         $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause('civicrm_grant.grant_type_id', $op, $value, "Integer");
 
-        $query->_qill[$grouping][] = ts('Grant Type %2 %1', array(1 => implode(' ' . ts('or') . ' ', $names), 2 => $op));
+        $query->_qill[$grouping][] = ts('Grant Type %2 %1', array(
+            1 => implode(' ' . ts('or') . ' ', $names),
+            2 => $op
+          ));
         $query->_tables['civicrm_grant'] = $query->_whereTables['civicrm_grant'] = 1;
 
         return;
@@ -244,7 +247,10 @@ class CRM_Grant_BAO_Query {
 
         $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause('civicrm_grant.status_id', $op, $value, "Integer");
 
-        $query->_qill[$grouping][] = ts('Grant Status %2 %1', array(1 => implode(' ' . ts('or') . ' ', $names), 2 => $op));
+        $query->_qill[$grouping][] = ts('Grant Status %2 %1', array(
+            1 => implode(' ' . ts('or') . ' ', $names),
+            2 => $op
+          ));
         $query->_tables['civicrm_grant'] = $query->_whereTables['civicrm_grant'] = 1;
 
         return;
index 773cebee6af44ddd0d11d9c55739a0ee63a2bd28..32c62f1a0cb0e4ab38ba60a927432b114a0b0172 100644 (file)
@@ -32,4 +32,5 @@
  * $Id$
  *
  */
-class CRM_Grant_Config extends CRM_Core_Component_Config {}
+class CRM_Grant_Config extends CRM_Core_Component_Config {
+}
index 69161a90ea079ba61fe7e474a3be428b0f3f79ae..3ce8f35a2285b3db62cca2601bb90efd3bf609f9 100644 (file)
@@ -71,7 +71,7 @@ class CRM_Grant_Form_Grant extends CRM_Core_Form {
     }
 
     $this->_contactID = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
-    $this->_id        = CRM_Utils_Request::retrieve('id', 'Positive', $this);
+    $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
     $this->_grantType = NULL;
     if ($this->_id) {
       $this->_grantType =
@@ -231,22 +231,22 @@ class CRM_Grant_Form_Grant extends CRM_Core_Form {
     // make this form an upload since we dont know if the custom data injected dynamically
     // is of type file etc $uploadNames = $this->get( 'uploadNames' );
     $this->addButtons(array(
-      array(
-        'type' => 'upload',
-        'name' => ts('Save'),
-        'isDefault' => TRUE,
-      ),
-      array(
-        'type' => 'upload',
-        'name' => ts('Save and New'),
-        'js' => array('onclick' => "return verify( );"),
-        'subName' => 'new',
-      ),
-      array(
-        'type' => 'cancel',
-        'name' => ts('Cancel'),
-      ),
-     )
+        array(
+          'type' => 'upload',
+          'name' => ts('Save'),
+          'isDefault' => TRUE,
+        ),
+        array(
+          'type' => 'upload',
+          'name' => ts('Save and New'),
+          'js' => array('onclick' => "return verify( );"),
+          'subName' => 'new',
+        ),
+        array(
+          'type' => 'cancel',
+          'name' => ts('Cancel'),
+        ),
+      )
     );
 
     if ($this->_context == 'standalone') {
@@ -315,19 +315,19 @@ class CRM_Grant_Form_Grant extends CRM_Core_Form {
     if ($this->_context == 'standalone') {
       if ($buttonName == $this->getButtonName('upload', 'new')) {
         $session->replaceUserContext(CRM_Utils_System::url('civicrm/grant/add',
-            'reset=1&action=add&context=standalone'
-          ));
+          'reset=1&action=add&context=standalone'
+        ));
       }
       else {
         $session->replaceUserContext(CRM_Utils_System::url('civicrm/contact/view',
-            "reset=1&cid={$this->_contactID}&selectedChild=grant"
-          ));
+          "reset=1&cid={$this->_contactID}&selectedChild=grant"
+        ));
       }
     }
     elseif ($buttonName == $this->getButtonName('upload', 'new')) {
       $session->replaceUserContext(CRM_Utils_System::url('civicrm/contact/view/grant',
-          "reset=1&action=add&context=grant&cid={$this->_contactID}"
-        ));
+        "reset=1&action=add&context=grant&cid={$this->_contactID}"
+      ));
     }
   }
 }
index 0dfa32303d4124806b2e96aea287f024e83850f7..18e92c7ca3cc98941e424db40ad9ab0d7eb6df53 100644 (file)
@@ -46,8 +46,8 @@ class CRM_Grant_Form_GrantView extends CRM_Core_Form {
    */
   public function preProcess() {
     $this->_contactID = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
-    $this->_id        = CRM_Utils_Request::retrieve('id', 'Positive', $this);
-    $context          = CRM_Utils_Request::retrieve('context', 'String', $this);
+    $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
+    $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $this->assign('context', $context);
 
     $values = array();
@@ -58,9 +58,15 @@ class CRM_Grant_Form_GrantView extends CRM_Core_Form {
     $this->assign('grantType', $grantType[$values['grant_type_id']]);
     $this->assign('grantStatus', $grantStatus[$values['status_id']]);
     $grantTokens = array(
-      'amount_total', 'amount_requested', 'amount_granted',
-      'rationale', 'grant_report_received', 'application_received_date',
-      'decision_date', 'money_transfer_date', 'grant_due_date',
+      'amount_total',
+      'amount_requested',
+      'amount_granted',
+      'rationale',
+      'grant_report_received',
+      'application_received_date',
+      'decision_date',
+      'money_transfer_date',
+      'grant_due_date',
     );
 
     foreach ($grantTokens as $token) {
index 83b163d68dbf48e2c72e4089c58a7928bd34ce5c..86475af3b167f7303da04a1ef878a7d57d270fc7 100644 (file)
@@ -92,9 +92,9 @@ class CRM_Grant_Form_Search extends CRM_Core_Form_Search {
          * driven by the wizard framework
          */
 
-    $this->_reset   = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
-    $this->_force   = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE);
-    $this->_limit   = CRM_Utils_Request::retrieve('limit', 'Positive', $this);
+    $this->_reset = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
+    $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE);
+    $this->_limit = CRM_Utils_Request::retrieve('limit', 'Positive', $this);
     $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'search');
 
     $this->assign("context", $this->_context);
index a0b3b8221a9f788d354dc3c586c8b535f17cf389..00be8531225a7f90e0432eb59064da357b8b769a 100644 (file)
@@ -102,7 +102,7 @@ class CRM_Grant_Form_Task extends CRM_Core_Form {
     else {
       $queryParams = $form->get('queryParams');
       $sortOrder = NULL;
-      if ($form->get(CRM_Utils_Sort::SORT_ORDER )) {
+      if ($form->get(CRM_Utils_Sort::SORT_ORDER)) {
         $sortOrder = $form->get(CRM_Utils_Sort::SORT_ORDER);
       }
       $query = new CRM_Contact_BAO_Query($queryParams, NULL, NULL, FALSE, FALSE,
index 127456278d13fc3ab93378ea36fc26d2ae0c684a..0176c5af35b00e17b99d83b9d87d370b0f86c9c9 100644 (file)
@@ -94,7 +94,7 @@ class CRM_Grant_Info extends CRM_Core_Component_Info {
    */
   public function registerTab() {
     return array(
-    'title' => ts('Grants'),
+      'title' => ts('Grants'),
       'url' => 'grant',
       'weight' => 50,
     );
@@ -106,7 +106,7 @@ class CRM_Grant_Info extends CRM_Core_Component_Info {
    */
   public function registerAdvancedSearchPane() {
     return array(
-    'title' => ts('Grants'),
+      'title' => ts('Grants'),
       'weight' => 50,
     );
   }
@@ -129,11 +129,12 @@ class CRM_Grant_Info extends CRM_Core_Component_Info {
     ) {
       $shortCuts = array_merge($shortCuts, array(
         array(
-      'path' => 'civicrm/grant/add',
-            'query' => "reset=1&action=add&context=standalone",
-            'ref' => 'new-grant',
-            'title' => ts('Grant'),
-          )));
+          'path' => 'civicrm/grant/add',
+          'query' => "reset=1&action=add&context=standalone",
+          'ref' => 'new-grant',
+          'title' => ts('Grant'),
+        )
+      ));
     }
   }
 }
index 97c126b98db1150f510095528f687a9f67ba0191..8feec27a85ef50beeed7f097d5e916eb029f931a 100644 (file)
@@ -104,9 +104,9 @@ class CRM_Grant_Page_Tab extends CRM_Contact_Page_View {
    * @return void
    */
   public function preProcess() {
-    $context       = CRM_Utils_Request::retrieve('context', 'String', $this);
+    $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
-    $this->_id     = CRM_Utils_Request::retrieve('id', 'Positive', $this);
+    $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
 
     if ($context == 'standalone') {
       $this->_action = CRM_Core_Action::ADD;
@@ -153,9 +153,9 @@ class CRM_Grant_Page_Tab extends CRM_Contact_Page_View {
   }
 
   public function setContext() {
-    $context   = CRM_Utils_Request::retrieve('context', 'String', $this);
+    $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $this->_id = CRM_Utils_Request::retrieve('id', 'Integer', $this);
-    $session   = CRM_Core_Session::singleton();
+    $session = CRM_Core_Session::singleton();
 
     $qfKey = CRM_Utils_Request::retrieve('key', 'String', $this);
     //validate the qfKey
@@ -201,8 +201,9 @@ class CRM_Grant_Page_Tab extends CRM_Contact_Page_View {
     $session->pushUserContext($url);
 
     if (CRM_Utils_Request::retrieve('confirmed', 'Boolean',
-        CRM_Core_DAO::$_nullObject
-      )) {
+      CRM_Core_DAO::$_nullObject
+    )
+    ) {
       CRM_Grant_BAO_Grant::del($this->_id);
       CRM_Utils_System::redirect($url);
     }
index 4905763d86712ef524f93111312a1b1e47cc0733..3bd0595360eb4db9e92d633a777f020f2ef2522e 100644 (file)
@@ -158,8 +158,8 @@ class CRM_Grant_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co
     // submitted form values
     $this->_queryParams = &$queryParams;
 
-    $this->_single  = $single;
-    $this->_limit   = $limit;
+    $this->_single = $single;
+    $this->_limit = $limit;
     $this->_context = $context;
 
     $this->_grantClause = $grantClause;
@@ -208,7 +208,7 @@ class CRM_Grant_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co
       if ($cid) {
         $delLink = array(
           CRM_Core_Action::DELETE => array(
-        'name' => ts('Delete'),
+            'name' => ts('Delete'),
             'url' => 'civicrm/contact/view/grant',
             'qs' => 'action=delete&reset=1&cid=%%cid%%&id=%%id%%&selectedChild=grant' . $extraParams,
             'title' => ts('Delete Grant'),
@@ -358,7 +358,7 @@ class CRM_Grant_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co
     if (!isset(self::$_columnHeaders)) {
       self::$_columnHeaders = array(
         array(
-      'name' => ts('Status'),
+          'name' => ts('Status'),
           'sort' => 'grant_status',
           'direction' => CRM_Utils_Sort::DONTCARE,
         ),
index 17e56abb6fd5bc2c60c551414e3a40920764eba1..e7d7490d188cfb6ff94f2895574b06a0eaa3b96b 100644 (file)
@@ -68,8 +68,8 @@ class CRM_Grant_Task {
   public static function &tasks() {
     if (!(self::$_tasks)) {
       self::$_tasks = array(
-      1 => array(
-        'title' => ts('Delete Grants'),
+        1 => array(
+          'title' => ts('Delete Grants'),
           'class' => 'CRM_Grant_Form_Task_Delete',
           'result' => FALSE,
         ),
index e112851194cc3152639145c89bf4150658e3ad5f..a3783da2fe2e08f6c00e39018ef09ef13d732038 100644 (file)
@@ -89,17 +89,19 @@ class CRM_Group_Form_Edit extends CRM_Core_Form {
   public function preProcess() {
     $this->_id = $this->get('id');
     if ($this->_id) {
-      $breadCrumb = array(array(
-      'title' => ts('Manage Groups'),
+      $breadCrumb = array(
+        array(
+          'title' => ts('Manage Groups'),
           'url' => CRM_Utils_System::url('civicrm/group',
             'reset=1'
           ),
-        ));
+        )
+      );
       CRM_Utils_System::appendBreadCrumb($breadCrumb);
 
       $this->_groupValues = array();
-      $params             = array('id' => $this->_id);
-      $this->_group       = CRM_Contact_BAO_Group::retrieve($params, $this->_groupValues);
+      $params = array('id' => $this->_id);
+      $this->_group = CRM_Contact_BAO_Group::retrieve($params, $this->_groupValues);
       $this->_title = $this->_groupValues['title'];
     }
 
@@ -125,7 +127,7 @@ class CRM_Group_Form_Edit extends CRM_Core_Form {
           'id' => $this->_id,
           'title' => $this->_title,
           'saved_search_id' =>
-          isset($this->_groupValues['saved_search_id']) ? $this->_groupValues['saved_search_id'] : '',
+            isset($this->_groupValues['saved_search_id']) ? $this->_groupValues['saved_search_id'] : '',
         );
         if (isset($this->_groupValues['saved_search_id'])) {
           $groupValues['mapping_id'] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch',
@@ -186,10 +188,11 @@ class CRM_Group_Form_Edit extends CRM_Core_Form {
     }
 
     if (!((CRM_Core_Permission::check('access CiviMail')) ||
-        (CRM_Mailing_Info::workflowEnabled() &&
-          CRM_Core_Permission::check('create mailings')
-        )
-      )) {
+      (CRM_Mailing_Info::workflowEnabled() &&
+        CRM_Core_Permission::check('create mailings')
+      )
+    )
+    ) {
       $groupTypes = CRM_Core_OptionGroup::values('group_type', TRUE);
       if ($defaults['group_type'][$groupTypes['Mailing List']] == 1) {
         $this->assign('freezeMailignList', $groupTypes['Mailing List']);
@@ -282,7 +285,7 @@ class CRM_Group_Form_Edit extends CRM_Core_Form {
         array(
           'type' => 'upload',
           'name' =>
-          ($this->_action == CRM_Core_Action::ADD) ? ts('Continue') : ts('Save'),
+            ($this->_action == CRM_Core_Action::ADD) ? ts('Continue') : ts('Save'),
           'isDefault' => TRUE,
         ),
         array(
index 28140f4b10a7d7750633cb03634863207feb754a..eeb8a34fb10a73d14315be28480cc344c3898ac6 100644 (file)
@@ -80,12 +80,12 @@ class CRM_Group_Form_Search extends CRM_Core_Form {
     );
 
     $this->addButtons(array(
-        array(
-          'type' => 'refresh',
-          'name' => ts('Search'),
-          'isDefault' => TRUE,
-        ),
-      ));
+      array(
+        'type' => 'refresh',
+        'name' => ts('Search'),
+        'isDefault' => TRUE,
+      ),
+    ));
 
     parent::buildQuickForm();
     $this->assign('suppressForm', TRUE);
index a5ed2d72b14d6bf51301fbe4e86317df68118d27..c8b00438268f011c3d8bc98fd2bdc4d7aea6a7f3 100644 (file)
@@ -42,7 +42,7 @@ class CRM_Group_Page_AJAX {
     if (isset($params['parent_id'])) {
       // requesting child groups for a given parent
       $params['page'] = 1;
-      $params['rp']   = 0;
+      $params['rp'] = 0;
       $groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
 
       CRM_Utils_JSON::output($groups);
@@ -50,17 +50,17 @@ class CRM_Group_Page_AJAX {
     else {
       $sortMapper = array(
         0 => 'groups.title',
-      1 => 'count',
-      2 => 'createdBy.sort_name',
-      3 => '',
+        1 => 'count',
+        2 => 'createdBy.sort_name',
+        3 => '',
         4 => 'groups.group_type',
-      5 => 'groups.visibility',
+        5 => 'groups.visibility',
       );
 
-      $sEcho     = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
-      $offset    = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
-      $rowCount  = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
-      $sort      = isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : NULL;
+      $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
+      $offset = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
+      $rowCount = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
+      $sort = isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : NULL;
       $sortOrder = isset($_REQUEST['sSortDir_0']) ? CRM_Utils_Type::escape($_REQUEST['sSortDir_0'], 'String') : 'asc';
 
       if ($sort && $sortOrder) {
@@ -77,7 +77,7 @@ class CRM_Group_Page_AJAX {
       // go ahead with flat hierarchy, CRM-12225
       if (empty($groups)) {
         $groupsAccessible = CRM_Core_PseudoConstant::group();
-        $parentsOnly      = CRM_Utils_Array::value('parentsOnly', $params);
+        $parentsOnly = CRM_Utils_Array::value('parentsOnly', $params);
         if (!empty($groupsAccessible) && $parentsOnly) {
           // recompute group list with flat hierarchy
           $params['parentsOnly'] = 0;
@@ -87,8 +87,15 @@ class CRM_Group_Page_AJAX {
 
       $iFilteredTotal = $iTotal = $params['total'];
       $selectorElements = array(
-        'group_name', 'count', 'created_by', 'group_description',
-        'group_type', 'visibility', 'org_info', 'links', 'class',
+        'group_name',
+        'count',
+        'created_by',
+        'group_description',
+        'group_type',
+        'visibility',
+        'org_info',
+        'links',
+        'class',
       );
 
       if (empty($params['showOrgInfo'])) {
index 91e83aa5eea7cf7bc9c249e080f2f889f8b3562c..ca0d8b4177f9ea7449d97e0c1c5d9a72c63e4846 100644 (file)
@@ -72,7 +72,10 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource {
     $form->assign('uploadSize', $uploadSize);
     $form->add('File', 'uploadFile', ts('Import Data File'), 'size=30 maxlength=255', TRUE);
     $form->setMaxFileSize($uploadFileSize);
-    $form->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(1 => $uploadSize, 2 => $uploadFileSize)), 'maxfilesize', $uploadFileSize);
+    $form->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(
+          1 => $uploadSize,
+          2 => $uploadFileSize
+        )), 'maxfilesize', $uploadFileSize);
     $form->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File');
     $form->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile');
 
@@ -144,9 +147,9 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource {
       $result['original_col_header'] = $firstrow;
 
       $strtolower = function_exists('mb_strtolower') ? 'mb_strtolower' : 'strtolower';
-      $columns    = array_map($strtolower, $firstrow);
-      $columns    = str_replace(' ', '_', $columns);
-      $columns    = preg_replace('/[^a-z_]/', '', $columns);
+      $columns = array_map($strtolower, $firstrow);
+      $columns = str_replace(' ', '_', $columns);
+      $columns = preg_replace('/[^a-z_]/', '', $columns);
 
       // need to take care of null as well as duplicate col names.
       $duplicateColName = FALSE;
@@ -207,7 +210,7 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource {
       rewind($fd);
     }
 
-    $sql   = NULL;
+    $sql = NULL;
     $first = TRUE;
     $count = 0;
     while ($row = fgetcsv($fd, 0, $fieldSeparator)) {
@@ -229,7 +232,7 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource {
         $sql = "INSERT IGNORE INTO $table VALUES $sql";
         $db->query($sql);
 
-        $sql   = NULL;
+        $sql = NULL;
         $first = TRUE;
         $count = 0;
       }
index 7bd33fd6daad8b13d9973067239a043204de7b02..fab0373472612482cac6c252804465d7db5b8f4e 100644 (file)
@@ -124,9 +124,9 @@ abstract class CRM_Import_Form_MapField extends CRM_Core_Form {
    * @return string
    */
   public function defaultFromData(&$patterns, $index) {
-    $best     = '';
+    $best = '';
     $bestHits = 0;
-    $n        = count($this->_dataValues);
+    $n = count($this->_dataValues);
 
     foreach ($patterns as $key => $re) {
       // Skip empty key/patterns
index 530e13f5641d8399ea93db48da9bac5b3db62c53..5bcb8fb99d760e16f544a2a6e58dab064cbdc88e 100644 (file)
@@ -32,8 +32,6 @@
  * $Id$
  *
  */
-
-
 abstract class CRM_Import_Parser {
   /**
    * Settings
index 231895b7cfbd974edb1d60f353f45ae8d76f446e..58c3697cee06ee547f2c07bc5d482517b6c39d71 100644 (file)
@@ -44,11 +44,11 @@ class CRM_Logging_Differ {
    * @param string $interval
    */
   public function __construct($log_conn_id, $log_date, $interval = '10 SECOND') {
-    $dsn               = defined('CIVICRM_LOGGING_DSN') ? DB::parseDSN(CIVICRM_LOGGING_DSN) : DB::parseDSN(CIVICRM_DSN);
-    $this->db          = $dsn['database'];
+    $dsn = defined('CIVICRM_LOGGING_DSN') ? DB::parseDSN(CIVICRM_LOGGING_DSN) : DB::parseDSN(CIVICRM_DSN);
+    $this->db = $dsn['database'];
     $this->log_conn_id = $log_conn_id;
-    $this->log_date    = $log_date;
-    $this->interval    = $interval;
+    $this->log_date = $log_date;
+    $this->interval = $interval;
   }
 
   /**
@@ -88,55 +88,55 @@ class CRM_Logging_Differ {
     if ($contactID) {
       $params[3] = array($contactID, 'Integer');
       switch ($table) {
-      case 'civicrm_contact':
-        $contactIdClause = "AND id = %3";
-        break;
+        case 'civicrm_contact':
+          $contactIdClause = "AND id = %3";
+          break;
 
-      case 'civicrm_note':
-        $contactIdClause = "AND (( entity_id = %3 AND entity_table = 'civicrm_contact' ) OR (entity_id IN (SELECT note.id FROM `{$this->db}`.log_civicrm_note note WHERE note.entity_id = %3 AND note.entity_table = 'civicrm_contact') AND entity_table = 'civicrm_note'))";
-        break;
+        case 'civicrm_note':
+          $contactIdClause = "AND (( entity_id = %3 AND entity_table = 'civicrm_contact' ) OR (entity_id IN (SELECT note.id FROM `{$this->db}`.log_civicrm_note note WHERE note.entity_id = %3 AND note.entity_table = 'civicrm_contact') AND entity_table = 'civicrm_note'))";
+          break;
 
-      case 'civicrm_entity_tag':
-        $contactIdClause = "AND entity_id = %3 AND entity_table = 'civicrm_contact'";
-        break;
+        case 'civicrm_entity_tag':
+          $contactIdClause = "AND entity_id = %3 AND entity_table = 'civicrm_contact'";
+          break;
 
-      case 'civicrm_relationship':
-        $contactIdClause = "AND (contact_id_a = %3 OR contact_id_b = %3)";
-        break;
+        case 'civicrm_relationship':
+          $contactIdClause = "AND (contact_id_a = %3 OR contact_id_b = %3)";
+          break;
 
-      case 'civicrm_activity':
-        $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
-        $sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
-        $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
-        $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
+        case 'civicrm_activity':
+          $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
+          $sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
+          $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
+          $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
 
-        $join  = "
+          $join = "
 LEFT JOIN civicrm_activity_contact at ON at.activity_id = lt.id AND at.contact_id = %3 AND at.record_type_id = {$targetID}
 LEFT JOIN civicrm_activity_contact aa ON aa.activity_id = lt.id AND aa.contact_id = %3 AND aa.record_type_id = {$assigneeID}
 LEFT JOIN civicrm_activity_contact source ON source.activity_id = lt.id AND source.contact_id = %3 AND source.record_type_id = {$sourceID} ";
-        $contactIdClause = "AND (at.id IS NOT NULL OR aa.id IS NOT NULL OR source.id IS NOT NULL)";
-        break;
-
-      case 'civicrm_case':
-        $contactIdClause = "AND id = (select case_id FROM civicrm_case_contact WHERE contact_id = %3 LIMIT 1)";
-        break;
+          $contactIdClause = "AND (at.id IS NOT NULL OR aa.id IS NOT NULL OR source.id IS NOT NULL)";
+          break;
 
-      default:
-        if (array_key_exists($table, $addressCustomTables)) {
-          $join  = "INNER JOIN `{$this->db}`.`log_civicrm_address` et ON et.id = lt.entity_id";
-          $contactIdClause = "AND contact_id = %3";
+        case 'civicrm_case':
+          $contactIdClause = "AND id = (select case_id FROM civicrm_case_contact WHERE contact_id = %3 LIMIT 1)";
           break;
-        }
 
-        // allow tables to be extended by report hook query objects
-        list($contactIdClause, $join) = CRM_Report_BAO_Hook::singleton()->logDiffClause($this, $table);
+        default:
+          if (array_key_exists($table, $addressCustomTables)) {
+            $join = "INNER JOIN `{$this->db}`.`log_civicrm_address` et ON et.id = lt.entity_id";
+            $contactIdClause = "AND contact_id = %3";
+            break;
+          }
 
-        if (empty($contactIdClause)) {
-          $contactIdClause = "AND contact_id = %3";
-        }
-        if (strpos($table, 'civicrm_value') !== FALSE) {
-          $contactIdClause = "AND entity_id = %3";
-        }
+          // allow tables to be extended by report hook query objects
+          list($contactIdClause, $join) = CRM_Report_BAO_Hook::singleton()->logDiffClause($this, $table);
+
+          if (empty($contactIdClause)) {
+            $contactIdClause = "AND contact_id = %3";
+          }
+          if (strpos($table, 'civicrm_value') !== FALSE) {
+            $contactIdClause = "AND entity_id = %3";
+          }
       }
     }
 
@@ -187,7 +187,9 @@ WHERE lt.log_conn_id = %1 AND
         case 'Delete':
           // the previous state is kept in the current state, current should keep the keys and clear the values
           $original = $changed;
-          foreach ($changed as & $val) $val = NULL;
+          foreach ($changed as & $val) {
+            $val = NULL;
+          }
           $changed['log_action'] = 'Delete';
           break;
 
@@ -280,7 +282,7 @@ WHERE lt.log_conn_id = %1 AND
         $values[$table] = array(
           'contribution_page_id' => CRM_Contribute_PseudoConstant::contributionPage(),
           'contribution_status_id' => CRM_Contribute_PseudoConstant::contributionStatus(),
-          'financial_type_id'              => CRM_Contribute_PseudoConstant::financialType(),
+          'financial_type_id' => CRM_Contribute_PseudoConstant::financialType(),
           'country_id' => CRM_Core_PseudoConstant::country(),
           'gender_id' => CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id'),
           'location_type_id' => CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'),
@@ -295,7 +297,7 @@ WHERE lt.log_conn_id = %1 AND
           'website_type_id' => CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id'),
           'activity_type_id' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE),
           'case_type_id' => CRM_Case_PseudoConstant::caseType('title', FALSE),
-          'priority_id'  => CRM_Core_PseudoConstant::get('CRM_Activity_DAO_Activity', 'priority_id'),
+          'priority_id' => CRM_Core_PseudoConstant::get('CRM_Activity_DAO_Activity', 'priority_id'),
         );
 
         // for columns that appear in more than 1 table
index 232d9a8dc72174a553792b297acb8855e6ce58f7..489eb3c1b5aee479785424be9b28340a0325d4c4 100644 (file)
@@ -59,12 +59,12 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form {
     $this->db = $dsn['database'];
 
     $this->log_conn_id = CRM_Utils_Request::retrieve('log_conn_id', 'Integer', CRM_Core_DAO::$_nullObject);
-    $this->log_date    = CRM_Utils_Request::retrieve('log_date', 'String', CRM_Core_DAO::$_nullObject);
-    $this->cid         = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject);
-    $this->raw         = CRM_Utils_Request::retrieve('raw', 'Boolean', CRM_Core_DAO::$_nullObject);
+    $this->log_date = CRM_Utils_Request::retrieve('log_date', 'String', CRM_Core_DAO::$_nullObject);
+    $this->cid = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject);
+    $this->raw = CRM_Utils_Request::retrieve('raw', 'Boolean', CRM_Core_DAO::$_nullObject);
 
-    $this->altered_name  = CRM_Utils_Request::retrieve('alteredName', 'String',  CRM_Core_DAO::$_nullObject);
-    $this->altered_by    = CRM_Utils_Request::retrieve('alteredBy',   'String',  CRM_Core_DAO::$_nullObject);
+    $this->altered_name = CRM_Utils_Request::retrieve('alteredName', 'String', CRM_Core_DAO::$_nullObject);
+    $this->altered_by = CRM_Utils_Request::retrieve('alteredBy', 'String', CRM_Core_DAO::$_nullObject);
     $this->altered_by_id = CRM_Utils_Request::retrieve('alteredById', 'Integer', CRM_Core_DAO::$_nullObject);
 
     parent::__construct();
@@ -72,19 +72,23 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form {
     CRM_Utils_System::resetBreadCrumb();
     $breadcrumb =
       array(
-            array(
-                  'title' => ts('Home'),
-                  'url' => CRM_Utils_System::url()),
-            array(
-                  'title' => ts('CiviCRM'),
-                  'url' => CRM_Utils_System::url('civicrm', 'reset=1')),
-            array(
-                  'title' => ts('View Contact'),
-                  'url' => CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$this->cid}")),
-            array(
-                  'title' => ts('Search Results'),
-                  'url' => CRM_Utils_System::url('civicrm/contact/search', "force=1")),
-            );
+        array(
+          'title' => ts('Home'),
+          'url' => CRM_Utils_System::url()
+        ),
+        array(
+          'title' => ts('CiviCRM'),
+          'url' => CRM_Utils_System::url('civicrm', 'reset=1')
+        ),
+        array(
+          'title' => ts('View Contact'),
+          'url' => CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$this->cid}")
+        ),
+        array(
+          'title' => ts('Search Results'),
+          'url' => CRM_Utils_System::url('civicrm/contact/search', "force=1")
+        ),
+      );
     CRM_Utils_System::appendBreadCrumb($breadcrumb);
 
     if (CRM_Utils_Request::retrieve('revert', 'Boolean', CRM_Core_DAO::$_nullObject)) {
@@ -164,8 +168,8 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form {
     $skipped = array('contact_id', 'entity_id', 'id');
     foreach ($diffs as $diff) {
       $field = $diff['field'];
-      $from  = $diff['from'];
-      $to    = $diff['to'];
+      $from = $diff['from'];
+      $to = $diff['to'];
 
       if ($this->raw) {
         $field = "$table.$field";
@@ -183,7 +187,8 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form {
         if ((substr($from, 0, 1) == CRM_Core_DAO::VALUE_SEPARATOR &&
             substr($from, -1, 1) == CRM_Core_DAO::VALUE_SEPARATOR) ||
           (substr($to, 0, 1) == CRM_Core_DAO::VALUE_SEPARATOR &&
-            substr($to, -1, 1) == CRM_Core_DAO::VALUE_SEPARATOR)) {
+            substr($to, -1, 1) == CRM_Core_DAO::VALUE_SEPARATOR)
+        ) {
           $froms = $tos = array();
           foreach (explode(CRM_Core_DAO::VALUE_SEPARATOR, trim($from, CRM_Core_DAO::VALUE_SEPARATOR)) as $val) {
             $froms[] = CRM_Utils_Array::value($val, $values[$field]);
@@ -192,7 +197,7 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form {
             $tos[] = CRM_Utils_Array::value($val, $values[$field]);
           }
           $from = implode(', ', array_filter($froms));
-          $to   = implode(', ', array_filter($tos));
+          $to = implode(', ', array_filter($tos));
         }
 
         if (isset($values[$field][$from])) {
@@ -227,9 +232,9 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form {
     );
 
     $this->assign('whom_url', CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$this->cid}"));
-    $this->assign('who_url',  CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$this->altered_by_id}"));
+    $this->assign('who_url', CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$this->altered_by_id}"));
     $this->assign('whom_name', $this->altered_name);
-    $this->assign('who_name',  $this->altered_by);
+    $this->assign('who_name', $this->altered_by);
 
     $this->assign('log_date', CRM_Utils_Date::mysqlToIso($this->log_date));
 
index 7fa86e6b16a81e6f823316ef1c40efd01193c352..4ec19735afacfc2d628d2f2dbdba0570daf081bf 100644 (file)
@@ -42,10 +42,10 @@ class CRM_Logging_Reverter {
    * @param $log_date
    */
   public function __construct($log_conn_id, $log_date) {
-    $dsn               = defined('CIVICRM_LOGGING_DSN') ? DB::parseDSN(CIVICRM_LOGGING_DSN) : DB::parseDSN(CIVICRM_DSN);
-    $this->db          = $dsn['database'];
+    $dsn = defined('CIVICRM_LOGGING_DSN') ? DB::parseDSN(CIVICRM_LOGGING_DSN) : DB::parseDSN(CIVICRM_DSN);
+    $this->db = $dsn['database'];
     $this->log_conn_id = $log_conn_id;
-    $this->log_date    = $log_date;
+    $this->log_date = $log_date;
   }
 
   /**
@@ -139,7 +139,7 @@ class CRM_Logging_Reverter {
           foreach ($row as $id => $changes) {
             $inserts = array('id' => '%1');
             $updates = array();
-            $params  = array(1 => array($id, 'Integer'));
+            $params = array(1 => array($id, 'Integer'));
             $counter = 2;
             foreach ($changes as $field => $value) {
               // don’t try reverting a field that’s no longer there
@@ -155,8 +155,8 @@ class CRM_Logging_Reverter {
                   $value = CRM_Utils_Date::isoToMysql($value);
                   break;
               }
-              $inserts[$field]  = "%$counter";
-              $updates[]        = "$field = %$counter";
+              $inserts[$field] = "%$counter";
+              $updates[] = "$field = %$counter";
               $params[$counter] = array($value, $ctypes[$table][$field]);
               $counter++;
             }
index 2cd7b80006664e06da18df9dad02b2506b0b3e57..3810315f2ed26a981765df549434b50e1376dd0b 100644 (file)
@@ -48,7 +48,7 @@ class CRM_Logging_Schema {
 
   //CRM-13028 / NYSS-6933 - table => array (cols) - to be excluded from the update statement
   private $exceptions = array(
-    'civicrm_job'   => array('last_run'),
+    'civicrm_job' => array('last_run'),
     'civicrm_group' => array('cache_date'),
   );
 
@@ -160,7 +160,7 @@ AND    TABLE_NAME LIKE 'log_civicrm_%'
       $dao->executeQuery("DROP TRIGGER IF EXISTS {$validName}_before_update");
       $dao->executeQuery("DROP TRIGGER IF EXISTS {$validName}_before_delete");
 
-     // after triggers
+      // after triggers
       $dao->executeQuery("DROP TRIGGER IF EXISTS {$validName}_after_insert");
       $dao->executeQuery("DROP TRIGGER IF EXISTS {$validName}_after_update");
       $dao->executeQuery("DROP TRIGGER IF EXISTS {$validName}_after_delete");
@@ -194,7 +194,7 @@ AND    TABLE_NAME LIKE 'log_civicrm_%'
   /**
    * Sync log tables and rebuild triggers.
    *
-   * @param bool $enableLogging: Ensure logging is enabled
+   * @param bool $enableLogging : Ensure logging is enabled
    *
    * @return void
    */
@@ -348,10 +348,10 @@ AND    TABLE_NAME LIKE 'log_civicrm_%'
     // add report instances
     $domain_id = CRM_Core_Config::domainID();
     foreach ($this->reports as $report) {
-      $dao             = new CRM_Report_DAO_ReportInstance;
-      $dao->domain_id  = $domain_id;
-      $dao->report_id  = $report;
-      $dao->title      = $titles[$report];
+      $dao = new CRM_Report_DAO_ReportInstance;
+      $dao->domain_id = $domain_id;
+      $dao->report_id = $report;
+      $dao->title = $titles[$report];
       $dao->permission = 'administer CiviCRM';
       if ($report == 'logging/contact/summary')
         $dao->is_reserved = 1;
@@ -410,11 +410,11 @@ WHERE  table_schema IN ('{$this->db}', '{$civiDB}')";
         }
         $columnSpecs[$dao->TABLE_NAME][$dao->COLUMN_NAME] =
           array(
-              'COLUMN_NAME' => $dao->COLUMN_NAME,
-              'DATA_TYPE'   => $dao->DATA_TYPE,
-              'IS_NULLABLE' => $dao->IS_NULLABLE,
-              'COLUMN_DEFAULT' => $dao->COLUMN_DEFAULT,
-            );
+            'COLUMN_NAME' => $dao->COLUMN_NAME,
+            'DATA_TYPE' => $dao->DATA_TYPE,
+            'IS_NULLABLE' => $dao->IS_NULLABLE,
+            'COLUMN_DEFAULT' => $dao->COLUMN_DEFAULT,
+          );
       }
     }
     return $columnSpecs[$table];
@@ -428,7 +428,7 @@ WHERE  table_schema IN ('{$this->db}', '{$civiDB}')";
    */
   public function columnsWithDiffSpecs($civiTable, $logTable) {
     $civiTableSpecs = $this->columnSpecsOf($civiTable);
-    $logTableSpecs  = $this->columnSpecsOf($logTable);
+    $logTableSpecs = $this->columnSpecsOf($logTable);
 
     $diff = array('ADD' => array(), 'MODIFY' => array(), 'OBSOLETE' => array());
 
@@ -451,12 +451,14 @@ WHERE  table_schema IN ('{$this->db}', '{$civiDB}')";
           $diff['MODIFY'][] = $col;
         }
         elseif ($civiTableSpecs[$col]['IS_NULLABLE'] != CRM_Utils_Array::value('IS_NULLABLE', $logTableSpecs[$col]) &&
-          $logTableSpecs[$col]['IS_NULLABLE'] == 'NO') {
+          $logTableSpecs[$col]['IS_NULLABLE'] == 'NO'
+        ) {
           // if is-null property is different, and log table's column is NOT-NULL, surely consider the column
           $diff['MODIFY'][] = $col;
         }
         elseif ($civiTableSpecs[$col]['COLUMN_DEFAULT'] != CRM_Utils_Array::value('COLUMN_DEFAULT', $logTableSpecs[$col]) &&
-          !strstr($civiTableSpecs[$col]['COLUMN_DEFAULT'], 'TIMESTAMP')) {
+          !strstr($civiTableSpecs[$col]['COLUMN_DEFAULT'], 'TIMESTAMP')
+        ) {
           // if default property is different, and its not about a timestamp column, consider it
           $diff['MODIFY'][] = $col;
         }
@@ -467,7 +469,8 @@ WHERE  table_schema IN ('{$this->db}', '{$civiDB}')";
     $oldCols = array_diff(array_keys($logTableSpecs), array_keys($civiTableSpecs));
     foreach ($oldCols as $col) {
       if (!in_array($col, array('log_date', 'log_conn_id', 'log_user_id', 'log_action')) &&
-        $logTableSpecs[$col]['IS_NULLABLE'] == 'NO') {
+        $logTableSpecs[$col]['IS_NULLABLE'] == 'NO'
+      ) {
         // if its a column present only in log table, not among those used by log tables for special purpose, and not-null
         $diff['OBSOLETE'][] = $col;
       }
@@ -528,7 +531,7 @@ COLS;
     // delete report instances
     $domain_id = CRM_Core_Config::domainID();
     foreach ($this->reports as $report) {
-      $dao            = new CRM_Report_DAO_ReportInstance;
+      $dao = new CRM_Report_DAO_ReportInstance;
       $dao->domain_id = $domain_id;
       $dao->report_id = $report;
       $dao->delete();
@@ -617,13 +620,13 @@ COLS;
 
       $sqlStmt = '';
       foreach ($columns as $column) {
-        $sqlStmt   .= "NEW.$column, ";
+        $sqlStmt .= "NEW.$column, ";
         $deleteSQL .= "OLD.$column, ";
       }
-      $sqlStmt   .= "CONNECTION_ID(), @civicrm_user_id, '{eventName}');";
+      $sqlStmt .= "CONNECTION_ID(), @civicrm_user_id, '{eventName}');";
       $deleteSQL .= "CONNECTION_ID(), @civicrm_user_id, '{eventName}');";
 
-      $sqlStmt   .= "END IF;";
+      $sqlStmt .= "END IF;";
       $deleteSQL .= "END IF;";
 
       $insertSQL .= $sqlStmt;
index cb17d3bb80c2487989bfca05358526a0bc6f09cd..99d8c4b26ec92af7dd27b017321594ea7ac016a7 100644 (file)
@@ -134,11 +134,11 @@ class CRM_Mailing_BAO_Mailing extends CRM_Mailing_DAO_Mailing {
     $mailingGroup = new CRM_Mailing_DAO_MailingGroup();
 
     $mailing = CRM_Mailing_BAO_Mailing::getTableName();
-    $job     = CRM_Mailing_BAO_MailingJob::getTableName();
-    $mg      = CRM_Mailing_DAO_MailingGroup::getTableName();
-    $eq      = CRM_Mailing_Event_DAO_Queue::getTableName();
-    $ed      = CRM_Mailing_Event_DAO_Delivered::getTableName();
-    $eb      = CRM_Mailing_Event_DAO_Bounce::getTableName();
+    $job = CRM_Mailing_BAO_MailingJob::getTableName();
+    $mg = CRM_Mailing_DAO_MailingGroup::getTableName();
+    $eq = CRM_Mailing_Event_DAO_Queue::getTableName();
+    $ed = CRM_Mailing_Event_DAO_Delivered::getTableName();
+    $eb = CRM_Mailing_Event_DAO_Bounce::getTableName();
 
     $email = CRM_Core_DAO_Email::getTableName();
     if ($mode == 'sms') {
@@ -323,7 +323,7 @@ WHERE  c.group_id = {$groupDAO->id}
 
     if ($mode == 'sms') {
       $phoneTypes = CRM_Core_OptionGroup::values('phone_type', TRUE, FALSE, FALSE, NULL, 'name');
-      $query      = "REPLACE INTO       I_$job_id (phone_id, contact_id)
+      $query = "REPLACE INTO       I_$job_id (phone_id, contact_id)
 
                     SELECT DISTINCT     $phone.id as phone_id,
                                         $contact.id as contact_id
@@ -632,11 +632,11 @@ ORDER BY   i.contact_id, i.{$tempColumn}
 
     $patterns = array();
 
-    $protos  = '(https?|ftp)';
+    $protos = '(https?|ftp)';
     $letters = '\w';
-    $gunk    = '\{\}/#~:.?+=&;%@!\,\-';
-    $punc    = '.:?\-';
-    $any     = "{$letters}{$gunk}{$punc}";
+    $gunk = '\{\}/#~:.?+=&;%@!\,\-';
+    $punc = '.:?\-';
+    $any = "{$letters}{$gunk}{$punc}";
     if ($onlyHrefs) {
       $pattern = "\\bhref[ ]*=[ ]*([\"'])?(($protos:[$any]+?(?=[$punc]*[^$any]|$)))([\"'])?";
     }
@@ -657,7 +657,7 @@ ORDER BY   i.contact_id, i.{$tempColumn}
    *  returns an array that denotes the type of token that we are dealing with
    *  we use the type later on when we are doing a token replcement lookup
    *
-   * @param string $token       The token for which we will be doing adata lookup
+   * @param string $token The token for which we will be doing adata lookup
    *
    * @return array
    *   An array that holds the token itself and the type.
@@ -728,20 +728,23 @@ ORDER BY   i.contact_id, i.{$tempColumn}
    **/
   private function getPreparedTemplates() {
     if (!$this->preparedTemplates) {
-      $patterns['html']    = $this->getPatterns(TRUE);
+      $patterns['html'] = $this->getPatterns(TRUE);
       $patterns['subject'] = $patterns['text'] = $this->getPatterns();
-      $templates           = $this->getTemplates();
+      $templates = $this->getTemplates();
 
       $this->preparedTemplates = array();
 
       foreach (array(
-        'html', 'text', 'subject') as $key) {
+                 'html',
+                 'text',
+                 'subject'
+               ) as $key) {
         if (!isset($templates[$key])) {
           continue;
         }
 
-        $matches        = array();
-        $tokens         = array();
+        $matches = array();
+        $tokens = array();
         $split_template = array();
 
         $email = $templates[$key];
@@ -926,12 +929,14 @@ ORDER BY   i.contact_id, i.{$tempColumn}
   public function getTestRecipients($testParams) {
     if (array_key_exists($testParams['test_group'], CRM_Core_PseudoConstant::group())) {
       $contacts = civicrm_api('contact', 'get', array(
-        'version' => 3,
-        'group' => $testParams['test_group'],
-         'return' => 'id',
-           'options' => array('limit' => 100000000000,
-          ))
-       );
+          'version' => 3,
+          'group' => $testParams['test_group'],
+          'return' => 'id',
+          'options' => array(
+            'limit' => 100000000000,
+          )
+        )
+      );
 
       foreach (array_keys($contacts['values']) as $groupContact) {
         $query = "
@@ -1010,20 +1015,20 @@ ORDER BY   civicrm_email.is_bulkmail DESC
    * @return void
    */
   public static function addMessageIdHeader(&$headers, $prefix, $job_id, $event_queue_id, $hash) {
-    $config           = CRM_Core_Config::singleton();
-    $localpart        = CRM_Core_BAO_MailSettings::defaultLocalpart();
-    $emailDomain      = CRM_Core_BAO_MailSettings::defaultDomain();
+    $config = CRM_Core_Config::singleton();
+    $localpart = CRM_Core_BAO_MailSettings::defaultLocalpart();
+    $emailDomain = CRM_Core_BAO_MailSettings::defaultDomain();
     $includeMessageId = CRM_Core_BAO_MailSettings::includeMessageId();
 
     if ($includeMessageId && (!array_key_exists('Message-ID', $headers))) {
       $headers['Message-ID'] = '<' . implode($config->verpSeparator,
-        array(
-          $localpart . $prefix,
-          $job_id,
-          $event_queue_id,
-          $hash,
-        )
-      ) . "@{$emailDomain}>";
+          array(
+            $localpart . $prefix,
+            $job_id,
+            $event_queue_id,
+            $hash,
+          )
+        ) . "@{$emailDomain}>";
     }
   }
 
@@ -1044,9 +1049,9 @@ ORDER BY   civicrm_email.is_bulkmail DESC
    */
   public static function getVerpAndUrls($job_id, $event_queue_id, $hash, $email) {
     // create a skeleton object and set its properties that are required by getVerpAndUrlsAndHeaders()
-    $config         = CRM_Core_Config::singleton();
-    $bao            = new CRM_Mailing_BAO_Mailing();
-    $bao->_domain   = CRM_Core_BAO_Domain::getDomain();
+    $config = CRM_Core_Config::singleton();
+    $bao = new CRM_Mailing_BAO_Mailing();
+    $bao->_domain = CRM_Core_BAO_Domain::getDomain();
     $bao->from_name = $bao->from_email = $bao->subject = '';
 
     // use $bao's instance method to get verp and urls
@@ -1097,13 +1102,13 @@ ORDER BY   civicrm_email.is_bulkmail DESC
 
     foreach ($verpTokens as $key => $value) {
       $verp[$key] = implode($config->verpSeparator,
-        array(
-          $localpart . $value,
-          $job_id,
-          $event_queue_id,
-          $hash,
-        )
-      ) . "@$emailDomain";
+          array(
+            $localpart . $value,
+            $job_id,
+            $event_queue_id,
+            $hash,
+          )
+        ) . "@$emailDomain";
     }
 
     //handle should override VERP address.
@@ -1228,8 +1233,8 @@ ORDER BY   civicrm_email.is_bulkmail DESC
 
       if (!$contact || is_a($contact, 'CRM_Core_Error')) {
         CRM_Core_Error::debug_log_message(ts('CiviMail will not send email to a non-existent contact: %1',
-            array(1 => $contactId)
-          ));
+          array(1 => $contactId)
+        ));
         // setting this because function is called by reference
         //@todo test not calling function by reference
         $res = NULL;
@@ -1244,12 +1249,12 @@ ORDER BY   civicrm_email.is_bulkmail DESC
     $pEmails = array();
 
     foreach ($pTemplates as $type => $pTemplate) {
-      $html           = ($type == 'html') ? TRUE : FALSE;
+      $html = ($type == 'html') ? TRUE : FALSE;
       $pEmails[$type] = array();
-      $pEmail         = &$pEmails[$type];
-      $template       = &$pTemplates[$type]['template'];
-      $tokens         = &$pTemplates[$type]['tokens'];
-      $idx            = 0;
+      $pEmail = &$pEmails[$type];
+      $template = &$pTemplates[$type]['template'];
+      $tokens = &$pTemplates[$type]['tokens'];
+      $idx = 0;
       if (!empty($tokens)) {
         foreach ($tokens as $idx => $token) {
           $token_data = $this->getTokenData($token, $html, $contact, $verp, $urls, $event_queue_id);
@@ -1296,7 +1301,8 @@ ORDER BY   civicrm_email.is_bulkmail DESC
     if ($text && ($test || $contact['preferred_mail_format'] == 'Text' ||
         $contact['preferred_mail_format'] == 'Both' ||
         ($contact['preferred_mail_format'] == 'HTML' && !array_key_exists('html', $pEmails))
-      )) {
+      )
+    ) {
       $textBody = join('', $text);
       if ($useSmarty) {
         $textBody = $smarty->fetch("string:$textBody");
@@ -1306,7 +1312,8 @@ ORDER BY   civicrm_email.is_bulkmail DESC
 
     if ($html && ($test || ($contact['preferred_mail_format'] == 'HTML' ||
           $contact['preferred_mail_format'] == 'Both'
-        ))) {
+        ))
+    ) {
       $htmlBody = join('', $html);
       if ($useSmarty) {
         $htmlBody = $smarty->fetch("string:$htmlBody");
@@ -1318,8 +1325,8 @@ ORDER BY   civicrm_email.is_bulkmail DESC
       // CRM-9833
       // something went wrong, lets log it and return null (by reference)
       CRM_Core_Error::debug_log_message(ts('CiviMail will not send an empty mail body, Skipping: %1',
-          array(1 => $email)
-        ));
+        array(1 => $email)
+      ));
       $res = NULL;
       return $res;
     }
@@ -1347,7 +1354,13 @@ ORDER BY   civicrm_email.is_bulkmail DESC
     foreach ($mailParams as $paramKey => $paramValue) {
       //exclude values not intended for the header
       if (!in_array($paramKey, array(
-        'text', 'html', 'attachments', 'toName', 'toEmail'))) {
+        'text',
+        'html',
+        'attachments',
+        'toName',
+        'toEmail'
+      ))
+      ) {
         $headers[$paramKey] = $paramValue;
       }
     }
@@ -1437,9 +1450,9 @@ ORDER BY   civicrm_email.is_bulkmail DESC
    *  and returns the appropriate data for the token
    */
   private function getTokenData(&$token_a, $html = FALSE, &$contact, &$verp, &$urls, $event_queue_id) {
-    $type  = $token_a['type'];
+    $type = $token_a['type'];
     $token = $token_a['token'];
-    $data  = $token;
+    $data = $token;
 
     $useSmarty = defined('CIVICRM_MAIL_SMARTY') && CIVICRM_MAIL_SMARTY ? TRUE : FALSE;
 
@@ -1513,9 +1526,9 @@ ORDER BY   civicrm_email.is_bulkmail DESC
     if (!isset($this->id)) {
       return array();
     }
-    $mg      = new CRM_Mailing_DAO_MailingGroup();
+    $mg = new CRM_Mailing_DAO_MailingGroup();
     $mgtable = CRM_Mailing_DAO_MailingGroup::getTableName();
-    $group   = CRM_Contact_BAO_Group::getTableName();
+    $group = CRM_Contact_BAO_Group::getTableName();
 
     $mg->query("SELECT      $group.title as name FROM $mgtable
                     INNER JOIN  $group ON $mgtable.entity_id = $group.id
@@ -1554,8 +1567,8 @@ ORDER BY   civicrm_email.is_bulkmail DESC
       CRM_Utils_Hook::pre('create', 'Mailing', NULL, $params);
     }
 
-    $mailing            = new static();
-    $mailing->id        = $id;
+    $mailing = new static();
+    $mailing->id = $id;
     $mailing->domain_id = CRM_Utils_Array::value('domain_id', $params, CRM_Core_Config::domainID());
 
     if (!isset($params['replyto_email']) &&
@@ -1610,11 +1623,11 @@ ORDER BY   civicrm_email.is_bulkmail DESC
       );
       if (isset($domain['from_email'])) {
         $domain_email = $domain['from_email'];
-        $domain_name  = $domain['from_name'];
+        $domain_name = $domain['from_name'];
       }
       else {
         $domain_email = 'info@EXAMPLE.ORG';
-        $domain_name  = 'EXAMPLE.ORG';
+        $domain_name = 'EXAMPLE.ORG';
       }
       if (!isset($params['created_id'])) {
         $session =& CRM_Core_Session::singleton();
@@ -1624,23 +1637,23 @@ ORDER BY   civicrm_email.is_bulkmail DESC
         // load the default config settings for each
         // eg reply_id, unsubscribe_id need to use
         // correct template IDs here
-        'override_verp'   => TRUE,
+        'override_verp' => TRUE,
         'forward_replies' => FALSE,
-        'open_tracking'   => TRUE,
-        'url_tracking'    => TRUE,
-        'visibility'      => 'Public Pages',
-        'replyto_email'   => $domain_email,
-        'header_id'       => CRM_Mailing_PseudoConstant::defaultComponent('header_id', ''),
-        'footer_id'       => CRM_Mailing_PseudoConstant::defaultComponent('footer_id', ''),
-        'from_email'      => $domain_email,
-        'from_name'       => $domain_name,
+        'open_tracking' => TRUE,
+        'url_tracking' => TRUE,
+        'visibility' => 'Public Pages',
+        'replyto_email' => $domain_email,
+        'header_id' => CRM_Mailing_PseudoConstant::defaultComponent('header_id', ''),
+        'footer_id' => CRM_Mailing_PseudoConstant::defaultComponent('footer_id', ''),
+        'from_email' => $domain_email,
+        'from_name' => $domain_name,
         'msg_template_id' => NULL,
-        'created_id'      => $params['created_id'],
-        'approver_id'     => NULL,
-        'auto_responder'  => 0,
-        'created_date'    => date('YmdHis'),
-        'scheduled_date'  => NULL,
-        'approval_date'   => NULL,
+        'created_id' => $params['created_id'],
+        'approver_id' => NULL,
+        'auto_responder' => 0,
+        'created_date' => date('YmdHis'),
+        'scheduled_date' => NULL,
+        'approval_date' => NULL,
       );
 
       // Get the default from email address, if not provided.
@@ -1690,12 +1703,12 @@ ORDER BY   civicrm_email.is_bulkmail DESC
 
     if (!empty($params['search_id']) && !empty($params['group_id'])) {
       $mg->reset();
-      $mg->mailing_id   = $mailing->id;
+      $mg->mailing_id = $mailing->id;
       $mg->entity_table = $groupTableName;
-      $mg->entity_id    = $params['group_id'];
-      $mg->search_id    = $params['search_id'];
-      $mg->search_args  = $params['search_args'];
-      $mg->group_type   = 'Include';
+      $mg->entity_id = $params['group_id'];
+      $mg->search_id = $params['search_id'];
+      $mg->search_args = $params['search_args'];
+      $mg->group_type = 'Include';
       $mg->save();
     }
 
@@ -1736,7 +1749,7 @@ ORDER BY   civicrm_email.is_bulkmail DESC
    *   'include' or 'exclude'.
    * @param string $entity
    *   'groups' or 'mailings'.
-   * @param array<int> $entityIds
+   * @param array <int> $entityIds
    * @throws CiviCRM_API3_Exception
    */
   public static function replaceGroups($mailingId, $type, $entity, $entityIds) {
@@ -1797,7 +1810,7 @@ ORDER BY   civicrm_email.is_bulkmail DESC
       'forward' => CRM_Mailing_Event_BAO_Forward::getTableName(),
       'url' => CRM_Mailing_BAO_TrackableURL::getTableName(),
       'urlopen' =>
-      CRM_Mailing_Event_BAO_TrackableURLOpen::getTableName(),
+        CRM_Mailing_Event_BAO_TrackableURLOpen::getTableName(),
       'component' => CRM_Mailing_BAO_Component::getTableName(),
       'spool' => CRM_Mailing_BAO_Spool::getTableName(),
     );
@@ -1867,9 +1880,9 @@ ORDER BY   civicrm_email.is_bulkmail DESC
         'type' => $components[$mailing->type],
         'name' => $mailing->name,
         'link' =>
-        CRM_Utils_System::url('civicrm/mailing/component',
-          "reset=1&action=update&id={$mailing->id}"
-        ),
+          CRM_Utils_System::url('civicrm/mailing/component',
+            "reset=1&action=update&id={$mailing->id}"
+          ),
       );
     }
 
@@ -1900,18 +1913,18 @@ ORDER BY   civicrm_email.is_bulkmail DESC
     while ($mailing->fetch()) {
       $row = array();
       if (isset($mailing->group_id)) {
-        $row['id']   = $mailing->group_id;
+        $row['id'] = $mailing->group_id;
         $row['name'] = $mailing->group_title;
         $row['link'] = CRM_Utils_System::url('civicrm/group/search',
-                       "reset=1&force=1&context=smog&gid={$row['id']}"
+          "reset=1&force=1&context=smog&gid={$row['id']}"
         );
       }
       else {
-        $row['id']      = $mailing->mailing_id;
-        $row['name']    = $mailing->mailing_name;
+        $row['id'] = $mailing->mailing_id;
+        $row['name'] = $mailing->mailing_name;
         $row['mailing'] = TRUE;
-        $row['link']    = CRM_Utils_System::url('civicrm/mailing/report',
-                          "mid={$row['id']}"
+        $row['link'] = CRM_Utils_System::url('civicrm/mailing/report',
+          "mid={$row['id']}"
         );
       }
 
@@ -1966,8 +1979,16 @@ ORDER BY   civicrm_email.is_bulkmail DESC
     $report['jobs'] = array();
     $report['event_totals'] = array();
     $elements = array(
-      'queue', 'delivered', 'url', 'forward',
-      'reply', 'unsubscribe', 'optout', 'opened', 'bounce', 'spool',
+      'queue',
+      'delivered',
+      'url',
+      'forward',
+      'reply',
+      'unsubscribe',
+      'optout',
+      'opened',
+      'bounce',
+      'spool',
     );
 
     // initialize various counters
@@ -2050,7 +2071,10 @@ ORDER BY   civicrm_email.is_bulkmail DESC
       );
 
       foreach (array(
-          'scheduled_date', 'start_date', 'end_date') as $key) {
+                 'scheduled_date',
+                 'start_date',
+                 'end_date'
+               ) as $key) {
         $row[$key] = CRM_Utils_Date::customFormat($row[$key]);
       }
       $report['jobs'][] = $row;
@@ -2104,15 +2128,15 @@ ORDER BY   civicrm_email.is_bulkmail DESC
       $report['click_through'][] = array(
         'url' => $mailing->url,
         'link' =>
-        CRM_Utils_System::url(
-          'civicrm/mailing/report/event',
-          "reset=1&event=click&mid=$mailing_id&uid={$mailing->id}"
-        ),
+          CRM_Utils_System::url(
+            'civicrm/mailing/report/event',
+            "reset=1&event=click&mid=$mailing_id&uid={$mailing->id}"
+          ),
         'link_unique' =>
-        CRM_Utils_System::url(
-          'civicrm/mailing/report/event',
-          "reset=1&event=click&mid=$mailing_id&uid={$mailing->id}&distinct=1"
-        ),
+          CRM_Utils_System::url(
+            'civicrm/mailing/report/event',
+            "reset=1&event=click&mid=$mailing_id&uid={$mailing->id}&distinct=1"
+          ),
         'clicks' => $mailing->clicks,
         'unique' => $mailing->unique_clicks,
         'rate' => CRM_Utils_Array::value('delivered', $report['event_totals']) ? (100.0 * $mailing->unique_clicks) / $report['event_totals']['delivered'] : 0,
@@ -2174,10 +2198,18 @@ ORDER BY   civicrm_email.is_bulkmail DESC
 
     $report['event_totals']['actionlinks'] = array();
     foreach (array(
-        'clicks', 'clicks_unique', 'queue', 'delivered', 'bounce', 'unsubscribe',
-        'forward', 'reply', 'opened', 'optout',
-      ) as $key) {
-      $url          = 'mailing/detail';
+               'clicks',
+               'clicks_unique',
+               'queue',
+               'delivered',
+               'bounce',
+               'unsubscribe',
+               'forward',
+               'reply',
+               'opened',
+               'optout',
+             ) as $key) {
+      $url = 'mailing/detail';
       $reportFilter = "reset=1&mailing_id_value={$mailing_id}";
       $searchFilter = "force=1&mailing_id=%%mid%%";
       switch ($key) {
@@ -2295,7 +2327,7 @@ ORDER BY   civicrm_email.is_bulkmail DESC
 
     if (!empty($mailingIDs)) {
       $mailingIDs = implode(',', $mailingIDs);
-      $tableName  = !$alias ? self::getTableName() : $alias;
+      $tableName = !$alias ? self::getTableName() : $alias;
       $mailingACL = " $tableName.id IN ( $mailingIDs ) ";
     }
     return $mailingACL;
@@ -2368,8 +2400,8 @@ LEFT JOIN civicrm_mailing_group g ON g.mailing_id   = m.id
    */
   public function &getRows($offset, $rowCount, $sort, $additionalClause = NULL, $additionalParams = NULL) {
     $mailing = self::getTableName();
-    $job     = CRM_Mailing_BAO_MailingJob::getTableName();
-    $group   = CRM_Mailing_DAO_MailingGroup::getTableName();
+    $job = CRM_Mailing_BAO_MailingJob::getTableName();
+    $group = CRM_Mailing_DAO_MailingGroup::getTableName();
     $session = CRM_Core_Session::singleton();
 
     $mailingACL = self::mailingACL();
@@ -2583,7 +2615,7 @@ LEFT JOIN civicrm_mailing_group g ON g.mailing_id   = m.id
         ts('HTML Format'),
         array(
           'cols' => '80',
-      'rows' => '8',
+          'rows' => '8',
           'onkeyup' => "return verify(this)",
         )
       );
@@ -2607,7 +2639,7 @@ LEFT JOIN civicrm_mailing_group g ON g.mailing_id   = m.id
       $form->add('textarea', $id, $label,
         array(
           'cols' => '80',
-      'rows' => '8',
+          'rows' => '8',
           'onkeyup' => "return verify(this, '{$prefix}')",
         )
       );
@@ -2667,7 +2699,8 @@ LEFT JOIN civicrm_mailing_group g ON g.mailing_id   = m.id
       $form->assign('templates', TRUE);
       $form->add('select', 'template', ts('Select Template'),
         array(
-          '' => ts('- select -')) + $form->_templates, FALSE,
+          '' => ts('- select -')
+        ) + $form->_templates, FALSE,
         array('onChange' => "selectValue( this.value,'' );")
       );
       $form->add('checkbox', 'updateTemplate', ts('Update Template'), NULL);
@@ -2682,7 +2715,7 @@ LEFT JOIN civicrm_mailing_group g ON g.mailing_id   = m.id
       ts('Your Letter'),
       array(
         'cols' => '80',
-    'rows' => '8',
+        'rows' => '8',
         'onkeyup' => "return verify(this)",
       )
     );
@@ -2812,7 +2845,10 @@ WHERE  civicrm_mailing_job.id = %1
     $config = &CRM_Core_Config::singleton();
 
     if ($mode == NULL && CRM_Core_BAO_MailSettings::defaultDomain() == "EXAMPLE.ORG") {
-      throw new CRM_Core_Exception(ts('The <a href="%1">default mailbox</a> has not been configured. You will find <a href="%2">more info in the online user and administrator guide</a>', array(1 => CRM_Utils_System::url('civicrm/admin/mailSettings', 'reset=1'), 2 => "http://book.civicrm.org/user/advanced-configuration/email-system-configuration/")));
+      throw new CRM_Core_Exception(ts('The <a href="%1">default mailbox</a> has not been configured. You will find <a href="%2">more info in the online user and administrator guide</a>', array(
+            1 => CRM_Utils_System::url('civicrm/admin/mailSettings', 'reset=1'),
+            2 => "http://book.civicrm.org/user/advanced-configuration/email-system-configuration/"
+          )));
     }
 
     // check if we are enforcing number of parallel cron jobs
@@ -2939,10 +2975,10 @@ AND        m.id = %1
    */
   public static function getContactMailingSelector(&$params) {
     // format the params
-    $params['offset']   = ($params['page'] - 1) * $params['rp'];
+    $params['offset'] = ($params['page'] - 1) * $params['rp'];
     $params['rowCount'] = $params['rp'];
-    $params['sort']     = CRM_Utils_Array::value('sortBy', $params);
-    $params['caseId']   = NULL;
+    $params['sort'] = CRM_Utils_Array::value('sortBy', $params);
+    $params['caseId'] = NULL;
 
     // get contact mailings
     $mailings = CRM_Mailing_BAO_Mailing::getContactMailings($params);
@@ -3028,9 +3064,9 @@ AND        m.id = %1
    */
   static public function getContactMailings(&$params) {
     $params['version'] = 3;
-    $params['offset']  = ($params['page'] - 1) * $params['rp'];
-    $params['limit']   = $params['rp'];
-    $params['sort']    = CRM_Utils_Array::value('sortBy', $params);
+    $params['offset'] = ($params['page'] - 1) * $params['rp'];
+    $params['limit'] = $params['rp'];
+    $params['sort'] = CRM_Utils_Array::value('sortBy', $params);
 
     $result = civicrm_api('MailingContact', 'get', $params);
     return $result['values'];
index c6ba6c22a1ca3d3581b88a3f05876435f10bc681..caf86088c3b6eeff5921bb37b4169bc3660ca522 100644 (file)
@@ -127,7 +127,7 @@ class CRM_Mailing_BAO_MailingAB extends CRM_Mailing_DAO_MailingAB {
     if (empty($id)) {
       CRM_Core_Error::fatal();
     }
-    CRM_Core_Transaction::create()->run(function() use ($id) {
+    CRM_Core_Transaction::create()->run(function () use ($id) {
       CRM_Utils_Hook::pre('delete', 'MailingAB', $id, CRM_Core_DAO::$_nullArray);
 
       $dao = new CRM_Mailing_DAO_MailingAB();
index b9e83d9f7d511eb504b32224fc889abecd0a6345..896808feeeefc105600befe2346ba67484641f18 100644 (file)
@@ -86,8 +86,8 @@ class CRM_Mailing_BAO_MailingJob extends CRM_Mailing_DAO_MailingJob {
   public static function runJobs($testParams = NULL, $mode = NULL) {
     $job = new CRM_Mailing_BAO_MailingJob();
 
-    $config       = CRM_Core_Config::singleton();
-    $jobTable     = CRM_Mailing_DAO_MailingJob::getTableName();
+    $config = CRM_Core_Config::singleton();
+    $jobTable = CRM_Mailing_DAO_MailingJob::getTableName();
     $mailingTable = CRM_Mailing_DAO_Mailing::getTableName();
 
     if (!empty($testParams)) {
@@ -99,8 +99,8 @@ class CRM_Mailing_BAO_MailingJob extends CRM_Mailing_DAO_MailingJob {
     }
     else {
       $currentTime = date('YmdHis');
-      $mailingACL  = CRM_Mailing_BAO_Mailing::mailingACL('m');
-      $domainID    = CRM_Core_Config::domainID();
+      $mailingACL = CRM_Mailing_BAO_Mailing::mailingACL('m');
+      $domainID = CRM_Core_Config::domainID();
 
       $modeClause = 'AND m.sms_provider_id IS NULL';
       if ($mode == 'sms') {
@@ -172,10 +172,10 @@ class CRM_Mailing_BAO_MailingJob extends CRM_Mailing_DAO_MailingJob {
         $job->queue($testParams);
 
         // Mark up the starting time
-        $saveJob             = new CRM_Mailing_DAO_MailingJob();
-        $saveJob->id         = $job->id;
+        $saveJob = new CRM_Mailing_DAO_MailingJob();
+        $saveJob->id = $job->id;
         $saveJob->start_date = date('YmdHis');
-        $saveJob->status     = 'Running';
+        $saveJob->status = 'Running';
         $saveJob->save();
 
         $transaction->commit();
@@ -201,10 +201,10 @@ class CRM_Mailing_BAO_MailingJob extends CRM_Mailing_DAO_MailingJob {
 
         $transaction = new CRM_Core_Transaction();
 
-        $saveJob           = new CRM_Mailing_DAO_MailingJob();
-        $saveJob->id       = $job->id;
+        $saveJob = new CRM_Mailing_DAO_MailingJob();
+        $saveJob->id = $job->id;
         $saveJob->end_date = date('YmdHis');
-        $saveJob->status   = 'Complete';
+        $saveJob->status = 'Complete';
         $saveJob->save();
 
         $transaction->commit();
@@ -232,13 +232,13 @@ class CRM_Mailing_BAO_MailingJob extends CRM_Mailing_DAO_MailingJob {
 
     $mailing = new CRM_Mailing_BAO_Mailing();
 
-    $config       = CRM_Core_Config::singleton();
-    $jobTable     = CRM_Mailing_DAO_MailingJob::getTableName();
+    $config = CRM_Core_Config::singleton();
+    $jobTable = CRM_Mailing_DAO_MailingJob::getTableName();
     $mailingTable = CRM_Mailing_DAO_Mailing::getTableName();
 
     $currentTime = date('YmdHis');
-    $mailingACL  = CRM_Mailing_BAO_Mailing::mailingACL('m');
-    $domainID    = CRM_Core_Config::domainID();
+    $mailingACL = CRM_Mailing_BAO_Mailing::mailingACL('m');
+    $domainID = CRM_Core_Config::domainID();
 
     $query = "
                 SELECT   j.*
@@ -277,10 +277,10 @@ class CRM_Mailing_BAO_MailingJob extends CRM_Mailing_DAO_MailingJob {
 
         $transaction = new CRM_Core_Transaction();
 
-        $saveJob           = new CRM_Mailing_DAO_MailingJob();
-        $saveJob->id       = $job->id;
+        $saveJob = new CRM_Mailing_DAO_MailingJob();
+        $saveJob->id = $job->id;
         $saveJob->end_date = date('YmdHis');
-        $saveJob->status   = 'Complete';
+        $saveJob->status = 'Complete';
         $saveJob->save();
 
         $mailing->reset();
@@ -301,7 +301,7 @@ class CRM_Mailing_BAO_MailingJob extends CRM_Mailing_DAO_MailingJob {
   public static function runJobs_pre($offset = 200, $mode = NULL) {
     $job = new CRM_Mailing_BAO_MailingJob();
 
-    $jobTable     = CRM_Mailing_DAO_MailingJob::getTableName();
+    $jobTable = CRM_Mailing_DAO_MailingJob::getTableName();
     $mailingTable = CRM_Mailing_DAO_Mailing::getTableName();
 
     $currentTime = date('YmdHis');
@@ -367,10 +367,10 @@ class CRM_Mailing_BAO_MailingJob extends CRM_Mailing_DAO_MailingJob {
       // update the status of the parent job
       $transaction = new CRM_Core_Transaction();
 
-      $saveJob             = new CRM_Mailing_DAO_MailingJob();
-      $saveJob->id         = $job->id;
+      $saveJob = new CRM_Mailing_DAO_MailingJob();
+      $saveJob->id = $job->id;
       $saveJob->start_date = date('YmdHis');
-      $saveJob->status     = 'Running';
+      $saveJob->status = 'Running';
       $saveJob->save();
 
       $transaction->commit();
@@ -398,7 +398,7 @@ INSERT INTO civicrm_mailing_job
 VALUES (%1, %2, %3, %4, %5, %6, %7)
 ";
     $params = array(
-    1 => array($this->mailing_id, 'Integer'),
+      1 => array($this->mailing_id, 'Integer'),
       2 => array($this->scheduled_date, 'String'),
       3 => array('Scheduled', 'String'),
       4 => array('child', 'String'),
@@ -441,9 +441,9 @@ VALUES (%1, %2, %3, %4, %5, %6, %7)
       // FIXME: this is not very smart, we should move this to one DB call
       // INSERT INTO ... SELECT FROM ..
       // the thing we need to figure out is how to generate the hash automatically
-      $now    = time();
+      $now = time();
       $params = array();
-      $count  = 0;
+      $count = 0;
       while ($recipients->fetch()) {
         if ($recipients->phone_id) {
           $recipients->email_id = "null";
@@ -488,13 +488,13 @@ VALUES (%1, %2, %3, %4, %5, %6, %7)
     $mailing->find(TRUE);
     $mailing->free();
 
-    $eq           = new CRM_Mailing_Event_BAO_Queue();
-    $eqTable      = CRM_Mailing_Event_BAO_Queue::getTableName();
-    $emailTable   = CRM_Core_BAO_Email::getTableName();
-    $phoneTable   = CRM_Core_DAO_Phone::getTableName();
+    $eq = new CRM_Mailing_Event_BAO_Queue();
+    $eqTable = CRM_Mailing_Event_BAO_Queue::getTableName();
+    $emailTable = CRM_Core_BAO_Email::getTableName();
+    $phoneTable = CRM_Core_DAO_Phone::getTableName();
     $contactTable = CRM_Contact_BAO_Contact::getTableName();
-    $edTable      = CRM_Mailing_Event_BAO_Delivered::getTableName();
-    $ebTable      = CRM_Mailing_Event_BAO_Bounce::getTableName();
+    $edTable = CRM_Mailing_Event_BAO_Delivered::getTableName();
+    $ebTable = CRM_Mailing_Event_BAO_Bounce::getTableName();
 
     $query = "  SELECT      $eqTable.id,
                                 $emailTable.email as email,
@@ -628,8 +628,8 @@ VALUES (%1, %2, %3, %4, %5, %6, %7)
 
     // get the return properties
     $returnProperties = $mailing->getReturnProperties();
-    $params           = $targetParams = $deliveredParams = array();
-    $count            = 0;
+    $params = $targetParams = $deliveredParams = array();
+    $count = 0;
 
     /**
      * CRM-15702: Sending bulk sms to contacts without e-mail addres fails.
@@ -687,8 +687,8 @@ VALUES (%1, %2, %3, %4, %5, %6, %7)
 
       if ($mailing->sms_provider_id) {
         $provider = CRM_SMS_Provider::singleton(array('mailing_id' => $mailing->id));
-        $body     = $provider->getMessage($message, $field['contact_id'], $details[0][$contactID]);
-        $headers  = $provider->getRecipientDetails($field, $details[0][$contactID]);
+        $body = $provider->getMessage($message, $field['contact_id'], $details[0][$contactID]);
+        $headers = $provider->getRecipientDetails($field, $details[0][$contactID]);
       }
 
       // make $recipient actually be the *encoded* header, so as not to baffle Mail_RFC822, CRM-5743
@@ -834,10 +834,10 @@ AND    ( ( job_type IS NULL ) OR
       in_array($job->status, array('Scheduled', 'Running', 'Paused'))
     ) {
 
-      $newJob           = new CRM_Mailing_BAO_MailingJob();
-      $newJob->id       = $job->id;
+      $newJob = new CRM_Mailing_BAO_MailingJob();
+      $newJob->id = $job->id;
       $newJob->end_date = date('YmdHis');
-      $newJob->status   = 'Canceled';
+      $newJob->status = 'Canceled';
       $newJob->save();
 
       // also cancel all child jobs
@@ -851,7 +851,7 @@ AND    job_type = 'child'
 AND    status IN ( 'Scheduled', 'Running', 'Paused' )
 ";
       $params = array(
-      1 => array($job->id, 'Integer'),
+        1 => array($job->id, 'Integer'),
         2 => array(date('YmdHis'), 'Timestamp'),
       );
       CRM_Core_DAO::executeQuery($sql, $params);
index d1d8ec871db45c74df4994f39dc636668ae692ee..1e934d63c9be31e27ce416f079b44ce2c731de7c 100644 (file)
@@ -71,13 +71,13 @@ class CRM_Mailing_BAO_Query {
 
       // get mailing name
       if (!empty($query->_returnProperties['mailing_name'])) {
-        $query->_select['mailing_name']  = "civicrm_mailing.name as mailing_name";
+        $query->_select['mailing_name'] = "civicrm_mailing.name as mailing_name";
         $query->_element['mailing_name'] = 1;
       }
 
       // get mailing subject
       if (!empty($query->_returnProperties['mailing_subject'])) {
-        $query->_select['mailing_subject']  = "civicrm_mailing.subject as mailing_subject";
+        $query->_select['mailing_subject'] = "civicrm_mailing.subject as mailing_subject";
         $query->_element['mailing_subject'] = 1;
       }
 
@@ -85,7 +85,7 @@ class CRM_Mailing_BAO_Query {
       if (!empty($query->_returnProperties['mailing_job_status'])) {
         $query->_tables['civicrm_mailing_job'] = $query->_whereTables['civicrm_mailing_job'] =
           " LEFT JOIN civicrm_mailing_job ON civicrm_mailing_job.mailing_id = civicrm_mailing.id AND civicrm_mailing_job.parent_id IS NULL AND civicrm_mailing_job.is_test != 1 ";
-        $query->_select['mailing_job_status']  = "civicrm_mailing_job.status as mailing_job_status";
+        $query->_select['mailing_job_status'] = "civicrm_mailing_job.status as mailing_job_status";
         $query->_element['mailing_job_status'] = 1;
       }
 
@@ -113,7 +113,7 @@ class CRM_Mailing_BAO_Query {
       if (!empty($query->_returnProperties['mailing_job_end_date'])) {
         $query->_tables['civicrm_mailing_job'] = $query->_whereTables['civicrm_mailing_job'] =
           " LEFT JOIN civicrm_mailing_job ON civicrm_mailing_job.mailing_id = civicrm_mailing.id AND civicrm_mailing_job.parent_id IS NULL AND civicrm_mailing_job.is_test != 1 ";
-        $query->_select['mailing_job_end_date']  = "civicrm_mailing_job.end_date as mailing_job_end_date";
+        $query->_select['mailing_job_end_date'] = "civicrm_mailing_job.end_date as mailing_job_end_date";
         $query->_element['mailing_job_end_date'] = 1;
       }
 
@@ -254,10 +254,10 @@ class CRM_Mailing_BAO_Query {
         $value = strtolower(addslashes($value));
         if ($wildcard) {
           $value = "%$value%";
-          $op    = 'LIKE';
+          $op = 'LIKE';
         }
         $query->_where[$grouping][] = "LOWER(civicrm_mailing.name) $op '$value'";
-        $query->_qill[$grouping][]  = "Mailing Namename $op \"$value\"";
+        $query->_qill[$grouping][] = "Mailing Namename $op \"$value\"";
         $query->_tables['civicrm_mailing'] = $query->_whereTables['civicrm_mailing'] = 1;
         $query->_tables['civicrm_mailing_recipients'] = $query->_whereTables['civicrm_mailing_recipients'] = 1;
         return;
@@ -306,7 +306,10 @@ class CRM_Mailing_BAO_Query {
           'civicrm_mailing_event_bounce',
           'bounce_type_id',
           ts('Bounce type(s)'),
-          CRM_Core_PseudoConstant::get('CRM_Mailing_Event_DAO_Bounce', 'bounce_type_id', array('keyColumn' => 'id', 'labelColumn' => 'name'))
+          CRM_Core_PseudoConstant::get('CRM_Mailing_Event_DAO_Bounce', 'bounce_type_id', array(
+              'keyColumn' => 'id',
+              'labelColumn' => 'name'
+            ))
         );
         return;
 
@@ -368,7 +371,7 @@ class CRM_Mailing_BAO_Query {
           $query->_tables['civicrm_mailing_recipients'] = $query->_whereTables['civicrm_mailing_recipients'] = 1;
 
           $query->_where[$grouping][] = " civicrm_mailing_job.status = '{$value}' ";
-          $query->_qill[$grouping][]  = "Mailing Job Status IS \"$value\"";
+          $query->_qill[$grouping][] = "Mailing Job Status IS \"$value\"";
         }
         return;
     }
index 68d459b224f03d4d12f9644d0972ad743280450f..dbb5fcfbd34e213160ab916b3cdc071b2f3ff983 100644 (file)
@@ -136,11 +136,11 @@ class CRM_Mailing_BAO_TrackableURL extends CRM_Mailing_DAO_TrackableURL {
       return;
     }
 
-    $protos  = '(https?|ftp)';
+    $protos = '(https?|ftp)';
     $letters = '\w';
-    $gunk    = '/#~:.?+=&%@!\-';
-    $punc    = '.:?\-';
-    $any     = "{$letters}{$gunk}{$punc}";
+    $gunk = '/#~:.?+=&%@!\-';
+    $punc = '.:?\-';
+    $any = "{$letters}{$gunk}{$punc}";
     if ($onlyHrefs) {
       $pattern = "{\\b(href=([\"'])?($protos:[$any]+?(?=[$punc]*[^$any]|$))([\"'])?)}im";
     }
index fc08f648fa3977041c09505a8b1c7c8782475291..b8398395fe2351810694d7908d632537050b34ad 100755 (executable)
@@ -55,8 +55,8 @@ class CRM_Mailing_Event_BAO_Bounce extends CRM_Mailing_Event_DAO_Bounce {
       return $success;
     }
 
-    $transaction        = new CRM_Core_Transaction();
-    $bounce             = new CRM_Mailing_Event_BAO_Bounce();
+    $transaction = new CRM_Core_Transaction();
+    $bounce = new CRM_Mailing_Event_BAO_Bounce();
     $bounce->time_stamp = date('YmdHis');
 
     // if we dont have a valid bounce type, we should set it
@@ -80,9 +80,9 @@ class CRM_Mailing_Event_BAO_Bounce extends CRM_Mailing_Event_DAO_Bounce {
     $success = TRUE;
 
     $bounceTable = CRM_Mailing_Event_BAO_Bounce::getTableName();
-    $bounceType  = CRM_Mailing_DAO_BounceType::getTableName();
-    $emailTable  = CRM_Core_BAO_Email::getTableName();
-    $queueTable  = CRM_Mailing_Event_BAO_Queue::getTableName();
+    $bounceType = CRM_Mailing_DAO_BounceType::getTableName();
+    $emailTable = CRM_Core_BAO_Email::getTableName();
+    $queueTable = CRM_Mailing_Event_BAO_Queue::getTableName();
 
     $bounce->reset();
     // might want to put distinct inside the count
@@ -105,9 +105,9 @@ class CRM_Mailing_Event_BAO_Bounce extends CRM_Mailing_Event_DAO_Bounce {
 
     while ($bounce->fetch()) {
       if ($bounce->bounces >= $bounce->threshold) {
-        $email            = new CRM_Core_BAO_Email();
-        $email->id        = $q->email_id;
-        $email->on_hold   = TRUE;
+        $email = new CRM_Core_BAO_Email();
+        $email->id = $q->email_id;
+        $email->on_hold = TRUE;
         $email->hold_date = date('YmdHis');
         $email->save();
         break;
@@ -135,10 +135,10 @@ class CRM_Mailing_Event_BAO_Bounce extends CRM_Mailing_Event_DAO_Bounce {
   public static function getTotalCount($mailing_id, $job_id = NULL, $is_distinct = FALSE, $toDate = NULL) {
     $dao = new CRM_Core_DAO();
 
-    $bounce  = self::getTableName();
-    $queue   = CRM_Mailing_Event_BAO_Queue::getTableName();
+    $bounce = self::getTableName();
+    $queue = CRM_Mailing_Event_BAO_Queue::getTableName();
     $mailing = CRM_Mailing_BAO_Mailing::getTableName();
-    $job     = CRM_Mailing_BAO_MailingJob::getTableName();
+    $job = CRM_Mailing_BAO_MailingJob::getTableName();
 
     $query = "
             SELECT      COUNT($bounce.id) as bounce
@@ -200,13 +200,13 @@ class CRM_Mailing_Event_BAO_Bounce extends CRM_Mailing_Event_DAO_Bounce {
 
     $dao = new CRM_Core_Dao();
 
-    $bounce     = self::getTableName();
+    $bounce = self::getTableName();
     $bounceType = CRM_Mailing_DAO_BounceType::getTableName();
-    $queue      = CRM_Mailing_Event_BAO_Queue::getTableName();
-    $mailing    = CRM_Mailing_BAO_Mailing::getTableName();
-    $job        = CRM_Mailing_BAO_MailingJob::getTableName();
-    $contact    = CRM_Contact_BAO_Contact::getTableName();
-    $email      = CRM_Core_BAO_Email::getTableName();
+    $queue = CRM_Mailing_Event_BAO_Queue::getTableName();
+    $mailing = CRM_Mailing_BAO_Mailing::getTableName();
+    $job = CRM_Mailing_BAO_MailingJob::getTableName();
+    $contact = CRM_Contact_BAO_Contact::getTableName();
+    $email = CRM_Core_BAO_Email::getTableName();
 
     $query = "
             SELECT      $contact.display_name as display_name,
@@ -269,7 +269,7 @@ class CRM_Mailing_Event_BAO_Bounce extends CRM_Mailing_Event_DAO_Bounce {
         'email' => $dao->email,
         // FIXME: translate this
         'type' => (empty($dao->bounce_type)
-      ? ts('Unknown') : $dao->bounce_type
+          ? ts('Unknown') : $dao->bounce_type
         ),
         'reason' => $dao->reason,
         'date' => CRM_Utils_Date::customFormat($dao->date),
index 68f8cb655c983b36a56928606c864bbc62409010..78d696db3a60ecdb1801349eab220d7a2818bb3d 100644 (file)
@@ -132,10 +132,10 @@ class CRM_Mailing_Event_BAO_Confirm extends CRM_Mailing_Event_DAO_Confirm {
       $text = CRM_Utils_String::htmlToText($component->body_html);
     }
 
-    $bao            = new CRM_Mailing_BAO_Mailing();
+    $bao = new CRM_Mailing_BAO_Mailing();
     $bao->body_text = $text;
     $bao->body_html = $html;
-    $tokens         = $bao->getTokens();
+    $tokens = $bao->getTokens();
 
     $html = CRM_Utils_Token::replaceDomainTokens($html, $domain, TRUE, $tokens['html']);
     $html = CRM_Utils_Token::replaceWelcomeTokens($html, $group->title, TRUE);
@@ -145,7 +145,7 @@ class CRM_Mailing_Event_BAO_Confirm extends CRM_Mailing_Event_DAO_Confirm {
 
     $mailParams = array(
       'groupName' => 'Mailing Event ' . $component->component_type,
-    'subject' => $component->subject,
+      'subject' => $component->subject,
       'from' => "\"$domainEmailName\" <do-not-reply@$emailDomain>",
       'toEmail' => $email,
       'toName' => $display_name,
index 04d15325230867f30c68627e39b6957f16341f3a..aaba7aa147c9fb920f5d8f90b26eeb82a0faa911 100755 (executable)
@@ -71,9 +71,9 @@ class CRM_Mailing_Event_BAO_Delivered extends CRM_Mailing_Event_DAO_Delivered {
     $queue->find(TRUE);
 
     while ($queue->fetch()) {
-      $email             = new CRM_Core_BAO_Email();
-      $email->id         = $queue->email_id;
-      $email->hold_date  = '';
+      $email = new CRM_Core_BAO_Email();
+      $email->id = $queue->email_id;
+      $email->hold_date = '';
       $email->reset_date = date('YmdHis');
       $email->save();
     }
@@ -99,10 +99,10 @@ class CRM_Mailing_Event_BAO_Delivered extends CRM_Mailing_Event_DAO_Delivered {
     $dao = new CRM_Core_DAO();
 
     $delivered = self::getTableName();
-    $bounce    = CRM_Mailing_Event_BAO_Bounce::getTableName();
-    $queue     = CRM_Mailing_Event_BAO_Queue::getTableName();
-    $mailing   = CRM_Mailing_BAO_Mailing::getTableName();
-    $job       = CRM_Mailing_BAO_MailingJob::getTableName();
+    $bounce = CRM_Mailing_Event_BAO_Bounce::getTableName();
+    $queue = CRM_Mailing_Event_BAO_Queue::getTableName();
+    $mailing = CRM_Mailing_BAO_Mailing::getTableName();
+    $job = CRM_Mailing_BAO_MailingJob::getTableName();
 
     $query = "
             SELECT      COUNT($delivered.id) as delivered
@@ -169,12 +169,12 @@ class CRM_Mailing_Event_BAO_Delivered extends CRM_Mailing_Event_DAO_Delivered {
     $dao = new CRM_Core_Dao();
 
     $delivered = self::getTableName();
-    $bounce    = CRM_Mailing_Event_BAO_Bounce::getTableName();
-    $queue     = CRM_Mailing_Event_BAO_Queue::getTableName();
-    $mailing   = CRM_Mailing_BAO_Mailing::getTableName();
-    $job       = CRM_Mailing_BAO_MailingJob::getTableName();
-    $contact   = CRM_Contact_BAO_Contact::getTableName();
-    $email     = CRM_Core_BAO_Email::getTableName();
+    $bounce = CRM_Mailing_Event_BAO_Bounce::getTableName();
+    $queue = CRM_Mailing_Event_BAO_Queue::getTableName();
+    $mailing = CRM_Mailing_BAO_Mailing::getTableName();
+    $job = CRM_Mailing_BAO_MailingJob::getTableName();
+    $contact = CRM_Contact_BAO_Contact::getTableName();
+    $email = CRM_Core_BAO_Email::getTableName();
 
     $query = "
             SELECT      $delivered.id as id,
@@ -260,8 +260,8 @@ class CRM_Mailing_Event_BAO_Delivered extends CRM_Mailing_Event_DAO_Delivered {
 
     while (!empty($values)) {
       $input = array_splice($values, 0, CRM_Core_DAO::BULK_INSERT_COUNT);
-      $str   = implode(',', $input);
-      $sql   = "INSERT INTO civicrm_mailing_event_delivered ( event_queue_id, time_stamp ) VALUES $str;";
+      $str = implode(',', $input);
+      $sql = "INSERT INTO civicrm_mailing_event_delivered ( event_queue_id, time_stamp ) VALUES $str;";
       CRM_Core_DAO::executeQuery($sql);
     }
   }
index fc7284f205872645a8e30175b059385bdf6407c7..1ddd7f985a61cc986c7f1900e09127c268052bfd 100755 (executable)
@@ -58,9 +58,9 @@ class CRM_Mailing_Event_BAO_Opened extends CRM_Mailing_Event_DAO_Opened {
     $q = new CRM_Mailing_Event_BAO_Queue();
     $q->id = $queue_id;
     if ($q->find(TRUE)) {
-      $oe                 = new CRM_Mailing_Event_BAO_Opened();
+      $oe = new CRM_Mailing_Event_BAO_Opened();
       $oe->event_queue_id = $queue_id;
-      $oe->time_stamp     = date('YmdHis');
+      $oe->time_stamp = date('YmdHis');
       $oe->save();
       $success = TRUE;
     }
@@ -90,10 +90,10 @@ class CRM_Mailing_Event_BAO_Opened extends CRM_Mailing_Event_DAO_Opened {
   ) {
     $dao = new CRM_Core_DAO();
 
-    $open    = self::getTableName();
-    $queue   = CRM_Mailing_Event_BAO_Queue::getTableName();
+    $open = self::getTableName();
+    $queue = CRM_Mailing_Event_BAO_Queue::getTableName();
     $mailing = CRM_Mailing_BAO_Mailing::getTableName();
-    $job     = CRM_Mailing_BAO_MailingJob::getTableName();
+    $job = CRM_Mailing_BAO_MailingJob::getTableName();
 
     $query = "
             SELECT      COUNT($open.id) as opened
@@ -143,9 +143,9 @@ class CRM_Mailing_Event_BAO_Opened extends CRM_Mailing_Event_DAO_Opened {
     $dao = new CRM_Core_DAO();
     $openedCount = array();
 
-    $open    = self::getTableName();
-    $queue   = CRM_Mailing_Event_BAO_Queue::getTableName();
-    $job     = CRM_Mailing_BAO_MailingJob::getTableName();
+    $open = self::getTableName();
+    $queue = CRM_Mailing_Event_BAO_Queue::getTableName();
+    $job = CRM_Mailing_BAO_MailingJob::getTableName();
     $mailingIDs = implode(',', $mailingIDs);
 
     $query = "
@@ -239,12 +239,12 @@ class CRM_Mailing_Event_BAO_Opened extends CRM_Mailing_Event_DAO_Opened {
   ) {
     $dao = new CRM_Core_Dao();
 
-    $open    = self::getTableName();
-    $queue   = CRM_Mailing_Event_BAO_Queue::getTableName();
+    $open = self::getTableName();
+    $queue = CRM_Mailing_Event_BAO_Queue::getTableName();
     $mailing = CRM_Mailing_BAO_Mailing::getTableName();
-    $job     = CRM_Mailing_BAO_MailingJob::getTableName();
+    $job = CRM_Mailing_BAO_MailingJob::getTableName();
     $contact = CRM_Contact_BAO_Contact::getTableName();
-    $email   = CRM_Core_BAO_Email::getTableName();
+    $email = CRM_Core_BAO_Email::getTableName();
 
     $query = "
             SELECT      $contact.display_name as display_name,
index 90ae82157fa6013e2dcd821efbcab34678f9bb32..c4002d4088b8ab06951b5613e0fb5fb89fbd3e21 100644 (file)
@@ -70,8 +70,8 @@ class CRM_Mailing_Event_BAO_Queue extends CRM_Mailing_Event_DAO_Queue {
    * @static
    */
   public static function hash($params) {
-    $jobId     = $params['job_id'];
-    $emailId   = CRM_Utils_Array::value('email_id', $params, '');
+    $jobId = $params['job_id'];
+    $emailId = CRM_Utils_Array::value('email_id', $params, '');
     $contactId = $params['contact_id'];
 
     return substr(sha1("{$jobId}:{$emailId}:{$contactId}:" . time()),
@@ -96,9 +96,9 @@ class CRM_Mailing_Event_BAO_Queue extends CRM_Mailing_Event_DAO_Queue {
     $success = NULL;
     $q = new CRM_Mailing_Event_BAO_Queue();
     if (!empty($job_id) && !empty($queue_id) && !empty($hash)) {
-      $q->id     = $queue_id;
+      $q->id = $queue_id;
       $q->job_id = $job_id;
-      $q->hash   = $hash;
+      $q->hash = $hash;
       if ($q->find(TRUE)) {
         $success = $q;
       }
@@ -118,7 +118,7 @@ class CRM_Mailing_Event_BAO_Queue extends CRM_Mailing_Event_DAO_Queue {
    */
   public static function getEmailAddress($queue_id) {
     $email = CRM_Core_BAO_Email::getTableName();
-    $eq    = self::getTableName();
+    $eq = self::getTableName();
     $query = "  SELECT      $email.email as email
                     FROM        $email
                     INNER JOIN  $eq
@@ -149,9 +149,9 @@ class CRM_Mailing_Event_BAO_Queue extends CRM_Mailing_Event_DAO_Queue {
   public static function getTotalCount($mailing_id, $job_id = NULL) {
     $dao = new CRM_Core_DAO();
 
-    $queue   = self::getTableName();
+    $queue = self::getTableName();
     $mailing = CRM_Mailing_BAO_Mailing::getTableName();
-    $job     = CRM_Mailing_BAO_MailingJob::getTableName();
+    $job = CRM_Mailing_BAO_MailingJob::getTableName();
 
     $dao->query("
             SELECT      COUNT(*) as queued
@@ -194,11 +194,11 @@ class CRM_Mailing_Event_BAO_Queue extends CRM_Mailing_Event_DAO_Queue {
   ) {
     $dao = new CRM_Core_Dao();
 
-    $queue   = self::getTableName();
+    $queue = self::getTableName();
     $mailing = CRM_Mailing_BAO_Mailing::getTableName();
-    $job     = CRM_Mailing_BAO_MailingJob::getTableName();
+    $job = CRM_Mailing_BAO_MailingJob::getTableName();
     $contact = CRM_Contact_BAO_Contact::getTableName();
-    $email   = CRM_Core_BAO_Email::getTableName();
+    $email = CRM_Core_BAO_Email::getTableName();
 
     $orderBy = "sort_name ASC, {$job}.start_date DESC";
     if ($sort) {
@@ -265,10 +265,10 @@ class CRM_Mailing_Event_BAO_Queue extends CRM_Mailing_Event_DAO_Queue {
    *   Mailing BAO
    */
   public function &getMailing() {
-    $mailing  = new CRM_Mailing_BAO_Mailing();
-    $jobs     = CRM_Mailing_BAO_MailingJob::getTableName();
+    $mailing = new CRM_Mailing_BAO_Mailing();
+    $jobs = CRM_Mailing_BAO_MailingJob::getTableName();
     $mailings = CRM_Mailing_BAO_Mailing::getTableName();
-    $queue    = self::getTableName();
+    $queue = self::getTableName();
 
     $mailing->query("
                 SELECT      $mailings.*
@@ -324,14 +324,14 @@ SELECT DISTINCT(civicrm_mailing_event_queue.contact_id) as contact_id,
     $values = array();
     foreach ($params as $param) {
       $values[] = "( {$param[0]}, {$param[1]}, {$param[2]}, {$param[3]}, '" . substr(sha1("{$param[0]}:{$param[1]}:{$param[2]}:{$param[3]}:{$now}"),
-        0, 16
-      ) . "' )";
+          0, 16
+        ) . "' )";
     }
 
     while (!empty($values)) {
       $input = array_splice($values, 0, CRM_Core_DAO::BULK_INSERT_COUNT);
-      $str   = implode(',', $input);
-      $sql   = "INSERT INTO civicrm_mailing_event_queue ( job_id, email_id, contact_id, phone_id, hash ) VALUES $str;";
+      $str = implode(',', $input);
+      $sql = "INSERT INTO civicrm_mailing_event_queue ( job_id, email_id, contact_id, phone_id, hash ) VALUES $str;";
       CRM_Core_DAO::executeQuery($sql);
     }
   }
index dc12b8d3633077601630af8ec63ab4e94dfdc076..f851c3e56e45da0429adc1bc0a8b49721c3dc8d9 100644 (file)
@@ -147,7 +147,7 @@ SELECT     civicrm_email.id as email_id
      WHERE civicrm_email.email = %1
        AND civicrm_email.contact_id = %2";
     $params = array(
-    1 => array($email, 'String'),
+      1 => array($email, 'String'),
       2 => array($contact_id, 'Integer'),
     );
     $dao = CRM_Core_DAO::executeQuery($query, $params);
@@ -220,13 +220,13 @@ SELECT     civicrm_email.id as email_id
     $emailDomain = CRM_Core_BAO_MailSettings::defaultDomain();
 
     $confirm = implode($config->verpSeparator,
-      array(
-        $localpart . 'c',
-        $this->contact_id,
-        $this->id,
-        $this->hash,
-      )
-    ) . "@$emailDomain";
+        array(
+          $localpart . 'c',
+          $this->contact_id,
+          $this->id,
+          $this->hash,
+        )
+      ) . "@$emailDomain";
 
     $group = new CRM_Contact_BAO_Group();
     $group->id = $this->group_id;
@@ -391,7 +391,10 @@ SELECT     civicrm_email.id as email_id
         $group[$groupID]['title'] = $contactGroups[$groupID]['title'];
 
         $group[$groupID]['status'] = $contactGroups[$groupID]['status'];
-        $status = ts('You are already subscribed in %1, your subscription is %2.', array(1 => $group[$groupID]['title'], 2 => $group[$groupID]['status']));
+        $status = ts('You are already subscribed in %1, your subscription is %2.', array(
+            1 => $group[$groupID]['title'],
+            2 => $group[$groupID]['status']
+          ));
         CRM_Utils_System::setUFMessage($status);
         continue;
       }
index 76af8fe1e77811ba5185ff5cde13566cdaef3f78..1e3b52a08d537cb46d93c414e7780198e7c66ec1 100755 (executable)
@@ -61,8 +61,8 @@ class CRM_Mailing_Event_BAO_TrackableURLOpen extends CRM_Mailing_Event_DAO_Track
     /* To find the url, we also join on the queue and job tables.  This
          * prevents foreign key violations. */
 
-    $job  = CRM_Mailing_BAO_MailingJob::getTableName();
-    $eq   = CRM_Mailing_Event_BAO_Queue::getTableName();
+    $job = CRM_Mailing_BAO_MailingJob::getTableName();
+    $eq = CRM_Mailing_Event_BAO_Queue::getTableName();
     $turl = CRM_Mailing_BAO_TrackableURL::getTableName();
 
     if (!$queue_id) {
@@ -118,10 +118,10 @@ class CRM_Mailing_Event_BAO_TrackableURLOpen extends CRM_Mailing_Event_DAO_Track
   ) {
     $dao = new CRM_Core_DAO();
 
-    $click   = self::getTableName();
-    $queue   = CRM_Mailing_Event_BAO_Queue::getTableName();
+    $click = self::getTableName();
+    $queue = CRM_Mailing_Event_BAO_Queue::getTableName();
     $mailing = CRM_Mailing_BAO_Mailing::getTableName();
-    $job     = CRM_Mailing_BAO_MailingJob::getTableName();
+    $job = CRM_Mailing_BAO_MailingJob::getTableName();
 
     $query = "
             SELECT      COUNT($click.id) as opened
@@ -275,13 +275,13 @@ class CRM_Mailing_Event_BAO_TrackableURLOpen extends CRM_Mailing_Event_DAO_Track
 
     $dao = new CRM_Core_Dao();
 
-    $click   = self::getTableName();
-    $url     = CRM_Mailing_BAO_TrackableURL::getTableName();
-    $queue   = CRM_Mailing_Event_BAO_Queue::getTableName();
+    $click = self::getTableName();
+    $url = CRM_Mailing_BAO_TrackableURL::getTableName();
+    $queue = CRM_Mailing_Event_BAO_Queue::getTableName();
     $mailing = CRM_Mailing_BAO_Mailing::getTableName();
-    $job     = CRM_Mailing_BAO_MailingJob::getTableName();
+    $job = CRM_Mailing_BAO_MailingJob::getTableName();
     $contact = CRM_Contact_BAO_Contact::getTableName();
-    $email   = CRM_Core_BAO_Email::getTableName();
+    $email = CRM_Core_BAO_Email::getTableName();
 
     $query = "
             SELECT      $contact.display_name as display_name,
index 79e7d234ee584bf2427d0f5ee31d50a9176bba66..66fea750931e8b21567f35d25ecbe025d678efe3 100755 (executable)
@@ -81,7 +81,7 @@ SET    on_hold = 2,
 WHERE  email = %2
 ";
         $sqlParams = array(
-        1 => array($now, 'Timestamp'),
+          1 => array($now, 'Timestamp'),
           2 => array($email->email, 'String'),
         );
         CRM_Core_DAO::executeQuery($sql, $sqlParams);
index da4c76b49db3deffd56bfaaf25020743ff27bba3..3477152a076cc271c752f79dd080f61853c354f9 100644 (file)
@@ -123,7 +123,7 @@ class CRM_Mailing_Form_Approve extends CRM_Core_Form {
 
     $buttons = array(
       array(
-    'type' => 'next',
+        'type' => 'next',
         'name' => ts('Save'),
         'spacing' => '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;',
         'isDefault' => TRUE,
@@ -240,8 +240,8 @@ class CRM_Mailing_Form_Approve extends CRM_Core_Form {
 
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/mailing/browse/scheduled',
-        'reset=1&scheduled=true'
-      ));
+      'reset=1&scheduled=true'
+    ));
   }
 
   /**
index 1bf8016eba84dd974b57ae11e3c4a65652ef014f..e595705024788b14402fca8a64e3750600653fc7 100644 (file)
@@ -58,9 +58,9 @@ class CRM_Mailing_Form_Browse extends CRM_Core_Form {
       CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
     }
 
-    $mailing     = new CRM_Mailing_BAO_Mailing();
+    $mailing = new CRM_Mailing_BAO_Mailing();
     $mailing->id = $this->_mailingId;
-    $subject     = '';
+    $subject = '';
     if ($mailing->find(TRUE)) {
       $subject = $mailing->subject;
     }
index 14f70362e8e5fd42f693989ad6a1be16b490e2c8..c689d4c832e5dc23e639e47d52941cff4b7a9f4e 100644 (file)
@@ -69,7 +69,10 @@ class CRM_Mailing_Form_Component extends CRM_Core_Form {
     $this->add('text', 'name', ts('Name'),
       CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Component', 'name'), TRUE
     );
-    $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array('CRM_Mailing_DAO_Component', $this->_id));
+    $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array(
+        'CRM_Mailing_DAO_Component',
+        $this->_id
+      ));
 
     $this->add('select', 'component_type', ts('Component Type'), CRM_Core_SelectValues::mailingComponents());
 
@@ -167,20 +170,24 @@ class CRM_Mailing_Form_Component extends CRM_Core_Form {
     }
     $errors = array();
     foreach (array(
-      'text', 'html') as $type) {
+               'text',
+               'html'
+             ) as $type) {
       $dataErrors = array();
       foreach ($InvalidTokens as $token => $desc) {
         if ($params['body_' . $type]) {
           if (preg_match('/' . preg_quote('{' . $token . '}') . '/', $params['body_' . $type])) {
             $dataErrors[] = '<li>' . ts('This message is having a invalid token - %1: %2', array(
-              1 => $token,
-            2 => $desc)) . '</li>';
+                1 => $token,
+                2 => $desc
+              )) . '</li>';
           }
         }
       }
       if (!empty($dataErrors)) {
         $errors['body_' . $type] = ts('The following errors were detected in %1 message:', array(
-          1 => $type)) . '<ul>' . implode('', $dataErrors) . '</ul><br /><a href="' . CRM_Utils_System::docURL2('Tokens', TRUE, NULL, NULL, NULL, "wiki") . '">' . ts('More information on tokens...') . '</a>';
+            1 => $type
+          )) . '<ul>' . implode('', $dataErrors) . '</ul><br /><a href="' . CRM_Utils_System::docURL2('Tokens', TRUE, NULL, NULL, NULL, "wiki") . '">' . ts('More information on tokens...') . '</a>';
       }
     }
 
index c586b05935e6c8960bcffbc35d9e6097a9dd959b..005bb10edf3ec88a76ee6edd6a5b0a4d3e092fff 100644 (file)
@@ -89,16 +89,16 @@ class CRM_Mailing_Form_ForwardMailing extends CRM_Core_Form {
     );
 
     $this->addButtons(array(
-        array(
-          'type' => 'next',
-          'name' => ts('Forward'),
-          'isDefault' => TRUE,
-        ),
-        array(
-          'type' => 'cancel',
-          'name' => ts('Cancel'),
-        ),
-      ));
+      array(
+        'type' => 'next',
+        'name' => ts('Forward'),
+        'isDefault' => TRUE,
+      ),
+      array(
+        'type' => 'cancel',
+        'name' => ts('Cancel'),
+      ),
+    ));
   }
 
   /**
@@ -108,15 +108,15 @@ class CRM_Mailing_Form_ForwardMailing extends CRM_Core_Form {
    * @return void
    */
   public function postProcess() {
-    $queue_id  = $this->get('queue_id');
-    $job_id    = $this->get('job_id');
-    $hash      = $this->get('hash');
+    $queue_id = $this->get('queue_id');
+    $job_id = $this->get('job_id');
+    $hash = $this->get('hash');
     $timeStamp = date('YmdHis');
 
-    $formValues          = $this->controller->exportValues($this->_name);
-    $params              = array();
+    $formValues = $this->controller->exportValues($this->_name);
+    $params = array();
     $params['body_text'] = $formValues['forward_comment'];
-    $html_comment        = $formValues['html_comment'];
+    $html_comment = $formValues['html_comment'];
     $params['body_html'] = str_replace('%7B', '{', str_replace('%7D', '}', $html_comment));
 
     $emails = array();
@@ -145,9 +145,15 @@ class CRM_Mailing_Form_ForwardMailing extends CRM_Core_Form {
       }
     }
 
-    $status = ts('Mailing is not forwarded to the given email address.', array('count' => count($emails), 'plural' => 'Mailing is not forwarded to the given email addresses.'));
+    $status = ts('Mailing is not forwarded to the given email address.', array(
+        'count' => count($emails),
+        'plural' => 'Mailing is not forwarded to the given email addresses.'
+      ));
     if ($forwarded) {
-      $status = ts('Mailing is forwarded successfully to %count email address.', array('count' => $forwarded, 'plural' => 'Mailing is forwarded successfully to %count email addresses.'));
+      $status = ts('Mailing is forwarded successfully to %count email address.', array(
+          'count' => $forwarded,
+          'plural' => 'Mailing is forwarded successfully to %count email addresses.'
+        ));
     }
 
     CRM_Utils_System::setUFMessage($status);
index db2d9ac026a137d6411b2ff14762212b991258f9..c9930150a2ad930616f380a89f4bb4f9400825b3 100644 (file)
@@ -53,7 +53,10 @@ class CRM_Mailing_Form_Group extends CRM_Contact_Form_Task {
    */
   public function preProcess() {
     if (CRM_Core_BAO_MailSettings::defaultDomain() == "EXAMPLE.ORG") {
-      CRM_Core_Error::fatal(ts('The <a href="%1">default mailbox</a> has not been configured. You will find <a href="%2">more info in our online user and administrator guide.</a>', array(1 => CRM_Utils_System::url('civicrm/admin/mailSettings', 'reset=1'), 2 => "http://book.civicrm.org/user/advanced-configuration/email-system-configuration/")));
+      CRM_Core_Error::fatal(ts('The <a href="%1">default mailbox</a> has not been configured. You will find <a href="%2">more info in our online user and administrator guide.</a>', array(
+            1 => CRM_Utils_System::url('civicrm/admin/mailSettings', 'reset=1'),
+            2 => "http://book.civicrm.org/user/advanced-configuration/email-system-configuration/"
+          )));
     }
 
     $this->_mailingID = CRM_Utils_Request::retrieve('mid', 'Integer', $this, FALSE, NULL);
@@ -156,8 +159,8 @@ class CRM_Mailing_Form_Group extends CRM_Contact_Form_Task {
     $showGroupSelector = TRUE;
     if ($this->_searchBasedMailing) {
       $showGroupSelector = FALSE;
-      $formElements      = array('includeGroups', 'excludeGroups', 'includeMailings', 'excludeMailings');
-      $formValues        = $this->controller->exportValues($this->_name);
+      $formElements = array('includeGroups', 'excludeGroups', 'includeMailings', 'excludeMailings');
+      $formValues = $this->controller->exportValues($this->_name);
       foreach ($formElements as $element) {
         if (!empty($formValues[$element])) {
           $showGroupSelector = TRUE;
@@ -240,7 +243,8 @@ class CRM_Mailing_Form_Group extends CRM_Contact_Form_Task {
       $this->add('select', 'baseGroup',
         ts('Unsubscription Group'),
         array(
-          '' => ts('- select -')) + CRM_Contact_BAO_Group::getGroupsHierarchy($staticGroups, NULL, '&nbsp;&nbsp;', TRUE),
+          '' => ts('- select -')
+        ) + CRM_Contact_BAO_Group::getGroupsHierarchy($staticGroups, NULL, '&nbsp;&nbsp;', TRUE),
         TRUE,
         array('class' => 'crm-select2 huge')
       );
@@ -320,9 +324,9 @@ class CRM_Mailing_Form_Group extends CRM_Contact_Form_Task {
       if ($this->_resultSelectOption == 'ts_sel') {
         // create a static grp if only a subset of result set was selected:
 
-        $randID   = md5(time());
+        $randID = md5(time());
         $grpTitle = "Hidden Group {$randID}";
-        $grpID    = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $grpTitle, 'id', 'title');
+        $grpID = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $grpTitle, 'id', 'title');
 
         if (!$grpID) {
           $groupParams = array(
@@ -339,8 +343,8 @@ class CRM_Mailing_Form_Group extends CRM_Contact_Form_Task {
 
           $newGroupTitle = "Hidden Group {$grpID}";
           $groupParams = array(
-            'id'    => $grpID,
-            'name'  => CRM_Utils_String::titleToVar($newGroupTitle),
+            'id' => $grpID,
+            'name' => CRM_Utils_String::titleToVar($newGroupTitle),
             'title' => $newGroupTitle,
             'group_type' => array('2' => 1),
           );
@@ -354,7 +358,7 @@ class CRM_Mailing_Form_Group extends CRM_Contact_Form_Task {
         //get the hidden smart group id.
         $ssId = $this->get('ssID');
         $hiddenSmartParams = array(
-        'group_type' => array('2' => 1),
+          'group_type' => array('2' => 1),
           'form_values' => $this->get('formValues'),
           'saved_search_id' => $ssId,
           'search_custom_id' => $this->get('customSearchID'),
@@ -380,7 +384,16 @@ class CRM_Mailing_Form_Group extends CRM_Contact_Form_Task {
     }
 
     foreach (
-      array('name', 'group_id', 'search_id', 'search_args', 'campaign_id', 'dedupe_email', 'location_type_id', 'email_selection_method') as $n
+      array(
+        'name',
+        'group_id',
+        'search_id',
+        'search_args',
+        'campaign_id',
+        'dedupe_email',
+        'location_type_id',
+        'email_selection_method'
+      ) as $n
     ) {
       if (!empty($values[$n])) {
         $params[$n] = $values[$n];
@@ -390,9 +403,9 @@ class CRM_Mailing_Form_Group extends CRM_Contact_Form_Task {
     $qf_Group_submit = $this->controller->exportValue($this->_name, '_qf_Group_submit');
     $this->set('name', $params['name']);
 
-    $inGroups    = $values['includeGroups'];
-    $outGroups   = $values['excludeGroups'];
-    $inMailings  = $values['includeMailings'];
+    $inGroups = $values['includeGroups'];
+    $outGroups = $values['excludeGroups'];
+    $inMailings = $values['includeMailings'];
     $outMailings = $values['excludeMailings'];
 
     if (is_array($inGroups)) {
@@ -426,8 +439,8 @@ class CRM_Mailing_Form_Group extends CRM_Contact_Form_Task {
       }
     }
 
-    $session            = CRM_Core_Session::singleton();
-    $params['groups']   = $groups;
+    $session = CRM_Core_Session::singleton();
+    $params['groups'] = $groups;
     $params['mailings'] = $mailings;
     $ids = array();
     if ($this->get('mailing_id')) {
@@ -440,8 +453,8 @@ class CRM_Mailing_Form_Group extends CRM_Contact_Form_Task {
 
       // delete previous includes/excludes, if mailing already existed
       foreach (array('groups', 'mailings') as $entity) {
-        $mg               = new CRM_Mailing_DAO_MailingGroup();
-        $mg->mailing_id   = $ids['mailing_id'];
+        $mg = new CRM_Mailing_DAO_MailingGroup();
+        $mg->mailing_id = $ids['mailing_id'];
         $mg->entity_table = ($entity == 'groups') ? $groupTableName : $mailingTableName;
         $mg->find();
         while ($mg->fetch()) {
index a2b2c4240d2590402ddac2aad41114305bb1651f..0825dc451a7c0e05172219b6558a01c04eb4ec28 100644 (file)
@@ -96,7 +96,7 @@ class CRM_Mailing_Form_Optout extends CRM_Core_Form {
     $queue_id = $this->_queue_id;
     $hash = $this->_hash;
 
-    $confirmURL = CRM_Utils_System::url("civicrm/mailing/{$this->_type}","reset=1&jid={$job_id}&qid={$queue_id}&h={$hash}&confirm=1");
+    $confirmURL = CRM_Utils_System::url("civicrm/mailing/{$this->_type}", "reset=1&jid={$job_id}&qid={$queue_id}&h={$hash}&confirm=1");
     $this->assign('confirmURL', $confirmURL);
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext($confirmURL);
index 0e1e252e4d1fac373dd0b946df677fe771b93d86..a58d8da6757f3c41db3665663da2e9f1c3e11b02 100644 (file)
@@ -67,6 +67,7 @@ class CRM_Mailing_Form_Schedule extends CRM_Core_Form {
       $this->_scheduleFormOnly = TRUE;
     }
   }
+
   /**
    * Set default values for the form.
    *
@@ -102,13 +103,13 @@ class CRM_Mailing_Form_Schedule extends CRM_Core_Form {
 
     if ($this->_scheduleFormOnly) {
       $title = ts('Schedule Mailing') . ' - ' . CRM_Core_DAO::getFieldValue('CRM_Mailing_DAO_Mailing',
-        $this->_mailingID,
-        'name'
-      );
+          $this->_mailingID,
+          'name'
+        );
       CRM_Utils_System::setTitle($title);
       $buttons = array(
         array(
-      'type' => 'next',
+          'type' => 'next',
           'name' => ts('Submit Mailing'),
           'spacing' => '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;',
           'isDefault' => TRUE,
@@ -162,8 +163,8 @@ class CRM_Mailing_Form_Schedule extends CRM_Core_Form {
       $this->_scheduleFormOnly
     ) {
       // add the preview elements
-      $preview            = array();
-      $preview['type']    = CRM_Core_DAO::getFieldValue('CRM_Mailing_DAO_Mailing', $this->_mailingID, 'body_html') ? 'html' : 'text';
+      $preview = array();
+      $preview['type'] = CRM_Core_DAO::getFieldValue('CRM_Mailing_DAO_Mailing', $this->_mailingID, 'body_html') ? 'html' : 'text';
       $preview['subject'] = CRM_Core_DAO::getFieldValue('CRM_Mailing_DAO_Mailing',
         $this->_mailingID,
         'subject'
@@ -248,8 +249,9 @@ class CRM_Mailing_Form_Schedule extends CRM_Core_Form {
     }
 
     if (CRM_Utils_Date::format(CRM_Utils_Date::processDate($params['start_date'],
-          $params['start_date_time']
-        )) < CRM_Utils_Date::format(date('YmdHi00'))) {
+        $params['start_date_time']
+      )) < CRM_Utils_Date::format(date('YmdHi00'))
+    ) {
       return array(
         'start_date' => ts('Start date cannot be earlier than the current time.'),
       );
@@ -342,8 +344,8 @@ class CRM_Mailing_Form_Schedule extends CRM_Core_Form {
 
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/mailing/browse/scheduled',
-        'reset=1&scheduled=true'
-      ));
+      'reset=1&scheduled=true'
+    ));
   }
 
   /**
index ce48afdf0e5621506fc32e732ce9c196feb6eac8..aaf30ca74da18088e45d777fadd872c1c8522d68 100644 (file)
@@ -68,12 +68,12 @@ class CRM_Mailing_Form_Search extends CRM_Core_Form {
     $this->add('hidden', 'hidden_find_mailings', 1);
 
     $this->addButtons(array(
-        array(
-          'type' => 'refresh',
-          'name' => ts('Search'),
-          'isDefault' => TRUE,
-        ),
-      ));
+      array(
+        'type' => 'refresh',
+        'name' => ts('Search'),
+        'isDefault' => TRUE,
+      ),
+    ));
   }
 
   /**
@@ -110,14 +110,27 @@ class CRM_Mailing_Form_Search extends CRM_Core_Form {
 
     $parent = $this->controller->getParent();
     if (!empty($params)) {
-      $fields = array('mailing_name', 'mailing_from', 'mailing_to', 'sort_name',
-                'campaign_id', 'mailing_status', 'sms', 'status_unscheduled', 'is_archived', 'hidden_find_mailings');
+      $fields = array(
+        'mailing_name',
+        'mailing_from',
+        'mailing_to',
+        'sort_name',
+        'campaign_id',
+        'mailing_status',
+        'sms',
+        'status_unscheduled',
+        'is_archived',
+        'hidden_find_mailings'
+      );
       foreach ($fields as $field) {
         if (isset($params[$field]) &&
           !CRM_Utils_System::isNull($params[$field])
         ) {
           if (in_array($field, array(
-            'mailing_from', 'mailing_to')) && !$params["mailing_relative"]) {
+              'mailing_from',
+              'mailing_to'
+            )) && !$params["mailing_relative"]
+          ) {
             $time = ($field == 'mailing_to') ? '235959' : NULL;
             $parent->set($field, CRM_Utils_Date::processDate($params[$field], $time));
           }
index 6f51a9556a90ec4c04d5bc630dfee3089f40ce2d..142403ed340b4311e03505b139d7b6a9a445be2b 100644 (file)
@@ -108,11 +108,11 @@ ORDER BY title";
       $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
       $rows = array();
       while ($dao->fetch()) {
-        $row                = array();
-        $row['id']          = $dao->id;
-        $row['title']       = $dao->title;
+        $row = array();
+        $row['id'] = $dao->id;
+        $row['title'] = $dao->title;
         $row['description'] = $dao->description;
-        $row['checkbox']    = CRM_Core_Form::CB_PREFIX . $row['id'];
+        $row['checkbox'] = CRM_Core_Form::CB_PREFIX . $row['id'];
         $this->addElement('checkbox',
           $row['checkbox'],
           NULL, NULL
@@ -131,12 +131,13 @@ ORDER BY title";
     // if recaptcha is not configured, then dont add it
     // CRM-11316 Only enable ReCAPTCHA for anonymous visitors
     $config = CRM_Core_Config::singleton();
-    $session   = CRM_Core_Session::singleton();
+    $session = CRM_Core_Session::singleton();
     $contactID = $session->get('userID');
 
     if (empty($config->recaptchaPublicKey) ||
       empty($config->recaptchaPrivateKey) ||
-      $contactID) {
+      $contactID
+    ) {
       $addCaptcha = FALSE;
     }
     else {
index b49e260fcabcd087c2f0ce1dbe39c28db17fabc1..74448afb0772ee6ac9e27b2a487f1301192221ec 100644 (file)
@@ -94,7 +94,7 @@ class CRM_Mailing_Form_Task extends CRM_Core_Form {
     else {
       $queryParams = $form->get('queryParams');
       $sortOrder = NULL;
-      if ($form->get(CRM_Utils_Sort::SORT_ORDER )) {
+      if ($form->get(CRM_Utils_Sort::SORT_ORDER)) {
         $sortOrder = $form->get(CRM_Utils_Sort::SORT_ORDER);
       }
 
index bf7cc15dcf1900a22260820ffa0a11427ca4872e..c1282d9a0f2ed196f86b7cb535e77cd907ba5d65 100644 (file)
@@ -113,8 +113,8 @@ class CRM_Mailing_Form_Test extends CRM_Core_Form {
     $this->addButtons($buttons);
 
     $mailingID = $this->get('mailing_id');
-    $textFile  = $this->get('textFile');
-    $htmlFile  = $this->get('htmlFile');
+    $textFile = $this->get('textFile');
+    $htmlFile = $this->get('htmlFile');
 
     $this->addFormRule(array('CRM_Mailing_Form_Test', 'testMail'), $this);
     $preview = array();
@@ -146,8 +146,8 @@ class CRM_Mailing_Form_Test extends CRM_Core_Form {
     );
 
     $returnProperties = $mailing->getReturnProperties();
-    $userID           = $session->get('userID');
-    $params           = array('contact_id' => $userID);
+    $userID = $session->get('userID');
+    $params = array('contact_id' => $userID);
 
     $details = CRM_Utils_Token::getTokenDetails($params,
       $returnProperties,
@@ -262,10 +262,11 @@ class CRM_Mailing_Form_Test extends CRM_Core_Form {
     }
 
     if (!empty($testParams['_qf_Test_next']) &&
-      $self->get('count') <= 0) {
+      $self->get('count') <= 0
+    ) {
       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'."),
       );
     }
 
@@ -274,9 +275,9 @@ class CRM_Mailing_Form_Test extends CRM_Core_Form {
       return $error;
     }
 
-    $job             = new CRM_Mailing_BAO_MailingJob();
+    $job = new CRM_Mailing_BAO_MailingJob();
     $job->mailing_id = $self->get('mailing_id');
-    $job->is_test    = TRUE;
+    $job->is_test = TRUE;
     $job->save();
     $newEmails = NULL;
     $session = CRM_Core_Session::singleton();
@@ -322,13 +323,14 @@ ORDER BY   e.is_bulkmail DESC, e.is_primary DESC
             'contact_type' => 'Individual',
             'email' => array(
               1 => array(
-          'email' => $email,
+                'email' => $email,
                 'is_primary' => 1,
                 'location_type_id' => 1,
-              )),
+              )
+            ),
           );
-          $contact   = CRM_Contact_BAO_Contact::create($params);
-          $emailId   = $contact->email[0]->id;
+          $contact = CRM_Contact_BAO_Contact::create($params);
+          $emailId = $contact->email[0]->id;
           $contactId = $contact->id;
           $contact->free();
         }
index 76d19646915fc2dbde4d3091b1062d1148093937..876aa3ab528109774697184184eb7bc7eaf3980d 100644 (file)
@@ -114,7 +114,7 @@ class CRM_Mailing_Form_Unsubscribe extends CRM_Core_Form {
     $queue_id = $this->_queue_id;
     $hash = $this->_hash;
 
-    $confirmURL = CRM_Utils_System::url("civicrm/mailing/{$this->_type}","reset=1&jid={$job_id}&qid={$queue_id}&h={$hash}&confirm=1");
+    $confirmURL = CRM_Utils_System::url("civicrm/mailing/{$this->_type}", "reset=1&jid={$job_id}&qid={$queue_id}&h={$hash}&confirm=1");
     $this->assign('confirmURL', $confirmURL);
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext($confirmURL);
@@ -140,7 +140,7 @@ class CRM_Mailing_Form_Unsubscribe extends CRM_Core_Form {
         array(1 => $values['email_confirm'])
       );
 
-    CRM_Core_Session::setStatus($statusMsg, '', 'fail');
+      CRM_Core_Session::setStatus($statusMsg, '', 'fail');
 
     }
 
index 223456d304503efb74320233127f080976a55ebb..2bb94e4def61a3c9e228058c9a4c508ca83f86a8 100644 (file)
@@ -56,6 +56,7 @@ class CRM_Mailing_Form_Upload extends CRM_Core_Form {
       $this->assign("value", $result);
     }
   }
+
   /**
    * Set default values for the form.
    * the default values are retrieved from the database
@@ -206,7 +207,7 @@ class CRM_Mailing_Form_Upload extends CRM_Core_Form {
    */
   public function buildQuickForm() {
     $session = CRM_Core_Session::singleton();
-    $config  = CRM_Core_Config::singleton();
+    $config = CRM_Core_Config::singleton();
     $options = array();
     $tempVar = FALSE;
 
@@ -230,7 +231,8 @@ class CRM_Mailing_Form_Upload extends CRM_Core_Form {
 
     $this->add('select', 'from_email_address',
       ts('From Email Address'), array(
-        '' => '- select -') + $fromEmailAddress, TRUE
+        '' => '- select -'
+      ) + $fromEmailAddress, TRUE
     );
 
     //Added code to add custom field as Reply-To on form when it is enabled from Mailer settings
@@ -319,9 +321,9 @@ class CRM_Mailing_Form_Upload extends CRM_Core_Form {
   }
 
   public function postProcess() {
-    $params       = $ids = array();
+    $params = $ids = array();
     $uploadParams = array('header_id', 'footer_id', 'subject', 'from_name', 'from_email');
-    $fileType     = array('textFile', 'htmlFile');
+    $fileType = array('textFile', 'htmlFile');
 
     $formValues = $this->controller->exportValues($this->_name);
 
@@ -374,8 +376,10 @@ class CRM_Mailing_Form_Upload extends CRM_Core_Form {
     $session = CRM_Core_Session::singleton();
     $params['contact_id'] = $session->get('userID');
     $composeFields = array(
-      'template', 'saveTemplate',
-      'updateTemplate', 'saveTemplateName',
+      'template',
+      'saveTemplate',
+      'updateTemplate',
+      'saveTemplateName',
     );
     $msgTemplate = NULL;
     //mail template is composed
@@ -482,9 +486,9 @@ class CRM_Mailing_Form_Upload extends CRM_Core_Form {
           $urlParams .= "&qfKey=$qfKey";
         }
 
-        $session  = CRM_Core_Session::singleton();
+        $session = CRM_Core_Session::singleton();
         $draftURL = CRM_Utils_System::url('civicrm/mailing/browse/unscheduled', 'scheduled=false&reset=1');
-        $status   = ts("You can continue later by clicking the 'Continue' action to resume working on it.<br />From <a href='%1'>Draft and Unscheduled Mailings</a>.", array(1 => $draftURL));
+        $status = ts("You can continue later by clicking the 'Continue' action to resume working on it.<br />From <a href='%1'>Draft and Unscheduled Mailings</a>.", array(1 => $draftURL));
         CRM_Core_Session::setStatus($status, ts('Mailing Saved'), 'success');
 
         // Redirect user to search.
@@ -532,7 +536,7 @@ class CRM_Mailing_Form_Upload extends CRM_Core_Form {
 
     $session = CRM_Core_Session::singleton();
     $values = array(
-    'contact_id' => $session->get('userID'),
+      'contact_id' => $session->get('userID'),
       'version' => 3,
     );
     require_once 'api/api.php';
@@ -553,7 +557,9 @@ class CRM_Mailing_Form_Upload extends CRM_Core_Form {
 
     // set $header and $footer
     foreach (array(
-      'header', 'footer') as $part) {
+               'header',
+               'footer'
+             ) as $part) {
       $$part = array();
       if ($params["{$part}_id"]) {
         //echo "found<p>";
@@ -591,7 +597,9 @@ class CRM_Mailing_Form_Upload extends CRM_Core_Form {
     }
 
     foreach (array(
-      'text', 'html') as $file) {
+               'text',
+               'html'
+             ) as $file) {
       if (!$params['upload_type'] && !file_exists(CRM_Utils_Array::value('tmp_name', $files[$file . 'File']))) {
         continue;
       }
@@ -604,8 +612,8 @@ class CRM_Mailing_Form_Upload extends CRM_Core_Form {
         $name = $files[$file . 'File']['name'];
       }
       else {
-        $str  = $params[$file . '_message'];
-        $str  = ($file == 'html') ? str_replace('%7B', '{', str_replace('%7D', '}', $str)) : $str;
+        $str = $params[$file . '_message'];
+        $str = ($file == 'html') ? str_replace('%7B', '{', str_replace('%7D', '}', $str)) : $str;
         $name = $file . ' message';
       }
 
@@ -622,8 +630,8 @@ class CRM_Mailing_Form_Upload extends CRM_Core_Form {
         if ($err !== TRUE) {
           foreach ($err as $token => $desc) {
             $dataErrors[] = '<li>' . ts('This message is missing a required token - {%1}: %2',
-              array(1 => $token, 2 => $desc)
-            ) . '</li>';
+                array(1 => $token, 2 => $desc)
+              ) . '</li>';
           }
         }
       }
@@ -638,10 +646,10 @@ class CRM_Mailing_Form_Upload extends CRM_Core_Form {
       // be a suggestion from someone on how to
       // make it a bit more elegant
 
-      $dummy_mail        = new CRM_Mailing_BAO_Mailing();
-      $mess              = "body_{$file}";
+      $dummy_mail = new CRM_Mailing_BAO_Mailing();
+      $mess = "body_{$file}";
       $dummy_mail->$mess = $str;
-      $tokens            = $dummy_mail->getTokens();
+      $tokens = $dummy_mail->getTokens();
 
       $str = CRM_Utils_Token::replaceSubscribeInviteTokens($str);
       $str = CRM_Utils_Token::replaceDomainTokens($str, $domain, NULL, $tokens[$file]);
@@ -659,7 +667,8 @@ class CRM_Mailing_Form_Upload extends CRM_Core_Form {
       }
       if (!empty($dataErrors)) {
         $errors[$file . 'File'] = ts('The following errors were detected in %1:', array(
-          1 => $name)) . ' <ul>' . implode('', $dataErrors) . '</ul><br /><a href="' . CRM_Utils_System::docURL2('Sample CiviMail Messages', TRUE, NULL, NULL, NULL, "wiki") . '" target="_blank">' . ts('More information on required tokens...') . '</a>';
+            1 => $name
+          )) . ' <ul>' . implode('', $dataErrors) . '</ul><br /><a href="' . CRM_Utils_System::docURL2('Sample CiviMail Messages', TRUE, NULL, NULL, NULL, "wiki") . '" target="_blank">' . ts('More information on required tokens...') . '</a>';
       }
     }
 
index 8ca35331d4b27b8e6cb48794edeb3cf0bbfd45c9..015d5eb031a1bf46c413daff2a83cb82464d4d2e 100644 (file)
@@ -59,12 +59,20 @@ class CRM_Mailing_Info extends CRM_Core_Component_Info {
     $result = array();
     $result['crmMailing'] = array(
       'ext' => 'civicrm',
-      'js' => array('js/angular-crmMailing.js', 'js/angular-crmMailing/services.js', 'js/angular-crmMailing/directives.js'),
+      'js' => array(
+        'js/angular-crmMailing.js',
+        'js/angular-crmMailing/services.js',
+        'js/angular-crmMailing/directives.js'
+      ),
       'css' => array('css/angular-crmMailing.css'),
     );
     $result['crmMailingAB'] = array(
       'ext' => 'civicrm',
-      'js' => array('js/angular-crmMailingAB.js', 'js/angular-crmMailingAB/services.js', 'js/angular-crmMailingAB/directives.js'),
+      'js' => array(
+        'js/angular-crmMailingAB.js',
+        'js/angular-crmMailingAB/services.js',
+        'js/angular-crmMailingAB/directives.js'
+      ),
       'css' => array('css/angular-crmMailingAB.css'),
     );
     $result['crmD3'] = array(
@@ -100,7 +108,7 @@ class CRM_Mailing_Info extends CRM_Core_Component_Info {
         'contact_id' => $contactID,
       ));
       $mesTemplate = civicrm_api3('MessageTemplate', 'get', array(
-      'sequential' => 1,
+        'sequential' => 1,
         'return' => array("msg_html", "id", "msg_title", "msg_subject", "msg_text"),
         'workflow_id' => array('IS NULL' => ""),
       ));
@@ -127,10 +135,13 @@ class CRM_Mailing_Info extends CRM_Core_Component_Info {
         'contactid' => $contactID,
         'enableReplyTo' => isset($config->replyTo) ? $config->replyTo : 0,
         'fromAddress' => array_values($fromAddress['values'][0]['api.OptionValue.get']['values']),
-        'defaultTestEmail' => civicrm_api3('Contact', 'getvalue', array('id' => 'user_contact_id', 'return' => 'email')),
+        'defaultTestEmail' => civicrm_api3('Contact', 'getvalue', array(
+            'id' => 'user_contact_id',
+            'return' => 'email'
+          )),
         'visibility' => array(
-            array('value' => 'Public Pages', 'label' => ts('Public Pages')),
-            array('value' => 'User and User Admin Only', 'label' => ts('User and User Admin Only')),
+          array('value' => 'Public Pages', 'label' => ts('Public Pages')),
+          array('value' => 'User and User Admin Only', 'label' => ts('User and User Admin Only')),
         ),
       ),
     ));
@@ -226,7 +237,7 @@ class CRM_Mailing_Info extends CRM_Core_Component_Info {
    */
   public function registerAdvancedSearchPane() {
     return array(
-    'title' => ts('Mailings'),
+      'title' => ts('Mailings'),
       'weight' => 20,
     );
   }
index 8aeb4418564dbbabafb295ce6cc0b208390b623f..f11c413f224aad4c0ffe3d13ecd1c537cdc0df6e 100644 (file)
@@ -47,8 +47,8 @@ class CRM_Mailing_MailStore {
    *   mail store implementation for processing CiviMail-bound emails
    */
   public static function getStore($name = NULL) {
-    $dao               = new CRM_Core_DAO_MailSettings;
-    $dao->domain_id    = CRM_Core_Config::domainID();
+    $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)) {
       throw new Exception("Could not find entry named $name in civicrm_mail_settings");
@@ -121,7 +121,7 @@ class CRM_Mailing_MailStore {
         print "fetching $count messages\n";
       }
     }
-    catch(ezcMailOffsetOutOfRangeException$e) {
+    catch (ezcMailOffsetOutOfRangeException$e) {
       if ($this->_debug) {
         print "got to the end of the mailbox\n";
       }
@@ -156,7 +156,10 @@ class CRM_Mailing_MailStore {
     $config = CRM_Core_Config::singleton();
     $dir = $config->customFileUploadDir . DIRECTORY_SEPARATOR . $name;
     foreach (array(
-      'cur', 'new', 'tmp') as $sub) {
+               'cur',
+               'new',
+               'tmp'
+             ) as $sub) {
       if (!file_exists($dir . DIRECTORY_SEPARATOR . $sub)) {
         if ($this->_debug) {
           print "creating $dir/$sub\n";
index 6c238a65b15f494ff6851cbb6c47db33ea070ba0..a6de684fc9bd9846e50d1aa1477dfb937fac4a59 100644 (file)
@@ -74,9 +74,9 @@ class CRM_Mailing_MailStore_Imap extends CRM_Mailing_MailStore {
     $this->_transport->authenticate($username, $password);
     $this->_transport->selectMailbox($folder);
 
-    $this->_ignored   = implode($this->_transport->getHierarchyDelimiter(), array($folder, 'CiviMail', 'ignored'));
+    $this->_ignored = implode($this->_transport->getHierarchyDelimiter(), array($folder, 'CiviMail', 'ignored'));
     $this->_processed = implode($this->_transport->getHierarchyDelimiter(), array($folder, 'CiviMail', 'processed'));
-    $boxes            = $this->_transport->listMailboxes();
+    $boxes = $this->_transport->listMailboxes();
 
     if ($this->_debug) {
       print 'mailboxes found: ' . implode(', ', $boxes) . "\n";
index 1f46225178ea4cd0809fdb898ab8592456fff144..27487fd1a875138774ca760333f8b4fd8e34f242 100644 (file)
@@ -52,8 +52,18 @@ class CRM_Mailing_MailStore_Localdir extends CRM_Mailing_MailStore {
   public function __construct($dir) {
     $this->_dir = $dir;
 
-    $this->_ignored = $this->maildir(implode(DIRECTORY_SEPARATOR, array('CiviMail.ignored', date('Y'), date('m'), date('d'))));
-    $this->_processed = $this->maildir(implode(DIRECTORY_SEPARATOR, array('CiviMail.processed', date('Y'), date('m'), date('d'))));
+    $this->_ignored = $this->maildir(implode(DIRECTORY_SEPARATOR, array(
+          'CiviMail.ignored',
+          date('Y'),
+          date('m'),
+          date('d')
+        )));
+    $this->_processed = $this->maildir(implode(DIRECTORY_SEPARATOR, array(
+          'CiviMail.processed',
+          date('Y'),
+          date('m'),
+          date('d')
+        )));
   }
 
   /**
@@ -99,8 +109,8 @@ class CRM_Mailing_MailStore_Localdir extends CRM_Mailing_MailStore {
 
       if (!$mail) {
         return CRM_Core_Error::createAPIError(ts('%1 could not be parsed',
-            array(1 => $file)
-          ));
+          array(1 => $file)
+        ));
       }
       $mails[$file] = $mail[0];
     }
index 0c21cd8a41b1eeb16191af2a55c6c34ca94fe1ad..81fb503f663611df463436b2f249f0fd98b5d662 100644 (file)
@@ -52,8 +52,18 @@ class CRM_Mailing_MailStore_Maildir extends CRM_Mailing_MailStore {
   public function __construct($dir) {
     $this->_dir = $dir;
 
-    $this->_ignored = $this->maildir(implode(DIRECTORY_SEPARATOR, array('CiviMail.ignored', date('Y'), date('m'), date('d'))));
-    $this->_processed = $this->maildir(implode(DIRECTORY_SEPARATOR, array('CiviMail.processed', date('Y'), date('m'), date('d'))));
+    $this->_ignored = $this->maildir(implode(DIRECTORY_SEPARATOR, array(
+          'CiviMail.ignored',
+          date('Y'),
+          date('m'),
+          date('d')
+        )));
+    $this->_processed = $this->maildir(implode(DIRECTORY_SEPARATOR, array(
+          'CiviMail.processed',
+          date('Y'),
+          date('m'),
+          date('d')
+        )));
   }
 
   /**
@@ -73,7 +83,9 @@ class CRM_Mailing_MailStore_Maildir extends CRM_Mailing_MailStore {
     $parser->options->parseTextAttachmentsAsFiles = TRUE;
 
     foreach (array(
-      'cur', 'new') as $subdir) {
+               'cur',
+               'new'
+             ) as $subdir) {
       $dir = $this->_dir . DIRECTORY_SEPARATOR . $subdir;
       foreach (scandir($dir) as $file) {
         if ($file == '.' or $file == '..') {
@@ -87,8 +99,8 @@ class CRM_Mailing_MailStore_Maildir extends CRM_Mailing_MailStore {
 
         }
 
-        $set          = new ezcMailFileSet(array($path));
-        $single       = $parser->parseMail($set);
+        $set = new ezcMailFileSet(array($path));
+        $single = $parser->parseMail($set);
         $mails[$path] = $single[0];
       }
     }
index a0e6191beabae09575c6335e2b96a6e1da4c4101..2b39759e4722eb7049fd65d1468cc880bc1eeecf 100644 (file)
@@ -55,8 +55,18 @@ class CRM_Mailing_MailStore_Mbox extends CRM_Mailing_MailStore {
 
     $this->_leftToProcess = count($this->_transport->listMessages());
 
-    $this->_ignored = $this->maildir(implode(DIRECTORY_SEPARATOR, array('CiviMail.ignored', date('Y'), date('m'), date('d'))));
-    $this->_processed = $this->maildir(implode(DIRECTORY_SEPARATOR, array('CiviMail.processed', date('Y'), date('m'), date('d'))));
+    $this->_ignored = $this->maildir(implode(DIRECTORY_SEPARATOR, array(
+          'CiviMail.ignored',
+          date('Y'),
+          date('m'),
+          date('d')
+        )));
+    $this->_processed = $this->maildir(implode(DIRECTORY_SEPARATOR, array(
+          'CiviMail.processed',
+          date('Y'),
+          date('m'),
+          date('d')
+        )));
   }
 
   /**
index bfe1f25fe0f6f2681c5727c81fc5e65429586349..49b2b22e353c1b195240ee4b0f4e6764c3391e39 100644 (file)
@@ -64,8 +64,18 @@ class CRM_Mailing_MailStore_Pop3 extends CRM_Mailing_MailStore {
     $this->_transport = new ezcMailPop3Transport($host, NULL, $options);
     $this->_transport->authenticate($username, $password);
 
-    $this->_ignored = $this->maildir(implode(DIRECTORY_SEPARATOR, array('CiviMail.ignored', date('Y'), date('m'), date('d'))));
-    $this->_processed = $this->maildir(implode(DIRECTORY_SEPARATOR, array('CiviMail.processed', date('Y'), date('m'), date('d'))));
+    $this->_ignored = $this->maildir(implode(DIRECTORY_SEPARATOR, array(
+          'CiviMail.ignored',
+          date('Y'),
+          date('m'),
+          date('d')
+        )));
+    $this->_processed = $this->maildir(implode(DIRECTORY_SEPARATOR, array(
+          'CiviMail.processed',
+          date('Y'),
+          date('m'),
+          date('d')
+        )));
   }
 
   /**
index f3d3487bbe3fbfa04f5a39a3c96ce099aecd7d20..fb2b56be5421ea708de95316fea7e245dde5bb9d 100644 (file)
@@ -67,17 +67,17 @@ class CRM_Mailing_Page_AJAX {
 
     $sortMapper = array(
       0 => 'subject',
-    1 => 'creator_name',
-    2 => '',
-    3 => 'start_date',
-    4 => '',
-    5 => 'links',
+      1 => 'creator_name',
+      2 => '',
+      3 => 'start_date',
+      4 => '',
+      5 => 'links',
     );
 
-    $sEcho     = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
-    $offset    = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
-    $rowCount  = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
-    $sort      = isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : NULL;
+    $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
+    $offset = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
+    $rowCount = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
+    $sort = isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : NULL;
     $sortOrder = isset($_REQUEST['sSortDir_0']) ? CRM_Utils_Type::escape($_REQUEST['sSortDir_0'], 'String') : 'asc';
 
     $params = $_POST;
@@ -96,8 +96,12 @@ class CRM_Mailing_Page_AJAX {
 
     $iFilteredTotal = $iTotal = $params['total'];
     $selectorElements = array(
-      'subject', 'mailing_creator', 'recipients',
-      'start_date', 'openstats', 'links',
+      'subject',
+      'mailing_creator',
+      'recipients',
+      'start_date',
+      'openstats',
+      'links',
     );
 
     echo CRM_Utils_JSON::encodeDataTableSelector($mailings, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
index be654cea04f07c4c7e1800acc5549b92e8512348..754db6949dc4cf866cf28bff0b915e283490cafe 100644 (file)
@@ -84,8 +84,8 @@ class CRM_Mailing_Page_Browse extends CRM_Core_Page {
    */
   public function preProcess() {
     $this->_unscheduled = $this->_archived = $archiveLinks = FALSE;
-    $this->_mailingId   = CRM_Utils_Request::retrieve('mid', 'Positive', $this);
-    $this->_sms         = CRM_Utils_Request::retrieve('sms', 'Positive', $this);
+    $this->_mailingId = CRM_Utils_Request::retrieve('mid', 'Positive', $this);
+    $this->_sms = CRM_Utils_Request::retrieve('sms', 'Positive', $this);
     $this->assign('sms', $this->_sms);
     // check that the user has permission to access mailing id
     CRM_Mailing_BAO_Mailing::checkPermission($this->_mailingId);
index 402e65f543808f248d683e5bc144bdb542837b69..419ada767c5ffa2ae260f49900fac8e416ba98ac 100644 (file)
@@ -40,9 +40,9 @@ class CRM_Mailing_Page_Common extends CRM_Core_Page {
    * @throws Exception
    */
   public function run() {
-    $job_id   = CRM_Utils_Request::retrieve('jid', 'Integer', CRM_Core_DAO::$_nullObject);
+    $job_id = CRM_Utils_Request::retrieve('jid', 'Integer', CRM_Core_DAO::$_nullObject);
     $queue_id = CRM_Utils_Request::retrieve('qid', 'Integer', CRM_Core_DAO::$_nullObject);
-    $hash     = CRM_Utils_Request::retrieve('h', 'String', CRM_Core_DAO::$_nullObject);
+    $hash = CRM_Utils_Request::retrieve('h', 'String', CRM_Core_DAO::$_nullObject);
 
     if (!$job_id ||
       !$queue_id ||
index ad97c254f9d2259b589f6db0cc74c45b4488faa7..4ba72c44717ed1e3280791e014b379cd33b25e3e 100644 (file)
@@ -40,9 +40,9 @@ class CRM_Mailing_Page_Confirm extends CRM_Core_Page {
   public function run() {
     CRM_Utils_System::addHTMLHead('<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">');
 
-    $contact_id   = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject);
+    $contact_id = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject);
     $subscribe_id = CRM_Utils_Request::retrieve('sid', 'Integer', CRM_Core_DAO::$_nullObject);
-    $hash         = CRM_Utils_Request::retrieve('h', 'String', CRM_Core_DAO::$_nullObject);
+    $hash = CRM_Utils_Request::retrieve('h', 'String', CRM_Core_DAO::$_nullObject);
 
     if (!$contact_id ||
       !$subscribe_id ||
index f379a1c84d9401efde50e805cbecdc2b62b9f54a..61d0fa7ba4674c8c915f0336e01d5c472c5c1f3d 100644 (file)
@@ -136,8 +136,8 @@ class CRM_Mailing_Page_Report extends CRM_Core_Page_Basic {
 
     $this->assign('report', $report);
     CRM_Utils_System::setTitle(ts('CiviMail Report: %1',
-        array(1 => $report['mailing']['name'])
-      ));
+      array(1 => $report['mailing']['name'])
+    ));
 
     return CRM_Core_Page::run();
   }
index 7cb8897e3e423723b74a7e28ac4f94b9555720c2..08ada120c10a3cb96f9b4b6943b6153fe3b678eb 100644 (file)
@@ -63,7 +63,7 @@ class CRM_Mailing_Page_Tab extends CRM_Contact_Page_View {
    */
   public function preProcess() {
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
-    $this->_id     = CRM_Utils_Request::retrieve('id', 'Positive', $this);
+    $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
 
     $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
     $displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId);
index e5feaaf686845c0ffbf7008d0a2a0c2059cdcb55..16f0455d42277cc685cffcea8cfcbfcfaa13e9a8 100644 (file)
@@ -156,7 +156,7 @@ class CRM_Mailing_Page_View extends CRM_Core_Page {
     }
     else {
       //get tokens that are not contact specific resolved
-      $params  = array('contact_id' => 0);
+      $params = array('contact_id' => 0);
       $details = CRM_Utils_Token::getAnonymousTokenDetails($params,
         $returnProperties,
         TRUE, TRUE, NULL,
index 2e254b45e87464aa710a811f16fcdd13f62d886a..1fcfba314e622d50819ac816e9e0d9153707987b 100644 (file)
@@ -190,23 +190,23 @@ class CRM_Mailing_PseudoConstant extends CRM_Core_PseudoConstant {
       $options = array(
         'bounce' => array(
           'N' => ts('Successful '),
-      'Y' => ts('Bounced '),
+          'Y' => ts('Bounced '),
         ),
         'delivered' => array(
           'Y' => ts('Successful '),
-      'N' => ts('Bounced '),
+          'N' => ts('Bounced '),
         ),
         'open' => array(
           'Y' => ts('Opened '),
-      'N' => ts('Unopened/Hidden '),
+          'N' => ts('Unopened/Hidden '),
         ),
         'click' => array(
           'Y' => ts('Clicked '),
-      'N' => ts('Not Clicked '),
+          'N' => ts('Not Clicked '),
         ),
         'reply' => array(
           'Y' => ts('Replied '),
-      'N' => ts('No Reply '),
+          'N' => ts('No Reply '),
         ),
       );
     }
index fd75d3329b76325c2f28fb0c7156ad0687701948..c5a9b3a707dd09175ce4a1a07898794bc966436a 100644 (file)
@@ -166,7 +166,7 @@ class CRM_Mailing_Selector_Browse extends CRM_Core_Selector_Base implements CRM_
 
       if (CRM_Campaign_BAO_Campaign::isCampaignEnable()) {
         self::$_columnHeaders[] = array(
-        'name' => ts('Campaign'),
+          'name' => ts('Campaign'),
           'sort' => 'campaign_id',
           'direction' => CRM_Utils_Sort::DONTCARE,
         );
@@ -188,8 +188,8 @@ class CRM_Mailing_Selector_Browse extends CRM_Core_Selector_Base implements CRM_
    *   Total number of rows
    */
   public function getTotalCount($action) {
-    $job        = CRM_Mailing_BAO_MailingJob::getTableName();
-    $mailing    = CRM_Mailing_BAO_Mailing::getTableName();
+    $job = CRM_Mailing_BAO_MailingJob::getTableName();
+    $mailing = CRM_Mailing_BAO_Mailing::getTableName();
     $mailingACL = CRM_Mailing_BAO_Mailing::mailingACL();
 
     //get the where clause.
@@ -228,8 +228,8 @@ LEFT JOIN  civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul
   public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) {
     static $actionLinks = NULL;
     if (empty($actionLinks)) {
-      $cancelExtra  = ts('Are you sure you want to cancel this mailing?');
-      $deleteExtra  = ts('Are you sure you want to delete this mailing?');
+      $cancelExtra = ts('Are you sure you want to cancel this mailing?');
+      $deleteExtra = ts('Are you sure you want to delete this mailing?');
       $archiveExtra = ts('Are you sure you want to archive this mailing?');
 
       $actionLinks = array(
@@ -361,7 +361,10 @@ LEFT JOIN  civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul
           }
         }
         if (in_array($row['status'], array(
-          'Scheduled', 'Running', 'Paused'))) {
+          'Scheduled',
+          'Running',
+          'Paused'
+        ))) {
           if ($allAccess ||
             ($showApprovalLinks && $showCreateLinks && $showScheduleLinks)
           ) {
@@ -378,7 +381,8 @@ LEFT JOIN  civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul
         }
 
         if (in_array($row['status'], array('Complete', 'Canceled')) &&
-          !$row['archived']) {
+          !$row['archived']
+        ) {
           if ($allAccess || $showCreateLinks) {
             $actionMask |= CRM_Core_Action::RENEW;
           }
@@ -447,7 +451,7 @@ LEFT JOIN  civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul
    */
   public function whereClause(&$params, $sortBy = TRUE) {
     $values = $clauses = array();
-    $isFormSubmitted   = $this->_parent->get('hidden_find_mailings');
+    $isFormSubmitted = $this->_parent->get('hidden_find_mailings');
 
     $title = $this->_parent->get('mailing_name');
     if ($title) {
@@ -482,7 +486,7 @@ LEFT JOIN  civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul
         $dateClause1[] = 'civicrm_mailing_job.start_date <= %3';
         $dateClause2[] = 'civicrm_mailing_job.scheduled_date <= %3';
       }
-      $params[3]     = array($to, 'String');
+      $params[3] = array($to, 'String');
     }
 
     $dateClauses = array();
@@ -505,8 +509,8 @@ LEFT JOIN  civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul
     }
 
     // get values submitted by form
-    $isDraft       = $this->_parent->get('status_unscheduled');
-    $isArchived    = $this->_parent->get('is_archived');
+    $isDraft = $this->_parent->get('status_unscheduled');
+    $isArchived = $this->_parent->get('is_archived');
     $mailingStatus = $this->_parent->get('mailing_status');
 
     if (!$isFormSubmitted && $this->_parent->get('scheduled')) {
index be68a4144659fe349218d137db9bc7c2bdee6ea8..e63925d0f63c6d643a5c94c1645c7561286c1cd8 100644 (file)
@@ -99,11 +99,11 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C
    * @access public
    */
   public function __construct($event, $distinct, $mailing, $job = NULL, $url = NULL) {
-    $this->_event_type  = $event;
+    $this->_event_type = $event;
     $this->_is_distinct = $distinct;
-    $this->_mailing_id  = $mailing;
-    $this->_job_id      = $job;
-    $this->_url_id      = $url;
+    $this->_mailing_id = $mailing;
+    $this->_job_id = $job;
+    $this->_url_id = $url;
   }
 
   /**
@@ -124,8 +124,8 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C
    */
   public function getPagerParams($action, &$params) {
     $params['csvString'] = NULL;
-    $params['rowCount']  = CRM_Utils_Pager::ROWCOUNT;
-    $params['status']    = ts('%1 %%StatusMessage%%', array(1 => $this->eventToTitle()));
+    $params['rowCount'] = CRM_Utils_Pager::ROWCOUNT;
+    $params['status'] = ts('%1 %%StatusMessage%%', array(1 => $this->eventToTitle()));
     $params['buttonTop'] = 'PagerTopButton';
     $params['buttonBottom'] = 'PagerBottomButton';
   }
@@ -212,27 +212,27 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C
           $dateSort = CRM_Mailing_Event_BAO_Unsubscribe::getTableName() . '.time_stamp';
           $this->_columnHeaders = array_merge($this->_columnHeaders, array(
             array(
-                'name' => ts('Unsubscribe'),
-              ),
-            ));
+              'name' => ts('Unsubscribe'),
+            ),
+          ));
           break;
 
         case 'optout':
           $dateSort = CRM_Mailing_Event_BAO_Unsubscribe::getTableName() . '.time_stamp';
           $this->_columnHeaders = array_merge($this->_columnHeaders, array(
             array(
-                'name' => ts('Opt-Out'),
-              ),
-            ));
+              'name' => ts('Opt-Out'),
+            ),
+          ));
           break;
 
         case 'click':
           $dateSort = CRM_Mailing_Event_BAO_TrackableURLOpen::getTableName() . '.time_stamp';
           $this->_columnHeaders = array_merge($this->_columnHeaders, array(
             array(
-                'name' => ts('URL'),
-              ),
-            ));
+              'name' => ts('URL'),
+            ),
+          ));
           break;
 
         default:
@@ -354,7 +354,7 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C
         return CRM_Mailing_Event_BAO_Queue::getRows($this->_mailing_id,
           $this->_job_id, $offset, $rowCount, $sort
         );
-      break;
+        break;
 
       case 'delivered':
         return CRM_Mailing_Event_BAO_Delivered::getRows($this->_mailing_id,
@@ -432,16 +432,16 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C
         'bounce' => ts('Bounces'),
         'forward' => ts('Forwards'),
         'reply' => $this->_is_distinct
-         ? ts('Unique Replies')
-         : ts('Replies'),
+          ? ts('Unique Replies')
+          : ts('Replies'),
         'unsubscribe' => ts('Unsubscribe Requests'),
         'optout' => ts('Opt-out Requests'),
         'click' => $this->_is_distinct
-         ? ts('Unique Click-throughs')
-         : ts('Click-throughs'),
+          ? ts('Unique Click-throughs')
+          : ts('Click-throughs'),
         'opened' => $this->_is_distinct
-         ? ts('Unique Tracked Opens')
-         : ts('Tracked Opens'),
+          ? ts('Unique Tracked Opens')
+          : ts('Tracked Opens'),
       );
     }
     return $events[$this->_event_type];
index d326e753c06e7a5a58761fd11012e07a4dc49877..14c6eb857439637600c0810bf3d4987a5ede7db3 100644 (file)
@@ -163,9 +163,9 @@ class CRM_Mailing_Selector_Search extends CRM_Core_Selector_Base implements CRM_
     // submitted form values
     $this->_queryParams = &$queryParams;
 
-    $this->_single      = $single;
-    $this->_limit       = $limit;
-    $this->_context     = $context;
+    $this->_single = $single;
+    $this->_limit = $limit;
+    $this->_context = $context;
     $this->_compContext = $compContext;
 
     $this->_mailingClause = $mailingClause;
@@ -199,24 +199,24 @@ class CRM_Mailing_Selector_Search extends CRM_Core_Selector_Base implements CRM_
       $searchContext = ($context) ? "&context=$context" : NULL;
 
       self::$_links = array(
-      CRM_Core_Action::VIEW => array(
-        'name' => ts('View'),
-        'url' => 'civicrm/contact/view',
-        'qs' => "reset=1&cid=%%cid%%{$searchContext}{$extraParams}",
-        'title' => ts('View Contact Details'),
-      ),
-      CRM_Core_Action::UPDATE => array(
-        'name' => ts('Edit'),
-        'url' => 'civicrm/contact/add',
-        'qs' => "reset=1&action=update&cid=%%cid%%{$searchContext}{$extraParams}",
-        'title' => ts('Edit Contact Details'),
-      ),
-      CRM_Core_Action::DELETE => array(
-        'name' => ts('Delete'),
-        'url' => 'civicrm/contact/view/delete',
-        'qs' => "reset=1&delete=1&cid=%%cid%%{$searchContext}{$extraParams}",
-        'title' => ts('Delete Contact'),
-      ),
+        CRM_Core_Action::VIEW => array(
+          'name' => ts('View'),
+          'url' => 'civicrm/contact/view',
+          'qs' => "reset=1&cid=%%cid%%{$searchContext}{$extraParams}",
+          'title' => ts('View Contact Details'),
+        ),
+        CRM_Core_Action::UPDATE => array(
+          'name' => ts('Edit'),
+          'url' => 'civicrm/contact/add',
+          'qs' => "reset=1&action=update&cid=%%cid%%{$searchContext}{$extraParams}",
+          'title' => ts('Edit Contact Details'),
+        ),
+        CRM_Core_Action::DELETE => array(
+          'name' => ts('Delete'),
+          'url' => 'civicrm/contact/view/delete',
+          'qs' => "reset=1&delete=1&cid=%%cid%%{$searchContext}{$extraParams}",
+          'title' => ts('Delete Contact'),
+        ),
       );
     }
     return self::$_links;
index 7e39c076a2cdb0f69508e53149f206a6b244c409..a5bff70466fb557b584f59e1a83eb28c868029ad 100644 (file)
@@ -346,9 +346,9 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership {
     //insert payment record for this membership
     if (!empty($params['relate_contribution_id'])) {
       CRM_Member_BAO_MembershipPayment::create(array(
-          'membership_id' => $membership->id,
-          'contribution_id' => $params['relate_contribution_id'],
-        ));
+        'membership_id' => $membership->id,
+        'contribution_id' => $params['relate_contribution_id'],
+      ));
     }
 
     // add activity record only during create mode and renew mode
@@ -761,12 +761,12 @@ INNER JOIN  civicrm_membership_type type ON ( type.id = membership.membership_ty
    */
   static function buildMembershipBlock(
     &$form,
-                                       $pageID,
-                                       $cid,
-                                       $formItems = FALSE,
-                                       $selectedMembershipTypeID = NULL,
-                                       $thankPage = FALSE,
-                                       $isTest = NULL
+    $pageID,
+    $cid,
+    $formItems = FALSE,
+    $selectedMembershipTypeID = NULL,
+    $thankPage = FALSE,
+    $isTest = NULL
   ) {
 
     $separateMembershipPayment = FALSE;
@@ -1326,8 +1326,8 @@ AND civicrm_membership.is_test = %2";
    */
   public static function postProcessMembership(
     $membershipParams, $contactID, &$form, $premiumParams,
-                                               $customFieldsFormatted = NULL, $includeFieldTypes = NULL, $membershipDetails, $membershipTypeIDs, $isPaidMembership, $membershipID,
-                                               $isProcessSeparateMembershipTransaction, $defaultContributionTypeID, $membershipLineItems, $isPayLater) {
+    $customFieldsFormatted = NULL, $includeFieldTypes = NULL, $membershipDetails, $membershipTypeIDs, $isPaidMembership, $membershipID,
+    $isProcessSeparateMembershipTransaction, $defaultContributionTypeID, $membershipLineItems, $isPayLater) {
     $result = $membershipContribution = NULL;
     $isTest = CRM_Utils_Array::value('is_test', $membershipParams, FALSE);
     $errors = $createdMemberships = array();
@@ -1458,9 +1458,9 @@ AND civicrm_membership.is_test = %2";
       if (!empty($membershipContribution->trxn_id)) {
         try {
           civicrm_api3('contribution', 'completetransaction', array(
-              'id' => $membershipContribution->id,
-              'trxn_id' => $membershipContribution->trxn_id,
-            ));
+            'id' => $membershipContribution->id,
+            'trxn_id' => $membershipContribution->trxn_id,
+          ));
         }
         catch (CiviCRM_API3_Exception $e) {
           // if for any reason it is already completed this will fail - e.g extensions hacking around core not completing transactions prior to CRM-15296
@@ -2296,9 +2296,9 @@ INNER JOIN  civicrm_contact contact ON ( contact.id = membership.contact_id AND
    */
   public static function linkMembershipPayment($membership, $membershipContribution) {
     CRM_Member_BAO_MembershipPayment::create(array(
-        'membership_id' => $membership->id,
-        'contribution_id' => $membershipContribution->id,
-      ));
+      'membership_id' => $membership->id,
+      'contribution_id' => $membershipContribution->id,
+    ));
   }
 
   /**
@@ -2872,9 +2872,9 @@ WHERE      civicrm_membership.is_test = 0";
     }
     $result['is_error'] = 0;
     $result['messages'] = ts('Processed %1 membership records. Updated %2 records.', array(
-        1 => $processCount,
-        2 => $updateCount,
-      ));
+      1 => $processCount,
+      2 => $updateCount,
+    ));
     return $result;
   }
 
@@ -3002,9 +3002,9 @@ WHERE      civicrm_membership.is_test = 0";
     //insert payment record for this membership
     if (empty($ids['contribution']) || !empty($params['is_recur'])) {
       CRM_Member_BAO_MembershipPayment::create(array(
-          'membership_id' => $membershipId,
-          'contribution_id' => $contribution->id,
-        ));
+        'membership_id' => $membershipId,
+        'contribution_id' => $contribution->id,
+      ));
     }
     return $contribution;
   }
index 1cd7d85002378d5b961376578fbbab99291d6c96..9fb5efc5d5c33702524d8788af6b37d2519013ed 100644 (file)
@@ -39,6 +39,7 @@ class CRM_Member_BAO_MembershipBlock extends CRM_Member_DAO_MembershipBlock {
   public function __construct() {
     parent::__construct();
   }
+
   /**
    * Add the membership Blocks
    *
index 10010872b7eebda570f0fa5f3dec331ccfcf4812..5236f414bd63d2a962d3f1d874199d3c55754123 100644 (file)
@@ -41,6 +41,7 @@ class CRM_Member_BAO_MembershipPayment extends CRM_Member_DAO_MembershipPayment
   public function __construct() {
     parent::__construct();
   }
+
   /**
    * Add the membership Payments
    *
@@ -67,13 +68,20 @@ class CRM_Member_BAO_MembershipPayment extends CRM_Member_DAO_MembershipPayment
     // table. However, at this stage we have both - there is still quite a bit of refactoring to do to set the line_iten entity_id right the first time
     // however, we can assume at this stage that any contribution id will have only one line item with that membership type in the line item table
     // 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'));
+    $membershipTypeID = civicrm_api3('membership', 'getvalue', array(
+        'id' => $dao->membership_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
       SET entity_table = 'civicrm_membership', entity_id = %1
       WHERE pv.membership_type_id = %2
       AND contribution_id = %3";
-    CRM_Core_DAO::executeQuery($sql, array(1 => array($dao->membership_id, 'Integer'), 2 => array($membershipTypeID, 'Integer'), 3 => array($dao->contribution_id, 'Integer')));
+    CRM_Core_DAO::executeQuery($sql, array(
+        1 => array($dao->membership_id, 'Integer'),
+        2 => array($membershipTypeID, 'Integer'),
+        3 => array($dao->contribution_id, 'Integer')
+      ));
     return $dao;
   }
 
index 7f1d6e6c5132cb9d614906b641c4acf661245c53..1bf4317e09ba9c9446d2b385dff888ab041880d3 100644 (file)
@@ -97,7 +97,7 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus {
   public static function create($params) {
     $ids = array();
     if (!empty($params['id'])) {
-      $ids['membershipStatus']  = $params['id'];
+      $ids['membershipStatus'] = $params['id'];
     }
     else {
       //don't allow duplicate names - if id not set
@@ -110,6 +110,7 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus {
     $membershipStatusBAO = CRM_Member_BAO_MembershipStatus::add($params, $ids);
     return $membershipStatusBAO;
   }
+
   /**
    * Add the membership types
    *
@@ -305,25 +306,25 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus {
               // add in months
               if ($membershipStatus->{$eve . '_event_adjust_unit'} == 'month') {
                 ${$eve . 'Event'} = date('Ymd', mktime($hour, $minute, $second,
-                    ${$dat . 'Month'} + $membershipStatus->{$eve . '_event_adjust_interval'},
-                    ${$dat . 'Day'},
-                    ${$dat . 'Year'}
+                  ${$dat . 'Month'} + $membershipStatus->{$eve . '_event_adjust_interval'},
+                  ${$dat . 'Day'},
+                  ${$dat . 'Year'}
                 ));
               }
               // add in days
               if ($membershipStatus->{$eve . '_event_adjust_unit'} == 'day') {
                 ${$eve . 'Event'} = date('Ymd', mktime($hour, $minute, $second,
-                    ${$dat . 'Month'},
-                    ${$dat . 'Day'} + $membershipStatus->{$eve . '_event_adjust_interval'},
-                    ${$dat . 'Year'}
+                  ${$dat . 'Month'},
+                  ${$dat . 'Day'} + $membershipStatus->{$eve . '_event_adjust_interval'},
+                  ${$dat . 'Year'}
                 ));
               }
               // add in years
               if ($membershipStatus->{$eve . '_event_adjust_unit'} == 'year') {
                 ${$eve . 'Event'} = date('Ymd', mktime($hour, $minute, $second,
-                    ${$dat . 'Month'},
-                    ${$dat . 'Day'},
-                    ${$dat . 'Year'} + $membershipStatus->{$eve . '_event_adjust_interval'}
+                  ${$dat . 'Month'},
+                  ${$dat . 'Day'},
+                  ${$dat . 'Year'} + $membershipStatus->{$eve . '_event_adjust_interval'}
                 ));
               }
               // if no interval and unit, present
index 3c96443ea137a8bff0797893ecaacfb5c92b645e..110a6e91d0a989355cda681eead098422714643b 100644 (file)
@@ -146,8 +146,8 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
    */
   public static function del($membershipTypeId) {
     //check dependencies
-    $check      = FALSE;
-    $status     = array();
+    $check = FALSE;
+    $status = array();
     $dependancy = array(
       'Membership' => 'membership_type_id',
       'MembershipBlock' => 'membership_type_default',
@@ -168,13 +168,20 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
       if (in_array('Membership', $status)) {
         $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));
+        $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
+            ));
         $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));
+        $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
+          ));
         throw new CRM_Core_Exception($message);
       }
     }
@@ -208,8 +215,8 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
       foreach ($periodDays as $pDay) {
         if (!empty($details[$pDay])) {
           if ($details[$pDay] > 31) {
-            $month    = substr($details[$pDay], 0, strlen($details[$pDay]) - 2);
-            $day      = substr($details[$pDay], -2);
+            $month = substr($details[$pDay], 0, strlen($details[$pDay]) - 2);
+            $day = substr($details[$pDay], -2);
             $monthMap = array(
               '1' => 'Jan',
               '2' => 'Feb',
@@ -304,7 +311,10 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
 
     // 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');
       }
@@ -368,10 +378,10 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
         //get the fixed end date here.
         $dateParts = explode('-', $actualStartDate);
         $fixedEndDate = date('Y-m-d', mktime(0, 0, 0,
-            $dateParts[1],
-            $dateParts[2] - 1,
-            $dateParts[0] + ($numRenewTerms * $membershipTypeDetails['duration_interval'])
-          ));
+          $dateParts[1],
+          $dateParts[2] - 1,
+          $dateParts[0] + ($numRenewTerms * $membershipTypeDetails['duration_interval'])
+        ));
 
         //make sure rollover window should be
         //subset of membership period window.
@@ -409,10 +419,10 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
     //calculate end date if it is not passed by user
     if (!$endDate) {
       //end date calculation
-      $date  = explode('-', $actualStartDate);
-      $year  = $date[0];
+      $date = explode('-', $actualStartDate);
+      $year = $date[0];
       $month = $date[1];
-      $day   = $date[2];
+      $day = $date[2];
 
       switch ($membershipTypeDetails['duration_unit']) {
         case 'year':
@@ -481,15 +491,15 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
    * @static
    */
   public static function getRenewalDatesForMembershipType($membershipId, $changeToday = NULL, $membershipTypeID = NULL, $numRenewTerms = 1) {
-    $params            = array('id' => $membershipId);
+    $params = array('id' => $membershipId);
     $membershipDetails = CRM_Member_BAO_Membership::getValues($params, $values);
-    $statusID          = $membershipDetails[$membershipId]->status_id;
+    $statusID = $membershipDetails[$membershipId]->status_id;
     $membershipDates = array(
       'join_date' => CRM_Utils_Date::customFormat($membershipDetails[$membershipId]->join_date, '%Y%m%d'),
     );
 
     $oldPeriodType = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType',
-        CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', $membershipId, 'membership_type_id'), 'period_type');
+      CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', $membershipId, 'membership_type_id'), 'period_type');
 
     // CRM-7297 Membership Upsell
     if (is_null($membershipTypeID)) {
@@ -510,17 +520,17 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
       else {
         $date = $membershipDetails[$membershipId]->end_date;
       }
-      $date  = explode('-', $date);
+      $date = explode('-', $date);
       $logStartDate = date('Y-m-d', mktime(0, 0, 0,
-          (double) $date[1],
-          (double) ($date[2] + 1),
-          (double) $date[0]
-        ));
+        (double) $date[1],
+        (double) ($date[2] + 1),
+        (double) $date[0]
+      ));
 
-      $date  = explode('-', $logStartDate);
-      $year  = $date[0];
+      $date = explode('-', $logStartDate);
+      $year = $date[0];
       $month = $date[1];
-      $day   = $date[2];
+      $day = $date[2];
 
       switch ($membershipTypeDetails['duration_unit']) {
         case 'year':
@@ -548,10 +558,10 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
       }
       else {
         $endDate = date('Y-m-d', mktime(0, 0, 0,
-            $month,
-            $day - 1,
-            $year
-          ));
+          $month,
+          $day - 1,
+          $year
+        ));
       }
       $today = date('Y-m-d');
       $membershipDates['today'] = CRM_Utils_Date::customFormat($today, '%Y%m%d');
@@ -689,8 +699,8 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
     else {
       $fieldName = $previousID;
     }
-    $fieldLabel  = 'Membership Amount';
-    $optionsIds  = NULL;
+    $fieldLabel = 'Membership Amount';
+    $optionsIds = NULL;
     $fieldParams = array(
       'price_set_id ' => $priceSetId,
       'name' => $fieldName,
@@ -727,9 +737,9 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
       $results = array();
       CRM_Price_BAO_PriceFieldValue::retrieve($fieldValueParams, $results);
       if (!empty($results)) {
-        $results['label']  = $results['name'] = $params['name'];
+        $results['label'] = $results['name'] = $params['name'];
         $results['amount'] = empty($params['minimum_fee']) ? 0 : $params['minimum_fee'];
-        $optionsIds['id']  = $results['id'];
+        $optionsIds['id'] = $results['id'];
       }
       else {
         $results = array(
index 8321122e7ed70d8360e74a04fb182c3e4f1b47c9..3864a5d6d2353db90b312693a1aff087bcd746a9 100644 (file)
@@ -32,4 +32,5 @@
  * $Id$
  *
  */
-class CRM_Member_Config extends CRM_Core_Component_Config {}
+class CRM_Member_Config extends CRM_Core_Component_Config {
+}
index 55a03716cadb14200d366a6248534df6c08e217f..e349a8edea6bf445711b5d8e318c2b5d42d7499a 100644 (file)
@@ -206,15 +206,15 @@ class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment {
     }
 
     list($this->_memberDisplayName,
-         $this->_memberEmail
-    ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contactID);
+      $this->_memberEmail
+      ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contactID);
 
     //CRM-10375 Where the payer differs to the member the payer should get the email.
     // here we store details in order to do that
     if (!empty($formValues['soft_credit_contact_id'])) {
       $this->_receiptContactId = $this->_contributorContactID = $formValues['soft_credit_contact_id'];
       list($this->_contributorDisplayName,
-         $this->_contributorEmail) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contributorContactID);
+        $this->_contributorEmail) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contributorContactID);
     }
     else {
       $this->_receiptContactId = $this->_contributorContactID = $this->_contactID;
index 8575c6cac0db21662e6cfe0d2bebdbc69fae34ff..88706734c78e8d93e517e0f37dd4cf06fceb3dbc 100644 (file)
@@ -457,7 +457,10 @@ class CRM_Member_Form_Membership extends CRM_Member_Form {
     }
 
     if ($this->_context == 'standalone') {
-      $this->addEntityRef('contact_id', ts('Contact'), array('create' => TRUE, 'api' => array('extra' => array('email'))), TRUE);
+      $this->addEntityRef('contact_id', ts('Contact'), array(
+          'create' => TRUE,
+          'api' => array('extra' => array('email'))
+        ), TRUE);
     }
 
     $selOrgMemType[0][0] = $selMemTypeOrg[0] = ts('- select -');
@@ -561,7 +564,7 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
           }
           $memTypeJs = array(
             'onChange' =>
-            "CRM.buildCustomData( 'Membership', this.value ); buildAutoRenew(this.value, null );",
+              "CRM.buildCustomData( 'Membership', this.value ); buildAutoRenew(this.value, null );",
           );
         }
       }
@@ -580,7 +583,7 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
       CRM_Core_DAO::getAttribute('CRM_Member_DAO_Membership', 'max_related')
     );
 
-    $sel = & $this->addElement('hierselect',
+    $sel = &$this->addElement('hierselect',
       'membership_type_id',
       ts('Membership Organization and Type'),
       $memTypeJs
@@ -889,7 +892,7 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
             }
             if (empty($params['status_id']) || in_array($params['status_id'], $status_ids) == FALSE) {
               $errors['status_id'] = ts('Please enter a status that does NOT represent a current membership status.');
-              $errors['is_override']  = ts('This must be checked because you set an End Date for a lifetime membership');
+              $errors['is_override'] = ts('This must be checked because you set an End Date for a lifetime membership');
             }
           }
           else {
@@ -948,7 +951,8 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
     }
 
     if (isset($params['is_override']) &&
-      $params['is_override'] && empty($params['status_id'])) {
+      $params['is_override'] && empty($params['status_id'])
+    ) {
       $errors['status_id'] = ts('Please enter the status.');
     }
 
@@ -1202,7 +1206,10 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
 
       if (!$this->_onlinePendingContributionId) {
         if (empty($formValues['source'])) {
-          $params['contribution_source'] = ts('%1 Membership: Offline signup (by %2)', array(1 => $membershipType, 2 => $userName));
+          $params['contribution_source'] = ts('%1 Membership: Offline signup (by %2)', array(
+              1 => $membershipType,
+              2 => $userName
+            ));
         }
         else {
           $params['contribution_source'] = $formValues['source'];
index a522f76b75ae200020e6a03461a8cf8102d1ed7e..7505d76a60e52015164c9d0abf6c64877583bd71 100644 (file)
@@ -79,7 +79,11 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa
       $this->_memPriceSetId = $priceSetId;
       $pFIDs = array();
       if ($priceSetId) {
-        CRM_Core_DAO::commonRetrieveAll('CRM_Price_DAO_PriceField', 'price_set_id', $priceSetId, $pFIDs, $return = array('html_type', 'name', 'label'));
+        CRM_Core_DAO::commonRetrieveAll('CRM_Price_DAO_PriceField', 'price_set_id', $priceSetId, $pFIDs, $return = array(
+            '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'];
@@ -147,7 +151,7 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa
         $membershipDefault[] = $this->createElement('radio', NULL, NULL, NULL, $k);
         $membershipRequired[$k] = NULL;
         if ($isRecur) {
-          $autoRenew        = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $k, 'auto_renew');
+          $autoRenew = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $k, 'auto_renew');
           $membershipRequired[$k] = $autoRenew;
           $autoRenewOptions = array();
           if ($autoRenew) {
@@ -174,7 +178,8 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa
         $this->assign('auto_renew', $this->_renewOption);
       }
       $this->addGroup($membership, 'membership_type', ts('Membership Types'));
-      $this->addGroup($membershipDefault, 'membership_type_default', ts('Membership Types Default'))->setAttribute('allowClear', TRUE);
+      $this->addGroup($membershipDefault, 'membership_type_default', ts('Membership Types Default'))
+        ->setAttribute('allowClear', TRUE);
 
       $this->addFormRule(array('CRM_Member_Form_MembershipBlock', 'formRule'), $this->_id);
     }
@@ -232,8 +237,8 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa
       //if both auto-renew and non-auto-renew memberships
       if ($bothTypes) {
         $paymentProcessorIds = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage',
-            $contributionPageId, 'payment_processor'
-            );
+          $contributionPageId, 'payment_processor'
+        );
 
         $paymentProcessorId = explode(CRM_Core_DAO::VALUE_SEPARATOR, $paymentProcessorIds);
 
@@ -243,10 +248,11 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa
             if ($pid) {
               $paymentProcessorTypeId = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessor',
                 $pid, 'payment_processor_type_id'
-                );
+              );
             }
             if (!($paymentProcessorTypeId == CRM_Utils_Array::key('PayPal', $paymentProcessorType) ||
-              ($paymentProcessorTypeId == CRM_Utils_Array::key('AuthNet', $paymentProcessorType)))) {
+              ($paymentProcessorTypeId == CRM_Utils_Array::key('AuthNet', $paymentProcessorType)))
+            ) {
               $errors['member_price_set_id'] = ts('The membership price set associated with this online contribution allows a user to select BOTH an auto-renew AND a non-auto-renew membership. This requires submitting multiple processor transactions, and is not supported for one or more of the payment processors enabled under the Amounts tab.');
             }
 
@@ -267,7 +273,8 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa
       }
 
       if ($contributionPageId && !empty($params['member_price_set_id']) &&
-        CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $contributionPageId, 'amount_block_is_active')) {
+        CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $contributionPageId, 'amount_block_is_active')
+      ) {
         $errors['member_price_set_id'] = ts('You cannot use Membership Price Sets with the Contribution Amounts section. However, a membership price set may include additional fields for non-membership options that requires an additional fee (e.g. magazine subscription) or an additional voluntary contribution.');
       }
 
@@ -327,9 +334,9 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa
     $deletePriceSet = 0;
     if ($params['membership_type']) {
       // we do this in case the user has hit the forward/back button
-      $dao               = new CRM_Member_DAO_MembershipBlock();
+      $dao = new CRM_Member_DAO_MembershipBlock();
       $dao->entity_table = 'civicrm_contribution_page';
-      $dao->entity_id    = $this->_id;
+      $dao->entity_id = $this->_id;
       $dao->find(TRUE);
       $membershipID = $dao->id;
       if ($membershipID) {
@@ -415,11 +422,11 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa
             unset($options[$priceFieldID]);
           }
           $membetype = CRM_Member_BAO_MembershipType::getMembershipTypeDetails($memType);
-          $fieldParams['option_label'][$rowCount]       = CRM_Utils_Array::value('name', $membetype);
-          $fieldParams['option_amount'][$rowCount]      = CRM_Utils_Array::value('minimum_fee', $membetype, 0);
-          $fieldParams['option_weight'][$rowCount]      = CRM_Utils_Array::value('weight', $membetype);
+          $fieldParams['option_label'][$rowCount] = CRM_Utils_Array::value('name', $membetype);
+          $fieldParams['option_amount'][$rowCount] = CRM_Utils_Array::value('minimum_fee', $membetype, 0);
+          $fieldParams['option_weight'][$rowCount] = CRM_Utils_Array::value('weight', $membetype);
           $fieldParams['option_description'][$rowCount] = CRM_Utils_Array::value('description', $membetype);
-          $fieldParams['default_option']                = CRM_Utils_Array::value('membership_type_default', $params);
+          $fieldParams['default_option'] = CRM_Utils_Array::value('membership_type_default', $params);
           $fieldParams['option_financial_type_id'][$rowCount] = CRM_Utils_Array::value('financial_type_id', $membetype);
 
           $fieldParams['membership_type_id'][$rowCount] = $memType;
@@ -441,9 +448,9 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa
       if ($priceSetID) {
         $params['membership_types'] = 'null';
         $params['membership_type_default'] = CRM_Utils_Array::value('membership_type_default', $params, 'null');
-        $params['membership_types']        = serialize($membershipTypes);
-        $params['display_min_fee']         = CRM_Utils_Array::value('display_min_fee', $params, FALSE);
-        $params['is_separate_payment']     = CRM_Utils_Array::value('is_separate_payment', $params, FALSE);
+        $params['membership_types'] = serialize($membershipTypes);
+        $params['display_min_fee'] = CRM_Utils_Array::value('display_min_fee', $params, FALSE);
+        $params['is_separate_payment'] = CRM_Utils_Array::value('is_separate_payment', $params, FALSE);
       }
       $params['entity_table'] = 'civicrm_contribution_page';
       $params['entity_id'] = $this->_id;
index bd3b739d47450cb79760dc1c7fa6fbe7c1e16192..aa12c2d5b6cd3b776f587771c55fb6d574ef5a08 100644 (file)
@@ -98,9 +98,9 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form {
     }
 
     $this->assign('endDate', CRM_Utils_Date::customFormat(CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership',
-          $this->_id, 'end_date'
-        )
-      ));
+        $this->_id, 'end_date'
+      )
+    ));
     $this->assign('membershipStatus',
       CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipStatus',
         CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership',
@@ -116,8 +116,8 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form {
         $statusMsg = ts('Membership Renewal using a credit card requires a Membership fee. Since there is no fee associated with the selected membership type, you can use the normal renewal mode.');
         CRM_Core_Session::setStatus($statusMsg, '', 'info');
         CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contact/view/membership',
-            "reset=1&action=renew&cid={$this->_contactID}&id={$this->_id}&context=membership"
-          ));
+          "reset=1&action=renew&cid={$this->_contactID}&id={$this->_id}&context=membership"
+        ));
       }
     }
 
@@ -145,7 +145,7 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form {
       return CRM_Custom_Form_CustomData::setDefaultValues($this);
     }
 
-    $defaults       = parent::setDefaultValues();
+    $defaults = parent::setDefaultValues();
     $this->_memType = $defaults['membership_type_id'];
 
     // set renewal_date and receive_date to today in correct input format (setDateDefaults uses today if no value passed)
@@ -183,9 +183,9 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form {
     }
 
     $defaults['total_amount'] = CRM_Utils_Money::format(CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType',
-        $this->_memType,
-        'minimum_fee'
-      ), NULL, '%a');
+      $this->_memType,
+      'minimum_fee'
+    ), NULL, '%a');
 
     $defaults['record_contribution'] = 0;
     $defaults['num_terms'] = 1;
@@ -209,8 +209,13 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form {
       }
 
       $names = array(
-        'first_name', 'middle_name', 'last_name', "street_address-{$this->_bltID}",
-        "city-{$this->_bltID}", "postal_code-{$this->_bltID}", "country_id-{$this->_bltID}",
+        'first_name',
+        'middle_name',
+        'last_name',
+        "street_address-{$this->_bltID}",
+        "city-{$this->_bltID}",
+        "postal_code-{$this->_bltID}",
+        "country_id-{$this->_bltID}",
         "state_province_id-{$this->_bltID}",
       );
       foreach ($names as $name) {
@@ -253,7 +258,7 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form {
 
     parent::buildQuickForm();
 
-    $defaults       = parent::setDefaultValues();
+    $defaults = parent::setDefaultValues();
     $this->_memType = $defaults['membership_type_id'];
     $this->assign('customDataType', 'Membership');
     $this->assign('customDataSubType', $this->_memType);
@@ -293,7 +298,7 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form {
         // membership type is selected.
         $allMembershipInfo[$key] = array(
           'financial_type_id' => CRM_Utils_Array::value('financial_type_id', $values),
-          'total_amount'         => CRM_Utils_Money::format($values['minimum_fee'], NULL, '%a'),
+          'total_amount' => CRM_Utils_Money::format($values['minimum_fee'], NULL, '%a'),
           'total_amount_numeric' => CRM_Utils_Array::value('minimum_fee', $values),
         );
 
@@ -344,7 +349,11 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
           while ($recurMembershipTypes->fetch()) {
             $autoRenew[$recurMembershipTypes->id] = $recurMembershipTypes->auto_renew;
             foreach (array(
-              'id', 'auto_renew', 'duration_unit', 'duration_interval') as $fld) {
+                       'id',
+                       'auto_renew',
+                       'duration_unit',
+                       'duration_interval'
+                     ) as $fld) {
               $this->_recurMembershipTypes[$recurMembershipTypes->id][$fld] = $recurMembershipTypes->$fld;
             }
           }
@@ -423,7 +432,7 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
     // Retrieve the name and email of the contact - this will be the TO for receipt email
     list($this->_contributorDisplayName,
       $this->_contributorEmail
-    ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contactID);
+      ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contactID);
     $this->assign('email', $this->_contributorEmail);
 
     $mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
@@ -520,8 +529,8 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
 
     if ($this->_mode) {
       $formValues['total_amount'] = CRM_Utils_Array::value('total_amount', $this->_params, CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType',
-          $this->_memType, 'minimum_fee'
-        ));
+        $this->_memType, 'minimum_fee'
+      ));
       if (empty($formValues['financial_type_id'])) {
         $formValues['financial_type_id'] = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $this->_memType, 'financial_type_id');
       }
@@ -601,8 +610,8 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
       if (is_a($result, 'CRM_Core_Error')) {
         CRM_Core_Error::displaySessionError($result);
         CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contact/view/membership',
-            "reset=1&action=renew&cid={$this->_contactID}&id={$this->_id}&context=membership&mode={$this->_mode}"
-          ));
+          "reset=1&action=renew&cid={$this->_contactID}&id={$this->_id}&context=membership&mode={$this->_mode}"
+        ));
       }
 
       if ($result) {
@@ -758,8 +767,8 @@ WHERE   id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )';
       $this->assign('mem_start_date', CRM_Utils_Date::customFormat($renewMembership->start_date));
       $this->assign('mem_end_date', CRM_Utils_Date::customFormat($renewMembership->end_date));
       $this->assign('membership_name', CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType',
-          $renewMembership->membership_type_id
-        ));
+        $renewMembership->membership_type_id
+      ));
       $this->assign('customValues', $customValues);
       if ($this->_mode) {
         if (!empty($this->_params['billing_first_name'])) {
index bfd765a652dea601ea37df6ad1f2ad0f994fb08d..e8768891f0643dc2b447d87ae4f1d7e1027a5081 100644 (file)
@@ -115,7 +115,7 @@ class CRM_Member_Form_MembershipStatus extends CRM_Member_Form_MembershipConfig
       try {
         CRM_Member_BAO_MembershipStatus::del($this->_id);
       }
-      catch(CRM_Core_Exception $e) {
+      catch (CRM_Core_Exception $e) {
         CRM_Core_Error::statusBounce($e->getMessage(), NULL, ts('Delete Failed'));
       }
       CRM_Core_Session::setStatus(ts('Selected membership status has been deleted.'), ts('Record Deleted'), 'success');
@@ -141,8 +141,8 @@ class CRM_Member_Form_MembershipStatus extends CRM_Member_Form_MembershipConfig
 
       $membershipStatus = CRM_Member_BAO_MembershipStatus::add($params, $ids);
       CRM_Core_Session::setStatus(ts('The membership status \'%1\' has been saved.',
-          array(1 => $membershipStatus->label)
-        ), ts('Saved'), 'success');
+        array(1 => $membershipStatus->label)
+      ), ts('Saved'), 'success');
     }
   }
 }
index 13dee0da3ee91061226c220ae08465e19f1d0704..9b686c6c96c9d80fba81212d3069c721abc5f0ac 100644 (file)
@@ -88,11 +88,11 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form_MembershipConfig {
     $periods = array('fixed_period_start_day', 'fixed_period_rollover_day');
     foreach ($periods as $per) {
       if (isset($defaults[$per])) {
-        $date            = $defaults[$per];
+        $date = $defaults[$per];
 
         $defaults[$per] = array();
         if ($date > 31) {
-          $date                = ($date < 999) ? '0' . $date : $date;
+          $date = ($date < 999) ? '0' . $date : $date;
           $defaults[$per]['M'] = substr($date, 0, 2);
           $defaults[$per]['d'] = substr($date, 2, 3);
         }
@@ -150,9 +150,9 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form_MembershipConfig {
     );
 
     //Auto-renew Option
-    $paymentProcessor  = CRM_Core_PseudoConstant::paymentProcessor(FALSE, FALSE, 'is_recur = 1');
-    $isAuthorize       = FALSE;
-    $options           = array();
+    $paymentProcessor = CRM_Core_PseudoConstant::paymentProcessor(FALSE, FALSE, 'is_recur = 1');
+    $isAuthorize = FALSE;
+    $options = array();
     if (is_array($paymentProcessor) && !empty($paymentProcessor)) {
       $isAuthorize = TRUE;
       $options = CRM_Core_SelectValues::memberAutoRenew();
@@ -201,7 +201,7 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form_MembershipConfig {
     $this->assign('membershipRecordsExists', $membershipRecords);
 
     $this->add('text', 'max_related', ts('Max related'),
-        CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipType', 'max_related')
+      CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipType', 'max_related')
     );
 
     $this->addFormRule(array('CRM_Member_Form_MembershipType', 'formRule'));
@@ -234,7 +234,9 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form_MembershipConfig {
     }
 
     if (in_array(CRM_Utils_Array::value('auto_renew', $params), array(
-      1, 2))) {
+      1,
+      2
+    ))) {
       if (($params['duration_interval'] > 1 && $params['duration_unit'] == 'year') ||
         ($params['duration_interval'] > 12 && $params['duration_unit'] == 'month')
       ) {
@@ -295,9 +297,9 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form_MembershipConfig {
   public function postProcess() {
     if ($this->_action & CRM_Core_Action::DELETE) {
       try {
-      CRM_Member_BAO_MembershipType::del($this->_id);
+        CRM_Member_BAO_MembershipType::del($this->_id);
       }
-      catch(CRM_Core_Exception $e) {
+      catch (CRM_Core_Exception $e) {
         CRM_Core_Error::statusBounce($e->getMessage(), NULL, ts('Membership Type Not Deleted'));
       }
       CRM_Core_Session::setStatus(ts('Selected membership type has been deleted.'), ts('Record Deleted'), 'success');
@@ -368,13 +370,13 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form_MembershipConfig {
       $periods = array('fixed_period_start_day', 'fixed_period_rollover_day');
       foreach ($periods as $per) {
         if (!empty($params[$per]['M']) && !empty($params[$per]['d'])) {
-          $mon          = $params[$per]['M'];
-          $dat          = $params[$per]['d'];
-          $mon          = ($mon < 10) ? '0' . $mon : $mon;
-          $dat          = ($dat < 10) ? '0' . $dat : $dat;
+          $mon = $params[$per]['M'];
+          $dat = $params[$per]['d'];
+          $mon = ($mon < 10) ? '0' . $mon : $mon;
+          $dat = ($dat < 10) ? '0' . $dat : $dat;
           $params[$per] = $mon . $dat;
         }
-        elseif($per == 'fixed_period_rollover_day' && !empty($params['month_fixed_period_rollover_day'])) {
+        elseif ($per == 'fixed_period_rollover_day' && !empty($params['month_fixed_period_rollover_day'])) {
           $params['fixed_period_rollover_day'] = $params['month_fixed_period_rollover_day']['d'];
           unset($params['month_fixed_period_rollover_day']);
         }
@@ -400,8 +402,8 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form_MembershipConfig {
       $membershipType = CRM_Member_BAO_MembershipType::add($params, $ids);
 
       CRM_Core_Session::setStatus(ts('The membership type \'%1\' has been saved.',
-          array(1 => $membershipType->name)
-        ), ts('Saved'), 'success');
+        array(1 => $membershipType->name)
+      ), ts('Saved'), 'success');
       $session = CRM_Core_Session::singleton();
       if ($buttonName == $this->getButtonName('upload', 'new')) {
         $session->replaceUserContext(
index 6effb09b56545b177b4184b732f88bf7bd4d5f43..3f015eb9e9b892c49586bef18152668a95152c9a 100644 (file)
@@ -93,9 +93,9 @@ class CRM_Member_Form_Search extends CRM_Core_Form_Search {
          * driven by the wizard framework
          */
 
-    $this->_reset   = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
-    $this->_force   = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE);
-    $this->_limit   = CRM_Utils_Request::retrieve('limit', 'Positive', $this);
+    $this->_reset = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
+    $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE);
+    $this->_limit = CRM_Utils_Request::retrieve('limit', 'Positive', $this);
     $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'search');
 
     $this->assign("context", $this->_context);
index 61f061a91edeffbb9405ee1941446a7bfb10b2be..b8fc2adc969fa40f7b1159e6645f47c4f791ab2a 100644 (file)
@@ -109,7 +109,7 @@ class CRM_Member_Form_Task extends CRM_Core_Form {
     else {
       $queryParams = $form->get('queryParams');
       $sortOrder = NULL;
-      if ($form->get(CRM_Utils_Sort::SORT_ORDER )) {
+      if ($form->get(CRM_Utils_Sort::SORT_ORDER)) {
         $sortOrder = $form->get(CRM_Utils_Sort::SORT_ORDER);
       }
       $query = new CRM_Contact_BAO_Query($queryParams, NULL, NULL, FALSE, FALSE,
@@ -146,8 +146,8 @@ class CRM_Member_Form_Task extends CRM_Core_Form {
     }
     else {
       $session->replaceUserContext(CRM_Utils_System::url("civicrm/contact/search/$searchFormName",
-          $urlParams
-        ));
+        $urlParams
+      ));
     }
   }
 
index ce1a96102ad284548f14b2b7f1650ad9082e8b2c..3307a7366e61a8999fb0e09f887c2428419ba73e 100644 (file)
@@ -216,7 +216,7 @@ class CRM_Member_Form_Task_Batch extends CRM_Member_Form_Task {
       'join_date',
       'membership_start_date',
       'membership_end_date',
-     );
+    );
     if (isset($params['field'])) {
       $customFields = array();
       foreach ($params['field'] as $key => $value) {
index dbc422669c265076696dca4d27aae482906ebb76..507a90f12231f18e1b993ee8b929c213ee8cb2ec 100644 (file)
@@ -86,7 +86,7 @@ class CRM_Member_Form_Task_Label extends CRM_Member_Form_Task {
    * @return void
    */
   public function postProcess() {
-    $formValues  = $this->controller->exportValues($this->_name);
+    $formValues = $this->controller->exportValues($this->_name);
     $locationTypeID = $formValues['location_type_id'];
     $respectDoNotMail = CRM_Utils_Array::value('do_not_mail', $formValues);
     $labelName = $formValues['label_name'];
@@ -115,7 +115,7 @@ class CRM_Member_Form_Task_Label extends CRM_Member_Form_Task {
     // format the addresses according to CIVICRM_ADDRESS_FORMAT (CRM-1327)
     foreach ($rows as $id => $row) {
       if ($commMethods = CRM_Utils_Array::value('preferred_communication_method', $row)) {
-        $val  = array_filter(explode(CRM_Core_DAO::VALUE_SEPARATOR, $commMethods));
+        $val = array_filter(explode(CRM_Core_DAO::VALUE_SEPARATOR, $commMethods));
         $comm = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'preferred_communication_method');
         $temp = array();
         foreach ($val as $vals) {
@@ -130,7 +130,10 @@ class CRM_Member_Form_Task_Label extends CRM_Member_Form_Task {
 
     if ($isPerMembership) {
       $labelRows = array();
-      $memberships = civicrm_api3('membership', 'get', array('id' => array('IN' => $this->_memberIds), 'return' => 'contact_id'));
+      $memberships = civicrm_api3('membership', 'get', array(
+          'id' => array('IN' => $this->_memberIds),
+          'return' => 'contact_id'
+        ));
       foreach ($memberships['values'] as $id => $membership) {
         $labelRows[$id] = $rows[$membership['contact_id']];
       }
index 5286f67049a2186d37b970c8ab08746e60292d58..f2226da97bcb42ae1b563139b667be01a4996fa4 100644 (file)
@@ -71,7 +71,10 @@ class CRM_Member_Form_Task_PickProfile extends CRM_Member_Form_Task {
     $validate = FALSE;
     //validations
     if (count($this->_memberIds) > $this->_maxMembers) {
-      CRM_Core_Session::setStatus(ts("The maximum number of members you can select for Batch Update is %1. You have selected %2. Please select fewer members from your search results and try again.", array(1 => $this->_maxMembers, 2 => count($this->_memberIds))), ts('Batch Update Error'), 'error');
+      CRM_Core_Session::setStatus(ts("The maximum number of members you can select for Batch Update is %1. You have selected %2. Please select fewer members from your search results and try again.", array(
+            1 => $this->_maxMembers,
+            2 => count($this->_memberIds)
+          )), ts('Batch Update Error'), 'error');
       $validate = TRUE;
     }
 
@@ -98,7 +101,8 @@ class CRM_Member_Form_Task_PickProfile extends CRM_Member_Form_Task {
 
     $ufGroupElement = $this->add('select', 'uf_group_id', ts('Select Profile'),
       array(
-        '' => ts('- select profile -')) + $profiles, TRUE
+        '' => ts('- select profile -')
+      ) + $profiles, TRUE
     );
     $this->addDefaultButtons(ts('Continue'));
   }
index 39a7a32b220c163687f027b20a550cdd20e4a70b..4890c03eb6e5b23bd989a9b5607f089c74aab82b 100644 (file)
@@ -66,7 +66,10 @@ class CRM_Member_Import_Form_DataSource extends CRM_Core_Form {
 
     $this->add('File', 'uploadFile', ts('Import Data File'), 'size=30 maxlength=255', TRUE);
     $this->setMaxFileSize($uploadFileSize);
-    $this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(1 => $uploadSize, 2 => $uploadFileSize)), 'maxfilesize', $uploadFileSize);
+    $this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(
+          1 => $uploadSize,
+          2 => $uploadFileSize
+        )), 'maxfilesize', $uploadFileSize);
     $this->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile');
     $this->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File');
 
@@ -85,13 +88,13 @@ class CRM_Member_Import_Form_DataSource extends CRM_Core_Form {
     );
     $this->setDefaults(array(
       'onDuplicate' => CRM_Import_Parser::DUPLICATE_SKIP,
-      ));
+    ));
 
     //get the saved mapping details
     $mappingArray = CRM_Core_BAO_Mapping::getMappings(CRM_Core_OptionGroup::getValue('mapping_type',
-        'Import Membership',
-        'name'
-      ));
+      'Import Membership',
+      'name'
+    ));
     $this->assign('savedMapping', $mappingArray);
     $this->add('select', 'savedMapping', ts('Mapping Option'), array('' => ts('- select -')) + $mappingArray);
 
@@ -124,7 +127,7 @@ class CRM_Member_Import_Form_DataSource extends CRM_Core_Form {
 
     $this->setDefaults(array(
       'contactType' => CRM_Import_Parser::CONTACT_INDIVIDUAL,
-      ));
+    ));
 
     //build date formats
     CRM_Core_Form_Date::buildAllowedDateFormats($this);
@@ -152,12 +155,12 @@ class CRM_Member_Import_Form_DataSource extends CRM_Core_Form {
   public function postProcess() {
     $this->controller->resetPage('MapField');
 
-    $fileName         = $this->controller->exportValue($this->_name, 'uploadFile');
+    $fileName = $this->controller->exportValue($this->_name, 'uploadFile');
     $skipColumnHeader = $this->controller->exportValue($this->_name, 'skipColumnHeader');
-    $onDuplicate      = $this->controller->exportValue($this->_name, 'onDuplicate');
-    $contactType      = $this->controller->exportValue($this->_name, 'contactType');
-    $dateFormats      = $this->controller->exportValue($this->_name, 'dateFormats');
-    $savedMapping     = $this->controller->exportValue($this->_name, 'savedMapping');
+    $onDuplicate = $this->controller->exportValue($this->_name, 'onDuplicate');
+    $contactType = $this->controller->exportValue($this->_name, 'contactType');
+    $dateFormats = $this->controller->exportValue($this->_name, 'dateFormats');
+    $savedMapping = $this->controller->exportValue($this->_name, 'savedMapping');
 
     $this->set('onDuplicate', $onDuplicate);
     $this->set('contactType', $contactType);
index 6696cd199c3e584e430254215facc133536ace5e..4b97ca494e0cc3d531359eb9e6296ca83c226e09 100644 (file)
@@ -39,7 +39,6 @@
 class CRM_Member_Import_Form_MapField extends CRM_Import_Form_MapField {
 
 
-
   /**
    * store contactType
    *
@@ -92,7 +91,13 @@ class CRM_Member_Import_Form_MapField extends CRM_Import_Form_MapField {
     }
     elseif ($this->_onDuplicate == CRM_Import_Parser::DUPLICATE_SKIP) {
       unset($this->_mapperFields['membership_id']);
-      $highlightedFieldsArray = array('membership_contact_id', 'email', 'external_identifier', 'membership_start_date', 'membership_type_id');
+      $highlightedFieldsArray = array(
+        'membership_contact_id',
+        'email',
+        'external_identifier',
+        'membership_start_date',
+        'membership_type_id'
+      );
       foreach ($highlightedFieldsArray as $name) {
         $highlightedFields[] = $name;
       }
@@ -124,16 +129,16 @@ class CRM_Member_Import_Form_MapField extends CRM_Import_Form_MapField {
 
       list($mappingName, $mappingContactType, $mappingLocation, $mappingPhoneType, $mappingRelation) = CRM_Core_BAO_Mapping::getMappingFields($savedMapping);
 
-      $mappingName        = $mappingName[1];
+      $mappingName = $mappingName[1];
       $mappingContactType = $mappingContactType[1];
-      $mappingLocation    = CRM_Utils_Array::value('1', $mappingLocation);
-      $mappingPhoneType   = CRM_Utils_Array::value('1', $mappingPhoneType);
-      $mappingRelation    = CRM_Utils_Array::value('1', $mappingRelation);
+      $mappingLocation = CRM_Utils_Array::value('1', $mappingLocation);
+      $mappingPhoneType = CRM_Utils_Array::value('1', $mappingPhoneType);
+      $mappingRelation = CRM_Utils_Array::value('1', $mappingRelation);
 
       //mapping is to be loaded from database
 
-      $params         = array('id' => $savedMapping);
-      $temp           = array();
+      $params = array('id' => $savedMapping);
+      $temp = array();
       $mappingDetails = CRM_Core_BAO_Mapping::retrieve($params, $temp);
 
       $this->assign('loadedMapping', $mappingDetails->name);
@@ -163,11 +168,11 @@ class CRM_Member_Import_Form_MapField extends CRM_Import_Form_MapField {
 
     //-------- end of saved mapping stuff ---------
 
-    $defaults         = array();
-    $mapperKeys       = array_keys($this->_mapperFields);
-    $hasHeaders       = !empty($this->_columnHeaders);
-    $headerPatterns   = $this->get('headerPatterns');
-    $dataPatterns     = $this->get('dataPatterns');
+    $defaults = array();
+    $mapperKeys = array_keys($this->_mapperFields);
+    $hasHeaders = !empty($this->_columnHeaders);
+    $headerPatterns = $this->get('headerPatterns');
+    $dataPatterns = $this->get('dataPatterns');
     $hasLocationTypes = $this->get('fieldTypes');
 
     /* Initialize all field usages to false */
@@ -329,7 +334,7 @@ class CRM_Member_Import_Form_MapField extends CRM_Import_Form_MapField {
         CRM_Import_Parser::CONTACT_ORGANIZATION => 'Organization',
       );
       $params = array(
-        'used'         => 'Unsupervised',
+        'used' => 'Unsupervised',
         'contact_type' => $contactTypes[$contactTypeId],
       );
       list($ruleFields, $threshold) = CRM_Dedupe_BAO_RuleGroup::dedupeRuleFieldsWeight($params);
@@ -359,7 +364,8 @@ class CRM_Member_Import_Form_MapField extends CRM_Import_Form_MapField {
                 $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)) . ' ' . ts('(OR Membership ID if update mode.)') . '<br />';
+                  1 => $threshold
+                )) . ' ' . ts('(OR Membership ID if update mode.)') . '<br />';
             }
           }
           else {
@@ -367,7 +373,8 @@ class CRM_Member_Import_Form_MapField extends CRM_Import_Form_MapField {
               $errors['_qf_default'] = '';
             }
             $errors['_qf_default'] .= ts('Missing required field: %1', array(
-              1 => $title)) . '<br />';
+                1 => $title
+              )) . '<br />';
           }
         }
       }
@@ -420,11 +427,11 @@ class CRM_Member_Import_Form_MapField extends CRM_Import_Form_MapField {
     $config = CRM_Core_Config::singleton();
     $seperator = $config->fieldSeparator;
 
-    $mapperKeys      = array();
-    $mapper          = array();
-    $mapperKeys      = $this->controller->exportValue($this->_name, 'mapper');
-    $mapperKeysMain  = array();
-    $mapperLocType   = array();
+    $mapperKeys = array();
+    $mapper = array();
+    $mapperKeys = $this->controller->exportValue($this->_name, 'mapper');
+    $mapperKeysMain = array();
+    $mapperLocType = array();
     $mapperPhoneType = array();
 
     for ($i = 0; $i < $this->_columnCount; $i++) {
index e3aa01bb8618c9a7a284135aaaf7e9c1bd02ee5d..a973a2c97c11fdbbfee932ee8d8e6bc18466acf4 100644 (file)
@@ -48,11 +48,11 @@ class CRM_Member_Import_Form_Preview extends CRM_Import_Form_Preview {
     $skipColumnHeader = $this->controller->exportValue('DataSource', 'skipColumnHeader');
 
     //get the data from the session
-    $dataValues       = $this->get('dataValues');
-    $mapper           = $this->get('mapper');
-    $invalidRowCount  = $this->get('invalidRowCount');
+    $dataValues = $this->get('dataValues');
+    $mapper = $this->get('mapper');
+    $invalidRowCount = $this->get('invalidRowCount');
     $conflictRowCount = $this->get('conflictRowCount');
-    $mismatchCount    = $this->get('unMatchCount');
+    $mismatchCount = $this->get('unMatchCount');
 
     //get the mapping name displayed if the mappingId is set
     $mappingId = $this->get('loadMappingId');
@@ -89,9 +89,12 @@ class CRM_Member_Import_Form_Preview extends CRM_Import_Form_Preview {
 
     $properties = array(
       'mapper',
-      'dataValues', 'columnCount',
-      'totalRowCount', 'validRowCount',
-      'invalidRowCount', 'conflictRowCount',
+      'dataValues',
+      'columnCount',
+      'totalRowCount',
+      'validRowCount',
+      'invalidRowCount',
+      'conflictRowCount',
       'downloadErrorRecordsUrl',
       'downloadConflictRecordsUrl',
       'downloadMismatchRecordsUrl',
@@ -109,11 +112,11 @@ class CRM_Member_Import_Form_Preview extends CRM_Import_Form_Preview {
    * @return void
    */
   public function postProcess() {
-    $fileName         = $this->controller->exportValue('DataSource', 'uploadFile');
+    $fileName = $this->controller->exportValue('DataSource', 'uploadFile');
     $skipColumnHeader = $this->controller->exportValue('DataSource', 'skipColumnHeader');
-    $invalidRowCount  = $this->get('invalidRowCount');
+    $invalidRowCount = $this->get('invalidRowCount');
     $conflictRowCount = $this->get('conflictRowCount');
-    $onDuplicate      = $this->get('onDuplicate');
+    $onDuplicate = $this->get('onDuplicate');
 
     $config = CRM_Core_Config::singleton();
     $seperator = $config->fieldSeparator;
index e9ea55b3e366e7238c82eeb2495b4de67ca477cd..c373882722c80f2e5d97750ac16d13fcf6b1683b 100644 (file)
@@ -94,7 +94,19 @@ class CRM_Member_Import_Form_Summary extends CRM_Import_Form_Summary {
     }
     $this->assign('dupeActionString', $dupeActionString);
 
-    $properties = array('totalRowCount', 'validRowCount', 'invalidRowCount', 'conflictRowCount', 'downloadConflictRecordsUrl', 'downloadErrorRecordsUrl', 'duplicateRowCount', 'downloadDuplicateRecordsUrl', 'downloadMismatchRecordsUrl', 'groupAdditions', 'unMatchCount');
+    $properties = array(
+      'totalRowCount',
+      'validRowCount',
+      'invalidRowCount',
+      'conflictRowCount',
+      'downloadConflictRecordsUrl',
+      'downloadErrorRecordsUrl',
+      'duplicateRowCount',
+      'downloadDuplicateRecordsUrl',
+      'downloadMismatchRecordsUrl',
+      'groupAdditions',
+      'unMatchCount'
+    );
     foreach ($properties as $property) {
       $this->assign($property, $this->get($property));
     }
index 67eb3304ef544375f52b49d0217a58f8e91833b3..2dad4b2984d9439baa99e3862ac725f4396bb867 100644 (file)
@@ -32,8 +32,6 @@
  * $Id$
  *
  */
-
-
 abstract class CRM_Member_Import_Parser extends CRM_Import_Parser {
 
   protected $_fileName;
@@ -246,7 +244,8 @@ abstract class CRM_Member_Import_Parser extends CRM_Import_Parser {
       }
       if ($this->_invalidRowCount) {
         // removed view url for invlaid contacts
-        $headers = array_merge(array(ts('Line Number'),
+        $headers = array_merge(array(
+            ts('Line Number'),
             ts('Reason'),
           ),
           $customHeaders
@@ -256,7 +255,8 @@ abstract class CRM_Member_Import_Parser extends CRM_Import_Parser {
         self::exportCSV($this->_errorFileName, $headers, $this->_errors);
       }
       if ($this->_conflictCount) {
-        $headers = array_merge(array(ts('Line Number'),
+        $headers = array_merge(array(
+            ts('Line Number'),
             ts('Reason'),
           ),
           $customHeaders
@@ -265,7 +265,8 @@ abstract class CRM_Member_Import_Parser extends CRM_Import_Parser {
         self::exportCSV($this->_conflictFileName, $headers, $this->_conflicts);
       }
       if ($this->_duplicateCount) {
-        $headers = array_merge(array(ts('Line Number'),
+        $headers = array_merge(array(
+            ts('Line Number'),
             ts('View Membership URL'),
           ),
           $customHeaders
index c55de5a87d3c32d453092c5ef84e82a54584ee8c..315e0506d2a426f3528271c894c95c26cf9b2f5c 100644 (file)
@@ -272,9 +272,9 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
         $params['join_date'] = $params['membership_start_date'];
       }
 
-      $session      = CRM_Core_Session::singleton();
-      $dateType     = $session->get('dateTypes');
-      $formatted    = array();
+      $session = CRM_Core_Session::singleton();
+      $dateType = $session->get('dateTypes');
+      $formatted = array();
       $customFields = CRM_Core_BAO_CustomField::getFields(CRM_Utils_Array::value('contact_type', $params));
 
       // don't add to recent items, CRM-4399
@@ -366,9 +366,9 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
         }
 
         if (!empty($formatValues['membership_id'])) {
-          $dao     = new CRM_Member_BAO_Membership();
+          $dao = new CRM_Member_BAO_Membership();
           $dao->id = $formatValues['membership_id'];
-          $dates   = array('join_date', 'start_date', 'end_date');
+          $dates = array('join_date', 'start_date', 'end_date');
           foreach ($dates as $v) {
             if (empty($formatted[$v])) {
               $formatted[$v] = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', $formatValues['membership_id'], $v);
@@ -409,8 +409,8 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
 
       //Format dates
       $startDate = CRM_Utils_Date::customFormat(CRM_Utils_Array::value('start_date', $formatted), '%Y-%m-%d');
-      $endDate   = CRM_Utils_Date::customFormat(CRM_Utils_Array::value('end_date', $formatted), '%Y-%m-%d');
-      $joinDate  = CRM_Utils_Date::customFormat(CRM_Utils_Array::value('join_date', $formatted), '%Y-%m-%d');
+      $endDate = CRM_Utils_Date::customFormat(CRM_Utils_Array::value('end_date', $formatted), '%Y-%m-%d');
+      $joinDate = CRM_Utils_Date::customFormat(CRM_Utils_Array::value('join_date', $formatted), '%Y-%m-%d');
 
       if ($this->_contactIdIndex < 0) {
 
@@ -478,7 +478,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
           // Using new Dedupe rule.
           $ruleParams = array(
             'contact_type' => $this->_contactType,
-            'used'         => 'Unsupervised',
+            'used' => 'Unsupervised',
           );
           $fieldsArray = CRM_Dedupe_BAO_Rule::dedupeRuleFields($ruleParams);
           $disp = '';
@@ -659,7 +659,8 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
             foreach ($customOption as $customValueID => $customLabel) {
               $customValue = $customLabel['value'];
               if ((strtolower($customLabel['label']) == strtolower(trim($v1))) ||
-                (strtolower($customValue) == strtolower(trim($v1)))) {
+                (strtolower($customValue) == strtolower(trim($v1)))
+              ) {
                 if ($type == 'CheckBox') {
                   $values[$key][$customValue] = 1;
                 }
@@ -677,9 +678,9 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
           if (!CRM_Utils_Rule::integer($value)) {
             throw new Exception("contact_id not valid: $value");
           }
-          $dao     = new CRM_Core_DAO();
+          $dao = new CRM_Core_DAO();
           $qParams = array();
-          $svq     = $dao->singleValueQuery("SELECT id FROM civicrm_contact WHERE id = $value",
+          $svq = $dao->singleValueQuery("SELECT id FROM civicrm_contact WHERE id = $value",
             $qParams
           );
           if (!$svq) {
@@ -698,7 +699,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
 
         case 'membership_type':
           $membershipTypeId = CRM_Utils_Array::key(ucfirst($value),
-          CRM_Member_PseudoConstant::membershipType()
+            CRM_Member_PseudoConstant::membershipType()
           );
           if ($membershipTypeId) {
             if (!empty($values['membership_type_id']) &&
@@ -722,7 +723,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
 
         case 'membership_status':
           $membershipStatusId = CRM_Utils_Array::key(ucfirst($value),
-          CRM_Member_PseudoConstant::membershipStatus()
+            CRM_Member_PseudoConstant::membershipStatus()
           );
           if ($membershipStatusId) {
             if (!empty($values['status_id']) &&
index 2e3e5c31fcb072c18aaac870b0a919aabfc196c6..a5650a34404f6ce8ba269d80557e360cccf97dbe 100644 (file)
@@ -102,7 +102,7 @@ class CRM_Member_Info extends CRM_Core_Component_Info {
    */
   public function getUserDashboardElement() {
     return array(
-    'name' => ts('Memberships'),
+      'name' => ts('Memberships'),
       'title' => ts('Your Membership(s)'),
       // this is CiviContribute specific permission, since
       // there is no permission that could be checked for
@@ -125,7 +125,7 @@ class CRM_Member_Info extends CRM_Core_Component_Info {
    */
   public function registerTab() {
     return array(
-    'title' => ts('Memberships'),
+      'title' => ts('Memberships'),
       'url' => 'membership',
       'weight' => 30,
     );
@@ -144,7 +144,7 @@ class CRM_Member_Info extends CRM_Core_Component_Info {
    */
   public function registerAdvancedSearchPane() {
     return array(
-    'title' => ts('Memberships'),
+      'title' => ts('Memberships'),
       'weight' => 30,
     );
   }
index 9981175ef6d735b720bc0ffbc9ab4a6012f0d908..5e305677589a8e0ab88e5ed478350ecdeafa1e5a 100644 (file)
@@ -102,52 +102,52 @@ class CRM_Member_Page_DashBoard extends CRM_Core_Page {
     foreach ($membershipTypes as $key => $value) {
 
       $membershipSummary[$key]['premonth']['new'] = array(
-      'count' => CRM_Member_BAO_Membership::getMembershipJoins($key, $preMonth, $preMonthEnd),
+        'count' => CRM_Member_BAO_Membership::getMembershipJoins($key, $preMonth, $preMonthEnd),
         'name' => $value,
       );
 
       $membershipSummary[$key]['premonth']['renew'] = array(
-      'count' => CRM_Member_BAO_Membership::getMembershipRenewals($key, $preMonth, $preMonthEnd),
+        'count' => CRM_Member_BAO_Membership::getMembershipRenewals($key, $preMonth, $preMonthEnd),
         'name' => $value,
       );
 
       $membershipSummary[$key]['premonth']['total'] = array(
-      'count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $preMonth, $preMonthEnd),
+        'count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $preMonth, $preMonthEnd),
         'name' => $value,
       );
 
       $membershipSummary[$key]['month']['new'] = array(
-      'count' => CRM_Member_BAO_Membership::getMembershipJoins($key, $monthStart, $ymd),
+        'count' => CRM_Member_BAO_Membership::getMembershipJoins($key, $monthStart, $ymd),
         'name' => $value,
       );
 
       $membershipSummary[$key]['month']['renew'] = array(
-      'count' => CRM_Member_BAO_Membership::getMembershipRenewals($key, $monthStart, $ymd),
+        'count' => CRM_Member_BAO_Membership::getMembershipRenewals($key, $monthStart, $ymd),
         'name' => $value,
       );
 
       $membershipSummary[$key]['month']['total'] = array(
-      'count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $monthStart, $ymd),
+        'count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $monthStart, $ymd),
         'name' => $value,
       );
 
       $membershipSummary[$key]['year']['new'] = array(
-      'count' => CRM_Member_BAO_Membership::getMembershipJoins($key, $yearStart, $ymd),
+        'count' => CRM_Member_BAO_Membership::getMembershipJoins($key, $yearStart, $ymd),
         'name' => $value,
       );
 
       $membershipSummary[$key]['year']['renew'] = array(
-      'count' => CRM_Member_BAO_Membership::getMembershipRenewals($key, $yearStart, $ymd),
+        'count' => CRM_Member_BAO_Membership::getMembershipRenewals($key, $yearStart, $ymd),
         'name' => $value,
       );
 
       $membershipSummary[$key]['year']['total'] = array(
-      'count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $yearStart, $ymd),
+        'count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $yearStart, $ymd),
         'name' => $value,
       );
 
       $membershipSummary[$key]['current']['total'] = array(
-      'count' => CRM_Member_BAO_Membership::getMembershipCount($key, $current),
+        'count' => CRM_Member_BAO_Membership::getMembershipCount($key, $current),
         'name' => $value,
       );
 
@@ -155,22 +155,22 @@ class CRM_Member_Page_DashBoard extends CRM_Core_Page {
 
       //LCD also get summary stats for membership owners
       $membershipSummary[$key]['premonth_owner']['premonth_owner'] = array(
-      'count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $preMonth, $preMonthEnd, 0, 1),
+        'count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $preMonth, $preMonthEnd, 0, 1),
         'name' => $value,
       );
 
       $membershipSummary[$key]['month_owner']['month_owner'] = array(
-      'count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $monthStart, $ymd, 0, 1),
+        'count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $monthStart, $ymd, 0, 1),
         'name' => $value,
       );
 
       $membershipSummary[$key]['year_owner']['year_owner'] = array(
-      'count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $yearStart, $ymd, 0, 1),
+        'count' => CRM_Member_BAO_Membership::getMembershipStarts($key, $yearStart, $ymd, 0, 1),
         'name' => $value,
       );
 
       $membershipSummary[$key]['current_owner']['current_owner'] = array(
-      'count' => CRM_Member_BAO_Membership::getMembershipCount($key, $current, 0, 1),
+        'count' => CRM_Member_BAO_Membership::getMembershipCount($key, $current, 0, 1),
         'name' => $value,
       );
 
@@ -283,17 +283,17 @@ class CRM_Member_Page_DashBoard extends CRM_Core_Page {
     $totalCountPreMonth = $totalCountMonth = $totalCountYear = $totalCountCurrent = $totalCountTotal = 0;
     $totalCountPreMonth_owner = $totalCountMonth_owner = $totalCountYear_owner = $totalCountCurrent_owner = $totalCountTotal_owner = 0;
     foreach ($membershipSummary as $key => $value) {
-      $newCountPreMonth   = $newCountPreMonth + $value['premonth']['new']['count'];
+      $newCountPreMonth = $newCountPreMonth + $value['premonth']['new']['count'];
       $renewCountPreMonth = $renewCountPreMonth + $value['premonth']['renew']['count'];
       $totalCountPreMonth = $totalCountPreMonth + $value['premonth']['total']['count'];
-      $newCountMonth      = $newCountMonth + $value['month']['new']['count'];
-      $renewCountMonth    = $renewCountMonth + $value['month']['renew']['count'];
-      $totalCountMonth    = $totalCountMonth + $value['month']['total']['count'];
-      $newCountYear       = $newCountYear + $value['year']['new']['count'];
-      $renewCountYear     = $renewCountYear + $value['year']['renew']['count'];
-      $totalCountYear     = $totalCountYear + $value['year']['total']['count'];
-      $totalCountCurrent  = $totalCountCurrent + $value['current']['total']['count'];
-      $totalCountTotal    = $totalCountTotal + $value['total']['total']['count'];
+      $newCountMonth = $newCountMonth + $value['month']['new']['count'];
+      $renewCountMonth = $renewCountMonth + $value['month']['renew']['count'];
+      $totalCountMonth = $totalCountMonth + $value['month']['total']['count'];
+      $newCountYear = $newCountYear + $value['year']['new']['count'];
+      $renewCountYear = $renewCountYear + $value['year']['renew']['count'];
+      $totalCountYear = $totalCountYear + $value['year']['total']['count'];
+      $totalCountCurrent = $totalCountCurrent + $value['current']['total']['count'];
+      $totalCountTotal = $totalCountTotal + $value['total']['total']['count'];
 
       //LCD add owner values
       $totalCountPreMonth_owner = $totalCountPreMonth_owner + $value['premonth_owner']['premonth_owner']['count'];
@@ -394,33 +394,33 @@ class CRM_Member_Page_DashBoard extends CRM_Core_Page {
     //LCD add owner values
     $totalCount['premonth_owner']['premonth_owner'] = array(
       'count' => $totalCountPreMonth_owner,
-    //  'url' => CRM_Utils_System::url('civicrm/member/search', "reset=1&force=1&status=$status&start=$preMonth&end=$preMonthEnd&owner=1"),
+      //  'url' => CRM_Utils_System::url('civicrm/member/search', "reset=1&force=1&status=$status&start=$preMonth&end=$preMonthEnd&owner=1"),
     );
 
     $totalCount['month_owner']['month_owner'] = array(
       'count' => $totalCountMonth_owner,
-    //  'url' => CRM_Utils_System::url('civicrm/member/search', "reset=1&force=1&status=$status&start=$monthStart&end=$ymd&owner=1"),
+      //  'url' => CRM_Utils_System::url('civicrm/member/search', "reset=1&force=1&status=$status&start=$monthStart&end=$ymd&owner=1"),
     );
 
     $totalCount['year_owner']['year_owner'] = array(
       'count' => $totalCountYear_owner,
-    //  'url' => CRM_Utils_System::url('civicrm/member/search', "reset=1&force=1&status=$status&start=$yearStart&end=$ymd&owner=1"),
+      //  'url' => CRM_Utils_System::url('civicrm/member/search', "reset=1&force=1&status=$status&start=$yearStart&end=$ymd&owner=1"),
     );
 
     $totalCount['current_owner']['current_owner'] = array(
       'count' => $totalCountCurrent_owner,
-    //  'url' => CRM_Utils_System::url('civicrm/member/search', "reset=1&force=1&status=$status&owner=1"),
+      //  'url' => CRM_Utils_System::url('civicrm/member/search', "reset=1&force=1&status=$status&owner=1"),
     );
 
     $totalCount['total_owner']['total_owner'] = array(
       'count' => $totalCountTotal_owner,
-    //  'url' => CRM_Utils_System::url('civicrm/member/search', "reset=1&force=1&status=$status&owner=1"),
+      //  'url' => CRM_Utils_System::url('civicrm/member/search', "reset=1&force=1&status=$status&owner=1"),
     );
 
     if (!$isCurrentMonth) {
       $totalCount['total_owner']['total_owner'] = array(
         'count' => $totalCountTotal_owner,
-      //  'url' => CRM_Utils_System::url('civicrm/member/search', "reset=1&force=1&status=$status&start=&end=$ymd&owner=1"),
+        //  'url' => CRM_Utils_System::url('civicrm/member/search', "reset=1&force=1&status=$status&start=&end=$ymd&owner=1"),
       );
     }
     //LCD end
index a72e52532a52f0a8a383fce5510e07fb0b17c7d3..a5fd7f178270c91719682263aa7fcc0ef814cd59 100644 (file)
@@ -167,7 +167,10 @@ class CRM_Member_Page_Tab extends CRM_Core_Page {
   WHERE m.owner_membership_id = {$dao->id} AND m.is_test = 0 AND ms.is_current_member = 1 AND ct.is_deleted = 0";
         $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))
+        $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
+          ))
         );
       }
       else {
@@ -466,10 +469,10 @@ class CRM_Member_Page_Tab extends CRM_Core_Page {
    */
   static function &links(
     $status = 'all',
-                         $isPaymentProcessor = NULL,
-                         $accessContribution = NULL,
-                         $isCancelSupported = FALSE,
-                         $isUpdateBilling = FALSE
+    $isPaymentProcessor = NULL,
+    $accessContribution = NULL,
+    $isCancelSupported = FALSE,
+    $isUpdateBilling = FALSE
   ) {
     if (!CRM_Utils_Array::value('view', self::$_links)) {
       self::$_links['view'] = array(
index 53fca6498acb02b8e76f887f8e032fff304f0a8a..eba8a181999349334293cd9d88cafc8acb2bc58d 100644 (file)
@@ -44,10 +44,10 @@ class CRM_Member_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoard
    * return null
    */
   public function listMemberships() {
-    $membership      = array();
-    $dao             = new CRM_Member_DAO_Membership();
+    $membership = array();
+    $dao = new CRM_Member_DAO_Membership();
     $dao->contact_id = $this->_contactId;
-    $dao->is_test    = 0;
+    $dao->is_test = 0;
     $dao->find();
 
     while ($dao->fetch()) {
@@ -57,7 +57,9 @@ class CRM_Member_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoard
       //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'])) {
index a6331da4ad18bdd26d65baa882626987c2d858e4..2a5f96bca5e06b91300132de6aaa73d84086885a 100644 (file)
@@ -134,6 +134,6 @@ class CRM_Member_PseudoConstant extends CRM_Core_PseudoConstant {
   public static function flush($name = 'cache') {
     if (isset(self::$$name)) {
       self::$$name = NULL;
-   }
+    }
   }
 }
index 2206144284ea71f5620cededb02db342a4b407ba..063d12eefef351671e17331fa2c7ce78fcc36d62 100644 (file)
@@ -158,8 +158,8 @@ class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_C
     // submitted form values
     $this->_queryParams = &$queryParams;
 
-    $this->_single  = $single;
-    $this->_limit   = $limit;
+    $this->_single = $single;
+    $this->_limit = $limit;
     $this->_context = $context;
 
     $this->_memberClause = $memberClause;
@@ -435,7 +435,7 @@ class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_C
       //does membership have auto renew CRM-7137.
       $autoRenew = FALSE;
       if (isset($result->membership_recur_id) && $result->membership_recur_id &&
-          !CRM_Member_BAO_Membership::isSubscriptionCancelled($row['membership_id'])
+        !CRM_Member_BAO_Membership::isSubscriptionCancelled($row['membership_id'])
       ) {
         $autoRenew = TRUE;
       }
@@ -482,7 +482,7 @@ class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_C
           'direction' => CRM_Utils_Sort::DONTCARE,
         ),
         array(
-      'name' => ts('Member Since'),
+          'name' => ts('Member Since'),
           'sort' => 'join_date',
           'direction' => CRM_Utils_Sort::DESCENDING,
         ),
index f7bfd24ffd487b6c3ec96c3a74264be0ac2121f3..ff6c8677a55af305297440a58f7cdafc22bba7a3 100644 (file)
@@ -73,9 +73,9 @@ class CRM_Note_Form_Note extends CRM_Core_Form {
 
   public function preProcess() {
     $this->_entityTable = $this->get('entityTable');
-    $this->_entityId    = $this->get('entityId');
-    $this->_id          = $this->get('id');
-    $this->_parentId    = CRM_Utils_Array::value('parentId', $_GET, 0);
+    $this->_entityId = $this->get('entityId');
+    $this->_id = $this->get('id');
+    $this->_parentId = CRM_Utils_Array::value('parentId', $_GET, 0);
     if ($this->_parentId) {
       $this->assign('parentId', $this->_parentId);
     }
index fbae546a15b361c6c933c2edcbd24820e18c3441..0f0ca1f846e104b7c5f35a05a5429e804bef204d 100644 (file)
@@ -80,7 +80,7 @@ class CRM_PCP_BAO_PCP extends CRM_PCP_DAO_PCP {
 
     // set currency for CRM-1496
     if (!isset($dao->currency)) {
-      $config = & CRM_Core_Config::singleton();
+      $config = &CRM_Core_Config::singleton();
       $dao->currency = $config->defaultCurrency;
     }
 
@@ -466,8 +466,8 @@ WHERE pcp.id = %1 AND cc.contribution_status_id =1 AND cc.is_test = 0";
       );
       $extraOption = array('onclick' => "return pcpAnonymous( );");
       $elements = array();
-      $elements[] = & $page->createElement('radio', NULL, '', ts('Include my name and message'), 0, $extraOption);
-      $elements[] = & $page->createElement('radio', NULL, '', ts('List my support anonymously'), 1, $extraOption);
+      $elements[] = &$page->createElement('radio', NULL, '', ts('Include my name and message'), 0, $extraOption);
+      $elements[] = &$page->createElement('radio', NULL, '', ts('List my support anonymously'), 1, $extraOption);
       $page->addGroup($elements, 'pcp_is_anonymous', NULL, '&nbsp;&nbsp;&nbsp;');
       $page->_defaults['pcp_is_anonymous'] = 0;
 
index 53ca89d3dc450daefcac227158f1d89b2d59eeb6..676837fbeae50ada559ba493c3bfe95e095634c8 100644 (file)
@@ -176,7 +176,7 @@ class CRM_PCP_Form_Campaign extends CRM_Core_Form {
    * @return void
    */
   public function postProcess() {
-    $params  = $this->controller->exportValues($this->_name);
+    $params = $this->controller->exportValues($this->_name);
     $checkBoxes = array('is_thermometer', 'is_honor_roll', 'is_active');
 
     foreach ($checkBoxes as $key) {
@@ -199,7 +199,7 @@ class CRM_PCP_Form_Campaign extends CRM_Core_Form {
     // we also need to purify it, so lets clean it up
     $htmlFields = array('intro_text', 'page_text', 'title');
     foreach ($htmlFields as $field) {
-      if (! empty($params[$field])) {
+      if (!empty($params[$field])) {
         $params[$field] = CRM_Utils_String::purifyHTML($params[$field]);
       }
     }
@@ -238,7 +238,7 @@ class CRM_PCP_Form_Campaign extends CRM_Core_Form {
     $statusId = CRM_Core_DAO::getFieldValue('CRM_PCP_DAO_PCP', $pcp->id, 'status_id');
 
     //send notification of PCP create/update.
-    $pcpParams    = array('entity_table' => $entity_table, 'entity_id' => $pcp->page_id);
+    $pcpParams = array('entity_table' => $entity_table, 'entity_id' => $pcp->page_id);
     $notifyParams = array();
     $notifyStatus = "";
     CRM_Core_DAO::commonRetrieve('CRM_PCP_DAO_PCPBlock', $pcpParams, $notifyParams, array('notify_email'));
@@ -343,8 +343,8 @@ class CRM_PCP_Form_Campaign extends CRM_Core_Form {
     }
 
     CRM_Core_Session::setStatus(ts("Your Personal Campaign Page has been %1 %2 %3",
-        array(1 => $pageStatus, 2 => $approvalMessage, 3 => $notifyStatus)
-      ), '', 'info');
+      array(1 => $pageStatus, 2 => $approvalMessage, 3 => $notifyStatus)
+    ), '', 'info');
     if (!$this->_pageId) {
       $session->pushUserContext(CRM_Utils_System::url('civicrm/pcp/info', "reset=1&id={$pcp->id}&ap={$anonymousPCP}"));
     }
index 31961bad6e23f8a6bb62259e448f7d883dc65fb4..1e950dd71c53963bda1963023403d0d8d459999b 100644 (file)
@@ -156,9 +156,9 @@ class CRM_PCP_Form_Contribute extends CRM_Contribute_Form_ContributionPage {
     $params['target_entity_type'] = CRM_Utils_Array::value('target_entity_type', $params, 'contribute');
     $params['target_entity_id'] = $this->_id;
 
-    $dao               = new CRM_PCP_DAO_PCPBlock();
+    $dao = new CRM_PCP_DAO_PCPBlock();
     $dao->entity_table = $params['entity_table'];
-    $dao->entity_id    = $this->_id;
+    $dao->entity_id = $this->_id;
     $dao->find(TRUE);
     $params['id'] = $dao->id;
     $params['is_active'] = CRM_Utils_Array::value('pcp_active', $params, FALSE);
index 9570b112eed8d3e53f3253e2cb69f780767a27fa..2b02239dee8e54b4531166f64874df7b1dbcb8a8 100644 (file)
@@ -80,7 +80,8 @@ class CRM_PCP_Form_Event extends CRM_Event_Form_ManageEvent {
       $defaults['link_text'] = ts('Promote this event with a personal campaign page');
 
       if ($this->_id &&
-          $ccReceipt = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $this->_id, 'cc_receipt')) {
+        $ccReceipt = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $this->_id, 'cc_receipt')
+      ) {
         $defaults['notify_email'] = $ccReceipt;
       }
     }
@@ -105,7 +106,8 @@ class CRM_PCP_Form_Event extends CRM_Event_Form_ManageEvent {
     $this->add('select', 'target_entity_id',
       ts('Online Contribution Page'),
       array(
-        '' => ts('- select -')) +
+        '' => ts('- select -')
+      ) +
       CRM_Contribute_PseudoConstant::contributionPage()
     );
 
@@ -119,7 +121,9 @@ class CRM_PCP_Form_Event extends CRM_Event_Form_ManageEvent {
 
     if (!empty($pcpBlock->id) && CRM_PCP_BAO_PCP::getPcpBlockInUse($pcpBlock->id)) {
       foreach (array(
-        'target_entity_type', 'target_entity_id') as $element_name) {
+                 'target_entity_type',
+                 'target_entity_id'
+               ) as $element_name) {
         $element = $this->getElement($element_name);
         $element->freeze();
       }
@@ -192,9 +196,9 @@ class CRM_PCP_Form_Event extends CRM_Event_Form_ManageEvent {
       $params['target_entity_id'] = CRM_Utils_Array::value('target_entity_id', $params, $this->_id);
     }
 
-    $dao               = new CRM_PCP_DAO_PCPBlock();
+    $dao = new CRM_PCP_DAO_PCPBlock();
     $dao->entity_table = $params['entity_table'];
-    $dao->entity_id    = $this->_id;
+    $dao->entity_id = $this->_id;
     $dao->find(TRUE);
     $params['id'] = $dao->id;
     $params['is_active'] = CRM_Utils_Array::value('pcp_active', $params, FALSE);
index f7eba0cbed96647fec87ed6a315b26ee09917942..8072cff8aa7ed9be2f46e6ea58e308600a5acbae 100644 (file)
@@ -77,7 +77,7 @@ class CRM_PCP_Form_PCP extends CRM_Core_Form {
 
     $session = CRM_Core_Session::singleton();
     $context = $session->popUserContext();
-    $userID  = $session->get('userID');
+    $userID = $session->get('userID');
 
     //do not allow destructive actions without permissions
     $permission = FALSE;
@@ -167,7 +167,7 @@ class CRM_PCP_Form_PCP extends CRM_Core_Form {
         'event' => ts('Event'),
       );
       $contribPages = array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::contributionPage();
-      $eventPages   = array('' => ts('- select -')) + CRM_Event_PseudoConstant::event(NULL, FALSE, "( is_template IS NULL OR is_template != 1 )");
+      $eventPages = array('' => ts('- select -')) + CRM_Event_PseudoConstant::event(NULL, FALSE, "( is_template IS NULL OR is_template != 1 )");
 
       $this->addElement('select', 'status_id', ts('Status'), $status);
       $this->addElement('select', 'page_type', ts('Source Type'), $types);
index a7f7c354d713e9cc0dce9e49f56c6def310e7443..16970676539be9e9918ac993d2577776a1d7e75f 100644 (file)
@@ -63,12 +63,12 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form {
 
 
   public function preProcess() {
-    $session          = CRM_Core_Session::singleton();
-    $config           = CRM_Core_Config::singleton();
-    $this->_action    = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE);
-    $this->_pageId    = CRM_Utils_Request::retrieve('pageId', 'Positive', $this);
+    $session = CRM_Core_Session::singleton();
+    $config = CRM_Core_Config::singleton();
+    $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE);
+    $this->_pageId = CRM_Utils_Request::retrieve('pageId', 'Positive', $this);
     $this->_component = CRM_Utils_Request::retrieve('component', 'String', $this);
-    $this->_id        = CRM_Utils_Request::retrieve('id', 'Positive', $this);
+    $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
 
     if (!$this->_pageId && $config->userFramework == 'Joomla' && $config->userFrameworkFrontend) {
       $this->_pageId = $this->_id;
@@ -195,7 +195,7 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form {
     if ($this->_single) {
       $button = array(
         array(
-      'type' => 'next',
+          'type' => 'next',
           'name' => ts('Save'),
           'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
           'isDefault' => TRUE,
index 861d7154d634f61bfbc14c9b3eaa7e87c55e9a46..4944b06e81ae960be694515bc7586dee57be7c24 100644 (file)
@@ -94,13 +94,13 @@ class CRM_PCP_Page_PCP extends CRM_Core_Page_Basic {
           'title' => ts('Delete Personal Campaign Page'),
         ),
         CRM_Core_Action::ENABLE => array(
-      'name' => ts('Enable'),
+          'name' => ts('Enable'),
           'url' => 'civicrm/admin/pcp',
           'qs' => 'action=enable&id=%%id%%',
           'title' => ts('Enable'),
         ),
         CRM_Core_Action::DISABLE => array(
-      'name' => ts('Disable'),
+          'name' => ts('Disable'),
           'url' => 'civicrm/admin/pcp',
           'qs' => 'action=disable&id=%%id%%',
           'title' => ts('Disable'),
index 39a5ef1c108629ae636ccc9e5df715235ab4d3e7..62e5e829b052cbfceec30759d3641af195ed284d 100644 (file)
@@ -49,10 +49,10 @@ class CRM_PCP_Page_PCPInfo extends CRM_Core_Page {
    * @return void
    */
   public function run() {
-    $session         = CRM_Core_Session::singleton();
-    $config          = CRM_Core_Config::singleton();
+    $session = CRM_Core_Session::singleton();
+    $config = CRM_Core_Config::singleton();
     $permissionCheck = FALSE;
-    $statusMessage   = '';
+    $statusMessage = '';
     if ($config->userFramework != 'Joomla') {
       $permissionCheck = CRM_Core_Permission::check('administer CiviCRM');
     }
@@ -106,9 +106,9 @@ class CRM_PCP_Page_PCPInfo extends CRM_Core_Page {
     if ($pcpInfo['status_id'] != $approvedId || !$pcpInfo['is_active']) {
       if ($pcpInfo['contact_id'] != $session->get('userID') && !$permissionCheck) {
         CRM_Core_Error::statusBounce($statusMessage, CRM_Utils_System::url($urlBase,
-            "reset=1&id=" . $pcpInfo['page_id'],
-            FALSE, NULL, FALSE, TRUE
-          ));
+          "reset=1&id=" . $pcpInfo['page_id'],
+          FALSE, NULL, FALSE, TRUE
+        ));
       }
     }
     else {
@@ -116,9 +116,9 @@ class CRM_PCP_Page_PCPInfo extends CRM_Core_Page {
       if (!$getStatus) {
         // PCP not enabled for this contribution page. Forward everyone to source page
         CRM_Core_Error::statusBounce($statusMessage, CRM_Utils_System::url($urlBase,
-            "reset=1&id=" . $pcpInfo['page_id'],
-            FALSE, NULL, FALSE, TRUE
-          ));
+          "reset=1&id=" . $pcpInfo['page_id'],
+          FALSE, NULL, FALSE, TRUE
+        ));
       }
     }
 
@@ -135,7 +135,12 @@ class CRM_PCP_Page_PCPInfo extends CRM_Core_Page {
       $page_class = 'CRM_Event_DAO_Event';
       $this->assign('pageName', CRM_Event_PseudoConstant::event($pcpInfo['page_id']));
       CRM_Core_DAO::commonRetrieveAll($page_class, 'id',
-        $pcpInfo['page_id'], $default, array('start_date', 'end_date', 'registration_start_date', 'registration_end_date')
+        $pcpInfo['page_id'], $default, array(
+          'start_date',
+          'end_date',
+          'registration_start_date',
+          'registration_end_date'
+        )
       );
     }
     elseif ($pcpBlock->entity_table == 'civicrm_contribution_page') {
@@ -198,8 +203,8 @@ class CRM_PCP_Page_PCPInfo extends CRM_Core_Page {
       $fileInfo = reset($entityFile);
       $fileId = $fileInfo['fileID'];
       $image = '<img src="' . CRM_Utils_System::url('civicrm/file',
-        "reset=1&id=$fileId&eid={$this->_id}"
-      ) . '" />';
+          "reset=1&id=$fileId&eid={$this->_id}"
+        ) . '" />';
       $this->assign('image', $image);
     }
 
@@ -296,14 +301,14 @@ class CRM_PCP_Page_PCPInfo extends CRM_Core_Page {
     switch ($action) {
       case CRM_Core_Action::BROWSE:
         $subForm = 'PCPAccount';
-        $form    = "CRM_PCP_Form_$subForm";
-        $single  = TRUE;
+        $form = "CRM_PCP_Form_$subForm";
+        $single = TRUE;
         break;
 
       case CRM_Core_Action::UPDATE:
         $subForm = 'Campaign';
-        $form    = "CRM_PCP_Form_$subForm";
-        $single  = TRUE;
+        $form = "CRM_PCP_Form_$subForm";
+        $single = TRUE;
         break;
     }
 
index bde6c1610bebf79f7aca2d7342c7c064237a1f74..4726b23a79f37c8825491620554477860a602779 100644 (file)
@@ -212,8 +212,16 @@ class CRM_Pledge_BAO_Pledge extends CRM_Pledge_DAO_Pledge {
       //building payment params
       $paymentParams['pledge_id'] = $pledge->id;
       $paymentKeys = array(
-        'amount', 'installments', 'scheduled_date', 'frequency_unit', 'currency',
-        'frequency_day', 'frequency_interval', 'contribution_id', 'installment_amount', 'actual_amount',
+        'amount',
+        'installments',
+        'scheduled_date',
+        'frequency_unit',
+        'currency',
+        'frequency_day',
+        'frequency_interval',
+        'contribution_id',
+        'installment_amount',
+        'actual_amount',
       );
       foreach ($paymentKeys as $key) {
         $paymentParams[$key] = CRM_Utils_Array::value($key, $params, NULL);
@@ -282,7 +290,7 @@ class CRM_Pledge_BAO_Pledge extends CRM_Pledge_DAO_Pledge {
       $payment->delete();
     }
 
-    $dao     = new CRM_Pledge_DAO_Pledge();
+    $dao = new CRM_Pledge_DAO_Pledge();
     $dao->id = $id;
     $results = $dao->delete();
 
@@ -354,18 +362,18 @@ FROM   civicrm_pledge
 WHERE  $whereCond AND is_test=0
 GROUP BY  currency
 ";
-    $start   = substr($startDate, 0, 8);
-    $end     = substr($endDate, 0, 8);
-    $pCount  = 0;
+    $start = substr($startDate, 0, 8);
+    $end = substr($endDate, 0, 8);
+    $pCount = 0;
     $pamount = array();
-    $dao     = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+    $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
     while ($dao->fetch()) {
       $pCount += $dao->pledge_count;
       $pamount[] = CRM_Utils_Money::format($dao->pledge_amount, $dao->currency);
     }
 
     $pledge_amount = array(
-    'pledge_amount' => implode(', ', $pamount),
+      'pledge_amount' => implode(', ', $pamount),
       'pledge_count' => $pCount,
       'purl' => CRM_Utils_System::url('civicrm/pledge/search',
         "reset=1&force=1&pstatus={$statusId}&pstart={$start}&pend={$end}&test=0"
@@ -376,31 +384,31 @@ GROUP BY  currency
     $statusId = array_search($status, $allStatus);
     switch ($status) {
       case 'Completed':
-        $select    = 'sum( total_amount ) as received_pledge , count( cd.id ) as received_count';
-        $where[]   = 'cp.status_id = ' . $statusId . ' AND cp.contribution_id = cd.id AND cd.is_test=0';
+        $select = 'sum( total_amount ) as received_pledge , count( cd.id ) as received_count';
+        $where[] = 'cp.status_id = ' . $statusId . ' AND cp.contribution_id = cd.id AND cd.is_test=0';
         $queryDate = 'receive_date';
-        $from      = ' civicrm_contribution cd, civicrm_pledge_payment cp';
+        $from = ' civicrm_contribution cd, civicrm_pledge_payment cp';
         break;
 
       case 'Cancelled':
-        $select    = 'sum( total_amount ) as received_pledge , count( cd.id ) as received_count';
-        $where[]   = 'cp.status_id = ' . $statusId . ' AND cp.contribution_id = cd.id AND cd.is_test=0';
+        $select = 'sum( total_amount ) as received_pledge , count( cd.id ) as received_count';
+        $where[] = 'cp.status_id = ' . $statusId . ' AND cp.contribution_id = cd.id AND cd.is_test=0';
         $queryDate = 'receive_date';
-        $from      = ' civicrm_contribution cd, civicrm_pledge_payment cp';
+        $from = ' civicrm_contribution cd, civicrm_pledge_payment cp';
         break;
 
       case 'Pending':
-        $select    = 'sum( scheduled_amount )as received_pledge , count( cp.id ) as received_count';
-        $where[]   = 'cp.status_id = ' . $statusId . ' AND pledge.is_test=0';
+        $select = 'sum( scheduled_amount )as received_pledge , count( cp.id ) as received_count';
+        $where[] = 'cp.status_id = ' . $statusId . ' AND pledge.is_test=0';
         $queryDate = 'scheduled_date';
-        $from      = ' civicrm_pledge_payment cp INNER JOIN civicrm_pledge pledge on cp.pledge_id = pledge.id';
+        $from = ' civicrm_pledge_payment cp INNER JOIN civicrm_pledge pledge on cp.pledge_id = pledge.id';
         break;
 
       case 'Overdue':
-        $select    = 'sum( scheduled_amount ) as received_pledge , count( cp.id ) as received_count';
-        $where[]   = 'cp.status_id = ' . $statusId . ' AND pledge.is_test=0';
+        $select = 'sum( scheduled_amount ) as received_pledge , count( cp.id ) as received_count';
+        $where[] = 'cp.status_id = ' . $statusId . ' AND pledge.is_test=0';
         $queryDate = 'scheduled_date';
-        $from      = ' civicrm_pledge_payment cp INNER JOIN civicrm_pledge pledge on cp.pledge_id = pledge.id';
+        $from = ' civicrm_pledge_payment cp INNER JOIN civicrm_pledge pledge on cp.pledge_id = pledge.id';
         break;
     }
 
@@ -420,9 +428,9 @@ GROUP BY  currency
  GROUP BY  cp.currency
 ";
     if ($select) {
-      $dao    = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
+      $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
       $amount = array();
-      $count  = 0;
+      $count = 0;
 
       while ($dao->fetch()) {
         $count += $dao->received_count;
@@ -431,12 +439,12 @@ GROUP BY  currency
 
       if ($count) {
         return array_merge($pledge_amount, array(
-        'received_amount' => implode(', ', $amount),
-            'received_count' => $count,
-            'url' => CRM_Utils_System::url('civicrm/pledge/search',
-              "reset=1&force=1&status={$statusId}&start={$start}&end={$end}&test=0"
-            ),
-          ));
+          'received_amount' => implode(', ', $amount),
+          'received_count' => $count,
+          'url' => CRM_Utils_System::url('civicrm/pledge/search',
+            "reset=1&force=1&status={$statusId}&start={$start}&end={$end}&test=0"
+          ),
+        ));
       }
     }
     else {
@@ -527,7 +535,7 @@ GROUP BY  currency
         }
         $payments[$payID] = array_merge($contributionValue,
           array(
-        'amount' => CRM_Utils_Array::value('scheduled_amount', $values),
+            'amount' => CRM_Utils_Array::value('scheduled_amount', $values),
             'due_date' => CRM_Utils_Array::value('scheduled_date', $values),
           )
         );
@@ -535,7 +543,8 @@ GROUP BY  currency
         //get the first valid payment id.
         if (!isset($form->paymentId) && ($paymentStatusTypes[$values['status_id']] == 'Pending' ||
             $paymentStatusTypes[$values['status_id']] == 'Overdue'
-          )) {
+          )
+        ) {
           $form->paymentId = $values['id'];
         }
       }
@@ -543,8 +552,14 @@ GROUP BY  currency
 
     //assign pledge fields value to template.
     $pledgeFields = array(
-      'create_date', 'total_pledge_amount', 'frequency_interval', 'frequency_unit',
-      'installments', 'frequency_day', 'scheduled_amount', 'currency',
+      'create_date',
+      'total_pledge_amount',
+      'frequency_interval',
+      'frequency_unit',
+      'installments',
+      'frequency_day',
+      'scheduled_amount',
+      'currency',
     );
     foreach ($pledgeFields as $field) {
       if (!empty($params[$field])) {
@@ -560,7 +575,7 @@ GROUP BY  currency
     //handle domain token values
     $domain = CRM_Core_BAO_Domain::getDomain();
     $tokens = array(
-    'domain' => array('name', 'phone', 'address', 'email'),
+      'domain' => array('name', 'phone', 'address', 'email'),
       'contact' => CRM_Core_SelectValues::contactTokens(),
     );
     $domainValues = array();
@@ -587,9 +602,9 @@ GROUP BY  currency
 
     //handle custom data.
     if (!empty($params['hidden_custom'])) {
-      $groupTree    = CRM_Core_BAO_CustomGroup::getTree('Pledge', CRM_Core_DAO::$_nullObject, $params['id']);
+      $groupTree = CRM_Core_BAO_CustomGroup::getTree('Pledge', CRM_Core_DAO::$_nullObject, $params['id']);
       $pledgeParams = array(array('pledge_id', '=', $params['id'], 0, 0));
-      $customGroup  = array();
+      $customGroup = array();
       // retrieve custom data
       foreach ($groupTree as $groupID => $group) {
         $customFields = $customValues = array();
@@ -612,7 +627,7 @@ GROUP BY  currency
     //handle acknowledgment email stuff.
     list($pledgerDisplayName,
       $pledgerEmail
-    ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($params['contact_id']);
+      ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($params['contact_id']);
 
     //check for online pledge.
     $session = CRM_Core_Session::singleton();
@@ -708,14 +723,14 @@ GROUP BY  currency
 
       //set title to calculated fields
       $calculatedFields = array(
-      'pledge_total_paid' => array('title' => ts('Total Paid')),
+        'pledge_total_paid' => array('title' => ts('Total Paid')),
         'pledge_balance_amount' => array('title' => ts('Balance Amount')),
         'pledge_next_pay_date' => array('title' => ts('Next Payment Date')),
         'pledge_next_pay_amount' => array('title' => ts('Next Payment Amount')),
         'pledge_payment_paid_amount' => array('title' => ts('Paid Amount')),
         'pledge_payment_paid_date' => array('title' => ts('Paid Date')),
         'pledge_payment_status' => array(
-      'title' => ts('Pledge Payment Status'),
+          'title' => ts('Pledge Payment Status'),
           'name' => 'pledge_payment_status',
           'data_type' => CRM_Utils_Type::T_STRING,
         ),
@@ -723,7 +738,7 @@ GROUP BY  currency
 
       $pledgeFields = array(
         'pledge_status' => array(
-      'title' => 'Pledge Status',
+          'title' => 'Pledge Status',
           'name' => 'pledge_status',
           'data_type' => CRM_Utils_Type::T_STRING,
         ),
@@ -772,7 +787,10 @@ GROUP BY  currency
 
     //get pending and in progress status
     foreach (array(
-      'Pending', 'In Progress', 'Overdue') as $name) {
+               'Pending',
+               'In Progress',
+               'Overdue'
+             ) as $name) {
       if ($statusId = array_search($name, $pledgeStatuses)) {
         $status[] = $statusId;
       }
@@ -829,7 +847,10 @@ GROUP BY  currency
 
     //unset statues that we never use for pledges
     foreach (array(
-      'Completed', 'Cancelled', 'Failed') as $statusKey) {
+               'Completed',
+               'Cancelled',
+               'Failed'
+             ) as $statusKey) {
       if ($key = CRM_Utils_Array::key($statusKey, $allStatus)) {
         unset($allStatus[$key]);
       }
@@ -902,7 +923,8 @@ SELECT  pledge.contact_id              as contact_id,
 
       if (CRM_Utils_Date::overdue(CRM_Utils_Date::customFormat($dao->scheduled_date, '%Y%m%d'),
           $now
-        ) && $dao->payment_status != array_search('Overdue', $allStatus)) {
+        ) && $dao->payment_status != array_search('Overdue', $allStatus)
+      ) {
         $pledgePayments[$dao->pledge_id][$dao->payment_id] = $dao->payment_id;
       }
     }
@@ -926,7 +948,7 @@ SELECT  pledge.contact_id              as contact_id,
       // retrieve domain tokens
       $domain = CRM_Core_BAO_Domain::getDomain();
       $tokens = array(
-      'domain' => array('name', 'phone', 'address', 'email'),
+        'domain' => array('name', 'phone', 'address', 'email'),
         'contact' => CRM_Core_SelectValues::contactTokens(),
       );
 
@@ -1111,7 +1133,10 @@ SELECT  pledge.contact_id              as contact_id,
       return TRUE;
     }
 
-    return civicrm_api3('pledge_payment', 'getcount', array('pledge_id' => $pledgeID, 'status_id' => array('IN' => self::getTransactionalStatus())));
+    return civicrm_api3('pledge_payment', 'getcount', array(
+        'pledge_id' => $pledgeID,
+        'status_id' => array('IN' => self::getTransactionalStatus())
+      ));
   }
 
   /**
index 4c2b55d95d4adbec0c72513fa616a3ad2ca03539..0dacaee5a1aec7c0b7b862f609fdd25fb0a85023 100644 (file)
@@ -163,7 +163,7 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock {
 
     $results = NULL;
 
-    $dao     = new CRM_Pledge_DAO_PledgeBlock();
+    $dao = new CRM_Pledge_DAO_PledgeBlock();
     $dao->id = $id;
     $results = $dao->delete();
 
@@ -186,9 +186,9 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock {
   public static function getPledgeBlock($pageID) {
     $pledgeBlock = array();
 
-    $dao               = new CRM_Pledge_DAO_PledgeBlock();
+    $dao = new CRM_Pledge_DAO_PledgeBlock();
     $dao->entity_table = 'civicrm_contribution_page';
-    $dao->entity_id    = $pageID;
+    $dao->entity_id = $pageID;
     if ($dao->find(TRUE)) {
       CRM_Core_DAO::storeValues($dao, $pledgeBlock);
     }
@@ -219,10 +219,10 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock {
       //get all status
       $allStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name');
 
-      $nextPayment     = array();
-      $isNextPayment   = FALSE;
+      $nextPayment = array();
+      $isNextPayment = FALSE;
       $overduePayments = array();
-      $now             = date('Ymd');
+      $now = date('Ymd');
       foreach ($allPayments as $payID => $value) {
         if ($allStatus[$value['status_id']] == 'Overdue') {
           $overduePayments[$payID] = array(
@@ -255,18 +255,18 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock {
       if (!empty($overduePayments)) {
         foreach ($overduePayments as $id => $payment) {
           $key = ts("%1 - due on %2 (overdue)", array(
-              1 => CRM_Utils_Money::format(CRM_Utils_Array::value('scheduled_amount', $payment), CRM_Utils_Array::value('scheduled_amount_currency', $payment)),
-              2 => CRM_Utils_Array::value('scheduled_date', $payment),
-            ));
+            1 => CRM_Utils_Money::format(CRM_Utils_Array::value('scheduled_amount', $payment), CRM_Utils_Array::value('scheduled_amount_currency', $payment)),
+            2 => CRM_Utils_Array::value('scheduled_date', $payment),
+          ));
           $payments[$key] = CRM_Utils_Array::value('id', $payment);
         }
       }
 
       if (!empty($nextPayment)) {
         $key = ts("%1 - due on %2", array(
-            1 => CRM_Utils_Money::format(CRM_Utils_Array::value('scheduled_amount', $nextPayment), CRM_Utils_Array::value('scheduled_amount_currency', $nextPayment)),
-            2 => CRM_Utils_Array::value('scheduled_date', $nextPayment),
-          ));
+          1 => CRM_Utils_Money::format(CRM_Utils_Array::value('scheduled_amount', $nextPayment), CRM_Utils_Array::value('scheduled_amount_currency', $nextPayment)),
+          2 => CRM_Utils_Array::value('scheduled_date', $nextPayment),
+        ));
         $payments[$key] = CRM_Utils_Array::value('id', $nextPayment);
       }
       //give error if empty or build form for payment.
@@ -284,7 +284,7 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock {
 
       //build form for pledge creation.
       $pledgeOptions = array(
-      '0' => ts('I want to make a one-time contribution'),
+        '0' => ts('I want to make a one-time contribution'),
         '1' => ts('I pledge to contribute this amount every'),
       );
       $form->addRadio('is_pledge', ts('Pledge Frequency Interval'), $pledgeOptions,
@@ -300,8 +300,8 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock {
         $form->add('hidden', 'pledge_frequency_interval', 1);
       }
       //Frequency unit drop-down label suffixes switch from *ly to *(s)
-      $freqUnitVals   = explode(CRM_Core_DAO::VALUE_SEPARATOR, $pledgeBlock['pledge_frequency_unit']);
-      $freqUnits      = array();
+      $freqUnitVals = explode(CRM_Core_DAO::VALUE_SEPARATOR, $pledgeBlock['pledge_frequency_unit']);
+      $freqUnits = array();
       $frequencyUnits = CRM_Core_OptionGroup::values('recur_frequency_units');
       foreach ($freqUnitVals as $key => $val) {
         if (array_key_exists($val, $frequencyUnits)) {
index c84430af2f34da851cbd253226bb99012f5a75e0..d5255fa9edb997d810daeac5d1fd3dc036308eb0 100644 (file)
@@ -638,11 +638,11 @@ WHERE  civicrm_pledge.id = %2
    */
   static function updatePledgePayments(
     $pledgeId,
-                                       $paymentStatusId,
-                                       $paymentIds = NULL,
-                                       $actualAmount = 0,
-                                       $contributionId = NULL,
-                                       $isScriptUpdate = FALSE
+    $paymentStatusId,
+    $paymentIds = NULL,
+    $actualAmount = 0,
+    $contributionId = NULL,
+    $isScriptUpdate = FALSE
   ) {
     $allStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name');
     $paymentClause = NULL;
index d8a748c9bf2e9b492f87a27c60fe0c4dffdb8e5b..273e59e4659b8b42c56183992318e37a409100d4 100644 (file)
@@ -102,7 +102,7 @@ class CRM_Pledge_BAO_Query {
     }
 
     if (!empty($query->_returnProperties['pledge_financial_type'])) {
-      $query->_select['pledge_financial_type']  = "(SELECT civicrm_financial_type.name FROM civicrm_financial_type WHERE civicrm_financial_type.id = civicrm_pledge.financial_type_id) as pledge_financial_type";
+      $query->_select['pledge_financial_type'] = "(SELECT civicrm_financial_type.name FROM civicrm_financial_type WHERE civicrm_financial_type.id = civicrm_pledge.financial_type_id) as pledge_financial_type";
       $query->_element['pledge_financial_type'] = 1;
       $query->_tables['civicrm_pledge'] = $query->_whereTables['civicrm_pledge'] = 1;
     }
index 3e2f1436b3f7b2c8df6d063694f287b9806954a4..55b2666ed827c924910b000c8d8d8ca042f91588 100644 (file)
@@ -35,4 +35,5 @@
  * $Id$
  *
  */
-class CRM_Pledge_Config extends CRM_Core_Component_Config {}
+class CRM_Pledge_Config extends CRM_Core_Component_Config {
+}
index 7672c6a3913e5db0d8b8ce27d6503803e92d3661..0295cf3b5550dd7e7989caa66b0ca42139cf09a9 100644 (file)
@@ -106,7 +106,7 @@ class CRM_Pledge_Form_Payment extends CRM_Core_Form {
     );
 
     $optionTypes = array(
-    '1' => ts('Adjust Pledge Payment Schedule?'),
+      '1' => ts('Adjust Pledge Payment Schedule?'),
       '2' => ts('Adjust Total Pledge Amount?'),
     );
     $element = $this->addRadio('option_type',
index 37218ae44c67a6c0d2119b1efa3ce0eb6082c045..f05166f4be1590655e86452618b3dce7b14e70e2 100644 (file)
@@ -97,7 +97,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
     if ($this->_contactID) {
       list($this->userDisplayName,
         $this->userEmail
-      ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contactID);
+        ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contactID);
       $this->assign('displayName', $this->userDisplayName);
     }
 
@@ -183,7 +183,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
       $defaults['max_reminders'] = 1;
       $defaults['additional_reminder_day'] = 5;
       $defaults['frequency_unit'] = array_search('month', $this->_freqUnits);
-      $defaults['financial_type_id']    = array_search('Donation', CRM_Contribute_PseudoConstant::financialType());
+      $defaults['financial_type_id'] = array_search('Donation', CRM_Contribute_PseudoConstant::financialType());
     }
 
     $pledgeStatus = CRM_Contribute_PseudoConstant::contributionStatus();
@@ -197,9 +197,9 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
 
     //assign status.
     $this->assign('status', CRM_Utils_Array::value(CRM_Utils_Array::value('status_id', $this->_values),
-        $pledgeStatus,
-        $defaultPledgeStatus
-      ));
+      $pledgeStatus,
+      $defaultPledgeStatus
+    ));
 
     if (isset($this->userEmail)) {
       $this->assign('email', $this->userEmail);
@@ -235,7 +235,10 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
     }
 
     if ($this->_context == 'standalone') {
-      $this->addEntityRef('contact_id', ts('Contact'), array('create' => TRUE, 'api' => array('extra' => array('email'))), TRUE);
+      $this->addEntityRef('contact_id', ts('Contact'), array(
+          'create' => TRUE,
+          'api' => array('extra' => array('email'))
+        ), TRUE);
     }
 
     $showAdditionalInfo = FALSE;
@@ -249,7 +252,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
     foreach ($paneNames as $name => $type) {
       $urlParams = "snippet=4&formType={$type}";
       $allPanes[$name] = array(
-      'url' => CRM_Utils_System::url('civicrm/contact/view/pledge', $urlParams),
+        'url' => CRM_Utils_System::url('civicrm/contact/view/pledge', $urlParams),
         'open' => 'false',
         'id' => $type,
       );
@@ -330,7 +333,8 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
     $element = &$this->add('select', 'frequency_unit',
       ts('Frequency'),
       array(
-        '' => ts('- select -')) + $freqUnitsDisplay,
+        '' => ts('- select -')
+      ) + $freqUnitsDisplay,
       TRUE
     );
 
@@ -348,7 +352,11 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
       $element->freeze();
     }
 
-    $this->add('text', 'eachPaymentAmount', ts('each'), array('size' => 10, 'style' => "background-color:#EBECE4", 'READONLY'));
+    $this->add('text', 'eachPaymentAmount', ts('each'), array(
+        'size' => 10,
+        'style' => "background-color:#EBECE4",
+        'READONLY'
+      ));
 
     //add various dates
     if (!$this->_id || $this->_isPending) {
@@ -379,8 +387,8 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
     $this->addDate('acknowledge_date', ts('Acknowledgment Date'));
 
     $this->add('select', 'financial_type_id',
-                   ts('Financial Type'),
-                   array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::financialType(),
+      ts('Financial Type'),
+      array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::financialType(),
       TRUE
     );
 
@@ -398,7 +406,8 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
     }
     $ele = $this->add('select', 'contribution_page_id', ts('Self-service Payments Page'),
       array(
-        '' => ts('- select -')) + $pledgePages
+        '' => ts('- select -')
+      ) + $pledgePages
     );
 
     $mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
@@ -609,7 +618,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
       if (!isset($this->userEmail)) {
         list($this->userDisplayName,
           $this->userEmail
-        ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contactID);
+          ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contactID);
       }
 
       $statusMsg .= ' ' . ts("An acknowledgment email has been sent to %1.<br />", array(1 => $this->userEmail));
@@ -626,7 +635,10 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
           "billing_mode IN ( 1, 3 )"
         );
         if (count($processors) > 0) {
-          $statusMsg .= ' ' . ts("If a payment is due now, you can record <a href='%1'>a check, EFT, or cash payment for this pledge</a> OR <a href='%2'>submit a credit card payment</a>.", array(1 => $contribURL, 2 => $creditURL));
+          $statusMsg .= ' ' . ts("If a payment is due now, you can record <a href='%1'>a check, EFT, or cash payment for this pledge</a> OR <a href='%2'>submit a credit card payment</a>.", array(
+                1 => $contribURL,
+                2 => $creditURL
+              ));
         }
         else {
           $statusMsg .= ' ' . ts("If a payment is due now, you can record <a href='%1'>a check, EFT, or cash payment for this pledge</a>.", array(1 => $contribURL));
@@ -639,19 +651,19 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
     if ($this->_context == 'standalone') {
       if ($buttonName == $this->getButtonName('upload', 'new')) {
         $session->replaceUserContext(CRM_Utils_System::url('civicrm/pledge/add',
-            'reset=1&action=add&context=standalone'
-          ));
+          'reset=1&action=add&context=standalone'
+        ));
       }
       else {
         $session->replaceUserContext(CRM_Utils_System::url('civicrm/contact/view',
-            "reset=1&cid={$this->_contactID}&selectedChild=pledge"
-          ));
+          "reset=1&cid={$this->_contactID}&selectedChild=pledge"
+        ));
       }
     }
     elseif ($buttonName == $this->getButtonName('upload', 'new')) {
       $session->replaceUserContext(CRM_Utils_System::url('civicrm/contact/view/pledge',
-          "reset=1&action=add&context=pledge&cid={$this->_contactID}"
-        ));
+        "reset=1&action=add&context=pledge&cid={$this->_contactID}"
+      ));
     }
   }
 }
index aab523ec5f71aa77cd087dd2cc69a0310bddeeb8..1ec293c992821e196f79c263eba3053acf277d5e 100644 (file)
@@ -86,9 +86,9 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form_Search {
      * we allow the controller to set force/reset externally, useful when we are being
      * driven by the wizard framework
      */
-    $this->_reset   = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
-    $this->_force   = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE);
-    $this->_limit   = CRM_Utils_Request::retrieve('limit', 'Positive', $this);
+    $this->_reset = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
+    $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE);
+    $this->_limit = CRM_Utils_Request::retrieve('limit', 'Positive', $this);
     $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'search');
 
     $this->assign("context", $this->_context);
index 72a4ff6bc40cda93d0493f86a5963beadcd21764..b9e4f69fce7df8eb911c2080a3fd0a00bb8ae755 100644 (file)
@@ -102,7 +102,7 @@ class CRM_Pledge_Form_Task extends CRM_Core_Form {
     else {
       $queryParams = $form->get('queryParams');
       $sortOrder = NULL;
-      if ($form->get(CRM_Utils_Sort::SORT_ORDER )) {
+      if ($form->get(CRM_Utils_Sort::SORT_ORDER)) {
         $sortOrder = $form->get(CRM_Utils_Sort::SORT_ORDER);
       }
       $query = new CRM_Contact_BAO_Query($queryParams, NULL, NULL, FALSE, FALSE,
index 45ca526dc803e4e31714445a37ef2e1f4880b97d..a33008b6f8a7d8df9e5dc986c4e3fb529d4b4aca 100644 (file)
@@ -85,7 +85,10 @@ class CRM_Pledge_Form_Task_Delete extends CRM_Pledge_Form_Task {
       }
     }
 
-    $status = ts('Deleted Pledge(s): %1 (Total Selected: %2) ', array(1 => $deletedPledges, 2 => count($this->_pledgeIds)));
+    $status = ts('Deleted Pledge(s): %1 (Total Selected: %2) ', array(
+        1 => $deletedPledges,
+        2 => count($this->_pledgeIds)
+      ));
     CRM_Core_Session::setStatus($status, '', 'info');
   }
 }
index d7e3beab41255a03cd3e07aa607d179d90a86db1..3d6b71f0ab21bca7496e73338a5c1def971ea676 100644 (file)
@@ -98,7 +98,7 @@ class CRM_Pledge_Info extends CRM_Core_Component_Info {
    */
   public function getUserDashboardElement() {
     return array(
-    'name' => ts('Pledges'),
+      'name' => ts('Pledges'),
       'title' => ts('Your Pledge(s)'),
       // we need to check this permission since you can click on contribution page link for making payment
       'perm' => array('make online contributions'),
@@ -119,7 +119,7 @@ class CRM_Pledge_Info extends CRM_Core_Component_Info {
    */
   public function registerTab() {
     return array(
-    'title' => ts('Pledges'),
+      'title' => ts('Pledges'),
       'url' => 'pledge',
       'weight' => 25,
     );
@@ -138,7 +138,7 @@ class CRM_Pledge_Info extends CRM_Core_Component_Info {
    */
   public function registerAdvancedSearchPane() {
     return array(
-    'title' => ts('Pledges'),
+      'title' => ts('Pledges'),
       'weight' => 25,
     );
   }
@@ -169,11 +169,12 @@ class CRM_Pledge_Info extends CRM_Core_Component_Info {
     ) {
       $shortCuts = array_merge($shortCuts, array(
         array(
-      'path' => 'civicrm/pledge/add',
-            'query' => 'reset=1&action=add&context=standalone',
-            'ref' => 'new-pledge',
-            'title' => ts('Pledge'),
-          )));
+          'path' => 'civicrm/pledge/add',
+          'query' => 'reset=1&action=add&context=standalone',
+          'ref' => 'new-pledge',
+          'title' => ts('Pledge'),
+        )
+      ));
     }
   }
 }
index 15df1ad3eac65623560b6491e1e86607a8b9c5db..694b5f1e93bca5d894f4947d07ffde501604dcfa 100755 (executable)
@@ -45,16 +45,16 @@ class CRM_Pledge_Page_AJAX {
 
     $getRecords = FALSE;
     if (isset($_GET['name']) && $_GET['name']) {
-      $name        = CRM_Utils_Type::escape($_GET['name'], 'String');
-      $name        = str_replace('*', '%', $name);
+      $name = CRM_Utils_Type::escape($_GET['name'], 'String');
+      $name = str_replace('*', '%', $name);
       $whereClause = "p.creator_pledge_desc LIKE '%$name%' ";
-      $getRecords  = TRUE;
+      $getRecords = TRUE;
     }
 
     if (isset($_GET['id']) && is_numeric($_GET['id'])) {
-      $pledgeId    = CRM_Utils_Type::escape($_GET['id'], 'Integer');
+      $pledgeId = CRM_Utils_Type::escape($_GET['id'], 'Integer');
       $whereClause = "p.id = {$pledgeId} ";
-      $getRecords  = TRUE;
+      $getRecords = TRUE;
     }
 
     if ($getRecords) {
@@ -79,7 +79,7 @@ WHERE {$whereClause}
         $name = $_GET['id'];
       }
       $elements[] = array(
-      'name' => trim($name, '*'),
+        'name' => trim($name, '*'),
         'value' => trim($name, '*'),
       );
     }
@@ -87,6 +87,7 @@ WHERE {$whereClause}
     echo CRM_Utils_JSON::encode($elements, 'value');
     CRM_Utils_System::civiExit();
   }
+
   /**
    * Function to setDefaults according to Pledge Id
    * for batch entry pledges
index 49573392a7469a0e5e9a6f882a716c8f8885d299..bb803326e67f9e6c11d9d459d5693ddcbf7c72be 100644 (file)
@@ -47,9 +47,9 @@ class CRM_Pledge_Page_DashBoard extends CRM_Core_Page {
   public function preProcess() {
     CRM_Utils_System::setTitle(ts('CiviPledge'));
 
-    $startToDate    = array();
-    $yearToDate     = array();
-    $monthToDate    = array();
+    $startToDate = array();
+    $yearToDate = array();
+    $monthToDate = array();
     $previousToDate = array();
 
     $prefixes = array('start', 'month', 'year', 'previous');
@@ -60,13 +60,13 @@ class CRM_Pledge_Page_DashBoard extends CRM_Core_Page {
     $startDateEnd = NULL;
 
     // current year - prefix = 'year'
-    $config   = CRM_Core_Config::singleton();
+    $config = CRM_Core_Config::singleton();
     $yearDate = $config->fiscalYearStart;
-    $year     = array('Y' => date('Y'));
+    $year = array('Y' => date('Y'));
     $this->assign('curYear', $year['Y']);
-    $yearDate    = array_merge($year, $yearDate);
-    $yearDate    = CRM_Utils_Date::format($yearDate);
-    $yearDate    = $yearDate . '000000';
+    $yearDate = array_merge($year, $yearDate);
+    $yearDate = CRM_Utils_Date::format($yearDate);
+    $yearDate = $yearDate . '000000';
     $yearDateEnd = $year['Y'] . '1231235959';
 
     // current month - prefix = 'month'
@@ -76,15 +76,15 @@ class CRM_Pledge_Page_DashBoard extends CRM_Core_Page {
     $monthDateEnd = CRM_Utils_Date::customFormat(date("Y-m-t", mktime(0, 0, 0, date("m"), 01, date("Y"))), '%Y%m%d') . '235959';
 
     // previous month - prefix = 'previous'
-    $previousDate    = CRM_Utils_Date::customFormat(date("Y-m-d", mktime(0, 0, 0, date("m") - 1, 01, date("Y"))), '%Y%m%d') . '000000';
+    $previousDate = CRM_Utils_Date::customFormat(date("Y-m-d", mktime(0, 0, 0, date("m") - 1, 01, date("Y"))), '%Y%m%d') . '000000';
     $previousDateEnd = CRM_Utils_Date::customFormat(date("Y-m-t", mktime(0, 0, 0, date("m") - 1, 01, date("Y"))), '%Y%m%d') . '235959';
-    $previousMonth   = date("F Y", mktime(0, 0, 0, date("m") - 1, 01, date("Y")));
+    $previousMonth = date("F Y", mktime(0, 0, 0, date("m") - 1, 01, date("Y")));
     $this->assign('previousMonthYear', $previousMonth);
 
     foreach ($prefixes as $prefix) {
-      $aName     = $prefix . 'ToDate';
+      $aName = $prefix . 'ToDate';
       $startName = $prefix . 'Date';
-      $endName   = $prefix . 'DateEnd';
+      $endName = $prefix . 'DateEnd';
       foreach ($status as $s) {
         ${$aName}[str_replace(" ", "", $s)] = CRM_Pledge_BAO_Pledge::getTotalAmountAndCount($s, $$startName, $$endName);
       }
index 83f28780477b67945cb7788c58ad76ddb3afaec1..563de86d56ba93deae7b748b01620bcc4543488c 100644 (file)
@@ -98,9 +98,9 @@ class CRM_Pledge_Page_Tab extends CRM_Core_Page {
   }
 
   public function preProcess() {
-    $context       = CRM_Utils_Request::retrieve('context', 'String', $this);
+    $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
-    $this->_id     = CRM_Utils_Request::retrieve('id', 'Positive', $this);
+    $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
 
     if ($context == 'standalone') {
       $this->_action = CRM_Core_Action::ADD;
index 160d3dd02b8404882db89bd466a8dc80b6d750da..7fe1428f1bcecedafa857de5946bfd31841bd899 100644 (file)
@@ -161,8 +161,8 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base {
     // submitted form values
     $this->_queryParams = &$queryParams;
 
-    $this->_single  = $single;
-    $this->_limit   = $limit;
+    $this->_single = $single;
+    $this->_limit = $limit;
     $this->_context = $context;
 
     $this->_additionalClause = $additionalClause;
index c6e7b31fabb252a25970b915bea05e28cfc08a75..1bb57e9e6c51d44f8c8b1cb9010c06196399e393 100644 (file)
@@ -68,8 +68,8 @@ class CRM_Pledge_Task {
   public static function &tasks() {
     if (!self::$_tasks) {
       self::$_tasks = array(
-      1 => array(
-        'title' => ts('Delete Pledges'),
+        1 => array(
+          'title' => ts('Delete Pledges'),
           'class' => 'CRM_Pledge_Form_Task_Delete',
           'result' => FALSE,
         ),
index 91bdf54c39a8591d1d5ba89347310d1fb171595e..0c1312a7cc75fcb9bd3141840549243561867b1e 100644 (file)
@@ -273,7 +273,7 @@ AND li.entity_id = {$entityId}
    *                          to the price set used for particular event
    * @param array $values
    *   Reference to the values array(.
-  this is
+   * this is
    *                          lineItem array)
    *
    * @return void
@@ -523,7 +523,8 @@ AND li.entity_id = {$entityId}
             $params['is_quick_config'] = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $setID, 'is_quick_config');
           }
           if (!empty($params['is_quick_config']) && array_key_exists('total_amount', $params)
-            && $totalEntityId == 1) {
+            && $totalEntityId == 1
+          ) {
             $values['line_total'] = $values['unit_price'] = $params['total_amount'];
           }
           $values['id'] = $key;
index 242b2ba7bbb0749d9e792e8e61881e294b37cc80..cf92e3d4cfd8539503724f187b95229b052e1500 100644 (file)
@@ -147,7 +147,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
         }
 
         if (CRM_Utils_Array::value($index, CRM_Utils_Array::value('option_financial_type_id', $params))) {
-          $options['financial_type_id'] =  $params['option_financial_type_id'][$index];
+          $options['financial_type_id'] = $params['option_financial_type_id'][$index];
         }
         elseif (!empty($params['financial_type_id'])) {
           $options['financial_type_id'] = $params['financial_type_id'];
@@ -272,7 +272,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
 
     $otherAmount = $qf->get('values');
     $config = CRM_Core_Config::singleton();
-    $currencySymbol = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_Currency',$config->defaultCurrency,'symbol','name');
+    $currencySymbol = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_Currency', $config->defaultCurrency, 'symbol', 'name');
     $qf->assign('currencySymbol', $currencySymbol);
     // get currency name for price field and option attributes
     $currencyName = $config->defaultCurrency;
@@ -312,7 +312,11 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
           $qf->assign('taxTerm', $taxTerm);
           $qf->assign('invoicing', $invoicing);
         }
-        $priceVal = implode($seperator, array($customOption[$optionKey][$valueFieldName] + $taxAmount, $count, $max_value));
+        $priceVal = implode($seperator, array(
+            $customOption[$optionKey][$valueFieldName] + $taxAmount,
+            $count,
+            $max_value
+          ));
 
         $extra = array();
         if (!empty($qf->_quickConfig) && !empty($qf->_contributionAmount)) {
@@ -333,16 +337,16 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
         }
 
         $element = &$qf->add('text', $elementName, $label,
-                   array_merge($extra,
-                     array(
-                       'price' => json_encode(array($optionKey, $priceVal)),
-                       'size' => '4',
-                     )
-                   ),
-                   $useRequired && $field->is_required
+          array_merge($extra,
+            array(
+              'price' => json_encode(array($optionKey, $priceVal)),
+              'size' => '4',
+            )
+          ),
+          $useRequired && $field->is_required
         );
         if ($is_pay_later) {
-          $qf->add('text', 'txt-'.$elementName, $label, array('size' => '4'));
+          $qf->add('text', 'txt-' . $elementName, $label, array('size' => '4'));
         }
 
         // CRM-6902 - Add "max" option for a price set field
@@ -378,14 +382,14 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
             $opt['label'] = !empty($opt['label']) ? $opt['label'] . '&nbsp;-&nbsp;' : '';
             if (isset($taxAmount) && $invoicing) {
               if ($displayOpt == 'Do_not_show') {
-                $opt['label'] =  '<span class="crm-price-amount-label">' . $opt['label'] . '</span>' . '<span class="crm-price-amount-amount">' . CRM_Utils_Money::format($opt[$valueFieldName] + $taxAmount) . '</span>';
+                $opt['label'] = '<span class="crm-price-amount-label">' . $opt['label'] . '</span>' . '<span class="crm-price-amount-amount">' . CRM_Utils_Money::format($opt[$valueFieldName] + $taxAmount) . '</span>';
               }
               elseif ($displayOpt == 'Inclusive') {
                 $opt['label'] = '<span class="crm-price-amount-label">' . $opt['label'] . '</span>' . '<span class="crm-price-amount-amount">' . CRM_Utils_Money::format($opt[$valueFieldName] + $taxAmount) . '</span>';
                 $opt['label'] .= '<span class="crm-price-amount-tax"> (includes ' . $taxTerm . ' of ' . CRM_Utils_Money::format($opt['tax_amount']) . ')</span>';
               }
               else {
-                $opt['label'] =  '<span class="crm-price-amount-label">' . $opt['label'] . '</span>' . '<span class="crm-price-amount-amount">' . CRM_Utils_Money::format($opt[$valueFieldName]) . '</span>';
+                $opt['label'] = '<span class="crm-price-amount-label">' . $opt['label'] . '</span>' . '<span class="crm-price-amount-amount">' . CRM_Utils_Money::format($opt[$valueFieldName]) . '</span>';
                 $opt['label'] .= '<span class="crm-price-amount-tax"> + ' . CRM_Utils_Money::format($opt['tax_amount']) . ' ' . $taxTerm . '</span>';
               }
             }
@@ -397,9 +401,9 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
           $max_value = CRM_Utils_Array::value('max_value', $opt, '');
           $priceVal = implode($seperator, array($opt[$valueFieldName] + $taxAmount, $count, $max_value));
           $extra = array(
-                   'price' => json_encode(array($elementName, $priceVal)),
-                   'data-amount' => $opt[$valueFieldName],
-                   'data-currency' => $currencyName,
+            'price' => json_encode(array($elementName, $priceVal)),
+            'data-amount' => $opt[$valueFieldName],
+            'data-currency' => $currencyName,
           );
           if (!empty($qf->_quickConfig) && $field->name == 'contribution_amount') {
             $extra += array('onclick' => 'clearAmountOther();');
@@ -409,13 +413,13 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
               'onclick' => "return showHideAutoRenew({$opt['membership_type_id']});",
               'membership-type' => $opt['membership_type_id'],
             );
-            $qf->assign('membershipFieldID',$field->id);
+            $qf->assign('membershipFieldID', $field->id);
           }
 
           $choice[$opId] = $qf->createElement('radio', NULL, '', $opt['label'], $opt['id'], $extra);
 
           if ($is_pay_later) {
-            $qf->add('text', 'txt-'.$elementName, $label, array('size' => '4'));
+            $qf->add('text', 'txt-' . $elementName, $label, array('size' => '4'));
           }
 
           // CRM-6902 - Add "max" option for a price set field
@@ -454,7 +458,8 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
 
         // make contribution field required for quick config when membership block is enabled
         if (($field->name == 'membership_amount' || $field->name == 'contribution_amount')
-          && !empty($qf->_membershipBlock) && !$field->is_required) {
+          && !empty($qf->_membershipBlock) && !$field->is_required
+        ) {
           $useRequired = $field->is_required = TRUE;
         }
 
@@ -473,7 +478,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
 
           if ($field->is_display_amounts) {
             $opt['label'] .= '&nbsp;-&nbsp;';
-            if (isset($taxAmount)  && $invoicing) {
+            if (isset($taxAmount) && $invoicing) {
               $opt['label'] = $opt['label'] . self::getTaxLabel($opt, $valueFieldName, $displayOpt, $taxTerm);
             }
             else {
@@ -495,16 +500,17 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
           $selectOption[$opt['id']] = $opt['label'];
 
           if ($is_pay_later) {
-            $qf->add('text', 'txt-'.$elementName, $label, array('size' => '4'));
+            $qf->add('text', 'txt-' . $elementName, $label, array('size' => '4'));
           }
         }
 
         $element = &$qf->add('select', $elementName, $label,
           array(
-            '' => ts('- select -')) + $selectOption,
-            $useRequired && $field->is_required,
-            array('price' => json_encode($priceVal))
-          );
+            '' => ts('- select -')
+          ) + $selectOption,
+          $useRequired && $field->is_required,
+          array('price' => json_encode($priceVal))
+        );
 
         // CRM-6902 - Add "max" option for a price set field
         $button = substr($qf->controller->getButtonName(), -4);
@@ -533,9 +539,9 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
           $priceVal = implode($seperator, array($opt[$valueFieldName] + $taxAmount, $count, $max_value));
           $check[$opId] = &$qf->createElement('checkbox', $opt['id'], NULL, $opt['label'],
             array(
-             'price' => json_encode(array($opt['id'], $priceVal)),
-             'data-amount' => $opt[$valueFieldName],
-             'data-currency' => $currencyName,
+              'price' => json_encode(array($opt['id'], $priceVal)),
+              'data-amount' => $opt[$valueFieldName],
+              'data-currency' => $currencyName,
             )
           );
           if ($is_pay_later) {
@@ -588,7 +594,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
         if (isset($priceFieldValues['financial_type_id']) && array_key_exists($priceFieldValues['financial_type_id'], $taxRates)) {
           $options[$fieldId][$priceFieldId]['tax_rate'] = $taxRates[$priceFieldValues['financial_type_id']];
           $taxAmount = CRM_Contribute_BAO_Contribution_Utils::calculateTaxAmount($priceFieldValues['amount'], $options[$fieldId][$priceFieldId]['tax_rate']);
-          $options[$fieldId][$priceFieldId]['tax_amount'] = round($taxAmount['tax_amount'],2);
+          $options[$fieldId][$priceFieldId]['tax_amount'] = round($taxAmount['tax_amount'], 2);
         }
       }
     }
@@ -620,7 +626,10 @@ WHERE
     AND option_group.id = option_value.option_group_id
     AND option_value.label = %2";
 
-    $dao = CRM_Core_DAO::executeQuery($query, array(1 => array($optionGroupName, 'String'), 2 => array($optionLabel, 'String')));
+    $dao = CRM_Core_DAO::executeQuery($query, array(
+        1 => array($optionGroupName, 'String'),
+        2 => array($optionLabel, 'String')
+      ));
 
     while ($dao->fetch()) {
       return $dao->id;
index 2c26b8b44868d0a9a8a51ccf5c4ff0f7c85170d4..3acc7f2f28ebd9993944f687a04a8bedfe59098c 100644 (file)
@@ -88,7 +88,7 @@ class CRM_Price_BAO_PriceFieldValue extends CRM_Price_DAO_PriceFieldValue {
       $params['name'] = strtolower(CRM_Utils_String::munge($params['label'], '_', 242));
     }
 
-    if ($id  && !empty($params['weight'])) {
+    if ($id && !empty($params['weight'])) {
       if (isset($params['name'])) {
         unset($params['name']);
       }
index c6d0c1668e9b937cf3e619cae04b2e8b84ff43b3..5f37574076f4eb256ebe4cf8900ab8d861f55b36 100644 (file)
@@ -142,14 +142,14 @@ WHERE       ps.name = '{$entityName}'
     self::$_defaultPriceSet[$entity] = array();
     while ($dao->fetch()) {
       self::$_defaultPriceSet[$entity][$dao->priceFieldValueID] = array(
-       'setID' => $dao->setID,
-       'priceFieldID' => $dao->priceFieldID,
-       'name' => $dao->name,
-       'label' => $dao->label,
-       'priceFieldValueID' => $dao->priceFieldValueID,
-       'membership_type_id' => $dao->membership_type_id,
-       'amount' => $dao->amount,
-       'financial_type_id' => $dao->financial_type_id,
+        'setID' => $dao->setID,
+        'priceFieldID' => $dao->priceFieldID,
+        'name' => $dao->name,
+        'label' => $dao->label,
+        'priceFieldValueID' => $dao->priceFieldValueID,
+        'membership_type_id' => $dao->membership_type_id,
+        'amount' => $dao->amount,
+        'financial_type_id' => $dao->financial_type_id,
       );
     }
 
@@ -357,9 +357,9 @@ WHERE     ct.id = cp.financial_type_id AND
    * @return mixed
    */
   public static function removeFrom($entityTable, $entityId) {
-    $dao               = new CRM_Price_DAO_PriceSetEntity();
+    $dao = new CRM_Price_DAO_PriceSetEntity();
     $dao->entity_table = $entityTable;
-    $dao->entity_id    = $entityId;
+    $dao->entity_id = $entityId;
     return $dao->delete();
   }
 
@@ -390,8 +390,8 @@ WHERE     ct.id = cp.financial_type_id AND
       $sql .= ' AND ps.is_quick_config = 0 ';
     }
     $params = array(
-    1 => array($entityTable, 'String'),
-              2 => array($entityId, 'Integer'),
+      1 => array($entityTable, 'String'),
+      2 => array($entityId, 'Integer'),
     );
     if ($usedFor) {
       $sql .= " AND ps.extends LIKE '%%3%' ";
@@ -525,9 +525,9 @@ WHERE     ct.id = cp.financial_type_id AND
     $select = 'SELECT ' . implode(',', $priceFields);
     $from = ' FROM civicrm_price_field';
 
-    $params    = array();
+    $params = array();
     $params[1] = array($setID, 'Integer');
-    $where     = '
+    $where = '
 WHERE price_set_id = %1
 AND is_active = 1
 ';
@@ -832,8 +832,8 @@ WHERE  id = %1";
             $params['amount_priceset_level_checkbox']["{$field['options'][$optionId]['id']}"] = $optionLabel;
             if (isset($checkboxLevel)) {
               $checkboxLevel = array_unique(array_merge(
-                $checkboxLevel,
-                array_keys($params['amount_priceset_level_checkbox'])
+                  $checkboxLevel,
+                  array_keys($params['amount_priceset_level_checkbox'])
                 )
               );
             }
@@ -908,12 +908,14 @@ WHERE  id = %1";
     $validFieldsOnly = TRUE;
     $className = CRM_Utils_System::getClassName($form);
     if (in_array($className, array(
-          'CRM_Contribute_Form_Contribution', 'CRM_Member_Form_Membership'))) {
+      'CRM_Contribute_Form_Contribution',
+      'CRM_Member_Form_Membership'
+    ))) {
       $validFieldsOnly = FALSE;
     }
 
-    $priceSet           = self::getSetDetail($priceSetId, TRUE, $validFieldsOnly);
-    $form->_priceSet    = CRM_Utils_Array::value($priceSetId, $priceSet);
+    $priceSet = self::getSetDetail($priceSetId, TRUE, $validFieldsOnly);
+    $form->_priceSet = CRM_Utils_Array::value($priceSetId, $priceSet);
     $validPriceFieldIds = array_keys($form->_priceSet['fields']);
     $form->_quickConfig = $quickConfig = 0;
     if (CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config')) {
@@ -1080,6 +1082,7 @@ WHERE  id = %1";
       //}
     }
   }
+
   /**
    * Get field ids of a price set
    *
@@ -1117,21 +1120,21 @@ WHERE  id = %1";
     $title = ts('[Copy id %1]', array(1 => $maxId + 1));
     $fieldsFix = array(
       'suffix' => array(
-    'title' => ' ' . $title,
-                'name' => '__Copy_id_' . ($maxId + 1) . '_',
+        'title' => ' ' . $title,
+        'name' => '__Copy_id_' . ($maxId + 1) . '_',
       ),
     );
 
     $copy = &CRM_Core_DAO::copyGeneric('CRM_Price_DAO_PriceSet',
-            array('id' => $id),
-            NULL,
-            $fieldsFix
+      array('id' => $id),
+      NULL,
+      $fieldsFix
     );
 
     //copying all the blocks pertaining to the price set
     $copyPriceField = &CRM_Core_DAO::copyGeneric('CRM_Price_DAO_PriceField',
-                      array('price_set_id' => $id),
-                      array('price_set_id' => $copy->id)
+      array('price_set_id' => $id),
+      array('price_set_id' => $copy->id)
     );
     if (!empty($copyPriceField)) {
       $price = array_combine(self::getFieldIds($id), self::getFieldIds($copy->id));
@@ -1256,9 +1259,9 @@ GROUP BY     mt.member_of_contact_id";
 
     $params = array(1 => array($priceSetId, 'Integer'));
 
-    $dao             = CRM_Core_DAO::executeQuery($query, $params);
+    $dao = CRM_Core_DAO::executeQuery($query, $params);
     $autoRenewOption = 2;
-    $interval        = $unit = array();
+    $interval = $unit = array();
     while ($dao->fetch()) {
       if (!$dao->auto_renew) {
         $autoRenewOption = 0;
@@ -1337,7 +1340,7 @@ GROUP BY     mt.member_of_contact_id";
    */
   public static function checkMembershipPriceSet($id) {
     $query =
-    "
+      "
 SELECT      pfv.id, pfv.price_field_id, pfv.name, pfv.membership_type_id, pf.html_type, mt.auto_renew
 FROM        civicrm_price_field_value pfv
 LEFT JOIN   civicrm_price_field pf ON pf.id = pfv.price_field_id
index a1446e30550511c0a9dc0006bf38e90e9ddf22ba..d3c330a02ab155eae4cde214ec41ba255bbcd123 100644 (file)
@@ -95,13 +95,13 @@ class CRM_Price_Form_DeleteSet extends CRM_Core_Form {
   public function postProcess() {
     if (CRM_Price_BAO_PriceSet::deleteSet($this->_sid)) {
       CRM_Core_Session::setStatus(ts('The Price Set \'%1\' has been deleted.',
-          array(1 => $this->_title), ts('Deleted'), 'success'
-        ));
+        array(1 => $this->_title), ts('Deleted'), 'success'
+      ));
     }
     else {
       CRM_Core_Session::setStatus(ts('The Price Set \'%1\' has not been deleted! You must delete all price fields in this set prior to deleting the set.',
-          array(1 => $this->_title)
-        ), 'Unable to Delete', 'error');
+        array(1 => $this->_title)
+      ), 'Unable to Delete', 'error');
     }
   }
 }
index 421d9985adc0465068d8c60cf2e266aa003b7c9b..388e37e5567497dff6f610383695c0e9d58afc85 100644 (file)
@@ -80,7 +80,7 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
 
     $this->_sid = CRM_Utils_Request::retrieve('sid', 'Positive', $this, FALSE, NULL, 'REQUEST');
     $this->_fid = CRM_Utils_Request::retrieve('fid', 'Positive', $this, FALSE, NULL, 'REQUEST');
-    $url        = CRM_Utils_System::url('civicrm/admin/price/field', "reset=1&action=browse&sid={$this->_sid}");
+    $url = CRM_Utils_System::url('civicrm/admin/price/field', "reset=1&action=browse&sid={$this->_sid}");
     $breadCrumb = array(array('title' => ts('Price Set Fields'), 'url' => $url));
 
     $this->_extendComponentId = array();
@@ -125,13 +125,13 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
       if (!empty($defaults['active_on'])) {
         list($defaults['active_on'],
           $defaults['active_on_time']
-        ) = CRM_Utils_Date::setDateDefaults($defaults['active_on'], 'activityDateTime');
+          ) = CRM_Utils_Date::setDateDefaults($defaults['active_on'], 'activityDateTime');
       }
 
       if (!empty($defaults['expire_on'])) {
         list($defaults['expire_on'],
           $defaults['expire_on_time']
-        ) = CRM_Utils_Date::setDateDefaults($defaults['expire_on'], 'activityDateTime');
+          ) = CRM_Utils_Date::setDateDefaults($defaults['expire_on'], 'activityDateTime');
       }
     }
     else {
@@ -151,7 +151,7 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
     $enabledComponents = CRM_Core_Component::getEnabledComponents();
     $eventComponentId = NULL;
     if (array_key_exists('CiviEvent', $enabledComponents)) {
-      $eventComponentId  = CRM_Core_Component::getComponentID('CiviEvent');
+      $eventComponentId = CRM_Core_Component::getComponentID('CiviEvent');
     }
 
     if (isset($this->_sid) && $this->_action == CRM_Core_Action::ADD) {
@@ -198,13 +198,13 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
     $enabledComponents = CRM_Core_Component::getEnabledComponents();
     $eventComponentId = $memberComponentId = NULL;
     if (array_key_exists('CiviEvent', $enabledComponents)) {
-      $eventComponentId  = CRM_Core_Component::getComponentID('CiviEvent');
+      $eventComponentId = CRM_Core_Component::getComponentID('CiviEvent');
     }
     if (array_key_exists('CiviMember', $enabledComponents)) {
       $memberComponentId = CRM_Core_Component::getComponentID('CiviMember');
     }
 
-    $attributes        = CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceFieldValue');
+    $attributes = CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceFieldValue');
 
     $this->add('select', 'financial_type_id',
       ts('Financial Type'),
@@ -292,8 +292,9 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
 
         $this->add('select', 'membership_type_id[' . $i . ']', ts('Membership Type'),
           array(
-            '' => ' ') + $membershipTypes, FALSE, $js
-          );
+            '' => ' '
+          ) + $membershipTypes, FALSE, $js
+        );
         $this->add('text', 'membership_num_terms[' . $i . ']', ts('Number of Terms'), CRM_Utils_Array::value('membership_num_terms', $attributes));
       }
 
@@ -412,7 +413,8 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
     }
 
     if (($form->_action & CRM_Core_Action::ADD || $form->_action & CRM_Core_Action::UPDATE) &&
-         $fields['html_type'] == 'Text' && $fields['financial_type_id'] == '') {
+      $fields['html_type'] == 'Text' && $fields['financial_type_id'] == ''
+    ) {
       $errors['financial_type_id'] = ts('Financial Type is a required field');
     }
 
@@ -616,7 +618,7 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
     $params['is_display_amounts'] = CRM_Utils_Array::value('is_display_amounts', $params, FALSE);
     $params['is_required'] = CRM_Utils_Array::value('is_required', $params, FALSE);
     $params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE);
-    $params['financial_type_id']  = CRM_Utils_Array::value('financial_type_id', $params, FALSE);
+    $params['financial_type_id'] = CRM_Utils_Array::value('financial_type_id', $params, FALSE);
     if (isset($params['active_on'])) {
       $params['active_on'] = CRM_Utils_Date::processDate($params['active_on'],
         CRM_Utils_Array::value('active_on_time', $params),
index bba1a6748eca1574e22fd05f12c900d5aa79c149..7c633e60ae427afcaac614ec7c39896d423a28bc 100644 (file)
@@ -135,7 +135,7 @@ class CRM_Price_Form_Option extends CRM_Core_Form {
       return;
     }
     else {
-      $attributes        = CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceFieldValue');
+      $attributes = CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceFieldValue');
       // lets trim all the whitespace
       $this->applyFilter('__ALL__', 'trim');
 
@@ -166,7 +166,8 @@ class CRM_Price_Form_Option extends CRM_Core_Form {
         $this->assign('showMember', TRUE);
         $membershipTypes = CRM_Member_PseudoConstant::membershipType();
         $this->add('select', 'membership_type_id', ts('Membership Type'), array(
-          '' => ' ') + $membershipTypes, FALSE,
+            '' => ' '
+          ) + $membershipTypes, FALSE,
           array('onClick' => "calculateRowValues( );")
         );
         $this->add('text', 'membership_num_terms', ts('Number of Terms'), $attributes['membership_num_terms']);
@@ -301,8 +302,8 @@ class CRM_Price_Form_Option extends CRM_Core_Form {
   public function postProcess() {
     if ($this->_action == CRM_Core_Action::DELETE) {
       $fieldValues = array('price_field_id' => $this->_fid);
-      $wt          = CRM_Utils_Weight::delWeight('CRM_Price_DAO_PriceFieldValue', $this->_oid, $fieldValues);
-      $label       = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue',
+      $wt = CRM_Utils_Weight::delWeight('CRM_Price_DAO_PriceFieldValue', $this->_oid, $fieldValues);
+      $label = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue',
         $this->_oid,
         'label', 'id'
       );
@@ -313,8 +314,8 @@ class CRM_Price_Form_Option extends CRM_Core_Form {
       return;
     }
     else {
-      $params     = $ids = array();
-      $params     = $this->controller->exportValues('Option');
+      $params = $ids = array();
+      $params = $this->controller->exportValues('Option');
       $fieldLabel = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $this->_fid, 'label');
 
       $params['amount'] = CRM_Utils_Rule::cleanMoney(trim($params['amount']));
index dffbba2d82fe057c8b1a8ede705cb122a22b066e..c69b635b8902372da60584b7a6162de33b7c18f4 100644 (file)
@@ -69,10 +69,12 @@ class CRM_Price_Form_Preview extends CRM_Core_Form {
       $this->_groupTree[$groupId]['fields'][$fieldId] = $groupTree[$groupId]['fields'][$fieldId];
       $this->assign('preview_type', 'field');
       $url = CRM_Utils_System::url('civicrm/admin/price/field', "reset=1&action=browse&sid={$groupId}");
-      $breadCrumb = array(array(
-      'title' => ts('Price Set Fields'),
+      $breadCrumb = array(
+        array(
+          'title' => ts('Price Set Fields'),
           'url' => $url,
-        ));
+        )
+      );
     }
     else {
       // group preview
@@ -80,10 +82,12 @@ class CRM_Price_Form_Preview extends CRM_Core_Form {
       $this->assign('preview_type', 'group');
       $this->assign('setTitle', CRM_Price_BAO_PriceSet::getTitle($groupId));
       $url = CRM_Utils_System::url('civicrm/admin/price', 'reset=1');
-      $breadCrumb = array(array(
-      'title' => ts('Price Sets'),
+      $breadCrumb = array(
+        array(
+          'title' => ts('Price Sets'),
           'url' => $url,
-        ));
+        )
+      );
     }
     CRM_Utils_System::appendBreadCrumb($breadCrumb);
   }
@@ -98,8 +102,8 @@ class CRM_Price_Form_Preview extends CRM_Core_Form {
    */
   public function setDefaultValues() {
     $defaults = array();
-    $groupId  = $this->get('groupId');
-    $fieldId  = $this->get('fieldId');
+    $groupId = $this->get('groupId');
+    $fieldId = $this->get('fieldId');
     if (!empty($this->_groupTree[$groupId]['fields'])) {
       foreach ($this->_groupTree[$groupId]['fields'] as $key => $val) {
         foreach ($val['options'] as $keys => $values) {
index de01dfa6baed3e7af3e9f28ff9ca82790b490c11..7f57e50e06f5a502ab759fae46b3b173e1907a7b 100644 (file)
@@ -70,10 +70,12 @@ class CRM_Price_Form_Set extends CRM_Core_Form {
     CRM_Utils_System::setTitle($title);
 
     $url = CRM_Utils_System::url('civicrm/admin/price', 'reset=1');
-    $breadCrumb = array(array(
-    'title' => ts('Price Sets'),
+    $breadCrumb = array(
+      array(
+        'title' => ts('Price Sets'),
         'url' => $url,
-      ));
+      )
+    );
     CRM_Utils_System::appendBreadCrumb($breadCrumb);
   }
 
@@ -132,7 +134,7 @@ class CRM_Price_Form_Set extends CRM_Core_Form {
       $priceSetUsedTables = CRM_Price_BAO_PriceSet::getUsedBy($this->_sid, 'table');
     }
 
-    $config           = CRM_Core_Config::singleton();
+    $config = CRM_Core_Config::singleton();
     $showContribution = FALSE;
     $enabledComponents = CRM_Core_Component::getEnabledComponents();
 
@@ -195,7 +197,7 @@ class CRM_Price_Form_Set extends CRM_Core_Form {
 
     $this->add('select', 'financial_type_id',
       ts('Default Financial Type'),
-          array('' => ts('- select -')) + $financialType, 'required'
+      array('' => ts('- select -')) + $financialType, 'required'
     );
 
     // help text
@@ -296,10 +298,15 @@ class CRM_Price_Form_Set extends CRM_Core_Form {
     else {
       // 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));
+      $url = CRM_Utils_System::url('civicrm/admin/price/field', array(
+          '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');
+        array(1 => $set->title)
+      ), ts('Saved'), 'success');
       $session = CRM_Core_Session::singleton();
       $session->replaceUserContext($url);
     }
index c87e338c3c02765792409717a0299f666dac2fcd..a6513dafdd20268d3694df84a37b6a8882b6fd76 100644 (file)
@@ -123,7 +123,7 @@ class CRM_Price_Page_Field extends CRM_Core_Page {
       $resourceManager->addScriptFile('civicrm', 'js/crm.addNew.js', 999, 'html-header');
     }
 
-    $priceField    = array();
+    $priceField = array();
     $priceFieldBAO = new CRM_Price_BAO_PriceField();
 
     // fkey is sid
@@ -218,7 +218,6 @@ class CRM_Price_Page_Field extends CRM_Core_Page {
    *
    * @param string $action
    *   The action to be invoked.
-
    *
    * @return void
    */
index 79be0c9ffb16512f81079ef571578c19d568c315..d6f7eddf9522032f2a82922ddf2fb7136551425e 100644 (file)
@@ -219,8 +219,8 @@ class CRM_Price_Page_Option extends CRM_Core_Page {
     $session = CRM_Core_Session::singleton();
 
     $session->pushUserContext(CRM_Utils_System::url('civicrm/admin/price/field/option',
-        "reset=1&action=browse&fid={$this->_fid}&sid={$this->_sid}"
-      ));
+      "reset=1&action=browse&fid={$this->_fid}&sid={$this->_sid}"
+    ));
     $controller = new CRM_Core_Controller_Simple('CRM_Price_Form_Option', ts('Price Field Option'), $action);
     $controller->set('fid', $this->_fid);
     $controller->setEmbedded(TRUE);
@@ -276,10 +276,12 @@ class CRM_Price_Page_Option extends CRM_Core_Page {
       $this->assign('isReserved', $this->_isSetReserved);
     }
     //as url contain $sid so append breadcrumb dynamically.
-    $breadcrumb = array(array(
-    'title' => ts('Price Fields'),
+    $breadcrumb = array(
+      array(
+        'title' => ts('Price Fields'),
         'url' => CRM_Utils_System::url('civicrm/admin/price/field', 'reset=1&sid=' . $this->_sid),
-      ));
+      )
+    );
     CRM_Utils_System::appendBreadCrumb($breadcrumb);
 
     if ($this->_fid) {
@@ -311,7 +313,8 @@ class CRM_Price_Page_Option extends CRM_Core_Page {
     // what action to take ?
     if ($action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD |
         CRM_Core_Action::VIEW | CRM_Core_Action::DELETE
-      ) && !$this->_isSetReserved) {
+      ) && !$this->_isSetReserved
+    ) {
       // no browse for edit/update/view
       $this->edit($action);
     }
index a5963aa6c554b3593873fe8db41d0dabfa1bf559..68d0f273fc9c53725f27a5880960777e63c89049 100644 (file)
@@ -230,8 +230,8 @@ class CRM_Price_Page_Set extends CRM_Core_Page {
    */
   public function preview($sid) {
     $controller = new CRM_Core_Controller_Simple('CRM_Price_Form_Preview', ts('Preview Price Set'), NULL);
-    $session    = CRM_Core_Session::singleton();
-    $context    = CRM_Utils_Request::retrieve('context', 'String', $this);
+    $session = CRM_Core_Session::singleton();
+    $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     if ($context == 'field') {
       $session->pushUserContext(CRM_Utils_System::url('civicrm/admin/price/field', "action=browse&sid={$sid}"));
     }
@@ -256,7 +256,7 @@ class CRM_Price_Page_Set extends CRM_Core_Page {
     // get all price sets
     $priceSet = array();
     $comps = array(
-    'CiviEvent' => ts('Event'),
+      'CiviEvent' => ts('Event'),
       'CiviContribute' => ts('Contribution'),
       'CiviMember' => ts('Membership'),
     );
index 5533c3d6915dadfec1350b761c9902b300974b33..e68ad1e87de13aaa5ebbadcfb92984a65ad07e82 100644 (file)
@@ -44,9 +44,9 @@
 class CRM_Profile_Form extends CRM_Core_Form {
   const
     MODE_REGISTER = 1,
-    MODE_SEARCH   = 2,
-    MODE_CREATE   = 4,
-    MODE_EDIT     = 8;
+    MODE_SEARCH = 2,
+    MODE_CREATE = 4,
+    MODE_EDIT = 8;
 
   protected $_mode;
 
@@ -174,7 +174,7 @@ class CRM_Profile_Form extends CRM_Core_Form {
   protected $_customGroupId = NULL;
 
   protected $_currentUserID = NULL;
-  protected $_session       = NULL;
+  protected $_session = NULL;
 
   /**
    * Pre processing work done here.
@@ -186,10 +186,10 @@ class CRM_Profile_Form extends CRM_Core_Form {
    * @return void
    */
   public function preProcess() {
-    $this->_id         = $this->get('id');
+    $this->_id = $this->get('id');
     $this->_profileIds = $this->get('profileIds');
-    $this->_grid       = CRM_Utils_Request::retrieve('grid', 'Integer', $this);
-    $this->_context    = CRM_Utils_Request::retrieve('context', 'String', $this);
+    $this->_grid = CRM_Utils_Request::retrieve('grid', 'Integer', $this);
+    $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
 
     //unset from session when $_GET doesn't have it
     //except when the form is submitted
@@ -214,7 +214,8 @@ class CRM_Profile_Form extends CRM_Core_Form {
       }
 
       if ($this->_multiRecord &&
-          !in_array($this->_multiRecord, array(CRM_Core_Action::UPDATE, CRM_Core_Action::ADD, CRM_Core_Action::DELETE))) {
+        !in_array($this->_multiRecord, array(CRM_Core_Action::UPDATE, CRM_Core_Action::ADD, CRM_Core_Action::DELETE))
+      ) {
         CRM_Core_Error::fatal(ts('Proper action not specified for this custom value record profile'));
       }
     }
@@ -315,7 +316,8 @@ class CRM_Profile_Form extends CRM_Core_Form {
           }
           //record id is neccessary for _multiRecord view and update/edit action
           if (!$this->_recordId
-              && ($this->_multiRecord == CRM_Core_Action::UPDATE || $this->_multiRecord == CRM_Core_Action::DELETE)) {
+            && ($this->_multiRecord == CRM_Core_Action::UPDATE || $this->_multiRecord == CRM_Core_Action::DELETE)
+          ) {
             CRM_Core_Error::fatal(ts('The requested Profile (gid=%1) requires record id while performing this action',
               array(1 => $this->_gid)
             ));
@@ -357,7 +359,11 @@ class CRM_Profile_Form extends CRM_Core_Form {
 
         }
         elseif (!empty($this->_multiRecordFields)
-           && (!$this->_multiRecord || !in_array($this->_multiRecord, array(CRM_Core_Action::DELETE, CRM_Core_Action::UPDATE)))) {
+          && (!$this->_multiRecord || !in_array($this->_multiRecord, array(
+                CRM_Core_Action::DELETE,
+                CRM_Core_Action::UPDATE
+              )))
+        ) {
           CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js', 1, 'html-header');
           //multirecord listing page
           $multiRecordFieldListing = TRUE;
@@ -486,8 +492,8 @@ class CRM_Profile_Form extends CRM_Core_Form {
           if ($htmlType == 'File') {
             $entityId = $this->_id;
             if (CRM_Utils_Array::value('field_type', $field) == 'Activity' &&
-                $this->_activityId
-                ) {
+              $this->_activityId
+            ) {
               $entityId = $this->_activityId;
             }
             $url = CRM_Core_BAO_CustomField::getFileURL($entityId, $key);
@@ -496,10 +502,10 @@ class CRM_Profile_Form extends CRM_Core_Form {
               $customFiles[$name]['displayURL'] = ts("Attached File") . ": {$url['file_url']}";
 
               $deleteExtra = ts("Are you sure you want to delete attached file?");
-              $fileId      = $url['file_id'];
-              $deleteURL   = CRM_Utils_System::url('civicrm/file',
-                             "reset=1&id={$fileId}&eid=$entityId&fid={$key}&action=delete"
-                           );
+              $fileId = $url['file_id'];
+              $deleteURL = CRM_Utils_System::url('civicrm/file',
+                "reset=1&id={$fileId}&eid=$entityId&fid={$key}&action=delete"
+              );
               $text = ts("Delete Attached File");
               $customFiles[$field['name']]['deleteURL'] = "<a href=\"{$deleteURL}\" onclick = \"if (confirm( ' $deleteExtra ' )) this.href+='&amp;confirmed=1'; else return false;\">$text</a>";
 
@@ -515,8 +521,8 @@ class CRM_Profile_Form extends CRM_Core_Form {
         if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($name)) {
           $htmlType = $field['html_type'];
           if ((!isset($this->_defaults[$name]) || $htmlType == 'File') &&
-              (CRM_Utils_Array::value('field_type', $field) != 'Activity')
-              ) {
+            (CRM_Utils_Array::value('field_type', $field) != 'Activity')
+          ) {
             CRM_Core_BAO_CustomField::setProfileDefaults($customFieldID,
               $name,
               $this->_defaults,
@@ -536,9 +542,9 @@ class CRM_Profile_Form extends CRM_Core_Form {
               $customFiles[$field['name']]['displayURL'] = ts("Attached File") . ": {$url['file_url']}";
 
               $deleteExtra = ts("Are you sure you want to delete attached file?");
-              $fileId      = $url['file_id'];
-              $deleteURL   = CRM_Utils_System::url('civicrm/file',
-                 "reset=1&id={$fileId}&eid=$entityId&fid={$customFieldID}&action=delete"
+              $fileId = $url['file_id'];
+              $deleteURL = CRM_Utils_System::url('civicrm/file',
+                "reset=1&id={$fileId}&eid=$entityId&fid={$customFieldID}&action=delete"
               );
               $text = ts("Delete Attached File");
               $customFiles[$field['name']]['deleteURL'] = "<a href=\"{$deleteURL}\" onclick = \"if (confirm( ' $deleteExtra ' )) this.href+='&amp;confirmed=1'; else return false;\">$text</a>";
@@ -643,7 +649,7 @@ class CRM_Profile_Form extends CRM_Core_Form {
 
       if ($this->_id) {
         $contactTypes = CRM_Contact_BAO_Contact::getContactTypes($this->_id);
-        $contactType  = $contactTypes[0];
+        $contactType = $contactTypes[0];
 
         array_shift($contactTypes);
         $contactSubtypes = $contactTypes;
@@ -669,10 +675,10 @@ class CRM_Profile_Form extends CRM_Core_Form {
       }
 
       if (
-        in_array(
-          $profileType,
-          array("Membership", "Participant", "Contribution")
-        )
+      in_array(
+        $profileType,
+        array("Membership", "Participant", "Contribution")
+      )
       ) {
         $return = TRUE;
         if (!$statusMessage) {
@@ -723,7 +729,7 @@ class CRM_Profile_Form extends CRM_Core_Form {
     if (!$this->_currentUserID) {
       $defaultLocationType = CRM_Core_BAO_LocationType::getDefault();
       $primaryLocationType = $defaultLocationType->id;
-      $anonUser            = TRUE;
+      $anonUser = TRUE;
     }
     $this->assign('anonUser', $anonUser);
 
@@ -957,12 +963,21 @@ class CRM_Profile_Form extends CRM_Core_Form {
             $contactLinks = CRM_Contact_BAO_Contact_Utils::formatContactIDSToLinks($ids, TRUE, TRUE);
 
             $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 />'));
+            $duplicateContactsLinks .= ts('One matching contact was found. ', array(
+                '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.'));
+              $duplicateContactsLinks .= ts('You can View the existing contact.', array(
+                  '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.'));
+              $duplicateContactsLinks .= ts('You can View or Edit the existing contact.', array(
+                  'count' => count($contactLinks['rows']),
+                  'plural' => 'You can View or Edit the existing contacts.'
+                ));
             }
             $duplicateContactsLinks .= '</div>';
             $duplicateContactsLinks .= '<table class="matching-contacts-actions">';
@@ -1013,8 +1028,8 @@ class CRM_Profile_Form extends CRM_Core_Form {
           if ($stateProvinceDAO->country_id != $countryId) {
             // country mismatch hence display error
             $stateProvinces = CRM_Core_PseudoConstant::stateProvince();
-            $countries      = CRM_Core_PseudoConstant::country();
-            $errors[$key]   = "State/Province " . $stateProvinces[$stateProvinceId] . " is not part of " . $countries[$countryId] . ". It belongs to " . $countries[$stateProvinceDAO->country_id] . ".";
+            $countries = CRM_Core_PseudoConstant::country();
+            $errors[$key] = "State/Province " . $stateProvinces[$stateProvinceId] . " is not part of " . $countries[$countryId] . ". It belongs to " . $countries[$stateProvinceDAO->country_id] . ".";
           }
         }
       }
@@ -1032,8 +1047,8 @@ class CRM_Profile_Form extends CRM_Core_Form {
           if ($countyDAO->state_province_id != $stateProvinceId) {
             // state province mismatch hence display error
             $stateProvinces = CRM_Core_PseudoConstant::stateProvince();
-            $counties       = CRM_Core_PseudoConstant::county();
-            $errors[$key]   = "County " . $counties[$countyId] . " is not part of " . $stateProvinces[$stateProvinceId] . ". It belongs to " . $stateProvinces[$countyDAO->state_province_id] . ".";
+            $counties = CRM_Core_PseudoConstant::county();
+            $errors[$key] = "County " . $counties[$countyId] . " is not part of " . $stateProvinces[$stateProvinceId] . ". It belongs to " . $stateProvinces[$countyDAO->state_province_id] . ".";
           }
         }
       }
@@ -1071,9 +1086,9 @@ class CRM_Profile_Form extends CRM_Core_Form {
           if ($tableName = CRM_Utils_Array::value('table_name', $returnValues)) {
             $sql = "DELETE FROM {$tableName} WHERE id = %1 AND entity_id = %2";
             $sqlParams = array(
-                          1 => array($this->_recordId, 'Integer'),
-                          2 => array($this->_id, 'Integer'),
-                         );
+              1 => array($this->_recordId, 'Integer'),
+              2 => array($this->_id, 'Integer'),
+            );
             CRM_Core_DAO::executeQuery($sql, $sqlParams);
             CRM_Core_Session::setStatus(ts('Your record has been deleted.'), ts('Deleted'), 'success');
           }
@@ -1100,8 +1115,9 @@ class CRM_Profile_Form extends CRM_Core_Form {
       $details = $contactDetails[0][$this->_id];
     }
     if (!(!empty($details['addressee_id']) || !empty($details['email_greeting_id']) ||
-        CRM_Utils_Array::value('postal_greeting_id', $details)
-      )) {
+      CRM_Utils_Array::value('postal_greeting_id', $details)
+    )
+    ) {
 
       $profileType = CRM_Core_BAO_UFField::getProfileType($this->_gid);
       //Though Profile type is contact we need
@@ -1305,8 +1321,8 @@ class CRM_Profile_Form extends CRM_Core_Form {
         CRM_Core_Error::debug_log_message("Rolling back transaction as CMSUser Create failed in Profile_Form for contact " . $params['contactID']);
         $transaction->rollback();
         return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/profile/create',
-            'reset=1&gid=' . $this->_gid
-          ));
+          'reset=1&gid=' . $this->_gid
+        ));
       }
     }
 
index 5f9cf1cfe4123e3c968cff91c9e6741a8ab3c9a0..a570ff68b7eef046f73502ba79b68cbc34028f68 100644 (file)
@@ -87,8 +87,8 @@ class CRM_Profile_Form_Edit extends CRM_Profile_Form {
     if ($this->get('edit')) {
       // make sure we have right permission to edit this user
       $session = CRM_Core_Session::singleton();
-      $userID  = $session->get('userID');
-      $id      = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, $userID);
+      $userID = $session->get('userID');
+      $id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, $userID);
 
       if ($id) {
         // this is edit mode.
index dad1aa518810bea92eb09a8b2c7cbe66283b1fc2..20e36938a394421fc3dc11ffefd5368405df3bd4 100644 (file)
@@ -88,7 +88,9 @@ class CRM_Profile_Form_Search extends CRM_Profile_Form {
         }
       }
       elseif (in_array($key, array(
-        'birth_date', 'deceased_date'))) {
+        'birth_date',
+        'deceased_date'
+      ))) {
         list($value) = CRM_Utils_Date::setDateDefaults($value);
       }
 
@@ -113,12 +115,12 @@ class CRM_Profile_Form_Search extends CRM_Profile_Form {
     }
 
     $this->addButtons(array(
-        array(
-          'type' => 'refresh',
-          'name' => ts('Search'),
-          'isDefault' => TRUE,
-        ),
-      ));
+      array(
+        'type' => 'refresh',
+        'name' => ts('Search'),
+        'isDefault' => TRUE,
+      ),
+    ));
 
     parent::buildQuickForm();
   }
index d2b79d9f6f811140da6789aa9cdeb116ef9b36cb..95a16677eb50ae1b3c3ec9fdadbbe66e9b51d60d 100644 (file)
@@ -141,7 +141,7 @@ class CRM_Profile_Page_Dynamic extends CRM_Core_Page {
     }
 
     if ($this->_multiRecord & CRM_Core_Action::VIEW) {
-      $this->_recordId  = CRM_Utils_Request::retrieve('recordId', 'Positive', $this);
+      $this->_recordId = CRM_Utils_Request::retrieve('recordId', 'Positive', $this);
       $this->_allFields = CRM_Utils_Request::retrieve('allFields', 'Integer', $this);
     }
 
@@ -192,8 +192,9 @@ class CRM_Profile_Page_Dynamic extends CRM_Core_Page {
       if ($limitListingsGroupsID) {
 
         if (!CRM_Contact_BAO_GroupContact::isContactInGroup($this->_id,
-            $limitListingsGroupsID
-          )) {
+          $limitListingsGroupsID
+        )
+        ) {
           CRM_Utils_System::setTitle(ts('Profile View - Permission Denied'));
           return CRM_Core_Session::setStatus(ts('You do not have permission to view this contact record. Contact the site administrator if you need assistance.'), ts('Permission Denied'), 'error');
         }
index afe07f12c94dbe1ed92f9bebf73e9bc7b78e158f..18e70b6b0906c8611226d97d2e57171f801246eb 100644 (file)
@@ -147,8 +147,15 @@ class CRM_Profile_Page_Listings extends CRM_Core_Page {
     $this->_params = array();
 
     $resetArray = array(
-      'group', 'tag', 'preferred_communication_method', 'do_not_phone',
-      'do_not_email', 'do_not_mail', 'do_not_sms', 'do_not_trade', 'gender',
+      'group',
+      'tag',
+      'preferred_communication_method',
+      'do_not_phone',
+      'do_not_email',
+      'do_not_mail',
+      'do_not_sms',
+      'do_not_trade',
+      'gender',
     );
 
     foreach ($this->_fields as $name => $field) {
@@ -173,8 +180,8 @@ class CRM_Profile_Page_Listings extends CRM_Core_Page {
           ) == 'TextArea')
       ) {
         $value = trim(CRM_Utils_Request::retrieve($name, 'String',
-            $this, FALSE, NULL, 'REQUEST'
-          ));
+          $this, FALSE, NULL, 'REQUEST'
+        ));
         if (!empty($value) &&
           !((substr($value, 0, 1) == '%') &&
             (substr($value, -1, 1) == '%')
@@ -222,8 +229,8 @@ class CRM_Profile_Page_Listings extends CRM_Core_Page {
         if ($customField) {
           // reset checkbox/radio because a form does not send null checkbox values
           if (in_array($customField['html_type'],
-              array('Multi-Select', 'CheckBox', 'Multi-Select State/Province', 'Multi-Select Country', 'Radio')
-            )) {
+            array('Multi-Select', 'CheckBox', 'Multi-Select State/Province', 'Multi-Select Country', 'Radio')
+          )) {
             // only reset on a POST submission if we dont see any value
             $value = NULL;
             $this->set($name, $value);
@@ -250,8 +257,13 @@ class CRM_Profile_Page_Listings extends CRM_Core_Page {
     // set the prox params
     // need to ensure proximity searching is enabled
     $proximityVars = array(
-      'street_address', 'city', 'postal_code', 'state_province_id',
-      'country_id', 'distance', 'distance_unit',
+      'street_address',
+      'city',
+      'postal_code',
+      'state_province_id',
+      'country_id',
+      'distance',
+      'distance_unit',
     );
     foreach ($proximityVars as $var) {
       $value = CRM_Utils_Request::retrieve("prox_{$var}",
@@ -335,11 +347,11 @@ class CRM_Profile_Page_Listings extends CRM_Core_Page {
         $gidString = implode(',', $this->_profileIds);
       }
 
-      $map      = 0;
+      $map = 0;
       $linkToUF = 0;
       $editLink = FALSE;
       if ($this->_gid) {
-        $map      = $ufgroupDAO->is_map;
+        $map = $ufgroupDAO->is_map;
         $linkToUF = $ufgroupDAO->is_uf_link;
         $editLink = $ufgroupDAO->is_edit_link;
       }
index b925a0f17fe056e591e797ed3fd6790e1aae73ef..018320fdf7b253394e1c76b461a59414e3484a93 100644 (file)
@@ -221,7 +221,14 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic {
     }
     if ($fieldIDs && !empty($fieldIDs) && $this->_contactId) {
       $options = array();
-      $returnProperities = array('html_type', 'data_type', 'date_format', 'time_format', 'default_value', 'is_required');
+      $returnProperities = array(
+        'html_type',
+        'data_type',
+        'date_format',
+        'time_format',
+        'default_value',
+        'is_required'
+      );
       foreach ($fieldIDs as $key => $fieldID) {
         $fieldIDs[$key] = !is_numeric($fieldID) ? CRM_Core_BAO_CustomField::getKeyID($fieldID) : $fieldID;
         $param = array('id' => $fieldIDs[$key]);
@@ -244,7 +251,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic {
         $options[$fieldIDs[$key]]['attributes']['default_value'] = CRM_Utils_Array::value('default_value', $returnValues);
 
         $options[$fieldIDs[$key]]['attributes']['format'] =
-          $options[$fieldIDs[$key]]['attributes']['date_format'] = CRM_Utils_Array::value('date_format', $returnValues);
+        $options[$fieldIDs[$key]]['attributes']['date_format'] = CRM_Utils_Array::value('date_format', $returnValues);
         $options[$fieldIDs[$key]]['attributes']['time_format'] = CRM_Utils_Array::value('time_format', $returnValues);
       }
 
@@ -263,7 +270,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic {
           $singleField = CRM_Core_BAO_CustomField::getKeyID($nonListingFieldIds[0]);
           $fieldIdInput = $singleField;
           $singleField = array($singleField);
-          $fieldInput  = $singleField;
+          $fieldInput = $singleField;
         }
         $customGroupInfo = CRM_Core_BAO_CustomGroup::getGroupTitles($fieldInput);
         $this->_customGroupTitle = $customGroupInfo[$fieldIdInput]['groupTitle'];
@@ -344,9 +351,10 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic {
               $op = NULL;
               if ($this->_pageViewType == 'profileDataView') {
                 $actionParams = array(
-                'recordId' => $recId,
-                'gid' => $this->_profileId,
-                  'id' => $this->_contactId);
+                  'recordId' => $recId,
+                  'gid' => $this->_profileId,
+                  'id' => $this->_contactId
+                );
                 $op = 'profile.multiValue.row';
               }
               else {
index 14709c61bae2bd4f662207ca7f6762742266ad3b..539ca6baa2e50fc8bc0ce58583f6048101fa10a8 100644 (file)
@@ -119,8 +119,9 @@ class CRM_Profile_Page_View extends CRM_Core_Page {
         );
       }
       if (CRM_Core_Permission::ufGroupValid($this->_gid,
-          CRM_Core_Permission::SEARCH
-        )) {
+        CRM_Core_Permission::SEARCH
+      )
+      ) {
         $this->assign('listingURL',
           CRM_Utils_System::url("civicrm/profile",
             "force=1&gid={$gidString}"
index f464c7b297e0fab08c41d6e12c6c9268f389ac84..f0855eb91be02c3b3da7b9abef8594bc40f71fd2 100644 (file)
@@ -161,7 +161,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
       $this->_gid = $ufGroupIds;
     }
 
-    $this->_map      = $map;
+    $this->_map = $map;
     $this->_editLink = $editLink;
     $this->_linkToUF = $linkToUF;
 
@@ -195,8 +195,8 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
     $returnProperties['contact_sub_type'] = 1;
     $returnProperties['sort_name'] = 1;
 
-    $queryParams    = CRM_Contact_BAO_Query::convertFormValues($this->_params, 1);
-    $this->_query   = new CRM_Contact_BAO_Query($queryParams, $returnProperties, $this->_fields);
+    $queryParams = CRM_Contact_BAO_Query::convertFormValues($this->_params, 1);
+    $this->_query = new CRM_Contact_BAO_Query($queryParams, $returnProperties, $this->_fields);
 
     //the below is done for query building for multirecord custom field listing
     //to show all the custom field multi valued records of a particular contact
@@ -279,9 +279,9 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
   public function getPagerParams($action, &$params) {
     $status =
       CRM_Utils_System::isNull($this->_multiRecordTableName) ? ts('Contact %%StatusMessage%%') : ts('Contact Multi Records %%StatusMessage%%');
-    $params['status']    = $status;
+    $params['status'] = $status;
     $params['csvString'] = NULL;
-    $params['rowCount']  = CRM_Utils_Pager::ROWCOUNT;
+    $params['rowCount'] = CRM_Utils_Pager::ROWCOUNT;
 
     $params['buttonTop'] = 'PagerTopButton';
     $params['buttonBottom'] = 'PagerBottomButton';
@@ -302,10 +302,11 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
   public function &getColumnHeaders($action = NULL, $output = NULL) {
     static $skipFields = array('group', 'tag');
     $multipleFields = array('url');
-    $direction      = CRM_Utils_Sort::ASCENDING;
-    $empty          = TRUE;
+    $direction = CRM_Utils_Sort::ASCENDING;
+    $empty = TRUE;
     if (!isset(self::$_columnHeaders)) {
-      self::$_columnHeaders = array(array('name' => ''),
+      self::$_columnHeaders = array(
+        array('name' => ''),
         array(
           'name' => ts('Name'),
           'sort' => 'sort_name',
@@ -327,10 +328,10 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
         ) {
 
           if (strpos($name, '-') !== FALSE) {
-            $value     = explode('-', $name);
+            $value = explode('-', $name);
             $fieldName = CRM_Utils_Array::value(0, $value);
-            $lType     = CRM_Utils_Array::value(1, $value);
-            $type      = CRM_Utils_Array::value(2, $value);
+            $lType = CRM_Utils_Array::value(1, $value);
+            $type = CRM_Utils_Array::value(2, $value);
 
             if (!in_array($fieldName, $multipleFields)) {
               if ($lType == 'Primary') {
@@ -341,7 +342,10 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
               }
 
               if (in_array($fieldName, array(
-                'phone', 'im', 'email'))) {
+                'phone',
+                'im',
+                'email'
+              ))) {
                 if ($type) {
                   $name = "`$locationTypeName-$fieldName-$type`";
                 }
@@ -396,7 +400,8 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
     $returnQuery = NULL;
 
     if ($this->_multiRecordTableName &&
-        !array_key_exists($this->_multiRecordTableName, $this->_query->_whereTables)) {
+      !array_key_exists($this->_multiRecordTableName, $this->_query->_whereTables)
+    ) {
       $additionalFromClause = CRM_Utils_Array::value($this->_multiRecordTableName, $this->_query->_tables);
       $returnQuery = TRUE;
     }
@@ -449,9 +454,9 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
       $vars = $sort->_vars;
       $varArray = array();
       foreach ($vars as $key => $field) {
-        $field      = $vars[$key];
+        $field = $vars[$key];
         $fieldArray = explode('-', $field['name']);
-        $fieldType  = CRM_Utils_Array::value('2', $fieldArray);
+        $fieldType = CRM_Utils_Array::value('2', $fieldArray);
         if (is_numeric(CRM_Utils_Array::value('1', $fieldArray))) {
           if (!in_array($fieldType, $multipleFields)) {
             $locationType = new CRM_Core_DAO_LocationType();
@@ -490,7 +495,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
 
     if ($returnQuery) {
       $resQuery = preg_replace('/GROUP BY contact_a.id[\s]+ORDER BY/', ' ORDER BY', $result);
-      $result   = CRM_Core_DAO::executeQuery($resQuery);
+      $result = CRM_Core_DAO::executeQuery($resQuery);
     }
 
     // process the result of the query
@@ -527,10 +532,10 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
         !in_array($key, $skipFields)
       ) {
         if (strpos($key, '-') !== FALSE) {
-          $value     = explode('-', $key);
+          $value = explode('-', $key);
           $fieldName = CRM_Utils_Array::value(0, $value);
-          $id        = CRM_Utils_Array::value(1, $value);
-          $type      = CRM_Utils_Array::value(2, $value);
+          $id = CRM_Utils_Array::value(1, $value);
+          $type = CRM_Utils_Array::value(2, $value);
 
           if (!in_array($fieldName, $multipleFields)) {
             $locationTypeName = NULL;
@@ -548,7 +553,10 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
             }
             $locationTypeName = str_replace(' ', '_', $locationTypeName);
             if (in_array($fieldName, array(
-              'phone', 'im', 'email'))) {
+              'phone',
+              'im',
+              'email'
+            ))) {
               if ($type) {
                 $names[] = "{$locationTypeName}-{$fieldName}-{$type}";
               }
@@ -590,7 +598,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
         $i18n = CRM_Core_I18n::singleton();
         $result->country = $i18n->translate($result->country);
       }
-      $row   = array();
+      $row = array();
       $empty = TRUE;
       $row[] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? $result->contact_sub_type : $result->contact_type,
         FALSE,
@@ -616,8 +624,8 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
         elseif (substr($name, -4) == '-url' &&
           !empty($result->$name)
         ) {
-          $url      = CRM_Utils_System::fixURL($result->$name);
-          $typeId   = substr($name, 0, -4) . "-website_type_id";
+          $url = CRM_Utils_System::fixURL($result->$name);
+          $typeId = substr($name, 0, -4) . "-website_type_id";
           $typeName = CRM_Core_PseudoConstant::getLabel('CRM_Core_DAO_Website', 'website_type_id', $result->$typeId);
           if ($typeName) {
             $row[] = "<a href=\"$url\">{$result->$name} (${typeName})</a>";
@@ -640,9 +648,9 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
         }
         elseif (strpos($name, '-im')) {
           if (!empty($result->$name)) {
-            $providerId   = $name . "-provider_id";
+            $providerId = $name . "-provider_id";
             $providerName = CRM_Core_PseudoConstant::getLabel('CRM_Core_DAO_IM', 'provider_id', $result->$providerId);
-            $row[]        = $result->$name . " ({$providerName})";
+            $row[] = $result->$name . " ({$providerName})";
           }
           else {
             $row[] = '';
@@ -658,12 +666,17 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
           }
         }
         elseif (in_array($name, array(
-          'addressee', 'email_greeting', 'postal_greeting'))) {
+          'addressee',
+          'email_greeting',
+          'postal_greeting'
+        ))) {
           $dname = $name . '_display';
           $row[] = $result->$dname;
         }
         elseif (in_array($name, array(
-          'birth_date', 'deceased_date'))) {
+          'birth_date',
+          'deceased_date'
+        ))) {
           $row[] = CRM_Utils_Date::customFormat($result->$name);
         }
         elseif (isset($result->$name)) {
index 817e112069aec1f95d00c31ebf8698699dfacba3..d5fb08d6ea34daf331a93a900043ade914d3e3e3 100644 (file)
@@ -63,7 +63,10 @@ class CRM_Queue_ErrorPolicy {
     $this->active = TRUE;
     $this->backup = array();
     foreach (array(
-      'display_errors', 'html_errors', 'xmlrpc_errors') as $key) {
+               'display_errors',
+               'html_errors',
+               'xmlrpc_errors'
+             ) as $key) {
       $this->backup[$key] = ini_get($key);
       ini_set($key, 0);
     }
@@ -79,7 +82,10 @@ class CRM_Queue_ErrorPolicy {
     $this->errorScope = NULL;
     restore_error_handler();
     foreach (array(
-      'display_errors', 'html_errors', 'xmlrpc_errors') as $key) {
+               'display_errors',
+               'html_errors',
+               'xmlrpc_errors'
+             ) as $key) {
       ini_set($key, $this->backup[$key]);
     }
     $this->active = FALSE;
@@ -99,7 +105,7 @@ class CRM_Queue_ErrorPolicy {
     try {
       $result = $callable();
     }
-    catch(Exception$e) {
+    catch (Exception$e) {
       $this->reportException($e);
     }
     $this->deactivate();
index cce29ee776636a390e6472dcc32b7c8e17f6086f..49dc16ffd69d148ef4fb8759457b6740e016d351 100644 (file)
@@ -135,8 +135,8 @@ class CRM_Queue_Queue_Memory extends CRM_Queue_Queue {
       if (empty($this->releaseTimes[$id]) || $this->releaseTimes[$id] < $nowEpoch) {
         $this->releaseTimes[$id] = $nowEpoch + $leaseTime;
 
-        $item       = new stdClass();
-        $item->id   = $id;
+        $item = new stdClass();
+        $item->id = $id;
         $item->data = unserialize($data);
         return $item;
       }
@@ -164,8 +164,8 @@ class CRM_Queue_Queue_Memory extends CRM_Queue_Queue {
       $nowEpoch = CRM_Utils_Time::getTimeRaw();
       $this->releaseTimes[$id] = $nowEpoch + $leaseTime;
 
-      $item       = new stdClass();
-      $item->id   = $id;
+      $item = new stdClass();
+      $item->id = $id;
       $item->data = unserialize($data);
       return $item;
     }
index 338e5d1b253700d6e81790c288ad0b1a6748fdbe..8301e91f17f67d1ddaa598931b152c73ce2b52dd 100644 (file)
@@ -58,12 +58,12 @@ class CRM_Report_BAO_Hook {
     return $singleton;
   }
 
- /**
-  * Get or build the list of search objects (via hook)
-  *
-  * @return array
 /**
+   * Get or build the list of search objects (via hook)
+   *
+   * @return array
    *   of CRM_Report_BAO_Hook_Interface objects
-  */
+   */
   public function getSearchQueryObjects() {
     if ($this->_queryObjects === NULL) {
       $this->_queryObjects = array();
index 3475012449b6504a0e52f6af602bcf3f2c670818..06e370d18199f4395883d5fd534dcc1f42a57a4a 100644 (file)
@@ -95,7 +95,7 @@ class CRM_Report_BAO_ReportInstance extends CRM_Report_DAO_ReportInstance {
       $instance->id = $instanceID;
     }
 
-    if (! $instanceID) {
+    if (!$instanceID) {
       if ($reportID = CRM_Utils_Array::value('report_id', $params)) {
         $instance->report_id = $reportID;
       }
@@ -133,10 +133,10 @@ class CRM_Report_BAO_ReportInstance extends CRM_Report_DAO_ReportInstance {
    */
   public static function &create(&$params) {
     if (isset($params['report_header'])) {
-      $params['header']    = CRM_Utils_Array::value('report_header',$params);
+      $params['header'] = CRM_Utils_Array::value('report_header', $params);
     }
     if (isset($params['report_footer'])) {
-      $params['footer']    = CRM_Utils_Array::value('report_footer',$params);
+      $params['footer'] = CRM_Utils_Array::value('report_footer', $params);
     }
 
     // build navigation parameters
@@ -148,7 +148,7 @@ class CRM_Report_BAO_ReportInstance extends CRM_Report_DAO_ReportInstance {
 
       $navigationParams['permission'] = array();
       $navigationParams['label'] = $params['title'];
-      $navigationParams['name']  = $params['title'];
+      $navigationParams['name'] = $params['title'];
 
       $navigationParams['current_parent_id'] = CRM_Utils_Array::value('parent_id', $navigationParams);
       $navigationParams['parent_id'] = CRM_Utils_Array::value('parent_id', $params);
@@ -206,10 +206,10 @@ class CRM_Report_BAO_ReportInstance extends CRM_Report_DAO_ReportInstance {
     // add to dashlet
     if (!empty($dashletParams)) {
       $section = 2;
-      $chart  = '';
+      $chart = '';
       if (!empty($params['charts'])) {
         $section = 1;
-        $chart   = "&charts=" . $params['charts'];
+        $chart = "&charts=" . $params['charts'];
       }
       $limitResult = NULL;
       if (CRM_Utils_Array::value('row_count', $params)) {
index 82650dea0a105ac5be4dc3c8c33b160a5ac73f43..544be75fdcfd0f80295a730e4fbc75ff1ca9ff59 100644 (file)
@@ -37,4 +37,5 @@
  * $Id$
  *
  */
-class CRM_Report_Config extends CRM_Core_Component_Config {}
+class CRM_Report_Config extends CRM_Core_Component_Config {
+}
index 410950739298ccf1e4300bbdf3fdaafa770ac1f1..d7c9cf65063df58e6751a63c58a7b3b364753da1 100644 (file)
@@ -147,9 +147,9 @@ class CRM_Report_Form extends CRM_Core_Form {
   protected $_tagFilter = FALSE;
 
   /**
-<<<<<<< HEAD
+   * <<<<<<< HEAD
    * Build groups filter
-=======
+   * =======
    * specify entity table for tags filter
    *
    */
@@ -158,7 +158,7 @@ class CRM_Report_Form extends CRM_Core_Form {
   /**
    * build groups filter
    *
->>>>>>> 098a61330d0fe12153370741ec98cb1172ece849
+   * >>>>>>> 098a61330d0fe12153370741ec98cb1172ece849
    */
   protected $_groupFilter = FALSE;
 
index 362a8f3aa7c837ecd944cdc259ad8b697cd67c35..2d622b544c96ddbbe2b2aa2729342bdef76c1a50 100644 (file)
@@ -253,18 +253,21 @@ class CRM_Report_Form_Activity extends CRM_Report_Form {
           'fields' => array(// so we have $this->_alias populated
           ),
           'status_id' =>
-          array('title' => ts('Activity Status'),
-            'default' => TRUE,
-            'type' => CRM_Utils_Type::T_STRING,
-          ),
+            array(
+              'title' => ts('Activity Status'),
+              'default' => TRUE,
+              'type' => CRM_Utils_Type::T_STRING,
+            ),
           'duration' =>
-          array('title' => ts('Duration'),
-            'type' => CRM_Utils_Type::T_INT,
-          ),
+            array(
+              'title' => ts('Duration'),
+              'type' => CRM_Utils_Type::T_INT,
+            ),
           'location' =>
-          array('title' => ts('Location'),
-            'type' => CRM_Utils_Type::T_STRING,
-          ),
+            array(
+              'title' => ts('Location'),
+              'type' => CRM_Utils_Type::T_STRING,
+            ),
           'details' => array(
             'title' => ts('Activity Details'),
           )
@@ -275,21 +278,24 @@ class CRM_Report_Form_Activity extends CRM_Report_Form {
             'operatorType' => CRM_Report_Form::OP_DATE,
           ),
           'activity_subject' =>
-          array('title' => ts('Activity Subject')),
+            array('title' => ts('Activity Subject')),
           'location' =>
-            array('title' => ts('Location'),
-            'type' => CRM_Utils_Type::T_TEXT,
-          ),
+            array(
+              'title' => ts('Location'),
+              'type' => CRM_Utils_Type::T_TEXT,
+            ),
           'activity_type_id' =>
-          array('title' => ts('Activity Type'),
-            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
-            'options' => $this->activityTypes,
-          ),
+            array(
+              'title' => ts('Activity Type'),
+              'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+              'options' => $this->activityTypes,
+            ),
           'status_id' =>
-          array('title' => ts('Activity Status'),
-            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
-            'options' => CRM_Core_PseudoConstant::activityStatus(),
-          ),
+            array(
+              'title' => ts('Activity Status'),
+              'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+              'options' => CRM_Core_PseudoConstant::activityStatus(),
+            ),
           'details' => array(
             'title' => ts('Activity Details'),
             'type' => CRM_Utils_Type::T_TEXT,
index 35c3d859b083359fd04b90930bb9c7179fd8604d..11347f1f74fd01d023189102d8a891436910217a 100644 (file)
@@ -144,9 +144,9 @@ class CRM_Report_Form_ActivitySummary extends CRM_Report_Form {
         ),
         'group_bys' => array(
           'activity_date_time' => array(
-              'title' => ts('Activity Date'),
-              'frequency' => TRUE,
-            ),
+            'title' => ts('Activity Date'),
+            'frequency' => TRUE,
+          ),
           'activity_type_id' => array(
             'title' => ts('Activity Type'),
             'default' => TRUE,
index ce79ccfd7f084f250302db8295a6570056bbf58f..1008f2962620968ffdd7fd2c214206407e059ca4 100644 (file)
@@ -299,9 +299,9 @@ FROM civicrm_contact {$this->_aliases['civicrm_contact']}
   public function postProcess() {
     // get the acl clauses built before we assemble the query
     $this->buildACLClause(array(
-        $this->_aliases['civicrm_contact'],
-        $this->_aliases['civicrm_employer'],
-      ));
+      $this->_aliases['civicrm_contact'],
+      $this->_aliases['civicrm_employer'],
+    ));
     parent::postProcess();
   }
 
index 3ec74470ac64f397a8bc9e0d0abe419d0bf3d253..1e182f310fd78fe449aa17a25bd5e5c00750d311 100644 (file)
@@ -37,9 +37,9 @@ class CRM_Report_Form_Contact_LoggingDetail extends CRM_Logging_ReportDetail {
   /**
    */
   public function __construct() {
-    $logging        = new CRM_Logging_Schema;
+    $logging = new CRM_Logging_Schema;
     $this->tables[] = 'civicrm_contact';
-    $this->tables   = array_merge($this->tables, array_keys($logging->customDataLogTables()));
+    $this->tables = array_merge($this->tables, array_keys($logging->customDataLogTables()));
     $this->tables[] = 'civicrm_email';
     $this->tables[] = 'civicrm_phone';
     $this->tables[] = 'civicrm_im';
index d26bc5b77d55a00a30751a4de4952ea17c2d1334..9968e950aa33114f94d00ee6c62bbf3f43ccd426 100644 (file)
@@ -82,7 +82,7 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary {
             'name' => 'id',
             'no_display' => TRUE,
             'required' => TRUE,
-            'alias'    => 'modified_contact_civireport',
+            'alias' => 'modified_contact_civireport',
           ),
           'log_conn_id' => array(
             'no_display' => TRUE,
@@ -119,7 +119,7 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary {
             'type' => CRM_Utils_Type::T_STRING,
           ),
           'log_type_table' => array(
-            'name'  => 'log_type',
+            'name' => 'log_type',
             'title' => ts('Log Type Table'),
             'type' => CRM_Utils_Type::T_STRING,
           ),
@@ -136,7 +136,7 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary {
         ),
       ),
       'altered_by_contact' => array(
-        'dao'   => 'CRM_Contact_DAO_Contact',
+        'dao' => 'CRM_Contact_DAO_Contact',
         'alias' => 'altered_by_contact',
         'fields' => array(
           'display_name' => array(
@@ -162,7 +162,7 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary {
   public function alterDisplay(&$rows) {
     // cache for id â†’ is_deleted mapping
     $isDeleted = array();
-    $newRows   = array();
+    $newRows = array();
 
     foreach ($rows as $key => &$row) {
       if (!isset($isDeleted[$row['log_civicrm_entity_altered_contact_id']])) {
@@ -171,7 +171,8 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary {
       }
 
       if (!empty($row['log_civicrm_entity_altered_contact']) &&
-        !$isDeleted[$row['log_civicrm_entity_altered_contact_id']]) {
+        !$isDeleted[$row['log_civicrm_entity_altered_contact_id']]
+      ) {
         $row['log_civicrm_entity_altered_contact_link'] =
           CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $row['log_civicrm_entity_altered_contact_id']);
         $row['log_civicrm_entity_altered_contact_hover'] = ts("Go to contact summary");
@@ -188,14 +189,16 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary {
       }
 
       if ('Contact' == CRM_Utils_Array::value('log_type', $this->_logTables[$row['log_civicrm_entity_log_type']]) &&
-          CRM_Utils_Array::value('log_civicrm_entity_log_action', $row) == 'Insert') {
+        CRM_Utils_Array::value('log_civicrm_entity_log_action', $row) == 'Insert'
+      ) {
         $row['log_civicrm_entity_log_action'] = ts('Update');
       }
 
       if ($newAction = $this->getEntityAction($row['log_civicrm_entity_id'],
-                       $row['log_civicrm_entity_log_conn_id'],
-                       $row['log_civicrm_entity_log_type'],
-                       CRM_Utils_Array::value('log_civicrm_entity_log_action', $row))) {
+        $row['log_civicrm_entity_log_conn_id'],
+        $row['log_civicrm_entity_log_type'],
+        CRM_Utils_Array::value('log_civicrm_entity_log_action', $row))
+      ) {
         $row['log_civicrm_entity_log_action'] = $newAction;
       }
 
@@ -217,7 +220,7 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary {
         $row['log_civicrm_entity_log_action'] = "<a href='{$url1}' class='crm-summary-link'><div class='icon ui-icon-zoomin'></div></a>&nbsp;<a title='View details for this update' href='{$url2}'>" . ts('Update') . '</a>';
       }
 
-      $key  = $date . '_' .
+      $key = $date . '_' .
         $row['log_civicrm_entity_log_type'] . '_' .
         $row['log_civicrm_entity_log_conn_id'] . '_' .
         $row['log_civicrm_entity_log_user_id'] . '_' .
@@ -241,7 +244,7 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary {
       $entity = $logTable;
     }
 
-    $detail    = $this->_logTables[$entity];
+    $detail = $this->_logTables[$entity];
     $tableName = CRM_Utils_Array::value('table_name', $detail, $entity);
     $clause = CRM_Utils_Array::value('entity_table', $detail);
     $clause = $clause ? "AND entity_log_civireport.entity_table = 'civicrm_contact'" : NULL;
index eeaad5a89ae540e9f4663d4ad3f4af8e9812c744..f059a2fc7bf6133a8e4a41fedc404eb9e6c43ef9 100644 (file)
@@ -541,9 +541,9 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form {
     }
 
     $this->buildACLClause(array(
-        $this->_aliases['civicrm_contact'],
-        $this->_aliases['civicrm_contact_b'],
-      ));
+      $this->_aliases['civicrm_contact'],
+      $this->_aliases['civicrm_contact_b'],
+    ));
     $sql = $this->buildQuery();
     $this->buildRows($sql, $rows);
 
index e5d05ee569a7b10becf66ef401b1501061a6dd9c..ac517147f8fc06842bbed42e6f62ff2995629145 100644 (file)
@@ -452,7 +452,7 @@ class CRM_Report_Form_Contribute_Bookkeeping extends CRM_Report_Form {
     while ($dao->fetch()) {
       $amount[] = CRM_Utils_Money::format($dao->amount, $dao->currency);
       $avg[] = CRM_Utils_Money::format(round(($dao->amount /
-            $dao->count), 2), $dao->currency);
+        $dao->count), 2), $dao->currency);
     }
 
     $statistics['counts']['amount'] = array(
index 9f3339a23ba676242ba6187519c4591fff63a2e6..d39512e7f89aace9addac0cc7e3870d5c7a7b1dd 100644 (file)
@@ -350,9 +350,9 @@ class CRM_Report_Form_Contribute_HouseholdSummary extends CRM_Report_Form {
 
     $this->beginPostProcess();
     $this->buildACLClause(array(
-        $this->_aliases['civicrm_contact'],
-        $this->_aliases['civicrm_contact_household'],
-      ));
+      $this->_aliases['civicrm_contact'],
+      $this->_aliases['civicrm_contact_household'],
+    ));
     $sql = $this->buildQuery(TRUE);
     $rows = array();
 
index bb0c9a338665cc69d7392a6a4064585a48b7906c..4634b0308cfe3586bf4882b6b8e9728d45cfdd5a 100644 (file)
@@ -37,9 +37,9 @@ class CRM_Report_Form_Contribute_LoggingDetail extends CRM_Logging_ReportDetail
   /**
    */
   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()));
+    $this->tables = array_merge($this->tables, array_keys($logging->customDataLogTables()));
 
     $this->detail = 'logging/contribute/detail';
     $this->summary = 'logging/contribute/summary';
index 664705aa2d80674625b276127a9049c578aa3961..981721d11893b7bb296d0f49a1984a40df536883 100644 (file)
@@ -120,8 +120,8 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form {
           ),
         ),
       )
-    + $this->addAddressFields()
-    + array(
+      + $this->addAddressFields()
+      + array(
         'civicrm_contribution' => array(
           'dao' => 'CRM_Contribute_DAO_Contribution',
           'fields' => array(
index d7521b31f2d8f10e112fac1f791273e6f29a2ba5..0428bd1552c1e401ec405ca0da898d850ea891e4 100644 (file)
@@ -164,7 +164,7 @@ class CRM_Report_Form_Contribute_Recur extends CRM_Report_Form {
           'financial_type_id' => array(
             'title' => ts('Financial Type'),
             'operatorType' => CRM_Report_Form::OP_MULTISELECT,
-            'options'  => CRM_Contribute_PseudoConstant::financialType(),
+            'options' => CRM_Contribute_PseudoConstant::financialType(),
             'type' => CRM_Utils_Type::T_INT,
           ),
           'frequency_unit' => array(
@@ -208,6 +208,7 @@ class CRM_Report_Form_Contribute_Recur extends CRM_Report_Form {
     $this->_currencyColumn = 'civicrm_contribution_recur_currency';
     parent::__construct();
   }
+
   public function getTemplateName() {
     return 'CRM/Report/Form.tpl';
   }
@@ -258,7 +259,7 @@ class CRM_Report_Form_Contribute_Recur extends CRM_Report_Form {
         $start_date_db_alias = $this->_columns['civicrm_contribution_recur']['filters']['start_date']['dbAlias'];
 
         // The end date clause is simple to construct
-        $end_date_clause   = $this->dateClause($end_date_db_alias, $relative, $from, $to, $end_date_type, NULL, NULL);
+        $end_date_clause = $this->dateClause($end_date_db_alias, $relative, $from, $to, $end_date_type, NULL, NULL);
 
         // NOTE: For the calculation based on installment, there doesn't
         // seem to be a way to include the interval unit (e.g. month,
@@ -267,22 +268,22 @@ class CRM_Report_Form_Contribute_Recur extends CRM_Report_Form {
 
         $installment_clause = '(' .
           $this->dateClause("DATE_ADD($start_date_db_alias, INTERVAL $installments_db_alias * COALESCE($frequency_interval_db_alias,1) month)",
-          $relative, $from, $to, $start_date_type, NULL, NULL);
+            $relative, $from, $to, $start_date_type, NULL, NULL);
         $installment_clause .= " AND $frequency_unit_db_alias = 'month' ) OR \n";
 
         $installment_clause .= '(' .
           $this->dateClause("DATE_ADD($start_date_db_alias, INTERVAL $installments_db_alias * COALESCE($frequency_interval_db_alias,1) day)",
-          $relative, $from, $to, $start_date_type, NULL, NULL);
+            $relative, $from, $to, $start_date_type, NULL, NULL);
         $installment_clause .= " AND $frequency_unit_db_alias = 'day' ) OR \n";
 
         $installment_clause .= '(' .
           $this->dateClause("DATE_ADD($start_date_db_alias, INTERVAL $installments_db_alias * COALESCE($frequency_interval_db_alias, 1) week)",
-          $relative, $from, $to, $start_date_type, NULL, NULL);
+            $relative, $from, $to, $start_date_type, NULL, NULL);
         $installment_clause .= " AND $frequency_unit_db_alias = 'week' ) OR \n";
 
         $installment_clause .= '(' .
           $this->dateClause("DATE_ADD($start_date_db_alias, INTERVAL $installments_db_alias * COALESCE($frequency_interval_db_alias, 1) year)",
-          $relative, $from, $to, $start_date_type, NULL, NULL);
+            $relative, $from, $to, $start_date_type, NULL, NULL);
         $installment_clause .= " AND $frequency_unit_db_alias = 'year' )\n";
 
         $this->_where .= " AND ";
index 3551899a05feebdecd126d1d35fc065337b7c5dd..2861df4bae8eaf9bbab920cba87314c9c871fe2f 100644 (file)
@@ -500,9 +500,9 @@ LEFT JOIN civicrm_temp_civireport_repeat2 {$this->_aliases['civicrm_contribution
           if (!$found) {
             $erorrGrps = implode(',', $invlidGroups);
             $tempErrors[] = ts("Do not select field %1 with Group by %2.", array(
-                1 => $idMapping[$fld_id],
-                2 => $erorrGrps,
-              ));
+              1 => $idMapping[$fld_id],
+              2 => $erorrGrps,
+            ));
           }
         }
       }
index 656f6571c901ebc07f7e3cfa0fb3bc0717e2a82b..744549750bcea6cb19c750079337894151cfda6e 100644 (file)
@@ -112,8 +112,8 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form {
           ),
         ),
       )
-    + $this->addAddressFields()
-    + array(
+      + $this->addAddressFields()
+      + array(
         'civicrm_contribution' => array(
           'dao' => 'CRM_Contribute_DAO_Contribution',
           'fields' => array(
index 36c3226113c4efa19c60b8abac8c776567da9fc9..a1b4fd233322aef74cb4bf77750f9ccf2ad24f52 100644 (file)
@@ -78,8 +78,8 @@ class CRM_Report_Form_Contribute_TopDonor extends CRM_Report_Form {
           ),
         ),
       )
-    + $this->getAddressColumns()
-    + array(
+      + $this->getAddressColumns()
+      + array(
         'civicrm_contribution' => array(
           'dao' => 'CRM_Contribute_DAO_Contribution',
           'fields' => array(
index 198bdc1d07d42201103158f2952f363cadd899bd..bbbf1fdefdafb2224b4ea56370ff6ab6a63cd2ce 100644 (file)
@@ -78,8 +78,8 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event {
 
     $eventID = implode(',', $eventIDs);
 
-    $participantStatus  = CRM_Event_PseudoConstant::participantStatus(NULL, "is_counted = 1");
-    $participantRole    = CRM_Event_PseudoConstant::participantRole();
+    $participantStatus = CRM_Event_PseudoConstant::participantStatus(NULL, "is_counted = 1");
+    $participantRole = CRM_Event_PseudoConstant::participantRole();
     $paymentInstruments = CRM_Contribute_PseudoConstant::paymentInstrument();
 
     $rows = $eventSummary = $roleRows = $statusRows = $instrumentRows = $count = array();
@@ -344,8 +344,8 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event {
       $this->setPager();
 
       $showEvents = array();
-      $count      = 0;
-      $numRows    = $this->_limit;
+      $count = 0;
+      $numRows = $this->_limit;
 
       if (CRM_Utils_Array::value('id_op', $this->_params, 'in') == 'in' || $noSelection) {
         while ($count < self::ROW_COUNT_LIMIT) {
index 974413e0bdb371dff762e25f229efa65ca9b4074..bdd122edbb632736ceef81f66c6f65bc86d3ba80 100644 (file)
@@ -88,7 +88,7 @@ class CRM_Report_Form_Instance {
       'row_count',
       ts('Limit Dashboard Results'),
       array(
-    'maxlength' => 64,
+        'maxlength' => 64,
         'size' => 5,
       )
     );
@@ -299,8 +299,17 @@ class CRM_Report_Form_Instance {
 
     // unset params from $formValues that doesn't match with DB columns of instance tables, and also not required in form-values for sure
     $unsetFields = array(
-      'title', 'to_emails', 'cc_emails', 'header', 'footer',
-      'qfKey', 'id', '_qf_default', 'report_header', 'report_footer', 'grouprole',
+      'title',
+      'to_emails',
+      'cc_emails',
+      'header',
+      'footer',
+      'qfKey',
+      'id',
+      '_qf_default',
+      'report_header',
+      'report_footer',
+      'grouprole',
     );
     foreach ($unsetFields as $field) {
       unset($formValues[$field]);
index 7871092bcb2b44b63497183b37e0575a48d78955..91246af8d8a4af90d9090b2bd511bc3e19676f6e 100644 (file)
@@ -371,8 +371,8 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form {
           $clause = NULL;
           if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_DATE) {
             $relative = CRM_Utils_Array::value("{$fieldName}_relative", $this->_params);
-            $from     = CRM_Utils_Array::value("{$fieldName}_from", $this->_params);
-            $to       = CRM_Utils_Array::value("{$fieldName}_to", $this->_params);
+            $from = CRM_Utils_Array::value("{$fieldName}_from", $this->_params);
+            $to = CRM_Utils_Array::value("{$fieldName}_to", $this->_params);
 
             $clause = $this->dateClause($this->_aliases[$tableName] . '.' . $field['name'], $relative, $from, $to, $field['type']);
           }
@@ -445,15 +445,15 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form {
    */
   public static function getChartCriteria() {
     return array(
-    'count' => array(
-    'civicrm_mailing_event_delivered_delivered_count' => ts('Delivered'),
+      'count' => array(
+        'civicrm_mailing_event_delivered_delivered_count' => ts('Delivered'),
         'civicrm_mailing_event_bounce_bounce_count' => ts('Bounce'),
         'civicrm_mailing_event_opened_open_count' => ts('Opened'),
         'civicrm_mailing_event_trackable_url_open_click_count' => ts('Clicks'),
         'civicrm_mailing_event_unsubscribe_unsubscribe_count' => ts('Unsubscribe'),
       ),
       'rate' => array(
-    'civicrm_mailing_event_delivered_accepted_rate' => ts('Accepted Rate'),
+        'civicrm_mailing_event_delivered_accepted_rate' => ts('Accepted Rate'),
         'civicrm_mailing_event_bounce_bounce_rate' => ts('Bounce Rate'),
         'civicrm_mailing_event_opened_open_rate' => ts('Confirmed Open Rate'),
         'civicrm_mailing_event_trackable_url_open_CTR' => ts('Click through Rate'),
@@ -480,13 +480,26 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form {
     $isError = TRUE;
     foreach ($fields['fields'] as $fld => $isActive) {
       if (in_array($fld, array(
-        'delivered_count', 'bounce_count', 'open_count', 'click_count', 'unsubscribe_count', 'accepted_rate', 'bounce_rate', 'open_rate', 'CTR', 'CTO'))) {
+        'delivered_count',
+        'bounce_count',
+        'open_count',
+        'click_count',
+        'unsubscribe_count',
+        'accepted_rate',
+        'bounce_rate',
+        'open_rate',
+        'CTR',
+        'CTO'
+      ))) {
         $isError = FALSE;
       }
     }
 
     if ($isError) {
-      $errors['_qf_default'] = ts('For Chart view, please select at least one field from %1 OR %2.', array(1 => implode(', ', $criterias['count']), 2 => implode(', ', $criterias['rate'])));
+      $errors['_qf_default'] = ts('For Chart view, please select at least one field from %1 OR %2.', array(
+          1 => implode(', ', $criterias['count']),
+          2 => implode(', ', $criterias['rate'])
+        ));
     }
 
     return $errors;
@@ -503,7 +516,7 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form {
     $criterias = self::getChartCriteria();
 
     $chartInfo = array(
-    'legend' => ts('Mail Summary'),
+      'legend' => ts('Mail Summary'),
       'xname' => ts('Mailing'),
       'yname' => ts('Statistics'),
       'xLabelAngle' => 20,
index 5c7c9545f98c3d937dbf72a680afd5b98bc80f20..f10493a20f0f8ae0dc69375db7831c2227c4626e 100644 (file)
@@ -174,8 +174,8 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form {
           ),
         ),
       )
-    + $this->getAddressColumns(array('group_by' => FALSE))
-    + $this->getPhoneColumns();
+      + $this->getAddressColumns(array('group_by' => FALSE))
+      + $this->getPhoneColumns();
     // If we have a campaign, build out the relevant elements
     $this->_tagFilter = TRUE;
     if ($campaignEnabled && !empty($this->activeCampaigns)) {
index 148c9428b5ad53e9285cfee9cd8b3382ee2e3cc2..6efc9e39c10060f186abb5fa14723bc022bdc1bc 100644 (file)
@@ -198,7 +198,10 @@ class CRM_Report_Form_Register extends CRM_Core_Form {
 
       $groupParams = array('name' => ('report_template'));
       $optionValue = CRM_Core_OptionValue::addOptionValue($params, $groupParams, $this->_action, $this->_id);
-      CRM_Core_Session::setStatus(ts('The %1 \'%2\' has been saved.', array(1 => 'Report Template', 2 => $optionValue->label)), ts('Saved'), 'success');
+      CRM_Core_Session::setStatus(ts('The %1 \'%2\' has been saved.', array(
+            1 => 'Report Template',
+            2 => $optionValue->label
+          )), ts('Saved'), 'success');
       CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/report/options/report_template', "reset=1"));
     }
   }
index f51c6f1dae82637ca4f1f41682406e32badf3ae7..2030527b81c798e392f71eb54869850d0148890a 100644 (file)
@@ -48,7 +48,7 @@ class CRM_Report_Page_Instance extends CRM_Core_Page {
     if (!$instanceId) {
       $instanceId = CRM_Report_Utils_Report::getInstanceIDForPath();
     }
-    $action    = CRM_Utils_Request::retrieve('action', 'String', $this);
+    $action = CRM_Utils_Request::retrieve('action', 'String', $this);
     $optionVal = CRM_Report_Utils_Report::getValueFromUrl($instanceId);
     $reportUrl = CRM_Utils_System::url('civicrm/report/list', "reset=1");
 
index 5296a5fcdcaa7155e70e48dc2a7c6bab55c037a9..37c5695aa69098a5c7b0327f43e2100ac79a6796 100644 (file)
@@ -181,11 +181,11 @@ class CRM_Report_Page_InstanceList extends CRM_Core_Page {
    */
   public function run() {
     //Filters by source report template or by component
-    $this->ovID   = CRM_Utils_Request::retrieve('ovid', 'Positive', $this);
+    $this->ovID = CRM_Utils_Request::retrieve('ovid', 'Positive', $this);
     $this->compID = CRM_Utils_Request::retrieve('compid', 'Positive', $this);
     $this->grouping = CRM_Utils_Request::retrieve('grp', 'String', $this);
 
-    $rows   = $this->info();
+    $rows = $this->info();
 
     $this->assign('list', $rows);
     if ($this->ovID OR $this->compID) {
index 80dc44cb85ed2cdb6b056ce4fbb67186bd16d102..902123dde8b4df397b920bddd6fa535a350068ef 100644 (file)
@@ -168,8 +168,8 @@ class CRM_Report_Page_Options extends CRM_Core_Page_Basic {
   public function browse() {
     $groupParams = array('name' => self::$_gName);
     $optionValue = CRM_Core_OptionValue::getRows($groupParams, $this->links(), 'weight');
-    $gName       = self::$_gName;
-    $returnURL   = CRM_Utils_System::url("civicrm/admin/report/options/$gName",
+    $gName = self::$_gName;
+    $returnURL = CRM_Utils_System::url("civicrm/admin/report/options/$gName",
       "reset=1"
     );
     $filter = "option_group_id = " . self::$_gId;
index 653e7c50d2b679a024162a40ae91ad652a0fa637..85da0509c84efa342af7bc11818540504e069e52 100644 (file)
@@ -85,8 +85,8 @@ LEFT  JOIN civicrm_component comp
     }
     $sql .= " ORDER BY  v.weight ";
 
-    $dao    = CRM_Core_DAO::executeQuery($sql);
-    $rows   = array();
+    $dao = CRM_Core_DAO::executeQuery($sql);
+    $rows = array();
     $config = CRM_Core_Config::singleton();
     while ($dao->fetch()) {
       if ($dao->component_name != 'Contact' && $dao->component_name != $dao->grouping &&
index 24d825117bde90b77cc954eb82150c49c70ace75..62665b4dbfb287fd2882caececcd2cc57117a2d8 100644 (file)
@@ -196,7 +196,9 @@ class CRM_Report_Utils_Get {
   public static function processChart(&$defaults) {
     $chartType = CRM_Utils_Array::value("charts", $_GET);
     if (in_array($chartType, array(
-      'barChart', 'pieChart'))) {
+      'barChart',
+      'pieChart'
+    ))) {
       $defaults["charts"] = $chartType;
     }
   }
index 4d73153b09a35406582f1bec8f704e5d1e034f9e..93cdac329a993f1c9447cf44d64490d9db677ad5 100644 (file)
@@ -191,7 +191,7 @@ WHERE  inst.report_id = %1";
 
     list($domainEmailName,
       $domainEmailAddress
-    ) = CRM_Core_BAO_Domain::getNameAndEmail();
+      ) = CRM_Core_BAO_Domain::getNameAndEmail();
 
     $params = array('id' => $instanceID);
     $instanceInfo = array();
@@ -200,13 +200,13 @@ WHERE  inst.report_id = %1";
       $instanceInfo
     );
 
-    $params              = array();
+    $params = array();
     $params['groupName'] = 'Report Email Sender';
-    $params['from']      = '"' . $domainEmailName . '" <' . $domainEmailAddress . '>';
+    $params['from'] = '"' . $domainEmailName . '" <' . $domainEmailAddress . '>';
     //$domainEmailName;
-    $params['toName']  = "";
+    $params['toName'] = "";
     $params['toEmail'] = CRM_Utils_Array::value('email_to', $instanceInfo);
-    $params['cc']      = CRM_Utils_Array::value('email_cc', $instanceInfo);
+    $params['cc'] = CRM_Utils_Array::value('email_cc', $instanceInfo);
     $params['subject'] = CRM_Utils_Array::value('email_subject', $instanceInfo);
     if (empty($instanceInfo['attachments'])) {
       $instanceInfo['attachments'] = array();
@@ -252,8 +252,8 @@ WHERE  inst.report_id = %1";
     }
     // Add the headers.
     $csv .= implode($config->fieldSeparator,
-      $headers
-    ) . "\r\n";
+        $headers
+      ) . "\r\n";
 
     $displayRows = array();
     $value = NULL;
@@ -288,8 +288,8 @@ WHERE  inst.report_id = %1";
       }
       // Add the data row.
       $csv .= implode($config->fieldSeparator,
-        $displayRows
-      ) . "\r\n";
+          $displayRows
+        ) . "\r\n";
     }
 
     return $csv;
@@ -347,8 +347,8 @@ WHERE  inst.report_id = %1";
 
     if (!empty($instanceValues['permission']) &&
       (!(CRM_Core_Permission::check($instanceValues['permission']) ||
-          CRM_Core_Permission::check('administer Reports')
-        ))
+        CRM_Core_Permission::check('administer Reports')
+      ))
     ) {
       return FALSE;
     }
@@ -412,8 +412,8 @@ WHERE  inst.report_id = %1";
     $messages = array("Report Mail Triggered...");
 
     $templateInfo = CRM_Core_OptionGroup::getRowValues('report_template', $optionVal, 'value');
-    $obj          = new CRM_Report_Page_Instance();
-    $is_error     = 0;
+    $obj = new CRM_Report_Page_Instance();
+    $is_error = 0;
     if (strstr(CRM_Utils_Array::value('name', $templateInfo), '_Form')) {
       $instanceInfo = array();
       CRM_Report_BAO_ReportInstance::retrieve(array('id' => $instanceId), $instanceInfo);
@@ -489,8 +489,8 @@ WHERE  inst.report_id = %1";
         // (in other words, there's no point in propagating blank filters).
         foreach ($process_params as $field_name => $field_value) {
           $suffix_position = strrpos($field_name, '_');
-          $suffix          = substr($field_name, $suffix_position);
-          $basename        = substr($field_name, 0, $suffix_position);
+          $suffix = substr($field_name, $suffix_position);
+          $basename = substr($field_name, 0, $suffix_position);
           if ($suffix == '_min' || $suffix == '_max' ||
             $suffix == '_from' || $suffix == '_to' ||
             $suffix == '_relative'
index 910161ac7602c6c2ff662792514af563cb9f90bc..2f4afe7e52b05baec2f4736c546f1dfa0fc37ddf 100644 (file)
@@ -70,8 +70,8 @@ class CRM_SMS_BAO_Provider extends CRM_SMS_DAO_Provider {
   public static function getProviders($selectArr = NULL, $filter = NULL, $getActive = TRUE, $orderBy = 'id') {
 
     $providers = array();
-    $temp      = array();
-    $dao       = new CRM_SMS_DAO_Provider();
+    $temp = array();
+    $dao = new CRM_SMS_DAO_Provider();
     if ($filter && !array_key_exists('is_active', $filter) && $getActive) {
       $dao->is_active = 1;
     }
index 5b0b66af951c58c6c1e9c35ba3f0df037bb0fedb..a919964f157646aeed0f4cf85086dbc842a17986 100644 (file)
@@ -190,7 +190,10 @@ class CRM_SMS_Form_Group extends CRM_Contact_Form_Task {
     $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];
       }
@@ -199,9 +202,9 @@ class CRM_SMS_Form_Group extends CRM_Contact_Form_Task {
     $qf_Group_submit = $this->controller->exportValue($this->_name, '_qf_Group_submit');
     $this->set('name', $params['name']);
 
-    $inGroups    = $values['includeGroups'];
-    $outGroups   = $values['excludeGroups'];
-    $inMailings  = $values['includeMailings'];
+    $inGroups = $values['includeGroups'];
+    $outGroups = $values['excludeGroups'];
+    $inMailings = $values['includeMailings'];
     $outMailings = $values['excludeMailings'];
 
     if (is_array($inGroups)) {
@@ -235,10 +238,10 @@ class CRM_SMS_Form_Group extends CRM_Contact_Form_Task {
       }
     }
 
-    $session            = CRM_Core_Session::singleton();
-    $params['groups']   = $groups;
+    $session = CRM_Core_Session::singleton();
+    $params['groups'] = $groups;
     $params['mailings'] = $mailings;
-    $ids                = array();
+    $ids = array();
     if ($this->get('mailing_id')) {
 
       // don't create a new mass sms if already exists
@@ -249,9 +252,11 @@ class CRM_SMS_Form_Group extends CRM_Contact_Form_Task {
 
       // delete previous includes/excludes, if mailing already existed
       foreach (array(
-        'groups', 'mailings') as $entity) {
-        $mg               = new CRM_Mailing_DAO_MailingGroup();
-        $mg->mailing_id   = $ids['mailing_id'];
+                 'groups',
+                 'mailings'
+               ) as $entity) {
+        $mg = new CRM_Mailing_DAO_MailingGroup();
+        $mg->mailing_id = $ids['mailing_id'];
         $mg->entity_table = ($entity == 'groups') ? $groupTableName : $mailingTableName;
         $mg->find();
         while ($mg->fetch()) {
index d26a2f97c7da359ab69be0755e6ba9108b0dbeb6..c6e532a617e791a82096834c7164f422c092ee3c 100644 (file)
@@ -97,7 +97,10 @@ class CRM_SMS_Form_Provider extends CRM_Core_Form {
       $attributes['title'], TRUE
     );
 
-    $this->addRule('title', ts('This Title already exists in Database.'), 'objectExists', array('CRM_SMS_DAO_Provider', $this->_id));
+    $this->addRule('title', ts('This Title already exists in Database.'), 'objectExists', array(
+        'CRM_SMS_DAO_Provider',
+        $this->_id
+      ));
 
     $this->add('text', 'username', ts('Username'),
       $attributes['username'], TRUE
index 96a55bd12a10c3b874915e778ab6e8495761f1bf..aaa7dfce77827b973eb41acd3533ed90cfa3551e 100644 (file)
@@ -102,8 +102,8 @@ class CRM_SMS_Form_Schedule extends CRM_Core_Form {
 
     $this->addButtons($buttons);
 
-    $preview            = array();
-    $preview['type']    = CRM_Core_DAO::getFieldValue('CRM_Mailing_DAO_Mailing', $this->_mailingID, 'body_html') ? 'html' : 'text';
+    $preview = array();
+    $preview['type'] = CRM_Core_DAO::getFieldValue('CRM_Mailing_DAO_Mailing', $this->_mailingID, 'body_html') ? 'html' : 'text';
     $preview['viewURL'] = CRM_Utils_System::url('civicrm/mailing/view', "reset=1&id={$this->_mailingID}");
     $this->assign_by_ref('preview', $preview);
   }
@@ -138,8 +138,9 @@ class CRM_SMS_Form_Schedule extends CRM_Core_Form {
     }
 
     if (CRM_Utils_Date::format(CRM_Utils_Date::processDate($params['start_date'],
-          $params['start_date_time']
-        )) < CRM_Utils_Date::format(date('YmdHi00'))) {
+        $params['start_date_time']
+      )) < CRM_Utils_Date::format(date('YmdHi00'))
+    ) {
       return array(
         'start_date' => ts('Start date cannot be earlier than the current time.'),
       );
@@ -198,8 +199,8 @@ class CRM_SMS_Form_Schedule extends CRM_Core_Form {
 
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/mailing/browse/scheduled',
-        'reset=1&scheduled=true&sms=1'
-      ));
+      'reset=1&scheduled=true&sms=1'
+    ));
   }
 
   /**
index 95b0842057ce06d64e1098cfd7c24de58d49821c..54d4e8116edb742ddbf72ccbd45be08edc8aad3e 100644 (file)
@@ -125,7 +125,7 @@ class CRM_SMS_Form_Upload extends CRM_Core_Form {
    */
   public function buildQuickForm() {
     $session = CRM_Core_Session::singleton();
-    $config  = CRM_Core_Config::singleton();
+    $config = CRM_Core_Config::singleton();
     $options = array();
     $tempVar = FALSE;
 
@@ -229,8 +229,10 @@ class CRM_SMS_Form_Upload extends CRM_Core_Form {
     $session = CRM_Core_Session::singleton();
     $params['contact_id'] = $session->get('userID');
     $composeFields = array(
-      'SMStemplate', 'SMSsaveTemplate',
-      'SMSupdateTemplate', 'SMSsaveTemplateName',
+      'SMStemplate',
+      'SMSsaveTemplate',
+      'SMSupdateTemplate',
+      'SMSsaveTemplateName',
     );
     $msgTemplate = NULL;
     //mail template is composed
@@ -388,10 +390,10 @@ class CRM_SMS_Form_Upload extends CRM_Core_Form {
       // be a suggestion from someone on how to
       // make it a bit more elegant
 
-      $dummy_mail        = new CRM_Mailing_BAO_Mailing();
-      $mess              = "body_text";
+      $dummy_mail = new CRM_Mailing_BAO_Mailing();
+      $mess = "body_text";
       $dummy_mail->$mess = $str;
-      $tokens            = $dummy_mail->getTokens();
+      $tokens = $dummy_mail->getTokens();
 
       $str = CRM_Utils_Token::replaceSubscribeInviteTokens($str);
       $str = CRM_Utils_Token::replaceDomainTokens($str, $domain, NULL, $tokens['text']);
@@ -413,7 +415,8 @@ class CRM_SMS_Form_Upload extends CRM_Core_Form {
       }
       if (!empty($dataErrors)) {
         $errors['textFile'] = ts('The following errors were detected in %1:', array(
-          1 => $name)) . ' <ul>' . implode('', $dataErrors) . '</ul>';
+            1 => $name
+          )) . ' <ul>' . implode('', $dataErrors) . '</ul>';
       }
     }
 
index d8a3f16e9d8d162742c0d7bb5893af6fec3a2ec6..6e9d533de7be6ca975a57391c75a1bf2033342c1 100644 (file)
  * $Id$
  *
  */
-
 class CRM_SMS_Page_Callback {
 
   public function run() {
     $provider = CRM_SMS_Provider::singleton($_REQUEST);
 
-    if (array_key_exists('status',$_REQUEST)) {
+    if (array_key_exists('status', $_REQUEST)) {
       $provider->callback();
     }
     else {
index c8f8a9060da9bc5706ea7c7899401255b1d2da1a..b6cd521c6ed7bcfb69324680b5b0279407d75a84 100644 (file)
@@ -106,12 +106,14 @@ class CRM_SMS_Page_Provider extends CRM_Core_Page_Basic {
   public function run() {
     // set title and breadcrumb
     CRM_Utils_System::setTitle(ts('Settings - SMS Provider'));
-    $breadCrumb = array(array(
+    $breadCrumb = array(
+      array(
         'title' => ts('SMS Provider'),
         'url' => CRM_Utils_System::url('civicrm/admin/sms/provider',
           'reset=1'
         ),
-      ));
+      )
+    );
     CRM_Utils_System::appendBreadCrumb($breadCrumb);
 
     $this->_id = CRM_Utils_Request::retrieve('id', 'String',
index de2fb2d98d21cee7118470e910fbbf54977b9bec..59883708589c5108f9e9ccf1e63e03011695adc0 100644 (file)
@@ -32,7 +32,6 @@
  * $Id$
  *
  */
-
 abstract class CRM_SMS_Provider {
 
   /**
@@ -55,8 +54,8 @@ abstract class CRM_SMS_Provider {
    * @static
    */
   public static function &singleton($providerParams = array(), $force = FALSE) {
-    $mailingID    = CRM_Utils_Array::value('mailing_id', $providerParams);
-    $providerID   = CRM_Utils_Array::value('provider_id', $providerParams);
+    $mailingID = CRM_Utils_Array::value('mailing_id', $providerParams);
+    $providerID = CRM_Utils_Array::value('provider_id', $providerParams);
     $providerName = CRM_Utils_Array::value('provider', $providerParams);
 
     if (!$providerID && $mailingID) {
@@ -72,7 +71,7 @@ abstract class CRM_SMS_Provider {
     }
 
     $providerName = CRM_Utils_Type::escape($providerName, 'String');
-    $cacheKey     = "{$providerName}_" . (int) $providerID . "_" . (int) $mailingID;
+    $cacheKey = "{$providerName}_" . (int) $providerID . "_" . (int) $mailingID;
 
     if (!isset(self::$_singleton[$cacheKey]) || $force) {
       $ext = CRM_Extension_System::singleton()->getMapper();
@@ -133,7 +132,7 @@ SELECT scheduled_id FROM civicrm_mailing m
 INNER JOIN civicrm_mailing_job mj ON mj.mailing_id = m.id AND mj.id = %1";
       $sourceContactID = CRM_Core_DAO::singleValueQuery($sql, array(1 => array($jobID, 'Integer')));
     }
-    elseif($userID) {
+    elseif ($userID) {
       $sourceContactID = $userID;
     }
     else {
@@ -193,11 +192,11 @@ INNER JOIN civicrm_mailing_job mj ON mj.mailing_id = m.id AND mj.id = %1";
    * @throws CRM_Core_Exception
    */
   public function processInbound($from, $body, $to = NULL, $trackID = NULL) {
-    $formatFrom   = $this->formatPhone($this->stripPhone($from), $like, "like");
-    $escapedFrom  = CRM_Utils_Type::escape($formatFrom, 'String');
+    $formatFrom = $this->formatPhone($this->stripPhone($from), $like, "like");
+    $escapedFrom = CRM_Utils_Type::escape($formatFrom, 'String');
     $fromContactID = CRM_Core_DAO::singleValueQuery('SELECT contact_id FROM civicrm_phone JOIN civicrm_contact ON civicrm_contact.id = civicrm_phone.contact_id WHERE !civicrm_contact.is_deleted AND phone LIKE "%' . $escapedFrom . '"');
 
-    if (! $fromContactID) {
+    if (!$fromContactID) {
       // unknown mobile sender -- create new contact
       // use fake @mobile.sms email address for new contact since civi
       // requires email or name for all contacts
@@ -209,16 +208,18 @@ INNER JOIN civicrm_mailing_job mj ON mj.mailing_id = m.id AND mj.id = %1";
       $contactparams = array(
         'contact_type' => 'Individual',
         'email' => array(
-      1 => array(
-          'location_type_id' => $phoneloc,
-          'email' => $stripFrom . '@mobile.sms',
-        )),
+          1 => array(
+            'location_type_id' => $phoneloc,
+            'email' => $stripFrom . '@mobile.sms',
+          )
+        ),
         'phone' => array(
-      1 => array(
-          'phone_type_id' => $phonetype,
-          'location_type_id' => $phoneloc,
-          'phone' => $stripFrom,
-        )),
+          1 => array(
+            'phone_type_id' => $phonetype,
+            'location_type_id' => $phoneloc,
+            'phone' => $stripFrom,
+          )
+        ),
       );
       $fromContact = CRM_Contact_BAO_Contact::create($contactparams, FALSE, TRUE, FALSE);
       $fromContactID = $fromContact->id;
@@ -291,7 +292,7 @@ INNER JOIN civicrm_mailing_job mj ON mj.mailing_id = m.id AND mj.id = %1";
         $area = "";
         $exch = "";
         $uniq = "";
-        $ext  = $phoneA[1];
+        $ext = $phoneA[1];
         break;
 
       case 7:
@@ -299,7 +300,7 @@ INNER JOIN civicrm_mailing_job mj ON mj.mailing_id = m.id AND mj.id = %1";
         $area = "";
         $exch = substr($phone, 0, 3);
         $uniq = substr($phone, 3, 4);
-        $ext  = $phoneA[1];
+        $ext = $phoneA[1];
         break;
 
       case 10:
@@ -307,7 +308,7 @@ INNER JOIN civicrm_mailing_job mj ON mj.mailing_id = m.id AND mj.id = %1";
         $area = substr($phone, 0, 3);
         $exch = substr($phone, 3, 3);
         $uniq = substr($phone, 6, 4);
-        $ext  = $phoneA[1];
+        $ext = $phoneA[1];
         break;
 
       default:
index f0384f94dd45891baf5ccba96d119fad80c8d69e..ee9e89933af04e9d88476eeca74cbd186cf8082f 100644 (file)
@@ -47,7 +47,7 @@ class CRM_UF_Form_AdvanceSetting extends CRM_UF_Form_Group {
     $form->addElement('checkbox', 'is_map', ts('Enable mapping for this profile?'));
 
     // should we allow updates on a exisitng contact
-    $options   = array();
+    $options = array();
     $options[] = $form->createElement('radio', NULL, NULL, ts('Issue warning and do not save'), 0);
     $options[] = $form->createElement('radio', NULL, NULL, ts('Update the matching contact'), 1);
     $options[] = $form->createElement('radio', NULL, NULL, ts('Allow duplicate contact to be created'), 2);
@@ -59,7 +59,8 @@ class CRM_UF_Form_AdvanceSetting extends CRM_UF_Form_Group {
 
     // add select for groups
     $group = array(
-      '' => ts('- select -')) + $form->_group;
+        '' => ts('- select -')
+      ) + $form->_group;
     $form->_groupElement = &$form->addElement('select', 'group', ts('Limit listings to a specific Group?'), $group);
 
     //add notify field
@@ -85,7 +86,7 @@ class CRM_UF_Form_AdvanceSetting extends CRM_UF_Form_Group {
       $form->_cmsId = TRUE;
     }
 
-    $options   = array();
+    $options = array();
     $options[] = $form->createElement('radio', NULL, NULL, ts('No account create option'), 0);
     $options[] = $form->createElement('radio', NULL, NULL, ts('Give option, but not required'), 1);
     $options[] = $form->createElement('radio', NULL, NULL, ts('Account creation required'), 2);
@@ -93,7 +94,7 @@ class CRM_UF_Form_AdvanceSetting extends CRM_UF_Form_Group {
     $form->addGroup($options, 'is_cms_user', ts('%1 user account registration option?', array(1 => $config->userFramework)));
 
     // options for including Proximity Search in the profile search form
-    $proxOptions   = array();
+    $proxOptions = array();
     $proxOptions[] = $form->createElement('radio', NULL, NULL, ts('None'), 0);
     $proxOptions[] = $form->createElement('radio', NULL, NULL, ts('Optional'), 1);
     $proxOptions[] = $form->createElement('radio', NULL, NULL, ts('Required'), 2);
index 3ac65d89a5dd0f0207ef056e5fc0c32fef356f2c..1f6b9c7d4aa7c9e715af96baf6ba34dcf5f8200e 100644 (file)
@@ -107,10 +107,12 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
 
       $session = CRM_Core_Session::singleton();
       $session->pushUserContext($url);
-      $breadCrumb = array(array(
-      'title' => ts('CiviCRM Profile Fields'),
+      $breadCrumb = array(
+        array(
+          'title' => ts('CiviCRM Profile Fields'),
           'url' => $url,
-        ));
+        )
+      );
       CRM_Utils_System::appendBreadCrumb($breadCrumb);
     }
 
@@ -292,7 +294,8 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
       $defaultLocation = $this->_location_types[$defaultLocationType->id];
       unset($this->_location_types[$defaultLocationType->id]);
       $this->_location_types = array(
-        $defaultLocationType->id => $defaultLocation) + $this->_location_types;
+          $defaultLocationType->id => $defaultLocation
+        ) + $this->_location_types;
     }
 
     $this->_location_types = array('Primary') + $this->_location_types;
@@ -366,8 +369,8 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
     }
 
     $this->_defaults = array();
-    $js              = "<script type='text/javascript'>\n";
-    $formName        = "document.{$this->_name}";
+    $js = "<script type='text/javascript'>\n";
+    $formName = "document.{$this->_name}";
 
     $alreadyMixProfile = FALSE;
     if (CRM_Core_BAO_UFField::checkProfileType($this->_gid)) {
@@ -505,7 +508,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
     if ($this->_action & CRM_Core_Action::DELETE) {
       $fieldValues = array('uf_group_id' => $this->_gid);
       CRM_Utils_Weight::delWeight('CRM_Core_DAO_UFField', $this->_id, $fieldValues);
-      $deleted     = CRM_Core_BAO_UFField::del($this->_id);
+      $deleted = CRM_Core_BAO_UFField::del($this->_id);
 
       //update group_type every time. CRM-3608
       if ($this->_gid && $deleted) {
@@ -558,7 +561,10 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
       $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 ($ufField->field_name == 'state_province') {
@@ -586,8 +592,8 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
         CRM_Core_BAO_UFGroup::updateGroupTypes($this->_gid, $fieldsType);
       }
       CRM_Core_Session::setStatus(ts('Your CiviCRM Profile Field \'%1\' has been saved to \'%2\'.',
-          array(1 => $name, 2 => $this->_title)
-        ), ts('Profile Field Saved'), 'success');
+        array(1 => $name, 2 => $this->_title)
+      ), ts('Profile Field Saved'), 'success');
     }
     $buttonName = $this->controller->getButtonName();
 
@@ -595,13 +601,13 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
     if ($buttonName == $this->getButtonName('next', 'new')) {
       CRM_Core_Session::setStatus(ts(' You can add another profile field.'), '', 'info');
       $session->replaceUserContext(CRM_Utils_System::url('civicrm/admin/uf/group/field/add',
-          "reset=1&action=add&gid={$this->_gid}&sbr={$showBestResult}"
-        ));
+        "reset=1&action=add&gid={$this->_gid}&sbr={$showBestResult}"
+      ));
     }
     else {
       $session->replaceUserContext(CRM_Utils_System::url('civicrm/admin/uf/group/field',
-          "reset=1&action=browse&gid={$this->_gid}"
-        ));
+        "reset=1&action=browse&gid={$this->_gid}"
+      ));
       $session->set('showBestResult', $showBestResult);
     }
   }
@@ -623,14 +629,22 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
    */
   public static function formRuleSubType($fieldType, $groupType, $errors) {
     if (in_array($fieldType, array(
-      'Participant', 'Contribution', 'Membership', 'Activity'))) {
+      'Participant',
+      'Contribution',
+      'Membership',
+      'Activity'
+    ))) {
       $individualSubTypes = CRM_Contact_BAO_ContactType::subTypes('Individual');
       foreach ($groupType as $value) {
         if (!in_array($value, $individualSubTypes) &&
           !in_array($value, array(
-            'Participant', 'Contribution', 'Membership',
-              'Individual', 'Contact', 'Activity',
-            ))
+            'Participant',
+            'Contribution',
+            'Membership',
+            'Individual',
+            'Contact',
+            'Activity',
+          ))
         ) {
           $errors['field_name'] = ts('Cannot add or update profile field "%1" with combination of Household or Organization or any subtypes of Household or Organisation.', array(1 => $fieldType));
           break;
@@ -671,7 +685,12 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
   public static function formRuleCustomDataExtentColumnValue($customField, $gid, $fieldType, &$errors) {
     // fix me : check object $customField
     if (in_array($fieldType, array(
-          'Participant', 'Contribution', 'Membership', 'Activity', 'Case'))) {
+      'Participant',
+      'Contribution',
+      'Membership',
+      'Activity',
+      'Case'
+    ))) {
       $params = array('id' => $customField->custom_group_id);
       $customGroup = array();
       CRM_Core_BAO_CustomGroup::retrieve($params, $customGroup);
@@ -758,11 +777,11 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
    * @static
    */
   public static function formRule($fields, $files, $self) {
-    $is_required     = CRM_Utils_Array::value('is_required', $fields, FALSE);
+    $is_required = CRM_Utils_Array::value('is_required', $fields, FALSE);
     $is_registration = CRM_Utils_Array::value('is_registration', $fields, FALSE);
-    $is_view         = CRM_Utils_Array::value('is_view', $fields, FALSE);
-    $in_selector     = CRM_Utils_Array::value('in_selector', $fields, FALSE);
-    $is_active       = CRM_Utils_Array::value('is_active', $fields, FALSE);
+    $is_view = CRM_Utils_Array::value('is_view', $fields, FALSE);
+    $in_selector = CRM_Utils_Array::value('in_selector', $fields, FALSE);
+    $is_active = CRM_Utils_Array::value('is_active', $fields, FALSE);
 
     $errors = array();
     if ($is_view && $is_registration) {
@@ -778,7 +797,12 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
     }
 
     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));
     }
 
@@ -966,7 +990,10 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
         if (CRM_Contact_BAO_ContactType::isaSubType($fieldType)) {
           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));
+              $errors['field_name'] = ts('Cannot add or update profile field type "%1" with combination of "%2".', array(
+                  1 => $fieldType,
+                  2 => $profileType
+                ));
             }
           }
           else {
@@ -975,7 +1002,10 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
               $profileType != $basicType &&
               $profileType != 'Contact'
             ) {
-              $errors['field_name'] = ts('Cannot add or update profile field type "%1" with combination of "%2".', array(1 => $fieldType, 2 => $profileType));
+              $errors['field_name'] = ts('Cannot add or update profile field type "%1" with combination of "%2".', array(
+                  1 => $fieldType,
+                  2 => $profileType
+                ));
             }
           }
         }
index cbb7a55e8dc73edf39390d5796264ad6288ed50f..99571012a1fc683a09e8ab78d62da63c5dc39b71 100644 (file)
@@ -80,8 +80,8 @@ class CRM_UF_Form_Group extends CRM_Core_Form {
     }
     elseif ($this->_action & (CRM_Core_Action::DISABLE | CRM_Core_Action::DELETE)) {
       $ufGroup['module'] = implode(' , ', CRM_Core_BAO_UFGroup::getUFJoinRecord($this->_id, TRUE));
-      $status            = 0;
-      $status            = CRM_Core_BAO_UFGroup::usedByModule($this->_id);
+      $status = 0;
+      $status = CRM_Core_BAO_UFGroup::usedByModule($this->_id);
       if ($this->_action & (CRM_Core_Action::DISABLE)) {
         if ($status) {
           $message = 'This profile is currently used for ' . $ufGroup['module'] . '. If you disable the profile - it will be removed from these forms and/or modules. Do you want to continue?';
@@ -251,9 +251,16 @@ class CRM_UF_Form_Group extends CRM_Core_Form {
 
       $showAdvanced = 0;
       $advFields = array(
-        'group', 'post_URL', 'cancel_URL',
-        'add_captcha', 'is_map', 'is_uf_link', 'is_edit_link',
-        'is_update_dupe', 'is_cms_user', 'is_proximity_search',
+        'group',
+        'post_URL',
+        'cancel_URL',
+        'add_captcha',
+        'is_map',
+        'is_uf_link',
+        'is_edit_link',
+        'is_update_dupe',
+        'is_cms_user',
+        'is_proximity_search',
       );
       foreach ($advFields as $key) {
         if (!empty($defaults[$key])) {
@@ -299,9 +306,9 @@ class CRM_UF_Form_Group extends CRM_Core_Form {
     $name .= $self->_id ? '_' . $self->_id : '';
     $query = 'select count(*) from civicrm_uf_group where ( name like %1 ) and id != %2';
     $pCnt = CRM_Core_DAO::singleValueQuery($query, array(
-    1 => array($name, 'String'),
-        2 => array((int) $self->_id, 'Integer'),
-      ));
+      1 => array($name, 'String'),
+      2 => array((int) $self->_id, 'Integer'),
+    ));
     if ($pCnt) {
       $errors['title'] = ts('Profile \'%1\' already exists in Database.', array(1 => $title));
     }
@@ -368,8 +375,8 @@ class CRM_UF_Form_Group extends CRM_Core_Form {
         $action = CRM_Core_Resources::singleton()->ajaxPopupsEnabled ? '' : '/add';
         $url = CRM_Utils_System::url("civicrm/admin/uf/group/field$action", 'reset=1&new=1&gid=' . $ufGroup->id . '&action=' . ($action ? 'add' : 'browse'));
         CRM_Core_Session::setStatus(ts('Your CiviCRM Profile \'%1\' has been added. You can add fields to this profile now.',
-            array(1 => $ufGroup->title)
-          ), ts('Profile Added'), 'success');
+          array(1 => $ufGroup->title)
+        ), ts('Profile Added'), 'success');
       }
       $session = CRM_Core_Session::singleton();
       $session->replaceUserContext($url);
index 529ce34c7de07241599fdc9e49fbc1602cd23542..0f4e6ccdb8a73d6f98d8fe5583ec7380a41a63af 100644 (file)
@@ -217,8 +217,8 @@ class CRM_UF_Page_Field extends CRM_Core_Page {
     // set the userContext stack
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/admin/uf/group/field',
-        'reset=1&action=browse&gid=' . $this->_gid
-      ));
+      'reset=1&action=browse&gid=' . $this->_gid
+    ));
     $controller->set('gid', $this->_gid);
     $controller->setEmbedded(TRUE);
     $controller->process();
@@ -288,8 +288,8 @@ class CRM_UF_Page_Field extends CRM_Core_Page {
     $controller = new CRM_Core_Controller_Simple('CRM_UF_Form_Preview', ts('Preview Custom Data'), CRM_Core_Action::PREVIEW);
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/admin/uf/group/field',
-        'reset=1&action=browse&gid=' . $this->_gid
-      ));
+      'reset=1&action=browse&gid=' . $this->_gid
+    ));
     $controller->set('fieldId', $fieldId);
     $controller->set('id', $groupId);
     $controller->setEmbedded(TRUE);
index dec0300d42e3e94a140ed87150a038956d94dcc7..db9c0592a55e21a2c28699d98a160985fe18d2d3 100644 (file)
@@ -19,7 +19,7 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page {
     $loaded = TRUE;
 
     CRM_Core_Resources::singleton()
-      ->addSettingsFactory(function() {
+      ->addSettingsFactory(function () {
         return array(
           'PseudoConstant' => array(
             'locationType' => CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'),
@@ -210,7 +210,8 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page {
         case 'Household':
           if ($field['field_type'] != $extends && $field['field_type'] != 'Contact'
             //CRM-15595 check if subtype
-            && !in_array($field['field_type'], CRM_Contact_BAO_ContactType::subTypes($extends))) {
+            && !in_array($field['field_type'], CRM_Contact_BAO_ContactType::subTypes($extends))
+          ) {
             continue 2;
           }
           break;
index f72b5a5360f451da0236d19aeb063256699e6671..a688e0d4649c4c86254f72370f3451da4040297c 100644 (file)
@@ -417,8 +417,10 @@ SET    version = '$version'
   public function processSQL($rev) {
     $sqlFile = implode(DIRECTORY_SEPARATOR,
       array(
-        dirname(__FILE__), 'Incremental',
-        'sql', $rev . '.mysql',
+        dirname(__FILE__),
+        'Incremental',
+        'sql',
+        $rev . '.mysql',
       )
     );
     $tplFile = "$sqlFile.tpl";
@@ -498,17 +500,17 @@ SET    version = '$version'
     $minPhpVersion = '5.3.3';
     if (version_compare($phpVersion, $minPhpVersion) < 0) {
       $error = ts('CiviCRM %3 requires PHP version %1 (or newer), but the current system uses %2 ',
-               array(
-                 1 => $minPhpVersion,
-                 2 => $phpVersion,
-                 3 => $latestVer,
-               ));
+        array(
+          1 => $minPhpVersion,
+          2 => $phpVersion,
+          3 => $latestVer,
+        ));
     }
 
     // check for mysql trigger privileges
     if (!CRM_Core_DAO::checkTriggerViewPermission(FALSE, TRUE)) {
       $error = ts('CiviCRM %1 requires MySQL trigger privileges.',
-               array(1 => $latestVer));
+        array(1 => $latestVer));
     }
 
     if (CRM_Core_DAO::getGlobalSetting('thread_stack', 0) < (1024 * self::MINIMUM_THREAD_STACK)) {
@@ -571,17 +573,17 @@ SET    version = '$version'
       CRM_Core_Error::fatal(ts('Failed to find or create queueing table'));
     }
     $queue = CRM_Queue_Service::singleton()->create(array(
-        'name' => self::QUEUE_NAME,
-        'type' => 'Sql',
-        'reset' => TRUE,
-      ));
+      'name' => self::QUEUE_NAME,
+      'type' => 'Sql',
+      'reset' => TRUE,
+    ));
 
     $revisions = $upgrade->getRevisionSequence();
     foreach ($revisions as $rev) {
       // proceed only if $currentVer < $rev
       if (version_compare($currentVer, $rev) < 0) {
         $beginTask = new CRM_Queue_Task(
-          // callback
+        // callback
           array('CRM_Upgrade_Form', 'doIncrementalUpgradeStart'),
           // arguments
           array($rev),
@@ -590,7 +592,7 @@ SET    version = '$version'
         $queue->createItem($beginTask);
 
         $task = new CRM_Queue_Task(
-          // callback
+        // callback
           array('CRM_Upgrade_Form', 'doIncrementalUpgradeStep'),
           // arguments
           array($rev, $currentVer, $latestVer, $postUpgradeMessageFile),
@@ -599,7 +601,7 @@ SET    version = '$version'
         $queue->createItem($task);
 
         $task = new CRM_Queue_Task(
-          // callback
+        // callback
           array('CRM_Upgrade_Form', 'doIncrementalUpgradeFinish'),
           // arguments
           array($rev, $currentVer, $latestVer, $postUpgradeMessageFile),
@@ -656,7 +658,10 @@ SET    version = '$version'
     // pre-db check for major release.
     if ($upgrade->checkVersionRelease($rev, 'alpha1')) {
       if (!(is_callable(array(
-        $versionObject, 'verifyPreDBstate')))) {
+        $versionObject,
+        'verifyPreDBstate'
+      )))
+      ) {
         CRM_Core_Error::fatal("verifyPreDBstate method was not found for $rev");
       }
 
@@ -673,7 +678,9 @@ SET    version = '$version'
     $upgrade->setSchemaStructureTables($rev);
 
     if (is_callable(array(
-      $versionObject, $phpFunctionName))) {
+      $versionObject,
+      $phpFunctionName
+    ))) {
       $versionObject->$phpFunctionName($rev, $originalVer, $latestVer);
     }
     else {
@@ -682,7 +689,9 @@ SET    version = '$version'
 
     // set post-upgrade-message if any
     if (is_callable(array(
-      $versionObject, 'setPostUpgradeMessage'))) {
+      $versionObject,
+      'setPostUpgradeMessage'
+    ))) {
       $postUpgradeMessage = file_get_contents($postUpgradeMessageFile);
       $versionObject->setPostUpgradeMessage($postUpgradeMessage, $rev);
       file_put_contents($postUpgradeMessageFile, $postUpgradeMessage);
@@ -769,7 +778,9 @@ SET    version = '$version'
       ) {
         $versionObject = $this->incrementalPhpObject($rev);
         if (is_callable(array(
-          $versionObject, 'setPreUpgradeMessage'))) {
+          $versionObject,
+          'setPreUpgradeMessage'
+        ))) {
           $versionObject->setPreUpgradeMessage($preUpgradeMessage, $rev, $currentVer);
         }
       }
index 52db1bc9a0c6a0d2a4ce6f032de65acb822b1d21..9ac4c313d1a1dc25de8980cee3236b8f754c7e9c 100644 (file)
@@ -61,9 +61,9 @@ class CRM_Upgrade_Headless {
 
     $postUpgradeMessageFile = CRM_Utils_File::tempnam('civicrm-post-upgrade');
     $queueRunner = new CRM_Queue_Runner(array(
-        'title' => ts('CiviCRM Upgrade Tasks'),
-        'queue' => CRM_Upgrade_Form::buildQueue($currentVer, $latestVer, $postUpgradeMessageFile),
-      ));
+      'title' => ts('CiviCRM Upgrade Tasks'),
+      'queue' => CRM_Upgrade_Form::buildQueue($currentVer, $latestVer, $postUpgradeMessageFile),
+    ));
     $queueResult = $queueRunner->runAll();
     if ($queueResult !== TRUE) {
       $errorMessage = CRM_Core_Error::formatTextException($queueResult['exception']);
index 09932f59169fdca3643c700b961dc58ca5f6af64..b893d3b2b796199ff01db9f0b31aadd46eaf208c 100644 (file)
@@ -81,7 +81,10 @@ SELECT  id
       version_compare($upgradeTo, '3.4.beta3') >= 0
     ) {
       $config = CRM_Core_Config::singleton();
-      $preUpgradeMessage .= '<br />' . ts("As per <a href='%1'>the related blog post</a>, we are making contact names, addresses and mailings monolingual; the values entered for the default locale (%2) will be preserved and values for other locales removed.", array(1 => 'http://civicrm.org/blogs/shot/multilingual-civicrm-3440-making-some-fields-monolingual', 2 => $config->lcMessages));
+      $preUpgradeMessage .= '<br />' . ts("As per <a href='%1'>the related blog post</a>, we are making contact names, addresses and mailings monolingual; the values entered for the default locale (%2) will be preserved and values for other locales removed.", array(
+            1 => 'http://civicrm.org/blogs/shot/multilingual-civicrm-3440-making-some-fields-monolingual',
+            2 => $config->lcMessages
+          ));
     }
 
     if (version_compare($currentVer, '3.4.6') == -1 &&
@@ -103,13 +106,13 @@ SELECT  id
     if (file_exists($ofcFile)) {
       if (@unlink($ofcFile)) {
         $preUpgradeMessage .= '<br />' . ts('This system included an outdated, insecure script (%1). The file was automatically deleted.', array(
-          1 => $ofcFile,
-        ));
+            1 => $ofcFile,
+          ));
       }
       else {
         $preUpgradeMessage .= '<br />' . ts('This system includes an outdated, insecure script (%1). Please delete it.', array(
-          1 => $ofcFile,
-        ));
+            1 => $ofcFile,
+          ));
       }
     }
 
@@ -158,9 +161,9 @@ SELECT  id
       return;
     }
 
-    $html     = NULL;
+    $html = NULL;
     $pathName = dirname(dirname(__FILE__));
-    $flag     = FALSE;
+    $flag = FALSE;
     foreach ($workflows as $workflow => $title) {
       $name = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue',
         $workflow,
@@ -198,7 +201,10 @@ SELECT  id
     if ($flag == TRUE) {
       $html = "<ul>" . $html . "<ul>";
 
-      $message .= '<br />' . ts("The default copies of the message templates listed below will be updated to handle new features or correct a problem. Your installation has customized versions of these message templates, and you will need to apply the updates manually after running this upgrade. <a href='%1' style='color:white; text-decoration:underline; font-weight:bold;' target='_blank'>Click here</a> for detailed instructions. %2", array(1 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Message+Templates#MessageTemplates-UpgradesandCustomizedSystemWorkflowTemplates', 2 => $html));
+      $message .= '<br />' . ts("The default copies of the message templates listed below will be updated to handle new features or correct a problem. Your installation has customized versions of these message templates, and you will need to apply the updates manually after running this upgrade. <a href='%1' style='color:white; text-decoration:underline; font-weight:bold;' target='_blank'>Click here</a> for detailed instructions. %2", array(
+            1 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Message+Templates#MessageTemplates-UpgradesandCustomizedSystemWorkflowTemplates',
+            2 => $html
+          ));
     }
   }
 
@@ -242,7 +248,10 @@ SELECT  id
 
         if (!empty($subTypeTemplates)) {
           $subTypeTemplates = implode(',', $subTypeTemplates);
-          $postUpgradeMessage .= '<br />' . ts('You are using custom template for contact subtypes: %1.', array(1 => $subTypeTemplates)) . '<br />' . ts('You need to move these subtype templates to the SubType directory in %1 and %2 respectively.', array(1 => 'CRM/Contact/Form/Edit', 2 => 'CRM/Contact/Page/View'));
+          $postUpgradeMessage .= '<br />' . ts('You are using custom template for contact subtypes: %1.', array(1 => $subTypeTemplates)) . '<br />' . ts('You need to move these subtype templates to the SubType directory in %1 and %2 respectively.', array(
+                1 => 'CRM/Contact/Form/Edit',
+                2 => 'CRM/Contact/Page/View'
+              ));
         }
       }
     }
@@ -295,9 +304,9 @@ SELECT  count( id ) as statusCount
       $template = CRM_Core_Smarty::singleton();
 
       $eventFees = array();
-      $query     = "SELECT og.id ogid FROM civicrm_option_group og WHERE og.name LIKE  %1";
-      $params    = array(1 => array('civicrm_event_page.amount%', 'String'));
-      $dao       = CRM_Core_DAO::executeQuery($query, $params);
+      $query = "SELECT og.id ogid FROM civicrm_option_group og WHERE og.name LIKE  %1";
+      $params = array(1 => array('civicrm_event_page.amount%', 'String'));
+      $dao = CRM_Core_DAO::executeQuery($query, $params);
       while ($dao->fetch()) {
         $eventFees[$dao->ogid] = $dao->ogid;
       }
@@ -379,13 +388,15 @@ SELECT  count( id ) as statusCount
   public static function upgrade_2_2_beta2($rev) {
     $template = CRM_Core_Smarty::singleton();
     if (!CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue',
-        'CRM_Contact_Form_Search_Custom_ZipCodeRange', 'id', 'name'
-      )) {
+      'CRM_Contact_Form_Search_Custom_ZipCodeRange', 'id', 'name'
+    )
+    ) {
       $template->assign('customSearchAbsentAll', TRUE);
     }
     elseif (!CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue',
-        'CRM_Contact_Form_Search_Custom_MultipleValues', 'id', 'name'
-      )) {
+      'CRM_Contact_Form_Search_Custom_MultipleValues', 'id', 'name'
+    )
+    ) {
       $template->assign('customSearchAbsent', TRUE);
     }
     $upgrade = new CRM_Upgrade_Form();
@@ -538,7 +549,9 @@ SELECT  count( id ) as statusCount
     // newly added permission 'edit_all_events', CRM-5472
     $config = CRM_Core_Config::singleton();
     if (is_callable(array(
-      $config->userSystem, 'replacePermission'))) {
+      $config->userSystem,
+      'replacePermission'
+    ))) {
       $config->userSystem->replacePermission('access CiviEvent', array('access CiviEvent', 'edit all events'));
     }
 
index 0426a7aa78accac072860e699b87a55ab8edfebc..a8b451f529e37debe62116ddaf01a2865f48dfec 100644 (file)
@@ -109,7 +109,8 @@ AND TABLE_SCHEMA = %1
     $dao = CRM_Core_DAO::executeQuery($query, $params, TRUE, NULL, FALSE, FALSE);
     if ($dao->fetch()) {
       if ($dao->CONSTRAINT_NAME == 'FK_civicrm_msg_template_pdf_format_id' ||
-        $dao->CONSTRAINT_NAME == 'pdf_format_id') {
+        $dao->CONSTRAINT_NAME == 'pdf_format_id'
+      ) {
         $sqlDropFK = "ALTER TABLE `civicrm_msg_template`
 DROP FOREIGN KEY `{$dao->CONSTRAINT_NAME}`,
 DROP KEY `{$dao->CONSTRAINT_NAME}`";
@@ -139,7 +140,10 @@ DROP KEY `{$dao->CONSTRAINT_NAME}`";
         FROM {$tableName}")->getDatabaseResult()->fetchRow();
       for ($startId = $minId; $startId <= $maxId; $startId += self::BATCH_SIZE) {
         $endId = $startId + self::BATCH_SIZE - 1;
-        $title = ts("Upgrade DB to 4.5.beta9: Fix line items for {$label} (%1 => %2)", array(1 => $startId, 2 => $endId));
+        $title = ts("Upgrade DB to 4.5.beta9: Fix line items for {$label} (%1 => %2)", array(
+            1 => $startId,
+            2 => $endId
+          ));
         $this->addTask($title, 'task_4_5_0_fixLineItem', $startId, $endId, $label);
       }
     }
index c1c0d19bc31e49451b402b081fbdd0c68dc82fa5..0d7898140c909f82b9dc8351190fccecfdb776d7 100644 (file)
@@ -69,8 +69,8 @@ class CRM_Upgrade_Incremental_php_FourFour {
       }
       if ($oversizedEntries > 0) {
         $preUpgradeMessage .= '<br/>' . ts("WARNING: There are %1 word-replacement entries which will not be valid in v4.4+ (eg with over 255 characters). They will be dropped during upgrade. For details, consult the CiviCRM log.", array(
-          1 => $oversizedEntries,
-        ));
+            1 => $oversizedEntries,
+          ));
       }
     }
   }
@@ -102,7 +102,10 @@ LEFT JOIN civicrm_contribution cc ON ceft.entity_id = cc.id
 WHERE ceft.entity_table = 'civicrm_contribution' AND cft.payment_instrument_id IS NULL;";
       $dao = CRM_Core_DAO::executeQuery($query);
       if ($dao->N) {
-        $postUpgradeMessage .= '<br /><br /><strong>' . ts('Your database contains %1 financial transaction records with no payment instrument (Paid By is empty). If you use the Accounting Batches feature this may result in unbalanced transactions. If you do not use this feature, you can ignore the condition (although you will be required to select a Paid By value for new transactions). <a href="%2" target="_blank">You can review steps to correct transactions with missing payment instruments on the wiki.</a>', array(1 => $dao->N, 2 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Fixing+Transactions+Missing+a+Payment+Instrument+-+4.4.3+Upgrades')) . '</strong>';
+        $postUpgradeMessage .= '<br /><br /><strong>' . ts('Your database contains %1 financial transaction records with no payment instrument (Paid By is empty). If you use the Accounting Batches feature this may result in unbalanced transactions. If you do not use this feature, you can ignore the condition (although you will be required to select a Paid By value for new transactions). <a href="%2" target="_blank">You can review steps to correct transactions with missing payment instruments on the wiki.</a>', array(
+              1 => $dao->N,
+              2 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Fixing+Transactions+Missing+a+Payment+Instrument+-+4.4.3+Upgrades'
+            )) . '</strong>';
       }
     }
     if ($rev == '4.4.6') {
@@ -391,7 +394,7 @@ ALTER TABLE civicrm_dashboard
           // For anyone who upgraded 4.4.6 release (eg 4.4.0=>4.4.6), the $newImageUrl incorrectly used backend URLs.
           // For anyone who skipped 4.4.6 (eg 4.4.0=>4.4.7), the $newImageUrl correctly uses frontend URLs
           self::setContactImageUrl($dao->id,
-              CRM_Utils_System::url('civicrm/contact/imagefile', 'photo=' . $photo, TRUE, NULL, TRUE, TRUE));
+            CRM_Utils_System::url('civicrm/contact/imagefile', 'photo=' . $photo, TRUE, NULL, TRUE, TRUE));
         }
         else {
           $failures[$dao->id] = $dao->image_url;
@@ -792,7 +795,7 @@ CREATE TABLE IF NOT EXISTS `civicrm_word_replacement` (
     // add civicrm_report_instance.name
 
     $sql = "SELECT count(*) FROM information_schema.columns "
-     . "WHERE table_schema = database() AND table_name = 'civicrm_report_instance' AND COLUMN_NAME = 'name' ";
+      . "WHERE table_schema = database() AND table_name = 'civicrm_report_instance' AND COLUMN_NAME = 'name' ";
 
     $res = CRM_Core_DAO::singleValueQuery($sql);
 
index 3befdf7d2e58e90f1e4230cc92afa9943e83cc12..9e62f02e604d278cd60e8b031d2fa94dc984b4ae 100644 (file)
@@ -71,11 +71,10 @@ class CRM_Upgrade_Incremental_php_FourSix {
   public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) {
     if ($rev == '4.6.alpha1') {
       $postUpgradeMessage .= '<br /><br />' . ts('Default versions of the following System Workflow Message Templates have been modified to handle new functionality: <ul><li>Events - Registration Confirmation and Receipt (on-line)</li><li>Events - Registration Confirmation and Receipt (off-line)</li><li>Contributions - Receipt (on-line)</li><li>Contributions - Receipt (off-line)</li><li>Memberships - Receipt (on-line)</li><li>Memberships - Signup and Renewal Receipts (off-line)</li></ul> If you have modified these templates, please review the new default versions and implement updates as needed to your copies (Administer > Communications > Message Templates > System Workflow Messages).');
-   }
+    }
   }
 
 
-
   /**
    * (Queue Task Callback)
    */
index 6e3a2817f440d8bca5bbe8aed403bc1e99520ea7..b57ede35a9576b2354841cd88074584f9906e63f 100644 (file)
@@ -66,9 +66,9 @@ class CRM_Upgrade_Incremental_php_FourThree {
 
       if ($count > 0) {
         $error = ts("There is a data integrity issue with this CiviCRM database. It contains %1 contribution records which are linked to contact records that have been deleted. You will need to correct this manually before you can run the upgrade. Use the following MySQL query to identify the problem records: %2 These records will need to be deleted or linked to an existing contact record.", array(
-            1 => $count,
-            2 => '<em>SELECT ct.* FROM civicrm_contribution ct LEFT JOIN civicrm_contact c ON ct.contact_id = c.id WHERE c.id IS NULL;</em>',
-          ));
+          1 => $count,
+          2 => '<em>SELECT ct.* FROM civicrm_contribution ct LEFT JOIN civicrm_contact c ON ct.contact_id = c.id WHERE c.id IS NULL;</em>',
+        ));
         CRM_Core_Error::fatal($error);
         return FALSE;
       }
index b33e7826db80aadf4261214b35b65598edc3fb11..33ac27ea501752bc1bdb9eb64db539ce5fea6401 100644 (file)
@@ -108,17 +108,17 @@ ORDER BY mp.contribution_id, mp.membership_id";
       // note: error conditions are also checked in upgrade_4_2_beta2()
       if (!defined('CIVICRM_SETTINGS_PATH')) {
         $preUpgradeMessage .= '<br />' . ts('Could not determine path to civicrm.settings.php. Please manually locate it and add these lines at the bottom: <pre>%1</pre>', array(
-          1 => self::SETTINGS_SNIPPET,
-        ));
+            1 => self::SETTINGS_SNIPPET,
+          ));
       }
       elseif (preg_match(self::SETTINGS_SNIPPET_PATTERN, file_get_contents(CIVICRM_SETTINGS_PATH))) {
         // OK, nothing to do
       }
       elseif (!is_writable(CIVICRM_SETTINGS_PATH)) {
         $preUpgradeMessage .= '<br />' . ts('The settings file (%1) must be updated. Please make it writable or manually add these lines:<pre>%2</pre>', array(
-          1 => CIVICRM_SETTINGS_PATH,
-          2 => self::SETTINGS_SNIPPET,
-        ));
+            1 => CIVICRM_SETTINGS_PATH,
+            2 => self::SETTINGS_SNIPPET,
+          ));
       }
     }
     if ($rev == '4.2.2' && version_compare($currentVer, '3.3.alpha1') >= 0) {
@@ -160,8 +160,8 @@ INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'de
       $config = CRM_Core_Config::singleton();
       if (!empty($config->extensionsDir)) {
         $postUpgradeMessage .= '<br />' . ts('Please <a href="%1" target="_blank">configure the Extension Resource URL</a>.', array(
-          1 => CRM_Utils_System::url('civicrm/admin/setting/url', 'reset=1'),
-        ));
+            1 => CRM_Utils_System::url('civicrm/admin/setting/url', 'reset=1'),
+          ));
       }
     }
     if ($rev == '4.2.7') {
@@ -177,10 +177,10 @@ INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'de
     //drop foreign key queries of CRM-9850
     $params = array();
     $tables = array(
-    'civicrm_contribution_page' => 'FK_civicrm_contribution_page_payment_processor_id',
-                    'civicrm_event' => 'FK_civicrm_event_payment_processor_id',
-                    'civicrm_group' => 'FK_civicrm_group_saved_search_id',
-                    );
+      'civicrm_contribution_page' => 'FK_civicrm_contribution_page_payment_processor_id',
+      'civicrm_event' => 'FK_civicrm_event_payment_processor_id',
+      'civicrm_group' => 'FK_civicrm_group_saved_search_id',
+    );
     foreach ($tables as $tableName => $fKey) {
       $foreignKeyExists = CRM_Core_DAO::checkConstraintExists($tableName, $fKey);
       if ($foreignKeyExists) {
@@ -396,15 +396,15 @@ HAVING COUNT(cpse.price_set_id) > 1 AND MIN(cpse1.id) <> cpse.id ";
   public static function task_4_2_alpha1_createPriceSets(CRM_Queue_TaskContext $ctx, $rev) {
     $upgrade = new CRM_Upgrade_Form();
     $daoName = array(
-        'civicrm_contribution_page' => array(
-          'CRM_Contribute_BAO_ContributionPage',
-          CRM_Core_Component::getComponentID('CiviContribute'),
-        ),
-        'civicrm_event' => array(
-          'CRM_Event_BAO_Event',
-          CRM_Core_Component::getComponentID('CiviEvent'),
-        ),
-      );
+      'civicrm_contribution_page' => array(
+        'CRM_Contribute_BAO_ContributionPage',
+        CRM_Core_Component::getComponentID('CiviContribute'),
+      ),
+      'civicrm_event' => array(
+        'CRM_Event_BAO_Event',
+        CRM_Core_Component::getComponentID('CiviEvent'),
+      ),
+    );
 
     // get all option group used for event and contribution page
     $query = "
@@ -433,8 +433,9 @@ WHERE     cpse.price_set_id IS NULL";
     while ($dao->fetch()) {
       $addTo[2] = $dao->contribution_page_id;
       $options = array(
-      'otherAmount' => $dao->is_allow_other_amount,
-                      'membership' => $dao->membership_block_id);
+        'otherAmount' => $dao->is_allow_other_amount,
+        'membership' => $dao->membership_block_id
+      );
       self::createPriceSet($daoName, $addTo, $options);
     }
 
@@ -461,7 +462,7 @@ WHERE     cpse.price_set_id IS NULL";
    */
   public static function createPriceSet($daoName, $addTo, $options = array()) {
     $query = "SELECT title FROM {$addTo[0]} where id =%1";
-    $setParams['title']  = CRM_Core_DAO::singleValueQuery($query,
+    $setParams['title'] = CRM_Core_DAO::singleValueQuery($query,
       array(1 => array($addTo[2], 'Integer'))
     );
     $pageTitle = strtolower(CRM_Utils_String::munge($setParams['title'], '_', 245));
@@ -486,7 +487,7 @@ WHERE     cpse.price_set_id IS NULL";
       return;
     }
 
-    if (! CRM_Core_DAO::getFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_BAO_Set', $pageTitle, 'id', 'name', TRUE)) {
+    if (!CRM_Core_DAO::getFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_BAO_Set', $pageTitle, 'id', 'name', TRUE)) {
       $setParams['name'] = $pageTitle;
     }
     else {
@@ -530,28 +531,28 @@ WHERE     cpse.price_set_id IS NULL";
 
     }
     if (!empty($options['membership'])) {
-      $dao               = new CRM_Member_DAO_MembershipBlock();
+      $dao = new CRM_Member_DAO_MembershipBlock();
       $dao->entity_table = 'civicrm_contribution_page';
-      $dao->entity_id    = $addTo[2];
+      $dao->entity_id = $addTo[2];
 
       if ($dao->find(TRUE)) {
         if ($dao->membership_types) {
           $fieldParams = array(
-            'name'               => strtolower(CRM_Utils_String::munge("Membership Amount", '_', 245)),
-            'label'              => "Membership Amount",
-            'is_required'        => $dao->is_required,
+            'name' => strtolower(CRM_Utils_String::munge("Membership Amount", '_', 245)),
+            'label' => "Membership Amount",
+            'is_required' => $dao->is_required,
             'is_display_amounts' => $dao->display_min_fee,
-            'is_active'          => $dao->is_active,
-            'price_set_id'       => $priceSet->id,
-            'html_type'          => 'Radio',
-            'weight'             => 1,
+            'is_active' => $dao->is_active,
+            'price_set_id' => $priceSet->id,
+            'html_type' => 'Radio',
+            'weight' => 1,
           );
           $membershipTypes = unserialize($dao->membership_types);
           $rowcount = 0;
           foreach ($membershipTypes as $membershipType => $autoRenew) {
             $membershipTypeDetail = CRM_Member_BAO_MembershipType::getMembershipTypeDetails($membershipType);
             $rowcount++;
-            $fieldParams['option_label'][$rowcount]  = $membershipTypeDetail['name'];
+            $fieldParams['option_label'][$rowcount] = $membershipTypeDetail['name'];
             $fieldParams['option_amount'][$rowcount] = $membershipTypeDetail['minimum_fee'];
             $fieldParams['option_weight'][$rowcount] = $rowcount;
             $fieldParams['membership_type_id'][$rowcount] = $membershipType;
@@ -562,8 +563,8 @@ WHERE     cpse.price_set_id IS NULL";
           $priceField = CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field::create($fieldParams);
 
           $setParams = array(
-            'id'                   => $priceSet->id,
-            'extends'              => CRM_Core_Component::getComponentID('CiviMember'),
+            'id' => $priceSet->id,
+            'extends' => CRM_Core_Component::getComponentID('CiviMember'),
             'contribution_type_id' => CRM_Core_DAO::getFieldValue($daoName[$addTo[0]][0], $addTo[2], 'contribution_type_id'),
           );
           CRM_Upgrade_Snapshot_V4p2_Price_BAO_Set::create($setParams);
@@ -573,16 +574,16 @@ WHERE     cpse.price_set_id IS NULL";
     if (!empty($options['otherAmount'])) {
 
       $fieldParams = array(
-        'name'               => strtolower(CRM_Utils_String::munge("Other Amount", '_', 245)),
-        'label'              => "Other Amount",
-        'is_required'        => 0,
+        'name' => strtolower(CRM_Utils_String::munge("Other Amount", '_', 245)),
+        'label' => "Other Amount",
+        'is_required' => 0,
         'is_display_amounts' => 0,
-        'is_active'          => 1,
-        'price_set_id'       => $priceSet->id,
-        'html_type'          => 'Text',
-        'weight'             => 3,
+        'is_active' => 1,
+        'price_set_id' => $priceSet->id,
+        'html_type' => 'Text',
+        'weight' => 3,
       );
-      $fieldParams['option_label'][1]  = "Other Amount";
+      $fieldParams['option_label'][1] = "Other Amount";
       $fieldParams['option_amount'][1] = 1;
       $fieldParams['option_weight'][1] = 1;
       $priceField = CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field::create($fieldParams);
@@ -653,7 +654,10 @@ WHERE     cpf.price_set_id = %1
         $params = array(
           '1' => array($result->price_set_id, 'Integer'),
           '2' => array('membership_amount', 'String'),
-          '3' => array(CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', $result->membership_id, 'membership_type_id'), 'Integer'),
+          '3' => array(
+            CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', $result->membership_id, 'membership_type_id'),
+            'Integer'
+          ),
         );
         $res = CRM_Core_DAO::executeQuery($sql, $params);
         if ($res->fetch()) {
@@ -843,7 +847,7 @@ SELECT   weight
 FROM     civicrm_uf_join
 WHERE    entity_id = {$events->id} AND module = 'CiviEvent'
 ORDER BY weight DESC LIMIT 1";
-      $weights        = CRM_Core_DAO::executeQuery($sql);
+      $weights = CRM_Core_DAO::executeQuery($sql);
       $weights->fetch();
       if (isset($weights->weight)) {
         $nextMainWeight += $weights->weight;
@@ -947,16 +951,25 @@ VALUES
   LEFT JOIN  $tempTableName2 temp2 ON temp1.payment_id = temp2.payment_id";
     $dao = CRM_Core_DAO::executeQuery($sql);
     if ($dao->N) {
-      $membershipType   = CRM_Member_PseudoConstant::membershipType();
+      $membershipType = CRM_Member_PseudoConstant::membershipType();
       $membershipStatus = CRM_Member_PseudoConstant::membershipStatus();
       $contributionStatus = CRM_Contribute_PseudoConstant::contributionStatus();
       while ($dao->fetch()) {
-        $status         = $dao->retain_id ? 'Retained' : 'Un-linked';
-        $memType        = CRM_Utils_Array::value($dao->membership_type_id, $membershipType);
-        $memStatus      = CRM_Utils_Array::value($dao->status_id, $membershipStatus);
-        $contribStatus  = CRM_Utils_Array::value($dao->contribution_status_id, $contributionStatus);
-        $processedRecords[] = array($dao->contact_id, $dao->contribution_id, $contribStatus, $dao->membership_id,
-                                    $memType, $dao->start_date, $dao->end_date, $memStatus, $status);
+        $status = $dao->retain_id ? 'Retained' : 'Un-linked';
+        $memType = CRM_Utils_Array::value($dao->membership_type_id, $membershipType);
+        $memStatus = CRM_Utils_Array::value($dao->status_id, $membershipStatus);
+        $contribStatus = CRM_Utils_Array::value($dao->contribution_status_id, $contributionStatus);
+        $processedRecords[] = array(
+          $dao->contact_id,
+          $dao->contribution_id,
+          $contribStatus,
+          $dao->membership_id,
+          $memType,
+          $dao->start_date,
+          $dao->end_date,
+          $memStatus,
+          $status
+        );
       }
     }
 
index 9afb3c7f3ced156e9b351d077f424049ed5258e9..9521d07f7d6ab31722dd6fc5fbf5cdf8e9187dca 100644 (file)
@@ -46,7 +46,34 @@ class CRM_Upgrade_Incremental_php_ThreeFour {
    */
   public function upgrade_3_4_alpha3($rev) {
     // CRM-7681, update report instance criteria.
-    $modifiedReportIds = array('contact/summary', 'contact/detail', 'event/participantListing', 'member/summary', 'pledge/summary', 'pledge/pbnp', 'member/detail', 'member/lapse', 'grant/detail', 'contribute/bookkeeping', 'contribute/lybunt', 'contribute/summary', 'contribute/repeat', 'contribute/detail', 'contribute/organizationSummary', 'contribute/sybunt', 'contribute/householdSummary', 'contact/relationship', 'contact/currentEmployer', 'case/demographics', 'walklist', 'case/detail', 'contact/log', 'activitySummary', 'case/timespent', 'case/summary');
+    $modifiedReportIds = array(
+      'contact/summary',
+      'contact/detail',
+      'event/participantListing',
+      'member/summary',
+      'pledge/summary',
+      'pledge/pbnp',
+      'member/detail',
+      'member/lapse',
+      'grant/detail',
+      'contribute/bookkeeping',
+      'contribute/lybunt',
+      'contribute/summary',
+      'contribute/repeat',
+      'contribute/detail',
+      'contribute/organizationSummary',
+      'contribute/sybunt',
+      'contribute/householdSummary',
+      'contact/relationship',
+      'contact/currentEmployer',
+      'case/demographics',
+      'walklist',
+      'case/detail',
+      'contact/log',
+      'activitySummary',
+      'case/timespent',
+      'case/summary'
+    );
 
     $instances = CRM_Core_DAO::executeQuery("SELECT id, form_values, report_id FROM civicrm_report_instance WHERE report_id IN ('" . implode("','", $modifiedReportIds) . "')");
 
@@ -91,8 +118,8 @@ class CRM_Upgrade_Incremental_php_ThreeFour {
       }
 
       // save updated instance criteria
-      $dao              = new CRM_Report_DAO_ReportInstance();
-      $dao->id          = $instances->id;
+      $dao = new CRM_Report_DAO_ReportInstance();
+      $dao->id = $instances->id;
       $dao->form_values = serialize($formValues);
       $dao->save();
       $dao->free();
@@ -151,7 +178,15 @@ class CRM_Upgrade_Incremental_php_ThreeFour {
     // CRM-8147, update group_type for uf groups, check and add component field types
     $ufGroups = new CRM_Core_DAO_UFGroup();
     $ufGroups->find();
-    $skipGroupTypes = array('Individual,Contact', 'Organization,Contact', 'Household,Contact', 'Contact', 'Individual', 'Organization', 'Household');
+    $skipGroupTypes = array(
+      'Individual,Contact',
+      'Organization,Contact',
+      'Household,Contact',
+      'Contact',
+      'Individual',
+      'Organization',
+      'Household'
+    );
     while ($ufGroups->fetch()) {
       if (!in_array($ufGroups->group_type, $skipGroupTypes)) {
         $groupTypes = CRM_Core_BAO_UFGroup::calculateGroupType($ufGroups->id, TRUE);
@@ -213,8 +248,8 @@ INSERT INTO civicrm_location_type ( name, description, is_reserved, is_active )
       }
 
       // save updated instance criteria
-      $dao              = new CRM_Report_DAO_ReportInstance();
-      $dao->id          = $instances->id;
+      $dao = new CRM_Report_DAO_ReportInstance();
+      $dao->id = $instances->id;
       $dao->form_values = serialize($formValues);
       $dao->save();
       $dao->free();
@@ -260,7 +295,12 @@ INSERT INTO civicrm_location_type ( name, description, is_reserved, is_active )
 
       switch ($instances->report_id) {
         case 'event/summary':
-          $eventDates = array('event_start_date_from', 'event_start_date_to', 'event_end_date_from', 'event_end_date_to');
+          $eventDates = array(
+            'event_start_date_from',
+            'event_start_date_to',
+            'event_end_date_from',
+            'event_end_date_to'
+          );
           foreach ($eventDates as $date) {
             if (isset($formValues[$date]) && $formValues[$date] == ' ') {
               $formValues[$date] = '';
@@ -299,8 +339,8 @@ INSERT INTO civicrm_location_type ( name, description, is_reserved, is_active )
       }
 
       // save updated instance criteria
-      $dao              = new CRM_Report_DAO_ReportInstance();
-      $dao->id          = $instances->id;
+      $dao = new CRM_Report_DAO_ReportInstance();
+      $dao->id = $instances->id;
       $dao->form_values = serialize($formValues);
       $dao->save();
       $dao->free();
@@ -314,9 +354,9 @@ WHERE  v.option_group_id = g.id
   AND  g.name      = %1
   AND  g.is_active = 1
   AND  v.name      = %2", array(
-    1 => array('activity_type', 'String'),
-        2 => array('Bulk Email', 'String'),
-      ));
+      1 => array('activity_type', 'String'),
+      2 => array('Bulk Email', 'String'),
+    ));
 
     // CRM-8852, reset contact field cache
     CRM_Core_BAO_Cache::deleteGroup('contact fields');
@@ -354,7 +394,7 @@ VALUES
     (1, 'OnBehalf', 'civicrm_contribution_page', %1, 1, %2)";
 
       $params = array(
-      1 => array($pages->id, 'Integer'),
+        1 => array($pages->id, 'Integer'),
         2 => array($onBehalfProfileId, 'Integer'),
       );
       CRM_Core_DAO::executeQuery($query, $params);
index 3556707547f9228e6de45d3c1ac20998021a2cc4..00fe0b9d30d48c89a14cfdf82a8a2b8f72f3db62 100644 (file)
@@ -68,7 +68,7 @@ class CRM_Upgrade_Incremental_php_ThreeThree {
       $name = CRM_Utils_String::munge($customField->label, '_', 64);
       $fldCnt = CRM_Core_DAO::singleValueQuery($customFldCntQuery,
         array(
-      1 => array($name, 'String'),
+          1 => array($name, 'String'),
           2 => array($customField->id, 'Integer'),
         ), TRUE, FALSE
       );
@@ -81,7 +81,7 @@ SET `name` = %1
 WHERE id = %2
 ";
       $customFieldParams = array(
-      1 => array($name, 'String'),
+        1 => array($name, 'String'),
         2 => array($customField->id, 'Integer'),
       );
       CRM_Core_DAO::executeQuery($customFieldQuery, $customFieldParams, TRUE, NULL, FALSE, FALSE);
@@ -97,7 +97,7 @@ WHERE id = %2
       $name = CRM_Utils_String::munge($customGroup->title, '_', 64);
       $grpCnt = CRM_Core_DAO::singleValueQuery($customGrpCntQuery,
         array(
-      1 => array($name, 'String'),
+          1 => array($name, 'String'),
           2 => array($customGroup->id, 'Integer'),
         )
       );
@@ -117,7 +117,7 @@ WHERE id = %2
       $name = CRM_Utils_String::munge($ufGroup->title, '_', 64);
       $ufGrpCnt = CRM_Core_DAO::singleValueQuery($ufGrpCntQuery,
         array(
-      1 => array($name, 'String'),
+          1 => array($name, 'String'),
           2 => array($ufGroup->id, 'Integer'),
         )
       );
@@ -221,7 +221,7 @@ WHERE id = %2
         // Used query to avoid line by line update.
         if ($labelFound || $priceFound) {
           $lineItemParams = array(
-          1 => array($fieldValueDAO->id, 'Integer'),
+            1 => array($fieldValueDAO->id, 'Integer'),
             2 => array($opValueDAO->label, 'String'),
           );
           $updateLineItems = "UPDATE civicrm_line_item SET price_field_value_id = %1 WHERE label = %2";
@@ -261,8 +261,8 @@ WHERE id = %2
   public function upgrade_3_3_beta3($rev) {
     // get the duplicate Ids of line item entries
     $dupeLineItemIds = array();
-    $fields          = array('entity_table', 'entity_id', 'price_field_id', 'price_field_value_id');
-    $mainLineItem    = new CRM_Price_BAO_LineItem();
+    $fields = array('entity_table', 'entity_id', 'price_field_id', 'price_field_value_id');
+    $mainLineItem = new CRM_Price_BAO_LineItem();
     $mainLineItem->find(TRUE);
     while ($mainLineItem->fetch()) {
       $dupeLineItem = new CRM_Price_BAO_LineItem();
@@ -362,8 +362,15 @@ INNER JOIN  civicrm_option_group grp ON ( grp.id = val.option_group_id )
     if (CRM_Mailing_Info::workflowEnabled()) {
       $config = CRM_Core_Config::singleton();
       if (is_callable(array(
-        $config->userSystem, 'replacePermission'))) {
-        $config->userSystem->replacePermission('access CiviMail', array('access CiviMail', 'create mailings', 'approve mailings', 'schedule mailings'));
+        $config->userSystem,
+        'replacePermission'
+      ))) {
+        $config->userSystem->replacePermission('access CiviMail', array(
+            'access CiviMail',
+            'create mailings',
+            'approve mailings',
+            'schedule mailings'
+          ));
       }
     }
 
index 07ab68f8246aace1e27ddf5427378c3093617432..2b816aa2b36f185f27b15be1b26b4c729ccb6d19 100644 (file)
@@ -50,7 +50,11 @@ class CRM_Upgrade_Incremental_php_ThreeTwo {
     $config = CRM_Core_Config::singleton();
     if ($config->userSystem->is_drupal) {
 
-      $config->userSystem->replacePermission('access CiviCase', array('access my cases and activities', 'access all cases and activities', 'administer CiviCase'));
+      $config->userSystem->replacePermission('access CiviCase', array(
+          'access my cases and activities',
+          'access all cases and activities',
+          'administer CiviCase'
+        ));
 
       //insert core acls.
       $casePermissions = array(
@@ -108,7 +112,10 @@ class CRM_Upgrade_Incremental_php_ThreeTwo {
       $locales = explode(CRM_Core_DAO::VALUE_SEPARATOR, $domain->locales);
       // optimal: an English locale
       foreach (array(
-        'en_US', 'en_GB', 'en_AU') as $loc) {
+                 'en_US',
+                 'en_GB',
+                 'en_AU'
+               ) as $loc) {
         if (in_array($loc, $locales)) {
           $seedLocale = $loc;
           break;
index 8325c3f6331c30012f232d478973d432fcea8165..ff4888080e982eca8bd237ae93806cfa1ce5a8ff 100644 (file)
 /**
  * Class CRM_Upgrade_Page_Cleanup
  */
-class CRM_Upgrade_Page_Cleanup  extends CRM_Core_Page {
+class CRM_Upgrade_Page_Cleanup extends CRM_Core_Page {
   public function cleanup425() {
-    $rows     = CRM_Upgrade_Incremental_php_FourTwo::deleteInvalidPairs();
+    $rows = CRM_Upgrade_Incremental_php_FourTwo::deleteInvalidPairs();
     $template = CRM_Core_Smarty::singleton();
 
-    $columnHeaders = array("Contact ID", "ContributionID", "Contribution Status", "MembershipID",
-                           "Membership Type", "Start Date", "End Date", "Membership Status", "Action");
+    $columnHeaders = array(
+      "Contact ID",
+      "ContributionID",
+      "Contribution Status",
+      "MembershipID",
+      "Membership Type",
+      "Start Date",
+      "End Date",
+      "Membership Status",
+      "Action"
+    );
     $template->assign('columnHeaders', $columnHeaders);
     $template->assign('rows', $rows);
 
@@ -42,9 +51,10 @@ class CRM_Upgrade_Page_Cleanup  extends CRM_Core_Page {
     $template->assign('preMessage', $preMessage);
 
     $postMessage = ts('You can <a href="%1">click here</a> to try running the 4.2 upgrade script again. <a href="%2" target="_blank">(Review upgrade documentation)</a>',
-                    array(
-    1 => CRM_Utils_System::url('civicrm/upgrade', 'reset=1'),
-                          2 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Installation+and+Upgrades'));
+      array(
+        1 => CRM_Utils_System::url('civicrm/upgrade', 'reset=1'),
+        2 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Installation+and+Upgrades'
+      ));
     $template->assign('postMessage', $postMessage);
 
     $content = $template->fetch('CRM/common/upgradeCleanup.tpl');
index 8422fdd4ff6c542e8f69e31eaea74d34cc8516c2..02949cad44041efb7f4110dc5f56c738e04f88af 100644 (file)
@@ -161,7 +161,7 @@ class CRM_Upgrade_Page_Upgrade extends CRM_Core_Page {
       'pathPrefix' => 'civicrm/upgrade/queue',
       'onEndUrl' => CRM_Utils_System::url('civicrm/upgrade', 'action=finish', FALSE, NULL, FALSE),
       'buttons' => array('retry' => $config->debug, 'skip' => $config->debug),
-      ));
+    ));
     $queueRunner->runAllViaWeb();
     CRM_Core_Error::fatal(ts('Upgrade failed to redirect'));
   }
index 6da2674b3c13d658770565868e4c0d7524818b20..12c22c939d65137071cdb8692feda7006088b4a4 100644 (file)
@@ -121,10 +121,10 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field extends CRM_Upgrade_Snapshot_V4p
     for ($index = 1; $index <= $maxIndex; $index++) {
 
       if (array_key_exists('option_amount', $params) &&
-          array_key_exists($index, $params['option_amount']) &&
-          (CRM_Utils_Array::value($index, CRM_Utils_Array::value('option_label', $params)) || !empty($params['is_quick_config'])) &&
-          !CRM_Utils_System::isNull($params['option_amount'][$index])
-          ) {
+        array_key_exists($index, $params['option_amount']) &&
+        (CRM_Utils_Array::value($index, CRM_Utils_Array::value('option_label', $params)) || !empty($params['is_quick_config'])) &&
+        !CRM_Utils_System::isNull($params['option_amount'][$index])
+      ) {
         $options = array(
           'price_field_id' => $priceField->id,
           'label' => trim($params['option_label'][$index]),
@@ -269,9 +269,9 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field extends CRM_Upgrade_Snapshot_V4p
     switch ($field->html_type) {
       case 'Text':
         $optionKey = key($customOption);
-        $count     = CRM_Utils_Array::value('count', $customOption[$optionKey], '');
+        $count = CRM_Utils_Array::value('count', $customOption[$optionKey], '');
         $max_value = CRM_Utils_Array::value('max_value', $customOption[$optionKey], '');
-        $priceVal  = implode($seperator, array($customOption[$optionKey][$valueFieldName], $count, $max_value));
+        $priceVal = implode($seperator, array($customOption[$optionKey][$valueFieldName], $count, $max_value));
 
         $extra = array();
         if (property_exists($qf, '_quickConfig') && $qf->_quickConfig && property_exists($qf, '_contributionAmount') && $qf->_contributionAmount) {
@@ -296,7 +296,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field extends CRM_Upgrade_Snapshot_V4p
         $element = &$qf->add('text', $elementName, $label,
           array_merge($extra,
             array(
-        'price' => json_encode(array($optionKey, $priceVal)),
+              'price' => json_encode(array($optionKey, $priceVal)),
               'size' => '4',
             )
           ),
@@ -333,22 +333,22 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field extends CRM_Upgrade_Snapshot_V4p
             $opt['label'] = !empty($opt['label']) ? $opt['label'] . '&nbsp;-&nbsp;' : '';
             $opt['label'] .= CRM_Utils_Money::format($opt[$valueFieldName]);
           }
-          $count     = CRM_Utils_Array::value('count', $opt, '');
+          $count = CRM_Utils_Array::value('count', $opt, '');
           $max_value = CRM_Utils_Array::value('max_value', $opt, '');
-          $priceVal  = implode($seperator, array($opt[$valueFieldName], $count, $max_value));
+          $priceVal = implode($seperator, array($opt[$valueFieldName], $count, $max_value));
           $extra = array(
-          'price' => json_encode(array($elementName, $priceVal)),
-                         'data-amount' => $opt[$valueFieldName],
-                         'data-currency' => $currencyName,
-                         );
+            'price' => json_encode(array($elementName, $priceVal)),
+            'data-amount' => $opt[$valueFieldName],
+            'data-currency' => $currencyName,
+          );
           if (property_exists($qf, '_quickConfig') && $qf->_quickConfig && $field->name == 'contribution_amount') {
             $extra += array('onclick' => 'clearAmountOther();');
           }
           elseif (property_exists($qf, '_quickConfig') && $qf->_quickConfig && $field->name == 'membership_amount') {
             $extra += array(
-            'onclick' => "return showHideAutoRenew({$opt['membership_type_id']});",
-                            'membership-type' => $opt['membership_type_id'],
-                            );
+              'onclick' => "return showHideAutoRenew({$opt['membership_type_id']});",
+              'membership-type' => $opt['membership_type_id'],
+            );
             $qf->assign('membershipFieldID', $field->id);
           }
           $choice[$opId] = $qf->createElement('radio', NULL, '', $opt['label'], $opt['id'], $extra);
@@ -416,7 +416,8 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field extends CRM_Upgrade_Snapshot_V4p
         }
         $element = &$qf->add('select', $elementName, $label,
           array(
-            '' => ts('- select -')) + $selectOption,
+            '' => ts('- select -')
+          ) + $selectOption,
           $useRequired && $field->is_required,
           array('price' => json_encode($priceVal))
         );
@@ -432,9 +433,9 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field extends CRM_Upgrade_Snapshot_V4p
 
         $check = array();
         foreach ($customOption as $opId => $opt) {
-          $count     = CRM_Utils_Array::value('count', $opt, '');
+          $count = CRM_Utils_Array::value('count', $opt, '');
           $max_value = CRM_Utils_Array::value('max_value', $opt, '');
-          $priceVal  = implode($seperator, array($opt[$valueFieldName], $count, $max_value));
+          $priceVal = implode($seperator, array($opt[$valueFieldName], $count, $max_value));
 
           if ($field->is_display_amounts) {
             $opt['label'] .= '&nbsp;-&nbsp;';
@@ -442,7 +443,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field extends CRM_Upgrade_Snapshot_V4p
           }
           $check[$opId] = &$qf->createElement('checkbox', $opt['id'], NULL, $opt['label'],
             array(
-          'price' => json_encode(array($opt['id'], $priceVal)),
+              'price' => json_encode(array($opt['id'], $priceVal)),
               'data-amount' => $opt[$valueFieldName],
               'data-currency' => $currencyName,
             )
@@ -513,7 +514,10 @@ WHERE
     AND option_group.id    = option_value.option_group_id
     AND option_value.label = %2";
 
-    $dao = CRM_Core_DAO::executeQuery($query, array(1 => array($optionGroupName, 'String'), 2 => array($optionLabel, 'String')));
+    $dao = CRM_Core_DAO::executeQuery($query, array(
+        1 => array($optionGroupName, 'String'),
+        2 => array($optionLabel, 'String')
+      ));
 
     while ($dao->fetch()) {
       return $dao->id;
index d69784240a663201919991760022ea0f7b6c3971..a182e5c74a07d3937846c72df560f9999fce1fdb 100644 (file)
@@ -183,7 +183,7 @@ WHERE     %2.id = %1";
    *                          to the price set used for particular event
    * @param array $values
    *   Reference to the values array(.
-  this is
+   * this is
    *                          lineItem array)
    *
    * @return void
index dc0c10a10bd93d9b3a988064f71a098f34a16f69..03d41a8ba84b532e502052c99cae9616f9cdbe95 100644 (file)
@@ -328,9 +328,9 @@ WHERE     ct.id = cp.contribution_type_id AND
    * @return mixed
    */
   public static function removeFrom($entityTable, $entityId) {
-    $dao               = new CRM_Upgrade_Snapshot_V4p2_Price_DAO_SetEntity();
+    $dao = new CRM_Upgrade_Snapshot_V4p2_Price_DAO_SetEntity();
     $dao->entity_table = $entityTable;
-    $dao->entity_id    = $entityId;
+    $dao->entity_id = $entityId;
     return $dao->delete();
   }
 
@@ -361,7 +361,7 @@ WHERE     ct.id = cp.contribution_type_id AND
       $sql .= " AND ps.is_quick_config = 0 ";
     }
     $params = array(
-    1 => array($entityTable, 'String'),
+      1 => array($entityTable, 'String'),
       2 => array($entityId, 'Integer'),
     );
     if ($usedFor) {
@@ -496,9 +496,9 @@ WHERE     ct.id = cp.contribution_type_id AND
     $select = 'SELECT ' . implode(',', $priceFields);
     $from = ' FROM civicrm_price_field';
 
-    $params    = array();
+    $params = array();
     $params[1] = array($setID, 'Integer');
-    $where     = '
+    $where = '
 WHERE price_set_id = %1
 AND is_active = 1
 ';
@@ -691,7 +691,7 @@ WHERE  id = %1";
           $params['amount_priceset_level_radio'][$optionValueId] = $optionLabel;
           if (isset($radioLevel)) {
             $radioLevel = array_merge($radioLevel,
-            array_keys($params['amount_priceset_level_radio'])
+              array_keys($params['amount_priceset_level_radio'])
             );
           }
           else {
@@ -725,9 +725,9 @@ WHERE  id = %1";
             $params['amount_priceset_level_checkbox']["{$field['options'][$optionId]['id']}"] = $optionLabel;
             if (isset($checkboxLevel)) {
               $checkboxLevel = array_unique(array_merge(
-              $checkboxLevel,
-              array_keys($params['amount_priceset_level_checkbox'])
-              )
+                  $checkboxLevel,
+                  array_keys($params['amount_priceset_level_checkbox'])
+                )
               );
             }
             else {
@@ -781,12 +781,14 @@ WHERE  id = %1";
     $validFieldsOnly = TRUE;
     $className = CRM_Utils_System::getClassName($form);
     if (in_array($className, array(
-  'CRM_Contribute_Form_Contribution', 'CRM_Member_Form_Membership'))) {
+      'CRM_Contribute_Form_Contribution',
+      'CRM_Member_Form_Membership'
+    ))) {
       $validFieldsOnly = FALSE;
     }
 
-    $priceSet           = self::getSetDetail($priceSetId, TRUE, $validFieldsOnly);
-    $form->_priceSet    = CRM_Utils_Array::value($priceSetId, $priceSet);
+    $priceSet = self::getSetDetail($priceSetId, TRUE, $validFieldsOnly);
+    $form->_priceSet = CRM_Utils_Array::value($priceSetId, $priceSet);
     $form->_quickConfig = $quickConfig = 0;
     if (CRM_Core_DAO::getFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set', $priceSetId, 'is_quick_config')) {
       $quickConfig = 1;
@@ -818,8 +820,8 @@ WHERE  id = %1";
 
     foreach ($feeBlock as $field) {
       if (CRM_Utils_Array::value('visibility', $field) == 'public' ||
-!$validFieldsOnly
-) {
+        !$validFieldsOnly
+      ) {
         $options = CRM_Utils_Array::value('options', $field);
         if ($className == 'CRM_Contribute_Form_Contribution_Main' && $component = 'membership') {
           $checklifetime = self::checkCurrentMembership($options, $userid);
@@ -831,12 +833,12 @@ WHERE  id = %1";
           continue;
         }
         CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field::addQuickFormElement($form,
-        'price_' . $field['id'],
-        $field['id'],
-        FALSE,
-        CRM_Utils_Array::value('is_required', $field, FALSE),
-        NULL,
-        $options
+          'price_' . $field['id'],
+          $field['id'],
+          FALSE,
+          CRM_Utils_Array::value('is_required', $field, FALSE),
+          NULL,
+          $options
         );
       }
     }
@@ -935,22 +937,22 @@ WHERE  id = %1";
 
     $title = ts('[Copy id %1]', array(1 => $maxId + 1));
     $fieldsFix = array(
-    'suffix' => array(
-    'title' => ' ' . $title,
-    'name' => '__Copy_id_' . ($maxId + 1) . '_',
-    ),
+      'suffix' => array(
+        'title' => ' ' . $title,
+        'name' => '__Copy_id_' . ($maxId + 1) . '_',
+      ),
     );
 
     $copy = &CRM_Core_DAO::copyGeneric('CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set',
-    array('id' => $id),
-    NULL,
-    $fieldsFix
+      array('id' => $id),
+      NULL,
+      $fieldsFix
     );
 
     //copying all the blocks pertaining to the price set
     $copyPriceField = &CRM_Core_DAO::copyGeneric('CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field',
-    array('price_set_id' => $id),
-    array('price_set_id' => $copy->id)
+      array('price_set_id' => $id),
+      array('price_set_id' => $copy->id)
     );
     if (!empty($copyPriceField)) {
       $price = array_combine(self::getFieldIds($id), self::getFieldIds($copy->id));
@@ -958,8 +960,8 @@ WHERE  id = %1";
       //copy option group and values
       foreach ($price as $originalId => $copyId) {
         CRM_Core_DAO::copyGeneric('CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue',
-        array('price_field_id' => $originalId),
-        array('price_field_id' => $copyId)
+          array('price_field_id' => $originalId),
+          array('price_field_id' => $copyId)
         );
       }
     }
@@ -979,8 +981,8 @@ WHERE  id = %1";
    */
   function checkPermission($sid) {
     if ($sid &&
-self::eventPriceSetDomainID()
-) {
+      self::eventPriceSetDomainID()
+    ) {
       $domain_id = CRM_Core_DAO::getFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set', $sid, 'domain_id', 'id');
       if (CRM_Core_Config::domainID() != $domain_id) {
         CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
@@ -1077,9 +1079,9 @@ GROUP BY     mt.member_of_contact_id";
 
     $params = array(1 => array($priceSetId, 'Integer'));
 
-    $dao             = CRM_Core_DAO::executeQuery($query, $params);
+    $dao = CRM_Core_DAO::executeQuery($query, $params);
     $autoRenewOption = 2;
-    $interval        = $unit = array();
+    $interval = $unit = array();
     while ($dao->fetch()) {
       if (!$dao->auto_renew) {
         $autoRenewOption = 0;
@@ -1129,9 +1131,9 @@ GROUP BY     mt.member_of_contact_id";
    */
   public static function eventPriceSetDomainID() {
     return CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME,
-           'event_price_set_domain_id',
-           NULL, FALSE
-           );
+      'event_price_set_domain_id',
+      NULL, FALSE
+    );
   }
 
   /**
index a49246b21282929ccbbbd863cd2bd0d9ace4f387..50b44136bd14c60131db11bfea71f42f9d15a2fb 100644 (file)
@@ -37,415 +37,413 @@ require_once 'CRM/Utils/Type.php';
 /**
  * Class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field
  */
-class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field extends CRM_Core_DAO
-{
-    /**
-     * static instance to hold the table name
-     *
-     * @var string
-     * @static
-     */
-    static $_tableName = 'civicrm_price_field';
-    /**
-     * static instance to hold the field values
-     *
-     * @var array
-     * @static
-     */
-    static $_fields = null;
-    /**
-     * static instance to hold the FK relationships
-     *
-     * @var string
-     * @static
-     */
-    static $_links = null;
-    /**
-     * static instance to hold the values that can
-     * be imported
-     *
-     * @var array
-     * @static
-     */
-    static $_import = null;
-    /**
-     * static instance to hold the values that can
-     * be exported
-     *
-     * @var array
-     * @static
-     */
-    static $_export = null;
-    /**
-     * static value to see if we should log any modifications to
-     * this table in the civicrm_log table
-     *
-     * @var boolean
-     * @static
-     */
-    static $_log = true;
-    /**
-     * Price Field
-     *
-     * @var int unsigned
-     */
-    public $id;
-    /**
-     * FK to civicrm_price_set
-     *
-     * @var int unsigned
-     */
-    public $price_set_id;
-    /**
-     * Variable name/programmatic handle for this field.
-     *
-     * @var string
-     */
-    public $name;
-    /**
-     * Text for form field label (also friendly name for administering this field).
-     *
-     * @var string
-     */
-    public $label;
-    /**
-     *
-     * @var enum('Text', 'Select', 'Radio', 'CheckBox')
-     */
-    public $html_type;
-    /**
-     * Enter a quantity for this field?
-     *
-     * @var boolean
-     */
-    public $is_enter_qty;
-    /**
-     * Description and/or help text to display before this field.
-     *
-     * @var text
-     */
-    public $help_pre;
-    /**
-     * Description and/or help text to display after this field.
-     *
-     * @var text
-     */
-    public $help_post;
-    /**
-     * Order in which the fields should appear
-     *
-     * @var int
-     */
-    public $weight;
-    /**
-     * Should the price be displayed next to the label for each option?
-     *
-     * @var boolean
-     */
-    public $is_display_amounts;
-    /**
-     * number of options per line for checkbox and radio
-     *
-     * @var int unsigned
-     */
-    public $options_per_line;
-    /**
-     * Is this price field active
-     *
-     * @var boolean
-     */
-    public $is_active;
-    /**
-     * Is this price field required (value must be > 1)
-     *
-     * @var boolean
-     */
-    public $is_required;
-    /**
-     * If non-zero, do not show this field before the date specified
-     *
-     * @var datetime
-     */
-    public $active_on;
-    /**
-     * If non-zero, do not show this field after the date specified
-     *
-     * @var datetime
-     */
-    public $expire_on;
-    /**
-     * Optional scripting attributes for field
-     *
-     * @var string
-     */
-    public $javascript;
-    /**
-     * Implicit FK to civicrm_option_group with name = \'visibility\'
-     *
-     * @var int unsigned
-     */
-    public $visibility_id;
+class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field extends CRM_Core_DAO {
+  /**
+   * static instance to hold the table name
+   *
+   * @var string
+   * @static
+   */
+  static $_tableName = 'civicrm_price_field';
+  /**
+   * static instance to hold the field values
+   *
+   * @var array
+   * @static
+   */
+  static $_fields = NULL;
+  /**
+   * static instance to hold the FK relationships
+   *
+   * @var string
+   * @static
+   */
+  static $_links = NULL;
+  /**
+   * static instance to hold the values that can
+   * be imported
+   *
+   * @var array
+   * @static
+   */
+  static $_import = NULL;
+  /**
+   * static instance to hold the values that can
+   * be exported
+   *
+   * @var array
+   * @static
+   */
+  static $_export = NULL;
+  /**
+   * static value to see if we should log any modifications to
+   * this table in the civicrm_log table
+   *
+   * @var boolean
+   * @static
+   */
+  static $_log = TRUE;
+  /**
+   * Price Field
+   *
+   * @var int unsigned
+   */
+  public $id;
+  /**
+   * FK to civicrm_price_set
+   *
+   * @var int unsigned
+   */
+  public $price_set_id;
+  /**
+   * Variable name/programmatic handle for this field.
+   *
+   * @var string
+   */
+  public $name;
+  /**
+   * Text for form field label (also friendly name for administering this field).
+   *
+   * @var string
+   */
+  public $label;
+  /**
+   *
+   * @var enum('Text', 'Select', 'Radio', 'CheckBox')
+   */
+  public $html_type;
+  /**
+   * Enter a quantity for this field?
+   *
+   * @var boolean
+   */
+  public $is_enter_qty;
+  /**
+   * Description and/or help text to display before this field.
+   *
+   * @var text
+   */
+  public $help_pre;
+  /**
+   * Description and/or help text to display after this field.
+   *
+   * @var text
+   */
+  public $help_post;
+  /**
+   * Order in which the fields should appear
+   *
+   * @var int
+   */
+  public $weight;
+  /**
+   * Should the price be displayed next to the label for each option?
+   *
+   * @var boolean
+   */
+  public $is_display_amounts;
+  /**
+   * number of options per line for checkbox and radio
+   *
+   * @var int unsigned
+   */
+  public $options_per_line;
+  /**
+   * Is this price field active
+   *
+   * @var boolean
+   */
+  public $is_active;
+  /**
+   * Is this price field required (value must be > 1)
+   *
+   * @var boolean
+   */
+  public $is_required;
+  /**
+   * If non-zero, do not show this field before the date specified
+   *
+   * @var datetime
+   */
+  public $active_on;
+  /**
+   * If non-zero, do not show this field after the date specified
+   *
+   * @var datetime
+   */
+  public $expire_on;
+  /**
+   * Optional scripting attributes for field
+   *
+   * @var string
+   */
+  public $javascript;
+  /**
+   * Implicit FK to civicrm_option_group with name = \'visibility\'
+   *
+   * @var int unsigned
+   */
+  public $visibility_id;
 
   /**
    * Class constructor
    *
    * @return \CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field
    */
-    public function __construct()
-    {
-        $this->__table = 'civicrm_price_field';
-        parent::__construct();
-    }
-    /**
-     * return foreign links
-     *
-     * @return array
-     */
-    public function links()
-    {
-        if (!(self::$_links)) {
-            self::$_links = array(
-                'price_set_id' => 'civicrm_price_set:id',
-            );
-        }
-        return self::$_links;
-    }
-    /**
-     * returns all the column names of this table
-     *
-     * @return array
-     */
-    static function &fields()
-    {
-        if (!(self::$_fields)) {
-            self::$_fields = array(
-                'id' => array(
-                    'name' => 'id',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'required' => true,
-                ) ,
-                'price_set_id' => array(
-                    'name' => 'price_set_id',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'required' => true,
-                    'FKClassName' => 'Snapshot_v4p2_Price_DAO_Set',
-                ) ,
-                'name' => array(
-                    'name' => 'name',
-                    'type' => CRM_Utils_Type::T_STRING,
-                    'title' => ts('Name') ,
-                    'required' => true,
-                    'maxlength' => 255,
-                    'size' => CRM_Utils_Type::HUGE,
-                ) ,
-                'label' => array(
-                    'name' => 'label',
-                    'type' => CRM_Utils_Type::T_STRING,
-                    'title' => ts('Label') ,
-                    'required' => true,
-                    'maxlength' => 255,
-                    'size' => CRM_Utils_Type::HUGE,
-                ) ,
-                'html_type' => array(
-                    'name' => 'html_type',
-                    'type' => CRM_Utils_Type::T_ENUM,
-                    'title' => ts('Html Type') ,
-                    'required' => true,
-                    'enumValues' => 'Text, Select, Radio, CheckBox',
-                ) ,
-                'is_enter_qty' => array(
-                    'name' => 'is_enter_qty',
-                    'type' => CRM_Utils_Type::T_BOOLEAN,
-                ) ,
-                'help_pre' => array(
-                    'name' => 'help_pre',
-                    'type' => CRM_Utils_Type::T_TEXT,
-                    'title' => ts('Help Pre') ,
-                    'rows' => 4,
-                    'cols' => 80,
-                ) ,
-                'help_post' => array(
-                    'name' => 'help_post',
-                    'type' => CRM_Utils_Type::T_TEXT,
-                    'title' => ts('Help Post') ,
-                    'rows' => 4,
-                    'cols' => 80,
-                ) ,
-                'weight' => array(
-                    'name' => 'weight',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'title' => ts('Weight') ,
-                    'default' => '',
-                ) ,
-                'is_display_amounts' => array(
-                    'name' => 'is_display_amounts',
-                    'type' => CRM_Utils_Type::T_BOOLEAN,
-                    'default' => '',
-                ) ,
-                'options_per_line' => array(
-                    'name' => 'options_per_line',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'title' => ts('Options Per Line') ,
-                    'default' => '',
-                ) ,
-                'is_active' => array(
-                    'name' => 'is_active',
-                    'type' => CRM_Utils_Type::T_BOOLEAN,
-                    'default' => '',
-                ) ,
-                'is_required' => array(
-                    'name' => 'is_required',
-                    'type' => CRM_Utils_Type::T_BOOLEAN,
-                    'default' => '',
-                ) ,
-                'active_on' => array(
-                    'name' => 'active_on',
-                    'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
-                    'title' => ts('Active On') ,
-                    'default' => 'UL',
-                ) ,
-                'expire_on' => array(
-                    'name' => 'expire_on',
-                    'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
-                    'title' => ts('Expire On') ,
-                    'default' => 'UL',
-                ) ,
-                'javascript' => array(
-                    'name' => 'javascript',
-                    'type' => CRM_Utils_Type::T_STRING,
-                    'title' => ts('Javascript') ,
-                    'maxlength' => 255,
-                    'size' => CRM_Utils_Type::HUGE,
-                ) ,
-                'visibility_id' => array(
-                    'name' => 'visibility_id',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'default' => '',
-                ) ,
-            );
-        }
-        return self::$_fields;
-    }
-    /**
-     * returns the names of this table
-     *
-     * @static
-     * @return string
-     */
-    public static function getTableName()
-    {
-        return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
+  public function __construct() {
+    $this->__table = 'civicrm_price_field';
+    parent::__construct();
+  }
+
+  /**
+   * return foreign links
+   *
+   * @return array
+   */
+  public function links() {
+    if (!(self::$_links)) {
+      self::$_links = array(
+        'price_set_id' => 'civicrm_price_set:id',
+      );
     }
-    /**
-     * returns if this table needs to be logged
-     *
-     * @return boolean
-     */
-    public function getLog()
-    {
-        return self::$_log;
+    return self::$_links;
+  }
+
+  /**
+   * returns all the column names of this table
+   *
+   * @return array
+   */
+  static function &fields() {
+    if (!(self::$_fields)) {
+      self::$_fields = array(
+        'id' => array(
+          'name' => 'id',
+          'type' => CRM_Utils_Type::T_INT,
+          'required' => TRUE,
+        ),
+        'price_set_id' => array(
+          'name' => 'price_set_id',
+          'type' => CRM_Utils_Type::T_INT,
+          'required' => TRUE,
+          'FKClassName' => 'Snapshot_v4p2_Price_DAO_Set',
+        ),
+        'name' => array(
+          'name' => 'name',
+          'type' => CRM_Utils_Type::T_STRING,
+          'title' => ts('Name'),
+          'required' => TRUE,
+          'maxlength' => 255,
+          'size' => CRM_Utils_Type::HUGE,
+        ),
+        'label' => array(
+          'name' => 'label',
+          'type' => CRM_Utils_Type::T_STRING,
+          'title' => ts('Label'),
+          'required' => TRUE,
+          'maxlength' => 255,
+          'size' => CRM_Utils_Type::HUGE,
+        ),
+        'html_type' => array(
+          'name' => 'html_type',
+          'type' => CRM_Utils_Type::T_ENUM,
+          'title' => ts('Html Type'),
+          'required' => TRUE,
+          'enumValues' => 'Text, Select, Radio, CheckBox',
+        ),
+        'is_enter_qty' => array(
+          'name' => 'is_enter_qty',
+          'type' => CRM_Utils_Type::T_BOOLEAN,
+        ),
+        'help_pre' => array(
+          'name' => 'help_pre',
+          'type' => CRM_Utils_Type::T_TEXT,
+          'title' => ts('Help Pre'),
+          'rows' => 4,
+          'cols' => 80,
+        ),
+        'help_post' => array(
+          'name' => 'help_post',
+          'type' => CRM_Utils_Type::T_TEXT,
+          'title' => ts('Help Post'),
+          'rows' => 4,
+          'cols' => 80,
+        ),
+        'weight' => array(
+          'name' => 'weight',
+          'type' => CRM_Utils_Type::T_INT,
+          'title' => ts('Weight'),
+          'default' => '',
+        ),
+        'is_display_amounts' => array(
+          'name' => 'is_display_amounts',
+          'type' => CRM_Utils_Type::T_BOOLEAN,
+          'default' => '',
+        ),
+        'options_per_line' => array(
+          'name' => 'options_per_line',
+          'type' => CRM_Utils_Type::T_INT,
+          'title' => ts('Options Per Line'),
+          'default' => '',
+        ),
+        'is_active' => array(
+          'name' => 'is_active',
+          'type' => CRM_Utils_Type::T_BOOLEAN,
+          'default' => '',
+        ),
+        'is_required' => array(
+          'name' => 'is_required',
+          'type' => CRM_Utils_Type::T_BOOLEAN,
+          'default' => '',
+        ),
+        'active_on' => array(
+          'name' => 'active_on',
+          'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
+          'title' => ts('Active On'),
+          'default' => 'UL',
+        ),
+        'expire_on' => array(
+          'name' => 'expire_on',
+          'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
+          'title' => ts('Expire On'),
+          'default' => 'UL',
+        ),
+        'javascript' => array(
+          'name' => 'javascript',
+          'type' => CRM_Utils_Type::T_STRING,
+          'title' => ts('Javascript'),
+          'maxlength' => 255,
+          'size' => CRM_Utils_Type::HUGE,
+        ),
+        'visibility_id' => array(
+          'name' => 'visibility_id',
+          'type' => CRM_Utils_Type::T_INT,
+          'default' => '',
+        ),
+      );
     }
-    /**
-     * returns the list of fields that can be imported
-     *
-     * return array
-     * @static
-     */
-    static function &import($prefix = false)
-    {
-        if (!(self::$_import)) {
-            self::$_import = array();
-            $fields = self::fields();
-            foreach($fields as $name => $field) {
-                if (!empty($field['import'])) {
-                    if ($prefix) {
-                        self::$_import['price_field'] = & $fields[$name];
-                    }
-                    else {
-                        self::$_import[$name] = & $fields[$name];
-                    }
-                }
-            }
+    return self::$_fields;
+  }
+
+  /**
+   * returns the names of this table
+   *
+   * @static
+   * @return string
+   */
+  public static function getTableName() {
+    return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
+  }
+
+  /**
+   * returns if this table needs to be logged
+   *
+   * @return boolean
+   */
+  public function getLog() {
+    return self::$_log;
+  }
+
+  /**
+   * returns the list of fields that can be imported
+   *
+   * return array
+   * @static
+   */
+  static function &import($prefix = FALSE) {
+    if (!(self::$_import)) {
+      self::$_import = array();
+      $fields = self::fields();
+      foreach ($fields as $name => $field) {
+        if (!empty($field['import'])) {
+          if ($prefix) {
+            self::$_import['price_field'] = &$fields[$name];
+          }
+          else {
+            self::$_import[$name] = &$fields[$name];
+          }
         }
-        return self::$_import;
+      }
     }
-    /**
-     * returns the list of fields that can be exported
-     *
-     * return array
-     * @static
-     */
-    static function &export($prefix = false)
-    {
-        if (!(self::$_export)) {
-            self::$_export = array();
-            $fields = self::fields();
-            foreach($fields as $name => $field) {
-                if (!empty($field['export'])) {
-                    if ($prefix) {
-                        self::$_export['price_field'] = & $fields[$name];
-                    }
-                    else {
-                        self::$_export[$name] = & $fields[$name];
-                    }
-                }
-            }
+    return self::$_import;
+  }
+
+  /**
+   * returns the list of fields that can be exported
+   *
+   * return array
+   * @static
+   */
+  static function &export($prefix = FALSE) {
+    if (!(self::$_export)) {
+      self::$_export = array();
+      $fields = self::fields();
+      foreach ($fields as $name => $field) {
+        if (!empty($field['export'])) {
+          if ($prefix) {
+            self::$_export['price_field'] = &$fields[$name];
+          }
+          else {
+            self::$_export[$name] = &$fields[$name];
+          }
         }
-        return self::$_export;
+      }
     }
-    /**
-     * returns an array containing the enum fields of the civicrm_price_field table
-     *
-     * @return array
+    return self::$_export;
+  }
+
+  /**
+   * returns an array containing the enum fields of the civicrm_price_field table
+   *
+   * @return array
    *   (reference)  the array of enum fields
-     */
-    static function &getEnums()
-    {
-        static $enums = array(
-            'html_type',
-        );
-        return $enums;
-    }
-    /**
-     * returns a ts()-translated enum value for display purposes
-     *
-     * @param string $field
-     *   The enum field in question.
-     * @param string $value
-     *   The enum value up for translation.
-     *
-     * @return string
+   */
+  static function &getEnums() {
+    static $enums = array(
+      'html_type',
+    );
+    return $enums;
+  }
+
+  /**
+   * returns a ts()-translated enum value for display purposes
+   *
+   * @param string $field
+   *   The enum field in question.
+   * @param string $value
+   *   The enum value up for translation.
+   *
+   * @return string
    *   the display value of the enum
-     */
-    public static function tsEnum($field, $value)
-    {
-        static $translations = null;
-        if (!$translations) {
-            $translations = array(
-                'html_type' => array(
-                    'Text' => ts('Text') ,
-                    'Select' => ts('Select') ,
-                    'Radio' => ts('Radio') ,
-                    'CheckBox' => ts('CheckBox') ,
-                ) ,
-            );
-        }
-        return $translations[$field][$value];
+   */
+  public static function tsEnum($field, $value) {
+    static $translations = NULL;
+    if (!$translations) {
+      $translations = array(
+        'html_type' => array(
+          'Text' => ts('Text'),
+          'Select' => ts('Select'),
+          'Radio' => ts('Radio'),
+          'CheckBox' => ts('CheckBox'),
+        ),
+      );
     }
-    /**
-     * adds $value['foo_display'] for each $value['foo'] enum from civicrm_price_field
-     *
-     * @param array $values
-     *   (reference) the array up for enhancing.
-     * @return void
-     */
-    public static function addDisplayEnums(&$values)
-    {
-        $enumFields = & Snapshot_v4p2_Price_DAO_Field::getEnums();
-        foreach($enumFields as $enum) {
-            if (isset($values[$enum])) {
-                $values[$enum . '_display'] = Snapshot_v4p2_Price_DAO_Field::tsEnum($enum, $values[$enum]);
-            }
-        }
+    return $translations[$field][$value];
+  }
+
+  /**
+   * adds $value['foo_display'] for each $value['foo'] enum from civicrm_price_field
+   *
+   * @param array $values
+   *   (reference) the array up for enhancing.
+   * @return void
+   */
+  public static function addDisplayEnums(&$values) {
+    $enumFields = &Snapshot_v4p2_Price_DAO_Field::getEnums();
+    foreach ($enumFields as $enum) {
+      if (isset($values[$enum])) {
+        $values[$enum . '_display'] = Snapshot_v4p2_Price_DAO_Field::tsEnum($enum, $values[$enum]);
+      }
     }
+  }
 }
index 2fb79f72f9e5bdfda68910795404739a58b336be..23cc580447dd7df0be5cae7367dbc075a7fba39c 100644 (file)
@@ -37,303 +37,301 @@ require_once 'CRM/Utils/Type.php';
 /**
  * Class CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue
  */
-class CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue extends CRM_Core_DAO
-{
-    /**
-     * static instance to hold the table name
-     *
-     * @var string
-     * @static
-     */
-    static $_tableName = 'civicrm_price_field_value';
-    /**
-     * static instance to hold the field values
-     *
-     * @var array
-     * @static
-     */
-    static $_fields = null;
-    /**
-     * static instance to hold the FK relationships
-     *
-     * @var string
-     * @static
-     */
-    static $_links = null;
-    /**
-     * static instance to hold the values that can
-     * be imported
-     *
-     * @var array
-     * @static
-     */
-    static $_import = null;
-    /**
-     * static instance to hold the values that can
-     * be exported
-     *
-     * @var array
-     * @static
-     */
-    static $_export = null;
-    /**
-     * static value to see if we should log any modifications to
-     * this table in the civicrm_log table
-     *
-     * @var boolean
-     * @static
-     */
-    static $_log = false;
-    /**
-     * Price Field Value
-     *
-     * @var int unsigned
-     */
-    public $id;
-    /**
-     * FK to civicrm_price_field
-     *
-     * @var int unsigned
-     */
-    public $price_field_id;
-    /**
-     * Price field option name
-     *
-     * @var string
-     */
-    public $name;
-    /**
-     * Price field option label
-     *
-     * @var string
-     */
-    public $label;
-    /**
-     * >Price field option description.
-     *
-     * @var text
-     */
-    public $description;
-    /**
-     * Price field option amount
-     *
-     * @var string
-     */
-    public $amount;
-    /**
-     * Number of participants per field option
-     *
-     * @var int unsigned
-     */
-    public $count;
-    /**
-     * Max number of participants per field options
-     *
-     * @var int unsigned
-     */
-    public $max_value;
-    /**
-     * Order in which the field options should appear
-     *
-     * @var int
-     */
-    public $weight;
-    /**
-     * FK to Membership Type
-     *
-     * @var int unsigned
-     */
-    public $membership_type_id;
-    /**
-     * Is this default price field option
-     *
-     * @var boolean
-     */
-    public $is_default;
-    /**
-     * Is this price field value active
-     *
-     * @var boolean
-     */
-    public $is_active;
+class CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue extends CRM_Core_DAO {
+  /**
+   * static instance to hold the table name
+   *
+   * @var string
+   * @static
+   */
+  static $_tableName = 'civicrm_price_field_value';
+  /**
+   * static instance to hold the field values
+   *
+   * @var array
+   * @static
+   */
+  static $_fields = NULL;
+  /**
+   * static instance to hold the FK relationships
+   *
+   * @var string
+   * @static
+   */
+  static $_links = NULL;
+  /**
+   * static instance to hold the values that can
+   * be imported
+   *
+   * @var array
+   * @static
+   */
+  static $_import = NULL;
+  /**
+   * static instance to hold the values that can
+   * be exported
+   *
+   * @var array
+   * @static
+   */
+  static $_export = NULL;
+  /**
+   * static value to see if we should log any modifications to
+   * this table in the civicrm_log table
+   *
+   * @var boolean
+   * @static
+   */
+  static $_log = FALSE;
+  /**
+   * Price Field Value
+   *
+   * @var int unsigned
+   */
+  public $id;
+  /**
+   * FK to civicrm_price_field
+   *
+   * @var int unsigned
+   */
+  public $price_field_id;
+  /**
+   * Price field option name
+   *
+   * @var string
+   */
+  public $name;
+  /**
+   * Price field option label
+   *
+   * @var string
+   */
+  public $label;
+  /**
+   * >Price field option description.
+   *
+   * @var text
+   */
+  public $description;
+  /**
+   * Price field option amount
+   *
+   * @var string
+   */
+  public $amount;
+  /**
+   * Number of participants per field option
+   *
+   * @var int unsigned
+   */
+  public $count;
+  /**
+   * Max number of participants per field options
+   *
+   * @var int unsigned
+   */
+  public $max_value;
+  /**
+   * Order in which the field options should appear
+   *
+   * @var int
+   */
+  public $weight;
+  /**
+   * FK to Membership Type
+   *
+   * @var int unsigned
+   */
+  public $membership_type_id;
+  /**
+   * Is this default price field option
+   *
+   * @var boolean
+   */
+  public $is_default;
+  /**
+   * Is this price field value active
+   *
+   * @var boolean
+   */
+  public $is_active;
 
   /**
    * Class constructor
    *
    * @return \CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue
    */
-    public function __construct()
-    {
-        $this->__table = 'civicrm_price_field_value';
-        parent::__construct();
-    }
-    /**
-     * return foreign links
-     *
-     * @return array
-     */
-    public function links()
-    {
-        if (!(self::$_links)) {
-            self::$_links = array(
-                'price_field_id' => 'civicrm_price_field:id',
-                'membership_type_id' => 'civicrm_membership_type:id',
-            );
-        }
-        return self::$_links;
-    }
-    /**
-     * returns all the column names of this table
-     *
-     * @return array
-     */
-    static function &fields()
-    {
-        if (!(self::$_fields)) {
-            self::$_fields = array(
-                'id' => array(
-                    'name' => 'id',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'required' => true,
-                ) ,
-                'price_field_id' => array(
-                    'name' => 'price_field_id',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'required' => true,
-                    'FKClassName' => 'Snapshot_v4p2_Price_DAO_Field',
-                ) ,
-                'name' => array(
-                    'name' => 'name',
-                    'type' => CRM_Utils_Type::T_STRING,
-                    'title' => ts('Name') ,
-                    'maxlength' => 255,
-                    'size' => CRM_Utils_Type::HUGE,
-                ) ,
-                'label' => array(
-                    'name' => 'label',
-                    'type' => CRM_Utils_Type::T_STRING,
-                    'title' => ts('Label') ,
-                    'maxlength' => 255,
-                    'size' => CRM_Utils_Type::HUGE,
-                ) ,
-                'description' => array(
-                    'name' => 'description',
-                    'type' => CRM_Utils_Type::T_TEXT,
-                    'title' => ts('Description') ,
-                    'rows' => 2,
-                    'cols' => 60,
-                    'default' => 'UL',
-                ) ,
-                'amount' => array(
-                    'name' => 'amount',
-                    'type' => CRM_Utils_Type::T_STRING,
-                    'title' => ts('Amount') ,
-                    'required' => true,
-                    'maxlength' => 512,
-                    'size' => CRM_Utils_Type::HUGE,
-                ) ,
-                'count' => array(
-                    'name' => 'count',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'title' => ts('Count') ,
-                    'default' => 'UL',
-                ) ,
-                'max_value' => array(
-                    'name' => 'max_value',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'title' => ts('Max Value') ,
-                    'default' => 'UL',
-                ) ,
-                'weight' => array(
-                    'name' => 'weight',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'title' => ts('Weight') ,
-                    'default' => '',
-                ) ,
-                'membership_type_id' => array(
-                    'name' => 'membership_type_id',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'default' => 'UL',
-                    'FKClassName' => 'CRM_Member_DAO_MembershipType',
-                ) ,
-                'is_default' => array(
-                    'name' => 'is_default',
-                    'type' => CRM_Utils_Type::T_BOOLEAN,
-                ) ,
-                'is_active' => array(
-                    'name' => 'is_active',
-                    'type' => CRM_Utils_Type::T_BOOLEAN,
-                    'default' => '',
-                ) ,
-            );
-        }
-        return self::$_fields;
-    }
-    /**
-     * returns the names of this table
-     *
-     * @static
-     * @return string
-     */
-    public static function getTableName()
-    {
-        return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
+  public function __construct() {
+    $this->__table = 'civicrm_price_field_value';
+    parent::__construct();
+  }
+
+  /**
+   * return foreign links
+   *
+   * @return array
+   */
+  public function links() {
+    if (!(self::$_links)) {
+      self::$_links = array(
+        'price_field_id' => 'civicrm_price_field:id',
+        'membership_type_id' => 'civicrm_membership_type:id',
+      );
     }
-    /**
-     * returns if this table needs to be logged
-     *
-     * @return boolean
-     */
-    public function getLog()
-    {
-        return self::$_log;
+    return self::$_links;
+  }
+
+  /**
+   * returns all the column names of this table
+   *
+   * @return array
+   */
+  static function &fields() {
+    if (!(self::$_fields)) {
+      self::$_fields = array(
+        'id' => array(
+          'name' => 'id',
+          'type' => CRM_Utils_Type::T_INT,
+          'required' => TRUE,
+        ),
+        'price_field_id' => array(
+          'name' => 'price_field_id',
+          'type' => CRM_Utils_Type::T_INT,
+          'required' => TRUE,
+          'FKClassName' => 'Snapshot_v4p2_Price_DAO_Field',
+        ),
+        'name' => array(
+          'name' => 'name',
+          'type' => CRM_Utils_Type::T_STRING,
+          'title' => ts('Name'),
+          'maxlength' => 255,
+          'size' => CRM_Utils_Type::HUGE,
+        ),
+        'label' => array(
+          'name' => 'label',
+          'type' => CRM_Utils_Type::T_STRING,
+          'title' => ts('Label'),
+          'maxlength' => 255,
+          'size' => CRM_Utils_Type::HUGE,
+        ),
+        'description' => array(
+          'name' => 'description',
+          'type' => CRM_Utils_Type::T_TEXT,
+          'title' => ts('Description'),
+          'rows' => 2,
+          'cols' => 60,
+          'default' => 'UL',
+        ),
+        'amount' => array(
+          'name' => 'amount',
+          'type' => CRM_Utils_Type::T_STRING,
+          'title' => ts('Amount'),
+          'required' => TRUE,
+          'maxlength' => 512,
+          'size' => CRM_Utils_Type::HUGE,
+        ),
+        'count' => array(
+          'name' => 'count',
+          'type' => CRM_Utils_Type::T_INT,
+          'title' => ts('Count'),
+          'default' => 'UL',
+        ),
+        'max_value' => array(
+          'name' => 'max_value',
+          'type' => CRM_Utils_Type::T_INT,
+          'title' => ts('Max Value'),
+          'default' => 'UL',
+        ),
+        'weight' => array(
+          'name' => 'weight',
+          'type' => CRM_Utils_Type::T_INT,
+          'title' => ts('Weight'),
+          'default' => '',
+        ),
+        'membership_type_id' => array(
+          'name' => 'membership_type_id',
+          'type' => CRM_Utils_Type::T_INT,
+          'default' => 'UL',
+          'FKClassName' => 'CRM_Member_DAO_MembershipType',
+        ),
+        'is_default' => array(
+          'name' => 'is_default',
+          'type' => CRM_Utils_Type::T_BOOLEAN,
+        ),
+        'is_active' => array(
+          'name' => 'is_active',
+          'type' => CRM_Utils_Type::T_BOOLEAN,
+          'default' => '',
+        ),
+      );
     }
-    /**
-     * returns the list of fields that can be imported
-     *
-     * return array
-     * @static
-     */
-    static function &import($prefix = false)
-    {
-        if (!(self::$_import)) {
-            self::$_import = array();
-            $fields = self::fields();
-            foreach($fields as $name => $field) {
-                if (!empty($field['import'])) {
-                    if ($prefix) {
-                        self::$_import['price_field_value'] = & $fields[$name];
-                    }
-                    else {
-                        self::$_import[$name] = & $fields[$name];
-                    }
-                }
-            }
+    return self::$_fields;
+  }
+
+  /**
+   * returns the names of this table
+   *
+   * @static
+   * @return string
+   */
+  public static function getTableName() {
+    return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
+  }
+
+  /**
+   * returns if this table needs to be logged
+   *
+   * @return boolean
+   */
+  public function getLog() {
+    return self::$_log;
+  }
+
+  /**
+   * returns the list of fields that can be imported
+   *
+   * return array
+   * @static
+   */
+  static function &import($prefix = FALSE) {
+    if (!(self::$_import)) {
+      self::$_import = array();
+      $fields = self::fields();
+      foreach ($fields as $name => $field) {
+        if (!empty($field['import'])) {
+          if ($prefix) {
+            self::$_import['price_field_value'] = &$fields[$name];
+          }
+          else {
+            self::$_import[$name] = &$fields[$name];
+          }
         }
-        return self::$_import;
+      }
     }
-    /**
-     * returns the list of fields that can be exported
-     *
-     * return array
-     * @static
-     */
-    static function &export($prefix = false)
-    {
-        if (!(self::$_export)) {
-            self::$_export = array();
-            $fields = self::fields();
-            foreach($fields as $name => $field) {
-                if (!empty($field['export'])) {
-                    if ($prefix) {
-                        self::$_export['price_field_value'] = & $fields[$name];
-                    }
-                    else {
-                        self::$_export[$name] = & $fields[$name];
-                    }
-                }
-            }
+    return self::$_import;
+  }
+
+  /**
+   * returns the list of fields that can be exported
+   *
+   * return array
+   * @static
+   */
+  static function &export($prefix = FALSE) {
+    if (!(self::$_export)) {
+      self::$_export = array();
+      $fields = self::fields();
+      foreach ($fields as $name => $field) {
+        if (!empty($field['export'])) {
+          if ($prefix) {
+            self::$_export['price_field_value'] = &$fields[$name];
+          }
+          else {
+            self::$_export[$name] = &$fields[$name];
+          }
         }
-        return self::$_export;
+      }
     }
+    return self::$_export;
+  }
 }
index ce0b37a6d4322671454ec23adbf95f3e27fc470c..2dd8580d20c932295e1eb8917ca75aa38b57af52 100644 (file)
@@ -37,279 +37,277 @@ require_once 'CRM/Utils/Type.php';
 /**
  * Class CRM_Upgrade_Snapshot_V4p2_Price_DAO_LineItem
  */
-class CRM_Upgrade_Snapshot_V4p2_Price_DAO_LineItem extends CRM_Core_DAO
-{
-    /**
-     * static instance to hold the table name
-     *
-     * @var string
-     * @static
-     */
-    static $_tableName = 'civicrm_line_item';
-    /**
-     * static instance to hold the field values
-     *
-     * @var array
-     * @static
-     */
-    static $_fields = null;
-    /**
-     * static instance to hold the FK relationships
-     *
-     * @var string
-     * @static
-     */
-    static $_links = null;
-    /**
-     * static instance to hold the values that can
-     * be imported
-     *
-     * @var array
-     * @static
-     */
-    static $_import = null;
-    /**
-     * static instance to hold the values that can
-     * be exported
-     *
-     * @var array
-     * @static
-     */
-    static $_export = null;
-    /**
-     * static value to see if we should log any modifications to
-     * this table in the civicrm_log table
-     *
-     * @var boolean
-     * @static
-     */
-    static $_log = true;
-    /**
-     * Line Item
-     *
-     * @var int unsigned
-     */
-    public $id;
-    /**
-     * table which has the transaction
-     *
-     * @var string
-     */
-    public $entity_table;
-    /**
-     * entry in table
-     *
-     * @var int unsigned
-     */
-    public $entity_id;
-    /**
-     * FK to price_field
-     *
-     * @var int unsigned
-     */
-    public $price_field_id;
-    /**
-     * descriptive label for item - from price_field_value.label
-     *
-     * @var string
-     */
-    public $label;
-    /**
-     * How many items ordered
-     *
-     * @var int unsigned
-     */
-    public $qty;
-    /**
-     * price of each item
-     *
-     * @var float
-     */
-    public $unit_price;
-    /**
-     * qty * unit_price
-     *
-     * @var float
-     */
-    public $line_total;
-    /**
-     * Participant count for field
-     *
-     * @var int unsigned
-     */
-    public $participant_count;
-    /**
-     * Implicit FK to civicrm_option_value
-     *
-     * @var int unsigned
-     */
-    public $price_field_value_id;
+class CRM_Upgrade_Snapshot_V4p2_Price_DAO_LineItem extends CRM_Core_DAO {
+  /**
+   * static instance to hold the table name
+   *
+   * @var string
+   * @static
+   */
+  static $_tableName = 'civicrm_line_item';
+  /**
+   * static instance to hold the field values
+   *
+   * @var array
+   * @static
+   */
+  static $_fields = NULL;
+  /**
+   * static instance to hold the FK relationships
+   *
+   * @var string
+   * @static
+   */
+  static $_links = NULL;
+  /**
+   * static instance to hold the values that can
+   * be imported
+   *
+   * @var array
+   * @static
+   */
+  static $_import = NULL;
+  /**
+   * static instance to hold the values that can
+   * be exported
+   *
+   * @var array
+   * @static
+   */
+  static $_export = NULL;
+  /**
+   * static value to see if we should log any modifications to
+   * this table in the civicrm_log table
+   *
+   * @var boolean
+   * @static
+   */
+  static $_log = TRUE;
+  /**
+   * Line Item
+   *
+   * @var int unsigned
+   */
+  public $id;
+  /**
+   * table which has the transaction
+   *
+   * @var string
+   */
+  public $entity_table;
+  /**
+   * entry in table
+   *
+   * @var int unsigned
+   */
+  public $entity_id;
+  /**
+   * FK to price_field
+   *
+   * @var int unsigned
+   */
+  public $price_field_id;
+  /**
+   * descriptive label for item - from price_field_value.label
+   *
+   * @var string
+   */
+  public $label;
+  /**
+   * How many items ordered
+   *
+   * @var int unsigned
+   */
+  public $qty;
+  /**
+   * price of each item
+   *
+   * @var float
+   */
+  public $unit_price;
+  /**
+   * qty * unit_price
+   *
+   * @var float
+   */
+  public $line_total;
+  /**
+   * Participant count for field
+   *
+   * @var int unsigned
+   */
+  public $participant_count;
+  /**
+   * Implicit FK to civicrm_option_value
+   *
+   * @var int unsigned
+   */
+  public $price_field_value_id;
 
   /**
    * Class constructor
    *
    * @return \CRM_Upgrade_Snapshot_V4p2_Price_DAO_LineItem
    */
-    public function __construct()
-    {
-        $this->__table = 'civicrm_line_item';
-        parent::__construct();
-    }
-    /**
-     * return foreign links
-     *
-     * @return array
-     */
-    public function links()
-    {
-        if (!(self::$_links)) {
-            self::$_links = array(
-                'price_field_id' => 'civicrm_price_field:id',
-                'price_field_value_id' => 'civicrm_price_field_value:id',
-            );
-        }
-        return self::$_links;
-    }
-    /**
-     * returns all the column names of this table
-     *
-     * @return array
-     */
-    static function &fields()
-    {
-        if (!(self::$_fields)) {
-            self::$_fields = array(
-                'id' => array(
-                    'name' => 'id',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'required' => true,
-                ) ,
-                'entity_table' => array(
-                    'name' => 'entity_table',
-                    'type' => CRM_Utils_Type::T_STRING,
-                    'title' => ts('Entity Table') ,
-                    'required' => true,
-                    'maxlength' => 64,
-                    'size' => CRM_Utils_Type::BIG,
-                ) ,
-                'entity_id' => array(
-                    'name' => 'entity_id',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'required' => true,
-                ) ,
-                'price_field_id' => array(
-                    'name' => 'price_field_id',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'required' => true,
-                    'FKClassName' => 'Snapshot_v4p2_Price_DAO_Field',
-                ) ,
-                'label' => array(
-                    'name' => 'label',
-                    'type' => CRM_Utils_Type::T_STRING,
-                    'title' => ts('Label') ,
-                    'maxlength' => 255,
-                    'size' => CRM_Utils_Type::HUGE,
-                    'default' => 'UL',
-                ) ,
-                'qty' => array(
-                    'name' => 'qty',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'title' => ts('Qty') ,
-                    'required' => true,
-                ) ,
-                'unit_price' => array(
-                    'name' => 'unit_price',
-                    'type' => CRM_Utils_Type::T_MONEY,
-                    'title' => ts('Unit Price') ,
-                    'required' => true,
-                ) ,
-                'line_total' => array(
-                    'name' => 'line_total',
-                    'type' => CRM_Utils_Type::T_MONEY,
-                    'title' => ts('Line Total') ,
-                    'required' => true,
-                ) ,
-                'participant_count' => array(
-                    'name' => 'participant_count',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'title' => ts('Participant Count') ,
-                    'default' => 'UL',
-                ) ,
-                'price_field_value_id' => array(
-                    'name' => 'price_field_value_id',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'default' => 'UL',
-                    'FKClassName' => 'Snapshot_v4p2_Price_DAO_FieldValue',
-                ) ,
-            );
-        }
-        return self::$_fields;
-    }
-    /**
-     * returns the names of this table
-     *
-     * @static
-     * @return string
-     */
-    public static function getTableName()
-    {
-        return self::$_tableName;
+  public function __construct() {
+    $this->__table = 'civicrm_line_item';
+    parent::__construct();
+  }
+
+  /**
+   * return foreign links
+   *
+   * @return array
+   */
+  public function links() {
+    if (!(self::$_links)) {
+      self::$_links = array(
+        'price_field_id' => 'civicrm_price_field:id',
+        'price_field_value_id' => 'civicrm_price_field_value:id',
+      );
     }
-    /**
-     * returns if this table needs to be logged
-     *
-     * @return boolean
-     */
-    public function getLog()
-    {
-        return self::$_log;
+    return self::$_links;
+  }
+
+  /**
+   * returns all the column names of this table
+   *
+   * @return array
+   */
+  static function &fields() {
+    if (!(self::$_fields)) {
+      self::$_fields = array(
+        'id' => array(
+          'name' => 'id',
+          'type' => CRM_Utils_Type::T_INT,
+          'required' => TRUE,
+        ),
+        'entity_table' => array(
+          'name' => 'entity_table',
+          'type' => CRM_Utils_Type::T_STRING,
+          'title' => ts('Entity Table'),
+          'required' => TRUE,
+          'maxlength' => 64,
+          'size' => CRM_Utils_Type::BIG,
+        ),
+        'entity_id' => array(
+          'name' => 'entity_id',
+          'type' => CRM_Utils_Type::T_INT,
+          'required' => TRUE,
+        ),
+        'price_field_id' => array(
+          'name' => 'price_field_id',
+          'type' => CRM_Utils_Type::T_INT,
+          'required' => TRUE,
+          'FKClassName' => 'Snapshot_v4p2_Price_DAO_Field',
+        ),
+        'label' => array(
+          'name' => 'label',
+          'type' => CRM_Utils_Type::T_STRING,
+          'title' => ts('Label'),
+          'maxlength' => 255,
+          'size' => CRM_Utils_Type::HUGE,
+          'default' => 'UL',
+        ),
+        'qty' => array(
+          'name' => 'qty',
+          'type' => CRM_Utils_Type::T_INT,
+          'title' => ts('Qty'),
+          'required' => TRUE,
+        ),
+        'unit_price' => array(
+          'name' => 'unit_price',
+          'type' => CRM_Utils_Type::T_MONEY,
+          'title' => ts('Unit Price'),
+          'required' => TRUE,
+        ),
+        'line_total' => array(
+          'name' => 'line_total',
+          'type' => CRM_Utils_Type::T_MONEY,
+          'title' => ts('Line Total'),
+          'required' => TRUE,
+        ),
+        'participant_count' => array(
+          'name' => 'participant_count',
+          'type' => CRM_Utils_Type::T_INT,
+          'title' => ts('Participant Count'),
+          'default' => 'UL',
+        ),
+        'price_field_value_id' => array(
+          'name' => 'price_field_value_id',
+          'type' => CRM_Utils_Type::T_INT,
+          'default' => 'UL',
+          'FKClassName' => 'Snapshot_v4p2_Price_DAO_FieldValue',
+        ),
+      );
     }
-    /**
-     * returns the list of fields that can be imported
-     *
-     * return array
-     * @static
-     */
-    static function &import($prefix = false)
-    {
-        if (!(self::$_import)) {
-            self::$_import = array();
-            $fields = self::fields();
-            foreach($fields as $name => $field) {
-                if (!empty($field['import'])) {
-                    if ($prefix) {
-                        self::$_import['line_item'] = & $fields[$name];
-                    }
-                    else {
-                        self::$_import[$name] = & $fields[$name];
-                    }
-                }
-            }
+    return self::$_fields;
+  }
+
+  /**
+   * returns the names of this table
+   *
+   * @static
+   * @return string
+   */
+  public static function getTableName() {
+    return self::$_tableName;
+  }
+
+  /**
+   * returns if this table needs to be logged
+   *
+   * @return boolean
+   */
+  public function getLog() {
+    return self::$_log;
+  }
+
+  /**
+   * returns the list of fields that can be imported
+   *
+   * return array
+   * @static
+   */
+  static function &import($prefix = FALSE) {
+    if (!(self::$_import)) {
+      self::$_import = array();
+      $fields = self::fields();
+      foreach ($fields as $name => $field) {
+        if (!empty($field['import'])) {
+          if ($prefix) {
+            self::$_import['line_item'] = &$fields[$name];
+          }
+          else {
+            self::$_import[$name] = &$fields[$name];
+          }
         }
-        return self::$_import;
+      }
     }
-    /**
-     * returns the list of fields that can be exported
-     *
-     * return array
-     * @static
-     */
-    static function &export($prefix = false)
-    {
-        if (!(self::$_export)) {
-            self::$_export = array();
-            $fields = self::fields();
-            foreach($fields as $name => $field) {
-                if (!empty($field['export'])) {
-                    if ($prefix) {
-                        self::$_export['line_item'] = & $fields[$name];
-                    }
-                    else {
-                        self::$_export[$name] = & $fields[$name];
-                    }
-                }
-            }
+    return self::$_import;
+  }
+
+  /**
+   * returns the list of fields that can be exported
+   *
+   * return array
+   * @static
+   */
+  static function &export($prefix = FALSE) {
+    if (!(self::$_export)) {
+      self::$_export = array();
+      $fields = self::fields();
+      foreach ($fields as $name => $field) {
+        if (!empty($field['export'])) {
+          if ($prefix) {
+            self::$_export['line_item'] = &$fields[$name];
+          }
+          else {
+            self::$_export[$name] = &$fields[$name];
+          }
         }
-        return self::$_export;
+      }
     }
+    return self::$_export;
+  }
 }
index 3563fbf250495ebbb895b27e0191c3ef91239393..42be0ca43277d5e3e949115317242c2baa8f8455 100644 (file)
@@ -37,303 +37,301 @@ require_once 'CRM/Utils/Type.php';
 /**
  * Class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set
  */
-class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set extends CRM_Core_DAO
-{
-    /**
-     * static instance to hold the table name
-     *
-     * @var string
-     * @static
-     */
-    static $_tableName = 'civicrm_price_set';
-    /**
-     * static instance to hold the field values
-     *
-     * @var array
-     * @static
-     */
-    static $_fields = null;
-    /**
-     * static instance to hold the FK relationships
-     *
-     * @var string
-     * @static
-     */
-    static $_links = null;
-    /**
-     * static instance to hold the values that can
-     * be imported
-     *
-     * @var array
-     * @static
-     */
-    static $_import = null;
-    /**
-     * static instance to hold the values that can
-     * be exported
-     *
-     * @var array
-     * @static
-     */
-    static $_export = null;
-    /**
-     * static value to see if we should log any modifications to
-     * this table in the civicrm_log table
-     *
-     * @var boolean
-     * @static
-     */
-    static $_log = true;
-    /**
-     * Price Set
-     *
-     * @var int unsigned
-     */
-    public $id;
-    /**
-     * Which Domain is this price-set for
-     *
-     * @var int unsigned
-     */
-    public $domain_id;
-    /**
-     * Variable name/programmatic handle for this set of price fields.
-     *
-     * @var string
-     */
-    public $name;
-    /**
-     * Displayed title for the Price Set.
-     *
-     * @var string
-     */
-    public $title;
-    /**
-     * Is this price set active
-     *
-     * @var boolean
-     */
-    public $is_active;
-    /**
-     * Description and/or help text to display before fields in form.
-     *
-     * @var text
-     */
-    public $help_pre;
-    /**
-     * Description and/or help text to display after fields in form.
-     *
-     * @var text
-     */
-    public $help_post;
-    /**
-     * Optional Javascript script function(s) included on the form with this price_set. Can be used for conditional
-     *
-     * @var string
-     */
-    public $javascript;
-    /**
-     * What components are using this price set?
-     *
-     * @var string
-     */
-    public $extends;
-    /**
-     * FK to Contribution Type(for membership price sets only).
-     *
-     * @var int unsigned
-     */
-    public $contribution_type_id;
-    /**
-     * Is set if edited on Contribution or Event Page rather than through Manage Price Sets
-     *
-     * @var boolean
-     */
-    public $is_quick_config;
-    /**
-     * Is this a predefined system price set  (i.e. it can not be deleted, edited)?
-     *
-     * @var boolean
-     */
-    public $is_reserved;
+class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set extends CRM_Core_DAO {
+  /**
+   * static instance to hold the table name
+   *
+   * @var string
+   * @static
+   */
+  static $_tableName = 'civicrm_price_set';
+  /**
+   * static instance to hold the field values
+   *
+   * @var array
+   * @static
+   */
+  static $_fields = NULL;
+  /**
+   * static instance to hold the FK relationships
+   *
+   * @var string
+   * @static
+   */
+  static $_links = NULL;
+  /**
+   * static instance to hold the values that can
+   * be imported
+   *
+   * @var array
+   * @static
+   */
+  static $_import = NULL;
+  /**
+   * static instance to hold the values that can
+   * be exported
+   *
+   * @var array
+   * @static
+   */
+  static $_export = NULL;
+  /**
+   * static value to see if we should log any modifications to
+   * this table in the civicrm_log table
+   *
+   * @var boolean
+   * @static
+   */
+  static $_log = TRUE;
+  /**
+   * Price Set
+   *
+   * @var int unsigned
+   */
+  public $id;
+  /**
+   * Which Domain is this price-set for
+   *
+   * @var int unsigned
+   */
+  public $domain_id;
+  /**
+   * Variable name/programmatic handle for this set of price fields.
+   *
+   * @var string
+   */
+  public $name;
+  /**
+   * Displayed title for the Price Set.
+   *
+   * @var string
+   */
+  public $title;
+  /**
+   * Is this price set active
+   *
+   * @var boolean
+   */
+  public $is_active;
+  /**
+   * Description and/or help text to display before fields in form.
+   *
+   * @var text
+   */
+  public $help_pre;
+  /**
+   * Description and/or help text to display after fields in form.
+   *
+   * @var text
+   */
+  public $help_post;
+  /**
+   * Optional Javascript script function(s) included on the form with this price_set. Can be used for conditional
+   *
+   * @var string
+   */
+  public $javascript;
+  /**
+   * What components are using this price set?
+   *
+   * @var string
+   */
+  public $extends;
+  /**
+   * FK to Contribution Type(for membership price sets only).
+   *
+   * @var int unsigned
+   */
+  public $contribution_type_id;
+  /**
+   * Is set if edited on Contribution or Event Page rather than through Manage Price Sets
+   *
+   * @var boolean
+   */
+  public $is_quick_config;
+  /**
+   * Is this a predefined system price set  (i.e. it can not be deleted, edited)?
+   *
+   * @var boolean
+   */
+  public $is_reserved;
 
   /**
    * Class constructor
    *
    * @return \CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set
    */
-    public function __construct()
-    {
-        $this->__table = 'civicrm_price_set';
-        parent::__construct();
-    }
-    /**
-     * return foreign links
-     *
-     * @return array
-     */
-    public function links()
-    {
-        if (!(self::$_links)) {
-            self::$_links = array(
-                'domain_id' => 'civicrm_domain:id',
-                'contribution_type_id' => 'civicrm_contribution_type:id',
-            );
-        }
-        return self::$_links;
-    }
-    /**
-     * returns all the column names of this table
-     *
-     * @return array
-     */
-    static function &fields()
-    {
-        if (!(self::$_fields)) {
-            self::$_fields = array(
-                'id' => array(
-                    'name' => 'id',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'required' => true,
-                ) ,
-                'domain_id' => array(
-                    'name' => 'domain_id',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'FKClassName' => 'CRM_Core_DAO_Domain',
-                ) ,
-                'name' => array(
-                    'name' => 'name',
-                    'type' => CRM_Utils_Type::T_STRING,
-                    'title' => ts('Name') ,
-                    'required' => true,
-                    'maxlength' => 255,
-                    'size' => CRM_Utils_Type::HUGE,
-                ) ,
-                'title' => array(
-                    'name' => 'title',
-                    'type' => CRM_Utils_Type::T_STRING,
-                    'title' => ts('Title') ,
-                    'required' => true,
-                    'maxlength' => 255,
-                    'size' => CRM_Utils_Type::HUGE,
-                ) ,
-                'is_active' => array(
-                    'name' => 'is_active',
-                    'type' => CRM_Utils_Type::T_BOOLEAN,
-                    'default' => '',
-                ) ,
-                'help_pre' => array(
-                    'name' => 'help_pre',
-                    'type' => CRM_Utils_Type::T_TEXT,
-                    'title' => ts('Help Pre') ,
-                    'rows' => 4,
-                    'cols' => 80,
-                ) ,
-                'help_post' => array(
-                    'name' => 'help_post',
-                    'type' => CRM_Utils_Type::T_TEXT,
-                    'title' => ts('Help Post') ,
-                    'rows' => 4,
-                    'cols' => 80,
-                ) ,
-                'javascript' => array(
-                    'name' => 'javascript',
-                    'type' => CRM_Utils_Type::T_STRING,
-                    'title' => ts('Javascript') ,
-                    'maxlength' => 64,
-                    'size' => CRM_Utils_Type::BIG,
-                ) ,
-                'extends' => array(
-                    'name' => 'extends',
-                    'type' => CRM_Utils_Type::T_STRING,
-                    'title' => ts('Extends') ,
-                    'required' => true,
-                    'maxlength' => 255,
-                    'size' => CRM_Utils_Type::HUGE,
-                ) ,
-                'contribution_type_id' => array(
-                    'name' => 'contribution_type_id',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'default' => 'UL',
-                    'FKClassName' => 'CRM_Contribute_DAO_ContributionType',
-                ) ,
-                'is_quick_config' => array(
-                    'name' => 'is_quick_config',
-                    'type' => CRM_Utils_Type::T_BOOLEAN,
-                ) ,
-                'is_reserved' => array(
-                    'name' => 'is_reserved',
-                    'type' => CRM_Utils_Type::T_BOOLEAN,
-                ) ,
-            );
-        }
-        return self::$_fields;
-    }
-    /**
-     * returns the names of this table
-     *
-     * @static
-     * @return string
-     */
-    public static function getTableName()
-    {
-        return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
+  public function __construct() {
+    $this->__table = 'civicrm_price_set';
+    parent::__construct();
+  }
+
+  /**
+   * return foreign links
+   *
+   * @return array
+   */
+  public function links() {
+    if (!(self::$_links)) {
+      self::$_links = array(
+        'domain_id' => 'civicrm_domain:id',
+        'contribution_type_id' => 'civicrm_contribution_type:id',
+      );
     }
-    /**
-     * returns if this table needs to be logged
-     *
-     * @return boolean
-     */
-    public function getLog()
-    {
-        return self::$_log;
+    return self::$_links;
+  }
+
+  /**
+   * returns all the column names of this table
+   *
+   * @return array
+   */
+  static function &fields() {
+    if (!(self::$_fields)) {
+      self::$_fields = array(
+        'id' => array(
+          'name' => 'id',
+          'type' => CRM_Utils_Type::T_INT,
+          'required' => TRUE,
+        ),
+        'domain_id' => array(
+          'name' => 'domain_id',
+          'type' => CRM_Utils_Type::T_INT,
+          'FKClassName' => 'CRM_Core_DAO_Domain',
+        ),
+        'name' => array(
+          'name' => 'name',
+          'type' => CRM_Utils_Type::T_STRING,
+          'title' => ts('Name'),
+          'required' => TRUE,
+          'maxlength' => 255,
+          'size' => CRM_Utils_Type::HUGE,
+        ),
+        'title' => array(
+          'name' => 'title',
+          'type' => CRM_Utils_Type::T_STRING,
+          'title' => ts('Title'),
+          'required' => TRUE,
+          'maxlength' => 255,
+          'size' => CRM_Utils_Type::HUGE,
+        ),
+        'is_active' => array(
+          'name' => 'is_active',
+          'type' => CRM_Utils_Type::T_BOOLEAN,
+          'default' => '',
+        ),
+        'help_pre' => array(
+          'name' => 'help_pre',
+          'type' => CRM_Utils_Type::T_TEXT,
+          'title' => ts('Help Pre'),
+          'rows' => 4,
+          'cols' => 80,
+        ),
+        'help_post' => array(
+          'name' => 'help_post',
+          'type' => CRM_Utils_Type::T_TEXT,
+          'title' => ts('Help Post'),
+          'rows' => 4,
+          'cols' => 80,
+        ),
+        'javascript' => array(
+          'name' => 'javascript',
+          'type' => CRM_Utils_Type::T_STRING,
+          'title' => ts('Javascript'),
+          'maxlength' => 64,
+          'size' => CRM_Utils_Type::BIG,
+        ),
+        'extends' => array(
+          'name' => 'extends',
+          'type' => CRM_Utils_Type::T_STRING,
+          'title' => ts('Extends'),
+          'required' => TRUE,
+          'maxlength' => 255,
+          'size' => CRM_Utils_Type::HUGE,
+        ),
+        'contribution_type_id' => array(
+          'name' => 'contribution_type_id',
+          'type' => CRM_Utils_Type::T_INT,
+          'default' => 'UL',
+          'FKClassName' => 'CRM_Contribute_DAO_ContributionType',
+        ),
+        'is_quick_config' => array(
+          'name' => 'is_quick_config',
+          'type' => CRM_Utils_Type::T_BOOLEAN,
+        ),
+        'is_reserved' => array(
+          'name' => 'is_reserved',
+          'type' => CRM_Utils_Type::T_BOOLEAN,
+        ),
+      );
     }
-    /**
-     * returns the list of fields that can be imported
-     *
-     * return array
-     * @static
-     */
-    static function &import($prefix = false)
-    {
-        if (!(self::$_import)) {
-            self::$_import = array();
-            $fields = self::fields();
-            foreach($fields as $name => $field) {
-                if (!empty($field['import'])) {
-                    if ($prefix) {
-                        self::$_import['price_set'] = & $fields[$name];
-                    }
-                    else {
-                        self::$_import[$name] = & $fields[$name];
-                    }
-                }
-            }
+    return self::$_fields;
+  }
+
+  /**
+   * returns the names of this table
+   *
+   * @static
+   * @return string
+   */
+  public static function getTableName() {
+    return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
+  }
+
+  /**
+   * returns if this table needs to be logged
+   *
+   * @return boolean
+   */
+  public function getLog() {
+    return self::$_log;
+  }
+
+  /**
+   * returns the list of fields that can be imported
+   *
+   * return array
+   * @static
+   */
+  static function &import($prefix = FALSE) {
+    if (!(self::$_import)) {
+      self::$_import = array();
+      $fields = self::fields();
+      foreach ($fields as $name => $field) {
+        if (!empty($field['import'])) {
+          if ($prefix) {
+            self::$_import['price_set'] = &$fields[$name];
+          }
+          else {
+            self::$_import[$name] = &$fields[$name];
+          }
         }
-        return self::$_import;
+      }
     }
-    /**
-     * returns the list of fields that can be exported
-     *
-     * return array
-     * @static
-     */
-    static function &export($prefix = false)
-    {
-        if (!(self::$_export)) {
-            self::$_export = array();
-            $fields = self::fields();
-            foreach($fields as $name => $field) {
-                if (!empty($field['export'])) {
-                    if ($prefix) {
-                        self::$_export['price_set'] = & $fields[$name];
-                    }
-                    else {
-                        self::$_export[$name] = & $fields[$name];
-                    }
-                }
-            }
+    return self::$_import;
+  }
+
+  /**
+   * returns the list of fields that can be exported
+   *
+   * return array
+   * @static
+   */
+  static function &export($prefix = FALSE) {
+    if (!(self::$_export)) {
+      self::$_export = array();
+      $fields = self::fields();
+      foreach ($fields as $name => $field) {
+        if (!empty($field['export'])) {
+          if ($prefix) {
+            self::$_export['price_set'] = &$fields[$name];
+          }
+          else {
+            self::$_export[$name] = &$fields[$name];
+          }
         }
-        return self::$_export;
+      }
     }
+    return self::$_export;
+  }
 }
index ec099fabf7e59bdb68c004df7581409c6246707a..a718314335bb15949ff85672b828a89ee1c47a4f 100644 (file)
@@ -37,204 +37,202 @@ require_once 'CRM/Utils/Type.php';
 /**
  * Class CRM_Upgrade_Snapshot_V4p2_Price_DAO_SetEntity
  */
-class CRM_Upgrade_Snapshot_V4p2_Price_DAO_SetEntity extends CRM_Core_DAO
-{
-    /**
-     * static instance to hold the table name
-     *
-     * @var string
-     * @static
-     */
-    static $_tableName = 'civicrm_price_set_entity';
-    /**
-     * static instance to hold the field values
-     *
-     * @var array
-     * @static
-     */
-    static $_fields = null;
-    /**
-     * static instance to hold the FK relationships
-     *
-     * @var string
-     * @static
-     */
-    static $_links = null;
-    /**
-     * static instance to hold the values that can
-     * be imported
-     *
-     * @var array
-     * @static
-     */
-    static $_import = null;
-    /**
-     * static instance to hold the values that can
-     * be exported
-     *
-     * @var array
-     * @static
-     */
-    static $_export = null;
-    /**
-     * static value to see if we should log any modifications to
-     * this table in the civicrm_log table
-     *
-     * @var boolean
-     * @static
-     */
-    static $_log = true;
-    /**
-     * Price Set Entity
-     *
-     * @var int unsigned
-     */
-    public $id;
-    /**
-     * Table which uses this price set
-     *
-     * @var string
-     */
-    public $entity_table;
-    /**
-     * Item in table
-     *
-     * @var int unsigned
-     */
-    public $entity_id;
-    /**
-     * price set being used
-     *
-     * @var int unsigned
-     */
-    public $price_set_id;
+class CRM_Upgrade_Snapshot_V4p2_Price_DAO_SetEntity extends CRM_Core_DAO {
+  /**
+   * static instance to hold the table name
+   *
+   * @var string
+   * @static
+   */
+  static $_tableName = 'civicrm_price_set_entity';
+  /**
+   * static instance to hold the field values
+   *
+   * @var array
+   * @static
+   */
+  static $_fields = NULL;
+  /**
+   * static instance to hold the FK relationships
+   *
+   * @var string
+   * @static
+   */
+  static $_links = NULL;
+  /**
+   * static instance to hold the values that can
+   * be imported
+   *
+   * @var array
+   * @static
+   */
+  static $_import = NULL;
+  /**
+   * static instance to hold the values that can
+   * be exported
+   *
+   * @var array
+   * @static
+   */
+  static $_export = NULL;
+  /**
+   * static value to see if we should log any modifications to
+   * this table in the civicrm_log table
+   *
+   * @var boolean
+   * @static
+   */
+  static $_log = TRUE;
+  /**
+   * Price Set Entity
+   *
+   * @var int unsigned
+   */
+  public $id;
+  /**
+   * Table which uses this price set
+   *
+   * @var string
+   */
+  public $entity_table;
+  /**
+   * Item in table
+   *
+   * @var int unsigned
+   */
+  public $entity_id;
+  /**
+   * price set being used
+   *
+   * @var int unsigned
+   */
+  public $price_set_id;
 
   /**
    * Class constructor
    *
    * @return \CRM_Upgrade_Snapshot_V4p2_Price_DAO_SetEntity
    */
-    public function __construct()
-    {
-        $this->__table = 'civicrm_price_set_entity';
-        parent::__construct();
-    }
-    /**
-     * return foreign links
-     *
-     * @return array
-     */
-    public function links()
-    {
-        if (!(self::$_links)) {
-            self::$_links = array(
-                'price_set_id' => 'civicrm_price_set:id',
-            );
-        }
-        return self::$_links;
-    }
-    /**
-     * returns all the column names of this table
-     *
-     * @return array
-     */
-    static function &fields()
-    {
-        if (!(self::$_fields)) {
-            self::$_fields = array(
-                'id' => array(
-                    'name' => 'id',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'required' => true,
-                ) ,
-                'entity_table' => array(
-                    'name' => 'entity_table',
-                    'type' => CRM_Utils_Type::T_STRING,
-                    'title' => ts('Entity Table') ,
-                    'required' => true,
-                    'maxlength' => 64,
-                    'size' => CRM_Utils_Type::BIG,
-                ) ,
-                'entity_id' => array(
-                    'name' => 'entity_id',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'required' => true,
-                ) ,
-                'price_set_id' => array(
-                    'name' => 'price_set_id',
-                    'type' => CRM_Utils_Type::T_INT,
-                    'required' => true,
-                    'FKClassName' => 'Snapshot_v4p2_Price_DAO_Set',
-                ) ,
-            );
-        }
-        return self::$_fields;
-    }
-    /**
-     * returns the names of this table
-     *
-     * @static
-     * @return string
-     */
-    public static function getTableName()
-    {
-        return self::$_tableName;
+  public function __construct() {
+    $this->__table = 'civicrm_price_set_entity';
+    parent::__construct();
+  }
+
+  /**
+   * return foreign links
+   *
+   * @return array
+   */
+  public function links() {
+    if (!(self::$_links)) {
+      self::$_links = array(
+        'price_set_id' => 'civicrm_price_set:id',
+      );
     }
-    /**
-     * returns if this table needs to be logged
-     *
-     * @return boolean
-     */
-    public function getLog()
-    {
-        return self::$_log;
+    return self::$_links;
+  }
+
+  /**
+   * returns all the column names of this table
+   *
+   * @return array
+   */
+  static function &fields() {
+    if (!(self::$_fields)) {
+      self::$_fields = array(
+        'id' => array(
+          'name' => 'id',
+          'type' => CRM_Utils_Type::T_INT,
+          'required' => TRUE,
+        ),
+        'entity_table' => array(
+          'name' => 'entity_table',
+          'type' => CRM_Utils_Type::T_STRING,
+          'title' => ts('Entity Table'),
+          'required' => TRUE,
+          'maxlength' => 64,
+          'size' => CRM_Utils_Type::BIG,
+        ),
+        'entity_id' => array(
+          'name' => 'entity_id',
+          'type' => CRM_Utils_Type::T_INT,
+          'required' => TRUE,
+        ),
+        'price_set_id' => array(
+          'name' => 'price_set_id',
+          'type' => CRM_Utils_Type::T_INT,
+          'required' => TRUE,
+          'FKClassName' => 'Snapshot_v4p2_Price_DAO_Set',
+        ),
+      );
     }
-    /**
-     * returns the list of fields that can be imported
-     *
-     * return array
-     * @static
-     */
-    static function &import($prefix = false)
-    {
-        if (!(self::$_import)) {
-            self::$_import = array();
-            $fields = self::fields();
-            foreach($fields as $name => $field) {
-                if (!empty($field['import'])) {
-                    if ($prefix) {
-                        self::$_import['price_set_entity'] = & $fields[$name];
-                    }
-                    else {
-                        self::$_import[$name] = & $fields[$name];
-                    }
-                }
-            }
+    return self::$_fields;
+  }
+
+  /**
+   * returns the names of this table
+   *
+   * @static
+   * @return string
+   */
+  public static function getTableName() {
+    return self::$_tableName;
+  }
+
+  /**
+   * returns if this table needs to be logged
+   *
+   * @return boolean
+   */
+  public function getLog() {
+    return self::$_log;
+  }
+
+  /**
+   * returns the list of fields that can be imported
+   *
+   * return array
+   * @static
+   */
+  static function &import($prefix = FALSE) {
+    if (!(self::$_import)) {
+      self::$_import = array();
+      $fields = self::fields();
+      foreach ($fields as $name => $field) {
+        if (!empty($field['import'])) {
+          if ($prefix) {
+            self::$_import['price_set_entity'] = &$fields[$name];
+          }
+          else {
+            self::$_import[$name] = &$fields[$name];
+          }
         }
-        return self::$_import;
+      }
     }
-    /**
-     * returns the list of fields that can be exported
-     *
-     * return array
-     * @static
-     */
-    static function &export($prefix = false)
-    {
-        if (!(self::$_export)) {
-            self::$_export = array();
-            $fields = self::fields();
-            foreach($fields as $name => $field) {
-                if (!empty($field['export'])) {
-                    if ($prefix) {
-                        self::$_export['price_set_entity'] = & $fields[$name];
-                    }
-                    else {
-                        self::$_export[$name] = & $fields[$name];
-                    }
-                }
-            }
+    return self::$_import;
+  }
+
+  /**
+   * returns the list of fields that can be exported
+   *
+   * return array
+   * @static
+   */
+  static function &export($prefix = FALSE) {
+    if (!(self::$_export)) {
+      self::$_export = array();
+      $fields = self::fields();
+      foreach ($fields as $name => $field) {
+        if (!empty($field['export'])) {
+          if ($prefix) {
+            self::$_export['price_set_entity'] = &$fields[$name];
+          }
+          else {
+            self::$_export[$name] = &$fields[$name];
+          }
         }
-        return self::$_export;
+      }
     }
+    return self::$_export;
+  }
 }
index 3c27365b7ccc42359cb0dbb2b06f1c698dfce026..f1754944cd7e636e2c5502fa9ee176e85960f916 100644 (file)
@@ -39,7 +39,6 @@
  * $Id$
  *
  */
-
 class CRM_Utils_API_HTMLInputCoder extends CRM_Utils_API_AbstractFieldCoder {
   private $skipFields = NULL;
 
index 3044c074455d394d3ddfd56a877ed3b4658666f0..b0fc937bf4b509bc1ba33a7d8942e08c266a6acb 100644 (file)
@@ -255,8 +255,8 @@ class CRM_Utils_Address {
     else {
       // remove \n from each line and only add at the end
       // this hack solves formatting issue, when we convert nl2br
-      $lines          = array();
-      $count          = 1;
+      $lines = array();
+      $count = 1;
       $finalFormatted = NULL;
       $formattedArray = explode("\n", $formatted);
       $formattedArray = array_filter($formattedArray);
index 62332940520dc14dcd0c9a7c70f14349ee0861ef..5a890d4b5110162a4524a3039e27be893350ea77 100644 (file)
@@ -256,14 +256,17 @@ class CRM_Utils_Address_BatchUpdate {
     }
 
     $this->returnMessages[] = ts("Addresses Evaluated: %1", array(
-      1 => $totalAddresses)) . "\n";
+        1 => $totalAddresses
+      )) . "\n";
     if ($processGeocode) {
       $this->returnMessages[] = ts("Addresses Geocoded: %1", array(
-        1 => $totalGeocoded)) . "\n";
+          1 => $totalGeocoded
+        )) . "\n";
     }
     if ($parseStreetAddress) {
       $this->returnMessages[] = ts("Street Addresses Parsed: %1", array(
-        1 => $totalAddressParsed)) . "\n";
+          1 => $totalAddressParsed
+        )) . "\n";
       if ($unparseableContactAddress) {
         $this->returnMessages[] = "<br />\n" . ts("Following is the list of contacts whose address is not parsed:") . "<br />\n";
         foreach ($unparseableContactAddress as $contactLink) {
@@ -279,7 +282,7 @@ class CRM_Utils_Address_BatchUpdate {
    * @return array
    */
   public function returnResult() {
-    $result             = array();
+    $result = array();
     $result['is_error'] = $this->returnError;
     $result['messages'] = implode("", $this->returnMessages);
     return $result;
index 3e13d2ede699a9f389db06bf25320ebb7848c7b7..d4105a186a9424e17f3fe2f3e184355480121ad3 100644 (file)
@@ -85,8 +85,8 @@ class CRM_Utils_Address_USPS {
     $code = $request->getResponseCode();
     if ($code != 200) {
       $session->setStatus(ts('USPS Address Lookup Failed with HTTP status code: %1',
-          array(1 => $code)
-        ));
+        array(1 => $code)
+      ));
       return FALSE;
     }
 
index 16e6b34139cc0edb1fb6aca150b62edf9226ca25..1a6434cc6c4963d0c5796b8aad570554c66bcd39 100644 (file)
@@ -34,7 +34,7 @@
  */
 class CRM_Utils_Cache_APCcache {
   const DEFAULT_TIMEOUT = 3600;
-  const DEFAULT_PREFIX  = '';
+  const DEFAULT_PREFIX = '';
 
   /**
    * The default timeout to use
index 7d601c1098c2755c49a09bc4289ac523e4a8bd87..1bee39c583b02e887aea261afbe70ef7ac0044a7 100644 (file)
  *
  */
 class CRM_Utils_Cache_Memcache {
-  const DEFAULT_HOST    = 'localhost';
-  const DEFAULT_PORT    = 11211;
+  const DEFAULT_HOST = 'localhost';
+  const DEFAULT_PORT = 11211;
   const DEFAULT_TIMEOUT = 3600;
-  const DEFAULT_PREFIX  = '';
+  const DEFAULT_PREFIX = '';
 
   /**
    * The host name of the memcached server
index 732aa831df37906cd3b8ac8e9c07e4f2369ddbd1..f347b1079162727acf2c828e734d9517571c2790 100644 (file)
  *
  */
 class CRM_Utils_Cache_Memcached {
-  const DEFAULT_HOST    = 'localhost';
-  const DEFAULT_PORT    = 11211;
+  const DEFAULT_HOST = 'localhost';
+  const DEFAULT_PORT = 11211;
   const DEFAULT_TIMEOUT = 3600;
-  const DEFAULT_PREFIX  = '';
-  const MAX_KEY_LEN     = 62;
+  const DEFAULT_PREFIX = '';
+  const MAX_KEY_LEN = 62;
 
   /**
    * The host name of the memcached server
index e3a0aa8dd0963afac16237dae95dcacb2d3f5631..0d8906069abc1ed314e9523b6381736d49b74bab 100644 (file)
@@ -32,7 +32,6 @@
  * $Id$
  *
  */
-
 class CRM_Utils_Cache_NoCache implements CRM_Utils_Cache_Interface {
 
   /**
index 2e6ede07b69a922402326cccb8ad189a509ca5c0..91c27ec5ba633a4de8095d25b33094242e8725e0 100644 (file)
@@ -52,7 +52,7 @@ class CRM_Utils_Cache_SerializeCache implements CRM_Utils_Cache_Interface {
    *
    * @return string
    */
-  public function fileName ($key) {
+  public function fileName($key) {
     if (strlen($key) > 50) {
       return CIVICRM_TEMPLATE_COMPILEDIR . "CRM_" . md5($key) . ".php";
     }
@@ -64,7 +64,7 @@ class CRM_Utils_Cache_SerializeCache implements CRM_Utils_Cache_Interface {
    *
    * @return mixed
    */
-  public function get ($key) {
+  public function get($key) {
     if (array_key_exists($key, $this->_cache)) {
       return $this->_cache[$key];
     }
index 62a76d89ab2ba669d311dd927e2ffcdcbad899bf..845f6f512011a3567c6ed243f6b3ba43d87edaf4 100644 (file)
@@ -103,7 +103,7 @@ class CRM_Utils_Cache_SqlGroup implements CRM_Utils_Cache_Interface {
    * @return mixed
    */
   public function get($key) {
-    if (! array_key_exists($key, $this->frontCache)) {
+    if (!array_key_exists($key, $this->frontCache)) {
       $this->frontCache[$key] = CRM_Core_BAO_Cache::getItem($this->group, $key, $this->componentID);
     }
     return $this->frontCache[$key];
index 986cee0f976fd73429810cb427028c897b9c88bc..4727bed3cd2071a2bb88c30a6f80c01e45828398 100644 (file)
@@ -46,7 +46,7 @@ class CRM_Utils_Check_Case {
 
   /**
    * @param CRM_Case_XMLRepository $xmlRepo
-   * @param array<string> $caseTypeNames
+   * @param array <string> $caseTypeNames
    */
   public function __construct($xmlRepo, $caseTypeNames) {
     $this->caseTypeNames = $caseTypeNames;
index faf49424181e34c42dffe1074683bf63ffb8dbb1..9875a9ffbd85747731f2c6b1f29f92f2de58db82 100644 (file)
@@ -150,8 +150,8 @@ class CRM_Utils_Check_Security {
         $messages[] = new CRM_Utils_Check_Message(
           'checkUploadsAreNotAccessible',
           ts('Files in the data directory (<a href="%3">%2</a>) should not be downloadable.'
-              . '<br />'
-              . '<a href="%1">Read more about this warning</a>',
+            . '<br />'
+            . '<a href="%1">Read more about this warning</a>',
             array(
               1 => $this->createDocUrl('checkUploadsAreNotAccessible'),
               2 => $privateDir,
index 6bffa9e95414ec4c576e3c164e3db9d9bacd6ccd..370774b747b06a0969c1805eb473331b71d952dc 100644 (file)
@@ -59,8 +59,8 @@ class CRM_Utils_Crypt {
     ) {
       $td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_ECB, '');
       // ECB mode - iv not needed - CRM-8198
-      $iv  = '00000000000000000000000000000000';
-      $ks  = mcrypt_enc_get_key_size($td);
+      $iv = '00000000000000000000000000000000';
+      $ks = mcrypt_enc_get_key_size($td);
       $key = substr(sha1(CIVICRM_SITE_KEY), 0, $ks);
 
       mcrypt_generic_init($td, $key, $iv);
@@ -98,8 +98,8 @@ class CRM_Utils_Crypt {
     ) {
       $td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_ECB, '');
       // ECB mode - iv not needed - CRM-8198
-      $iv  = '00000000000000000000000000000000';
-      $ks  = mcrypt_enc_get_key_size($td);
+      $iv = '00000000000000000000000000000000';
+      $ks = mcrypt_enc_get_key_size($td);
       $key = substr(sha1(CIVICRM_SITE_KEY), 0, $ks);
 
       mcrypt_generic_init($td, $key, $iv);
index 80442aaa9b8cd093d212161b56ff63b305896953..929d57c52bf0690caac9207f6b46bc6bf8f90215 100644 (file)
@@ -355,17 +355,17 @@ class CRM_Utils_Date {
 
     if (!CRM_Utils_System::isNull($dateString)) {
       if (strpos($dateString, '-')) {
-        $year  = (int) substr($dateString, 0, 4);
+        $year = (int) substr($dateString, 0, 4);
         $month = (int) substr($dateString, 5, 2);
-        $day   = (int) substr($dateString, 8, 2);
+        $day = (int) substr($dateString, 8, 2);
 
         $hour24 = (int) substr($dateString, 11, 2);
         $minute = (int) substr($dateString, 14, 2);
       }
       else {
-        $year  = (int) substr($dateString, 0, 4);
+        $year = (int) substr($dateString, 0, 4);
         $month = (int) substr($dateString, 4, 2);
-        $day   = (int) substr($dateString, 6, 2);
+        $day = (int) substr($dateString, 6, 2);
 
         $hour24 = (int) substr($dateString, 8, 2);
         $minute = (int) substr($dateString, 10, 2);
@@ -442,10 +442,10 @@ class CRM_Utils_Date {
    * @static
    */
   public static function mysqlToIso($mysql) {
-    $year   = substr($mysql, 0, 4);
-    $month  = substr($mysql, 4, 2);
-    $day    = substr($mysql, 6, 2);
-    $hour   = substr($mysql, 8, 2);
+    $year = substr($mysql, 0, 4);
+    $month = substr($mysql, 4, 2);
+    $day = substr($mysql, 6, 2);
+    $hour = substr($mysql, 8, 2);
     $minute = substr($mysql, 10, 2);
     $second = substr($mysql, 12, 2);
 
@@ -504,8 +504,8 @@ class CRM_Utils_Date {
    * @static
    */
   public static function convertToDefaultDate(&$params, $dateType, $dateParam) {
-    $now     = getdate();
-    $cen     = substr($now['year'], 0, 2);
+    $now = getdate();
+    $cen = substr($now['year'], 0, 2);
     $prevCen = $cen - 1;
 
     $value = NULL;
@@ -555,9 +555,9 @@ class CRM_Utils_Date {
     if ($dateType == 1) {
       $formattedDate = explode("-", $value);
       if (count($formattedDate) == 3) {
-        $year  = (int) $formattedDate[0];
+        $year = (int) $formattedDate[0];
         $month = (int) $formattedDate[1];
-        $day   = (int) $formattedDate[2];
+        $day = (int) $formattedDate[2];
       }
       elseif (count($formattedDate) == 1 && (strlen($value) == 8)) {
         return TRUE;
@@ -573,9 +573,9 @@ class CRM_Utils_Date {
         $formattedDate = explode("-", $value);
       }
       if (count($formattedDate) == 3) {
-        $year  = (int) $formattedDate[2];
+        $year = (int) $formattedDate[2];
         $month = (int) $formattedDate[0];
-        $day   = (int) $formattedDate[1];
+        $day = (int) $formattedDate[1];
       }
       else {
         return FALSE;
@@ -603,8 +603,8 @@ class CRM_Utils_Date {
           }
         }
       }
-      $year  = (int) $dateArray[2];
-      $day   = (int) $dateArray[1];
+      $year = (int) $dateArray[2];
+      $day = (int) $dateArray[1];
       $month = (int) $monthInt;
     }
     if ($dateType == 16) {
@@ -635,8 +635,8 @@ class CRM_Utils_Date {
           $monthInt = $dateArray[1];
         }
 
-        $year  = (int) $dateArray[2];
-        $day   = (int) $dateArray[0];
+        $year = (int) $dateArray[2];
+        $day = (int) $dateArray[0];
         $month = (int) $monthInt;
       }
       else {
@@ -646,9 +646,9 @@ class CRM_Utils_Date {
     if ($dateType == 32) {
       $formattedDate = explode("/", $value);
       if (count($formattedDate) == 3) {
-        $year  = (int) $formattedDate[2];
+        $year = (int) $formattedDate[2];
         $month = (int) $formattedDate[1];
-        $day   = (int) $formattedDate[0];
+        $day = (int) $formattedDate[0];
       }
       else {
         return FALSE;
@@ -725,7 +725,7 @@ class CRM_Utils_Date {
    * actuall today pass 'dayParams' as null. or else pass the day,
    * month, year values as array values
    * Example: $dayParams = array(
-  'day' => '25', 'month' => '10',
+   * 'day' => '25', 'month' => '10',
    *                              'year' => '2007' );
    *
    * @param array $dayParamsArray of the day, month, year.
@@ -745,10 +745,10 @@ class CRM_Utils_Date {
     }
     else {
       $today = date($format, mktime(0, 0, 0,
-                 $dayParams['month'],
-                 $dayParams['day'],
-                 $dayParams['year']
-               ));
+        $dayParams['month'],
+        $dayParams['day'],
+        $dayParams['year']
+      ));
     }
 
     return $today;
@@ -767,10 +767,10 @@ class CRM_Utils_Date {
    * @static
    */
   public static function getRange($startDate, $endDate) {
-    $today          = date("Y-m-d");
+    $today = date("Y-m-d");
     $mysqlStartDate = self::isoToMysql($startDate);
-    $mysqlEndDate   = self::isoToMysql($endDate);
-    $mysqlToday     = self::isoToMysql($today);
+    $mysqlEndDate = self::isoToMysql($endDate);
+    $mysqlToday = self::isoToMysql($today);
 
     if ((isset($mysqlStartDate) && isset($mysqlEndDate)) && (($mysqlToday >= $mysqlStartDate) && ($mysqlToday <= $mysqlEndDate))) {
       return TRUE;
@@ -827,11 +827,11 @@ class CRM_Utils_Date {
     $results = array();
     $formatedBirthDate = CRM_Utils_Date::customFormat($birthDate, '%Y-%m-%d');
 
-    $bDate      = explode('-', $formatedBirthDate);
-    $birthYear  = $bDate[0];
+    $bDate = explode('-', $formatedBirthDate);
+    $birthYear = $bDate[0];
     $birthMonth = $bDate[1];
-    $birthDay   = $bDate[2];
-    $year_diff  = date("Y") - $birthYear;
+    $birthDay = $bDate[2];
+    $year_diff = date("Y") - $birthYear;
 
     // don't calculate age CRM-3143
     if ($birthYear == '1902') {
@@ -889,12 +889,12 @@ class CRM_Utils_Date {
    */
   public static function intervalAdd($unit, $interval, $date, $dontCareTime = FALSE) {
     if (is_array($date)) {
-      $hour   = CRM_Utils_Array::value('H', $date);
+      $hour = CRM_Utils_Array::value('H', $date);
       $minute = CRM_Utils_Array::value('i', $date);
       $second = CRM_Utils_Array::value('s', $date);
-      $month  = CRM_Utils_Array::value('M', $date);
-      $day    = CRM_Utils_Array::value('d', $date);
-      $year   = CRM_Utils_Array::value('Y', $date);
+      $month = CRM_Utils_Array::value('M', $date);
+      $day = CRM_Utils_Array::value('d', $date);
+      $year = CRM_Utils_Array::value('Y', $date);
     }
     else {
       extract(date_parse($date));
@@ -925,7 +925,7 @@ class CRM_Utils_Date {
 
     $scheduleDate = explode("-", date("n-j-Y-H-i-s", $date));
 
-    $date      = array();
+    $date = array();
     $date['M'] = $scheduleDate[0];
     $date['d'] = $scheduleDate[1];
     $date['Y'] = $scheduleDate[2];
@@ -982,8 +982,8 @@ class CRM_Utils_Date {
    * @static
    */
   public static function relativeToAbsolute($relativeTerm, $unit) {
-    $now       = getdate();
-    $from      = $to = $dateRange = array();
+    $now = getdate();
+    $from = $to = $dateRange = array();
     $from['H'] = $from['i'] = $from['s'] = 0;
 
     switch ($unit) {
@@ -991,31 +991,31 @@ class CRM_Utils_Date {
         switch ($relativeTerm) {
           case 'this':
             $from['d'] = $from['M'] = 1;
-            $to['d']   = 31;
-            $to['M']   = 12;
-            $to['Y']   = $from['Y'] = $now['year'];
+            $to['d'] = 31;
+            $to['M'] = 12;
+            $to['Y'] = $from['Y'] = $now['year'];
             break;
 
           case 'previous':
             $from['M'] = $from['d'] = 1;
-            $to['d']   = 31;
-            $to['M']   = 12;
-            $to['Y']   = $from['Y'] = $now['year'] - 1;
+            $to['d'] = 31;
+            $to['M'] = 12;
+            $to['Y'] = $from['Y'] = $now['year'] - 1;
             break;
 
           case 'previous_before':
             $from['M'] = $from['d'] = 1;
-            $to['d']   = 31;
-            $to['M']   = 12;
-            $to['Y']   = $from['Y'] = $now['year'] - 2;
+            $to['d'] = 31;
+            $to['M'] = 12;
+            $to['Y'] = $from['Y'] = $now['year'] - 2;
             break;
 
           case 'previous_2':
             $from['M'] = $from['d'] = 1;
-            $to['d']   = 31;
-            $to['M']   = 12;
+            $to['d'] = 31;
+            $to['M'] = 12;
             $from['Y'] = $now['year'] - 2;
-            $to['Y']   = $now['year'] - 1;
+            $to['Y'] = $now['year'] - 1;
             break;
 
           case 'earlier':
@@ -1044,8 +1044,8 @@ class CRM_Utils_Date {
             $to['Y'] = $now['year'];
             $to['H'] = 23;
             $to['i'] = $to['s'] = 59;
-            $from    = self::intervalAdd('year', -1, $to);
-            $from    = self::intervalAdd('second', 1, $from);
+            $from = self::intervalAdd('year', -1, $to);
+            $from = self::intervalAdd('second', 1, $from);
             break;
 
           case 'current':
@@ -1064,8 +1064,8 @@ class CRM_Utils_Date {
             $to['Y'] = $now['year'];
             $to['H'] = 23;
             $to['i'] = $to['s'] = 59;
-            $from    = self::intervalAdd('year', -2, $to);
-            $from    = self::intervalAdd('second', 1, $from);
+            $from = self::intervalAdd('year', -2, $to);
+            $from = self::intervalAdd('second', 1, $from);
             break;
 
           case 'ending_3':
@@ -1074,22 +1074,22 @@ class CRM_Utils_Date {
             $to['Y'] = $now['year'];
             $to['H'] = 23;
             $to['i'] = $to['s'] = 59;
-            $from    = self::intervalAdd('year', -3, $to);
-            $from    = self::intervalAdd('second', 1, $from);
+            $from = self::intervalAdd('year', -3, $to);
+            $from = self::intervalAdd('second', 1, $from);
             break;
 
           case 'less':
-            $to['d']   = 31;
-            $to['M']   = 12;
-            $to['Y']   = $now['year'];
+            $to['d'] = 31;
+            $to['M'] = 12;
+            $to['Y'] = $now['year'];
             unset($from);
             break;
 
           case 'next':
             $from['M'] = $from['d'] = 1;
-            $to['d']   = 31;
-            $to['M']   = 12;
-            $to['Y']   = $from['Y'] = $now['year'] + 1;
+            $to['d'] = 31;
+            $to['M'] = 12;
+            $to['Y'] = $from['Y'] = $now['year'] + 1;
             break;
 
           case 'starting':
@@ -1104,15 +1104,15 @@ class CRM_Utils_Date {
         break;
 
       case 'fiscal_year':
-        $config    = CRM_Core_Config::singleton();
+        $config = CRM_Core_Config::singleton();
         $from['d'] = $config->fiscalYearStart['d'];
         $from['M'] = $config->fiscalYearStart['M'];
-        $fYear     = self::calculateFiscalYear($from['d'], $from['M']);
+        $fYear = self::calculateFiscalYear($from['d'], $from['M']);
         switch ($relativeTerm) {
           case 'this':
-            $from['Y']  = $fYear;
+            $from['Y'] = $fYear;
             $fiscalYear = mktime(0, 0, 0, $from['M'], $form['d'], $from['Y'] + 1);
-            $fiscalEnd  = explode('-', date("Y-m-d", $fiscalYear));
+            $fiscalEnd = explode('-', date("Y-m-d", $fiscalYear));
 
             $to['d'] = $fiscalEnd['2'];
             $to['M'] = $fiscalEnd['1'];
@@ -1120,18 +1120,18 @@ class CRM_Utils_Date {
             break;
 
           case 'previous':
-            $from['Y']  = $fYear - 1;
+            $from['Y'] = $fYear - 1;
             $fiscalYear = mktime(0, 0, 0, $from['M'], $form['d'], $from['Y'] + 1);
-            $fiscalEnd  = explode('-', date("Y-m-d", $fiscalYear));
+            $fiscalEnd = explode('-', date("Y-m-d", $fiscalYear));
             $to['d'] = $fiscalEnd['2'];
             $to['M'] = $fiscalEnd['1'];
             $to['Y'] = $fiscalEnd['0'];
             break;
 
           case 'next':
-            $from['Y']  = $fYear + 1;
+            $from['Y'] = $fYear + 1;
             $fiscalYear = mktime(0, 0, 0, $from['M'], $from['d'], $from['Y'] + 1);
-            $fiscalEnd  = explode('-', date("Y-m-d", $fiscalYear));
+            $fiscalEnd = explode('-', date("Y-m-d", $fiscalYear));
             $to['d'] = $fiscalEnd['2'];
             $to['M'] = $fiscalEnd['1'];
             $to['Y'] = $fiscalEnd['0'];
@@ -1143,18 +1143,18 @@ class CRM_Utils_Date {
         switch ($relativeTerm) {
           case 'this':
 
-            $quarter   = ceil($now['mon'] / 3);
+            $quarter = ceil($now['mon'] / 3);
             $from['d'] = 1;
             $from['M'] = (3 * $quarter) - 2;
-            $to['M']   = 3 * $quarter;
-            $to['Y']   = $from['Y'] = $now['year'];
-            $to['d']   = date('t', mktime(0, 0, 0, $to['M'], 1, $now['year']));
+            $to['M'] = 3 * $quarter;
+            $to['Y'] = $from['Y'] = $now['year'];
+            $to['d'] = date('t', mktime(0, 0, 0, $to['M'], 1, $now['year']));
             break;
 
           case 'previous':
-            $difference   = 1;
-            $quarter      = ceil($now['mon'] / 3);
-            $quarter      = $quarter - $difference;
+            $difference = 1;
+            $quarter = ceil($now['mon'] / 3);
+            $quarter = $quarter - $difference;
             $subtractYear = 0;
             if ($quarter <= 0) {
               $subtractYear = 1;
@@ -1162,15 +1162,15 @@ class CRM_Utils_Date {
             }
             $from['d'] = 1;
             $from['M'] = (3 * $quarter) - 2;
-            $to['M']   = 3 * $quarter;
-            $to['Y']   = $from['Y'] = $now['year'] - $subtractYear;
-            $to['d']   = date('t', mktime(0, 0, 0, $to['M'], 1, $to['Y']));
+            $to['M'] = 3 * $quarter;
+            $to['Y'] = $from['Y'] = $now['year'] - $subtractYear;
+            $to['d'] = date('t', mktime(0, 0, 0, $to['M'], 1, $to['Y']));
             break;
 
           case 'previous_before':
             $difference = 2;
-            $quarter    = ceil($now['mon'] / 3);
-            $quarter    = $quarter - $difference;
+            $quarter = ceil($now['mon'] / 3);
+            $quarter = $quarter - $difference;
             $subtractYear = 0;
             if ($quarter <= 0) {
               $subtractYear = 1;
@@ -1178,17 +1178,17 @@ class CRM_Utils_Date {
             }
             $from['d'] = 1;
             $from['M'] = (3 * $quarter) - 2;
-            $to['M']   = 3 * $quarter;
-            $to['Y']   = $from['Y'] = $now['year'] - $subtractYear;
-            $to['d']   = date('t', mktime(0, 0, 0, $to['M'], 1, $to['Y']));
+            $to['M'] = 3 * $quarter;
+            $to['Y'] = $from['Y'] = $now['year'] - $subtractYear;
+            $to['d'] = date('t', mktime(0, 0, 0, $to['M'], 1, $to['Y']));
             break;
 
           case 'previous_2':
-            $difference      = 2;
-            $quarter         = ceil($now['mon'] / 3);
+            $difference = 2;
+            $quarter = ceil($now['mon'] / 3);
             $current_quarter = $quarter;
-            $quarter         = $quarter - $difference;
-            $subtractYear    = 0;
+            $quarter = $quarter - $difference;
+            $subtractYear = 0;
             if ($quarter <= 0) {
               $subtractYear = 1;
               $quarter += 4;
@@ -1234,7 +1234,7 @@ class CRM_Utils_Date {
             break;
 
           case 'greater':
-            $quarter   = ceil($now['mon'] / 3);
+            $quarter = ceil($now['mon'] / 3);
             $from['d'] = 1;
             $from['M'] = (3 * $quarter) - 2;
             $from['Y'] = $now['year'];
@@ -1243,7 +1243,7 @@ class CRM_Utils_Date {
 
           case 'greater_previous':
             $quarter = ceil($now['mon'] / 3) - 1;
-            $subtractYear    = 0;
+            $subtractYear = 0;
             if ($quarter <= 0) {
               $subtractYear = 1;
               $quarter += 4;
@@ -1260,12 +1260,12 @@ class CRM_Utils_Date {
             $to['Y'] = $now['year'];
             $to['H'] = 23;
             $to['i'] = $to['s'] = 59;
-            $from    = self::intervalAdd('month', -3, $to);
-            $from    = self::intervalAdd('second', 1, $from);
+            $from = self::intervalAdd('month', -3, $to);
+            $from = self::intervalAdd('second', 1, $from);
             break;
 
           case 'current':
-            $quarter   = ceil($now['mon'] / 3);
+            $quarter = ceil($now['mon'] / 3);
             $from['d'] = 1;
             $from['M'] = (3 * $quarter) - 2;
             $from['Y'] = $now['year'];
@@ -1277,18 +1277,18 @@ class CRM_Utils_Date {
             break;
 
           case 'less':
-            $quarter   = ceil($now['mon'] / 3);
-            $to['M']   = 3 * $quarter;
-            $to['Y']   = $now['year'];
-            $to['d']   = date('t', mktime(0, 0, 0, $to['M'], 1, $now['year']));
+            $quarter = ceil($now['mon'] / 3);
+            $to['M'] = 3 * $quarter;
+            $to['Y'] = $now['year'];
+            $to['d'] = date('t', mktime(0, 0, 0, $to['M'], 1, $now['year']));
             unset($from);
             break;
 
           case 'next':
             $difference = -1;
             $subtractYear = 0;
-            $quarter    = ceil($now['mon'] / 3);
-            $quarter    = $quarter - $difference;
+            $quarter = ceil($now['mon'] / 3);
+            $quarter = $quarter - $difference;
             //CRM-14550 QA Fix
             if ($quarter > 4) {
               $now['year'] = $now['year'] + 1;
@@ -1300,9 +1300,9 @@ class CRM_Utils_Date {
             }
             $from['d'] = 1;
             $from['M'] = (3 * $quarter) - 2;
-            $to['M']   = 3 * $quarter;
-            $to['Y']   = $from['Y'] = $now['year'] - $subtractYear;
-            $to['d']   = date('t', mktime(0, 0, 0, $to['M'], 1, $to['Y']));
+            $to['M'] = 3 * $quarter;
+            $to['Y'] = $from['Y'] = $now['year'] - $subtractYear;
+            $to['d'] = date('t', mktime(0, 0, 0, $to['M'], 1, $to['Y']));
             break;
         }
         break;
@@ -1311,7 +1311,7 @@ class CRM_Utils_Date {
         switch ($relativeTerm) {
           case 'this':
             $from['d'] = 1;
-            $to['d']   = date('t', mktime(0, 0, 0, $now['mon'], 1, $now['year']));
+            $to['d'] = date('t', mktime(0, 0, 0, $now['mon'], 1, $now['year']));
             $from['M'] = $to['M'] = $now['mon'];
             $from['Y'] = $to['Y'] = $now['year'];
             break;
@@ -1408,8 +1408,8 @@ class CRM_Utils_Date {
             $to['Y'] = $now['year'];
             $to['H'] = 23;
             $to['i'] = $to['s'] = 59;
-            $from    = self::intervalAdd('month', -1, $to);
-            $from    = self::intervalAdd('second', 1, $from);
+            $from = self::intervalAdd('month', -1, $to);
+            $from = self::intervalAdd('second', 1, $from);
             break;
 
           case 'current':
@@ -1450,8 +1450,8 @@ class CRM_Utils_Date {
             $from['Y'] = $now['year'];
             $from['H'] = 00;
             $from['i'] = $to['s'] = 00;
-            $to    = self::intervalAdd('month', + 1, $from);
-            $to    = self::intervalAdd('second', -1, $to);
+            $to = self::intervalAdd('month', +1, $from);
+            $to = self::intervalAdd('second', -1, $to);
             break;
         }
         break;
@@ -1462,39 +1462,39 @@ class CRM_Utils_Date {
             $from['d'] = $now['mday'];
             $from['M'] = $now['mon'];
             $from['Y'] = $now['year'];
-            $from      = self::intervalAdd('day', -1 * ($now['wday']), $from);
-            $to        = self::intervalAdd('day', 6, $from);
+            $from = self::intervalAdd('day', -1 * ($now['wday']), $from);
+            $to = self::intervalAdd('day', 6, $from);
             break;
 
           case 'previous':
             $from['d'] = $now['mday'];
             $from['M'] = $now['mon'];
             $from['Y'] = $now['year'];
-            $from      = self::intervalAdd('day', -1 * ($now['wday']) - 7, $from);
-            $to        = self::intervalAdd('day', 6, $from);
+            $from = self::intervalAdd('day', -1 * ($now['wday']) - 7, $from);
+            $to = self::intervalAdd('day', 6, $from);
             break;
 
           case 'previous_before':
             $from['d'] = $now['mday'];
             $from['M'] = $now['mon'];
             $from['Y'] = $now['year'];
-            $from      = self::intervalAdd('day', -1 * ($now['wday']) - 14, $from);
-            $to        = self::intervalAdd('day', 6, $from);
+            $from = self::intervalAdd('day', -1 * ($now['wday']) - 14, $from);
+            $to = self::intervalAdd('day', 6, $from);
             break;
 
           case 'previous_2':
             $from['d'] = $now['mday'];
             $from['M'] = $now['mon'];
             $from['Y'] = $now['year'];
-            $from      = self::intervalAdd('day', -1 * ($now['wday']) - 14, $from);
-            $to        = self::intervalAdd('day', 13, $from);
+            $from = self::intervalAdd('day', -1 * ($now['wday']) - 14, $from);
+            $to = self::intervalAdd('day', 13, $from);
             break;
 
           case 'earlier':
             $to['d'] = $now['mday'];
             $to['M'] = $now['mon'];
             $to['Y'] = $now['year'];
-            $to      = self::intervalAdd('day', -1 * ($now['wday']) - 1, $to);
+            $to = self::intervalAdd('day', -1 * ($now['wday']) - 1, $to);
             unset($from);
             break;
 
@@ -1502,7 +1502,7 @@ class CRM_Utils_Date {
             $from['d'] = $now['mday'];
             $from['M'] = $now['mon'];
             $from['Y'] = $now['year'];
-            $from      = self::intervalAdd('day', -1 * ($now['wday']), $from);
+            $from = self::intervalAdd('day', -1 * ($now['wday']), $from);
             unset($to);
             break;
 
@@ -1510,7 +1510,7 @@ class CRM_Utils_Date {
             $from['d'] = $now['mday'];
             $from['M'] = $now['mon'];
             $from['Y'] = $now['year'];
-            $from     = self::intervalAdd('day', -1 * ($now['wday']) - 1, $from);
+            $from = self::intervalAdd('day', -1 * ($now['wday']) - 1, $from);
             unset($to);
             break;
 
@@ -1520,15 +1520,15 @@ class CRM_Utils_Date {
             $to['Y'] = $now['year'];
             $to['H'] = 23;
             $to['i'] = $to['s'] = 59;
-            $from    = self::intervalAdd('day', -7, $to);
-            $from    = self::intervalAdd('second', 1, $from);
+            $from = self::intervalAdd('day', -7, $to);
+            $from = self::intervalAdd('second', 1, $from);
             break;
 
           case 'current':
             $from['d'] = $now['mday'];
             $from['M'] = $now['mon'];
             $from['Y'] = $now['year'];
-            $from      = self::intervalAdd('day', -1 * ($now['wday']), $from);
+            $from = self::intervalAdd('day', -1 * ($now['wday']), $from);
             $to['d'] = $now['mday'];
             $to['M'] = $now['mon'];
             $to['Y'] = $now['year'];
@@ -1549,8 +1549,8 @@ class CRM_Utils_Date {
             $from['d'] = $now['mday'];
             $from['M'] = $now['mon'];
             $from['Y'] = $now['year'];
-            $from      = self::intervalAdd('day', -1 * ($now['wday']) + 7, $from);
-            $to        = self::intervalAdd('day', + 6, $from);
+            $from = self::intervalAdd('day', -1 * ($now['wday']) + 7, $from);
+            $to = self::intervalAdd('day', +6, $from);
             break;
 
           case 'starting':
@@ -1559,8 +1559,8 @@ class CRM_Utils_Date {
             $from['Y'] = $now['year'];
             $from['H'] = 00;
             $from['i'] = $to['s'] = 00;
-            $to        = self::intervalAdd('day', + 7, $from);
-            $to        = self::intervalAdd('second', -1, $to);
+            $to = self::intervalAdd('day', +7, $from);
+            $to = self::intervalAdd('second', -1, $to);
             break;
         }
         break;
@@ -1577,28 +1577,28 @@ class CRM_Utils_Date {
             $from['d'] = $now['mday'];
             $from['M'] = $now['mon'];
             $from['Y'] = $now['year'];
-            $from      = self::intervalAdd('day', -1, $from);
-            $to['d']   = $from['d'];
-            $to['M']   = $from['M'];
-            $to['Y']   = $from['Y'];
+            $from = self::intervalAdd('day', -1, $from);
+            $to['d'] = $from['d'];
+            $to['M'] = $from['M'];
+            $to['Y'] = $from['Y'];
             break;
 
           case 'previous_before':
             $from['d'] = $now['mday'];
             $from['M'] = $now['mon'];
             $from['Y'] = $now['year'];
-            $from      = self::intervalAdd('day', -2, $from);
-            $to['d']   = $from['d'];
-            $to['M']   = $from['M'];
-            $to['Y']   = $from['Y'];
+            $from = self::intervalAdd('day', -2, $from);
+            $to['d'] = $from['d'];
+            $to['M'] = $from['M'];
+            $to['Y'] = $from['Y'];
             break;
 
           case 'previous_2':
             $from['d'] = $to['d'] = $now['mday'];
             $from['M'] = $to['M'] = $now['mon'];
             $from['Y'] = $to['Y'] = $now['year'];
-            $from      = self::intervalAdd('day', -2, $from);
-            $to        = self::intervalAdd('day', -1, $to);
+            $from = self::intervalAdd('day', -2, $from);
+            $to = self::intervalAdd('day', -1, $to);
             break;
 
           case 'earlier':
@@ -1616,10 +1616,10 @@ class CRM_Utils_Date {
             break;
 
           case 'starting':
-            $to['d']   = $now['mday'];
-            $to['M']   = $now['mon'];
-            $to['Y']   = $now['year'];
-            $to        = self::intervalAdd('day', + 1, $to);
+            $to['d'] = $now['mday'];
+            $to['M'] = $now['mon'];
+            $to['Y'] = $now['year'];
+            $to = self::intervalAdd('day', +1, $to);
             $from['d'] = $to['d'];
             $from['M'] = $to['M'];
             $from['Y'] = $to['Y'];
@@ -1630,7 +1630,9 @@ class CRM_Utils_Date {
     }
 
     foreach (array(
-        'from', 'to') as $item) {
+               'from',
+               'to'
+             ) as $item) {
       if (!empty($$item)) {
         $dateRange[$item] = self::format($$item);
       }
@@ -1659,9 +1661,9 @@ class CRM_Utils_Date {
     $currentYear = date("Y");
 
     //recalculate the date because month 4::04 make the difference
-    $fiscalYear  = explode('-', date("Y-m-d", mktime(0, 0, 0, $fyMonth, $fyDate, $currentYear)));
-    $fyDate      = $fiscalYear[2];
-    $fyMonth     = $fiscalYear[1];
+    $fiscalYear = explode('-', date("Y-m-d", mktime(0, 0, 0, $fyMonth, $fyDate, $currentYear)));
+    $fyDate = $fiscalYear[2];
+    $fyMonth = $fiscalYear[1];
     $fyStartDate = date("Y-m-d", mktime(0, 0, 0, $fyMonth, $fyDate, $currentYear));
 
     if ($fyStartDate > $date) {
@@ -1786,7 +1788,7 @@ class CRM_Utils_Date {
     $format = NULL;
     if ($formatType) {
       $format = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_PreferencesDate',
-                $formatType, 'date_format', 'name'
+        $formatType, 'date_format', 'name'
       );
     }
 
index ebc41265eac0a4281393a76ab45db25581e32579..73a8859300bee90d388e4b1fe073a8fc41c3455f 100644 (file)
@@ -985,7 +985,12 @@ function _civicrm_api3_deprecated_add_formatted_location_blocks(&$values, &$para
   }
 
   foreach (array(
-    'Phone', 'Email', 'IM', 'OpenID', 'Phone_Ext') as $block) {
+             'Phone',
+             'Email',
+             'IM',
+             'OpenID',
+             'Phone_Ext'
+           ) as $block) {
     $name = strtolower($block);
     if (!array_key_exists($name, $values)) {
       continue;
@@ -1073,7 +1078,8 @@ function _civicrm_api3_deprecated_add_formatted_location_blocks(&$values, &$para
               foreach ($mulValues as $v1) {
                 foreach ($customOption as $v2) {
                   if ((strtolower($v2['label']) == strtolower(trim($v1))) ||
-                     (strtolower($v2['value']) == strtolower(trim($v1)))) {
+                    (strtolower($v2['value']) == strtolower(trim($v1)))
+                  ) {
                     if ($htmlType == 'CheckBox') {
                       $newValues[$key][$v2['value']] = 1;
                     }
@@ -1095,8 +1101,11 @@ function _civicrm_api3_deprecated_add_formatted_location_blocks(&$values, &$para
   _civicrm_api3_store_values($fields['Address'], $values, $params['address'][$addressCnt]);
 
   $addressFields = array(
-    'county', 'country', 'state_province',
-    'supplemental_address_1', 'supplemental_address_2',
+    'county',
+    'country',
+    'state_province',
+    'supplemental_address_1',
+    'supplemental_address_2',
     'StateProvince.name',
   );
 
@@ -1122,7 +1131,7 @@ function _civicrm_api3_deprecated_add_formatted_location_blocks(&$values, &$para
  * @param <type> $params
  *
  * @return array
  *   <type>
+ *   <type>
  */
 function _civicrm_api3_deprecated_duplicate_formatted_contact($params) {
   $id = CRM_Utils_Array::value('id', $params);
@@ -1305,7 +1314,7 @@ function _civicrm_api3_deprecated_participant_check_params($params, $checkDuplic
  *   Contact subtype if exists/passed.
  *
  * @return null
  *   on success, error message otherwise
+ *   on success, error message otherwise
  */
 function _civicrm_api3_deprecated_contact_check_custom_params($params, $csType = NULL) {
   empty($csType) ? $onlyParent = TRUE : $onlyParent = FALSE;
@@ -1477,7 +1486,7 @@ function _civicrm_api3_deprecated_contact_check_params(
  * @param int $activityTypeID
  *
  * @return array
  *   <type> $params
+ *   <type> $params
  */
 function _civicrm_api3_deprecated_activity_buildmailparams($result, $activityTypeID) {
   // get ready for collecting data about activity to be created
index 7ab45ff23dde5017301c820c36b4e763c7a1d3cc..fbd098235e3b167cb20bf2684d08910637a88e94 100644 (file)
@@ -331,11 +331,12 @@ class CRM_Utils_File {
       // allow html/htm extension ONLY if the user is admin
       // and/or has access CiviMail
       if (!(CRM_Core_Permission::check('access CiviMail') ||
-          CRM_Core_Permission::check('administer CiviCRM') ||
-          (CRM_Mailing_Info::workflowEnabled() &&
-            CRM_Core_Permission::check('create mailings')
-          )
-        )) {
+        CRM_Core_Permission::check('administer CiviCRM') ||
+        (CRM_Mailing_Info::workflowEnabled() &&
+          CRM_Core_Permission::check('create mailings')
+        )
+      )
+      ) {
         unset($extensions['html']);
         unset($extensions['htm']);
       }
@@ -380,8 +381,8 @@ class CRM_Utils_File {
    * @return string
    */
   public static function makeFileName($name) {
-    $uniqID   = md5(uniqid(rand(), TRUE));
-    $info     = pathinfo($name);
+    $uniqID = md5(uniqid(rand(), TRUE));
+    $info = pathinfo($name);
     $basename = substr($info['basename'],
       0, -(strlen(CRM_Utils_Array::value('extension', $info)) + (CRM_Utils_Array::value('extension', $info) == '' ? 0 : 1))
     );
@@ -403,7 +404,7 @@ class CRM_Utils_File {
    * @return array
    */
   public static function getFilesByExtension($path, $ext) {
-    $path  = self::addTrailingSlash($path);
+    $path = self::addTrailingSlash($path);
     $files = array();
     if ($dh = opendir($path)) {
       while (FALSE !== ($elem = readdir($dh))) {
index 8eddda2c8cae4e0165430918245e287c8bd32036..2a1eaca598162972ff4aa9d5247cda892edfefb9 100644 (file)
@@ -343,7 +343,7 @@ abstract class CRM_Utils_Hook {
    */
   public static function preProcess($formName, &$form) {
     return self::singleton()
-      ->invoke(2, $formName, $form, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,  'civicrm_preProcess');
+      ->invoke(2, $formName, $form, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_preProcess');
   }
 
   /**
index b5792e673ad4e95fcb7c972c3cf88f811690d4e6..e228b54f76134847b39536385681408c64b748ec 100644 (file)
@@ -70,8 +70,8 @@ class CRM_Utils_Hook_Joomla extends CRM_Utils_Hook {
    */
   function invoke(
     $numParams,
-                  &$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6,
-                  $fnSuffix
+    &$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6,
+    $fnSuffix
   ) {
     // ensure that we are running in a joomla context
     // we've not yet figured out how to bootstrap joomla, so we should
index 4ba46aa454abdd3fd39fe8e79a9a2b650e1464b8..74f91697d8fc5d37b6a3d74d0fc3004869f0f59a 100644 (file)
@@ -109,7 +109,7 @@ class CRM_Utils_Hook_WordPress extends CRM_Utils_Hook {
      */
 
     // distinguish between types of hook
-    if (! in_array($fnSuffix, $this->hooksThatReturn)) {
+    if (!in_array($fnSuffix, $this->hooksThatReturn)) {
 
       // only pass the arguments that have values
       $args = array_slice(
@@ -169,7 +169,6 @@ class CRM_Utils_Hook_WordPress extends CRM_Utils_Hook {
   }
 
 
-
   /**
    * Build the list of plugins ("modules" in CiviCRM terminology) to be processed for hooks.
    * We need to do this to preserve the CiviCRM hook signatures for hooks that require
@@ -221,5 +220,4 @@ class CRM_Utils_Hook_WordPress extends CRM_Utils_Hook {
   }
 
 
-
 }
index 565bed7cf8e753e3939e21b984196b3f5bf24a79..0fdbc7a01b87fefdf82c2461cebece0ecddb8190 100644 (file)
@@ -154,7 +154,7 @@ class CRM_Utils_JSON {
         $sOutput .= '"' . addcslashes(str_replace(array("\r\n", "\n", "\r"), '<br />', $value[$element]), '"\\') . '"';
 
         //remove extra spaces and tab character that breaks dataTable CRM-12551
-        $sOutput  = preg_replace("/\s+/", " ", $sOutput);
+        $sOutput = preg_replace("/\s+/", " ", $sOutput);
         $addcomma = TRUE;
       }
       $sOutput .= "],";
index b059c3b021a9ad590537949be0dda4685d866a8e..08dd2c39a3e4e81e78417b3096556535338689ae 100644 (file)
@@ -60,10 +60,10 @@ class CRM_Utils_Mail {
    *   true if a mail was sent, else false
    */
   public static function send(&$params) {
-    $returnPath       = CRM_Core_BAO_MailSettings::defaultReturnPath();
+    $returnPath = CRM_Core_BAO_MailSettings::defaultReturnPath();
     $includeMessageId = CRM_Core_BAO_MailSettings::includeMessageId();
-    $emailDomain      = CRM_Core_BAO_MailSettings::defaultDomain();
-    $from             = CRM_Utils_Array::value('from', $params);
+    $emailDomain = CRM_Core_BAO_MailSettings::defaultDomain();
+    $from = CRM_Utils_Array::value('from', $params);
     if (!$returnPath) {
       $returnPath = self::pluckEmailFromHeader($from);
     }
@@ -86,13 +86,13 @@ class CRM_Utils_Mail {
       $htmlMessage = FALSE;
     }
 
-    $headers         = array();
+    $headers = array();
     // CRM-10699 support custom email headers
     if (!empty($params['headers'])) {
       $headers = array_merge($headers, $params['headers']);
     }
     $headers['From'] = $params['from'];
-    $headers['To']   =
+    $headers['To'] =
       self::formatRFC822Email(
         CRM_Utils_Array::value('toName', $params),
         CRM_Utils_Array::value('toEmail', $params),
@@ -201,7 +201,8 @@ class CRM_Utils_Mail {
    */
   public static function errorMessage($mailer, $result) {
     $message = '<p>' . ts('An error occurred when CiviCRM attempted to send an email (via %1). If you received this error after submitting on online contribution or event registration - the transaction was completed, but we were unable to send the email receipt.', array(
-      1 => 'SMTP')) . '</p>' . '<p>' . ts('The mail library returned the following error message:') . '<br /><span class="font-red"><strong>' . $result->getMessage() . '</strong></span></p>' . '<p>' . ts('This is probably related to a problem in your Outbound Email Settings (Administer CiviCRM &raquo; System Settings &raquo; Outbound Email), OR the FROM email address specifically configured for your contribution page or event. Possible causes are:') . '</p>';
+        1 => 'SMTP'
+      )) . '</p>' . '<p>' . ts('The mail library returned the following error message:') . '<br /><span class="font-red"><strong>' . $result->getMessage() . '</strong></span></p>' . '<p>' . ts('This is probably related to a problem in your Outbound Email Settings (Administer CiviCRM &raquo; System Settings &raquo; Outbound Email), OR the FROM email address specifically configured for your contribution page or event. Possible causes are:') . '</p>';
 
     if (is_a($mailer, 'Mail_smtp')) {
       $message .= '<ul>' . '<li>' . ts('Your SMTP Username or Password are incorrect.') . '</li>' . '<li>' . ts('Your SMTP Server (machine) name is incorrect.') . '</li>' . '<li>' . ts('You need to use a Port other than the default port 25 in your environment.') . '</li>' . '<li>' . ts('Your SMTP server is just not responding right now (it is down for some reason).') . '</li>';
@@ -211,7 +212,8 @@ class CRM_Utils_Mail {
     }
 
     $message .= '<li>' . ts('The FROM Email Address configured for this feature may not be a valid sender based on your email service provider rules.') . '</li>' . '</ul>' . '<p>' . ts('Check <a href="%1">this page</a> for more information.', array(
-      1 => CRM_Utils_System::docURL2('user/advanced-configuration/email-system-configuration', TRUE))) . '</p>';
+        1 => CRM_Utils_System::docURL2('user/advanced-configuration/email-system-configuration', TRUE)
+      )) . '</p>';
 
     return $message;
   }
@@ -408,9 +410,9 @@ class CRM_Utils_Mail {
     $html = preg_replace('/(<html)(.+?xmlns=["\'].[^\s]+["\'])(.+)?(>)/', '\1\3\4', $html);
 
     file_put_contents($pdf_filename, CRM_Utils_PDF_Utils::html2pdf($html,
-      $fileName,
-      TRUE,
-      $format)
+        $fileName,
+        TRUE,
+        $format)
     );
     return array(
       'fullPath' => $pdf_filename,
index 0be9b28051509b4a71286a252b84b22f93d43635..d13d2e1461fa2b43beab80df8dd5aacd3ceff332 100644 (file)
@@ -51,8 +51,8 @@ class CRM_Utils_Mail_EmailProcessor {
    *                 fix this to return true on success / false on failure etc
    */
   public static function processBounces() {
-    $dao             = new CRM_Core_DAO_MailSettings;
-    $dao->domain_id  = CRM_Core_Config::domainID();
+    $dao = new CRM_Core_DAO_MailSettings;
+    $dao->domain_id = CRM_Core_Config::domainID();
     $dao->is_default = TRUE;
     $dao->find();
 
@@ -101,8 +101,8 @@ class CRM_Utils_Mail_EmailProcessor {
    * @return void
    */
   public static function processActivities() {
-    $dao             = new CRM_Core_DAO_MailSettings;
-    $dao->domain_id  = CRM_Core_Config::domainID();
+    $dao = new CRM_Core_DAO_MailSettings;
+    $dao->domain_id = CRM_Core_Config::domainID();
     $dao->is_default = FALSE;
     $dao->find();
     $found = FALSE;
@@ -146,19 +146,19 @@ class CRM_Utils_Mail_EmailProcessor {
     $emailActivityTypeId =
       (defined('EMAIL_ACTIVITY_TYPE_ID') && EMAIL_ACTIVITY_TYPE_ID) ? EMAIL_ACTIVITY_TYPE_ID : CRM_Core_OptionGroup::getValue(
         'activity_type',
-      'Inbound Email',
-      'name'
-    );
+        'Inbound Email',
+        'name'
+      );
 
     if (!$emailActivityTypeId) {
       CRM_Core_Error::fatal(ts('Could not find a valid Activity Type ID for Inbound Email'));
     }
 
-    $config            = CRM_Core_Config::singleton();
-    $verpSeperator     = preg_quote($config->verpSeparator);
+    $config = CRM_Core_Config::singleton();
+    $verpSeperator = preg_quote($config->verpSeparator);
     $twoDigitStringMin = $verpSeperator . '(\d+)' . $verpSeperator . '(\d+)';
-    $twoDigitString    = $twoDigitStringMin . $verpSeperator;
-    $threeDigitString  = $twoDigitString . '(\d+)' . $verpSeperator;
+    $twoDigitString = $twoDigitStringMin . $verpSeperator;
+    $threeDigitString = $twoDigitString . '(\d+)' . $verpSeperator;
 
     // FIXME: legacy regexen to handle CiviCRM 2.1 address patterns, with domain id and possible VERP part
     $commonRegex = '/^' . preg_quote($dao->localpart) . '(b|bounce|c|confirm|o|optOut|r|reply|re|e|resubscribe|u|unsubscribe)' . $threeDigitString . '([0-9a-f]{16})(-.*)?@' . preg_quote($dao->domain) . '$/';
@@ -177,7 +177,7 @@ class CRM_Utils_Mail_EmailProcessor {
     try {
       $store = CRM_Mailing_MailStore::getStore($dao->name);
     }
-    catch(Exception$e) {
+    catch (Exception$e) {
       $message = ts('Could not connect to MailStore for ') . $dao->username . '@' . $dao->server . '<p>';
       $message .= ts('Error message: ');
       $message .= '<pre>' . $e->getMessage() . '</pre><p>';
index ac8f7eeaad578999a6fe4179a9c8bc70a1dfcbb3..320899b9762a82ebe2ede8a3e97ba82be9369f79 100644 (file)
@@ -280,22 +280,22 @@ class CRM_Utils_Mail_Incoming {
       !trim(file_get_contents($file))
     ) {
       return CRM_Core_Error::createAPIError(ts('%1 does not exists or is empty',
-          array(1 => $file)
-        ));
+        array(1 => $file)
+      ));
     }
 
     require_once 'ezc/Base/src/ezc_bootstrap.php';
     require_once 'ezc/autoload/mail_autoload.php';
 
     // explode email to digestable format
-    $set    = new ezcMailFileSet(array($file));
+    $set = new ezcMailFileSet(array($file));
     $parser = new ezcMailParser();
-    $mail   = $parser->parseMail($set);
+    $mail = $parser->parseMail($set);
 
     if (!$mail) {
       return CRM_Core_Error::createAPIError(ts('%1 could not be parsed',
-          array(1 => $file)
-        ));
+        array(1 => $file)
+      ));
     }
 
     // since we only have one fileset
@@ -347,9 +347,9 @@ class CRM_Utils_Mail_Incoming {
       $config = CRM_Core_Config::singleton();
       for ($i = 0; $i < count($attachments); $i++) {
         $attachNum = $i + 1;
-        $fileName  = basename($attachments[$i]['fullName']);
-        $newName   = CRM_Utils_File::makeFileName($fileName);
-        $location  = $config->uploadDir . $newName;
+        $fileName = basename($attachments[$i]['fullName']);
+        $newName = CRM_Utils_File::makeFileName($fileName);
+        $location = $config->uploadDir . $newName;
 
         // move file to the civicrm upload directory
         rename($attachments[$i]['fullName'], $location);
index 3a0049fbd16c6e272d1f4cbe123eecbc3bb16a58..2694c092f2e7fb18bc9e0e1b6d12ed3104f30f01 100644 (file)
@@ -465,7 +465,7 @@ class CRM_Utils_Migrate_Export {
    * @return array
    */
   public function exportDAO($objectName, $object, $mappedFields) {
-    $dbFields = & $object->fields();
+    $dbFields = &$object->fields();
 
     // Filter the list of keys and values so that we only export interesting stuff
     $keyValues = array();
@@ -477,7 +477,15 @@ class CRM_Utils_Migrate_Export {
       if (isset($object->$name) && $object->$name !== NULL) {
         // hack for extends_entity_column_value
         if ($name == 'extends_entity_column_value') {
-          if (in_array($object->extends, array('Event', 'Activity', 'Relationship', 'Individual', 'Organization', 'Household', 'Case'))) {
+          if (in_array($object->extends, array(
+              'Event',
+              'Activity',
+              'Relationship',
+              'Individual',
+              'Organization',
+              'Household',
+              'Case'
+            ))) {
             if ($object->extends == 'Event') {
               $key = 'event_type';
             }
@@ -487,7 +495,7 @@ class CRM_Utils_Migrate_Export {
             elseif ($object->extends == 'Relationship') {
               $key = 'relationship_type';
             }
-            elseif($object->extends == 'Case') {
+            elseif ($object->extends == 'Case') {
               $key = 'case_type';
             }
             $types = explode(CRM_Core_DAO::VALUE_SEPARATOR, substr($object->$name, 1, -1));
index 8388c61e6f76370e70902e8339d6405c31d7dff2..3ecec2efd49bcab8725802839ae5b838bcfaebcb 100644 (file)
@@ -142,7 +142,7 @@ class CRM_Utils_Migrate_ExportJSON {
    */
   public function auxTable($tables) {
     foreach ($tables as $tableName => $daoName) {
-      $fields = & $this->dbFields($daoName, TRUE);
+      $fields = &$this->dbFields($daoName, TRUE);
 
       $sql = "SELECT * from $tableName";
       $this->sql($sql, $tableName, $fields);
@@ -165,7 +165,7 @@ SELECT *
 FROM   civicrm_option_group
 WHERE  name IN ( $nameString )
 ";
-    $fields = & $this->dbFields('CRM_Core_DAO_OptionGroup', TRUE);
+    $fields = &$this->dbFields('CRM_Core_DAO_OptionGroup', TRUE);
     $this->sql($sql, 'civicrm_option_group', $fields);
 
     $sql = "
@@ -174,7 +174,7 @@ FROM       civicrm_option_value v
 INNER JOIN civicrm_option_group g ON v.option_group_id = g.id
 WHERE      g.name IN ( $nameString )
 ";
-    $fields = & $this->dbFields('CRM_Core_DAO_OptionValue', TRUE);
+    $fields = &$this->dbFields('CRM_Core_DAO_OptionValue', TRUE);
     $this->sql($sql, 'civicrm_option_value', $fields);
   }
 
@@ -217,7 +217,7 @@ SELECT *
    * @param $fields
    */
   public function sql($sql, $tableName, &$fields) {
-    $dao = & CRM_Core_DAO::executeQuery($sql);
+    $dao = &CRM_Core_DAO::executeQuery($sql);
 
     while ($dao->fetch()) {
       $value = array();
@@ -238,7 +238,7 @@ SELECT *
    * @param $contactIDs
    */
   public function contact(&$contactIDs) {
-    $fields = & $this->dbFields('CRM_Contact_DAO_Contact', TRUE);
+    $fields = &$this->dbFields('CRM_Contact_DAO_Contact', TRUE);
     $this->table($contactIDs, 'civicrm_contact', $fields, 'id', NULL);
   }
 
@@ -246,7 +246,7 @@ SELECT *
    * @param $contactIDs
    */
   public function note(&$contactIDs) {
-    $fields = & $this->dbFields('CRM_Core_DAO_Note', TRUE);
+    $fields = &$this->dbFields('CRM_Core_DAO_Note', TRUE);
     $this->table($contactIDs, 'civicrm_note', $fields, 'entity_id', "entity_table = 'civicrm_contact'");
   }
 
@@ -254,7 +254,7 @@ SELECT *
    * @param $contactIDs
    */
   public function phone(&$contactIDs) {
-    $fields = & $this->dbFields('CRM_Core_DAO_Phone', TRUE);
+    $fields = &$this->dbFields('CRM_Core_DAO_Phone', TRUE);
     $this->table($contactIDs, 'civicrm_phone', $fields, 'contact_id', NULL);
   }
 
@@ -262,7 +262,7 @@ SELECT *
    * @param $contactIDs
    */
   public function email(&$contactIDs) {
-    $fields = & $this->dbFields('CRM_Core_DAO_Email', TRUE);
+    $fields = &$this->dbFields('CRM_Core_DAO_Email', TRUE);
     $this->table($contactIDs, 'civicrm_email', $fields, 'contact_id', NULL);
   }
 
@@ -270,7 +270,7 @@ SELECT *
    * @param $contactIDs
    */
   public function im(&$contactIDs) {
-    $fields = & $this->dbFields('CRM_Core_DAO_IM', TRUE);
+    $fields = &$this->dbFields('CRM_Core_DAO_IM', TRUE);
     $this->table($contactIDs, 'civicrm_im', $fields, 'contact_id', NULL);
   }
 
@@ -278,7 +278,7 @@ SELECT *
    * @param $contactIDs
    */
   public function website(&$contactIDs) {
-    $fields = & $this->dbFields('CRM_Core_DAO_Website', TRUE);
+    $fields = &$this->dbFields('CRM_Core_DAO_Website', TRUE);
     $this->table($contactIDs, 'civicrm_website', $fields, 'contact_id', NULL);
   }
 
@@ -286,7 +286,7 @@ SELECT *
    * @param $contactIDs
    */
   public function address(&$contactIDs) {
-    $fields = & $this->dbFields('CRM_Core_DAO_Email', TRUE);
+    $fields = &$this->dbFields('CRM_Core_DAO_Email', TRUE);
     $this->table($contactIDs, 'civicrm_address', $fields, 'contact_id', NULL);
   }
 
@@ -294,7 +294,7 @@ SELECT *
    * @param $contactIDs
    */
   public function groupContact(&$contactIDs) {
-    $fields = & $this->dbFields('CRM_Contact_DAO_GroupContact', TRUE);
+    $fields = &$this->dbFields('CRM_Contact_DAO_GroupContact', TRUE);
     $this->table($contactIDs, 'civicrm_group_contact', $fields, 'contact_id', NULL);
   }
 
@@ -323,7 +323,7 @@ WHERE  contact_id IN ( $ids )
       }
     }
 
-    $fields = & $this->dbFields('CRM_Contact_DAO_Group', TRUE);
+    $fields = &$this->dbFields('CRM_Contact_DAO_Group', TRUE);
     $this->table($groupIDs, 'civicrm_group', $fields, 'id');
 
     $this->savedSearch($groupIDs);
@@ -346,7 +346,7 @@ INNER JOIN civicrm_group g on g.saved_search_id = s.id
 WHERE      g.id IN ( $idString )
 ";
 
-    $fields = & $this->dbFields('CRM_Contact_DAO_SavedSearch', TRUE);
+    $fields = &$this->dbFields('CRM_Contact_DAO_SavedSearch', TRUE);
     $this->sql($sql, 'civicrm_saved_search', $fields);
   }
 
@@ -354,7 +354,7 @@ WHERE      g.id IN ( $idString )
    * @param $contactIDs
    */
   public function entityTag(&$contactIDs) {
-    $fields = & $this->dbFields('CRM_Core_DAO_EntityTag', TRUE);
+    $fields = &$this->dbFields('CRM_Core_DAO_EntityTag', TRUE);
     $this->table($contactIDs, 'civicrm_entity_tag', $fields, 'entity_id', "entity_table = 'civicrm_contact'");
   }
 
@@ -382,7 +382,7 @@ AND    entity_table = 'civicrm_contact'
       }
     }
 
-    $fields = & $this->dbFields('CRM_Core_DAO_Tag', TRUE);
+    $fields = &$this->dbFields('CRM_Core_DAO_Tag', TRUE);
     $this->table($tagIDs, 'civicrm_tag', $fields, 'id');
   }
 
@@ -408,7 +408,7 @@ AND    entity_table = 'civicrm_contact'
 ";
 
     $fields = $this->dbFields('CRM_Contact_DAO_Relationship', TRUE);
-    $dao = & CRM_Core_DAO::executeQuery($sql);
+    $dao = &CRM_Core_DAO::executeQuery($sql);
     while ($dao->fetch()) {
       if (isset($_relationshipsHandled[$dao->id])) {
         continue;
@@ -456,9 +456,9 @@ WHERE ac.contact_id IN ( $ids )
   AND (a.activity_type_id != 3 AND a.activity_type_id != 20)
 ";
 
-    $fields = & $this->dbFields('CRM_Activity_DAO_Activity', TRUE);
+    $fields = &$this->dbFields('CRM_Activity_DAO_Activity', TRUE);
 
-    $dao = & CRM_Core_DAO::executeQuery($sql);
+    $dao = &CRM_Core_DAO::executeQuery($sql);
     while ($dao->fetch()) {
       // adding source, target and assignee contacts in additional contacts array
       $this->addAdditionalContacts(array($dao->contact_id),
@@ -524,12 +524,12 @@ WHERE ac.contact_id IN ( $ids )
     if (!isset($_fieldsRetrieved[$daoName])) {
       $_fieldsRetrieved[$daoName] = array();
       $daoFile = str_replace('_',
-        DIRECTORY_SEPARATOR,
-        $daoName
-      ) . '.php';
+          DIRECTORY_SEPARATOR,
+          $daoName
+        ) . '.php';
       include_once $daoFile;
 
-      $daoFields = & $daoName::fields();
+      $daoFields = &$daoName::fields();
 
       foreach ($daoFields as $key => & $value) {
         $_fieldsRetrieved[$daoName][$value['name']] = array(
@@ -571,7 +571,7 @@ WHERE ac.contact_id IN ( $ids )
    * @param $contactIDs
    */
   public function export(&$contactIDs) {
-    $chunks = & $this->splitContactIDs($contactIDs);
+    $chunks = &$this->splitContactIDs($contactIDs);
 
     $additionalContactIDs = array();
 
index 76e0bfd3d335b91ba62a49369b64142afa224d54..4b7b327cf87caafd78c1cf0a26517644eb1b23db 100644 (file)
@@ -49,7 +49,7 @@ class CRM_Utils_Migrate_Import {
   public function run($file) {
     // read xml file
     $dom = new DomDocument();
-    if (! $dom->load($file)) {
+    if (!$dom->load($file)) {
       throw new CRM_Core_Exception("Failed to parse XML file \"$file\"");
     }
     $dom->xinclude();
@@ -117,7 +117,7 @@ class CRM_Utils_Migrate_Import {
       }
     }
 
-    $fields = & $dao->fields();
+    $fields = &$dao->fields();
     foreach ($fields as $name => $dontCare) {
       if (isset($xml->$name)) {
         $value = (string ) $xml->$name;
@@ -223,7 +223,8 @@ WHERE      v.option_group_id = %1
 
         // fix extends stuff if it exists
         if (isset($customGroupXML->extends_entity_column_value_option_group) &&
-          isset($customGroupXML->extends_entity_column_value)) {
+          isset($customGroupXML->extends_entity_column_value)
+        ) {
           $valueIDs = array();
           $optionValues = explode(",", $customGroupXML->extends_entity_column_value);
           $optValues = implode("','", $optionValues);
@@ -251,7 +252,7 @@ AND        v.name IN ('$optValues')
                   'String',
                 ),
               );
-              $dao = & CRM_Core_DAO::executeQuery($sql, $params);
+              $dao = &CRM_Core_DAO::executeQuery($sql, $params);
 
               while ($dao->fetch()) {
                 $valueIDs[] = $dao->value;
@@ -259,8 +260,8 @@ AND        v.name IN ('$optValues')
             }
             if (!empty($valueIDs)) {
               $customGroup->extends_entity_column_value = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,
-                $valueIDs
-              ) . CRM_Core_DAO::VALUE_SEPARATOR;
+                  $valueIDs
+                ) . CRM_Core_DAO::VALUE_SEPARATOR;
 
               unset($valueIDs);
 
@@ -312,8 +313,8 @@ AND        v.name = %1
 
             if (is_array($optionIDs) && !empty($optionIDs)) {
               $customGroup->extends_entity_column_value = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,
-                array_keys($optionIDs)
-              ) . CRM_Core_DAO::VALUE_SEPARATOR;
+                  array_keys($optionIDs)
+                ) . CRM_Core_DAO::VALUE_SEPARATOR;
 
               $saveAgain = TRUE;
             }
@@ -443,12 +444,12 @@ AND        f.column_name = %2
           $cfID = CRM_Core_DAO::singleValueQuery($sql, $params);
           if (!$cfID) {
             CRM_Core_Error::fatal(ts("Could not find custom field for %1, %2, %3",
-              array(
-                1 => $profileField->field_name,
-                2 => $tableName,
-                3 => $columnName,
-              )
-            ) . "<br />");
+                array(
+                  1 => $profileField->field_name,
+                  2 => $tableName,
+                  3 => $columnName,
+                )
+              ) . "<br />");
           }
           $profileField->field_name = "custom_{$cfID}";
         }
index c0af031fb5656ae6789f5860bbdbd1e793c11d0b..943d1871eb88ad0a3757de25d53dbf9e7ff30e17 100644 (file)
@@ -208,7 +208,7 @@ class CRM_Utils_Migrate_ImportJSON {
    * @param null $dateFields
    */
   public function restore(&$chunk, $daoName, $lookUpMapping = NULL, $dateFields = NULL) {
-    $object   = new $daoName();
+    $object = new $daoName();
     $tableName = $object->__table;
 
     if (is_array($lookUpMapping)) {
@@ -226,7 +226,7 @@ class CRM_Utils_Migrate_ImportJSON {
     $columns = $chunk[0];
     foreach ($chunk as $key => $value) {
       if ($key) {
-        $object   = new $daoName();
+        $object = new $daoName();
         foreach ($columns as $k => $column) {
           if ($column == 'id') {
             $childID = $value[$k];
index 03e7aa813dc9775b9117bfc92587cb91b4f5c2c8..328aa230b2434385df572e1d2d4d949d748e4624 100644 (file)
@@ -89,7 +89,10 @@ class CRM_Utils_Money {
     }
 
     if (!self::$_currencySymbols) {
-      self::$_currencySymbols = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', array('keyColumn' => 'name', 'labelColumn' => 'symbol'));
+      self::$_currencySymbols = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', array(
+          'keyColumn' => 'name',
+          'labelColumn' => 'symbol'
+        ));
     }
 
     if (!$currency) {
index 6d6f87bdad6542818cce3750643d458c675da08b..7e7049237cc40799136ad79ea6d7ff7e6a33af06 100644 (file)
@@ -46,9 +46,18 @@ class CRM_Utils_OpenFlashChart {
    * @static
    */
   private static $_colours = array(
-    "#C3CC38", "#C8B935", "#CEA632", "#D3932F",
-    "#D9802C", "#FA6900", "#DC9B57", "#F78F01",
-    "#5AB56E", "#6F8069", "#C92200", "#EB6C5C",
+    "#C3CC38",
+    "#C8B935",
+    "#CEA632",
+    "#D3932F",
+    "#D9802C",
+    "#FA6900",
+    "#DC9B57",
+    "#F78F01",
+    "#5AB56E",
+    "#6F8069",
+    "#C92200",
+    "#EB6C5C",
   );
 
   /**
@@ -127,7 +136,7 @@ class CRM_Utils_OpenFlashChart {
     $xLabels = new x_axis_labels();
     // set_labels function requires xValues array of string or x_axis_label
     // so type casting array values to string values
-    array_walk($xValues, function(&$value, $index) {
+    array_walk($xValues, function (&$value, $index) {
       $value = (string) $value;
     });
     $xLabels->set_labels($xValues);
@@ -468,7 +477,10 @@ class CRM_Utils_OpenFlashChart {
 
     // carry some chart params if pass.
     foreach (array(
-      'xSize', 'ySize', 'divName') as $f) {
+               'xSize',
+               'ySize',
+               'divName'
+             ) as $f) {
       if (!empty($rows[$f])) {
         $chartData[$f] = $rows[$f];
       }
@@ -505,7 +517,10 @@ class CRM_Utils_OpenFlashChart {
 
     // carry some chart params if pass.
     foreach (array(
-      'xSize', 'ySize', 'divName') as $f) {
+               'xSize',
+               'ySize',
+               'divName'
+             ) as $f) {
       if (!empty($rows[$f])) {
         $chartData[$f] = $rows[$f];
       }
index 0f5ac5b1dac3b2508088513ad8bebcdff01aa662..b60466e4d2fcd518624b760b313d17af43d9edc1 100644 (file)
@@ -59,19 +59,19 @@ class CRM_Utils_PDF_Utils {
       // PDF Page Format ID passed in
       $format = CRM_Core_BAO_PdfFormat::getById($pdfFormat);
     }
-    $paperSize    = CRM_Core_BAO_PaperSize::getByName($format['paper_size']);
-    $paper_width  = self::convertMetric($paperSize['width'], $paperSize['metric'], 'pt');
+    $paperSize = CRM_Core_BAO_PaperSize::getByName($format['paper_size']);
+    $paper_width = self::convertMetric($paperSize['width'], $paperSize['metric'], 'pt');
     $paper_height = self::convertMetric($paperSize['height'], $paperSize['metric'], 'pt');
     // dompdf requires dimensions in points
-    $paper_size  = array(0, 0, $paper_width, $paper_height);
+    $paper_size = array(0, 0, $paper_width, $paper_height);
     $orientation = CRM_Core_BAO_PdfFormat::getValue('orientation', $format);
-    $metric      = CRM_Core_BAO_PdfFormat::getValue('metric', $format);
-    $t           = CRM_Core_BAO_PdfFormat::getValue('margin_top', $format);
-    $r           = CRM_Core_BAO_PdfFormat::getValue('margin_right', $format);
-    $b           = CRM_Core_BAO_PdfFormat::getValue('margin_bottom', $format);
-    $l           = CRM_Core_BAO_PdfFormat::getValue('margin_left', $format);
+    $metric = CRM_Core_BAO_PdfFormat::getValue('metric', $format);
+    $t = CRM_Core_BAO_PdfFormat::getValue('margin_top', $format);
+    $r = CRM_Core_BAO_PdfFormat::getValue('margin_right', $format);
+    $b = CRM_Core_BAO_PdfFormat::getValue('margin_bottom', $format);
+    $l = CRM_Core_BAO_PdfFormat::getValue('margin_left', $format);
 
-    $stationery_path_partial  = CRM_Core_BAO_PdfFormat::getValue('stationery', $format);
+    $stationery_path_partial = CRM_Core_BAO_PdfFormat::getValue('stationery', $format);
 
     $stationery_path = NULL;
     if (strlen($stationery_path_partial)) {
@@ -79,7 +79,7 @@ class CRM_Utils_PDF_Utils {
       $stationery_path = $doc_root . "/" . $stationery_path_partial;
     }
 
-    $margins     = array($metric, $t, $r, $b, $l);
+    $margins = array($metric, $t, $r, $b, $l);
 
     $config = CRM_Core_Config::singleton();
     $html = "
@@ -131,7 +131,7 @@ class CRM_Utils_PDF_Utils {
     require_once 'tcpdf/tcpdf.php';
     require_once 'FPDI/fpdi.php'; // This library is only in the 'packages' area as of version 4.5
 
-    $paper_size_arr  = array($paper_size[2], $paper_size[3]);
+    $paper_size_arr = array($paper_size[2], $paper_size[3]);
 
     $pdf = new TCPDF($orientation, 'pt', $paper_size_arr);
     $pdf->Open();
@@ -396,13 +396,13 @@ class CRM_Utils_PDF_Utils {
         return $buf;
       }
     }
-    catch(PDFlibException$excp) {
+    catch (PDFlibException$excp) {
       CRM_Core_Error::statusBounce('PDFlib Error: Exception' .
         "[" . $excp->get_errnum() . "] " . $excp->get_apiname() . ": " .
         $excp->get_errmsg()
       );
     }
-    catch(Exception$excp) {
+    catch (Exception$excp) {
       CRM_Core_Error::statusBounce("PDFlib Error: " . $excp->get_errmsg());
     }
   }
index 2aee44bd81b48ed765b7baf28fb3497937b093e8..d69f822d461d5bccdb22e2f890a54ba736baa81f 100644 (file)
@@ -125,8 +125,14 @@ class CRM_Utils_Pager extends Pager_Sliding {
      * page variable, but a different form element for one at the bottom
      *
      */
-    $this->_response['titleTop'] = ts('Page %1 of %2', array(1 => '<input size="2" maxlength="3" name="' . self::PAGE_ID . '" type="text" value="' . $this->_response['currentPage'] . '" />', 2 => $this->_response['numPages']));
-    $this->_response['titleBottom'] = ts('Page %1 of %2', array(1 => '<input size="2" maxlength="3" name="' . self::PAGE_ID_BOTTOM . '" type="text" value="' . $this->_response['currentPage'] . '" />', 2 => $this->_response['numPages']));
+    $this->_response['titleTop'] = ts('Page %1 of %2', array(
+        1 => '<input size="2" maxlength="3" name="' . self::PAGE_ID . '" type="text" value="' . $this->_response['currentPage'] . '" />',
+        2 => $this->_response['numPages']
+      ));
+    $this->_response['titleBottom'] = ts('Page %1 of %2', array(
+        1 => '<input size="2" maxlength="3" name="' . self::PAGE_ID_BOTTOM . '" type="text" value="' . $this->_response['currentPage'] . '" />',
+        2 => $this->_response['numPages']
+      ));
   }
 
   /**
@@ -281,7 +287,7 @@ class CRM_Utils_Pager extends Pager_Sliding {
     }
     $href = $this->makeURL(self::PAGE_ID, 1);
     return $this->formatLink($href, str_replace('%d', 1, $this->_altFirst), $this->_firstPagePre . $this->_firstPageText . $this->_firstPagePost) .
-      $this->_spacesBefore . $this->_spacesAfter;
+    $this->_spacesBefore . $this->_spacesAfter;
   }
 
   /**
@@ -313,8 +319,8 @@ class CRM_Utils_Pager extends Pager_Sliding {
     if ($this->_currentPage < $this->_totalPages) {
       $href = $this->makeURL(self::PAGE_ID, $this->getNextPageID());
       return $this->_spacesAfter .
-        $this->formatLink($href, $this->_altNext, $this->_nextImg) .
-        $this->_spacesBefore . $this->_spacesAfter;
+      $this->formatLink($href, $this->_altNext, $this->_nextImg) .
+      $this->_spacesBefore . $this->_spacesAfter;
     }
     return '';
   }
index 7b81d6eb0646ceb373b30740b253f308eb02dcbc..ddbf0ed84941c57da76befb2d4ef5bba4ff72d1e 100644 (file)
@@ -66,7 +66,34 @@ class CRM_Utils_PagerAToZ {
    * @static
    */
   public static function getStaticCharacters() {
-    $staticAlphabets = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');
+    $staticAlphabets = array(
+      'A',
+      'B',
+      'C',
+      'D',
+      'E',
+      'F',
+      'G',
+      'H',
+      'I',
+      'J',
+      'K',
+      'L',
+      'M',
+      'N',
+      'O',
+      'P',
+      'Q',
+      'R',
+      'S',
+      'T',
+      'U',
+      'V',
+      'W',
+      'X',
+      'Y',
+      'Z'
+    );
     return $staticAlphabets;
   }
 
index 44def6eb969400f75a15da085a85389af117ec33..3dac69f0a974b6400818537181058350cfd73215 100644 (file)
@@ -185,10 +185,10 @@ class CRM_Utils_REST {
    * @return string
    */
   public static function jsonFormated($json) {
-    $tabcount   = 0;
-    $result     = '';
-    $inquote    = FALSE;
-    $inarray    = FALSE;
+    $tabcount = 0;
+    $result = '';
+    $inquote = FALSE;
+    $inarray = FALSE;
     $ignorenext = FALSE;
 
     $tab = "\t";
@@ -417,7 +417,7 @@ class CRM_Utils_REST {
       'action' => 1,
     );
 
-    if (array_key_exists('json', $requestParams) &&  $requestParams['json'][0] == "{") {
+    if (array_key_exists('json', $requestParams) && $requestParams['json'][0] == "{") {
       $params = json_decode($requestParams['json'], TRUE);
       if ($params === NULL) {
         CRM_Utils_JSON::output(array('is_error' => 1, 'error_message', 'Unable to decode supplied JSON.'));
@@ -470,7 +470,7 @@ class CRM_Utils_REST {
   }
 
   /** used to load a template "inline", eg. for ajax, without having to build a menu for each template */
-  static  function loadTemplate () {
+  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");
@@ -499,12 +499,13 @@ class CRM_Utils_REST {
     unset($param['q']);
     $smarty->assign_by_ref("request", $param);
 
-    if  (! array_key_exists('HTTP_X_REQUESTED_WITH', $_SERVER) ||
-      $_SERVER['HTTP_X_REQUESTED_WITH'] != "XMLHttpRequest" ) {
+    if (!array_key_exists('HTTP_X_REQUESTED_WITH', $_SERVER) ||
+      $_SERVER['HTTP_X_REQUESTED_WITH'] != "XMLHttpRequest"
+    ) {
 
       $smarty->assign('tplFile', $tpl);
       $config = CRM_Core_Config::singleton();
-      $content = $smarty->fetch('CRM/common/'. strtolower($config->userFramework) .'.tpl');
+      $content = $smarty->fetch('CRM/common/' . strtolower($config->userFramework) . '.tpl');
 
       if (!defined('CIVICRM_UF_HEAD') && $region = CRM_Core_Region::instance('html-header', FALSE)) {
         CRM_Utils_System::addHTMLHead($region->render(''));
@@ -533,7 +534,8 @@ class CRM_Utils_REST {
     // Why is $config undefined -- $config = CRM_Core_Config::singleton();
     if (!$config->debug && (!array_key_exists('HTTP_X_REQUESTED_WITH', $_SERVER) ||
         $_SERVER['HTTP_X_REQUESTED_WITH'] != "XMLHttpRequest"
-      )) {
+      )
+    ) {
       $error = civicrm_api3_create_error("SECURITY ALERT: Ajax requests can only be issued by javascript clients, eg. CRM.api3().",
         array(
           'IP' => $_SERVER['REMOTE_ADDR'],
@@ -556,7 +558,11 @@ class CRM_Utils_REST {
     $entity = CRM_Utils_String::munge(CRM_Utils_Array::value('entity', $requestParams));
     $action = CRM_Utils_String::munge(CRM_Utils_Array::value('action', $requestParams));
     if (!is_array($params)) {
-      CRM_Utils_JSON::output(array('is_error' => 1, 'error_message', 'invalid json format: ?{"param_with_double_quote":"value"}'));
+      CRM_Utils_JSON::output(array(
+          'is_error' => 1,
+          'error_message',
+          'invalid json format: ?{"param_with_double_quote":"value"}'
+        ));
     }
 
     $params['check_permissions'] = TRUE;
@@ -685,8 +691,8 @@ class CRM_Utils_REST {
 
     $uid = NULL;
     if (!$uid) {
-      $store      = NULL;
-      $api_key    = CRM_Utils_Request::retrieve('api_key', 'String', $store, FALSE, NULL, 'REQUEST');
+      $store = NULL;
+      $api_key = CRM_Utils_Request::retrieve('api_key', 'String', $store, FALSE, NULL, 'REQUEST');
       if (empty($api_key)) {
         return self::error("FATAL: mandatory param 'api_key' (user key) missing");
       }
index 23756b3444fc3f55e8ef422fb9d33bd1546afa6b..1cfca8a0b8fc4d5fba72896f0ab2e141df933625 100644 (file)
@@ -75,7 +75,7 @@ class CRM_Utils_ReCAPTCHA {
    * Add element to form
    */
   public static function add(&$form) {
-    $error  = NULL;
+    $error = NULL;
     $config = CRM_Core_Config::singleton();
     $useSSL = FALSE;
     if (!function_exists('recaptcha_get_html')) {
index df74201a3ad308859d6e55b7b233c71f7ba41a71..ec8378798b700316e3ada794eb3ee38316908061 100644 (file)
@@ -166,8 +166,9 @@ class CRM_Utils_Recent {
     // make sure item is not already present in list
     for ($i = 0; $i < count($tempRecent); $i++) {
       if (!($tempRecent[$i]['id'] == $recentItem['id'] &&
-          $tempRecent[$i]['type'] == $recentItem['type']
-        )) {
+        $tempRecent[$i]['type'] == $recentItem['type']
+      )
+      ) {
         self::$_recent[] = $tempRecent[$i];
       }
     }
index 0a409adea1ec8e352cae0afeae52af8ced29d1ff..0a737d1309290b9ca4783d1c086e5fa2e598f201 100644 (file)
@@ -427,11 +427,11 @@ class CRM_Utils_Rule {
 
     //CRM-14868
     $currencySymbols = CRM_Core_PseudoConstant::get(
-                          'CRM_Contribute_DAO_Contribution',
-                          'currency', array(
-                                           'keyColumn' => 'name',
-                                           'labelColumn' => 'symbol',
-                                            ));
+      'CRM_Contribute_DAO_Contribution',
+      'currency', array(
+        'keyColumn' => 'name',
+        'labelColumn' => 'symbol',
+      ));
     $value = str_replace($currencySymbols, '', $value);
 
     if ($config->monetaryThousandSeparator) {
index c9a30738e5ae2fdeec72578e04625ac49e6bf098..978bbbb5a0cad0b80b46226bb141ee8d97d2ce1a 100644 (file)
@@ -55,12 +55,12 @@ class CRM_Utils_Sort {
    */
   const ASCENDING = 1, DESCENDING = 2, DONTCARE = 4,
 
-  /**
-   * The name for the sort GET/POST param
-   *
-   * @var string
-   */
-  SORT_ID = 'crmSID', SORT_DIRECTION = 'crmSortDirection', SORT_ORDER = 'crmSortOrder';
+    /**
+     * The name for the sort GET/POST param
+     *
+     * @var string
+     */
+    SORT_ID = 'crmSID', SORT_DIRECTION = 'crmSortDirection', SORT_ORDER = 'crmSortOrder';
 
   /**
    * Name of the sort function. Used to isolate session variables
index a86d859d2702fd27f7a8148d108f89e1844310d3..c10aa00e053655f7a88dfa6f2e9f3af8023adb21 100644 (file)
@@ -599,10 +599,23 @@ class CRM_Utils_String {
 
     if ($_searchChars == NULL) {
       $_searchChars = array(
-        '&', ';', ',', '=', '$',
-        '"', "'", '\\',
-        '<', '>', '(', ')',
-        ' ', "\r", "\r\n", "\n", "\t",
+        '&',
+        ';',
+        ',',
+        '=',
+        '$',
+        '"',
+        "'",
+        '\\',
+        '<',
+        '>',
+        '(',
+        ')',
+        ' ',
+        "\r",
+        "\r\n",
+        "\n",
+        "\t",
       );
       $_replaceChar = '_';
     }
@@ -723,8 +736,8 @@ class CRM_Utils_String {
     $offset = floor(($len - $maskCount) / 2);
 
     $masked = substr($user, 0, $offset)
-       . str_repeat($maskChar, $maskCount)
-       . substr($user, $maskCount + $offset);
+      . str_repeat($maskChar, $maskCount)
+      . substr($user, $maskCount + $offset);
 
     return ($masked . '@' . $domain);
   }
index ed5ff5a3bab51f4dd13efb12d5b51b1cbd5977db..fe9f45a4d02cf4e95c7557a9721b65ebd9e1a46d 100644 (file)
@@ -56,8 +56,8 @@ class CRM_Utils_Sunlight {
     }
     if ($request->getResponseCode() != 200) {
       CRM_Core_Error::fatal(ts('Invalid response code received from Sunlight servers: %1',
-          array(1 => $request->getResponseCode())
-        ));
+        array(1 => $request->getResponseCode())
+      ));
     }
     $string = $request->getResponseBody();
     return simplexml_load_string($string);
@@ -137,9 +137,9 @@ class CRM_Utils_Sunlight {
     ) {
       return NULL;
     }
-    $key  = self::$_apiKey;
+    $key = self::$_apiKey;
     $city = urlencode($city);
-    $uri  = "people.reps.getRepsFromCityState.php?city={$city}&state={$state}&apikey={$key}&output=xml";
+    $uri = "people.reps.getRepsFromCityState.php?city={$city}&state={$state}&apikey={$key}&output=xml";
     return self::getPeopleInfo($uri);
   }
 
index 5ec7b8d96017bf9e7e843aad9f41370259e1f90d..6a2671d7c070d1a61ec28ffc1d0f19f39b21db01 100644 (file)
@@ -106,8 +106,8 @@ class CRM_Utils_System {
   public static function getLinksUrl($urlVar, $includeReset = FALSE, $includeForce = TRUE, $skipUFVar = TRUE) {
     // Sort out query string to prevent messy urls
     $querystring = array();
-    $qs          = array();
-    $arrays      = array();
+    $qs = array();
+    $arrays = array();
 
     if (!empty($_SERVER['QUERY_STRING'])) {
       $qs = explode('&', str_replace('&amp;', '&', $_SERVER['QUERY_STRING']));
@@ -508,7 +508,7 @@ class CRM_Utils_System {
     $config->userFrameworkResourceURL = str_replace('http://', 'https://', $config->userFrameworkResourceURL);
     $config->resourceBase = $config->userFrameworkResourceURL;
 
-    if (! empty($config->extensionsURL)) {
+    if (!empty($config->extensionsURL)) {
       $config->extensionsURL = str_replace('http://', 'https://', $config->extensionsURL);
     }
 
@@ -734,17 +734,17 @@ class CRM_Utils_System {
     $s = ob_get_contents();
     ob_end_clean();
 
-    $s        = strip_tags($s, '<h2><th><td>');
-    $s        = preg_replace('/<th[^>]*>([^<]+)<\/th>/', "<info>\\1</info>", $s);
-    $s        = preg_replace('/<td[^>]*>([^<]+)<\/td>/', "<info>\\1</info>", $s);
-    $vTmp     = preg_split('/(<h2>[^<]+<\/h2>)/', $s, -1, PREG_SPLIT_DELIM_CAPTURE);
+    $s = strip_tags($s, '<h2><th><td>');
+    $s = preg_replace('/<th[^>]*>([^<]+)<\/th>/', "<info>\\1</info>", $s);
+    $s = preg_replace('/<td[^>]*>([^<]+)<\/td>/', "<info>\\1</info>", $s);
+    $vTmp = preg_split('/(<h2>[^<]+<\/h2>)/', $s, -1, PREG_SPLIT_DELIM_CAPTURE);
     $vModules = array();
     for ($i = 1; $i < count($vTmp); $i++) {
       if (preg_match('/<h2>([^<]+)<\/h2>/', $vTmp[$i], $vMat)) {
         $vName = trim($vMat[1]);
         $vTmp2 = explode("\n", $vTmp[$i + 1]);
         foreach ($vTmp2 as $vOne) {
-          $vPat  = '<info>([^<]+)<\/info>';
+          $vPat = '<info>([^<]+)<\/info>';
           $vPat3 = "/$vPat\s*$vPat\s*$vPat/";
           $vPat2 = "/$vPat\s*$vPat/";
           // 3cols
@@ -981,8 +981,8 @@ class CRM_Utils_System {
 
     if ($abort) {
       CRM_Core_Error::fatal(ts('This feature requires PHP Version %1 or greater',
-          array(1 => $ver)
-        ));
+        array(1 => $ver)
+      ));
     }
     return FALSE;
   }
@@ -1068,8 +1068,8 @@ class CRM_Utils_System {
           array(dirname(__FILE__), '..', '..', 'xml', 'version.xml')
         );
         if (file_exists($verFile)) {
-          $str     = file_get_contents($verFile);
-          $xmlObj  = simplexml_load_string($str);
+          $str = file_get_contents($verFile);
+          $xmlObj = simplexml_load_string($str);
           $version = (string) $xmlObj->version_no;
         }
       }
@@ -1110,10 +1110,10 @@ class CRM_Utils_System {
         $headers[str_replace(' ',
           '-',
           ucwords(strtolower(str_replace('_',
-                ' ',
-                substr($name, 5)
-              )
-            ))
+              ' ',
+              substr($name, 5)
+            )
+          ))
         )] = $value;
       }
     }
@@ -1425,8 +1425,8 @@ class CRM_Utils_System {
       // if db.ver > code.ver, sth really wrong
       if (version_compare($dbVersion, $codeVersion) > 0) {
         $errorMessage = '<p>' . ts('Your database is marked with an unexpected version number: %1. The v%2 codebase may not be compatible with your database state. You will need to determine the correct version corresponding to your current database state. You may want to revert to the codebase you were using until you resolve this problem.',
-          array(1 => $dbVersion, 2 => $codeVersion)
-        ) . '</p>';
+            array(1 => $dbVersion, 2 => $codeVersion)
+          ) . '</p>';
         $errorMessage .= "<p>" . ts('OR if this is a manual install from git, you might want to fix civicrm-version.php file.') . "</p>";
         return FALSE;
       }
@@ -1468,14 +1468,14 @@ class CRM_Utils_System {
 
     // reset various static arrays used here
     CRM_Contact_BAO_Contact::$_importableFields =
-      CRM_Contact_BAO_Contact::$_exportableFields =
-      CRM_Contribute_BAO_Contribution::$_importableFields =
-      CRM_Contribute_BAO_Contribution::$_exportableFields =
-      CRM_Pledge_BAO_Pledge::$_exportableFields =
-      CRM_Contribute_BAO_Query::$_contributionFields =
-      CRM_Core_BAO_CustomField::$_importFields =
-      CRM_Core_BAO_Cache::$_cache =
-      CRM_Core_DAO::$_dbColumnValueCache = NULL;
+    CRM_Contact_BAO_Contact::$_exportableFields =
+    CRM_Contribute_BAO_Contribution::$_importableFields =
+    CRM_Contribute_BAO_Contribution::$_exportableFields =
+    CRM_Pledge_BAO_Pledge::$_exportableFields =
+    CRM_Contribute_BAO_Query::$_contributionFields =
+    CRM_Core_BAO_CustomField::$_importFields =
+    CRM_Core_BAO_Cache::$_cache =
+    CRM_Core_DAO::$_dbColumnValueCache = NULL;
 
     CRM_Core_OptionGroup::flushAll();
     CRM_Utils_PseudoConstant::flushAll();
@@ -1540,7 +1540,8 @@ class CRM_Utils_System {
             DIRECTORY_SEPARATOR . 'sites' .
             DIRECTORY_SEPARATOR . 'all' .
             DIRECTORY_SEPARATOR . 'modules'
-          ) === FALSE) {
+          ) === FALSE
+        ) {
           $startPos = strpos($civicrm_root,
             DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR
           );
index 4c3cdacfff64642615357ba509b30fdb6fb6282c..57d64d9c4735187beb8a206b0c3cbff1c536ce39 100644 (file)
@@ -372,6 +372,7 @@ abstract class CRM_Utils_System_Base {
   public function getUserRecordUrl($contactID) {
     return NULL;
   }
+
   /**
    * Is the current user permitted to add a user
    * @return bool
index e71a3b5ecc36808f63de608abcd362ed7ccbb512..7d3f289a0da0e0e26e40f7f24a9dc9e12f2147f2 100644 (file)
@@ -133,9 +133,9 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase {
   public static function checkUserNameEmailExists(&$params, &$errors, $emailName = 'email') {
     $config = CRM_Core_Config::singleton();
 
-    $dao    = new CRM_Core_DAO();
-    $name   = $dao->escape(CRM_Utils_Array::value('name', $params));
-    $email  = $dao->escape(CRM_Utils_Array::value('mail', $params));
+    $dao = new CRM_Core_DAO();
+    $name = $dao->escape(CRM_Utils_Array::value('name', $params));
+    $email = $dao->escape(CRM_Utils_Array::value('mail', $params));
     $errors = form_get_errors();
     if ($errors) {
       // unset drupal messages to avoid twice display of errors
@@ -320,7 +320,7 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase {
   /**
    * Add a script file
    *
-   * @param $url: string, absolute path to file
+   * @param $url : string, absolute path to file
    * @param string $region
    *   location within the document: 'html-header', 'page-header', 'page-footer'.
    *
@@ -350,7 +350,7 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase {
   /**
    * Add an inline script
    *
-   * @param $code: string, javascript code
+   * @param $code : string, javascript code
    * @param string $region
    *   location within the document: 'html-header', 'page-header', 'page-footer'.
    *
@@ -378,7 +378,7 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase {
   /**
    * Add a css file
    *
-   * @param $url: string, absolute path to file
+   * @param $url : string, absolute path to file
    * @param string $region
    *   location within the document: 'html-header', 'page-header', 'page-footer'.
    *
@@ -402,7 +402,7 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase {
   /**
    * Add an inline style
    *
-   * @param $code: string, css code
+   * @param $code : string, css code
    * @param string $region
    *   location within the document: 'html-header', 'page-header', 'page-footer'.
    *
@@ -503,8 +503,8 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase {
       require_once "$cmsPath/includes/password.inc";
 
       $strtolower = function_exists('mb_strtolower') ? 'mb_strtolower' : 'strtolower';
-      $name       = $dbDrupal->escapeSimple($strtolower($name));
-      $sql        = "
+      $name = $dbDrupal->escapeSimple($strtolower($name));
+      $sql = "
 SELECT u.*
 FROM   {$config->userFrameworkUsersTableName} u
 WHERE  LOWER(u.name) = '$name'
@@ -911,11 +911,11 @@ AND    u.status = 1
               //kinda hackish but not sure how to do it right
               //hope http_build_url() will help at some point.
               if (is_array($parseUrl) && !empty($parseUrl)) {
-                $urlParts           = explode('/', $url);
-                $hostKey            = array_search($parseUrl['host'], $urlParts);
-                $ufUrlParts         = parse_url(CIVICRM_UF_BASEURL);
+                $urlParts = explode('/', $url);
+                $hostKey = array_search($parseUrl['host'], $urlParts);
+                $ufUrlParts = parse_url(CIVICRM_UF_BASEURL);
                 $urlParts[$hostKey] = $ufUrlParts['host'];
-                $url                = implode('/', $urlParts);
+                $url = implode('/', $urlParts);
               }
             }
           }
@@ -1023,6 +1023,7 @@ AND    u.status = 1
     }
     return $timezone;
   }
+
   /**
    * Reset any system caches that may be required for proper CiviCRM
    * integration.
index 4da3d34127c95c9970162a40c186a8eb994158ab..82a99e1cecd0947b7f4afbdd1c7b539e43296664 100644 (file)
@@ -157,8 +157,8 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase {
   public function checkUserNameEmailExists(&$params, &$errors, $emailName = 'email') {
     $config = CRM_Core_Config::singleton();
 
-    $dao   = new CRM_Core_DAO();
-    $name  = $dao->escape(CRM_Utils_Array::value('name', $params));
+    $dao = new CRM_Core_DAO();
+    $name = $dao->escape(CRM_Utils_Array::value('name', $params));
     $email = $dao->escape(CRM_Utils_Array::value('mail', $params));
     _user_edit_validate(NULL, $params);
     $errors = form_get_errors();
@@ -332,7 +332,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase {
   /**
    * Add a script file
    *
-   * @param $url: string, absolute path to file
+   * @param $url : string, absolute path to file
    * @param string $region
    *   location within the document: 'html-header', 'page-header', 'page-footer'.
    *
@@ -350,7 +350,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase {
   /**
    * Add an inline script
    *
-   * @param $code: string, javascript code
+   * @param $code : string, javascript code
    * @param string $region
    *   location within the document: 'html-header', 'page-header', 'page-footer'.
    *
@@ -368,7 +368,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase {
   /**
    * Add a css file
    *
-   * @param $url: string, absolute path to file
+   * @param $url : string, absolute path to file
    * @param string $region
    *   location within the document: 'html-header', 'page-header', 'page-footer'.
    *
@@ -389,7 +389,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase {
   /**
    * Add an inline style
    *
-   * @param $code: string, css code
+   * @param $code : string, css code
    * @param string $region
    *   location within the document: 'html-header', 'page-header', 'page-footer'.
    *
@@ -465,10 +465,10 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase {
     }
 
     $strtolower = function_exists('mb_strtolower') ? 'mb_strtolower' : 'strtolower';
-    $dbpassword   = md5($password);
-    $name       = $dbDrupal->escapeSimple($strtolower($name));
-    $sql        = 'SELECT u.* FROM ' . $config->userFrameworkUsersTableName . " u WHERE LOWER(u.name) = '$name' AND u.pass = '$dbpassword' AND u.status = 1";
-    $query      = $dbDrupal->query($sql);
+    $dbpassword = md5($password);
+    $name = $dbDrupal->escapeSimple($strtolower($name));
+    $sql = 'SELECT u.* FROM ' . $config->userFrameworkUsersTableName . " u WHERE LOWER(u.name) = '$name' AND u.pass = '$dbpassword' AND u.status = 1";
+    $query = $dbDrupal->query($sql);
 
     $user = NULL;
     // need to change this to make sure we matched only one row
@@ -483,8 +483,8 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase {
           $bootStrapParams = array();
           if ($name && $password) {
             $bootStrapParams = array(
-                'name' => $name,
-                'pass' => $password,
+              'name' => $name,
+              'pass' => $password,
             );
           }
           CRM_Utils_System::loadBootStrap($bootStrapParams, TRUE, TRUE, $realPath);
@@ -829,8 +829,8 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase {
         $language->prefix &&
         in_array($mode, array(
           LANGUAGE_NEGOTIATION_PATH,
-            LANGUAGE_NEGOTIATION_PATH_DEFAULT,
-          ))
+          LANGUAGE_NEGOTIATION_PATH_DEFAULT,
+        ))
       ) {
 
         if ($addLanguagePart) {
@@ -855,11 +855,11 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase {
           //kinda hackish but not sure how to do it right
           //hope http_build_url() will help at some point.
           if (is_array($parseUrl) && !empty($parseUrl)) {
-            $urlParts           = explode('/', $url);
-            $hostKey            = array_search($parseUrl['host'], $urlParts);
-            $ufUrlParts         = parse_url(CIVICRM_UF_BASEURL);
+            $urlParts = explode('/', $url);
+            $hostKey = array_search($parseUrl['host'], $urlParts);
+            $ufUrlParts = parse_url(CIVICRM_UF_BASEURL);
             $urlParts[$hostKey] = $ufUrlParts['host'];
-            $url                = implode('/', $urlParts);
+            $url = implode('/', $urlParts);
           }
         }
       }
index 1852235fbe90e137dbfc6ba73e1db8784530c0d4..1b1a87abbc06796d49f6320d5a7505ec6dd47e89 100644 (file)
@@ -155,7 +155,8 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase {
       // This checks for both username uniqueness and validity.
       $violations = iterator_to_array($user->validate());
       // We only care about violations on the username field; discard the rest.
-      $violations = array_filter($violations, function ($v) { return $v->getPropertyPath() == 'name.0.value';
+      $violations = array_filter($violations, function ($v) {
+        return $v->getPropertyPath() == 'name.0.value';
       });
       if (count($violations) > 0) {
         $errors['cms_name'] = $violations[0]->getMessage();
@@ -172,7 +173,8 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase {
       // This checks for both email uniqueness.
       $violations = iterator_to_array($user->validate());
       // We only care about violations on the email field; discard the rest.
-      $violations = array_filter($violations, function ($v) { return $v->getPropertyPath() == 'mail.0.value';
+      $violations = array_filter($violations, function ($v) {
+        return $v->getPropertyPath() == 'mail.0.value';
       });
       if (count($violations) > 0) {
         $errors[$emailName] = $violations[0]->getMessage();
@@ -292,7 +294,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase {
   /**
    * Add a script file
    *
-   * @param $url: string, absolute path to file
+   * @param $url : string, absolute path to file
    * @param string $region
    *   location within the document: 'html-header', 'page-header', 'page-footer'.
    *
@@ -322,7 +324,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase {
   /**
    * Add an inline script
    *
-   * @param $code: string, javascript code
+   * @param $code : string, javascript code
    * @param string $region
    *   location within the document: 'html-header', 'page-header', 'page-footer'.
    *
@@ -350,7 +352,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase {
   /**
    * Add a css file
    *
-   * @param $url: string, absolute path to file
+   * @param $url : string, absolute path to file
    * @param string $region
    *   location within the document: 'html-header', 'page-header', 'page-footer'.
    *
@@ -374,7 +376,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase {
   /**
    * Add an inline style
    *
-   * @param $code: string, css code
+   * @param $code : string, css code
    * @param string $region
    *   location within the document: 'html-header', 'page-header', 'page-footer'.
    *
index de90d45d298e8b1d92bdc663478527f78c4c97af..9361ab29f3f3f3629d22ffb24ce2bf0d39d0e432 100644 (file)
@@ -44,6 +44,7 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base {
    * @var bool
    */
   var $supports_UF_Logging = TRUE;
+
   /**
    */
   public function __construct() {
@@ -272,7 +273,12 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base {
    */
   public function getUserRecordUrl($contactID) {
     $uid = CRM_Core_BAO_UFMatch::getUFId($contactID);
-    if (CRM_Core_Session::singleton()->get('userID') == $contactID || CRM_Core_Permission::checkAnyPerm(array('cms:administer users', 'cms:view user account'))) {
+    if (CRM_Core_Session::singleton()
+        ->get('userID') == $contactID || CRM_Core_Permission::checkAnyPerm(array(
+          'cms:administer users',
+          'cms:view user account'
+        ))
+    ) {
       return CRM_Utils_System::url('user/' . $uid);
     };
   }
@@ -353,6 +359,7 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base {
       }
     }
   }
+
   /**
    * Format the url as per language Negotiation.
    *
@@ -404,11 +411,11 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base {
               //kinda hackish but not sure how to do it right
               //hope http_build_url() will help at some point.
               if (is_array($parseUrl) && !empty($parseUrl)) {
-                $urlParts           = explode('/', $url);
-                $hostKey            = array_search($parseUrl['host'], $urlParts);
-                $ufUrlParts         = parse_url(CIVICRM_UF_BASEURL);
+                $urlParts = explode('/', $url);
+                $hostKey = array_search($parseUrl['host'], $urlParts);
+                $ufUrlParts = parse_url(CIVICRM_UF_BASEURL);
                 $urlParts[$hostKey] = $ufUrlParts['host'];
-                $url                = implode('/', $urlParts);
+                $url = implode('/', $urlParts);
               }
             }
           }
@@ -465,6 +472,7 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base {
 
     return CRM_Core_I18n_PseudoConstant::longForShort(substr($language->language, 0, 2));
   }
+
   /**
    * Perform any post login activities required by the UF -
    * e.g. for drupal: records a watchdog message about the new session, saves the login timestamp,
index 1a5b7205d8e430db1217dda8403e6a9b17ef7e39..234f3bc6d8b8a16a5f3506205c5e37b3aba1befe 100644 (file)
@@ -64,8 +64,8 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base {
     require_once $baseDir . '/components/com_users/models/registration.php';
 
     $userParams = JComponentHelper::getParams('com_users');
-    $model      = new UsersModelRegistration();
-    $ufID       = NULL;
+    $model = new UsersModelRegistration();
+    $ufID = NULL;
 
     // get the default usertype
     $userType = $userParams->get('new_usertype');
@@ -84,11 +84,11 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base {
     }
 
     // Prepare the values for a new Joomla user.
-    $values              = array();
-    $values['name']      = $fullname;
-    $values['username']  = trim($params['cms_name']);
+    $values = array();
+    $values['name'] = $fullname;
+    $values['username'] = trim($params['cms_name']);
     $values['password1'] = $values['password2'] = $params['cms_pass'];
-    $values['email1']    = $values['email2'] = trim($params[$mail]);
+    $values['email1'] = $values['email2'] = trim($params[$mail]);
 
     $lang = JFactory::getLanguage();
     $lang->load('com_users', $baseDir);
@@ -133,8 +133,8 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base {
   public function checkUserNameEmailExists(&$params, &$errors, $emailName = 'email') {
     $config = CRM_Core_Config::singleton();
 
-    $dao   = new CRM_Core_DAO();
-    $name  = $dao->escape(CRM_Utils_Array::value('name', $params));
+    $dao = new CRM_Core_DAO();
+    $name = $dao->escape(CRM_Utils_Array::value('name', $params));
     $email = $dao->escape(CRM_Utils_Array::value('mail', $params));
     //don't allow the special characters and min. username length is two
     //regex \\ to match a single backslash would become '/\\\\/'
@@ -262,7 +262,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base {
   /**
    * Add a script file
    *
-   * @param $url: string, absolute path to file
+   * @param $url : string, absolute path to file
    * @param string $region
    *   location within the document: 'html-header', 'page-header', 'page-footer'.
    *
@@ -279,7 +279,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base {
   /**
    * Add an inline script
    *
-   * @param $code: string, javascript code
+   * @param $code : string, javascript code
    * @param string $region
    *   location within the document: 'html-header', 'page-header', 'page-footer'.
    *
@@ -296,7 +296,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base {
   /**
    * Add a css file
    *
-   * @param $url: string, absolute path to file
+   * @param $url : string, absolute path to file
    * @param string $region
    *   location within the document: 'html-header', 'page-header', 'page-footer'.
    *
@@ -318,7 +318,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base {
   /**
    * Add an inline style
    *
-   * @param $code: string, css code
+   * @param $code : string, css code
    * @param string $region
    *   location within the document: 'html-header', 'page-header', 'page-footer'.
    *
@@ -365,11 +365,11 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base {
     $fragment = NULL, $htmlize = TRUE,
     $frontend = FALSE, $forceBackend = FALSE
   ) {
-    $config    = CRM_Core_Config::singleton();
+    $config = CRM_Core_Config::singleton();
     $separator = $htmlize ? '&amp;' : '&';
-    $Itemid    = '';
-    $script    = '';
-    $path      = CRM_Utils_String::stripPathChars($path);
+    $Itemid = '';
+    $script = '';
+    $path = CRM_Utils_String::stripPathChars($path);
 
     if ($config->userFrameworkFrontend) {
       $script = 'index.php';
@@ -477,7 +477,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base {
    *
    * @return mixed false if no auth
    *               array(
-  contactID, ufID, unique string ) if success
+   * contactID, ufID, unique string ) if success
    */
   public function authenticate($name, $password, $loadCMSBootstrap = FALSE) {
     require_once 'DB.php';
@@ -658,7 +658,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base {
 
     // load BootStrap here if needed
     // We are a valid Joomla entry point.
-    if (! defined('_JEXEC') && $loadDefines) {
+    if (!defined('_JEXEC') && $loadDefines) {
       define('_JEXEC', 1);
       define('DS', DIRECTORY_SEPARATOR);
       define('JPATH_BASE', $joomlaBase . '/administrator');
@@ -729,6 +729,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base {
     $user = JFactory::getUser();
     return $this->getUniqueIdentifierFromUserObject($user);
   }
+
   /**
    * Get User ID from UserFramework system (Joomla)
    * @param object $user
index e2eec7c8796849b2dce32a3c1293c3c6b57d6fe5..7ffe19b30bfa52d96ee38d59272fcadc7ac81ecc 100644 (file)
@@ -172,7 +172,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
   /**
    * Add a script file
    *
-   * @param $url: string, absolute path to file
+   * @param $url : string, absolute path to file
    * @param string $region
    *   location within the document: 'html-header', 'page-header', 'page-footer'.
    *
@@ -189,7 +189,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
   /**
    * Add an inline script
    *
-   * @param $code: string, javascript code
+   * @param $code : string, javascript code
    * @param string $region
    *   location within the document: 'html-header', 'page-header', 'page-footer'.
    *
@@ -206,7 +206,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
   /**
    * Add a css file
    *
-   * @param $url: string, absolute path to file
+   * @param $url : string, absolute path to file
    * @param string $region
    *   location within the document: 'html-header', 'page-header', 'page-footer'.
    *
@@ -223,7 +223,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
   /**
    * Add an inline style
    *
-   * @param $code: string, css code
+   * @param $code : string, css code
    * @param string $region
    *   location within the document: 'html-header', 'page-header', 'page-footer'.
    *
@@ -300,10 +300,10 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
     $frontend = FALSE,
     $forceBackend = FALSE
   ) {
-    $config    = CRM_Core_Config::singleton();
-    $script    = '';
+    $config = CRM_Core_Config::singleton();
+    $script = '';
     $separator = $htmlize ? '&amp;' : '&';
-    $wpPageParam    = '';
+    $wpPageParam = '';
     $fragment = isset($fragment) ? ('#' . $fragment) : '';
 
     $path = CRM_Utils_String::stripPathChars($path);
@@ -371,7 +371,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
    * @return mixed|null|string
    */
   private function getBaseUrl($absolute, $frontend, $forceBackend) {
-    $config    = CRM_Core_Config::singleton();
+    $config = CRM_Core_Config::singleton();
 
     if (!isset($config->useFrameworkRelativeBase)) {
       $base = parse_url($config->userFrameworkBaseURL);
@@ -630,7 +630,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
   public function updateCMSName($ufID, $ufName) {
     // CRM-10620
     if (function_exists('wp_update_user')) {
-      $ufID   = CRM_Utils_Type::escape($ufID, 'Integer');
+      $ufID = CRM_Utils_Type::escape($ufID, 'Integer');
       $ufName = CRM_Utils_Type::escape($ufName, 'String');
 
       $values = array('ID' => $ufID, 'user_email' => $ufName);
@@ -648,8 +648,8 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
   public function checkUserNameEmailExists(&$params, &$errors, $emailName = 'email') {
     $config = CRM_Core_Config::singleton();
 
-    $dao   = new CRM_Core_DAO();
-    $name  = $dao->escape(CRM_Utils_Array::value('name', $params));
+    $dao = new CRM_Core_DAO();
+    $name = $dao->escape(CRM_Utils_Array::value('name', $params));
     $email = $dao->escape(CRM_Utils_Array::value('mail', $params));
 
     if (!empty($params['name'])) {
@@ -693,11 +693,13 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
    */
   public function getLoggedInUserObject() {
     if (function_exists('is_user_logged_in') &&
-    is_user_logged_in()) {
+      is_user_logged_in()
+    ) {
       global $current_user;
     }
     return $current_user;
   }
+
   /**
    * Get currently logged in user uf id.
    *
@@ -797,7 +799,9 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
    */
   public function getUserRecordUrl($contactID) {
     $uid = CRM_Core_BAO_UFMatch::getUFId($contactID);
-    if (CRM_Core_Session::singleton()->get('userID') == $contactID || CRM_Core_Permission::checkAnyPerm(array('cms:administer users'))) {
+    if (CRM_Core_Session::singleton()
+        ->get('userID') == $contactID || CRM_Core_Permission::checkAnyPerm(array('cms:administer users'))
+    ) {
       return CRM_Core_Config::singleton()->userFrameworkBaseURL . "wp-admin/user-edit.php?user_id=" . $uid;
     }
   }
index 26f6c3a94f6d93c9d9dcf80486b797ba1119dbbd..eb03666221b6beec5e7ff1ce7c2d94a01ddb50ff 100644 (file)
@@ -244,14 +244,15 @@ class CRM_Utils_Token {
   ) {
     $key = 'domain';
     if (
-      !$knownTokens || empty($knownTokens[$key])) {
+      !$knownTokens || empty($knownTokens[$key])
+    ) {
       return $str;
     }
 
     $str = preg_replace_callback(
       self::tokenRegex($key),
-      function ($matches) use(&$domain, $html, $escapeSmarty) {
-      return CRM_Utils_Token::getDomainTokenReplacement($matches[1], $domain, $html, $escapeSmarty);
+      function ($matches) use (&$domain, $html, $escapeSmarty) {
+        return CRM_Utils_Token::getDomainTokenReplacement($matches[1], $domain, $html, $escapeSmarty);
       },
       $str
     );
@@ -434,8 +435,8 @@ class CRM_Utils_Token {
 
     $str = preg_replace_callback(
       self::tokenRegex($key),
-      function ($matches) use(&$mailing, $escapeSmarty) {
-      return CRM_Utils_Token::getMailingTokenReplacement($matches[1], $mailing, $escapeSmarty);
+      function ($matches) use (&$mailing, $escapeSmarty) {
+        return CRM_Utils_Token::getMailingTokenReplacement($matches[1], $mailing, $escapeSmarty);
       },
       $str
     );
@@ -574,8 +575,8 @@ class CRM_Utils_Token {
 
     $str = preg_replace_callback(
       self::tokenRegex($key),
-      function ($matches) use(&$addresses, &$urls, $html, $escapeSmarty) {
-      return CRM_Utils_Token::getActionTokenReplacement($matches[1], $addresses, $urls, $html, $escapeSmarty);
+      function ($matches) use (&$addresses, &$urls, $html, $escapeSmarty) {
+        return CRM_Utils_Token::getActionTokenReplacement($matches[1], $addresses, $urls, $html, $escapeSmarty);
       },
       $str
     );
@@ -678,8 +679,8 @@ class CRM_Utils_Token {
 
     $str = preg_replace_callback(
       self::tokenRegex($key),
-      function ($matches) use(&$contact, $html, $returnBlankToken, $escapeSmarty) {
-      return CRM_Utils_Token::getContactTokenReplacement($matches[1], $contact, $html, $returnBlankToken, $escapeSmarty);
+      function ($matches) use (&$contact, $html, $returnBlankToken, $escapeSmarty) {
+        return CRM_Utils_Token::getContactTokenReplacement($matches[1], $contact, $html, $returnBlankToken, $escapeSmarty);
       },
       $str
     );
@@ -769,7 +770,8 @@ class CRM_Utils_Token {
     }
 
     if ($escapeSmarty
-        && !($returnBlankToken && $noReplace)) { // $returnBlankToken means the caller wants to do further attempts at processing unreplaced tokens -- so don't escape them yet in this case.
+      && !($returnBlankToken && $noReplace)
+    ) { // $returnBlankToken means the caller wants to do further attempts at processing unreplaced tokens -- so don't escape them yet in this case.
       $value = self::tokenEscapeSmarty($value);
     }
 
@@ -804,8 +806,8 @@ class CRM_Utils_Token {
     foreach ($categories as $key) {
       $str = preg_replace_callback(
         self::tokenRegex($key),
-        function ($matches) use(&$contact, $key, $html, $escapeSmarty) {
-        return CRM_Utils_Token::getHookTokenReplacement($matches[1], $contact, $key, $html, $escapeSmarty);
+        function ($matches) use (&$contact, $key, $html, $escapeSmarty) {
+          return CRM_Utils_Token::getHookTokenReplacement($matches[1], $contact, $key, $html, $escapeSmarty);
         },
         $str
       );
@@ -1013,9 +1015,9 @@ class CRM_Utils_Token {
 
     if (preg_match('/\{action\.subscribe.\d+\}/', $str, $matches)) {
       foreach ($matches as $key => $value) {
-        $gid       = substr($value, 18, -1);
-        $config    = CRM_Core_Config::singleton();
-        $domain    = CRM_Core_BAO_MailSettings::defaultDomain();
+        $gid = substr($value, 18, -1);
+        $config = CRM_Core_Config::singleton();
+        $domain = CRM_Core_BAO_MailSettings::defaultDomain();
         $localpart = CRM_Core_BAO_MailSettings::defaultLocalpart();
         // we add the 0.0000000000000000 part to make this match the other email patterns (with action, two ids and a hash)
         $str = preg_replace('/' . preg_quote($value) . '/', "mailto:{$localpart}s.{$gid}.0.0000000000000000@$domain", $str);
@@ -1146,10 +1148,10 @@ class CRM_Utils_Token {
     $returnProperties = array();
     $matches = array();
     preg_match_all('/(?<!\{|\\\\)\{(\w+\.\w+)\}(?!\})/',
-        $string,
-        $matches,
-        PREG_PATTERN_ORDER
-      );
+      $string,
+      $matches,
+      PREG_PATTERN_ORDER
+    );
     if ($matches[1]) {
       foreach ($matches[1] as $token) {
         list($type, $name) = preg_split('/\./', $token, 2);
@@ -1169,9 +1171,9 @@ class CRM_Utils_Token {
    * @param $contactIDs
    * @param array $returnProperties
    *   Of required properties.
-   * @param bool $skipOnHoldDon't return on_hold contact info also.
+   * @param bool $skipOnHoldDon 't return on_hold contact info also.
    *   Don't return on_hold contact info also.
-   * @param bool $skipDeceasedDon't return deceased contact info.
+   * @param bool $skipDeceasedDon 't return deceased contact info.
    *   Don't return deceased contact info.
    * @param array $extraParams
    *   Extra params.
@@ -1203,7 +1205,10 @@ class CRM_Utils_Token {
     foreach ($contactIDs as $key => $contactID) {
       $params[] = array(
         CRM_Core_Form::CB_PREFIX . $contactID,
-        '=', 1, 0, 0,
+        '=',
+        1,
+        0,
+        0,
       );
     }
 
@@ -1277,7 +1282,10 @@ class CRM_Utils_Token {
 
         //special case for greeting replacement
         foreach (array(
-          'email_greeting', 'postal_greeting', 'addressee') as $val) {
+                   'email_greeting',
+                   'postal_greeting',
+                   'addressee'
+                 ) as $val) {
           if (!empty($contactDetails[$contactID][$val])) {
             $contactDetails[$contactID][$val] = $contactDetails[$contactID]["{$val}_display"];
           }
@@ -1314,14 +1322,15 @@ class CRM_Utils_Token {
    *   contactDetails with hooks swapped out
    */
   public function getAnonymousTokenDetails($contactIDs = array(
-    0),
-    $returnProperties = NULL,
-    $skipOnHold = TRUE,
-    $skipDeceased = TRUE,
-    $extraParams = NULL,
-    $tokens = array(),
-    $className = NULL,
-    $jobID = NULL) {
+      0
+    ),
+                                           $returnProperties = NULL,
+                                           $skipOnHold = TRUE,
+                                           $skipDeceased = TRUE,
+                                           $extraParams = NULL,
+                                           $tokens = array(),
+                                           $className = NULL,
+                                           $jobID = NULL) {
     $details = array(0 => array());
     // also call a hook and get token details
     CRM_Utils_Hook::tokenValues($details[0],
@@ -1406,9 +1415,13 @@ class CRM_Utils_Token {
    *   Array of membership IDS.
    */
   public static function getMembershipTokenDetails($membershipIDs) {
-    $memberships = civicrm_api3('membership', 'get', array('options' => array('limit' => 200000), 'membership_id' => array('IN' => (array) $membershipIDs)));
+    $memberships = civicrm_api3('membership', 'get', array(
+        'options' => array('limit' => 200000),
+        'membership_id' => array('IN' => (array) $membershipIDs)
+      ));
     return $memberships['values'];
   }
+
   /**
    * Replace greeting tokens exists in message/subject
    */
@@ -1493,7 +1506,10 @@ class CRM_Utils_Token {
     $flattenTokens = array();
 
     foreach (array(
-      'html', 'text', 'subject') as $prop) {
+               'html',
+               'text',
+               'subject'
+             ) as $prop) {
       if (!isset($tokens[$prop])) {
         continue;
       }
@@ -1533,8 +1549,8 @@ class CRM_Utils_Token {
 
     $str = preg_replace_callback(
       self::tokenRegex($key),
-      function ($matches) use($escapeSmarty) {
-      return CRM_Utils_Token::getUserTokenReplacement($matches[1], $escapeSmarty);
+      function ($matches) use ($escapeSmarty) {
+        return CRM_Utils_Token::getUserTokenReplacement($matches[1], $escapeSmarty);
       },
       $str
     );
@@ -1575,8 +1591,8 @@ class CRM_Utils_Token {
     $key = 'contribution';
     if (self::$_tokens[$key] == NULL) {
       self::$_tokens[$key] = array_keys(array_merge(CRM_Contribute_BAO_Contribution::exportableFields('All'),
-          array('campaign', 'financial_type')
-        ));
+        array('campaign', 'financial_type')
+      ));
     }
   }
 
@@ -1648,8 +1664,8 @@ class CRM_Utils_Token {
 
     $str = preg_replace_callback(
       self::tokenRegex($key),
-      function ($matches) use(&$contribution, $html, $escapeSmarty) {
-      return CRM_Utils_Token::getContributionTokenReplacement($matches[1], $contribution, $html, $escapeSmarty);
+      function ($matches) use (&$contribution, $html, $escapeSmarty) {
+        return CRM_Utils_Token::getContributionTokenReplacement($matches[1], $contribution, $html, $escapeSmarty);
       },
       $str
     );
@@ -1719,7 +1735,10 @@ class CRM_Utils_Token {
 
       case 'fee':
         try {
-          $value = civicrm_api3('membership_type', 'getvalue', array('id' => $membership['membership_type_id'], 'return' => 'minimum_fee'));
+          $value = civicrm_api3('membership_type', 'getvalue', array(
+              'id' => $membership['membership_type_id'],
+              'return' => 'minimum_fee'
+            ));
         }
         catch (CiviCRM_API3_Exception $e) {
           // we can anticipate we will get an error if the minimum fee is set to 'NULL' because of the way the
index b07ad4f6e46fbc61bd05c0d11cbd16b9d7a58cf9..cbbafa0f4d7357479479214bfff6b6c97e0e16ed 100644 (file)
@@ -110,7 +110,7 @@ class CRM_Utils_Tree {
    * @param array (ref) $parentNode which parent node should we search in ?
    *
    * @return array(
-  ref) | false node if found else false
+   * ref) | false node if found else false
    */
   //public function &findNode(&$parentNode, $name)
   public function &findNode($name, &$parentNode) {
@@ -146,8 +146,8 @@ class CRM_Utils_Tree {
    * Check if node is a leaf node.
    * Currently leaf nodes are strings and non-leaf nodes are arrays
    *
-   * @param array(
-  ref) $node node which needs to checked
+   * @param array (
+   * ref) $node node which needs to checked
    *
    * @return boolean
    */
@@ -164,9 +164,9 @@ class CRM_Utils_Tree {
    *   (ref)
    */
   public function &createNode($name) {
-    $node['name']     = $name;
+    $node['name'] = $name;
     $node['children'] = array();
-    $node['data']     = array();
+    $node['data'] = array();
 
     return $node;
   }
index 8b54738a19cf4ba6f9ffa9cf8ffdaea6ca938172..49d571c73bdf470bc2c675f8a9e33bfdc593e3cd 100644 (file)
  */
 class CRM_Utils_Type {
   const
-    T_INT        = 1,
-    T_STRING     = 2,
-    T_ENUM       = 2,
-    T_DATE       = 4,
-    T_TIME       = 8,
-    T_BOOLEAN    = 16,
-    T_TEXT       = 32,
-    T_LONGTEXT   = 32,
-    T_BLOB       = 64,
-    T_TIMESTAMP  = 256,
-    T_FLOAT      = 512,
-    T_MONEY      = 1024,
-    T_EMAIL      = 2048,
-    T_URL        = 4096,
-    T_CCNUM      = 8192,
+    T_INT = 1,
+    T_STRING = 2,
+    T_ENUM = 2,
+    T_DATE = 4,
+    T_TIME = 8,
+    T_BOOLEAN = 16,
+    T_TEXT = 32,
+    T_LONGTEXT = 32,
+    T_BLOB = 64,
+    T_TIMESTAMP = 256,
+    T_FLOAT = 512,
+    T_MONEY = 1024,
+    T_EMAIL = 2048,
+    T_URL = 4096,
+    T_CCNUM = 8192,
     T_MEDIUMBLOB = 16384;
 
   // @todo What's the point of these constants? Backwards compatibility?
   const
-    TWO       = 2,
-    FOUR      = 4,
-    SIX       = 6,
-    EIGHT     = 8,
-    TWELVE    = 12,
-    SIXTEEN   = 16,
-    TWENTY    = 20,
-    MEDIUM    = 20,
-    THIRTY    = 30,
-    BIG       = 30,
+    TWO = 2,
+    FOUR = 4,
+    SIX = 6,
+    EIGHT = 8,
+    TWELVE = 12,
+    SIXTEEN = 16,
+    TWENTY = 20,
+    MEDIUM = 20,
+    THIRTY = 30,
+    BIG = 30,
     FORTYFIVE = 45,
-    HUGE      = 45;
+    HUGE = 45;
 
   /**
    * Gets the string representation for a data type.
@@ -185,7 +185,7 @@ class CRM_Utils_Type {
             return $data;
           }
         }
-        elseif (!is_numeric($data) &&  CRM_Core_DAO::escapeString($data)) {
+        elseif (!is_numeric($data) && CRM_Core_DAO::escapeString($data)) {
           return $data;
         }
         elseif (CRM_Utils_Rule::positiveInteger($data)) {
index 9a2e2d6479ff021d3a7f335d70b81e213922f5f9..e6ff1ca25331ed712327ae190a010dcfb2253bf0 100644 (file)
@@ -103,8 +103,8 @@ class CRM_Utils_Verp {
   public static function &verpdecode($address) {
     preg_match('/^(.+)-([^=]+)=([^\@]+)\@(.+)/', $address, $match);
 
-    $slocal  = $match[1];
-    $rlocal  = $match[2];
+    $slocal = $match[1];
+    $rlocal = $match[2];
     $rdomain = $match[3];
     $sdomain = $match[4];
 
index f7f19905e84299e472cb60b0cbc97dc376560aa9..8dccc0789e5fd87c5f9ff5ff202613b92fcb9580 100644 (file)
@@ -183,7 +183,8 @@ class CRM_Utils_VersionCheck {
     foreach ($this->versionInfo as $majorVersion) {
       foreach ($majorVersion['releases'] as $release) {
         if (!empty($release['security']) && $release['date'] > $localVersionDate
-          && version_compare($this->localVersion, $release['version']) < 0) {
+          && version_compare($this->localVersion, $release['version']) < 0
+        ) {
           if (!$this->ignoreDate || $this->ignoreDate < $release['date']) {
             return TRUE;
           }
@@ -255,7 +256,8 @@ class CRM_Utils_VersionCheck {
             <li><a class="crm-setVersionCheckIgnoreDate" href="' . $settingsUrl . '">' . ts('Suppress this message') . '</a></li>
           </ul>';
         $session->setStatus($msg, ts('Security Alert'), 'alert');
-        CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'templates/CRM/Admin/Form/Setting/versionCheckOptions.js');
+        CRM_Core_Resources::singleton()
+          ->addScriptFile('civicrm', 'templates/CRM/Admin/Form/Setting/versionCheckOptions.js');
       }
     }
     elseif (CRM_Core_Permission::check('administer CiviCRM') && $versionAlertSetting > 1) {
@@ -269,7 +271,8 @@ class CRM_Utils_VersionCheck {
               <li><a class="crm-setVersionCheckIgnoreDate" href="' . $settingsUrl . '">' . ts('Suppress this message') . '</a></li>
             </ul>';
           $session->setStatus($msg, ts('Update Available'), 'info');
-          CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'templates/CRM/Admin/Form/Setting/versionCheckOptions.js');
+          CRM_Core_Resources::singleton()
+            ->addScriptFile('civicrm', 'templates/CRM/Admin/Form/Setting/versionCheckOptions.js');
         }
       }
     }
index 5abd4c4c13e824438850b58d5c60b80ce794adb7..a7213b6337cfa03ac99d8a4c7802a15bf34ca90f 100644 (file)
@@ -65,8 +65,8 @@ class CRM_Utils_Weight {
 
     if ($minDupeID->dupeId) {
       $additionalWhere = "id !=" . $minDupeID->dupeId . " AND $weightField >= " . $minDupeID->dupeWeight;
-      $update          = "$weightField = $weightField + 1";
-      $status          = CRM_Utils_Weight::query('UPDATE', $daoName, $fieldValues, $update, $additionalWhere);
+      $update = "$weightField = $weightField + 1";
+      $status = CRM_Utils_Weight::query('UPDATE', $daoName, $fieldValues, $update, $additionalWhere);
     }
 
     if ($minDupeID->dupeId && $status) {
@@ -112,8 +112,8 @@ class CRM_Utils_Weight {
 
     // fill the gap
     $additionalWhere = "$weightField > $weight";
-    $update          = "$weightField = $weightField - 1";
-    $status          = CRM_Utils_Weight::query('UPDATE', $daoName, $fieldValues, $update, $additionalWhere);
+    $update = "$weightField = $weightField - 1";
+    $status = CRM_Utils_Weight::query('UPDATE', $daoName, $fieldValues, $update, $additionalWhere);
 
     return $status;
   }
@@ -202,10 +202,10 @@ class CRM_Utils_Weight {
    * @return integer
    */
   public static function getNewWeight($daoName, $fieldValues = NULL, $weightField = 'weight') {
-    $selectField     = "id AS fieldID, $weightField AS weight";
-    $field           = CRM_Utils_Weight::query('SELECT', $daoName, $fieldValues, $selectField);
+    $selectField = "id AS fieldID, $weightField AS weight";
+    $field = CRM_Utils_Weight::query('SELECT', $daoName, $fieldValues, $selectField);
     $sameWeightCount = 0;
-    $weights         = array();
+    $weights = array();
     while ($field->fetch()) {
       if (in_array($field->weight, $weights)) {
         $sameWeightCount++;
@@ -292,19 +292,19 @@ class CRM_Utils_Weight {
    */
   static function &query(
     $queryType,
-      $daoName,
-      $fieldValues = NULL,
-      $queryData,
-      $additionalWhere = NULL,
-      $orderBy = NULL,
-      $groupBy = NULL
-    ) {
+    $daoName,
+    $fieldValues = NULL,
+    $queryData,
+    $additionalWhere = NULL,
+    $orderBy = NULL,
+    $groupBy = NULL
+  ) {
 
     require_once str_replace('_', DIRECTORY_SEPARATOR, $daoName) . ".php";
 
-    $dao       = new $daoName;
-    $table     = $dao->getTablename();
-    $fields    = &$dao->fields();
+    $dao = new $daoName;
+    $table = $dao->getTablename();
+    $fields = &$dao->fields();
     $fieldlist = array_keys($fields);
 
     $whereConditions = array();
@@ -321,7 +321,7 @@ class CRM_Utils_Weight {
         }
         $fieldNum++;
         $whereConditions[] = "$fieldName = %$fieldNum";
-        $fieldType         = $fields[$fieldName]['type'];
+        $fieldType = $fields[$fieldName]['type'];
         $params[$fieldNum] = array($value, CRM_Utils_Type::typeToString($fieldType));
       }
     }
@@ -375,15 +375,15 @@ class CRM_Utils_Weight {
     $ids = array_keys($rows);
     $numIDs = count($ids);
     array_unshift($ids, 0);
-    $ids[]   = 0;
+    $ids[] = 0;
     $firstID = $ids[1];
-    $lastID  = $ids[$numIDs];
+    $lastID = $ids[$numIDs];
     if ($firstID == $lastID) {
       $rows[$firstID]['order'] = NULL;
       return;
     }
-    $config    = CRM_Core_Config::singleton();
-    $imageURL  = $config->userFrameworkResourceURL . 'i/arrow';
+    $config = CRM_Core_Config::singleton();
+    $imageURL = $config->userFrameworkResourceURL . 'i/arrow';
 
     $queryParams = array(
       'reset' => 1,
@@ -398,7 +398,7 @@ class CRM_Utils_Weight {
     $baseURL = CRM_Utils_System::url('civicrm/admin/weight', $queryParams);
 
     for ($i = 1; $i <= $numIDs; $i++) {
-      $id     = $ids[$i];
+      $id = $ids[$i];
       $prevID = $ids[$i - 1];
       $nextID = $ids[$i + 1];
 
@@ -437,20 +437,20 @@ class CRM_Utils_Weight {
     $signer = new CRM_Utils_Signer(CRM_Core_Key::privateKey(), self::$SIGNABLE_FIELDS);
 
     // Validate $_GET values b/c subsequent code reads $_GET (via CRM_Utils_Request::retrieve)
-    if (! $signer->validate($signature, $_GET)) {
+    if (!$signer->validate($signature, $_GET)) {
       CRM_Core_Error::fatal('Request signature is invalid');
     }
 
     // Note: Ensure this list matches self::$SIGNABLE_FIELDS
     $daoName = CRM_Utils_Request::retrieve('dao', 'String', CRM_Core_DAO::$_nullObject);
-    $id      = CRM_Utils_Request::retrieve('id', 'Integer', CRM_Core_DAO::$_nullObject);
-    $idName  = CRM_Utils_Request::retrieve('idName', 'String', CRM_Core_DAO::$_nullObject);
-    $url     = CRM_Utils_Request::retrieve('url', 'String', CRM_Core_DAO::$_nullObject);
-    $filter  = CRM_Utils_Request::retrieve('filter', 'String', CRM_Core_DAO::$_nullObject);
-    $src     = CRM_Utils_Request::retrieve('src', 'Integer', CRM_Core_DAO::$_nullObject);
-    $dst     = CRM_Utils_Request::retrieve('dst', 'Integer', CRM_Core_DAO::$_nullObject);
-    $dir     = CRM_Utils_Request::retrieve('dir', 'String', CRM_Core_DAO::$_nullObject);
-    $object   = new $daoName();
+    $id = CRM_Utils_Request::retrieve('id', 'Integer', CRM_Core_DAO::$_nullObject);
+    $idName = CRM_Utils_Request::retrieve('idName', 'String', CRM_Core_DAO::$_nullObject);
+    $url = CRM_Utils_Request::retrieve('url', 'String', CRM_Core_DAO::$_nullObject);
+    $filter = CRM_Utils_Request::retrieve('filter', 'String', CRM_Core_DAO::$_nullObject);
+    $src = CRM_Utils_Request::retrieve('src', 'Integer', CRM_Core_DAO::$_nullObject);
+    $dst = CRM_Utils_Request::retrieve('dst', 'Integer', CRM_Core_DAO::$_nullObject);
+    $dir = CRM_Utils_Request::retrieve('dir', 'String', CRM_Core_DAO::$_nullObject);
+    $object = new $daoName();
     $srcWeight = CRM_Core_DAO::getFieldValue($daoName, $src, 'weight', $idName);
     $dstWeight = CRM_Core_DAO::getFieldValue($daoName, $dst, 'weight', $idName);
     if ($srcWeight == $dstWeight) {
@@ -461,15 +461,15 @@ class CRM_Utils_Weight {
 
     $query = "UPDATE $tableName SET weight = %1 WHERE $idName = %2";
     $params = array(
-    1 => array($dstWeight, 'Integer'),
-              2 => array($src, 'Integer'),
+      1 => array($dstWeight, 'Integer'),
+      2 => array($src, 'Integer'),
     );
     CRM_Core_DAO::executeQuery($query, $params);
 
     if ($dir == 'swap') {
       $params = array(
-      1 => array($srcWeight, 'Integer'),
-                2 => array($dst, 'Integer'),
+        1 => array($srcWeight, 'Integer'),
+        2 => array($dst, 'Integer'),
       );
       CRM_Core_DAO::executeQuery($query, $params);
     }
@@ -480,8 +480,8 @@ class CRM_Utils_Weight {
         $query .= " AND $filter";
       }
       $params = array(
-      1 => array($src, 'Integer'),
-                2 => array($srcWeight, 'Integer'),
+        1 => array($src, 'Integer'),
+        2 => array($srcWeight, 'Integer'),
       );
       CRM_Core_DAO::executeQuery($query, $params);
     }
@@ -492,8 +492,8 @@ class CRM_Utils_Weight {
         $query .= " AND $filter";
       }
       $params = array(
-      1 => array($src, 'Integer'),
-                2 => array($srcWeight, 'Integer'),
+        1 => array($src, 'Integer'),
+        2 => array($srcWeight, 'Integer'),
       );
       CRM_Core_DAO::executeQuery($query, $params);
     }
index 0474c2e5e1ade2828151bdf252421f0a6c76a413..956215b234f73622f0036687b1ae31ffb822e899 100644 (file)
@@ -62,15 +62,15 @@ class CRM_Utils_Wrapper {
    */
   public function run($formName, $formLabel = NULL, $arguments = NULL) {
     if (is_array($arguments)) {
-      $mode         = CRM_Utils_Array::value('mode', $arguments);
-      $imageUpload  = (bool) CRM_Utils_Array::value('imageUpload', $arguments, FALSE);
-      $addSequence  = (bool) CRM_Utils_Array::value('addSequence', $arguments, FALSE);
+      $mode = CRM_Utils_Array::value('mode', $arguments);
+      $imageUpload = (bool) CRM_Utils_Array::value('imageUpload', $arguments, FALSE);
+      $addSequence = (bool) CRM_Utils_Array::value('addSequence', $arguments, FALSE);
       $attachUpload = (bool) CRM_Utils_Array::value('attachUpload', $arguments, FALSE);
-      $ignoreKey    = (bool) CRM_Utils_Array::value('ignoreKey', $arguments, FALSE);
+      $ignoreKey = (bool) CRM_Utils_Array::value('ignoreKey', $arguments, FALSE);
     }
     else {
-      $arguments   = array();
-      $mode        = NULL;
+      $arguments = array();
+      $mode = NULL;
       $addSequence = $ignoreKey = $imageUpload = $attachUpload = FALSE;
     }
 
@@ -87,11 +87,11 @@ class CRM_Utils_Wrapper {
     if (array_key_exists('urlToSession', $arguments)) {
       if (is_array($arguments['urlToSession'])) {
         foreach ($arguments['urlToSession'] as $params) {
-          $urlVar     = CRM_Utils_Array::value('urlVar', $params);
+          $urlVar = CRM_Utils_Array::value('urlVar', $params);
           $sessionVar = CRM_Utils_Array::value('sessionVar', $params);
-          $type       = CRM_Utils_Array::value('type', $params);
-          $default    = CRM_Utils_Array::value('default', $params);
-          $abort      = CRM_Utils_Array::value('abort', $params, FALSE);
+          $type = CRM_Utils_Array::value('type', $params);
+          $default = CRM_Utils_Array::value('default', $params);
+          $abort = CRM_Utils_Array::value('abort', $params, FALSE);
 
           $value = NULL;
           $value = CRM_Utils_Request::retrieve(
index ee36f11eca2c7f565815f3405dc786e989555bcd..149b663831338a936610b6caed97969f81c82fe0 100644 (file)
@@ -30,7 +30,6 @@
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  */
-
 class CRM_Utils_XML {
 
   /**
@@ -45,7 +44,7 @@ class CRM_Utils_XML {
     $xml = FALSE; // SimpleXMLElement
     $error = FALSE; // string
 
-    if (! file_exists($file)) {
+    if (!file_exists($file)) {
       $error = 'File ' . $file . ' does not exist.';
     }
     else {