From 353ffa53c335f7b94ebaddc701e46f2bb30c7048 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 9 Jan 2015 20:15:06 -0800 Subject: [PATCH] INFRA-132 - CRM/ - PHPStorm cleanup --- CRM/ACL/BAO/ACL.php | 45 +- CRM/ACL/BAO/Cache.php | 2 +- CRM/ACL/Form/ACL.php | 30 +- CRM/ACL/Form/ACLBasic.php | 6 +- CRM/ACL/Form/WordPress/Permissions.php | 14 +- CRM/ACL/Page/ACL.php | 32 +- CRM/ACL/Page/ACLBasic.php | 8 +- CRM/ACL/Page/EntityRole.php | 8 +- CRM/Activity/BAO/ActivityContact.php | 5 +- CRM/Activity/BAO/ICalendar.php | 2 +- CRM/Activity/BAO/Query.php | 20 +- CRM/Activity/Form/Activity.php | 26 +- CRM/Activity/Form/ActivityView.php | 10 +- CRM/Activity/Form/Search.php | 6 +- CRM/Activity/Form/Task.php | 4 +- CRM/Activity/Form/Task/AddToTag.php | 5 +- CRM/Activity/Form/Task/FileOnCase.php | 9 +- CRM/Activity/Form/Task/PickOption.php | 5 +- CRM/Activity/Form/Task/PickProfile.php | 8 +- CRM/Activity/Form/Task/RemoveFromTag.php | 12 +- CRM/Activity/Import/Form/DataSource.php | 21 +- CRM/Activity/Import/Form/MapField.php | 51 +- CRM/Activity/Import/Form/Preview.php | 23 +- CRM/Activity/Import/Form/Summary.php | 14 +- CRM/Activity/Import/Parser.php | 11 +- CRM/Activity/Import/Parser/Activity.php | 8 +- CRM/Activity/Page/AJAX.php | 117 +-- CRM/Activity/Page/Tab.php | 8 +- CRM/Activity/Selector/Activity.php | 104 +-- CRM/Activity/Selector/Search.php | 14 +- CRM/Activity/Task.php | 3 +- CRM/Admin/Form.php | 4 +- CRM/Admin/Form/ContactType.php | 4 +- CRM/Admin/Form/Extensions.php | 4 +- CRM/Admin/Form/Job.php | 25 +- CRM/Admin/Form/LocationType.php | 4 +- CRM/Admin/Form/MailSettings.php | 6 +- CRM/Admin/Form/Mapping.php | 5 +- CRM/Admin/Form/MessageTemplates.php | 17 +- CRM/Admin/Form/Navigation.php | 4 +- CRM/Admin/Form/OptionGroup.php | 5 +- CRM/Admin/Form/Options.php | 54 +- CRM/Admin/Form/PaymentProcessor.php | 26 +- CRM/Admin/Form/PaymentProcessorType.php | 6 +- CRM/Admin/Form/PdfFormats.php | 8 +- CRM/Admin/Form/Persistent.php | 4 +- CRM/Admin/Form/Preferences.php | 4 +- CRM/Admin/Form/Preferences/Address.php | 3 +- CRM/Admin/Form/Preferences/Contribute.php | 120 +-- CRM/Admin/Form/Preferences/Display.php | 4 +- CRM/Admin/Form/Preferences/Event.php | 2 +- CRM/Admin/Form/Preferences/Multisite.php | 26 +- CRM/Admin/Form/PreferencesDate.php | 12 +- CRM/Admin/Form/RelationshipType.php | 6 +- CRM/Admin/Form/ScheduleReminders.php | 27 +- CRM/Admin/Form/Setting.php | 34 +- CRM/Admin/Form/Setting/Debugging.php | 1 + CRM/Admin/Form/Setting/Localization.php | 5 +- CRM/Admin/Form/Setting/Mail.php | 3 +- CRM/Admin/Form/Setting/Miscellaneous.php | 2 +- CRM/Admin/Form/Setting/Path.php | 2 +- CRM/Admin/Form/Setting/Search.php | 6 +- CRM/Admin/Form/Setting/Smtp.php | 15 +- .../Form/Setting/UpdateConfigBackend.php | 7 +- CRM/Admin/Form/Setting/Url.php | 1 + CRM/Admin/Form/Tag.php | 5 +- CRM/Admin/Form/WordReplacements.php | 22 +- CRM/Admin/Page/AJAX.php | 7 +- CRM/Admin/Page/Admin.php | 2 +- CRM/Admin/Page/CMSUser.php | 5 +- CRM/Admin/Page/EventTemplate.php | 8 +- CRM/Admin/Page/Extensions.php | 2 +- CRM/Admin/Page/Job.php | 8 +- CRM/Admin/Page/JobLog.php | 8 +- CRM/Admin/Page/MessageTemplates.php | 2 +- CRM/Admin/Page/Options.php | 38 +- CRM/Admin/Page/ParticipantStatusType.php | 8 +- CRM/Admin/Page/PaymentProcessor.php | 19 +- CRM/Badge/BAO/Badge.php | 3 +- CRM/Badge/Form/Layout.php | 1 + CRM/Badge/Page/AJAX.php | 1 - CRM/Batch/BAO/Batch.php | 39 +- CRM/Batch/Form/Entry.php | 31 +- CRM/Batch/Page/AJAX.php | 10 +- CRM/Bridge/OG/CiviCRM.php | 6 +- CRM/Bridge/OG/Drupal.php | 10 +- CRM/Campaign/BAO/Campaign.php | 44 +- CRM/Campaign/BAO/Query.php | 30 +- CRM/Campaign/BAO/Survey.php | 54 +- CRM/Campaign/Config.php | 3 +- CRM/Campaign/Form/Campaign.php | 16 +- CRM/Campaign/Form/Petition.php | 4 +- CRM/Campaign/Form/Petition/Signature.php | 26 +- CRM/Campaign/Form/Search.php | 24 +- CRM/Campaign/Form/Search/Campaign.php | 10 +- CRM/Campaign/Form/Search/Petition.php | 4 +- CRM/Campaign/Form/Search/Survey.php | 7 +- CRM/Campaign/Form/Survey.php | 16 +- CRM/Campaign/Form/Survey/Main.php | 8 +- CRM/Campaign/Form/Survey/Questions.php | 4 +- CRM/Campaign/Form/Survey/Results.php | 16 +- CRM/Campaign/Form/Survey/TabHeader.php | 8 +- CRM/Campaign/Form/SurveyType.php | 4 +- CRM/Campaign/Form/Task.php | 12 +- CRM/Campaign/Form/Task/Interview.php | 59 +- CRM/Campaign/Form/Task/Release.php | 8 +- CRM/Campaign/Form/Task/Reserve.php | 40 +- CRM/Campaign/Info.php | 24 +- CRM/Campaign/Page/AJAX.php | 93 ++- CRM/Campaign/Page/DashBoard.php | 28 +- CRM/Campaign/Page/Petition/Confirm.php | 12 +- CRM/Campaign/Page/Petition/ThankYou.php | 6 +- CRM/Campaign/Page/Survey.php | 4 +- CRM/Campaign/Page/SurveyType.php | 4 +- CRM/Campaign/Page/Vote.php | 18 +- CRM/Campaign/PseudoConstant.php | 2 +- CRM/Campaign/Selector/Search.php | 16 +- CRM/Campaign/Task.php | 4 +- CRM/Case/Audit/Audit.php | 13 +- CRM/Case/BAO/Query.php | 4 +- CRM/Case/Config.php | 3 +- CRM/Case/Form/Activity.php | 8 +- .../Form/Activity/ChangeCaseStartDate.php | 14 +- CRM/Case/Form/Activity/ChangeCaseStatus.php | 2 +- CRM/Case/Form/Activity/ChangeCaseType.php | 2 +- CRM/Case/Form/Activity/OpenCase.php | 13 +- CRM/Case/Form/ActivityView.php | 8 +- CRM/Case/Form/Case.php | 9 +- CRM/Case/Form/CaseView.php | 36 +- CRM/Case/Form/CustomData.php | 6 +- CRM/Case/Form/EditClient.php | 4 +- CRM/Case/Form/Report.php | 2 +- CRM/Case/Form/Search.php | 6 +- CRM/Case/Form/Task.php | 4 +- CRM/Case/Form/Task/SearchTaskHookSample.php | 4 +- CRM/Case/Info.php | 15 +- CRM/Case/Page/AJAX.php | 10 +- CRM/Case/Page/CaseDetails.php | 4 +- CRM/Case/Page/DashBoard.php | 4 +- CRM/Case/Page/Tab.php | 6 +- CRM/Case/Selector/Search.php | 4 +- CRM/Case/XMLProcessor/Process.php | 32 +- CRM/Case/XMLProcessor/Report.php | 39 +- CRM/Case/XMLRepository.php | 2 +- CRM/Contact/BAO/Contact/Location.php | 2 +- CRM/Contact/BAO/Contact/Optimizer.php | 36 +- CRM/Contact/BAO/Contact/Permission.php | 7 +- CRM/Contact/BAO/Contact/Utils.php | 36 +- CRM/Contact/BAO/ContactType.php | 18 +- CRM/Contact/BAO/DashboardContact.php | 60 +- CRM/Contact/BAO/Group.php | 27 +- CRM/Contact/BAO/GroupContact.php | 2 +- CRM/Contact/BAO/GroupContactCache.php | 45 +- CRM/Contact/BAO/GroupNesting.php | 8 +- CRM/Contact/BAO/GroupNestingCache.php | 6 +- CRM/Contact/BAO/Individual.php | 56 +- CRM/Contact/BAO/ProximityQuery.php | 34 +- CRM/Contact/BAO/Query/Hook.php | 10 +- CRM/Contact/BAO/Relationship.php | 16 +- CRM/Contact/BAO/RelationshipType.php | 7 +- CRM/Contact/BAO/SavedSearch.php | 8 +- CRM/Contact/BAO/SearchCustom.php | 6 +- CRM/Contact/Controller/Search.php | 2 +- CRM/Contact/DAO/Factory.php | 2 +- CRM/Contact/Form/Contact.php | 95 ++- CRM/Contact/Form/CustomData.php | 4 +- CRM/Contact/Form/DedupeRules.php | 18 +- CRM/Contact/Form/Domain.php | 30 +- CRM/Contact/Form/Edit/Address.php | 46 +- .../Form/Edit/CommunicationPreferences.php | 3 +- CRM/Contact/Form/Edit/Email.php | 6 +- CRM/Contact/Form/Edit/IM.php | 6 +- CRM/Contact/Form/Edit/Organization.php | 2 +- CRM/Contact/Form/Edit/Phone.php | 12 +- CRM/Contact/Form/Edit/TagsAndGroups.php | 4 +- CRM/Contact/Form/GroupContact.php | 9 +- CRM/Contact/Form/Inline.php | 4 +- CRM/Contact/Form/Inline/ContactInfo.php | 2 +- CRM/Contact/Form/Inline/ContactName.php | 2 +- CRM/Contact/Form/Inline/Email.php | 8 +- CRM/Contact/Form/Inline/IM.php | 2 +- CRM/Contact/Form/Inline/OpenID.php | 2 +- CRM/Contact/Form/Inline/Phone.php | 8 +- CRM/Contact/Form/Location.php | 4 +- CRM/Contact/Form/Merge.php | 25 +- CRM/Contact/Form/ProfileContact.php | 10 +- CRM/Contact/Form/RelatedContact.php | 33 +- CRM/Contact/Form/Relationship.php | 26 +- CRM/Contact/Form/Search.php | 23 +- CRM/Contact/Form/Search/Advanced.php | 10 +- CRM/Contact/Form/Search/Basic.php | 14 +- CRM/Contact/Form/Search/Builder.php | 30 +- CRM/Contact/Form/Search/Criteria.php | 11 +- CRM/Contact/Form/Search/Custom.php | 11 +- .../Form/Search/Custom/ActivitySearch.php | 19 +- CRM/Contact/Form/Search/Custom/Base.php | 8 +- CRM/Contact/Form/Search/Custom/Basic.php | 8 +- CRM/Contact/Form/Search/Custom/DateAdded.php | 4 +- .../Form/Search/Custom/EventAggregate.php | 11 +- CRM/Contact/Form/Search/Custom/FullText.php | 1 - .../Custom/FullText/AbstractPartialQuery.php | 6 +- .../Search/Custom/FullText/Contribution.php | 2 +- .../Search/Custom/FullText/Membership.php | 2 +- .../Search/Custom/FullText/Participant.php | 2 +- CRM/Contact/Form/Search/Custom/Group.php | 6 +- .../Form/Search/Custom/MultipleValues.php | 22 +- .../Form/Search/Custom/PostalMailing.php | 4 +- CRM/Contact/Form/Search/Custom/PriceSet.php | 16 +- CRM/Contact/Form/Search/Custom/Proximity.php | 18 +- .../Form/Search/Custom/RandomSegment.php | 8 +- CRM/Contact/Form/Search/Custom/Sample.php | 4 +- .../Form/Search/Custom/ZipCodeRange.php | 2 +- CRM/Contact/Form/Task.php | 10 +- CRM/Contact/Form/Task/AddToGroup.php | 33 +- CRM/Contact/Form/Task/AddToHousehold.php | 44 +- CRM/Contact/Form/Task/AddToOrganization.php | 38 +- CRM/Contact/Form/Task/AddToTag.php | 5 +- CRM/Contact/Form/Task/AlterPreferences.php | 2 +- CRM/Contact/Form/Task/Batch.php | 17 +- CRM/Contact/Form/Task/Delete.php | 38 +- CRM/Contact/Form/Task/Email.php | 2 +- CRM/Contact/Form/Task/EmailCommon.php | 30 +- CRM/Contact/Form/Task/Label.php | 40 +- CRM/Contact/Form/Task/LabelCommon.php | 48 +- CRM/Contact/Form/Task/Map.php | 6 +- CRM/Contact/Form/Task/Merge.php | 2 +- CRM/Contact/Form/Task/PDFLetterCommon.php | 14 +- CRM/Contact/Form/Task/PickProfile.php | 5 +- CRM/Contact/Form/Task/Print.php | 23 +- CRM/Contact/Form/Task/ProximityCommon.php | 4 +- CRM/Contact/Form/Task/RemoveFromGroup.php | 18 +- CRM/Contact/Form/Task/RemoveFromTag.php | 12 +- CRM/Contact/Form/Task/Result.php | 4 +- CRM/Contact/Form/Task/SMSCommon.php | 38 +- CRM/Contact/Form/Task/SaveSearch.php | 10 +- CRM/Contact/Form/Task/Unhold.php | 10 +- CRM/Contact/Form/Task/Useradd.php | 8 +- CRM/Contact/Import/Form/DataSource.php | 27 +- CRM/Contact/Import/Form/MapField.php | 117 +-- CRM/Contact/Import/Form/Preview.php | 72 +- CRM/Contact/Import/Form/Summary.php | 16 +- CRM/Contact/Import/ImportJob.php | 20 +- CRM/Contact/Import/Parser.php | 24 +- CRM/Contact/Page/AJAX.php | 84 +- CRM/Contact/Page/DashBoard.php | 4 +- CRM/Contact/Page/DedupeException.php | 6 +- CRM/Contact/Page/DedupeFind.php | 44 +- CRM/Contact/Page/Inline/CustomData.php | 6 +- CRM/Contact/Page/Inline/Website.php | 2 +- CRM/Contact/Page/SavedSearch.php | 10 +- CRM/Contact/Page/View.php | 4 +- CRM/Contact/Page/View/CustomData.php | 4 +- CRM/Contact/Page/View/GroupContact.php | 4 +- CRM/Contact/Page/View/Log.php | 4 +- CRM/Contact/Page/View/Note.php | 11 +- CRM/Contact/Page/View/Print.php | 4 +- CRM/Contact/Page/View/Relationship.php | 5 +- CRM/Contact/Page/View/Summary.php | 20 +- CRM/Contact/Page/View/UserDashBoard.php | 14 +- CRM/Contact/Page/View/Vcard.php | 8 +- CRM/Contact/Selector.php | 66 +- CRM/Contact/Selector/Custom.php | 19 +- CRM/Contribute/BAO/Contribution.php | 6 +- CRM/Contribute/BAO/Contribution/Utils.php | 18 +- CRM/Contribute/BAO/ContributionPage.php | 90 +- CRM/Contribute/BAO/ContributionRecur.php | 24 +- CRM/Contribute/BAO/ContributionSoft.php | 5 +- CRM/Contribute/BAO/Query.php | 78 +- CRM/Contribute/BAO/Widget.php | 35 +- CRM/Contribute/Config.php | 3 +- .../InactiveContributionPageException.php | 2 + CRM/Contribute/Form/AbstractEditPayment.php | 12 +- CRM/Contribute/Form/AdditionalInfo.php | 42 +- CRM/Contribute/Form/AdditionalPayment.php | 14 +- CRM/Contribute/Form/CancelSubscription.php | 32 +- CRM/Contribute/Form/Contribution.php | 18 +- CRM/Contribute/Form/Contribution/Main.php | 70 +- .../Form/Contribution/OnBehalfOf.php | 4 +- CRM/Contribute/Form/Contribution/ThankYou.php | 31 +- CRM/Contribute/Form/ContributionBase.php | 56 +- CRM/Contribute/Form/ContributionCharts.php | 12 +- CRM/Contribute/Form/ContributionPage.php | 50 +- .../Form/ContributionPage/AddProduct.php | 27 +- .../Form/ContributionPage/Amount.php | 44 +- .../Form/ContributionPage/Custom.php | 16 +- .../Form/ContributionPage/Delete.php | 8 +- .../Form/ContributionPage/Premium.php | 8 +- .../Form/ContributionPage/Settings.php | 22 +- .../Form/ContributionPage/TabHeader.php | 33 +- .../Form/ContributionPage/Widget.php | 36 +- CRM/Contribute/Form/ContributionView.php | 10 +- CRM/Contribute/Form/ManagePremiums.php | 20 +- CRM/Contribute/Form/Search.php | 10 +- CRM/Contribute/Form/SearchContribution.php | 12 +- CRM/Contribute/Form/SoftCredit.php | 9 +- CRM/Contribute/Form/Task.php | 6 +- CRM/Contribute/Form/Task/Delete.php | 5 +- CRM/Contribute/Form/Task/Invoice.php | 2 +- CRM/Contribute/Form/Task/PDF.php | 29 +- CRM/Contribute/Form/Task/PDFLetter.php | 2 +- CRM/Contribute/Form/Task/PDFLetterCommon.php | 16 +- CRM/Contribute/Form/Task/PickProfile.php | 8 +- CRM/Contribute/Form/Task/Status.php | 15 +- CRM/Contribute/Form/UpdateBilling.php | 22 +- CRM/Contribute/Form/UpdateSubscription.php | 198 ++--- CRM/Contribute/Import/Form/DataSource.php | 25 +- CRM/Contribute/Import/Form/MapField.php | 17 +- CRM/Contribute/Import/Form/Preview.php | 30 +- CRM/Contribute/Import/Form/Summary.php | 20 +- CRM/Contribute/Import/Parser.php | 16 +- CRM/Contribute/Import/Parser/Contribution.php | 20 +- CRM/Contribute/Info.php | 4 +- CRM/Contribute/Page/ContributionPage.php | 20 +- CRM/Contribute/Page/ContributionRecur.php | 6 +- CRM/Contribute/Page/DashBoard.php | 14 +- CRM/Contribute/Page/ManagePremiums.php | 2 +- CRM/Contribute/Page/Premium.php | 4 +- CRM/Contribute/Page/SubscriptionStatus.php | 7 +- CRM/Contribute/Page/Tab.php | 17 +- CRM/Contribute/Page/UserDashboard.php | 4 +- CRM/Contribute/PseudoConstant.php | 18 +- CRM/Contribute/Selector/Search.php | 14 +- CRM/Core/Action.php | 12 +- CRM/Core/BAO/ActionSchedule.php | 63 +- CRM/Core/BAO/Address.php | 85 +- CRM/Core/BAO/Block.php | 10 +- CRM/Core/BAO/CMSUser.php | 108 +-- CRM/Core/BAO/CustomGroup.php | 10 +- CRM/Core/BAO/CustomOption.php | 16 +- CRM/Core/BAO/CustomQuery.php | 24 +- CRM/Core/BAO/CustomValue.php | 16 +- CRM/Core/BAO/CustomValueTable.php | 48 +- CRM/Core/BAO/Dashboard.php | 20 +- CRM/Core/BAO/Discount.php | 8 +- CRM/Core/BAO/Domain.php | 4 +- CRM/Core/BAO/Email.php | 12 +- CRM/Core/BAO/EntityTag.php | 20 +- CRM/Core/BAO/File.php | 10 +- CRM/Core/BAO/FinancialTrxn.php | 15 +- CRM/Core/BAO/IM.php | 4 +- CRM/Core/BAO/LabelFormat.php | 10 +- CRM/Core/BAO/Location.php | 25 +- CRM/Core/BAO/Log.php | 8 +- CRM/Core/BAO/MailSettings.php | 6 +- CRM/Core/BAO/Mapping.php | 84 +- CRM/Core/BAO/MessageTemplate.php | 73 +- CRM/Core/BAO/Navigation.php | 41 +- CRM/Core/BAO/Note.php | 32 +- CRM/Core/BAO/OpenID.php | 4 +- CRM/Core/BAO/OptionValue.php | 40 +- CRM/Core/BAO/PaperSize.php | 4 +- CRM/Core/BAO/PdfFormat.php | 4 +- CRM/Core/BAO/Phone.php | 4 +- CRM/Core/BAO/Preferences.php | 2 +- CRM/Core/BAO/PrevNextCache.php | 16 +- CRM/Core/BAO/RecurringEntity.php | 100 +-- CRM/Core/BAO/SchemaHandler.php | 25 +- CRM/Core/BAO/Setting.php | 44 +- CRM/Core/BAO/Tag.php | 36 +- CRM/Core/BAO/UFField.php | 28 +- CRM/Core/BAO/UFJoin.php | 14 +- CRM/Core/BAO/UFMatch.php | 38 +- CRM/Core/BAO/Website.php | 8 +- CRM/Core/BAO/WordReplacement.php | 5 +- CRM/Core/Block.php | 70 +- CRM/Core/CodeGen/Config.php | 6 +- CRM/Core/CodeGen/Main.php | 6 +- CRM/Core/CodeGen/Specification.php | 18 +- CRM/Core/Component.php | 4 +- CRM/Core/Component/Config.php | 1 - CRM/Core/Component/Info.php | 7 +- CRM/Core/Config.php | 7 +- CRM/Core/Config/Defaults.php | 7 +- CRM/Core/Config/Variables.php | 8 +- CRM/Core/Controller.php | 17 +- CRM/Core/DAO.php | 132 +-- CRM/Core/DAO/Factory.php | 2 +- CRM/Core/DAO/permissions.php | 8 +- CRM/Core/EntityReference.php | 1 + CRM/Core/Error.php | 36 +- CRM/Core/Exception.php | 1 - CRM/Core/FileSearchInterface.php | 1 + CRM/Core/Form.php | 99 ++- CRM/Core/Form/Date.php | 13 +- CRM/Core/Form/RecurringEntity.php | 99 ++- CRM/Core/Form/Renderer.php | 5 +- CRM/Core/I18n.php | 16 +- CRM/Core/I18n/Form.php | 16 +- CRM/Core/I18n/Schema.php | 28 +- CRM/Core/I18n/SchemaStructure_2_2_0.php | 2 +- CRM/Core/I18n/SchemaStructure_3_0_alpha1.php | 2 +- CRM/Core/I18n/SchemaStructure_3_1_alpha1.php | 2 +- CRM/Core/I18n/SchemaStructure_4_2_alpha1.php | 95 +-- CRM/Core/I18n/SchemaStructure_4_3_1.php | 69 +- CRM/Core/I18n/SchemaStructure_4_5_alpha1.php | 69 +- CRM/Core/I18n/SchemaStructure_4_5_beta2.php | 73 +- CRM/Core/IDS.php | 10 +- CRM/Core/Invoke.php | 7 +- CRM/Core/JobManager.php | 16 +- CRM/Core/Key.php | 4 +- CRM/Core/ManagedEntities.php | 4 +- CRM/Core/Menu.php | 35 +- CRM/Core/OptionGroup.php | 32 +- CRM/Core/OptionValue.php | 10 +- CRM/Core/Page.php | 16 +- CRM/Core/Page/AJAX/Location.php | 96 ++- CRM/Core/Page/AJAX/RecurringEntity.php | 8 +- CRM/Core/Page/Angular.php | 36 +- CRM/Core/Page/Basic.php | 26 +- CRM/Core/Page/File.php | 8 +- CRM/Core/Payment.php | 26 +- CRM/Core/Payment/AuthorizeNet.php | 44 +- CRM/Core/Payment/AuthorizeNetIPN.php | 2 +- CRM/Core/Payment/BaseIPN.php | 109 ++- CRM/Core/Payment/Dummy.php | 20 +- CRM/Core/Payment/Elavon.php | 43 +- CRM/Core/Payment/FirstData.php | 28 +- CRM/Core/Payment/Form.php | 8 +- CRM/Core/Payment/Google.php | 30 +- CRM/Core/Payment/GoogleIPN.php | 43 +- CRM/Core/Payment/IATS.php | 8 +- CRM/Core/Payment/Moneris.php | 6 +- CRM/Core/Payment/PayJunction.php | 8 +- CRM/Core/Payment/PayPalIPN.php | 6 +- CRM/Core/Payment/PayPalImpl.php | 43 +- CRM/Core/Payment/PayPalProIPN.php | 37 +- CRM/Core/Payment/PayflowPro.php | 3 +- CRM/Core/Payment/PaymentExpressIPN.php | 72 +- CRM/Core/Payment/ProcessorForm.php | 3 +- CRM/Core/Payment/Realex.php | 12 +- CRM/Core/Payment/eWAY.php | 78 +- CRM/Core/Permission/Base.php | 1 + CRM/Core/Permission/DrupalBase.php | 4 +- CRM/Core/Permission/WordPress.php | 1 + CRM/Core/PseudoConstant.php | 35 +- CRM/Core/QuickForm/Action/Upload.php | 5 +- CRM/Core/QuickForm/GroupMultiSelect.php | 61 +- CRM/Core/Reference/Dynamic.php | 2 - CRM/Core/Reference/OptionValue.php | 4 +- CRM/Core/Region.php | 54 +- CRM/Core/Report/Excel.php | 8 +- CRM/Core/Resources.php | 51 +- CRM/Core/ScheduledJob.php | 10 +- CRM/Core/SelectValues.php | 35 +- CRM/Core/Selector/Controller.php | 10 +- CRM/Core/Session.php | 2 +- CRM/Core/ShowHideBlocks.php | 2 +- CRM/Core/Smarty.php | 8 +- CRM/Core/Smarty/plugins/block.edit.php | 2 +- CRM/Core/Smarty/plugins/block.htxt.php | 2 +- CRM/Core/Smarty/plugins/block.localize.php | 2 +- CRM/Core/Smarty/plugins/block.serialize.php | 2 +- CRM/Core/Smarty/plugins/block.ts.php | 2 +- CRM/Core/Smarty/plugins/function.crmKey.php | 2 +- .../plugins/function.crmNavigationMenu.php | 2 +- CRM/Core/Smarty/plugins/function.docURL.php | 2 +- CRM/Core/Smarty/plugins/function.help.php | 2 +- .../Smarty/plugins/function.sectionTotal.php | 2 +- .../function.simpleActivityContacts.php | 14 +- .../Smarty/plugins/modifier.crmAddClass.php | 2 +- .../Smarty/plugins/modifier.crmBtnType.php | 2 +- CRM/Core/Smarty/plugins/modifier.crmDate.php | 2 +- .../Smarty/plugins/modifier.crmDelete.php | 2 +- .../Smarty/plugins/modifier.crmICalDate.php | 2 +- .../Smarty/plugins/modifier.crmICalText.php | 2 +- .../Smarty/plugins/modifier.crmInsert.php | 2 +- CRM/Core/Smarty/plugins/modifier.crmMoney.php | 2 +- .../plugins/modifier.crmNumberFormat.php | 6 +- .../Smarty/plugins/modifier.crmReplace.php | 2 +- .../plugins/modifier.crmStripAlternatives.php | 2 +- CRM/Core/Smarty/plugins/modifier.htmlize.php | 2 +- CRM/Core/Smarty/plugins/modifier.json.php | 2 +- .../Smarty/plugins/modifier.mb_truncate.php | 2 +- .../plugins/prefilter.resetExtScope.php | 2 +- CRM/Core/TableHierarchy.php | 2 +- CRM/Custom/Form/ChangeFieldType.php | 25 +- CRM/Custom/Form/Field.php | 76 +- CRM/Custom/Form/Group.php | 51 +- CRM/Custom/Form/MoveField.php | 17 +- CRM/Custom/Form/Option.php | 6 +- CRM/Custom/Form/Preview.php | 2 +- CRM/Custom/Import/Form/DataSource.php | 21 +- CRM/Custom/Import/Form/MapField.php | 21 +- CRM/Custom/Import/Form/Preview.php | 28 +- CRM/Custom/Import/Parser.php | 11 +- CRM/Custom/Import/Parser/Api.php | 11 +- CRM/Custom/Page/Group.php | 4 +- CRM/Custom/Page/Option.php | 18 +- CRM/Dashlet/Page/AllCases.php | 4 +- CRM/Dashlet/Page/CaseDashboard.php | 2 +- CRM/Dashlet/Page/MyCases.php | 4 +- CRM/Dedupe/BAO/QueryBuilder.php | 4 +- .../BAO/QueryBuilder/IndividualGeneral.php | 4 +- .../BAO/QueryBuilder/IndividualSupervised.php | 4 +- .../QueryBuilder/IndividualUnsupervised.php | 4 +- CRM/Dedupe/BAO/Rule.php | 10 +- CRM/Dedupe/BAO/RuleGroup.php | 31 +- CRM/Dedupe/Finder.php | 24 +- CRM/Dedupe/Merger.php | 61 +- CRM/Event/BAO/Event.php | 22 +- CRM/Event/BAO/ParticipantPayment.php | 12 +- CRM/Event/BAO/ParticipantStatusType.php | 4 +- CRM/Event/BAO/Query.php | 2 +- CRM/Event/Badge.php | 26 +- CRM/Event/Badge/Logo.php | 34 +- CRM/Event/Badge/Logo5395.php | 34 +- CRM/Event/Badge/NameTent.php | 28 +- CRM/Event/Cart/BAO/Cart.php | 8 +- CRM/Event/Cart/BAO/Conference.php | 4 +- CRM/Event/Cart/BAO/EventInCart.php | 4 +- CRM/Event/Cart/Form/Cart.php | 6 +- .../Cart/Form/Checkout/ConferenceEvents.php | 12 +- .../Form/Checkout/ParticipantsAndPrices.php | 18 +- CRM/Event/Cart/Form/Checkout/Payment.php | 40 +- CRM/Event/Cart/Form/MerParticipant.php | 10 +- CRM/Event/Cart/Page/AddToCart.php | 5 +- CRM/Event/Cart/Page/CheckoutAJAX.php | 6 +- CRM/Event/Cart/Page/RemoveFromCart.php | 8 +- CRM/Event/Cart/StateMachine/Checkout.php | 4 +- CRM/Event/Config.php | 3 +- CRM/Event/Form/EventFees.php | 30 +- CRM/Event/Form/ManageEvent.php | 27 +- CRM/Event/Form/ManageEvent/Conference.php | 7 +- CRM/Event/Form/ManageEvent/Delete.php | 4 +- CRM/Event/Form/ManageEvent/EventInfo.php | 8 +- CRM/Event/Form/ManageEvent/Fee.php | 33 +- CRM/Event/Form/ManageEvent/Location.php | 10 +- CRM/Event/Form/ManageEvent/Registration.php | 31 +- CRM/Event/Form/ManageEvent/Repeat.php | 30 +- CRM/Event/Form/ManageEvent/TabHeader.php | 11 +- CRM/Event/Form/Participant.php | 92 +- CRM/Event/Form/ParticipantFeeSelection.php | 7 +- CRM/Event/Form/ParticipantView.php | 19 +- CRM/Event/Form/Registration.php | 56 +- .../Registration/AdditionalParticipant.php | 54 +- CRM/Event/Form/Registration/Confirm.php | 28 +- .../Form/Registration/ParticipantConfirm.php | 40 +- CRM/Event/Form/Registration/Register.php | 21 +- CRM/Event/Form/Registration/ThankYou.php | 18 +- CRM/Event/Form/Search.php | 8 +- CRM/Event/Form/SearchEvent.php | 12 +- CRM/Event/Form/Task.php | 4 +- CRM/Event/Form/Task/AddToGroup.php | 30 +- CRM/Event/Form/Task/Badge.php | 7 +- CRM/Event/Form/Task/Batch.php | 6 +- CRM/Event/Form/Task/Delete.php | 7 +- CRM/Event/Form/Task/ParticipantStatus.php | 3 +- CRM/Event/Form/Task/PickProfile.php | 3 +- CRM/Event/Import/Form/DataSource.php | 25 +- CRM/Event/Import/Form/MapField.php | 67 +- CRM/Event/Import/Form/Preview.php | 23 +- CRM/Event/Import/Form/Summary.php | 14 +- CRM/Event/Import/Parser.php | 11 +- CRM/Event/Import/Parser/Participant.php | 20 +- CRM/Event/Page/EventInfo.php | 13 +- CRM/Event/Page/ICalendar.php | 14 +- CRM/Event/Page/ManageEvent.php | 24 +- CRM/Event/Page/ParticipantListing.php | 11 +- .../ParticipantListing/NameStatusAndDate.php | 10 +- CRM/Event/Page/ParticipantListing/Simple.php | 4 +- CRM/Event/Page/Tab.php | 9 +- CRM/Event/PseudoConstant.php | 2 +- CRM/Event/Selector/Search.php | 14 +- CRM/Event/StateMachine/Registration.php | 2 +- CRM/Event/Task.php | 10 +- CRM/Export/BAO/Export.php | 2 +- CRM/Export/Form/Select.php | 20 +- CRM/Extension/Browser.php | 8 +- CRM/Extension/Downloader.php | 8 +- CRM/Extension/Info.php | 16 +- CRM/Extension/Manager.php | 6 +- CRM/Extension/Manager/Payment.php | 39 +- CRM/Extension/Manager/Report.php | 12 +- CRM/Extension/Manager/Search.php | 12 +- CRM/Financial/BAO/ExportFormat.php | 1 - CRM/Financial/BAO/ExportFormat/CSV.php | 2 +- CRM/Financial/BAO/FinancialAccount.php | 3 +- CRM/Financial/BAO/FinancialItem.php | 41 +- CRM/Financial/BAO/FinancialType.php | 1 - CRM/Financial/BAO/FinancialTypeAccount.php | 1 - CRM/Financial/BAO/PaymentProcessor.php | 57 +- CRM/Financial/Form/BatchTransaction.php | 15 +- CRM/Financial/Form/FinancialAccount.php | 13 +- CRM/Financial/Form/FinancialBatch.php | 9 +- CRM/Financial/Form/FinancialTypeAccount.php | 55 +- CRM/Financial/Form/Search.php | 3 +- CRM/Financial/Page/AJAX.php | 91 +- CRM/Financial/Page/BatchTransaction.php | 13 +- CRM/Financial/Page/FinancialAccount.php | 22 +- CRM/Financial/Page/FinancialBatch.php | 3 +- CRM/Financial/Page/FinancialType.php | 34 +- CRM/Financial/Page/FinancialTypeAccount.php | 4 +- CRM/Friend/BAO/Friend.php | 2 +- CRM/Friend/Form.php | 14 +- CRM/Grant/BAO/Grant.php | 7 +- CRM/Grant/BAO/Query.php | 10 +- CRM/Grant/Config.php | 3 +- CRM/Grant/Form/Grant.php | 46 +- CRM/Grant/Form/GrantView.php | 16 +- CRM/Grant/Form/Search.php | 6 +- CRM/Grant/Form/Task.php | 2 +- CRM/Grant/Info.php | 15 +- CRM/Grant/Page/Tab.php | 13 +- CRM/Grant/Selector/Search.php | 8 +- CRM/Grant/Task.php | 4 +- CRM/Group/Form/Edit.php | 25 +- CRM/Group/Form/Search.php | 12 +- CRM/Group/Page/AJAX.php | 31 +- CRM/Import/DataSource/CSV.php | 15 +- CRM/Import/Form/MapField.php | 4 +- CRM/Import/Parser.php | 2 - CRM/Logging/Differ.php | 90 +- CRM/Logging/ReportDetail.php | 53 +- CRM/Logging/Reverter.php | 12 +- CRM/Logging/Schema.php | 43 +- CRM/Mailing/BAO/Mailing.php | 280 ++++--- CRM/Mailing/BAO/MailingAB.php | 2 +- CRM/Mailing/BAO/MailingJob.php | 76 +- CRM/Mailing/BAO/Query.php | 19 +- CRM/Mailing/BAO/TrackableURL.php | 8 +- CRM/Mailing/Event/BAO/Bounce.php | 36 +- CRM/Mailing/Event/BAO/Confirm.php | 6 +- CRM/Mailing/Event/BAO/Delivered.php | 30 +- CRM/Mailing/Event/BAO/Opened.php | 24 +- CRM/Mailing/Event/BAO/Queue.php | 34 +- CRM/Mailing/Event/BAO/Subscribe.php | 21 +- CRM/Mailing/Event/BAO/TrackableURLOpen.php | 20 +- CRM/Mailing/Event/BAO/Unsubscribe.php | 2 +- CRM/Mailing/Form/Approve.php | 6 +- CRM/Mailing/Form/Browse.php | 4 +- CRM/Mailing/Form/Component.php | 17 +- CRM/Mailing/Form/ForwardMailing.php | 42 +- CRM/Mailing/Form/Group.php | 47 +- CRM/Mailing/Form/Optout.php | 2 +- CRM/Mailing/Form/Schedule.php | 22 +- CRM/Mailing/Form/Search.php | 31 +- CRM/Mailing/Form/Subscribe.php | 13 +- CRM/Mailing/Form/Task.php | 2 +- CRM/Mailing/Form/Test.php | 26 +- CRM/Mailing/Form/Unsubscribe.php | 4 +- CRM/Mailing/Form/Upload.php | 47 +- CRM/Mailing/Info.php | 25 +- CRM/Mailing/MailStore.php | 11 +- CRM/Mailing/MailStore/Imap.php | 4 +- CRM/Mailing/MailStore/Localdir.php | 18 +- CRM/Mailing/MailStore/Maildir.php | 22 +- CRM/Mailing/MailStore/Mbox.php | 14 +- CRM/Mailing/MailStore/Pop3.php | 14 +- CRM/Mailing/Page/AJAX.php | 26 +- CRM/Mailing/Page/Browse.php | 4 +- CRM/Mailing/Page/Common.php | 4 +- CRM/Mailing/Page/Confirm.php | 4 +- CRM/Mailing/Page/Report.php | 4 +- CRM/Mailing/Page/Tab.php | 2 +- CRM/Mailing/Page/View.php | 2 +- CRM/Mailing/PseudoConstant.php | 10 +- CRM/Mailing/Selector/Browse.php | 26 +- CRM/Mailing/Selector/Event.php | 44 +- CRM/Mailing/Selector/Search.php | 42 +- CRM/Member/BAO/Membership.php | 46 +- CRM/Member/BAO/MembershipBlock.php | 1 + CRM/Member/BAO/MembershipPayment.php | 12 +- CRM/Member/BAO/MembershipStatus.php | 21 +- CRM/Member/BAO/MembershipType.php | 76 +- CRM/Member/Config.php | 3 +- CRM/Member/Form.php | 6 +- CRM/Member/Form/Membership.php | 19 +- CRM/Member/Form/MembershipBlock.php | 41 +- CRM/Member/Form/MembershipRenewal.php | 51 +- CRM/Member/Form/MembershipStatus.php | 6 +- CRM/Member/Form/MembershipType.php | 34 +- CRM/Member/Form/Search.php | 6 +- CRM/Member/Form/Task.php | 6 +- CRM/Member/Form/Task/Batch.php | 2 +- CRM/Member/Form/Task/Label.php | 9 +- CRM/Member/Form/Task/PickProfile.php | 8 +- CRM/Member/Import/Form/DataSource.php | 25 +- CRM/Member/Import/Form/MapField.php | 49 +- CRM/Member/Import/Form/Preview.php | 23 +- CRM/Member/Import/Form/Summary.php | 14 +- CRM/Member/Import/Parser.php | 11 +- CRM/Member/Import/Parser/Membership.php | 27 +- CRM/Member/Info.php | 6 +- CRM/Member/Page/DashBoard.php | 58 +- CRM/Member/Page/Tab.php | 13 +- CRM/Member/Page/UserDashboard.php | 10 +- CRM/Member/PseudoConstant.php | 2 +- CRM/Member/Selector/Search.php | 8 +- CRM/Note/Form/Note.php | 6 +- CRM/PCP/BAO/PCP.php | 6 +- CRM/PCP/Form/Campaign.php | 10 +- CRM/PCP/Form/Contribute.php | 4 +- CRM/PCP/Form/Event.php | 14 +- CRM/PCP/Form/PCP.php | 4 +- CRM/PCP/Form/PCPAccount.php | 12 +- CRM/PCP/Page/PCP.php | 4 +- CRM/PCP/Page/PCPInfo.php | 37 +- CRM/Pledge/BAO/Pledge.php | 113 ++- CRM/Pledge/BAO/PledgeBlock.php | 30 +- CRM/Pledge/BAO/PledgePayment.php | 10 +- CRM/Pledge/BAO/Query.php | 2 +- CRM/Pledge/Config.php | 3 +- CRM/Pledge/Form/Payment.php | 2 +- CRM/Pledge/Form/Pledge.php | 52 +- CRM/Pledge/Form/Search.php | 6 +- CRM/Pledge/Form/Task.php | 2 +- CRM/Pledge/Form/Task/Delete.php | 5 +- CRM/Pledge/Info.php | 17 +- CRM/Pledge/Page/AJAX.php | 13 +- CRM/Pledge/Page/DashBoard.php | 24 +- CRM/Pledge/Page/Tab.php | 4 +- CRM/Pledge/Selector/Search.php | 4 +- CRM/Pledge/Task.php | 4 +- CRM/Price/BAO/LineItem.php | 5 +- CRM/Price/BAO/PriceField.php | 69 +- CRM/Price/BAO/PriceFieldValue.php | 2 +- CRM/Price/BAO/PriceSet.php | 61 +- CRM/Price/Form/DeleteSet.php | 8 +- CRM/Price/Form/Field.php | 22 +- CRM/Price/Form/Option.php | 13 +- CRM/Price/Form/Preview.php | 20 +- CRM/Price/Form/Set.php | 23 +- CRM/Price/Page/Field.php | 3 +- CRM/Price/Page/Option.php | 15 +- CRM/Price/Page/Set.php | 6 +- CRM/Profile/Form.php | 98 ++- CRM/Profile/Form/Edit.php | 4 +- CRM/Profile/Form/Search.php | 16 +- CRM/Profile/Page/Dynamic.php | 7 +- CRM/Profile/Page/Listings.php | 32 +- .../Page/MultipleRecordFieldsListing.php | 20 +- CRM/Profile/Page/View.php | 5 +- CRM/Profile/Selector/Listings.php | 67 +- CRM/Queue/ErrorPolicy.php | 12 +- CRM/Queue/Queue/Memory.php | 8 +- CRM/Report/BAO/Hook.php | 10 +- CRM/Report/BAO/ReportInstance.php | 12 +- CRM/Report/Config.php | 3 +- CRM/Report/Form.php | 6 +- CRM/Report/Form/Activity.php | 50 +- CRM/Report/Form/ActivitySummary.php | 6 +- CRM/Report/Form/Contact/CurrentEmployer.php | 6 +- CRM/Report/Form/Contact/LoggingDetail.php | 4 +- CRM/Report/Form/Contact/LoggingSummary.php | 25 +- CRM/Report/Form/Contact/Relationship.php | 6 +- CRM/Report/Form/Contribute/Bookkeeping.php | 2 +- .../Form/Contribute/HouseholdSummary.php | 6 +- CRM/Report/Form/Contribute/LoggingDetail.php | 4 +- CRM/Report/Form/Contribute/Lybunt.php | 4 +- CRM/Report/Form/Contribute/Recur.php | 13 +- CRM/Report/Form/Contribute/Repeat.php | 6 +- CRM/Report/Form/Contribute/Sybunt.php | 4 +- CRM/Report/Form/Contribute/TopDonor.php | 4 +- CRM/Report/Form/Event/Income.php | 8 +- CRM/Report/Form/Instance.php | 15 +- CRM/Report/Form/Mailing/Summary.php | 29 +- CRM/Report/Form/Pledge/Detail.php | 4 +- CRM/Report/Form/Register.php | 5 +- CRM/Report/Page/Instance.php | 2 +- CRM/Report/Page/InstanceList.php | 4 +- CRM/Report/Page/Options.php | 4 +- CRM/Report/Page/TemplateList.php | 4 +- CRM/Report/Utils/Get.php | 4 +- CRM/Report/Utils/Report.php | 30 +- CRM/SMS/BAO/Provider.php | 4 +- CRM/SMS/Form/Group.php | 25 +- CRM/SMS/Form/Provider.php | 5 +- CRM/SMS/Form/Schedule.php | 13 +- CRM/SMS/Form/Upload.php | 17 +- CRM/SMS/Page/Callback.php | 3 +- CRM/SMS/Page/Provider.php | 6 +- CRM/SMS/Provider.php | 41 +- CRM/UF/Form/AdvanceSetting.php | 9 +- CRM/UF/Form/Field.php | 82 +- CRM/UF/Form/Group.php | 27 +- CRM/UF/Page/Field.php | 8 +- CRM/UF/Page/ProfileEditor.php | 5 +- CRM/Upgrade/Form.php | 49 +- CRM/Upgrade/Headless.php | 6 +- CRM/Upgrade/Incremental/Legacy.php | 47 +- CRM/Upgrade/Incremental/php/FourFive.php | 8 +- CRM/Upgrade/Incremental/php/FourFour.php | 13 +- CRM/Upgrade/Incremental/php/FourSix.php | 3 +- CRM/Upgrade/Incremental/php/FourThree.php | 6 +- CRM/Upgrade/Incremental/php/FourTwo.php | 119 +-- CRM/Upgrade/Incremental/php/ThreeFour.php | 66 +- CRM/Upgrade/Incremental/php/ThreeThree.php | 25 +- CRM/Upgrade/Incremental/php/ThreeTwo.php | 11 +- CRM/Upgrade/Page/Cleanup.php | 24 +- CRM/Upgrade/Page/Upgrade.php | 2 +- CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php | 46 +- .../Snapshot/V4p2/Price/BAO/LineItem.php | 2 +- CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php | 78 +- CRM/Upgrade/Snapshot/V4p2/Price/DAO/Field.php | 788 +++++++++--------- .../Snapshot/V4p2/Price/DAO/FieldValue.php | 572 +++++++------ .../Snapshot/V4p2/Price/DAO/LineItem.php | 524 ++++++------ CRM/Upgrade/Snapshot/V4p2/Price/DAO/Set.php | 572 +++++++------ .../Snapshot/V4p2/Price/DAO/SetEntity.php | 374 +++++---- CRM/Utils/API/HTMLInputCoder.php | 1 - CRM/Utils/Address.php | 4 +- CRM/Utils/Address/BatchUpdate.php | 11 +- CRM/Utils/Address/USPS.php | 4 +- CRM/Utils/Cache/APCcache.php | 2 +- CRM/Utils/Cache/Memcache.php | 6 +- CRM/Utils/Cache/Memcached.php | 8 +- CRM/Utils/Cache/NoCache.php | 1 - CRM/Utils/Cache/SerializeCache.php | 4 +- CRM/Utils/Cache/SqlGroup.php | 2 +- CRM/Utils/Check/Case.php | 2 +- CRM/Utils/Check/Security.php | 4 +- CRM/Utils/Crypt.php | 8 +- CRM/Utils/Date.php | 294 +++---- CRM/Utils/DeprecatedUtils.php | 23 +- CRM/Utils/File.php | 17 +- CRM/Utils/Hook.php | 2 +- CRM/Utils/Hook/Joomla.php | 4 +- CRM/Utils/Hook/WordPress.php | 4 +- CRM/Utils/JSON.php | 2 +- CRM/Utils/Mail.php | 22 +- CRM/Utils/Mail/EmailProcessor.php | 24 +- CRM/Utils/Mail/Incoming.php | 18 +- CRM/Utils/Migrate/Export.php | 14 +- CRM/Utils/Migrate/ExportJSON.php | 48 +- CRM/Utils/Migrate/Import.php | 29 +- CRM/Utils/Migrate/ImportJSON.php | 4 +- CRM/Utils/Money.php | 5 +- CRM/Utils/OpenFlashChart.php | 27 +- CRM/Utils/PDF/Utils.php | 26 +- CRM/Utils/Pager.php | 16 +- CRM/Utils/PagerAToZ.php | 29 +- CRM/Utils/REST.php | 32 +- CRM/Utils/ReCAPTCHA.php | 2 +- CRM/Utils/Recent.php | 5 +- CRM/Utils/Rule.php | 10 +- CRM/Utils/Sort.php | 12 +- CRM/Utils/String.php | 25 +- CRM/Utils/Sunlight.php | 8 +- CRM/Utils/System.php | 55 +- CRM/Utils/System/Base.php | 1 + CRM/Utils/System/Drupal.php | 27 +- CRM/Utils/System/Drupal6.php | 36 +- CRM/Utils/System/Drupal8.php | 14 +- CRM/Utils/System/DrupalBase.php | 18 +- CRM/Utils/System/Joomla.php | 37 +- CRM/Utils/System/WordPress.php | 30 +- CRM/Utils/Token.php | 99 ++- CRM/Utils/Tree.php | 10 +- CRM/Utils/Type.php | 54 +- CRM/Utils/Verp.php | 4 +- CRM/Utils/VersionCheck.php | 9 +- CRM/Utils/Weight.php | 80 +- CRM/Utils/Wrapper.php | 20 +- CRM/Utils/XML.php | 3 +- 853 files changed, 10822 insertions(+), 8409 deletions(-) diff --git a/CRM/ACL/BAO/ACL.php b/CRM/ACL/BAO/ACL.php index 042c2113ea..c4aed716cd 100644 --- a/CRM/ACL/BAO/ACL.php +++ b/CRM/ACL/BAO/ACL.php @@ -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); } } diff --git a/CRM/ACL/BAO/Cache.php b/CRM/ACL/BAO/Cache.php index 56c8bd5d01..8771235220 100644 --- a/CRM/ACL/BAO/Cache.php +++ b/CRM/ACL/BAO/Cache.php @@ -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"); }); } diff --git a/CRM/ACL/Form/ACL.php b/CRM/ACL/Form/ACL.php index cc6c182c28..1769504d64 100644 --- a/CRM/ACL/Form/ACL.php +++ b/CRM/ACL/Form/ACL.php @@ -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); diff --git a/CRM/ACL/Form/ACLBasic.php b/CRM/ACL/Form/ACLBasic.php index 1a00bb9103..d38cc2735c 100644 --- a/CRM/ACL/Form/ACLBasic.php +++ b/CRM/ACL/Form/ACLBasic.php @@ -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) { diff --git a/CRM/ACL/Form/WordPress/Permissions.php b/CRM/ACL/Form/WordPress/Permissions.php index 230d215e08..f4c3e14fd0 100644 --- a/CRM/ACL/Form/WordPress/Permissions.php +++ b/CRM/ACL/Form/WordPress/Permissions.php @@ -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') ); } diff --git a/CRM/ACL/Page/ACL.php b/CRM/ACL/Page/ACL.php index b232e99fe5..b711625c5e 100644 --- a/CRM/ACL/Page/ACL.php +++ b/CRM/ACL/Page/ACL.php @@ -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(); diff --git a/CRM/ACL/Page/ACLBasic.php b/CRM/ACL/Page/ACLBasic.php index 2fc65be571..ad580950f0 100644 --- a/CRM/ACL/Page/ACLBasic.php +++ b/CRM/ACL/Page/ACLBasic.php @@ -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 ? diff --git a/CRM/ACL/Page/EntityRole.php b/CRM/ACL/Page/EntityRole.php index 0ce29ba230..aaaa9d4f72 100644 --- a/CRM/ACL/Page/EntityRole.php +++ b/CRM/ACL/Page/EntityRole.php @@ -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')); diff --git a/CRM/Activity/BAO/ActivityContact.php b/CRM/Activity/BAO/ActivityContact.php index 6f186b9427..329f14f8ed 100644 --- a/CRM/Activity/BAO/ActivityContact.php +++ b/CRM/Activity/BAO/ActivityContact.php @@ -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; } diff --git a/CRM/Activity/BAO/ICalendar.php b/CRM/Activity/BAO/ICalendar.php index d81317c027..582a322013 100644 --- a/CRM/Activity/BAO/ICalendar.php +++ b/CRM/Activity/BAO/ICalendar.php @@ -97,7 +97,7 @@ class CRM_Activity_BAO_ICalendar { 'fileName' => $icsFileName, 'cleanName' => $icsFileName, 'fullPath' => $this->icsfile, - ); + ); return 'activity_ics'; } } diff --git a/CRM/Activity/BAO/Query.php b/CRM/Activity/BAO/Query.php index 2685b8baf6..243200697c 100644 --- a/CRM/Activity/BAO/Query.php +++ b/CRM/Activity/BAO/Query.php @@ -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; } } diff --git a/CRM/Activity/Form/Activity.php b/CRM/Activity/Form/Activity.php index 66039852fe..bbecf8f4dc 100644 --- a/CRM/Activity/Form/Activity.php +++ b/CRM/Activity/Form/Activity.php @@ -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)); diff --git a/CRM/Activity/Form/ActivityView.php b/CRM/Activity/Form/ActivityView.php index 4c354edca9..cee0767830 100644 --- a/CRM/Activity/Form/ActivityView.php +++ b/CRM/Activity/Form/ActivityView.php @@ -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 { diff --git a/CRM/Activity/Form/Search.php b/CRM/Activity/Form/Search.php index 009e575210..f1b566bd38 100644 --- a/CRM/Activity/Form/Search.php +++ b/CRM/Activity/Form/Search.php @@ -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); diff --git a/CRM/Activity/Form/Task.php b/CRM/Activity/Form/Task.php index f748a9bf40..e53688dd49 100644 --- a/CRM/Activity/Form/Task.php +++ b/CRM/Activity/Form/Task.php @@ -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 + )); } } diff --git a/CRM/Activity/Form/Task/AddToTag.php b/CRM/Activity/Form/Task/AddToTag.php index d75d6262af..b7d825aac1 100644 --- a/CRM/Activity/Form/Task/AddToTag.php +++ b/CRM/Activity/Form/Task/AddToTag.php @@ -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 = ''; CRM_Core_Session::setStatus($status, ts("Added Tag %1", array(1 => $this->_tags[$key])), 'success', array('expires' => 0)); diff --git a/CRM/Activity/Form/Task/FileOnCase.php b/CRM/Activity/Form/Task/FileOnCase.php index e81bdf14af..a3f5663e3b 100644 --- a/CRM/Activity/Form/Task/FileOnCase.php +++ b/CRM/Activity/Form/Task/FileOnCase.php @@ -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"); } } diff --git a/CRM/Activity/Form/Task/PickOption.php b/CRM/Activity/Form/Task/PickOption.php index b88216f1fd..08821a4658 100644 --- a/CRM/Activity/Form/Task/PickOption.php +++ b/CRM/Activity/Form/Task/PickOption.php @@ -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 diff --git a/CRM/Activity/Form/Task/PickProfile.php b/CRM/Activity/Form/Task/PickProfile.php index 36e160453c..6590fb817f 100755 --- a/CRM/Activity/Form/Task/PickProfile.php +++ b/CRM/Activity/Form/Task/PickProfile.php @@ -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')); } diff --git a/CRM/Activity/Form/Task/RemoveFromTag.php b/CRM/Activity/Form/Task/RemoveFromTag.php index 031a13ea52..c97fb65285 100644 --- a/CRM/Activity/Form/Task/RemoveFromTag.php +++ b/CRM/Activity/Form/Task/RemoveFromTag.php @@ -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 = ''; CRM_Core_Session::setStatus($status, ts("Removed Tag %1", array(1 => $this->_tags[$key])), 'success', array('expires' => 0)); diff --git a/CRM/Activity/Import/Form/DataSource.php b/CRM/Activity/Import/Form/DataSource.php index a1987ad0c9..bd20b21593 100644 --- a/CRM/Activity/Import/Form/DataSource.php +++ b/CRM/Activity/Import/Form/DataSource.php @@ -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); diff --git a/CRM/Activity/Import/Form/MapField.php b/CRM/Activity/Import/Form/MapField.php index 87baedbc39..e10d2fff80 100644 --- a/CRM/Activity/Import/Form/MapField.php +++ b/CRM/Activity/Import/Form/MapField.php @@ -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', - )) . '
'; + array( + 1 => $title, + 2 => 'Activity Type Label', + )) . '
'; } } 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++) { diff --git a/CRM/Activity/Import/Form/Preview.php b/CRM/Activity/Import/Form/Preview.php index 4263c463e1..55146a1d00 100644 --- a/CRM/Activity/Import/Form/Preview.php +++ b/CRM/Activity/Import/Form/Preview.php @@ -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; diff --git a/CRM/Activity/Import/Form/Summary.php b/CRM/Activity/Import/Form/Summary.php index 42c1a33c93..6a33eb5cff 100644 --- a/CRM/Activity/Import/Form/Summary.php +++ b/CRM/Activity/Import/Form/Summary.php @@ -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)); } diff --git a/CRM/Activity/Import/Parser.php b/CRM/Activity/Import/Parser.php index 259cfa25ae..47a1aaae26 100644 --- a/CRM/Activity/Import/Parser.php +++ b/CRM/Activity/Import/Parser.php @@ -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 diff --git a/CRM/Activity/Import/Parser/Activity.php b/CRM/Activity/Import/Parser/Activity.php index 31e25b906c..da723f0ec1 100644 --- a/CRM/Activity/Import/Parser/Activity.php +++ b/CRM/Activity/Import/Parser/Activity.php @@ -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); diff --git a/CRM/Activity/Page/AJAX.php b/CRM/Activity/Page/AJAX.php index 5d35324ae3..7bb5f47e3d 100644 --- a/CRM/Activity/Page/AJAX.php +++ b/CRM/Activity/Page/AJAX.php @@ -37,24 +37,24 @@ */ 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'] = '' . $clientRelationships[$key]['name'] . ''; + 'action=view&reset=1&cid=' . $clientRelationships[$key]['cid']) . '>' . $clientRelationships[$key]['name'] . ''; } $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'] = '' . $row['name'] . ''; + 'action=view&reset=1&cid=' . $row['cid']) . '>' . $row['name'] . ''; } // email column links/icon if ($row['email']) { @@ -285,19 +294,19 @@ class CRM_Activity_Page_AJAX { switch ($row['source']) { case 'caseRel': $row['actions'] = - '' . + '' . '' . - '' . - '' . + '' . + '' . '' . - ''; + ''; break; case 'caseRoles': $row['actions'] = - '' . + '' . '' . - ''; + ''; 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); diff --git a/CRM/Activity/Page/Tab.php b/CRM/Activity/Page/Tab.php index 01e25eb1df..6686de71d0 100644 --- a/CRM/Activity/Page/Tab.php +++ b/CRM/Activity/Page/Tab.php @@ -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; } } diff --git a/CRM/Activity/Selector/Activity.php b/CRM/Activity/Selector/Activity.php index ebcccca104..37172af2af 100644 --- a/CRM/Activity/Selector/Activity.php +++ b/CRM/Activity/Selector/Activity.php @@ -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, ), diff --git a/CRM/Activity/Selector/Search.php b/CRM/Activity/Selector/Search.php index 1cc43cf9a8..bd06e3bff6 100644 --- a/CRM/Activity/Selector/Search.php +++ b/CRM/Activity/Selector/Search.php @@ -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)"; } diff --git a/CRM/Activity/Task.php b/CRM/Activity/Task.php index 3b47f1f476..5148e57630 100644 --- a/CRM/Activity/Task.php +++ b/CRM/Activity/Task.php @@ -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', diff --git a/CRM/Admin/Form.php b/CRM/Admin/Form.php index 3f9cbafaec..520e895ee7 100644 --- a/CRM/Admin/Form.php +++ b/CRM/Admin/Form.php @@ -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 diff --git a/CRM/Admin/Form/ContactType.php b/CRM/Admin/Form/ContactType.php index 91824e02ba..bf6a2f4d39 100644 --- a/CRM/Admin/Form/ContactType.php +++ b/CRM/Admin/Form/ContactType.php @@ -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'); } } diff --git a/CRM/Admin/Form/Extensions.php b/CRM/Admin/Form/Extensions.php index d5a7d70311..9f786e3106 100644 --- a/CRM/Admin/Form/Extensions.php +++ b/CRM/Admin/Form/Extensions.php @@ -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 { diff --git a/CRM/Admin/Form/Job.php b/CRM/Admin/Form/Job.php index be4d4542ca..114e3efa68 100644 --- a/CRM/Admin/Form/Job.php +++ b/CRM/Admin/Form/Job.php @@ -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(); diff --git a/CRM/Admin/Form/LocationType.php b/CRM/Admin/Form/LocationType.php index 654015b005..a347b5007e 100644 --- a/CRM/Admin/Form/LocationType.php +++ b/CRM/Admin/Form/LocationType.php @@ -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'); } } diff --git a/CRM/Admin/Form/MailSettings.php b/CRM/Admin/Form/MailSettings.php index 5b331db125..a3de9c5d0b 100644 --- a/CRM/Admin/Form/MailSettings.php +++ b/CRM/Admin/Form/MailSettings.php @@ -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 { diff --git a/CRM/Admin/Form/Mapping.php b/CRM/Admin/Form/Mapping.php index 4304651d27..ed1a99e5a9 100644 --- a/CRM/Admin/Form/Mapping.php +++ b/CRM/Admin/Form/Mapping.php @@ -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') diff --git a/CRM/Admin/Form/MessageTemplates.php b/CRM/Admin/Form/MessageTemplates.php index dc7acc0765..0f24a14b88 100644 --- a/CRM/Admin/Form/MessageTemplates.php +++ b/CRM/Admin/Form/MessageTemplates.php @@ -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?')); diff --git a/CRM/Admin/Form/Navigation.php b/CRM/Admin/Form/Navigation.php index 220febde66..2ab93c48f9 100644 --- a/CRM/Admin/Form/Navigation.php +++ b/CRM/Admin/Form/Navigation.php @@ -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'); } } diff --git a/CRM/Admin/Form/OptionGroup.php b/CRM/Admin/Form/OptionGroup.php index 6aaa367fd6..bb8c5e6a97 100644 --- a/CRM/Admin/Form/OptionGroup.php +++ b/CRM/Admin/Form/OptionGroup.php @@ -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); diff --git a/CRM/Admin/Form/Options.php b/CRM/Admin/Form/Options.php index c2e653bc39..9ee6bcef0b 100644 --- a/CRM/Admin/Form/Options.php +++ b/CRM/Admin/Form/Options.php @@ -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 = "" . ts('Learn more about a script that can automatically update contact addressee and greeting options.') . ""; - CRM_Core_Session::setStatus(ts('The selected %1 option has not been deleted 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 not been deleted 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'); } } diff --git a/CRM/Admin/Form/PaymentProcessor.php b/CRM/Admin/Form/PaymentProcessor.php index 95fabcbf23..1afa4544c8 100644 --- a/CRM/Admin/Form/PaymentProcessor.php +++ b/CRM/Admin/Form/PaymentProcessor.php @@ -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(); diff --git a/CRM/Admin/Form/PaymentProcessorType.php b/CRM/Admin/Form/PaymentProcessorType.php index 56ac6a9aa8..2f4d62183b 100644 --- a/CRM/Admin/Form/PaymentProcessorType.php +++ b/CRM/Admin/Form/PaymentProcessorType.php @@ -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']; diff --git a/CRM/Admin/Form/PdfFormats.php b/CRM/Admin/Form/PdfFormats.php index 15c50218f2..5daa96f03c 100644 --- a/CRM/Admin/Form/PdfFormats.php +++ b/CRM/Admin/Form/PdfFormats.php @@ -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'); diff --git a/CRM/Admin/Form/Persistent.php b/CRM/Admin/Form/Persistent.php index c0014595e7..232fc52e73 100644 --- a/CRM/Admin/Form/Persistent.php +++ b/CRM/Admin/Form/Persistent.php @@ -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')); diff --git a/CRM/Admin/Form/Preferences.php b/CRM/Admin/Form/Preferences.php index 44ec82f348..d6ac61dade 100644 --- a/CRM/Admin/Form/Preferences.php +++ b/CRM/Admin/Form/Preferences.php @@ -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; diff --git a/CRM/Admin/Form/Preferences/Address.php b/CRM/Admin/Form/Preferences/Address.php index b6e447417b..1b2eac7a0b 100644 --- a/CRM/Admin/Form/Preferences/Address.php +++ b/CRM/Admin/Form/Preferences/Address.php @@ -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( diff --git a/CRM/Admin/Form/Preferences/Contribute.php b/CRM/Admin/Form/Preferences/Contribute.php index 76f464c255..e474e28a49 100644 --- a/CRM/Admin/Form/Preferences/Contribute.php +++ b/CRM/Admin/Form/Preferences/Contribute.php @@ -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(); } diff --git a/CRM/Admin/Form/Preferences/Display.php b/CRM/Admin/Form/Preferences/Display.php index 2e828005d2..fcfa3b6292 100644 --- a/CRM/Admin/Form/Preferences/Display.php +++ b/CRM/Admin/Form/Preferences/Display.php @@ -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; } diff --git a/CRM/Admin/Form/Preferences/Event.php b/CRM/Admin/Form/Preferences/Event.php index 6af7cbd18d..978b585d3f 100644 --- a/CRM/Admin/Form/Preferences/Event.php +++ b/CRM/Admin/Form/Preferences/Event.php @@ -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', diff --git a/CRM/Admin/Form/Preferences/Multisite.php b/CRM/Admin/Form/Preferences/Multisite.php index 855d374d11..93e8456ce2 100644 --- a/CRM/Admin/Form/Preferences/Multisite.php +++ b/CRM/Admin/Form/Preferences/Multisite.php @@ -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, + * ), + */ ), ); diff --git a/CRM/Admin/Form/PreferencesDate.php b/CRM/Admin/Form/PreferencesDate.php index ab904d0ecc..9037b956f9 100644 --- a/CRM/Admin/Form/PreferencesDate.php +++ b/CRM/Admin/Form/PreferencesDate.php @@ -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'); } } diff --git a/CRM/Admin/Form/RelationshipType.php b/CRM/Admin/Form/RelationshipType.php index f6a74c5541..d9572b6c31 100644 --- a/CRM/Admin/Form/RelationshipType.php +++ b/CRM/Admin/Form/RelationshipType.php @@ -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?')); diff --git a/CRM/Admin/Form/ScheduleReminders.php b/CRM/Admin/Form/ScheduleReminders.php index 352d35a99d..ffef831dcb 100644 --- a/CRM/Admin/Form/ScheduleReminders.php +++ b/CRM/Admin/Form/ScheduleReminders.php @@ -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 => "{$values['title']}") + array(1 => "{$values['title']}") ); } diff --git a/CRM/Admin/Form/Setting.php b/CRM/Admin/Form/Setting.php index ca40d9c33a..35a60e44c8 100644 --- a/CRM/Admin/Form/Setting.php +++ b/CRM/Admin/Form/Setting.php @@ -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, diff --git a/CRM/Admin/Form/Setting/Debugging.php b/CRM/Admin/Form/Setting/Debugging.php index 55128f0cae..401219d22a 100644 --- a/CRM/Admin/Form/Setting/Debugging.php +++ b/CRM/Admin/Form/Setting/Debugging.php @@ -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 * diff --git a/CRM/Admin/Form/Setting/Localization.php b/CRM/Admin/Form/Setting/Localization.php index ee08eba60a..d922123c45 100644 --- a/CRM/Admin/Form/Setting/Localization.php +++ b/CRM/Admin/Form/Setting/Localization.php @@ -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']; } diff --git a/CRM/Admin/Form/Setting/Mail.php b/CRM/Admin/Form/Setting/Mail.php index 47b3f8bfe6..4e0c02b56e 100644 --- a/CRM/Admin/Form/Setting/Mail.php +++ b/CRM/Admin/Form/Setting/Mail.php @@ -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.'); } } diff --git a/CRM/Admin/Form/Setting/Miscellaneous.php b/CRM/Admin/Form/Setting/Miscellaneous.php index bce3279a81..a078bc8963 100644 --- a/CRM/Admin/Form/Setting/Miscellaneous.php +++ b/CRM/Admin/Form/Setting/Miscellaneous.php @@ -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); diff --git a/CRM/Admin/Form/Setting/Path.php b/CRM/Admin/Form/Setting/Path.php index fecceb069e..3d44082017 100644 --- a/CRM/Admin/Form/Setting/Path.php +++ b/CRM/Admin/Form/Setting/Path.php @@ -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'), diff --git a/CRM/Admin/Form/Setting/Search.php b/CRM/Admin/Form/Setting/Search.php index 7c716e141c..8e78680315 100644 --- a/CRM/Admin/Form/Setting/Search.php +++ b/CRM/Admin/Form/Setting/Search.php @@ -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, diff --git a/CRM/Admin/Form/Setting/Smtp.php b/CRM/Admin/Form/Setting/Smtp.php index 943c8a8bdd..3ce97c290d 100644 --- a/CRM/Admin/Form/Setting/Smtp.php +++ b/CRM/Admin/Form/Setting/Smtp.php @@ -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.
', array(1 => $domainEmailAddress, 2 => $toEmail)); + $to = '"' . $toDisplayName . '"' . "<$toEmail>"; + $from = '"' . $domainEmailName . '" <' . $domainEmailAddress . '>'; + $testMailStatusMsg = ts('Sending test email. FROM: %1 TO: %2.
', 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'; } diff --git a/CRM/Admin/Form/Setting/UpdateConfigBackend.php b/CRM/Admin/Form/Setting/UpdateConfigBackend.php index d9eaea95c1..000ef9c243 100644 --- a/CRM/Admin/Form/Setting/UpdateConfigBackend.php +++ b/CRM/Admin/Form/Setting/UpdateConfigBackend.php @@ -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 && diff --git a/CRM/Admin/Form/Setting/Url.php b/CRM/Admin/Form/Setting/Url.php index cfb5a4d706..d16a5e8839 100644 --- a/CRM/Admin/Form/Setting/Url.php +++ b/CRM/Admin/Form/Setting/Url.php @@ -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 * diff --git a/CRM/Admin/Form/Tag.php b/CRM/Admin/Form/Tag.php index 56eea10976..af478be545 100644 --- a/CRM/Admin/Form/Tag.php +++ b/CRM/Admin/Form/Tag.php @@ -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') diff --git a/CRM/Admin/Form/WordReplacements.php b/CRM/Admin/Form/WordReplacements.php index 773eda2ae6..5d632ef332 100644 --- a/CRM/Admin/Form/WordReplacements.php +++ b/CRM/Admin/Form/WordReplacements.php @@ -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" + )); } } } diff --git a/CRM/Admin/Page/AJAX.php b/CRM/Admin/Page/AJAX.php index 812e5c6c88..35d7aa9e2c 100644 --- a/CRM/Admin/Page/AJAX.php +++ b/CRM/Admin/Page/AJAX.php @@ -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)) . "
$table"; + 1 => $priceSet + )) . "
$table"; } else { $ret['content'] = ts('Are you sure you want to disable \'%1\' Price Set?', array(1 => $priceSet)); diff --git a/CRM/Admin/Page/Admin.php b/CRM/Admin/Page/Admin.php index 40df721971..07fa772e73 100644 --- a/CRM/Admin/Page/Admin.php +++ b/CRM/Admin/Page/Admin.php @@ -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'), diff --git a/CRM/Admin/Page/CMSUser.php b/CRM/Admin/Page/CMSUser.php index 3758fbafb6..8379019219 100644 --- a/CRM/Admin/Page/CMSUser.php +++ b/CRM/Admin/Page/CMSUser.php @@ -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; } diff --git a/CRM/Admin/Page/EventTemplate.php b/CRM/Admin/Page/EventTemplate.php index 5cc3b81cdf..70f42ce582 100644 --- a/CRM/Admin/Page/EventTemplate.php +++ b/CRM/Admin/Page/EventTemplate.php @@ -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' + )); } /** diff --git a/CRM/Admin/Page/Extensions.php b/CRM/Admin/Page/Extensions.php index 5e77ae71dc..2cc2726f90 100644 --- a/CRM/Admin/Page/Extensions.php +++ b/CRM/Admin/Page/Extensions.php @@ -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); diff --git a/CRM/Admin/Page/Job.php b/CRM/Admin/Page/Job.php index 50cfd0d4f4..02d86e0e3d 100644 --- a/CRM/Admin/Page/Job.php +++ b/CRM/Admin/Page/Job.php @@ -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', diff --git a/CRM/Admin/Page/JobLog.php b/CRM/Admin/Page/JobLog.php index 0c9984b74a..889e0699f2 100644 --- a/CRM/Admin/Page/JobLog.php +++ b/CRM/Admin/Page/JobLog.php @@ -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(); } diff --git a/CRM/Admin/Page/MessageTemplates.php b/CRM/Admin/Page/MessageTemplates.php index 5321f75ab4..75f5a57eff 100644 --- a/CRM/Admin/Page/MessageTemplates.php +++ b/CRM/Admin/Page/MessageTemplates.php @@ -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'), diff --git a/CRM/Admin/Page/Options.php b/CRM/Admin/Page/Options.php index 418a69841f..252e3b4255 100644 --- a/CRM/Admin/Page/Options.php +++ b/CRM/Admin/Page/Options.php @@ -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; diff --git a/CRM/Admin/Page/ParticipantStatusType.php b/CRM/Admin/Page/ParticipantStatusType.php index 70fbc9daa5..b4d931f6a1 100644 --- a/CRM/Admin/Page/ParticipantStatusType.php +++ b/CRM/Admin/Page/ParticipantStatusType.php @@ -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]); diff --git a/CRM/Admin/Page/PaymentProcessor.php b/CRM/Admin/Page/PaymentProcessor.php index 6964e218ed..9734efbce2 100644 --- a/CRM/Admin/Page/PaymentProcessor.php +++ b/CRM/Admin/Page/PaymentProcessor.php @@ -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(); diff --git a/CRM/Badge/BAO/Badge.php b/CRM/Badge/BAO/Badge.php index deb7bd0c42..c5752a8ce0 100644 --- a/CRM/Badge/BAO/Badge.php +++ b/CRM/Badge/BAO/Badge.php @@ -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'])) { diff --git a/CRM/Badge/Form/Layout.php b/CRM/Badge/Form/Layout.php index 8b6d074d99..0559403951 100644 --- a/CRM/Badge/Form/Layout.php +++ b/CRM/Badge/Form/Layout.php @@ -40,6 +40,7 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form { const FIELD_ROWCOUNT = 6; + /** * Build the form object * diff --git a/CRM/Badge/Page/AJAX.php b/CRM/Badge/Page/AJAX.php index 5019e9a190..a69a01578e 100644 --- a/CRM/Badge/Page/AJAX.php +++ b/CRM/Badge/Page/AJAX.php @@ -31,7 +31,6 @@ * @copyright CiviCRM LLC (c) 2004-2014 * */ - class CRM_Badge_Page_AJAX { public static function getImageProp() { $img = $_GET['img']; diff --git a/CRM/Batch/BAO/Batch.php b/CRM/Batch/BAO/Batch.php index 56194b60bb..2b37cc3c33 100755 --- a/CRM/Batch/BAO/Batch.php +++ b/CRM/Batch/BAO/Batch.php @@ -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) { diff --git a/CRM/Batch/Form/Entry.php b/CRM/Batch/Form/Entry.php index ce8e5d04d4..165ec1114d 100755 --- a/CRM/Batch/Form/Entry.php +++ b/CRM/Batch/Form/Entry.php @@ -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); } diff --git a/CRM/Batch/Page/AJAX.php b/CRM/Batch/Page/AJAX.php index 57d01df038..98263c5f9a 100644 --- a/CRM/Batch/Page/AJAX.php +++ b/CRM/Batch/Page/AJAX.php @@ -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; diff --git a/CRM/Bridge/OG/CiviCRM.php b/CRM/Bridge/OG/CiviCRM.php index 8646196230..843ddced70 100644 --- a/CRM/Bridge/OG/CiviCRM.php +++ b/CRM/Bridge/OG/CiviCRM.php @@ -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 diff --git a/CRM/Bridge/OG/Drupal.php b/CRM/Bridge/OG/Drupal.php index f6f4cd3cf1..3acaeb810a 100644 --- a/CRM/Bridge/OG/Drupal.php +++ b/CRM/Bridge/OG/Drupal.php @@ -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(); diff --git a/CRM/Campaign/BAO/Campaign.php b/CRM/Campaign/BAO/Campaign.php index 8fa0bcae4a..a573d57c9e 100644 --- a/CRM/Campaign/BAO/Campaign.php +++ b/CRM/Campaign/BAO/Campaign.php @@ -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; } diff --git a/CRM/Campaign/BAO/Query.php b/CRM/Campaign/BAO/Query.php index 9ab392da24..c4d6594187 100755 --- a/CRM/Campaign/BAO/Query.php +++ b/CRM/Campaign/BAO/Query.php @@ -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, diff --git a/CRM/Campaign/BAO/Survey.php b/CRM/Campaign/BAO/Survey.php index ce1221c03d..db05a07475 100644 --- a/CRM/Campaign/BAO/Survey.php +++ b/CRM/Campaign/BAO/Survey.php @@ -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 */ diff --git a/CRM/Campaign/Config.php b/CRM/Campaign/Config.php index 75efaab469..f0d87aa467 100644 --- a/CRM/Campaign/Config.php +++ b/CRM/Campaign/Config.php @@ -35,4 +35,5 @@ * $Id$ * */ -class CRM_Campaign_Config extends CRM_Core_Component_Config {} +class CRM_Campaign_Config extends CRM_Core_Component_Config { +} diff --git a/CRM/Campaign/Form/Campaign.php b/CRM/Campaign/Form/Campaign.php index ae7673791d..937fc03ae5 100644 --- a/CRM/Campaign/Form/Campaign.php +++ b/CRM/Campaign/Form/Campaign.php @@ -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()) { diff --git a/CRM/Campaign/Form/Petition.php b/CRM/Campaign/Form/Petition.php index 418d7a12a7..86ee1ccda2 100644 --- a/CRM/Campaign/Form/Petition.php +++ b/CRM/Campaign/Form/Petition.php @@ -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')); diff --git a/CRM/Campaign/Form/Petition/Signature.php b/CRM/Campaign/Form/Petition/Signature.php index a948de77d8..b694f76ae6 100644 --- a/CRM/Campaign/Form/Petition/Signature.php +++ b/CRM/Campaign/Form/Petition/Signature.php @@ -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(); } diff --git a/CRM/Campaign/Form/Search.php b/CRM/Campaign/Form/Search.php index 7cb09b82ff..a36fb93d6d 100755 --- a/CRM/Campaign/Form/Search.php +++ b/CRM/Campaign/Form/Search.php @@ -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. diff --git a/CRM/Campaign/Form/Search/Campaign.php b/CRM/Campaign/Form/Search/Campaign.php index 971acddc33..c210b70c95 100755 --- a/CRM/Campaign/Form/Search/Campaign.php +++ b/CRM/Campaign/Form/Search/Campaign.php @@ -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)); diff --git a/CRM/Campaign/Form/Search/Petition.php b/CRM/Campaign/Form/Search/Petition.php index 975cca62b1..98becd18f2 100755 --- a/CRM/Campaign/Form/Search/Petition.php +++ b/CRM/Campaign/Form/Search/Petition.php @@ -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. diff --git a/CRM/Campaign/Form/Search/Survey.php b/CRM/Campaign/Form/Search/Survey.php index 044ba72e00..0b6195b2ec 100755 --- a/CRM/Campaign/Form/Search/Survey.php +++ b/CRM/Campaign/Form/Search/Survey.php @@ -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)); diff --git a/CRM/Campaign/Form/Survey.php b/CRM/Campaign/Form/Survey.php index a3357b49a3..4d6e5075f4 100644 --- a/CRM/Campaign/Form/Survey.php +++ b/CRM/Campaign/Form/Survey.php @@ -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}")); } } } diff --git a/CRM/Campaign/Form/Survey/Main.php b/CRM/Campaign/Form/Survey/Main.php index 1164ef1e70..84ab2f6a47 100644 --- a/CRM/Campaign/Form/Survey/Main.php +++ b/CRM/Campaign/Form/Survey/Main.php @@ -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) { diff --git a/CRM/Campaign/Form/Survey/Questions.php b/CRM/Campaign/Form/Survey/Questions.php index eecf3b19ad..078f3bc4af 100644 --- a/CRM/Campaign/Form/Survey/Questions.php +++ b/CRM/Campaign/Form/Survey/Questions.php @@ -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 diff --git a/CRM/Campaign/Form/Survey/Results.php b/CRM/Campaign/Form/Survey/Results.php index b389ff3b69..70e49c6571 100644 --- a/CRM/Campaign/Form/Survey/Results.php +++ b/CRM/Campaign/Form/Survey/Results.php @@ -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 %2 has been created.", diff --git a/CRM/Campaign/Form/Survey/TabHeader.php b/CRM/Campaign/Form/Survey/TabHeader.php index 940e2a6cc7..a37f81dd18 100644 --- a/CRM/Campaign/Form/Survey/TabHeader.php +++ b/CRM/Campaign/Form/Survey/TabHeader.php @@ -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; diff --git a/CRM/Campaign/Form/SurveyType.php b/CRM/Campaign/Form/SurveyType.php index 011a0ed6d9..feef600885 100644 --- a/CRM/Campaign/Form/SurveyType.php +++ b/CRM/Campaign/Form/SurveyType.php @@ -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'); diff --git a/CRM/Campaign/Form/Task.php b/CRM/Campaign/Form/Task.php index cde042f94a..3fcab21335 100755 --- a/CRM/Campaign/Form/Task.php +++ b/CRM/Campaign/Form/Task.php @@ -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; diff --git a/CRM/Campaign/Form/Task/Interview.php b/CRM/Campaign/Form/Task/Interview.php index 617b887863..20425cbfc9 100755 --- a/CRM/Campaign/Form/Task/Interview.php +++ b/CRM/Campaign/Form/Task/Interview.php @@ -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; diff --git a/CRM/Campaign/Form/Task/Release.php b/CRM/Campaign/Form/Task/Release.php index 661a84f0ff..bbb84df5e2 100644 --- a/CRM/Campaign/Form/Task/Release.php +++ b/CRM/Campaign/Form/Task/Release.php @@ -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; } diff --git a/CRM/Campaign/Form/Task/Reserve.php b/CRM/Campaign/Form/Task/Reserve.php index caa0fdc875..05cc122df6 100644 --- a/CRM/Campaign/Form/Task/Reserve.php +++ b/CRM/Campaign/Form/Task/Reserve.php @@ -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 = '

' . ts("%1 Contact(s) have been reserved.", array(1 => $countVoters)) . '

'; if ($groupAdditions) { $status .= '

' . ts('Respondent(s) has been added to %1 group(s).', - array(1 => implode(', ', $groupAdditions)) - ) . '

'; + array(1 => implode(', ', $groupAdditions)) + ) . '

'; } 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); diff --git a/CRM/Campaign/Info.php b/CRM/Campaign/Info.php index 2f1162f484..07a838bd9b 100644 --- a/CRM/Campaign/Info.php +++ b/CRM/Campaign/Info.php @@ -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'), + ), + )); } } } diff --git a/CRM/Campaign/Page/AJAX.php b/CRM/Campaign/Page/AJAX.php index 79c76a31c8..b8cf42de6d 100644 --- a/CRM/Campaign/Page/AJAX.php +++ b/CRM/Campaign/Page/AJAX.php @@ -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 .= " "; } elseif ($searchVoterFor == 'gotv') { - $surveyActId = $result->survey_activity_id; + $surveyActId = $result->survey_activity_id; $voterExtraColHtml = ''; - $msg = ts('Vote Recorded.'); + $msg = ts('Vote Recorded.'); $voterExtraColHtml .= "     "; } else { - $surveyActId = $result->survey_activity_id; + $surveyActId = $result->survey_activity_id; $voterExtraColHtml = ''; - $msg = ts('Vote Recorded.'); + $msg = ts('Vote Recorded.'); $voterExtraColHtml .= "     "; } $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) { diff --git a/CRM/Campaign/Page/DashBoard.php b/CRM/Campaign/Page/DashBoard.php index a9e3f84b7c..eb0d701606 100644 --- a/CRM/Campaign/Page/DashBoard.php +++ b/CRM/Campaign/Page/DashBoard.php @@ -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')), + ) + )); } /** diff --git a/CRM/Campaign/Page/Petition/Confirm.php b/CRM/Campaign/Page/Petition/Confirm.php index 80360a287f..50a95f43f1 100644 --- a/CRM/Campaign/Page/Petition/Confirm.php +++ b/CRM/Campaign/Page/Petition/Confirm.php @@ -40,13 +40,13 @@ class CRM_Campaign_Page_Petition_Confirm extends CRM_Core_Page { public function run() { CRM_Utils_System::addHTMLHead(''); - $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)); diff --git a/CRM/Campaign/Page/Petition/ThankYou.php b/CRM/Campaign/Page/Petition/ThankYou.php index 1c4b1a0dbe..a6ff4f0655 100644 --- a/CRM/Campaign/Page/Petition/ThankYou.php +++ b/CRM/Campaign/Page/Petition/ThankYou.php @@ -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']); diff --git a/CRM/Campaign/Page/Survey.php b/CRM/Campaign/Page/Survey.php index b7addf9e23..99ab30099d 100644 --- a/CRM/Campaign/Page/Survey.php +++ b/CRM/Campaign/Page/Survey.php @@ -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']]; diff --git a/CRM/Campaign/Page/SurveyType.php b/CRM/Campaign/Page/SurveyType.php index 21c9a281e0..44456cd1b4 100644 --- a/CRM/Campaign/Page/SurveyType.php +++ b/CRM/Campaign/Page/SurveyType.php @@ -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) { diff --git a/CRM/Campaign/Page/Vote.php b/CRM/Campaign/Page/Vote.php index 9550d2b1a9..c322e9cd3b 100644 --- a/CRM/Campaign/Page/Vote.php +++ b/CRM/Campaign/Page/Vote.php @@ -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; } diff --git a/CRM/Campaign/PseudoConstant.php b/CRM/Campaign/PseudoConstant.php index 0f06ded249..0ce3f80f3f 100755 --- a/CRM/Campaign/PseudoConstant.php +++ b/CRM/Campaign/PseudoConstant.php @@ -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; - } + } } } diff --git a/CRM/Campaign/Selector/Search.php b/CRM/Campaign/Selector/Search.php index 90d2be1a63..4460958edf 100755 --- a/CRM/Campaign/Selector/Search.php +++ b/CRM/Campaign/Selector/Search.php @@ -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')), diff --git a/CRM/Campaign/Task.php b/CRM/Campaign/Task.php index e44f3d85c0..a453dee24a 100755 --- a/CRM/Campaign/Task.php +++ b/CRM/Campaign/Task.php @@ -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', diff --git a/CRM/Case/Audit/Audit.php b/CRM/Case/Audit/Audit.php index 630be4d9b0..e607f4d020 100644 --- a/CRM/Case/Audit/Audit.php +++ b/CRM/Case/Audit/Audit.php @@ -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; diff --git a/CRM/Case/BAO/Query.php b/CRM/Case/BAO/Query.php index 49ec82f2b5..53d3b52817 100644 --- a/CRM/Case/BAO/Query.php +++ b/CRM/Case/BAO/Query.php @@ -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': diff --git a/CRM/Case/Config.php b/CRM/Case/Config.php index 67ba166229..5481d50272 100644 --- a/CRM/Case/Config.php +++ b/CRM/Case/Config.php @@ -36,4 +36,5 @@ * $Id$ * */ -class CRM_Case_Config extends CRM_Core_Component_Config {} +class CRM_Case_Config extends CRM_Core_Component_Config { +} diff --git a/CRM/Case/Form/Activity.php b/CRM/Case/Form/Activity.php index 9847be50c9..f470d46bf6 100644 --- a/CRM/Case/Form/Activity.php +++ b/CRM/Case/Form/Activity.php @@ -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."); diff --git a/CRM/Case/Form/Activity/ChangeCaseStartDate.php b/CRM/Case/Form/Activity/ChangeCaseStartDate.php index c9af2a21e8..cf626fa3c4 100644 --- a/CRM/Case/Form/Activity/ChangeCaseStartDate.php +++ b/CRM/Case/Form/Activity/ChangeCaseStartDate.php @@ -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'; diff --git a/CRM/Case/Form/Activity/ChangeCaseStatus.php b/CRM/Case/Form/Activity/ChangeCaseStatus.php index bb27d4209f..d82f8c354f 100644 --- a/CRM/Case/Form/Activity/ChangeCaseStatus.php +++ b/CRM/Case/Form/Activity/ChangeCaseStatus.php @@ -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); diff --git a/CRM/Case/Form/Activity/ChangeCaseType.php b/CRM/Case/Form/Activity/ChangeCaseType.php index ce5f053877..7820a9583b 100644 --- a/CRM/Case/Form/Activity/ChangeCaseType.php +++ b/CRM/Case/Form/Activity/ChangeCaseType.php @@ -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), ) ); diff --git a/CRM/Case/Form/Activity/OpenCase.php b/CRM/Case/Form/Activity/OpenCase.php index 95e83b96de..afca55a490 100644 --- a/CRM/Case/Form/Activity/OpenCase.php +++ b/CRM/Case/Form/Activity/OpenCase.php @@ -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}" + )); } } } diff --git a/CRM/Case/Form/ActivityView.php b/CRM/Case/Form/ActivityView.php index 6fa94a50fe..314cbd3da2 100644 --- a/CRM/Case/Form/ActivityView.php +++ b/CRM/Case/Form/ActivityView.php @@ -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' diff --git a/CRM/Case/Form/Case.php b/CRM/Case/Form/Case.php index 6f37d0c049..ce75a40b6e 100644 --- a/CRM/Case/Form/Case.php +++ b/CRM/Case/Form/Case.php @@ -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, diff --git a/CRM/Case/Form/CaseView.php b/CRM/Case/Form/CaseView.php index d68e9cc794..94e4978c53 100644 --- a/CRM/Case/Form/CaseView.php +++ b/CRM/Case/Form/CaseView.php @@ -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 && diff --git a/CRM/Case/Form/CustomData.php b/CRM/Case/Form/CustomData.php index 4441ce1e83..4a352c861c 100644 --- a/CRM/Case/Form/CustomData.php +++ b/CRM/Case/Form/CustomData.php @@ -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, diff --git a/CRM/Case/Form/EditClient.php b/CRM/Case/Form/EditClient.php index 10c8c152e6..0253bc94eb 100644 --- a/CRM/Case/Form/EditClient.php +++ b/CRM/Case/Form/EditClient.php @@ -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(); diff --git a/CRM/Case/Form/Report.php b/CRM/Case/Form/Report.php index e563b211d9..935d5e7f56 100644 --- a/CRM/Case/Form/Report.php +++ b/CRM/Case/Form/Report.php @@ -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', diff --git a/CRM/Case/Form/Search.php b/CRM/Case/Form/Search.php index b509a9c2d1..74cd7ba4b7 100644 --- a/CRM/Case/Form/Search.php +++ b/CRM/Case/Form/Search.php @@ -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); diff --git a/CRM/Case/Form/Task.php b/CRM/Case/Form/Task.php index 7fd46c836e..1996ba56e5 100644 --- a/CRM/Case/Form/Task.php +++ b/CRM/Case/Form/Task.php @@ -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 + )); } } diff --git a/CRM/Case/Form/Task/SearchTaskHookSample.php b/CRM/Case/Form/Task/SearchTaskHookSample.php index f17c04db65..19466d0d6a 100644 --- a/CRM/Case/Form/Task/SearchTaskHookSample.php +++ b/CRM/Case/Form/Task/SearchTaskHookSample.php @@ -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 diff --git a/CRM/Case/Info.php b/CRM/Case/Info.php index 1b0db3c88f..d24104ccf1 100644 --- a/CRM/Case/Info.php +++ b/CRM/Case/Info.php @@ -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'), + ) + )); } } } diff --git a/CRM/Case/Page/AJAX.php b/CRM/Case/Page/AJAX.php index 44ae2aab00..87e03e3126 100644 --- a/CRM/Case/Page/AJAX.php +++ b/CRM/Case/Page/AJAX.php @@ -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 = " + $cs = $caseStatuses[$dao->status_id]; + $caseDetails = "
" . ts('Case Subject') . "{$dao->subject}
@@ -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)) { diff --git a/CRM/Case/Page/CaseDetails.php b/CRM/Case/Page/CaseDetails.php index 15cd39920b..60e520ba40 100644 --- a/CRM/Case/Page/CaseDetails.php +++ b/CRM/Case/Page/CaseDetails.php @@ -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); diff --git a/CRM/Case/Page/DashBoard.php b/CRM/Case/Page/DashBoard.php index 58b2c82a75..892bffd7b1 100644 --- a/CRM/Case/Page/DashBoard.php +++ b/CRM/Case/Page/DashBoard.php @@ -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()) { diff --git a/CRM/Case/Page/Tab.php b/CRM/Case/Page/Tab.php index 0cde99ac2c..dfdaa28282 100644 --- a/CRM/Case/Page/Tab.php +++ b/CRM/Case/Page/Tab.php @@ -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) { diff --git a/CRM/Case/Selector/Search.php b/CRM/Case/Selector/Search.php index 0886e09556..8efdef6aa3 100644 --- a/CRM/Case/Selector/Search.php +++ b/CRM/Case/Selector/Search.php @@ -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; diff --git a/CRM/Case/XMLProcessor/Process.php b/CRM/Case/XMLProcessor/Process.php index e129ca7d63..d434104b18 100644 --- a/CRM/Case/XMLProcessor/Process.php +++ b/CRM/Case/XMLProcessor/Process.php @@ -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; } diff --git a/CRM/Case/XMLProcessor/Report.php b/CRM/Case/XMLProcessor/Report.php index 0b4e3600ef..d5dded61d2 100644 --- a/CRM/Case/XMLProcessor/Report.php +++ b/CRM/Case/XMLProcessor/Report.php @@ -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; } diff --git a/CRM/Case/XMLRepository.php b/CRM/Case/XMLRepository.php index 8ec73aabfe..b2111ec8ea 100644 --- a/CRM/Case/XMLRepository.php +++ b/CRM/Case/XMLRepository.php @@ -65,7 +65,7 @@ class CRM_Case_XMLRepository { } /** - * @param array $xml + * @param array $xml */ public function __construct($allCaseTypes = NULL, $xml = array()) { $this->allCaseTypes = $allCaseTypes; diff --git a/CRM/Contact/BAO/Contact/Location.php b/CRM/Contact/BAO/Contact/Location.php index 595310b491..d32bbf829f 100644 --- a/CRM/Contact/BAO/Contact/Location.php +++ b/CRM/Contact/BAO/Contact/Location.php @@ -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; } diff --git a/CRM/Contact/BAO/Contact/Optimizer.php b/CRM/Contact/BAO/Contact/Optimizer.php index 4f4042200d..fd736ab5fe 100644 --- a/CRM/Contact/BAO/Contact/Optimizer.php +++ b/CRM/Contact/BAO/Contact/Optimizer.php @@ -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; } } diff --git a/CRM/Contact/BAO/Contact/Permission.php b/CRM/Contact/BAO/Contact/Permission.php index 5e15d51022..6b540804f1 100644 --- a/CRM/Contact/BAO/Contact/Permission.php +++ b/CRM/Contact/BAO/Contact/Permission.php @@ -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.'); diff --git a/CRM/Contact/BAO/Contact/Utils.php b/CRM/Contact/BAO/Contact/Utils.php index a5eaf5c8bf..c7068f3b36 100644 --- a/CRM/Contact/BAO/Contact/Utils.php +++ b/CRM/Contact/BAO/Contact/Utils.php @@ -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) { diff --git a/CRM/Contact/BAO/ContactType.php b/CRM/Contact/BAO/ContactType.php index cf0235eb7c..74fc006e6d 100644 --- a/CRM/Contact/BAO/ContactType.php +++ b/CRM/Contact/BAO/ContactType.php @@ -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 diff --git a/CRM/Contact/BAO/DashboardContact.php b/CRM/Contact/BAO/DashboardContact.php index d4ddda8a5d..27ecfcea07 100644 --- a/CRM/Contact/BAO/DashboardContact.php +++ b/CRM/Contact/BAO/DashboardContact.php @@ -1,34 +1,34 @@ 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); } } diff --git a/CRM/Contact/BAO/GroupContact.php b/CRM/Contact/BAO/GroupContact.php index 34d12ab7bd..fd717dbb50 100644 --- a/CRM/Contact/BAO/GroupContact.php +++ b/CRM/Contact/BAO/GroupContact.php @@ -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, diff --git a/CRM/Contact/BAO/GroupContactCache.php b/CRM/Contact/BAO/GroupContactCache.php index dabeebe47c..32eef80a54 100644 --- a/CRM/Contact/BAO/GroupContactCache.php +++ b/CRM/Contact/BAO/GroupContactCache.php @@ -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; } diff --git a/CRM/Contact/BAO/GroupNesting.php b/CRM/Contact/BAO/GroupNesting.php index 78c9816dec..af8b73c5b6 100644 --- a/CRM/Contact/BAO/GroupNesting.php +++ b/CRM/Contact/BAO/GroupNesting.php @@ -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) { diff --git a/CRM/Contact/BAO/GroupNestingCache.php b/CRM/Contact/BAO/GroupNestingCache.php index d363bc16b9..e16644e14e 100644 --- a/CRM/Contact/BAO/GroupNestingCache.php +++ b/CRM/Contact/BAO/GroupNestingCache.php @@ -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 diff --git a/CRM/Contact/BAO/Individual.php b/CRM/Contact/BAO/Individual.php index c62456aef3..4d6394edfa 100644 --- a/CRM/Contact/BAO/Individual.php +++ b/CRM/Contact/BAO/Individual.php @@ -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(); diff --git a/CRM/Contact/BAO/ProximityQuery.php b/CRM/Contact/BAO/ProximityQuery.php index f6106a189b..bf769928fe 100644 --- a/CRM/Contact/BAO/ProximityQuery.php +++ b/CRM/Contact/BAO/ProximityQuery.php @@ -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), ); } diff --git a/CRM/Contact/BAO/Query/Hook.php b/CRM/Contact/BAO/Query/Hook.php index b5ae9f0e51..a47bdb6a5d 100644 --- a/CRM/Contact/BAO/Query/Hook.php +++ b/CRM/Contact/BAO/Query/Hook.php @@ -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(); diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index 3feadfd493..fc4cfc78cc 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -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; diff --git a/CRM/Contact/BAO/RelationshipType.php b/CRM/Contact/BAO/RelationshipType.php index cdcf3717a7..11f1c93979 100644 --- a/CRM/Contact/BAO/RelationshipType.php +++ b/CRM/Contact/BAO/RelationshipType.php @@ -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 diff --git a/CRM/Contact/BAO/SavedSearch.php b/CRM/Contact/BAO/SavedSearch.php index 31c70839f2..3fdfcf8508 100644 --- a/CRM/Contact/BAO/SavedSearch.php +++ b/CRM/Contact/BAO/SavedSearch.php @@ -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); } } diff --git a/CRM/Contact/BAO/SearchCustom.php b/CRM/Contact/BAO/SearchCustom.php index fd7d6e3779..1ea22a7d2d 100644 --- a/CRM/Contact/BAO/SearchCustom.php +++ b/CRM/Contact/BAO/SearchCustom.php @@ -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); diff --git a/CRM/Contact/Controller/Search.php b/CRM/Contact/Controller/Search.php index 64eab805ba..728c4d2dca 100644 --- a/CRM/Contact/Controller/Search.php +++ b/CRM/Contact/Controller/Search.php @@ -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'; diff --git a/CRM/Contact/DAO/Factory.php b/CRM/Contact/DAO/Factory.php index e26ad410e8..5f4432c2b5 100644 --- a/CRM/Contact/DAO/Factory.php +++ b/CRM/Contact/DAO/Factory.php @@ -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(); diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php index 495a042896..19d52d4cf3 100644 --- a/CRM/Contact/Form/Contact.php +++ b/CRM/Contact/Form/Contact.php @@ -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+=\'&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+=\'&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 = '
'; - $duplicateContactsLinks .= ts('One matching contact was found. ', array('count' => count($contactLinks['rows']), 'plural' => '%count matching contacts were found.
')); + $duplicateContactsLinks .= ts('One matching contact was found. ', array( + 'count' => count($contactLinks['rows']), + 'plural' => '%count matching contacts were found.
' + )); 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 ) diff --git a/CRM/Contact/Form/CustomData.php b/CRM/Contact/Form/CustomData.php index 9e805a5a51..6334991867 100644 --- a/CRM/Contact/Form/CustomData.php +++ b/CRM/Contact/Form/CustomData.php @@ -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(); diff --git a/CRM/Contact/Form/DedupeRules.php b/CRM/Contact/Form/DedupeRules.php index 670c7cb265..d37cdf0d3f 100644 --- a/CRM/Contact/Form/DedupeRules.php +++ b/CRM/Contact/Form/DedupeRules.php @@ -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)) { diff --git a/CRM/Contact/Form/Domain.php b/CRM/Contact/Form/Domain.php index 603cfaa20d..124ca0f8b1 100644 --- a/CRM/Contact/Form/Domain.php +++ b/CRM/Contact/Form/Domain.php @@ -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', diff --git a/CRM/Contact/Form/Edit/Address.php b/CRM/Contact/Form/Edit/Address.php index c3885983d1..c7aa121d1e 100644 --- a/CRM/Contact/Form/Edit/Address.php +++ b/CRM/Contact/Form/Edit/Address.php @@ -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); diff --git a/CRM/Contact/Form/Edit/CommunicationPreferences.php b/CRM/Contact/Form/Edit/CommunicationPreferences.php index 3343286fd1..7c88999b4d 100644 --- a/CRM/Contact/Form/Edit/CommunicationPreferences.php +++ b/CRM/Contact/Form/Edit/CommunicationPreferences.php @@ -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'], diff --git a/CRM/Contact/Form/Edit/Email.php b/CRM/Contact/Form/Edit/Email.php index 91953302ac..d778fe6a03 100644 --- a/CRM/Contact/Form/Edit/Email.php +++ b/CRM/Contact/Form/Edit/Email.php @@ -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(); diff --git a/CRM/Contact/Form/Edit/IM.php b/CRM/Contact/Form/Edit/IM.php index 32e0eae755..d5176ea24b 100644 --- a/CRM/Contact/Form/Edit/IM.php +++ b/CRM/Contact/Form/Edit/IM.php @@ -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'), diff --git a/CRM/Contact/Form/Edit/Organization.php b/CRM/Contact/Form/Edit/Organization.php index da17b87dd3..5d808b4797 100644 --- a/CRM/Contact/Form/Edit/Organization.php +++ b/CRM/Contact/Form/Edit/Organization.php @@ -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 * diff --git a/CRM/Contact/Form/Edit/Phone.php b/CRM/Contact/Form/Edit/Phone.php index 3ee9b6d99e..68da6e976f 100644 --- a/CRM/Contact/Form/Edit/Phone.php +++ b/CRM/Contact/Form/Edit/Phone.php @@ -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 );'); diff --git a/CRM/Contact/Form/Edit/TagsAndGroups.php b/CRM/Contact/Form/Edit/TagsAndGroups.php index c59ed345d9..81e20e53ed 100644 --- a/CRM/Contact/Form/Edit/TagsAndGroups.php +++ b/CRM/Contact/Form/Edit/TagsAndGroups.php @@ -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); diff --git a/CRM/Contact/Form/GroupContact.php b/CRM/Contact/Form/GroupContact.php index dd0a16e2b7..d803a9335d 100644 --- a/CRM/Contact/Form/GroupContact.php +++ b/CRM/Contact/Form/GroupContact.php @@ -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'); diff --git a/CRM/Contact/Form/Inline.php b/CRM/Contact/Form/Inline.php index e7a8227c0f..20db671923 100644 --- a/CRM/Contact/Form/Inline.php +++ b/CRM/Contact/Form/Inline.php @@ -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, diff --git a/CRM/Contact/Form/Inline/ContactInfo.php b/CRM/Contact/Form/Inline/ContactInfo.php index 30c486823e..0bc5ff71af 100644 --- a/CRM/Contact/Form/Inline/ContactInfo.php +++ b/CRM/Contact/Form/Inline/ContactInfo.php @@ -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; diff --git a/CRM/Contact/Form/Inline/ContactName.php b/CRM/Contact/Form/Inline/ContactName.php index 9895863da3..7c70087753 100644 --- a/CRM/Contact/Form/Inline/ContactName.php +++ b/CRM/Contact/Form/Inline/ContactName.php @@ -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; diff --git a/CRM/Contact/Form/Inline/Email.php b/CRM/Contact/Form/Inline/Email.php index 72bf2f1a46..a0efe9980b 100644 --- a/CRM/Contact/Form/Inline/Email.php +++ b/CRM/Contact/Form/Inline/Email.php @@ -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)) { diff --git a/CRM/Contact/Form/Inline/IM.php b/CRM/Contact/Form/Inline/IM.php index dfed038617..2bcb95c636 100644 --- a/CRM/Contact/Form/Inline/IM.php +++ b/CRM/Contact/Form/Inline/IM.php @@ -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']; } } } diff --git a/CRM/Contact/Form/Inline/OpenID.php b/CRM/Contact/Form/Inline/OpenID.php index 4b0c3828d5..c1d77bb93e 100644 --- a/CRM/Contact/Form/Inline/OpenID.php +++ b/CRM/Contact/Form/Inline/OpenID.php @@ -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']; } } } diff --git a/CRM/Contact/Form/Inline/Phone.php b/CRM/Contact/Form/Inline/Phone.php index 9f2f96f979..544bf4872b 100644 --- a/CRM/Contact/Form/Inline/Phone.php +++ b/CRM/Contact/Form/Inline/Phone.php @@ -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']; } } } diff --git a/CRM/Contact/Form/Location.php b/CRM/Contact/Form/Location.php index 77a2ed0350..008291f041 100644 --- a/CRM/Contact/Form/Location.php +++ b/CRM/Contact/Form/Location.php @@ -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'), diff --git a/CRM/Contact/Form/Merge.php b/CRM/Contact/Form/Merge.php index 4141d06aaa..ba367123ca 100644 --- a/CRM/Contact/Form/Merge.php +++ b/CRM/Contact/Form/Merge.php @@ -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); } diff --git a/CRM/Contact/Form/ProfileContact.php b/CRM/Contact/Form/ProfileContact.php index 2dd022f0b2..b860cf7c0b 100644 --- a/CRM/Contact/Form/ProfileContact.php +++ b/CRM/Contact/Form/ProfileContact.php @@ -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); diff --git a/CRM/Contact/Form/RelatedContact.php b/CRM/Contact/Form/RelatedContact.php index ce80a97f24..5ef9d24927 100644 --- a/CRM/Contact/Form/RelatedContact.php +++ b/CRM/Contact/Form/RelatedContact.php @@ -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']; diff --git a/CRM/Contact/Form/Relationship.php b/CRM/Contact/Form/Relationship.php index a2a937849d..dbd0edf5b7 100644 --- a/CRM/Contact/Form/Relationship.php +++ b/CRM/Contact/Form/Relationship.php @@ -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'); diff --git a/CRM/Contact/Form/Search.php b/CRM/Contact/Form/Search.php index 0a4aa10438..30df4e6823 100644 --- a/CRM/Contact/Form/Search.php +++ b/CRM/Contact/Form/Search.php @@ -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); diff --git a/CRM/Contact/Form/Search/Advanced.php b/CRM/Contact/Form/Search/Advanced.php index d7fd336071..530c9284a6 100644 --- a/CRM/Contact/Form/Search/Advanced.php +++ b/CRM/Contact/Form/Search/Advanced.php @@ -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; diff --git a/CRM/Contact/Form/Search/Basic.php b/CRM/Contact/Form/Search/Basic.php index 9a5716143f..13dd608ef7 100644 --- a/CRM/Contact/Form/Search/Basic.php +++ b/CRM/Contact/Form/Search/Basic.php @@ -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 -') + )); } } diff --git a/CRM/Contact/Form/Search/Builder.php b/CRM/Contact/Form/Search/Builder.php index 18338dc465..5dbb773d0b 100644 --- a/CRM/Contact/Form/Search/Builder.php +++ b/CRM/Contact/Form/Search/Builder.php @@ -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'; diff --git a/CRM/Contact/Form/Search/Criteria.php b/CRM/Contact/Form/Search/Criteria.php index 68fd674444..00d7caa030 100644 --- a/CRM/Contact/Form/Search/Criteria.php +++ b/CRM/Contact/Form/Search/Criteria.php @@ -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; } diff --git a/CRM/Contact/Form/Search/Custom.php b/CRM/Contact/Form/Search/Custom.php index 283819d2c7..7c4edc5172 100644 --- a/CRM/Contact/Form/Search/Custom.php +++ b/CRM/Contact/Form/Search/Custom.php @@ -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(); } } diff --git a/CRM/Contact/Form/Search/Custom/ActivitySearch.php b/CRM/Contact/Form/Search/Custom/ActivitySearch.php index b94cd426ff..c518532a9d 100644 --- a/CRM/Contact/Form/Search/Custom/ActivitySearch.php +++ b/CRM/Contact/Form/Search/Custom/ActivitySearch.php @@ -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}%'"; } diff --git a/CRM/Contact/Form/Search/Custom/Base.php b/CRM/Contact/Form/Search/Custom/Base.php index cbad293b1f..227c58efb2 100644 --- a/CRM/Contact/Form/Search/Custom/Base.php +++ b/CRM/Contact/Form/Search/Custom/Base.php @@ -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) + )); } } } diff --git a/CRM/Contact/Form/Search/Custom/Basic.php b/CRM/Contact/Form/Search/Custom/Basic.php index 06e492a737..e2c7d55d24 100644 --- a/CRM/Contact/Form/Search/Custom/Basic.php +++ b/CRM/Contact/Form/Search/Custom/Basic.php @@ -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; } diff --git a/CRM/Contact/Form/Search/Custom/DateAdded.php b/CRM/Contact/Form/Search/Custom/DateAdded.php index 1adb3d454c..0075f3f05f 100644 --- a/CRM/Contact/Form/Search/Custom/DateAdded.php +++ b/CRM/Contact/Form/Search/Custom/DateAdded.php @@ -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()) { diff --git a/CRM/Contact/Form/Search/Custom/EventAggregate.php b/CRM/Contact/Form/Search/Custom/EventAggregate.php index 06f71fa0f6..1c38c06f3d 100644 --- a/CRM/Contact/Form/Search/Custom/EventAggregate.php +++ b/CRM/Contact/Form/Search/Custom/EventAggregate.php @@ -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) { diff --git a/CRM/Contact/Form/Search/Custom/FullText.php b/CRM/Contact/Form/Search/Custom/FullText.php index 16c9846d5e..d36d8a1a17 100644 --- a/CRM/Contact/Form/Search/Custom/FullText.php +++ b/CRM/Contact/Form/Search/Custom/FullText.php @@ -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 diff --git a/CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php b/CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php index 128d6a3e3b..a1f3153f85 100644 --- a/CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php +++ b/CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php @@ -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(); diff --git a/CRM/Contact/Form/Search/Custom/FullText/Contribution.php b/CRM/Contact/Form/Search/Custom/FullText/Contribution.php index 9f7bfdb2d5..20a27eafe4 100644 --- a/CRM/Contact/Form/Search/Custom/FullText/Contribution.php +++ b/CRM/Contact/Form/Search/Custom/FullText/Contribution.php @@ -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'); } /** diff --git a/CRM/Contact/Form/Search/Custom/FullText/Membership.php b/CRM/Contact/Form/Search/Custom/FullText/Membership.php index 341df71ea4..5c3298cf5f 100644 --- a/CRM/Contact/Form/Search/Custom/FullText/Membership.php +++ b/CRM/Contact/Form/Search/Custom/FullText/Membership.php @@ -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'); } /** diff --git a/CRM/Contact/Form/Search/Custom/FullText/Participant.php b/CRM/Contact/Form/Search/Custom/FullText/Participant.php index ecc0d7297d..8ceebbd915 100644 --- a/CRM/Contact/Form/Search/Custom/FullText/Participant.php +++ b/CRM/Contact/Form/Search/Custom/FullText/Participant.php @@ -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'); } /** diff --git a/CRM/Contact/Form/Search/Custom/Group.php b/CRM/Contact/Form/Search/Custom/Group.php index 07d55c8034..4e55632257 100644 --- a/CRM/Contact/Form/Search/Custom/Group.php +++ b/CRM/Contact/Form/Search/Custom/Group.php @@ -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 diff --git a/CRM/Contact/Form/Search/Custom/MultipleValues.php b/CRM/Contact/Form/Search/Custom/MultipleValues.php index 0e2bb5fc9e..9df1ad8b41 100644 --- a/CRM/Contact/Form/Search/Custom/MultipleValues.php +++ b/CRM/Contact/Form/Search/Custom/MultipleValues.php @@ -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' diff --git a/CRM/Contact/Form/Search/Custom/PostalMailing.php b/CRM/Contact/Form/Search/Custom/PostalMailing.php index fded896cd0..58d0366041 100644 --- a/CRM/Contact/Form/Search/Custom/PostalMailing.php +++ b/CRM/Contact/Form/Search/Custom/PostalMailing.php @@ -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 ); diff --git a/CRM/Contact/Form/Search/Custom/PriceSet.php b/CRM/Contact/Form/Search/Custom/PriceSet.php index fb54e99841..ae6fd34e6e 100644 --- a/CRM/Contact/Form/Search/Custom/PriceSet.php +++ b/CRM/Contact/Form/Search/Custom/PriceSet.php @@ -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}"; diff --git a/CRM/Contact/Form/Search/Custom/Proximity.php b/CRM/Contact/Form/Search/Custom/Proximity.php index ffa29d149c..de7bb987d4 100644 --- a/CRM/Contact/Form/Search/Custom/Proximity.php +++ b/CRM/Contact/Form/Search/Custom/Proximity.php @@ -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', + )); } /** diff --git a/CRM/Contact/Form/Search/Custom/RandomSegment.php b/CRM/Contact/Form/Search/Custom/RandomSegment.php index 6b37c6b050..2ec16741fc 100644 --- a/CRM/Contact/Form/Search/Custom/RandomSegment.php +++ b/CRM/Contact/Form/Search/Custom/RandomSegment.php @@ -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); diff --git a/CRM/Contact/Form/Search/Custom/Sample.php b/CRM/Contact/Form/Search/Custom/Sample.php index 93169bcd03..627a749139 100644 --- a/CRM/Contact/Form/Search/Custom/Sample.php +++ b/CRM/Contact/Form/Search/Custom/Sample.php @@ -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) { diff --git a/CRM/Contact/Form/Search/Custom/ZipCodeRange.php b/CRM/Contact/Form/Search/Custom/ZipCodeRange.php index 767eec099b..966eb4ba9d 100644 --- a/CRM/Contact/Form/Search/Custom/ZipCodeRange.php +++ b/CRM/Contact/Form/Search/Custom/ZipCodeRange.php @@ -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'), ); diff --git a/CRM/Contact/Form/Task.php b/CRM/Contact/Form/Task.php index 2b4da5af51..134c696520 100644 --- a/CRM/Contact/Form/Task.php +++ b/CRM/Contact/Form/Task.php @@ -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); diff --git a/CRM/Contact/Form/Task/AddToGroup.php b/CRM/Contact/Form/Task/AddToGroup.php index 10852e63da..976ab1694f 100644 --- a/CRM/Contact/Form/Task/AddToGroup.php +++ b/CRM/Contact/Form/Task/AddToGroup.php @@ -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 = '
  • ' . implode('
  • ', $status) . '
'; - 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")); } } } diff --git a/CRM/Contact/Form/Task/AddToHousehold.php b/CRM/Contact/Form/Task/AddToHousehold.php index 0490eb929e..c4c11ed02d 100644 --- a/CRM/Contact/Form/Task/AddToHousehold.php +++ b/CRM/Contact/Form/Task/AddToHousehold.php @@ -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 = '
  • ' . implode('
  • ', $status) . '
'; - 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 = ' $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 = '
  • ' . implode('
  • ', $status) . '
'; - 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)); } } diff --git a/CRM/Contact/Form/Task/AddToTag.php b/CRM/Contact/Form/Task/AddToTag.php index e6e4f15d59..91811916f2 100644 --- a/CRM/Contact/Form/Task/AddToTag.php +++ b/CRM/Contact/Form/Task/AddToTag.php @@ -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 = '
  • ' . implode('
  • ', $status) . '
'; CRM_Core_Session::setStatus($status, ts("Added Tag %1", array(1 => $this->_tags[$key])), 'success', array('expires' => 0)); diff --git a/CRM/Contact/Form/Task/AlterPreferences.php b/CRM/Contact/Form/Task/AlterPreferences.php index beb116ce8f..f8c4c746b8 100644 --- a/CRM/Contact/Form/Task/AlterPreferences.php +++ b/CRM/Contact/Form/Task/AlterPreferences.php @@ -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')); diff --git a/CRM/Contact/Form/Task/Batch.php b/CRM/Contact/Form/Task/Batch.php index f56373ce8b..75f10ff0f8 100644 --- a/CRM/Contact/Form/Task/Batch.php +++ b/CRM/Contact/Form/Task/Batch.php @@ -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')); } } diff --git a/CRM/Contact/Form/Task/Delete.php b/CRM/Contact/Form/Task/Delete.php index 264508fef0..2c85b7e38a 100644 --- a/CRM/Contact/Form/Task/Delete.php +++ b/CRM/Contact/Form/Task/Delete.php @@ -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'); } diff --git a/CRM/Contact/Form/Task/Email.php b/CRM/Contact/Form/Task/Email.php index e5a89b4c64..a31bceb0a0 100644 --- a/CRM/Contact/Form/Task/Email.php +++ b/CRM/Contact/Form/Task/Email.php @@ -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) { diff --git a/CRM/Contact/Form/Task/EmailCommon.php b/CRM/Contact/Form/Task/EmailCommon.php index 2b8850654c..9907ea8f58 100644 --- a/CRM/Contact/Form/Task/EmailCommon.php +++ b/CRM/Contact/Form/Task/EmailCommon.php @@ -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[] = "$displayName" . ($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') . ')
  • ' . implode('
  • ', $not_sent) . '
'; - 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)) { diff --git a/CRM/Contact/Form/Task/Label.php b/CRM/Contact/Form/Task/Label.php index 431cecb270..9240375488 100644 --- a/CRM/Contact/Form/Task/Label.php +++ b/CRM/Contact/Form/Task/Label.php @@ -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) * diff --git a/CRM/Contact/Form/Task/LabelCommon.php b/CRM/Contact/Form/Task/LabelCommon.php index ff309d5b18..77b009a42e 100644 --- a/CRM/Contact/Form/Task/LabelCommon.php +++ b/CRM/Contact/Form/Task/LabelCommon.php @@ -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; - } + } } diff --git a/CRM/Contact/Form/Task/Map.php b/CRM/Contact/Form/Task/Map.php index c1f4e8541f..0a225a2ab5 100644 --- a/CRM/Contact/Form/Task/Map.php +++ b/CRM/Contact/Form/Task/Map.php @@ -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); diff --git a/CRM/Contact/Form/Task/Merge.php b/CRM/Contact/Form/Task/Merge.php index 93b01e3662..c8099dce4d 100644 --- a/CRM/Contact/Form/Task/Merge.php +++ b/CRM/Contact/Form/Task/Merge.php @@ -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).'); diff --git a/CRM/Contact/Form/Task/PDFLetterCommon.php b/CRM/Contact/Form/Task/PDFLetterCommon.php index 8ebdc65f10..b6a6b55c51 100644 --- a/CRM/Contact/Form/Task/PDFLetterCommon.php +++ b/CRM/Contact/Form/Task/PDFLetterCommon.php @@ -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('/^( )+/', $msg, $matches)) { $spaceLen = strlen($matches[0]) / 6; - $trimMsg = ltrim($msg, '  '); - $charLen = strlen($trimMsg); + $trimMsg = ltrim($msg, '  '); + $charLen = strlen($trimMsg); $totalLen = $charLen + $spaceLen; if ($totalLen > 100) { $spacesCount = 10; diff --git a/CRM/Contact/Form/Task/PickProfile.php b/CRM/Contact/Form/Task/PickProfile.php index c59a397687..b2cc75dfb4 100644 --- a/CRM/Contact/Form/Task/PickProfile.php +++ b/CRM/Contact/Form/Task/PickProfile.php @@ -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; } diff --git a/CRM/Contact/Form/Task/Print.php b/CRM/Contact/Form/Task/Print.php index 11747d38b8..0b4995e53d 100644 --- a/CRM/Contact/Form/Task/Print.php +++ b/CRM/Contact/Form/Task/Print.php @@ -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, diff --git a/CRM/Contact/Form/Task/ProximityCommon.php b/CRM/Contact/Form/Task/ProximityCommon.php index 54313f2765..fea9dbe3af 100644 --- a/CRM/Contact/Form/Task/ProximityCommon.php +++ b/CRM/Contact/Form/Task/ProximityCommon.php @@ -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) { diff --git a/CRM/Contact/Form/Task/RemoveFromGroup.php b/CRM/Contact/Form/Task/RemoveFromGroup.php index c07fb53dc8..f96c4141a0 100644 --- a/CRM/Contact/Form/Task/RemoveFromGroup.php +++ b/CRM/Contact/Form/Task/RemoveFromGroup.php @@ -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 = '
  • ' . implode('
  • ', $status) . '
'; - 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)); } } diff --git a/CRM/Contact/Form/Task/RemoveFromTag.php b/CRM/Contact/Form/Task/RemoveFromTag.php index cc1cf3954b..0c19f2109d 100644 --- a/CRM/Contact/Form/Task/RemoveFromTag.php +++ b/CRM/Contact/Form/Task/RemoveFromTag.php @@ -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 = '
  • ' . implode('
  • ', $status) . '
'; CRM_Core_Session::setStatus($status, ts("Removed Tag %1", array(1 => $this->_tags[$key])), 'success', array('expires' => 0)); diff --git a/CRM/Contact/Form/Task/Result.php b/CRM/Contact/Form/Task/Result.php index 60d03f90be..3696721a67 100644 --- a/CRM/Contact/Form/Task/Result.php +++ b/CRM/Contact/Form/Task/Result.php @@ -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)); diff --git a/CRM/Contact/Form/Task/SMSCommon.php b/CRM/Contact/Form/Task/SMSCommon.php index e1bca8a50e..23aa32eb7a 100644 --- a/CRM/Contact/Form/Task/SMSCommon.php +++ b/CRM/Contact/Form/Task/SMSCommon.php @@ -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 .= '
  • ' . $errMsg . '
  • '; } $status .= ''; - 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[] = "$displayName"; } @@ -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 .= ')
    • ' . implode('
    • ', $not_sent) . '
    '; - 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'); } } } diff --git a/CRM/Contact/Form/Task/SaveSearch.php b/CRM/Contact/Form/Task/SaveSearch.php index ee5150566c..935409a302 100644 --- a/CRM/Contact/Form/Task/SaveSearch.php +++ b/CRM/Contact/Form/Task/SaveSearch.php @@ -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'] = ''; diff --git a/CRM/Contact/Form/Task/Unhold.php b/CRM/Contact/Form/Task/Unhold.php index 8fc69e313c..05ec941b34 100644 --- a/CRM/Contact/Form/Task/Unhold.php +++ b/CRM/Contact/Form/Task/Unhold.php @@ -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 { diff --git a/CRM/Contact/Form/Task/Useradd.php b/CRM/Contact/Form/Task/Useradd.php index 401f06532c..1a015edc1d 100755 --- a/CRM/Contact/Form/Task/Useradd.php +++ b/CRM/Contact/Form/Task/Useradd.php @@ -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))); } diff --git a/CRM/Contact/Import/Form/DataSource.php b/CRM/Contact/Import/Form/DataSource.php index 43191809b4..59a269beed 100644 --- a/CRM/Contact/Import/Form/DataSource.php +++ b/CRM/Contact/Import/Form/DataSource.php @@ -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('%1 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('%1 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); diff --git a/CRM/Contact/Import/Form/MapField.php b/CRM/Contact/Import/Form/MapField.php index 3d9d87c949..ec64bea512 100644 --- a/CRM/Contact/Import/Form/MapField.php +++ b/CRM/Contact/Import/Form/MapField.php @@ -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' => '          ', - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), + array( + 'type' => 'back', + 'name' => ts('Previous'), + ), + array( + 'type' => 'next', + 'name' => ts('Continue'), + 'spacing' => '          ', + 'isDefault' => TRUE, + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), ) ); } @@ -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; diff --git a/CRM/Contact/Import/Form/Preview.php b/CRM/Contact/Import/Form/Preview.php index f895702533..f09c2528f3 100644 --- a/CRM/Contact/Import/Form/Preview.php +++ b/CRM/Contact/Import/Form/Preview.php @@ -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 diff --git a/CRM/Contact/Import/Form/Summary.php b/CRM/Contact/Import/Form/Summary.php index 3bf9f8a72a..4522a0e363 100644 --- a/CRM/Contact/Import/Form/Summary.php +++ b/CRM/Contact/Import/Form/Summary.php @@ -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)); } diff --git a/CRM/Contact/Import/ImportJob.php b/CRM/Contact/Import/ImportJob.php index 84e2a176dd..6b3269d7f6 100644 --- a/CRM/Contact/Import/ImportJob.php +++ b/CRM/Contact/Import/ImportJob.php @@ -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"; diff --git a/CRM/Contact/Import/Parser.php b/CRM/Contact/Import/Parser.php index 288ba58ccd..fddfc8f8bb 100644 --- a/CRM/Contact/Import/Parser.php +++ b/CRM/Contact/Import/Parser.php @@ -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( diff --git a/CRM/Contact/Page/AJAX.php b/CRM/Contact/Page/AJAX.php index e7ddfec6b3..9d1580f5c8 100644 --- a/CRM/Contact/Page/AJAX.php +++ b/CRM/Contact/Page/AJAX.php @@ -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; diff --git a/CRM/Contact/Page/DashBoard.php b/CRM/Contact/Page/DashBoard.php index 2466d9f8bb..7c695f8652 100644 --- a/CRM/Contact/Page/DashBoard.php +++ b/CRM/Contact/Page/DashBoard.php @@ -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 diff --git a/CRM/Contact/Page/DedupeException.php b/CRM/Contact/Page/DedupeException.php index 64801beaec..db0e324281 100644 --- a/CRM/Contact/Page/DedupeException.php +++ b/CRM/Contact/Page/DedupeException.php @@ -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; diff --git a/CRM/Contact/Page/DedupeFind.php b/CRM/Contact/Page/DedupeFind.php index 2acdf69d2d..36c9348507 100644 --- a/CRM/Contact/Page/DedupeFind.php +++ b/CRM/Contact/Page/DedupeFind.php @@ -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}" + )); } } } diff --git a/CRM/Contact/Page/Inline/CustomData.php b/CRM/Contact/Page/Inline/CustomData.php index 90735344e2..820ccc9270 100644 --- a/CRM/Contact/Page/Inline/CustomData.php +++ b/CRM/Contact/Page/Inline/CustomData.php @@ -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) { diff --git a/CRM/Contact/Page/Inline/Website.php b/CRM/Contact/Page/Inline/Website.php index 50b5af159f..301d3af816 100644 --- a/CRM/Contact/Page/Inline/Website.php +++ b/CRM/Contact/Page/Inline/Website.php @@ -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) { diff --git a/CRM/Contact/Page/SavedSearch.php b/CRM/Contact/Page/SavedSearch.php index a513e09df2..ca861385a5 100644 --- a/CRM/Contact/Page/SavedSearch.php +++ b/CRM/Contact/Page/SavedSearch.php @@ -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, diff --git a/CRM/Contact/Page/View.php b/CRM/Contact/Page/View.php index c33f3c8ac2..7c90bf2987 100644 --- a/CRM/Contact/Page/View.php +++ b/CRM/Contact/Page/View.php @@ -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 ); diff --git a/CRM/Contact/Page/View/CustomData.php b/CRM/Contact/Page/View/CustomData.php index 511bd859ec..7f0f8b8817 100644 --- a/CRM/Contact/Page/View/CustomData.php +++ b/CRM/Contact/Page/View/CustomData.php @@ -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 ); diff --git a/CRM/Contact/Page/View/GroupContact.php b/CRM/Contact/Page/View/GroupContact.php index 3310b10660..01d5c7cdf1 100644 --- a/CRM/Contact/Page/View/GroupContact.php +++ b/CRM/Contact/Page/View/GroupContact.php @@ -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 diff --git a/CRM/Contact/Page/View/Log.php b/CRM/Contact/Page/View/Log.php index 9e857fb8d1..3b8da83952 100644 --- a/CRM/Contact/Page/View/Log.php +++ b/CRM/Contact/Page/View/Log.php @@ -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§ion=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§ion=2&altered_contact_id_op=eq&altered_contact_id_value={$this->_contactId}&cid={$this->_contactId}", FALSE, NULL, FALSE)); return; } diff --git a/CRM/Contact/Page/View/Note.php b/CRM/Contact/Page/View/Note.php index 83c2ef243b..2906018d68 100644 --- a/CRM/Contact/Page/View/Note.php +++ b/CRM/Contact/Page/View/Note.php @@ -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); } diff --git a/CRM/Contact/Page/View/Print.php b/CRM/Contact/Page/View/Print.php index d28510a543..eac69366dd 100644 --- a/CRM/Contact/Page/View/Print.php +++ b/CRM/Contact/Page/View/Print.php @@ -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); diff --git a/CRM/Contact/Page/View/Relationship.php b/CRM/Contact/Page/View/Relationship.php index ed73699a9a..2fdd80530d 100644 --- a/CRM/Contact/Page/View/Relationship.php +++ b/CRM/Contact/Page/View/Relationship.php @@ -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); diff --git a/CRM/Contact/Page/View/Summary.php b/CRM/Contact/Page/View/Summary.php index 24eb69dd2a..169a9766e9 100644 --- a/CRM/Contact/Page/View/Summary.php +++ b/CRM/Contact/Page/View/Summary.php @@ -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; } } diff --git a/CRM/Contact/Page/View/UserDashBoard.php b/CRM/Contact/Page/View/UserDashBoard.php index 3b1db77572..fdc49338e2 100644 --- a/CRM/Contact/Page/View/UserDashBoard.php +++ b/CRM/Contact/Page/View/UserDashBoard.php @@ -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'), + ), + )); } } diff --git a/CRM/Contact/Page/View/Vcard.php b/CRM/Contact/Page/View/Vcard.php index a697d348cc..88e2eaa3f7 100644 --- a/CRM/Contact/Page/View/Vcard.php +++ b/CRM/Contact/Page/View/Vcard.php @@ -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)]; } diff --git a/CRM/Contact/Selector.php b/CRM/Contact/Selector.php index f2914c6506..3c37792145 100644 --- a/CRM/Contact/Selector.php +++ b/CRM/Contact/Selector.php @@ -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 = "{$websiteValue} ({$websiteType})"; + $websiteUrl = "{$websiteValue} ({$websiteType})"; } $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 diff --git a/CRM/Contact/Selector/Custom.php b/CRM/Contact/Selector/Custom.php index e8dee4b0a8..b4ad66c504 100644 --- a/CRM/Contact/Selector/Custom.php +++ b/CRM/Contact/Selector/Custom.php @@ -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 diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 57b00994ac..6d83725bef 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -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']], + )); } } diff --git a/CRM/Contribute/BAO/Contribution/Utils.php b/CRM/Contribute/BAO/Contribution/Utils.php index fc85bb7b97..1d9b7a5527 100644 --- a/CRM/Contribute/BAO/Contribution/Utils.php +++ b/CRM/Contribute/BAO/Contribution/Utils.php @@ -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; } diff --git a/CRM/Contribute/BAO/ContributionPage.php b/CRM/Contribute/BAO/ContributionPage.php index 389aafd036..77729652e3 100644 --- a/CRM/Contribute/BAO/ContributionPage.php +++ b/CRM/Contribute/BAO/ContributionPage.php @@ -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; } diff --git a/CRM/Contribute/BAO/ContributionRecur.php b/CRM/Contribute/BAO/ContributionRecur.php index 153fa200dd..ccfef2f84e 100644 --- a/CRM/Contribute/BAO/ContributionRecur.php +++ b/CRM/Contribute/BAO/ContributionRecur.php @@ -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 .= '
    ' . ts('Automatic renewal of %1 membership cancelled.', array(1 => $membershipType)); } else { $details .= '
    ' . 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, )); diff --git a/CRM/Contribute/BAO/ContributionSoft.php b/CRM/Contribute/BAO/ContributionSoft.php index f27bc3cb7e..e654b31857 100644 --- a/CRM/Contribute/BAO/ContributionSoft.php +++ b/CRM/Contribute/BAO/ContributionSoft.php @@ -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); diff --git a/CRM/Contribute/BAO/Query.php b/CRM/Contribute/BAO/Query.php index 4c8e4c9671..a4448dd253 100644 --- a/CRM/Contribute/BAO/Query.php +++ b/CRM/Contribute/BAO/Query.php @@ -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', ) ); diff --git a/CRM/Contribute/BAO/Widget.php b/CRM/Contribute/BAO/Widget.php index e2f2c98e87..731660dd9d 100644 --- a/CRM/Contribute/BAO/Widget.php +++ b/CRM/Contribute/BAO/Widget.php @@ -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'] = "" . ts('Learn more.') . ""; + $data['home_url'] = "" . ts('Learn more.') . ""; // if is_active is false, show this link and hide the contribute button $data['homepage_link'] = $widget->url_homepage; diff --git a/CRM/Contribute/Config.php b/CRM/Contribute/Config.php index d91601fb00..b90b21013f 100644 --- a/CRM/Contribute/Config.php +++ b/CRM/Contribute/Config.php @@ -36,4 +36,5 @@ * $Id$ * */ -class CRM_Contribute_Config extends CRM_Core_Component_Config {} +class CRM_Contribute_Config extends CRM_Core_Component_Config { +} diff --git a/CRM/Contribute/Exception/InactiveContributionPageException.php b/CRM/Contribute/Exception/InactiveContributionPageException.php index 788ac732c4..742d1b0b37 100644 --- a/CRM/Contribute/Exception/InactiveContributionPageException.php +++ b/CRM/Contribute/Exception/InactiveContributionPageException.php @@ -1,4 +1,5 @@ id = $id; diff --git a/CRM/Contribute/Form/AbstractEditPayment.php b/CRM/Contribute/Form/AbstractEditPayment.php index 55dd114c9d..f515b9ab05 100644 --- a/CRM/Contribute/Form/AbstractEditPayment.php +++ b/CRM/Contribute/Form/AbstractEditPayment.php @@ -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 .= "
    " . 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']); } diff --git a/CRM/Contribute/Form/AdditionalInfo.php b/CRM/Contribute/Form/AdditionalInfo.php index 5d1c072e30..31ec73c698 100644 --- a/CRM/Contribute/Form/AdditionalInfo.php +++ b/CRM/Contribute/Form/AdditionalInfo.php @@ -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 = "\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, + * )); + * } + */ } diff --git a/CRM/Core/Report/Excel.php b/CRM/Core/Report/Excel.php index 0ae0eca5f6..83aeaa1584 100644 --- a/CRM/Core/Report/Excel.php +++ b/CRM/Core/Report/Excel.php @@ -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 = ''; diff --git a/CRM/Core/Resources.php b/CRM/Core/Resources.php index 10e4f40460..7c361855c0 100644 --- a/CRM/Core/Resources.php +++ b/CRM/Core/Resources.php @@ -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( diff --git a/CRM/Core/ScheduledJob.php b/CRM/Core/ScheduledJob.php index fc96115de5..effe858229 100644 --- a/CRM/Core/ScheduledJob.php +++ b/CRM/Core/ScheduledJob.php @@ -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; diff --git a/CRM/Core/SelectValues.php b/CRM/Core/SelectValues.php index 4839aa8464..5a31958955 100644 --- a/CRM/Core/SelectValues.php +++ b/CRM/Core/SelectValues.php @@ -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; diff --git a/CRM/Core/Selector/Controller.php b/CRM/Core/Selector/Controller.php index 534cef9eb4..457d4cac31 100644 --- a/CRM/Core/Selector/Controller.php +++ b/CRM/Core/Selector/Controller.php @@ -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); diff --git a/CRM/Core/Session.php b/CRM/Core/Session.php index 0c9133346f..458fe56cdf 100644 --- a/CRM/Core/Session.php +++ b/CRM/Core/Session.php @@ -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(); diff --git a/CRM/Core/ShowHideBlocks.php b/CRM/Core/ShowHideBlocks.php index 887ea1b8e3..1617329987 100644 --- a/CRM/Core/ShowHideBlocks.php +++ b/CRM/Core/ShowHideBlocks.php @@ -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\""); diff --git a/CRM/Core/Smarty.php b/CRM/Core/Smarty.php index 5ff43aca84..928036aadf 100644 --- a/CRM/Core/Smarty.php +++ b/CRM/Core/Smarty.php @@ -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; } diff --git a/CRM/Core/Smarty/plugins/block.edit.php b/CRM/Core/Smarty/plugins/block.edit.php index a39a478a0d..851e724b94 100644 --- a/CRM/Core/Smarty/plugins/block.edit.php +++ b/CRM/Core/Smarty/plugins/block.edit.php @@ -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']; diff --git a/CRM/Core/Smarty/plugins/block.htxt.php b/CRM/Core/Smarty/plugins/block.htxt.php index a87f7e85b9..d228479aee 100644 --- a/CRM/Core/Smarty/plugins/block.htxt.php +++ b/CRM/Core/Smarty/plugins/block.htxt.php @@ -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']; diff --git a/CRM/Core/Smarty/plugins/block.localize.php b/CRM/Core/Smarty/plugins/block.localize.php index 198df317c7..8e0bed30bc 100644 --- a/CRM/Core/Smarty/plugins/block.localize.php +++ b/CRM/Core/Smarty/plugins/block.localize.php @@ -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']) { diff --git a/CRM/Core/Smarty/plugins/block.serialize.php b/CRM/Core/Smarty/plugins/block.serialize.php index 64a1ad80aa..1092629b18 100644 --- a/CRM/Core/Smarty/plugins/block.serialize.php +++ b/CRM/Core/Smarty/plugins/block.serialize.php @@ -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); diff --git a/CRM/Core/Smarty/plugins/block.ts.php b/CRM/Core/Smarty/plugins/block.ts.php index 14c535e9f8..092363eda2 100644 --- a/CRM/Core/Smarty/plugins/block.ts.php +++ b/CRM/Core/Smarty/plugins/block.ts.php @@ -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'])) { diff --git a/CRM/Core/Smarty/plugins/function.crmKey.php b/CRM/Core/Smarty/plugins/function.crmKey.php index ea8f01754e..47d2e40a56 100644 --- a/CRM/Core/Smarty/plugins/function.crmKey.php +++ b/CRM/Core/Smarty/plugins/function.crmKey.php @@ -42,7 +42,7 @@ * The Smarty object. * * @return string - * the generated key + * the generated key */ function smarty_function_crmKey($params, &$smarty) { return diff --git a/CRM/Core/Smarty/plugins/function.crmNavigationMenu.php b/CRM/Core/Smarty/plugins/function.crmNavigationMenu.php index 252cdf08c6..b5bfba1315 100644 --- a/CRM/Core/Smarty/plugins/function.crmNavigationMenu.php +++ b/CRM/Core/Smarty/plugins/function.crmNavigationMenu.php @@ -42,7 +42,7 @@ * The Smarty object. * * @return string - * HTML + * HTML */ function smarty_function_crmNavigationMenu($params, &$smarty) { $config = CRM_Core_Config::singleton(); diff --git a/CRM/Core/Smarty/plugins/function.docURL.php b/CRM/Core/Smarty/plugins/function.docURL.php index 17a0e6057a..84d9bbc050 100644 --- a/CRM/Core/Smarty/plugins/function.docURL.php +++ b/CRM/Core/Smarty/plugins/function.docURL.php @@ -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)) { diff --git a/CRM/Core/Smarty/plugins/function.help.php b/CRM/Core/Smarty/plugins/function.help.php index bf93bddf16..fce651c236 100644 --- a/CRM/Core/Smarty/plugins/function.help.php +++ b/CRM/Core/Smarty/plugins/function.help.php @@ -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'])) { diff --git a/CRM/Core/Smarty/plugins/function.sectionTotal.php b/CRM/Core/Smarty/plugins/function.sectionTotal.php index 11cf42ac95..9d1e03fdc3 100644 --- a/CRM/Core/Smarty/plugins/function.sectionTotal.php +++ b/CRM/Core/Smarty/plugins/function.sectionTotal.php @@ -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', diff --git a/CRM/Core/Smarty/plugins/function.simpleActivityContacts.php b/CRM/Core/Smarty/plugins/function.simpleActivityContacts.php index 22c64acc41..59459c5e4a 100644 --- a/CRM/Core/Smarty/plugins/function.simpleActivityContacts.php +++ b/CRM/Core/Smarty/plugins/function.simpleActivityContacts.php @@ -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']); diff --git a/CRM/Core/Smarty/plugins/modifier.crmAddClass.php b/CRM/Core/Smarty/plugins/modifier.crmAddClass.php index eab0a5df6a..ebecda4452 100644 --- a/CRM/Core/Smarty/plugins/modifier.crmAddClass.php +++ b/CRM/Core/Smarty/plugins/modifier.crmAddClass.php @@ -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 diff --git a/CRM/Core/Smarty/plugins/modifier.crmBtnType.php b/CRM/Core/Smarty/plugins/modifier.crmBtnType.php index 5021647e41..6cb0b34198 100644 --- a/CRM/Core/Smarty/plugins/modifier.crmBtnType.php +++ b/CRM/Core/Smarty/plugins/modifier.crmBtnType.php @@ -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) { diff --git a/CRM/Core/Smarty/plugins/modifier.crmDate.php b/CRM/Core/Smarty/plugins/modifier.crmDate.php index ff045b67a6..6847674587 100644 --- a/CRM/Core/Smarty/plugins/modifier.crmDate.php +++ b/CRM/Core/Smarty/plugins/modifier.crmDate.php @@ -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) { diff --git a/CRM/Core/Smarty/plugins/modifier.crmDelete.php b/CRM/Core/Smarty/plugins/modifier.crmDelete.php index e4b5f10f1b..57dc27cc18 100644 --- a/CRM/Core/Smarty/plugins/modifier.crmDelete.php +++ b/CRM/Core/Smarty/plugins/modifier.crmDelete.php @@ -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 = '/>'; diff --git a/CRM/Core/Smarty/plugins/modifier.crmICalDate.php b/CRM/Core/Smarty/plugins/modifier.crmICalDate.php index fb4c8b2f2f..0751831c95 100644 --- a/CRM/Core/Smarty/plugins/modifier.crmICalDate.php +++ b/CRM/Core/Smarty/plugins/modifier.crmICalDate.php @@ -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); diff --git a/CRM/Core/Smarty/plugins/modifier.crmICalText.php b/CRM/Core/Smarty/plugins/modifier.crmICalText.php index e629e01953..5e3828dd96 100644 --- a/CRM/Core/Smarty/plugins/modifier.crmICalText.php +++ b/CRM/Core/Smarty/plugins/modifier.crmICalText.php @@ -39,7 +39,7 @@ * @param string $str * * @return string - * formatted text + * formatted text */ function smarty_modifier_crmICalText($str) { return CRM_Utils_ICalendar::formatText($str); diff --git a/CRM/Core/Smarty/plugins/modifier.crmInsert.php b/CRM/Core/Smarty/plugins/modifier.crmInsert.php index 8c8ad73390..9eb279573e 100644 --- a/CRM/Core/Smarty/plugins/modifier.crmInsert.php +++ b/CRM/Core/Smarty/plugins/modifier.crmInsert.php @@ -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); diff --git a/CRM/Core/Smarty/plugins/modifier.crmMoney.php b/CRM/Core/Smarty/plugins/modifier.crmMoney.php index 227ad3f77e..9de1095e58 100644 --- a/CRM/Core/Smarty/plugins/modifier.crmMoney.php +++ b/CRM/Core/Smarty/plugins/modifier.crmMoney.php @@ -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); diff --git a/CRM/Core/Smarty/plugins/modifier.crmNumberFormat.php b/CRM/Core/Smarty/plugins/modifier.crmNumberFormat.php index fa810c250d..0c847f9139 100644 --- a/CRM/Core/Smarty/plugins/modifier.crmNumberFormat.php +++ b/CRM/Core/Smarty/plugins/modifier.crmNumberFormat.php @@ -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; } diff --git a/CRM/Core/Smarty/plugins/modifier.crmReplace.php b/CRM/Core/Smarty/plugins/modifier.crmReplace.php index cd572a89b1..330299ce98 100644 --- a/CRM/Core/Smarty/plugins/modifier.crmReplace.php +++ b/CRM/Core/Smarty/plugins/modifier.crmReplace.php @@ -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" diff --git a/CRM/Core/Smarty/plugins/modifier.crmStripAlternatives.php b/CRM/Core/Smarty/plugins/modifier.crmStripAlternatives.php index 76da47c45c..5cfe8df3f8 100644 --- a/CRM/Core/Smarty/plugins/modifier.crmStripAlternatives.php +++ b/CRM/Core/Smarty/plugins/modifier.crmStripAlternatives.php @@ -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); diff --git a/CRM/Core/Smarty/plugins/modifier.htmlize.php b/CRM/Core/Smarty/plugins/modifier.htmlize.php index 5b2ae4b2bc..6f6ae44eb8 100644 --- a/CRM/Core/Smarty/plugins/modifier.htmlize.php +++ b/CRM/Core/Smarty/plugins/modifier.htmlize.php @@ -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+)?)?)?)@', '$1', $text); diff --git a/CRM/Core/Smarty/plugins/modifier.json.php b/CRM/Core/Smarty/plugins/modifier.json.php index 9e03697dc8..7530d77824 100644 --- a/CRM/Core/Smarty/plugins/modifier.json.php +++ b/CRM/Core/Smarty/plugins/modifier.json.php @@ -41,7 +41,7 @@ * @param mixed $data * * @return string - * JSON + * JSON */ function smarty_modifier_json($data) { return json_encode($data); diff --git a/CRM/Core/Smarty/plugins/modifier.mb_truncate.php b/CRM/Core/Smarty/plugins/modifier.mb_truncate.php index 8d8e3e56c2..997da1c479 100644 --- a/CRM/Core/Smarty/plugins/modifier.mb_truncate.php +++ b/CRM/Core/Smarty/plugins/modifier.mb_truncate.php @@ -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'); diff --git a/CRM/Core/Smarty/plugins/prefilter.resetExtScope.php b/CRM/Core/Smarty/plugins/prefilter.resetExtScope.php index 2415b84ce8..e7b6501e7b 100644 --- a/CRM/Core/Smarty/plugins/prefilter.resetExtScope.php +++ b/CRM/Core/Smarty/plugins/prefilter.resetExtScope.php @@ -8,5 +8,5 @@ function smarty_prefilter_resetExtScope($tpl_source, &$smarty) { return '{crmScope extensionKey=""}' . $tpl_source - . '{/crmScope}'; + . '{/crmScope}'; } diff --git a/CRM/Core/TableHierarchy.php b/CRM/Core/TableHierarchy.php index c5a8d72658..dc07c38908 100644 --- a/CRM/Core/TableHierarchy.php +++ b/CRM/Core/TableHierarchy.php @@ -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', diff --git a/CRM/Custom/Form/ChangeFieldType.php b/CRM/Custom/Form/ChangeFieldType.php index d6f4544374..06d26d3da6 100644 --- a/CRM/Custom/Form/ChangeFieldType.php +++ b/CRM/Custom/Form/ChangeFieldType.php @@ -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); diff --git a/CRM/Custom/Form/Field.php b/CRM/Custom/Form/Field.php index de9ea04349..922246b88a 100644 --- a/CRM/Custom/Form/Field.php +++ b/CRM/Custom/Form/Field.php @@ -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();"), '
    ' + 'onclick' => "showOptionSelect();" + ), '
    ' ); $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 .= '

    ' . ts("Ready to add another.") . '

    '; $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'); diff --git a/CRM/Custom/Form/Group.php b/CRM/Custom/Form/Group.php index 87d0a94fe5..26d651981d 100644 --- a/CRM/Custom/Form/Group.php +++ b/CRM/Custom/Form/Group.php @@ -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'); } } } diff --git a/CRM/Custom/Form/MoveField.php b/CRM/Custom/Form/MoveField.php index f3f24ad943..fcfb6913fd 100644 --- a/CRM/Custom/Form/MoveField.php +++ b/CRM/Custom/Form/MoveField.php @@ -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 %2.", array( - 1 => $this->_srcFieldLabel, - 2 => $dstGroup, + 1 => $this->_srcFieldLabel, + 2 => $dstGroup, 3 => $srcUrl, - )), '', 'success'); + )), '', 'success'); } } diff --git a/CRM/Custom/Form/Option.php b/CRM/Custom/Form/Option.php index 3405e1249b..e1da4cc6c2 100644 --- a/CRM/Custom/Form/Option.php +++ b/CRM/Custom/Form/Option.php @@ -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(); diff --git a/CRM/Custom/Form/Preview.php b/CRM/Custom/Form/Preview.php index 982369092a..d5347b3b4a 100644 --- a/CRM/Custom/Form/Preview.php +++ b/CRM/Custom/Form/Preview.php @@ -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); diff --git a/CRM/Custom/Import/Form/DataSource.php b/CRM/Custom/Import/Form/DataSource.php index a8c0d3662d..64c9c7564f 100644 --- a/CRM/Custom/Import/Form/DataSource.php +++ b/CRM/Custom/Import/Form/DataSource.php @@ -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); diff --git a/CRM/Custom/Import/Form/MapField.php b/CRM/Custom/Import/Form/MapField.php index 1958eebde7..2634b7dfc3 100644 --- a/CRM/Custom/Import/Form/MapField.php +++ b/CRM/Custom/Import/Form/MapField.php @@ -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(); diff --git a/CRM/Custom/Import/Form/Preview.php b/CRM/Custom/Import/Form/Preview.php index d21fd2a11e..c7911d072a 100644 --- a/CRM/Custom/Import/Form/Preview.php +++ b/CRM/Custom/Import/Form/Preview.php @@ -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; diff --git a/CRM/Custom/Import/Parser.php b/CRM/Custom/Import/Parser.php index f378a70445..0be813e09b 100644 --- a/CRM/Custom/Import/Parser.php +++ b/CRM/Custom/Import/Parser.php @@ -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 diff --git a/CRM/Custom/Import/Parser/Api.php b/CRM/Custom/Import/Parser/Api.php index 9e2a3fc204..b5bf3d615d 100644 --- a/CRM/Custom/Import/Parser/Api.php +++ b/CRM/Custom/Import/Parser/Api.php @@ -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; diff --git a/CRM/Custom/Page/Group.php b/CRM/Custom/Page/Group.php index 2737323aa3..2003d472f0 100644 --- a/CRM/Custom/Page/Group.php +++ b/CRM/Custom/Page/Group.php @@ -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) diff --git a/CRM/Custom/Page/Option.php b/CRM/Custom/Page/Option.php index 3dea06a146..bbf3a05389 100644 --- a/CRM/Custom/Page/Option.php +++ b/CRM/Custom/Page/Option.php @@ -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) { diff --git a/CRM/Dashlet/Page/AllCases.php b/CRM/Dashlet/Page/AllCases.php index 5e0f90f9ac..d3a7b3eb47 100644 --- a/CRM/Dashlet/Page/AllCases.php +++ b/CRM/Dashlet/Page/AllCases.php @@ -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)) { diff --git a/CRM/Dashlet/Page/CaseDashboard.php b/CRM/Dashlet/Page/CaseDashboard.php index 16d78b4eb4..e7be5280fc 100644 --- a/CRM/Dashlet/Page/CaseDashboard.php +++ b/CRM/Dashlet/Page/CaseDashboard.php @@ -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)) { diff --git a/CRM/Dashlet/Page/MyCases.php b/CRM/Dashlet/Page/MyCases.php index 284cc2b854..b121d03573 100644 --- a/CRM/Dashlet/Page/MyCases.php +++ b/CRM/Dashlet/Page/MyCases.php @@ -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)) { diff --git a/CRM/Dedupe/BAO/QueryBuilder.php b/CRM/Dedupe/BAO/QueryBuilder.php index 686cda71d9..393a4dab49 100644 --- a/CRM/Dedupe/BAO/QueryBuilder.php +++ b/CRM/Dedupe/BAO/QueryBuilder.php @@ -22,4 +22,6 @@ class CRM_Dedupe_BAO_QueryBuilder { return "($strID1 < $strID2)"; } } -}; +} + +; diff --git a/CRM/Dedupe/BAO/QueryBuilder/IndividualGeneral.php b/CRM/Dedupe/BAO/QueryBuilder/IndividualGeneral.php index 2d90f02e21..f65884c162 100644 --- a/CRM/Dedupe/BAO/QueryBuilder/IndividualGeneral.php +++ b/CRM/Dedupe/BAO/QueryBuilder/IndividualGeneral.php @@ -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 = " diff --git a/CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php b/CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php index 080f3df0cb..905aef6fe2 100644 --- a/CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php +++ b/CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php @@ -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); } -}; +} + +; diff --git a/CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php b/CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php index fc05be3f70..07c7bb797d 100644 --- a/CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php +++ b/CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php @@ -107,4 +107,6 @@ AND " . self::internalFilters($rg); return array("civicrm_contact.{$rg->name}.{$rg->threshold}" => $query); } -}; +} + +; diff --git a/CRM/Dedupe/BAO/Rule.php b/CRM/Dedupe/BAO/Rule.php index e513d0c3cc..767d715e29 100644 --- a/CRM/Dedupe/BAO/Rule.php +++ b/CRM/Dedupe/BAO/Rule.php @@ -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); diff --git a/CRM/Dedupe/BAO/RuleGroup.php b/CRM/Dedupe/BAO/RuleGroup.php index 744e118c6a..bd7d5ec87c 100644 --- a/CRM/Dedupe/BAO/RuleGroup.php +++ b/CRM/Dedupe/BAO/RuleGroup.php @@ -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 diff --git a/CRM/Dedupe/Finder.php b/CRM/Dedupe/Finder.php index 451c552667..094b399621 100644 --- a/CRM/Dedupe/Finder.php +++ b/CRM/Dedupe/Finder.php @@ -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])) { diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index 8d7e2fc558..3d0da9030f 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -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]); diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index 8bbb8c8282..0a6fba66a2 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -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); } diff --git a/CRM/Event/BAO/ParticipantPayment.php b/CRM/Event/BAO/ParticipantPayment.php index 6a203bf908..1014483149 100644 --- a/CRM/Event/BAO/ParticipantPayment.php +++ b/CRM/Event/BAO/ParticipantPayment.php @@ -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; diff --git a/CRM/Event/BAO/ParticipantStatusType.php b/CRM/Event/BAO/ParticipantStatusType.php index 23797561ec..86439c42a7 100644 --- a/CRM/Event/BAO/ParticipantStatusType.php +++ b/CRM/Event/BAO/ParticipantStatusType.php @@ -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)) { diff --git a/CRM/Event/BAO/Query.php b/CRM/Event/BAO/Query.php index c343efef6e..ca8f7550a7 100644 --- a/CRM/Event/BAO/Query.php +++ b/CRM/Event/BAO/Query.php @@ -432,7 +432,7 @@ class CRM_Event_BAO_Query { "[[:>:]]' "; $query->_tables['civicrm_participant'] = - $query->_whereTables['civicrm_participant'] = 1; + $query->_whereTables['civicrm_participant'] = 1; } return; diff --git a/CRM/Event/Badge.php b/CRM/Event/Badge.php index 5baee3d5a4..f5e59dad35 100644 --- a/CRM/Event/Badge.php +++ b/CRM/Event/Badge.php @@ -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) { diff --git a/CRM/Event/Badge/Logo.php b/CRM/Event/Badge/Logo.php index 575631f22f..016979c6da 100644 --- a/CRM/Event/Badge/Logo.php +++ b/CRM/Event/Badge/Logo.php @@ -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); diff --git a/CRM/Event/Badge/Logo5395.php b/CRM/Event/Badge/Logo5395.php index 9fb927d4d9..59d1d18231 100644 --- a/CRM/Event/Badge/Logo5395.php +++ b/CRM/Event/Badge/Logo5395.php @@ -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); diff --git a/CRM/Event/Badge/NameTent.php b/CRM/Event/Badge/NameTent.php index 6345be427c..3bca8a13a2 100644 --- a/CRM/Event/Badge/NameTent.php +++ b/CRM/Event/Badge/NameTent.php @@ -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 (); } diff --git a/CRM/Event/Cart/BAO/Cart.php b/CRM/Event/Cart/BAO/Cart.php index c14cbaf4aa..f6841d258c 100644 --- a/CRM/Event/Cart/BAO/Cart.php +++ b/CRM/Event/Cart/BAO/Cart.php @@ -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; } /** diff --git a/CRM/Event/Cart/BAO/Conference.php b/CRM/Event/Cart/BAO/Conference.php index b207e6c7d5..d96f36aaec 100644 --- a/CRM/Event/Cart/BAO/Conference.php +++ b/CRM/Event/Cart/BAO/Conference.php @@ -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); diff --git a/CRM/Event/Cart/BAO/EventInCart.php b/CRM/Event/Cart/BAO/EventInCart.php index f1cbf8562a..b9f661a0d9 100644 --- a/CRM/Event/Cart/BAO/EventInCart.php +++ b/CRM/Event/Cart/BAO/EventInCart.php @@ -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) { diff --git a/CRM/Event/Cart/Form/Cart.php b/CRM/Event/Cart/Form/Cart.php index ef67dbfb8d..c227a3c829 100644 --- a/CRM/Event/Cart/Form/Cart.php +++ b/CRM/Event/Cart/Form/Cart.php @@ -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(); diff --git a/CRM/Event/Cart/Form/Checkout/ConferenceEvents.php b/CRM/Event/Cart/Form/Checkout/ConferenceEvents.php index 7f8c70d5d7..b6c6a2057e 100644 --- a/CRM/Event/Cart/Form/Checkout/ConferenceEvents.php +++ b/CRM/Event/Cart/Form/Checkout/ConferenceEvents.php @@ -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 . "

    " : '') . $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); } diff --git a/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php b/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php index 897f8478db..608c1e2399 100644 --- a/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php +++ b/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php @@ -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) { diff --git a/CRM/Event/Cart/Form/Checkout/Payment.php b/CRM/Event/Cart/Form/Checkout/Payment.php index c433ca8e7d..38b7b9c7b2 100644 --- a/CRM/Event/Cart/Form/Checkout/Payment.php +++ b/CRM/Event/Cart/Form/Checkout/Payment.php @@ -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)); diff --git a/CRM/Event/Cart/Form/MerParticipant.php b/CRM/Event/Cart/Form/MerParticipant.php index f67fef8076..b483498281 100644 --- a/CRM/Event/Cart/Form/MerParticipant.php +++ b/CRM/Event/Cart/Form/MerParticipant.php @@ -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(), + ))); } /** diff --git a/CRM/Event/Cart/Page/AddToCart.php b/CRM/Event/Cart/Page/AddToCart.php index 327029bf7f..1aabf6919a 100644 --- a/CRM/Event/Cart/Page/AddToCart.php +++ b/CRM/Event/Cart/Page/AddToCart.php @@ -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("%1 has been added to your cart. View your cart.", array(1 => $event_in_cart->event->title, 2 => $url))); + CRM_Utils_System::setUFMessage(ts("%1 has been added to your cart. View your cart.", array( + 1 => $event_in_cart->event->title, + 2 => $url + ))); $transaction->commit(); diff --git a/CRM/Event/Cart/Page/CheckoutAJAX.php b/CRM/Event/Cart/Page/CheckoutAJAX.php index 8b85bf6e80..194f8b50fb 100644 --- a/CRM/Event/Cart/Page/CheckoutAJAX.php +++ b/CRM/Event/Cart/Page/CheckoutAJAX.php @@ -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); diff --git a/CRM/Event/Cart/Page/RemoveFromCart.php b/CRM/Event/Cart/Page/RemoveFromCart.php index 72e3298a6e..06ea46b528 100644 --- a/CRM/Event/Cart/Page/RemoveFromCart.php +++ b/CRM/Event/Cart/Page/RemoveFromCart.php @@ -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("%1 has been removed from your cart.", array(1 => $removed_event_title)), '', 'success'); $transaction->commit(); diff --git a/CRM/Event/Cart/StateMachine/Checkout.php b/CRM/Event/Cart/StateMachine/Checkout.php index d56d42ede9..c6d58689a9 100644 --- a/CRM/Event/Cart/StateMachine/Checkout.php +++ b/CRM/Event/Cart/StateMachine/Checkout.php @@ -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) { diff --git a/CRM/Event/Config.php b/CRM/Event/Config.php index 91c15903c9..b60823435f 100644 --- a/CRM/Event/Config.php +++ b/CRM/Event/Config.php @@ -35,4 +35,5 @@ * $Id$ * */ -class CRM_Event_Config extends CRM_Core_Component_Config {} +class CRM_Event_Config extends CRM_Core_Component_Config { +} diff --git a/CRM/Event/Form/EventFees.php b/CRM/Event/Form/EventFees.php index 477b056e32..e5628f00e7 100644 --- a/CRM/Event/Form/EventFees.php +++ b/CRM/Event/Form/EventFees.php @@ -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 { diff --git a/CRM/Event/Form/ManageEvent.php b/CRM/Event/Form/ManageEvent.php index 7e1e55a5c0..53644e2287 100644 --- a/CRM/Event/Form/ManageEvent.php +++ b/CRM/Event/Form/ManageEvent.php @@ -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}" + )); } } } diff --git a/CRM/Event/Form/ManageEvent/Conference.php b/CRM/Event/Form/ManageEvent/Conference.php index ad967dbea7..a1ba39b20e 100644 --- a/CRM/Event/Form/ManageEvent/Conference.php +++ b/CRM/Event/Form/ManageEvent/Conference.php @@ -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 ); diff --git a/CRM/Event/Form/ManageEvent/Delete.php b/CRM/Event/Form/ManageEvent/Delete.php index f18783abde..2507a7cc84 100644 --- a/CRM/Event/Form/ManageEvent/Delete.php +++ b/CRM/Event/Form/ManageEvent/Delete.php @@ -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 CiviEvent >> Find Participants page .', - array(1 => $searchURL) - ), ts('Deletion Error'), 'error'); + array(1 => $searchURL) + ), ts('Deletion Error'), 'error'); return; } CRM_Event_BAO_Event::del($this->_id); diff --git a/CRM/Event/Form/ManageEvent/EventInfo.php b/CRM/Event/Form/ManageEvent/EventInfo.php index 74b04386cd..86a0bc70c6 100644 --- a/CRM/Event/Form/ManageEvent/EventInfo.php +++ b/CRM/Event/Form/ManageEvent/EventInfo.php @@ -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) { diff --git a/CRM/Event/Form/ManageEvent/Fee.php b/CRM/Event/Form/ManageEvent/Fee.php index 1685248f2a..4e25a57bb5 100644 --- a/CRM/Event/Form/ManageEvent/Fee.php +++ b/CRM/Event/Form/ManageEvent/Fee.php @@ -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); } } diff --git a/CRM/Event/Form/ManageEvent/Location.php b/CRM/Event/Form/ManageEvent/Location.php index ceb4cb239d..25588f5cb2 100644 --- a/CRM/Event/Form/ManageEvent/Location.php +++ b/CRM/Event/Form/ManageEvent/Location.php @@ -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; } diff --git a/CRM/Event/Form/ManageEvent/Registration.php b/CRM/Event/Form/ManageEvent/Registration.php index 010168182b..7714a34d6d 100644 --- a/CRM/Event/Form/ManageEvent/Registration.php +++ b/CRM/Event/Form/ManageEvent/Registration.php @@ -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']; } diff --git a/CRM/Event/Form/ManageEvent/Repeat.php b/CRM/Event/Form/ManageEvent/Repeat.php index d6f7ee2370..b418855348 100644 --- a/CRM/Event/Form/ManageEvent/Repeat.php +++ b/CRM/Event/Form/ManageEvent/Repeat.php @@ -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) { diff --git a/CRM/Event/Form/ManageEvent/TabHeader.php b/CRM/Event/Form/ManageEvent/TabHeader.php index edd9177eea..54198ece0a 100644 --- a/CRM/Event/Form/ManageEvent/TabHeader.php +++ b/CRM/Event/Form/ManageEvent/TabHeader.php @@ -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) { diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index 4a247eca19..a750a12532 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -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, '
    '); @@ -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}" + )); } } } diff --git a/CRM/Event/Form/ParticipantFeeSelection.php b/CRM/Event/Form/ParticipantFeeSelection.php index 44eafbc624..0e0be7404a 100644 --- a/CRM/Event/Form/ParticipantFeeSelection.php +++ b/CRM/Event/Form/ParticipantFeeSelection.php @@ -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}" + )); } } diff --git a/CRM/Event/Form/ParticipantView.php b/CRM/Event/Form/ParticipantView.php index 43510502fe..e14f071acb 100644 --- a/CRM/Event/Form/ParticipantView.php +++ b/CRM/Event/Form/ParticipantView.php @@ -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; } diff --git a/CRM/Event/Form/Registration.php b/CRM/Event/Form/Registration.php index d901357cf4..e58bfb6c5d 100644 --- a/CRM/Event/Form/Registration.php +++ b/CRM/Event/Form/Registration.php @@ -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 && diff --git a/CRM/Event/Form/Registration/AdditionalParticipant.php b/CRM/Event/Form/Registration/AdditionalParticipant.php index 9b86dfcd3c..e69ae49be0 100644 --- a/CRM/Event/Form/Registration/AdditionalParticipant.php +++ b/CRM/Event/Form/Registration/AdditionalParticipant.php @@ -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' => '                  ', @@ -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; diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php index 37997cc45c..b901947c09 100644 --- a/CRM/Event/Form/Registration/Confirm.php +++ b/CRM/Event/Form/Registration/Confirm.php @@ -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'; diff --git a/CRM/Event/Form/Registration/ParticipantConfirm.php b/CRM/Event/Form/Registration/ParticipantConfirm.php index 6d3ca4c6a3..581b48ae34 100644 --- a/CRM/Event/Form/Registration/ParticipantConfirm.php +++ b/CRM/Event/Form/Registration/ParticipantConfirm.php @@ -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 = '

    ' . ts('Your Credit Card transaction was not successful. No money has yet been charged to your card.') . '

    ' . 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'])) . '
    '; + 1 => $values['title'] + )) . '
    '; } else { $statusMsg = '
    ' . ts('Confirm your registration for %1.', array( - 1 => $values['title'])) . '

    ' . ts('Click the "Confirm Registration" button to begin, or click "Cancel Registration" if you are no longer interested in attending this event.') . '
    '; + 1 => $values['title'] + )) . '

    ' . ts('Click the "Confirm Registration" button to begin, or click "Cancel Registration" if you are no longer interested in attending this event.') . '
    '; } $buttons = array_merge($buttons, array( array( - 'type' => 'next', - 'name' => ts('Confirm Registration'), - 'spacing' => '         ', - 'isDefault' => TRUE, - ))); + 'type' => 'next', + 'name' => ts('Confirm Registration'), + 'spacing' => '         ', + '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' => '         ', - 'js' => array('onclick' => 'return confirm(\'' . $cancelConfirm . '\');'), - ))); + 'type' => 'submit', + 'name' => ts('Cancel Registration'), + 'spacing' => '         ', + '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') { diff --git a/CRM/Event/Form/Registration/Register.php b/CRM/Event/Form/Registration/Register.php index 0e28ad1809..25ab5a0bb6 100644 --- a/CRM/Event/Form/Registration/Register.php +++ b/CRM/Event/Form/Registration/Register.php @@ -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 { diff --git a/CRM/Event/Form/Registration/ThankYou.php b/CRM/Event/Form/Registration/ThankYou.php index 95e10de766..6e33d880ab 100644 --- a/CRM/Event/Form/Registration/ThankYou.php +++ b/CRM/Event/Form/Registration/ThankYou.php @@ -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) { diff --git a/CRM/Event/Form/Search.php b/CRM/Event/Form/Search.php index 1cdb4b3189..12baa8350c 100644 --- a/CRM/Event/Form/Search.php +++ b/CRM/Event/Form/Search.php @@ -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 diff --git a/CRM/Event/Form/SearchEvent.php b/CRM/Event/Form/SearchEvent.php index 3e3087e0ec..a0a2cd6be4 100644 --- a/CRM/Event/Form/SearchEvent.php +++ b/CRM/Event/Form/SearchEvent.php @@ -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() { diff --git a/CRM/Event/Form/Task.php b/CRM/Event/Form/Task.php index 95eee70f72..2cc7538dcf 100644 --- a/CRM/Event/Form/Task.php +++ b/CRM/Event/Form/Task.php @@ -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 + )); } } diff --git a/CRM/Event/Form/Task/AddToGroup.php b/CRM/Event/Form/Task/AddToGroup.php index 0d390a77d8..9660e63565 100644 --- a/CRM/Event/Form/Task/AddToGroup.php +++ b/CRM/Event/Form/Task/AddToGroup.php @@ -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 = '
    • ' . implode('
    • ', $status) . '
    '; - 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)); } } diff --git a/CRM/Event/Form/Task/Badge.php b/CRM/Event/Form/Task/Badge.php index 4819649cb5..b55c05c6cd 100644 --- a/CRM/Event/Form/Task/Badge.php +++ b/CRM/Event/Form/Task/Badge.php @@ -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'; diff --git a/CRM/Event/Form/Task/Batch.php b/CRM/Event/Form/Task/Batch.php index 50e93a14ff..f5d9d01710 100644 --- a/CRM/Event/Form/Task/Batch.php +++ b/CRM/Event/Form/Task/Batch.php @@ -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. diff --git a/CRM/Event/Form/Task/Delete.php b/CRM/Event/Form/Task/Delete.php index 24a3b4c79c..7269f6665f 100644 --- a/CRM/Event/Form/Task/Delete.php +++ b/CRM/Event/Form/Task/Delete.php @@ -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:') . '
    ' . $participantLinks; } diff --git a/CRM/Event/Form/Task/ParticipantStatus.php b/CRM/Event/Form/Task/ParticipantStatus.php index 25f68f10e6..f27f0d818b 100644 --- a/CRM/Event/Form/Task/ParticipantStatus.php +++ b/CRM/Event/Form/Task/ParticipantStatus.php @@ -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'); diff --git a/CRM/Event/Form/Task/PickProfile.php b/CRM/Event/Form/Task/PickProfile.php index 932b05b95c..1d73c1383f 100644 --- a/CRM/Event/Form/Task/PickProfile.php +++ b/CRM/Event/Form/Task/PickProfile.php @@ -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')); } diff --git a/CRM/Event/Import/Form/DataSource.php b/CRM/Event/Import/Form/DataSource.php index fda54b9f04..dae3c5a63f 100644 --- a/CRM/Event/Import/Form/DataSource.php +++ b/CRM/Event/Import/Form/DataSource.php @@ -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); diff --git a/CRM/Event/Import/Form/MapField.php b/CRM/Event/Import/Form/MapField.php index 9134670257..b34e74590a 100644 --- a/CRM/Event/Import/Form/MapField.php +++ b/CRM/Event/Import/Form/MapField.php @@ -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 = "
    " . ts('Case Subject') . "{$dao->subject}
    " . ts('Case Type') . "{$dao->case_type}
    " . ts('Case Status') . "{$cs}
    " . ts('Case Start Date') . "" . CRM_Utils_Date::customFormat($dao->start_date) . "