From 00be918220e9ac8f6d25d12ed3c9c49fddd07ff7 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 30 Dec 2014 14:06:54 -0800 Subject: [PATCH] phpcs - Fix error, "Visibility must be declared on method" --- CRM/ACL/API.php | 2 +- CRM/ACL/BAO/ACL.php | 20 +- CRM/ACL/BAO/Cache.php | 12 +- CRM/ACL/BAO/EntityRole.php | 10 +- CRM/ACL/Form/ACL.php | 4 +- CRM/ACL/Form/ACLBasic.php | 4 +- CRM/ACL/Form/WordPress/Permissions.php | 4 +- CRM/ACL/Page/ACL.php | 14 +- CRM/ACL/Page/ACLBasic.php | 14 +- CRM/ACL/Page/EntityRole.php | 14 +- CRM/Activity/BAO/Activity.php | 32 +-- CRM/Activity/BAO/ActivityAssignment.php | 6 +- CRM/Activity/BAO/ActivityContact.php | 8 +- CRM/Activity/BAO/ActivityTarget.php | 6 +- CRM/Activity/BAO/ICalendar.php | 6 +- CRM/Activity/BAO/Query.php | 16 +- CRM/Activity/Controller/Search.php | 2 +- CRM/Activity/Form/Activity.php | 12 +- CRM/Activity/Form/ActivityFilter.php | 2 +- CRM/Activity/Form/ActivityLinks.php | 2 +- CRM/Activity/Form/Search.php | 10 +- CRM/Activity/Form/Task.php | 6 +- CRM/Activity/Form/Task/AddToTag.php | 6 +- CRM/Activity/Form/Task/Batch.php | 6 +- CRM/Activity/Form/Task/Delete.php | 4 +- CRM/Activity/Form/Task/FileOnCase.php | 6 +- CRM/Activity/Form/Task/PickOption.php | 8 +- CRM/Activity/Form/Task/PickProfile.php | 8 +- CRM/Activity/Form/Task/Print.php | 4 +- CRM/Activity/Form/Task/RemoveFromTag.php | 6 +- CRM/Activity/Form/Task/SMS.php | 2 +- .../Form/Task/SearchTaskHookSample.php | 2 +- CRM/Activity/Import/Controller.php | 2 +- CRM/Activity/Import/Field.php | 8 +- CRM/Activity/Import/Form/MapField.php | 2 +- CRM/Activity/Import/Parser.php | 10 +- CRM/Activity/Import/Parser/Activity.php | 14 +- CRM/Activity/Page/AJAX.php | 14 +- CRM/Activity/Page/Tab.php | 10 +- CRM/Activity/Page/UserDashboard.php | 4 +- CRM/Activity/Selector/Activity.php | 10 +- CRM/Activity/Selector/Search.php | 12 +- CRM/Activity/StateMachine/Search.php | 8 +- CRM/Activity/Task.php | 8 +- CRM/Admin/Form.php | 4 +- CRM/Admin/Form/ContactType.php | 2 +- CRM/Admin/Form/Extensions.php | 4 +- CRM/Admin/Form/Job.php | 6 +- CRM/Admin/Form/LabelFormats.php | 4 +- CRM/Admin/Form/MailSettings.php | 6 +- CRM/Admin/Form/Mapping.php | 2 +- CRM/Admin/Form/MessageTemplates.php | 2 +- CRM/Admin/Form/Options.php | 4 +- CRM/Admin/Form/ParticipantStatus.php | 4 +- CRM/Admin/Form/PaymentProcessor.php | 10 +- CRM/Admin/Form/PaymentProcessorType.php | 4 +- CRM/Admin/Form/PdfFormats.php | 2 +- CRM/Admin/Form/Preferences.php | 6 +- CRM/Admin/Form/Preferences/Address.php | 6 +- CRM/Admin/Form/Preferences/Campaign.php | 2 +- CRM/Admin/Form/Preferences/Contribute.php | 6 +- CRM/Admin/Form/Preferences/Display.php | 4 +- CRM/Admin/Form/Preferences/Event.php | 2 +- CRM/Admin/Form/Preferences/Mailing.php | 4 +- CRM/Admin/Form/Preferences/Member.php | 4 +- CRM/Admin/Form/Preferences/Multisite.php | 2 +- CRM/Admin/Form/PreferencesDate.php | 2 +- CRM/Admin/Form/RelationshipType.php | 2 +- CRM/Admin/Form/ScheduleReminders.php | 4 +- CRM/Admin/Form/Setting.php | 2 +- CRM/Admin/Form/Setting/Component.php | 2 +- CRM/Admin/Form/Setting/Localization.php | 4 +- CRM/Admin/Form/Setting/Mail.php | 2 +- CRM/Admin/Form/Setting/Mapping.php | 4 +- CRM/Admin/Form/Setting/Miscellaneous.php | 2 +- CRM/Admin/Form/Setting/Smtp.php | 4 +- .../Form/Setting/UpdateConfigBackend.php | 6 +- CRM/Admin/Form/Setting/Url.php | 2 +- CRM/Admin/Form/WordReplacements.php | 4 +- CRM/Admin/Page/AJAX.php | 14 +- CRM/Admin/Page/APIDoc.php | 6 +- CRM/Admin/Page/APIExplorer.php | 4 +- CRM/Admin/Page/Access.php | 2 +- CRM/Admin/Page/Admin.php | 2 +- CRM/Admin/Page/CMSUser.php | 2 +- CRM/Admin/Page/ConfigTaskList.php | 2 +- CRM/Admin/Page/ContactType.php | 14 +- CRM/Admin/Page/EventTemplate.php | 12 +- CRM/Admin/Page/Extensions.php | 18 +- CRM/Admin/Page/ExtensionsUpgrade.php | 4 +- CRM/Admin/Page/Job.php | 14 +- CRM/Admin/Page/JobLog.php | 14 +- CRM/Admin/Page/LabelFormats.php | 12 +- CRM/Admin/Page/LocationType.php | 10 +- CRM/Admin/Page/MailSettings.php | 12 +- CRM/Admin/Page/Mapping.php | 16 +- CRM/Admin/Page/MessageTemplates.php | 18 +- CRM/Admin/Page/Navigation.php | 12 +- CRM/Admin/Page/Options.php | 16 +- CRM/Admin/Page/ParticipantStatus.php | 12 +- CRM/Admin/Page/PaymentProcessor.php | 14 +- CRM/Admin/Page/PaymentProcessorType.php | 10 +- CRM/Admin/Page/PdfFormats.php | 12 +- CRM/Admin/Page/Persistent.php | 6 +- CRM/Admin/Page/PreferencesDate.php | 12 +- CRM/Admin/Page/RelationshipType.php | 10 +- CRM/Admin/Page/ScheduleReminders.php | 10 +- CRM/Admin/Page/Setting.php | 2 +- CRM/Admin/Page/Tag.php | 16 +- CRM/Badge/BAO/Badge.php | 6 +- CRM/Badge/BAO/Layout.php | 14 +- CRM/Badge/Form/Layout.php | 2 +- CRM/Badge/Page/AJAX.php | 2 +- CRM/Badge/Page/Layout.php | 10 +- CRM/Batch/BAO/Batch.php | 34 +-- CRM/Batch/Form/Batch.php | 2 +- CRM/Batch/Form/Entry.php | 14 +- CRM/Batch/Form/Search.php | 2 +- CRM/Batch/Page/AJAX.php | 4 +- CRM/Batch/Page/Batch.php | 14 +- CRM/Bridge/OG/CiviCRM.php | 8 +- CRM/Bridge/OG/Drupal.php | 14 +- CRM/Bridge/OG/Utils.php | 14 +- CRM/Campaign/BAO/Campaign.php | 12 +- CRM/Campaign/BAO/Petition.php | 20 +- CRM/Campaign/BAO/Query.php | 18 +- CRM/Campaign/BAO/Survey.php | 28 +-- CRM/Campaign/Controller/Search.php | 2 +- CRM/Campaign/Form/Campaign.php | 4 +- CRM/Campaign/Form/Gotv.php | 4 +- CRM/Campaign/Form/Petition.php | 4 +- CRM/Campaign/Form/Petition/Signature.php | 14 +- CRM/Campaign/Form/Search.php | 12 +- CRM/Campaign/Form/Search/Campaign.php | 2 +- CRM/Campaign/Form/Search/Petition.php | 2 +- CRM/Campaign/Form/Search/Survey.php | 2 +- CRM/Campaign/Form/Survey.php | 4 +- CRM/Campaign/Form/Survey/Main.php | 2 +- CRM/Campaign/Form/Survey/Questions.php | 2 +- CRM/Campaign/Form/Survey/Results.php | 4 +- CRM/Campaign/Form/Survey/TabHeader.php | 10 +- CRM/Campaign/Form/SurveyType.php | 2 +- CRM/Campaign/Form/Task.php | 2 +- CRM/Campaign/Form/Task/Interview.php | 14 +- CRM/Campaign/Form/Task/Print.php | 4 +- CRM/Campaign/Form/Task/Release.php | 4 +- CRM/Campaign/Form/Task/Reserve.php | 8 +- CRM/Campaign/Form/Task/Result.php | 2 +- CRM/Campaign/Page/AJAX.php | 18 +- CRM/Campaign/Page/Campaign.php | 6 +- CRM/Campaign/Page/DashBoard.php | 22 +- CRM/Campaign/Page/Petition.php | 4 +- CRM/Campaign/Page/Petition/Confirm.php | 2 +- CRM/Campaign/Page/Petition/ThankYou.php | 2 +- CRM/Campaign/Page/Survey.php | 6 +- CRM/Campaign/Page/SurveyType.php | 18 +- CRM/Campaign/Page/Vote.php | 10 +- CRM/Campaign/Selector/Search.php | 14 +- CRM/Campaign/StateMachine/Search.php | 4 +- CRM/Campaign/Task.php | 8 +- CRM/Case/Audit/Audit.php | 2 +- CRM/Case/BAO/Case.php | 108 ++++----- CRM/Case/BAO/CaseType.php | 20 +- CRM/Case/BAO/Query.php | 20 +- CRM/Case/Controller/Search.php | 2 +- CRM/Case/Form/Activity.php | 6 +- .../Form/Activity/ChangeCaseStartDate.php | 12 +- CRM/Case/Form/Activity/ChangeCaseStatus.php | 12 +- CRM/Case/Form/Activity/ChangeCaseType.php | 12 +- CRM/Case/Form/Activity/LinkCases.php | 12 +- CRM/Case/Form/Activity/OpenCase.php | 12 +- CRM/Case/Form/ActivityToCase.php | 4 +- CRM/Case/Form/Case.php | 8 +- CRM/Case/Form/CaseView.php | 4 +- CRM/Case/Form/CustomData.php | 2 +- CRM/Case/Form/EditClient.php | 4 +- CRM/Case/Form/Search.php | 16 +- CRM/Case/Form/Task.php | 6 +- CRM/Case/Form/Task/Delete.php | 2 +- CRM/Case/Form/Task/Print.php | 4 +- CRM/Case/Form/Task/Restore.php | 2 +- CRM/Case/Form/Task/Result.php | 2 +- CRM/Case/Form/Task/SearchTaskHookSample.php | 2 +- CRM/Case/Page/AJAX.php | 10 +- CRM/Case/Page/CaseDetails.php | 2 +- CRM/Case/Page/DashBoard.php | 4 +- CRM/Case/Page/Tab.php | 14 +- CRM/Case/Selector/Search.php | 14 +- CRM/Case/StateMachine/Search.php | 6 +- CRM/Case/Task.php | 10 +- CRM/Case/XMLProcessor.php | 4 +- CRM/Case/XMLProcessor/Process.php | 42 ++-- CRM/Case/XMLProcessor/Report.php | 24 +- CRM/Case/XMLProcessor/Settings.php | 2 +- CRM/Case/XMLRepository.php | 4 +- CRM/Contact/BAO/Contact.php | 50 ++-- CRM/Contact/BAO/Contact/Location.php | 6 +- CRM/Contact/BAO/Contact/Optimizer.php | 6 +- CRM/Contact/BAO/Contact/Permission.php | 14 +- CRM/Contact/BAO/Contact/Utils.php | 36 +-- CRM/Contact/BAO/ContactType.php | 50 ++-- CRM/Contact/BAO/Group.php | 32 +-- CRM/Contact/BAO/GroupContact.php | 20 +- CRM/Contact/BAO/GroupContactCache.php | 26 +- CRM/Contact/BAO/GroupNesting.php | 60 ++--- CRM/Contact/BAO/GroupNestingCache.php | 12 +- CRM/Contact/BAO/GroupOrganization.php | 14 +- CRM/Contact/BAO/Household.php | 4 +- CRM/Contact/BAO/Individual.php | 10 +- CRM/Contact/BAO/ProximityQuery.php | 18 +- CRM/Contact/BAO/Query.php | 146 +++++------ CRM/Contact/BAO/Relationship.php | 48 ++-- CRM/Contact/BAO/RelationshipType.php | 10 +- CRM/Contact/BAO/SavedSearch.php | 24 +- CRM/Contact/BAO/SearchCustom.php | 10 +- CRM/Contact/BAO/SubscriptionHistory.php | 2 +- CRM/Contact/Controller/Search.php | 2 +- CRM/Contact/Form/Contact.php | 24 +- CRM/Contact/Form/CustomData.php | 4 +- CRM/Contact/Form/DedupeFind.php | 4 +- CRM/Contact/Form/DedupeRules.php | 6 +- CRM/Contact/Form/Domain.php | 8 +- CRM/Contact/Form/Edit/Address.php | 8 +- .../Form/Edit/CommunicationPreferences.php | 8 +- CRM/Contact/Form/Edit/CustomData.php | 6 +- CRM/Contact/Form/Edit/Demographics.php | 4 +- CRM/Contact/Form/Edit/Email.php | 2 +- CRM/Contact/Form/Edit/Household.php | 2 +- CRM/Contact/Form/Edit/IM.php | 2 +- CRM/Contact/Form/Edit/Individual.php | 2 +- CRM/Contact/Form/Edit/Lock.php | 2 +- CRM/Contact/Form/Edit/Notes.php | 2 +- CRM/Contact/Form/Edit/OpenID.php | 2 +- CRM/Contact/Form/Edit/Organization.php | 2 +- CRM/Contact/Form/Edit/Phone.php | 2 +- CRM/Contact/Form/Edit/TagsAndGroups.php | 4 +- CRM/Contact/Form/Edit/Website.php | 2 +- CRM/Contact/Form/GroupContact.php | 2 +- CRM/Contact/Form/Inline/Address.php | 2 +- CRM/Contact/Form/Inline/Email.php | 2 +- CRM/Contact/Form/Inline/IM.php | 2 +- CRM/Contact/Form/Inline/Lock.php | 6 +- CRM/Contact/Form/Inline/OpenID.php | 2 +- CRM/Contact/Form/Inline/Phone.php | 2 +- CRM/Contact/Form/Location.php | 4 +- CRM/Contact/Form/Merge.php | 8 +- CRM/Contact/Form/ProfileContact.php | 6 +- CRM/Contact/Form/RelatedContact.php | 4 +- CRM/Contact/Form/Relationship.php | 8 +- CRM/Contact/Form/Search.php | 22 +- CRM/Contact/Form/Search/Advanced.php | 14 +- CRM/Contact/Form/Search/Basic.php | 18 +- CRM/Contact/Form/Search/Builder.php | 10 +- CRM/Contact/Form/Search/Criteria.php | 20 +- CRM/Contact/Form/Search/Custom.php | 10 +- .../Form/Search/Custom/ActivitySearch.php | 22 +- CRM/Contact/Form/Search/Custom/Base.php | 22 +- CRM/Contact/Form/Search/Custom/Basic.php | 16 +- .../Form/Search/Custom/ContribSYBNT.php | 24 +- .../Search/Custom/ContributionAggregate.php | 22 +- CRM/Contact/Form/Search/Custom/DateAdded.php | 20 +- .../Form/Search/Custom/EmployerListing.php | 24 +- .../Form/Search/Custom/EventAggregate.php | 20 +- CRM/Contact/Form/Search/Custom/FullText.php | 36 +-- .../Custom/FullText/AbstractPartialQuery.php | 4 +- .../Form/Search/Custom/FullText/Activity.php | 6 +- .../Form/Search/Custom/FullText/Case.php | 6 +- .../Form/Search/Custom/FullText/Contact.php | 6 +- .../Search/Custom/FullText/Contribution.php | 6 +- .../Search/Custom/FullText/Membership.php | 6 +- .../Search/Custom/FullText/Participant.php | 6 +- CRM/Contact/Form/Search/Custom/Group.php | 26 +- .../Form/Search/Custom/MultipleValues.php | 24 +- .../Form/Search/Custom/PostalMailing.php | 12 +- CRM/Contact/Form/Search/Custom/PriceSet.php | 28 +-- CRM/Contact/Form/Search/Custom/Proximity.php | 16 +- .../Form/Search/Custom/RandomSegment.php | 20 +- CRM/Contact/Form/Search/Custom/Sample.php | 20 +- .../Form/Search/Custom/TagContributions.php | 20 +- .../Form/Search/Custom/ZipCodeRange.php | 18 +- CRM/Contact/Form/Search/Interface.php | 20 +- CRM/Contact/Form/Task.php | 10 +- CRM/Contact/Form/Task/AddToGroup.php | 10 +- CRM/Contact/Form/Task/AddToHousehold.php | 6 +- CRM/Contact/Form/Task/AddToOrganization.php | 4 +- CRM/Contact/Form/Task/AddToTag.php | 6 +- CRM/Contact/Form/Task/AlterPreferences.php | 8 +- CRM/Contact/Form/Task/Batch.php | 8 +- CRM/Contact/Form/Task/Delete.php | 6 +- CRM/Contact/Form/Task/Email.php | 2 +- CRM/Contact/Form/Task/EmailCommon.php | 8 +- CRM/Contact/Form/Task/HookSample.php | 4 +- CRM/Contact/Form/Task/Label.php | 14 +- CRM/Contact/Form/Task/LabelCommon.php | 16 +- CRM/Contact/Form/Task/Map.php | 4 +- CRM/Contact/Form/Task/Map/Event.php | 4 +- CRM/Contact/Form/Task/Merge.php | 2 +- CRM/Contact/Form/Task/PDF.php | 4 +- CRM/Contact/Form/Task/PDFLetterCommon.php | 16 +- CRM/Contact/Form/Task/PickProfile.php | 8 +- CRM/Contact/Form/Task/Print.php | 4 +- CRM/Contact/Form/Task/ProximityCommon.php | 8 +- CRM/Contact/Form/Task/RemoveFromGroup.php | 4 +- CRM/Contact/Form/Task/RemoveFromTag.php | 6 +- CRM/Contact/Form/Task/Result.php | 2 +- CRM/Contact/Form/Task/SMS.php | 2 +- CRM/Contact/Form/Task/SMSCommon.php | 8 +- CRM/Contact/Form/Task/SaveSearch.php | 2 +- CRM/Contact/Form/Task/SaveSearch/Update.php | 4 +- CRM/Contact/Form/Task/Unhold.php | 4 +- CRM/Contact/Form/Task/Useradd.php | 6 +- CRM/Contact/Import/Controller.php | 2 +- CRM/Contact/Import/Field.php | 8 +- CRM/Contact/Import/Form/DataSource.php | 2 +- CRM/Contact/Import/Form/MapField.php | 4 +- CRM/Contact/Import/Form/Preview.php | 2 +- CRM/Contact/Import/Page/AJAX.php | 2 +- CRM/Contact/Import/Parser.php | 32 +-- CRM/Contact/Import/Parser/Contact.php | 36 +-- CRM/Contact/Page/AJAX.php | 44 ++-- CRM/Contact/Page/CustomSearch.php | 4 +- CRM/Contact/Page/DashBoard.php | 2 +- CRM/Contact/Page/Dashlet.php | 2 +- CRM/Contact/Page/DedupeException.php | 4 +- CRM/Contact/Page/DedupeFind.php | 14 +- CRM/Contact/Page/DedupeRules.php | 16 +- CRM/Contact/Page/ImageFile.php | 2 +- CRM/Contact/Page/Inline/Actions.php | 2 +- CRM/Contact/Page/Inline/Address.php | 2 +- .../Page/Inline/CommunicationPreferences.php | 2 +- CRM/Contact/Page/Inline/ContactInfo.php | 2 +- CRM/Contact/Page/Inline/ContactName.php | 2 +- CRM/Contact/Page/Inline/CustomData.php | 2 +- CRM/Contact/Page/Inline/Demographics.php | 2 +- CRM/Contact/Page/Inline/Email.php | 2 +- CRM/Contact/Page/Inline/IM.php | 2 +- CRM/Contact/Page/Inline/OpenID.php | 2 +- CRM/Contact/Page/Inline/Phone.php | 2 +- CRM/Contact/Page/Inline/Website.php | 2 +- CRM/Contact/Page/SavedSearch.php | 8 +- CRM/Contact/Page/Task.php | 2 +- CRM/Contact/Page/View.php | 10 +- CRM/Contact/Page/View/ContactSmartGroup.php | 6 +- CRM/Contact/Page/View/CustomData.php | 4 +- CRM/Contact/Page/View/GroupContact.php | 10 +- CRM/Contact/Page/View/Log.php | 6 +- CRM/Contact/Page/View/Note.php | 16 +- CRM/Contact/Page/View/Print.php | 4 +- CRM/Contact/Page/View/Relationship.php | 16 +- CRM/Contact/Page/View/Summary.php | 10 +- CRM/Contact/Page/View/Sunlight.php | 4 +- CRM/Contact/Page/View/Tag.php | 6 +- CRM/Contact/Page/View/UserDashBoard.php | 10 +- .../Page/View/UserDashBoard/GroupContact.php | 6 +- CRM/Contact/Page/View/Useradd.php | 2 +- CRM/Contact/Page/View/Vcard.php | 2 +- CRM/Contact/Selector.php | 32 +-- CRM/Contact/Selector/Controller.php | 2 +- CRM/Contact/Selector/Custom.php | 20 +- CRM/Contact/StateMachine/Search.php | 6 +- CRM/Contact/Task.php | 10 +- CRM/Contribute/BAO/Contribution.php | 88 +++---- CRM/Contribute/BAO/Contribution/Utils.php | 14 +- CRM/Contribute/BAO/ContributionPage.php | 20 +- CRM/Contribute/BAO/ContributionRecur.php | 20 +- CRM/Contribute/BAO/ContributionSoft.php | 16 +- CRM/Contribute/BAO/ManagePremiums.php | 10 +- CRM/Contribute/BAO/Premium.php | 16 +- CRM/Contribute/BAO/Query.php | 28 +-- CRM/Contribute/Controller/Contribution.php | 4 +- .../Controller/ContributionPage.php | 2 +- CRM/Contribute/Controller/Search.php | 2 +- CRM/Contribute/Form.php | 2 +- CRM/Contribute/Form/AdditionalInfo.php | 14 +- CRM/Contribute/Form/AdditionalPayment.php | 4 +- CRM/Contribute/Form/CancelSubscription.php | 2 +- CRM/Contribute/Form/Contribution.php | 4 +- CRM/Contribute/Form/Contribution/Confirm.php | 18 +- CRM/Contribute/Form/Contribution/Main.php | 8 +- .../Form/Contribution/OnBehalfOf.php | 4 +- CRM/Contribute/Form/Contribution/ThankYou.php | 2 +- CRM/Contribute/Form/ContributionBase.php | 12 +- CRM/Contribute/Form/ContributionCharts.php | 2 +- CRM/Contribute/Form/ContributionPage.php | 6 +- .../Form/ContributionPage/AddProduct.php | 2 +- .../Form/ContributionPage/Amount.php | 4 +- .../Form/ContributionPage/Custom.php | 4 +- .../Form/ContributionPage/Premium.php | 2 +- .../Form/ContributionPage/Settings.php | 4 +- .../Form/ContributionPage/TabHeader.php | 8 +- .../Form/ContributionPage/ThankYou.php | 4 +- .../Form/ContributionPage/Widget.php | 8 +- CRM/Contribute/Form/ManagePremiums.php | 2 +- CRM/Contribute/Form/Search.php | 8 +- CRM/Contribute/Form/SearchContribution.php | 2 +- CRM/Contribute/Form/SoftCredit.php | 8 +- CRM/Contribute/Form/Task.php | 6 +- CRM/Contribute/Form/Task/Batch.php | 6 +- CRM/Contribute/Form/Task/Delete.php | 2 +- CRM/Contribute/Form/Task/Invoice.php | 8 +- CRM/Contribute/Form/Task/PDF.php | 2 +- CRM/Contribute/Form/Task/PDFLetter.php | 4 +- CRM/Contribute/Form/Task/PDFLetterCommon.php | 14 +- CRM/Contribute/Form/Task/PickProfile.php | 8 +- CRM/Contribute/Form/Task/Print.php | 4 +- CRM/Contribute/Form/Task/Result.php | 2 +- .../Form/Task/SearchTaskHookSample.php | 2 +- CRM/Contribute/Form/Task/Status.php | 6 +- CRM/Contribute/Form/UpdateBilling.php | 4 +- CRM/Contribute/Form/UpdateSubscription.php | 4 +- CRM/Contribute/Import/Controller.php | 2 +- CRM/Contribute/Import/Field.php | 8 +- CRM/Contribute/Import/Form/MapField.php | 2 +- CRM/Contribute/Import/Parser.php | 18 +- CRM/Contribute/Import/Parser/Contribution.php | 18 +- CRM/Contribute/Page/ContributionPage.php | 22 +- CRM/Contribute/Page/ContributionRecur.php | 4 +- CRM/Contribute/Page/DashBoard.php | 4 +- CRM/Contribute/Page/ManagePremiums.php | 14 +- CRM/Contribute/Page/PaymentInfo.php | 6 +- CRM/Contribute/Page/Premium.php | 14 +- CRM/Contribute/Page/SubscriptionStatus.php | 2 +- CRM/Contribute/Page/Tab.php | 14 +- CRM/Contribute/Page/UserDashboard.php | 4 +- CRM/Contribute/Selector/Search.php | 16 +- CRM/Contribute/StateMachine/Contribution.php | 2 +- .../StateMachine/ContributionPage.php | 2 +- CRM/Contribute/StateMachine/Search.php | 6 +- CRM/Contribute/Task.php | 8 +- CRM/Core/Action.php | 12 +- CRM/Core/BAO/ActionLog.php | 2 +- CRM/Core/BAO/ActionSchedule.php | 32 +-- CRM/Core/BAO/Address.php | 34 +-- CRM/Core/BAO/Block.php | 18 +- CRM/Core/BAO/CMSUser.php | 12 +- CRM/Core/BAO/Cache.php | 14 +- CRM/Core/BAO/ConfigSetting.php | 22 +- CRM/Core/BAO/CustomField.php | 44 ++-- CRM/Core/BAO/CustomGroup.php | 40 +-- CRM/Core/BAO/CustomOption.php | 10 +- CRM/Core/BAO/CustomQuery.php | 10 +- CRM/Core/BAO/CustomValue.php | 2 +- CRM/Core/BAO/CustomValueTable.php | 10 +- CRM/Core/BAO/Dashboard.php | 26 +- CRM/Core/BAO/Discount.php | 10 +- CRM/Core/BAO/Domain.php | 30 +-- CRM/Core/BAO/Email.php | 18 +- CRM/Core/BAO/EntityTag.php | 22 +- CRM/Core/BAO/Extension.php | 8 +- CRM/Core/BAO/File.php | 26 +- CRM/Core/BAO/FinancialTrxn.php | 24 +- CRM/Core/BAO/IM.php | 10 +- CRM/Core/BAO/Job.php | 12 +- CRM/Core/BAO/LabelFormat.php | 20 +- CRM/Core/BAO/Location.php | 20 +- CRM/Core/BAO/LocationType.php | 14 +- CRM/Core/BAO/Log.php | 8 +- CRM/Core/BAO/MailSettings.php | 20 +- CRM/Core/BAO/Mapping.php | 28 +-- CRM/Core/BAO/MessageTemplate.php | 16 +- CRM/Core/BAO/Navigation.php | 44 ++-- CRM/Core/BAO/Note.php | 18 +- CRM/Core/BAO/OpenID.php | 10 +- CRM/Core/BAO/OptionGroup.php | 12 +- CRM/Core/BAO/OptionValue.php | 30 +-- CRM/Core/BAO/PaperSize.php | 20 +- CRM/Core/BAO/PdfFormat.php | 20 +- CRM/Core/BAO/Persistent.php | 6 +- CRM/Core/BAO/Phone.php | 14 +- CRM/Core/BAO/Preferences.php | 6 +- CRM/Core/BAO/PreferencesDate.php | 8 +- CRM/Core/BAO/PrevNextCache.php | 24 +- CRM/Core/BAO/RecurringEntity.php | 24 +- CRM/Core/BAO/SchemaHandler.php | 28 +-- CRM/Core/BAO/Setting.php | 28 +-- CRM/Core/BAO/Tag.php | 20 +- CRM/Core/BAO/UFField.php | 36 +-- CRM/Core/BAO/UFGroup.php | 70 +++--- CRM/Core/BAO/UFMatch.php | 28 +-- CRM/Core/BAO/Website.php | 10 +- CRM/Core/BAO/WordReplacement.php | 16 +- CRM/Core/Base.php | 2 +- CRM/Core/Block.php | 16 +- CRM/Core/ClassLoader.php | 8 +- CRM/Core/CodeGen/BaseTask.php | 4 +- CRM/Core/CodeGen/Config.php | 6 +- CRM/Core/CodeGen/DAO.php | 4 +- CRM/Core/CodeGen/I18n.php | 6 +- CRM/Core/CodeGen/ITask.php | 4 +- CRM/Core/CodeGen/Main.php | 12 +- CRM/Core/CodeGen/Reflection.php | 4 +- CRM/Core/CodeGen/Schema.php | 16 +- CRM/Core/CodeGen/Specification.php | 28 +-- CRM/Core/CodeGen/Test.php | 4 +- CRM/Core/CodeGen/Util/File.php | 12 +- CRM/Core/CodeGen/Util/Smarty.php | 8 +- CRM/Core/CodeGen/Util/Template.php | 8 +- CRM/Core/CodeGen/Util/Xml.php | 2 +- CRM/Core/Component.php | 34 +-- CRM/Core/Config.php | 22 +- CRM/Core/Config/Defaults.php | 2 +- CRM/Core/Controller.php | 56 ++--- CRM/Core/Controller/Simple.php | 2 +- CRM/Core/DAO.php | 122 +++++----- CRM/Core/Error.php | 32 +-- CRM/Core/FileSearchInterface.php | 2 +- CRM/Core/Form.php | 134 +++++----- CRM/Core/Form/Date.php | 4 +- CRM/Core/Form/RecurringEntity.php | 10 +- CRM/Core/Form/Renderer.php | 16 +- CRM/Core/Form/Search.php | 6 +- CRM/Core/Form/Tag.php | 2 +- CRM/Core/I18n.php | 20 +- CRM/Core/I18n/Form.php | 6 +- CRM/Core/I18n/NativeGettext.php | 6 +- CRM/Core/I18n/PseudoConstant.php | 6 +- CRM/Core/I18n/Schema.php | 18 +- CRM/Core/I18n/SchemaStructure_2_2_0.php | 4 +- CRM/Core/I18n/SchemaStructure_3_0_alpha1.php | 4 +- CRM/Core/I18n/SchemaStructure_3_0_beta1.php | 6 +- CRM/Core/I18n/SchemaStructure_3_0_beta4.php | 6 +- CRM/Core/I18n/SchemaStructure_3_1_alpha1.php | 4 +- CRM/Core/I18n/SchemaStructure_3_1_beta2.php | 6 +- CRM/Core/I18n/SchemaStructure_3_2_beta4.php | 6 +- CRM/Core/I18n/SchemaStructure_3_3_beta1.php | 6 +- CRM/Core/I18n/SchemaStructure_3_4_0.php | 6 +- CRM/Core/I18n/SchemaStructure_3_4_beta2.php | 6 +- CRM/Core/I18n/SchemaStructure_3_4_beta3.php | 6 +- CRM/Core/I18n/SchemaStructure_4_1_0.php | 6 +- CRM/Core/I18n/SchemaStructure_4_1_alpha1.php | 6 +- CRM/Core/I18n/SchemaStructure_4_2_alpha1.php | 6 +- CRM/Core/I18n/SchemaStructure_4_3_1.php | 6 +- CRM/Core/I18n/SchemaStructure_4_5_alpha1.php | 6 +- CRM/Core/I18n/SchemaStructure_4_5_beta2.php | 6 +- CRM/Core/IDS.php | 2 +- CRM/Core/Invoke.php | 8 +- CRM/Core/Joomla.php | 2 +- CRM/Core/Key.php | 10 +- CRM/Core/Lock.php | 14 +- CRM/Core/Menu.php | 32 +-- CRM/Core/OptionGroup.php | 20 +- CRM/Core/OptionValue.php | 12 +- CRM/Core/Page.php | 38 +-- CRM/Core/Page/AJAX.php | 12 +- CRM/Core/Page/AJAX/Location.php | 8 +- CRM/Core/Page/Angular.php | 2 +- CRM/Core/Page/Basic.php | 16 +- CRM/Core/Page/File.php | 2 +- CRM/Core/Page/Inline/Help.php | 2 +- CRM/Core/Page/QUnit.php | 4 +- CRM/Core/Page/Redirect.php | 2 +- CRM/Core/Payment.php | 18 +- CRM/Core/Payment/AuthorizeNet.php | 40 +-- CRM/Core/Payment/AuthorizeNetIPN.php | 14 +- CRM/Core/Payment/BaseIPN.php | 34 +-- CRM/Core/Payment/Dummy.php | 10 +- CRM/Core/Payment/Elavon.php | 24 +- CRM/Core/Payment/FirstData.php | 16 +- CRM/Core/Payment/Form.php | 20 +- CRM/Core/Payment/Google.php | 26 +- CRM/Core/Payment/GoogleIPN.php | 22 +- CRM/Core/Payment/IATS.php | 12 +- CRM/Core/Payment/Moneris.php | 14 +- CRM/Core/Payment/PayJunction.php | 18 +- CRM/Core/Payment/PayPalIPN.php | 10 +- CRM/Core/Payment/PayPalImpl.php | 34 +-- CRM/Core/Payment/PayPalProIPN.php | 20 +- CRM/Core/Payment/PayflowPro.php | 20 +- CRM/Core/Payment/PaymentExpress.php | 16 +- CRM/Core/Payment/PaymentExpressIPN.php | 14 +- CRM/Core/Payment/PaymentExpressUtils.php | 8 +- CRM/Core/Payment/ProcessorForm.php | 4 +- CRM/Core/Payment/Realex.php | 30 +-- CRM/Core/Payment/eWAY.php | 18 +- CRM/Core/Permission.php | 32 +-- CRM/Core/Permission/Base.php | 10 +- CRM/Core/Permission/Drupal.php | 6 +- CRM/Core/Permission/Drupal6.php | 8 +- CRM/Core/Permission/Drupal8.php | 2 +- CRM/Core/Permission/DrupalBase.php | 6 +- CRM/Core/Permission/Joomla.php | 6 +- CRM/Core/Permission/Soap.php | 2 +- CRM/Core/Permission/UnitTests.php | 2 +- CRM/Core/Permission/WordPress.php | 4 +- CRM/Core/PseudoConstant.php | 10 +- CRM/Core/QuickForm/Action.php | 4 +- CRM/Core/QuickForm/Action/Back.php | 4 +- CRM/Core/QuickForm/Action/Cancel.php | 4 +- CRM/Core/QuickForm/Action/Display.php | 10 +- CRM/Core/QuickForm/Action/Done.php | 4 +- CRM/Core/QuickForm/Action/Jump.php | 4 +- CRM/Core/QuickForm/Action/Next.php | 4 +- CRM/Core/QuickForm/Action/Process.php | 4 +- CRM/Core/QuickForm/Action/Refresh.php | 4 +- CRM/Core/QuickForm/Action/Reload.php | 4 +- CRM/Core/QuickForm/Action/Submit.php | 4 +- CRM/Core/QuickForm/Action/Upload.php | 8 +- CRM/Core/QuickForm/GroupMultiSelect.php | 2 +- CRM/Core/Reference/Basic.php | 12 +- CRM/Core/Reference/OptionValue.php | 2 +- CRM/Core/Region.php | 4 +- CRM/Core/Report/Excel.php | 6 +- CRM/Core/Resources.php | 6 +- CRM/Core/SelectValues.php | 96 ++++---- CRM/Core/Selector/API.php | 14 +- CRM/Core/Selector/Base.php | 8 +- CRM/Core/Selector/Controller.php | 24 +- CRM/Core/Session.php | 42 ++-- CRM/Core/ShowHideBlocks.php | 16 +- CRM/Core/Smarty.php | 14 +- CRM/Core/Smarty/Permissions.php | 2 +- CRM/Core/State.php | 20 +- CRM/Core/StateMachine.php | 34 +-- CRM/Core/TableHierarchy.php | 2 +- CRM/Core/Transaction.php | 6 +- CRM/Custom/Form/ChangeFieldType.php | 6 +- CRM/Custom/Form/CustomData.php | 4 +- CRM/Custom/Form/DeleteField.php | 2 +- CRM/Custom/Form/DeleteGroup.php | 2 +- CRM/Custom/Form/Field.php | 4 +- CRM/Custom/Form/Group.php | 8 +- CRM/Custom/Form/MoveField.php | 4 +- CRM/Custom/Form/Option.php | 4 +- CRM/Custom/Form/Preview.php | 4 +- CRM/Custom/Import/Controller.php | 2 +- CRM/Custom/Import/Form/DataSource.php | 2 +- CRM/Custom/Import/Form/MapField.php | 2 +- CRM/Custom/Import/Parser.php | 6 +- CRM/Custom/Import/Parser/Api.php | 22 +- CRM/Custom/Page/Field.php | 10 +- CRM/Custom/Page/Group.php | 10 +- CRM/Custom/Page/Option.php | 8 +- CRM/Dashlet/Page/Activity.php | 2 +- CRM/Dashlet/Page/AllCases.php | 2 +- CRM/Dashlet/Page/Blog.php | 2 +- CRM/Dashlet/Page/CaseDashboard.php | 2 +- CRM/Dashlet/Page/MyCases.php | 2 +- CRM/Dedupe/BAO/QueryBuilder.php | 2 +- .../BAO/QueryBuilder/IndividualGeneral.php | 4 +- .../BAO/QueryBuilder/IndividualSupervised.php | 4 +- .../QueryBuilder/IndividualUnsupervised.php | 6 +- CRM/Dedupe/BAO/Rule.php | 6 +- CRM/Dedupe/BAO/RuleGroup.php | 20 +- CRM/Dedupe/Finder.php | 8 +- CRM/Dedupe/Merger.php | 38 +-- CRM/Event/BAO/Event.php | 50 ++-- CRM/Event/BAO/Participant.php | 60 ++--- CRM/Event/BAO/ParticipantPayment.php | 4 +- CRM/Event/BAO/ParticipantStatusType.php | 10 +- CRM/Event/BAO/Query.php | 20 +- CRM/Event/Badge.php | 12 +- CRM/Event/Badge/Logo.php | 2 +- CRM/Event/Badge/Logo5395.php | 2 +- CRM/Event/Badge/NameTent.php | 4 +- CRM/Event/Cart/BAO/Cart.php | 6 +- CRM/Event/Cart/BAO/Conference.php | 2 +- CRM/Event/Cart/BAO/EventInCart.php | 12 +- CRM/Event/Cart/BAO/MerParticipant.php | 16 +- CRM/Event/Cart/Controller/Checkout.php | 2 +- CRM/Event/Cart/Form/Cart.php | 18 +- .../Cart/Form/Checkout/ConferenceEvents.php | 6 +- .../Form/Checkout/ParticipantsAndPrices.php | 12 +- CRM/Event/Cart/Form/Checkout/Payment.php | 30 +-- CRM/Event/Cart/Form/Checkout/ThankYou.php | 6 +- CRM/Event/Cart/Form/MerParticipant.php | 18 +- CRM/Event/Cart/Page/AddToCart.php | 2 +- CRM/Event/Cart/Page/CheckoutAJAX.php | 4 +- CRM/Event/Cart/Page/RemoveFromCart.php | 2 +- CRM/Event/Cart/Page/ViewCart.php | 2 +- CRM/Event/Cart/StateMachine/Checkout.php | 2 +- CRM/Event/Controller/Registration.php | 4 +- CRM/Event/Controller/Search.php | 2 +- CRM/Event/Form/EventFees.php | 8 +- CRM/Event/Form/ManageEvent.php | 10 +- CRM/Event/Form/ManageEvent/Conference.php | 2 +- CRM/Event/Form/ManageEvent/EventInfo.php | 6 +- CRM/Event/Form/ManageEvent/Fee.php | 8 +- CRM/Event/Form/ManageEvent/Location.php | 8 +- CRM/Event/Form/ManageEvent/Registration.php | 30 +-- CRM/Event/Form/ManageEvent/Repeat.php | 4 +- .../Form/ManageEvent/ScheduleReminders.php | 4 +- CRM/Event/Form/ManageEvent/TabHeader.php | 8 +- CRM/Event/Form/Participant.php | 4 +- CRM/Event/Form/ParticipantFeeSelection.php | 4 +- CRM/Event/Form/Registration.php | 22 +- .../Registration/AdditionalParticipant.php | 14 +- CRM/Event/Form/Registration/Confirm.php | 6 +- CRM/Event/Form/Registration/Register.php | 10 +- CRM/Event/Form/Registration/ThankYou.php | 4 +- CRM/Event/Form/Search.php | 14 +- CRM/Event/Form/SearchEvent.php | 4 +- CRM/Event/Form/Task.php | 6 +- CRM/Event/Form/Task/AddToGroup.php | 10 +- CRM/Event/Form/Task/Badge.php | 4 +- CRM/Event/Form/Task/Batch.php | 8 +- CRM/Event/Form/Task/Cancel.php | 4 +- CRM/Event/Form/Task/Delete.php | 4 +- CRM/Event/Form/Task/ParticipantStatus.php | 2 +- CRM/Event/Form/Task/PickProfile.php | 8 +- CRM/Event/Form/Task/Print.php | 4 +- CRM/Event/Form/Task/Result.php | 2 +- CRM/Event/Form/Task/SaveSearch.php | 2 +- CRM/Event/Form/Task/SaveSearch/Update.php | 4 +- CRM/Event/Form/Task/SearchTaskHookSample.php | 2 +- CRM/Event/Import/Controller.php | 2 +- CRM/Event/Import/Field.php | 8 +- CRM/Event/Import/Form/MapField.php | 2 +- CRM/Event/Import/Parser.php | 10 +- CRM/Event/Import/Parser/Participant.php | 16 +- CRM/Event/Page/AJAX.php | 2 +- CRM/Event/Page/DashBoard.php | 4 +- CRM/Event/Page/EventInfo.php | 4 +- CRM/Event/Page/ICalendar.php | 2 +- CRM/Event/Page/ManageEvent.php | 18 +- CRM/Event/Page/ParticipantListing.php | 4 +- CRM/Event/Page/ParticipantListing/Name.php | 2 +- .../Page/ParticipantListing/NameAndEmail.php | 2 +- .../ParticipantListing/NameStatusAndDate.php | 8 +- CRM/Event/Page/ParticipantListing/Simple.php | 8 +- CRM/Event/Page/Tab.php | 14 +- CRM/Event/Page/UserDashboard.php | 4 +- CRM/Event/PseudoConstant.php | 2 +- CRM/Event/Selector/Search.php | 16 +- CRM/Event/StateMachine/Registration.php | 2 +- CRM/Event/StateMachine/Search.php | 8 +- CRM/Event/Task.php | 10 +- CRM/Export/BAO/Export.php | 26 +- CRM/Export/Form/Map.php | 2 +- CRM/Export/Form/Select.php | 6 +- CRM/Extension/Downloader.php | 2 +- CRM/Extension/Info.php | 2 +- CRM/Extension/Manager.php | 2 +- CRM/Extension/Upgrades.php | 4 +- CRM/Financial/BAO/ExportFormat.php | 24 +- CRM/Financial/BAO/ExportFormat/CSV.php | 20 +- CRM/Financial/BAO/ExportFormat/IIF.php | 24 +- CRM/Financial/BAO/FinancialAccount.php | 14 +- CRM/Financial/BAO/FinancialItem.php | 14 +- CRM/Financial/BAO/FinancialType.php | 12 +- CRM/Financial/BAO/FinancialTypeAccount.php | 14 +- CRM/Financial/BAO/PaymentProcessor.php | 28 +-- CRM/Financial/BAO/PaymentProcessorType.php | 12 +- CRM/Financial/Form/BatchTransaction.php | 6 +- CRM/Financial/Form/Export.php | 4 +- CRM/Financial/Form/FinancialAccount.php | 4 +- CRM/Financial/Form/FinancialBatch.php | 6 +- CRM/Financial/Form/FinancialTypeAccount.php | 2 +- CRM/Financial/Form/Search.php | 6 +- CRM/Financial/Page/AJAX.php | 14 +- CRM/Financial/Page/Batch.php | 14 +- CRM/Financial/Page/BatchTransaction.php | 14 +- CRM/Financial/Page/FinancialAccount.php | 14 +- CRM/Financial/Page/FinancialBatch.php | 14 +- CRM/Financial/Page/FinancialType.php | 14 +- CRM/Financial/Page/FinancialTypeAccount.php | 10 +- CRM/Friend/BAO/Friend.php | 16 +- CRM/Friend/Form.php | 2 +- CRM/Grant/BAO/Grant.php | 20 +- CRM/Grant/BAO/Query.php | 18 +- CRM/Grant/Controller/Search.php | 2 +- CRM/Grant/Form/Grant.php | 2 +- CRM/Grant/Form/Search.php | 10 +- CRM/Grant/Form/Task.php | 4 +- CRM/Grant/Form/Task/Delete.php | 2 +- CRM/Grant/Form/Task/Print.php | 4 +- CRM/Grant/Form/Task/Result.php | 2 +- CRM/Grant/Form/Task/SearchTaskHookSample.php | 2 +- CRM/Grant/Form/Task/Update.php | 4 +- CRM/Grant/Page/DashBoard.php | 4 +- CRM/Grant/Page/Tab.php | 10 +- CRM/Grant/Selector/Search.php | 12 +- CRM/Grant/StateMachine/Search.php | 4 +- CRM/Grant/Task.php | 8 +- CRM/Group/Controller.php | 4 +- CRM/Group/Form/Edit.php | 8 +- CRM/Group/Form/Search.php | 4 +- CRM/Group/Page/AJAX.php | 2 +- CRM/Group/Page/Group.php | 20 +- CRM/Group/StateMachine.php | 4 +- CRM/Import/DataSource/CSV.php | 8 +- CRM/Import/DataSource/SQL.php | 2 +- CRM/Import/Parser.php | 22 +- CRM/Import/StateMachine.php | 2 +- CRM/Logging/Differ.php | 8 +- CRM/Logging/ReportDetail.php | 8 +- CRM/Logging/ReportSummary.php | 16 +- CRM/Logging/Reverter.php | 4 +- CRM/Logging/Schema.php | 26 +- CRM/Mailing/BAO/BouncePattern.php | 2 +- CRM/Mailing/BAO/Component.php | 8 +- CRM/Mailing/BAO/Mailing.php | 32 +-- CRM/Mailing/BAO/MailingAB.php | 4 +- CRM/Mailing/BAO/MailingJob.php | 2 +- CRM/Mailing/BAO/Query.php | 18 +- CRM/Mailing/BAO/Recipients.php | 8 +- CRM/Mailing/BAO/Spool.php | 4 +- CRM/Mailing/BAO/TrackableURL.php | 2 +- CRM/Mailing/Controller/Send.php | 2 +- CRM/Mailing/Event/BAO/Bounce.php | 4 +- CRM/Mailing/Event/BAO/Confirm.php | 2 +- CRM/Mailing/Event/BAO/Delivered.php | 4 +- CRM/Mailing/Event/BAO/Forward.php | 4 +- CRM/Mailing/Event/BAO/Opened.php | 2 +- CRM/Mailing/Event/BAO/Queue.php | 4 +- CRM/Mailing/Event/BAO/Reply.php | 2 +- CRM/Mailing/Event/BAO/Subscribe.php | 2 +- CRM/Mailing/Event/BAO/TrackableURLOpen.php | 2 +- CRM/Mailing/Event/BAO/Unsubscribe.php | 2 +- CRM/Mailing/Form/Approve.php | 2 +- CRM/Mailing/Form/Browse.php | 2 +- CRM/Mailing/Form/Component.php | 6 +- CRM/Mailing/Form/ForwardMailing.php | 2 +- CRM/Mailing/Form/Group.php | 4 +- CRM/Mailing/Form/Optout.php | 6 +- CRM/Mailing/Form/Schedule.php | 2 +- CRM/Mailing/Form/Search.php | 4 +- CRM/Mailing/Form/Settings.php | 2 +- CRM/Mailing/Form/Subscribe.php | 4 +- CRM/Mailing/Form/Task.php | 6 +- CRM/Mailing/Form/Task/Print.php | 4 +- CRM/Mailing/Form/Test.php | 4 +- CRM/Mailing/Form/Unsubscribe.php | 6 +- CRM/Mailing/Form/Upload.php | 6 +- CRM/Mailing/Info.php | 2 +- CRM/Mailing/MailStore.php | 8 +- CRM/Mailing/MailStore/Imap.php | 8 +- CRM/Mailing/MailStore/Localdir.php | 8 +- CRM/Mailing/MailStore/Maildir.php | 8 +- CRM/Mailing/MailStore/Mbox.php | 8 +- CRM/Mailing/MailStore/Pop3.php | 6 +- CRM/Mailing/Page/Browse.php | 8 +- CRM/Mailing/Page/Common.php | 2 +- CRM/Mailing/Page/Component.php | 12 +- CRM/Mailing/Page/Confirm.php | 2 +- CRM/Mailing/Page/Event.php | 2 +- CRM/Mailing/Page/Optout.php | 2 +- CRM/Mailing/Page/Preview.php | 2 +- CRM/Mailing/Page/Report.php | 14 +- CRM/Mailing/Page/Resubscribe.php | 2 +- CRM/Mailing/Page/Tab.php | 6 +- CRM/Mailing/Page/Unsubscribe.php | 2 +- CRM/Mailing/Page/View.php | 4 +- CRM/Mailing/Selector/Browse.php | 20 +- CRM/Mailing/Selector/Event.php | 18 +- CRM/Mailing/Selector/Search.php | 14 +- CRM/Mailing/StateMachine/Send.php | 2 +- CRM/Mailing/Task.php | 8 +- CRM/Member/BAO/Membership.php | 74 +++--- CRM/Member/BAO/MembershipBlock.php | 6 +- CRM/Member/BAO/MembershipLog.php | 6 +- CRM/Member/BAO/MembershipPayment.php | 6 +- CRM/Member/BAO/MembershipStatus.php | 14 +- CRM/Member/BAO/MembershipType.php | 26 +- CRM/Member/BAO/Query.php | 16 +- CRM/Member/Controller/Search.php | 2 +- CRM/Member/Form.php | 6 +- CRM/Member/Form/Membership.php | 4 +- CRM/Member/Form/MembershipBlock.php | 4 +- CRM/Member/Form/MembershipConfig.php | 4 +- CRM/Member/Form/MembershipRenewal.php | 2 +- CRM/Member/Form/MembershipType.php | 4 +- CRM/Member/Form/MembershipView.php | 6 +- CRM/Member/Form/Search.php | 10 +- CRM/Member/Form/Task.php | 6 +- CRM/Member/Form/Task/Batch.php | 6 +- CRM/Member/Form/Task/Delete.php | 4 +- CRM/Member/Form/Task/Email.php | 2 +- CRM/Member/Form/Task/Label.php | 6 +- CRM/Member/Form/Task/PDFLetter.php | 4 +- CRM/Member/Form/Task/PDFLetterCommon.php | 4 +- CRM/Member/Form/Task/PickProfile.php | 8 +- CRM/Member/Form/Task/Print.php | 4 +- CRM/Member/Form/Task/Result.php | 2 +- CRM/Member/Form/Task/SearchTaskHookSample.php | 2 +- CRM/Member/Import/Controller.php | 2 +- CRM/Member/Import/Field.php | 8 +- CRM/Member/Import/Form/MapField.php | 2 +- CRM/Member/Import/Parser.php | 10 +- CRM/Member/Import/Parser/Membership.php | 20 +- CRM/Member/Page/AJAX.php | 2 +- CRM/Member/Page/DashBoard.php | 4 +- CRM/Member/Page/MembershipStatus.php | 14 +- CRM/Member/Page/MembershipType.php | 6 +- CRM/Member/Page/Tab.php | 14 +- CRM/Member/Page/UserDashboard.php | 4 +- CRM/Member/Selector/Search.php | 12 +- CRM/Member/StateMachine/Search.php | 6 +- CRM/Member/Task.php | 8 +- CRM/Note/Form/Note.php | 4 +- CRM/PCP/BAO/PCP.php | 36 +-- CRM/PCP/Controller/PCP.php | 2 +- CRM/PCP/Form/Campaign.php | 4 +- CRM/PCP/Form/PCP.php | 4 +- CRM/PCP/Form/PCPAccount.php | 4 +- CRM/PCP/Page/PCP.php | 18 +- CRM/PCP/Page/PCPInfo.php | 4 +- CRM/PCP/StateMachine/PCP.php | 2 +- CRM/Pledge/BAO/Pledge.php | 26 +- CRM/Pledge/BAO/PledgeBlock.php | 14 +- CRM/Pledge/BAO/PledgePayment.php | 28 +-- CRM/Pledge/BAO/Query.php | 20 +- CRM/Pledge/Controller/Search.php | 2 +- CRM/Pledge/Form/Payment.php | 2 +- CRM/Pledge/Form/Pledge.php | 4 +- CRM/Pledge/Form/Search.php | 16 +- CRM/Pledge/Form/Task.php | 6 +- CRM/Pledge/Form/Task/Delete.php | 2 +- CRM/Pledge/Form/Task/Print.php | 4 +- CRM/Pledge/Form/Task/Result.php | 2 +- CRM/Pledge/Form/Task/SearchTaskHookSample.php | 2 +- CRM/Pledge/Page/AJAX.php | 4 +- CRM/Pledge/Page/DashBoard.php | 4 +- CRM/Pledge/Page/Payment.php | 4 +- CRM/Pledge/Page/Tab.php | 10 +- CRM/Pledge/Page/UserDashboard.php | 4 +- CRM/Pledge/Selector/Search.php | 12 +- CRM/Pledge/StateMachine/Search.php | 6 +- CRM/Pledge/Task.php | 10 +- CRM/Price/BAO/LineItem.php | 16 +- CRM/Price/BAO/PriceField.php | 12 +- CRM/Price/BAO/PriceFieldValue.php | 18 +- CRM/Price/BAO/PriceSet.php | 36 +-- CRM/Price/Form/Field.php | 4 +- CRM/Price/Form/Option.php | 4 +- CRM/Price/Form/Preview.php | 2 +- CRM/Price/Form/Set.php | 4 +- CRM/Price/Page/Field.php | 8 +- CRM/Price/Page/Option.php | 6 +- CRM/Price/Page/Set.php | 10 +- CRM/Profile/Form.php | 14 +- CRM/Profile/Form/Dynamic.php | 4 +- CRM/Profile/Form/Edit.php | 4 +- CRM/Profile/Form/Search.php | 4 +- CRM/Profile/Page/Dynamic.php | 12 +- CRM/Profile/Page/Listings.php | 12 +- .../Page/MultipleRecordFieldsListing.php | 14 +- CRM/Profile/Page/Router.php | 2 +- CRM/Profile/Page/View.php | 10 +- CRM/Profile/Selector/Listings.php | 16 +- CRM/Report/BAO/ReportInstance.php | 8 +- CRM/Report/Form.php | 166 ++++++------- CRM/Report/Form/Activity.php | 22 +- CRM/Report/Form/ActivitySummary.php | 16 +- CRM/Report/Form/Campaign/SurveyDetails.php | 14 +- CRM/Report/Form/Case/Demographics.php | 22 +- CRM/Report/Form/Case/Detail.php | 28 +-- CRM/Report/Form/Case/Summary.php | 18 +- CRM/Report/Form/Case/TimeSpent.php | 18 +- CRM/Report/Form/Contact/CurrentEmployer.php | 18 +- CRM/Report/Form/Contact/Detail.php | 26 +- CRM/Report/Form/Contact/Log.php | 16 +- CRM/Report/Form/Contact/LoggingDetail.php | 4 +- CRM/Report/Form/Contact/LoggingSummary.php | 6 +- CRM/Report/Form/Contact/Relationship.php | 20 +- CRM/Report/Form/Contact/Summary.php | 14 +- CRM/Report/Form/Contribute/Bookkeeping.php | 18 +- CRM/Report/Form/Contribute/Detail.php | 20 +- CRM/Report/Form/Contribute/History.php | 34 +-- .../Form/Contribute/HouseholdSummary.php | 24 +- CRM/Report/Form/Contribute/LoggingDetail.php | 4 +- CRM/Report/Form/Contribute/LoggingSummary.php | 6 +- CRM/Report/Form/Contribute/Lybunt.php | 22 +- .../Form/Contribute/OrganizationSummary.php | 24 +- CRM/Report/Form/Contribute/PCP.php | 14 +- CRM/Report/Form/Contribute/Recur.php | 12 +- CRM/Report/Form/Contribute/Repeat.php | 24 +- CRM/Report/Form/Contribute/SoftCredit.php | 20 +- CRM/Report/Form/Contribute/Summary.php | 24 +- CRM/Report/Form/Contribute/Sybunt.php | 22 +- CRM/Report/Form/Contribute/TopDonor.php | 22 +- CRM/Report/Form/Event/Income.php | 14 +- CRM/Report/Form/Event/IncomeCountSummary.php | 20 +- .../Form/Event/ParticipantListCount.php | 20 +- CRM/Report/Form/Event/ParticipantListing.php | 20 +- CRM/Report/Form/Event/Summary.php | 22 +- CRM/Report/Form/Extended.php | 106 ++++---- CRM/Report/Form/Grant/Detail.php | 12 +- CRM/Report/Form/Grant/Statistics.php | 14 +- CRM/Report/Form/Instance.php | 8 +- CRM/Report/Form/Mailing/Bounce.php | 22 +- CRM/Report/Form/Mailing/Clicks.php | 20 +- CRM/Report/Form/Mailing/Detail.php | 12 +- CRM/Report/Form/Mailing/Opened.php | 20 +- CRM/Report/Form/Mailing/Summary.php | 26 +- CRM/Report/Form/Member/ContributionDetail.php | 22 +- CRM/Report/Form/Member/Detail.php | 16 +- CRM/Report/Form/Member/Lapse.php | 18 +- CRM/Report/Form/Member/Summary.php | 18 +- CRM/Report/Form/Membership/Summary.php | 22 +- CRM/Report/Form/Pledge/Detail.php | 22 +- CRM/Report/Form/Pledge/Pbnp.php | 16 +- CRM/Report/Form/Pledge/Summary.php | 18 +- CRM/Report/Form/Register.php | 4 +- CRM/Report/Form/Walklist/Walklist.php | 16 +- CRM/Report/Interface.php | 18 +- CRM/Report/Page/Instance.php | 2 +- CRM/Report/Page/InstanceList.php | 2 +- CRM/Report/Page/Options.php | 18 +- CRM/Report/Page/Report.php | 2 +- CRM/Report/Page/TemplateList.php | 2 +- CRM/Report/Utils/Get.php | 18 +- CRM/Report/Utils/Report.php | 32 +-- CRM/SMS/BAO/Provider.php | 14 +- CRM/SMS/Controller/Send.php | 2 +- CRM/SMS/Form/Group.php | 4 +- CRM/SMS/Form/Provider.php | 4 +- CRM/SMS/Form/Schedule.php | 2 +- CRM/SMS/Form/Upload.php | 6 +- CRM/SMS/Page/Callback.php | 2 +- CRM/SMS/Page/Provider.php | 14 +- CRM/SMS/Provider.php | 18 +- CRM/SMS/StateMachine/Send.php | 2 +- CRM/Tag/Form/Tag.php | 2 +- CRM/UF/Form/AbstractPreview.php | 2 +- CRM/UF/Form/Field.php | 8 +- CRM/UF/Form/Group.php | 4 +- CRM/UF/Form/Inline/Preview.php | 2 +- CRM/UF/Form/Inline/PreviewById.php | 2 +- CRM/UF/Form/Preview.php | 2 +- CRM/UF/Page/AJAX.php | 2 +- CRM/UF/Page/Field.php | 8 +- CRM/UF/Page/Group.php | 18 +- CRM/UF/Page/ProfileEditor.php | 12 +- CRM/Upgrade/Form.php | 60 ++--- CRM/Upgrade/Headless.php | 2 +- CRM/Upgrade/Incremental/Legacy.php | 34 +-- CRM/Upgrade/Incremental/php/FourFive.php | 18 +- CRM/Upgrade/Incremental/php/FourFour.php | 36 +-- CRM/Upgrade/Incremental/php/FourOne.php | 20 +- CRM/Upgrade/Incremental/php/FourSix.php | 8 +- CRM/Upgrade/Incremental/php/FourThree.php | 54 ++--- CRM/Upgrade/Incremental/php/FourTwo.php | 36 +-- CRM/Upgrade/Incremental/php/FourZero.php | 4 +- CRM/Upgrade/Incremental/php/ThreeFour.php | 18 +- CRM/Upgrade/Incremental/php/ThreeThree.php | 14 +- CRM/Upgrade/Incremental/php/ThreeTwo.php | 8 +- CRM/Upgrade/Page/Upgrade.php | 10 +- CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php | 10 +- .../Snapshot/V4p2/Price/BAO/FieldValue.php | 14 +- .../Snapshot/V4p2/Price/BAO/LineItem.php | 8 +- CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php | 16 +- CRM/Upgrade/Snapshot/V4p2/Price/DAO/Field.php | 12 +- .../Snapshot/V4p2/Price/DAO/FieldValue.php | 8 +- .../Snapshot/V4p2/Price/DAO/LineItem.php | 8 +- CRM/Upgrade/Snapshot/V4p2/Price/DAO/Set.php | 8 +- .../Snapshot/V4p2/Price/DAO/SetEntity.php | 8 +- CRM/Upgrade/StateMachine.php | 2 +- CRM/Utils/API/MatchOption.php | 2 +- CRM/Utils/Address.php | 2 +- CRM/Utils/Address/BatchUpdate.php | 4 +- CRM/Utils/Address/USPS.php | 2 +- CRM/Utils/Api.php | 2 +- CRM/Utils/Array.php | 54 ++--- CRM/Utils/Cache.php | 6 +- CRM/Utils/Cache/APCcache.php | 10 +- CRM/Utils/Cache/ArrayCache.php | 10 +- CRM/Utils/Cache/Interface.php | 8 +- CRM/Utils/Cache/Memcache.php | 10 +- CRM/Utils/Cache/Memcached.php | 12 +- CRM/Utils/Cache/NoCache.php | 10 +- CRM/Utils/Cache/SerializeCache.php | 12 +- CRM/Utils/Cache/SqlGroup.php | 14 +- CRM/Utils/Check.php | 2 +- CRM/Utils/Check/Case.php | 2 +- CRM/Utils/Check/Message.php | 8 +- CRM/Utils/Crypt.php | 4 +- CRM/Utils/Date.php | 50 ++-- CRM/Utils/FakeObject.php | 4 +- CRM/Utils/File.php | 48 ++-- CRM/Utils/Geocode/Google.php | 2 +- CRM/Utils/Geocode/Yahoo.php | 2 +- CRM/Utils/Hook.php | 176 +++++++------- CRM/Utils/Hook/DrupalBase.php | 2 +- CRM/Utils/Hook/UnitTests.php | 6 +- CRM/Utils/Hook/WordPress.php | 2 +- CRM/Utils/ICalendar.php | 6 +- CRM/Utils/JSON.php | 8 +- CRM/Utils/Mail.php | 18 +- CRM/Utils/Mail/EmailProcessor.php | 10 +- CRM/Utils/Mail/Incoming.php | 24 +- CRM/Utils/Migrate/Export.php | 18 +- CRM/Utils/Migrate/ExportJSON.php | 50 ++-- CRM/Utils/Migrate/Import.php | 28 +-- CRM/Utils/Migrate/ImportJSON.php | 28 +-- CRM/Utils/Money.php | 2 +- CRM/Utils/Number.php | 4 +- CRM/Utils/OpenFlashChart.php | 12 +- CRM/Utils/PDF/Label.php | 14 +- CRM/Utils/PDF/Utils.php | 10 +- CRM/Utils/Pager.php | 22 +- CRM/Utils/PagerAToZ.php | 8 +- CRM/Utils/QueryFormatter.php | 2 +- CRM/Utils/REST.php | 32 +-- CRM/Utils/ReCAPTCHA.php | 8 +- CRM/Utils/Recent.php | 8 +- CRM/Utils/Request.php | 6 +- CRM/Utils/Rule.php | 76 +++--- CRM/Utils/Signer.php | 8 +- CRM/Utils/Sort.php | 16 +- CRM/Utils/String.php | 42 ++-- CRM/Utils/Sunlight.php | 14 +- CRM/Utils/System.php | 124 +++++----- CRM/Utils/System/Base.php | 48 ++-- CRM/Utils/System/Drupal.php | 58 ++--- CRM/Utils/System/Drupal6.php | 58 ++--- CRM/Utils/System/Drupal8.php | 40 +-- CRM/Utils/System/DrupalBase.php | 44 ++-- CRM/Utils/System/Joomla.php | 58 ++--- CRM/Utils/System/Soap.php | 18 +- CRM/Utils/System/UnitTests.php | 34 +-- CRM/Utils/System/WordPress.php | 56 ++--- CRM/Utils/Time.php | 10 +- CRM/Utils/Token.php | 14 +- CRM/Utils/Type.php | 2 +- CRM/Utils/VersionCheck.php | 4 +- CRM/Utils/Weight.php | 18 +- CRM/Utils/Wrapper.php | 2 +- CRM/Widget/Widget.php | 6 +- Civi/CCase/CaseChangeListener.php | 2 +- Civi/CCase/Event/CaseChangeEvent.php | 2 +- Civi/CiUtil/Arrays.php | 2 +- Civi/CiUtil/Command/AntagonistCommand.php | 4 +- Civi/CiUtil/Command/CompareCommand.php | 2 +- Civi/CiUtil/Command/LsCommand.php | 2 +- Civi/CiUtil/ComparisonPrinter.php | 6 +- Civi/CiUtil/CsvPrinter.php | 6 +- Civi/CiUtil/EnvTestRunner.php | 2 +- Civi/CiUtil/PHPUnitScanner.php | 6 +- Civi/Core/DAO/Event/PostDelete.php | 2 +- Civi/Core/DAO/Event/PostUpdate.php | 2 +- Civi/Core/Event/PostEvent.php | 2 +- Civi/Core/Event/PreEvent.php | 2 +- Civi/Core/Transaction/Manager.php | 2 +- Civi/Install/Requirements.php | 4 +- .../Activity/BAO/ActivityAssignmentTest.php | 14 +- .../phpunit/CRM/Activity/BAO/ActivityTest.php | 32 +-- tests/phpunit/CRM/Batch/Form/EntryTest.php | 12 +- tests/phpunit/CRM/Bridge/OG/DrupalTest.php | 2 +- tests/phpunit/CRM/Case/BAO/CaseTest.php | 14 +- .../phpunit/CRM/Case/BAO/CaseTypeForkTest.php | 8 +- tests/phpunit/CRM/Case/BAO/CaseTypeTest.php | 12 +- tests/phpunit/CRM/Case/PseudoConstantTest.php | 2 +- tests/phpunit/CRM/Case/XMLRepositoryTest.php | 12 +- tests/phpunit/CRM/Contact/BAO/ContactTest.php | 48 ++-- .../BAO/ContactType/ContactSearchTest.php | 12 +- .../Contact/BAO/ContactType/ContactTest.php | 10 +- .../BAO/ContactType/ContactTypeTest.php | 18 +- .../BAO/ContactType/RelationshipTest.php | 22 +- .../CRM/Contact/BAO/GroupContactCacheTest.php | 10 +- .../CRM/Contact/BAO/GroupContactTest.php | 6 +- tests/phpunit/CRM/Contact/BAO/GroupTest.php | 10 +- tests/phpunit/CRM/Contact/BAO/QueryTest.php | 12 +- .../Contact/Form/Search/Custom/GroupTest.php | 4 +- .../Contribute/BAO/ContributionPageTest.php | 14 +- .../Contribute/BAO/ContributionRecurTest.php | 8 +- .../CRM/Contribute/BAO/ContributionTest.php | 18 +- .../Contribute/BAO/ContributionTypeTest.php | 12 +- .../CRM/Contribute/BAO/ManagePremiumsTest.php | 10 +- .../CRM/Core/BAO/ActionScheduleTest.php | 36 +-- tests/phpunit/CRM/Core/BAO/AddressTest.php | 14 +- .../phpunit/CRM/Core/BAO/CustomFieldTest.php | 16 +- .../phpunit/CRM/Core/BAO/CustomGroupTest.php | 42 ++-- .../Core/BAO/CustomValueTableMultipleTest.php | 10 +- .../Core/BAO/CustomValueTableSetGetTest.php | 6 +- .../CRM/Core/BAO/CustomValueTableTest.php | 16 +- .../phpunit/CRM/Core/BAO/CustomValueTest.php | 14 +- tests/phpunit/CRM/Core/BAO/EmailTest.php | 8 +- .../CRM/Core/BAO/FinancialTrxnTest.php | 4 +- tests/phpunit/CRM/Core/BAO/IMTest.php | 6 +- tests/phpunit/CRM/Core/BAO/LocationTest.php | 14 +- tests/phpunit/CRM/Core/BAO/OpenIDTest.php | 10 +- tests/phpunit/CRM/Core/BAO/PhoneTest.php | 8 +- .../phpunit/CRM/Core/BAO/PreferencesTest.php | 6 +- .../CRM/Core/BAO/RecurringEntityTest.php | 4 +- tests/phpunit/CRM/Core/BAO/SettingTest.php | 26 +- tests/phpunit/CRM/Core/BAO/UFFieldTest.php | 2 +- .../CRM/Core/CommunityMessagesTest.php | 2 +- tests/phpunit/CRM/Core/Config/MailerTest.php | 4 +- tests/phpunit/CRM/Core/DAOTest.php | 18 +- tests/phpunit/CRM/Core/ErrorTest.php | 12 +- tests/phpunit/CRM/Core/FieldOptionsTest.php | 4 +- tests/phpunit/CRM/Core/InnoDBIndexerTest.php | 10 +- tests/phpunit/CRM/Core/JobManagerTest.php | 4 +- .../phpunit/CRM/Core/ManagedEntitiesTest.php | 24 +- tests/phpunit/CRM/Core/MenuTest.php | 4 +- tests/phpunit/CRM/Core/Page/RedirectTest.php | 2 +- .../CRM/Core/Payment/AuthorizeNetIPNTest.php | 12 +- .../CRM/Core/Payment/AuthorizeNetTest.php | 8 +- .../phpunit/CRM/Core/Payment/BaseIPNTest.php | 46 ++-- .../CRM/Core/Payment/PayPalProIPNTest.php | 20 +- tests/phpunit/CRM/Core/PaymentTest.php | 2 +- tests/phpunit/CRM/Core/PseudoConstantTest.php | 6 +- tests/phpunit/CRM/Core/RegionTest.php | 20 +- tests/phpunit/CRM/Core/ResourcesTest.php | 34 +-- .../CRM/Core/Smarty/plugins/CrmScopeTest.php | 6 +- tests/phpunit/CRM/Core/TransactionTest.php | 28 +-- tests/phpunit/CRM/Dedupe/DedupeFinderTest.php | 4 +- .../CRM/Event/BAO/AdditionalPaymentTest.php | 8 +- .../CRM/Event/BAO/ParticipantStatusTest.php | 8 +- .../phpunit/CRM/Event/BAO/ParticipantTest.php | 24 +- tests/phpunit/CRM/Extension/BrowserTest.php | 16 +- .../CRM/Extension/Container/BasicTest.php | 22 +- .../Extension/Container/CollectionTest.php | 16 +- .../CRM/Extension/Container/StaticTest.php | 14 +- tests/phpunit/CRM/Extension/InfoTest.php | 12 +- .../CRM/Extension/Manager/ModuleTest.php | 20 +- .../CRM/Extension/Manager/PaymentTest.php | 10 +- .../CRM/Extension/Manager/ReportTest.php | 8 +- .../CRM/Extension/Manager/SearchTest.php | 8 +- tests/phpunit/CRM/Extension/ManagerTest.php | 32 +-- tests/phpunit/CRM/Extension/MapperTest.php | 26 +- .../Financial/BAO/FinancialAccountTest.php | 14 +- .../CRM/Financial/BAO/FinancialItemTest.php | 12 +- .../BAO/FinancialTypeAccountTest.php | 12 +- .../CRM/Financial/BAO/FinancialTypeTest.php | 12 +- .../BAO/PaymentProcessorTypeTest.php | 12 +- tests/phpunit/CRM/Group/Page/AjaxTest.php | 72 +++--- tests/phpunit/CRM/Mailing/BAO/QueryTest.php | 6 +- tests/phpunit/CRM/Mailing/BAO/SpoolTest.php | 6 +- .../CRM/Member/BAO/MembershipLogTest.php | 10 +- .../CRM/Member/BAO/MembershipStatusTest.php | 16 +- .../phpunit/CRM/Member/BAO/MembershipTest.php | 30 +-- .../CRM/Member/BAO/MembershipTypeTest.php | 24 +- .../CRM/Member/Form/MembershipTest.php | 26 +- .../Member/Import/Parser/MembershipTest.php | 6 +- tests/phpunit/CRM/PCP/BAO/PCPTest.php | 8 +- .../CRM/Pledge/BAO/PledgeBlockTest.php | 6 +- .../CRM/Pledge/BAO/PledgePaymentTest.php | 26 +- tests/phpunit/CRM/Pledge/BAO/PledgeTest.php | 8 +- tests/phpunit/CRM/Queue/Queue/SqlTest.php | 8 +- tests/phpunit/CRM/Queue/QueueTest.php | 20 +- tests/phpunit/CRM/Queue/RunnerTest.php | 22 +- .../CRM/Report/Form/Contribute/DetailTest.php | 4 +- .../phpunit/CRM/Report/Form/TestCaseTest.php | 4 +- .../phpunit/CRM/UF/Page/ProfileEditorTest.php | 4 +- .../phpunit/CRM/Utils/API/MatchOptionTest.php | 18 +- .../CRM/Utils/API/ReloadOptionTest.php | 12 +- tests/phpunit/CRM/Utils/ArrayTest.php | 14 +- .../phpunit/CRM/Utils/Cache/SqlGroupTest.php | 10 +- .../phpunit/CRM/Utils/DeprecatedUtilsTest.php | 12 +- tests/phpunit/CRM/Utils/FileTest.php | 2 +- tests/phpunit/CRM/Utils/HookTest.php | 8 +- tests/phpunit/CRM/Utils/HtmlToTextTest.php | 4 +- tests/phpunit/CRM/Utils/HttpClientTest.php | 18 +- tests/phpunit/CRM/Utils/JSTest.php | 6 +- tests/phpunit/CRM/Utils/MailTest.php | 4 +- .../CRM/Utils/Migrate/ImportExportTest.php | 10 +- tests/phpunit/CRM/Utils/NumberTest.php | 8 +- .../phpunit/CRM/Utils/QueryFormatterTest.php | 4 +- tests/phpunit/CRM/Utils/RestTest.php | 4 +- tests/phpunit/CRM/Utils/RuleTest.php | 14 +- tests/phpunit/CRM/Utils/SQL/InsertTest.php | 6 +- tests/phpunit/CRM/Utils/SQL/SelectTest.php | 34 +-- tests/phpunit/CRM/Utils/SignerTest.php | 4 +- tests/phpunit/CRM/Utils/StringTest.php | 14 +- tests/phpunit/CRM/Utils/SystemTest.php | 6 +- tests/phpunit/CRM/Utils/TimeTest.php | 2 +- tests/phpunit/CRM/Utils/TypeTest.php | 6 +- tests/phpunit/CRM/Utils/ZipTest.php | 36 +-- tests/phpunit/CRM/Utils/versionCheckTest.php | 12 +- tests/phpunit/Civi/API/KernelTest.php | 4 +- tests/phpunit/Civi/API/RequestTest.php | 16 +- .../Subscriber/DynamicFKAuthorizationTest.php | 8 +- .../Subscriber/TransactionSubscriberTest.php | 6 +- .../Civi/CCase/SequenceListenerTest.php | 6 +- tests/phpunit/CiviTest/AuthorizeNet.php | 4 +- tests/phpunit/CiviTest/CiviCaseTestCase.php | 4 +- tests/phpunit/CiviTest/CiviDBAssert.php | 12 +- tests/phpunit/CiviTest/CiviMailUtils.php | 20 +- tests/phpunit/CiviTest/CiviReportTestCase.php | 8 +- .../phpunit/CiviTest/CiviSeleniumTestCase.php | 132 +++++----- tests/phpunit/CiviTest/CiviTestSuite.php | 4 +- tests/phpunit/CiviTest/CiviUnitTestCase.php | 228 +++++++++--------- tests/phpunit/CiviTest/Contact.php | 10 +- tests/phpunit/CiviTest/ContributionPage.php | 4 +- tests/phpunit/CiviTest/Custom.php | 8 +- tests/phpunit/CiviTest/Event.php | 4 +- tests/phpunit/CiviTest/Membership.php | 6 +- tests/phpunit/CiviTest/PCP.php | 4 +- tests/phpunit/CiviTest/Participant.php | 4 +- tests/phpunit/CiviTest/PaypalPro.php | 4 +- tests/phpunit/HelloTest.php | 8 +- tests/phpunit/Utils.php | 2 +- .../WebTest/ACL/AssignUsersToRolesTest.php | 4 +- .../Activity/AddRecurringActivityTest.php | 2 +- .../Activity/ContactContextAddTest.php | 4 +- tests/phpunit/WebTest/Activity/IcalTest.php | 2 +- .../WebTest/Activity/StandaloneAddTest.php | 6 +- tests/phpunit/WebTest/Admin/CustomAddTest.php | 2 +- .../WebTest/Admin/CustomAddTestSameField.php | 4 +- .../Admin/Form/ScheduleReminderTest.php | 2 +- .../Admin/Form/Setting/LocalizationTest.php | 2 +- .../WebTest/Admin/MoveCustomDataTest.php | 16 +- .../WebTest/Admin/RelationshipTypeAddTest.php | 4 +- .../phpunit/WebTest/Campaign/ActivityTest.php | 4 +- .../Campaign/CampaignDescriptionTest.php | 4 +- .../phpunit/WebTest/Campaign/MailingTest.php | 4 +- .../WebTest/Campaign/MembershipTest.php | 4 +- .../Campaign/OfflineContributionTest.php | 6 +- .../Campaign/OfflineEventRegistrationTest.php | 6 +- .../Campaign/OnlineContributionTest.php | 4 +- .../Campaign/OnlineEventRegistrationTest.php | 18 +- .../Campaign/PetitionUsageScenarioTest.php | 2 +- tests/phpunit/WebTest/Campaign/PledgeTest.php | 4 +- .../Campaign/SurveyUsageScenarioTest.php | 4 +- .../WebTest/Case/ActivityToCaseTest.php | 8 +- tests/phpunit/WebTest/Case/AddCaseTest.php | 16 +- .../phpunit/WebTest/Case/AddCaseTypeTest.php | 2 +- .../WebTest/Case/CaseCustomFieldsTest.php | 10 +- .../WebTest/Case/CaseDashboardTest.php | 2 +- .../WebTest/Contact/AddCmsUserTest.php | 4 +- .../AddContactsToEventAdvancedSearchTest.php | 2 +- tests/phpunit/WebTest/Contact/AddTest.php | 8 +- .../WebTest/Contact/AddViaProfileTest.php | 2 +- .../WebTest/Contact/AddressParsingTest.php | 2 +- .../WebTest/Contact/AdvanceSearchPaneTest.php | 6 +- .../AdvanceSearchPrivacyOptionsTest.php | 10 +- .../WebTest/Contact/AdvancedSearchTest.php | 26 +- .../AdvancedSearchedRelatedContactTest.php | 14 +- .../Contact/ContactReferenceFieldTest.php | 2 +- .../WebTest/Contact/ContactTagTest.php | 4 +- .../Contact/CreateCmsUserFromContactTest.php | 18 +- .../WebTest/Contact/CustomDataAddTest.php | 6 +- .../DeceasedContactsAdvancedSearchTest.php | 4 +- .../WebTest/Contact/DupeContactTest.php | 2 +- .../WebTest/Contact/EditContactTest.php | 2 +- .../phpunit/WebTest/Contact/GroupAddTest.php | 10 +- .../WebTest/Contact/InlineFieldsEditTest.php | 2 +- .../WebTest/Contact/MergeContactsTest.php | 18 +- .../Contact/MultipleContactSubTypes.php | 4 +- .../phpunit/WebTest/Contact/PrevNextTest.php | 2 +- .../Contact/PrivacyOptionSearchTest.php | 2 +- .../WebTest/Contact/ProfileChecksumTest.php | 4 +- .../WebTest/Contact/RelationshipAddTest.php | 8 +- .../WebTest/Contact/SearchBuilderTest.php | 20 +- tests/phpunit/WebTest/Contact/SearchTest.php | 10 +- .../Contact/SearchbyDateFilterTest.php | 6 +- .../phpunit/WebTest/Contact/SignatureTest.php | 10 +- tests/phpunit/WebTest/Contact/TagAddTest.php | 4 +- .../WebTest/Contact/TagSetSearchTest.php | 4 +- .../Contact/TaskActionAddToGroupTest.php | 4 +- .../Contact/TaskActionSendMassMailing.php | 2 +- .../WebTest/Contact/TaskActionSendSMS.php | 2 +- .../WebTest/Contact/UpdateProfileTest.php | 2 +- .../WebTest/Contribute/AddBatchesTest.php | 12 +- .../WebTest/Contribute/AddPricesetTest.php | 18 +- .../Contribute/ConfirmOptionalTest.php | 4 +- .../Contribute/ContactContextAddTest.php | 2 +- .../Contribute/ContributionPageAddTest.php | 10 +- .../Contribute/OfflineContributionTest.php | 10 +- .../OfflineRecurContributionTest.php | 2 +- .../Contribute/OnBehalfOfOrganization.php | 20 +- .../Contribute/OnlineContributionTest.php | 6 +- .../OnlineMultiplePaymentProcessorTest.php | 4 +- .../OnlineRecurContributionTest.php | 2 +- .../phpunit/WebTest/Contribute/PCPAddTest.php | 2 +- .../WebTest/Contribute/StandaloneAddTest.php | 8 +- .../UpdateBatchPendingContributionTest.php | 8 +- .../Contribute/UpdateContributionTest.php | 18 +- .../UpdatePendingContributionTest.php | 6 +- .../Contribute/VerifySSLContributionTest.php | 6 +- tests/phpunit/WebTest/Event/AddEventTest.php | 44 ++-- .../WebTest/Event/AddParticipationTest.php | 12 +- .../phpunit/WebTest/Event/AddPricesetTest.php | 18 +- .../WebTest/Event/AddRecurringEventTest.php | 2 +- .../WebTest/Event/AdditionalPaymentTest.php | 4 +- .../WebTest/Event/ChangeParticipantStatus.php | 4 +- .../WebTest/Event/EventListingTest.php | 4 +- .../WebTest/Event/EventWaitListTest.php | 8 +- .../MultipleEventRegistrationbyCartTest.php | 22 +- .../WebTest/Event/MultiprofileEventTest.php | 26 +- tests/phpunit/WebTest/Event/PCPAddTest.php | 20 +- .../WebTest/Event/ParticipantCountTest.php | 14 +- .../WebTest/Event/ParticipantSearchTest.php | 20 +- .../WebTest/Event/PricesetMaxCountTest.php | 20 +- .../phpunit/WebTest/Event/TellAFriendTest.php | 10 +- tests/phpunit/WebTest/Export/ContactTest.php | 10 +- .../Export/ExportCiviSeleniumTestCase.php | 4 +- .../Financial/FinancialAccountTest.php | 2 +- .../Financial/FinancialAccountTypeTest.php | 2 +- .../Financial/FinancialBatchExport.php | 8 +- .../WebTest/Generic/CheckActivityTest.php | 2 +- .../WebTest/Generic/CheckDashboardTest.php | 8 +- .../phpunit/WebTest/Generic/CheckFindTest.php | 2 +- .../Generic/GeneralClickAroundTest.php | 32 +-- .../WebTest/Grant/ContactContextAddTest.php | 2 +- .../WebTest/Grant/CustomFieldsetTest.php | 4 +- .../WebTest/Grant/StandaloneAddTest.php | 2 +- tests/phpunit/WebTest/Import/ActivityTest.php | 4 +- .../WebTest/Import/AddressImportTest.php | 8 +- .../WebTest/Import/AddressParsingTest.php | 10 +- .../WebTest/Import/ContactCustomDataTest.php | 8 +- .../WebTest/Import/ContactSubtypeTest.php | 14 +- tests/phpunit/WebTest/Import/ContactTest.php | 12 +- .../WebTest/Import/ContributionTest.php | 12 +- .../phpunit/WebTest/Import/CustomDataTest.php | 6 +- .../phpunit/WebTest/Import/DateFormatTest.php | 24 +- .../WebTest/Import/DuplicateMatchingTest.php | 14 +- tests/phpunit/WebTest/Import/GroupTest.php | 4 +- .../Import/ImportCiviSeleniumTestCase.php | 10 +- .../WebTest/Import/MatchExternalIdTest.php | 16 +- tests/phpunit/WebTest/Import/MemberTest.php | 12 +- .../Import/MultipleRelationshipTest.php | 4 +- .../WebTest/Import/ParticipantTest.php | 14 +- .../WebTest/Import/SavedMappingTest.php | 4 +- tests/phpunit/WebTest/Import/TagTest.php | 4 +- .../Mailing/AddMessageTemplateTest.php | 4 +- .../Mailing/AddNewMailingComponentTest.php | 6 +- tests/phpunit/WebTest/Mailing/MailingTest.php | 8 +- tests/phpunit/WebTest/Mailing/SpoolTest.php | 2 +- .../Member/BatchUpdateViaProfileTest.php | 8 +- .../WebTest/Member/ContactContextAddTest.php | 4 +- .../Member/DefaultMembershipPricesetTest.php | 12 +- .../WebTest/Member/EditMembershipTest.php | 2 +- .../Member/FixedMembershipTypeTest.php | 8 +- .../Member/InheritedMembershipTest.php | 4 +- .../Member/OfflineAutoRenewMembershipTest.php | 2 +- .../OfflineMembershipAddPricesetTest.php | 14 +- .../Member/OfflineMembershipRenewTest.php | 8 +- .../OnlineAutoRenewMembershipGCTest.php | 6 +- .../Member/OnlineAutoRenewMembershipTest.php | 8 +- .../OnlineMembershipAddPricesetTest.php | 14 +- .../Member/OnlineMembershipCreateTest.php | 6 +- .../Member/OnlineMembershipRenewTest.php | 6 +- .../Member/SeperateMembershipPaymentTest.php | 4 +- .../WebTest/Member/StandaloneAddTest.php | 8 +- .../Member/UpdateMembershipScriptTest.php | 4 +- .../WebTest/Pledge/AddCancelPaymentTest.php | 2 +- .../WebTest/Pledge/ContactContextAddTest.php | 2 +- .../ContactContextPledgePaymentAddTest.php | 6 +- .../Pledge/StandaloneAddDeleteTest.php | 2 +- .../WebTest/Pledge/StandaloneAddTest.php | 2 +- .../WebTest/Profile/BatchUpdateTest.php | 8 +- tests/phpunit/WebTest/Profile/DedupeTest.php | 2 +- .../Profile/MultiRecordProfileAddTest.php | 16 +- .../WebTest/Profile/ProfileAddTest.php | 8 +- .../WebTest/Profile/ProfileCountryState.php | 2 +- .../Profile/ProfileGroupSubscriptionTest.php | 4 +- tests/phpunit/WebTest/Profile/SearchTest.php | 2 +- .../phpunit/WebTest/Release/InstallScript.php | 2 +- .../phpunit/WebTest/Release/UpgradeScript.php | 2 +- tests/phpunit/WebTest/Report/AddTest.php | 2 +- .../WebTest/Report/DonarReportTest.php | 2 +- .../WebTest/Report/LoggingReportTest.php | 6 +- .../Report/RolePermissionReportTest.php | 8 +- tests/phpunit/WebTest/Utils/RestTest.php | 8 +- tests/phpunit/api/v3/ACLCachingTest.php | 6 +- tests/phpunit/api/v3/ACLPermissionTest.php | 40 +-- tests/phpunit/api/v3/APIStandardsTest.php | 8 +- tests/phpunit/api/v3/APITest.php | 18 +- tests/phpunit/api/v3/APIWrapperTest.php | 4 +- tests/phpunit/api/v3/ActionScheduleTest.php | 6 +- tests/phpunit/api/v3/ActivityContactTest.php | 2 +- tests/phpunit/api/v3/ActivityTest.php | 94 ++++---- tests/phpunit/api/v3/ActivityTypeTest.php | 10 +- tests/phpunit/api/v3/AddressTest.php | 6 +- tests/phpunit/api/v3/BatchTest.php | 10 +- tests/phpunit/api/v3/CRM11793Test.php | 10 +- tests/phpunit/api/v3/CampaignTest.php | 2 +- tests/phpunit/api/v3/CaseTest.php | 26 +- tests/phpunit/api/v3/CaseTypeTest.php | 20 +- tests/phpunit/api/v3/ContactTest.php | 138 +++++------ tests/phpunit/api/v3/ContactTypeTest.php | 14 +- tests/phpunit/api/v3/ContributionPageTest.php | 8 +- .../phpunit/api/v3/ContributionRecurTest.php | 2 +- tests/phpunit/api/v3/ContributionSoftTest.php | 26 +- tests/phpunit/api/v3/ContributionTest.php | 122 +++++----- tests/phpunit/api/v3/CountryTest.php | 2 +- tests/phpunit/api/v3/CustomFieldTest.php | 44 ++-- tests/phpunit/api/v3/CustomGroupTest.php | 38 +-- tests/phpunit/api/v3/CustomSearchTest.php | 2 +- .../api/v3/CustomValueContactTypeTest.php | 22 +- tests/phpunit/api/v3/CustomValueTest.php | 4 +- tests/phpunit/api/v3/DashboardContactTest.php | 2 +- tests/phpunit/api/v3/DashboardTest.php | 4 +- tests/phpunit/api/v3/EmailTest.php | 2 +- tests/phpunit/api/v3/EntityTagTest.php | 36 +-- tests/phpunit/api/v3/EventTest.php | 72 +++--- tests/phpunit/api/v3/GrantTest.php | 4 +- tests/phpunit/api/v3/GroupContactTest.php | 18 +- tests/phpunit/api/v3/GroupTest.php | 22 +- tests/phpunit/api/v3/ImTest.php | 2 +- .../phpunit/api/v3/JobProcessMailingTest.php | 10 +- tests/phpunit/api/v3/JobTest.php | 20 +- tests/phpunit/api/v3/MailSettingsTest.php | 2 +- tests/phpunit/api/v3/MailingABTest.php | 2 +- tests/phpunit/api/v3/MailingContactTest.php | 6 +- tests/phpunit/api/v3/MailingGroupTest.php | 2 +- tests/phpunit/api/v3/MailingTest.php | 4 +- .../phpunit/api/v3/MembershipPaymentTest.php | 2 +- tests/phpunit/api/v3/MembershipStatusTest.php | 26 +- tests/phpunit/api/v3/MembershipTest.php | 86 +++---- tests/phpunit/api/v3/MembershipTypeTest.php | 32 +-- tests/phpunit/api/v3/MessageTemplateTest.php | 2 +- tests/phpunit/api/v3/NoteTest.php | 32 +-- tests/phpunit/api/v3/OptionGroupTest.php | 2 +- tests/phpunit/api/v3/OptionValueTest.php | 10 +- .../phpunit/api/v3/ParticipantPaymentTest.php | 34 +-- .../api/v3/ParticipantStatusTypeTest.php | 2 +- tests/phpunit/api/v3/ParticipantTest.php | 76 +++--- tests/phpunit/api/v3/PaymentProcessorTest.php | 12 +- .../api/v3/PaymentProcessorTypeTest.php | 28 +-- tests/phpunit/api/v3/PhoneTest.php | 2 +- tests/phpunit/api/v3/PledgePaymentTest.php | 22 +- tests/phpunit/api/v3/PledgeTest.php | 48 ++-- tests/phpunit/api/v3/PriceFieldTest.php | 2 +- tests/phpunit/api/v3/PriceFieldValueTest.php | 2 +- tests/phpunit/api/v3/PriceSetTest.php | 2 +- tests/phpunit/api/v3/ProductTest.php | 6 +- tests/phpunit/api/v3/ProfileTest.php | 72 +++--- tests/phpunit/api/v3/RelationshipTest.php | 72 +++--- tests/phpunit/api/v3/RelationshipTypeTest.php | 32 +-- tests/phpunit/api/v3/ReportTemplateTest.php | 8 +- tests/phpunit/api/v3/SettingTest.php | 52 ++-- tests/phpunit/api/v3/SurveyRespondantTest.php | 2 +- tests/phpunit/api/v3/SurveyTest.php | 2 +- .../phpunit/api/v3/SyntaxConformanceTest.php | 10 +- tests/phpunit/api/v3/SystemTest.php | 6 +- tests/phpunit/api/v3/TagTest.php | 20 +- .../api/v3/TaxContributionPageTest.php | 24 +- tests/phpunit/api/v3/UFFieldTest.php | 4 +- tests/phpunit/api/v3/UFGroupTest.php | 14 +- tests/phpunit/api/v3/UFJoinTest.php | 4 +- tests/phpunit/api/v3/UFMatchTest.php | 12 +- tests/phpunit/api/v3/UtilsTest.php | 32 +-- tests/phpunit/api/v3/WebsiteTest.php | 2 +- 1526 files changed, 9079 insertions(+), 9079 deletions(-) diff --git a/CRM/ACL/API.php b/CRM/ACL/API.php index 75b20d2273..b5b091a026 100644 --- a/CRM/ACL/API.php +++ b/CRM/ACL/API.php @@ -56,7 +56,7 @@ class CRM_ACL_API { * @static * @access public */ - static function check($str, $contactID = NULL) { + public static function check($str, $contactID = NULL) { if ($contactID == NULL) { $session = CRM_Core_Session::singleton(); $contactID = $session->get('userID'); diff --git a/CRM/ACL/BAO/ACL.php b/CRM/ACL/BAO/ACL.php index 368fe40d6b..8474a10c80 100644 --- a/CRM/ACL/BAO/ACL.php +++ b/CRM/ACL/BAO/ACL.php @@ -46,7 +46,7 @@ class CRM_ACL_BAO_ACL extends CRM_ACL_DAO_ACL { /** * @return array|null */ - static function entityTable() { + public static function entityTable() { if (!self::$_entityTable) { self::$_entityTable = array( 'civicrm_contact' => ts('Contact'), @@ -59,7 +59,7 @@ class CRM_ACL_BAO_ACL extends CRM_ACL_DAO_ACL { /** * @return array|null */ - static function objectTable() { + public static function objectTable() { if (!self::$_objectTable) { self::$_objectTable = array( 'civicrm_contact' => ts('Contact'), @@ -75,7 +75,7 @@ class CRM_ACL_BAO_ACL extends CRM_ACL_DAO_ACL { /** * @return array|null */ - static function operation() { + public static function operation() { if (!self::$_operation) { self::$_operation = array( 'View' => ts('View'), @@ -365,7 +365,7 @@ class CRM_ACL_BAO_ACL extends CRM_ACL_DAO_ACL { * @return array - Assoc. array of the ACL rule's properties * @access public */ - function toArray($format = '%s', $hideEmpty = false) { + public function toArray($format = '%s', $hideEmpty = false) { $result = array(); if (!self::$_fieldKeys) { @@ -658,7 +658,7 @@ SELECT $acl.* * * @return CRM_ACL_DAO_ACL */ - static function create(&$params) { + public static function create(&$params) { $dao = new CRM_ACL_DAO_ACL(); $dao->copyValues($params); $dao->save(); @@ -669,7 +669,7 @@ SELECT $acl.* * @param array $params * @param $defaults */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { CRM_Core_DAO::commonRetrieve('CRM_ACL_DAO_ACL', $params, $defaults); } @@ -682,7 +682,7 @@ SELECT $acl.* * @return Object DAO object on sucess, null otherwise * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { // note this also resets any ACL cache CRM_Core_BAO_Cache::deleteGroup('contact fields'); @@ -695,7 +695,7 @@ SELECT $acl.* * * @return bool */ - static function check($str, $contactID) { + public static function check($str, $contactID) { $acls = CRM_ACL_BAO_Cache::build($contactID); @@ -922,7 +922,7 @@ ORDER BY a.object_id * * @return bool */ - static function matchType($type, $operation) { + public static function matchType($type, $operation) { $typeCheck = FALSE; switch ($operation) { case 'All': @@ -970,7 +970,7 @@ ORDER BY a.object_id * @access public * @static */ - static function del($aclId) { + public static function del($aclId) { // delete all entries from the acl cache CRM_ACL_BAO_Cache::resetCache(); diff --git a/CRM/ACL/BAO/Cache.php b/CRM/ACL/BAO/Cache.php index af51e05142..b56255e901 100644 --- a/CRM/ACL/BAO/Cache.php +++ b/CRM/ACL/BAO/Cache.php @@ -45,7 +45,7 @@ class CRM_ACL_BAO_Cache extends CRM_ACL_DAO_Cache { * * @return mixed */ - static function &build($id) { + public static function &build($id) { if (!self::$_cache) { self::$_cache = array(); } @@ -71,7 +71,7 @@ class CRM_ACL_BAO_Cache extends CRM_ACL_DAO_Cache { * * @return array */ - static function retrieve($id) { + public static function retrieve($id) { $query = " SELECT acl_id FROM civicrm_acl_cache @@ -96,7 +96,7 @@ SELECT acl_id * @param int $id * @param array $cache */ - static function store($id, &$cache) { + public static function store($id, &$cache) { foreach ($cache as $aclID => $data) { $dao = new CRM_ACL_DAO_Cache(); if ($id) { @@ -113,7 +113,7 @@ SELECT acl_id /** * @param int $id */ - static function deleteEntry($id) { + public static function deleteEntry($id) { if (self::$_cache && array_key_exists($id, self::$_cache) ) { @@ -131,7 +131,7 @@ WHERE contact_id = %1 /** * @param int $id */ - static function updateEntry($id) { + public static function updateEntry($id) { // rebuilds civicrm_acl_cache self::deleteEntry($id); self::build($id); @@ -141,7 +141,7 @@ WHERE contact_id = %1 } // deletes all the cache entries - static function resetCache() { + public static function resetCache() { // reset any static caching self::$_cache = NULL; diff --git a/CRM/ACL/BAO/EntityRole.php b/CRM/ACL/BAO/EntityRole.php index bd17506f97..71891c301d 100644 --- a/CRM/ACL/BAO/EntityRole.php +++ b/CRM/ACL/BAO/EntityRole.php @@ -42,7 +42,7 @@ class CRM_ACL_BAO_EntityRole extends CRM_ACL_DAO_EntityRole { /** * @return array|null */ - static function entityTable() { + public static function entityTable() { if (!self::$_entityTable) { self::$_entityTable = array( 'civicrm_contact' => ts('Contact'), @@ -57,7 +57,7 @@ class CRM_ACL_BAO_EntityRole extends CRM_ACL_DAO_EntityRole { * * @return CRM_ACL_DAO_EntityRole */ - static function create(&$params) { + public static function create(&$params) { $dao = new CRM_ACL_DAO_EntityRole(); $dao->copyValues($params); $dao->save(); @@ -68,7 +68,7 @@ class CRM_ACL_BAO_EntityRole extends CRM_ACL_DAO_EntityRole { * @param array $params * @param $defaults */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { CRM_Core_DAO::commonRetrieve('CRM_ACL_DAO_EntityRole', $params, $defaults); } @@ -81,7 +81,7 @@ class CRM_ACL_BAO_EntityRole extends CRM_ACL_DAO_EntityRole { * @return Object DAO object on sucess, null otherwise * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_ACL_DAO_EntityRole', $id, 'is_active', $is_active); } @@ -93,7 +93,7 @@ class CRM_ACL_BAO_EntityRole extends CRM_ACL_DAO_EntityRole { * @access public * @static */ - static function del($entityRoleId) { + public static function del($entityRoleId) { $entityDAO = new CRM_ACL_DAO_EntityRole(); $entityDAO->id = $entityRoleId; $entityDAO->find(TRUE); diff --git a/CRM/ACL/Form/ACL.php b/CRM/ACL/Form/ACL.php index 9d877f5e84..a58a736ab6 100644 --- a/CRM/ACL/Form/ACL.php +++ b/CRM/ACL/Form/ACL.php @@ -49,7 +49,7 @@ class CRM_ACL_Form_ACL extends CRM_Admin_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = parent::setDefaultValues(); if ($this->_action & CRM_Core_Action::ADD) { @@ -199,7 +199,7 @@ class CRM_ACL_Form_ACL extends CRM_Admin_Form { * * @return bool */ - static function formRule($params) { + public static function formRule($params) { $showHide = new CRM_Core_ShowHideBlocks(); // Make sure role is not -1 diff --git a/CRM/ACL/Form/ACLBasic.php b/CRM/ACL/Form/ACLBasic.php index 43e06dcc9e..50e9e050d5 100644 --- a/CRM/ACL/Form/ACLBasic.php +++ b/CRM/ACL/Form/ACLBasic.php @@ -49,7 +49,7 @@ class CRM_ACL_Form_ACLBasic extends CRM_Admin_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); if ($this->_id || @@ -115,7 +115,7 @@ SELECT object_table * * @return array|bool */ - static function formRule($params) { + public static function formRule($params) { if ($params['entity_id'] == -1) { $errors = array('entity_id' => ts('Role is a required field')); return $errors; diff --git a/CRM/ACL/Form/WordPress/Permissions.php b/CRM/ACL/Form/WordPress/Permissions.php index 7daa22c7b0..58938363b8 100644 --- a/CRM/ACL/Form/WordPress/Permissions.php +++ b/CRM/ACL/Form/WordPress/Permissions.php @@ -45,7 +45,7 @@ class CRM_ACL_Form_WordPress_Permissions extends CRM_Core_Form { * @access public * @return void */ - function buildQuickForm( ) { + public function buildQuickForm( ) { CRM_Utils_System::setTitle( 'Wordpress Access Control' ); @@ -175,7 +175,7 @@ class CRM_ACL_Form_WordPress_Permissions extends CRM_Core_Form { * @access public * @return array civicrm permissions */ - static function getPermissionArray(){ + public static function getPermissionArray(){ global $civicrm_root; $permissions = CRM_Core_Permission::basicPermissions(); diff --git a/CRM/ACL/Page/ACL.php b/CRM/ACL/Page/ACL.php index fa6c58120e..9e6a5748d4 100644 --- a/CRM/ACL/Page/ACL.php +++ b/CRM/ACL/Page/ACL.php @@ -57,7 +57,7 @@ class CRM_ACL_Page_ACL extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_ACL_BAO_ACL'; } @@ -66,7 +66,7 @@ class CRM_ACL_Page_ACL extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::UPDATE => array( @@ -107,7 +107,7 @@ class CRM_ACL_Page_ACL extends CRM_Core_Page_Basic { * @access public * */ - function run() { + public function run() { // get the requested action $action = CRM_Utils_Request::retrieve('action', 'String', // default to 'browse' @@ -157,7 +157,7 @@ class CRM_ACL_Page_ACL extends CRM_Core_Page_Basic { * @access public * @static */ - function browse() { + public function browse() { // get all acl's sorted by weight $acl = array(); $query = " @@ -255,7 +255,7 @@ ORDER BY entity_id * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_ACL_Form_ACL'; } @@ -264,7 +264,7 @@ ORDER BY entity_id * * @return string name of this page. */ - function editName() { + public function editName() { return 'ACL'; } @@ -275,7 +275,7 @@ ORDER BY entity_id * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/acl'; } } diff --git a/CRM/ACL/Page/ACLBasic.php b/CRM/ACL/Page/ACLBasic.php index 61bae4bcb4..8b2e61a84a 100644 --- a/CRM/ACL/Page/ACLBasic.php +++ b/CRM/ACL/Page/ACLBasic.php @@ -55,7 +55,7 @@ class CRM_ACL_Page_ACLBasic extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_ACL_BAO_ACL'; } @@ -64,7 +64,7 @@ class CRM_ACL_Page_ACLBasic extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::UPDATE => array( @@ -95,7 +95,7 @@ class CRM_ACL_Page_ACLBasic extends CRM_Core_Page_Basic { * @access public * */ - function run() { + public function run() { // get the requested action $action = CRM_Utils_Request::retrieve('action', 'String', // default to 'browse' @@ -133,7 +133,7 @@ class CRM_ACL_Page_ACLBasic extends CRM_Core_Page_Basic { * @access public * @static */ - function browse() { + public function browse() { // get all acl's sorted by weight $acl = array(); @@ -192,7 +192,7 @@ ORDER BY entity_id * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_ACL_Form_ACLBasic'; } @@ -201,7 +201,7 @@ ORDER BY entity_id * * @return string name of this page. */ - function editName() { + public function editName() { return 'Core ACLs'; } @@ -212,7 +212,7 @@ ORDER BY entity_id * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/acl/basic'; } } diff --git a/CRM/ACL/Page/EntityRole.php b/CRM/ACL/Page/EntityRole.php index 0d30d3a823..872ea67fdd 100644 --- a/CRM/ACL/Page/EntityRole.php +++ b/CRM/ACL/Page/EntityRole.php @@ -57,7 +57,7 @@ class CRM_ACL_Page_EntityRole extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_ACL_BAO_EntityRole'; } @@ -66,7 +66,7 @@ class CRM_ACL_Page_EntityRole extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::UPDATE => array( @@ -107,7 +107,7 @@ class CRM_ACL_Page_EntityRole extends CRM_Core_Page_Basic { * @access public * */ - function run() { + public function run() { // get the requested action $action = CRM_Utils_Request::retrieve('action', 'String', // default to 'browse' @@ -154,7 +154,7 @@ class CRM_ACL_Page_EntityRole extends CRM_Core_Page_Basic { * @access public * @static */ - function browse() { + public function browse() { // get all acl's sorted by weight $entityRoles = array(); @@ -199,7 +199,7 @@ class CRM_ACL_Page_EntityRole extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_ACL_Form_EntityRole'; } @@ -208,7 +208,7 @@ class CRM_ACL_Page_EntityRole extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'ACL EntityRole'; } @@ -219,7 +219,7 @@ class CRM_ACL_Page_EntityRole extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/acl/entityrole'; } } diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index 1efed57ff1..f42e82cc70 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -661,7 +661,7 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity { * @access public * @static */ - static function &getActivities($input) { + public static function &getActivities($input) { //step 1: Get the basic activity data $bulkActivityTypeID = CRM_Core_OptionGroup::getValue( 'activity_type', @@ -909,7 +909,7 @@ ORDER BY fixed_sort_order * @return array of component id and name. * @static **/ - static function activityComponents() { + public static function activityComponents() { $components = array(); $compInfo = CRM_Core_Component::getEnabledComponents(); foreach ($compInfo as $compObj) { @@ -950,7 +950,7 @@ ORDER BY fixed_sort_order * @access public * @static */ - static function &getActivitiesCount($input) { + public static function &getActivitiesCount($input) { $input['count'] = TRUE; list($sqlClause, $params) = self::getActivitySQLClause($input); @@ -987,7 +987,7 @@ LEFT JOIN civicrm_case_activity ON ( civicrm_case_activity.activity_id = tbl.a * @access public * @static */ - static function getActivitySQLClause($input) { + public static function getActivitySQLClause($input) { $params = array(); $sourceWhere = $targetWhere = $assigneeWhere = $caseWhere = 1; @@ -1647,7 +1647,7 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND * @access public * @static */ - static function &importableFields($status = FALSE) { + public static function &importableFields($status = FALSE) { if (!self::$_importableFields) { if (!self::$_importableFields) { self::$_importableFields = array(); @@ -1700,7 +1700,7 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND * @return array array of activity fields * @access public */ - static function getContactActivity($contactId) { + public static function getContactActivity($contactId) { $activities = array(); $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); $sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); @@ -1891,7 +1891,7 @@ SELECT display_name * @return int $parentId Id of parent activity otherwise false. * @access public */ - static function getParentActivity($activityId) { + public static function getParentActivity($activityId) { static $parentActivities = array(); $activityId = CRM_Utils_Type::escape($activityId, 'Integer'); @@ -1918,7 +1918,7 @@ SELECT display_name * @return int $params count of prior activities otherwise false. * @access public */ - static function getPriorCount($activityID) { + public static function getPriorCount($activityID) { static $priorCounts = array(); $activityID = CRM_Utils_Type::escape($activityID, 'Integer'); @@ -1956,7 +1956,7 @@ AND id < {$activityID} * @return array $result prior activities info. * @access public */ - static function getPriorAcitivities($activityID, $onlyPriorRevisions = FALSE) { + public static function getPriorAcitivities($activityID, $onlyPriorRevisions = FALSE) { static $priorActivities = array(); $activityID = CRM_Utils_Type::escape($activityID, 'Integer'); @@ -2005,7 +2005,7 @@ AND cl.modified_id = c.id * @return int current activity id. * @access public */ - static function getLatestActivityId($activityID) { + public static function getLatestActivityId($activityID) { static $latestActivityIds = array(); $activityID = CRM_Utils_Type::escape($activityID, 'Integer'); @@ -2039,7 +2039,7 @@ AND cl.modified_id = c.id * * @access public */ - static function createFollowupActivity($activityId, $params) { + public static function createFollowupActivity($activityId, $params) { if (!$activityId) { return; } @@ -2079,7 +2079,7 @@ AND cl.modified_id = c.id * * @static */ - static function getFileForActivityTypeId($activityTypeId, $crmDir = 'Activity') { + public static function getFileForActivityTypeId($activityTypeId, $crmDir = 'Activity') { $activityTypes = CRM_Case_PseudoConstant::caseActivityType(FALSE, TRUE); if ($activityTypes[$activityTypeId]['name']) { @@ -2131,7 +2131,7 @@ AND cl.modified_id = c.id * @access public * @static */ - static function &exportableFields($name = 'Activity') { + public static function &exportableFields($name = 'Activity') { if (!isset(self::$_exportableFields[$name])) { self::$_exportableFields[$name] = array(); @@ -2185,7 +2185,7 @@ AND cl.modified_id = c.id * @return array array of activity profile Fields * @access public */ - static function getProfileFields() { + public static function getProfileFields() { $exportableFields = self::exportableFields('Activity'); $skipFields = array( 'activity_id', @@ -2567,7 +2567,7 @@ INNER JOIN civicrm_option_group grp ON ( grp.id = val.option_group_id AND grp.n * * @param array $params */ - static function copyExtendedActivityData($params) { + public static function copyExtendedActivityData($params) { // attach custom data to the new activity $customParams = $htmlType = array(); $customValues = CRM_Core_BAO_CustomValueTable::getEntityValues($params['activityID'], 'Activity'); @@ -2641,7 +2641,7 @@ INNER JOIN civicrm_option_group grp ON ( grp.id = val.option_group_id AND grp.n /** * @param array $params */ - function setApiFilter(&$params) { + public function setApiFilter(&$params) { if (CRM_Utils_Array::value('target_contact_id', $params)) { $this->selectAdd(); $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); diff --git a/CRM/Activity/BAO/ActivityAssignment.php b/CRM/Activity/BAO/ActivityAssignment.php index 325c386211..b5d2f05a2d 100644 --- a/CRM/Activity/BAO/ActivityAssignment.php +++ b/CRM/Activity/BAO/ActivityAssignment.php @@ -42,7 +42,7 @@ class CRM_Activity_BAO_ActivityAssignment extends CRM_Activity_DAO_ActivityConta /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -74,7 +74,7 @@ class CRM_Activity_BAO_ActivityAssignment extends CRM_Activity_DAO_ActivityConta * * @access public */ - static function retrieveAssigneeIdsByActivityId($activity_id) { + public static function retrieveAssigneeIdsByActivityId($activity_id) { $assigneeArray = array(); if (!CRM_Utils_Rule::positiveInteger($activity_id)) { return $assigneeArray; @@ -111,7 +111,7 @@ AND civicrm_contact.is_deleted = 0 * @access public * */ - static function getAssigneeNames($activityIDs, $isDisplayName = FALSE, $skipDetails = TRUE) { + public static function getAssigneeNames($activityIDs, $isDisplayName = FALSE, $skipDetails = TRUE) { $assigneeNames = array(); if (empty($activityIDs)) { return $assigneeNames; diff --git a/CRM/Activity/BAO/ActivityContact.php b/CRM/Activity/BAO/ActivityContact.php index b2ddca6a7c..abbc05f6a6 100644 --- a/CRM/Activity/BAO/ActivityContact.php +++ b/CRM/Activity/BAO/ActivityContact.php @@ -42,7 +42,7 @@ class CRM_Activity_BAO_ActivityContact extends CRM_Activity_DAO_ActivityContact /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -76,7 +76,7 @@ class CRM_Activity_BAO_ActivityContact extends CRM_Activity_DAO_ActivityContact * * @access public */ - static function getNames($activityID, $recordTypeID, $alsoIDs = FALSE) { + public static function getNames($activityID, $recordTypeID, $alsoIDs = FALSE) { $names = array(); $ids = array(); @@ -116,7 +116,7 @@ AND contact_a.is_deleted = 0 * * @access public */ - static function retrieveContactIdsByActivityId($activityID, $recordTypeID) { + public static function retrieveContactIdsByActivityId($activityID, $recordTypeID) { $activityContact = array(); if (!CRM_Utils_Rule::positiveInteger($activityID) || !CRM_Utils_Rule::positiveInteger($recordTypeID)) { @@ -161,7 +161,7 @@ AND civicrm_contact.is_deleted = 0 /** * @return array|null */ - function links() { + public function links() { $link = array('activity_id' => 'civicrm_activity:id'); return $link; } diff --git a/CRM/Activity/BAO/ActivityTarget.php b/CRM/Activity/BAO/ActivityTarget.php index 18bc060477..20328ec5fd 100644 --- a/CRM/Activity/BAO/ActivityTarget.php +++ b/CRM/Activity/BAO/ActivityTarget.php @@ -42,7 +42,7 @@ class CRM_Activity_BAO_ActivityTarget extends CRM_Activity_DAO_ActivityContact { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -73,7 +73,7 @@ class CRM_Activity_BAO_ActivityTarget extends CRM_Activity_DAO_ActivityContact { * * @access public */ - static function retrieveTargetIdsByActivityId($activity_id) { + public static function retrieveTargetIdsByActivityId($activity_id) { $targetArray = array(); if (!CRM_Utils_Rule::positiveInteger($activity_id)) { return $targetArray; @@ -106,7 +106,7 @@ AND civicrm_contact.is_deleted = 0 * * @access public */ - static function getTargetNames($activityID) { + public static function getTargetNames($activityID) { $targetNames = array(); if (empty($activityID)) { diff --git a/CRM/Activity/BAO/ICalendar.php b/CRM/Activity/BAO/ICalendar.php index b5da6f8bcb..20251ddff1 100644 --- a/CRM/Activity/BAO/ICalendar.php +++ b/CRM/Activity/BAO/ICalendar.php @@ -52,7 +52,7 @@ class CRM_Activity_BAO_ICalendar { * @return \CRM_Activity_BAO_ICalendar @access public */ - function __construct( &$act ) { + public function __construct( &$act ) { $this->activity = $act; } @@ -65,7 +65,7 @@ class CRM_Activity_BAO_ICalendar { * @return string Array index of the added attachment in the $attachments array, or else null. * @access public */ - function addAttachment( &$attachments, $contacts ) { + public function addAttachment( &$attachments, $contacts ) { // Check preferences setting if ( CRM_Core_BAO_Setting::getItem( CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'activity_assignee_notification_ics' ) ) { $config = &CRM_Core_Config::singleton(); @@ -102,7 +102,7 @@ class CRM_Activity_BAO_ICalendar { return null; } - function cleanup() { + public function cleanup() { if ( !empty ( $this->icsfile ) ) { @unlink( $this->icsfile ); } diff --git a/CRM/Activity/BAO/Query.php b/CRM/Activity/BAO/Query.php index 0a1e92afe8..e9fcfc6885 100644 --- a/CRM/Activity/BAO/Query.php +++ b/CRM/Activity/BAO/Query.php @@ -43,7 +43,7 @@ class CRM_Activity_BAO_Query { * @return void * @access public */ - static function select(&$query) { + public static function select(&$query) { if (!empty($query->_returnProperties['activity_id'])) { $query->_select['activity_id'] = "civicrm_activity.id as activity_id"; $query->_element['activity_id'] = 1; @@ -169,7 +169,7 @@ class CRM_Activity_BAO_Query { * @return void * @access public */ - static function where(&$query) { + public static function where(&$query) { $grouping = NULL; foreach (array_keys($query->_params) as $id) { if (substr($query->_params[$id][0], 0, 9) == 'activity_') { @@ -190,7 +190,7 @@ class CRM_Activity_BAO_Query { * @return void * @access public */ - static function whereClauseSingle(&$values, &$query) { + public static function whereClauseSingle(&$values, &$query) { list($name, $op, $value, $grouping, $wildcard) = $values; $strtolower = function_exists('mb_strtolower') ? 'mb_strtolower' : 'strtolower'; @@ -401,7 +401,7 @@ class CRM_Activity_BAO_Query { * * @return null|string */ - static function from($name, $mode, $side) { + public static function from($name, $mode, $side) { $from = NULL; switch ($name) { case 'civicrm_activity': @@ -457,7 +457,7 @@ class CRM_Activity_BAO_Query { * @return string * @access public */ - function qill() { + public function qill() { return (isset($this->_qill)) ? $this->_qill : ""; } @@ -470,7 +470,7 @@ class CRM_Activity_BAO_Query { * @return void * @static */ - static function buildSearchForm(&$form) { + public static function buildSearchForm(&$form) { $activityOptions = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE); asort($activityOptions); foreach ($activityOptions as $activityID => $activity) { @@ -585,7 +585,7 @@ class CRM_Activity_BAO_Query { * * @return array|null */ - static function defaultReturnProperties($mode, $includeCustomFields = TRUE) { + public static function defaultReturnProperties($mode, $includeCustomFields = TRUE) { $properties = NULL; if ($mode & CRM_Contact_BAO_Query::MODE_ACTIVITY) { $properties = array( @@ -635,7 +635,7 @@ class CRM_Activity_BAO_Query { * * @return array */ - static function buildWhereAndQill(&$query, $value, $pseudoconstantType, $op, $grouping, $params) { + public static function buildWhereAndQill(&$query, $value, $pseudoconstantType, $op, $grouping, $params) { $matches = $val = $clause = array(); if (is_array($value)) { diff --git a/CRM/Activity/Controller/Search.php b/CRM/Activity/Controller/Search.php index 85e490f831..d8d0ddb90f 100644 --- a/CRM/Activity/Controller/Search.php +++ b/CRM/Activity/Controller/Search.php @@ -48,7 +48,7 @@ class CRM_Activity_Controller_Search extends CRM_Core_Controller { /** * Class constructor */ - function __construct($title = NULL, $modal = TRUE, $action = CRM_Core_Action::NONE) { + public function __construct($title = NULL, $modal = TRUE, $action = CRM_Core_Action::NONE) { parent::__construct($title, $modal); diff --git a/CRM/Activity/Form/Activity.php b/CRM/Activity/Form/Activity.php index 1542a0cee7..3d0f8827ee 100644 --- a/CRM/Activity/Form/Activity.php +++ b/CRM/Activity/Form/Activity.php @@ -127,7 +127,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { * form fields based on their requirement * */ - function setFields() { + public function setFields() { $this->_fields = array( 'subject' => array( 'type' => 'text', @@ -212,7 +212,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { $this->_cdType = CRM_Utils_Array::value('type', $_GET); $this->assign('cdType', FALSE); if ($this->_cdType) { @@ -514,7 +514,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { if ($this->_cdType) { return CRM_Custom_Form_CustomData::setDefaultValues($this); } @@ -824,7 +824,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { * @access public * @static */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { // skip form rule if deleting if (CRM_Utils_Array::value('_qf_Activity_next_', $fields) == 'Delete') { return TRUE; @@ -1170,7 +1170,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { * * @param array $params */ - function beginPostProcess(&$params) { + public function beginPostProcess(&$params) { if ($this->_activityTypeFile) { $className = "CRM_{$this->_crmDir}_Form_Activity_{$this->_activityTypeFile}"; $className::beginPostProcess($this, $params); @@ -1184,7 +1184,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { * @param array $params * @param $activity */ - function endPostProcess(&$params, &$activity) { + public function endPostProcess(&$params, &$activity) { if ($this->_activityTypeFile) { $className = "CRM_{$this->_crmDir}_Form_Activity_{$this->_activityTypeFile}"; $className::endPostProcess($this, $params, $activity); diff --git a/CRM/Activity/Form/ActivityFilter.php b/CRM/Activity/Form/ActivityFilter.php index 49a876ea7f..b90ef62d5b 100644 --- a/CRM/Activity/Form/ActivityFilter.php +++ b/CRM/Activity/Form/ActivityFilter.php @@ -69,7 +69,7 @@ class CRM_Activity_Form_ActivityFilter extends CRM_Core_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { // CRM-11761 retrieve user's activity filter preferences $defaults = array(); $session = CRM_Core_Session::singleton(); diff --git a/CRM/Activity/Form/ActivityLinks.php b/CRM/Activity/Form/ActivityLinks.php index 0c1b75ed02..57f6f3fdc6 100644 --- a/CRM/Activity/Form/ActivityLinks.php +++ b/CRM/Activity/Form/ActivityLinks.php @@ -45,7 +45,7 @@ class CRM_Activity_Form_ActivityLinks extends CRM_Core_Form { /** * @param $self */ - static function commonBuildQuickForm($self) { + public static function commonBuildQuickForm($self) { $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $self); if (!$contactId) { $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, NULL, $_REQUEST); diff --git a/CRM/Activity/Form/Search.php b/CRM/Activity/Form/Search.php index f64d45852e..3fe8d61d39 100644 --- a/CRM/Activity/Form/Search.php +++ b/CRM/Activity/Form/Search.php @@ -87,7 +87,7 @@ class CRM_Activity_Form_Search extends CRM_Core_Form_Search { * @return void * @access public */ - function preProcess() { + public function preProcess() { $this->set('searchFormName', 'Search'); // set the button names @@ -170,7 +170,7 @@ class CRM_Activity_Form_Search extends CRM_Core_Form_Search { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { parent::buildQuickForm(); $this->addElement('text', 'sort_name', ts('Name or Email'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name')); @@ -206,7 +206,7 @@ class CRM_Activity_Form_Search extends CRM_Core_Form_Search { * @return void * @access public */ - function postProcess() { + public function postProcess() { if ($this->_done) { return; } @@ -286,7 +286,7 @@ class CRM_Activity_Form_Search extends CRM_Core_Form_Search { $controller->run(); } - function fixFormValues() { + public function fixFormValues() { if (!$this->_force) { return; } @@ -395,7 +395,7 @@ class CRM_Activity_Form_Search extends CRM_Core_Form_Search { /** * @return null */ - function getFormValues() { + public function getFormValues() { return NULL; } diff --git a/CRM/Activity/Form/Task.php b/CRM/Activity/Form/Task.php index 912d4d2156..5b20c4b496 100644 --- a/CRM/Activity/Form/Task.php +++ b/CRM/Activity/Form/Task.php @@ -82,7 +82,7 @@ class CRM_Activity_Form_Task extends CRM_Core_Form { * @return void * @access public */ - function preProcess() { + public function preProcess() { self::preProcessCommon($this); } @@ -90,7 +90,7 @@ class CRM_Activity_Form_Task extends CRM_Core_Form { * @param CRM_Core_Form $form * @param bool $useTable */ - static function preProcessCommon(&$form, $useTable = FALSE) { + public static function preProcessCommon(&$form, $useTable = FALSE) { $form->_activityHolderIds = array(); $values = $form->controller->exportValues($form->get('searchFormName')); @@ -183,7 +183,7 @@ WHERE activity_id IN ( $IDs ) AND * @return void * @access public */ - function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { + public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { $this->addButtons(array( array( 'type' => $nextType, diff --git a/CRM/Activity/Form/Task/AddToTag.php b/CRM/Activity/Form/Task/AddToTag.php index 7801a06588..5c15b25d30 100644 --- a/CRM/Activity/Form/Task/AddToTag.php +++ b/CRM/Activity/Form/Task/AddToTag.php @@ -61,7 +61,7 @@ class CRM_Activity_Form_Task_AddToTag extends CRM_Activity_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { // add select for tag $this->_tags = CRM_Core_BAO_Tag::getTags('civicrm_activity'); @@ -76,7 +76,7 @@ class CRM_Activity_Form_Task_AddToTag extends CRM_Activity_Form_Task { $this->addDefaultButtons(ts('Tag Activities')); } - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Activity_Form_Task_AddToTag', 'formRule')); } @@ -86,7 +86,7 @@ class CRM_Activity_Form_Task_AddToTag extends CRM_Activity_Form_Task { * * @return array */ - static function formRule($form, $rule) { + public static function formRule($form, $rule) { $errors = array(); if (empty($form['tag']) && empty($form['activity_taglist'])) { $errors['_qf_default'] = ts("Please select at least one tag."); diff --git a/CRM/Activity/Form/Task/Batch.php b/CRM/Activity/Form/Task/Batch.php index 367176bbe0..c7e425d5c6 100755 --- a/CRM/Activity/Form/Task/Batch.php +++ b/CRM/Activity/Form/Task/Batch.php @@ -63,7 +63,7 @@ class CRM_Activity_Form_Task_Batch extends CRM_Activity_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { /* * initialize the task and row fields */ @@ -104,7 +104,7 @@ class CRM_Activity_Form_Task_Batch extends CRM_Activity_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $ufGroupId = $this->get('ufGroupId'); if (!$ufGroupId) { @@ -209,7 +209,7 @@ class CRM_Activity_Form_Task_Batch extends CRM_Activity_Form_Task { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { if (empty($this->_fields)) { return; } diff --git a/CRM/Activity/Form/Task/Delete.php b/CRM/Activity/Form/Task/Delete.php index 3543d65bd1..dcddc86c59 100755 --- a/CRM/Activity/Form/Task/Delete.php +++ b/CRM/Activity/Form/Task/Delete.php @@ -54,7 +54,7 @@ class CRM_Activity_Form_Task_Delete extends CRM_Activity_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); } @@ -65,7 +65,7 @@ class CRM_Activity_Form_Task_Delete extends CRM_Activity_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $this->addDefaultButtons(ts('Delete Activities'), 'done'); } diff --git a/CRM/Activity/Form/Task/FileOnCase.php b/CRM/Activity/Form/Task/FileOnCase.php index 1d4194b779..3c075d1fe6 100644 --- a/CRM/Activity/Form/Task/FileOnCase.php +++ b/CRM/Activity/Form/Task/FileOnCase.php @@ -63,7 +63,7 @@ class CRM_Activity_Form_Task_FileOnCase extends CRM_Activity_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); $session = CRM_Core_Session::singleton(); $this->_userContext = $session->readUserContext(); @@ -78,7 +78,7 @@ class CRM_Activity_Form_Task_FileOnCase extends CRM_Activity_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $this->add('text', 'unclosed_case_id', ts('Select Case'), array('class' => 'huge'), TRUE); $this->addDefaultButtons(ts('Continue >>')); } @@ -90,7 +90,7 @@ class CRM_Activity_Form_Task_FileOnCase extends CRM_Activity_Form_Task { * * @return void */ - function addRules() {} + public function addRules() {} /** * Process the form after the input has been submitted and validated diff --git a/CRM/Activity/Form/Task/PickOption.php b/CRM/Activity/Form/Task/PickOption.php index 70ed11c27f..80e6d9084e 100644 --- a/CRM/Activity/Form/Task/PickOption.php +++ b/CRM/Activity/Form/Task/PickOption.php @@ -69,7 +69,7 @@ class CRM_Activity_Form_Task_PickOption extends CRM_Activity_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { /* * initialize the task and row fields */ @@ -99,7 +99,7 @@ class CRM_Activity_Form_Task_PickOption extends CRM_Activity_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $this->addElement('checkbox', 'with_contact', ts('With Contact')); $this->addElement('checkbox', 'assigned_to', ts('Assigned to Contact')); $this->addElement('checkbox', 'created_by', ts('Created by')); @@ -114,7 +114,7 @@ class CRM_Activity_Form_Task_PickOption extends CRM_Activity_Form_Task { * * @return void */ - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Activity_Form_Task_PickOption', 'formRule')); } @@ -127,7 +127,7 @@ class CRM_Activity_Form_Task_PickOption extends CRM_Activity_Form_Task { * @static * @access public */ - static function formRule($fields) { + public static function formRule($fields) { if ( !isset($fields['with_contact']) && !isset($fields['assigned_to']) && !isset($fields['created_by']) diff --git a/CRM/Activity/Form/Task/PickProfile.php b/CRM/Activity/Form/Task/PickProfile.php index 9a6b5251a0..b5194b3f7b 100755 --- a/CRM/Activity/Form/Task/PickProfile.php +++ b/CRM/Activity/Form/Task/PickProfile.php @@ -63,7 +63,7 @@ class CRM_Activity_Form_Task_PickProfile extends CRM_Activity_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { /* * initialize the task and row fields */ @@ -94,7 +94,7 @@ class CRM_Activity_Form_Task_PickProfile extends CRM_Activity_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $types = array('Activity'); $profiles = CRM_Core_BAO_UFGroup::getProfiles($types, TRUE); @@ -142,7 +142,7 @@ class CRM_Activity_Form_Task_PickProfile extends CRM_Activity_Form_Task { * * @return void */ - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Activity_Form_Task_PickProfile', 'formRule')); } @@ -155,7 +155,7 @@ class CRM_Activity_Form_Task_PickProfile extends CRM_Activity_Form_Task { * @static * @access public */ - static function formRule($fields) { + public static function formRule($fields) { return TRUE; } diff --git a/CRM/Activity/Form/Task/Print.php b/CRM/Activity/Form/Task/Print.php index f0f2d94a56..f80745fa5c 100644 --- a/CRM/Activity/Form/Task/Print.php +++ b/CRM/Activity/Form/Task/Print.php @@ -44,7 +44,7 @@ class CRM_Activity_Form_Task_Print extends CRM_Activity_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preprocess(); // set print view, so that print templates are called @@ -75,7 +75,7 @@ class CRM_Activity_Form_Task_Print extends CRM_Activity_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { // // just need to add a javacript to popup the window for printing // diff --git a/CRM/Activity/Form/Task/RemoveFromTag.php b/CRM/Activity/Form/Task/RemoveFromTag.php index a2e0dd5753..bc0a5b69db 100644 --- a/CRM/Activity/Form/Task/RemoveFromTag.php +++ b/CRM/Activity/Form/Task/RemoveFromTag.php @@ -59,7 +59,7 @@ class CRM_Activity_Form_Task_RemoveFromTag extends CRM_Activity_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { // add select for tag $this->_tags = CRM_Core_BAO_Tag::getTags('civicrm_activity'); foreach ($this->_tags as $tagID => $tagName) { @@ -72,7 +72,7 @@ class CRM_Activity_Form_Task_RemoveFromTag extends CRM_Activity_Form_Task { $this->addDefaultButtons(ts('Remove Tags from activities')); } - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Activity_Form_Task_RemoveFromTag', 'formRule')); } @@ -82,7 +82,7 @@ class CRM_Activity_Form_Task_RemoveFromTag extends CRM_Activity_Form_Task { * * @return array */ - static function formRule($form, $rule) { + public static function formRule($form, $rule) { $errors = array(); if (empty($form['tag']) && empty($form['activity_taglist'])) { $errors['_qf_default'] = "Please select atleast one tag."; diff --git a/CRM/Activity/Form/Task/SMS.php b/CRM/Activity/Form/Task/SMS.php index 4da9839aa1..d29d80fc1b 100644 --- a/CRM/Activity/Form/Task/SMS.php +++ b/CRM/Activity/Form/Task/SMS.php @@ -52,7 +52,7 @@ class CRM_Activity_Form_Task_SMS extends CRM_Activity_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); CRM_Contact_Form_Task_SMSCommon::preProcessProvider($this); $this->assign('single', $this->_single); diff --git a/CRM/Activity/Form/Task/SearchTaskHookSample.php b/CRM/Activity/Form/Task/SearchTaskHookSample.php index 7a0110bd36..aaa88ca5d3 100644 --- a/CRM/Activity/Form/Task/SearchTaskHookSample.php +++ b/CRM/Activity/Form/Task/SearchTaskHookSample.php @@ -44,7 +44,7 @@ class CRM_Activity_Form_Task_SearchTaskHookSample extends CRM_Activity_Form_Task * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); $rows = array(); // display name and activity details of all selected contacts diff --git a/CRM/Activity/Import/Controller.php b/CRM/Activity/Import/Controller.php index 32f46326df..92bbf07648 100644 --- a/CRM/Activity/Import/Controller.php +++ b/CRM/Activity/Import/Controller.php @@ -37,7 +37,7 @@ class CRM_Activity_Import_Controller extends CRM_Core_Controller { /** * Class constructor */ - function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { + public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { parent::__construct($title, $modal); // lets get around the time limit issue if possible, CRM-2113 diff --git a/CRM/Activity/Import/Field.php b/CRM/Activity/Import/Field.php index 94c4bdfe94..064fbd472d 100644 --- a/CRM/Activity/Import/Field.php +++ b/CRM/Activity/Import/Field.php @@ -92,7 +92,7 @@ class CRM_Activity_Import_Field { * @param string $headerPattern * @param string $dataPattern */ - function __construct($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') { + public function __construct($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') { $this->_name = $name; $this->_title = $title; $this->_type = $type; @@ -102,7 +102,7 @@ class CRM_Activity_Import_Field { $this->_value = NULL; } - function resetValue() { + public function resetValue() { $this->_value = NULL; } @@ -110,14 +110,14 @@ class CRM_Activity_Import_Field { * The value is in string format. convert the value to the type of this field * and set the field value with the appropriate type */ - function setValue($value) { + public function setValue($value) { $this->_value = $value; } /** * @return bool */ - function validate() { + public function validate() { if (CRM_Utils_System::isNull($this->_value)) { return TRUE; diff --git a/CRM/Activity/Import/Form/MapField.php b/CRM/Activity/Import/Form/MapField.php index 5caa725d54..b9f95b61de 100644 --- a/CRM/Activity/Import/Form/MapField.php +++ b/CRM/Activity/Import/Form/MapField.php @@ -275,7 +275,7 @@ class CRM_Activity_Import_Form_MapField extends CRM_Import_Form_MapField { * @static * @access public */ - static function formRule($fields) { + public static function formRule($fields) { $errors = array(); // define so we avoid notices below $errors['_qf_default'] = ''; diff --git a/CRM/Activity/Import/Parser.php b/CRM/Activity/Import/Parser.php index f607767d33..ff04c4bdac 100644 --- a/CRM/Activity/Import/Parser.php +++ b/CRM/Activity/Import/Parser.php @@ -283,7 +283,7 @@ abstract class CRM_Activity_Import_Parser extends CRM_Import_Parser { * @return void * @access public */ - function setActiveFields($fieldKeys) { + public function setActiveFields($fieldKeys) { $this->_activeFieldCount = count($fieldKeys); foreach ($fieldKeys as $key) { if (empty($this->_fields[$key])) { @@ -301,7 +301,7 @@ abstract class CRM_Activity_Import_Parser extends CRM_Import_Parser { * @return array (reference ) associative array of name/value pairs * @access public */ - function &getActiveFieldParams() { + public function &getActiveFieldParams() { $params = array(); for ($i = 0; $i < $this->_activeFieldCount; $i++) { if (isset($this->_activeFields[$i]->_value) @@ -322,7 +322,7 @@ abstract class CRM_Activity_Import_Parser extends CRM_Import_Parser { * @param string $headerPattern * @param string $dataPattern */ - function addField($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') { + public function addField($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') { if (empty($name)) { $this->_fields['doNotImport'] = new CRM_Activity_Import_Field($name, $title, $type, $headerPattern, $dataPattern); } @@ -348,7 +348,7 @@ abstract class CRM_Activity_Import_Parser extends CRM_Import_Parser { * @return void * @access public */ - function set($store, $mode = self::MODE_SUMMARY) { + public function set($store, $mode = self::MODE_SUMMARY) { $store->set('fileSize', $this->_fileSize); $store->set('lineCount', $this->_lineCount); $store->set('seperator', $this->_seperator); @@ -393,7 +393,7 @@ abstract class CRM_Activity_Import_Parser extends CRM_Import_Parser { * @return void * @access public */ - static function exportCSV($fileName, $header, $data) { + public static function exportCSV($fileName, $header, $data) { $output = array(); $fd = fopen($fileName, 'w'); diff --git a/CRM/Activity/Import/Parser/Activity.php b/CRM/Activity/Import/Parser/Activity.php index 225a97f31e..2cae106a66 100644 --- a/CRM/Activity/Import/Parser/Activity.php +++ b/CRM/Activity/Import/Parser/Activity.php @@ -57,7 +57,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { /** * Class constructor */ - function __construct(&$mapperKeys, $mapperLocType = NULL, $mapperPhoneType = NULL) { + public function __construct(&$mapperKeys, $mapperLocType = NULL, $mapperPhoneType = NULL) { parent::__construct(); $this->_mapperKeys = &$mapperKeys; } @@ -68,7 +68,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { * @return void * @access public */ - function init() { + public function init() { $activityContact = CRM_Activity_BAO_ActivityContact::import(); $activityTarget['target_contact_id'] = $activityContact['contact_id']; $fields = array_merge(CRM_Activity_BAO_Activity::importableFields(), @@ -135,7 +135,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { * @return boolean * @access public */ - function mapField(&$values) { + public function mapField(&$values) { return CRM_Import_Parser::VALID; } @@ -147,7 +147,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { * @return boolean the result of this processing * @access public */ - function preview(&$values) { + public function preview(&$values) { return $this->summary($values); } @@ -159,7 +159,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { * @return boolean the result of this processing * @access public */ - function summary(&$values) { + public function summary(&$values) { $erroneousField = NULL; $response = $this->setActiveFieldValues($values, $erroneousField); $index = -1; @@ -242,7 +242,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { * @return boolean the result of this processing * @access public */ - function import($onDuplicate, &$values) { + public function import($onDuplicate, &$values) { // first make sure this is a valid line $response = $this->summary($values); @@ -398,7 +398,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { * @return void * @access public */ - function fini() {} + public function fini() {} } diff --git a/CRM/Activity/Page/AJAX.php b/CRM/Activity/Page/AJAX.php index c8e42c9f55..c39a339a88 100644 --- a/CRM/Activity/Page/AJAX.php +++ b/CRM/Activity/Page/AJAX.php @@ -36,7 +36,7 @@ * This class contains all the function that are called using AJAX (jQuery) */ class CRM_Activity_Page_AJAX { - static function getCaseActivity() { + public static function getCaseActivity() { $caseID = CRM_Utils_Type::escape($_GET['caseID'], 'Integer'); $contactID = CRM_Utils_Type::escape($_GET['cid'], 'Integer'); $userID = CRM_Utils_Type::escape($_GET['userID'], 'Integer'); @@ -71,7 +71,7 @@ class CRM_Activity_Page_AJAX { CRM_Utils_System::civiExit(); } - static function getCaseGlobalRelationships() { + public static function getCaseGlobalRelationships() { $sortMapper = array( 0 => 'sort_name', 1 => 'phone', 2 => 'email', ); @@ -104,7 +104,7 @@ class CRM_Activity_Page_AJAX { CRM_Utils_System::civiExit(); } - static function getCaseClientRelationships() { + public static function getCaseClientRelationships() { $caseID = CRM_Utils_Type::escape($_GET['caseID'], 'Integer'); $contactID = CRM_Utils_Type::escape($_GET['cid'], 'Integer'); @@ -165,7 +165,7 @@ class CRM_Activity_Page_AJAX { } - static function getCaseRoles() { + public static function getCaseRoles() { $caseID = CRM_Utils_Type::escape($_GET['caseID'], 'Integer'); $contactID = CRM_Utils_Type::escape($_GET['cid'], 'Integer'); @@ -296,7 +296,7 @@ class CRM_Activity_Page_AJAX { CRM_Utils_System::civiExit(); } - static function convertToCaseActivity() { + public static function convertToCaseActivity() { $params = array('caseID', 'activityID', 'contactID', 'newSubject', 'targetContactIds', 'mode'); $vals = array(); foreach ($params as $param) { @@ -311,7 +311,7 @@ class CRM_Activity_Page_AJAX { * * @return array */ - static function _convertToCaseActivity($params) { + public static function _convertToCaseActivity($params) { if (!$params['activityID'] || !$params['caseID']) { return (array('error_msg' => 'required params missing.')); } @@ -425,7 +425,7 @@ class CRM_Activity_Page_AJAX { return (array('error_msg' => $error_msg, 'newId' => $mainActivity->id)); } - static function getContactActivity() { + public static function getContactActivity() { $contactID = CRM_Utils_Type::escape($_POST['contact_id'], 'Integer'); $context = CRM_Utils_Type::escape(CRM_Utils_Array::value('context', $_GET), 'String'); diff --git a/CRM/Activity/Page/Tab.php b/CRM/Activity/Page/Tab.php index b5ad1d66c8..23ee5a4d23 100644 --- a/CRM/Activity/Page/Tab.php +++ b/CRM/Activity/Page/Tab.php @@ -46,7 +46,7 @@ class CRM_Activity_Page_Tab extends CRM_Core_Page { * * @access public */ - function browse() { + public function browse() { $this->assign('admin', FALSE); $this->assign('context', 'activity'); @@ -63,7 +63,7 @@ class CRM_Activity_Page_Tab extends CRM_Core_Page { $this->ajaxResponse['tabCount'] = CRM_Contact_BAO_Contact::getCountComponent('activity', $this->_contactId); } - function edit() { + public function edit() { // used for ajax tabs $context = CRM_Utils_Request::retrieve('context', 'String', $this); $this->assign('context', $context); @@ -126,7 +126,7 @@ class CRM_Activity_Page_Tab extends CRM_Core_Page { * @access public * */ - function preProcess() { + public function preProcess() { $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE); $this->assign('contactId', $this->_contactId); //FIX ME: need to fix this conflict @@ -149,7 +149,7 @@ class CRM_Activity_Page_Tab extends CRM_Core_Page { $controller->run(); } - function delete() { + public function delete() { $controller = new CRM_Core_Controller_Simple( 'CRM_Activity_Form_Activity', ts('Activity Record'), @@ -168,7 +168,7 @@ class CRM_Activity_Page_Tab extends CRM_Core_Page { * * @access public */ - function run() { + public function run() { $context = CRM_Utils_Request::retrieve('context', 'String', $this); $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this); $action = CRM_Utils_Request::retrieve('action', 'String', $this); diff --git a/CRM/Activity/Page/UserDashboard.php b/CRM/Activity/Page/UserDashboard.php index 4c227658ae..a1442022cb 100644 --- a/CRM/Activity/Page/UserDashboard.php +++ b/CRM/Activity/Page/UserDashboard.php @@ -44,7 +44,7 @@ class CRM_Activity_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoar * return null * @access public */ - function listActivities() { + public function listActivities() { $controller = new CRM_Core_Controller_Simple( @@ -72,7 +72,7 @@ class CRM_Activity_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoar * return null * @access public */ - function run() { + public function run() { parent::preProcess(); $this->listActivities(); } diff --git a/CRM/Activity/Selector/Activity.php b/CRM/Activity/Selector/Activity.php index b697aa11e5..769b566218 100644 --- a/CRM/Activity/Selector/Activity.php +++ b/CRM/Activity/Selector/Activity.php @@ -279,7 +279,7 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C * * @access public */ - function getPagerParams($action, &$params) { + public function getPagerParams($action, &$params) { $params['status'] = ts('Activities %%StatusMessage%%'); $params['csvString'] = NULL; $params['rowCount'] = CRM_Utils_Pager::ROWCOUNT; @@ -298,7 +298,7 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C * @return array the column headers that need to be displayed * @access public */ - function &getColumnHeaders($action = NULL, $output = NULL) { + public function &getColumnHeaders($action = NULL, $output = NULL) { if ($output == CRM_Core_Selector_Controller::EXPORT || $output == CRM_Core_Selector_Controller::SCREEN) { $csvHeaders = array(ts('Activity Type'), ts('Description'), ts('Activity Date')); foreach (self::_getColumnHeaders() as $column) { @@ -323,7 +323,7 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C * @return int Total number of rows * @access public */ - function getTotalCount($action, $case = NULL) { + public function getTotalCount($action, $case = NULL) { $params = array( 'contact_id' => $this->_contactId, 'admin' => $this->_admin, @@ -350,7 +350,7 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C * * @return int the total number of rows for this action */ - function &getRows($action, $offset, $rowCount, $sort, $output = NULL, $case = NULL) { + public function &getRows($action, $offset, $rowCount, $sort, $output = NULL, $case = NULL) { $params = array( 'contact_id' => $this->_contactId, 'admin' => $this->_admin, @@ -470,7 +470,7 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C * * @return string name of the file */ - function getExportFileName($output = 'csv') { + public function getExportFileName($output = 'csv') { return ts('CiviCRM Activity'); } diff --git a/CRM/Activity/Selector/Search.php b/CRM/Activity/Selector/Search.php index 61b70d40b6..b548bf0162 100644 --- a/CRM/Activity/Selector/Search.php +++ b/CRM/Activity/Selector/Search.php @@ -198,7 +198,7 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM * * @access public */ - function getPagerParams($action, &$params) { + public function getPagerParams($action, &$params) { $params['status'] = ts('Activities %%StatusMessage%%'); $params['csvString'] = NULL; $params['rowCount'] = CRM_Utils_Pager::ROWCOUNT; @@ -214,7 +214,7 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM * @return int Total number of rows * @access public */ - function getTotalCount($action) { + public function getTotalCount($action) { return $this->_query->searchQuery(0, 0, NULL, TRUE, FALSE, FALSE, FALSE, @@ -234,7 +234,7 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM * * @return array rows in the given offset and rowCount */ - function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { + public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { $result = $this->_query->searchQuery( $offset, $rowCount, $sort, FALSE, FALSE, @@ -416,14 +416,14 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM /** * @return mixed */ - function alphabetQuery() { + public function alphabetQuery() { return $this->_query->searchQuery(NULL, NULL, NULL, FALSE, FALSE, TRUE); } /** * @return string */ - function &getQuery() { + public function &getQuery() { return $this->_query; } @@ -434,7 +434,7 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM * * @return string name of the file */ - function getExportFileName($output = 'csv') { + public function getExportFileName($output = 'csv') { return ts('CiviCRM Activity Search'); } } diff --git a/CRM/Activity/StateMachine/Search.php b/CRM/Activity/StateMachine/Search.php index 7a91f7f05f..945ac1772f 100644 --- a/CRM/Activity/StateMachine/Search.php +++ b/CRM/Activity/StateMachine/Search.php @@ -44,7 +44,7 @@ class CRM_Activity_StateMachine_Search extends CRM_Core_StateMachine { /** * Class constructor */ - function __construct($controller, $action = CRM_Core_Action::NONE) { + public function __construct($controller, $action = CRM_Core_Action::NONE) { parent::__construct($controller, $action); $this->_pages = array(); @@ -77,7 +77,7 @@ class CRM_Activity_StateMachine_Search extends CRM_Core_StateMachine { * @return string the name of the form that will handle the task * @access protected */ - function taskName($controller, $formName = 'Search') { + public function taskName($controller, $formName = 'Search') { // total hack, check POST vars and then session to determine stuff $value = CRM_Utils_Array::value('task', $_POST); if (!isset($value)) { @@ -93,7 +93,7 @@ class CRM_Activity_StateMachine_Search extends CRM_Core_StateMachine { * @return string * @access public */ - function getTaskFormName() { + public function getTaskFormName() { return CRM_Utils_String::getClassName($this->_task); } @@ -109,7 +109,7 @@ class CRM_Activity_StateMachine_Search extends CRM_Core_StateMachine { /** * @return bool */ - function shouldReset() { + public function shouldReset() { return FALSE; } } diff --git a/CRM/Activity/Task.php b/CRM/Activity/Task.php index 0d046c0fa7..8575dc289a 100644 --- a/CRM/Activity/Task.php +++ b/CRM/Activity/Task.php @@ -70,7 +70,7 @@ class CRM_Activity_Task { * @static * @access public */ - static function &tasks() { + public static function &tasks() { if (!(self::$_tasks)) { self::$_tasks = array( 1 => array( @@ -154,7 +154,7 @@ class CRM_Activity_Task { * @static * @access public */ - static function &taskTitles() { + public static function &taskTitles() { self::tasks(); $titles = array(); foreach (self::$_tasks as $id => $value) { @@ -172,7 +172,7 @@ class CRM_Activity_Task { * @return array set of tasks that are valid for the user * @access public */ - static function &permissionedTaskTitles($permission) { + public static function &permissionedTaskTitles($permission) { $tasks = array(); if ($permission == CRM_Core_Permission::EDIT) { $tasks = self::taskTitles(); @@ -200,7 +200,7 @@ class CRM_Activity_Task { * @static * @access public */ - static function getTask($value) { + public static function getTask($value) { self::tasks(); if (!$value || !CRM_Utils_Array::value($value, self::$_tasks)) { // make the print task by default diff --git a/CRM/Admin/Form.php b/CRM/Admin/Form.php index fbae8a6946..4871920507 100644 --- a/CRM/Admin/Form.php +++ b/CRM/Admin/Form.php @@ -62,7 +62,7 @@ class CRM_Admin_Form extends CRM_Core_Form { /** * Basic setup */ - function preProcess() { + public function preProcess() { $this->_id = $this->get('id'); $this->_BAOName = $this->get('BAOName'); $this->_values = array(); @@ -82,7 +82,7 @@ class CRM_Admin_Form extends CRM_Core_Form { * * @return array */ - function setDefaultValues() { + public function setDefaultValues() { if (isset($this->_id) && empty($this->_values)) { $this->_values = array(); $params = array('id' => $this->_id); diff --git a/CRM/Admin/Form/ContactType.php b/CRM/Admin/Form/ContactType.php index 511466270a..7941da49d8 100644 --- a/CRM/Admin/Form/ContactType.php +++ b/CRM/Admin/Form/ContactType.php @@ -94,7 +94,7 @@ class CRM_Admin_Form_ContactType extends CRM_Admin_Form { * @access public * @static */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); diff --git a/CRM/Admin/Form/Extensions.php b/CRM/Admin/Form/Extensions.php index c4458185f7..74053ccf2c 100644 --- a/CRM/Admin/Form/Extensions.php +++ b/CRM/Admin/Form/Extensions.php @@ -92,7 +92,7 @@ class CRM_Admin_Form_Extensions extends CRM_Admin_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); return $defaults; } @@ -162,7 +162,7 @@ class CRM_Admin_Form_Extensions extends CRM_Admin_Form { * @access public * @static */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); return empty($errors) ? TRUE : $errors; diff --git a/CRM/Admin/Form/Job.php b/CRM/Admin/Form/Job.php index 93f4611db0..1d5b8a6600 100644 --- a/CRM/Admin/Form/Job.php +++ b/CRM/Admin/Form/Job.php @@ -39,7 +39,7 @@ class CRM_Admin_Form_Job extends CRM_Admin_Form { protected $_id = NULL; - function preProcess() { + public function preProcess() { parent::preProcess(); @@ -114,7 +114,7 @@ class CRM_Admin_Form_Job extends CRM_Admin_Form { * @return array|bool * @throws API_Exception */ - static function formRule($fields) { + public static function formRule($fields) { $errors = array(); @@ -139,7 +139,7 @@ class CRM_Admin_Form_Job extends CRM_Admin_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); if (!$this->_id) { diff --git a/CRM/Admin/Form/LabelFormats.php b/CRM/Admin/Form/LabelFormats.php index 230fffb1c5..d6f535591f 100644 --- a/CRM/Admin/Form/LabelFormats.php +++ b/CRM/Admin/Form/LabelFormats.php @@ -50,7 +50,7 @@ class CRM_Admin_Form_LabelFormats extends CRM_Admin_Form { */ protected $_group = NULL; - function preProcess() { + public function preProcess() { $this->_id = $this->get('id'); $this->_group = CRM_Utils_Request::retrieve('group', 'String', $this, FALSE, 'label_format'); $this->_values = array(); @@ -156,7 +156,7 @@ class CRM_Admin_Form_LabelFormats extends CRM_Admin_Form { /** * @return int */ - function setDefaultValues() { + public function setDefaultValues() { if ($this->_action & CRM_Core_Action::ADD) { $defaults['weight'] = CRM_Utils_Array::value('weight', CRM_Core_BAO_LabelFormat::getDefaultValues($this->_group), 0); } diff --git a/CRM/Admin/Form/MailSettings.php b/CRM/Admin/Form/MailSettings.php index 57dc757fdf..d35174fe48 100644 --- a/CRM/Admin/Form/MailSettings.php +++ b/CRM/Admin/Form/MailSettings.php @@ -98,7 +98,7 @@ class CRM_Admin_Form_MailSettings extends CRM_Admin_Form { * * @return void */ - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Admin_Form_MailSettings', 'formRule')); } @@ -111,7 +111,7 @@ class CRM_Admin_Form_MailSettings extends CRM_Admin_Form { * @static * @access public */ - static function formRule($fields) { + public static function formRule($fields) { $errors = array(); // Check for default from email address and organization (domain) name. Force them to change it. if ($fields['domain'] == 'EXAMPLE.ORG') { @@ -128,7 +128,7 @@ class CRM_Admin_Form_MailSettings extends CRM_Admin_Form { * * @return void */ - function postProcess() { + public function postProcess() { if ($this->_action & CRM_Core_Action::DELETE) { CRM_Core_BAO_MailSettings::deleteMailSettings($this->_id); CRM_Core_Session::setStatus("", ts('Mail Setting Deleted.'), "success"); diff --git a/CRM/Admin/Form/Mapping.php b/CRM/Admin/Form/Mapping.php index 38507db724..1bcce7d0a3 100644 --- a/CRM/Admin/Form/Mapping.php +++ b/CRM/Admin/Form/Mapping.php @@ -83,7 +83,7 @@ class CRM_Admin_Form_Mapping extends CRM_Admin_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = parent::setDefaultValues(); return $defaults; } diff --git a/CRM/Admin/Form/MessageTemplates.php b/CRM/Admin/Form/MessageTemplates.php index e5c9d318e7..5c7e00b0d1 100644 --- a/CRM/Admin/Form/MessageTemplates.php +++ b/CRM/Admin/Form/MessageTemplates.php @@ -42,7 +42,7 @@ class CRM_Admin_Form_MessageTemplates extends CRM_Admin_Form { // which (and whether) mailing workflow this template belongs to protected $_workflow_id = NULL; - function preProcess() { + public function preProcess() { $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add' diff --git a/CRM/Admin/Form/Options.php b/CRM/Admin/Form/Options.php index 9f1d27cd55..0a97ea4464 100644 --- a/CRM/Admin/Form/Options.php +++ b/CRM/Admin/Form/Options.php @@ -122,7 +122,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = parent::setDefaultValues(); if (!isset($defaults['weight']) || !$defaults['weight']) { @@ -331,7 +331,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form { * @access public * @static */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); if ($self->_gName == 'case_status' && empty($fields['grouping'])) { $errors['grouping'] = ts('Status class is a required field'); diff --git a/CRM/Admin/Form/ParticipantStatus.php b/CRM/Admin/Form/ParticipantStatus.php index 52ed87c881..6161f62094 100644 --- a/CRM/Admin/Form/ParticipantStatus.php +++ b/CRM/Admin/Form/ParticipantStatus.php @@ -70,7 +70,7 @@ class CRM_Admin_Form_ParticipantStatus extends CRM_Admin_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = parent::setDefaultValues(); if (empty($defaults['weight'])) { $defaults['weight'] = CRM_Utils_Weight::getDefaultWeight('CRM_Event_DAO_ParticipantStatusType'); @@ -82,7 +82,7 @@ class CRM_Admin_Form_ParticipantStatus extends CRM_Admin_Form { return $defaults; } - function postProcess() { + public function postProcess() { if ($this->_action & CRM_Core_Action::DELETE) { if (CRM_Event_BAO_ParticipantStatusType::deleteParticipantStatusType($this->_id)) { CRM_Core_Session::setStatus(ts('Selected participant status has been deleted.'), ts('Record Deleted'), 'success'); diff --git a/CRM/Admin/Form/PaymentProcessor.php b/CRM/Admin/Form/PaymentProcessor.php index 5ebc33a787..6b7e087779 100644 --- a/CRM/Admin/Form/PaymentProcessor.php +++ b/CRM/Admin/Form/PaymentProcessor.php @@ -46,7 +46,7 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form { protected $_ppDAO; - function preProcess() { + public function preProcess() { if(!CRM_Core_Permission::check('administer payment processors')) { CRM_Core_Error::statusBounce('The \'administer payment processors\' permission is required to add or edit a payment processor.'); } @@ -233,7 +233,7 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form { * * @return array|bool */ - static function formRule($fields) { + public static function formRule($fields) { // make sure that at least one of live or test is present // and we have at least name and url_site @@ -260,7 +260,7 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form { * * @return bool */ - static function checkSection(&$fields, &$errors, $section = NULL) { + public static function checkSection(&$fields, &$errors, $section = NULL) { $names = array('user_name'); $present = FALSE; @@ -288,7 +288,7 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); if ($this->_ppType) { $defaults['payment_processor_type_id'] = $this->_ppType; @@ -372,7 +372,7 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form { * * @return Void */ - function updatePaymentProcessor(&$values, $domainID, $test) { + public function updatePaymentProcessor(&$values, $domainID, $test) { $dao = new CRM_Financial_DAO_PaymentProcessor( ); $dao->id = $test ? $this->_testID : $this->_id; diff --git a/CRM/Admin/Form/PaymentProcessorType.php b/CRM/Admin/Form/PaymentProcessorType.php index 510b9871ab..e965483e91 100644 --- a/CRM/Admin/Form/PaymentProcessorType.php +++ b/CRM/Admin/Form/PaymentProcessorType.php @@ -42,7 +42,7 @@ class CRM_Admin_Form_PaymentProcessorType extends CRM_Admin_Form { protected $_fields = NULL; - function preProcess() { + public function preProcess() { parent::preProcess(); $this->_fields = array( @@ -181,7 +181,7 @@ class CRM_Admin_Form_PaymentProcessorType extends CRM_Admin_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); if (!$this->_id) { diff --git a/CRM/Admin/Form/PdfFormats.php b/CRM/Admin/Form/PdfFormats.php index c5481feab6..b95877e89c 100644 --- a/CRM/Admin/Form/PdfFormats.php +++ b/CRM/Admin/Form/PdfFormats.php @@ -95,7 +95,7 @@ class CRM_Admin_Form_PdfFormats extends CRM_Admin_Form { /** * @return int */ - function setDefaultValues() { + public function setDefaultValues() { if ($this->_action & CRM_Core_Action::ADD) { $defaults['weight'] = CRM_Utils_Array::value('weight', CRM_Core_BAO_PdfFormat::getDefaultValues(), 0); } diff --git a/CRM/Admin/Form/Preferences.php b/CRM/Admin/Form/Preferences.php index 78d3d18cfc..06c5b53875 100644 --- a/CRM/Admin/Form/Preferences.php +++ b/CRM/Admin/Form/Preferences.php @@ -50,7 +50,7 @@ class CRM_Admin_Form_Preferences extends CRM_Core_Form { protected $_params = NULL; - function preProcess() { + public function preProcess() { $this->_contactID = CRM_Utils_Request::retrieve('cid', 'Positive', $this, FALSE ); @@ -100,7 +100,7 @@ class CRM_Admin_Form_Preferences extends CRM_Core_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); foreach ($this->_varNames as $groupName => $settings) { @@ -115,7 +115,7 @@ class CRM_Admin_Form_Preferences extends CRM_Core_Form { /** * @param $defaults */ - function cbsDefaultValues(&$defaults) { + public function cbsDefaultValues(&$defaults) { foreach ($this->_varNames as $groupName => $groupValues) { foreach ($groupValues as $settingName => $fieldValue) { diff --git a/CRM/Admin/Form/Preferences/Address.php b/CRM/Admin/Form/Preferences/Address.php index a68c0206d4..596ae74666 100644 --- a/CRM/Admin/Form/Preferences/Address.php +++ b/CRM/Admin/Form/Preferences/Address.php @@ -37,7 +37,7 @@ * This class generates form components for Address Section */ class CRM_Admin_Form_Preferences_Address extends CRM_Admin_Form_Preferences { - function preProcess() { + public function preProcess() { CRM_Utils_System::setTitle(ts('Settings - Addresses')); @@ -93,7 +93,7 @@ class CRM_Admin_Form_Preferences_Address extends CRM_Admin_Form_Preferences { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $defaults['address_standardization_provider'] = $this->_config->address_standardization_provider; $defaults['address_standardization_userid'] = $this->_config->address_standardization_userid; @@ -158,7 +158,7 @@ class CRM_Admin_Form_Preferences_Address extends CRM_Admin_Form_Preferences { * * @return bool */ - static function formRule($fields) { + public static function formRule($fields) { $p = $fields['address_standardization_provider']; $u = $fields['address_standardization_userid']; $w = $fields['address_standardization_url']; diff --git a/CRM/Admin/Form/Preferences/Campaign.php b/CRM/Admin/Form/Preferences/Campaign.php index f5d4283f70..d48c104ba8 100644 --- a/CRM/Admin/Form/Preferences/Campaign.php +++ b/CRM/Admin/Form/Preferences/Campaign.php @@ -38,7 +38,7 @@ * */ class CRM_Admin_Form_Preferences_Campaign extends CRM_Admin_Form_Preferences { - function preProcess() { + public function preProcess() { CRM_Utils_System::setTitle(ts('CiviCampaign Component Settings')); $this->_varNames = array( CRM_Core_BAO_Setting::CAMPAIGN_PREFERENCES_NAME => array( diff --git a/CRM/Admin/Form/Preferences/Contribute.php b/CRM/Admin/Form/Preferences/Contribute.php index 15894d8f86..b839c23552 100644 --- a/CRM/Admin/Form/Preferences/Contribute.php +++ b/CRM/Admin/Form/Preferences/Contribute.php @@ -12,7 +12,7 @@ class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences { * * @return void */ - function preProcess() { + public function preProcess() { $config = CRM_Core_Config::singleton(); CRM_Utils_System::setTitle(ts('CiviContribute Component Settings')); $this->_varNames = array( @@ -90,7 +90,7 @@ class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences { * @return void * @access public */ - function buildQuickForm() { + public function buildQuickForm() { $this->add('checkbox', 'invoicing', ts('Enable Tax and Invoicing')); parent::buildQuickForm(); } @@ -103,7 +103,7 @@ class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings'); return $defaults; } diff --git a/CRM/Admin/Form/Preferences/Display.php b/CRM/Admin/Form/Preferences/Display.php index 36cbbae0f1..bf7bde5066 100644 --- a/CRM/Admin/Form/Preferences/Display.php +++ b/CRM/Admin/Form/Preferences/Display.php @@ -38,7 +38,7 @@ * */ class CRM_Admin_Form_Preferences_Display extends CRM_Admin_Form_Preferences { - function preProcess() { + public function preProcess() { CRM_Utils_System::setTitle(ts('Settings - Display Preferences')); $this->_varNames = array( @@ -111,7 +111,7 @@ class CRM_Admin_Form_Preferences_Display extends CRM_Admin_Form_Preferences { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = parent::setDefaultValues(); parent::cbsDefaultValues($defaults); diff --git a/CRM/Admin/Form/Preferences/Event.php b/CRM/Admin/Form/Preferences/Event.php index b5da07a162..e2657af60c 100644 --- a/CRM/Admin/Form/Preferences/Event.php +++ b/CRM/Admin/Form/Preferences/Event.php @@ -38,7 +38,7 @@ * */ class CRM_Admin_Form_Preferences_Event extends CRM_Admin_Form_Preferences { - function preProcess() { + public function preProcess() { CRM_Utils_System::setTitle(ts('CiviEvent Component Settings')); // pass "wiki" as 6th param to docURL2 if you are linking to a page in wiki.civicrm.org $docLink = CRM_Utils_System::docURL2("CiviEvent Cart Checkout", NULL, NULL, NULL, NULL, "wiki"); diff --git a/CRM/Admin/Form/Preferences/Mailing.php b/CRM/Admin/Form/Preferences/Mailing.php index 560f259fe6..7de79ac874 100644 --- a/CRM/Admin/Form/Preferences/Mailing.php +++ b/CRM/Admin/Form/Preferences/Mailing.php @@ -38,7 +38,7 @@ * */ class CRM_Admin_Form_Preferences_Mailing extends CRM_Admin_Form_Preferences { - function preProcess() { + public function preProcess() { CRM_Utils_System::setTitle(ts('CiviMail Component Settings')); $this->_varNames = array( CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME => array( @@ -114,7 +114,7 @@ class CRM_Admin_Form_Preferences_Mailing extends CRM_Admin_Form_Preferences { parent::preProcess(); } - function postProcess() { + public function postProcess() { // check if mailing tab is enabled, if not prompt user to enable the tab if "write_activity_record" is disabled $params = $this->controller->exportValues($this->_name); diff --git a/CRM/Admin/Form/Preferences/Member.php b/CRM/Admin/Form/Preferences/Member.php index 2e34cd1f26..6b7a3c5f01 100644 --- a/CRM/Admin/Form/Preferences/Member.php +++ b/CRM/Admin/Form/Preferences/Member.php @@ -38,7 +38,7 @@ * */ class CRM_Admin_Form_Preferences_Member extends CRM_Admin_Form_Preferences { - function preProcess() { + public function preProcess() { CRM_Utils_System::setTitle(ts('CiviMember Component Settings')); $this->_varNames = array( CRM_Core_BAO_Setting::MEMBER_PREFERENCES_NAME => array( @@ -61,7 +61,7 @@ class CRM_Admin_Form_Preferences_Member extends CRM_Admin_Form_Preferences { * @return void * @access public */ - function buildQuickForm() { + public function buildQuickForm() { parent::buildQuickForm(); } } diff --git a/CRM/Admin/Form/Preferences/Multisite.php b/CRM/Admin/Form/Preferences/Multisite.php index c8c551b0e1..b5944c3987 100644 --- a/CRM/Admin/Form/Preferences/Multisite.php +++ b/CRM/Admin/Form/Preferences/Multisite.php @@ -38,7 +38,7 @@ * */ class CRM_Admin_Form_Preferences_Multisite extends CRM_Admin_Form_Preferences { - function preProcess() { + public function preProcess() { $msDoc = CRM_Utils_System::docURL2('Multi Site Installation', NULL, NULL, NULL, NULL, "wiki"); CRM_Utils_System::setTitle(ts('Multi Site Settings')); $this->_varNames = array( diff --git a/CRM/Admin/Form/PreferencesDate.php b/CRM/Admin/Form/PreferencesDate.php index 82f29a8eef..f7d22e3afe 100644 --- a/CRM/Admin/Form/PreferencesDate.php +++ b/CRM/Admin/Form/PreferencesDate.php @@ -98,7 +98,7 @@ class CRM_Admin_Form_PreferencesDate extends CRM_Admin_Form { * @static * @access public */ - static function formRule($fields) { + public static function formRule($fields) { $errors = array(); if ($fields['name'] == 'activityDateTime' && !$fields['time_format']) { diff --git a/CRM/Admin/Form/RelationshipType.php b/CRM/Admin/Form/RelationshipType.php index ebc712b8c3..b1dd175e8f 100644 --- a/CRM/Admin/Form/RelationshipType.php +++ b/CRM/Admin/Form/RelationshipType.php @@ -103,7 +103,7 @@ class CRM_Admin_Form_RelationshipType extends CRM_Admin_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { if ($this->_action != CRM_Core_Action::DELETE && isset($this->_id) ) { diff --git a/CRM/Admin/Form/ScheduleReminders.php b/CRM/Admin/Form/ScheduleReminders.php index 4d520e15b4..350c7e7e44 100644 --- a/CRM/Admin/Form/ScheduleReminders.php +++ b/CRM/Admin/Form/ScheduleReminders.php @@ -270,7 +270,7 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form { * @access public * @static */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); if ((array_key_exists(1, $fields['entity']) && $fields['entity'][1][0] === 0) || (array_key_exists(2, $fields['entity']) && $fields['entity'][2][0] == 0) @@ -327,7 +327,7 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form { /** * @return int */ - function setDefaultValues() { + public function setDefaultValues() { if ($this->_action & CRM_Core_Action::ADD) { $defaults['is_active'] = 1; $defaults['mode'] = 'Email'; diff --git a/CRM/Admin/Form/Setting.php b/CRM/Admin/Form/Setting.php index bca622fbbe..539f53ad84 100644 --- a/CRM/Admin/Form/Setting.php +++ b/CRM/Admin/Form/Setting.php @@ -50,7 +50,7 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { if (!$this->_defaults) { $this->_defaults = array(); $formArray = array('Component', 'Localization'); diff --git a/CRM/Admin/Form/Setting/Component.php b/CRM/Admin/Form/Setting/Component.php index bff82c2f21..861d9297ea 100644 --- a/CRM/Admin/Form/Setting/Component.php +++ b/CRM/Admin/Form/Setting/Component.php @@ -76,7 +76,7 @@ class CRM_Admin_Form_Setting_Component extends CRM_Admin_Form_Setting { * @access public * @static */ - static function formRule($fields, $files, $options) { + public static function formRule($fields, $files, $options) { $errors = array(); if (array_key_exists('enableComponents', $fields) && is_array($fields['enableComponents'])) { diff --git a/CRM/Admin/Form/Setting/Localization.php b/CRM/Admin/Form/Setting/Localization.php index 693a0ee3c9..869e0bf9a5 100644 --- a/CRM/Admin/Form/Setting/Localization.php +++ b/CRM/Admin/Form/Setting/Localization.php @@ -174,7 +174,7 @@ class CRM_Admin_Form_Setting_Localization extends CRM_Admin_Form_Setting { * * @return array|bool */ - static function formRule($fields) { + public static function formRule($fields) { $errors = array(); if (CRM_Utils_Array::value('monetaryThousandSeparator', $fields) == CRM_Utils_Array::value('monetaryDecimalPoint', $fields) @@ -212,7 +212,7 @@ class CRM_Admin_Form_Setting_Localization extends CRM_Admin_Form_Setting { return empty($errors) ? TRUE : $errors; } - function setDefaultValues() { + public function setDefaultValues() { parent::setDefaultValues(); // CRM-1496 diff --git a/CRM/Admin/Form/Setting/Mail.php b/CRM/Admin/Form/Setting/Mail.php index 94f882cb03..37823ac2f6 100644 --- a/CRM/Admin/Form/Setting/Mail.php +++ b/CRM/Admin/Form/Setting/Mail.php @@ -72,7 +72,7 @@ class CRM_Admin_Form_Setting_Mail extends CRM_Admin_Form_Setting { * * @return array|bool */ - static function formRule($fields) { + public static function formRule($fields) { $errors = array(); if (CRM_Utils_Array::value('mailerJobSize', $fields) > 0) { diff --git a/CRM/Admin/Form/Setting/Mapping.php b/CRM/Admin/Form/Setting/Mapping.php index 9c1335ffbe..67106e535d 100644 --- a/CRM/Admin/Form/Setting/Mapping.php +++ b/CRM/Admin/Form/Setting/Mapping.php @@ -67,7 +67,7 @@ class CRM_Admin_Form_Setting_Mapping extends CRM_Admin_Form_Setting { * @access public * @static */ - static function formRule($fields) { + public static function formRule($fields) { $errors = array(); if (!CRM_Utils_System::checkPHPVersion(5, FALSE)) { @@ -94,7 +94,7 @@ class CRM_Admin_Form_Setting_Mapping extends CRM_Admin_Form_Setting { * @return void * @access public */ - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Admin_Form_Setting_Mapping', 'formRule')); } } diff --git a/CRM/Admin/Form/Setting/Miscellaneous.php b/CRM/Admin/Form/Setting/Miscellaneous.php index 8b0cf20daa..65e94c3f8e 100644 --- a/CRM/Admin/Form/Setting/Miscellaneous.php +++ b/CRM/Admin/Form/Setting/Miscellaneous.php @@ -129,7 +129,7 @@ class CRM_Admin_Form_Setting_Miscellaneous extends CRM_Admin_Form_Setting { * @access public * @static */ - static function formRule($fields, $files, $options) { + public static function formRule($fields, $files, $options) { $errors = array(); // validate max file size diff --git a/CRM/Admin/Form/Setting/Smtp.php b/CRM/Admin/Form/Setting/Smtp.php index f16b35cfc2..5ae6789cc1 100644 --- a/CRM/Admin/Form/Setting/Smtp.php +++ b/CRM/Admin/Form/Setting/Smtp.php @@ -209,7 +209,7 @@ class CRM_Admin_Form_Setting_Smtp extends CRM_Admin_Form_Setting { * @static * @access public */ - static function formRule($fields) { + public static function formRule($fields) { if ($fields['outBound_option'] == CRM_Mailing_Config::OUTBOUND_OPTION_SMTP) { if (empty($fields['smtpServer'])) { $errors['smtpServer'] = 'SMTP Server name is a required field.'; @@ -246,7 +246,7 @@ class CRM_Admin_Form_Setting_Smtp extends CRM_Admin_Form_Setting { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { if (!$this->_defaults) { $this->_defaults = array(); diff --git a/CRM/Admin/Form/Setting/UpdateConfigBackend.php b/CRM/Admin/Form/Setting/UpdateConfigBackend.php index 610b12e4e4..cca9dded3a 100644 --- a/CRM/Admin/Form/Setting/UpdateConfigBackend.php +++ b/CRM/Admin/Form/Setting/UpdateConfigBackend.php @@ -76,7 +76,7 @@ class CRM_Admin_Form_Setting_UpdateConfigBackend extends CRM_Admin_Form_Setting parent::buildQuickForm(); } - function setDefaultValues() { + public function setDefaultValues() { if (!$this->_defaults) { parent::setDefaultValues(); @@ -96,7 +96,7 @@ class CRM_Admin_Form_Setting_UpdateConfigBackend extends CRM_Admin_Form_Setting * * @return array */ - static function formRule($fields) { + public static function formRule($fields) { $tmpDir = trim($fields['newBaseDir']); $errors = array(); @@ -108,7 +108,7 @@ class CRM_Admin_Form_Setting_UpdateConfigBackend extends CRM_Admin_Form_Setting return $errors; } - function postProcess() { + public function postProcess() { if (!empty($_POST['_qf_UpdateConfigBackend_next_cleanup'])) { $config = CRM_Core_Config::singleton(); diff --git a/CRM/Admin/Form/Setting/Url.php b/CRM/Admin/Form/Setting/Url.php index 1c96ce317d..da1f039664 100644 --- a/CRM/Admin/Form/Setting/Url.php +++ b/CRM/Admin/Form/Setting/Url.php @@ -73,7 +73,7 @@ class CRM_Admin_Form_Setting_Url extends CRM_Admin_Form_Setting { * * @return array|bool */ - static function formRule($fields) { + public static function formRule($fields) { if (isset($fields['enableSSL']) && $fields['enableSSL'] ) { diff --git a/CRM/Admin/Form/WordReplacements.php b/CRM/Admin/Form/WordReplacements.php index bc3f112174..054fb3f2ee 100644 --- a/CRM/Admin/Form/WordReplacements.php +++ b/CRM/Admin/Form/WordReplacements.php @@ -39,7 +39,7 @@ class CRM_Admin_Form_WordReplacements extends CRM_Core_Form { protected $_defaults = NULL; - function preProcess() { + public function preProcess() { // This controller was originally written to CRUD $config->locale_custom_strings, // but that's no longer the canonical store. Re-sync from canonical store to ensure // that we display that latest data. This is inefficient - at some point, we @@ -183,7 +183,7 @@ class CRM_Admin_Form_WordReplacements extends CRM_Core_Form { * @static * @access public */ - static function formRule($values) { + public static function formRule($values) { $errors = array(); $oldValues = CRM_Utils_Array::value('old', $values); diff --git a/CRM/Admin/Page/AJAX.php b/CRM/Admin/Page/AJAX.php index f0175a9aff..b930058f6d 100644 --- a/CRM/Admin/Page/AJAX.php +++ b/CRM/Admin/Page/AJAX.php @@ -42,7 +42,7 @@ class CRM_Admin_Page_AJAX { * CRM-12337 Output navigation menu as executable javascript * @see smarty_function_crmNavigationMenu */ - static function getNavigationMenu() { + public static function getNavigationMenu() { $contactID = CRM_Core_Session::singleton()->get('userID'); if ($contactID) { CRM_Core_Page_AJAX::setJsHeaders(); @@ -56,7 +56,7 @@ class CRM_Admin_Page_AJAX { /** * Return menu tree as json data for editing */ - static function getNavigationList() { + public static function getNavigationList() { echo CRM_Core_BAO_Navigation::buildNavigation(TRUE, FALSE); CRM_Utils_System::civiExit(); } @@ -64,7 +64,7 @@ class CRM_Admin_Page_AJAX { /** * Process drag/move action for menu tree */ - static function menuTree() { + public static function menuTree() { CRM_Core_BAO_Navigation::processNavigation($_GET); } @@ -72,7 +72,7 @@ class CRM_Admin_Page_AJAX { * Build status message while * enabling/ disabling various objects */ - static function getStatusMsg() { + public static function getStatusMsg() { require_once('api/v3/utils.php'); $recordID = CRM_Utils_Type::escape($_GET['id'], 'Integer'); $entity = CRM_Utils_Type::escape($_GET['entity'], 'String'); @@ -246,7 +246,7 @@ class CRM_Admin_Page_AJAX { CRM_Core_Page_AJAX::returnJsonResponse($ret); } - static function mergeTagList() { + public static function mergeTagList() { $name = CRM_Utils_Type::escape($_GET['term'], 'String'); $fromId = CRM_Utils_Type::escape($_GET['fromId'], 'Integer'); $limit = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'search_autocomplete_count', NULL, 10); @@ -294,7 +294,7 @@ LIMIT $limit"; CRM_Utils_JSON::output($result); } - function mappingList() { + public function mappingList() { if (empty($_GET['mappingID'])) { CRM_Utils_JSON::output(array('status' => 'error', 'error_msg' => 'required params missing.')); } @@ -318,7 +318,7 @@ LIMIT $limit"; CRM_Utils_JSON::output($output); } - static function mergeTags() { + public static function mergeTags() { $tagAId = CRM_Utils_Type::escape($_POST['fromId'], 'Integer'); $tagBId = CRM_Utils_Type::escape($_POST['toId'], 'Integer'); diff --git a/CRM/Admin/Page/APIDoc.php b/CRM/Admin/Page/APIDoc.php index 8a3e63c9b3..549af5a0f0 100644 --- a/CRM/Admin/Page/APIDoc.php +++ b/CRM/Admin/Page/APIDoc.php @@ -41,7 +41,7 @@ class CRM_Admin_Page_APIDoc extends CRM_Core_Page { /** * @return string */ - function run() { + public function run() { CRM_Utils_System::setTitle(ts('API Parameters')); return parent::run(); } @@ -49,7 +49,7 @@ class CRM_Admin_Page_APIDoc extends CRM_Core_Page { /** * @return string */ - function getTemplateFileName() { + public function getTemplateFileName() { return 'CRM/Core/APIDoc.tpl'; } @@ -60,7 +60,7 @@ class CRM_Admin_Page_APIDoc extends CRM_Core_Page { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/api/doc'; } } diff --git a/CRM/Admin/Page/APIExplorer.php b/CRM/Admin/Page/APIExplorer.php index 1a178ef49e..5200f02aac 100644 --- a/CRM/Admin/Page/APIExplorer.php +++ b/CRM/Admin/Page/APIExplorer.php @@ -41,7 +41,7 @@ class CRM_Admin_Page_APIExplorer extends CRM_Core_Page { /** * @return string */ - function run() { + public function run() { CRM_Utils_System::setTitle(ts('API explorer and generator')); CRM_Core_Resources::singleton() ->addScriptFile('civicrm', 'templates/CRM/Admin/Page/APIExplorer.js') @@ -56,7 +56,7 @@ class CRM_Admin_Page_APIExplorer extends CRM_Core_Page { * * @return string user context. */ - function userContext() { + public function userContext() { return 'civicrm/api/explorer'; } } diff --git a/CRM/Admin/Page/Access.php b/CRM/Admin/Page/Access.php index 3d19f3b668..a5c75d0a18 100644 --- a/CRM/Admin/Page/Access.php +++ b/CRM/Admin/Page/Access.php @@ -41,7 +41,7 @@ class CRM_Admin_Page_Access extends CRM_Core_Page { /** * @return string */ - function run() { + public function run() { $config = CRM_Core_Config::singleton(); switch ($config->userFramework) { diff --git a/CRM/Admin/Page/Admin.php b/CRM/Admin/Page/Admin.php index 0a5a3d1afa..fa5e14e8ce 100644 --- a/CRM/Admin/Page/Admin.php +++ b/CRM/Admin/Page/Admin.php @@ -40,7 +40,7 @@ class CRM_Admin_Page_Admin extends CRM_Core_Page { /** * @return string */ - function run() { + public function run() { $errorMessage = ''; // ensure that all CiviCRM tables are InnoDB, else abort // this is not a very fast operation, so we do it randomly 10% of the times diff --git a/CRM/Admin/Page/CMSUser.php b/CRM/Admin/Page/CMSUser.php index 775e488e00..8448e2c33f 100644 --- a/CRM/Admin/Page/CMSUser.php +++ b/CRM/Admin/Page/CMSUser.php @@ -49,7 +49,7 @@ class CRM_Admin_Page_CMSUser extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { //if javascript is enabled if (CRM_Utils_Request::retrieve('confirmed', 'Boolean', $this, '', '', 'GET' diff --git a/CRM/Admin/Page/ConfigTaskList.php b/CRM/Admin/Page/ConfigTaskList.php index 2ce2a62bf6..984e634767 100644 --- a/CRM/Admin/Page/ConfigTaskList.php +++ b/CRM/Admin/Page/ConfigTaskList.php @@ -40,7 +40,7 @@ class CRM_Admin_Page_ConfigTaskList extends CRM_Core_Page { /** * @return string */ - function run() { + public function run() { CRM_Utils_System::setTitle(ts("Configuration Checklist")); $this->assign('recentlyViewed', FALSE); diff --git a/CRM/Admin/Page/ContactType.php b/CRM/Admin/Page/ContactType.php index 72c86fe758..bc16e7b17a 100644 --- a/CRM/Admin/Page/ContactType.php +++ b/CRM/Admin/Page/ContactType.php @@ -53,7 +53,7 @@ class CRM_Admin_Page_ContactType extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Contact_BAO_ContactType'; } @@ -62,7 +62,7 @@ class CRM_Admin_Page_ContactType extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::UPDATE => array( @@ -92,7 +92,7 @@ class CRM_Admin_Page_ContactType extends CRM_Core_Page_Basic { return self::$_links; } - function run() { + public function run() { $action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 0); $this->assign('action', $action); $id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, 0); @@ -102,7 +102,7 @@ class CRM_Admin_Page_ContactType extends CRM_Core_Page_Basic { return parent::run(); } - function browse() { + public function browse() { $rows = CRM_Contact_BAO_ContactType::contactTypeInfo(TRUE); foreach ($rows as $key => $value) { $mask = NULL; @@ -135,7 +135,7 @@ class CRM_Admin_Page_ContactType extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Admin_Form_ContactType'; } @@ -144,7 +144,7 @@ class CRM_Admin_Page_ContactType extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'Contact Types'; } @@ -155,7 +155,7 @@ class CRM_Admin_Page_ContactType extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/options/subtype'; } } diff --git a/CRM/Admin/Page/EventTemplate.php b/CRM/Admin/Page/EventTemplate.php index ae0ccfdade..084d02ad7f 100644 --- a/CRM/Admin/Page/EventTemplate.php +++ b/CRM/Admin/Page/EventTemplate.php @@ -51,7 +51,7 @@ class CRM_Admin_Page_EventTemplate extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Event_BAO_Event'; } @@ -60,7 +60,7 @@ class CRM_Admin_Page_EventTemplate extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { // helper variable for nicer formatting self::$_links = array( @@ -89,7 +89,7 @@ class CRM_Admin_Page_EventTemplate extends CRM_Core_Page_Basic { * @access public * @static */ - function browse() { + public function browse() { //get all event templates. $allEventTemplates = array(); @@ -146,7 +146,7 @@ class CRM_Admin_Page_EventTemplate extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Admin_Form_EventTemplate'; } @@ -155,7 +155,7 @@ class CRM_Admin_Page_EventTemplate extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'Event Templates'; } @@ -166,7 +166,7 @@ class CRM_Admin_Page_EventTemplate extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/eventTemplate'; } } diff --git a/CRM/Admin/Page/Extensions.php b/CRM/Admin/Page/Extensions.php index 560618e439..00513fe605 100644 --- a/CRM/Admin/Page/Extensions.php +++ b/CRM/Admin/Page/Extensions.php @@ -54,7 +54,7 @@ class CRM_Admin_Page_Extensions extends CRM_Core_Page_Basic { * @access public * */ - function preProcess() { + public function preProcess() { CRM_Utils_System::setTitle(ts('CiviCRM Extensions')); $destination = CRM_Utils_System::url( 'civicrm/admin/extensions', 'reset=1' ); @@ -68,7 +68,7 @@ class CRM_Admin_Page_Extensions extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Core_BAO_Extension'; } @@ -77,7 +77,7 @@ class CRM_Admin_Page_Extensions extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::ADD => array( @@ -121,7 +121,7 @@ class CRM_Admin_Page_Extensions extends CRM_Core_Page_Basic { * * @return void */ - function run() { + public function run() { $this->preProcess(); return parent::run(); } @@ -134,7 +134,7 @@ class CRM_Admin_Page_Extensions extends CRM_Core_Page_Basic { * @access public * @static */ - function browse() { + public function browse() { $mapper = CRM_Extension_System::singleton()->getMapper(); $manager = CRM_Extension_System::singleton()->getManager(); @@ -243,7 +243,7 @@ class CRM_Admin_Page_Extensions extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Admin_Form_Extensions'; } @@ -252,7 +252,7 @@ class CRM_Admin_Page_Extensions extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'CRM_Admin_Form_Extensions'; } @@ -263,7 +263,7 @@ class CRM_Admin_Page_Extensions extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/extensions'; } @@ -275,7 +275,7 @@ class CRM_Admin_Page_Extensions extends CRM_Core_Page_Basic { * @return string * @access public */ - function userContextParams($mode = NULL) { + public function userContextParams($mode = NULL) { return 'reset=1&action=browse'; } diff --git a/CRM/Admin/Page/ExtensionsUpgrade.php b/CRM/Admin/Page/ExtensionsUpgrade.php index 3c99d8a02d..bb0931388a 100644 --- a/CRM/Admin/Page/ExtensionsUpgrade.php +++ b/CRM/Admin/Page/ExtensionsUpgrade.php @@ -10,7 +10,7 @@ class CRM_Admin_Page_ExtensionsUpgrade extends CRM_Core_Page { const END_URL = 'civicrm/admin/extensions'; const END_PARAMS = 'reset=1'; - function run() { + public function run() { $queue = CRM_Extension_Upgrades::createQueue(); $runner = new CRM_Queue_Runner(array( 'title' => ts('Database Upgrades'), @@ -27,7 +27,7 @@ class CRM_Admin_Page_ExtensionsUpgrade extends CRM_Core_Page { /** * Handle the final step of the queue */ - static function onEnd(CRM_Queue_TaskContext $ctx) { + public static function onEnd(CRM_Queue_TaskContext $ctx) { CRM_Core_Error::debug_log_message('CRM_Admin_Page_ExtensionsUpgrade: Finish upgrades'); } } diff --git a/CRM/Admin/Page/Job.php b/CRM/Admin/Page/Job.php index 1658c67c5f..12ff3e5eb5 100644 --- a/CRM/Admin/Page/Job.php +++ b/CRM/Admin/Page/Job.php @@ -51,7 +51,7 @@ class CRM_Admin_Page_Job extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Core_BAO_Job'; } @@ -60,7 +60,7 @@ class CRM_Admin_Page_Job extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::FOLLOWUP => array( @@ -113,7 +113,7 @@ class CRM_Admin_Page_Job extends CRM_Core_Page_Basic { * @access public * */ - function run() { + public function run() { // set title and breadcrumb CRM_Utils_System::setTitle(ts('Settings - Scheduled Jobs')); $breadCrumb = array(array('title' => ts('Scheduled Jobs'), @@ -148,7 +148,7 @@ class CRM_Admin_Page_Job extends CRM_Core_Page_Basic { * @access public * @static */ - function browse($action = NULL) { + public function browse($action = NULL) { // using Export action for Execute. Doh. if ($this->_action & CRM_Core_Action::EXPORT) { @@ -194,7 +194,7 @@ class CRM_Admin_Page_Job extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Admin_Form_Job'; } @@ -203,7 +203,7 @@ class CRM_Admin_Page_Job extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'Scheduled Jobs'; } @@ -214,7 +214,7 @@ class CRM_Admin_Page_Job extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/job'; } } diff --git a/CRM/Admin/Page/JobLog.php b/CRM/Admin/Page/JobLog.php index 0b3caed900..dfe7e1e592 100644 --- a/CRM/Admin/Page/JobLog.php +++ b/CRM/Admin/Page/JobLog.php @@ -51,7 +51,7 @@ class CRM_Admin_Page_JobLog extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Core_BAO_Job'; } @@ -60,7 +60,7 @@ class CRM_Admin_Page_JobLog extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { return self::$_links; } @@ -75,7 +75,7 @@ class CRM_Admin_Page_JobLog extends CRM_Core_Page_Basic { * @access public * */ - function run() { + public function run() { // set title and breadcrumb CRM_Utils_System::setTitle(ts('Settings - Scheduled Jobs Log')); $breadCrumb = array(array('title' => ts('Administration'), @@ -96,7 +96,7 @@ class CRM_Admin_Page_JobLog extends CRM_Core_Page_Basic { * @access public * @static */ - function browse($action = NULL) { + public function browse($action = NULL) { $jid = CRM_Utils_Request::retrieve('jid', 'Positive', $this); @@ -138,7 +138,7 @@ class CRM_Admin_Page_JobLog extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Admin_Form_Job'; } @@ -147,7 +147,7 @@ class CRM_Admin_Page_JobLog extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'Scheduled Jobs'; } @@ -158,7 +158,7 @@ class CRM_Admin_Page_JobLog extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/job'; } } diff --git a/CRM/Admin/Page/LabelFormats.php b/CRM/Admin/Page/LabelFormats.php index 5541079eb0..aef5e87d73 100644 --- a/CRM/Admin/Page/LabelFormats.php +++ b/CRM/Admin/Page/LabelFormats.php @@ -54,7 +54,7 @@ class CRM_Admin_Page_LabelFormats extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Core_BAO_LabelFormat'; } @@ -63,7 +63,7 @@ class CRM_Admin_Page_LabelFormats extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { // helper variable for nicer formatting self::$_links = array( @@ -96,7 +96,7 @@ class CRM_Admin_Page_LabelFormats extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Admin_Form_LabelFormats'; } @@ -105,7 +105,7 @@ class CRM_Admin_Page_LabelFormats extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'Mailing Label Formats'; } @@ -116,7 +116,7 @@ class CRM_Admin_Page_LabelFormats extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/labelFormats'; } @@ -129,7 +129,7 @@ class CRM_Admin_Page_LabelFormats extends CRM_Core_Page_Basic { * @access public * @static */ - function browse($action = NULL) { + public function browse($action = NULL) { // Get list of configured Label Formats $labelFormatList= CRM_Core_BAO_LabelFormat::getList(); $nameFormatList= CRM_Core_BAO_LabelFormat::getList(false, 'name_badge'); diff --git a/CRM/Admin/Page/LocationType.php b/CRM/Admin/Page/LocationType.php index dd07ebd100..ce7c3f6de2 100644 --- a/CRM/Admin/Page/LocationType.php +++ b/CRM/Admin/Page/LocationType.php @@ -53,7 +53,7 @@ class CRM_Admin_Page_LocationType extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Core_BAO_LocationType'; } @@ -62,7 +62,7 @@ class CRM_Admin_Page_LocationType extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::UPDATE => array( @@ -97,7 +97,7 @@ class CRM_Admin_Page_LocationType extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Admin_Form_LocationType'; } @@ -106,7 +106,7 @@ class CRM_Admin_Page_LocationType extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'Location Types'; } @@ -117,7 +117,7 @@ class CRM_Admin_Page_LocationType extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/locationType'; } } diff --git a/CRM/Admin/Page/MailSettings.php b/CRM/Admin/Page/MailSettings.php index cea84d2626..bdc52e51bc 100644 --- a/CRM/Admin/Page/MailSettings.php +++ b/CRM/Admin/Page/MailSettings.php @@ -53,7 +53,7 @@ class CRM_Admin_Page_MailSettings extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Core_BAO_MailSettings'; } @@ -62,7 +62,7 @@ class CRM_Admin_Page_MailSettings extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { // helper variable for nicer formatting self::$_links = array( @@ -91,7 +91,7 @@ class CRM_Admin_Page_MailSettings extends CRM_Core_Page_Basic { * @access public * @static */ - function browse() { + public function browse() { //get all mail settings. $allMailSettings = array(); $mailSetting = new CRM_Core_DAO_MailSettings(); @@ -135,7 +135,7 @@ class CRM_Admin_Page_MailSettings extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Admin_Form_MailSettings'; } @@ -144,7 +144,7 @@ class CRM_Admin_Page_MailSettings extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'Mail Settings'; } @@ -155,7 +155,7 @@ class CRM_Admin_Page_MailSettings extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/mailSettings'; } } diff --git a/CRM/Admin/Page/Mapping.php b/CRM/Admin/Page/Mapping.php index d49c51ad18..79cf5fd303 100644 --- a/CRM/Admin/Page/Mapping.php +++ b/CRM/Admin/Page/Mapping.php @@ -53,7 +53,7 @@ class CRM_Admin_Page_Mapping extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Core_BAO_Mapping'; } @@ -62,7 +62,7 @@ class CRM_Admin_Page_Mapping extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { // helper variable for nicer formatting $deleteExtra = ts('Are you sure you want to delete this mapping?') . ' ' . ts('This operation cannot be undone.'); @@ -89,7 +89,7 @@ class CRM_Admin_Page_Mapping extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Admin_Form_Mapping'; } @@ -98,7 +98,7 @@ class CRM_Admin_Page_Mapping extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'Mapping'; } @@ -107,7 +107,7 @@ class CRM_Admin_Page_Mapping extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function deleteName() { + public function deleteName() { return 'Mapping'; } @@ -118,7 +118,7 @@ class CRM_Admin_Page_Mapping extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/mapping'; } @@ -127,7 +127,7 @@ class CRM_Admin_Page_Mapping extends CRM_Core_Page_Basic { * * @return string Classname of delete form. */ - function deleteForm() { + public function deleteForm() { return 'CRM_Admin_Form_Mapping'; } @@ -136,7 +136,7 @@ class CRM_Admin_Page_Mapping extends CRM_Core_Page_Basic { * * @return void */ - function run() { + public function run() { $sort = 'mapping_type asc'; return parent::run($sort); } diff --git a/CRM/Admin/Page/MessageTemplates.php b/CRM/Admin/Page/MessageTemplates.php index e836469b0e..5e3a0c8c79 100644 --- a/CRM/Admin/Page/MessageTemplates.php +++ b/CRM/Admin/Page/MessageTemplates.php @@ -56,7 +56,7 @@ class CRM_Admin_Page_MessageTemplates extends CRM_Core_Page_Basic { * @param null $title * @param null $mode */ - function __construct($title = NULL, $mode = NULL) { + public function __construct($title = NULL, $mode = NULL) { parent::__construct($title, $mode); // fetch the ids of templates which diverted from defaults and can be reverted – @@ -83,7 +83,7 @@ class CRM_Admin_Page_MessageTemplates extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Core_BAO_MessageTemplate'; } @@ -92,7 +92,7 @@ class CRM_Admin_Page_MessageTemplates extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { $confirm = ts('Are you sure you want to revert this template to the default for this workflow? You will lose any customizations you have made.', array('escape' => 'js')) . '\n\n' . ts('We recommend that you save a copy of the your customized Text and HTML message content to a text file before reverting so you can combine your changes with the system default messages as needed.', array('escape' => 'js')); self::$_links = array( @@ -144,7 +144,7 @@ class CRM_Admin_Page_MessageTemplates extends CRM_Core_Page_Basic { * @param string $permission * @param bool $forceAction */ - function action(&$object, $action, &$values, &$links, $permission, $forceAction = FALSE) { + public function action(&$object, $action, &$values, &$links, $permission, $forceAction = FALSE) { if ($object->workflow_id) { // do not expose action link for reverting to default if the template did not diverge or we just reverted it now if (!in_array($object->id, array_keys($this->_revertible)) or @@ -187,7 +187,7 @@ class CRM_Admin_Page_MessageTemplates extends CRM_Core_Page_Basic { * * @throws Exception */ - function run($args = NULL, $pageArgs = NULL, $sort = NULL) { + public function run($args = NULL, $pageArgs = NULL, $sort = NULL) { // handle the revert action and offload the rest to parent if (CRM_Utils_Request::retrieve('action', 'String', $this) & CRM_Core_Action::REVERT) { @@ -211,7 +211,7 @@ class CRM_Admin_Page_MessageTemplates extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Admin_Form_MessageTemplates'; } @@ -220,7 +220,7 @@ class CRM_Admin_Page_MessageTemplates extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return ts('Message Template'); } @@ -231,7 +231,7 @@ class CRM_Admin_Page_MessageTemplates extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/messageTemplates'; } @@ -241,7 +241,7 @@ class CRM_Admin_Page_MessageTemplates extends CRM_Core_Page_Basic { * @return void * @access public */ - function browse() { + public function browse() { $action = func_num_args() ? func_get_arg(0) : NULL; if ($this->_action & CRM_Core_Action::ADD) { return; diff --git a/CRM/Admin/Page/Navigation.php b/CRM/Admin/Page/Navigation.php index 870f09a1f7..b51cdc4bb1 100644 --- a/CRM/Admin/Page/Navigation.php +++ b/CRM/Admin/Page/Navigation.php @@ -51,7 +51,7 @@ class CRM_Admin_Page_Navigation extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Core_BAO_Navigation'; } @@ -60,14 +60,14 @@ class CRM_Admin_Page_Navigation extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() {} + public function &links() {} /** * Get name of edit form * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Admin_Form_Navigation'; } @@ -76,7 +76,7 @@ class CRM_Admin_Page_Navigation extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'CiviCRM Navigation'; } @@ -87,14 +87,14 @@ class CRM_Admin_Page_Navigation extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/menu'; } /** * Browse all menus */ - function browse() { + public function browse() { // assign home id to the template $homeMenuId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Navigation', 'Home', 'id', 'name'); $this->assign('homeMenuId', $homeMenuId); diff --git a/CRM/Admin/Page/Options.php b/CRM/Admin/Page/Options.php index 97dfa209c9..b98428e295 100644 --- a/CRM/Admin/Page/Options.php +++ b/CRM/Admin/Page/Options.php @@ -88,7 +88,7 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic { * @access public * */ - function preProcess() { + public function preProcess() { if (!self::$_gName && !empty($this->urlPath[3])) { self::$_gName = $this->urlPath[3]; } @@ -168,7 +168,7 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return self::$_gName ? 'CRM_Core_BAO_OptionValue' : 'CRM_Core_BAO_OptionGroup'; } @@ -177,7 +177,7 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::UPDATE => array( @@ -223,7 +223,7 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic { * * @return void */ - function run() { + public function run() { $this->preProcess(); return parent::run(); } @@ -236,7 +236,7 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic { * @access public * @static */ - function browse() { + public function browse() { if (!self::$_gName) { return parent::browse(); } @@ -265,7 +265,7 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return self::$_gName ? 'CRM_Admin_Form_Options' : 'CRM_Admin_Form_OptionGroup'; } @@ -274,7 +274,7 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return self::$_gLabel; } @@ -285,7 +285,7 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/options' . (self::$_gName ? '/' . self::$_gName : ''); } } diff --git a/CRM/Admin/Page/ParticipantStatus.php b/CRM/Admin/Page/ParticipantStatus.php index 5775f6cd72..42d5411d7f 100644 --- a/CRM/Admin/Page/ParticipantStatus.php +++ b/CRM/Admin/Page/ParticipantStatus.php @@ -39,14 +39,14 @@ class CRM_Admin_Page_ParticipantStatus extends CRM_Core_Page_Basic { /** * @return string */ - function getBAOName() { + public function getBAOName() { return 'CRM_Event_BAO_ParticipantStatusType'; } /** * @return array */ - function &links() { + public function &links() { static $links = NULL; if ($links === NULL) { $links = array( @@ -77,7 +77,7 @@ class CRM_Admin_Page_ParticipantStatus extends CRM_Core_Page_Basic { return $links; } - function browse() { + public function browse() { $statusTypes = array(); $dao = new CRM_Event_DAO_ParticipantStatusType; @@ -117,14 +117,14 @@ class CRM_Admin_Page_ParticipantStatus extends CRM_Core_Page_Basic { /** * @return string */ - function editForm() { + public function editForm() { return 'CRM_Admin_Form_ParticipantStatus'; } /** * @return string */ - function editName() { + public function editName() { return 'Participant Status'; } @@ -133,7 +133,7 @@ class CRM_Admin_Page_ParticipantStatus extends CRM_Core_Page_Basic { * * @return string */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/participant_status'; } } diff --git a/CRM/Admin/Page/PaymentProcessor.php b/CRM/Admin/Page/PaymentProcessor.php index b41040767d..53099e1074 100644 --- a/CRM/Admin/Page/PaymentProcessor.php +++ b/CRM/Admin/Page/PaymentProcessor.php @@ -51,7 +51,7 @@ class CRM_Admin_Page_PaymentProcessor extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Financial_BAO_PaymentProcessor'; } @@ -60,7 +60,7 @@ class CRM_Admin_Page_PaymentProcessor extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::UPDATE => array( @@ -101,7 +101,7 @@ class CRM_Admin_Page_PaymentProcessor extends CRM_Core_Page_Basic { * @access public * */ - function run() { + public function run() { // set title and breadcrumb CRM_Utils_System::setTitle(ts('Settings - Payment Processor')); //CRM-15546 @@ -125,7 +125,7 @@ class CRM_Admin_Page_PaymentProcessor extends CRM_Core_Page_Basic { * @access public * @static */ - function browse($action = NULL) { + public function browse($action = NULL) { // get all custom groups sorted by weight $paymentProcessor = array(); $dao = new CRM_Financial_DAO_PaymentProcessor(); @@ -170,7 +170,7 @@ class CRM_Admin_Page_PaymentProcessor extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Admin_Form_PaymentProcessor'; } @@ -179,7 +179,7 @@ class CRM_Admin_Page_PaymentProcessor extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'Payment Processors'; } @@ -190,7 +190,7 @@ class CRM_Admin_Page_PaymentProcessor extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/paymentProcessor'; } } diff --git a/CRM/Admin/Page/PaymentProcessorType.php b/CRM/Admin/Page/PaymentProcessorType.php index 7bb6332295..6bb5b9c657 100644 --- a/CRM/Admin/Page/PaymentProcessorType.php +++ b/CRM/Admin/Page/PaymentProcessorType.php @@ -51,7 +51,7 @@ class CRM_Admin_Page_PaymentProcessorType extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Financial_BAO_PaymentProcessorType'; } @@ -60,7 +60,7 @@ class CRM_Admin_Page_PaymentProcessorType extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::UPDATE => array( @@ -95,7 +95,7 @@ class CRM_Admin_Page_PaymentProcessorType extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Admin_Form_PaymentProcessorType'; } @@ -104,7 +104,7 @@ class CRM_Admin_Page_PaymentProcessorType extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'Payment Processor Type'; } @@ -115,7 +115,7 @@ class CRM_Admin_Page_PaymentProcessorType extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/paymentProcessorType'; } } diff --git a/CRM/Admin/Page/PdfFormats.php b/CRM/Admin/Page/PdfFormats.php index 8aab4e3676..29ca18abec 100644 --- a/CRM/Admin/Page/PdfFormats.php +++ b/CRM/Admin/Page/PdfFormats.php @@ -54,7 +54,7 @@ class CRM_Admin_Page_PdfFormats extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Core_BAO_PdfFormat'; } @@ -63,7 +63,7 @@ class CRM_Admin_Page_PdfFormats extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { // helper variable for nicer formatting self::$_links = array( @@ -90,7 +90,7 @@ class CRM_Admin_Page_PdfFormats extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Admin_Form_PdfFormats'; } @@ -99,7 +99,7 @@ class CRM_Admin_Page_PdfFormats extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'PDF Page Formats'; } @@ -110,7 +110,7 @@ class CRM_Admin_Page_PdfFormats extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/pdfFormats'; } @@ -123,7 +123,7 @@ class CRM_Admin_Page_PdfFormats extends CRM_Core_Page_Basic { * @access public * @static */ - function browse($action = NULL) { + public function browse($action = NULL) { // Get list of configured PDF Page Formats $pdfFormatList = CRM_Core_BAO_PdfFormat::getList(); diff --git a/CRM/Admin/Page/Persistent.php b/CRM/Admin/Page/Persistent.php index 2cc3da5586..8e47390f5b 100644 --- a/CRM/Admin/Page/Persistent.php +++ b/CRM/Admin/Page/Persistent.php @@ -70,7 +70,7 @@ class CRM_Admin_Page_Persistent extends CRM_Core_Page { /** * @return array */ - function &customizeActionLinks() { + public function &customizeActionLinks() { // check if variable _actionsLinks is populated if (!isset(self::$_customizeActionLinks)) { @@ -91,7 +91,7 @@ class CRM_Admin_Page_Persistent extends CRM_Core_Page { * * @return void */ - function run() { + public function run() { CRM_Utils_System::setTitle(ts('DB Template Strings')); $this->browse(); return parent::run(); @@ -105,7 +105,7 @@ class CRM_Admin_Page_Persistent extends CRM_Core_Page { * @access public * @static */ - function browse() { + public function browse() { $permission = FALSE; $this->assign('editClass', FALSE); if (CRM_Core_Permission::check('access CiviCRM')) { diff --git a/CRM/Admin/Page/PreferencesDate.php b/CRM/Admin/Page/PreferencesDate.php index 3783ce6961..29e0fba2f7 100644 --- a/CRM/Admin/Page/PreferencesDate.php +++ b/CRM/Admin/Page/PreferencesDate.php @@ -51,7 +51,7 @@ class CRM_Admin_Page_PreferencesDate extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Core_BAO_PreferencesDate'; } @@ -60,7 +60,7 @@ class CRM_Admin_Page_PreferencesDate extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::UPDATE => array( @@ -85,7 +85,7 @@ class CRM_Admin_Page_PreferencesDate extends CRM_Core_Page_Basic { * @access public * */ - function run() { + public function run() { // set title and breadcrumb CRM_Utils_System::setTitle(ts('Settings - Date Preferences')); return parent::run(); @@ -96,7 +96,7 @@ class CRM_Admin_Page_PreferencesDate extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Admin_Form_PreferencesDate'; } @@ -105,7 +105,7 @@ class CRM_Admin_Page_PreferencesDate extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'Date Preferences'; } @@ -116,7 +116,7 @@ class CRM_Admin_Page_PreferencesDate extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/setting/preferences/date'; } } diff --git a/CRM/Admin/Page/RelationshipType.php b/CRM/Admin/Page/RelationshipType.php index 59ebf44f86..4682ed3fdb 100644 --- a/CRM/Admin/Page/RelationshipType.php +++ b/CRM/Admin/Page/RelationshipType.php @@ -53,7 +53,7 @@ class CRM_Admin_Page_RelationshipType extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Contact_BAO_RelationshipType'; } @@ -62,7 +62,7 @@ class CRM_Admin_Page_RelationshipType extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::VIEW => array( @@ -103,7 +103,7 @@ class CRM_Admin_Page_RelationshipType extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Admin_Form_RelationshipType'; } @@ -112,7 +112,7 @@ class CRM_Admin_Page_RelationshipType extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'Relationship Types'; } @@ -123,7 +123,7 @@ class CRM_Admin_Page_RelationshipType extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/reltype'; } } diff --git a/CRM/Admin/Page/ScheduleReminders.php b/CRM/Admin/Page/ScheduleReminders.php index a5ec361732..7e83d45bac 100644 --- a/CRM/Admin/Page/ScheduleReminders.php +++ b/CRM/Admin/Page/ScheduleReminders.php @@ -54,7 +54,7 @@ class CRM_Admin_Page_ScheduleReminders extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Core_BAO_ActionSchedule'; } @@ -100,7 +100,7 @@ class CRM_Admin_Page_ScheduleReminders extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Admin_Form_ScheduleReminders'; } @@ -109,7 +109,7 @@ class CRM_Admin_Page_ScheduleReminders extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'ScheduleReminders'; } @@ -120,7 +120,7 @@ class CRM_Admin_Page_ScheduleReminders extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/scheduleReminders'; } @@ -133,7 +133,7 @@ class CRM_Admin_Page_ScheduleReminders extends CRM_Core_Page_Basic { * @access public * @static */ - function browse($action = NULL) { + public function browse($action = NULL) { // Get list of configured reminders $reminderList = CRM_Core_BAO_ActionSchedule::getList(); diff --git a/CRM/Admin/Page/Setting.php b/CRM/Admin/Page/Setting.php index 0b9746d963..68227ae7ff 100644 --- a/CRM/Admin/Page/Setting.php +++ b/CRM/Admin/Page/Setting.php @@ -41,7 +41,7 @@ class CRM_Admin_Page_Setting extends CRM_Core_Page { * @return string * @throws Exception */ - function run() { + public function run() { CRM_Core_Error::fatal('This page is deprecated. If you have followed a link or have been redirected here, please change link or redirect to Admin Console (/civicrm/admin?reset=1)'); CRM_Utils_System::setTitle(ts("Global Settings")); diff --git a/CRM/Admin/Page/Tag.php b/CRM/Admin/Page/Tag.php index 465deaf784..49699bb3a3 100644 --- a/CRM/Admin/Page/Tag.php +++ b/CRM/Admin/Page/Tag.php @@ -53,7 +53,7 @@ class CRM_Admin_Page_Tag extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Core_BAO_Tag'; } @@ -62,7 +62,7 @@ class CRM_Admin_Page_Tag extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::UPDATE => array( @@ -92,7 +92,7 @@ class CRM_Admin_Page_Tag extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Admin_Form_Tag'; } @@ -101,7 +101,7 @@ class CRM_Admin_Page_Tag extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'Tag'; } @@ -110,7 +110,7 @@ class CRM_Admin_Page_Tag extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function deleteName() { + public function deleteName() { return 'Tag'; } @@ -121,7 +121,7 @@ class CRM_Admin_Page_Tag extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/tag'; } @@ -130,7 +130,7 @@ class CRM_Admin_Page_Tag extends CRM_Core_Page_Basic { * * @return string Classname of delete form. */ - function deleteForm() { + public function deleteForm() { return 'CRM_Admin_Form_Tag'; } @@ -140,7 +140,7 @@ class CRM_Admin_Page_Tag extends CRM_Core_Page_Basic { * @param null $action * @param null $sort */ - function browse($action = NULL, $sort = NULL) { + public function browse($action = NULL, $sort = NULL) { $adminTagSet = FALSE; if (CRM_Core_Permission::check('administer Tagsets')) { $adminTagSet = TRUE; diff --git a/CRM/Badge/BAO/Badge.php b/CRM/Badge/BAO/Badge.php index 282fa67e11..8e4a45c306 100644 --- a/CRM/Badge/BAO/Badge.php +++ b/CRM/Badge/BAO/Badge.php @@ -81,7 +81,7 @@ class CRM_Badge_BAO_Badge { * * @return array $formattedRow row with meta data */ - static function formatLabel(&$row, &$layout) { + public static function formatLabel(&$row, &$layout) { $formattedRow = array('labelFormat' => $layout['label_format_name']); $formattedRow['labelTitle'] = $layout['title']; $formattedRow['labelId'] = $layout['id']; @@ -358,7 +358,7 @@ class CRM_Badge_BAO_Badge { * @return void * @access public */ - function printImage($img, $x = '', $y = '', $w = NULL, $h = NULL) { + public function printImage($img, $x = '', $y = '', $w = NULL, $h = NULL) { if (!$x) { $x = $this->pdf->GetAbsX(); } @@ -385,7 +385,7 @@ class CRM_Badge_BAO_Badge { * * @return array */ - static function getImageProperties($img, $imgRes = 300, $w = NULL, $h = NULL) { + public static function getImageProperties($img, $imgRes = 300, $w = NULL, $h = NULL) { $imgsize = getimagesize($img); $f = $imgRes / 25.4; $w = !empty($w) ? $w : $imgsize[0] / $f; diff --git a/CRM/Badge/BAO/Layout.php b/CRM/Badge/BAO/Layout.php index edcdcc5aad..86e710a415 100644 --- a/CRM/Badge/BAO/Layout.php +++ b/CRM/Badge/BAO/Layout.php @@ -37,7 +37,7 @@ class CRM_Badge_BAO_Layout extends CRM_Core_DAO_PrintLabel { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -53,7 +53,7 @@ class CRM_Badge_BAO_Layout extends CRM_Core_DAO_PrintLabel { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $printLabel = new CRM_Core_DAO_PrintLabel(); $printLabel->copyValues($params); if ($printLabel->find(TRUE)) { @@ -74,7 +74,7 @@ class CRM_Badge_BAO_Layout extends CRM_Core_DAO_PrintLabel { * @access public * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Core_DAO_PrintLabel', $id, 'is_active', $is_active); } @@ -88,7 +88,7 @@ class CRM_Badge_BAO_Layout extends CRM_Core_DAO_PrintLabel { * * @return object */ - static function create(&$params) { + public static function create(&$params) { $params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE); $params['is_default'] = CRM_Utils_Array::value('is_default', $params, FALSE); $params['is_reserved'] = CRM_Utils_Array::value('is_reserved', $params, FALSE); @@ -128,7 +128,7 @@ class CRM_Badge_BAO_Layout extends CRM_Core_DAO_PrintLabel { * @access public * @static */ - static function del($printLabelId) { + public static function del($printLabelId) { $printLabel = new CRM_Core_DAO_PrintLabel(); $printLabel->id = $printLabelId; $printLabel->delete(); @@ -141,7 +141,7 @@ class CRM_Badge_BAO_Layout extends CRM_Core_DAO_PrintLabel { * @access public * @static */ - static function getList() { + public static function getList() { $printLabel = new CRM_Core_DAO_PrintLabel(); $printLabel->find(); @@ -160,7 +160,7 @@ class CRM_Badge_BAO_Layout extends CRM_Core_DAO_PrintLabel { * @return array $formattedLayout array formatted array * @access public */ - static function buildLayout(&$params) { + public static function buildLayout(&$params) { $layoutParams = array('id' => $params['badge_id']); CRM_Badge_BAO_Layout::retrieve($layoutParams, $layoutInfo); diff --git a/CRM/Badge/Form/Layout.php b/CRM/Badge/Form/Layout.php index 66a2a2b096..88dcfcf084 100644 --- a/CRM/Badge/Form/Layout.php +++ b/CRM/Badge/Form/Layout.php @@ -163,7 +163,7 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { if (isset($this->_id)) { $defaults = array_merge($this->_values, CRM_Badge_BAO_Layout::getDecodedData($this->_values['data'])); diff --git a/CRM/Badge/Page/AJAX.php b/CRM/Badge/Page/AJAX.php index 02caadf999..030caa76a0 100644 --- a/CRM/Badge/Page/AJAX.php +++ b/CRM/Badge/Page/AJAX.php @@ -33,7 +33,7 @@ */ class CRM_Badge_Page_AJAX { - static function getImageProp() { + public static function getImageProp() { $img = $_GET['img']; list($w, $h) = CRM_Badge_BAO_Badge::getImageProperties($img); CRM_Utils_JSON::output(array('width' => $w, 'height' => $h)); diff --git a/CRM/Badge/Page/Layout.php b/CRM/Badge/Page/Layout.php index 04dde3eda6..803dde0ad9 100644 --- a/CRM/Badge/Page/Layout.php +++ b/CRM/Badge/Page/Layout.php @@ -51,7 +51,7 @@ class CRM_Badge_Page_Layout extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Badge_BAO_Layout'; } @@ -60,7 +60,7 @@ class CRM_Badge_Page_Layout extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::UPDATE => array( @@ -95,7 +95,7 @@ class CRM_Badge_Page_Layout extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Badge_Form_Layout'; } @@ -104,7 +104,7 @@ class CRM_Badge_Page_Layout extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'Badge Layout'; } @@ -115,7 +115,7 @@ class CRM_Badge_Page_Layout extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/badgelayout'; } } diff --git a/CRM/Batch/BAO/Batch.php b/CRM/Batch/BAO/Batch.php index d654dd0afe..a10a4c012e 100755 --- a/CRM/Batch/BAO/Batch.php +++ b/CRM/Batch/BAO/Batch.php @@ -59,7 +59,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { * @return object $batch batch object * @access public */ - static function create(&$params, $ids = NULL, $context = NULL) { + public static function create(&$params, $ids = NULL, $context = NULL) { if (empty($params['id'])) { $params['name'] = CRM_Utils_String::titleToVar($params['title']); } @@ -84,7 +84,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $batch = new CRM_Batch_DAO_Batch(); $batch->copyValues($params); if ($batch->find(TRUE)) { @@ -102,7 +102,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { * @return int $profileId profile id * @static */ - static function getProfileId($batchTypeId) { + public static function getProfileId($batchTypeId) { //retrieve the profile specific to batch type switch ($batchTypeId) { case 1: @@ -127,7 +127,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { * @return batch name * @static */ - static function generateBatchName() { + public static function generateBatchName() { $sql = "SELECT max(id) FROM civicrm_batch"; $batchNo = CRM_Core_DAO::singleValueQuery($sql) + 1; return ts('Batch %1', array(1 => $batchNo)) . ': ' . date('Y-m-d'); @@ -139,7 +139,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { * @return batch array * @access public */ - static function addBatchEntity(&$params) { + public static function addBatchEntity(&$params) { $entityBatch = new CRM_Batch_DAO_EntityBatch(); $entityBatch->copyValues($params); $entityBatch->save(); @@ -151,7 +151,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { * @param array $params associated array * @return CRM_Batch_DAO_EntityBatch */ - static function removeBatchEntity($params) { + public static function removeBatchEntity($params) { $entityBatch = new CRM_Batch_DAO_EntityBatch(); $entityBatch->copyValues($params); $entityBatch->delete(); @@ -166,7 +166,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { * @return void * @access public */ - static function deleteBatch($batchId) { + public static function deleteBatch($batchId) { // delete entry from batch table $batch = new CRM_Batch_DAO_Batch(); $batch->id = $batchId; @@ -248,7 +248,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { * @return array * @access public */ - static function getBatchList(&$params) { + public static function getBatchList(&$params) { $whereClause = self::whereClause($params); if (!empty($params['rowCount']) && is_numeric($params['rowCount']) @@ -419,7 +419,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { * @return array $links array of action links * @access public */ - function links($context = NULL) { + public function links($context = NULL) { if ($context == 'financialBatch') { $links = array( 'transaction' => array( @@ -497,7 +497,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { * @return array array of all batches * excluding batches with data entry in progress */ - static function getBatches() { + public static function getBatches() { $dataEntryStatusId = CRM_Core_OptionGroup::getValue('batch_status','Data Entry', 'name'); $query = "SELECT id, title FROM civicrm_batch @@ -522,7 +522,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { * @param array $batchIds * @return array */ - static function batchTotals($batchIds) { + public static function batchTotals($batchIds) { $totals = array_fill_keys($batchIds, array('item_count' => 0, 'total' => 0)); if ($batchIds) { $sql = "SELECT eb.batch_id, COUNT(tx.id) AS item_count, SUM(tx.total_amount) AS total @@ -546,7 +546,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { * @param $expected: user-entered total * @return array */ - static function displayTotals($actual, $expected) { + public static function displayTotals($actual, $expected) { $class = 'actual-value'; if ($expected && $expected != $actual) { $class .= ' crm-error'; @@ -572,7 +572,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { * @static * @access public */ - static function exportFinancialBatch($batchIds, $exportFormat) { + public static function exportFinancialBatch($batchIds, $exportFormat) { if (empty($batchIds)) { CRM_Core_Error::fatal(ts('No batches were selected.')); return; @@ -612,7 +612,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { * @param array $batchIds * @param $status */ - static function closeReOpen($batchIds = array(), $status) { + public static function closeReOpen($batchIds = array(), $status) { $batchStatus = CRM_Core_PseudoConstant::get('CRM_Batch_DAO_Batch', 'status_id'); $params['status_id'] = CRM_Utils_Array::key( $status, $batchStatus ); $session = CRM_Core_Session::singleton( ); @@ -637,7 +637,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { * * @return Object */ - static function getBatchFinancialItems($entityID, $returnValues, $notPresent = NULL, $params = NULL, $getCount = FALSE) { + public static function getBatchFinancialItems($entityID, $returnValues, $notPresent = NULL, $params = NULL, $getCount = FALSE) { if (!$getCount) { if (!empty($params['rowCount']) && $params['rowCount'] > 0 @@ -770,7 +770,7 @@ WHERE {$where} * * @return array array of batches */ - static function getBatchNames($batchIds) { + public static function getBatchNames($batchIds) { $query = 'SELECT id, title FROM civicrm_batch WHERE id IN ('. $batchIds . ')'; @@ -790,7 +790,7 @@ WHERE {$where} * * @return array array of batches */ - static function getBatchStatuses($batchIds) { + public static function getBatchStatuses($batchIds) { $query = 'SELECT id, status_id FROM civicrm_batch WHERE id IN ('.$batchIds.')'; diff --git a/CRM/Batch/Form/Batch.php b/CRM/Batch/Form/Batch.php index f9e8dc6070..2be27eda78 100755 --- a/CRM/Batch/Form/Batch.php +++ b/CRM/Batch/Form/Batch.php @@ -83,7 +83,7 @@ class CRM_Batch_Form_Batch extends CRM_Admin_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); if ($this->_action & CRM_Core_Action::ADD) { diff --git a/CRM/Batch/Form/Entry.php b/CRM/Batch/Form/Entry.php index 6826af9e23..c64a1dee55 100755 --- a/CRM/Batch/Form/Entry.php +++ b/CRM/Batch/Form/Entry.php @@ -91,7 +91,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { * @return void * @access public */ - function preProcess() { + public function preProcess() { $this->_batchId = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE); $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); @@ -121,7 +121,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { if (!$this->_profileId) { CRM_Core_Error::fatal(ts('Profile for bulk data entry is missing.')); } @@ -270,7 +270,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { * @static * @access public */ - static function formRule($params, $files, $self) { + public static function formRule($params, $files, $self) { $errors = array(); $batchTypes = CRM_Core_Pseudoconstant::get('CRM_Batch_DAO_Batch', 'type_id', array('flip' => 1), 'validate'); @@ -323,7 +323,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { /** * Override default cancel action */ - function cancelAction() { + public function cancelAction() { // redirect to batch listing CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/batch', 'reset=1')); CRM_Utils_System::civiExit(); @@ -336,7 +336,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { if (empty($this->_fields)) { return; } @@ -849,7 +849,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { * * @return bool */ - function testProcessMembership($params) { + public function testProcessMembership($params) { return $this->processMembership($params); } @@ -862,7 +862,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { * * @return bool */ - function testProcessContribution($params) { + public function testProcessContribution($params) { return $this->processContribution($params); } } diff --git a/CRM/Batch/Form/Search.php b/CRM/Batch/Form/Search.php index c899156036..1168ef4a77 100644 --- a/CRM/Batch/Form/Search.php +++ b/CRM/Batch/Form/Search.php @@ -36,7 +36,7 @@ class CRM_Batch_Form_Search extends CRM_Core_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $status = CRM_Utils_Request::retrieve('status', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, 1); diff --git a/CRM/Batch/Page/AJAX.php b/CRM/Batch/Page/AJAX.php index fb75594948..108d123d89 100644 --- a/CRM/Batch/Page/AJAX.php +++ b/CRM/Batch/Page/AJAX.php @@ -41,7 +41,7 @@ class CRM_Batch_Page_AJAX { /** * Save record */ - function batchSave() { + public function batchSave() { // save the entered information in 'data' column $batchId = CRM_Utils_Type::escape($_POST['batch_id'], 'Positive'); @@ -54,7 +54,7 @@ class CRM_Batch_Page_AJAX { /** * Retrieve records */ - static function getBatchList() { + public static function getBatchList() { $sortMapper = array( 0 => 'batch.title', 1 => 'batch.type_id', diff --git a/CRM/Batch/Page/Batch.php b/CRM/Batch/Page/Batch.php index b9e4f1593e..344cacd042 100644 --- a/CRM/Batch/Page/Batch.php +++ b/CRM/Batch/Page/Batch.php @@ -51,7 +51,7 @@ class CRM_Batch_Page_Batch extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Batch_BAO_Batch'; } @@ -60,14 +60,14 @@ class CRM_Batch_Page_Batch extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() {} + public function &links() {} /** * Get name of edit form * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Batch_Form_Batch'; } @@ -76,7 +76,7 @@ class CRM_Batch_Page_Batch extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return ts('Batch Processing'); } @@ -87,7 +87,7 @@ class CRM_Batch_Page_Batch extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return CRM_Utils_System::currentPath(); } @@ -97,13 +97,13 @@ class CRM_Batch_Page_Batch extends CRM_Core_Page_Basic { * @return void * @access public */ - function browse() { + public function browse() { $status = CRM_Utils_Request::retrieve('status', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, 1); $this->assign('status', $status); $this->search(); } - function search() { + public function search() { if ($this->_action & (CRM_Core_Action::ADD | CRM_Core_Action::UPDATE | diff --git a/CRM/Bridge/OG/CiviCRM.php b/CRM/Bridge/OG/CiviCRM.php index 6ac89babb9..c1b34b829d 100644 --- a/CRM/Bridge/OG/CiviCRM.php +++ b/CRM/Bridge/OG/CiviCRM.php @@ -39,7 +39,7 @@ class CRM_Bridge_OG_CiviCRM { * @param $group * @param $op */ - static function group($groupID, $group, $op) { + public static function group($groupID, $group, $op) { if ($op == 'add') { self::groupAdd($groupID, $group); } @@ -52,7 +52,7 @@ class CRM_Bridge_OG_CiviCRM { * @param int $groupID * @param $group */ - static function groupAdd($groupID, $group) { + public static function groupAdd($groupID, $group) { $ogID = CRM_Bridge_OG_Utils::ogID($groupID, FALSE); $node = new StdClass(); @@ -86,7 +86,7 @@ class CRM_Bridge_OG_CiviCRM { * @param int $groupID * @param $group */ - static function groupDelete($groupID, $group) { + public static function groupDelete($groupID, $group) { $ogID = CRM_Bridge_OG_Utils::ogID($groupID, FALSE); if (!$ogID) { return; @@ -100,7 +100,7 @@ class CRM_Bridge_OG_CiviCRM { * @param $contactIDs * @param $op */ - static function groupContact($groupID, $contactIDs, $op) { + public static function groupContact($groupID, $contactIDs, $op) { $config = CRM_Core_Config::singleton(); $ogID = CRM_Bridge_OG_Utils::ogID($groupID, FALSE); diff --git a/CRM/Bridge/OG/Drupal.php b/CRM/Bridge/OG/Drupal.php index acafcec529..86d384a082 100644 --- a/CRM/Bridge/OG/Drupal.php +++ b/CRM/Bridge/OG/Drupal.php @@ -40,7 +40,7 @@ class CRM_Bridge_OG_Drupal { * @param array $params * @param $op */ - static function nodeapi(&$params, $op) { + public static function nodeapi(&$params, $op) { $transaction = new CRM_Core_Transaction(); @@ -72,7 +72,7 @@ class CRM_Bridge_OG_Drupal { * @param $op * @param null $groupType */ - static function updateCiviGroup(&$params, $op, $groupType = NULL) { + public static function updateCiviGroup(&$params, $op, $groupType = NULL) { $abort = false; $params['version'] = 3; $params['id'] = CRM_Bridge_OG_Utils::groupID($params['source'], $params['title'], $abort); @@ -101,7 +101,7 @@ class CRM_Bridge_OG_Drupal { * @param array $aclParams * @param $op */ - static function updateCiviACLTables($aclParams, $op) { + public static function updateCiviACLTables($aclParams, $op) { if ($op == 'delete') { self::updateCiviACL($aclParams, $op); self::updateCiviACLEntityRole($aclParams, $op); @@ -118,7 +118,7 @@ class CRM_Bridge_OG_Drupal { * @param array $params * @param $op */ - static function updateCiviACLRole(&$params, $op) { + public static function updateCiviACLRole(&$params, $op) { $optionGroupID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'acl_role', @@ -165,7 +165,7 @@ SELECT v.id * @param array $params * @param $op */ - static function updateCiviACLEntityRole(&$params, $op) { + public static function updateCiviACLEntityRole(&$params, $op) { $dao = new CRM_ACL_DAO_EntityRole(); $dao->entity_table = 'civicrm_group'; @@ -187,7 +187,7 @@ SELECT v.id * @param array $params * @param $op */ - static function updateCiviACL(&$params, $op) { + public static function updateCiviACL(&$params, $op) { $dao = new CRM_ACL_DAO_ACL(); $dao->object_table = 'civicrm_saved_search'; @@ -215,7 +215,7 @@ SELECT v.id * * @throws Exception */ - static function og(&$params, $op) { + public static function og(&$params, $op) { $contactID = CRM_Bridge_OG_Utils::contactID($params['uf_id']); if (!$contactID) { diff --git a/CRM/Bridge/OG/Utils.php b/CRM/Bridge/OG/Utils.php index ec26d64daf..ad52db9369 100644 --- a/CRM/Bridge/OG/Utils.php +++ b/CRM/Bridge/OG/Utils.php @@ -38,7 +38,7 @@ class CRM_Bridge_OG_Utils { /** * @return int */ - static function aclEnabled() { + public static function aclEnabled() { return self::aclEnabled; } @@ -47,7 +47,7 @@ class CRM_Bridge_OG_Utils { * This was always false before, and is always true * now. Most likely, this needs to be a setting. */ - static function syncFromCiviCRM() { + public static function syncFromCiviCRM() { // make sure that acls are not enabled //RMT -- the following makes no f**king sense... //return ! self::aclEnabled & self::syncFromCiviCRM; @@ -59,7 +59,7 @@ class CRM_Bridge_OG_Utils { * * @return string */ - static function ogSyncName($ogID) { + public static function ogSyncName($ogID) { return "OG Sync Group :{$ogID}:"; } @@ -68,7 +68,7 @@ class CRM_Bridge_OG_Utils { * * @return string */ - static function ogSyncACLName($ogID) { + public static function ogSyncACLName($ogID) { return "OG Sync Group ACL :{$ogID}:"; } @@ -79,7 +79,7 @@ class CRM_Bridge_OG_Utils { * @return int|null|string * @throws Exception */ - static function ogID($groupID, $abort = TRUE) { + public static function ogID($groupID, $abort = TRUE) { $source = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $groupID, 'source' @@ -103,7 +103,7 @@ class CRM_Bridge_OG_Utils { * @return int * @throws Exception */ - static function contactID($ufID) { + public static function contactID($ufID) { $contactID = CRM_Core_BAO_UFMatch::getContactId($ufID); if ($contactID) { return $contactID; @@ -128,7 +128,7 @@ class CRM_Bridge_OG_Utils { * @return null|string * @throws Exception */ - static function groupID($source, $title = NULL, $abort = FALSE) { + public static function groupID($source, $title = NULL, $abort = FALSE) { $query = " SELECT id FROM civicrm_group diff --git a/CRM/Campaign/BAO/Campaign.php b/CRM/Campaign/BAO/Campaign.php index 797a4f39d3..d77edd7bdc 100644 --- a/CRM/Campaign/BAO/Campaign.php +++ b/CRM/Campaign/BAO/Campaign.php @@ -47,7 +47,7 @@ Class CRM_Campaign_BAO_Campaign extends CRM_Campaign_DAO_Campaign { * @access public * @static */ - static function create(&$params) { + public static function create(&$params) { if (empty($params)) { return; } @@ -312,7 +312,7 @@ Order By camp.title"; * * @static */ - static function getCampaignSummary($params = array(), $onlyCount = FALSE) { + public static function getCampaignSummary($params = array(), $onlyCount = FALSE) { $campaigns = array(); //build the limit and order clause. @@ -460,7 +460,7 @@ SELECT campaign.id as id, * * @static */ - static function getCampaignCount() { + public static function getCampaignCount() { return (int)CRM_Core_DAO::singleValueQuery('SELECT COUNT(*) FROM civicrm_campaign'); } @@ -472,7 +472,7 @@ SELECT campaign.id as id, * @return array * @static */ - static function getCampaignGroups($campaignId) { + public static function getCampaignGroups($campaignId) { static $campaignGroups; if (!$campaignId) { return array(); @@ -507,14 +507,14 @@ INNER JOIN civicrm_group grp ON ( grp.id = campgrp.entity_id ) * @return Object DAO object on sucess, null otherwise * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Campaign_DAO_Campaign', $id, 'is_active', $is_active); } /** * @return bool */ - static function accessCampaign() { + public static function accessCampaign() { static $allow = NULL; if (!isset($allow)) { diff --git a/CRM/Campaign/BAO/Petition.php b/CRM/Campaign/BAO/Petition.php index 736a6cf562..6d0c92d404 100644 --- a/CRM/Campaign/BAO/Petition.php +++ b/CRM/Campaign/BAO/Petition.php @@ -36,7 +36,7 @@ class CRM_Campaign_BAO_Petition extends CRM_Campaign_BAO_Survey { /** * */ - function __construct() { + public function __construct() { parent::__construct(); // expire cookie in one day $this->cookieExpire = (1 * 60 * 60 * 24); @@ -47,7 +47,7 @@ class CRM_Campaign_BAO_Petition extends CRM_Campaign_BAO_Survey { * * @static */ - static function getPetitionSummary($params = array(), $onlyCount = FALSE) { + public static function getPetitionSummary($params = array(), $onlyCount = FALSE) { //build the limit and order clause. $limitClause = $orderByClause = $lookupTableJoins = NULL; if (!$onlyCount) { @@ -157,7 +157,7 @@ SELECT petition.id as id, * * @static */ - static function getPetitionCount() { + public static function getPetitionCount() { $whereClause = 'WHERE ( 1 )'; $queryParams = array(); $petitionTypeID = CRM_Core_OptionGroup::getValue('activity_type', 'petition', 'name'); @@ -179,7 +179,7 @@ SELECT petition.id as id, * @access public * @static */ - function createSignature(&$params) { + public function createSignature(&$params) { if (empty($params)) { return; } @@ -235,7 +235,7 @@ SELECT petition.id as id, * * @return bool */ - function confirmSignature($activity_id, $contact_id, $petition_id) { + public function confirmSignature($activity_id, $contact_id, $petition_id) { // change activity status to completed (status_id = 2) // I wonder why do we need contact_id when we have activity_id anyway? [chastell] $sql = 'UPDATE civicrm_activity SET status_id = 2 WHERE id = %1'; @@ -286,7 +286,7 @@ AND tag_id = ( SELECT id FROM civicrm_tag WHERE name = %2 )"; * @return array * @static */ - static function getPetitionSignatureTotalbyCountry($surveyId) { + public static function getPetitionSignatureTotalbyCountry($surveyId) { $countries = array(); $sql = " SELECT count(civicrm_address.country_id) as total, @@ -329,7 +329,7 @@ AND tag_id = ( SELECT id FROM civicrm_tag WHERE name = %2 )"; * @return array * @static */ - static function getPetitionSignatureTotal($surveyId) { + public static function getPetitionSignatureTotal($surveyId) { $surveyInfo = CRM_Campaign_BAO_Petition::getSurveyInfo((int) $surveyId); //$activityTypeID = $surveyInfo['activity_type_id']; $sql = " @@ -391,7 +391,7 @@ AND tag_id = ( SELECT id FROM civicrm_tag WHERE name = %2 )"; * @return array * @static */ - static function getPetitionSignature($surveyId, $status_id = NULL) { + public static function getPetitionSignature($surveyId, $status_id = NULL) { // sql injection protection $surveyId = (int) $surveyId; @@ -468,7 +468,7 @@ AND tag_id = ( SELECT id FROM civicrm_tag WHERE name = %2 )"; * @return array $contactIds array of contact ids * @access public */ - function getEntitiesByTag($tag) { + public function getEntitiesByTag($tag) { $contactIds = array(); $entityTagDAO = new CRM_Core_DAO_EntityTag(); $entityTagDAO->tag_id = $tag['id']; @@ -489,7 +489,7 @@ AND tag_id = ( SELECT id FROM civicrm_tag WHERE name = %2 )"; * @return array * @static */ - static function checkSignature($surveyId, $contactId) { + public static function checkSignature($surveyId, $contactId) { $surveyInfo = CRM_Campaign_BAO_Petition::getSurveyInfo($surveyId); $signature = array(); diff --git a/CRM/Campaign/BAO/Query.php b/CRM/Campaign/BAO/Query.php index abc83060fa..0b2aba68a9 100755 --- a/CRM/Campaign/BAO/Query.php +++ b/CRM/Campaign/BAO/Query.php @@ -56,7 +56,7 @@ class CRM_Campaign_BAO_Query { * @return array self::$_campaignFields an associative array of campaign fields * @static */ - static function &getFields() { + public static function &getFields() { if (!isset(self::$_campaignFields)) { self::$_campaignFields = array(); } @@ -72,7 +72,7 @@ class CRM_Campaign_BAO_Query { * @return void * @access public */ - static function select(&$query) { + public static function select(&$query) { self::$_applySurveyClause = FALSE; if (is_array($query->_params)) { foreach ($query->_params as $values) { @@ -147,7 +147,7 @@ class CRM_Campaign_BAO_Query { /** * @param $query */ - static function where(&$query) { + public static function where(&$query) { //get survey clause in force, //only when we have survey id. if (!self::$_applySurveyClause) { @@ -168,7 +168,7 @@ class CRM_Campaign_BAO_Query { * @param $values * @param $query */ - static function whereClauseSingle(&$values, &$query) { + public static function whereClauseSingle(&$values, &$query) { //get survey clause in force, //only when we have survey id. if (!self::$_applySurveyClause) { @@ -221,7 +221,7 @@ class CRM_Campaign_BAO_Query { * * @return null|string */ - static function from($name, $mode, $side) { + public static function from($name, $mode, $side) { $from = NULL; //get survey clause in force, //only when we have survey id. @@ -308,18 +308,18 @@ civicrm_activity_assignment.record_type_id = $assigneeID ) "; /** * @param $tables */ - static function tableNames(&$tables) {} + public static function tableNames(&$tables) {} /** * @param $row * @param int $id */ - static function searchAction(&$row, $id) {} + public static function searchAction(&$row, $id) {} /** * @param $tables */ - static function info(&$tables) { + public static function info(&$tables) { //get survey clause in force, //only when we have survey id. if (!self::$_applySurveyClause) { @@ -344,7 +344,7 @@ civicrm_activity_assignment.record_type_id = $assigneeID ) "; * @return void * @static */ - static function buildSearchForm(&$form) { + public static function buildSearchForm(&$form) { $attributes = CRM_Core_DAO::getAttribute('CRM_Core_DAO_Address'); $className = CRM_Utils_System::getClassName($form); diff --git a/CRM/Campaign/BAO/Survey.php b/CRM/Campaign/BAO/Survey.php index 8201864eac..e58b2265f9 100644 --- a/CRM/Campaign/BAO/Survey.php +++ b/CRM/Campaign/BAO/Survey.php @@ -58,7 +58,7 @@ class CRM_Campaign_BAO_Survey extends CRM_Campaign_DAO_Survey { * * @return CRM_Campaign_DAO_Survey|null */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $dao = new CRM_Campaign_DAO_Survey(); $dao->copyValues($params); @@ -83,7 +83,7 @@ class CRM_Campaign_BAO_Survey extends CRM_Campaign_DAO_Survey { * @access public * @static */ - static function create(&$params) { + public static function create(&$params) { if (empty($params)) { return false; } @@ -121,7 +121,7 @@ class CRM_Campaign_BAO_Survey extends CRM_Campaign_DAO_Survey { * * @static */ - static function getSurveySummary($params = array(), $onlyCount = FALSE) { + public static function getSurveySummary($params = array(), $onlyCount = FALSE) { //build the limit and order clause. $limitClause = $orderByClause = $lookupTableJoins = NULL; if (!$onlyCount) { @@ -237,7 +237,7 @@ SELECT survey.id as id, * * @static */ - static function getSurveyCount() { + public static function getSurveyCount() { return (int)CRM_Core_DAO::singleValueQuery('SELECT COUNT(*) FROM civicrm_survey'); } @@ -251,7 +251,7 @@ SELECT survey.id as id, * * @static */ - static function getSurveys($onlyActive = TRUE, $onlyDefault = FALSE, $forceAll = FALSE, $includePetition = FALSE ) { + public static function getSurveys($onlyActive = TRUE, $onlyDefault = FALSE, $forceAll = FALSE, $includePetition = FALSE ) { $cacheKey = 0; $cacheKeyParams = array('onlyActive', 'onlyDefault', 'forceAll', 'includePetition'); foreach ($cacheKeyParams as $param) { @@ -341,7 +341,7 @@ SELECT survey.id as id, * @return array * @static */ - static function getSurveyCustomGroups($surveyTypes = array()) { + public static function getSurveyCustomGroups($surveyTypes = array()) { $customGroups = array(); if (!is_array($surveyTypes)) { $surveyTypes = array($surveyTypes); @@ -382,7 +382,7 @@ SELECT survey.id as id, * @return Object DAO object on sucess, null otherwise * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Campaign_DAO_Survey', $id, 'is_active', $is_active); } @@ -396,7 +396,7 @@ SELECT survey.id as id, * @static * */ - static function del($id) { + public static function del($id) { if (!$id) { return NULL; } @@ -418,7 +418,7 @@ SELECT survey.id as id, * @return array $voterDetails array of contact info. * @static */ - static function voterDetails($voterIds, $returnProperties = array()) { + public static function voterDetails($voterIds, $returnProperties = array()) { $voterDetails = array(); if (!is_array($voterIds) || empty($voterIds)) { return $voterDetails; @@ -672,7 +672,7 @@ INNER JOIN civicrm_contact contact_a ON ( activityTarget.contact_id = contact_a * @return array $$contactIds survey related contact ids. * @static */ - static function getSurveyVoterInfo($surveyId, $interviewerId = NULL, $statusIds = array( )) { + public static function getSurveyVoterInfo($surveyId, $interviewerId = NULL, $statusIds = array( )) { $voterIds = array(); if (!$surveyId) { return $voterIds; @@ -704,7 +704,7 @@ INNER JOIN civicrm_contact contact_a ON ( activityTarget.contact_id = contact_a * @param string $valueColumnName * @return array $resultSets an array of option groups.@static */ - static function getResultSets( $valueColumnName = 'title' ) { + public static function getResultSets( $valueColumnName = 'title' ) { $resultSets = array(); $valueColumnName = CRM_Utils_Type::escape($valueColumnName, 'String'); @@ -724,7 +724,7 @@ INNER JOIN civicrm_contact contact_a ON ( activityTarget.contact_id = contact_a * @return boolean $isSurveyActivity true/false * @static */ - static function isSurveyActivity($activityId) { + public static function isSurveyActivity($activityId) { $isSurveyActivity = FALSE; if (!$activityId) { return $isSurveyActivity; @@ -751,7 +751,7 @@ INNER JOIN civicrm_contact contact_a ON ( activityTarget.contact_id = contact_a * @param int $surveyId survey id. * @return array $responseOptions an array of option values@static */ - static function getResponsesOptions($surveyId) { + public static function getResponsesOptions($surveyId) { $responseOptions = array(); if (!$surveyId) { return $responseOptions; @@ -773,7 +773,7 @@ INNER JOIN civicrm_contact contact_a ON ( activityTarget.contact_id = contact_a * @param string $extraULName * @return array|string $url array of permissioned links@static */ - static function buildPermissionLinks($surveyId, $enclosedInUL = FALSE, $extraULName = 'more') { + public static function buildPermissionLinks($surveyId, $enclosedInUL = FALSE, $extraULName = 'more') { $menuLinks = array(); if (!$surveyId) { return $menuLinks; diff --git a/CRM/Campaign/Controller/Search.php b/CRM/Campaign/Controller/Search.php index 026f14949c..de7b0a5f31 100755 --- a/CRM/Campaign/Controller/Search.php +++ b/CRM/Campaign/Controller/Search.php @@ -49,7 +49,7 @@ class CRM_Campaign_Controller_Search extends CRM_Core_Controller { /** * Class constructor */ - function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { + public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { parent::__construct($title, $modal); diff --git a/CRM/Campaign/Form/Campaign.php b/CRM/Campaign/Form/Campaign.php index 0fcca12922..10041b7dde 100644 --- a/CRM/Campaign/Form/Campaign.php +++ b/CRM/Campaign/Form/Campaign.php @@ -138,7 +138,7 @@ class CRM_Campaign_Form_Campaign extends CRM_Core_Form { * * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = $this->_values; //load only custom data defaults. @@ -306,7 +306,7 @@ class CRM_Campaign_Form_Campaign extends CRM_Core_Form { * @access public * @see valid_date */ - static function formRule($fields, $files, $errors) { + public static function formRule($fields, $files, $errors) { $errors = array(); return empty($errors) ? TRUE : $errors; diff --git a/CRM/Campaign/Form/Gotv.php b/CRM/Campaign/Form/Gotv.php index 69fc74231f..9d7923d6fb 100755 --- a/CRM/Campaign/Form/Gotv.php +++ b/CRM/Campaign/Form/Gotv.php @@ -103,7 +103,7 @@ class CRM_Campaign_Form_Gotv extends CRM_Core_Form { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { if ($this->_search) { return; } @@ -150,7 +150,7 @@ class CRM_Campaign_Form_Gotv extends CRM_Core_Form { $this->validateIds(); } - function validateIds() { + public function validateIds() { $errorMessages = array(); //check for required permissions. if (!CRM_Core_Permission::check('manage campaign') && diff --git a/CRM/Campaign/Form/Petition.php b/CRM/Campaign/Form/Petition.php index 7602c3eb37..2243136b66 100644 --- a/CRM/Campaign/Form/Petition.php +++ b/CRM/Campaign/Form/Petition.php @@ -129,7 +129,7 @@ class CRM_Campaign_Form_Petition extends CRM_Core_Form { * @return array array of default values * @access public */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = $this->_values; $ufContactJoinParams = array( @@ -256,7 +256,7 @@ class CRM_Campaign_Form_Petition extends CRM_Core_Form { * Global validation rules for the form * */ - static function formRule($fields, $files, $form) { + public static function formRule($fields, $files, $form) { $errors = array(); // Petitions should be unique by: title, campaign ID (if assigned) and activity type ID // NOTE: This class is called for both Petition create / update AND for Survey Results tab, but this rule is only for Petition. diff --git a/CRM/Campaign/Form/Petition/Signature.php b/CRM/Campaign/Form/Petition/Signature.php index 24315d1c88..b09025f9fe 100644 --- a/CRM/Campaign/Form/Petition/Signature.php +++ b/CRM/Campaign/Form/Petition/Signature.php @@ -143,7 +143,7 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form { /** * */ - function __construct() { + public function __construct() { parent::__construct(); // this property used by civicrm_fb module and if true, forces thank you email to be sent // for users signing in via Facebook connect; also sets Fb email to check against @@ -154,7 +154,7 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form { /** * @return mixed */ - function getContactID() { + public function getContactID() { $tempID = CRM_Utils_Request::retrieve('cid', 'Positive', $this); // force to ignore the authenticated user @@ -245,7 +245,7 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $this->_defaults = array(); if ($this->_contactId) { CRM_Core_BAO_UFGroup::setProfileDefaults($this->_contactId, $this->_contactProfileFields, $this->_defaults, TRUE); @@ -334,7 +334,7 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form { * @see valid_date */ - static function formRule($fields, $files, $errors) { + public static function formRule($fields, $files, $errors) { $errors = array(); return empty($errors) ? TRUE : $errors; @@ -598,7 +598,7 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form { * @return void * @access public */ - function buildCustom($id, $name, $viewOnly = FALSE) { + public function buildCustom($id, $name, $viewOnly = FALSE) { if ($id) { $session = CRM_Core_Session::singleton(); $this->assign("petition", $this->petition); @@ -663,7 +663,7 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form { /** * @return string */ - function getTemplateFileName() { + public function getTemplateFileName() { if (isset($this->thankyou)) { return ('CRM/Campaign/Page/Petition/ThankYou.tpl'); } @@ -675,7 +675,7 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form { /** * @param array $params */ - function redirectIfSigned($params) { + public function redirectIfSigned($params) { $signature = $this->bao->checkSignature($this->_surveyId, $this->_contactId); //TODO: error case when more than one signature found for this petition and this contact if (!empty($signature) && (count($signature) == 1)) { diff --git a/CRM/Campaign/Form/Search.php b/CRM/Campaign/Form/Search.php index f29aa7de0e..32ee48b229 100755 --- a/CRM/Campaign/Form/Search.php +++ b/CRM/Campaign/Form/Search.php @@ -181,7 +181,7 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form_Search { CRM_Utils_System::setTitle(ts('Find Respondents To %1', array(1 => ucfirst($this->_operation)))); } - function setDefaultValues() { + public function setDefaultValues() { //load the default survey for all actions. if (empty($this->_defaults)) { $defaultSurveyId = key(CRM_Campaign_BAO_Survey::getSurveys(TRUE, TRUE)); @@ -200,7 +200,7 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form_Search { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { parent::buildQuickForm(); //build the search form. CRM_Campaign_BAO_Query::buildSearchForm($this); @@ -258,7 +258,7 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form_Search { * @return void * @access public */ - function postProcess() { + public function postProcess() { if ($this->_done) { return; } @@ -333,7 +333,7 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form_Search { $controller->run(); } - function formatParams() { + public function formatParams() { $interviewerId = CRM_Utils_Array::value('survey_interviewer_id', $this->_formValues); if ($interviewerId) { $this->set('interviewerId', $interviewerId); @@ -396,7 +396,7 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form_Search { $this->_formValues['campaign_search_voter_for'] = $this->_operation; } - function fixFormValues() { + public function fixFormValues() { // if this search has been forced // then see if there are any get values, and if so over-ride the post values // note that this means that GET over-rides POST :) @@ -446,7 +446,7 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form_Search { /** * @return array */ - function voterClause() { + public function voterClause() { $params = array('campaign_search_voter_for' => $this->_operation); $clauseFields = array( diff --git a/CRM/Campaign/Form/Search/Campaign.php b/CRM/Campaign/Form/Search/Campaign.php index 00c7caae06..fd6f4a89c5 100755 --- a/CRM/Campaign/Form/Search/Campaign.php +++ b/CRM/Campaign/Form/Search/Campaign.php @@ -76,7 +76,7 @@ class CRM_Campaign_Form_Search_Campaign extends CRM_Core_Form { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { if ($this->_search) { return; } diff --git a/CRM/Campaign/Form/Search/Petition.php b/CRM/Campaign/Form/Search/Petition.php index a1deed4f35..c9d9b7d05c 100755 --- a/CRM/Campaign/Form/Search/Petition.php +++ b/CRM/Campaign/Form/Search/Petition.php @@ -75,7 +75,7 @@ class CRM_Campaign_Form_Search_Petition extends CRM_Core_Form { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { if ($this->_search) { return; } diff --git a/CRM/Campaign/Form/Search/Survey.php b/CRM/Campaign/Form/Search/Survey.php index 0b96e97af8..d275ea23fe 100755 --- a/CRM/Campaign/Form/Search/Survey.php +++ b/CRM/Campaign/Form/Search/Survey.php @@ -76,7 +76,7 @@ class CRM_Campaign_Form_Search_Survey extends CRM_Core_Form { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { if ($this->_search) { return; } diff --git a/CRM/Campaign/Form/Survey.php b/CRM/Campaign/Form/Survey.php index 42f0dd3a23..9f3cedf41e 100644 --- a/CRM/Campaign/Form/Survey.php +++ b/CRM/Campaign/Form/Survey.php @@ -140,7 +140,7 @@ class CRM_Campaign_Form_Survey extends CRM_Core_Form { $session->replaceUserContext($url); } - function endPostProcess() { + public function endPostProcess() { // make submit buttons keep the current working tab opened. if ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD)) { $tabTitle = $className = CRM_Utils_String::getClassName($this->_name); @@ -174,7 +174,7 @@ class CRM_Campaign_Form_Survey extends CRM_Core_Form { /** * @return string */ - function getTemplateFileName() { + public function getTemplateFileName() { if ($this->controller->getPrint() || $this->getVar('_surveyId') <= 0 ) { return parent::getTemplateFileName(); } diff --git a/CRM/Campaign/Form/Survey/Main.php b/CRM/Campaign/Form/Survey/Main.php index c442901ba4..e33343f677 100644 --- a/CRM/Campaign/Form/Survey/Main.php +++ b/CRM/Campaign/Form/Survey/Main.php @@ -109,7 +109,7 @@ class CRM_Campaign_Form_Survey_Main extends CRM_Campaign_Form_Survey { * @return array array of default values * @access public */ - function setDefaultValues() { + public function setDefaultValues() { if ($this->_cdType) { return CRM_Custom_Form_CustomData::setDefaultValues($this); } diff --git a/CRM/Campaign/Form/Survey/Questions.php b/CRM/Campaign/Form/Survey/Questions.php index 8d46633e2a..0d4e6f7db5 100644 --- a/CRM/Campaign/Form/Survey/Questions.php +++ b/CRM/Campaign/Form/Survey/Questions.php @@ -48,7 +48,7 @@ class CRM_Campaign_Form_Survey_Questions extends CRM_Campaign_Form_Survey { * @return array array of default values * @access public */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $ufJoinParams = array( diff --git a/CRM/Campaign/Form/Survey/Results.php b/CRM/Campaign/Form/Survey/Results.php index 4e70bc3ae4..5489fc3532 100644 --- a/CRM/Campaign/Form/Survey/Results.php +++ b/CRM/Campaign/Form/Survey/Results.php @@ -82,7 +82,7 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey { * @return array array of default values * @access public */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = $this->_values; // set defaults for weight. @@ -211,7 +211,7 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey { * Global validation rules for the form * */ - static function formRule($fields, $files, $form) { + public static function formRule($fields, $files, $form) { $errors = array(); if (!empty($fields['option_label']) && !empty($fields['option_value']) && (count(array_filter($fields['option_label'])) == 0) && diff --git a/CRM/Campaign/Form/Survey/TabHeader.php b/CRM/Campaign/Form/Survey/TabHeader.php index d60549a08a..cf88c4c3a5 100644 --- a/CRM/Campaign/Form/Survey/TabHeader.php +++ b/CRM/Campaign/Form/Survey/TabHeader.php @@ -43,7 +43,7 @@ class CRM_Campaign_Form_Survey_TabHeader { * * @return array */ - static function build(&$form) { + public static function build(&$form) { $tabs = $form->get('tabHeader'); if (!$tabs || empty($_GET['reset'])) { $tabs = self::process($form); @@ -63,7 +63,7 @@ class CRM_Campaign_Form_Survey_TabHeader { * * @return array */ - static function process(&$form) { + public static function process(&$form) { if ($form->getVar('_surveyId') <= 0) { return NULL; } @@ -122,7 +122,7 @@ class CRM_Campaign_Form_Survey_TabHeader { /** * @param CRM_Core_Form $form */ - static function reset(&$form) { + public static function reset(&$form) { $tabs = self::process($form); $form->set('tabHeader', $tabs); } @@ -132,7 +132,7 @@ class CRM_Campaign_Form_Survey_TabHeader { * * @return int|string */ - static function getCurrentTab($tabs) { + public static function getCurrentTab($tabs) { static $current = FALSE; if ($current) { @@ -157,7 +157,7 @@ class CRM_Campaign_Form_Survey_TabHeader { * * @return int|string */ - static function getNextTab(&$form) { + public static function getNextTab(&$form) { static $next = FALSE; if ($next) return $next; diff --git a/CRM/Campaign/Form/SurveyType.php b/CRM/Campaign/Form/SurveyType.php index d083beeeb3..e566612221 100644 --- a/CRM/Campaign/Form/SurveyType.php +++ b/CRM/Campaign/Form/SurveyType.php @@ -104,7 +104,7 @@ class CRM_Campaign_Form_SurveyType extends CRM_Admin_Form { * @return array array of default values * @access public */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = parent::setDefaultValues(); if (!isset($defaults['weight']) || !$defaults['weight']) { diff --git a/CRM/Campaign/Form/Task.php b/CRM/Campaign/Form/Task.php index 7aead4ce2d..fe1e2a1c11 100755 --- a/CRM/Campaign/Form/Task.php +++ b/CRM/Campaign/Form/Task.php @@ -143,7 +143,7 @@ class CRM_Campaign_Form_Task extends CRM_Core_Form { * @return void * @access public */ - function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { + public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { $this->addButtons(array( array( 'type' => $nextType, diff --git a/CRM/Campaign/Form/Task/Interview.php b/CRM/Campaign/Form/Task/Interview.php index ba023254a2..32a5167916 100755 --- a/CRM/Campaign/Form/Task/Interview.php +++ b/CRM/Campaign/Form/Task/Interview.php @@ -75,7 +75,7 @@ class CRM_Campaign_Form_Task_Interview extends CRM_Campaign_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { $this->_votingTab = $this->get('votingTab'); $this->_reserveToInterview = $this->get('reserveToInterview'); if ($this->_reserveToInterview || $this->_votingTab) { @@ -257,7 +257,7 @@ WHERE {$clause} CRM_Utils_System::setTitle(ts('Record %1 Responses', array(1 => $activityTypes[$this->_surveyTypeId]))); } - function validateIds() { + public function validateIds() { $required = array('surveyId' => ts('Could not find Survey.'), 'interviewerId' => ts('Could not find Interviewer.'), 'contactIds' => ts('No respondents are currently reserved for you to interview.'), @@ -285,7 +285,7 @@ WHERE {$clause} * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $this->assign('surveyTypeId', $this->_surveyTypeId); $options = @@ -385,7 +385,7 @@ WHERE {$clause} * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { //load default data for only contact fields. $contactFields = $defaults = array(); foreach ($this->_surveyFields as $name => $field) { @@ -466,7 +466,7 @@ WHERE {$clause} * * @return mixed */ - static function registerInterview($params) { + public static function registerInterview($params) { $activityId = CRM_Utils_Array::value('activity_id', $params); $surveyTypeId = CRM_Utils_Array::value('activity_type_id', $params); if (!is_array($params) || !$surveyTypeId || !$activityId) { @@ -572,7 +572,7 @@ WHERE {$clause} return $activityId; } - function getVoterIds() { + public function getVoterIds() { if (!$this->_interviewerId) { $session = CRM_Core_Session::singleton(); $this->_interviewerId = $session->get('userID'); @@ -604,7 +604,7 @@ WHERE {$clause} } } - function filterVoterIds() { + public function filterVoterIds() { //do the cleanup later on. if (!is_array($this->_contactIds)) { return; diff --git a/CRM/Campaign/Form/Task/Print.php b/CRM/Campaign/Form/Task/Print.php index 360ed3b8c3..467fee5f9a 100755 --- a/CRM/Campaign/Form/Task/Print.php +++ b/CRM/Campaign/Form/Task/Print.php @@ -44,7 +44,7 @@ class CRM_Campaign_Form_Task_Print extends CRM_Campaign_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preprocess(); // set print view, so that print templates are called @@ -84,7 +84,7 @@ class CRM_Campaign_Form_Task_Print extends CRM_Campaign_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { // // just need to add a javacript to popup the window for printing // diff --git a/CRM/Campaign/Form/Task/Release.php b/CRM/Campaign/Form/Task/Release.php index d2a43b8b2a..368967c8e7 100644 --- a/CRM/Campaign/Form/Task/Release.php +++ b/CRM/Campaign/Form/Task/Release.php @@ -138,12 +138,12 @@ class CRM_Campaign_Form_Task_Release extends CRM_Campaign_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $this->addDefaultButtons(ts('Release Respondents'), 'done'); } - function postProcess() { + public function postProcess() { $deleteActivityIds = array(); foreach ($this->_contactIds as $cid) { if (array_key_exists($cid, $this->_surveyActivities)) { diff --git a/CRM/Campaign/Form/Task/Reserve.php b/CRM/Campaign/Form/Task/Reserve.php index 9cc880063f..4b3d9eebf0 100644 --- a/CRM/Campaign/Form/Task/Reserve.php +++ b/CRM/Campaign/Form/Task/Reserve.php @@ -73,7 +73,7 @@ class CRM_Campaign_Form_Task_Reserve extends CRM_Campaign_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); //get the survey id from user submitted values. @@ -126,7 +126,7 @@ class CRM_Campaign_Form_Task_Reserve extends CRM_Campaign_Form_Task { CRM_Utils_System::setTitle(ts('Reserve Respondents')); } - function validateSurvey() { + public function validateSurvey() { $errorMsg = NULL; $maxVoters = CRM_Utils_Array::value('max_number_of_contacts', $this->_surveyDetails); if ($maxVoters) { @@ -159,7 +159,7 @@ class CRM_Campaign_Form_Task_Reserve extends CRM_Campaign_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { // allow to add contact to either new or existing group. $this->addElement('text', 'ActivityType', ts('Activity Type')); $this->addElement('text', 'newGroupName', ts('Name for new group')); @@ -212,7 +212,7 @@ class CRM_Campaign_Form_Task_Reserve extends CRM_Campaign_Form_Task { * @static * @access public */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); $invalidGroupName = FALSE; if (!empty($fields['newGroupName'])) { diff --git a/CRM/Campaign/Form/Task/Result.php b/CRM/Campaign/Form/Task/Result.php index e42568c461..42e3fb8520 100755 --- a/CRM/Campaign/Form/Task/Result.php +++ b/CRM/Campaign/Form/Task/Result.php @@ -46,7 +46,7 @@ class CRM_Campaign_Form_Task_Result extends CRM_Campaign_Form_Task { * @return void * @access public */ - function preProcess() {} + public function preProcess() {} /** * Build the form object diff --git a/CRM/Campaign/Page/AJAX.php b/CRM/Campaign/Page/AJAX.php index b3d3189463..30d784d822 100644 --- a/CRM/Campaign/Page/AJAX.php +++ b/CRM/Campaign/Page/AJAX.php @@ -37,7 +37,7 @@ */ class CRM_Campaign_Page_AJAX { - static function registerInterview() { + public static function registerInterview() { $fields = array( 'result', 'voter_id', @@ -104,7 +104,7 @@ class CRM_Campaign_Page_AJAX { CRM_Utils_JSON::output($result); } - static function loadOptionGroupDetails() { + public static function loadOptionGroupDetails() { $id = CRM_Utils_Array::value('option_group_id', $_POST); $status = 'fail'; @@ -144,7 +144,7 @@ class CRM_Campaign_Page_AJAX { CRM_Utils_JSON::output($result); } - function voterList() { + public function voterList() { //get the search criteria params. $searchParams = explode(',', CRM_Utils_Array::value('searchCriteria', $_POST)); @@ -351,7 +351,7 @@ class CRM_Campaign_Page_AJAX { CRM_Utils_System::civiExit(); } - function processVoterData() { + public function processVoterData() { $status = NULL; $operation = CRM_Utils_Type::escape($_POST['operation'], 'String'); if ($operation == 'release') { @@ -479,7 +479,7 @@ class CRM_Campaign_Page_AJAX { CRM_Utils_JSON::output(array('status' => $status)); } - function allActiveCampaigns() { + public function allActiveCampaigns() { $currentCampaigns = CRM_Campaign_BAO_Campaign::getCampaigns(); $campaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, TRUE, FALSE, TRUE); $options = array( @@ -510,7 +510,7 @@ class CRM_Campaign_Page_AJAX { CRM_Utils_JSON::output($results); } - function campaignGroups() { + public function campaignGroups() { $surveyId = CRM_Utils_Request::retrieve('survey_id', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, NULL, 'POST' ); @@ -549,7 +549,7 @@ class CRM_Campaign_Page_AJAX { * Retrieve campaigns as for campaign dashboard. * **/ - function campaignList() { + public function campaignList() { //get the search criteria params. $searchParams = explode(',', CRM_Utils_Array::value('searchCriteria', $_POST)); @@ -645,7 +645,7 @@ class CRM_Campaign_Page_AJAX { * Retrieve survey for survey dashboard. * **/ - function surveyList() { + public function surveyList() { //get the search criteria params. $searchParams = explode(',', CRM_Utils_Array::value('searchCriteria', $_POST)); @@ -743,7 +743,7 @@ class CRM_Campaign_Page_AJAX { * Retrieve petitions for petition dashboard. * **/ - function petitionList() { + public function petitionList() { //get the search criteria params. $searchParams = explode(',', CRM_Utils_Array::value('searchCriteria', $_POST)); diff --git a/CRM/Campaign/Page/Campaign.php b/CRM/Campaign/Page/Campaign.php index e9281518a9..410e9682cf 100644 --- a/CRM/Campaign/Page/Campaign.php +++ b/CRM/Campaign/Page/Campaign.php @@ -53,7 +53,7 @@ class CRM_Campaign_Page_Campaign extends CRM_Core_Page { * @return array $_actionLinks * */ - function &actionLinks() { + public function &actionLinks() { // check if variable _actionsLinks is populated if (!isset(self::$_actionLinks)) { $deleteExtra = ts('Are you sure you want to delete this Campaign?'); @@ -85,7 +85,7 @@ class CRM_Campaign_Page_Campaign extends CRM_Core_Page { return self::$_actionLinks; } - function browse() { + public function browse() { $campaigns = CRM_Campaign_BAO_Campaign::getCampaignSummary(); @@ -127,7 +127,7 @@ class CRM_Campaign_Page_Campaign extends CRM_Core_Page { /** * @return string */ - function run() { + public function run() { if (!CRM_Core_Permission::check('administer CiviCampaign')) { CRM_Utils_System::permissionDenied(); } diff --git a/CRM/Campaign/Page/DashBoard.php b/CRM/Campaign/Page/DashBoard.php index 653a245f74..3e82595615 100644 --- a/CRM/Campaign/Page/DashBoard.php +++ b/CRM/Campaign/Page/DashBoard.php @@ -53,7 +53,7 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page { * @return array $_campaignActionLinks * */ - function &campaignActionLinks() { + public function &campaignActionLinks() { // check if variable _actionsLinks is populated if (!isset(self::$_campaignActionLinks)) { $deleteExtra = ts('Are you sure you want to delete this Campaign?'); @@ -89,7 +89,7 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page { /** * @return array */ - function &surveyActionLinks() { + public function &surveyActionLinks() { // check if variable _actionsLinks is populated if (!isset(self::$_surveyActionLinks)) { self::$_surveyActionLinks = array( @@ -124,7 +124,7 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page { /** * @return array */ - function &petitionActionLinks() { + public function &petitionActionLinks() { if (!isset(self::$_petitionActionLinks)) { self::$_petitionActionLinks = self::surveyActionLinks(); self::$_petitionActionLinks[CRM_Core_Action::UPDATE] = array( @@ -172,7 +172,7 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page { /** * @return mixed */ - function browseCampaign() { + public function browseCampaign() { // ensure valid javascript (these must have a value set) $this->assign('searchParams', json_encode(NULL)); $this->assign('campaignTypes', json_encode(NULL)); @@ -264,7 +264,7 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page { /** * @return mixed */ - function browseSurvey() { + public function browseSurvey() { // ensure valid javascript - this must have a value set $this->assign('searchParams', json_encode(NULL)); $this->assign('surveyTypes', json_encode(NULL)); @@ -293,7 +293,7 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page { * * @return array */ - function getSurveySummary($params = array()) { + public function getSurveySummary($params = array()) { $surveysData = array(); //get the survey. @@ -365,7 +365,7 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page { return $surveysData; } - function browsePetition() { + public function browsePetition() { // ensure valid javascript - this must have a value set $this->assign('searchParams', json_encode(NULL)); $this->assign('petitionCampaigns', json_encode(NULL)); @@ -393,7 +393,7 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page { * * @return array */ - function getPetitionSummary($params = array()) { + public function getPetitionSummary($params = array()) { $config = CRM_Core_Config::singleton(); $petitionsData = array(); @@ -443,7 +443,7 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page { return $petitionsData; } - function browse() { + public function browse() { $this->_tabs = array( 'campaign' => ts('Campaigns'), 'survey' => ts('Surveys'), @@ -473,7 +473,7 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page { /** * @return string */ - function run() { + public function run() { if (!CRM_Campaign_BAO_Campaign::accessCampaign()) { CRM_Utils_System::permissionDenied(); } @@ -483,7 +483,7 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page { return parent::run(); } - function buildTabs() { + public function buildTabs() { $allTabs = array(); foreach ($this->_tabs as $name => $title) { $allTabs[$name] = array( diff --git a/CRM/Campaign/Page/Petition.php b/CRM/Campaign/Page/Petition.php index 085843ed4d..09aada8d39 100644 --- a/CRM/Campaign/Page/Petition.php +++ b/CRM/Campaign/Page/Petition.php @@ -37,7 +37,7 @@ * Page for displaying Petition Signatures */ class CRM_Campaign_Page_Petition extends CRM_Core_Page { - function browse() { + public function browse() { //get the survey id $surveyId = CRM_Utils_Request::retrieve('sid', 'Positive', $this); @@ -50,7 +50,7 @@ class CRM_Campaign_Page_Petition extends CRM_Core_Page { /** * @return string */ - function run() { + public function run() { $action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 0 ); diff --git a/CRM/Campaign/Page/Petition/Confirm.php b/CRM/Campaign/Page/Petition/Confirm.php index b6b27e78b6..eb381d3afe 100644 --- a/CRM/Campaign/Page/Petition/Confirm.php +++ b/CRM/Campaign/Page/Petition/Confirm.php @@ -37,7 +37,7 @@ class CRM_Campaign_Page_Petition_Confirm extends CRM_Core_Page { * @return string * @throws Exception */ - function run() { + public function run() { CRM_Utils_System::addHTMLHead(''); $contact_id = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject); diff --git a/CRM/Campaign/Page/Petition/ThankYou.php b/CRM/Campaign/Page/Petition/ThankYou.php index c6bd11d9db..2908725cd7 100644 --- a/CRM/Campaign/Page/Petition/ThankYou.php +++ b/CRM/Campaign/Page/Petition/ThankYou.php @@ -36,7 +36,7 @@ class CRM_Campaign_Page_Petition_ThankYou extends CRM_Core_Page { /** * @return string */ - function run() { + public function run() { $id = CRM_Utils_Request::retrieve('id', 'Positive', $this); $petition_id = CRM_Utils_Request::retrieve('pid', 'Positive', $this); $params['id'] = $petition_id; diff --git a/CRM/Campaign/Page/Survey.php b/CRM/Campaign/Page/Survey.php index 0b6b23237d..f2962c4fcb 100644 --- a/CRM/Campaign/Page/Survey.php +++ b/CRM/Campaign/Page/Survey.php @@ -45,7 +45,7 @@ class CRM_Campaign_Page_Survey extends CRM_Core_Page { /** * @return array */ - function &actionLinks() { + public function &actionLinks() { // check if variable _actionsLinks is populated if (!isset(self::$_actionLinks)) { @@ -77,7 +77,7 @@ class CRM_Campaign_Page_Survey extends CRM_Core_Page { return self::$_actionLinks; } - function browse() { + public function browse() { $surveys = CRM_Campaign_BAO_Survey::getSurveySummary(); @@ -119,7 +119,7 @@ class CRM_Campaign_Page_Survey extends CRM_Core_Page { /** * @return string */ - function run() { + public function run() { if (!CRM_Campaign_BAO_Campaign::accessCampaign()) { CRM_Utils_System::permissionDenied(); } diff --git a/CRM/Campaign/Page/SurveyType.php b/CRM/Campaign/Page/SurveyType.php index 79350551d3..6a5299ae50 100644 --- a/CRM/Campaign/Page/SurveyType.php +++ b/CRM/Campaign/Page/SurveyType.php @@ -79,7 +79,7 @@ class CRM_Campaign_Page_SurveyType extends CRM_Core_Page_Basic { * @access public * */ - function preProcess() { + public function preProcess() { $this->_gName = 'activity_type'; $this->_gid = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $this->_gName, 'id', 'name'); @@ -99,7 +99,7 @@ class CRM_Campaign_Page_SurveyType extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Core_BAO_OptionValue'; } @@ -108,7 +108,7 @@ class CRM_Campaign_Page_SurveyType extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::UPDATE => array( @@ -143,7 +143,7 @@ class CRM_Campaign_Page_SurveyType extends CRM_Core_Page_Basic { * * @return void */ - function run() { + public function run() { $this->preProcess(); return parent::run(); } @@ -156,7 +156,7 @@ class CRM_Campaign_Page_SurveyType extends CRM_Core_Page_Basic { * @access public * @static */ - function browse() { + 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'); @@ -182,7 +182,7 @@ class CRM_Campaign_Page_SurveyType extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Campaign_Form_SurveyType'; } @@ -191,7 +191,7 @@ class CRM_Campaign_Page_SurveyType extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return $this->_GName; } @@ -202,7 +202,7 @@ class CRM_Campaign_Page_SurveyType extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/campaign/surveyType'; } @@ -214,7 +214,7 @@ class CRM_Campaign_Page_SurveyType extends CRM_Core_Page_Basic { * @return string * @access public */ - function userContextParams($mode = NULL) { + public function userContextParams($mode = NULL) { return 'reset=1'; } } diff --git a/CRM/Campaign/Page/Vote.php b/CRM/Campaign/Page/Vote.php index befa9d91b1..5c0a739836 100644 --- a/CRM/Campaign/Page/Vote.php +++ b/CRM/Campaign/Page/Vote.php @@ -43,7 +43,7 @@ class CRM_Campaign_Page_Vote extends CRM_Core_Page { /** * @return mixed */ - function reserve() { + public function reserve() { //build ajax voter search and selector. $controller = new CRM_Core_Controller_Simple('CRM_Campaign_Form_Gotv', ts('Reserve Respondents')); $controller->set('votingTab', TRUE); @@ -56,7 +56,7 @@ class CRM_Campaign_Page_Vote extends CRM_Core_Page { /** * @return mixed */ - function interview() { + public function interview() { //build interview and release voter interface. $controller = new CRM_Core_Controller_Simple('CRM_Campaign_Form_Task_Interview', ts('Interview Respondents')); $controller->set('votingTab', TRUE); @@ -71,7 +71,7 @@ class CRM_Campaign_Page_Vote extends CRM_Core_Page { return $controller->run(); } - function browse() { + public function browse() { $this->_tabs = array('reserve' => ts('Reserve Respondents'), 'interview' => ts('Interview Respondents'), ); @@ -102,13 +102,13 @@ class CRM_Campaign_Page_Vote extends CRM_Core_Page { /** * @return string */ - function run() { + public function run() { $this->browse(); return parent::run(); } - function buildTabs() { + public function buildTabs() { $allTabs = array(); foreach ($this->_tabs as $name => $title) { // check for required permissions. diff --git a/CRM/Campaign/Selector/Search.php b/CRM/Campaign/Selector/Search.php index 6b41cfecc5..4f66c6f134 100755 --- a/CRM/Campaign/Selector/Search.php +++ b/CRM/Campaign/Selector/Search.php @@ -190,7 +190,7 @@ class CRM_Campaign_Selector_Search extends CRM_Core_Selector_Base implements CRM * */ static - function &links() { + public function &links() { return self::$_links = array(); } @@ -202,7 +202,7 @@ class CRM_Campaign_Selector_Search extends CRM_Core_Selector_Base implements CRM * * @access public */ - function getPagerParams($action, &$params) { + public function getPagerParams($action, &$params) { $params['csvString'] = NULL; $params['status'] = ts('Respondents') . ' %%StatusMessage%%'; $params['rowCount'] = ($this->_limit) ? $this->_limit : CRM_Utils_Pager::ROWCOUNT; @@ -218,7 +218,7 @@ class CRM_Campaign_Selector_Search extends CRM_Core_Selector_Base implements CRM * @return int Total number of rows * @access public */ - function getTotalCount($action) { + public function getTotalCount($action) { return $this->_query->searchQuery(0, 0, NULL, TRUE, FALSE, FALSE, FALSE, FALSE, @@ -239,7 +239,7 @@ class CRM_Campaign_Selector_Search extends CRM_Core_Selector_Base implements CRM * * @return int the total number of rows for this action */ - function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { + public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { $result = $this->_query->searchQuery($offset, $rowCount, $sort, FALSE, FALSE, FALSE, FALSE, @@ -274,7 +274,7 @@ class CRM_Campaign_Selector_Search extends CRM_Core_Selector_Base implements CRM /** * @param $sort */ - function buildPrevNextCache($sort) { + public function buildPrevNextCache($sort) { //for prev/next pagination $crmPID = CRM_Utils_Request::retrieve('crmPID', 'Integer', CRM_Core_DAO::$_nullObject); @@ -363,7 +363,7 @@ FROM {$from} /** * @return string */ - function &getQuery() { + public function &getQuery() { return $this->_query; } @@ -374,7 +374,7 @@ FROM {$from} * * @return string name of the file */ - function getExportFileName($output = 'csv') { + public function getExportFileName($output = 'csv') { return ts('CiviCRM Respondent Search'); } } diff --git a/CRM/Campaign/StateMachine/Search.php b/CRM/Campaign/StateMachine/Search.php index ef63e9071d..2bdc763778 100755 --- a/CRM/Campaign/StateMachine/Search.php +++ b/CRM/Campaign/StateMachine/Search.php @@ -79,7 +79,7 @@ class CRM_Campaign_StateMachine_Search extends CRM_Core_StateMachine { * @return string the name of the form that will handle the task * @access protected */ - function taskName($controller, $formName = 'Search') { + public function taskName($controller, $formName = 'Search') { // total hack, check POST vars and then session to determine stuff $value = CRM_Utils_Array::value('task', $_POST); if (!isset($value)) { @@ -96,7 +96,7 @@ class CRM_Campaign_StateMachine_Search extends CRM_Core_StateMachine { * @return string * @access public */ - function getTaskFormName() { + public function getTaskFormName() { return CRM_Utils_String::getClassName($this->_task); } } diff --git a/CRM/Campaign/Task.php b/CRM/Campaign/Task.php index 17d1de5e28..fcb5b12f13 100755 --- a/CRM/Campaign/Task.php +++ b/CRM/Campaign/Task.php @@ -66,7 +66,7 @@ class CRM_Campaign_Task { * @static * @access public */ - static function &tasks() { + public static function &tasks() { if (!(self::$_tasks)) { self::$_tasks = array(1 => array( 'title' => ts('Record Respondents Interview'), @@ -113,7 +113,7 @@ class CRM_Campaign_Task { * @static * @access public */ - static function &taskTitles() { + public static function &taskTitles() { self::tasks(); $titles = array(); foreach (self::$_tasks as $id => $value) { @@ -132,7 +132,7 @@ class CRM_Campaign_Task { * @return array set of tasks that are valid for the user * @access public */ - static function &permissionedTaskTitles($permission) { + public static function &permissionedTaskTitles($permission) { $tasks = self::taskTitles(); return $tasks; @@ -148,7 +148,7 @@ class CRM_Campaign_Task { * @static * @access public */ - static function getTask($value) { + public static function getTask($value) { self::tasks(); if (!$value || !CRM_Utils_Array::value($value, self::$_tasks)) { // make the interview task by default diff --git a/CRM/Case/Audit/Audit.php b/CRM/Case/Audit/Audit.php index 37c4becffc..8517a7098c 100644 --- a/CRM/Case/Audit/Audit.php +++ b/CRM/Case/Audit/Audit.php @@ -218,7 +218,7 @@ class CRM_Case_Audit_Audit { * @return mixed */ static - function run($xmlString, $clientID, $caseID, $printReport = FALSE) { + public function run($xmlString, $clientID, $caseID, $printReport = FALSE) { /* $fh = fopen('C:/temp/audit2.xml', 'w'); fwrite($fh, $xmlString); diff --git a/CRM/Case/BAO/Case.php b/CRM/Case/BAO/Case.php index 862080b974..e40a77a890 100644 --- a/CRM/Case/BAO/Case.php +++ b/CRM/Case/BAO/Case.php @@ -50,7 +50,7 @@ class CRM_Case_BAO_Case extends CRM_Case_DAO_Case { /** * */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -59,7 +59,7 @@ class CRM_Case_BAO_Case extends CRM_Case_DAO_Case { * * @return bool */ - static function enabled() { + public static function enabled() { $config = CRM_Core_Config::singleton(); return in_array('CiviCase', $config->enableComponents); } @@ -77,7 +77,7 @@ class CRM_Case_BAO_Case extends CRM_Case_DAO_Case { * @access public * @static */ - static function add(&$params) { + public static function add(&$params) { $caseDAO = new CRM_Case_DAO_Case(); $caseDAO->copyValues($params); return $caseDAO->save(); @@ -95,7 +95,7 @@ class CRM_Case_BAO_Case extends CRM_Case_DAO_Case { * @access public * @static */ - static function &getValues(&$params, &$values, &$ids) { + public static function &getValues(&$params, &$values, &$ids) { $case = new CRM_Case_BAO_Case(); $case->copyValues($params); @@ -117,7 +117,7 @@ class CRM_Case_BAO_Case extends CRM_Case_DAO_Case { * @access public * @static */ - static function &create(&$params) { + public static function &create(&$params) { $transaction = new CRM_Core_Transaction(); if (!empty($params['id'])) { @@ -161,7 +161,7 @@ class CRM_Case_BAO_Case extends CRM_Case_DAO_Case { * @return object * @access public */ - static function addCaseToContact($params) { + public static function addCaseToContact($params) { $caseContact = new CRM_Case_DAO_CaseContact(); $caseContact->case_id = $params['case_id']; $caseContact->contact_id = $params['contact_id']; @@ -204,7 +204,7 @@ class CRM_Case_BAO_Case extends CRM_Case_DAO_Case { * @return Void * @access public */ - static function deleteCaseContact($caseID) { + public static function deleteCaseContact($caseID) { $caseContact = new CRM_Case_DAO_CaseContact(); $caseContact->case_id = $caseID; $caseContact->delete(); @@ -225,7 +225,7 @@ class CRM_Case_BAO_Case extends CRM_Case_DAO_Case { * the api needs the name => value conversion, also the view layer typically * requires value => name conversion */ - static function lookupValue(&$defaults, $property, &$lookup, $reverse) { + public static function lookupValue(&$defaults, $property, &$lookup, $reverse) { $id = $property . '_id'; $src = $reverse ? $property : $id; @@ -261,7 +261,7 @@ class CRM_Case_BAO_Case extends CRM_Case_DAO_Case { * @access public * @static */ - static function retrieve(&$params, &$defaults, &$ids) { + public static function retrieve(&$params, &$defaults, &$ids) { $case = CRM_Case_BAO_Case::getValues($params, $defaults, $ids); return $case; } @@ -275,7 +275,7 @@ class CRM_Case_BAO_Case extends CRM_Case_DAO_Case { * @access public * @static */ - static function processCaseActivity(&$params) { + public static function processCaseActivity(&$params) { $caseActivityDAO = new CRM_Case_DAO_CaseActivity(); $caseActivityDAO->activity_id = $params['activity_id']; $caseActivityDAO->case_id = $params['case_id']; @@ -293,7 +293,7 @@ class CRM_Case_BAO_Case extends CRM_Case_DAO_Case { * @access public * @static */ - static function getCaseSubject($activityId) { + public static function getCaseSubject($activityId) { $caseActivity = new CRM_Case_DAO_CaseActivity(); $caseActivity->activity_id = $activityId; if ($caseActivity->find(TRUE)) { @@ -313,7 +313,7 @@ class CRM_Case_BAO_Case extends CRM_Case_DAO_Case { * @access public * @static */ - static function getCaseType($caseId, $colName = 'title') { + public static function getCaseType($caseId, $colName = 'title') { $query = " SELECT civicrm_case_type.{$colName} FROM civicrm_case LEFT JOIN civicrm_case_type ON @@ -337,7 +337,7 @@ WHERE civicrm_case.id = %1"; * @access public * @static */ - static function deleteCase($caseId, $moveToTrash = FALSE) { + public static function deleteCase($caseId, $moveToTrash = FALSE) { CRM_Utils_Hook::pre('delete', 'Case', $caseId, CRM_Core_DAO::$_nullArray); //delete activities @@ -390,7 +390,7 @@ WHERE civicrm_case.id = %1"; * @access public * @static */ - static function enableDisableCaseRelationships($caseId, $enable) { + public static function enableDisableCaseRelationships($caseId, $enable) { $contactIds = self::retrieveContactIdsByCaseId($caseId); if (!empty($contactIds)) { foreach ($contactIds as $cid) { @@ -415,7 +415,7 @@ WHERE civicrm_case.id = %1"; * @access public * @static */ - static function deleteCaseActivity($activityId) { + public static function deleteCaseActivity($activityId) { $case = new CRM_Case_DAO_CaseActivity(); $case->activity_id = $activityId; $case->delete(); @@ -431,7 +431,7 @@ WHERE civicrm_case.id = %1"; * @return array * @access public */ - static function retrieveContactIdsByCaseId($caseId, $contactID = NULL) { + public static function retrieveContactIdsByCaseId($caseId, $contactID = NULL) { $caseContact = new CRM_Case_DAO_CaseContact(); $caseContact->case_id = $caseId; $caseContact->find(); @@ -454,7 +454,7 @@ WHERE civicrm_case.id = %1"; * * @return int, case ID */ - static function getCaseIdByActivityId($activityId) { + public static function getCaseIdByActivityId($activityId) { $originalId = CRM_Core_DAO::singleValueQuery( 'SELECT original_id FROM civicrm_activity WHERE id = %1', array('1' => array($activityId, 'Integer')) @@ -479,7 +479,7 @@ WHERE civicrm_case.id = %1"; * @access public * */ - static function getContactNames($caseId) { + public static function getContactNames($caseId) { $contactNames = array(); if (!$caseId) { return $contactNames; @@ -525,7 +525,7 @@ WHERE civicrm_case.id = %1"; * * @access public */ - static function retrieveCaseIdsByContactId($contactID, $includeDeleted = FALSE, $caseType = NULL) { + public static function retrieveCaseIdsByContactId($contactID, $includeDeleted = FALSE, $caseType = NULL) { $query = " SELECT ca.id as id FROM civicrm_case_contact cc @@ -563,7 +563,7 @@ WHERE cc.contact_id = %1 AND civicrm_case_type.name = '{$caseType}'"; * * @return string */ - static function getCaseActivityQuery($type = 'upcoming', $userID = NULL, $condition = NULL, $isDeleted = 0) { + public static function getCaseActivityQuery($type = 'upcoming', $userID = NULL, $condition = NULL, $isDeleted = 0) { if (!$userID) { $session = CRM_Core_Session::singleton(); $userID = $session->get('userID'); @@ -728,7 +728,7 @@ LEFT JOIN civicrm_option_group aog ON aog.name='activity_type' * * @access public */ - static function getCases($allCases = TRUE, $userID = NULL, $type = 'upcoming', $context = 'dashboard') { + public static function getCases($allCases = TRUE, $userID = NULL, $type = 'upcoming', $context = 'dashboard') { $condition = NULL; $casesList = array(); @@ -895,7 +895,7 @@ AND civicrm_case.status_id != $closedId"; * @param int $userID * @return array */ - static function getCasesSummary($allCases = TRUE, $userID) { + public static function getCasesSummary($allCases = TRUE, $userID) { $caseSummary = array(); //validate access for civicase. @@ -978,7 +978,7 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c * * @static */ - static function getCaseRoles($contactID, $caseID, $relationshipID = NULL) { + public static function getCaseRoles($contactID, $caseID, $relationshipID = NULL) { $query = ' SELECT civicrm_relationship.id as civicrm_relationship_id, civicrm_contact.sort_name as sort_name, @@ -1039,7 +1039,7 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c * * @static */ - static function getCaseActivity($caseID, &$params, $contactID, $context = NULL, $userID = NULL, $type = NULL) { + public static function getCaseActivity($caseID, &$params, $contactID, $context = NULL, $userID = NULL, $type = NULL) { $values = array(); $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); @@ -1379,7 +1379,7 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c * * @static */ - static function getRelatedContacts($caseID, $skipDetails = FALSE) { + public static function getRelatedContacts($caseID, $skipDetails = FALSE) { $values = array(); $query = ' SELECT cc.display_name as name, cc.sort_name as sort_name, cc.id, crt.label_b_a as role, ce.email @@ -1429,7 +1429,7 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c * @return void * @access public */ - static function sendActivityCopy($clientId, $activityId, $contacts, $attachments = NULL, $caseId) { + public static function sendActivityCopy($clientId, $activityId, $contacts, $attachments = NULL, $caseId) { if (!$activityId) { return; } @@ -1570,7 +1570,7 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c * @access public * */ - static function getCaseActivityCount($caseId, $activityTypeId) { + public static function getCaseActivityCount($caseId, $activityTypeId) { $queryParam = array( 1 => array($caseId, 'Integer'), 2 => array($activityTypeId, 'Integer'), @@ -1597,7 +1597,7 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c * * @return array|void $activity object of newly creted activity via email@access public */ - static function recordActivityViaEmail($file) { + public static function recordActivityViaEmail($file) { if (!file_exists($file) || !is_readable($file) ) { @@ -1691,7 +1691,7 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c * * @static */ - static function getNextScheduledActivity($cases, $type = 'upcoming') { + public static function getNextScheduledActivity($cases, $type = 'upcoming') { $session = CRM_Core_Session::singleton(); $userID = $session->get('userID'); @@ -1729,7 +1729,7 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c * @access public * @static */ - static function &exportableFields() { + public static function &exportableFields() { if (!self::$_exportableFields) { if (!self::$_exportableFields) { self::$_exportableFields = array(); @@ -1760,7 +1760,7 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c * @access public * @static */ - static function restoreCase($caseId) { + public static function restoreCase($caseId) { //restore activities $activities = self::getCaseActivityDates($caseId); if ($activities) { @@ -1789,7 +1789,7 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c * * @return array */ - static function getGlobalContacts(&$groupInfo, $sort = NULL, $showLinks = NULL, $returnOnlyCount = FALSE, $offset = 0, $rowCount = 25) { + public static function getGlobalContacts(&$groupInfo, $sort = NULL, $showLinks = NULL, $returnOnlyCount = FALSE, $offset = 0, $rowCount = 25) { $globalContacts = array(); $settingsProcessor = new CRM_Case_XMLProcessor_Settings(); @@ -1828,7 +1828,7 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c * * @return array */ - static function getRelatedAndGlobalContacts($caseId) { + public static function getRelatedAndGlobalContacts($caseId) { $relatedContacts = self::getRelatedContacts($caseId); $groupInfo = array(); @@ -1858,7 +1858,7 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c * * @static */ - static function getCaseActivityDates($caseID, $criteriaParams = array(), $latestDate = FALSE) { + public static function getCaseActivityDates($caseID, $criteriaParams = array(), $latestDate = FALSE) { $values = array(); $selectDate = " ca.activity_date_time"; $where = $groupBy = ' '; @@ -1910,7 +1910,7 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c * * @static */ - static function createCaseRoleActivity($caseId, $relationshipId, $relContactId = NULL, $contactId = NULL) { + public static function createCaseRoleActivity($caseId, $relationshipId, $relContactId = NULL, $contactId = NULL) { if (!$caseId || !$relationshipId || empty($relationshipId)) { return; } @@ -2002,7 +2002,7 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c * * @static */ - static function getCaseManagerContact($caseType, $caseId) { + public static function getCaseManagerContact($caseType, $caseId) { if (!$caseType || !$caseId) { return; } @@ -2045,7 +2045,7 @@ SELECT civicrm_contact.id as casemanager_id, * * @return array of case and related data keyed on case id */ - static function getUnclosedCases($params = array(), $excludeCaseIds = array(), $excludeDeleted = TRUE, $includeClosed = FALSE) { + public static function getUnclosedCases($params = array(), $excludeCaseIds = array(), $excludeDeleted = TRUE, $includeClosed = FALSE) { //params from ajax call. $where = array($includeClosed ? '(1)' : '(ca.end_date is null)'); if ($caseType = CRM_Utils_Array::value('case_type', $params)) { @@ -2128,7 +2128,7 @@ SELECT civicrm_contact.id as casemanager_id, * * @return null|string */ - static function caseCount($contactId = NULL, $excludeDeleted = TRUE) { + public static function caseCount($contactId = NULL, $excludeDeleted = TRUE) { $whereConditions = array(); if ($excludeDeleted) { $whereConditions[] = "( civicrm_case.is_deleted = 0 OR civicrm_case.is_deleted IS NULL )"; @@ -2173,7 +2173,7 @@ LEFT JOIN civicrm_case_contact ON ( civicrm_case.id = civicrm_case_contact.case * * @access public */ - static function getContactCases($contactId, $excludeDeleted = TRUE) { + public static function getContactCases($contactId, $excludeDeleted = TRUE) { $cases = array(); if (!$contactId) { return $cases; @@ -2215,7 +2215,7 @@ INNER JOIN civicrm_case_contact ON ( civicrm_case.id = civicrm_case_contact.cas * * @access public */ - static function getRelatedCases($mainCaseId, $contactId, $excludeDeleted = TRUE) { + public static function getRelatedCases($mainCaseId, $contactId, $excludeDeleted = TRUE) { //FIXME : do check for permissions. $relatedCases = array(); @@ -2321,7 +2321,7 @@ INNER JOIN civicrm_case_contact ON ( civicrm_case.id = civicrm_case_contact.cas * * TODO: use the 3rd $sqls param to append sql statements rather than executing them here */ - static function mergeContacts($mainContactId, $otherContactId) { + public static function mergeContacts($mainContactId, $otherContactId) { self::mergeCases($mainContactId, NULL, $otherContactId); } @@ -2753,7 +2753,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; * @return void * @static */ - static function buildPermissionLinks(&$tplParams, $activityParams) { + public static function buildPermissionLinks(&$tplParams, $activityParams) { $activityTypeId = CRM_Core_DAO::getFieldValue('CRM_Activity_DAO_Activity', $activityParams['source_record_id'], 'activity_type_id', 'id' ); @@ -2795,7 +2795,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; * @return boolean $allow true/false * @static */ - static function checkPermission($activityId, $operation, $actTypeId = NULL, $contactId = NULL, $checkComponent = TRUE) { + public static function checkPermission($activityId, $operation, $actTypeId = NULL, $contactId = NULL, $checkComponent = TRUE) { $allow = FALSE; if (!$actTypeId && $activityId) { $actTypeId = CRM_Core_DAO::getFieldValue('CRM_Activity_DAO_Activity', $activityId, 'activity_type_id'); @@ -3035,7 +3035,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; * if user has 'access my cases and activities' * or 'access all cases and activities' */ - static function accessCiviCase() { + public static function accessCiviCase() { if (!self::enabled()) { return FALSE; } @@ -3057,7 +3057,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; * * @return bool */ - static function accessCase($caseId, $denyClosed = TRUE) { + public static function accessCase($caseId, $denyClosed = TRUE) { if (!$caseId || !self::enabled()) { return FALSE; } @@ -3104,7 +3104,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; * * @return boolean $isCaseActivity true/false */ - static function isCaseActivity($activityID) { + public static function isCaseActivity($activityID) { $isCaseActivity = FALSE; if ($activityID) { $params = array(1 => array($activityID, 'Integer')); @@ -3123,7 +3123,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; * * @return array $caseTypeIds */ - static function getUsedCaseType() { + public static function getUsedCaseType() { static $caseTypeIds; if (!is_array($caseTypeIds)) { @@ -3148,7 +3148,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; * * @return array $caseStatusIds */ - static function getUsedCaseStatuses() { + public static function getUsedCaseStatuses() { static $caseStatusIds; if (!is_array($caseStatusIds)) { @@ -3168,7 +3168,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; * Get all the encounter medium ids currently in use * @return array */ - static function getUsedEncounterMediums() { + public static function getUsedEncounterMediums() { static $mediumIds; if (!is_array($mediumIds)) { @@ -3191,7 +3191,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; * * @return array $configured */ - static function isCaseConfigured($contactId = NULL) { + public static function isCaseConfigured($contactId = NULL) { $configured = array_fill_keys(array('configured', 'allowToAddNewCase', 'redirectToCaseAdmin'), FALSE); //lets check for case configured. @@ -3237,7 +3237,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; /** * Used during case component enablement and during ugprade */ - static function createCaseViews() { + public static function createCaseViews() { $errorScope = CRM_Core_TemporaryErrorScope::ignoreException(); $dao = new CRM_Core_DAO(); @@ -3271,7 +3271,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; /** * Helper function, also used by the upgrade in case of error */ - static function createCaseViewsQuery($section = 'upcoming') { + public static function createCaseViewsQuery($section = 'upcoming') { $sql = ""; $scheduled_id = CRM_Core_OptionGroup::getValue('activity_status', 'Scheduled', 'name'); switch ($section) { @@ -3305,7 +3305,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; * * @return void */ - static function addCaseRelationships($caseId, $contactId) { + public static function addCaseRelationships($caseId, $contactId) { // get the case role / relationships for the case $caseRelationships = new CRM_Contact_DAO_Relationship(); $caseRelationships->case_id = $caseId; @@ -3345,7 +3345,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; * @return array $clients associated array with client ids * @static */ - static function getCaseClients($caseId) { + public static function getCaseClients($caseId) { $clients = array(); $caseContact = new CRM_Case_DAO_CaseContact(); $caseContact->case_id = $caseId; diff --git a/CRM/Case/BAO/CaseType.php b/CRM/Case/BAO/CaseType.php index 80ac55e5b5..ecff9bf2ff 100644 --- a/CRM/Case/BAO/CaseType.php +++ b/CRM/Case/BAO/CaseType.php @@ -62,7 +62,7 @@ class CRM_Case_BAO_CaseType extends CRM_Case_DAO_CaseType { * @access public * @static */ - static function add(&$params) { + public static function add(&$params) { $caseTypeDAO = new CRM_Case_DAO_CaseType(); // form the name only if missing: CRM-627 @@ -106,7 +106,7 @@ class CRM_Case_BAO_CaseType extends CRM_Case_DAO_CaseType { * @static * @access public */ - static function convertDefinitionToXML($name, $definition) { + public static function convertDefinitionToXML($name, $definition) { $xmlFile = '' . "\n\n\n"; $xmlFile .= "{$name}\n"; @@ -186,7 +186,7 @@ class CRM_Case_BAO_CaseType extends CRM_Case_DAO_CaseType { * @return array the definition of the case-type, expressed as PHP array-tree * @static */ - static function convertXmlToDefinition($xml) { + public static function convertXmlToDefinition($xml) { // build PHP array based on definition $definition = array(); @@ -249,7 +249,7 @@ class CRM_Case_BAO_CaseType extends CRM_Case_DAO_CaseType { * @access public * @static */ - static function &getValues(&$params, &$values) { + public static function &getValues(&$params, &$values) { $caseType = new CRM_Case_BAO_CaseType(); $caseType->copyValues($params); @@ -270,7 +270,7 @@ class CRM_Case_BAO_CaseType extends CRM_Case_DAO_CaseType { * @access public * @static */ - static function &create(&$params) { + public static function &create(&$params) { $transaction = new CRM_Core_Transaction(); if (!empty($params['id'])) { @@ -313,7 +313,7 @@ class CRM_Case_BAO_CaseType extends CRM_Case_DAO_CaseType { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $caseType = CRM_Case_BAO_CaseType::getValues($params, $defaults); return $caseType; } @@ -324,7 +324,7 @@ class CRM_Case_BAO_CaseType extends CRM_Case_DAO_CaseType { * @throws CRM_Core_Exception * @return mixed */ - static function del($caseTypeId) { + public static function del($caseTypeId) { $caseType = new CRM_Case_DAO_CaseType(); $caseType->id = $caseTypeId; $refCounts = $caseType->getReferenceCounts(); @@ -343,7 +343,7 @@ class CRM_Case_BAO_CaseType extends CRM_Case_DAO_CaseType { * @param string $caseType * @return bool */ - static function isValidName($caseType) { + public static function isValidName($caseType) { return preg_match('/^[a-zA-Z0-9_]+$/', $caseType); } @@ -353,7 +353,7 @@ class CRM_Case_BAO_CaseType extends CRM_Case_DAO_CaseType { * @param int $caseTypeId * @return bool|null TRUE if there are *both* DB and file-based definitions */ - static function isForked($caseTypeId) { + public static function isForked($caseTypeId) { $caseTypeName = CRM_Core_DAO::getFieldValue('CRM_Case_DAO_CaseType', $caseTypeId, 'name', 'id', TRUE); if ($caseTypeName) { $dbDefinition = CRM_Core_DAO::getFieldValue('CRM_Case_DAO_CaseType', $caseTypeId, 'definition', 'id', TRUE); @@ -369,7 +369,7 @@ class CRM_Case_BAO_CaseType extends CRM_Case_DAO_CaseType { * @param int $caseTypeId * @return bool TRUE if the definition can be modified */ - static function isForkable($caseTypeId) { + public static function isForkable($caseTypeId) { $caseTypeName = CRM_Core_DAO::getFieldValue('CRM_Case_DAO_CaseType', $caseTypeId, 'name', 'id', TRUE); if ($caseTypeName) { // if file-based definition explicitly disables "forkable" option, then don't allow changes to definition diff --git a/CRM/Case/BAO/Query.php b/CRM/Case/BAO/Query.php index 7cde38d273..be00bc864b 100644 --- a/CRM/Case/BAO/Query.php +++ b/CRM/Case/BAO/Query.php @@ -39,7 +39,7 @@ class CRM_Case_BAO_Query { * * @return array */ - static function &getFields($excludeActivityFields = FALSE) { + public static function &getFields($excludeActivityFields = FALSE) { $fields = array(); $fields = CRM_Case_BAO_Case::exportableFields(); @@ -59,7 +59,7 @@ class CRM_Case_BAO_Query { * @return void * @access public */ - static function select(&$query) { + public static function select(&$query) { if (($query->_mode & CRM_Contact_BAO_Query::MODE_CASE) || !empty($query->_returnProperties['case_id'])) { $query->_select['case_id'] = "civicrm_case.id as case_id"; $query->_element['case_id'] = 1; @@ -227,7 +227,7 @@ class CRM_Case_BAO_Query { * @return void * @access public */ - static function where(&$query) { + public static function where(&$query) { foreach ($query->_params as $id => $values) { if (!is_array($values) || count($values) != 5) { continue; @@ -252,7 +252,7 @@ class CRM_Case_BAO_Query { * @return void * @access public */ - static function whereClauseSingle(&$values, &$query) { + public static function whereClauseSingle(&$values, &$query) { list($name, $op, $value, $grouping, $wildcard) = $values; $val = $names = array(); switch ($name) { @@ -536,7 +536,7 @@ class CRM_Case_BAO_Query { * * @return string */ - static function from($name, $mode, $side) { + public static function from($name, $mode, $side) { $from = ""; switch ($name) { @@ -609,7 +609,7 @@ case_relation_type.id = case_relationship.relationship_type_id )"; * @return string * @access public */ - function qill() { + public function qill() { return (isset($this->_qill)) ? $this->_qill : ""; } @@ -663,7 +663,7 @@ case_relation_type.id = case_relationship.relationship_type_id )"; /** * This includes any extra fields that might need for export etc */ - static function extraReturnProperties($mode) { + public static function extraReturnProperties($mode) { $properties = NULL; if ($mode & CRM_Contact_BAO_Query::MODE_CASE) { @@ -685,7 +685,7 @@ case_relation_type.id = case_relationship.relationship_type_id )"; /** * @param $tables */ - static function tableNames(&$tables) { + public static function tableNames(&$tables) { if (!empty($tables['civicrm_case'])) { $tables = array_merge(array('civicrm_case_contact' => 1), $tables); } @@ -705,7 +705,7 @@ case_relation_type.id = case_relationship.relationship_type_id )"; * @return void * @static */ - static function buildSearchForm(&$form) { + public static function buildSearchForm(&$form) { $config = CRM_Core_Config::singleton(); //validate case configuration. @@ -775,6 +775,6 @@ case_relation_type.id = case_relationship.relationship_type_id )"; * @param $row * @param int $id */ - static function searchAction(&$row, $id) {} + public static function searchAction(&$row, $id) {} } diff --git a/CRM/Case/Controller/Search.php b/CRM/Case/Controller/Search.php index ff52be1534..582449942c 100644 --- a/CRM/Case/Controller/Search.php +++ b/CRM/Case/Controller/Search.php @@ -49,7 +49,7 @@ class CRM_Case_Controller_Search extends CRM_Core_Controller { /** * Class constructor */ - function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { + public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { parent::__construct($title, $modal); diff --git a/CRM/Case/Form/Activity.php b/CRM/Case/Form/Activity.php index bee7d03583..e38a645bfd 100644 --- a/CRM/Case/Form/Activity.php +++ b/CRM/Case/Form/Activity.php @@ -73,7 +73,7 @@ class CRM_Case_Form_Activity extends CRM_Activity_Form_Activity { * @return void * @access public */ - function preProcess() { + public function preProcess() { $caseIds = CRM_Utils_Request::retrieve('caseid', 'String', $this); $this->_caseId = explode(',', $caseIds); $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this); @@ -226,7 +226,7 @@ class CRM_Case_Form_Activity extends CRM_Activity_Form_Activity { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $this->_defaults = parent::setDefaultValues(); $targetContactValues = array(); foreach ($this->_caseId as $key => $val) { @@ -365,7 +365,7 @@ class CRM_Case_Form_Activity extends CRM_Activity_Form_Activity { * @access public * @static */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { // skip form rule if deleting if (CRM_Utils_Array::value('_qf_Activity_next_', $fields) == 'Delete' || CRM_Utils_Array::value('_qf_Activity_next_', $fields) == 'Restore') { return TRUE; diff --git a/CRM/Case/Form/Activity/ChangeCaseStartDate.php b/CRM/Case/Form/Activity/ChangeCaseStartDate.php index 9ca60f6da6..0bfd91cfc3 100644 --- a/CRM/Case/Form/Activity/ChangeCaseStartDate.php +++ b/CRM/Case/Form/Activity/ChangeCaseStartDate.php @@ -44,7 +44,7 @@ class CRM_Case_Form_Activity_ChangeCaseStartDate { * * @throws Exception */ - static function preProcess(&$form) { + public static function preProcess(&$form) { if (!isset($form->_caseId)) { CRM_Core_Error::fatal(ts('Case Id not found.')); } @@ -63,7 +63,7 @@ class CRM_Case_Form_Activity_ChangeCaseStartDate { * * @return void */ - static function setDefaultValues(&$form) { + public static function setDefaultValues(&$form) { $defaults = array(); $openCaseActivityType = CRM_Core_OptionGroup::getValue('activity_type', @@ -91,7 +91,7 @@ class CRM_Case_Form_Activity_ChangeCaseStartDate { /** * @param CRM_Core_Form $form */ - static function buildQuickForm(&$form) { + public static function buildQuickForm(&$form) { $form->removeElement('status_id'); $form->removeElement('priority_id'); $caseId = CRM_Utils_Array::first($form->_caseId); @@ -113,7 +113,7 @@ class CRM_Case_Form_Activity_ChangeCaseStartDate { * @static * @access public */ - static function formRule($values, $files, $form) { + public static function formRule($values, $files, $form) { return TRUE; } @@ -127,7 +127,7 @@ class CRM_Case_Form_Activity_ChangeCaseStartDate { * * @return void */ - static function beginPostProcess(&$form, &$params) { + public static function beginPostProcess(&$form, &$params) { if ($form->_context == 'case') { $params['id'] = $form->_id; } @@ -144,7 +144,7 @@ class CRM_Case_Form_Activity_ChangeCaseStartDate { * * @return void */ - static function endPostProcess(&$form, &$params, $activity) { + public static function endPostProcess(&$form, &$params, $activity) { if (!empty($params['start_date'])) { $params['start_date'] = CRM_Utils_Date::processDate($params['start_date'], $params['start_date_time']); } diff --git a/CRM/Case/Form/Activity/ChangeCaseStatus.php b/CRM/Case/Form/Activity/ChangeCaseStatus.php index d2cc43e13a..7e52e7db1b 100644 --- a/CRM/Case/Form/Activity/ChangeCaseStatus.php +++ b/CRM/Case/Form/Activity/ChangeCaseStatus.php @@ -44,7 +44,7 @@ class CRM_Case_Form_Activity_ChangeCaseStatus { * * @throws Exception */ - static function preProcess(&$form) { + public static function preProcess(&$form) { if (!isset($form->_caseId)) { CRM_Core_Error::fatal(ts('Case Id not found.')); } @@ -60,7 +60,7 @@ class CRM_Case_Form_Activity_ChangeCaseStatus { * * @return void */ - static function setDefaultValues(&$form) { + public static function setDefaultValues(&$form) { $defaults = array(); // Retrieve current case status $defaults['case_status_id'] = $form->_defaultCaseStatus; @@ -71,7 +71,7 @@ class CRM_Case_Form_Activity_ChangeCaseStatus { /** * @param CRM_Core_Form $form */ - static function buildQuickForm(&$form) { + public static function buildQuickForm(&$form) { $form->removeElement('status_id'); $form->removeElement('priority_id'); @@ -113,7 +113,7 @@ class CRM_Case_Form_Activity_ChangeCaseStatus { * @static * @access public */ - static function formRule($values, $files, $form) { + public static function formRule($values, $files, $form) { return TRUE; } @@ -127,7 +127,7 @@ class CRM_Case_Form_Activity_ChangeCaseStatus { * * @return void */ - static function beginPostProcess(&$form, &$params) { + public static function beginPostProcess(&$form, &$params) { $params['id'] = CRM_Utils_Array::value('case_id', $params); } @@ -142,7 +142,7 @@ class CRM_Case_Form_Activity_ChangeCaseStatus { * * @return void */ - static function endPostProcess(&$form, &$params, $activity) { + public static function endPostProcess(&$form, &$params, $activity) { $groupingValues = CRM_Core_OptionGroup::values('case_status', FALSE, TRUE, FALSE, NULL, 'value'); // Set case end_date if we're closing the case. Clear end_date if we're (re)opening it. diff --git a/CRM/Case/Form/Activity/ChangeCaseType.php b/CRM/Case/Form/Activity/ChangeCaseType.php index 3f74333245..f4e653af37 100644 --- a/CRM/Case/Form/Activity/ChangeCaseType.php +++ b/CRM/Case/Form/Activity/ChangeCaseType.php @@ -44,7 +44,7 @@ class CRM_Case_Form_Activity_ChangeCaseType { * * @throws Exception */ - static function preProcess(&$form) { + public static function preProcess(&$form) { if (!isset($form->_caseId)) { CRM_Core_Error::fatal(ts('Case Id not found.')); } @@ -60,7 +60,7 @@ class CRM_Case_Form_Activity_ChangeCaseType { * * @return void */ - static function setDefaultValues(&$form) { + public static function setDefaultValues(&$form) { $defaults = array(); $defaults['is_reset_timeline'] = 1; @@ -75,7 +75,7 @@ class CRM_Case_Form_Activity_ChangeCaseType { /** * @param CRM_Core_Form $form */ - static function buildQuickForm(&$form) { + public static function buildQuickForm(&$form) { $form->removeElement('status_id'); $form->removeElement('priority_id'); @@ -110,7 +110,7 @@ class CRM_Case_Form_Activity_ChangeCaseType { * @static * @access public */ - static function formRule($values, $files, $form) { + public static function formRule($values, $files, $form) { return TRUE; } @@ -124,7 +124,7 @@ class CRM_Case_Form_Activity_ChangeCaseType { * * @return void */ - static function beginPostProcess(&$form, &$params) { + public static function beginPostProcess(&$form, &$params) { if ($form->_context == 'case') { $params['id'] = $form->_id; } @@ -149,7 +149,7 @@ class CRM_Case_Form_Activity_ChangeCaseType { * * @return void */ - static function endPostProcess(&$form, &$params, $activity) { + public static function endPostProcess(&$form, &$params, $activity) { if (!$form->_caseId) { // always expecting a change, so case-id is a must. return; diff --git a/CRM/Case/Form/Activity/LinkCases.php b/CRM/Case/Form/Activity/LinkCases.php index 67f4cfc13a..724a2e2e15 100644 --- a/CRM/Case/Form/Activity/LinkCases.php +++ b/CRM/Case/Form/Activity/LinkCases.php @@ -43,7 +43,7 @@ class CRM_Case_Form_Activity_LinkCases { * * @throws Exception */ - static function preProcess(&$form) { + public static function preProcess(&$form) { if (!isset($form->_caseId)) { CRM_Core_Error::fatal(ts('Case Id not found.')); } @@ -79,14 +79,14 @@ class CRM_Case_Form_Activity_LinkCases { * * @return void */ - static function setDefaultValues(&$form) { + public static function setDefaultValues(&$form) { return $defaults = array(); } /** * @param CRM_Core_Form $form */ - static function buildQuickForm(&$form) { + public static function buildQuickForm(&$form) { $form->add('text', 'link_to_case_id', ts('Link To Case'), array('class' => 'huge'), TRUE); } @@ -102,7 +102,7 @@ class CRM_Case_Form_Activity_LinkCases { * @static * @access public */ - static function formRule($values, $files, $form) { + public static function formRule($values, $files, $form) { $errors = array(); $linkCaseId = CRM_Utils_Array::value('link_to_case_id', $values); @@ -130,7 +130,7 @@ class CRM_Case_Form_Activity_LinkCases { * * @return void */ - static function beginPostProcess(&$form, &$params) {} + public static function beginPostProcess(&$form, &$params) {} /** * Process the form submission @@ -143,7 +143,7 @@ class CRM_Case_Form_Activity_LinkCases { * * @return void */ - static function endPostProcess(&$form, &$params, &$activity) { + public static function endPostProcess(&$form, &$params, &$activity) { $activityId = $activity->id; $linkCaseID = CRM_Utils_Array::value('link_to_case_id', $params); diff --git a/CRM/Case/Form/Activity/OpenCase.php b/CRM/Case/Form/Activity/OpenCase.php index fdfbe415fb..1cf6e4dd33 100644 --- a/CRM/Case/Form/Activity/OpenCase.php +++ b/CRM/Case/Form/Activity/OpenCase.php @@ -50,7 +50,7 @@ class CRM_Case_Form_Activity_OpenCase { /** * @param CRM_Core_Form $form */ - static function preProcess(&$form) { + public static function preProcess(&$form) { //get multi client case configuration $xmlProcessorProcess = new CRM_Case_XMLProcessor_Process(); $form->_allowMultiClient = (bool) $xmlProcessorProcess->getAllowMultipleCaseClients(); @@ -99,7 +99,7 @@ class CRM_Case_Form_Activity_OpenCase { * * @return void */ - static function setDefaultValues(&$form) { + public static function setDefaultValues(&$form) { $defaults = array(); if ($form->_context == 'caseActivity') { return $defaults; @@ -146,7 +146,7 @@ class CRM_Case_Form_Activity_OpenCase { /** * @param CRM_Case_Form_Case $form */ - static function buildQuickForm(&$form) { + public static function buildQuickForm(&$form) { if ($form->_context == 'caseActivity') { return; } @@ -219,7 +219,7 @@ class CRM_Case_Form_Activity_OpenCase { * * @return void */ - static function beginPostProcess(&$form, &$params) { + public static function beginPostProcess(&$form, &$params) { if ($form->_context == 'caseActivity') { return; } @@ -261,7 +261,7 @@ class CRM_Case_Form_Activity_OpenCase { * @static * @access public */ - static function formRule($fields, $files, $form) { + public static function formRule($fields, $files, $form) { if ($form->_context == 'caseActivity') { return TRUE; } @@ -280,7 +280,7 @@ class CRM_Case_Form_Activity_OpenCase { * * @return void */ - static function endPostProcess(&$form, &$params) { + public static function endPostProcess(&$form, &$params) { if ($form->_context == 'caseActivity') { return; } diff --git a/CRM/Case/Form/ActivityToCase.php b/CRM/Case/Form/ActivityToCase.php index f288975183..7017767d83 100644 --- a/CRM/Case/Form/ActivityToCase.php +++ b/CRM/Case/Form/ActivityToCase.php @@ -45,7 +45,7 @@ class CRM_Case_Form_ActivityToCase extends CRM_Core_Form { * @return void * @access public */ - function preProcess() { + public function preProcess() { $this->_activityId = CRM_Utils_Request::retrieve('activityId', 'Positive', CRM_Core_DAO::$_nullObject); if (!$this->_activityId) { CRM_Core_Error::fatal('required activity id is missing.'); @@ -64,7 +64,7 @@ class CRM_Case_Form_ActivityToCase extends CRM_Core_Form { * * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $params = array('id' => $this->_activityId); diff --git a/CRM/Case/Form/Case.php b/CRM/Case/Form/Case.php index f4db047fc7..a955a67cce 100644 --- a/CRM/Case/Form/Case.php +++ b/CRM/Case/Form/Case.php @@ -92,7 +92,7 @@ class CRM_Case_Form_Case extends CRM_Core_Form { * @return void * @access public */ - function preProcess() { + public function preProcess() { $this->_cdType = CRM_Utils_Array::value('type', $_GET); $this->assign('cdType', FALSE); if ($this->_cdType) { @@ -211,7 +211,7 @@ class CRM_Case_Form_Case extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { if ($this->_action & CRM_Core_Action::DELETE || $this->_action & CRM_Core_Action::RENEW || $this->_cdType) { return TRUE; } @@ -304,7 +304,7 @@ class CRM_Case_Form_Case extends CRM_Core_Form { * * @return void */ - function addRules() { + public function addRules() { if ($this->_action & CRM_Core_Action::DELETE || $this->_action & CRM_Core_Action::RENEW || $this->_cdType) { return TRUE; } @@ -325,7 +325,7 @@ class CRM_Case_Form_Case extends CRM_Core_Form { * @static * @access public */ - static function formRule($values, $files, $form) { + public static function formRule($values, $files, $form) { return TRUE; } diff --git a/CRM/Case/Form/CaseView.php b/CRM/Case/Form/CaseView.php index 043329157e..67997e7226 100644 --- a/CRM/Case/Form/CaseView.php +++ b/CRM/Case/Form/CaseView.php @@ -200,7 +200,7 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); return $defaults; } @@ -503,7 +503,7 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form { * @param CRM_Core_Form $form * @param array $aTypes to include acivities related to current case id $form->_caseID */ - static function activityForm($form, $aTypes = array()) { + public static function activityForm($form, $aTypes = array()) { $caseRelationships = CRM_Case_BAO_Case::getCaseRoles($form->_contactID, $form->_caseID); //build reporter select $reporters = array("" => ts(' - any reporter - ')); diff --git a/CRM/Case/Form/CustomData.php b/CRM/Case/Form/CustomData.php index 4cf0e7cb84..f98419d9c6 100644 --- a/CRM/Case/Form/CustomData.php +++ b/CRM/Case/Form/CustomData.php @@ -77,7 +77,7 @@ class CRM_Case_Form_CustomData extends CRM_Core_Form { * @access public * */ - function preProcess() { + public function preProcess() { $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); diff --git a/CRM/Case/Form/EditClient.php b/CRM/Case/Form/EditClient.php index 210af02e35..e17e4fd1a2 100644 --- a/CRM/Case/Form/EditClient.php +++ b/CRM/Case/Form/EditClient.php @@ -99,7 +99,7 @@ class CRM_Case_Form_EditClient extends CRM_Core_Form { } - function addRules() { + public function addRules() { $this->addFormRule(array(get_class($this), 'formRule'), $this); } @@ -110,7 +110,7 @@ class CRM_Case_Form_EditClient extends CRM_Core_Form { * * @return array */ - static function formRule($vals, $rule, $form) { + public static function formRule($vals, $rule, $form) { $errors = array(); if (empty($vals['reassign_contact_id']) || $vals['reassign_contact_id'] == $form->get('cid')) { $errors['reassign_contact_id'] = ts("Please select a different contact."); diff --git a/CRM/Case/Form/Search.php b/CRM/Case/Form/Search.php index 134cd10a6c..f12e13186a 100644 --- a/CRM/Case/Form/Search.php +++ b/CRM/Case/Form/Search.php @@ -76,7 +76,7 @@ class CRM_Case_Form_Search extends CRM_Core_Form_Search { * @return void * @access public */ - function preProcess() { + public function preProcess() { $this->set('searchFormName', 'Search'); //check for civicase access. @@ -178,7 +178,7 @@ class CRM_Case_Form_Search extends CRM_Core_Form_Search { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { parent::buildQuickForm(); $this->addElement('text', 'sort_name', @@ -227,7 +227,7 @@ class CRM_Case_Form_Search extends CRM_Core_Form_Search { * @return void * @access public */ - function postProcess() { + public function postProcess() { if ($this->_done) { return; } @@ -325,7 +325,7 @@ class CRM_Case_Form_Search extends CRM_Core_Form_Search { * @access public * @see valid_date */ - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Case_Form_Search', 'formRule')); } @@ -338,7 +338,7 @@ class CRM_Case_Form_Search extends CRM_Core_Form_Search { * @static * @access public */ - static function formRule($fields) { + public static function formRule($fields) { $errors = array(); if (!empty($errors)) { @@ -355,13 +355,13 @@ class CRM_Case_Form_Search extends CRM_Core_Form_Search { * * @return array the default array reference */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $defaults = $this->_formValues; return $defaults; } - function fixFormValues() { + public function fixFormValues() { if (!$this->_force) { return; } @@ -438,7 +438,7 @@ class CRM_Case_Form_Search extends CRM_Core_Form_Search { /** * @return null */ - function getFormValues() { + public function getFormValues() { return NULL; } diff --git a/CRM/Case/Form/Task.php b/CRM/Case/Form/Task.php index 850f9b5eae..89865e9737 100644 --- a/CRM/Case/Form/Task.php +++ b/CRM/Case/Form/Task.php @@ -75,7 +75,7 @@ class CRM_Case_Form_Task extends CRM_Core_Form { * @return void * @access public */ - function preProcess() { + public function preProcess() { self::preProcessCommon($this); } @@ -83,7 +83,7 @@ class CRM_Case_Form_Task extends CRM_Core_Form { * @param CRM_Core_Form $form * @param bool $useTable */ - static function preProcessCommon(&$form, $useTable = FALSE) { + public static function preProcessCommon(&$form, $useTable = FALSE) { $form->_caseIds = array(); $values = $form->controller->exportValues($form->get('searchFormName')); @@ -161,7 +161,7 @@ class CRM_Case_Form_Task extends CRM_Core_Form { * @return void * @access public */ - function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { + public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { $this->addButtons(array( array( 'type' => $nextType, diff --git a/CRM/Case/Form/Task/Delete.php b/CRM/Case/Form/Task/Delete.php index 1b2f74e474..115b8821ad 100644 --- a/CRM/Case/Form/Task/Delete.php +++ b/CRM/Case/Form/Task/Delete.php @@ -75,7 +75,7 @@ class CRM_Case_Form_Task_Delete extends CRM_Case_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $this->addDefaultButtons(ts('Delete Cases'), 'done'); } diff --git a/CRM/Case/Form/Task/Print.php b/CRM/Case/Form/Task/Print.php index 49ff1cc003..b16626ade0 100644 --- a/CRM/Case/Form/Task/Print.php +++ b/CRM/Case/Form/Task/Print.php @@ -45,7 +45,7 @@ class CRM_Case_Form_Task_Print extends CRM_Case_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preprocess(); // set print view, so that print templates are called @@ -76,7 +76,7 @@ class CRM_Case_Form_Task_Print extends CRM_Case_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { // // just need to add a javacript to popup the window for printing // diff --git a/CRM/Case/Form/Task/Restore.php b/CRM/Case/Form/Task/Restore.php index 40833e047c..d794701756 100644 --- a/CRM/Case/Form/Task/Restore.php +++ b/CRM/Case/Form/Task/Restore.php @@ -64,7 +64,7 @@ class CRM_Case_Form_Task_Restore extends CRM_Case_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $this->addDefaultButtons(ts('Restore Cases'), 'done'); } diff --git a/CRM/Case/Form/Task/Result.php b/CRM/Case/Form/Task/Result.php index 672c3272fe..b36b403f10 100644 --- a/CRM/Case/Form/Task/Result.php +++ b/CRM/Case/Form/Task/Result.php @@ -46,7 +46,7 @@ class CRM_Case_Form_Task_Result extends CRM_Case_Form_Task { * @return void * @access public */ - function preProcess() {} + public function preProcess() {} /** * Build the form object diff --git a/CRM/Case/Form/Task/SearchTaskHookSample.php b/CRM/Case/Form/Task/SearchTaskHookSample.php index 89ea268f23..1adb0bce87 100644 --- a/CRM/Case/Form/Task/SearchTaskHookSample.php +++ b/CRM/Case/Form/Task/SearchTaskHookSample.php @@ -44,7 +44,7 @@ class CRM_Case_Form_Task_SearchTaskHookSample extends CRM_Case_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); $rows = array(); // display name and email of all contact ids diff --git a/CRM/Case/Page/AJAX.php b/CRM/Case/Page/AJAX.php index ddc2b0fb01..31720c0686 100644 --- a/CRM/Case/Page/AJAX.php +++ b/CRM/Case/Page/AJAX.php @@ -40,7 +40,7 @@ class CRM_Case_Page_AJAX { /** * Retrieve unclosed cases. */ - static function unclosedCases() { + public static function unclosedCases() { $params = array( 'limit' => CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'search_autocomplete_count', NULL, 10), 'sort_name' => CRM_Utils_Type::escape(CRM_Utils_Array::value('term', $_GET, ''), 'String'), @@ -64,7 +64,7 @@ class CRM_Case_Page_AJAX { CRM_Utils_JSON::output($results); } - function processCaseTags() { + public function processCaseTags() { $caseId = CRM_Utils_Type::escape($_POST['case_id'], 'Positive'); $tags = CRM_Utils_Type::escape($_POST['tag'], 'String'); @@ -123,7 +123,7 @@ class CRM_Case_Page_AJAX { CRM_Utils_System::civiExit(); } - function caseDetails() { + public function caseDetails() { $caseId = CRM_Utils_Type::escape($_GET['caseId'], 'Positive'); if (!CRM_Case_BAO_Case::accessCase($caseId, FALSE)) { @@ -157,7 +157,7 @@ class CRM_Case_Page_AJAX { CRM_Utils_System::civiExit(); } - function addClient() { + public function addClient() { $caseId = CRM_Utils_Type::escape($_POST['caseID'], 'Positive'); $contactId = CRM_Utils_Type::escape($_POST['contactID'], 'Positive'); @@ -200,7 +200,7 @@ class CRM_Case_Page_AJAX { /** * Delete relationships specific to case and relationship type */ - static function deleteCaseRoles() { + public static function deleteCaseRoles() { $caseId = CRM_Utils_Type::escape($_POST['case_id'], 'Positive'); $relType = CRM_Utils_Type::escape($_POST['rel_type'], 'Positive'); diff --git a/CRM/Case/Page/CaseDetails.php b/CRM/Case/Page/CaseDetails.php index f68efd95ae..97e4c9f810 100644 --- a/CRM/Case/Page/CaseDetails.php +++ b/CRM/Case/Page/CaseDetails.php @@ -41,7 +41,7 @@ class CRM_Case_Page_CaseDetails extends CRM_Core_Page { * return null * @access public */ - function run() { + public function run() { $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); diff --git a/CRM/Case/Page/DashBoard.php b/CRM/Case/Page/DashBoard.php index 047ab9035b..68c84efae4 100644 --- a/CRM/Case/Page/DashBoard.php +++ b/CRM/Case/Page/DashBoard.php @@ -48,7 +48,7 @@ class CRM_Case_Page_DashBoard extends CRM_Core_Page { * @access public * */ - function preProcess() { + public function preProcess() { //check for civicase access. if (!CRM_Case_BAO_Case::accessCiviCase()) { CRM_Core_Error::fatal(ts('You are not authorized to access this page.')); @@ -112,7 +112,7 @@ class CRM_Case_Page_DashBoard extends CRM_Core_Page { * return null * @access public */ - function run() { + public function run() { $this->preProcess(); return parent::run(); diff --git a/CRM/Case/Page/Tab.php b/CRM/Case/Page/Tab.php index c439eeba79..1c028b97ab 100644 --- a/CRM/Case/Page/Tab.php +++ b/CRM/Case/Page/Tab.php @@ -49,7 +49,7 @@ class CRM_Case_Page_Tab extends CRM_Core_Page { public $_permission = NULL; public $_contactId = NULL; - function preProcess() { + public function preProcess() { $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this); @@ -102,7 +102,7 @@ class CRM_Case_Page_Tab extends CRM_Core_Page { * @return void * @access public */ - function view() { + public function view() { $controller = new CRM_Core_Controller_Simple( 'CRM_Case_Form_CaseView', 'View Case', @@ -146,7 +146,7 @@ class CRM_Case_Page_Tab extends CRM_Core_Page { * return null * @access public */ - function browse() { + public function browse() { $controller = new CRM_Core_Controller_Simple('CRM_Case_Form_Search', ts('Case'), NULL); $controller->setEmbedded(TRUE); @@ -170,7 +170,7 @@ class CRM_Case_Page_Tab extends CRM_Core_Page { * return null * @access public */ - function edit() { + public function edit() { $config = CRM_Core_Config::singleton(); $controller = new CRM_Core_Controller_Simple( @@ -191,7 +191,7 @@ class CRM_Case_Page_Tab extends CRM_Core_Page { * return null * @access public */ - function run() { + public function run() { $contactID = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullArray); $context = CRM_Utils_Request::retrieve('context', 'String', $this); @@ -233,7 +233,7 @@ class CRM_Case_Page_Tab extends CRM_Core_Page { * @static */ static - function &links() { + public function &links() { $config = CRM_Core_Config::singleton(); if (!(self::$_links)) { @@ -257,7 +257,7 @@ class CRM_Case_Page_Tab extends CRM_Core_Page { return self::$_links; } - function setContext() { + public function setContext() { $context = $this->get('context'); $url = NULL; diff --git a/CRM/Case/Selector/Search.php b/CRM/Case/Selector/Search.php index 806789b958..a4bf334a44 100644 --- a/CRM/Case/Selector/Search.php +++ b/CRM/Case/Selector/Search.php @@ -191,7 +191,7 @@ class CRM_Case_Selector_Search extends CRM_Core_Selector_Base { * @access public */ static - function &links($isDeleted = FALSE, $key = NULL) { + public function &links($isDeleted = FALSE, $key = NULL) { $extraParams = ($key) ? "&key={$key}" : NULL; if ($isDeleted) { @@ -254,7 +254,7 @@ class CRM_Case_Selector_Search extends CRM_Core_Selector_Base { * * @access public */ - function getPagerParams($action, &$params) { + public function getPagerParams($action, &$params) { $params['status'] = ts('Case') . ' %%StatusMessage%%'; $params['csvString'] = NULL; if ($this->_limit) { @@ -276,7 +276,7 @@ class CRM_Case_Selector_Search extends CRM_Core_Selector_Base { * @return int Total number of rows * @access public */ - function getTotalCount($action) { + public function getTotalCount($action) { return $this->_query->searchQuery(0, 0, NULL, TRUE, FALSE, FALSE, FALSE, @@ -296,7 +296,7 @@ class CRM_Case_Selector_Search extends CRM_Core_Selector_Base { * * @return int the total number of rows for this action */ - function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { + public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { $result = $this->_query->searchQuery($offset, $rowCount, $sort, FALSE, FALSE, FALSE, FALSE, @@ -487,14 +487,14 @@ class CRM_Case_Selector_Search extends CRM_Core_Selector_Base { /** * @return mixed */ - function alphabetQuery() { + public function alphabetQuery() { return $this->_query->searchQuery(NULL, NULL, NULL, FALSE, FALSE, TRUE); } /** * @return string */ - function &getQuery() { + public function &getQuery() { return $this->_query; } @@ -505,7 +505,7 @@ class CRM_Case_Selector_Search extends CRM_Core_Selector_Base { * * @return string name of the file */ - function getExportFileName($output = 'csv') { + public function getExportFileName($output = 'csv') { return ts('Case Search'); } } diff --git a/CRM/Case/StateMachine/Search.php b/CRM/Case/StateMachine/Search.php index 79efc9e582..e9d394a38b 100644 --- a/CRM/Case/StateMachine/Search.php +++ b/CRM/Case/StateMachine/Search.php @@ -81,7 +81,7 @@ class CRM_Case_StateMachine_Search extends CRM_Core_StateMachine { * @return string the name of the form that will handle the task * @access protected */ - function taskName($controller, $formName = 'Search') { + public function taskName($controller, $formName = 'Search') { // total hack, check POST vars and then session to determine stuff $value = CRM_Utils_Array::value('task', $_POST); if (!isset($value)) { @@ -98,7 +98,7 @@ class CRM_Case_StateMachine_Search extends CRM_Core_StateMachine { * @return string * @access public */ - function getTaskFormName() { + public function getTaskFormName() { return CRM_Utils_String::getClassName($this->_task); } @@ -107,7 +107,7 @@ class CRM_Case_StateMachine_Search extends CRM_Core_StateMachine { * we dont want to issue a reset of the state session when we are done processing a task * */ - function shouldReset() { + public function shouldReset() { return FALSE; } } diff --git a/CRM/Case/Task.php b/CRM/Case/Task.php index 79b892d165..5f9c15e4ae 100644 --- a/CRM/Case/Task.php +++ b/CRM/Case/Task.php @@ -65,7 +65,7 @@ class CRM_Case_Task { * @static * @access public */ - static function &tasks() { + public static function &tasks() { if (!self::$_tasks) { self::$_tasks = array( 1 => array( @@ -110,7 +110,7 @@ class CRM_Case_Task { * @static * @access public */ - static function &taskTitles() { + public static function &taskTitles() { self::tasks(); $titles = array(); foreach (self::$_tasks as $id => $value) { @@ -126,7 +126,7 @@ class CRM_Case_Task { * @static * @access public */ - static function &optionalTaskTitle() { + public static function &optionalTaskTitle() { $tasks = array(); return $tasks; } @@ -140,7 +140,7 @@ class CRM_Case_Task { * @return array set of tasks that are valid for the user * @access public */ - static function &permissionedTaskTitles($permission) { + public static function &permissionedTaskTitles($permission) { $tasks = array(); if (($permission == CRM_Core_Permission::EDIT) || CRM_Core_Permission::check('access all cases and activities') @@ -169,7 +169,7 @@ class CRM_Case_Task { * @static * @access public */ - static function getTask($value) { + public static function getTask($value) { self::tasks(); if (!$value || !CRM_Utils_Array::value($value, self::$_tasks)) { // make the print task by default diff --git a/CRM/Case/XMLProcessor.php b/CRM/Case/XMLProcessor.php index b6c3ebab05..9287233681 100644 --- a/CRM/Case/XMLProcessor.php +++ b/CRM/Case/XMLProcessor.php @@ -101,7 +101,7 @@ class CRM_Case_XMLProcessor { * * @return array */ - function &allActivityTypes($indexName = TRUE, $all = FALSE) { + public function &allActivityTypes($indexName = TRUE, $all = FALSE) { if (self::$activityTypes === NULL) { self::$activityTypes = CRM_Case_PseudoConstant::caseActivityType($indexName, $all); } @@ -111,7 +111,7 @@ class CRM_Case_XMLProcessor { /** * @return array */ - function &allRelationshipTypes() { + public function &allRelationshipTypes() { if (self::$relationshipTypes === NULL) { $relationshipInfo = CRM_Core_PseudoConstant::relationshipType('label', TRUE); diff --git a/CRM/Case/XMLProcessor/Process.php b/CRM/Case/XMLProcessor/Process.php index c3452e789a..6846b0198b 100644 --- a/CRM/Case/XMLProcessor/Process.php +++ b/CRM/Case/XMLProcessor/Process.php @@ -39,7 +39,7 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor { * * @throws Exception */ - function run($caseType, &$params) { + public function run($caseType, &$params) { $xml = $this->retrieve($caseType); if ($xml === FALSE) { @@ -65,7 +65,7 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor { * @return array|bool|mixed * @throws Exception */ - function get($caseType, $fieldSet, $isLabel = FALSE, $maskAction = FALSE) { + public function get($caseType, $fieldSet, $isLabel = FALSE, $maskAction = FALSE) { $xml = $this->retrieve($caseType); if ($xml === FALSE) { $docLink = CRM_Utils_System::docURL2("user/case-management/setup"); @@ -93,7 +93,7 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor { * * @throws Exception */ - function process($xml, &$params) { + public function process($xml, &$params) { $standardTimeline = CRM_Utils_Array::value('standardTimeline', $params); $activitySetName = CRM_Utils_Array::value('activitySetName', $params); $activityTypeName = CRM_Utils_Array::value('activityTypeName', $params); @@ -144,7 +144,7 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor { * @param $activitySetXML * @param array $params */ - function processStandardTimeline($activitySetXML, &$params) { + public function processStandardTimeline($activitySetXML, &$params) { if ('Change Case Type' == CRM_Utils_Array::value('activityTypeName', $params) && CRM_Utils_Array::value('resetTimeline', $params, TRUE)) { // delete all existing activities which are non-empty @@ -162,7 +162,7 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor { * @param $activitySetXML * @param array $params */ - function processActivitySet($activitySetXML, &$params) { + public function processActivitySet($activitySetXML, &$params) { foreach ($activitySetXML->ActivityTypes as $activityTypesXML) { foreach ($activityTypesXML as $activityTypeXML) { $this->createActivity($activityTypeXML, $params); @@ -176,7 +176,7 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor { * * @return array|mixed */ - function &caseRoles($caseRolesXML, $isCaseManager = FALSE) { + public function &caseRoles($caseRolesXML, $isCaseManager = FALSE) { $relationshipTypes = &$this->allRelationshipTypes(); $result = array(); @@ -208,7 +208,7 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor { * @return bool * @throws Exception */ - function createRelationships($relationshipTypeName, &$params) { + public function createRelationships($relationshipTypeName, &$params) { $relationshipTypes = &$this->allRelationshipTypes(); // get the relationship id $relationshipTypeID = array_search($relationshipTypeName, $relationshipTypes); @@ -249,7 +249,7 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor { * * @return bool */ - function createRelationship(&$params) { + public function createRelationship(&$params) { $dao = new CRM_Contact_DAO_Relationship(); $dao->copyValues($params); // only create a relationship if it does not exist @@ -267,7 +267,7 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor { * * @return array */ - function activityTypes($activityTypesXML, $maxInst = FALSE, $isLabel = FALSE, $maskAction = FALSE) { + public function activityTypes($activityTypesXML, $maxInst = FALSE, $isLabel = FALSE, $maskAction = FALSE) { $activityTypes = &$this->allActivityTypes(TRUE, TRUE); $result = array(); foreach ($activityTypesXML as $activityTypeXML) { @@ -312,7 +312,7 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor { * @param SimpleXMLElement $caseTypeXML * @return array symbolic activity-type names */ - function getDeclaredActivityTypes($caseTypeXML) { + public function getDeclaredActivityTypes($caseTypeXML) { $result = array(); if (!empty($caseTypeXML->ActivityTypes) && $caseTypeXML->ActivityTypes->ActivityType) { @@ -340,7 +340,7 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor { * @param SimpleXMLElement $caseTypeXML * @return array symbolic relationship-type names */ - function getDeclaredRelationshipTypes($caseTypeXML) { + public function getDeclaredRelationshipTypes($caseTypeXML) { $result = array(); if (!empty($caseTypeXML->CaseRoles) && $caseTypeXML->CaseRoles->RelationshipType) { @@ -357,7 +357,7 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor { /** * @param array $params */ - function deleteEmptyActivity(&$params) { + public function deleteEmptyActivity(&$params) { $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); @@ -379,7 +379,7 @@ AND a.is_current_revision = 1 * * @return bool */ - function isActivityPresent(&$params) { + public function isActivityPresent(&$params) { $query = " SELECT count(a.id) FROM civicrm_activity a @@ -409,7 +409,7 @@ AND a.is_deleted = 0 * @throws CRM_Core_Exception * @throws Exception */ - function createActivity($activityTypeXML, &$params) { + public function createActivity($activityTypeXML, &$params) { $activityTypeName = (string) $activityTypeXML->name; $activityTypes = &$this->allActivityTypes(TRUE, TRUE); $activityTypeInfo = CRM_Utils_Array::value($activityTypeName, $activityTypes); @@ -576,7 +576,7 @@ AND a.is_deleted = 0 * * @return array */ - static function activitySets($activitySetsXML) { + public static function activitySets($activitySetsXML) { $result = array(); foreach ($activitySetsXML as $activitySetXML) { foreach ($activitySetXML as $recordXML) { @@ -596,7 +596,7 @@ AND a.is_deleted = 0 * @return array|bool|mixed * @throws Exception */ - function getMaxInstance($caseType, $activityTypeName = NULL) { + public function getMaxInstance($caseType, $activityTypeName = NULL) { $xml = $this->retrieve($caseType); if ($xml === FALSE) { @@ -613,7 +613,7 @@ AND a.is_deleted = 0 * * @return array|mixed */ - function getCaseManagerRoleId($caseType) { + public function getCaseManagerRoleId($caseType) { $xml = $this->retrieve($caseType); return $this->caseRoles($xml->CaseRoles, TRUE); } @@ -622,7 +622,7 @@ AND a.is_deleted = 0 * @param string $caseType * @return array<\Civi\CCase\CaseChangeListener> */ - function getListeners($caseType) { + public function getListeners($caseType) { $xml = $this->retrieve($caseType); $listeners = array(); if ($xml->Listeners && $xml->Listeners->Listener) { @@ -637,7 +637,7 @@ AND a.is_deleted = 0 /** * @return int */ - function getRedactActivityEmail() { + public function getRedactActivityEmail() { $xml = $this->retrieve("Settings"); return ( string ) $xml->RedactActivityEmail ? 1 : 0; } @@ -647,7 +647,7 @@ AND a.is_deleted = 0 * * @return string 1 if allowed, 0 if not */ - function getAllowMultipleCaseClients() { + public function getAllowMultipleCaseClients() { $xml = $this->retrieve("Settings"); if ($xml) { return ( string ) $xml->AllowMultipleCaseClients ? 1 : 0; @@ -660,7 +660,7 @@ AND a.is_deleted = 0 * * @return string 1 if natural, 0 if alphabetic */ - function getNaturalActivityTypeSort() { + public function getNaturalActivityTypeSort() { $xml = $this->retrieve("Settings"); return ( string ) $xml->NaturalActivityTypeSort ? 1 : 0; } diff --git a/CRM/Case/XMLProcessor/Report.php b/CRM/Case/XMLProcessor/Report.php index 237c93e388..665dc244dd 100644 --- a/CRM/Case/XMLProcessor/Report.php +++ b/CRM/Case/XMLProcessor/Report.php @@ -54,7 +54,7 @@ class CRM_Case_XMLProcessor_Report extends CRM_Case_XMLProcessor { * * @return mixed */ - function run($clientID, $caseID, $activitySetName, $params) { + public function run($clientID, $caseID, $activitySetName, $params) { $contents = self::getCaseReport($clientID, $caseID, $activitySetName, @@ -65,7 +65,7 @@ class CRM_Case_XMLProcessor_Report extends CRM_Case_XMLProcessor { return CRM_Case_Audit_Audit::run($contents, $clientID, $caseID); } - function &getRedactionRules() { + public function &getRedactionRules() { foreach (array( 'redactionStringRules', 'redactionRegexRules') as $key => $rule) { $$rule = CRM_Case_PseudoConstant::redactionRule($key); @@ -152,7 +152,7 @@ class CRM_Case_XMLProcessor_Report extends CRM_Case_XMLProcessor { * * @return array|bool */ - function getActivityTypes($xml, $activitySetName) { + public function getActivityTypes($xml, $activitySetName) { foreach ($xml->ActivitySets as $activitySetsXML) { foreach ($activitySetsXML->ActivitySet as $activitySetXML) { if ((string ) $activitySetXML->name == $activitySetName) { @@ -180,7 +180,7 @@ class CRM_Case_XMLProcessor_Report extends CRM_Case_XMLProcessor { * * @return null|string */ - function getActivitySetLabel($xml, $activitySetName) { + public function getActivitySetLabel($xml, $activitySetName) { foreach ($xml->ActivitySets as $activitySetsXML) { foreach ($activitySetsXML->ActivitySet as $activitySetXML) { if ((string ) $activitySetXML->name == $activitySetName) { @@ -197,7 +197,7 @@ class CRM_Case_XMLProcessor_Report extends CRM_Case_XMLProcessor { * @param $activityTypes * @param $activities */ - function getActivities($clientID, $caseID, $activityTypes, &$activities) { + public function getActivities($clientID, $caseID, $activityTypes, &$activities) { // get all activities for this case that in this activityTypes set foreach ($activityTypes as $aType) { $map[$aType['id']] = $aType; @@ -243,7 +243,7 @@ AND ac.case_id = %1 * * @return mixed */ - function &getActivityInfo($clientID, $activityID, $anyActivity = FALSE, $redact = 0) { + public function &getActivityInfo($clientID, $activityID, $anyActivity = FALSE, $redact = 0) { static $activityInfos = array(); if ($redact) { $this->_isRedact = 1; @@ -311,7 +311,7 @@ WHERE a.id = %1 * * @return array */ - function &getActivity($clientID, $activityDAO, &$activityTypeInfo) { + public function &getActivity($clientID, $activityDAO, &$activityTypeInfo) { if (empty($this->_redactionStringRules)) { $this->_redactionStringRules = array(); } @@ -540,7 +540,7 @@ WHERE a.id = %1 * * @return array|null */ - function getCustomData($clientID, $activityDAO, &$activityTypeInfo) { + public function getCustomData($clientID, $activityDAO, &$activityTypeInfo) { list($typeValues, $options, $sql) = $this->getActivityTypeCustomSQL($activityTypeInfo['id'], '%Y-%m-%d'); $params = array(1 => array($activityDAO->id, 'Integer')); @@ -599,7 +599,7 @@ WHERE a.id = %1 * * @return mixed */ - function getActivityTypeCustomSQL($activityTypeID, $dateFormat = NULL) { + public function getActivityTypeCustomSQL($activityTypeID, $dateFormat = NULL) { static $cache = array(); if (is_null($activityTypeID)) { @@ -700,7 +700,7 @@ WHERE entity_id = %1 * * @return null|string */ - function getCreatedBy($activityID) { + public function getCreatedBy($activityID) { $query = " SELECT c.display_name FROM civicrm_contact c, @@ -742,7 +742,7 @@ LIMIT 1 * * @return mixed */ - static function getCaseReport($clientID, $caseID, $activitySetName, $params, $form) { + public static function getCaseReport($clientID, $caseID, $activitySetName, $params, $form) { $template = CRM_Core_Smarty::singleton(); @@ -804,7 +804,7 @@ LIMIT 1 return $contents; } - static function printCaseReport() { + 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); diff --git a/CRM/Case/XMLProcessor/Settings.php b/CRM/Case/XMLProcessor/Settings.php index 3da6688b7a..77e0e638e3 100644 --- a/CRM/Case/XMLProcessor/Settings.php +++ b/CRM/Case/XMLProcessor/Settings.php @@ -43,7 +43,7 @@ class CRM_Case_XMLProcessor_Settings extends CRM_Case_XMLProcessor { * * @return array */ - function run($filename = 'settings') { + public function run($filename = 'settings') { $xml = $this->retrieve($filename); // For now it's not an error. In the future it might be a required file. diff --git a/CRM/Case/XMLRepository.php b/CRM/Case/XMLRepository.php index ced38f9665..d0c5a88ff0 100644 --- a/CRM/Case/XMLRepository.php +++ b/CRM/Case/XMLRepository.php @@ -257,7 +257,7 @@ class CRM_Case_XMLRepository { * @param string $activityType symbolic-name of an activity type * @return int */ - function getActivityReferenceCount($activityType) { + public function getActivityReferenceCount($activityType) { $p = new CRM_Case_XMLProcessor_Process(); $count = 0; foreach ($this->getAllCaseTypes() as $caseTypeName) { @@ -276,7 +276,7 @@ class CRM_Case_XMLRepository { * @param string $relationshipTypeName symbolic-name of a relationship-type * @return int */ - function getRelationshipReferenceCount($relationshipTypeName) { + public function getRelationshipReferenceCount($relationshipTypeName) { $p = new CRM_Case_XMLProcessor_Process(); $count = 0; foreach ($this->getAllCaseTypes() as $caseTypeName) { diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index fa463315cd..f783b6ca22 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -98,7 +98,7 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact { /** * */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -115,7 +115,7 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact { * @access public * @static */ - static function add(&$params) { + public static function add(&$params) { $contact = new CRM_Contact_DAO_Contact(); if (empty($params)) { @@ -278,7 +278,7 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact { * @access public * @static */ - static function &create(&$params, $fixAddress = TRUE, $invokeHooks = TRUE, $skipDelete = FALSE) { + public static function &create(&$params, $fixAddress = TRUE, $invokeHooks = TRUE, $skipDelete = FALSE) { $contact = NULL; if (empty($params['contact_type']) && empty($params['contact_id'])) { return $contact; @@ -474,7 +474,7 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact { * @access public * @static */ - static function getDisplayAndImage($id, $type = FALSE) { + public static function getDisplayAndImage($id, $type = FALSE) { //CRM-14276 added the * on the civicrm_contact table so that we have all the contact info available $sql = " SELECT civicrm_contact.*, @@ -560,7 +560,7 @@ WHERE civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer'); * @access public * @static */ - static function resolveDefaults(&$defaults, $reverse = FALSE) { + public static function resolveDefaults(&$defaults, $reverse = FALSE) { // hack for birth_date if (!empty($defaults['birth_date'])) { if (is_array($defaults['birth_date'])) { @@ -692,7 +692,7 @@ WHERE civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer'); * @access public * @static */ - static function &retrieve(&$params, &$defaults, $microformat = FALSE) { + public static function &retrieve(&$params, &$defaults, $microformat = FALSE) { if (array_key_exists('contact_id', $params)) { $params['id'] = $params['contact_id']; } @@ -738,7 +738,7 @@ WHERE civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer'); * @static * @access public */ - static function displayName($id) { + public static function displayName($id) { $displayName = NULL; if ($id) { $displayName = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $id, 'display_name'); @@ -758,7 +758,7 @@ WHERE civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer'); * @access public * @static */ - static function deleteContact($id, $restore = FALSE, $skipUndelete = FALSE) { + public static function deleteContact($id, $restore = FALSE, $skipUndelete = FALSE) { if (!$id) { return FALSE; @@ -1041,7 +1041,7 @@ WHERE id={$id}; "; * @return void * @static */ - static function contactTrashRestore($contact, $restore = FALSE) { + public static function contactTrashRestore($contact, $restore = FALSE) { $op = ($restore ? 'restore' : 'trash'); CRM_Utils_Hook::pre($op, $contact->contact_type, $contact->id, CRM_Core_DAO::$_nullArray); @@ -1350,7 +1350,7 @@ WHERE id={$id}; "; * @access public * @static */ - static function &exportableFields($contactType = 'Individual', $status = FALSE, $export = FALSE, $search = FALSE, $withMultiRecord = FALSE) { + public static function &exportableFields($contactType = 'Individual', $status = FALSE, $export = FALSE, $search = FALSE, $withMultiRecord = FALSE) { if (empty($contactType)) { $contactType = 'All'; } @@ -1583,7 +1583,7 @@ WHERE id={$id}; "; * @static * @access public */ - static function getHierContactDetails($contactId, &$fields) { + public static function getHierContactDetails($contactId, &$fields) { $params = array(array('contact_id', '=', $contactId, 0, 0)); $options = array(); @@ -1610,7 +1610,7 @@ WHERE id={$id}; "; * @access public * @static */ - static function &makeHierReturnProperties($fields, $contactId = NULL) { + public static function &makeHierReturnProperties($fields, $contactId = NULL) { $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'); $returnProperties = array(); @@ -1681,7 +1681,7 @@ WHERE id={$id}; "; * @access public * @static */ - static function getPrimaryLocationType($contactId, $skipDefaultPriamry = FALSE, $block = NULL) { + public static function getPrimaryLocationType($contactId, $skipDefaultPriamry = FALSE, $block = NULL) { if($block){ $entityBlock = array('contact_id' => $contactId); $blocks = CRM_Core_BAO_Location::getValues($entityBlock); @@ -1744,7 +1744,7 @@ WHERE civicrm_contact.id = %1 "; * @static * @access public */ - static function getContactDetails($id) { + public static function getContactDetails($id) { // check if the contact type $contactType = self::getContactType($id); @@ -2263,7 +2263,7 @@ ORDER BY civicrm_email.is_primary DESC"; * @return object $dao contact details * @static */ - static function &matchContactOnEmail($mail, $ctype = NULL) { + public static function &matchContactOnEmail($mail, $ctype = NULL) { $strtolower = function_exists('mb_strtolower') ? 'mb_strtolower' : 'strtolower'; $mail = $strtolower(trim($mail)); $query = " @@ -2315,7 +2315,7 @@ WHERE civicrm_email.email = %1 AND civicrm_contact.is_deleted=0"; * @return object $dao contact details * @static */ - static function &matchContactOnOpenId($openId, $ctype = NULL) { + public static function &matchContactOnOpenId($openId, $ctype = NULL) { $strtolower = function_exists('mb_strtolower') ? 'mb_strtolower' : 'strtolower'; $openId = $strtolower(trim($openId)); $query = " @@ -2495,7 +2495,7 @@ AND civicrm_openid.is_primary = 1"; * @access public * @static */ - static function getCountComponent($component, $contactId, $tableName = NULL) { + public static function getCountComponent($component, $contactId, $tableName = NULL) { $object = NULL; switch ($component) { case 'tag': @@ -2572,7 +2572,7 @@ AND civicrm_openid.is_primary = 1"; * @access public * @static */ - static function processGreetings(&$contact, $useDefaults = FALSE) { + public static function processGreetings(&$contact, $useDefaults = FALSE) { if ($useDefaults) { //retrieve default greetings $defaultGreetings = CRM_Core_PseudoConstant::greetingDefaults(); @@ -2724,7 +2724,7 @@ AND civicrm_openid.is_primary = 1"; * @return array $locBlockIds loc block ids which fulfill condition. * @static */ - static function getLocBlockIds($contactId, $criteria = array(), $condOperator = 'AND') { + public static function getLocBlockIds($contactId, $criteria = array(), $condOperator = 'AND') { $locBlockIds = array(); if (!$contactId) { return $locBlockIds; @@ -2773,7 +2773,7 @@ AND civicrm_openid.is_primary = 1"; * @return array of context menu for logged in user. * @static */ - static function contextMenu($contactId = NULL) { + public static function contextMenu($contactId = NULL) { $menu = array( 'view' => array( 'title' => ts('View Contact'), @@ -3036,7 +3036,7 @@ AND civicrm_openid.is_primary = 1"; * @access public * @static */ - static function getMasterDisplayName($masterAddressId = NULL, $contactId = NULL) { + public static function getMasterDisplayName($masterAddressId = NULL, $contactId = NULL) { $masterDisplayName = NULL; $sql = NULL; if (!$masterAddressId && !$contactId) { @@ -3067,7 +3067,7 @@ LEFT JOIN civicrm_address add2 ON ( add1.master_id = add2.id ) * * @return array('created_date' => $, 'modified_date' => $) */ - static function getTimestamps($contactId) { + public static function getTimestamps($contactId) { $timestamps = CRM_Core_DAO::executeQuery( 'SELECT created_date, modified_date FROM civicrm_contact @@ -3107,7 +3107,7 @@ LEFT JOIN civicrm_address add2 ON ( add1.master_id = add2.id ) * @access public * @static */ - static function generateTimestampTriggers(&$info, $reqTableName, $relatedTableNames, $contactRefColumn) { + public static function generateTimestampTriggers(&$info, $reqTableName, $relatedTableNames, $contactRefColumn) { // Safety $contactRefColumn = CRM_Core_DAO::escapeString($contactRefColumn); // If specific related table requested, just process that one @@ -3140,7 +3140,7 @@ LEFT JOIN civicrm_address add2 ON ( add1.master_id = add2.id ) * @see CRM_Core_DAO::triggerRebuild * @see http://issues.civicrm.org/jira/browse/CRM-10554 */ - static function triggerInfo(&$info, $tableName = NULL) { + public static function triggerInfo(&$info, $tableName = NULL) { //during upgrade, first check for valid version and then create triggers //i.e the columns created_date and modified_date are introduced in 4.3.alpha1 so dont create triggers for older version if (CRM_Core_Config::isUpgradeMode()) { @@ -3207,7 +3207,7 @@ LEFT JOIN civicrm_address add2 ON ( add1.master_id = add2.id ) * @access public * @static */ - static function checkDomainContact($contactId) { + public static function checkDomainContact($contactId) { if (!$contactId) return FALSE; $domainId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Domain', $contactId, 'id', 'contact_id'); diff --git a/CRM/Contact/BAO/Contact/Location.php b/CRM/Contact/BAO/Contact/Location.php index 22c09a0f9e..4952c741eb 100644 --- a/CRM/Contact/BAO/Contact/Location.php +++ b/CRM/Contact/BAO/Contact/Location.php @@ -46,7 +46,7 @@ class CRM_Contact_BAO_Contact_Location { * @static * @access public */ - static function getEmailDetails($id, $isPrimary = TRUE, $locationTypeID = NULL) { + public static function getEmailDetails($id, $isPrimary = TRUE, $locationTypeID = NULL) { $primaryClause = NULL; if ($isPrimary) { $primaryClause = " AND civicrm_email.is_primary = 1"; @@ -86,7 +86,7 @@ WHERE civicrm_contact.id = %1"; * @static * @access public */ - static function getPhoneDetails($id, $type = NULL) { + public static function getPhoneDetails($id, $type = NULL) { if (!$id) { return array(NULL, NULL); } @@ -126,7 +126,7 @@ LEFT JOIN civicrm_phone ON ( civicrm_phone.contact_id = civicrm_contact.id ) * @static * @access public */ - static function &getMapInfo($ids, $locationTypeID = NULL, $imageUrlOnly = FALSE) { + public static function &getMapInfo($ids, $locationTypeID = NULL, $imageUrlOnly = FALSE) { $idString = ' ( ' . implode(',', $ids) . ' ) '; $sql = " SELECT civicrm_contact.id as contact_id, diff --git a/CRM/Contact/BAO/Contact/Optimizer.php b/CRM/Contact/BAO/Contact/Optimizer.php index 2c803f9fd6..956766acb7 100644 --- a/CRM/Contact/BAO/Contact/Optimizer.php +++ b/CRM/Contact/BAO/Contact/Optimizer.php @@ -37,7 +37,7 @@ class CRM_Contact_BAO_Contact_Optimizer { * @param $newValues * @param $oldValues */ - static function edit( &$newValues, &$oldValues ) { + public static function edit( &$newValues, &$oldValues ) { // still need to do more work on this // CRM-10192 return; @@ -49,7 +49,7 @@ class CRM_Contact_BAO_Contact_Optimizer { * @param $newValues * @param $oldValues */ - static function website( &$newValues, &$oldValues ) { + public static function website( &$newValues, &$oldValues ) { $oldWebsiteValues = CRM_Utils_Array::value( 'website', $oldValues ); $newWebsiteValues = CRM_Utils_Array::value( 'website', $newValues ); @@ -112,7 +112,7 @@ class CRM_Contact_BAO_Contact_Optimizer { * @param $newValues * @param $oldValues */ - static function email( &$newValues, &$oldValues ) { + public static function email( &$newValues, &$oldValues ) { $oldEmailValues = CRM_Utils_Array::value( 'email', $oldValues ); $newEmailValues = CRM_Utils_Array::value( 'email', $newValues ); diff --git a/CRM/Contact/BAO/Contact/Permission.php b/CRM/Contact/BAO/Contact/Permission.php index 3c101c5199..783e65bf13 100644 --- a/CRM/Contact/BAO/Contact/Permission.php +++ b/CRM/Contact/BAO/Contact/Permission.php @@ -44,7 +44,7 @@ class CRM_Contact_BAO_Contact_Permission { * @access public * @static */ - static function allow($id, $type = CRM_Core_Permission::VIEW) { + public static function allow($id, $type = CRM_Core_Permission::VIEW) { $tables = array(); $whereTables = array(); @@ -91,7 +91,7 @@ WHERE contact_a.id = %1 AND $permission"; * @access public * @static */ - static function cache($userID, $type = CRM_Core_Permission::VIEW, $force = FALSE) { + public static function cache($userID, $type = CRM_Core_Permission::VIEW, $force = FALSE) { static $_processed = array(); if ($type = CRM_Core_Permission::VIEW) { @@ -194,7 +194,7 @@ AND $operationClause LIMIT 1"; * * @return array */ - static function cacheClause($contactAlias = 'contact_a', $contactID = NULL) { + public static function cacheClause($contactAlias = 'contact_a', $contactID = NULL) { if (CRM_Core_Permission::check('view all contacts') || CRM_Core_Permission::check('edit all contacts') ) { @@ -249,7 +249,7 @@ AND $operationClause LIMIT 1"; * selected contact record else false * @static */ - static function relationship($selectedContactID, $contactID = NULL) { + public static function relationship($selectedContactID, $contactID = NULL) { $session = CRM_Core_Session::singleton(); $config = CRM_Core_Config::singleton(); if (!$contactID) { @@ -337,7 +337,7 @@ WHERE (( contact_id_a = %1 AND contact_id_b = %2 AND is_permission_a_b = 1 ) OR * * @return bool */ - static function validateOnlyChecksum($contactID, &$form, $redirect = TRUE) { + 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) @@ -372,7 +372,7 @@ WHERE (( contact_id_a = %1 AND contact_id_b = %2 AND is_permission_a_b = 1 ) OR * @param bool $checkSumValidationResult * @param null $form */ - static function initChecksumAuthSrc($checkSumValidationResult = FALSE, $form = NULL) { + public static function initChecksumAuthSrc($checkSumValidationResult = FALSE, $form = NULL) { $session = CRM_Core_Session::singleton(); if ($checkSumValidationResult && $form && CRM_Utils_Request::retrieve('cs', 'String', $form, FALSE)) { // if result is already validated, and url has cs, set the flag. @@ -391,7 +391,7 @@ WHERE (( contact_id_a = %1 AND contact_id_b = %2 AND is_permission_a_b = 1 ) OR * * @return bool */ - static function validateChecksumContact($contactID, &$form, $redirect = TRUE) { + public static function validateChecksumContact($contactID, &$form, $redirect = TRUE) { if (!self::allow($contactID, CRM_Core_Permission::EDIT)) { // check if this is of the format cs=XXX return self::validateOnlyChecksum($contactID, $form, $redirect); diff --git a/CRM/Contact/BAO/Contact/Utils.php b/CRM/Contact/BAO/Contact/Utils.php index 713c772bc6..ef5f22fcd1 100644 --- a/CRM/Contact/BAO/Contact/Utils.php +++ b/CRM/Contact/BAO/Contact/Utils.php @@ -46,7 +46,7 @@ class CRM_Contact_BAO_Contact_Utils { * @access public * @static */ - static function getImage($contactType, $urlOnly = FALSE, $contactId = NULL, $addProfileOverlay = TRUE) { + public static function getImage($contactType, $urlOnly = FALSE, $contactId = NULL, $addProfileOverlay = TRUE) { static $imageInfo = array(); $contactType = explode(CRM_Core_DAO::VALUE_SEPARATOR, trim($contactType, CRM_Core_DAO::VALUE_SEPARATOR)); @@ -153,7 +153,7 @@ WHERE id IN ( $idString ) * @static * @access public */ - static function generateChecksum($entityId, $ts = NULL, $live = NULL, $hash = NULL, $entityType = 'contact', $hashSize = NULL) { + public static function generateChecksum($entityId, $ts = NULL, $live = NULL, $hash = NULL, $entityType = 'contact', $hashSize = NULL) { // return a warning message if we dont get a entityId // this typically happens when we do a message preview // or an anon mailing view - CRM-8298 @@ -221,7 +221,7 @@ WHERE id IN ( $idString ) * @static * @access public */ - static function validChecksum($contactID, $inputCheck) { + public static function validChecksum($contactID, $inputCheck) { $input = CRM_Utils_System::explode('_', $inputCheck, 3); @@ -254,7 +254,7 @@ WHERE id IN ( $idString ) * @static * @access public */ - static function maxLocations($contactId) { + public static function maxLocations($contactId) { $contactLocations = array(); // find number of location blocks for this contact and adjust value accordinly @@ -283,7 +283,7 @@ UNION * @access public * @static */ - static function createCurrentEmployerRelationship($contactID, $organization, $previousEmployerID = NULL, $newContact = FALSE) { + public static function createCurrentEmployerRelationship($contactID, $organization, $previousEmployerID = NULL, $newContact = FALSE) { //if organization name is passed. CRM-15368,CRM-15547 if ($organization && !is_numeric($organization)) { $organizationParams['organization_name'] = $organization; @@ -363,7 +363,7 @@ UNION * @access public * @static */ - static function currentEmployerRelatedMembership($contactID, $employerID, $relationshipParams, $duplicate = FALSE, $previousEmpID = NULL) { + public static function currentEmployerRelatedMembership($contactID, $employerID, $relationshipParams, $duplicate = FALSE, $previousEmpID = NULL) { $ids = array(); $action = CRM_Core_Action::ADD; @@ -395,7 +395,7 @@ UNION * @param array $currentEmployerParams associated array of contact id and its employer id * */ - static function setCurrentEmployer($currentEmployerParams) { + public static function setCurrentEmployer($currentEmployerParams) { foreach ($currentEmployerParams as $contactId => $orgId) { $query = "UPDATE civicrm_contact contact_a,civicrm_contact contact_b SET contact_a.employer_id=contact_b.id, contact_a.organization_name=contact_b.organization_name @@ -413,7 +413,7 @@ WHERE contact_a.id ={$contactId} AND contact_b.id={$orgId}; "; * @param int $organizationId current employer id * */ - static function updateCurrentEmployer($organizationId) { + public static function updateCurrentEmployer($organizationId) { $query = "UPDATE civicrm_contact contact_a,civicrm_contact contact_b SET contact_a.organization_name=contact_b.organization_name WHERE contact_a.employer_id=contact_b.id AND contact_b.id={$organizationId}; "; @@ -428,7 +428,7 @@ WHERE contact_a.employer_id=contact_b.id AND contact_b.id={$organizationId}; "; * @param int $employerId contact id ( mostly organization contact id) * */ - static function clearCurrentEmployer($contactId, $employerId = NULL) { + public static function clearCurrentEmployer($contactId, $employerId = NULL) { $query = "UPDATE civicrm_contact SET organization_name=NULL, employer_id = NULL WHERE id={$contactId}; "; @@ -478,7 +478,7 @@ WHERE id={$contactId}; "; * * @static */ - static function buildOnBehalfForm(&$form, $contactType, $countryID, $stateID, $title) { + public static function buildOnBehalfForm(&$form, $contactType, $countryID, $stateID, $title) { $config = CRM_Core_Config::singleton(); @@ -549,7 +549,7 @@ WHERE id={$contactId}; "; * @param int $employerId contact id of employer ( organization id ) * */ - static function clearAllEmployee($employerId) { + public static function clearAllEmployee($employerId) { $query = " UPDATE civicrm_contact SET organization_name=NULL, employer_id = NULL @@ -571,7 +571,7 @@ UPDATE civicrm_contact * @static * @access public */ - static function formatContactIDSToLinks($contactIDs, $addViewLink = TRUE, $addEditLink = TRUE, $originalId = NULL) { + public static function formatContactIDSToLinks($contactIDs, $addViewLink = TRUE, $addEditLink = TRUE, $originalId = NULL) { $contactLinks = array(); if (!is_array($contactIDs) || empty($contactIDs)) { return $contactLinks; @@ -674,7 +674,7 @@ LEFT JOIN civicrm_email ce ON ( ce.contact_id=c.id AND ce.is_primary = 1 ) * * @return array $contactDetails array of contact info.@static */ - static function contactDetails($componentIds, $componentName, $returnProperties = array()) { + public static function contactDetails($componentIds, $componentName, $returnProperties = array()) { $contactDetails = array(); if (empty($componentIds) || !in_array($componentName, array('CiviContribute', 'CiviMember', 'CiviEvent', 'Activity')) @@ -801,7 +801,7 @@ Group By componentId"; * @static * @access public */ - static function processSharedAddress(&$address) { + public static function processSharedAddress(&$address) { if (!is_array($address)) { return; } @@ -850,7 +850,7 @@ Group By componentId"; * * @return array $contactNames associated array of contact names@static */ - static function getAddressShareContactNames(&$addresses) { + public static function getAddressShareContactNames(&$addresses) { $contactNames = array(); // get the list of master id's for address $masterAddressIds = array(); @@ -889,7 +889,7 @@ Group By componentId"; * @return void * @static */ - static function clearContactCaches($contactID = NULL) { + public static function clearContactCaches($contactID = NULL) { // clear acl cache if any. CRM_ACL_BAO_Cache::resetCache(); @@ -1061,7 +1061,7 @@ WHERE id IN (" . implode(',', $contactIds) . ")"; * * @return int or null */ - static function defaultGreeting($contactType, $greetingType) { + public static function defaultGreeting($contactType, $greetingType) { $contactTypeFilters = array('Individual' => 1, 'Household' => 2, 'Organization' => 3); if (!isset($contactTypeFilters[$contactType])) { return; @@ -1100,7 +1100,7 @@ WHERE id IN (" . implode(',', $contactIds) . ")"; * @return void * @static */ - static function processGreetingTemplate(&$templateString, $contactDetails, $contactID, $className) { + public static function processGreetingTemplate(&$templateString, $contactDetails, $contactID, $className) { CRM_Utils_Token::replaceGreetingTokens($templateString, $contactDetails, $contactID, $className, TRUE); $smarty = CRM_Core_Smarty::singleton(); diff --git a/CRM/Contact/BAO/ContactType.php b/CRM/Contact/BAO/ContactType.php index 51955e1966..3ff4cdaeb4 100644 --- a/CRM/Contact/BAO/ContactType.php +++ b/CRM/Contact/BAO/ContactType.php @@ -44,7 +44,7 @@ class CRM_Contact_BAO_ContactType extends CRM_Contact_DAO_ContactType { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $contactType = new CRM_Contact_DAO_ContactType(); $contactType->copyValues($params); if ($contactType->find(TRUE)) { @@ -59,7 +59,7 @@ class CRM_Contact_BAO_ContactType extends CRM_Contact_DAO_ContactType { * * @return bool */ - static function isActive($contactType) { + public static function isActive($contactType) { $contact = self::contactTypeInfo(FALSE); $active = array_key_exists($contactType, $contact) ? TRUE : FALSE; return $active; @@ -73,7 +73,7 @@ class CRM_Contact_BAO_ContactType extends CRM_Contact_DAO_ContactType { * @return array of basic contact types information. * @static */ - static function &basicTypeInfo($all = FALSE) { + public static function &basicTypeInfo($all = FALSE) { static $_cache = NULL; if ($_cache === NULL) { @@ -119,7 +119,7 @@ WHERE parent_id IS NULL * @return array of basic contact types * @static */ - static function basicTypes($all = FALSE) { + public static function basicTypes($all = FALSE) { return array_keys(self::basicTypeInfo($all)); } @@ -129,7 +129,7 @@ WHERE parent_id IS NULL * * @return array */ - static function basicTypePairs($all = FALSE, $key = 'name') { + public static function basicTypePairs($all = FALSE, $key = 'name') { $subtypes = self::basicTypeInfo($all); $pairs = array(); @@ -151,7 +151,7 @@ WHERE parent_id IS NULL * @return array of sub type information * @static */ - static function &subTypeInfo($contactType = NULL, $all = FALSE, $ignoreCache = FALSE, $reset = FALSE) { + public static function &subTypeInfo($contactType = NULL, $all = FALSE, $ignoreCache = FALSE, $reset = FALSE) { static $_cache = NULL; if ($reset === TRUE) { @@ -220,7 +220,7 @@ WHERE subtype.name IS NOT NULL AND subtype.parent_id IS NOT NULL {$ctWHERE} *a given basic contact type * @static */ - static function subTypes($contactType = NULL, $all = FALSE, $columnName = 'name', $ignoreCache = FALSE) { + public static function subTypes($contactType = NULL, $all = FALSE, $columnName = 'name', $ignoreCache = FALSE) { if ($columnName == 'name') { return array_keys(self::subTypeInfo($contactType, $all, $ignoreCache)); } @@ -241,7 +241,7 @@ WHERE subtype.name IS NOT NULL AND subtype.parent_id IS NOT NULL {$ctWHERE} * @return list of subtypes with name as 'subtype-name' and 'label' as value * @static */ - static function subTypePairs($contactType = NULL, $all = FALSE, $labelPrefix = '- ', $ignoreCache = FALSE) { + public static function subTypePairs($contactType = NULL, $all = FALSE, $labelPrefix = '- ', $ignoreCache = FALSE) { $subtypes = self::subTypeInfo($contactType, $all, $ignoreCache); $pairs = array(); @@ -260,7 +260,7 @@ WHERE subtype.name IS NOT NULL AND subtype.parent_id IS NOT NULL {$ctWHERE} * @return array of basic types + all subtypes. * @static */ - static function contactTypes($all = FALSE) { + public static function contactTypes($all = FALSE) { return array_keys(self::contactTypeInfo($all)); } @@ -274,7 +274,7 @@ WHERE subtype.name IS NOT NULL AND subtype.parent_id IS NOT NULL {$ctWHERE} * @return array of basic types + all subtypes. * @static */ - static function contactTypeInfo($all = FALSE, $reset = FALSE) { + public static function contactTypeInfo($all = FALSE, $reset = FALSE) { static $_cache = NULL; if ($reset === TRUE) { @@ -334,7 +334,7 @@ WHERE type.name IS NOT NULL * @return array of basictypes with name as 'built-in name' and 'label' as value * @static */ - static function contactTypePairs($all = FALSE, $typeName = NULL, $delimiter = NULL) { + public static function contactTypePairs($all = FALSE, $typeName = NULL, $delimiter = NULL) { $types = self::contactTypeInfo($all); if ($typeName && !is_array($typeName)) { @@ -448,7 +448,7 @@ AND ( p.is_active = 1 OR p.id IS NULL ) * @return boolean true if subType, false otherwise. * @static */ - static function isaSubType($subType, $ignoreCache = FALSE) { + public static function isaSubType($subType, $ignoreCache = FALSE) { return in_array($subType, self::subTypes(NULL, TRUE, 'name', $ignoreCache)); } @@ -460,7 +460,7 @@ AND ( p.is_active = 1 OR p.id IS NULL ) *@static * */ - static function getBasicType($subType) { + public static function getBasicType($subType) { static $_cache = NULL; if ($_cache === NULL) { $_cache = array(); @@ -502,7 +502,7 @@ WHERE subtype.name IN ('" . implode("','", $subType) . "' )"; * @return array of suppressed subTypes. * @static */ - static function suppressSubTypes(&$subTypes, $ignoreCache = FALSE) { + public static function suppressSubTypes(&$subTypes, $ignoreCache = FALSE) { $subTypes = array_diff($subTypes, self::subTypes(NULL, TRUE, 'name', $ignoreCache)); return $subTypes; } @@ -518,7 +518,7 @@ WHERE subtype.name IN ('" . implode("','", $subType) . "' )"; * @return boolean true if contact extends, false otherwise. * @static */ - static function isExtendsContactType($subType, $contactType, $ignoreCache = FALSE, $columnName = 'name') { + public static function isExtendsContactType($subType, $contactType, $ignoreCache = FALSE, $columnName = 'name') { if (!is_array($subType)) { $subType = explode(CRM_Core_DAO::VALUE_SEPARATOR, trim($subType, CRM_Core_DAO::VALUE_SEPARATOR)); } @@ -533,7 +533,7 @@ WHERE subtype.name IN ('" . implode("','", $subType) . "' )"; * @return array of contactTypes * @static */ - static function getCreateNewList() { + public static function getCreateNewList() { $shortCuts = array(); //@todo FIXME - using the CRM_Core_DAO::VALUE_SEPARATOR creates invalid html - if you can find the form // this is loaded onto then replace with something like '__' & test @@ -573,7 +573,7 @@ WHERE subtype.name IN ('" . implode("','", $subType) . "' )"; * @access public * @static */ - static function del($contactTypeId) { + public static function del($contactTypeId) { if (!$contactTypeId) { return FALSE; @@ -626,7 +626,7 @@ WHERE name = %1"; * @access public * @static */ - static function add(&$params) { + public static function add(&$params) { // label or name if (empty($params['id']) && empty($params['label'])) { @@ -692,7 +692,7 @@ WHERE name = %1"; * @return Object DAO object on success, null otherwise * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { $params = array('id' => $id); self::retrieve($params, $contactinfo); $params = array('name' => "New $contactinfo[name]"); @@ -709,7 +709,7 @@ WHERE name = %1"; * * @return mixed */ - static function getLabel($typeName) { + public static function getLabel($typeName) { $types = self::contactTypeInfo(TRUE); if (array_key_exists($typeName, $types)) { @@ -729,7 +729,7 @@ WHERE name = %1"; * @return boolean true/false. * @static */ - static function isAllowEdit($contactId, $subType = NULL) { + public static function isAllowEdit($contactId, $subType = NULL) { if (!$contactId) { return TRUE; @@ -755,7 +755,7 @@ WHERE name = %1"; * * @return bool */ - static function hasCustomData($contactType, $contactId = NULL) { + public static function hasCustomData($contactType, $contactId = NULL) { $subTypeClause = ''; if (self::isaSubType($contactType)) { @@ -792,7 +792,7 @@ WHERE name = %1"; * * @return bool */ - static function hasRelationships($contactId, $contactType) { + public static function hasRelationships($contactId, $contactType) { $subTypeClause = NULL; if (self::isaSubType($contactType)) { $subType = $contactType; @@ -828,7 +828,7 @@ LIMIT 1"; * * @return array */ - static function getSubtypeCustomPair($contactType, $subtypeSet = array()) { + public static function getSubtypeCustomPair($contactType, $subtypeSet = array()) { if (empty($subtypeSet)) { return $subtypeSet; } @@ -923,7 +923,7 @@ WHERE ($subtypeClause)"; * @return void * @access public */ - function deleteCustomRowsForEntityID($customTable, $entityID) { + public function deleteCustomRowsForEntityID($customTable, $entityID) { $customTable = CRM_Utils_Type::escape($customTable, 'String'); $query = "DELETE FROM {$customTable} WHERE entity_id = %1"; return CRM_Core_DAO::singleValueQuery($query, array(1 => array($entityID, 'Integer'))); diff --git a/CRM/Contact/BAO/Group.php b/CRM/Contact/BAO/Group.php index 9a67ef3dc3..0e06b5b83c 100644 --- a/CRM/Contact/BAO/Group.php +++ b/CRM/Contact/BAO/Group.php @@ -37,7 +37,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -55,7 +55,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $group = new CRM_Contact_DAO_Group(); $group->copyValues($params); if ($group->find(TRUE)) { @@ -77,7 +77,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { * @static * */ - static function discard($id) { + public static function discard($id) { CRM_Utils_Hook::pre('delete', 'Group', $id, CRM_Core_DAO::$_nullArray); $transaction = new CRM_Core_Transaction(); @@ -145,7 +145,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { * Returns an array of the contacts in the given group. * */ - static function getGroupContacts($id) { + public static function getGroupContacts($id) { $params = array(array('group', 'IN', array($id => 1), 0, 0)); list($contacts, $_) = CRM_Contact_BAO_Query::apiQuery($params, array('contact_id')); return $contacts; @@ -162,7 +162,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { * @return int count of members in the group with above status * @access public */ - static function memberCount($id, $status = 'Added', $countChildGroups = FALSE) { + public static function memberCount($id, $status = 'Added', $countChildGroups = FALSE) { $groupContact = new CRM_Contact_DAO_GroupContact(); $groupIds = array($id); if ($countChildGroups) { @@ -208,7 +208,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { * @access public * @static */ - static function &getMember($groupID, $useCache = TRUE) { + public static function &getMember($groupID, $useCache = TRUE) { $params = array(array('group', 'IN', array($groupID => 1), 0, 0)); $returnProperties = array('contact_id'); list($contacts, $_) = CRM_Contact_BAO_Query::apiQuery($params, $returnProperties, NULL, NULL, 0, 0, $useCache); @@ -311,7 +311,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { * @access public * @static */ - static function checkPermission($id) { + public static function checkPermission($id) { $allGroups = CRM_Core_PseudoConstant::allGroup(); $permissions = NULL; @@ -506,7 +506,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { * Given a saved search compute the clause and the tables * and store it for future use */ - function buildClause() { + public function buildClause() { $params = array(array('group', 'IN', array($this->id => 1), 0, 0)); if (!empty($params)) { @@ -560,7 +560,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { * @return Object DAO object on sucess, null otherwise * @static */ - static function setIsActive($id, $isActive) { + public static function setIsActive($id, $isActive) { return CRM_Core_DAO::setFieldValue('CRM_Contact_DAO_Group', $id, 'is_active', $isActive); } @@ -573,7 +573,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { * @return string $condition * @static */ - static function groupTypeCondition($groupType = NULL, $excludeHidden = TRUE) { + public static function groupTypeCondition($groupType = NULL, $excludeHidden = TRUE) { $value = NULL; if ($groupType == 'Mailing') { $value = CRM_Core_DAO::VALUE_SEPARATOR . '2' . CRM_Core_DAO::VALUE_SEPARATOR; @@ -646,7 +646,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { * @access public * @static */ - static function createHiddenSmartGroup($params) { + public static function createHiddenSmartGroup($params) { $ssId = CRM_Utils_Array::value('saved_search_id', $params); //add mapping record only for search builder saved search @@ -784,7 +784,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { * @return array * @access public */ - static function getGroupList(&$params) { + public static function getGroupList(&$params) { $config = CRM_Core_Config::singleton(); $whereClause = self::whereClause($params, FALSE); @@ -1119,7 +1119,7 @@ WHERE id IN $groupIdString * * @return null|string */ - static function getGroupCount(&$params) { + public static function getGroupCount(&$params) { $whereClause = self::whereClause($params, FALSE); $query = "SELECT COUNT(*) FROM civicrm_group groups"; @@ -1141,7 +1141,7 @@ WHERE {$whereClause}"; * * @return string */ - static function whereClause(&$params, $sortBy = TRUE, $excludeHidden = TRUE) { + public static function whereClause(&$params, $sortBy = TRUE, $excludeHidden = TRUE) { $values = array(); $title = CRM_Utils_Array::value('title', $params); if ($title) { @@ -1231,7 +1231,7 @@ WHERE {$whereClause}"; * @return array $links array of action links * @access public */ - static function actionLinks() { + public static function actionLinks() { $links = array( CRM_Core_Action::VIEW => array( 'name' => ts('Contacts'), @@ -1272,7 +1272,7 @@ WHERE {$whereClause}"; * * @return string */ - function pagerAtoZ($whereClause, $whereParams) { + public function pagerAtoZ($whereClause, $whereParams) { $query = " SELECT DISTINCT UPPER(LEFT(groups.title, 1)) as sort_name FROM civicrm_group groups diff --git a/CRM/Contact/BAO/GroupContact.php b/CRM/Contact/BAO/GroupContact.php index 6fba2cb727..3d5d07fc08 100644 --- a/CRM/Contact/BAO/GroupContact.php +++ b/CRM/Contact/BAO/GroupContact.php @@ -37,7 +37,7 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -54,7 +54,7 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact { * @access public * @static */ - static function add(&$params) { + public static function add(&$params) { $dataExists = self::dataExists($params); if (!$dataExists) { @@ -77,7 +77,7 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact { * @access public * @static */ - static function dataExists(&$params) { + public static function dataExists(&$params) { // return if no data present if ($params['group_id'] == 0) { return FALSE; @@ -97,7 +97,7 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact { * @access public * @static */ - static function getValues(&$params, &$values) { + public static function getValues(&$params, &$values) { if (empty($params)) { return NULL; } @@ -277,7 +277,7 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact { * @return array $values this array has key-> group id and value group title * @static */ - static function getGroupList($contactId = 0, $visibility = FALSE) { + public static function getGroupList($contactId = 0, $visibility = FALSE) { $group = new CRM_Contact_DAO_Group(); $select = $from = $where = ''; @@ -450,7 +450,7 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact { * @access public * @static */ - static function getMembershipDetail($contactId, $groupID, $method = 'Email') { + public static function getMembershipDetail($contactId, $groupID, $method = 'Email') { $leftJoin = $where = $orderBy = null; if ($method) { @@ -491,7 +491,7 @@ SELECT * * @access public * @static */ - static function getGroupId($groupContactID) { + public static function getGroupId($groupContactID) { $dao = new CRM_Contact_DAO_GroupContact(); $dao->id = $groupContactID; $dao->find(TRUE); @@ -513,7 +513,7 @@ SELECT * * @access public * @static */ - static function create(&$params, $contactId, $visibility = FALSE, $method = 'Admin') { + public static function create(&$params, $contactId, $visibility = FALSE, $method = 'Admin') { $contactIds = array(); $contactIds[] = $contactId; @@ -567,7 +567,7 @@ SELECT * * * @return bool */ - static function isContactInGroup($contactID, $groupID) { + public static function isContactInGroup($contactID, $groupID) { if (!CRM_Utils_Rule::positiveInteger($contactID) || !CRM_Utils_Rule::positiveInteger($groupID) ) { @@ -600,7 +600,7 @@ SELECT * * @return void. * @static */ - static function mergeGroupContact($mainContactId, $otherContactId) { + public static function mergeGroupContact($mainContactId, $otherContactId) { $params = array(1 => array($mainContactId, 'Integer'), 2 => array($otherContactId, 'Integer'), ); diff --git a/CRM/Contact/BAO/GroupContactCache.php b/CRM/Contact/BAO/GroupContactCache.php index fa87d86d65..0463c5be3c 100644 --- a/CRM/Contact/BAO/GroupContactCache.php +++ b/CRM/Contact/BAO/GroupContactCache.php @@ -44,7 +44,7 @@ class CRM_Contact_BAO_GroupContactCache extends CRM_Contact_DAO_GroupContactCach * * @return boolean true if we did not regenerate, false if we did */ - static function check($groupIDs) { + public static function check($groupIDs) { if (empty($groupIDs)) { return TRUE; } @@ -63,7 +63,7 @@ class CRM_Contact_BAO_GroupContactCache extends CRM_Contact_DAO_GroupContactCach * @static * @public */ - static function groupRefreshedClause($groupIDClause = null, $includeHiddenGroups = FALSE) { + public static function groupRefreshedClause($groupIDClause = null, $includeHiddenGroups = FALSE) { $smartGroupCacheTimeout = self::smartGroupCacheTimeout(); $now = CRM_Utils_Date::getUTCTime(); @@ -101,7 +101,7 @@ AND ( g.cache_date IS NULL OR * @static * @public */ - static function shouldGroupBeRefreshed($groupID, $includeHiddenGroups = FALSE) { + public static function shouldGroupBeRefreshed($groupID, $includeHiddenGroups = FALSE) { $query = self::groupRefreshedClause("g.id = %1", $includeHiddenGroups); $params = array(1 => array($groupID, 'Integer')); @@ -119,7 +119,7 @@ AND ( g.cache_date IS NULL OR * * @return boolean true if we did not regenerate, false if we did */ - static function loadAll($groupIDs = null, $limit = 0) { + public static function loadAll($groupIDs = null, $limit = 0) { // ensure that all the smart groups are loaded // this function is expensive and should be sparingly used if groupIDs is empty if (empty($groupIDs)) { @@ -191,7 +191,7 @@ AND g.refresh_date IS NULL /** * FIXME: This function should not be needed, because the cache table should not be getting truncated */ - static function fillIfEmpty() { + public static function fillIfEmpty() { if (!CRM_Core_DAO::singleValueQuery("SELECT COUNT(id) FROM civicrm_group_contact_cache")) { self::loadAll(); } @@ -200,7 +200,7 @@ AND g.refresh_date IS NULL /** * @param int $groupID */ - static function add($groupID) { + public static function add($groupID) { // first delete the current cache self::remove($groupID); if (!is_array($groupID)) { @@ -219,7 +219,7 @@ AND g.refresh_date IS NULL * @param int $groupID * @param $values */ - static function store(&$groupID, &$values) { + public static function store(&$groupID, &$values) { $processed = FALSE; // sort the values so we put group IDs in front and hence optimize @@ -243,7 +243,7 @@ AND g.refresh_date IS NULL * @param $groupID array(int) * @param $processed bool, whether the cache data was recently modified */ - static function updateCacheTime($groupID, $processed) { + public static function updateCacheTime($groupID, $processed) { // only update cache entry if we had any values if ($processed) { // also update the group with cache date information @@ -280,7 +280,7 @@ WHERE id IN ( $groupIDs ) * @return void * @static */ - static function remove($groupID = NULL, $onceOnly = TRUE) { + public static function remove($groupID = NULL, $onceOnly = TRUE) { static $invoked = FALSE; // typically this needs to happy only once per instance @@ -390,7 +390,7 @@ WHERE id = %1 * @param int $groupId * @return bool - true if successful */ - static function removeContact($cid, $groupId = NULL) { + public static function removeContact($cid, $groupId = NULL) { $cids = array(); // sanitize input foreach ((array) $cid as $c) { @@ -415,7 +415,7 @@ WHERE id = %1 * @param boolean $force - should we force a search through * */ - static function load(&$group, $force = FALSE) { + public static function load(&$group, $force = FALSE) { $groupID = $group->id; $savedSearchID = $group->saved_search_id; if (array_key_exists($groupID, self::$_alreadyLoaded) && !$force) { @@ -575,7 +575,7 @@ AND civicrm_group_contact.group_id = $groupID "; /** * @return int */ - static function smartGroupCacheTimeout() { + public static function smartGroupCacheTimeout() { $config = CRM_Core_Config::singleton(); if ( @@ -599,7 +599,7 @@ AND civicrm_group_contact.group_id = $groupID "; * * @return array an array of groups that this contact belongs to */ - static function contactGroup($contactID, $showHidden = FALSE) { + public static function contactGroup($contactID, $showHidden = FALSE) { if (empty($contactID)) { return; } diff --git a/CRM/Contact/BAO/GroupNesting.php b/CRM/Contact/BAO/GroupNesting.php index 6b74585503..29da90f055 100644 --- a/CRM/Contact/BAO/GroupNesting.php +++ b/CRM/Contact/BAO/GroupNesting.php @@ -52,7 +52,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen /** * Class constructor */ - function __construct($styleLabels = FALSE, $styleIndent = " -- ") { + public function __construct($styleLabels = FALSE, $styleIndent = " -- ") { parent::__construct(); $this->_styleLabels = $styleLabels; $this->_styleIndent = $styleIndent; @@ -61,7 +61,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen /** * @param $sortOrder */ - function setSortOrder($sortOrder) { + public function setSortOrder($sortOrder) { switch ($sortOrder) { case 'ASC': case 'DESC': @@ -79,14 +79,14 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen /** * @return string */ - function getSortOrder() { + public function getSortOrder() { return self::$_sortOrder; } /** * @return int */ - function getCurrentNestingLevel() { + public function getCurrentNestingLevel() { return count($this->_parentStack); } @@ -95,7 +95,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * which is the first group (according to _sortOrder) that * has no parent groups */ - function rewind() { + public function rewind() { $this->_parentStack = array(); // calling _getNextParentlessGroup w/ no arguments // makes it return the first parentless group @@ -105,7 +105,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen $this->_alreadyStyled = FALSE; } - function current() { + public function current() { if ($this->_styleLabels && $this->valid() && !$this->_alreadyStyled @@ -127,7 +127,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen /** * @return string */ - function key() { + public function key() { $group = &$this->_current; $ids = array(); foreach ($this->_parentStack as $parentGroup) { @@ -144,7 +144,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen /** * @return CRM_Contact_BAO_Group|null */ - function next() { + public function next() { $currentGroup = &$this->_current; $childGroup = $this->_getNextChildGroup($currentGroup); if ($childGroup) { @@ -178,7 +178,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen /** * @return bool */ - function valid() { + public function valid() { if ($this->_current) { return TRUE; } @@ -192,7 +192,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * * @return CRM_Contact_BAO_Group|null */ - function _getNextParentlessGroup(&$group = NULL) { + public function _getNextParentlessGroup(&$group = NULL) { $lastParentlessGroup = $this->_lastParentlessGroup; $nextGroup = new CRM_Contact_BAO_Group(); $nextGroup->order_by = 'title ' . self::$_sortOrder; @@ -220,7 +220,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * * @return CRM_Contact_BAO_Group|null */ - function _getNextChildGroup(&$parentGroup, &$group = NULL) { + public function _getNextChildGroup(&$parentGroup, &$group = NULL) { $children = self::getChildGroupIds($parentGroup->id); if (count($children) > 0) { // we have child groups, so get the first one based on _sortOrder @@ -251,7 +251,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * * @return CRM_Contact_BAO_Group|null */ - function _getNextSiblingGroup(&$group) { + public function _getNextSiblingGroup(&$group) { $parentGroup = end($this->_parentStack); if ($parentGroup) { $nextGroup = $this->_getNextChildGroup($parentGroup, $group); @@ -284,7 +284,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * @return void * @access public */ - static function add($parentID, $childID) { + public static function add($parentID, $childID) { // TODO: Add checks here to make sure invalid nests can't be created $dao = new CRM_Contact_DAO_GroupNesting(); $query = "REPLACE INTO civicrm_group_nesting (child_group_id, parent_group_id) VALUES ($childID,$parentID);"; @@ -303,7 +303,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * * @access public */ - static function remove($parentID, $childID) { + public static function remove($parentID, $childID) { $dao = new CRM_Contact_DAO_GroupNesting(); $query = "DELETE FROM civicrm_group_nesting WHERE child_group_id = $childID AND parent_group_id = $parentID"; $dao->query($query); @@ -320,7 +320,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * * @access public */ - static function removeAllParentForChild($childID) { + public static function removeAllParentForChild($childID) { $dao = new CRM_Contact_DAO_GroupNesting(); $query = "DELETE FROM civicrm_group_nesting WHERE child_group_id = $childID"; $dao->query($query); @@ -337,7 +337,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * * @access public */ - static function isParentChild($parentID, $childID) { + public static function isParentChild($parentID, $childID) { $dao = new CRM_Contact_DAO_GroupNesting(); $query = "SELECT id FROM civicrm_group_nesting WHERE child_group_id = $childID AND parent_group_id = $parentID"; $dao->query($query); @@ -357,7 +357,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * * @access public */ - static function hasChildGroups($groupId) { + public static function hasChildGroups($groupId) { $dao = new CRM_Contact_DAO_GroupNesting(); $query = "SELECT child_group_id FROM civicrm_group_nesting WHERE parent_group_id = $groupId LIMIT 1"; //print $query . "\n

"; @@ -378,7 +378,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * * @access public */ - static function hasParentGroups($groupId) { + public static function hasParentGroups($groupId) { $dao = new CRM_Contact_DAO_GroupNesting(); $query = "SELECT parent_group_id FROM civicrm_group_nesting WHERE child_group_id = $groupId LIMIT 1"; $dao->query($query); @@ -399,7 +399,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * * @access public */ - static function isParentGroup($groupIds, $checkGroupId) { + public static function isParentGroup($groupIds, $checkGroupId) { if (!is_array($groupIds)) { $groupIds = array($groupIds); } @@ -430,7 +430,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * * @access public */ - static function isChildGroup($groupIds, $checkGroupId) { + public static function isChildGroup($groupIds, $checkGroupId) { if (!is_array($groupIds)) { $groupIds = array($groupIds); @@ -463,7 +463,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * * @access public */ - static function isAncestorGroup($groupIds, $checkGroupId) { + public static function isAncestorGroup($groupIds, $checkGroupId) { if (!is_array($groupIds)) { $groupIds = array($groupIds); } @@ -503,7 +503,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * * @access public */ - static function isDescendentGroup($groupIds, $checkGroupId) { + public static function isDescendentGroup($groupIds, $checkGroupId) { if (!is_array($groupIds)) { $groupIds = array($groupIds); } @@ -541,7 +541,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * * @return array $groupIdArray List of groupIds that represent the requested group and its ancestors@access public */ - static function getAncestorGroupIds($groupIds, $includeSelf = TRUE) { + public static function getAncestorGroupIds($groupIds, $includeSelf = TRUE) { if (!is_array($groupIds)) { $groupIds = array($groupIds); } @@ -576,7 +576,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * @param bool $includeSelf * @return \An $groupArray List of ancestor groups@access public */ - static function getAncestorGroups($groupIds, $includeSelf = TRUE) { + public static function getAncestorGroups($groupIds, $includeSelf = TRUE) { $groupIds = self::getAncestorGroupIds($groupIds, $includeSelf); $params['id'] = $groupIds; return CRM_Contact_BAO_Group::getGroups($params); @@ -589,7 +589,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * * @return array $groupIdArray List of groupIds that represent the requested group and its children@access public */ - static function getChildGroupIds($groupIds) { + public static function getChildGroupIds($groupIds) { if (!is_array($groupIds)) { $groupIds = array($groupIds); } @@ -610,7 +610,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * * @return array $groupIdArray List of groupIds that represent the requested group and its parents@access public */ - static function getParentGroupIds($groupIds) { + public static function getParentGroupIds($groupIds) { if (!is_array($groupIds)) { $groupIds = array($groupIds); } @@ -632,7 +632,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * @param bool $includeSelf * @return array $groupIdArray List of groupIds that represent the requested group and its descendents@access public */ - static function getDescendentGroupIds($groupIds, $includeSelf = TRUE) { + public static function getDescendentGroupIds($groupIds, $includeSelf = TRUE) { if (!is_array($groupIds)) { $groupIds = array($groupIds); } @@ -665,7 +665,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * @param bool $includeSelf * @return \An $groupArray List of descendent groups@access public */ - static function getDescendentGroups($groupIds, $includeSelf = TRUE) { + public static function getDescendentGroups($groupIds, $includeSelf = TRUE) { $groupIds = self::getDescendentGroupIds($groupIds, $includeSelf); $params['id'] = $groupIds; return CRM_Contact_BAO_Group::getGroups($params); @@ -678,7 +678,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * * @return array $groupIdArray List of groupIds that represent the valid potential children of the group@access public */ - static function getPotentialChildGroupIds($groupId) { + public static function getPotentialChildGroupIds($groupId) { $groups = CRM_Contact_BAO_Group::getGroups(); $potentialChildGroupIds = array(); foreach ($groups as $group) { @@ -700,7 +700,7 @@ class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting implemen * * @return array */ - static function getContainingGroups($contactId, $parentGroupId) { + public static function getContainingGroups($contactId, $parentGroupId) { $groups = CRM_Contact_BAO_Group::getGroups(); $containingGroups = array(); foreach ($groups as $group) { diff --git a/CRM/Contact/BAO/GroupNestingCache.php b/CRM/Contact/BAO/GroupNestingCache.php index 4e02a079a3..f8ddc512ab 100644 --- a/CRM/Contact/BAO/GroupNestingCache.php +++ b/CRM/Contact/BAO/GroupNestingCache.php @@ -102,7 +102,7 @@ WHERE id = $id * * @return bool */ - static function checkCyclicGraph(&$tree) { + public static function checkCyclicGraph(&$tree) { // lets keep this simple, we should probably use a graph algoritm here at some stage // foreach group that has a parent or a child, ensure that @@ -122,7 +122,7 @@ WHERE id = $id * * @return bool */ - static function isCyclic(&$tree, $id) { + public static function isCyclic(&$tree, $id) { $parents = $children = array(); self::getAll($parent, $tree, $id, 'parents'); self::getAll($child, $tree, $id, 'children'); @@ -146,7 +146,7 @@ WHERE id = $id * * @return array */ - static function getPotentialCandidates($id, &$groups) { + public static function getPotentialCandidates($id, &$groups) { $tree = CRM_Core_BAO_Cache::getItem('contact groups', 'nestable tree hierarchy'); if ($tree === NULL) { @@ -171,7 +171,7 @@ WHERE id = $id * @param int $id * @param $token */ - static function invalidate(&$potential, &$tree, $id, $token) { + public static function invalidate(&$potential, &$tree, $id, $token) { unset($potential[$id]); if (!isset($tree[$id]) || @@ -191,7 +191,7 @@ WHERE id = $id * @param int $id * @param $token */ - static function getAll(&$all, &$tree, $id, $token) { + public static function getAll(&$all, &$tree, $id, $token) { // if seen before, dont do anything if (isset($all[$id])) { return; @@ -212,7 +212,7 @@ WHERE id = $id /** * @return string */ - static function json() { + public static function json() { $tree = CRM_Core_BAO_Cache::getItem('contact groups', 'nestable tree hierarchy'); if ($tree === NULL) { diff --git a/CRM/Contact/BAO/GroupOrganization.php b/CRM/Contact/BAO/GroupOrganization.php index 1a7c6971cb..e46a56e14b 100644 --- a/CRM/Contact/BAO/GroupOrganization.php +++ b/CRM/Contact/BAO/GroupOrganization.php @@ -37,7 +37,7 @@ class CRM_Contact_BAO_GroupOrganization extends CRM_Contact_DAO_GroupOrganizatio /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -50,7 +50,7 @@ class CRM_Contact_BAO_GroupOrganization extends CRM_Contact_DAO_GroupOrganizatio * @access public * @static */ - static function add(&$params) { + public static function add(&$params) { $formattedValues = array(); self::formatValues($params, $formattedValues); $dataExists = self::dataExists($formattedValues); @@ -76,7 +76,7 @@ class CRM_Contact_BAO_GroupOrganization extends CRM_Contact_DAO_GroupOrganizatio * @access public * @static */ - static function formatValues(&$params, &$formatedValues) { + public static function formatValues(&$params, &$formatedValues) { if (!empty($params['group_organization'])) { $formatedValues['id'] = $params['group_organization']; } @@ -99,7 +99,7 @@ class CRM_Contact_BAO_GroupOrganization extends CRM_Contact_DAO_GroupOrganizatio * @access public * @static */ - static function dataExists($params) { + public static function dataExists($params) { // return if no data present if (!empty($params['organization_id']) && !empty($params['group_id'])) { return TRUE; @@ -111,7 +111,7 @@ class CRM_Contact_BAO_GroupOrganization extends CRM_Contact_DAO_GroupOrganizatio * @param int $groupID * @param $defaults */ - static function retrieve($groupID, &$defaults) { + public static function retrieve($groupID, &$defaults) { $dao = new CRM_Contact_DAO_GroupOrganization(); $dao->group_id = $groupID; if ($dao->find(TRUE)) { @@ -129,7 +129,7 @@ class CRM_Contact_BAO_GroupOrganization extends CRM_Contact_DAO_GroupOrganizatio * @access public * @static */ - static function hasGroupAssociated($contactID) { + public static function hasGroupAssociated($contactID) { $orgID = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_GroupOrganization', $contactID, 'group_id', 'organization_id' ); @@ -146,7 +146,7 @@ class CRM_Contact_BAO_GroupOrganization extends CRM_Contact_DAO_GroupOrganizatio * * @return mixed|null $results no of deleted group organization on success, false otherwise@access public */ - static function deleteGroupOrganization($groupOrganizationID) { + public static function deleteGroupOrganization($groupOrganizationID) { $results = NULL; $groupOrganization = new CRM_Contact_DAO_GroupOrganization(); $groupOrganization->id = $groupOrganizationID; diff --git a/CRM/Contact/BAO/Household.php b/CRM/Contact/BAO/Household.php index a5ff7aea55..10347479c3 100644 --- a/CRM/Contact/BAO/Household.php +++ b/CRM/Contact/BAO/Household.php @@ -37,7 +37,7 @@ class CRM_Contact_BAO_Household extends CRM_Contact_DAO_Contact { /** * This is a contructor of the class. */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -51,7 +51,7 @@ class CRM_Contact_BAO_Household extends CRM_Contact_DAO_Contact { * @access public * @static */ - static function updatePrimaryContact($primaryContactId, $contactId) { + public static function updatePrimaryContact($primaryContactId, $contactId) { $queryString = "UPDATE civicrm_contact SET primary_contact_id = "; diff --git a/CRM/Contact/BAO/Individual.php b/CRM/Contact/BAO/Individual.php index 131ef50b7a..27ad1351fd 100644 --- a/CRM/Contact/BAO/Individual.php +++ b/CRM/Contact/BAO/Individual.php @@ -41,7 +41,7 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact { /** * This is a contructor of the class. */ - function __construct() {} + public function __construct() {} /** * Function is used to format the individual contact values @@ -53,7 +53,7 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact { * @access public * @static */ - static function format(&$params, &$contact) { + public static function format(&$params, &$contact) { if (!self::dataExists($params)) { return; } @@ -340,7 +340,7 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact { * * @return void */ - static function updateDisplayNames(&$ids, $action) { + public static function updateDisplayNames(&$ids, $action) { // get the proper field name (prefix_id or suffix_id) and its value $fieldName = ''; foreach ($ids as $key => $value) { @@ -384,7 +384,7 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact { * * @return string the constructed display name */ - function displayName() { + public function displayName() { $prefix = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'prefix_id'); $suffix = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'suffix_id'); return str_replace(' ', ' ', trim($prefix[$this->prefix_id] . ' ' . $this->first_name . ' ' . $this->middle_name . ' ' . $this->last_name . ' ' . $suffix[$this->suffix_id])); @@ -399,7 +399,7 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact { * @access public * @static */ - static function dataExists(&$params) { + public static function dataExists(&$params) { if ($params['contact_type'] == 'Individual') { return TRUE; } diff --git a/CRM/Contact/BAO/ProximityQuery.php b/CRM/Contact/BAO/ProximityQuery.php index ad473ad20b..63b87e5538 100644 --- a/CRM/Contact/BAO/ProximityQuery.php +++ b/CRM/Contact/BAO/ProximityQuery.php @@ -59,7 +59,7 @@ class CRM_Contact_BAO_ProximityQuery { static protected $_earthRadiusSemiMajor; static protected $_earthEccentricitySQ; - static function initialize() { + public static function initialize() { static $_initialized = FALSE; if (!$_initialized) { @@ -84,7 +84,7 @@ class CRM_Contact_BAO_ProximityQuery { * Default to an approximate average radius for the United States. */ - static function earthRadius($latitude) { + public static function earthRadius($latitude) { $lat = deg2rad($latitude); $x = cos($lat) / self::$_earthRadiusSemiMajor; @@ -96,7 +96,7 @@ class CRM_Contact_BAO_ProximityQuery { * Convert longitude and latitude to earth-centered earth-fixed coordinates. * X axis is 0 long, 0 lat; Y axis is 90 deg E; Z axis is north pole. */ - static function earthXYZ($longitude, $latitude, $height = 0) { + public static function earthXYZ($longitude, $latitude, $height = 0) { $long = deg2rad($longitude); $lat = deg2rad($latitude); @@ -117,14 +117,14 @@ class CRM_Contact_BAO_ProximityQuery { /** * Convert a given angle to earth-surface distance. */ - static function earthArcLength($angle, $latitude) { + public static function earthArcLength($angle, $latitude) { return deg2rad($angle) * self::earthRadius($latitude); } /** * Estimate the min and max longitudes within $distance of a given location. */ - static function earthLongitudeRange($longitude, $latitude, $distance) { + public static function earthLongitudeRange($longitude, $latitude, $distance) { $long = deg2rad($longitude); $lat = deg2rad($latitude); $radius = self::earthRadius($latitude); @@ -150,7 +150,7 @@ class CRM_Contact_BAO_ProximityQuery { /** * Estimate the min and max latitudes within $distance of a given location. */ - static function earthLatitudeRange($longitude, $latitude, $distance) { + public static function earthLatitudeRange($longitude, $latitude, $distance) { $long = deg2rad($longitude); $lat = deg2rad($latitude); $radius = self::earthRadius($latitude); @@ -193,7 +193,7 @@ class CRM_Contact_BAO_ProximityQuery { * * @return string */ - static function where($latitude, $longitude, $distance, $tablePrefix = 'civicrm_address') { + public static function where($latitude, $longitude, $distance, $tablePrefix = 'civicrm_address') { self::initialize(); $params = array(); @@ -247,7 +247,7 @@ ACOS( * * @throws Exception */ - static function process(&$query, &$values) { + public static function process(&$query, &$values) { list($name, $op, $distance, $grouping, $wildcard) = $values; // also get values array for all address related info @@ -354,7 +354,7 @@ ACOS( /** * @param $input */ - static function fixInputParams(&$input) { + public static function fixInputParams(&$input) { foreach ($input as $param) { if (CRM_Utils_Array::value('0', $param) == 'prox_distance') { // add prox_ prefix to these diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 406a7bf6e4..1f4a161ef5 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -481,7 +481,7 @@ class CRM_Contact_BAO_Query { * @return void * @access private */ - function initialize() { + public function initialize() { $this->_select = array(); $this->_element = array(); $this->_tables = array(); @@ -519,7 +519,7 @@ class CRM_Contact_BAO_Query { $this->openedSearchPanes(TRUE); } - function buildParamsLookup() { + public function buildParamsLookup() { // first fix and handle contact deletion nicely // this code is primarily for search builder use case // where different clauses can specify if they want deleted @@ -588,7 +588,7 @@ class CRM_Contact_BAO_Query { * @return void * @access public */ - function addSpecialFields() { + public function addSpecialFields() { static $special = array('contact_type', 'contact_sub_type', 'sort_name', 'display_name'); foreach ($special as $name) { if (!empty($this->_returnProperties[$name])) { @@ -608,7 +608,7 @@ class CRM_Contact_BAO_Query { * @return void * @access public */ - function selectClause() { + public function selectClause() { $this->addSpecialFields(); @@ -915,7 +915,7 @@ class CRM_Contact_BAO_Query { * @return void * @access public */ - function addHierarchicalElements() { + public function addHierarchicalElements() { if (empty($this->_returnProperties['location'])) { return; } @@ -1239,7 +1239,7 @@ class CRM_Contact_BAO_Query { * @return void * @access public */ - function addMultipleElements() { + public function addMultipleElements() { if (empty($this->_returnProperties['website'])) { return; } @@ -1274,7 +1274,7 @@ class CRM_Contact_BAO_Query { * @return array sql query parts as an array * @access public */ - function query($count = FALSE, $sortByChar = FALSE, $groupContacts = FALSE, $onlyDeleted = FALSE) { + public function query($count = FALSE, $sortByChar = FALSE, $groupContacts = FALSE, $onlyDeleted = FALSE) { // build permission clause $this->generatePermissionClause($onlyDeleted, $count); @@ -1388,7 +1388,7 @@ class CRM_Contact_BAO_Query { * * @return null */ - function &getWhereValues($name, $grouping) { + public function &getWhereValues($name, $grouping) { $result = NULL; foreach ($this->_params as $values) { if ($values[0] == $name && $values[3] == $grouping) { @@ -1404,7 +1404,7 @@ class CRM_Contact_BAO_Query { * @param $from * @param $to */ - static function fixDateValues($relative, &$from, &$to) { + public static function fixDateValues($relative, &$from, &$to) { if ($relative) { list($from, $to) = CRM_Utils_Date::getFromTo($relative, $from, $to); } @@ -1417,7 +1417,7 @@ class CRM_Contact_BAO_Query { * * @return array */ - static function convertFormValues(&$formValues, $wildcard = 0, $useEquals = FALSE) { + public static function convertFormValues(&$formValues, $wildcard = 0, $useEquals = FALSE) { $params = array(); if (empty($formValues)) { return $params; @@ -1487,7 +1487,7 @@ class CRM_Contact_BAO_Query { * * @return array|null */ - static function &fixWhereValues($id, &$values, $wildcard = 0, $useEquals = FALSE) { + public static function &fixWhereValues($id, &$values, $wildcard = 0, $useEquals = FALSE) { // skip a few search variables static $skipWhere = NULL; static $likeNames = NULL; @@ -1573,7 +1573,7 @@ class CRM_Contact_BAO_Query { /** * @param $values */ - function whereClauseSingle(&$values) { + public function whereClauseSingle(&$values) { // do not process custom fields or prefixed contact ids or component params if (CRM_Core_BAO_CustomField::getKeyID($values[0]) || (substr($values[0], 0, CRM_Core_Form::CB_PREFIX_LEN) == CRM_Core_Form::CB_PREFIX) || @@ -1804,7 +1804,7 @@ class CRM_Contact_BAO_Query { * @return string * @access public */ - function whereClause() { + public function whereClause() { $this->_where[0] = array(); $this->_qill[0] = array(); @@ -1889,7 +1889,7 @@ class CRM_Contact_BAO_Query { * * @throws Exception */ - function restWhere(&$values) { + public function restWhere(&$values) { $name = CRM_Utils_Array::value(0, $values); $op = CRM_Utils_Array::value(1, $values); $value = CRM_Utils_Array::value(2, $values); @@ -2220,7 +2220,7 @@ class CRM_Contact_BAO_Query { * @return array * @throws Exception */ - static function getLocationTableName(&$where, &$locType) { + public static function getLocationTableName(&$where, &$locType) { if (isset($locType[1]) && is_numeric($locType[1])) { list($tbName, $fldName) = explode(".", $where); @@ -2267,7 +2267,7 @@ class CRM_Contact_BAO_Query { * * @return array values for this query */ - function store($dao) { + public function store($dao) { $value = array(); foreach ($this->_element as $key => $dontCare) { @@ -2313,7 +2313,7 @@ class CRM_Contact_BAO_Query { * @return array * @access public */ - function tables() { + public function tables() { return $this->_tables; } @@ -2323,7 +2323,7 @@ class CRM_Contact_BAO_Query { * logic may have eroded * @return array */ - function whereTables() { + public function whereTables() { return $this->_whereTables; } @@ -2340,7 +2340,7 @@ class CRM_Contact_BAO_Query { * @access public * @static */ - static function getWhereClause($params, $fields, &$tables, &$whereTables, $strict = FALSE) { + public static function getWhereClause($params, $fields, &$tables, &$whereTables, $strict = FALSE) { $query = new CRM_Contact_BAO_Query($params, NULL, $fields, FALSE, $strict ); @@ -2366,7 +2366,7 @@ class CRM_Contact_BAO_Query { * @access public * @static */ - static function fromClause(&$tables, $inner = NULL, $right = NULL, $primaryLocation = TRUE, $mode = 1) { + public static function fromClause(&$tables, $inner = NULL, $right = NULL, $primaryLocation = TRUE, $mode = 1) { $from = ' FROM civicrm_contact contact_a'; if (empty($tables)) { @@ -2611,7 +2611,7 @@ class CRM_Contact_BAO_Query { * * @return void */ - function deletedContacts($values) { + public function deletedContacts($values) { list($_, $_, $value, $grouping, $_) = $values; if ($value) { // *prepend* to the relevant grouping as this is quite an important factor @@ -2627,7 +2627,7 @@ class CRM_Contact_BAO_Query { * @return void * @access public */ - function contactType(&$values) { + public function contactType(&$values) { list($name, $op, $value, $grouping, $wildcard) = $values; $subTypes = array(); @@ -2695,7 +2695,7 @@ class CRM_Contact_BAO_Query { * @return void * @access public */ - function contactSubType(&$values) { + public function contactSubType(&$values) { list($name, $op, $value, $grouping, $wildcard) = $values; $this->includeContactSubTypes($value, $grouping, $op); } @@ -2704,7 +2704,7 @@ class CRM_Contact_BAO_Query { * @param $value * @param $grouping */ - function includeContactSubTypes($value, $grouping, $op = 'LIKE') { + public function includeContactSubTypes($value, $grouping, $op = 'LIKE') { $clause = array(); $alias = "contact_a.contact_sub_type"; @@ -2742,7 +2742,7 @@ class CRM_Contact_BAO_Query { * @return void * @access public */ - function group(&$values) { + public function group(&$values) { list($name, $op, $value, $grouping, $wildcard) = $values; if (count($value) > 1) { @@ -2839,7 +2839,7 @@ class CRM_Contact_BAO_Query { * * @return array */ - function getGroupsFromTypeCriteria($value){ + public function getGroupsFromTypeCriteria($value){ $groupIds = array(); foreach ($value as $groupTypeValue) { $groupList = CRM_Core_PseudoConstant::group($groupTypeValue); @@ -2856,7 +2856,7 @@ class CRM_Contact_BAO_Query { * @return string|NULL * @access public */ - function savedSearch(&$values) { + public function savedSearch(&$values) { list($name, $op, $value, $grouping, $wildcard) = $values; return $this->addGroupContactCache(array_keys($value)); } @@ -2868,7 +2868,7 @@ class CRM_Contact_BAO_Query { * * @return null|string */ - function addGroupContactCache($groups, $tableAlias = NULL, $joinTable = "contact_a") { + public function addGroupContactCache($groups, $tableAlias = NULL, $joinTable = "contact_a") { $config = CRM_Core_Config::singleton(); // Find all the groups that are part of a saved search. @@ -2922,7 +2922,7 @@ WHERE id IN ( $groupIDs ) * @return void * @access public */ - function ufUser(&$values) { + public function ufUser(&$values) { list($name, $op, $value, $grouping, $wildcard) = $values; if ($value == 1) { @@ -2946,7 +2946,7 @@ WHERE id IN ( $groupIDs ) * @return void * @access public */ - function tagSearch(&$values) { + public function tagSearch(&$values) { list($name, $op, $value, $grouping, $wildcard) = $values; $op = "LIKE"; @@ -3014,7 +3014,7 @@ WHERE id IN ( $groupIDs ) * @return void * @access public */ - function tag(&$values) { + public function tag(&$values) { list($name, $op, $value, $grouping, $wildcard) = $values; $tagNames = CRM_Core_PseudoConstant::get('CRM_Core_DAO_EntityTag', 'tag_id', array('onlyActive' => FALSE)); @@ -3101,7 +3101,7 @@ WHERE id IN ( $groupIDs ) * @return void * @access public */ - function notes(&$values) { + public function notes(&$values) { list($name, $op, $value, $grouping, $wildcard) = $values; $noteOptionValues = $this->getWhereValues('note_option', $grouping); @@ -3148,7 +3148,7 @@ WHERE id IN ( $groupIDs ) * * @return bool */ - function nameNullOrEmptyOp($name, $op, $grouping) { + public function nameNullOrEmptyOp($name, $op, $grouping) { switch ( $op ) { case 'IS NULL': case 'IS NOT NULL': @@ -3179,7 +3179,7 @@ WHERE id IN ( $groupIDs ) * @return void * @access public */ - function sortName(&$values) { + public function sortName(&$values) { list($fieldName, $op, $value, $grouping, $wildcard) = $values; // handle IS NULL / IS NOT NULL / IS EMPTY / IS NOT EMPTY @@ -3266,7 +3266,7 @@ WHERE id IN ( $groupIDs ) * @return void * @access public */ - function email(&$values) { + public function email(&$values) { list($name, $op, $value, $grouping, $wildcard) = $values; $n = trim($value); @@ -3309,7 +3309,7 @@ WHERE id IN ( $groupIDs ) * @return void * @access public */ - function phone_numeric(&$values) { + public function phone_numeric(&$values) { list($name, $op, $value, $grouping, $wildcard) = $values; // Strip non-numeric characters; allow wildcards $number = preg_replace('/[^\d%]/', '', $value); @@ -3332,7 +3332,7 @@ WHERE id IN ( $groupIDs ) * @return void * @access public */ - function phone_option_group($values) { + public function phone_option_group($values) { list($name, $op, $value, $grouping, $wildcard) = $values; $option = ($name == 'phone_phone_type_id' ? 'phone_type_id' : 'location_type_id'); $options = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', $option); @@ -3350,7 +3350,7 @@ WHERE id IN ( $groupIDs ) * @return void * @access public */ - function street_address(&$values) { + public function street_address(&$values) { list($name, $op, $value, $grouping, $wildcard) = $values; if (!$op) { @@ -3385,7 +3385,7 @@ WHERE id IN ( $groupIDs ) * @return void * @access public */ - function street_number(&$values) { + public function street_number(&$values) { list($name, $op, $value, $grouping, $wildcard) = $values; if (!$op) { @@ -3420,7 +3420,7 @@ WHERE id IN ( $groupIDs ) * @return void * @access public */ - function sortByCharacter(&$values) { + public function sortByCharacter(&$values) { list($name, $op, $value, $grouping, $wildcard) = $values; $name = trim($value); @@ -3435,7 +3435,7 @@ WHERE id IN ( $groupIDs ) * @return void * @access public */ - function includeContactIDs() { + public function includeContactIDs() { if (!$this->_includeContactIds || empty($this->_params)) { return; } @@ -3459,7 +3459,7 @@ WHERE id IN ( $groupIDs ) * @return void * @access public */ - function postalCode(&$values) { + public function postalCode(&$values) { // skip if the fields dont have anything to do with postal_code if (empty($this->_fields['postal_code'])) { return; @@ -3502,7 +3502,7 @@ WHERE id IN ( $groupIDs ) * @return void * @access public */ - function locationType(&$values, $status = NULL) { + public function locationType(&$values, $status = NULL) { list($name, $op, $value, $grouping, $wildcard) = $values; if (is_array($value)) { @@ -3533,7 +3533,7 @@ WHERE id IN ( $groupIDs ) * * @return array */ - function country(&$values, $fromStateProvince = TRUE) { + public function country(&$values, $fromStateProvince = TRUE) { list($name, $op, $value, $grouping, $wildcard) = $values; if (!$fromStateProvince) { @@ -3622,7 +3622,7 @@ WHERE id IN ( $groupIDs ) * @return void * @access public */ - function county(&$values, $status = null) { + public function county(&$values, $status = null) { list($name, $op, $value, $grouping, $wildcard) = $values; if (! is_array($value)) { @@ -3691,7 +3691,7 @@ WHERE id IN ( $groupIDs ) * @return void * @access public */ - function stateProvince(&$values, $status = NULL) { + public function stateProvince(&$values, $status = NULL) { list($name, $op, $value, $grouping, $wildcard) = $values; // quick escape for IS NULL @@ -3785,7 +3785,7 @@ WHERE id IN ( $groupIDs ) * @return void * @access public */ - function changeLog(&$values) { + public function changeLog(&$values) { list($name, $op, $value, $grouping, $wildcard) = $values; $targetName = $this->getWhereValues('changed_by', $grouping); @@ -3804,7 +3804,7 @@ WHERE id IN ( $groupIDs ) /** * @param $values */ - function modifiedDates($values) { + public function modifiedDates($values) { $this->_useDistinct = TRUE; // CRM-11281, default to added date if not set @@ -3828,7 +3828,7 @@ WHERE id IN ( $groupIDs ) /** * @param $values */ - function demographics(&$values) { + public function demographics(&$values) { list($name, $op, $value, $grouping, $wildcard) = $values; if (($name == 'birth_date_low') || ($name == 'birth_date_high')) { @@ -3850,7 +3850,7 @@ WHERE id IN ( $groupIDs ) /** * @param $values */ - function privacy(&$values) { + public function privacy(&$values) { list($name, $op, $value, $grouping, $wildcard) = $values; //fixed for profile search listing CRM-4633 if (strpbrk($value, "[")) { @@ -3869,7 +3869,7 @@ WHERE id IN ( $groupIDs ) /** * @param $values */ - function privacyOptions($values) { + public function privacyOptions($values) { list($name, $op, $value, $grouping, $wildcard) = $values; if (empty($value) || !is_array($value)) { @@ -3909,7 +3909,7 @@ WHERE id IN ( $groupIDs ) /** * @param $values */ - function preferredCommunication(&$values) { + public function preferredCommunication(&$values) { list($name, $op, $value, $grouping, $wildcard) = $values; $pref = array(); @@ -3966,7 +3966,7 @@ WHERE id IN ( $groupIDs ) * @return void * @access public */ - function relationship(&$values) { + public function relationship(&$values) { list($name, $op, $value, $grouping, $wildcard) = $values; if ($this->_relationshipValuesAdded){ return; @@ -4155,7 +4155,7 @@ civicrm_relationship.is_permission_a_b = 0 * @param array $where = array to add where clauses to, in case you are generating a temp table * not the main query. */ - function addRelationshipDateClauses($grouping, &$where){ + public function addRelationshipDateClauses($grouping, &$where){ $dateValues = array(); $dateTypes = array( 'start_date', @@ -4186,7 +4186,7 @@ civicrm_relationship.is_permission_a_b = 0 * @return array derault return properties * @access public */ - static function &defaultReturnProperties($mode = 1) { + public static function &defaultReturnProperties($mode = 1) { if (!isset(self::$_defaultReturnProperties)) { self::$_defaultReturnProperties = array(); } @@ -4268,7 +4268,7 @@ civicrm_relationship.is_permission_a_b = 0 * @return string|NULL * @access public */ - static function getPrimaryCondition($value) { + public static function getPrimaryCondition($value) { if (is_numeric($value)) { $value = (int ) $value; return ($value == 1) ? 'is_primary = 1' : 'is_primary = 0'; @@ -4286,7 +4286,7 @@ civicrm_relationship.is_permission_a_b = 0 * @return string * @access public */ - static function getQuery($params = NULL, $returnProperties = NULL, $count = FALSE) { + public static function getQuery($params = NULL, $returnProperties = NULL, $count = FALSE) { $query = new CRM_Contact_BAO_Query($params, $returnProperties); list($select, $from, $where, $having) = $query->query(); @@ -4600,7 +4600,7 @@ civicrm_relationship.is_permission_a_b = 0 * @param bool $includeContactIds * @return CRM_Core_DAO */ - function getCachedContacts($cacheKey, $offset, $rowCount, $includeContactIds) { + public function getCachedContacts($cacheKey, $offset, $rowCount, $includeContactIds) { $this->_includeContactIds = $includeContactIds; $onlyDeleted = in_array(array('deleted_contacts', '=', '1', '0', '0'), $this->_params); list($select, $from, $where) = $this->query(FALSE, FALSE, FALSE, $onlyDeleted); @@ -4627,7 +4627,7 @@ civicrm_relationship.is_permission_a_b = 0 * * @return null */ - function generatePermissionClause($onlyDeleted = FALSE, $count = FALSE) { + public function generatePermissionClause($onlyDeleted = FALSE, $count = FALSE) { if (!$this->_skipPermission) { $this->_permissionWhereClause = CRM_ACL_API::whereClause( CRM_Core_Permission::VIEW, @@ -4669,7 +4669,7 @@ civicrm_relationship.is_permission_a_b = 0 /** * @param $val */ - function setSkipPermission($val) { + public function setSkipPermission($val) { $this->_skipPermission = $val; } @@ -4678,7 +4678,7 @@ civicrm_relationship.is_permission_a_b = 0 * * @return array */ - function &summaryContribution($context = NULL) { + public function &summaryContribution($context = NULL) { list($innerselect, $from, $where, $having) = $this->query(TRUE); // hack $select @@ -4812,7 +4812,7 @@ SELECT COUNT( conts.total_amount ) as cancel_count, * @return string * @access public */ - function qill() { + public function qill() { return $this->_qill; } @@ -4822,7 +4822,7 @@ SELECT COUNT( conts.total_amount ) as cancel_count, * @return array * @access public */ - static function &defaultHierReturnProperties() { + public static function &defaultHierReturnProperties() { if (!isset(self::$_defaultHierReturnProperties)) { self::$_defaultHierReturnProperties = array( 'home_URL' => 1, @@ -5109,7 +5109,7 @@ SELECT COUNT( conts.total_amount ) as cancel_count, * @return string where clause for the query * @access public */ - static function buildClause($field, $op, $value = NULL, $dataType = NULL) { + public static function buildClause($field, $op, $value = NULL, $dataType = NULL) { $op = trim($op); $clause = "$field $op"; @@ -5172,7 +5172,7 @@ SELECT COUNT( conts.total_amount ) as cancel_count, * * @return array */ - function openedSearchPanes($reset = FALSE) { + public function openedSearchPanes($reset = FALSE) { if (!$reset || empty($this->_whereTables)) { return self::$_openedPanes; } @@ -5206,7 +5206,7 @@ SELECT COUNT( conts.total_amount ) as cancel_count, /** * @param $operator */ - function setOperator($operator) { + public function setOperator($operator) { $validOperators = array('AND', 'OR'); if (!in_array($operator, $validOperators)) { $operator = 'AND'; @@ -5217,7 +5217,7 @@ SELECT COUNT( conts.total_amount ) as cancel_count, /** * @return string */ - function getOperator() { + public function getOperator() { return $this->_operator; } @@ -5226,7 +5226,7 @@ SELECT COUNT( conts.total_amount ) as cancel_count, * @param $where * @param $having */ - function filterRelatedContacts(&$from, &$where, &$having) { + public function filterRelatedContacts(&$from, &$where, &$having) { static $_rTypeProcessed = NULL; static $_rTypeFrom = NULL; static $_rTypeWhere = NULL; @@ -5302,7 +5302,7 @@ AND displayRelType.is_active = 1 * * @return bool */ - static function caseImportant( $op ) { + public static function caseImportant( $op ) { return in_array($op, array('LIKE', 'IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY')) ? FALSE : TRUE; } @@ -5313,7 +5313,7 @@ AND displayRelType.is_active = 1 * * @return bool */ - static function componentPresent( &$returnProperties, $prefix ) { + public static function componentPresent( &$returnProperties, $prefix ) { foreach ($returnProperties as $name => $dontCare ) { if (substr($name, 0, strlen($prefix)) == $prefix) { return TRUE; @@ -5416,7 +5416,7 @@ AND displayRelType.is_active = 1 * array of numeric values if string does match the pattern * @static */ - static function parseSearchBuilderString($string, $dataType = 'Integer') { + public static function parseSearchBuilderString($string, $dataType = 'Integer') { $string = trim($string); if (substr($string, 0, 1) != '(' || substr($string, -1, 1) != ')') { Return FALSE; @@ -5454,7 +5454,7 @@ AND displayRelType.is_active = 1 * * @return array */ - function convertToPseudoNames(&$dao, $return = FALSE) { + public function convertToPseudoNames(&$dao, $return = FALSE) { if (empty($this->_pseudoConstantsSelect)) { return; } @@ -5528,7 +5528,7 @@ AND displayRelType.is_active = 1 * * @return array */ - function includePseudoFieldsJoin($sort) { + public function includePseudoFieldsJoin($sort) { if (!$sort || empty($this->_pseudoConstantsSelect)) { return; } diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index 2be57a44ce..2a142ea003 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -54,7 +54,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { * @access public * @static */ - static function create(&$params, $ids = array()) { + public static function create(&$params, $ids = array()) { $valid = $invalid = $duplicate = $saved = 0; $relationships = $relationshipIds = array(); $relationshipId = CRM_Utils_Array::value('relationship', $ids, CRM_Utils_Array::value('id', $params)); @@ -198,7 +198,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { * @access public * @static */ - static function add(&$params, $ids = array(), $contactId = NULL) { + public static function add(&$params, $ids = array(), $contactId = NULL) { $relationshipId = CRM_Utils_Array::value('relationship', $ids, CRM_Utils_Array::value('id', $params)); @@ -272,7 +272,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { * @access public * @static */ - static function getdefaults() { + public static function getdefaults() { return array( 'is_active' => 0, 'is_permission_a_b' => 0, @@ -294,7 +294,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { * @access public * @static */ - static function dataExists(&$params) { + public static function dataExists(&$params) { // return if no data present if (!is_array(CRM_Utils_Array::value('contact_check', $params))) { return FALSE; @@ -415,7 +415,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { * * @return CRM_Contact_DAO_Relationship */ - static function clearCurrentEmployer($id, $action) { + public static function clearCurrentEmployer($id, $action) { $relationship = new CRM_Contact_DAO_Relationship(); $relationship->id = $id; $relationship->find(TRUE); @@ -448,7 +448,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { * * @static */ - static function del($id) { + public static function del($id) { // delete from relationship table CRM_Utils_Hook::pre('delete', 'Relationship', $id, CRM_Core_DAO::$_nullArray); @@ -498,7 +498,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { * @access public * @static */ - static function disableEnableRelationship($id, $action) { + public static function disableEnableRelationship($id, $action) { $relationship = self::clearCurrentEmployer($id, $action); if (CRM_Core_Permission::access('CiviMember')) { // create $params array which isrequired to delete memberships @@ -540,7 +540,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { * @access public * @static */ - static function deleteContact($contactId) { + public static function deleteContact($contactId) { $relationship = new CRM_Contact_DAO_Relationship(); $relationship->contact_id_a = $contactId; $relationship->delete(); @@ -563,7 +563,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { * @access public * @static */ - static function getContactIds($id) { + public static function getContactIds($id) { $relationship = new CRM_Contact_DAO_Relationship(); $relationship->id = $id; @@ -585,7 +585,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { * @access public * @static */ - static function checkRelationshipType($contact_a, $contact_b, $relationshipTypeId) { + public static function checkRelationshipType($contact_a, $contact_b, $relationshipTypeId) { $relationshipType = new CRM_Contact_DAO_RelationshipType(); $relationshipType->id = $relationshipTypeId; $relationshipType->selectAdd(); @@ -626,7 +626,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { @access public * @static */ - static function checkValidRelationship(&$params, &$ids, $contactId) { + public static function checkValidRelationship(&$params, &$ids, $contactId) { $errors = ''; // get the string of relationship type @@ -654,7 +654,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { * @access public * @static */ - static function checkDuplicateRelationship(&$params, $id, $contactId = 0, $relationshipId = 0) { + public static function checkDuplicateRelationship(&$params, $id, $contactId = 0, $relationshipId = 0) { $relationshipTypeId = CRM_Utils_Array::value('relationship_type_id', $params); list($type, $first, $second) = explode('_', $relationshipTypeId); @@ -729,7 +729,7 @@ WHERE relationship_type_id = " . CRM_Utils_Type::escape($type, 'Integer'); * @return Object DAO object on success, null otherwise * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { // as both the create & add functions have a bunch of logic in them that // doesn't seem to cope with a normal update we will call the api which // has tested handling for this @@ -763,7 +763,7 @@ WHERE relationship_type_id = " . CRM_Utils_Type::escape($type, 'Integer'); * @access public * @static */ - static function &getValues(&$params, &$values) { + public static function &getValues(&$params, &$values) { if (empty($params)) { return NULL; } @@ -804,7 +804,7 @@ WHERE relationship_type_id = " . CRM_Utils_Type::escape($type, 'Integer'); * @static * @access public */ - static function makeURLClause($contactId, $status, $numRelationship, $count, $relationshipId, $direction, $params = array()) { + public static function makeURLClause($contactId, $status, $numRelationship, $count, $relationshipId, $direction, $params = array()) { $select = $from = $where = ''; $select = '( '; @@ -1146,7 +1146,7 @@ LEFT JOIN civicrm_country ON (civicrm_address.country_id = civicrm_country.id) * @return array - array reference of all relationship types with context to current contact type . * */ - function getRelationType($targetContactType) { + public function getRelationType($targetContactType) { $relationshipType = array(); $allRelationshipType = CRM_Core_PseudoConstant::relationshipType(); @@ -1176,7 +1176,7 @@ LEFT JOIN civicrm_country ON (civicrm_address.country_id = civicrm_country.id) * * @static */ - static function relatedMemberships($contactId, &$params, $ids, $action = CRM_Core_Action::ADD, $active = TRUE) { + public static function relatedMemberships($contactId, &$params, $ids, $action = CRM_Core_Action::ADD, $active = TRUE) { // Check the end date and set the status of the relationship // accrodingly. $status = self::CURRENT; @@ -1391,7 +1391,7 @@ SELECT count(*) * @static * */ - static function isDeleteRelatedMembership($relTypeIds, $contactId, $mainRelatedContactId, $relTypeId, $relIds) { + public static function isDeleteRelatedMembership($relTypeIds, $contactId, $mainRelatedContactId, $relTypeId, $relIds) { if (in_array($relTypeId, $relTypeIds)) { return TRUE; } @@ -1428,7 +1428,7 @@ SELECT count(*) * * @return array $currentEmployer array of the current employer@static */ - static function getCurrentEmployer($contactIds) { + public static function getCurrentEmployer($contactIds) { $contacts = implode(',', $contactIds); $query = " @@ -1459,7 +1459,7 @@ WHERE id IN ( {$contacts} ) * @return array array of employers. * */ - static function getPermissionedEmployer($contactID, $name = NULL) { + public static function getPermissionedEmployer($contactID, $name = NULL) { //get the relationship id $relTypeId = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_RelationshipType', 'Employee of', 'id', 'name_a_b' @@ -1480,7 +1480,7 @@ WHERE id IN ( {$contacts} ) * * @return array of contacts */ - static function getPermissionedContacts($contactID, $relTypeId, $name = NULL) { + public static function getPermissionedContacts($contactID, $relTypeId, $name = NULL) { $contacts = array(); if ($relTypeId) { @@ -1527,7 +1527,7 @@ AND cc.sort_name LIKE '%$name%'"; * * @static */ - static function mergeRelationships($mainId, $otherId, &$sqls) { + public static function mergeRelationships($mainId, $otherId, &$sqls) { // Delete circular relationships $sqls[] = "DELETE FROM civicrm_relationship WHERE (contact_id_a = $mainId AND contact_id_b = $otherId) @@ -1561,7 +1561,7 @@ AND cc.sort_name LIKE '%$name%'"; * * @return True on success, false if error is encountered. */ - static function disableExpiredRelationships() { + public static function disableExpiredRelationships() { $query = "SELECT id FROM civicrm_relationship WHERE is_active = 1 AND end_date < CURDATE()"; $dao = CRM_Core_DAO::executeQuery($query); @@ -1586,7 +1586,7 @@ AND cc.sort_name LIKE '%$name%'"; * * @return array */ - static function membershipTypeToRelationshipTypes(&$params, $direction = NULL) { + 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')); $relationshipTypes = $membershipType['relationship_type_id']; if(empty($relationshipTypes)) { diff --git a/CRM/Contact/BAO/RelationshipType.php b/CRM/Contact/BAO/RelationshipType.php index 3081a8b612..37dc61530f 100644 --- a/CRM/Contact/BAO/RelationshipType.php +++ b/CRM/Contact/BAO/RelationshipType.php @@ -37,7 +37,7 @@ class CRM_Contact_BAO_RelationshipType extends CRM_Contact_DAO_RelationshipType /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -51,7 +51,7 @@ class CRM_Contact_BAO_RelationshipType extends CRM_Contact_DAO_RelationshipType * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $relationshipType = new CRM_Contact_DAO_RelationshipType(); $relationshipType->copyValues($params); if ($relationshipType->find(TRUE)) { @@ -71,7 +71,7 @@ class CRM_Contact_BAO_RelationshipType extends CRM_Contact_DAO_RelationshipType * @return Object DAO object on sucess, null otherwise * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Contact_DAO_RelationshipType', $id, 'is_active', $is_active); } @@ -86,7 +86,7 @@ class CRM_Contact_BAO_RelationshipType extends CRM_Contact_DAO_RelationshipType * @static * */ - static function add(&$params, &$ids) { + public static function add(&$params, &$ids) { //to change name, CRM-3336 if (empty($params['label_a_b']) && !empty($params['name_a_b'])) { $params['label_a_b'] = $params['name_a_b']; @@ -139,7 +139,7 @@ class CRM_Contact_BAO_RelationshipType extends CRM_Contact_DAO_RelationshipType * @return mixed * @static */ - static function del($relationshipTypeId) { + public static function del($relationshipTypeId) { // make sure relationshipTypeId is an integer // @todo review this as most delete functions rely on the api & form layer for this // or do a find first & throw error if no find diff --git a/CRM/Contact/BAO/SavedSearch.php b/CRM/Contact/BAO/SavedSearch.php index 0f32b4c343..1734763ddd 100644 --- a/CRM/Contact/BAO/SavedSearch.php +++ b/CRM/Contact/BAO/SavedSearch.php @@ -44,7 +44,7 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch { * * @return \CRM_Contact_BAO_SavedSearch CRM_Contact_BAO_SavedSearch */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -55,7 +55,7 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch { * * @access public */ - function getAll() { + public function getAll() { $savedSearch = new CRM_Contact_DAO_SavedSearch(); $savedSearch->selectAdd(); $savedSearch->selectAdd('id, name'); @@ -77,7 +77,7 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $savedSearch = new CRM_Contact_DAO_SavedSearch(); $savedSearch->copyValues($params); if ($savedSearch->find(TRUE)) { @@ -96,7 +96,7 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch { * @access public * @static */ - static function &getFormValues($id) { + public static function &getFormValues($id) { $fv = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $id, 'form_values'); $result = NULL; if ($fv) { @@ -135,7 +135,7 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch { * * @return array */ - static function getSearchParams($id) { + public static function getSearchParams($id) { $fv = self::getFormValues($id); //check if the saved search has mapping id if (CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $id, 'mapping_id')) { @@ -160,7 +160,7 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch { * @access public * @static */ - static function whereClause($id, &$tables, &$whereTables) { + public static function whereClause($id, &$tables, &$whereTables) { $params = self::getSearchParams($id); if ($params) { if (!empty($params['customSearchID'])) { @@ -177,7 +177,7 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch { * * @return string */ - static function contactIDsSQL($id) { + public static function contactIDsSQL($id) { $params = self::getSearchParams($id); if ($params && !empty($params['customSearchID'])) { return CRM_Contact_BAO_SearchCustom::contactIDSQL(NULL, $id); @@ -201,7 +201,7 @@ WHERE $where"; * * @return array */ - static function fromWhereEmail($id) { + public static function fromWhereEmail($id) { $params = self::getSearchParams($id); if ($params) { @@ -232,7 +232,7 @@ LEFT JOIN civicrm_email ON (contact_a.id = civicrm_email.contact_id AND civicrm_ * Given a saved search compute the clause and the tables * and store it for future use */ - function buildClause() { + public function buildClause() { $fv = unserialize($this->form_values); if ($this->mapping_id) { @@ -256,7 +256,7 @@ LEFT JOIN civicrm_email ON (contact_a.id = civicrm_email.contact_id AND civicrm_ return; } - function save() { + public function save() { // first build the computed fields $this->buildClause(); @@ -274,7 +274,7 @@ LEFT JOIN civicrm_email ON (contact_a.id = civicrm_email.contact_id AND civicrm_ * @access public * @static */ - static function getName($id, $value = 'name') { + public static function getName($id, $value = 'name') { $group = new CRM_Contact_DAO_Group(); $group->saved_search_id = $id; if ($group->find(TRUE)) { @@ -287,7 +287,7 @@ LEFT JOIN civicrm_email ON (contact_a.id = civicrm_email.contact_id AND civicrm_ * Given a label and a set of normalized POST * formValues, create a smart group with that */ - static function create(&$params) { + public static function create(&$params) { $savedSearch = new CRM_Contact_DAO_SavedSearch(); if (isset($params['formValues']) && !empty($params['formValues']) diff --git a/CRM/Contact/BAO/SearchCustom.php b/CRM/Contact/BAO/SearchCustom.php index 5fa1c86794..3f534af36a 100644 --- a/CRM/Contact/BAO/SearchCustom.php +++ b/CRM/Contact/BAO/SearchCustom.php @@ -42,7 +42,7 @@ class CRM_Contact_BAO_SearchCustom { * @return array * @throws Exception */ - static function details($csID, $ssID = NULL, $gID = NULL) { + public static function details($csID, $ssID = NULL, $gID = NULL) { $error = array(NULL, NULL, NULL); if (!$csID && @@ -106,7 +106,7 @@ class CRM_Contact_BAO_SearchCustom { * @return mixed * @throws Exception */ - static function customClass($csID, $ssID) { + public static function customClass($csID, $ssID) { list($customSearchID, $customSearchClass, $formValues) = self::details($csID, $ssID); if (!$customSearchID) { @@ -125,7 +125,7 @@ class CRM_Contact_BAO_SearchCustom { * * @return mixed */ - static function contactIDSQL($csID, $ssID) { + public static function contactIDSQL($csID, $ssID) { $customClass = self::customClass($csID, $ssID); return $customClass->contactIDs(); } @@ -135,7 +135,7 @@ class CRM_Contact_BAO_SearchCustom { * * @return array */ - static function &buildFormValues($args) { + public static function &buildFormValues($args) { $args = trim($args); $values = explode("\n", $args); @@ -155,7 +155,7 @@ class CRM_Contact_BAO_SearchCustom { * * @return array */ - static function fromWhereEmail($csID, $ssID) { + public static function fromWhereEmail($csID, $ssID) { $customClass = self::customClass($csID, $ssID); $from = $customClass->from(); diff --git a/CRM/Contact/BAO/SubscriptionHistory.php b/CRM/Contact/BAO/SubscriptionHistory.php index 258ed9c667..3f1924364e 100644 --- a/CRM/Contact/BAO/SubscriptionHistory.php +++ b/CRM/Contact/BAO/SubscriptionHistory.php @@ -46,7 +46,7 @@ class CRM_Contact_BAO_SubscriptionHistory extends CRM_Contact_DAO_SubscriptionHi /** * */ - function __construct() { + public function __construct() { parent::__construct(); } diff --git a/CRM/Contact/Controller/Search.php b/CRM/Contact/Controller/Search.php index ec7f0aa98f..c66637b5e7 100644 --- a/CRM/Contact/Controller/Search.php +++ b/CRM/Contact/Controller/Search.php @@ -49,7 +49,7 @@ class CRM_Contact_Controller_Search extends CRM_Core_Controller { /** * Class constructor */ - function __construct($title = NULL, $modal = TRUE, $action = CRM_Core_Action::NONE) { + public function __construct($title = NULL, $modal = TRUE, $action = CRM_Core_Action::NONE) { parent::__construct($title, $modal); $this->_stateMachine = new CRM_Contact_StateMachine_Search($this, $action); diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php index 1e55901288..ea01fc26b8 100644 --- a/CRM/Contact/Form/Contact.php +++ b/CRM/Contact/Form/Contact.php @@ -135,7 +135,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { * @return void * @access public */ - function preProcess() { + public function preProcess() { $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add'); $this->_dedupeButtonName = $this->getButtonName('refresh', 'dedupe'); @@ -392,7 +392,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = $this->_values; $params = array(); @@ -458,7 +458,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { * primary location, default country * */ - function blockSetDefaults(&$defaults) { + public function blockSetDefaults(&$defaults) { $locationTypeKeys = array_filter(array_keys(CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id')), 'is_int'); sort($locationTypeKeys); @@ -561,7 +561,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { * @access public * @see valid_date */ - function addRules() { + public function addRules() { // skip adding formRules when custom data is build if ($this->_addBlockName || ($this->_action & CRM_Core_Action::DELETE)) { return; @@ -593,7 +593,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { * @return bool $primaryID email/openId@static * @access public */ - static function formRule($fields, &$errors, $contactId = NULL) { + public static function formRule($fields, &$errors, $contactId = NULL) { $config = CRM_Core_Config::singleton(); // validations. @@ -1068,7 +1068,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { * @static * @access public */ - static function blockDataExists(&$fields) { + public static function blockDataExists(&$fields) { if (!is_array($fields)) { return FALSE; } @@ -1112,7 +1112,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { * @param string $contactType contact type * */ - static function checkDuplicateContacts(&$fields, &$errors, $contactID, $contactType) { + public static function checkDuplicateContacts(&$fields, &$errors, $contactID, $contactType) { // if this is a forced save, ignore find duplicate rule if (empty($fields['_qf_Contact_upload_duplicate'])) { @@ -1178,7 +1178,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { * @return string * @access public */ - function getTemplateFileName() { + public function getTemplateFileName() { if ($this->_contactSubType) { $templateFile = "CRM/Contact/Form/Edit/SubType/{$this->_contactSubType}.tpl"; $template = CRM_Core_Form::getTemplate(); @@ -1199,7 +1199,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { * * @return array $parseSuccess as array of sucess/fails for each address block@static */ - function parseAddress(&$params) { + public function parseAddress(&$params) { $parseSuccess = $parsedFields = array(); if (!is_array($params['address']) || CRM_Utils_System::isNull($params['address']) @@ -1284,7 +1284,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { * * @return null|string $statusMsg string status message for all address blocks.@static */ - static function parseAddressStatusMsg($parseResult) { + public static function parseAddressStatusMsg($parseResult) { $statusMsg = NULL; if (!is_array($parseResult) || empty($parseResult)) { return $statusMsg; @@ -1315,7 +1315,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { * @return ordinal number for given number. * @static */ - static function ordinalNumber($number) { + public static function ordinalNumber($number) { if (empty($number)) { return NULL; } @@ -1350,7 +1350,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { * * @return null|string $updateMembershipMsg string status message for updated membership. */ - function updateMembershipStatus($deceasedParams) { + public function updateMembershipStatus($deceasedParams) { $updateMembershipMsg = NULL; $contactId = CRM_Utils_Array::value('contact_id', $deceasedParams); $deceasedDate = CRM_Utils_Array::value('deceased_date', $deceasedParams); diff --git a/CRM/Contact/Form/CustomData.php b/CRM/Contact/Form/CustomData.php index 79113aa551..2fe49f96f6 100644 --- a/CRM/Contact/Form/CustomData.php +++ b/CRM/Contact/Form/CustomData.php @@ -116,7 +116,7 @@ class CRM_Contact_Form_CustomData extends CRM_Core_Form { * @access public * */ - function preProcess() { + public function preProcess() { $this->_cdType = CRM_Utils_Array::value('type', $_GET); $this->assign('cdType', FALSE); $this->_multiRecordDisplay = CRM_Utils_Request::retrieve('multiRecordDisplay', 'String', $this); @@ -240,7 +240,7 @@ class CRM_Contact_Form_CustomData extends CRM_Core_Form { * * @return array the default array reference */ - function setDefaultValues() { + public function setDefaultValues() { if ($this->_cdType || $this->_multiRecordDisplay == 'single') { if ($this->_copyValueId) { // cached tree is fetched diff --git a/CRM/Contact/Form/DedupeFind.php b/CRM/Contact/Form/DedupeFind.php index 521f030014..1ac59b06a6 100644 --- a/CRM/Contact/Form/DedupeFind.php +++ b/CRM/Contact/Form/DedupeFind.php @@ -51,7 +51,7 @@ class CRM_Contact_Form_DedupeFind extends CRM_Admin_Form { * @return void * @access public */ - function preProcess() { + public function preProcess() { $this->rgid = CRM_Utils_Request::retrieve('rgid', 'Positive', $this, FALSE, 0); } @@ -81,7 +81,7 @@ class CRM_Contact_Form_DedupeFind extends CRM_Admin_Form { ); } - function setDefaultValues() { + public function setDefaultValues() { return $this->_defaults; } diff --git a/CRM/Contact/Form/DedupeRules.php b/CRM/Contact/Form/DedupeRules.php index 29c2676129..9752d9c51c 100644 --- a/CRM/Contact/Form/DedupeRules.php +++ b/CRM/Contact/Form/DedupeRules.php @@ -50,7 +50,7 @@ class CRM_Contact_Form_DedupeRules extends CRM_Admin_Form { * @return void * @access public */ - function preProcess() { + public function preProcess() { // Ensure user has permission to be here if (!CRM_Core_Permission::check('administer dedupe rules')) { CRM_Utils_System::permissionDenied(); @@ -153,7 +153,7 @@ class CRM_Contact_Form_DedupeRules extends CRM_Admin_Form { * @static * @access public */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); if (!empty($fields['is_reserved'])) { return TRUE; @@ -185,7 +185,7 @@ class CRM_Contact_Form_DedupeRules extends CRM_Admin_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { return $this->_defaults; } diff --git a/CRM/Contact/Form/Domain.php b/CRM/Contact/Form/Domain.php index 3597bef86d..491cb93bd9 100644 --- a/CRM/Contact/Form/Domain.php +++ b/CRM/Contact/Form/Domain.php @@ -74,7 +74,7 @@ class CRM_Contact_Form_Domain extends CRM_Core_Form { */ const LOCATION_BLOCKS = 1; - function preProcess() { + public function preProcess() { CRM_Utils_System::setTitle(ts('Organization Address and Contact Info')); $breadCrumbPath = CRM_Utils_System::url('civicrm/admin', 'reset=1'); CRM_Utils_System::appendBreadCrumb(ts('Administer CiviCRM'), $breadCrumbPath); @@ -109,7 +109,7 @@ class CRM_Contact_Form_Domain extends CRM_Core_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $params = array(); @@ -194,7 +194,7 @@ class CRM_Contact_Form_Domain extends CRM_Core_Form { * * @return void */ - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Contact_Form_Domain', 'formRule')); } @@ -207,7 +207,7 @@ class CRM_Contact_Form_Domain extends CRM_Core_Form { * @static * @access public */ - static function formRule($fields) { + public static function formRule($fields) { // check for state/country mapping $errors = CRM_Contact_Form_Edit_Address::formRule($fields, CRM_Core_DAO::$_nullArray, CRM_Core_DAO::$_nullObject); // $errors === TRUE means no errors from above formRule excution, diff --git a/CRM/Contact/Form/Edit/Address.php b/CRM/Contact/Form/Edit/Address.php index d14172fee9..98e7330e74 100644 --- a/CRM/Contact/Form/Edit/Address.php +++ b/CRM/Contact/Form/Edit/Address.php @@ -51,7 +51,7 @@ class CRM_Contact_Form_Edit_Address { * @access public * @static */ - static function buildQuickForm(&$form, $addressBlockCount = NULL, $sharing = TRUE, $inlineEdit = FALSE) { + public static function buildQuickForm(&$form, $addressBlockCount = NULL, $sharing = TRUE, $inlineEdit = FALSE) { // passing this via the session is AWFUL. we need to fix this if (!$addressBlockCount) { $blockId = ($form->get('Address_Block_Count')) ? $form->get('Address_Block_Count') : 1; @@ -264,7 +264,7 @@ class CRM_Contact_Form_Edit_Address { * @access public * @static */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); $customDataRequiredFields = array(); @@ -320,7 +320,7 @@ class CRM_Contact_Form_Edit_Address { * @static * @access public */ - static function setDefaultValues( &$defaults, &$form ) { + public static function setDefaultValues( &$defaults, &$form ) { $addressValues = array(); if (isset($defaults['address']) && is_array($defaults['address']) && !CRM_Utils_System::isNull($defaults['address']) @@ -418,7 +418,7 @@ class CRM_Contact_Form_Edit_Address { * @param CRM_Core_Form $form * @param $groupTree */ - static function storeRequiredCustomDataInfo(&$form, $groupTree) { + public static function storeRequiredCustomDataInfo(&$form, $groupTree) { if (CRM_Utils_System::getClassName($form) == 'CRM_Contact_Form_Contact') { $requireOmission = NULL; foreach ($groupTree as $csId => $csVal) { diff --git a/CRM/Contact/Form/Edit/CommunicationPreferences.php b/CRM/Contact/Form/Edit/CommunicationPreferences.php index 27c43d05b3..80e4fc78af 100644 --- a/CRM/Contact/Form/Edit/CommunicationPreferences.php +++ b/CRM/Contact/Form/Edit/CommunicationPreferences.php @@ -54,7 +54,7 @@ class CRM_Contact_Form_Edit_CommunicationPreferences { * @access public * @static */ - static function buildQuickForm(&$form) { + public static function buildQuickForm(&$form) { // since the pcm - preferred comminication method is logically // grouped hence we'll use groups of HTML_QuickForm @@ -141,7 +141,7 @@ class CRM_Contact_Form_Edit_CommunicationPreferences { * @access public * @static */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { //CRM-4575 $greetings = self::getGreetingFields($self->_contactType); @@ -167,7 +167,7 @@ class CRM_Contact_Form_Edit_CommunicationPreferences { * * @return void */ - static function setDefaultValues(&$form, &$defaults) { + public static function setDefaultValues(&$form, &$defaults) { if (!empty($defaults['preferred_language'])) { $languages = CRM_Contact_BAO_Contact::buildOptions('preferred_language'); @@ -212,7 +212,7 @@ class CRM_Contact_Form_Edit_CommunicationPreferences { * @return void * @access public */ - static function getGreetingFields($contactType) { + public static function getGreetingFields($contactType) { if (empty(self::$greetings[$contactType])) { self::$greetings[$contactType] = array(); diff --git a/CRM/Contact/Form/Edit/CustomData.php b/CRM/Contact/Form/Edit/CustomData.php index 34b5c89a34..c87e95ec86 100644 --- a/CRM/Contact/Form/Edit/CustomData.php +++ b/CRM/Contact/Form/Edit/CustomData.php @@ -46,7 +46,7 @@ class CRM_Contact_Form_Edit_CustomData { * @return void * @access public */ - static function preProcess(&$form) { + public static function preProcess(&$form) { $form->_type = CRM_Utils_Request::retrieve('type', 'String', CRM_Core_DAO::$_nullObject); $form->_subType = CRM_Utils_Request::retrieve('subType', 'String', CRM_Core_DAO::$_nullObject); @@ -75,7 +75,7 @@ class CRM_Contact_Form_Edit_CustomData { * @access public * @static */ - static function buildQuickForm(&$form) { + public static function buildQuickForm(&$form) { if(!empty($form->_submitValues)) { if ($customValueCount = CRM_Utils_Array::value('hidden_custom_group_count', $form->_submitValues)) { if (is_array($customValueCount)) { @@ -112,7 +112,7 @@ class CRM_Contact_Form_Edit_CustomData { * * @return void */ - static function setDefaultValues(&$form, &$defaults) { + public static function setDefaultValues(&$form, &$defaults) { $defaults += CRM_Custom_Form_CustomData::setDefaultValues($form); } } diff --git a/CRM/Contact/Form/Edit/Demographics.php b/CRM/Contact/Form/Edit/Demographics.php index ff7b5f965d..bf376ffe55 100644 --- a/CRM/Contact/Form/Edit/Demographics.php +++ b/CRM/Contact/Form/Edit/Demographics.php @@ -47,7 +47,7 @@ class CRM_Contact_Form_Edit_Demographics { * @access public * @static */ - static function buildQuickForm(&$form) { + public static function buildQuickForm(&$form) { // radio button for gender $genderOptions = array(); $gender = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id', array('localize' => TRUE)); @@ -76,6 +76,6 @@ class CRM_Contact_Form_Edit_Demographics { * * @return void */ - static function setDefaultValues(&$form, &$defaults) {} + public static function setDefaultValues(&$form, &$defaults) {} } diff --git a/CRM/Contact/Form/Edit/Email.php b/CRM/Contact/Form/Edit/Email.php index f3500721c9..0e1452d3d1 100644 --- a/CRM/Contact/Form/Edit/Email.php +++ b/CRM/Contact/Form/Edit/Email.php @@ -49,7 +49,7 @@ class CRM_Contact_Form_Edit_Email { * @access public * @static */ - static function buildQuickForm(&$form, $blockCount = NULL, $blockEdit = FALSE) { + public static function buildQuickForm(&$form, $blockCount = NULL, $blockEdit = FALSE) { // passing this via the session is AWFUL. we need to fix this if (!$blockCount) { $blockId = ($form->get('Email_Block_Count')) ? $form->get('Email_Block_Count') : 1; diff --git a/CRM/Contact/Form/Edit/Household.php b/CRM/Contact/Form/Edit/Household.php index 66414d25f6..af7cd1a593 100644 --- a/CRM/Contact/Form/Edit/Household.php +++ b/CRM/Contact/Form/Edit/Household.php @@ -87,7 +87,7 @@ class CRM_Contact_Form_Edit_Household { * @return array|bool $error@static * @public */ - static function formRule($fields, $files, $contactID = NULL) { + public static function formRule($fields, $files, $contactID = NULL) { $errors = array(); $primaryID = CRM_Contact_Form_Contact::formRule($fields, $errors, $contactID); diff --git a/CRM/Contact/Form/Edit/IM.php b/CRM/Contact/Form/Edit/IM.php index 0529c885cf..b574de9edf 100644 --- a/CRM/Contact/Form/Edit/IM.php +++ b/CRM/Contact/Form/Edit/IM.php @@ -49,7 +49,7 @@ class CRM_Contact_Form_Edit_IM { * @access public * @static */ - static function buildQuickForm(&$form, $blockCount = NULL, $blockEdit = FALSE) { + public static function buildQuickForm(&$form, $blockCount = NULL, $blockEdit = FALSE) { if (!$blockCount) { $blockId = ($form->get('IM_Block_Count')) ? $form->get('IM_Block_Count') : 1; } diff --git a/CRM/Contact/Form/Edit/Individual.php b/CRM/Contact/Form/Edit/Individual.php index b6b598d15b..bd62769a89 100644 --- a/CRM/Contact/Form/Edit/Individual.php +++ b/CRM/Contact/Form/Edit/Individual.php @@ -153,7 +153,7 @@ class CRM_Contact_Form_Edit_Individual { * @access public * @static */ - static function formRule($fields, $files, $contactID = NULL) { + public static function formRule($fields, $files, $contactID = NULL) { $errors = array(); $primaryID = CRM_Contact_Form_Contact::formRule($fields, $errors, $contactID); diff --git a/CRM/Contact/Form/Edit/Lock.php b/CRM/Contact/Form/Edit/Lock.php index b14722fb32..2b746be588 100644 --- a/CRM/Contact/Form/Edit/Lock.php +++ b/CRM/Contact/Form/Edit/Lock.php @@ -62,7 +62,7 @@ class CRM_Contact_Form_Edit_Lock { * @access public * @static */ - static function formRule($fields, $files, $contactID = NULL) { + public static function formRule($fields, $files, $contactID = NULL) { $errors = array(); $timestamps = CRM_Contact_BAO_Contact::getTimestamps($contactID); diff --git a/CRM/Contact/Form/Edit/Notes.php b/CRM/Contact/Form/Edit/Notes.php index 71b3985056..a5512dc6fc 100644 --- a/CRM/Contact/Form/Edit/Notes.php +++ b/CRM/Contact/Form/Edit/Notes.php @@ -41,7 +41,7 @@ Class CRM_Contact_Form_Edit_Notes { * @static * @access public */ - static function buildQuickForm(&$form) { + public static function buildQuickForm(&$form) { $form->applyFilter('__ALL__', 'trim'); $form->add('text', 'subject', ts('Subject'), array('size' => 60, 'maxlength' => 254)); $form->add('textarea', 'note', ts('Notes'), array('cols' => '60', 'rows' => '3')); diff --git a/CRM/Contact/Form/Edit/OpenID.php b/CRM/Contact/Form/Edit/OpenID.php index dff709b395..8c2609d86a 100644 --- a/CRM/Contact/Form/Edit/OpenID.php +++ b/CRM/Contact/Form/Edit/OpenID.php @@ -49,7 +49,7 @@ class CRM_Contact_Form_Edit_OpenID { * @access public * @static */ - static function buildQuickForm(&$form, $blockCount = NULL, $blockEdit = FALSE) { + public static function buildQuickForm(&$form, $blockCount = NULL, $blockEdit = FALSE) { if (!$blockCount) { $blockId = ($form->get('OpenID_Block_Count')) ? $form->get('OpenID_Block_Count') : 1; } diff --git a/CRM/Contact/Form/Edit/Organization.php b/CRM/Contact/Form/Edit/Organization.php index 063bcfaa53..ca095b2529 100644 --- a/CRM/Contact/Form/Edit/Organization.php +++ b/CRM/Contact/Form/Edit/Organization.php @@ -93,7 +93,7 @@ class CRM_Contact_Form_Edit_Organization { * * @return array|bool */ - static function formRule($fields, $files, $contactID = NULL) { + public static function formRule($fields, $files, $contactID = NULL) { $errors = array(); $primaryID = CRM_Contact_Form_Contact::formRule($fields, $errors, $contactID); diff --git a/CRM/Contact/Form/Edit/Phone.php b/CRM/Contact/Form/Edit/Phone.php index f6f21af120..241353d710 100644 --- a/CRM/Contact/Form/Edit/Phone.php +++ b/CRM/Contact/Form/Edit/Phone.php @@ -49,7 +49,7 @@ class CRM_Contact_Form_Edit_Phone { * @access public * @static */ - static function buildQuickForm(&$form, $addressBlockCount = NULL, $blockEdit = FALSE) { + public static function buildQuickForm(&$form, $addressBlockCount = NULL, $blockEdit = FALSE) { // passing this via the session is AWFUL. we need to fix this if (!$addressBlockCount) { $blockId = ($form->get('Phone_Block_Count')) ? $form->get('Phone_Block_Count') : 1; diff --git a/CRM/Contact/Form/Edit/TagsAndGroups.php b/CRM/Contact/Form/Edit/TagsAndGroups.php index 053f69469e..631aa88aaf 100644 --- a/CRM/Contact/Form/Edit/TagsAndGroups.php +++ b/CRM/Contact/Form/Edit/TagsAndGroups.php @@ -178,7 +178,7 @@ class CRM_Contact_Form_Edit_TagsAndGroups { $form->assign('tagGroup', $form->_tagGroup); } - static function climbtree($form, $tree, &$elements) { + public static function climbtree($form, $tree, &$elements) { foreach ($tree as $tagID => $varValue) { $tagAttribute = array( 'onclick' => "return changeRowColor(\"rowidtag_$tagID\")", @@ -208,7 +208,7 @@ class CRM_Contact_Form_Edit_TagsAndGroups { * @access public * @static */ - static function setDefaults($id, &$defaults, $type = self::ALL, $fieldName = NULL, $groupElementType = 'checkbox') { + public static function setDefaults($id, &$defaults, $type = self::ALL, $fieldName = NULL, $groupElementType = 'checkbox') { $type = (int ) $type; if ($type & self::GROUP) { $fName = 'group'; diff --git a/CRM/Contact/Form/Edit/Website.php b/CRM/Contact/Form/Edit/Website.php index 30780d2428..92e1c1fc8a 100644 --- a/CRM/Contact/Form/Edit/Website.php +++ b/CRM/Contact/Form/Edit/Website.php @@ -48,7 +48,7 @@ class CRM_Contact_Form_Edit_Website { * @access public * @static */ - static function buildQuickForm(&$form, $blockCount = NULL) { + public static function buildQuickForm(&$form, $blockCount = NULL) { if (!$blockCount) { $blockId = ($form->get('Website_Block_Count')) ? $form->get('Website_Block_Count') : 1; } diff --git a/CRM/Contact/Form/GroupContact.php b/CRM/Contact/Form/GroupContact.php index 70722cd6cf..9dcd5d4638 100644 --- a/CRM/Contact/Form/GroupContact.php +++ b/CRM/Contact/Form/GroupContact.php @@ -53,7 +53,7 @@ class CRM_Contact_Form_GroupContact extends CRM_Core_Form { */ protected $_contactId; - function preProcess() { + public function preProcess() { $this->_contactId = $this->get('contactId'); $this->_groupContactId = $this->get('groupContactId'); $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this); diff --git a/CRM/Contact/Form/Inline/Address.php b/CRM/Contact/Form/Inline/Address.php index 706d2db5e6..8c226d1880 100644 --- a/CRM/Contact/Form/Inline/Address.php +++ b/CRM/Contact/Form/Inline/Address.php @@ -68,7 +68,7 @@ class CRM_Contact_Form_Inline_Address extends CRM_Contact_Form_Inline { * of address block, we need to generate unique form name for each, * hence calling parent contructor */ - function __construct() { + public function __construct() { $locBlockNo = CRM_Utils_Request::retrieve('locno', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST); $name = "Address_{$locBlockNo}"; diff --git a/CRM/Contact/Form/Inline/Email.php b/CRM/Contact/Form/Inline/Email.php index e6801386af..2563fcc6d0 100644 --- a/CRM/Contact/Form/Inline/Email.php +++ b/CRM/Contact/Form/Inline/Email.php @@ -105,7 +105,7 @@ class CRM_Contact_Form_Inline_Email extends CRM_Contact_Form_Inline { * @return array $errors@static * @access public */ - static function formRule($fields, $errors) { + public static function formRule($fields, $errors) { $hasData = $hasPrimary = $errors = array(); if (!empty($fields['email']) && is_array($fields['email'])) { foreach ($fields['email'] as $instance => $blockValues) { diff --git a/CRM/Contact/Form/Inline/IM.php b/CRM/Contact/Form/Inline/IM.php index 01c776648e..eee47a20a9 100644 --- a/CRM/Contact/Form/Inline/IM.php +++ b/CRM/Contact/Form/Inline/IM.php @@ -105,7 +105,7 @@ class CRM_Contact_Form_Inline_IM extends CRM_Contact_Form_Inline { * @return array $errors@static * @access public */ - static function formRule($fields, $errors) { + public static function formRule($fields, $errors) { $hasData = $hasPrimary = $errors = array(); if (!empty($fields['im']) && is_array($fields['im'])) { foreach ($fields['im'] as $instance => $blockValues) { diff --git a/CRM/Contact/Form/Inline/Lock.php b/CRM/Contact/Form/Inline/Lock.php index a9897d276d..745424b40c 100644 --- a/CRM/Contact/Form/Inline/Lock.php +++ b/CRM/Contact/Form/Inline/Lock.php @@ -48,7 +48,7 @@ class CRM_Contact_Form_Inline_Lock { * @access public * @return void */ - static function buildQuickForm(&$form, $contactID) { + public static function buildQuickForm(&$form, $contactID) { // We provide a value for oplock_ts to client, but JS uses it carefully // -- i.e. when loading the first inline form, JS copies oplock_ts to a // global value, and that global value is used for future form submissions. @@ -73,7 +73,7 @@ class CRM_Contact_Form_Inline_Lock { * @access public * @static */ - static function formRule($fields, $files, $contactID = NULL) { + public static function formRule($fields, $files, $contactID = NULL) { $errors = array(); $timestamps = CRM_Contact_BAO_Contact::getTimestamps($contactID); @@ -94,7 +94,7 @@ class CRM_Contact_Form_Inline_Lock { * * @return array extra options to return in JSON */ - static function getResponse($contactID) { + public static function getResponse($contactID) { $timestamps = CRM_Contact_BAO_Contact::getTimestamps($contactID); return array('oplock_ts' => $timestamps['modified_date']); } diff --git a/CRM/Contact/Form/Inline/OpenID.php b/CRM/Contact/Form/Inline/OpenID.php index f16ba2f84f..6c220cb3cf 100644 --- a/CRM/Contact/Form/Inline/OpenID.php +++ b/CRM/Contact/Form/Inline/OpenID.php @@ -105,7 +105,7 @@ class CRM_Contact_Form_Inline_OpenID extends CRM_Contact_Form_Inline { * @return array $errors@static * @access public */ - static function formRule($fields, $errors) { + public static function formRule($fields, $errors) { $hasData = $hasPrimary = $errors = array(); if (!empty($fields['openid']) && is_array($fields['openid'])) { foreach ($fields['openid'] as $instance => $blockValues) { diff --git a/CRM/Contact/Form/Inline/Phone.php b/CRM/Contact/Form/Inline/Phone.php index aa1a46891d..9a81daa854 100644 --- a/CRM/Contact/Form/Inline/Phone.php +++ b/CRM/Contact/Form/Inline/Phone.php @@ -105,7 +105,7 @@ class CRM_Contact_Form_Inline_Phone extends CRM_Contact_Form_Inline { * @return array $errors@static * @access public */ - static function formRule($fields, $errors) { + public static function formRule($fields, $errors) { $hasData = $hasPrimary = $errors = array(); if (!empty($fields['phone']) && is_array($fields['phone'])) { $primaryID = null; diff --git a/CRM/Contact/Form/Location.php b/CRM/Contact/Form/Location.php index 9e94cb9612..9bfbf0f990 100644 --- a/CRM/Contact/Form/Location.php +++ b/CRM/Contact/Form/Location.php @@ -41,7 +41,7 @@ class CRM_Contact_Form_Location { * * @return void */ - static function preProcess(&$form) { + public static function preProcess(&$form) { $form->_addBlockName = CRM_Utils_Request::retrieve('block', 'String', CRM_Core_DAO::$_nullObject); $additionalblockCount = CRM_Utils_Request::retrieve('count', 'Positive', CRM_Core_DAO::$_nullObject); @@ -81,7 +81,7 @@ class CRM_Contact_Form_Location { * @return void * @access public */ - static function buildQuickForm(&$form) { + public static function buildQuickForm(&$form) { // required for subsequent AJAX requests. $ajaxRequestBlocks = array(); $generateAjaxRequest = 0; diff --git a/CRM/Contact/Form/Merge.php b/CRM/Contact/Form/Merge.php index d5ad1b7df5..9b63f883bd 100644 --- a/CRM/Contact/Form/Merge.php +++ b/CRM/Contact/Form/Merge.php @@ -57,7 +57,7 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form { // to side-step this, we use the below UUID as a (re)placeholder var $_qfZeroBug = 'e8cddb72-a257-11dc-b9cc-0016d3330ee9'; - function preProcess() { + public function preProcess() { if (!CRM_Core_Permission::check('merge duplicate contacts')) { CRM_Core_Error::fatal(ts('You do not have access to this page')); } @@ -253,11 +253,11 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { return array('deleteOther' => 1); } - function addRules() {} + public function addRules() {} public function buildQuickForm() { CRM_Utils_System::setTitle(ts('Merge %1s', array(1 => $this->_contactType))); @@ -312,7 +312,7 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form { * * @return array */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); $link = CRM_Utils_System::href(ts('Flip between the original and duplicate contacts.'), 'civicrm/contact/merge', diff --git a/CRM/Contact/Form/ProfileContact.php b/CRM/Contact/Form/ProfileContact.php index acc8856440..dde75bfd44 100644 --- a/CRM/Contact/Form/ProfileContact.php +++ b/CRM/Contact/Form/ProfileContact.php @@ -44,7 +44,7 @@ class CRM_Contact_Form_ProfileContact { * @return void * @access public */ - static function preProcess(&$form) { + public static function preProcess(&$form) { $session = CRM_Core_Session::singleton(); $contactID = $session->get('userID'); @@ -81,7 +81,7 @@ class CRM_Contact_Form_ProfileContact { * * @static */ - static function buildQuickForm(&$form) { + public static function buildQuickForm(&$form) { $ufGroup = new CRM_Core_DAO_UFGroup(); $ufGroup->id = $form->_honoreeProfileId; if (!$ufGroup->find(TRUE)) { @@ -111,7 +111,7 @@ class CRM_Contact_Form_ProfileContact { /** * @param $form */ - static function postProcess($form) { + public static function postProcess($form) { $params = $form->_params; if (!empty($form->_honor_block_is_active) && !empty($params['soft_credit_type_id'])) { $honorId = null; diff --git a/CRM/Contact/Form/RelatedContact.php b/CRM/Contact/Form/RelatedContact.php index 016c3a06cb..40f4da1187 100644 --- a/CRM/Contact/Form/RelatedContact.php +++ b/CRM/Contact/Form/RelatedContact.php @@ -70,7 +70,7 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form { * @return void * @access public */ - function preProcess() { + public function preProcess() { // reset action from the session $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'update' @@ -111,7 +111,7 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { return $this->_defaults; } diff --git a/CRM/Contact/Form/Relationship.php b/CRM/Contact/Form/Relationship.php index 3d274e560b..0d4f3a25ce 100644 --- a/CRM/Contact/Form/Relationship.php +++ b/CRM/Contact/Form/Relationship.php @@ -121,7 +121,7 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { */ public $_cdType; - function preProcess() { + public function preProcess() { //custom data related code $this->_cdType = CRM_Utils_Array::value('type', $_GET); $this->assign('cdType', FALSE); @@ -218,7 +218,7 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { if ($this->_cdType) { return CRM_Custom_Form_CustomData::setDefaultValues($this); } @@ -282,7 +282,7 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { * @return void * @access public */ - function addRules() { + public function addRules() { if ($this->_cdType) { return; } @@ -549,7 +549,7 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { * @access public * @static */ - static function dateRule($params) { + public static function dateRule($params) { $errors = array(); // check start and end date diff --git a/CRM/Contact/Form/Search.php b/CRM/Contact/Form/Search.php index 64da4325b8..02aab324fe 100644 --- a/CRM/Contact/Form/Search.php +++ b/CRM/Contact/Form/Search.php @@ -181,7 +181,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { * @access protected * @static */ - static function &validContext() { + public static function &validContext() { if (!(self::$_validContext)) { self::$_validContext = array( 'smog' => 'Show members of group', @@ -201,12 +201,12 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { * * @return bool */ - static function isSearchContext($context) { + public static function isSearchContext($context) { $searchContext = CRM_Utils_Array::value($context, self::validContext()); return $searchContext ? TRUE : FALSE; } - static function setModeValues() { + public static function setModeValues() { if (!self::$_modeValues) { self::$_modeValues = array( 1 => array( @@ -290,7 +290,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { * * @return mixed */ - static function getModeValue($mode = 1) { + public static function getModeValue($mode = 1) { self::setModeValues(); if (!array_key_exists($mode, self::$_modeValues)) { @@ -303,7 +303,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { /** * @return array */ - static function getModeSelect() { + public static function getModeSelect() { self::setModeValues(); $select = array(); @@ -334,7 +334,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { parent::buildQuickForm(); CRM_Core_Resources::singleton() // jsTree is needed for tags popup @@ -483,7 +483,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { * @return void * @access public */ - function preProcess() { + public function preProcess() { // set the various class variables $this->_group = CRM_Core_PseudoConstant::group(); @@ -729,7 +729,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { /** * @return array */ - function &getFormValues() { + public function &getFormValues() { return $this->_formValues; } @@ -739,7 +739,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { * @return void * @access public */ - function postProcess() { + public function postProcess() { /* * sometime we do a postProcess early on, so we dont need to repeat it * this will most likely introduce some more bugs :( @@ -868,7 +868,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { /** * @return null */ - function &returnProperties() { + public function &returnProperties() { return CRM_Core_DAO::$_nullObject; } @@ -878,7 +878,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { * @return string * @access public */ - function getTitle() { + public function getTitle() { return ts('Search'); } } diff --git a/CRM/Contact/Form/Search/Advanced.php b/CRM/Contact/Form/Search/Advanced.php index f19a35eb37..662d8641aa 100644 --- a/CRM/Contact/Form/Search/Advanced.php +++ b/CRM/Contact/Form/Search/Advanced.php @@ -48,7 +48,7 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search { * @return void * @access public */ - function preProcess() { + public function preProcess() { $this->set('searchFormName', 'Advanced'); parent::preProcess(); @@ -64,7 +64,7 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $this->set('context', 'advanced'); $this->_searchPane = CRM_Utils_Array::value('searchPane', $_GET); @@ -186,7 +186,7 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search { /** * @return string */ - function getTemplateFileName() { + public function getTemplateFileName() { if (!$this->_searchPane) { return parent::getTemplateFileName(); } @@ -208,7 +208,7 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search { * * @return array the default array reference */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = $this->_formValues; $this->normalizeDefaultValues($defaults); @@ -238,7 +238,7 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search { * @return void * @access public */ - function postProcess() { + public function postProcess() { $this->set('isAdvanced', '1'); // get user submitted values @@ -336,7 +336,7 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search { * @return void * @access private */ - function normalizeFormValues() { + public function normalizeFormValues() { $contactType = CRM_Utils_Array::value('contact_type', $this->_formValues); if ($contactType && is_array($contactType)) { @@ -398,7 +398,7 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search { * @return array * @access private */ - function normalizeDefaultValues(&$defaults) { + public function normalizeDefaultValues(&$defaults) { if (!is_array($defaults)) { $defaults = array(); } diff --git a/CRM/Contact/Form/Search/Basic.php b/CRM/Contact/Form/Search/Basic.php index 1e9b776afa..0b5e775f75 100644 --- a/CRM/Contact/Form/Search/Basic.php +++ b/CRM/Contact/Form/Search/Basic.php @@ -59,7 +59,7 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { // text for sort_name or email criteria $config = CRM_Core_Config::singleton(); $label = empty($config->includeEmailInName) ? ts('Name') : ts('Name or Email'); @@ -110,7 +110,7 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { * * @return array the default array reference */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $defaults['sort_name'] = CRM_Utils_Array::value('sort_name', $this->_formValues); @@ -142,7 +142,7 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { * * @return void */ - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Contact_Form_Search_Basic', 'formRule')); } @@ -152,7 +152,7 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { * @return void * @access public */ - function preProcess() { + public function preProcess() { $this->set('searchFormName', 'Basic'); parent::preProcess(); @@ -161,7 +161,7 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { /** * @return array */ - function &getFormValues() { + public function &getFormValues() { return $this->_formValues; } @@ -171,7 +171,7 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { * @return void * @access public */ - function postProcess() { + public function postProcess() { $this->set('isAdvanced', '0'); $this->set('isSearchBuilder', '0'); @@ -224,7 +224,7 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { * @return void * @access private */ - function normalizeFormValues() { + public function normalizeFormValues() { $contactType = CRM_Utils_Array::value('contact_type', $this->_formValues); if ($contactType && !is_array($contactType)) { unset($this->_formValues['contact_type']); @@ -252,7 +252,7 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { * Add a form rule for this form. If Go is pressed then we must select some checkboxes * and an action */ - static function formRule($fields) { + public static function formRule($fields) { // check actionName and if next, then do not repeat a search, since we are going to the next page if (array_key_exists('_qf_Search_next', $fields)) { if (empty($fields['task'])) { @@ -288,7 +288,7 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { /** * @return string */ - function getTitle() { + public function getTitle() { return ts('Find Contacts'); } } diff --git a/CRM/Contact/Form/Search/Builder.php b/CRM/Contact/Form/Search/Builder.php index a480c1497c..92fafd0fb9 100644 --- a/CRM/Contact/Form/Search/Builder.php +++ b/CRM/Contact/Form/Search/Builder.php @@ -132,7 +132,7 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search { * * @return void */ - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Contact_Form_Search_Builder', 'formRule'), $this); } @@ -147,7 +147,7 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search { * @static * @access public */ - static function formRule($values, $files, $self) { + public static function formRule($values, $files, $self) { if (!empty($values['addMore']) || !empty($values['addBlock'])) { return TRUE; } @@ -409,7 +409,7 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search { /** * @return array */ - static function fields() { + public static function fields() { $fields = array_merge( CRM_Contact_BAO_Contact::exportableFields('All', FALSE, TRUE), CRM_Core_Component::getQueryFields(), @@ -425,7 +425,7 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search { * @return array: (string => string) key: field_name value: api entity name * Note: options are fetched via ajax using the api "getoptions" method */ - static function fieldOptions() { + public static function fieldOptions() { // Hack to add options not retrieved by getfields // This list could go on and on, but it would be better to fix getfields $options = array( @@ -476,7 +476,7 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search { * if using IS NULL/NOT NULL, an array with no array key is created * convert that to simple null so processing can proceed */ - static function checkArrayKeyEmpty($val) { + public static function checkArrayKeyEmpty($val) { if (is_array($val)) { $v2empty = true; foreach ($val as $vk => $vv) { diff --git a/CRM/Contact/Form/Search/Criteria.php b/CRM/Contact/Form/Search/Criteria.php index 5129cc653d..c99992c1c9 100644 --- a/CRM/Contact/Form/Search/Criteria.php +++ b/CRM/Contact/Form/Search/Criteria.php @@ -36,7 +36,7 @@ class CRM_Contact_Form_Search_Criteria { /** * @param CRM_Core_Form $form */ - static function basic(&$form) { + public static function basic(&$form) { $form->addElement('hidden', 'hidden_basic', 1); if ($form->_searchOptions['contactType']) { @@ -273,7 +273,7 @@ class CRM_Contact_Form_Search_Criteria { /** * @param CRM_Core_Form $form */ - static function location(&$form) { + public static function location(&$form) { $config = CRM_Core_Config::singleton(); // Build location criteria based on _submitValues if // available; otherwise, use $form->_formValues. @@ -388,7 +388,7 @@ class CRM_Contact_Form_Search_Criteria { /** * @param CRM_Core_Form $form */ - static function activity(&$form) { + public static function activity(&$form) { $form->add('hidden', 'hidden_activity', 1); CRM_Activity_BAO_Query::buildSearchForm($form); } @@ -396,7 +396,7 @@ class CRM_Contact_Form_Search_Criteria { /** * @param CRM_Core_Form $form */ - static function changeLog(&$form) { + public static function changeLog(&$form) { $form->add('hidden', 'hidden_changeLog', 1); // block for change log @@ -411,14 +411,14 @@ class CRM_Contact_Form_Search_Criteria { /** * @param CRM_Core_Form $form */ - static function task(&$form) { + public static function task(&$form) { $form->add('hidden', 'hidden_task', 1); } /** * @param $form */ - static function relationship(&$form) { + public static function relationship(&$form) { $form->add('hidden', 'hidden_relationship', 1); $allRelationshipType = array(); @@ -468,7 +468,7 @@ class CRM_Contact_Form_Search_Criteria { /** * @param $form */ - static function demographics(&$form) { + public static function demographics(&$form) { $form->add('hidden', 'hidden_demographics', 1); // radio button for gender $genderOptions = array(); @@ -493,7 +493,7 @@ class CRM_Contact_Form_Search_Criteria { /** * @param $form */ - static function notes(&$form) { + public static function notes(&$form) { $form->add('hidden', 'hidden_notes', 1); $options = array( @@ -518,7 +518,7 @@ class CRM_Contact_Form_Search_Criteria { * * @return void */ - static function custom(&$form) { + public static function custom(&$form) { $form->add('hidden', 'hidden_custom', 1); $extends = array_merge(array('Contact', 'Individual', 'Household', 'Organization'), CRM_Contact_BAO_ContactType::subTypes() @@ -552,7 +552,7 @@ class CRM_Contact_Form_Search_Criteria { /** * @param $form */ - static function CiviCase(&$form) { + public static function CiviCase(&$form) { //Looks like obsolete code, since CiviCase is a component, but might be used by HRD $form->add('hidden', 'hidden_CiviCase', 1); CRM_Case_BAO_Query::buildSearchForm($form); diff --git a/CRM/Contact/Form/Search/Custom.php b/CRM/Contact/Form/Search/Custom.php index 5c56531532..7b62f26a93 100644 --- a/CRM/Contact/Form/Search/Custom.php +++ b/CRM/Contact/Form/Search/Custom.php @@ -101,14 +101,14 @@ class CRM_Contact_Form_Search_Custom extends CRM_Contact_Form_Search { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { if (method_exists($this->_customSearchClass, 'setDefaultValues')) { return $this->_customClass->setDefaultValues(); } return $this->_formValues; } - function buildQuickForm() { + public function buildQuickForm() { $this->_customClass->buildForm($this); parent::buildQuickForm(); @@ -123,7 +123,7 @@ class CRM_Contact_Form_Search_Custom extends CRM_Contact_Form_Search { /** * @return string */ - function getTemplateFileName() { + public function getTemplateFileName() { $ext = CRM_Extension_System::singleton()->getMapper(); @@ -137,7 +137,7 @@ class CRM_Contact_Form_Search_Custom extends CRM_Contact_Form_Search { return $fileName ? $fileName : parent::getTemplateFileName(); } - function postProcess() { + public function postProcess() { $this->set('isAdvanced', '3'); $this->set('isCustom', '1'); @@ -174,7 +174,7 @@ class CRM_Contact_Form_Search_Custom extends CRM_Contact_Form_Search { * * @return bool */ - function isPermissioned($components) { + public function isPermissioned($components) { if (empty($components)) { return TRUE; } diff --git a/CRM/Contact/Form/Search/Custom/ActivitySearch.php b/CRM/Contact/Form/Search/Custom/ActivitySearch.php index 0e23aa77ed..6003bfe269 100644 --- a/CRM/Contact/Form/Search/Custom/ActivitySearch.php +++ b/CRM/Contact/Form/Search/Custom/ActivitySearch.php @@ -42,7 +42,7 @@ class CRM_Contact_Form_Search_Custom_ActivitySearch implements CRM_Contact_Form_ /** * @param $formValues */ - function __construct(&$formValues) { + public function __construct(&$formValues) { $this->_formValues = $formValues; /** @@ -92,7 +92,7 @@ class CRM_Contact_Form_Search_Custom_ActivitySearch implements CRM_Contact_Form_ /** * @param CRM_Core_Form $form */ - function buildForm(&$form) { + public function buildForm(&$form) { /** * You can define a custom title for the search form @@ -148,7 +148,7 @@ class CRM_Contact_Form_Search_Custom_ActivitySearch implements CRM_Contact_Form_ /** * Define the smarty template used to layout the search form and results listings. */ - function templateFile() { + public function templateFile() { return 'CRM/Contact/Form/Search/Custom/ActivitySearch.tpl'; } @@ -241,7 +241,7 @@ ORDER BY contact_a.sort_name'; /** * @param $row */ - function alterRow(&$row) { + public function alterRow(&$row) { $row['activity_date'] = CRM_Utils_Date::customFormat($row['activity_date'], '%B %E%f, %Y %l:%M %P'); } @@ -249,7 +249,7 @@ ORDER BY contact_a.sort_name'; /** * @return string */ - function from() { + public function from() { $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); @@ -284,7 +284,7 @@ ORDER BY contact_a.sort_name'; * * @return string */ - function where($includeContactIDs = FALSE) { + public function where($includeContactIDs = FALSE) { $clauses = array(); // add contact name search; search on primary name, source contact, assignee @@ -358,7 +358,7 @@ ORDER BY contact_a.sort_name'; * Functions below generally don't need to be modified * @return integer */ - function count() { + public function count() { $sql = $this->all(); $dao = CRM_Core_DAO::executeQuery($sql, @@ -374,21 +374,21 @@ ORDER BY contact_a.sort_name'; * * @return string */ - function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) { + public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) { return $this->all($offset, $rowcount, $sort, FALSE, TRUE); } /** * @return array */ - function &columns() { + public function &columns() { return $this->_columns; } /** * @param $title */ - function setTitle($title) { + public function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); } @@ -400,7 +400,7 @@ ORDER BY contact_a.sort_name'; /** * @return null */ - function summary() { + public function summary() { return NULL; } } diff --git a/CRM/Contact/Form/Search/Custom/Base.php b/CRM/Contact/Form/Search/Custom/Base.php index 28085da147..fe7fa5a45d 100644 --- a/CRM/Contact/Form/Search/Custom/Base.php +++ b/CRM/Contact/Form/Search/Custom/Base.php @@ -43,21 +43,21 @@ class CRM_Contact_Form_Search_Custom_Base { /** * @param $formValues */ - function __construct(&$formValues) { + public function __construct(&$formValues) { $this->_formValues = &$formValues; } /** * @return null|string */ - function count() { + public function count() { return CRM_Core_DAO::singleValueQuery($this->sql('count(distinct contact_a.id) as total')); } /** * @return null */ - function summary() { + public function summary() { return NULL; } @@ -69,7 +69,7 @@ class CRM_Contact_Form_Search_Custom_Base { * * @return string */ - function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) { + public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) { $sql = $this->sql( 'contact_a.id as contact_id', $offset, @@ -127,11 +127,11 @@ class CRM_Contact_Form_Search_Custom_Base { /** * @return null */ - function templateFile() { + public function templateFile() { return NULL; } - function &columns() { + public function &columns() { return $this->_columns; } @@ -139,7 +139,7 @@ class CRM_Contact_Form_Search_Custom_Base { * @param $sql * @param $formValues */ - static function includeContactIDs(&$sql, &$formValues) { + public static function includeContactIDs(&$sql, &$formValues) { $contactIDs = array(); foreach ($formValues as $id => $value) { if ($value && @@ -161,7 +161,7 @@ class CRM_Contact_Form_Search_Custom_Base { * @param $rowcount * @param $sort */ - function addSortOffset(&$sql, $offset, $rowcount, $sort) { + public function addSortOffset(&$sql, $offset, $rowcount, $sort) { if (!empty($sort)) { if (is_string($sort)) { $sort = CRM_Utils_Type::escape($sort, 'String'); @@ -186,7 +186,7 @@ class CRM_Contact_Form_Search_Custom_Base { * * @throws Exception */ - function validateUserSQL(&$sql, $onlyWhere = FALSE) { + public function validateUserSQL(&$sql, $onlyWhere = FALSE) { $includeStrings = array('contact_a'); $excludeStrings = array('insert', 'delete', 'update'); @@ -217,7 +217,7 @@ class CRM_Contact_Form_Search_Custom_Base { * * @return string */ - function whereClause(&$where, &$params) { + public function whereClause(&$where, &$params) { return CRM_Core_DAO::composeQuery($where, $params, TRUE); } @@ -226,7 +226,7 @@ class CRM_Contact_Form_Search_Custom_Base { /** * @return null */ - function getQueryObj() { + public function getQueryObj() { return NULL; } } diff --git a/CRM/Contact/Form/Search/Custom/Basic.php b/CRM/Contact/Form/Search/Custom/Basic.php index 8bd48eb8c7..1ccb5b42f6 100644 --- a/CRM/Contact/Form/Search/Custom/Basic.php +++ b/CRM/Contact/Form/Search/Custom/Basic.php @@ -42,7 +42,7 @@ class CRM_Contact_Form_Search_Custom_Basic extends CRM_Contact_Form_Search_Custo /** * @param $formValues */ - function __construct(&$formValues) { + public function __construct(&$formValues) { parent::__construct($formValues); $this->normalize(); @@ -88,7 +88,7 @@ class CRM_Contact_Form_Search_Custom_Basic extends CRM_Contact_Form_Search_Custo * @return void * @access private */ - function normalize() { + public function normalize() { $contactType = CRM_Utils_Array::value('contact_type', $this->_formValues); if ($contactType && !is_array($contactType)) { unset($this->_formValues['contact_type']); @@ -113,7 +113,7 @@ class CRM_Contact_Form_Search_Custom_Basic extends CRM_Contact_Form_Search_Custo /** * @param CRM_Core_Form $form */ - function buildForm(&$form) { + public function buildForm(&$form) { //@todo FIXME - using the CRM_Core_DAO::VALUE_SEPARATOR creates invalid html - if you can find the form // this is loaded onto then replace with something like '__' & test $separator = CRM_Core_DAO::VALUE_SEPARATOR; @@ -137,7 +137,7 @@ class CRM_Contact_Form_Search_Custom_Basic extends CRM_Contact_Form_Search_Custo /** * @return CRM_Contact_DAO_Contact */ - function count() { + public function count() { return $this->_query->searchQuery(0, 0, NULL, TRUE); } @@ -172,7 +172,7 @@ class CRM_Contact_Form_Search_Custom_Basic extends CRM_Contact_Form_Search_Custo /** * @return string */ - function from() { + public function from() { return $this->_query->_fromClause; } @@ -181,7 +181,7 @@ class CRM_Contact_Form_Search_Custom_Basic extends CRM_Contact_Form_Search_Custo * * @return string|void */ - function where($includeContactIDs = FALSE) { + public function where($includeContactIDs = FALSE) { if ($whereClause = $this->_query->whereClause()) { return $whereClause; } @@ -191,14 +191,14 @@ class CRM_Contact_Form_Search_Custom_Basic extends CRM_Contact_Form_Search_Custo /** * @return string */ - function templateFile() { + public function templateFile() { return 'CRM/Contact/Form/Search/Basic.tpl'; } /** * @return CRM_Contact_BAO_Query */ - function getQueryObj() { + public function getQueryObj() { return $this->_query; } } diff --git a/CRM/Contact/Form/Search/Custom/ContribSYBNT.php b/CRM/Contact/Form/Search/Custom/ContribSYBNT.php index 626fa13d7d..6e5cc7970e 100644 --- a/CRM/Contact/Form/Search/Custom/ContribSYBNT.php +++ b/CRM/Contact/Form/Search/Custom/ContribSYBNT.php @@ -40,7 +40,7 @@ class CRM_Contact_Form_Search_Custom_ContribSYBNT implements CRM_Contact_Form_Se /** * @param $formValues */ - function __construct(&$formValues) { + public function __construct(&$formValues) { $this->_formValues = $formValues; $this->_permissionedComponent = 'CiviContribute'; @@ -87,7 +87,7 @@ class CRM_Contact_Form_Search_Custom_ContribSYBNT implements CRM_Contact_Form_Se /** * @param CRM_Core_Form $form */ - function buildForm(&$form) { + public function buildForm(&$form) { foreach ($this->_amounts as $name => $title) { $form->add('text', @@ -115,7 +115,7 @@ class CRM_Contact_Form_Search_Custom_ContribSYBNT implements CRM_Contact_Form_Se /** * @return mixed */ - function count() { + public function count() { $sql = $this->all(); $dao = CRM_Core_DAO::executeQuery($sql); @@ -129,7 +129,7 @@ class CRM_Contact_Form_Search_Custom_ContribSYBNT implements CRM_Contact_Form_Se * * @return string */ - function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) { + public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) { return $this->all($offset, $rowcount, $sort, FALSE, TRUE); } @@ -203,7 +203,7 @@ ORDER BY donation_amount desc /** * @return string */ - function select() { + public function select() { if (!empty($this->start_date_2) || !empty($this->end_date_2)) { return " sum(contrib_1.total_amount) + sum(contrib_2.total_amount) AS donation_amount, @@ -221,7 +221,7 @@ count(contrib_1.id) AS donation_count /** * @return null|string */ - function from() { + public function from() { $from = NULL; if (!empty($this->start_date_2) || !empty($this->end_date_2)) { $from .= " LEFT JOIN civicrm_contribution contrib_2 ON contrib_2.contact_id = contact_a.id "; @@ -242,7 +242,7 @@ count(contrib_1.id) AS donation_count * * @return string */ - function where($includeContactIDs = FALSE) { + public function where($includeContactIDs = FALSE) { $clauses = array(); if (!empty($this->start_date_1)) { @@ -343,7 +343,7 @@ AND c.receive_date < {$this->start_date_1} * * @return string */ - function having($includeContactIDs = FALSE) { + public function having($includeContactIDs = FALSE) { $clauses = array(); $min = CRM_Utils_Array::value('min_amount', $this->_formValues); if ($min) { @@ -361,28 +361,28 @@ AND c.receive_date < {$this->start_date_1} /** * @return array */ - function &columns() { + public function &columns() { return $this->_columns; } /** * @return string */ - function templateFile() { + public function templateFile() { return 'CRM/Contact/Form/Search/Custom/ContribSYBNT.tpl'; } /** * @return null */ - function summary() { + public function summary() { return NULL; } /** * @param $title */ - function setTitle($title) { + public function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); } diff --git a/CRM/Contact/Form/Search/Custom/ContributionAggregate.php b/CRM/Contact/Form/Search/Custom/ContributionAggregate.php index ab2f2c0655..a216888cbb 100644 --- a/CRM/Contact/Form/Search/Custom/ContributionAggregate.php +++ b/CRM/Contact/Form/Search/Custom/ContributionAggregate.php @@ -40,7 +40,7 @@ class CRM_Contact_Form_Search_Custom_ContributionAggregate implements CRM_Contac /** * @param $formValues */ - function __construct(&$formValues) { + public function __construct(&$formValues) { $this->_formValues = $formValues; /** * Define the columns for search result rows @@ -60,7 +60,7 @@ class CRM_Contact_Form_Search_Custom_ContributionAggregate implements CRM_Contac /** * @param CRM_Core_Form $form */ - function buildForm(&$form) { + public function buildForm(&$form) { /** * You can define a custom title for the search form @@ -100,7 +100,7 @@ class CRM_Contact_Form_Search_Custom_ContributionAggregate implements CRM_Contac /** * Define the smarty template used to layout the search form and results listings. */ - function templateFile() { + public function templateFile() { return 'CRM/Contact/Form/Search/Custom/ContributionAggregate.tpl'; } @@ -167,7 +167,7 @@ $having /** * @return string */ - function from() { + public function from() { return " civicrm_contribution AS contrib, civicrm_contact AS contact_a @@ -183,7 +183,7 @@ civicrm_contact AS contact_a * * @return string */ - function where($includeContactIDs = FALSE) { + public function where($includeContactIDs = FALSE) { $clauses = array(); $clauses[] = "contrib.contact_id = contact_a.id"; @@ -228,7 +228,7 @@ civicrm_contact AS contact_a * * @return string */ - function having($includeContactIDs = FALSE) { + public function having($includeContactIDs = FALSE) { $clauses = array(); $min = CRM_Utils_Array::value('min_amount', $this->_formValues); if ($min) { @@ -248,7 +248,7 @@ civicrm_contact AS contact_a /* * Functions below generally don't need to be modified */ - function count() { + public function count() { $sql = $this->all(); $dao = CRM_Core_DAO::executeQuery($sql, @@ -264,21 +264,21 @@ civicrm_contact AS contact_a * * @return string */ - function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) { + public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) { return $this->all($offset, $rowcount, $sort, FALSE, TRUE); } /** * @return array */ - function &columns() { + public function &columns() { return $this->_columns; } /** * @param $title */ - function setTitle($title) { + public function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); } @@ -290,7 +290,7 @@ civicrm_contact AS contact_a /** * @return null */ - function summary() { + public function summary() { return NULL; } } diff --git a/CRM/Contact/Form/Search/Custom/DateAdded.php b/CRM/Contact/Form/Search/Custom/DateAdded.php index 4574ed6ef5..e4e97865df 100644 --- a/CRM/Contact/Form/Search/Custom/DateAdded.php +++ b/CRM/Contact/Form/Search/Custom/DateAdded.php @@ -39,7 +39,7 @@ class CRM_Contact_Form_Search_Custom_DateAdded extends CRM_Contact_Form_Search_C /** * @param $formValues */ - function __construct(&$formValues) { + public function __construct(&$formValues) { parent::__construct($formValues); $this->_includeGroups = CRM_Utils_Array::value('includeGroups', $formValues, array()); @@ -56,7 +56,7 @@ class CRM_Contact_Form_Search_Custom_DateAdded extends CRM_Contact_Form_Search_C /** * @param CRM_Core_Form $form */ - function buildForm(&$form) { + public function buildForm(&$form) { $form->addDate('start_date', ts('Start Date'), FALSE, array('formatType' => 'custom')); $form->addDate('end_date', ts('End Date'), FALSE, array('formatType' => 'custom')); @@ -104,11 +104,11 @@ class CRM_Contact_Form_Search_Custom_DateAdded extends CRM_Contact_Form_Search_C /** * @return null */ - function summary() { + public function summary() { return NULL; } - function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) { + public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) { return $this->all($offset, $rowcount, $sort, FALSE, TRUE); } @@ -164,7 +164,7 @@ class CRM_Contact_Form_Search_Custom_DateAdded extends CRM_Contact_Form_Search_C /** * @return string */ - function from() { + public function from() { //define table name $randomNum = md5(uniqid()); $this->_tableName = "civicrm_temp_custom_{$randomNum}"; @@ -385,21 +385,21 @@ class CRM_Contact_Form_Search_Custom_DateAdded extends CRM_Contact_Form_Search_C * * @return string */ - function where($includeContactIDs = FALSE) { + public function where($includeContactIDs = FALSE) { return '(1)'; } /** * @return string */ - function templateFile() { + public function templateFile() { return 'CRM/Contact/Form/Search/Custom.tpl'; } /** * @param $title */ - function setTitle($title) { + public function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); } @@ -411,7 +411,7 @@ class CRM_Contact_Form_Search_Custom_DateAdded extends CRM_Contact_Form_Search_C /** * @return mixed */ - function count() { + public function count() { $sql = $this->all(); $dao = CRM_Core_DAO::executeQuery($sql, @@ -420,7 +420,7 @@ class CRM_Contact_Form_Search_Custom_DateAdded extends CRM_Contact_Form_Search_C return $dao->N; } - function __destruct() { + public function __destruct() { //drop the temp. tables if they exist if (!empty($this->_includeGroups)) { $sql = "DROP TEMPORARY TABLE IF EXISTS Ig_{$this->_tableName}"; diff --git a/CRM/Contact/Form/Search/Custom/EmployerListing.php b/CRM/Contact/Form/Search/Custom/EmployerListing.php index c15f1df577..a267d38e8b 100644 --- a/CRM/Contact/Form/Search/Custom/EmployerListing.php +++ b/CRM/Contact/Form/Search/Custom/EmployerListing.php @@ -39,7 +39,7 @@ class CRM_Contact_Form_Search_Custom_EmployerListing implements CRM_Contact_Form /** * @param $formValues */ - function __construct(&$formValues) { + public function __construct(&$formValues) { $this->_formValues = $formValues; /** @@ -57,7 +57,7 @@ class CRM_Contact_Form_Search_Custom_EmployerListing implements CRM_Contact_Form /** * @param CRM_Core_Form $form */ - function buildForm(&$form) { + public function buildForm(&$form) { /** * You can define a custom title for the search form @@ -87,7 +87,7 @@ class CRM_Contact_Form_Search_Custom_EmployerListing implements CRM_Contact_Form * * @return array */ - function setDefaultValues() { + public function setDefaultValues() { // Setting default search state to California return array( 'state_province_id' => 1004, @@ -97,7 +97,7 @@ class CRM_Contact_Form_Search_Custom_EmployerListing implements CRM_Contact_Form /** * Define the smarty template used to layout the search form and results listings. */ - function templateFile() { + public function templateFile() { return 'CRM/Contact/Form/Search/Custom.tpl'; } @@ -159,7 +159,7 @@ class CRM_Contact_Form_Search_Custom_EmployerListing implements CRM_Contact_Form /** * @return string */ - function from() { + public function from() { return " civicrm_relationship cR, civicrm_contact cInd @@ -180,7 +180,7 @@ class CRM_Contact_Form_Search_Custom_EmployerListing implements CRM_Contact_Form * * @return string */ - function where($includeContactIDs = FALSE) { + public function where($includeContactIDs = FALSE) { $clauses = array(); // These are required filters for our query. @@ -232,7 +232,7 @@ class CRM_Contact_Form_Search_Custom_EmployerListing implements CRM_Contact_Form * * @return string */ - function having($includeContactIDs = FALSE) { + public function having($includeContactIDs = FALSE) { $clauses = array(); return implode(' AND ', $clauses); } @@ -240,7 +240,7 @@ class CRM_Contact_Form_Search_Custom_EmployerListing implements CRM_Contact_Form /* * Functions below generally don't need to be modified */ - function count() { + public function count() { $sql = $this->all(); $dao = CRM_Core_DAO::executeQuery($sql, @@ -256,21 +256,21 @@ class CRM_Contact_Form_Search_Custom_EmployerListing implements CRM_Contact_Form * * @return string */ - function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) { + public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) { return $this->all($offset, $rowcount, $sort); } /** * @return array */ - function &columns() { + public function &columns() { return $this->_columns; } /** * @param $title */ - function setTitle($title) { + public function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); } @@ -282,7 +282,7 @@ class CRM_Contact_Form_Search_Custom_EmployerListing implements CRM_Contact_Form /** * @return null */ - function summary() { + public function summary() { return NULL; } } diff --git a/CRM/Contact/Form/Search/Custom/EventAggregate.php b/CRM/Contact/Form/Search/Custom/EventAggregate.php index b09de18327..2adaa5a668 100644 --- a/CRM/Contact/Form/Search/Custom/EventAggregate.php +++ b/CRM/Contact/Form/Search/Custom/EventAggregate.php @@ -40,7 +40,7 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea /** * @param $formValues */ - function __construct(&$formValues) { + public function __construct(&$formValues) { $this->_formValues = $formValues; $this->_permissionedComponent = array('CiviContribute', 'CiviEvent'); @@ -61,7 +61,7 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea /** * @param CRM_Core_Form $form */ - function buildForm(&$form) { + public function buildForm(&$form) { /** * You can define a custom title for the search form @@ -96,7 +96,7 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea /** * Define the smarty template used to layout the search form and results listings. */ - function templateFile() { + public function templateFile() { return 'CRM/Contact/Form/Search/Custom/EventDetails.tpl'; } @@ -177,7 +177,7 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea /** * @return string */ - function from() { + public function from() { return " civicrm_participant_payment left join civicrm_participant @@ -200,7 +200,7 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea * * @return string */ - function where($includeContactIDs = FALSE) { + public function where($includeContactIDs = FALSE) { $clauses = array(); $clauses[] = "civicrm_participant.status_id in ( 1 )"; @@ -254,7 +254,7 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea /** * @return array */ - function summary() { + public function summary() { $totalSelect = " SUM(civicrm_contribution.total_amount) as payment_amount,COUNT(civicrm_participant.id) as participant_count, format(sum(if(civicrm_contribution.payment_instrument_id <>0,(civicrm_contribution.total_amount *.034) +.45,0)),2) as fee, @@ -296,7 +296,7 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea /* * Functions below generally don't need to be modified */ - function count() { + public function count() { $sql = $this->all(); $dao = CRM_Core_DAO::executeQuery($sql, @@ -312,21 +312,21 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea * * @return string */ - function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) { + public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) { return $this->all($offset, $rowcount, $sort); } /** * @return array */ - function &columns() { + public function &columns() { return $this->_columns; } /** * @param $title */ - function setTitle($title) { + public function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); } diff --git a/CRM/Contact/Form/Search/Custom/FullText.php b/CRM/Contact/Form/Search/Custom/FullText.php index 7c1b04644c..17e4736ace 100644 --- a/CRM/Contact/Form/Search/Custom/FullText.php +++ b/CRM/Contact/Form/Search/Custom/FullText.php @@ -78,7 +78,7 @@ class CRM_Contact_Form_Search_Custom_FullText implements CRM_Contact_Form_Search /** * @param $formValues */ - function __construct(&$formValues) { + public function __construct(&$formValues) { $this->_partialQueries = array( new CRM_Contact_Form_Search_Custom_FullText_Contact(), new CRM_Contact_Form_Search_Custom_FullText_Activity(), @@ -131,10 +131,10 @@ class CRM_Contact_Form_Search_Custom_FullText implements CRM_Contact_Form_Search return $value; } - function __destruct() { + public function __destruct() { } - function initialize() { + public function initialize() { static $initialized = FALSE; if (!$initialized) { @@ -146,7 +146,7 @@ class CRM_Contact_Form_Search_Custom_FullText implements CRM_Contact_Form_Search } } - function buildTempTable() { + public function buildTempTable() { $randomNum = md5(uniqid()); $this->_tableName = "civicrm_temp_custom_details_{$randomNum}"; @@ -227,7 +227,7 @@ CREATE TEMPORARY TABLE {$this->_entityIDTableName} ( CRM_Core_DAO::executeQuery($sql); } - function fillTable() { + public function fillTable() { foreach ($this->_partialQueries as $partialQuery) { /** @var $partialQuery CRM_Contact_Form_Search_Custom_FullText_AbstractPartialQuery */ if (!$this->_table || $this->_table == $partialQuery->getName()) { @@ -241,7 +241,7 @@ CREATE TEMPORARY TABLE {$this->_entityIDTableName} ( $this->filterACLContacts(); } - function filterACLContacts() { + public function filterACLContacts() { if (CRM_Core_Permission::check('view all contacts')) { CRM_Core_DAO::executeQuery("DELETE FROM {$this->_tableName} WHERE contact_id IN (SELECT id FROM civicrm_contact WHERE is_deleted = 1)"); return; @@ -290,7 +290,7 @@ WHERE t.table_name = 'Activity' AND /** * @param CRM_Core_Form $form */ - function buildForm(&$form) { + public function buildForm(&$form) { $config = CRM_Core_Config::singleton(); $form->applyFilter('__ALL__', 'trim'); @@ -344,7 +344,7 @@ WHERE t.table_name = 'Activity' AND /** * @return array */ - function &columns() { + public function &columns() { $this->_columns = array( ts('Contact ID') => 'contact_id', ts('Name') => 'sort_name', @@ -356,7 +356,7 @@ WHERE t.table_name = 'Activity' AND /** * @return array */ - function summary() { + public function summary() { $this->initialize(); $summary = array(); @@ -423,7 +423,7 @@ WHERE t.table_name = 'Activity' AND /** * @return null|string */ - function count() { + public function count() { $this->initialize(); if ($this->_table) { @@ -442,7 +442,7 @@ WHERE t.table_name = 'Activity' AND * * @return null|string */ - function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) { + public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) { $this->initialize(); if ($returnSQL) { @@ -462,7 +462,7 @@ WHERE t.table_name = 'Activity' AND * * @return string */ - function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE) { + public function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE) { $this->initialize(); if ($justIDs) { @@ -486,7 +486,7 @@ FROM {$this->_tableName} contact_a /** * @return null */ - function from() { + public function from() { return NULL; } @@ -495,34 +495,34 @@ FROM {$this->_tableName} contact_a * * @return null */ - function where($includeContactIDs = FALSE) { + public function where($includeContactIDs = FALSE) { return NULL; } /** * @return string */ - function templateFile() { + public function templateFile() { return 'CRM/Contact/Form/Search/Custom/FullText.tpl'; } /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { return array(); } /** * @param $row */ - function alterRow(&$row) { + public function alterRow(&$row) { } /** * @param $title */ - function setTitle($title) { + public function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); } diff --git a/CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php b/CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php index c4a3ba9dc7..be9102d858 100644 --- a/CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php +++ b/CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php @@ -92,7 +92,7 @@ abstract class CRM_Contact_Form_Search_Custom_FullText_AbstractPartialQuery { * @param $tables * @param $extends */ - function fillCustomInfo(&$tables, $extends) { + public function fillCustomInfo(&$tables, $extends) { $sql = " SELECT cg.table_name, cf.column_name FROM civicrm_custom_group cg @@ -127,7 +127,7 @@ AND cf.html_type IN ( 'Text', 'TextArea', 'RichTextEditor' ) * - count: int * - files: NULL | array */ - function runQueries($queryText, &$tables, $entityIDTableName, $limit) { + public function runQueries($queryText, &$tables, $entityIDTableName, $limit) { $sql = "TRUNCATE {$entityIDTableName}"; CRM_Core_DAO::executeQuery($sql); diff --git a/CRM/Contact/Form/Search/Custom/FullText/Activity.php b/CRM/Contact/Form/Search/Custom/FullText/Activity.php index 85ee49b513..47450f554a 100644 --- a/CRM/Contact/Form/Search/Custom/FullText/Activity.php +++ b/CRM/Contact/Form/Search/Custom/FullText/Activity.php @@ -34,11 +34,11 @@ */ class CRM_Contact_Form_Search_Custom_FullText_Activity extends CRM_Contact_Form_Search_Custom_FullText_AbstractPartialQuery { - function __construct() { + public function __construct() { parent::__construct('Activity', ts('Activities')); } - function isActive() { + public function isActive() { return CRM_Core_Permission::check('view all activities'); } @@ -60,7 +60,7 @@ class CRM_Contact_Form_Search_Custom_FullText_Activity extends CRM_Contact_Form_ * @param string $entityIDTableName * @return array list tables/queries (for runQueries) */ - function prepareQueries($queryText, $entityIDTableName) { + public function prepareQueries($queryText, $entityIDTableName) { // Note: For available full-text indices, see CRM_Core_InnoDBIndexer $contactSQL = array(); diff --git a/CRM/Contact/Form/Search/Custom/FullText/Case.php b/CRM/Contact/Form/Search/Custom/FullText/Case.php index 8032a565fa..f8f1ae283a 100644 --- a/CRM/Contact/Form/Search/Custom/FullText/Case.php +++ b/CRM/Contact/Form/Search/Custom/FullText/Case.php @@ -34,11 +34,11 @@ */ class CRM_Contact_Form_Search_Custom_FullText_Case extends CRM_Contact_Form_Search_Custom_FullText_AbstractPartialQuery { - function __construct() { + public function __construct() { parent::__construct('Case', ts('Cases')); } - function isActive() { + public function isActive() { $config = CRM_Core_Config::singleton(); return in_array('CiviCase', $config->enableComponents); } @@ -61,7 +61,7 @@ class CRM_Contact_Form_Search_Custom_FullText_Case extends CRM_Contact_Form_Sear * @param string $entityIDTableName * @return array list tables/queries (for runQueries) */ - function prepareQueries($queryText, $entityIDTableName) { + public function prepareQueries($queryText, $entityIDTableName) { // Note: For available full-text indices, see CRM_Core_InnoDBIndexer $contactSQL = array(); diff --git a/CRM/Contact/Form/Search/Custom/FullText/Contact.php b/CRM/Contact/Form/Search/Custom/FullText/Contact.php index 760519df08..3462dbed85 100644 --- a/CRM/Contact/Form/Search/Custom/FullText/Contact.php +++ b/CRM/Contact/Form/Search/Custom/FullText/Contact.php @@ -34,11 +34,11 @@ */ class CRM_Contact_Form_Search_Custom_FullText_Contact extends CRM_Contact_Form_Search_Custom_FullText_AbstractPartialQuery { - function __construct() { + public function __construct() { parent::__construct('Contact', ts('Contacts')); } - function isActive() { + public function isActive() { return CRM_Core_Permission::check('view all contacts'); } @@ -60,7 +60,7 @@ class CRM_Contact_Form_Search_Custom_FullText_Contact extends CRM_Contact_Form_S * @param string $entityIDTableName * @return array list tables/queries (for runQueries) */ - function prepareQueries($queryText, $entityIDTableName) { + public function prepareQueries($queryText, $entityIDTableName) { // Note: For available full-text indices, see CRM_Core_InnoDBIndexer $contactSQL = array(); diff --git a/CRM/Contact/Form/Search/Custom/FullText/Contribution.php b/CRM/Contact/Form/Search/Custom/FullText/Contribution.php index e737dee36e..5ddf8e336d 100644 --- a/CRM/Contact/Form/Search/Custom/FullText/Contribution.php +++ b/CRM/Contact/Form/Search/Custom/FullText/Contribution.php @@ -34,11 +34,11 @@ */ class CRM_Contact_Form_Search_Custom_FullText_Contribution extends CRM_Contact_Form_Search_Custom_FullText_AbstractPartialQuery { - function __construct() { + public function __construct() { parent::__construct('Contribution', ts('Contributions')); } - function isActive() { + public function isActive() { $config = CRM_Core_Config::singleton(); return in_array('CiviContribute', $config->enableComponents) && CRM_Core_Permission::check('access CiviContribute'); @@ -64,7 +64,7 @@ class CRM_Contact_Form_Search_Custom_FullText_Contribution extends CRM_Contact_F * @param string $entityIDTableName * @return array list tables/queries (for runQueries) */ - function prepareQueries($queryText, $entityIDTableName) { + public function prepareQueries($queryText, $entityIDTableName) { // Note: For available full-text indices, see CRM_Core_InnoDBIndexer $contactSQL = array(); diff --git a/CRM/Contact/Form/Search/Custom/FullText/Membership.php b/CRM/Contact/Form/Search/Custom/FullText/Membership.php index 841b764e58..2fad2841c9 100644 --- a/CRM/Contact/Form/Search/Custom/FullText/Membership.php +++ b/CRM/Contact/Form/Search/Custom/FullText/Membership.php @@ -34,11 +34,11 @@ */ class CRM_Contact_Form_Search_Custom_FullText_Membership extends CRM_Contact_Form_Search_Custom_FullText_AbstractPartialQuery { - function __construct() { + public function __construct() { parent::__construct('Membership', ts('Memberships')); } - function isActive() { + public function isActive() { $config = CRM_Core_Config::singleton(); return in_array('CiviMember', $config->enableComponents) && CRM_Core_Permission::check('access CiviMember'); @@ -64,7 +64,7 @@ class CRM_Contact_Form_Search_Custom_FullText_Membership extends CRM_Contact_For * @param string $entityIDTableName * @return array list tables/queries (for runQueries) */ - function prepareQueries($queryText, $entityIDTableName) { + public function prepareQueries($queryText, $entityIDTableName) { // Note: For available full-text indices, see CRM_Core_InnoDBIndexer $contactSQL = array(); diff --git a/CRM/Contact/Form/Search/Custom/FullText/Participant.php b/CRM/Contact/Form/Search/Custom/FullText/Participant.php index 60e077c133..6fab0053e2 100644 --- a/CRM/Contact/Form/Search/Custom/FullText/Participant.php +++ b/CRM/Contact/Form/Search/Custom/FullText/Participant.php @@ -34,11 +34,11 @@ */ class CRM_Contact_Form_Search_Custom_FullText_Participant extends CRM_Contact_Form_Search_Custom_FullText_AbstractPartialQuery { - function __construct() { + public function __construct() { parent::__construct('Participant', ts('Participants')); } - function isActive() { + public function isActive() { $config = CRM_Core_Config::singleton(); return in_array('CiviEvent', $config->enableComponents) && CRM_Core_Permission::check('view event participants'); @@ -64,7 +64,7 @@ class CRM_Contact_Form_Search_Custom_FullText_Participant extends CRM_Contact_Fo * @param string $entityIDTableName * @return array list tables/queries (for runQueries) */ - function prepareQueries($queryText, $entityIDTableName) { + public function prepareQueries($queryText, $entityIDTableName) { // Note: For available full-text indices, see CRM_Core_InnoDBIndexer $contactSQL = array(); diff --git a/CRM/Contact/Form/Search/Custom/Group.php b/CRM/Contact/Form/Search/Custom/Group.php index c1322a985c..789ac02dea 100644 --- a/CRM/Contact/Form/Search/Custom/Group.php +++ b/CRM/Contact/Form/Search/Custom/Group.php @@ -48,7 +48,7 @@ class CRM_Contact_Form_Search_Custom_Group /** * @param $formValues */ - function __construct(&$formValues) { + public function __construct(&$formValues) { $this->_formValues = $formValues; $this->_columns = array( ts('Contact ID') => 'contact_id', @@ -84,7 +84,7 @@ class CRM_Contact_Form_Search_Custom_Group $this->_tags = (!empty($this->_includeTags) || !empty($this->_excludeTags)); } - function __destruct() { + public function __destruct() { // mysql drops the tables when connectiomn is terminated // cannot drop tables here, since the search might be used // in other parts after the object is destroyed @@ -93,7 +93,7 @@ class CRM_Contact_Form_Search_Custom_Group /** * @param CRM_Core_Form $form */ - function buildForm(&$form) { + public function buildForm(&$form) { $this->setTitle(ts('Include / Exclude Search')); @@ -160,7 +160,7 @@ class CRM_Contact_Form_Search_Custom_Group /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array( 'andOr' => '1' ); if (!empty($this->_formValues)) { @@ -264,7 +264,7 @@ class CRM_Contact_Form_Search_Custom_Group * @return string * @throws Exception */ - function from() { + public function from() { $iGroups = $xGroups = $iTags = $xTags = 0; @@ -567,7 +567,7 @@ WHERE gcc.group_id = {$ssGroup->id} * * @return string */ - function where($includeContactIDs = FALSE) { + public function where($includeContactIDs = FALSE) { if ($includeContactIDs) { $contactIDs = array(); @@ -598,7 +598,7 @@ WHERE gcc.group_id = {$ssGroup->id} /** * @return mixed */ - function count() { + public function count() { $sql = $this->all(); $dao = CRM_Core_DAO::executeQuery($sql); @@ -613,35 +613,35 @@ WHERE gcc.group_id = {$ssGroup->id} * * @return string */ - function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) { + public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) { return $this->all($offset, $rowcount, $sort, FALSE, TRUE); } /** * @return array */ - function &columns() { + public function &columns() { return $this->_columns; } /** * @return null */ - function summary() { + public function summary() { return NULL; } /** * @return string */ - function templateFile() { + public function templateFile() { return 'CRM/Contact/Form/Search/Custom.tpl'; } /** * @param $title */ - function setTitle($title) { + public function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); } @@ -653,7 +653,7 @@ WHERE gcc.group_id = {$ssGroup->id} /** * @param string $tableAlias */ - function buildACLClause($tableAlias = 'contact') { + public function buildACLClause($tableAlias = 'contact') { list($this->_aclFrom, $this->_aclWhere) = CRM_Contact_BAO_Contact_Permission::cacheClause($tableAlias); } } diff --git a/CRM/Contact/Form/Search/Custom/MultipleValues.php b/CRM/Contact/Form/Search/Custom/MultipleValues.php index f71fea12f8..5e03b35658 100644 --- a/CRM/Contact/Form/Search/Custom/MultipleValues.php +++ b/CRM/Contact/Form/Search/Custom/MultipleValues.php @@ -41,7 +41,7 @@ class CRM_Contact_Form_Search_Custom_MultipleValues extends CRM_Contact_Form_Sea /** * @param $formValues */ - function __construct(&$formValues) { + public function __construct(&$formValues) { parent::__construct($formValues); $this->_groupTree = CRM_Core_BAO_CustomGroup::getTree("'Contact', 'Individual', 'Organization', 'Household'", @@ -66,7 +66,7 @@ class CRM_Contact_Form_Search_Custom_MultipleValues extends CRM_Contact_Form_Sea } } - function addColumns() { + public function addColumns() { // add all the fields for chosen groups $this->_tables = $this->_options = array(); foreach ($this->_groupTree as $groupID => $group) { @@ -94,7 +94,7 @@ class CRM_Contact_Form_Search_Custom_MultipleValues extends CRM_Contact_Form_Sea /** * @param CRM_Core_Form $form */ - function buildForm(&$form) { + public function buildForm(&$form) { /** * You can define a custom title for the search form @@ -137,11 +137,11 @@ class CRM_Contact_Form_Search_Custom_MultipleValues extends CRM_Contact_Form_Sea /** * @return null */ - function summary() { + public function summary() { return NULL; } - function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) { + public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) { return $this->all($offset, $rowcount, $sort, FALSE, TRUE); } @@ -154,7 +154,7 @@ class CRM_Contact_Form_Search_Custom_MultipleValues extends CRM_Contact_Form_Sea * * @return string */ - function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE) { + public function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE) { //redirect if custom group not select in search criteria if (empty($this->_formValues['custom_group'])) { CRM_Core_Error::statusBounce(ts("You must select at least one Custom Group as a search criteria."), @@ -196,7 +196,7 @@ contact_a.sort_name as sort_name, /** * @return string */ - function from() { + public function from() { $from = "FROM civicrm_contact contact_a"; $customFrom = array(); // lets do an INNER JOIN so we get only relevant values rather than all values @@ -226,7 +226,7 @@ contact_a.sort_name as sort_name, * * @return string */ - function where($includeContactIDs = FALSE) { + public function where($includeContactIDs = FALSE) { $count = 1; $clause = array(); $params = array(); @@ -274,21 +274,21 @@ contact_a.sort_name as sort_name, /** * @return string */ - function templateFile() { + public function templateFile() { return 'CRM/Contact/Form/Search/Custom/MultipleValues.tpl'; } /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { return array(); } /** * @param $row */ - function alterRow(&$row) { + public function alterRow(&$row) { foreach ($this->_options as $fieldID => $values) { $customVal = $valueSeparatedArray = array(); if (in_array($values['attributes']['html_type'], @@ -342,7 +342,7 @@ contact_a.sort_name as sort_name, /** * @param $title */ - function setTitle($title) { + public function setTitle($title) { CRM_Utils_System::setTitle($title); } } diff --git a/CRM/Contact/Form/Search/Custom/PostalMailing.php b/CRM/Contact/Form/Search/Custom/PostalMailing.php index dc9fcd4328..4e30937807 100644 --- a/CRM/Contact/Form/Search/Custom/PostalMailing.php +++ b/CRM/Contact/Form/Search/Custom/PostalMailing.php @@ -36,7 +36,7 @@ class CRM_Contact_Form_Search_Custom_PostalMailing extends CRM_Contact_Form_Sear /** * @param $formValues */ - function __construct(&$formValues) { + public function __construct(&$formValues) { parent::__construct($formValues); $this->_columns = array( @@ -51,7 +51,7 @@ class CRM_Contact_Form_Search_Custom_PostalMailing extends CRM_Contact_Form_Sear /** * @param CRM_Core_Form $form */ - function buildForm(&$form) { + public function buildForm(&$form) { $groups = array('' => ts('- select group -')) + CRM_Core_PseudoConstant::nestedGroup(FALSE); $form->addElement('select', 'group_id', ts('Group'), $groups, array('class' => 'crm-select2 huge')); @@ -62,7 +62,7 @@ class CRM_Contact_Form_Search_Custom_PostalMailing extends CRM_Contact_Form_Sear $form->assign('elements', array('group_id')); } - function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) { + public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) { return $this->all($offset, $rowcount, $sort, FALSE, TRUE); } @@ -101,7 +101,7 @@ state_province.name as state_province /** * @return string */ - function from() { + public function from() { return " FROM civicrm_group_contact as cgc, civicrm_contact as contact_a @@ -116,7 +116,7 @@ LEFT JOIN civicrm_state_province state_province ON state_province.id = address. * * @return string */ - function where($includeContactIDs = FALSE) { + public function where($includeContactIDs = FALSE) { $params = array(); $count = 1; @@ -145,7 +145,7 @@ LEFT JOIN civicrm_state_province state_province ON state_province.id = address. /** * @return string */ - function templateFile() { + public function templateFile() { return 'CRM/Contact/Form/Search/Custom.tpl'; } } diff --git a/CRM/Contact/Form/Search/Custom/PriceSet.php b/CRM/Contact/Form/Search/Custom/PriceSet.php index e155e6ec68..a623796fd8 100644 --- a/CRM/Contact/Form/Search/Custom/PriceSet.php +++ b/CRM/Contact/Form/Search/Custom/PriceSet.php @@ -42,7 +42,7 @@ class CRM_Contact_Form_Search_Custom_PriceSet extends CRM_Contact_Form_Search_Cu /** * @param $formValues */ - function __construct(&$formValues) { + public function __construct(&$formValues) { parent::__construct($formValues); $this->_eventID = CRM_Utils_Array::value('event_id', @@ -60,7 +60,7 @@ class CRM_Contact_Form_Search_Custom_PriceSet extends CRM_Contact_Form_Search_Cu $this->_permissionedComponent = 'CiviEvent'; } - function __destruct() { + public function __destruct() { /* if ( $this->_eventID ) { $sql = "DROP TEMPORARY TABLE {$this->_tableName}"; @@ -69,7 +69,7 @@ class CRM_Contact_Form_Search_Custom_PriceSet extends CRM_Contact_Form_Search_Cu */ } - function buildTempTable() { + public function buildTempTable() { $randomNum = md5(uniqid()); $this->_tableName = "civicrm_temp_custom_{$randomNum}"; $sql = " @@ -99,7 +99,7 @@ UNIQUE INDEX unique_participant_id ( participant_id ) CRM_Core_DAO::executeQuery($sql); } - function fillTable() { + public function fillTable() { $sql = " REPLACE INTO {$this->_tableName} ( contact_id, participant_id ) @@ -159,7 +159,7 @@ WHERE participant_id = $participantID; * * @return Object */ - function priceSetDAO($eventID = NULL) { + public function priceSetDAO($eventID = NULL) { // get all the events that have a price set associated with it $sql = " @@ -190,7 +190,7 @@ AND p.entity_id = e.id * * @throws Exception */ - function buildForm(&$form) { + public function buildForm(&$form) { $dao = $this->priceSetDAO(); $event = array(); @@ -221,7 +221,7 @@ AND p.entity_id = e.id $form->assign('elements', array('event_id')); } - function setColumns() { + public function setColumns() { $this->_columns = array( ts('Contact ID') => 'contact_id', ts('Participant ID') => 'participant_id', @@ -263,7 +263,7 @@ AND p.entity_id = e.id /** * @return null */ - function summary() { + public function summary() { return NULL; } @@ -307,7 +307,7 @@ contact_a.display_name as display_name"; /** * @return string */ - function from() { + public function from() { return " FROM civicrm_contact contact_a INNER JOIN {$this->_tableName} tempTable ON ( tempTable.contact_id = contact_a.id ) @@ -319,33 +319,33 @@ INNER JOIN {$this->_tableName} tempTable ON ( tempTable.contact_id = contact_a.i * * @return string */ - function where($includeContactIDs = FALSE) { + public function where($includeContactIDs = FALSE) { return ' ( 1 ) '; } /** * @return string */ - function templateFile() { + public function templateFile() { return 'CRM/Contact/Form/Search/Custom.tpl'; } /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { return array(); } /** * @param $row */ - function alterRow(&$row) {} + public function alterRow(&$row) {} /** * @param $title */ - function setTitle($title) { + public function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); } diff --git a/CRM/Contact/Form/Search/Custom/Proximity.php b/CRM/Contact/Form/Search/Custom/Proximity.php index c77da44c38..ac8ee30ecb 100644 --- a/CRM/Contact/Form/Search/Custom/Proximity.php +++ b/CRM/Contact/Form/Search/Custom/Proximity.php @@ -43,7 +43,7 @@ class CRM_Contact_Form_Search_Custom_Proximity extends CRM_Contact_Form_Search_C * * @throws Exception */ - function __construct(&$formValues) { + public function __construct(&$formValues) { parent::__construct($formValues); // unset search profile and other search params if set @@ -99,7 +99,7 @@ class CRM_Contact_Form_Search_Custom_Proximity extends CRM_Contact_Form_Search_C /** * @param CRM_Core_Form $form */ - function buildForm(&$form) { + public function buildForm(&$form) { $config = CRM_Core_Config::singleton(); $countryDefault = $config->defaultContactCountry; @@ -197,7 +197,7 @@ country.name as country /** * @return string */ - function from() { + public function from() { $f = " FROM civicrm_contact contact_a LEFT JOIN civicrm_address address ON ( address.contact_id = contact_a.id AND @@ -226,7 +226,7 @@ LEFT JOIN civicrm_group_contact cgc ON ( cgc.contact_id = contact_a.id AND cgc.s * * @return string */ - function where($includeContactIDs = FALSE) { + public function where($includeContactIDs = FALSE) { $params = array(); $clause = array(); @@ -255,14 +255,14 @@ AND cgc.group_id = {$this->_group} /** * @return string */ - function templateFile() { + public function templateFile() { return 'CRM/Contact/Form/Search/Custom/Proximity.tpl'; } /** * @return array|null */ - function setDefaultValues() { + public function setDefaultValues() { $config = CRM_Core_Config::singleton(); $countryDefault = $config->defaultContactCountry; $stateprovinceDefault = $config->defaultContactStateProvince; @@ -287,12 +287,12 @@ AND cgc.group_id = {$this->_group} /** * @param $row */ - function alterRow(&$row) {} + public function alterRow(&$row) {} /** * @param $title */ - function setTitle($title) { + public function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); } diff --git a/CRM/Contact/Form/Search/Custom/RandomSegment.php b/CRM/Contact/Form/Search/Custom/RandomSegment.php index 4ec5edd722..720504fba0 100644 --- a/CRM/Contact/Form/Search/Custom/RandomSegment.php +++ b/CRM/Contact/Form/Search/Custom/RandomSegment.php @@ -39,7 +39,7 @@ class CRM_Contact_Form_Search_Custom_RandomSegment extends CRM_Contact_Form_Sear /** * @param $formValues */ - function __construct(&$formValues) { + public function __construct(&$formValues) { parent::__construct($formValues); $this->_columns = array( @@ -52,7 +52,7 @@ class CRM_Contact_Form_Search_Custom_RandomSegment extends CRM_Contact_Form_Sear $this->initialize(); } - function initialize() { + public function initialize() { $this->_segmentSize = CRM_Utils_Array::value('segmentSize', $this->_formValues); $this->_includeGroups = CRM_Utils_Array::value('includeGroups', $this->_formValues); @@ -76,7 +76,7 @@ class CRM_Contact_Form_Search_Custom_RandomSegment extends CRM_Contact_Form_Sear /** * @param CRM_Core_Form $form */ - function buildForm(&$form) { + public function buildForm(&$form) { $form->add('text', 'segmentSize', ts('Segment Size'), @@ -118,7 +118,7 @@ class CRM_Contact_Form_Search_Custom_RandomSegment extends CRM_Contact_Form_Sear /** * @return null */ - function summary() { + public function summary() { return NULL; } @@ -153,7 +153,7 @@ class CRM_Contact_Form_Search_Custom_RandomSegment extends CRM_Contact_Form_Sear /** * @return string */ - function from() { + public function from() { //define table name $randomNum = md5(uniqid()); $this->_tableName = "civicrm_temp_custom_{$randomNum}"; @@ -335,21 +335,21 @@ class CRM_Contact_Form_Search_Custom_RandomSegment extends CRM_Contact_Form_Sear * * @return string */ - function where($includeContactIDs = FALSE) { + public function where($includeContactIDs = FALSE) { return '(1)'; } /** * @return string */ - function templateFile() { + public function templateFile() { return 'CRM/Contact/Form/Search/Custom.tpl'; } /** * @param $title */ - function setTitle($title) { + public function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); } @@ -364,14 +364,14 @@ class CRM_Contact_Form_Search_Custom_RandomSegment extends CRM_Contact_Form_Sear /** * @return mixed */ - function count() { + public function count() { $sql = $this->all(); $dao = CRM_Core_DAO::executeQuery($sql); return $dao->N; } - function __destruct() { + public function __destruct() { // the temporary tables are dropped automatically // so we don't do it here // but let mysql clean up diff --git a/CRM/Contact/Form/Search/Custom/Sample.php b/CRM/Contact/Form/Search/Custom/Sample.php index 241fc29c57..6d9bd2d7be 100644 --- a/CRM/Contact/Form/Search/Custom/Sample.php +++ b/CRM/Contact/Form/Search/Custom/Sample.php @@ -36,7 +36,7 @@ class CRM_Contact_Form_Search_Custom_Sample extends CRM_Contact_Form_Search_Cust /** * @param $formValues */ - function __construct(&$formValues) { + public function __construct(&$formValues) { parent::__construct($formValues); if (!isset($formValues['state_province_id'])) { @@ -59,7 +59,7 @@ class CRM_Contact_Form_Search_Custom_Sample extends CRM_Contact_Form_Search_Cust /** * @param CRM_Core_Form $form */ - function buildForm(&$form) { + public function buildForm(&$form) { $form->add('text', 'household_name', @@ -85,7 +85,7 @@ class CRM_Contact_Form_Search_Custom_Sample extends CRM_Contact_Form_Search_Cust /** * @return array */ - function summary() { + public function summary() { $summary = array( 'summary' => 'This is a summary', 'total' => 50.0, @@ -93,7 +93,7 @@ class CRM_Contact_Form_Search_Custom_Sample extends CRM_Contact_Form_Search_Cust return $summary; } - function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) { + public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) { return $this->all($offset, $rowcount, $sort, FALSE, TRUE); } @@ -131,7 +131,7 @@ state_province.name as state_province /** * @return string */ - function from() { + public function from() { return " FROM civicrm_contact contact_a LEFT JOIN civicrm_address address ON ( address.contact_id = contact_a.id AND @@ -147,7 +147,7 @@ LEFT JOIN civicrm_state_province state_province ON state_province.id = address.s * * @return string */ - function where($includeContactIDs = FALSE) { + public function where($includeContactIDs = FALSE) { $params = array(); $where = "contact_a.contact_type = 'Household'"; @@ -189,14 +189,14 @@ LEFT JOIN civicrm_state_province state_province ON state_province.id = address.s /** * @return string */ - function templateFile() { + public function templateFile() { return 'CRM/Contact/Form/Search/Custom.tpl'; } /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { return array( 'household_name' => '', ); @@ -205,14 +205,14 @@ LEFT JOIN civicrm_state_province state_province ON state_province.id = address.s /** * @param $row */ - function alterRow(&$row) { + public function alterRow(&$row) { $row['sort_name'] .= ' ( altered )'; } /** * @param $title */ - function setTitle($title) { + public function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); } diff --git a/CRM/Contact/Form/Search/Custom/TagContributions.php b/CRM/Contact/Form/Search/Custom/TagContributions.php index cb380d2188..242d2f24ac 100644 --- a/CRM/Contact/Form/Search/Custom/TagContributions.php +++ b/CRM/Contact/Form/Search/Custom/TagContributions.php @@ -40,7 +40,7 @@ class CRM_Contact_Form_Search_Custom_TagContributions implements CRM_Contact_For /** * @param $formValues */ - function __construct(&$formValues) { + public function __construct(&$formValues) { $this->_formValues = $formValues; $this->_permissionedComponent = 'CiviContribute'; @@ -60,7 +60,7 @@ class CRM_Contact_Form_Search_Custom_TagContributions implements CRM_Contact_For /** * @param CRM_Core_Form $form */ - function buildForm(&$form) { + public function buildForm(&$form) { /** * You can define a custom title for the search form @@ -87,7 +87,7 @@ class CRM_Contact_Form_Search_Custom_TagContributions implements CRM_Contact_For /** * Define the smarty template used to layout the search form and results listings. */ - function templateFile() { + public function templateFile() { return 'CRM/Contact/Form/Search/Custom.tpl'; } @@ -143,7 +143,7 @@ WHERE $where /** * @return string */ - function from() { + public function from() { return " civicrm_contribution, civicrm_contact contact_a @@ -162,7 +162,7 @@ WHERE $where * * @return string */ - function where($includeContactIDs = FALSE) { + public function where($includeContactIDs = FALSE) { $clauses = array(); $clauses[] = "contact_a.contact_type = 'Individual'"; @@ -212,7 +212,7 @@ WHERE $where /** * @return mixed */ - function count() { + public function count() { $sql = $this->all(); $dao = CRM_Core_DAO::executeQuery($sql, @@ -228,21 +228,21 @@ WHERE $where * * @return string */ - function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) { + public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) { return $this->all($offset, $rowcount, $sort, FALSE, TRUE); } /** * @return array */ - function &columns() { + public function &columns() { return $this->_columns; } /** * @param $title */ - function setTitle($title) { + public function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); } @@ -254,7 +254,7 @@ WHERE $where /** * @return null */ - function summary() { + public function summary() { return NULL; } } diff --git a/CRM/Contact/Form/Search/Custom/ZipCodeRange.php b/CRM/Contact/Form/Search/Custom/ZipCodeRange.php index a13dbf888a..f1426186bc 100644 --- a/CRM/Contact/Form/Search/Custom/ZipCodeRange.php +++ b/CRM/Contact/Form/Search/Custom/ZipCodeRange.php @@ -36,7 +36,7 @@ class CRM_Contact_Form_Search_Custom_ZipCodeRange extends CRM_Contact_Form_Searc /** * @param $formValues */ - function __construct(&$formValues) { + public function __construct(&$formValues) { parent::__construct($formValues); $this->_columns = array( @@ -50,7 +50,7 @@ class CRM_Contact_Form_Search_Custom_ZipCodeRange extends CRM_Contact_Form_Searc /** * @param CRM_Core_Form $form */ - function buildForm(&$form) { + public function buildForm(&$form) { $form->add('text', 'postal_code_low', ts('Postal Code Start'), @@ -78,12 +78,12 @@ class CRM_Contact_Form_Search_Custom_ZipCodeRange extends CRM_Contact_Form_Searc /** * @return array */ - function summary() { + public function summary() { $summary = array(); return $summary; } - function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) { + public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = FALSE) { return $this->all($offset, $rowcount, $sort, FALSE, TRUE); } @@ -120,7 +120,7 @@ address.postal_code as postal_code /** * @return string */ - function from() { + public function from() { return " FROM civicrm_contact contact_a LEFT JOIN civicrm_address address ON ( address.contact_id = contact_a.id AND @@ -135,7 +135,7 @@ LEFT JOIN civicrm_email email ON ( email.contact_id = contact_a.id AND * * @return string */ - function where($includeContactIDs = FALSE) { + public function where($includeContactIDs = FALSE) { $params = array(); $low = CRM_Utils_Array::value('postal_code_low', @@ -164,21 +164,21 @@ LEFT JOIN civicrm_email email ON ( email.contact_id = contact_a.id AND /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { return array(); } /** * @return string */ - function templateFile() { + public function templateFile() { return 'CRM/Contact/Form/Search/Custom.tpl'; } /** * @param $title */ - function setTitle($title) { + public function setTitle($title) { if ($title) { CRM_Utils_System::setTitle($title); } diff --git a/CRM/Contact/Form/Search/Interface.php b/CRM/Contact/Form/Search/Interface.php index b8c68d9d99..1a0972d2e6 100644 --- a/CRM/Contact/Form/Search/Interface.php +++ b/CRM/Contact/Form/Search/Interface.php @@ -37,12 +37,12 @@ interface CRM_Contact_Form_Search_Interface { /** * The constructor gets the submitted form values */ - function __construct(&$formValues); + public function __construct(&$formValues); /** * Builds the quickform for this search */ - function buildForm(&$form); + public function buildForm(&$form); /** * Builds the search query for various cases. We break it down into finer cases @@ -55,26 +55,26 @@ interface CRM_Contact_Form_Search_Interface { * Count of records that match the current input parameters * Used by pager */ - function count(); + public function count(); /** * Summary information for the query that can be displayed in the template * This is useful to pass total / sub total information if needed */ - function summary(); + public function summary(); /** * List of contact ids that match the current input parameters * Used by different tasks. Will be also used to optimize the * 'all' query below to avoid excessive LEFT JOIN blowup */ - function contactIDs($offset = 0, $rowcount = 0, $sort = NULL); + public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL); /** * Retrieve all the values that match the current input parameters * Used by the selector */ - function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE); + public function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE); /** * The below two functions (from and where) are ONLY used if you want to @@ -89,21 +89,21 @@ interface CRM_Contact_Form_Search_Interface { /** * The from clause for the query */ - function from(); + public function from(); /** * The where clause for the query */ - function where($includeContactIDs = FALSE); + public function where($includeContactIDs = FALSE); /** * The template FileName to use to display the results */ - function templateFile(); + public function templateFile(); /** * Returns an array of column headers and field names and sort options */ - function &columns(); + public function &columns(); } diff --git a/CRM/Contact/Form/Task.php b/CRM/Contact/Form/Task.php index 4c1b8d07fd..9838d8e622 100644 --- a/CRM/Contact/Form/Task.php +++ b/CRM/Contact/Form/Task.php @@ -94,7 +94,7 @@ class CRM_Contact_Form_Task extends CRM_Core_Form { * @return void * @access public */ - function preProcess() { + public function preProcess() { self::preProcessCommon($this); } @@ -102,7 +102,7 @@ class CRM_Contact_Form_Task extends CRM_Core_Form { * @param CRM_Core_Form $form * @param bool $useTable */ - static function preProcessCommon(&$form, $useTable = FALSE) { + public static function preProcessCommon(&$form, $useTable = FALSE) { $form->_contactIds = array(); $form->_contactTypes = array(); @@ -334,7 +334,7 @@ class CRM_Contact_Form_Task extends CRM_Core_Form { * * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); return $defaults; } @@ -345,7 +345,7 @@ class CRM_Contact_Form_Task extends CRM_Core_Form { * @return void * @access public */ - function addRules() { + public function addRules() { } /** @@ -380,7 +380,7 @@ class CRM_Contact_Form_Task extends CRM_Core_Form { * @return void * @access public */ - function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { + public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { $this->addButtons(array( array( 'type' => $nextType, diff --git a/CRM/Contact/Form/Task/AddToGroup.php b/CRM/Contact/Form/Task/AddToGroup.php index 5a68ca96c0..ecd694b2ba 100644 --- a/CRM/Contact/Form/Task/AddToGroup.php +++ b/CRM/Contact/Form/Task/AddToGroup.php @@ -67,7 +67,7 @@ class CRM_Contact_Form_Task_AddToGroup extends CRM_Contact_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { /* * initialize the task and row fields */ @@ -84,7 +84,7 @@ class CRM_Contact_Form_Task_AddToGroup extends CRM_Contact_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { //create radio buttons to select existing group or add a new group $options = array(ts('Add Contact To Existing Group'), ts('Create New Group')); @@ -157,7 +157,7 @@ class CRM_Contact_Form_Task_AddToGroup extends CRM_Contact_Form_Task { * * @return array the default array reference */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); if ($this->_context === 'amtg') { @@ -175,7 +175,7 @@ class CRM_Contact_Form_Task_AddToGroup extends CRM_Contact_Form_Task { * * @return void */ - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Contact_Form_task_AddToGroup', 'formRule')); } @@ -188,7 +188,7 @@ class CRM_Contact_Form_Task_AddToGroup extends CRM_Contact_Form_Task { * @static * @access public */ - static function formRule($params) { + public static function formRule($params) { $errors = array(); if (!empty($params['group_option']) && empty($params['title'])) { diff --git a/CRM/Contact/Form/Task/AddToHousehold.php b/CRM/Contact/Form/Task/AddToHousehold.php index ffe0766a12..691c93b992 100644 --- a/CRM/Contact/Form/Task/AddToHousehold.php +++ b/CRM/Contact/Form/Task/AddToHousehold.php @@ -45,7 +45,7 @@ class CRM_Contact_Form_Task_AddToHousehold extends CRM_Contact_Form_Task { * * @return void */ - function preProcess() { + public function preProcess() { /* * initialize the task and row fields */ @@ -60,7 +60,7 @@ class CRM_Contact_Form_Task_AddToHousehold extends CRM_Contact_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { CRM_Utils_System::setTitle(ts('Add Members to Household')); $this->addElement('text', 'name', ts('Find Target Household')); @@ -185,7 +185,7 @@ class CRM_Contact_Form_Task_AddToHousehold extends CRM_Contact_Form_Task { * * @return void */ - function search(&$form, &$params) { + public function search(&$form, &$params) { //max records that will be listed $searchValues = array(); if (!empty($params['rel_contact'])) { diff --git a/CRM/Contact/Form/Task/AddToOrganization.php b/CRM/Contact/Form/Task/AddToOrganization.php index b167015558..b7e154c2b1 100644 --- a/CRM/Contact/Form/Task/AddToOrganization.php +++ b/CRM/Contact/Form/Task/AddToOrganization.php @@ -45,7 +45,7 @@ class CRM_Contact_Form_Task_AddToOrganization extends CRM_Contact_Form_Task { * * @return void */ - function preProcess() { + public function preProcess() { // initialize the task and row fields parent::preProcess(); } @@ -57,7 +57,7 @@ class CRM_Contact_Form_Task_AddToOrganization extends CRM_Contact_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { CRM_Utils_System::setTitle(ts('Add Contacts to Organization')); $this->addElement('text', 'name', ts('Find Target Organization')); diff --git a/CRM/Contact/Form/Task/AddToTag.php b/CRM/Contact/Form/Task/AddToTag.php index 3d6322d1c0..d735f24f07 100644 --- a/CRM/Contact/Form/Task/AddToTag.php +++ b/CRM/Contact/Form/Task/AddToTag.php @@ -61,7 +61,7 @@ class CRM_Contact_Form_Task_AddToTag extends CRM_Contact_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { // add select for tag $this->_tags = CRM_Core_BAO_Tag::getTags(); @@ -75,7 +75,7 @@ class CRM_Contact_Form_Task_AddToTag extends CRM_Contact_Form_Task { $this->addDefaultButtons(ts('Tag Contacts')); } - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Contact_Form_Task_AddToTag', 'formRule')); } @@ -85,7 +85,7 @@ class CRM_Contact_Form_Task_AddToTag extends CRM_Contact_Form_Task { * * @return array */ - static function formRule($form, $rule) { + public static function formRule($form, $rule) { $errors = array(); if (empty($form['tag']) && empty($form['contact_taglist'])) { $errors['_qf_default'] = ts("Please select at least one tag."); diff --git a/CRM/Contact/Form/Task/AlterPreferences.php b/CRM/Contact/Form/Task/AlterPreferences.php index b303e4d3f6..1113fdbca5 100644 --- a/CRM/Contact/Form/Task/AlterPreferences.php +++ b/CRM/Contact/Form/Task/AlterPreferences.php @@ -46,7 +46,7 @@ class CRM_Contact_Form_Task_AlterPreferences extends CRM_Contact_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { // add select for preferences $options = array(ts('Add Selected Options'), ts('Remove selected options')); @@ -62,7 +62,7 @@ class CRM_Contact_Form_Task_AlterPreferences extends CRM_Contact_Form_Task { $this->addDefaultButtons(ts('Set Privacy Options')); } - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Contact_Form_Task_AlterPreferences', 'formRule')); } @@ -73,7 +73,7 @@ class CRM_Contact_Form_Task_AlterPreferences extends CRM_Contact_Form_Task { * * @return array the default array reference */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $defaults['actionTypeOption'] = 0; @@ -86,7 +86,7 @@ class CRM_Contact_Form_Task_AlterPreferences extends CRM_Contact_Form_Task { * * @return array */ - static function formRule($form, $rule) { + public static function formRule($form, $rule) { $errors = array(); if (empty($form['pref']) && empty($form['contact_taglist'])) { $errors['_qf_default'] = ts("Please select at least one privacy option."); diff --git a/CRM/Contact/Form/Task/Batch.php b/CRM/Contact/Form/Task/Batch.php index 337922f0ea..954df6931f 100644 --- a/CRM/Contact/Form/Task/Batch.php +++ b/CRM/Contact/Form/Task/Batch.php @@ -74,7 +74,7 @@ class CRM_Contact_Form_Task_Batch extends CRM_Contact_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { /* * initialize the task and row fields */ @@ -88,7 +88,7 @@ class CRM_Contact_Form_Task_Batch extends CRM_Contact_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $ufGroupId = $this->get('ufGroupId'); if (!$ufGroupId) { @@ -172,7 +172,7 @@ class CRM_Contact_Form_Task_Batch extends CRM_Contact_Form_Task { * * @return array */ - function setDefaultValues() { + public function setDefaultValues() { if (empty($this->_fields)) { return; } @@ -204,7 +204,7 @@ class CRM_Contact_Form_Task_Batch extends CRM_Contact_Form_Task { * @access public * @static */ - static function formRule($fields) { + public static function formRule($fields) { $errors = array(); $externalIdentifiers = array(); foreach ($fields['field'] as $componentId => $field) { diff --git a/CRM/Contact/Form/Task/Delete.php b/CRM/Contact/Form/Task/Delete.php index ecefcad7ba..32db1e7b4a 100644 --- a/CRM/Contact/Form/Task/Delete.php +++ b/CRM/Contact/Form/Task/Delete.php @@ -59,7 +59,7 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, FALSE @@ -147,7 +147,7 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $label = $this->_restore ? ts('Restore Contact(s)') : ts('Delete Contact(s)'); if ($this->_single) { @@ -184,7 +184,7 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task { * @access public * @static */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { // CRM-12929 $error = array(); if ($self->_skipUndelete) { diff --git a/CRM/Contact/Form/Task/Email.php b/CRM/Contact/Form/Task/Email.php index e684ac3278..9a6aafa1a3 100644 --- a/CRM/Contact/Form/Task/Email.php +++ b/CRM/Contact/Form/Task/Email.php @@ -98,7 +98,7 @@ class CRM_Contact_Form_Task_Email extends CRM_Contact_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { // store case id if present $this->_caseId = CRM_Utils_Request::retrieve('caseid', 'String', $this, FALSE); $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this); diff --git a/CRM/Contact/Form/Task/EmailCommon.php b/CRM/Contact/Form/Task/EmailCommon.php index 8e8e6fa611..d96623738a 100644 --- a/CRM/Contact/Form/Task/EmailCommon.php +++ b/CRM/Contact/Form/Task/EmailCommon.php @@ -48,7 +48,7 @@ class CRM_Contact_Form_Task_EmailCommon { /** * @param CRM_Core_Form $form */ - static function preProcessFromAddress(&$form) { + public static function preProcessFromAddress(&$form) { $form->_single = FALSE; $className = CRM_Utils_System::getClassName($form); if (property_exists($form, '_context') && @@ -138,7 +138,7 @@ class CRM_Contact_Form_Task_EmailCommon { * * @return void */ - static function buildQuickForm(&$form) { + public static function buildQuickForm(&$form) { $toArray = $ccArray = $bccArray = array(); $suppressedEmails = 0; //here we are getting logged in user id as array but we need target contact id. CRM-5988 @@ -327,7 +327,7 @@ class CRM_Contact_Form_Task_EmailCommon { * @access public * */ - static function formRule($fields, $dontCare, $self) { + public static function formRule($fields, $dontCare, $self) { $errors = array(); $template = CRM_Core_Smarty::singleton(); @@ -354,7 +354,7 @@ class CRM_Contact_Form_Task_EmailCommon { * * @return void */ - static function postProcess(&$form) { + 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) diff --git a/CRM/Contact/Form/Task/HookSample.php b/CRM/Contact/Form/Task/HookSample.php index e806783e18..c0fe1b3563 100644 --- a/CRM/Contact/Form/Task/HookSample.php +++ b/CRM/Contact/Form/Task/HookSample.php @@ -45,7 +45,7 @@ class CRM_Contact_Form_Task_HookSample extends CRM_Contact_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); // display name and email of all contact ids @@ -80,7 +80,7 @@ AND c.id IN ( $contactIDs )"; * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $this->addDefaultButtons(ts('Back to Search'), 'done'); } diff --git a/CRM/Contact/Form/Task/Label.php b/CRM/Contact/Form/Task/Label.php index 004df54116..0e91e1e1d7 100644 --- a/CRM/Contact/Form/Task/Label.php +++ b/CRM/Contact/Form/Task/Label.php @@ -45,7 +45,7 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { $this->set('contactIds', $this->_contactIds); parent::preProcess(); } @@ -57,7 +57,7 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { CRM_Utils_System::setTitle(ts('Make Mailing Labels')); //add select for label @@ -99,7 +99,7 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task { * @return array array of default values * @access public */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $format = CRM_Core_BAO_LabelFormat::getDefaultValues(); $defaults['label_name'] = CRM_Utils_Array::value('name', $format); @@ -366,7 +366,7 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task { * * @return bool */ - function tokenIsFound($contact, $mailingFormatProperties, $tokenFields) { + public function tokenIsFound($contact, $mailingFormatProperties, $tokenFields) { foreach (array_merge($mailingFormatProperties, array_fill_keys($tokenFields, 1)) as $key => $dontCare) { if (!empty($contact[$key])) { return TRUE; @@ -384,7 +384,7 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task { * @return null * @access public */ - function createLabel(&$contactRows, &$format, $fileName = 'MailingLabels_CiviCRM.pdf') { + public function createLabel(&$contactRows, &$format, $fileName = 'MailingLabels_CiviCRM.pdf') { $pdf = new CRM_Utils_PDF_Label($format, 'mm'); $pdf->Open(); $pdf->AddPage(); @@ -410,7 +410,7 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task { * @return array of returnProperties * @access public */ - function getReturnProperties(&$format) { + public function getReturnProperties(&$format) { $returnProperties = array(); $matches = array(); preg_match_all('/(? $dontCare) { //we should not consider addressee for data exists, CRM-6025 if ($key != 'addressee' && !empty($contact[$key])) { @@ -67,7 +67,7 @@ class CRM_Contact_Form_Task_LabelCommon { * @return null * @access public */ - static function createLabel(&$contactRows, &$format, $fileName = 'MailingLabels_CiviCRM.pdf') { + public static function createLabel(&$contactRows, &$format, $fileName = 'MailingLabels_CiviCRM.pdf') { $pdf = new CRM_Utils_PDF_Label($format, 'mm'); $pdf->Open(); $pdf->AddPage(); @@ -99,7 +99,7 @@ class CRM_Contact_Form_Task_LabelCommon { * @access public */ - static function getRows($contactIDs, $locationTypeID, $respectDoNotMail, $mergeSameAddress, $mergeSameHousehold) { + public static function getRows($contactIDs, $locationTypeID, $respectDoNotMail, $mergeSameAddress, $mergeSameHousehold) { $locName = NULL; //get the address format sequence from the config file $addressReturnProperties = CRM_Contact_Form_Task_LabelCommon::getAddressReturnProperties(); @@ -263,7 +263,7 @@ class CRM_Contact_Form_Task_LabelCommon { * @param unknown_type $format * @return multitype:number */ - function regexReturnProperties(&$format) { + public function regexReturnProperties(&$format) { $returnProperties = array(); $matches = array(); preg_match_all('/(? 1 * ) */ - function getAddressReturnProperties() { + public function getAddressReturnProperties() { $mailingFormat = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'mailing_format' ); @@ -311,7 +311,7 @@ class CRM_Contact_Form_Task_LabelCommon { * @param unknown_type $contacts * @return unknown */ - function getTokenData(&$contacts) { + public function getTokenData(&$contacts) { $mailingFormat = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'mailing_format' ); @@ -340,7 +340,7 @@ class CRM_Contact_Form_Task_LabelCommon { * Merge contacts with the Same address to get one shared label * @param unknown_type $rows */ - function mergeSameAddress(&$rows) { + public function mergeSameAddress(&$rows) { $uniqueAddress = array(); foreach (array_keys($rows) as $rowID) { // load complete address as array key @@ -408,7 +408,7 @@ class CRM_Contact_Form_Task_LabelCommon { * * @return array */ - function mergeSameHousehold(&$rows) { + public function mergeSameHousehold(&$rows) { # group selected contacts by type $individuals = array(); $households = array(); diff --git a/CRM/Contact/Form/Task/Map.php b/CRM/Contact/Form/Task/Map.php index 2756753daf..b173934b37 100644 --- a/CRM/Contact/Form/Task/Map.php +++ b/CRM/Contact/Form/Task/Map.php @@ -54,7 +54,7 @@ class CRM_Contact_Form_Task_Map extends CRM_Contact_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, FALSE ); @@ -153,7 +153,7 @@ class CRM_Contact_Form_Task_Map extends CRM_Contact_Form_Task { * @return string the location of the file we have created * @access protected */ - static function createMapXML($ids, $locationId, &$page, $addBreadCrumb, $type = 'Contact') { + public static function createMapXML($ids, $locationId, &$page, $addBreadCrumb, $type = 'Contact') { $config = CRM_Core_Config::singleton(); CRM_Utils_System::setTitle(ts('Map Location(s)')); diff --git a/CRM/Contact/Form/Task/Map/Event.php b/CRM/Contact/Form/Task/Map/Event.php index 24c2d610e7..b6fe01fb9d 100644 --- a/CRM/Contact/Form/Task/Map/Event.php +++ b/CRM/Contact/Form/Task/Map/Event.php @@ -46,7 +46,7 @@ class CRM_Contact_Form_Task_Map_Event extends CRM_Contact_Form_Task_Map { * @return void * @access public */ - function preProcess() { + public function preProcess() { $ids = CRM_Utils_Request::retrieve('eid', 'Positive', $this, TRUE ); @@ -68,7 +68,7 @@ class CRM_Contact_Form_Task_Map_Event extends CRM_Contact_Form_Task_Map { /** * @return string */ - function getTemplateFileName() { + public function getTemplateFileName() { return 'CRM/Contact/Form/Task/Map.tpl'; } } diff --git a/CRM/Contact/Form/Task/Merge.php b/CRM/Contact/Form/Task/Merge.php index cc8117a868..e48baa3e01 100644 --- a/CRM/Contact/Form/Task/Merge.php +++ b/CRM/Contact/Form/Task/Merge.php @@ -45,7 +45,7 @@ class CRM_Contact_Form_Task_Merge extends CRM_Contact_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); $statusMsg = NULL; $contactIds = array(); diff --git a/CRM/Contact/Form/Task/PDF.php b/CRM/Contact/Form/Task/PDF.php index f2bf954e0e..0aab33ab7b 100644 --- a/CRM/Contact/Form/Task/PDF.php +++ b/CRM/Contact/Form/Task/PDF.php @@ -58,7 +58,7 @@ class CRM_Contact_Form_Task_PDF extends CRM_Contact_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { $this->skipOnHold = $this->skipDeceased = FALSE; CRM_Contact_Form_Task_PDFLetterCommon::preProcess($this); @@ -98,7 +98,7 @@ class CRM_Contact_Form_Task_PDF extends CRM_Contact_Form_Task { /** * */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); if (isset($this->_activityId)) { $params = array('id' => $this->_activityId); diff --git a/CRM/Contact/Form/Task/PDFLetterCommon.php b/CRM/Contact/Form/Task/PDFLetterCommon.php index 984f042a6a..cae112cf4e 100644 --- a/CRM/Contact/Form/Task/PDFLetterCommon.php +++ b/CRM/Contact/Form/Task/PDFLetterCommon.php @@ -47,7 +47,7 @@ class CRM_Contact_Form_Task_PDFLetterCommon { * @return void * @access public */ - static function preProcess(&$form) { + public static function preProcess(&$form) { $messageText = array(); $messageSubject = array(); $dao = new CRM_Core_BAO_MessageTemplate(); @@ -67,7 +67,7 @@ class CRM_Contact_Form_Task_PDFLetterCommon { * @param CRM_Core_Form $form * @param int $cid */ - static function preProcessSingle(&$form, $cid) { + public static function preProcessSingle(&$form, $cid) { $form->_contactIds = array($cid); // put contact display name in title for single contact mode CRM_Utils_System::setTitle(ts('Create Printable Letter (PDF) for %1', array(1 => CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $cid, 'display_name')))); @@ -80,7 +80,7 @@ class CRM_Contact_Form_Task_PDFLetterCommon { * * @return void */ - static function buildQuickForm(&$form) { + public static function buildQuickForm(&$form) { // This form outputs a file so should never be submitted via ajax $form->preventAjaxSubmit(); @@ -195,7 +195,7 @@ class CRM_Contact_Form_Task_PDFLetterCommon { /** * Set default values */ - static function setDefaultValues() { + public static function setDefaultValues() { $defaultFormat = CRM_Core_BAO_PdfFormat::getDefaultValues(); $defaultFormat['format_id'] = $defaultFormat['id']; return $defaultFormat; @@ -212,7 +212,7 @@ class CRM_Contact_Form_Task_PDFLetterCommon { * @access public * */ - static function formRule($fields, $dontCare, $self) { + public static function formRule($fields, $dontCare, $self) { $errors = array(); $template = CRM_Core_Smarty::singleton(); @@ -319,7 +319,7 @@ class CRM_Contact_Form_Task_PDFLetterCommon { * * @return void */ - static function postProcess(&$form) { + public static function postProcess(&$form) { list($formValues, $categories, $html_message, $messageToken, $returnProperties) = self::processMessageTemplate($form); $skipOnHold = isset($form->skipOnHold) ? $form->skipOnHold : FALSE; @@ -370,7 +370,7 @@ class CRM_Contact_Form_Task_PDFLetterCommon { * * @throws CRM_Core_Exception */ - static function createActivities($form, $html_message, $contactIds) { + public static function createActivities($form, $html_message, $contactIds) { //Added for CRM-12682: Add activity subject and campaign fields $formValues = $form->controller->exportValues($form->getName()); @@ -421,7 +421,7 @@ class CRM_Contact_Form_Task_PDFLetterCommon { /** * @param $message */ - static function formatMessage(&$message) { + public static function formatMessage(&$message) { $newLineOperators = array( 'p' => array( 'oper' => '

', diff --git a/CRM/Contact/Form/Task/PickProfile.php b/CRM/Contact/Form/Task/PickProfile.php index 66b0307cff..86ba93d346 100644 --- a/CRM/Contact/Form/Task/PickProfile.php +++ b/CRM/Contact/Form/Task/PickProfile.php @@ -69,7 +69,7 @@ class CRM_Contact_Form_Task_PickProfile extends CRM_Contact_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { /* * initialize the task and row fields */ @@ -103,7 +103,7 @@ class CRM_Contact_Form_Task_PickProfile extends CRM_Contact_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { CRM_Utils_System::setTitle(ts('Batch Profile Update for Contact')); foreach ($this->_contactIds as $id) { @@ -132,7 +132,7 @@ class CRM_Contact_Form_Task_PickProfile extends CRM_Contact_Form_Task { * * @return void */ - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Contact_Form_Task_PickProfile', 'formRule')); } @@ -145,7 +145,7 @@ class CRM_Contact_Form_Task_PickProfile extends CRM_Contact_Form_Task { * @static * @access public */ - static function formRule($fields) { + public static function formRule($fields) { if (CRM_Core_BAO_UFField::checkProfileType($fields['uf_group_id'])) { $errorMsg['uf_group_id'] = "You cannot select mix profile for batch update."; } diff --git a/CRM/Contact/Form/Task/Print.php b/CRM/Contact/Form/Task/Print.php index 3573fd2c22..4f2158b363 100644 --- a/CRM/Contact/Form/Task/Print.php +++ b/CRM/Contact/Form/Task/Print.php @@ -45,7 +45,7 @@ class CRM_Contact_Form_Task_Print extends CRM_Contact_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preprocess(); // set print view, so that print templates are called @@ -113,7 +113,7 @@ class CRM_Contact_Form_Task_Print extends CRM_Contact_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { // // just need to add a javacript to popup the window for printing // diff --git a/CRM/Contact/Form/Task/ProximityCommon.php b/CRM/Contact/Form/Task/ProximityCommon.php index 5b96d820ab..8baa7cde54 100644 --- a/CRM/Contact/Form/Task/ProximityCommon.php +++ b/CRM/Contact/Form/Task/ProximityCommon.php @@ -65,7 +65,7 @@ class CRM_Contact_Form_Task_ProximityCommon extends CRM_Contact_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { /* * initialize the task and row fields */ @@ -82,7 +82,7 @@ class CRM_Contact_Form_Task_ProximityCommon extends CRM_Contact_Form_Task { * * @return void */ - function buildQuickForm($form, $proxSearch) { + public function buildQuickForm($form, $proxSearch) { // is proximity search required (2) or optional (1)? $proxRequired = ($proxSearch == 2 ? TRUE : FALSE); $form->assign('proximity_search', TRUE); @@ -118,7 +118,7 @@ class CRM_Contact_Form_Task_ProximityCommon extends CRM_Contact_Form_Task { * @access public * @static */ - static function formRule($fields, $files, $form) { + public static function formRule($fields, $files, $form) { $errors = array(); // If Distance is present, make sure state, country and city or postal code are populated. if (!empty($fields['prox_distance'])) { @@ -144,7 +144,7 @@ class CRM_Contact_Form_Task_ProximityCommon extends CRM_Contact_Form_Task { * * @return array the default array reference */ - function setDefaultValues($form) { + public function setDefaultValues($form) { $defaults = array(); $config = CRM_Core_Config::singleton(); $countryDefault = $config->defaultContactCountry; diff --git a/CRM/Contact/Form/Task/RemoveFromGroup.php b/CRM/Contact/Form/Task/RemoveFromGroup.php index d4e8e76dd0..8badd9ac64 100644 --- a/CRM/Contact/Form/Task/RemoveFromGroup.php +++ b/CRM/Contact/Form/Task/RemoveFromGroup.php @@ -47,7 +47,7 @@ class CRM_Contact_Form_Task_RemoveFromGroup extends CRM_Contact_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { // add select for groups $group = array('' => ts('- select group -')) + CRM_Core_PseudoConstant::nestedGroup(); $groupElement = $this->add('select', 'group_id', ts('Select Group'), $group, TRUE, array('class' => 'crm-select2 huge')); @@ -63,7 +63,7 @@ class CRM_Contact_Form_Task_RemoveFromGroup extends CRM_Contact_Form_Task { * * @return array the default array reference */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); if ($this->get('context') === 'smog') { diff --git a/CRM/Contact/Form/Task/RemoveFromTag.php b/CRM/Contact/Form/Task/RemoveFromTag.php index 7483fdb1ae..805495c2bf 100644 --- a/CRM/Contact/Form/Task/RemoveFromTag.php +++ b/CRM/Contact/Form/Task/RemoveFromTag.php @@ -59,7 +59,7 @@ class CRM_Contact_Form_Task_RemoveFromTag extends CRM_Contact_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { // add select for tag $this->_tags = CRM_Core_BAO_Tag::getTags(); foreach ($this->_tags as $tagID => $tagName) { @@ -72,7 +72,7 @@ class CRM_Contact_Form_Task_RemoveFromTag extends CRM_Contact_Form_Task { $this->addDefaultButtons(ts('Remove Tags from Contacts')); } - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Contact_Form_Task_RemoveFromTag', 'formRule')); } @@ -82,7 +82,7 @@ class CRM_Contact_Form_Task_RemoveFromTag extends CRM_Contact_Form_Task { * * @return array */ - static function formRule($form, $rule) { + public static function formRule($form, $rule) { $errors = array(); if (empty($form['tag']) && empty($form['contact_taglist'])) { $errors['_qf_default'] = "Please select atleast one tag."; diff --git a/CRM/Contact/Form/Task/Result.php b/CRM/Contact/Form/Task/Result.php index e7dcbd479f..c7d191dd84 100644 --- a/CRM/Contact/Form/Task/Result.php +++ b/CRM/Contact/Form/Task/Result.php @@ -46,7 +46,7 @@ class CRM_Contact_Form_Task_Result extends CRM_Contact_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { $session = CRM_Core_Session::singleton(); //this is done to unset searchRows variable assign during AddToHousehold and AddToOrganization diff --git a/CRM/Contact/Form/Task/SMS.php b/CRM/Contact/Form/Task/SMS.php index 9fb790e41a..be50d6197d 100644 --- a/CRM/Contact/Form/Task/SMS.php +++ b/CRM/Contact/Form/Task/SMS.php @@ -54,7 +54,7 @@ class CRM_Contact_Form_Task_SMS extends CRM_Contact_Form_Task { */ public $_templates = NULL; - function preProcess() { + public function preProcess() { $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this); diff --git a/CRM/Contact/Form/Task/SMSCommon.php b/CRM/Contact/Form/Task/SMSCommon.php index cbe22dc511..a405d0092d 100644 --- a/CRM/Contact/Form/Task/SMSCommon.php +++ b/CRM/Contact/Form/Task/SMSCommon.php @@ -50,7 +50,7 @@ class CRM_Contact_Form_Task_SMSCommon { /** * @param CRM_Core_Form $form */ - static function preProcessProvider(&$form) { + public static function preProcessProvider(&$form) { $form->_single = FALSE; $className = CRM_Utils_System::getClassName($form); @@ -91,7 +91,7 @@ class CRM_Contact_Form_Task_SMSCommon { * * @return void */ - static function buildQuickForm(&$form) { + public static function buildQuickForm(&$form) { $toArray = array(); @@ -310,7 +310,7 @@ class CRM_Contact_Form_Task_SMSCommon { * @access public * */ - static function formRule($fields, $dontCare, $self) { + public static function formRule($fields, $dontCare, $self) { $errors = array(); $template = CRM_Core_Smarty::singleton(); @@ -345,7 +345,7 @@ class CRM_Contact_Form_Task_SMSCommon { * * @return void */ - static function postProcess(&$form) { + public static function postProcess(&$form) { // check and ensure that $thisValues = $form->controller->exportValues($form->getName()); diff --git a/CRM/Contact/Form/Task/SaveSearch.php b/CRM/Contact/Form/Task/SaveSearch.php index ac9ef4dfac..cdaa3f75d7 100644 --- a/CRM/Contact/Form/Task/SaveSearch.php +++ b/CRM/Contact/Form/Task/SaveSearch.php @@ -83,7 +83,7 @@ class CRM_Contact_Form_Task_SaveSearch extends CRM_Contact_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { // get the qill $query = new CRM_Contact_BAO_Query($this->get('queryParams')); $qill = $query->qill(); diff --git a/CRM/Contact/Form/Task/SaveSearch/Update.php b/CRM/Contact/Form/Task/SaveSearch/Update.php index bc1da7fed0..8cc290f355 100644 --- a/CRM/Contact/Form/Task/SaveSearch/Update.php +++ b/CRM/Contact/Form/Task/SaveSearch/Update.php @@ -45,7 +45,7 @@ class CRM_Contact_Form_Task_SaveSearch_Update extends CRM_Contact_Form_Task_Save * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); $this->_id = $this->get('ssID'); @@ -66,7 +66,7 @@ class CRM_Contact_Form_Task_SaveSearch_Update extends CRM_Contact_Form_Task_Save * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $params = array(); diff --git a/CRM/Contact/Form/Task/Unhold.php b/CRM/Contact/Form/Task/Unhold.php index 16a7b25ac1..4171dfd541 100644 --- a/CRM/Contact/Form/Task/Unhold.php +++ b/CRM/Contact/Form/Task/Unhold.php @@ -11,11 +11,11 @@ class CRM_Contact_Form_Task_Unhold extends CRM_Contact_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); } - function buildQuickForm() { + public function buildQuickForm() { $this->addDefaultButtons(ts('Unhold Email'), 'done'); } diff --git a/CRM/Contact/Form/Task/Useradd.php b/CRM/Contact/Form/Task/Useradd.php index b32503d918..d74b18c2e2 100755 --- a/CRM/Contact/Form/Task/Useradd.php +++ b/CRM/Contact/Form/Task/Useradd.php @@ -54,7 +54,7 @@ class CRM_Contact_Form_Task_Useradd extends CRM_Core_Form { */ public $_email; - function preProcess() { + public function preProcess() { $params = $defaults = $ids = array(); $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE); @@ -73,7 +73,7 @@ class CRM_Contact_Form_Task_Useradd extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $defaults['contactID'] = $this->_contactId; $defaults['name'] = $this->_displayName; @@ -139,7 +139,7 @@ class CRM_Contact_Form_Task_Useradd extends CRM_Core_Form { * * @static */ - static function usernameRule($params) { + public static function usernameRule($params) { $config = CRM_Core_Config::singleton(); $errors = array(); $check_params = array( diff --git a/CRM/Contact/Import/Controller.php b/CRM/Contact/Import/Controller.php index 11c29f17ff..923eae4463 100644 --- a/CRM/Contact/Import/Controller.php +++ b/CRM/Contact/Import/Controller.php @@ -37,7 +37,7 @@ class CRM_Contact_Import_Controller extends CRM_Core_Controller { /** * Class constructor */ - function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { + public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { parent::__construct($title, $modal); // lets get around the time limit issue if possible, CRM-2113 diff --git a/CRM/Contact/Import/Field.php b/CRM/Contact/Import/Field.php index 9f973ab7bc..20e6936f78 100644 --- a/CRM/Contact/Import/Field.php +++ b/CRM/Contact/Import/Field.php @@ -143,7 +143,7 @@ class CRM_Contact_Import_Field { * @param null $relatedContactLocType * @param null $relatedContactPhoneType */ - function __construct($name, $title, $type = CRM_Utils_Type::T_INT, $columnPattern = '//', $dataPattern = '//', $hasLocationType = NULL, $phoneType = NULL, $related = NULL, $relatedContactType = NULL, $relatedContactDetails = NULL, $relatedContactLocType = NULL, $relatedContactPhoneType = NULL) { + public function __construct($name, $title, $type = CRM_Utils_Type::T_INT, $columnPattern = '//', $dataPattern = '//', $hasLocationType = NULL, $phoneType = NULL, $related = NULL, $relatedContactType = NULL, $relatedContactDetails = NULL, $relatedContactLocType = NULL, $relatedContactPhoneType = NULL) { $this->_name = $name; $this->_title = $title; $this->_type = $type; @@ -160,7 +160,7 @@ class CRM_Contact_Import_Field { $this->_value = NULL; } - function resetValue() { + public function resetValue() { $this->_value = NULL; } @@ -168,14 +168,14 @@ class CRM_Contact_Import_Field { * The value is in string format. convert the value to the type of this field * and set the field value with the appropriate type */ - function setValue($value) { + public function setValue($value) { $this->_value = $value; } /** * @return bool */ - function validate() { + public function validate() { // echo $this->_value."===========
"; $message = ''; diff --git a/CRM/Contact/Import/Form/DataSource.php b/CRM/Contact/Import/Form/DataSource.php index d94ad272f0..7cfdd3597b 100644 --- a/CRM/Contact/Import/Form/DataSource.php +++ b/CRM/Contact/Import/Form/DataSource.php @@ -245,7 +245,7 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $config = CRM_Core_Config::singleton(); $defaults = array( 'dataSource' => 'CRM_Import_DataSource_CSV', diff --git a/CRM/Contact/Import/Form/MapField.php b/CRM/Contact/Import/Form/MapField.php index eaf9825418..f242eea605 100644 --- a/CRM/Contact/Import/Form/MapField.php +++ b/CRM/Contact/Import/Form/MapField.php @@ -630,7 +630,7 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField { * @static * @access public */ - static function formRule($fields) { + public static function formRule($fields) { $errors = array(); if (!empty($fields['saveMapping'])) { $nameField = CRM_Utils_Array::value('saveMappingName', $fields); @@ -985,7 +985,7 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField { * @return void * @access public */ - function formatCustomFieldName(&$fields) { + public function formatCustomFieldName(&$fields) { //CRM-2676, replacing the conflict for same custom field name from different custom group. $fieldIds = $formattedFieldNames = array(); foreach ($fields as $key => $value) { diff --git a/CRM/Contact/Import/Form/Preview.php b/CRM/Contact/Import/Form/Preview.php index b9a0ad87c1..d5502bd19d 100644 --- a/CRM/Contact/Import/Form/Preview.php +++ b/CRM/Contact/Import/Form/Preview.php @@ -199,7 +199,7 @@ class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview { * @static * @access public */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); $invalidTagName = $invalidGroupName = FALSE; diff --git a/CRM/Contact/Import/Page/AJAX.php b/CRM/Contact/Import/Page/AJAX.php index 8ffca19e2d..e09d2acd2f 100644 --- a/CRM/Contact/Import/Page/AJAX.php +++ b/CRM/Contact/Import/Page/AJAX.php @@ -41,7 +41,7 @@ class CRM_Contact_Import_Page_AJAX { /** * Show import status */ - static function status() { + public static function status() { // make sure we get an id if (!isset($_GET['id'])) { return; diff --git a/CRM/Contact/Import/Parser.php b/CRM/Contact/Import/Parser.php index 90ec3ae37a..34726e17c6 100644 --- a/CRM/Contact/Import/Parser.php +++ b/CRM/Contact/Import/Parser.php @@ -408,7 +408,7 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { * @return void * @access public */ - function setActiveFields($fieldKeys) { + public function setActiveFields($fieldKeys) { $this->_activeFieldCount = count($fieldKeys); foreach ($fieldKeys as $key) { if (empty($this->_fields[$key])) { @@ -423,7 +423,7 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { /** * @param $elements */ - function setActiveFieldLocationTypes($elements) { + public function setActiveFieldLocationTypes($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_hasLocationType = $elements[$i]; } @@ -435,7 +435,7 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { /** * @param $elements */ - function setActiveFieldPhoneTypes($elements) { + public function setActiveFieldPhoneTypes($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_phoneType = $elements[$i]; } @@ -444,7 +444,7 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { /** * @param $elements */ - function setActiveFieldWebsiteTypes($elements) { + public function setActiveFieldWebsiteTypes($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_websiteType = $elements[$i]; } @@ -458,7 +458,7 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { * @return void * @access public */ - function setActiveFieldImProviders($elements) { + public function setActiveFieldImProviders($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_imProvider = $elements[$i]; } @@ -467,7 +467,7 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { /** * @param $elements */ - function setActiveFieldRelated($elements) { + public function setActiveFieldRelated($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_related = $elements[$i]; } @@ -476,7 +476,7 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { /** * @param $elements */ - function setActiveFieldRelatedContactType($elements) { + public function setActiveFieldRelatedContactType($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_relatedContactType = $elements[$i]; } @@ -485,7 +485,7 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { /** * @param $elements */ - function setActiveFieldRelatedContactDetails($elements) { + public function setActiveFieldRelatedContactDetails($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_relatedContactDetails = $elements[$i]; } @@ -494,7 +494,7 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { /** * @param $elements */ - function setActiveFieldRelatedContactLocType($elements) { + public function setActiveFieldRelatedContactLocType($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_relatedContactLocType = $elements[$i]; } @@ -503,7 +503,7 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { /** * @param $elements */ - function setActiveFieldRelatedContactPhoneType($elements) { + public function setActiveFieldRelatedContactPhoneType($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_relatedContactPhoneType = $elements[$i]; } @@ -512,7 +512,7 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { /** * @param $elements */ - function setActiveFieldRelatedContactWebsiteType($elements) { + public function setActiveFieldRelatedContactWebsiteType($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_relatedContactWebsiteType = $elements[$i]; } @@ -526,7 +526,7 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { * @return void * @access public */ - function setActiveFieldRelatedContactImProvider($elements) { + public function setActiveFieldRelatedContactImProvider($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_relatedContactImProvider = $elements[$i]; } @@ -538,7 +538,7 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { * @return array (reference ) associative array of name/value pairs * @access public */ - function &getActiveFieldParams() { + public function &getActiveFieldParams() { $params = array(); for ($i = 0; $i < $this->_activeFieldCount; $i++) { @@ -635,7 +635,7 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { /** * @return array */ - function getColumnPatterns() { + public function getColumnPatterns() { $values = array(); foreach ($this->_fields as $name => $field) { $values[$name] = $field->_columnPattern; @@ -671,7 +671,7 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { * @return void * @access public */ - function set($store, $mode = self::MODE_SUMMARY) { + public function set($store, $mode = self::MODE_SUMMARY) { $store->set('rowCount', $this->_rowCount); $store->set('fields', $this->getSelectValues()); $store->set('fieldTypes', $this->getSelectTypes()); @@ -736,7 +736,7 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { * @return void * @access public */ - static function exportCSV($fileName, $header, $data) { + public static function exportCSV($fileName, $header, $data) { if (file_exists($fileName) && !is_writable($fileName)) { CRM_Core_Error::movedSiteError($fileName); diff --git a/CRM/Contact/Import/Parser/Contact.php b/CRM/Contact/Import/Parser/Contact.php index 2ebba3c8fb..632aac6d1d 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -128,7 +128,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { * @return void * @access public */ - function init() { + public function init() { $contactFields = CRM_Contact_BAO_Contact::importableFields($this->_contactType); // exclude the address options disabled in the Address Settings $fields = CRM_Core_BAO_Address::validateAddressOptions($contactFields); @@ -251,7 +251,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { * @return boolean * @access public */ - function mapField(&$values) { + public function mapField(&$values) { return CRM_Import_Parser::VALID; } @@ -263,7 +263,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { * @return boolean the result of this processing * @access public */ - function preview(&$values) { + public function preview(&$values) { return $this->summary($values); } @@ -275,7 +275,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { * @return boolean the result of this processing * @access public */ - function summary(&$values) { + public function summary(&$values) { $erroneousField = NULL; $response = $this->setActiveFieldValues($values, $erroneousField); @@ -447,7 +447,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { * @return boolean the result of this processing * @access public */ - function import($onDuplicate, &$values, $doGeocodeAddress = FALSE) { + public function import($onDuplicate, &$values, $doGeocodeAddress = FALSE) { $config = CRM_Core_Config::singleton(); $this->_unparsedStreetAddressContacts = array(); if (!$doGeocodeAddress) { @@ -1073,7 +1073,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { * @return array * @access public */ - function &getImportedContacts() { + public function &getImportedContacts() { return $this->_newContacts; } @@ -1083,7 +1083,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { * @return array * @access public */ - function &getRelatedImportedContacts() { + public function &getRelatedImportedContacts() { return $this->_newRelatedContacts; } @@ -1093,7 +1093,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { * @return void * @access public */ - function fini() {} + public function fini() {} /** * Check if an error in custom data @@ -1106,7 +1106,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { * * @access public */ - static function isErrorInCustomData($params, &$errorMessage, $csType = NULL, $relationships = NULL) { + public static function isErrorInCustomData($params, &$errorMessage, $csType = NULL, $relationships = NULL) { $session = CRM_Core_Session::singleton(); $dateType = $session->get("dateTypes"); @@ -1324,7 +1324,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { * * @access public */ - function isErrorInCoreData($params, &$errorMessage) { + public function isErrorInCoreData($params, &$errorMessage) { foreach ($params as $key => $value) { if ($value) { $session = CRM_Core_Session::singleton(); @@ -1597,7 +1597,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { * * @access public */ - function in_value($value, $valueArray) { + public function in_value($value, $valueArray) { foreach ($valueArray as $key => $v) { //fix for CRM-1514 if (strtolower(trim($v, ".")) == strtolower(trim($value, "."))) { @@ -1616,7 +1616,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { * @static * @access public */ - static function addToErrorMsg($errorName, &$errorMessage) { + public static function addToErrorMsg($errorName, &$errorMessage) { if ($errorMessage) { $errorMessage .= "; $errorName"; } @@ -1630,7 +1630,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { * * */ - function createContact(&$formatted, &$contactFields, $onDuplicate, $contactId = NULL, $requiredCheck = TRUE, $dedupeRuleGroupID = NULL) { + public function createContact(&$formatted, &$contactFields, $onDuplicate, $contactId = NULL, $requiredCheck = TRUE, $dedupeRuleGroupID = NULL) { $dupeCheck = FALSE; $newContact = NULL; @@ -1695,7 +1695,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { * @param $onDuplicate int * @param $cid int contact id */ - function formatParams(&$params, $onDuplicate, $cid) { + public function formatParams(&$params, $onDuplicate, $cid) { if ($onDuplicate == CRM_Import_Parser::DUPLICATE_SKIP) { return; } @@ -1804,7 +1804,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { * @param string $dateParam index of params * @static */ - function formatCustomDate(&$params, &$formatted, $dateType, $dateParam) { + public function formatCustomDate(&$params, &$formatted, $dateType, $dateParam) { //fix for CRM-2687 CRM_Utils_Date::convertToDefaultDate($params, $dateType, $dateParam); $formatted[$dateParam] = CRM_Utils_Date::processDate($params[$dateParam]); @@ -1818,7 +1818,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { * @param array $contactFields contact DAO fields. * @static */ - function formatCommonData($params, &$formatted, &$contactFields) { + public function formatCommonData($params, &$formatted, &$contactFields) { $csType = array( CRM_Utils_Array::value('contact_type', $formatted), ); @@ -2043,7 +2043,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { * @return int * @access public */ - function processMessage(&$values, $statusFieldName, $returnCode) { + public function processMessage(&$values, $statusFieldName, $returnCode) { if (empty($this->_unparsedStreetAddressContacts)) { $importRecordParams = array( $statusFieldName => 'IMPORTED', @@ -2072,7 +2072,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { * * @return bool */ - function checkRelatedContactFields($relKey, $params) { + public function checkRelatedContactFields($relKey, $params) { //avoid blank contact creation. $allowToCreate = FALSE; diff --git a/CRM/Contact/Page/AJAX.php b/CRM/Contact/Page/AJAX.php index 2a8003dd29..3bb980db4e 100644 --- a/CRM/Contact/Page/AJAX.php +++ b/CRM/Contact/Page/AJAX.php @@ -48,7 +48,7 @@ class CRM_Contact_Page_AJAX { /** * @deprecated */ - static function getContactList() { + public static function getContactList() { // if context is 'customfield' if (CRM_Utils_Array::value('context', $_GET) == 'customfield') { return self::contactReference(); @@ -107,7 +107,7 @@ class CRM_Contact_Page_AJAX { * * Todo: Migrate contact reference fields to use EntityRef */ - static function contactReference() { + public static function contactReference() { $name = CRM_Utils_Array::value('term', $_GET); $name = CRM_Utils_Type::escape($name, 'String'); $cfID = CRM_Utils_Type::escape($_GET['id'], 'Positive'); @@ -198,7 +198,7 @@ class CRM_Contact_Page_AJAX { /** * Fetch PCP ID by PCP Supporter sort_name, also displays PCP title and associated Contribution Page title */ - static function getPCPList() { + public static function getPCPList() { $name = CRM_Utils_Array::value('s', $_GET); $name = CRM_Utils_Type::escape($name, 'String'); $limit = '10'; @@ -254,7 +254,7 @@ class CRM_Contact_Page_AJAX { CRM_Utils_JSON::output($results); } - static function relationship() { + public static function relationship() { $relType = CRM_Utils_Request::retrieve('rel_type', 'Positive', CRM_Core_DAO::$_nullObject, TRUE); $relContactID = CRM_Utils_Request::retrieve('rel_contact', 'Positive', CRM_Core_DAO::$_nullObject, TRUE); $relationshipID = CRM_Utils_Array::value('rel_id', $_REQUEST); // this used only to determine add or update mode @@ -319,7 +319,7 @@ class CRM_Contact_Page_AJAX { /** * Fetch the custom field help */ - static function customField() { + public static function customField() { $fieldId = CRM_Utils_Type::escape($_REQUEST['id'], 'Integer'); $params = array('id' => $fieldId); $returnProperties = array('help_pre', 'help_post'); @@ -329,7 +329,7 @@ class CRM_Contact_Page_AJAX { CRM_Utils_JSON::output($values); } - static function groupTree() { + public static function groupTree() { $gids = CRM_Utils_Type::escape($_GET['gids'], 'String'); echo CRM_Contact_BAO_GroupNestingCache::json($gids); CRM_Utils_System::civiExit(); @@ -340,7 +340,7 @@ class CRM_Contact_Page_AJAX { * Old quicksearch function. No longer used in core. * @todo: Remove this function and associated menu entry in CiviCRM 5 */ - static function search() { + public static function search() { $json = TRUE; $name = CRM_Utils_Array::value('name', $_GET, ''); if (!array_key_exists('name', $_GET)) { @@ -521,7 +521,7 @@ ORDER BY sort_name "; * Delete custom value * */ - static function deleteCustomValue() { + public static function deleteCustomValue() { $customValueID = CRM_Utils_Type::escape($_REQUEST['valueID'], 'Positive'); $customGroupID = CRM_Utils_Type::escape($_REQUEST['groupID'], 'Positive'); @@ -540,7 +540,7 @@ ORDER BY sort_name "; * Perform enable / disable actions on record. * */ - static function enableDisable() { + public static function enableDisable() { $op = CRM_Utils_Type::escape($_REQUEST['op'], 'String'); $recordID = CRM_Utils_Type::escape($_REQUEST['recordID'], 'Positive'); $recordBAO = CRM_Utils_Type::escape($_REQUEST['recordBAO'], 'String'); @@ -620,7 +620,7 @@ ORDER BY sort_name "; /** * Function to get email address of a contact */ - static function getContactEmail() { + public static function getContactEmail() { if (!empty($_REQUEST['contact_id'])) { $contactID = CRM_Utils_Type::escape($_REQUEST['contact_id'], 'Positive'); if (!CRM_Contact_BAO_Contact_Permission::allow($contactID, CRM_Core_Permission::EDIT)) { @@ -730,7 +730,7 @@ LIMIT {$offset}, {$rowCount} CRM_Utils_System::civiExit(); } - static function getContactPhone() { + public static function getContactPhone() { $queryString = NULL; //check for mobile type @@ -800,7 +800,7 @@ LIMIT {$offset}, {$rowCount} } - static function buildSubTypes() { + public static function buildSubTypes() { $parent = CRM_Utils_Array::value('parentId', $_REQUEST); switch ($parent) { @@ -822,7 +822,7 @@ LIMIT {$offset}, {$rowCount} CRM_Utils_JSON::output($subTypes); } - static function buildDedupeRules() { + public static function buildDedupeRules() { $parent = CRM_Utils_Array::value('parentId', $_REQUEST); switch ($parent) { @@ -847,7 +847,7 @@ LIMIT {$offset}, {$rowCount} /** * Function used for CiviCRM dashboard operations */ - static function dashboard() { + public static function dashboard() { $operation = CRM_Utils_Type::escape($_REQUEST['op'], 'String'); switch ($operation) { @@ -879,7 +879,7 @@ LIMIT {$offset}, {$rowCount} /** * Retrieve signature based on email id */ - static function getSignature() { + 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); @@ -899,7 +899,7 @@ LIMIT {$offset}, {$rowCount} * Process dupes. * */ - static function processDupes() { + 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'); @@ -928,7 +928,7 @@ LIMIT {$offset}, {$rowCount} CRM_Utils_JSON::output(array('status' => ($status) ? $oper : $status)); } - static function getDedupes() { + public static function getDedupes() { $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer'); $offset = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0; @@ -982,7 +982,7 @@ LIMIT {$offset}, {$rowCount} /** * Retrieve a PDF Page Format for the PDF Letter form */ - function pdfFormat() { + public function pdfFormat() { $formatId = CRM_Utils_Type::escape($_REQUEST['formatId'], 'Integer'); $pdfFormat = CRM_Core_BAO_PdfFormat::getById($formatId); @@ -993,7 +993,7 @@ LIMIT {$offset}, {$rowCount} /** * Retrieve Paper Size dimensions */ - static function paperSize() { + public static function paperSize() { $paperSizeName = CRM_Utils_Type::escape($_REQUEST['paperSizeName'], 'String'); $paperSize = CRM_Core_BAO_PaperSize::getByName($paperSizeName); @@ -1001,7 +1001,7 @@ LIMIT {$offset}, {$rowCount} CRM_Utils_JSON::output($paperSize); } - static function selectUnselectContacts() { + 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'); @@ -1040,14 +1040,14 @@ LIMIT {$offset}, {$rowCount} * * @return string */ - static function _convertToId($name) { + public static function _convertToId($name) { if (substr($name, 0, CRM_Core_Form::CB_PREFIX_LEN) == CRM_Core_Form::CB_PREFIX) { $cId = substr($name, CRM_Core_Form::CB_PREFIX_LEN); } return $cId; } - static function getAddressDisplay() { + public static function getAddressDisplay() { $contactId = CRM_Utils_Array::value('contact_id', $_REQUEST); if (!$contactId) { $addressVal["error_message"] = "no contact id found"; diff --git a/CRM/Contact/Page/CustomSearch.php b/CRM/Contact/Page/CustomSearch.php index 049a249179..ef09445cf0 100644 --- a/CRM/Contact/Page/CustomSearch.php +++ b/CRM/Contact/Page/CustomSearch.php @@ -82,7 +82,7 @@ ORDER By v.weight * @return content of the parents run method * */ - function browse() { + public function browse() { $rows = self::info(); $this->assign('rows', $rows); return parent::run(); @@ -93,7 +93,7 @@ ORDER By v.weight * * @return void */ - function run() { + public function run() { $action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse' diff --git a/CRM/Contact/Page/DashBoard.php b/CRM/Contact/Page/DashBoard.php index 6e6744848f..00e953ca26 100644 --- a/CRM/Contact/Page/DashBoard.php +++ b/CRM/Contact/Page/DashBoard.php @@ -45,7 +45,7 @@ class CRM_Contact_Page_DashBoard extends CRM_Core_Page { * @return void * @access public */ - function run() { + public function run() { // Add dashboard js and css $resources = CRM_Core_Resources::singleton(); $resources->addScriptFile('civicrm', 'js/jquery/jquery.dashboard.js', 0, 'html-header', FALSE); diff --git a/CRM/Contact/Page/Dashlet.php b/CRM/Contact/Page/Dashlet.php index 9aa6df5493..360db01a99 100644 --- a/CRM/Contact/Page/Dashlet.php +++ b/CRM/Contact/Page/Dashlet.php @@ -45,7 +45,7 @@ class CRM_Contact_Page_Dashlet extends CRM_Core_Page { * @return void * @access public */ - function run() { + public function run() { CRM_Utils_System::setTitle(ts('Dashlets')); $this->assign('admin', CRM_Core_Permission::check('administer CiviCRM')); diff --git a/CRM/Contact/Page/DedupeException.php b/CRM/Contact/Page/DedupeException.php index 18f0d44c3d..5e3127e5be 100644 --- a/CRM/Contact/Page/DedupeException.php +++ b/CRM/Contact/Page/DedupeException.php @@ -47,7 +47,7 @@ class CRM_Contact_Page_DedupeException extends CRM_Core_Page { * @access public * */ - function preProcess() { + public function preProcess() { //fetch the dedupe exception contacts. $dedupeExceptions = array(); @@ -85,7 +85,7 @@ class CRM_Contact_Page_DedupeException extends CRM_Core_Page { * return null * @access public */ - function run() { + public function run() { $this->preProcess(); return parent::run(); } diff --git a/CRM/Contact/Page/DedupeFind.php b/CRM/Contact/Page/DedupeFind.php index 434384527c..a9939fa23a 100644 --- a/CRM/Contact/Page/DedupeFind.php +++ b/CRM/Contact/Page/DedupeFind.php @@ -43,7 +43,7 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Dedupe_BAO_RuleGroup'; } @@ -52,7 +52,7 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() {} + public function &links() {} /** * Browse all rule groups @@ -60,7 +60,7 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic { * @return void * @access public */ - function run() { + public function run() { $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); @@ -317,7 +317,7 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic { * @return void * @access public */ - function browse() { + public function browse() { $this->assign('main_contacts', $this->_mainContacts); if ($this->_cid) { @@ -334,7 +334,7 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic { * * @return string classname of edit form */ - function editForm() { + public function editForm() { return 'CRM_Contact_Form_DedupeFind'; } @@ -343,7 +343,7 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic { * * @return string name of this page */ - function editName() { + public function editName() { return 'DedupeFind'; } @@ -354,7 +354,7 @@ class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic { * * @return string user context */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/contact/dedupefind'; } } diff --git a/CRM/Contact/Page/DedupeRules.php b/CRM/Contact/Page/DedupeRules.php index 81b174b53c..291e4746aa 100644 --- a/CRM/Contact/Page/DedupeRules.php +++ b/CRM/Contact/Page/DedupeRules.php @@ -47,7 +47,7 @@ class CRM_Contact_Page_DedupeRules extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Dedupe_BAO_RuleGroup'; } @@ -56,7 +56,7 @@ class CRM_Contact_Page_DedupeRules extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { $deleteExtra = ts('Are you sure you want to delete this Rule?'); @@ -103,7 +103,7 @@ class CRM_Contact_Page_DedupeRules extends CRM_Core_Page_Basic { * @access public * */ - function run() { + public function run() { // get the requested action, default to 'browse' $action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); @@ -141,7 +141,7 @@ class CRM_Contact_Page_DedupeRules extends CRM_Core_Page_Basic { * @return void * @access public */ - function browse() { + public function browse() { // get all rule groups $ruleGroups = array(); $dao = new CRM_Dedupe_DAO_RuleGroup(); @@ -186,7 +186,7 @@ class CRM_Contact_Page_DedupeRules extends CRM_Core_Page_Basic { * * @return string classname of edit form */ - function editForm() { + public function editForm() { return 'CRM_Contact_Form_DedupeRules'; } @@ -195,7 +195,7 @@ class CRM_Contact_Page_DedupeRules extends CRM_Core_Page_Basic { * * @return string name of this page */ - function editName() { + public function editName() { return 'DedupeRules'; } @@ -206,14 +206,14 @@ class CRM_Contact_Page_DedupeRules extends CRM_Core_Page_Basic { * * @return string user context */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/contact/deduperules'; } /** * @param int $id */ - function delete($id) { + public function delete($id) { $ruleDao = new CRM_Dedupe_DAO_Rule(); $ruleDao->dedupe_rule_group_id = $id; $ruleDao->delete(); diff --git a/CRM/Contact/Page/ImageFile.php b/CRM/Contact/Page/ImageFile.php index a4874c4841..c67361ba4e 100644 --- a/CRM/Contact/Page/ImageFile.php +++ b/CRM/Contact/Page/ImageFile.php @@ -33,7 +33,7 @@ * */ class CRM_Contact_Page_ImageFile extends CRM_Core_Page { - function run() { + public function run() { if (!preg_match('/^[^\/]+\.(jpg|jpeg|png|gif)$/i', $_GET['photo'])) { CRM_Core_Error::fatal('Malformed photo name'); } diff --git a/CRM/Contact/Page/Inline/Actions.php b/CRM/Contact/Page/Inline/Actions.php index ff1bb71065..9e823391be 100644 --- a/CRM/Contact/Page/Inline/Actions.php +++ b/CRM/Contact/Page/Inline/Actions.php @@ -48,7 +48,7 @@ class CRM_Contact_Page_Inline_Actions extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST); $this->assign('contactId', $contactId); diff --git a/CRM/Contact/Page/Inline/Address.php b/CRM/Contact/Page/Inline/Address.php index 7bc679b8d6..8f12515c61 100644 --- a/CRM/Contact/Page/Inline/Address.php +++ b/CRM/Contact/Page/Inline/Address.php @@ -48,7 +48,7 @@ class CRM_Contact_Page_Inline_Address extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { // get the emails for this contact $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST); $locBlockNo = CRM_Utils_Request::retrieve('locno', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST); diff --git a/CRM/Contact/Page/Inline/CommunicationPreferences.php b/CRM/Contact/Page/Inline/CommunicationPreferences.php index 9fc315894f..c3fb164e4f 100644 --- a/CRM/Contact/Page/Inline/CommunicationPreferences.php +++ b/CRM/Contact/Page/Inline/CommunicationPreferences.php @@ -48,7 +48,7 @@ class CRM_Contact_Page_Inline_CommunicationPreferences extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { // get the emails for this contact $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST); diff --git a/CRM/Contact/Page/Inline/ContactInfo.php b/CRM/Contact/Page/Inline/ContactInfo.php index 637dc87c2e..b7c3cd4d17 100644 --- a/CRM/Contact/Page/Inline/ContactInfo.php +++ b/CRM/Contact/Page/Inline/ContactInfo.php @@ -48,7 +48,7 @@ class CRM_Contact_Page_Inline_ContactInfo extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { // get the emails for this contact $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST); diff --git a/CRM/Contact/Page/Inline/ContactName.php b/CRM/Contact/Page/Inline/ContactName.php index b649f9d7d2..eea3969777 100644 --- a/CRM/Contact/Page/Inline/ContactName.php +++ b/CRM/Contact/Page/Inline/ContactName.php @@ -48,7 +48,7 @@ class CRM_Contact_Page_Inline_ContactName extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { // get the emails for this contact $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST); diff --git a/CRM/Contact/Page/Inline/CustomData.php b/CRM/Contact/Page/Inline/CustomData.php index 33d7e7dbdd..4f4dd807b4 100644 --- a/CRM/Contact/Page/Inline/CustomData.php +++ b/CRM/Contact/Page/Inline/CustomData.php @@ -48,7 +48,7 @@ class CRM_Contact_Page_Inline_CustomData extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { // get the emails for this contact $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST); $cgId = CRM_Utils_Request::retrieve('groupID', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST); diff --git a/CRM/Contact/Page/Inline/Demographics.php b/CRM/Contact/Page/Inline/Demographics.php index 20cc318f07..eed3eea412 100644 --- a/CRM/Contact/Page/Inline/Demographics.php +++ b/CRM/Contact/Page/Inline/Demographics.php @@ -48,7 +48,7 @@ class CRM_Contact_Page_Inline_Demographics extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { // get the emails for this contact $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST); diff --git a/CRM/Contact/Page/Inline/Email.php b/CRM/Contact/Page/Inline/Email.php index 3a5ce66c8f..d1a6510287 100644 --- a/CRM/Contact/Page/Inline/Email.php +++ b/CRM/Contact/Page/Inline/Email.php @@ -48,7 +48,7 @@ class CRM_Contact_Page_Inline_Email extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { // get the emails for this contact $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST); diff --git a/CRM/Contact/Page/Inline/IM.php b/CRM/Contact/Page/Inline/IM.php index ef349540bc..adc3948b9d 100644 --- a/CRM/Contact/Page/Inline/IM.php +++ b/CRM/Contact/Page/Inline/IM.php @@ -48,7 +48,7 @@ class CRM_Contact_Page_Inline_IM extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { // get the emails for this contact $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST); diff --git a/CRM/Contact/Page/Inline/OpenID.php b/CRM/Contact/Page/Inline/OpenID.php index 0648666101..803b345841 100644 --- a/CRM/Contact/Page/Inline/OpenID.php +++ b/CRM/Contact/Page/Inline/OpenID.php @@ -48,7 +48,7 @@ class CRM_Contact_Page_Inline_OpenID extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { // get the emails for this contact $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST); diff --git a/CRM/Contact/Page/Inline/Phone.php b/CRM/Contact/Page/Inline/Phone.php index 2781508b0a..d0b027e27f 100644 --- a/CRM/Contact/Page/Inline/Phone.php +++ b/CRM/Contact/Page/Inline/Phone.php @@ -48,7 +48,7 @@ class CRM_Contact_Page_Inline_Phone extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { // get the emails for this contact $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST); diff --git a/CRM/Contact/Page/Inline/Website.php b/CRM/Contact/Page/Inline/Website.php index dd1fd81937..5ba6cb3ad4 100644 --- a/CRM/Contact/Page/Inline/Website.php +++ b/CRM/Contact/Page/Inline/Website.php @@ -48,7 +48,7 @@ class CRM_Contact_Page_Inline_Website extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { // get the emails for this contact $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST); diff --git a/CRM/Contact/Page/SavedSearch.php b/CRM/Contact/Page/SavedSearch.php index f1168dfc15..9a54a4a6f7 100644 --- a/CRM/Contact/Page/SavedSearch.php +++ b/CRM/Contact/Page/SavedSearch.php @@ -55,7 +55,7 @@ class CRM_Contact_Page_SavedSearch extends CRM_Core_Page { * @return void * */ - function delete($id) { + public function delete($id) { // first delete the group associated with this saved search $group = new CRM_Contact_DAO_Group(); $group->saved_search_id = $id; @@ -76,7 +76,7 @@ class CRM_Contact_Page_SavedSearch extends CRM_Core_Page { * @return content of the parents run method * */ - function browse() { + public function browse() { $rows = array(); $savedSearch = new CRM_Contact_DAO_SavedSearch(); @@ -129,7 +129,7 @@ class CRM_Contact_Page_SavedSearch extends CRM_Core_Page { * * @return void */ - function run() { + public function run() { $action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse' ); @@ -151,7 +151,7 @@ class CRM_Contact_Page_SavedSearch extends CRM_Core_Page { * @return array (reference) of action links * @static */ - static function &links() { + public static function &links() { if (!(self::$_links)) { diff --git a/CRM/Contact/Page/Task.php b/CRM/Contact/Page/Task.php index 2cc69fccdf..6baba4c468 100644 --- a/CRM/Contact/Page/Task.php +++ b/CRM/Contact/Page/Task.php @@ -48,7 +48,7 @@ class CRM_Contact_Page_Task extends CRM_Core_Page { * @return string the title of the page * @access public */ - function getTitle() { + public function getTitle() { return "Task Results"; } } diff --git a/CRM/Contact/Page/View.php b/CRM/Contact/Page/View.php index 4de1a40fe3..e4181691e2 100644 --- a/CRM/Contact/Page/View.php +++ b/CRM/Contact/Page/View.php @@ -79,7 +79,7 @@ class CRM_Contact_Page_View extends CRM_Core_Page { * @access public * */ - function preProcess() { + public function preProcess() { // process url params $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); $this->assign('id', $this->_id); @@ -264,7 +264,7 @@ class CRM_Contact_Page_View extends CRM_Core_Page { * @return array contact fields in fixed order * @access public */ - static function getContactDetails($contactId) { + public static function getContactDetails($contactId) { return list($displayName, $contactImage, $contactType, @@ -280,7 +280,7 @@ class CRM_Contact_Page_View extends CRM_Core_Page { * @param $page * @param int $contactID */ - static function checkUserPermission($page, $contactID = NULL) { + public static function checkUserPermission($page, $contactID = NULL) { // check for permissions $page->_permission = NULL; @@ -321,7 +321,7 @@ class CRM_Contact_Page_View extends CRM_Core_Page { * * @return string */ - static function setTitle($contactId, $isDeleted = FALSE) { + public static function setTitle($contactId, $isDeleted = FALSE) { static $contactDetails; $displayName = $contactImage = NULL; if (!isset($contactDetails[$contactId])) { @@ -353,7 +353,7 @@ class CRM_Contact_Page_View extends CRM_Core_Page { * @param CRM_Core_Page $obj * @param integer $cid */ - static function addUrls(&$obj, $cid) { + public static function addUrls(&$obj, $cid) { $uid = CRM_Core_BAO_UFMatch::getUFId($cid); if ($uid) { diff --git a/CRM/Contact/Page/View/ContactSmartGroup.php b/CRM/Contact/Page/View/ContactSmartGroup.php index f10821c928..cd2c508108 100644 --- a/CRM/Contact/Page/View/ContactSmartGroup.php +++ b/CRM/Contact/Page/View/ContactSmartGroup.php @@ -45,7 +45,7 @@ class CRM_Contact_Page_View_ContactSmartGroup extends CRM_Core_Page { * return null * @access public */ - function browse() { + public function browse() { $in = CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId, 'Added'); // keep track of all 'added' contact groups so we can remove them from the smart group @@ -85,7 +85,7 @@ class CRM_Contact_Page_View_ContactSmartGroup extends CRM_Core_Page { } } - function preProcess() { + public function preProcess() { $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE); $this->assign('contactId', $this->_contactId); @@ -104,7 +104,7 @@ class CRM_Contact_Page_View_ContactSmartGroup extends CRM_Core_Page { * return null * @access public */ - function run() { + public function run() { $this->preProcess(); $this->browse(); return parent::run(); diff --git a/CRM/Contact/Page/View/CustomData.php b/CRM/Contact/Page/View/CustomData.php index 6be13d8ae5..e34670400e 100644 --- a/CRM/Contact/Page/View/CustomData.php +++ b/CRM/Contact/Page/View/CustomData.php @@ -63,7 +63,7 @@ class CRM_Contact_Page_View_CustomData extends CRM_Core_Page { * @access public * */ - function preProcess() { + public function preProcess() { $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE); $this->assign('contactId', $this->_contactId); @@ -92,7 +92,7 @@ class CRM_Contact_Page_View_CustomData extends CRM_Core_Page { * @return void * @static */ - function run() { + public function run() { $this->preProcess(); //set the userContext stack diff --git a/CRM/Contact/Page/View/GroupContact.php b/CRM/Contact/Page/View/GroupContact.php index 57accd35d5..d407af0a76 100644 --- a/CRM/Contact/Page/View/GroupContact.php +++ b/CRM/Contact/Page/View/GroupContact.php @@ -40,7 +40,7 @@ class CRM_Contact_Page_View_GroupContact extends CRM_Core_Page { * return null * @access public */ - function browse() { + public function browse() { $count = CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId, NULL, NULL, TRUE); @@ -78,7 +78,7 @@ class CRM_Contact_Page_View_GroupContact extends CRM_Core_Page { * return null * @access public */ - function edit($groupId = NULL) { + public function edit($groupId = NULL) { $controller = new CRM_Core_Controller_Simple( 'CRM_Contact_Form_GroupContact', ts('Contact\'s Groups'), @@ -105,7 +105,7 @@ class CRM_Contact_Page_View_GroupContact extends CRM_Core_Page { $controller->run(); } - function preProcess() { + public function preProcess() { $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE); $this->assign('contactId', $this->_contactId); @@ -124,7 +124,7 @@ class CRM_Contact_Page_View_GroupContact extends CRM_Core_Page { * return null * @access public */ - function run() { + public function run() { $this->preProcess(); $displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId); @@ -156,7 +156,7 @@ class CRM_Contact_Page_View_GroupContact extends CRM_Core_Page { * * @return bool */ - static function del($groupContactId, $status, $contactID) { + public static function del($groupContactId, $status, $contactID) { $groupId = CRM_Contact_BAO_GroupContact::getGroupId($groupContactId); switch ($status) { diff --git a/CRM/Contact/Page/View/Log.php b/CRM/Contact/Page/View/Log.php index 6503f08199..4828627aa8 100644 --- a/CRM/Contact/Page/View/Log.php +++ b/CRM/Contact/Page/View/Log.php @@ -40,7 +40,7 @@ class CRM_Contact_Page_View_Log extends CRM_Core_Page { * return null * @access public */ - function browse() { + public function browse() { $loggingReport = CRM_Core_BAO_Log::useLoggingReport(); $this->assign('useLogging', $loggingReport); @@ -73,7 +73,7 @@ class CRM_Contact_Page_View_Log extends CRM_Core_Page { $this->assign_by_ref('log', $logEntries); } - function preProcess() { + public function preProcess() { $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE); $this->assign('contactId', $this->_contactId); @@ -93,7 +93,7 @@ class CRM_Contact_Page_View_Log extends CRM_Core_Page { * return null * @access public */ - function run() { + public function run() { $this->preProcess(); $this->browse(); diff --git a/CRM/Contact/Page/View/Note.php b/CRM/Contact/Page/View/Note.php index a043f987b3..78b8fe55e0 100644 --- a/CRM/Contact/Page/View/Note.php +++ b/CRM/Contact/Page/View/Note.php @@ -61,7 +61,7 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page { * @return void * @access public */ - function view() { + public function view() { $note = new CRM_Core_DAO_Note(); $note->id = $this->_id; if ($note->find(TRUE)) { @@ -88,7 +88,7 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page { * return null * @access public */ - function browse() { + public function browse() { $note = new CRM_Core_DAO_Note(); $note->entity_table = 'civicrm_contact'; $note->entity_id = $this->_contactId; @@ -168,7 +168,7 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page { * return null * @access public */ - function edit() { + public function edit() { $controller = new CRM_Core_Controller_Simple('CRM_Note_Form_Note', ts('Contact Notes'), $this->_action); $controller->setEmbedded(TRUE); @@ -195,7 +195,7 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page { $controller->run(); } - function preProcess() { + public function preProcess() { $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); if ($this->_id && CRM_Core_BAO_Note::getNotePrivacyHidden($this->_id)) { @@ -222,7 +222,7 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page { * return null * @access public */ - function run() { + public function run() { $this->preProcess(); if ($this->_action & CRM_Core_Action::VIEW) { @@ -246,7 +246,7 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page { * @return void * @access public */ - function delete() { + public function delete() { CRM_Core_BAO_Note::del($this->_id); } @@ -256,7 +256,7 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page { * @return array (reference) of action links * @static */ - static function &links() { + public static function &links() { if (!(self::$_links)) { $deleteExtra = ts('Are you sure you want to delete this note?'); @@ -296,7 +296,7 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page { * @return array (reference) of action links * @static */ - static function &commentLinks() { + public static function &commentLinks() { if (!(self::$_commentLinks)) { self::$_commentLinks = array( CRM_Core_Action::VIEW => array( diff --git a/CRM/Contact/Page/View/Print.php b/CRM/Contact/Page/View/Print.php index 2ff8ac6aea..8ed35da4b1 100644 --- a/CRM/Contact/Page/View/Print.php +++ b/CRM/Contact/Page/View/Print.php @@ -47,7 +47,7 @@ class CRM_Contact_Page_View_Print extends CRM_Contact_Page_View_Summary { * @access public * */ - function run() { + public function run() { $this->_print = CRM_Core_Smarty::PRINT_PAGE; $this->preProcess(); @@ -63,7 +63,7 @@ class CRM_Contact_Page_View_Print extends CRM_Contact_Page_View_Summary { * @return void * @access public */ - function view() { + public function view() { $params = array(); $defaults = array(); $ids = array(); diff --git a/CRM/Contact/Page/View/Relationship.php b/CRM/Contact/Page/View/Relationship.php index 68d5caf91d..4e9d89619f 100644 --- a/CRM/Contact/Page/View/Relationship.php +++ b/CRM/Contact/Page/View/Relationship.php @@ -59,7 +59,7 @@ class CRM_Contact_Page_View_Relationship extends CRM_Core_Page { * * @access public */ - function view() { + public function view() { $viewRelationship = CRM_Contact_BAO_Relationship::getRelationship($this->_contactId, NULL, NULL, NULL, $this->_id); //To check whether selected contact is a contact_id_a in //relationship type 'a_b' in relationship table, if yes then @@ -142,7 +142,7 @@ class CRM_Contact_Page_View_Relationship extends CRM_Core_Page { * return null * @access public */ - function browse() { + public function browse() { // do nothing :) we are using datatable for rendering relationship selectors } @@ -152,7 +152,7 @@ class CRM_Contact_Page_View_Relationship extends CRM_Core_Page { * return null * @access public */ - function edit() { + public function edit() { $controller = new CRM_Core_Controller_Simple('CRM_Contact_Form_Relationship', ts('Contact Relationships'), $this->_action); $controller->setEmbedded(TRUE); @@ -190,7 +190,7 @@ class CRM_Contact_Page_View_Relationship extends CRM_Core_Page { $controller->run(); } - function preProcess() { + public function preProcess() { $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE); $this->assign('contactId', $this->_contactId); @@ -209,7 +209,7 @@ class CRM_Contact_Page_View_Relationship extends CRM_Core_Page { * return null * @access public */ - function run() { + public function run() { $this->preProcess(); $this->setContext(); @@ -243,7 +243,7 @@ class CRM_Contact_Page_View_Relationship extends CRM_Core_Page { return parent::run(); } - function setContext() { + public function setContext() { $context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'search' ); @@ -269,7 +269,7 @@ class CRM_Contact_Page_View_Relationship extends CRM_Core_Page { * return null * @access public */ - function delete() { + public function delete() { // calls a function to delete relationship CRM_Contact_BAO_Relationship::del($this->_id); } @@ -280,7 +280,7 @@ class CRM_Contact_Page_View_Relationship extends CRM_Core_Page { * @return array (reference) of action links * @static */ - static function &links() { + public static function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::VIEW => array( diff --git a/CRM/Contact/Page/View/Summary.php b/CRM/Contact/Page/View/Summary.php index 840bb0b408..4f265724bd 100644 --- a/CRM/Contact/Page/View/Summary.php +++ b/CRM/Contact/Page/View/Summary.php @@ -47,7 +47,7 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View { * @access public * */ - function preProcess() { + public function preProcess() { parent::preProcess(); // actions buttom contextMenu @@ -94,7 +94,7 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View { * @access public * */ - function run() { + public function run() { $this->preProcess(); if ($this->_action & CRM_Core_Action::UPDATE) { @@ -113,7 +113,7 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View { * @return void * @access public */ - function edit() { + public function edit() { // set the userContext stack $session = CRM_Core_Session::singleton(); $url = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $this->_contactId); @@ -131,7 +131,7 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View { * @return void * @access public */ - function view() { + public function view() { // Add js for tabs, in-place editing, and jstree for tags CRM_Core_Resources::singleton() ->addScriptFile('civicrm', 'templates/CRM/Contact/Page/View/Summary.js', 2, 'html-header') @@ -421,7 +421,7 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View { /** * @return string */ - function getTemplateFileName() { + public function getTemplateFileName() { if ($this->_contactId) { $contactSubtypes = $this->get('contactSubtype') ? explode(CRM_Core_DAO::VALUE_SEPARATOR, $this->get('contactSubtype')) : array(); diff --git a/CRM/Contact/Page/View/Sunlight.php b/CRM/Contact/Page/View/Sunlight.php index fef23f655e..61bd13644a 100644 --- a/CRM/Contact/Page/View/Sunlight.php +++ b/CRM/Contact/Page/View/Sunlight.php @@ -40,7 +40,7 @@ class CRM_Contact_Page_View_Sunlight extends CRM_Contact_Page_View { * return null * @access public */ - function browse() { + public function browse() { // get the primary city, state and zip for the contact $ids = array($this->_contactId); $locations = CRM_Contact_BAO_Contact_Location::getMapInfo($ids); @@ -60,7 +60,7 @@ class CRM_Contact_Page_View_Sunlight extends CRM_Contact_Page_View { * return null * @access public */ - function run() { + public function run() { $this->preProcess(); $this->browse(); diff --git a/CRM/Contact/Page/View/Tag.php b/CRM/Contact/Page/View/Tag.php index 614a24080a..923b41a95e 100644 --- a/CRM/Contact/Page/View/Tag.php +++ b/CRM/Contact/Page/View/Tag.php @@ -40,7 +40,7 @@ class CRM_Contact_Page_View_Tag extends CRM_Core_Page { * return null * @access public */ - function browse() { + public function browse() { $controller = new CRM_Core_Controller_Simple('CRM_Tag_Form_Tag', ts('Contact Tags'), $this->_action); $controller->setEmbedded(TRUE); @@ -54,7 +54,7 @@ class CRM_Contact_Page_View_Tag extends CRM_Core_Page { $controller->run(); } - function preProcess() { + public function preProcess() { $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE); $this->assign('contactId', $this->_contactId); @@ -72,7 +72,7 @@ class CRM_Contact_Page_View_Tag extends CRM_Core_Page { * return null * @access public */ - function run() { + public function run() { $this->preProcess(); $this->browse(); diff --git a/CRM/Contact/Page/View/UserDashBoard.php b/CRM/Contact/Page/View/UserDashBoard.php index 003b9689ba..8a5f348d2f 100644 --- a/CRM/Contact/Page/View/UserDashBoard.php +++ b/CRM/Contact/Page/View/UserDashBoard.php @@ -60,7 +60,7 @@ class CRM_Contact_Page_View_UserDashBoard extends CRM_Core_Page { /** * @throws Exception */ - function __construct() { + public function __construct() { parent::__construct(); $check = CRM_Core_Permission::check('access Contact Dashboard'); @@ -94,7 +94,7 @@ class CRM_Contact_Page_View_UserDashBoard extends CRM_Core_Page { * @return void * @access public */ - function preProcess() { + public function preProcess() { if (!$this->_contactId) { CRM_Core_Error::fatal(ts('You must be logged in to view this page.')); } @@ -115,7 +115,7 @@ class CRM_Contact_Page_View_UserDashBoard extends CRM_Core_Page { * @return void * @access public */ - function buildUserDashBoard() { + public function buildUserDashBoard() { //build component selectors $dashboardElements = array(); $config = CRM_Core_Config::singleton(); @@ -207,7 +207,7 @@ class CRM_Contact_Page_View_UserDashBoard extends CRM_Core_Page { * * @access public */ - function run() { + public function run() { $this->preProcess(); $this->buildUserDashBoard(); return parent::run(); @@ -220,7 +220,7 @@ class CRM_Contact_Page_View_UserDashBoard extends CRM_Core_Page { * @static */ static - function &links() { + public function &links() { if (!(self::$_links)) { $disableExtra = ts('Are you sure you want to disable this relationship?'); diff --git a/CRM/Contact/Page/View/UserDashBoard/GroupContact.php b/CRM/Contact/Page/View/UserDashBoard/GroupContact.php index 3a1fa747d9..598dd3850e 100644 --- a/CRM/Contact/Page/View/UserDashBoard/GroupContact.php +++ b/CRM/Contact/Page/View/UserDashBoard/GroupContact.php @@ -40,7 +40,7 @@ class CRM_Contact_Page_View_UserDashBoard_GroupContact extends CRM_Contact_Page_ * return null * @access public */ - function browse() { + public function browse() { $count = CRM_Contact_BAO_GroupContact::getContactGroup( $this->_contactId, NULL, @@ -83,7 +83,7 @@ class CRM_Contact_Page_View_UserDashBoard_GroupContact extends CRM_Contact_Page_ * return null * @access public */ - function edit($groupId = NULL) { + public function edit($groupId = NULL) { $this->assign('edit', $this->_edit); if (!$this->_edit) { return; @@ -137,7 +137,7 @@ class CRM_Contact_Page_View_UserDashBoard_GroupContact extends CRM_Contact_Page_ * return null * @access public */ - function run() { + public function run() { $this->edit(); $this->browse(); } diff --git a/CRM/Contact/Page/View/Useradd.php b/CRM/Contact/Page/View/Useradd.php index 19d9d50346..e62fb414fb 100755 --- a/CRM/Contact/Page/View/Useradd.php +++ b/CRM/Contact/Page/View/Useradd.php @@ -47,7 +47,7 @@ class CRM_Contact_Page_View_Useradd extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { $controller = new CRM_Core_Controller_Simple('CRM_Contact_Form_Task_Useradd', ts('Add User'), CRM_Core_Action::ADD diff --git a/CRM/Contact/Page/View/Vcard.php b/CRM/Contact/Page/View/Vcard.php index 1e13cb3f1e..42c9804697 100644 --- a/CRM/Contact/Page/View/Vcard.php +++ b/CRM/Contact/Page/View/Vcard.php @@ -48,7 +48,7 @@ class CRM_Contact_Page_View_Vcard extends CRM_Contact_Page_View { * * @return void */ - function run() { + public function run() { $this->preProcess(); $params = array(); diff --git a/CRM/Contact/Selector.php b/CRM/Contact/Selector.php index e172e4804d..85c53f827e 100644 --- a/CRM/Contact/Selector.php +++ b/CRM/Contact/Selector.php @@ -232,7 +232,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se * @access public * */ - static function &links() { + public static function &links() { list($context, $contextMenu, $key) = func_get_args(); $extraParams = ($key) ? "&key={$key}" : NULL; $searchContext = ($context) ? "&context=$context" : NULL; @@ -307,7 +307,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se * * @access public */ - function getPagerParams($action, &$params) { + public function getPagerParams($action, &$params) { $params['status'] = ts('Contact %%StatusMessage%%'); $params['csvString'] = NULL; $params['rowCount'] = CRM_Utils_Pager::ROWCOUNT; @@ -322,7 +322,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se * * @return array */ - function &getColHeads($action = NULL, $output = NULL) { + public function &getColHeads($action = NULL, $output = NULL) { $colHeads = self::_getColumnHeaders(); $colHeads[] = array('desc' => ts('Actions'), 'name' => ts('Action')); return $colHeads; @@ -338,7 +338,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se * @return array the column headers that need to be displayed * @access public */ - function &getColumnHeaders($action = NULL, $output = NULL) { + public function &getColumnHeaders($action = NULL, $output = NULL) { $headers = NULL; // unset return property elements that we don't care @@ -490,7 +490,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se * @return int Total number of rows * @access public */ - function getTotalCount($action) { + public function getTotalCount($action) { // Use count from cache during paging/sorting if (!empty($_GET['crmPID']) || !empty($_GET['crmSID'])) { $count = CRM_Core_BAO_Cache::getItem('Search Results Count', $this->_key); @@ -513,7 +513,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se * * @return int the total number of rows for this action */ - function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { + public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { $config = CRM_Core_Config::singleton(); if (($output == CRM_Core_Selector_Controller::EXPORT || @@ -825,7 +825,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se * * @return string */ - function buildPrevNextCache($sort) { + public function buildPrevNextCache($sort) { $cacheKey = 'civicrm search ' . $this->_key; // We should clear the cache in following conditions: @@ -881,7 +881,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se /** * @param $rows */ - function addActions(&$rows) { + public function addActions(&$rows) { $config = CRM_Core_Config::singleton(); $permissions = array(CRM_Core_Permission::getPermission()); @@ -977,7 +977,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se /** * @param $rows */ - function removeActions(&$rows) { + public function removeActions(&$rows) { foreach ($rows as $rid => & $rValue) { unset($rValue['contact_type']); unset($rValue['action']); @@ -990,7 +990,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se * @param int $start * @param int $end */ - function fillupPrevNextCache($sort, $cacheKey, $start = 0, $end = 500) { + public function fillupPrevNextCache($sort, $cacheKey, $start = 0, $end = 500) { $coreSearch = TRUE; // For custom searches, use the contactIDs method if (is_a($this, 'CRM_Contact_Selector_Custom')) { @@ -1052,7 +1052,7 @@ SELECT DISTINCT 'civicrm_contact', contact_a.id, contact_a.id, '$cacheKey', cont * * @return void */ - function rebuildPreNextCache($start, $end, $sort, $cacheKey) { + public function rebuildPreNextCache($start, $end, $sort, $cacheKey) { // generate full SQL $sql = $this->_query->searchQuery($start, $end, $sort, FALSE, $this->_query->_includeContactIds, FALSE, FALSE, TRUE); @@ -1098,7 +1098,7 @@ SELECT DISTINCT 'civicrm_contact', contact_a.id, contact_a.id, '$cacheKey', cont * * @return string name of the file */ - function getExportFileName($output = 'csv') { + public function getExportFileName($output = 'csv') { return ts('CiviCRM Contact Search'); } @@ -1168,14 +1168,14 @@ SELECT DISTINCT 'civicrm_contact', contact_a.id, contact_a.id, '$cacheKey', cont /** * @return CRM_Contact_BAO_Query */ - function &getQuery() { + public function &getQuery() { return $this->_query; } /** * @return CRM_Contact_DAO_Contact */ - function alphabetQuery() { + public function alphabetQuery() { return $this->_query->searchQuery(NULL, NULL, NULL, FALSE, FALSE, TRUE); } @@ -1188,7 +1188,7 @@ SELECT DISTINCT 'civicrm_contact', contact_a.id, contact_a.id, '$cacheKey', cont * * @return CRM_Contact_DAO_Contact */ - function contactIDQuery($params, $action, $sortID, $displayRelationshipType = NULL, $queryOperator = 'AND') { + public function contactIDQuery($params, $action, $sortID, $displayRelationshipType = NULL, $queryOperator = 'AND') { $sortOrder = &$this->getSortOrder($this->_action); $sort = new CRM_Utils_Sort($sortOrder, $sortID); @@ -1225,7 +1225,7 @@ SELECT DISTINCT 'civicrm_contact', contact_a.id, contact_a.id, '$cacheKey', cont * * @return array */ - function &makeProperties(&$returnProperties) { + public function &makeProperties(&$returnProperties) { $properties = array(); foreach ($returnProperties as $name => $value) { if ($name != 'location') { diff --git a/CRM/Contact/Selector/Controller.php b/CRM/Contact/Selector/Controller.php index 58585224f1..45d075d007 100644 --- a/CRM/Contact/Selector/Controller.php +++ b/CRM/Contact/Selector/Controller.php @@ -43,7 +43,7 @@ class CRM_Contact_Selector_Controller extends CRM_Core_Selector_Controller { /** * @return string */ - function getQill() { + public function getQill() { return $this->_object->getQILL(); } } diff --git a/CRM/Contact/Selector/Custom.php b/CRM/Contact/Selector/Custom.php index c443d33058..6afc9090cf 100644 --- a/CRM/Contact/Selector/Custom.php +++ b/CRM/Contact/Selector/Custom.php @@ -169,7 +169,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { * @access public * */ - static function &links() { + public static function &links() { list($key) = func_get_args(); $searchContext = "&context=custom"; $extraParams = ($key) ? "&key={$key}" : NULL; @@ -214,7 +214,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { * * @access public */ - function getPagerParams($action, &$params) { + public function getPagerParams($action, &$params) { $params['status'] = ts('Contact %%StatusMessage%%'); $params['csvString'] = NULL; $params['rowCount'] = CRM_Utils_Pager::ROWCOUNT; @@ -233,7 +233,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { * @return array the column headers that need to be displayed * @access public */ - function &getColumnHeaders($action = NULL, $output = NULL) { + public function &getColumnHeaders($action = NULL, $output = NULL) { $columns = $this->_search->columns(); if ($output == CRM_Core_Selector_Controller::EXPORT) { return array_keys($columns); @@ -264,7 +264,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { * @return int Total number of rows * @access public */ - function getTotalCount($action) { + public function getTotalCount($action) { return $this->_search->count(); } @@ -279,7 +279,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { * * @return int the total number of rows for this action */ - function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { + public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { $includeContactIDs = FALSE; if (($output == CRM_Core_Selector_Controller::EXPORT || @@ -400,14 +400,14 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { * * @return string name of the file */ - function getExportFileName($output = 'csv') { + public function getExportFileName($output = 'csv') { return ts('CiviCRM Custom Search'); } /** * @return null */ - function alphabetQuery() { + public function alphabetQuery() { return NULL; } @@ -420,7 +420,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { * * @return Object */ - function &contactIDQuery($params, $action, $sortID, $displayRelationshipType = NULL, $queryOperator = 'AND') { + public function &contactIDQuery($params, $action, $sortID, $displayRelationshipType = NULL, $queryOperator = 'AND') { $params = array(); $sql = $this->_search->contactIDs($params); @@ -430,7 +430,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { /** * @param $rows */ - function addActions(&$rows) { + public function addActions(&$rows) { $links = self::links($this->_key); $permissions = array(CRM_Core_Permission::getPermission()); @@ -455,7 +455,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { /** * @param $rows */ - function removeActions(&$rows) { + public function removeActions(&$rows) { foreach ($rows as $rid => & $rValue) { unset($rValue['action']); } diff --git a/CRM/Contact/StateMachine/Search.php b/CRM/Contact/StateMachine/Search.php index 25a990e388..358aee70c5 100644 --- a/CRM/Contact/StateMachine/Search.php +++ b/CRM/Contact/StateMachine/Search.php @@ -93,7 +93,7 @@ class CRM_Contact_StateMachine_Search extends CRM_Core_StateMachine { * @return string the name of the form that will handle the task * @access protected */ - function taskName($controller, $formName = 'Search') { + public function taskName($controller, $formName = 'Search') { // total hack, check POST vars and then session to determine stuff $value = CRM_Utils_Array::value('task', $_POST); if (!isset($value)) { @@ -118,7 +118,7 @@ class CRM_Contact_StateMachine_Search extends CRM_Core_StateMachine { * @return string * @access public */ - function getTaskFormName() { + public function getTaskFormName() { if (is_array($this->_task)) { // return first page return CRM_Utils_String::getClassName($this->_task[0]); @@ -133,7 +133,7 @@ class CRM_Contact_StateMachine_Search extends CRM_Core_StateMachine { * we dont want to issue a reset of the state session when we are done processing a task * */ - function shouldReset() { + public function shouldReset() { return FALSE; } } diff --git a/CRM/Contact/Task.php b/CRM/Contact/Task.php index 91d6865ad7..635679dc12 100644 --- a/CRM/Contact/Task.php +++ b/CRM/Contact/Task.php @@ -82,7 +82,7 @@ class CRM_Contact_Task { */ static $_optionalTasks = NULL; - static function initTasks() { + public static function initTasks() { if (!self::$_tasks) { self::$_tasks = array( self::GROUP_CONTACTS => array( @@ -283,7 +283,7 @@ class CRM_Contact_Task { * @static * @access public */ - static function &taskTitles() { + public static function &taskTitles() { self::initTasks(); $titles = array(); @@ -319,7 +319,7 @@ class CRM_Contact_Task { * @return array set of tasks that are valid for the user * @access public */ - static function &permissionedTaskTitles($permission, $deletedContacts = FALSE) { + public static function &permissionedTaskTitles($permission, $deletedContacts = FALSE) { self::initTasks(); $tasks = array(); if ($deletedContacts) { @@ -362,7 +362,7 @@ class CRM_Contact_Task { * @static * @access public */ - static function &optionalTaskTitle() { + public static function &optionalTaskTitle() { $tasks = array( self::SAVE_SEARCH_UPDATE => self::$_tasks[self::SAVE_SEARCH_UPDATE]['title'], ); @@ -374,7 +374,7 @@ class CRM_Contact_Task { * * @return array */ - static function getTask($value) { + public static function getTask($value) { self::initTasks(); if (!CRM_Utils_Array::value($value, self::$_tasks)) { diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 70d0fa4f4e..2d22dc04e9 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -78,7 +78,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { /** * */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -96,7 +96,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { * @access public * @static */ - static function add(&$params, $ids = array()) { + public static function add(&$params, $ids = array()) { if (empty($params)) { return; } @@ -206,7 +206,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { * Get defaults for new entity * @return array */ - static function getDefaults() { + public static function getDefaults() { return array( 'payment_instrument_id' => key(CRM_Core_OptionGroup::values('payment_instrument', FALSE, FALSE, FALSE, 'AND is_default = 1') @@ -227,7 +227,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { * @access public * @static */ - static function &getValues($params, &$values, &$ids) { + public static function &getValues($params, &$values, &$ids) { if (empty($params)) { return NULL; } @@ -298,7 +298,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { * @access public * @static */ - static function create(&$params, $ids = array()) { + public static function create(&$params, $ids = array()) { $dateFields = array('receive_date', 'cancel_date', 'receipt_date', 'thankyou_date'); foreach ($dateFields as $df) { if (isset($params[$df])) { @@ -487,7 +487,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { * @access public * @static */ - static function resolveDefaults(&$defaults, $reverse = FALSE) { + public static function resolveDefaults(&$defaults, $reverse = FALSE) { self::lookupValue($defaults, 'financial_type', CRM_Contribute_PseudoConstant::financialType(), $reverse); self::lookupValue($defaults, 'payment_instrument', CRM_Contribute_PseudoConstant::paymentInstrument(), $reverse); self::lookupValue($defaults, 'contribution_status', CRM_Contribute_PseudoConstant::contributionStatus(), $reverse); @@ -502,7 +502,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { * the api needs the name => value conversion, also the view layer typically * requires value => name conversion */ - static function lookupValue(&$defaults, $property, &$lookup, $reverse) { + public static function lookupValue(&$defaults, $property, &$lookup, $reverse) { $id = $property . '_id'; $src = $reverse ? $property : $id; @@ -538,7 +538,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { * @access public * @static */ - static function retrieve(&$params, &$defaults, &$ids) { + public static function retrieve(&$params, &$defaults, &$ids) { $contribution = CRM_Contribute_BAO_Contribution::getValues($params, $defaults, $ids); return $contribution; } @@ -557,7 +557,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { * @access public * @static */ - static function &importableFields($contactType = 'Individual', $status = TRUE) { + public static function &importableFields($contactType = 'Individual', $status = TRUE) { if (!self::$_importableFields) { if (!self::$_importableFields) { self::$_importableFields = array(); @@ -623,7 +623,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { /** * @return array */ - static function &exportableFields() { + public static function &exportableFields() { if (!self::$_exportableFields) { if (!self::$_exportableFields) { self::$_exportableFields = array(); @@ -710,7 +710,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { * * @return array|null */ - static function getTotalAmountAndCount($status = NULL, $startDate = NULL, $endDate = NULL) { + public static function getTotalAmountAndCount($status = NULL, $startDate = NULL, $endDate = NULL) { $where = array(); switch ($status) { case 'Valid': @@ -766,7 +766,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = civicrm_contribution.conta * @return mixed|null $results no of deleted Contribution on success, false otherwise@access public * @static */ - static function deleteContribution($id) { + public static function deleteContribution($id) { CRM_Utils_Hook::pre('delete', 'Contribution', $id, CRM_Core_DAO::$_nullArray); $transaction = new CRM_Core_Transaction(); @@ -842,7 +842,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = civicrm_contribution.conta * @access public * static */ - static function checkDuplicate($input, &$duplicates, $id = NULL) { + public static function checkDuplicate($input, &$duplicates, $id = NULL) { if (!$id) { $id = CRM_Utils_Array::value('id', $input); } @@ -895,7 +895,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = civicrm_contribution.conta * @access public * @static */ - static function addPremium(&$params) { + public static function addPremium(&$params) { $contributionProduct = new CRM_Contribute_DAO_ContributionProduct(); $contributionProduct->copyValues($params); return $contributionProduct->save(); @@ -912,7 +912,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = civicrm_contribution.conta * @static * @access public */ - static function getContributionFields($addExtraFields = TRUE) { + public static function getContributionFields($addExtraFields = TRUE) { $contributionFields = CRM_Contribute_DAO_Contribution::export(); $contributionFields = array_merge($contributionFields, CRM_Core_OptionValue::getFields($mode = 'contribute')); @@ -941,7 +941,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = civicrm_contribution.conta * * @static */ - static function getSpecialContributionFields() { + public static function getSpecialContributionFields() { $extraFields = array( 'contribution_soft_credit_name' => array( 'name' => 'contribution_soft_credit_name', @@ -977,7 +977,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = civicrm_contribution.conta * * @return array */ - static function getCurrentandGoalAmount($pageID) { + public static function getCurrentandGoalAmount($pageID) { $query = " SELECT p.goal_amount as goal, sum( c.total_amount ) as total FROM civicrm_contribution_page p, @@ -1010,7 +1010,7 @@ GROUP BY p.id * @access public * @static */ - static function getHonorContacts($honorId) { + public static function getHonorContacts($honorId) { $params = array(); $honorDAO = new CRM_Contribute_DAO_ContributionSoft(); $honorDAO->contact_id = $honorId; @@ -1047,7 +1047,7 @@ GROUP BY p.id * @static * @access public */ - static function sortName($id) { + public static function sortName($id) { $id = CRM_Utils_Type::escape($id, 'Integer'); $query = " @@ -1064,7 +1064,7 @@ WHERE civicrm_contribution.contact_id = civicrm_contact.id * * @return array */ - static function annual($contactID) { + public static function annual($contactID) { if (is_array($contactID)) { $contactIDs = implode(',', $contactID); } @@ -1147,7 +1147,7 @@ WHERE civicrm_contribution.contact_id = civicrm_contact.id * @access public * static */ - static function checkDuplicateIds($params) { + public static function checkDuplicateIds($params) { $dao = new CRM_Contribute_DAO_Contribution(); $clause = array(); @@ -1179,7 +1179,7 @@ WHERE civicrm_contribution.contact_id = civicrm_contact.id * @static * @access public */ - static function getContributionDetails($exportMode, $componentIds) { + public static function getContributionDetails($exportMode, $componentIds) { $paymentDetails = array(); $componentClause = ' IN ( ' . implode(',', $componentIds) . ' ) '; @@ -1241,7 +1241,7 @@ LEFT JOIN civicrm_option_value contribution_status ON (civicrm_contribution.cont * @return address id * @static */ - static function createAddress(&$params, $billingLocationTypeID) { + public static function createAddress(&$params, $billingLocationTypeID) { $billingFields = array( 'street_address', 'city', @@ -1278,7 +1278,7 @@ LEFT JOIN civicrm_option_value contribution_status ON (civicrm_contribution.cont * @access public * @static */ - static function deleteAddress($contributionId = NULL, $contactId = NULL) { + public static function deleteAddress($contributionId = NULL, $contactId = NULL) { $clauses = array(); $contactJoin = NULL; @@ -1322,7 +1322,7 @@ WHERE $condition * @return $contributionId pending contribution id. * @static */ - static function checkOnlinePendingContribution($componentId, $componentName) { + public static function checkOnlinePendingContribution($componentId, $componentName) { $contributionId = NULL; if (!$componentId || !in_array($componentName, array('Event', 'Membership')) @@ -1376,7 +1376,7 @@ LEFT JOIN civicrm_contribution contribution ON ( componentPayment.contribution_ /** * This function update contribution as well as related objects. */ - static function transitionComponents($params, $processContributionObject = FALSE) { + public static function transitionComponents($params, $processContributionObject = FALSE) { // get minimum required values. $contactId = CRM_Utils_Array::value('contact_id', $params); $componentId = CRM_Utils_Array::value('component_id', $params); @@ -1780,7 +1780,7 @@ LEFT JOIN civicrm_contribution contribution ON ( componentPayment.contribution_ * * @return null|string */ - static function contributionCount($contactId, $includeSoftCredit = TRUE) { + public static function contributionCount($contactId, $includeSoftCredit = TRUE) { if (!$contactId) { return 0; } @@ -1817,7 +1817,7 @@ LEFT JOIN civicrm_contribution contribution ON ( componentPayment.contribution_ * @return array $ids containing organization id and individual id * @access public */ - static function getOnbehalfIds($contributionId, $contributorId = NULL) { + public static function getOnbehalfIds($contributionId, $contributorId = NULL) { $ids = array(); @@ -1885,7 +1885,7 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac * @return array * @static */ - static function getContributionDates() { + public static function getContributionDates() { $config = CRM_Core_Config::singleton(); $currentMonth = date('m'); $currentDay = date('d'); @@ -1936,7 +1936,7 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac * @return bool * @throws Exception */ - function loadRelatedObjects(&$input, &$ids, $required = FALSE, $loadAll = false) { + public function loadRelatedObjects(&$input, &$ids, $required = FALSE, $loadAll = false) { if($loadAll){ $ids = array_merge($this->getComponentDetails($this->id),$ids); if(empty($ids['contact']) && isset($this->contact_id)){ @@ -2115,7 +2115,7 @@ WHERE contribution_id = %1 "; * * @throws Exception */ - function composeMessageArray(&$input, &$ids, &$values, $recur = FALSE, $returnMessageText = TRUE) { + public function composeMessageArray(&$input, &$ids, &$values, $recur = FALSE, $returnMessageText = TRUE) { if (empty($this->_relatedObjects)) { $this->loadRelatedObjects($input, $ids); } @@ -2255,7 +2255,7 @@ WHERE contribution_id = %1 "; * * @return mixed */ - function _gatherMessageValues($input, &$values, $ids = array()) { + public function _gatherMessageValues($input, &$values, $ids = array()) { // set display address of contributor if ($this->address_id) { $addressParams = array('id' => $this->address_id); @@ -2371,7 +2371,7 @@ WHERE contribution_id = %1 "; * * @return mixed */ - function _assignMessageVariablesToTemplate(&$values, $input, &$template, $recur = FALSE, $returnMessageText = True) { + public function _assignMessageVariablesToTemplate(&$values, $input, &$template, $recur = FALSE, $returnMessageText = True) { $template->assign('first_name', $this->_relatedObjects['contact']->first_name); $template->assign('last_name', $this->_relatedObjects['contact']->last_name); $template->assign('displayName', $this->_relatedObjects['contact']->display_name); @@ -2559,7 +2559,7 @@ WHERE contribution_id = %1 "; * @access public * @static */ - static function isCancelSubscriptionSupported($contributionId, $isNotCancelled = TRUE) { + public static function isCancelSubscriptionSupported($contributionId, $isNotCancelled = TRUE) { $cacheKeyString = "$contributionId"; $cacheKeyString .= $isNotCancelled ? '_1' : '_0'; @@ -2590,7 +2590,7 @@ WHERE contribution_id = %1 "; * @access public * @static */ - static function isSubscriptionCancelled($contributionId) { + public static function isSubscriptionCancelled($contributionId) { $sql = " SELECT cr.contribution_status_id FROM civicrm_contribution_recur cr @@ -2617,7 +2617,7 @@ WHERE contribution_id = %1 "; * @access public * @static */ - static function recordFinancialAccounts(&$params, $financialTrxnValues = NULL) { + public static function recordFinancialAccounts(&$params, $financialTrxnValues = NULL) { $skipRecords = $update = $return = $isRelatedId = FALSE; $additionalParticipantId = array(); @@ -2904,7 +2904,7 @@ WHERE contribution_id = %1 "; * @access public * @static */ - static function updateFinancialAccounts(&$params, $context = NULL, $skipTrxn = NULL) { + public static function updateFinancialAccounts(&$params, $context = NULL, $skipTrxn = NULL) { $itemAmount = $trxnID = NULL; //get all the statuses $contributionStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); @@ -3072,7 +3072,7 @@ WHERE contribution_id = %1 "; * @access public * @static */ - static function checkStatusValidation($values, &$fields, &$errors) { + public static function checkStatusValidation($values, &$fields, &$errors) { if (CRM_Utils_System::isNull($values) && !empty($fields['id'])) { $values['contribution_status_id'] = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $fields['id'], 'contribution_status_id'); if ($values['contribution_status_id'] == $fields['contribution_status_id']) { @@ -3103,7 +3103,7 @@ WHERE contribution_id = %1 "; * @access public * @static */ - static function deleteContactContribution($contactId) { + public static function deleteContactContribution($contactId) { $contribution = new CRM_Contribute_DAO_Contribution(); $contribution->contact_id = $contactId; $contribution->find(); @@ -3162,7 +3162,7 @@ WHERE contribution_id = %1 "; * @access public * @static */ - static function validateFinancialType($financialTypeId, $relationName = 'Expense Account is') { + public static function validateFinancialType($financialTypeId, $relationName = 'Expense Account is') { $expenseTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE '{$relationName}' ")); $financialAccount = CRM_Contribute_PseudoConstant::financialAccountType($financialTypeId, $expenseTypeId); @@ -3188,7 +3188,7 @@ WHERE contribution_id = %1 "; * * @return null|object */ - static function recordAdditionalPayment($contributionId, $trxnsData, $paymentType = 'owed', $participantId = NULL) { + public static function recordAdditionalPayment($contributionId, $trxnsData, $paymentType = 'owed', $participantId = NULL) { $statusId = CRM_Core_OptionGroup::getValue('contribution_status', 'Completed', 'name'); $getInfoOf['id'] = $contributionId; $defaults = array(); @@ -3355,7 +3355,7 @@ WHERE eft.financial_trxn_id IN ({$trxnId}, {$baseTrxnId['financialTrxnId']}) * * @throws CRM_Core_Exception */ - static function addActivityForPayment($entityObj, $trxnObj, $activityType, $component, $contributionId) { + public static function addActivityForPayment($entityObj, $trxnObj, $activityType, $component, $contributionId) { if ($component == 'event') { $date = CRM_Utils_Date::isoToMysql($trxnObj->trxn_date); $paymentAmount = CRM_Utils_Money::format($trxnObj->total_amount, $trxnObj->currency); @@ -3403,7 +3403,7 @@ WHERE eft.financial_trxn_id IN ({$trxnId}, {$baseTrxnId['financialTrxnId']}) * * @return mixed */ - static function getPaymentInfo($id, $component, $getTrxnInfo = FALSE, $usingLineTotal = FALSE) { + public static function getPaymentInfo($id, $component, $getTrxnInfo = FALSE, $usingLineTotal = FALSE) { if ($component == 'event') { $entity = 'participant'; $entityTable = 'civicrm_participant'; @@ -3514,7 +3514,7 @@ WHERE con.id = {$contributionId} * * @return FinancialAccountId */ - static function getFinancialAccountId($financialTypeId) { + public static function getFinancialAccountId($financialTypeId) { $accountRel = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Sales Tax Account is' ")); $searchParams = array( 'entity_table' => 'civicrm_financial_type', diff --git a/CRM/Contribute/BAO/Contribution/Utils.php b/CRM/Contribute/BAO/Contribution/Utils.php index 9255a6561d..0880265169 100644 --- a/CRM/Contribute/BAO/Contribution/Utils.php +++ b/CRM/Contribute/BAO/Contribution/Utils.php @@ -379,7 +379,7 @@ class CRM_Contribute_BAO_Contribution_Utils { * @static * @access public */ - static function contributionChartMonthly($param) { + public static function contributionChartMonthly($param) { if ($param) { $param = array(1 => array($param, 'Integer')); } @@ -420,7 +420,7 @@ INNER JOIN civicrm_contact AS contact ON ( contact.id = contrib.contact_id ) * @static * @access public */ - static function contributionChartYearly() { + public static function contributionChartYearly() { $config = CRM_Core_Config::singleton(); $yearClause = "year(contrib.receive_date) as contribYear"; if (!empty($config->fiscalYearStart) && ($config->fiscalYearStart['M'] != 1 || $config->fiscalYearStart['d'] != 1)) { @@ -460,7 +460,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = contrib.contact_id ) * @param int $contactID * @param $mail */ - static function createCMSUser(&$params, $contactID, $mail) { + public static function createCMSUser(&$params, $contactID, $mail) { // lets ensure we only create one CMS user static $created = FALSE; @@ -483,7 +483,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = contrib.contact_id ) * * @return bool */ - static function _fillCommonParams(&$params, $type = 'paypal') { + public static function _fillCommonParams(&$params, $type = 'paypal') { if (array_key_exists('transaction', $params)) { $transaction = &$params['transaction']; } @@ -555,7 +555,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = contrib.contact_id ) * * @return array */ - static function formatAPIParams($apiParams, $mapper, $type = 'paypal', $category = TRUE) { + public static function formatAPIParams($apiParams, $mapper, $type = 'paypal', $category = TRUE) { $type = strtolower($type); if (!in_array($type, array( @@ -753,7 +753,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = contrib.contact_id ) * * @return bool */ - static function processAPIContribution($params) { + public static function processAPIContribution($params) { if (empty($params) || array_key_exists('error', $params)) { return FALSE; } @@ -836,7 +836,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = contrib.contact_id ) * * @return mixed */ - static function getFirstLastDetails($contactID) { + public static function getFirstLastDetails($contactID) { static $_cache; if (!$_cache) { diff --git a/CRM/Contribute/BAO/ContributionPage.php b/CRM/Contribute/BAO/ContributionPage.php index 6b2fb32873..df24cc27c6 100644 --- a/CRM/Contribute/BAO/ContributionPage.php +++ b/CRM/Contribute/BAO/ContributionPage.php @@ -73,7 +73,7 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio * @return Object DAO object on success, null otherwise * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Contribute_DAO_ContributionPage', $id, 'is_active', $is_active); } @@ -81,7 +81,7 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio * @param int $id * @param $values */ - static function setValues($id, &$values) { + public static function setValues($id, &$values) { $params = array( 'id' => $id, ); @@ -122,7 +122,7 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio * @access public * @static */ - static function sendMail($contactID, $values, $isTest = FALSE, $returnMessageText = FALSE, $fieldTypes = NULL) { + public static function sendMail($contactID, $values, $isTest = FALSE, $returnMessageText = FALSE, $fieldTypes = NULL) { $gIds = $params = array(); $email = NULL; if (isset($values['custom_pre_id'])) { @@ -435,7 +435,7 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio * * @return array */ - function composeMessage($tplParams, $contactID, $isTest) { + public function composeMessage($tplParams, $contactID, $isTest) { $sendTemplateParams = array( 'groupName' => $tplParams['membershipID'] ? 'msg_tpl_workflow_membership' : 'msg_tpl_workflow_contribution', 'valueName' => $tplParams['membershipID'] ? 'membership_online_receipt' : 'contribution_online_receipt', @@ -468,7 +468,7 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio * @access public * @static */ - static function recurringNotify($type, $contactID, $pageID, $recur, $autoRenewMembership = FALSE) { + public static function recurringNotify($type, $contactID, $pageID, $recur, $autoRenewMembership = FALSE) { $value = array(); if ($pageID) { CRM_Core_DAO::commonRetrieveAll('CRM_Contribute_DAO_ContributionPage', 'id', $pageID, $value, array( @@ -615,7 +615,7 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio * @access public * @static */ - static function copy($id) { + public static function copy($id) { $fieldsFix = array( 'prefix' => array( 'title' => ts('Copy of') . ' ', @@ -712,7 +712,7 @@ WHERE entity_table = 'civicrm_contribution_page' * @access public * @static */ - static function checkRecurPaymentProcessor($contributionPageId) { + public static function checkRecurPaymentProcessor($contributionPageId) { //FIXME $sql = " SELECT pp.is_recur @@ -736,7 +736,7 @@ WHERE entity_table = 'civicrm_contribution_page' * @access public * @static */ - static function getSectionInfo($contribPageIds = array()) { + public static function getSectionInfo($contribPageIds = array()) { $info = array(); $whereClause = NULL; if (is_array($contribPageIds) && !empty($contribPageIds)) { @@ -903,7 +903,7 @@ LEFT JOIN civicrm_premiums ON ( civicrm_premiums.entity_id = civicrm * @param int $userID contact id for contributor * @return array $pdfHtml */ - static function addInvoicePdfToEmail($contributionId, $userID) { + public static function addInvoicePdfToEmail($contributionId, $userID) { $contributionID = array($contributionId); $contactId = array($userID); $pdfParams = array( @@ -921,7 +921,7 @@ LEFT JOIN civicrm_premiums ON ( civicrm_premiums.entity_id = civicrm * * @return bool isSeparateMembershipPayment */ - static function getIsMembershipPayment($id) { + public static function getIsMembershipPayment($id) { $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 4ac169b2fa..3941477f95 100644 --- a/CRM/Contribute/BAO/ContributionRecur.php +++ b/CRM/Contribute/BAO/ContributionRecur.php @@ -43,7 +43,7 @@ class CRM_Contribute_BAO_ContributionRecur extends CRM_Contribute_DAO_Contributi * @access public * */ - static function create(&$params) { + public static function create(&$params) { return self::add($params); } @@ -61,7 +61,7 @@ class CRM_Contribute_BAO_ContributionRecur extends CRM_Contribute_DAO_Contributi * @static * @todo move hook calls / extended logic to create - requires changing calls to call create not add */ - static function add(&$params) { + public static function add(&$params) { if (!empty($params['id'])) { CRM_Utils_Hook::pre('edit', 'ContributionRecur', $params['id'], $params); } @@ -114,7 +114,7 @@ class CRM_Contribute_BAO_ContributionRecur extends CRM_Contribute_DAO_Contributi * @access public * static */ - static function checkDuplicate($params, &$duplicates) { + public static function checkDuplicate($params, &$duplicates) { $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); @@ -158,7 +158,7 @@ class CRM_Contribute_BAO_ContributionRecur extends CRM_Contribute_DAO_Contributi * * @return array|null */ - static function getPaymentProcessor($id, $mode) { + public static function getPaymentProcessor($id, $mode) { //FIX ME: $sql = " SELECT r.payment_processor_id @@ -184,7 +184,7 @@ SELECT r.payment_processor_id * @access public * static */ - static function getCount(&$ids) { + public static function getCount(&$ids) { $recurID = implode(',', $ids); $totalCount = array(); @@ -211,7 +211,7 @@ SELECT r.payment_processor_id * @access public * @static */ - static function deleteRecurContribution($recurId) { + public static function deleteRecurContribution($recurId) { $result = FALSE; if (!$recurId) { return $result; @@ -237,7 +237,7 @@ SELECT r.payment_processor_id * @access public * @static */ - static function cancelRecurContribution($recurId, $objects, $activityParams = array()) { + public static function cancelRecurContribution($recurId, $objects, $activityParams = array()) { if (!$recurId) { return FALSE; } @@ -332,7 +332,7 @@ SELECT r.payment_processor_id * @access public * @static */ - static function getRecurContributions($contactId) { + public static function getRecurContributions($contactId) { $params = array(); $recurDAO = new CRM_Contribute_DAO_ContributionRecur(); $recurDAO->contact_id = $contactId; @@ -365,7 +365,7 @@ SELECT r.payment_processor_id * * @return null|Object */ - static function getSubscriptionDetails($entityID, $entity = 'recur') { + public static function getSubscriptionDetails($entityID, $entity = 'recur') { $sql = " SELECT rec.id as recur_id, rec.processor_id as subscription_id, @@ -414,7 +414,7 @@ INNER JOIN civicrm_contribution con ON ( con.id = mp.contribution_id ) } } - static function setSubscriptionContext() { + public static function setSubscriptionContext() { // handle context redirection for subscription url $session = CRM_Core_Session::singleton(); if ($session->get('userID')) { diff --git a/CRM/Contribute/BAO/ContributionSoft.php b/CRM/Contribute/BAO/ContributionSoft.php index b1ed776d59..6e1c2016a2 100644 --- a/CRM/Contribute/BAO/ContributionSoft.php +++ b/CRM/Contribute/BAO/ContributionSoft.php @@ -37,7 +37,7 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio /** * Construct method */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -72,7 +72,7 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $contributionSoft = new CRM_Contribute_DAO_ContributionSoft(); $contributionSoft->copyValues($params); if ($contributionSoft->find(TRUE)) { @@ -89,7 +89,7 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio * * @static */ - static function del($params) { + public static function del($params) { //delete from contribution soft table $contributionSoft = new CRM_Contribute_DAO_ContributionSoft(); foreach($params as $column => $value) { @@ -104,7 +104,7 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio * * @return array */ - static function getSoftContributionTotals($contact_id, $isTest = 0) { + public static function getSoftContributionTotals($contact_id, $isTest = 0) { $query = ' SELECT SUM(amount) as amount, AVG(total_amount) as average, cc.currency FROM civicrm_contribution_soft ccs @@ -148,7 +148,7 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio * @return array of soft contribution ids, amounts, and associated contact ids * @static */ - static function getSoftContribution($contributionID, $all = FALSE) { + public static function getSoftContribution($contributionID, $all = FALSE) { $pcpFields = array( 'pcp_id', 'pcp_title', @@ -203,7 +203,7 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio * * @return array */ - static function getSoftCreditIds($contributionID , $isPCP = FALSE) { + public static function getSoftCreditIds($contributionID , $isPCP = FALSE) { $query = " SELECT id FROM civicrm_contribution_soft @@ -240,7 +240,7 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio * @return array * @static */ - static function getSoftContributionList($contact_id, $filter = NULL, $isTest = 0) { + public static function getSoftContributionList($contact_id, $filter = NULL, $isTest = 0) { $query = ' SELECT ccs.id, ccs.amount as amount, ccs.contribution_id, @@ -318,7 +318,7 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio * @param int $honoreeprofileId * @param int $honorId */ - static function formatHonoreeProfileFields($form, $params, $honoreeprofileId, $honorId = NULL) { + public static function formatHonoreeProfileFields($form, $params, $honoreeprofileId, $honorId = NULL) { $profileContactType = CRM_Core_BAO_UFGroup::getContactType($honoreeprofileId); $profileFields = CRM_Core_BAO_UFGroup::getFields($honoreeprofileId); $honoreeProfileFields = $values = array(); diff --git a/CRM/Contribute/BAO/ManagePremiums.php b/CRM/Contribute/BAO/ManagePremiums.php index 7b6e83b807..ea5aae5519 100644 --- a/CRM/Contribute/BAO/ManagePremiums.php +++ b/CRM/Contribute/BAO/ManagePremiums.php @@ -42,7 +42,7 @@ class CRM_Contribute_BAO_ManagePremiums extends CRM_Contribute_DAO_Product { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -56,7 +56,7 @@ class CRM_Contribute_BAO_ManagePremiums extends CRM_Contribute_DAO_Product { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $premium = new CRM_Contribute_DAO_Product(); $premium->copyValues($params); if ($premium->find(TRUE)) { @@ -76,7 +76,7 @@ class CRM_Contribute_BAO_ManagePremiums extends CRM_Contribute_DAO_Product { * @return Object DAO object on sucess, null otherwise * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { if (!$is_active) { $dao = new CRM_Contribute_DAO_PremiumsProduct(); $dao->product_id = $id; @@ -96,7 +96,7 @@ class CRM_Contribute_BAO_ManagePremiums extends CRM_Contribute_DAO_Product { * * @return object */ - static function add(&$params, &$ids) { + public static function add(&$params, &$ids) { // CRM-14283 - strip protocol and domain from image URLs $image_type = array('image', 'thumbnail'); foreach ($image_type as $key) { @@ -133,7 +133,7 @@ class CRM_Contribute_BAO_ManagePremiums extends CRM_Contribute_DAO_Product { * @static */ - static function del($productID) { + public static function del($productID) { //check dependencies $premiumsProduct = new CRM_Contribute_DAO_PremiumsProduct(); $premiumsProduct->product_id = $productID; diff --git a/CRM/Contribute/BAO/Premium.php b/CRM/Contribute/BAO/Premium.php index 3cff9d7f2d..5dcc72bb98 100644 --- a/CRM/Contribute/BAO/Premium.php +++ b/CRM/Contribute/BAO/Premium.php @@ -44,7 +44,7 @@ class CRM_Contribute_BAO_Premium extends CRM_Contribute_DAO_Premium { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -58,7 +58,7 @@ class CRM_Contribute_BAO_Premium extends CRM_Contribute_DAO_Premium { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $premium = new CRM_Contribute_DAO_Product(); $premium->copyValues($params); if ($premium->find(TRUE)) { @@ -77,7 +77,7 @@ class CRM_Contribute_BAO_Premium extends CRM_Contribute_DAO_Premium { * @return Object DAO object on sucess, null otherwise * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Contribute_DAO_Premium', $id, 'premiums_active ', $is_active); } @@ -88,7 +88,7 @@ class CRM_Contribute_BAO_Premium extends CRM_Contribute_DAO_Premium { * * @static */ - static function del($premiumID) { + public static function del($premiumID) { //check dependencies //delete from financial Type table @@ -108,7 +108,7 @@ class CRM_Contribute_BAO_Premium extends CRM_Contribute_DAO_Premium { * * @static */ - static function buildPremiumBlock(&$form, $pageID, $formItems = FALSE, $selectedProductID = NULL, $selectedOption = NULL) { + public static function buildPremiumBlock(&$form, $pageID, $formItems = FALSE, $selectedProductID = NULL, $selectedOption = NULL) { $form->add('hidden', "selectProduct", $selectedProductID, array('id' => 'selectProduct')); $dao = new CRM_Contribute_DAO_Premium(); @@ -175,7 +175,7 @@ class CRM_Contribute_BAO_Premium extends CRM_Contribute_DAO_Premium { * * @static */ - function buildPremiumPreviewBlock($form, $productID, $premiumProductID = NULL) { + public function buildPremiumPreviewBlock($form, $productID, $premiumProductID = NULL) { if ($premiumProductID) { $dao = new CRM_Contribute_DAO_PremiumsProduct(); $dao->id = $premiumProductID; @@ -214,7 +214,7 @@ class CRM_Contribute_BAO_Premium extends CRM_Contribute_DAO_Premium { * * @static */ - static function deletePremium($contributionPageID) { + public static function deletePremium($contributionPageID) { if (!$contributionPageID) { return; } @@ -248,7 +248,7 @@ class CRM_Contribute_BAO_Premium extends CRM_Contribute_DAO_Premium { * @static * @access public */ - static function getPremiumProductInfo() { + public static function getPremiumProductInfo() { if (!self::$productInfo) { $products = $options = array(); diff --git a/CRM/Contribute/BAO/Query.php b/CRM/Contribute/BAO/Query.php index 86021ce1dc..39a217392d 100644 --- a/CRM/Contribute/BAO/Query.php +++ b/CRM/Contribute/BAO/Query.php @@ -50,7 +50,7 @@ class CRM_Contribute_BAO_Query { * @return array self::$_contributionFields associative array of contribution fields * @static */ - static function &getFields() { + public static function &getFields() { if (!self::$_contributionFields) { self::$_contributionFields = array(); @@ -71,7 +71,7 @@ class CRM_Contribute_BAO_Query { * @return void * @access public */ - static function select(&$query) { + public static function select(&$query) { // if contribute mode add contribution id if ($query->_mode & CRM_Contact_BAO_Query::MODE_CONTRIBUTE) { $query->_select['contribution_id'] = "civicrm_contribution.id as contribution_id"; @@ -207,7 +207,7 @@ class CRM_Contribute_BAO_Query { /** * @param $query */ - static function where(&$query) { + public static function where(&$query) { $grouping = NULL; self::initializeAnySoftCreditClause($query); @@ -242,7 +242,7 @@ class CRM_Contribute_BAO_Query { * @param $values * @param $query */ - static function whereClauseSingle(&$values, &$query) { + public static function whereClauseSingle(&$values, &$query) { list($name, $op, $value, $grouping, $wildcard) = $values; $quoteValue = NULL; @@ -690,7 +690,7 @@ class CRM_Contribute_BAO_Query { * * @return null|string */ - static function from($name, $mode, $side) { + public static function from($name, $mode, $side) { $from = NULL; switch ($name) { case 'civicrm_contribution': @@ -824,7 +824,7 @@ class CRM_Contribute_BAO_Query { /** * @param $query */ - static function initializeAnySoftCreditClause(&$query) { + public static function initializeAnySoftCreditClause(&$query) { if (self::isSoftCreditOptionEnabled($query->_params)) { if ($query->_mode & CRM_Contact_BAO_Query::MODE_CONTRIBUTE) { unset($query->_distinctComponentClause); @@ -839,7 +839,7 @@ class CRM_Contribute_BAO_Query { * * @return bool */ - static function isSoftCreditOptionEnabled($queryParams = array()) { + public static function isSoftCreditOptionEnabled($queryParams = array()) { static $tempTableFilled = FALSE; if (!empty($queryParams)) { foreach (array_keys($queryParams) as $id) { @@ -878,7 +878,7 @@ class CRM_Contribute_BAO_Query { * * @return array */ - static function softCreditReturnProperties($isExportMode = False) { + public static function softCreditReturnProperties($isExportMode = False) { $properties = array( 'contribution_soft_credit_name' => 1, 'contribution_soft_credit_amount' => 1, @@ -896,7 +896,7 @@ class CRM_Contribute_BAO_Query { * * @return array|null */ - static function defaultReturnProperties($mode, $includeCustomFields = TRUE) { + public static function defaultReturnProperties($mode, $includeCustomFields = TRUE) { $properties = NULL; if ($mode & CRM_Contact_BAO_Query::MODE_CONTRIBUTE) { $properties = array( @@ -963,7 +963,7 @@ class CRM_Contribute_BAO_Query { * @return void * @static */ - static function buildSearchForm(&$form) { + public static function buildSearchForm(&$form) { // Added contribution source $form->addElement('text', 'contribution_source', ts('Contribution Source'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Contribution', 'source')); @@ -1111,13 +1111,13 @@ class CRM_Contribute_BAO_Query { * @param $row * @param int $id */ - static function searchAction(&$row, $id) { + public static function searchAction(&$row, $id) { } /** * @param $tables */ - static function tableNames(&$tables) { + public static function tableNames(&$tables) { // Add contribution table if (!empty($tables['civicrm_product'])) { $tables = array_merge(array('civicrm_contribution' => 1), $tables); @@ -1139,7 +1139,7 @@ class CRM_Contribute_BAO_Query { * * @return bool */ - static function buildDateWhere(&$values, $query, $name, $field, $title) { + public static function buildDateWhere(&$values, $query, $name, $field, $title) { $fieldPart = strpos($name, $field); if($fieldPart === FALSE) { return; @@ -1156,7 +1156,7 @@ class CRM_Contribute_BAO_Query { /** * @return array */ - static function getRecurringFields() { + public static function getRecurringFields() { return array( 'contribution_recur_start_date' => ts('Recurring Contribution Start Date'), 'contribution_recur_next_sched_contribution_date' => ts('Next Scheduled Recurring Contribution'), diff --git a/CRM/Contribute/Controller/Contribution.php b/CRM/Contribute/Controller/Contribution.php index a7de1ade19..ac024a7b46 100644 --- a/CRM/Contribute/Controller/Contribution.php +++ b/CRM/Contribute/Controller/Contribution.php @@ -49,7 +49,7 @@ class CRM_Contribute_Controller_Contribution extends CRM_Core_Controller { /** * Class constructor */ - function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { + public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { parent::__construct($title, $modal); $this->_stateMachine = new CRM_Contribute_StateMachine_Contribution($this, $action); @@ -68,7 +68,7 @@ class CRM_Contribute_Controller_Contribution extends CRM_Core_Controller { } } - function invalidKey() { + public function invalidKey() { $this->invalidKeyRedirect(); } diff --git a/CRM/Contribute/Controller/ContributionPage.php b/CRM/Contribute/Controller/ContributionPage.php index 1d45d48306..ede46cf31e 100644 --- a/CRM/Contribute/Controller/ContributionPage.php +++ b/CRM/Contribute/Controller/ContributionPage.php @@ -49,7 +49,7 @@ class CRM_Contribute_Controller_ContributionPage extends CRM_Core_Controller { /** * Class constructor */ - function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { + public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { parent::__construct($title, $modal); diff --git a/CRM/Contribute/Controller/Search.php b/CRM/Contribute/Controller/Search.php index f000afb531..d4affc1499 100644 --- a/CRM/Contribute/Controller/Search.php +++ b/CRM/Contribute/Controller/Search.php @@ -49,7 +49,7 @@ class CRM_Contribute_Controller_Search extends CRM_Core_Controller { /** * Class constructor */ - function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { + public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { parent::__construct($title, $modal); diff --git a/CRM/Contribute/Form.php b/CRM/Contribute/Form.php index 9231d39c13..6113cdafd2 100644 --- a/CRM/Contribute/Form.php +++ b/CRM/Contribute/Form.php @@ -47,7 +47,7 @@ class CRM_Contribute_Form extends CRM_Admin_Form { * * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); if (isset($this->_id)) { diff --git a/CRM/Contribute/Form/AdditionalInfo.php b/CRM/Contribute/Form/AdditionalInfo.php index c1d7189908..5d700cbb04 100644 --- a/CRM/Contribute/Form/AdditionalInfo.php +++ b/CRM/Contribute/Form/AdditionalInfo.php @@ -43,7 +43,7 @@ class CRM_Contribute_Form_AdditionalInfo { * * @return void */ - static function buildPremium(&$form) { + public static function buildPremium(&$form) { //premium section $form->add('hidden', 'hidden_Premium', 1); $sel1 = $sel2 = array(); @@ -94,7 +94,7 @@ class CRM_Contribute_Form_AdditionalInfo { * * @return void */ - static function buildAdditionalDetail(&$form) { + public static function buildAdditionalDetail(&$form) { //Additional information section $form->add('hidden', 'hidden_AdditionalDetail', 1); @@ -182,7 +182,7 @@ class CRM_Contribute_Form_AdditionalInfo { * * @return void */ - static function buildPaymentReminders(&$form) { + public static function buildPaymentReminders(&$form) { //PaymentReminders section $form->add('hidden', 'hidden_PaymentReminders', 1); $form->add('text', 'initial_reminder_day', ts('Send Initial Reminder'), array('size' => 3)); @@ -204,7 +204,7 @@ class CRM_Contribute_Form_AdditionalInfo { * @param null $options * @return void */ - static function processPremium(&$params, $contributionID, $premiumID = NULL, &$options = NULL) { + public static function processPremium(&$params, $contributionID, $premiumID = NULL, &$options = NULL) { $dao = new CRM_Contribute_DAO_ContributionProduct(); $dao->contribution_id = $contributionID; $dao->product_id = $params['product_name'][0]; @@ -265,7 +265,7 @@ class CRM_Contribute_Form_AdditionalInfo { * * @return void */ - static function processNote(&$params, $contactID, $contributionID, $contributionNoteID = NULL) { + public static function processNote(&$params, $contactID, $contributionID, $contributionNoteID = NULL) { //process note $noteParams = array( 'entity_table' => 'civicrm_contribution', @@ -291,7 +291,7 @@ class CRM_Contribute_Form_AdditionalInfo { * @param CRM_Core_Form $form * @return void */ - static function postProcessCommon(&$params, &$formatted, &$form) { + public static function postProcessCommon(&$params, &$formatted, &$form) { $fields = array( 'non_deductible_amount', 'total_amount', @@ -346,7 +346,7 @@ class CRM_Contribute_Form_AdditionalInfo { * * @return array */ - static function emailReceipt(&$form, &$params, $ccContribution = FALSE) { + public static function emailReceipt(&$form, &$params, $ccContribution = FALSE) { $form->assign('receiptType', 'contribution'); // Retrieve Financial Type Name from financial_type_id $params['contributionType_name'] = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialType', diff --git a/CRM/Contribute/Form/AdditionalPayment.php b/CRM/Contribute/Form/AdditionalPayment.php index 28ce8985bb..013950ffd5 100644 --- a/CRM/Contribute/Form/AdditionalPayment.php +++ b/CRM/Contribute/Form/AdditionalPayment.php @@ -351,7 +351,7 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract * * @return array */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); if ($self->_paymentType == 'owed' && $fields['total_amount'] > $self->_owed) { $errors['total_amount'] = ts('Payment amount cannot be greater than owed amount'); @@ -632,7 +632,7 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract * * @return mixed */ - function emailReceipt(&$params) { + public function emailReceipt(&$params) { // email receipt sending // send message template if ($this->_component == 'event') { diff --git a/CRM/Contribute/Form/CancelSubscription.php b/CRM/Contribute/Form/CancelSubscription.php index d49a387166..84c9dbecca 100644 --- a/CRM/Contribute/Form/CancelSubscription.php +++ b/CRM/Contribute/Form/CancelSubscription.php @@ -193,7 +193,7 @@ class CRM_Contribute_Form_CancelSubscription extends CRM_Core_Form { * @return array array of default values * @access public */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array('is_notify' => 1); return $defaults; } diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index 560dc7594d..b7ba391e64 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -343,7 +343,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP } } - function setDefaultValues() { + public function setDefaultValues() { if ($this->_cdType) { return CRM_Custom_Form_CustomData::setDefaultValues($this); } @@ -949,7 +949,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP * @access public * @static */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); //check for Credit Card Contribution. diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index 2dc3242bef..fb947496e5 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -640,7 +640,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr * @return int * @access public */ - function getAction() { + public function getAction() { if ($this->_action & CRM_Core_Action::PREVIEW) { return CRM_Core_Action::VIEW | CRM_Core_Action::PREVIEW; } @@ -657,7 +657,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr * * @return void */ - function setDefaultValues() {} + public function setDefaultValues() {} /** * Process the form @@ -1048,7 +1048,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr * * @return null|string */ - function wrangleFinancialTypeID($contributionTypeId) { + public function wrangleFinancialTypeID($contributionTypeId) { if (isset($paymentParams['financial_type'])) { $contributionTypeId = $paymentParams['financial_type']; } @@ -1522,7 +1522,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr * * @return mixed */ - static function processRecurringContribution(&$form, &$params, $contactID, $contributionType, $online = TRUE) { + public static function processRecurringContribution(&$form, &$params, $contactID, $contributionType, $online = TRUE) { // return if this page is not set for recurring // or the user has not chosen the recurring option @@ -1613,7 +1613,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr * @return void * @access public */ - static function processOnBehalfOrganization(&$behalfOrganization, &$contactID, &$values, &$params, $fields = NULL) { + public static function processOnBehalfOrganization(&$behalfOrganization, &$contactID, &$values, &$params, $fields = NULL) { $isCurrentEmployer = FALSE; $dupeIDs = array(); $orgID = NULL; @@ -1719,7 +1719,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr * @static * @access public */ - static function processPcpSoft(&$params, &$contribution) { + public static function processPcpSoft(&$params, &$contribution) { //add soft contribution due to pcp or Submit Credit / Debit Card Contribution by admin. if (!empty($params['soft_credit_to'])) { $contributionSoftParams = array(); @@ -1753,7 +1753,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr * @static * @access public */ - static function processPcp(&$page, $params) { + public static function processPcp(&$page, $params) { $params['pcp_made_through_id'] = $page->_pcpId; $page->assign('pcpBlock', TRUE); if (!empty($params['pcp_display_in_roll']) && empty($params['pcp_roll_nickname'])) { @@ -1909,7 +1909,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr * * @throws CiviCRM_API3_Exception */ - static function submit($params) { + public static function submit($params) { $form = new CRM_Contribute_Form_Contribution_Confirm(); $form->_id = $params['id']; if (!empty($params['contact_id'])) { @@ -1955,7 +1955,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr * @return array * @throws CiviCRM_API3_Exception */ - static function getFormParams($id, array $params) { + public static function getFormParams($id, array $params) { if(!isset($params['is_pay_later'])) { if (!empty($params['payment_processor'])) { $params['is_pay_later'] = 0; diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index c29d6c0337..57c13d4db1 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -193,7 +193,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu /** * */ - function setDefaultValues() { + public function setDefaultValues() { // check if the user is registered and we have a contact ID $contactID = $this->getContactID(); @@ -632,7 +632,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu * * @access public */ - function buildOnBehalfOrganization() { + public function buildOnBehalfOrganization() { if ($this->_membershipContactID) { $entityBlock = array('contact_id' => $this->_membershipContactID); CRM_Core_BAO_Location::getValues($entityBlock, $this->_defaults); @@ -734,7 +734,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu * @access public * @static */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); $amount = self::computeAmount($fields, $self); @@ -1392,7 +1392,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu * @param CRM_Contribute_Form_Contribution_Main|CRM_Event_Form_Registration_Register $form * @param bool $noFees */ - static function preProcessPaymentOptions(&$form, $noFees = FALSE) { + public static function preProcessPaymentOptions(&$form, $noFees = FALSE) { $form->_snippet = CRM_Utils_Array::value('snippet', $_GET); $form->_paymentProcessors = $noFees ? array() : $form->get('paymentProcessors'); diff --git a/CRM/Contribute/Form/Contribution/OnBehalfOf.php b/CRM/Contribute/Form/Contribution/OnBehalfOf.php index e53c85fadf..7c8c3c58e1 100644 --- a/CRM/Contribute/Form/Contribution/OnBehalfOf.php +++ b/CRM/Contribute/Form/Contribution/OnBehalfOf.php @@ -42,7 +42,7 @@ class CRM_Contribute_Form_Contribution_OnBehalfOf { * @return void * @access public */ - static function preProcess(&$form) { + public static function preProcess(&$form) { $session = CRM_Core_Session::singleton(); $contactID = $form->_contactID; @@ -129,7 +129,7 @@ class CRM_Contribute_Form_Contribution_OnBehalfOf { * * @static */ - static function buildQuickForm(&$form) { + public static function buildQuickForm(&$form) { $form->assign('fieldSetTitle', ts('Organization Details')); $form->assign('buildOnBehalfForm', TRUE); diff --git a/CRM/Contribute/Form/Contribution/ThankYou.php b/CRM/Contribute/Form/Contribution/ThankYou.php index a59dc4e8f2..134bfd381a 100644 --- a/CRM/Contribute/Form/Contribution/ThankYou.php +++ b/CRM/Contribute/Form/Contribution/ThankYou.php @@ -81,7 +81,7 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont * @return int * @access public */ - function getAction() { + public function getAction() { if ($this->_action & CRM_Core_Action::PREVIEW) { return CRM_Core_Action::VIEW | CRM_Core_Action::PREVIEW; } diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index 2b1f7f1f8b..336d97d7ce 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -542,7 +542,7 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { * @return void * @access public */ - function setDefaultValues() { + public function setDefaultValues() { return $this->_defaults; } @@ -552,7 +552,7 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { * @return void * @access public */ - function assignToTemplate() { + public function assignToTemplate() { $name = CRM_Utils_Array::value('billing_first_name', $this->_params); if (!empty($this->_params['billing_middle_name'])) { $name .= " {$this->_params['billing_middle_name']}"; @@ -685,7 +685,7 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { * @return void * @access public */ - function buildCustom($id, $name, $viewOnly = FALSE, $profileContactType = NULL, $fieldTypes = NULL) { + public function buildCustom($id, $name, $viewOnly = FALSE, $profileContactType = NULL, $fieldTypes = NULL) { if ($id) { $contactID = $this->getContactID(); @@ -799,7 +799,7 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { * * @return null|string */ - function checkTemplateFileExists($suffix = NULL) { + public function checkTemplateFileExists($suffix = NULL) { if ($this->_id) { $templateFile = "CRM/Contribute/Form/Contribution/{$this->_id}/{$this->_name}.{$suffix}tpl"; $template = CRM_Core_Form::getTemplate(); @@ -819,7 +819,7 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { /** * @return string */ - function getTemplateFileName() { + public function getTemplateFileName() { $fileName = $this->checkTemplateFileExists(); return $fileName ? $fileName : parent::getTemplateFileName(); } @@ -834,7 +834,7 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { /** * @return string */ - function overrideExtraTemplateFileName() { + public function overrideExtraTemplateFileName() { $fileName = $this->checkTemplateFileExists('extra.'); return $fileName ? $fileName : parent::overrideExtraTemplateFileName(); } diff --git a/CRM/Contribute/Form/ContributionCharts.php b/CRM/Contribute/Form/ContributionCharts.php index 5de33bf21e..ccd6b2605a 100644 --- a/CRM/Contribute/Form/ContributionCharts.php +++ b/CRM/Contribute/Form/ContributionCharts.php @@ -48,7 +48,7 @@ class CRM_Contribute_Form_ContributionCharts extends CRM_Core_Form { */ protected $_chartType = NULL; - function preProcess() { + public function preProcess() { $this->_year = CRM_Utils_Request::retrieve('year', 'Int', $this); $this->_chartType = CRM_Utils_Request::retrieve('type', 'String', $this); diff --git a/CRM/Contribute/Form/ContributionPage.php b/CRM/Contribute/Form/ContributionPage.php index cd045feeee..e5cc56fc8c 100644 --- a/CRM/Contribute/Form/ContributionPage.php +++ b/CRM/Contribute/Form/ContributionPage.php @@ -247,7 +247,7 @@ class CRM_Contribute_Form_ContributionPage extends CRM_Core_Form { * * @return array defaults */ - function setDefaultValues() { + public function setDefaultValues() { //some child classes calling setdefaults directly w/o preprocess. $this->_values = $this->get('values'); if (!is_array($this->_values)) { @@ -357,7 +357,7 @@ class CRM_Contribute_Form_ContributionPage extends CRM_Core_Form { } } - function endPostProcess() { + public function endPostProcess() { // make submit buttons keep the current working tab opened, or save and next tab if ($this->_action & CRM_Core_Action::UPDATE) { $className = CRM_Utils_String::getClassName($this->_name); @@ -444,7 +444,7 @@ class CRM_Contribute_Form_ContributionPage extends CRM_Core_Form { /** * @return string */ - function getTemplateFileName() { + public function getTemplateFileName() { if ($this->controller->getPrint() || $this->getVar('_id') <= 0 || ($this->_action & CRM_Core_Action::DELETE) || (CRM_Utils_String::getClassName($this->_name) == 'AddProduct') diff --git a/CRM/Contribute/Form/ContributionPage/AddProduct.php b/CRM/Contribute/Form/ContributionPage/AddProduct.php index 86cf9ca75b..6bd3f45f10 100644 --- a/CRM/Contribute/Form/ContributionPage/AddProduct.php +++ b/CRM/Contribute/Form/ContributionPage/AddProduct.php @@ -76,7 +76,7 @@ class CRM_Contribute_Form_ContributionPage_AddProduct extends CRM_Contribute_For * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); if ($this->_pid) { diff --git a/CRM/Contribute/Form/ContributionPage/Amount.php b/CRM/Contribute/Form/ContributionPage/Amount.php index c1d0130586..32ef5308c0 100644 --- a/CRM/Contribute/Form/ContributionPage/Amount.php +++ b/CRM/Contribute/Form/ContributionPage/Amount.php @@ -192,7 +192,7 @@ SELECT id * * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = parent::setDefaultValues(); $title = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $this->_id, 'title'); CRM_Utils_System::setTitle(ts('Contribution Amounts') . " ($title)"); @@ -283,7 +283,7 @@ SELECT id * @access public * @static */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); //as for separate membership payment we has to have //contribution amount section enabled, hence to disable it need to diff --git a/CRM/Contribute/Form/ContributionPage/Custom.php b/CRM/Contribute/Form/ContributionPage/Custom.php index 7e8dc1f195..ecec52598f 100644 --- a/CRM/Contribute/Form/ContributionPage/Custom.php +++ b/CRM/Contribute/Form/ContributionPage/Custom.php @@ -84,7 +84,7 @@ class CRM_Contribute_Form_ContributionPage_Custom extends CRM_Contribute_Form_Co * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = parent::setDefaultValues(); if ($this->_id) { @@ -173,7 +173,7 @@ class CRM_Contribute_Form_ContributionPage_Custom extends CRM_Contribute_Form_Co * @access public * @static */ - static function formRule($fields, $files, $contributionPageId) { + public static function formRule($fields, $files, $contributionPageId) { $errors = array(); $preProfileType = $postProfileType = NULL; // for membership profile make sure Membership section is enabled diff --git a/CRM/Contribute/Form/ContributionPage/Premium.php b/CRM/Contribute/Form/ContributionPage/Premium.php index 8278f1ef1a..03a5822800 100644 --- a/CRM/Contribute/Form/ContributionPage/Premium.php +++ b/CRM/Contribute/Form/ContributionPage/Premium.php @@ -46,7 +46,7 @@ class CRM_Contribute_Form_ContributionPage_Premium extends CRM_Contribute_Form_C * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); if (isset($this->_id)) { $title = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $this->_id, 'title'); diff --git a/CRM/Contribute/Form/ContributionPage/Settings.php b/CRM/Contribute/Form/ContributionPage/Settings.php index 656c89218f..2c51366a2a 100644 --- a/CRM/Contribute/Form/ContributionPage/Settings.php +++ b/CRM/Contribute/Form/ContributionPage/Settings.php @@ -52,7 +52,7 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_ * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = parent::setDefaultValues(); $soft_credit_types = CRM_Core_OptionGroup::values('soft_credit_type', TRUE, FALSE, FALSE, NULL, 'name'); @@ -225,7 +225,7 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_ * @static * @access public */ - static function formRule($values, $files, $self) { + public static function formRule($values, $files, $self) { $errors = array(); $contributionPageId = $self->_id; //CRM-4286 diff --git a/CRM/Contribute/Form/ContributionPage/TabHeader.php b/CRM/Contribute/Form/ContributionPage/TabHeader.php index 8b9f13a7c1..a6368430c8 100644 --- a/CRM/Contribute/Form/ContributionPage/TabHeader.php +++ b/CRM/Contribute/Form/ContributionPage/TabHeader.php @@ -42,7 +42,7 @@ class CRM_Contribute_Form_ContributionPage_TabHeader { * * @return array */ - static function build(&$form) { + public static function build(&$form) { $tabs = $form->get('tabHeader'); if (!$tabs || empty($_GET['reset'])) { $tabs = self::process($form); @@ -62,7 +62,7 @@ class CRM_Contribute_Form_ContributionPage_TabHeader { * * @return array */ - static function process(&$form) { + public static function process(&$form) { if ($form->getVar('_id') <= 0) { return NULL; } @@ -182,7 +182,7 @@ class CRM_Contribute_Form_ContributionPage_TabHeader { /** * @param $form */ - static function reset(&$form) { + public static function reset(&$form) { $tabs = self::process($form); $form->set('tabHeader', $tabs); } @@ -192,7 +192,7 @@ class CRM_Contribute_Form_ContributionPage_TabHeader { * * @return int|string */ - static function getCurrentTab($tabs) { + public static function getCurrentTab($tabs) { static $current = FALSE; if ($current) { diff --git a/CRM/Contribute/Form/ContributionPage/ThankYou.php b/CRM/Contribute/Form/ContributionPage/ThankYou.php index 1e11f35607..88354cf14d 100644 --- a/CRM/Contribute/Form/ContributionPage/ThankYou.php +++ b/CRM/Contribute/Form/ContributionPage/ThankYou.php @@ -46,7 +46,7 @@ class CRM_Contribute_Form_ContributionPage_ThankYou extends CRM_Contribute_Form_ * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $title = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $this->_id, 'title'); CRM_Utils_System::setTitle(ts('Thank-you and Receipting') . " ($title)"); return parent::setDefaultValues(); @@ -102,7 +102,7 @@ class CRM_Contribute_Form_ContributionPage_ThankYou extends CRM_Contribute_Form_ * @access public * @static */ - static function formRule($fields, $files, $options) { + public static function formRule($fields, $files, $options) { $errors = array(); // if is_email_receipt is set, the receipt message must be non-empty diff --git a/CRM/Contribute/Form/ContributionPage/Widget.php b/CRM/Contribute/Form/ContributionPage/Widget.php index adf5496e73..f85e3785ab 100644 --- a/CRM/Contribute/Form/ContributionPage/Widget.php +++ b/CRM/Contribute/Form/ContributionPage/Widget.php @@ -37,7 +37,7 @@ class CRM_Contribute_Form_ContributionPage_Widget extends CRM_Contribute_Form_Co protected $_widget; - function preProcess() { + public function preProcess() { parent::preProcess(); $this->_widget = new CRM_Contribute_DAO_Widget(); @@ -139,7 +139,7 @@ class CRM_Contribute_Form_ContributionPage_Widget extends CRM_Contribute_Form_Co /** * */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); // check if there is a widget already created if ($this->_widget) { @@ -164,7 +164,7 @@ class CRM_Contribute_Form_ContributionPage_Widget extends CRM_Contribute_Form_Co return $defaults; } - function buildQuickForm() { + public function buildQuickForm() { $attributes = CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Widget'); $this->addElement('checkbox', @@ -236,7 +236,7 @@ class CRM_Contribute_Form_ContributionPage_Widget extends CRM_Contribute_Form_Co return empty($errors) ? TRUE : $errors; } - function postProcess() { + public function postProcess() { //to reset quickform elements of next (pcp) page. if ($this->controller->getNextName('Widget') == 'PCP') { $this->controller->resetPage('PCP'); diff --git a/CRM/Contribute/Form/ManagePremiums.php b/CRM/Contribute/Form/ManagePremiums.php index c58dc7994b..50b9246b51 100644 --- a/CRM/Contribute/Form/ManagePremiums.php +++ b/CRM/Contribute/Form/ManagePremiums.php @@ -58,7 +58,7 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = parent::setDefaultValues(); if ($this->_id) { $params = array('id' => $this->_id); diff --git a/CRM/Contribute/Form/Search.php b/CRM/Contribute/Form/Search.php index 491228fe34..e088322b4b 100644 --- a/CRM/Contribute/Form/Search.php +++ b/CRM/Contribute/Form/Search.php @@ -165,7 +165,7 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search { $this->assign('contributionSummary', $this->get('summary')); } - function setDefaultValues() { + public function setDefaultValues() { if (empty($this->_defaults ['contribution_status'])) { $this->_defaults['contribution_status'][1] = 1; @@ -180,7 +180,7 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { parent::buildQuickForm(); // text for sort_name $this->addElement('text', @@ -247,7 +247,7 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search { * @return void * @access public */ - function postProcess() { + public function postProcess() { if ($this->_done) { return; } @@ -374,7 +374,7 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search { $controller->run(); } - function fixFormValues() { + public function fixFormValues() { // if this search has been forced // then see if there are any get values, and if so over-ride the post values // note that this means that GET over-rides POST :) diff --git a/CRM/Contribute/Form/SearchContribution.php b/CRM/Contribute/Form/SearchContribution.php index 9e835bbfdd..686ce762a8 100644 --- a/CRM/Contribute/Form/SearchContribution.php +++ b/CRM/Contribute/Form/SearchContribution.php @@ -63,7 +63,7 @@ class CRM_Contribute_Form_SearchContribution extends CRM_Core_Form { )); } - function postProcess() { + public function postProcess() { $params = $this->controller->exportValues($this->_name); $parent = $this->controller->getParent(); $parent->set('searchResult', 1); diff --git a/CRM/Contribute/Form/SoftCredit.php b/CRM/Contribute/Form/SoftCredit.php index f8a89f8776..6757b5d328 100644 --- a/CRM/Contribute/Form/SoftCredit.php +++ b/CRM/Contribute/Form/SoftCredit.php @@ -46,7 +46,7 @@ class CRM_Contribute_Form_SoftCredit { * @return void * @access static */ - static function preProcess(&$form) { + public static function preProcess(&$form) { $contriDAO = new CRM_Contribute_DAO_Contribution(); $contriDAO->id = $form->_id; $contriDAO->find(TRUE); @@ -75,7 +75,7 @@ class CRM_Contribute_Form_SoftCredit { * * @return void */ - static function buildQuickForm(&$form) { + public static function buildQuickForm(&$form) { if ($form->_mode == 'live' && !empty($form->_honor_block_is_active)) { $ufJoinDAO = new CRM_Core_DAO_UFJoin(); $ufJoinDAO->module = 'soft_credit'; @@ -163,7 +163,7 @@ class CRM_Contribute_Form_SoftCredit { * @param $defaults * @param $form */ - static function setDefaultValues(&$defaults, &$form) { + public static function setDefaultValues(&$defaults, &$form) { //Used to hide/unhide PCP and/or Soft-credit Panes $noPCP = $noSoftCredit = TRUE; if (!empty($form->_softCreditInfo['soft_credit'])) { @@ -203,7 +203,7 @@ class CRM_Contribute_Form_SoftCredit { * @access public * @static */ - static function formRule($fields, $errors, $self) { + public static function formRule($fields, $errors, $self) { $errors = array(); // if honor roll fields are populated but no PCP is selected diff --git a/CRM/Contribute/Form/Task.php b/CRM/Contribute/Form/Task.php index adc990e93f..1c5205e661 100644 --- a/CRM/Contribute/Form/Task.php +++ b/CRM/Contribute/Form/Task.php @@ -96,7 +96,7 @@ class CRM_Contribute_Form_Task extends CRM_Core_Form { * @return void * @access public */ - function preProcess() { + public function preProcess() { self::preProcessCommon($this); } @@ -104,7 +104,7 @@ class CRM_Contribute_Form_Task extends CRM_Core_Form { * @param CRM_Core_Form $form * @param bool $useTable */ - static function preProcessCommon(&$form, $useTable = FALSE) { + public static function preProcessCommon(&$form, $useTable = FALSE) { $form->_contributionIds = array(); $values = $form->controller->exportValues($form->get('searchFormName')); @@ -208,7 +208,7 @@ class CRM_Contribute_Form_Task extends CRM_Core_Form { * @return void * @access public */ - function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { + public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { $this->addButtons(array( array( 'type' => $nextType, diff --git a/CRM/Contribute/Form/Task/Batch.php b/CRM/Contribute/Form/Task/Batch.php index 034af699cb..42b96429ff 100644 --- a/CRM/Contribute/Form/Task/Batch.php +++ b/CRM/Contribute/Form/Task/Batch.php @@ -63,7 +63,7 @@ class CRM_Contribute_Form_Task_Batch extends CRM_Contribute_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { /* * initialize the task and row fields */ @@ -92,7 +92,7 @@ class CRM_Contribute_Form_Task_Batch extends CRM_Contribute_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $ufGroupId = $this->get('ufGroupId'); if (!$ufGroupId) { @@ -197,7 +197,7 @@ class CRM_Contribute_Form_Task_Batch extends CRM_Contribute_Form_Task { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { if (empty($this->_fields)) { return; } diff --git a/CRM/Contribute/Form/Task/Delete.php b/CRM/Contribute/Form/Task/Delete.php index 1607b0beaa..78a192511b 100644 --- a/CRM/Contribute/Form/Task/Delete.php +++ b/CRM/Contribute/Form/Task/Delete.php @@ -68,7 +68,7 @@ class CRM_Contribute_Form_Task_Delete extends CRM_Contribute_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $this->addDefaultButtons(ts('Delete Contributions'), 'done'); } diff --git a/CRM/Contribute/Form/Task/Invoice.php b/CRM/Contribute/Form/Task/Invoice.php index 349b226f1a..6d008888ba 100644 --- a/CRM/Contribute/Form/Task/Invoice.php +++ b/CRM/Contribute/Form/Task/Invoice.php @@ -77,7 +77,7 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { $id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE); if ($id) { $this->_contributionIds = array($id); @@ -235,7 +235,7 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task { * @static * @access public */ - static function formRule($values) { + public static function formRule($values) { $errors = array(); if ($values['output'] == 'email_invoice' && empty($values['from_email_address'])) { @@ -269,7 +269,7 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task { * @static * */ - static function printPDF($contribIDs, &$params, $contactIds, &$form) { + public static function printPDF($contribIDs, &$params, $contactIds, &$form) { // get all the details needed to generate a invoice $messageInvoice = array(); $invoiceTemplate = CRM_Core_Smarty::singleton(); @@ -671,7 +671,7 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task { /** * Callback to perform action on Print Invoice button. */ - static function getPrintPDF() { + public static function getPrintPDF() { $contributionId = CRM_Utils_Request::retrieve('id', 'Positive', CRM_Core_DAO::$_nullObject, FALSE); $contributionIDs = array($contributionId); $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, FALSE); diff --git a/CRM/Contribute/Form/Task/PDF.php b/CRM/Contribute/Form/Task/PDF.php index 0437198f21..f48ed71234 100644 --- a/CRM/Contribute/Form/Task/PDF.php +++ b/CRM/Contribute/Form/Task/PDF.php @@ -139,7 +139,7 @@ AND {$this->_componentClause}"; /** * Set default values */ - function setDefaultValues() { + public function setDefaultValues() { $defaultFormat = CRM_Core_BAO_PdfFormat::getDefaultValues(); return array('pdf_format_id' => $defaultFormat['id'], 'receipt_update' => 1, 'override_privacy' => 0); } diff --git a/CRM/Contribute/Form/Task/PDFLetter.php b/CRM/Contribute/Form/Task/PDFLetter.php index a1c28139a2..7dde505bd3 100644 --- a/CRM/Contribute/Form/Task/PDFLetter.php +++ b/CRM/Contribute/Form/Task/PDFLetter.php @@ -56,7 +56,7 @@ class CRM_Contribute_Form_Task_PDFLetter extends CRM_Contribute_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { $this->skipOnHold = $this->skipDeceased = FALSE; CRM_Contact_Form_Task_PDFLetterCommon::preProcess($this); // store case id if present @@ -90,7 +90,7 @@ class CRM_Contribute_Form_Task_PDFLetter extends CRM_Contribute_Form_Task { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); if (isset($this->_activityId)) { $params = array('id' => $this->_activityId); diff --git a/CRM/Contribute/Form/Task/PDFLetterCommon.php b/CRM/Contribute/Form/Task/PDFLetterCommon.php index 32f3894733..16c130e8b9 100644 --- a/CRM/Contribute/Form/Task/PDFLetterCommon.php +++ b/CRM/Contribute/Form/Task/PDFLetterCommon.php @@ -15,7 +15,7 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF * * @return void */ - static function postProcess(&$form) { + public static function postProcess(&$form) { list($formValues, $categories, $html_message, $messageToken, $returnProperties) = self::processMessageTemplate($form); $isPDF = FALSE; $emailParams = array(); @@ -139,7 +139,7 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF * * @return bool */ - static function isValidHTMLWithTableSeparator($tokens, $html) { + public static function isValidHTMLWithTableSeparator($tokens, $html) { $relevantEntities = array('contribution'); foreach ($relevantEntities as $entity) { if (isset($tokens[$entity]) && is_array($tokens[$entity])) { @@ -163,7 +163,7 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF * * @return bool */ - static function isHtmlTokenInTableCell($token, $entity, $textToSearch) { + public static function isHtmlTokenInTableCell($token, $entity, $textToSearch) { $tokenToMatch = $entity . '.' . $token; $dontCare = array(); $within = preg_match_all("|getVar('_contributionIds'); if ($form->_includesSoftCredits) { @@ -281,7 +281,7 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF * * @return array */ - static function combineContributions($existing, $contribution, $separator) { + public static function combineContributions($existing, $contribution, $separator) { foreach ($contribution as $field => $value) { $existing[$field] = isset($existing[$field]) ? $existing[$field] . $separator : ''; $existing[$field] .= $value; @@ -298,7 +298,7 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF * @param $groupBy * @param int $groupByID */ - static function assignCombinedContributionValues($contact, $contributions, $groupBy, $groupByID) { + public static function assignCombinedContributionValues($contact, $contributions, $groupBy, $groupByID) { if (!defined('CIVICRM_MAIL_SMARTY') || !CIVICRM_MAIL_SMARTY) { return; } @@ -320,7 +320,7 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF * * @return bool */ - static function emailLetter($contact, $html, $is_pdf, $format = array(), $params = array()) { + public static function emailLetter($contact, $html, $is_pdf, $format = array(), $params = array()) { try { if(empty($contact['email'])) { return FALSE; diff --git a/CRM/Contribute/Form/Task/PickProfile.php b/CRM/Contribute/Form/Task/PickProfile.php index a390b18f05..e6e7d6ff7f 100644 --- a/CRM/Contribute/Form/Task/PickProfile.php +++ b/CRM/Contribute/Form/Task/PickProfile.php @@ -63,7 +63,7 @@ class CRM_Contribute_Form_Task_PickProfile extends CRM_Contribute_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { /* * initialize the task and row fields */ @@ -93,7 +93,7 @@ class CRM_Contribute_Form_Task_PickProfile extends CRM_Contribute_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $types = array('Contribution'); $profiles = CRM_Core_BAO_UFGroup::getProfiles($types, TRUE); @@ -117,7 +117,7 @@ class CRM_Contribute_Form_Task_PickProfile extends CRM_Contribute_Form_Task { * * @return void */ - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Contribute_Form_Task_PickProfile', 'formRule')); } @@ -130,7 +130,7 @@ class CRM_Contribute_Form_Task_PickProfile extends CRM_Contribute_Form_Task { * @static * @access public */ - static function formRule($fields) { + public static function formRule($fields) { return TRUE; } diff --git a/CRM/Contribute/Form/Task/Print.php b/CRM/Contribute/Form/Task/Print.php index b5183921d2..4d8bd034bf 100644 --- a/CRM/Contribute/Form/Task/Print.php +++ b/CRM/Contribute/Form/Task/Print.php @@ -44,7 +44,7 @@ class CRM_Contribute_Form_Task_Print extends CRM_Contribute_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preprocess(); // set print view, so that print templates are called @@ -75,7 +75,7 @@ class CRM_Contribute_Form_Task_Print extends CRM_Contribute_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { // // just need to add a javacript to popup the window for printing // diff --git a/CRM/Contribute/Form/Task/Result.php b/CRM/Contribute/Form/Task/Result.php index 54b5241f38..525874044a 100644 --- a/CRM/Contribute/Form/Task/Result.php +++ b/CRM/Contribute/Form/Task/Result.php @@ -46,7 +46,7 @@ class CRM_Contribute_Form_Task_Result extends CRM_Contribute_Form_Task { * @return void * @access public */ - function preProcess() {} + public function preProcess() {} /** * Build the form object diff --git a/CRM/Contribute/Form/Task/SearchTaskHookSample.php b/CRM/Contribute/Form/Task/SearchTaskHookSample.php index d877264eae..970bfae81f 100644 --- a/CRM/Contribute/Form/Task/SearchTaskHookSample.php +++ b/CRM/Contribute/Form/Task/SearchTaskHookSample.php @@ -44,7 +44,7 @@ class CRM_Contribute_Form_Task_SearchTaskHookSample extends CRM_Contribute_Form_ * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); $rows = array(); // display name and contribution details of all selected contacts diff --git a/CRM/Contribute/Form/Task/Status.php b/CRM/Contribute/Form/Task/Status.php index 6233302f55..3e9be9c478 100644 --- a/CRM/Contribute/Form/Task/Status.php +++ b/CRM/Contribute/Form/Task/Status.php @@ -54,7 +54,7 @@ class CRM_Contribute_Form_Task_Status extends CRM_Contribute_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { $id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE ); @@ -191,7 +191,7 @@ AND co.id IN ( $contribIDs )"; * @static * @access public */ - static function formRule($fields) { + public static function formRule($fields) { $seen = $errors = array(); foreach ($fields as $name => $value) { if (strpos($name, 'trxn_id_') !== FALSE) { @@ -306,7 +306,7 @@ AND co.id IN ( $contribIDs )"; * * @return array */ - static function &getDetails($contributionIDs) { + public static function &getDetails($contributionIDs) { $query = " SELECT c.id as contribution_id, c.contact_id as contact_id , diff --git a/CRM/Contribute/Form/UpdateBilling.php b/CRM/Contribute/Form/UpdateBilling.php index 86e6b49596..eba70a1d78 100644 --- a/CRM/Contribute/Form/UpdateBilling.php +++ b/CRM/Contribute/Form/UpdateBilling.php @@ -142,7 +142,7 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $this->_defaults = array(); if ($this->_subscriptionDetails->contact_id) { @@ -225,7 +225,7 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form { * @access public * @static */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); CRM_Core_Form::validateMandatoryFields($self->_fields, $fields, $errors); diff --git a/CRM/Contribute/Form/UpdateSubscription.php b/CRM/Contribute/Form/UpdateSubscription.php index 29320bb2da..1a424c0ecb 100644 --- a/CRM/Contribute/Form/UpdateSubscription.php +++ b/CRM/Contribute/Form/UpdateSubscription.php @@ -68,7 +68,7 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Core_Form { */ public $_contactID; - function preProcess() { + public function preProcess() { $this->_crid = CRM_Utils_Request::retrieve('crid', 'Integer', $this, FALSE); if ($this->_crid) { @@ -132,7 +132,7 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $this->_defaults = array(); $this->_defaults['amount'] = $this->_subscriptionDetails->amount; diff --git a/CRM/Contribute/Import/Controller.php b/CRM/Contribute/Import/Controller.php index dcf9e84635..8f081593e1 100644 --- a/CRM/Contribute/Import/Controller.php +++ b/CRM/Contribute/Import/Controller.php @@ -37,7 +37,7 @@ class CRM_Contribute_Import_Controller extends CRM_Core_Controller { /** * Class constructor */ - function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { + public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { parent::__construct($title, $modal); // lets get around the time limit issue if possible, CRM-2113 diff --git a/CRM/Contribute/Import/Field.php b/CRM/Contribute/Import/Field.php index 057af30c81..9fcdddf847 100644 --- a/CRM/Contribute/Import/Field.php +++ b/CRM/Contribute/Import/Field.php @@ -99,7 +99,7 @@ class CRM_Contribute_Import_Field { * @param string $dataPattern * @param null $softCreditField */ - function __construct($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//', $softCreditField = NULL) { + public function __construct($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//', $softCreditField = NULL) { $this->_name = $name; $this->_title = $title; $this->_type = $type; @@ -109,7 +109,7 @@ class CRM_Contribute_Import_Field { $this->_value = NULL; } - function resetValue() { + public function resetValue() { $this->_value = NULL; } @@ -117,14 +117,14 @@ class CRM_Contribute_Import_Field { * The value is in string format. convert the value to the type of this field * and set the field value with the appropriate type */ - function setValue($value) { + public function setValue($value) { $this->_value = $value; } /** * @return bool */ - function validate() { + public function validate() { if (CRM_Utils_System::isNull($this->_value)) { return TRUE; diff --git a/CRM/Contribute/Import/Form/MapField.php b/CRM/Contribute/Import/Form/MapField.php index f75d01fa3c..01b4b2bc5b 100644 --- a/CRM/Contribute/Import/Form/MapField.php +++ b/CRM/Contribute/Import/Form/MapField.php @@ -348,7 +348,7 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Import_Form_MapField { * @static * @access public */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); $fieldMessage = NULL; $contactORContributionId = $self->_onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE ? 'contribution_id' : 'contribution_contact_id'; diff --git a/CRM/Contribute/Import/Parser.php b/CRM/Contribute/Import/Parser.php index 9f7750dd13..5acbce2592 100644 --- a/CRM/Contribute/Import/Parser.php +++ b/CRM/Contribute/Import/Parser.php @@ -407,7 +407,7 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser { * @return void * @access public */ - function setActiveFields($fieldKeys) { + public function setActiveFields($fieldKeys) { $this->_activeFieldCount = count($fieldKeys); foreach ($fieldKeys as $key) { if (empty($this->_fields[$key])) { @@ -422,7 +422,7 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser { /** * @param array $elements */ - function setActiveFieldSoftCredit($elements) { + public function setActiveFieldSoftCredit($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_softCreditField = $elements[$i]; } @@ -431,7 +431,7 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser { /** * @param array $elements */ - function setActiveFieldSoftCreditType($elements) { + public function setActiveFieldSoftCreditType($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_softCreditType = $elements[$i]; } @@ -443,7 +443,7 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser { * @return array (reference ) associative array of name/value pairs * @access public */ - function &getActiveFieldParams() { + public function &getActiveFieldParams() { $params = array(); for ($i = 0; $i < $this->_activeFieldCount; $i++) { if (isset($this->_activeFields[$i]->_value)) { @@ -474,7 +474,7 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser { * @param string $headerPattern * @param string $dataPattern */ - function addField($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') { + public function addField($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') { if (empty($name)) { $this->_fields['doNotImport'] = new CRM_Contribute_Import_Field($name, $title, $type, $headerPattern, $dataPattern); } @@ -501,7 +501,7 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser { * @return void * @access public */ - function set($store, $mode = self::MODE_SUMMARY) { + public function set($store, $mode = self::MODE_SUMMARY) { $store->set('fileSize', $this->_fileSize); $store->set('lineCount', $this->_lineCount); $store->set('seperator', $this->_seperator); @@ -570,7 +570,7 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser { * @return void * @access public */ - static function exportCSV($fileName, $header, $data) { + public static function exportCSV($fileName, $header, $data) { $output = array(); $fd = fopen($fileName, 'w'); @@ -607,7 +607,7 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser { * * @return string */ - static function errorFileName($type) { + public static function errorFileName($type) { $fileName = NULL; if (empty($type)) { return $fileName; @@ -640,7 +640,7 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser { * * @return string */ - static function saveFileName($type) { + public static function saveFileName($type) { $fileName = NULL; if (empty($type)) { return $fileName; diff --git a/CRM/Contribute/Import/Parser/Contribution.php b/CRM/Contribute/Import/Parser/Contribution.php index 7a619629cf..29d69bf6cd 100644 --- a/CRM/Contribute/Import/Parser/Contribution.php +++ b/CRM/Contribute/Import/Parser/Contribution.php @@ -57,7 +57,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa /** * Class constructor */ - function __construct(&$mapperKeys, $mapperSoftCredit = NULL, $mapperPhoneType = NULL, $mapperSoftCreditType = NULL) { + public function __construct(&$mapperKeys, $mapperSoftCredit = NULL, $mapperPhoneType = NULL, $mapperSoftCreditType = NULL) { parent::__construct(); $this->_mapperKeys = &$mapperKeys; $this->_mapperSoftCredit = &$mapperSoftCredit; @@ -70,7 +70,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa * @return void * @access public */ - function init() { + public function init() { $fields = CRM_Contribute_BAO_Contribution::importableFields($this->_contactType, FALSE); $fields = array_merge($fields, @@ -143,7 +143,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa * @return boolean * @access public */ - function mapField(&$values) { + public function mapField(&$values) { return CRM_Import_Parser::VALID; } @@ -155,7 +155,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa * @return boolean the result of this processing * @access public */ - function preview(&$values) { + public function preview(&$values) { return $this->summary($values); } @@ -167,7 +167,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa * @return boolean the result of this processing * @access public */ - function summary(&$values) { + public function summary(&$values) { $erroneousField = NULL; $response = $this->setActiveFieldValues($values, $erroneousField); @@ -244,7 +244,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa * @return boolean the result of this processing * @access public */ - function import($onDuplicate, &$values) { + public function import($onDuplicate, &$values) { // first make sure this is a valid line $response = $this->summary($values); if ($response != CRM_Import_Parser::VALID) { @@ -567,7 +567,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa /** * Process pledge payments */ - function processPledgePayments(&$formatted) { + public function processPledgePayments(&$formatted) { if (!empty($formatted['pledge_payment_id']) && !empty($formatted['pledge_id'])) { //get completed status $completeStatusID = CRM_Core_OptionGroup::getValue('contribution_status', 'Completed', 'name'); @@ -594,7 +594,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa * @return array * @access public */ - function &getImportedContributions() { + public function &getImportedContributions() { return $this->_newContributions; } @@ -604,6 +604,6 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa * @return void * @access public */ - function fini() {} + public function fini() {} } diff --git a/CRM/Contribute/Page/ContributionPage.php b/CRM/Contribute/Page/ContributionPage.php index 5d4ae72f73..9afd4d7036 100644 --- a/CRM/Contribute/Page/ContributionPage.php +++ b/CRM/Contribute/Page/ContributionPage.php @@ -110,7 +110,7 @@ class CRM_Contribute_Page_ContributionPage extends CRM_Core_Page { * @return array $_configureActionLinks * */ - function &configureActionLinks() { + public function &configureActionLinks() { // check if variable _actionsLinks is populated if (!isset(self::$_configureActionLinks)) { $urlString = 'civicrm/admin/contribute/'; @@ -192,7 +192,7 @@ class CRM_Contribute_Page_ContributionPage extends CRM_Core_Page { * @return array $_onlineContributionLinks. * */ - function &onlineContributionLinks() { + public function &onlineContributionLinks() { if (!isset(self::$_onlineContributionLinks)) { $urlString = 'civicrm/contribute/transact'; $urlParams = 'reset=1&id=%%id%%'; @@ -224,7 +224,7 @@ class CRM_Contribute_Page_ContributionPage extends CRM_Core_Page { * @return array $_contributionLinks * */ - function &contributionLinks() { + public function &contributionLinks() { if (!isset(self::$_contributionLinks)) { //get contribution dates. $dates = CRM_Contribute_BAO_Contribution::getContributionDates(); @@ -275,7 +275,7 @@ class CRM_Contribute_Page_ContributionPage extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { // get the requested action $action = CRM_Utils_Request::retrieve('action', 'String', // default to 'browse' @@ -373,7 +373,7 @@ AND cp.page_type = 'contribute' * @return void * @access public */ - function copy() { + public function copy() { $gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this, TRUE, 0, 'GET' ); @@ -392,7 +392,7 @@ AND cp.page_type = 'contribute' * @access public * @static */ - function browse($action = NULL) { + public function browse($action = NULL) { $this->_sortByCharacter = CRM_Utils_Request::retrieve('sortByCharacter', 'String', $this @@ -534,7 +534,7 @@ ORDER BY title asc } } - function search() { + public function search() { if (isset($this->_action) & (CRM_Core_Action::ADD | CRM_Core_Action::UPDATE | @@ -560,7 +560,7 @@ ORDER BY title asc * * @return int|string */ - function whereClause(&$params, $sortBy = TRUE) { + public function whereClause(&$params, $sortBy = TRUE) { $values = $clauses = array(); $title = $this->get('title'); $createdId = $this->get('cid'); @@ -624,7 +624,7 @@ ORDER BY title asc * @param $whereClause * @param array $whereParams */ - function pager($whereClause, $whereParams) { + public function pager($whereClause, $whereParams) { $params['status'] = ts('Contribution %%StatusMessage%%'); $params['csvString'] = NULL; @@ -650,7 +650,7 @@ SELECT count(id) * @param $whereClause * @param array $whereParams */ - function pagerAtoZ($whereClause, $whereParams) { + public function pagerAtoZ($whereClause, $whereParams) { $query = " SELECT DISTINCT UPPER(LEFT(title, 1)) as sort_name @@ -669,7 +669,7 @@ SELECT count(id) * * @return array */ - function formatConfigureLinks($sectionsInfo) { + public function formatConfigureLinks($sectionsInfo) { //build the formatted configure links. $formattedConfLinks = self::configureActionLinks(); foreach ($formattedConfLinks as $act => & $link) { diff --git a/CRM/Contribute/Page/ContributionRecur.php b/CRM/Contribute/Page/ContributionRecur.php index 907d038cfd..c84db105e8 100644 --- a/CRM/Contribute/Page/ContributionRecur.php +++ b/CRM/Contribute/Page/ContributionRecur.php @@ -71,7 +71,7 @@ class CRM_Contribute_Page_ContributionRecur extends CRM_Core_Page { } } - function preProcess() { + public function preProcess() { $context = CRM_Utils_Request::retrieve('context', 'String', $this); $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'view'); $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); @@ -97,7 +97,7 @@ class CRM_Contribute_Page_ContributionRecur extends CRM_Core_Page { * return null * @access public */ - function run() { + public function run() { $this->preProcess(); if ($this->_action & CRM_Core_Action::VIEW) { diff --git a/CRM/Contribute/Page/DashBoard.php b/CRM/Contribute/Page/DashBoard.php index e894af20f1..f256b11d2a 100644 --- a/CRM/Contribute/Page/DashBoard.php +++ b/CRM/Contribute/Page/DashBoard.php @@ -46,7 +46,7 @@ class CRM_Contribute_Page_DashBoard extends CRM_Core_Page { * @access public * */ - function preProcess() { + public function preProcess() { CRM_Utils_System::setTitle(ts('CiviContribute')); $status = array('Valid', 'Cancelled'); @@ -107,7 +107,7 @@ class CRM_Contribute_Page_DashBoard extends CRM_Core_Page { * return null * @access public */ - function run() { + public function run() { $this->preProcess(); $controller = new CRM_Core_Controller_Simple('CRM_Contribute_Form_Search', diff --git a/CRM/Contribute/Page/ManagePremiums.php b/CRM/Contribute/Page/ManagePremiums.php index 0caab07983..25a12d9ea3 100644 --- a/CRM/Contribute/Page/ManagePremiums.php +++ b/CRM/Contribute/Page/ManagePremiums.php @@ -53,7 +53,7 @@ class CRM_Contribute_Page_ManagePremiums extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Contribute_BAO_ManagePremiums'; } @@ -62,7 +62,7 @@ class CRM_Contribute_Page_ManagePremiums extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::UPDATE => array( @@ -109,7 +109,7 @@ class CRM_Contribute_Page_ManagePremiums extends CRM_Core_Page_Basic { * @access public * */ - function run() { + public function run() { // get the requested action $action = CRM_Utils_Request::retrieve('action', 'String', @@ -142,7 +142,7 @@ class CRM_Contribute_Page_ManagePremiums extends CRM_Core_Page_Basic { * @access public * @static */ - function browse() { + public function browse() { // get all custom groups sorted by weight $premiums = array(); $dao = new CRM_Contribute_DAO_Product(); @@ -186,7 +186,7 @@ class CRM_Contribute_Page_ManagePremiums extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Contribute_Form_ManagePremiums'; } @@ -195,7 +195,7 @@ class CRM_Contribute_Page_ManagePremiums extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'Manage Premiums'; } @@ -206,7 +206,7 @@ class CRM_Contribute_Page_ManagePremiums extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/contribute/managePremiums'; } } diff --git a/CRM/Contribute/Page/PaymentInfo.php b/CRM/Contribute/Page/PaymentInfo.php index 1e7f64e33e..f1aea8c818 100644 --- a/CRM/Contribute/Page/PaymentInfo.php +++ b/CRM/Contribute/Page/PaymentInfo.php @@ -33,7 +33,7 @@ * */ class CRM_Contribute_Page_PaymentInfo extends CRM_Core_Page { - function preProcess() { + public function preProcess() { $this->_component = CRM_Utils_Request::retrieve('component', 'String', $this, TRUE); $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE); @@ -46,7 +46,7 @@ class CRM_Contribute_Page_PaymentInfo extends CRM_Core_Page { $this->assign('component', $this->_component); } - function browse() { + public function browse() { $getTrxnInfo = $this->_context == 'transaction' ? TRUE : FALSE; $paymentInfo = CRM_Contribute_BAO_Contribution::getPaymentInfo($this->_id, $this->_component, $getTrxnInfo, TRUE); if ($this->_context == 'payment_info') { @@ -64,7 +64,7 @@ class CRM_Contribute_Page_PaymentInfo extends CRM_Core_Page { /** * @return string */ - function run() { + public function run() { $this->preProcess(); if ($this->_action) { $this->browse(); diff --git a/CRM/Contribute/Page/Premium.php b/CRM/Contribute/Page/Premium.php index 3531bc98b2..a39a3c727f 100644 --- a/CRM/Contribute/Page/Premium.php +++ b/CRM/Contribute/Page/Premium.php @@ -51,7 +51,7 @@ class CRM_Contribute_Page_Premium extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Contribute_BAO_Premium'; } @@ -60,7 +60,7 @@ class CRM_Contribute_Page_Premium extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { // helper variable for nicer formatting $deleteExtra = ts('Are you sure you want to remove this product form this page?'); @@ -101,7 +101,7 @@ class CRM_Contribute_Page_Premium extends CRM_Core_Page_Basic { * @access public * */ - function run() { + public function run() { // get the requested action $action = CRM_Utils_Request::retrieve('action', 'String', // default to 'browse' @@ -131,7 +131,7 @@ class CRM_Contribute_Page_Premium extends CRM_Core_Page_Basic { * @access public * @static */ - function browse() { + public function browse() { // get all custom groups sorted by weight $premiums = array(); $pageID = CRM_Utils_Request::retrieve('id', 'Positive', @@ -201,7 +201,7 @@ class CRM_Contribute_Page_Premium extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Contribute_Form_ContributionPage_Premium'; } @@ -210,7 +210,7 @@ class CRM_Contribute_Page_Premium extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'Configure Premiums'; } @@ -221,7 +221,7 @@ class CRM_Contribute_Page_Premium extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return CRM_Utils_System::currentPath(); } } diff --git a/CRM/Contribute/Page/SubscriptionStatus.php b/CRM/Contribute/Page/SubscriptionStatus.php index 0f72cff93c..05bf8038c5 100644 --- a/CRM/Contribute/Page/SubscriptionStatus.php +++ b/CRM/Contribute/Page/SubscriptionStatus.php @@ -42,7 +42,7 @@ class CRM_Contribute_Page_SubscriptionStatus extends CRM_Core_Page { * return null * @access public */ - function run() { + public function run() { $task = CRM_Utils_Request::retrieve('task', 'String', CRM_Core_DAO::$_nullObject); $result = CRM_Utils_Request::retrieve('result', 'Integer', CRM_Core_DAO::$_nullObject); diff --git a/CRM/Contribute/Page/Tab.php b/CRM/Contribute/Page/Tab.php index 41ffaa2196..5d247de085 100644 --- a/CRM/Contribute/Page/Tab.php +++ b/CRM/Contribute/Page/Tab.php @@ -59,7 +59,7 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page { * @return array * @access public */ - static function &recurLinks($recurID = FALSE, $context = 'contribution') { + public static function &recurLinks($recurID = FALSE, $context = 'contribution') { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::VIEW => array( @@ -108,7 +108,7 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page { * return null * @access public */ - function browse() { + public function browse() { // add annual contribution $annual = array(); list($annual['count'], @@ -205,7 +205,7 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page { * return null * @access public */ - function view() { + public function view() { $controller = new CRM_Core_Controller_Simple( 'CRM_Contribute_Form_ContributionView', ts('View Contribution'), @@ -224,7 +224,7 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page { * return null * @access public */ - function edit() { + public function edit() { // set https for offline cc transaction $mode = CRM_Utils_Request::retrieve('mode', 'String', $this); if ($mode == 'test' || $mode == 'live') { @@ -243,7 +243,7 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page { return $controller->run(); } - function preProcess() { + public function preProcess() { $context = CRM_Utils_Request::retrieve('context', 'String', $this); $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); @@ -277,7 +277,7 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page { * return null * @access public */ - function run() { + public function run() { $this->preProcess(); // check if we can process credit card contribs @@ -298,7 +298,7 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page { return parent::run(); } - function setContext() { + public function setContext() { $qfKey = CRM_Utils_Request::retrieve('key', 'String', $this); $context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'search' diff --git a/CRM/Contribute/Page/UserDashboard.php b/CRM/Contribute/Page/UserDashboard.php index 711ca4da57..73113a8475 100644 --- a/CRM/Contribute/Page/UserDashboard.php +++ b/CRM/Contribute/Page/UserDashboard.php @@ -40,7 +40,7 @@ class CRM_Contribute_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBo * return null * @access public */ - function listContribution() { + public function listContribution() { $controller = new CRM_Core_Controller_Simple( 'CRM_Contribute_Form_Search', ts('Contributions'), @@ -151,7 +151,7 @@ class CRM_Contribute_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBo * return null * @access public */ - function run() { + public function run() { $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,'contribution_invoice_settings'); $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings); $this->assign('invoicing', $invoicing); diff --git a/CRM/Contribute/Selector/Search.php b/CRM/Contribute/Selector/Search.php index e8509c7801..1d0e79a22b 100644 --- a/CRM/Contribute/Selector/Search.php +++ b/CRM/Contribute/Selector/Search.php @@ -225,7 +225,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C * @return array * @access public */ - static function &links($componentId = NULL, $componentAction = NULL, $key = NULL, $compContext = NULL) { + public static function &links($componentId = NULL, $componentAction = NULL, $key = NULL, $compContext = NULL) { $extraParams = NULL; if ($componentId) { $extraParams = "&compId={$componentId}&compAction={$componentAction}"; @@ -269,7 +269,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C * @param array $params * @access public */ - function getPagerParams($action, &$params) { + public function getPagerParams($action, &$params) { $params['status'] = ts('Contribution') . ' %%StatusMessage%%'; $params['csvString'] = NULL; if ($this->_limit) { @@ -291,7 +291,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C * @return int Total number of rows * @access public */ - function getTotalCount($action) { + public function getTotalCount($action) { return $this->_query->searchQuery(0, 0, NULL, TRUE, FALSE, FALSE, FALSE, @@ -311,7 +311,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C * * @return int the total number of rows for this action */ - function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { + public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { if ($this->_includeSoftCredits) { // especial sort order when rows include soft credits $sort = "civicrm_contribution.receive_date DESC, civicrm_contribution.id, civicrm_contribution_soft.id"; @@ -543,14 +543,14 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C /** * @return mixed */ - function alphabetQuery() { + public function alphabetQuery() { return $this->_query->searchQuery(NULL, NULL, NULL, FALSE, FALSE, TRUE); } /** * @return string */ - function &getQuery() { + public function &getQuery() { return $this->_query; } @@ -561,14 +561,14 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C * * @return string name of the file */ - function getExportFileName($output = 'csv') { + public function getExportFileName($output = 'csv') { return ts('CiviCRM Contribution Search'); } /** * @return mixed */ - function getSummary() { + public function getSummary() { return $this->_query->summaryContribution($this->_context); } } diff --git a/CRM/Contribute/StateMachine/Contribution.php b/CRM/Contribute/StateMachine/Contribution.php index 8f1301f889..7ee106e3b9 100644 --- a/CRM/Contribute/StateMachine/Contribution.php +++ b/CRM/Contribute/StateMachine/Contribution.php @@ -47,7 +47,7 @@ class CRM_Contribute_StateMachine_Contribution extends CRM_Core_StateMachine { * * @return CRM_Contribute_StateMachine_Contribution */ - function __construct($controller, $action = CRM_Core_Action::NONE) { + public function __construct($controller, $action = CRM_Core_Action::NONE) { parent::__construct($controller, $action); $this->_pages = array( diff --git a/CRM/Contribute/StateMachine/ContributionPage.php b/CRM/Contribute/StateMachine/ContributionPage.php index 77ae2d00ed..784acef6f2 100644 --- a/CRM/Contribute/StateMachine/ContributionPage.php +++ b/CRM/Contribute/StateMachine/ContributionPage.php @@ -47,7 +47,7 @@ class CRM_Contribute_StateMachine_ContributionPage extends CRM_Core_StateMachine * * @return CRM_Contribute_StateMachine_ContributionPage */ - function __construct($controller, $action = CRM_Core_Action::NONE) { + public function __construct($controller, $action = CRM_Core_Action::NONE) { parent::__construct($controller, $action); $session = CRM_Core_Session::singleton(); diff --git a/CRM/Contribute/StateMachine/Search.php b/CRM/Contribute/StateMachine/Search.php index c93e294388..7ed72194b8 100644 --- a/CRM/Contribute/StateMachine/Search.php +++ b/CRM/Contribute/StateMachine/Search.php @@ -79,7 +79,7 @@ class CRM_Contribute_StateMachine_Search extends CRM_Core_StateMachine { * @return string the name of the form that will handle the task * @access protected */ - function taskName($controller, $formName = 'Search') { + public function taskName($controller, $formName = 'Search') { // total hack, check POST vars and then session to determine stuff $value = CRM_Utils_Array::value('task', $_POST); if (!isset($value)) { @@ -95,7 +95,7 @@ class CRM_Contribute_StateMachine_Search extends CRM_Core_StateMachine { * @return string * @access public */ - function getTaskFormName() { + public function getTaskFormName() { return CRM_Utils_String::getClassName($this->_task); } @@ -104,7 +104,7 @@ class CRM_Contribute_StateMachine_Search extends CRM_Core_StateMachine { * we dont want to issue a reset of the state session when we are done processing a task * */ - function shouldReset() { + public function shouldReset() { return FALSE; } } diff --git a/CRM/Contribute/Task.php b/CRM/Contribute/Task.php index 41cb724977..d07b128252 100644 --- a/CRM/Contribute/Task.php +++ b/CRM/Contribute/Task.php @@ -65,7 +65,7 @@ class CRM_Contribute_Task { * @static * @access public */ - static function &tasks() { + public static function &tasks() { if (!(self::$_tasks)) { self::$_tasks = array( 1 => array( @@ -151,7 +151,7 @@ class CRM_Contribute_Task { * @static * @access public */ - static function &taskTitles() { + public static function &taskTitles() { self::tasks(); $titles = array(); foreach (self::$_tasks as $id => $value) { @@ -171,7 +171,7 @@ class CRM_Contribute_Task { * @return array set of tasks that are valid for the user * @access public */ - static function &permissionedTaskTitles($permission, $softCreditFiltering = FALSE) { + public static function &permissionedTaskTitles($permission, $softCreditFiltering = FALSE) { $tasks = array(); if (($permission == CRM_Core_Permission::EDIT) || CRM_Core_Permission::check('edit contributions') @@ -206,7 +206,7 @@ class CRM_Contribute_Task { * @static * @access public */ - static function getTask($value) { + public static function getTask($value) { self::tasks(); if (!$value || !CRM_Utils_Array::value($value, self::$_tasks)) { // make the print task by default diff --git a/CRM/Core/Action.php b/CRM/Core/Action.php index 0fffddb2b0..12970a8727 100644 --- a/CRM/Core/Action.php +++ b/CRM/Core/Action.php @@ -119,7 +119,7 @@ class CRM_Core_Action { * @access public * @static */ - static function resolve($str) { + public static function resolve($str) { $action = 0; if ($str) { $items = explode('|', $str); @@ -139,7 +139,7 @@ class CRM_Core_Action { * @static * */ - static function map($item) { + public static function map($item) { $mask = 0; if (is_array($item)) { @@ -163,7 +163,7 @@ class CRM_Core_Action { * @static * */ - static function mapItem($item) { + public static function mapItem($item) { $mask = CRM_Utils_Array::value(trim($item), self::$_names); return $mask ? $mask : 0; } @@ -179,7 +179,7 @@ class CRM_Core_Action { * @static * */ - static function description($mask) { + public static function description($mask) { if (!isset($_description)) { self::$_description = array_flip(self::$_names); } @@ -315,7 +315,7 @@ class CRM_Core_Action { * @access public * @static */ - static function &replace(&$str, &$values) { + public static function &replace(&$str, &$values) { foreach ($values as $n => $v) { $str = str_replace("%%$n%%", $v, $str); } @@ -331,7 +331,7 @@ class CRM_Core_Action { * @static * @access public */ - static function mask($permissions) { + public static function mask($permissions) { $mask = NULL; if (!is_array($permissions) || CRM_Utils_System::isNull($permissions)) { return $mask; diff --git a/CRM/Core/BAO/ActionLog.php b/CRM/Core/BAO/ActionLog.php index 43bfd9497f..90ce83bf02 100644 --- a/CRM/Core/BAO/ActionLog.php +++ b/CRM/Core/BAO/ActionLog.php @@ -47,7 +47,7 @@ class CRM_Core_BAO_ActionLog extends CRM_Core_DAO_ActionLog { * @return actionLog array * @access public */ - static function create($params) { + public static function create($params) { $actionLog = new CRM_Core_DAO_ActionLog(); $params['action_date_time'] = CRM_Utils_Array::value('action_date_time', $params, date('YmdHis')); diff --git a/CRM/Core/BAO/ActionSchedule.php b/CRM/Core/BAO/ActionSchedule.php index 89cb5258e7..cd72bc77bc 100644 --- a/CRM/Core/BAO/ActionSchedule.php +++ b/CRM/Core/BAO/ActionSchedule.php @@ -44,7 +44,7 @@ class CRM_Core_BAO_ActionSchedule extends CRM_Core_DAO_ActionSchedule { * * @return array */ - static function getMapping($id = NULL) { + public static function getMapping($id = NULL) { static $_action_mapping; if ($id && !is_null($_action_mapping) && isset($_action_mapping[$id])) { @@ -72,7 +72,7 @@ class CRM_Core_BAO_ActionSchedule extends CRM_Core_DAO_ActionSchedule { * Get all fields of the type Date */ - static function getDateFields() { + public static function getDateFields() { $allFields = CRM_Core_BAO_CustomField::getFields(''); $dateFields = array('birth_date' => ts('Birth Date')); foreach ($allFields as $fieldID => $field) { @@ -92,7 +92,7 @@ class CRM_Core_BAO_ActionSchedule extends CRM_Core_DAO_ActionSchedule { * @static * @access public */ - static function getSelection($id = NULL) { + public static function getSelection($id = NULL) { $mapping = self::getMapping(); $activityStatus = CRM_Core_PseudoConstant::activityStatus(); $activityType = CRM_Core_PseudoConstant::activityType(TRUE, TRUE); @@ -266,7 +266,7 @@ class CRM_Core_BAO_ActionSchedule extends CRM_Core_DAO_ActionSchedule { * * @return array */ - static function getSelection1($id = NULL) { + public static function getSelection1($id = NULL) { $mapping = self::getMapping($id); $sel4 = $sel5 = array(); $options = array( @@ -325,7 +325,7 @@ class CRM_Core_BAO_ActionSchedule extends CRM_Core_DAO_ActionSchedule { * @static * @access public */ - static function &getList($namesOnly = FALSE, $entityValue = NULL, $id = NULL) { + public static function &getList($namesOnly = FALSE, $entityValue = NULL, $id = NULL) { $activity_type = CRM_Core_PseudoConstant::activityType(TRUE, TRUE); $activity_status = CRM_Core_PseudoConstant::activityStatus(); @@ -423,7 +423,7 @@ AND cas.entity_value = $id AND * @return bool|null * @throws CRM_Core_Exception */ - static function sendReminder($contactId, $to, $scheduleID, $from, $tokenParams) { + public static function sendReminder($contactId, $to, $scheduleID, $from, $tokenParams) { $email = $to['email']; $phoneNumber = $to['phone']; $schedule = new CRM_Core_DAO_ActionSchedule(); @@ -588,7 +588,7 @@ AND cas.entity_value = $id AND * @static * */ - static function add(&$params, $ids = array()) { + public static function add(&$params, $ids = array()) { $actionSchedule = new CRM_Core_DAO_ActionSchedule(); $actionSchedule->copyValues($params); @@ -607,7 +607,7 @@ AND cas.entity_value = $id AND * @access public * @static */ - static function retrieve(&$params, &$values) { + public static function retrieve(&$params, &$values) { if (empty($params)) { return NULL; } @@ -633,7 +633,7 @@ AND cas.entity_value = $id AND * @access public * @static */ - static function del($id) { + public static function del($id) { if ($id) { $dao = new CRM_Core_DAO_ActionSchedule(); $dao->id = $id; @@ -654,7 +654,7 @@ AND cas.entity_value = $id AND * @return Object DAO object on success, null otherwise * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Core_DAO_ActionSchedule', $id, 'is_active', $is_active); } @@ -664,7 +664,7 @@ AND cas.entity_value = $id AND * * @throws CRM_Core_Exception */ - static function sendMailings($mappingID, $now) { + public static function sendMailings($mappingID, $now) { $domainValues = CRM_Core_BAO_Domain::getNameAndEmail(); $fromEmailAddress = "$domainValues[0] <$domainValues[1]>"; @@ -918,7 +918,7 @@ WHERE reminder.action_schedule_id = %1 AND reminder.action_date_time IS NULL * * @throws API_Exception */ - static function buildRecipientContacts($mappingID, $now, $params = array()) { + public static function buildRecipientContacts($mappingID, $now, $params = array()) { $actionSchedule = new CRM_Core_DAO_ActionSchedule(); $actionSchedule->mapping_id = $mappingID; $actionSchedule->is_active = 1; @@ -1357,7 +1357,7 @@ GROUP BY reminder.contact_id * * @return null|string */ - static function permissionedRelationships($field) { + public static function permissionedRelationships($field) { $query = ' SELECT cm.id AS owner_id, cm.contact_id AS owner_contact, m.id AS slave_id, m.contact_id AS slave_contact, cmt.relationship_type_id AS relation_type, rel.contact_id_a, rel.contact_id_b, rel.is_permission_a_b, rel.is_permission_b_a FROM civicrm_membership m @@ -1393,7 +1393,7 @@ WHERE m.owner_membership_id IS NOT NULL AND * * @return array */ - static function processQueue($now = NULL, $params = array()) { + public static function processQueue($now = NULL, $params = array()) { $now = $now ? CRM_Utils_Time::setTime($now) : CRM_Utils_Time::getTime(); $mappings = self::getMapping(); @@ -1415,7 +1415,7 @@ WHERE m.owner_membership_id IS NOT NULL AND * * @return null|string */ - static function isConfigured($id, $mappingID) { + public static function isConfigured($id, $mappingID) { $queryString = "SELECT count(id) FROM civicrm_action_schedule WHERE mapping_id = %1 AND entity_value = %2"; @@ -1433,7 +1433,7 @@ WHERE m.owner_membership_id IS NOT NULL AND * * @return array */ - static function getRecipientListing($mappingID, $recipientType) { + public static function getRecipientListing($mappingID, $recipientType) { $options = array(); if (!$mappingID || !$recipientType) { return $options; diff --git a/CRM/Core/BAO/Address.php b/CRM/Core/BAO/Address.php index 7f414ccd78..49e112c70a 100644 --- a/CRM/Core/BAO/Address.php +++ b/CRM/Core/BAO/Address.php @@ -51,7 +51,7 @@ class CRM_Core_BAO_Address extends CRM_Core_DAO_Address { * @access public * @static */ - static function create(&$params, $fixAddress = TRUE, $entity = NULL) { + public static function create(&$params, $fixAddress = TRUE, $entity = NULL) { if (!isset($params['address']) || !is_array($params['address'])) { return; } @@ -142,7 +142,7 @@ class CRM_Core_BAO_Address extends CRM_Core_DAO_Address { * @access public * @static */ - static function add(&$params, $fixAddress) { + public static function add(&$params, $fixAddress) { static $customFields = NULL; $address = new CRM_Core_DAO_Address(); @@ -204,7 +204,7 @@ class CRM_Core_BAO_Address extends CRM_Core_DAO_Address { * @access public * @static */ - static function fixAddress(&$params) { + public static function fixAddress(&$params) { if (!empty($params['billing_street_address'])) { //Check address is comming from online contribution / registration page //Fixed :CRM-5076 @@ -405,7 +405,7 @@ class CRM_Core_BAO_Address extends CRM_Core_DAO_Address { * @access public * @static */ - static function dataExists(&$params) { + public static function dataExists(&$params) { //check if location type is set if not return false if (!isset($params['location_type_id'])) { return FALSE; @@ -463,7 +463,7 @@ class CRM_Core_BAO_Address extends CRM_Core_DAO_Address { * @access public * @static */ - static function &getValues($entityBlock, $microformat = FALSE, $fieldName = 'contact_id') { + public static function &getValues($entityBlock, $microformat = FALSE, $fieldName = 'contact_id') { if (empty($entityBlock)) { return NULL; } @@ -548,7 +548,7 @@ class CRM_Core_BAO_Address extends CRM_Core_DAO_Address { * @return void * @access public */ - function addDisplay($microformat = FALSE) { + public function addDisplay($microformat = FALSE) { $fields = array( // added this for CRM 1200 'address_id' => $this->id, @@ -588,7 +588,7 @@ class CRM_Core_BAO_Address extends CRM_Core_DAO_Address { * @access public * @static */ - static function allAddress($id, $updateBlankLocInfo = FALSE) { + public static function allAddress($id, $updateBlankLocInfo = FALSE) { if (!$id) { return NULL; } @@ -624,7 +624,7 @@ ORDER BY civicrm_address.is_primary DESC, address_id ASC"; * @access public * @static */ - static function allEntityAddress(&$entityElements) { + public static function allEntityAddress(&$entityElements) { $addresses = array(); if (empty($entityElements)) { return $addresses; @@ -657,7 +657,7 @@ ORDER BY civicrm_address.is_primary DESC, civicrm_address.location_type_id DESC, * * @return array of address sequence. */ - static function addressSequence() { + public static function addressSequence() { $config = CRM_Core_Config::singleton(); $addressSequence = $config->addressSequence(); @@ -702,7 +702,7 @@ ORDER BY civicrm_address.is_primary DESC, civicrm_address.location_type_id DESC, * @access public * @static */ - static function parseStreetAddress($streetAddress, $locale = NULL) { + public static function parseStreetAddress($streetAddress, $locale = NULL) { $config = CRM_Core_Config::singleton(); /* locales supported include: @@ -837,7 +837,7 @@ ORDER BY civicrm_address.is_primary DESC, civicrm_address.location_type_id DESC, * @access public * @static */ - static function validateAddressOptions($fields) { + public static function validateAddressOptions($fields) { static $addressOptions = NULL; if (!$addressOptions) { $addressOptions = @@ -866,7 +866,7 @@ ORDER BY civicrm_address.is_primary DESC, civicrm_address.location_type_id DESC, * @access public * @static */ - static function checkContactSharedAddress($addressId) { + public static function checkContactSharedAddress($addressId) { $query = 'SELECT count(id) FROM civicrm_address WHERE master_id = %1'; return CRM_Core_DAO::singleValueQuery($query, array(1 => array($addressId, 'Integer'))); } @@ -880,7 +880,7 @@ ORDER BY civicrm_address.is_primary DESC, civicrm_address.location_type_id DESC, * @access public * @static */ - static function checkContactSharedAddressFields(&$fields, $contactId) { + public static function checkContactSharedAddressFields(&$fields, $contactId) { if (!$contactId || !is_array($fields) || empty($fields)) { return; } @@ -952,7 +952,7 @@ SELECT is_primary, * @access public * @static */ - static function processSharedAddress($addressId, $params) { + public static function processSharedAddress($addressId, $params) { $query = 'SELECT id FROM civicrm_address WHERE master_id = %1'; $dao = CRM_Core_DAO::executeQuery($query, array(1 => array($addressId, 'Integer'))); @@ -984,7 +984,7 @@ SELECT is_primary, * @access public * @static */ - static function processSharedAddressRelationship($masterAddressId, $params) { + public static function processSharedAddressRelationship($masterAddressId, $params) { if (!$masterAddressId) { return; } @@ -1056,7 +1056,7 @@ SELECT is_primary, * @access public * @static */ - static function setSharedAddressDeleteStatus($addressId = NULL, $contactId = NULL, $returnStatus = FALSE) { + public static function setSharedAddressDeleteStatus($addressId = NULL, $contactId = NULL, $returnStatus = FALSE) { // check if address that is being deleted has any shared if ($addressId) { $entityId = $addressId; @@ -1109,7 +1109,7 @@ SELECT is_primary, /** * Call common delete function */ - static function del($id) { + public static function del($id) { return CRM_Contact_BAO_Contact::deleteObjectWithPrimary('Address', $id); } diff --git a/CRM/Core/BAO/Block.php b/CRM/Core/BAO/Block.php index e477c52915..f2fa53bc0d 100644 --- a/CRM/Core/BAO/Block.php +++ b/CRM/Core/BAO/Block.php @@ -58,7 +58,7 @@ class CRM_Core_BAO_Block { * @access public * @static */ - static function &getValues($blockName, $params) { + public static function &getValues($blockName, $params) { if (empty($params)) { return NULL; } @@ -103,7 +103,7 @@ class CRM_Core_BAO_Block { * @access public * @static */ - static function retrieveBlock(&$block, $blockName) { + public static function retrieveBlock(&$block, $blockName) { // we first get the primary location due to the order by clause $block->orderBy('is_primary desc, id'); $block->find(); @@ -133,7 +133,7 @@ class CRM_Core_BAO_Block { * @access public * @static */ - static function dataExists($blockFields, &$params) { + public static function dataExists($blockFields, &$params) { foreach ($blockFields as $field) { if (CRM_Utils_System::isNull(CRM_Utils_Array::value($field, $params))) { return FALSE; @@ -152,7 +152,7 @@ class CRM_Core_BAO_Block { * @access public * @static */ - static function blockExists($blockName, &$params) { + public static function blockExists($blockName, &$params) { // return if no data present if (empty($params[$blockName]) || !is_array($params[$blockName])) { return FALSE; @@ -175,7 +175,7 @@ class CRM_Core_BAO_Block { * @access public * @static */ - static function getBlockIds($blockName, $contactId = NULL, $entityElements = NULL, $updateBlankLocInfo = FALSE) { + public static function getBlockIds($blockName, $contactId = NULL, $entityElements = NULL, $updateBlankLocInfo = FALSE) { $allBlocks = array(); $name = ucfirst($blockName); @@ -216,7 +216,7 @@ class CRM_Core_BAO_Block { * @access public * @static */ - static function create($blockName, &$params, $entity = NULL, $contactId = NULL) { + public static function create($blockName, &$params, $entity = NULL, $contactId = NULL) { if (!self::blockExists($blockName, $params)) { return NULL; } @@ -394,7 +394,7 @@ class CRM_Core_BAO_Block { * @return void * @static */ - static function blockDelete($blockName, $params) { + public static function blockDelete($blockName, $params) { $name = ucfirst($blockName); if ($blockName == 'im') { $name = 'IM'; @@ -505,7 +505,7 @@ class CRM_Core_BAO_Block { * @param array $locations * */ - static function sortPrimaryFirst(&$locations){ + public static function sortPrimaryFirst(&$locations){ uasort($locations, 'self::primaryComparison'); } @@ -516,7 +516,7 @@ class CRM_Core_BAO_Block { * @param array $location2 * @return number */ - static function primaryComparison($location1, $location2){ + public static function primaryComparison($location1, $location2){ $l1 = CRM_Utils_Array::value('is_primary', $location1); $l2 = CRM_Utils_Array::value('is_primary', $location2); if ($l1 == $l2) { diff --git a/CRM/Core/BAO/CMSUser.php b/CRM/Core/BAO/CMSUser.php index eb3576cf56..9ced86bd83 100644 --- a/CRM/Core/BAO/CMSUser.php +++ b/CRM/Core/BAO/CMSUser.php @@ -57,7 +57,7 @@ class CRM_Core_BAO_CMSUser { * @static * @access public */ - static function synchronize($is_interactive = TRUE) { + public static function synchronize($is_interactive = TRUE) { //start of schronization code $config = CRM_Core_Config::singleton(); @@ -230,7 +230,7 @@ class CRM_Core_BAO_CMSUser { * @access public * @static */ - static function create(&$params, $mail) { + public static function create(&$params, $mail) { $config = CRM_Core_Config::singleton(); $ufID = $config->userSystem->createUser($params, $mail); @@ -267,7 +267,7 @@ class CRM_Core_BAO_CMSUser { * @access public * @static */ - static function buildForm(&$form, $gid, $emailPresent, $action = CRM_Core_Action::NONE) { + public static function buildForm(&$form, $gid, $emailPresent, $action = CRM_Core_Action::NONE) { $config = CRM_Core_Config::singleton(); $showCMS = FALSE; @@ -349,7 +349,7 @@ class CRM_Core_BAO_CMSUser { * * @return array|bool */ - static function formRule($fields, $files, $form) { + public static function formRule($fields, $files, $form) { if (empty($fields['cms_create_account'])) { return TRUE; } @@ -427,7 +427,7 @@ class CRM_Core_BAO_CMSUser { * @access public * @static */ - static function userExists(&$contact) { + public static function userExists(&$contact) { $config = CRM_Core_Config::singleton(); $isDrupal = $config->userSystem->is_drupal; @@ -490,7 +490,7 @@ class CRM_Core_BAO_CMSUser { * * @return object */ - static function &dbHandle(&$config) { + public static function &dbHandle(&$config) { $errorScope = CRM_Core_TemporaryErrorScope::ignoreException(); $db_uf = DB::connect($config->userFrameworkDSN); unset($errorScope); diff --git a/CRM/Core/BAO/Cache.php b/CRM/Core/BAO/Cache.php index 85edce55a7..4d507127c0 100644 --- a/CRM/Core/BAO/Cache.php +++ b/CRM/Core/BAO/Cache.php @@ -62,7 +62,7 @@ class CRM_Core_BAO_Cache extends CRM_Core_DAO_Cache { * @static * @access public */ - static function &getItem($group, $path, $componentID = NULL) { + public static function &getItem($group, $path, $componentID = NULL) { if (self::$_cache === NULL) { self::$_cache = array(); } @@ -100,7 +100,7 @@ class CRM_Core_BAO_Cache extends CRM_Core_DAO_Cache { * @static * @access public */ - static function &getItems($group, $componentID = NULL) { + public static function &getItems($group, $componentID = NULL) { if (self::$_cache === NULL) { self::$_cache = array(); } @@ -142,7 +142,7 @@ class CRM_Core_BAO_Cache extends CRM_Core_DAO_Cache { * @static * @access public */ - static function setItem(&$data, $group, $path, $componentID = NULL) { + public static function setItem(&$data, $group, $path, $componentID = NULL) { if (self::$_cache === NULL) { self::$_cache = array(); } @@ -196,7 +196,7 @@ class CRM_Core_BAO_Cache extends CRM_Core_DAO_Cache { * @static * @access public */ - static function deleteGroup($group = NULL, $path = NULL, $clearAll = TRUE) { + public static function deleteGroup($group = NULL, $path = NULL, $clearAll = TRUE) { $dao = new CRM_Core_DAO_Cache(); if (!empty($group)) { @@ -238,7 +238,7 @@ class CRM_Core_BAO_Cache extends CRM_Core_DAO_Cache { * @static * @access private */ - static function storeSessionToCache($names, $resetSession = TRUE) { + public static function storeSessionToCache($names, $resetSession = TRUE) { foreach ($names as $key => $sessionName) { if (is_array($sessionName)) { $value = null; @@ -281,7 +281,7 @@ class CRM_Core_BAO_Cache extends CRM_Core_DAO_Cache { /** * @param string $names */ - static function restoreSessionFromCache($names) { + public static function restoreSessionFromCache($names) { foreach ($names as $key => $sessionName) { if (is_array($sessionName)) { $value = self::getItem('CiviCRM Session', @@ -314,7 +314,7 @@ class CRM_Core_BAO_Cache extends CRM_Core_DAO_Cache { * @static * @access private */ - static function cleanup($session = false, $table = false, $prevNext = false) { + public static function cleanup($session = false, $table = false, $prevNext = false) { // clean up the session cache every $cacheCleanUpNumber probabilistically $cleanUpNumber = 757; diff --git a/CRM/Core/BAO/ConfigSetting.php b/CRM/Core/BAO/ConfigSetting.php index 90b2959ac2..b26bd984bb 100644 --- a/CRM/Core/BAO/ConfigSetting.php +++ b/CRM/Core/BAO/ConfigSetting.php @@ -49,7 +49,7 @@ class CRM_Core_BAO_ConfigSetting { * @return null * @static */ - static function create($params) { + public static function create($params) { self::add($params); $cache = CRM_Utils_Cache::singleton(); $cache->delete('CRM_Core_Config'); @@ -65,7 +65,7 @@ class CRM_Core_BAO_ConfigSetting { * @return null * @static */ - static function add(&$params) { + public static function add(&$params) { self::fixParams($params); // also set a template url so js files can use this @@ -146,7 +146,7 @@ class CRM_Core_BAO_ConfigSetting { * @return null * @static */ - static function fixParams(&$params) { + public static function fixParams(&$params) { // in our old civicrm.settings.php we were using ISO code for country and // province limit, now we have changed it to use ids @@ -179,7 +179,7 @@ class CRM_Core_BAO_ConfigSetting { * @return null * @static */ - static function formatParams(&$params, &$values) { + public static function formatParams(&$params, &$values) { if (empty($params) || !is_array($params) ) { @@ -203,7 +203,7 @@ class CRM_Core_BAO_ConfigSetting { * @return array $defaults * @static */ - static function retrieve(&$defaults) { + public static function retrieve(&$defaults) { $domain = new CRM_Core_DAO_Domain(); //we are initializing config, really can't use, CRM-7863 @@ -360,7 +360,7 @@ class CRM_Core_BAO_ConfigSetting { /** * @return array */ - static function getConfigSettings() { + public static function getConfigSettings() { $config = CRM_Core_Config::singleton(); $url = $dir = $siteName = $siteRoot = NULL; @@ -485,7 +485,7 @@ class CRM_Core_BAO_ConfigSetting { * - $siteName * - $siteRoot */ - static function getBestGuessSettings() { + public static function getBestGuessSettings() { $config = CRM_Core_Config::singleton(); //CRM-15365 - Fix preg_replace to handle backslash for Windows File Paths @@ -512,7 +512,7 @@ class CRM_Core_BAO_ConfigSetting { * @return string * @throws Exception */ - static function doSiteMove($defaultValues = array()) { + public static function doSiteMove($defaultValues = array()) { $moveStatus = ts('Beginning site move process...') . '
'; // get the current and guessed values list($oldURL, $oldDir, $oldSiteName, $oldSiteRoot) = self::getConfigSettings(); @@ -657,7 +657,7 @@ WHERE option_group_id = ( * @return boolean - true if valid component name and enabling succeeds, else false * @static */ - static function enableComponent($componentName) { + public static function enableComponent($componentName) { $config = CRM_Core_Config::singleton(); if (in_array($componentName, $config->enableComponents)) { // component is already enabled @@ -679,7 +679,7 @@ WHERE option_group_id = ( return TRUE; } - static function disableComponent($componentName) { + public static function disableComponent($componentName) { $config = CRM_Core_Config::singleton(); if (!in_array($componentName, $config->enableComponents) || !array_key_exists($componentName, CRM_Core_Component::getComponents()) @@ -722,7 +722,7 @@ WHERE option_group_id = ( /** * @return array */ - static function skipVars() { + public static function skipVars() { return array( 'dsn', 'templateCompileDir', diff --git a/CRM/Core/BAO/CustomField.php b/CRM/Core/BAO/CustomField.php index 7683b7b207..eec601e008 100644 --- a/CRM/Core/BAO/CustomField.php +++ b/CRM/Core/BAO/CustomField.php @@ -72,7 +72,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { * @access public * @static */ - static function &dataType() { + public static function &dataType() { if (!(self::$_dataType)) { self::$_dataType = array( 'String' => ts('Alphanumeric'), @@ -95,7 +95,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { /** * @return array */ - static function dataToHtml() { + public static function dataToHtml() { if (!self::$_dataToHtml) { self::$_dataToHtml = array( array( @@ -132,7 +132,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { * @access public * @static */ - static function create(&$params) { + public static function create(&$params) { $origParams = array_merge(array(), $params); if (!isset($params['id'])) { @@ -322,7 +322,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { return CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomField', $params, $defaults); } @@ -337,7 +337,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { * @access public * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { CRM_Utils_System::flushCache(); @@ -688,7 +688,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { * @static * public */ - static function getFieldObject($fieldID) { + public static function getFieldObject($fieldID) { $field = new CRM_Core_DAO_CustomField(); // check if we can get the field values from the system cache @@ -1087,7 +1087,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { * @static * @access public */ - static function getDisplayValue($value, $id, &$options, $contactID = NULL, $fieldID = NULL) { + public static function getDisplayValue($value, $id, &$options, $contactID = NULL, $fieldID = NULL) { $option = &$options[$id]; $attributes = &$option['attributes']; $html_type = $attributes['html_type']; @@ -1438,7 +1438,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { * * @return array */ - static function getFileURL($contactID, $cfID, $fileID = NULL, $absolute = FALSE, $multiRecordWhereClause = NULL) { + public static function getFileURL($contactID, $cfID, $fileID = NULL, $absolute = FALSE, $multiRecordWhereClause = NULL) { if ($contactID) { if (!$fileID) { $params = array('id' => $cfID); @@ -1760,7 +1760,7 @@ SELECT $columnName * * @return array */ - static function &defaultCustomTableSchema(&$params) { + public static function &defaultCustomTableSchema(&$params) { // add the id and extends_id $table = array( 'name' => $params['name'], @@ -1804,7 +1804,7 @@ SELECT $columnName * @param bool $indexExist * @param bool $triggerRebuild */ - static function createField($field, $operation, $indexExist = FALSE, $triggerRebuild = TRUE) { + public static function createField($field, $operation, $indexExist = FALSE, $triggerRebuild = TRUE) { $tableName = CRM_Core_DAO::getFieldValue( 'CRM_Core_DAO_CustomGroup', $field->custom_group_id, @@ -1872,7 +1872,7 @@ SELECT $columnName * @return array( string) or TRUE */ - static function _moveFieldValidate($fieldID, $newGroupID) { + public static function _moveFieldValidate($fieldID, $newGroupID) { $errors = array(); $field = new CRM_Core_DAO_CustomField(); @@ -1955,7 +1955,7 @@ WHERE id IN ( %1, %2 ) * * @return void */ - static function moveField($fieldID, $newGroupID) { + public static function moveField($fieldID, $newGroupID) { $validation = self::_moveFieldValidate($fieldID, $newGroupID); if (TRUE !== $validation) { CRM_Core_Error::fatal(implode(' ', $validation)); @@ -2001,7 +2001,7 @@ WHERE id IN ( %1, %2 ) * @static * @public */ - static function getTableColumnGroup($fieldID, $force = FALSE) { + public static function getTableColumnGroup($fieldID, $force = FALSE) { $cacheKey = "CRM_Core_DAO_CustomField_CustomGroup_TableColumn_{$fieldID}"; $cache = CRM_Utils_Cache::singleton(); $fieldValues = $cache->get($cacheKey); @@ -2082,7 +2082,7 @@ INNER JOIN civicrm_custom_field f ON ( g.id = f.option_group_id ) * @return void * @static */ - static function fixOptionGroups($customFieldId, $optionGroupId) { + public static function fixOptionGroups($customFieldId, $optionGroupId) { // check if option group belongs to any custom Field else delete // get the current option group $currentOptionGroupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', @@ -2108,7 +2108,7 @@ INNER JOIN civicrm_custom_field f ON ( g.id = f.option_group_id ) * @return void * @static */ - static function checkOptionGroup($optionGroupId) { + public static function checkOptionGroup($optionGroupId) { $query = " SELECT count(*) FROM civicrm_custom_field @@ -2128,7 +2128,7 @@ WHERE option_group_id = {$optionGroupId}"; * * @return null|string */ - static function getOptionGroupDefault($optionGroupId, $htmlType) { + public static function getOptionGroupDefault($optionGroupId, $htmlType) { $query = " SELECT default_value, html_type FROM civicrm_custom_field @@ -2218,7 +2218,7 @@ ORDER BY html_type"; * * @throws Exception */ - static function buildOption($field, &$options) { + public static function buildOption($field, &$options) { // Fixme - adding anything but options to the $options array is a bad idea // What if an option had the key 'attributes'? $options['attributes'] = array( @@ -2272,7 +2272,7 @@ SELECT label, value * * @return null */ - static function getCustomFieldID($fieldLabel, $groupTitle = NULL) { + public static function getCustomFieldID($fieldLabel, $groupTitle = NULL) { $params = array(1 => array($fieldLabel, 'String')); if ($groupTitle) { $params[2] = array($groupTitle, 'String'); @@ -2307,7 +2307,7 @@ WHERE ( f.label = %1 OR f.name = %1 ) * Given ID of a custom field, return its name as well as the name of the custom group it belongs to. * */ - static function getNameFromID($ids) { + public static function getNameFromID($ids) { if (is_array($ids)) { $ids = implode(',', $ids); } @@ -2340,7 +2340,7 @@ WHERE f.id IN ($ids)"; * @return array $errors validation errors. * @static */ - static function validateCustomData($params) { + public static function validateCustomData($params) { $errors = array(); if (!is_array($params) || empty($params)) { return $errors; @@ -2442,7 +2442,7 @@ WHERE f.id IN ($ids)"; * * @return bool */ - static function isMultiRecordField($customId) { + public static function isMultiRecordField($customId) { $isMultipleWithGid = FALSE; if (!is_numeric($customId)) { $customId = self::getKeyID($customId); @@ -2470,7 +2470,7 @@ WHERE cf.id = %1 AND cg.is_multiple = 1"; * @param CRM_Core_DAO_CustomField|array $field * @return bool */ - static function isSerialized($field) { + public static function isSerialized($field) { // Fields retrieved via api are an array, or from the dao are an object. We'll accept either. $field = (array) $field; // FIXME: Currently the only way to know if data is serialized is by looking at the html_type. It would be cleaner to decouple this. diff --git a/CRM/Core/BAO/CustomGroup.php b/CRM/Core/BAO/CustomGroup.php index 1a4d44e03b..bb593538d3 100644 --- a/CRM/Core/BAO/CustomGroup.php +++ b/CRM/Core/BAO/CustomGroup.php @@ -42,7 +42,7 @@ class CRM_Core_BAO_CustomGroup extends CRM_Core_DAO_CustomGroup { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -57,7 +57,7 @@ class CRM_Core_BAO_CustomGroup extends CRM_Core_DAO_CustomGroup { * @access public * @static */ - static function create(&$params) { + public static function create(&$params) { // create custom group dao, populate fields and then save. $group = new CRM_Core_DAO_CustomGroup(); $group->title = $params['title']; @@ -233,7 +233,7 @@ class CRM_Core_BAO_CustomGroup extends CRM_Core_DAO_CustomGroup { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { return CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomGroup', $params, $defaults); } @@ -247,7 +247,7 @@ class CRM_Core_BAO_CustomGroup extends CRM_Core_DAO_CustomGroup { * @static * @access public */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { // reset the cache CRM_Core_BAO_Cache::deleteGroup('contact fields'); @@ -1135,7 +1135,7 @@ ORDER BY civicrm_custom_group.weight, * * @return CRM_Core_DAO_CustomGroup */ - static function getAllCustomGroupsByBaseEntity($entityType) { + public static function getAllCustomGroupsByBaseEntity($entityType) { $customGroupDAO = new CRM_Core_DAO_CustomGroup(); self::_addWhereAdd($customGroupDAO, $entityType, NULL, TRUE); return $customGroupDAO; @@ -1257,7 +1257,7 @@ ORDER BY civicrm_custom_group.weight, * @param bool $inactiveNeeded * @param int $action */ - static function setDefaults(&$groupTree, &$defaults, $viewMode = FALSE, $inactiveNeeded = FALSE, $action = CRM_Core_Action::NONE) { + public static function setDefaults(&$groupTree, &$defaults, $viewMode = FALSE, $inactiveNeeded = FALSE, $action = CRM_Core_Action::NONE) { foreach ($groupTree as $id => $group) { if (!isset($group['fields'])) { continue; @@ -1399,7 +1399,7 @@ ORDER BY civicrm_custom_group.weight, * @param array $params * @param bool $skipFile */ - static function postProcess(&$groupTree, &$params, $skipFile = FALSE) { + public static function postProcess(&$groupTree, &$params, $skipFile = FALSE) { // Get the Custom form values and groupTree // first reset all checkbox and radio data foreach ($groupTree as $groupID => $group) { @@ -1531,7 +1531,7 @@ ORDER BY civicrm_custom_group.weight, * @access public * @static */ - static function buildQuickForm(&$form, &$groupTree, $inactiveNeeded = FALSE, $prefix = '') { + public static function buildQuickForm(&$form, &$groupTree, $inactiveNeeded = FALSE, $prefix = '') { $form->assign_by_ref("{$prefix}groupTree", $groupTree); // this is fix for date field @@ -1566,7 +1566,7 @@ ORDER BY civicrm_custom_group.weight, * @access public * @static */ - static function extractGetParams(&$form, $type) { + public static function extractGetParams(&$form, $type) { if (empty($_GET)) { return array(); } @@ -1674,7 +1674,7 @@ ORDER BY civicrm_custom_group.weight, * @static * @access public */ - static function checkCustomField($customFieldId, &$removeCustomFieldTypes) { + public static function checkCustomField($customFieldId, &$removeCustomFieldTypes) { $query = "SELECT cg.extends as extends FROM civicrm_custom_group as cg, civicrm_custom_field as cf WHERE cg.id = cf.custom_group_id @@ -1695,7 +1695,7 @@ ORDER BY civicrm_custom_group.weight, * @return string * @throws Exception */ - static function mapTableName($table) { + public static function mapTableName($table) { switch ($table) { case 'Contact': case 'Individual': @@ -1761,7 +1761,7 @@ SELECT IF( EXISTS(SELECT name FROM civicrm_contact_type WHERE name like %1), 1, /** * @param $group */ - static function createTable($group) { + public static function createTable($group) { $params = array( 'name' => $group->table_name, 'is_multiple' => $group->is_multiple ? 1 : 0, @@ -1782,7 +1782,7 @@ SELECT IF( EXISTS(SELECT name FROM civicrm_contact_type WHERE name like %1), 1, * * @return array $formattedGroupTree */ - static function formatGroupTree(&$groupTree, $groupCount = 1, &$form) { + public static function formatGroupTree(&$groupTree, $groupCount = 1, &$form) { $formattedGroupTree = array(); $uploadNames = array(); @@ -1855,7 +1855,7 @@ SELECT IF( EXISTS(SELECT name FROM civicrm_contact_type WHERE name like %1), 1, * * @return array|int */ - static function buildCustomDataView(&$form, &$groupTree, $returnCount = FALSE, $gID = NULL, $prefix = NULL, $customValueId = NULL) { + public static function buildCustomDataView(&$form, &$groupTree, $returnCount = FALSE, $gID = NULL, $prefix = NULL, $customValueId = NULL) { $details = array(); foreach ($groupTree as $key => $group) { if ($key === 'info') { @@ -1942,7 +1942,7 @@ SELECT IF( EXISTS(SELECT name FROM civicrm_contact_type WHERE name like %1), 1, * * @return array|null|string */ - static function formatCustomValues(&$values, &$field, $dncOptionPerLine = FALSE) { + public static function formatCustomValues(&$values, &$field, $dncOptionPerLine = FALSE) { $value = $values['data']; //changed isset CRM-4601 @@ -2203,7 +2203,7 @@ SELECT civicrm_custom_group.id as groupID, civicrm_custom_group.title as groupT return $groupLabels; } - static function dropAllTables() { + public static function dropAllTables() { $query = "SELECT table_name FROM civicrm_custom_group"; $dao = CRM_Core_DAO::executeQuery($query); @@ -2221,7 +2221,7 @@ SELECT civicrm_custom_group.id as groupID, civicrm_custom_group.title as groupT * @return boolean true if empty otherwise false. * @access public */ - static function isGroupEmpty($gID) { + public static function isGroupEmpty($gID) { if (!$gID) { return; } @@ -2249,7 +2249,7 @@ SELECT civicrm_custom_group.id as groupID, civicrm_custom_group.title as groupT * @return array of types. * @access public */ - static function getExtendedObjectTypes(&$types = array()) { + public static function getExtendedObjectTypes(&$types = array()) { static $flag = FALSE, $objTypes = array(); if (!$flag) { @@ -2289,7 +2289,7 @@ SELECT civicrm_custom_group.id as groupID, civicrm_custom_group.title as groupT * * @return bool */ - static function hasReachedMaxLimit($customGroupId, $entityId) { + public static function hasReachedMaxLimit($customGroupId, $entityId) { //check whether the group is multiple $isMultiple = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $customGroupId, 'is_multiple'); $isMultiple = ($isMultiple) ? TRUE : FALSE; @@ -2318,7 +2318,7 @@ SELECT civicrm_custom_group.id as groupID, civicrm_custom_group.title as groupT /** * @return array */ - static function getMultipleFieldGroup() { + public static function getMultipleFieldGroup() { $multipleGroup = array(); $dao = new CRM_Core_DAO_CustomGroup(); $dao->is_multiple = 1; diff --git a/CRM/Core/BAO/CustomOption.php b/CRM/Core/BAO/CustomOption.php index 178f6099b9..c6a63df928 100644 --- a/CRM/Core/BAO/CustomOption.php +++ b/CRM/Core/BAO/CustomOption.php @@ -49,7 +49,7 @@ class CRM_Core_BAO_CustomOption { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $customOption = new CRM_Core_DAO_OptionValue(); $customOption->copyValues($params); if ($customOption->find(TRUE)) { @@ -117,7 +117,7 @@ class CRM_Core_BAO_CustomOption { * @static * @access public */ - static function getOptionLabel($fieldId, $value, $htmlType = NULL, $dataType = NULL) { + public static function getOptionLabel($fieldId, $value, $htmlType = NULL, $dataType = NULL) { if (!$fieldId) { return NULL; } @@ -168,7 +168,7 @@ WHERE id = %1 * @static * @access public */ - static function del($optionId) { + public static function del($optionId) { // get the customFieldID $query = " SELECT f.id as id, f.data_type as dataType @@ -212,7 +212,7 @@ WHERE id = %1"; * * @throws Exception */ - static function updateCustomValues($params) { + public static function updateCustomValues($params) { $optionDAO = new CRM_Core_DAO_OptionValue(); $optionDAO->id = $params['optionId']; $optionDAO->find(TRUE); @@ -285,7 +285,7 @@ SET {$dao->columnName} = REPLACE( {$dao->columnName}, %1, %2 )"; * * @return array */ - static function valuesByID($customFieldID, $optionGroupID = NULL) { + public static function valuesByID($customFieldID, $optionGroupID = NULL) { if (!$optionGroupID) { $optionGroupID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', $customFieldID, diff --git a/CRM/Core/BAO/CustomQuery.php b/CRM/Core/BAO/CustomQuery.php index baa49831e9..f8fd3b21f5 100644 --- a/CRM/Core/BAO/CustomQuery.php +++ b/CRM/Core/BAO/CustomQuery.php @@ -142,7 +142,7 @@ class CRM_Core_BAO_CustomQuery { * * @access public */ - function __construct($ids, $contactSearch = FALSE, $locationSpecificFields = array()) { + public function __construct($ids, $contactSearch = FALSE, $locationSpecificFields = array()) { $this->_ids = &$ids; $this->_locationSpecificCustomFields = $locationSpecificFields; @@ -263,7 +263,7 @@ SELECT label, value * @return void * @access public */ - function select() { + public function select() { if (empty($this->_fields)) { return; } @@ -332,7 +332,7 @@ SELECT label, value * * @access public */ - function where() { + public function where() { foreach ($this->_ids as $id => $values) { // Fixed for Isuue CRM 607 @@ -561,7 +561,7 @@ SELECT label, value * @return array array of strings * @access public */ - function query() { + public function query() { $this->select(); $this->where(); @@ -593,7 +593,7 @@ SELECT label, value * @param $value * @param $grouping */ - function searchRange(&$id, &$label, $type, $fieldName, &$value, &$grouping) { + public function searchRange(&$id, &$label, $type, $fieldName, &$value, &$grouping) { $qill = array(); if (isset($value['from'])) { diff --git a/CRM/Core/BAO/CustomValue.php b/CRM/Core/BAO/CustomValue.php index 29e42f2950..b573c7c72c 100644 --- a/CRM/Core/BAO/CustomValue.php +++ b/CRM/Core/BAO/CustomValue.php @@ -198,7 +198,7 @@ class CRM_Core_BAO_CustomValue extends CRM_Core_DAO { * @return void * @static */ - static function deleteCustomValue($customValueID, $customGroupID) { + public static function deleteCustomValue($customValueID, $customGroupID) { // first we need to find custom value table, from custom group ID $tableName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $customGroupID, 'table_name'); diff --git a/CRM/Core/BAO/CustomValueTable.php b/CRM/Core/BAO/CustomValueTable.php index 8fffddb1d3..b7035cf6a8 100644 --- a/CRM/Core/BAO/CustomValueTable.php +++ b/CRM/Core/BAO/CustomValueTable.php @@ -39,7 +39,7 @@ class CRM_Core_BAO_CustomValueTable { * * @throws Exception */ - static function create(&$customParams) { + public static function create(&$customParams) { if (empty($customParams) || !is_array($customParams) ) { @@ -310,7 +310,7 @@ class CRM_Core_BAO_CustomValueTable { * @param $entityTable * @param int $entityID */ - static function store(&$params, $entityTable, $entityID) { + public static function store(&$params, $entityTable, $entityID) { $cvParams = array(); foreach ($params as $fieldID => $param) { foreach ($param as $index => $customValue) { @@ -358,7 +358,7 @@ class CRM_Core_BAO_CustomValueTable { * @param int $entityID * @param $customFieldExtends */ - static function postProcess(&$params, &$customFields, $entityTable, $entityID, $customFieldExtends) { + public static function postProcess(&$params, &$customFields, $entityTable, $entityID, $customFieldExtends) { $customData = CRM_Core_BAO_CustomField::postProcess($params, $customFields, $entityID, @@ -496,7 +496,7 @@ AND $cond * @return array * @static */ - static function setValues(&$params) { + public static function setValues(&$params) { if (!isset($params['entityID']) || CRM_Utils_Type::escape($params['entityID'], 'Integer', FALSE) === NULL @@ -641,7 +641,7 @@ AND cf.id IN ( $fieldIDList ) * @return array * @static */ - static function &getValues(&$params) { + public static function &getValues(&$params) { if (empty($params)) { return NULL; } diff --git a/CRM/Core/BAO/Dashboard.php b/CRM/Core/BAO/Dashboard.php index 0bb16f3f49..894d5c88b8 100644 --- a/CRM/Core/BAO/Dashboard.php +++ b/CRM/Core/BAO/Dashboard.php @@ -47,7 +47,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard { * * @return object */ - static function create($params) { + public static function create($params) { $hook = empty($params['id']) ? 'create' : 'edit'; CRM_Utils_Hook::pre($hook, 'Dashboard', CRM_Utils_Array::value('id', $params), $params); $dao = self::addDashlet($params); @@ -65,7 +65,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard { * @access public * @static */ - static function getDashlets($all = TRUE, $checkPermission = TRUE) { + public static function getDashlets($all = TRUE, $checkPermission = TRUE) { $dashlets = array(); $dao = new CRM_Core_DAO_Dashboard(); @@ -105,7 +105,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard { * @access public * @static */ - static function getContactDashlets($flatFormat = FALSE, $contactID = NULL) { + public static function getContactDashlets($flatFormat = FALSE, $contactID = NULL) { $dashlets = array(); if (!$contactID) { @@ -153,7 +153,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard { * * @return array of dashboard_id's */ - static function initializeDashlets() { + public static function initializeDashlets() { $dashlets = array(); $getDashlets = civicrm_api3("Dashboard", "get", array('domain_id' => CRM_Core_Config::domainID(), 'option.limit' => 0)); $contactID = CRM_Core_Session::singleton()->get('userID'); @@ -193,7 +193,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard { * * @return boolean true if use has permission else false */ - static function checkPermission($permission, $operator) { + public static function checkPermission($permission, $operator) { if ($permission) { $permissions = explode(',', $permission); $config = CRM_Core_Config::singleton(); @@ -268,7 +268,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard { * @access public * @static */ - static function getDashletInfo($dashletID) { + public static function getDashletInfo($dashletID) { $dashletInfo = array(); $params = array(1 => array($dashletID, 'Integer')); @@ -340,7 +340,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard { * @access public * @static */ - static function saveDashletChanges($columns, $contactID=NULL) { + public static function saveDashletChanges($columns, $contactID=NULL) { $session = CRM_Core_Session::singleton(); if (!$contactID) { $contactID = $session->get('userID'); @@ -406,7 +406,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard { * @access public * @static */ - static function addDashlet(&$params) { + public static function addDashlet(&$params) { // special case to handle duplicate entries for report instances $dashboardID = CRM_Utils_Array::value('id', $params); @@ -455,7 +455,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard { * * @return string */ - static function getDashletName($url) { + public static function getDashletName($url) { $urlElements = explode('/', $url); if ($urlElements[1] == 'dashlet') { return $urlElements[2]; @@ -473,7 +473,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard { * @return void * @static */ - static function addContactDashlet($dashlet) { + public static function addContactDashlet($dashlet) { $admin = CRM_Core_Permission::check('administer CiviCRM'); // if dashlet is created by admin then you need to add it all contacts. @@ -519,7 +519,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard { * @param array $params each item is a spec for a dashlet on the contact's dashboard * @return bool */ - static function addContactDashletToDashboard(&$params) { + public static function addContactDashletToDashboard(&$params) { $valuesString = NULL; $columns = array(); foreach ($params as $dashboardIDs) { @@ -540,7 +540,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard { * @return void * @static */ - static function resetDashletCache($contactID = null) { + public static function resetDashletCache($contactID = null) { $whereClause = null; $params = array(); if ($contactID) { @@ -559,7 +559,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard { * @return void * @static */ - static function deleteDashlet($dashletID) { + public static function deleteDashlet($dashletID) { $dashlet = new CRM_Core_DAO_Dashboard(); $dashlet->id = $dashletID; $dashlet->delete(); diff --git a/CRM/Core/BAO/Discount.php b/CRM/Core/BAO/Discount.php index ba79ac3d5a..cdbd96179b 100644 --- a/CRM/Core/BAO/Discount.php +++ b/CRM/Core/BAO/Discount.php @@ -37,7 +37,7 @@ class CRM_Core_BAO_Discount extends CRM_Core_DAO_Discount { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -51,7 +51,7 @@ class CRM_Core_BAO_Discount extends CRM_Core_DAO_Discount { * @access public * @static */ - static function del($entityId,$entityTable) { + public static function del($entityId,$entityTable) { // delete all discount records with the selected discounted id $discount = new CRM_Core_DAO_Discount( ); $discount->entity_id = $entityId; @@ -74,7 +74,7 @@ class CRM_Core_BAO_Discount extends CRM_Core_DAO_Discount { * @access public * @static */ - static function add(&$params) { + public static function add(&$params) { $discount = new CRM_Core_DAO_Discount( ); $discount->copyValues($params); $discount->save(); @@ -91,7 +91,7 @@ class CRM_Core_BAO_Discount extends CRM_Core_DAO_Discount { * @return array $optionGroupIDs option group Ids associated with discount * */ - static function getOptionGroup($entityId, $entityTable) { + public static function getOptionGroup($entityId, $entityTable) { $optionGroupIDs = array(); $dao = new CRM_Core_DAO_Discount( ); $dao->entity_id = $entityId; @@ -112,7 +112,7 @@ class CRM_Core_BAO_Discount extends CRM_Core_DAO_Discount { * @return integer $dao->id discount id of the set which matches * the date criteria */ - static function findSet($entityID, $entityTable) { + public static function findSet($entityID, $entityTable) { if (empty($entityID) || empty($entityTable)) { // adding this here, to trap errors if values are not sent CRM_Core_Error::fatal(); diff --git a/CRM/Core/BAO/Domain.php b/CRM/Core/BAO/Domain.php index a987897673..9ae6738499 100644 --- a/CRM/Core/BAO/Domain.php +++ b/CRM/Core/BAO/Domain.php @@ -58,7 +58,7 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { return CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_Domain', $params, $defaults); } @@ -71,7 +71,7 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { * @access public * @static */ - static function &getDomain($reset = null) { + public static function &getDomain($reset = null) { static $domain = NULL; if (!$domain || $reset) { $domain = new CRM_Core_BAO_Domain(); @@ -96,7 +96,7 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { * @deprecated * @see http://issues.civicrm.org/jira/browse/CRM-11204 */ - static function setDomain($domainID) { + public static function setDomain($domainID) { CRM_Core_Config::domainID($domainID); self::getDomain($domainID); CRM_Core_Config::singleton(TRUE, TRUE); @@ -109,7 +109,7 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { * @deprecated * @see CRM_Core_BAO_Domain::setDomain */ - static function resetDomain() { + public static function resetDomain() { CRM_Core_Config::domainID(null, true); self::getDomain(null, true); CRM_Core_Config::singleton(TRUE, TRUE); @@ -120,7 +120,7 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { * * @return null|string */ - static function version($skipUsingCache = false) { + public static function version($skipUsingCache = false) { return CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Domain', CRM_Core_Config::domainID(), 'version', @@ -137,7 +137,7 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { * @return array Location::getValues * @access public */ - function &getLocationValues() { + public function &getLocationValues() { if ($this->_location == NULL) { $domain = self::getDomain(null); $params = array( @@ -161,7 +161,7 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { * @return array domain * @access public */ - static function edit(&$params, &$id) { + public static function edit(&$params, &$id) { $domain = new CRM_Core_DAO_Domain(); $domain->id = $id; $domain->copyValues($params); @@ -177,7 +177,7 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { * @return array domain * @access public */ - static function create($params) { + public static function create($params) { $domain = new CRM_Core_DAO_Domain(); $domain->copyValues($params); $domain->save(); @@ -187,7 +187,7 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { /** * @return bool */ - static function multipleDomains() { + public static function multipleDomains() { $session = CRM_Core_Session::singleton(); $numberDomains = $session->get('numberDomains'); @@ -205,7 +205,7 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { * @return array name & email for domain * @throws Exception */ - static function getNameAndEmail($skipFatal = FALSE) { + public static function getNameAndEmail($skipFatal = FALSE) { $fromEmailAddress = CRM_Core_OptionGroup::values('from_email_address', NULL, NULL, NULL, ' AND is_default = 1'); if (!empty($fromEmailAddress)) { foreach ($fromEmailAddress as $key => $value) { @@ -233,7 +233,7 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { * * @return bool|null|object|string */ - static function addContactToDomainGroup($contactID) { + public static function addContactToDomainGroup($contactID) { $groupID = self::getGroupId(); if ($groupID) { @@ -248,7 +248,7 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { /** * @return bool|null|object|string */ - static function getGroupId() { + public static function getGroupId() { static $groupID = NULL; if ($groupID) { @@ -291,7 +291,7 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { * * @return bool */ - static function isDomainGroup($groupId) { + public static function isDomainGroup($groupId) { $domainGroupID = self::getGroupId(); return $domainGroupID == $groupId ? TRUE : FALSE; } @@ -299,7 +299,7 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { /** * @return array */ - static function getChildGroupIds() { + public static function getChildGroupIds() { $domainGroupID = self::getGroupId(); $childGrps = array(); @@ -315,7 +315,7 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { * * @return array */ - static function getContactList() { + public static function getContactList() { $siteGroups = CRM_Core_BAO_Domain::getChildGroupIds(); $siteContacts = array(); diff --git a/CRM/Core/BAO/Email.php b/CRM/Core/BAO/Email.php index 0aa6e592d4..890d628ea9 100644 --- a/CRM/Core/BAO/Email.php +++ b/CRM/Core/BAO/Email.php @@ -46,7 +46,7 @@ class CRM_Core_BAO_Email extends CRM_Core_DAO_Email { * * @return object */ - static function create($params) { + public static function create($params) { // if id is set & is_primary isn't we can assume no change if (is_numeric(CRM_Utils_Array::value('is_primary', $params)) || empty($params['id'])) { CRM_Core_BAO_Block::handlePrimary($params, get_class()); @@ -66,7 +66,7 @@ class CRM_Core_BAO_Email extends CRM_Core_DAO_Email { * @access public * @static */ - static function add(&$params) { + public static function add(&$params) { $hook = empty($params['id']) ? 'create' : 'edit'; CRM_Utils_Hook::pre($hook, 'Email', CRM_Utils_Array::value('id', $params), $params); @@ -119,7 +119,7 @@ WHERE contact_id = {$params['contact_id']} * @access public * @static */ - static function &getValues($entityBlock) { + public static function &getValues($entityBlock) { return CRM_Core_BAO_Block::getValues('email', $entityBlock); } @@ -134,7 +134,7 @@ WHERE contact_id = {$params['contact_id']} * @access public * @static */ - static function allEmails($id, $updateBlankLocInfo = FALSE) { + public static function allEmails($id, $updateBlankLocInfo = FALSE) { if (!$id) { return NULL; } @@ -191,7 +191,7 @@ ORDER BY civicrm_email.is_primary DESC, email_id ASC "; * @access public * @static */ - static function allEntityEmails(&$entityElements) { + public static function allEntityEmails(&$entityElements) { if (empty($entityElements)) { return NULL; } @@ -239,7 +239,7 @@ ORDER BY e.is_primary DESC, email_id ASC "; * @return void * @static */ - static function holdEmail(&$email) { + public static function holdEmail(&$email) { //check for update mode if ($email->id) { $params = array(1 => array($email->id, 'Integer')); @@ -286,7 +286,7 @@ AND reset_date IS NULL * @access public * @static */ - static function getFromEmail() { + public static function getFromEmail() { $session = CRM_Core_Session::singleton(); $contactID = $session->get('userID'); $fromEmailValues = array(); @@ -323,14 +323,14 @@ AND reset_date IS NULL /** * @return object */ - static function isMultipleBulkMail() { + public static function isMultipleBulkMail() { return CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, 'civimail_multiple_bulk_emails', NULL, FALSE); } /** * Call common delete function */ - static function del($id) { + public static function del($id) { return CRM_Contact_BAO_Contact::deleteObjectWithPrimary('Email', $id); } } diff --git a/CRM/Core/BAO/EntityTag.php b/CRM/Core/BAO/EntityTag.php index 34689a15ba..d21b4dec4b 100644 --- a/CRM/Core/BAO/EntityTag.php +++ b/CRM/Core/BAO/EntityTag.php @@ -49,7 +49,7 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag { * @access public * @static */ - static function &getTag($entityID, $entityTable = 'civicrm_contact') { + public static function &getTag($entityID, $entityTable = 'civicrm_contact') { $tags = array(); $entityTag = new CRM_Core_BAO_EntityTag(); @@ -76,7 +76,7 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag { * @access public * @static */ - static function add(&$params) { + public static function add(&$params) { $dataExists = self::dataExists($params); if (!$dataExists) { return NULL; @@ -107,7 +107,7 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag { * @access public * @static */ - static function dataExists($params) { + public static function dataExists($params) { return !($params['tag_id'] == 0); } @@ -121,7 +121,7 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag { * @static * */ - static function del(&$params) { + public static function del(&$params) { $entityTag = new CRM_Core_BAO_EntityTag(); $entityTag->copyValues($params); $entityTag->delete(); @@ -142,7 +142,7 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag { * @access public * @static */ - static function addEntitiesToTag(&$entityIds, $tagId, $entityTable = 'civicrm_contact') { + public static function addEntitiesToTag(&$entityIds, $tagId, $entityTable = 'civicrm_contact') { $numEntitiesAdded = 0; $numEntitiesNotAdded = 0; $entityIdsAdded = array(); @@ -185,7 +185,7 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag { * @access public * @static */ - static function removeEntitiesFromTag(&$entityIds, $tagId, $entityTable = 'civicrm_contact') { + public static function removeEntitiesFromTag(&$entityIds, $tagId, $entityTable = 'civicrm_contact') { $numEntitiesRemoved = 0; $numEntitiesNotRemoved = 0; $entityIdsRemoved = array(); @@ -228,7 +228,7 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag { * @access public * @static */ - static function create(&$params, $entityTable, $entityID) { + public static function create(&$params, $entityTable, $entityID) { // get categories for the entity id $entityTag = CRM_Core_BAO_EntityTag::getTag($entityID, $entityTable); @@ -270,7 +270,7 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag { * @return array $entityIds array of entity ids * @access public */ - function getEntitiesByTag($tag) { + public function getEntitiesByTag($tag) { $entityIds = array(); $entityTagDAO = new CRM_Core_DAO_EntityTag(); $entityTagDAO->tag_id = $tag->id; @@ -284,7 +284,7 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag { /** * Get contact tags */ - static function getContactTags($contactID, $count = FALSE) { + public static function getContactTags($contactID, $count = FALSE) { $contactTags = array(); if (!$count) { $select = "SELECT name "; @@ -317,7 +317,7 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag { /** * Get child contact tags given parentId */ - static function getChildEntityTags($parentId, $entityId, $entityTable = 'civicrm_contact') { + public static function getChildEntityTags($parentId, $entityId, $entityTable = 'civicrm_contact') { $entityTags = array(); $query = "SELECT ct.id as tag_id, name FROM civicrm_tag ct INNER JOIN civicrm_entity_tag et ON ( et.entity_id = {$entityId} AND @@ -339,7 +339,7 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag { /** * Merge two tags: tag B into tag A. */ - function mergeTags($tagAId, $tagBId) { + public function mergeTags($tagAId, $tagBId) { $queryParams = array(1 => array($tagBId, 'Integer'), 2 => array($tagAId, 'Integer'), ); diff --git a/CRM/Core/BAO/Extension.php b/CRM/Core/BAO/Extension.php index a4620d547b..cbb830dc8d 100644 --- a/CRM/Core/BAO/Extension.php +++ b/CRM/Core/BAO/Extension.php @@ -49,7 +49,7 @@ class CRM_Core_BAO_Extension extends CRM_Core_DAO_Extension { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $extension = new CRM_Core_DAO_Extension(); $extension->copyValues($params); if ($extension->find(TRUE)) { @@ -69,7 +69,7 @@ class CRM_Core_BAO_Extension extends CRM_Core_DAO_Extension { * @access public * @static */ - static function del($id) { + public static function del($id) { $extension = new CRM_Core_DAO_Extension(); $extension->id = $id; return $extension->delete(); @@ -82,7 +82,7 @@ class CRM_Core_BAO_Extension extends CRM_Core_DAO_Extension { * @param $schemaVersion string * @return void */ - static function setSchemaVersion($fullName, $schemaVersion) { + public static function setSchemaVersion($fullName, $schemaVersion) { $sql = 'UPDATE civicrm_extension SET schema_version = %1 WHERE full_name = %2'; $params = array( 1 => array($schemaVersion, 'String'), @@ -97,7 +97,7 @@ class CRM_Core_BAO_Extension extends CRM_Core_DAO_Extension { * @param $fullName string, the fully-qualified name (eg "com.example.myextension") * @return string */ - static function getSchemaVersion($fullName) { + public static function getSchemaVersion($fullName) { $sql = 'SELECT schema_version FROM civicrm_extension WHERE full_name = %1'; $params = array( 1 => array($fullName, 'String'), diff --git a/CRM/Core/BAO/File.php b/CRM/Core/BAO/File.php index 3a1b2f06b5..a7426987a9 100644 --- a/CRM/Core/BAO/File.php +++ b/CRM/Core/BAO/File.php @@ -47,7 +47,7 @@ class CRM_Core_BAO_File extends CRM_Core_DAO_File { * * @return array */ - static function path($fileID, $entityID, $entityTable = NULL) { + public static function path($fileID, $entityID, $entityTable = NULL) { $entityFileDAO = new CRM_Core_DAO_EntityFile(); if ($entityTable) { $entityFileDAO->entity_table = $entityTable; @@ -221,7 +221,7 @@ class CRM_Core_BAO_File extends CRM_Core_DAO_File { * Delete all the files and associated object associated with this * combination */ - static function deleteEntityFile($entityTable, $entityID, $fileTypeID = NULL, $fileID = NULL) { + public static function deleteEntityFile($entityTable, $entityID, $fileTypeID = NULL, $fileID = NULL) { if (empty($entityTable) || empty($entityID)) { return; } @@ -274,7 +274,7 @@ class CRM_Core_BAO_File extends CRM_Core_DAO_File { * Get all the files and associated object associated with this * combination */ - static function getEntityFile($entityTable, $entityID, $addDeleteArgs = FALSE) { + public static function getEntityFile($entityTable, $entityID, $addDeleteArgs = FALSE) { if (empty($entityTable) || !$entityID) { $results = NULL; return $results; @@ -330,7 +330,7 @@ class CRM_Core_BAO_File extends CRM_Core_DAO_File { * * @return array */ - static function sql($entityTable, $entityID, $fileTypeID = NULL, $fileID = NULL) { + public static function sql($entityTable, $entityID, $fileTypeID = NULL, $fileID = NULL) { if ($entityTable == '*') { // $entityID is the ID of a specific file $sql = " @@ -385,7 +385,7 @@ AND CEF.entity_id = %2"; * @param null $numAttachments * @param bool $ajaxDelete */ - static function buildAttachment(&$form, $entityTable, $entityID = NULL, $numAttachments = NULL, $ajaxDelete = FALSE) { + public static function buildAttachment(&$form, $entityTable, $entityID = NULL, $numAttachments = NULL, $ajaxDelete = FALSE) { if (!$numAttachments) { $numAttachments = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'max_attachments'); @@ -468,7 +468,7 @@ AND CEF.entity_id = %2"; * @return array An array with 2 elements. The string and the number of attachments * @static */ - static function attachmentInfo($entityTable, $entityID, $separator = '
') { + public static function attachmentInfo($entityTable, $entityID, $separator = '
') { if (!$entityID) { return NULL; } @@ -543,7 +543,7 @@ AND CEF.entity_id = %2"; * @param $entityTable * @param int $entityID */ - static function processAttachment(&$params, $entityTable, $entityID) { + public static function processAttachment(&$params, $entityTable, $entityID) { $numAttachments = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'max_attachments'); for ($i = 1; $i <= $numAttachments; $i++) { @@ -569,7 +569,7 @@ AND CEF.entity_id = %2"; /** * @return array */ - static function uploadNames() { + public static function uploadNames() { $numAttachments = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'max_attachments'); $names = array(); @@ -590,7 +590,7 @@ AND CEF.entity_id = %2"; * @param $newEntityTable * @param int $newEntityId */ - static function copyEntityFile($oldEntityTable, $oldEntityId, $newEntityTable, $newEntityId) { + public static function copyEntityFile($oldEntityTable, $oldEntityId, $newEntityTable, $newEntityId) { $oldEntityFile = new CRM_Core_DAO_EntityFile(); $oldEntityFile->entity_id = $oldEntityId; $oldEntityFile->entity_table = $oldEntityTable; @@ -612,7 +612,7 @@ AND CEF.entity_id = %2"; * * @return string */ - static function deleteURLArgs($entityTable, $entityID, $fileID) { + public static function deleteURLArgs($entityTable, $entityID, $fileID) { $params['entityTable'] = $entityTable; $params['entityID'] = $entityID; $params['fileID'] = $fileID; @@ -628,7 +628,7 @@ AND CEF.entity_id = %2"; * @static * @access public */ - static function deleteAttachment() { + public static function deleteAttachment() { $params = array(); $params['entityTable'] = CRM_Utils_Request::retrieve('entityTable', 'String', CRM_Core_DAO::$_nullObject, TRUE); $params['entityID'] = CRM_Utils_Request::retrieve('entityID', 'Positive', CRM_Core_DAO::$_nullObject, TRUE); @@ -657,7 +657,7 @@ AND CEF.entity_id = %2"; * @static * @access public */ - static function paperIconAttachment($entityTable, $entityID) { + public static function paperIconAttachment($entityTable, $entityID) { if (empty($entityTable) || !$entityID) { $results = NULL; return $results; @@ -703,7 +703,7 @@ AND CEF.entity_id = %2"; * * @return CRM_Core_FileSearchInterface|NULL */ - static function getSearchService() { + public static function getSearchService() { $fileSearches = array(); CRM_Utils_Hook::fileSearches($fileSearches); diff --git a/CRM/Core/BAO/FinancialTrxn.php b/CRM/Core/BAO/FinancialTrxn.php index 3efe184e49..1ec96c9e86 100644 --- a/CRM/Core/BAO/FinancialTrxn.php +++ b/CRM/Core/BAO/FinancialTrxn.php @@ -43,7 +43,7 @@ class CRM_Core_BAO_FinancialTrxn extends CRM_Financial_DAO_FinancialTrxn { /** * */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -58,7 +58,7 @@ class CRM_Core_BAO_FinancialTrxn extends CRM_Financial_DAO_FinancialTrxn { * @access public * @static */ - static function create(&$params, $trxnEntityTable = null ) { + public static function create(&$params, $trxnEntityTable = null ) { $trxn = new CRM_Financial_DAO_FinancialTrxn(); $trxn->copyValues($params); $fids = array(); @@ -98,7 +98,7 @@ class CRM_Core_BAO_FinancialTrxn extends CRM_Financial_DAO_FinancialTrxn { * * @return array */ - static function getBalanceTrxnAmt($contributionId, $contributionFinancialTypeId = NULL) { + public static function getBalanceTrxnAmt($contributionId, $contributionFinancialTypeId = NULL) { if (!$contributionFinancialTypeId) { $contributionFinancialTypeId = CRM_Core_DAO::getFieldValue('CRM_Contribute_BAO_Contribution', $contributionId, 'financial_type_id'); } @@ -129,7 +129,7 @@ class CRM_Core_BAO_FinancialTrxn extends CRM_Financial_DAO_FinancialTrxn { * @access public * @static */ - static function retrieve( &$params, &$defaults ) { + public static function retrieve( &$params, &$defaults ) { $financialItem = new CRM_Financial_DAO_FinancialTrxn( ); $financialItem->copyValues($params); if ($financialItem->find(true)) { @@ -152,7 +152,7 @@ class CRM_Core_BAO_FinancialTrxn extends CRM_Financial_DAO_FinancialTrxn { * @access public * @static */ - static function getFinancialTrxnId($entity_id, $orderBy = 'ASC', $newTrxn = FALSE) { + public static function getFinancialTrxnId($entity_id, $orderBy = 'ASC', $newTrxn = FALSE) { $ids = array('entityFinancialTrxnId' => NULL, 'financialTrxnId' => NULL); $condition = ""; @@ -195,7 +195,7 @@ LIMIT 1;"; * @access public * @static */ - static function getFinancialTrxnTotal($entity_id) { + public static function getFinancialTrxnTotal($entity_id) { $query = " SELECT (ft.amount+SUM(ceft.amount)) AS total FROM civicrm_entity_financial_trxn AS ft LEFT JOIN civicrm_entity_financial_trxn AS ceft ON ft.financial_trxn_id = ceft.entity_id @@ -218,7 +218,7 @@ WHERE ft.entity_table = 'civicrm_contribution' AND ft.entity_id = %1 * @access public * @static */ - static function getPayments($financial_trxn_id) { + public static function getPayments($financial_trxn_id) { $query = " SELECT ef1.financial_trxn_id, sum(ef1.amount) amount FROM civicrm_entity_financial_trxn ef1 @@ -270,7 +270,7 @@ WHERE ef2.financial_trxn_id =%1 * @access public * @static */ - static function getFinancialTrxnLineTotal($entity_id, $entity_table = 'civicrm_contribution') { + public static function getFinancialTrxnLineTotal($entity_id, $entity_table = 'civicrm_contribution') { $query = "SELECT lt.price_field_value_id AS id, ft.financial_trxn_id,ft.amount AS amount FROM civicrm_entity_financial_trxn AS ft LEFT JOIN civicrm_financial_item AS fi ON fi.id = ft.entity_id AND fi.entity_table = 'civicrm_line_item' AND ft.entity_table = 'civicrm_financial_item' LEFT JOIN civicrm_line_item AS lt ON lt.id = fi.entity_id AND lt.entity_table = %2 @@ -297,7 +297,7 @@ WHERE lt.entity_id = %1 "; * @access public * @static */ - static function deleteFinancialTrxn($entity_id) { + public static function deleteFinancialTrxn($entity_id) { $query = "DELETE ceft1, cfi, ceft, cft FROM `civicrm_financial_trxn` cft LEFT JOIN civicrm_entity_financial_trxn ceft ON ceft.financial_trxn_id = cft.id AND ceft.entity_table = 'civicrm_contribution' @@ -316,7 +316,7 @@ WHERE ceft.entity_id = %1"; * @access public * @static */ - static function createPremiumTrxn($params) { + public static function createPremiumTrxn($params) { if ((empty($params['financial_type_id']) || empty($params['contributionId'])) && empty($params['oldPremium'])) { return; } @@ -366,7 +366,7 @@ WHERE ceft.entity_id = %1"; * @access public * @static */ - static function recordFees($params) { + public static function recordFees($params) { $expenseTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Expense Account is' ")); $domainId = CRM_Core_Config::domainID(); $amount = 0; @@ -428,7 +428,7 @@ WHERE ceft.entity_id = %1"; * * @return array|int|null|string */ - static function getPartialPaymentWithType($entityId, $entityName = 'participant', $returnType = TRUE, $lineItemTotal = NULL) { + public static function getPartialPaymentWithType($entityId, $entityName = 'participant', $returnType = TRUE, $lineItemTotal = NULL) { $value = NULL; if (empty($entityName)) { return $value; diff --git a/CRM/Core/BAO/IM.php b/CRM/Core/BAO/IM.php index 07378a47e3..806df878dc 100644 --- a/CRM/Core/BAO/IM.php +++ b/CRM/Core/BAO/IM.php @@ -47,7 +47,7 @@ class CRM_Core_BAO_IM extends CRM_Core_DAO_IM { * @access public * @static */ - static function add(&$params) { + public static function add(&$params) { $hook = empty($params['id']) ? 'create' : 'edit'; CRM_Utils_Hook::pre($hook, 'IM', CRM_Utils_Array::value('id', $params), $params); @@ -69,7 +69,7 @@ class CRM_Core_BAO_IM extends CRM_Core_DAO_IM { * @access public * @static */ - static function &getValues($entityBlock) { + public static function &getValues($entityBlock) { return CRM_Core_BAO_Block::getValues('im', $entityBlock); } @@ -84,7 +84,7 @@ class CRM_Core_BAO_IM extends CRM_Core_DAO_IM { * @access public * @static */ - static function allIMs($id, $updateBlankLocInfo = FALSE) { + public static function allIMs($id, $updateBlankLocInfo = FALSE) { if (!$id) { return NULL; } @@ -135,7 +135,7 @@ ORDER BY * @access public * @static */ - static function allEntityIMs(&$entityElements) { + public static function allEntityIMs(&$entityElements) { if (empty($entityElements)) { return NULL; } @@ -172,7 +172,7 @@ ORDER BY cim.is_primary DESC, im_id ASC "; /** * Call common delete function */ - static function del($id) { + public static function del($id) { return CRM_Contact_BAO_Contact::deleteObjectWithPrimary('IM', $id); } } diff --git a/CRM/Core/BAO/Job.php b/CRM/Core/BAO/Job.php index f066cb7bac..82505592ae 100644 --- a/CRM/Core/BAO/Job.php +++ b/CRM/Core/BAO/Job.php @@ -41,7 +41,7 @@ class CRM_Core_BAO_Job extends CRM_Core_DAO_Job { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -54,7 +54,7 @@ class CRM_Core_BAO_Job extends CRM_Core_DAO_Job { * @access public * @static */ - static function create($params) { + public static function create($params) { $job = new CRM_Core_DAO_Job(); $job->copyValues($params); return $job->save(); @@ -72,7 +72,7 @@ class CRM_Core_BAO_Job extends CRM_Core_DAO_Job { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $job = new CRM_Core_DAO_Job(); $job->copyValues($params); if ($job->find(TRUE)) { @@ -93,7 +93,7 @@ class CRM_Core_BAO_Job extends CRM_Core_DAO_Job { * @access public * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Core_DAO_Job', $id, 'is_active', $is_active); } @@ -106,7 +106,7 @@ class CRM_Core_BAO_Job extends CRM_Core_DAO_Job { * @access public * @static */ - static function del($jobID) { + public static function del($jobID) { if (!$jobID) { CRM_Core_Error::fatal(ts('Invalid value passed to delete function.')); } @@ -127,7 +127,7 @@ class CRM_Core_BAO_Job extends CRM_Core_DAO_Job { * * CRM-10513 */ - static function cleanup($maxEntriesToKeep = 1000, $minDaysToKeep = 30) { + public static function cleanup($maxEntriesToKeep = 1000, $minDaysToKeep = 30) { // Prevent the job log from getting too big // For now, keep last minDays days and at least maxEntries records $query = 'SELECT COUNT(*) FROM civicrm_job_log'; diff --git a/CRM/Core/BAO/LabelFormat.php b/CRM/Core/BAO/LabelFormat.php index 092d85964c..9b9deb3a37 100644 --- a/CRM/Core/BAO/LabelFormat.php +++ b/CRM/Core/BAO/LabelFormat.php @@ -282,7 +282,7 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue { * @static * @access public */ - static function addOrder(&$list, $returnURL) { + public static function addOrder(&$list, $returnURL) { $filter = "option_group_id = " . self::_getGid(); CRM_Utils_Weight::addOrder($list, 'CRM_Core_DAO_OptionValue', 'id', $returnURL, $filter); } @@ -297,7 +297,7 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue { * @static * @access public */ - static function &getList($namesOnly = FALSE, $groupName='label_format') { + public static function &getList($namesOnly = FALSE, $groupName='label_format') { static $list = array(); if (self::_getGid($groupName)) { // get saved label formats from Option Value table @@ -327,7 +327,7 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue { * @static * @access public */ - static function &getDefaultValues($groupName = 'label_format') { + public static function &getDefaultValues($groupName = 'label_format') { $params = array('is_active' => 1, 'is_default' => 1); $defaults = array(); if (!self::retrieve($params, $defaults, $groupName)) { @@ -351,7 +351,7 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue { * @return array $values (reference) associative array of name/value pairs * @access public */ - static function &getLabelFormat($field, $val, $groupName = 'label_format') { + public static function &getLabelFormat($field, $val, $groupName = 'label_format') { $params = array('is_active' => 1, $field => $val); $labelFormat = array(); if (self::retrieve($params, $labelFormat, $groupName)) { @@ -370,7 +370,7 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue { * @return array $values (reference) associative array of name/value pairs * @access public */ - static function &getByName($name) { + public static function &getByName($name) { return self::getLabelFormat('name', $name); } @@ -383,7 +383,7 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue { * @return array $values (reference) associative array of name/value pairs * @access public */ - static function &getById($id, $groupName = 'label_format') { + public static function &getById($id, $groupName = 'label_format') { return self::getLabelFormat('id', $id, $groupName); } @@ -400,7 +400,7 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue { * @access public * @static */ - static function getValue($field, &$values, $default = NULL) { + public static function getValue($field, &$values, $default = NULL) { if (array_key_exists($field, self::$optionValueFields)) { switch (self::$optionValueFields[$field]['type']) { case CRM_Utils_Type::T_INT: @@ -433,7 +433,7 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue { * @access public * @static */ - static function retrieve(&$params, &$values, $groupName='label_format') { + public static function retrieve(&$params, &$values, $groupName='label_format') { $optionValue = new CRM_Core_DAO_OptionValue(); $optionValue->copyValues($params); $optionValue->option_group_id = self::_getGid($groupName); @@ -481,7 +481,7 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue { * @return void * @access public */ - function saveLabelFormat(&$values, $id = NULL, $groupName = 'label_format') { + public function saveLabelFormat(&$values, $id = NULL, $groupName = 'label_format') { // get the Option Group ID for Label Formats (create one if it doesn't exist) $group_id = self::_getGid($groupName); @@ -546,7 +546,7 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue { * @access public * @static */ - static function del($id, $groupName) { + public static function del($id, $groupName) { if ($id) { $dao = new CRM_Core_DAO_OptionValue(); $dao->id = $id; diff --git a/CRM/Core/BAO/Location.php b/CRM/Core/BAO/Location.php index a28c3d5361..3f0f410997 100644 --- a/CRM/Core/BAO/Location.php +++ b/CRM/Core/BAO/Location.php @@ -56,7 +56,7 @@ class CRM_Core_BAO_Location extends CRM_Core_DAO { * @access public * @static */ - static function create(&$params, $fixAddress = TRUE, $entity = NULL) { + public static function create(&$params, $fixAddress = TRUE, $entity = NULL) { $location = array(); if (!self::dataExists($params)) { return $location; @@ -98,7 +98,7 @@ class CRM_Core_BAO_Location extends CRM_Core_DAO { * Creates the entry in the civicrm_loc_block * */ - static function createLocBlock(&$location, &$entityElements) { + public static function createLocBlock(&$location, &$entityElements) { $locId = self::findExisting($entityElements); $locBlock = array(); @@ -134,7 +134,7 @@ class CRM_Core_BAO_Location extends CRM_Core_DAO { * @access public * @static */ - static function findExisting($entityElements) { + public static function findExisting($entityElements) { $eid = $entityElements['entity_id']; $etable = $entityElements['entity_table']; $query = " @@ -159,7 +159,7 @@ WHERE e.id = %1"; * @access public * @static */ - static function addLocBlock(&$params) { + public static function addLocBlock(&$params) { $locBlock = new CRM_Core_DAO_LocBlock(); $locBlock->copyValues($params); @@ -219,7 +219,7 @@ WHERE e.id = %1"; * @access public * @static */ - static function dataExists(&$params) { + public static function dataExists(&$params) { // return if no data present $dataExists = FALSE; foreach (self::$blocks as $block) { @@ -240,7 +240,7 @@ WHERE e.id = %1"; * @access public * @static */ - static function &getValues($entityBlock, $microformat = FALSE) { + public static function &getValues($entityBlock, $microformat = FALSE) { if (empty($entityBlock)) { return NULL; } @@ -274,7 +274,7 @@ WHERE e.id = %1"; * @access public * @static */ - static function deleteLocationBlocks($contactId, $locationTypeId) { + public static function deleteLocationBlocks($contactId, $locationTypeId) { // ensure that contactId has a value if (empty($contactId) || !CRM_Utils_Rule::positiveInteger($contactId) @@ -306,7 +306,7 @@ WHERE e.id = %1"; * * @return int newly created/updated location block id. */ - static function copyLocBlock($locBlockId, $updateLocBlockId = NULL) { + public static function copyLocBlock($locBlockId, $updateLocBlockId = NULL) { //get the location info. $defaults = $updateValues = array(); $locBlock = array('id' => $locBlockId); @@ -354,7 +354,7 @@ WHERE e.id = %1"; * @access public * @static */ - static function checkPrimaryBlocks($contactId) { + public static function checkPrimaryBlocks($contactId) { if (!$contactId) { return; } @@ -395,7 +395,7 @@ WHERE e.id = %1"; * * @return array */ - static function getChainSelectValues($values, $valueType, $flatten = FALSE) { + public static function getChainSelectValues($values, $valueType, $flatten = FALSE) { if (!$values) { return array(); } diff --git a/CRM/Core/BAO/LocationType.php b/CRM/Core/BAO/LocationType.php index 09b771a49d..228ea6352f 100644 --- a/CRM/Core/BAO/LocationType.php +++ b/CRM/Core/BAO/LocationType.php @@ -43,7 +43,7 @@ class CRM_Core_BAO_LocationType extends CRM_Core_DAO_LocationType { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -57,7 +57,7 @@ class CRM_Core_BAO_LocationType extends CRM_Core_DAO_LocationType { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $locationType = new CRM_Core_DAO_LocationType(); $locationType->copyValues($params); if ($locationType->find(TRUE)) { @@ -78,7 +78,7 @@ class CRM_Core_BAO_LocationType extends CRM_Core_DAO_LocationType { * @access public * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Core_DAO_LocationType', $id, 'is_active', $is_active); } @@ -92,7 +92,7 @@ class CRM_Core_BAO_LocationType extends CRM_Core_DAO_LocationType { * @static * @access public */ - static function &getDefault() { + public static function &getDefault() { if (self::$_defaultLocationType == NULL) { $params = array('is_default' => 1); $defaults = array(); @@ -108,7 +108,7 @@ class CRM_Core_BAO_LocationType extends CRM_Core_DAO_LocationType { /** * @return mixed|null */ - static function getBilling() { + public static function getBilling() { if (self::$_billingLocationType == NULL) { $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array(), 'validate'); self::$_billingLocationType = array_search('Billing', $locationTypes); @@ -126,7 +126,7 @@ class CRM_Core_BAO_LocationType extends CRM_Core_DAO_LocationType { * * @return object */ - static function create(&$params) { + public static function create(&$params) { $params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE); $params['is_default'] = CRM_Utils_Array::value('is_default', $params, FALSE); $params['is_reserved'] = CRM_Utils_Array::value('is_reserved', $params, FALSE); @@ -152,7 +152,7 @@ class CRM_Core_BAO_LocationType extends CRM_Core_DAO_LocationType { * @access public * @static */ - static function del($locationTypeId) { + public static function del($locationTypeId) { $entity = array('address', 'phone', 'email', 'im'); //check dependencies foreach ($entity as $key) { diff --git a/CRM/Core/BAO/Log.php b/CRM/Core/BAO/Log.php index b62abc3001..d8c7dd9018 100644 --- a/CRM/Core/BAO/Log.php +++ b/CRM/Core/BAO/Log.php @@ -45,7 +45,7 @@ class CRM_Core_BAO_Log extends CRM_Core_DAO_Log { * * @return array|null */ - static function &lastModified($id, $table = 'civicrm_contact') { + public static function &lastModified($id, $table = 'civicrm_contact') { $log = new CRM_Core_DAO_Log(); @@ -73,7 +73,7 @@ class CRM_Core_BAO_Log extends CRM_Core_DAO_Log { * * @static */ - static function add(&$params) { + public static function add(&$params) { $log = new CRM_Core_DAO_Log(); $log->copyValues($params); @@ -159,7 +159,7 @@ UPDATE civicrm_log * @access public * @static */ - static function getContactLogCount($contactID) { + public static function getContactLogCount($contactID) { $query = "SELECT count(*) FROM civicrm_log WHERE civicrm_log.entity_table = 'civicrm_contact' AND civicrm_log.entity_id = {$contactID}"; return CRM_Core_DAO::singleValueQuery($query); @@ -173,7 +173,7 @@ UPDATE civicrm_log * @access public * @static */ - static function useLoggingReport() { + public static function useLoggingReport() { // first check if logging is enabled $config = CRM_Core_Config::singleton(); if (!$config->logging) { diff --git a/CRM/Core/BAO/MailSettings.php b/CRM/Core/BAO/MailSettings.php index 70edf9b335..78f1fff5fd 100644 --- a/CRM/Core/BAO/MailSettings.php +++ b/CRM/Core/BAO/MailSettings.php @@ -37,7 +37,7 @@ class CRM_Core_BAO_MailSettings extends CRM_Core_DAO_MailSettings { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -49,7 +49,7 @@ class CRM_Core_BAO_MailSettings extends CRM_Core_DAO_MailSettings { * * @return CRM_Core_BAO_MailSettings DAO with the default mail settings set */ - static function defaultDAO($reset = FALSE) { + public static function defaultDAO($reset = FALSE) { static $mailSettings = array(); $domainID = CRM_Core_Config::domainID(); if (empty($mailSettings[$domainID]) || $reset) { @@ -67,7 +67,7 @@ class CRM_Core_BAO_MailSettings extends CRM_Core_DAO_MailSettings { * * @return string default domain */ - static function defaultDomain() { + public static function defaultDomain() { return self::defaultDAO()->domain; } @@ -76,7 +76,7 @@ class CRM_Core_BAO_MailSettings extends CRM_Core_DAO_MailSettings { * * @return string default localpart */ - static function defaultLocalpart() { + public static function defaultLocalpart() { return self::defaultDAO()->localpart; } @@ -85,7 +85,7 @@ class CRM_Core_BAO_MailSettings extends CRM_Core_DAO_MailSettings { * * @return string default return path */ - static function defaultReturnPath() { + public static function defaultReturnPath() { return self::defaultDAO()->return_path; } @@ -94,7 +94,7 @@ class CRM_Core_BAO_MailSettings extends CRM_Core_DAO_MailSettings { * * @return boolean default include message ID */ - static function includeMessageId() { + public static function includeMessageId() { return CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, 'include_message_id', NULL, @@ -115,7 +115,7 @@ class CRM_Core_BAO_MailSettings extends CRM_Core_DAO_MailSettings { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $mailSettings = new CRM_Core_DAO_MailSettings(); $mailSettings->copyValues($params); @@ -138,7 +138,7 @@ class CRM_Core_BAO_MailSettings extends CRM_Core_DAO_MailSettings { * * @return object */ - static function add(&$params) { + public static function add(&$params) { $result = NULL; if (empty($params)) { return $result; @@ -172,7 +172,7 @@ class CRM_Core_BAO_MailSettings extends CRM_Core_DAO_MailSettings { * @access public * @static */ - static function create(&$params) { + public static function create(&$params) { $transaction = new CRM_Core_Transaction(); $mailSettings = self::add($params); @@ -196,7 +196,7 @@ class CRM_Core_BAO_MailSettings extends CRM_Core_DAO_MailSettings { * @static * */ - static function deleteMailSettings($id) { + public static function deleteMailSettings($id) { $results = NULL; $transaction = new CRM_Core_Transaction(); diff --git a/CRM/Core/BAO/Mapping.php b/CRM/Core/BAO/Mapping.php index 4843cc7d7b..8567c53686 100644 --- a/CRM/Core/BAO/Mapping.php +++ b/CRM/Core/BAO/Mapping.php @@ -37,7 +37,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -51,7 +51,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $mapping = new CRM_Core_DAO_Mapping(); $mapping->copyValues($params); if ($mapping->find(TRUE)) { @@ -71,7 +71,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { * @static * */ - static function del($id) { + public static function del($id) { // delete from mapping_field table $mappingField = new CRM_Core_DAO_MappingField(); $mappingField->mapping_id = $id; @@ -102,7 +102,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { * @access public * @static */ - static function add($params) { + public static function add($params) { $mapping = new CRM_Core_DAO_Mapping(); $mapping->copyValues($params); $mapping->save(); @@ -119,7 +119,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { * @access public * @static */ - static function getMappings($mappingTypeId) { + public static function getMappings($mappingTypeId) { $mapping = array(); $mappingDAO = new CRM_Core_DAO_Mapping(); $mappingDAO->mapping_type_id = $mappingTypeId; @@ -141,7 +141,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { * @access public * @static */ - static function getMappingFields($mappingId) { + public static function getMappingFields($mappingId) { //mapping is to be loaded from database $mapping = new CRM_Core_DAO_MappingField(); $mapping->mapping_id = $mappingId; @@ -198,7 +198,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { * * @return boolean */ - static function checkMapping($nameField, $mapTypeId) { + public static function checkMapping($nameField, $mapTypeId) { $mapping = new CRM_Core_DAO_Mapping(); $mapping->name = $nameField; $mapping->mapping_type_id = $mapTypeId; @@ -213,7 +213,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { * @return array $returnFields associated array of elements@static * @public */ - static function getFormattedFields($smartGroupId) { + public static function getFormattedFields($smartGroupId) { $returnFields = array(); //get the fields from mapping table @@ -249,7 +249,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { * @access public * @static */ - static function buildMappingForm(&$form, $mappingType = 'Export', $mappingId = NULL, $columnNo, $blockCount = 3, $exportMode = NULL) { + public static function buildMappingForm(&$form, $mappingType = 'Export', $mappingId = NULL, $columnNo, $blockCount = 3, $exportMode = NULL) { if ($mappingType == 'Export') { $name = "Map"; $columnCount = array('1' => $columnNo); @@ -913,7 +913,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { * * @return array all custom field titles */ - function getRelationTypeCustomGroupData($relationshipTypeId) { + public function getRelationTypeCustomGroupData($relationshipTypeId) { $customFields = CRM_Core_BAO_CustomField::getFields('Relationship', NULL, NULL, $relationshipTypeId, NULL, NULL); $groupTitle = array(); @@ -931,7 +931,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { * * @return null|string $customGroupName all custom group names@static */ - static function getCustomGroupName($customfieldId) { + public static function getCustomGroupName($customfieldId) { if ($customFieldId = CRM_Core_BAO_CustomField::getKeyID($customfieldId)) { $customGroupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', $customFieldId, 'custom_group_id'); $customGroupName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $customGroupId, 'title'); @@ -954,7 +954,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { * @return array $returnFields formatted associated array of elements@static * @public */ - static function formattedFields(&$params, $row = FALSE) { + public static function formattedFields(&$params, $row = FALSE) { $fields = array(); if (empty($params) || !isset($params['mapper'])) { @@ -1087,7 +1087,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { * * @return array */ - static function &returnProperties(&$params) { + public static function &returnProperties(&$params) { $fields = array( 'contact_type' => 1, 'contact_sub_type' => 1, @@ -1151,7 +1151,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { * @static * @access public */ - static function saveMappingFields(&$params, $mappingId) { + public static function saveMappingFields(&$params, $mappingId) { //delete mapping fields records for exixting mapping $mappingFields = new CRM_Core_DAO_MappingField(); $mappingFields->mapping_id = $mappingId; diff --git a/CRM/Core/BAO/MessageTemplate.php b/CRM/Core/BAO/MessageTemplate.php index 7a35d5258b..3403ccc768 100644 --- a/CRM/Core/BAO/MessageTemplate.php +++ b/CRM/Core/BAO/MessageTemplate.php @@ -50,7 +50,7 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $messageTemplates = new CRM_Core_DAO_MessageTemplate(); $messageTemplates->copyValues($params); if ($messageTemplates->find(TRUE)) { @@ -69,7 +69,7 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate { * @return Object DAO object on sucess, null otherwise * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Core_DAO_MessageTemplate', $id, 'is_active', $is_active); } @@ -83,7 +83,7 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate { * * @return object */ - static function add(&$params) { + public static function add(&$params) { $hook = empty($params['id']) ? 'create' : 'edit'; CRM_Utils_Hook::pre($hook, 'MessageTemplate', CRM_Utils_Array::value('id', $params), $params); @@ -105,7 +105,7 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate { * * @return object */ - static function del($messageTemplatesID) { + public static function del($messageTemplatesID) { // make sure messageTemplatesID is an integer if (!CRM_Utils_Rule::positiveInteger($messageTemplatesID)) { CRM_Core_Error::fatal(ts('Invalid Message template')); @@ -135,7 +135,7 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate { * * @return object */ - static function getMessageTemplates($all = TRUE, $isSMS = FALSE) { + public static function getMessageTemplates($all = TRUE, $isSMS = FALSE) { $msgTpls = array(); $messageTemplates = new CRM_Core_DAO_MessageTemplate(); @@ -161,7 +161,7 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate { * * @return bool|null */ - static function sendReminder($contactId, $email, $messageTemplateID, $from) { + public static function sendReminder($contactId, $email, $messageTemplateID, $from) { $messageTemplates = new CRM_Core_DAO_MessageTemplate(); $messageTemplates->id = $messageTemplateID; @@ -278,7 +278,7 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate { * * @return void */ - static function revert($id) { + public static function revert($id) { $diverted = new self; $diverted->id = (int) $id; $diverted->find(1); @@ -310,7 +310,7 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate { * * @return array of four parameters: a boolean whether the email was sent, and the subject, text and HTML templates */ - static function sendTemplate($params) { + public static function sendTemplate($params) { $defaults = array( // option group name of the template 'groupName' => NULL, diff --git a/CRM/Core/BAO/Navigation.php b/CRM/Core/BAO/Navigation.php index f46c9c8231..b571a318dc 100644 --- a/CRM/Core/BAO/Navigation.php +++ b/CRM/Core/BAO/Navigation.php @@ -40,7 +40,7 @@ class CRM_Core_BAO_Navigation extends CRM_Core_DAO_Navigation { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -55,7 +55,7 @@ class CRM_Core_BAO_Navigation extends CRM_Core_DAO_Navigation { * @access public * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Core_DAO_Navigation', $id, 'is_active', $is_active); } @@ -65,7 +65,7 @@ class CRM_Core_BAO_Navigation extends CRM_Core_DAO_Navigation { * @static * @return array associated array */ - static function getMenus() { + public static function getMenus() { $menus = array(); $menu = new CRM_Core_DAO_Menu(); @@ -88,7 +88,7 @@ class CRM_Core_BAO_Navigation extends CRM_Core_DAO_Navigation { * @return object navigation object * @static */ - static function add(&$params) { + public static function add(&$params) { $navigation = new CRM_Core_DAO_Navigation(); $params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE); @@ -131,7 +131,7 @@ class CRM_Core_BAO_Navigation extends CRM_Core_DAO_Navigation { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $navigation = new CRM_Core_DAO_Navigation(); $navigation->copyValues($params); @@ -152,7 +152,7 @@ class CRM_Core_BAO_Navigation extends CRM_Core_DAO_Navigation { * * @return int $weight string@static */ - static function calculateWeight($parentID = NULL, $menuID = NULL) { + public static function calculateWeight($parentID = NULL, $menuID = NULL) { $domainID = CRM_Core_Config::domainID(); $weight = 1; @@ -177,7 +177,7 @@ class CRM_Core_BAO_Navigation extends CRM_Core_DAO_Navigation { * @return array $navigations returns associated array * @static */ - static function getNavigationList() { + public static function getNavigationList() { $cacheKeyString = "navigationList"; $whereClause = ''; @@ -217,7 +217,7 @@ FROM civicrm_navigation WHERE domain_id = $domainID {$whereClause} ORDER BY pare * @param array $navigations navigation menus * @param string $separator menu separator */ - static function _getNavigationLabel($list, &$navigations, $separator = '') { + public static function _getNavigationLabel($list, &$navigations, $separator = '') { $i18n = CRM_Core_I18n::singleton(); foreach ($list as $label => $val) { if ($label == 'navigation_id') { @@ -238,7 +238,7 @@ FROM civicrm_navigation WHERE domain_id = $domainID {$whereClause} ORDER BY pare * @param array $pidGroups parent menus * @return array */ - static function _getNavigationValue($val, &$pidGroups) { + public static function _getNavigationValue($val, &$pidGroups) { if (array_key_exists($val, $pidGroups)) { $list = array('navigation_id' => $val); foreach ($pidGroups[$val] as $label => $id) { @@ -262,7 +262,7 @@ FROM civicrm_navigation WHERE domain_id = $domainID {$whereClause} ORDER BY pare * @return array $navigationTree nested array of menus * @static */ - static function buildNavigationTree(&$navigationTree, $parentID, $navigationMenu = TRUE) { + public static function buildNavigationTree(&$navigationTree, $parentID, $navigationMenu = TRUE) { $whereClause = " parent_id IS NULL"; if ($parentID) { @@ -314,7 +314,7 @@ ORDER BY parent_id, weight"; * @return returns html or json object * @static */ - static function buildNavigation($json = FALSE, $navigationMenu = TRUE) { + public static function buildNavigation($json = FALSE, $navigationMenu = TRUE) { $navigations = array(); self::buildNavigationTree($navigations, $parent = NULL, $navigationMenu); $navigationString = NULL; @@ -378,7 +378,7 @@ ORDER BY parent_id, weight"; * @param boolean $skipMenuItems * @return string */ - static function recurseNavigation(&$value, &$navigationString, $json, $skipMenuItems) { + public static function recurseNavigation(&$value, &$navigationString, $json, $skipMenuItems) { if ($json) { if (!empty($value['child'])) { $navigationString .= ', "children": [ '; @@ -453,7 +453,7 @@ ORDER BY parent_id, weight"; * @param array $skipMenuItems * @return bool|string */ - static function getMenuName(&$value, &$skipMenuItems) { + public static function getMenuName(&$value, &$skipMenuItems) { // we need to localise the menu labels (CRM-5456) and don’t // want to use ts() as it would throw the ts-extractor off $i18n = CRM_Core_I18n::singleton(); @@ -566,7 +566,7 @@ ORDER BY parent_id, weight"; * @return string $navigation returns navigation html * @static */ - static function createNavigation($contactID) { + public static function createNavigation($contactID) { $config = CRM_Core_Config::singleton(); $navigation = self::buildNavigation(); @@ -628,7 +628,7 @@ ORDER BY parent_id, weight"; * @param integer $contactID - reset only entries belonging to that contact ID * @return string */ - static function resetNavigation($contactID = NULL) { + public static function resetNavigation($contactID = NULL) { $newKey = CRM_Utils_String::createRandom(self::CACHE_KEY_STRLEN, CRM_Utils_String::ALPHANUMERIC); if (!$contactID) { $query = "UPDATE civicrm_setting SET value = '$newKey' WHERE name='navigation' AND contact_id IS NOT NULL"; @@ -666,7 +666,7 @@ ORDER BY parent_id, weight"; * @return void * @static */ - static function processNavigation(&$params) { + public static function processNavigation(&$params) { $nodeID = (int)str_replace("node_", "", $params['id']); $referenceID = (int)str_replace("node_", "", $params['ref_id']); $position = $params['ps']; @@ -702,7 +702,7 @@ ORDER BY parent_id, weight"; * @return void * @static */ - static function processMove($nodeID, $referenceID, $position) { + public static function processMove($nodeID, $referenceID, $position) { // based on the new position we need to get the weight of the node after moved node // 1. update the weight of $position + 1 nodes to weight + 1 // 2. weight of the ( $position -1 ) node - 1 is the new weight of the node being moved @@ -761,7 +761,7 @@ ORDER BY parent_id, weight"; * @param int $nodeID * @param $label */ - static function processRename($nodeID, $label) { + public static function processRename($nodeID, $label) { CRM_Core_DAO::setFieldValue('CRM_Core_DAO_Navigation', $nodeID, 'label', $label); } @@ -770,7 +770,7 @@ ORDER BY parent_id, weight"; * * @param int $nodeID */ - static function processDelete($nodeID) { + public static function processDelete($nodeID) { $query = "DELETE FROM civicrm_navigation WHERE id = {$nodeID}"; CRM_Core_DAO::executeQuery($query); } @@ -783,7 +783,7 @@ ORDER BY parent_id, weight"; * @return array associated array * @static */ - static function getNavigationInfo($navigationID) { + public static function getNavigationInfo($navigationID) { $query = "SELECT parent_id, weight FROM civicrm_navigation WHERE id = %1"; $params = array($navigationID, 'Integer'); $dao = CRM_Core_DAO::executeQuery($query, array(1 => $params)); @@ -801,7 +801,7 @@ ORDER BY parent_id, weight"; * @param array $newParams new value of params * @static */ - static function processUpdate($params, $newParams) { + public static function processUpdate($params, $newParams) { $dao = new CRM_Core_DAO_Navigation(); $dao->copyValues($params); if ($dao->find(TRUE)) { @@ -815,7 +815,7 @@ ORDER BY parent_id, weight"; * * @return object|string */ - static function getCacheKey($cid) { + public static function getCacheKey($cid) { $key = CRM_Core_BAO_Setting::getItem( CRM_Core_BAO_Setting::PERSONAL_PREFERENCES_NAME, 'navigation', diff --git a/CRM/Core/BAO/Note.php b/CRM/Core/BAO/Note.php index e5c65c76ad..980a638148 100644 --- a/CRM/Core/BAO/Note.php +++ b/CRM/Core/BAO/Note.php @@ -54,7 +54,7 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note { * @access public * @static */ - static function getNoteText($id) { + public static function getNoteText($id) { return CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Note', $id, 'note'); } @@ -68,7 +68,7 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note { * @access public * @static */ - static function getNoteSubject($id) { + public static function getNoteSubject($id) { return CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Note', $id, 'subject'); } @@ -82,7 +82,7 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note { * @access public * @static */ - static function getNotePrivacyHidden($note) { + public static function getNotePrivacyHidden($note) { if (CRM_Core_Permission::check('view all notes')) { return FALSE; } @@ -138,7 +138,7 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note { * @access public * @static */ - static function &add(&$params, $ids = array()) { + public static function &add(&$params, $ids = array()) { $dataExists = self::dataExists($params); if (!$dataExists) { return CRM_Core_DAO::$_nullObject; @@ -225,7 +225,7 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note { * @access public * @static */ - static function dataExists(&$params) { + public static function dataExists(&$params) { // return if no data present if (!strlen($params['note'])) { return FALSE; @@ -245,7 +245,7 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note { * @access public * @static */ - static function &getValues(&$params, &$values, $numNotes = self::MAX_NOTES) { + public static function &getValues(&$params, &$values, $numNotes = self::MAX_NOTES) { if (empty($params)) { return NULL; } @@ -287,7 +287,7 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note { * @return mixed|null $return no of deleted notes on success, false otherwise@access public * @static */ - static function del($id, $showStatus = TRUE) { + public static function del($id, $showStatus = TRUE) { $return = NULL; $recent = array($id); $note = new CRM_Core_DAO_Note(); @@ -394,7 +394,7 @@ ORDER BY modified_date desc"; * @access public * @static */ - static function getContactNoteCount($contactID) { + public static function getContactNoteCount($contactID) { $note = new CRM_Core_DAO_Note(); $note->entity_id = $contactID; $note->entity_table = 'civicrm_contact'; @@ -543,7 +543,7 @@ ORDER BY modified_date desc"; * @return void * @static */ - static function cleanContactNotes($contactID) { + public static function cleanContactNotes($contactID) { $params = array(1 => array($contactID, 'Integer')); // delete all notes related to contribution diff --git a/CRM/Core/BAO/OpenID.php b/CRM/Core/BAO/OpenID.php index 4d421ed0fb..27b5bc1ee6 100644 --- a/CRM/Core/BAO/OpenID.php +++ b/CRM/Core/BAO/OpenID.php @@ -47,7 +47,7 @@ class CRM_Core_BAO_OpenID extends CRM_Core_DAO_OpenID { * @access public * @static */ - static function add(&$params) { + public static function add(&$params) { $hook = empty($params['id']) ? 'create' : 'edit'; CRM_Utils_Hook::pre($hook, 'OpenID', CRM_Utils_Array::value('id', $params), $params); @@ -69,7 +69,7 @@ class CRM_Core_BAO_OpenID extends CRM_Core_DAO_OpenID { * @access public * @static */ - static function &getValues($entityBlock) { + public static function &getValues($entityBlock) { return CRM_Core_BAO_Block::getValues('openid', $entityBlock); } @@ -82,7 +82,7 @@ class CRM_Core_BAO_OpenID extends CRM_Core_DAO_OpenID { * @access public * @static */ - static function isAllowedToLogin($identity_url) { + public static function isAllowedToLogin($identity_url) { $openId = new CRM_Core_DAO_OpenID(); $openId->openid = $identity_url; if ($openId->find(TRUE)) { @@ -102,7 +102,7 @@ class CRM_Core_BAO_OpenID extends CRM_Core_DAO_OpenID { * @access public * @static */ - static function allOpenIDs($id, $updateBlankLocInfo = FALSE) { + public static function allOpenIDs($id, $updateBlankLocInfo = FALSE) { if (!$id) { return NULL; } @@ -146,7 +146,7 @@ ORDER BY /** * Call common delete function */ - static function del($id) { + public static function del($id) { return CRM_Contact_BAO_Contact::deleteObjectWithPrimary('OpenID', $id); } } diff --git a/CRM/Core/BAO/OptionGroup.php b/CRM/Core/BAO/OptionGroup.php index 5d1e0abfa8..c93ddb0b69 100644 --- a/CRM/Core/BAO/OptionGroup.php +++ b/CRM/Core/BAO/OptionGroup.php @@ -37,7 +37,7 @@ class CRM_Core_BAO_OptionGroup extends CRM_Core_DAO_OptionGroup { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -51,7 +51,7 @@ class CRM_Core_BAO_OptionGroup extends CRM_Core_DAO_OptionGroup { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $optionGroup = new CRM_Core_DAO_OptionGroup(); $optionGroup->copyValues($params); if ($optionGroup->find(TRUE)) { @@ -70,7 +70,7 @@ class CRM_Core_BAO_OptionGroup extends CRM_Core_DAO_OptionGroup { * @return Object DAO object on sucess, null otherwise * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Core_DAO_OptionGroup', $id, 'is_active', $is_active); } @@ -85,7 +85,7 @@ class CRM_Core_BAO_OptionGroup extends CRM_Core_DAO_OptionGroup { * * @return object */ - static function add(&$params, $ids = array()) { + public static function add(&$params, $ids = array()) { if(empty($params['id'])){ $params['id'] = CRM_Utils_Array::value('optionGroup', $ids); } @@ -116,7 +116,7 @@ class CRM_Core_BAO_OptionGroup extends CRM_Core_DAO_OptionGroup { * @access public * @static */ - static function del($optionGroupId) { + public static function del($optionGroupId) { // need to delete all option value field before deleting group $optionValue = new CRM_Core_DAO_OptionValue(); $optionValue->option_group_id = $optionGroupId; @@ -137,7 +137,7 @@ class CRM_Core_BAO_OptionGroup extends CRM_Core_DAO_OptionGroup { * @access public * @static */ - static function getTitle($optionGroupId) { + public static function getTitle($optionGroupId) { $optionGroup = new CRM_Core_DAO_OptionGroup(); $optionGroup->id = $optionGroupId; $optionGroup->find(TRUE); diff --git a/CRM/Core/BAO/OptionValue.php b/CRM/Core/BAO/OptionValue.php index da6f8117f6..9d8917373e 100644 --- a/CRM/Core/BAO/OptionValue.php +++ b/CRM/Core/BAO/OptionValue.php @@ -37,7 +37,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -49,7 +49,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue { * * @return object */ - static function create($params) { + public static function create($params) { if (empty($params['id'])){ self::setDefaults($params); } @@ -72,7 +72,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue { * * @param array $params */ - static function setDefaults(&$params){ + public static function setDefaults(&$params){ if(CRM_Utils_Array::value('label', $params, NULL) === NULL){ $params['label'] = $params['name']; } @@ -97,7 +97,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue { * * @return int */ - static function getDefaultWeight($params){ + public static function getDefaultWeight($params){ return (int) CRM_Utils_Weight::getDefaultWeight('CRM_Core_DAO_OptionValue', array('option_group_id' => $params['option_group_id'])); } @@ -109,7 +109,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue { * more complex decision making * @param array $params */ - static function getDefaultValue($params){ + public static function getDefaultValue($params){ $bao = new CRM_Core_BAO_OptionValue(); $bao->option_group_id = $params['option_group_id']; if(isset($params['domain_id'])){ @@ -131,7 +131,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $optionValue = new CRM_Core_DAO_OptionValue(); $optionValue->copyValues($params); if ($optionValue->find(TRUE)) { @@ -150,7 +150,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue { * @return Object DAO object on sucess, null otherwise * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Core_DAO_OptionValue', $id, 'is_active', $is_active); } @@ -165,7 +165,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue { * * @return CRM_Core_DAO_OptionValue */ - static function add(&$params, &$ids) { + public static function add(&$params, &$ids) { // CRM-10921: do not reset attributes to default if this is an update //@todo consider if defaults are being set in the right place. 'dumb' defaults like // these would be usefully set @ the api layer so they are visible to api users @@ -231,7 +231,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue { * @access public * @static */ - static function del($optionValueId) { + public static function del($optionValueId) { $optionValue = new CRM_Core_DAO_OptionValue(); $optionValue->id = $optionValueId; if (self::updateRecords($optionValueId, CRM_Core_Action::DELETE)) { @@ -250,7 +250,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue { * @static * @access public */ - static function getActivityTypeDetails($activityTypeId) { + public static function getActivityTypeDetails($activityTypeId) { $query = "SELECT civicrm_option_value.label, civicrm_option_value.description FROM civicrm_option_value LEFT JOIN civicrm_option_group ON ( civicrm_option_value.option_group_id = civicrm_option_group.id ) @@ -287,7 +287,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue { * * @return bool */ - static function updateRecords(&$optionValueId, $action) { + public static function updateRecords(&$optionValueId, $action) { //finding group name $optionValue = new CRM_Core_DAO_OptionValue(); $optionValue->id = $optionValueId; @@ -418,7 +418,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue { * @access public * @static */ - static function updateOptionWeights($opGroupId, $opWeights) { + public static function updateOptionWeights($opGroupId, $opWeights) { if (!is_array($opWeights) || empty($opWeights)) { return; } @@ -446,7 +446,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue { * @static * @public */ - static function getOptionValuesArray($optionGroupID) { + public static function getOptionValuesArray($optionGroupID) { // check if we can get the field values from the system cache $cacheKey = "CRM_Core_BAO_OptionValue_OptionGroupID_{$optionGroupID}"; $cache = CRM_Utils_Cache::singleton(); @@ -479,7 +479,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue { * @static * @public */ - static function getOptionValuesAssocArray($optionGroupID) { + public static function getOptionValuesAssocArray($optionGroupID) { $optionValues = self::getOptionValuesArray($optionGroupID); $options = array(); @@ -498,7 +498,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue { * @static * @public */ - static function getOptionValuesAssocArrayFromName($optionGroupName) { + public static function getOptionValuesAssocArrayFromName($optionGroupName) { $dao = new CRM_Core_DAO_OptionGroup(); $dao->name = $optionGroupName; $dao->selectAdd(); diff --git a/CRM/Core/BAO/PaperSize.php b/CRM/Core/BAO/PaperSize.php index 5efc8783e2..7c41ab4646 100644 --- a/CRM/Core/BAO/PaperSize.php +++ b/CRM/Core/BAO/PaperSize.php @@ -95,7 +95,7 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { * @static * @access public */ - static function &addOrder(&$list, $returnURL) { + public static function &addOrder(&$list, $returnURL) { $filter = "option_group_id = " . self::_getGid(); CRM_Utils_Weight::addOrder($list, 'CRM_Core_DAO_OptionValue', 'id', $returnURL, $filter); } @@ -109,7 +109,7 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { * @static * @access public */ - static function &getList($namesOnly = FALSE) { + public static function &getList($namesOnly = FALSE) { static $list = array(); if (self::_getGid()) { // get saved Paper Sizes from Option Value table @@ -139,7 +139,7 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { * @static * @access public */ - static function &getDefaultValues() { + public static function &getDefaultValues() { $params = array('is_active' => 1, 'is_default' => 1); $defaults = array(); if (!self::retrieve($params, $defaults)) { @@ -161,7 +161,7 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { * @return array $values (reference) associative array of name/value pairs * @access public */ - static function &getPaperFormat($field, $val) { + public static function &getPaperFormat($field, $val) { $params = array('is_active' => 1, $field => $val); $paperFormat = array(); if (self::retrieve($params, $paperFormat)) { @@ -180,7 +180,7 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { * @return array $values (reference) associative array of name/value pairs * @access public */ - static function &getByName($name) { + public static function &getByName($name) { return self::getPaperFormat('name', $name); } @@ -192,7 +192,7 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { * @return array $values (reference) associative array of name/value pairs * @access public */ - static function &getById($id) { + public static function &getById($id) { return self::getPaperFormat('id', $id); } @@ -209,7 +209,7 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { * @access public * @static */ - static function getValue($field, &$values, $default = NULL) { + public static function getValue($field, &$values, $default = NULL) { if (array_key_exists($field, self::$optionValueFields)) { switch (self::$optionValueFields[$field]['type']) { case CRM_Utils_Type::T_INT: @@ -240,7 +240,7 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { * @access public * @static */ - static function retrieve(&$params, &$values) { + public static function retrieve(&$params, &$values) { $optionValue = new CRM_Core_DAO_OptionValue(); $optionValue->copyValues($params); $optionValue->option_group_id = self::_getGid(); @@ -275,7 +275,7 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { * @return void * @access public */ - function savePaperSize(&$values, $id) { + public function savePaperSize(&$values, $id) { // get the Option Group ID for Paper Sizes (create one if it doesn't exist) $group_id = self::_getGid(TRUE); @@ -334,7 +334,7 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { * @access public * @static */ - static function del($id) { + public static function del($id) { if ($id) { $dao = new CRM_Core_DAO_OptionValue(); $dao->id = $id; diff --git a/CRM/Core/BAO/PdfFormat.php b/CRM/Core/BAO/PdfFormat.php index 9a4c003a30..94eb28ddae 100644 --- a/CRM/Core/BAO/PdfFormat.php +++ b/CRM/Core/BAO/PdfFormat.php @@ -154,7 +154,7 @@ class CRM_Core_BAO_PdfFormat extends CRM_Core_DAO_OptionValue { * @static * @access public */ - static function addOrder(&$list, $returnURL) { + public static function addOrder(&$list, $returnURL) { $filter = "option_group_id = " . self::_getGid(); CRM_Utils_Weight::addOrder($list, 'CRM_Core_DAO_OptionValue', 'id', $returnURL, $filter); } @@ -168,7 +168,7 @@ class CRM_Core_BAO_PdfFormat extends CRM_Core_DAO_OptionValue { * @static * @access public */ - static function &getList($namesOnly = FALSE) { + public static function &getList($namesOnly = FALSE) { static $list = array(); if (self::_getGid()) { // get saved PDF Page Formats from Option Value table @@ -198,7 +198,7 @@ class CRM_Core_BAO_PdfFormat extends CRM_Core_DAO_OptionValue { * @static * @access public */ - static function &getDefaultValues() { + public static function &getDefaultValues() { $params = array('is_active' => 1, 'is_default' => 1); $defaults = array(); if (!self::retrieve($params, $defaults)) { @@ -223,7 +223,7 @@ class CRM_Core_BAO_PdfFormat extends CRM_Core_DAO_OptionValue { * @return array $values (reference) associative array of name/value pairs * @access public */ - static function &getPdfFormat($field, $val) { + public static function &getPdfFormat($field, $val) { $params = array('is_active' => 1, $field => $val); $pdfFormat = array(); if (self::retrieve($params, $pdfFormat)) { @@ -242,7 +242,7 @@ class CRM_Core_BAO_PdfFormat extends CRM_Core_DAO_OptionValue { * @return array $values (reference) associative array of name/value pairs * @access public */ - static function &getByName($name) { + public static function &getByName($name) { return self::getPdfFormat('name', $name); } @@ -254,7 +254,7 @@ class CRM_Core_BAO_PdfFormat extends CRM_Core_DAO_OptionValue { * @return array $values (reference) associative array of name/value pairs * @access public */ - static function &getById($id) { + public static function &getById($id) { return self::getPdfFormat('id', $id); } @@ -271,7 +271,7 @@ class CRM_Core_BAO_PdfFormat extends CRM_Core_DAO_OptionValue { * @access public * @static */ - static function getValue($field, &$values, $default = NULL) { + public static function getValue($field, &$values, $default = NULL) { if (array_key_exists($field, self::$optionValueFields)) { switch (self::$optionValueFields[$field]['type']) { case CRM_Utils_Type::T_INT: @@ -302,7 +302,7 @@ class CRM_Core_BAO_PdfFormat extends CRM_Core_DAO_OptionValue { * @access public * @static */ - static function retrieve(&$params, &$values) { + public static function retrieve(&$params, &$values) { $optionValue = new CRM_Core_DAO_OptionValue(); $optionValue->copyValues($params); $optionValue->option_group_id = self::_getGid(); @@ -337,7 +337,7 @@ class CRM_Core_BAO_PdfFormat extends CRM_Core_DAO_OptionValue { * @return void * @access public */ - function savePdfFormat(&$values, $id = NULL) { + public function savePdfFormat(&$values, $id = NULL) { // get the Option Group ID for PDF Page Formats (create one if it doesn't exist) $group_id = self::_getGid(); @@ -392,7 +392,7 @@ class CRM_Core_BAO_PdfFormat extends CRM_Core_DAO_OptionValue { * @access public * @static */ - static function del($id) { + public static function del($id) { if ($id) { $dao = new CRM_Core_DAO_OptionValue(); $dao->id = $id; diff --git a/CRM/Core/BAO/Persistent.php b/CRM/Core/BAO/Persistent.php index 5f303d06e7..d03c7110ff 100644 --- a/CRM/Core/BAO/Persistent.php +++ b/CRM/Core/BAO/Persistent.php @@ -44,7 +44,7 @@ class CRM_Core_BAO_Persistent extends CRM_Core_DAO_Persistent { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $dao = new CRM_Core_DAO_Persistent(); $dao->copyValues($params); @@ -69,7 +69,7 @@ class CRM_Core_BAO_Persistent extends CRM_Core_DAO_Persistent { * * @return object */ - static function add(&$params, &$ids) { + public static function add(&$params, &$ids) { if (CRM_Utils_Array::value('is_config', $params) == 1) { $params['data'] = serialize(explode(',', $params['data'])); } @@ -87,7 +87,7 @@ class CRM_Core_BAO_Persistent extends CRM_Core_DAO_Persistent { * * @return mixed */ - static function getContext($context, $name = NULL) { + public static function getContext($context, $name = NULL) { static $contextNameData = array(); if (!array_key_exists($context, $contextNameData)) { diff --git a/CRM/Core/BAO/Phone.php b/CRM/Core/BAO/Phone.php index d7191b2d85..5ceb44a923 100644 --- a/CRM/Core/BAO/Phone.php +++ b/CRM/Core/BAO/Phone.php @@ -50,7 +50,7 @@ class CRM_Core_BAO_Phone extends CRM_Core_DAO_Phone { * @return object * @throws API_Exception */ - static function create($params) { + public static function create($params) { // Ensure mysql phone function exists CRM_Core_DAO::checkSqlFunctionsExist(); @@ -74,7 +74,7 @@ class CRM_Core_BAO_Phone extends CRM_Core_DAO_Phone { * @access public * @static */ - static function add(&$params) { + public static function add(&$params) { // Ensure mysql phone function exists CRM_Core_DAO::checkSqlFunctionsExist(); @@ -99,7 +99,7 @@ class CRM_Core_BAO_Phone extends CRM_Core_DAO_Phone { * @access public * @static */ - static function &getValues($entityBlock) { + public static function &getValues($entityBlock) { $getValues = CRM_Core_BAO_Block::getValues('phone', $entityBlock); return $getValues; } @@ -117,7 +117,7 @@ class CRM_Core_BAO_Phone extends CRM_Core_DAO_Phone { * @access public * @static */ - static function allPhones($id, $updateBlankLocInfo = FALSE, $type = NULL, $filters = array()) { + public static function allPhones($id, $updateBlankLocInfo = FALSE, $type = NULL, $filters = array()) { if (!$id) { return NULL; } @@ -189,7 +189,7 @@ ORDER BY civicrm_phone.is_primary DESC, phone_id ASC "; * @access public * @static */ - static function allEntityPhones($entityElements, $type = NULL) { + public static function allEntityPhones($entityElements, $type = NULL) { if (empty($entityElements)) { return NULL; } @@ -242,7 +242,7 @@ ORDER BY ph.is_primary DESC, phone_id ASC "; * return void * @static */ - static function setOptionToNull($optionId) { + public static function setOptionToNull($optionId) { if (!$optionId) { return; } @@ -270,7 +270,7 @@ ORDER BY ph.is_primary DESC, phone_id ASC "; /** * Call common delete function */ - static function del($id) { + public static function del($id) { // Ensure mysql phone function exists CRM_Core_DAO::checkSqlFunctionsExist(); return CRM_Contact_BAO_Contact::deleteObjectWithPrimary('Phone', $id); diff --git a/CRM/Core/BAO/Preferences.php b/CRM/Core/BAO/Preferences.php index 811e3a77c6..3209643b2c 100644 --- a/CRM/Core/BAO/Preferences.php +++ b/CRM/Core/BAO/Preferences.php @@ -41,7 +41,7 @@ class CRM_Core_BAO_Preferences { /** * @param array $params */ - static function fixAndStoreDirAndURL(&$params) { + public static function fixAndStoreDirAndURL(&$params) { $sql = " SELECT v.name as valueName, g.name as optionName FROM civicrm_option_value v, @@ -81,7 +81,7 @@ AND v.is_active = 1 * @param array $params * @param string $type */ - static function storeDirectoryOrURLPreferences(&$params, $type = 'directory') { + public static function storeDirectoryOrURLPreferences(&$params, $type = 'directory') { $optionName = ($type == 'directory') ? 'directory_preferences' : 'url_preferences'; $sql = " @@ -114,7 +114,7 @@ AND v.name = %3 * @param array $params * @param bool $setInConfig */ - static function retrieveDirectoryAndURLPreferences(&$params, $setInConfig = FALSE) { + public static function retrieveDirectoryAndURLPreferences(&$params, $setInConfig = FALSE) { if ($setInConfig) { $config = CRM_Core_Config::singleton(); } diff --git a/CRM/Core/BAO/PreferencesDate.php b/CRM/Core/BAO/PreferencesDate.php index 6639a42cb0..165fed8bbe 100644 --- a/CRM/Core/BAO/PreferencesDate.php +++ b/CRM/Core/BAO/PreferencesDate.php @@ -42,7 +42,7 @@ class CRM_Core_BAO_PreferencesDate extends CRM_Core_DAO_PreferencesDate { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -56,7 +56,7 @@ class CRM_Core_BAO_PreferencesDate extends CRM_Core_DAO_PreferencesDate { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $dao = new CRM_Core_DAO_PreferencesDate(); $dao->copyValues($params); if ($dao->find(TRUE)) { @@ -77,7 +77,7 @@ class CRM_Core_BAO_PreferencesDate extends CRM_Core_DAO_PreferencesDate { * @access public * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { CRM_Core_Error::fatal(); } @@ -89,7 +89,7 @@ class CRM_Core_BAO_PreferencesDate extends CRM_Core_DAO_PreferencesDate { * @access public * @static */ - static function del($id) { + public static function del($id) { CRM_Core_Error::fatal(); } } diff --git a/CRM/Core/BAO/PrevNextCache.php b/CRM/Core/BAO/PrevNextCache.php index f52dfd5f46..bef0f7b062 100644 --- a/CRM/Core/BAO/PrevNextCache.php +++ b/CRM/Core/BAO/PrevNextCache.php @@ -49,7 +49,7 @@ class CRM_Core_BAO_PrevNextCache extends CRM_Core_DAO_PrevNextCache { * * @return array */ - static function getPositions($cacheKey, $id1, $id2, &$mergeId = NULL, $join = NULL, $where = NULL, $flip = FALSE) { + public static function getPositions($cacheKey, $id1, $id2, &$mergeId = NULL, $join = NULL, $where = NULL, $flip = FALSE) { if ($flip) { list($id1, $id2) = array($id2, $id1); } @@ -116,7 +116,7 @@ WHERE cacheKey = %3 AND * @param null $cacheKey * @param string $entityTable */ - static function deleteItem($id = NULL, $cacheKey = NULL, $entityTable = 'civicrm_contact') { + public static function deleteItem($id = NULL, $cacheKey = NULL, $entityTable = 'civicrm_contact') { //clear cache $sql = "DELETE FROM civicrm_prevnext_cache WHERE entity_table = %1"; @@ -141,7 +141,7 @@ WHERE cacheKey = %3 AND * @param bool $isViceVersa * @param string $entityTable */ - static function deletePair($id1, $id2, $cacheKey = NULL, $isViceVersa = FALSE, $entityTable = 'civicrm_contact') { + public static function deletePair($id1, $id2, $cacheKey = NULL, $isViceVersa = FALSE, $entityTable = 'civicrm_contact') { $sql = "DELETE FROM civicrm_prevnext_cache WHERE entity_table = %1"; $params = array(1 => array($entityTable, 'String')); @@ -170,7 +170,7 @@ WHERE cacheKey = %3 AND * * @return array */ - static function retrieve($cacheKey, $join = NULL, $where = NULL, $offset = 0, $rowCount = 0) { + public static function retrieve($cacheKey, $join = NULL, $where = NULL, $offset = 0, $rowCount = 0) { $query = " SELECT data FROM civicrm_prevnext_cache pn @@ -217,7 +217,7 @@ WHERE cacheKey = %1 /** * @param $values */ - static function setItem($values) { + public static function setItem($values) { $insert = "INSERT INTO civicrm_prevnext_cache ( entity_table, entity_id1, entity_id2, cacheKey, data ) VALUES \n"; $query = $insert . implode(",\n ", $values); @@ -233,7 +233,7 @@ WHERE cacheKey = %1 * * @return int */ - static function getCount($cacheKey, $join = NULL, $where = NULL, $op = "=") { + public static function getCount($cacheKey, $join = NULL, $where = NULL, $op = "=") { $query = " SELECT COUNT(*) FROM civicrm_prevnext_cache pn {$join} @@ -252,7 +252,7 @@ WHERE cacheKey $op %1 * @param int $gid * @param null $cacheKeyString */ - static function refillCache($rgid = NULL, $gid = NULL, $cacheKeyString = NULL) { + public static function refillCache($rgid = NULL, $gid = NULL, $cacheKeyString = NULL) { if (!$cacheKeyString && $rgid) { $contactType = CRM_Core_DAO::getFieldValue('CRM_Dedupe_DAO_RuleGroup', $rgid, 'contact_type'); $cacheKeyString = "merge {$contactType}"; @@ -321,7 +321,7 @@ WHERE cacheKey $op %1 } } - static function cleanupCache() { + public static function cleanupCache() { // clean up all prev next caches older than $cacheTimeIntervalDays days $cacheTimeIntervalDays = 2; @@ -348,7 +348,7 @@ AND c.created_date < date_sub( NOW( ), INTERVAL %2 day ) * @param array $cIds * @param string $entity_table */ - static function markSelection($cacheKey, $action = 'unselect', $cIds = NULL, $entity_table = 'civicrm_contact') { + public static function markSelection($cacheKey, $action = 'unselect', $cIds = NULL, $entity_table = 'civicrm_contact') { if (!$cacheKey) { return; } @@ -405,7 +405,7 @@ WHERE cacheKey LIKE %1 AND is_selected = 1 * * @return array */ - static function getSelection($cacheKey, $action = 'get', $entity_table = 'civicrm_contact') { + public static function getSelection($cacheKey, $action = 'get', $entity_table = 'civicrm_contact') { if (!$cacheKey) { return; } @@ -437,7 +437,7 @@ ORDER BY id /** * @return array */ - static function getSelectedContacts() { + public static function getSelectedContacts() { $qfKey = CRM_Utils_Request::retrieve('qfKey', 'String'); $cacheKey = "civicrm search {$qfKey}"; $query = " @@ -464,7 +464,7 @@ WHERE cacheKey LIKE %1 * * @return mixed */ - static function buildSelectedContactPager(&$form, &$params) { + public static function buildSelectedContactPager(&$form, &$params) { $params['status'] = ts('Contacts %%StatusMessage%%'); $params['csvString'] = NULL; $params['buttonTop'] = 'PagerTopButton'; diff --git a/CRM/Core/BAO/RecurringEntity.php b/CRM/Core/BAO/RecurringEntity.php index 993b23c0dc..c1055a9145 100644 --- a/CRM/Core/BAO/RecurringEntity.php +++ b/CRM/Core/BAO/RecurringEntity.php @@ -125,11 +125,11 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { ), ); - static function getStatus() { + public static function getStatus() { return self::$status; } - static function setStatus($status) { + public static function setStatus($status) { self::$status = $status; } /** @@ -142,7 +142,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * * @return object */ - static function add(&$params) { + public static function add(&$params) { if (CRM_Utils_Array::value('id', $params)) { CRM_Utils_Hook::pre('edit', 'RecurringEntity', $params['id'], $params); } @@ -176,7 +176,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * * @return object */ - static function quickAdd($parentId, $entityId, $entityTable) { + public static function quickAdd($parentId, $entityId, $entityTable) { $params = array( 'parent_id' => $parentId, @@ -195,7 +195,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * * @return void */ - function mode($mode) { + public function mode($mode) { if ($this->entity_id && $this->entity_table) { if ($this->find(TRUE)) { $this->mode = $mode; @@ -213,7 +213,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * * @return array */ - function generate() { + public function generate() { $this->generateRecursiveDates(); return $this->generateEntities(); @@ -224,7 +224,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * * @return object When object */ - function generateRecursion() { + public function generateRecursion() { // return if already generated if (is_a($this->recursion, 'When')) { return $this->recursion; @@ -249,7 +249,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * * @return array */ - function generateEntities() { + public function generateEntities() { self::setStatus(self::RUNNING); $newEntities = array(); @@ -315,7 +315,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * * @return array array of dates */ - function generateRecursiveDates() { + public function generateRecursiveDates() { $this->generateRecursion(); $recursionDates = array(); @@ -814,7 +814,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * * @return array */ - function mapFormValuesToDB($formParams = array()) { + public function mapFormValuesToDB($formParams = array()) { $dbParams = array(); if (CRM_Utils_Array::value('used_for', $formParams)) { $dbParams['used_for'] = $formParams['used_for']; @@ -917,7 +917,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * * @return array */ - function getScheduleParams($scheduleReminderId) { + public function getScheduleParams($scheduleReminderId) { $scheduleReminderDetails = array(); if ($scheduleReminderId) { //Get all the details from schedule reminder table @@ -935,7 +935,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * * @return object When object */ - function getRecursionFromSchedule($scheduleReminderDetails = array()) { + public function getRecursionFromSchedule($scheduleReminderDetails = array()) { $r = new When(); //If there is some data for this id if ($scheduleReminderDetails['repetition_frequency_unit']) { diff --git a/CRM/Core/BAO/SchemaHandler.php b/CRM/Core/BAO/SchemaHandler.php index bbb9d131f4..3715c63b20 100644 --- a/CRM/Core/BAO/SchemaHandler.php +++ b/CRM/Core/BAO/SchemaHandler.php @@ -71,7 +71,7 @@ class CRM_Core_BAO_SchemaHandler { * @static * @access public */ - static function createTable(&$params) { + public static function createTable(&$params) { $sql = self::buildTableSQL($params); // do not i18n-rewrite $dao = CRM_Core_DAO::executeQuery($sql, array(), TRUE, NULL, FALSE, FALSE); @@ -95,7 +95,7 @@ class CRM_Core_BAO_SchemaHandler { * * @return string */ - static function buildTableSQL(&$params) { + public static function buildTableSQL(&$params) { $sql = "CREATE TABLE {$params['name']} ("; if (isset($params['fields']) && is_array($params['fields']) @@ -132,7 +132,7 @@ class CRM_Core_BAO_SchemaHandler { * * @return string */ - static function buildFieldSQL(&$params, $separator, $prefix) { + public static function buildFieldSQL(&$params, $separator, $prefix) { $sql = ''; $sql .= $separator; $sql .= str_repeat(' ', 8); @@ -167,7 +167,7 @@ class CRM_Core_BAO_SchemaHandler { * * @return null|string */ - static function buildPrimaryKeySQL(&$params, $separator, $prefix) { + public static function buildPrimaryKeySQL(&$params, $separator, $prefix) { $sql = NULL; if (!empty($params['primary'])) { $sql .= $separator; @@ -186,7 +186,7 @@ class CRM_Core_BAO_SchemaHandler { * * @return null|string */ - static function buildSearchIndexSQL(&$params, $separator, $prefix, $indexExist = FALSE) { + public static function buildSearchIndexSQL(&$params, $separator, $prefix, $indexExist = FALSE) { $sql = NULL; // dont index blob @@ -218,7 +218,7 @@ class CRM_Core_BAO_SchemaHandler { * * @return string */ - static function buildIndexSQL(&$params, $separator, $prefix) { + public static function buildIndexSQL(&$params, $separator, $prefix) { $sql = ''; $sql .= $separator; $sql .= str_repeat(' ', 8); @@ -250,7 +250,7 @@ class CRM_Core_BAO_SchemaHandler { * * @return bool */ - static function changeFKConstraint($tableName, $fkTableName) { + public static function changeFKConstraint($tableName, $fkTableName) { $fkName = "{$tableName}_entity_id"; if (strlen($fkName) >= 48) { $fkName = substr($fkName, 0, 32) . "_" . substr(md5($fkName), 0, 16); @@ -280,7 +280,7 @@ ALTER TABLE {$tableName} * * @return null|string */ - static function buildForeignKeySQL(&$params, $separator, $prefix, $tableName) { + public static function buildForeignKeySQL(&$params, $separator, $prefix, $tableName) { $sql = NULL; if (!empty($params['fk_table_name']) && !empty($params['fk_field_name'])) { $sql .= $separator; @@ -304,7 +304,7 @@ ALTER TABLE {$tableName} * * @return bool */ - static function alterFieldSQL(&$params, $indexExist = FALSE, $triggerRebuild = TRUE) { + public static function alterFieldSQL(&$params, $indexExist = FALSE, $triggerRebuild = TRUE) { $sql = str_repeat(' ', 8); $sql .= "ALTER TABLE {$params['table_name']}"; @@ -371,7 +371,7 @@ ALTER TABLE {$tableName} * @static * @access public */ - static function dropTable($tableName) { + public static function dropTable($tableName) { $sql = "DROP TABLE $tableName"; $dao = CRM_Core_DAO::executeQuery($sql); } @@ -380,7 +380,7 @@ ALTER TABLE {$tableName} * @param string $tableName * @param string $columnName */ - static function dropColumn($tableName, $columnName) { + public static function dropColumn($tableName, $columnName) { $sql = "ALTER TABLE $tableName DROP COLUMN $columnName"; $dao = CRM_Core_DAO::executeQuery($sql); } @@ -389,7 +389,7 @@ ALTER TABLE {$tableName} * @param string $tableName * @param bool $dropUnique */ - static function changeUniqueToIndex($tableName, $dropUnique = TRUE) { + public static function changeUniqueToIndex($tableName, $dropUnique = TRUE) { if ($dropUnique) { $sql = "ALTER TABLE $tableName DROP INDEX `unique_entity_id` , @@ -408,7 +408,7 @@ ADD UNIQUE INDEX `unique_entity_id` ( `entity_id` )"; * @param string $createIndexPrefix * @param array $substrLenghts */ - static function createIndexes(&$tables, $createIndexPrefix = 'index', $substrLenghts = array()) { + public static function createIndexes(&$tables, $createIndexPrefix = 'index', $substrLenghts = array()) { $queries = array(); require_once 'CRM/Core/DAO/Domain.php'; $domain = new CRM_Core_DAO_Domain; @@ -475,7 +475,7 @@ ADD UNIQUE INDEX `unique_entity_id` ( `entity_id` )"; * * @throws Exception */ - static function alterFieldLength($customFieldID, $tableName, $columnName, $length) { + public static function alterFieldLength($customFieldID, $tableName, $columnName, $length) { // first update the custom field tables $sql = " UPDATE civicrm_custom_field diff --git a/CRM/Core/BAO/Setting.php b/CRM/Core/BAO/Setting.php index d1f7311197..63c9c4025b 100644 --- a/CRM/Core/BAO/Setting.php +++ b/CRM/Core/BAO/Setting.php @@ -114,7 +114,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { * Allow key o be cleared * @param string $cacheKey */ - static function flushCache($cacheKey){ + public static function flushCache($cacheKey){ unset(self::$_cache[$cacheKey]); $globalCache = CRM_Utils_Cache::singleton(); $globalCache->delete($cacheKey); @@ -261,7 +261,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { * @static * @access public */ - static function getItems(&$params, $domains = NULL, $settingsToReturn) { + public static function getItems(&$params, $domains = NULL, $settingsToReturn) { $originalDomain = CRM_Core_Config::domainID(); if (empty($domains)) { $domains[] = $originalDomain; @@ -448,7 +448,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { * @static * @access public */ - static function setItems(&$params, $domains = NULL) { + public static function setItems(&$params, $domains = NULL) { $originalDomain = CRM_Core_Config::domainID(); if (empty($domains)) { $domains[] = $originalDomain; @@ -515,7 +515,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { * @throws api_Exception * @return array $fieldstoset name => value array of the fields to be set (with extraneous removed) */ - static function validateSettingsInput($params, &$fields, $createMode = TRUE) { + public static function validateSettingsInput($params, &$fields, $createMode = TRUE) { $group = CRM_Utils_Array::value('group', $params); $ignoredParams = array( @@ -565,7 +565,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { * @value mixed value of the setting to be set * @fieldSpec array Metadata for given field (drawn from the xml) */ - static function validateSetting(&$value, $fieldSpec) { + public static function validateSetting(&$value, $fieldSpec) { if($fieldSpec['type'] == 'String' && is_array($value)){ $value = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,$value) . CRM_Core_DAO::VALUE_SEPARATOR; } @@ -586,7 +586,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { * @value mixed value of the setting to be set * @fieldSpec array Metadata for given field (drawn from the xml) */ - static function validateBoolSetting(&$value, $fieldSpec) { + public static function validateBoolSetting(&$value, $fieldSpec) { if (!CRM_Utils_Rule::boolean($value)) { throw new api_Exception("Boolean value required for {$fieldSpec['name']}"); } @@ -693,7 +693,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { /** * Load up settings metadata from files */ - static function loadSettingsMetadata($metaDataFolder) { + public static function loadSettingsMetadata($metaDataFolder) { $settingMetaData = array(); $settingsFiles = CRM_Utils_File::findFiles($metaDataFolder, '*.setting.php'); foreach ($settingsFiles as $file) { @@ -711,7 +711,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { * @param array $filters Filters to match against data * @param array $settingSpec metadata to filter */ - static function _filterSettingsSpecification($filters, &$settingSpec) { + public static function _filterSettingsSpecification($filters, &$settingSpec) { if (empty($filters)) { return; } @@ -736,7 +736,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { * Multisites have often been overlooked in upgrade scripts so can be expected to be missing * a number of settings */ - static function updateSettingsFromMetaData() { + public static function updateSettingsFromMetaData() { $apiParams = array( 'version' => 3, 'domain_id' => 'all', @@ -763,7 +763,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { * * Note that where the key name is being changed the 'legacy_key' will give us the old name */ - static function convertConfigToSetting($name, $domainID = NULL) { + public static function convertConfigToSetting($name, $domainID = NULL) { // we have to force this here in case more than one domain is in play. // whenever there is a possibility of more than one domain we must force it $config = CRM_Core_Config::singleton(); @@ -908,7 +908,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { * @param array $params * @param int $domainID */ - static function fixAndStoreDirAndURL(&$params, $domainID = NULL) { + public static function fixAndStoreDirAndURL(&$params, $domainID = NULL) { if (self::isUpgradeFromPreFourOneAlpha1()) { return; } @@ -983,7 +983,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { * @param array $params * @param $group */ - static function storeDirectoryOrURLPreferences(&$params, $group) { + public static function storeDirectoryOrURLPreferences(&$params, $group) { foreach ($params as $name => $value) { // always try to store relative directory or url from CMS root $value = ($group == self::DIRECTORY_PREFERENCES_NAME) ? CRM_Utils_File::relativeDirectory($value) : CRM_Utils_System::relativeURL($value); @@ -996,7 +996,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { * @param array $params * @param bool $setInConfig */ - static function retrieveDirectoryAndURLPreferences(&$params, $setInConfig = FALSE) { + public static function retrieveDirectoryAndURLPreferences(&$params, $setInConfig = FALSE) { if (CRM_Core_Config::isUpgradeMode()) { $isJoomla = (defined('CIVICRM_UF') && CIVICRM_UF == 'Joomla') ? TRUE : FALSE; // hack to set the resource base url so that js/ css etc is loaded correctly @@ -1088,7 +1088,7 @@ AND domain_id = %3 * * @return boolean */ - static function isUpgradeFromPreFourOneAlpha1() { + public static function isUpgradeFromPreFourOneAlpha1() { if (CRM_Core_Config::isUpgradeMode()) { $currentVer = CRM_Core_BAO_Domain::version(); if (version_compare($currentVer, '4.1.alpha1') < 0) { diff --git a/CRM/Core/BAO/Tag.php b/CRM/Core/BAO/Tag.php index 19abee26e3..3d875b77a6 100644 --- a/CRM/Core/BAO/Tag.php +++ b/CRM/Core/BAO/Tag.php @@ -37,7 +37,7 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -51,7 +51,7 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $tag = new CRM_Core_DAO_Tag(); $tag->copyValues($params); if ($tag->find(TRUE)) { @@ -67,7 +67,7 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { * * @return mixed */ - function getTree($usedFor = NULL, $excludeHidden = FALSE) { + public function getTree($usedFor = NULL, $excludeHidden = FALSE) { if (!isset($this->tree)) { $this->buildTree($usedFor, $excludeHidden); } @@ -79,7 +79,7 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { * @param null $usedFor * @param bool $excludeHidden */ - function buildTree($usedFor = NULL, $excludeHidden = FALSE) { + public function buildTree($usedFor = NULL, $excludeHidden = FALSE) { $sql = "SELECT id, parent_id, name, description, is_selectable FROM civicrm_tag"; $whereClause = array(); @@ -125,7 +125,7 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { * * @return array */ - static function getTagsUsedFor($usedFor = array('civicrm_contact'), + public static function getTagsUsedFor($usedFor = array('civicrm_contact'), $buildSelect = TRUE, $all = FALSE, $parentId = NULL @@ -315,7 +315,7 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { * @static * */ - static function del($id) { + public static function del($id) { // since this is a destructive operation, lets make sure // id is a postive number CRM_Utils_Type::validate($id, 'Positive'); @@ -353,7 +353,7 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { * @access public * @static */ - static function add(&$params, $ids = array()) { + public static function add(&$params, $ids = array()) { $id = CRM_Utils_Array::value('id', $params, CRM_Utils_Array::value('tag', $ids)); if (!$id && !self::dataExists($params)) { return NULL; @@ -403,7 +403,7 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { * @access public * @static */ - static function dataExists(&$params) { + public static function dataExists(&$params) { // Disallow empty values except for the number zero. // TODO: create a utility for this since it's needed in many places if (!empty($params['name']) || (string) $params['name'] === '0') { @@ -422,7 +422,7 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { * @access public * @static */ - static function getTagSet($entityTable) { + public static function getTagSet($entityTable) { $tagSets = array(); $query = "SELECT name, id FROM civicrm_tag WHERE is_tagset=1 AND parent_id IS NULL and used_for LIKE %1"; @@ -440,7 +440,7 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { * @return array $tags associated array of tag name and id@access public * @static */ - static function getTagsNotInTagset() { + public static function getTagsNotInTagset() { $tags = $tagSets = array(); // first get all the tag sets $query = "SELECT id FROM civicrm_tag WHERE is_tagset=1 AND parent_id IS NULL"; diff --git a/CRM/Core/BAO/UFField.php b/CRM/Core/BAO/UFField.php index 73fa6c4193..3bc3eae1d6 100644 --- a/CRM/Core/BAO/UFField.php +++ b/CRM/Core/BAO/UFField.php @@ -56,7 +56,7 @@ class CRM_Core_BAO_UFField extends CRM_Core_DAO_UFField { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { return CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_UFField', $params, $defaults); } @@ -85,7 +85,7 @@ class CRM_Core_BAO_UFField extends CRM_Core_DAO_UFField { * @access public * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { //check if custom data profile field is disabled if ($is_active) { if (CRM_Core_BAO_UFField::checkUFStatus($id)) { @@ -205,7 +205,7 @@ WHERE cf.id IN (" . $customFieldIds . ") AND is_multiple = 1 LIMIT 0,1"; * @static * */ - static function add(&$params, $ids = array()) { + public static function add(&$params, $ids = array()) { // set values for uf field properties and save $ufField = new CRM_Core_DAO_UFField(); $ufField->field_type = $params['field_name'][0]; @@ -277,7 +277,7 @@ WHERE cf.id IN (" . $customFieldIds . ") AND is_multiple = 1 LIMIT 0,1"; * @static * @access public */ - static function setUFField($customFieldId, $is_active) { + public static function setUFField($customFieldId, $is_active) { //find the profile id given custom field $ufField = new CRM_Core_DAO_UFField(); $ufField->field_name = "custom_" . $customFieldId; @@ -300,7 +300,7 @@ WHERE cf.id IN (" . $customFieldIds . ") AND is_multiple = 1 LIMIT 0,1"; * @static * @access public */ - static function copy($old_id, $new_id) { + public static function copy($old_id, $new_id) { $ufField = new CRM_Core_DAO_UFField(); $ufField->uf_group_id = $old_id; $ufField->find(); @@ -322,7 +322,7 @@ WHERE cf.id IN (" . $customFieldIds . ") AND is_multiple = 1 LIMIT 0,1"; * @static * @access public */ - static function delUFField($customFieldId) { + public static function delUFField($customFieldId) { //find the profile id given custom field id $ufField = new CRM_Core_DAO_UFField(); $ufField->field_name = "custom_" . $customFieldId; @@ -344,7 +344,7 @@ WHERE cf.id IN (" . $customFieldIds . ") AND is_multiple = 1 LIMIT 0,1"; * @static * @access public */ - static function setUFFieldStatus($customGroupId, $is_active) { + public static function setUFFieldStatus($customGroupId, $is_active) { //find the profile id given custom group id $queryString = "SELECT civicrm_custom_field.id as custom_field_id FROM civicrm_custom_field, civicrm_custom_group @@ -368,7 +368,7 @@ WHERE cf.id IN (" . $customFieldIds . ") AND is_multiple = 1 LIMIT 0,1"; * @static * @access public */ - static function checkUFStatus($UFFieldId) { + public static function checkUFStatus($UFFieldId) { $fieldName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFField', $UFFieldId, 'field_name'); // return if field is not a custom field if (!$customFieldId = CRM_Core_BAO_CustomField::getKeyID($fieldName)) { @@ -392,7 +392,7 @@ WHERE cf.id IN (" . $customFieldIds . ") AND is_multiple = 1 LIMIT 0,1"; * Find out whether given profile group using Activity * Profile fields with contact fields */ - static function checkContactActivityProfileType($ufGroupId) { + public static function checkContactActivityProfileType($ufGroupId) { $ufGroup = new CRM_Core_DAO_UFGroup(); $ufGroup->id = $ufGroupId; $ufGroup->find(TRUE); @@ -455,7 +455,7 @@ WHERE cf.id IN (" . $customFieldIds . ") AND is_multiple = 1 LIMIT 0,1"; * @return boolean $valid * @static */ - static function checkValidProfileType($ufGroupId, $required, $optional = NULL) { + public static function checkValidProfileType($ufGroupId, $required, $optional = NULL) { if (!is_array($required) || empty($required)) { return; } @@ -503,7 +503,7 @@ WHERE cf.id IN (" . $customFieldIds . ") AND is_multiple = 1 LIMIT 0,1"; * @access public * @static */ - static function checkProfileType($ufGroupId) { + public static function checkProfileType($ufGroupId) { $ufGroup = new CRM_Core_DAO_UFGroup(); $ufGroup->id = $ufGroupId; $ufGroup->find(TRUE); @@ -573,7 +573,7 @@ WHERE cf.id IN (" . $customFieldIds . ") AND is_multiple = 1 LIMIT 0,1"; * * TODO Why is this function in this class? It seems to be about the UFGroup. */ - static function getProfileType($ufGroupId, $returnMixType = TRUE, $onlyPure = FALSE, $skipComponentType = FALSE) { + public static function getProfileType($ufGroupId, $returnMixType = TRUE, $onlyPure = FALSE, $skipComponentType = FALSE) { $ufGroup = new CRM_Core_DAO_UFGroup(); $ufGroup->id = $ufGroupId; $ufGroup->is_active = 1; @@ -698,7 +698,7 @@ WHERE cf.id IN (" . $customFieldIds . ") AND is_multiple = 1 LIMIT 0,1"; * @access public * @static */ - static function checkProfileGroupType($ctype) { + public static function checkProfileGroupType($ctype) { $ufGroup = new CRM_Core_DAO_UFGroup(); $query = " @@ -732,7 +732,7 @@ SELECT ufg.id as id * * @return boolean $result true/false. */ - static function checkSearchableORInSelector($profileID) { + public static function checkSearchableORInSelector($profileID) { $result = FALSE; if (!$profileID) { return $result; @@ -760,7 +760,7 @@ SELECT id * * @return void. */ - function resetInSelectorANDSearchable($profileID) { + public function resetInSelectorANDSearchable($profileID) { if (!$profileID) { return; } @@ -790,7 +790,7 @@ SELECT id * * @return bool Can the address block be hidden safe in the knowledge all fields are elsewhere collected (see CRM-15118) */ - static function assignAddressField($key, &$profileAddressFields, $profileFilter) { + public static function assignAddressField($key, &$profileAddressFields, $profileFilter) { $billing_id = CRM_Core_BAO_LocationType::getBilling(); list($prefixName, $index) = CRM_Utils_System::explode('-', $key, 2); @@ -1071,7 +1071,7 @@ SELECT id * @param string $fieldName * @return bool */ - static function isValidFieldName($fieldName) { + public static function isValidFieldName($fieldName) { $availableFields = CRM_Core_BAO_UFField::getAvailableFieldsFlat(); return isset($availableFields[$fieldName]); } @@ -1079,7 +1079,7 @@ SELECT id /** * @return array|null */ - static function getContribBatchEntryFields() { + public static function getContribBatchEntryFields() { if (self::$_contriBatchEntryFields === NULL) { self::$_contriBatchEntryFields = array( 'send_receipt' => array( diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index af2ac14a09..e415ce1c87 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -58,7 +58,7 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { return CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_UFGroup', $params, $defaults); } @@ -69,7 +69,7 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { * * @return string contact type */ - static function getContactType($id) { + public static function getContactType($id) { $validTypes = array_filter(array_keys(CRM_Core_SelectValues::contactType())); $validSubTypes = CRM_Contact_BAO_ContactType::subTypeInfo(); @@ -117,7 +117,7 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { * @access public * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Core_DAO_UFGroup', $id, 'is_active', $is_active); } @@ -133,7 +133,7 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { * @static * @access public */ - static function getRegistrationFields($action, $mode, $ctype = NULL) { + public static function getRegistrationFields($action, $mode, $ctype = NULL) { if ($mode & CRM_Profile_Form::MODE_REGISTER) { $ufGroups = CRM_Core_BAO_UFGroup::getModuleUFGroup('User Registration'); } @@ -694,7 +694,7 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { * @static * @access public */ - static function isValid($userID, $title, $register = FALSE, $action = NULL) { + public static function isValid($userID, $title, $register = FALSE, $action = NULL) { if ($register) { $controller = new CRM_Core_Controller_Simple('CRM_Profile_Form_Dynamic', ts('Dynamic Form Creator'), @@ -1385,7 +1385,7 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { * * @return object */ - static function add(&$params, $ids = array()) { + public static function add(&$params, $ids = array()) { $fields = array('is_active', 'add_captcha', 'is_map', 'is_update_dupe', 'is_edit_link', 'is_uf_link', 'is_cms_user'); foreach ($fields as $field) { $params[$field] = CRM_Utils_Array::value($field, $params, FALSE); @@ -1427,7 +1427,7 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { * @access public * @static */ - static function createUFJoin(&$params, $ufGroupId) { + public static function createUFJoin(&$params, $ufGroupId) { $groupTypes = CRM_Utils_Array::value('uf_group_type', $params); // get ufjoin records for uf group @@ -1544,7 +1544,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * @access public * @static */ - static function addUFJoin(&$params) { + public static function addUFJoin(&$params) { $ufJoin = new CRM_Core_DAO_UFJoin(); $ufJoin->copyValues($params); $ufJoin->save(); @@ -1560,7 +1560,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * @access public * @static */ - static function delUFJoin(&$params) { + public static function delUFJoin(&$params) { $ufJoin = new CRM_Core_DAO_UFJoin(); $ufJoin->copyValues($params); $ufJoin->delete(); @@ -1575,7 +1575,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * @access public * @static */ - static function getWeight($ufGroupId = NULL) { + public static function getWeight($ufGroupId = NULL) { //calculate the weight $p = array(); if (!$ufGroupId) { @@ -1682,7 +1682,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * @static * @access public */ - static function filterUFGroups($ufGroupId, $contactID = NULL) { + public static function filterUFGroups($ufGroupId, $contactID = NULL) { if (!$contactID) { $session = CRM_Core_Session::singleton(); $contactID = $session->get('userID'); @@ -2483,7 +2483,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * @static * @access public */ - static function getProfiles($types, $onlyPure = FALSE) { + public static function getProfiles($types, $onlyPure = FALSE) { $profiles = array(); $ufGroups = CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id'); @@ -2512,7 +2512,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * @static * @access public */ - static function getValidProfiles($required, $optional = NULL) { + public static function getValidProfiles($required, $optional = NULL) { if (!is_array($required) || empty($required)) { return; } @@ -2543,7 +2543,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * @static * @access public */ - static function checkValidProfile($ufId, $required = NULL) { + public static function checkValidProfile($ufId, $required = NULL) { $validProfile = FALSE; if (!$ufId) { return $validProfile; @@ -2584,7 +2584,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * @return mixed $defaults@static * @access public */ - static function setRegisterDefaults(&$fields, &$defaults) { + public static function setRegisterDefaults(&$fields, &$defaults) { $config = CRM_Core_Config::singleton(); foreach ($fields as $name => $field) { if (substr($name, 0, 8) == 'country-') { @@ -2610,7 +2610,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * @return void * @access public */ - static function copy($id) { + public static function copy($id) { $fieldsFix = array('prefix' => array('title' => ts('Copy of '))); $copy = &CRM_Core_DAO::copyGeneric('CRM_Core_DAO_UFGroup', array('id' => $id), @@ -2669,7 +2669,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * @access public */ - static function commonSendMail($contactID, &$values) { + public static function commonSendMail($contactID, &$values) { if (!$contactID || !$values) { return; @@ -2729,7 +2729,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * @return array * @access public */ - function checkFieldsEmptyValues($gid, $cid, $params, $skipCheck = FALSE) { + public function checkFieldsEmptyValues($gid, $cid, $params, $skipCheck = FALSE) { if ($gid) { if (CRM_Core_BAO_UFGroup::filterUFGroups($gid, $cid) || $skipCheck) { $values = array(); @@ -2763,7 +2763,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * @return void * @access public */ - function profileDisplay($gid, $values, $template) { + public function profileDisplay($gid, $values, $template) { $groupTitle = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $gid, 'title'); $template->assign('grouptitle', $groupTitle); if (count($values)) { @@ -2782,7 +2782,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * @access public * @static */ - static function formatFields($params, $contactId = NULL) { + public static function formatFields($params, $contactId = NULL) { if ($contactId) { // get the primary location type id and email list($name, $primaryEmail, $primaryLocationType) = CRM_Contact_BAO_Contact_Location::getEmailDetails($contactId); @@ -2915,7 +2915,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * * @return array list of calculated group type */ - static function calculateGroupType($gId, $includeTypeValues = FALSE, $ignoreFieldId = NULL) { + public static function calculateGroupType($gId, $includeTypeValues = FALSE, $ignoreFieldId = NULL) { //get the profile fields. $ufFields = self::getFields($gId, FALSE, NULL, NULL, NULL, TRUE, NULL, TRUE); return self::_calculateGroupType($ufFields, $includeTypeValues, $ignoreFieldId); @@ -2930,7 +2930,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * * @return array list of calculated group type */ - static function _calculateGroupType($ufFields, $includeTypeValues = FALSE, $ignoreFieldId = NULL) { + public static function _calculateGroupType($ufFields, $includeTypeValues = FALSE, $ignoreFieldId = NULL) { $groupType = $groupTypeValues = $customFieldIds = array(); if (!empty($ufFields)) { foreach ($ufFields as $fieldName => $fieldValue) { @@ -2998,7 +2998,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * * @return Boolean */ - static function updateGroupTypes($gId, $groupTypes = array()) { + public static function updateGroupTypes($gId, $groupTypes = array()) { if (!is_array($groupTypes) || !$gId) { return FALSE; } @@ -3064,7 +3064,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * @return string * @throws CRM_Core_Exception */ - static function encodeGroupType($coreTypes, $subTypes, $delim = CRM_Core_DAO::VALUE_SEPARATOR) { + public static function encodeGroupType($coreTypes, $subTypes, $delim = CRM_Core_DAO::VALUE_SEPARATOR) { $groupTypeExpr = ''; if ($coreTypes) { $groupTypeExpr .= implode(',', $coreTypes); @@ -3227,7 +3227,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * * @return array */ - static function getCreateLinks($profiles = '', $appendProfiles = array()) { + public static function getCreateLinks($profiles = '', $appendProfiles = array()) { // Default to contact profiles if (!$profiles) { $profiles = array('new_individual', 'new_organization', 'new_household'); @@ -3270,7 +3270,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * @return array returns array * @static */ - static function profileGroups($profileID) { + public static function profileGroups($profileID) { $groupTypes = array(); $profileTypes = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $profileID, 'group_type'); if ($profileTypes) { @@ -3289,7 +3289,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * * @return array $subscribeGroupIds This contains array of groups for subscription */ - static function getDoubleOptInGroupIds(&$params, $contactId = NULL) { + public static function getDoubleOptInGroupIds(&$params, $contactId = NULL) { $config = CRM_Core_Config::singleton(); $subscribeGroupIds = array(); @@ -3363,7 +3363,7 @@ SELECT group_id * @static * @access public */ - static function checkForMixProfiles($profileIds) { + public static function checkForMixProfiles($profileIds) { $mixProfile = FALSE; $contactTypes = array('Individual', 'Household', 'Organization'); @@ -3414,7 +3414,7 @@ SELECT group_id * @static * @access public */ - static function showOverlayProfile() { + public static function showOverlayProfile() { $showOverlay = TRUE; // get the id of overlay profile @@ -3442,7 +3442,7 @@ SELECT group_id * @static * @access public */ - static function groupTypeValues($profileId, $groupType = NULL) { + public static function groupTypeValues($profileId, $groupType = NULL) { $groupTypeValue = array(); $groupTypes = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $profileId, 'group_type'); @@ -3484,7 +3484,7 @@ SELECT group_id /** * @return bool|object */ - static function isProfileDoubleOptin() { + public static function isProfileDoubleOptin() { // check for double optin $config = CRM_Core_Config::singleton(); if (in_array('CiviMail', $config->enableComponents)) { @@ -3498,7 +3498,7 @@ SELECT group_id /** * @return bool|object */ - static function isProfileAddToGroupDoubleOptin() { + public static function isProfileAddToGroupDoubleOptin() { // check for add to group double optin $config = CRM_Core_Config::singleton(); if (in_array('CiviMail', $config->enableComponents)) { @@ -3515,7 +3515,7 @@ SELECT group_id * @return array profileIds profile ids * @static */ - static function getBatchProfiles() { + public static function getBatchProfiles() { $query = "SELECT id FROM civicrm_uf_group WHERE name IN ('contribution_batch_entry', 'membership_batch_entry')"; @@ -3535,7 +3535,7 @@ SELECT group_id * * @return array|null */ - static function shiftMultiRecordFields(&$source, &$destination, $returnMultiSummaryFields = FALSE) { + public static function shiftMultiRecordFields(&$source, &$destination, $returnMultiSummaryFields = FALSE) { $multiSummaryFields = $returnMultiSummaryFields ? array( ) : NULL; foreach ($source as $field => $properties) { if (!CRM_Core_BAO_CustomField::getKeyID($field)) { @@ -3561,7 +3561,7 @@ SELECT group_id * * @static */ - static function reformatProfileFields(&$fields) { + public static function reformatProfileFields(&$fields) { //reformat fields array foreach ($fields as $name => $field) { //reformat phone and extension field diff --git a/CRM/Core/BAO/UFMatch.php b/CRM/Core/BAO/UFMatch.php index ea5a963656..49fb14650d 100644 --- a/CRM/Core/BAO/UFMatch.php +++ b/CRM/Core/BAO/UFMatch.php @@ -49,7 +49,7 @@ class CRM_Core_BAO_UFMatch extends CRM_Core_DAO_UFMatch { * * @return CRM_Core_DAO_UFMatch */ - static function create($params) { + public static function create($params) { $hook = empty($params['id']) ? 'create' : 'edit'; CRM_Utils_Hook::pre($hook, 'UFMatch', CRM_Utils_Array::value('id', $params), $params); if(empty($params['domain_id'])) { @@ -79,7 +79,7 @@ class CRM_Core_BAO_UFMatch extends CRM_Core_DAO_UFMatch { * @access public * @static */ - static function synchronize(&$user, $update, $uf, $ctype, $isLogin = FALSE) { + public static function synchronize(&$user, $update, $uf, $ctype, $isLogin = FALSE) { $userSystem = CRM_Core_Config::singleton()->userSystem; $session = CRM_Core_Session::singleton(); if (!is_object($session)) { @@ -185,7 +185,7 @@ class CRM_Core_BAO_UFMatch extends CRM_Core_DAO_UFMatch { * @access public * @static */ - static function &synchronizeUFMatch(&$user, $userKey, $uniqId, $uf, $status = NULL, $ctype = NULL, $isLogin = FALSE) { + public static function &synchronizeUFMatch(&$user, $userKey, $uniqId, $uf, $status = NULL, $ctype = NULL, $isLogin = FALSE) { $config = CRM_Core_Config::singleton(); if (!CRM_Utils_Rule::email($uniqId)) { @@ -365,7 +365,7 @@ AND domain_id = %4 * @access public * @static */ - static function updateUFName($contactId) { + public static function updateUFName($contactId) { if (!$contactId) { return; } @@ -420,7 +420,7 @@ AND domain_id = %4 * @access public * @static */ - static function updateContactEmail($contactId, $emailAddress) { + public static function updateContactEmail($contactId, $emailAddress) { $strtolower = function_exists('mb_strtolower') ? 'mb_strtolower' : 'strtolower'; $emailAddress = $strtolower($emailAddress); @@ -475,7 +475,7 @@ AND domain_id = %4 * @access public * @static */ - static function deleteUser($ufID) { + public static function deleteUser($ufID) { $ufmatch = new CRM_Core_DAO_UFMatch(); $ufmatch->uf_id = $ufID; @@ -492,7 +492,7 @@ AND domain_id = %4 * @access public * @static */ - static function getContactId($ufID) { + public static function getContactId($ufID) { if (!isset($ufID)) { return NULL; } @@ -516,7 +516,7 @@ AND domain_id = %4 * @access public * @static */ - static function getUFId($contactID) { + public static function getUFId($contactID) { if (!isset($contactID)) { return NULL; } @@ -534,7 +534,7 @@ AND domain_id = %4 /** * @return bool */ - static function isEmptyTable() { + public static function isEmptyTable() { $sql = "SELECT count(id) FROM civicrm_uf_match"; return CRM_Core_DAO::singleValueQuery($sql) > 0 ? FALSE : TRUE; } @@ -547,7 +547,7 @@ AND domain_id = %4 * @access public * @static */ - static function getContactIDs() { + public static function getContactIDs() { $id = array(); $dao = new CRM_Core_DAO_UFMatch(); $dao->find(); @@ -567,7 +567,7 @@ AND domain_id = %4 * @access public * @static */ - static function getAllowedToLogin($openId) { + public static function getAllowedToLogin($openId) { $ufmatch = new CRM_Core_DAO_UFMatch(); $ufmatch->uf_name = $openId; $ufmatch->allowed_to_login = 1; @@ -586,7 +586,7 @@ AND domain_id = %4 * @access public * @static */ - static function getNextUfIdValue() { + public static function getNextUfIdValue() { $query = "SELECT MAX(uf_id)+1 AS next_uf_id FROM civicrm_uf_match"; $dao = CRM_Core_DAO::executeQuery($query); if ($dao->fetch()) { @@ -604,7 +604,7 @@ AND domain_id = %4 * * @return bool */ - static function isDuplicateUser($email) { + public static function isDuplicateUser($email) { $session = CRM_Core_Session::singleton(); $contactID = $session->get('userID'); if (!empty($email) && isset($contactID)) { @@ -627,7 +627,7 @@ AND domain_id = %4 * * @return array */ - static function getUFValues($ufID = NULL) { + public static function getUFValues($ufID = NULL) { if (!$ufID) { //get logged in user uf id. $ufID = CRM_Utils_System::getLoggedInUfID(); diff --git a/CRM/Core/BAO/Website.php b/CRM/Core/BAO/Website.php index b9e05e0ae4..08fe9485d8 100644 --- a/CRM/Core/BAO/Website.php +++ b/CRM/Core/BAO/Website.php @@ -47,7 +47,7 @@ class CRM_Core_BAO_Website extends CRM_Core_DAO_Website { * @access public * @static */ - static function add(&$params) { + public static function add(&$params) { $hook = empty($params['id']) ? 'create' : 'edit'; CRM_Utils_Hook::pre($hook, 'Website', CRM_Utils_Array::value('id', $params), $params); @@ -71,7 +71,7 @@ class CRM_Core_BAO_Website extends CRM_Core_DAO_Website { * @access public * @static */ - static function create(&$params, $contactID, $skipDelete) { + public static function create(&$params, $contactID, $skipDelete) { if (empty($params)) { return FALSE; } @@ -118,7 +118,7 @@ class CRM_Core_BAO_Website extends CRM_Core_DAO_Website { * @return void * @static */ - static function del($ids) { + public static function del($ids) { $query = 'DELETE FROM civicrm_website WHERE id IN ( ' . implode(',', $ids) . ')'; CRM_Core_DAO::executeQuery($query); // FIXME: we should return false if the del was unsuccessful @@ -136,7 +136,7 @@ class CRM_Core_BAO_Website extends CRM_Core_DAO_Website { * @access public * @static */ - static function &getValues(&$params, &$values) { + public static function &getValues(&$params, &$values) { $websites = array(); $website = new CRM_Core_DAO_Website(); $website->contact_id = $params['contact_id']; @@ -165,7 +165,7 @@ class CRM_Core_BAO_Website extends CRM_Core_DAO_Website { * @access public * @static */ - static function allWebsites($id, $updateBlankLocInfo = FALSE) { + public static function allWebsites($id, $updateBlankLocInfo = FALSE) { if (!$id) { return NULL; } diff --git a/CRM/Core/BAO/WordReplacement.php b/CRM/Core/BAO/WordReplacement.php index dc65aacd30..2e8e728e97 100644 --- a/CRM/Core/BAO/WordReplacement.php +++ b/CRM/Core/BAO/WordReplacement.php @@ -47,7 +47,7 @@ class CRM_Core_BAO_WordReplacement extends CRM_Core_DAO_WordReplacement { /** * */ - function __construct() { + public function __construct() { parent::__construct(); } /** @@ -62,7 +62,7 @@ class CRM_Core_BAO_WordReplacement extends CRM_Core_DAO_WordReplacement { * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { return CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_WordRepalcement', $params, $defaults); } @@ -75,7 +75,7 @@ class CRM_Core_BAO_WordReplacement extends CRM_Core_DAO_WordReplacement { * @access public * @static */ - static function getWordReplacement($reset = NULL) { + public static function getWordReplacement($reset = NULL) { static $wordReplacement = NULL; if (!$wordReplacement || $reset) { $wordReplacement = new CRM_Core_BAO_WordReplacement(); @@ -97,7 +97,7 @@ class CRM_Core_BAO_WordReplacement extends CRM_Core_DAO_WordReplacement { * @return WordReplacement array * @access public */ - static function edit(&$params, &$id) { + public static function edit(&$params, &$id) { $wordReplacement = new CRM_Core_DAO_WordReplacement(); $wordReplacement->id = $id; $wordReplacement->copyValues($params); @@ -116,7 +116,7 @@ class CRM_Core_BAO_WordReplacement extends CRM_Core_DAO_WordReplacement { * @return WordReplacement array * @access public */ - static function create($params) { + public static function create($params) { if(array_key_exists("domain_id",$params) === FALSE) { $params["domain_id"] = CRM_Core_Config::domainID(); } @@ -137,7 +137,7 @@ class CRM_Core_BAO_WordReplacement extends CRM_Core_DAO_WordReplacement { * @return object * @static */ - static function del($id) { + public static function del($id) { $dao = new CRM_Core_DAO_WordReplacement(); $dao->id = $id; $dao->delete(); @@ -195,7 +195,7 @@ WHERE domain_id = %1 /** * Rebuild */ - static function rebuild($clearCaches = TRUE) { + public static function rebuild($clearCaches = TRUE) { $id = CRM_Core_Config::domainID(); $stringOverride = self::getAllAsConfigArray($id); $params = array('locale_custom_strings' => serialize($stringOverride)); @@ -231,7 +231,7 @@ WHERE domain_id = %1 * @return array Each item is $params for WordReplacement.create * @see CRM_Core_BAO_WordReplacement::convertConfigArraysToAPIParams */ - static function getConfigArraysAsAPIParams($rebuildEach) { + public static function getConfigArraysAsAPIParams($rebuildEach) { $wordReplacementCreateParams = array(); // get all domains $result = civicrm_api3('domain', 'get', array( diff --git a/CRM/Core/Base.php b/CRM/Core/Base.php index a8b7f9c758..99fcce5cbc 100644 --- a/CRM/Core/Base.php +++ b/CRM/Core/Base.php @@ -46,6 +46,6 @@ class CRM_Core_Base { /** * Constructor */ - function __construct() {} + public function __construct() {} } diff --git a/CRM/Core/Block.php b/CRM/Core/Block.php index 3bb44fd75f..bec00e3862 100644 --- a/CRM/Core/Block.php +++ b/CRM/Core/Block.php @@ -63,14 +63,14 @@ class CRM_Core_Block { * Class constructor * */ - function __construct() {} + public function __construct() {} /** * Initialises the $_properties array * * @return void */ - static function initProperties() { + public static function initProperties() { if (!defined('BLOCK_CACHE_GLOBAL')) { define('BLOCK_CACHE_GLOBAL', 0x0008); } @@ -187,7 +187,7 @@ class CRM_Core_Block { * * @return string the value of the desired property */ - static function getProperty($id, $property) { + public static function getProperty($id, $property) { if (!(self::$_properties)) { self::initProperties(); } @@ -203,7 +203,7 @@ class CRM_Core_Block { * * @return void */ - static function setProperty($id, $property, $value) { + public static function setProperty($id, $property, $value) { if (!(self::$_properties)) { self::initProperties(); } @@ -215,7 +215,7 @@ class CRM_Core_Block { * * @return array the $_properties array */ - static function properties() { + public static function properties() { if (!(self::$_properties)) { self::initProperties(); } @@ -228,7 +228,7 @@ class CRM_Core_Block { * @return array * @access public */ - static function getInfo() { + public static function getInfo() { $block = array(); foreach (self::properties() as $id => $value) { @@ -572,7 +572,7 @@ class CRM_Core_Block { * @return array * @access public */ - static function getContent($id) { + public static function getContent($id) { // return if upgrade mode $config = CRM_Core_Config::singleton(); if ($config->isUpgradeMode()) { @@ -652,7 +652,7 @@ class CRM_Core_Block { * @return array * @access public */ - static function fetch($id, $fileName, $properties) { + public static function fetch($id, $fileName, $properties) { $template = CRM_Core_Smarty::singleton(); if ($properties) { diff --git a/CRM/Core/ClassLoader.php b/CRM/Core/ClassLoader.php index 434b88a7da..60d4df2ac5 100644 --- a/CRM/Core/ClassLoader.php +++ b/CRM/Core/ClassLoader.php @@ -48,7 +48,7 @@ class CRM_Core_ClassLoader { * * @return object */ - static function &singleton($force = FALSE) { + public static function &singleton($force = FALSE) { if ($force || self::$_singleton === NULL) { self::$_singleton = new CRM_Core_ClassLoader(); } @@ -74,7 +74,7 @@ class CRM_Core_ClassLoader { * * @api */ - function register($prepend = FALSE) { + public function register($prepend = FALSE) { if ($this->_registered) { return; } @@ -102,7 +102,7 @@ class CRM_Core_ClassLoader { require_once "$civicrm_base_path/packages/vendor/autoload.php"; } - function initHtmlPurifier($prepend) { + public function initHtmlPurifier($prepend) { if (class_exists('HTMLPurifier_Bootstrap')) { // HTMLPurifier is already initialized, e.g. by the Drupal module. return; @@ -149,7 +149,7 @@ class CRM_Core_ClassLoader { /** * @param $class */ - function loadClass($class) { + public function loadClass($class) { if ( // Only load classes that clearly belong to CiviCRM. // Note: api/v3 does not use classes, but api_v3's test-suite does diff --git a/CRM/Core/CodeGen/BaseTask.php b/CRM/Core/CodeGen/BaseTask.php index 0e731fbcce..98dfe73a6a 100644 --- a/CRM/Core/CodeGen/BaseTask.php +++ b/CRM/Core/CodeGen/BaseTask.php @@ -9,7 +9,7 @@ abstract class CRM_Core_CodeGen_BaseTask implements CRM_Core_CodeGen_ITask { /** * */ - function __construct() { + public function __construct() { } // TODO: this is the most rudimentary possible hack. CG config should @@ -17,7 +17,7 @@ abstract class CRM_Core_CodeGen_BaseTask implements CRM_Core_CodeGen_ITask { /** * @param is $config */ - function setConfig($config) { + public function setConfig($config) { $this->config = $config; $this->tables = $this->config->tables; } diff --git a/CRM/Core/CodeGen/Config.php b/CRM/Core/CodeGen/Config.php index de7ae4b99a..39a5900fa7 100644 --- a/CRM/Core/CodeGen/Config.php +++ b/CRM/Core/CodeGen/Config.php @@ -4,17 +4,17 @@ * Generate configuration files */ class CRM_Core_CodeGen_Config extends CRM_Core_CodeGen_BaseTask { - function run() { + public function run() { $this->generateTemplateVersion(); $this->setupCms(); } - function generateTemplateVersion() { + public function generateTemplateVersion() { file_put_contents($this->config->tplCodePath . "/CRM/common/version.tpl", $this->config->db_version); } - function setupCms() { + public function setupCms() { if (!in_array($this->config->cms, array( 'drupal', 'joomla', 'wordpress'))) { echo "Config file for '{$this->config->cms}' not known."; diff --git a/CRM/Core/CodeGen/DAO.php b/CRM/Core/CodeGen/DAO.php index 5ee51d9c0b..ea04ce8459 100644 --- a/CRM/Core/CodeGen/DAO.php +++ b/CRM/Core/CodeGen/DAO.php @@ -4,11 +4,11 @@ * Create DAO ORM classes. */ class CRM_Core_CodeGen_DAO extends CRM_Core_CodeGen_BaseTask { - function run() { + public function run() { $this->generateDAOs(); } - function generateDAOs() { + public function generateDAOs() { foreach (array_keys($this->tables) as $name) { echo "Generating $name as " . $this->tables[$name]['fileName'] . "\n"; diff --git a/CRM/Core/CodeGen/I18n.php b/CRM/Core/CodeGen/I18n.php index 42aa2e0af3..f450a99d42 100644 --- a/CRM/Core/CodeGen/I18n.php +++ b/CRM/Core/CodeGen/I18n.php @@ -4,12 +4,12 @@ * Generate language files and classes */ class CRM_Core_CodeGen_I18n extends CRM_Core_CodeGen_BaseTask { - function run() { + public function run() { $this->generateInstallLangs(); $this->generateSchemaStructure(); } - function generateInstallLangs() { + public function generateInstallLangs() { // CRM-7161: generate install/langs.php from the languages template // grep it for enabled languages and create a 'xx_YY' => 'Language name' $langs mapping $matches = array(); @@ -21,7 +21,7 @@ class CRM_Core_CodeGen_I18n extends CRM_Core_CodeGen_BaseTask { file_put_contents('../install/langs.php', "CoreDAOCodePath = $CoreDAOCodePath; $this->sqlCodePath = $sqlCodePath; $this->phpCodePath = $phpCodePath; @@ -65,7 +65,7 @@ class CRM_Core_CodeGen_Main { * Automatically generate a variety of files * */ - function main() { + public function main() { if (!empty($this->digestPath) && file_exists($this->digestPath) && $this->hasExpectedFiles()) { if ($this->getDigest() === file_get_contents($this->digestPath)) { echo "GenCode has previously executed. To force execution, please (a) omit CIVICRM_GENCODE_DIGEST\n"; @@ -105,7 +105,7 @@ Alternatively you can get a version of CiviCRM that matches your PHP version } } - function runAllTasks() { + public function runAllTasks() { // TODO: This configuration can be manipulated dynamically. $components = $this->getTasks(); foreach ($components as $component) { @@ -142,7 +142,7 @@ Alternatively you can get a version of CiviCRM that matches your PHP version * * @return string */ - function getDigest() { + public function getDigest() { if ($this->digest === NULL) { $srcDir = CRM_Core_CodeGen_Util_File::findCoreSourceDir(); $files = CRM_Core_CodeGen_Util_File::findManyFiles(array( @@ -173,7 +173,7 @@ Alternatively you can get a version of CiviCRM that matches your PHP version /** * @return array */ - function getExpectedFiles() { + public function getExpectedFiles() { return array( $this->sqlCodePath . '/civicrm.mysql', $this->phpCodePath . '/CRM/Contact/DAO/Contact.php', @@ -183,7 +183,7 @@ Alternatively you can get a version of CiviCRM that matches your PHP version /** * @return bool */ - function hasExpectedFiles() { + public function hasExpectedFiles() { foreach ($this->getExpectedFiles() as $file) { if (!file_exists($file)) { return FALSE; diff --git a/CRM/Core/CodeGen/Reflection.php b/CRM/Core/CodeGen/Reflection.php index 1a70dafce1..d5902d1747 100644 --- a/CRM/Core/CodeGen/Reflection.php +++ b/CRM/Core/CodeGen/Reflection.php @@ -4,11 +4,11 @@ * Create classes which are used for schema introspection. */ class CRM_Core_CodeGen_Reflection extends CRM_Core_CodeGen_BaseTask { - function run() { + public function run() { $this->generateListAll(); } - function generateListAll() { + public function generateListAll() { $template = new CRM_Core_CodeGen_Util_Template('php'); $template->assign('tables', $this->tables); diff --git a/CRM/Core/CodeGen/Schema.php b/CRM/Core/CodeGen/Schema.php index 87487b6183..ee6eb8bcd5 100644 --- a/CRM/Core/CodeGen/Schema.php +++ b/CRM/Core/CodeGen/Schema.php @@ -7,12 +7,12 @@ class CRM_Core_CodeGen_Schema extends CRM_Core_CodeGen_BaseTask { /** * */ - function __construct() { + public function __construct() { parent::__construct(); $this->locales = $this->findLocales(); } - function run() { + public function run() { CRM_Core_CodeGen_Util_File::createDir($this->config->sqlCodePath); $this->generateCreateSql(); @@ -31,7 +31,7 @@ class CRM_Core_CodeGen_Schema extends CRM_Core_CodeGen_BaseTask { /** * @param string $fileName */ - function generateCreateSql($fileName = 'civicrm.mysql') { + public function generateCreateSql($fileName = 'civicrm.mysql') { echo "Generating sql file\n"; $template = new CRM_Core_CodeGen_Util_Template('sql'); @@ -47,7 +47,7 @@ class CRM_Core_CodeGen_Schema extends CRM_Core_CodeGen_BaseTask { /** * @param string $fileName */ - function generateDropSql($fileName = 'civicrm_drop.mysql') { + public function generateDropSql($fileName = 'civicrm_drop.mysql') { echo "Generating sql drop tables file\n"; $dropOrder = array_reverse(array_keys($this->tables)); $template = new CRM_Core_CodeGen_Util_Template('sql'); @@ -55,13 +55,13 @@ class CRM_Core_CodeGen_Schema extends CRM_Core_CodeGen_BaseTask { $template->run('drop.tpl', $this->config->sqlCodePath . $fileName); } - function generateNavigation() { + public function generateNavigation() { echo "Generating navigation file\n"; $template = new CRM_Core_CodeGen_Util_Template('sql'); $template->run('civicrm_navigation.tpl', $this->config->sqlCodePath . "civicrm_navigation.mysql"); } - function generateLocaleDataSql() { + public function generateLocaleDataSql() { $template = new CRM_Core_CodeGen_Util_Template('sql'); global $tsLocale; @@ -91,7 +91,7 @@ class CRM_Core_CodeGen_Schema extends CRM_Core_CodeGen_BaseTask { $tsLocale = $oldTsLocale; } - function generateSample() { + public function generateSample() { $template = new CRM_Core_CodeGen_Util_Template('sql'); $sections = array( 'civicrm_sample.tpl', @@ -105,7 +105,7 @@ class CRM_Core_CodeGen_Schema extends CRM_Core_CodeGen_BaseTask { /** * @return array */ - function findLocales() { + public function findLocales() { require_once 'CRM/Core/Config.php'; $config = CRM_Core_Config::singleton(FALSE); $locales = array(); diff --git a/CRM/Core/CodeGen/Specification.php b/CRM/Core/CodeGen/Specification.php index 97453d1803..53b47f8a00 100644 --- a/CRM/Core/CodeGen/Specification.php +++ b/CRM/Core/CodeGen/Specification.php @@ -15,7 +15,7 @@ class CRM_Core_CodeGen_Specification { * @param $schemaPath * @param string $buildVersion which version of the schema to build */ - function parse($schemaPath, $buildVersion) { + public function parse($schemaPath, $buildVersion) { $this->buildVersion = $buildVersion; echo "Parsing schema description ".$schemaPath."\n"; @@ -61,7 +61,7 @@ class CRM_Core_CodeGen_Specification { * * @return array */ - function &getDatabase(&$dbXML) { + public function &getDatabase(&$dbXML) { $database = array('name' => trim((string ) $dbXML->name)); $attributes = ''; @@ -86,7 +86,7 @@ class CRM_Core_CodeGen_Specification { * * @return array */ - function getTables($dbXML, &$database) { + public function getTables($dbXML, &$database) { $tables = array(); foreach ($dbXML->tables as $tablesXML) { foreach ($tablesXML->table as $tableXML) { @@ -107,7 +107,7 @@ class CRM_Core_CodeGen_Specification { * @param $tables * @param string $classNames */ - function resolveForeignKeys(&$tables, &$classNames) { + public function resolveForeignKeys(&$tables, &$classNames) { foreach (array_keys($tables) as $name) { $this->resolveForeignKey($tables, $classNames, $name); } @@ -118,7 +118,7 @@ class CRM_Core_CodeGen_Specification { * @param string $classNames * @param string $name */ - function resolveForeignKey(&$tables, &$classNames, $name) { + public function resolveForeignKey(&$tables, &$classNames, $name) { if (!array_key_exists('foreignKey', $tables[$name])) { return; } @@ -140,7 +140,7 @@ class CRM_Core_CodeGen_Specification { * * @return array */ - function orderTables(&$tables) { + public function orderTables(&$tables) { $ordered = array(); while (!empty($tables)) { @@ -161,7 +161,7 @@ class CRM_Core_CodeGen_Specification { * * @return bool */ - function validTable(&$tables, &$valid, $name) { + public function validTable(&$tables, &$valid, $name) { if (!array_key_exists('foreignKey', $tables[$name])) { return TRUE; } @@ -180,7 +180,7 @@ class CRM_Core_CodeGen_Specification { * @param $database * @param $tables */ - function getTable($tableXML, &$database, &$tables) { + public function getTable($tableXML, &$database, &$tables) { $name = trim((string ) $tableXML->name); $klass = trim((string ) $tableXML->class); $base = $this->value('base', $tableXML); @@ -280,7 +280,7 @@ class CRM_Core_CodeGen_Specification { * @param $fieldXML * @param $fields */ - function getField(&$fieldXML, &$fields) { + public function getField(&$fieldXML, &$fields) { $name = trim((string ) $fieldXML->name); $field = array('name' => $name, 'localizable' => $fieldXML->localizable); $type = (string ) $fieldXML->type; @@ -419,7 +419,7 @@ class CRM_Core_CodeGen_Specification { * * @return string */ - function composeTitle($name) { + public function composeTitle($name) { $names = explode('_', strtolower($name)); $title = ''; for ($i = 0; $i < count($names); $i++) { @@ -445,7 +445,7 @@ class CRM_Core_CodeGen_Specification { * @param $fields * @param $table */ - function getPrimaryKey(&$primaryXML, &$fields, &$table) { + public function getPrimaryKey(&$primaryXML, &$fields, &$table) { $name = trim((string ) $primaryXML->name); /** need to make sure there is a field of type name */ @@ -469,7 +469,7 @@ class CRM_Core_CodeGen_Specification { * @param $fields * @param $indices */ - function getIndex(&$indexXML, &$fields, &$indices) { + public function getIndex(&$indexXML, &$fields, &$indices) { //echo "\n\n*******************************************************\n"; //echo "entering getIndex\n"; @@ -536,7 +536,7 @@ class CRM_Core_CodeGen_Specification { * @param $foreignKeys * @param string $currentTableName */ - function getForeignKey(&$foreignXML, &$fields, &$foreignKeys, &$currentTableName) { + public function getForeignKey(&$foreignXML, &$fields, &$foreignKeys, &$currentTableName) { $name = trim((string ) $foreignXML->name); /** need to make sure there is a field of type name */ @@ -565,7 +565,7 @@ class CRM_Core_CodeGen_Specification { * @param $foreignXML * @param $dynamicForeignKeys */ - function getDynamicForeignKey(&$foreignXML, &$dynamicForeignKeys) { + public function getDynamicForeignKey(&$foreignXML, &$dynamicForeignKeys) { $foreignKey = array( 'idColumn' => trim($foreignXML->idColumn), 'typeColumn' => trim($foreignXML->typeColumn), diff --git a/CRM/Core/CodeGen/Test.php b/CRM/Core/CodeGen/Test.php index 3754ae93b2..ef123597fd 100644 --- a/CRM/Core/CodeGen/Test.php +++ b/CRM/Core/CodeGen/Test.php @@ -4,11 +4,11 @@ * Generate files used during testing. */ class CRM_Core_CodeGen_Test extends CRM_Core_CodeGen_BaseTask { - function run() { + public function run() { $this->generateCiviTestTruncate(); } - function generateCiviTestTruncate() { + public function generateCiviTestTruncate() { echo "Generating tests truncate file\n"; # TODO template diff --git a/CRM/Core/CodeGen/Util/File.php b/CRM/Core/CodeGen/Util/File.php index 5784c7ccdf..d68c14050a 100644 --- a/CRM/Core/CodeGen/Util/File.php +++ b/CRM/Core/CodeGen/Util/File.php @@ -8,7 +8,7 @@ class CRM_Core_CodeGen_Util_File { * @param $dir * @param int $perm */ - static function createDir($dir, $perm = 0755) { + public static function createDir($dir, $perm = 0755) { if (!is_dir($dir)) { mkdir($dir, $perm, TRUE); } @@ -17,7 +17,7 @@ class CRM_Core_CodeGen_Util_File { /** * @param $dir */ - static function cleanTempDir($dir) { + public static function cleanTempDir($dir) { foreach (glob("$dir/*") as $tempFile) { unlink($tempFile); } @@ -34,7 +34,7 @@ class CRM_Core_CodeGen_Util_File { * * @return string */ - static function createTempDir($prefix) { + public static function createTempDir($prefix) { $newTempDir = tempnam(sys_get_temp_dir(), $prefix) . '.d'; if (file_exists($newTempDir)) { self::removeDir($newTempDir); @@ -52,7 +52,7 @@ class CRM_Core_CodeGen_Util_File { * * @return string */ - static function digestAll($files, $digest = 'md5') { + public static function digestAll($files, $digest = 'md5') { $buffer = ''; foreach ($files as $file) { $buffer .= $digest(file_get_contents($file)); @@ -66,7 +66,7 @@ class CRM_Core_CodeGen_Util_File { * @return string * @throws RuntimeException */ - static function findCoreSourceDir() { + public static function findCoreSourceDir() { $path = str_replace(DIRECTORY_SEPARATOR, '/', __DIR__); if (!preg_match(':(.*)/CRM/Core/CodeGen/Util:', $path, $matches)) { throw new RuntimeException("Failed to determine path of code-gen"); @@ -81,7 +81,7 @@ class CRM_Core_CodeGen_Util_File { * @param array $pairs each item is an array(0 => $searchBaseDir, 1 => $filePattern) * @return array of file paths */ - static function findManyFiles($pairs) { + public static function findManyFiles($pairs) { $files = array(); foreach ($pairs as $pair) { list ($dir, $pattern) = $pair; diff --git a/CRM/Core/CodeGen/Util/Smarty.php b/CRM/Core/CodeGen/Util/Smarty.php index 587f1257c8..1d6ddb92cf 100644 --- a/CRM/Core/CodeGen/Util/Smarty.php +++ b/CRM/Core/CodeGen/Util/Smarty.php @@ -25,25 +25,25 @@ class CRM_Core_CodeGen_Util_Smarty { private $compileDir; - function __destruct() { + public function __destruct() { if ($this->compileDir) { CRM_Core_CodeGen_Util_File::cleanTempDir($this->compileDir); } } - function setPluginDirs($pluginDirs) { + public function setPluginDirs($pluginDirs) { $this->smartyPluginDirs = $pluginDirs; $this->smarty = NULL; } - function getCompileDir() { + public function getCompileDir() { if ($this->compileDir === NULL) { $this->compileDir = CRM_Core_CodeGen_Util_File::createTempDir('templates_c_'); } return $this->compileDir; } - function getSmarty() { + public function getSmarty() { if ($this->smarty === NULL) { require_once 'Smarty/Smarty.class.php'; $this->smarty = new Smarty(); diff --git a/CRM/Core/CodeGen/Util/Template.php b/CRM/Core/CodeGen/Util/Template.php index 05603d6bd5..89985d1af9 100644 --- a/CRM/Core/CodeGen/Util/Template.php +++ b/CRM/Core/CodeGen/Util/Template.php @@ -12,7 +12,7 @@ class CRM_Core_CodeGen_Util_Template { /** * @param string $filetype */ - function __construct($filetype) { + public function __construct($filetype) { $this->filetype = $filetype; $this->smarty = CRM_Core_CodeGen_Util_Smarty::singleton()->getSmarty(); @@ -42,7 +42,7 @@ class CRM_Core_CodeGen_Util_Template { * @param array $inputs template filenames * @param string $outpath full path to the desired output file */ - function runConcat($inputs, $outpath) { + public function runConcat($inputs, $outpath) { if (file_exists($outpath)) { unlink($outpath); } @@ -56,7 +56,7 @@ class CRM_Core_CodeGen_Util_Template { * @param string $infile filename of the template, without a path * @param string $outpath full path to the desired output file */ - function run($infile, $outpath) { + public function run($infile, $outpath) { $renderedContents = $this->smarty->fetch($infile); if ($this->filetype === 'php') { @@ -73,7 +73,7 @@ class CRM_Core_CodeGen_Util_Template { * @param $key * @param $value */ - function assign($key, $value) { + public function assign($key, $value) { $this->smarty->assign_by_ref($key, $value); } diff --git a/CRM/Core/CodeGen/Util/Xml.php b/CRM/Core/CodeGen/Util/Xml.php index 9dc6092ea8..d58e43d156 100644 --- a/CRM/Core/CodeGen/Util/Xml.php +++ b/CRM/Core/CodeGen/Util/Xml.php @@ -9,7 +9,7 @@ class CRM_Core_CodeGen_Util_Xml { * * @return SimpleXMLElement|bool */ - static function parse($file) { + public static function parse($file) { $dom = new DomDocument(); $dom->load($file); $dom->xinclude(); diff --git a/CRM/Core/Component.php b/CRM/Core/Component.php index 6bafebe330..a245d68f90 100644 --- a/CRM/Core/Component.php +++ b/CRM/Core/Component.php @@ -75,7 +75,7 @@ class CRM_Core_Component { * * @return mixed */ - static function get($name, $attribute = NULL) { + public static function get($name, $attribute = NULL) { $comp = CRM_Utils_Array::value($name, self::_info()); if ($attribute) { return CRM_Utils_Array::value($attribute, $comp->info); @@ -151,7 +151,7 @@ class CRM_Core_Component { * * @return bool */ - static function invoke(&$args, $type) { + public static function invoke(&$args, $type) { $info = self::_info(); $config = CRM_Core_Config::singleton(); @@ -186,7 +186,7 @@ class CRM_Core_Component { /** * @return array */ - static function xmlMenu() { + public static function xmlMenu() { // lets build the menu for all components $info = self::getComponents(TRUE); @@ -204,7 +204,7 @@ class CRM_Core_Component { /** * @return array */ - static function &menu() { + public static function &menu() { $info = self::_info(); $items = array(); foreach ($info as $name => $comp) { @@ -223,7 +223,7 @@ class CRM_Core_Component { * @param $config * @param bool $oldMode */ - static function addConfig(&$config, $oldMode = FALSE) { + public static function addConfig(&$config, $oldMode = FALSE) { $info = self::_info(); foreach ($info as $name => $comp) { @@ -238,7 +238,7 @@ class CRM_Core_Component { * * @return mixed */ - static function getComponentID($componentName) { + public static function getComponentID($componentName) { $info = self::_info(); if (!empty($info[$componentName])) { return $info[$componentName]->componentID; @@ -253,7 +253,7 @@ class CRM_Core_Component { * * @return int|null|string */ - static function getComponentName($componentID) { + public static function getComponentName($componentID) { $info = self::_info(); $componentName = NULL; @@ -270,7 +270,7 @@ class CRM_Core_Component { /** * @return array */ - static function &getQueryFields() { + public static function &getQueryFields() { $info = self::_info(); $fields = array(); foreach ($info as $name => $comp) { @@ -287,7 +287,7 @@ class CRM_Core_Component { * @param $query * @param string $fnName */ - static function alterQuery(&$query, $fnName) { + public static function alterQuery(&$query, $fnName) { $info = self::_info(); foreach ($info as $name => $comp) { @@ -305,7 +305,7 @@ class CRM_Core_Component { * * @return null */ - static function from($fieldName, $mode, $side) { + public static function from($fieldName, $mode, $side) { $info = self::_info(); $from = NULL; @@ -348,7 +348,7 @@ class CRM_Core_Component { /** * @param CRM_Core_Form $form */ - static function &buildSearchForm(&$form) { + public static function &buildSearchForm(&$form) { $info = self::_info(); foreach ($info as $name => $comp) { @@ -363,7 +363,7 @@ class CRM_Core_Component { * @param $row * @param int $id */ - static function searchAction(&$row, $id) { + public static function searchAction(&$row, $id) { $info = self::_info(); foreach ($info as $name => $comp) { @@ -377,7 +377,7 @@ class CRM_Core_Component { /** * @return array|null */ - static function &contactSubTypes() { + public static function &contactSubTypes() { if (self::$_contactSubTypes == NULL) { self::$_contactSubTypes = array(); } @@ -391,7 +391,7 @@ class CRM_Core_Component { * * @return null */ - static function &contactSubTypeProperties($subType, $op) { + public static function &contactSubTypeProperties($subType, $op) { $properties = self::contactSubTypes(); if (array_key_exists($subType, $properties) && array_key_exists($op, $properties[$subType]) @@ -404,7 +404,7 @@ class CRM_Core_Component { /** * FIXME: This function does not appear to do anything. The is_array() check runs on a bunch of objects and (always?) returns false */ - static function &taskList() { + public static function &taskList() { $info = self::_info(); $tasks = array(); @@ -425,7 +425,7 @@ class CRM_Core_Component { * @access public * @static */ - static function tableNames(&$tables) { + public static function tableNames(&$tables) { $info = self::_info(); foreach ($info as $name => $comp) { @@ -440,7 +440,7 @@ class CRM_Core_Component { * Get components info from info file * */ - static function getComponentsFromFile($crmFolderDir) { + public static function getComponentsFromFile($crmFolderDir) { $components = array(); //traverse CRM folder and check for Info file if (is_dir($crmFolderDir)) { diff --git a/CRM/Core/Config.php b/CRM/Core/Config.php index 8c668688d0..1beaabadb3 100644 --- a/CRM/Core/Config.php +++ b/CRM/Core/Config.php @@ -193,7 +193,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables { * @return CRM_Core_Config * @static */ - static function &singleton($loadFromDB = TRUE, $force = FALSE) { + public static function &singleton($loadFromDB = TRUE, $force = FALSE) { if (self::$_singleton === NULL || $force) { // goto a simple error handler $GLOBALS['civicrm_default_error_scope'] = CRM_Core_TemporaryErrorScope::create(array('CRM_Core_Error', 'handle')); @@ -541,7 +541,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables { * @access private * @return object */ - static function &getMailer($persist = FALSE) { + public static function &getMailer($persist = FALSE) { if (!isset(self::$_mail)) { $mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, 'mailing_backend' @@ -671,7 +671,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables { * @static * @access public */ - static function check(&$config, &$required) { + public static function check(&$config, &$required) { foreach ($required as $name) { if (CRM_Utils_System::isNull($config->$name)) { return FALSE; @@ -684,13 +684,13 @@ class CRM_Core_Config extends CRM_Core_Config_Variables { * Reset the serialized array and recompute * use with care */ - function reset() { + public function reset() { $query = "UPDATE civicrm_domain SET config_backend = null"; CRM_Core_DAO::executeQuery($query); } // This method should initialize auth sources - function initAuthSrc() { + public function initAuthSrc() { $session = CRM_Core_Session::singleton(); if ($session->get('userID') && !$session->get('authSrc')) { $session->set('authSrc', CRM_Core_Permission::AUTH_SRC_LOGIN); @@ -703,7 +703,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables { /** * One function to get domain ID */ - static function domainID($domainID = NULL, $reset = FALSE) { + public static function domainID($domainID = NULL, $reset = FALSE) { static $domain; if ($domainID) { $domain = $domainID; @@ -719,7 +719,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables { * Do general cleanup of caches, temp directories and temp tables * CRM-8739 */ - function cleanupCaches($sessionReset = TRUE) { + public function cleanupCaches($sessionReset = TRUE) { // cleanup templates_c directory $this->cleanup(1, FALSE); @@ -735,7 +735,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables { /** * Do general cleanup of module permissions. */ - function cleanupPermissions() { + public function cleanupPermissions() { $module_files = CRM_Extension_System::singleton()->getMapper()->getActiveModuleFiles(); if ($this->userPermissionClass->isModulePermissionSupported()) { // Can store permissions -- so do it! @@ -764,7 +764,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables { /** * Flush information about loaded modules */ - function clearModuleList() { + public function clearModuleList() { CRM_Extension_System::singleton()->getCache()->flush(); CRM_Utils_Hook::singleton(TRUE); CRM_Core_PseudoConstant::getModuleExtensions(TRUE); @@ -829,7 +829,7 @@ AND /** * Check if running in upgrade mode */ - static function isUpgradeMode($path = NULL) { + public static function isUpgradeMode($path = NULL) { if (defined('CIVICRM_UPGRADE_ACTIVE')) { return TRUE; } @@ -865,7 +865,7 @@ AND * it? * @return bool */ - static function isEnabledBackOfficeCreditCardPayments() { + public static function isEnabledBackOfficeCreditCardPayments() { return CRM_Financial_BAO_PaymentProcessor::hasPaymentProcessorSupporting(array('BackOffice')); } } diff --git a/CRM/Core/Config/Defaults.php b/CRM/Core/Config/Defaults.php index 507cbe6cde..6e61e4b80c 100644 --- a/CRM/Core/Config/Defaults.php +++ b/CRM/Core/Config/Defaults.php @@ -42,7 +42,7 @@ */ class CRM_Core_Config_Defaults { - function setCoreVariables() { + public function setCoreVariables() { global $civicrm_root; // set of base directories relying on $civicrm_root diff --git a/CRM/Core/Controller.php b/CRM/Core/Controller.php index 10c952551d..657c62dd51 100644 --- a/CRM/Core/Controller.php +++ b/CRM/Core/Controller.php @@ -274,7 +274,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { ); } - function fini() { + public function fini() { CRM_Core_BAO_Cache::storeSessionToCache(array( "_{$this->_name}_container", array('CiviCRM', $this->_scope), @@ -290,7 +290,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * * @return mixed|string */ - function key($name, $addSequence = FALSE, $ignoreKey = FALSE) { + public function key($name, $addSequence = FALSE, $ignoreKey = FALSE) { $config = CRM_Core_Config::singleton(); if ( @@ -329,7 +329,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * jump action * */ - function run() { + public function run() { // the names of the action and page should be saved // note that this is split into two, because some versions of // php 5.x core dump on the triple assignment :) @@ -353,7 +353,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { /** * @return bool */ - function validate() { + public function validate() { $this->_actionName = $this->getActionName(); list($pageName, $action) = $this->_actionName; @@ -384,7 +384,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * @return void * */ - function addActions($uploadDirectory = NULL, $uploadNames = NULL) { + public function addActions($uploadDirectory = NULL, $uploadNames = NULL) { $names = array( 'display' => 'CRM_Core_QuickForm_Action_Display', 'next' => 'CRM_Core_QuickForm_Action_Next', @@ -412,7 +412,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * @return CRM_Core_StateMachine * @access public */ - function getStateMachine() { + public function getStateMachine() { return $this->_stateMachine; } @@ -424,7 +424,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * @return void * @access public */ - function setStateMachine($stateMachine) { + public function setStateMachine($stateMachine) { $this->_stateMachine = $stateMachine; } @@ -439,7 +439,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * @return void * @access public */ - function addPages(&$stateMachine, $action = CRM_Core_Action::NONE) { + public function addPages(&$stateMachine, $action = CRM_Core_Action::NONE) { $pages = $stateMachine->getPages(); foreach ($pages as $name => $value) { $className = CRM_Utils_Array::value('className', $value, $name); @@ -488,7 +488,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * @return string the name of the button that has been pressed by the user * @access public */ - function getButtonName() { + public function getButtonName() { $data = &$this->container(); return CRM_Utils_Array::value('_qf_button_name', $data); } @@ -500,7 +500,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * * @return void */ - function reset() { + public function reset() { $this->container(TRUE); self::$_session->resetScope($this->_scope); } @@ -515,7 +515,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * @return void * @access public */ - function process() {} + public function process() {} /** * Store the variable with the value in the form scope @@ -528,7 +528,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * @return void * */ - function set($name, $value = NULL) { + public function set($name, $value = NULL) { self::$_session->set($name, $value, $this->_scope); } @@ -543,7 +543,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * @return mixed * */ - function get($name) { + public function get($name) { return self::$_session->get($name, $this->_scope); } @@ -556,7 +556,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * @return array * @access public */ - function wizardHeader($currentPageName) { + public function wizardHeader($currentPageName) { $wizard = array(); $wizard['steps'] = array(); $count = 0; @@ -591,7 +591,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { /** * @param array $wizard */ - function addWizardStyle(&$wizard) { + public function addWizardStyle(&$wizard) { $wizard['style'] = array( 'barClass' => '', 'stepPrefixCurrent' => '»', @@ -613,7 +613,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * @return void * @access public */ - function assign($var, $value = NULL) { + public function assign($var, $value = NULL) { self::$_template->assign($var, $value); } @@ -626,7 +626,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * @return void * @access public */ - function assign_by_ref($var, &$value) { + public function assign_by_ref($var, &$value) { self::$_template->assign_by_ref($var, $value); } @@ -637,7 +637,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * @param mixed $value the value to append * @param bool $merge */ - function append($tpl_var, $value=NULL, $merge=FALSE) { + public function append($tpl_var, $value=NULL, $merge=FALSE) { self::$_template->append($tpl_var, $value, $merge); } @@ -648,7 +648,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * * @return array */ - function get_template_vars($name=null) { + public function get_template_vars($name=null) { return self::$_template->get_template_vars($name); } @@ -660,7 +660,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * @return void * @access public */ - function setEmbedded($embedded) { + public function setEmbedded($embedded) { $this->_embedded = $embedded; } @@ -670,7 +670,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * @return boolean return the embedded value * @access public */ - function getEmbedded() { + public function getEmbedded() { return $this->_embedded; } @@ -682,7 +682,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * @return void * @access public */ - function setSkipRedirection($skipRedirection) { + public function setSkipRedirection($skipRedirection) { $this->_skipRedirection = $skipRedirection; } @@ -692,14 +692,14 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * @return boolean return the skipRedirection value * @access public */ - function getSkipRedirection() { + public function getSkipRedirection() { return $this->_skipRedirection; } /** * @param null $fileName */ - function setWord($fileName = NULL) { + public function setWord($fileName = NULL) { //Mark as a CSV file. header('Content-Type: application/vnd.ms-word'); @@ -713,7 +713,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { /** * @param null $fileName */ - function setExcel($fileName = NULL) { + public function setExcel($fileName = NULL) { //Mark as an excel file. header('Content-Type: application/vnd.ms-excel'); @@ -733,7 +733,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * @return void * @access public */ - function setPrint($print) { + public function setPrint($print) { if ($print == "xls") { $this->setExcel(); } @@ -749,14 +749,14 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * @return boolean return the print value * @access public */ - function getPrint() { + public function getPrint() { return $this->_print; } /** * @return string */ - function getTemplateFile() { + public function getTemplateFile() { if ($this->_print) { if ($this->_print == CRM_Core_Smarty::PRINT_PAGE) { return 'CRM/common/print.tpl'; diff --git a/CRM/Core/Controller/Simple.php b/CRM/Core/Controller/Simple.php index 4e0ecedca7..0107416f46 100644 --- a/CRM/Core/Controller/Simple.php +++ b/CRM/Core/Controller/Simple.php @@ -129,7 +129,7 @@ class CRM_Core_Controller_Simple extends CRM_Core_Controller { * A wrapper for getTemplateFileName that includes calling the hook to * prevent us from having to copy & paste the logic of calling the hook */ - function getHookedTemplateFileName() { + public function getHookedTemplateFileName() { $pageTemplateFile = $this->getTemplateFileName(); CRM_Utils_Hook::alterTemplateFile(get_class($this), $this, 'page', $pageTemplateFile); return $pageTemplateFile; diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index caeada540e..6250086ca1 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -82,7 +82,7 @@ class CRM_Core_DAO extends DB_DataObject { * @return \CRM_Core_DAO @access public */ - function __construct() { + public function __construct() { $this->initialize(); $this->__table = $this->getTableName(); } @@ -90,7 +90,7 @@ class CRM_Core_DAO extends DB_DataObject { /** * Empty definition for virtual function */ - static function getTableName() { + public static function getTableName() { return NULL; } @@ -103,7 +103,7 @@ class CRM_Core_DAO extends DB_DataObject { * @access private * @static */ - static function init($dsn) { + public static function init($dsn) { $options = &PEAR::getStaticProperty('DB_DataObject', 'options'); $options['database'] = $dsn; if (defined('CIVICRM_DAO_DEBUG')) { @@ -276,7 +276,7 @@ class CRM_Core_DAO extends DB_DataObject { * @access public * */ - function reset() { + public function reset() { foreach (array_keys($this->table()) as $field) { unset($this->$field); @@ -296,7 +296,7 @@ class CRM_Core_DAO extends DB_DataObject { * * @return string */ - static function getLocaleTableName($tableName) { + public static function getLocaleTableName($tableName) { global $dbLocale; if ($dbLocale) { $tables = CRM_Core_I18n_Schema::schemaStructureTables(); @@ -315,7 +315,7 @@ class CRM_Core_DAO extends DB_DataObject { * * @return object the current DAO object after the query execution */ - function query($query, $i18nRewrite = TRUE) { + public function query($query, $i18nRewrite = TRUE) { // rewrite queries that should use $dbLocale-based views for multi-language installs global $dbLocale; if ($i18nRewrite and $dbLocale) { @@ -334,7 +334,7 @@ class CRM_Core_DAO extends DB_DataObject { * @access public * @static */ - static function setFactory(&$factory) { + public static function setFactory(&$factory) { self::$_factory = &$factory; } @@ -346,7 +346,7 @@ class CRM_Core_DAO extends DB_DataObject { * @return void * @access public */ - function factory($table = '') { + public function factory($table = '') { if (!isset(self::$_factory)) { return parent::factory($table); } @@ -361,7 +361,7 @@ class CRM_Core_DAO extends DB_DataObject { * @return void * @access protected */ - function initialize() { + public function initialize() { $this->_connect(); $this->query("SET NAMES utf8"); } @@ -373,7 +373,7 @@ class CRM_Core_DAO extends DB_DataObject { * * @return array */ - function keys() { + public function keys() { static $keys; if (!isset($keys)) { $keys = array('id'); @@ -389,7 +389,7 @@ class CRM_Core_DAO extends DB_DataObject { * * @return array */ - function sequenceKey() { + public function sequenceKey() { static $sequenceKeys; if (!isset($sequenceKeys)) { $sequenceKeys = array('id', TRUE); @@ -405,7 +405,7 @@ class CRM_Core_DAO extends DB_DataObject { * * @return array of CRM_Core_Reference_Interface */ - static function getReferenceColumns() { + public static function getReferenceColumns() { return array(); } @@ -428,7 +428,7 @@ class CRM_Core_DAO extends DB_DataObject { * @param array key=>type array * @return array (associative) */ - function table() { + public function table() { $fields = &$this->fields(); $table = array(); @@ -447,7 +447,7 @@ class CRM_Core_DAO extends DB_DataObject { /** * @return $this */ - function save() { + public function save() { if (!empty($this->id)) { $this->update(); @@ -467,7 +467,7 @@ class CRM_Core_DAO extends DB_DataObject { return $this; } - function delete($useWhere = FALSE) { + public function delete($useWhere = FALSE) { $result = parent::delete($useWhere); $event = new \Civi\Core\DAO\Event\PostDelete($this, $result); @@ -479,7 +479,7 @@ class CRM_Core_DAO extends DB_DataObject { /** * @param bool $created */ - function log($created = FALSE) { + public function log($created = FALSE) { static $cid = NULL; if (!$this->getLog()) { @@ -513,7 +513,7 @@ class CRM_Core_DAO extends DB_DataObject { * @return boolean did we copy all null values into the object * @access public */ - function copyValues(&$params) { + public function copyValues(&$params) { $fields = &$this->fields(); $allNull = TRUE; foreach ($fields as $name => $value) { @@ -556,7 +556,7 @@ class CRM_Core_DAO extends DB_DataObject { * @access public * @static */ - static function storeValues(&$object, &$values) { + public static function storeValues(&$object, &$values) { $fields = &$object->fields(); foreach ($fields as $name => $value) { $dbName = $value['name']; @@ -578,7 +578,7 @@ class CRM_Core_DAO extends DB_DataObject { * @access public * @static */ - static function makeAttribute($field) { + public static function makeAttribute($field) { if ($field) { if (CRM_Utils_Array::value('type', $field) == CRM_Utils_Type::T_STRING) { $maxLength = CRM_Utils_Array::value('maxlength', $field); @@ -630,7 +630,7 @@ class CRM_Core_DAO extends DB_DataObject { * @access public * @static */ - static function getAttribute($class, $fieldName = NULL) { + public static function getAttribute($class, $fieldName = NULL) { $object = new $class( ); $fields = &$object->fields(); if ($fieldName != NULL) { @@ -658,7 +658,7 @@ class CRM_Core_DAO extends DB_DataObject { * * @throws Exception */ - static function transaction($type) { + public static function transaction($type) { CRM_Core_Error::fatal('This function is obsolete, please use CRM_Core_Transaction'); } @@ -675,7 +675,7 @@ class CRM_Core_DAO extends DB_DataObject { * @access public * @static */ - static function objectExists($value, $daoName, $daoID, $fieldName = 'name') { + public static function objectExists($value, $daoName, $daoID, $fieldName = 'name') { $object = new $daoName( ); $object->$fieldName = $value; @@ -699,7 +699,7 @@ class CRM_Core_DAO extends DB_DataObject { * @return boolean true if exists, else false * @static */ - static function checkFieldExists($tableName, $columnName, $i18nRewrite = TRUE) { + public static function checkFieldExists($tableName, $columnName, $i18nRewrite = TRUE) { $query = " SHOW COLUMNS FROM $tableName @@ -725,7 +725,7 @@ LIKE %1 * @return array * @static */ - static function getStorageValues($tableName = NULL, $maxTablesToCheck = 10, $fieldName = 'Engine') { + public static function getStorageValues($tableName = NULL, $maxTablesToCheck = 10, $fieldName = 'Engine') { $values = array(); $query = "SHOW TABLE STATUS LIKE %1"; @@ -766,7 +766,7 @@ LIKE %1 * * @return bool */ - static function isDBMyISAM($maxTablesToCheck = 10) { + public static function isDBMyISAM($maxTablesToCheck = 10) { // show error if any of the tables, use 'MyISAM' storage engine. $engines = self::getStorageValues(NULL, $maxTablesToCheck); if (array_key_exists('MyISAM', $engines)) { @@ -784,7 +784,7 @@ LIKE %1 * @return boolean true if constraint exists, false otherwise * @static */ - static function checkConstraintExists($tableName, $constraint) { + public static function checkConstraintExists($tableName, $constraint) { static $show = array(); if (!array_key_exists($tableName, $show)) { @@ -811,7 +811,7 @@ LIKE %1 * * @return boolean true if CONSTRAINT keyword exists, false otherwise */ - static function schemaRequiresRebuilding($tables = array("civicrm_contact")) { + public static function schemaRequiresRebuilding($tables = array("civicrm_contact")) { $show = array(); foreach($tables as $tableName){ if (!array_key_exists($tableName, $show)) { @@ -847,7 +847,7 @@ LIKE %1 * @return boolean true if in format, false otherwise * @static */ - static function checkFKConstraintInFormat($tableName, $columnName) { + public static function checkFKConstraintInFormat($tableName, $columnName) { static $show = array(); if (!array_key_exists($tableName, $show)) { @@ -876,7 +876,7 @@ LIKE %1 * @return boolean true if the value is always $columnValue, false otherwise * @static */ - static function checkFieldHasAlwaysValue($tableName, $columnName, $columnValue) { + public static function checkFieldHasAlwaysValue($tableName, $columnName, $columnValue) { $query = "SELECT * FROM $tableName WHERE $columnName != '$columnValue'"; $dao = CRM_Core_DAO::executeQuery($query); $result = $dao->fetch() ? FALSE : TRUE; @@ -893,7 +893,7 @@ LIKE %1 * @return boolean true if if the value is always NULL, false otherwise * @static */ - static function checkFieldIsAlwaysNull($tableName, $columnName) { + public static function checkFieldIsAlwaysNull($tableName, $columnName) { $query = "SELECT * FROM $tableName WHERE $columnName IS NOT NULL"; $dao = CRM_Core_DAO::executeQuery($query); $result = $dao->fetch() ? FALSE : TRUE; @@ -909,7 +909,7 @@ LIKE %1 * @return boolean true if exists, else false * @static */ - static function checkTableExists($tableName) { + public static function checkTableExists($tableName) { $query = " SHOW TABLES LIKE %1 @@ -927,7 +927,7 @@ LIKE %1 * * @return bool */ - function checkVersion($version) { + public function checkVersion($version) { $query = " SELECT version FROM civicrm_domain @@ -943,7 +943,7 @@ FROM civicrm_domain * * @return object Object of the type of the class that called this function. */ - static function findById($id) { + public static function findById($id) { $object = new static(); $object->id = $id; if (!$object->find(TRUE)) { @@ -965,7 +965,7 @@ FROM civicrm_domain * @static * @access public */ - static function getFieldValue($daoName, $searchValue, $returnColumn = 'name', $searchColumn = 'id', $force = FALSE) { + public static function getFieldValue($daoName, $searchValue, $returnColumn = 'name', $searchColumn = 'id', $force = FALSE) { if ( empty($searchValue) || trim(strtolower($searchValue)) == 'null' @@ -1011,7 +1011,7 @@ FROM civicrm_domain * @static * @access public */ - static function setFieldValue($daoName, $searchValue, $setColumn, $setValue, $searchColumn = 'id') { + public static function setFieldValue($daoName, $searchValue, $setColumn, $setValue, $searchColumn = 'id') { $object = new $daoName( ); $object->selectAdd(); $object->selectAdd("$searchColumn, $setColumn"); @@ -1037,7 +1037,7 @@ FROM civicrm_domain * @access public * @static */ - static function getSortString($sort, $default = NULL) { + public static function getSortString($sort, $default = NULL) { // check if sort is of type CRM_Utils_Sort if (is_a($sort, 'CRM_Utils_Sort')) { return $sort->orderBy(); @@ -1065,7 +1065,7 @@ FROM civicrm_domain * @access public * @static */ - static function commonRetrieve($daoName, &$params, &$defaults, $returnProperities = NULL) { + public static function commonRetrieve($daoName, &$params, &$defaults, $returnProperities = NULL) { $object = new $daoName( ); $object->copyValues($params); @@ -1092,7 +1092,7 @@ FROM civicrm_domain * @access public * @static */ - static function deleteEntityContact($daoName, $contactId) { + public static function deleteEntityContact($daoName, $contactId) { $object = new $daoName( ); $object->entity_table = 'civicrm_contact'; @@ -1201,7 +1201,7 @@ FROM civicrm_domain * @return string * @throws Exception */ - static function composeQuery($query, &$params, $abort = TRUE) { + public static function composeQuery($query, &$params, $abort = TRUE) { $tr = array(); foreach ($params as $key => $item) { if (is_numeric($key)) { @@ -1248,7 +1248,7 @@ FROM civicrm_domain /** * @param null $ids */ - static function freeResult($ids = NULL) { + public static function freeResult($ids = NULL) { global $_DB_DATAOBJECT; if (!$ids) { @@ -1364,7 +1364,7 @@ FROM civicrm_domain return $newObject; } - static function cascadeUpdate($daoName, $fromId, $toId, $newData = array()) { + public static function cascadeUpdate($daoName, $fromId, $toId, $newData = array()) { $object = new $daoName( ); $object->id = $fromId; @@ -1442,7 +1442,7 @@ SELECT contact_id * @access public * @static */ - static function commonRetrieveAll($daoName, $fieldIdName = 'id', $fieldId, &$details, $returnProperities = NULL) { + public static function commonRetrieveAll($daoName, $fieldIdName = 'id', $fieldId, &$details, $returnProperities = NULL) { require_once (str_replace('_', DIRECTORY_SEPARATOR, $daoName) . ".php"); $object = new $daoName( ); $object->$fieldIdName = $fieldId; @@ -1464,7 +1464,7 @@ SELECT contact_id return $details; } - static function dropAllTables() { + public static function dropAllTables() { // first drop all the custom tables we've created CRM_Core_BAO_CustomGroup::dropAllTables(); @@ -1486,7 +1486,7 @@ SELECT contact_id * * @return string */ - static function escapeString($string) { + public static function escapeString($string) { static $_dao = NULL; if (!$_dao) { @@ -1517,7 +1517,7 @@ SELECT contact_id * @param $default string the value to use if $strings has no elements * @return string eg "abc","def","ghi" */ - static function escapeStrings($strings, $default = NULL) { + public static function escapeStrings($strings, $default = NULL) { static $_dao = NULL; if (!$_dao) { $_dao = new CRM_Core_DAO(); @@ -1536,7 +1536,7 @@ SELECT contact_id * * @return string */ - static function escapeWildCardString($string) { + public static function escapeWildCardString($string) { // CRM-9155 // ensure we escape the single characters % and _ which are mysql wild // card characters and could come in via sortByCharacter @@ -1636,7 +1636,7 @@ SELECT contact_id * @param string $daoName * @param array $params */ - static function deleteTestObjects($daoName, $params = array()) { + public static function deleteTestObjects($daoName, $params = array()) { //this is a test function also backtrace is set for the test suite it sometimes unsets itself // so we re-set here in case $config = CRM_Core_Config::singleton(); @@ -1681,7 +1681,7 @@ SELECT contact_id * @param array $params * @param $defaults */ - static function setCreateDefaults(&$params, $defaults) { + public static function setCreateDefaults(&$params, $defaults) { if (isset($params['id'])) { return; } @@ -1699,7 +1699,7 @@ SELECT contact_id * * @return string */ - static function createTempTableName($prefix = 'civicrm', $addRandomString = TRUE, $string = NULL) { + public static function createTempTableName($prefix = 'civicrm', $addRandomString = TRUE, $string = NULL) { $tableName = $prefix . "_temp"; if ($addRandomString) { @@ -1719,7 +1719,7 @@ SELECT contact_id * * @return bool */ - static function checkTriggerViewPermission($view = TRUE, $trigger = TRUE) { + public static function checkTriggerViewPermission($view = TRUE, $trigger = TRUE) { // test for create view and trigger permissions and if allowed, add the option to go multilingual // and logging // I'm not sure why we use the getStaticProperty for an error, rather than checking for DB_Error @@ -1764,7 +1764,7 @@ SELECT contact_id * @param null $message * @param bool $printDAO */ - static function debugPrint($message = NULL, $printDAO = TRUE) { + public static function debugPrint($message = NULL, $printDAO = TRUE) { CRM_Utils_System::xMemory("{$message}: "); if ($printDAO) { @@ -1786,7 +1786,7 @@ SELECT contact_id * * @see CRM-9716 */ - static function triggerRebuild($tableName = NULL, $force = FALSE) { + public static function triggerRebuild($tableName = NULL, $force = FALSE) { $info = array(); $logging = new CRM_Logging_Schema; @@ -1811,7 +1811,7 @@ SELECT contact_id * * Stop using functions and find another way to strip numeric characters from phones * * Give better error messages (currently a missing fn fatals with "unknown error") */ - static function checkSqlFunctionsExist() { + public static function checkSqlFunctionsExist() { if (!self::$_checkedSqlFunctionsExist) { self::$_checkedSqlFunctionsExist = TRUE; $dao = CRM_Core_DAO::executeQuery("SHOW function status WHERE db = database() AND name = 'civicrm_strip_non_numeric'"); @@ -1826,7 +1826,7 @@ SELECT contact_id * * @param $tableName string the specific table requiring a rebuild; or NULL to rebuild all tables */ - static function dropTriggers($tableName = NULL) { + public static function dropTriggers($tableName = NULL) { $info = array(); $logging = new CRM_Logging_Schema; @@ -1840,7 +1840,7 @@ SELECT contact_id * @param $info array per hook_civicrm_triggerInfo * @param $onlyTableName string the specific table requiring a rebuild; or NULL to rebuild all tables */ - static function createTriggers(&$info, $onlyTableName = NULL) { + public static function createTriggers(&$info, $onlyTableName = NULL) { // Validate info array, should probably raise errors? if (is_array($info) == FALSE) { return; @@ -1951,7 +1951,7 @@ SELECT contact_id * @param string $className BAO/DAO class name * @return array */ - static function createReferenceColumns($className) { + public static function createReferenceColumns($className) { $result = array(); $fields = $className::fields(); foreach ($fields as $field) { @@ -1973,7 +1973,7 @@ SELECT contact_id * * @return array of objects referencing this */ - function findReferences() { + public function findReferences() { $links = self::getReferencesToTable(static::getTableName()); $occurrences = array(); @@ -2001,7 +2001,7 @@ SELECT contact_id * - table: string|null SQL table name * - key: string|null SQL column name */ - function getReferenceCounts() { + public function getReferenceCounts() { $links = self::getReferencesToTable(static::getTableName()); $counts = array(); @@ -2036,7 +2036,7 @@ SELECT contact_id * @return array structure of table and column, listing every table with a * foreign key reference to $tableName, and the column where the key appears. */ - static function getReferencesToTable($tableName) { + public static function getReferencesToTable($tableName) { $refsFound = array(); foreach (CRM_Core_DAO_AllCoreTables::getClasses() as $daoClassName) { $links = $daoClassName::getReferenceColumns(); @@ -2138,7 +2138,7 @@ SELECT contact_id * @param string $fieldName * @return bool|array */ - function getFieldSpec($fieldName) { + public function getFieldSpec($fieldName) { $fields = $this->fields(); $fieldKeys = $this->fieldKeys(); @@ -2287,6 +2287,6 @@ SELECT contact_id /** * @param array $params */ - function setApiFilter(&$params) {} + public function setApiFilter(&$params) {} } diff --git a/CRM/Core/Error.php b/CRM/Core/Error.php index b331db37cb..b633897db5 100644 --- a/CRM/Core/Error.php +++ b/CRM/Core/Error.php @@ -114,7 +114,7 @@ class CRM_Core_Error extends PEAR_ErrorStack { * @return object * @static */ - static function &singleton($package = NULL, $msgCallback = FALSE, $contextCallback = FALSE, $throwPEAR_Error = FALSE, $stackClass = 'PEAR_ErrorStack') { + public static function &singleton($package = NULL, $msgCallback = FALSE, $contextCallback = FALSE, $throwPEAR_Error = FALSE, $stackClass = 'PEAR_ErrorStack') { if (self::$_singleton === NULL) { self::$_singleton = new CRM_Core_Error('CiviCRM'); } @@ -124,7 +124,7 @@ class CRM_Core_Error extends PEAR_ErrorStack { /** * Constructor */ - function __construct() { + public function __construct() { parent::__construct('CiviCRM'); $log = CRM_Core_Config::getLog(); @@ -158,7 +158,7 @@ class CRM_Core_Error extends PEAR_ErrorStack { * @param $error * @param string $separator */ - static function displaySessionError(&$error, $separator = '
') { + public static function displaySessionError(&$error, $separator = '
') { $message = self::getMessages($error, $separator); if ($message) { $status = ts("Payment Processor Error message") . "{$separator} $message"; @@ -310,7 +310,7 @@ class CRM_Core_Error extends PEAR_ErrorStack { * @static * @access public */ - static function fatal($message = NULL, $code = NULL, $email = NULL) { + public static function fatal($message = NULL, $code = NULL, $email = NULL) { $vars = array( 'message' => $message, 'code' => $code, @@ -398,7 +398,7 @@ class CRM_Core_Error extends PEAR_ErrorStack { * @static * @access public */ - static function handleUnhandledException($exception) { + public static function handleUnhandledException($exception) { $config = CRM_Core_Config::singleton(); $vars = array( 'message' => $exception->getMessage(), @@ -474,7 +474,7 @@ class CRM_Core_Error extends PEAR_ErrorStack { * @access public * @static */ - static function debug($name, $variable = NULL, $log = TRUE, $html = TRUE, $checkPermission = TRUE) { + public static function debug($name, $variable = NULL, $log = TRUE, $html = TRUE, $checkPermission = TRUE) { $error = self::singleton(); if ($variable === NULL) { @@ -570,7 +570,7 @@ class CRM_Core_Error extends PEAR_ErrorStack { * * @static */ - static function debug_log_message($message, $out = FALSE, $comp = '') { + public static function debug_log_message($message, $out = FALSE, $comp = '') { $config = CRM_Core_Config::singleton(); $file_log = self::createDebugLogger($comp); @@ -594,7 +594,7 @@ class CRM_Core_Error extends PEAR_ErrorStack { /** * Append to the query log (if enabled) */ - static function debug_query($string) { + public static function debug_query($string) { if ( defined( 'CIVICRM_DEBUG_LOG_QUERY' ) ) { if ( CIVICRM_DEBUG_LOG_QUERY == 'backtrace' ) { CRM_Core_Error::backtrace( $string, true ); @@ -609,7 +609,7 @@ class CRM_Core_Error extends PEAR_ErrorStack { * * @param string $query */ - static function debug_query_result($query) { + public static function debug_query_result($query) { $dao = CRM_Core_DAO::executeQuery($query); $results = array(); while ($dao->fetch()) { @@ -625,7 +625,7 @@ class CRM_Core_Error extends PEAR_ErrorStack { * * @return Log */ - static function createDebugLogger($comp = '') { + public static function createDebugLogger($comp = '') { $config = CRM_Core_Config::singleton(); if ($comp) { @@ -657,7 +657,7 @@ class CRM_Core_Error extends PEAR_ErrorStack { * @param string $msg * @param bool $log */ - static function backtrace($msg = 'backTrace', $log = FALSE) { + public static function backtrace($msg = 'backTrace', $log = FALSE) { $backTrace = debug_backtrace(); $message = self::formatBacktrace($backTrace); if (!$log) { @@ -676,7 +676,7 @@ class CRM_Core_Error extends PEAR_ErrorStack { * @param int $maxArgLen maximum number of characters to show from each argument string * @return string printable plain-text */ - static function formatBacktrace($backTrace, $showArgs = TRUE, $maxArgLen = 80) { + public static function formatBacktrace($backTrace, $showArgs = TRUE, $maxArgLen = 80) { $message = ''; foreach (self::parseBacktrace($backTrace, $showArgs, $maxArgLen) as $idx => $trace) { $message .= sprintf("#%s %s\n", $idx, $trace); @@ -695,7 +695,7 @@ class CRM_Core_Error extends PEAR_ErrorStack { * @see debug_backtrace * @see Exception::getTrace() */ - static function parseBacktrace($backTrace, $showArgs = TRUE, $maxArgLen = 80) { + public static function parseBacktrace($backTrace, $showArgs = TRUE, $maxArgLen = 80) { $ret = array(); foreach ($backTrace as $trace) { $args = array(); @@ -759,7 +759,7 @@ class CRM_Core_Error extends PEAR_ErrorStack { * @param Exception $e * @return string printable HTML text */ - static function formatHtmlException(Exception $e) { + public static function formatHtmlException(Exception $e) { $msg = ''; // Exception metadata @@ -793,7 +793,7 @@ class CRM_Core_Error extends PEAR_ErrorStack { * @param Exception $e * @return string printable plain text */ - static function formatTextException(Exception $e) { + public static function formatTextException(Exception $e) { $msg = get_class($e) . ": \"" . $e->getMessage() . "\"\n"; $ei = $e; @@ -817,7 +817,7 @@ class CRM_Core_Error extends PEAR_ErrorStack { * * @return object */ - static function createError($message, $code = 8000, $level = 'Fatal', $params = NULL) { + public static function createError($message, $code = 8000, $level = 'Fatal', $params = NULL) { $error = CRM_Core_Error::singleton(); $error->push($code, $level, array($params), $message); return $error; diff --git a/CRM/Core/FileSearchInterface.php b/CRM/Core/FileSearchInterface.php index 8ee91ca042..9e96da9452 100644 --- a/CRM/Core/FileSearchInterface.php +++ b/CRM/Core/FileSearchInterface.php @@ -19,5 +19,5 @@ interface CRM_Core_FileSearchInterface { * - xparent_table: string - business-entity to which file is attached (directly or indirectly) * - xparent_id: int - business-entity to which file is attached (directly or indirectly) */ - function search($query, $limit = self::DEFAULT_SEARCH_LIMIT, $offset = self::DEFAULT_SEARCH_OFFSET); + public function search($query, $limit = self::DEFAULT_SEARCH_LIMIT, $offset = self::DEFAULT_SEARCH_OFFSET); } \ No newline at end of file diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index e6d09d6d24..ccfc288488 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -200,7 +200,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { $this->assign('snippet', CRM_Utils_Array::value('snippet', $_GET)); } - static function generateID() { + public static function generateID() { } /** @@ -219,7 +219,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @access private * */ - function registerRules() { + public function registerRules() { static $rules = array( 'title', 'longTitle', 'variable', 'qfVariable', 'phone', 'integer', 'query', @@ -302,7 +302,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return void * */ - function preProcess() {} + public function preProcess() {} /** * This function is called after the form is validated. Any @@ -317,14 +317,14 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return void * */ - function postProcess() {} + public function postProcess() {} /** * This function is just a wrapper, so that we can call all the hook functions * @param bool $allowAjax - FIXME: This feels kind of hackish, ideally we would take the json-related code from this function * and bury it deeper down in the controller */ - function mainProcess($allowAjax = TRUE) { + public function mainProcess($allowAjax = TRUE) { $this->postProcess(); $this->postProcessHook(); @@ -347,7 +347,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * better way is to do setUserContext so the framework does the redirect * */ - function postProcessHook() { + public function postProcessHook() { CRM_Utils_Hook::postProcess(get_class($this), $this); } @@ -361,7 +361,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return void * */ - function buildQuickForm() {} + public function buildQuickForm() {} /** * This virtual function is used to set the default values of @@ -372,7 +372,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return array reference to the array of default values * */ - function setDefaultValues() {} + public function setDefaultValues() {} /** * This is a virtual function that adds group and global rules to @@ -384,7 +384,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return void * */ - function addRules() {} + public function addRules() {} /** * Performs the server side validation @@ -393,7 +393,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return boolean true if no error found * @throws HTML_QuickForm_Error */ - function validate() { + public function validate() { $error = parent::validate(); $this->validateChainSelectFields(); @@ -430,7 +430,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * buildQuickForm. * */ - function buildForm() { + public function buildForm() { $this->_formBuilt = TRUE; $this->preProcess(); @@ -493,7 +493,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @access public * */ - function addButtons($params) { + public function addButtons($params) { $prevnext = array(); $spacing = array(); foreach ($params as $button) { @@ -552,7 +552,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return string * @access public */ - function getName() { + public function getName() { return $this->_name; } @@ -562,7 +562,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return object * @access public */ - function &getState() { + public function &getState() { return $this->_state; } @@ -572,7 +572,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return int * @access public */ - function getStateType() { + public function getStateType() { return $this->_state->getType(); } @@ -582,7 +582,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return string * @access public */ - function getTitle() { + public function getTitle() { return $this->_title ? $this->_title : ts('ERROR: Title is not Set'); } @@ -594,7 +594,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return void * @access public */ - function setTitle($title) { + public function setTitle($title) { $this->_title = $title; } @@ -606,7 +606,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return void * @access public */ - function setOptions($options) { + public function setOptions($options) { $this->_options = $options; } @@ -616,7 +616,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return string * @access public */ - function getLink() { + public function getLink() { $config = CRM_Core_Config::singleton(); return CRM_Utils_System::url($_GET[$config->userFrameworkURLVar], '_qf_' . $this->_name . '_display=true' @@ -629,7 +629,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return boolean * @access public */ - function isSimpleForm() { + public function isSimpleForm() { return $this->_state->getType() & (CRM_Core_State::START | CRM_Core_State::FINISH); } @@ -639,7 +639,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return string * @access public */ - function getFormAction() { + public function getFormAction() { return $this->_attributes['action']; } @@ -651,7 +651,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return void * @access public */ - function setFormAction($action) { + public function setFormAction($action) { $this->_attributes['action'] = $action; } @@ -661,7 +661,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return string * @access public */ - function toSmarty() { + public function toSmarty() { $this->preProcessChainSelectFields(); $renderer = $this->getRenderer(); $this->accept($renderer); @@ -679,7 +679,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return object * @access public */ - function &getRenderer() { + public function &getRenderer() { if (!isset($this->_renderer)) { $this->_renderer = CRM_Core_Form_Renderer::singleton(); } @@ -692,7 +692,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return string * @access public */ - function getTemplateFileName() { + public function getTemplateFileName() { $ext = CRM_Extension_System::singleton()->getMapper(); if ($ext->isExtensionClass(CRM_Utils_System::getClassName($this))) { $filename = $ext->getTemplateName(CRM_Utils_System::getClassName($this)); @@ -711,7 +711,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * A wrapper for getTemplateFileName that includes calling the hook to * prevent us from having to copy & paste the logic of calling the hook */ - function getHookedTemplateFileName() { + public function getHookedTemplateFileName() { $pageTemplateFile = $this->getTemplateFileName(); CRM_Utils_Hook::alterTemplateFile(get_class($this), $this, 'page', $pageTemplateFile); return $pageTemplateFile; @@ -724,7 +724,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return string * @access public */ - function overrideExtraTemplateFileName() { + public function overrideExtraTemplateFileName() { return NULL; } @@ -738,7 +738,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return void * @access public */ - function error($message, $code = NULL, $dao = NULL) { + public function error($message, $code = NULL, $dao = NULL) { if ($dao) { $dao->query('ROLLBACK'); } @@ -759,7 +759,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return void * */ - function set($name, $value) { + public function set($name, $value) { $this->controller->set($name, $value); } @@ -773,7 +773,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return mixed * */ - function get($name) { + public function get($name) { return $this->controller->get($name); } @@ -783,7 +783,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return int * @access public */ - function getAction() { + public function getAction() { return $this->_action; } @@ -795,7 +795,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return void * @access public */ - function setAction($action) { + public function setAction($action) { $this->_action = $action; } @@ -808,7 +808,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return void * @access public */ - function assign($var, $value = NULL) { + public function assign($var, $value = NULL) { self::$_template->assign($var, $value); } @@ -821,7 +821,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return void * @access public */ - function assign_by_ref($var, &$value) { + public function assign_by_ref($var, &$value) { self::$_template->assign_by_ref($var, $value); } @@ -832,7 +832,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @param mixed $value the value to append * @param bool $merge */ - function append($tpl_var, $value=NULL, $merge=FALSE) { + public function append($tpl_var, $value=NULL, $merge=FALSE) { self::$_template->append($tpl_var, $value, $merge); } @@ -843,7 +843,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * * @return array */ - function get_template_vars($name=null) { + public function get_template_vars($name=null) { return self::$_template->get_template_vars($name); } @@ -857,7 +857,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * * @return HTML_QuickForm_group */ - function &addRadio($name, $title, $values, $attributes = array(), $separator = NULL, $required = FALSE) { + public function &addRadio($name, $title, $values, $attributes = array(), $separator = NULL, $required = FALSE) { $options = array(); $attributes = $attributes ? $attributes : array(); $allowClear = !empty($attributes['allowClear']); @@ -883,7 +883,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @param null $required * @param array $attributes */ - function addYesNo($id, $title, $allowClear = FALSE, $required = NULL, $attributes = array()) { + public function addYesNo($id, $title, $allowClear = FALSE, $required = NULL, $attributes = array()) { $attributes += array('id_suffix' => $id); $choice = array(); $choice[] = $this->createElement('radio', NULL, '11', ts('Yes'), '1', $attributes); @@ -951,7 +951,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { } } - function resetValues() { + public function resetValues() { $data = $this->controller->container(); $data['values'][$this->_name] = array(); } @@ -968,7 +968,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @return void * @access public */ - function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { + public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { $buttons = array(); if ($backType != NULL) { $buttons[] = array( @@ -999,7 +999,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @param bool $required * @param bool $displayTime */ - function addDateRange($name, $from = '_from', $to = '_to', $label = 'From:', $dateFormat = 'searchDate', $required = FALSE, $displayTime = FALSE) { + public function addDateRange($name, $from = '_from', $to = '_to', $label = 'From:', $dateFormat = 'searchDate', $required = FALSE, $displayTime = FALSE) { if ($displayTime) { $this->addDateTime($name . $from, $label, $required, array('formatType' => $dateFormat)); $this->addDateTime($name . $to, ts('To:'), $required, array('formatType' => $dateFormat)); @@ -1024,7 +1024,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @throws CRM_Core_Exception * @return HTML_QuickForm_Element */ - function addSelect($name, $props = array(), $required = FALSE) { + public function addSelect($name, $props = array(), $required = FALSE) { if (!isset($props['entity'])) { $props['entity'] = CRM_Utils_Api::getEntityName($this); } @@ -1081,7 +1081,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @param array $entities * @param bool $default //CRM-15427 */ - function addProfileSelector($name, $label, $allowCoreTypes, $allowSubTypes, $entities, $default = FALSE) { + public function addProfileSelector($name, $label, $allowCoreTypes, $allowSubTypes, $entities, $default = FALSE) { // Output widget // FIXME: Instead of adhoc serialization, use a single json_encode() CRM_UF_Page_ProfileEditor::registerProfileScripts(); @@ -1102,7 +1102,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @param $attributes * @param bool $forceTextarea */ - function addWysiwyg($name, $label, $attributes, $forceTextarea = FALSE) { + public function addWysiwyg($name, $label, $attributes, $forceTextarea = FALSE) { // 1. Get configuration option for editor (tinymce, ckeditor, pure textarea) // 2. Based on the option, initialise proper editor $editorID = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, @@ -1146,7 +1146,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @param null $required * @param null $extra */ - function addCountry($id, $title, $required = NULL, $extra = NULL) { + public function addCountry($id, $title, $required = NULL, $extra = NULL) { $this->addElement('select', $id, $title, array( '' => ts('- select -')) + CRM_Core_PseudoConstant::country(), $extra @@ -1164,7 +1164,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @param null $required * @param null $javascriptMethod */ - function addSelectOther($name, $label, $options, $attributes, $required = NULL, $javascriptMethod = NULL) { + public function addSelectOther($name, $label, $options, $attributes, $required = NULL, $javascriptMethod = NULL) { $this->addElement('select', $name . '_id', $label, $options, $javascriptMethod); @@ -1190,14 +1190,14 @@ class CRM_Core_Form extends HTML_QuickForm_Page { /** * @return CRM_Core_Smarty */ - static function &getTemplate() { + public static function &getTemplate() { return self::$_template; } /** * @param $elementName */ - function addUploadElement($elementName) { + public function addUploadElement($elementName) { $uploadNames = $this->get('uploadNames'); if (!$uploadNames) { $uploadNames = array(); @@ -1225,7 +1225,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { /** * @return string */ - function buttonType() { + public function buttonType() { $uploadNames = $this->get('uploadNames'); $buttonType = (is_array($uploadNames) && !empty($uploadNames)) ? 'upload' : 'next'; $this->assign('buttonType', $buttonType); @@ -1237,7 +1237,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * * @return null */ - function getVar($name) { + public function getVar($name) { return isset($this->$name) ? $this->$name : NULL; } @@ -1245,7 +1245,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @param $name * @param $value */ - function setVar($name, $value) { + public function setVar($name, $value) { $this->$name = $value; } @@ -1263,7 +1263,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @param boolean $required true if required * */ - function addDate($name, $label, $required = FALSE, $attributes = NULL) { + public function addDate($name, $label, $required = FALSE, $attributes = NULL) { if (!empty($attributes['formatType'])) { // get actual format $params = array('name' => $attributes['formatType']); @@ -1344,7 +1344,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { /** * Function that will add date and time */ - function addDateTime($name, $label, $required = FALSE, $attributes = NULL) { + public function addDateTime($name, $label, $required = FALSE, $attributes = NULL) { $addTime = array('addTime' => TRUE); if (is_array($attributes)) { $attributes = array_merge($attributes, $addTime); @@ -1425,7 +1425,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @access public * @return HTML_QuickForm_Element */ - function addEntityRef($name, $label = '', $props = array(), $required = FALSE) { + public function addEntityRef($name, $label = '', $props = array(), $required = FALSE) { require_once "api/api.php"; $config = CRM_Core_Config::singleton(); // Default properties @@ -1473,7 +1473,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * @todo standardise the format which dates are passed to the BAO layer in & remove date * handling from BAO */ - function convertDateFieldsToMySQL(&$params){ + public function convertDateFieldsToMySQL(&$params){ foreach ($this->_dateFields as $fieldName => $specs){ if(!empty($params[$fieldName])){ $params[$fieldName] = CRM_Utils_Date::isoToMysql( @@ -1493,7 +1493,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { /** * @param $elementName */ - function removeFileRequiredRules($elementName) { + public function removeFileRequiredRules($elementName) { $this->_required = array_diff($this->_required, array($elementName)); if (isset($this->_rules[$elementName])) { foreach ($this->_rules[$elementName] as $index => $ruleInfo) { @@ -1513,13 +1513,13 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * * @access public */ - function cancelAction() {} + public function cancelAction() {} /** * Helper function to verify that required fields have been filled * Typically called within the scope of a FormRule function */ - static function validateMandatoryFields($fields, $values, &$errors) { + public static function validateMandatoryFields($fields, $values, &$errors) { foreach ($fields as $name => $fld) { if (!empty($fld['is_required']) && CRM_Utils_System::isNull(CRM_Utils_Array::value($name, $values))) { $errors[$name] = ts('%1 is a required field.', array(1 => $fld['title'])); @@ -1538,7 +1538,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * * @return mixed NULL|integer */ - function getContactID() { + public function getContactID() { $tempID = CRM_Utils_Request::retrieve('cid', 'Positive', $this); if(isset($this->_params) && isset($this->_params['select_contact_id'])) { $tempID = $this->_params['select_contact_id']; @@ -1584,7 +1584,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { /** * Get the contact id of the logged in user */ - function getLoggedInUserContactID() { + public function getLoggedInUserContactID() { // check if the user is logged in and has a contact ID $session = CRM_Core_Session::singleton(); return $session->get('userID'); @@ -1612,7 +1612,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * * @todo add data attributes so we can deal with multiple instances on a form */ - function addAutoSelector($profiles = array(), $autoCompleteField = array()) { + public function addAutoSelector($profiles = array(), $autoCompleteField = array()) { $autoCompleteField = array_merge(array( 'id_field' => 'select_contact_id', 'placeholder' => ts('Select someone else ...'), @@ -1635,7 +1635,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { /** * */ - function canUseAjaxContactLookups() { + public function canUseAjaxContactLookups() { if (0 < (civicrm_api3('contact', 'getcount', array('check_permissions' => 1))) && CRM_Core_Permission::check(array(array('access AJAX API', 'access CiviCRM')))) { return TRUE; @@ -1650,7 +1650,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * is this form. Inserting a class FrontEndForm.php between the contribution & event & this class would allow functions like this * and a dozen other small ones to be refactored into a shared parent with the reduction of much code duplication */ - function addCIDZeroOptions($onlinePaymentProcessorEnabled) { + public function addCIDZeroOptions($onlinePaymentProcessorEnabled) { $this->assign('nocid', TRUE); $profiles = array(); if($this->_values['custom_pre_id']) { @@ -1675,7 +1675,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * * @return array */ - function getProfileDefaults($profile_id = 'Billing', $contactID = NULL) { + public function getProfileDefaults($profile_id = 'Billing', $contactID = NULL) { try{ $defaults = civicrm_api3('profile', 'getsingle', array( 'profile_id' => (array) $profile_id, @@ -1694,7 +1694,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * Sets form attribute * @see CRM.loadForm */ - function preventAjaxSubmit() { + public function preventAjaxSubmit() { $this->setAttribute('data-no-ajax-submit', 'true'); } @@ -1702,7 +1702,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * Sets form attribute * @see CRM.loadForm */ - function allowAjaxSubmit() { + public function allowAjaxSubmit() { $this->removeAttribute('data-no-ajax-submit'); } @@ -1710,7 +1710,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * Sets page title based on entity and action * @param string $entityLabel */ - function setPageTitle($entityLabel) { + public function setPageTitle($entityLabel) { switch ($this->_action) { case CRM_Core_Action::ADD: CRM_Utils_System::setTitle(ts('New %1', array(1 => $entityLabel))); diff --git a/CRM/Core/Form/Date.php b/CRM/Core/Form/Date.php index 42850f8078..30c76da12e 100644 --- a/CRM/Core/Form/Date.php +++ b/CRM/Core/Form/Date.php @@ -47,7 +47,7 @@ Class CRM_Core_Form_Date { * @static * @access public */ - static function buildAllowedDateFormats(&$form) { + public static function buildAllowedDateFormats(&$form) { $dateOptions = array(); @@ -238,7 +238,7 @@ Class CRM_Core_Form_Date { * * @return null */ - static function addDateRangeToForm(&$form, $fieldName, $selector, $from = '_from', $to = '_to', $fromLabel = 'From:', $required = FALSE, $dateFormat = 'searchDate', $displayTime = FALSE) { + public static function addDateRangeToForm(&$form, $fieldName, $selector, $from = '_from', $to = '_to', $fromLabel = 'From:', $required = FALSE, $dateFormat = 'searchDate', $displayTime = FALSE) { $form->add('select', "{$fieldName}_relative", ts('Relative Date Range'), diff --git a/CRM/Core/Form/RecurringEntity.php b/CRM/Core/Form/RecurringEntity.php index 7b3e468e3e..5665778eaa 100644 --- a/CRM/Core/Form/RecurringEntity.php +++ b/CRM/Core/Form/RecurringEntity.php @@ -73,7 +73,7 @@ class CRM_Core_Form_RecurringEntity { */ public static $_hasParent = FALSE; - static function preProcess($entityTable) { + public static function preProcess($entityTable) { self::$_entityId = (int) CRM_Utils_Request::retrieve('id', 'Positive'); self::$_entityTable = $entityTable; @@ -112,7 +112,7 @@ class CRM_Core_Form_RecurringEntity { * * @return None */ - static function setDefaultValues() { + public static function setDefaultValues() { $defaults = array(); if (self::$_scheduleReminderID) { $defaults['repetition_frequency_unit'] = self::$_scheduleReminderDetails->repetition_frequency_unit; @@ -147,7 +147,7 @@ class CRM_Core_Form_RecurringEntity { return $defaults; } - static function buildQuickForm(&$form) { + public static function buildQuickForm(&$form) { if (self::$_entityTable) { $entityType = explode("_", self::$_entityTable); if ($entityType[1]) { @@ -234,7 +234,7 @@ class CRM_Core_Form_RecurringEntity { * @static * @access public */ - static function formRule($values) { + public static function formRule($values) { $errors = array(); //Process this function only when you get this variable if ($values['allowRepeatConfigToSubmit'] == 1) { @@ -317,7 +317,7 @@ class CRM_Core_Form_RecurringEntity { * * @return None */ - static function postProcess($params = array(), $type, $linkedEntities = array()) { + public static function postProcess($params = array(), $type, $linkedEntities = array()) { //Check entity_id not present in params take it from class variable if (!CRM_Utils_Array::value('entity_id', $params)) { $params['entity_id'] = self::$_entityId; diff --git a/CRM/Core/Form/Renderer.php b/CRM/Core/Form/Renderer.php index dab72db10a..d4ea445936 100644 --- a/CRM/Core/Form/Renderer.php +++ b/CRM/Core/Form/Renderer.php @@ -80,7 +80,7 @@ class CRM_Core_Form_Renderer extends HTML_QuickForm_Renderer_ArraySmarty { * * Method providing static instance of as in Singleton pattern. */ - static function &singleton() { + public static function &singleton() { if (!isset(self::$_singleton)) { self::$_singleton = new CRM_Core_Form_Renderer(); } @@ -101,7 +101,7 @@ class CRM_Core_Form_Renderer extends HTML_QuickForm_Renderer_ArraySmarty { * * @return array */ - function _elementToArray(&$element, $required, $error) { + public function _elementToArray(&$element, $required, $error) { self::updateAttributes($element, $required, $error); $el = parent::_elementToArray($element, $required, $error); @@ -151,7 +151,7 @@ class CRM_Core_Form_Renderer extends HTML_QuickForm_Renderer_ArraySmarty { * @return array * @static */ - static function updateAttributes(&$element, $required, $error) { + public static function updateAttributes(&$element, $required, $error) { // lets create an id for all input elements, so we can generate nice label tags // to make it nice and clean, we'll just use the elementName if it is non null $attributes = array(); @@ -207,7 +207,7 @@ class CRM_Core_Form_Renderer extends HTML_QuickForm_Renderer_ArraySmarty { * * @param $field HTML_QuickForm_element */ - static function preProcessEntityRef($field) { + public static function preProcessEntityRef($field) { $val = $field->getValue(); // Support array values if (is_array($val)) { @@ -240,7 +240,7 @@ class CRM_Core_Form_Renderer extends HTML_QuickForm_Renderer_ArraySmarty { * @param $el array * @param $field HTML_QuickForm_element */ - function renderFrozenEntityRef(&$el, $field) { + public function renderFrozenEntityRef(&$el, $field) { $entity = $field->getAttribute('data-api-entity'); $vals = json_decode($field->getAttribute('data-entity-value'), TRUE); $display = array(); @@ -269,7 +269,7 @@ class CRM_Core_Form_Renderer extends HTML_QuickForm_Renderer_ArraySmarty { * * @param $field HTML_QuickForm_element */ - static function preprocessContactReference($field) { + public static function preprocessContactReference($field) { $val = $field->getValue(); if ($val && is_numeric($val)) { @@ -297,7 +297,7 @@ class CRM_Core_Form_Renderer extends HTML_QuickForm_Renderer_ArraySmarty { * @param array $el * @param HTML_QuickForm_element $field */ - function addOptionsEditLink(&$el, $field) { + public function addOptionsEditLink(&$el, $field) { if (CRM_Core_Permission::check('administer CiviCRM')) { // NOTE: $path is used on the client-side to know which option lists need rebuilding, // that's why we need that bit of data both in the link and in the form element @@ -312,7 +312,7 @@ class CRM_Core_Form_Renderer extends HTML_QuickForm_Renderer_ArraySmarty { * @param array $el * @param HTML_QuickForm_element $field */ - function appendUnselectButton(&$el, $field) { + public function appendUnselectButton(&$el, $field) { // Initially hide if not needed // Note: visibility:hidden prevents layout jumping around unlike display:none $display = $field->getValue() !== NULL ? '' : ' style="visibility:hidden;"'; diff --git a/CRM/Core/Form/Search.php b/CRM/Core/Form/Search.php index 419a42923a..a344b162ea 100644 --- a/CRM/Core/Form/Search.php +++ b/CRM/Core/Form/Search.php @@ -80,7 +80,7 @@ class CRM_Core_Form_Search extends CRM_Core_Form { /** * Common buildform tasks required by all searches */ - function buildQuickform() { + public function buildQuickform() { $resources = CRM_Core_Resources::singleton(); if ($resources->ajaxPopupsEnabled) { @@ -104,7 +104,7 @@ class CRM_Core_Form_Search extends CRM_Core_Form { /** * Add checkboxes for each row plus a master checkbox */ - function addRowSelectors($rows) { + public function addRowSelectors($rows) { $this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('class' => 'select-rows')); foreach ($rows as $row) { $this->addElement('checkbox', $row['checkbox'], NULL, NULL, array('class' => 'select-row')); @@ -115,7 +115,7 @@ class CRM_Core_Form_Search extends CRM_Core_Form { * Add actions menu to search results form * @param $tasks */ - function addTaskMenu($tasks) { + public function addTaskMenu($tasks) { if (is_array($tasks) && !empty($tasks)) { $tasks = array('' => ts('Actions')) + $tasks; $this->add('select', 'task', NULL, $tasks, FALSE, array('class' => 'crm-select2 crm-action-menu huge crm-search-result-actions')); diff --git a/CRM/Core/Form/Tag.php b/CRM/Core/Form/Tag.php index 05731dff18..fff554e335 100644 --- a/CRM/Core/Form/Tag.php +++ b/CRM/Core/Form/Tag.php @@ -127,7 +127,7 @@ class CRM_Core_Form_Tag { * @access public * @static */ - static function postProcess(&$params, $entityId, $entityTable = 'civicrm_contact', &$form) { + public static function postProcess(&$params, $entityId, $entityTable = 'civicrm_contact', &$form) { if ($form && !empty($form->_entityTagValues)) { $existingTags = $form->_entityTagValues; } diff --git a/CRM/Core/I18n.php b/CRM/Core/I18n.php index d32b744cda..f0366789d4 100644 --- a/CRM/Core/I18n.php +++ b/CRM/Core/I18n.php @@ -59,7 +59,7 @@ class CRM_Core_I18n { * * @return \CRM_Core_I18n */ - function __construct($locale) { + public function __construct($locale) { if ($locale != '' and $locale != 'en_US') { $config = CRM_Core_Config::singleton(); @@ -110,7 +110,7 @@ class CRM_Core_I18n { * * @return bool True if gettext is native */ - function isNative() { + public function isNative() { return $this->_nativegettext; } @@ -121,7 +121,7 @@ class CRM_Core_I18n { * * @return array of code/language name mappings */ - static function languages($justEnabled = FALSE) { + public static function languages($justEnabled = FALSE) { static $all = NULL; static $enabled = NULL; @@ -176,7 +176,7 @@ class CRM_Core_I18n { * * @return string modified string */ - function strarg($str) { + public function strarg($str) { $tr = array(); $p = 0; for ($i = 1; $i < func_num_args(); $i++) { @@ -213,7 +213,7 @@ class CRM_Core_I18n { * * @return string the translated string */ - function crm_translate($text, $params = array()) { + public function crm_translate($text, $params = array()) { if (isset($params['escape'])) { $escape = $params['escape']; unset($params['escape']); @@ -344,7 +344,7 @@ class CRM_Core_I18n { * * @return string the translated string */ - function translate($string) { + public function translate($string) { return ($this->_phpgettext) ? $this->_phpgettext->translate($string) : $string; } @@ -380,7 +380,7 @@ class CRM_Core_I18n { * * @return void */ - function localizeTitles(&$array) { + public function localizeTitles(&$array) { foreach ($array as $key => $value) { if (is_array($value)) { $this->localizeTitles($value); @@ -399,7 +399,7 @@ class CRM_Core_I18n { * * @return Boolean True if the domain was changed for an extension. */ - function setGettextDomain($key) { + public function setGettextDomain($key) { /* No domain changes for en_US */ if (! $this->_phpgettext) { return FALSE; @@ -452,7 +452,7 @@ class CRM_Core_I18n { /** * Static instance provider - return the instance for the current locale. */ - static function &singleton() { + public static function &singleton() { static $singleton = array(); global $tsLocale; @@ -468,7 +468,7 @@ class CRM_Core_I18n { * * @return string the final LC_TIME that got set */ - static function setLcTime() { + public static function setLcTime() { static $locales = array(); global $tsLocale; diff --git a/CRM/Core/I18n/Form.php b/CRM/Core/I18n/Form.php index d843b3de6d..025d300311 100644 --- a/CRM/Core/I18n/Form.php +++ b/CRM/Core/I18n/Form.php @@ -33,7 +33,7 @@ * */ class CRM_Core_I18n_Form extends CRM_Core_Form { - function buildQuickForm() { + public function buildQuickForm() { $config = CRM_Core_Config::singleton(); global $tsLocale; $this->_locales = array_keys($config->languageLimit); @@ -87,11 +87,11 @@ class CRM_Core_I18n_Form extends CRM_Core_Form { * @return array reference to the array of default values * */ - function setDefaultValues() { + public function setDefaultValues() { return $this->_defaults; } - function postProcess() { + public function postProcess() { $values = $this->exportValues(); $table = $values['table']; $field = $values['field']; diff --git a/CRM/Core/I18n/NativeGettext.php b/CRM/Core/I18n/NativeGettext.php index 7f81c5a936..7f8c07ca1b 100644 --- a/CRM/Core/I18n/NativeGettext.php +++ b/CRM/Core/I18n/NativeGettext.php @@ -39,14 +39,14 @@ class CRM_Core_I18n_NativeGettext { * * @return string */ - function translate($string) { + public function translate($string) { return gettext($string); } /** * Based on php-gettext, since native gettext does not support this as is. */ - function pgettext($context, $text) { + public function pgettext($context, $text) { $key = $context . chr(4) . $text; $ret = $this->translate($key); @@ -65,7 +65,7 @@ class CRM_Core_I18n_NativeGettext { * * @return string */ - function ngettext($text, $plural, $count) { + public function ngettext($text, $plural, $count) { return ngettext($text, $plural, $count); } } diff --git a/CRM/Core/I18n/PseudoConstant.php b/CRM/Core/I18n/PseudoConstant.php index 264dd6b765..64fa31bf6d 100644 --- a/CRM/Core/I18n/PseudoConstant.php +++ b/CRM/Core/I18n/PseudoConstant.php @@ -39,7 +39,7 @@ class CRM_Core_I18n_PseudoConstant { * * @return mixed */ - static function longForShort($short) { + public static function longForShort($short) { $longForShortMapping = self::longForShortMapping(); return $longForShortMapping[$short]; } @@ -47,7 +47,7 @@ class CRM_Core_I18n_PseudoConstant { /** * @return array */ - static function &longForShortMapping() { + public static function &longForShortMapping() { static $longForShortMapping = NULL; if ($longForShortMapping === NULL) { $rows = array(); @@ -74,7 +74,7 @@ class CRM_Core_I18n_PseudoConstant { * * @return string */ - static function shortForLong($long) { + public static function shortForLong($long) { return substr($long, 0, 2); } } diff --git a/CRM/Core/I18n/Schema.php b/CRM/Core/I18n/Schema.php index 97e33a8359..e2b0740199 100644 --- a/CRM/Core/I18n/Schema.php +++ b/CRM/Core/I18n/Schema.php @@ -39,7 +39,7 @@ class CRM_Core_I18n_Schema { * * @return void */ - static function dropAllViews() { + public static function dropAllViews() { $domain = new CRM_Core_DAO_Domain(); $domain->find(TRUE); if (!$domain->locales) { @@ -64,7 +64,7 @@ class CRM_Core_I18n_Schema { * * @return void */ - static function makeMultilingual($locale) { + public static function makeMultilingual($locale) { $domain = new CRM_Core_DAO_Domain(); $domain->find(TRUE); @@ -118,7 +118,7 @@ class CRM_Core_I18n_Schema { * * @return void */ - static function makeSinglelingual($retain) { + public static function makeSinglelingual($retain) { $domain = new CRM_Core_DAO_Domain; $domain->find(TRUE); $locales = explode(CRM_Core_DAO::VALUE_SEPARATOR, $domain->locales); @@ -240,7 +240,7 @@ class CRM_Core_I18n_Schema { * * @return void */ - static function addLocale($locale, $source) { + public static function addLocale($locale, $source) { // get the current supported locales $domain = new CRM_Core_DAO_Domain(); $domain->find(TRUE); @@ -297,7 +297,7 @@ class CRM_Core_I18n_Schema { * * @return void */ - static function rebuildMultilingualSchema($locales, $version = NULL) { + public static function rebuildMultilingualSchema($locales, $version = NULL) { if ($version) { $latest = self::getLatestSchema($version); require_once "CRM/Core/I18n/SchemaStructure_{$latest}.php"; @@ -360,7 +360,7 @@ class CRM_Core_I18n_Schema { * * @return string the rewritten query */ - static function rewriteQuery($query) { + public static function rewriteQuery($query) { global $dbLocale; $tables = self::schemaStructureTables(); foreach ($tables as $table) { @@ -377,7 +377,7 @@ class CRM_Core_I18n_Schema { * * @return array */ - static function schemaStructureTables($version = NULL, $force = FALSE) { + public static function schemaStructureTables($version = NULL, $force = FALSE) { static $_tables = NULL; if ($_tables === NULL || $force) { if ($version) { @@ -401,7 +401,7 @@ class CRM_Core_I18n_Schema { * * @return mixed */ - static function getLatestSchema($version) { + public static function getLatestSchema($version) { // remove any .upgrade sub-str from version. Makes it easy to do version_compare & give right result $version = str_ireplace(".upgrade", "", $version); @@ -495,7 +495,7 @@ class CRM_Core_I18n_Schema { * @param $info * @param null $tableName */ - static function triggerInfo(&$info, $tableName = NULL) { + public static function triggerInfo(&$info, $tableName = NULL) { // get the current supported locales $domain = new CRM_Core_DAO_Domain(); $domain->find(TRUE); diff --git a/CRM/Core/I18n/SchemaStructure_2_2_0.php b/CRM/Core/I18n/SchemaStructure_2_2_0.php index 85b4a2cf0e..7d48d89b7e 100644 --- a/CRM/Core/I18n/SchemaStructure_2_2_0.php +++ b/CRM/Core/I18n/SchemaStructure_2_2_0.php @@ -36,7 +36,7 @@ class CRM_Core_I18n_SchemaStructure_2_2_0 { /** * @return mixed */ - static function &columns() { + public static function &columns() { static $result = NULL; if (!$result) { $result = unserialize('a:17:{s:20:"civicrm_custom_group";a:3:{s:5:"title";s:11:"varchar(64)";s:8:"help_pre";s:4:"text";s:9:"help_post";s:4:"text";}s:20:"civicrm_custom_field";a:3:{s:5:"label";s:12:"varchar(255)";s:8:"help_pre";s:4:"text";s:9:"help_post";s:4:"text";}s:20:"civicrm_option_group";a:2:{s:5:"label";s:12:"varchar(255)";s:11:"description";s:12:"varchar(255)";}s:17:"civicrm_price_set";a:3:{s:5:"title";s:12:"varchar(255)";s:8:"help_pre";s:4:"text";s:9:"help_post";s:4:"text";}s:15:"civicrm_contact";a:7:{s:9:"sort_name";s:12:"varchar(128)";s:12:"display_name";s:12:"varchar(128)";s:10:"first_name";s:11:"varchar(64)";s:11:"middle_name";s:11:"varchar(64)";s:9:"last_name";s:11:"varchar(64)";s:14:"household_name";s:12:"varchar(128)";s:17:"organization_name";s:12:"varchar(128)";}s:16:"civicrm_premiums";a:2:{s:20:"premiums_intro_title";s:12:"varchar(255)";s:19:"premiums_intro_text";s:4:"text";}s:15:"civicrm_product";a:3:{s:4:"name";s:12:"varchar(255)";s:11:"description";s:4:"text";s:7:"options";s:4:"text";}s:23:"civicrm_membership_type";a:2:{s:4:"name";s:12:"varchar(128)";s:11:"description";s:12:"varchar(255)";}s:25:"civicrm_membership_status";a:1:{s:4:"name";s:12:"varchar(128)";}s:19:"civicrm_tell_friend";a:5:{s:5:"title";s:12:"varchar(255)";s:5:"intro";s:4:"text";s:17:"suggested_message";s:4:"text";s:14:"thankyou_title";s:12:"varchar(255)";s:13:"thankyou_text";s:4:"text";}s:20:"civicrm_option_value";a:2:{s:5:"label";s:12:"varchar(255)";s:11:"description";s:12:"varchar(255)";}s:19:"civicrm_price_field";a:3:{s:5:"label";s:12:"varchar(255)";s:8:"help_pre";s:4:"text";s:9:"help_post";s:4:"text";}s:25:"civicrm_contribution_page";a:13:{s:5:"title";s:12:"varchar(255)";s:10:"intro_text";s:4:"text";s:14:"pay_later_text";s:4:"text";s:17:"pay_later_receipt";s:4:"text";s:14:"thankyou_title";s:12:"varchar(255)";s:13:"thankyou_text";s:4:"text";s:15:"thankyou_footer";s:4:"text";s:16:"for_organization";s:4:"text";s:17:"receipt_from_name";s:12:"varchar(255)";s:12:"receipt_text";s:4:"text";s:11:"footer_text";s:4:"text";s:17:"honor_block_title";s:12:"varchar(255)";s:16:"honor_block_text";s:4:"text";}s:24:"civicrm_membership_block";a:4:{s:9:"new_title";s:12:"varchar(255)";s:8:"new_text";s:4:"text";s:13:"renewal_title";s:12:"varchar(255)";s:12:"renewal_text";s:4:"text";}s:16:"civicrm_uf_group";a:3:{s:5:"title";s:11:"varchar(64)";s:8:"help_pre";s:4:"text";s:9:"help_post";s:4:"text";}s:16:"civicrm_uf_field";a:2:{s:9:"help_post";s:4:"text";s:5:"label";s:12:"varchar(255)";}s:13:"civicrm_event";a:18:{s:5:"title";s:12:"varchar(255)";s:7:"summary";s:4:"text";s:11:"description";s:4:"text";s:22:"registration_link_text";s:12:"varchar(255)";s:15:"event_full_text";s:4:"text";s:9:"fee_label";s:12:"varchar(255)";s:10:"intro_text";s:4:"text";s:11:"footer_text";s:4:"text";s:13:"confirm_title";s:12:"varchar(255)";s:12:"confirm_text";s:4:"text";s:19:"confirm_footer_text";s:4:"text";s:18:"confirm_email_text";s:4:"text";s:17:"confirm_from_name";s:12:"varchar(255)";s:14:"thankyou_title";s:12:"varchar(255)";s:13:"thankyou_text";s:4:"text";s:20:"thankyou_footer_text";s:4:"text";s:14:"pay_later_text";s:4:"text";s:17:"pay_later_receipt";s:4:"text";}}'); @@ -58,7 +58,7 @@ class CRM_Core_I18n_SchemaStructure_2_2_0 { /** * @return array */ - static function &tables() { + public static function &tables() { static $result = NULL; if (!$result) { $result = array_keys(self::columns()); diff --git a/CRM/Core/I18n/SchemaStructure_3_0_alpha1.php b/CRM/Core/I18n/SchemaStructure_3_0_alpha1.php index 39065c38cb..636667c64d 100644 --- a/CRM/Core/I18n/SchemaStructure_3_0_alpha1.php +++ b/CRM/Core/I18n/SchemaStructure_3_0_alpha1.php @@ -36,7 +36,7 @@ class CRM_Core_I18n_SchemaStructure_3_0_alpha1 { /** * @return array */ - static function &columns() { + public static function &columns() { static $result = NULL; if (!$result) { $result = array( @@ -167,7 +167,7 @@ class CRM_Core_I18n_SchemaStructure_3_0_alpha1 { /** * @return array */ - static function &indices() { + public static function &indices() { static $result = NULL; if (!$result) { $result = array( diff --git a/CRM/Core/I18n/SchemaStructure_3_0_beta1.php b/CRM/Core/I18n/SchemaStructure_3_0_beta1.php index 4bbfbdea45..ed36b59288 100644 --- a/CRM/Core/I18n/SchemaStructure_3_0_beta1.php +++ b/CRM/Core/I18n/SchemaStructure_3_0_beta1.php @@ -36,7 +36,7 @@ class CRM_Core_I18n_SchemaStructure_3_0_beta1 { /** * @return array */ - static function &columns() { + public static function &columns() { static $result = NULL; if (!$result) { $result = array( @@ -175,7 +175,7 @@ class CRM_Core_I18n_SchemaStructure_3_0_beta1 { /** * @return array */ - static function &indices() { + public static function &indices() { static $result = NULL; if (!$result) { $result = array( @@ -256,7 +256,7 @@ class CRM_Core_I18n_SchemaStructure_3_0_beta1 { /** * @return array */ - static function &tables() { + public static function &tables() { static $result = NULL; if (!$result) { $result = array_keys(self::columns()); diff --git a/CRM/Core/I18n/SchemaStructure_3_0_beta4.php b/CRM/Core/I18n/SchemaStructure_3_0_beta4.php index 1a496315c3..1efb13bc2b 100644 --- a/CRM/Core/I18n/SchemaStructure_3_0_beta4.php +++ b/CRM/Core/I18n/SchemaStructure_3_0_beta4.php @@ -36,7 +36,7 @@ class CRM_Core_I18n_SchemaStructure_3_0_beta4 { /** * @return array */ - static function &columns() { + public static function &columns() { static $result = NULL; if (!$result) { $result = array( @@ -188,7 +188,7 @@ class CRM_Core_I18n_SchemaStructure_3_0_beta4 { /** * @return array */ - static function &indices() { + public static function &indices() { static $result = NULL; if (!$result) { $result = array( @@ -269,7 +269,7 @@ class CRM_Core_I18n_SchemaStructure_3_0_beta4 { /** * @return array */ - static function &tables() { + public static function &tables() { static $result = NULL; if (!$result) { $result = array_keys(self::columns()); diff --git a/CRM/Core/I18n/SchemaStructure_3_1_alpha1.php b/CRM/Core/I18n/SchemaStructure_3_1_alpha1.php index 3040437599..929dd6f7cc 100644 --- a/CRM/Core/I18n/SchemaStructure_3_1_alpha1.php +++ b/CRM/Core/I18n/SchemaStructure_3_1_alpha1.php @@ -192,7 +192,7 @@ class CRM_Core_I18n_SchemaStructure_3_1_alpha1 { /** * @return array */ - static function &indices() { + public static function &indices() { static $result = NULL; if (!$result) { $result = array( @@ -273,7 +273,7 @@ class CRM_Core_I18n_SchemaStructure_3_1_alpha1 { /** * @return array */ - static function &tables() { + public static function &tables() { static $result = NULL; if (!$result) { $result = array_keys(self::columns()); diff --git a/CRM/Core/I18n/SchemaStructure_3_1_beta2.php b/CRM/Core/I18n/SchemaStructure_3_1_beta2.php index d75cf1428a..d95755cd7b 100644 --- a/CRM/Core/I18n/SchemaStructure_3_1_beta2.php +++ b/CRM/Core/I18n/SchemaStructure_3_1_beta2.php @@ -36,7 +36,7 @@ class CRM_Core_I18n_SchemaStructure_3_1_beta2 { /** * @return array */ - static function &columns() { + public static function &columns() { static $result = NULL; if (!$result) { $result = array( @@ -195,7 +195,7 @@ class CRM_Core_I18n_SchemaStructure_3_1_beta2 { /** * @return array */ - static function &indices() { + public static function &indices() { static $result = NULL; if (!$result) { $result = array( @@ -276,7 +276,7 @@ class CRM_Core_I18n_SchemaStructure_3_1_beta2 { /** * @return array */ - static function &tables() { + public static function &tables() { static $result = NULL; if (!$result) { $result = array_keys(self::columns()); diff --git a/CRM/Core/I18n/SchemaStructure_3_2_beta4.php b/CRM/Core/I18n/SchemaStructure_3_2_beta4.php index f4d1551e22..9dc9c9e053 100644 --- a/CRM/Core/I18n/SchemaStructure_3_2_beta4.php +++ b/CRM/Core/I18n/SchemaStructure_3_2_beta4.php @@ -36,7 +36,7 @@ class CRM_Core_I18n_SchemaStructure_3_2_beta4 { /** * @return array */ - static function &columns() { + public static function &columns() { static $result = NULL; if (!$result) { $result = array( @@ -196,7 +196,7 @@ class CRM_Core_I18n_SchemaStructure_3_2_beta4 { /** * @return array */ - static function &indices() { + public static function &indices() { static $result = NULL; if (!$result) { $result = array( @@ -277,7 +277,7 @@ class CRM_Core_I18n_SchemaStructure_3_2_beta4 { /** * @return array */ - static function &tables() { + public static function &tables() { static $result = NULL; if (!$result) { $result = array_keys(self::columns()); diff --git a/CRM/Core/I18n/SchemaStructure_3_3_beta1.php b/CRM/Core/I18n/SchemaStructure_3_3_beta1.php index 3749ee80e7..d4fdf16790 100644 --- a/CRM/Core/I18n/SchemaStructure_3_3_beta1.php +++ b/CRM/Core/I18n/SchemaStructure_3_3_beta1.php @@ -37,7 +37,7 @@ class CRM_Core_I18n_SchemaStructure_3_3_beta1 { * @return array */ static - function &columns() { + public function &columns() { static $result = NULL; if (!$result) { $result = array( @@ -206,7 +206,7 @@ class CRM_Core_I18n_SchemaStructure_3_3_beta1 { * @return array */ static - function &indices() { + public function &indices() { static $result = NULL; if (!$result) { $result = array( @@ -288,7 +288,7 @@ class CRM_Core_I18n_SchemaStructure_3_3_beta1 { * @return array */ static - function &tables() { + public function &tables() { static $result = NULL; if (!$result) { $result = array_keys(self::columns()); diff --git a/CRM/Core/I18n/SchemaStructure_3_4_0.php b/CRM/Core/I18n/SchemaStructure_3_4_0.php index 9fb2d2362e..4411f12359 100644 --- a/CRM/Core/I18n/SchemaStructure_3_4_0.php +++ b/CRM/Core/I18n/SchemaStructure_3_4_0.php @@ -36,7 +36,7 @@ class CRM_Core_I18n_SchemaStructure_3_4_0 { /** * @return array */ - static function &columns() { + public static function &columns() { static $result = NULL; if (!$result) { $result = array( @@ -171,7 +171,7 @@ class CRM_Core_I18n_SchemaStructure_3_4_0 { /** * @return array */ - static function &indices() { + public static function &indices() { static $result = NULL; if (!$result) { $result = array( @@ -212,7 +212,7 @@ class CRM_Core_I18n_SchemaStructure_3_4_0 { /** * @return array */ - static function &tables() { + public static function &tables() { static $result = NULL; if (!$result) { $result = array_keys(self::columns()); diff --git a/CRM/Core/I18n/SchemaStructure_3_4_beta2.php b/CRM/Core/I18n/SchemaStructure_3_4_beta2.php index 8c66d826fb..203e588e2b 100644 --- a/CRM/Core/I18n/SchemaStructure_3_4_beta2.php +++ b/CRM/Core/I18n/SchemaStructure_3_4_beta2.php @@ -36,7 +36,7 @@ class CRM_Core_I18n_SchemaStructure_3_4_beta2 { /** * @return array */ - static function &columns() { + public static function &columns() { static $result = NULL; if (!$result) { $result = array( @@ -204,7 +204,7 @@ class CRM_Core_I18n_SchemaStructure_3_4_beta2 { /** * @return array */ - static function &indices() { + public static function &indices() { static $result = NULL; if (!$result) { $result = array( @@ -285,7 +285,7 @@ class CRM_Core_I18n_SchemaStructure_3_4_beta2 { /** * @return array */ - static function &tables() { + public static function &tables() { static $result = NULL; if (!$result) { $result = array_keys(self::columns()); diff --git a/CRM/Core/I18n/SchemaStructure_3_4_beta3.php b/CRM/Core/I18n/SchemaStructure_3_4_beta3.php index a84ee7cfb9..2271d79be8 100644 --- a/CRM/Core/I18n/SchemaStructure_3_4_beta3.php +++ b/CRM/Core/I18n/SchemaStructure_3_4_beta3.php @@ -36,7 +36,7 @@ class CRM_Core_I18n_SchemaStructure_3_4_beta3 { /** * @return array */ - static function &columns() { + public static function &columns() { static $result = NULL; if (!$result) { $result = array( @@ -171,7 +171,7 @@ class CRM_Core_I18n_SchemaStructure_3_4_beta3 { /** * @return array */ - static function &indices() { + public static function &indices() { static $result = NULL; if (!$result) { $result = array( @@ -212,7 +212,7 @@ class CRM_Core_I18n_SchemaStructure_3_4_beta3 { /** * @return array */ - static function &tables() { + public static function &tables() { static $result = NULL; if (!$result) { $result = array_keys(self::columns()); diff --git a/CRM/Core/I18n/SchemaStructure_4_1_0.php b/CRM/Core/I18n/SchemaStructure_4_1_0.php index e80da72428..51bfee57d0 100644 --- a/CRM/Core/I18n/SchemaStructure_4_1_0.php +++ b/CRM/Core/I18n/SchemaStructure_4_1_0.php @@ -36,7 +36,7 @@ class CRM_Core_I18n_SchemaStructure_4_1_0 { /** * @return array */ - static function &columns() { + public static function &columns() { static $result = NULL; if (!$result) { $result = array( @@ -177,7 +177,7 @@ class CRM_Core_I18n_SchemaStructure_4_1_0 { /** * @return array */ - static function &indices() { + public static function &indices() { static $result = NULL; if (!$result) { $result = array( @@ -218,7 +218,7 @@ class CRM_Core_I18n_SchemaStructure_4_1_0 { /** * @return array */ - static function &tables() { + public static function &tables() { static $result = NULL; if (!$result) { $result = array_keys(self::columns()); diff --git a/CRM/Core/I18n/SchemaStructure_4_1_alpha1.php b/CRM/Core/I18n/SchemaStructure_4_1_alpha1.php index 778cae0432..f7157da711 100644 --- a/CRM/Core/I18n/SchemaStructure_4_1_alpha1.php +++ b/CRM/Core/I18n/SchemaStructure_4_1_alpha1.php @@ -36,7 +36,7 @@ class CRM_Core_I18n_SchemaStructure_4_1_alpha1 { /** * @return array */ - static function &columns() { + public static function &columns() { static $result = NULL; if (!$result) { $result = array( @@ -174,7 +174,7 @@ class CRM_Core_I18n_SchemaStructure_4_1_alpha1 { /** * @return array */ - static function &indices() { + public static function &indices() { static $result = NULL; if (!$result) { $result = array( @@ -215,7 +215,7 @@ class CRM_Core_I18n_SchemaStructure_4_1_alpha1 { /** * @return array */ - static function &tables() { + public static function &tables() { static $result = NULL; if (!$result) { $result = array_keys(self::columns()); diff --git a/CRM/Core/I18n/SchemaStructure_4_2_alpha1.php b/CRM/Core/I18n/SchemaStructure_4_2_alpha1.php index 9a935a6f68..f478485942 100644 --- a/CRM/Core/I18n/SchemaStructure_4_2_alpha1.php +++ b/CRM/Core/I18n/SchemaStructure_4_2_alpha1.php @@ -36,7 +36,7 @@ class CRM_Core_I18n_SchemaStructure_4_2_alpha1 /** * @return array */ - static function &columns() + public static function &columns() { static $result = null; if (!$result) { @@ -185,7 +185,7 @@ class CRM_Core_I18n_SchemaStructure_4_2_alpha1 /** * @return array */ - static function &indices() + public static function &indices() { static $result = null; if (!$result) { @@ -227,7 +227,7 @@ class CRM_Core_I18n_SchemaStructure_4_2_alpha1 /** * @return array */ - static function &tables() + public static function &tables() { static $result = null; if (!$result) { diff --git a/CRM/Core/I18n/SchemaStructure_4_3_1.php b/CRM/Core/I18n/SchemaStructure_4_3_1.php index 928f369866..873dd7a80b 100644 --- a/CRM/Core/I18n/SchemaStructure_4_3_1.php +++ b/CRM/Core/I18n/SchemaStructure_4_3_1.php @@ -36,7 +36,7 @@ class CRM_Core_I18n_SchemaStructure_4_3_1 /** * @return array */ - static function &columns() + public static function &columns() { static $result = null; if (!$result) { @@ -190,7 +190,7 @@ class CRM_Core_I18n_SchemaStructure_4_3_1 /** * @return array */ - static function &indices() + public static function &indices() { static $result = null; if (!$result) { @@ -232,7 +232,7 @@ class CRM_Core_I18n_SchemaStructure_4_3_1 /** * @return array */ - static function &tables() + public static function &tables() { static $result = null; if (!$result) { diff --git a/CRM/Core/I18n/SchemaStructure_4_5_alpha1.php b/CRM/Core/I18n/SchemaStructure_4_5_alpha1.php index 11981c3a46..390132ed39 100644 --- a/CRM/Core/I18n/SchemaStructure_4_5_alpha1.php +++ b/CRM/Core/I18n/SchemaStructure_4_5_alpha1.php @@ -36,7 +36,7 @@ class CRM_Core_I18n_SchemaStructure_4_5_alpha1 { /** * @return array */ - static function &columns() { + public static function &columns() { static $result = null; if (!$result) { $result = array( @@ -189,7 +189,7 @@ class CRM_Core_I18n_SchemaStructure_4_5_alpha1 { /** * @return array */ - static function &indices() + public static function &indices() { static $result = null; if (!$result) { @@ -231,7 +231,7 @@ class CRM_Core_I18n_SchemaStructure_4_5_alpha1 { /** * @return array */ - static function &tables() + public static function &tables() { static $result = null; if (!$result) { diff --git a/CRM/Core/I18n/SchemaStructure_4_5_beta2.php b/CRM/Core/I18n/SchemaStructure_4_5_beta2.php index 57f9d7ebb1..2cac3d0632 100644 --- a/CRM/Core/I18n/SchemaStructure_4_5_beta2.php +++ b/CRM/Core/I18n/SchemaStructure_4_5_beta2.php @@ -34,7 +34,7 @@ */ class CRM_Core_I18n_SchemaStructure_4_5_beta2 { - static function &columns() + public static function &columns() { static $result = null; if (!$result) { @@ -188,7 +188,7 @@ class CRM_Core_I18n_SchemaStructure_4_5_beta2 } return $result; } - static function &indices() + public static function &indices() { static $result = null; if (!$result) { @@ -226,7 +226,7 @@ class CRM_Core_I18n_SchemaStructure_4_5_beta2 } return $result; } - static function &tables() + public static function &tables() { static $result = null; if (!$result) { diff --git a/CRM/Core/IDS.php b/CRM/Core/IDS.php index 4690de6011..9f285d2248 100644 --- a/CRM/Core/IDS.php +++ b/CRM/Core/IDS.php @@ -101,7 +101,7 @@ class CRM_Core_IDS { * @return string the full path to the config file * @static */ - static function createConfigFile($force = FALSE) { + public static function createConfigFile($force = FALSE) { $config = CRM_Core_Config::singleton(); $configFile = $config->configAndLogDir . 'Config.IDS.ini'; if (!$force && file_exists($configFile)) { diff --git a/CRM/Core/Invoke.php b/CRM/Core/Invoke.php index 497d552639..2f720d9e60 100644 --- a/CRM/Core/Invoke.php +++ b/CRM/Core/Invoke.php @@ -47,7 +47,7 @@ class CRM_Core_Invoke { * @static * @access public */ - static function invoke($args) { + public static function invoke($args) { try { return self::_invoke($args); } @@ -351,7 +351,7 @@ class CRM_Core_Invoke { * @static * @access public */ - static function form($action, $contact_type, $contact_sub_type) { + public static function form($action, $contact_type, $contact_sub_type) { CRM_Utils_System::setUserContext(array('civicrm/contact/search/basic', 'civicrm/contact/view')); $wrapper = new CRM_Utils_Wrapper(); @@ -369,7 +369,7 @@ class CRM_Core_Invoke { * * @param CRM_Core_Smarty $template */ - static function versionCheck($template) { + public static function versionCheck($template) { if (CRM_Core_Config::isUpgradeMode()) { return; } @@ -390,7 +390,7 @@ class CRM_Core_Invoke { * * @throws Exception */ - static function rebuildMenuAndCaches($triggerRebuild = FALSE, $sessionReset = FALSE) { + public static function rebuildMenuAndCaches($triggerRebuild = FALSE, $sessionReset = FALSE) { $config = CRM_Core_Config::singleton(); $config->clearModuleList(); diff --git a/CRM/Core/Joomla.php b/CRM/Core/Joomla.php index 0466ba0e16..e4f65dc825 100644 --- a/CRM/Core/Joomla.php +++ b/CRM/Core/Joomla.php @@ -46,7 +46,7 @@ class CRM_Core_Joomla { * @access public * @static */ - static function sidebarLeft() { + public static function sidebarLeft() { $config = CRM_Core_Config::singleton(); if ($config->userFrameworkFrontend) { diff --git a/CRM/Core/Key.php b/CRM/Core/Key.php index aab92222c9..e7454e2bad 100644 --- a/CRM/Core/Key.php +++ b/CRM/Core/Key.php @@ -44,7 +44,7 @@ class CRM_Core_Key { * @static * @access private */ - static function privateKey() { + public static function privateKey() { if (!self::$_key) { $session = CRM_Core_Session::singleton(); self::$_key = $session->get('qfPrivateKey'); @@ -59,7 +59,7 @@ class CRM_Core_Key { /** * @return mixed|null|string */ - static function sessionID() { + public static function sessionID() { if (!self::$_sessionID) { $session = CRM_Core_Session::singleton(); self::$_sessionID = $session->get('qfSessionID'); @@ -82,7 +82,7 @@ class CRM_Core_Key { * @static * @access public */ - static function get($name, $addSequence = FALSE) { + public static function get($name, $addSequence = FALSE) { $privateKey = self::privateKey(); $sessionID = self::sessionID(); $key = md5($sessionID . $name . $privateKey); @@ -106,7 +106,7 @@ class CRM_Core_Key { * @static * @access public */ - static function validate($key, $name, $addSequence = FALSE) { + public static function validate($key, $name, $addSequence = FALSE) { if (!is_string($key)) { return NULL; } @@ -134,7 +134,7 @@ class CRM_Core_Key { * * @return bool */ - static function valid($key) { + public static function valid($key) { // a valid key is a 32 digit hex number // followed by an optional _ and a number between 1 and 10000 if (strpos('_', $key) !== FALSE) { diff --git a/CRM/Core/Lock.php b/CRM/Core/Lock.php index e5bfff90c0..73c16cde9f 100644 --- a/CRM/Core/Lock.php +++ b/CRM/Core/Lock.php @@ -54,7 +54,7 @@ class CRM_Core_Lock { * * @return \CRM_Core_Lock the lock object */ - function __construct($name, $timeout = NULL, $serverWideLock = FALSE) { + public function __construct($name, $timeout = NULL, $serverWideLock = FALSE) { $config = CRM_Core_Config::singleton(); $dsnArray = DB::parseDSN($config->dsn); $database = $dsnArray['database']; @@ -80,14 +80,14 @@ class CRM_Core_Lock { $this->acquire(); } - function __destruct() { + public function __destruct() { $this->release(); } /** * @return bool */ - function acquire() { + public function acquire() { if (defined('CIVICRM_LOCK_DEBUG')) { CRM_Core_Error::debug_log_message('acquire lock for ' . $this->_name); } @@ -108,7 +108,7 @@ class CRM_Core_Lock { /** * @return null|string */ - function release() { + public function release() { if ($this->_hasLock) { $this->_hasLock = FALSE; @@ -121,7 +121,7 @@ class CRM_Core_Lock { /** * @return null|string */ - function isFree() { + public function isFree() { $query = "SELECT IS_FREE_LOCK( %1 )"; $params = array(1 => array($this->_name, 'String')); return CRM_Core_DAO::singleValueQuery($query, $params); @@ -130,7 +130,7 @@ class CRM_Core_Lock { /** * @return bool */ - function isAcquired() { + public function isAcquired() { return $this->_hasLock; } @@ -147,7 +147,7 @@ class CRM_Core_Lock { * @throws CRM_Core_Exception * @return boolean */ - function hackyHandleBrokenCode($jobLog) { + public function hackyHandleBrokenCode($jobLog) { if (stristr($this->_name, 'job')) { throw new CRM_Core_Exception('lock aquisition for ' . $this->_name . 'attempted when ' . $jobLog . 'is not released'); } diff --git a/CRM/Core/Menu.php b/CRM/Core/Menu.php index 8c791cc157..26da37939c 100644 --- a/CRM/Core/Menu.php +++ b/CRM/Core/Menu.php @@ -75,7 +75,7 @@ class CRM_Core_Menu { * * @return array */ - static function &xmlItems($fetchFromXML = FALSE) { + public static function &xmlItems($fetchFromXML = FALSE) { if (!self::$_items || $fetchFromXML) { $config = CRM_Core_Config::singleton(); @@ -108,7 +108,7 @@ class CRM_Core_Menu { * * @throws Exception */ - static function read($name, &$menu) { + public static function read($name, &$menu) { $config = CRM_Core_Config::singleton(); @@ -167,7 +167,7 @@ class CRM_Core_Menu { * @static * @access public */ - static function &items($fetchFromXML = FALSE) { + public static function &items($fetchFromXML = FALSE) { return self::xmlItems($fetchFromXML); } @@ -176,7 +176,7 @@ class CRM_Core_Menu { * * @return bool */ - static function isArrayTrue(&$values) { + public static function isArrayTrue(&$values) { foreach ($values as $name => $value) { if (!$value) { return FALSE; @@ -191,7 +191,7 @@ class CRM_Core_Menu { * * @throws Exception */ - static function fillMenuValues(&$menu, $path) { + public static function fillMenuValues(&$menu, $path) { $fieldsToPropagate = array( 'access_callback', 'access_arguments', @@ -244,7 +244,7 @@ class CRM_Core_Menu { * 4. Build the global navigation block * */ - static function build(&$menu) { + public static function build(&$menu) { foreach ($menu as $path => $menuItems) { self::buildBreadcrumb($menu, $path); self::fillMenuValues($menu, $path); @@ -264,7 +264,7 @@ class CRM_Core_Menu { * This function recomputes menu from xml and populates civicrm_menu * @param bool $truncate */ - static function store($truncate = TRUE) { + public static function store($truncate = TRUE) { // first clean up the db if ($truncate) { $query = 'TRUNCATE civicrm_menu'; @@ -304,7 +304,7 @@ class CRM_Core_Menu { /** * @param $menu */ - static function buildAdminLinks(&$menu) { + public static function buildAdminLinks(&$menu) { $values = array(); foreach ($menu as $path => $item) { @@ -355,7 +355,7 @@ class CRM_Core_Menu { * @return mixed * @throws Exception */ - static function &getNavigation($all = FALSE) { + public static function &getNavigation($all = FALSE) { CRM_Core_Error::fatal(); if (!self::$_menuCache) { @@ -464,7 +464,7 @@ class CRM_Core_Menu { /** * @return null */ - static function &getAdminLinks() { + public static function &getAdminLinks() { $links = self::get('admin'); if (!$links || @@ -488,7 +488,7 @@ class CRM_Core_Menu { * @static * @access public */ - static function buildBreadcrumb(&$menu, $path) { + public static function buildBreadcrumb(&$menu, $path) { $crumbs = array(); $pathElements = explode('/', $path); @@ -531,7 +531,7 @@ class CRM_Core_Menu { * @param $menu * @param $path */ - static function buildReturnUrl(&$menu, $path) { + public static function buildReturnUrl(&$menu, $path) { if (!isset($menu[$path]['return_url'])) { list($menu[$path]['return_url'], $menu[$path]['return_url_args']) = self::getReturnUrl($menu, $path); } @@ -543,7 +543,7 @@ class CRM_Core_Menu { * * @return array */ - static function getReturnUrl(&$menu, $path) { + public static function getReturnUrl(&$menu, $path) { if (!isset($menu[$path]['return_url'])) { $pathElements = explode('/', $path); array_pop($pathElements); @@ -571,7 +571,7 @@ class CRM_Core_Menu { * @param $menu * @param $path */ - static function fillComponentIds(&$menu, $path) { + public static function fillComponentIds(&$menu, $path) { static $cache = array(); if (array_key_exists('component_id', $menu[$path])) { @@ -609,7 +609,7 @@ class CRM_Core_Menu { * * @return null */ - static function get($path) { + public static function get($path) { // return null if menu rebuild $config = CRM_Core_Config::singleton(); @@ -716,7 +716,7 @@ UNION ( * * @return mixed */ - static function getArrayForPathArgs($pathArgs) { + public static function getArrayForPathArgs($pathArgs) { if (!is_string($pathArgs)) { return; } diff --git a/CRM/Core/OptionGroup.php b/CRM/Core/OptionGroup.php index 3764e9aa18..26739152df 100644 --- a/CRM/Core/OptionGroup.php +++ b/CRM/Core/OptionGroup.php @@ -209,7 +209,7 @@ WHERE v.option_group_id = g.id * @static * @void */ - static function &valuesByID($id, $flip = FALSE, $grouping = FALSE, $localize = FALSE, $labelColumnName = 'label', $onlyActive = TRUE, $fresh = FALSE) { + public static function &valuesByID($id, $flip = FALSE, $grouping = FALSE, $localize = FALSE, $labelColumnName = 'label', $onlyActive = TRUE, $fresh = FALSE) { $cacheKey = self::createCacheKey($id, $flip, $grouping, $localize, $labelColumnName, $onlyActive); $cache = CRM_Utils_Cache::singleton(); @@ -265,7 +265,7 @@ WHERE v.option_group_id = g.id * @access public * @static */ - static function lookupValues(&$params, &$names, $flip = FALSE) { + public static function lookupValues(&$params, &$names, $flip = FALSE) { foreach ($names as $postName => $value) { // See if $params field is in $names array (i.e. is a value that we need to lookup) if ($postalName = CRM_Utils_Array::value($postName, $params)) { @@ -324,7 +324,7 @@ WHERE v.option_group_id = g.id * * @return null */ - static function getLabel($groupName, $value, $onlyActiveValue = TRUE) { + public static function getLabel($groupName, $value, $onlyActiveValue = TRUE) { if (empty($groupName) || empty($value) ) { @@ -405,7 +405,7 @@ WHERE v.option_group_id = g.id * * @return string the value from the row where is_default = true */ - static function getDefaultValue($groupName) { + public static function getDefaultValue($groupName) { if (empty($groupName)) { return NULL; } @@ -450,7 +450,7 @@ WHERE v.option_group_id = g.id * * @return int the option group ID */ - static function createAssoc($groupName, &$values, &$defaultID, $groupTitle = NULL) { + public static function createAssoc($groupName, &$values, &$defaultID, $groupTitle = NULL) { self::deleteAssoc($groupName); if (!empty($values)) { $group = new CRM_Core_DAO_OptionGroup(); @@ -490,7 +490,7 @@ WHERE v.option_group_id = g.id * @param bool $flip * @param string $field */ - static function getAssoc($groupName, &$values, $flip = FALSE, $field = 'name') { + public static function getAssoc($groupName, &$values, $flip = FALSE, $field = 'name') { $query = " SELECT v.id as amount_id, v.value, v.label, v.name, v.description, v.weight FROM civicrm_option_group g, @@ -534,7 +534,7 @@ ORDER BY v.weight * @param string $groupName * @param string $operator */ - static function deleteAssoc($groupName, $operator = "=") { + public static function deleteAssoc($groupName, $operator = "=") { $query = " DELETE g, v FROM civicrm_option_group g, @@ -553,7 +553,7 @@ DELETE g, v * * @return null|string */ - static function optionLabel($groupName, $value) { + public static function optionLabel($groupName, $value) { $query = " SELECT v.label FROM civicrm_option_group g, @@ -621,7 +621,7 @@ WHERE v.option_group_id = g.id * @param $name * @param array $params */ - static function flush($name, $params = array()){ + public static function flush($name, $params = array()){ $defaults = array( 'flip' => FALSE, 'grouping' => FALSE, @@ -653,7 +653,7 @@ WHERE v.option_group_id = g.id ); } - static function flushAll() { + public static function flushAll() { self::$_values = array(); self::$_cache = array(); CRM_Utils_Cache::singleton()->flush(); diff --git a/CRM/Core/OptionValue.php b/CRM/Core/OptionValue.php index eaaa1a7a07..9e35e2e873 100644 --- a/CRM/Core/OptionValue.php +++ b/CRM/Core/OptionValue.php @@ -70,7 +70,7 @@ class CRM_Core_OptionValue { * @access public * @static */ - static function getRows($groupParams, $links, $orderBy = 'weight') { + public static function getRows($groupParams, $links, $orderBy = 'weight') { $optionValue = array(); $optionGroupID = NULL; @@ -182,7 +182,7 @@ class CRM_Core_OptionValue { * @access public * @static */ - static function addOptionValue(&$params, &$groupParams, &$action, &$optionValueID) { + public static function addOptionValue(&$params, &$groupParams, &$action, &$optionValueID) { $params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE); // checking if the group name with the given id or name (in $groupParams) exists if (!empty($groupParams)) { @@ -250,7 +250,7 @@ class CRM_Core_OptionValue { * @access public * @static */ - static function optionExists($value, $daoName, $daoID, $optionGroupID, $fieldName = 'name') { + public static function optionExists($value, $daoName, $daoID, $optionGroupID, $fieldName = 'name') { $object = new $daoName(); $object->$fieldName = $value; $object->option_group_id = $optionGroupID; @@ -273,7 +273,7 @@ class CRM_Core_OptionValue { * @access public * @static */ - static function getFields($mode = '', $contactType = 'Individual') { + public static function getFields($mode = '', $contactType = 'Individual') { $key = "$mode $contactType"; if (empty(self::$_fields[$key]) || !self::$_fields[$key]) { self::$_fields[$key] = array(); @@ -345,7 +345,7 @@ class CRM_Core_OptionValue { * @return void * @access public */ - static function select(&$query) { + public static function select(&$query) { if (!empty($query->_params) || !empty($query->_returnProperties)) { $field = self::getFields(); foreach ($field as $name => $values) { @@ -380,7 +380,7 @@ class CRM_Core_OptionValue { * @access public * @static */ - static function getValues($groupParams, &$values, $orderBy = 'weight', $isActive = FALSE) { + public static function getValues($groupParams, &$values, $orderBy = 'weight', $isActive = FALSE) { if (empty($groupParams)) { return NULL; } diff --git a/CRM/Core/Page.php b/CRM/Core/Page.php index f2de786a2c..14bc2705d7 100644 --- a/CRM/Core/Page.php +++ b/CRM/Core/Page.php @@ -132,7 +132,7 @@ class CRM_Core_Page { * * @return CRM_Core_Page */ - function __construct($title = NULL, $mode = NULL) { + public function __construct($title = NULL, $mode = NULL) { $this->_name = CRM_Utils_System::getClassName($this); $this->_title = $title; $this->_mode = $mode; @@ -174,7 +174,7 @@ class CRM_Core_Page { * * @return string The content generated by running this page */ - function run() { + public function run() { if ($this->_embedded) { return; } @@ -258,7 +258,7 @@ class CRM_Core_Page { * @return void * */ - function set($name, $value = NULL) { + public function set($name, $value = NULL) { self::$_session->set($name, $value, $this->_name); } @@ -272,7 +272,7 @@ class CRM_Core_Page { * @return mixed * */ - function get($name) { + public function get($name) { return self::$_session->get($name, $this->_name); } @@ -285,7 +285,7 @@ class CRM_Core_Page { * @return void * @access public */ - function assign($var, $value = NULL) { + public function assign($var, $value = NULL) { self::$_template->assign($var, $value); } @@ -298,7 +298,7 @@ class CRM_Core_Page { * @return void * @access public */ - function assign_by_ref($var, &$value) { + public function assign_by_ref($var, &$value) { self::$_template->assign_by_ref($var, $value); } @@ -309,7 +309,7 @@ class CRM_Core_Page { * @param mixed $value the value to append * @param bool $merge */ - function append($tpl_var, $value=NULL, $merge=FALSE) { + public function append($tpl_var, $value=NULL, $merge=FALSE) { self::$_template->append($tpl_var, $value, $merge); } @@ -320,7 +320,7 @@ class CRM_Core_Page { * * @return array */ - function get_template_vars($name=null) { + public function get_template_vars($name=null) { return self::$_template->get_template_vars($name); } @@ -331,7 +331,7 @@ class CRM_Core_Page { * * @return void */ - function reset() { + public function reset() { self::$_session->resetScope($this->_name); } @@ -341,7 +341,7 @@ class CRM_Core_Page { * @return string * @access public */ - function getTemplateFileName() { + public function getTemplateFileName() { return str_replace('_', DIRECTORY_SEPARATOR, CRM_Utils_System::getClassName($this) @@ -352,7 +352,7 @@ class CRM_Core_Page { * A wrapper for getTemplateFileName that includes calling the hook to * prevent us from having to copy & paste the logic of calling the hook */ - function getHookedTemplateFileName() { + public function getHookedTemplateFileName() { $pageTemplateFile = $this->getTemplateFileName(); CRM_Utils_Hook::alterTemplateFile(get_class($this), $this, 'page', $pageTemplateFile); return $pageTemplateFile; @@ -365,7 +365,7 @@ class CRM_Core_Page { * @return string * @access public */ - function overrideExtraTemplateFileName() { + public function overrideExtraTemplateFileName() { return NULL; } @@ -377,7 +377,7 @@ class CRM_Core_Page { * @return void * @access public */ - function setEmbedded($embedded) { + public function setEmbedded($embedded) { $this->_embedded = $embedded; } @@ -387,7 +387,7 @@ class CRM_Core_Page { * @return boolean return the embedded value * @access public */ - function getEmbedded() { + public function getEmbedded() { return $this->_embedded; } @@ -399,7 +399,7 @@ class CRM_Core_Page { * @return void * @access public */ - function setPrint($print) { + public function setPrint($print) { $this->_print = $print; } @@ -409,14 +409,14 @@ class CRM_Core_Page { * @return boolean return the print value * @access public */ - function getPrint() { + public function getPrint() { return $this->_print; } /** * @return CRM_Core_Smarty */ - static function &getTemplate() { + public static function &getTemplate() { return self::$_template; } @@ -425,7 +425,7 @@ class CRM_Core_Page { * * @return null */ - function getVar($name) { + public function getVar($name) { return isset($this->$name) ? $this->$name : NULL; } @@ -433,7 +433,7 @@ class CRM_Core_Page { * @param string $name * @param $value */ - function setVar($name, $value) { + public function setVar($name, $value) { $this->$name = $value; } } diff --git a/CRM/Core/Page/AJAX.php b/CRM/Core/Page/AJAX.php index 1e561c6af5..a603f99ee1 100644 --- a/CRM/Core/Page/AJAX.php +++ b/CRM/Core/Page/AJAX.php @@ -44,7 +44,7 @@ class CRM_Core_Page_AJAX { * @static * @access public */ - static function run() { + public static function run() { $className = CRM_Utils_Type::escape($_REQUEST['class_name'], 'String'); $type = ''; if (!empty($_REQUEST['type'])) { @@ -95,7 +95,7 @@ class CRM_Core_Page_AJAX { * @static * @access public */ - static function setIsQuickConfig() { + public static function setIsQuickConfig() { $id = $context = NULL; if (!empty($_REQUEST['id'])) { $id = CRM_Utils_Type::escape($_REQUEST['id'], 'Integer'); @@ -138,7 +138,7 @@ class CRM_Core_Page_AJAX { * * @return bool */ - static function checkAuthz($type, $className, $fnName = null) { + public static function checkAuthz($type, $className, $fnName = null) { switch ($type) { case 'method': if (!preg_match('/^CRM_[a-zA-Z0-9]+_Page_AJAX$/', $className)) { @@ -167,7 +167,7 @@ class CRM_Core_Page_AJAX { * Outputs the CiviCRM standard json-formatted page/form response * @param array|string $response */ - static function returnJsonResponse($response) { + public static function returnJsonResponse($response) { // Allow lazy callers to not wrap content in an array if (is_string($response)) { $response = array('content' => $response); @@ -200,7 +200,7 @@ class CRM_Core_Page_AJAX { /** * Set headers appropriate for a js file */ - static function setJsHeaders() { + public static function setJsHeaders() { // Encourage browsers to cache for a long time - 1 year $year = 60*60*24*364; header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + $year)); @@ -215,7 +215,7 @@ class CRM_Core_Page_AJAX { * @param string $key - array key to use as the key * @deprecated */ - static function autocompleteResults($results, $val='label', $key='id') { + public static function autocompleteResults($results, $val='label', $key='id') { $output = array(); if (is_array($results)) { foreach ($results as $k => $v) { diff --git a/CRM/Core/Page/AJAX/Location.php b/CRM/Core/Page/AJAX/Location.php index 79bf583442..3ca27474d1 100644 --- a/CRM/Core/Page/AJAX/Location.php +++ b/CRM/Core/Page/AJAX/Location.php @@ -45,7 +45,7 @@ class CRM_Core_Page_AJAX_Location { * This method is used by on-behalf-of form to dynamically generate poulate the * location field values for selected permissioned contact. */ - static function getPermissionedLocation() { + public static function getPermissionedLocation() { $cid = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject, TRUE); $ufId = CRM_Utils_Request::retrieve('ufId', 'Integer', CRM_Core_DAO::$_nullObject, TRUE); @@ -199,15 +199,15 @@ class CRM_Core_Page_AJAX_Location { CRM_Utils_JSON::output($elements); } - static function jqState() { + public static function jqState() { CRM_Utils_JSON::output(CRM_Core_BAO_Location::getChainSelectValues($_GET['_value'], 'country')); } - static function jqCounty() { + public static function jqCounty() { CRM_Utils_JSON::output(CRM_Core_BAO_Location::getChainSelectValues($_GET['_value'], 'stateProvince')); } - static function getLocBlock() { + public static function getLocBlock() { // i wish i could retrieve loc block info based on loc_block_id, // Anyway, lets retrieve an event which has loc_block_id set to 'lbid'. if ($_REQUEST['lbid']) { diff --git a/CRM/Core/Page/Angular.php b/CRM/Core/Page/Angular.php index 0ab871872c..7805ce411c 100644 --- a/CRM/Core/Page/Angular.php +++ b/CRM/Core/Page/Angular.php @@ -19,7 +19,7 @@ class CRM_Core_Page_Angular extends CRM_Core_Page { * * @return string The content generated by running this page */ - function run() { + public function run() { $this->registerResources(CRM_Core_Resources::singleton()); return parent::run(); } diff --git a/CRM/Core/Page/Basic.php b/CRM/Core/Page/Basic.php index b6e1f5bf36..406801fc34 100644 --- a/CRM/Core/Page/Basic.php +++ b/CRM/Core/Page/Basic.php @@ -95,7 +95,7 @@ abstract class CRM_Core_Page_Basic extends CRM_Core_Page { * @return string * @access public */ - function userContextParams($mode = NULL) { + public function userContextParams($mode = NULL) { return 'reset=1&action=browse'; } @@ -121,7 +121,7 @@ abstract class CRM_Core_Page_Basic extends CRM_Core_Page { * @return void * @access public */ - function addValues($controller) {} + public function addValues($controller) {} /** * Class constructor @@ -131,7 +131,7 @@ abstract class CRM_Core_Page_Basic extends CRM_Core_Page { * * @return \CRM_Core_Page_Basic */ - function __construct($title = NULL, $mode = NULL) { + public function __construct($title = NULL, $mode = NULL) { parent::__construct($title, $mode); } @@ -140,7 +140,7 @@ abstract class CRM_Core_Page_Basic extends CRM_Core_Page { * * @return void */ - function run() { + public function run() { // CRM-9034 // dont see args or pageArgs being used, so we should // consider eliminating them in a future version @@ -188,7 +188,7 @@ abstract class CRM_Core_Page_Basic extends CRM_Core_Page { /** * @return string */ - function superRun() { + public function superRun() { return parent::run(); } @@ -198,7 +198,7 @@ abstract class CRM_Core_Page_Basic extends CRM_Core_Page { * @return void * @access public */ - function browse() { + public function browse() { $n = func_num_args(); $action = ($n > 0) ? func_get_arg(0) : NULL; $sort = ($n > 0) ? func_get_arg(1) : NULL; @@ -295,7 +295,7 @@ abstract class CRM_Core_Page_Basic extends CRM_Core_Page { * @return void * @access private */ - function action(&$object, $action, &$values, &$links, $permission, $forceAction = FALSE) { + public function action(&$object, $action, &$values, &$links, $permission, $forceAction = FALSE) { $values['class'] = ''; $newAction = $action; $hasDelete = $hasDisable = TRUE; @@ -371,7 +371,7 @@ abstract class CRM_Core_Page_Basic extends CRM_Core_Page { * * @return void */ - function edit($mode, $id = NULL, $imageUpload = FALSE, $pushUserContext = TRUE) { + public function edit($mode, $id = NULL, $imageUpload = FALSE, $pushUserContext = TRUE) { $controller = new CRM_Core_Controller_Simple($this->editForm(), $this->editName(), $mode, diff --git a/CRM/Core/Page/File.php b/CRM/Core/Page/File.php index ff302aa10d..7ae58327ab 100644 --- a/CRM/Core/Page/File.php +++ b/CRM/Core/Page/File.php @@ -34,7 +34,7 @@ */ class CRM_Core_Page_File extends CRM_Core_Page { - function run() { + public function run() { $eid = CRM_Utils_Request::retrieve('eid', 'Positive', $this, TRUE); $fid = CRM_Utils_Request::retrieve('fid', 'Positive', $this, FALSE); $id = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE); diff --git a/CRM/Core/Page/Inline/Help.php b/CRM/Core/Page/Inline/Help.php index 476ecb5278..3b9efa5b0c 100644 --- a/CRM/Core/Page/Inline/Help.php +++ b/CRM/Core/Page/Inline/Help.php @@ -37,7 +37,7 @@ * This loads a smarty help file via ajax and returns as html */ class CRM_Core_Page_Inline_Help { - function run() { + public function run() { $args = $_REQUEST; if (!empty($args['file']) && strpos($args['file'], '..') === FALSE) { $file = $args['file'] . '.hlp'; diff --git a/CRM/Core/Page/QUnit.php b/CRM/Core/Page/QUnit.php index c0b0538ffe..b068860903 100644 --- a/CRM/Core/Page/QUnit.php +++ b/CRM/Core/Page/QUnit.php @@ -9,7 +9,7 @@ require_once 'CRM/Core/Page.php'; class CRM_Core_Page_QUnit extends CRM_Core_Page { protected $tplFile = NULL; - function run() { + public function run() { list ($ext, $suite) = $this->getRequestExtAndSuite(); if (empty($ext) || empty($suite)) { throw new CRM_Core_Exception("FIXME: Not implemented: QUnit browser"); @@ -50,7 +50,7 @@ class CRM_Core_Page_QUnit extends CRM_Core_Page { * * @return array */ - function getRequestExtAndSuite() { + public function getRequestExtAndSuite() { $config = CRM_Core_Config::singleton(); $arg = explode('/', $_GET[$config->userFrameworkURLVar]); diff --git a/CRM/Core/Page/Redirect.php b/CRM/Core/Page/Redirect.php index 1441ada009..6b71ed5096 100644 --- a/CRM/Core/Page/Redirect.php +++ b/CRM/Core/Page/Redirect.php @@ -12,7 +12,7 @@ * @endcoe */ class CRM_Core_Page_Redirect extends CRM_Core_Page { - function run($path = NULL, $pageArgs = array()) { + public function run($path = NULL, $pageArgs = array()) { $url = self::createUrl($path, $_REQUEST, $pageArgs, TRUE); // return $url; CRM_Utils_System::redirect($url); diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index 0f49ce80d3..c1c2a63172 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -95,7 +95,7 @@ abstract class CRM_Core_Payment { * @static * */ - static function &singleton($mode = 'test', &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) { + public static function &singleton($mode = 'test', &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) { // make sure paymentProcessor is not empty // CRM-7424 if (empty($paymentProcessor)) { @@ -200,7 +200,7 @@ abstract class CRM_Core_Payment { * @param CRM_Core_Form $paymentForm * */ - function setForm(&$paymentForm) { + public function setForm(&$paymentForm) { $this->_paymentForm = $paymentForm; } @@ -209,7 +209,7 @@ abstract class CRM_Core_Payment { * * @return CRM_Core_Form A form object */ - function getForm() { + public function getForm() { return $this->_paymentForm; } @@ -220,7 +220,7 @@ abstract class CRM_Core_Payment { * * @return null */ - function getVar($name) { + public function getVar($name) { return isset($this->$name) ? $this->$name : NULL; } @@ -461,7 +461,7 @@ abstract class CRM_Core_Payment { * * @return bool */ - static function paypalRedirect(&$paymentProcessor) { + public static function paypalRedirect(&$paymentProcessor) { if (!$paymentProcessor) { return FALSE; } @@ -481,7 +481,7 @@ abstract class CRM_Core_Payment { * Page callback for civicrm/payment/ipn * @public */ - static function handleIPN() { + public static function handleIPN() { self::handlePaymentMethod( 'PaymentNotification', array( @@ -502,7 +502,7 @@ abstract class CRM_Core_Payment { * @param $method * @param array $params */ - static function handlePaymentMethod($method, $params = array()) { + public static function handlePaymentMethod($method, $params = array()) { if (!isset($params['processor_id']) && !isset($params['processor_name'])) { CRM_Core_Error::fatal("Either 'processor_id' or 'processor_name' param is required for payment callback"); } @@ -601,7 +601,7 @@ abstract class CRM_Core_Payment { * @return boolean * @public */ - function isSupported($method = 'cancelSubscription') { + public function isSupported($method = 'cancelSubscription') { return method_exists(CRM_Utils_System::getClassName($this), $method); } @@ -612,7 +612,7 @@ abstract class CRM_Core_Payment { * * @return string */ - function subscriptionURL($entityID = NULL, $entity = NULL, $action = 'cancel') { + public function subscriptionURL($entityID = NULL, $entity = NULL, $action = 'cancel') { // Set URL switch ($action) { case 'cancel' : diff --git a/CRM/Core/Payment/AuthorizeNet.php b/CRM/Core/Payment/AuthorizeNet.php index 84f7e3e1bc..f937171ace 100644 --- a/CRM/Core/Payment/AuthorizeNet.php +++ b/CRM/Core/Payment/AuthorizeNet.php @@ -46,7 +46,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { * * @return \CRM_Core_Payment_AuthorizeNet */ - function __construct($mode, &$paymentProcessor) { + public function __construct($mode, &$paymentProcessor) { $this->_mode = $mode; $this->_paymentProcessor = $paymentProcessor; $this->_processorName = ts('Authorize.net'); @@ -75,7 +75,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { * @static * */ - static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) { + public static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) { $processorName = $paymentProcessor['name']; if (!isset(self::$_singleton[$processorName]) || self::$_singleton[$processorName] === NULL) { self::$_singleton[$processorName] = new CRM_Core_Payment_AuthorizeNet($mode, $paymentProcessor); @@ -100,7 +100,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { * @return array the result in a nice formatted array (or an error object) * @public */ - function doDirectPayment(&$params) { + public function doDirectPayment(&$params) { if (!defined('CURLOPT_SSLCERT')) { return self::error(9001, 'Authorize.Net requires curl with SSL support'); } @@ -213,7 +213,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { * * @public */ - function doRecurPayment() { + public function doRecurPayment() { $template = CRM_Core_Smarty::singleton(); $intervalLength = $this->_getParam('frequency_interval'); @@ -349,7 +349,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { /** * @return array */ - function _getAuthorizeNetFields() { + public function _getAuthorizeNetFields() { $amount = $this->_getParam('total_amount');//Total amount is from the form contribution field if(empty($amount)){//CRM-9894 would this ever be the case?? $amount = $this->_getParam('amount'); @@ -400,7 +400,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { * * @return bool True if ID exists, else false */ - function _checkDupe($invoiceId) { + public function _checkDupe($invoiceId) { $contribution = new CRM_Contribute_DAO_Contribution(); $contribution->invoice_id = $invoiceId; return $contribution->find(); @@ -414,7 +414,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { * * @return string the HMAC_MD5 encoding string **/ - function hmac($key, $data) { + public function hmac($key, $data) { if (function_exists('mhash')) { // Use PHP mhash extension return (bin2hex(mhash(MHASH_MD5, $data, $key))); @@ -450,7 +450,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { * * @return bool */ - function checkMD5($responseMD5, $transaction_id, $amount, $ipn = FALSE) { + public function checkMD5($responseMD5, $transaction_id, $amount, $ipn = FALSE) { // cannot check if no MD5 hash $md5Hash = $this->_getParam('md5Hash'); if (empty($md5Hash)) { @@ -473,7 +473,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { * * @return string fingerprint **/ - function CalculateFP() { + public function CalculateFP() { $x_tran_key = $this->_getParam('paymentKey'); $loginid = $this->_getParam('apiLogin'); $sequence = $this->_getParam('sequence'); @@ -492,7 +492,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { * * @return array CSV fields */ - function explode_csv($data) { + public function explode_csv($data) { $data = trim($data); //make it easier to parse fields with quotes in them $data = str_replace('""', "''", $data); @@ -527,7 +527,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { * * @return array refId, resultCode, code, text, subscriptionId */ - function _parseArbReturn($content) { + public function _parseArbReturn($content) { $refId = $this->_substring_between($content, '', ''); $resultCode = $this->_substring_between($content, '', ''); $code = $this->_substring_between($content, '', ''); @@ -548,7 +548,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { * Function is from Authorize.Net sample code, and used to avoid using * PHP5 XML functions */ - function _substring_between(&$haystack, $start, $end) { + public function _substring_between(&$haystack, $start, $end) { if (strpos($haystack, $start) === FALSE || strpos($haystack, $end) === FALSE) { return FALSE; } @@ -568,7 +568,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { * @return mixed value of the field, or empty string if the field is * not set */ - function _getParam($field, $xmlSafe = FALSE) { + public function _getParam($field, $xmlSafe = FALSE) { $value = CRM_Utils_Array::value($field, $this->_params, ''); if ($xmlSafe) { $value = str_replace(array( '&', '"', "'", '<', '>' ), '', $value); @@ -582,7 +582,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { * * @return object */ - function &error($errorCode = NULL, $errorMessage = NULL) { + public function &error($errorCode = NULL, $errorMessage = NULL) { $e = CRM_Core_Error::singleton(); if ($errorCode) { $e->push($errorCode, 0, array( ), $errorMessage); @@ -602,7 +602,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { * * @return bool false if value is not a scalar, true if successful */ - function _setParam($field, $value) { + public function _setParam($field, $value) { if (!is_scalar($value)) { return FALSE; } @@ -617,7 +617,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { * @return string the error message if any * @public */ - function checkConfig() { + public function checkConfig() { $error = array(); if (empty($this->_paymentProcessor['user_name'])) { $error[] = ts('APILogin is not set for this payment processor'); @@ -638,7 +638,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { /** * @return string */ - function accountLoginURL() { + public function accountLoginURL() { return ($this->_mode == 'test') ? 'https://test.authorize.net' : 'https://authorize.net'; } @@ -648,7 +648,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { * * @return bool|object */ - function cancelSubscription(&$message = '', $params = array()) { + public function cancelSubscription(&$message = '', $params = array()) { $template = CRM_Core_Smarty::singleton(); $template->assign('subscriptionType', 'cancel'); @@ -695,7 +695,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { * * @return bool|object */ - function updateSubscriptionBillingInfo(&$message = '', $params = array()) { + public function updateSubscriptionBillingInfo(&$message = '', $params = array()) { $template = CRM_Core_Smarty::singleton(); $template->assign('subscriptionType', 'updateBilling'); @@ -754,7 +754,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { * * @return bool|object */ - function changeSubscriptionAmount(&$message = '', $params = array()) { + public function changeSubscriptionAmount(&$message = '', $params = array()) { $template = CRM_Core_Smarty::singleton(); $template->assign('subscriptionType', 'update'); diff --git a/CRM/Core/Payment/AuthorizeNetIPN.php b/CRM/Core/Payment/AuthorizeNetIPN.php index 97fd481c24..23074e7f7a 100644 --- a/CRM/Core/Payment/AuthorizeNetIPN.php +++ b/CRM/Core/Payment/AuthorizeNetIPN.php @@ -41,7 +41,7 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN { * * @throws CRM_Core_Exception */ - function __construct($inputData) { + public function __construct($inputData) { $this->setInputParameters($inputData); parent::__construct(); } @@ -51,7 +51,7 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN { * * @return bool|void */ - function main($component = 'contribute') { + public function main($component = 'contribute') { //we only get invoice num as a key player from payment gateway response. //for ARB we get x_subscription_id and x_subscription_paynum @@ -97,7 +97,7 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN { * * @return bool */ - function recur(&$input, &$ids, &$objects, $first) { + public function recur(&$input, &$ids, &$objects, $first) { $this->_isRecurring = TRUE; $recur = &$objects['contributionRecur']; @@ -206,7 +206,7 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN { * @param $input * @param $ids */ - function getInput(&$input, &$ids) { + public function getInput(&$input, &$ids) { $input['amount'] = $this->retrieve('x_amount', 'String'); $input['subscription_id'] = $this->retrieve('x_subscription_id', 'Integer'); $input['response_code'] = $this->retrieve('x_response_code', 'Integer'); @@ -247,7 +247,7 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN { * @param $ids * @param $input */ - function getIDs(&$ids, &$input) { + public function getIDs(&$ids, &$input) { $ids['contact'] = $this->retrieve('x_cust_id', 'Integer', FALSE, 0); $ids['contribution'] = $this->retrieve('x_invoice_num', 'Integer'); @@ -310,7 +310,7 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr * @throws CRM_Core_Exception * @return mixed */ - function retrieve($name, $type, $abort = TRUE, $default = NULL) { + public function retrieve($name, $type, $abort = TRUE, $default = NULL) { $value = CRM_Utils_Type::validate( empty($this->_inputParameters[$name]) ? $default : $this->_inputParameters[$name], $type, @@ -328,7 +328,7 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr * * @return bool */ - function checkMD5($ids, $input) { + public function checkMD5($ids, $input) { $paymentProcessor = CRM_Financial_BAO_PaymentProcessor::getPayment($ids['paymentProcessor'], $input['is_test'] ? 'test' : 'live' ); diff --git a/CRM/Core/Payment/BaseIPN.php b/CRM/Core/Payment/BaseIPN.php index 502c9bda7d..7d663e25fb 100644 --- a/CRM/Core/Payment/BaseIPN.php +++ b/CRM/Core/Payment/BaseIPN.php @@ -49,7 +49,7 @@ class CRM_Core_Payment_BaseIPN { /** * Constructor */ - function __construct() { + public function __construct() { self::$_now = date('YmdHis'); } @@ -60,7 +60,7 @@ class CRM_Core_Payment_BaseIPN { * * @throws CRM_Core_Exception */ - function setInputParameters($parameters) { + public function setInputParameters($parameters) { if(!is_array($parameters)) { throw new CRM_Core_Exception('Invalid input parameters'); } @@ -81,7 +81,7 @@ class CRM_Core_Payment_BaseIPN { * @param integer $paymentProcessorID Id of the payment processor ID in use * @return boolean */ - function validateData(&$input, &$ids, &$objects, $required = TRUE, $paymentProcessorID = NULL) { + public function validateData(&$input, &$ids, &$objects, $required = TRUE, $paymentProcessorID = NULL) { // make sure contact exists and is valid $contact = new CRM_Contact_BAO_Contact(); @@ -130,7 +130,7 @@ class CRM_Core_Payment_BaseIPN { * * @return multitype:number NULL |boolean */ - function loadObjects(&$input, &$ids, &$objects, $required, $paymentProcessorID, $error_handling = NULL) { + public function loadObjects(&$input, &$ids, &$objects, $required, $paymentProcessorID, $error_handling = NULL) { if (empty($error_handling)) { // default options are that we log an error & echo it out // note that we should refactor this error handling into error code @ some point @@ -180,7 +180,7 @@ class CRM_Core_Payment_BaseIPN { * @param array $input * @return boolean */ - function failed(&$objects, &$transaction, $input = array()) { + public function failed(&$objects, &$transaction, $input = array()) { $contribution = &$objects['contribution']; $memberships = array(); if (!empty($objects['membership'])) { @@ -251,7 +251,7 @@ class CRM_Core_Payment_BaseIPN { * @param object $transaction * @return boolean */ - function pending(&$objects, &$transaction) { + public function pending(&$objects, &$transaction) { $transaction->commit(); CRM_Core_Error::debug_log_message("returning since contribution status is pending"); echo "Success: Returning since contribution status is pending

"; @@ -265,7 +265,7 @@ class CRM_Core_Payment_BaseIPN { * * @return bool */ - function cancelled(&$objects, &$transaction, $input = array()) { + public function cancelled(&$objects, &$transaction, $input = array()) { $contribution = &$objects['contribution']; $memberships = &$objects['membership']; if (is_numeric($memberships)) { @@ -331,7 +331,7 @@ class CRM_Core_Payment_BaseIPN { * * @return bool */ - function unhandled(&$objects, &$transaction) { + public function unhandled(&$objects, &$transaction) { $transaction->rollback(); CRM_Core_Error::debug_log_message("returning since contribution status: is not handled"); echo "Failure: contribution status is not handled

"; @@ -345,7 +345,7 @@ class CRM_Core_Payment_BaseIPN { * @param $transaction * @param bool $recur */ - function completeTransaction(&$input, &$ids, &$objects, &$transaction, $recur = FALSE) { + public function completeTransaction(&$input, &$ids, &$objects, &$transaction, $recur = FALSE) { $contribution = &$objects['contribution']; $primaryContributionID = isset($contribution->id) ? $contribution->id : $objects['first_contribution']->id; @@ -680,7 +680,7 @@ LIMIT 1;"; * * @return bool */ - function getBillingID(&$ids) { + public function getBillingID(&$ids) { // get the billing location type $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array(), 'validate'); // CRM-8108 remove the ts around the Billing locationtype @@ -708,7 +708,7 @@ LIMIT 1;"; * * @return array */ - function sendMail(&$input, &$ids, &$objects, &$values, $recur = FALSE, $returnMessageText = FALSE) { + public function sendMail(&$input, &$ids, &$objects, &$values, $recur = FALSE, $returnMessageText = FALSE) { $contribution = &$objects['contribution']; $input['is_recur'] = $recur; // set receipt from e-mail and name in value @@ -729,7 +729,7 @@ LIMIT 1;"; * @param $ids * @param $recur */ - function sendRecurringStartOrEndNotification($ids, $recur) { + public function sendRecurringStartOrEndNotification($ids, $recur) { if ($this->_isFirstOrLastRecurringPayment) { $autoRenewMembership = FALSE; if ($recur->id && @@ -755,7 +755,7 @@ LIMIT 1;"; * @param unknown_type $params * @return void|Ambigous */ - function updateContributionStatus(&$params) { + public function updateContributionStatus(&$params) { // get minimum required values. $statusId = CRM_Utils_Array::value('contribution_status_id', $params); $componentId = CRM_Utils_Array::value('component_id', $params); @@ -874,7 +874,7 @@ LIMIT 1;"; /** * @param $contribution */ - function updateRecurLinkedPledge(&$contribution) { + public function updateRecurLinkedPledge(&$contribution) { $returnProperties = array('id', 'pledge_id'); $paymentDetails = $paymentIDs = array(); @@ -940,7 +940,7 @@ LIMIT 1;"; * * @return array */ - function addRecurLineItems($recurId, $contribution) { + public function addRecurLineItems($recurId, $contribution) { $lineSets = array(); $originalContributionID = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $recurId, 'id', 'contribution_recur_id'); @@ -974,7 +974,7 @@ LIMIT 1;"; * @param int $recurId * @param int $targetContributionId */ - function copyCustomValues($recurId, $targetContributionId) { + public function copyCustomValues($recurId, $targetContributionId) { if ($recurId && $targetContributionId) { // get the initial contribution id of recur id $sourceContributionId = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $recurId, 'id', 'contribution_recur_id'); @@ -1019,7 +1019,7 @@ LIMIT 1;"; * @param int $recurId * @param int $targetContributionId */ - function addrecurSoftCredit($recurId, $targetContributionId) { + public function addrecurSoftCredit($recurId, $targetContributionId) { $contriID = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $recurId, 'id', 'contribution_recur_id'); $soft_contribution = new CRM_Contribute_DAO_ContributionSoft(); diff --git a/CRM/Core/Payment/Dummy.php b/CRM/Core/Payment/Dummy.php index ab007b6b29..13a99e1752 100644 --- a/CRM/Core/Payment/Dummy.php +++ b/CRM/Core/Payment/Dummy.php @@ -51,7 +51,7 @@ class CRM_Core_Payment_Dummy extends CRM_Core_Payment { * * @return \CRM_Core_Payment_Dummy */ - function __construct($mode, &$paymentProcessor) { + public function __construct($mode, &$paymentProcessor) { $this->_mode = $mode; $this->_paymentProcessor = $paymentProcessor; $this->_processorName = ts('Dummy Processor'); @@ -69,7 +69,7 @@ class CRM_Core_Payment_Dummy extends CRM_Core_Payment { * @return object * @static */ - static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) { + public static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) { $processorName = $paymentProcessor['name']; if (CRM_Utils_Array::value($processorName, self::$_singleton) === NULL) { self::$_singleton[$processorName] = new CRM_Core_Payment_Dummy($mode, $paymentProcessor); @@ -85,7 +85,7 @@ class CRM_Core_Payment_Dummy extends CRM_Core_Payment { * @return array the result in a nice formatted array (or an error object) * @public */ - function doDirectPayment(&$params) { + public function doDirectPayment(&$params) { // Invoke hook_civicrm_paymentProcessor // In Dummy's case, there is no translation of parameters into // the back-end's canonical set of parameters. But if a processor @@ -140,7 +140,7 @@ class CRM_Core_Payment_Dummy extends CRM_Core_Payment { * * @return object */ - function &error($errorCode = NULL, $errorMessage = NULL) { + public function &error($errorCode = NULL, $errorMessage = NULL) { $e = CRM_Core_Error::singleton(); if ($errorCode) { $e->push($errorCode, 0, NULL, $errorMessage); @@ -157,7 +157,7 @@ class CRM_Core_Payment_Dummy extends CRM_Core_Payment { * @return string the error message if any * @public */ - function checkConfig() { + public function checkConfig() { return NULL; } } diff --git a/CRM/Core/Payment/Elavon.php b/CRM/Core/Payment/Elavon.php index b27ad2e66c..44d1b4912a 100644 --- a/CRM/Core/Payment/Elavon.php +++ b/CRM/Core/Payment/Elavon.php @@ -46,7 +46,7 @@ class CRM_Core_Payment_Elavon extends CRM_Core_Payment { * * @return \CRM_Core_Payment_Elavon ******************************************************* */ - function __construct($mode, &$paymentProcessor) { + public function __construct($mode, &$paymentProcessor) { // live or test $this->_mode = $mode; $this->_paymentProcessor = $paymentProcessor; @@ -63,7 +63,7 @@ class CRM_Core_Payment_Elavon extends CRM_Core_Payment { * @return object * @static */ - static function &singleton($mode, &$paymentProcessor) { + public static function &singleton($mode, &$paymentProcessor) { $processorName = $paymentProcessor['name']; if (self::$_singleton[$processorName] === NULL) { self::$_singleton[$processorName] = new CRM_Core_Payment_Elavon($mode, $paymentProcessor); @@ -77,7 +77,7 @@ class CRM_Core_Payment_Elavon extends CRM_Core_Payment { * * Comment out irrelevant fields **********************************************************/ - function mapProcessorFieldstoParams($params) { + public function mapProcessorFieldstoParams($params) { /********************************************************** * compile array @@ -134,7 +134,7 @@ class CRM_Core_Payment_Elavon extends CRM_Core_Payment { * This function sends request and receives response from * the processor **********************************************************/ - function doDirectPayment(&$params) { + public function doDirectPayment(&$params) { if (isset($params['is_recur']) && $params['is_recur'] == TRUE) { CRM_Core_Error::fatal(ts('Elavon - recurring payments not implemented')); } @@ -313,7 +313,7 @@ class CRM_Core_Payment_Elavon extends CRM_Core_Payment { * * @return bool True if ID exists, else false */ - function _checkDupe($invoiceId) { + public function _checkDupe($invoiceId) { $contribution = new CRM_Contribute_DAO_Contribution(); $contribution->invoice_id = $invoiceId; return $contribution->find(); @@ -322,7 +322,7 @@ class CRM_Core_Payment_Elavon extends CRM_Core_Payment { /************************************************** * Produces error message and returns from class **************************************************/ - function &errorExit($errorCode = NULL, $errorMessage = NULL) { + public function &errorExit($errorCode = NULL, $errorMessage = NULL) { $e = CRM_Core_Error::singleton(); if ($errorCode) { $e->push($errorCode, 0, NULL, $errorMessage); @@ -336,7 +336,7 @@ class CRM_Core_Payment_Elavon extends CRM_Core_Payment { /************************************************** * NOTE: 'doTransferCheckout' not implemented **************************************************/ - function doTransferCheckout(&$params, $component) { + public function doTransferCheckout(&$params, $component) { CRM_Core_Error::fatal(ts('This function is not implemented')); } @@ -355,7 +355,7 @@ class CRM_Core_Payment_Elavon extends CRM_Core_Payment { */ // function checkConfig( $mode ) // CiviCRM V1.9 Declaration // CiviCRM V2.0 Declaration - function checkConfig() { + public function checkConfig() { $errorMsg = array(); if (empty($this->_paymentProcessor['user_name'])) { @@ -379,7 +379,7 @@ class CRM_Core_Payment_Elavon extends CRM_Core_Payment { * * @return string */ - function buildXML($requestFields) { + public function buildXML($requestFields) { $xmlFieldLength['ssl_first_name'] = 15; // credit card name $xmlFieldLength['ssl_last_name'] = 15; @@ -424,7 +424,7 @@ class CRM_Core_Payment_Elavon extends CRM_Core_Payment { * * @return string */ - function tidyStringforXML($value, $fieldlength) { + public function tidyStringforXML($value, $fieldlength) { // the xml is posted to a url so must not contain spaces etc. It also needs to be cut off at a certain // length to match the processor's field length. The cut needs to be made after spaces etc are // transformed but must not include a partial transformed character e.g. %20 must be in or out not half-way @@ -442,7 +442,7 @@ class CRM_Core_Payment_Elavon extends CRM_Core_Payment { * It returns the NodeValue for a given NodeName * or returns an empty string. ************************************************************************/ - function GetNodeValue($NodeName, &$strXML) { + public function GetNodeValue($NodeName, &$strXML) { $OpeningNodeName = "<" . $NodeName . ">"; $ClosingNodeName = ""; @@ -469,7 +469,7 @@ class CRM_Core_Payment_Elavon extends CRM_Core_Payment { * * @return mixed */ - function decodeXMLresponse($Xml) { + public function decodeXMLresponse($Xml) { /** * $xtr = simplexml_load_string($Xml) or die ("Unable to load XML string!"); diff --git a/CRM/Core/Payment/FirstData.php b/CRM/Core/Payment/FirstData.php index bffb103251..d00dc65eab 100644 --- a/CRM/Core/Payment/FirstData.php +++ b/CRM/Core/Payment/FirstData.php @@ -71,7 +71,7 @@ class CRM_Core_Payment_FirstData extends CRM_Core_Payment { * * @return \CRM_Core_Payment_FirstData ******************************************************* */ - function __construct($mode, &$paymentProcessor) { + public function __construct($mode, &$paymentProcessor) { // live or test $this->_mode = $mode; $this->_paymentProcessor = $paymentProcessor; @@ -87,7 +87,7 @@ class CRM_Core_Payment_FirstData extends CRM_Core_Payment { * @return object * @static */ - static function &singleton($mode, &$paymentProcessor) { + public static function &singleton($mode, &$paymentProcessor) { $processorName = $paymentProcessor['name']; if (self::$_singleton[$processorName] === NULL) { self::$_singleton[$processorName] = new CRM_Core_Payment_FirstData($mode, $paymentProcessor); @@ -101,7 +101,7 @@ class CRM_Core_Payment_FirstData extends CRM_Core_Payment { * * Comment out irrelevant fields **********************************************************/ - function mapProcessorFieldstoParams($params) { + public function mapProcessorFieldstoParams($params) { /*concatenate full customer name first - code from EWAY gateway */ @@ -159,7 +159,7 @@ class CRM_Core_Payment_FirstData extends CRM_Core_Payment { * This function sends request and receives response from * the processor **********************************************************/ - function doDirectPayment(&$params) { + public function doDirectPayment(&$params) { if ($params['is_recur'] == TRUE) { CRM_Core_Error::fatal(ts('%1 - recurring payments not implemented', array(1 => $paymentProcessor))); } @@ -326,7 +326,7 @@ class CRM_Core_Payment_FirstData extends CRM_Core_Payment { * * @return bool True if ID exists, else false */ - function _checkDupe($invoiceId) { + public function _checkDupe($invoiceId) { $contribution = new CRM_Contribute_DAO_Contribution(); $contribution->invoice_id = $invoiceId; return $contribution->find(); @@ -335,7 +335,7 @@ class CRM_Core_Payment_FirstData extends CRM_Core_Payment { /************************************************** * Produces error message and returns from class **************************************************/ - function &errorExit($errorCode = NULL, $errorMessage = NULL) { + public function &errorExit($errorCode = NULL, $errorMessage = NULL) { $e = CRM_Core_Error::singleton(); if ($errorCode) { @@ -350,7 +350,7 @@ class CRM_Core_Payment_FirstData extends CRM_Core_Payment { /************************************************** * NOTE: 'doTransferCheckout' not implemented **************************************************/ - function doTransferCheckout(&$params, $component) { + public function doTransferCheckout(&$params, $component) { CRM_Core_Error::fatal(ts('This function is not implemented')); } @@ -369,7 +369,7 @@ class CRM_Core_Payment_FirstData extends CRM_Core_Payment { */ // function checkConfig( $mode ) // CiviCRM V1.9 Declaration // CiviCRM V2.0 Declaration - function checkConfig() { + public function checkConfig() { $errorMsg = array(); if (empty($this->_paymentProcessor['user_name'])) { diff --git a/CRM/Core/Payment/Form.php b/CRM/Core/Payment/Form.php index 3e38f99bf0..28a94bad07 100644 --- a/CRM/Core/Payment/Form.php +++ b/CRM/Core/Payment/Form.php @@ -206,7 +206,7 @@ class CRM_Core_Payment_Form { * * @return array */ - static function getPaymentFields($paymentProcessor) { + public static function getPaymentFields($paymentProcessor) { $paymentProcessorObject = CRM_Core_Payment::singleton(($paymentProcessor['is_test'] ? 'test' : 'live'), $paymentProcessor); return $paymentProcessorObject->getPaymentFormFields(); } @@ -216,7 +216,7 @@ class CRM_Core_Payment_Form { * * @return array */ - static function getPaymentFieldMetadata($paymentProcessor) { + public static function getPaymentFieldMetadata($paymentProcessor) { $paymentProcessorObject = CRM_Core_Payment::singleton(($paymentProcessor['is_test'] ? 'test' : 'live'), $paymentProcessor); return $paymentProcessorObject->getPaymentFormFieldsMetadata(); } @@ -226,7 +226,7 @@ class CRM_Core_Payment_Form { * * @return string */ - static function getPaymentTypeName($paymentProcessor) { + public static function getPaymentTypeName($paymentProcessor) { $paymentProcessorObject = CRM_Core_Payment::singleton(($paymentProcessor['is_test'] ? 'test' : 'live'), $paymentProcessor); return $paymentProcessorObject->getPaymentTypeName(); } @@ -236,7 +236,7 @@ class CRM_Core_Payment_Form { * * @return string */ - static function getPaymentTypeLabel($paymentProcessor) { + public static function getPaymentTypeLabel($paymentProcessor) { $paymentProcessorObject = CRM_Core_Payment::singleton(($paymentProcessor['is_test'] ? 'test' : 'live'), $paymentProcessor); return ts(($paymentProcessorObject->getPaymentTypeLabel()) . ' Information'); } @@ -250,7 +250,7 @@ class CRM_Core_Payment_Form { * * @return bool */ - static function buildPaymentForm($form, $processor, $isBillingDataOptional){ + public static function buildPaymentForm($form, $processor, $isBillingDataOptional){ //if the form has address fields assign to the template so the js can decide what billing fields to show $profileAddressFields = $form->get('profileAddressFields'); if (!empty($profileAddressFields)) { @@ -316,7 +316,7 @@ class CRM_Core_Payment_Form { * The credit card pseudo constant results only the CC label, not the key ID * So we normalize the name to use it as a CSS class. */ - static function getCreditCardCSSNames() { + public static function getCreditCardCSSNames() { $creditCardTypes = array(); foreach (CRM_Contribute_PseudoConstant::creditCard() as $key => $name) { // Replace anything not css-friendly by an underscore @@ -334,7 +334,7 @@ class CRM_Core_Payment_Form { * Make sure that credit card number and cvv are valid * Called within the scope of a QF formRule function */ - static function validateCreditCard($values, &$errors) { + public static function validateCreditCard($values, &$errors) { if (!empty($values['credit_card_type'])) { if (!empty($values['credit_card_number']) && !CRM_Utils_Rule::creditCardNumber($values['credit_card_number'], $values['credit_card_type']) @@ -363,7 +363,7 @@ class CRM_Core_Payment_Form { * @return void * @static */ - static function mapParams($id, &$src, &$dst, $reverse = FALSE) { + public static function mapParams($id, &$src, &$dst, $reverse = FALSE) { static $map = NULL; if (!$map) { $map = array( @@ -404,7 +404,7 @@ class CRM_Core_Payment_Form { * @return int * @static */ - static function getCreditCardExpirationMonth($src) { + public static function getCreditCardExpirationMonth($src) { if ($month = CRM_Utils_Array::value('M', $src['credit_card_exp_date'])) { return $month; } @@ -422,7 +422,7 @@ class CRM_Core_Payment_Form { * @return int * @static */ - static function getCreditCardExpirationYear($src) { + public static function getCreditCardExpirationYear($src) { return CRM_Utils_Array::value('Y', $src['credit_card_exp_date']); } } diff --git a/CRM/Core/Payment/Google.php b/CRM/Core/Payment/Google.php index 66c64b4020..e057e532e5 100644 --- a/CRM/Core/Payment/Google.php +++ b/CRM/Core/Payment/Google.php @@ -68,7 +68,7 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment { * * @return \CRM_Core_Payment_Google */ - function __construct($mode, &$paymentProcessor) { + public function __construct($mode, &$paymentProcessor) { $this->_mode = $mode; $this->_paymentProcessor = $paymentProcessor; $this->_processorName = ts('Google Checkout'); @@ -84,7 +84,7 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment { * @return object * @static */ - static function &singleton($mode, &$paymentProcessor) { + public static function &singleton($mode, &$paymentProcessor) { $processorName = $paymentProcessor['name']; if (!isset(self::$_singleton[$processorName]) || self::$_singleton[$processorName] === NULL) { self::$_singleton[$processorName] = new CRM_Core_Payment_Google($mode, $paymentProcessor); @@ -98,7 +98,7 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment { * @return string the error message if any * @public */ - function checkConfig() { + public function checkConfig() { $config = CRM_Core_Config::singleton(); $error = array(); @@ -128,7 +128,7 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment { * @return array the result in an nice formatted array (or an error object) * @abstract */ - function doDirectPayment(&$params) { + public function doDirectPayment(&$params) { CRM_Core_Error::fatal(ts('This function is not implemented')); } @@ -142,7 +142,7 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment { * @return void * @access public */ - function doTransferCheckout(&$params, $component) { + public function doTransferCheckout(&$params, $component) { $component = strtolower($component); if (!empty($params['is_recur']) && @@ -169,7 +169,7 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment { * @param array $params * @param $component */ - function doRecurCheckout(&$params, $component) { + public function doRecurCheckout(&$params, $component) { $intervalUnit = CRM_Utils_Array::value('frequency_unit', $params); if ($intervalUnit == 'week') { $intervalUnit = 'WEEKLY'; @@ -216,7 +216,7 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment { * @access public * */ - function submitPostParams($params, $component, $cart) { + public function submitPostParams($params, $component, $cart) { $url = rtrim($this->_paymentProcessor['url_site'], '/') . '/cws/v2/Merchant/' . $this->_paymentProcessor['user_name'] . '/checkout'; if ($component == "event") { @@ -304,7 +304,7 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment { * @searchParamsnvpStr is the array of search params. * returns an associtive array containing the response from the server. */ - function invokeAPI($paymentProcessor, $searchParams) { + public function invokeAPI($paymentProcessor, $searchParams) { $merchantID = $paymentProcessor['user_name']; $merchantKey = $paymentProcessor['password']; $siteURL = rtrim(str_replace('https://', '', $paymentProcessor['url_site']), '/'); @@ -358,7 +358,7 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment { * * @return string */ - static function buildXMLQuery($searchParams) { + public static function buildXMLQuery($searchParams) { $xml = ' '; @@ -396,7 +396,7 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment { * * @return array */ - static function getArrayFromXML($xmlData) { + public static function getArrayFromXML($xmlData) { require_once 'Google/library/xml-processing/gc_xmlparser.php'; $xmlParser = new gc_XmlParser($xmlData); $root = $xmlParser->GetRoot(); @@ -411,7 +411,7 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment { * * @return object */ - function &error($errorCode = NULL, $errorMessage = NULL) { + public function &error($errorCode = NULL, $errorMessage = NULL) { $e = &CRM_Core_Error::singleton(); if ($errorCode) { $e->push($errorCode, 0, NULL, $errorMessage); @@ -425,7 +425,7 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment { /** * @return string */ - function accountLoginURL() { + public function accountLoginURL() { return ($this->_mode == 'test') ? 'https://sandbox.google.com/checkout/sell' : 'https://checkout.google.com/'; } @@ -435,7 +435,7 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment { * * @return bool|object */ - function cancelSubscription(&$message = '', $params = array()) { + public function cancelSubscription(&$message = '', $params = array()) { $orderNo = CRM_Utils_Array::value('subscriptionId', $params); $merchant_id = $this->_paymentProcessor['user_name']; diff --git a/CRM/Core/Payment/GoogleIPN.php b/CRM/Core/Payment/GoogleIPN.php index c0679d1874..25bf5a2596 100644 --- a/CRM/Core/Payment/GoogleIPN.php +++ b/CRM/Core/Payment/GoogleIPN.php @@ -65,7 +65,7 @@ class CRM_Core_Payment_GoogleIPN extends CRM_Core_Payment_BaseIPN { * * @return mixed */ - static function retrieve($name, $type, $object, $abort = TRUE) { + public static function retrieve($name, $type, $object, $abort = TRUE) { $value = CRM_Utils_Array::value($name, $object); if ($abort && $value === NULL) { CRM_Core_Error::debug_log_message("Could not find an entry for $name"); @@ -93,7 +93,7 @@ class CRM_Core_Payment_GoogleIPN extends CRM_Core_Payment_BaseIPN { * * @return \CRM_Core_Payment_GoogleIPN */ - function __construct($mode, &$paymentProcessor) { + public function __construct($mode, &$paymentProcessor) { parent::__construct(); $this->_mode = $mode; @@ -110,7 +110,7 @@ class CRM_Core_Payment_GoogleIPN extends CRM_Core_Payment_BaseIPN { * * @return void */ - function newOrderNotify($dataRoot, $privateData, $component) { + public function newOrderNotify($dataRoot, $privateData, $component) { $ids = $input = $params = array(); $input['component'] = strtolower($component); @@ -251,7 +251,7 @@ class CRM_Core_Payment_GoogleIPN extends CRM_Core_Payment_BaseIPN { * * @return void */ - function orderStateChange($status, $dataRoot, $privateData, $component) { + public function orderStateChange($status, $dataRoot, $privateData, $component) { $input = $objects = $ids = array(); $input['component'] = strtolower($component); @@ -343,7 +343,7 @@ class CRM_Core_Payment_GoogleIPN extends CRM_Core_Payment_BaseIPN { * @param $ids * @param $objects */ - function completeRecur($input, $ids, $objects) { + public function completeRecur($input, $ids, $objects) { if ($ids['contributionRecur']) { $recur = &$objects['contributionRecur']; $contributionCount = CRM_Core_DAO::singleValueQuery(" @@ -402,7 +402,7 @@ WHERE contribution_recur_id = {$ids['contributionRecur']} * @return object * @static */ - static function &singleton($mode, $component, &$paymentProcessor) { + public static function &singleton($mode, $component, &$paymentProcessor) { if (self::$_singleton === NULL) { self::$_singleton = new CRM_Core_Payment_GoogleIPN($mode, $paymentProcessor); } @@ -417,7 +417,7 @@ WHERE contribution_recur_id = {$ids['contributionRecur']} * @return amount * @access public */ - function getAmount($orderNo) { + public function getAmount($orderNo) { $contribution = new CRM_Contribute_DAO_Contribution(); $contribution->invoice_id = $orderNo; if (!$contribution->find(TRUE)) { @@ -441,7 +441,7 @@ WHERE contribution_recur_id = {$ids['contributionRecur']} * @return array context of this call (test, module, payment processor id) * @static */ - function getContext($privateData, $orderNo, $root, $response, $serial) { + public function getContext($privateData, $orderNo, $root, $response, $serial) { $contributionID = CRM_Utils_Array::value('contributionID', $privateData); $contribution = new CRM_Contribute_DAO_Contribution(); if ($root == 'new-order-notification') { @@ -508,7 +508,7 @@ WHERE contribution_recur_id = {$ids['contributionRecur']} * a notification or request is sent by the Google Server. * */ - static function main($xml_response) { + public static function main($xml_response) { require_once 'Google/library/googleresponse.php'; require_once 'Google/library/googlerequest.php'; require_once 'Google/library/googlemerchantcalculations.php'; @@ -654,7 +654,7 @@ WHERE contribution_recur_id = {$ids['contributionRecur']} * * @return bool */ - function getInput(&$input, &$ids, $dataRoot) { + public function getInput(&$input, &$ids, $dataRoot) { if (!$this->getBillingID($ids)) { return FALSE; } @@ -684,7 +684,7 @@ WHERE contribution_recur_id = {$ids['contributionRecur']} * Converts the comma separated name-value pairs in * to an array of name-value pairs. */ - static function stringToArray($str) { + public static function stringToArray($str) { $vars = $labels = array(); $labels = explode(',', $str); foreach ($labels as $label) { diff --git a/CRM/Core/Payment/IATS.php b/CRM/Core/Payment/IATS.php index ebc8f48aae..6a9a77028b 100644 --- a/CRM/Core/Payment/IATS.php +++ b/CRM/Core/Payment/IATS.php @@ -57,7 +57,7 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment { * * @return \CRM_Core_Payment_IATS */ - function __construct($mode, &$paymentProcessor) { + public function __construct($mode, &$paymentProcessor) { $this->_paymentProcessor = $paymentProcessor; $this->_processorName = ts('IATS'); @@ -80,7 +80,7 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment { * * @return mixed */ - static function &singleton($mode, &$paymentProcessor) { + public static function &singleton($mode, &$paymentProcessor) { $processorName = $paymentProcessor['name']; if (self::$_singleton[$processorName] === NULL) { self::$_singleton[$processorName] = new CRM_Core_Payment_IATS($mode, $paymentProcessor); @@ -97,7 +97,7 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment { * @return array the result in an nice formatted array (or an error object) * @abstract */ - function doDirectPayment(&$params) { + public function doDirectPayment(&$params) { // $result = ''; // foreach($params as $key => $value) { // $result .= "$key: $value
"; @@ -266,7 +266,7 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment { * * @return object */ - function &error($error = NULL) { + public function &error($error = NULL) { $e = CRM_Core_Error::singleton(); if (is_object($error)) { $e->push($error->getResponseCode(), @@ -297,7 +297,7 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment { * * @return string */ - function errorString($error_id) { + public function errorString($error_id) { $errors = array( 1 => 'Agent Code has not been set up on the authorization system.', 2 => 'Unable to process transaction. Verify and re-enter credit card information.', @@ -339,7 +339,7 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment { * @return string the error message if any * @public */ - function checkConfig() { + public function checkConfig() { $error = array(); if (empty($this->_paymentProcessor['signature'])) { diff --git a/CRM/Core/Payment/Moneris.php b/CRM/Core/Payment/Moneris.php index 318ae89af1..bfd27c5b27 100644 --- a/CRM/Core/Payment/Moneris.php +++ b/CRM/Core/Payment/Moneris.php @@ -55,7 +55,7 @@ class CRM_Core_Payment_Moneris extends CRM_Core_Payment { * * @return \CRM_Core_Payment_Moneris */ - function __construct($mode, &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) { + public function __construct($mode, &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) { $this->_mode = $mode; $this->_paymentProcessor = $paymentProcessor; $this->_processorName = ts('Moneris'); @@ -88,7 +88,7 @@ class CRM_Core_Payment_Moneris extends CRM_Core_Payment { * @return object * @static */ - static function &singleton($mode, &$paymentProcessor) { + public static function &singleton($mode, &$paymentProcessor) { $processorName = $paymentProcessor['name']; if (self::$_singleton[$processorName] === NULL) { self::$_singleton[$processorName] = new CRM_Core_Payment_Moneris($mode, $paymentProcessor); @@ -105,7 +105,7 @@ class CRM_Core_Payment_Moneris extends CRM_Core_Payment { * @return array the result in an nice formatted array (or an error object) * @abstract */ - function doDirectPayment(&$params) { + public function doDirectPayment(&$params) { //make sure i've been called correctly ... if (!$this->_profile) { return self::error('Unexpected error, missing profile'); @@ -254,7 +254,7 @@ class CRM_Core_Payment_Moneris extends CRM_Core_Payment { * * @return bool */ - function isError(&$response) { + public function isError(&$response) { $responseCode = $response->getResponseCode(); if (is_null($responseCode)) { return TRUE; @@ -274,7 +274,7 @@ class CRM_Core_Payment_Moneris extends CRM_Core_Payment { * * @return object */ - function &checkResult(&$response) { + public function &checkResult(&$response) { return $response; $errors = $response->getErrors(); @@ -305,7 +305,7 @@ class CRM_Core_Payment_Moneris extends CRM_Core_Payment { * * @return object */ - function &error($error = NULL) { + public function &error($error = NULL) { $e = CRM_Core_Error::singleton(); if (is_object($error)) { $e->push($error->getResponseCode(), @@ -331,7 +331,7 @@ class CRM_Core_Payment_Moneris extends CRM_Core_Payment { * @return string the error message if any * @public */ - function checkConfig() { + public function checkConfig() { $error = array(); if (empty($this->_paymentProcessor['signature'])) { diff --git a/CRM/Core/Payment/PayJunction.php b/CRM/Core/Payment/PayJunction.php index 3927f24c96..78273ef355 100644 --- a/CRM/Core/Payment/PayJunction.php +++ b/CRM/Core/Payment/PayJunction.php @@ -37,7 +37,7 @@ class CRM_Core_Payment_PayJunction extends CRM_Core_Payment { * * @return \CRM_Core_Payment_PayJunction */ - function __construct($mode, &$paymentProcessor) { + public function __construct($mode, &$paymentProcessor) { //require PayJunction API library require_once 'PayJunction/pjClasses.php'; @@ -58,7 +58,7 @@ class CRM_Core_Payment_PayJunction extends CRM_Core_Payment { * @return object * @static */ - static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = false) { + public static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = false) { $processorName = $paymentProcessor['name']; if (self::$_singleton[$processorName] === NULL) { self::$_singleton[$processorName] = new CRM_Core_Payment_PayJunction($mode, $paymentProcessor); @@ -79,7 +79,7 @@ class CRM_Core_Payment_PayJunction extends CRM_Core_Payment { * @return array the result in an nice formatted array (or an error object) * @abstract */ - function doDirectPayment(&$params) { + public function doDirectPayment(&$params) { $logon = $this->_paymentProcessor['user_name']; $password = $this->_paymentProcessor['password']; $url_site = $this->_paymentProcessor['url_site']; @@ -204,7 +204,7 @@ class CRM_Core_Payment_PayJunction extends CRM_Core_Payment { * * @return bool */ - function isError(&$response) { + public function isError(&$response) { $responseCode = $response['dc_response_code']; if ($responseCode == "00" || $responseCode == "85") { @@ -222,7 +222,7 @@ class CRM_Core_Payment_PayJunction extends CRM_Core_Payment { * * @return mixed */ - function &checkResult(&$response) { + public function &checkResult(&$response) { return $response; } @@ -234,7 +234,7 @@ class CRM_Core_Payment_PayJunction extends CRM_Core_Payment { * @return mixed value of the field, or empty string if the field is * not set */ - function _getParam($field) { + public function _getParam($field) { if (isset($this->_params[$field])) { return $this->_params[$field]; } @@ -248,7 +248,7 @@ class CRM_Core_Payment_PayJunction extends CRM_Core_Payment { * * @return object */ - function &error($error = NULL) { + public function &error($error = NULL) { $e = CRM_Core_Error::singleton(); if ($error) { $e->push($error['dc_response_code'], @@ -271,7 +271,7 @@ class CRM_Core_Payment_PayJunction extends CRM_Core_Payment { * * @return bool false if value is not a scalar, true if successful */ - function _setParam($field, $value) { + public function _setParam($field, $value) { if (!is_scalar($value)) { return FALSE; } @@ -286,7 +286,7 @@ class CRM_Core_Payment_PayJunction extends CRM_Core_Payment { * @return string the error message if any * @public */ - function checkConfig() { + public function checkConfig() { $error = array(); if (empty($this->_paymentProcessor['user_name'])) { $error[] = ts('Username is not set for this payment processor'); diff --git a/CRM/Core/Payment/PayPalIPN.php b/CRM/Core/Payment/PayPalIPN.php index 3c1e658916..448d377fc4 100644 --- a/CRM/Core/Payment/PayPalIPN.php +++ b/CRM/Core/Payment/PayPalIPN.php @@ -39,7 +39,7 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { /** * Constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -51,7 +51,7 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { * * @return mixed */ - static function retrieve($name, $type, $location = 'POST', $abort = TRUE) { + public static function retrieve($name, $type, $location = 'POST', $abort = TRUE) { static $store = NULL; $value = CRM_Utils_Request::retrieve($name, $type, $store, FALSE, NULL, $location @@ -70,7 +70,7 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { * @param $objects * @param $first */ - function recur(&$input, &$ids, &$objects, $first) { + public function recur(&$input, &$ids, &$objects, $first) { if (!isset($input['txnType'])) { CRM_Core_Error::debug_log_message("Could not find txn_type in input request"); echo "Failure: Invalid parameters

"; @@ -285,7 +285,7 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { $this->completeTransaction($input, $ids, $objects, $transaction, $recur); } - function main() { + public function main() { //@todo - this could be refactored like PayPalProIPN & a test could be added $objects = $ids = $input = array(); @@ -342,7 +342,7 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { * @param $input * @param $ids */ - function getInput(&$input, &$ids) { + public function getInput(&$input, &$ids) { if (!$this->getBillingID($ids)) { return FALSE; } diff --git a/CRM/Core/Payment/PayPalImpl.php b/CRM/Core/Payment/PayPalImpl.php index b4dbc8546c..058c0b4074 100644 --- a/CRM/Core/Payment/PayPalImpl.php +++ b/CRM/Core/Payment/PayPalImpl.php @@ -55,7 +55,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { * * @return \CRM_Core_Payment_PayPalImpl */ - function __construct($mode, &$paymentProcessor) { + public function __construct($mode, &$paymentProcessor) { $this->_mode = $mode; $this->_paymentProcessor = $paymentProcessor; $this->_processorName = ts('PayPal Pro'); @@ -86,7 +86,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { * @return object * @static */ - static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) { + public static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) { $processorName = $paymentProcessor['name']; if (!isset(self::$_singleton[$processorName]) || self::$_singleton[$processorName] === NULL) { self::$_singleton[$processorName] = new CRM_Core_Payment_PaypalImpl($mode, $paymentProcessor); @@ -112,7 +112,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { * @return array the result in an nice formatted array (or an error object) * @public */ - function setExpressCheckOut(&$params) { + public function setExpressCheckOut(&$params) { $args = array(); $this->initialize($args, 'SetExpressCheckout'); @@ -156,7 +156,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { * @return array the result in an nice formatted array (or an error object) * @public */ - function getExpressCheckoutDetails($token) { + public function getExpressCheckoutDetails($token) { $args = array(); $this->initialize($args, 'GetExpressCheckoutDetails'); @@ -199,7 +199,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { * @return array the result in an nice formatted array (or an error object) * @public */ - function doExpressCheckout(&$params) { + public function doExpressCheckout(&$params) { $args = array(); $this->initialize($args, 'DoExpressCheckoutPayment'); @@ -241,7 +241,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { * * @return mixed */ - function createRecurringPayments(&$params) { + public function createRecurringPayments(&$params) { $args = array(); $this->initialize($args, 'CreateRecurringPaymentsProfile'); @@ -298,7 +298,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { * @param $args * @param $method */ - function initialize(&$args, $method) { + public function initialize(&$args, $method) { $args['user'] = $this->_paymentProcessor['user_name']; $args['pwd'] = $this->_paymentProcessor['password']; $args['version'] = 3.0; @@ -317,7 +317,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { * @return array the result in an nice formatted array (or an error object) * @public */ - function doDirectPayment(&$params, $component = 'contribute') { + public function doDirectPayment(&$params, $component = 'contribute') { $args = array(); $this->initialize($args, 'DoDirectPayment'); @@ -394,7 +394,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { * @return string the error message if any * @public */ - function checkConfig() { + public function checkConfig() { $error = array(); $paymentProcessorType = CRM_Core_PseudoConstant::paymentProcessorType(false, null, 'name'); if ( @@ -427,7 +427,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { /** * @return null|string */ - function cancelSubscriptionURL() { + public function cancelSubscriptionURL() { if ($this->_paymentProcessor['payment_processor_type'] == 'PayPal_Standard') { return "{$this->_paymentProcessor['url_site']}cgi-bin/webscr?cmd=_subscr-find&alias=" . urlencode($this->_paymentProcessor['user_name']); } @@ -444,7 +444,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { * @return boolean * @public */ - function isSupported($method = 'cancelSubscription') { + public function isSupported($method = 'cancelSubscription') { if ($this->_paymentProcessor['payment_processor_type'] != 'PayPal') { // since subscription methods like cancelSubscription or updateBilling is not yet implemented / supported // by standard or express. @@ -459,7 +459,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { * * @return array|bool|object */ - function cancelSubscription(&$message = '', $params = array()) { + public function cancelSubscription(&$message = '', $params = array()) { if ($this->_paymentProcessor['payment_processor_type'] == 'PayPal') { $args = array(); $this->initialize($args, 'ManageRecurringPaymentsProfileStatus'); @@ -484,7 +484,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { * * @return array|bool|object */ - function updateSubscriptionBillingInfo(&$message = '', $params = array()) { + public function updateSubscriptionBillingInfo(&$message = '', $params = array()) { if ($this->_paymentProcessor['payment_processor_type'] == 'PayPal') { $config = CRM_Core_Config::singleton(); $args = array(); @@ -522,7 +522,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { * * @return array|bool|object */ - function changeSubscriptionAmount(&$message = '', $params = array()) { + public function changeSubscriptionAmount(&$message = '', $params = array()) { if ($this->_paymentProcessor['payment_processor_type'] == 'PayPal') { $config = CRM_Core_Config::singleton(); $args = array(); @@ -550,7 +550,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { * * @throws Exception */ - function doTransferCheckout(&$params, $component = 'contribute') { + public function doTransferCheckout(&$params, $component = 'contribute') { $config = CRM_Core_Config::singleton(); if ($component != 'contribute' && $component != 'event') { @@ -721,7 +721,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { * @nvpStr is nvp string. * returns an associtive array containing the response from the server. */ - function invokeAPI($args, $url = NULL) { + public function invokeAPI($args, $url = NULL) { if ($url === NULL) { if (empty($this->_paymentProcessor['url_api'])) { @@ -795,7 +795,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { * @nvpstr is NVPString. * @nvpArray is Associative Array. */ - static function deformat($str) { + public static function deformat($str) { $result = array(); while (strlen($str)) { diff --git a/CRM/Core/Payment/PayPalProIPN.php b/CRM/Core/Payment/PayPalProIPN.php index 8b461344ec..03d2f66d5b 100644 --- a/CRM/Core/Payment/PayPalProIPN.php +++ b/CRM/Core/Payment/PayPalProIPN.php @@ -67,7 +67,7 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN { * * @throws CRM_Core_Exception */ - function __construct($inputData) { + public function __construct($inputData) { $this->setInputParameters($inputData); $this->setInvoiceData(); parent::__construct(); @@ -82,7 +82,7 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN { * @throws CRM_Core_Exception * @return unknown */ - function getValue($name, $abort = TRUE) { + public function getValue($name, $abort = TRUE) { if ($abort && empty($this->_invoiceData[$name])) { throw new CRM_Core_Exception("Failure: Missing Parameter $name"); } @@ -94,7 +94,7 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN { /** * Set $this->_invoiceData from the input array */ - function setInvoiceData() { + public function setInvoiceData() { if(empty($this->_inputParameters['rp_invoice_id'])) { $this->_isPaymentExpress = TRUE; return; @@ -138,7 +138,7 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN { * @throws CRM_Core_Exception * @return Ambigous */ - function retrieve($name, $type, $location = 'POST', $abort = TRUE) { + public function retrieve($name, $type, $location = 'POST', $abort = TRUE) { $value = CRM_Utils_Type::validate( CRM_Utils_Array::value($name, $this->_inputParameters), $type, @@ -158,7 +158,7 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN { * @param boolean $first * @return void|boolean */ - function recur(&$input, &$ids, &$objects, $first) { + public function recur(&$input, &$ids, &$objects, $first) { if (!isset($input['txnType'])) { CRM_Core_Error::debug_log_message("Could not find txn_type in input request"); echo "Failure: Invalid parameters

"; @@ -318,7 +318,7 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN { * @param bool $recur * @param bool $first */ - function single(&$input, &$ids, &$objects, $recur = FALSE, $first = FALSE) { + public function single(&$input, &$ids, &$objects, $recur = FALSE, $first = FALSE) { $contribution = &$objects['contribution']; // make sure the invoice is valid and matches what we have in the contribution record @@ -381,7 +381,7 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN { * @todo the references to POST throughout this class need to be removed * @return void|boolean|Ambigous */ - function main() { + public function main() { CRM_Core_Error::debug_var('GET', $_GET, TRUE, TRUE); CRM_Core_Error::debug_var('POST', $_POST, TRUE, TRUE); if($this->_isPaymentExpress) { @@ -464,7 +464,7 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr * * @throws CRM_Core_Exception */ - function getInput(&$input, &$ids) { + public function getInput(&$input, &$ids) { if (!$this->getBillingID($ids)) { return FALSE; @@ -510,7 +510,7 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr * but let's assume knowledge on invoice id & schedule is enough for now esp for donations * only contribute is handled */ - function handlePaymentExpress() { + public function handlePaymentExpress() { //@todo - loads of copy & paste / code duplication but as this not going into core need to try to // keep discreet // also note that a lot of the complexity above could be removed if we used @@ -559,7 +559,7 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr * Function check if transaction already exists * @param string $trxn_id */ - function transactionExists($trxn_id) { + public function transactionExists($trxn_id) { if(CRM_Core_DAO::singleValueQuery("SELECT count(*) FROM civicrm_contribution WHERE trxn_id = %1", array( 1 => array($trxn_id, 'String') diff --git a/CRM/Core/Payment/PayflowPro.php b/CRM/Core/Payment/PayflowPro.php index 052bc401e6..30a19ed94b 100644 --- a/CRM/Core/Payment/PayflowPro.php +++ b/CRM/Core/Payment/PayflowPro.php @@ -37,7 +37,7 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment { * @param $mode * @param $paymentProcessor */ - function __construct($mode, &$paymentProcessor) { + public function __construct($mode, &$paymentProcessor) { // live or test $this->_mode = $mode; $this->_paymentProcessor = $paymentProcessor; @@ -54,7 +54,7 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment { * @return object * @static */ - static function &singleton($mode, &$paymentProcessor) { + public static function &singleton($mode, &$paymentProcessor) { $processorName = $paymentProcessor['name']; if (self::$_singleton[$processorName] === NULL) { self::$_singleton[$processorName] = new CRM_Core_Payment_PayflowPro($mode, $paymentProcessor); @@ -76,7 +76,7 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment { * @return array the result in an nice formatted array (or an error object) * @abstract */ - function doDirectPayment(&$params) { + public function doDirectPayment(&$params) { if (!defined('CURLOPT_SSLCERT')) { CRM_Core_Error::fatal(ts('PayFlowPro requires curl with SSL support')); } @@ -373,7 +373,7 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment { * * @return bool True if ID exists, else false */ - function _checkDupe($invoiceId) { + public function _checkDupe($invoiceId) { //copied from Eway but not working and not really sure it should! $contribution = new CRM_Contribute_DAO_Contribution(); $contribution->invoice_id = $invoiceId; @@ -389,7 +389,7 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment { * * @return object */ - function &errorExit($errorCode = NULL, $errorMessage = NULL) { + public function &errorExit($errorCode = NULL, $errorMessage = NULL) { $e = CRM_Core_Error::singleton(); if ($errorCode) { $e->push($errorCode, 0, NULL, $errorMessage); @@ -410,7 +410,7 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment { * * @throws Exception */ - function doTransferCheckout(&$params, $component) { + public function doTransferCheckout(&$params, $component) { CRM_Core_Error::fatal(ts('This function is not implemented')); } @@ -437,7 +437,7 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment { * @return string the error message if any * @public */ - function checkConfig() { + public function checkConfig() { $errorMsg = array(); if (empty($this->_paymentProcessor['user_name'])) { $errorMsg[] = ' ' . ts('ssl_merchant_id is not set for this payment processor'); @@ -464,7 +464,7 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment { * * @return array|string */ - function convert_to_nvp($payflow_query_array) { + public function convert_to_nvp($payflow_query_array) { foreach ($payflow_query_array as $key => $value) { $payflow_query[] = $key . '[' . strlen($value) . ']=' . $value; } @@ -485,7 +485,7 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment { * * @return mixed|object */ - function submit_transaction($submiturl, $payflow_query) { + public function submit_transaction($submiturl, $payflow_query) { /* * Submit transaction using CuRL */ @@ -631,7 +631,7 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment { * * @throws Exception */ - function getRecurringTransactionStatus($recurringProfileID, $processorID) { + public function getRecurringTransactionStatus($recurringProfileID, $processorID) { if (!defined('CURLOPT_SSLCERT')) { CRM_Core_Error::fatal(ts('PayFlowPro requires curl with SSL support')); } diff --git a/CRM/Core/Payment/PaymentExpress.php b/CRM/Core/Payment/PaymentExpress.php index aa38036c3f..4927ca9658 100644 --- a/CRM/Core/Payment/PaymentExpress.php +++ b/CRM/Core/Payment/PaymentExpress.php @@ -59,7 +59,7 @@ class CRM_Core_Payment_PaymentExpress extends CRM_Core_Payment { * * @return \CRM_Core_Payment_PaymentExpress */ - function __construct($mode, &$paymentProcessor) { + public function __construct($mode, &$paymentProcessor) { $this->_mode = $mode; $this->_paymentProcessor = $paymentProcessor; @@ -78,7 +78,7 @@ class CRM_Core_Payment_PaymentExpress extends CRM_Core_Payment { * @return object * @static */ - static function &singleton($mode = 'test', &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) { + public static function &singleton($mode = 'test', &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) { $processorName = $paymentProcessor['name']; if (self::$_singleton[$processorName] === NULL) { self::$_singleton[$processorName] = new CRM_Core_Payment_PaymentExpress($mode, $paymentProcessor); @@ -94,7 +94,7 @@ class CRM_Core_Payment_PaymentExpress extends CRM_Core_Payment { * @return string the error message if any * @public */ - function checkConfig() { + public function checkConfig() { $config = CRM_Core_Config::singleton(); $error = array(); @@ -120,7 +120,7 @@ class CRM_Core_Payment_PaymentExpress extends CRM_Core_Payment { * * @throws Exception */ - function setExpressCheckOut(&$params) { + public function setExpressCheckOut(&$params) { CRM_Core_Error::fatal(ts('This function is not implemented')); } @@ -129,7 +129,7 @@ class CRM_Core_Payment_PaymentExpress extends CRM_Core_Payment { * * @throws Exception */ - function getExpressCheckoutDetails($token) { + public function getExpressCheckoutDetails($token) { CRM_Core_Error::fatal(ts('This function is not implemented')); } @@ -138,7 +138,7 @@ class CRM_Core_Payment_PaymentExpress extends CRM_Core_Payment { * * @throws Exception */ - function doExpressCheckout(&$params) { + public function doExpressCheckout(&$params) { CRM_Core_Error::fatal(ts('This function is not implemented')); } @@ -151,7 +151,7 @@ class CRM_Core_Payment_PaymentExpress extends CRM_Core_Payment { * @return array the result in an nice formatted array (or an error object) * @abstract */ - function doDirectPayment(&$params) { + public function doDirectPayment(&$params) { CRM_Core_Error::fatal(ts('This function is not implemented')); } @@ -165,7 +165,7 @@ class CRM_Core_Payment_PaymentExpress extends CRM_Core_Payment { * @return void * @access public */ - function doTransferCheckout(&$params, $component) { + public function doTransferCheckout(&$params, $component) { $component = strtolower($component); $config = CRM_Core_Config::singleton(); if ($component != 'contribute' && $component != 'event') { diff --git a/CRM/Core/Payment/PaymentExpressIPN.php b/CRM/Core/Payment/PaymentExpressIPN.php index 0fd5e068fa..0baa831bb2 100644 --- a/CRM/Core/Payment/PaymentExpressIPN.php +++ b/CRM/Core/Payment/PaymentExpressIPN.php @@ -62,7 +62,7 @@ class CRM_Core_Payment_PaymentExpressIPN extends CRM_Core_Payment_BaseIPN { * * @return mixed */ - static function retrieve($name, $type, $object, $abort = TRUE) { + public static function retrieve($name, $type, $object, $abort = TRUE) { $value = CRM_Utils_Array::value($name, $object); if ($abort && $value === NULL) { CRM_Core_Error::debug_log_message("Could not find an entry for $name"); @@ -90,7 +90,7 @@ class CRM_Core_Payment_PaymentExpressIPN extends CRM_Core_Payment_BaseIPN { * * @return \CRM_Core_Payment_PaymentExpressIPN */ - function __construct($mode, &$paymentProcessor) { + public function __construct($mode, &$paymentProcessor) { parent::__construct(); $this->_mode = $mode; @@ -109,7 +109,7 @@ class CRM_Core_Payment_PaymentExpressIPN extends CRM_Core_Payment_BaseIPN { * @return object * @static */ - static function &singleton($mode = 'test', &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) { + public static function &singleton($mode = 'test', &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) { if (self::$_singleton === NULL) { self::$_singleton = new CRM_Core_Payment_PaymentExpressIPN($mode, $paymentProcessor); } @@ -129,7 +129,7 @@ class CRM_Core_Payment_PaymentExpressIPN extends CRM_Core_Payment_BaseIPN { * @internal param \xml $dataRoot response send by google in xml format * @return void */ - function newOrderNotify($success, $privateData, $component, $amount, $transactionReference) { + public function newOrderNotify($success, $privateData, $component, $amount, $transactionReference) { $ids = $input = $params = array(); $input['component'] = strtolower($component); @@ -215,7 +215,7 @@ class CRM_Core_Payment_PaymentExpressIPN extends CRM_Core_Payment_BaseIPN { * @return array context of this call (test, component, payment processor id) * @static */ - static function getContext($privateData, $orderNo) { + public static function getContext($privateData, $orderNo) { $component = NULL; $isTest = NULL; @@ -282,7 +282,7 @@ class CRM_Core_Payment_PaymentExpressIPN extends CRM_Core_Payment_BaseIPN { * mac_key is only passed if the processor is pxaccess as it is used for decryption * $dps_method is either pxaccess or pxpay */ - static function main($dps_method, $rawPostData, $dps_url, $dps_user, $dps_key, $mac_key) { + public static function main($dps_method, $rawPostData, $dps_url, $dps_user, $dps_key, $mac_key) { $config = CRM_Core_Config::singleton(); define('RESPONSE_HANDLER_LOG_FILE', $config->uploadDir . 'CiviCRM.PaymentExpress.log'); @@ -436,7 +436,7 @@ class CRM_Core_Payment_PaymentExpressIPN extends CRM_Core_Payment_BaseIPN { * Converts the comma separated name-value pairs in * to an array of values. */ - static function stringToArray($str) { + public static function stringToArray($str) { $vars = $labels = array(); $labels = explode(',', $str); foreach ($labels as $label) { diff --git a/CRM/Core/Payment/PaymentExpressUtils.php b/CRM/Core/Payment/PaymentExpressUtils.php index ee9b726e2e..06c1adda2d 100644 --- a/CRM/Core/Payment/PaymentExpressUtils.php +++ b/CRM/Core/Payment/PaymentExpressUtils.php @@ -44,7 +44,7 @@ class CRM_Core_Payment_PaymentExpressUtils { * * @return string */ - static function _valueXml($element, $value = NULL) { + public static function _valueXml($element, $value = NULL) { $nl = "\n"; if (is_array($element)) { @@ -63,7 +63,7 @@ class CRM_Core_Payment_PaymentExpressUtils { * * @return mixed */ - static function _xmlElement($xml, $name) { + public static function _xmlElement($xml, $name) { $value = preg_replace('/.*<' . $name . '[^>]*>(.*)<\/' . $name . '>.*/', '\1', $xml); return $value; } @@ -74,7 +74,7 @@ class CRM_Core_Payment_PaymentExpressUtils { * * @return mixed|null */ - static function _xmlAttribute($xml, $name) { + public static function _xmlAttribute($xml, $name) { $value = preg_replace('/<.*' . $name . '="([^"]*)".*>/', '\1', $xml); return $value != $xml ? $value : NULL; } @@ -85,7 +85,7 @@ class CRM_Core_Payment_PaymentExpressUtils { * * @return resource */ - static function &_initCURL($query, $url) { + public static function &_initCURL($query, $url) { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); diff --git a/CRM/Core/Payment/ProcessorForm.php b/CRM/Core/Payment/ProcessorForm.php index 15a7457fa2..77a99bb7fc 100644 --- a/CRM/Core/Payment/ProcessorForm.php +++ b/CRM/Core/Payment/ProcessorForm.php @@ -45,7 +45,7 @@ class CRM_Core_Payment_ProcessorForm { * * @throws Exception */ - static function preProcess(&$form, $type = NULL, $mode = NULL ) { + public static function preProcess(&$form, $type = NULL, $mode = NULL ) { if ($type) { $form->_type = $type; } @@ -104,7 +104,7 @@ class CRM_Core_Payment_ProcessorForm { /** * @param $form */ - static function buildQuickform(&$form) { + public static function buildQuickform(&$form) { //@todo document why this addHidden is here //CRM-15743 - we should not set/create hidden element for pay later // because payment processor is not selected diff --git a/CRM/Core/Payment/Realex.php b/CRM/Core/Payment/Realex.php index f582330684..d869d6f9be 100644 --- a/CRM/Core/Payment/Realex.php +++ b/CRM/Core/Payment/Realex.php @@ -63,7 +63,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment { * * @return \CRM_Core_Payment_Realex */ - function __construct($mode, &$paymentProcessor) { + public function __construct($mode, &$paymentProcessor) { $this->_mode = $mode; $this->_paymentProcessor = $paymentProcessor; $this->_processorName = ts('Realex'); @@ -87,7 +87,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment { * @return object * @static */ - static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = false) { + public static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = false) { $processorName = $paymentProcessor['name']; if (self::$_singleton[$processorName] === NULL) { self::$_singleton[$processorName] = new CRM_Core_Payment_Realex($mode, $paymentProcessor); @@ -100,7 +100,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment { * * @throws Exception */ - function setExpressCheckOut(&$params) { + public function setExpressCheckOut(&$params) { CRM_Core_Error::fatal(ts('This function is not implemented')); } @@ -109,7 +109,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment { * * @throws Exception */ - function getExpressCheckoutDetails($token) { + public function getExpressCheckoutDetails($token) { CRM_Core_Error::fatal(ts('This function is not implemented')); } @@ -118,7 +118,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment { * * @throws Exception */ - function doExpressCheckout(&$params) { + public function doExpressCheckout(&$params) { CRM_Core_Error::fatal(ts('This function is not implemented')); } @@ -127,7 +127,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment { * * @throws Exception */ - function doTransferCheckout(&$params) { + public function doTransferCheckout(&$params) { CRM_Core_Error::fatal(ts('This function is not implemented')); } @@ -139,7 +139,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment { * @return array the result in a nice formatted array (or an error object) * @public */ - function doDirectPayment(&$params) { + public function doDirectPayment(&$params) { if (!defined('CURLOPT_SSLCERT')) { return self::error(9001, ts('RealAuth requires curl with SSL support')); @@ -283,7 +283,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment { * * @return array An array of the result with following keys: */ - function xml_parse_into_assoc($xml) { + public function xml_parse_into_assoc($xml) { $input = array(); $result = array(); @@ -322,7 +322,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment { * * @return array */ - function _xml_parse($input, $depth = 1) { + public function _xml_parse($input, $depth = 1) { $output = array(); $children = array(); @@ -352,7 +352,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment { /** * Format the params from the form ready for sending to Realex. Also perform some validation */ - function setRealexFields(&$params) { + public function setRealexFields(&$params) { if ((int)$params['amount'] <= 0) { return self::error(9001, ts('Amount must be positive')); } @@ -452,7 +452,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment { * * @return bool True if ID exists, else false */ - function _checkDupe($invoiceId) { + public function _checkDupe($invoiceId) { $contribution = new CRM_Contribute_DAO_Contribution(); $contribution->invoice_id = $invoiceId; return $contribution->find(); @@ -466,7 +466,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment { * @return mixed value of the field, or empty string if the field is * not set */ - function _getParam($field) { + public function _getParam($field) { if (isset($this->_params[$field])) { return $this->_params[$field]; } @@ -484,7 +484,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment { * * @return bool false if value is not a scalar, true if successful */ - function _setParam($field, $value) { + public function _setParam($field, $value) { if (!is_scalar($value)) { return FALSE; } @@ -499,7 +499,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment { * * @return object */ - function &error($errorCode = NULL, $errorMessage = NULL) { + public function &error($errorCode = NULL, $errorMessage = NULL) { $e = CRM_Core_Error::singleton(); if ($errorCode) { @@ -532,7 +532,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment { * @return string the error message if any * @public */ - function checkConfig() { + public function checkConfig() { $error = array(); if (empty($this->_paymentProcessor['user_name'])) { $error[] = ts('Merchant ID is not set for this payment processor'); diff --git a/CRM/Core/Payment/eWAY.php b/CRM/Core/Payment/eWAY.php index 7286f674fc..7e02218c8b 100644 --- a/CRM/Core/Payment/eWAY.php +++ b/CRM/Core/Payment/eWAY.php @@ -112,7 +112,7 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment { * * @return \CRM_Core_Payment_eWAY ******************************************************* */ - function __construct($mode, &$paymentProcessor) { + public function __construct($mode, &$paymentProcessor) { // require Standaard eWAY API libraries require_once 'eWAY/eWAY_GatewayRequest.php'; require_once 'eWAY/eWAY_GatewayResponse.php'; @@ -135,7 +135,7 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment { * @return object * @static */ - static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = false) { + public static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = false) { $processorName = $paymentProcessor['name']; if (self::$_singleton[$processorName] === NULL) { self::$_singleton[$processorName] = new CRM_Core_Payment_eWAY($mode, $paymentProcessor); @@ -147,7 +147,7 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment { * This function sends request and receives response from * eWAY payment process **********************************************************/ - function doDirectPayment(&$params) { + public function doDirectPayment(&$params) { if (CRM_Utils_Array::value('is_recur', $params) == TRUE) { CRM_Core_Error::fatal(ts('eWAY - recurring payments not implemented')); } @@ -431,7 +431,7 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment { * * @return bool True if ID exists, else false */ - function _checkDupe($invoiceId) { + public function _checkDupe($invoiceId) { $contribution = new CRM_Contribute_DAO_Contribution(); $contribution->invoice_id = $invoiceId; return $contribution->find(); @@ -440,7 +440,7 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment { /************************************************************************************************* * This function checks the eWAY response status - returning a boolean false if status != 'true' *************************************************************************************************/ - function isError(&$response) { + public function isError(&$response) { $status = $response->Status(); if ((stripos($status, "true")) === FALSE) { @@ -452,7 +452,7 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment { /************************************************** * Produces error message and returns from class **************************************************/ - function &errorExit($errorCode = NULL, $errorMessage = NULL) { + public function &errorExit($errorCode = NULL, $errorMessage = NULL) { $e = CRM_Core_Error::singleton(); if ($errorCode) { @@ -467,7 +467,7 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment { /************************************************** * NOTE: 'doTransferCheckout' not implemented **************************************************/ - function doTransferCheckout(&$params, $component) { + public function doTransferCheckout(&$params, $component) { CRM_Core_Error::fatal(ts('This function is not implemented')); } @@ -488,7 +488,7 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment { */ //function checkConfig( $mode ) // CiviCRM V1.9 Declaration // CiviCRM V2.0 Declaration - function checkConfig() { + public function checkConfig() { $errorMsg = array(); if (empty($this->_paymentProcessor['user_name'])) { @@ -514,7 +514,7 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment { * @param $p_request * @param $p_response */ - function send_alert_email($p_eWAY_tran_num, $p_trxn_out, $p_trxn_back, $p_request, $p_response) { + public function send_alert_email($p_eWAY_tran_num, $p_trxn_out, $p_trxn_back, $p_request, $p_response) { // Initialization call is required to use CiviCRM APIs. civicrm_initialize(TRUE); diff --git a/CRM/Core/Permission.php b/CRM/Core/Permission.php index 1e73a30431..06ac4c7022 100644 --- a/CRM/Core/Permission.php +++ b/CRM/Core/Permission.php @@ -116,7 +116,7 @@ class CRM_Core_Permission { * @static * @access public */ - static function check($permissions) { + public static function check($permissions) { $permissions = (array) $permissions; foreach ($permissions as $permission) { @@ -164,7 +164,7 @@ class CRM_Core_Permission { * @static * @access public */ - static function checkGroupRole($array) { + public static function checkGroupRole($array) { $config = CRM_Core_Config::singleton(); return $config->userPermissionClass->checkGroupRole($array); } @@ -254,7 +254,7 @@ class CRM_Core_Permission { * * @return string */ - static function customGroupClause($type = CRM_Core_Permission::VIEW, $prefix = NULL, $reset = FALSE) { + public static function customGroupClause($type = CRM_Core_Permission::VIEW, $prefix = NULL, $reset = FALSE) { if (self::customGroupAdmin()) { return ' ( 1 ) '; } @@ -334,7 +334,7 @@ class CRM_Core_Permission { * * @return array|string */ - static function ufGroupClause($type = CRM_Core_Permission::VIEW, $prefix = NULL, $returnUFGroupIds = FALSE) { + public static function ufGroupClause($type = CRM_Core_Permission::VIEW, $prefix = NULL, $returnUFGroupIds = FALSE) { $groups = self::ufGroup($type); if ($returnUFGroupIds) { return $groups; @@ -390,7 +390,7 @@ class CRM_Core_Permission { * * @return string */ - static function eventClause($type = CRM_Core_Permission::VIEW, $prefix = NULL) { + public static function eventClause($type = CRM_Core_Permission::VIEW, $prefix = NULL) { $events = self::event($type); if (empty($events)) { return ' ( 0 ) '; @@ -406,7 +406,7 @@ class CRM_Core_Permission { * * @return bool */ - static function access($module, $checkPermission = TRUE) { + public static function access($module, $checkPermission = TRUE) { $config = CRM_Core_Config::singleton(); if (!in_array($module, $config->enableComponents)) { @@ -434,7 +434,7 @@ class CRM_Core_Permission { * * @return bool */ - static function checkActionPermission($module, $action) { + public static function checkActionPermission($module, $action) { //check delete related permissions. if ($action & CRM_Core_Action::DELETE) { $permissionName = "delete in $module"; @@ -467,7 +467,7 @@ class CRM_Core_Permission { * * @return bool */ - static function checkMenu(&$args, $op = 'and') { + public static function checkMenu(&$args, $op = 'and') { if (!is_array($args)) { return $args; } @@ -489,7 +489,7 @@ class CRM_Core_Permission { * @return bool|mixed * @throws Exception */ - static function checkMenuItem(&$item) { + public static function checkMenuItem(&$item) { if (!array_key_exists('access_callback', $item)) { CRM_Core_Error::backtrace(); CRM_Core_Error::fatal(); @@ -543,7 +543,7 @@ class CRM_Core_Permission { * * @return array */ - static function &basicPermissions($all = FALSE) { + public static function &basicPermissions($all = FALSE) { static $permissions = NULL; if (!$permissions) { @@ -583,7 +583,7 @@ class CRM_Core_Permission { /** * @return array */ - static function getAnonymousPermissionsWarnings() { + public static function getAnonymousPermissionsWarnings() { static $permissions = array(); if (empty($permissions)) { $permissions = array( @@ -605,14 +605,14 @@ class CRM_Core_Permission { * * @return array */ - static function validateForPermissionWarnings($anonymous_perms) { + public static function validateForPermissionWarnings($anonymous_perms) { return array_intersect($anonymous_perms, self::getAnonymousPermissionsWarnings()); } /** * @return array */ - static function getCorePermissions() { + public static function getCorePermissions() { $prefix = ts('CiviCRM') . ': '; $permissions = array( 'add contacts' => $prefix . ts('add contacts'), @@ -668,7 +668,7 @@ class CRM_Core_Permission { * * return boolean true/false. **/ - static function giveMeAllACLs() { + public static function giveMeAllACLs() { if (CRM_Core_Permission::check('view all contacts') || CRM_Core_Permission::check('edit all contacts') ) { @@ -710,7 +710,7 @@ class CRM_Core_Permission { * @return int|null|string * @static */ - static function getComponentName($permission) { + public static function getComponentName($permission) { $componentName = NULL; $permission = trim($permission); if (empty($permission)) { @@ -765,7 +765,7 @@ class CRM_Core_Permission { /** * @return bool */ - static function isMultisiteEnabled() { + public static function isMultisiteEnabled() { return CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME, 'is_enabled' ) ? TRUE : FALSE; diff --git a/CRM/Core/Permission/Base.php b/CRM/Core/Permission/Base.php index caa589cb12..1ff0aae37b 100644 --- a/CRM/Core/Permission/Base.php +++ b/CRM/Core/Permission/Base.php @@ -140,7 +140,7 @@ class CRM_Core_Permission_Base { * @access public */ - function check($str) { + public function check($str) { //no default behaviour } @@ -153,7 +153,7 @@ class CRM_Core_Permission_Base { * @access public */ - function checkGroupRole($array) { + public function checkGroupRole($array) { return FALSE; } @@ -201,7 +201,7 @@ class CRM_Core_Permission_Base { * @throws CRM_Core_Exception * @see CRM_Core_Permission::getCorePermissions */ - function upgradePermissions($permissions) { + public function upgradePermissions($permissions) { throw new CRM_Core_Exception("Unimplemented method: CRM_Core_Permission_*::upgradePermissions"); } @@ -217,7 +217,7 @@ class CRM_Core_Permission_Base { * @return Array of permissions, in the same format as CRM_Core_Permission::getCorePermissions(). * @see CRM_Core_Permission::getCorePermissions */ - static function getModulePermissions($module) { + public static function getModulePermissions($module) { $return_permissions = array(); $fn_name = "{$module}_civicrm_permission"; if (function_exists($fn_name)) { @@ -234,7 +234,7 @@ class CRM_Core_Permission_Base { * * @return Array of permissions, in the same format as CRM_Core_Permission::getCorePermissions(). */ - function getAllModulePermissions() { + public function getAllModulePermissions() { $permissions = array(); CRM_Utils_Hook::permission($permissions); return $permissions; diff --git a/CRM/Core/Permission/Drupal.php b/CRM/Core/Permission/Drupal.php index 5356dafa4e..eb75c0a9e6 100644 --- a/CRM/Core/Permission/Drupal.php +++ b/CRM/Core/Permission/Drupal.php @@ -72,7 +72,7 @@ class CRM_Core_Permission_Drupal extends CRM_Core_Permission_DrupalBase{ * @return boolean true if yes, else false * @access public */ - function check($str, $contactID = NULL) { + public function check($str, $contactID = NULL) { $str = $this->translatePermission($str, 'Drupal', array( 'view user account' => 'access user profiles', 'administer users' => 'administer users', @@ -97,7 +97,7 @@ class CRM_Core_Permission_Drupal extends CRM_Core_Permission_DrupalBase{ * @return boolean true if yes, else false * @access public */ - function checkGroupRole($array) { + public function checkGroupRole($array) { if (function_exists('user_load') && isset($array)) { $user = user_load( $GLOBALS['user']->uid); //if giver roles found in user roles - return true @@ -120,7 +120,7 @@ class CRM_Core_Permission_Drupal extends CRM_Core_Permission_DrupalBase{ /** * {@inheritdoc} */ - function upgradePermissions($permissions) { + public function upgradePermissions($permissions) { if (empty($permissions)) { throw new CRM_Core_Exception("Cannot upgrade permissions: permission list missing"); } diff --git a/CRM/Core/Permission/Drupal6.php b/CRM/Core/Permission/Drupal6.php index 54aed44270..844f13c913 100644 --- a/CRM/Core/Permission/Drupal6.php +++ b/CRM/Core/Permission/Drupal6.php @@ -71,7 +71,7 @@ class CRM_Core_Permission_Drupal6 extends CRM_Core_Permission_DrupalBase { * @return boolean true if yes, else false * @access public */ - function check($str, $contactID = NULL) { + public function check($str, $contactID = NULL) { $str = $this->translatePermission($str, 'Drupal6', array( 'view user account' => 'access user profiles', 'administer users' => 'administer users', @@ -97,7 +97,7 @@ class CRM_Core_Permission_Drupal6 extends CRM_Core_Permission_DrupalBase { * @access public */ - function checkGroupRole($array) { + public function checkGroupRole($array) { if (function_exists('user_load') && isset($array)) { $user = user_load(array('uid' => $GLOBALS['user']->uid)); //if giver roles found in user roles - return true @@ -188,7 +188,7 @@ class CRM_Core_Permission_Drupal6 extends CRM_Core_Permission_DrupalBase { * * Does nothing in Drupal 6. */ - function upgradePermissions($permissions) { + public function upgradePermissions($permissions) { // D6 allows us to be really lazy... things get cleaned up when the admin form is next submitted... } @@ -200,7 +200,7 @@ class CRM_Core_Permission_Drupal6 extends CRM_Core_Permission_DrupalBase { * * @return Array of permissions, in the same format as CRM_Core_Permission::getCorePermissions(). */ - static function getModulePermissions($module) { + public static function getModulePermissions($module) { $return_permissions = array(); $fn_name = "{$module}_civicrm_permission"; if (function_exists($fn_name)) { diff --git a/CRM/Core/Permission/Drupal8.php b/CRM/Core/Permission/Drupal8.php index 48b5246f80..e05d0dab63 100644 --- a/CRM/Core/Permission/Drupal8.php +++ b/CRM/Core/Permission/Drupal8.php @@ -44,7 +44,7 @@ class CRM_Core_Permission_Drupal8 extends CRM_Core_Permission_DrupalBase{ * * @return bool */ - function check($str, $contactID = NULL) { + public function check($str, $contactID = NULL) { $str = $this->translatePermission($str, 'Drupal', array( 'view user account' => 'access user profiles', )); diff --git a/CRM/Core/Permission/DrupalBase.php b/CRM/Core/Permission/DrupalBase.php index 2f4c950b93..b443da3f56 100644 --- a/CRM/Core/Permission/DrupalBase.php +++ b/CRM/Core/Permission/DrupalBase.php @@ -223,7 +223,7 @@ class CRM_Core_Permission_DrupalBase extends CRM_Core_Permission_Base { * * @return string */ - function getContactEmails($uids) { + public function getContactEmails($uids) { if (empty($uids)) { return ''; } @@ -257,7 +257,7 @@ class CRM_Core_Permission_DrupalBase extends CRM_Core_Permission_Base { * @access public * */ - function checkGroupRole($array) { + public function checkGroupRole($array) { if (function_exists('user_load') && isset($array)) { $user = user_load( $GLOBALS['user']->uid); //if giver roles found in user roles - return true @@ -316,7 +316,7 @@ class CRM_Core_Permission_DrupalBase extends CRM_Core_Permission_Base { * {@inheritdoc} * */ - function upgradePermissions($permissions) { + public function upgradePermissions($permissions) { if (empty($permissions)) { throw new CRM_Core_Exception("Cannot upgrade permissions: permission list missing"); } diff --git a/CRM/Core/Permission/Joomla.php b/CRM/Core/Permission/Joomla.php index 1fe5d3b1d6..93bc435da0 100644 --- a/CRM/Core/Permission/Joomla.php +++ b/CRM/Core/Permission/Joomla.php @@ -45,7 +45,7 @@ class CRM_Core_Permission_Joomla extends CRM_Core_Permission_Base { * @return boolean true if yes, else false * @access public */ - function check($str) { + public function check($str) { $config = CRM_Core_Config::singleton(); $translated = $this->translateJoomlaPermission($str); @@ -75,7 +75,7 @@ class CRM_Core_Permission_Joomla extends CRM_Core_Permission_Base { * @internal param string $name e.g. "administer CiviCRM", "cms:access user record", "Drupal:administer content", "Joomla:example.action:com_some_asset" * @return ALWAYS_DENY_PERMISSION|ALWAYS_ALLOW_PERMISSION|array(0 => $joomlaAction, 1 => $joomlaAsset) */ - function translateJoomlaPermission($perm) { + public function translateJoomlaPermission($perm) { if ($perm === CRM_Core_Permission::ALWAYS_DENY_PERMISSION || $perm === CRM_Core_Permission::ALWAYS_ALLOW_PERMISSION) { return $perm; } @@ -103,7 +103,7 @@ class CRM_Core_Permission_Joomla extends CRM_Core_Permission_Base { * @static * @access public */ - function checkGroupRole($array) { + public function checkGroupRole($array) { return FALSE; } } diff --git a/CRM/Core/Permission/Soap.php b/CRM/Core/Permission/Soap.php index b844c4e178..86c2f27393 100644 --- a/CRM/Core/Permission/Soap.php +++ b/CRM/Core/Permission/Soap.php @@ -47,7 +47,7 @@ class CRM_Core_Permission_Soap extends CRM_Core_Permission_Base { * @access public */ - function check($str) { + public function check($str) { return TRUE; } } diff --git a/CRM/Core/Permission/UnitTests.php b/CRM/Core/Permission/UnitTests.php index 071fd4c2dc..c3414e2123 100644 --- a/CRM/Core/Permission/UnitTests.php +++ b/CRM/Core/Permission/UnitTests.php @@ -49,7 +49,7 @@ class CRM_Core_Permission_UnitTests extends CRM_Core_Permission_Base { * @return boolean true if yes, else false * @access public */ - function check($str) { + public function check($str) { if ($str == CRM_Core_Permission::ALWAYS_DENY_PERMISSION) { return FALSE; } diff --git a/CRM/Core/Permission/WordPress.php b/CRM/Core/Permission/WordPress.php index 8fe4af20aa..6b96b91d5c 100644 --- a/CRM/Core/Permission/WordPress.php +++ b/CRM/Core/Permission/WordPress.php @@ -45,7 +45,7 @@ class CRM_Core_Permission_WordPress extends CRM_Core_Permission_Base { * @return boolean true if yes, else false * @access public */ - function check($str) { + public function check($str) { // Generic cms 'administer users' role tranlates to 'administrator' WordPress role $str = $this->translatePermission($str, 'WordPress', array( 'administer users' => 'administrator', @@ -99,7 +99,7 @@ class CRM_Core_Permission_WordPress extends CRM_Core_Permission_Base { /** * {@inheritdoc} */ - function upgradePermissions($permissions) { + public function upgradePermissions($permissions) { return; } } diff --git a/CRM/Core/PseudoConstant.php b/CRM/Core/PseudoConstant.php index 774c1b65b1..09e98db997 100644 --- a/CRM/Core/PseudoConstant.php +++ b/CRM/Core/PseudoConstant.php @@ -454,7 +454,7 @@ class CRM_Core_PseudoConstant { * NULL if the given key has no corresponding option * String if label is found */ - static function getLabel($baoName, $fieldName, $key) { + public static function getLabel($baoName, $fieldName, $key) { $values = $baoName::buildOptions($fieldName, 'get'); if ($values === FALSE) { return FALSE; @@ -474,7 +474,7 @@ class CRM_Core_PseudoConstant { * NULL if the given key has no corresponding option * String if label is found */ - static function getName($baoName, $fieldName, $key) { + public static function getName($baoName, $fieldName, $key) { $values = $baoName::buildOptions($fieldName, 'validate'); if ($values === FALSE) { return FALSE; @@ -494,7 +494,7 @@ class CRM_Core_PseudoConstant { * NULL if the given key has no corresponding option * String|Number if key is found */ - static function getKey($baoName, $fieldName, $value) { + public static function getKey($baoName, $fieldName, $value) { $values = $baoName::buildOptions($fieldName, 'validate'); if ($values === FALSE) { return FALSE; @@ -507,7 +507,7 @@ class CRM_Core_PseudoConstant { * @param $fieldSpec * @return string|null */ - static function getOptionEditUrl($fieldSpec) { + public static function getOptionEditUrl($fieldSpec) { // If it's an option group, that's easy if (!empty($fieldSpec['pseudoconstant']['optionGroupName'])) { return 'civicrm/admin/options/' . $fieldSpec['pseudoconstant']['optionGroupName']; @@ -1687,7 +1687,7 @@ ORDER BY name"; * @static * @public */ - static function countryIDForStateID($stateID) { + public static function countryIDForStateID($stateID) { if (empty($stateID)) { return CRM_Core_DAO::$_nullObject; } diff --git a/CRM/Core/QuickForm/Action.php b/CRM/Core/QuickForm/Action.php index 95d7409426..5b8c56972e 100644 --- a/CRM/Core/QuickForm/Action.php +++ b/CRM/Core/QuickForm/Action.php @@ -55,7 +55,7 @@ class CRM_Core_QuickForm_Action extends HTML_QuickForm_Action { * @return \CRM_Core_QuickForm_Action @access public */ - function __construct(&$stateMachine) { + public function __construct(&$stateMachine) { $this->_stateMachine = &$stateMachine; } @@ -65,7 +65,7 @@ class CRM_Core_QuickForm_Action extends HTML_QuickForm_Action { * @return void * @access public */ - function popUserContext() { + public function popUserContext() { $session = CRM_Core_Session::singleton(); $config = CRM_Core_Config::singleton(); diff --git a/CRM/Core/QuickForm/Action/Back.php b/CRM/Core/QuickForm/Action/Back.php index 701043c0e6..18290b10bc 100644 --- a/CRM/Core/QuickForm/Action/Back.php +++ b/CRM/Core/QuickForm/Action/Back.php @@ -43,7 +43,7 @@ class CRM_Core_QuickForm_Action_Back extends CRM_Core_QuickForm_Action { * @return \CRM_Core_QuickForm_Action_Back * @access public */ - function __construct(&$stateMachine) { + public function __construct(&$stateMachine) { parent::__construct($stateMachine); } @@ -56,7 +56,7 @@ class CRM_Core_QuickForm_Action_Back extends CRM_Core_QuickForm_Action { * @return void * @access public */ - function perform(&$page, $actionName) { + public function perform(&$page, $actionName) { $this->_stateMachine->perform($page, $actionName, 'Back'); } } diff --git a/CRM/Core/QuickForm/Action/Cancel.php b/CRM/Core/QuickForm/Action/Cancel.php index b9a0f31b05..83d8363fe1 100644 --- a/CRM/Core/QuickForm/Action/Cancel.php +++ b/CRM/Core/QuickForm/Action/Cancel.php @@ -43,7 +43,7 @@ class CRM_Core_QuickForm_Action_Cancel extends CRM_Core_QuickForm_Action { * @return \CRM_Core_QuickForm_Action_Cancel @access public */ - function __construct(&$stateMachine) { + public function __construct(&$stateMachine) { parent::__construct($stateMachine); } @@ -56,7 +56,7 @@ class CRM_Core_QuickForm_Action_Cancel extends CRM_Core_QuickForm_Action { * @return void * @access public */ - function perform(&$page, $actionName) { + public function perform(&$page, $actionName) { // conditional actions if cancelAction is defined $this->_stateMachine->cancelAction(); diff --git a/CRM/Core/QuickForm/Action/Display.php b/CRM/Core/QuickForm/Action/Display.php index e5b8c6ba4f..43bc896525 100644 --- a/CRM/Core/QuickForm/Action/Display.php +++ b/CRM/Core/QuickForm/Action/Display.php @@ -55,7 +55,7 @@ class CRM_Core_QuickForm_Action_Display extends CRM_Core_QuickForm_Action { * @return \CRM_Core_QuickForm_Action_Display @access public */ - function __construct(&$stateMachine) { + public function __construct(&$stateMachine) { parent::__construct($stateMachine); } @@ -68,7 +68,7 @@ class CRM_Core_QuickForm_Action_Display extends CRM_Core_QuickForm_Action { * @return void * @access public */ - function perform(&$page, $actionName) { + public function perform(&$page, $actionName) { $pageName = $page->getAttribute('id'); // If the original action was 'display' and we have values in container then we load them @@ -109,7 +109,7 @@ class CRM_Core_QuickForm_Action_Display extends CRM_Core_QuickForm_Action { * @return void * @access public */ - function renderForm(&$page) { + public function renderForm(&$page) { $this->_setRenderTemplates($page); $template = CRM_Core_Smarty::singleton(); $form = $page->toSmarty(); @@ -193,7 +193,7 @@ class CRM_Core_QuickForm_Action_Display extends CRM_Core_QuickForm_Action { * @return void * @access public */ - function _setRenderTemplates(&$page) { + public function _setRenderTemplates(&$page) { if (self::$_requiredTemplate === NULL) { $this->initializeTemplates(); } @@ -210,7 +210,7 @@ class CRM_Core_QuickForm_Action_Display extends CRM_Core_QuickForm_Action { * @return void * @access public */ - function initializeTemplates() { + public function initializeTemplates() { if (self::$_requiredTemplate !== NULL) { return; } diff --git a/CRM/Core/QuickForm/Action/Done.php b/CRM/Core/QuickForm/Action/Done.php index 5374b3da01..9afc3f3dd6 100644 --- a/CRM/Core/QuickForm/Action/Done.php +++ b/CRM/Core/QuickForm/Action/Done.php @@ -43,7 +43,7 @@ class CRM_Core_QuickForm_Action_Done extends CRM_Core_QuickForm_Action { * @return \CRM_Core_QuickForm_Action_Done @access public */ - function __construct(&$stateMachine) { + public function __construct(&$stateMachine) { parent::__construct($stateMachine); } @@ -59,7 +59,7 @@ class CRM_Core_QuickForm_Action_Done extends CRM_Core_QuickForm_Action { * @return void * @access public */ - function perform(&$page, $actionName) { + public function perform(&$page, $actionName) { $page->isFormBuilt() or $page->buildForm(); $pageName = $page->getAttribute('name'); diff --git a/CRM/Core/QuickForm/Action/Jump.php b/CRM/Core/QuickForm/Action/Jump.php index ce6b92b3e4..124759d1d5 100644 --- a/CRM/Core/QuickForm/Action/Jump.php +++ b/CRM/Core/QuickForm/Action/Jump.php @@ -43,7 +43,7 @@ class CRM_Core_QuickForm_Action_Jump extends CRM_Core_QuickForm_Action { * @return \CRM_Core_QuickForm_Action_Jump @access public */ - function __construct(&$stateMachine) { + public function __construct(&$stateMachine) { parent::__construct($stateMachine); } @@ -56,7 +56,7 @@ class CRM_Core_QuickForm_Action_Jump extends CRM_Core_QuickForm_Action { * @return void * @access public */ - function perform(&$page, $actionName) { + public function perform(&$page, $actionName) { // check whether the page is valid before trying to go to it if ($page->controller->isModal()) { // we check whether *all* pages up to current are valid diff --git a/CRM/Core/QuickForm/Action/Next.php b/CRM/Core/QuickForm/Action/Next.php index 1a51deb36f..77897d5616 100644 --- a/CRM/Core/QuickForm/Action/Next.php +++ b/CRM/Core/QuickForm/Action/Next.php @@ -43,7 +43,7 @@ class CRM_Core_QuickForm_Action_Next extends CRM_Core_QuickForm_Action { * @return \CRM_Core_QuickForm_Action_Next @access public */ - function __construct(&$stateMachine) { + public function __construct(&$stateMachine) { parent::__construct($stateMachine); } @@ -56,7 +56,7 @@ class CRM_Core_QuickForm_Action_Next extends CRM_Core_QuickForm_Action { * @return void * @access public */ - function perform(&$page, $actionName) { + public function perform(&$page, $actionName) { $this->_stateMachine->perform($page, $actionName, 'Next'); } } diff --git a/CRM/Core/QuickForm/Action/Process.php b/CRM/Core/QuickForm/Action/Process.php index 63befea301..fc0bcd1f3e 100644 --- a/CRM/Core/QuickForm/Action/Process.php +++ b/CRM/Core/QuickForm/Action/Process.php @@ -43,7 +43,7 @@ class CRM_Core_QuickForm_Action_Process extends CRM_Core_QuickForm_Action { * @return \CRM_Core_QuickForm_Action_Process @access public */ - function __construct(&$stateMachine) { + public function __construct(&$stateMachine) { parent::__construct($stateMachine); } @@ -56,7 +56,7 @@ class CRM_Core_QuickForm_Action_Process extends CRM_Core_QuickForm_Action { * @return void * @access public */ - function perform(&$page, $actionName) { + public function perform(&$page, $actionName) { if ($this->_stateMachine->shouldReset()) { $this->_stateMachine->reset(); } diff --git a/CRM/Core/QuickForm/Action/Refresh.php b/CRM/Core/QuickForm/Action/Refresh.php index 0e8cde0655..3985e0cc91 100644 --- a/CRM/Core/QuickForm/Action/Refresh.php +++ b/CRM/Core/QuickForm/Action/Refresh.php @@ -43,7 +43,7 @@ class CRM_Core_QuickForm_Action_Refresh extends CRM_Core_QuickForm_Action { * @return \CRM_Core_QuickForm_Action_Refresh @access public */ - function __construct(&$stateMachine) { + public function __construct(&$stateMachine) { parent::__construct($stateMachine); } @@ -56,7 +56,7 @@ class CRM_Core_QuickForm_Action_Refresh extends CRM_Core_QuickForm_Action { * @return void * @access public */ - function perform(&$page, $actionName) { + public function perform(&$page, $actionName) { // save the form values and validation status to the session $page->isFormBuilt() or $page->buildForm(); diff --git a/CRM/Core/QuickForm/Action/Reload.php b/CRM/Core/QuickForm/Action/Reload.php index 3125aa7ed4..a885a83499 100644 --- a/CRM/Core/QuickForm/Action/Reload.php +++ b/CRM/Core/QuickForm/Action/Reload.php @@ -46,7 +46,7 @@ class CRM_Core_QuickForm_Action_Reload extends CRM_Core_QuickForm_Action { * @return \CRM_Core_QuickForm_Action_Reload @access public */ - function __construct(&$stateMachine) { + public function __construct(&$stateMachine) { parent::__construct($stateMachine); } @@ -59,7 +59,7 @@ class CRM_Core_QuickForm_Action_Reload extends CRM_Core_QuickForm_Action { * @return void * @access public */ - function perform(&$page, $actionName) { + public function perform(&$page, $actionName) { // save the form values and validation status to the session $page->isFormBuilt() or $page->buildForm(); diff --git a/CRM/Core/QuickForm/Action/Submit.php b/CRM/Core/QuickForm/Action/Submit.php index a1be06781f..d8d1ad1c14 100644 --- a/CRM/Core/QuickForm/Action/Submit.php +++ b/CRM/Core/QuickForm/Action/Submit.php @@ -43,7 +43,7 @@ class CRM_Core_QuickForm_Action_Submit extends CRM_Core_QuickForm_Action { * @return \CRM_Core_QuickForm_Action_Submit @access public */ - function __construct(&$stateMachine) { + public function __construct(&$stateMachine) { parent::__construct($stateMachine); } @@ -56,7 +56,7 @@ class CRM_Core_QuickForm_Action_Submit extends CRM_Core_QuickForm_Action { * @return void * @access public */ - function perform(&$page, $actionName) { + public function perform(&$page, $actionName) { $page->isFormBuilt() or $page->buildForm(); $pageName = $page->getAttribute('name'); diff --git a/CRM/Core/QuickForm/Action/Upload.php b/CRM/Core/QuickForm/Action/Upload.php index 77bcc80e87..1cf3f15e46 100644 --- a/CRM/Core/QuickForm/Action/Upload.php +++ b/CRM/Core/QuickForm/Action/Upload.php @@ -57,7 +57,7 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action { * @return \CRM_Core_QuickForm_Action_Upload @access public */ - function __construct(&$stateMachine, $uploadDir, $uploadNames) { + public function __construct(&$stateMachine, $uploadDir, $uploadNames) { parent::__construct($stateMachine); $this->_uploadDir = $uploadDir; @@ -75,7 +75,7 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action { * @return void * @access private */ - function upload(&$page, &$data, $pageName, $uploadName) { + public function upload(&$page, &$data, $pageName, $uploadName) { // make sure uploadName exists in the QF array // else we skip, CRM-3427 if (empty($uploadName) || @@ -117,7 +117,7 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action { * @return void * @access public */ - function perform(&$page, $actionName) { + public function perform(&$page, $actionName) { // like in Action_Next $page->isFormBuilt() or $page->buildForm(); @@ -135,7 +135,7 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action { * * @return mixed */ - function realPerform(&$page, $actionName) { + public function realPerform(&$page, $actionName) { $pageName = $page->getAttribute('name'); $data = &$page->controller->container(); $data['values'][$pageName] = $page->exportValues(); diff --git a/CRM/Core/QuickForm/GroupMultiSelect.php b/CRM/Core/QuickForm/GroupMultiSelect.php index 7f05937cfa..da6f7fff59 100644 --- a/CRM/Core/QuickForm/GroupMultiSelect.php +++ b/CRM/Core/QuickForm/GroupMultiSelect.php @@ -41,7 +41,7 @@ class CRM_Core_QuickForm_GroupMultiSelect extends CRM_Core_QuickForm_NestedAdvMu * @return string * @since version 0.4.0 (2005-06-25) */ - function toHtml() { + public function toHtml() { if ($this->_flagFrozen) { return $this->getFrozenHtml(); } diff --git a/CRM/Core/Reference/Basic.php b/CRM/Core/Reference/Basic.php index 0b13ef5f5b..572e963058 100644 --- a/CRM/Core/Reference/Basic.php +++ b/CRM/Core/Reference/Basic.php @@ -19,7 +19,7 @@ class CRM_Core_Reference_Basic implements CRM_Core_Reference_Interface { * @param string $targetKey * @param null $refTypeColumn */ - function __construct($refTable, $refKey, $targetTable = NULL, $targetKey = 'id', $refTypeColumn = NULL) { + public function __construct($refTable, $refKey, $targetTable = NULL, $targetKey = 'id', $refTypeColumn = NULL) { $this->refTable = $refTable; $this->refKey = $refKey; $this->targetTable = $targetTable; @@ -30,35 +30,35 @@ class CRM_Core_Reference_Basic implements CRM_Core_Reference_Interface { /** * @return mixed */ - function getReferenceTable() { + public function getReferenceTable() { return $this->refTable; } /** * @return mixed */ - function getReferenceKey() { + public function getReferenceKey() { return $this->refKey; } /** * @return null */ - function getTypeColumn() { + public function getTypeColumn() { return $this->refTypeColumn; } /** * @return null */ - function getTargetTable() { + public function getTargetTable() { return $this->targetTable; } /** * @return string */ - function getTargetKey() { + public function getTargetKey() { return $this->targetKey; } diff --git a/CRM/Core/Reference/OptionValue.php b/CRM/Core/Reference/OptionValue.php index 7229af33d7..eed0b5d93c 100644 --- a/CRM/Core/Reference/OptionValue.php +++ b/CRM/Core/Reference/OptionValue.php @@ -21,7 +21,7 @@ class CRM_Core_Reference_OptionValue extends CRM_Core_Reference_Basic { * @param string $targetKey * @param null $optionGroupName */ - function __construct($refTable, $refKey, $targetTable = NULL, $targetKey = 'id', $optionGroupName) { + public function __construct($refTable, $refKey, $targetTable = NULL, $targetKey = 'id', $optionGroupName) { parent::__construct($refTable, $refKey, $targetTable, $targetKey, NULL); $this->targetOptionGroupName = $optionGroupName; } diff --git a/CRM/Core/Region.php b/CRM/Core/Region.php index 1dcca501ef..15d76aa184 100644 --- a/CRM/Core/Region.php +++ b/CRM/Core/Region.php @@ -13,7 +13,7 @@ class CRM_Core_Region { * @param bool $autocreate whether to automatically create an empty region * @return CRM_Core_Region */ - static function &instance($name, $autocreate = TRUE) { + public static function &instance($name, $autocreate = TRUE) { if ( $autocreate && ! isset( self::$_instances[$name] ) ) { self::$_instances[$name] = new CRM_Core_Region($name); } @@ -221,7 +221,7 @@ class CRM_Core_Region { * * @return int */ - static function _cmpSnippet($a, $b) { + public static function _cmpSnippet($a, $b) { if ($a['weight'] < $b['weight']) return -1; if ($a['weight'] > $b['weight']) return 1; // fallback to name sort; don't really want to do this, but it makes results more stable diff --git a/CRM/Core/Report/Excel.php b/CRM/Core/Report/Excel.php index 2f483cdfea..11d3948c9e 100644 --- a/CRM/Core/Report/Excel.php +++ b/CRM/Core/Report/Excel.php @@ -50,7 +50,7 @@ class CRM_Core_Report_Excel { * @access public * @static */ - static function makeCSVTable(&$header, &$rows, $titleHeader = NULL, $print = TRUE, $outputHeader = TRUE) { + public static function makeCSVTable(&$header, &$rows, $titleHeader = NULL, $print = TRUE, $outputHeader = TRUE) { if ($titleHeader) { echo $titleHeader; } @@ -158,7 +158,7 @@ class CRM_Core_Report_Excel { * @param null $titleHeader * @param bool $outputHeader */ - function writeHTMLFile($fileName, &$header, &$rows, $titleHeader = NULL, $outputHeader = TRUE) { + public function writeHTMLFile($fileName, &$header, &$rows, $titleHeader = NULL, $outputHeader = TRUE) { if ($outputHeader) { CRM_Utils_System::download(CRM_Utils_String::munge($fileName), 'application/vnd.ms-excel', @@ -201,7 +201,7 @@ class CRM_Core_Report_Excel { * @public * @static */ - static function writeCSVFile($fileName, &$header, &$rows, $titleHeader = NULL, $outputHeader = TRUE, $saveFile = NULL) { + public static function writeCSVFile($fileName, &$header, &$rows, $titleHeader = NULL, $outputHeader = TRUE, $saveFile = NULL) { if ($outputHeader && !$saveFile) { CRM_Utils_System::download(CRM_Utils_String::munge($fileName), 'text/x-csv', diff --git a/CRM/Core/Resources.php b/CRM/Core/Resources.php index b8bc4bef56..0f19893e10 100644 --- a/CRM/Core/Resources.php +++ b/CRM/Core/Resources.php @@ -586,7 +586,7 @@ class CRM_Core_Resources { * * @return string javascript content */ - static function outputLocalizationJS() { + public static function outputLocalizationJS() { CRM_Core_Page_AJAX::setJsHeaders(); $config = CRM_Core_Config::singleton(); $vars = array( @@ -689,7 +689,7 @@ class CRM_Core_Resources { /** * @return bool - is this page request an ajax snippet? */ - static function isAjaxMode() { + 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)); } @@ -699,7 +699,7 @@ class CRM_Core_Resources { * @TODO: Provide a sane way to extend this list for other entities - a hook or?? * @return array */ - static function getEntityRefFilters() { + public static function getEntityRefFilters() { $filters = array(); $filters['event'] = array( diff --git a/CRM/Core/SelectValues.php b/CRM/Core/SelectValues.php index 4917fa2be6..fbbb1e2b62 100644 --- a/CRM/Core/SelectValues.php +++ b/CRM/Core/SelectValues.php @@ -41,7 +41,7 @@ class CRM_Core_SelectValues { * Preferred mail format * @static */ - static function pmf() { + public static function pmf() { return array( 'Both' => ts('Both'), 'HTML' => ts('HTML'), @@ -53,7 +53,7 @@ class CRM_Core_SelectValues { * Privacy options * @static */ - static function privacy() { + public static function privacy() { return array( 'do_not_phone' => ts('Do not phone'), 'do_not_email' => ts('Do not email'), @@ -68,7 +68,7 @@ class CRM_Core_SelectValues { * Various pre defined contact super types * @static */ - static function contactType() { + public static function contactType() { static $contactType = NULL; if (!$contactType) { $contactType = CRM_Contact_BAO_ContactType::basicTypePairs(); @@ -80,7 +80,7 @@ class CRM_Core_SelectValues { * Various pre defined unit list * @static */ - static function unitList($unitType = NULL) { + public static function unitList($unitType = NULL) { $unitList = array( 'day' => ts('day'), 'month' => ts('month'), @@ -96,7 +96,7 @@ class CRM_Core_SelectValues { * Membership type unit * @static */ - static function membershipTypeUnitList( ) { + public static function membershipTypeUnitList( ) { return self::unitList('duration'); } @@ -104,7 +104,7 @@ class CRM_Core_SelectValues { * Various pre defined period types * @static */ - static function periodType() { + public static function periodType() { return array( 'rolling' => ts('Rolling'), 'fixed' => ts('Fixed'), @@ -115,7 +115,7 @@ class CRM_Core_SelectValues { * Various pre defined email selection methods * @static */ - static function emailSelectMethods() { + public static function emailSelectMethods() { return array( 'automatic' => ts("Automatic"), 'location-only' => ts("Only send to email addresses assigned to the specified location"), @@ -128,7 +128,7 @@ class CRM_Core_SelectValues { * Various pre defined member visibility options * @static */ - static function memberVisibility() { + public static function memberVisibility() { return array( 'Public' => ts('Public'), 'Admin' => ts('Admin'), @@ -139,7 +139,7 @@ class CRM_Core_SelectValues { * Various pre defined event dates * @static */ - static function eventDate() { + public static function eventDate() { return array( 'start_date' => ts('start date'), 'end_date' => ts('end date'), @@ -151,7 +151,7 @@ class CRM_Core_SelectValues { * Custom form field types * @static */ - static function customHtmlType() { + public static function customHtmlType() { return array( 'Text' => ts('Single-line input field (text or numeric)'), 'TextArea' => ts('Multi-line text box (textarea)'), @@ -178,7 +178,7 @@ class CRM_Core_SelectValues { * * @static */ - static function customGroupExtends() { + public static function customGroupExtends() { $customGroupExtends = array( 'Activity' => ts('Activities'), 'Relationship' => ts('Relationships'), @@ -207,7 +207,7 @@ class CRM_Core_SelectValues { * * @static */ - static function customGroupStyle() { + public static function customGroupStyle() { return array( 'Tab' => ts('Tab'), 'Inline' => ts('Inline'), @@ -220,7 +220,7 @@ class CRM_Core_SelectValues { * * @static */ - static function ufGroupTypes() { + public static function ufGroupTypes() { $ufGroupType = array( 'Profile' => ts('Standalone Form or Directory'), 'Search Profile' => ts('Search Views'), @@ -240,7 +240,7 @@ class CRM_Core_SelectValues { * * @static */ - static function groupContactStatus() { + public static function groupContactStatus() { return array( 'Added' => ts('Added'), 'Removed' => ts('Removed'), @@ -252,7 +252,7 @@ class CRM_Core_SelectValues { * List of Group Types * @static */ - static function groupType() { + public static function groupType() { return array( 'query' => ts('Dynamic'), 'static' => ts('Static'), @@ -271,7 +271,7 @@ class CRM_Core_SelectValues { * @return array the date array * @static */ - static function date($type = NULL, $format = NULL, $minOffset = NULL, $maxOffset = NULL) { + public static function date($type = NULL, $format = NULL, $minOffset = NULL, $maxOffset = NULL) { $date = array( 'addEmptyOption' => TRUE, @@ -316,7 +316,7 @@ class CRM_Core_SelectValues { * * @static */ - static function ufVisibility() { + public static function ufVisibility() { return array( 'User and User Admin Only' => ts('User and User Admin Only'), 'Public Pages' => ts('Public Pages'), @@ -329,7 +329,7 @@ class CRM_Core_SelectValues { * * @static */ - static function groupVisibility() { + public static function groupVisibility() { return array( 'User and User Admin Only' => ts('User and User Admin Only'), 'Public Pages' => ts('Public Pages'), @@ -342,7 +342,7 @@ class CRM_Core_SelectValues { * @static * return array */ - static function mailingComponents() { + public static function mailingComponents() { return array('Header' => ts('Header'), 'Footer' => ts('Footer'), 'Reply' => ts('Reply Auto-responder'), @@ -360,7 +360,7 @@ class CRM_Core_SelectValues { * * @static */ - function getHours() { + public function getHours() { $hours = array(); for ($i = 0; $i <= 6; $i++) { $hours[$i] = $i; @@ -374,7 +374,7 @@ class CRM_Core_SelectValues { * * @static */ - function getMinutes() { + public function getMinutes() { $minutes = array(); for ($i = 0; $i < 60; $i = $i + 15) { $minutes[$i] = $i; @@ -388,7 +388,7 @@ class CRM_Core_SelectValues { * @return array $map array of map providers * @static */ - static function mapProvider() { + public static function mapProvider() { static $map = NULL; if (!$map) { $map = CRM_Utils_System::getPluginList('templates/CRM/Contact/Form/Task/Map', ".tpl"); @@ -402,7 +402,7 @@ class CRM_Core_SelectValues { * @return array $geo array of geocoder providers * @static */ - static function geoProvider() { + public static function geoProvider() { static $geo = NULL; if (!$geo) { $geo = CRM_Utils_System::getPluginList('CRM/Utils/Geocode'); @@ -417,7 +417,7 @@ class CRM_Core_SelectValues { * @return array $addr array of address standardization providers * @static */ - static function addressProvider() { + public static function addressProvider() { static $addr = NULL; if (!$addr) { $addr = CRM_Utils_System::getPluginList('CRM/Utils/Address', '.php', array('BatchUpdate')); @@ -431,7 +431,7 @@ class CRM_Core_SelectValues { * @static * return array */ - static function mailingTokens() { + public static function mailingTokens() { return array( '{action.unsubscribe}' => ts('Unsubscribe via email'), '{action.unsubscribeUrl}' => ts('Unsubscribe via web page'), @@ -458,7 +458,7 @@ class CRM_Core_SelectValues { * @static * return array */ - static function activityTokens() { + public static function activityTokens() { return array( '{activity.activity_id}' => ts('Activity ID'), '{activity.subject}' => ts('Activity Subject'), @@ -473,7 +473,7 @@ class CRM_Core_SelectValues { * @static * return array */ - static function membershipTokens() { + public static function membershipTokens() { return array( '{membership.id}' => ts('Membership ID'), '{membership.status}' => ts('Membership Status'), @@ -491,7 +491,7 @@ class CRM_Core_SelectValues { * @static * return array */ - static function eventTokens() { + public static function eventTokens() { return array( '{event.event_id}' => ts('Event ID'), '{event.title}' => ts('Event Title'), @@ -516,7 +516,7 @@ class CRM_Core_SelectValues { * @static * return array */ - static function contributionTokens() { + public static function contributionTokens() { return array( '{contribution.contribution_id}' => ts('Contribution ID'), '{contribution.total_amount}' => ts('Total Amount'), @@ -550,7 +550,7 @@ class CRM_Core_SelectValues { * @static * return array */ - static function contactTokens() { + public static function contactTokens() { static $tokens = NULL; if (!$tokens) { $additionalFields = array('checksum' => array('title' => ts('Checksum')), @@ -617,7 +617,7 @@ class CRM_Core_SelectValues { * @static * return array */ - static function participantTokens() { + public static function participantTokens() { static $tokens = NULL; if (!$tokens) { $exportFields = CRM_Event_BAO_Participant::exportableFields(); @@ -652,7 +652,7 @@ class CRM_Core_SelectValues { /** * CiviCRM supported date input formats */ - static function getDatePluginInputFormats() { + public static function getDatePluginInputFormats() { $dateInputFormats = array( "mm/dd/yy" => ts('mm/dd/yyyy (12/31/2009)'), "dd/mm/yy" => ts('dd/mm/yyyy (31/12/2009)'), @@ -691,7 +691,7 @@ class CRM_Core_SelectValues { /** * Map date plugin and actual format that is used by PHP */ - static function datePluginToPHPFormats() { + public static function datePluginToPHPFormats() { $dateInputFormats = array( "mm/dd/yy" => 'm/d/Y', "dd/mm/yy" => 'd/m/Y', @@ -715,7 +715,7 @@ class CRM_Core_SelectValues { /** * Time formats */ - static function getTimeFormats() { + public static function getTimeFormats() { return array( '1' => ts('12 Hours'), '2' => ts('24 Hours'), @@ -740,7 +740,7 @@ class CRM_Core_SelectValues { * Barcode types * @static */ - static function getBarcodeTypes() { + public static function getBarcodeTypes() { return array( 'barcode' => ts('Linear (1D)'), 'qrcode' => ts('QR code'), @@ -750,7 +750,7 @@ class CRM_Core_SelectValues { /** * Dedupe rule types */ - static function getDedupeRuleTypes() { + public static function getDedupeRuleTypes() { return array( 'Unsupervised' => ts('Unsupervised'), 'Supervised' => ts('Supervised'), @@ -761,7 +761,7 @@ class CRM_Core_SelectValues { /** * Campaign group types */ - static function getCampaignGroupTypes() { + public static function getCampaignGroupTypes() { return array( 'Include' => ts('Include'), 'Exclude' => ts('Exclude'), @@ -771,7 +771,7 @@ class CRM_Core_SelectValues { /** * Subscription history method */ - static function getSubscriptionHistoryMethods() { + public static function getSubscriptionHistoryMethods() { return array( 'Admin' => ts('Admin'), 'Email' => ts('Email'), @@ -783,7 +783,7 @@ class CRM_Core_SelectValues { /** * Premium units */ - static function getPremiumUnits() { + public static function getPremiumUnits() { return array( 'day' => ts('Day'), 'week' => ts('Week'), @@ -795,7 +795,7 @@ class CRM_Core_SelectValues { /** * Extension types */ - static function getExtensionTypes() { + public static function getExtensionTypes() { return array( 'payment' => ts('Payment'), 'search' => ts('Search'), @@ -808,7 +808,7 @@ class CRM_Core_SelectValues { /** * Job frequency */ - static function getJobFrequency() { + public static function getJobFrequency() { return array( 'Daily' => ts('Daily'), 'Hourly' => ts('Hourly'), @@ -819,7 +819,7 @@ class CRM_Core_SelectValues { /** * Search builder operators */ - static function getSearchBuilderOperators() { + public static function getSearchBuilderOperators() { return array( '=' => '=', '!=' => '≠', @@ -842,7 +842,7 @@ class CRM_Core_SelectValues { * * @static */ - static function getProfileGroupType() { + public static function getProfileGroupType() { $profileGroupType = array( 'Activity' => ts('Activities'), 'Contribution' => ts('Contributions'), @@ -860,7 +860,7 @@ class CRM_Core_SelectValues { /** * Word replacement match type */ - static function getWordReplacementMatchType() { + public static function getWordReplacementMatchType() { return array( 'exactMatch' => ts('Exact Match'), 'wildcardMatch' => ts('Wildcard Match'), @@ -870,7 +870,7 @@ class CRM_Core_SelectValues { /** * Mailing group types */ - static function getMailingGroupTypes() { + public static function getMailingGroupTypes() { return array( 'Include' => ts('Include'), 'Exclude' => ts('Exclude'), @@ -881,7 +881,7 @@ class CRM_Core_SelectValues { /** * Mailing Job Status */ - static function getMailingJobStatus() { + public static function getMailingJobStatus() { return array( 'Scheduled' => ts('Scheduled'), 'Running' => ts('Running'), @@ -891,7 +891,7 @@ class CRM_Core_SelectValues { ); } - static function billingMode() { + public static function billingMode() { return array( CRM_Core_Payment::BILLING_MODE_FORM => 'form', CRM_Core_Payment::BILLING_MODE_BUTTON => 'button', @@ -902,7 +902,7 @@ class CRM_Core_SelectValues { /** * Frequency unit for schedule reminders */ - static function getScheduleReminderFrequencyUnits() { + public static function getScheduleReminderFrequencyUnits() { //@todo update schema to refer to option group direct & remove this static $scheduleReminderFrequencyUnits = NULL; if (!$scheduleReminderFrequencyUnits) { diff --git a/CRM/Core/Selector/API.php b/CRM/Core/Selector/API.php index aebd19031f..364e1cc13a 100644 --- a/CRM/Core/Selector/API.php +++ b/CRM/Core/Selector/API.php @@ -59,7 +59,7 @@ interface CRM_Core_Selector_API { * @access public * */ - function getPagerParams($action, &$params); + public function getPagerParams($action, &$params); /** * Returns the sort order array for the given action @@ -70,7 +70,7 @@ interface CRM_Core_Selector_API { * @access public * */ - function &getSortOrder($action); + public function &getSortOrder($action); /** * Returns the column headers as an array of tuples: @@ -82,7 +82,7 @@ interface CRM_Core_Selector_API { * @return array the column headers that need to be displayed * @access public */ - function &getColumnHeaders($action = NULL, $type = NULL); + public function &getColumnHeaders($action = NULL, $type = NULL); /** * Returns the number of rows for this action @@ -94,7 +94,7 @@ interface CRM_Core_Selector_API { * @access public * */ - function getTotalCount($action); + public function getTotalCount($action); /** * Returns all the rows in the given offset and rowCount @@ -108,7 +108,7 @@ interface CRM_Core_Selector_API { * @return int the total number of rows for this action * @access public */ - function &getRows($action, $offset, $rowCount, $sort, $type = NULL); + public function &getRows($action, $offset, $rowCount, $sort, $type = NULL); /** * Return the template (.tpl) filename @@ -119,7 +119,7 @@ interface CRM_Core_Selector_API { * @access public * */ - function getTemplateFileName($action = NULL); + public function getTemplateFileName($action = NULL); /** * Return the filename for the exported CSV @@ -130,6 +130,6 @@ interface CRM_Core_Selector_API { * special characters to avoid various browser issues * */ - function getExportFileName($type = 'csv'); + public function getExportFileName($type = 'csv'); } diff --git a/CRM/Core/Selector/Base.php b/CRM/Core/Selector/Base.php index 32cc5d37dc..d24161d03a 100644 --- a/CRM/Core/Selector/Base.php +++ b/CRM/Core/Selector/Base.php @@ -71,7 +71,7 @@ class CRM_Core_Selector_Base { * @access public * */ - function getActionAttribute($match, $attribute = 'name') { + public function getActionAttribute($match, $attribute = 'name') { $links = &$this->links(); foreach ($link as $action => $item) { @@ -94,7 +94,7 @@ class CRM_Core_Selector_Base { * qs : the parameters to the above url along with any dynamic substitutions * title : A more descriptive name, typically used in breadcrumbs / navigation */ - static function &links() { + public static function &links() { return NULL; } @@ -106,7 +106,7 @@ class CRM_Core_Selector_Base { * @return string template file name * @access public */ - function getTemplateFileName($action = NULL) { + public function getTemplateFileName($action = NULL) { return (str_replace('_', DIRECTORY_SEPARATOR, CRM_Utils_System::getClassName($this)) . ".tpl"); } @@ -118,7 +118,7 @@ class CRM_Core_Selector_Base { * @return array the elements that can be sorted along with their properties * @access public */ - function &getSortOrder($action) { + public function &getSortOrder($action) { $columnHeaders = &$this->getColumnHeaders(NULL); if (!isset($this->_order)) { diff --git a/CRM/Core/Selector/Controller.php b/CRM/Core/Selector/Controller.php index 740bd0710e..a5b6ed7b99 100644 --- a/CRM/Core/Selector/Controller.php +++ b/CRM/Core/Selector/Controller.php @@ -190,7 +190,7 @@ class CRM_Core_Selector_Controller { * @return \CRM_Core_Selector_Controller @access public */ - function __construct($object, $pageID, $sortID, $action, $store = NULL, $output = self::TEMPLATE, $prefix = NULL, $case = NULL) { + public function __construct($object, $pageID, $sortID, $action, $store = NULL, $output = self::TEMPLATE, $prefix = NULL, $case = NULL) { $this->_object = $object; $this->_pageID = $pageID ? $pageID : 1; @@ -257,7 +257,7 @@ class CRM_Core_Selector_Controller { * @return boolean if the GET params are different from the session params * @access public */ - function hasChanged($reset) { + public function hasChanged($reset) { /** * if we are in reset state, i.e the store is cleaned out, we return false @@ -296,7 +296,7 @@ class CRM_Core_Selector_Controller { * @return void * */ - function run() { + public function run() { // get the column headers $columnHeaders = &$this->_object->getColumnHeaders($this->_action, $this->_output); @@ -426,7 +426,7 @@ class CRM_Core_Selector_Controller { * @return CRM_Utils_Pager * @access public */ - function getPager() { + public function getPager() { return $this->_pager; } @@ -436,7 +436,7 @@ class CRM_Core_Selector_Controller { * @return CRM_Utils_Sort * @access public */ - function getSort() { + public function getSort() { return $this->_sort; } @@ -446,7 +446,7 @@ class CRM_Core_Selector_Controller { * @return void * @access public */ - function moveFromSessionToTemplate() { + public function moveFromSessionToTemplate() { self::$_template->assign_by_ref("{$this->_prefix}pager", $this->_pager); $rows = $this->_store->get("{$this->_prefix}rows"); @@ -491,7 +491,7 @@ class CRM_Core_Selector_Controller { * @return void * @access public */ - function setEmbedded($embedded) { + public function setEmbedded($embedded) { $this->_embedded = $embedded; } @@ -501,7 +501,7 @@ class CRM_Core_Selector_Controller { * @return boolean return the embedded value * @access public */ - function getEmbedded() { + public function getEmbedded() { return $this->_embedded; } @@ -513,7 +513,7 @@ class CRM_Core_Selector_Controller { * @return void * @access public */ - function setPrint($print) { + public function setPrint($print) { $this->_print = $print; } @@ -523,21 +523,21 @@ class CRM_Core_Selector_Controller { * @return boolean return the print value * @access public */ - function getPrint() { + public function getPrint() { return $this->_print; } /** * @param $value */ - function setDynamicAction($value) { + public function setDynamicAction($value) { $this->_dynamicAction = $value; } /** * @return bool */ - function getDynamicAction() { + public function getDynamicAction() { return $this->_dynamicAction; } } diff --git a/CRM/Core/Session.php b/CRM/Core/Session.php index 1eb9e00f27..f9c51bdf6d 100644 --- a/CRM/Core/Session.php +++ b/CRM/Core/Session.php @@ -85,7 +85,7 @@ class CRM_Core_Session { * * @return CRM_Core_Session */ - function __construct() { + public function __construct() { $this->_session = null; } @@ -95,7 +95,7 @@ class CRM_Core_Session { * @return CRM_Core_Session * @static */ - static function &singleton() { + public static function &singleton() { if (self::$_singleton === NULL) { self::$_singleton = new CRM_Core_Session; } @@ -112,7 +112,7 @@ class CRM_Core_Session { * * @return void */ - function initialize($isRead = FALSE) { + public function initialize($isRead = FALSE) { // lets initialize the _session variable just before we need it // hopefully any bootstrapping code will actually load the session from the CMS if (!isset($this->_session)) { @@ -158,7 +158,7 @@ class CRM_Core_Session { * * @return void */ - function reset($all = 1) { + public function reset($all = 1) { if ($all != 1) { $this->initialize(); @@ -183,7 +183,7 @@ class CRM_Core_Session { * * @return void */ - function createScope($prefix, $isRead = FALSE) { + public function createScope($prefix, $isRead = FALSE) { $this->initialize($isRead); if ($isRead || empty($prefix)) { @@ -203,7 +203,7 @@ class CRM_Core_Session { * * @return void */ - function resetScope($prefix) { + public function resetScope($prefix) { $this->initialize(); if (empty($prefix)) { @@ -232,7 +232,7 @@ class CRM_Core_Session { * @return void * */ - function set($name, $value = NULL, $prefix = NULL) { + public function set($name, $value = NULL, $prefix = NULL) { // create session scope $this->createScope($prefix); @@ -267,7 +267,7 @@ class CRM_Core_Session { * @return mixed * */ - function get($name, $prefix = NULL) { + public function get($name, $prefix = NULL) { // create session scope $this->createScope($prefix, TRUE); @@ -300,7 +300,7 @@ class CRM_Core_Session { * @return void * */ - function getVars(&$vars, $prefix = '') { + public function getVars(&$vars, $prefix = '') { // create session scope $this->createScope($prefix, TRUE); @@ -332,7 +332,7 @@ class CRM_Core_Session { * @return mixed * */ - function timer($name, $expire) { + public function timer($name, $expire) { $ts = $this->get($name, 'timer'); if (!$ts || $ts < time() - $expire) { $this->set($name, time(), 'timer'); @@ -352,7 +352,7 @@ class CRM_Core_Session { * @access public * */ - function pushUserContext($userContext, $check = TRUE) { + public function pushUserContext($userContext, $check = TRUE) { if (empty($userContext)) { return; } @@ -391,7 +391,7 @@ class CRM_Core_Session { * @access public * */ - function replaceUserContext($userContext) { + public function replaceUserContext($userContext) { if (empty($userContext)) { return; } @@ -408,7 +408,7 @@ class CRM_Core_Session { * @return string the top of the userContext stack (also pops the top element) * */ - function popUserContext() { + public function popUserContext() { $this->createScope(self::USER_CONTEXT); return array_pop($this->_session[$this->_key][self::USER_CONTEXT]); @@ -420,7 +420,7 @@ class CRM_Core_Session { * @return string the top of the userContext stack * */ - function readUserContext() { + public function readUserContext() { $this->createScope(self::USER_CONTEXT); $config = CRM_Core_Config::singleton(); @@ -432,7 +432,7 @@ class CRM_Core_Session { * Dumps the session to the log * @param int $all */ - function debug($all = 1) { + public function debug($all = 1) { $this->initialize(); if ($all != 1) { CRM_Core_Error::debug('CRM Session', $this->_session); @@ -449,7 +449,7 @@ class CRM_Core_Session { * * @return string the status message if any */ - function getStatus($reset = FALSE) { + public function getStatus($reset = FALSE) { $this->initialize(); $status = NULL; @@ -493,7 +493,7 @@ class CRM_Core_Session { * * @return void */ - static function setStatus($text, $title = '', $type = 'alert', $options = array()) { + public static function setStatus($text, $title = '', $type = 'alert', $options = array()) { // make sure session is initialized, CRM-8120 $session = self::singleton(); $session->initialize(); @@ -525,7 +525,7 @@ class CRM_Core_Session { /** * @param string|array $names */ - static function registerAndRetrieveSessionObjects($names) { + public static function registerAndRetrieveSessionObjects($names) { if (!is_array($names)) { $names = array($names); } @@ -543,7 +543,7 @@ class CRM_Core_Session { /** * @param bool $reset */ - static function storeSessionObjects($reset = TRUE) { + public static function storeSessionObjects($reset = TRUE) { if (empty(self::$_managedNames)) { return; } @@ -559,7 +559,7 @@ class CRM_Core_Session { * Retrieve contact id of the logged in user * @return integer|NULL contact ID of logged in user */ - static function getLoggedInContactID() { + public static function getLoggedInContactID() { $session = CRM_Core_Session::singleton(); if (!is_numeric($session->get('userID'))) { return NULL; @@ -570,7 +570,7 @@ class CRM_Core_Session { /** * @return bool */ - function isEmpty() { + public function isEmpty() { // check if session is empty, if so we don't cache // stuff that we can get away with // helps proxies like varnish diff --git a/CRM/Core/ShowHideBlocks.php b/CRM/Core/ShowHideBlocks.php index ea9cae44cc..52909b70d4 100644 --- a/CRM/Core/ShowHideBlocks.php +++ b/CRM/Core/ShowHideBlocks.php @@ -63,7 +63,7 @@ class CRM_Core_ShowHideBlocks { * * @return \CRM_Core_ShowHideBlocks the newly created object@access public */ - function __construct($show = NULL, $hide = NULL) { + public function __construct($show = NULL, $hide = NULL) { if (!empty($show)) { $this->_show = $show; } @@ -86,7 +86,7 @@ class CRM_Core_ShowHideBlocks { * @access public * @static */ - static function setIcons() { + public static function setIcons() { if (!isset(self::$_showIcon)) { $config = CRM_Core_Config::singleton(); self::$_showIcon = '' . ts('show field or section') . ''; @@ -100,7 +100,7 @@ class CRM_Core_ShowHideBlocks { * @return void * @access public */ - function addToTemplate() { + public function addToTemplate() { $hide = $show = ''; $first = TRUE; @@ -134,7 +134,7 @@ class CRM_Core_ShowHideBlocks { * @return void * @access public */ - function addShow($name) { + public function addShow($name) { $this->_show[$name] = 1; if (array_key_exists($name, $this->_hide)) { unset($this->_hide[$name]); @@ -149,7 +149,7 @@ class CRM_Core_ShowHideBlocks { * @return void * @access public */ - function addHide($name) { + public function addHide($name) { $this->_hide[$name] = 1; if (array_key_exists($name, $this->_show)) { unset($this->_show[$name]); @@ -167,7 +167,7 @@ class CRM_Core_ShowHideBlocks { * @return string the formatted html link * @access public */ - static function linkHtml($name, $href, $text, $js) { + public static function linkHtml($name, $href, $text, $js) { return '$text"; } @@ -186,7 +186,7 @@ class CRM_Core_ShowHideBlocks { * @return void * @access public */ - static function links(&$form, $prefix, $showLinkText, $hideLinkText, $assign = TRUE) { + public static function links(&$form, $prefix, $showLinkText, $hideLinkText, $assign = TRUE) { $showCode = "cj('#id_{$prefix}').show(); cj('#id_{$prefix}_show').hide();"; $hideCode = "cj('#id_{$prefix}').hide(); cj('#id_{$prefix}_show').show(); return false;"; @@ -218,7 +218,7 @@ class CRM_Core_ShowHideBlocks { * @return void * @access public */ - function linksForArray(&$form, $index, $maxIndex, $prefix, $showLinkText, $hideLinkText, $elementType = NULL, $hideLink = NULL) { + public function linksForArray(&$form, $index, $maxIndex, $prefix, $showLinkText, $hideLinkText, $elementType = NULL, $hideLink = NULL) { $showHidePrefix = str_replace(array("]", "["), array("", "_"), $prefix); $showHidePrefix = "id_" . $showHidePrefix; if ($index == $maxIndex) { diff --git a/CRM/Core/Smarty.php b/CRM/Core/Smarty.php index deb737c7b1..23c0100403 100644 --- a/CRM/Core/Smarty.php +++ b/CRM/Core/Smarty.php @@ -177,7 +177,7 @@ class CRM_Core_Smarty extends Smarty { * Method providing static instance of SmartTemplate, as * in Singleton pattern. */ - static function &singleton() { + public static function &singleton() { if (!isset(self::$_singleton)) { self::$_singleton = new CRM_Core_Smarty( ); self::$_singleton->initialize( ); @@ -197,7 +197,7 @@ class CRM_Core_Smarty extends Smarty { * * @return bool|mixed|string */ - function fetch($resource_name, $cache_id = NULL, $compile_id = NULL, $display = FALSE) { + public function fetch($resource_name, $cache_id = NULL, $compile_id = NULL, $display = FALSE) { if (preg_match( '/^(\s+)?string:/', $resource_name)) { $old_security = $this->security; $this->security = TRUE; @@ -217,7 +217,7 @@ class CRM_Core_Smarty extends Smarty { * @throws Exception * @return bool|mixed|string */ - function fetchWith($resource_name, $vars) { + public function fetchWith($resource_name, $vars) { $this->pushScope($vars); try { $result = $this->fetch($resource_name); @@ -234,7 +234,7 @@ class CRM_Core_Smarty extends Smarty { * @param string $name * @param $value */ - function appendValue($name, $value) { + public function appendValue($name, $value) { $currentValue = $this->get_template_vars($name); if (!$currentValue) { $this->assign($name, $value); @@ -246,7 +246,7 @@ class CRM_Core_Smarty extends Smarty { } } - function clearTemplateVars() { + public function clearTemplateVars() { foreach (array_keys($this->_tpl_vars) as $key) { if ($key == 'config' || $key == 'session') { continue; @@ -255,7 +255,7 @@ class CRM_Core_Smarty extends Smarty { } } - static function registerStringResource() { + public static function registerStringResource() { require_once 'CRM/Core/Smarty/resources/String.php'; civicrm_smarty_register_string_resource(); } @@ -263,7 +263,7 @@ class CRM_Core_Smarty extends Smarty { /** * @param $path */ - function addTemplateDir($path) { + public function addTemplateDir($path) { if ( is_array( $this->template_dir ) ) { array_unshift( $this->template_dir, $path ); } else { diff --git a/CRM/Core/Smarty/Permissions.php b/CRM/Core/Smarty/Permissions.php index 2c4f648f21..a64389565d 100644 --- a/CRM/Core/Smarty/Permissions.php +++ b/CRM/Core/Smarty/Permissions.php @@ -10,7 +10,7 @@ class CRM_Core_Smarty_Permissions { * * @return bool */ - function check($offset) { + public function check($offset) { return CRM_Core_Permission::check($offset); } diff --git a/CRM/Core/State.php b/CRM/Core/State.php index 917f35a6ad..323f5dc3de 100644 --- a/CRM/Core/State.php +++ b/CRM/Core/State.php @@ -88,7 +88,7 @@ class CRM_Core_State { * @return CRM_Core_State * @access public */ - function __construct($name, $type, $back, $next, &$stateMachine) { + public function __construct($name, $type, $back, $next, &$stateMachine) { $this->_name = $name; $this->_type = $type; $this->_back = $back; @@ -97,7 +97,7 @@ class CRM_Core_State { $this->_stateMachine = &$stateMachine; } - function debugPrint() { + public function debugPrint() { CRM_Core_Error::debug("{$this->_name}, {$this->_type}", "{$this->_back}, {$this->_next}"); } @@ -109,7 +109,7 @@ class CRM_Core_State { * @return mixed does a jump to the back state * @access public */ - function handleBackState(&$page) { + public function handleBackState(&$page) { if ($this->_type & self::START) { $page->handle('display'); } @@ -127,7 +127,7 @@ class CRM_Core_State { * @return mixed does a jump to the nextstate * @access public */ - function handleNextState(&$page) { + public function handleNextState(&$page) { if ($this->_type & self::FINISH) { $page->handle('process'); } @@ -144,7 +144,7 @@ class CRM_Core_State { * @return string * @access public */ - function getNextState() { + public function getNextState() { if ($this->_type & self::FINISH) { return NULL; } @@ -163,7 +163,7 @@ class CRM_Core_State { * @return void * @access public */ - function validate(&$data) { + public function validate(&$data) { $data['valid'][$this->_name] = TRUE; } @@ -176,7 +176,7 @@ class CRM_Core_State { * @return void * @access public */ - function invalidate(&$data) { + public function invalidate(&$data) { $data['valid'][$this->_name] = NULL; } @@ -186,7 +186,7 @@ class CRM_Core_State { * @return string * @access public */ - function getName() { + public function getName() { return $this->_name; } @@ -198,7 +198,7 @@ class CRM_Core_State { * @return void * @access public */ - function setName($name) { + public function setName($name) { $this->_name = $name; } @@ -208,7 +208,7 @@ class CRM_Core_State { * @return int * @access public */ - function getType() { + public function getType() { return $this->_type; } } diff --git a/CRM/Core/StateMachine.php b/CRM/Core/StateMachine.php index d38f1fbab5..59c7354bea 100644 --- a/CRM/Core/StateMachine.php +++ b/CRM/Core/StateMachine.php @@ -92,7 +92,7 @@ class CRM_Core_StateMachine { * @return \CRM_Core_StateMachine @access public */ - function __construct(&$controller, $action = CRM_Core_Action::NONE) { + public function __construct(&$controller, $action = CRM_Core_Action::NONE) { $this->_controller = &$controller; $this->_action = $action; @@ -133,7 +133,7 @@ class CRM_Core_StateMachine { * @return void * @access public */ - function perform(&$page, $actionName, $type = 'Next') { + public function perform(&$page, $actionName, $type = 'Next') { // save the form values and validation status to the session $page->isFormBuilt() or $page->buildForm(); @@ -181,7 +181,7 @@ class CRM_Core_StateMachine { * @return void * @access public */ - function addState($name, $type, $prev, $next) { + public function addState($name, $type, $prev, $next) { $this->_states[$name] = new CRM_Core_State($name, $type, $prev, $next, $this); } @@ -193,7 +193,7 @@ class CRM_Core_StateMachine { * @return object the state object * @access public */ - function find($name) { + public function find($name) { if (array_key_exists($name, $this->_states)) { return $this->_states[$name]; } @@ -208,7 +208,7 @@ class CRM_Core_StateMachine { * @return array array of states in the state machine * @access public */ - function getStates() { + public function getStates() { return $this->_states; } @@ -220,7 +220,7 @@ class CRM_Core_StateMachine { * @return CRM_Core_State state object matching the name * @access public */ - function &getState($name) { + public function &getState($name) { if (isset($this->_states[$name])) { return $this->_states[$name]; } @@ -245,7 +245,7 @@ class CRM_Core_StateMachine { * @return array array of pages in the state machine * @access public */ - function getPages() { + public function getPages() { return $this->_pages; } @@ -263,7 +263,7 @@ class CRM_Core_StateMachine { * * @return void */ - function addSequentialPages(&$pages) { + public function addSequentialPages(&$pages) { $this->_pages = &$pages; $numPages = count($pages); @@ -321,7 +321,7 @@ class CRM_Core_StateMachine { * @return void * @access public */ - function reset() { + public function reset() { $this->_controller->reset(); } @@ -331,7 +331,7 @@ class CRM_Core_StateMachine { * @return int * @access public */ - function getAction() { + public function getAction() { return $this->_action; } @@ -343,7 +343,7 @@ class CRM_Core_StateMachine { * @return void * @access public */ - function setContent(&$content) { + public function setContent(&$content) { $this->_controller->setContent($content); } @@ -353,35 +353,35 @@ class CRM_Core_StateMachine { * @return string * @access public */ - function &getContent() { + public function &getContent() { return $this->_controller->getContent(); } /** * @return mixed */ - function getDestination() { + public function getDestination() { return $this->_controller->getDestination(); } /** * @return mixed */ - function getSkipRedirection() { + public function getSkipRedirection() { return $this->_controller->getSkipRedirection(); } /** * @return mixed */ - function fini() { + public function fini() { return $this->_controller->fini(); } /** * @return mixed */ - function cancelAction() { + public function cancelAction() { return $this->_controller->cancelAction(); } @@ -394,7 +394,7 @@ class CRM_Core_StateMachine { * * @return boolean */ - function shouldReset() { + public function shouldReset() { return TRUE; } diff --git a/CRM/Core/TableHierarchy.php b/CRM/Core/TableHierarchy.php index 3d6a707cee..539bc9bc4d 100644 --- a/CRM/Core/TableHierarchy.php +++ b/CRM/Core/TableHierarchy.php @@ -81,7 +81,7 @@ class CRM_Core_TableHierarchy { /** * @return array */ - static function &info() { + public static function &info() { //get the campaign related tables. CRM_Campaign_BAO_Query::info(self::$info); diff --git a/CRM/Core/Transaction.php b/CRM/Core/Transaction.php index 412bbae5a7..36d841aad1 100644 --- a/CRM/Core/Transaction.php +++ b/CRM/Core/Transaction.php @@ -119,11 +119,11 @@ class CRM_Core_Transaction { * - If true, then make a new nested transaction ("SAVEPOINT") * - If false, then attach to the existing transaction */ - function __construct($nest = FALSE) { + public function __construct($nest = FALSE) { \Civi\Core\Transaction\Manager::singleton()->inc($nest); } - function __destruct() { + public function __destruct() { $this->commit(); } @@ -134,7 +134,7 @@ class CRM_Core_Transaction { * * @return \CRM_Core_Exception this */ - function commit() { + public function commit() { if (!$this->_pseudoCommitted) { $this->_pseudoCommitted = TRUE; \Civi\Core\Transaction\Manager::singleton()->dec(); diff --git a/CRM/Custom/Form/ChangeFieldType.php b/CRM/Custom/Form/ChangeFieldType.php index c9e5883519..2f2a5e609c 100644 --- a/CRM/Custom/Form/ChangeFieldType.php +++ b/CRM/Custom/Form/ChangeFieldType.php @@ -62,7 +62,7 @@ class CRM_Custom_Form_ChangeFieldType extends CRM_Core_Form { * @return void * @acess protected */ - function preProcess() { + public function preProcess() { $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE ); @@ -201,7 +201,7 @@ class CRM_Custom_Form_ChangeFieldType extends CRM_Core_Form { * * @return array|null */ - static function fieldTypeTransitions($dataType, $htmlType) { + public static function fieldTypeTransitions($dataType, $htmlType) { // Text field is single value field, // can not be change to other single value option which contains option group if ($htmlType == 'Text') { @@ -304,7 +304,7 @@ class CRM_Custom_Form_ChangeFieldType extends CRM_Core_Form { * * @return array */ - static function explode($str) { + public static function explode($str) { if (empty($str) || $str == CRM_Core_DAO::VALUE_SEPARATOR . CRM_Core_DAO::VALUE_SEPARATOR) { return array(); } diff --git a/CRM/Custom/Form/CustomData.php b/CRM/Custom/Form/CustomData.php index 24b5a04d1c..1a2e5d5fd3 100644 --- a/CRM/Custom/Form/CustomData.php +++ b/CRM/Custom/Form/CustomData.php @@ -150,7 +150,7 @@ class CRM_Custom_Form_CustomData { * * @return array */ - static function setDefaultValues(&$form) { + public static function setDefaultValues(&$form) { $defaults = array(); CRM_Core_BAO_CustomGroup::setDefaults($form->_groupTree, $defaults, FALSE, FALSE, $form->get('action')); return $defaults; @@ -160,7 +160,7 @@ class CRM_Custom_Form_CustomData { * @param CRM_Core_Form $form * @return void */ - static function buildQuickForm(&$form) { + public static function buildQuickForm(&$form) { $form->addElement('hidden', 'hidden_custom', 1); $form->addElement('hidden', "hidden_custom_group_count[{$form->_groupID}]", $form->_groupCount); CRM_Core_BAO_CustomGroup::buildQuickForm($form, $form->_groupTree); diff --git a/CRM/Custom/Form/DeleteField.php b/CRM/Custom/Form/DeleteField.php index fac170a94f..b79fe400f9 100644 --- a/CRM/Custom/Form/DeleteField.php +++ b/CRM/Custom/Form/DeleteField.php @@ -60,7 +60,7 @@ class CRM_Custom_Form_DeleteField extends CRM_Core_Form { * @return void * @acess protected */ - function preProcess() { + public function preProcess() { $this->_id = $this->get('id'); diff --git a/CRM/Custom/Form/DeleteGroup.php b/CRM/Custom/Form/DeleteGroup.php index 3fba3d9337..d74c1e4e75 100644 --- a/CRM/Custom/Form/DeleteGroup.php +++ b/CRM/Custom/Form/DeleteGroup.php @@ -58,7 +58,7 @@ class CRM_Custom_Form_DeleteGroup extends CRM_Core_Form { * @return void * @acess protected */ - function preProcess() { + public function preProcess() { $this->_id = $this->get('id'); $defaults = array(); diff --git a/CRM/Custom/Form/Field.php b/CRM/Custom/Form/Field.php index 8deb783b2e..3489b9ccd1 100644 --- a/CRM/Custom/Form/Field.php +++ b/CRM/Custom/Form/Field.php @@ -171,7 +171,7 @@ class CRM_Custom_Form_Field extends CRM_Core_Form { * @return array array of default values * @access public */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = $this->_values; if ($this->_id) { @@ -571,7 +571,7 @@ class CRM_Custom_Form_Field extends CRM_Core_Form { * @static * @access public */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $default = CRM_Utils_Array::value('default_value', $fields); $errors = array(); diff --git a/CRM/Custom/Form/Group.php b/CRM/Custom/Form/Group.php index 8750aa08a3..8b1b126eaa 100644 --- a/CRM/Custom/Form/Group.php +++ b/CRM/Custom/Form/Group.php @@ -121,7 +121,7 @@ class CRM_Custom_Form_Group extends CRM_Core_Form { * @access public * @static */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); //validate group title as well as name. @@ -183,7 +183,7 @@ class CRM_Custom_Form_Group extends CRM_Core_Form { * @access public * @see valid_date */ - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Custom_Form_Group', 'formRule'), $this); } @@ -412,7 +412,7 @@ class CRM_Custom_Form_Group extends CRM_Core_Form { * @return array array of default values * @access public */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = &$this->_defaults; $this->assign('showMaxMultiple', TRUE); if ($this->_action == CRM_Core_Action::ADD) { @@ -535,7 +535,7 @@ class CRM_Custom_Form_Group extends CRM_Core_Form { * * @return array of relationship name. */ - static function getFormattedList(&$list) { + public static function getFormattedList(&$list) { $relName = array(); foreach ($list as $listItemKey => $itemValue) { diff --git a/CRM/Custom/Form/MoveField.php b/CRM/Custom/Form/MoveField.php index 468ad34333..214310f296 100644 --- a/CRM/Custom/Form/MoveField.php +++ b/CRM/Custom/Form/MoveField.php @@ -79,7 +79,7 @@ class CRM_Custom_Form_MoveField extends CRM_Core_Form { * @return void * @acess protected */ - function preProcess() { + public function preProcess() { $this->_srcFID = CRM_Utils_Request::retrieve('fid', 'Positive', $this, TRUE ); @@ -148,7 +148,7 @@ class CRM_Custom_Form_MoveField extends CRM_Core_Form { * * @return array|bool */ - static function formRule($fields, $files, $self) { + 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(); diff --git a/CRM/Custom/Form/Option.php b/CRM/Custom/Form/Option.php index cc554899ad..0fb42bb009 100644 --- a/CRM/Custom/Form/Option.php +++ b/CRM/Custom/Form/Option.php @@ -112,7 +112,7 @@ class CRM_Custom_Form_Option extends CRM_Core_Form { * @return array array of default values * @access public */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = $fieldDefaults = array(); if (isset($this->_id)) { $params = array('id' => $this->_id); @@ -254,7 +254,7 @@ class CRM_Custom_Form_Option extends CRM_Core_Form { * @static * @access public */ - static function formRule($fields, $files, $form) { + public static function formRule($fields, $files, $form) { $optionLabel = $fields['label']; $optionValue = $fields['value']; $fieldId = $form->_fid; diff --git a/CRM/Custom/Form/Preview.php b/CRM/Custom/Form/Preview.php index 7637202206..c0db0280d2 100644 --- a/CRM/Custom/Form/Preview.php +++ b/CRM/Custom/Form/Preview.php @@ -60,7 +60,7 @@ class CRM_Custom_Form_Preview extends CRM_Core_Form { * @return void * @access public */ - function preProcess() { + public function preProcess() { // get the controller vars $this->_groupId = $this->get('groupId'); $this->_fieldId = $this->get('fieldId'); @@ -100,7 +100,7 @@ class CRM_Custom_Form_Preview extends CRM_Core_Form { * @return array the default array reference * @access protected */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); CRM_Core_BAO_CustomGroup::setDefaults($this->_groupTree, $defaults, FALSE, FALSE); diff --git a/CRM/Custom/Import/Controller.php b/CRM/Custom/Import/Controller.php index 5212ea1848..bead20ad6d 100644 --- a/CRM/Custom/Import/Controller.php +++ b/CRM/Custom/Import/Controller.php @@ -7,7 +7,7 @@ class CRM_Custom_Import_Controller extends CRM_Core_Controller { /** * Class constructor */ - function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { + public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { parent::__construct($title, $modal); // lets get around the time limit issue if possible, CRM-2113 diff --git a/CRM/Custom/Import/Form/DataSource.php b/CRM/Custom/Import/Form/DataSource.php index 22ec930baf..a1e226dc63 100644 --- a/CRM/Custom/Import/Form/DataSource.php +++ b/CRM/Custom/Import/Form/DataSource.php @@ -62,7 +62,7 @@ class CRM_Custom_Import_Form_DataSource extends CRM_Core_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $config = CRM_Core_Config::singleton(); $defaults = array( 'contactType' => CRM_Import_Parser::CONTACT_INDIVIDUAL, diff --git a/CRM/Custom/Import/Form/MapField.php b/CRM/Custom/Import/Form/MapField.php index 56f2a2568f..519f25c75c 100644 --- a/CRM/Custom/Import/Form/MapField.php +++ b/CRM/Custom/Import/Form/MapField.php @@ -65,7 +65,7 @@ class CRM_Custom_Import_Form_MapField extends CRM_Contact_Import_Form_MapField { * @static * @access public */ - static function formRule($fields) { + public static function formRule($fields) { $errors = array(); $fieldMessage = NULL; if (!array_key_exists('savedMapping', $fields)) { diff --git a/CRM/Custom/Import/Parser.php b/CRM/Custom/Import/Parser.php index 31536db4cb..47e9203d6b 100644 --- a/CRM/Custom/Import/Parser.php +++ b/CRM/Custom/Import/Parser.php @@ -296,7 +296,7 @@ abstract class CRM_Custom_Import_Parser extends CRM_Contact_Import_Parser { * @return void * @access public */ - function setActiveFields($fieldKeys) { + public function setActiveFields($fieldKeys) { $this->_activeFieldCount = count($fieldKeys); foreach ($fieldKeys as $key) { if (empty($this->_fields[$key])) { @@ -314,7 +314,7 @@ abstract class CRM_Custom_Import_Parser extends CRM_Contact_Import_Parser { * @return array (reference ) associative array of name/value pairs * @access public */ - function &getActiveFieldParams() { + public function &getActiveFieldParams() { $params = array(); for ($i = 0; $i < $this->_activeFieldCount; $i++) { if (isset($this->_activeFields[$i]->_value) @@ -337,7 +337,7 @@ abstract class CRM_Custom_Import_Parser extends CRM_Contact_Import_Parser { * @return void * @access public */ - function set($store, $mode = self::MODE_SUMMARY) { + public function set($store, $mode = self::MODE_SUMMARY) { $store->set('fileSize', $this->_fileSize); $store->set('lineCount', $this->_lineCount); $store->set('seperator', $this->_separator); diff --git a/CRM/Custom/Import/Parser/Api.php b/CRM/Custom/Import/Parser/Api.php index e178107725..accb1ab575 100644 --- a/CRM/Custom/Import/Parser/Api.php +++ b/CRM/Custom/Import/Parser/Api.php @@ -19,11 +19,11 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser { /** * Class constructor */ - function __construct(&$mapperKeys, $mapperLocType = NULL, $mapperPhoneType = NULL) { + public function __construct(&$mapperKeys, $mapperLocType = NULL, $mapperPhoneType = NULL) { parent::__construct(); $this->_mapperKeys = &$mapperKeys; } - function setFields() { + 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); @@ -35,7 +35,7 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser { * @return void * @access public */ - function init() { + public function init() { $this->setFields(); $fields = $this->_fields; $hasLocationType = FALSE; @@ -57,7 +57,7 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser { * @return boolean * @access public */ - function mapField(&$values) { + public function mapField(&$values) { return CRM_Import_Parser::VALID; } @@ -69,7 +69,7 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser { * @return boolean the result of this processing * @access public */ - function preview(&$values) { + public function preview(&$values) { return $this->summary($values); } @@ -81,7 +81,7 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser { * (non-PHPdoc) * @see CRM_Custom_Import_Parser_BaseClass::summary() */ - function summary(&$values) { + public function summary(&$values) { $erroneousField = NULL; $response = $this->setActiveFieldValues($values, $erroneousField); $errorRequired = FALSE; @@ -130,7 +130,7 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser { * @return boolean the result of this processing * @access public */ - function import($onDuplicate, &$values) { + public function import($onDuplicate, &$values) { $response = $this->summary($values); if ($response != CRM_Import_Parser::VALID) { $importRecordParams = array( @@ -177,7 +177,7 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser { * Although the api will accept any strtotime valid string CiviCRM accepts at least one date format * not supported by strtotime so we should run this through a conversion */ - function formatDateParams() { + public function formatDateParams() { $session = CRM_Core_Session::singleton(); $dateType = $session->get('dateTypes'); $setDateFields = array_intersect_key($this->_params, array_flip($this->_dateFields)); @@ -192,7 +192,7 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser { * Set import entity * @param string $entity */ - function setEntity($entity) { + public function setEntity($entity) { $this->_entity = $entity; $this->_multipleCustomData = $entity; } @@ -203,7 +203,7 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser { * @return void * @access public */ - function fini() {} + public function fini() {} /** * Return the field ids and names (with groups) for import purpose. @@ -215,7 +215,7 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser { * @access public * @static */ - function getGroupFieldsForImport( $id ) { + public function getGroupFieldsForImport( $id ) { $importableFields = array(); $params = array('custom_group_id' => $id); $allFields = civicrm_api3('custom_field', 'get', $params); diff --git a/CRM/Custom/Page/Field.php b/CRM/Custom/Page/Field.php index 45c3d59bc4..7b95d71993 100644 --- a/CRM/Custom/Page/Field.php +++ b/CRM/Custom/Page/Field.php @@ -69,7 +69,7 @@ class CRM_Custom_Page_Field extends CRM_Core_Page { * @return array array of action links that we need to display for the browse screen * @access public */ - function &actionLinks() { + public function &actionLinks() { if (!isset(self::$_actionLinks)) { self::$_actionLinks = array( CRM_Core_Action::UPDATE => array( @@ -126,7 +126,7 @@ class CRM_Custom_Page_Field extends CRM_Core_Page { * @return void * @access public */ - function browse() { + public function browse() { $resourceManager = CRM_Core_Resources::singleton(); if (!empty($_GET['new']) && $resourceManager->ajaxPopupsEnabled) { $resourceManager->addScriptFile('civicrm', 'js/crm.addNew.js', 999, 'html-header'); @@ -209,7 +209,7 @@ class CRM_Custom_Page_Field extends CRM_Core_Page { * @return void * @access public */ - function edit($action) { + public function edit($action) { // create a simple controller for editing custom dataCRM/Custom/Page/Field.php $controller = new CRM_Core_Controller_Simple('CRM_Custom_Form_Field', ts('Custom Field'), $action); @@ -234,7 +234,7 @@ class CRM_Custom_Page_Field extends CRM_Core_Page { * @return void * @access public */ - function run() { + public function run() { $id = CRM_Utils_Request::retrieve('id', 'Positive', @@ -313,7 +313,7 @@ class CRM_Custom_Page_Field extends CRM_Core_Page { * @return void * @access public */ - function preview($id) { + public function preview($id) { $controller = new CRM_Core_Controller_Simple('CRM_Custom_Form_Preview', ts('Preview Custom Data'), CRM_Core_Action::PREVIEW); $session = CRM_Core_Session::singleton(); $session->pushUserContext(CRM_Utils_System::url('civicrm/admin/custom/group/field', 'reset=1&action=browse&gid=' . $this->_gid)); diff --git a/CRM/Custom/Page/Group.php b/CRM/Custom/Page/Group.php index b0a12f3d9a..47e0e0c46c 100644 --- a/CRM/Custom/Page/Group.php +++ b/CRM/Custom/Page/Group.php @@ -58,7 +58,7 @@ class CRM_Custom_Page_Group extends CRM_Core_Page { * @return array array of action links that we need to display for the browse screen * @access public */ - function &actionLinks() { + public function &actionLinks() { // check if variable _actionsLinks is populated if (!isset(self::$_actionLinks)) { self::$_actionLinks = array( @@ -114,7 +114,7 @@ class CRM_Custom_Page_Group extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { // get the requested action $action = CRM_Utils_Request::retrieve('action', 'String', // default to 'browse' @@ -163,7 +163,7 @@ class CRM_Custom_Page_Group extends CRM_Core_Page { * @return void * @access public */ - function edit($id, $action) { + public function edit($id, $action) { // create a simple controller for editing custom data $controller = new CRM_Core_Controller_Simple('CRM_Custom_Form_Group', ts('Custom Set'), $action); @@ -184,7 +184,7 @@ class CRM_Custom_Page_Group extends CRM_Core_Page { * @return void * @access public */ - function preview($id) { + public function preview($id) { $controller = new CRM_Core_Controller_Simple('CRM_Custom_Form_Preview', ts('Preview Custom Data'), NULL); $session = CRM_Core_Session::singleton(); $session->pushUserContext(CRM_Utils_System::url('civicrm/admin/custom/group', 'action=browse')); @@ -202,7 +202,7 @@ class CRM_Custom_Page_Group extends CRM_Core_Page { * @return void * @access public */ - function browse($action = NULL) { + public function browse($action = NULL) { // get all custom groups sorted by weight $customGroup = array(); $dao = new CRM_Core_DAO_CustomGroup(); diff --git a/CRM/Custom/Page/Option.php b/CRM/Custom/Page/Option.php index 00d09fb0dc..dd489d4ee8 100644 --- a/CRM/Custom/Page/Option.php +++ b/CRM/Custom/Page/Option.php @@ -77,7 +77,7 @@ class CRM_Custom_Page_Option extends CRM_Core_Page { * @return array array of action links that we need to display for the browse screen * @access public */ - function &actionLinks() { + public function &actionLinks() { if (!isset(self::$_actionLinks)) { self::$_actionLinks = array( CRM_Core_Action::UPDATE => array( @@ -121,7 +121,7 @@ class CRM_Custom_Page_Option extends CRM_Core_Page { * @return void * @access public */ - function browse() { + public function browse() { //get the default value from custom fields $customFieldBAO = new CRM_Core_BAO_CustomField(); $customFieldBAO->id = $this->_fid; @@ -247,7 +247,7 @@ ORDER BY weight, label * @return void * @access public */ - function edit($action) { + public function edit($action) { // create a simple controller for editing custom data $controller = new CRM_Core_Controller_Simple('CRM_Custom_Form_Option', ts('Custom Option'), $action); @@ -273,7 +273,7 @@ ORDER BY weight, label * @return void * @access public */ - function run() { + public function run() { // get the field id $this->_fid = CRM_Utils_Request::retrieve('fid', 'Positive', diff --git a/CRM/Dashlet/Page/Activity.php b/CRM/Dashlet/Page/Activity.php index f2e7f6c744..a0722e128c 100644 --- a/CRM/Dashlet/Page/Activity.php +++ b/CRM/Dashlet/Page/Activity.php @@ -46,7 +46,7 @@ class CRM_Dashlet_Page_Activity extends CRM_Core_Page { * * @access public */ - function run() { + public function run() { $session = CRM_Core_Session::singleton(); $contactID = $session->get('userID'); $this->assign('contactID', $contactID); diff --git a/CRM/Dashlet/Page/AllCases.php b/CRM/Dashlet/Page/AllCases.php index a6a867ab50..3a1f8bf24c 100644 --- a/CRM/Dashlet/Page/AllCases.php +++ b/CRM/Dashlet/Page/AllCases.php @@ -46,7 +46,7 @@ class CRM_Dashlet_Page_AllCases extends CRM_Core_Page { * * @access public */ - function run() { + public function run() { $context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'dashlet'); $this->assign('context', $context); diff --git a/CRM/Dashlet/Page/Blog.php b/CRM/Dashlet/Page/Blog.php index 9b67dd7705..04000ad8e3 100644 --- a/CRM/Dashlet/Page/Blog.php +++ b/CRM/Dashlet/Page/Blog.php @@ -62,7 +62,7 @@ class CRM_Dashlet_Page_Blog extends CRM_Core_Page { * * @access public */ - function run() { + public function run() { $context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'dashlet'); $this->assign('context', $context); diff --git a/CRM/Dashlet/Page/CaseDashboard.php b/CRM/Dashlet/Page/CaseDashboard.php index f76ef6f548..117305e139 100644 --- a/CRM/Dashlet/Page/CaseDashboard.php +++ b/CRM/Dashlet/Page/CaseDashboard.php @@ -46,7 +46,7 @@ class CRM_Dashlet_Page_CaseDashboard extends CRM_Core_Page { * * @access public */ - function run() { + public function run() { //check for civicase access. if (!CRM_Case_BAO_Case::accessCiviCase()) { diff --git a/CRM/Dashlet/Page/MyCases.php b/CRM/Dashlet/Page/MyCases.php index 34ae8f7904..650d548f06 100644 --- a/CRM/Dashlet/Page/MyCases.php +++ b/CRM/Dashlet/Page/MyCases.php @@ -46,7 +46,7 @@ class CRM_Dashlet_Page_MyCases extends CRM_Core_Page { * * @access public */ - function run() { + public function run() { $context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'dashlet'); $this->assign('context', $context); diff --git a/CRM/Dedupe/BAO/QueryBuilder.php b/CRM/Dedupe/BAO/QueryBuilder.php index d372dab0d8..dc7fb41066 100644 --- a/CRM/Dedupe/BAO/QueryBuilder.php +++ b/CRM/Dedupe/BAO/QueryBuilder.php @@ -11,7 +11,7 @@ class CRM_Dedupe_BAO_QueryBuilder { * * @return string */ - static function internalFilters( $rg, $strID1 = 'contact1.id', $strID2 = 'contact2.id' ) { + public static function internalFilters( $rg, $strID1 = 'contact1.id', $strID2 = 'contact2.id' ) { // Add a contact id filter for dedupe by group requests and add logic // to remove duplicate results with opposing orders, i.e. 1,2 and 2,1 if( !empty($rg->contactIds) ) { diff --git a/CRM/Dedupe/BAO/QueryBuilder/IndividualGeneral.php b/CRM/Dedupe/BAO/QueryBuilder/IndividualGeneral.php index 6438c7f382..c96c28b0b6 100644 --- a/CRM/Dedupe/BAO/QueryBuilder/IndividualGeneral.php +++ b/CRM/Dedupe/BAO/QueryBuilder/IndividualGeneral.php @@ -10,7 +10,7 @@ class CRM_Dedupe_BAO_QueryBuilder_IndividualGeneral extends CRM_Dedupe_BAO_Query * * @return array */ - static function record($rg) { + public static function record($rg) { $civicrm_contact = CRM_Utils_Array::value('civicrm_contact', $rg->params); $civicrm_address = CRM_Utils_Array::value('civicrm_address', $rg->params); @@ -49,7 +49,7 @@ class CRM_Dedupe_BAO_QueryBuilder_IndividualGeneral extends CRM_Dedupe_BAO_Query * * @return array */ - static function internal($rg) { + public static function internal($rg) { $query = " SELECT contact1.id id1, contact2.id id2, {$rg->threshold} weight FROM civicrm_contact AS contact1 diff --git a/CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php b/CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php index 273beaae5f..087b19993b 100644 --- a/CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php +++ b/CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php @@ -11,7 +11,7 @@ class CRM_Dedupe_BAO_QueryBuilder_IndividualSupervised extends CRM_Dedupe_BAO_Qu * * @return array */ - static function record($rg) { + public static function record($rg) { $civicrm_contact = CRM_Utils_Array::value('civicrm_contact', $rg->params, array()); $civicrm_email = CRM_Utils_Array::value('civicrm_email', $rg->params, array()); @@ -39,7 +39,7 @@ class CRM_Dedupe_BAO_QueryBuilder_IndividualSupervised extends CRM_Dedupe_BAO_Qu * * @return array */ - static function internal($rg) { + public static function internal($rg) { $query = " SELECT contact1.id as id1, contact2.id as id2, {$rg->threshold} as weight FROM civicrm_contact as contact1 diff --git a/CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php b/CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php index 35ebb1941f..f44b344d41 100644 --- a/CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php +++ b/CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php @@ -35,7 +35,7 @@ class CRM_Dedupe_BAO_QueryBuilder_IndividualUnsupervised extends CRM_Dedupe_BAO_ * * @return array */ - static function record($rg) { + public static function record($rg) { $civicrm_email = CRM_Utils_Array::value('civicrm_email', $rg->params, array()); $params = array( @@ -57,7 +57,7 @@ class CRM_Dedupe_BAO_QueryBuilder_IndividualUnsupervised extends CRM_Dedupe_BAO_ * * @return array */ - static function internal($rg) { + public static function internal($rg) { $query = " SELECT contact1.id as id1, contact2.id as id2, {$rg->threshold} as weight FROM civicrm_contact as contact1 @@ -75,7 +75,7 @@ class CRM_Dedupe_BAO_QueryBuilder_IndividualUnsupervised extends CRM_Dedupe_BAO_ * An alternative version which might perform a lot better * than the above. Will need to do some testing */ - static function internalOptimized($rg) { + public static function internalOptimized($rg) { $sql = " CREATE TEMPORARY TABLE emails ( email varchar(255), diff --git a/CRM/Dedupe/BAO/Rule.php b/CRM/Dedupe/BAO/Rule.php index 3b824a85eb..c21bac1226 100644 --- a/CRM/Dedupe/BAO/Rule.php +++ b/CRM/Dedupe/BAO/Rule.php @@ -55,7 +55,7 @@ class CRM_Dedupe_BAO_Rule extends CRM_Dedupe_DAO_Rule { * * @return string SQL query performing the search */ - function sql() { + public function sql() { if ($this->params && (!array_key_exists($this->rule_table, $this->params) || !array_key_exists($this->rule_field, $this->params[$this->rule_table]) @@ -192,7 +192,7 @@ class CRM_Dedupe_BAO_Rule extends CRM_Dedupe_DAO_Rule { * @return rule fields array associated to rule group * @access public */ - static function dedupeRuleFields($params) { + public static function dedupeRuleFields($params) { $rgBao = new CRM_Dedupe_BAO_RuleGroup(); $rgBao->used = $params['used']; $rgBao->contact_type = $params['contact_type']; @@ -214,7 +214,7 @@ class CRM_Dedupe_BAO_Rule extends CRM_Dedupe_DAO_Rule { * * @return bool */ - static function validateContacts($cid, $oid) { + public static function validateContacts($cid, $oid) { if (!$cid || !$oid) { return; } diff --git a/CRM/Dedupe/BAO/RuleGroup.php b/CRM/Dedupe/BAO/RuleGroup.php index c300dc7512..0b1a692145 100644 --- a/CRM/Dedupe/BAO/RuleGroup.php +++ b/CRM/Dedupe/BAO/RuleGroup.php @@ -61,7 +61,7 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup { * * @return array a table-keyed array of field-keyed arrays holding supported fields' titles */ - static function &supportedFields($requestedType) { + public static function &supportedFields($requestedType) { static $fields = NULL; if (!$fields) { // this is needed, as we're piggy-backing importableFields() below @@ -115,7 +115,7 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup { /** * Return the SQL query for dropping the temporary table. */ - function tableDropQuery() { + public function tableDropQuery() { return 'DROP TEMPORARY TABLE IF EXISTS dedupe'; } @@ -123,7 +123,7 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup { * Return a set of SQL queries whose cummulative weights will mark matched * records for the RuleGroup::threasholdQuery() to retrieve. */ - function tableQuery() { + public function tableQuery() { // make sure we've got a fetched dbrecord, not sure if this is enforced if (!$this->name == NULL || $this->is_reserved == NULL) { $this->find(TRUE); @@ -174,7 +174,7 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup { return $queries; } - function fillTable() { + public function fillTable() { // get the list of queries handy $tableQueries = $this->tableQuery(); @@ -274,7 +274,7 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup { * * @return array */ - static function isQuerySetInclusive($tableQueries, $threshold, $exclWeightSum = array()) { + public static function isQuerySetInclusive($tableQueries, $threshold, $exclWeightSum = array()) { $input = array(); foreach ($tableQueries as $key => $query) { $input[] = substr($key, strrpos($key, '.') + 1); @@ -310,7 +310,7 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup { /** * @param $tableQueries */ - static function orderByTableCount(&$tableQueries) { + public static function orderByTableCount(&$tableQueries) { static $tableCount = array(); $tempArray = array(); @@ -340,7 +340,7 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup { * Multi-Site dedupe for public pages. * */ - function thresholdQuery($checkPermission = TRUE) { + public function thresholdQuery($checkPermission = TRUE) { $this->_aclFrom = ''; // CRM-6603: anonymous dupechecks side-step ACLs $this->_aclWhere = ' AND is_deleted = 0 '; @@ -381,7 +381,7 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup { * * @return array (rule field => weight) array and threshold associated to rule group@access public */ - static function dedupeRuleFieldsWeight($params) { + public static function dedupeRuleFieldsWeight($params) { $rgBao = new CRM_Dedupe_BAO_RuleGroup(); $rgBao->contact_type = $params['contact_type']; if (CRM_Utils_Array::value('id', $params)) { @@ -408,7 +408,7 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup { * Get all of the combinations of fields that would work with a rule */ - static function combos($rgFields, $threshold, &$combos, $running = array()) { + public static function combos($rgFields, $threshold, &$combos, $running = array()) { foreach ($rgFields as $rgField => $weight) { unset($rgFields[$rgField]); $diff = $threshold - $weight; @@ -434,7 +434,7 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup { * * @return array id => "nice name" of rule group */ - static function getByType($contactType = NULL) { + public static function getByType($contactType = NULL) { $dao = new CRM_Dedupe_DAO_RuleGroup(); if ($contactType) { diff --git a/CRM/Dedupe/Finder.php b/CRM/Dedupe/Finder.php index 41fca27618..709fb65544 100644 --- a/CRM/Dedupe/Finder.php +++ b/CRM/Dedupe/Finder.php @@ -48,7 +48,7 @@ class CRM_Dedupe_Finder { * * @return array array of (cid1, cid2, weight) dupe triples */ - static function dupes($rgid, $cids = array()) { + public static function dupes($rgid, $cids = array()) { $rgBao = new CRM_Dedupe_BAO_RuleGroup(); $rgBao->id = $rgid; $rgBao->contactIds = $cids; @@ -139,7 +139,7 @@ class CRM_Dedupe_Finder { * * @return array array of (cid1, cid2, weight) dupe triples */ - static function dupesInGroup($rgid, $gid) { + public static function dupesInGroup($rgid, $gid) { $cids = array_keys(CRM_Contact_BAO_Group::getMember($gid)); if ( !empty($cids) ) { return self::dupes($rgid, $cids); @@ -156,7 +156,7 @@ class CRM_Dedupe_Finder { * * @return array array of dupe contact_ids */ - static function dupesOfContact($cid, $used = 'Unsupervised', $ctype = NULL) { + public static function dupesOfContact($cid, $used = 'Unsupervised', $ctype = NULL) { // if not provided, fetch the contact type from the database if (!$ctype) { $dao = new CRM_Contact_DAO_Contact(); @@ -196,7 +196,7 @@ class CRM_Dedupe_Finder { * * @return array valid $params array for dedupe */ - static function formatParams($fields, $ctype) { + public static function formatParams($fields, $ctype) { $flat = array(); CRM_Utils_Array::flatten($fields, $flat); diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index f62096e3f2..466af81634 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -40,7 +40,7 @@ class CRM_Dedupe_Merger { /** * @return array */ - static function relTables() { + public static function relTables() { static $relTables; $config = CRM_Core_Config::singleton(); @@ -158,7 +158,7 @@ class CRM_Dedupe_Merger { /** * Returns the related tables groups for which a contact has any info entered */ - static function getActiveRelTables($cid) { + public static function getActiveRelTables($cid) { $cid = (int) $cid; $groups = array(); @@ -191,7 +191,7 @@ class CRM_Dedupe_Merger { /** * Return tables and their fields referencing civicrm_contact.contact_id explicitly */ - static function cidRefs() { + public static function cidRefs() { static $cidRefs; if (!$cidRefs) { $sql = " @@ -222,7 +222,7 @@ WHERE /** * Return tables and their fields referencing civicrm_contact.contact_id with entity_id */ - static function eidRefs() { + public static function eidRefs() { static $eidRefs; if (!$eidRefs) { // FIXME: this should be generated dynamically from the schema @@ -245,7 +245,7 @@ WHERE /** * Return tables using locations */ - static function locTables() { + public static function locTables() { static $locTables; if (!$locTables) { $locTables = array( 'civicrm_email', 'civicrm_address', 'civicrm_phone' ); @@ -261,7 +261,7 @@ WHERE * @param string $request 'relTables' or 'cidRefs' * @see CRM-13836 */ - static function getMultiValueCustomSets($request) { + public static function getMultiValueCustomSets($request) { static $data = NULL; if ($data === NULL) { $data = array( @@ -290,7 +290,7 @@ WHERE * Tables which require custom processing should declare functions to call here. * Doing so will override normal processing. */ - static function cpTables() { + public static function cpTables() { static $tables; if (!$tables) { $tables = array( @@ -307,7 +307,7 @@ WHERE /** * Return payment related table. */ - static function paymentTables() { + public static function paymentTables() { static $tables; if (!$tables) { $tables = array('civicrm_pledge', 'civicrm_membership', 'civicrm_participant'); @@ -319,7 +319,7 @@ WHERE /** * Return payment update Query. */ - static function paymentSql($tableName, $mainContactId, $otherContactId) { + public static function paymentSql($tableName, $mainContactId, $otherContactId) { $sqls = array(); if (!$tableName || !$mainContactId || !$otherContactId) { return $sqls; @@ -371,7 +371,7 @@ INNER JOIN civicrm_participant participant ON ( participant.id = payment.partic * * @return array */ - static function operationSql($mainId, $otherId, $tableName, $tableOperations = array(), $mode = 'add') { + public static function operationSql($mainId, $otherId, $tableName, $tableOperations = array(), $mode = 'add') { $sqls = array(); if (!$tableName || !$mainId || !$otherId) { return $sqls; @@ -416,7 +416,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * * @static */ - static function moveContactBelongings($mainId, $otherId, $tables = FALSE, $tableOperations = array()) { + public static function moveContactBelongings($mainId, $otherId, $tables = FALSE, $tableOperations = array()) { $cidRefs = self::cidRefs(); $eidRefs = self::eidRefs(); $cpTables = self::cpTables(); @@ -523,7 +523,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * @return array * @static */ - static function findDifferences($main, $other) { + public static function findDifferences($main, $other) { $result = array( 'contact' => array(), 'custom' => array(), @@ -566,7 +566,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * @static * @access public */ - static function batchMerge($rgid, $gid = NULL, $mode = 'safe', $autoFlip = TRUE, $redirectForPerformance = FALSE) { + public static function batchMerge($rgid, $gid = NULL, $mode = 'safe', $autoFlip = TRUE, $redirectForPerformance = FALSE) { $contactType = CRM_Core_DAO::getFieldValue('CRM_Dedupe_DAO_RuleGroup', $rgid, 'contact_type'); $cacheKeyString = "merge {$contactType}"; $cacheKeyString .= $rgid ? "_{$rgid}" : '_0'; @@ -611,7 +611,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * @static * @access public */ - static function merge($dupePairs = array(), $cacheParams = array(), $mode = 'safe', + public static function merge($dupePairs = array(), $cacheParams = array(), $mode = 'safe', $autoFlip = TRUE, $redirectForPerformance = FALSE ) { $cacheKeyString = CRM_Utils_Array::value('cache_key_string', $cacheParams); @@ -698,7 +698,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * @static * @access public */ - static function skipMerge($mainId, $otherId, &$migrationInfo, $mode = 'safe') { + public static function skipMerge($mainId, $otherId, &$migrationInfo, $mode = 'safe') { $conflicts = array(); $migrationData = array( 'old_migration_info' => $migrationInfo, @@ -806,7 +806,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * @static * @access public */ - static function getRowsElementsAndInfo($mainId, $otherId) { + public static function getRowsElementsAndInfo($mainId, $otherId) { $qfZeroBug = 'e8cddb72-a257-11dc-b9cc-0016d3330ee9'; // Fetch contacts @@ -1204,7 +1204,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * @static * @access public */ - static function moveAllBelongings($mainId, $otherId, $migrationInfo) { + public static function moveAllBelongings($mainId, $otherId, $migrationInfo) { if (empty($migrationInfo)) { return FALSE; } @@ -1582,7 +1582,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m /** * @return array of field names which will be compared, so everything except ID. */ - static function getContactFields() { + 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'); @@ -1601,7 +1601,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * * @param contactId */ - static function addMembershipToRealtedContacts($contactID) { + public static function addMembershipToRealtedContacts($contactID) { $dao = new CRM_Member_DAO_Membership(); $dao->contact_id = $contactID; $dao->is_test = 0; diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index 3a0937a2e4..f7a5655863 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -37,7 +37,7 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -51,7 +51,7 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $event = new CRM_Event_DAO_Event(); $event->copyValues($params); if ($event->find(TRUE)) { @@ -70,7 +70,7 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event { * @return Object DAO object on sucess, null otherwise * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Event_DAO_Event', $id, 'is_active', $is_active); } @@ -84,7 +84,7 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event { * * @return object */ - static function add(&$params) { + public static function add(&$params) { CRM_Utils_System::flushCache(); $financialTypeId = NULL; if (!empty($params['id'])) { @@ -183,7 +183,7 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event { * @static * */ - static function del($id) { + public static function del($id) { if (!$id) { return NULL; } @@ -233,7 +233,7 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event { * @access public * @static */ - static function deleteEventLocBlock($locBlockId, $eventId = NULL) { + public static function deleteEventLocBlock($locBlockId, $eventId = NULL) { $query = "SELECT count(ce.id) FROM civicrm_event ce WHERE ce.loc_block_id = $locBlockId"; if ($eventId) { @@ -316,7 +316,7 @@ WHERE ( civicrm_event.is_template IS NULL OR civicrm_event.is_template = 0 )"; * * @return array Array of event summary values */ - static function getEventSummary() { + public static function getEventSummary() { $eventSummary = $eventIds = array(); $config = CRM_Core_Config::singleton(); @@ -643,7 +643,7 @@ $event_summary_limit * @static * @access public */ - static function &getMapInfo(&$id) { + public static function &getMapInfo(&$id) { $sql = " SELECT @@ -898,7 +898,7 @@ WHERE civicrm_event.is_active = 1 * @return void * @access public */ - static function copy($id, $newEvent = NULL, $afterCreate = FALSE) { + public static function copy($id, $newEvent = NULL, $afterCreate = FALSE) { $defaults = $eventValues = array(); @@ -1013,7 +1013,7 @@ WHERE civicrm_event.is_active = 1 * This is sometimes called in a loop (during event search) * hence we cache the values to prevent repeated calls to the db */ - static function isMonetary($id) { + public static function isMonetary($id) { static $isMonetary = array(); if (!array_key_exists($id, $isMonetary)) { $isMonetary[$id] = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', @@ -1028,7 +1028,7 @@ WHERE civicrm_event.is_active = 1 * This is sometimes called in a loop (during event search) * hence we cache the values to prevent repeated calls to the db */ - static function usesPriceSet($id) { + public static function usesPriceSet($id) { static $usesPriceSet = array(); if (!array_key_exists($id, $usesPriceSet)) { $usesPriceSet[$id] = CRM_Price_BAO_PriceSet::getFor('civicrm_event', $id); @@ -1048,7 +1048,7 @@ WHERE civicrm_event.is_active = 1 * @return void * @access public */ - static function sendMail($contactID, &$values, $participantId, $isTest = FALSE, $returnMessageText = FALSE) { + public static function sendMail($contactID, &$values, $participantId, $isTest = FALSE, $returnMessageText = FALSE) { $template = CRM_Core_Smarty::singleton(); $gIds = array( @@ -1426,7 +1426,7 @@ WHERE civicrm_event.is_active = 1 * @access public * @static */ - static function displayProfile(&$params, $gid, &$groupTitle, &$values, &$profileFields = array()) { + public static function displayProfile(&$params, $gid, &$groupTitle, &$values, &$profileFields = array()) { if ($gid) { $config = CRM_Core_Config::singleton(); $session = CRM_Core_Session::singleton(); @@ -1805,7 +1805,7 @@ WHERE id = $cfID /** * @return array */ - static function getLocationEvents() { + public static function getLocationEvents() { $events = array(); $query = " @@ -1830,7 +1830,7 @@ ORDER BY sp.name, ca.city, ca.street_address ASC * * @return int|null|string */ - static function countEventsUsingLocBlockId($locBlockId) { + public static function countEventsUsingLocBlockId($locBlockId) { if (!$locBlockId) { return 0; } @@ -1851,7 +1851,7 @@ WHERE ce.loc_block_id = $locBlockId"; * @param integer $eventID * @return boolean */ - static function validRegistrationRequest($values, $eventID) { + public static function validRegistrationRequest($values, $eventID) { // check that the user has permission to register for this event $hasPermission = CRM_Core_Permission::event(CRM_Core_Permission::EDIT, $eventID, 'register for events' @@ -1865,7 +1865,7 @@ WHERE ce.loc_block_id = $locBlockId"; * * @return bool */ - static function validRegistrationDate(&$values) { + public static function validRegistrationDate(&$values) { // make sure that we are between registration start date and registration end date $startDate = CRM_Utils_Date::unixTime(CRM_Utils_Array::value('registration_start_date', $values)); $endDate = CRM_Utils_Date::unixTime(CRM_Utils_Array::value('registration_end_date', $values)); @@ -1896,7 +1896,7 @@ WHERE ce.loc_block_id = $locBlockId"; * * @return bool */ - static function showHideRegistrationLink($values) { + public static function showHideRegistrationLink($values) { $session = CRM_Core_Session::singleton(); $contactID = $session->get('userID'); @@ -1933,7 +1933,7 @@ WHERE ce.loc_block_id = $locBlockId"; * * @return bool */ - static function checkRegistration($params) { + public static function checkRegistration($params) { $alreadyRegistered = FALSE; if (empty($params['contact_id'])) { return $alreadyRegistered; @@ -1964,7 +1964,7 @@ WHERE ce.loc_block_id = $locBlockId"; * @access public * @static */ - static function checkPermission($eventId = NULL, $type = CRM_Core_Permission::VIEW) { + public static function checkPermission($eventId = NULL, $type = CRM_Core_Permission::VIEW) { static $permissions = NULL; if (empty($permissions)) { @@ -2028,7 +2028,7 @@ WHERE ce.loc_block_id = $locBlockId"; * @access public * @static */ - static function getFromEmailIds($eventId = NULL) { + public static function getFromEmailIds($eventId = NULL) { $fromEmailValues['from_email_id'] = CRM_Core_BAO_Email::getFromEmail(); if ($eventId) { @@ -2062,7 +2062,7 @@ WHERE ce.loc_block_id = $locBlockId"; * @access public * @static */ - static function eventTotalSeats($eventId, $extraWhereClause = NULL) { + public static function eventTotalSeats($eventId, $extraWhereClause = NULL) { if (empty($eventId)) { return 0; } @@ -2106,7 +2106,7 @@ LEFT JOIN civicrm_price_field_value value ON ( value.id = lineItem.price_field * * @return array of custom data defaults. */ - static function getTemplateDefaultValues($templateId) { + public static function getTemplateDefaultValues($templateId) { $defaults = array(); if (!$templateId) { return $defaults; @@ -2132,7 +2132,7 @@ LEFT JOIN civicrm_price_field_value value ON ( value.id = lineItem.price_field * * @return object */ - static function get_sub_events($event_id) { + public static function get_sub_events($event_id) { $params = array('parent_event_id' => $event_id); $defaults = array(); return CRM_Event_BAO_Event::retrieve($params, $defaults); @@ -2144,7 +2144,7 @@ LEFT JOIN civicrm_price_field_value value ON ( value.id = lineItem.price_field * @param int $eventID event id. * @param int $eventCampaignID campaign id of that event */ - static function updateParticipantCampaignID($eventID, $eventCampaignID) { + public static function updateParticipantCampaignID($eventID, $eventCampaignID) { $params = array(); $params[1] = array($eventID, 'Integer'); diff --git a/CRM/Event/BAO/Participant.php b/CRM/Event/BAO/Participant.php index 3e5d54d280..e32319db20 100644 --- a/CRM/Event/BAO/Participant.php +++ b/CRM/Event/BAO/Participant.php @@ -70,7 +70,7 @@ class CRM_Event_BAO_Participant extends CRM_Event_DAO_Participant { /** * */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -87,7 +87,7 @@ class CRM_Event_BAO_Participant extends CRM_Event_DAO_Participant { * @access public * @static */ - static function &add(&$params) { + public static function &add(&$params) { if (!empty($params['id'])) { CRM_Utils_Hook::pre('edit', 'Participant', $params['id'], $params); @@ -167,7 +167,7 @@ class CRM_Event_BAO_Participant extends CRM_Event_DAO_Participant { * @access public * @static */ - static function getValues(&$params, &$values, &$ids) { + public static function getValues(&$params, &$values, &$ids) { if (empty($params)) { return NULL; } @@ -192,7 +192,7 @@ class CRM_Event_BAO_Participant extends CRM_Event_DAO_Participant { * @access public * @static */ - static function create(&$params) { + public static function create(&$params) { $transaction = new CRM_Core_Transaction(); $status = NULL; @@ -570,7 +570,7 @@ INNER JOIN civicrm_price_field field ON ( value.price_field_id = field.id * @static * @access public */ - static function pendingToConfirmSpaces($eventId) { + public static function pendingToConfirmSpaces($eventId) { $emptySeats = 0; if (!$eventId) { return $emptySeats; @@ -620,7 +620,7 @@ GROUP BY participant.event_id * @access public * @static */ - static function &importableFields($contactType = 'Individual', $status = TRUE, $onlyParticipant = FALSE) { + public static function &importableFields($contactType = 'Individual', $status = TRUE, $onlyParticipant = FALSE) { if (!self::$_importableFields) { if (!$onlyParticipant) { if (!$status) { @@ -729,7 +729,7 @@ GROUP BY participant.event_id * @access public * @static */ - static function &exportableFields() { + public static function &exportableFields() { if (!self::$_exportableFields) { if (!self::$_exportableFields) { self::$_exportableFields = array(); @@ -785,7 +785,7 @@ GROUP BY participant.event_id * @static * @access public */ - static function participantDetails($participantId) { + public static function participantDetails($participantId) { $query = " SELECT civicrm_contact.sort_name as name, civicrm_event.title as title, civicrm_contact.id as cid FROM civicrm_participant @@ -815,7 +815,7 @@ WHERE civicrm_participant.id = {$participantId} * @access public * @static */ - static function resolveDefaults(&$defaults, $reverse = FALSE) { + public static function resolveDefaults(&$defaults, $reverse = FALSE) { self::lookupValue($defaults, 'event', CRM_Event_PseudoConstant::event(), $reverse); self::lookupValue($defaults, 'status', CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label'), $reverse); self::lookupValue($defaults, 'role', CRM_Event_PseudoConstant::participantRole(), $reverse); @@ -829,7 +829,7 @@ WHERE civicrm_participant.id = {$participantId} * the api needs the name => value conversion, also the view layer typically * requires value => name conversion */ - static function lookupValue(&$defaults, $property, $lookup, $reverse) { + public static function lookupValue(&$defaults, $property, $lookup, $reverse) { $id = $property . '_id'; $src = $reverse ? $property : $id; @@ -859,7 +859,7 @@ WHERE civicrm_participant.id = {$participantId} * @access public * @static */ - static function deleteParticipant($id) { + public static function deleteParticipant($id) { CRM_Utils_Hook::pre('delete', 'Participant', $id, CRM_Core_DAO::$_nullArray); $transaction = new CRM_Core_Transaction(); @@ -922,7 +922,7 @@ WHERE civicrm_participant.id = {$participantId} * @access public * @static */ - static function checkDuplicate($input, &$duplicates) { + public static function checkDuplicate($input, &$duplicates) { $eventId = CRM_Utils_Array::value('event_id', $input); $contactId = CRM_Utils_Array::value('contact_id', $input); @@ -968,7 +968,7 @@ WHERE civicrm_participant.id = {$participantId} * * @return void */ - static function fixEventLevel(&$eventLevel) { + public static function fixEventLevel(&$eventLevel) { if ((substr($eventLevel, 0, 1) == CRM_Core_DAO::VALUE_SEPARATOR) && (substr($eventLevel, -1, 1) == CRM_Core_DAO::VALUE_SEPARATOR) ) { @@ -1001,7 +1001,7 @@ WHERE civicrm_participant.id = {$participantId} * @return array $additionalParticipantIds * @static */ - static function getAdditionalParticipantIds($primaryParticipantId, $excludeCancel = TRUE, $oldStatusId = NULL) { + public static function getAdditionalParticipantIds($primaryParticipantId, $excludeCancel = TRUE, $oldStatusId = NULL) { $additionalParticipantIds = array(); if (!$primaryParticipantId) { return $additionalParticipantIds; @@ -1041,7 +1041,7 @@ WHERE civicrm_participant.id = {$participantId} * @return array $feeDetails * @static */ - function getFeeDetails($participantIds, $hasLineItems = FALSE) { + public function getFeeDetails($participantIds, $hasLineItems = FALSE) { $feeDetails = array(); if (!is_array($participantIds) || empty($participantIds)) { return $feeDetails; @@ -1105,7 +1105,7 @@ INNER JOIN civicrm_price_field_value value ON ( value.id = lineItem.price_field_ * @return array $additionalParticipants $displayName => $viewUrl * @static */ - static function getAdditionalParticipants($primaryParticipantID) { + public static function getAdditionalParticipants($primaryParticipantID) { $additionalParticipantIDs = array(); $additionalParticipantIDs = self::getAdditionalParticipantIds($primaryParticipantID); if (!empty($additionalParticipantIDs)) { @@ -1137,7 +1137,7 @@ INNER JOIN civicrm_price_field_value value ON ( value.id = lineItem.price_field_ * @access public * @static */ - static function updateParticipantStatus($participantID, $oldStatusID, $newStatusID = NULL, $updatePrimaryStatus = FALSE) { + public static function updateParticipantStatus($participantID, $oldStatusID, $newStatusID = NULL, $updatePrimaryStatus = FALSE) { if (!$participantID || !$oldStatusID) { return; } @@ -1173,7 +1173,7 @@ INNER JOIN civicrm_price_field_value value ON ( value.id = lineItem.price_field_ * @access public * @static */ - static function updateStatus($participantIds, $statusId, $updateRegisterDate = FALSE) { + public static function updateStatus($participantIds, $statusId, $updateRegisterDate = FALSE) { if (!is_array($participantIds) || empty($participantIds) || !$statusId) { return; } @@ -1548,7 +1548,7 @@ UPDATE civicrm_participant * @return string * @access public */ - function updateStatusMessage($participantId, $statusChangeTo, $fromStatusId) { + public function updateStatusMessage($participantId, $statusChangeTo, $fromStatusId) { $statusMsg = NULL; $results = self::transitionParticipants(array($participantId), $statusChangeTo, $fromStatusId, TRUE @@ -1585,7 +1585,7 @@ UPDATE civicrm_participant * @return string * @access public */ - static function eventFullMessage($eventId, $participantId = NULL) { + public static function eventFullMessage($eventId, $participantId = NULL) { $eventfullMsg = $dbStatusId = NULL; $checkEventFull = TRUE; if ($participantId) { @@ -1646,7 +1646,7 @@ UPDATE civicrm_participant * @return true if participant is primary * @access public */ - static function isPrimaryParticipant($participantId) { + public static function isPrimaryParticipant($participantId) { $participant = new CRM_Event_DAO_Participant(); $participant->registered_by_id = $participantId; @@ -1667,7 +1667,7 @@ UPDATE civicrm_participant * @return true if allowed * @access public */ - static function getValidAdditionalIds($participantId, $oldStatusId, $newStatusId) { + public static function getValidAdditionalIds($participantId, $oldStatusId, $newStatusId) { $additionalParticipantIds = array(); @@ -1695,7 +1695,7 @@ UPDATE civicrm_participant * @access public * @static */ - static function getContactParticipantCount($contactID) { + public static function getContactParticipantCount($contactID) { $query = "SELECT count(*) FROM civicrm_participant WHERE civicrm_participant.contact_id = {$contactID} AND @@ -1713,7 +1713,7 @@ WHERE civicrm_participant.contact_id = {$contactID} AND * @access public * @static */ - static function getParticipantIds($contributionId, $excludeCancelled = FALSE) { + public static function getParticipantIds($contributionId, $excludeCancelled = FALSE) { $ids = array(); if (!$contributionId) { @@ -1744,7 +1744,7 @@ WHERE civicrm_participant.contact_id = {$contactID} AND * @access public * @static */ - static function getAdditionalParticipantUrl($participantIds) { + public static function getAdditionalParticipantUrl($participantIds) { foreach ($participantIds as $value) { $links = array(); $details = self::participantDetails($value); @@ -1770,7 +1770,7 @@ WHERE civicrm_participant.contact_id = {$contactID} AND * * @static */ - static function createDiscountTrxn($eventID, $contributionParams, $feeLevel) { + public static function createDiscountTrxn($eventID, $contributionParams, $feeLevel) { // CRM-11124 $checkDiscount = CRM_Core_BAO_Discount::findSet($eventID,'civicrm_event'); if (!empty($checkDiscount)) { @@ -1807,7 +1807,7 @@ WHERE cpf.price_set_id = %1 AND cpfv.label LIKE %2"; * @access public * @static */ - static function deleteContactParticipant($contactId) { + public static function deleteContactParticipant($contactId) { $participant = new CRM_Event_DAO_Participant(); $participant->contact_id = $contactId; $participant->find(); @@ -1825,7 +1825,7 @@ WHERE cpf.price_set_id = %1 AND cpfv.label LIKE %2"; * @param $paidAmount * @param int $priceSetId */ - static function changeFeeSelections($params, $participantId, $contributionId, $feeBlock, $lineItems, $paidAmount, $priceSetId) { + public static function changeFeeSelections($params, $participantId, $contributionId, $feeBlock, $lineItems, $paidAmount, $priceSetId) { $contributionStatuses = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); $partiallyPaidStatusId = array_search('Partially paid', $contributionStatuses); $pendingRefundStatusId = array_search('Pending refund', $contributionStatuses); @@ -2028,7 +2028,7 @@ WHERE (li.entity_table = 'civicrm_participant' AND li.entity_id = {$participantI * @param $paidAmount * @param int $contributionId */ - static function recordAdjustedAmt($updatedAmount, $paidAmount, $contributionId, $taxAmount = NULL) { + public static function recordAdjustedAmt($updatedAmount, $paidAmount, $contributionId, $taxAmount = NULL) { $balanceAmt = $updatedAmount - $paidAmount; $contributionStatuses = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); $partiallyPaidStatusId = array_search('Partially paid', $contributionStatuses); @@ -2095,7 +2095,7 @@ WHERE (li.entity_table = 'civicrm_participant' AND li.entity_id = {$participantI * * @throws CRM_Core_Exception */ - static function addActivityForSelection($participantId, $activityType) { + public static function addActivityForSelection($participantId, $activityType) { $eventId = CRM_Core_DAO::getFieldValue('CRM_Event_BAO_Participant', $participantId, 'event_id'); $contactId = CRM_Core_DAO::getFieldValue('CRM_Event_BAO_Participant', $participantId, 'contact_id'); diff --git a/CRM/Event/BAO/ParticipantPayment.php b/CRM/Event/BAO/ParticipantPayment.php index 81b546183a..394e4ef63f 100644 --- a/CRM/Event/BAO/ParticipantPayment.php +++ b/CRM/Event/BAO/ParticipantPayment.php @@ -44,7 +44,7 @@ class CRM_Event_BAO_ParticipantPayment extends CRM_Event_DAO_ParticipantPayment * @return object the partcipant payment record * @static */ - static function create(&$params, &$ids) { + public static function create(&$params, &$ids) { if (isset($ids['id'])) { CRM_Utils_Hook::pre('edit', 'ParticipantPayment', $ids['id'], $params); } @@ -92,7 +92,7 @@ class CRM_Event_BAO_ParticipantPayment extends CRM_Event_DAO_ParticipantPayment * @static * @access public */ - static function deleteParticipantPayment($params) { + public static function deleteParticipantPayment($params) { $participantPayment = new CRM_Event_DAO_ParticipantPayment(); $valid = FALSE; diff --git a/CRM/Event/BAO/ParticipantStatusType.php b/CRM/Event/BAO/ParticipantStatusType.php index 9c2bc53a98..5132e1fa6b 100644 --- a/CRM/Event/BAO/ParticipantStatusType.php +++ b/CRM/Event/BAO/ParticipantStatusType.php @@ -38,7 +38,7 @@ class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatu * * @return $this|null */ - static function add(&$params) { + public static function add(&$params) { if (empty($params)) { return NULL; } @@ -52,7 +52,7 @@ class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatu * * @return $this|null */ - static function &create(&$params) { + public static function &create(&$params) { $transaction = new CRM_Core_Transaction(); $statusType = self::add($params); if (is_a($statusType, 'CRM_Core_Error')) { @@ -68,7 +68,7 @@ class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatu * * @return bool */ - static function deleteParticipantStatusType($id) { + public static function deleteParticipantStatusType($id) { // return early if there are participants with this status $participant = new CRM_Event_DAO_Participant; $participant->status_id = $id; @@ -91,7 +91,7 @@ class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatu * * @return CRM_Event_DAO_ParticipantStatusType|null */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $result = NULL; $dao = new CRM_Event_DAO_ParticipantStatusType; @@ -110,7 +110,7 @@ class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatu * * @return bool */ - static function setIsActive($id, $isActive) { + public static function setIsActive($id, $isActive) { return CRM_Core_DAO::setFieldValue('CRM_Event_BAO_ParticipantStatusType', $id, 'is_active', $isActive); } diff --git a/CRM/Event/BAO/Query.php b/CRM/Event/BAO/Query.php index 0daddeb87c..ad0ab1c10b 100644 --- a/CRM/Event/BAO/Query.php +++ b/CRM/Event/BAO/Query.php @@ -38,7 +38,7 @@ class CRM_Event_BAO_Query { /** * @return array */ - static function &getFields() { + public static function &getFields() { $fields = array(); $fields = array_merge($fields, CRM_Event_DAO_Event::import()); $fields = array_merge($fields, self::getParticipantFields()); @@ -50,7 +50,7 @@ class CRM_Event_BAO_Query { /** * @return array */ - static function &getParticipantFields() { + public static function &getParticipantFields() { $fields = CRM_Event_BAO_Participant::importableFields('Individual', TRUE, TRUE); return $fields; } @@ -63,7 +63,7 @@ class CRM_Event_BAO_Query { * @return void * @access public */ - static function select(&$query) { + public static function select(&$query) { if (($query->_mode & CRM_Contact_BAO_Query::MODE_EVENT) || CRM_Contact_BAO_Query::componentPresent($query->_returnProperties, 'participant_') ) { @@ -211,7 +211,7 @@ class CRM_Event_BAO_Query { /** * @param $query */ - static function where(&$query) { + public static function where(&$query) { $grouping = NULL; foreach (array_keys($query->_params) as $id) { if (empty($query->_params[$id][0])) { @@ -233,7 +233,7 @@ class CRM_Event_BAO_Query { * @param $values * @param $query */ - static function whereClauseSingle(&$values, &$query) { + public static function whereClauseSingle(&$values, &$query) { list($name, $op, $value, $grouping, $wildcard) = $values; switch ($name) { case 'event_start_date_low': @@ -506,7 +506,7 @@ class CRM_Event_BAO_Query { * * @return null|string */ - static function from($name, $mode, $side) { + public static function from($name, $mode, $side) { $from = NULL; switch ($name) { case 'civicrm_participant': @@ -551,7 +551,7 @@ class CRM_Event_BAO_Query { * @return string * @access public */ - function qill() { + public function qill() { return (isset($this->_qill)) ? $this->_qill : ""; } @@ -609,7 +609,7 @@ class CRM_Event_BAO_Query { /** * @param CRM_Core_Form $form */ - static function buildSearchForm(&$form) { + public static function buildSearchForm(&$form) { $dataURLEventFee = CRM_Utils_System::url('civicrm/ajax/eventFee', "reset=1", FALSE, NULL, FALSE @@ -681,12 +681,12 @@ class CRM_Event_BAO_Query { * @param $row * @param int $id */ - static function searchAction(&$row, $id) {} + public static function searchAction(&$row, $id) {} /** * @param $tables */ - static function tableNames(&$tables) { + public static function tableNames(&$tables) { //add participant table if (!empty($tables['civicrm_event'])) { $tables = array_merge(array('civicrm_participant' => 1), $tables); diff --git a/CRM/Event/Badge.php b/CRM/Event/Badge.php index 487c636248..45c2507476 100644 --- a/CRM/Event/Badge.php +++ b/CRM/Event/Badge.php @@ -46,7 +46,7 @@ class CRM_Event_Badge { /** * */ - function __construct() { + 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->imgExtension = 'png'; @@ -58,7 +58,7 @@ class CRM_Event_Badge { /** * @param bool $debug */ - function setDebug($debug = TRUE) { + public function setDebug($debug = TRUE) { if (!$debug) { $this->debug = FALSE; $this->border = 0; @@ -107,7 +107,7 @@ class CRM_Event_Badge { * * @return string */ - function getImageFileName($eventID, $img = FALSE) { + public function getImageFileName($eventID, $img = FALSE) { global $civicrm_root; $path = "CRM/Event/Badge"; if ($img == FALSE) { @@ -139,7 +139,7 @@ class CRM_Event_Badge { /** * @param bool $img */ - function printBackground($img = FALSE) { + public function printBackground($img = FALSE) { $x = $this->pdf->GetAbsX(); $y = $this->pdf->GetY(); if ($this->debug) { @@ -168,7 +168,7 @@ class CRM_Event_Badge { $this->pdf->MultiCell($this->pdf->width, $this->pdf->lineHeight, $txt); } - function pdfExtraFormat() {} + public function pdfExtraFormat() {} /** * Create labels (pdf) @@ -178,7 +178,7 @@ class CRM_Event_Badge { * @return null * @access public */ - function createLabels(&$participants) { + public function createLabels(&$participants) { $this->pdf = new CRM_Utils_PDF_Label($this->format, 'mm'); $this->pdfExtraFormat(); diff --git a/CRM/Event/Badge/Logo.php b/CRM/Event/Badge/Logo.php index 92e6bd12b5..29843557e3 100644 --- a/CRM/Event/Badge/Logo.php +++ b/CRM/Event/Badge/Logo.php @@ -7,7 +7,7 @@ class CRM_Event_Badge_Logo extends CRM_Event_Badge { /** * */ - function __construct() { + public function __construct() { parent::__construct(); // A4 $pw = 210; diff --git a/CRM/Event/Badge/Logo5395.php b/CRM/Event/Badge/Logo5395.php index 6d7352edf0..e75cf24257 100644 --- a/CRM/Event/Badge/Logo5395.php +++ b/CRM/Event/Badge/Logo5395.php @@ -7,7 +7,7 @@ class CRM_Event_Badge_Logo5395 extends CRM_Event_Badge { /** * */ - function __construct() { + public function __construct() { parent::__construct(); // A4 $pw = 210; diff --git a/CRM/Event/Badge/NameTent.php b/CRM/Event/Badge/NameTent.php index 7982746051..0f409162f7 100644 --- a/CRM/Event/Badge/NameTent.php +++ b/CRM/Event/Badge/NameTent.php @@ -41,7 +41,7 @@ class CRM_Event_Badge_NameTent extends CRM_Event_Badge { /** * */ - function __construct() { + public function __construct() { parent::__construct(); // A4 $pw = 297; @@ -58,7 +58,7 @@ class CRM_Event_Badge_NameTent extends CRM_Event_Badge { // $this->setDebug (); } - function pdfExtraFormat() { + public function pdfExtraFormat() { $this->pdf->setPageFormat('A4', 'L'); } diff --git a/CRM/Event/Cart/BAO/Cart.php b/CRM/Event/Cart/BAO/Cart.php index 4e75e7e39b..97aed8c094 100644 --- a/CRM/Event/Cart/BAO/Cart.php +++ b/CRM/Event/Cart/BAO/Cart.php @@ -46,7 +46,7 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart { /** * @param $participant */ - function add_participant_to_cart($participant) { + public function add_participant_to_cart($participant) { $event_in_cart = $this->get_event_in_cart_by_event_id($participant->event_id); if (!$event_in_cart) { $event_in_cart = $this->add_event($participant->event_id); @@ -198,7 +198,7 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart { * * @return int */ - static function compare_event_dates($event_in_cart_1, $event_in_cart_2) { + public static function compare_event_dates($event_in_cart_1, $event_in_cart_2) { $date_1 = CRM_Utils_Date::unixTime($event_in_cart_1->event->start_date); $date_2 = CRM_Utils_Date::unixTime($event_in_cart_2->event->start_date); @@ -299,7 +299,7 @@ class CRM_Event_Cart_BAO_Cart extends CRM_Event_Cart_DAO_Cart { * * @return int */ - function get_participant_index_from_id($participant_id) { + public function get_participant_index_from_id($participant_id) { foreach ($this->events_in_carts as $event_in_cart) { $index = 0; foreach ($event_in_cart->participants as $participant) { diff --git a/CRM/Event/Cart/BAO/Conference.php b/CRM/Event/Cart/BAO/Conference.php index f2e23f4927..c07bb5f0c6 100644 --- a/CRM/Event/Cart/BAO/Conference.php +++ b/CRM/Event/Cart/BAO/Conference.php @@ -11,7 +11,7 @@ class CRM_Event_Cart_BAO_Conference { * * @return array|null */ - static function get_participant_sessions($main_event_participant_id) { + public static function get_participant_sessions($main_event_participant_id) { $sql = <<load_associations(); $contacts_to_delete = array(); foreach ($this->participants as $participant) { @@ -156,7 +156,7 @@ class CRM_Event_Cart_BAO_EventInCart extends CRM_Event_Cart_DAO_EventInCart impl * * @return mixed */ - static function part_key($participant) { + public static function part_key($participant) { return $participant->id; } @@ -279,7 +279,7 @@ class CRM_Event_Cart_BAO_EventInCart extends CRM_Event_Cart_DAO_EventInCart impl * * @return array */ - static function get_registration_link($event_id) { + public static function get_registration_link($event_id) { $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($event_id); @@ -303,7 +303,7 @@ class CRM_Event_Cart_BAO_EventInCart extends CRM_Event_Cart_DAO_EventInCart impl /** * @return bool */ - function is_parent_event() { + public function is_parent_event() { return (NULL !== (CRM_Event_BAO_Event::get_sub_events($this->event_id))); } @@ -312,7 +312,7 @@ class CRM_Event_Cart_BAO_EventInCart extends CRM_Event_Cart_DAO_EventInCart impl * * @return bool */ - function is_child_event($parent_event_id = NULL) { + public function is_child_event($parent_event_id = NULL) { if ($parent_event_id == NULL) { return $this->event->parent_event_id; } diff --git a/CRM/Event/Cart/BAO/MerParticipant.php b/CRM/Event/Cart/BAO/MerParticipant.php index 5277c69a1e..9541492f16 100644 --- a/CRM/Event/Cart/BAO/MerParticipant.php +++ b/CRM/Event/Cart/BAO/MerParticipant.php @@ -37,7 +37,7 @@ class CRM_Event_Cart_BAO_MerParticipant extends CRM_Event_BAO_Participant { /** * @param null $participant */ - function __construct($participant = NULL) { + public function __construct($participant = NULL) { parent::__construct(); $a = (array)$participant; $this->copyValues($a); @@ -51,7 +51,7 @@ class CRM_Event_Cart_BAO_MerParticipant extends CRM_Event_BAO_Participant { * @return CRM_Event_Cart_BAO_MerParticipant * @throws Exception */ - static function create(&$params) { + public static function create(&$params) { $participantParams = array( 'id' => CRM_Utils_Array::value('id', $params), 'role_id' => self::get_attendee_role_id(), @@ -78,7 +78,7 @@ class CRM_Event_Cart_BAO_MerParticipant extends CRM_Event_BAO_Participant { /** * @return mixed */ - static function get_attendee_role_id() { + public static function get_attendee_role_id() { $roles = CRM_Event_PseudoConstant::participantRole(NULL, "v.label='Attendee'"); $role_names = array_keys($roles); return end($role_names); @@ -87,7 +87,7 @@ class CRM_Event_Cart_BAO_MerParticipant extends CRM_Event_BAO_Participant { /** * @return mixed */ - static function get_pending_in_cart_status_id() { + public static function get_pending_in_cart_status_id() { $status_types = CRM_Event_PseudoConstant::participantStatus(NULL, "name='Pending in cart'"); $status_names = array_keys($status_types); return end($status_names); @@ -145,7 +145,7 @@ class CRM_Event_Cart_BAO_MerParticipant extends CRM_Event_BAO_Participant { return array_pop($results); } - function load_associations() { + public function load_associations() { $contact_details = CRM_Contact_BAO_Contact::getContactDetails($this->contact_id); $this->email = $contact_details[1]; } @@ -153,7 +153,7 @@ class CRM_Event_Cart_BAO_MerParticipant extends CRM_Event_BAO_Participant { /** * @return int */ - function get_participant_index() { + public function get_participant_index() { if (!$this->cart) { $this->cart = CRM_Event_Cart_BAO_Cart::find_by_id($this->cart_id); $this->cart->load_associations(); @@ -167,7 +167,7 @@ class CRM_Event_Cart_BAO_MerParticipant extends CRM_Event_BAO_Participant { * * @return null */ - static function billing_address_from_contact($contact) { + public static function billing_address_from_contact($contact) { foreach ($contact->address as $loc) { if ($loc['is_billing']) { return $loc; @@ -184,7 +184,7 @@ class CRM_Event_Cart_BAO_MerParticipant extends CRM_Event_BAO_Participant { /** * @return CRM_Event_Cart_Form_MerParticipant */ - function get_form() { + public function get_form() { return new CRM_Event_Cart_Form_MerParticipant($this); } } diff --git a/CRM/Event/Cart/Controller/Checkout.php b/CRM/Event/Cart/Controller/Checkout.php index fe861bbab7..28d9b22307 100644 --- a/CRM/Event/Cart/Controller/Checkout.php +++ b/CRM/Event/Cart/Controller/Checkout.php @@ -9,7 +9,7 @@ class CRM_Event_Cart_Controller_Checkout extends CRM_Core_Controller { * @param bool|int $action * @param bool $modal */ - function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { + public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { parent::__construct($title, $modal); diff --git a/CRM/Event/Cart/Form/Cart.php b/CRM/Event/Cart/Form/Cart.php index 831a45f8ec..10adac14e6 100644 --- a/CRM/Event/Cart/Form/Cart.php +++ b/CRM/Event/Cart/Form/Cart.php @@ -33,7 +33,7 @@ class CRM_Event_Cart_Form_Cart extends CRM_Core_Form { } } - function loadCart() { + public function loadCart() { if ($this->event_cart_id == NULL) { $this->cart = CRM_Event_Cart_BAO_Cart::find_or_create_for_current_session(); } @@ -44,7 +44,7 @@ class CRM_Event_Cart_Form_Cart extends CRM_Core_Form { $this->stub_out_and_inherit(); } - function stub_out_and_inherit() { + public function stub_out_and_inherit() { $transaction = new CRM_Core_Transaction(); foreach ($this->cart->get_main_events_in_carts() as $event_in_cart) { @@ -63,7 +63,7 @@ class CRM_Event_Cart_Form_Cart extends CRM_Core_Form { $transaction->commit(); } - function checkWaitingList() { + public function checkWaitingList() { foreach ($this->cart->events_in_carts as $event_in_cart) { $empty_seats = $this->checkEventCapacity($event_in_cart->event_id); if ($empty_seats === NULL) { @@ -81,7 +81,7 @@ class CRM_Event_Cart_Form_Cart extends CRM_Core_Form { * * @return bool|int|null|string */ - function checkEventCapacity($event_id) { + public function checkEventCapacity($event_id) { $empty_seats = CRM_Event_BAO_Participant::eventFull($event_id, TRUE); if (is_numeric($empty_seats)) { return $empty_seats; @@ -97,7 +97,7 @@ class CRM_Event_Cart_Form_Cart extends CRM_Core_Form { /** * @return bool */ - static function is_administrator() { + public static function is_administrator() { global $user; return CRM_Core_Permission::check('administer CiviCRM'); } @@ -105,7 +105,7 @@ class CRM_Event_Cart_Form_Cart extends CRM_Core_Form { /** * @return mixed */ - function getContactID() { + public function getContactID() { //XXX when do we query 'cid' ? $tempID = CRM_Utils_Request::retrieve('cid', 'Positive', $this); @@ -129,7 +129,7 @@ class CRM_Event_Cart_Form_Cart extends CRM_Core_Form { * * @return mixed|null */ - static function find_contact($fields) { + public static function find_contact($fields) { $dedupe_params = CRM_Dedupe_Finder::formatParams($fields, 'Individual'); $dedupe_params['check_permission'] = FALSE; $ids = CRM_Dedupe_Finder::dupesByParams($dedupe_params, 'Individual'); @@ -145,7 +145,7 @@ class CRM_Event_Cart_Form_Cart extends CRM_Core_Form { * * @return int|mixed|null */ - static function find_or_create_contact($registeringContactID = NULL, $fields = array()) { + public static function find_or_create_contact($registeringContactID = NULL, $fields = array()) { $contact_id = self::find_contact($fields); if ($contact_id) { @@ -170,7 +170,7 @@ class CRM_Event_Cart_Form_Cart extends CRM_Core_Form { * * @return mixed */ - function getValuesForPage($page_name) { + public function getValuesForPage($page_name) { $container = $this->controller->container(); return $container['values'][$page_name]; } diff --git a/CRM/Event/Cart/Form/Checkout/ConferenceEvents.php b/CRM/Event/Cart/Form/Checkout/ConferenceEvents.php index c165c99a9d..6355a3cb8a 100644 --- a/CRM/Event/Cart/Form/Checkout/ConferenceEvents.php +++ b/CRM/Event/Cart/Form/Checkout/ConferenceEvents.php @@ -9,7 +9,7 @@ class CRM_Event_Cart_Form_Checkout_ConferenceEvents extends CRM_Event_Cart_Form_ public $main_participant = NULL; public $contact_id = NULL; - function preProcess() { + public function preProcess() { parent::preProcess(); $matches = array(); preg_match("/.*_(\d+)_(\d+)/", $this->getAttribute('name'), $matches); @@ -49,7 +49,7 @@ EOS; } } - function buildQuickForm() { + public function buildQuickForm() { //drupal_add_css(drupal_get_path('module', 'jquery_ui') . '/jquery.ui/themes/base/jquery-ui.css'); //variable_set('jquery_update_compression_type', 'none'); //jquery_ui_add('ui.dialog'); @@ -110,7 +110,7 @@ EOS; $this->addButtons($buttons); } - function postProcess() { + public function postProcess() { $params = $this->controller->exportValues($this->_name); $main_event_in_cart = $this->cart->get_event_in_cart_by_event_id($this->conference_event->id); diff --git a/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php b/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php index 79530170b8..d9ebdbece4 100644 --- a/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php +++ b/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php @@ -7,7 +7,7 @@ class CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices extends CRM_Event_Cart_ public $price_fields_for_event; public $_values = NULL; - function preProcess() { + public function preProcess() { parent::preProcess(); $this->cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this); @@ -17,7 +17,7 @@ class CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices extends CRM_Event_Cart_ } } - function buildQuickForm() { + public function buildQuickForm() { $this->price_fields_for_event = array(); foreach ($this->cart->get_main_event_participants() as $participant) { $form = new CRM_Event_Cart_Form_MerParticipant($participant); @@ -55,7 +55,7 @@ class CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices extends CRM_Event_Cart_ * * @return null */ - static function primary_email_from_contact($contact) { + public static function primary_email_from_contact($contact) { foreach ($contact->email as $email) { if ($email['is_primary']) { return $email['email']; @@ -70,7 +70,7 @@ class CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices extends CRM_Event_Cart_ * * @return array */ - function build_price_options($event) { + public function build_price_options($event) { $price_fields_for_event = array(); $base_field_name = "event_{$event->id}_amount"; $price_set_id = CRM_Price_BAO_PriceSet::getFor('civicrm_event', $event->id); @@ -91,7 +91,7 @@ class CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices extends CRM_Event_Cart_ /** * @return bool */ - function validate() { + public function validate() { parent::validate(); if ($this->_errors) { return FALSE; @@ -184,7 +184,7 @@ class CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices extends CRM_Event_Cart_ return $defaults; } - function postProcess() { + public function postProcess() { if (!array_key_exists('event', $this->_submitValues)) { return; } diff --git a/CRM/Event/Cart/Form/Checkout/Payment.php b/CRM/Event/Cart/Form/Checkout/Payment.php index 6767bce06b..4302eccbe2 100644 --- a/CRM/Event/Cart/Form/Checkout/Payment.php +++ b/CRM/Event/Cart/Form/Checkout/Payment.php @@ -24,7 +24,7 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { * * @return mixed */ - function registerParticipant($params, &$participant, $event) { + public function registerParticipant($params, &$participant, $event) { $transaction = new CRM_Core_Transaction(); // handle register date CRM-4320 @@ -128,7 +128,7 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { return $participant; } - function buildPaymentFields() { + public function buildPaymentFields() { $payment_processor_id = NULL; $can_pay_later = TRUE; $pay_later_text = ""; @@ -173,7 +173,7 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { } } - function buildQuickForm() { + public function buildQuickForm() { $this->line_items = array(); $this->sub_total = 0; @@ -238,7 +238,7 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { * @param $event_in_cart * @param null $class */ - function process_event_line_item(&$event_in_cart, $class = NULL) { + public function process_event_line_item(&$event_in_cart, $class = NULL) { $cost = 0; $price_set_id = CRM_Price_BAO_PriceSet::getFor("civicrm_event", $event_in_cart->event_id); $amount_level = NULL; @@ -272,7 +272,7 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { * @param $event_in_cart * @param null $class */ - function add_line_item($event_in_cart, $class = NULL) { + public function add_line_item($event_in_cart, $class = NULL) { $amount = 0; $cost = 0; $not_waiting_participants = array(); @@ -306,7 +306,7 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { /** * @return mixed */ - function getDefaultFrom() { + public function getDefaultFrom() { $values = CRM_Core_OptionGroup::values('from_email_address'); return $values[1]; } @@ -315,7 +315,7 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { * @param $events_in_cart * @param array $params */ - function emailReceipt($events_in_cart, $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(); $state_province->id = $params["billing_state_province_id-{$this->_bltID}"]; @@ -388,7 +388,7 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { * * @return array|bool */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); if ($self->payment_required && empty($self->_submitValues['is_pay_later'])) { @@ -409,7 +409,7 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { /** * @return bool */ - function validate() { + public function validate() { if ($this->is_pay_later) { $this->_fields['credit_card_number']['is_required'] = FALSE; $this->_fields['cvv2']['is_required'] = FALSE; @@ -419,14 +419,14 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { return parent::validate(); } - function preProcess() { + public function preProcess() { $params = $this->_submitValues; $this->is_pay_later = CRM_Utils_Array::value('is_pay_later', $params, FALSE) && !CRM_Utils_Array::value('payment_completed', $params); parent::preProcess(); } - function postProcess() { + public function postProcess() { $transaction = new CRM_Core_Transaction(); $trxnDetails = NULL; @@ -565,7 +565,7 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { * @return array * @throws Exception */ - function make_payment(&$params) { + public function make_payment(&$params) { $config = CRM_Core_Config::singleton(); if (isset($params["billing_state_province_id-{$this->_bltID}"]) && $params["billing_state_province_id-{$this->_bltID}"]) { $params["billing_state_province-{$this->_bltID}"] = CRM_Core_PseudoConstant::stateProvinceAbbreviation($params["billing_state_province_id-{$this->_bltID}"]); @@ -607,7 +607,7 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { * @return object * @throws Exception */ - function record_contribution(&$mer_participant, &$params, $event) { + public function record_contribution(&$mer_participant, &$params, $event) { if (self::is_administrator() && !empty($params['payment_type'])) { $params['payment_instrument_id'] = $params['payment_type']; } @@ -654,7 +654,7 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { return $contribution; } - function saveDataToSession() { + public function saveDataToSession() { $session_line_items = array(); foreach ($this->line_items as $line_item) { $session_line_item = array(); @@ -675,7 +675,7 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = parent::setDefaultValues(); diff --git a/CRM/Event/Cart/Form/Checkout/ThankYou.php b/CRM/Event/Cart/Form/Checkout/ThankYou.php index 63fe344aae..6dc21c5a53 100644 --- a/CRM/Event/Cart/Form/Checkout/ThankYou.php +++ b/CRM/Event/Cart/Form/Checkout/ThankYou.php @@ -7,7 +7,7 @@ class CRM_Event_Cart_Form_Checkout_ThankYou extends CRM_Event_Cart_Form_Cart { public $line_items = NULL; public $sub_total = 0; - function buildLineItems() { + public function buildLineItems() { foreach ($this->cart->events_in_carts as $event_in_cart) { $event_in_cart->load_location(); } @@ -42,7 +42,7 @@ class CRM_Event_Cart_Form_Checkout_ThankYou extends CRM_Event_Cart_Form_Cart { $this->assign('line_items', $this->line_items); } - function buildQuickForm() { + public function buildQuickForm() { $defaults = array(); $ids = array(); $template_params_to_copy = array( @@ -74,7 +74,7 @@ class CRM_Event_Cart_Form_Checkout_ThankYou extends CRM_Event_Cart_Form_Cart { //$this->assign( 'site_contact', "" ); } - function preProcess() { + public function preProcess() { $this->event_cart_id = $this->get('last_event_cart_id'); $this->loadCart(); //$this->loadParticipants( ); diff --git a/CRM/Event/Cart/Form/MerParticipant.php b/CRM/Event/Cart/Form/MerParticipant.php index 432b163e1f..6e63b8642c 100644 --- a/CRM/Event/Cart/Form/MerParticipant.php +++ b/CRM/Event/Cart/Form/MerParticipant.php @@ -9,7 +9,7 @@ class CRM_Event_Cart_Form_MerParticipant extends CRM_Core_Form { /** * @param null|object $participant */ - function __construct($participant) { + public function __construct($participant) { parent::__construct(); //XXX $this->participant = $participant; @@ -18,7 +18,7 @@ class CRM_Event_Cart_Form_MerParticipant extends CRM_Core_Form { /** * @param CRM_Core_Form $form */ - function appendQuickForm(&$form) { + public function appendQuickForm(&$form) { $textarea_size = array('size' => 30, 'maxlength' => 60); $form->add('text', $this->email_field_name(), ts('Email Address'), $textarea_size, TRUE); @@ -46,7 +46,7 @@ class CRM_Event_Cart_Form_MerParticipant extends CRM_Core_Form { * * @return array */ - function get_profile_groups($event_id) { + public function get_profile_groups($event_id) { $ufJoinParams = array( 'entity_table' => 'civicrm_event', 'module' => 'CiviEvent', @@ -59,7 +59,7 @@ class CRM_Event_Cart_Form_MerParticipant extends CRM_Core_Form { /** * @return array */ - function get_participant_custom_data_fields() { + public function get_participant_custom_data_fields() { list($custom_pre_id, $custom_post_id) = self::get_profile_groups($this->participant->event_id); $pre_fields = $post_fields = array(); @@ -76,7 +76,7 @@ class CRM_Event_Cart_Form_MerParticipant extends CRM_Core_Form { /** * @return string */ - function email_field_name() { + public function email_field_name() { return $this->html_field_name("email"); } @@ -87,7 +87,7 @@ class CRM_Event_Cart_Form_MerParticipant extends CRM_Core_Form { * * @return string */ - static function full_field_name($event_id, $participant_id, $field_name) { + public static function full_field_name($event_id, $participant_id, $field_name) { return "event[$event_id][participant][$participant_id][$field_name]"; } @@ -96,14 +96,14 @@ class CRM_Event_Cart_Form_MerParticipant extends CRM_Core_Form { * * @return string */ - function html_field_name($field_name) { + public function html_field_name($field_name) { return self::full_field_name($this->participant->event_id, $this->participant->id, $field_name); } /** * @return string */ - function name() { + public function name() { return "Participant {$this->participant->get_participant_index()}"; } @@ -120,7 +120,7 @@ class CRM_Event_Cart_Form_MerParticipant extends CRM_Core_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array( $this->html_field_name('email') => $this->participant->email, ); diff --git a/CRM/Event/Cart/Page/AddToCart.php b/CRM/Event/Cart/Page/AddToCart.php index 8218a2b2f2..a57779440f 100644 --- a/CRM/Event/Cart/Page/AddToCart.php +++ b/CRM/Event/Cart/Page/AddToCart.php @@ -4,7 +4,7 @@ * Class CRM_Event_Cart_Page_AddToCart */ class CRM_Event_Cart_Page_AddToCart extends CRM_Core_Page { - function run() { + public function run() { $transaction = new CRM_Core_Transaction(); $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE); diff --git a/CRM/Event/Cart/Page/CheckoutAJAX.php b/CRM/Event/Cart/Page/CheckoutAJAX.php index 85e29a2bef..7037f0bee8 100644 --- a/CRM/Event/Cart/Page/CheckoutAJAX.php +++ b/CRM/Event/Cart/Page/CheckoutAJAX.php @@ -4,7 +4,7 @@ * Class CRM_Event_Cart_Page_CheckoutAJAX */ class CRM_Event_Cart_Page_CheckoutAJAX { - function add_participant_to_cart() { + public function add_participant_to_cart() { $transaction = new CRM_Core_Transaction(); $cart_id = CRM_Utils_Request::retrieve('cart_id', 'Integer'); $event_id = CRM_Utils_Request::retrieve('event_id', 'Integer'); @@ -41,7 +41,7 @@ class CRM_Event_Cart_Page_CheckoutAJAX { CRM_Utils_System::civiExit(); } - function remove_participant_from_cart() { + public function remove_participant_from_cart() { $id = CRM_Utils_Request::retrieve('id', 'Integer'); $participant = CRM_Event_Cart_BAO_MerParticipant::get_by_id($id); $participant->delete(); diff --git a/CRM/Event/Cart/Page/RemoveFromCart.php b/CRM/Event/Cart/Page/RemoveFromCart.php index 519dcaee43..68e1552250 100644 --- a/CRM/Event/Cart/Page/RemoveFromCart.php +++ b/CRM/Event/Cart/Page/RemoveFromCart.php @@ -4,7 +4,7 @@ * Class CRM_Event_Cart_Page_RemoveFromCart */ class CRM_Event_Cart_Page_RemoveFromCart extends CRM_Core_Page { - function run() { + 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(); diff --git a/CRM/Event/Cart/Page/ViewCart.php b/CRM/Event/Cart/Page/ViewCart.php index 70654afbe3..32ba49ffc3 100644 --- a/CRM/Event/Cart/Page/ViewCart.php +++ b/CRM/Event/Cart/Page/ViewCart.php @@ -7,7 +7,7 @@ class CRM_Event_Cart_Page_ViewCart extends CRM_Core_Page { /** * @return string */ - function run() { + public function run() { $transaction = new CRM_Core_Transaction(); $cart = CRM_Event_Cart_BAO_Cart::find_or_create_for_current_session(); diff --git a/CRM/Event/Cart/StateMachine/Checkout.php b/CRM/Event/Cart/StateMachine/Checkout.php index 8e2a428471..e210dbff0f 100644 --- a/CRM/Event/Cart/StateMachine/Checkout.php +++ b/CRM/Event/Cart/StateMachine/Checkout.php @@ -8,7 +8,7 @@ class CRM_Event_Cart_StateMachine_Checkout extends CRM_Core_StateMachine { * @param object $controller * @param const|int $action */ - function __construct($controller, $action = CRM_Core_Action::NONE) { + public function __construct($controller, $action = CRM_Core_Action::NONE) { parent::__construct($controller, $action); $cart = CRM_Event_Cart_BAO_Cart::find_or_create_for_current_session(); diff --git a/CRM/Event/Controller/Registration.php b/CRM/Event/Controller/Registration.php index 13eff68c41..52da654590 100644 --- a/CRM/Event/Controller/Registration.php +++ b/CRM/Event/Controller/Registration.php @@ -37,7 +37,7 @@ class CRM_Event_Controller_Registration extends CRM_Core_Controller { /** * Class constructor */ - function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { + public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { parent::__construct($title, $modal); $this->_stateMachine = new CRM_Event_StateMachine_Registration($this, $action); @@ -58,7 +58,7 @@ class CRM_Event_Controller_Registration extends CRM_Core_Controller { } } - function invalidKey() { + public function invalidKey() { $this->invalidKeyRedirect(); } diff --git a/CRM/Event/Controller/Search.php b/CRM/Event/Controller/Search.php index 020d6df654..0fd8410d02 100644 --- a/CRM/Event/Controller/Search.php +++ b/CRM/Event/Controller/Search.php @@ -49,7 +49,7 @@ class CRM_Event_Controller_Search extends CRM_Core_Controller { /** * Class constructor */ - function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { + public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { parent::__construct($title, $modal); diff --git a/CRM/Event/Form/EventFees.php b/CRM/Event/Form/EventFees.php index 42d7bb6cb1..6543a08fad 100644 --- a/CRM/Event/Form/EventFees.php +++ b/CRM/Event/Form/EventFees.php @@ -47,7 +47,7 @@ class CRM_Event_Form_EventFees { * @return void * @access public */ - static function preProcess(&$form) { + public static function preProcess(&$form) { //as when call come from register.php if (!$form->_eventId) { $form->_eventId = CRM_Utils_Request::retrieve('eventId', 'Positive', $form); @@ -77,7 +77,7 @@ class CRM_Event_Form_EventFees { * * @return void */ - static function setDefaultValues(&$form) { + public static function setDefaultValues(&$form) { $defaults = array(); if ($form->_eventId) { @@ -261,7 +261,7 @@ class CRM_Event_Form_EventFees { * * @return void */ - static function setDefaultPriceSet($participantID, $eventID = NULL, $includeQtyZero = TRUE) { + public static function setDefaultPriceSet($participantID, $eventID = NULL, $includeQtyZero = TRUE) { $defaults = array(); if (!$eventID && $participantID) { $eventID = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Participant', $participantID, 'event_id'); @@ -346,7 +346,7 @@ SELECT id, html_type * @return void * @access public */ - static function buildQuickForm(&$form) { + public static function buildQuickForm(&$form) { if ($form->_eventId) { $form->_isPaidEvent = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $form->_eventId, 'is_monetary'); if ($form->_isPaidEvent) { diff --git a/CRM/Event/Form/ManageEvent.php b/CRM/Event/Form/ManageEvent.php index 829b5a22a4..b01b49c7a8 100644 --- a/CRM/Event/Form/ManageEvent.php +++ b/CRM/Event/Form/ManageEvent.php @@ -96,7 +96,7 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form { * @return void * @access public */ - function preProcess() { + public function preProcess() { $config = CRM_Core_Config::singleton(); if (in_array('CiviEvent', $config->enableComponents)) { $this->assign('CiviEvent', TRUE); @@ -232,7 +232,7 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); if (isset($this->_id)) { $params = array('id' => $this->_id); @@ -329,7 +329,7 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form { $this->add('hidden', 'is_template', $this->_isTemplate); } - function endPostProcess() { + public function endPostProcess() { // make submit buttons keep the current working tab opened. if ($this->_action & CRM_Core_Action::UPDATE) { $className = CRM_Utils_String::getClassName($this->_name); @@ -387,7 +387,7 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form { /** * @return string */ - function getTemplateFileName() { + public function getTemplateFileName() { if ($this->controller->getPrint() || $this->getVar('_id') <= 0 || $this->_action & CRM_Core_Action::DELETE) { return parent::getTemplateFileName(); } @@ -401,7 +401,7 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form { /** * Pre-load libraries required by Online Registration Profile fields */ - static function addProfileEditScripts() { + public static function addProfileEditScripts() { CRM_UF_Page_ProfileEditor::registerProfileScripts(); CRM_UF_Page_ProfileEditor::registerSchemas(array('IndividualModel', 'ParticipantModel')); } diff --git a/CRM/Event/Form/ManageEvent/Conference.php b/CRM/Event/Form/ManageEvent/Conference.php index bc15ddfd17..585c2dfce3 100644 --- a/CRM/Event/Form/ManageEvent/Conference.php +++ b/CRM/Event/Form/ManageEvent/Conference.php @@ -52,7 +52,7 @@ class CRM_Event_Form_ManageEvent_Conference extends CRM_Event_Form_ManageEvent { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $parentDefaults = parent::setDefaultValues(); $eventId = $this->_id; diff --git a/CRM/Event/Form/ManageEvent/EventInfo.php b/CRM/Event/Form/ManageEvent/EventInfo.php index 924c8bc5d3..a057348cec 100644 --- a/CRM/Event/Form/ManageEvent/EventInfo.php +++ b/CRM/Event/Form/ManageEvent/EventInfo.php @@ -51,7 +51,7 @@ class CRM_Event_Form_ManageEvent_EventInfo extends CRM_Event_Form_ManageEvent { * @return void * @access public */ - function preProcess() { + public function preProcess() { //custom data related code $this->_cdType = CRM_Utils_Array::value('type', $_GET); $this->assign('cdType', FALSE); @@ -93,7 +93,7 @@ class CRM_Event_Form_ManageEvent_EventInfo extends CRM_Event_Form_ManageEvent { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { if ($this->_cdType) { $tempId = (int) CRM_Utils_Request::retrieve('template_id', 'Integer', $this); // set template custom data as a default for event, CRM-5596 @@ -247,7 +247,7 @@ class CRM_Event_Form_ManageEvent_EventInfo extends CRM_Event_Form_ManageEvent { * @static * @access public */ - static function formRule($values) { + public static function formRule($values) { $errors = array(); if (!$values['is_template']) { diff --git a/CRM/Event/Form/ManageEvent/Fee.php b/CRM/Event/Form/ManageEvent/Fee.php index 1aea08a9a0..5f0783e2e5 100644 --- a/CRM/Event/Form/ManageEvent/Fee.php +++ b/CRM/Event/Form/ManageEvent/Fee.php @@ -65,7 +65,7 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); } @@ -77,7 +77,7 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $parentDefaults = parent::setDefaultValues(); $eventId = $this->_id; @@ -401,7 +401,7 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent { * * @return void */ - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Event_Form_ManageEvent_Fee', 'formRule')); } @@ -414,7 +414,7 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent { * @static * @access public */ - static function formRule($values) { + public static function formRule($values) { $errors = array(); if (!empty($values['is_discount'])) { $occurDiscount = array_count_values($values['discount_name']); diff --git a/CRM/Event/Form/ManageEvent/Location.php b/CRM/Event/Form/ManageEvent/Location.php index 4876796b99..072a2e8ab3 100644 --- a/CRM/Event/Form/ManageEvent/Location.php +++ b/CRM/Event/Form/ManageEvent/Location.php @@ -74,7 +74,7 @@ class CRM_Event_Form_ManageEvent_Location extends CRM_Event_Form_ManageEvent { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); $this->_values = $this->get('values'); @@ -104,7 +104,7 @@ class CRM_Event_Form_ManageEvent_Location extends CRM_Event_Form_ManageEvent { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = $this->_values; if (!empty($defaults['loc_block_id'])) { @@ -134,7 +134,7 @@ class CRM_Event_Form_ManageEvent_Location extends CRM_Event_Form_ManageEvent { * * @return void */ - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Event_Form_ManageEvent_Location', 'formRule')); } @@ -147,7 +147,7 @@ class CRM_Event_Form_ManageEvent_Location extends CRM_Event_Form_ManageEvent { * @static * @access public */ - static function formRule($fields) { + public static function formRule($fields) { // check for state/country mapping $errors = CRM_Contact_Form_Edit_Address::formRule($fields, CRM_Core_DAO::$_nullArray, CRM_Core_DAO::$_nullObject); diff --git a/CRM/Event/Form/ManageEvent/Registration.php b/CRM/Event/Form/ManageEvent/Registration.php index 43a1e570e7..8ca0153f98 100644 --- a/CRM/Event/Form/ManageEvent/Registration.php +++ b/CRM/Event/Form/ManageEvent/Registration.php @@ -56,7 +56,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent * @return void * @access public */ - function preProcess() { + public function preProcess() { $this->_addProfileBottom = CRM_Utils_Array::value('addProfileBottom', $_GET, FALSE); $this->_profileBottomNum = CRM_Utils_Array::value('addProfileNum', $_GET, 0); $this->_addProfileBottomAdd = CRM_Utils_Array::value('addProfileBottomAdd', $_GET, FALSE); @@ -97,7 +97,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { if ($this->_addProfileBottom || $this->_addProfileBottomAdd) { return; } @@ -210,7 +210,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent * * @return void */ - function setShowHide($defaults) { + public function setShowHide($defaults) { $this->_showHide = new CRM_Core_ShowHideBlocks(array('registration' => 1), '' ); @@ -322,7 +322,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent * * @static */ - function buildRegistrationBlock(&$form) { + public function buildRegistrationBlock(&$form) { $attributes = CRM_Core_DAO::getAttribute('CRM_Event_DAO_Event'); $attributes['intro_text']['click_wysiwyg'] = true; $form->addWysiwyg('intro_text', ts('Introductory Text'), $attributes['intro_text']); @@ -354,7 +354,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent * @param string $label Label * @param array $configs Optional, for addProfileSelector(), defaults to using getProfileSelectorTypes() **/ - function buildMultipleProfileBottom(&$form, $count, $prefix = '', $label = 'Include Profile', $configs = null) { + public function buildMultipleProfileBottom(&$form, $count, $prefix = '', $label = 'Include Profile', $configs = null) { extract( ( is_null($configs) ) ? self::getProfileSelectorTypes() : $configs ); $element = $prefix . "custom_post_id_multiple[$count]"; $label .= '
'.ts('(bottom of page)'); @@ -366,7 +366,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent * * @return array( 'allowCoreTypes' => array(), 'allowSubTypes' => array(), 'profileEntities' => array() ) **/ - static function getProfileSelectorTypes() { + public static function getProfileSelectorTypes() { $configs = array( 'allowCoreTypes' => array(), 'allowSubTypes' => array(), @@ -397,7 +397,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent * * @static */ - function buildConfirmationBlock(&$form) { + public function buildConfirmationBlock(&$form) { $attributes = CRM_Core_DAO::getAttribute('CRM_Event_DAO_Event'); $attributes['confirm_text']['click_wysiwyg'] = true; // CRM-11182 - Optional confirmation page for free events @@ -425,7 +425,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent * * @static */ - function buildMailBlock(&$form) { + public function buildMailBlock(&$form) { $form->registerRule('emailList', 'callback', 'emailList', 'CRM_Utils_Rule'); $attributes = CRM_Core_DAO::getAttribute('CRM_Event_DAO_Event'); $form->addYesNo('is_email_confirm', ts('Send Confirmation Email?'), NULL, NULL, array('onclick' => "return showHideByValue('is_email_confirm','','confirmEmail','block','radio',false);")); @@ -442,7 +442,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent /** * @param CRM_Core_Form $form */ - function buildThankYouBlock(&$form) { + public function buildThankYouBlock(&$form) { $attributes = CRM_Core_DAO::getAttribute('CRM_Event_DAO_Event'); $attributes['thankyou_text']['click_wysiwyg'] = true; $form->add('text', 'thankyou_title', ts('Title'), $attributes['thankyou_title']); @@ -464,7 +464,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent * * @return void */ - function addRules() { + public function addRules() { if ($this->_addProfileBottom || $this->_addProfileBottomAdd) { return; } @@ -482,7 +482,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent * @static * @access public */ - static function formRule($values, $files, $form) { + public static function formRule($values, $files, $form) { if (!empty($values['is_online_registration'])) { if (!$values['confirm_title']) { @@ -669,7 +669,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent * @param $profileIds * @return boolean */ - static function getEmailFields($profileIds) { + public static function getEmailFields($profileIds) { $emailFields = array(); foreach ($profileIds as $profileId) { if ($profileId && is_numeric($profileId)) { @@ -690,7 +690,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent * @param $profileIds * @return boolean */ - static function isProfileComplete($profileIds) { + public static function isProfileComplete($profileIds) { $profileReqFields = array(); foreach ($profileIds as $profileId) { if ($profileId && is_numeric($profileId)) { @@ -726,7 +726,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent * @return boolean */ - function canProfilesDedupe($profileIds, $rgId = 0) { + public function canProfilesDedupe($profileIds, $rgId = 0) { // find the unsupervised rule @@ -804,7 +804,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent * Add additional profiles from the form to an array of profile ids. * */ - static function addMultipleProfiles(&$profileIds, $values, $field) { + public static function addMultipleProfiles(&$profileIds, $values, $field) { if ($multipleProfiles = CRM_Utils_Array::value($field, $values)) { foreach ($multipleProfiles as $profileId) { $profileIds[] = $profileId; diff --git a/CRM/Event/Form/ManageEvent/Repeat.php b/CRM/Event/Form/ManageEvent/Repeat.php index 65652320d2..336c9ca38a 100644 --- a/CRM/Event/Form/ManageEvent/Repeat.php +++ b/CRM/Event/Form/ManageEvent/Repeat.php @@ -24,7 +24,7 @@ class CRM_Event_Form_ManageEvent_Repeat extends CRM_Event_Form_ManageEvent { protected $_parentEventEndDate = NULL; - function preProcess() { + public function preProcess() { parent::preProcess(); CRM_Core_Form_RecurringEntity::preProcess('civicrm_event'); $this->assign('currentEventId', $this->_id); @@ -80,7 +80,7 @@ class CRM_Event_Form_ManageEvent_Repeat extends CRM_Event_Form_ManageEvent { * * @return None */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); //Always pass current event's start date by default diff --git a/CRM/Event/Form/ManageEvent/ScheduleReminders.php b/CRM/Event/Form/ManageEvent/ScheduleReminders.php index f31cb17045..cfca03d40d 100644 --- a/CRM/Event/Form/ManageEvent/ScheduleReminders.php +++ b/CRM/Event/Form/ManageEvent/ScheduleReminders.php @@ -46,7 +46,7 @@ class CRM_Event_Form_ManageEvent_ScheduleReminders extends CRM_Event_Form_Manage * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); $setTab = CRM_Utils_Request::retrieve('setTab', 'Int', $this, FALSE, 0); @@ -91,7 +91,7 @@ class CRM_Event_Form_ManageEvent_ScheduleReminders extends CRM_Event_Form_Manage $this->setPageTitle(ts('Scheduled Reminder')); } - function getTemplateFileName() { + public function getTemplateFileName() { return 'CRM/Admin/Page/ScheduleReminders.tpl'; } } \ No newline at end of file diff --git a/CRM/Event/Form/ManageEvent/TabHeader.php b/CRM/Event/Form/ManageEvent/TabHeader.php index 91f16548ec..c4337d9998 100644 --- a/CRM/Event/Form/ManageEvent/TabHeader.php +++ b/CRM/Event/Form/ManageEvent/TabHeader.php @@ -43,7 +43,7 @@ class CRM_Event_Form_ManageEvent_TabHeader { * * @return array */ - static function build(&$form) { + public static function build(&$form) { $tabs = $form->get('tabHeader'); if (!$tabs || empty($_GET['reset'])) { $tabs = self::process($form); @@ -65,7 +65,7 @@ class CRM_Event_Form_ManageEvent_TabHeader { * @return array * @throws Exception */ - static function process(&$form) { + public static function process(&$form) { if ($form->getVar('_id') <= 0) { return NULL; } @@ -205,7 +205,7 @@ WHERE e.id = %1 /** * @param $form */ - static function reset(&$form) { + public static function reset(&$form) { $tabs = self::process($form); $form->set('tabHeader', $tabs); } @@ -215,7 +215,7 @@ WHERE e.id = %1 * * @return int|string */ - static function getCurrentTab($tabs) { + public static function getCurrentTab($tabs) { static $current = FALSE; if ($current) { diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index ff6b9e507f..94772ffc72 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -791,7 +791,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment * * @return void */ - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Event_Form_Participant', 'formRule'), $this); } @@ -806,7 +806,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment * @static * @access public */ - static function formRule($values, $files, $self) { + public static function formRule($values, $files, $self) { // If $values['_qf_Participant_next'] is Delete or // $values['event_id'] is empty, then return // instead of proceeding further. diff --git a/CRM/Event/Form/ParticipantFeeSelection.php b/CRM/Event/Form/ParticipantFeeSelection.php index 7ec58ad63f..7e4498c81b 100644 --- a/CRM/Event/Form/ParticipantFeeSelection.php +++ b/CRM/Event/Form/ParticipantFeeSelection.php @@ -227,7 +227,7 @@ class CRM_Event_Form_ParticipantFeeSelection extends CRM_Core_Form { * * @return array */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); return $errors; } @@ -275,7 +275,7 @@ class CRM_Event_Form_ParticipantFeeSelection extends CRM_Core_Form { * * @return mixed */ - function emailReceipt(&$params) { + public function emailReceipt(&$params) { $updatedLineItem = CRM_Price_BAO_LineItem::getLineItems($this->_participantId, 'participant', NULL, FALSE); $lineItem = array(); if ($updatedLineItem) { diff --git a/CRM/Event/Form/Registration.php b/CRM/Event/Form/Registration.php index 5b39bbf1b4..3bc3874cd9 100644 --- a/CRM/Event/Form/Registration.php +++ b/CRM/Event/Form/Registration.php @@ -195,7 +195,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form { * @return void * @access public */ - function preProcess() { + public function preProcess() { $this->_eventId = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE); $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE); @@ -480,7 +480,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form { * @return void * @access public */ - function assignToTemplate() { + public function assignToTemplate() { //process only primary participant params $this->_params = $this->get('params'); if (isset($this->_params[0])) { @@ -580,7 +580,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form { * @return void * @access public */ - function buildCustom($id, $name, $viewOnly = FALSE) { + public function buildCustom($id, $name, $viewOnly = FALSE) { if ($id) { $button = substr($this->controller->getButtonName(), -4); $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this); @@ -680,7 +680,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form { * * @throws Exception */ - static function initEventFee(&$form, $eventID) { + public static function initEventFee(&$form, $eventID) { // get price info // retrive all active price set fields. @@ -742,7 +742,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form { * @return void * @access public */ - function confirmPostProcess($contactID = NULL, $contribution = NULL, $payment = NULL) { + public function confirmPostProcess($contactID = NULL, $contribution = NULL, $payment = NULL) { // add/update contact information $fields = array(); unset($this->_params['note']); @@ -1173,7 +1173,7 @@ WHERE v.option_group_id = g.id * * @return null|string */ - function checkTemplateFileExists($suffix = '') { + public function checkTemplateFileExists($suffix = '') { if ($this->_eventId) { $templateName = $this->_name; if (substr($templateName, 0, 12) == 'Participant_') { @@ -1192,7 +1192,7 @@ WHERE v.option_group_id = g.id /** * @return null|string */ - function getTemplateFileName() { + public function getTemplateFileName() { $fileName = $this->checkTemplateFileExists(); return $fileName ? $fileName : parent::getTemplateFileName(); } @@ -1200,7 +1200,7 @@ WHERE v.option_group_id = g.id /** * @return null|string */ - function overrideExtraTemplateFileName() { + public function overrideExtraTemplateFileName() { $fileName = $this->checkTemplateFileExists('extra.'); return $fileName ? $fileName : parent::overrideExtraTemplateFileName(); } @@ -1212,7 +1212,7 @@ WHERE v.option_group_id = g.id * @param unknown_type $params * @return multitype:|Ambigous */ - static function validatePriceSet(&$form, $params) { + public static function validatePriceSet(&$form, $params) { $errors = array(); $hasOptMaxValue = FALSE; if (!is_array($params) || empty($params)) { @@ -1349,7 +1349,7 @@ WHERE v.option_group_id = g.id /** * @param int $participantID */ - function processFirstParticipant($participantID) { + public function processFirstParticipant($participantID) { $this->_participantId = $participantID; $this->set('participantId', $this->_participantId); @@ -1376,7 +1376,7 @@ WHERE v.option_group_id = g.id * * @param string $redirect */ - function checkValidEvent($redirect = NULL) { + public function checkValidEvent($redirect = NULL) { // is the event active (enabled)? if (!$this->_values['event']['is_active']) { // form is inactive, die a fatal death diff --git a/CRM/Event/Form/Registration/AdditionalParticipant.php b/CRM/Event/Form/Registration/AdditionalParticipant.php index 1f80dce802..2286fd790c 100644 --- a/CRM/Event/Form/Registration/AdditionalParticipant.php +++ b/CRM/Event/Form/Registration/AdditionalParticipant.php @@ -58,7 +58,7 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); $participantNo = substr($this->_name, 12); @@ -96,7 +96,7 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = $unsetSubmittedOptions = array(); $discountId = NULL; //fix for CRM-3088, default value for discount set. @@ -375,7 +375,7 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R * @access public * @static */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); //get the button name. $button = substr($self->controller->getButtonName(), -4); @@ -517,7 +517,7 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R * * @return bool */ - function validatePaymentValues($self, $fields) { + public function validatePaymentValues($self, $fields) { if (!empty($self->_params[0]['bypass_payment']) || $self->_allowWaitlist || @@ -753,7 +753,7 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R * @return boolean ture on success. * @access public */ - function isLastParticipant($isButtonJs = FALSE) { + public function isLastParticipant($isButtonJs = FALSE) { $participant = $isButtonJs ? $this->_params[0]['additional_participants'] : $this->_params[0]['additional_participants'] + 1; if (count($this->_params) == $participant) { return TRUE; @@ -765,7 +765,7 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R * Reset values for all options those are full. * **/ - function resetElementValue($optionFullIds = array()) { + public function resetElementValue($optionFullIds = array()) { if (!is_array($optionFullIds) || empty($optionFullIds) || !$this->isSubmitted() @@ -824,7 +824,7 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R * @param string $elementName * @param array $optionIds */ - function resetSubmittedValue($elementName, $optionIds = array()) { + public function resetSubmittedValue($elementName, $optionIds = array()) { if (empty($elementName) || !$this->elementExists($elementName) || !$this->getSubmitValue($elementName) diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php index b65f4846c4..9184a970d3 100644 --- a/CRM/Event/Form/Registration/Confirm.php +++ b/CRM/Event/Form/Registration/Confirm.php @@ -62,7 +62,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); // lineItem isn't set until Register postProcess @@ -212,7 +212,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { * @return int * @access public */ - function getAction() { + public function getAction() { if ($this->_action & CRM_Core_Action::PREVIEW) { return CRM_Core_Action::VIEW | CRM_Core_Action::PREVIEW; } @@ -394,7 +394,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { $this->addFormRule(array('CRM_Event_Form_Registration_Confirm', 'formRule'), $this); } - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); $eventFull = CRM_Event_BAO_Participant::eventFull($self->_eventId, FALSE, CRM_Utils_Array::value('has_waitlist', $self->_values['event'])); if ($eventFull && empty($self->_allowConfirmation)) { diff --git a/CRM/Event/Form/Registration/Register.php b/CRM/Event/Form/Registration/Register.php index 7a921d8509..33a8f503b3 100644 --- a/CRM/Event/Form/Registration/Register.php +++ b/CRM/Event/Form/Registration/Register.php @@ -88,7 +88,7 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); //CRM-4320. @@ -144,7 +144,7 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { if ($this->_paymentProcessorID && $this->_snippet && !($this->_paymentProcessor['billing_mode'] & CRM_Core_Payment::BILLING_MODE_FORM)) { // see function comment block for explanation of this. Note that CRM-15555 will require this to look at the billing form fields not the // billing_mode which @@ -804,7 +804,7 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { * @access public * @static */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); //check that either an email or firstname+lastname is included in the form(CRM-9587) self::checkProfileComplete($fields, $errors, $self->_eventId); @@ -944,7 +944,7 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { * Check if profiles are complete when event registration occurs(CRM-9587) * */ - static function checkProfileComplete($fields, &$errors, $eventId) { + public static function checkProfileComplete($fields, &$errors, $eventId) { $email = ''; foreach ($fields as $fieldname => $fieldvalue) { if (substr($fieldname, 0, 6) == 'email-' && $fieldvalue) { @@ -1399,7 +1399,7 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { * @return void * @access public */ - static function checkRegistration($fields, &$self, $isAdditional = FALSE, $returnContactId = FALSE, $useDedupeRules = FALSE) { + public static function checkRegistration($fields, &$self, $isAdditional = FALSE, $returnContactId = FALSE, $useDedupeRules = FALSE) { // CRM-3907, skip check for preview registrations // CRM-4320 participant need to walk wizard if (!$returnContactId && diff --git a/CRM/Event/Form/Registration/ThankYou.php b/CRM/Event/Form/Registration/ThankYou.php index b078c3ccb0..6d9519c801 100644 --- a/CRM/Event/Form/Registration/ThankYou.php +++ b/CRM/Event/Form/Registration/ThankYou.php @@ -46,7 +46,7 @@ class CRM_Event_Form_Registration_ThankYou extends CRM_Event_Form_Registration { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); $this->_params = $this->get('params'); $this->_lineItem = $this->get('lineItem'); @@ -74,7 +74,7 @@ class CRM_Event_Form_Registration_ThankYou extends CRM_Event_Form_Registration { * @return int * @access public */ - function getAction() { + public function getAction() { if ($this->_action & CRM_Core_Action::PREVIEW) { return CRM_Core_Action::VIEW | CRM_Core_Action::PREVIEW; } diff --git a/CRM/Event/Form/Search.php b/CRM/Event/Form/Search.php index 6f0e9d7bfe..63622b8865 100644 --- a/CRM/Event/Form/Search.php +++ b/CRM/Event/Form/Search.php @@ -88,7 +88,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { * @return void * @access public */ - function preProcess() { + public function preProcess() { $this->set('searchFormName', 'Search'); /** @@ -175,7 +175,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { parent::buildQuickForm(); $this->addElement('text', 'sort_name', ts('Participant Name or Email'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name')); @@ -267,7 +267,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { * @return void * @access public */ - function postProcess() { + public function postProcess() { if ($this->_done) { return; } @@ -364,7 +364,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { * @access public * @see valid_date */ - function addRules() {} + public function addRules() {} /** * Set the default form values @@ -373,13 +373,13 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { * * @return array the default array reference */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $defaults = $this->_formValues; return $defaults; } - function fixFormValues() { + public function fixFormValues() { // if this search has been forced // then see if there are any get values, and if so over-ride the post values // note that this means that GET over-rides POST :) @@ -458,7 +458,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { /** * @return null */ - function getFormValues() { + public function getFormValues() { return NULL; } diff --git a/CRM/Event/Form/SearchEvent.php b/CRM/Event/Form/SearchEvent.php index 986d39011f..fd35d35d6e 100644 --- a/CRM/Event/Form/SearchEvent.php +++ b/CRM/Event/Form/SearchEvent.php @@ -37,7 +37,7 @@ class CRM_Event_Form_SearchEvent extends CRM_Core_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $defaults['eventsByDates'] = 0; @@ -86,7 +86,7 @@ class CRM_Event_Form_SearchEvent extends CRM_Core_Form { )); } - function postProcess() { + public function postProcess() { $params = $this->controller->exportValues($this->_name); $parent = $this->controller->getParent(); $parent->set('searchResult', 1); diff --git a/CRM/Event/Form/Task.php b/CRM/Event/Form/Task.php index 26d33809fc..cd07d47b80 100644 --- a/CRM/Event/Form/Task.php +++ b/CRM/Event/Form/Task.php @@ -75,7 +75,7 @@ class CRM_Event_Form_Task extends CRM_Core_Form { * @return void * @access public */ - function preProcess() { + public function preProcess() { self::preProcessCommon($this); } @@ -83,7 +83,7 @@ class CRM_Event_Form_Task extends CRM_Core_Form { * @param CRM_Core_Form $form * @param bool $useTable */ - static function preProcessCommon(&$form, $useTable = FALSE) { + public static function preProcessCommon(&$form, $useTable = FALSE) { $form->_participantIds = array(); $values = $form->controller->exportValues($form->get('searchFormName')); @@ -167,7 +167,7 @@ class CRM_Event_Form_Task extends CRM_Core_Form { * @return void * @access public */ - function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { + public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { $this->addButtons(array( array( 'type' => $nextType, diff --git a/CRM/Event/Form/Task/AddToGroup.php b/CRM/Event/Form/Task/AddToGroup.php index 10a3c5e278..aad0acd159 100644 --- a/CRM/Event/Form/Task/AddToGroup.php +++ b/CRM/Event/Form/Task/AddToGroup.php @@ -67,7 +67,7 @@ class CRM_Event_Form_Task_AddToGroup extends CRM_Event_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { // initialize the task and row fields parent::preProcess(); @@ -83,7 +83,7 @@ class CRM_Event_Form_Task_AddToGroup extends CRM_Event_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { //create radio buttons to select existing group or add a new group $options = array(ts('Add Contact To Existing Group'), ts('Create New Group')); @@ -156,7 +156,7 @@ class CRM_Event_Form_Task_AddToGroup extends CRM_Event_Form_Task { * * @return array the default array reference */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); if ($this->_context === 'amtg') { @@ -174,7 +174,7 @@ class CRM_Event_Form_Task_AddToGroup extends CRM_Event_Form_Task { * * @return void */ - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Event_Form_Task_AddToGroup', 'formRule')); } @@ -187,7 +187,7 @@ class CRM_Event_Form_Task_AddToGroup extends CRM_Event_Form_Task { * @static * @access public */ - static function formRule($params) { + public static function formRule($params) { $errors = array(); if (!empty($params['group_option']) && empty($params['title'])) { diff --git a/CRM/Event/Form/Task/Badge.php b/CRM/Event/Form/Task/Badge.php index 5583d3c25f..9899b6fc5f 100644 --- a/CRM/Event/Form/Task/Badge.php +++ b/CRM/Event/Form/Task/Badge.php @@ -60,7 +60,7 @@ class CRM_Event_Form_Task_Badge extends CRM_Event_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this); if ($this->_context == 'view') { $this->_single = TRUE; @@ -89,7 +89,7 @@ class CRM_Event_Form_Task_Badge extends CRM_Event_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { CRM_Utils_System::setTitle(ts('Make Name Badges')); //add select for label diff --git a/CRM/Event/Form/Task/Batch.php b/CRM/Event/Form/Task/Batch.php index c35abc9497..ddf0c8b67c 100644 --- a/CRM/Event/Form/Task/Batch.php +++ b/CRM/Event/Form/Task/Batch.php @@ -69,7 +69,7 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { /* * initialize the task and row fields */ @@ -98,7 +98,7 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $ufGroupId = $this->get('ufGroupId'); if (!$ufGroupId) { @@ -240,7 +240,7 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { if (empty($this->_fields)) { return; } @@ -355,7 +355,7 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { * * @return Ambigous|void */ - static function updatePendingOnlineContribution($participantId, $statusId) { + public static function updatePendingOnlineContribution($participantId, $statusId) { if (!$participantId || !$statusId) { return; } diff --git a/CRM/Event/Form/Task/Cancel.php b/CRM/Event/Form/Task/Cancel.php index d9e712c244..8951c8d2a5 100644 --- a/CRM/Event/Form/Task/Cancel.php +++ b/CRM/Event/Form/Task/Cancel.php @@ -50,7 +50,7 @@ class CRM_Event_Form_Task_Cancel extends CRM_Event_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { // initialize the task and row fields parent::preProcess(); @@ -65,7 +65,7 @@ class CRM_Event_Form_Task_Cancel extends CRM_Event_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { CRM_Utils_System::setTitle(ts('Cancel Registration for Event Participation')); $session = CRM_Core_Session::singleton(); $this->addDefaultButtons(ts('Continue'), 'done'); diff --git a/CRM/Event/Form/Task/Delete.php b/CRM/Event/Form/Task/Delete.php index a0a22391ae..0a0e9ec479 100644 --- a/CRM/Event/Form/Task/Delete.php +++ b/CRM/Event/Form/Task/Delete.php @@ -54,7 +54,7 @@ class CRM_Event_Form_Task_Delete extends CRM_Event_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { //check for delete if (!CRM_Core_Permission::checkActionPermission('CiviEvent', CRM_Core_Action::DELETE)) { @@ -75,7 +75,7 @@ class CRM_Event_Form_Task_Delete extends CRM_Event_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $deleteParticipants = array(1 => ts('Delete this participant record along with associated participant record(s).'), 2 => ts('Delete only this participant record.'), ); diff --git a/CRM/Event/Form/Task/ParticipantStatus.php b/CRM/Event/Form/Task/ParticipantStatus.php index 4f26252638..b020ac80c1 100644 --- a/CRM/Event/Form/Task/ParticipantStatus.php +++ b/CRM/Event/Form/Task/ParticipantStatus.php @@ -33,7 +33,7 @@ * */ class CRM_Event_Form_Task_ParticipantStatus extends CRM_Event_Form_Task_Batch { - function buildQuickForm() { + public function buildQuickForm() { // CRM_Event_Form_Task_Batch::buildQuickForm() gets ufGroupId // from the form, so set it here to the id of the reserved profile $dao = new CRM_Core_DAO_UFGroup; diff --git a/CRM/Event/Form/Task/PickProfile.php b/CRM/Event/Form/Task/PickProfile.php index 811c3f9ed2..67c7c0837f 100644 --- a/CRM/Event/Form/Task/PickProfile.php +++ b/CRM/Event/Form/Task/PickProfile.php @@ -63,7 +63,7 @@ class CRM_Event_Form_Task_PickProfile extends CRM_Event_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { // initialize the task and row fields parent::preProcess(); @@ -92,7 +92,7 @@ class CRM_Event_Form_Task_PickProfile extends CRM_Event_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $types = array('Participant'); $profiles = CRM_Core_BAO_UFGroup::getProfiles($types, TRUE); @@ -115,7 +115,7 @@ class CRM_Event_Form_Task_PickProfile extends CRM_Event_Form_Task { * * @return void */ - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Event_Form_Task_PickProfile', 'formRule')); } @@ -128,7 +128,7 @@ class CRM_Event_Form_Task_PickProfile extends CRM_Event_Form_Task { * @static * @access public */ - static function formRule($fields) { + public static function formRule($fields) { return TRUE; } diff --git a/CRM/Event/Form/Task/Print.php b/CRM/Event/Form/Task/Print.php index 1e0e9711e5..c22c5f24e4 100644 --- a/CRM/Event/Form/Task/Print.php +++ b/CRM/Event/Form/Task/Print.php @@ -44,7 +44,7 @@ class CRM_Event_Form_Task_Print extends CRM_Event_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preprocess(); // set print view, so that print templates are called @@ -75,7 +75,7 @@ class CRM_Event_Form_Task_Print extends CRM_Event_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { // // just need to add a javacript to popup the window for printing // diff --git a/CRM/Event/Form/Task/Result.php b/CRM/Event/Form/Task/Result.php index 24877d8dfe..a94f917598 100644 --- a/CRM/Event/Form/Task/Result.php +++ b/CRM/Event/Form/Task/Result.php @@ -46,7 +46,7 @@ class CRM_Event_Form_Task_Result extends CRM_Event_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { $session = CRM_Core_Session::singleton(); //this is done to unset searchRows variable assign during AddToHousehold and AddToOrganization diff --git a/CRM/Event/Form/Task/SaveSearch.php b/CRM/Event/Form/Task/SaveSearch.php index a57d9f803e..c4d67e64d5 100644 --- a/CRM/Event/Form/Task/SaveSearch.php +++ b/CRM/Event/Form/Task/SaveSearch.php @@ -66,7 +66,7 @@ class CRM_Event_Form_Task_SaveSearch extends CRM_Event_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { CRM_Utils_System::setTitle(ts('Smart Group')); // get the qill $query = new CRM_Event_BAO_Query($this->get('formValues')); diff --git a/CRM/Event/Form/Task/SaveSearch/Update.php b/CRM/Event/Form/Task/SaveSearch/Update.php index 08c897dbf9..afa9355c60 100644 --- a/CRM/Event/Form/Task/SaveSearch/Update.php +++ b/CRM/Event/Form/Task/SaveSearch/Update.php @@ -45,7 +45,7 @@ class CRM_Event_Form_Task_SaveSearch_Update extends CRM_Event_Form_Task_SaveSear * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); $this->_id = $this->get('ssID'); @@ -64,7 +64,7 @@ class CRM_Event_Form_Task_SaveSearch_Update extends CRM_Event_Form_Task_SaveSear * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $params = array(); diff --git a/CRM/Event/Form/Task/SearchTaskHookSample.php b/CRM/Event/Form/Task/SearchTaskHookSample.php index 935f6f3add..a8a6fbfacf 100644 --- a/CRM/Event/Form/Task/SearchTaskHookSample.php +++ b/CRM/Event/Form/Task/SearchTaskHookSample.php @@ -44,7 +44,7 @@ class CRM_Event_Form_Task_SearchTaskHookSample extends CRM_Event_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); $rows = array(); // display name and participation details of participants diff --git a/CRM/Event/Import/Controller.php b/CRM/Event/Import/Controller.php index 066e93ff74..07ece114c0 100644 --- a/CRM/Event/Import/Controller.php +++ b/CRM/Event/Import/Controller.php @@ -37,7 +37,7 @@ class CRM_Event_Import_Controller extends CRM_Core_Controller { /** * Class constructor */ - function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { + public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { parent::__construct($title, $modal); // lets get around the time limit issue if possible, CRM-2113 diff --git a/CRM/Event/Import/Field.php b/CRM/Event/Import/Field.php index d08141bcd5..f7fcbdb38c 100644 --- a/CRM/Event/Import/Field.php +++ b/CRM/Event/Import/Field.php @@ -76,7 +76,7 @@ class CRM_Event_Import_Field { * @param string $headerPattern * @param string $dataPattern */ - function __construct($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') { + public function __construct($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') { $this->_name = $name; $this->_title = $title; $this->_type = $type; @@ -86,7 +86,7 @@ class CRM_Event_Import_Field { $this->_value = NULL; } - function resetValue() { + public function resetValue() { $this->_value = NULL; } @@ -94,14 +94,14 @@ class CRM_Event_Import_Field { * The value is in string format. convert the value to the type of this field * and set the field value with the appropriate type */ - function setValue($value) { + public function setValue($value) { $this->_value = $value; } /** * @return bool */ - function validate() { + public function validate() { if (CRM_Utils_System::isNull($this->_value)) { return TRUE; } diff --git a/CRM/Event/Import/Form/MapField.php b/CRM/Event/Import/Form/MapField.php index 02132172ab..d042110e7b 100644 --- a/CRM/Event/Import/Form/MapField.php +++ b/CRM/Event/Import/Form/MapField.php @@ -291,7 +291,7 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField { * @static * @access public */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); $fieldMessage = NULL; if (!array_key_exists('savedMapping', $fields)) { diff --git a/CRM/Event/Import/Parser.php b/CRM/Event/Import/Parser.php index fa17fc89c1..156f0f6e40 100644 --- a/CRM/Event/Import/Parser.php +++ b/CRM/Event/Import/Parser.php @@ -297,7 +297,7 @@ abstract class CRM_Event_Import_Parser extends CRM_Import_Parser { * @return void * @access public */ - function setActiveFields($fieldKeys) { + public function setActiveFields($fieldKeys) { $this->_activeFieldCount = count($fieldKeys); foreach ($fieldKeys as $key) { if (empty($this->_fields[$key])) { @@ -315,7 +315,7 @@ abstract class CRM_Event_Import_Parser extends CRM_Import_Parser { * @return array (reference ) associative array of name/value pairs * @access public */ - function &getActiveFieldParams() { + public function &getActiveFieldParams() { $params = array(); for ($i = 0; $i < $this->_activeFieldCount; $i++) { if (isset($this->_activeFields[$i]->_value) @@ -336,7 +336,7 @@ abstract class CRM_Event_Import_Parser extends CRM_Import_Parser { * @param string $headerPattern * @param string $dataPattern */ - function addField($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') { + public function addField($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') { if (empty($name)) { $this->_fields['doNotImport'] = new CRM_Event_Import_Field($name, $title, $type, $headerPattern, $dataPattern); } @@ -365,7 +365,7 @@ abstract class CRM_Event_Import_Parser extends CRM_Import_Parser { * @return void * @access public */ - function set($store, $mode = self::MODE_SUMMARY) { + public function set($store, $mode = self::MODE_SUMMARY) { $store->set('fileSize', $this->_fileSize); $store->set('lineCount', $this->_lineCount); $store->set('seperator', $this->_seperator); @@ -422,7 +422,7 @@ abstract class CRM_Event_Import_Parser extends CRM_Import_Parser { * @return void * @access public */ - static function exportCSV($fileName, $header, $data) { + public static function exportCSV($fileName, $header, $data) { $output = array(); $fd = fopen($fileName, 'w'); diff --git a/CRM/Event/Import/Parser/Participant.php b/CRM/Event/Import/Parser/Participant.php index f58323f7bb..0f615df798 100644 --- a/CRM/Event/Import/Parser/Participant.php +++ b/CRM/Event/Import/Parser/Participant.php @@ -60,7 +60,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { /** * Class constructor */ - function __construct(&$mapperKeys, $mapperLocType = NULL, $mapperPhoneType = NULL) { + public function __construct(&$mapperKeys, $mapperLocType = NULL, $mapperPhoneType = NULL) { parent::__construct(); $this->_mapperKeys = &$mapperKeys; } @@ -71,7 +71,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { * @return void * @access public */ - function init() { + public function init() { $fields = CRM_Event_BAO_Participant::importableFields($this->_contactType, FALSE); $fields['event_id']['title'] = 'Event ID'; $eventfields = &CRM_Event_BAO_Event::fields(); @@ -131,7 +131,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { * @return boolean * @access public */ - function mapField(&$values) { + public function mapField(&$values) { return CRM_Import_Parser::VALID; } @@ -143,7 +143,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { * @return boolean the result of this processing * @access public */ - function preview(&$values) { + public function preview(&$values) { return $this->summary($values); } @@ -155,7 +155,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { * @return boolean the result of this processing * @access public */ - function summary(&$values) { + public function summary(&$values) { $erroneousField = NULL; $response = $this->setActiveFieldValues($values, $erroneousField); @@ -272,7 +272,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { * @return boolean the result of this processing * @access public */ - function import($onDuplicate, &$values) { + public function import($onDuplicate, &$values) { // first make sure this is a valid line $response = $this->summary($values); @@ -495,7 +495,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { * @return array * @access public */ - function &getImportedParticipations() { + public function &getImportedParticipations() { return $this->_newParticipants; } @@ -505,6 +505,6 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { * @return void * @access public */ - function fini() {} + public function fini() {} } diff --git a/CRM/Event/Page/AJAX.php b/CRM/Event/Page/AJAX.php index d7707da2dd..f7ef649d07 100644 --- a/CRM/Event/Page/AJAX.php +++ b/CRM/Event/Page/AJAX.php @@ -42,7 +42,7 @@ class CRM_Event_Page_AJAX { * Building EventFee combo box * FIXME: This ajax callback could be eliminated in favor of an entityRef field but the priceFieldValue api doesn't currently support filtering on entity_table */ - function eventFee() { + public function eventFee() { $name = trim(CRM_Utils_Type::escape($_GET['term'], 'String')); if (!$name) { diff --git a/CRM/Event/Page/DashBoard.php b/CRM/Event/Page/DashBoard.php index dd657f802c..c83306d8bd 100644 --- a/CRM/Event/Page/DashBoard.php +++ b/CRM/Event/Page/DashBoard.php @@ -46,7 +46,7 @@ class CRM_Event_Page_DashBoard extends CRM_Core_Page { * @access public * */ - function preProcess() { + public function preProcess() { CRM_Utils_System::setTitle(ts('CiviEvent')); $eventSummary = CRM_Event_BAO_Event::getEventSummary(); @@ -79,7 +79,7 @@ class CRM_Event_Page_DashBoard extends CRM_Core_Page { * return null * @access public */ - function run() { + public function run() { $this->preProcess(); $controller = new CRM_Core_Controller_Simple('CRM_Event_Form_Search', ts('events'), NULL); diff --git a/CRM/Event/Page/EventInfo.php b/CRM/Event/Page/EventInfo.php index d97c88d148..14899576e6 100644 --- a/CRM/Event/Page/EventInfo.php +++ b/CRM/Event/Page/EventInfo.php @@ -49,7 +49,7 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { //get the event id. $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE); $config = CRM_Core_Config::singleton(); @@ -363,7 +363,7 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page { /** * @return string */ - function getTemplateFileName() { + public function getTemplateFileName() { if ($this->_id) { $templateFile = "CRM/Event/Page/{$this->_id}/EventInfo.tpl"; $template = CRM_Core_Page::getTemplate(); diff --git a/CRM/Event/Page/ICalendar.php b/CRM/Event/Page/ICalendar.php index 1fe0bdfc42..47c9ab9fbb 100644 --- a/CRM/Event/Page/ICalendar.php +++ b/CRM/Event/Page/ICalendar.php @@ -48,7 +48,7 @@ class CRM_Event_Page_ICalendar extends CRM_Core_Page { * * @return void */ - function run() { + public function run() { $id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, NULL, 'GET'); $type = CRM_Utils_Request::retrieve('type', 'Positive', $this, FALSE, 0); $start = CRM_Utils_Request::retrieve('start', 'Positive', $this, FALSE, 0); diff --git a/CRM/Event/Page/ManageEvent.php b/CRM/Event/Page/ManageEvent.php index 99efc7c7f8..3d439a686b 100644 --- a/CRM/Event/Page/ManageEvent.php +++ b/CRM/Event/Page/ManageEvent.php @@ -61,7 +61,7 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_actionLinks)) { // helper variable for nicer formatting $copyExtra = ts('Are you sure you want to make a copy of this Event?'); @@ -104,7 +104,7 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page { * * @return array (reference) of tab links */ - static function &tabs($enableCart) { + public static function &tabs($enableCart) { $cacheKey = $enableCart ? 1 : 0; if (!(self::$_tabLinks)) { self::$_tabLinks = array(); @@ -189,7 +189,7 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { // get the requested action $action = CRM_Utils_Request::retrieve('action', 'String', // default to 'browse' @@ -245,7 +245,7 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page { * * @return void */ - function browse() { + public function browse() { $this->assign('includeWysiwygEditor', TRUE); $this->_sortByCharacter = CRM_Utils_Request::retrieve('sortByCharacter', 'String', @@ -401,7 +401,7 @@ ORDER BY start_date desc * @return void * @access public */ - function copy() { + public function copy() { $id = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE, 0, 'GET'); $urlString = 'civicrm/event/manage'; @@ -416,7 +416,7 @@ ORDER BY start_date desc return CRM_Utils_System::redirect(CRM_Utils_System::url($urlString, $urlParams)); } - function search() { + public function search() { if (isset($this->_action) & (CRM_Core_Action::ADD | CRM_Core_Action::UPDATE | @@ -440,7 +440,7 @@ ORDER BY start_date desc * * @return string */ - function whereClause(&$params, $sortBy = TRUE, $force) { + public function whereClause(&$params, $sortBy = TRUE, $force) { $values = array(); $clauses = array(); $title = $this->get('title'); @@ -532,7 +532,7 @@ ORDER BY start_date desc * @param $whereClause * @param array $whereParams */ - function pager($whereClause, $whereParams) { + public function pager($whereClause, $whereParams) { $params['status'] = ts('Event %%StatusMessage%%'); $params['csvString'] = NULL; @@ -558,7 +558,7 @@ SELECT count(id) * @param $whereClause * @param array $whereParams */ - function pagerAtoZ($whereClause, $whereParams) { + public function pagerAtoZ($whereClause, $whereParams) { $query = " SELECT DISTINCT UPPER(LEFT(title, 1)) as sort_name diff --git a/CRM/Event/Page/ParticipantListing.php b/CRM/Event/Page/ParticipantListing.php index c6f72dfd16..5df4b91eb5 100644 --- a/CRM/Event/Page/ParticipantListing.php +++ b/CRM/Event/Page/ParticipantListing.php @@ -41,7 +41,7 @@ class CRM_Event_Page_ParticipantListing extends CRM_Core_Page { protected $_eventTitle; protected $_pager; - function preProcess() { + public function preProcess() { $this->_id = CRM_Utils_Request::retrieve('id', 'Integer', $this, TRUE); // ensure that there is a particpant type for this @@ -64,7 +64,7 @@ class CRM_Event_Page_ParticipantListing extends CRM_Core_Page { $this->assign('displayRecent', FALSE); } - function run() { + public function run() { $this->preProcess(); // get the class name from the participantListingID diff --git a/CRM/Event/Page/ParticipantListing/Name.php b/CRM/Event/Page/ParticipantListing/Name.php index 1dbd18558c..cc488d987b 100644 --- a/CRM/Event/Page/ParticipantListing/Name.php +++ b/CRM/Event/Page/ParticipantListing/Name.php @@ -33,7 +33,7 @@ * */ class CRM_Event_Page_ParticipantListing_Name extends CRM_Event_Page_ParticipantListing_Simple { - function preProcess() { + public function preProcess() { $this->_participantListingType == 'Name'; parent::preProcess(); diff --git a/CRM/Event/Page/ParticipantListing/NameAndEmail.php b/CRM/Event/Page/ParticipantListing/NameAndEmail.php index bada75bbb1..dc085f811d 100644 --- a/CRM/Event/Page/ParticipantListing/NameAndEmail.php +++ b/CRM/Event/Page/ParticipantListing/NameAndEmail.php @@ -33,7 +33,7 @@ * */ class CRM_Event_Page_ParticipantListing_NameAndEmail extends CRM_Event_Page_ParticipantListing_Simple { - function preProcess() { + public function preProcess() { $this->_participantListingType = 'Name and Email'; parent::preProcess(); diff --git a/CRM/Event/Page/ParticipantListing/NameStatusAndDate.php b/CRM/Event/Page/ParticipantListing/NameStatusAndDate.php index 973396493d..39f73247c7 100644 --- a/CRM/Event/Page/ParticipantListing/NameStatusAndDate.php +++ b/CRM/Event/Page/ParticipantListing/NameStatusAndDate.php @@ -42,7 +42,7 @@ class CRM_Event_Page_ParticipantListing_NameStatusAndDate extends CRM_Core_Page protected $_pager; - function preProcess() { + public function preProcess() { $this->_id = CRM_Utils_Request::retrieve('id', 'Integer', $this, TRUE); // ensure that there is a particpant type for this @@ -68,7 +68,7 @@ class CRM_Event_Page_ParticipantListing_NameStatusAndDate extends CRM_Core_Page /** * @return string */ - function run() { + public function run() { $this->preProcess(); $fromClause = " @@ -125,7 +125,7 @@ LIMIT $offset, $rowCount"; * @param $whereClause * @param array $whereParams */ - function pager($fromClause, $whereClause, $whereParams) { + public function pager($fromClause, $whereClause, $whereParams) { $params = array(); @@ -151,7 +151,7 @@ SELECT count( civicrm_contact.id ) /** * @return string */ - function orderBy() { + public function orderBy() { static $headers = NULL; if (!$headers) { $headers = array(); diff --git a/CRM/Event/Page/ParticipantListing/Simple.php b/CRM/Event/Page/ParticipantListing/Simple.php index 0e6fa9a750..fc4bf73bfc 100644 --- a/CRM/Event/Page/ParticipantListing/Simple.php +++ b/CRM/Event/Page/ParticipantListing/Simple.php @@ -42,7 +42,7 @@ class CRM_Event_Page_ParticipantListing_Simple extends CRM_Core_Page { protected $_pager; - function preProcess() { + public function preProcess() { $this->_id = CRM_Utils_Request::retrieve('id', 'Integer', $this, TRUE); // retrieve Event Title and include it in page title @@ -59,7 +59,7 @@ class CRM_Event_Page_ParticipantListing_Simple extends CRM_Core_Page { /** * @return string */ - function run() { + public function run() { $this->preProcess(); $fromClause = " @@ -112,7 +112,7 @@ LIMIT $offset, $rowCount"; * @param $whereClause * @param array $whereParams */ - function pager($fromClause, $whereClause, $whereParams) { + public function pager($fromClause, $whereClause, $whereParams) { $params = array(); @@ -139,7 +139,7 @@ SELECT count( civicrm_contact.id ) /** * @return string */ - function orderBy() { + public function orderBy() { static $headers = NULL; if (!$headers) { $headers = array(); diff --git a/CRM/Event/Page/Tab.php b/CRM/Event/Page/Tab.php index cdec192852..b3592d608b 100644 --- a/CRM/Event/Page/Tab.php +++ b/CRM/Event/Page/Tab.php @@ -43,7 +43,7 @@ class CRM_Event_Page_Tab extends CRM_Core_Page { * return null * @access public */ - function browse() { + public function browse() { $controller = new CRM_Core_Controller_Simple( 'CRM_Event_Form_Search', ts('Events'), @@ -76,7 +76,7 @@ class CRM_Event_Page_Tab extends CRM_Core_Page { * return null * @access public */ - function view() { + public function view() { // build associated contributions $this->associatedContribution(); @@ -98,7 +98,7 @@ class CRM_Event_Page_Tab extends CRM_Core_Page { * return null * @access public */ - function edit() { + public function edit() { // set https for offline cc transaction $mode = CRM_Utils_Request::retrieve('mode', 'String', $this); if ($mode == 'test' || $mode == 'live') { @@ -123,7 +123,7 @@ class CRM_Event_Page_Tab extends CRM_Core_Page { return $controller->run(); } - function preProcess() { + public function preProcess() { $context = CRM_Utils_Request::retrieve('context', 'String', $this); $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); @@ -154,7 +154,7 @@ class CRM_Event_Page_Tab extends CRM_Core_Page { * return null * @access public */ - function run() { + public function run() { $this->preProcess(); // check if we can process credit card registration @@ -186,7 +186,7 @@ class CRM_Event_Page_Tab extends CRM_Core_Page { return parent::run(); } - function setContext() { + public function setContext() { $context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'search' ); @@ -290,7 +290,7 @@ class CRM_Event_Page_Tab extends CRM_Core_Page { * return null * @access public */ - function associatedContribution() { + public function associatedContribution() { if (CRM_Core_Permission::access('CiviContribute')) { $this->assign('accessContribution', TRUE); $controller = new CRM_Core_Controller_Simple( diff --git a/CRM/Event/Page/UserDashboard.php b/CRM/Event/Page/UserDashboard.php index 730fb1024e..c6ac521a58 100644 --- a/CRM/Event/Page/UserDashboard.php +++ b/CRM/Event/Page/UserDashboard.php @@ -44,7 +44,7 @@ class CRM_Event_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoard { * return null * @access public */ - function listParticipations() { + public function listParticipations() { $controller = new CRM_Core_Controller_Simple( 'CRM_Event_Form_Search', ts('Events'), @@ -67,7 +67,7 @@ class CRM_Event_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoard { * return null * @access public */ - function run() { + public function run() { parent::preProcess(); $this->listParticipations(); } diff --git a/CRM/Event/PseudoConstant.php b/CRM/Event/PseudoConstant.php index 8f83d4a2d1..782d8339a0 100644 --- a/CRM/Event/PseudoConstant.php +++ b/CRM/Event/PseudoConstant.php @@ -168,7 +168,7 @@ class CRM_Event_PseudoConstant extends CRM_Core_PseudoConstant { * * @return array of status classes, keyed by status type */ - static function &participantStatusClass() { + public static function &participantStatusClass() { static $statusClasses = NULL; if ($statusClasses === NULL) { diff --git a/CRM/Event/Selector/Search.php b/CRM/Event/Selector/Search.php index 198ee5a726..e3e179e040 100644 --- a/CRM/Event/Selector/Search.php +++ b/CRM/Event/Selector/Search.php @@ -202,7 +202,7 @@ class CRM_Event_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co * @access public * */ - function setLimit($limit) { + public function setLimit($limit) { $this->_limit = $limit; } @@ -220,7 +220,7 @@ class CRM_Event_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co * @return array * @access public */ - static function &links($qfKey = NULL, $context = NULL, $compContext = NULL) { + public static function &links($qfKey = NULL, $context = NULL, $compContext = NULL) { $extraParams = NULL; if ($compContext) { $extraParams .= "&compContext={$compContext}"; @@ -267,7 +267,7 @@ class CRM_Event_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co * * @access public */ - function getPagerParams($action, &$params) { + public function getPagerParams($action, &$params) { $params['status'] = ts('Event') . ' %%StatusMessage%%'; $params['csvString'] = NULL; if ($this->_limit) { @@ -289,7 +289,7 @@ class CRM_Event_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co * @return int Total number of rows * @access public */ - function getTotalCount($action) { + public function getTotalCount($action) { return $this->_query->searchQuery(0, 0, NULL, TRUE, FALSE, FALSE, FALSE, @@ -309,7 +309,7 @@ class CRM_Event_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co * * @return array rows in the given offset and rowCount */ - function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { + public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { $result = $this->_query->searchQuery($offset, $rowCount, $sort, FALSE, FALSE, FALSE, FALSE, @@ -508,14 +508,14 @@ class CRM_Event_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co /** * @return mixed */ - function alphabetQuery() { + public function alphabetQuery() { return $this->_query->searchQuery(NULL, NULL, NULL, FALSE, FALSE, TRUE); } /** * @return string */ - function &getQuery() { + public function &getQuery() { return $this->_query; } @@ -526,7 +526,7 @@ class CRM_Event_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co * * @return string name of the file */ - function getExportFileName($output = 'csv') { + public function getExportFileName($output = 'csv') { return ts('CiviCRM Event Search'); } } diff --git a/CRM/Event/StateMachine/Registration.php b/CRM/Event/StateMachine/Registration.php index 88c510d748..fced7f72c3 100644 --- a/CRM/Event/StateMachine/Registration.php +++ b/CRM/Event/StateMachine/Registration.php @@ -47,7 +47,7 @@ class CRM_Event_StateMachine_Registration extends CRM_Core_StateMachine { * * @return \CRM_Event_StateMachine_Registration CRM_Event_StateMachine */ - function __construct($controller, $action = CRM_Core_Action::NONE) { + public function __construct($controller, $action = CRM_Core_Action::NONE) { parent::__construct($controller, $action); $id = CRM_Utils_Request::retrieve('id', 'Positive', $controller, TRUE); $is_monetary = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $id, 'is_monetary'); diff --git a/CRM/Event/StateMachine/Search.php b/CRM/Event/StateMachine/Search.php index 1531aa66c3..0f3ae11033 100644 --- a/CRM/Event/StateMachine/Search.php +++ b/CRM/Event/StateMachine/Search.php @@ -45,7 +45,7 @@ class CRM_Event_StateMachine_Search extends CRM_Core_StateMachine { /** * Class constructor */ - function __construct($controller, $action = CRM_Core_Action::NONE) { + public function __construct($controller, $action = CRM_Core_Action::NONE) { parent::__construct($controller, $action); $this->_pages = array(); @@ -82,7 +82,7 @@ class CRM_Event_StateMachine_Search extends CRM_Core_StateMachine { * @return string the name of the form that will handle the task * @access protected */ - function taskName($controller, $formName = 'Search') { + public function taskName($controller, $formName = 'Search') { // total hack, check POST vars and then session to determine stuff $value = CRM_Utils_Array::value('task', $_POST); if (!isset($value)) { @@ -98,7 +98,7 @@ class CRM_Event_StateMachine_Search extends CRM_Core_StateMachine { * @return string * @access public */ - function getTaskFormName() { + public function getTaskFormName() { return CRM_Utils_String::getClassName($this->_task); } @@ -107,7 +107,7 @@ class CRM_Event_StateMachine_Search extends CRM_Core_StateMachine { * we dont want to issue a reset of the state session when we are done processing a task * */ - function shouldReset() { + public function shouldReset() { return FALSE; } } diff --git a/CRM/Event/Task.php b/CRM/Event/Task.php index 1de1be8bdb..cff96825eb 100644 --- a/CRM/Event/Task.php +++ b/CRM/Event/Task.php @@ -69,7 +69,7 @@ class CRM_Event_Task { * @static * @access public */ - static function &tasks() { + public static function &tasks() { if (!(self::$_tasks)) { self::$_tasks = array(1 => array( 'title' => ts('Delete Participants'), @@ -157,7 +157,7 @@ class CRM_Event_Task { * @static * @access public */ - static function &taskTitles() { + public static function &taskTitles() { self::tasks(); $titles = array(); foreach (self::$_tasks as $id => $value) { @@ -176,7 +176,7 @@ class CRM_Event_Task { * @static * @access public */ - static function &optionalTaskTitle() { + public static function &optionalTaskTitle() { $tasks = array( 14 => self::$_tasks[14]['title'], ); @@ -192,7 +192,7 @@ class CRM_Event_Task { * @return array set of tasks that are valid for the user * @access public */ - static function &permissionedTaskTitles($permission) { + public static function &permissionedTaskTitles($permission) { $tasks = array(); if (($permission == CRM_Core_Permission::EDIT) || CRM_Core_Permission::check('edit event participants') @@ -223,7 +223,7 @@ class CRM_Event_Task { * @static * @access public */ - static function getTask($value) { + public static function getTask($value) { self::tasks(); if (!$value || !CRM_Utils_Array::value($value, self::$_tasks)) { // make the print task by default diff --git a/CRM/Export/BAO/Export.php b/CRM/Export/BAO/Export.php index 83cbbed772..f81515b4dd 100644 --- a/CRM/Export/BAO/Export.php +++ b/CRM/Export/BAO/Export.php @@ -1178,7 +1178,7 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c * * @return string name of the file */ - static function getExportFileName($output = 'csv', $mode = CRM_Export_Form_Select::CONTACT_EXPORT) { + public static function getExportFileName($output = 'csv', $mode = CRM_Export_Form_Select::CONTACT_EXPORT) { switch ($mode) { case CRM_Export_Form_Select::CONTACT_EXPORT: return ts('CiviCRM Contact Search'); @@ -1210,7 +1210,7 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c * Handle import error file creation. * */ - static function invoke() { + public static function invoke() { $type = CRM_Utils_Request::retrieve('type', 'Positive', CRM_Core_DAO::$_nullObject); $parserName = CRM_Utils_Request::retrieve('parser', 'String', CRM_Core_DAO::$_nullObject); if (empty($parserName) || empty($type)) { @@ -1252,7 +1252,7 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c * @param $formValues * @param $order */ - static function exportCustom($customSearchClass, $formValues, $order) { + public static function exportCustom($customSearchClass, $formValues, $order) { $ext = CRM_Extension_System::singleton()->getMapper(); if (!$ext->isExtensionClass($customSearchClass)) { require_once (str_replace('_', DIRECTORY_SEPARATOR, $customSearchClass) . '.php'); @@ -1301,7 +1301,7 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c * @param $sqlColumns * @param $field */ - static function sqlColumnDefn(&$query, &$sqlColumns, $field) { + public static function sqlColumnDefn(&$query, &$sqlColumns, $field) { if (substr($field, -4) == '_a_b' || substr($field, -4) == '_b_a') { return; } @@ -1427,7 +1427,7 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c * @param $details * @param $sqlColumns */ - static function writeDetailsToTable($tableName, &$details, &$sqlColumns) { + public static function writeDetailsToTable($tableName, &$details, &$sqlColumns) { if (empty($details)) { return; } @@ -1475,7 +1475,7 @@ VALUES $sqlValueString * * @return string */ - static function createTempTable(&$sqlColumns) { + public static function createTempTable(&$sqlColumns) { //creating a temporary table for the search result that need be exported $exportTempTable = CRM_Core_DAO::createTempTableName('civicrm_export', TRUE); @@ -1521,7 +1521,7 @@ CREATE TABLE {$exportTempTable} ( * @param $sqlColumns * @param array $exportParams */ - static function mergeSameAddress($tableName, &$headerRows, &$sqlColumns, $exportParams) { + public static function mergeSameAddress($tableName, &$headerRows, &$sqlColumns, $exportParams) { // check if any records are present based on if they have used shared address feature, // and not based on if city / state .. matches. $sql = " @@ -1629,7 +1629,7 @@ WHERE id IN ( $deleteIDString ) * * @return array */ - static function _replaceMergeTokens($contactId, $exportParams) { + public static function _replaceMergeTokens($contactId, $exportParams) { $greetings = array(); $contact = NULL; @@ -1692,7 +1692,7 @@ WHERE id IN ( $deleteIDString ) * * @return array */ - static function _buildMasterCopyArray($sql, $exportParams, $sharedAddress = FALSE) { + public static function _buildMasterCopyArray($sql, $exportParams, $sharedAddress = FALSE) { static $contactGreetingTokens = array(); $addresseeOptions = CRM_Core_OptionGroup::values('addressee'); @@ -1797,7 +1797,7 @@ WHERE id IN ( $deleteIDString ) * @param array $sqlColumns array of names of the table columns of the temp table * @param string $prefix name of the relationship type that is prefixed to the table columns */ - static function mergeSameHousehold($exportTempTable, &$headerRows, &$sqlColumns, $prefix) { + public static function mergeSameHousehold($exportTempTable, &$headerRows, &$sqlColumns, $prefix) { $prefixColumn = $prefix . '_'; $allKeys = array_keys($sqlColumns); $replaced = array(); @@ -1878,7 +1878,7 @@ GROUP BY civicrm_primary_id "; * @param null $saveFile * @param string $batchItems */ - static function writeCSVFromTable($exportTempTable, $headerRows, $sqlColumns, $exportMode, $saveFile = null, $batchItems = '') { + public static function writeCSVFromTable($exportTempTable, $headerRows, $sqlColumns, $exportMode, $saveFile = null, $batchItems = '') { $writeHeader = TRUE; $offset = 0; $limit = self::EXPORT_ROW_COUNT; @@ -1945,7 +1945,7 @@ LIMIT $offset, $limit * or have no street address * */ - static function postalMailingFormat($exportTempTable, &$headerRows, &$sqlColumns, $exportParams) { + public static function postalMailingFormat($exportTempTable, &$headerRows, &$sqlColumns, $exportParams) { $whereClause = array(); if (array_key_exists('is_deceased', $sqlColumns)) { @@ -1997,7 +1997,7 @@ WHERE {$whereClause}"; /** * Build componentPayment fields. */ - static function componentPaymentFields() { + public static function componentPaymentFields() { static $componentPaymentFields; if (!isset( $componentPaymentFields)) { $componentPaymentFields = array( diff --git a/CRM/Export/Form/Map.php b/CRM/Export/Form/Map.php index 19bb775df8..8a0b417e41 100644 --- a/CRM/Export/Form/Map.php +++ b/CRM/Export/Form/Map.php @@ -119,7 +119,7 @@ class CRM_Export_Form_Map extends CRM_Core_Form { * @static * @access public */ - static function formRule($fields, $values, $mappingTypeId) { + public static function formRule($fields, $values, $mappingTypeId) { $errors = array(); if (!empty($fields['saveMapping']) && !empty($fields['_qf_Map_next'])) { diff --git a/CRM/Export/Form/Select.php b/CRM/Export/Form/Select.php index 452ead1f1a..8740f5039b 100644 --- a/CRM/Export/Form/Select.php +++ b/CRM/Export/Form/Select.php @@ -78,7 +78,7 @@ class CRM_Export_Form_Select extends CRM_Core_Form { * @return void * @access public */ - function preProcess() { + public function preProcess() { //special case for custom search, directly give option to download csv file $customSearchID = $this->get('customSearchID'); if ($customSearchID) { @@ -448,7 +448,7 @@ FROM {$this->_componentTable} * Build mapping form element * */ - function buildMapping() { + public function buildMapping() { switch ($this->_exportMode) { case CRM_Export_Form_Select::CONTACT_EXPORT: $exportType = 'Export Contact'; @@ -495,7 +495,7 @@ FROM {$this->_componentTable} /** * @return array */ - static function getGreetingOptions() { + public static function getGreetingOptions() { $options = array(); $greetings = array( 'postal_greeting' => 'postal_greeting_other', diff --git a/CRM/Extension/Downloader.php b/CRM/Extension/Downloader.php index 0e3d50bcd0..4a2c41ee50 100644 --- a/CRM/Extension/Downloader.php +++ b/CRM/Extension/Downloader.php @@ -191,7 +191,7 @@ class CRM_Extension_Downloader { * * @return bool */ - function validateFiles($key, $extractedZipPath) { + public function validateFiles($key, $extractedZipPath) { $filename = $extractedZipPath . DIRECTORY_SEPARATOR . CRM_Extension_Info::FILENAME; if (!is_readable($filename)) { CRM_Core_Session::setStatus(ts('Failed reading data from %1 during installation', array(1 => $filename)), ts('Installation Error'), 'error'); diff --git a/CRM/Extension/Info.php b/CRM/Extension/Info.php index ab83734a1b..851e7f4604 100644 --- a/CRM/Extension/Info.php +++ b/CRM/Extension/Info.php @@ -86,7 +86,7 @@ class CRM_Extension_Info { * @param null $label * @param null $file */ - function __construct($key = NULL, $type = NULL, $name = NULL, $label = NULL, $file = NULL) { + public function __construct($key = NULL, $type = NULL, $name = NULL, $label = NULL, $file = NULL) { $this->key = $key; $this->type = $type; $this->name = $name; diff --git a/CRM/Extension/Manager.php b/CRM/Extension/Manager.php index f992c62872..17af419eae 100644 --- a/CRM/Extension/Manager.php +++ b/CRM/Extension/Manager.php @@ -106,7 +106,7 @@ class CRM_Extension_Manager { * @param CRM_Extension_Mapper $mapper * @param $typeManagers */ - function __construct(CRM_Extension_Container_Interface $fullContainer, $defaultContainer, CRM_Extension_Mapper $mapper, $typeManagers) { + public function __construct(CRM_Extension_Container_Interface $fullContainer, $defaultContainer, CRM_Extension_Mapper $mapper, $typeManagers) { $this->fullContainer = $fullContainer; $this->defaultContainer = $defaultContainer; $this->mapper = $mapper; diff --git a/CRM/Extension/Upgrades.php b/CRM/Extension/Upgrades.php index d179cb3428..18a4869bd7 100644 --- a/CRM/Extension/Upgrades.php +++ b/CRM/Extension/Upgrades.php @@ -42,7 +42,7 @@ class CRM_Extension_Upgrades { * * @return bool */ - static function hasPending() { + public static function hasPending() { $checks = CRM_Utils_Hook::upgrade('check'); if (is_array($checks)) { foreach ($checks as $check) { @@ -60,7 +60,7 @@ class CRM_Extension_Upgrades { * * @return CRM_Queue_Queue */ - static function createQueue() { + public static function createQueue() { $queue = CRM_Queue_Service::singleton()->create(array( 'type' => 'Sql', 'name' => self::QUEUE_NAME, diff --git a/CRM/Financial/BAO/ExportFormat.php b/CRM/Financial/BAO/ExportFormat.php index 00347247b3..727d1d9316 100644 --- a/CRM/Financial/BAO/ExportFormat.php +++ b/CRM/Financial/BAO/ExportFormat.php @@ -54,7 +54,7 @@ class CRM_Financial_BAO_ExportFormat { /** * Class constructor */ - function __construct() { + public function __construct() { if ( !isset( self::$_template ) ) { self::$_template = CRM_Core_Smarty::singleton(); } @@ -66,7 +66,7 @@ class CRM_Financial_BAO_ExportFormat { * * @return mixed */ - function export($exportParams) { + public function export($exportParams) { $this->_exportParams = $exportParams; return $exportParams; } @@ -74,7 +74,7 @@ class CRM_Financial_BAO_ExportFormat { /** * @param null $fileName */ - function output($fileName = NULL) { + public function output($fileName = NULL) { switch ($this->getFileExtension()) { case 'csv': self::createActivityExport($this->_batchIds, $fileName); @@ -92,14 +92,14 @@ class CRM_Financial_BAO_ExportFormat { /** * @return string */ - function getMimeType() { + public function getMimeType() { return 'text/plain'; } /** * @return string */ - function getFileExtension() { + public function getFileExtension() { return 'txt'; } @@ -107,14 +107,14 @@ class CRM_Financial_BAO_ExportFormat { /** * @return null */ - function getTemplateFileName() { + public function getTemplateFileName() { return null; } /** * @return object */ - static function &getTemplate() { + public static function &getTemplate() { return self::$_template; } @@ -122,7 +122,7 @@ class CRM_Financial_BAO_ExportFormat { * @param $var * @param null $value */ - function assign($var, $value = NULL) { + public function assign($var, $value = NULL) { self::$_template->assign($var, $value); } @@ -138,7 +138,7 @@ class CRM_Financial_BAO_ExportFormat { * * @return null */ - static function format($s, $type = 'string') { + public static function format($s, $type = 'string') { if (!empty($s)) { return $s; } @@ -147,7 +147,7 @@ class CRM_Financial_BAO_ExportFormat { } } - function initiateDownload() { + public function initiateDownload() { $config = CRM_Core_Config::singleton(); //zip files if more than one. if (count($this->_downloadFile)>1) { @@ -181,7 +181,7 @@ class CRM_Financial_BAO_ExportFormat { * * @throws CRM_Core_Exception */ - static function createActivityExport($batchIds, $fileName) { + public static function createActivityExport($batchIds, $fileName) { $session = CRM_Core_Session::singleton(); $values = array(); $params = array('id' => $batchIds); @@ -233,7 +233,7 @@ class CRM_Financial_BAO_ExportFormat { * * @return bool */ - function createZip($files = array(), $destination = NULL, $overwrite = FALSE) { + public function createZip($files = array(), $destination = NULL, $overwrite = FALSE) { //if the zip file already exists and overwrite is false, return false if (file_exists($destination) && !$overwrite) { return FALSE; diff --git a/CRM/Financial/BAO/ExportFormat/CSV.php b/CRM/Financial/BAO/ExportFormat/CSV.php index 287a83653f..8cc6eed97f 100644 --- a/CRM/Financial/BAO/ExportFormat/CSV.php +++ b/CRM/Financial/BAO/ExportFormat/CSV.php @@ -50,14 +50,14 @@ class CRM_Financial_BAO_ExportFormat_CSV extends CRM_Financial_BAO_ExportFormat /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } /** * @param array $exportParams */ - function export($exportParams) { + public function export($exportParams) { $export = parent::export($exportParams); // Save the file in the public directory @@ -79,7 +79,7 @@ class CRM_Financial_BAO_ExportFormat_CSV extends CRM_Financial_BAO_ExportFormat * * @return Object */ - function generateExportQuery($batchId) { + public function generateExportQuery($batchId) { $sql = "SELECT ft.id as financial_trxn_id, ft.trxn_date, @@ -132,7 +132,7 @@ class CRM_Financial_BAO_ExportFormat_CSV extends CRM_Financial_BAO_ExportFormat * * @return string */ - function putFile($export) { + public function putFile($export) { $config = CRM_Core_Config::singleton(); $fileName = $config->uploadDir.'Financial_Transactions_'.$this->_batchIds.'_'.date('YmdHis').'.'.$this->getFileExtension(); $this->_downloadFile[] = $config->customFileUploadDir.CRM_Utils_File::cleanFileName(basename($fileName)); @@ -154,7 +154,7 @@ class CRM_Financial_BAO_ExportFormat_CSV extends CRM_Financial_BAO_ExportFormat * @param array $values * @return array */ - function formatHeaders($values) { + public function formatHeaders($values) { $arrayKeys = array_keys($values); $headers = ''; if (!empty($arrayKeys)) { @@ -171,7 +171,7 @@ class CRM_Financial_BAO_ExportFormat_CSV extends CRM_Financial_BAO_ExportFormat * @param array $export * */ - function makeCSV($export) { + public function makeCSV($export) { foreach ($export as $batchId => $dao) { $financialItems = array(); $this->_batchIds = $batchId; @@ -219,16 +219,16 @@ class CRM_Financial_BAO_ExportFormat_CSV extends CRM_Financial_BAO_ExportFormat /** * @return string */ - function getFileExtension() { + public function getFileExtension() { return 'csv'; } - function exportACCNT() { + public function exportACCNT() { } - function exportCUST() { + public function exportCUST() { } - function exportTRANS() { + public function exportTRANS() { } } diff --git a/CRM/Financial/BAO/ExportFormat/IIF.php b/CRM/Financial/BAO/ExportFormat/IIF.php index 0254c1f687..7ccaa5c2c2 100644 --- a/CRM/Financial/BAO/ExportFormat/IIF.php +++ b/CRM/Financial/BAO/ExportFormat/IIF.php @@ -53,7 +53,7 @@ class CRM_Financial_BAO_ExportFormat_IIF extends CRM_Financial_BAO_ExportFormat /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); self::$SEPARATOR = chr(9); } @@ -61,7 +61,7 @@ class CRM_Financial_BAO_ExportFormat_IIF extends CRM_Financial_BAO_ExportFormat /** * @param array $exportParams */ - function export( $exportParams ) { + public function export( $exportParams ) { parent::export( $exportParams ); foreach( self::$complementaryTables as $rct ) { @@ -80,7 +80,7 @@ class CRM_Financial_BAO_ExportFormat_IIF extends CRM_Financial_BAO_ExportFormat * * @return string */ - function putFile($out) { + public function putFile($out) { $config = CRM_Core_Config::singleton(); $fileName = $config->uploadDir.'Financial_Transactions_'.$this->_batchIds.'_'.date('YmdHis').'.'.$this->getFileExtension(); $this->_downloadFile[] = $config->customFileUploadDir.CRM_Utils_File::cleanFileName(basename($fileName)); @@ -95,7 +95,7 @@ class CRM_Financial_BAO_ExportFormat_IIF extends CRM_Financial_BAO_ExportFormat * * @return Object */ - function generateExportQuery($batchId) { + public function generateExportQuery($batchId) { $sql = "SELECT ft.id as financial_trxn_id, @@ -147,7 +147,7 @@ class CRM_Financial_BAO_ExportFormat_IIF extends CRM_Financial_BAO_ExportFormat /** * @param $export */ - function makeIIF($export) { + public function makeIIF($export) { // Keep running list of accounts and contacts used in this batch, since we need to // include those in the output. Only want to include ones used in the batch, not everything in the db, // since would increase the chance of messing up user's existing Quickbooks entries. @@ -298,36 +298,36 @@ class CRM_Financial_BAO_ExportFormat_IIF extends CRM_Financial_BAO_ExportFormat parent::initiateDownload(); } - function exportACCNT() { + public function exportACCNT() { self::assign( 'accounts', $this->_exportParams['accounts'] ); } - function exportCUST() { + public function exportCUST() { self::assign( 'contacts', $this->_exportParams['contacts'] ); } - function exportTRANS() { + public function exportTRANS() { self::assign( 'journalEntries', $this->_exportParams['journalEntries'] ); } /** * @return string */ - function getMimeType() { + public function getMimeType() { return 'application/octet-stream'; } /** * @return string */ - function getFileExtension() { + public function getFileExtension() { return 'iif'; } /** * @return string */ - function getHookedTemplateFileName() { + public function getHookedTemplateFileName() { return 'CRM/Financial/ExportFormat/IIF.tpl'; } @@ -341,7 +341,7 @@ class CRM_Financial_BAO_ExportFormat_IIF extends CRM_Financial_BAO_ExportFormat * * @return bool|mixed|string */ - static function format($s, $type = 'string') { + public static function format($s, $type = 'string') { // If I remember right there's a couple things: // NOTEPAD field needs to be surrounded by quotes and then get rid of double quotes inside, also newlines should be literal \n, and ditch any ascii 0x0d's. // Date handling has changed over the years. It used to only understand mm/dd/yy but I think now it might depend on your OS settings. Sometimes mm/dd/yyyy works but sometimes it wants yyyy/mm/dd, at least where I had used it. diff --git a/CRM/Financial/BAO/FinancialAccount.php b/CRM/Financial/BAO/FinancialAccount.php index 8331273ad9..6e4902d527 100644 --- a/CRM/Financial/BAO/FinancialAccount.php +++ b/CRM/Financial/BAO/FinancialAccount.php @@ -44,7 +44,7 @@ class CRM_Financial_BAO_FinancialAccount extends CRM_Financial_DAO_FinancialAcco /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -58,7 +58,7 @@ class CRM_Financial_BAO_FinancialAccount extends CRM_Financial_DAO_FinancialAcco * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $financialAccount = new CRM_Financial_DAO_FinancialAccount(); $financialAccount->copyValues($params); if ($financialAccount->find(TRUE)) { @@ -77,7 +77,7 @@ class CRM_Financial_BAO_FinancialAccount extends CRM_Financial_DAO_FinancialAcco * @return Object DAO object on sucess, null otherwise * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Financial_DAO_FinancialAccount', $id, 'is_active', $is_active); } @@ -91,7 +91,7 @@ class CRM_Financial_BAO_FinancialAccount extends CRM_Financial_DAO_FinancialAcco * @static * @return object */ - static function add(&$params, &$ids = array()) { + public static function add(&$params, &$ids = array()) { if(empty($params['id'])) { $params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE); $params['is_deductible'] = CRM_Utils_Array::value('is_deductible', $params, FALSE); @@ -121,7 +121,7 @@ class CRM_Financial_BAO_FinancialAccount extends CRM_Financial_DAO_FinancialAcco * @param int $financialAccountId * @static */ - static function del($financialAccountId) { + public static function del($financialAccountId) { //checking if financial type is present $check = FALSE; @@ -161,7 +161,7 @@ class CRM_Financial_BAO_FinancialAccount extends CRM_Financial_DAO_FinancialAcco * @return accounting code * @static */ - static function getAccountingCode($financialTypeId) { + public static function getAccountingCode($financialTypeId) { $relationTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Income Account is' ")); $query = "SELECT cfa.accounting_code FROM civicrm_financial_type cft @@ -188,7 +188,7 @@ WHERE cft.id = %1 * @return integer count * @static */ - static function getARAccounts($financialAccountId, $financialAccountTypeId = NULL, $accountTypeCode = 'ar') { + public static function getARAccounts($financialAccountId, $financialAccountTypeId = NULL, $accountTypeCode = 'ar') { if (!$financialAccountTypeId) { $financialAccountType = CRM_Core_PseudoConstant::accountOptionValues('financial_account_type'); $financialAccountTypeId = array_search('Asset', $financialAccountType); diff --git a/CRM/Financial/BAO/FinancialItem.php b/CRM/Financial/BAO/FinancialItem.php index 273abab038..0e5c6d70bf 100644 --- a/CRM/Financial/BAO/FinancialItem.php +++ b/CRM/Financial/BAO/FinancialItem.php @@ -38,7 +38,7 @@ class CRM_Financial_BAO_FinancialItem extends CRM_Financial_DAO_FinancialItem { /** * Class constructor */ - function __construct( ) { + public function __construct( ) { parent::__construct( ); } @@ -52,7 +52,7 @@ class CRM_Financial_BAO_FinancialItem extends CRM_Financial_DAO_FinancialItem { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $financialItem = new CRM_Financial_DAO_FinancialItem(); $financialItem->copyValues($params); if ($financialItem->find(TRUE)) { @@ -73,7 +73,7 @@ class CRM_Financial_BAO_FinancialItem extends CRM_Financial_DAO_FinancialItem { * @static * @return void */ - static function add($lineItem, $contribution, $taxTrxnID = FALSE) { + public static function add($lineItem, $contribution, $taxTrxnID = FALSE) { $contributionStatuses = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); $financialItemStatus = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_FinancialItem', 'status_id'); $itemStatus = NULL; @@ -137,7 +137,7 @@ class CRM_Financial_BAO_FinancialItem extends CRM_Financial_DAO_FinancialItem { * @static * @return object */ - static function create(&$params, $ids = NULL, $trxnIds = NULL) { + public static function create(&$params, $ids = NULL, $trxnIds = NULL) { $financialItem = new CRM_Financial_DAO_FinancialItem(); if (!empty($ids['id'])) { @@ -186,7 +186,7 @@ class CRM_Financial_BAO_FinancialItem extends CRM_Financial_DAO_FinancialItem { * @access public * @static */ - static function createEntityTrxn($params) { + public static function createEntityTrxn($params) { $entity_trxn = new CRM_Financial_DAO_EntityFinancialTrxn(); $entity_trxn->copyValues($params); $entity_trxn->save(); @@ -203,7 +203,7 @@ class CRM_Financial_BAO_FinancialItem extends CRM_Financial_DAO_FinancialItem { * @access public * @static */ - static function retrieveEntityFinancialTrxn($params, $maxId = FALSE) { + public static function retrieveEntityFinancialTrxn($params, $maxId = FALSE) { $financialItem = new CRM_Financial_DAO_EntityFinancialTrxn(); $financialItem->copyValues($params); //retrieve last entry from civicrm_entity_financial_trxn @@ -242,7 +242,7 @@ class CRM_Financial_BAO_FinancialItem extends CRM_Financial_DAO_FinancialItem { * @access public * @static */ - static function checkContactPresent($contactIds, &$error) { + public static function checkContactPresent($contactIds, &$error) { if (empty($contactIds)) { return FALSE; } diff --git a/CRM/Financial/BAO/FinancialType.php b/CRM/Financial/BAO/FinancialType.php index d6fa29d64a..7bc5023782 100644 --- a/CRM/Financial/BAO/FinancialType.php +++ b/CRM/Financial/BAO/FinancialType.php @@ -44,7 +44,7 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType { /** * Class constructor */ - function __construct( ) { + public function __construct( ) { parent::__construct( ); } @@ -58,7 +58,7 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType { * @access public * @static */ - static function retrieve( &$params, &$defaults ) { + public static function retrieve( &$params, &$defaults ) { $financialType = new CRM_Financial_DAO_FinancialType( ); $financialType->copyValues( $params ); if ($financialType->find(true)) { @@ -77,7 +77,7 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType { * @return Object DAO object on sucess, null otherwise * @static */ - static function setIsActive( $id, $is_active ) { + public static function setIsActive( $id, $is_active ) { return CRM_Core_DAO::setFieldValue( 'CRM_Financial_DAO_FinancialType', $id, 'is_active', $is_active ); } @@ -91,7 +91,7 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType { * @static * @return object */ - static function add(&$params, &$ids = array()) { + public static function add(&$params, &$ids = array()) { if(empty($params['id'])) { $params['is_active'] = CRM_Utils_Array::value('is_active', $params, false); $params['is_deductible'] = CRM_Utils_Array::value('is_deductible', $params, false); @@ -121,7 +121,7 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType { * @return array|bool * @static */ - static function del($financialTypeId) { + public static function del($financialTypeId) { $financialType = new CRM_Financial_DAO_FinancialType( ); $financialType->id = $financialTypeId; $financialType->find(true); @@ -167,7 +167,7 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType { * @return array all financial type with income account is relationship * @static */ - static function getIncomeFinancialType() { + public static function getIncomeFinancialType() { // Financial Type $financialType = CRM_Contribute_PseudoConstant::financialType(); $revenueFinancialType = array(); diff --git a/CRM/Financial/BAO/FinancialTypeAccount.php b/CRM/Financial/BAO/FinancialTypeAccount.php index c10a71a52e..cb5abe0510 100644 --- a/CRM/Financial/BAO/FinancialTypeAccount.php +++ b/CRM/Financial/BAO/FinancialTypeAccount.php @@ -38,7 +38,7 @@ class CRM_Financial_BAO_FinancialTypeAccount extends CRM_Financial_DAO_EntityFin /** * Class constructor */ - function __construct( ) { + public function __construct( ) { parent::__construct( ); } @@ -61,7 +61,7 @@ class CRM_Financial_BAO_FinancialTypeAccount extends CRM_Financial_DAO_EntityFin * @access public * @static */ - static function retrieve(&$params, &$defaults, &$allValues = array()) { + public static function retrieve(&$params, &$defaults, &$allValues = array()) { $financialTypeAccount = new CRM_Financial_DAO_EntityFinancialAccount(); $financialTypeAccount->copyValues($params); $financialTypeAccount->find(); @@ -82,7 +82,7 @@ class CRM_Financial_BAO_FinancialTypeAccount extends CRM_Financial_DAO_EntityFin * @static * @return object */ - static function add(&$params, &$ids = NULL) { + public static function add(&$params, &$ids = NULL) { // action is taken depending upon the mode $financialTypeAccount = new CRM_Financial_DAO_EntityFinancialAccount(); if ($params['entity_table'] != 'civicrm_financial_type') { @@ -109,7 +109,7 @@ class CRM_Financial_BAO_FinancialTypeAccount extends CRM_Financial_DAO_EntityFin * * @static */ - static function del($financialTypeAccountId, $accountId = null) { + public static function del($financialTypeAccountId, $accountId = null) { //checking if financial type is present $check = false; $relationValues = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_EntityFinancialAccount', 'account_relationship'); @@ -169,7 +169,7 @@ class CRM_Financial_BAO_FinancialTypeAccount extends CRM_Financial_DAO_EntityFin * @return null|string * @static */ - static function getFinancialAccount($entityId, $entityTable, $columnName = 'name') { + public static function getFinancialAccount($entityId, $entityTable, $columnName = 'name') { $join = $columnName == 'name' ? 'LEFT JOIN civicrm_financial_account ON civicrm_entity_financial_account.financial_account_id = civicrm_financial_account.id' : NULL; $query = " SELECT {$columnName} @@ -193,7 +193,7 @@ AND entity_id = %2"; * @return array|null|string * @static */ - static function getInstrumentFinancialAccount($paymentInstrumentValue = NULL) { + public static function getInstrumentFinancialAccount($paymentInstrumentValue = NULL) { if (!self::$financialAccount) { $query = "SELECT ceft.financial_account_id, cov.value FROM civicrm_entity_financial_account ceft @@ -227,7 +227,7 @@ WHERE cog.name = 'payment_instrument' "; * @return array * @static */ - static function createDefaultFinancialAccounts($financialType) { + public static function createDefaultFinancialAccounts($financialType) { $titles = array(); $financialAccountTypeID = CRM_Core_PseudoConstant::accountOptionValues('financial_account_type'); $accountRelationship = CRM_Core_PseudoConstant::accountOptionValues('account_relationship'); diff --git a/CRM/Financial/BAO/PaymentProcessor.php b/CRM/Financial/BAO/PaymentProcessor.php index 54024be93c..bc03b75853 100644 --- a/CRM/Financial/BAO/PaymentProcessor.php +++ b/CRM/Financial/BAO/PaymentProcessor.php @@ -51,7 +51,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces * @return CRM_Financial_DAO_PaymentProcessor * @throws Exception */ - static function create($params) { + public static function create($params) { // FIXME Reconcile with CRM_Admin_Form_PaymentProcessor::updatePaymentProcessor $processor = new CRM_Financial_DAO_PaymentProcessor(); $processor->copyValues($params); @@ -87,7 +87,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -103,7 +103,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $paymentProcessor = new CRM_Financial_DAO_PaymentProcessor(); $paymentProcessor->copyValues($params); if ($paymentProcessor->find(TRUE)) { @@ -124,7 +124,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces * @access public * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Financial_DAO_PaymentProcessor', $id, 'is_active', $is_active); } @@ -138,7 +138,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces * @static * @access public */ - static function &getDefault() { + public static function &getDefault() { if (self::$_defaultPaymentProcessor == NULL) { $params = array('is_default' => 1); $defaults = array(); @@ -156,7 +156,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces * @access public * @static */ - static function del($paymentProcessorID) { + public static function del($paymentProcessorID) { if (!$paymentProcessorID) { CRM_Core_Error::fatal(ts('Invalid value passed to delete function.')); } @@ -185,7 +185,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces * @static * @access public */ - static function getPayment($paymentProcessorID, $mode) { + public static function getPayment($paymentProcessorID, $mode) { if (!$paymentProcessorID) { CRM_Core_Error::fatal(ts('Invalid value passed to getPayment function')); } @@ -219,7 +219,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces * @return array * @throws Exception */ - static function getPayments($paymentProcessorIDs, $mode) { + public static function getPayments($paymentProcessorIDs, $mode) { if (!$paymentProcessorIDs) { CRM_Core_Error::fatal(ts('Invalid value passed to getPayment function')); } @@ -241,7 +241,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces * @param array_type $processor2 * @return number */ - static function defaultComparison($processor1, $processor2){ + public static function defaultComparison($processor1, $processor2){ $p1 = CRM_Utils_Array::value('is_default', $processor1); $p2 = CRM_Utils_Array::value('is_default', $processor2); if ($p1 == $p2) { @@ -260,7 +260,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces * @static * @access public */ - static function buildPayment($dao, $mode) { + public static function buildPayment($dao, $mode) { $fields = array( 'id', 'name', 'payment_processor_type_id', 'user_name', 'password', 'signature', 'url_site', 'url_api', 'url_recur', 'url_button', @@ -287,7 +287,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces * @throws CiviCRM_API3_Exception * @return array */ - static function getAllPaymentProcessors($isExcludeTest, $reset = FALSE) { + public static function getAllPaymentProcessors($isExcludeTest, $reset = FALSE) { /** * $cacheKey = 'CRM_Financial_BAO_Payment_Processor_' . ($isExcludeTest ? 'test' : 'all'); if (!$reset) { @@ -324,7 +324,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces * * @return array available processors */ - static function getPaymentProcessors($capabilities = array(), $isIncludeTest = FALSE, $ids = array()) { + public static function getPaymentProcessors($capabilities = array(), $isIncludeTest = FALSE, $ids = array()) { $processors = self::getAllPaymentProcessors(!$isIncludeTest); if ($capabilities) { foreach ($processors as $index => $processor) { @@ -353,7 +353,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces * * @return bool */ - static function hasPaymentProcessorSupporting($capabilities = array(), $isIncludeTest = FALSE) { + public static function hasPaymentProcessorSupporting($capabilities = array(), $isIncludeTest = FALSE) { $result = self::getPaymentProcessors($capabilities, $isIncludeTest); return (!empty($result)) ? TRUE : FALSE; } @@ -369,7 +369,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces * @static * @access public */ - static function getProcessorForEntity($entityID, $component = 'contribute', $type = 'id') { + public static function getProcessorForEntity($entityID, $component = 'contribute', $type = 'id') { $result = NULL; if (!in_array($component, array( 'membership', 'contribute', 'recur'))) { diff --git a/CRM/Financial/BAO/PaymentProcessorType.php b/CRM/Financial/BAO/PaymentProcessorType.php index f8625082e5..f97b3e998a 100644 --- a/CRM/Financial/BAO/PaymentProcessorType.php +++ b/CRM/Financial/BAO/PaymentProcessorType.php @@ -42,7 +42,7 @@ class CRM_Financial_BAO_PaymentProcessorType extends CRM_Financial_DAO_PaymentPr /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -56,7 +56,7 @@ class CRM_Financial_BAO_PaymentProcessorType extends CRM_Financial_DAO_PaymentPr * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $paymentProcessorType = new CRM_Financial_DAO_PaymentProcessorType(); $paymentProcessorType->copyValues($params); if ($paymentProcessorType->find(TRUE)) { @@ -77,7 +77,7 @@ class CRM_Financial_BAO_PaymentProcessorType extends CRM_Financial_DAO_PaymentPr * @access public * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Financial_DAO_PaymentProcessorType', $id, 'is_active', $is_active); } @@ -91,7 +91,7 @@ class CRM_Financial_BAO_PaymentProcessorType extends CRM_Financial_DAO_PaymentPr * @static * @access public */ - static function &getDefault() { + public static function &getDefault() { if (self::$_defaultPaymentProcessorType == NULL) { $params = array('is_default' => 1); $defaults = array(); @@ -110,7 +110,7 @@ class CRM_Financial_BAO_PaymentProcessorType extends CRM_Financial_DAO_PaymentPr * @access public * @static */ - static function create(&$params) { + public static function create(&$params) { $paymentProcessorType = new CRM_Financial_DAO_PaymentProcessorType(); $paymentProcessorType->copyValues($params); @@ -178,7 +178,7 @@ class CRM_Financial_BAO_PaymentProcessorType extends CRM_Financial_DAO_PaymentPr * @access public * @static */ - static function del($paymentProcessorTypeId) { + public static function del($paymentProcessorTypeId) { $query = " SELECT pp.id processor_id FROM civicrm_payment_processor pp, civicrm_payment_processor_type ppt diff --git a/CRM/Financial/Form/BatchTransaction.php b/CRM/Financial/Form/BatchTransaction.php index 3b4fe17f7b..9fe8187bbc 100644 --- a/CRM/Financial/Form/BatchTransaction.php +++ b/CRM/Financial/Form/BatchTransaction.php @@ -47,7 +47,7 @@ class CRM_Financial_Form_BatchTransaction extends CRM_Contribute_Form { */ protected $_batchStatusId; - function preProcess() { + public function preProcess() { self::$_entityID = CRM_Utils_Request::retrieve( 'bid' , 'Positive' ) ? CRM_Utils_Request::retrieve( 'bid' , 'Positive' ) : $_POST['batch_id']; $this->assign('entityID', self::$_entityID); if (isset(self::$_entityID)) { @@ -159,7 +159,7 @@ class CRM_Financial_Form_BatchTransaction extends CRM_Contribute_Form { $this->add('text', 'name', ts('Batch Name')); } - function setDefaultValues() { + public function setDefaultValues() { // do not setdefault unless it is open batch if ($this->_batchStatusId != 1 ) { return; @@ -175,7 +175,7 @@ class CRM_Financial_Form_BatchTransaction extends CRM_Contribute_Form { /** * @return array|null */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( 'view' => array( diff --git a/CRM/Financial/Form/Export.php b/CRM/Financial/Form/Export.php index 00dffa440e..b3fc958260 100644 --- a/CRM/Financial/Form/Export.php +++ b/CRM/Financial/Form/Export.php @@ -69,7 +69,7 @@ class CRM_Financial_Form_Export extends CRM_Core_Form { * @return void * @access public */ - function preProcess() { + public function preProcess() { $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); // this mean it's a batch action @@ -118,7 +118,7 @@ class CRM_Financial_Form_Export extends CRM_Core_Form { * @access public * @return void */ - function buildQuickForm() { + public function buildQuickForm() { // this mean it's a batch action if (!empty($this->_batchIds)) { $batchNames = CRM_Batch_BAO_Batch::getBatchNames($this->_batchIds); diff --git a/CRM/Financial/Form/FinancialAccount.php b/CRM/Financial/Form/FinancialAccount.php index c848a4e913..d523175c9d 100644 --- a/CRM/Financial/Form/FinancialAccount.php +++ b/CRM/Financial/Form/FinancialAccount.php @@ -140,7 +140,7 @@ class CRM_Financial_Form_FinancialAccount extends CRM_Contribute_Form { * @static * @access public */ - static function formRule( $values, $files, $self ) { + public static function formRule( $values, $files, $self ) { $errorMsg = array( ); $financialAccountTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('financial_account_type', NULL, " AND v.name LIKE 'Liability' ")); if (isset($values['is_tax'])) { @@ -180,7 +180,7 @@ class CRM_Financial_Form_FinancialAccount extends CRM_Contribute_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = parent::setDefaultValues(); if ($this->_action & CRM_Core_Action::ADD) { $defaults['contact_id'] = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Domain', CRM_Core_Config::domainID(), 'contact_id'); diff --git a/CRM/Financial/Form/FinancialBatch.php b/CRM/Financial/Form/FinancialBatch.php index ca08535a96..653efcef86 100644 --- a/CRM/Financial/Form/FinancialBatch.php +++ b/CRM/Financial/Form/FinancialBatch.php @@ -157,7 +157,7 @@ class CRM_Financial_Form_FinancialBatch extends CRM_Contribute_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = parent::setDefaultValues(); if ($this->_id) { @@ -183,7 +183,7 @@ class CRM_Financial_Form_FinancialBatch extends CRM_Contribute_Form { * @static * @access public */ - static function formRule($values, $files, $self) { + public static function formRule($values, $files, $self) { $errors = array(); if (!empty($values['contact_name']) && !is_numeric($values['created_id'])) { $errors['contact_name'] = ts('Please select a valid contact.'); @@ -303,7 +303,7 @@ class CRM_Financial_Form_FinancialBatch extends CRM_Contribute_Form { * @static * @access public */ - function checkPermissions($action, $permissions, $createdID, $userContactID, $actionName) { + public function checkPermissions($action, $permissions, $createdID, $userContactID, $actionName) { if ((CRM_Core_Permission::check($permissions[0]) || CRM_Core_Permission::check($permissions[1]))) { if (CRM_Core_Permission::check($permissions[0]) && $userContactID != $createdID && !CRM_Core_Permission::check($permissions[1])) { CRM_Core_Error::statusBounce(ts('You dont have permission to %1 this batch'), array(1 => $actionName)); diff --git a/CRM/Financial/Form/FinancialTypeAccount.php b/CRM/Financial/Form/FinancialTypeAccount.php index a1ce434179..00cec20f27 100644 --- a/CRM/Financial/Form/FinancialTypeAccount.php +++ b/CRM/Financial/Form/FinancialTypeAccount.php @@ -244,7 +244,7 @@ class CRM_Financial_Form_FinancialTypeAccount extends CRM_Contribute_Form { * @static * @access public */ - static function formRule($values, $files, $self) { + public static function formRule($values, $files, $self) { $errorMsg = array(); $errorFlag = FALSE; if ($self->_action == CRM_Core_Action::DELETE) { diff --git a/CRM/Financial/Form/Search.php b/CRM/Financial/Form/Search.php index 60276e779f..adad8c3573 100644 --- a/CRM/Financial/Form/Search.php +++ b/CRM/Financial/Form/Search.php @@ -36,7 +36,7 @@ class CRM_Financial_Form_Search extends CRM_Core_Form { public $_batchStatus; - function preProcess() { + public function preProcess() { $this->_batchStatus = CRM_Utils_Request::retrieve('batchStatus', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, NULL); $this->assign('batchStatus', $this->_batchStatus); } @@ -44,7 +44,7 @@ class CRM_Financial_Form_Search extends CRM_Core_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $status = CRM_Utils_Request::retrieve('status', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, 1); $defaults['batch_update'] = $status; @@ -119,7 +119,7 @@ class CRM_Financial_Form_Search extends CRM_Core_Form { parent::buildQuickForm(); } - function postProcess() { + public function postProcess() { $batchIds = array(); foreach ($_POST as $key => $value) { if (substr($key,0,6) == "check_") { diff --git a/CRM/Financial/Page/AJAX.php b/CRM/Financial/Page/AJAX.php index 21d64eeff8..451cb41b8e 100644 --- a/CRM/Financial/Page/AJAX.php +++ b/CRM/Financial/Page/AJAX.php @@ -46,7 +46,7 @@ class CRM_Financial_Page_AJAX { /** * @param $config */ - static function jqFinancial($config) { + public static function jqFinancial($config) { if (!isset($_GET['_value']) || empty($_GET['_value'])) { CRM_Utils_System::civiExit(); @@ -97,7 +97,7 @@ class CRM_Financial_Page_AJAX { /** * @param $config */ - static function jqFinancialRelation($config) { + public static function jqFinancialRelation($config) { if (!isset($_GET['_value']) || empty($_GET['_value'])) { CRM_Utils_System::civiExit(); @@ -156,7 +156,7 @@ class CRM_Financial_Page_AJAX { /** * @param $config */ - static function jqFinancialType($config) { + public static function jqFinancialType($config) { if (! isset($_GET['_value']) || empty($_GET['_value'])) { CRM_Utils_System::civiExit(); @@ -169,7 +169,7 @@ class CRM_Financial_Page_AJAX { /** * Callback to perform action on batch records. */ - static function assignRemove() { + public static function assignRemove() { $op = CRM_Utils_Type::escape($_POST['op'], 'String'); $recordBAO = CRM_Utils_Type::escape($_POST['recordBAO'], 'String'); foreach ($_POST['records'] as $record) { @@ -258,7 +258,7 @@ class CRM_Financial_Page_AJAX { CRM_Utils_JSON::output($response); } - static function getFinancialTransactionsList() { + public static function getFinancialTransactionsList() { $sortMapper = array( 0 => '', 1 => '', 2 => 'sort_name', @@ -451,7 +451,7 @@ class CRM_Financial_Page_AJAX { CRM_Utils_System::civiExit(); } - static function bulkAssignRemove() { + public static function bulkAssignRemove() { $checkIDs = $_REQUEST['ID']; $entityID = CRM_Utils_Type::escape($_REQUEST['entityID'], 'String'); $action = CRM_Utils_Type::escape($_REQUEST['action'], 'String'); @@ -490,7 +490,7 @@ class CRM_Financial_Page_AJAX { CRM_Utils_JSON::output($status); } - static function getBatchSummary() { + public static function getBatchSummary() { $batchID = CRM_Utils_Type::escape($_REQUEST['batchID'], 'String'); $params = array('id' => $batchID); $batchInfo = CRM_Batch_BAO_Batch::retrieve($params, $value); diff --git a/CRM/Financial/Page/Batch.php b/CRM/Financial/Page/Batch.php index e3f36d2908..dfab755512 100644 --- a/CRM/Financial/Page/Batch.php +++ b/CRM/Financial/Page/Batch.php @@ -51,7 +51,7 @@ class CRM_Financial_Page_Batch extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Batch_BAO_Batch'; } @@ -60,14 +60,14 @@ class CRM_Financial_Page_Batch extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() {} + public function &links() {} /** * Get name of edit form * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Financial_Form_FinancialBatch'; } @@ -76,7 +76,7 @@ class CRM_Financial_Page_Batch extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return ts('Accounting Batch Processing'); } @@ -87,7 +87,7 @@ class CRM_Financial_Page_Batch extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return CRM_Utils_System::currentPath(); } @@ -97,13 +97,13 @@ class CRM_Financial_Page_Batch extends CRM_Core_Page_Basic { * @return void * @access public */ - function browse() { + public function browse() { $status = CRM_Utils_Request::retrieve('status', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, 1); $this->assign('status', $status); $this->search(); } - function search() { + public function search() { if ($this->_action & (CRM_Core_Action::ADD | CRM_Core_Action::UPDATE | diff --git a/CRM/Financial/Page/BatchTransaction.php b/CRM/Financial/Page/BatchTransaction.php index 606d041ae3..83fa36b889 100644 --- a/CRM/Financial/Page/BatchTransaction.php +++ b/CRM/Financial/Page/BatchTransaction.php @@ -54,7 +54,7 @@ class CRM_Financial_Page_BatchTransaction extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Batch_BAO_Batch'; } @@ -63,7 +63,7 @@ class CRM_Financial_Page_BatchTransaction extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( 'view' => array( @@ -93,7 +93,7 @@ class CRM_Financial_Page_BatchTransaction extends CRM_Core_Page_Basic { * @access public * */ - function run() { + public function run() { // get the requested action $action = CRM_Utils_Request::retrieve('action', 'String', $this, false, 'browse'); // default to 'browse' @@ -126,7 +126,7 @@ class CRM_Financial_Page_BatchTransaction extends CRM_Core_Page_Basic { * @access public * @static */ - function browse() { + public function browse() { } /** @@ -134,7 +134,7 @@ class CRM_Financial_Page_BatchTransaction extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Financial_Form_BatchTransaction'; } @@ -143,7 +143,7 @@ class CRM_Financial_Page_BatchTransaction extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'Batch'; } @@ -154,7 +154,7 @@ class CRM_Financial_Page_BatchTransaction extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = null) { + public function userContext($mode = null) { return 'civicrm/batchtransaction'; } } diff --git a/CRM/Financial/Page/FinancialAccount.php b/CRM/Financial/Page/FinancialAccount.php index 40033e0b0b..76069947e8 100644 --- a/CRM/Financial/Page/FinancialAccount.php +++ b/CRM/Financial/Page/FinancialAccount.php @@ -52,7 +52,7 @@ class CRM_Financial_Page_FinancialAccount extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Financial_BAO_FinancialAccount'; } @@ -61,7 +61,7 @@ class CRM_Financial_Page_FinancialAccount extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::UPDATE => array( @@ -102,7 +102,7 @@ class CRM_Financial_Page_FinancialAccount extends CRM_Core_Page_Basic { * @access public * */ - function run() { + public function run() { // get the requested action $action = CRM_Utils_Request::retrieve('action', 'String', $this, false, 'browse'); // default to 'browse' @@ -127,7 +127,7 @@ class CRM_Financial_Page_FinancialAccount extends CRM_Core_Page_Basic { * @access public * @static */ - function browse() { + public function browse() { // get all custom groups sorted by weight $contributionType = array(); $dao = new CRM_Financial_DAO_FinancialAccount(); @@ -172,7 +172,7 @@ class CRM_Financial_Page_FinancialAccount extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Financial_Form_FinancialAccount'; } @@ -181,7 +181,7 @@ class CRM_Financial_Page_FinancialAccount extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'Financial Types'; } @@ -192,7 +192,7 @@ class CRM_Financial_Page_FinancialAccount extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = null) { + public function userContext($mode = null) { return 'civicrm/admin/financial/financialAccount'; } } diff --git a/CRM/Financial/Page/FinancialBatch.php b/CRM/Financial/Page/FinancialBatch.php index 5a8ce6b325..e2057037f8 100644 --- a/CRM/Financial/Page/FinancialBatch.php +++ b/CRM/Financial/Page/FinancialBatch.php @@ -51,7 +51,7 @@ class CRM_Financial_Page_FinancialBatch extends CRM_Core_Page_Basic { * * @return string classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Batch_BAO_Batch'; } @@ -60,7 +60,7 @@ class CRM_Financial_Page_FinancialBatch extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array(); } @@ -78,7 +78,7 @@ class CRM_Financial_Page_FinancialBatch extends CRM_Core_Page_Basic { * @access public * */ - function run() { + public function run() { $context = CRM_Utils_Request::retrieve('context', 'String', $this); $this->set("context", $context); // assign vars to templates @@ -104,7 +104,7 @@ class CRM_Financial_Page_FinancialBatch extends CRM_Core_Page_Basic { * * @return string classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Financial_Form_FinancialBatch'; } @@ -113,7 +113,7 @@ class CRM_Financial_Page_FinancialBatch extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'Accounting Batch'; } @@ -126,7 +126,7 @@ class CRM_Financial_Page_FinancialBatch extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = null) { + public function userContext($mode = null) { $context = $this->get("context"); if ($mode == CRM_Core_Action::UPDATE || ($mode = CRM_Core_Action::ADD & isset($context))) { return "civicrm/financial/financialbatches"; @@ -139,7 +139,7 @@ class CRM_Financial_Page_FinancialBatch extends CRM_Core_Page_Basic { * * @return string */ - function userContextParams($mode = NULL) { + public function userContextParams($mode = NULL) { $context = $this->get("context"); if ($mode == CRM_Core_Action::UPDATE || ($mode = CRM_Core_Action::ADD & isset($context))) { return "reset=1&batchStatus={$context}"; diff --git a/CRM/Financial/Page/FinancialType.php b/CRM/Financial/Page/FinancialType.php index 7783beea38..1b35c36c2c 100644 --- a/CRM/Financial/Page/FinancialType.php +++ b/CRM/Financial/Page/FinancialType.php @@ -52,7 +52,7 @@ class CRM_Financial_Page_FinancialType extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Financial_BAO_FinancialType'; } @@ -61,7 +61,7 @@ class CRM_Financial_Page_FinancialType extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::BROWSE => array( @@ -108,7 +108,7 @@ class CRM_Financial_Page_FinancialType extends CRM_Core_Page_Basic { * @access public * */ - function run() { + public function run() { // get the requested action $action = CRM_Utils_Request::retrieve('action', 'String', $this, false, 'browse'); // default to 'browse' @@ -133,7 +133,7 @@ class CRM_Financial_Page_FinancialType extends CRM_Core_Page_Basic { * @access public * @static */ - function browse() { + public function browse() { // get all financial types sorted by weight $financialType = array(); $dao = new CRM_Financial_DAO_FinancialType(); @@ -198,7 +198,7 @@ class CRM_Financial_Page_FinancialType extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Financial_Form_FinancialType'; } @@ -207,7 +207,7 @@ class CRM_Financial_Page_FinancialType extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'Financial Types'; } @@ -218,7 +218,7 @@ class CRM_Financial_Page_FinancialType extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = null) { + public function userContext($mode = null) { return 'civicrm/admin/financial/financialType'; } } diff --git a/CRM/Financial/Page/FinancialTypeAccount.php b/CRM/Financial/Page/FinancialTypeAccount.php index ed59964bc0..35d0bbfda1 100644 --- a/CRM/Financial/Page/FinancialTypeAccount.php +++ b/CRM/Financial/Page/FinancialTypeAccount.php @@ -58,7 +58,7 @@ class CRM_Financial_Page_FinancialTypeAccount extends CRM_Core_Page { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Financial_BAO_FinancialTypeAccount'; } @@ -67,7 +67,7 @@ class CRM_Financial_Page_FinancialTypeAccount extends CRM_Core_Page { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::UPDATE => array( @@ -98,7 +98,7 @@ class CRM_Financial_Page_FinancialTypeAccount extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { // get the requested action $action = CRM_Utils_Request::retrieve('action', 'String', $this, false, 'browse'); // default to 'browse' @@ -126,7 +126,7 @@ class CRM_Financial_Page_FinancialTypeAccount extends CRM_Core_Page { * @access public * @static */ - function browse() { + public function browse() { // get all Financial Type Account data sorted by weight $financialType = array(); $params = array(); @@ -207,7 +207,7 @@ class CRM_Financial_Page_FinancialTypeAccount extends CRM_Core_Page { * @return void * @access public */ - function edit( $action ) { + public function edit( $action ) { // create a simple controller for editing CiviCRM Profile data $controller = new CRM_Core_Controller_Simple( 'CRM_Financial_Form_FinancialTypeAccount', ts('Financial Account Types'), $action ); diff --git a/CRM/Friend/BAO/Friend.php b/CRM/Friend/BAO/Friend.php index ffb563e291..8b54538dd3 100644 --- a/CRM/Friend/BAO/Friend.php +++ b/CRM/Friend/BAO/Friend.php @@ -41,7 +41,7 @@ class CRM_Friend_BAO_Friend extends CRM_Friend_DAO_Friend { /** * */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -58,7 +58,7 @@ class CRM_Friend_BAO_Friend extends CRM_Friend_DAO_Friend { * @access public * @static */ - static function add(&$params) { + public static function add(&$params) { $friend = CRM_Contact_BAO_Contact::createProfileContact($params, CRM_Core_DAO::$_nullArray); return $friend; } @@ -74,7 +74,7 @@ class CRM_Friend_BAO_Friend extends CRM_Friend_DAO_Friend { * @access public * @static */ - static function retrieve(&$params, &$values) { + public static function retrieve(&$params, &$values) { $friend = new CRM_Friend_DAO_Friend(); $friend->copyValues($params); @@ -95,7 +95,7 @@ class CRM_Friend_BAO_Friend extends CRM_Friend_DAO_Friend { * @access public * @static */ - static function create(&$params) { + public static function create(&$params) { $transaction = new CRM_Core_Transaction(); $mailParams = array(); @@ -243,7 +243,7 @@ class CRM_Friend_BAO_Friend extends CRM_Friend_DAO_Friend { * @return void * @access public */ - static function buildFriendForm($form) { + public static function buildFriendForm($form) { $form->addElement('checkbox', 'tf_is_active', ts('Tell a Friend enabled?'), NULL, array('onclick' => "friendBlock(this)")); // name $form->add('text', 'tf_title', ts('Title'), CRM_Core_DAO::getAttribute('CRM_Friend_DAO_Friend', 'title'), TRUE); @@ -274,7 +274,7 @@ class CRM_Friend_BAO_Friend extends CRM_Friend_DAO_Friend { * * @return booelan whether anything was found */ - static function getValues(&$defaults) { + public static function getValues(&$defaults) { if (empty($defaults)) { return NULL; } @@ -294,7 +294,7 @@ class CRM_Friend_BAO_Friend extends CRM_Friend_DAO_Friend { * @return void * @access public */ - static function sendMail($contactID, &$values) { + public static function sendMail($contactID, &$values) { list($fromName, $email) = CRM_Contact_BAO_Contact::getContactDetails($contactID); // if no $fromName (only email collected from originating contact) - list returns single space if (trim($fromName) == '') { @@ -345,7 +345,7 @@ class CRM_Friend_BAO_Friend extends CRM_Friend_DAO_Friend { * @access public * @static */ - static function addTellAFriend(&$params) { + public static function addTellAFriend(&$params) { $friendDAO = new CRM_Friend_DAO_Friend(); $friendDAO->copyValues($params); diff --git a/CRM/Friend/Form.php b/CRM/Friend/Form.php index 69fba3e339..31deffecfe 100644 --- a/CRM/Friend/Form.php +++ b/CRM/Friend/Form.php @@ -237,7 +237,7 @@ class CRM_Friend_Form extends CRM_Core_Form { * @access public * @static */ - static function formRule($fields) { + public static function formRule($fields) { $errors = array(); diff --git a/CRM/Grant/BAO/Grant.php b/CRM/Grant/BAO/Grant.php index 1c9aff8e75..b46e86aba2 100644 --- a/CRM/Grant/BAO/Grant.php +++ b/CRM/Grant/BAO/Grant.php @@ -44,7 +44,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -57,7 +57,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { * * @return array Array of event summary values */ - static function getGrantSummary($admin = FALSE) { + public static function getGrantSummary($admin = FALSE) { $query = " SELECT status_id, count(id) as status_total FROM civicrm_grant GROUP BY status_id"; @@ -95,7 +95,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { * * @return array Array of event summary values */ - static function getGrantStatusOptGroup() { + public static function getGrantStatusOptGroup() { $params = array(); $params['name'] = CRM_Grant_BAO_Grant::$statusGroupName; @@ -119,7 +119,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { * * @return array Array of grant summary statistics */ - static function getGrantStatistics($admin = FALSE) { + public static function getGrantStatistics($admin = FALSE) { $grantStatuses = array(); } @@ -133,7 +133,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $grant = new CRM_Grant_DAO_Grant(); $grant->copyValues($params); if ($grant->find(TRUE)) { @@ -154,7 +154,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { * * @return object */ - static function add(&$params, &$ids) { + public static function add(&$params, &$ids) { if (!empty($ids['grant_id'])) { CRM_Utils_Hook::pre('edit', 'Grant', $ids['grant_id'], $params); @@ -317,7 +317,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { * @access public * @static */ - static function deleteContact($id) { + public static function deleteContact($id) { $grant = new CRM_Grant_DAO_Grant(); $grant->contact_id = $id; $grant->delete(); @@ -334,7 +334,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { * @static * */ - static function del($id) { + public static function del($id) { CRM_Utils_Hook::pre('delete', 'Grant', $id, CRM_Core_DAO::$_nullArray); $grant = new CRM_Grant_DAO_Grant(); @@ -364,7 +364,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { * @access public * @static */ - static function &exportableFields() { + public static function &exportableFields() { if (!self::$_exportableFields) { if (!self::$_exportableFields) { self::$_exportableFields = array(); @@ -421,7 +421,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { * @access public * @static */ - static function getContactGrantCount($contactID) { + public static function getContactGrantCount($contactID) { $query = "SELECT count(*) FROM civicrm_grant WHERE civicrm_grant.contact_id = {$contactID} "; return CRM_Core_DAO::singleValueQuery($query); } diff --git a/CRM/Grant/BAO/Query.php b/CRM/Grant/BAO/Query.php index 50386ee78b..bb5b44833a 100644 --- a/CRM/Grant/BAO/Query.php +++ b/CRM/Grant/BAO/Query.php @@ -37,7 +37,7 @@ class CRM_Grant_BAO_Query { /** * @return array */ - static function &getFields() { + public static function &getFields() { $fields = array(); $fields = CRM_Grant_BAO_Grant::exportableFields(); return $fields; @@ -51,7 +51,7 @@ class CRM_Grant_BAO_Query { * @return void * @access public */ - static function select(&$query) { + public static function select(&$query) { if (($query->_mode & CRM_Contact_BAO_Query::MODE_GRANT) || !empty($query->_returnProperties)) { if (!empty($query->_returnProperties['grant_status_id'])) { $query->_select['grant_status_id'] = 'grant_status.id as grant_status_id'; @@ -108,7 +108,7 @@ class CRM_Grant_BAO_Query { * @return void * @access public */ - static function where(&$query) { + public static function where(&$query) { foreach ($query->_params as $id => $values) { if (!is_array($values) || count($values) != 5) { continue; @@ -124,7 +124,7 @@ class CRM_Grant_BAO_Query { * @param $values * @param $query */ - static function whereClauseSingle(&$values, &$query) { + public static function whereClauseSingle(&$values, &$query) { $strtolower = function_exists('mb_strtolower') ? 'mb_strtolower' : 'strtolower'; list($name, $op, $value, $grouping, $wildcard) = $values; $val = $names = array(); @@ -283,7 +283,7 @@ class CRM_Grant_BAO_Query { * * @return null|string */ - static function from($name, $mode, $side) { + public static function from($name, $mode, $side) { $from = NULL; switch ($name) { case 'civicrm_grant': @@ -319,7 +319,7 @@ class CRM_Grant_BAO_Query { * @return string * @access public */ - function qill() { + public function qill() { return (isset($this->_qill)) ? $this->_qill : ""; } @@ -362,7 +362,7 @@ class CRM_Grant_BAO_Query { * @return void * @static */ - static function buildSearchForm(&$form) { + public static function buildSearchForm(&$form) { $grantType = CRM_Core_OptionGroup::values('grant_type'); $form->add('select', 'grant_type_id', ts('Grant Type'), $grantType, FALSE, @@ -427,11 +427,11 @@ class CRM_Grant_BAO_Query { * @param $row * @param int $id */ - static function searchAction(&$row, $id) {} + public static function searchAction(&$row, $id) {} /** * @param $tables */ - static function tableNames(&$tables) {} + public static function tableNames(&$tables) {} } diff --git a/CRM/Grant/Controller/Search.php b/CRM/Grant/Controller/Search.php index e0415947f5..8b68f5f40b 100644 --- a/CRM/Grant/Controller/Search.php +++ b/CRM/Grant/Controller/Search.php @@ -49,7 +49,7 @@ class CRM_Grant_Controller_Search extends CRM_Core_Controller { /** * Class constructor */ - function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { + public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { parent::__construct($title, $modal); diff --git a/CRM/Grant/Form/Grant.php b/CRM/Grant/Form/Grant.php index ad947d8e55..432dbe72ee 100644 --- a/CRM/Grant/Form/Grant.php +++ b/CRM/Grant/Form/Grant.php @@ -120,7 +120,7 @@ class CRM_Grant_Form_Grant extends CRM_Core_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { if ($this->_cdType) { return CRM_Custom_Form_CustomData::setDefaultValues($this); } diff --git a/CRM/Grant/Form/Search.php b/CRM/Grant/Form/Search.php index 54729fe759..5d517e25de 100644 --- a/CRM/Grant/Form/Search.php +++ b/CRM/Grant/Form/Search.php @@ -167,7 +167,7 @@ class CRM_Grant_Form_Search extends CRM_Core_Form_Search { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { parent::buildQuickForm(); $this->addElement('text', 'sort_name', ts('Name or Email'), array('class' => 'twenty') + CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name')); @@ -203,7 +203,7 @@ class CRM_Grant_Form_Search extends CRM_Core_Form_Search { * @return void * @access public */ - function postProcess() { + public function postProcess() { if ($this->_done) { return; } @@ -280,11 +280,11 @@ class CRM_Grant_Form_Search extends CRM_Core_Form_Search { * * @return array the default array reference */ - function &setDefaultValues() { + public function &setDefaultValues() { return $this->_formValues; } - function fixFormValues() { + public function fixFormValues() { // if this search has been forced // then see if there are any get values, and if so over-ride the post values // note that this means that GET over-rides POST :) @@ -317,7 +317,7 @@ class CRM_Grant_Form_Search extends CRM_Core_Form_Search { /** * @return null */ - function getFormValues() { + public function getFormValues() { return NULL; } diff --git a/CRM/Grant/Form/Task.php b/CRM/Grant/Form/Task.php index 8363fba65b..9355db5b16 100644 --- a/CRM/Grant/Form/Task.php +++ b/CRM/Grant/Form/Task.php @@ -82,7 +82,7 @@ class CRM_Grant_Form_Task extends CRM_Core_Form { * @param CRM_Core_Form $form * @param bool $useTable */ - static function preProcessCommon(&$form, $useTable = FALSE) { + public static function preProcessCommon(&$form, $useTable = FALSE) { $form->_grantIds = array(); $values = $form->controller->exportValues('Search'); @@ -155,7 +155,7 @@ class CRM_Grant_Form_Task extends CRM_Core_Form { * @return void * @access public */ - function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { + public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { $this->addButtons(array( array( 'type' => $nextType, diff --git a/CRM/Grant/Form/Task/Delete.php b/CRM/Grant/Form/Task/Delete.php index c8e662978e..3508da9f69 100644 --- a/CRM/Grant/Form/Task/Delete.php +++ b/CRM/Grant/Form/Task/Delete.php @@ -69,7 +69,7 @@ class CRM_Grant_Form_Task_Delete extends CRM_Grant_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $this->addDefaultButtons(ts('Delete Grants'), 'done'); } diff --git a/CRM/Grant/Form/Task/Print.php b/CRM/Grant/Form/Task/Print.php index 3b158775f9..7fc6dc39f6 100644 --- a/CRM/Grant/Form/Task/Print.php +++ b/CRM/Grant/Form/Task/Print.php @@ -44,7 +44,7 @@ class CRM_Grant_Form_Task_Print extends CRM_Grant_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preprocess(); // set print view, so that print templates are called @@ -75,7 +75,7 @@ class CRM_Grant_Form_Task_Print extends CRM_Grant_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { // // just need to add a javacript to popup the window for printing // diff --git a/CRM/Grant/Form/Task/Result.php b/CRM/Grant/Form/Task/Result.php index f9f0bb406a..9910b0ef9f 100644 --- a/CRM/Grant/Form/Task/Result.php +++ b/CRM/Grant/Form/Task/Result.php @@ -46,7 +46,7 @@ class CRM_Grant_Form_Task_Result extends CRM_Grant_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { $session = CRM_Core_Session::singleton(); $this->set('searchRows', ''); diff --git a/CRM/Grant/Form/Task/SearchTaskHookSample.php b/CRM/Grant/Form/Task/SearchTaskHookSample.php index beeeef5bc3..7a08f068b0 100644 --- a/CRM/Grant/Form/Task/SearchTaskHookSample.php +++ b/CRM/Grant/Form/Task/SearchTaskHookSample.php @@ -44,7 +44,7 @@ class CRM_Grant_Form_Task_SearchTaskHookSample extends CRM_Grant_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); $rows = array(); // display name and grant details of all selectced contacts diff --git a/CRM/Grant/Form/Task/Update.php b/CRM/Grant/Form/Task/Update.php index 56b5452fe3..1859deff6d 100644 --- a/CRM/Grant/Form/Task/Update.php +++ b/CRM/Grant/Form/Task/Update.php @@ -46,7 +46,7 @@ class CRM_Grant_Form_Task_Update extends CRM_Grant_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); //check permission for update. @@ -62,7 +62,7 @@ class CRM_Grant_Form_Task_Update extends CRM_Grant_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $grantStatus = CRM_Core_PseudoConstant::get('CRM_Grant_DAO_Grant', 'status_id'); $this->addElement('select', 'status_id', ts('Grant Status'), array('' => '') + $grantStatus); diff --git a/CRM/Grant/Page/DashBoard.php b/CRM/Grant/Page/DashBoard.php index b063c3450f..4bc832f41d 100644 --- a/CRM/Grant/Page/DashBoard.php +++ b/CRM/Grant/Page/DashBoard.php @@ -46,7 +46,7 @@ class CRM_Grant_Page_DashBoard extends CRM_Core_Page { * @access public * */ - function preProcess() { + public function preProcess() { $admin = CRM_Core_Permission::check('administer CiviCRM'); $grantSummary = CRM_Grant_BAO_Grant::getGrantSummary($admin); @@ -62,7 +62,7 @@ class CRM_Grant_Page_DashBoard extends CRM_Core_Page { * return null * @access public */ - function run() { + public function run() { $this->preProcess(); $controller = new CRM_Core_Controller_Simple('CRM_Grant_Form_Search', ts('grants'), NULL); diff --git a/CRM/Grant/Page/Tab.php b/CRM/Grant/Page/Tab.php index b19c3fd25c..16c17724c1 100644 --- a/CRM/Grant/Page/Tab.php +++ b/CRM/Grant/Page/Tab.php @@ -76,7 +76,7 @@ class CRM_Grant_Page_Tab extends CRM_Contact_Page_View { * return null * @access public */ - function view() { + public function view() { $controller = new CRM_Core_Controller_Simple('CRM_Grant_Form_GrantView', 'View Grant', $this->_action); $controller->setEmbedded(TRUE); $controller->set('id', $this->_id); @@ -91,7 +91,7 @@ class CRM_Grant_Page_Tab extends CRM_Contact_Page_View { * return null * @access public */ - function edit() { + public function edit() { $controller = new CRM_Core_Controller_Simple('CRM_Grant_Form_Grant', 'Create grant', $this->_action); $controller->setEmbedded(TRUE); $controller->set('id', $this->_id); @@ -106,7 +106,7 @@ class CRM_Grant_Page_Tab extends CRM_Contact_Page_View { * @return void * @access public */ - function preProcess() { + public function preProcess() { $context = CRM_Utils_Request::retrieve('context', 'String', $this); $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); @@ -139,7 +139,7 @@ class CRM_Grant_Page_Tab extends CRM_Contact_Page_View { * return null * @access public */ - function run() { + public function run() { $this->preProcess(); $this->setContext(); @@ -156,7 +156,7 @@ class CRM_Grant_Page_Tab extends CRM_Contact_Page_View { return parent::run(); } - function setContext() { + public function setContext() { $context = CRM_Utils_Request::retrieve('context', 'String', $this); $this->_id = CRM_Utils_Request::retrieve('id', 'Integer', $this); $session = CRM_Core_Session::singleton(); diff --git a/CRM/Grant/Selector/Search.php b/CRM/Grant/Selector/Search.php index c464b71540..705c8f4c44 100644 --- a/CRM/Grant/Selector/Search.php +++ b/CRM/Grant/Selector/Search.php @@ -187,7 +187,7 @@ class CRM_Grant_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co * @return array * @access public */ - static function &links($key = NULL) { + public static function &links($key = NULL) { $cid = CRM_Utils_Request::retrieve('cid', 'Integer', $this); $extraParams = ($key) ? "&key={$key}" : NULL; @@ -229,7 +229,7 @@ class CRM_Grant_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co * * @access public */ - function getPagerParams($action, &$params) { + public function getPagerParams($action, &$params) { $params['status'] = ts('Grant') . ' %%StatusMessage%%'; $params['csvString'] = NULL; if ($this->_limit) { @@ -251,7 +251,7 @@ class CRM_Grant_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co * @return int Total number of rows * @access public */ - function getTotalCount($action) { + public function getTotalCount($action) { return $this->_query->searchQuery(0, 0, NULL, TRUE, FALSE, FALSE, FALSE, @@ -271,7 +271,7 @@ class CRM_Grant_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co * * @return int the total number of rows for this action */ - function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { + public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { $result = $this->_query->searchQuery($offset, $rowCount, $sort, FALSE, FALSE, FALSE, FALSE, @@ -408,7 +408,7 @@ class CRM_Grant_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co /** * @return string */ - function &getQuery() { + public function &getQuery() { return $this->_query; } @@ -419,7 +419,7 @@ class CRM_Grant_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co * * @return string name of the file */ - function getExportFileName($output = 'csv') { + public function getExportFileName($output = 'csv') { return ts('CiviCRM Grant Search'); } } diff --git a/CRM/Grant/StateMachine/Search.php b/CRM/Grant/StateMachine/Search.php index d88af8b61c..62c0a80ccf 100644 --- a/CRM/Grant/StateMachine/Search.php +++ b/CRM/Grant/StateMachine/Search.php @@ -81,7 +81,7 @@ class CRM_Grant_StateMachine_Search extends CRM_Core_StateMachine { * @return string the name of the form that will handle the task * @access protected */ - function taskName($controller, $formName = 'Search') { + public function taskName($controller, $formName = 'Search') { // total hack, check POST vars and then session to determine stuff $value = CRM_Utils_Array::value('task', $_POST); if (!isset($value)) { @@ -98,7 +98,7 @@ class CRM_Grant_StateMachine_Search extends CRM_Core_StateMachine { * @return string * @access public */ - function getTaskFormName() { + public function getTaskFormName() { return CRM_Utils_String::getClassName($this->_task); } } diff --git a/CRM/Grant/Task.php b/CRM/Grant/Task.php index 6eae921561..de43ebf301 100644 --- a/CRM/Grant/Task.php +++ b/CRM/Grant/Task.php @@ -65,7 +65,7 @@ class CRM_Grant_Task { * @static * @access public */ - static function &tasks() { + public static function &tasks() { if (!(self::$_tasks)) { self::$_tasks = array(1 => array( 'title' => ts('Delete Grants'), @@ -107,7 +107,7 @@ class CRM_Grant_Task { * @static * @access public */ - static function &taskTitles() { + public static function &taskTitles() { self::tasks(); $titles = array(); foreach (self::$_tasks as $id => $value) { @@ -125,7 +125,7 @@ class CRM_Grant_Task { * @return array set of tasks that are valid for the user * @access public */ - static function &permissionedTaskTitles($permission) { + public static function &permissionedTaskTitles($permission) { $tasks = array(); if (($permission == CRM_Core_Permission::EDIT) || CRM_Core_Permission::check('edit grants') @@ -153,7 +153,7 @@ class CRM_Grant_Task { * @static * @access public */ - static function getTask($value) { + public static function getTask($value) { self::tasks(); if (!$value || !CRM_Utils_Array::value($value, self::$_tasks)) { // make the print task by default diff --git a/CRM/Group/Controller.php b/CRM/Group/Controller.php index 92bf5dcb08..c0e78fded1 100644 --- a/CRM/Group/Controller.php +++ b/CRM/Group/Controller.php @@ -37,7 +37,7 @@ class CRM_Group_Controller extends CRM_Core_Controller { /** * Class constructor */ - function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { + public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { parent::__construct($title, $modal); $this->_stateMachine = new CRM_Group_StateMachine($this, $action); @@ -71,7 +71,7 @@ class CRM_Group_Controller extends CRM_Core_Controller { /** * @return mixed */ - function run() { + public function run() { return parent::run(); } diff --git a/CRM/Group/Form/Edit.php b/CRM/Group/Form/Edit.php index e9107f234e..22e3b67a12 100644 --- a/CRM/Group/Form/Edit.php +++ b/CRM/Group/Form/Edit.php @@ -86,7 +86,7 @@ class CRM_Group_Form_Edit extends CRM_Core_Form { * @return void * @acess protected */ - function preProcess() { + public function preProcess() { $this->_id = $this->get('id'); if ($this->_id) { $breadCrumb = array(array('title' => ts('Manage Groups'), @@ -165,7 +165,7 @@ class CRM_Group_Form_Edit extends CRM_Core_Form { * @access public * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); if (isset($this->_id)) { @@ -318,7 +318,7 @@ class CRM_Group_Form_Edit extends CRM_Core_Form { * @static * @access public */ - static function formRule($fields, $fileParams, $options) { + public static function formRule($fields, $fileParams, $options) { $errors = array(); $doParentCheck = $options['doParentCheck']; @@ -446,7 +446,7 @@ WHERE title = %1 * @static * @access public */ - static function buildParentGroups(&$form) { + public static function buildParentGroups(&$form) { $groupNames = CRM_Core_PseudoConstant::group(); $parentGroups = $parentGroupElements = array(); if (isset($form->_id) && !empty($form->_groupValues['parents'])) { diff --git a/CRM/Group/Form/Search.php b/CRM/Group/Form/Search.php index 146b0dabe1..999adbe8e2 100644 --- a/CRM/Group/Form/Search.php +++ b/CRM/Group/Form/Search.php @@ -41,7 +41,7 @@ class CRM_Group_Form_Search extends CRM_Core_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $defaults['group_status[1]'] = 1; return $defaults; @@ -91,7 +91,7 @@ class CRM_Group_Form_Search extends CRM_Core_Form { $this->assign('suppressForm', TRUE); } - function postProcess() { + public function postProcess() { $params = $this->controller->exportValues($this->_name); $parent = $this->controller->getParent(); if (!empty($params)) { diff --git a/CRM/Group/Page/AJAX.php b/CRM/Group/Page/AJAX.php index b7ffb23941..53e58c0be9 100644 --- a/CRM/Group/Page/AJAX.php +++ b/CRM/Group/Page/AJAX.php @@ -36,7 +36,7 @@ * This class contains the functions that are called using AJAX (jQuery) */ class CRM_Group_Page_AJAX { - static function getGroupList() { + public static function getGroupList() { $params = $_REQUEST; if (isset($params['parent_id'])) { diff --git a/CRM/Group/Page/Group.php b/CRM/Group/Page/Group.php index b25d0b0e3a..6077be5b47 100644 --- a/CRM/Group/Page/Group.php +++ b/CRM/Group/Page/Group.php @@ -38,7 +38,7 @@ class CRM_Group_Page_Group extends CRM_Core_Page_Basic { /** * @return string */ - function getBAOName() { + public function getBAOName() { return 'CRM_Contact_BAO_Group'; } @@ -48,7 +48,7 @@ class CRM_Group_Page_Group extends CRM_Core_Page_Basic { * @return array self::$_links array of action links * @access public */ - function &links() {} + public function &links() {} /** * Return class name of edit form @@ -56,7 +56,7 @@ class CRM_Group_Page_Group extends CRM_Core_Page_Basic { * @return string * @access public */ - function editForm() { + public function editForm() { return 'CRM_Group_Form_Edit'; } @@ -66,7 +66,7 @@ class CRM_Group_Page_Group extends CRM_Core_Page_Basic { * @return string * @access public */ - function editName() { + public function editName() { return ts('Edit Group'); } @@ -76,7 +76,7 @@ class CRM_Group_Page_Group extends CRM_Core_Page_Basic { * @return string * @access public */ - function deleteName() { + public function deleteName() { return 'Delete Group'; } @@ -88,7 +88,7 @@ class CRM_Group_Page_Group extends CRM_Core_Page_Basic { * @return string * @access public */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/group'; } @@ -100,7 +100,7 @@ class CRM_Group_Page_Group extends CRM_Core_Page_Basic { * @return string * @access public */ - function userContextParams($mode = NULL) { + public function userContextParams($mode = NULL) { return 'reset=1&action=browse'; } @@ -113,7 +113,7 @@ class CRM_Group_Page_Group extends CRM_Core_Page_Basic { * @return string the permission that the user has (or null) * @access public */ - function checkPermission($id, $title) { + public function checkPermission($id, $title) { return CRM_Contact_BAO_Group::checkPermission($id, $title); } @@ -126,7 +126,7 @@ class CRM_Group_Page_Group extends CRM_Core_Page_Basic { * @return void * @access public */ - function browse($action = NULL) { + public function browse($action = NULL) { $groupPermission = CRM_Core_Permission::check('edit groups') ? CRM_Core_Permission::EDIT : CRM_Core_Permission::VIEW; $this->assign('groupPermission', $groupPermission); @@ -154,7 +154,7 @@ class CRM_Group_Page_Group extends CRM_Core_Page_Basic { $this->search(); } - function search() { + public function search() { if ($this->_action & (CRM_Core_Action::ADD | CRM_Core_Action::UPDATE | diff --git a/CRM/Group/StateMachine.php b/CRM/Group/StateMachine.php index 62804d3b1a..80c853d652 100644 --- a/CRM/Group/StateMachine.php +++ b/CRM/Group/StateMachine.php @@ -37,7 +37,7 @@ class CRM_Group_StateMachine extends CRM_Core_StateMachine { /** * Class constructor */ - function __construct($controller, $action = CRM_Core_Action::NONE) { + public function __construct($controller, $action = CRM_Core_Action::NONE) { parent::__construct($controller, $action); $this->_pages = array( @@ -56,7 +56,7 @@ class CRM_Group_StateMachine extends CRM_Core_StateMachine { * @return string * @access public */ - function getTaskFormName() { + public function getTaskFormName() { return CRM_Utils_String::getClassName('CRM_Contact_Form_Task_AddToGroup'); } } diff --git a/CRM/Import/DataSource/CSV.php b/CRM/Import/DataSource/CSV.php index 188d7e5999..5881fc389a 100644 --- a/CRM/Import/DataSource/CSV.php +++ b/CRM/Import/DataSource/CSV.php @@ -44,7 +44,7 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource { * @access public * */ - function getInfo() { + public function getInfo() { return array('title' => ts('Comma-Separated Values (CSV)')); } @@ -53,7 +53,7 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource { * * @access public */ - function preProcess(&$form) {} + public function preProcess(&$form) {} /** * This is function is called by the form object to get the DataSource's @@ -65,7 +65,7 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource { * @return void (operates directly on form argument) * @access public */ - function buildQuickForm(&$form) { + public function buildQuickForm(&$form) { $form->add('hidden', 'hidden_dataSource', 'CRM_Import_DataSource_CSV'); $config = CRM_Core_Config::singleton(); @@ -87,7 +87,7 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource { * * @access public */ - function postProcess(&$params, &$db, &$form) { + public function postProcess(&$params, &$db, &$form) { $file = $params['uploadFile']['name']; $result = self::_CsvToTable($db, $file, diff --git a/CRM/Import/DataSource/SQL.php b/CRM/Import/DataSource/SQL.php index 26a4fa4265..8a1496e690 100644 --- a/CRM/Import/DataSource/SQL.php +++ b/CRM/Import/DataSource/SQL.php @@ -76,7 +76,7 @@ class CRM_Import_DataSource_SQL extends CRM_Import_DataSource { * * @return array|bool */ - static function formRule($fields, $files, $form) { + public static function formRule($fields, $files, $form) { $errors = array(); // poor man's query validation (case-insensitive regex matching on word boundaries) diff --git a/CRM/Import/Parser.php b/CRM/Import/Parser.php index a9042ba7af..7a3b9996ef 100644 --- a/CRM/Import/Parser.php +++ b/CRM/Import/Parser.php @@ -188,7 +188,7 @@ abstract class CRM_Import_Parser { /** * Class constructor */ - function __construct() { + public function __construct() { $this->_maxLinesToProcess = 0; $this->_maxErrorCount = self::MAX_ERRORS; } @@ -240,7 +240,7 @@ abstract class CRM_Import_Parser { * * @return int */ - function setActiveFieldValues($elements, &$erroneousField) { + public function setActiveFieldValues($elements, &$erroneousField) { $maxCount = count($elements) < $this->_activeFieldCount ? count($elements) : $this->_activeFieldCount; for ($i = 0; $i < $maxCount; $i++) { $this->_activeFields[$i]->setValue($elements[$i]); @@ -270,7 +270,7 @@ abstract class CRM_Import_Parser { * @return array (reference) associative array of name/value pairs * @access public */ - function &getActiveFieldParams() { + public function &getActiveFieldParams() { $params = array(); for ($i = 0; $i < $this->_activeFieldCount; $i++) { if (isset($this->_activeFields[$i]->_value) @@ -287,7 +287,7 @@ abstract class CRM_Import_Parser { /** * @return array */ - function getSelectValues() { + public function getSelectValues() { $values = array(); foreach ($this->_fields as $name => $field) { $values[$name] = $field->_title; @@ -298,7 +298,7 @@ abstract class CRM_Import_Parser { /** * @return array */ - function getSelectTypes() { + public function getSelectTypes() { $values = array(); foreach ($this->_fields as $name => $field) { if (isset($field->_hasLocationType)) { @@ -311,7 +311,7 @@ abstract class CRM_Import_Parser { /** * @return array */ - function getHeaderPatterns() { + public function getHeaderPatterns() { $values = array(); foreach ($this->_fields as $name => $field) { if (isset($field->_headerPattern)) { @@ -324,7 +324,7 @@ abstract class CRM_Import_Parser { /** * @return array */ - function getDataPatterns() { + public function getDataPatterns() { $values = array(); foreach ($this->_fields as $name => $field) { $values[$name] = $field->_dataPattern; @@ -342,7 +342,7 @@ abstract class CRM_Import_Parser { * @static * @access public */ - static function encloseScrub(&$values, $enclosure = "'") { + public static function encloseScrub(&$values, $enclosure = "'") { if (empty($values)) { return; } @@ -360,7 +360,7 @@ abstract class CRM_Import_Parser { * @return void * @access public */ - function setMaxLinesToProcess($max) { + public function setMaxLinesToProcess($max) { $this->_maxLinesToProcess = $max; } @@ -371,7 +371,7 @@ abstract class CRM_Import_Parser { * @return string * @static */ - static function errorFileName($type) { + public static function errorFileName($type) { $fileName = NULL; if (empty($type)) { return $fileName; @@ -411,7 +411,7 @@ abstract class CRM_Import_Parser { * @return string * @static */ - static function saveFileName($type) { + public static function saveFileName($type) { $fileName = NULL; if (empty($type)) { return $fileName; diff --git a/CRM/Import/StateMachine.php b/CRM/Import/StateMachine.php index c669ca39c4..ed0fafc782 100644 --- a/CRM/Import/StateMachine.php +++ b/CRM/Import/StateMachine.php @@ -45,7 +45,7 @@ class CRM_Import_StateMachine extends CRM_Core_StateMachine { * @param \const|int $action * */ - function __construct($controller, $action = CRM_Core_Action::NONE) { + public function __construct($controller, $action = CRM_Core_Action::NONE) { parent::__construct($controller, $action); $classType = str_replace('_Controller', '', get_class($controller)); diff --git a/CRM/Logging/Differ.php b/CRM/Logging/Differ.php index 05455284a5..8118af5b82 100644 --- a/CRM/Logging/Differ.php +++ b/CRM/Logging/Differ.php @@ -43,7 +43,7 @@ class CRM_Logging_Differ { * @param $log_date * @param string $interval */ - function __construct($log_conn_id, $log_date, $interval = '10 SECOND') { + public function __construct($log_conn_id, $log_date, $interval = '10 SECOND') { $dsn = defined('CIVICRM_LOGGING_DSN') ? DB::parseDSN(CIVICRM_LOGGING_DSN) : DB::parseDSN(CIVICRM_DSN); $this->db = $dsn['database']; $this->log_conn_id = $log_conn_id; @@ -56,7 +56,7 @@ class CRM_Logging_Differ { * * @return array */ - function diffsInTables($tables) { + public function diffsInTables($tables) { $diffs = array(); foreach ($tables as $table) { $diff = $this->diffsInTable($table); @@ -73,7 +73,7 @@ class CRM_Logging_Differ { * * @return array */ - function diffsInTable($table, $contactID = null) { + public function diffsInTable($table, $contactID = null) { $diffs = array(); $params = array( @@ -244,7 +244,7 @@ WHERE lt.log_conn_id = %1 AND * * @return array */ - function titlesAndValuesForTable($table) { + public function titlesAndValuesForTable($table) { // static caches for subsequent calls with the same $table static $titles = array(); static $values = array(); diff --git a/CRM/Logging/ReportDetail.php b/CRM/Logging/ReportDetail.php index 365df3d8e0..376ad93f1b 100644 --- a/CRM/Logging/ReportDetail.php +++ b/CRM/Logging/ReportDetail.php @@ -52,7 +52,7 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { // don’t display the ‘Add these Contacts to Group’ button $this->_add2groupSupported = FALSE; @@ -115,13 +115,13 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form { /** * @param bool $applyLimit */ - function buildQuery($applyLimit = TRUE) {} + public function buildQuery($applyLimit = TRUE) {} /** * @param $sql * @param $rows */ - function buildRows($sql, &$rows) { + public function buildRows($sql, &$rows) { // safeguard for when there aren’t any log entries yet if (!$this->log_conn_id or !$this->log_date) { return; @@ -214,7 +214,7 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form { return $rows; } - function buildQuickForm() { + public function buildQuickForm() { parent::buildQuickForm(); $params = array( diff --git a/CRM/Logging/ReportSummary.php b/CRM/Logging/ReportSummary.php index 62de33b75b..e81fdbce48 100644 --- a/CRM/Logging/ReportSummary.php +++ b/CRM/Logging/ReportSummary.php @@ -42,7 +42,7 @@ class CRM_Logging_ReportSummary extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { // don’t display the ‘Add these Contacts to Group’ button $this->_add2groupSupported = FALSE; @@ -205,11 +205,11 @@ class CRM_Logging_ReportSummary extends CRM_Report_Form { parent::__construct(); } - function groupBy() { + public function groupBy() { $this->_groupBy = 'GROUP BY entity_log_civireport.log_conn_id, entity_log_civireport.log_user_id, EXTRACT(DAY_MICROSECOND FROM entity_log_civireport.log_date), entity_log_civireport.id'; } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); foreach ($this->_columns as $tableName => $table) { @@ -229,7 +229,7 @@ class CRM_Logging_ReportSummary extends CRM_Report_Form { $this->_select = 'SELECT ' . implode(', ', $select) . ' '; } - function where() { + public function where() { // reset where clause as its called multiple times, every time insert sql is built. $this->_whereClauses = array(); @@ -237,7 +237,7 @@ class CRM_Logging_ReportSummary extends CRM_Report_Form { $this->_where .= " AND (entity_log_civireport.log_action != 'Initialization')"; } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); $rows = array(); @@ -352,7 +352,7 @@ ORDER BY log_civicrm_entity_log_date DESC {$this->_limit}"; * * @return string */ - function getLogType($entity) { + public function getLogType($entity) { if (!empty($this->_logTables[$entity]['log_type'])) { return $this->_logTables[$entity]['log_type']; } @@ -367,7 +367,7 @@ ORDER BY log_civicrm_entity_log_date DESC {$this->_limit}"; * * @return mixed|null|string */ - function getEntityValue($id, $entity, $logDate) { + public function getEntityValue($id, $entity, $logDate) { if (!empty($this->_logTables[$entity]['bracket_info'])) { if (!empty($this->_logTables[$entity]['bracket_info']['entity_column'])) { $logTable = !empty($this->_logTables[$entity]['table_name']) ? $this->_logTables[$entity]['table_name'] : $entity; @@ -419,7 +419,7 @@ WHERE log_date <= %1 AND id = %2 ORDER BY log_date DESC LIMIT 1"; * * @return null|string */ - function getEntityAction($id, $connId, $entity, $oldAction) { + public function getEntityAction($id, $connId, $entity, $oldAction) { if (!empty($this->_logTables[$entity]['action_column'])) { $sql = "select {$this->_logTables[$entity]['action_column']} from `{$this->loggingDB}`.{$entity} where id = %1 AND log_conn_id = %2"; $newAction = CRM_Core_DAO::singleValueQuery($sql, array( diff --git a/CRM/Logging/Reverter.php b/CRM/Logging/Reverter.php index 6e424b5415..8fb0ae6826 100644 --- a/CRM/Logging/Reverter.php +++ b/CRM/Logging/Reverter.php @@ -41,7 +41,7 @@ class CRM_Logging_Reverter { * @param int $log_conn_id * @param $log_date */ - function __construct($log_conn_id, $log_date) { + public function __construct($log_conn_id, $log_date) { $dsn = defined('CIVICRM_LOGGING_DSN') ? DB::parseDSN(CIVICRM_LOGGING_DSN) : DB::parseDSN(CIVICRM_DSN); $this->db = $dsn['database']; $this->log_conn_id = $log_conn_id; @@ -51,7 +51,7 @@ class CRM_Logging_Reverter { /** * @param $tables */ - function revert($tables) { + public function revert($tables) { // FIXME: split off the table → DAO mapping to a GenCode-generated class $daos = array( 'civicrm_address' => 'CRM_Core_DAO_Address', diff --git a/CRM/Logging/Schema.php b/CRM/Logging/Schema.php index 52ad43aa16..f3045b02c4 100644 --- a/CRM/Logging/Schema.php +++ b/CRM/Logging/Schema.php @@ -55,7 +55,7 @@ class CRM_Logging_Schema { /** * Populate $this->tables and $this->logs with current db state. */ - function __construct() { + public function __construct() { $dao = new CRM_Contact_DAO_Contact(); $civiDBName = $dao->_database; @@ -107,14 +107,14 @@ AND TABLE_NAME LIKE 'log_civicrm_%' /** * Return logging custom data tables. */ - function customDataLogTables() { + public function customDataLogTables() { return preg_grep('/^log_civicrm_value_/', $this->logs); } /** * Return custom data tables for specified entity / extends. */ - function entityCustomDataLogTables($extends) { + public function entityCustomDataLogTables($extends) { $customGroupTables = array(); $customGroupDAO = CRM_Core_BAO_CustomGroup::getAllCustomGroupsByBaseEntity($extends); $customGroupDAO->find(); @@ -127,7 +127,7 @@ AND TABLE_NAME LIKE 'log_civicrm_%' /** * Disable logging by dropping the triggers (but keep the log tables intact). */ - function disableLogging() { + public function disableLogging() { $config = CRM_Core_Config::singleton(); $config->logging = FALSE; @@ -142,7 +142,7 @@ AND TABLE_NAME LIKE 'log_civicrm_%' /** * Drop triggers for all logged tables. */ - function dropTriggers($tableName = NULL) { + public function dropTriggers($tableName = NULL) { $dao = new CRM_Core_DAO; if ($tableName) { @@ -186,7 +186,7 @@ AND TABLE_NAME LIKE 'log_civicrm_%' * * @return void */ - function enableLogging() { + public function enableLogging() { $this->fixSchemaDifferences(TRUE); $this->addReports(); } @@ -198,7 +198,7 @@ AND TABLE_NAME LIKE 'log_civicrm_%' * * @return void */ - function fixSchemaDifferences($enableLogging = FALSE) { + public function fixSchemaDifferences($enableLogging = FALSE) { $config = CRM_Core_Config::singleton(); if ($enableLogging) { $config->logging = TRUE; @@ -219,7 +219,7 @@ AND TABLE_NAME LIKE 'log_civicrm_%' * * @return void */ - function fixSchemaDifferencesFor($table, $cols = array(), $rebuildTrigger = FALSE) { + public function fixSchemaDifferencesFor($table, $cols = array(), $rebuildTrigger = FALSE) { if (empty($table)) { return FALSE; } @@ -289,7 +289,7 @@ AND TABLE_NAME LIKE 'log_civicrm_%' /** * @param bool $rebuildTrigger */ - function fixSchemaDifferencesForAll($rebuildTrigger = FALSE) { + public function fixSchemaDifferencesForAll($rebuildTrigger = FALSE) { $diffs = array(); foreach ($this->tables as $table) { if (empty($this->logs[$table])) { @@ -320,7 +320,7 @@ AND TABLE_NAME LIKE 'log_civicrm_%' * * @return mixed */ - function fixTimeStampAndNotNullSQL($query) { + public function fixTimeStampAndNotNullSQL($query) { $query = str_ireplace("TIMESTAMP NOT NULL", "TIMESTAMP NULL", $query); $query = str_ireplace("DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP", '', $query); $query = str_ireplace("DEFAULT CURRENT_TIMESTAMP", '', $query); @@ -423,7 +423,7 @@ WHERE table_schema IN ('{$this->db}', '{$civiDB}')"; * * @return array */ - function columnsWithDiffSpecs($civiTable, $logTable) { + public function columnsWithDiffSpecs($civiTable, $logTable) { $civiTableSpecs = $this->columnSpecsOf($civiTable); $logTableSpecs = $this->columnSpecsOf($logTable); @@ -563,7 +563,7 @@ COLS; * @param null $tableName * @param bool $force */ - function triggerInfo(&$info, $tableName = NULL, $force = FALSE) { + public function triggerInfo(&$info, $tableName = NULL, $force = FALSE) { // check if we have logging enabled $config =& CRM_Core_Config::singleton(); if (!$config->logging) { @@ -655,7 +655,7 @@ COLS; * @static * @public */ - static function disableLoggingForThisConnection( ) { + public static function disableLoggingForThisConnection( ) { // do this only if logging is enabled $config = CRM_Core_Config::singleton( ); if ( $config->logging ) { diff --git a/CRM/Mailing/BAO/BouncePattern.php b/CRM/Mailing/BAO/BouncePattern.php index 8db348ec1b..d910a608ed 100644 --- a/CRM/Mailing/BAO/BouncePattern.php +++ b/CRM/Mailing/BAO/BouncePattern.php @@ -42,7 +42,7 @@ class CRM_Mailing_BAO_BouncePattern extends CRM_Mailing_DAO_BouncePattern { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } diff --git a/CRM/Mailing/BAO/Component.php b/CRM/Mailing/BAO/Component.php index 9d81e024ff..9cd78995f7 100644 --- a/CRM/Mailing/BAO/Component.php +++ b/CRM/Mailing/BAO/Component.php @@ -37,7 +37,7 @@ class CRM_Mailing_BAO_Component extends CRM_Mailing_DAO_Component { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -51,7 +51,7 @@ class CRM_Mailing_BAO_Component extends CRM_Mailing_DAO_Component { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $component = new CRM_Mailing_DAO_Component(); $component->copyValues($params); if ($component->find(TRUE)) { @@ -70,7 +70,7 @@ class CRM_Mailing_BAO_Component extends CRM_Mailing_DAO_Component { * @return Object DAO object on sucess, null otherwise * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Mailing_DAO_Component', $id, 'is_active', $is_active); } @@ -85,7 +85,7 @@ class CRM_Mailing_BAO_Component extends CRM_Mailing_DAO_Component { * @access public * @static */ - static function add(&$params, $ids = array()) { + public static function add(&$params, $ids = array()) { $id = CRM_Utils_Array::value('id', $params, CRM_Utils_Array::value('id', $ids)); $component = new CRM_Mailing_DAO_Component(); $component->id = $id; diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index 8a237081bd..1bc15c5ec7 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -91,7 +91,7 @@ class CRM_Mailing_BAO_Mailing extends CRM_Mailing_DAO_Mailing { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -102,7 +102,7 @@ class CRM_Mailing_BAO_Mailing extends CRM_Mailing_DAO_Mailing { * * @return int */ - static function &getRecipientsCount($job_id, $mailing_id = NULL, $mode = NULL) { + public static function &getRecipientsCount($job_id, $mailing_id = NULL, $mode = NULL) { // need this for backward compatibility, so we can get count for old mailings // please do not use this function if possible $eq = self::getRecipients($job_id, $mailing_id); @@ -660,7 +660,7 @@ ORDER BY i.contact_id, i.{$tempColumn} * the type will tell us which function to use for the data lookup * if we need to do a lookup at all */ - function &getDataFunc($token) { + public function &getDataFunc($token) { static $_categories = NULL; static $_categoryString = NULL; if (!$_categories) { @@ -1002,7 +1002,7 @@ ORDER BY civicrm_email.is_bulkmail DESC * * @return void */ - static function addMessageIdHeader(&$headers, $prefix, $job_id, $event_queue_id, $hash) { + public static function addMessageIdHeader(&$headers, $prefix, $job_id, $event_queue_id, $hash) { $config = CRM_Core_Config::singleton(); $localpart = CRM_Core_BAO_MailSettings::defaultLocalpart(); $emailDomain = CRM_Core_BAO_MailSettings::defaultDomain(); @@ -1030,7 +1030,7 @@ ORDER BY civicrm_email.is_bulkmail DESC * * @return array (reference) array array ref that hold array refs to the verp info and urls */ - static function getVerpAndUrls($job_id, $event_queue_id, $hash, $email) { + public static function getVerpAndUrls($job_id, $event_queue_id, $hash, $email) { // create a skeleton object and set its properties that are required by getVerpAndUrlsAndHeaders() $config = CRM_Core_Config::singleton(); $bao = new CRM_Mailing_BAO_Mailing(); @@ -1518,7 +1518,7 @@ ORDER BY civicrm_email.is_bulkmail DESC * * @return object */ - static function add(&$params, $ids = array()) { + public static function add(&$params, $ids = array()) { $id = CRM_Utils_Array::value('mailing_id', $ids, CRM_Utils_Array::value('id', $params)); if ($id) { @@ -2235,7 +2235,7 @@ ORDER BY civicrm_email.is_bulkmail DESC * * @throws Exception */ - static function checkPermission($id) { + public static function checkPermission($id) { if (!$id) { return; } @@ -2256,7 +2256,7 @@ ORDER BY civicrm_email.is_bulkmail DESC * * @return string */ - static function mailingACL($alias = NULL) { + public static function mailingACL($alias = NULL) { $mailingACL = " ( 0 ) "; $mailingIDs = self::mailingACLIDs(); @@ -2282,7 +2282,7 @@ ORDER BY civicrm_email.is_bulkmail DESC * @return boolean | array - TRUE if the user has access to all mailings, else array of mailing IDs (possibly empty) * @static */ - static function mailingACLIDs() { + public static function mailingACLIDs() { // CRM-11633 // optimize common case where admin has access // to all mailings @@ -2423,7 +2423,7 @@ LEFT JOIN civicrm_mailing_group g ON g.mailing_id = m.id * @static * @access public */ - static function showEmailDetails($id) { + public static function showEmailDetails($id) { return CRM_Utils_System::url('civicrm/mailing/report', "mid=$id"); } @@ -2480,7 +2480,7 @@ LEFT JOIN civicrm_mailing_group g ON g.mailing_id = m.id /** * @return array */ - function getReturnProperties() { + public function getReturnProperties() { $tokens = &$this->getTokens(); $properties = array(); @@ -2698,7 +2698,7 @@ SELECT $mailing.id as mailing_id * * @return array $report array content/component.@access public */ - static function getMailingContent(&$report, &$form, $isSMS = FALSE) { + public static function getMailingContent(&$report, &$form, $isSMS = FALSE) { $htmlHeader = $textHeader = NULL; $htmlFooter = $textFooter = NULL; @@ -2750,7 +2750,7 @@ SELECT $mailing.id as mailing_id * * @return mixed */ - static function overrideVerp($jobID) { + public static function overrideVerp($jobID) { static $_cache = array(); if (!isset($_cache[$jobID])) { @@ -2772,7 +2772,7 @@ WHERE civicrm_mailing_job.id = %1 * @return bool * @throws Exception */ - static function processQueue($mode = NULL) { + public static function processQueue($mode = NULL) { $config = &CRM_Core_Config::singleton(); if ($mode == NULL && CRM_Core_BAO_MailSettings::defaultDomain() == "EXAMPLE.ORG") { @@ -2847,7 +2847,7 @@ AND e.id NOT IN ( SELECT email_id FROM civicrm_mailing_recipients mr WHERE ma * * @return mixed */ - static function getMailingsList($isSMS = FALSE) { + public static function getMailingsList($isSMS = FALSE) { static $list = array(); $where = " WHERE "; if (!$isSMS) { @@ -2878,7 +2878,7 @@ ORDER BY civicrm_mailing.name"; * * @return null|string */ - static function hiddenMailingGroup($mid) { + public static function hiddenMailingGroup($mid) { $sql = " SELECT g.id FROM civicrm_mailing m diff --git a/CRM/Mailing/BAO/MailingAB.php b/CRM/Mailing/BAO/MailingAB.php index 31ef72ab6c..4964fae1f6 100644 --- a/CRM/Mailing/BAO/MailingAB.php +++ b/CRM/Mailing/BAO/MailingAB.php @@ -41,7 +41,7 @@ class CRM_Mailing_BAO_MailingAB extends CRM_Mailing_DAO_MailingAB { /** * class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -81,7 +81,7 @@ class CRM_Mailing_BAO_MailingAB extends CRM_Mailing_DAO_MailingAB { * * @return object */ - static function add(&$params, $ids = array()) { + public static function add(&$params, $ids = array()) { $id = CRM_Utils_Array::value('mailingab_id', $ids, CRM_Utils_Array::value('id', $params)); if ($id) { diff --git a/CRM/Mailing/BAO/MailingJob.php b/CRM/Mailing/BAO/MailingJob.php index c746d36fcb..e0ff17bd9c 100644 --- a/CRM/Mailing/BAO/MailingJob.php +++ b/CRM/Mailing/BAO/MailingJob.php @@ -53,7 +53,7 @@ class CRM_Mailing_BAO_MailingJob extends CRM_Mailing_DAO_MailingJob { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } diff --git a/CRM/Mailing/BAO/Query.php b/CRM/Mailing/BAO/Query.php index ba592245a3..b61495ce9e 100644 --- a/CRM/Mailing/BAO/Query.php +++ b/CRM/Mailing/BAO/Query.php @@ -38,7 +38,7 @@ class CRM_Mailing_BAO_Query { /** * @return array|null */ - static function &getFields() { + public static function &getFields() { if (!self::$_mailingFields) { self::$_mailingFields = array(); $_mailingFields['mailing_id'] = array( @@ -58,7 +58,7 @@ class CRM_Mailing_BAO_Query { * @return void * @access public */ - static function select(&$query) { + public static function select(&$query) { // if Mailing mode add mailing id if ($query->_mode & CRM_Contact_BAO_Query::MODE_MAILING) { $query->_select['mailing_id'] = "civicrm_mailing.id as mailing_id"; @@ -128,7 +128,7 @@ class CRM_Mailing_BAO_Query { /** * @param $query */ - static function where(&$query) { + public static function where(&$query) { $grouping = NULL; foreach (array_keys($query->_params) as $id) { if (empty($query->_params[$id][0])) { @@ -151,7 +151,7 @@ class CRM_Mailing_BAO_Query { * * @return null|string */ - static function from($name, $mode, $side) { + public static function from($name, $mode, $side) { $from = NULL; switch ($name) { @@ -226,7 +226,7 @@ class CRM_Mailing_BAO_Query { * @param $values * @param $query */ - static function whereClauseSingle(&$values, &$query) { + public static function whereClauseSingle(&$values, &$query) { list($name, $op, $value, $grouping, $wildcard) = $values; $fields = array(); @@ -383,7 +383,7 @@ class CRM_Mailing_BAO_Query { * @return void * @static */ - static function buildSearchForm(&$form) { + public static function buildSearchForm(&$form) { // mailing selectors $mailings = CRM_Mailing_BAO_Mailing::getMailingsList(); @@ -429,12 +429,12 @@ class CRM_Mailing_BAO_Query { * @param $row * @param int $id */ - static function searchAction(&$row, $id) {} + public static function searchAction(&$row, $id) {} /** * @param $tables */ - static function tableNames(&$tables) { + public static function tableNames(&$tables) { } /** @@ -450,7 +450,7 @@ class CRM_Mailing_BAO_Query { * * @return void */ - static function mailingEventQueryBuilder(&$query, &$values, $tableName, $fieldName, $fieldTitle, &$valueTitles) { + public static function mailingEventQueryBuilder(&$query, &$values, $tableName, $fieldName, $fieldTitle, &$valueTitles) { list($name, $op, $value, $grouping, $wildcard) = $values; if (empty($value) || $value == 'A') { diff --git a/CRM/Mailing/BAO/Recipients.php b/CRM/Mailing/BAO/Recipients.php index 702aff6ab9..2af9a7bf4a 100644 --- a/CRM/Mailing/BAO/Recipients.php +++ b/CRM/Mailing/BAO/Recipients.php @@ -37,7 +37,7 @@ class CRM_Mailing_BAO_Recipients extends CRM_Mailing_DAO_Recipients { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -46,7 +46,7 @@ class CRM_Mailing_BAO_Recipients extends CRM_Mailing_DAO_Recipients { * * @return null|string */ - static function mailingSize($mailingID) { + public static function mailingSize($mailingID) { $sql = " SELECT count(*) as count FROM civicrm_mailing_recipients @@ -95,7 +95,7 @@ WHERE mailing_id = %1 * @param int $totalLimit * Number of recipients to move */ - static function updateRandomRecipients($sourceMailingId, $newMailingID, $totalLimit = NULL) { + public static function updateRandomRecipients($sourceMailingId, $newMailingID, $totalLimit = NULL) { $limitString = NULL; if ($totalLimit) { $limitString = "LIMIT 0, $totalLimit"; @@ -129,7 +129,7 @@ SET mr.mailing_id = $newMailingID * @param int $sourceMailingId * @param array $to (int $targetMailingId => int $count) */ - static function reassign($sourceMailingId, $to) { + public static function reassign($sourceMailingId, $to) { foreach ($to as $targetMailingId => $count) { if ($count > 0) { CRM_Mailing_BAO_Recipients::updateRandomRecipients($sourceMailingId, $targetMailingId, $count); diff --git a/CRM/Mailing/BAO/Spool.php b/CRM/Mailing/BAO/Spool.php index be89640321..c37f60a630 100644 --- a/CRM/Mailing/BAO/Spool.php +++ b/CRM/Mailing/BAO/Spool.php @@ -37,7 +37,7 @@ class CRM_Mailing_BAO_Spool extends CRM_Mailing_DAO_Spool { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -63,7 +63,7 @@ class CRM_Mailing_BAO_Spool extends CRM_Mailing_DAO_Spool { * failure. * @access public */ - function send($recipient, $headers, $body, $job_id = null) { + public function send($recipient, $headers, $body, $job_id = null) { $headerStr = array(); foreach ($headers as $name => $value) { $headerStr[] = "$name: $value"; diff --git a/CRM/Mailing/BAO/TrackableURL.php b/CRM/Mailing/BAO/TrackableURL.php index 57d6b6bf97..9cc47a1440 100644 --- a/CRM/Mailing/BAO/TrackableURL.php +++ b/CRM/Mailing/BAO/TrackableURL.php @@ -37,7 +37,7 @@ class CRM_Mailing_BAO_TrackableURL extends CRM_Mailing_DAO_TrackableURL { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } diff --git a/CRM/Mailing/Controller/Send.php b/CRM/Mailing/Controller/Send.php index 53be18b84a..a3b5f6fac9 100644 --- a/CRM/Mailing/Controller/Send.php +++ b/CRM/Mailing/Controller/Send.php @@ -37,7 +37,7 @@ class CRM_Mailing_Controller_Send extends CRM_Core_Controller { /** * Class constructor */ - function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { + public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { parent::__construct($title, $modal, NULL, FALSE, TRUE); if (!defined('CIVICRM_CIVIMAIL_UI_LEGACY')) { diff --git a/CRM/Mailing/Event/BAO/Bounce.php b/CRM/Mailing/Event/BAO/Bounce.php index b9d231b618..2db914b91a 100755 --- a/CRM/Mailing/Event/BAO/Bounce.php +++ b/CRM/Mailing/Event/BAO/Bounce.php @@ -37,14 +37,14 @@ class CRM_Mailing_Event_BAO_Bounce extends CRM_Mailing_Event_DAO_Bounce { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } /** * Create a new bounce event, update the email address if necessary */ - static function &create(&$params) { + public static function &create(&$params) { $q = &CRM_Mailing_Event_BAO_Queue::verify($params['job_id'], $params['event_queue_id'], $params['hash'] diff --git a/CRM/Mailing/Event/BAO/Confirm.php b/CRM/Mailing/Event/BAO/Confirm.php index 00fed2d2a3..86d311208e 100644 --- a/CRM/Mailing/Event/BAO/Confirm.php +++ b/CRM/Mailing/Event/BAO/Confirm.php @@ -43,7 +43,7 @@ class CRM_Mailing_Event_BAO_Confirm extends CRM_Mailing_Event_DAO_Confirm { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } diff --git a/CRM/Mailing/Event/BAO/Delivered.php b/CRM/Mailing/Event/BAO/Delivered.php index a8835f7106..8d205e3f94 100755 --- a/CRM/Mailing/Event/BAO/Delivered.php +++ b/CRM/Mailing/Event/BAO/Delivered.php @@ -37,7 +37,7 @@ class CRM_Mailing_Event_BAO_Delivered extends CRM_Mailing_Event_DAO_Delivered { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -237,7 +237,7 @@ class CRM_Mailing_Event_BAO_Delivered extends CRM_Mailing_Event_DAO_Delivered { * @param $eventQueueIDs * @param null $time */ - static function bulkCreate($eventQueueIDs, $time = NULL) { + public static function bulkCreate($eventQueueIDs, $time = NULL) { if (!$time) { $time = date('YmdHis'); } diff --git a/CRM/Mailing/Event/BAO/Forward.php b/CRM/Mailing/Event/BAO/Forward.php index 12d210f616..26d272e4b3 100644 --- a/CRM/Mailing/Event/BAO/Forward.php +++ b/CRM/Mailing/Event/BAO/Forward.php @@ -37,14 +37,14 @@ class CRM_Mailing_Event_BAO_Forward extends CRM_Mailing_Event_DAO_Forward { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } /** * Create a new forward event, create a new contact if necessary */ - static function &forward($job_id, $queue_id, $hash, $forward_email, $fromEmail = NULL, $comment = NULL) { + public static function &forward($job_id, $queue_id, $hash, $forward_email, $fromEmail = NULL, $comment = NULL) { $q = CRM_Mailing_Event_BAO_Queue::verify($job_id, $queue_id, $hash); $successfulForward = FALSE; diff --git a/CRM/Mailing/Event/BAO/Opened.php b/CRM/Mailing/Event/BAO/Opened.php index 07404fa100..778d3d9382 100755 --- a/CRM/Mailing/Event/BAO/Opened.php +++ b/CRM/Mailing/Event/BAO/Opened.php @@ -37,7 +37,7 @@ class CRM_Mailing_Event_BAO_Opened extends CRM_Mailing_Event_DAO_Opened { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } diff --git a/CRM/Mailing/Event/BAO/Queue.php b/CRM/Mailing/Event/BAO/Queue.php index 04c4b37a20..72aa91e85e 100644 --- a/CRM/Mailing/Event/BAO/Queue.php +++ b/CRM/Mailing/Event/BAO/Queue.php @@ -37,7 +37,7 @@ class CRM_Mailing_Event_BAO_Queue extends CRM_Mailing_Event_DAO_Queue { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -304,7 +304,7 @@ SELECT DISTINCT(civicrm_mailing_event_queue.contact_id) as contact_id, * @param array $params * @param null $now */ - static function bulkCreate($params, $now = NULL) { + public static function bulkCreate($params, $now = NULL) { if (!$now) { $now = time(); } diff --git a/CRM/Mailing/Event/BAO/Reply.php b/CRM/Mailing/Event/BAO/Reply.php index 4084af7120..f8d70f7b3b 100644 --- a/CRM/Mailing/Event/BAO/Reply.php +++ b/CRM/Mailing/Event/BAO/Reply.php @@ -46,7 +46,7 @@ class CRM_Mailing_Event_BAO_Reply extends CRM_Mailing_Event_DAO_Reply { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } diff --git a/CRM/Mailing/Event/BAO/Subscribe.php b/CRM/Mailing/Event/BAO/Subscribe.php index bd824dfd57..be8cfbdaec 100644 --- a/CRM/Mailing/Event/BAO/Subscribe.php +++ b/CRM/Mailing/Event/BAO/Subscribe.php @@ -44,7 +44,7 @@ class CRM_Mailing_Event_BAO_Subscribe extends CRM_Mailing_Event_DAO_Subscribe { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } diff --git a/CRM/Mailing/Event/BAO/TrackableURLOpen.php b/CRM/Mailing/Event/BAO/TrackableURLOpen.php index 9fcb89c68f..7f0467e412 100755 --- a/CRM/Mailing/Event/BAO/TrackableURLOpen.php +++ b/CRM/Mailing/Event/BAO/TrackableURLOpen.php @@ -37,7 +37,7 @@ class CRM_Mailing_Event_BAO_TrackableURLOpen extends CRM_Mailing_Event_DAO_Track /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } diff --git a/CRM/Mailing/Event/BAO/Unsubscribe.php b/CRM/Mailing/Event/BAO/Unsubscribe.php index b916a2a267..edf2a12c23 100755 --- a/CRM/Mailing/Event/BAO/Unsubscribe.php +++ b/CRM/Mailing/Event/BAO/Unsubscribe.php @@ -43,7 +43,7 @@ class CRM_Mailing_Event_BAO_Unsubscribe extends CRM_Mailing_Event_DAO_Unsubscrib /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } diff --git a/CRM/Mailing/Form/Approve.php b/CRM/Mailing/Form/Approve.php index 68c02afe19..3290cb0aa4 100644 --- a/CRM/Mailing/Form/Approve.php +++ b/CRM/Mailing/Form/Approve.php @@ -88,7 +88,7 @@ class CRM_Mailing_Form_Approve extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); if ($this->_mailingID) { $defaults['approval_status_id'] = $this->_mailing->approval_status_id; diff --git a/CRM/Mailing/Form/Browse.php b/CRM/Mailing/Form/Browse.php index 361a2e8588..2ef3dd9942 100644 --- a/CRM/Mailing/Form/Browse.php +++ b/CRM/Mailing/Form/Browse.php @@ -52,7 +52,7 @@ class CRM_Mailing_Form_Browse extends CRM_Core_Form { * @access public * */ - function preProcess() { + public function preProcess() { $this->_mailingId = CRM_Utils_Request::retrieve('mid', 'Positive', $this); $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this); diff --git a/CRM/Mailing/Form/Component.php b/CRM/Mailing/Form/Component.php index 798191a673..b1a03d9f9f 100644 --- a/CRM/Mailing/Form/Component.php +++ b/CRM/Mailing/Form/Component.php @@ -53,7 +53,7 @@ class CRM_Mailing_Form_Component extends CRM_Core_Form { */ protected $_BAOName; - function preProcess() { + public function preProcess() { $this->_id = $this->get('id'); $this->_BAOName = $this->get('BAOName'); } @@ -112,7 +112,7 @@ class CRM_Mailing_Form_Component extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $params = array(); @@ -161,7 +161,7 @@ class CRM_Mailing_Form_Component extends CRM_Core_Form { * @access public * @static */ - static function dataRule($params, $files, $options) { + public static function dataRule($params, $files, $options) { if ($params['component_type'] == 'Header' || $params['component_type'] == 'Footer') { $InvalidTokens = array(); } diff --git a/CRM/Mailing/Form/ForwardMailing.php b/CRM/Mailing/Form/ForwardMailing.php index 578e32d581..9e77e0eec0 100644 --- a/CRM/Mailing/Form/ForwardMailing.php +++ b/CRM/Mailing/Form/ForwardMailing.php @@ -33,7 +33,7 @@ * */ class CRM_Mailing_Form_ForwardMailing extends CRM_Core_Form { - function preProcess() { + public function preProcess() { $job_id = CRM_Utils_Request::retrieve('jid', 'Positive', $this, NULL ); diff --git a/CRM/Mailing/Form/Group.php b/CRM/Mailing/Form/Group.php index d33de9d4aa..f7e1f475f4 100644 --- a/CRM/Mailing/Form/Group.php +++ b/CRM/Mailing/Form/Group.php @@ -96,7 +96,7 @@ class CRM_Mailing_Form_Group extends CRM_Contact_Form_Task { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $continue = CRM_Utils_Request::retrieve('continue', 'String', $this, FALSE, NULL); $defaults = array(); @@ -549,7 +549,7 @@ class CRM_Mailing_Form_Group extends CRM_Contact_Form_Task { * @static * @access public */ - static function formRule($fields) { + public static function formRule($fields) { $errors = array(); if (isset($fields['includeGroups']) && is_array($fields['includeGroups']) && diff --git a/CRM/Mailing/Form/Optout.php b/CRM/Mailing/Form/Optout.php index d4cf07c19e..a221ff1975 100644 --- a/CRM/Mailing/Form/Optout.php +++ b/CRM/Mailing/Form/Optout.php @@ -34,7 +34,7 @@ */ class CRM_Mailing_Form_Optout extends CRM_Core_Form { - function preProcess() { + public function preProcess() { $this->_type = 'optout'; @@ -63,7 +63,7 @@ class CRM_Mailing_Form_Optout extends CRM_Core_Form { $this->_email = $email; } - function buildQuickForm() { + public function buildQuickForm() { CRM_Utils_System::addHTMLHead(''); CRM_Utils_System::setTitle(ts('Please Confirm Your Opt Out')); @@ -85,7 +85,7 @@ class CRM_Mailing_Form_Optout extends CRM_Core_Form { $this->addButtons($buttons); } - function postProcess() { + public function postProcess() { $values = $this->exportValues(); diff --git a/CRM/Mailing/Form/Schedule.php b/CRM/Mailing/Form/Schedule.php index 1af8e19215..84f4e3371a 100644 --- a/CRM/Mailing/Form/Schedule.php +++ b/CRM/Mailing/Form/Schedule.php @@ -75,7 +75,7 @@ class CRM_Mailing_Form_Schedule extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); if ($this->_scheduleFormOnly) { $count = CRM_Mailing_BAO_Recipients::mailingSize($this->_mailingID); diff --git a/CRM/Mailing/Form/Search.php b/CRM/Mailing/Form/Search.php index a741aaa007..0e4bf43a2a 100644 --- a/CRM/Mailing/Form/Search.php +++ b/CRM/Mailing/Form/Search.php @@ -79,7 +79,7 @@ class CRM_Mailing_Form_Search extends CRM_Core_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = $statusVals = array(); $parent = $this->controller->getParent(); @@ -103,7 +103,7 @@ class CRM_Mailing_Form_Search extends CRM_Core_Form { return $defaults; } - function postProcess() { + public function postProcess() { $params = $this->controller->exportValues($this->_name); CRM_Contact_BAO_Query::fixDateValues($params["mailing_relative"], $params['mailing_from'], $params['mailing_to']); diff --git a/CRM/Mailing/Form/Settings.php b/CRM/Mailing/Form/Settings.php index 72cf5c9e9c..dcf9e8f969 100644 --- a/CRM/Mailing/Form/Settings.php +++ b/CRM/Mailing/Form/Settings.php @@ -64,7 +64,7 @@ class CRM_Mailing_Form_Settings extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $mailingID = CRM_Utils_Request::retrieve('mid', 'Integer', $this, FALSE, NULL); // CRM-14716 - Pick up mailingID from session since most of the time it's not in the URL if (!$mailingID) { diff --git a/CRM/Mailing/Form/Subscribe.php b/CRM/Mailing/Form/Subscribe.php index 463eb8758a..59b8af619f 100644 --- a/CRM/Mailing/Form/Subscribe.php +++ b/CRM/Mailing/Form/Subscribe.php @@ -36,7 +36,7 @@ class CRM_Mailing_Form_Subscribe extends CRM_Core_Form { protected $_groupID = NULL; - function preProcess() { + public function preProcess() { parent::preProcess(); $this->_groupID = CRM_Utils_Request::retrieve('gid', 'Integer', $this, FALSE, NULL, 'REQUEST' @@ -178,7 +178,7 @@ ORDER BY title"; * * @return array|bool */ - static function formRule($fields) { + public static function formRule($fields) { foreach ($fields as $name => $dontCare) { if (substr($name, 0, CRM_Core_Form::CB_PREFIX_LEN) == CRM_Core_Form::CB_PREFIX) { return TRUE; diff --git a/CRM/Mailing/Form/Task.php b/CRM/Mailing/Form/Task.php index bbd90c92db..f886771ec7 100644 --- a/CRM/Mailing/Form/Task.php +++ b/CRM/Mailing/Form/Task.php @@ -68,7 +68,7 @@ class CRM_Mailing_Form_Task extends CRM_Core_Form { * @return void * @access public */ - function preProcess() { + public function preProcess() { self::preProcessCommon($this); } @@ -76,7 +76,7 @@ class CRM_Mailing_Form_Task extends CRM_Core_Form { * @param CRM_Core_Form $form * @param bool $useTable */ - static function preProcessCommon(&$form, $useTable = FALSE) { + public static function preProcessCommon(&$form, $useTable = FALSE) { $values = $form->controller->exportValues($form->get('searchFormName')); $form->_task = CRM_Utils_Array::value('task', $values); @@ -146,7 +146,7 @@ class CRM_Mailing_Form_Task extends CRM_Core_Form { * @return void * @access public */ - function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { + public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { $this->addButtons(array( array( 'type' => $nextType, diff --git a/CRM/Mailing/Form/Task/Print.php b/CRM/Mailing/Form/Task/Print.php index 1bc7b99143..acb61a246e 100644 --- a/CRM/Mailing/Form/Task/Print.php +++ b/CRM/Mailing/Form/Task/Print.php @@ -44,7 +44,7 @@ class CRM_Mailing_Form_Task_Print extends CRM_Mailing_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preprocess(); // set print view, so that print templates are called @@ -75,7 +75,7 @@ class CRM_Mailing_Form_Task_Print extends CRM_Mailing_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { // // just need to add a javacript to popup the window for printing // diff --git a/CRM/Mailing/Form/Test.php b/CRM/Mailing/Form/Test.php index 1ffab7353a..c45c3b9b3b 100644 --- a/CRM/Mailing/Form/Test.php +++ b/CRM/Mailing/Form/Test.php @@ -63,7 +63,7 @@ class CRM_Mailing_Form_Test extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $count = $this->get('count'); $this->assign('count', $count); } @@ -179,7 +179,7 @@ class CRM_Mailing_Form_Test extends CRM_Core_Form { * @return boolean true on successful SMTP handoff * @access public */ - static function testMail($testParams, $files, $self) { + public static function testMail($testParams, $files, $self) { $error = NULL; $urlString = 'civicrm/mailing/send'; diff --git a/CRM/Mailing/Form/Unsubscribe.php b/CRM/Mailing/Form/Unsubscribe.php index ca5a8144c2..aa67a7f179 100644 --- a/CRM/Mailing/Form/Unsubscribe.php +++ b/CRM/Mailing/Form/Unsubscribe.php @@ -34,7 +34,7 @@ */ class CRM_Mailing_Form_Unsubscribe extends CRM_Core_Form { - function preProcess() { + public function preProcess() { $this->_type = 'unsubscribe'; @@ -80,7 +80,7 @@ class CRM_Mailing_Form_Unsubscribe extends CRM_Core_Form { } - function buildQuickForm() { + public function buildQuickForm() { CRM_Utils_System::addHTMLHead(''); CRM_Utils_System::setTitle(ts('Please Confirm Your Unsubscribe from this Mailing/Group')); @@ -102,7 +102,7 @@ class CRM_Mailing_Form_Unsubscribe extends CRM_Core_Form { $this->addButtons($buttons); } - function postProcess() { + public function postProcess() { $values = $this->exportValues(); diff --git a/CRM/Mailing/Form/Upload.php b/CRM/Mailing/Form/Upload.php index 21d8fd4cac..9556e018c4 100644 --- a/CRM/Mailing/Form/Upload.php +++ b/CRM/Mailing/Form/Upload.php @@ -40,7 +40,7 @@ class CRM_Mailing_Form_Upload extends CRM_Core_Form { public $_mailingID; - function preProcess() { + public function preProcess() { $this->_mailingID = $this->get('mailing_id'); if (CRM_Core_Permission::check('administer CiviCRM')) { $this->assign('isAdmin', 1); @@ -64,7 +64,7 @@ class CRM_Mailing_Form_Upload extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $mailingID = CRM_Utils_Request::retrieve('mid', 'Integer', $this, FALSE, NULL); //need to differentiate new/reuse mailing, CRM-2873 @@ -512,7 +512,7 @@ class CRM_Mailing_Form_Upload extends CRM_Core_Form { * @access public * @static */ - static function formRule($params, $files, $self) { + public static function formRule($params, $files, $self) { if (!empty($_POST['_qf_Import_refresh'])) { return TRUE; } diff --git a/CRM/Mailing/Info.php b/CRM/Mailing/Info.php index 5667c3648c..ecaa67fefa 100644 --- a/CRM/Mailing/Info.php +++ b/CRM/Mailing/Info.php @@ -139,7 +139,7 @@ class CRM_Mailing_Info extends CRM_Core_Component_Info { /** * @return bool */ - static function workflowEnabled() { + public static function workflowEnabled() { $config = CRM_Core_Config::singleton(); // early exit, since not true for most diff --git a/CRM/Mailing/MailStore.php b/CRM/Mailing/MailStore.php index bda3f3169a..330ab57150 100644 --- a/CRM/Mailing/MailStore.php +++ b/CRM/Mailing/MailStore.php @@ -86,14 +86,14 @@ class CRM_Mailing_MailStore { * * @return array array of ezcMail objects */ - function allMails() { + public function allMails() { return $this->fetchNext(0); } /** * Expunge the messages marked for deletion; stub function to be redefined by IMAP store */ - function expunge() {} + public function expunge() {} /** * Return the next X messages from the mail store @@ -102,7 +102,7 @@ class CRM_Mailing_MailStore { * * @return array array of ezcMail objects */ - function fetchNext($count = 1) { + public function fetchNext($count = 1) { if (isset($this->_transport->options->uidReferencing) and $this->_transport->options->uidReferencing) { $offset = array_shift($this->_transport->listUniqueIdentifiers()); } @@ -144,7 +144,7 @@ class CRM_Mailing_MailStore { * @throws Exception * @return string path to the Maildir's cur directory */ - function maildir($name) { + public function maildir($name) { $config = CRM_Core_Config::singleton(); $dir = $config->customFileUploadDir . DIRECTORY_SEPARATOR . $name; foreach (array( diff --git a/CRM/Mailing/MailStore/Imap.php b/CRM/Mailing/MailStore/Imap.php index 6abb1fdaa3..4fac23fb4d 100644 --- a/CRM/Mailing/MailStore/Imap.php +++ b/CRM/Mailing/MailStore/Imap.php @@ -52,7 +52,7 @@ class CRM_Mailing_MailStore_Imap extends CRM_Mailing_MailStore { * * @return \CRM_Mailing_MailStore_Imap */ - function __construct($host, $username, $password, $ssl = TRUE, $folder = 'INBOX') { + public function __construct($host, $username, $password, $ssl = TRUE, $folder = 'INBOX') { // default to INBOX if an empty string if (!$folder) { $folder = 'INBOX'; @@ -89,7 +89,7 @@ class CRM_Mailing_MailStore_Imap extends CRM_Mailing_MailStore { /** * Expunge the messages marked for deletion, CRM-7356 */ - function expunge() { + public function expunge() { $this->_transport->expunge(); } @@ -100,7 +100,7 @@ class CRM_Mailing_MailStore_Imap extends CRM_Mailing_MailStore { * * @return void */ - function markIgnored($nr) { + public function markIgnored($nr) { if ($this->_debug) { print "setting $nr as seen and moving it to the ignored mailbox\n"; } @@ -116,7 +116,7 @@ class CRM_Mailing_MailStore_Imap extends CRM_Mailing_MailStore { * * @return void */ - function markProcessed($nr) { + public function markProcessed($nr) { if ($this->_debug) { print "setting $nr as seen and moving it to the processed mailbox\n"; } diff --git a/CRM/Mailing/MailStore/Localdir.php b/CRM/Mailing/MailStore/Localdir.php index afb9eba73d..5924645fd4 100644 --- a/CRM/Mailing/MailStore/Localdir.php +++ b/CRM/Mailing/MailStore/Localdir.php @@ -48,7 +48,7 @@ class CRM_Mailing_MailStore_Localdir extends CRM_Mailing_MailStore { * * @return \CRM_Mailing_MailStore_Localdir */ - function __construct($dir) { + public function __construct($dir) { $this->_dir = $dir; $this->_ignored = $this->maildir(implode(DIRECTORY_SEPARATOR, array('CiviMail.ignored', date('Y'), date('m'), date('d')))); @@ -63,7 +63,7 @@ class CRM_Mailing_MailStore_Localdir extends CRM_Mailing_MailStore { * * @return array array of ezcMail objects */ - function fetchNext($count = 0) { + public function fetchNext($count = 0) { $mails = array(); $path = rtrim($this->_dir, DIRECTORY_SEPARATOR); @@ -118,7 +118,7 @@ class CRM_Mailing_MailStore_Localdir extends CRM_Mailing_MailStore { * @throws Exception * @return void */ - function markIgnored($file) { + public function markIgnored($file) { if ($this->_debug) { print "moving $file to ignored folder\n"; } @@ -136,7 +136,7 @@ class CRM_Mailing_MailStore_Localdir extends CRM_Mailing_MailStore { * @throws Exception * @return void */ - function markProcessed($file) { + public function markProcessed($file) { if ($this->_debug) { print "moving $file to processed folder\n"; } diff --git a/CRM/Mailing/MailStore/Maildir.php b/CRM/Mailing/MailStore/Maildir.php index 159f095825..87bad7409e 100644 --- a/CRM/Mailing/MailStore/Maildir.php +++ b/CRM/Mailing/MailStore/Maildir.php @@ -48,7 +48,7 @@ class CRM_Mailing_MailStore_Maildir extends CRM_Mailing_MailStore { * * @return \CRM_Mailing_MailStore_Maildir */ - function __construct($dir) { + public function __construct($dir) { $this->_dir = $dir; $this->_ignored = $this->maildir(implode(DIRECTORY_SEPARATOR, array('CiviMail.ignored', date('Y'), date('m'), date('d')))); @@ -63,7 +63,7 @@ class CRM_Mailing_MailStore_Maildir extends CRM_Mailing_MailStore { * * @return array array of ezcMail objects */ - function fetchNext($count = 0) { + public function fetchNext($count = 0) { $mails = array(); $parser = new ezcMailParser; //set property text attachment as file CRM-5408 @@ -100,7 +100,7 @@ class CRM_Mailing_MailStore_Maildir extends CRM_Mailing_MailStore { * @throws Exception * @return void */ - function markIgnored($file) { + public function markIgnored($file) { if ($this->_debug) { print "moving $file to ignored folder\n"; } @@ -118,7 +118,7 @@ class CRM_Mailing_MailStore_Maildir extends CRM_Mailing_MailStore { * @throws Exception * @return void */ - function markProcessed($file) { + public function markProcessed($file) { if ($this->_debug) { print "moving $file to processed folder\n"; } diff --git a/CRM/Mailing/MailStore/Mbox.php b/CRM/Mailing/MailStore/Mbox.php index 01e566843a..2e7451e2d6 100644 --- a/CRM/Mailing/MailStore/Mbox.php +++ b/CRM/Mailing/MailStore/Mbox.php @@ -48,7 +48,7 @@ class CRM_Mailing_MailStore_Mbox extends CRM_Mailing_MailStore { * * @return \CRM_Mailing_MailStore_Mbox */ - function __construct($file) { + public function __construct($file) { $this->_transport = new ezcMailMboxTransport($file); flock($this->_transport->fh, LOCK_EX); @@ -63,7 +63,7 @@ class CRM_Mailing_MailStore_Mbox extends CRM_Mailing_MailStore { * * @return void */ - function __destruct() { + public function __destruct() { if ($this->_leftToProcess === 0) { // FIXME: the ftruncate() call does not work for some reason if ($this->_debug) { @@ -81,7 +81,7 @@ class CRM_Mailing_MailStore_Mbox extends CRM_Mailing_MailStore { * * @return void */ - function markIgnored($nr) { + public function markIgnored($nr) { if ($this->_debug) { print "copying message $nr to ignored folder\n"; } @@ -98,7 +98,7 @@ class CRM_Mailing_MailStore_Mbox extends CRM_Mailing_MailStore { * * @return void */ - function markProcessed($nr) { + public function markProcessed($nr) { if ($this->_debug) { print "copying message $nr to processed folder\n"; } diff --git a/CRM/Mailing/MailStore/Pop3.php b/CRM/Mailing/MailStore/Pop3.php index b2e4b29255..f7381095da 100644 --- a/CRM/Mailing/MailStore/Pop3.php +++ b/CRM/Mailing/MailStore/Pop3.php @@ -51,7 +51,7 @@ class CRM_Mailing_MailStore_Pop3 extends CRM_Mailing_MailStore { * * @return \CRM_Mailing_MailStore_Pop3 */ - function __construct($host, $username, $password, $ssl = TRUE) { + public function __construct($host, $username, $password, $ssl = TRUE) { if ($this->_debug) { print "connecting to $host and authenticating as $username\n"; } @@ -71,7 +71,7 @@ class CRM_Mailing_MailStore_Pop3 extends CRM_Mailing_MailStore { * * @return void */ - function markIgnored($nr) { + public function markIgnored($nr) { if ($this->_debug) { print "fetching message $nr and putting it in the ignored mailbox\n"; } @@ -88,7 +88,7 @@ class CRM_Mailing_MailStore_Pop3 extends CRM_Mailing_MailStore { * * @return void */ - function markProcessed($nr) { + public function markProcessed($nr) { if ($this->_debug) { print "fetching message $nr and putting it in the processed mailbox\n"; } diff --git a/CRM/Mailing/Page/Browse.php b/CRM/Mailing/Page/Browse.php index fa5872d3c0..296b861870 100644 --- a/CRM/Mailing/Page/Browse.php +++ b/CRM/Mailing/Page/Browse.php @@ -88,7 +88,7 @@ class CRM_Mailing_Page_Browse extends CRM_Core_Page { * @access public * */ - function preProcess() { + public function preProcess() { $this->_unscheduled = $this->_archived = $archiveLinks = FALSE; $this->_mailingId = CRM_Utils_Request::retrieve('mid', 'Positive', $this); $this->_sms = CRM_Utils_Request::retrieve('sms', 'Positive', $this); @@ -124,7 +124,7 @@ class CRM_Mailing_Page_Browse extends CRM_Core_Page { * * @return void */ - function run() { + public function run() { $this->preProcess(); $newArgs = func_get_args(); @@ -292,7 +292,7 @@ class CRM_Mailing_Page_Browse extends CRM_Core_Page { return parent::run(); } - function search() { + public function search() { if ($this->_action & (CRM_Core_Action::ADD | CRM_Core_Action::UPDATE @@ -317,7 +317,7 @@ class CRM_Mailing_Page_Browse extends CRM_Core_Page { * * @return string */ - function whereClause(&$params, $sortBy = TRUE) { + public function whereClause(&$params, $sortBy = TRUE) { $values = array(); $clauses = array(); diff --git a/CRM/Mailing/Page/Common.php b/CRM/Mailing/Page/Common.php index 9b861563be..86fc7580f2 100644 --- a/CRM/Mailing/Page/Common.php +++ b/CRM/Mailing/Page/Common.php @@ -39,7 +39,7 @@ class CRM_Mailing_Page_Common extends CRM_Core_Page { * @return string * @throws Exception */ - function run() { + public function run() { $job_id = CRM_Utils_Request::retrieve('jid', 'Integer', CRM_Core_DAO::$_nullObject); $queue_id = CRM_Utils_Request::retrieve('qid', 'Integer', CRM_Core_DAO::$_nullObject); $hash = CRM_Utils_Request::retrieve('h', 'String', CRM_Core_DAO::$_nullObject); diff --git a/CRM/Mailing/Page/Component.php b/CRM/Mailing/Page/Component.php index 44e938a738..53ca5396e0 100644 --- a/CRM/Mailing/Page/Component.php +++ b/CRM/Mailing/Page/Component.php @@ -52,7 +52,7 @@ class CRM_Mailing_Page_Component extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Mailing_BAO_Component'; } @@ -61,7 +61,7 @@ class CRM_Mailing_Page_Component extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::UPDATE => array( @@ -90,7 +90,7 @@ class CRM_Mailing_Page_Component extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Mailing_Form_Component'; } @@ -99,7 +99,7 @@ class CRM_Mailing_Page_Component extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'Mailing Components'; } @@ -110,7 +110,7 @@ class CRM_Mailing_Page_Component extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return CRM_Utils_System::currentPath(); } @@ -119,7 +119,7 @@ class CRM_Mailing_Page_Component extends CRM_Core_Page_Basic { * @param null $pageArgs * @param null $sort */ - function run($args = NULL, $pageArgs = NULL, $sort = NULL) { + public function run($args = NULL, $pageArgs = NULL, $sort = NULL) { return parent::run($args, $pageArgs, "component_type, is_default desc, name"); } } diff --git a/CRM/Mailing/Page/Confirm.php b/CRM/Mailing/Page/Confirm.php index 8d582110fb..61b064c51b 100644 --- a/CRM/Mailing/Page/Confirm.php +++ b/CRM/Mailing/Page/Confirm.php @@ -37,7 +37,7 @@ class CRM_Mailing_Page_Confirm extends CRM_Core_Page { * @return string * @throws Exception */ - function run() { + public function run() { CRM_Utils_System::addHTMLHead(''); $contact_id = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject); diff --git a/CRM/Mailing/Page/Event.php b/CRM/Mailing/Page/Event.php index 5682db3a5f..365314eb9a 100644 --- a/CRM/Mailing/Page/Event.php +++ b/CRM/Mailing/Page/Event.php @@ -54,7 +54,7 @@ class CRM_Mailing_Page_Event extends CRM_Core_Page { * * @return void */ - function run() { + public function run() { $selector = &new CRM_Mailing_Selector_Event( CRM_Utils_Request::retrieve('event', 'String', $this), CRM_Utils_Request::retrieve('distinct', 'Boolean', $this), diff --git a/CRM/Mailing/Page/Optout.php b/CRM/Mailing/Page/Optout.php index 5b71d9f450..c39a7f01a8 100644 --- a/CRM/Mailing/Page/Optout.php +++ b/CRM/Mailing/Page/Optout.php @@ -33,7 +33,7 @@ * */ class CRM_Mailing_Page_Optout extends CRM_Mailing_Page_Common { - function run() { + public function run() { $this->_type = 'optout'; return parent::run(); } diff --git a/CRM/Mailing/Page/Preview.php b/CRM/Mailing/Page/Preview.php index b08987e3e3..dee140ce44 100644 --- a/CRM/Mailing/Page/Preview.php +++ b/CRM/Mailing/Page/Preview.php @@ -43,7 +43,7 @@ class CRM_Mailing_Page_Preview extends CRM_Core_Page { * * @return void */ - function run() { + public function run() { $session = CRM_Core_Session::singleton(); diff --git a/CRM/Mailing/Page/Report.php b/CRM/Mailing/Page/Report.php index 4accb4c74b..08398972af 100644 --- a/CRM/Mailing/Page/Report.php +++ b/CRM/Mailing/Page/Report.php @@ -45,28 +45,28 @@ class CRM_Mailing_Page_Report extends CRM_Core_Page_Basic { * * @return string Classname of BAO */ - function getBAOName() { + public function getBAOName() { return 'CRM_Mailing_BAO_Mailing'; } /** * @return null */ - function &links() { + public function &links() { return CRM_Core_DAO::$_nullObject; } /** * @return null */ - function editForm() { + public function editForm() { return NULL; } /** * @return string */ - function editName() { + public function editName() { return 'CiviMail Report'; } @@ -77,7 +77,7 @@ class CRM_Mailing_Page_Report extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/mailing/report'; } @@ -86,14 +86,14 @@ class CRM_Mailing_Page_Report extends CRM_Core_Page_Basic { * * @return string */ - function userContextParams($mode = NULL) { + public function userContextParams($mode = NULL) { return 'reset=1&mid=' . $this->_mailing_id; } /** * @return string */ - function run() { + public function run() { $this->_mailing_id = CRM_Utils_Request::retrieve('mid', 'Positive', $this); // check that the user has permission to access mailing id diff --git a/CRM/Mailing/Page/Resubscribe.php b/CRM/Mailing/Page/Resubscribe.php index c985727d63..a9931ea9cf 100644 --- a/CRM/Mailing/Page/Resubscribe.php +++ b/CRM/Mailing/Page/Resubscribe.php @@ -36,7 +36,7 @@ class CRM_Mailing_Page_Resubscribe extends CRM_Mailing_Page_Common { /** * @return string */ - function run() { + public function run() { $this->_type = 'resubscribe'; return parent::run(); } diff --git a/CRM/Mailing/Page/Tab.php b/CRM/Mailing/Page/Tab.php index 2c7037b760..ab13d3c9b6 100644 --- a/CRM/Mailing/Page/Tab.php +++ b/CRM/Mailing/Page/Tab.php @@ -54,7 +54,7 @@ class CRM_Mailing_Page_Tab extends CRM_Contact_Page_View { * return null * @access public */ - function browse() { + public function browse() { } /** @@ -63,7 +63,7 @@ class CRM_Mailing_Page_Tab extends CRM_Contact_Page_View { * @return void * @access public */ - function preProcess() { + public function preProcess() { $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); @@ -87,7 +87,7 @@ class CRM_Mailing_Page_Tab extends CRM_Contact_Page_View { * return null * @access public */ - function run() { + public function run() { $this->preProcess(); $this->browse(); diff --git a/CRM/Mailing/Page/Unsubscribe.php b/CRM/Mailing/Page/Unsubscribe.php index 8b7a258a7c..8eb8589d99 100644 --- a/CRM/Mailing/Page/Unsubscribe.php +++ b/CRM/Mailing/Page/Unsubscribe.php @@ -34,7 +34,7 @@ */ class CRM_Mailing_Page_Unsubscribe extends CRM_Mailing_Page_Common { - function run() { + public function run() { $this->_type = 'unsubscribe'; return parent::run(); } diff --git a/CRM/Mailing/Page/View.php b/CRM/Mailing/Page/View.php index 9b416f16b6..6010f15bf9 100644 --- a/CRM/Mailing/Page/View.php +++ b/CRM/Mailing/Page/View.php @@ -47,7 +47,7 @@ class CRM_Mailing_Page_View extends CRM_Core_Page { * Second check for visibility * Call a hook to see if hook wants to override visibility setting */ - function checkPermission() { + public function checkPermission() { if (!$this->_mailing) { return FALSE; } @@ -80,7 +80,7 @@ class CRM_Mailing_Page_View extends CRM_Core_Page { * * @return void */ - function run($id = NULL, $contactID = NULL, $print = TRUE, $allowID = FALSE) { + public function run($id = NULL, $contactID = NULL, $print = TRUE, $allowID = FALSE) { if (is_numeric($id)) { $this->_mailingID = $id; } diff --git a/CRM/Mailing/Selector/Browse.php b/CRM/Mailing/Selector/Browse.php index 72a34650ef..0a7f46b30c 100644 --- a/CRM/Mailing/Selector/Browse.php +++ b/CRM/Mailing/Selector/Browse.php @@ -63,7 +63,7 @@ class CRM_Mailing_Selector_Browse extends CRM_Core_Selector_Base implements CRM_ * @return \CRM_Mailing_Selector_Browse @access public */ - function __construct() { + public function __construct() { } /** @@ -73,7 +73,7 @@ class CRM_Mailing_Selector_Browse extends CRM_Core_Selector_Base implements CRM_ * @access public * */ - static function &links() { + public static function &links() { return self::$_links; } @@ -85,7 +85,7 @@ class CRM_Mailing_Selector_Browse extends CRM_Core_Selector_Base implements CRM_ * * @access public */ - function getPagerParams($action, &$params) { + public function getPagerParams($action, &$params) { $params['csvString'] = NULL; $params['rowCount'] = CRM_Utils_Pager::ROWCOUNT; $params['status'] = ts('Mailings %%StatusMessage%%'); @@ -103,7 +103,7 @@ class CRM_Mailing_Selector_Browse extends CRM_Core_Selector_Base implements CRM_ * @return array the column headers that need to be displayed * @access public */ - function &getColumnHeaders($action = NULL, $output = NULL) { + public function &getColumnHeaders($action = NULL, $output = NULL) { $mailing = CRM_Mailing_BAO_Mailing::getTableName(); $job = CRM_Mailing_BAO_MailingJob::getTableName(); if (!isset(self::$_columnHeaders)) { @@ -188,7 +188,7 @@ class CRM_Mailing_Selector_Browse extends CRM_Core_Selector_Base implements CRM_ * @return int Total number of rows * @access public */ - function getTotalCount($action) { + public function getTotalCount($action) { $job = CRM_Mailing_BAO_MailingJob::getTableName(); $mailing = CRM_Mailing_BAO_Mailing::getTableName(); $mailingACL = CRM_Mailing_BAO_Mailing::mailingACL(); @@ -220,7 +220,7 @@ LEFT JOIN civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul * * @return int the total number of rows for this action */ - function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { + public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { static $actionLinks = NULL; if (empty($actionLinks)) { $cancelExtra = ts('Are you sure you want to cancel this mailing?'); @@ -421,14 +421,14 @@ LEFT JOIN civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul * * @return string name of the file */ - function getExportFileName($output = 'csv') { + public function getExportFileName($output = 'csv') { return ts('CiviMail Mailings'); } /** * @param $parent */ - function setParent($parent) { + public function setParent($parent) { $this->_parent = $parent; } @@ -438,7 +438,7 @@ LEFT JOIN civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul * * @return int|string */ - function whereClause(&$params, $sortBy = TRUE) { + public function whereClause(&$params, $sortBy = TRUE) { $values = $clauses = array(); $isFormSubmitted = $this->_parent->get('hidden_find_mailings'); @@ -579,7 +579,7 @@ LEFT JOIN civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul return implode(' AND ', $clauses); } - function pagerAtoZ() { + public function pagerAtoZ() { $params = array(); $whereClause = $this->whereClause($params, FALSE); diff --git a/CRM/Mailing/Selector/Event.php b/CRM/Mailing/Selector/Event.php index a71578a5ce..15d525febd 100644 --- a/CRM/Mailing/Selector/Event.php +++ b/CRM/Mailing/Selector/Event.php @@ -93,7 +93,7 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C * @return \CRM_Mailing_Selector_Event @access public */ - function __construct($event, $distinct, $mailing, $job = NULL, $url = NULL) { + public function __construct($event, $distinct, $mailing, $job = NULL, $url = NULL) { $this->_event_type = $event; $this->_is_distinct = $distinct; $this->_mailing_id = $mailing; @@ -108,7 +108,7 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C * @access public * @static */ - static function &links() { + public static function &links() { return self::$_links; } @@ -120,7 +120,7 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C * * @access public */ - function getPagerParams($action, &$params) { + public function getPagerParams($action, &$params) { $params['csvString'] = NULL; $params['rowCount'] = CRM_Utils_Pager::ROWCOUNT; $params['status'] = ts('%1 %%StatusMessage%%', array(1 => $this->eventToTitle())); @@ -138,7 +138,7 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C * @return array the column headers that need to be displayed * @access public */ - function &getColumnHeaders($action = NULL, $output = NULL) { + public function &getColumnHeaders($action = NULL, $output = NULL) { $mailing = CRM_Mailing_BAO_Mailing::getTableName(); $contact = CRM_Contact_BAO_Contact::getTableName(); @@ -256,7 +256,7 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C * @return int Total number of rows * @access public */ - function getTotalCount($action) { + public function getTotalCount($action) { switch ($this->_event_type) { case 'queue': $event = new CRM_Mailing_Event_BAO_Queue(); @@ -347,7 +347,7 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C * * @return int the total number of rows for this action */ - function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { + public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { switch ($this->_event_type) { case 'queue': return CRM_Mailing_Event_BAO_Queue::getRows($this->_mailing_id, @@ -423,9 +423,9 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C * * @return string name of the file */ - function getExportFileName($output = 'csv') {} + public function getExportFileName($output = 'csv') {} - function eventToTitle() { + public function eventToTitle() { static $events = NULL; if (empty($events)) { @@ -450,7 +450,7 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C return $events[$this->_event_type]; } - function getTitle() { + public function getTitle() { return $this->eventToTitle(); } } diff --git a/CRM/Mailing/Selector/Search.php b/CRM/Mailing/Selector/Search.php index 85563166fa..2e514ccfca 100644 --- a/CRM/Mailing/Selector/Search.php +++ b/CRM/Mailing/Selector/Search.php @@ -195,7 +195,7 @@ class CRM_Mailing_Selector_Search extends CRM_Core_Selector_Base implements CRM_ * @access public * */ - static function &links() { + public static function &links() { if (!(self::$_links)) { list($context, $key) = func_get_args(); $extraParams = ($key) ? "&key={$key}" : NULL; @@ -233,7 +233,7 @@ class CRM_Mailing_Selector_Search extends CRM_Core_Selector_Base implements CRM_ * * @access public */ - function getPagerParams($action, &$params) { + public function getPagerParams($action, &$params) { $params['status'] = ts('Mailing Recipient') . ' %%StatusMessage%%'; $params['csvString'] = NULL; if ($this->_limit) { @@ -255,7 +255,7 @@ class CRM_Mailing_Selector_Search extends CRM_Core_Selector_Base implements CRM_ * @return int Total number of rows * @access public */ - function getTotalCount($action) { + public function getTotalCount($action) { return $this->_query->searchQuery(0, 0, NULL, TRUE, FALSE, FALSE, FALSE, @@ -275,7 +275,7 @@ class CRM_Mailing_Selector_Search extends CRM_Core_Selector_Base implements CRM_ * * @return int the total number of rows for this action */ - function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { + public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { $result = $this->_query->searchQuery($offset, $rowCount, $sort, FALSE, FALSE, FALSE, FALSE, @@ -391,14 +391,14 @@ class CRM_Mailing_Selector_Search extends CRM_Core_Selector_Base implements CRM_ /** * @return mixed */ - function alphabetQuery() { + public function alphabetQuery() { return $this->_query->searchQuery(NULL, NULL, NULL, FALSE, FALSE, TRUE); } /** * @return string */ - function &getQuery() { + public function &getQuery() { return $this->_query; } @@ -409,7 +409,7 @@ class CRM_Mailing_Selector_Search extends CRM_Core_Selector_Base implements CRM_ * * @return string name of the file */ - function getExportFileName($output = 'csv') { + public function getExportFileName($output = 'csv') { return ts('CiviCRM Mailing Search'); } } diff --git a/CRM/Mailing/StateMachine/Send.php b/CRM/Mailing/StateMachine/Send.php index cdc95d5289..21e25b6857 100644 --- a/CRM/Mailing/StateMachine/Send.php +++ b/CRM/Mailing/StateMachine/Send.php @@ -47,7 +47,7 @@ class CRM_Mailing_StateMachine_Send extends CRM_Core_StateMachine { * * @return \CRM_Mailing_StateMachine_Send CRM_Mailing_StateMachine */ - function __construct($controller, $action = CRM_Core_Action::NONE) { + public function __construct($controller, $action = CRM_Core_Action::NONE) { parent::__construct($controller, $action); $this->_pages = array( diff --git a/CRM/Mailing/Task.php b/CRM/Mailing/Task.php index 7e068c14be..f79d94e628 100644 --- a/CRM/Mailing/Task.php +++ b/CRM/Mailing/Task.php @@ -63,7 +63,7 @@ class CRM_Mailing_Task { * @static * @access public */ - static function &tasks() { + public static function &tasks() { if (!(self::$_tasks)) { self::$_tasks = array( 1 => array( @@ -88,7 +88,7 @@ class CRM_Mailing_Task { * @static * @access public */ - static function &taskTitles() { + public static function &taskTitles() { return array(); } @@ -101,7 +101,7 @@ class CRM_Mailing_Task { * @return array set of tasks that are valid for the user * @access public */ - static function &permissionedTaskTitles($permission) { + public static function &permissionedTaskTitles($permission) { $task = array(); return $task; } @@ -116,7 +116,7 @@ class CRM_Mailing_Task { * @static * @access public */ - static function getTask($value) { + public static function getTask($value) { self::tasks(); if (!$value || !CRM_Utils_Array::value($value, self::$_tasks)) { // make the print task by default diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php index 8d7d3dedf6..5c2df4099a 100644 --- a/CRM/Member/BAO/Membership.php +++ b/CRM/Member/BAO/Membership.php @@ -55,7 +55,7 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership { /** * */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -73,7 +73,7 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership { * @access public * @static */ - static function add(&$params, $ids = array()) { + public static function add(&$params, $ids = array()) { $oldStatus = $oldType = NULL; if (!empty($ids['membership'])) { CRM_Utils_Hook::pre('edit', 'Membership', $ids['membership'], $params); @@ -195,7 +195,7 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership { * @access public * @static */ - static function &getValues(&$params, &$values, $active = FALSE) { + public static function &getValues(&$params, &$values, $active = FALSE) { if (empty($params)) { return NULL; } @@ -235,7 +235,7 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership { * @access public * @static */ - static function create(&$params, &$ids, $skipRedirect = FALSE, $activityType = 'Membership Signup') { + public static function create(&$params, &$ids, $skipRedirect = FALSE, $activityType = 'Membership Signup') { // always calculate status if is_override/skipStatusCal is not true. // giving respect to is_override during import. CRM-4012 @@ -440,7 +440,7 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership { * @return Array array of contact_id of all related contacts. * @static */ - static function checkMembershipRelationship($membershipId, $contactId, $action = CRM_Core_Action::ADD) { + public static function checkMembershipRelationship($membershipId, $contactId, $action = CRM_Core_Action::ADD) { $contacts = array(); $membershipTypeID = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', $membershipId, 'membership_type_id'); @@ -507,7 +507,7 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $membership = new CRM_Member_DAO_Membership(); $membership->copyValues($params); @@ -542,7 +542,7 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership { * @return array of key value pairs * @access public */ - static function getStatusANDTypeValues($membershipId) { + public static function getStatusANDTypeValues($membershipId) { $values = array(); if (!$membershipId) { return $values; @@ -581,7 +581,7 @@ INNER JOIN civicrm_membership_type type ON ( type.id = membership.membership_ty * @return $results no of deleted Membership on success, false otherwise * @access public */ - static function del($membershipId) { + public static function del($membershipId) { //delete related first and then delete parent. self::deleteRelatedMemberships($membershipId); return self::deleteMembership($membershipId); @@ -597,7 +597,7 @@ INNER JOIN civicrm_membership_type type ON ( type.id = membership.membership_ty * @return $results no of deleted Membership on success, false otherwise * @access public */ - static function deleteMembership($membershipId) { + public static function deleteMembership($membershipId) { // CRM-12147, retrieve membership data before we delete it for hooks $params = array('id' => $membershipId); $memValues = array(); @@ -659,7 +659,7 @@ INNER JOIN civicrm_membership_type type ON ( type.id = membership.membership_ty * @return null * @static */ - static function deleteRelatedMemberships($ownerMembershipId, $contactId = NULL) { + public static function deleteRelatedMemberships($ownerMembershipId, $contactId = NULL) { if (!$ownerMembershipId && !$contactId) { return; } @@ -690,7 +690,7 @@ INNER JOIN civicrm_membership_type type ON ( type.id = membership.membership_ty * @static * @access public */ - static function activeMembers($memberships, $status = 'active') { + public static function activeMembers($memberships, $status = 'active') { $actives = array(); if ($status == 'active') { foreach ($memberships as $f => $v) { @@ -919,7 +919,7 @@ INNER JOIN civicrm_membership_type type ON ( type.id = membership.membership_ty * * @static */ - static function getMembershipBlock($pageID) { + public static function getMembershipBlock($pageID) { $membershipBlock = array(); $dao = new CRM_Member_DAO_MembershipBlock(); $dao->entity_table = 'civicrm_contribution_page'; @@ -961,7 +961,7 @@ INNER JOIN civicrm_membership_type type ON ( type.id = membership.membership_ty * @return array|bool * @static */ - static function getContactMembership($contactID, $memType, $isTest, $membershipId = NULL, $onlySameParentOrg = FALSE) { + public static function getContactMembership($contactID, $memType, $isTest, $membershipId = NULL, $onlySameParentOrg = FALSE) { $dao = new CRM_Member_DAO_Membership(); if ($membershipId) { $dao->id = $membershipId; @@ -1054,7 +1054,7 @@ INNER JOIN civicrm_membership_type type ON ( type.id = membership.membership_ty * @access public * @static */ - static function &importableFields($contactType = 'Individual', $status = TRUE) { + public static function &importableFields($contactType = 'Individual', $status = TRUE) { if (!self::$_importableFields) { if (!self::$_importableFields) { self::$_importableFields = array(); @@ -1115,7 +1115,7 @@ INNER JOIN civicrm_membership_type type ON ( type.id = membership.membership_ty * @retun array return array of all exportable fields * @static */ - static function &exportableFields() { + public static function &exportableFields() { $expFieldMembership = CRM_Member_DAO_Membership::export(); $expFieldsMemType = CRM_Member_DAO_MembershipType::export(); @@ -1238,7 +1238,7 @@ AND civicrm_membership.is_test = %2"; * * @return int */ - static function statusAvailabilty($contactId) { + public static function statusAvailabilty($contactId) { $membership = new CRM_Member_DAO_MembershipStatus(); $membership->whereAdd('is_active=1'); return $membership->count(); @@ -1534,7 +1534,7 @@ AND civicrm_membership.is_test = %2"; * @return void * @static */ - static function fixMembershipStatusBeforeRenew(&$currentMembership, $changeToday) { + public static function fixMembershipStatusBeforeRenew(&$currentMembership, $changeToday) { $today = NULL; if ($changeToday) { $today = CRM_Utils_Date::processDate($changeToday, NULL, FALSE, 'Y-m-d'); @@ -1618,7 +1618,7 @@ AND civicrm_membership.is_test = %2"; * @access public * @static */ - static function getContributionPageId($membershipID) { + public static function getContributionPageId($membershipID) { $query = " SELECT c.contribution_page_id as pageID FROM civicrm_membership_payment mp, civicrm_contribution c @@ -1639,7 +1639,7 @@ SELECT c.contribution_page_id as pageID * @param array $params formatted array of key => value.. * @static */ - static function updateRelatedMemberships($ownerMembershipId, $params) { + public static function updateRelatedMemberships($ownerMembershipId, $params) { $membership = new CRM_Member_DAO_Membership(); $membership->owner_membership_id = $ownerMembershipId; $membership->find(); @@ -1666,7 +1666,7 @@ SELECT c.contribution_page_id as pageID * @static * @access public */ - static function getMembershipFields($mode = NULL) { + public static function getMembershipFields($mode = NULL) { $fields = CRM_Member_DAO_Membership::export(); unset($fields['membership_contact_id']); @@ -1690,7 +1690,7 @@ SELECT c.contribution_page_id as pageID * @static * @access public */ - static function sortName($id) { + public static function sortName($id) { $id = CRM_Utils_Type::escape($id, 'Integer'); $query = " @@ -1713,7 +1713,7 @@ WHERE civicrm_membership.contact_id = civicrm_contact.id * @static * @access public */ - static function createRelatedMemberships(&$params, &$dao, $reset = FALSE) { + public static function createRelatedMemberships(&$params, &$dao, $reset = FALSE) { static $relatedContactIds = array(); if ($reset) { // not sure why a static var is in use here - we need a way to reset it from the test suite @@ -1878,7 +1878,7 @@ WHERE civicrm_membership.contact_id = civicrm_contact.id * @return boolean true if deleted false otherwise * @access public */ - static function deleteMembershipPayment($membershipId) { + public static function deleteMembershipPayment($membershipId) { $membesrshipPayment = new CRM_Member_DAO_MembershipPayment(); $membesrshipPayment->membership_id = $membershipId; @@ -1899,7 +1899,7 @@ WHERE civicrm_membership.contact_id = civicrm_contact.id * * @return array */ - static function &buildMembershipTypeValues(&$form, $membershipTypeID = NULL) { + public static function &buildMembershipTypeValues(&$form, $membershipTypeID = NULL) { $whereClause = " WHERE domain_id = ". CRM_Core_Config::domainID(); if (is_array($membershipTypeID)) { @@ -1956,7 +1956,7 @@ FROM civicrm_membership_type * @access public * @static */ - static function getContactMembershipCount($contactID, $activeOnly = FALSE) { + public static function getContactMembershipCount($contactID, $activeOnly = FALSE) { $select = "SELECT count(*) FROM civicrm_membership "; $where = "WHERE civicrm_membership.contact_id = {$contactID} AND civicrm_membership.is_test = 0 "; @@ -1982,7 +1982,7 @@ FROM civicrm_membership_type * @access public * @static */ - static function isCancelSubscriptionSupported($mid, $isNotCancelled = TRUE) { + public static function isCancelSubscriptionSupported($mid, $isNotCancelled = TRUE) { $cacheKeyString = "$mid"; $cacheKeyString .= $isNotCancelled ? '_1' : '_0'; @@ -2013,7 +2013,7 @@ FROM civicrm_membership_type * @access public * @static */ - static function isSubscriptionCancelled($mid) { + public static function isSubscriptionCancelled($mid) { $sql = " SELECT cr.contribution_status_id FROM civicrm_contribution_recur cr @@ -2043,7 +2043,7 @@ LEFT JOIN civicrm_membership mem ON ( cr.id = mem.contribution_recur_id ) * whose join_date is between $startDate and $endDate and * whose start_date is between $startDate and $endDate */ - static function getMembershipJoins($membershipTypeId, $startDate, $endDate, $isTest = 0) { + public static function getMembershipJoins($membershipTypeId, $startDate, $endDate, $isTest = 0) { $testClause = 'membership.is_test = 1'; if (!$isTest) { $testClause = '( membership.is_test IS NULL OR membership.is_test = 0 )'; @@ -2091,7 +2091,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND * whose join_date is before $startDate and * whose start_date is between $startDate and $endDate */ - static function getMembershipRenewals($membershipTypeId, $startDate, $endDate, $isTest = 0) { + public static function getMembershipRenewals($membershipTypeId, $startDate, $endDate, $isTest = 0) { $testClause = 'membership.is_test = 1'; if (!$isTest) { $testClause = '( membership.is_test IS NULL OR membership.is_test = 0 )'; @@ -2581,7 +2581,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND * * @return void */ - function processPriceSet($membershipId, $lineItem) { + public function processPriceSet($membershipId, $lineItem) { //FIXME : need to move this too if (!$membershipId || !is_array($lineItem) || CRM_Utils_System::isNull($lineItem) @@ -2610,7 +2610,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND * @return integer contribution id * @access public */ - static function getMembershipContributionId($membershipId) { + public static function getMembershipContributionId($membershipId) { $membershipPayment = new CRM_Member_DAO_MembershipPayment(); $membershipPayment->membership_id = $membershipId; @@ -2630,7 +2630,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND * @return array $result * @access public */ - static function updateAllMembershipStatus() { + public static function updateAllMembershipStatus() { //get all active statuses of membership, CRM-3984 $allStatus = CRM_Member_PseudoConstant::membershipStatus(); @@ -2796,7 +2796,7 @@ WHERE civicrm_membership.is_test = 0"; * * @return array */ - static function getAllContactMembership($contactID, $isTest = FALSE, $onlyLifeTime = FALSE) { + public static function getAllContactMembership($contactID, $isTest = FALSE, $onlyLifeTime = FALSE) { $contactMembershipType = array(); if (!$contactID) { return $contactMembershipType; @@ -2836,7 +2836,7 @@ WHERE civicrm_membership.is_test = 0"; * @return CRM_Contribute_BAO_Contribution * @static */ - static function recordMembershipContribution( &$params, $ids = array()) { + public static function recordMembershipContribution( &$params, $ids = array()) { $membershipId = $params['membership_id']; $contributionParams = array(); $config = CRM_Core_Config::singleton(); @@ -2912,7 +2912,7 @@ WHERE civicrm_membership.is_test = 0"; * @access public * @static */ - static function createLineItems(&$qf, $membershipType, &$priceSetId) { + public static function createLineItems(&$qf, $membershipType, &$priceSetId) { $qf->_priceSetId = $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', 'default_membership_type_amount', 'id', 'name'); if ($priceSetId) { $qf->_priceSet = $priceSets = current(CRM_Price_BAO_PriceSet::getSetDetail($priceSetId)); @@ -2948,7 +2948,7 @@ WHERE civicrm_membership.is_test = 0"; /** * @todo document me - I seem a bit out of date.... */ - static function _getActTypes() { + public static function _getActTypes() { $activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, FALSE, FALSE, 'name'); self::$_renewalActType = CRM_Utils_Array::key('Membership Renewal', $activityTypes); self::$_signupActType = CRM_Utils_Array::key('Membership Signup', $activityTypes); @@ -2964,7 +2964,7 @@ WHERE civicrm_membership.is_test = 0"; * @static * @access public */ - static function getContactsCancelledMembership($contactID, $isTest = FALSE) { + public static function getContactsCancelledMembership($contactID, $isTest = FALSE) { if (!$contactID) { return array(); } diff --git a/CRM/Member/BAO/MembershipBlock.php b/CRM/Member/BAO/MembershipBlock.php index aee125c87c..3c88da7354 100644 --- a/CRM/Member/BAO/MembershipBlock.php +++ b/CRM/Member/BAO/MembershipBlock.php @@ -36,7 +36,7 @@ class CRM_Member_BAO_MembershipBlock extends CRM_Member_DAO_MembershipBlock { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } /** @@ -49,7 +49,7 @@ class CRM_Member_BAO_MembershipBlock extends CRM_Member_DAO_MembershipBlock { * * @return object */ - static function create(&$params) { + public static function create(&$params) { $hook = empty($params['id']) ? 'create' : 'edit'; CRM_Utils_Hook::pre($hook, 'MembershipBlock', CRM_Utils_Array::value('id', $params), $params); $dao = new CRM_Member_DAO_MembershipBlock(); @@ -68,7 +68,7 @@ class CRM_Member_BAO_MembershipBlock extends CRM_Member_DAO_MembershipBlock { * @return bool * @static */ - static function del($id) { + public static function del($id) { $dao = new CRM_Member_DAO_MembershipBlock(); $dao->id = $id; $result = FALSE; diff --git a/CRM/Member/BAO/MembershipLog.php b/CRM/Member/BAO/MembershipLog.php index 8989cc63d6..193f7b1012 100644 --- a/CRM/Member/BAO/MembershipLog.php +++ b/CRM/Member/BAO/MembershipLog.php @@ -45,7 +45,7 @@ class CRM_Member_BAO_MembershipLog extends CRM_Member_DAO_MembershipLog { * * @return object */ - static function add(&$params, &$ids) { + public static function add(&$params, &$ids) { $membershipLog = new CRM_Member_DAO_MembershipLog(); $membershipLog->copyValues($params); @@ -64,7 +64,7 @@ class CRM_Member_BAO_MembershipLog extends CRM_Member_DAO_MembershipLog { * @static */ - static function del($membershipID) { + public static function del($membershipID) { $membershipLog = new CRM_Member_DAO_MembershipLog(); $membershipLog->membership_id = $membershipID; return $membershipLog->delete(); @@ -73,7 +73,7 @@ class CRM_Member_BAO_MembershipLog extends CRM_Member_DAO_MembershipLog { /** * @param int $contactID */ - static function resetModifiedID($contactID) { + public static function resetModifiedID($contactID) { $query = " UPDATE civicrm_membership_log SET modified_id = null diff --git a/CRM/Member/BAO/MembershipPayment.php b/CRM/Member/BAO/MembershipPayment.php index 446e57c108..f4b6128120 100644 --- a/CRM/Member/BAO/MembershipPayment.php +++ b/CRM/Member/BAO/MembershipPayment.php @@ -38,7 +38,7 @@ class CRM_Member_BAO_MembershipPayment extends CRM_Member_DAO_MembershipPayment /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } /** @@ -51,7 +51,7 @@ class CRM_Member_BAO_MembershipPayment extends CRM_Member_DAO_MembershipPayment * * @return object */ - static function create($params) { + public static function create($params) { $hook = empty($params['id']) ? 'create' : 'edit'; CRM_Utils_Hook::pre($hook, 'MembershipPayment', CRM_Utils_Array::value('id', $params), $params); $dao = new CRM_Member_DAO_MembershipPayment(); @@ -85,7 +85,7 @@ class CRM_Member_BAO_MembershipPayment extends CRM_Member_DAO_MembershipPayment * @return bool * @static */ - static function del($id) { + public static function del($id) { $dao = new CRM_Member_DAO_MembershipPayment(); $dao->id = $id; $result = FALSE; diff --git a/CRM/Member/BAO/MembershipStatus.php b/CRM/Member/BAO/MembershipStatus.php index 3762203a32..c2e197e95c 100644 --- a/CRM/Member/BAO/MembershipStatus.php +++ b/CRM/Member/BAO/MembershipStatus.php @@ -42,7 +42,7 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -56,7 +56,7 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $membershipStatus = new CRM_Member_DAO_MembershipStatus(); $membershipStatus->copyValues($params); if ($membershipStatus->find(TRUE)) { @@ -75,7 +75,7 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus { * @return Object DAO object on sucess, null otherwise * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Member_DAO_MembershipStatus', $id, 'is_active', $is_active); } @@ -90,7 +90,7 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus { * @access public * @static */ - static function create($params){ + public static function create($params){ $ids = array(); if(!empty($params['id'])){ $ids['membershipStatus'] = $params['id']; @@ -117,7 +117,7 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus { * * @return object */ - static function add(&$params, $ids = array()) { + public static function add(&$params, $ids = array()) { $id = CRM_Utils_Array::value('id', $params, CRM_Utils_Array::value('membershipStatus', $ids)); if (!$id) { CRM_Core_DAO::setCreateDefaults($params, self::getDefaults()); @@ -155,7 +155,7 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus { * Get defaults for new entity * @return array */ - static function getDefaults() { + public static function getDefaults() { return array( 'is_active' => FALSE, 'is_current_member' => FALSE, @@ -190,7 +190,7 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus { * @throws CRM_Core_Exception * @static */ - static function del($membershipStatusId) { + public static function del($membershipStatusId) { //check dependencies //checking if membership status is present in some other table $check = FALSE; diff --git a/CRM/Member/BAO/MembershipType.php b/CRM/Member/BAO/MembershipType.php index 4d5f103368..ad18cc6e62 100644 --- a/CRM/Member/BAO/MembershipType.php +++ b/CRM/Member/BAO/MembershipType.php @@ -44,7 +44,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -58,7 +58,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $membershipType = new CRM_Member_DAO_MembershipType(); $membershipType->copyValues($params); if ($membershipType->find(TRUE)) { @@ -77,7 +77,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { * @return Object DAO object on sucess, null otherwise * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Member_DAO_MembershipType', $id, 'is_active', $is_active); } @@ -92,7 +92,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { * * @return object */ - static function add(&$params, $ids = array()) { + public static function add(&$params, $ids = array()) { $id = CRM_Utils_Array::value('id', $params, CRM_Utils_Array::value('membershipType', $ids)); if (!$id) { if (!isset($params['is_active'])) { @@ -139,7 +139,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { * @return bool|mixed * @static */ - static function del($membershipTypeId) { + public static function del($membershipTypeId) { //check dependencies $check = FALSE; $status = array(); @@ -193,7 +193,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { * @param array $membershipType an array of membershipType-details. * @static */ - static function convertDayFormat(&$membershipType) { + public static function convertDayFormat(&$membershipType) { $periodDays = array( 'fixed_period_start_day', 'fixed_period_rollover_day', @@ -236,7 +236,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { * @return array * @static */ - static function getMembershipTypes($public = TRUE) { + public static function getMembershipTypes($public = TRUE) { $membershipTypes = array(); $membershipType = new CRM_Member_DAO_MembershipType(); $membershipType->is_active = 1; @@ -260,7 +260,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { * @return array|null * @static */ - static function getMembershipTypeDetails($membershipTypeId) { + public static function getMembershipTypeDetails($membershipTypeId) { $membershipTypeDetails = array(); $membershipType = new CRM_Member_DAO_MembershipType(); @@ -571,7 +571,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { * @return Array array of the details of membership types * @static */ - static function getMembershipTypesByOrg($orgID) { + public static function getMembershipTypesByOrg($orgID) { $membershipTypes = array(); $dao = new CRM_Member_DAO_MembershipType(); $dao->member_of_contact_id = $orgID; @@ -591,7 +591,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { * @return Array array of the details of membership types with Member of Contact id * @static */ - static function getMemberOfContactByMemTypes($membershipTypes) { + public static function getMemberOfContactByMemTypes($membershipTypes) { $memTypeOrgs = array(); if (empty($membershipTypes)) { return $memTypeOrgs; @@ -612,7 +612,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { * * @return array */ - static function getMembershipTypeOrganization($membershipTypeId = NULL) { + public static function getMembershipTypeOrganization($membershipTypeId = NULL) { $allmembershipTypes = array(); $membershipType = new CRM_Member_DAO_MembershipType(); @@ -637,7 +637,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { * @static * @access public */ - static function getMembershipTypeInfo() { + public static function getMembershipTypeInfo() { if (!self::$_membershipTypeInfo) { $orgs = $types = array(); @@ -743,7 +743,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { * * @param integer financial type id */ - static function updateAllPriceFieldValue($membershipTypeId, $params) { + public static function updateAllPriceFieldValue($membershipTypeId, $params) { if (!empty($params['minimum_fee'])){ $amount = $params['minimum_fee']; } diff --git a/CRM/Member/BAO/Query.php b/CRM/Member/BAO/Query.php index a40e1ad6f4..9464d3bcc1 100644 --- a/CRM/Member/BAO/Query.php +++ b/CRM/Member/BAO/Query.php @@ -37,7 +37,7 @@ class CRM_Member_BAO_Query { /** * @return array */ - static function &getFields() { + public static function &getFields() { $fields = CRM_Member_BAO_Membership::exportableFields(); return $fields; } @@ -50,7 +50,7 @@ class CRM_Member_BAO_Query { * @return void * @access public */ - static function select(&$query) { + public static function select(&$query) { // if membership mode add membership id if ($query->_mode & CRM_Contact_BAO_Query::MODE_MEMBER || CRM_Contact_BAO_Query::componentPresent($query->_returnProperties, 'membership_') @@ -134,7 +134,7 @@ class CRM_Member_BAO_Query { /** * @param $query */ - static function where(&$query) { + public static function where(&$query) { $grouping = NULL; foreach (array_keys($query->_params) as $id) { if (empty($query->_params[$id][0])) { @@ -154,7 +154,7 @@ class CRM_Member_BAO_Query { * @param $values * @param $query */ - static function whereClauseSingle(&$values, &$query) { + public static function whereClauseSingle(&$values, &$query) { list($name, $op, $value, $grouping, $wildcard) = $values; switch ($name) { case 'member_join_date_low': @@ -354,7 +354,7 @@ class CRM_Member_BAO_Query { * * @return null|string */ - static function from($name, $mode, $side) { + public static function from($name, $mode, $side) { $from = NULL; switch ($name) { case 'civicrm_membership': @@ -435,7 +435,7 @@ class CRM_Member_BAO_Query { /** * @param CRM_Core_Form $form */ - static function buildSearchForm(&$form) { + public static function buildSearchForm(&$form) { foreach (CRM_Member_PseudoConstant::membershipType() as $id => $Name) { $form->_membershipType = &$form->addElement('checkbox', "member_membership_type_id[$id]", NULL, $Name); } @@ -486,12 +486,12 @@ class CRM_Member_BAO_Query { * @param $row * @param int $id */ - static function searchAction(&$row, $id) {} + public static function searchAction(&$row, $id) {} /** * @param $tables */ - static function tableNames(&$tables) { + public static function tableNames(&$tables) { //add membership table if (!empty($tables['civicrm_membership_log']) || !empty($tables['civicrm_membership_status']) || CRM_Utils_Array::value('civicrm_membership_type', $tables)) { $tables = array_merge(array('civicrm_membership' => 1), $tables); diff --git a/CRM/Member/Controller/Search.php b/CRM/Member/Controller/Search.php index f07c3680ca..62b8589d2b 100644 --- a/CRM/Member/Controller/Search.php +++ b/CRM/Member/Controller/Search.php @@ -49,7 +49,7 @@ class CRM_Member_Controller_Search extends CRM_Core_Controller { /** * Class constructor */ - function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { + public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { parent::__construct($title, $modal); diff --git a/CRM/Member/Form.php b/CRM/Member/Form.php index 76e9840365..96bcd51e2b 100644 --- a/CRM/Member/Form.php +++ b/CRM/Member/Form.php @@ -58,7 +58,7 @@ class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment { */ protected $_fromEmails = array(); - function preProcess() { + public function preProcess() { $this->_action = CRM_Utils_Request::retrieve('action', 'String',$this, FALSE, 'add'); $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'membership'); $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); @@ -88,7 +88,7 @@ class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment { * * @return array defaults */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); if (isset($this->_id)) { $params = array('id' => $this->_id); @@ -199,7 +199,7 @@ class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment { * - contact_id * - soft_credit_contact_id */ - function storeContactFields($formValues){ + public function storeContactFields($formValues){ // in a 'standalone form' (contact id not in the url) the contact will be in the form values if (!empty($formValues['contact_id'])) { $this->_contactID = $formValues['contact_id']; diff --git a/CRM/Member/Form/Membership.php b/CRM/Member/Form/Membership.php index 2acf18d710..719be20e04 100644 --- a/CRM/Member/Form/Membership.php +++ b/CRM/Member/Form/Membership.php @@ -751,7 +751,7 @@ WHERE id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )'; * @access public * @static */ - static function formRule($params, $files, $self) { + public static function formRule($params, $files, $self) { $errors = array(); $priceSetId = CRM_Utils_Array::value('price_set_id', $params); @@ -1709,7 +1709,7 @@ WHERE id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )'; * @return boolean true if mail was sent successfully * @static */ - static function emailReceipt(&$form, &$formValues, &$membership) { + public static function emailReceipt(&$form, &$formValues, &$membership) { // retrieve 'from email id' for acknowledgement $receiptFrom = $formValues['from_email_address']; diff --git a/CRM/Member/Form/MembershipBlock.php b/CRM/Member/Form/MembershipBlock.php index 760898efba..73a5e8ccb8 100644 --- a/CRM/Member/Form/MembershipBlock.php +++ b/CRM/Member/Form/MembershipBlock.php @@ -51,7 +51,7 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { //parent::setDefaultValues(); $defaults = array(); if (isset($this->_id)) { @@ -223,7 +223,7 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa * @access public * @static */ - static function formRule($params, $files, $contributionPageId = NULL) { + public static function formRule($params, $files, $contributionPageId = NULL) { $errors = array(); if (!empty($params['member_price_set_id'])) { diff --git a/CRM/Member/Form/MembershipConfig.php b/CRM/Member/Form/MembershipConfig.php index 52b0b724d9..a81ffe783b 100644 --- a/CRM/Member/Form/MembershipConfig.php +++ b/CRM/Member/Form/MembershipConfig.php @@ -53,7 +53,7 @@ class CRM_Member_Form_MembershipConfig extends CRM_Core_Form { */ protected $_BAOName; - function preProcess() { + public function preProcess() { $this->_id = $this->get('id'); $this->_BAOName = $this->get('BAOName'); } @@ -66,7 +66,7 @@ class CRM_Member_Form_MembershipConfig extends CRM_Core_Form { * * @return array defaults */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); if (isset($this->_id)) { diff --git a/CRM/Member/Form/MembershipRenewal.php b/CRM/Member/Form/MembershipRenewal.php index 7fdac21f83..2d94f4027c 100644 --- a/CRM/Member/Form/MembershipRenewal.php +++ b/CRM/Member/Form/MembershipRenewal.php @@ -460,7 +460,7 @@ WHERE id IN ( ' . implode(' , ', array_keys($membershipType)) . ' )'; * @access public * @static */ - static function formRule($params) { + public static function formRule($params) { $errors = array(); if ($params['membership_type_id'][0] == 0) { $errors['membership_type_id'] = ts('Oops. It looks like you are trying to change the membership type while renewing the membership. Please click the "change membership type" link, and select a Membership Organization.'); diff --git a/CRM/Member/Form/MembershipType.php b/CRM/Member/Form/MembershipType.php index 4fb4fd228d..ff6dc33d8b 100644 --- a/CRM/Member/Form/MembershipType.php +++ b/CRM/Member/Form/MembershipType.php @@ -44,7 +44,7 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form_MembershipConfig { */ const MAX_CONTACTS = 50; - function preProcess() { + public function preProcess() { $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, 0 ); $this->_BAOName = 'CRM_Member_BAO_MembershipType'; $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add'); @@ -220,7 +220,7 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form_MembershipConfig { * @access public * @static */ - static function formRule($params) { + public static function formRule($params) { $errors = array(); if (!$params['name']) { diff --git a/CRM/Member/Form/MembershipView.php b/CRM/Member/Form/MembershipView.php index 0617073cf2..a613ee913a 100644 --- a/CRM/Member/Form/MembershipView.php +++ b/CRM/Member/Form/MembershipView.php @@ -52,7 +52,7 @@ class CRM_Member_Form_MembershipView extends CRM_Core_Form { * * @return text extra query parameters */ - function addContext() { + public function addContext() { $extra = ''; foreach (array('context', 'selectedChild') as $arg) { if ($value = CRM_Utils_Request::retrieve($arg, 'String', $this)) { @@ -67,7 +67,7 @@ class CRM_Member_Form_MembershipView extends CRM_Core_Form { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::DELETE => array( @@ -94,7 +94,7 @@ class CRM_Member_Form_MembershipView extends CRM_Core_Form { * @param array $owner primary membership info (membership_id, contact_id, membership_type ...) * */ - function relAction($action, $owner) { + public function relAction($action, $owner) { switch ($action) { case 'delete': $id = CRM_Utils_Request::retrieve('mid', 'Positive', $this); diff --git a/CRM/Member/Form/Search.php b/CRM/Member/Form/Search.php index e77fc90dc9..0a04bc8a7f 100644 --- a/CRM/Member/Form/Search.php +++ b/CRM/Member/Form/Search.php @@ -80,7 +80,7 @@ class CRM_Member_Form_Search extends CRM_Core_Form_Search { * @return void * @access public */ - function preProcess() { + public function preProcess() { $this->set('searchFormName', 'Search'); /** @@ -164,7 +164,7 @@ class CRM_Member_Form_Search extends CRM_Core_Form_Search { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { parent::buildQuickForm(); $this->addElement('text', 'sort_name', ts('Member Name or Email'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name')); @@ -200,7 +200,7 @@ class CRM_Member_Form_Search extends CRM_Core_Form_Search { * @return void * @access public */ - function postProcess() { + public function postProcess() { if ($this->_done) { return; } @@ -271,11 +271,11 @@ class CRM_Member_Form_Search extends CRM_Core_Form_Search { $controller->run(); } - function setDefaultValues() { + public function setDefaultValues() { return $this->_defaults; } - function fixFormValues() { + public function fixFormValues() { // if this search has been forced // then see if there are any get values, and if so over-ride the post values // note that this means that GET over-rides POST :) diff --git a/CRM/Member/Form/Task.php b/CRM/Member/Form/Task.php index 831b86436e..17dbbaec05 100644 --- a/CRM/Member/Form/Task.php +++ b/CRM/Member/Form/Task.php @@ -82,7 +82,7 @@ class CRM_Member_Form_Task extends CRM_Core_Form { * @return void * @access public */ - function preProcess() { + public function preProcess() { self::preProcessCommon($this); } @@ -90,7 +90,7 @@ class CRM_Member_Form_Task extends CRM_Core_Form { * @param CRM_Core_Form $form * @param bool $useTable */ - static function preProcessCommon(&$form, $useTable = FALSE) { + public static function preProcessCommon(&$form, $useTable = FALSE) { $form->_memberIds = array(); $values = $form->controller->exportValues($form->get('searchFormName')); @@ -174,7 +174,7 @@ class CRM_Member_Form_Task extends CRM_Core_Form { * @return void * @access public */ - function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { + public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { $this->addButtons(array( array( 'type' => $nextType, diff --git a/CRM/Member/Form/Task/Batch.php b/CRM/Member/Form/Task/Batch.php index 1355a0796f..f436b0e22e 100644 --- a/CRM/Member/Form/Task/Batch.php +++ b/CRM/Member/Form/Task/Batch.php @@ -63,7 +63,7 @@ class CRM_Member_Form_Task_Batch extends CRM_Member_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { /* * initialize the task and row fields */ @@ -92,7 +92,7 @@ class CRM_Member_Form_Task_Batch extends CRM_Member_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $ufGroupId = $this->get('ufGroupId'); if (!$ufGroupId) { @@ -196,7 +196,7 @@ class CRM_Member_Form_Task_Batch extends CRM_Member_Form_Task { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { if (empty($this->_fields)) { return; } diff --git a/CRM/Member/Form/Task/Delete.php b/CRM/Member/Form/Task/Delete.php index 46d2d18f82..5b5a1a3e97 100644 --- a/CRM/Member/Form/Task/Delete.php +++ b/CRM/Member/Form/Task/Delete.php @@ -54,7 +54,7 @@ class CRM_Member_Form_Task_Delete extends CRM_Member_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { //check for delete if (!CRM_Core_Permission::checkActionPermission('CiviMember', CRM_Core_Action::DELETE)) { CRM_Core_Error::fatal(ts('You do not have permission to access this page.')); @@ -69,7 +69,7 @@ class CRM_Member_Form_Task_Delete extends CRM_Member_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $this->addDefaultButtons(ts('Delete Memberships'), 'done'); } diff --git a/CRM/Member/Form/Task/Email.php b/CRM/Member/Form/Task/Email.php index a44b2a31b2..555fe89bcf 100644 --- a/CRM/Member/Form/Task/Email.php +++ b/CRM/Member/Form/Task/Email.php @@ -68,7 +68,7 @@ class CRM_Member_Form_Task_Email extends CRM_Member_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this); parent::preProcess(); diff --git a/CRM/Member/Form/Task/Label.php b/CRM/Member/Form/Task/Label.php index 08c9d988a2..4a302baada 100644 --- a/CRM/Member/Form/Task/Label.php +++ b/CRM/Member/Form/Task/Label.php @@ -45,7 +45,7 @@ class CRM_Member_Form_Task_Label extends CRM_Member_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); $this->setContactIDs(); CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'templates/CRM/Member/Form/Task/Label.js'); @@ -58,7 +58,7 @@ class CRM_Member_Form_Task_Label extends CRM_Member_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { CRM_Contact_Form_Task_Label::buildQuickForm($this); $this->addElement('checkbox', 'per_membership', ts('Print one label per Membership (rather than per contact)')); } @@ -71,7 +71,7 @@ class CRM_Member_Form_Task_Label extends CRM_Member_Form_Task { * @return array array of default values * @access public */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $format = CRM_Core_BAO_LabelFormat::getDefaultValues(); $defaults['label_name'] = CRM_Utils_Array::value('name', $format); diff --git a/CRM/Member/Form/Task/PDFLetter.php b/CRM/Member/Form/Task/PDFLetter.php index ae4af5d7d3..02ece46e74 100644 --- a/CRM/Member/Form/Task/PDFLetter.php +++ b/CRM/Member/Form/Task/PDFLetter.php @@ -56,7 +56,7 @@ class CRM_Member_Form_Task_PDFLetter extends CRM_Member_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { $this->skipOnHold = $this->skipDeceased = FALSE; parent::preProcess(); $this->setContactIDs(); @@ -68,7 +68,7 @@ class CRM_Member_Form_Task_PDFLetter extends CRM_Member_Form_Task { * (non-PHPdoc) * @see CRM_Core_Form::setDefaultValues() */ - function setDefaultValues() { + public function setDefaultValues() { return CRM_Contact_Form_Task_PDFLetterCommon::setDefaultValues(); } diff --git a/CRM/Member/Form/Task/PDFLetterCommon.php b/CRM/Member/Form/Task/PDFLetterCommon.php index 710ad6486f..af0887ac13 100644 --- a/CRM/Member/Form/Task/PDFLetterCommon.php +++ b/CRM/Member/Form/Task/PDFLetterCommon.php @@ -20,7 +20,7 @@ class CRM_Member_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDFLett * * @return void */ - static function postProcessMembers(&$form, $membershipIDs, $skipOnHold, $skipDeceased, $contactIDs) { + public static function postProcessMembers(&$form, $membershipIDs, $skipOnHold, $skipDeceased, $contactIDs) { list($formValues, $categories, $html_message, $messageToken, $returnProperties) = self::processMessageTemplate($form); @@ -57,7 +57,7 @@ class CRM_Member_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDFLett * * @return unknown */ - static function generateHTML($membershipIDs, $returnProperties, $skipOnHold, $skipDeceased, $messageToken, $html_message, $categories) { + public static function generateHTML($membershipIDs, $returnProperties, $skipOnHold, $skipDeceased, $messageToken, $html_message, $categories) { $memberships = CRM_Utils_Token::getMembershipTokenDetails($membershipIDs); foreach ($membershipIDs as $membershipID) { diff --git a/CRM/Member/Form/Task/PickProfile.php b/CRM/Member/Form/Task/PickProfile.php index 8a5bf18b57..89abc97cc7 100644 --- a/CRM/Member/Form/Task/PickProfile.php +++ b/CRM/Member/Form/Task/PickProfile.php @@ -63,7 +63,7 @@ class CRM_Member_Form_Task_PickProfile extends CRM_Member_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { // initialize the task and row fields parent::preProcess(); $session = CRM_Core_Session::singleton(); @@ -91,7 +91,7 @@ class CRM_Member_Form_Task_PickProfile extends CRM_Member_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $types = array('Membership'); $profiles = CRM_Core_BAO_UFGroup::getProfiles($types, TRUE); @@ -114,7 +114,7 @@ class CRM_Member_Form_Task_PickProfile extends CRM_Member_Form_Task { * * @return void */ - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Member_Form_Task_PickProfile', 'formRule')); } @@ -127,7 +127,7 @@ class CRM_Member_Form_Task_PickProfile extends CRM_Member_Form_Task { * @static * @access public */ - static function formRule($fields) { + public static function formRule($fields) { return TRUE; } diff --git a/CRM/Member/Form/Task/Print.php b/CRM/Member/Form/Task/Print.php index 4e0af6e985..dbf079b09f 100644 --- a/CRM/Member/Form/Task/Print.php +++ b/CRM/Member/Form/Task/Print.php @@ -44,7 +44,7 @@ class CRM_Member_Form_Task_Print extends CRM_Member_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preprocess(); // set print view, so that print templates are called @@ -75,7 +75,7 @@ class CRM_Member_Form_Task_Print extends CRM_Member_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { // // just need to add a javacript to popup the window for printing // diff --git a/CRM/Member/Form/Task/Result.php b/CRM/Member/Form/Task/Result.php index 432322701a..ceb03723ad 100644 --- a/CRM/Member/Form/Task/Result.php +++ b/CRM/Member/Form/Task/Result.php @@ -46,7 +46,7 @@ class CRM_Member_Form_Task_Result extends CRM_Member_Form_Task { * @return void * @access public */ - function preProcess() {} + public function preProcess() {} /** * Build the form object diff --git a/CRM/Member/Form/Task/SearchTaskHookSample.php b/CRM/Member/Form/Task/SearchTaskHookSample.php index e60e7e1621..57b5375860 100644 --- a/CRM/Member/Form/Task/SearchTaskHookSample.php +++ b/CRM/Member/Form/Task/SearchTaskHookSample.php @@ -44,7 +44,7 @@ class CRM_Member_Form_Task_SearchTaskHookSample extends CRM_Member_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); $rows = array(); // display name and membership details of all selected contacts diff --git a/CRM/Member/Import/Controller.php b/CRM/Member/Import/Controller.php index 279f33f128..d93e185f72 100644 --- a/CRM/Member/Import/Controller.php +++ b/CRM/Member/Import/Controller.php @@ -37,7 +37,7 @@ class CRM_Member_Import_Controller extends CRM_Core_Controller { /** * Class constructor */ - function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { + public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { parent::__construct($title, $modal); // lets get around the time limit issue if possible, CRM-2113 diff --git a/CRM/Member/Import/Field.php b/CRM/Member/Import/Field.php index 8a02e97e27..4506d30b03 100644 --- a/CRM/Member/Import/Field.php +++ b/CRM/Member/Import/Field.php @@ -92,7 +92,7 @@ class CRM_Member_Import_Field { * @param string $headerPattern * @param string $dataPattern */ - function __construct($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') { + public function __construct($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') { $this->_name = $name; $this->_title = $title; $this->_type = $type; @@ -102,7 +102,7 @@ class CRM_Member_Import_Field { $this->_value = NULL; } - function resetValue() { + public function resetValue() { $this->_value = NULL; } @@ -110,14 +110,14 @@ class CRM_Member_Import_Field { * The value is in string format. convert the value to the type of this field * and set the field value with the appropriate type */ - function setValue($value) { + public function setValue($value) { $this->_value = $value; } /** * @return bool */ - function validate() { + public function validate() { if (CRM_Utils_System::isNull($this->_value)) { return TRUE; diff --git a/CRM/Member/Import/Form/MapField.php b/CRM/Member/Import/Form/MapField.php index a12dd9fa2d..501fdb7ffc 100644 --- a/CRM/Member/Import/Form/MapField.php +++ b/CRM/Member/Import/Form/MapField.php @@ -309,7 +309,7 @@ class CRM_Member_Import_Form_MapField extends CRM_Import_Form_MapField { * @static * @access public */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); if (!array_key_exists('savedMapping', $fields)) { diff --git a/CRM/Member/Import/Parser.php b/CRM/Member/Import/Parser.php index b5f0a28ceb..75bc41af18 100644 --- a/CRM/Member/Import/Parser.php +++ b/CRM/Member/Import/Parser.php @@ -287,7 +287,7 @@ abstract class CRM_Member_Import_Parser extends CRM_Import_Parser { * @return void * @access public */ - function setActiveFields($fieldKeys) { + public function setActiveFields($fieldKeys) { $this->_activeFieldCount = count($fieldKeys); foreach ($fieldKeys as $key) { if (empty($this->_fields[$key])) { @@ -305,7 +305,7 @@ abstract class CRM_Member_Import_Parser extends CRM_Import_Parser { * @return array (reference ) associative array of name/value pairs * @access public */ - function &getActiveFieldParams() { + public function &getActiveFieldParams() { $params = array(); for ($i = 0; $i < $this->_activeFieldCount; $i++) { if (isset($this->_activeFields[$i]->_value) @@ -326,7 +326,7 @@ abstract class CRM_Member_Import_Parser extends CRM_Import_Parser { * @param string $headerPattern * @param string $dataPattern */ - function addField($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') { + public function addField($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') { if (empty($name)) { $this->_fields['doNotImport'] = new CRM_Member_Import_Field($name, $title, $type, $headerPattern, $dataPattern); } @@ -355,7 +355,7 @@ abstract class CRM_Member_Import_Parser extends CRM_Import_Parser { * @return void * @access public */ - function set($store, $mode = self::MODE_SUMMARY) { + public function set($store, $mode = self::MODE_SUMMARY) { $store->set('fileSize', $this->_fileSize); $store->set('lineCount', $this->_lineCount); $store->set('seperator', $this->_seperator); @@ -412,7 +412,7 @@ abstract class CRM_Member_Import_Parser extends CRM_Import_Parser { * @return void * @access public */ - static function exportCSV($fileName, $header, $data) { + public static function exportCSV($fileName, $header, $data) { $output = array(); $fd = fopen($fileName, 'w'); diff --git a/CRM/Member/Import/Parser/Membership.php b/CRM/Member/Import/Parser/Membership.php index e8e7c8e709..76beb5d3a0 100644 --- a/CRM/Member/Import/Parser/Membership.php +++ b/CRM/Member/Import/Parser/Membership.php @@ -58,7 +58,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { /** * Class constructor */ - function __construct(&$mapperKeys, $mapperLocType = NULL, $mapperPhoneType = NULL) { + public function __construct(&$mapperKeys, $mapperLocType = NULL, $mapperPhoneType = NULL) { parent::__construct(); $this->_mapperKeys = &$mapperKeys; } @@ -69,7 +69,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { * @return void * @access public */ - function init() { + public function init() { $fields = CRM_Member_BAO_Membership::importableFields($this->_contactType, FALSE); foreach ($fields as $name => $field) { @@ -115,7 +115,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { * @return boolean * @access public */ - function mapField(&$values) { + public function mapField(&$values) { return CRM_Import_Parser::VALID; } @@ -127,7 +127,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { * @return boolean the result of this processing * @access public */ - function preview(&$values) { + public function preview(&$values) { return $this->summary($values); } @@ -139,7 +139,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { * @return boolean the result of this processing * @access public */ - function summary(&$values) { + public function summary(&$values) { $erroneousField = NULL; $response = $this->setActiveFieldValues($values, $erroneousField); @@ -254,7 +254,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { * @return boolean the result of this processing * @access public */ - function import($onDuplicate, &$values) { + public function import($onDuplicate, &$values) { try{ // first make sure this is a valid line $response = $this->summary($values); @@ -571,7 +571,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { * @return array * @access public */ - function &getImportedMemberships() { + public function &getImportedMemberships() { return $this->_newMemberships; } @@ -581,7 +581,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { * @return void * @access public */ - function fini() {} + public function fini() {} /** * to calculate join, start and end dates @@ -594,7 +594,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { * * @access public */ - function formattedDates($calcDates, &$formatted) { + public function formattedDates($calcDates, &$formatted) { $dates = array( 'join_date', 'start_date', @@ -630,7 +630,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { * @return array|error * @access public */ - function membership_format_params($params, &$values, $create = FALSE) { + public function membership_format_params($params, &$values, $create = FALSE) { require_once 'api/v3/utils.php'; $fields = CRM_Member_DAO_Membership::fields(); _civicrm_api3_store_values($fields, $params, $values); diff --git a/CRM/Member/Page/AJAX.php b/CRM/Member/Page/AJAX.php index e20b6700a6..d0926ba1a9 100644 --- a/CRM/Member/Page/AJAX.php +++ b/CRM/Member/Page/AJAX.php @@ -41,7 +41,7 @@ class CRM_Member_Page_AJAX { /** * SetDefaults according to membership type */ - static function getMemberTypeDefaults() { + public static function getMemberTypeDefaults() { if (!$_POST['mtype']) { $details['name'] = ''; $details['auto_renew'] = ''; diff --git a/CRM/Member/Page/DashBoard.php b/CRM/Member/Page/DashBoard.php index 4a25ee8f2c..2a22db3c94 100644 --- a/CRM/Member/Page/DashBoard.php +++ b/CRM/Member/Page/DashBoard.php @@ -46,7 +46,7 @@ class CRM_Member_Page_DashBoard extends CRM_Core_Page { * @access public * */ - function preProcess() { + public function preProcess() { //CRM-13901 don't show dashboard to contacts with limited view writes & it does not relect //what they have access to @@ -434,7 +434,7 @@ class CRM_Member_Page_DashBoard extends CRM_Core_Page { * return null * @access public */ - function run() { + public function run() { $this->preProcess(); $controller = new CRM_Core_Controller_Simple('CRM_Member_Form_Search', ts('Member'), NULL); diff --git a/CRM/Member/Page/MembershipStatus.php b/CRM/Member/Page/MembershipStatus.php index b2cbb7fa6d..6691970d12 100644 --- a/CRM/Member/Page/MembershipStatus.php +++ b/CRM/Member/Page/MembershipStatus.php @@ -53,7 +53,7 @@ class CRM_Member_Page_MembershipStatus extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Member_BAO_MembershipStatus'; } @@ -62,7 +62,7 @@ class CRM_Member_Page_MembershipStatus extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::UPDATE => array( @@ -103,7 +103,7 @@ class CRM_Member_Page_MembershipStatus extends CRM_Core_Page_Basic { * @access public * */ - function run() { + public function run() { // get the requested action $action = CRM_Utils_Request::retrieve('action', 'String', // default to 'browse' @@ -135,7 +135,7 @@ class CRM_Member_Page_MembershipStatus extends CRM_Core_Page_Basic { * @access public * @static */ - function browse() { + public function browse() { // get all custom groups sorted by weight $membershipStatus = array(); $dao = new CRM_Member_DAO_MembershipStatus(); @@ -187,7 +187,7 @@ class CRM_Member_Page_MembershipStatus extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Member_Form_MembershipStatus'; } @@ -196,7 +196,7 @@ class CRM_Member_Page_MembershipStatus extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'Membership Status'; } @@ -207,7 +207,7 @@ class CRM_Member_Page_MembershipStatus extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/member/membershipStatus'; } } diff --git a/CRM/Member/Page/MembershipType.php b/CRM/Member/Page/MembershipType.php index 3c652ee654..68872956a2 100644 --- a/CRM/Member/Page/MembershipType.php +++ b/CRM/Member/Page/MembershipType.php @@ -53,7 +53,7 @@ class CRM_Member_Page_MembershipType extends CRM_Core_Page { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::UPDATE => array( @@ -94,7 +94,7 @@ class CRM_Member_Page_MembershipType extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { $this->browse(); // parent run @@ -109,7 +109,7 @@ class CRM_Member_Page_MembershipType extends CRM_Core_Page { * @access public * @static */ - function browse() { + public function browse() { // get all membership types sorted by weight $membershipType = array(); $dao = new CRM_Member_DAO_MembershipType(); diff --git a/CRM/Member/Page/Tab.php b/CRM/Member/Page/Tab.php index 5acd46dfd0..66fdd9103c 100644 --- a/CRM/Member/Page/Tab.php +++ b/CRM/Member/Page/Tab.php @@ -52,7 +52,7 @@ class CRM_Member_Page_Tab extends CRM_Core_Page { * return null * @access public */ - function browse() { + public function browse() { $links = self::links('all', $this->_isPaymentProcessor, $this->_accessContribution); $membership = array(); @@ -223,7 +223,7 @@ class CRM_Member_Page_Tab extends CRM_Core_Page { * return null * @access public */ - function view() { + public function view() { $controller = new CRM_Core_Controller_Simple( 'CRM_Member_Form_MembershipView', ts('View Membership'), @@ -242,7 +242,7 @@ class CRM_Member_Page_Tab extends CRM_Core_Page { * return null * @access public */ - function edit() { + public function edit() { // set https for offline cc transaction $mode = CRM_Utils_Request::retrieve('mode', 'String', $this); if ($mode == 'test' || $mode == 'live') { @@ -285,7 +285,7 @@ class CRM_Member_Page_Tab extends CRM_Core_Page { return $controller->run(); } - function preProcess() { + public function preProcess() { $context = CRM_Utils_Request::retrieve('context', 'String', $this); $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); @@ -316,7 +316,7 @@ class CRM_Member_Page_Tab extends CRM_Core_Page { * return null * @access public */ - function run() { + public function run() { $this->preProcess(); // check if we can process credit card membership @@ -557,7 +557,7 @@ class CRM_Member_Page_Tab extends CRM_Core_Page { * @return array self::$_membershipTypesLinks array of action links * @access public */ - static function &membershipTypesLinks() { + public static function &membershipTypesLinks() { if (!self::$_membershipTypesLinks) { self::$_membershipTypesLinks = array( CRM_Core_Action::VIEW => array( @@ -606,7 +606,7 @@ class CRM_Member_Page_Tab extends CRM_Core_Page { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Member_BAO_Membership'; } } diff --git a/CRM/Member/Page/UserDashboard.php b/CRM/Member/Page/UserDashboard.php index 6652eb2d92..3a0ec7ca80 100644 --- a/CRM/Member/Page/UserDashboard.php +++ b/CRM/Member/Page/UserDashboard.php @@ -44,7 +44,7 @@ class CRM_Member_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoard * return null * @access public */ - function listMemberships() { + public function listMemberships() { $membership = array(); $dao = new CRM_Member_DAO_Membership(); $dao->contact_id = $this->_contactId; @@ -98,7 +98,7 @@ class CRM_Member_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoard * return null * @access public */ - function run() { + public function run() { parent::preProcess(); $this->listMemberships(); } diff --git a/CRM/Member/Selector/Search.php b/CRM/Member/Selector/Search.php index 55ee441fe9..c036f55f88 100644 --- a/CRM/Member/Selector/Search.php +++ b/CRM/Member/Selector/Search.php @@ -279,7 +279,7 @@ class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_C * @param array $params * @access public */ - function getPagerParams($action, &$params) { + public function getPagerParams($action, &$params) { $params['status'] = ts('Member') . ' %%StatusMessage%%'; $params['csvString'] = NULL; if ($this->_limit) { @@ -301,7 +301,7 @@ class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_C * @return int Total number of rows * @access public */ - function getTotalCount($action) { + public function getTotalCount($action) { return $this->_query->searchQuery(0, 0, NULL, TRUE, FALSE, FALSE, FALSE, @@ -321,7 +321,7 @@ class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_C * * @return int the total number of rows for this action */ - function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { + public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { // check if we can process credit card registration $processors = CRM_Core_PseudoConstant::paymentProcessor(FALSE, FALSE, "billing_mode IN ( 1, 3 )" @@ -523,14 +523,14 @@ class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_C /** * @return mixed */ - function alphabetQuery() { + public function alphabetQuery() { return $this->_query->searchQuery(NULL, NULL, NULL, FALSE, FALSE, TRUE); } /** * @return string */ - function &getQuery() { + public function &getQuery() { return $this->_query; } @@ -541,7 +541,7 @@ class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_C * * @return string name of the file */ - function getExportFileName($output = 'csv') { + public function getExportFileName($output = 'csv') { return ts('CiviCRM Member Search'); } } diff --git a/CRM/Member/StateMachine/Search.php b/CRM/Member/StateMachine/Search.php index c83031f6e6..89a95315a5 100644 --- a/CRM/Member/StateMachine/Search.php +++ b/CRM/Member/StateMachine/Search.php @@ -79,7 +79,7 @@ class CRM_Member_StateMachine_Search extends CRM_Core_StateMachine { * @return string the name of the form that will handle the task * @access protected */ - function taskName($controller, $formName = 'Search') { + public function taskName($controller, $formName = 'Search') { // total hack, check POST vars and then session to determine stuff $value = CRM_Utils_Array::value('task', $_POST); if (!isset($value)) { @@ -95,7 +95,7 @@ class CRM_Member_StateMachine_Search extends CRM_Core_StateMachine { * @return string * @access public */ - function getTaskFormName() { + public function getTaskFormName() { return CRM_Utils_String::getClassName($this->_task); } @@ -104,7 +104,7 @@ class CRM_Member_StateMachine_Search extends CRM_Core_StateMachine { * we dont want to issue a reset of the state session when we are done processing a task * */ - function shouldReset() { + public function shouldReset() { return FALSE; } } diff --git a/CRM/Member/Task.php b/CRM/Member/Task.php index e340f24ee7..41f5b5029a 100644 --- a/CRM/Member/Task.php +++ b/CRM/Member/Task.php @@ -66,7 +66,7 @@ class CRM_Member_Task { * @static * @access public */ - static function &tasks() { + public static function &tasks() { if (!(self::$_tasks)) { self::$_tasks = array( 1 => array( @@ -136,7 +136,7 @@ class CRM_Member_Task { * @static * @access public */ - static function &taskTitles() { + public static function &taskTitles() { self::tasks(); $titles = array(); foreach (self::$_tasks as $id => $value) { @@ -154,7 +154,7 @@ class CRM_Member_Task { * @return array set of tasks that are valid for the user * @access public */ - static function &permissionedTaskTitles($permission) { + public static function &permissionedTaskTitles($permission) { $tasks = array(); if (($permission == CRM_Core_Permission::EDIT) || CRM_Core_Permission::check('edit memberships') @@ -184,7 +184,7 @@ class CRM_Member_Task { * @static * @access public */ - static function getTask($value) { + public static function getTask($value) { self::tasks(); if (!$value || !CRM_Utils_Array::value($value, self::$_tasks)) { // make the print task by default diff --git a/CRM/Note/Form/Note.php b/CRM/Note/Form/Note.php index a5781e58af..64fcbca8da 100644 --- a/CRM/Note/Form/Note.php +++ b/CRM/Note/Form/Note.php @@ -71,7 +71,7 @@ class CRM_Note_Form_Note extends CRM_Core_Form { */ protected $_parentId; - function preProcess() { + public function preProcess() { $this->_entityTable = $this->get('entityTable'); $this->_entityId = $this->get('entityId'); $this->_id = $this->get('id'); @@ -94,7 +94,7 @@ class CRM_Note_Form_Note extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); if ($this->_action & CRM_Core_Action::UPDATE) { diff --git a/CRM/PCP/BAO/PCP.php b/CRM/PCP/BAO/PCP.php index 48c36ce42f..0ef86421c2 100644 --- a/CRM/PCP/BAO/PCP.php +++ b/CRM/PCP/BAO/PCP.php @@ -45,7 +45,7 @@ class CRM_PCP_BAO_PCP extends CRM_PCP_DAO_PCP { /** * */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -60,7 +60,7 @@ class CRM_PCP_BAO_PCP extends CRM_PCP_DAO_PCP { * * @return object */ - static function add(&$params, $pcpBlock = TRUE) { + public static function add(&$params, $pcpBlock = TRUE) { if ($pcpBlock) { // action is taken depending upon the mode $dao = new CRM_PCP_DAO_PCPBlock(); @@ -97,7 +97,7 @@ class CRM_PCP_BAO_PCP extends CRM_PCP_DAO_PCP { * @static * @access public */ - static function displayName($id) { + public static function displayName($id) { $id = CRM_Utils_Type::escape($id, 'Integer'); $query = " @@ -118,7 +118,7 @@ WHERE civicrm_pcp.contact_id = civicrm_contact.id * @access public * @static */ - static function getPcpDashboardInfo($contactId) { + public static function getPcpDashboardInfo($contactId) { $links = self::pcpLinks(); $query = " @@ -238,7 +238,7 @@ ORDER BY target_entity_type, target_entity_id * * @return total amount */ - static function thermoMeter($pcpId) { + public static function thermoMeter($pcpId) { $query = " SELECT SUM(cc.total_amount) as total FROM civicrm_pcp pcp @@ -260,7 +260,7 @@ WHERE pcp.id = %1 AND cc.contribution_status_id =1 AND cc.is_test = 0"; * * @return array $honor */ - static function honorRoll($pcpId) { + public static function honorRoll($pcpId) { $query = " SELECT cc.id, cs.pcp_roll_nickname, cs.pcp_personal_note, cc.total_amount, cc.currency @@ -286,7 +286,7 @@ WHERE pcp.id = %1 AND cc.contribution_status_id =1 AND cc.is_test = 0"; * @return array (reference) of action links * @static */ - static function &pcpLinks() { + public static function &pcpLinks() { if (!(self::$_pcpLinks)) { $deleteExtra = ts('Are you sure you want to delete this Personal Campaign Page?') . '\n' . ts('This action cannot be undone.'); @@ -434,7 +434,7 @@ WHERE pcp.id = %1 AND cc.contribution_status_id =1 AND cc.is_test = 0"; * @param CRM_Core_Page $page * @param null $elements */ - function buildPcp($pcpId, &$page, &$elements = NULL) { + public function buildPcp($pcpId, &$page, &$elements = NULL) { $prms = array('id' => $pcpId); CRM_Core_DAO::commonRetrieve('CRM_PCP_DAO_PCP', $prms, $pcpInfo); @@ -593,7 +593,7 @@ WHERE pcp.id = %1 AND cc.contribution_status_id =1 AND cc.is_test = 0"; * @access public * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { switch ($is_active) { case 0: $is_active = 3; @@ -641,7 +641,7 @@ WHERE pcp.id = %1 AND cc.contribution_status_id =1 AND cc.is_test = 0"; * @access public * @static */ - static function sendStatusUpdate($pcpId, $newStatus, $isInitial = FALSE, $component = 'contribute') { + public static function sendStatusUpdate($pcpId, $newStatus, $isInitial = FALSE, $component = 'contribute') { $pcpStatusName = CRM_Core_OptionGroup::values("pcp_status", FALSE, FALSE, FALSE, NULL, 'name'); $pcpStatus = CRM_Core_OptionGroup::values("pcp_status"); $config = CRM_Core_Config::singleton(); @@ -734,7 +734,7 @@ WHERE pcp.id = %1 AND cc.contribution_status_id =1 AND cc.is_test = 0"; * @access public * @static */ - static function setDisable($id, $is_active) { + public static function setDisable($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_PCP_DAO_PCP', $id, 'is_active', $is_active); } @@ -748,7 +748,7 @@ WHERE pcp.id = %1 AND cc.contribution_status_id =1 AND cc.is_test = 0"; * @access public * @static */ - static function getStatus($pcpId, $component) { + public static function getStatus($pcpId, $component) { $query = " SELECT pb.is_active FROM civicrm_pcp pcp @@ -772,7 +772,7 @@ WHERE pcp.id = %1 AND cc.contribution_status_id =1 AND cc.is_test = 0"; * @access public * @static */ - static function getPcpBlockStatus($pageId, $component) { + public static function getPcpBlockStatus($pageId, $component) { $query = " SELECT pb.link_text as linkText FROM civicrm_pcp_block pb @@ -796,7 +796,7 @@ WHERE pcp.id = %1 AND cc.contribution_status_id =1 AND cc.is_test = 0"; * @static * */ - static function getPcpBlockInUse($id) { + public static function getPcpBlockInUse($id) { $query = " SELECT count(*) FROM civicrm_pcp pcp @@ -816,7 +816,7 @@ WHERE pcp.id = %1 AND cc.contribution_status_id =1 AND cc.is_test = 0"; * @access public * @static */ - static function checkEmailProfile($profileId) { + public static function checkEmailProfile($profileId) { $query = " SELECT field_name FROM civicrm_uf_field @@ -840,7 +840,7 @@ WHERE field_name like 'email%' And is_active = 1 And uf_group_id = %1"; * @access public * @static */ - static function getPcpPageTitle($pcpId, $component) { + public static function getPcpPageTitle($pcpId, $component) { if ($component == 'contribute') { $query = " SELECT cp.title @@ -870,7 +870,7 @@ WHERE field_name like 'email%' And is_active = 1 And uf_group_id = %1"; * @access public * @static */ - static function getPcpBlockEntityId($pcpId, $component) { + public static function getPcpBlockEntityId($pcpId, $component) { $entity_table = self::getPcpEntityTable($component); $query = " @@ -897,7 +897,7 @@ WHERE pcp.id = %1"; * @access public * @static */ - static function getPcpEntityTable($component) { + public static function getPcpEntityTable($component) { $entity_table_map = array( 'event' => 'civicrm_event', 'civicrm_event' => 'civicrm_event', diff --git a/CRM/PCP/Controller/PCP.php b/CRM/PCP/Controller/PCP.php index 6c43a3421c..2296f689f9 100644 --- a/CRM/PCP/Controller/PCP.php +++ b/CRM/PCP/Controller/PCP.php @@ -49,7 +49,7 @@ class CRM_PCP_Controller_PCP extends CRM_Core_Controller { /** * Class constructor */ - function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { + public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { parent::__construct($title, $modal); diff --git a/CRM/PCP/Form/Campaign.php b/CRM/PCP/Form/Campaign.php index 65c67d31e5..047a39b1be 100644 --- a/CRM/PCP/Form/Campaign.php +++ b/CRM/PCP/Form/Campaign.php @@ -64,7 +64,7 @@ class CRM_PCP_Form_Campaign extends CRM_Core_Form { parent::preProcess(); } - function setDefaultValues() { + public function setDefaultValues() { $dafaults = array(); $dao = new CRM_PCP_DAO_PCP(); @@ -158,7 +158,7 @@ class CRM_PCP_Form_Campaign extends CRM_Core_Form { * @access public * @static */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); if ($fields['goal_amount'] <= 0) { $errors['goal_amount'] = ts('Goal Amount should be a numeric value greater than zero.'); diff --git a/CRM/PCP/Form/PCP.php b/CRM/PCP/Form/PCP.php index 6fde01fb4d..f1eb051101 100644 --- a/CRM/PCP/Form/PCP.php +++ b/CRM/PCP/Form/PCP.php @@ -129,7 +129,7 @@ class CRM_PCP_Form_PCP extends CRM_Core_Form { * @return array array of default values * @access public */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $pageType = CRM_Utils_Request::retrieve('page_type', 'String', $this); @@ -201,7 +201,7 @@ class CRM_PCP_Form_PCP extends CRM_Core_Form { * @static * @access public */ - static function formRule($fields, $files, $form) {} + public static function formRule($fields, $files, $form) {} /** * Process the form diff --git a/CRM/PCP/Form/PCPAccount.php b/CRM/PCP/Form/PCPAccount.php index f7ee0559e1..7746b7cdca 100644 --- a/CRM/PCP/Form/PCPAccount.php +++ b/CRM/PCP/Form/PCPAccount.php @@ -119,7 +119,7 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $this->_defaults = array(); if ($this->_contactID) { foreach ($this->_fields as $name => $dontcare) { @@ -234,7 +234,7 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form { * @access public * @static */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); foreach ($fields as $key => $value) { if (strpos($key, 'email-') !== FALSE && !empty($value)) { diff --git a/CRM/PCP/Page/PCP.php b/CRM/PCP/Page/PCP.php index dfa2d43015..eb2af15442 100644 --- a/CRM/PCP/Page/PCP.php +++ b/CRM/PCP/Page/PCP.php @@ -51,7 +51,7 @@ class CRM_PCP_Page_PCP extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_PCP_BAO_PCP'; } @@ -60,7 +60,7 @@ class CRM_PCP_Page_PCP extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { // helper variable for nicer formatting $deleteExtra = ts('Are you sure you want to delete this Campaign Page ?'); @@ -118,7 +118,7 @@ class CRM_PCP_Page_PCP extends CRM_Core_Page_Basic { * @return void * @access public */ - function run() { + public function run() { // get the requested action $action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, @@ -167,7 +167,7 @@ class CRM_PCP_Page_PCP extends CRM_Core_Page_Basic { * @access public * @static */ - function browse($action = NULL) { + public function browse($action = NULL) { $this->_sortByCharacter = CRM_Utils_Request::retrieve('sortByCharacter', 'String', $this @@ -343,7 +343,7 @@ class CRM_PCP_Page_PCP extends CRM_Core_Page_Basic { } } - function search() { + public function search() { if ($this->_action & CRM_Core_Action::DELETE) { return; @@ -361,7 +361,7 @@ class CRM_PCP_Page_PCP extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_PCP_Form_PCP'; } @@ -370,7 +370,7 @@ class CRM_PCP_Page_PCP extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return ts('Personal Campaign Page'); } @@ -381,7 +381,7 @@ class CRM_PCP_Page_PCP extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/pcp'; } @@ -390,7 +390,7 @@ class CRM_PCP_Page_PCP extends CRM_Core_Page_Basic { * @param $whereClause * @param array $whereParams */ - function pagerAtoZ($whereClause, $whereParams) { + public function pagerAtoZ($whereClause, $whereParams) { $where = ''; if ($whereClause) { if (strpos($whereClause, ' AND') == 0) { diff --git a/CRM/PCP/Page/PCPInfo.php b/CRM/PCP/Page/PCPInfo.php index 1556af7715..fb3b167bc1 100644 --- a/CRM/PCP/Page/PCPInfo.php +++ b/CRM/PCP/Page/PCPInfo.php @@ -50,7 +50,7 @@ class CRM_PCP_Page_PCPInfo extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { $session = CRM_Core_Session::singleton(); $config = CRM_Core_Config::singleton(); $permissionCheck = FALSE; @@ -334,7 +334,7 @@ class CRM_PCP_Page_PCPInfo extends CRM_Core_Page { /** * @return string */ - function getTemplateFileName() { + public function getTemplateFileName() { if ($this->_id) { $templateFile = "CRM/PCP/Page/{$this->_id}/PCPInfo.tpl"; $template = &CRM_Core_Page::getTemplate(); diff --git a/CRM/PCP/StateMachine/PCP.php b/CRM/PCP/StateMachine/PCP.php index 4ef12edd40..f85bbd3c4a 100644 --- a/CRM/PCP/StateMachine/PCP.php +++ b/CRM/PCP/StateMachine/PCP.php @@ -48,7 +48,7 @@ class CRM_PCP_StateMachine_PCP extends CRM_Core_StateMachine { * @internal param \CRM_Contact_Import_Controller $object * @return \CRM_PCP_StateMachine_PCP CRM_Contact_Import_StateMachine */ - function __construct($controller, $action = CRM_Core_Action::NONE) { + public function __construct($controller, $action = CRM_Core_Action::NONE) { parent::__construct($controller, $action); $session = CRM_Core_Session::singleton(); diff --git a/CRM/Pledge/BAO/Pledge.php b/CRM/Pledge/BAO/Pledge.php index 2d2a3838dc..8fc4197c12 100644 --- a/CRM/Pledge/BAO/Pledge.php +++ b/CRM/Pledge/BAO/Pledge.php @@ -45,7 +45,7 @@ class CRM_Pledge_BAO_Pledge extends CRM_Pledge_DAO_Pledge { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -63,7 +63,7 @@ class CRM_Pledge_BAO_Pledge extends CRM_Pledge_DAO_Pledge { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $pledge = new CRM_Pledge_DAO_Pledge(); $pledge->copyValues($params); if ($pledge->find(TRUE)) { @@ -83,7 +83,7 @@ class CRM_Pledge_BAO_Pledge extends CRM_Pledge_DAO_Pledge { * * @return object */ - static function add(&$params) { + public static function add(&$params) { if (!empty($params['id'])) { CRM_Utils_Hook::pre('edit', 'Pledge', $params['id'], $params); } @@ -130,7 +130,7 @@ class CRM_Pledge_BAO_Pledge extends CRM_Pledge_DAO_Pledge { * @access public * @static */ - static function &getValues(&$params, &$values, $returnProperties = NULL) { + public static function &getValues(&$params, &$values, $returnProperties = NULL) { if (empty($params)) { return NULL; } @@ -147,7 +147,7 @@ class CRM_Pledge_BAO_Pledge extends CRM_Pledge_DAO_Pledge { * @access public * @static */ - static function &create(&$params) { + public static function &create(&$params) { //FIXME: a cludgy hack to fix the dates to MySQL format $dateFields = array('start_date', 'create_date', 'acknowledge_date', 'modified_date', 'cancel_date', 'end_date'); foreach ($dateFields as $df) { @@ -262,7 +262,7 @@ class CRM_Pledge_BAO_Pledge extends CRM_Pledge_DAO_Pledge { * @static * */ - static function deletePledge($id) { + public static function deletePledge($id) { CRM_Utils_Hook::pre('delete', 'Pledge', $id, CRM_Core_DAO::$_nullArray); $transaction = new CRM_Core_Transaction(); @@ -307,7 +307,7 @@ class CRM_Pledge_BAO_Pledge extends CRM_Pledge_DAO_Pledge { * * @return array|null */ - static function getTotalAmountAndCount($status = NULL, $startDate = NULL, $endDate = NULL) { + public static function getTotalAmountAndCount($status = NULL, $startDate = NULL, $endDate = NULL) { $where = array(); $select = $from = $queryDate = NULL; //get all status @@ -451,7 +451,7 @@ GROUP BY currency * @access public * @static */ - static function getHonorContacts($honorId) { + public static function getHonorContacts($honorId) { $params = array(); $honorDAO = new CRM_Contribute_DAO_ContributionSoft(); $honorDAO->contact_id = $honorId; @@ -495,7 +495,7 @@ GROUP BY currency * * @return void. */ - static function sendAcknowledgment(&$form, $params) { + public static function sendAcknowledgment(&$form, $params) { //handle Acknowledgment. $allPayments = $payments = array(); @@ -688,7 +688,7 @@ GROUP BY currency * @access public * @static */ - static function &exportableFields() { + public static function &exportableFields() { if (!self::$_exportableFields) { if (!self::$_exportableFields) { self::$_exportableFields = array(); @@ -752,7 +752,7 @@ GROUP BY currency * @return array associated array of pledge id(s) * @static */ - static function getContactPledges($contactID) { + public static function getContactPledges($contactID) { $pledgeDetails = array(); $pledgeStatuses = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); @@ -797,7 +797,7 @@ GROUP BY currency * @access public * @static */ - static function getContactPledgeCount($contactID) { + public static function getContactPledgeCount($contactID) { $query = "SELECT count(*) FROM civicrm_pledge WHERE civicrm_pledge.contact_id = {$contactID} AND civicrm_pledge.is_test = 0"; return CRM_Core_DAO::singleValueQuery($query); } @@ -1086,7 +1086,7 @@ SELECT pledge.contact_id as contact_id, * @param integer $pledgeStatusID * @return bool do financial transactions exist for this pledge? */ - static function pledgeHasFinancialTransactions($pledgeID, $pledgeStatusID) { + public static function pledgeHasFinancialTransactions($pledgeID, $pledgeStatusID) { if (empty($pledgeStatusID)) { //why would this happen? If we can see where it does then we can see if we should look it up //but assuming from form code it CAN be empty diff --git a/CRM/Pledge/BAO/PledgeBlock.php b/CRM/Pledge/BAO/PledgeBlock.php index a4a58f0ba8..a0fdf6cfba 100644 --- a/CRM/Pledge/BAO/PledgeBlock.php +++ b/CRM/Pledge/BAO/PledgeBlock.php @@ -37,7 +37,7 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -55,7 +55,7 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $pledgeBlock = new CRM_Pledge_DAO_PledgeBlock(); $pledgeBlock->copyValues($params); if ($pledgeBlock->find(TRUE)) { @@ -74,7 +74,7 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock { * @access public * @static */ - static function &create(&$params) { + public static function &create(&$params) { $transaction = new CRM_Core_Transaction(); $pledgeBlock = self::add($params); @@ -100,7 +100,7 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock { * * @return object */ - static function add(&$params) { + public static function add(&$params) { if (!empty($params['id'])) { CRM_Utils_Hook::pre('edit', 'PledgeBlock', $params['id'], $params); @@ -155,7 +155,7 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock { * @access public * @static */ - static function deletePledgeBlock($id) { + public static function deletePledgeBlock($id) { CRM_Utils_Hook::pre('delete', 'PledgeBlock', $id, CRM_Core_DAO::$_nullArray); $transaction = new CRM_Core_Transaction(); @@ -181,7 +181,7 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock { * @return array * @static */ - static function getPledgeBlock($pageID) { + public static function getPledgeBlock($pageID) { $pledgeBlock = array(); $dao = new CRM_Pledge_DAO_PledgeBlock(); @@ -200,7 +200,7 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock { * @param CRM_Core_Form $form * @static */ - static function buildPledgeBlock($form) { + public static function buildPledgeBlock($form) { //build pledge payment fields. if (!empty($form->_values['pledge_id'])) { //get all payments required details. diff --git a/CRM/Pledge/BAO/PledgePayment.php b/CRM/Pledge/BAO/PledgePayment.php index 607ab33deb..efba600126 100644 --- a/CRM/Pledge/BAO/PledgePayment.php +++ b/CRM/Pledge/BAO/PledgePayment.php @@ -37,7 +37,7 @@ class CRM_Pledge_BAO_PledgePayment extends CRM_Pledge_DAO_PledgePayment { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -49,7 +49,7 @@ class CRM_Pledge_BAO_PledgePayment extends CRM_Pledge_DAO_PledgePayment { * @return array associated array of pledge payment details * @static */ - static function getPledgePayments($pledgeId) { + public static function getPledgePayments($pledgeId) { $query = " SELECT civicrm_pledge_payment.id id, scheduled_amount, @@ -97,7 +97,7 @@ WHERE pledge_id = %1 * * @return pledge */ - static function create($params) { + public static function create($params) { $transaction = new CRM_Core_Transaction(); $contributionStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); @@ -168,7 +168,7 @@ WHERE pledge_id = %1 * @return pledge payment id * @static */ - static function add($params) { + public static function add($params) { if (!empty($params['id'])) { CRM_Utils_Hook::pre('edit', 'PledgePayment', $params['id'], $params); } @@ -212,7 +212,7 @@ WHERE pledge_id = %1 * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $payment = new CRM_Pledge_BAO_PledgePayment; $payment->copyValues($params); if ($payment->find(TRUE)) { @@ -230,7 +230,7 @@ WHERE pledge_id = %1 * @return int pledge payment id * @static */ - static function del($id) { + public static function del($id) { $payment = new CRM_Pledge_DAO_PledgePayment(); $payment->id = $id; if ($payment->find()) { @@ -259,7 +259,7 @@ WHERE pledge_id = %1 * @static * */ - static function deletePayments($id) { + public static function deletePayments($id) { if (!CRM_Utils_Rule::positiveInteger($id)) { return FALSE; } @@ -293,7 +293,7 @@ WHERE pledge_id = %1 * @access public * @static */ - static function resetPledgePayment($contributionID) { + public static function resetPledgePayment($contributionID) { //get all status $allStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); @@ -511,7 +511,7 @@ WHERE civicrm_pledge.id = %2 * @return array $newdate Next scheduled date as an array * @static */ - static function calculateBaseScheduleDate(&$params) { + public static function calculateBaseScheduleDate(&$params) { $date = array(); $scheduled_date = CRM_Utils_Date::processDate($params['scheduled_date']); $date['year'] = (int) substr($scheduled_date, 0, 4); @@ -555,7 +555,7 @@ WHERE civicrm_pledge.id = %2 * @return formatted date * */ - static function calculateNextScheduledDate(&$params, $paymentNo, $basePaymentDate = NULL) { + public static function calculateNextScheduledDate(&$params, $paymentNo, $basePaymentDate = NULL) { if (!$basePaymentDate) { $basePaymentDate = self::calculateBaseScheduleDate($params); } @@ -576,7 +576,7 @@ WHERE civicrm_pledge.id = %2 * @return int $statusId calculated status id of pledge * @static */ - static function calculatePledgeStatus($pledgeId) { + public static function calculatePledgeStatus($pledgeId) { $paymentStatusTypes = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); //retrieve all pledge payments for this particular pledge @@ -660,7 +660,7 @@ WHERE civicrm_pledge_payment.pledge_id = %1 * * @static */ - static function updateReminderDetails($paymentId) { + public static function updateReminderDetails($paymentId) { $query = " UPDATE civicrm_pledge_payment SET civicrm_pledge_payment.reminder_date = CURRENT_TIMESTAMP, @@ -680,7 +680,7 @@ WHERE civicrm_pledge_payment.id = {$paymentId} * @return array associated array of pledge details * @static */ - static function getOldestPledgePayment($pledgeID, $limit = 1) { + public static function getOldestPledgePayment($pledgeID, $limit = 1) { //get pending / overdue statuses $pledgeStatuses = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); @@ -727,7 +727,7 @@ LIMIT 0, %2 * @param int $pPaymentId * @param int $paymentStatusID */ - static function adjustPledgePayment($pledgeID, $actualAmount, $pledgeScheduledAmount, $paymentContributionId = NULL, $pPaymentId = NULL, $paymentStatusID = NULL) { + public static function adjustPledgePayment($pledgeID, $actualAmount, $pledgeScheduledAmount, $paymentContributionId = NULL, $pPaymentId = NULL, $paymentStatusID = NULL) { $allStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); if ($paymentStatusID == array_search('Cancelled', $allStatus) || $paymentStatusID == array_search('Refunded', $allStatus)) { $query = " diff --git a/CRM/Pledge/BAO/Query.php b/CRM/Pledge/BAO/Query.php index 02657fd62d..138301ef1a 100644 --- a/CRM/Pledge/BAO/Query.php +++ b/CRM/Pledge/BAO/Query.php @@ -37,7 +37,7 @@ class CRM_Pledge_BAO_Query { /** * @return array */ - static function &getFields() { + public static function &getFields() { $fields = CRM_Pledge_BAO_Pledge::exportableFields(); return $fields; } @@ -50,7 +50,7 @@ class CRM_Pledge_BAO_Query { * @return void * @access public */ - static function select(&$query) { + public static function select(&$query) { if (($query->_mode & CRM_Contact_BAO_Query::MODE_PLEDGE) || !empty($query->_returnProperties['pledge_id'])) { $query->_select['pledge_id'] = 'civicrm_pledge.id as pledge_id'; $query->_element['pledge_id'] = 1; @@ -204,7 +204,7 @@ class CRM_Pledge_BAO_Query { /** * @param $query */ - static function where(&$query) { + public static function where(&$query) { $grouping = NULL; foreach (array_keys($query->_params) as $id) { if (empty($query->_params[$id][0])) { @@ -224,7 +224,7 @@ class CRM_Pledge_BAO_Query { * @param $values * @param $query */ - static function whereClauseSingle(&$values, &$query) { + public static function whereClauseSingle(&$values, &$query) { list($name, $op, $value, $grouping, $wildcard) = $values; switch ($name) { @@ -427,7 +427,7 @@ class CRM_Pledge_BAO_Query { * * @return null|string */ - static function from($name, $mode, $side) { + public static function from($name, $mode, $side) { $from = NULL; switch ($name) { @@ -467,7 +467,7 @@ class CRM_Pledge_BAO_Query { * @return string * @access public */ - function qill() { + public function qill() { return (isset($this->_qill)) ? $this->_qill : ""; } @@ -508,7 +508,7 @@ class CRM_Pledge_BAO_Query { /** * This includes any extra fields that might need for export etc */ - static function extraReturnProperties($mode) { + public static function extraReturnProperties($mode) { $properties = NULL; if ($mode & CRM_Contact_BAO_Query::MODE_PLEDGE) { @@ -539,7 +539,7 @@ class CRM_Pledge_BAO_Query { /** * @param CRM_Core_Form $form */ - static function buildSearchForm(&$form) { + public static function buildSearchForm(&$form) { // pledge related dates CRM_Core_Form_Date::buildDateRange($form, 'pledge_start_date', 1, '_low', '_high', ts('From'), FALSE); CRM_Core_Form_Date::buildDateRange($form, 'pledge_end_date', 1, '_low', '_high', ts('From'), FALSE); @@ -628,12 +628,12 @@ class CRM_Pledge_BAO_Query { * @param $row * @param int $id */ - static function searchAction(&$row, $id) {} + public static function searchAction(&$row, $id) {} /** * @param $tables */ - static function tableNames(&$tables) { + public static function tableNames(&$tables) { //add status table if (!empty($tables['pledge_status']) || !empty($tables['civicrm_pledge_payment'])) { $tables = array_merge(array('civicrm_pledge' => 1), $tables); diff --git a/CRM/Pledge/Controller/Search.php b/CRM/Pledge/Controller/Search.php index 656d79612a..fdd3afa494 100644 --- a/CRM/Pledge/Controller/Search.php +++ b/CRM/Pledge/Controller/Search.php @@ -49,7 +49,7 @@ class CRM_Pledge_Controller_Search extends CRM_Core_Controller { /** * Class constructor */ - function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { + public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { parent::__construct($title, $modal); diff --git a/CRM/Pledge/Form/Payment.php b/CRM/Pledge/Form/Payment.php index f6cf6c4400..c8e46d9023 100644 --- a/CRM/Pledge/Form/Payment.php +++ b/CRM/Pledge/Form/Payment.php @@ -72,7 +72,7 @@ class CRM_Pledge_Form_Payment extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); if ($this->_id) { $params['id'] = $this->_id; diff --git a/CRM/Pledge/Form/Pledge.php b/CRM/Pledge/Form/Pledge.php index 2f89c42151..0da5026d68 100644 --- a/CRM/Pledge/Form/Pledge.php +++ b/CRM/Pledge/Form/Pledge.php @@ -139,7 +139,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = $this->_values; $fields = array(); @@ -457,7 +457,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form { * @access public * @static */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); if ($fields['amount'] <= 0) { diff --git a/CRM/Pledge/Form/Search.php b/CRM/Pledge/Form/Search.php index bceed11eff..85108e0d84 100644 --- a/CRM/Pledge/Form/Search.php +++ b/CRM/Pledge/Form/Search.php @@ -76,7 +76,7 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form_Search { * @return void * @access public */ - function preProcess() { + public function preProcess() { /** * set the button names @@ -163,7 +163,7 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form_Search { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { parent::buildQuickForm(); $this->addElement('text', 'sort_name', ts('Pledger Name or Email'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name')); @@ -199,7 +199,7 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form_Search { * @return void * @access public */ - function postProcess() { + public function postProcess() { if ($this->_done) { return; } @@ -295,7 +295,7 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form_Search { * @access public * @see valid_date */ - function addRules() { + public function addRules() { $this->addFormRule(array('CRM_Pledge_Form_Search', 'formRule')); } @@ -308,7 +308,7 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form_Search { * @static * @access public */ - static function formRule($fields) { + public static function formRule($fields) { $errors = array(); if (!empty($errors)) { @@ -325,13 +325,13 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form_Search { * * @return array the default array reference */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $defaults = $this->_formValues; return $defaults; } - function fixFormValues() { + public function fixFormValues() { if (!$this->_force) { return; } @@ -419,7 +419,7 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form_Search { /** * @return null */ - function getFormValues() { + public function getFormValues() { return NULL; } diff --git a/CRM/Pledge/Form/Task.php b/CRM/Pledge/Form/Task.php index 611e303776..81cbb2080d 100644 --- a/CRM/Pledge/Form/Task.php +++ b/CRM/Pledge/Form/Task.php @@ -75,7 +75,7 @@ class CRM_Pledge_Form_Task extends CRM_Core_Form { * @return void * @access public */ - function preProcess() { + public function preProcess() { self::preProcessCommon($this); } @@ -83,7 +83,7 @@ class CRM_Pledge_Form_Task extends CRM_Core_Form { * @param CRM_Core_Form $form * @param bool $useTable */ - static function preProcessCommon(&$form, $useTable = FALSE) { + public static function preProcessCommon(&$form, $useTable = FALSE) { $form->_pledgeIds = array(); $values = $form->controller->exportValues('Search'); @@ -159,7 +159,7 @@ class CRM_Pledge_Form_Task extends CRM_Core_Form { * @return void * @access public */ - function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { + public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { $this->addButtons(array( array( 'type' => $nextType, diff --git a/CRM/Pledge/Form/Task/Delete.php b/CRM/Pledge/Form/Task/Delete.php index a7785859fa..4ecac3158e 100644 --- a/CRM/Pledge/Form/Task/Delete.php +++ b/CRM/Pledge/Form/Task/Delete.php @@ -68,7 +68,7 @@ class CRM_Pledge_Form_Task_Delete extends CRM_Pledge_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { $this->addDefaultButtons(ts('Delete Pledges'), 'done'); } diff --git a/CRM/Pledge/Form/Task/Print.php b/CRM/Pledge/Form/Task/Print.php index dc721fb879..338ceb307e 100644 --- a/CRM/Pledge/Form/Task/Print.php +++ b/CRM/Pledge/Form/Task/Print.php @@ -45,7 +45,7 @@ class CRM_Pledge_Form_Task_Print extends CRM_Pledge_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preprocess(); // set print view, so that print templates are called @@ -76,7 +76,7 @@ class CRM_Pledge_Form_Task_Print extends CRM_Pledge_Form_Task { * * @return void */ - function buildQuickForm() { + public function buildQuickForm() { // // just need to add a javacript to popup the window for printing // diff --git a/CRM/Pledge/Form/Task/Result.php b/CRM/Pledge/Form/Task/Result.php index 9c5665011d..4311c71a7e 100644 --- a/CRM/Pledge/Form/Task/Result.php +++ b/CRM/Pledge/Form/Task/Result.php @@ -46,7 +46,7 @@ class CRM_Pledge_Form_Task_Result extends CRM_Pledge_Form_Task { * @return void * @access public */ - function preProcess() {} + public function preProcess() {} /** * Build the form object diff --git a/CRM/Pledge/Form/Task/SearchTaskHookSample.php b/CRM/Pledge/Form/Task/SearchTaskHookSample.php index 4f78d8a3cc..44cdda4140 100644 --- a/CRM/Pledge/Form/Task/SearchTaskHookSample.php +++ b/CRM/Pledge/Form/Task/SearchTaskHookSample.php @@ -44,7 +44,7 @@ class CRM_Pledge_Form_Task_SearchTaskHookSample extends CRM_Pledge_Form_Task { * @return void * @access public */ - function preProcess() { + public function preProcess() { parent::preProcess(); $rows = array(); // display name and pledge details of all selected contacts diff --git a/CRM/Pledge/Page/AJAX.php b/CRM/Pledge/Page/AJAX.php index d626ac6da1..f19da2fdd3 100755 --- a/CRM/Pledge/Page/AJAX.php +++ b/CRM/Pledge/Page/AJAX.php @@ -41,7 +41,7 @@ class CRM_Pledge_Page_AJAX { /** * Building Pledge Name combo box */ - static function pledgeName() { + public static function pledgeName() { $getRecords = FALSE; if (isset($_GET['name']) && $_GET['name']) { @@ -90,7 +90,7 @@ WHERE {$whereClause} * Function to setDefaults according to Pledge Id * for batch entry pledges */ - function getPledgeDefaults() { + public function getPledgeDefaults() { $details = array(); if (!empty($_POST['pid'])) { $pledgeID = CRM_Utils_Type::escape($_POST['pid'], 'Integer'); diff --git a/CRM/Pledge/Page/DashBoard.php b/CRM/Pledge/Page/DashBoard.php index d42b6f99e7..1343fb3d78 100644 --- a/CRM/Pledge/Page/DashBoard.php +++ b/CRM/Pledge/Page/DashBoard.php @@ -46,7 +46,7 @@ class CRM_Pledge_Page_DashBoard extends CRM_Core_Page { * @access public * */ - function preProcess() { + public function preProcess() { CRM_Utils_System::setTitle(ts('CiviPledge')); $startToDate = array(); @@ -102,7 +102,7 @@ class CRM_Pledge_Page_DashBoard extends CRM_Core_Page { * return null * @access public */ - function run() { + public function run() { $this->preProcess(); $controller = new CRM_Core_Controller_Simple('CRM_Pledge_Form_Search', diff --git a/CRM/Pledge/Page/Payment.php b/CRM/Pledge/Page/Payment.php index 733ecada84..0eb9f082f6 100644 --- a/CRM/Pledge/Page/Payment.php +++ b/CRM/Pledge/Page/Payment.php @@ -40,7 +40,7 @@ class CRM_Pledge_Page_Payment extends CRM_Core_Page { * return null * @access public */ - function run() { + public function run() { $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this); @@ -83,7 +83,7 @@ class CRM_Pledge_Page_Payment extends CRM_Core_Page { * return null * @access public */ - function edit() { + public function edit() { $controller = new CRM_Core_Controller_Simple('CRM_Pledge_Form_Payment', 'Update Pledge Payment', $this->_action diff --git a/CRM/Pledge/Page/Tab.php b/CRM/Pledge/Page/Tab.php index 1f02e2c713..ffe7a7458c 100644 --- a/CRM/Pledge/Page/Tab.php +++ b/CRM/Pledge/Page/Tab.php @@ -42,7 +42,7 @@ class CRM_Pledge_Page_Tab extends CRM_Core_Page { * return null * @access public */ - function browse() { + public function browse() { $controller = new CRM_Core_Controller_Simple('CRM_Pledge_Form_Search', ts('Pledges'), $this->_action); $controller->setEmbedded(TRUE); $controller->reset(); @@ -70,7 +70,7 @@ class CRM_Pledge_Page_Tab extends CRM_Core_Page { * return null * @access public */ - function view() { + public function view() { $controller = new CRM_Core_Controller_Simple('CRM_Pledge_Form_PledgeView', 'View Pledge', $this->_action @@ -88,7 +88,7 @@ class CRM_Pledge_Page_Tab extends CRM_Core_Page { * return null * @access public */ - function edit() { + public function edit() { $controller = new CRM_Core_Controller_Simple('CRM_Pledge_Form_Pledge', 'Create Pledge', $this->_action @@ -100,7 +100,7 @@ class CRM_Pledge_Page_Tab extends CRM_Core_Page { return $controller->run(); } - function preProcess() { + public function preProcess() { $context = CRM_Utils_Request::retrieve('context', 'String', $this); $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); @@ -131,7 +131,7 @@ class CRM_Pledge_Page_Tab extends CRM_Core_Page { * return null * @access public */ - function run() { + public function run() { $this->preProcess(); // check if we can process credit card registration diff --git a/CRM/Pledge/Page/UserDashboard.php b/CRM/Pledge/Page/UserDashboard.php index 16e3c71af0..71db8c3b23 100644 --- a/CRM/Pledge/Page/UserDashboard.php +++ b/CRM/Pledge/Page/UserDashboard.php @@ -40,7 +40,7 @@ class CRM_Pledge_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoard * return null * @access public */ - function listPledges() { + public function listPledges() { $controller = new CRM_Core_Controller_Simple( 'CRM_Pledge_Form_Search', ts('Pledges'), @@ -76,7 +76,7 @@ class CRM_Pledge_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoard * return null * @access public */ - function run() { + public function run() { parent::preProcess(); $this->listPledges(); } diff --git a/CRM/Pledge/Selector/Search.php b/CRM/Pledge/Selector/Search.php index 40d31140aa..73454d6430 100644 --- a/CRM/Pledge/Selector/Search.php +++ b/CRM/Pledge/Selector/Search.php @@ -189,7 +189,7 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base { * @access public * */ - static function &links() { + public static function &links() { $args = func_get_args(); $hideOption = CRM_Utils_Array::value(0, $args); $key = CRM_Utils_Array::value(1, $args); @@ -241,7 +241,7 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base { * * @access public */ - function getPagerParams($action, &$params) { + public function getPagerParams($action, &$params) { $params['status'] = ts('Pledge') . ' %%StatusMessage%%'; $params['csvString'] = NULL; if ($this->_limit) { @@ -263,7 +263,7 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base { * @return int Total number of rows * @access public */ - function getTotalCount($action) { + public function getTotalCount($action) { return $this->_query->searchQuery(0, 0, NULL, TRUE, FALSE, FALSE, FALSE, @@ -283,7 +283,7 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base { * * @return int the total number of rows for this action */ - function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { + public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { $result = $this->_query->searchQuery($offset, $rowCount, $sort, FALSE, FALSE, FALSE, FALSE, @@ -450,7 +450,7 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base { /** * @return string */ - function &getQuery() { + public function &getQuery() { return $this->_query; } @@ -461,7 +461,7 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base { * * @return string name of the file */ - function getExportFileName($output = 'csv') { + public function getExportFileName($output = 'csv') { return ts('Pledge Search'); } } diff --git a/CRM/Pledge/StateMachine/Search.php b/CRM/Pledge/StateMachine/Search.php index d0b55c2ee6..2a95eb60f5 100644 --- a/CRM/Pledge/StateMachine/Search.php +++ b/CRM/Pledge/StateMachine/Search.php @@ -81,7 +81,7 @@ class CRM_Pledge_StateMachine_Search extends CRM_Core_StateMachine { * @return string the name of the form that will handle the task * @access protected */ - function taskName($controller, $formName = 'Search') { + public function taskName($controller, $formName = 'Search') { // total hack, check POST vars and then session to determine stuff $value = CRM_Utils_Array::value('task', $_POST); if (!isset($value)) { @@ -97,7 +97,7 @@ class CRM_Pledge_StateMachine_Search extends CRM_Core_StateMachine { * @return string * @access public */ - function getTaskFormName() { + public function getTaskFormName() { return CRM_Utils_String::getClassName($this->_task); } @@ -106,7 +106,7 @@ class CRM_Pledge_StateMachine_Search extends CRM_Core_StateMachine { * we dont want to issue a reset of the state session when we are done processing a task * */ - function shouldReset() { + public function shouldReset() { return FALSE; } } diff --git a/CRM/Pledge/Task.php b/CRM/Pledge/Task.php index b089d388e5..35238450d0 100644 --- a/CRM/Pledge/Task.php +++ b/CRM/Pledge/Task.php @@ -65,7 +65,7 @@ class CRM_Pledge_Task { * @static * @access public */ - static function &tasks() { + public static function &tasks() { if (!self::$_tasks) { self::$_tasks = array(1 => array( 'title' => ts('Delete Pledges'), @@ -104,7 +104,7 @@ class CRM_Pledge_Task { * @static * @access public */ - static function &taskTitles() { + public static function &taskTitles() { self::tasks(); $titles = array(); foreach (self::$_tasks as $id => $value) { @@ -120,7 +120,7 @@ class CRM_Pledge_Task { * @static * @access public */ - static function &optionalTaskTitle() { + public static function &optionalTaskTitle() { $tasks = array(); return $tasks; } @@ -134,7 +134,7 @@ class CRM_Pledge_Task { * @return array set of tasks that are valid for the user * @access public */ - static function &permissionedTaskTitles($permission) { + public static function &permissionedTaskTitles($permission) { $tasks = array(); if (($permission == CRM_Core_Permission::EDIT) || CRM_Core_Permission::check('edit pledges') @@ -163,7 +163,7 @@ class CRM_Pledge_Task { * @static * @access public */ - static function getTask($value) { + public static function getTask($value) { self::tasks(); if (!$value || !CRM_Utils_Array::value($value, self::$_tasks)) { // make the print task by default diff --git a/CRM/Price/BAO/LineItem.php b/CRM/Price/BAO/LineItem.php index 8c6c138177..11b2ad4a6e 100644 --- a/CRM/Price/BAO/LineItem.php +++ b/CRM/Price/BAO/LineItem.php @@ -54,7 +54,7 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem { * @access public * @static */ - static function create(&$params) { + public static function create(&$params) { $id = CRM_Utils_Array::value('id', $params); if ($id) { CRM_Utils_Hook::pre('edit', 'LineItem', $id, $params); @@ -97,7 +97,7 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $lineItem = new CRM_Price_BAO_LineItem(); $lineItem->copyValues($params); if ($lineItem->find(TRUE)) { @@ -113,7 +113,7 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem { * * @return null|string */ - static function getLineTotal($entityId, $entityTable) { + public static function getLineTotal($entityId, $entityTable) { $sqlLineItemTotal = "SELECT SUM(li.line_total + COALESCE(li.tax_amount,0)) FROM civicrm_line_item li WHERE li.entity_table = '{$entityTable}' @@ -129,7 +129,7 @@ AND li.entity_id = {$entityId} * * @return array */ - static function getLineItemsByContributionID($contributionID) { + public static function getLineItemsByContributionID($contributionID) { return self::getLineItems($contributionID,'contribution', NULL, TRUE, TRUE, " WHERE contribution_id = " . (int) $contributionID); } @@ -150,7 +150,7 @@ AND li.entity_id = {$entityId} * * @return array of line items */ - static function getLineItems($entityId, $entity = 'participant', $isQuick = NULL , $isQtyZero = TRUE, $relatedEntity = FALSE, $overrideWhereClause = '') { + public static function getLineItems($entityId, $entity = 'participant', $isQuick = NULL , $isQtyZero = TRUE, $relatedEntity = FALSE, $overrideWhereClause = '') { $whereClause = $fromClause = NULL; $selectClause = " SELECT li.id, @@ -270,7 +270,7 @@ AND li.entity_id = {$entityId} * @return void * @access static */ - static function format($fid, &$params, &$fields, &$values) { + public static function format($fid, &$params, &$fields, &$values) { if (empty($params["price_{$fid}"])) { return; } @@ -363,7 +363,7 @@ AND li.entity_id = {$entityId} * @return void * @static */ - static function processPriceSet($entityId, $lineItem, $contributionDetails = NULL, $entityTable = 'civicrm_contribution', $update = FALSE) { + public static function processPriceSet($entityId, $lineItem, $contributionDetails = NULL, $entityTable = 'civicrm_contribution', $update = FALSE) { if (!$entityId || !is_array($lineItem) || CRM_Utils_system::isNull($lineItem) ) { @@ -472,7 +472,7 @@ AND li.entity_id = {$entityId} * @return void * @static */ - static function getLineItemArray(&$params, $entityId = NULL, $entityTable = 'contribution', $isRelatedID = FALSE) { + public static function getLineItemArray(&$params, $entityId = NULL, $entityTable = 'contribution', $isRelatedID = FALSE) { if (!$entityId) { $priceSetDetails = CRM_Price_BAO_PriceSet::getDefaultPriceSet($entityTable); diff --git a/CRM/Price/BAO/PriceField.php b/CRM/Price/BAO/PriceField.php index 96b97ff2a0..e855418c0d 100644 --- a/CRM/Price/BAO/PriceField.php +++ b/CRM/Price/BAO/PriceField.php @@ -54,7 +54,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { * @access public * @static */ - static function add(&$params) { + public static function add(&$params) { $priceFieldBAO = new CRM_Price_BAO_PriceField(); $priceFieldBAO->copyValues($params); @@ -78,7 +78,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { * @access public * @static */ - static function create(&$params) { + public static function create(&$params) { if(empty($params['id']) && empty($params['name'])) { $params['name'] = strtolower(CRM_Utils_String::munge($params['label'], '_', 242)); } @@ -177,7 +177,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { return CRM_Core_DAO::commonRetrieve('CRM_Price_DAO_PriceField', $params, $defaults); } @@ -192,11 +192,11 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { * @access public * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Price_DAO_PriceField', $id, 'is_active', $is_active); } - static function freezeIfEnabled(&$element, $fieldOptions) { + public static function freezeIfEnabled(&$element, $fieldOptions) { if (!empty($fieldOptions['is_full'])) { $element->freeze(); } @@ -645,7 +645,7 @@ WHERE /** * @return array */ - static function &htmlTypes() { + public static function &htmlTypes() { static $htmlTypes = NULL; if (!$htmlTypes) { $htmlTypes = array( diff --git a/CRM/Price/BAO/PriceFieldValue.php b/CRM/Price/BAO/PriceFieldValue.php index c781908afe..c338f300c1 100644 --- a/CRM/Price/BAO/PriceFieldValue.php +++ b/CRM/Price/BAO/PriceFieldValue.php @@ -50,7 +50,7 @@ class CRM_Price_BAO_PriceFieldValue extends CRM_Price_DAO_PriceFieldValue { * @access public * @static */ - static function add(&$params, $ids = array()) { + public static function add(&$params, $ids = array()) { $fieldValueBAO = new CRM_Price_BAO_PriceFieldValue(); $fieldValueBAO->copyValues($params); @@ -79,7 +79,7 @@ class CRM_Price_BAO_PriceFieldValue extends CRM_Price_DAO_PriceFieldValue { * @access public * @static */ - static function create(&$params, $ids = array()) { + public static function create(&$params, $ids = array()) { $id = CRM_Utils_Array::value('id', $params, CRM_Utils_Array::value('id', $ids)); if (!is_array($params) || empty($params)) { return; @@ -114,7 +114,7 @@ class CRM_Price_BAO_PriceFieldValue extends CRM_Price_DAO_PriceFieldValue { * Get defaults for new entity * @return array */ - static function getDefaults() { + public static function getDefaults() { return array( 'is_active' => 1, 'weight' => 1, @@ -133,7 +133,7 @@ class CRM_Price_BAO_PriceFieldValue extends CRM_Price_DAO_PriceFieldValue { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { return CRM_Core_DAO::commonRetrieve('CRM_Price_DAO_PriceFieldValue', $params, $defaults); } @@ -150,7 +150,7 @@ class CRM_Price_BAO_PriceFieldValue extends CRM_Price_DAO_PriceFieldValue { * @access public * @static */ - static function getValues($fieldId, &$values, $orderBy = 'weight', $isActive = FALSE) { + public static function getValues($fieldId, &$values, $orderBy = 'weight', $isActive = FALSE) { $fieldValueDAO = new CRM_Price_DAO_PriceFieldValue(); $fieldValueDAO->price_field_id = $fieldId; $fieldValueDAO->orderBy($orderBy, 'label'); @@ -192,7 +192,7 @@ class CRM_Price_BAO_PriceFieldValue extends CRM_Price_DAO_PriceFieldValue { * @access public * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Price_DAO_PriceFieldValue', $id, 'is_active', $is_active); } @@ -205,7 +205,7 @@ class CRM_Price_BAO_PriceFieldValue extends CRM_Price_DAO_PriceFieldValue { * @access public * @static */ - static function deleteValues($fieldId) { + public static function deleteValues($fieldId) { if (!$fieldId) { return; } @@ -225,7 +225,7 @@ class CRM_Price_BAO_PriceFieldValue extends CRM_Price_DAO_PriceFieldValue { * @access public * @static */ - static function del($id) { + public static function del($id) { if (!$id) { return FALSE; } @@ -246,7 +246,7 @@ class CRM_Price_BAO_PriceFieldValue extends CRM_Price_DAO_PriceFieldValue { * @access public * @static */ - static function updateFinancialType($entityId, $entityTable, $financialTypeID) { + public static function updateFinancialType($entityId, $entityTable, $financialTypeID) { if (!$entityId || !$entityTable || !$financialTypeID) { return; } diff --git a/CRM/Price/BAO/PriceSet.php b/CRM/Price/BAO/PriceSet.php index 71589493d0..433bf16c19 100644 --- a/CRM/Price/BAO/PriceSet.php +++ b/CRM/Price/BAO/PriceSet.php @@ -50,7 +50,7 @@ class CRM_Price_BAO_PriceSet extends CRM_Price_DAO_PriceSet { /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -63,7 +63,7 @@ class CRM_Price_BAO_PriceSet extends CRM_Price_DAO_PriceSet { * @access public * @static */ - static function create(&$params) { + public static function create(&$params) { if(empty($params['id']) && empty($params['name'])) { $params['name'] = CRM_Utils_String::munge($params['title'], '_', 242); } @@ -85,7 +85,7 @@ class CRM_Price_BAO_PriceSet extends CRM_Price_DAO_PriceSet { * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { return CRM_Core_DAO::commonRetrieve('CRM_Price_DAO_PriceSet', $params, $defaults); } @@ -101,7 +101,7 @@ class CRM_Price_BAO_PriceSet extends CRM_Price_DAO_PriceSet { * @static * @access public */ - static function setIsActive($id, $isActive) { + public static function setIsActive($id, $isActive) { return CRM_Core_DAO::setFieldValue('CRM_Price_DAO_PriceSet', $id, 'is_active', $isActive); } @@ -579,7 +579,7 @@ WHERE id = %1"; * @throws CRM_Core_Exception * @return int */ - static function getOnlyPriceFieldID(array $priceSet) { + public static function getOnlyPriceFieldID(array $priceSet) { if(count($priceSet['fields']) > 1) { throw new CRM_Core_Exception(ts('expected only one price field to be in priceset but multiple are present')); } @@ -594,7 +594,7 @@ WHERE id = %1"; * @throws CRM_Core_Exception * @return int */ - static function getOnlyPriceFieldValueID(array $priceSet) { + public static function getOnlyPriceFieldValueID(array $priceSet) { $priceFieldID = self::getOnlyPriceFieldID($priceSet); if(count($priceSet['fields'][$priceFieldID]['options']) > 1) { throw new CRM_Core_Exception(ts('expected only one price field to be in priceset but multiple are present')); @@ -612,7 +612,7 @@ WHERE id = %1"; * * @return bool|false|int|null */ - static function initSet(&$form, $id, $entityTable = 'civicrm_event', $validOnly = FALSE, $priceSetId = NULL) { + public static function initSet(&$form, $id, $entityTable = 'civicrm_event', $validOnly = FALSE, $priceSetId = NULL) { if (!$priceSetId) { $priceSetId = self::getFor($entityTable, $id); } @@ -710,7 +710,7 @@ WHERE id = %1"; * @param $lineItem * @param string $component */ - static function processAmount(&$fields, &$params, &$lineItem, $component = '') { + public static function processAmount(&$fields, &$params, &$lineItem, $component = '') { // using price set $totalPrice = $totalTax = 0; $radioLevel = $checkboxLevel = $selectLevel = $textLevel = array(); @@ -889,7 +889,7 @@ WHERE id = %1"; * @return void * @access public */ - static function buildPriceSet(&$form) { + public static function buildPriceSet(&$form) { $priceSetId = $form->get('priceSetId'); if (!$priceSetId) { return; @@ -972,7 +972,7 @@ WHERE id = %1"; * Check the current Membership * having end date null. */ - static function checkCurrentMembership(&$options, $userid) { + public static function checkCurrentMembership(&$options, $userid) { if (!$userid || empty($options)) { return; } @@ -1007,7 +1007,7 @@ WHERE id = %1"; * @return array $defaults * @access public */ - static function setDefaultPriceSet(&$form, &$defaults) { + public static function setDefaultPriceSet(&$form, &$defaults) { if (!isset($form->_priceSet) || empty($form->_priceSet['fields'])) { return $defaults; } @@ -1034,7 +1034,7 @@ WHERE id = %1"; * @param CRM_Core_DAO $entity object for given entity * @param string $entityName name of entity - e.g event */ - static function setPriceSets(&$params, $entity, $entityName) { + public static function setPriceSets(&$params, $entity, $entityName) { if(empty($params['price_set_id']) || !is_array($params['price_set_id'])) { return; } @@ -1098,7 +1098,7 @@ WHERE id = %1"; * @access public * @static */ - static function copy($id) { + public static function copy($id) { $maxId = CRM_Core_DAO::singleValueQuery("SELECT max(id) FROM civicrm_price_set"); $title = ts('[Copy id %1]', array(1 => $maxId + 1)); @@ -1143,7 +1143,7 @@ WHERE id = %1"; * * @return bool */ - static function checkPermission($sid) { + public static function checkPermission($sid) { if ($sid && self::eventPriceSetDomainID()) { $domain_id = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $sid, 'domain_id', 'id'); if (CRM_Core_Config::domainID() != $domain_id) { @@ -1288,7 +1288,7 @@ GROUP BY mt.member_of_contact_id"; /** * @return object */ - static function eventPriceSetDomainID() { + public static function eventPriceSetDomainID() { return CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME, 'event_price_set_domain_id', NULL, FALSE @@ -1305,7 +1305,7 @@ GROUP BY mt.member_of_contact_id"; * @static * @access public */ - static function setIsQuickConfig($id, $isQuickConfig) { + public static function setIsQuickConfig($id, $isQuickConfig) { return CRM_Core_DAO::setFieldValue('CRM_Price_DAO_PriceSet', $id, 'is_quick_config', $isQuickConfig); } @@ -1357,7 +1357,7 @@ WHERE ps.id = %1 * @param int $id old event/contribution page id * @param int $newId newly created event/contribution page id */ - static function copyPriceSet($baoName, $id, $newId) { + public static function copyPriceSet($baoName, $id, $newId) { $priceSetId = CRM_Price_BAO_PriceSet::getFor($baoName, $id); if ($priceSetId) { $isQuickConfig = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config'); @@ -1401,7 +1401,7 @@ WHERE ps.id = %1 * * */ - static function setLineItem($field, $lineItem, $optionValueId) { + public static function setLineItem($field, $lineItem, $optionValueId) { if ($field['html_type'] == 'Text') { $taxAmount = $field['options'][$optionValueId]['tax_amount'] * $lineItem[$optionValueId]['qty']; } diff --git a/CRM/Price/Form/Field.php b/CRM/Price/Form/Field.php index 25b7999cbd..18750a69df 100644 --- a/CRM/Price/Form/Field.php +++ b/CRM/Price/Form/Field.php @@ -108,7 +108,7 @@ class CRM_Price_Form_Field extends CRM_Core_Form { * @return array array of default values * @access public */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); // is it an edit operation ? if (isset($this->_fid)) { @@ -401,7 +401,7 @@ class CRM_Price_Form_Field extends CRM_Core_Form { * @static * @access public */ - static function formRule($fields, $files, $form) { + public static function formRule($fields, $files, $form) { // all option fields are of type "money" $errors = array(); diff --git a/CRM/Price/Form/Option.php b/CRM/Price/Form/Option.php index d1f15621a7..9a9c51945d 100644 --- a/CRM/Price/Form/Option.php +++ b/CRM/Price/Form/Option.php @@ -81,7 +81,7 @@ class CRM_Price_Form_Option extends CRM_Core_Form { * @return array array of default values * @access public */ - function setDefaultValues() { + public function setDefaultValues() { if ($this->_action == CRM_Core_Action::DELETE) { return; } @@ -284,7 +284,7 @@ class CRM_Price_Form_Option extends CRM_Core_Form { * @static * @access public */ - static function formRule($fields, $files, $form) { + public static function formRule($fields, $files, $form) { $errors = array(); if (!empty($fields['count']) && !empty($fields['max_value']) && $fields['count'] > $fields['max_value'] diff --git a/CRM/Price/Form/Preview.php b/CRM/Price/Form/Preview.php index d5399ec635..3cfb349efe 100644 --- a/CRM/Price/Form/Preview.php +++ b/CRM/Price/Form/Preview.php @@ -94,7 +94,7 @@ class CRM_Price_Form_Preview extends CRM_Core_Form { * @return array the default array reference * @access protected */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $groupId = $this->get('groupId'); $fieldId = $this->get('fieldId'); diff --git a/CRM/Price/Form/Set.php b/CRM/Price/Form/Set.php index 9482ef3f5a..3e5d4b262f 100644 --- a/CRM/Price/Form/Set.php +++ b/CRM/Price/Form/Set.php @@ -89,7 +89,7 @@ class CRM_Price_Form_Set extends CRM_Core_Form { * @access public * @static */ - static function formRule($fields, $files, $options) { + public static function formRule($fields, $files, $options) { $errors = array(); $count = count(CRM_Utils_Array::value('extends', $fields)); //price sets configured for membership @@ -239,7 +239,7 @@ class CRM_Price_Form_Set extends CRM_Core_Form { * @return array array of default values * @access public */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array('is_active' => TRUE); if ($this->_sid) { $params = array('id' => $this->_sid); diff --git a/CRM/Price/Page/Field.php b/CRM/Price/Page/Field.php index 6fba3003c3..a452d6e796 100644 --- a/CRM/Price/Page/Field.php +++ b/CRM/Price/Page/Field.php @@ -120,7 +120,7 @@ class CRM_Price_Page_Field extends CRM_Core_Page { * @return void * @access public */ - function browse() { + public function browse() { $resourceManager = CRM_Core_Resources::singleton(); if (!empty($_GET['new']) && $resourceManager->ajaxPopupsEnabled) { $resourceManager->addScriptFile('civicrm', 'js/crm.addNew.js', 999, 'html-header'); @@ -225,7 +225,7 @@ class CRM_Price_Page_Field extends CRM_Core_Page { * @return void * @access public */ - function edit($action) { + public function edit($action) { // create a simple controller for editing price data $controller = new CRM_Core_Controller_Simple('CRM_Price_Form_Field', ts('Price Field'), $action); @@ -250,7 +250,7 @@ class CRM_Price_Page_Field extends CRM_Core_Page { * @return void * @access public */ - function run() { + public function run() { // get the group id $this->_sid = CRM_Utils_Request::retrieve('sid', 'Positive', @@ -345,7 +345,7 @@ class CRM_Price_Page_Field extends CRM_Core_Page { * @return void * @access public */ - function preview($fid) { + public function preview($fid) { $controller = new CRM_Core_Controller_Simple('CRM_Price_Form_Preview', ts('Preview Form Field'), CRM_Core_Action::PREVIEW); $session = CRM_Core_Session::singleton(); $session->pushUserContext(CRM_Utils_System::url('civicrm/admin/price/field', 'reset=1&action=browse&sid=' . $this->_sid)); diff --git a/CRM/Price/Page/Option.php b/CRM/Price/Page/Option.php index 0fc615f13b..6fbc915f72 100644 --- a/CRM/Price/Page/Option.php +++ b/CRM/Price/Page/Option.php @@ -128,7 +128,7 @@ class CRM_Price_Page_Option extends CRM_Core_Page { * @return void * @access public */ - function browse() { + public function browse() { $customOption = array(); CRM_Price_BAO_PriceFieldValue::getValues($this->_fid, $customOption); $config = CRM_Core_Config::singleton(); @@ -208,7 +208,7 @@ class CRM_Price_Page_Option extends CRM_Core_Page { * @return void * @access public */ - function edit($action) { + public function edit($action) { $oid = CRM_Utils_Request::retrieve('oid', 'Positive', $this, FALSE, 0 ); @@ -264,7 +264,7 @@ class CRM_Price_Page_Option extends CRM_Core_Page { * @return void * @access public */ - function run() { + public function run() { // get the field id $this->_fid = CRM_Utils_Request::retrieve('fid', 'Positive', diff --git a/CRM/Price/Page/Set.php b/CRM/Price/Page/Set.php index bc2d0db093..2225544be4 100644 --- a/CRM/Price/Page/Set.php +++ b/CRM/Price/Page/Set.php @@ -124,7 +124,7 @@ class CRM_Price_Page_Set extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { // get the requested action $action = CRM_Utils_Request::retrieve('action', 'String', // default to 'browse' @@ -207,7 +207,7 @@ class CRM_Price_Page_Set extends CRM_Core_Page { * @return void * @access public */ - function edit($sid, $action) { + public function edit($sid, $action) { // create a simple controller for editing price sets $controller = new CRM_Core_Controller_Simple('CRM_Price_Form_Set', ts('Price Set'), $action); @@ -228,7 +228,7 @@ class CRM_Price_Page_Set extends CRM_Core_Page { * @return void * @access public */ - function preview($sid) { + public function preview($sid) { $controller = new CRM_Core_Controller_Simple('CRM_Price_Form_Preview', ts('Preview Price Set'), NULL); $session = CRM_Core_Session::singleton(); $context = CRM_Utils_Request::retrieve('context', 'String', $this); @@ -252,7 +252,7 @@ class CRM_Price_Page_Set extends CRM_Core_Page { * @return void * @access public */ - function browse($action = NULL) { + public function browse($action = NULL) { // get all price sets $priceSet = array(); $comps = array('CiviEvent' => ts('Event'), @@ -321,7 +321,7 @@ class CRM_Price_Page_Set extends CRM_Core_Page { * @return void * @access public */ - function copy() { + public function copy() { $id = CRM_Utils_Request::retrieve('sid', 'Positive', $this, TRUE, 0, 'GET' ); diff --git a/CRM/Profile/Form.php b/CRM/Profile/Form.php index bb074dc360..7e2f6a5029 100644 --- a/CRM/Profile/Form.php +++ b/CRM/Profile/Form.php @@ -187,7 +187,7 @@ class CRM_Profile_Form extends CRM_Core_Form { * * @access public */ - function preProcess() { + public function preProcess() { $this->_id = $this->get('id'); $this->_profileIds = $this->get('profileIds'); $this->_grid = CRM_Utils_Request::retrieve('grid', 'Integer', $this); @@ -413,7 +413,7 @@ class CRM_Profile_Form extends CRM_Core_Form { * * @return void */ - function setDefaultsValues() { + public function setDefaultsValues() { $this->_defaults = array(); if ($this->_multiRecordProfile && ($this->_multiRecord == CRM_Core_Action::DELETE)) { return; @@ -835,7 +835,7 @@ class CRM_Profile_Form extends CRM_Core_Form { * * @return array */ - static function validateContactActivityProfile($activityId, $contactId, $gid) { + public static function validateContactActivityProfile($activityId, $contactId, $gid) { $errors = array(); if (!$activityId) { $errors[] = 'Profile is using one or more activity fields, and is missing the activity Id (aid) in the URL.'; @@ -877,7 +877,7 @@ class CRM_Profile_Form extends CRM_Core_Form { * @access public * @static */ - static function formRule($fields, $files, $form) { + public static function formRule($fields, $files, $form) { CRM_Utils_Hook::validateProfile($form->_ufGroup['name']); $errors = array(); @@ -1313,7 +1313,7 @@ class CRM_Profile_Form extends CRM_Core_Form { * * @return null|string */ - function checkTemplateFileExists($suffix = NULL) { + public function checkTemplateFileExists($suffix = NULL) { if ($this->_gid) { $templateFile = "CRM/Profile/Form/{$this->_gid}/{$this->_name}.{$suffix}tpl"; $template = CRM_Core_Form::getTemplate(); @@ -1342,7 +1342,7 @@ class CRM_Profile_Form extends CRM_Core_Form { /** * @return string */ - function getTemplateFileName() { + public function getTemplateFileName() { $fileName = $this->checkTemplateFileExists(); return $fileName ? $fileName : parent::getTemplateFileName(); } @@ -1357,7 +1357,7 @@ class CRM_Profile_Form extends CRM_Core_Form { /** * @return string */ - function overrideExtraTemplateFileName() { + public function overrideExtraTemplateFileName() { $fileName = $this->checkTemplateFileExists('extra.'); return $fileName ? $fileName : parent::overrideExtraTemplateFileName(); } diff --git a/CRM/Profile/Form/Dynamic.php b/CRM/Profile/Form/Dynamic.php index 954de1d197..66208e1d81 100644 --- a/CRM/Profile/Form/Dynamic.php +++ b/CRM/Profile/Form/Dynamic.php @@ -53,7 +53,7 @@ class CRM_Profile_Form_Dynamic extends CRM_Profile_Form { * @access public * */ - function preProcess() { + public function preProcess() { if ($this->get('register')) { $this->_mode = CRM_Profile_Form::MODE_REGISTER; } @@ -106,7 +106,7 @@ class CRM_Profile_Form_Dynamic extends CRM_Profile_Form { * @access public * @static */ - static function formRule($fields, $files, $form) { + public static function formRule($fields, $files, $form) { $errors = array(); // if no values, return diff --git a/CRM/Profile/Form/Edit.php b/CRM/Profile/Form/Edit.php index 9f4c80d485..dd9d0d0700 100644 --- a/CRM/Profile/Form/Edit.php +++ b/CRM/Profile/Form/Edit.php @@ -59,7 +59,7 @@ class CRM_Profile_Form_Edit extends CRM_Profile_Form { * @access public * */ - function preProcess() { + public function preProcess() { $this->_mode = CRM_Profile_Form::MODE_CREATE; $this->_onPopupClose = CRM_Utils_Request::retrieve('onPopupClose', 'String', $this); @@ -319,7 +319,7 @@ SELECT module,is_reserved * * @return boolean true if no error found */ - function validate() { + public function validate() { $errors = parent::validate(); if (!$errors && !empty($_POST['errorURL'])) { diff --git a/CRM/Profile/Form/Search.php b/CRM/Profile/Form/Search.php index 3c35bdc815..a4d24b10bd 100644 --- a/CRM/Profile/Form/Search.php +++ b/CRM/Profile/Form/Search.php @@ -53,7 +53,7 @@ class CRM_Profile_Form_Search extends CRM_Profile_Form { * @access public * */ - function preProcess() { + public function preProcess() { $this->_mode = CRM_Profile_Form::MODE_SEARCH; parent::preProcess(); } @@ -65,7 +65,7 @@ class CRM_Profile_Form_Search extends CRM_Profile_Form { * * @return array the default array reference */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); // note we intentionally overwrite value since we use it as defaults // and its all pass by value diff --git a/CRM/Profile/Page/Dynamic.php b/CRM/Profile/Page/Dynamic.php index 6812c34a48..099894bb75 100644 --- a/CRM/Profile/Page/Dynamic.php +++ b/CRM/Profile/Page/Dynamic.php @@ -117,7 +117,7 @@ class CRM_Profile_Page_Dynamic extends CRM_Core_Page { * @return \CRM_Profile_Page_Dynamic * @access public */ - function __construct($id, $gid, $restrict, $skipPermission = FALSE, $profileIds = NULL) { + public function __construct($id, $gid, $restrict, $skipPermission = FALSE, $profileIds = NULL) { parent::__construct(); $this->_id = $id; @@ -172,7 +172,7 @@ class CRM_Profile_Page_Dynamic extends CRM_Core_Page { * @return array $_actionLinks * */ - function &actionLinks() { + public function &actionLinks() { return NULL; } @@ -186,7 +186,7 @@ class CRM_Profile_Page_Dynamic extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { $template = CRM_Core_Smarty::singleton(); if ($this->_id && $this->_gid) { @@ -391,7 +391,7 @@ class CRM_Profile_Page_Dynamic extends CRM_Core_Page { * * @return null|string */ - function checkTemplateFileExists($suffix = '') { + public function checkTemplateFileExists($suffix = '') { if ($this->_gid) { $templateFile = "CRM/Profile/Page/{$this->_gid}/Dynamic.{$suffix}tpl"; $template = CRM_Core_Page::getTemplate(); @@ -420,7 +420,7 @@ class CRM_Profile_Page_Dynamic extends CRM_Core_Page { /** * @return string */ - function getTemplateFileName() { + public function getTemplateFileName() { $fileName = $this->checkTemplateFileExists(); return $fileName ? $fileName : parent::getTemplateFileName(); } @@ -435,7 +435,7 @@ class CRM_Profile_Page_Dynamic extends CRM_Core_Page { /** * @return string */ - function overrideExtraTemplateFileName() { + public function overrideExtraTemplateFileName() { $fileName = $this->checkTemplateFileExists('extra.'); return $fileName ? $fileName : parent::overrideExtraTemplateFileName(); } diff --git a/CRM/Profile/Page/Listings.php b/CRM/Profile/Page/Listings.php index f1f91c961d..73586cd755 100644 --- a/CRM/Profile/Page/Listings.php +++ b/CRM/Profile/Page/Listings.php @@ -100,7 +100,7 @@ class CRM_Profile_Page_Listings extends CRM_Core_Page { * @access public * */ - function preProcess() { + public function preProcess() { $this->_search = TRUE; @@ -279,7 +279,7 @@ class CRM_Profile_Page_Listings extends CRM_Core_Page { * * @return void */ - function run() { + public function run() { $this->preProcess(); $this->assign('recentlyViewed', FALSE); @@ -405,7 +405,7 @@ class CRM_Profile_Page_Listings extends CRM_Core_Page { * @return array * @access public */ - function getProfileContact($gid) { + public function getProfileContact($gid) { $session = CRM_Core_Session::singleton(); $params = $session->get('profileParams'); @@ -462,7 +462,7 @@ class CRM_Profile_Page_Listings extends CRM_Core_Page { * * @return null|string */ - function checkTemplateFileExists($suffix = '') { + public function checkTemplateFileExists($suffix = '') { if ($this->_gid) { $templateFile = "CRM/Profile/Page/{$this->_gid}/Listings.{$suffix}tpl"; $template = CRM_Core_Page::getTemplate(); @@ -491,7 +491,7 @@ class CRM_Profile_Page_Listings extends CRM_Core_Page { /** * @return string */ - function getTemplateFileName() { + public function getTemplateFileName() { $fileName = $this->checkTemplateFileExists(); return $fileName ? $fileName : parent::getTemplateFileName(); } @@ -506,7 +506,7 @@ class CRM_Profile_Page_Listings extends CRM_Core_Page { /** * @return string */ - function overrideExtraTemplateFileName() { + public function overrideExtraTemplateFileName() { $fileName = $this->checkTemplateFileExists('extra.'); return $fileName ? $fileName : parent::overrideExtraTemplateFileName(); } diff --git a/CRM/Profile/Page/MultipleRecordFieldsListing.php b/CRM/Profile/Page/MultipleRecordFieldsListing.php index 5327bf5ef4..bdf4d4b1ca 100644 --- a/CRM/Profile/Page/MultipleRecordFieldsListing.php +++ b/CRM/Profile/Page/MultipleRecordFieldsListing.php @@ -59,7 +59,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return ''; } @@ -68,7 +68,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links[$this->_pageViewType])) { // helper variable for nicer formatting $links = array(); @@ -140,7 +140,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { * @access public * */ - function run() { + public function run() { // get the requested action, default to 'browse' $action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, FALSE); @@ -170,7 +170,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { * @return void * @access public */ - function browse() { + public function browse() { $dateFields = NULL; $cgcount = 0; $dateFieldsVals = NULL; @@ -368,7 +368,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { * * @return string classname of edit form */ - function editForm() { + public function editForm() { return ''; } @@ -377,7 +377,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { * * @return string name of this page */ - function editName() { + public function editName() { return ''; } @@ -388,7 +388,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { * * @return string user context */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return ''; } } diff --git a/CRM/Profile/Page/Router.php b/CRM/Profile/Page/Router.php index 6096708ef8..c87a24eefe 100644 --- a/CRM/Profile/Page/Router.php +++ b/CRM/Profile/Page/Router.php @@ -47,7 +47,7 @@ class CRM_Profile_Page_Router extends CRM_Core_Page { * @static * @access public */ - function run($args = NULL) { + public function run($args = NULL) { if ($args[1] !== 'profile') { return; } diff --git a/CRM/Profile/Page/View.php b/CRM/Profile/Page/View.php index c2112640a8..6926b03f20 100644 --- a/CRM/Profile/Page/View.php +++ b/CRM/Profile/Page/View.php @@ -61,7 +61,7 @@ class CRM_Profile_Page_View extends CRM_Core_Page { * @access public * */ - function preProcess() { + public function preProcess() { $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE ); @@ -170,7 +170,7 @@ class CRM_Profile_Page_View extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { $this->preProcess(); return parent::run(); } @@ -180,7 +180,7 @@ class CRM_Profile_Page_View extends CRM_Core_Page { * * @return null|string */ - function checkTemplateFileExists($suffix = '') { + public function checkTemplateFileExists($suffix = '') { if ($this->_gid) { $templateFile = "CRM/Profile/Page/{$this->_gid}/View.{$suffix}tpl"; $template = CRM_Core_Page::getTemplate(); @@ -209,7 +209,7 @@ class CRM_Profile_Page_View extends CRM_Core_Page { /** * @return string */ - function getTemplateFileName() { + public function getTemplateFileName() { $fileName = $this->checkTemplateFileExists(); return $fileName ? $fileName : parent::getTemplateFileName(); } @@ -224,7 +224,7 @@ class CRM_Profile_Page_View extends CRM_Core_Page { /** * @return string */ - function overrideExtraTemplateFileName() { + public function overrideExtraTemplateFileName() { $fileName = $this->checkTemplateFileExists('extra.'); return $fileName ? $fileName : parent::overrideExtraTemplateFileName(); } diff --git a/CRM/Profile/Selector/Listings.php b/CRM/Profile/Selector/Listings.php index cd515ef507..1bbd39fa12 100644 --- a/CRM/Profile/Selector/Listings.php +++ b/CRM/Profile/Selector/Listings.php @@ -221,7 +221,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR * @return array * @access public */ - static function &links($map = FALSE, $editLink = FALSE, $ufLink = FALSE, $gids = NULL) { + public static function &links($map = FALSE, $editLink = FALSE, $ufLink = FALSE, $gids = NULL) { if (!self::$_links) { self::$_links = array(); @@ -284,7 +284,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR * * @access public */ - function getPagerParams($action, &$params) { + public function getPagerParams($action, &$params) { $status = CRM_Utils_System::isNull($this->_multiRecordTableName) ? ts('Contact %%StatusMessage%%') : ts('Contact Multi Records %%StatusMessage%%'); $params['status'] = $status; @@ -305,7 +305,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR * @return array the column headers that need to be displayed * @access public */ - function &getColumnHeaders($action = NULL, $output = NULL) { + public function &getColumnHeaders($action = NULL, $output = NULL) { static $skipFields = array('group', 'tag'); $multipleFields = array('url'); $direction = CRM_Utils_Sort::ASCENDING; @@ -396,7 +396,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR * @return int Total number of rows * @access public */ - function getTotalCount($action) { + public function getTotalCount($action) { $additionalWhereClause = 'contact_a.is_deleted = 0'; $additionalFromClause = NULL; $returnQuery = NULL; @@ -427,7 +427,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR * @return string * @access public */ - function getQill() { + public function getQill() { return $this->_query->qill(); } @@ -442,7 +442,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR * * @return int the total number of rows for this action */ - function &getRows($action, $offset, $rowCount, $sort, $output = NULL, $extraWhereClause = NULL) { + public function &getRows($action, $offset, $rowCount, $sort, $output = NULL, $extraWhereClause = NULL) { $multipleFields = array('url'); //$sort object processing for location fields @@ -731,7 +731,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR * * @return string name of the file */ - function getExportFileName($output = 'csv') { + public function getExportFileName($output = 'csv') { return ts('CiviCRM Profile Listings'); } @@ -739,7 +739,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR * set the _multiRecordTableName to display the result set * according to multi record custom field values */ - function setMultiRecordTableName($fields) { + public function setMultiRecordTableName($fields) { $customGroupId = $multiRecordTableName = NULL; $selectorSet = FALSE; diff --git a/CRM/Report/BAO/ReportInstance.php b/CRM/Report/BAO/ReportInstance.php index 25360449dd..552b3da278 100644 --- a/CRM/Report/BAO/ReportInstance.php +++ b/CRM/Report/BAO/ReportInstance.php @@ -48,7 +48,7 @@ class CRM_Report_BAO_ReportInstance extends CRM_Report_DAO_ReportInstance { * @access public * @static */ - static function add(&$params) { + public static function add(&$params) { $instance = new CRM_Report_DAO_ReportInstance(); if (empty($params)) { return NULL; @@ -129,7 +129,7 @@ class CRM_Report_BAO_ReportInstance extends CRM_Report_DAO_ReportInstance { * @access public * @static */ - static function &create(&$params) { + public static function &create(&$params) { if (isset($params['report_header'])) { $params['header'] = CRM_Utils_Array::value('report_header',$params); } @@ -231,7 +231,7 @@ class CRM_Report_BAO_ReportInstance extends CRM_Report_DAO_ReportInstance { * * @return mixed $results no of deleted Instance on success, false otherwise@access public */ - static function del($id = NULL) { + public static function del($id = NULL) { $dao = new CRM_Report_DAO_ReportInstance(); $dao->id = $id; return $dao->delete(); @@ -243,7 +243,7 @@ class CRM_Report_BAO_ReportInstance extends CRM_Report_DAO_ReportInstance { * * @return CRM_Report_DAO_ReportInstance|null */ - static function retrieve($params, &$defaults) { + public static function retrieve($params, &$defaults) { $instance = new CRM_Report_DAO_ReportInstance(); $instance->copyValues($params); diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 81010c2f36..d592268208 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -300,7 +300,7 @@ class CRM_Report_Form extends CRM_Core_Form { /** * */ - function __construct() { + public function __construct() { parent::__construct(); // build tag filter @@ -347,7 +347,7 @@ class CRM_Report_Form extends CRM_Core_Form { $this->assign('currencyColumn', $this->_currencyColumn); } - function preProcessCommon() { + public function preProcessCommon() { $this->_force = CRM_Utils_Request::retrieve( 'force', @@ -472,7 +472,7 @@ class CRM_Report_Form extends CRM_Core_Form { $this->_chartButtonName = $this->getButtonName('submit', 'chart'); } - function addBreadCrumb() { + public function addBreadCrumb() { $breadCrumbs = array( array( @@ -484,7 +484,7 @@ class CRM_Report_Form extends CRM_Core_Form { CRM_Utils_System::appendBreadCrumb($breadCrumbs); } - function preProcess() { + public function preProcess() { $this->preProcessCommon(); if (!$this->_id) { @@ -654,7 +654,7 @@ class CRM_Report_Form extends CRM_Core_Form { * * @return array */ - function setDefaultValues($freeze = TRUE) { + public function setDefaultValues($freeze = TRUE) { $freezeGroup = array(); // FIXME: generalizing form field naming conventions would reduce @@ -802,7 +802,7 @@ class CRM_Report_Form extends CRM_Core_Form { * * @return bool */ - function getElementFromGroup($group, $grpFieldName) { + public function getElementFromGroup($group, $grpFieldName) { $eleObj = $this->getElement($group); foreach ($eleObj->_elements as $index => $obj) { if ($grpFieldName == $obj->_attributes['name']) { @@ -817,7 +817,7 @@ class CRM_Report_Form extends CRM_Core_Form { * * @param array $params */ - function setParams($params) { + public function setParams($params) { $this->_params = $params; } @@ -826,7 +826,7 @@ class CRM_Report_Form extends CRM_Core_Form { * * @param int $instanceid */ - function setID($instanceid) { + public function setID($instanceid) { $this->_id = $instanceid; } @@ -835,7 +835,7 @@ class CRM_Report_Form extends CRM_Core_Form { * * @param $isForce */ - function setForce($isForce) { + public function setForce($isForce) { $this->_force = $isForce; } @@ -844,7 +844,7 @@ class CRM_Report_Form extends CRM_Core_Form { * * @param number $_limitValue */ - function setLimitValue($_limitValue) { + public function setLimitValue($_limitValue) { $this->_limitValue = $_limitValue; } @@ -853,7 +853,7 @@ class CRM_Report_Form extends CRM_Core_Form { * * @param number $_offsetValue */ - function setOffsetValue($_offsetValue) { + public function setOffsetValue($_offsetValue) { $this->_offsetValue = $_offsetValue; } @@ -861,11 +861,11 @@ class CRM_Report_Form extends CRM_Core_Form { * Getter for $_defaultValues * @return array $_defaultValues */ - function getDefaultValues() { + public function getDefaultValues() { return $this->_defaults; } - function addColumns() { + public function addColumns() { $options = array(); $colGroups = NULL; foreach ($this->_columns as $tableName => $table) { @@ -908,7 +908,7 @@ class CRM_Report_Form extends CRM_Core_Form { $this->assign('colGroups', $colGroups); } - function addFilters() { + public function addFilters() { $filters = array(); $count = 1; foreach ($this->_filters as $table => $attributes) { @@ -1022,7 +1022,7 @@ class CRM_Report_Form extends CRM_Core_Form { $this->assign('filters', $filters); } - function addOptions() { + public function addOptions() { if (!empty($this->_options)) { // FIXME: For now lets build all elements as checkboxes. // Once we clear with the format we can build elements based on type @@ -1044,7 +1044,7 @@ class CRM_Report_Form extends CRM_Core_Form { $this->assign('otherOptions', $this->_options); } - function addChartOptions() { + public function addChartOptions() { if (!empty($this->_charts)) { $this->addElement('select', "charts", ts('Chart'), $this->_charts, array('onchange' => 'disablePrintPDFButtons(this.value);')); $this->assign('charts', $this->_charts); @@ -1052,7 +1052,7 @@ class CRM_Report_Form extends CRM_Core_Form { } } - function addGroupBys() { + public function addGroupBys() { $options = $freqElements = array(); foreach ($this->_columns as $tableName => $table) { @@ -1079,7 +1079,7 @@ class CRM_Report_Form extends CRM_Core_Form { } } - function addOrderBys() { + public function addOrderBys() { $options = array(); foreach ($this->_columns as $tableName => $table) { @@ -1128,7 +1128,7 @@ class CRM_Report_Form extends CRM_Core_Form { } } - function buildInstanceAndButtons() { + public function buildInstanceAndButtons() { CRM_Report_Form_Instance::buildForm($this); $label = $this->_id ? ts('Update Report') : ts('Create Report'); @@ -1179,7 +1179,7 @@ class CRM_Report_Form extends CRM_Core_Form { ); } - function buildQuickForm() { + public function buildQuickForm() { $this->addColumns(); $this->addFilters(); @@ -1210,7 +1210,7 @@ class CRM_Report_Form extends CRM_Core_Form { * * @return array */ - function customDataFormRule($fields, $ignoreFields = array()) { + public function customDataFormRule($fields, $ignoreFields = array()) { $errors = array(); if (!empty($this->_customGroupExtends) && $this->_customGroupGroupBy && !empty($fields['group_bys']) @@ -1250,7 +1250,7 @@ class CRM_Report_Form extends CRM_Core_Form { * * @return array */ - function getOperationPair($type = "string", $fieldName = NULL) { + public function getOperationPair($type = "string", $fieldName = NULL) { // FIXME: At some point we should move these key-val pairs // to option_group and option_value table. switch ($type) { @@ -1314,7 +1314,7 @@ class CRM_Report_Form extends CRM_Core_Form { } } - function buildTagFilter() { + public function buildTagFilter() { $contactTags = CRM_Core_BAO_Tag::getTags(); if (!empty($contactTags)) { $this->_columns['civicrm_tag'] = array( @@ -1335,7 +1335,7 @@ class CRM_Report_Form extends CRM_Core_Form { /* * Adds group filters to _columns (called from _Constuct */ - function buildGroupFilter() { + public function buildGroupFilter() { $this->_columns['civicrm_group']['filters'] = array( 'gid' => array( 'name' => 'group_id', @@ -1358,7 +1358,7 @@ class CRM_Report_Form extends CRM_Core_Form { * * @return string */ - function getSQLOperator($operator = "like") { + public function getSQLOperator($operator = "like") { switch ($operator) { case 'eq': return '='; @@ -1631,7 +1631,7 @@ class CRM_Report_Form extends CRM_Core_Form { * * @return string|NULL */ - function dateDisplay($relative, $from, $to) { + public function dateDisplay($relative, $from, $to) { list($from, $to) = $this->getFromTo($relative, $from, $to); if ($from) { @@ -1664,7 +1664,7 @@ class CRM_Report_Form extends CRM_Core_Form { * * @return array */ - function getFromTo($relative, $from, $to, $fromtime = NULL, $totime = NULL) { + public function getFromTo($relative, $from, $to, $fromtime = NULL, $totime = NULL) { if (empty($totime)) { $totime = '235959'; } @@ -1684,14 +1684,14 @@ class CRM_Report_Form extends CRM_Core_Form { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows } /** * @param $rows */ - function alterCustomDataDisplay(&$rows) { + public function alterCustomDataDisplay(&$rows) { // custom code to alter rows having custom values if (empty($this->_customGroupExtends)) { return; @@ -1765,7 +1765,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND * * @return float|string */ - function formatCustomValues($value, $customField, $fieldValueMap) { + public function formatCustomValues($value, $customField, $fieldValueMap) { if (CRM_Utils_System::isNull($value)) { return; } @@ -1883,7 +1883,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND /** * @param $rows */ - function removeDuplicates(&$rows) { + public function removeDuplicates(&$rows) { if (empty($this->_noRepeats)) { return; } @@ -1908,7 +1908,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND * @param $fields * @param bool $subtotal */ - function fixSubTotalDisplay(&$row, $fields, $subtotal = TRUE) { + public function fixSubTotalDisplay(&$row, $fields, $subtotal = TRUE) { foreach ($row as $colName => $colVal) { if (in_array($colName, $fields)) { $row[$colName] = $row[$colName]; @@ -1930,7 +1930,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND * * @return bool */ - function grandTotal(&$rows) { + public function grandTotal(&$rows) { if (!$this->_rollup || ($this->_rollup == '') || ($this->_limit && count($rows) >= self::ROW_COUNT_LIMIT) ) { @@ -1958,7 +1958,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND * @param $rows * @param bool $pager */ - function formatDisplay(&$rows, $pager = TRUE) { + public function formatDisplay(&$rows, $pager = TRUE) { // set pager based on if any limit was applied in the query. if ($pager) { $this->setPager(); @@ -2007,14 +2007,14 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND /** * @param $rows */ - function buildChart(&$rows) { + public function buildChart(&$rows) { // override this method for building charts. } // select() method below has been added recently (v3.3), and many of the report templates might // still be having their own select() method. We should fix them as and when encountered and move // towards generalizing the select() method below. - function select() { + public function select() { $select = $this->_selectAliases = array(); foreach ($this->_columns as $tableName => $table) { @@ -2182,11 +2182,11 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND * * @return bool */ - function selectClause(&$tableName, $tableKey, &$fieldName, &$field) { + public function selectClause(&$tableName, $tableKey, &$fieldName, &$field) { return FALSE; } - function where() { + public function where() { $this->storeWhereHavingClauseArray(); if (empty($this->_whereClauses)) { @@ -2213,7 +2213,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND * temp table that may not be part of the final where clause or added * in other functions */ - function storeWhereHavingClauseArray() { + public function storeWhereHavingClauseArray() { foreach ($this->_columns as $tableName => $table) { if (array_key_exists('filters', $table)) { foreach ($table['filters'] as $fieldName => $field) { @@ -2270,7 +2270,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND } - function processReportMode() { + public function processReportMode() { $buttonName = $this->controller->getButtonName(); $output = CRM_Utils_Request::retrieve( @@ -2338,7 +2338,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND /** * Post Processing function for Form (postProcessCommon should be used to set other variables from input as the api accesses that function) */ - function beginPostProcess() { + public function beginPostProcess() { $this->setParams($this->controller->exportValues($this->_name)); if (empty($this->_params) && @@ -2372,7 +2372,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND /** * BeginPostProcess function run in both report mode and non-report mode (api) */ - function beginPostProcessCommon() { + public function beginPostProcessCommon() { } @@ -2381,7 +2381,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND * * @return string */ - function buildQuery($applyLimit = TRUE) { + public function buildQuery($applyLimit = TRUE) { $this->select(); $this->from(); $this->customDataFrom(); @@ -2404,7 +2404,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND return $sql; } - function groupBy() { + public function groupBy() { $groupBys = array(); if (!empty($this->_params['group_bys']) && is_array($this->_params['group_bys']) && @@ -2426,7 +2426,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND } } - function orderBy() { + public function orderBy() { $this->_orderBy = ""; $this->_sections = array(); $this->storeOrderByArray(); @@ -2441,7 +2441,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND * Separating this into a separate function allows it to be called separately from constructing * the order by clause */ - function storeOrderByArray() { + public function storeOrderByArray() { $orderBys = array(); if (!empty($this->_params['order_bys']) && @@ -2493,7 +2493,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND /** * @return array */ - function unselectedSectionColumns() { + public function unselectedSectionColumns() { $selectColumns = array(); foreach ($this->_columns as $tableName => $table) { if (array_key_exists('fields', $table)) { @@ -2520,7 +2520,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND * @param $sql * @param $rows */ - function buildRows($sql, &$rows) { + public function buildRows($sql, &$rows) { $dao = CRM_Core_DAO::executeQuery($sql); if (!is_array($rows)) { $rows = array(); @@ -2555,7 +2555,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND * an array of total counts for each section. This data is used by the Smarty * plugin {sectionTotal} */ - function sectionTotals() { + public function sectionTotals() { // Reports using order_bys with sections must populate $this->_selectAliases in select() method. if (empty($this->_selectAliases)) { @@ -2616,14 +2616,14 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND } } - function modifyColumnHeaders() { + public function modifyColumnHeaders() { // use this method to modify $this->_columnHeaders } /** * @param $rows */ - function doTemplateAssignment(&$rows) { + public function doTemplateAssignment(&$rows) { $this->assign_by_ref('columnHeaders', $this->_columnHeaders); $this->assign_by_ref('rows', $rows); $this->assign('statistics', $this->statistics($rows)); @@ -2635,7 +2635,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { $statistics = array(); $count = count($rows); @@ -2657,7 +2657,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND * @param $statistics * @param $count */ - function countStat(&$statistics, $count) { + public function countStat(&$statistics, $count) { $statistics['counts']['rowCount'] = array( 'title' => ts('Row(s) Listed'), 'value' => $count, @@ -2674,7 +2674,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND /** * @param $statistics */ - function groupByStat(&$statistics) { + public function groupByStat(&$statistics) { if (!empty($this->_params['group_bys']) && is_array($this->_params['group_bys']) && !empty($this->_params['group_bys']) @@ -2698,7 +2698,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND /** * @param $statistics */ - function filterStat(&$statistics) { + public function filterStat(&$statistics) { foreach ($this->_columns as $tableName => $table) { if (array_key_exists('filters', $table)) { foreach ($table['filters'] as $fieldName => $field) { @@ -2804,7 +2804,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND /** * @param null $rows */ - function endPostProcess(&$rows = NULL) { + public function endPostProcess(&$rows = NULL) { if ($this->_storeResultSet) { $this->_resultSet = $rows; } @@ -2922,14 +2922,14 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND } } - function storeResultSet() { + public function storeResultSet() { $this->_storeResultSet = TRUE; } /** * @return bool */ - function getResultSet() { + public function getResultSet() { return $this->_resultSet; } @@ -2946,7 +2946,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND /** * @return string */ - function getTemplateFileName() { + public function getTemplateFileName() { $defaultTpl = parent::getTemplateFileName(); $template = CRM_Core_Smarty::singleton(); if (!$template->template_exists($defaultTpl)) { @@ -2963,7 +2963,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND /** * @return string */ - function compileContent() { + public function compileContent() { $templateFile = $this->getHookedTemplateFileName(); return $this->_formValues['report_header'] . CRM_Core_Form::$_template->fetch($templateFile) . @@ -2971,7 +2971,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND } - function postProcess() { + public function postProcess() { // get ready with post process params $this->beginPostProcess(); @@ -2996,7 +2996,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND /** * @param int $rowCount */ - function limit($rowCount = self::ROW_COUNT_LIMIT) { + public function limit($rowCount = self::ROW_COUNT_LIMIT) { // lets do the pager if in html mode $this->_limit = NULL; @@ -3042,7 +3042,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND /** * @param int $rowCount */ - function setPager($rowCount = self::ROW_COUNT_LIMIT) { + public function setPager($rowCount = self::ROW_COUNT_LIMIT) { // CRM-14115, over-ride row count if rowCount is specified in URL if ($this->_dashBoardRowCount) { @@ -3074,7 +3074,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND * * @return string */ - function whereGroupClause($field, $value, $op) { + public function whereGroupClause($field, $value, $op) { $smartGroupQuery = ""; @@ -3121,7 +3121,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND * * @return string */ - function whereTagClause($field, $value, $op) { + public function whereTagClause($field, $value, $op) { // not using left join in query because if any contact // belongs to more than one tag, results duplicate // entries. @@ -3137,7 +3137,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND WHERE entity_table = 'civicrm_contact' AND {$clause} ) "; } - function whereMembershipOrgClause($field, $value, $op) { + public function whereMembershipOrgClause($field, $value, $op) { $sqlOp = $this->getSQLOperator($op); if (!is_array($value)) { $value = array($value); @@ -3156,7 +3156,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND AND mem_status.is_active = '1' ) "; } - function whereMembershipTypeClause($field, $value, $op) { + public function whereMembershipTypeClause($field, $value, $op) { $sqlOp = $this->getSQLOperator($op); if (!is_array($value)) { $value = array($value); @@ -3178,7 +3178,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND /** * @param string $tableAlias */ - function buildACLClause($tableAlias = 'contact_a') { + public function buildACLClause($tableAlias = 'contact_a') { list($this->_aclFrom, $this->_aclWhere) = CRM_Contact_BAO_Contact_Permission::cacheClause($tableAlias); } @@ -3186,7 +3186,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND * @param bool $addFields * @param array $permCustomGroupIds */ - function addCustomDataToColumns($addFields = TRUE, $permCustomGroupIds = array()) { + public function addCustomDataToColumns($addFields = TRUE, $permCustomGroupIds = array()) { if (empty($this->_customGroupExtends)) { return; } @@ -3374,7 +3374,7 @@ ORDER BY cg.weight, cf.weight"; } } - function customDataFrom() { + public function customDataFrom() { if (empty($this->_customGroupExtends)) { return; } @@ -3416,7 +3416,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a * * @return bool */ - function isFieldSelected($prop) { + public function isFieldSelected($prop) { if (empty($prop)) { return FALSE; } @@ -3495,7 +3495,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a * Check for empty order_by configurations and remove them; also set * template to hide them. */ - function preProcessOrderBy(&$formValues) { + public function preProcessOrderBy(&$formValues) { // Object to show/hide form elements $_showHide = new CRM_Core_ShowHideBlocks('', ''); @@ -3538,7 +3538,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a * * @return bool */ - function isTableSelected($tableName) { + public function isTableSelected($tableName) { return in_array($tableName, $this->selectedTables()); } @@ -3548,7 +3548,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a * * @return Array $this->_selectedTables */ - function selectedTables() { + public function selectedTables() { if (!$this->_selectedTables) { $orderByColumns = array(); if (array_key_exists('order_bys', $this->_params) && @@ -3609,7 +3609,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a * * @return array address fields for construct clause */ - function addAddressFields($groupBy = TRUE, $orderBy = FALSE, $filters = TRUE, $defaults = array('country_id' => TRUE)) { + public function addAddressFields($groupBy = TRUE, $orderBy = FALSE, $filters = TRUE, $defaults = array('country_id' => TRUE)) { $addressFields = array( 'civicrm_address' => array( 'dao' => 'CRM_Core_DAO_Address', @@ -3764,7 +3764,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a * * @return bool */ - function alterDisplayAddressFields(&$row, &$rows, &$rowNum, $baseUrl, $urltxt) { + public function alterDisplayAddressFields(&$row, &$rows, &$rowNum, $baseUrl, $urltxt) { $criteriaQueryParams = CRM_Report_Utils_Report::getPreviewCriteriaQueryParams($this->_defaults, $this->_params); $entryFound = FALSE; // handle country @@ -3827,7 +3827,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a * * @return string */ - function fiscalYearOffset($fieldName) { + public function fiscalYearOffset($fieldName) { $config = CRM_Core_Config::singleton(); $fy = $config->fiscalYearStart; if (CRM_Utils_Array::value('yid_op', $this->_params) == 'calendar' || @@ -3842,7 +3842,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a /* * Add Address into From Table if required */ - function addAddressFromClause() { + public function addAddressFromClause() { // include address field if address column is to be included if ((isset($this->_addressField) && $this->_addressField @@ -3860,7 +3860,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a /** * Add Phone into From Table if required */ - function addPhoneFromClause() { + public function addPhoneFromClause() { // include address field if address column is to be included if ($this->isTableSelected('civicrm_phone') ) { @@ -3881,7 +3881,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a * * @return array phone columns definition */ - function getPhoneColumns($options = array()) { + public function getPhoneColumns($options = array()) { $defaultOptions = array( 'prefix' => '', 'prefix_label' => '', @@ -3912,7 +3912,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a * * @return array address columns definition */ - function getAddressColumns($options = array()) { + public function getAddressColumns($options = array()) { $options += array( 'prefix' => '', 'prefix_label' => '', @@ -3932,7 +3932,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a /** * @param int $groupID */ - function add2group($groupID) { + public function add2group($groupID) { if (is_numeric($groupID) && isset($this->_aliases['civicrm_contact'])) { $select = "SELECT DISTINCT {$this->_aliases['civicrm_contact']}.id AS addtogroup_contact_id, "; $select = str_ireplace('SELECT SQL_CALC_FOUND_ROWS ', $select, $this->_select); @@ -3959,7 +3959,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a } /* function used for showing charts on print screen */ - static function uploadChartImage() { + public static function uploadChartImage() { // upload strictly for '.png' images $name = trim(basename(CRM_Utils_Request::retrieve('name', 'String', CRM_Core_DAO::$_nullObject, FALSE, NULL, 'GET'))); if (preg_match('/\.png$/', $name)) { diff --git a/CRM/Report/Form/Activity.php b/CRM/Report/Form/Activity.php index aed8b7d99e..a877d55ad7 100644 --- a/CRM/Report/Form/Activity.php +++ b/CRM/Report/Form/Activity.php @@ -47,7 +47,7 @@ class CRM_Report_Form_Activity extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { // There could be multiple contacts. We not clear on which contact id to display. // Lets hide it for now. $this->_exposeContactID = FALSE; @@ -300,7 +300,7 @@ class CRM_Report_Form_Activity extends CRM_Report_Form { /** adding address fields with dbAlias for order clause * @return array address fields */ - function addressFields($orderBy = FALSE) { + public function addressFields($orderBy = FALSE) { $address = parent::addAddressFields(FALSE, TRUE); if ($orderBy) { foreach ($address['civicrm_address']['order_bys'] as $fieldName => $field) { @@ -313,7 +313,7 @@ class CRM_Report_Form_Activity extends CRM_Report_Form { /** * @param null $recordType */ - function select($recordType = NULL) { + public function select($recordType = NULL) { if (!array_key_exists("contact_{$recordType}", $this->_params['fields']) && $recordType != 'final' ) { @@ -404,7 +404,7 @@ class CRM_Report_Form_Activity extends CRM_Report_Form { /** * @param $recordType */ - function from($recordType) { + public function from($recordType) { $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); $activityTypeId = CRM_Core_DAO::getFieldValue("CRM_Core_DAO_OptionGroup", 'activity_type', 'id', 'name'); $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); @@ -476,7 +476,7 @@ class CRM_Report_Form_Activity extends CRM_Report_Form { /** * @param null $recordType */ - function where($recordType = NULL) { + public function where($recordType = NULL) { $this->_where = " WHERE {$this->_aliases['civicrm_activity']}.is_test = 0 AND {$this->_aliases['civicrm_activity']}.is_deleted = 0 AND {$this->_aliases['civicrm_activity']}.is_current_revision = 1"; @@ -559,14 +559,14 @@ class CRM_Report_Form_Activity extends CRM_Report_Form { } } - function groupBy() { + public function groupBy() { $this->_groupBy = "GROUP BY {$this->_aliases['civicrm_activity']}.id"; } /** * @param string $tableAlias */ - function buildACLClause($tableAlias = 'contact_a') { + public function buildACLClause($tableAlias = 'contact_a') { //override for ACL( Since Contact may be source //contact/assignee or target also it may be null ) @@ -597,7 +597,7 @@ class CRM_Report_Form_Activity extends CRM_Report_Form { * * @throws Exception */ - function add2group($groupID) { + public function add2group($groupID) { if (CRM_Utils_Array::value("contact_target_op", $this->_params) == 'nll') { CRM_Core_Error::fatal(ts('Current filter criteria didn\'t have any target contact to add to group')); } @@ -629,7 +629,7 @@ GROUP BY civicrm_activity_id {$this->_having} {$this->_orderBy}"; } } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); //Assign those recordtype to array which have filter operator as 'Is not empty' or 'Is empty' @@ -721,7 +721,7 @@ GROUP BY civicrm_activity_id {$this->_having} {$this->_orderBy} {$this->_limit}" /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; @@ -889,7 +889,7 @@ GROUP BY civicrm_activity_id {$this->_having} {$this->_orderBy} {$this->_limit}" } } - function sectionTotals() { + public function sectionTotals() { // Reports using order_bys with sections must populate $this->_selectAliases in select() method. if (empty($this->_selectAliases)) { return; diff --git a/CRM/Report/Form/ActivitySummary.php b/CRM/Report/Form/ActivitySummary.php index c3a0bc6819..18e59a1a5c 100644 --- a/CRM/Report/Form/ActivitySummary.php +++ b/CRM/Report/Form/ActivitySummary.php @@ -44,7 +44,7 @@ class CRM_Report_Form_ActivitySummary extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->_columns = array( 'civicrm_contact' => array( 'dao' => 'CRM_Contact_DAO_Contact', @@ -170,7 +170,7 @@ class CRM_Report_Form_ActivitySummary extends CRM_Report_Form { parent::__construct(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); foreach ($this->_columns as $tableName => $table) { @@ -275,7 +275,7 @@ class CRM_Report_Form_ActivitySummary extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } - function from() { + public function from() { $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); @@ -326,7 +326,7 @@ class CRM_Report_Form_ActivitySummary extends CRM_Report_Form { } } - function where() { + public function where() { $this->_where = " WHERE civicrm_option_group.name = 'activity_type' AND {$this->_aliases['civicrm_activity']}.is_test = 0 AND {$this->_aliases['civicrm_activity']}.is_deleted = 0 AND @@ -376,7 +376,7 @@ class CRM_Report_Form_ActivitySummary extends CRM_Report_Form { } } - function groupBy() { + public function groupBy() { $this->_groupBy = array(); if (is_array($this->_params['group_bys']) && !empty($this->_params['group_bys']) @@ -423,7 +423,7 @@ class CRM_Report_Form_ActivitySummary extends CRM_Report_Form { * * @return array */ - function formRule($fields, $files, $self) { + public function formRule($fields, $files, $self) { $errors = array(); $contactFields = array('sort_name', 'email', 'phone'); if (!empty($fields['group_bys'])) { @@ -454,7 +454,7 @@ class CRM_Report_Form_ActivitySummary extends CRM_Report_Form { return $errors; } - function postProcess() { + public function postProcess() { // get the acl clauses built before we assemble the query $this->buildACLClause($this->_aliases['civicrm_contact']); parent::postProcess(); @@ -463,7 +463,7 @@ class CRM_Report_Form_ActivitySummary extends CRM_Report_Form { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Campaign/SurveyDetails.php b/CRM/Report/Form/Campaign/SurveyDetails.php index fad91e5594..a64f713398 100644 --- a/CRM/Report/Form/Campaign/SurveyDetails.php +++ b/CRM/Report/Form/Campaign/SurveyDetails.php @@ -59,7 +59,7 @@ class CRM_Report_Form_Campaign_SurveyDetails extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { //filter options for survey activity status. $responseStatus = array('' => '- Any -'); self::$_surveyRespondentStatus = array(); @@ -291,11 +291,11 @@ class CRM_Report_Form_Campaign_SurveyDetails extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { $select = array(); //add the survey response fields. @@ -332,7 +332,7 @@ class CRM_Report_Form_Campaign_SurveyDetails extends CRM_Report_Form { $this->_select = "SELECT " . implode(",\n", $select) . " "; } - function from() { + public function from() { $this->_from = " FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom} "; $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); @@ -378,7 +378,7 @@ class CRM_Report_Form_Campaign_SurveyDetails extends CRM_Report_Form { } } - function where() { + public function where() { $clauses = array(); foreach ($this->_columns as $tableName => $table) { if (array_key_exists('filters', $table)) { @@ -435,7 +435,7 @@ class CRM_Report_Form_Campaign_SurveyDetails extends CRM_Report_Form { } } - function postProcess() { + public function postProcess() { // get the acl clauses built before we assemble the query $this->buildACLClause($this->_aliases['civicrm_contact']); @@ -614,7 +614,7 @@ INNER JOIN civicrm_option_value val ON ( val.option_group_id = survey.result_id /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { //format the survey result data. $this->_formatSurveyResult($rows); diff --git a/CRM/Report/Form/Case/Demographics.php b/CRM/Report/Form/Case/Demographics.php index 6c409e7d60..a80b79280f 100644 --- a/CRM/Report/Form/Case/Demographics.php +++ b/CRM/Report/Form/Case/Demographics.php @@ -47,7 +47,7 @@ class CRM_Report_Form_Case_Demographics extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->_columns = array( 'civicrm_contact' => array( 'dao' => 'CRM_Contact_DAO_Contact', @@ -227,11 +227,11 @@ where (cg.extends='Contact' OR cg.extends='Individual' OR cg.extends_entity_colu parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); foreach ($this->_columns as $tableName => $table) { @@ -265,12 +265,12 @@ where (cg.extends='Contact' OR cg.extends='Individual' OR cg.extends_entity_colu * * @return array */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = $grouping = array(); return $errors; } - function from() { + public function from() { $this->_from = " FROM civicrm_contact {$this->_aliases['civicrm_contact']} LEFT JOIN civicrm_address {$this->_aliases['civicrm_address']} @@ -307,7 +307,7 @@ where (cg.extends='Contact' OR cg.extends='Individual' OR cg.extends_entity_colu } } - function where() { + public function where() { $clauses = array(); $this->_having = ''; foreach ($this->_columns as $tableName => $table) { @@ -359,15 +359,15 @@ where (cg.extends='Contact' OR cg.extends='Individual' OR cg.extends_entity_colu $this->_where = "WHERE " . implode(' AND ', $clauses); } - function groupBy() { + public function groupBy() { $this->_groupBy = "GROUP BY {$this->_aliases['civicrm_contact']}.id, {$this->_aliases['civicrm_case']}.id"; } - function orderBy() { + public function orderBy() { $this->_orderBy = "ORDER BY {$this->_aliases['civicrm_contact']}.sort_name, {$this->_aliases['civicrm_contact']}.id, {$this->_aliases['civicrm_case']}.id"; } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); @@ -383,7 +383,7 @@ where (cg.extends='Contact' OR cg.extends='Individual' OR cg.extends_entity_colu /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; foreach ($rows as $rowNum => $row) { @@ -451,7 +451,7 @@ where (cg.extends='Contact' OR cg.extends='Individual' OR cg.extends_entity_colu * * @return null|string */ - function getCustomFieldLabel($fname, $val) { + public function getCustomFieldLabel($fname, $val) { $query = " SELECT v.label FROM civicrm_custom_group cg INNER JOIN civicrm_custom_field cf ON cg.id = cf.custom_group_id diff --git a/CRM/Report/Form/Case/Detail.php b/CRM/Report/Form/Case/Detail.php index 26f0ffbd5a..1a9eddec6a 100644 --- a/CRM/Report/Form/Case/Detail.php +++ b/CRM/Report/Form/Case/Detail.php @@ -59,7 +59,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->case_statuses = CRM_Core_OptionGroup::values('case_status'); $this->case_types = CRM_Case_PseudoConstant::caseType(); $rels = CRM_Core_PseudoConstant::relationshipType(); @@ -266,16 +266,16 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function buildQuickForm() { + public function buildQuickForm() { parent::buildQuickForm(); $this->caseDetailSpecialColumnsAdd(); } - function caseDetailSpecialColumnsAdd() { + public function caseDetailSpecialColumnsAdd() { $elements = array(); $elements[] = &$this->createElement('select', 'case_activity_all_dates', NULL, array( @@ -294,7 +294,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { $this->assign('caseDetailExtra', $this->_caseDetailExtra); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); foreach ($this->_columns as $tableName => $table) { @@ -340,7 +340,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { $this->_select = 'SELECT ' . implode(', ', $select) . ' '; } - function from() { + public function from() { $case = $this->_aliases['civicrm_case']; $conact = $this->_aliases['civicrm_contact']; @@ -393,7 +393,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { } } - function where() { + public function where() { $clauses = array(); $this->_having = ''; foreach ($this->_columns as $tableName => $table) { @@ -458,7 +458,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { } } - function groupBy() { + public function groupBy() { $this->_groupBy = " GROUP BY {$this->_aliases['civicrm_case']}.id"; } @@ -467,7 +467,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { $statistics = parent::statistics($rows); $select = "select COUNT( DISTINCT( {$this->_aliases['civicrm_address']}.country_id))"; @@ -497,11 +497,11 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { return $statistics; } - function orderBy() { + public function orderBy() { $this->_orderBy = " ORDER BY {$this->_aliases['civicrm_case']}.start_date DESC "; } - function caseDetailSpecialColumnProcess() { + public function caseDetailSpecialColumnProcess() { if (!$this->_includeCaseDetailExtra) { return; } @@ -526,7 +526,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { $this->_from .= ' ' . implode(' ', $from) . ' '; } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); @@ -547,7 +547,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { $this->endPostProcess($rows); } - function checkEnabledFields() { + public function checkEnabledFields() { if (isset($this->_params['worldregion_id_value']) && !empty($this->_params['worldregion_id_value']) ) { @@ -579,7 +579,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { $entryFound = FALSE; $activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE); diff --git a/CRM/Report/Form/Case/Summary.php b/CRM/Report/Form/Case/Summary.php index 713b74dc77..fea1096320 100644 --- a/CRM/Report/Form/Case/Summary.php +++ b/CRM/Report/Form/Case/Summary.php @@ -45,7 +45,7 @@ class CRM_Report_Form_Case_Summary extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->case_types = CRM_Case_PseudoConstant::caseType(); $this->case_statuses = CRM_Core_OptionGroup::values('case_status'); $rels = CRM_Core_PseudoConstant::relationshipType(); @@ -184,11 +184,11 @@ class CRM_Report_Form_Case_Summary extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); foreach ($this->_columns as $tableName => $table) { @@ -225,7 +225,7 @@ class CRM_Report_Form_Case_Summary extends CRM_Report_Form { * * @return array */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = $grouping = array(); if (empty($fields['relationship_type_id_value']) && (array_key_exists('sort_name', $fields['fields']) || @@ -243,7 +243,7 @@ class CRM_Report_Form_Case_Summary extends CRM_Report_Form { return $errors; } - function from() { + public function from() { $cc = $this->_aliases['civicrm_case']; $c = $this->_aliases['civicrm_contact']; @@ -271,7 +271,7 @@ inner join civicrm_contact $c2 on ${c2}.id=${ccc}.contact_id } } - function where() { + public function where() { $clauses = array(); $this->_having = ''; foreach ($this->_columns as $tableName => $table) { @@ -326,11 +326,11 @@ inner join civicrm_contact $c2 on ${c2}.id=${ccc}.contact_id } } - function groupBy() { + public function groupBy() { $this->_groupBy = ""; } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); @@ -347,7 +347,7 @@ inner join civicrm_contact $c2 on ${c2}.id=${ccc}.contact_id /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { $entryFound = FALSE; foreach ($rows as $rowNum => $row) { if (array_key_exists('civicrm_case_status_id', $row)) { diff --git a/CRM/Report/Form/Case/TimeSpent.php b/CRM/Report/Form/Case/TimeSpent.php index fa805df794..d19c13faaa 100644 --- a/CRM/Report/Form/Case/TimeSpent.php +++ b/CRM/Report/Form/Case/TimeSpent.php @@ -40,7 +40,7 @@ class CRM_Report_Form_Case_TimeSpent extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE); asort($this->activityTypes); @@ -165,7 +165,7 @@ class CRM_Report_Form_Case_TimeSpent extends CRM_Report_Form { parent::__construct(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); @@ -214,7 +214,7 @@ class CRM_Report_Form_Case_TimeSpent extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } - function from() { + public function from() { $this->_from = " FROM civicrm_activity {$this->_aliases['civicrm_activity']} @@ -227,7 +227,7 @@ class CRM_Report_Form_Case_TimeSpent extends CRM_Report_Form { "; } - function where() { + public function where() { $this->_where = " WHERE {$this->_aliases['civicrm_activity']}.is_current_revision = 1 AND {$this->_aliases['civicrm_activity']}.is_deleted = 0 AND {$this->_aliases['civicrm_activity']}.is_test = 0"; @@ -283,7 +283,7 @@ class CRM_Report_Form_Case_TimeSpent extends CRM_Report_Form { } } - function groupBy() { + public function groupBy() { $this->_groupBy = ''; if ($this->has_grouping) { $this->_groupBy = " @@ -295,11 +295,11 @@ GROUP BY {$this->_aliases['civicrm_contact']}.id, } } - function orderBy() { + public function orderBy() { $this->_orderBy = "ORDER BY {$this->_aliases['civicrm_contact']}.sort_name, {$this->_aliases['civicrm_contact']}.id"; } - function postProcess() { + public function postProcess() { parent::postProcess(); } @@ -310,7 +310,7 @@ GROUP BY {$this->_aliases['civicrm_contact']}.id, * * @return array */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); if (!empty($fields['group_bys']) && (!array_key_exists('id', $fields['fields']) || @@ -325,7 +325,7 @@ GROUP BY {$this->_aliases['civicrm_contact']}.id, /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Contact/CurrentEmployer.php b/CRM/Report/Form/Contact/CurrentEmployer.php index e3d69949e4..85e4d9e36b 100644 --- a/CRM/Report/Form/Contact/CurrentEmployer.php +++ b/CRM/Report/Form/Contact/CurrentEmployer.php @@ -50,7 +50,7 @@ class CRM_Report_Form_Contact_CurrentEmployer extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->_columns = array( 'civicrm_employer' => array( @@ -192,11 +192,11 @@ class CRM_Report_Form_Contact_CurrentEmployer extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { $select = $this->_columnHeaders = array(); @@ -218,7 +218,7 @@ class CRM_Report_Form_Contact_CurrentEmployer extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } - function from() { + public function from() { $this->_from = " FROM civicrm_contact {$this->_aliases['civicrm_contact']} @@ -242,7 +242,7 @@ FROM civicrm_contact {$this->_aliases['civicrm_contact']} AND {$this->_aliases['civicrm_email']}.is_primary = 1) "; } - function where() { + public function where() { $clauses = array(); foreach ($this->_columns as $tableName => $table) { @@ -291,15 +291,15 @@ FROM civicrm_contact {$this->_aliases['civicrm_contact']} } } - function groupBy() { + public function groupBy() { $this->_groupBy = "GROUP BY {$this->_aliases['civicrm_employer']}.id,{$this->_aliases['civicrm_contact']}.id"; } - function orderBy() { + public function orderBy() { $this->_orderBy = "ORDER BY {$this->_aliases['civicrm_employer']}.organization_name, {$this->_aliases['civicrm_contact']}.display_name"; } - function postProcess() { + public function postProcess() { // get the acl clauses built before we assemble the query $this->buildACLClause(array( $this->_aliases['civicrm_contact'], @@ -311,7 +311,7 @@ FROM civicrm_contact {$this->_aliases['civicrm_contact']} /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $checkList = array(); $entryFound = FALSE; diff --git a/CRM/Report/Form/Contact/Detail.php b/CRM/Report/Form/Contact/Detail.php index ec6ad61133..b5ce50ae1f 100644 --- a/CRM/Report/Form/Contact/Detail.php +++ b/CRM/Report/Form/Contact/Detail.php @@ -50,7 +50,7 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->_autoIncludeIndexedFieldsAsOrderBys = 1; $this->_columns = array( 'civicrm_contact' => array( @@ -346,12 +346,12 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { $this->_csvSupported = FALSE; parent::preProcess(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); $this->_component = array( @@ -425,12 +425,12 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form { * * @return array */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); return $errors; } - function from() { + public function from() { $group = " "; $this->_from = " FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom}"; @@ -538,7 +538,7 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form { } } - function where() { + public function where() { $clauses = array(); foreach ($this->_columns as $tableName => $table) { @@ -587,7 +587,7 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form { /** * @return array */ - function clauseComponent() { + public function clauseComponent() { $selectedContacts = implode(',', $this->_contactSelected); $contribution = $membership = $participant = NULL; $eligibleResult = $rows = $tempArray = array(); @@ -733,7 +733,7 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form { * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { $statistics = array(); $count = count($rows); @@ -751,7 +751,7 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form { /** * @param int $rowCount */ - function limit($rowCount = self::ROW_COUNT_LIMIT) { + public function limit($rowCount = self::ROW_COUNT_LIMIT) { parent::limit($rowCount); } @@ -759,11 +759,11 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form { /** * @param int $rowCount */ - function setPager($rowCount = self::ROW_COUNT_LIMIT) { + public function setPager($rowCount = self::ROW_COUNT_LIMIT) { parent::setPager($rowCount); } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); @@ -813,7 +813,7 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; @@ -854,7 +854,7 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form { /** * @param $componentRows */ - function alterComponentDisplay(&$componentRows) { + public function alterComponentDisplay(&$componentRows) { // custom code to alter rows $activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE); $activityStatus = CRM_Core_PseudoConstant::activityStatus(); diff --git a/CRM/Report/Form/Contact/Log.php b/CRM/Report/Form/Contact/Log.php index 40a8ea24e9..b38eecd7ed 100644 --- a/CRM/Report/Form/Contact/Log.php +++ b/CRM/Report/Form/Contact/Log.php @@ -43,7 +43,7 @@ class CRM_Report_Form_Contact_Log extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE); asort($this->activityTypes); @@ -143,11 +143,11 @@ class CRM_Report_Form_Contact_Log extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); foreach ($this->_columns as $tableName => $table) { @@ -175,12 +175,12 @@ class CRM_Report_Form_Contact_Log extends CRM_Report_Form { * * @return array */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = $grouping = array(); return $errors; } - function from() { + public function from() { $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); $sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); $this->_from = " @@ -194,7 +194,7 @@ class CRM_Report_Form_Contact_Log extends CRM_Report_Form { "; } - function where() { + public function where() { $clauses = array(); $this->_having = ''; foreach ($this->_columns as $tableName => $table) { @@ -233,7 +233,7 @@ class CRM_Report_Form_Contact_Log extends CRM_Report_Form { $this->_where = "WHERE " . implode(' AND ', $clauses); } - function orderBy() { + public function orderBy() { $this->_orderBy = " ORDER BY {$this->_aliases['civicrm_log']}.modified_date DESC, {$this->_aliases['civicrm_contact']}.sort_name, {$this->_aliases['civicrm_contact_touched']}.sort_name "; @@ -242,7 +242,7 @@ ORDER BY {$this->_aliases['civicrm_log']}.modified_date DESC, {$this->_aliases[' /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; foreach ($rows as $rowNum => $row) { diff --git a/CRM/Report/Form/Contact/LoggingDetail.php b/CRM/Report/Form/Contact/LoggingDetail.php index 4a29cf2dc8..795967d505 100644 --- a/CRM/Report/Form/Contact/LoggingDetail.php +++ b/CRM/Report/Form/Contact/LoggingDetail.php @@ -37,7 +37,7 @@ class CRM_Report_Form_Contact_LoggingDetail extends CRM_Logging_ReportDetail { /** * */ - function __construct() { + public function __construct() { $logging = new CRM_Logging_Schema; $this->tables[] = 'civicrm_contact'; $this->tables = array_merge($this->tables, array_keys($logging->customDataLogTables())); @@ -61,7 +61,7 @@ class CRM_Report_Form_Contact_LoggingDetail extends CRM_Logging_ReportDetail { parent::__construct(); } - function buildQuickForm() { + public function buildQuickForm() { $layout = CRM_Utils_Request::retrieve('layout', 'String', $this); $this->assign('layout', $layout); diff --git a/CRM/Report/Form/Contact/LoggingSummary.php b/CRM/Report/Form/Contact/LoggingSummary.php index ecc14c304b..65cb0af61f 100644 --- a/CRM/Report/Form/Contact/LoggingSummary.php +++ b/CRM/Report/Form/Contact/LoggingSummary.php @@ -36,7 +36,7 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary { /** * */ - function __construct() { + public function __construct() { parent::__construct(); $logTypes = array(); @@ -160,7 +160,7 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // cache for id → is_deleted mapping $isDeleted = array(); $newRows = array(); @@ -237,7 +237,7 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary { /** * @param null $logTable */ - function from( $logTable = null ) { + public function from( $logTable = null ) { static $entity = null; if ( $logTable ) { $entity = $logTable; diff --git a/CRM/Report/Form/Contact/Relationship.php b/CRM/Report/Form/Contact/Relationship.php index c34278eaa9..8575c97640 100644 --- a/CRM/Report/Form/Contact/Relationship.php +++ b/CRM/Report/Form/Contact/Relationship.php @@ -45,7 +45,7 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { ); public $_drilldownReport = array('contact/detail' => 'Link to Detail Report'); - function __construct() { + public function __construct() { $contact_type = CRM_Contact_BAO_ContactType::getSelectElements(FALSE, TRUE, '_'); @@ -255,11 +255,11 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { $select = $this->_columnHeaders = array(); foreach ($this->_columns as $tableName => $table) { if (array_key_exists('fields', $table)) { @@ -291,7 +291,7 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } - function from() { + public function from() { $this->_from = " FROM civicrm_relationship {$this->_aliases['civicrm_relationship']} @@ -354,7 +354,7 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { } } - function where() { + public function where() { $whereClauses = $havingClauses = array(); foreach ($this->_columns as $tableName => $table) { if (array_key_exists('filters', $table)) { @@ -467,7 +467,7 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { $statistics = parent::statistics($rows); $isStatusFilter = FALSE; @@ -505,7 +505,7 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { return $statistics; } - function groupBy() { + public function groupBy() { $this->_groupBy = " "; $groupBy = array(); if ($this->relationType == 'a_b') { @@ -524,11 +524,11 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { } } - function orderBy() { + public function orderBy() { $this->_orderBy = " ORDER BY {$this->_aliases['civicrm_contact']}.sort_name, {$this->_aliases['civicrm_contact_b']}.sort_name "; } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); $this->relationType = NULL; @@ -560,7 +560,7 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Contact/Summary.php b/CRM/Report/Form/Contact/Summary.php index 42a108e47b..397efc6327 100644 --- a/CRM/Report/Form/Contact/Summary.php +++ b/CRM/Report/Form/Contact/Summary.php @@ -53,7 +53,7 @@ class CRM_Report_Form_Contact_Summary extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->_autoIncludeIndexedFieldsAsOrderBys = 1; $this->_columns = array( 'civicrm_contact' => array( @@ -164,11 +164,11 @@ class CRM_Report_Form_Contact_Summary extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); foreach ($this->_columns as $tableName => $table) { @@ -207,12 +207,12 @@ class CRM_Report_Form_Contact_Summary extends CRM_Report_Form { * * @return array */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = $grouping = array(); return $errors; } - function from() { + public function from() { $this->_from = " FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom} LEFT JOIN civicrm_address {$this->_aliases['civicrm_address']} @@ -241,7 +241,7 @@ class CRM_Report_Form_Contact_Summary extends CRM_Report_Form { } } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); @@ -273,7 +273,7 @@ class CRM_Report_Form_Contact_Summary extends CRM_Report_Form { $entryFound = TRUE; } - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Contribute/Bookkeeping.php b/CRM/Report/Form/Contribute/Bookkeeping.php index d3662e64d2..f3d2482491 100644 --- a/CRM/Report/Form/Contribute/Bookkeeping.php +++ b/CRM/Report/Form/Contribute/Bookkeeping.php @@ -50,7 +50,7 @@ class CRM_Report_Form_Contribute_Bookkeeping extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->_columns = array( 'civicrm_contact' => array( 'dao' => 'CRM_Contact_DAO_Contact', @@ -274,11 +274,11 @@ class CRM_Report_Form_Contribute_Bookkeeping extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); @@ -324,7 +324,7 @@ class CRM_Report_Form_Contribute_Bookkeeping extends CRM_Report_Form { $this->_select = 'SELECT ' . implode(', ', $select) . ' '; } - function from() { + public function from() { $this->_from = NULL; $this->_from = "FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom} @@ -355,7 +355,7 @@ class CRM_Report_Form_Contribute_Bookkeeping extends CRM_Report_Form { ON fitem.entity_id = {$this->_aliases['civicrm_line_item']}.id AND fitem.entity_table = 'civicrm_line_item' "; } - function orderBy() { + public function orderBy() { parent::orderBy(); // please note this will just add the order-by columns to select query, and not display in column-headers. @@ -369,7 +369,7 @@ class CRM_Report_Form_Contribute_Bookkeeping extends CRM_Report_Form { } } - function where() { + public function where() { foreach ($this->_columns as $tableName => $table) { if (array_key_exists('filters', $table)) { foreach ($table['filters'] as $fieldName => $field) { @@ -420,7 +420,7 @@ class CRM_Report_Form_Contribute_Bookkeeping extends CRM_Report_Form { } } - function postProcess() { + public function postProcess() { // get the acl clauses built before we assemble the query $this->buildACLClause($this->_aliases['civicrm_contact']); parent::postProcess(); @@ -431,7 +431,7 @@ class CRM_Report_Form_Contribute_Bookkeeping extends CRM_Report_Form { * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { $statistics = parent::statistics($rows); $select = " SELECT COUNT({$this->_aliases['civicrm_financial_trxn']}.id ) as count, @@ -470,7 +470,7 @@ class CRM_Report_Form_Contribute_Bookkeeping extends CRM_Report_Form { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { $contributionTypes = CRM_Contribute_PseudoConstant::financialType(); $paymentInstruments = CRM_Contribute_PseudoConstant::paymentInstrument(); $contributionStatus = CRM_Contribute_PseudoConstant::contributionStatus(); diff --git a/CRM/Report/Form/Contribute/Detail.php b/CRM/Report/Form/Contribute/Detail.php index 4936df85ea..76e3309e16 100644 --- a/CRM/Report/Form/Contribute/Detail.php +++ b/CRM/Report/Form/Contribute/Detail.php @@ -50,7 +50,7 @@ class CRM_Report_Form_Contribute_Detail extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { // Check if CiviCampaign is a) enabled and b) has active campaigns $config = CRM_Core_Config::singleton(); @@ -333,11 +333,11 @@ class CRM_Report_Form_Contribute_Detail extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { $this->_columnHeaders = array(); parent::select(); @@ -346,7 +346,7 @@ class CRM_Report_Form_Contribute_Detail extends CRM_Report_Form { $this->_select = str_replace("sum({$this->_aliases['civicrm_contribution']}.total_amount)", "{$this->_aliases['civicrm_contribution']}.total_amount", $this->_select); } - function orderBy() { + public function orderBy() { parent::orderBy(); // please note this will just add the order-by columns to select query, and not display in column-headers. @@ -363,7 +363,7 @@ class CRM_Report_Form_Contribute_Detail extends CRM_Report_Form { /** * @param bool $softcredit */ - function from($softcredit = FALSE) { + public function from($softcredit = FALSE) { $this->_from = " FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom} INNER JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']} @@ -444,7 +444,7 @@ class CRM_Report_Form_Contribute_Detail extends CRM_Report_Form { } - function groupBy() { + public function groupBy() { $this->_groupBy = " GROUP BY {$this->_aliases['civicrm_contact']}.id, {$this->_aliases['civicrm_contribution']}.id "; } @@ -453,7 +453,7 @@ class CRM_Report_Form_Contribute_Detail extends CRM_Report_Form { * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { $statistics = parent::statistics($rows); $totalAmount = $average = array(); @@ -534,7 +534,7 @@ GROUP BY {$this->_aliases['civicrm_contribution']}.currency"; return $statistics; } - function postProcess() { + public function postProcess() { // get the acl clauses built before we assemble the query $this->buildACLClause($this->_aliases['civicrm_contact']); @@ -640,7 +640,7 @@ UNION ALL /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $checkList = array(); $entryFound = FALSE; @@ -809,7 +809,7 @@ WHERE civicrm_contribution_contribution_id={$row['civicrm_contribution_contribu } } - function sectionTotals() { + public function sectionTotals() { // Reports using order_bys with sections must populate $this->_selectAliases in select() method. if (empty($this->_selectAliases)) { diff --git a/CRM/Report/Form/Contribute/History.php b/CRM/Report/Form/Contribute/History.php index f0b5f08a3e..5627ae93bd 100644 --- a/CRM/Report/Form/Contribute/History.php +++ b/CRM/Report/Form/Contribute/History.php @@ -57,7 +57,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $yearsInPast = 4; $date = CRM_Core_SelectValues::date('custom', NULL, $yearsInPast, 0); $count = $date['maxYear']; @@ -240,11 +240,11 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); @@ -309,7 +309,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } - function from() { + public function from() { $this->_from = " FROM civicrm_contact {$this->_aliases['civicrm_contact']} INNER JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']} @@ -341,7 +341,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { } } - function where() { + public function where() { $whereClauses = $havingClauses = $relationshipWhere = array(); $this->_relationshipWhere = ''; $this->_statusClause = ''; @@ -418,7 +418,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { } } - function groupBy() { + public function groupBy() { $this->_groupBy = "GROUP BY {$this->_aliases['civicrm_contribution']}.contact_id, YEAR({$this->_aliases['civicrm_contribution']}.receive_date)"; } @@ -426,7 +426,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { /** * @param int $rowCount */ - function limit($rowCount = self::ROW_COUNT_LIMIT) { + public function limit($rowCount = self::ROW_COUNT_LIMIT) { parent::limit($rowCount); } @@ -434,7 +434,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { /** * @param int $rowCount */ - function setPager($rowCount = self::ROW_COUNT_LIMIT) { + public function setPager($rowCount = self::ROW_COUNT_LIMIT) { parent::setPager($rowCount); } @@ -443,7 +443,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { $statistics = parent::statistics($rows); $count = 0; foreach ($rows as $rownum => $row) { @@ -473,7 +473,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { * * @return array */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); if (!empty($fields['this_year_value']) && !empty($fields['other_year_value']) && @@ -484,7 +484,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { return $errors; } - function postProcess() { + public function postProcess() { // get ready with post process params $this->beginPostProcess(); $this->fixReportParams(); @@ -513,7 +513,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { $this->endPostProcess($rows); } - function fixReportParams() { + public function fixReportParams() { if (!empty($this->_params['this_year_value'])) { $this->_referenceYear['this_year'] = $this->_params['this_year_value']; } @@ -525,7 +525,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { /** * @param $rows */ - function buildRows($sql, &$rows) { + public function buildRows($sql, &$rows) { $contactIds = array(); $addWhere = ''; @@ -620,7 +620,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { * * @return array */ - function buildContributionRows($contactIds) { + public function buildContributionRows($contactIds) { $rows = array(); if (empty($contactIds)) { return $rows; @@ -673,7 +673,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { * * @return array */ - function buildRelationshipRows($contactIds) { + public function buildRelationshipRows($contactIds) { $relationshipRows = $relatedContactIds = array(); if (empty($contactIds)) { return array($relationshipRows, $relatedContactIds); @@ -720,7 +720,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { * * @return array */ - function getOperationPair($type = "string", $fieldName = NULL) { + public function getOperationPair($type = "string", $fieldName = NULL) { if ($fieldName == 'this_year' || $fieldName == 'other_year') { return array( 'calendar' => ts('Is Calendar Year'), @@ -733,7 +733,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { if (empty($rows)) { return; } diff --git a/CRM/Report/Form/Contribute/HouseholdSummary.php b/CRM/Report/Form/Contribute/HouseholdSummary.php index c7479b8291..60037b7086 100644 --- a/CRM/Report/Form/Contribute/HouseholdSummary.php +++ b/CRM/Report/Form/Contribute/HouseholdSummary.php @@ -49,7 +49,7 @@ class CRM_Report_Form_Contribute_HouseholdSummary extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { self::validRelationships(); $config = CRM_Core_Config::singleton(); @@ -200,11 +200,11 @@ class CRM_Report_Form_Contribute_HouseholdSummary extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { $this->_columnHeaders = $select = array(); foreach ($this->_columns as $tableName => $table) { if (array_key_exists('fields', $table)) { @@ -240,7 +240,7 @@ class CRM_Report_Form_Contribute_HouseholdSummary extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } - function from() { + public function from() { $this->_from = NULL; $this->_from = " @@ -267,7 +267,7 @@ class CRM_Report_Form_Contribute_HouseholdSummary extends CRM_Report_Form { } } - function where() { + public function where() { $clauses = array(); foreach ($this->_columns as $tableName => $table) { if (array_key_exists('filters', $table)) { @@ -318,11 +318,11 @@ class CRM_Report_Form_Contribute_HouseholdSummary extends CRM_Report_Form { } } - function groupBy() { + public function groupBy() { $this->_groupBy = " GROUP BY {$this->_aliases['civicrm_relationship']}.$this->householdContact, {$this->_aliases['civicrm_relationship']}.$this->otherContact , {$this->_aliases['civicrm_contribution']}.id, {$this->_aliases['civicrm_relationship']}.relationship_type_id "; } - function orderBy() { + public function orderBy() { $this->_orderBy = " ORDER BY {$this->_aliases['civicrm_contact_household']}.household_name, {$this->_aliases['civicrm_relationship']}.$this->householdContact, {$this->_aliases['civicrm_contact']}.sort_name, {$this->_aliases['civicrm_relationship']}.$this->otherContact"; } @@ -331,7 +331,7 @@ class CRM_Report_Form_Contribute_HouseholdSummary extends CRM_Report_Form { * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { $statistics = parent::statistics($rows); //hack filter display for relationship type @@ -348,7 +348,7 @@ class CRM_Report_Form_Contribute_HouseholdSummary extends CRM_Report_Form { return $statistics; } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); $this->buildACLClause(array( @@ -367,7 +367,7 @@ class CRM_Report_Form_Contribute_HouseholdSummary extends CRM_Report_Form { /** * Set variables to be accessed by API and form layer in processing */ - function beginPostProcessCommon() { + public function beginPostProcessCommon() { $getRelationship = $this->_params['relationship_type_id_value']; $type = substr($getRelationship, -3); $this->relationshipId = intval((substr($getRelationship, 0, strpos($getRelationship, '_')))); @@ -381,7 +381,7 @@ class CRM_Report_Form_Contribute_HouseholdSummary extends CRM_Report_Form { } } - function validRelationships() { + public function validRelationships() { $this->relationTypes = $relationTypes = array(); $params = array('contact_type_b' => 'Household', 'version' => 3); @@ -411,7 +411,7 @@ class CRM_Report_Form_Contribute_HouseholdSummary extends CRM_Report_Form { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $type = substr($this->_params['relationship_type_id_value'], -3); diff --git a/CRM/Report/Form/Contribute/LoggingDetail.php b/CRM/Report/Form/Contribute/LoggingDetail.php index 61dab8e866..e75b21abca 100644 --- a/CRM/Report/Form/Contribute/LoggingDetail.php +++ b/CRM/Report/Form/Contribute/LoggingDetail.php @@ -37,7 +37,7 @@ class CRM_Report_Form_Contribute_LoggingDetail extends CRM_Logging_ReportDetail /** * */ - function __construct() { + public function __construct() { $logging = new CRM_Logging_Schema; $this->tables[] = 'civicrm_contribution'; $this->tables = array_merge($this->tables, array_keys($logging->customDataLogTables())); @@ -48,7 +48,7 @@ class CRM_Report_Form_Contribute_LoggingDetail extends CRM_Logging_ReportDetail parent::__construct(); } - function buildQuickForm() { + public function buildQuickForm() { parent::buildQuickForm(); // link back to summary report diff --git a/CRM/Report/Form/Contribute/LoggingSummary.php b/CRM/Report/Form/Contribute/LoggingSummary.php index cec784d4b1..bc5ec577da 100644 --- a/CRM/Report/Form/Contribute/LoggingSummary.php +++ b/CRM/Report/Form/Contribute/LoggingSummary.php @@ -37,7 +37,7 @@ class CRM_Report_Form_Contribute_LoggingSummary extends CRM_Logging_ReportSummar /** * */ - function __construct() { + public function __construct() { $this->_columns = array( 'civicrm_contact_altered_contact' => array( 'dao' => 'CRM_Contact_DAO_Contact', @@ -178,7 +178,7 @@ class CRM_Report_Form_Contribute_LoggingSummary extends CRM_Logging_ReportSummar /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // cache for id → is_deleted mapping $isDeleted = array(); @@ -216,7 +216,7 @@ class CRM_Report_Form_Contribute_LoggingSummary extends CRM_Logging_ReportSummar } } - function from() { + public function from() { $this->_from = " FROM `{$this->loggingDB}`.log_civicrm_contribution {$this->_aliases['log_civicrm_contribution']} LEFT JOIN civicrm_contact {$this->_aliases['civicrm_contact_altered_by']} diff --git a/CRM/Report/Form/Contribute/Lybunt.php b/CRM/Report/Form/Contribute/Lybunt.php index a590d1174e..20cec80a59 100644 --- a/CRM/Report/Form/Contribute/Lybunt.php +++ b/CRM/Report/Form/Contribute/Lybunt.php @@ -52,7 +52,7 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $yearsInPast = 10; $yearsInFuture = 1; $date = CRM_Core_SelectValues::date('custom', NULL, $yearsInPast, $yearsInFuture); @@ -187,11 +187,11 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { $this->_columnHeaders = $select = array(); $current_year = $this->_params['yid_value']; @@ -236,7 +236,7 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } - function from() { + public function from() { $this->_from = " FROM civicrm_contribution {$this->_aliases['civicrm_contribution']} @@ -259,7 +259,7 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { $this->addAddressFromClause(); } - function where() { + public function where() { $this->_statusClause = ""; $clauses = array($this->_aliases['civicrm_contribution'] . '.is_test = 0'); $current_year = $this->_params['yid_value']; @@ -319,7 +319,7 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { } } - function groupBy() { + public function groupBy() { $this->_groupBy = "GROUP BY {$this->_aliases['civicrm_contribution']}.contact_id, " . self::fiscalYearOffset($this->_aliases['civicrm_contribution'] . @@ -332,7 +332,7 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { $statistics = parent::statistics($rows); if (!empty($rows)) { $select = " @@ -353,7 +353,7 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { return $statistics; } - function postProcess() { + public function postProcess() { // get ready with post process params $this->beginPostProcess(); @@ -431,7 +431,7 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { /** * @param $rows */ - function buildChart(&$rows) { + public function buildChart(&$rows) { $graphRows = array(); $count = 0; @@ -466,7 +466,7 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; @@ -510,7 +510,7 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { * * @return array */ - function getOperationPair($type = "string", $fieldName = NULL) { + public function getOperationPair($type = "string", $fieldName = NULL) { if ($fieldName == 'yid') { return array( 'calendar' => ts('Is Calendar Year'), diff --git a/CRM/Report/Form/Contribute/OrganizationSummary.php b/CRM/Report/Form/Contribute/OrganizationSummary.php index eec48b47e1..adcc65cfff 100644 --- a/CRM/Report/Form/Contribute/OrganizationSummary.php +++ b/CRM/Report/Form/Contribute/OrganizationSummary.php @@ -61,7 +61,7 @@ class CRM_Report_Form_Contribute_OrganizationSummary extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { self::validRelationships(); $config = CRM_Core_Config::singleton(); $campaignEnabled = in_array('CiviCampaign', $config->enableComponents); @@ -211,11 +211,11 @@ class CRM_Report_Form_Contribute_OrganizationSummary extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { $this->_columnHeaders = $select = array(); foreach ($this->_columns as $tableName => $table) { if (array_key_exists('fields', $table)) { @@ -249,7 +249,7 @@ class CRM_Report_Form_Contribute_OrganizationSummary extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } - function from() { + public function from() { $this->_from = NULL; $this->_from = " @@ -276,7 +276,7 @@ class CRM_Report_Form_Contribute_OrganizationSummary extends CRM_Report_Form { } } - function where() { + public function where() { $clauses = array(); foreach ($this->_columns as $tableName => $table) { if (array_key_exists('filters', $table)) { @@ -325,11 +325,11 @@ class CRM_Report_Form_Contribute_OrganizationSummary extends CRM_Report_Form { } } - function groupBy() { + public function groupBy() { $this->_groupBy = " GROUP BY {$this->_aliases['civicrm_relationship']}.$this->orgContact, {$this->_aliases['civicrm_relationship']}.$this->otherContact , {$this->_aliases['civicrm_contribution']}.id, {$this->_aliases['civicrm_relationship']}.relationship_type_id "; } - function orderBy() { + public function orderBy() { $this->_orderBy = " ORDER BY {$this->_aliases['civicrm_contact_organization']}.organization_name, {$this->_aliases['civicrm_relationship']}.$this->orgContact, {$this->_aliases['civicrm_contact']}.sort_name, {$this->_aliases['civicrm_relationship']}.$this->otherContact"; } @@ -338,7 +338,7 @@ class CRM_Report_Form_Contribute_OrganizationSummary extends CRM_Report_Form { * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { $statistics = parent::statistics($rows); //hack filter display for relationship type @@ -352,7 +352,7 @@ class CRM_Report_Form_Contribute_OrganizationSummary extends CRM_Report_Form { return $statistics; } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); $this->buildACLClause(array($this->_aliases['civicrm_contact'], $this->_aliases['civicrm_contact_organization'])); $sql = $this->buildQuery(TRUE); @@ -366,7 +366,7 @@ class CRM_Report_Form_Contribute_OrganizationSummary extends CRM_Report_Form { /** * Set variables to be accessed by API and form layer in processing */ - function beginPostProcessCommon() { + public function beginPostProcessCommon() { $getRelationship = $this->_params['relationship_type_id_value']; $type = substr($getRelationship, -3); $this->relationshipId = intval((substr($getRelationship, 0, strpos($getRelationship, '_')))); @@ -380,7 +380,7 @@ class CRM_Report_Form_Contribute_OrganizationSummary extends CRM_Report_Form { } } - function validRelationships() { + public function validRelationships() { $this->relationTypes = $relationTypes = array(); $params = array('contact_type_b' => 'Organization', 'version' => 3); @@ -412,7 +412,7 @@ class CRM_Report_Form_Contribute_OrganizationSummary extends CRM_Report_Form { /** * @param array $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $type = substr($this->_params['relationship_type_id_value'], -3); diff --git a/CRM/Report/Form/Contribute/PCP.php b/CRM/Report/Form/Contribute/PCP.php index 9157610557..81a26e4bcd 100644 --- a/CRM/Report/Form/Contribute/PCP.php +++ b/CRM/Report/Form/Contribute/PCP.php @@ -40,7 +40,7 @@ class CRM_Report_Form_Contribute_PCP extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->_columns = array( 'civicrm_contact' => array( 'dao' => 'CRM_Contact_DAO_Contact', @@ -174,7 +174,7 @@ class CRM_Report_Form_Contribute_PCP extends CRM_Report_Form { parent::__construct(); } - function from() { + public function from() { $this->_from = " FROM civicrm_pcp {$this->_aliases['civicrm_pcp']} @@ -195,15 +195,15 @@ LEFT JOIN civicrm_contribution_page {$this->_aliases['civicrm_contribution_page' {$this->_aliases['civicrm_contribution_page']}.id"; } - function groupBy() { + public function groupBy() { $this->_groupBy = "GROUP BY {$this->_aliases['civicrm_pcp']}.id"; } - function orderBy() { + public function orderBy() { $this->_orderBy = " ORDER BY {$this->_aliases['civicrm_contact']}.sort_name "; } - function where() { + public function where() { $whereClauses = $havingClauses = array(); foreach ($this->_columns as $tableName => $table) { @@ -264,7 +264,7 @@ LEFT JOIN civicrm_contribution_page {$this->_aliases['civicrm_contribution_page' * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { $statistics = parent::statistics($rows); $select = @@ -301,7 +301,7 @@ LEFT JOIN civicrm_contribution_page {$this->_aliases['civicrm_contribution_page' /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; $checkList = array(); diff --git a/CRM/Report/Form/Contribute/Recur.php b/CRM/Report/Form/Contribute/Recur.php index bce3bfe84a..3858a0fa70 100644 --- a/CRM/Report/Form/Contribute/Recur.php +++ b/CRM/Report/Form/Contribute/Recur.php @@ -34,7 +34,7 @@ */ class CRM_Report_Form_Contribute_Recur extends CRM_Report_Form { - function __construct() { + public function __construct() { $this->_columns = array( 'civicrm_contact' => array( 'dao' => 'CRM_Contact_DAO_Contact', @@ -208,11 +208,11 @@ class CRM_Report_Form_Contribute_Recur extends CRM_Report_Form { $this->_currencyColumn = 'civicrm_contribution_recur_currency'; parent::__construct(); } - function getTemplateName() { + public function getTemplateName() { return 'CRM/Report/Form.tpl' ; } - function from() { + public function from() { $this->_from = " FROM civicrm_contact {$this->_aliases['civicrm_contact']} INNER JOIN civicrm_contribution_recur {$this->_aliases['civicrm_contribution_recur']} @@ -229,11 +229,11 @@ class CRM_Report_Form_Contribute_Recur extends CRM_Report_Form { {$this->_aliases['civicrm_phone']}.is_primary = 1)"; } - function groupBy() { + public function groupBy() { $this->_groupBy = "GROUP BY " . $this->_aliases['civicrm_contribution_recur'] . ".id"; } - function where() { + public function where() { parent::where(); // Handle calculated end date. This can come from one of two sources: // Either there is a specified end date for the end_date field @@ -297,7 +297,7 @@ class CRM_Report_Form_Contribute_Recur extends CRM_Report_Form { } - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { $contributionStatus = CRM_Contribute_PseudoConstant::contributionStatus(); foreach ($rows as $rowNum => $row) { // convert display name to links diff --git a/CRM/Report/Form/Contribute/Repeat.php b/CRM/Report/Form/Contribute/Repeat.php index 5a19f2bfd8..52601b3f8e 100644 --- a/CRM/Report/Form/Contribute/Repeat.php +++ b/CRM/Report/Form/Contribute/Repeat.php @@ -44,7 +44,7 @@ class CRM_Report_Form_Contribute_Repeat extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->_columns = array( 'civicrm_contact' => array( 'dao' => 'CRM_Contact_DAO_Contact', @@ -218,7 +218,7 @@ contribution_civireport2.total_amount_sum as contribution2_total_amount_sum', parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } @@ -227,11 +227,11 @@ contribution_civireport2.total_amount_sum as contribution2_total_amount_sum', * * @return array */ - function setDefaultValues($freeze = TRUE) { + public function setDefaultValues($freeze = TRUE) { return parent::setDefaultValues($freeze); } - function select() { + public function select() { $select = array(); $append = NULL; // since contact fields not related to financial type @@ -276,7 +276,7 @@ contribution_civireport2.total_amount_sum as contribution2_total_amount_sum', /** * @param bool $tableCol */ - function groupBy($tableCol = FALSE) { + public function groupBy($tableCol = FALSE) { $this->_groupBy = ""; if (!empty($this->_params['group_bys']) && is_array($this->_params['group_bys']) @@ -300,7 +300,7 @@ contribution_civireport2.total_amount_sum as contribution2_total_amount_sum', } } - function from() { + public function from() { list($fromTable, $fromAlias, $fromCol) = $this->groupBy(TRUE); $from = "$fromTable $fromAlias"; @@ -341,7 +341,7 @@ LEFT JOIN civicrm_temp_civireport_repeat2 {$this->_aliases['civicrm_contribution * * @return mixed|string */ - function whereContribution($replaceAliasWith = 'contribution1') { + public function whereContribution($replaceAliasWith = 'contribution1') { $clauses = array("is_test" => "{$this->_aliases['civicrm_contribution']}.is_test = 0"); foreach ($this->_columns['civicrm_contribution']['filters'] as $fieldName => $field) { @@ -399,7 +399,7 @@ LEFT JOIN civicrm_temp_civireport_repeat2 {$this->_aliases['civicrm_contribution return $whereClause; } - function where() { + public function where() { if (!$this->_amountClauseWithAND) { $this->_amountClauseWithAND = "!({$this->_aliases['civicrm_contribution']}1.total_amount_count IS NULL AND {$this->_aliases['civicrm_contribution']}2.total_amount_count IS NULL)"; @@ -439,7 +439,7 @@ LEFT JOIN civicrm_temp_civireport_repeat2 {$this->_aliases['civicrm_contribution * * @return array */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = $checkDate = $errorCount = array(); @@ -599,7 +599,7 @@ LEFT JOIN civicrm_temp_civireport_repeat2 {$this->_aliases['civicrm_contribution * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { $statistics = parent::statistics($rows); //fetch contributions for both date ranges from pre-existing temp tables @@ -758,7 +758,7 @@ GROUP BY currency return $statistics; } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); $create = $subSelect1 = $subSelect2 = NULL; list($fromTable, $fromAlias, $fromCol) = $this->groupBy(TRUE); @@ -905,7 +905,7 @@ currency varchar(3) /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows list($from1, $to1) = $this->getFromTo(CRM_Utils_Array::value("receive_date1_relative", $this->_params), CRM_Utils_Array::value("receive_date1_from", $this->_params), diff --git a/CRM/Report/Form/Contribute/SoftCredit.php b/CRM/Report/Form/Contribute/SoftCredit.php index c614389218..a35723b994 100644 --- a/CRM/Report/Form/Contribute/SoftCredit.php +++ b/CRM/Report/Form/Contribute/SoftCredit.php @@ -51,7 +51,7 @@ class CRM_Report_Form_Contribute_SoftCredit extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { // Check if CiviCampaign is a) enabled and b) has active campaigns $config = CRM_Core_Config::singleton(); @@ -243,11 +243,11 @@ class CRM_Report_Form_Contribute_SoftCredit extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); foreach ($this->_columns as $tableName => $table) { @@ -322,12 +322,12 @@ class CRM_Report_Form_Contribute_SoftCredit extends CRM_Report_Form { * * @return array */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = $grouping = array(); return $errors; } - function from() { + public function from() { $alias_constituent = 'constituentname'; $alias_creditor = 'contact_civireport'; $this->_from = " @@ -387,13 +387,13 @@ class CRM_Report_Form_Contribute_SoftCredit extends CRM_Report_Form { } } - function groupBy() { + public function groupBy() { $this->_rollup = 'WITH ROLLUP'; $this->_groupBy = " GROUP BY {$this->_aliases['civicrm_contribution_soft']}.contact_id, constituentname.id {$this->_rollup}"; } - function where() { + public function where() { parent::where(); $this->_where .= " AND {$this->_aliases['civicrm_contribution']}.is_test = 0 "; } @@ -403,7 +403,7 @@ GROUP BY {$this->_aliases['civicrm_contribution_soft']}.contact_id, constituentn * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { $statistics = parent::statistics($rows); $select = " @@ -445,7 +445,7 @@ GROUP BY {$this->_aliases['civicrm_contribution']}.currency return $statistics; } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); $this->buildACLClause(array('constituentname', 'contact_civireport')); @@ -475,7 +475,7 @@ GROUP BY {$this->_aliases['civicrm_contribution']}.currency /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Contribute/Summary.php b/CRM/Report/Form/Contribute/Summary.php index d6c8d9d1ba..b7677a81b0 100644 --- a/CRM/Report/Form/Contribute/Summary.php +++ b/CRM/Report/Form/Contribute/Summary.php @@ -51,7 +51,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { // Check if CiviCampaign is a) enabled and b) has active campaigns $config = CRM_Core_Config::singleton(); @@ -264,7 +264,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } @@ -273,11 +273,11 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { * * @return array */ - function setDefaultValues($freeze = TRUE) { + public function setDefaultValues($freeze = TRUE) { return parent::setDefaultValues($freeze); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); foreach ($this->_columns as $tableName => $table) { @@ -389,7 +389,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { * * @return array */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = $grouping = array(); //check for searching combination of dispaly columns and //grouping criteria @@ -419,7 +419,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { return $errors; } - function from() { + public function from() { $softCreditJoin = "LEFT"; if (!empty($this->_params['fields']['soft_amount']) && empty($this->_params['fields']['total_amount']) @@ -454,7 +454,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { } } - function groupBy() { + public function groupBy() { $this->_groupBy = ""; $append = FALSE; if (is_array($this->_params['group_bys']) && @@ -503,7 +503,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { } } - function storeWhereHavingClauseArray() { + public function storeWhereHavingClauseArray() { parent::storeWhereHavingClauseArray(); if (empty($this->_params['fields']['soft_amount']) && !empty($this->_havingClauses) @@ -521,7 +521,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { $statistics = parent::statistics($rows); $softCredit = CRM_Utils_Array::value('soft_amount', $this->_params['fields']); @@ -598,7 +598,7 @@ ROUND(AVG({$this->_aliases['civicrm_contribution_soft']}.amount), 2) as civicrm_ return $statistics; } - function postProcess() { + public function postProcess() { $this->buildACLClause($this->_aliases['civicrm_contact']); parent::postProcess(); } @@ -606,7 +606,7 @@ ROUND(AVG({$this->_aliases['civicrm_contribution_soft']}.amount), 2) as civicrm_ /** * @param $rows */ - function buildChart(&$rows) { + public function buildChart(&$rows) { $graphRows = array(); if (!empty($this->_params['charts'])) { @@ -657,7 +657,7 @@ ROUND(AVG({$this->_aliases['civicrm_contribution_soft']}.amount), 2) as civicrm_ /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Contribute/Sybunt.php b/CRM/Report/Form/Contribute/Sybunt.php index b6a81da766..3e4af34a1d 100644 --- a/CRM/Report/Form/Contribute/Sybunt.php +++ b/CRM/Report/Form/Contribute/Sybunt.php @@ -44,7 +44,7 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $yearsInPast = 10; $yearsInFuture = 1; $date = CRM_Core_SelectValues::date('custom', NULL, $yearsInPast, $yearsInFuture); @@ -178,11 +178,11 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); $current_year = $this->_params['yid_value']; @@ -236,7 +236,7 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } - function from() { + public function from() { $this->_from = " FROM civicrm_contribution {$this->_aliases['civicrm_contribution']} @@ -259,7 +259,7 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { $this->addAddressFromClause(); } - function where() { + public function where() { $this->_statusClause = ""; $clauses = array($this->_aliases['civicrm_contribution'] . '.is_test = 0'); foreach ($this->_columns as $tableName => $table) { @@ -315,7 +315,7 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { } } - function groupBy() { + public function groupBy() { $this->assign('chartSupported', TRUE); $this->_groupBy = "Group BY {$this->_aliases['civicrm_contribution']}.contact_id, " . @@ -328,7 +328,7 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { $statistics = parent::statistics($rows); if (!empty($rows)) { @@ -349,7 +349,7 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { return $statistics; } - function postProcess() { + public function postProcess() { // get ready with post process params $this->beginPostProcess(); @@ -435,7 +435,7 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { /** * @param $rows */ - function buildChart(&$rows) { + public function buildChart(&$rows) { $graphRows = array(); $count = 0; $current_year = $this->_params['yid_value']; @@ -481,7 +481,7 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; @@ -525,7 +525,7 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { * * @return array */ - function getOperationPair($type = "string", $fieldName = NULL) { + public function getOperationPair($type = "string", $fieldName = NULL) { if ($fieldName == 'yid') { return array( 'calendar' => ts('Is Calendar Year'), diff --git a/CRM/Report/Form/Contribute/TopDonor.php b/CRM/Report/Form/Contribute/TopDonor.php index bbc8cd7dcb..15a230e313 100644 --- a/CRM/Report/Form/Contribute/TopDonor.php +++ b/CRM/Report/Form/Contribute/TopDonor.php @@ -51,7 +51,7 @@ class CRM_Report_Form_Contribute_TopDonor extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->_columns = array( 'civicrm_contact' => array( 'dao' => 'CRM_Contact_DAO_Contact', @@ -160,11 +160,11 @@ class CRM_Report_Form_Contribute_TopDonor extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); //Headers for Rank column @@ -226,7 +226,7 @@ class CRM_Report_Form_Contribute_TopDonor extends CRM_Report_Form { * * @return array */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); $op = CRM_Utils_Array::value('total_range_op', $fields); @@ -246,7 +246,7 @@ class CRM_Report_Form_Contribute_TopDonor extends CRM_Report_Form { return $errors; } - function from() { + public function from() { $this->_from = " FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom} INNER JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']} @@ -261,7 +261,7 @@ class CRM_Report_Form_Contribute_TopDonor extends CRM_Report_Form { $this->addAddressFromClause(); } - function where() { + public function where() { $clauses = array(); $this->_tempClause = $this->_outerCluase = $this->_groupLimit = ''; foreach ($this->_columns as $tableName => $table) { @@ -314,11 +314,11 @@ class CRM_Report_Form_Contribute_TopDonor extends CRM_Report_Form { } } - function groupBy() { + public function groupBy() { $this->_groupBy = "GROUP BY {$this->_aliases['civicrm_contact']}.id, {$this->_aliases['civicrm_contribution']}.currency"; } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); @@ -366,7 +366,7 @@ class CRM_Report_Form_Contribute_TopDonor extends CRM_Report_Form { /** * @param int $groupID */ - function add2group($groupID) { + public function add2group($groupID) { if (is_numeric($groupID)) { $sql = " @@ -389,7 +389,7 @@ ORDER BY civicrm_contribution_total_amount_sum DESC /** * @param int $rowCount */ - function limit($rowCount = CRM_Report_Form::ROW_COUNT_LIMIT) { + public function limit($rowCount = CRM_Report_Form::ROW_COUNT_LIMIT) { // lets do the pager if in html mode $this->_limit = NULL; @@ -425,7 +425,7 @@ ORDER BY civicrm_contribution_total_amount_sum DESC /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Event/Income.php b/CRM/Report/Form/Event/Income.php index 59d502785c..5ecc8e365c 100644 --- a/CRM/Report/Form/Event/Income.php +++ b/CRM/Report/Form/Event/Income.php @@ -47,7 +47,7 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { /** * */ - function __construct() { + public function __construct() { $this->_columns = array( 'civicrm_event' => array( @@ -66,7 +66,7 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { parent::__construct(); } - function preProcess() { + public function preProcess() { $this->_csvSupported = FALSE; parent::preProcess(); } @@ -74,7 +74,7 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { /** * @param $eventIDs */ - function buildEventReport($eventIDs) { + public function buildEventReport($eventIDs) { $this->assign('events', $eventIDs); @@ -269,7 +269,7 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { * * @return array */ - function statistics(&$eventIDs) { + public function statistics(&$eventIDs) { $statistics = array(); $count = count($eventIDs); $this->countStat($statistics, $count); @@ -283,7 +283,7 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { /** * @param int $rowCount */ - function limit($rowCount = self::ROW_COUNT_LIMIT) { + public function limit($rowCount = self::ROW_COUNT_LIMIT) { parent::limit($rowCount); //modify limit @@ -300,7 +300,7 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { /** * @param int $rowCount */ - function setPager($rowCount = self::ROW_COUNT_LIMIT) { + public function setPager($rowCount = self::ROW_COUNT_LIMIT) { $params = array( 'total' => $this->_rowsFound, 'rowCount' => self::ROW_COUNT_LIMIT, @@ -314,7 +314,7 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { $this->assign_by_ref('pager', $pager); } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); $this->_setVariable = TRUE; diff --git a/CRM/Report/Form/Event/IncomeCountSummary.php b/CRM/Report/Form/Event/IncomeCountSummary.php index 53fe42a57c..865b1ef355 100644 --- a/CRM/Report/Form/Event/IncomeCountSummary.php +++ b/CRM/Report/Form/Event/IncomeCountSummary.php @@ -56,7 +56,7 @@ class CRM_Report_Form_Event_IncomeCountSummary extends CRM_Report_Form_Event { /** * */ - function __construct() { + public function __construct() { $this->_columns = array( 'civicrm_event' => array( @@ -157,11 +157,11 @@ class CRM_Report_Form_Event_IncomeCountSummary extends CRM_Report_Form_Event { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { $select = array(); foreach ($this->_columns as $tableName => $table) { if (array_key_exists('fields', $table)) { @@ -208,7 +208,7 @@ class CRM_Report_Form_Event_IncomeCountSummary extends CRM_Report_Form_Event { $this->_select = "SELECT " . implode(', ', $select); } - function from() { + public function from() { $this->_from = " FROM civicrm_event {$this->_aliases['civicrm_event']} LEFT JOIN civicrm_participant {$this->_aliases['civicrm_participant']} @@ -219,7 +219,7 @@ class CRM_Report_Form_Event_IncomeCountSummary extends CRM_Report_Form_Event { {$this->_aliases['civicrm_line_item']}.entity_table = 'civicrm_participant' "; } - function where() { + public function where() { $clauses = array(); $this->_participantWhere = ""; foreach ($this->_columns as $tableName => $table) { @@ -265,7 +265,7 @@ class CRM_Report_Form_Event_IncomeCountSummary extends CRM_Report_Form_Event { * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { $statistics = parent::statistics($rows); $select = " SELECT SUM( {$this->_aliases['civicrm_line_item']}.participant_count ) as count, @@ -299,13 +299,13 @@ class CRM_Report_Form_Event_IncomeCountSummary extends CRM_Report_Form_Event { return $statistics; } - function groupBy() { + public function groupBy() { $this->assign('chartSupported', TRUE); $this->_rollup = " WITH ROLLUP"; $this->_groupBy = " GROUP BY {$this->_aliases['civicrm_event']}.id {$this->_rollup}"; } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); @@ -365,7 +365,7 @@ class CRM_Report_Form_Event_IncomeCountSummary extends CRM_Report_Form_Event { /** * @param $rows */ - function buildChart(&$rows) { + public function buildChart(&$rows) { $this->_interval = 'events'; $countEvent = NULL; @@ -408,7 +408,7 @@ class CRM_Report_Form_Event_IncomeCountSummary extends CRM_Report_Form_Event { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { if (is_array($rows)) { $eventType = CRM_Core_OptionGroup::values('event_type'); diff --git a/CRM/Report/Form/Event/ParticipantListCount.php b/CRM/Report/Form/Event/ParticipantListCount.php index 678813f0d3..20ca92ab8f 100644 --- a/CRM/Report/Form/Event/ParticipantListCount.php +++ b/CRM/Report/Form/Event/ParticipantListCount.php @@ -51,7 +51,7 @@ class CRM_Report_Form_Event_ParticipantListCount extends CRM_Report_Form_Event { /** * */ - function __construct() { + public function __construct() { $this->_columns = array( 'civicrm_contact' => array( 'dao' => 'CRM_Contact_DAO_Contact', @@ -268,7 +268,7 @@ class CRM_Report_Form_Event_ParticipantListCount extends CRM_Report_Form_Event { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } @@ -278,7 +278,7 @@ class CRM_Report_Form_Event_ParticipantListCount extends CRM_Report_Form_Event { * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { $statistics = parent::statistics($rows); $avg = NULL; @@ -312,7 +312,7 @@ class CRM_Report_Form_Event_ParticipantListCount extends CRM_Report_Form_Event { return $statistics; } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); @@ -367,12 +367,12 @@ class CRM_Report_Form_Event_ParticipantListCount extends CRM_Report_Form_Event { * * @return array */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = $grouping = array(); return $errors; } - function from() { + public function from() { $this->_from = " FROM civicrm_participant {$this->_aliases['civicrm_participant']} LEFT JOIN civicrm_event {$this->_aliases['civicrm_event']} @@ -395,12 +395,12 @@ class CRM_Report_Form_Event_ParticipantListCount extends CRM_Report_Form_Event { ON {$this->_aliases['civicrm_line_item']}.entity_table = 'civicrm_participant' AND {$this->_aliases['civicrm_participant']}.id ={$this->_aliases['civicrm_line_item']}.entity_id"; } - function storeWhereHavingClauseArray() { + public function storeWhereHavingClauseArray() { parent::storeWhereHavingClauseArray(); $this->_whereClauses[] = "{$this->_aliases['civicrm_participant']}.is_test = 0"; } - function groupBy() { + public function groupBy() { $this->_groupBy = ""; if (!empty($this->_params['group_bys']) && is_array($this->_params['group_bys']) && @@ -428,7 +428,7 @@ class CRM_Report_Form_Event_ParticipantListCount extends CRM_Report_Form_Event { $this->_groupBy; } - function postProcess() { + public function postProcess() { // get ready with post process params $this->beginPostProcess(); @@ -455,7 +455,7 @@ class CRM_Report_Form_Event_ParticipantListCount extends CRM_Report_Form_Event { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { $entryFound = FALSE; $eventType = CRM_Core_OptionGroup::values('event_type'); diff --git a/CRM/Report/Form/Event/ParticipantListing.php b/CRM/Report/Form/Event/ParticipantListing.php index b6e89ef75d..cdc7f7ca83 100644 --- a/CRM/Report/Form/Event/ParticipantListing.php +++ b/CRM/Report/Form/Event/ParticipantListing.php @@ -58,7 +58,7 @@ class CRM_Report_Form_Event_ParticipantListing extends CRM_Report_Form_Event { /** * */ - function __construct() { + public function __construct() { $this->_autoIncludeIndexedFieldsAsOrderBys = 1; // Check if CiviCampaign is a) enabled and b) has active campaigns @@ -408,7 +408,7 @@ class CRM_Report_Form_Event_ParticipantListing extends CRM_Report_Form_Event { /** * @return array */ - function getPriceLevels() { + public function getPriceLevels() { $query = " SELECT CONCAT(cv.label, ' (', ps.title, ')') label, cv.id FROM civicrm_price_field_value cv @@ -431,11 +431,11 @@ ORDER BY cv.label } //searches database for priceset values - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); @@ -488,12 +488,12 @@ ORDER BY cv.label * * @return array */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = $grouping = array(); return $errors; } - function from() { + public function from() { $this->_from = " FROM civicrm_participant {$this->_aliases['civicrm_participant']} LEFT JOIN civicrm_event {$this->_aliases['civicrm_event']} @@ -529,7 +529,7 @@ ORDER BY cv.label } } - function where() { + public function where() { $clauses = array(); foreach ($this->_columns as $tableName => $table) { if (array_key_exists('filters', $table)) { @@ -586,11 +586,11 @@ ORDER BY cv.label } } - function groupBy() { + public function groupBy() { $this->_groupBy = "GROUP BY {$this->_aliases['civicrm_participant']}.id"; } - function postProcess() { + public function postProcess() { // get ready with post process params $this->beginPostProcess(); @@ -639,7 +639,7 @@ ORDER BY cv.label /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Event/Summary.php b/CRM/Report/Form/Event/Summary.php index d7750c87ae..b397d5a96b 100644 --- a/CRM/Report/Form/Event/Summary.php +++ b/CRM/Report/Form/Event/Summary.php @@ -56,7 +56,7 @@ class CRM_Report_Form_Event_Summary extends CRM_Report_Form_Event { /** * */ - function __construct() { + public function __construct() { $this->_columns = array( 'civicrm_event' => array( @@ -112,11 +112,11 @@ class CRM_Report_Form_Event_Summary extends CRM_Report_Form_Event { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { $select = array(); foreach ($this->_columns as $tableName => $table) { if (array_key_exists('fields', $table)) { @@ -133,11 +133,11 @@ class CRM_Report_Form_Event_Summary extends CRM_Report_Form_Event { $this->_select = 'SELECT ' . implode(', ', $select); } - function from() { + public function from() { $this->_from = " FROM civicrm_event {$this->_aliases['civicrm_event']} "; } - function where() { + public function where() { $clauses = array(); $this->_participantWhere = ""; foreach ($this->_columns as $tableName => $table) { @@ -178,7 +178,7 @@ class CRM_Report_Form_Event_Summary extends CRM_Report_Form_Event { $this->_where = 'WHERE ' . implode(' AND ', $clauses); } - function groupBy() { + public function groupBy() { $this->assign('chartSupported', TRUE); $this->_groupBy = " GROUP BY {$this->_aliases['civicrm_event']}.id"; } @@ -187,7 +187,7 @@ class CRM_Report_Form_Event_Summary extends CRM_Report_Form_Event { /** * @return array */ - function participantInfo() { + public function participantInfo() { $statusType1 = CRM_Event_PseudoConstant::participantStatus(NULL, 'is_counted = 1'); $statusType2 = CRM_Event_PseudoConstant::participantStatus(NULL, 'is_counted = 0'); @@ -246,7 +246,7 @@ class CRM_Report_Form_Event_Summary extends CRM_Report_Form_Event { } //build header for table - function buildColumnHeaders() { + public function buildColumnHeaders() { $this->_columnHeaders = array(); foreach ($this->_columns as $tableName => $table) { @@ -286,7 +286,7 @@ class CRM_Report_Form_Event_Summary extends CRM_Report_Form_Event { ); } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); @@ -340,7 +340,7 @@ class CRM_Report_Form_Event_Summary extends CRM_Report_Form_Event { /** * @param $rows */ - function buildChart(&$rows) { + public function buildChart(&$rows) { $this->_interval = 'events'; $countEvent = NULL; if (!empty($this->_params['charts'])) { @@ -380,7 +380,7 @@ class CRM_Report_Form_Event_Summary extends CRM_Report_Form_Event { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { if (is_array($rows)) { $eventType = CRM_Core_OptionGroup::values('event_type'); diff --git a/CRM/Report/Form/Extended.php b/CRM/Report/Form/Extended.php index 3d82771160..8e3bb49db8 100644 --- a/CRM/Report/Form/Extended.php +++ b/CRM/Report/Form/Extended.php @@ -48,15 +48,15 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { parent::select(); } @@ -64,7 +64,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { /* * From clause build where baseTable & fromClauses are defined */ - function from() { + public function from() { if (!empty($this->_baseTable)) { $this->buildACLClause($this->_aliases['civicrm_contact']); $this->_from = "FROM {$this->_baseTable} {$this->_aliases[$this->_baseTable]}"; @@ -85,11 +85,11 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { /** * @return array */ - function fromClauses() { + public function fromClauses() { return array(); } - function groupBy() { + public function groupBy() { parent::groupBy(); //@todo - need to re-visit this - bad behaviour from pa if ($this->_groupBy == 'GROUP BY') { @@ -105,7 +105,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { } } - function orderBy() { + public function orderBy() { parent::orderBy(); } @@ -114,11 +114,11 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { return parent::statistics($rows); } - function postProcess() { + public function postProcess() { if (!empty($this->_aclTable) && !empty($this->_aliases[$this->_aclTable])) { $this->buildACLClause($this->_aliases[$this->_aclTable]); } @@ -128,7 +128,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { parent::alterDisplay($rows); //THis is all generic functionality which can hopefully go into the parent class @@ -172,7 +172,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { /** * @return array */ - function getLineItemColumns() { + public function getLineItemColumns() { return array( 'civicrm_line_item' => array( 'dao' => 'CRM_Price_BAO_LineItem', @@ -221,7 +221,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { /** * @return array */ - function getPriceFieldValueColumns() { + public function getPriceFieldValueColumns() { return array( 'civicrm_price_field_value' => array( 'dao' => 'CRM_Price_BAO_PriceFieldValue', @@ -261,7 +261,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { /** * @return array */ - function getPriceFieldColumns() { + public function getPriceFieldColumns() { return array( 'civicrm_price_field' => array( 'dao' => 'CRM_Price_BAO_PriceField', @@ -298,7 +298,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { /** * @return array */ - function getParticipantColumns() { + public function getParticipantColumns() { static $_events = array(); if (!isset($_events['all'])) { CRM_Core_PseudoConstant::populate($_events['all'], 'CRM_Event_DAO_Event', FALSE, 'title', 'is_active', "is_template IS NULL OR is_template = 0", 'end_date DESC'); @@ -371,7 +371,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { /** * @return array */ - function getMembershipColumns() { + public function getMembershipColumns() { return array( 'civicrm_membership' => array( 'dao' => 'CRM_Member_DAO_Membership', @@ -413,7 +413,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { /** * @return array */ - function getMembershipTypeColumns() { + public function getMembershipTypeColumns() { return array( 'civicrm_membership_type' => array( 'dao' => 'CRM_Member_DAO_MembershipType', @@ -434,7 +434,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { /** * @return array */ - function getEventColumns() { + public function getEventColumns() { return array( 'civicrm_event' => array( 'dao' => 'CRM_Event_DAO_Event', @@ -495,7 +495,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { /** * @return array */ - function getContributionColumns() { + public function getContributionColumns() { return array( 'civicrm_contribution' => array( 'dao' => 'CRM_Contribute_DAO_Contribution', @@ -568,7 +568,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { /** * @return array */ - function getContactColumns() { + public function getContactColumns() { return array( 'civicrm_contact' => array( 'dao' => 'CRM_Contact_DAO_Contact', @@ -616,7 +616,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { /** * @return array */ - function getCaseColumns() { + public function getCaseColumns() { return array( 'civicrm_case' => array( 'dao' => 'CRM_Case_DAO_Case', @@ -721,7 +721,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { * * @return array */ - function getAddressColumns($options = array()) { + public function getAddressColumns($options = array()) { $defaultOptions = array( 'prefix' => '', 'prefix_label' => '', @@ -926,7 +926,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { /** * @return array */ - function getAvailableJoins() { + public function getAvailableJoins() { return array( 'priceFieldValue_from_lineItem' => array( 'leftTable' => 'civicrm_line_item', @@ -1018,7 +1018,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { /** * @param string $prefix */ - function joinAddressFromContact($prefix = '') { + public function joinAddressFromContact($prefix = '') { $this->_from .= " LEFT JOIN civicrm_address {$this->_aliases[$prefix . 'civicrm_address']} ON {$this->_aliases[$prefix . @@ -1026,12 +1026,12 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { 'civicrm_contact']}.id"; } - function joinPriceFieldValueFromLineItem() { + public function joinPriceFieldValueFromLineItem() { $this->_from .= " LEFT JOIN civicrm_price_field_value {$this->_aliases['civicrm_price_field_value']} ON {$this->_aliases['civicrm_line_item']}.price_field_value_id = {$this->_aliases['civicrm_price_field_value']}.id"; } - function joinPriceFieldFromLineItem() { + public function joinPriceFieldFromLineItem() { $this->_from .= " LEFT JOIN civicrm_price_field {$this->_aliases['civicrm_price_field']} ON {$this->_aliases['civicrm_line_item']}.price_field_id = {$this->_aliases['civicrm_price_field']}.id @@ -1041,7 +1041,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { /* * Define join from line item table to participant table */ - function joinParticipantFromLineItem() { + public function joinParticipantFromLineItem() { $this->_from .= " LEFT JOIN civicrm_participant {$this->_aliases['civicrm_participant']} ON ( {$this->_aliases['civicrm_line_item']}.entity_id = {$this->_aliases['civicrm_participant']}.id AND {$this->_aliases['civicrm_line_item']}.entity_table = 'civicrm_participant') @@ -1052,7 +1052,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { * Define join from line item table to Membership table. Seems to be still via contribution * as the entity. Have made 'inner' to restrict does that make sense? */ - function joinMembershipFromLineItem() { + public function joinMembershipFromLineItem() { $this->_from .= " INNER JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']} ON ( {$this->_aliases['civicrm_line_item']}.entity_id = {$this->_aliases['civicrm_contribution']}.id AND {$this->_aliases['civicrm_line_item']}.entity_table = 'civicrm_contribution') @@ -1066,7 +1066,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { /* * Define join from Participant to Contribution table */ - function joinContributionFromParticipant() { + public function joinContributionFromParticipant() { $this->_from .= " LEFT JOIN civicrm_participant_payment pp ON {$this->_aliases['civicrm_participant']}.id = pp.participant_id LEFT JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']} @@ -1077,7 +1077,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { /* * Define join from Membership to Contribution table */ - function joinContributionFromMembership() { + public function joinContributionFromMembership() { $this->_from .= " LEFT JOIN civicrm_membership_payment pp ON {$this->_aliases['civicrm_membership']}.id = pp.membership_id LEFT JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']} @@ -1085,14 +1085,14 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { "; } - function joinParticipantFromContribution() { + public function joinParticipantFromContribution() { $this->_from .= " LEFT JOIN civicrm_participant_payment pp ON {$this->_aliases['civicrm_contribution']}.id = pp.contribution_id LEFT JOIN civicrm_participant {$this->_aliases['civicrm_participant']} ON pp.participant_id = {$this->_aliases['civicrm_participant']}.id"; } - function joinMembershipFromContribution() { + public function joinMembershipFromContribution() { $this->_from .= " LEFT JOIN civicrm_membership_payment pp ON {$this->_aliases['civicrm_contribution']}.id = pp.contribution_id @@ -1100,14 +1100,14 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { ON pp.membership_id = {$this->_aliases['civicrm_membership']}.id"; } - function joinMembershipTypeFromMembership() { + public function joinMembershipTypeFromMembership() { $this->_from .= " LEFT JOIN civicrm_membership_type {$this->_aliases['civicrm_membership_type']} ON {$this->_aliases['civicrm_membership']}.membership_type_id = {$this->_aliases['civicrm_membership_type']}.id "; } - function joinContributionFromLineItem() { + public function joinContributionFromLineItem() { // this can be stored as a temp table & indexed for more speed. Not done at this state. // another option is to cache it but I haven't tried to put that code in yet (have used it before for one hour caching @@ -1143,7 +1143,7 @@ LEFT JOIN civicrm_membership_payment pp "; } - function joinLineItemFromContribution() { + public function joinLineItemFromContribution() { // this can be stored as a temp table & indexed for more speed. Not done at this stage. // another option is to cache it but I haven't tried to put that code in yet (have used it before for one hour caching @@ -1177,7 +1177,7 @@ WHERE line_item_civireport.id IS NOT NULL "; } - function joinLineItemFromMembership() { + public function joinLineItemFromMembership() { // this can be stored as a temp table & indexed for more speed. Not done at this stage. // another option is to cache it but I haven't tried to put that code in yet (have used it before for one hour caching @@ -1203,22 +1203,22 @@ WHERE line_item_civireport.id IS NOT NULL "; } - function joinContactFromParticipant() { + public function joinContactFromParticipant() { $this->_from .= " LEFT JOIN civicrm_contact {$this->_aliases['civicrm_contact']} ON {$this->_aliases['civicrm_participant']}.contact_id = {$this->_aliases['civicrm_contact']}.id"; } - function joinContactFromMembership() { + public function joinContactFromMembership() { $this->_from .= " LEFT JOIN civicrm_contact {$this->_aliases['civicrm_contact']} ON {$this->_aliases['civicrm_membership']}.contact_id = {$this->_aliases['civicrm_contact']}.id"; } - function joinContactFromContribution() { + public function joinContactFromContribution() { $this->_from .= " LEFT JOIN civicrm_contact {$this->_aliases['civicrm_contact']} ON {$this->_aliases['civicrm_contribution']}.contact_id = {$this->_aliases['civicrm_contact']}.id"; } - function joinEventFromParticipant() { + public function joinEventFromParticipant() { $this->_from .= " LEFT JOIN civicrm_event {$this->_aliases['civicrm_event']} ON ({$this->_aliases['civicrm_event']}.id = {$this->_aliases['civicrm_participant']}.event_id ) AND ({$this->_aliases['civicrm_event']}.is_template IS NULL OR @@ -1234,7 +1234,7 @@ WHERE line_item_civireport.id IS NOT NULL * * @return string */ - function alterNickName($value, &$row) { + public function alterNickName($value, &$row) { if (empty($row['civicrm_contact_id'])) { return; } @@ -1253,7 +1253,7 @@ WHERE line_item_civireport.id IS NOT NULL * * @return array|string */ - function alterContributionType($value, &$row) { + public function alterContributionType($value, &$row) { return is_string(CRM_Contribute_PseudoConstant::financialType($value, FALSE)) ? CRM_Contribute_PseudoConstant::financialType($value, FALSE) : ''; } @@ -1266,7 +1266,7 @@ WHERE line_item_civireport.id IS NOT NULL * * @return array */ - function alterContributionStatus($value, &$row) { + public function alterContributionStatus($value, &$row) { return CRM_Contribute_PseudoConstant::contributionStatus($value); } @@ -1279,7 +1279,7 @@ WHERE line_item_civireport.id IS NOT NULL * * @return array */ - function alterEventType($value, &$row) { + public function alterEventType($value, &$row) { return CRM_Event_PseudoConstant::eventType($value); } @@ -1289,7 +1289,7 @@ WHERE line_item_civireport.id IS NOT NULL * * @return array|string */ - function alterEventID($value, &$row) { + public function alterEventID($value, &$row) { return is_string(CRM_Event_PseudoConstant::event($value, FALSE)) ? CRM_Event_PseudoConstant::event($value, FALSE) : ''; } @@ -1299,7 +1299,7 @@ WHERE line_item_civireport.id IS NOT NULL * * @return array|string */ - function alterMembershipTypeID($value, &$row) { + public function alterMembershipTypeID($value, &$row) { return is_string(CRM_Member_PseudoConstant::membershipType($value, FALSE)) ? CRM_Member_PseudoConstant::membershipType($value, FALSE) : ''; } @@ -1309,7 +1309,7 @@ WHERE line_item_civireport.id IS NOT NULL * * @return array|string */ - function alterMembershipStatusID($value, &$row) { + public function alterMembershipStatusID($value, &$row) { return is_string(CRM_Member_PseudoConstant::membershipStatus($value, FALSE)) ? CRM_Member_PseudoConstant::membershipStatus($value, FALSE) : ''; } @@ -1321,7 +1321,7 @@ WHERE line_item_civireport.id IS NOT NULL * * @return array */ - function alterCountryID($value, &$row, $selectedfield, $criteriaFieldName) { + public function alterCountryID($value, &$row, $selectedfield, $criteriaFieldName) { $url = CRM_Utils_System::url(CRM_Utils_System::currentPath(), "reset=1&force=1&{$criteriaFieldName}_op=in&{$criteriaFieldName}_value={$value}", $this->_absoluteUrl); $row[$selectedfield . '_link'] = $url; $row[$selectedfield . @@ -1340,7 +1340,7 @@ WHERE line_item_civireport.id IS NOT NULL * * @return array */ - function alterCountyID($value, &$row, $selectedfield, $criteriaFieldName) { + public function alterCountyID($value, &$row, $selectedfield, $criteriaFieldName) { $url = CRM_Utils_System::url(CRM_Utils_System::currentPath(), "reset=1&force=1&{$criteriaFieldName}_op=in&{$criteriaFieldName}_value={$value}", $this->_absoluteUrl); $row[$selectedfield . '_link'] = $url; $row[$selectedfield . @@ -1359,7 +1359,7 @@ WHERE line_item_civireport.id IS NOT NULL * * @return array */ - function alterStateProvinceID($value, &$row, $selectedfield, $criteriaFieldName) { + public function alterStateProvinceID($value, &$row, $selectedfield, $criteriaFieldName) { $url = CRM_Utils_System::url(CRM_Utils_System::currentPath(), "reset=1&force=1&{$criteriaFieldName}_op=in&{$criteriaFieldName}_value={$value}", $this->_absoluteUrl); $row[$selectedfield . '_link'] = $url; $row[$selectedfield . @@ -1378,7 +1378,7 @@ WHERE line_item_civireport.id IS NOT NULL * * @return mixed */ - function alterContactID($value, &$row, $fieldname) { + public function alterContactID($value, &$row, $fieldname) { $row[$fieldname . '_link'] = CRM_Utils_System::url("civicrm/contact/view", 'reset=1&cid=' . $value, $this->_absoluteUrl); return $value; @@ -1389,7 +1389,7 @@ WHERE line_item_civireport.id IS NOT NULL * * @return array */ - function alterParticipantStatus($value) { + public function alterParticipantStatus($value) { if (empty($value)) { return; } @@ -1401,7 +1401,7 @@ WHERE line_item_civireport.id IS NOT NULL * * @return string */ - function alterParticipantRole($value) { + public function alterParticipantRole($value) { if (empty($value)) { return; } @@ -1418,7 +1418,7 @@ WHERE line_item_civireport.id IS NOT NULL * * @return mixed */ - function alterPaymentType($value) { + public function alterPaymentType($value) { $paymentInstruments = CRM_Contribute_PseudoConstant::paymentInstrument(); return $paymentInstruments[$value]; } diff --git a/CRM/Report/Form/Grant/Detail.php b/CRM/Report/Form/Grant/Detail.php index a189e05166..29229a1ce9 100644 --- a/CRM/Report/Form/Grant/Detail.php +++ b/CRM/Report/Form/Grant/Detail.php @@ -47,7 +47,7 @@ class CRM_Report_Form_Grant_Detail extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->_columns = array( 'civicrm_contact' => array( 'dao' => 'CRM_Contact_DAO_Contact', @@ -212,7 +212,7 @@ class CRM_Report_Form_Grant_Detail extends CRM_Report_Form { parent::__construct(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); @@ -238,7 +238,7 @@ class CRM_Report_Form_Grant_Detail extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } - function from() { + public function from() { $this->_from = " FROM civicrm_grant {$this->_aliases['civicrm_grant']} LEFT JOIN civicrm_contact {$this->_aliases['civicrm_contact']} @@ -252,7 +252,7 @@ class CRM_Report_Form_Grant_Detail extends CRM_Report_Form { } } - function where() { + public function where() { $clauses = array(); $this->_where = ''; foreach ($this->_columns as $tableName => $table) { @@ -289,7 +289,7 @@ class CRM_Report_Form_Grant_Detail extends CRM_Report_Form { } } - function groupBy() { + public function groupBy() { $this->_groupBy = ""; if (!empty($this->_params['group_bys']) && is_array($this->_params['group_bys']) && @@ -317,7 +317,7 @@ class CRM_Report_Form_Grant_Detail extends CRM_Report_Form { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; foreach ($rows as $rowNum => $row) { diff --git a/CRM/Report/Form/Grant/Statistics.php b/CRM/Report/Form/Grant/Statistics.php index 3e6982b819..91b7636614 100644 --- a/CRM/Report/Form/Grant/Statistics.php +++ b/CRM/Report/Form/Grant/Statistics.php @@ -47,7 +47,7 @@ class CRM_Report_Form_Grant_Statistics extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->_columns = array( 'civicrm_grant' => array( 'dao' => 'CRM_Grant_DAO_Grant', @@ -208,7 +208,7 @@ class CRM_Report_Form_Grant_Statistics extends CRM_Report_Form { parent::__construct(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); @@ -238,7 +238,7 @@ class CRM_Report_Form_Grant_Statistics extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } - function from() { + public function from() { $this->_from = " FROM civicrm_grant {$this->_aliases['civicrm_grant']} LEFT JOIN civicrm_contact {$this->_aliases['civicrm_contact']} @@ -258,7 +258,7 @@ class CRM_Report_Form_Grant_Statistics extends CRM_Report_Form { } } - function where() { + public function where() { $whereClause = " WHERE {$this->_aliases['civicrm_grant']}.amount_total IS NOT NULL AND {$this->_aliases['civicrm_grant']}.amount_total > 0"; @@ -307,7 +307,7 @@ WHERE {$this->_aliases['civicrm_grant']}.amount_total IS NOT NULL } } - function groupBy() { + public function groupBy() { $this->_groupBy = ''; if (!empty($this->_params['fields']) && @@ -329,7 +329,7 @@ WHERE {$this->_aliases['civicrm_grant']}.amount_total IS NOT NULL } } - function postProcess() { + public function postProcess() { // get ready with post process params $this->beginPostProcess(); @@ -353,7 +353,7 @@ WHERE {$this->_aliases['civicrm_grant']}.amount_total IS NOT NULL /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { $totalStatistics = $grantStatistics = array(); $totalStatistics = parent::statistics($rows); $awardedGrantsAmount = $grantsReceived = $totalAmount = $awardedGrants = $grantReportsReceived = 0; diff --git a/CRM/Report/Form/Instance.php b/CRM/Report/Form/Instance.php index 0934db770e..29f831a45f 100644 --- a/CRM/Report/Form/Instance.php +++ b/CRM/Report/Form/Instance.php @@ -37,7 +37,7 @@ class CRM_Report_Form_Instance { /** * @param CRM_Core_Form $form */ - static function buildForm(&$form) { + public static function buildForm(&$form) { // we should not build form elements in dashlet mode if ($form->_section) { return; @@ -182,7 +182,7 @@ class CRM_Report_Form_Instance { * * @return array|bool */ - static function formRule($fields, $errors, $self) { + public static function formRule($fields, $errors, $self) { // Validate both the "next" and "save" buttons for creating/updating a report $nextButton = $self->controller->getButtonName(); $saveButton = str_replace('_next', '_save', $nextButton); @@ -203,7 +203,7 @@ class CRM_Report_Form_Instance { * @param CRM_Core_Form $form * @param $defaults */ - static function setDefaultValues(&$form, &$defaults) { + public static function setDefaultValues(&$form, &$defaults) { // we should not build form elements in dashlet mode if ($form->_section) { return; @@ -269,7 +269,7 @@ class CRM_Report_Form_Instance { * @param CRM_Core_Form $form * @param bool $redirect */ - static function postProcess(&$form, $redirect = TRUE) { + public static function postProcess(&$form, $redirect = TRUE) { $params = $form->getVar('_params'); $instanceID = $form->getVar('_id'); diff --git a/CRM/Report/Form/Mailing/Bounce.php b/CRM/Report/Form/Mailing/Bounce.php index 456b5c425d..7cb5849a4e 100644 --- a/CRM/Report/Form/Mailing/Bounce.php +++ b/CRM/Report/Form/Mailing/Bounce.php @@ -63,7 +63,7 @@ class CRM_Report_Form_Mailing_Bounce extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->_columns = array(); $this->_columns['civicrm_contact'] = array( @@ -200,12 +200,12 @@ class CRM_Report_Form_Mailing_Bounce extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { $this->assign('chartSupported', TRUE); parent::preProcess(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); @@ -247,12 +247,12 @@ class CRM_Report_Form_Mailing_Bounce extends CRM_Report_Form { * * @return array */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = $grouping = array(); return $errors; } - function from() { + public function from() { $this->_from = " FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom}"; // LEFT JOIN civicrm_address {$this->_aliases['civicrm_address']} @@ -282,12 +282,12 @@ class CRM_Report_Form_Mailing_Bounce extends CRM_Report_Form { } } - function where() { + public function where() { parent::where(); $this->_where .= " AND {$this->_aliases['civicrm_mailing']}.sms_provider_id IS NULL"; } - function groupBy() { + public function groupBy() { if (!empty($this->_params['charts'])) { $this->_groupBy = " GROUP BY {$this->_aliases['civicrm_mailing']}.id"; } @@ -296,7 +296,7 @@ class CRM_Report_Form_Mailing_Bounce extends CRM_Report_Form { } } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); // get the acl clauses built before we assemble the query @@ -315,7 +315,7 @@ class CRM_Report_Form_Mailing_Bounce extends CRM_Report_Form { /** * @param $rows */ - function buildChart(&$rows) { + public function buildChart(&$rows) { if (empty($rows)) { return; } @@ -339,7 +339,7 @@ class CRM_Report_Form_Mailing_Bounce extends CRM_Report_Form { /** * @return array */ - function bounce_type() { + public function bounce_type() { $data = array('' => '--Please Select--'); @@ -357,7 +357,7 @@ class CRM_Report_Form_Mailing_Bounce extends CRM_Report_Form { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; foreach ($rows as $rowNum => $row) { diff --git a/CRM/Report/Form/Mailing/Clicks.php b/CRM/Report/Form/Mailing/Clicks.php index e013a301e4..dd70d8130e 100644 --- a/CRM/Report/Form/Mailing/Clicks.php +++ b/CRM/Report/Form/Mailing/Clicks.php @@ -60,7 +60,7 @@ class CRM_Report_Form_Mailing_Clicks extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->_columns = array(); $this->_columns['civicrm_contact'] = array( @@ -167,12 +167,12 @@ class CRM_Report_Form_Mailing_Clicks extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { $this->assign('chartSupported', TRUE); parent::preProcess(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); foreach ($this->_columns as $tableName => $table) { @@ -212,12 +212,12 @@ class CRM_Report_Form_Mailing_Clicks extends CRM_Report_Form { * * @return array */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = $grouping = array(); return $errors; } - function from() { + public function from() { $this->_from = " FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom}"; @@ -244,12 +244,12 @@ class CRM_Report_Form_Mailing_Clicks extends CRM_Report_Form { } } - function where() { + public function where() { parent::where(); $this->_where .= " AND {$this->_aliases['civicrm_mailing']}.sms_provider_id IS NULL"; } - function groupBy() { + public function groupBy() { $this->_groupBy = ''; if (!empty($this->_params['charts'])) { @@ -260,7 +260,7 @@ class CRM_Report_Form_Mailing_Clicks extends CRM_Report_Form { } } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); @@ -280,7 +280,7 @@ class CRM_Report_Form_Mailing_Clicks extends CRM_Report_Form { /** * @param $rows */ - function buildChart(&$rows) { + public function buildChart(&$rows) { if (empty($rows)) { return; } @@ -304,7 +304,7 @@ class CRM_Report_Form_Mailing_Clicks extends CRM_Report_Form { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; foreach ($rows as $rowNum => $row) { diff --git a/CRM/Report/Form/Mailing/Detail.php b/CRM/Report/Form/Mailing/Detail.php index 464eff91eb..c6409cc951 100644 --- a/CRM/Report/Form/Mailing/Detail.php +++ b/CRM/Report/Form/Mailing/Detail.php @@ -43,7 +43,7 @@ class CRM_Report_Form_Mailing_Detail extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->_columns = array(); $this->_columns['civicrm_contact'] = array( @@ -252,7 +252,7 @@ class CRM_Report_Form_Mailing_Detail extends CRM_Report_Form { parent::__construct(); } - function select() { + public function select() { $select = $columns = array(); foreach ($this->_columns as $tableName => $table) { if (array_key_exists('fields', $table)) { @@ -302,7 +302,7 @@ class CRM_Report_Form_Mailing_Detail extends CRM_Report_Form { ksort($this->_columnHeaders); } - function from() { + public function from() { $this->_from = " FROM civicrm_contact {$this->_aliases['civicrm_contact']}"; @@ -423,7 +423,7 @@ class CRM_Report_Form_Mailing_Detail extends CRM_Report_Form { } } - function where() { + public function where() { parent::where(); $this->_where .= " AND {$this->_aliases['civicrm_mailing']}.sms_provider_id IS NULL"; } @@ -431,7 +431,7 @@ class CRM_Report_Form_Mailing_Detail extends CRM_Report_Form { /** * @return array */ - function mailingList() { + public function mailingList() { $data = array(); $mailing = new CRM_Mailing_BAO_Mailing(); @@ -448,7 +448,7 @@ class CRM_Report_Form_Mailing_Detail extends CRM_Report_Form { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; foreach ($rows as $rowNum => $row) { diff --git a/CRM/Report/Form/Mailing/Opened.php b/CRM/Report/Form/Mailing/Opened.php index 9e92e61773..9890d35f67 100644 --- a/CRM/Report/Form/Mailing/Opened.php +++ b/CRM/Report/Form/Mailing/Opened.php @@ -60,7 +60,7 @@ class CRM_Report_Form_Mailing_Opened extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->_columns = array(); $this->_columns['civicrm_contact'] = array( @@ -157,12 +157,12 @@ class CRM_Report_Form_Mailing_Opened extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { $this->assign('chartSupported', TRUE); parent::preProcess(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); foreach ($this->_columns as $tableName => $table) { @@ -202,12 +202,12 @@ class CRM_Report_Form_Mailing_Opened extends CRM_Report_Form { * * @return array */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = $grouping = array(); return $errors; } - function from() { + public function from() { $this->_from = " FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom}"; @@ -233,12 +233,12 @@ class CRM_Report_Form_Mailing_Opened extends CRM_Report_Form { } } - function where() { + public function where() { parent::where(); $this->_where .= " AND {$this->_aliases['civicrm_mailing']}.sms_provider_id IS NULL"; } - function groupBy() { + public function groupBy() { if (!empty($this->_params['charts'])) { $this->_groupBy = " GROUP BY {$this->_aliases['civicrm_mailing']}.id"; } @@ -247,7 +247,7 @@ class CRM_Report_Form_Mailing_Opened extends CRM_Report_Form { } } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); @@ -267,7 +267,7 @@ class CRM_Report_Form_Mailing_Opened extends CRM_Report_Form { /** * @param $rows */ - function buildChart(&$rows) { + public function buildChart(&$rows) { if (empty($rows)) { return; } @@ -291,7 +291,7 @@ class CRM_Report_Form_Mailing_Opened extends CRM_Report_Form { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; foreach ($rows as $rowNum => $row) { diff --git a/CRM/Report/Form/Mailing/Summary.php b/CRM/Report/Form/Mailing/Summary.php index 80a7a4236f..64bceb5c9a 100644 --- a/CRM/Report/Form/Mailing/Summary.php +++ b/CRM/Report/Form/Mailing/Summary.php @@ -59,7 +59,7 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->_columns = array(); $this->_columns['civicrm_mailing'] = array( @@ -259,7 +259,7 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { /** * @return array */ - function mailing_select() { + public function mailing_select() { $data = array(); @@ -274,13 +274,13 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { return $data; } - function preProcess() { + public function preProcess() { $this->assign('chartSupported', TRUE); parent::preProcess(); } // manipulate the select function to query count functions - function select() { + public function select() { $count_tables = array( 'civicrm_mailing_event_queue', @@ -331,7 +331,7 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { //print_r($this->_select); } - function from() { + public function from() { $this->_from = " FROM civicrm_mailing {$this->_aliases['civicrm_mailing']} @@ -362,7 +362,7 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { //print_r($this->_from); } - function where() { + public function where() { $clauses = array(); //to avoid the sms listings $clauses[] = "{$this->_aliases['civicrm_mailing']}.sms_provider_id IS NULL"; @@ -415,15 +415,15 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { // } } - function groupBy() { + public function groupBy() { $this->_groupBy = "GROUP BY {$this->_aliases['civicrm_mailing']}.id"; } - function orderBy() { + public function orderBy() { $this->_orderBy = " ORDER BY {$this->_aliases['civicrm_mailing_job']}.end_date DESC "; } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); @@ -445,7 +445,7 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { /** * @return array */ - static function getChartCriteria() { + public static function getChartCriteria() { return array('count' => array('civicrm_mailing_event_delivered_delivered_count' => ts('Delivered'), 'civicrm_mailing_event_bounce_bounce_count' => ts('Bounce'), 'civicrm_mailing_event_opened_open_count' => ts('Opened'), @@ -468,7 +468,7 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { * * @return array */ - function formRule($fields, $files, $self) { + public function formRule($fields, $files, $self) { $errors = array(); if (empty($fields['charts'])) { @@ -494,7 +494,7 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { /** * @param $rows */ - function buildChart(&$rows) { + public function buildChart(&$rows) { if (empty($rows)) { return; } @@ -557,7 +557,7 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; foreach ($rows as $rowNum => $row) { diff --git a/CRM/Report/Form/Member/ContributionDetail.php b/CRM/Report/Form/Member/ContributionDetail.php index 1ec7bcca94..da94529e4c 100644 --- a/CRM/Report/Form/Member/ContributionDetail.php +++ b/CRM/Report/Form/Member/ContributionDetail.php @@ -52,7 +52,7 @@ class CRM_Report_Form_Member_ContributionDetail extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $config = CRM_Core_Config::singleton(); $campaignEnabled = in_array('CiviCampaign', $config->enableComponents); if ($campaignEnabled) { @@ -383,11 +383,11 @@ class CRM_Report_Form_Member_ContributionDetail extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); @@ -451,7 +451,7 @@ class CRM_Report_Form_Member_ContributionDetail extends CRM_Report_Form { $this->_select = 'SELECT ' . implode(', ', $select) . ' '; } - function from() { + public function from() { $this->_from = " FROM civireport_membership_contribution_detail INNER JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']} @@ -535,7 +535,7 @@ class CRM_Report_Form_Member_ContributionDetail extends CRM_Report_Form { /** * @param bool $applyLimit */ - function tempTable($applyLimit = TRUE) { + public function tempTable($applyLimit = TRUE) { // create temp table with contact ids,contribtuion id,membership id $dropTempTable = 'DROP TABLE IF EXISTS civireport_membership_contribution_detail'; CRM_Core_DAO::executeQuery($dropTempTable); @@ -564,7 +564,7 @@ class CRM_Report_Form_Member_ContributionDetail extends CRM_Report_Form { * * @return string */ - function buildQuery($applyLimit = TRUE) { + public function buildQuery($applyLimit = TRUE) { $this->select(); //create temp table to be used as base table $this->tempTable(); @@ -588,11 +588,11 @@ class CRM_Report_Form_Member_ContributionDetail extends CRM_Report_Form { return $sql; } - function groupBy() { + public function groupBy() { $this->_groupBy = " GROUP BY {$this->_aliases['civicrm_contact']}.id, {$this->_aliases['civicrm_contribution']}.id "; } - function orderBy() { + public function orderBy() { $this->_orderBy = " ORDER BY {$this->_aliases['civicrm_contact']}.sort_name, {$this->_aliases['civicrm_contact']}.id "; if (!empty($this->_params['fields']['first_donation_date']) || !empty($this->_params['fields']['first_donation_amount']) @@ -606,7 +606,7 @@ class CRM_Report_Form_Member_ContributionDetail extends CRM_Report_Form { * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { $statistics = parent::statistics($rows); $select = " SELECT COUNT({$this->_aliases['civicrm_contribution']}.total_amount ) as count, SUM( {$this->_aliases['civicrm_contribution']}.total_amount ) as amount, ROUND(AVG({$this->_aliases['civicrm_contribution']}.total_amount), 2) as avg, {$this->_aliases['civicrm_contribution']}.currency as currency "; @@ -637,7 +637,7 @@ class CRM_Report_Form_Member_ContributionDetail extends CRM_Report_Form { return $statistics; } - function postProcess() { + public function postProcess() { // get the acl clauses built before we assemble the query $this->buildACLClause($this->_aliases['civicrm_contact']); parent::postProcess(); @@ -646,7 +646,7 @@ class CRM_Report_Form_Member_ContributionDetail extends CRM_Report_Form { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $checkList = array(); diff --git a/CRM/Report/Form/Member/Detail.php b/CRM/Report/Form/Member/Detail.php index c8ea28e1b5..eb76b01604 100644 --- a/CRM/Report/Form/Member/Detail.php +++ b/CRM/Report/Form/Member/Detail.php @@ -53,7 +53,7 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { // Check if CiviCampaign is a) enabled and b) has active campaigns $config = CRM_Core_Config::singleton(); @@ -280,12 +280,12 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { $this->assign('reportTitle', ts('Membership Detail Report')); parent::preProcess(); } - function select() { + public function select() { $select = $this->_columnHeaders = array(); foreach ($this->_columns as $tableName => $table) { @@ -317,7 +317,7 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } - function from() { + public function from() { $this->_from = " FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom} INNER JOIN civicrm_membership {$this->_aliases['civicrm_membership']} @@ -362,11 +362,11 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form { } } - function groupBy() { + public function groupBy() { $this->_groupBy = " GROUP BY {$this->_aliases['civicrm_contact']}.id, {$this->_aliases['civicrm_membership']}.membership_type_id"; } - function orderBy() { + public function orderBy() { $this->_orderBy = " ORDER BY {$this->_aliases['civicrm_contact']}.sort_name, {$this->_aliases['civicrm_contact']}.id, {$this->_aliases['civicrm_membership']}.membership_type_id"; if ($this->_contribField) { @@ -374,7 +374,7 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form { } } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); @@ -393,7 +393,7 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; $checkList = array(); diff --git a/CRM/Report/Form/Member/Lapse.php b/CRM/Report/Form/Member/Lapse.php index 7400fe6f16..6374dc14bc 100644 --- a/CRM/Report/Form/Member/Lapse.php +++ b/CRM/Report/Form/Member/Lapse.php @@ -50,7 +50,7 @@ class CRM_Report_Form_Member_Lapse extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { // Check if CiviCampaign is a) enabled and b) has active campaigns $config = CRM_Core_Config::singleton(); @@ -195,11 +195,11 @@ class CRM_Report_Form_Member_Lapse extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); foreach ($this->_columns as $tableName => $table) { @@ -235,7 +235,7 @@ class CRM_Report_Form_Member_Lapse extends CRM_Report_Form { * * @return array */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = $grouping = array(); //check for searching combination of dispaly columns and //grouping criteria @@ -243,7 +243,7 @@ class CRM_Report_Form_Member_Lapse extends CRM_Report_Form { return $errors; } - function from() { + public function from() { $this->_from = NULL; $this->_from = " @@ -281,7 +281,7 @@ class CRM_Report_Form_Member_Lapse extends CRM_Report_Form { } } - function where() { + public function where() { $clauses = array(); foreach ($this->_columns as $tableName => $table) { if (array_key_exists('filters', $table)) { @@ -334,11 +334,11 @@ class CRM_Report_Form_Member_Lapse extends CRM_Report_Form { } } - function orderBy() { + public function orderBy() { $this->_orderBy = " ORDER BY {$this->_aliases['civicrm_contact']}.sort_name, {$this->_aliases['civicrm_contact']}.id, {$this->_aliases['civicrm_membership']}.membership_type_id"; } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); // get the acl clauses built before we assemble the query @@ -367,7 +367,7 @@ class CRM_Report_Form_Member_Lapse extends CRM_Report_Form { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; $checkList = array(); diff --git a/CRM/Report/Form/Member/Summary.php b/CRM/Report/Form/Member/Summary.php index 3253f4e240..0a01e2fead 100644 --- a/CRM/Report/Form/Member/Summary.php +++ b/CRM/Report/Form/Member/Summary.php @@ -53,7 +53,7 @@ class CRM_Report_Form_Member_Summary extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { // UI for selecting columns to appear in the report list // Array containing the columns, group_bys and filters build and provided to Form @@ -197,7 +197,7 @@ class CRM_Report_Form_Member_Summary extends CRM_Report_Form { parent::__construct(); } - function select() { + public function select() { $select = array(); $groupBys = FALSE; $this->_columnHeaders = array(); @@ -328,7 +328,7 @@ class CRM_Report_Form_Member_Summary extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } - function from() { + public function from() { $this->_from = " FROM civicrm_membership {$this->_aliases['civicrm_membership']} @@ -344,13 +344,13 @@ class CRM_Report_Form_Member_Summary extends CRM_Report_Form { // end of from - function where() { + public function where() { $this->_whereClauses[] = "{$this->_aliases['civicrm_membership']}.is_test = 0 AND {$this->_aliases['civicrm_contact']}.is_deleted = 0"; parent::where(); } - function groupBy() { + public function groupBy() { $this->_groupBy = ""; if (is_array($this->_params['group_bys']) && !empty($this->_params['group_bys']) @@ -397,7 +397,7 @@ class CRM_Report_Form_Member_Summary extends CRM_Report_Form { * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { $statistics = parent::statistics($rows); $select = " SELECT COUNT({$this->_aliases['civicrm_contribution']}.total_amount ) as count, @@ -450,14 +450,14 @@ GROUP BY {$this->_aliases['civicrm_contribution']}.currency return $statistics; } - function postProcess() { + public function postProcess() { parent::postProcess(); } /** * @param $rows */ - function buildChart(&$rows) { + public function buildChart(&$rows) { $graphRows = array(); $count = 0; $membershipTypeValues = CRM_Member_PseudoConstant::membershipType(); @@ -535,7 +535,7 @@ GROUP BY {$this->_aliases['civicrm_contribution']}.currency /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; foreach ($rows as $rowNum => $row) { diff --git a/CRM/Report/Form/Membership/Summary.php b/CRM/Report/Form/Membership/Summary.php index 8b7dbb34e6..12904371d1 100644 --- a/CRM/Report/Form/Membership/Summary.php +++ b/CRM/Report/Form/Membership/Summary.php @@ -49,7 +49,7 @@ class CRM_Report_Form_Membership_Summary extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { // UI for selecting columns to appear in the report list // array conatining the columns, group_bys and filters build and provided to Form $this->_columns = array( @@ -142,7 +142,7 @@ class CRM_Report_Form_Membership_Summary extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { $this->assign('reportTitle', ts('Membership Summary Report')); parent::preProcess(); } @@ -150,11 +150,11 @@ class CRM_Report_Form_Membership_Summary extends CRM_Report_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { return parent::setDefaultValues(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); foreach ($this->_columns as $tableName => $table) { @@ -188,7 +188,7 @@ class CRM_Report_Form_Membership_Summary extends CRM_Report_Form { * * @return array */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = $grouping = array(); //check for searching combination of dispaly columns and //grouping criteria @@ -196,7 +196,7 @@ class CRM_Report_Form_Membership_Summary extends CRM_Report_Form { return $errors; } - function from() { + public function from() { $this->_from = NULL; $this->_from = " @@ -219,7 +219,7 @@ LEFT JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']} } } - function where() { + public function where() { $clauses = array(); foreach ($this->_columns as $tableName => $table) { if (array_key_exists('filters', $table)) { @@ -266,7 +266,7 @@ LEFT JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']} * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { $statistics = array(); $statistics[] = array( 'title' => ts('Row(s) Listed'), @@ -275,7 +275,7 @@ LEFT JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']} return $statistics; } - function groupBy() { + public function groupBy() { $this->_groupBy = ""; if (is_array($this->_params['group_bys']) && !empty($this->_params['group_bys']) @@ -303,7 +303,7 @@ LEFT JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']} } } - function postProcess() { + public function postProcess() { $this->_params = $this->controller->exportValues($this->_name); if (empty($this->_params) && $this->_force @@ -368,7 +368,7 @@ LEFT JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']} /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; $checkList = array(); diff --git a/CRM/Report/Form/Pledge/Detail.php b/CRM/Report/Form/Pledge/Detail.php index dd40c49e00..64319e26ce 100644 --- a/CRM/Report/Form/Pledge/Detail.php +++ b/CRM/Report/Form/Pledge/Detail.php @@ -59,7 +59,7 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->_pledgeStatuses = CRM_Contribute_PseudoConstant::contributionStatus(); // Check if CiviCampaign is a) enabled and b) has active campaigns $config = CRM_Core_Config::singleton(); @@ -200,11 +200,11 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { parent::select(); } /* @@ -218,7 +218,7 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form { * * @return bool|string */ - function selectClause(&$tableName, $tableKey, &$fieldName, &$field) { + public function selectClause(&$tableName, $tableKey, &$fieldName, &$field) { if ($fieldName == 'total_paid') { $this->_totalPaid = TRUE; // add pledge_payment join $this->_columnHeaders["{$tableName}_{$fieldName}"] = array( @@ -241,14 +241,14 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form { return FALSE; } - function groupBy() { + public function groupBy() { parent::groupBy(); if (empty($this->_groupBy) && $this->_totalPaid) { $this->_groupBy = " GROUP BY {$this->_aliases['civicrm_pledge']}.id, {$this->_aliases['civicrm_pledge']}.currency"; } } - function from() { + public function from() { $this->_from = " FROM civicrm_pledge {$this->_aliases['civicrm_pledge']} LEFT JOIN civicrm_contact {$this->_aliases['civicrm_contact']} @@ -281,7 +281,7 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form { * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { $statistics = parent::statistics($rows); //regenerate the from field without extra left join on pledge payments $this->_totalPaid = FALSE; @@ -335,11 +335,11 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form { return $statistics; } - function orderBy() { + public function orderBy() { $this->_orderBy = "ORDER BY {$this->_aliases['civicrm_contact']}.sort_name, {$this->_aliases['civicrm_contact']}.id"; } - function where() { + public function where() { $clauses = array(); foreach ($this->_columns as $tableName => $table) { if (array_key_exists('filters', $table)) { @@ -391,7 +391,7 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form { } } - function postProcess() { + public function postProcess() { $this->beginPostProcess(); @@ -504,7 +504,7 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; $checkList = array(); diff --git a/CRM/Report/Form/Pledge/Pbnp.php b/CRM/Report/Form/Pledge/Pbnp.php index dd0b8ee9fd..26d40d59b5 100644 --- a/CRM/Report/Form/Pledge/Pbnp.php +++ b/CRM/Report/Form/Pledge/Pbnp.php @@ -50,7 +50,7 @@ class CRM_Report_Form_Pledge_Pbnp extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { // Check if CiviCampaign is a) enabled and b) has active campaigns $config = CRM_Core_Config::singleton(); @@ -193,12 +193,12 @@ class CRM_Report_Form_Pledge_Pbnp extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { $this->assign('reportTitle', ts('Pledged but not Paid Report')); parent::preProcess(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); foreach ($this->_columns as $tableName => $table) { @@ -225,7 +225,7 @@ class CRM_Report_Form_Pledge_Pbnp extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } - function from() { + public function from() { $this->_from = NULL; $allStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); @@ -271,18 +271,18 @@ class CRM_Report_Form_Pledge_Pbnp extends CRM_Report_Form { } } - function groupBy() { + public function groupBy() { $this->_groupBy = " GROUP BY {$this->_aliases['civicrm_pledge']}.contact_id, {$this->_aliases['civicrm_pledge']}.id, {$this->_aliases['civicrm_pledge']}.currency"; } - function orderBy() { + public function orderBy() { $this->_orderBy = "ORDER BY {$this->_aliases['civicrm_contact']}.sort_name, {$this->_aliases['civicrm_pledge']}.contact_id, {$this->_aliases['civicrm_pledge']}.id"; } - function postProcess() { + public function postProcess() { // get the acl clauses built before we assemble the query $this->buildACLClause($this->_aliases['civicrm_contact']); parent::PostProcess(); @@ -291,7 +291,7 @@ class CRM_Report_Form_Pledge_Pbnp extends CRM_Report_Form { /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; $checkList = array(); diff --git a/CRM/Report/Form/Pledge/Summary.php b/CRM/Report/Form/Pledge/Summary.php index 1c0f08a59e..042bce1a65 100644 --- a/CRM/Report/Form/Pledge/Summary.php +++ b/CRM/Report/Form/Pledge/Summary.php @@ -48,7 +48,7 @@ class CRM_Report_Form_Pledge_Summary extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->_columns = array( 'civicrm_contact' => array( 'dao' => 'CRM_Contact_DAO_Contact', @@ -178,15 +178,15 @@ class CRM_Report_Form_Pledge_Summary extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { parent::select(); } - function from() { + public function from() { $this->_from = " FROM civicrm_pledge {$this->_aliases['civicrm_pledge']} LEFT JOIN civicrm_contact {$this->_aliases['civicrm_contact']} @@ -221,7 +221,7 @@ class CRM_Report_Form_Pledge_Summary extends CRM_Report_Form { } } - function groupBy() { + public function groupBy() { $this->_groupBy = ""; $append = FALSE; @@ -276,7 +276,7 @@ class CRM_Report_Form_Pledge_Summary extends CRM_Report_Form { * * @return array */ - function statistics(&$rows) { + public function statistics(&$rows) { $statistics = parent::statistics($rows); if (!$this->_having) { @@ -310,7 +310,7 @@ class CRM_Report_Form_Pledge_Summary extends CRM_Report_Form { return $statistics; } - function where() { + public function where() { $clauses = array(); foreach ($this->_columns as $tableName => $table) { if (array_key_exists('filters', $table)) { @@ -362,14 +362,14 @@ class CRM_Report_Form_Pledge_Summary extends CRM_Report_Form { } } - function postProcess() { + public function postProcess() { parent::postProcess(); } /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; $checkList = array(); diff --git a/CRM/Report/Form/Register.php b/CRM/Report/Form/Register.php index 5c1728efb5..670c674b0e 100644 --- a/CRM/Report/Form/Register.php +++ b/CRM/Report/Form/Register.php @@ -66,7 +66,7 @@ class CRM_Report_Form_Register extends CRM_Core_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); if ($this->_action & CRM_Core_Action::DELETE) { return $defaults; @@ -144,7 +144,7 @@ class CRM_Report_Form_Register extends CRM_Core_Form { * * @return array */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); $dupeClass = FALSE; $reportUrl = new CRM_Core_DAO_OptionValue(); diff --git a/CRM/Report/Form/Walklist/Walklist.php b/CRM/Report/Form/Walklist/Walklist.php index 2806b9776b..a47165123c 100644 --- a/CRM/Report/Form/Walklist/Walklist.php +++ b/CRM/Report/Form/Walklist/Walklist.php @@ -57,7 +57,7 @@ class CRM_Report_Form_Walklist_Walklist extends CRM_Report_Form { /** * */ - function __construct() { + public function __construct() { $this->_columns = array( 'civicrm_contact' => array( 'dao' => 'CRM_Contact_DAO_Contact', @@ -130,11 +130,11 @@ class CRM_Report_Form_Walklist_Walklist extends CRM_Report_Form { parent::__construct(); } - function preProcess() { + public function preProcess() { parent::preProcess(); } - function select() { + public function select() { $select = array(); $this->_columnHeaders = array(); @@ -163,7 +163,7 @@ class CRM_Report_Form_Walklist_Walklist extends CRM_Report_Form { $this->_select = "SELECT " . implode(",\n", $select) . " "; } - function from() { + public function from() { $this->_from = NULL; $this->_from = " @@ -182,7 +182,7 @@ FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom } } - function where() { + public function where() { $clauses = array(); foreach ($this->_columns as $tableName => $table) { if (array_key_exists('filters', $table)) { @@ -227,7 +227,7 @@ FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom } } - function orderBy() { + public function orderBy() { $this->_orderBy = ""; foreach ($this->_columns as $tableName => $table) { if (array_key_exists('order_bys', $table)) { @@ -239,7 +239,7 @@ FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom $this->_orderBy = "ORDER BY " . implode(', ', $this->_orderBy) . " "; } - function postProcess() { + public function postProcess() { // get the acl clauses built before we assemble the query $this->buildACLClause($this->_aliases['civicrm_contact']); parent::postProcess(); @@ -248,7 +248,7 @@ FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom /** * @param $rows */ - function alterDisplay(&$rows) { + public function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; foreach ($rows as $rowNum => $row) { diff --git a/CRM/Report/Interface.php b/CRM/Report/Interface.php index 78a6228fe2..0383e11713 100644 --- a/CRM/Report/Interface.php +++ b/CRM/Report/Interface.php @@ -38,12 +38,12 @@ interface CRM_Report_Interface { /** * The constructor gets the submitted form values */ - function __construct(&$formValues); + public function __construct(&$formValues); /** * Builds the quickform for this search */ - function buildForm(&$form); + public function buildForm(&$form); /** * Builds the search query for various cases. We break it down into finer cases @@ -56,20 +56,20 @@ interface CRM_Report_Interface { * Count of records that match the current input parameters * Used by pager */ - function count(); + public function count(); /** * Summary information for the query that can be displayed in the template * This is useful to pass total / sub total information if needed */ - function summary(); + public function summary(); /** * List of contact ids that match the current input parameters * Used by different tasks. Will be also used to optimize the * 'all' query below to avoid excessive LEFT JOIN blowup */ - function contactIDs($offset = 0, $rowcount = 0, $sort = NULL); + public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL); /** * Retrieve all the values that match the current input parameters @@ -92,21 +92,21 @@ interface CRM_Report_Interface { /** * The from clause for the query */ - function from(); + public function from(); /** * The where clause for the query */ - function where($includeContactIDs = FALSE); + public function where($includeContactIDs = FALSE); /** * The template FileName to use to display the results */ - function templateFile(); + public function templateFile(); /** * Returns an array of column headers and field names and sort options */ - function &columns(); + public function &columns(); } diff --git a/CRM/Report/Page/Instance.php b/CRM/Report/Page/Instance.php index 2a7fd6557c..81e214edff 100644 --- a/CRM/Report/Page/Instance.php +++ b/CRM/Report/Page/Instance.php @@ -43,7 +43,7 @@ class CRM_Report_Page_Instance extends CRM_Core_Page { * * @return void */ - function run() { + public function run() { $instanceId = CRM_Report_Utils_Report::getInstanceID(); if (!$instanceId) { $instanceId = CRM_Report_Utils_Report::getInstanceIDForPath(); diff --git a/CRM/Report/Page/InstanceList.php b/CRM/Report/Page/InstanceList.php index 18c007fccc..7bab2fb834 100644 --- a/CRM/Report/Page/InstanceList.php +++ b/CRM/Report/Page/InstanceList.php @@ -180,7 +180,7 @@ class CRM_Report_Page_InstanceList extends CRM_Core_Page { * * @return void */ - function run() { + public function run() { //Filters by source report template or by component $this->ovID = CRM_Utils_Request::retrieve('ovid', 'Positive', $this); $this->compID = CRM_Utils_Request::retrieve('compid', 'Positive', $this); diff --git a/CRM/Report/Page/Options.php b/CRM/Report/Page/Options.php index 2869bed4e2..60326ba0ba 100644 --- a/CRM/Report/Page/Options.php +++ b/CRM/Report/Page/Options.php @@ -80,7 +80,7 @@ class CRM_Report_Page_Options extends CRM_Core_Page_Basic { * @access public * */ - function preProcess() { + public function preProcess() { $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE); $this->_id = CRM_Utils_Request::retrieve('id', 'String', $this, FALSE); @@ -108,7 +108,7 @@ class CRM_Report_Page_Options extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_Core_BAO_OptionValue'; } @@ -117,7 +117,7 @@ class CRM_Report_Page_Options extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::UPDATE => array( @@ -153,7 +153,7 @@ class CRM_Report_Page_Options extends CRM_Core_Page_Basic { * * @return void */ - function run() { + public function run() { $this->preProcess(); return parent::run(); } @@ -166,7 +166,7 @@ class CRM_Report_Page_Options extends CRM_Core_Page_Basic { * @access public * @static */ - function browse() { + public function browse() { $groupParams = array('name' => self::$_gName); $optionValue = CRM_Core_OptionValue::getRows($groupParams, $this->links(), 'weight'); $gName = self::$_gName; @@ -188,7 +188,7 @@ class CRM_Report_Page_Options extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_Report_Form_Register'; } @@ -197,7 +197,7 @@ class CRM_Report_Page_Options extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return self::$_GName; } @@ -208,7 +208,7 @@ class CRM_Report_Page_Options extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/report/options/' . self::$_gName; } @@ -220,7 +220,7 @@ class CRM_Report_Page_Options extends CRM_Core_Page_Basic { * @return string * @access public */ - function userContextParams($mode = NULL) { + public function userContextParams($mode = NULL) { return 'reset=1&action=browse'; } } diff --git a/CRM/Report/Page/Report.php b/CRM/Report/Page/Report.php index f20d41410a..d895fd4f27 100644 --- a/CRM/Report/Page/Report.php +++ b/CRM/Report/Page/Report.php @@ -44,7 +44,7 @@ class CRM_Report_Page_Report extends CRM_Core_Page { * * @return void */ - function run() { + public function run() { if (!CRM_Core_Permission::check('administer Reports')) { return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/report/list', 'reset=1')); } diff --git a/CRM/Report/Page/TemplateList.php b/CRM/Report/Page/TemplateList.php index e4c33fd715..dc91460063 100644 --- a/CRM/Report/Page/TemplateList.php +++ b/CRM/Report/Page/TemplateList.php @@ -111,7 +111,7 @@ LEFT JOIN civicrm_component comp * * @return void */ - function run() { + public function run() { $compID = CRM_Utils_Request::retrieve('compid', 'Positive', $this); $grouping = CRM_Utils_Request::retrieve('grp', 'String', $this); $rows = self::info($compID, $grouping); diff --git a/CRM/Report/Utils/Get.php b/CRM/Report/Utils/Get.php index f911298f9a..18917483c0 100644 --- a/CRM/Report/Utils/Get.php +++ b/CRM/Report/Utils/Get.php @@ -41,7 +41,7 @@ class CRM_Report_Utils_Get { * * @return mixed|null */ - static function getTypedValue($name, $type) { + public static function getTypedValue($name, $type) { $value = CRM_Utils_Array::value($name, $_GET); if ($value === NULL) { return NULL; @@ -57,7 +57,7 @@ class CRM_Report_Utils_Get { * @param $field * @param $defaults */ - static function dateParam($fieldName, &$field, &$defaults) { + public static function dateParam($fieldName, &$field, &$defaults) { // type = 12 (datetime) is not recognized by Utils_Type::escape() method, // and therefore the below hack $type = 4; @@ -100,7 +100,7 @@ class CRM_Report_Utils_Get { * @param $field * @param $defaults */ - static function stringParam($fieldName, &$field, &$defaults) { + public static function stringParam($fieldName, &$field, &$defaults) { $fieldOP = CRM_Utils_Array::value("{$fieldName}_op", $_GET, 'like'); switch ($fieldOP) { @@ -138,7 +138,7 @@ class CRM_Report_Utils_Get { * @param $field * @param $defaults */ - static function intParam($fieldName, &$field, &$defaults) { + public static function intParam($fieldName, &$field, &$defaults) { $fieldOP = CRM_Utils_Array::value("{$fieldName}_op", $_GET, 'eq'); switch ($fieldOP) { @@ -192,7 +192,7 @@ class CRM_Report_Utils_Get { /** * @param $defaults */ - static function processChart(&$defaults) { + public static function processChart(&$defaults) { $chartType = CRM_Utils_Array::value("charts", $_GET); if (in_array($chartType, array( 'barChart', 'pieChart'))) { @@ -204,7 +204,7 @@ class CRM_Report_Utils_Get { * @param $fieldGrp * @param $defaults */ - static function processFilter(&$fieldGrp, &$defaults) { + public static function processFilter(&$fieldGrp, &$defaults) { // process only filters for now foreach ($fieldGrp as $tableName => $fields) { foreach ($fields as $fieldName => $field) { @@ -233,7 +233,7 @@ class CRM_Report_Utils_Get { /** * @param $defaults */ - static function unsetFilters(&$defaults) { + public static function unsetFilters(&$defaults) { static $unsetFlag = TRUE; if ($unsetFlag) { foreach ($defaults as $field_name => $field_value) { @@ -254,7 +254,7 @@ class CRM_Report_Utils_Get { * @param $fieldGrp * @param $defaults */ - static function processGroupBy(&$fieldGrp, &$defaults) { + public static function processGroupBy(&$fieldGrp, &$defaults) { // process only group_bys for now $flag = FALSE; @@ -282,7 +282,7 @@ class CRM_Report_Utils_Get { * @param $reportFields * @param $defaults */ - static function processFields(&$reportFields, &$defaults) { + public static function processFields(&$reportFields, &$defaults) { //add filters from url if (is_array($reportFields)) { if ($urlFields = CRM_Utils_Array::value("fld", $_GET)) { diff --git a/CRM/Report/Utils/Report.php b/CRM/Report/Utils/Report.php index d423d9963a..3cf37431b9 100644 --- a/CRM/Report/Utils/Report.php +++ b/CRM/Report/Utils/Report.php @@ -40,7 +40,7 @@ class CRM_Report_Utils_Report { * * @return null|string */ - static function getValueFromUrl($instanceID = NULL) { + public static function getValueFromUrl($instanceID = NULL) { if ($instanceID) { $optionVal = CRM_Core_DAO::getFieldValue('CRM_Report_DAO_ReportInstance', $instanceID, @@ -67,7 +67,7 @@ class CRM_Report_Utils_Report { * * @return array|bool */ - static function getValueIDFromUrl($instanceID = NULL) { + public static function getValueIDFromUrl($instanceID = NULL) { $optionVal = self::getValueFromUrl($instanceID); if ($optionVal) { @@ -83,7 +83,7 @@ class CRM_Report_Utils_Report { * * @return mixed */ - static function getInstanceIDForValue($optionVal) { + public static function getInstanceIDForValue($optionVal) { static $valId = array(); if (!array_key_exists($optionVal, $valId)) { @@ -102,7 +102,7 @@ WHERE report_id = %1"; * * @return mixed */ - static function getInstanceIDForPath($path = NULL) { + public static function getInstanceIDForPath($path = NULL) { static $valId = array(); // if $path is null, try to get it from url @@ -128,7 +128,7 @@ WHERE TRIM(BOTH '/' FROM CONCAT(report_id, '/', name)) = %1"; * * @return bool|string */ - static function getNextUrl($urlValue, $query = 'reset=1', $absolute = FALSE, $instanceID = NULL, $drilldownReport = array()) { + public static function getNextUrl($urlValue, $query = 'reset=1', $absolute = FALSE, $instanceID = NULL, $drilldownReport = array()) { if ($instanceID) { $drilldownInstanceID = false; if (array_key_exists($urlValue, $drilldownReport)) @@ -159,7 +159,7 @@ WHERE TRIM(BOTH '/' FROM CONCAT(report_id, '/', name)) = %1"; * * @return int|null|string */ - static function getInstanceCount($optionVal) { + public static function getInstanceCount($optionVal) { if (empty($optionVal)) return 0; $sql = " @@ -180,7 +180,7 @@ WHERE inst.report_id = %1"; * * @return bool */ - static function mailReport($fileContent, $instanceID = NULL, $outputMode = 'html', $attachments = array()) { + public static function mailReport($fileContent, $instanceID = NULL, $outputMode = 'html', $attachments = array()) { if (!$instanceID) { return FALSE; } @@ -218,7 +218,7 @@ WHERE inst.report_id = %1"; * @param CRM_Core_Form $form * @param $rows */ - static function export2csv(&$form, &$rows) { + public static function export2csv(&$form, &$rows) { //Mark as a CSV file. header('Content-Type: text/csv'); @@ -233,7 +233,7 @@ WHERE inst.report_id = %1"; * Utility function for export2csv and CRM_Report_Form::endPostProcess * - make CSV file content and return as string. */ - static function makeCsv(&$form, &$rows) { + public static function makeCsv(&$form, &$rows) { $config = CRM_Core_Config::singleton(); $csv = ''; @@ -294,7 +294,7 @@ WHERE inst.report_id = %1"; /** * @return mixed */ - static function getInstanceID() { + public static function getInstanceID() { $config = CRM_Core_Config::singleton(); $arg = explode('/', $_GET[$config->userFrameworkURLVar]); @@ -311,7 +311,7 @@ WHERE inst.report_id = %1"; /** * @return string */ - static function getInstancePath() { + public static function getInstancePath() { $config = CRM_Core_Config::singleton(); $arg = explode('/', $_GET[$config->userFrameworkURLVar]); @@ -329,7 +329,7 @@ WHERE inst.report_id = %1"; * * @return bool */ - static function isInstancePermissioned($instanceId) { + public static function isInstancePermissioned($instanceId) { if (!$instanceId) { return TRUE; } @@ -363,7 +363,7 @@ WHERE inst.report_id = %1"; * @static * @access public */ - static function isInstanceGroupRoleAllowed($instanceId) { + public static function isInstanceGroupRoleAllowed($instanceId) { if (!$instanceId) { return TRUE; } @@ -393,7 +393,7 @@ WHERE inst.report_id = %1"; * * @return array */ - static function processReport($params) { + public static function processReport($params) { $instanceId = CRM_Utils_Array::value('instanceId', $params); // hack for now, CRM-8358 @@ -462,7 +462,7 @@ WHERE inst.report_id = %1"; * * @return string URL query string */ - static function getPreviewCriteriaQueryParams($defaults = array(), $params = array()) { + public static function getPreviewCriteriaQueryParams($defaults = array(), $params = array()) { static $query_string; if (!isset($query_string)) { if (!empty($params)) { @@ -536,7 +536,7 @@ WHERE inst.report_id = %1"; * * @return mixed */ - static function getInstanceList($reportUrl) { + public static function getInstanceList($reportUrl) { static $instanceDetails = array(); if (!array_key_exists($reportUrl, $instanceDetails )) { diff --git a/CRM/SMS/BAO/Provider.php b/CRM/SMS/BAO/Provider.php index 44ae736803..f64b84394d 100644 --- a/CRM/SMS/BAO/Provider.php +++ b/CRM/SMS/BAO/Provider.php @@ -43,14 +43,14 @@ class CRM_SMS_BAO_Provider extends CRM_SMS_DAO_Provider { /** * */ - function __construct() { + public function __construct() { parent::__construct(); } /** * @return null|string */ - static function activeProviderCount() { + public static function activeProviderCount() { $activeProviders = CRM_Core_DAO::singleValueQuery('SELECT MAX(id) FROM civicrm_sms_provider WHERE is_active = 1'); return $activeProviders; } @@ -70,7 +70,7 @@ class CRM_SMS_BAO_Provider extends CRM_SMS_DAO_Provider { * * @return array */ - static function getProviders($selectArr = NULL, $filter = NULL, $getActive = TRUE, $orderBy = 'id') { + public static function getProviders($selectArr = NULL, $filter = NULL, $getActive = TRUE, $orderBy = 'id') { $providers = array(); $temp = array(); @@ -99,7 +99,7 @@ class CRM_SMS_BAO_Provider extends CRM_SMS_DAO_Provider { /** * @param $values */ - static function saveRecord($values) { + public static function saveRecord($values) { $dao = new CRM_SMS_DAO_Provider(); $dao->copyValues($values); $dao->save(); @@ -109,7 +109,7 @@ class CRM_SMS_BAO_Provider extends CRM_SMS_DAO_Provider { * @param $values * @param int $providerId */ - static function updateRecord($values, $providerId) { + public static function updateRecord($values, $providerId) { $dao = new CRM_SMS_DAO_Provider(); $dao->id = $providerId; if ($dao->find(TRUE)) { @@ -124,7 +124,7 @@ class CRM_SMS_BAO_Provider extends CRM_SMS_DAO_Provider { * * @return bool */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_SMS_DAO_Provider', $id, 'is_active', $is_active); } @@ -134,7 +134,7 @@ class CRM_SMS_BAO_Provider extends CRM_SMS_DAO_Provider { * @return null * @throws Exception */ - static function del($providerID) { + public static function del($providerID) { if (!$providerID) { CRM_Core_Error::fatal(ts('Invalid value passed to delete function.')); } diff --git a/CRM/SMS/Controller/Send.php b/CRM/SMS/Controller/Send.php index a33d9bdafb..8d8dd77657 100644 --- a/CRM/SMS/Controller/Send.php +++ b/CRM/SMS/Controller/Send.php @@ -37,7 +37,7 @@ class CRM_SMS_Controller_Send extends CRM_Core_Controller { /** * Class constructor */ - function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { + public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { parent::__construct($title, $modal, NULL, FALSE, TRUE); $mailingID = CRM_Utils_Request::retrieve('mid', 'String', $this, FALSE, NULL); diff --git a/CRM/SMS/Form/Group.php b/CRM/SMS/Form/Group.php index dd5f5a6751..a8326748e3 100644 --- a/CRM/SMS/Form/Group.php +++ b/CRM/SMS/Form/Group.php @@ -62,7 +62,7 @@ class CRM_SMS_Form_Group extends CRM_Contact_Form_Task { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $mailingID = CRM_Utils_Request::retrieve('mid', 'Integer', $this, FALSE, NULL); $continue = CRM_Utils_Request::retrieve('continue', 'String', $this, FALSE, NULL); @@ -316,7 +316,7 @@ class CRM_SMS_Form_Group extends CRM_Contact_Form_Task { * @static * @access public */ - static function formRule($fields) { + public static function formRule($fields) { $errors = array(); if (isset($fields['includeGroups']) && is_array($fields['includeGroups']) && diff --git a/CRM/SMS/Form/Provider.php b/CRM/SMS/Form/Provider.php index 1cb8fc5591..4cfcb81f8e 100644 --- a/CRM/SMS/Form/Provider.php +++ b/CRM/SMS/Form/Provider.php @@ -39,7 +39,7 @@ class CRM_SMS_Form_Provider extends CRM_Core_Form { protected $_id = NULL; - function preProcess() { + public function preProcess() { $this->_id = $this->get('id'); @@ -133,7 +133,7 @@ class CRM_SMS_Form_Provider extends CRM_Core_Form { /** * @return array */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $name = CRM_Utils_Request::retrieve('key', 'String', $this, FALSE, NULL); diff --git a/CRM/SMS/Form/Schedule.php b/CRM/SMS/Form/Schedule.php index 62ce903ac8..2d62a0a96d 100644 --- a/CRM/SMS/Form/Schedule.php +++ b/CRM/SMS/Form/Schedule.php @@ -60,7 +60,7 @@ class CRM_SMS_Form_Schedule extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $count = $this->get('count'); diff --git a/CRM/SMS/Form/Upload.php b/CRM/SMS/Form/Upload.php index 74b75c99af..c453f3c87d 100644 --- a/CRM/SMS/Form/Upload.php +++ b/CRM/SMS/Form/Upload.php @@ -39,7 +39,7 @@ class CRM_SMS_Form_Upload extends CRM_Core_Form { public $_mailingID; - function preProcess() { + public function preProcess() { $this->_mailingID = $this->get('mailing_id'); if (CRM_Core_Permission::check('administer CiviCRM')) { $this->assign('isAdmin', 1); @@ -54,7 +54,7 @@ class CRM_SMS_Form_Upload extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $mailingID = CRM_Utils_Request::retrieve('mid', 'Integer', $this, FALSE, NULL); //need to differentiate new/reuse mailing, CRM-2873 @@ -301,7 +301,7 @@ class CRM_SMS_Form_Upload extends CRM_Core_Form { * @access public * @static */ - static function formRule($params, $files, $self) { + public static function formRule($params, $files, $self) { if (!empty($_POST['_qf_Import_refresh'])) { return TRUE; } diff --git a/CRM/SMS/Page/Callback.php b/CRM/SMS/Page/Callback.php index 77d97686c9..83a202a285 100644 --- a/CRM/SMS/Page/Callback.php +++ b/CRM/SMS/Page/Callback.php @@ -36,7 +36,7 @@ class CRM_SMS_Page_Callback { - function run(){ + public function run(){ $provider = CRM_SMS_Provider::singleton($_REQUEST); if (array_key_exists('status',$_REQUEST)){ diff --git a/CRM/SMS/Page/Provider.php b/CRM/SMS/Page/Provider.php index 7fa4a1069d..b4286807e0 100644 --- a/CRM/SMS/Page/Provider.php +++ b/CRM/SMS/Page/Provider.php @@ -53,7 +53,7 @@ class CRM_SMS_Page_Provider extends CRM_Core_Page_Basic { * * @return string Classname of BAO. */ - function getBAOName() { + public function getBAOName() { return 'CRM_SMS_BAO_Provider'; } @@ -62,7 +62,7 @@ class CRM_SMS_Page_Provider extends CRM_Core_Page_Basic { * * @return array (reference) of action links */ - function &links() { + public function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::UPDATE => array( @@ -103,7 +103,7 @@ class CRM_SMS_Page_Provider extends CRM_Core_Page_Basic { * @access public * */ - function run() { + public function run() { // set title and breadcrumb CRM_Utils_System::setTitle(ts('Settings - SMS Provider')); $breadCrumb = array(array('title' => ts('SMS Provider'), @@ -132,7 +132,7 @@ class CRM_SMS_Page_Provider extends CRM_Core_Page_Basic { * @access public * @static */ - function browse($action = NULL) { + public function browse($action = NULL) { $providers = CRM_SMS_BAO_Provider::getProviders(); $rows = array(); foreach ($providers as $provider) { @@ -166,7 +166,7 @@ class CRM_SMS_Page_Provider extends CRM_Core_Page_Basic { * * @return string Classname of edit form. */ - function editForm() { + public function editForm() { return 'CRM_SMS_Form_Provider'; } @@ -175,7 +175,7 @@ class CRM_SMS_Page_Provider extends CRM_Core_Page_Basic { * * @return string name of this page. */ - function editName() { + public function editName() { return 'SMS Provider'; } @@ -186,7 +186,7 @@ class CRM_SMS_Page_Provider extends CRM_Core_Page_Basic { * * @return string user context. */ - function userContext($mode = NULL) { + public function userContext($mode = NULL) { return 'civicrm/admin/sms/provider'; } } diff --git a/CRM/SMS/Provider.php b/CRM/SMS/Provider.php index db73beae15..5cd67c9a63 100644 --- a/CRM/SMS/Provider.php +++ b/CRM/SMS/Provider.php @@ -54,7 +54,7 @@ abstract class CRM_SMS_Provider { * @return object * @static */ - static function &singleton($providerParams = array(), $force = FALSE) { + public static function &singleton($providerParams = array(), $force = FALSE) { $mailingID = CRM_Utils_Array::value('mailing_id', $providerParams); $providerID = CRM_Utils_Array::value('provider_id', $providerParams); $providerName = CRM_Utils_Array::value('provider', $providerParams); @@ -100,7 +100,7 @@ abstract class CRM_SMS_Provider { * * @access public */ - function getMessage($message, $contactID, $contactDetails) { + public function getMessage($message, $contactID, $contactDetails) { $html = $message->getHTMLBody(); $text = $message->getTXTBody(); @@ -113,7 +113,7 @@ abstract class CRM_SMS_Provider { * * @return mixed */ - function getRecipientDetails($fields, $additionalDetails) { + public function getRecipientDetails($fields, $additionalDetails) { // we could do more altering here $fields['To'] = $fields['phone']; return $fields; @@ -129,7 +129,7 @@ abstract class CRM_SMS_Provider { * @return $this|null|object * @throws CRM_Core_Exception */ - function createActivity($apiMsgID, $message, $headers = array(), $jobID = NULL, $userID = NULL) { + public function createActivity($apiMsgID, $message, $headers = array(), $jobID = NULL, $userID = NULL) { if ($jobID) { $sql = " SELECT scheduled_id FROM civicrm_mailing m @@ -173,7 +173,7 @@ INNER JOIN civicrm_mailing_job mj ON mj.mailing_id = m.id AND mj.id = %1"; * * @return mixed */ - function retrieve($name, $type, $abort = TRUE, $default = NULL, $location = 'REQUEST') { + public function retrieve($name, $type, $abort = TRUE, $default = NULL, $location = 'REQUEST') { static $store = NULL; $value = CRM_Utils_Request::retrieve($name, $type, $store, FALSE, $default, $location @@ -195,7 +195,7 @@ INNER JOIN civicrm_mailing_job mj ON mj.mailing_id = m.id AND mj.id = %1"; * @return $this|null|object * @throws CRM_Core_Exception */ - function processInbound($from, $body, $to = NULL, $trackID = NULL) { + public function processInbound($from, $body, $to = NULL, $trackID = NULL) { $formatFrom = $this->formatPhone($this->stripPhone($from), $like, "like"); $escapedFrom = CRM_Utils_Type::escape($formatFrom, 'String'); $fromContactID = CRM_Core_DAO::singleValueQuery('SELECT contact_id FROM civicrm_phone JOIN civicrm_contact ON civicrm_contact.id = civicrm_phone.contact_id WHERE !civicrm_contact.is_deleted AND phone LIKE "%' . $escapedFrom . '"'); @@ -263,7 +263,7 @@ INNER JOIN civicrm_mailing_job mj ON mj.mailing_id = m.id AND mj.id = %1"; * * @return mixed|string */ - function stripPhone($phone) { + public function stripPhone($phone) { $newphone = preg_replace('/[^0-9x]/', '', $phone); while (substr($newphone, 0, 1) == "1") { $newphone = substr($newphone, 1); @@ -284,7 +284,7 @@ INNER JOIN civicrm_mailing_job mj ON mj.mailing_id = m.id AND mj.id = %1"; * * @return mixed|string */ - function formatPhone($phone, &$kind, $format = "dash") { + public function formatPhone($phone, &$kind, $format = "dash") { $phoneA = explode("x", $phone); switch (strlen($phoneA[0])) { case 0: @@ -346,7 +346,7 @@ INNER JOIN civicrm_mailing_job mj ON mj.mailing_id = m.id AND mj.id = %1"; * * @return string */ - function urlEncode($values) { + public function urlEncode($values) { $uri = ''; foreach ($values as $key => $value) { $value = urlencode($value); diff --git a/CRM/SMS/StateMachine/Send.php b/CRM/SMS/StateMachine/Send.php index 4a50aa9fe8..56a05d1da1 100644 --- a/CRM/SMS/StateMachine/Send.php +++ b/CRM/SMS/StateMachine/Send.php @@ -48,7 +48,7 @@ class CRM_SMS_StateMachine_Send extends CRM_Core_StateMachine { * @internal param \CRM_SMS_Controller $object * @return \CRM_SMS_StateMachine_Send CRM_SMS_StateMachine */ - function __construct($controller, $action = CRM_Core_Action::NONE) { + public function __construct($controller, $action = CRM_Core_Action::NONE) { parent::__construct($controller, $action); $this->_pages = array( diff --git a/CRM/Tag/Form/Tag.php b/CRM/Tag/Form/Tag.php index 94c20182db..b9c406e7cf 100644 --- a/CRM/Tag/Form/Tag.php +++ b/CRM/Tag/Form/Tag.php @@ -47,7 +47,7 @@ class CRM_Tag_Form_Tag extends CRM_Core_Form { protected $_entityID; protected $_entityTable; - function preProcess() { + public function preProcess() { if ($this->get('entityID')) { $this->_entityID = $this->get('entityID'); } diff --git a/CRM/UF/Form/AbstractPreview.php b/CRM/UF/Form/AbstractPreview.php index 0a3ed942f8..a3410e5e4a 100644 --- a/CRM/UF/Form/AbstractPreview.php +++ b/CRM/UF/Form/AbstractPreview.php @@ -78,7 +78,7 @@ class CRM_UF_Form_AbstractPreview extends CRM_Core_Form { * * @return array the default array reference */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); foreach ($this->_fields as $name => $field) { if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($field['name'])) { diff --git a/CRM/UF/Form/Field.php b/CRM/UF/Form/Field.php index e66fb1bb2c..1f7f0f6f52 100644 --- a/CRM/UF/Form/Field.php +++ b/CRM/UF/Form/Field.php @@ -629,7 +629,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form { * @static * @access public */ - static function formRuleSubType($fieldType, $groupType, $errors) { + public static function formRuleSubType($fieldType, $groupType, $errors) { if (in_array($fieldType, array( 'Participant', 'Contribution', 'Membership', 'Activity'))) { $individualSubTypes = CRM_Contact_BAO_ContactType::subTypes('Individual'); @@ -672,7 +672,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form { * @static * @access public */ - static function formRuleCustomDataExtentColumnValue($customField, $gid, $fieldType, &$errors) { + public static function formRuleCustomDataExtentColumnValue($customField, $gid, $fieldType, &$errors) { // fix me : check object $customField if (in_array($fieldType, array( 'Participant', 'Contribution', 'Membership', 'Activity', 'Case'))) { @@ -717,7 +717,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form { * @static * @access public */ - static function formRulePrimaryCheck($fields, $profileFieldName, $groupFields, &$errors) { + public static function formRulePrimaryCheck($fields, $profileFieldName, $groupFields, &$errors) { //FIXME: This may need to also apply to website fields if they are refactored to allow more than one per profile $checkPrimary = array('phone' => 'civicrm_phone.phone', 'phone_and_ext' => 'civicrm_phone.phone'); $whereCheck = NULL; @@ -757,7 +757,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form { * @static * @access public */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $is_required = CRM_Utils_Array::value('is_required', $fields, FALSE); $is_registration = CRM_Utils_Array::value('is_registration', $fields, FALSE); $is_view = CRM_Utils_Array::value('is_view', $fields, FALSE); diff --git a/CRM/UF/Form/Group.php b/CRM/UF/Form/Group.php index 3d08843ad3..9699c5815a 100644 --- a/CRM/UF/Form/Group.php +++ b/CRM/UF/Form/Group.php @@ -215,7 +215,7 @@ class CRM_UF_Form_Group extends CRM_Core_Form { * * @return void */ - function setDefaultValues() { + public function setDefaultValues() { $defaults = array(); $showHide = new CRM_Core_ShowHideBlocks(); @@ -294,7 +294,7 @@ class CRM_UF_Form_Group extends CRM_Core_Form { * @access public * @static */ - static function formRule($fields, $files, $self) { + public static function formRule($fields, $files, $self) { $errors = array(); //validate profile title as well as name. diff --git a/CRM/UF/Form/Inline/Preview.php b/CRM/UF/Form/Inline/Preview.php index 7cf8c28efa..b0df01f58d 100644 --- a/CRM/UF/Form/Inline/Preview.php +++ b/CRM/UF/Form/Inline/Preview.php @@ -52,7 +52,7 @@ class CRM_UF_Form_Inline_Preview extends CRM_UF_Form_AbstractPreview { * @access public * */ - function preProcess() { + public function preProcess() { if ($_SERVER['REQUEST_METHOD'] != 'POST') { // CRM_Core_Controller validates qfKey for POST requests, but not necessarily // for GET requests. Allowing GET would therefore be CSRF vulnerability. diff --git a/CRM/UF/Form/Inline/PreviewById.php b/CRM/UF/Form/Inline/PreviewById.php index 6c7fd34182..724a19a849 100644 --- a/CRM/UF/Form/Inline/PreviewById.php +++ b/CRM/UF/Form/Inline/PreviewById.php @@ -52,7 +52,7 @@ class CRM_UF_Form_Inline_PreviewById extends CRM_UF_Form_AbstractPreview { * @access public * */ - function preProcess() { + public function preProcess() { // Inline forms don't get menu-level permission checks if (!CRM_Core_Permission::check('access CiviCRM')) { CRM_Core_Error::fatal(ts('Permission Denied')); diff --git a/CRM/UF/Form/Preview.php b/CRM/UF/Form/Preview.php index 3b310d5bdc..6b87f24151 100644 --- a/CRM/UF/Form/Preview.php +++ b/CRM/UF/Form/Preview.php @@ -52,7 +52,7 @@ class CRM_UF_Form_Preview extends CRM_UF_Form_AbstractPreview { * @access public * */ - function preProcess() { + public function preProcess() { $flag = FALSE; $gid = $this->get('id'); $this->set('gid', $gid); diff --git a/CRM/UF/Page/AJAX.php b/CRM/UF/Page/AJAX.php index 5303abb44b..785048df90 100644 --- a/CRM/UF/Page/AJAX.php +++ b/CRM/UF/Page/AJAX.php @@ -42,7 +42,7 @@ class CRM_UF_Page_AJAX { * Function the check whether the field belongs * to multi-record custom set */ - function checkIsMultiRecord() { + public function checkIsMultiRecord() { $customId = $_GET['customId']; $isMultiple = CRM_Core_BAO_CustomField::isMultiRecordField($customId); diff --git a/CRM/UF/Page/Field.php b/CRM/UF/Page/Field.php index 7a7ca5e747..fcc1e2ba51 100644 --- a/CRM/UF/Page/Field.php +++ b/CRM/UF/Page/Field.php @@ -109,7 +109,7 @@ class CRM_UF_Page_Field extends CRM_Core_Page { * @access public * @static */ - function browse() { + public function browse() { $resourceManager = CRM_Core_Resources::singleton(); if (!empty($_GET['new']) && $resourceManager->ajaxPopupsEnabled) { $resourceManager->addScriptFile('civicrm', 'js/crm.addNew.js', 999, 'html-header'); @@ -213,7 +213,7 @@ class CRM_UF_Page_Field extends CRM_Core_Page { * @return void * @access public */ - function edit($action) { + public function edit($action) { // create a simple controller for editing CiviCRM Profile data $controller = new CRM_Core_Controller_Simple('CRM_UF_Form_Field', ts('CiviCRM Profile Field'), $action); @@ -238,7 +238,7 @@ class CRM_UF_Page_Field extends CRM_Core_Page { * @access public * */ - function run() { + public function run() { // get the group id $this->_gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this, FALSE, 0 @@ -289,7 +289,7 @@ class CRM_UF_Page_Field extends CRM_Core_Page { * @return void * @access public */ - function preview($fieldId, $groupId) { + public function preview($fieldId, $groupId) { $controller = new CRM_Core_Controller_Simple('CRM_UF_Form_Preview', ts('Preview Custom Data'), CRM_Core_Action::PREVIEW); $session = CRM_Core_Session::singleton(); $session->pushUserContext(CRM_Utils_System::url('civicrm/admin/uf/group/field', diff --git a/CRM/UF/Page/Group.php b/CRM/UF/Page/Group.php index c3805af914..ff36ea3fb0 100644 --- a/CRM/UF/Page/Group.php +++ b/CRM/UF/Page/Group.php @@ -58,7 +58,7 @@ class CRM_UF_Page_Group extends CRM_Core_Page { * @return array $_actionLinks * */ - function &actionLinks() { + public function &actionLinks() { // check if variable _actionsLinks is populated if (!self::$_actionLinks) { // helper variable for nicer formatting @@ -142,7 +142,7 @@ class CRM_UF_Page_Group extends CRM_Core_Page { * @return void * @access public */ - function run() { + public function run() { // get the requested action $action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, @@ -195,7 +195,7 @@ class CRM_UF_Page_Group extends CRM_Core_Page { * @return void * @access public */ - function copy() { + public function copy() { $gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this, TRUE, 0, 'GET' ); @@ -210,7 +210,7 @@ class CRM_UF_Page_Group extends CRM_Core_Page { * @return void * @access public */ - function profile() { + public function profile() { $config = CRM_Core_Config::singleton(); // reassign resource base to be the full url, CRM-4660 @@ -277,7 +277,7 @@ class CRM_UF_Page_Group extends CRM_Core_Page { * @return void * @access public */ - function edit($id, $action) { + public function edit($id, $action) { // create a simple controller for editing uf data $controller = new CRM_Core_Controller_Simple('CRM_UF_Form_Group', ts('CiviCRM Profile Group'), $action); $this->setContext($id, $action); @@ -296,7 +296,7 @@ class CRM_UF_Page_Group extends CRM_Core_Page { * @access public * @static */ - function browse($action = NULL) { + public function browse($action = NULL) { $ufGroup = array(); $allUFGroups = array(); $allUFGroups = CRM_Core_BAO_UFGroup::getModuleUFGroup(); @@ -392,7 +392,7 @@ class CRM_UF_Page_Group extends CRM_Core_Page { * @return void * @access public */ - function preview($id, $action) { + public function preview($id, $action) { $controller = new CRM_Core_Controller_Simple('CRM_UF_Form_Preview', ts('CiviCRM Profile Group Preview'), NULL); $controller->set('id', $id); $controller->setEmbedded(TRUE); @@ -404,7 +404,7 @@ class CRM_UF_Page_Group extends CRM_Core_Page { * @param int $id * @param $action */ - function setContext($id, $action) { + public function setContext($id, $action) { $context = CRM_Utils_Request::retrieve('context', 'String', $this); //we need to differentiate context for update and preview profile. @@ -428,7 +428,7 @@ class CRM_UF_Page_Group extends CRM_Core_Page { * * @return array */ - static function extractGroupTypes($groupType) { + public static function extractGroupTypes($groupType) { $returnGroupTypes = array(); if (!$groupType) { return $returnGroupTypes; diff --git a/CRM/UF/Page/ProfileEditor.php b/CRM/UF/Page/ProfileEditor.php index 3a4708a696..4537567619 100644 --- a/CRM/UF/Page/ProfileEditor.php +++ b/CRM/UF/Page/ProfileEditor.php @@ -7,11 +7,11 @@ require_once 'CRM/Core/Page.php'; * widgets */ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page { - function run() { + public function run() { CRM_Core_Error::fatal('This is not a real page!'); } - static function registerProfileScripts() { + public static function registerProfileScripts() { static $loaded = FALSE; if ($loaded || CRM_Core_Resources::isAjaxMode()) { return; @@ -66,7 +66,7 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page { * * @param array $entityTypes strings, e.g. "IndividualModel", "ActivityModel" */ - static function registerSchemas($entityTypes) { + public static function registerSchemas($entityTypes) { // TODO in cases where registerSchemas is called multiple times for same entity, be more efficient CRM_Core_Resources::singleton()->addSettingsFactory(function () use ($entityTypes) { return array( @@ -78,7 +78,7 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page { /** * AJAX callback */ - static function getSchemaJSON() { + public static function getSchemaJSON() { $entityTypes = explode(',', $_REQUEST['entityTypes']); CRM_Utils_JSON::output(self::getSchema($entityTypes)); } @@ -93,7 +93,7 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page { * @see js/model/crm.core.js * @see js/model/crm.mappedcore.js */ - static function getSchema($entityTypes) { + public static function getSchema($entityTypes) { // FIXME: Depending on context (eg civicrm/profile/create vs search-columns), it may be appropriate to // pick importable or exportable fields @@ -180,7 +180,7 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page { * @see js/model/crm.core.js * @see js/model/crm.mappedcore.js */ - static function convertCiviModelToBackboneModel($extends, $title, $availableFields) { + public static function convertCiviModelToBackboneModel($extends, $title, $availableFields) { $locationFields = CRM_Core_BAO_UFGroup::getLocationFields(); $result = array( diff --git a/CRM/Upgrade/Form.php b/CRM/Upgrade/Form.php index 3e4cafe1b4..7432908dbf 100644 --- a/CRM/Upgrade/Form.php +++ b/CRM/Upgrade/Form.php @@ -131,7 +131,7 @@ class CRM_Upgrade_Form extends CRM_Core_Form { * * @return mixed */ - static function &incrementalPhpObject($version) { + public static function &incrementalPhpObject($version) { static $incrementalPhpObject = array(); $versionParts = explode('.', $version); @@ -150,7 +150,7 @@ class CRM_Upgrade_Form extends CRM_Core_Form { * * @return bool */ - function checkVersionRelease($version, $release) { + public function checkVersionRelease($version, $release) { $versionParts = explode('.', $version); if ($versionParts[2] == $release) { return TRUE; @@ -163,7 +163,7 @@ class CRM_Upgrade_Form extends CRM_Core_Form { * * @return array */ - function checkSQLConstraints(&$constraints) { + public function checkSQLConstraints(&$constraints) { $pass = $fail = 0; foreach ($constraints as $constraint) { if ($this->checkSQLConstraint($constraint)) { @@ -181,7 +181,7 @@ class CRM_Upgrade_Form extends CRM_Core_Form { * * @return bool */ - function checkSQLConstraint($constraint) { + public function checkSQLConstraint($constraint) { // check constraint here return TRUE; } @@ -190,14 +190,14 @@ class CRM_Upgrade_Form extends CRM_Core_Form { * @param string $fileName * @param bool $isQueryString */ - function source($fileName, $isQueryString = FALSE) { + public function source($fileName, $isQueryString = FALSE) { CRM_Utils_File::sourceSQLFile($this->_config->dsn, $fileName, NULL, $isQueryString ); } - function preProcess() { + public function preProcess() { CRM_Utils_System::setTitle($this->getTitle()); if (!$this->verifyPreDBState($errorMessage)) { if (!isset($errorMessage)) { @@ -208,7 +208,7 @@ class CRM_Upgrade_Form extends CRM_Core_Form { $this->assign('recentlyViewed', FALSE); } - function buildQuickForm() { + public function buildQuickForm() { $this->addDefaultButtons($this->getButtonTitle(), 'next', NULL, @@ -225,21 +225,21 @@ class CRM_Upgrade_Form extends CRM_Core_Form { /** * @return string */ - function getTitle() { + public function getTitle() { return ts('Title not Set'); } /** * @return string */ - function getFieldsetTitle() { + public function getFieldsetTitle() { return ts(''); } /** * @return string */ - function getButtonTitle() { + public function getButtonTitle() { return ts('Continue'); } @@ -252,7 +252,7 @@ class CRM_Upgrade_Form extends CRM_Core_Form { /** * @return string */ - function getTemplateFileName() { + public function getTemplateFileName() { $this->assign('title', $this->getFieldsetTitle() ); @@ -262,7 +262,7 @@ class CRM_Upgrade_Form extends CRM_Core_Form { return 'CRM/Upgrade/Base.tpl'; } - function postProcess() { + public function postProcess() { $this->upgrade(); if (!$this->verifyPostDBState($errorMessage)) { @@ -278,7 +278,7 @@ class CRM_Upgrade_Form extends CRM_Core_Form { * * @return Object */ - function runQuery($query) { + public function runQuery($query) { return CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray ); @@ -289,7 +289,7 @@ class CRM_Upgrade_Form extends CRM_Core_Form { * * @return Object */ - function setVersion($version) { + public function setVersion($version) { $this->logVersion($version); $query = " @@ -304,7 +304,7 @@ SET version = '$version' * * @return bool */ - function logVersion($newVersion) { + public function logVersion($newVersion) { if ($newVersion) { $oldVersion = CRM_Core_BAO_Domain::version(); @@ -329,7 +329,7 @@ SET version = '$version' * * @return bool */ - function checkVersion($version) { + public function checkVersion($version) { $domainID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Domain', $version, 'id', 'version' @@ -341,7 +341,7 @@ SET version = '$version' * @return array * @throws Exception */ - function getRevisionSequence() { + public function getRevisionSequence() { $revList = array(); $sqlDir = implode(DIRECTORY_SEPARATOR, array(dirname(__FILE__), 'Incremental', 'sql') @@ -377,7 +377,7 @@ SET version = '$version' * * @return null */ - static function getRevisionPart($rev, $index = 1) { + public static function getRevisionPart($rev, $index = 1) { $revPattern = '/^((\d{1,2})\.\d{1,2})\.(\d{1,2}|\w{4,7})?$/i'; preg_match($revPattern, $rev, $matches); @@ -390,7 +390,7 @@ SET version = '$version' * * @return bool */ - function processLocales($tplFile, $rev) { + public function processLocales($tplFile, $rev) { $smarty = CRM_Core_Smarty::singleton(); $smarty->assign('domainID', CRM_Core_Config::domainID()); @@ -405,7 +405,7 @@ SET version = '$version' /** * @param $rev */ - function setSchemaStructureTables($rev) { + public function setSchemaStructureTables($rev) { if ($this->multilingual) { CRM_Core_I18n_Schema::schemaStructureTables($rev, TRUE); } @@ -416,7 +416,7 @@ SET version = '$version' * * @throws Exception */ - function processSQL($rev) { + public function processSQL($rev) { $sqlFile = implode(DIRECTORY_SEPARATOR, array( dirname(__FILE__), 'Incremental', @@ -441,7 +441,7 @@ SET version = '$version' * * @return array(0=>$currentVer, 1=>$latestVer) */ - function getUpgradeVersions() { + public function getUpgradeVersions() { $latestVer = CRM_Utils_System::version(); $currentVer = CRM_Core_BAO_Domain::version(true); if (!$currentVer) { @@ -477,7 +477,7 @@ SET version = '$version' * * @return mixed, a string error message or boolean 'false' if OK */ - function checkUpgradeableVersion($currentVer, $latestVer) { + public function checkUpgradeableVersion($currentVer, $latestVer) { $error = FALSE; // since version is suppose to be in valid format at this point, especially after conversion ($convertVer), // lets do a pattern check - @@ -531,7 +531,7 @@ SET version = '$version' * * @return mixed, a string error message or boolean 'false' if OK */ - function checkCurrentVersion($currentVer, $latestVer) { + public function checkCurrentVersion($currentVer, $latestVer) { $error = FALSE; // since version is suppose to be in valid format at this point, especially after conversion ($convertVer), @@ -556,7 +556,7 @@ SET version = '$version' * * @return CRM_Queue */ - static function buildQueue($currentVer, $latestVer, $postUpgradeMessageFile) { + public static function buildQueue($currentVer, $latestVer, $postUpgradeMessageFile) { $upgrade = new CRM_Upgrade_Form(); // hack to make 4.0.x (D7,J1.6) codebase go through 3.4.x (d6, J1.5) upgrade files, @@ -619,7 +619,7 @@ SET version = '$version' * * @return bool */ - static function doIncrementalUpgradeStart(CRM_Queue_TaskContext $ctx, $rev) { + public static function doIncrementalUpgradeStart(CRM_Queue_TaskContext $ctx, $rev) { $upgrade = new CRM_Upgrade_Form(); // as soon as we start doing anything we append ".upgrade" to version. @@ -640,7 +640,7 @@ SET version = '$version' * * @return bool */ - static function doIncrementalUpgradeStep(CRM_Queue_TaskContext$ctx, $rev, $originalVer, $latestVer, $postUpgradeMessageFile) { + public static function doIncrementalUpgradeStep(CRM_Queue_TaskContext$ctx, $rev, $originalVer, $latestVer, $postUpgradeMessageFile) { $upgrade = new CRM_Upgrade_Form(); $phpFunctionName = 'upgrade_' . str_replace('.', '_', $rev); @@ -700,7 +700,7 @@ SET version = '$version' * * @return bool */ - static function doIncrementalUpgradeFinish(CRM_Queue_TaskContext $ctx, $rev, $currentVer, $latestVer, $postUpgradeMessageFile) { + public static function doIncrementalUpgradeFinish(CRM_Queue_TaskContext $ctx, $rev, $currentVer, $latestVer, $postUpgradeMessageFile) { $upgrade = new CRM_Upgrade_Form(); $upgrade->setVersion($rev); CRM_Utils_System::flushCache(); @@ -710,7 +710,7 @@ SET version = '$version' return TRUE; } - static function doFinish() { + public static function doFinish() { $upgrade = new CRM_Upgrade_Form(); list($ignore, $latestVer) = $upgrade->getUpgradeVersions(); // Seems extraneous in context, but we'll preserve old behavior @@ -744,7 +744,7 @@ SET version = '$version' * @param $currentVer * @param $latestVer */ - function setPreUpgradeMessage(&$preUpgradeMessage, $currentVer, $latestVer) { + public function setPreUpgradeMessage(&$preUpgradeMessage, $currentVer, $latestVer) { CRM_Upgrade_Incremental_Legacy::setPreUpgradeMessage($preUpgradeMessage, $currentVer, $latestVer); // Scan through all php files and see if any file is interested in setting pre-upgrade-message diff --git a/CRM/Upgrade/Headless.php b/CRM/Upgrade/Headless.php index 968703d0df..9898156e60 100644 --- a/CRM/Upgrade/Headless.php +++ b/CRM/Upgrade/Headless.php @@ -40,7 +40,7 @@ class CRM_Upgrade_Headless { * @return array, with keys: * - message: string, HTML-ish blob */ - function run($enablePrint = TRUE) { + public function run($enablePrint = TRUE) { // lets get around the time limit issue if possible for upgrades if (!ini_get('safe_mode')) { set_time_limit(0); diff --git a/CRM/Upgrade/Incremental/Legacy.php b/CRM/Upgrade/Incremental/Legacy.php index 4af7c5038f..6dfbab04e7 100644 --- a/CRM/Upgrade/Incremental/Legacy.php +++ b/CRM/Upgrade/Incremental/Legacy.php @@ -46,7 +46,7 @@ class CRM_Upgrade_Incremental_Legacy { * @param $currentVer * @param $latestVer */ - static function setPreUpgradeMessage(&$preUpgradeMessage, $currentVer, $latestVer) { + public static function setPreUpgradeMessage(&$preUpgradeMessage, $currentVer, $latestVer) { $upgrade = new CRM_Upgrade_Form(); $template = CRM_Core_Smarty::singleton(); @@ -131,7 +131,7 @@ SELECT id * @param $latestVer * @param $currentVer */ - static function checkMessageTemplate(&$template, &$message, $latestVer, $currentVer) { + public static function checkMessageTemplate(&$template, &$message, $latestVer, $currentVer) { if (version_compare($currentVer, '3.1.alpha1') < 0) { return; } @@ -207,7 +207,7 @@ SELECT id * @param $rev string, an intermediate version; note that setPostUpgradeMessage is called repeatedly with different $revs * @return void */ - static function setPostUpgradeMessage(&$postUpgradeMessage, $rev) { + public static function setPostUpgradeMessage(&$postUpgradeMessage, $rev) { if ($rev == '3.2.alpha1') { $postUpgradeMessage .= '
' . ts("We have reset the COUNTED flag to false for the event participant status 'Pending from incomplete transaction'. This change ensures that people who have a problem during registration can try again."); } @@ -270,7 +270,7 @@ SELECT count( id ) as statusCount * * @param $rev string, the revision to which we are upgrading (Note: When processing a series of upgrades, this is the immediate upgrade - not the final) */ - static function upgrade_2_2_alpha1($rev) { + public static function upgrade_2_2_alpha1($rev) { for ($stepID = 1; $stepID <= 4; $stepID++) { $formName = "CRM_Upgrade_TwoTwo_Form_Step{$stepID}"; $form = new $formName(); @@ -314,7 +314,7 @@ SELECT count( id ) as statusCount * * @param $rev string, the revision to which we are upgrading (Note: When processing a series of upgrades, this is the immediate upgrade - not the final) */ - static function upgrade_2_1_2($rev) { + public static function upgrade_2_1_2($rev) { $formName = "CRM_Upgrade_TwoOne_Form_TwoOneTwo"; $form = new $formName($rev); @@ -341,7 +341,7 @@ SELECT count( id ) as statusCount * Name of this function will change according to the latest release * */ - static function upgrade_2_2_alpha3($rev) { + public static function upgrade_2_2_alpha3($rev) { // skip processing sql file, if fresh install - if (!CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'mail_protocol', 'id', 'name')) { $upgrade = new CRM_Upgrade_Form(); @@ -355,7 +355,7 @@ SELECT count( id ) as statusCount * * @param $rev string, the revision to which we are upgrading (Note: When processing a series of upgrades, this is the immediate upgrade - not the final) */ - static function upgrade_2_2_beta1($rev) { + public static function upgrade_2_2_beta1($rev) { if (!CRM_Core_DAO::checkFieldExists('civicrm_pcp_block', 'notify_email')) { $template = CRM_Core_Smarty::singleton(); $template->assign('notifyAbsent', TRUE); @@ -369,7 +369,7 @@ SELECT count( id ) as statusCount * * @param $rev string, the revision to which we are upgrading (Note: When processing a series of upgrades, this is the immediate upgrade - not the final) */ - static function upgrade_2_2_beta2($rev) { + public static function upgrade_2_2_beta2($rev) { $template = CRM_Core_Smarty::singleton(); if (!CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', 'CRM_Contact_Form_Search_Custom_ZipCodeRange', 'id', 'name' @@ -390,7 +390,7 @@ SELECT count( id ) as statusCount * * @param $rev string, the revision to which we are upgrading (Note: When processing a series of upgrades, this is the immediate upgrade - not the final) */ - static function upgrade_2_2_beta3($rev) { + public static function upgrade_2_2_beta3($rev) { $template = CRM_Core_Smarty::singleton(); if (!CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'custom_data_type', 'id', 'name')) { $template->assign('customDataType', TRUE); @@ -405,7 +405,7 @@ SELECT count( id ) as statusCount * * @param $rev string, the revision to which we are upgrading (Note: When processing a series of upgrades, this is the immediate upgrade - not the final) */ - static function upgrade_3_0_alpha1($rev) { + public static function upgrade_3_0_alpha1($rev) { $threeZero = new CRM_Upgrade_ThreeZero_ThreeZero(); @@ -425,7 +425,7 @@ SELECT count( id ) as statusCount * * @param $rev string, the revision to which we are upgrading (Note: When processing a series of upgrades, this is the immediate upgrade - not the final) */ - static function upgrade_3_1_alpha1($rev) { + public static function upgrade_3_1_alpha1($rev) { $threeOne = new CRM_Upgrade_ThreeOne_ThreeOne(); @@ -445,7 +445,7 @@ SELECT count( id ) as statusCount * * @param $rev string, the revision to which we are upgrading (Note: When processing a series of upgrades, this is the immediate upgrade - not the final) */ - static function upgrade_2_2_7($rev) { + public static function upgrade_2_2_7($rev) { $upgrade = new CRM_Upgrade_Form(); $upgrade->processSQL($rev); $sql = "UPDATE civicrm_report_instance @@ -477,7 +477,7 @@ SELECT count( id ) as statusCount * * @param $rev string, the revision to which we are upgrading (Note: When processing a series of upgrades, this is the immediate upgrade - not the final) */ - static function upgrade_3_0_2($rev) { + public static function upgrade_3_0_2($rev) { $template = CRM_Core_Smarty::singleton(); //check whether upgraded from 2.1.x or 2.2.x @@ -499,7 +499,7 @@ SELECT count( id ) as statusCount * * @param $rev string, the revision to which we are upgrading (Note: When processing a series of upgrades, this is the immediate upgrade - not the final) */ - static function upgrade_3_0_4($rev) { + public static function upgrade_3_0_4($rev) { //make sure 'Deceased' membership status present in db,CRM-5636 $template = CRM_Core_Smarty::singleton(); @@ -519,7 +519,7 @@ SELECT count( id ) as statusCount * * @param $rev string, the revision to which we are upgrading (Note: When processing a series of upgrades, this is the immediate upgrade - not the final) */ - static function upgrade_3_1_0($rev) { + public static function upgrade_3_1_0($rev) { // upgrade all roles who have 'access CiviEvent' permission, to also have // newly added permission 'edit_all_events', CRM-5472 $config = CRM_Core_Config::singleton(); @@ -547,7 +547,7 @@ SELECT count( id ) as statusCount * * @param $rev string, the revision to which we are upgrading (Note: When processing a series of upgrades, this is the immediate upgrade - not the final) */ - static function upgrade_3_1_3($rev) { + public static function upgrade_3_1_3($rev) { $threeOne = new CRM_Upgrade_ThreeOne_ThreeOne(); $threeOne->upgrade_3_1_3(); @@ -560,7 +560,7 @@ SELECT count( id ) as statusCount * * @param $rev string, the revision to which we are upgrading (Note: When processing a series of upgrades, this is the immediate upgrade - not the final) */ - static function upgrade_3_1_4($rev) { + public static function upgrade_3_1_4($rev) { $threeOne = new CRM_Upgrade_ThreeOne_ThreeOne(); $threeOne->upgrade_3_1_4(); diff --git a/CRM/Upgrade/Incremental/php/FourFive.php b/CRM/Upgrade/Incremental/php/FourFive.php index a4f2017809..a94ec64cf5 100644 --- a/CRM/Upgrade/Incremental/php/FourFive.php +++ b/CRM/Upgrade/Incremental/php/FourFive.php @@ -39,7 +39,7 @@ class CRM_Upgrade_Incremental_php_FourFive { * * @return bool */ - function verifyPreDBstate(&$errors) { + public function verifyPreDBstate(&$errors) { return TRUE; } @@ -55,7 +55,7 @@ class CRM_Upgrade_Incremental_php_FourFive { * * @return void */ - function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL) { + public function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL) { } /** @@ -65,7 +65,7 @@ class CRM_Upgrade_Incremental_php_FourFive { * @param $rev string, an intermediate version; note that setPostUpgradeMessage is called repeatedly with different $revs * @return void */ - function setPostUpgradeMessage(&$postUpgradeMessage, $rev) { + public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) { if ($rev == '4.5.alpha1') { $postUpgradeMessage .= '

' . ts('Default versions of the following System Workflow Message Templates have been modified to handle new functionality:

  • Contributions - Receipt (off-line)
  • Contributions - Receipt (on-line)
  • Contributions - Recurring Start and End Notification
  • Contributions - Recurring Updates
  • Memberships - Receipt (on-line)
  • Memberships - Signup and Renewal Receipts (off-line)
  • Pledges - Acknowledgement
If you have modified these templates, please review the new default versions and implement updates as needed to your copies (Administer > Communications > Message Templates > System Workflow Messages). (learn more...)', array(1 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Updating+System+Workflow+Message+Templates+after+Upgrades+-+method+1+-+kdiff')); $postUpgradeMessage .= '

' . ts('This release allows you to view and edit multiple-record custom field sets in a table format which will be more usable in some cases. You can try out the format by navigating to Administer > Custom Data & Screens > Custom Fields. Click Settings for a custom field set and change Display Style to "Tab with Tables".'); @@ -84,7 +84,7 @@ class CRM_Upgrade_Incremental_php_FourFive { * * @return bool */ - function upgrade_4_5_alpha1($rev) { + public function upgrade_4_5_alpha1($rev) { // task to process sql $this->addTask(ts('Migrate honoree information to module_data'), 'migrateHonoreeInfo'); $this->addTask(ts('Upgrade DB to 4.5.alpha1: SQL'), 'task_4_5_x_runSql', $rev); @@ -122,7 +122,7 @@ DROP KEY `{$dao->CONSTRAINT_NAME}`"; * * @return bool */ - function upgrade_4_5_beta9($rev) { + public function upgrade_4_5_beta9($rev) { $this->addTask(ts('Upgrade DB to 4.5.beta9: SQL'), 'task_4_5_x_runSql', $rev); $entityTable = array( @@ -156,7 +156,7 @@ DROP KEY `{$dao->CONSTRAINT_NAME}`"; * * @return bool */ - static function task_4_5_0_fixLineItem(CRM_Queue_TaskContext $ctx, $startId, $endId, $entityTable) { + public static function task_4_5_0_fixLineItem(CRM_Queue_TaskContext $ctx, $startId, $endId, $entityTable) { $sqlParams = array( 1 => array($startId, 'Integer'), @@ -224,7 +224,7 @@ DROP KEY `{$dao->CONSTRAINT_NAME}`"; * * @return bool TRUE for success */ - static function addNameFieldOptions(CRM_Queue_TaskContext $ctx) { + public static function addNameFieldOptions(CRM_Queue_TaskContext $ctx) { $query = "SELECT `value` FROM `civicrm_setting` WHERE `group_name` = 'CiviCRM Preferences' AND `name` = 'contact_edit_options'"; $dao = CRM_Core_DAO::executeQuery($query); $dao->fetch(); @@ -247,7 +247,7 @@ DROP KEY `{$dao->CONSTRAINT_NAME}`"; * * @return bool TRUE for success */ - static function migrateHonoreeInfo(CRM_Queue_TaskContext $ctx) { + public static function migrateHonoreeInfo(CRM_Queue_TaskContext $ctx) { $query = "ALTER TABLE `civicrm_uf_join` ADD COLUMN `module_data` longtext COMMENT 'Json serialized array of data used by the ufjoin.module'"; CRM_Core_DAO::executeQuery($query); @@ -304,7 +304,7 @@ DROP KEY `{$dao->CONSTRAINT_NAME}`"; /** * (Queue Task Callback) */ - static function task_4_5_x_runSql(CRM_Queue_TaskContext $ctx, $rev) { + public static function task_4_5_x_runSql(CRM_Queue_TaskContext $ctx, $rev) { $upgrade = new CRM_Upgrade_Form(); $upgrade->processSQL($rev); diff --git a/CRM/Upgrade/Incremental/php/FourFour.php b/CRM/Upgrade/Incremental/php/FourFour.php index 6e58c4e76a..1c6b710a68 100644 --- a/CRM/Upgrade/Incremental/php/FourFour.php +++ b/CRM/Upgrade/Incremental/php/FourFour.php @@ -41,7 +41,7 @@ class CRM_Upgrade_Incremental_php_FourFour { * * @return bool */ - function verifyPreDBstate(&$errors) { + public function verifyPreDBstate(&$errors) { return TRUE; } @@ -57,7 +57,7 @@ class CRM_Upgrade_Incremental_php_FourFour { * * @return void */ - function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL) { + public function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL) { if ($rev == '4.4.beta1') { $apiCalls = self::getConfigArraysAsAPIParams(FALSE); $oversizedEntries = 0; @@ -81,7 +81,7 @@ class CRM_Upgrade_Incremental_php_FourFour { * @param $rev string, an intermediate version; note that setPostUpgradeMessage is called repeatedly with different $revs * @return void */ - function setPostUpgradeMessage(&$postUpgradeMessage, $rev) { + public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) { if ($rev == '4.4.1') { $config = CRM_Core_Config::singleton(); if (!empty($config->useIDS)) { @@ -112,7 +112,7 @@ WHERE ceft.entity_table = 'civicrm_contribution' AND cft.payment_instrument_id I * * @return bool */ - function upgrade_4_4_alpha1($rev) { + public function upgrade_4_4_alpha1($rev) { // task to process sql $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.4.alpha1')), 'task_4_4_x_runSql', $rev); @@ -125,7 +125,7 @@ WHERE ceft.entity_table = 'civicrm_contribution' AND cft.payment_instrument_id I /** * @param $rev */ - function upgrade_4_4_beta1($rev) { + public function upgrade_4_4_beta1($rev) { $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.4.beta1')), 'task_4_4_x_runSql', $rev); // add new 'data' column in civicrm_batch @@ -154,7 +154,7 @@ WHERE ceft.entity_table = 'civicrm_contribution' AND cft.payment_instrument_id I /** * @param $rev */ - function upgrade_4_4_1($rev) { + public function upgrade_4_4_1($rev) { $config = CRM_Core_Config::singleton(); // CRM-13327 upgrade handling for the newly added name badges $ogID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'name_badge', 'id', 'name'); @@ -256,7 +256,7 @@ VALUES {$insertStatus}"; * * @return bool */ - function upgrade_4_4_4($rev) { + public function upgrade_4_4_4($rev) { $fkConstraint = array(); if (!CRM_Core_DAO::checkFKConstraintInFormat('civicrm_activity_contact', 'activity_id')) { $fkConstraint[] = "ADD CONSTRAINT `FK_civicrm_activity_contact_activity_id` FOREIGN KEY (`activity_id`) REFERENCES `civicrm_activity` (`id`) ON DELETE CASCADE"; @@ -333,7 +333,7 @@ ALTER TABLE civicrm_dashboard /** * @param $rev */ - function upgrade_4_4_6($rev){ + public function upgrade_4_4_6($rev){ $sql = "SELECT count(*) AS count FROM INFORMATION_SCHEMA.STATISTICS where ". "TABLE_SCHEMA = database() AND INDEX_NAME = 'index_image_url' AND TABLE_NAME = 'civicrm_contact';"; $dao = CRM_Core_DAO::executeQuery($sql); @@ -358,7 +358,7 @@ ALTER TABLE civicrm_dashboard * * @return bool */ - function upgrade_4_4_7($rev, $originalVer, $latestVer) { + public function upgrade_4_4_7($rev, $originalVer, $latestVer) { // For WordPress/Joomla(?), cleanup broken image_URL from 4.4.6 upgrades - https://issues.civicrm.org/jira/browse/CRM-14971 $exBackendUrl = CRM_Utils_System::url('civicrm/contact/imagefile', 'photo=XXX', TRUE); // URL formula from 4.4.6 upgrade $exFrontendUrl = CRM_Utils_System::url('civicrm/contact/imagefile', 'photo=XXX', TRUE, NULL, TRUE, TRUE); @@ -374,7 +374,7 @@ ALTER TABLE civicrm_dashboard $this->addTask(ts('Update saved search information'), 'changeSavedSearch'); } - static function upgradeImageUrls(CRM_Queue_TaskContext $ctx, $startId, $endId){ + public static function upgradeImageUrls(CRM_Queue_TaskContext $ctx, $startId, $endId){ $dao = self::findContactImageUrls($startId, $endId); $failures = array(); while ($dao->fetch()){ @@ -403,7 +403,7 @@ ALTER TABLE civicrm_dashboard return TRUE; } - static function changeSavedSearch(CRM_Queue_TaskContext $ctx) { + public static function changeSavedSearch(CRM_Queue_TaskContext $ctx) { $membershipStatuses = array_flip(CRM_Member_PseudoConstant::membershipStatus()); $dao = new CRM_Contact_DAO_SavedSearch(); @@ -459,7 +459,7 @@ ALTER TABLE civicrm_dashboard * @param int $endId * @return bool */ - static function cleanupBackendImageUrls(CRM_Queue_TaskContext $ctx, $startId, $endId) { + public static function cleanupBackendImageUrls(CRM_Queue_TaskContext $ctx, $startId, $endId) { $dao = self::findContactImageUrls($startId, $endId); while ($dao->fetch()) { $imageUrl = str_replace('&', '&', $dao->image_url); @@ -516,7 +516,7 @@ AND image_URL IS NOT NULL * * @return bool TRUE for success */ - static function activityContacts(CRM_Queue_TaskContext $ctx) { + public static function activityContacts(CRM_Queue_TaskContext $ctx) { $upgrade = new CRM_Upgrade_Form(); $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); @@ -626,7 +626,7 @@ WHERE source_contact_id IS NOT NULL"; * @return bool TRUE for success * @see http://issues.civicrm.org/jira/browse/CRM-13187 */ - static function wordReplacements(CRM_Queue_TaskContext $ctx) { + public static function wordReplacements(CRM_Queue_TaskContext $ctx) { $query = " CREATE TABLE IF NOT EXISTS `civicrm_word_replacement` ( `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Word replacement ID', @@ -658,7 +658,7 @@ CREATE TABLE IF NOT EXISTS `civicrm_word_replacement` ( * @return bool TRUE for success * @see http://issues.civicrm.org/jira/browse/CRM-13655 */ - static function wordReplacements_patch(CRM_Queue_TaskContext $ctx, $rev) { + public static function wordReplacements_patch(CRM_Queue_TaskContext $ctx, $rev) { if (CRM_Core_DAO::checkConstraintExists('civicrm_word_replacement', 'UI_find')) { CRM_Core_DAO::executeQuery("ALTER TABLE civicrm_word_replacement DROP FOREIGN KEY FK_civicrm_word_replacement_domain_id;"); CRM_Core_DAO::executeQuery("ALTER TABLE civicrm_word_replacement DROP KEY FK_civicrm_word_replacement_domain_id;"); @@ -674,7 +674,7 @@ CREATE TABLE IF NOT EXISTS `civicrm_word_replacement` ( /** * (Queue Task Callback) */ - static function task_4_4_x_runSql(CRM_Queue_TaskContext $ctx, $rev) { + public static function task_4_4_x_runSql(CRM_Queue_TaskContext $ctx, $rev) { $upgrade = new CRM_Upgrade_Form(); $upgrade->processSQL($rev); @@ -719,7 +719,7 @@ CREATE TABLE IF NOT EXISTS `civicrm_word_replacement` ( * @return array Each item is $params for WordReplacement.create * @see CRM_Core_BAO_WordReplacement::convertConfigArraysToAPIParams */ - static function getConfigArraysAsAPIParams($rebuildEach) { + public static function getConfigArraysAsAPIParams($rebuildEach) { $wordReplacementCreateParams = array(); // get all domains $result = civicrm_api3('domain', 'get', array( @@ -814,7 +814,7 @@ CREATE TABLE IF NOT EXISTS `civicrm_word_replacement` ( * @param array $params * @return bool TRUE if $params is valid */ - static function isValidWordReplacement($params) { + public static function isValidWordReplacement($params) { $result = strlen($params['find_word']) <= self::MAX_WORD_REPLACEMENT_SIZE && strlen($params['replace_word']) <= self::MAX_WORD_REPLACEMENT_SIZE; if (!$result) { CRM_Core_Error::debug_var('invalidWordReplacement', $params); diff --git a/CRM/Upgrade/Incremental/php/FourOne.php b/CRM/Upgrade/Incremental/php/FourOne.php index 63795bd932..da15a78bb7 100644 --- a/CRM/Upgrade/Incremental/php/FourOne.php +++ b/CRM/Upgrade/Incremental/php/FourOne.php @@ -41,7 +41,7 @@ class CRM_Upgrade_Incremental_php_FourOne { * * @return bool */ - function verifyPreDBstate(&$errors) { + public function verifyPreDBstate(&$errors) { $config = CRM_Core_Config::singleton(); if (in_array('CiviCase', $config->enableComponents)) { if (!CRM_Core_DAO::checkTriggerViewPermission(TRUE, FALSE)) { @@ -61,7 +61,7 @@ class CRM_Upgrade_Incremental_php_FourOne { * * @return void */ - function setPostUpgradeMessage(&$postUpgradeMessage, $rev) { + public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) { if ($rev == '4.1.alpha1') { $postUpgradeMessage .= '
' . ts('WARNING! CiviCRM 4.1 introduces an improved way of handling cron jobs. However the new method is NOT backwards compatible. Please notify your system administrator that all CiviCRM related cron jobs will cease to work, and will need to be re-configured (this includes sending CiviMail mailings, updating membership statuses, etc.). Refer to the online documentation for detailed instructions.', array(1 => 'http://wiki.civicrm.org/confluence/display/CRMDOC41/Managing+Scheduled+Jobs')); @@ -79,7 +79,7 @@ class CRM_Upgrade_Incremental_php_FourOne { /** * @param $rev */ - function upgrade_4_1_alpha1($rev) { + public function upgrade_4_1_alpha1($rev) { $config = CRM_Core_Config::singleton(); if (in_array('CiviCase', $config->enableComponents)) { if (!CRM_Case_BAO_Case::createCaseViews()) { @@ -116,7 +116,7 @@ class CRM_Upgrade_Incremental_php_FourOne { CRM_Core_BAO_Navigation::resetNavigation(); } - function transferPreferencesToSettings() { + public function transferPreferencesToSettings() { // first transfer system preferences $domainColumnNames = array( CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME => array( @@ -214,7 +214,7 @@ VALUES CRM_Core_DAO::executeQuery($sql); } - function createNewSettings() { + public function createNewSettings() { $domainColumns = array( CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME => array( array('contact_ajax_check_similar', 1), @@ -294,7 +294,7 @@ VALUES /** * @param array $params */ - static function retrieveDirectoryAndURLPaths(&$params) { + public static function retrieveDirectoryAndURLPaths(&$params) { $sql = " SELECT v.name as valueName, v.value, g.name as optionName @@ -322,7 +322,7 @@ AND v.is_active = 1 /** * @param $rev */ - function upgrade_4_1_alpha2($rev) { + public function upgrade_4_1_alpha2($rev) { $dao = new CRM_Core_DAO_Setting(); $dao->group_name = 'Directory Preferences'; $dao->name = 'customTemplateDir'; @@ -342,7 +342,7 @@ AND v.is_active = 1 /** * @param $rev */ - function upgrade_4_1_beta1($rev) { + public function upgrade_4_1_beta1($rev) { //CRM-9311 $groupNames = array('directory_preferences', 'url_preferences'); foreach ($groupNames as $groupName) { @@ -413,7 +413,7 @@ AND v.is_active = 1 /** * @param $rev */ - function upgrade_4_1_1($rev) { + public function upgrade_4_1_1($rev) { $upgrade = new CRM_Upgrade_Form(); $upgrade->assign('addDedupeEmail', !(CRM_Core_DAO::checkFieldExists('civicrm_mailing', 'dedupe_email'))); @@ -426,7 +426,7 @@ AND v.is_active = 1 /** * @return string */ - function getTemplateMessage() { + public function getTemplateMessage() { return "Blah"; } } diff --git a/CRM/Upgrade/Incremental/php/FourSix.php b/CRM/Upgrade/Incremental/php/FourSix.php index d9a76bef15..ece18192ae 100644 --- a/CRM/Upgrade/Incremental/php/FourSix.php +++ b/CRM/Upgrade/Incremental/php/FourSix.php @@ -39,7 +39,7 @@ class CRM_Upgrade_Incremental_php_FourSix { * * @return bool */ - function verifyPreDBstate(&$errors) { + public function verifyPreDBstate(&$errors) { return TRUE; } @@ -55,7 +55,7 @@ class CRM_Upgrade_Incremental_php_FourSix { * * @return void */ - function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL) { + public function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL) { } /** @@ -65,7 +65,7 @@ class CRM_Upgrade_Incremental_php_FourSix { * @param $rev string, an intermediate version; note that setPostUpgradeMessage is called repeatedly with different $revs * @return void */ - function setPostUpgradeMessage(&$postUpgradeMessage, $rev) { + public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) { if ($rev == '4.6.alpha1') { $postUpgradeMessage .= '

' . ts('Default versions of the following System Workflow Message Templates have been modified to handle new functionality:
  • Events - Registration Confirmation and Receipt (on-line)
  • Events - Registration Confirmation and Receipt (off-line)
  • Contributions - Receipt (on-line)
  • Contributions - Receipt (off-line)
  • Memberships - Receipt (on-line)
  • Memberships - Signup and Renewal Receipts (off-line)
If you have modified these templates, please review the new default versions and implement updates as needed to your copies (Administer > Communications > Message Templates > System Workflow Messages).'); } @@ -76,7 +76,7 @@ class CRM_Upgrade_Incremental_php_FourSix { /** * (Queue Task Callback) */ - static function task_4_6_x_runSql(CRM_Queue_TaskContext $ctx, $rev) { + public static function task_4_6_x_runSql(CRM_Queue_TaskContext $ctx, $rev) { $upgrade = new CRM_Upgrade_Form(); $upgrade->processSQL($rev); diff --git a/CRM/Upgrade/Incremental/php/FourThree.php b/CRM/Upgrade/Incremental/php/FourThree.php index c27058fddc..9ddd537d42 100644 --- a/CRM/Upgrade/Incremental/php/FourThree.php +++ b/CRM/Upgrade/Incremental/php/FourThree.php @@ -40,7 +40,7 @@ class CRM_Upgrade_Incremental_php_FourThree { * * @return bool */ - function verifyPreDBstate(&$errors) { + public function verifyPreDBstate(&$errors) { return TRUE; } @@ -56,7 +56,7 @@ class CRM_Upgrade_Incremental_php_FourThree { * * @return void|bool */ - function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL) { + public function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL) { if ($rev == '4.3.beta3') { //CRM-12084 //sql for checking orphaned contribution records @@ -118,7 +118,7 @@ WHERE {$key}.id IS NULL"; * @param $rev string, an intermediate version; note that setPostUpgradeMessage is called repeatedly with different $revs * @return void */ - function setPostUpgradeMessage(&$postUpgradeMessage, $rev) { + public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) { if ($rev == '4.3.alpha1') { // check if CiviMember component is enabled $config = CRM_Core_Config::singleton(); @@ -245,7 +245,7 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0'); * * @return bool */ - function upgrade_4_3_alpha1($rev) { + public function upgrade_4_3_alpha1($rev) { self::task_4_3_alpha1_checkDBConstraints(); // add indexes for civicrm_entity_financial_trxn @@ -283,7 +283,7 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0'); /** * @param $rev */ - function upgrade_4_3_alpha2($rev) { + public function upgrade_4_3_alpha2($rev) { //CRM-11847 $isColumnPresent = CRM_Core_DAO::checkFieldExists('civicrm_dedupe_rule_group', 'is_default'); if ($isColumnPresent) { @@ -295,14 +295,14 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0'); /** * @param $rev */ - function upgrade_4_3_alpha3($rev) { + public function upgrade_4_3_alpha3($rev) { $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.alpha3')), 'task_4_3_x_runSql', $rev); } /** * @param $rev */ - function upgrade_4_3_beta2($rev) { + public function upgrade_4_3_beta2($rev) { $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.beta2')), 'task_4_3_x_runSql', $rev); // CRM-12002 @@ -317,7 +317,7 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0'); /** * @param $rev */ - function upgrade_4_3_beta3($rev) { + public function upgrade_4_3_beta3($rev) { $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.beta3')), 'task_4_3_x_runSql', $rev); // CRM-12065 $query = "SELECT id, form_values FROM civicrm_report_instance WHERE form_values LIKE '%contribution_type%'"; @@ -329,7 +329,7 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0'); /** * @param $rev */ - function upgrade_4_3_beta4($rev) { + public function upgrade_4_3_beta4($rev) { $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.beta4')), 'task_4_3_x_runSql', $rev); // add indexes for civicrm_entity_financial_trxn // CRM-12141 @@ -339,7 +339,7 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0'); /** * @param $rev */ - function upgrade_4_3_beta5($rev) { + public function upgrade_4_3_beta5($rev) { // CRM-12205 if ( CRM_Core_DAO::checkTableExists('log_civicrm_financial_trxn') && @@ -366,14 +366,14 @@ ADD COLUMN premiums_nothankyou_label varchar(255) COLLATE utf8_unicode_ci DEFA /** * @param $rev */ - function upgrade_4_3_4($rev) { + public function upgrade_4_3_4($rev) { $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.4')), 'task_4_3_x_runSql', $rev); } /** * @param $rev */ - function upgrade_4_3_5($rev) { + public function upgrade_4_3_5($rev) { // CRM-12156 $config = CRM_Core_Config::singleton(); $dbname = DB::parseDSN($config->dsn); @@ -401,7 +401,7 @@ ADD CONSTRAINT `FK_civicrm_financial_item_contact_id` FOREIGN KEY (`contact_id`) /** * @param $rev */ - function upgrade_4_3_6($rev) { + public function upgrade_4_3_6($rev) { //CRM-13094 $this->addTask(ts('Add missing constraints'), 'addMissingConstraints', $rev); //CRM-13088 @@ -417,7 +417,7 @@ ADD CONSTRAINT `FK_civicrm_financial_item_contact_id` FOREIGN KEY (`contact_id`) /** * @return bool */ - function assignFinancialTypeToPriceRecords() { + public function assignFinancialTypeToPriceRecords() { $upgrade = new CRM_Upgrade_Form(); //here we update price set entries $sqlFinancialIds = " @@ -461,7 +461,7 @@ INNER JOIN civicrm_price_set ps ON (pf.price_set_id = ps.id) /** * @return bool */ - static function _checkAndMigrateDefaultFinancialTypes() { + public static function _checkAndMigrateDefaultFinancialTypes() { $modifiedDefaults = FALSE; //insert types if not exists $sqlFetchTypes = " @@ -493,7 +493,7 @@ ON DUPLICATE KEY UPDATE is_active = 1 /** * @return bool */ - function createFinancialRecords() { + public function createFinancialRecords() { $upgrade = new CRM_Upgrade_Form(); // update civicrm_entity_financial_trxn.amount = civicrm_financial_trxn.total_amount @@ -837,7 +837,7 @@ FROM civicrm_financial_item fi"; /** * @return array */ - function createDomainContacts() { + public function createDomainContacts() { $domainParams = $context = array(); $query = " ALTER TABLE civicrm_domain ADD contact_id INT( 10 ) UNSIGNED NULL DEFAULT NULL COMMENT 'FK to Contact ID. This is specifically not an FK to avoid circular constraints', @@ -884,7 +884,7 @@ WHERE cc.contact_type = 'Organization' AND cc.organization_name = %1 return $context; } - function task_4_3_alpha1_checkDBConstraints() { + public function task_4_3_alpha1_checkDBConstraints() { //checking whether the foreign key exists before dropping it CRM-11260 $config = CRM_Core_Config::singleton(); $dbUf = DB::parseDSN($config->dsn); @@ -936,7 +936,7 @@ ALTER TABLE civicrm_financial_account * Read creation and modification times from civicrm_log; add * them to civicrm_contact. */ - function convertTimestamps(CRM_Queue_TaskContext $ctx, $startId, $endId) { + public function convertTimestamps(CRM_Queue_TaskContext $ctx, $startId, $endId) { $sql = " SELECT entity_id, min(modified_date) AS created, max(modified_date) AS modified FROM civicrm_log @@ -967,7 +967,7 @@ ALTER TABLE civicrm_financial_account /** * Change index and add missing constraints for civicrm_contribution_recur */ - function addMissingConstraints(CRM_Queue_TaskContext $ctx) { + public function addMissingConstraints(CRM_Queue_TaskContext $ctx) { $query = "SHOW KEYS FROM `civicrm_contribution_recur` WHERE key_name = 'UI_contrib_payment_instrument_id'"; $dao = CRM_Core_DAO::executeQuery($query); if ($dao->N) { @@ -999,7 +999,7 @@ ALTER TABLE civicrm_financial_account * CRM-12844 * */ - function updateFinancialTrxnData(CRM_Queue_TaskContext $ctx) { + public function updateFinancialTrxnData(CRM_Queue_TaskContext $ctx) { $upgrade = new CRM_Upgrade_Form(); $sql = "SELECT cc.id contribution_id, cc.contribution_recur_id, cft.payment_processor_id, cft.id financial_trxn_id, cfi.entity_table, cft.from_financial_account_id, cft.to_financial_account_id @@ -1061,7 +1061,7 @@ id IN (' . implode(',', $val) . ')'; * CRM-12844 * */ - function updateLineItemData(CRM_Queue_TaskContext $ctx) { + public function updateLineItemData(CRM_Queue_TaskContext $ctx) { $sql = "SELECT cc.id contribution_id, cc.contribution_recur_id, cc.financial_type_id contribution_financial_type, cli.financial_type_id line_financial_type_id, @@ -1125,7 +1125,7 @@ AND cli.entity_table = 'civicrm_contribution' AND cli.id IN (" . implode(',', $v * Replace contribution_type to financial_type in table * civicrm_saved_search and Structure civicrm_report_instance */ - function replaceContributionTypeId(CRM_Queue_TaskContext $ctx, $query, $table) { + public function replaceContributionTypeId(CRM_Queue_TaskContext $ctx, $query, $table) { $dao = CRM_Core_DAO::executeQuery($query); while ($dao->fetch()) { $formValues = unserialize($dao->form_values); @@ -1205,7 +1205,7 @@ AND cli.entity_table = 'civicrm_contribution' AND cli.id IN (" . implode(',', $v * * @return bool TRUE for success */ - function task_4_3_x_checkConstraints(CRM_Queue_TaskContext $ctx) { + public function task_4_3_x_checkConstraints(CRM_Queue_TaskContext $ctx) { CRM_Core_DAO::executeQuery('ALTER TABLE `civicrm_financial_account` CHANGE `contact_id` `contact_id` INT( 10 ) UNSIGNED NULL DEFAULT NULL'); $config = CRM_Core_Config::singleton(); $dbname = DB::parseDSN($config->dsn); @@ -1264,7 +1264,7 @@ AND CONSTRAINT_SCHEMA = %1"; * * @return bool TRUE for success */ - function task_4_3_x_checkIndexes(CRM_Queue_TaskContext $ctx) { + public function task_4_3_x_checkIndexes(CRM_Queue_TaskContext $ctx) { $query = " SHOW KEYS FROM civicrm_entity_financial_trxn @@ -1289,7 +1289,7 @@ ADD INDEX UI_entity_financial_trxn_entity_id (entity_id); * * @return bool TRUE for success */ - static function phoneNumeric(CRM_Queue_TaskContext $ctx) { + public static function phoneNumeric(CRM_Queue_TaskContext $ctx) { CRM_Core_DAO::executeQuery(CRM_Contact_BAO_Contact::DROP_STRIP_FUNCTION_43); CRM_Core_DAO::executeQuery(CRM_Contact_BAO_Contact::CREATE_STRIP_FUNCTION_43); CRM_Core_DAO::executeQuery("UPDATE civicrm_phone SET phone_numeric = civicrm_strip_non_numeric(phone)"); @@ -1299,7 +1299,7 @@ ADD INDEX UI_entity_financial_trxn_entity_id (entity_id); /** * (Queue Task Callback) */ - static function task_4_3_x_runSql(CRM_Queue_TaskContext $ctx, $rev) { + public static function task_4_3_x_runSql(CRM_Queue_TaskContext $ctx, $rev) { $upgrade = new CRM_Upgrade_Form(); $upgrade->processSQL($rev); diff --git a/CRM/Upgrade/Incremental/php/FourTwo.php b/CRM/Upgrade/Incremental/php/FourTwo.php index 66906836ec..3dc6f96b35 100644 --- a/CRM/Upgrade/Incremental/php/FourTwo.php +++ b/CRM/Upgrade/Incremental/php/FourTwo.php @@ -42,7 +42,7 @@ class CRM_Upgrade_Incremental_php_FourTwo { * * @return bool */ - function verifyPreDBstate(&$errors) { + public function verifyPreDBstate(&$errors) { return TRUE; } @@ -58,7 +58,7 @@ class CRM_Upgrade_Incremental_php_FourTwo { * * @return void */ - function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL) { + public function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL) { if ($rev == '4.2.alpha1') { $tables = array('civicrm_contribution_page','civicrm_event','civicrm_group','civicrm_contact'); if (!CRM_Core_DAO::schemaRequiresRebuilding($tables)){ @@ -150,7 +150,7 @@ INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'de * @param $rev string, an intermediate version; note that setPostUpgradeMessage is called repeatedly with different $revs * @return void */ - function setPostUpgradeMessage(&$postUpgradeMessage, $rev) { + public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) { if ($rev == '4.2.beta5') { $config = CRM_Core_Config::singleton(); if (!empty($config->extensionsDir)) { @@ -167,7 +167,7 @@ INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'de /** * @param $rev */ - function upgrade_4_2_alpha1($rev) { + public function upgrade_4_2_alpha1($rev) { //checking whether the foreign key exists before dropping it //drop foreign key queries of CRM-9850 $params = array(); @@ -213,7 +213,7 @@ INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'de /** * @param $rev */ - function upgrade_4_2_beta2($rev) { + public function upgrade_4_2_beta2($rev) { // note: error conditions are also checked in setPreUpgradeMessage() if (defined('CIVICRM_SETTINGS_PATH')) { if (!preg_match(self::SETTINGS_SNIPPET_PATTERN, file_get_contents(CIVICRM_SETTINGS_PATH))) { @@ -227,7 +227,7 @@ INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'de /** * @param $rev */ - function upgrade_4_2_beta3($rev) { + public function upgrade_4_2_beta3($rev) { $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.2.beta3')), 'task_4_2_x_runSql', $rev); $minParticipantId = CRM_Core_DAO::singleValueQuery('SELECT coalesce(min(id),0) FROM civicrm_participant'); $maxParticipantId = CRM_Core_DAO::singleValueQuery('SELECT coalesce(max(id),0) FROM civicrm_participant'); @@ -242,7 +242,7 @@ INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'de /** * @param $rev */ - function upgrade_4_2_beta5($rev) { + public function upgrade_4_2_beta5($rev) { // CRM-10629 Create a setting for extension URLs // For some reason, this isn't working when placed in the .sql file CRM_Core_DAO::executeQuery(" @@ -254,14 +254,14 @@ INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'de /** * @param $rev */ - function upgrade_4_2_0($rev) { + public function upgrade_4_2_0($rev) { $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.2.0')), 'task_4_2_x_runSql', $rev); } /** * @param $rev */ - function upgrade_4_2_2($rev) { + public function upgrade_4_2_2($rev) { $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.2.2')), 'task_4_2_x_runSql', $rev); //create line items for memberships and participants for api/import self::convertContribution(); @@ -301,7 +301,7 @@ INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'de /** * @param $rev */ - function upgrade_4_2_3($rev) { + public function upgrade_4_2_3($rev) { $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.2.3')), 'task_4_2_x_runSql', $rev); // CRM-10953 Remove duplicate activity type for 'Reminder Sent' which is mistakenly inserted by 4.2.alpha1 upgrade script $queryMin = " @@ -343,7 +343,7 @@ DELETE from civicrm_option_value /** * @param $rev */ - function upgrade_4_2_5($rev) { + public function upgrade_4_2_5($rev) { $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.2.5')), 'task_4_2_x_runSql', $rev); //CRM-11077 $sql = " SELECT cpse.entity_id, cpse.price_set_id @@ -363,7 +363,7 @@ HAVING COUNT(cpse.price_set_id) > 1 AND MIN(cpse1.id) <> cpse.id "; } } - function convertContribution(){ + public function convertContribution(){ $minContributionId = CRM_Core_DAO::singleValueQuery('SELECT coalesce(min(id),0) FROM civicrm_contribution'); $maxContributionId = CRM_Core_DAO::singleValueQuery('SELECT coalesce(max(id),0) FROM civicrm_contribution'); for ($startId = $minContributionId; $startId <= $maxContributionId; $startId += self::BATCH_SIZE) { @@ -386,7 +386,7 @@ HAVING COUNT(cpse.price_set_id) > 1 AND MIN(cpse1.id) <> cpse.id "; * * Upgrade code to create priceset for contribution pages and events */ - static function task_4_2_alpha1_createPriceSets(CRM_Queue_TaskContext $ctx, $rev) { + public static function task_4_2_alpha1_createPriceSets(CRM_Queue_TaskContext $ctx, $rev) { $upgrade = new CRM_Upgrade_Form(); $daoName = array( 'civicrm_contribution_page' => array( @@ -436,7 +436,7 @@ WHERE cpse.price_set_id IS NULL"; /** * (Queue Task Callback) */ - static function task_4_2_x_runSql(CRM_Queue_TaskContext $ctx, $rev) { + public static function task_4_2_x_runSql(CRM_Queue_TaskContext $ctx, $rev) { $upgrade = new CRM_Upgrade_Form(); $upgrade->processSQL($rev); @@ -451,7 +451,7 @@ WHERE cpse.price_set_id IS NULL"; * * create price sets */ - static function createPriceSet($daoName, $addTo, $options = array()) { + public static function createPriceSet($daoName, $addTo, $options = array()) { $query = "SELECT title FROM {$addTo[0]} where id =%1"; $setParams['title'] = CRM_Core_DAO::singleValueQuery($query, array(1 => array($addTo[2], 'Integer')) @@ -592,7 +592,7 @@ WHERE cpse.price_set_id IS NULL"; * * @return bool */ - static function task_4_2_alpha1_convertContributions(CRM_Queue_TaskContext $ctx, $startId, $endId) { + public static function task_4_2_alpha1_convertContributions(CRM_Queue_TaskContext $ctx, $startId, $endId) { $upgrade = new CRM_Upgrade_Form(); $query = " INSERT INTO civicrm_line_item(`entity_table` ,`entity_id` ,`price_field_id` ,`label` , `qty` ,`unit_price` ,`line_total` ,`participant_count` ,`price_field_value_id`) @@ -738,7 +738,7 @@ WHERE cpf.price_set_id = %1 * * @return bool */ - static function task_4_2_alpha1_convertParticipants(CRM_Queue_TaskContext $ctx, $startId, $endId) { + public static function task_4_2_alpha1_convertParticipants(CRM_Queue_TaskContext $ctx, $startId, $endId) { $upgrade = new CRM_Upgrade_Form(); //create lineitems for participant in edge cases using default price set for contribution. $query = " @@ -793,7 +793,7 @@ AND cli.entity_id IS NULL AND cp.fee_amount IS NOT NULL"; * * Create an event registration profile with a single email field CRM-9587 */ - static function task_4_2_alpha1_eventProfile(CRM_Queue_TaskContext $ctx) { + public static function task_4_2_alpha1_eventProfile(CRM_Queue_TaskContext $ctx) { $upgrade = new CRM_Upgrade_Form(); $profileTitle = ts('Your Registration Info'); diff --git a/CRM/Upgrade/Incremental/php/FourZero.php b/CRM/Upgrade/Incremental/php/FourZero.php index a33a02ee23..16888f6bf4 100644 --- a/CRM/Upgrade/Incremental/php/FourZero.php +++ b/CRM/Upgrade/Incremental/php/FourZero.php @@ -38,14 +38,14 @@ class CRM_Upgrade_Incremental_php_FourZero { * * @return bool */ - function verifyPreDBstate(&$errors) { + public function verifyPreDBstate(&$errors) { return TRUE; } /** * @param $rev */ - function upgrade_4_0_alpha1($rev) { + public function upgrade_4_0_alpha1($rev) { // do nothing, db is already upgraded to 3.4.alpha1. } } diff --git a/CRM/Upgrade/Incremental/php/ThreeFour.php b/CRM/Upgrade/Incremental/php/ThreeFour.php index c5714abe50..5e17121d47 100644 --- a/CRM/Upgrade/Incremental/php/ThreeFour.php +++ b/CRM/Upgrade/Incremental/php/ThreeFour.php @@ -37,14 +37,14 @@ class CRM_Upgrade_Incremental_php_ThreeFour { * * @return bool */ - function verifyPreDBstate(&$errors) { + public function verifyPreDBstate(&$errors) { return TRUE; } /** * @param $rev */ - function upgrade_3_4_alpha3($rev) { + public function upgrade_3_4_alpha3($rev) { // CRM-7681, update report instance criteria. $modifiedReportIds = array('contact/summary', 'contact/detail', 'event/participantListing', 'member/summary', 'pledge/summary', 'pledge/pbnp', 'member/detail', 'member/lapse', 'grant/detail', 'contribute/bookkeeping', 'contribute/lybunt', 'contribute/summary', 'contribute/repeat', 'contribute/detail', 'contribute/organizationSummary', 'contribute/sybunt', 'contribute/householdSummary', 'contact/relationship', 'contact/currentEmployer', 'case/demographics', 'walklist', 'case/detail', 'contact/log', 'activitySummary', 'case/timespent', 'case/summary'); @@ -110,7 +110,7 @@ class CRM_Upgrade_Incremental_php_ThreeFour { /** * @param $rev */ - function upgrade_3_4_beta2($rev) { + public function upgrade_3_4_beta2($rev) { $addPetitionOptionGroup = !(boolean) CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'msg_tpl_workflow_petition', 'id', 'name'); $upgrade = new CRM_Upgrade_Form(); $upgrade->assign('addPetitionOptionGroup', $addPetitionOptionGroup); @@ -120,7 +120,7 @@ class CRM_Upgrade_Incremental_php_ThreeFour { /** * @param $rev */ - function upgrade_3_4_beta3($rev) { + public function upgrade_3_4_beta3($rev) { // do the regular upgrade $upgrade = new CRM_Upgrade_Form; $upgrade->processSQL($rev); @@ -147,7 +147,7 @@ class CRM_Upgrade_Incremental_php_ThreeFour { /** * @param $rev */ - function upgrade_3_4_3($rev) { + public function upgrade_3_4_3($rev) { // CRM-8147, update group_type for uf groups, check and add component field types $ufGroups = new CRM_Core_DAO_UFGroup(); $ufGroups->find(); @@ -191,7 +191,7 @@ INSERT INTO civicrm_location_type ( name, description, is_reserved, is_active ) /** * @param $rev */ - function upgrade_3_4_4($rev) { + public function upgrade_3_4_4($rev) { // CRM-8315, update report instance criteria. $modifiedReportIds = array('member/summary', 'member/detail'); @@ -227,7 +227,7 @@ INSERT INTO civicrm_location_type ( name, description, is_reserved, is_active ) /** * @param $rev */ - function upgrade_3_4_5($rev) { + public function upgrade_3_4_5($rev) { // handle db changes done for CRM-8218 $alterContactDashboard = FALSE; $dao = new CRM_Contact_DAO_DashboardContact(); @@ -251,7 +251,7 @@ INSERT INTO civicrm_location_type ( name, description, is_reserved, is_active ) /** * @param $rev */ - function upgrade_3_4_6($rev) { + public function upgrade_3_4_6($rev) { $modifiedReportIds = array('event/summary', 'activity', 'Mailing/bounce', 'Mailing/clicks', 'Mailing/opened'); $instances = CRM_Core_DAO::executeQuery("SELECT id, form_values, report_id FROM civicrm_report_instance WHERE report_id IN ('" . implode("','", $modifiedReportIds) . "')"); @@ -331,7 +331,7 @@ WHERE v.option_group_id = g.id * * @throws Exception */ - function upgrade_3_4_7($rev) { + public function upgrade_3_4_7($rev) { $onBehalfProfileId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', 'on_behalf_organization', 'id', 'name'); if (!$onBehalfProfileId) { CRM_Core_Error::fatal(); diff --git a/CRM/Upgrade/Incremental/php/ThreeThree.php b/CRM/Upgrade/Incremental/php/ThreeThree.php index e1bbb249b3..023c44ce1e 100644 --- a/CRM/Upgrade/Incremental/php/ThreeThree.php +++ b/CRM/Upgrade/Incremental/php/ThreeThree.php @@ -38,14 +38,14 @@ class CRM_Upgrade_Incremental_php_ThreeThree { * * @return bool */ - function verifyPreDBstate(&$errors) { + public function verifyPreDBstate(&$errors) { return TRUE; } /** * @param $rev */ - function upgrade_3_3_alpha1($rev) { + public function upgrade_3_3_alpha1($rev) { $config = CRM_Core_Config::singleton(); if ($config->userSystem->is_drupal) { // CRM-6426 - make civicrm profiles permissioned on drupal my account @@ -137,7 +137,7 @@ WHERE id = %2 /** * @param $rev */ - function upgrade_3_3_beta1($rev) { + public function upgrade_3_3_beta1($rev) { $upgrade = new CRM_Upgrade_Form(); $upgrade->processSQL($rev); @@ -254,7 +254,7 @@ WHERE id = %2 /** * @param $rev */ - function upgrade_3_3_beta3($rev) { + public function upgrade_3_3_beta3($rev) { // get the duplicate Ids of line item entries $dupeLineItemIds = array(); $fields = array('entity_table', 'entity_id', 'price_field_id', 'price_field_value_id'); @@ -285,7 +285,7 @@ WHERE id = %2 /** * @param $rev */ - function upgrade_3_3_0($rev) { + public function upgrade_3_3_0($rev) { $upgrade = new CRM_Upgrade_Form(); $upgrade->processSQL($rev); @@ -325,7 +325,7 @@ INNER JOIN civicrm_option_group grp ON ( grp.id = val.option_group_id ) /** * @param $rev */ - function upgrade_3_3_2($rev) { + public function upgrade_3_3_2($rev) { $dropMailingIndex = FALSE; $indexes = CRM_Core_DAO::executeQuery('SHOW INDEXES FROM civicrm_mailing_job'); while ($indexes->fetch()) { @@ -370,7 +370,7 @@ INNER JOIN civicrm_option_group grp ON ( grp.id = val.option_group_id ) /** * @param $rev */ - function upgrade_3_3_7($rev) { + public function upgrade_3_3_7($rev) { $dao = new CRM_Contact_DAO_Contact(); $dbName = $dao->_database; diff --git a/CRM/Upgrade/Incremental/php/ThreeTwo.php b/CRM/Upgrade/Incremental/php/ThreeTwo.php index d80bfce33a..05902be292 100644 --- a/CRM/Upgrade/Incremental/php/ThreeTwo.php +++ b/CRM/Upgrade/Incremental/php/ThreeTwo.php @@ -37,14 +37,14 @@ class CRM_Upgrade_Incremental_php_ThreeTwo { * * @return bool */ - function verifyPreDBstate(&$errors) { + public function verifyPreDBstate(&$errors) { return TRUE; } /** * @param $rev */ - function upgrade_3_2_alpha1($rev) { + public function upgrade_3_2_alpha1($rev) { //CRM-5666 -if user already have 'access CiviCase' //give all new permissions and drop access CiviCase. $config = CRM_Core_Config::singleton(); @@ -90,7 +90,7 @@ class CRM_Upgrade_Incremental_php_ThreeTwo { /** * @param $rev */ - function upgrade_3_2_beta4($rev) { + public function upgrade_3_2_beta4($rev) { $upgrade = new CRM_Upgrade_Form; $config = CRM_Core_Config::singleton(); @@ -264,7 +264,7 @@ UPDATE civicrm_membership_status /** * @param $rev */ - function upgrade_3_2_1($rev) { + public function upgrade_3_2_1($rev) { //CRM-6565 check if Activity Index is already exists or not. $addActivityTypeIndex = TRUE; $indexes = CRM_Core_DAO::executeQuery('SHOW INDEXES FROM civicrm_activity'); diff --git a/CRM/Upgrade/Page/Upgrade.php b/CRM/Upgrade/Page/Upgrade.php index 99d15e9cdf..b4f84422fa 100644 --- a/CRM/Upgrade/Page/Upgrade.php +++ b/CRM/Upgrade/Page/Upgrade.php @@ -33,11 +33,11 @@ * */ class CRM_Upgrade_Page_Upgrade extends CRM_Core_Page { - function preProcess() { + public function preProcess() { parent::preProcess(); } - function run() { + public function run() { // lets get around the time limit issue if possible for upgrades if (!ini_get('safe_mode')) { set_time_limit(0); @@ -80,7 +80,7 @@ class CRM_Upgrade_Page_Upgrade extends CRM_Core_Page { /** * Display an introductory screen with any pre-upgrade messages */ - function runIntro() { + public function runIntro() { $upgrade = new CRM_Upgrade_Form(); $template = CRM_Core_Smarty::singleton(); list($currentVer, $latestVer) = $upgrade->getUpgradeVersions(); @@ -131,7 +131,7 @@ class CRM_Upgrade_Page_Upgrade extends CRM_Core_Page { /** * Begin the upgrade by building a queue of tasks and redirecting to the queue-runner */ - function runBegin() { + public function runBegin() { $upgrade = new CRM_Upgrade_Form(); list($currentVer, $latestVer) = $upgrade->getUpgradeVersions(); @@ -168,7 +168,7 @@ class CRM_Upgrade_Page_Upgrade extends CRM_Core_Page { /** * Display any final messages, clear caches, etc */ - function runFinish() { + public function runFinish() { $upgrade = new CRM_Upgrade_Form(); $template = CRM_Core_Smarty::singleton(); diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php index 821cc3d31c..33a40449ee 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php @@ -54,7 +54,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field extends CRM_Upgrade_Snapshot_V4p * @access public * @static */ - static function &add(&$params) { + public static function &add(&$params) { $priceFieldBAO = new CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field(); $priceFieldBAO->copyValues($params); @@ -78,7 +78,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field extends CRM_Upgrade_Snapshot_V4p * @access public * @static */ - static function create(&$params) { + public static function create(&$params) { $transaction = new CRM_Core_Transaction(); @@ -163,7 +163,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field extends CRM_Upgrade_Snapshot_V4p * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { return CRM_Core_DAO::commonRetrieve('CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field', $params, $defaults); } @@ -178,7 +178,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field extends CRM_Upgrade_Snapshot_V4p * @access public * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field', $id, 'is_active', $is_active); } @@ -532,7 +532,7 @@ WHERE /** * @return array */ - static function &htmlTypes() { + public static function &htmlTypes() { static $htmlTypes = NULL; if (!$htmlTypes) { $htmlTypes = array( diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/FieldValue.php b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/FieldValue.php index f06a7a3acf..9bcfa1255b 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/FieldValue.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/FieldValue.php @@ -50,7 +50,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho * @access public * @static */ - static function &add(&$params, $ids) { + public static function &add(&$params, $ids) { $fieldValueBAO = new CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue(); $fieldValueBAO->copyValues($params); @@ -79,7 +79,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho * @access public * @static */ - static function create(&$params, $ids) { + public static function create(&$params, $ids) { if (!is_array($params) || empty($params)) { return; @@ -120,7 +120,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { return CRM_Core_DAO::commonRetrieve('CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue', $params, $defaults); } @@ -137,7 +137,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho * @access public * @static */ - static function getValues($fieldId, &$values, $orderBy = 'weight', $isActive = FALSE) { + public static function getValues($fieldId, &$values, $orderBy = 'weight', $isActive = FALSE) { $fieldValueDAO = new CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue(); $fieldValueDAO->price_field_id = $fieldId; $fieldValueDAO->orderBy($orderBy, 'label'); @@ -179,7 +179,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho * @access public * @static */ - static function setIsActive($id, $is_active) { + public static function setIsActive($id, $is_active) { return CRM_Core_DAO::setFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue', $id, 'is_active', $is_active); } @@ -193,7 +193,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho * @access public * @static */ - static function deleteValues($fieldId) { + public static function deleteValues($fieldId) { if (!$fieldId) { return FALSE; } @@ -213,7 +213,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_FieldValue extends CRM_Upgrade_Snapsho * @access public * @static */ - static function del($id) { + public static function del($id) { if (!$id) { return FALSE; } diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/LineItem.php b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/LineItem.php index 4da249a18b..c70dc527f8 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/LineItem.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/LineItem.php @@ -54,7 +54,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_LineItem extends CRM_Upgrade_Snapshot_ * @access public * @static */ - static function create(&$params) { + public static function create(&$params) { //create mode only as we don't support editing line items CRM_Utils_Hook::pre('create', 'LineItem', $params['entity_id'], $params); @@ -82,7 +82,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_LineItem extends CRM_Upgrade_Snapshot_ * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { $lineItem = new CRM_Upgrade_Snapshot_V4p2_Price_BAO_LineItem(); $lineItem->copyValues($params); if ($lineItem->find(TRUE)) { @@ -103,7 +103,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_LineItem extends CRM_Upgrade_Snapshot_ * * @return array of line items */ - static function getLineItems($entityId, $entity = 'participant', $isQuick = NULL) { + public static function getLineItems($entityId, $entity = 'participant', $isQuick = NULL) { $selectClause = $whereClause = $fromClause = NULL; $selectClause = " @@ -181,7 +181,7 @@ WHERE %2.id = %1"; * @return void * @access static */ - static function format($fid, &$params, &$fields, &$values) { + public static function format($fid, &$params, &$fields, &$values) { if (empty($params["price_{$fid}"])) { return; } diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php index 52f35b6964..0faff56175 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php @@ -42,7 +42,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Set extends CRM_Upgrade_Snapshot_V4p2_ /** * Class constructor */ - function __construct() { + public function __construct() { parent::__construct(); } @@ -55,7 +55,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Set extends CRM_Upgrade_Snapshot_V4p2_ * @access public * @static */ - static function create(&$params) { + public static function create(&$params) { $priceSetBAO = new CRM_Upgrade_Snapshot_V4p2_Price_BAO_Set(); $priceSetBAO->copyValues($params); if (self::eventPriceSetDomainID()) { @@ -74,7 +74,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Set extends CRM_Upgrade_Snapshot_V4p2_ * @access public * @static */ - static function retrieve(&$params, &$defaults) { + public static function retrieve(&$params, &$defaults) { return CRM_Core_DAO::commonRetrieve('CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set', $params, $defaults); } @@ -88,7 +88,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Set extends CRM_Upgrade_Snapshot_V4p2_ * @static * @access public */ - static function setIsActive($id, $isActive) { + public static function setIsActive($id, $isActive) { return CRM_Core_DAO::setFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set', $id, 'is_active', $isActive); } @@ -554,7 +554,7 @@ WHERE id = %1"; * * @return bool|false|int|null */ - static function initSet(&$form, $id, $entityTable = 'civicrm_event', $validOnly = FALSE, $priceSetId = NULL) { + public static function initSet(&$form, $id, $entityTable = 'civicrm_event', $validOnly = FALSE, $priceSetId = NULL) { if (!$priceSetId) { $priceSetId = self::getFor($entityTable, $id); } @@ -651,7 +651,7 @@ WHERE id = %1"; * @param array $params * @param $lineItem */ - static function processAmount(&$fields, &$params, &$lineItem) { + public static function processAmount(&$fields, &$params, &$lineItem) { // using price set $totalPrice = 0; $radioLevel = $checkboxLevel = $selectLevel = $textLevel = array(); @@ -1114,7 +1114,7 @@ return 0; /** * @return object */ - static function eventPriceSetDomainID() { + public static function eventPriceSetDomainID() { return CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME, 'event_price_set_domain_id', NULL, FALSE @@ -1131,7 +1131,7 @@ return 0; * @static * @access public */ - static function setIsQuickConfig($id, $isQuickConfig) { + public static function setIsQuickConfig($id, $isQuickConfig) { return CRM_Core_DAO::setFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set', $id, 'is_quick_config', $isQuickConfig); } } diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Field.php b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Field.php index 3ab10571b5..3c4c5df302 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Field.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Field.php @@ -192,7 +192,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field extends CRM_Core_DAO * @access public * @return \CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field */ - function __construct() + public function __construct() { $this->__table = 'civicrm_price_field'; parent::__construct(); @@ -203,7 +203,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field extends CRM_Core_DAO * @access public * @return array */ - function links() + public function links() { if (!(self::$_links)) { self::$_links = array( @@ -336,7 +336,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field extends CRM_Core_DAO * @static * @return string */ - static function getTableName() + public static function getTableName() { return CRM_Core_DAO::getLocaleTableName(self::$_tableName); } @@ -346,7 +346,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field extends CRM_Core_DAO * @access public * @return boolean */ - function getLog() + public function getLog() { return self::$_log; } @@ -418,7 +418,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field extends CRM_Core_DAO * * @return string the display value of the enum */ - static function tsEnum($field, $value) + public static function tsEnum($field, $value) { static $translations = null; if (!$translations) { @@ -439,7 +439,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field extends CRM_Core_DAO * @param array $values (reference) the array up for enhancing * @return void */ - static function addDisplayEnums(&$values) + public static function addDisplayEnums(&$values) { $enumFields = & Snapshot_v4p2_Price_DAO_Field::getEnums(); foreach($enumFields as $enum) { diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/FieldValue.php b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/FieldValue.php index 89b8d46b47..ce70c98e95 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/FieldValue.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/FieldValue.php @@ -163,7 +163,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue extends CRM_Core_DAO * @access public * @return \CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue */ - function __construct() + public function __construct() { $this->__table = 'civicrm_price_field_value'; parent::__construct(); @@ -174,7 +174,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue extends CRM_Core_DAO * @access public * @return array */ - function links() + public function links() { if (!(self::$_links)) { self::$_links = array( @@ -279,7 +279,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue extends CRM_Core_DAO * @static * @return string */ - static function getTableName() + public static function getTableName() { return CRM_Core_DAO::getLocaleTableName(self::$_tableName); } @@ -289,7 +289,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue extends CRM_Core_DAO * @access public * @return boolean */ - function getLog() + public function getLog() { return self::$_log; } diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/LineItem.php b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/LineItem.php index 345485e212..9aabf563bc 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/LineItem.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/LineItem.php @@ -151,7 +151,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_LineItem extends CRM_Core_DAO * @access public * @return \CRM_Upgrade_Snapshot_V4p2_Price_DAO_LineItem */ - function __construct() + public function __construct() { $this->__table = 'civicrm_line_item'; parent::__construct(); @@ -162,7 +162,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_LineItem extends CRM_Core_DAO * @access public * @return array */ - function links() + public function links() { if (!(self::$_links)) { self::$_links = array( @@ -255,7 +255,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_LineItem extends CRM_Core_DAO * @static * @return string */ - static function getTableName() + public static function getTableName() { return self::$_tableName; } @@ -265,7 +265,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_LineItem extends CRM_Core_DAO * @access public * @return boolean */ - function getLog() + public function getLog() { return self::$_log; } diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Set.php b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Set.php index 8c90ce76d9..b6c66e64ef 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Set.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Set.php @@ -163,7 +163,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set extends CRM_Core_DAO * @access public * @return \CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set */ - function __construct() + public function __construct() { $this->__table = 'civicrm_price_set'; parent::__construct(); @@ -174,7 +174,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set extends CRM_Core_DAO * @access public * @return array */ - function links() + public function links() { if (!(self::$_links)) { self::$_links = array( @@ -279,7 +279,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set extends CRM_Core_DAO * @static * @return string */ - static function getTableName() + public static function getTableName() { return CRM_Core_DAO::getLocaleTableName(self::$_tableName); } @@ -289,7 +289,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set extends CRM_Core_DAO * @access public * @return boolean */ - function getLog() + public function getLog() { return self::$_log; } diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/SetEntity.php b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/SetEntity.php index 329f1074ab..92c6d33569 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/SetEntity.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/SetEntity.php @@ -115,7 +115,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_SetEntity extends CRM_Core_DAO * @access public * @return \CRM_Upgrade_Snapshot_V4p2_Price_DAO_SetEntity */ - function __construct() + public function __construct() { $this->__table = 'civicrm_price_set_entity'; parent::__construct(); @@ -126,7 +126,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_SetEntity extends CRM_Core_DAO * @access public * @return array */ - function links() + public function links() { if (!(self::$_links)) { self::$_links = array( @@ -180,7 +180,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_SetEntity extends CRM_Core_DAO * @static * @return string */ - static function getTableName() + public static function getTableName() { return self::$_tableName; } @@ -190,7 +190,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_DAO_SetEntity extends CRM_Core_DAO * @access public * @return boolean */ - function getLog() + public function getLog() { return self::$_log; } diff --git a/CRM/Upgrade/StateMachine.php b/CRM/Upgrade/StateMachine.php index dfbeb535c1..f6408a48fb 100644 --- a/CRM/Upgrade/StateMachine.php +++ b/CRM/Upgrade/StateMachine.php @@ -49,7 +49,7 @@ class CRM_Upgrade_StateMachine extends CRM_Core_StateMachine { * @internal param \CRM_Upgrade_Controller_base $object * @return \CRM_Upgrade_StateMachine CRM_Upgrade_StateMachine_Base */ - function __construct(&$controller, &$pages, $action = CRM_Core_Action::NONE) { + public function __construct(&$controller, &$pages, $action = CRM_Core_Action::NONE) { parent::__construct($controller, $action); $this->_pages = &$pages; diff --git a/CRM/Utils/API/MatchOption.php b/CRM/Utils/API/MatchOption.php index 4fd3b0553e..0542478c67 100644 --- a/CRM/Utils/API/MatchOption.php +++ b/CRM/Utils/API/MatchOption.php @@ -174,7 +174,7 @@ class CRM_Utils_API_MatchOption implements API_Wrapper { * * @return array APIv3 $params */ - function createGetParams($origParams, $keys) { + public function createGetParams($origParams, $keys) { $params = array('version' => 3); foreach ($keys as $key) { $params[$key] = CRM_Utils_Array::value($key, $origParams, ''); diff --git a/CRM/Utils/Address.php b/CRM/Utils/Address.php index 00e7bb16d8..3fcd2393d7 100644 --- a/CRM/Utils/Address.php +++ b/CRM/Utils/Address.php @@ -274,7 +274,7 @@ class CRM_Utils_Address { * * @return array */ - static function sequence($format) { + public static function sequence($format) { // also compute and store the address sequence $addressSequence = array( 'address_name', diff --git a/CRM/Utils/Address/BatchUpdate.php b/CRM/Utils/Address/BatchUpdate.php index 3e6b455715..dc3fa4afab 100644 --- a/CRM/Utils/Address/BatchUpdate.php +++ b/CRM/Utils/Address/BatchUpdate.php @@ -122,7 +122,7 @@ class CRM_Utils_Address_BatchUpdate { * @return array * @throws Exception */ - function processContacts(&$config, $processGeocode, $parseStreetAddress) { + public function processContacts(&$config, $processGeocode, $parseStreetAddress) { // build where clause. $clause = array('( c.id = a.contact_id )'); $params = array(); @@ -279,7 +279,7 @@ class CRM_Utils_Address_BatchUpdate { /** * @return array */ - function returnResult() { + public function returnResult() { $result = array(); $result['is_error'] = $this->returnError; $result['messages'] = implode("", $this->returnMessages); diff --git a/CRM/Utils/Address/USPS.php b/CRM/Utils/Address/USPS.php index 21e185d7c9..f16dfeafc1 100644 --- a/CRM/Utils/Address/USPS.php +++ b/CRM/Utils/Address/USPS.php @@ -43,7 +43,7 @@ class CRM_Utils_Address_USPS { * * @return bool */ - static function checkAddress(&$values) { + public static function checkAddress(&$values) { if (!isset($values['street_address']) || (!isset($values['city']) && !isset($values['state_province']) && diff --git a/CRM/Utils/Api.php b/CRM/Utils/Api.php index a2b29b2a93..cd2eda3b21 100644 --- a/CRM/Utils/Api.php +++ b/CRM/Utils/Api.php @@ -37,7 +37,7 @@ class CRM_Utils_Api { * @return string * @throws CRM_Core_Exception */ - static function getEntityName($classNameOrObject) { + public static function getEntityName($classNameOrObject) { require_once 'api/api.php'; $className = is_string($classNameOrObject) ? $classNameOrObject : get_class($classNameOrObject); diff --git a/CRM/Utils/Array.php b/CRM/Utils/Array.php index a8223eed01..b2a193a180 100644 --- a/CRM/Utils/Array.php +++ b/CRM/Utils/Array.php @@ -51,7 +51,7 @@ class CRM_Utils_Array { * @return mixed * Can return any type, since $list might contain anything. */ - static function value($key, $list, $default = NULL) { + public static function value($key, $list, $default = NULL) { if (is_array($list)) { return array_key_exists($key, $list) ? $list[$key] : $default; } @@ -73,7 +73,7 @@ class CRM_Utils_Array { * The value of the key, or null if the key is not found. * @access public */ - static function retrieveValueRecursive(&$params, $key) { + public static function retrieveValueRecursive(&$params, $key) { if (!is_array($params)) { return NULL; } @@ -109,7 +109,7 @@ class CRM_Utils_Array { * @return int|string|null * Returns the key, which could be an int or a string, or NULL on failure. */ - static function key($value, &$list) { + public static function key($value, &$list) { if (is_array($list)) { $key = array_search($value, $list); @@ -140,7 +140,7 @@ class CRM_Utils_Array { * @return string * XML fragment representing $list. */ - static function &xml(&$list, $depth = 1, $seperator = "\n") { + public static function &xml(&$list, $depth = 1, $seperator = "\n") { $xml = ''; foreach ($list as $name => $value) { $xml .= str_repeat(' ', $depth * 4); @@ -171,7 +171,7 @@ class CRM_Utils_Array { * @return string * Sanitized version of $value. */ - static function escapeXML($value) { + public static function escapeXML($value) { static $src = NULL; static $dst = NULL; @@ -238,7 +238,7 @@ class CRM_Utils_Array { * * @access public */ - static function flatten(&$list, &$flat, $prefix = '', $seperator = ".") { + public static function flatten(&$list, &$flat, $prefix = '', $seperator = ".") { foreach ($list as $name => $value) { $newPrefix = ($prefix) ? $prefix . $seperator . $name : $name; if (is_array($value)) { @@ -267,7 +267,7 @@ class CRM_Utils_Array { * * @access public */ - function unflatten($delim, &$arr) { + public function unflatten($delim, &$arr) { $result = array(); foreach ($arr as $key => $value) { $path = explode($delim, $key); @@ -303,7 +303,7 @@ class CRM_Utils_Array { * The merged array. * @access public */ - static function crmArrayMerge($a1, $a2) { + public static function crmArrayMerge($a1, $a2) { if (empty($a1)) { return $a2; } @@ -345,7 +345,7 @@ class CRM_Utils_Array { * True if $list contains at least one sub-array, false otherwise. * @access public */ - static function isHierarchical(&$list) { + public static function isHierarchical(&$list) { foreach ($list as $n => $v) { if (is_array($v)) { return TRUE; @@ -359,7 +359,7 @@ class CRM_Utils_Array { * @param $superset * @return bool TRUE if $subset is a subset of $superset */ - static function isSubset($subset, $superset) { + public static function isSubset($subset, $superset) { foreach ($subset as $expected) { if (!in_array($expected, $superset)) { return FALSE; @@ -383,7 +383,7 @@ class CRM_Utils_Array { * * @access public */ - static function crmInArray($value, $params, $caseInsensitive = TRUE) { + public static function crmInArray($value, $params, $caseInsensitive = TRUE) { foreach ($params as $item) { if (is_array($item)) { $ret = crmInArray($value, $item, $caseInsensitive); @@ -406,7 +406,7 @@ class CRM_Utils_Array { * the api needs the name => value conversion, also the view layer typically * requires value => name conversion */ - static function lookupValue(&$defaults, $property, $lookup, $reverse) { + public static function lookupValue(&$defaults, $property, $lookup, $reverse) { $id = $property . '_id'; $src = $reverse ? $property : $id; @@ -455,7 +455,7 @@ class CRM_Utils_Array { * True if the array is empty. * @access public */ - static function crmIsEmptyArray($array = array()) { + public static function crmIsEmptyArray($array = array()) { if (!is_array($array)) { return TRUE; } @@ -483,7 +483,7 @@ class CRM_Utils_Array { * @return array * Sorted array */ - static function crmArraySortByField($array, $field) { + public static function crmArraySortByField($array, $field) { $code = "return strnatcmp(\$a['$field'], \$b['$field']);"; uasort($array, create_function('$a,$b', $code)); return $array; @@ -498,7 +498,7 @@ class CRM_Utils_Array { * @return array * The input array with duplicate values removed. */ - static function crmArrayUnique($array) { + public static function crmArrayUnique($array) { $result = array_map("unserialize", array_unique(array_map("serialize", $array))); foreach ($result as $key => $value) { if (is_array($value)) { @@ -522,7 +522,7 @@ class CRM_Utils_Array { * @return array * Sorted array. */ - static function asort($array = array()) { + public static function asort($array = array()) { $lcMessages = CRM_Utils_System::getUFLocale(); if ($lcMessages && $lcMessages != 'en_US' && class_exists('Collator')) { @@ -547,7 +547,7 @@ class CRM_Utils_Array { * When passed an array of strings, unsets $items[$k] for each string $k * in the array. */ - static function remove(&$items) { + public static function remove(&$items) { foreach (func_get_args() as $n => $key) { // Skip argument 0 ($items) by testing $n for truth. if ($n && is_array($key)) { @@ -571,7 +571,7 @@ class CRM_Utils_Array { * @return array * Multi-dimensional array, with one layer for each key. */ - static function index($keys, $records) { + public static function index($keys, $records) { $final_key = array_pop($keys); $result = array(); @@ -608,7 +608,7 @@ class CRM_Utils_Array { * @return array * Keys are the original keys of $records; values are the $prop values. */ - static function collect($prop, $records) { + public static function collect($prop, $records) { $result = array(); if (is_array($records)) { foreach ($records as $key => $record) { @@ -640,7 +640,7 @@ class CRM_Utils_Array { * An array of strings produced by explode(), or the unmodified input * array, or NULL. */ - static function explodePadded($values, $delim = CRM_Core_DAO::VALUE_SEPARATOR) { + public static function explodePadded($values, $delim = CRM_Core_DAO::VALUE_SEPARATOR) { if ($values === NULL) { return NULL; } @@ -668,7 +668,7 @@ class CRM_Utils_Array { * @return string|NULL * The generated string, or NULL if NULL was passed as $values parameter. */ - static function implodePadded($values, $delim = CRM_Core_DAO::VALUE_SEPARATOR) { + public static function implodePadded($values, $delim = CRM_Core_DAO::VALUE_SEPARATOR) { if ($values === NULL) { return NULL; } @@ -701,7 +701,7 @@ class CRM_Utils_Array { * @return array * The manipulated array. */ - static function crmReplaceKey(&$elementArray, $oldKey, $newKey) { + public static function crmReplaceKey(&$elementArray, $oldKey, $newKey) { $keys = array_keys($elementArray); if (FALSE === $index = array_search($oldKey, $keys)) { throw new Exception(sprintf('key "%s" does not exit', $oldKey)); @@ -739,7 +739,7 @@ class CRM_Utils_Array { * * @return null */ - static function valueByRegexKey($regexKey, $list, $default = NULL) { + public static function valueByRegexKey($regexKey, $list, $default = NULL) { if (is_array($list) && $regexKey) { $matches = preg_grep($regexKey, array_keys($list)); $key = reset($matches); @@ -773,7 +773,7 @@ class CRM_Utils_Array { * {fg => blue, bg => black} * } */ - static function product($dimensions, $template = array()) { + public static function product($dimensions, $template = array()) { if (empty($dimensions)) { return array($template); } @@ -802,7 +802,7 @@ class CRM_Utils_Array { * @param array $array * @return mixed|NULL */ - static function first($array) { + public static function first($array) { foreach ($array as $value) { return $value; } @@ -819,7 +819,7 @@ class CRM_Utils_Array { * @param array $keys list of keys to copy * @return array */ - static function subset($array, $keys) { + public static function subset($array, $keys) { $result = array(); foreach ($keys as $key) { if (isset($array[$key])) { @@ -838,7 +838,7 @@ class CRM_Utils_Array { * @param string $valueName * @return array */ - static function makeNonAssociative($associative, $keyName = 'key', $valueName = 'value') { + public static function makeNonAssociative($associative, $keyName = 'key', $valueName = 'value') { $output = array(); foreach ($associative as $key => $val) { $output[] = array($keyName => $key, $valueName => $val); diff --git a/CRM/Utils/Cache.php b/CRM/Utils/Cache.php index cf3107be7b..1a338ec445 100644 --- a/CRM/Utils/Cache.php +++ b/CRM/Utils/Cache.php @@ -54,7 +54,7 @@ class CRM_Utils_Cache { * * @return \CRM_Utils_Cache */ - function __construct(&$config) { + public function __construct(&$config) { CRM_Core_Error::fatal(ts('this is just an interface and should not be called directly')); } @@ -65,7 +65,7 @@ class CRM_Utils_Cache { * @static * */ - static function &singleton() { + public static function &singleton() { if (self::$_singleton === NULL) { $className = 'ArrayCache'; // default to ArrayCache for now @@ -101,7 +101,7 @@ class CRM_Utils_Cache { * associative array of settings for the cache * @static */ - static function getCacheSettings($cachePlugin) { + public static function getCacheSettings($cachePlugin) { switch ($cachePlugin) { case 'ArrayCache': case 'NoCache': diff --git a/CRM/Utils/Cache/APCcache.php b/CRM/Utils/Cache/APCcache.php index cfa49286b9..5bbbbe1440 100644 --- a/CRM/Utils/Cache/APCcache.php +++ b/CRM/Utils/Cache/APCcache.php @@ -61,7 +61,7 @@ class CRM_Utils_Cache_APCcache { * * @return \CRM_Utils_Cache_APCcache */ - function __construct(&$config) { + public function __construct(&$config) { if (isset($config['timeout'])) { $this->_timeout = intval($config['timeout']); } @@ -76,7 +76,7 @@ class CRM_Utils_Cache_APCcache { * * @return bool */ - function set($key, &$value) { + public function set($key, &$value) { if (!apc_store($this->_prefix . $key, $value, $this->_timeout)) { return FALSE; } @@ -88,7 +88,7 @@ class CRM_Utils_Cache_APCcache { * * @return mixed */ - function &get($key) { + public function &get($key) { return apc_fetch($this->_prefix . $key); } @@ -97,11 +97,11 @@ class CRM_Utils_Cache_APCcache { * * @return bool|string[] */ - function delete($key) { + public function delete($key) { return apc_delete($this->_prefix . $key); } - function flush() { + public function flush() { $allinfo = apc_cache_info('user'); $keys = $allinfo['cache_list']; $prefix = $this->_prefix . "CRM_"; // Our keys follows this pattern: ([A-Za-z0-9_]+)?CRM_[A-Za-z0-9_]+ diff --git a/CRM/Utils/Cache/ArrayCache.php b/CRM/Utils/Cache/ArrayCache.php index a0df84b33b..619e49fdc6 100644 --- a/CRM/Utils/Cache/ArrayCache.php +++ b/CRM/Utils/Cache/ArrayCache.php @@ -17,7 +17,7 @@ class CRM_Utils_Cache_Arraycache implements CRM_Utils_Cache_Interface { * * @return \CRM_Utils_Cache_Arraycache */ - function __construct($config) { + public function __construct($config) { $this->_cache = array(); } @@ -25,7 +25,7 @@ class CRM_Utils_Cache_Arraycache implements CRM_Utils_Cache_Interface { * @param string $key * @param mixed $value */ - function set($key, &$value) { + public function set($key, &$value) { $this->_cache[$key] = $value; } @@ -34,18 +34,18 @@ class CRM_Utils_Cache_Arraycache implements CRM_Utils_Cache_Interface { * * @return mixed */ - function get($key) { + public function get($key) { return CRM_Utils_Array::value($key, $this->_cache); } /** * @param string $key */ - function delete($key) { + public function delete($key) { unset($this->_cache[$key]); } - function flush() { + public function flush() { unset($this->_cache); $this->_cache = array(); } diff --git a/CRM/Utils/Cache/Interface.php b/CRM/Utils/Cache/Interface.php index ba9a2694f1..d59eee27c9 100644 --- a/CRM/Utils/Cache/Interface.php +++ b/CRM/Utils/Cache/Interface.php @@ -41,7 +41,7 @@ interface CRM_Utils_Cache_Interface { * @param mixed $value * @return void */ - function set($key, &$value); + public function set($key, &$value); /** * Get a value from the cache @@ -49,7 +49,7 @@ interface CRM_Utils_Cache_Interface { * @param string $key * @return mixed NULL if $key has not been previously set */ - function get($key); + public function get($key); /** * Delete a value from the cache @@ -57,12 +57,12 @@ interface CRM_Utils_Cache_Interface { * @param string $key * @return void */ - function delete($key); + public function delete($key); /** * Delete all values from the cache * * @return void */ - function flush(); + public function flush(); } diff --git a/CRM/Utils/Cache/Memcache.php b/CRM/Utils/Cache/Memcache.php index 9604e49513..69c7688251 100644 --- a/CRM/Utils/Cache/Memcache.php +++ b/CRM/Utils/Cache/Memcache.php @@ -84,7 +84,7 @@ class CRM_Utils_Cache_Memcache { * * @return \CRM_Utils_Cache_Memcache */ - function __construct($config) { + public function __construct($config) { if (isset($config['host'])) { $this->_host = $config['host']; } @@ -113,7 +113,7 @@ class CRM_Utils_Cache_Memcache { * * @return bool */ - function set($key, &$value) { + public function set($key, &$value) { if (!$this->_cache->set($this->_prefix . $key, $value, FALSE, $this->_timeout)) { return FALSE; } @@ -125,7 +125,7 @@ class CRM_Utils_Cache_Memcache { * * @return mixed */ - function &get($key) { + public function &get($key) { $result = $this->_cache->get($this->_prefix . $key); return $result; } @@ -135,14 +135,14 @@ class CRM_Utils_Cache_Memcache { * * @return mixed */ - function delete($key) { + public function delete($key) { return $this->_cache->delete($this->_prefix . $key); } /** * @return mixed */ - function flush() { + public function flush() { return $this->_cache->flush(); } } diff --git a/CRM/Utils/Cache/Memcached.php b/CRM/Utils/Cache/Memcached.php index e747447605..e5ce5d792a 100644 --- a/CRM/Utils/Cache/Memcached.php +++ b/CRM/Utils/Cache/Memcached.php @@ -85,7 +85,7 @@ class CRM_Utils_Cache_Memcached { * * @return \CRM_Utils_Cache_Memcached */ - function __construct($config) { + public function __construct($config) { if (isset($config['host'])) { $this->_host = $config['host']; } @@ -115,7 +115,7 @@ class CRM_Utils_Cache_Memcached { * @return bool * @throws Exception */ - function set($key, &$value) { + public function set($key, &$value) { $key = $this->cleanKey($key); if (!$this->_cache->set($key, $value, $this->_timeout)) { CRM_Core_Error::debug( 'Result Code: ', $this->_cache->getResultMessage()); @@ -130,7 +130,7 @@ class CRM_Utils_Cache_Memcached { * * @return mixed */ - function &get($key) { + public function &get($key) { $key = $this->cleanKey($key); $result = $this->_cache->get($key); return $result; @@ -141,7 +141,7 @@ class CRM_Utils_Cache_Memcached { * * @return mixed */ - function delete($key) { + public function delete($key) { $key = $this->cleanKey($key); return $this->_cache->delete($key); } @@ -151,7 +151,7 @@ class CRM_Utils_Cache_Memcached { * * @return mixed|string */ - function cleanKey($key) { + public function cleanKey($key) { $key = preg_replace('/\s+|\W+/', '_', $this->_prefix . $key); if ( strlen($key) > self::MAX_KEY_LEN ) { $md5Key = md5($key); // this should be 32 characters in length @@ -164,7 +164,7 @@ class CRM_Utils_Cache_Memcached { /** * @return mixed */ - function flush() { + public function flush() { return $this->_cache->flush(); } } diff --git a/CRM/Utils/Cache/NoCache.php b/CRM/Utils/Cache/NoCache.php index f351560a11..5bea75cdc3 100644 --- a/CRM/Utils/Cache/NoCache.php +++ b/CRM/Utils/Cache/NoCache.php @@ -51,7 +51,7 @@ class CRM_Utils_Cache_NoCache implements CRM_Utils_Cache_Interface { * * @return \CRM_Utils_Cache_NoCache */ - function __construct($config) { + public function __construct($config) { } /** @@ -60,7 +60,7 @@ class CRM_Utils_Cache_NoCache implements CRM_Utils_Cache_Interface { * * @return bool */ - function set($key, &$value) { + public function set($key, &$value) { return FALSE; } @@ -69,7 +69,7 @@ class CRM_Utils_Cache_NoCache implements CRM_Utils_Cache_Interface { * * @return null */ - function get($key) { + public function get($key) { return NULL; } @@ -78,14 +78,14 @@ class CRM_Utils_Cache_NoCache implements CRM_Utils_Cache_Interface { * * @return bool */ - function delete($key) { + public function delete($key) { return FALSE; } /** * @return bool */ - function flush() { + public function flush() { return FALSE; } } diff --git a/CRM/Utils/Cache/SerializeCache.php b/CRM/Utils/Cache/SerializeCache.php index 8d4f7bfa5c..2f3d1a094b 100644 --- a/CRM/Utils/Cache/SerializeCache.php +++ b/CRM/Utils/Cache/SerializeCache.php @@ -42,7 +42,7 @@ class CRM_Utils_Cache_SerializeCache implements CRM_Utils_Cache_Interface { * * @return \CRM_Utils_Cache_SerializeCache */ - function __construct($config) { + public function __construct($config) { $this->_cache = array(); } @@ -51,7 +51,7 @@ class CRM_Utils_Cache_SerializeCache implements CRM_Utils_Cache_Interface { * * @return string */ - function fileName ($key) { + public function fileName ($key) { if (strlen($key) > 50) return CIVICRM_TEMPLATE_COMPILEDIR ."CRM_".md5($key).".php"; return CIVICRM_TEMPLATE_COMPILEDIR .$key.".php"; @@ -62,7 +62,7 @@ class CRM_Utils_Cache_SerializeCache implements CRM_Utils_Cache_Interface { * * @return mixed */ - function get ($key) { + public function get ($key) { if (array_key_exists($key,$this->_cache)) return $this->_cache[$key]; @@ -77,7 +77,7 @@ class CRM_Utils_Cache_SerializeCache implements CRM_Utils_Cache_Interface { * @param string $key * @param mixed $value */ - function set($key, &$value) { + public function set($key, &$value) { if (file_exists($this->fileName ($key))) { return; } @@ -88,7 +88,7 @@ class CRM_Utils_Cache_SerializeCache implements CRM_Utils_Cache_Interface { /** * @param string $key */ - function delete($key) { + public function delete($key) { if (file_exists($this->fileName ($key))) { unlink ($this->fileName ($key)); } @@ -98,7 +98,7 @@ class CRM_Utils_Cache_SerializeCache implements CRM_Utils_Cache_Interface { /** * @param null $key */ - function flush($key =null) { + public function flush($key =null) { $prefix = "CRM_"; if (!$handle = opendir(CIVICRM_TEMPLATE_COMPILEDIR)) { return; // die? Error? diff --git a/CRM/Utils/Cache/SqlGroup.php b/CRM/Utils/Cache/SqlGroup.php index 47b9f2f2d9..7234010a5a 100644 --- a/CRM/Utils/Cache/SqlGroup.php +++ b/CRM/Utils/Cache/SqlGroup.php @@ -68,7 +68,7 @@ class CRM_Utils_Cache_SqlGroup implements CRM_Utils_Cache_Interface { * @throws RuntimeException * @return \CRM_Utils_Cache_SqlGroup */ - function __construct($config) { + public function __construct($config) { if (isset($config['group'])) { $this->group = $config['group']; } else { @@ -89,7 +89,7 @@ class CRM_Utils_Cache_SqlGroup implements CRM_Utils_Cache_Interface { * @param string $key * @param mixed $value */ - function set($key, &$value) { + public function set($key, &$value) { CRM_Core_BAO_Cache::setItem($value, $this->group, $key, $this->componentID); $this->frontCache[$key] = $value; } @@ -99,7 +99,7 @@ class CRM_Utils_Cache_SqlGroup implements CRM_Utils_Cache_Interface { * * @return mixed */ - function get($key) { + public function get($key) { if (! array_key_exists($key, $this->frontCache)) { $this->frontCache[$key] = CRM_Core_BAO_Cache::getItem($this->group, $key, $this->componentID); } @@ -112,24 +112,24 @@ class CRM_Utils_Cache_SqlGroup implements CRM_Utils_Cache_Interface { * * @return mixed */ - function getFromFrontCache($key, $default = NULL) { + public function getFromFrontCache($key, $default = NULL) { return CRM_Utils_Array::value($key, $this->frontCache, $default); } /** * @param string $key */ - function delete($key) { + public function delete($key) { CRM_Core_BAO_Cache::deleteGroup($this->group, $key); unset($this->frontCache[$key]); } - function flush() { + public function flush() { CRM_Core_BAO_Cache::deleteGroup($this->group); $this->frontCache = array(); } - function prefetch() { + public function prefetch() { $this->frontCache = CRM_Core_BAO_Cache::getItems($this->group, $this->componentID); } } diff --git a/CRM/Utils/Check.php b/CRM/Utils/Check.php index a4954732db..f559360c52 100644 --- a/CRM/Utils/Check.php +++ b/CRM/Utils/Check.php @@ -51,7 +51,7 @@ class CRM_Utils_Check { * * @return CRM_Utils_Check */ - static function &singleton() { + public static function &singleton() { if (!isset(self::$_singleton)) { self::$_singleton = new CRM_Utils_Check(); } diff --git a/CRM/Utils/Check/Case.php b/CRM/Utils/Check/Case.php index 1d7b96dd48..c33246a869 100644 --- a/CRM/Utils/Check/Case.php +++ b/CRM/Utils/Check/Case.php @@ -48,7 +48,7 @@ class CRM_Utils_Check_Case { * @param CRM_Case_XMLRepository $xmlRepo * @param array $caseTypeNames */ - function __construct($xmlRepo, $caseTypeNames) { + public function __construct($xmlRepo, $caseTypeNames) { $this->caseTypeNames = $caseTypeNames; $this->xmlRepo = $xmlRepo; } diff --git a/CRM/Utils/Check/Message.php b/CRM/Utils/Check/Message.php index e829c2450e..97fee53a68 100644 --- a/CRM/Utils/Check/Message.php +++ b/CRM/Utils/Check/Message.php @@ -53,7 +53,7 @@ class CRM_Utils_Check_Message { * @param $message * @param $title */ - function __construct($name, $message, $title) { + public function __construct($name, $message, $title) { $this->name = $name; $this->message = $message; $this->title = $title; @@ -62,14 +62,14 @@ class CRM_Utils_Check_Message { /** * @return string */ - function getName() { + public function getName() { return $this->name; } /** * @return string */ - function getMessage() { + public function getMessage() { return $this->message; } @@ -83,7 +83,7 @@ class CRM_Utils_Check_Message { /** * @return array */ - function toArray() { + public function toArray() { return array( 'name' => $this->name, 'message' => $this->message, diff --git a/CRM/Utils/Crypt.php b/CRM/Utils/Crypt.php index a93978ff7a..a155c7b4b4 100644 --- a/CRM/Utils/Crypt.php +++ b/CRM/Utils/Crypt.php @@ -49,7 +49,7 @@ class CRM_Utils_Crypt { * Base64-encoded ciphertext, or base64-encoded plaintext if encryption is * disabled or unavailable. */ - static function encrypt($string) { + public static function encrypt($string) { if (empty($string)) { return $string; } @@ -83,7 +83,7 @@ class CRM_Utils_Crypt { * Plaintext, or base64-decoded ciphertext if encryption is disabled or * unavailable. */ - static function decrypt($string) { + public static function decrypt($string) { if (empty($string)) { return $string; } diff --git a/CRM/Utils/Date.php b/CRM/Utils/Date.php index 41e03a1d47..4eb4cf0cb7 100644 --- a/CRM/Utils/Date.php +++ b/CRM/Utils/Date.php @@ -49,7 +49,7 @@ class CRM_Utils_Date { * * @static */ - static function format($date, $separator = '', $invalidDate = 0) { + public static function format($date, $separator = '', $invalidDate = 0) { if (is_numeric($date) && ((strlen($date) == 8) || (strlen($date) == 14)) ) { @@ -170,7 +170,7 @@ class CRM_Utils_Date { * * @static */ - static function &getAbbrWeekdayNames() { + public static function &getAbbrWeekdayNames() { static $abbrWeekdayNames; if (!isset($abbrWeekdayNames)) { @@ -191,7 +191,7 @@ class CRM_Utils_Date { * * @static */ - static function &getFullWeekdayNames() { + public static function &getFullWeekdayNames() { static $fullWeekdayNames; if (!isset($fullWeekdayNames)) { @@ -214,7 +214,7 @@ class CRM_Utils_Date { * * @static */ - static function &getAbbrMonthNames($month = FALSE) { + public static function &getAbbrMonthNames($month = FALSE) { static $abbrMonthNames; if (!isset($abbrMonthNames)) { @@ -237,7 +237,7 @@ class CRM_Utils_Date { * * @static */ - static function &getFullMonthNames() { + public static function &getFullMonthNames() { static $fullMonthNames; if (!isset($fullMonthNames)) { @@ -255,7 +255,7 @@ class CRM_Utils_Date { * * @return int */ - static function unixTime($string) { + public static function unixTime($string) { if (empty($string)) { return 0; } @@ -295,7 +295,7 @@ class CRM_Utils_Date { * @return string the $format-formatted $date * @static */ - static function customFormat($dateString, $format = NULL, $dateParts = NULL) { + public static function customFormat($dateString, $format = NULL, $dateParts = NULL) { // 1-based (January) month names arrays $abbrMonths = self::getAbbrMonthNames(); $fullMonths = self::getFullMonthNames(); @@ -428,7 +428,7 @@ class CRM_Utils_Date { * @return string date/datetime in ISO format * @static */ - static function mysqlToIso($mysql) { + public static function mysqlToIso($mysql) { $year = substr($mysql, 0, 4); $month = substr($mysql, 4, 2); $day = substr($mysql, 6, 2); @@ -470,7 +470,7 @@ class CRM_Utils_Date { * @return string date/datetime in MySQL format * @static */ - static function isoToMysql($iso) { + public static function isoToMysql($iso) { $dropArray = array('-' => '', ':' => '', ' ' => ''); return strtr($iso, $dropArray); } @@ -485,7 +485,7 @@ class CRM_Utils_Date { * @return bool * @static */ - static function convertToDefaultDate(&$params, $dateType, $dateParam) { + public static function convertToDefaultDate(&$params, $dateType, $dateParam) { $now = getDate(); $cen = substr($now['year'], 0, 2); $prevCen = $cen - 1; @@ -667,7 +667,7 @@ class CRM_Utils_Date { * * @return bool */ - static function isDate(&$date) { + public static function isDate(&$date) { if (CRM_Utils_System::isNull($date)) { return FALSE; } @@ -679,7 +679,7 @@ class CRM_Utils_Date { * * @return bool|string */ - static function currentDBDate($timeStamp = NULL) { + public static function currentDBDate($timeStamp = NULL) { return $timeStamp ? date('YmdHis', $timeStamp) : date('YmdHis'); } @@ -689,7 +689,7 @@ class CRM_Utils_Date { * * @return bool */ - static function overdue($date, $now = NULL) { + public static function overdue($date, $now = NULL) { $mysqlDate = self::isoToMysql($date); if (!$now) { $now = self::currentDBDate(); @@ -719,7 +719,7 @@ class CRM_Utils_Date { * @return string Return the customized todays date (Y-m-d) * @static */ - static function getToday($dayParams = NULL, $format = "Y-m-d") { + public static function getToday($dayParams = NULL, $format = "Y-m-d") { if (is_null($dayParams) || empty($dayParams)) { $today = date($format); } @@ -744,7 +744,7 @@ class CRM_Utils_Date { * @return true todays date is in the given date range * @static */ - static function getRange($startDate, $endDate) { + public static function getRange($startDate, $endDate) { $today = date("Y-m-d"); $mysqlStartDate = self::isoToMysql($startDate); $mysqlEndDate = self::isoToMysql($endDate); @@ -774,7 +774,7 @@ class CRM_Utils_Date { * @return array start date, end date * @static */ - static function getFromTo($relative, $from, $to) { + public static function getFromTo($relative, $from, $to) { if ($relative) { list($term, $unit) = explode('.', $relative); $dateRange = self::relativeToAbsolute($term, $unit); @@ -859,7 +859,7 @@ class CRM_Utils_Date { * @return array $result contains new date with added interval * @access public */ - static function intervalAdd($unit, $interval, $date, $dontCareTime = FALSE) { + public static function intervalAdd($unit, $interval, $date, $dontCareTime = FALSE) { if (is_array($date)) { $hour = CRM_Utils_Array::value('H', $date); $minute = CRM_Utils_Array::value('i', $date); @@ -918,7 +918,7 @@ class CRM_Utils_Date { * * @return array|null|string */ - static function &checkBirthDateFormat($format = NULL) { + public static function &checkBirthDateFormat($format = NULL) { $birthDateFormat = NULL; if (!$format) { $birthDateFormat = self::getDateFormat('birth'); @@ -949,7 +949,7 @@ class CRM_Utils_Date { * @return array $dateRange start date and end date for the relative time frame * @static */ - static function relativeToAbsolute($relativeTerm, $unit) { + public static function relativeToAbsolute($relativeTerm, $unit) { $now = getDate(); $from = $to = $dateRange = array(); $from['H'] = $from['i'] = $from['s'] = 0; @@ -1620,7 +1620,7 @@ class CRM_Utils_Date { * @access public * @static */ - static function calculateFiscalYear($fyDate, $fyMonth) { + public static function calculateFiscalYear($fyDate, $fyMonth) { $date = date("Y-m-d"); $currentYear = date("Y"); @@ -1650,7 +1650,7 @@ class CRM_Utils_Date { * * @return string $mysqlDate date format that is excepted by mysql */ - static function processDate($date, $time = NULL, $returnNullString = FALSE, $format = 'YmdHis') { + public static function processDate($date, $time = NULL, $returnNullString = FALSE, $format = 'YmdHis') { $mysqlDate = NULL; if ($returnNullString) { @@ -1675,7 +1675,7 @@ class CRM_Utils_Date { * * @return array $date and time */ - static function setDateDefaults($mysqlDate = NULL, $formatType = NULL, $format = NULL, $timeFormat = NULL) { + public static function setDateDefaults($mysqlDate = NULL, $formatType = NULL, $format = NULL, $timeFormat = NULL) { // if date is not passed assume it as today if (!$mysqlDate) { $mysqlDate = date('Y-m-d G:i:s'); @@ -1742,7 +1742,7 @@ class CRM_Utils_Date { * * @return string $format */ - static function getDateFormat($formatType = NULL) { + public static function getDateFormat($formatType = NULL) { $format = NULL; if ($formatType) { $format = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_PreferencesDate', @@ -1766,7 +1766,7 @@ class CRM_Utils_Date { * @static * @public */ - static function getUTCTime($offset = 0) { + public static function getUTCTime($offset = 0) { $originalTimezone = date_default_timezone_get(); date_default_timezone_set('UTC'); $time = time() + $offset; @@ -1782,7 +1782,7 @@ class CRM_Utils_Date { * * @return null|string */ - static function formatDate($date, $dateType) { + public static function formatDate($date, $dateType) { $formattedDate = NULL; if (empty($date)) { return $formattedDate; diff --git a/CRM/Utils/FakeObject.php b/CRM/Utils/FakeObject.php index a7b71b8a9f..c7fa4d7cae 100644 --- a/CRM/Utils/FakeObject.php +++ b/CRM/Utils/FakeObject.php @@ -15,7 +15,7 @@ class CRM_Utils_FakeObject { /** * @param $array */ - function __construct($array) { + public function __construct($array) { $this->array = $array; } @@ -25,7 +25,7 @@ class CRM_Utils_FakeObject { * * @throws Exception */ - function __call($name, $arguments) { + public function __call($name, $arguments) { if (isset($this->array[$name]) && is_callable($this->array[$name])) { return call_user_func_array($this->array[$name], $arguments); } else { diff --git a/CRM/Utils/File.php b/CRM/Utils/File.php index 7ed48a5ef1..2e630041bd 100644 --- a/CRM/Utils/File.php +++ b/CRM/Utils/File.php @@ -46,7 +46,7 @@ class CRM_Utils_File { * @return boolean true if file is ascii * @access public */ - static function isAscii($name) { + public static function isAscii($name) { $fd = fopen($name, "r"); if (!$fd) { return FALSE; @@ -73,7 +73,7 @@ class CRM_Utils_File { * @return boolean true if file is html * @access public */ - static function isHtml($name) { + public static function isHtml($name) { $fd = fopen($name, "r"); if (!$fd) { return FALSE; @@ -105,7 +105,7 @@ class CRM_Utils_File { * @access public * @static */ - static function createDir($path, $abort = TRUE) { + public static function createDir($path, $abort = TRUE) { if (is_dir($path) || empty($path)) { return; } @@ -138,7 +138,7 @@ class CRM_Utils_File { * @access public * @static */ - static function cleanDir($target, $rmdir = TRUE, $verbose = TRUE) { + public static function cleanDir($target, $rmdir = TRUE, $verbose = TRUE) { static $exceptions = array('.', '..'); if ($target == '' || $target == '/') { throw new Exception("Overly broad deletion"); @@ -179,7 +179,7 @@ class CRM_Utils_File { * @param $source * @param $destination */ - static function copyDir($source, $destination) { + public static function copyDir($source, $destination) { $dir = opendir($source); @mkdir($destination); while (FALSE !== ($file = readdir($dir))) { @@ -203,7 +203,7 @@ class CRM_Utils_File { * @return boolean whether the file was recoded properly * @access public */ - static function toUtf8($name) { + public static function toUtf8($name) { static $config = NULL; static $legacyEncoding = NULL; if ($config == NULL) { @@ -251,7 +251,7 @@ class CRM_Utils_File { * @access public * @static */ - static function addTrailingSlash($path, $slash = NULL) { + public static function addTrailingSlash($path, $slash = NULL) { if (!$slash) { // FIXME: Defaulting to backslash on windows systems can produce unexpected results, esp for URL strings which should always use forward-slashes. // I think this fn should default to forward-slash instead. @@ -270,7 +270,7 @@ class CRM_Utils_File { * @param bool $isQueryString * @param bool $dieOnErrors */ - static function sourceSQLFile($dsn, $fileName, $prefix = NULL, $isQueryString = FALSE, $dieOnErrors = TRUE) { + public static function sourceSQLFile($dsn, $fileName, $prefix = NULL, $isQueryString = FALSE, $dieOnErrors = TRUE) { require_once 'DB.php'; $db = DB::connect($dsn); @@ -317,7 +317,7 @@ class CRM_Utils_File { * * @return bool */ - static function isExtensionSafe($ext) { + public static function isExtensionSafe($ext) { static $extensions = NULL; if (!$extensions) { $extensions = CRM_Core_OptionGroup::values('safe_file_extension', TRUE); @@ -347,7 +347,7 @@ class CRM_Utils_File { * * @return boolean whether the file can be include()d or require()d */ - static function isIncludable($name) { + public static function isIncludable($name) { $x = @fopen($name, 'r', TRUE); if ($x) { fclose($x); @@ -362,7 +362,7 @@ class CRM_Utils_File { * Remove the 32 bit md5 we add to the fileName * also remove the unknown tag if we added it */ - static function cleanFileName($name) { + public static function cleanFileName($name) { // replace the last 33 character before the '.' with null $name = preg_replace('/(_[\w]{32})\./', '.', $name); return $name; @@ -373,7 +373,7 @@ class CRM_Utils_File { * * @return string */ - static function makeFileName($name) { + public static function makeFileName($name) { $uniqID = md5(uniqid(rand(), TRUE)); $info = pathinfo($name); $basename = substr($info['basename'], @@ -396,7 +396,7 @@ class CRM_Utils_File { * * @return array */ - static function getFilesByExtension($path, $ext) { + public static function getFilesByExtension($path, $ext) { $path = self::addTrailingSlash($path); $dh = opendir($path); $files = array(); @@ -415,7 +415,7 @@ class CRM_Utils_File { * @param string $dir the directory to be secured * @param bool $overwrite */ - static function restrictAccess($dir, $overwrite = FALSE) { + public static function restrictAccess($dir, $overwrite = FALSE) { // note: empty value for $dir can play havoc, since that might result in putting '.htaccess' to root dir // of site, causing site to stop functioning. // FIXME: we should do more checks here - @@ -441,7 +441,7 @@ HTACCESS; * * @param $publicDir */ - static function restrictBrowsing($publicDir) { + public static function restrictBrowsing($publicDir) { if (!is_dir($publicDir) || !is_writable($publicDir)) { return; } @@ -468,7 +468,7 @@ HTACCESS; * Create the base file path from which all our internal directories are * offset. This is derived from the template compile directory set */ - static function baseFilePath($templateCompileDir = NULL) { + public static function baseFilePath($templateCompileDir = NULL) { static $_path = NULL; if (!$_path) { if ($templateCompileDir == NULL) { @@ -497,7 +497,7 @@ HTACCESS; * * @return string */ - static function relativeDirectory($directory) { + public static function relativeDirectory($directory) { // Do nothing on windows if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { return $directory; @@ -525,7 +525,7 @@ HTACCESS; * * @return string */ - static function absoluteDirectory($directory) { + public static function absoluteDirectory($directory) { // check if directory is already absolute, if so return immediately // Note: Windows PHP accepts any mix of "/" or "\", so "C:\htdocs" or "C:/htdocs" would be a valid absolute path if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' && preg_match(';^[a-zA-Z]:[/\\\\];', $directory)) { @@ -551,7 +551,7 @@ HTACCESS; * * @return string */ - static function relativize($directory, $basePath) { + public static function relativize($directory, $basePath) { if (substr($directory, 0, strlen($basePath)) == $basePath) { return substr($directory, strlen($basePath)); } else { @@ -569,7 +569,7 @@ HTACCESS; * @return string, path to an openable/writable file * @see tempnam */ - static function tempnam($prefix = 'tmp-') { + public static function tempnam($prefix = 'tmp-') { //$config = CRM_Core_Config::singleton(); //$nonce = md5(uniqid() . $config->dsn . $config->userFrameworkResourceURL); //$fileName = "{$config->configAndLogDir}" . $prefix . $nonce . $suffix; @@ -587,7 +587,7 @@ HTACCESS; * @return string, path to an openable/writable directory; ends with '/' * @see tempnam */ - static function tempdir($prefix = 'tmp-') { + public static function tempdir($prefix = 'tmp-') { $fileName = self::tempnam($prefix); unlink($fileName); mkdir($fileName, 0700); @@ -603,7 +603,7 @@ HTACCESS; * @param $pattern string, glob pattern, eg "*.txt" * @return array(string) */ - static function findFiles($dir, $pattern) { + public static function findFiles($dir, $pattern) { $todos = array($dir); $result = array(); while (!empty($todos)) { @@ -641,7 +641,7 @@ HTACCESS; * * @return bool */ - static function isChildPath($parent, $child, $checkRealPath = TRUE) { + public static function isChildPath($parent, $child, $checkRealPath = TRUE) { if ($checkRealPath) { $parent = realpath($parent); $child = realpath($child); @@ -671,7 +671,7 @@ HTACCESS; * * @return bool TRUE on success */ - static function replaceDir($fromDir, $toDir, $verbose = FALSE) { + public static function replaceDir($fromDir, $toDir, $verbose = FALSE) { if (is_dir($toDir)) { if (!self::cleanDir($toDir, TRUE, $verbose)) { return FALSE; diff --git a/CRM/Utils/Geocode/Google.php b/CRM/Utils/Geocode/Google.php index 4e7060ca99..430c34da7e 100644 --- a/CRM/Utils/Geocode/Google.php +++ b/CRM/Utils/Geocode/Google.php @@ -65,7 +65,7 @@ class CRM_Utils_Geocode_Google { * @return boolean true if we modified the address, false otherwise * @static */ - static function format(&$values, $stateName = FALSE) { + public static function format(&$values, $stateName = FALSE) { // we need a valid country, else we ignore if (empty($values['country'])) { return FALSE; diff --git a/CRM/Utils/Geocode/Yahoo.php b/CRM/Utils/Geocode/Yahoo.php index c5201cafa9..7dd1e82692 100644 --- a/CRM/Utils/Geocode/Yahoo.php +++ b/CRM/Utils/Geocode/Yahoo.php @@ -66,7 +66,7 @@ class CRM_Utils_Geocode_Yahoo { * @return boolean true if we modified the address, false otherwise * @static */ - static function format(&$values, $stateName = FALSE) { + public static function format(&$values, $stateName = FALSE) { CRM_Utils_System::checkPHPVersion(5, TRUE); $config = CRM_Core_Config::singleton(); diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index 977c093f56..5fd710803e 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -79,7 +79,7 @@ abstract class CRM_Utils_Hook { * @return self * An instance of $config->userHookClass */ - static function singleton($fresh = FALSE) { + public static function singleton($fresh = FALSE) { if (self::$_singleton == NULL || $fresh) { $config = CRM_Core_Config::singleton(); $class = $config->userHookClass; @@ -138,7 +138,7 @@ abstract class CRM_Utils_Hook { * * @param string $fnPrefix */ - function commonBuildModuleList($fnPrefix) { + public function commonBuildModuleList($fnPrefix) { if (!$this->commonIncluded) { // include external file $this->commonIncluded = TRUE; @@ -233,7 +233,7 @@ abstract class CRM_Utils_Hook { /** * @param $moduleList */ - function requireCiviModules(&$moduleList) { + public function requireCiviModules(&$moduleList) { $civiModules = CRM_Core_PseudoConstant::getModuleExtensions(); foreach ($civiModules as $civiModule) { if (!file_exists($civiModule['filePath'])) { @@ -259,7 +259,7 @@ abstract class CRM_Utils_Hook { * * @return null the return value is ignored */ - static function pre($op, $objectName, $id, &$params) { + public static function pre($op, $objectName, $id, &$params) { $event = new \Civi\Core\Event\PreEvent($op, $objectName, $id, $params); \Civi\Core\Container::singleton()->get('dispatcher')->dispatch("hook_civicrm_pre", $event); \Civi\Core\Container::singleton()->get('dispatcher')->dispatch("hook_civicrm_pre::$objectName", $event); @@ -278,7 +278,7 @@ abstract class CRM_Utils_Hook { * an error message which aborts the operation * @access public */ - static function post($op, $objectName, $objectId, &$objectRef) { + public static function post($op, $objectName, $objectId, &$objectRef) { $event = new \Civi\Core\Event\PostEvent($op, $objectName, $objectId, $objectRef); \Civi\Core\Container::singleton()->get('dispatcher')->dispatch("hook_civicrm_post", $event); \Civi\Core\Container::singleton()->get('dispatcher')->dispatch("hook_civicrm_post::$objectName", $event); @@ -298,7 +298,7 @@ abstract class CRM_Utils_Hook { * * @return null the return value is ignored */ - static function links($op, $objectName, &$objectId, &$links, &$mask = NULL, &$values = array()) { + public static function links($op, $objectName, &$objectId, &$links, &$mask = NULL, &$values = array()) { return self::singleton()->invoke(6, $op, $objectName, $objectId, $links, $mask, $values, 'civicrm_links'); } @@ -310,7 +310,7 @@ abstract class CRM_Utils_Hook { * * @return null the return value is ignored */ - static function preProcess($formName, &$form) { + public static function preProcess($formName, &$form) { return self::singleton()->invoke(2, $formName, $form, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_preProcess'); } @@ -323,7 +323,7 @@ abstract class CRM_Utils_Hook { * * @return null the return value is ignored */ - static function buildForm($formName, &$form) { + public static function buildForm($formName, &$form) { return self::singleton()->invoke(2, $formName, $form, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_buildForm'); } @@ -336,7 +336,7 @@ abstract class CRM_Utils_Hook { * * @return null the return value is ignored */ - static function postProcess($formName, &$form) { + public static function postProcess($formName, &$form) { return self::singleton()->invoke(2, $formName, $form, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_postProcess'); } @@ -352,7 +352,7 @@ abstract class CRM_Utils_Hook { * @return mixed formRule hooks return a boolean or * an array of error messages which display a QF Error */ - static function validate($formName, &$fields, &$files, &$form) { + public static function validate($formName, &$fields, &$files, &$form) { return self::singleton()->invoke(4, $formName, $fields, $files, $form, self::$_nullObject, self::$_nullObject, 'civicrm_validate'); } @@ -369,7 +369,7 @@ abstract class CRM_Utils_Hook { * @return mixed formRule hooks return a boolean or * an array of error messages which display a QF Error */ - static function validateForm($formName, &$fields, &$files, &$form, &$errors) { + public static function validateForm($formName, &$fields, &$files, &$form, &$errors) { return self::singleton()->invoke(5, $formName, $fields, $files, $form, $errors, self::$_nullObject, 'civicrm_validateForm'); } @@ -383,7 +383,7 @@ abstract class CRM_Utils_Hook { * * @return null the return value is ignored */ - static function custom($op, $groupID, $entityID, &$params) { + public static function custom($op, $groupID, $entityID, &$params) { return self::singleton()->invoke(4, $op, $groupID, $entityID, $params, self::$_nullObject, self::$_nullObject, 'civicrm_custom'); } @@ -399,7 +399,7 @@ abstract class CRM_Utils_Hook { * * @return null the return value is ignored */ - static function aclWhereClause($type, &$tables, &$whereTables, &$contactID, &$where) { + public static function aclWhereClause($type, &$tables, &$whereTables, &$contactID, &$where) { return self::singleton()->invoke(5, $type, $tables, $whereTables, $contactID, $where, self::$_nullObject, 'civicrm_aclWhereClause'); } @@ -415,7 +415,7 @@ abstract class CRM_Utils_Hook { * * @return null the return value is ignored */ - static function aclGroup($type, $contactID, $tableName, &$allGroups, &$currentGroups) { + public static function aclGroup($type, $contactID, $tableName, &$allGroups, &$currentGroups) { return self::singleton()->invoke(5, $type, $contactID, $tableName, $allGroups, $currentGroups, self::$_nullObject, 'civicrm_aclGroup'); } @@ -426,7 +426,7 @@ abstract class CRM_Utils_Hook { * * @return null the return value is ignored */ - static function xmlMenu(&$files) { + public static function xmlMenu(&$files) { return self::singleton()->invoke(1, $files, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_xmlMenu' @@ -441,7 +441,7 @@ abstract class CRM_Utils_Hook { * @return null the return value is ignored * @access public */ - static function managed(&$entities) { + public static function managed(&$entities) { return self::singleton()->invoke(1, $entities, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_managed' @@ -458,7 +458,7 @@ abstract class CRM_Utils_Hook { * @return string the html snippet to include in the dashboard * @access public */ - static function dashboard($contactID, &$contentPlacement = self::DASHBOARD_BELOW) { + public static function dashboard($contactID, &$contentPlacement = self::DASHBOARD_BELOW) { $retval = self::singleton()->invoke(2, $contactID, $contentPlacement, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_dashboard' @@ -484,7 +484,7 @@ abstract class CRM_Utils_Hook { * @return array * @access public */ - static function recent(&$recentArray) { + public static function recent(&$recentArray) { return self::singleton()->invoke(1, $recentArray, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_recent' @@ -501,7 +501,7 @@ abstract class CRM_Utils_Hook { * - count: int, eg "5" if there are 5 email addresses that refer to $dao * @return void */ - static function referenceCounts($dao, &$refCounts) { + public static function referenceCounts($dao, &$refCounts) { return self::singleton()->invoke(2, $dao, $refCounts, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_referenceCounts' @@ -518,7 +518,7 @@ abstract class CRM_Utils_Hook { * @return null * @access public */ - static function buildAmount($pageType, &$form, &$amount) { + public static function buildAmount($pageType, &$form, &$amount) { return self::singleton()->invoke(3, $pageType, $form, $amount, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_buildAmount'); } @@ -532,7 +532,7 @@ abstract class CRM_Utils_Hook { * * @return null */ - static function buildStateProvinceForCountry($countryID, &$states) { + public static function buildStateProvinceForCountry($countryID, &$states) { return self::singleton()->invoke(2, $countryID, $states, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_buildStateProvinceForCountry' @@ -547,7 +547,7 @@ abstract class CRM_Utils_Hook { * * @return null */ - static function tabs(&$tabs, $contactID) { + public static function tabs(&$tabs, $contactID) { return self::singleton()->invoke(2, $tabs, $contactID, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_tabs' ); @@ -566,7 +566,7 @@ abstract class CRM_Utils_Hook { * * @return null */ - static function tabset($tabsetName, &$tabs, $context) { + public static function tabset($tabsetName, &$tabs, $context) { return self::singleton()->invoke(3, $tabsetName, $tabs, $context, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_tabset' ); @@ -580,7 +580,7 @@ abstract class CRM_Utils_Hook { * @return null * @access public */ - static function tokens(&$tokens) { + public static function tokens(&$tokens) { return self::singleton()->invoke(1, $tokens, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_tokens' ); @@ -617,7 +617,7 @@ abstract class CRM_Utils_Hook { * @return null * @access public */ - static function pageRun(&$page) { + public static function pageRun(&$page) { return self::singleton()->invoke(1, $page, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_pageRun' @@ -634,7 +634,7 @@ abstract class CRM_Utils_Hook { * @return null * @access public */ - static function copy($objectName, &$object) { + public static function copy($objectName, &$object) { return self::singleton()->invoke(2, $objectName, $object, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_copy' @@ -659,7 +659,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function unsubscribeGroups($op, $mailingId, $contactId, &$groups, &$baseGroups) { + public static function unsubscribeGroups($op, $mailingId, $contactId, &$groups, &$baseGroups) { return self::singleton()->invoke(5, $op, $mailingId, $contactId, $groups, $baseGroups, self::$_nullObject, 'civicrm_unsubscribeGroups'); } @@ -679,7 +679,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function customFieldOptions($customFieldID, &$options, $detailedFormat = FALSE, $selectAttributes = array()) { + public static function customFieldOptions($customFieldID, &$options, $detailedFormat = FALSE, $selectAttributes = array()) { return self::singleton()->invoke(3, $customFieldID, $options, $detailedFormat, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_customFieldOptions' @@ -703,7 +703,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function searchTasks($objectType, &$tasks) { + public static function searchTasks($objectType, &$tasks) { return self::singleton()->invoke(2, $objectType, $tasks, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_searchTasks' @@ -716,7 +716,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function eventDiscount(&$form, &$params) { + public static function eventDiscount(&$form, &$params) { return self::singleton()->invoke(2, $form, $params, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_eventDiscount' @@ -735,7 +735,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function mailingGroups(&$form, &$groups, &$mailings) { + public static function mailingGroups(&$form, &$groups, &$mailings) { return self::singleton()->invoke(3, $form, $groups, $mailings, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_mailingGroups' @@ -756,7 +756,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function membershipTypeValues(&$form, &$membershipTypes) { + public static function membershipTypeValues(&$form, &$membershipTypes) { return self::singleton()->invoke(2, $form, $membershipTypes, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_membershipTypeValues' @@ -776,7 +776,7 @@ abstract class CRM_Utils_Hook { * @return string * The html snippet to include in the contact summary */ - static function summary($contactID, &$content, &$contentPlacement = self::SUMMARY_BELOW) { + public static function summary($contactID, &$content, &$contentPlacement = self::SUMMARY_BELOW) { return self::singleton()->invoke(3, $contactID, $content, $contentPlacement, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_summary' @@ -803,7 +803,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function contactListQuery(&$query, $name, $context, $id) { + public static function contactListQuery(&$query, $name, $context, $id) { return self::singleton()->invoke(4, $query, $name, $context, $id, self::$_nullObject, self::$_nullObject, 'civicrm_contactListQuery' @@ -847,7 +847,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function alterMailParams(&$params, $context = NULL) { + public static function alterMailParams(&$params, $context = NULL) { return self::singleton()->invoke(2, $params, $context, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_alterMailParams' @@ -869,7 +869,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function alterCalculatedMembershipStatus(&$membershipStatus, $arguments, $membership) { + public static function alterCalculatedMembershipStatus(&$membershipStatus, $arguments, $membership) { return self::singleton()->invoke(3, $membershipStatus, $arguments, $membership, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_alterCalculatedMembershipStatus' @@ -885,7 +885,7 @@ abstract class CRM_Utils_Hook { * and the value is an array with keys 'label' and 'value' specifying label/value pairs * @access public */ - static function caseSummary($caseID) { + public static function caseSummary($caseID) { return self::singleton()->invoke(1, $caseID, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_caseSummary' @@ -899,7 +899,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function caseTypes(&$caseTypes) { + public static function caseTypes(&$caseTypes) { return self::singleton()->invoke(1, $caseTypes, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_caseTypes'); } @@ -912,7 +912,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function config(&$config) { + public static function config(&$config) { return self::singleton()->invoke(1, $config, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_config' @@ -926,7 +926,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function enableDisable($recordBAO, $recordID, $isActive) { + public static function enableDisable($recordBAO, $recordID, $isActive) { return self::singleton()->invoke(3, $recordBAO, $recordID, $isActive, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_enableDisable' @@ -943,7 +943,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function optionValues(&$options, $name) { + public static function optionValues(&$options, $name) { return self::singleton()->invoke(2, $options, $name, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_optionValues' @@ -958,7 +958,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function navigationMenu(&$params) { + public static function navigationMenu(&$params) { return self::singleton()->invoke(1, $params, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_navigationMenu' @@ -976,7 +976,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function merge($type, &$data, $mainId = NULL, $otherId = NULL, $tables = NULL) { + public static function merge($type, &$data, $mainId = NULL, $otherId = NULL, $tables = NULL) { return self::singleton()->invoke(5, $type, $data, $mainId, $otherId, $tables, self::$_nullObject, 'civicrm_merge'); } @@ -988,7 +988,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function notePrivacy(&$noteValues) { + public static function notePrivacy(&$noteValues) { return self::singleton()->invoke(1, $noteValues, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_notePrivacy' @@ -1005,7 +1005,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function export(&$exportTempTable, &$headerRows, &$sqlColumns, &$exportMode) { + public static function export(&$exportTempTable, &$headerRows, &$sqlColumns, &$exportMode) { return self::singleton()->invoke(4, $exportTempTable, $headerRows, $sqlColumns, $exportMode, self::$_nullObject, self::$_nullObject, 'civicrm_export' @@ -1022,7 +1022,7 @@ abstract class CRM_Utils_Hook { * @return mixed * @access public */ - static function dupeQuery($obj, $type, &$query) { + public static function dupeQuery($obj, $type, &$query) { return self::singleton()->invoke(3, $obj, $type, $query, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_dupeQuery' @@ -1041,7 +1041,7 @@ abstract class CRM_Utils_Hook { * @return mixed * @access public */ - static function emailProcessor($type, &$params, $mail, &$result, $action = NULL) { + public static function emailProcessor($type, &$params, $mail, &$result, $action = NULL) { return self::singleton()->invoke(5, $type, $params, $mail, $result, $action, self::$_nullObject, 'civicrm_emailProcessor'); } @@ -1063,7 +1063,7 @@ abstract class CRM_Utils_Hook { * @return void * @access public */ - static function import($object, $usage, &$objectRef, &$params) { + public static function import($object, $usage, &$objectRef, &$params) { return self::singleton()->invoke(4, $object, $usage, $objectRef, $params, self::$_nullObject, self::$_nullObject, 'civicrm_import' @@ -1081,7 +1081,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function alterAPIPermissions($entity, $action, &$params, &$permissions) { + public static function alterAPIPermissions($entity, $action, &$params, &$permissions) { return self::singleton()->invoke(4, $entity, $action, $params, $permissions, self::$_nullObject, self::$_nullObject, 'civicrm_alterAPIPermissions' @@ -1093,7 +1093,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function postSave(&$dao) { + public static function postSave(&$dao) { $hookName = 'civicrm_postSave_' . $dao->getTableName(); return self::singleton()->invoke(1, $dao, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, @@ -1109,7 +1109,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function summaryActions(&$actions, $contactID = NULL) { + public static function summaryActions(&$actions, $contactID = NULL) { return self::singleton()->invoke(2, $actions, $contactID, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_summaryActions' @@ -1136,7 +1136,7 @@ abstract class CRM_Utils_Hook { * * @return void modify the header and values object to pass the data u need */ - static function searchColumns($objectName, &$headers, &$rows, &$selector) { + public static function searchColumns($objectName, &$headers, &$rows, &$selector) { return self::singleton()->invoke(4, $objectName, $headers, $rows, $selector, self::$_nullObject, self::$_nullObject, 'civicrm_searchColumns' @@ -1152,7 +1152,7 @@ abstract class CRM_Utils_Hook { * @return null * @access public */ - static function buildUFGroupsForModule($moduleName, &$ufGroups) { + public static function buildUFGroupsForModule($moduleName, &$ufGroups) { return self::singleton()->invoke(2, $moduleName, $ufGroups, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_buildUFGroupsForModule' @@ -1175,7 +1175,7 @@ abstract class CRM_Utils_Hook { * @return null * @access public */ - static function emailProcessorContact($email, $contactID, &$result) { + public static function emailProcessorContact($email, $contactID, &$result) { return self::singleton()->invoke(3, $email, $contactID, $result, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_emailProcessorContact' @@ -1214,7 +1214,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function alterMailingLabelParams(&$args) { + public static function alterMailingLabelParams(&$args) { return self::singleton()->invoke(1, $args, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, @@ -1233,7 +1233,7 @@ abstract class CRM_Utils_Hook { * @return mixed * @access public */ - static function alterContent(&$content, $context, $tplName, &$object) { + public static function alterContent(&$content, $context, $tplName, &$object) { return self::singleton()->invoke(4, $content, $context, $tplName, $object, self::$_nullObject, self::$_nullObject, 'civicrm_alterContent' @@ -1252,7 +1252,7 @@ abstract class CRM_Utils_Hook { * @return mixed * @access public */ - static function alterTemplateFile($formName, &$form, $context, &$tplName) { + public static function alterTemplateFile($formName, &$form, $context, &$tplName) { return self::singleton()->invoke(4, $formName, $form, $context, $tplName, self::$_nullObject, self::$_nullObject, 'civicrm_alterTemplateFile' @@ -1276,7 +1276,7 @@ abstract class CRM_Utils_Hook { * templatizing logging and other hooks * @return mixed */ - static function triggerInfo(&$info, $tableName = NULL) { + public static function triggerInfo(&$info, $tableName = NULL) { return self::singleton()->invoke(2, $info, $tableName, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, @@ -1289,7 +1289,7 @@ abstract class CRM_Utils_Hook { * Each module will receive hook_civicrm_install during its own installation (but not during the * installation of unrelated modules). */ - static function install() { + public static function install() { return self::singleton()->invoke(0, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, @@ -1302,7 +1302,7 @@ abstract class CRM_Utils_Hook { * Each module will receive hook_civicrm_uninstall during its own uninstallation (but not during the * uninstallation of unrelated modules). */ - static function uninstall() { + public static function uninstall() { return self::singleton()->invoke(0, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, @@ -1315,7 +1315,7 @@ abstract class CRM_Utils_Hook { * Each module will receive hook_civicrm_enable during its own re-enablement (but not during the * re-enablement of unrelated modules). */ - static function enable() { + public static function enable() { return self::singleton()->invoke(0, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, @@ -1328,7 +1328,7 @@ abstract class CRM_Utils_Hook { * Each module will receive hook_civicrm_disable during its own disablement (but not during the * disablement of unrelated modules). */ - static function disable() { + public static function disable() { return self::singleton()->invoke(0, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, @@ -1343,7 +1343,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function alterReportVar($varType, &$var, &$object) { + public static function alterReportVar($varType, &$var, &$object) { return self::singleton()->invoke(3, $varType, $var, $object, self::$_nullObject, self::$_nullObject, self::$_nullObject, @@ -1364,7 +1364,7 @@ abstract class CRM_Utils_Hook { * TRUE, if $op is 'check' and upgrades are pending. * FALSE, if $op is 'check' and upgrades are not pending. */ - static function upgrade($op, CRM_Queue_Queue $queue = NULL) { + public static function upgrade($op, CRM_Queue_Queue $queue = NULL) { return self::singleton()->invoke(2, $op, $queue, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, @@ -1382,7 +1382,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function postEmailSend(&$params) { + public static function postEmailSend(&$params) { return self::singleton()->invoke(1, $params, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, @@ -1398,7 +1398,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function alterSettingsFolders(&$settingsFolders) { + public static function alterSettingsFolders(&$settingsFolders) { return self::singleton()->invoke(1, $settingsFolders, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, @@ -1416,7 +1416,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function alterSettingsMetaData(&$settingsMetaData, $domainID, $profile) { + public static function alterSettingsMetaData(&$settingsMetaData, $domainID, $profile) { return self::singleton()->invoke(3, $settingsMetaData, $domainID, $profile, self::$_nullObject, self::$_nullObject, self::$_nullObject, @@ -1434,7 +1434,7 @@ abstract class CRM_Utils_Hook { * @return null * The return value is ignored */ - static function apiWrappers(&$wrappers, $apiRequest) { + public static function apiWrappers(&$wrappers, $apiRequest) { return self::singleton() ->invoke(2, $wrappers, $apiRequest, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_apiWrappers' @@ -1449,7 +1449,7 @@ abstract class CRM_Utils_Hook { * @return null * The return value is ignored. */ - static function cron($jobManager) { + public static function cron($jobManager) { return self::singleton()->invoke(1, $jobManager, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_cron' @@ -1467,7 +1467,7 @@ abstract class CRM_Utils_Hook { * @return null * The return value is ignored */ - static function permission(&$permissions) { + public static function permission(&$permissions) { return self::singleton()->invoke(1, $permissions, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_permission' @@ -1487,7 +1487,7 @@ abstract class CRM_Utils_Hook { * @return null * The return value is ignored */ - static function entityTypes(&$entityTypes) { + public static function entityTypes(&$entityTypes) { return self::singleton()->invoke(1, $entityTypes, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_entityTypes' ); @@ -1499,7 +1499,7 @@ abstract class CRM_Utils_Hook { * @param string $name * @return mixed */ - static function buildProfile($name) { + public static function buildProfile($name) { return self::singleton()->invoke(1, $name, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_buildProfile'); } @@ -1510,7 +1510,7 @@ abstract class CRM_Utils_Hook { * @param string $name * @return mixed */ - static function validateProfile($name) { + public static function validateProfile($name) { return self::singleton()->invoke(1, $name, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_validateProfile'); } @@ -1521,7 +1521,7 @@ abstract class CRM_Utils_Hook { * @param string $name * @return mixed */ - static function processProfile($name) { + public static function processProfile($name) { return self::singleton()->invoke(1, $name, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_processProfile'); } @@ -1532,7 +1532,7 @@ abstract class CRM_Utils_Hook { * @param string $name * @return mixed */ - static function viewProfile($name) { + public static function viewProfile($name) { return self::singleton()->invoke(1, $name, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_viewProfile'); } @@ -1543,7 +1543,7 @@ abstract class CRM_Utils_Hook { * @param string $name * @return mixed */ - static function searchProfile($name) { + public static function searchProfile($name) { return self::singleton()->invoke(1, $name, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_searchProfile'); } @@ -1558,7 +1558,7 @@ abstract class CRM_Utils_Hook { * * @return null the return value is ignored */ - static function alterBadge($labelName, &$label, &$format, &$participant) { + public static function alterBadge($labelName, &$label, &$format, &$participant) { return self::singleton()->invoke(4, $labelName, $label, $format, $participant, self::$_nullObject, self::$_nullObject, 'civicrm_alterBadge'); } @@ -1572,7 +1572,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function alterBarcode( &$data, $type = 'barcode', $context = 'name_badge' ) { + public static function alterBarcode( &$data, $type = 'barcode', $context = 'name_badge' ) { return self::singleton()->invoke(3, $data, $type, $context, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_alterBarcode'); } @@ -1590,7 +1590,7 @@ abstract class CRM_Utils_Hook { * @return mixed * @see Mail::factory */ - static function alterMail(&$mailer, $driver, $params) { + public static function alterMail(&$mailer, $driver, $params) { return self::singleton() ->invoke(3, $mailer, $driver, $params, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_alterMailer'); } @@ -1604,7 +1604,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function queryObjects(&$queryObjects, $type = 'Contact') { + public static function queryObjects(&$queryObjects, $type = 'Contact') { return self::singleton()->invoke(2, $queryObjects, $type, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_queryObjects'); } @@ -1618,7 +1618,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function dashboard_defaults($availableDashlets, &$defaultDashlets) { + public static function dashboard_defaults($availableDashlets, &$defaultDashlets) { return self::singleton()->invoke(2, $availableDashlets, $defaultDashlets, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_dashboard_defaults'); } @@ -1633,7 +1633,7 @@ abstract class CRM_Utils_Hook { * * @return void */ - static function pre_case_merge($mainContactId, $mainCaseId = NULL, $otherContactId = NULL, $otherCaseId = NULL, $changeClient = FALSE) { + public static function pre_case_merge($mainContactId, $mainCaseId = NULL, $otherContactId = NULL, $otherCaseId = NULL, $changeClient = FALSE) { return self::singleton()->invoke(5, $mainContactId, $mainCaseId, $otherContactId, $otherCaseId, $changeClient, self::$_nullObject, 'civicrm_pre_case_merge'); } @@ -1648,7 +1648,7 @@ abstract class CRM_Utils_Hook { * * @return void */ - static function post_case_merge($mainContactId, $mainCaseId = NULL, $otherContactId = NULL, $otherCaseId = NULL, $changeClient = FALSE) { + public static function post_case_merge($mainContactId, $mainCaseId = NULL, $otherContactId = NULL, $otherCaseId = NULL, $changeClient = FALSE) { return self::singleton()->invoke(5, $mainContactId, $mainCaseId, $otherContactId, $otherCaseId, $changeClient, self::$_nullObject, 'civicrm_post_case_merge'); } @@ -1664,7 +1664,7 @@ abstract class CRM_Utils_Hook { * * @return mixed */ - static function alterDisplayName($displayName, $contactId, $dao) { + public static function alterDisplayName($displayName, $contactId, $dao) { return self::singleton()->invoke(3, $displayName, $contactId, $dao, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_contact_get_displayname' @@ -1685,7 +1685,7 @@ abstract class CRM_Utils_Hook { * } * @endcode */ - static function angularModules(&$angularModules) { + public static function angularModules(&$angularModules) { return self::singleton()->invoke(1, $angularModules, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_angularModules' @@ -1697,7 +1697,7 @@ abstract class CRM_Utils_Hook { * * @param \Civi\CCase\Analyzer $analyzer */ - static function caseChange(\Civi\CCase\Analyzer $analyzer) { + public static function caseChange(\Civi\CCase\Analyzer $analyzer) { $event = new \Civi\CCase\Event\CaseChangeEvent($analyzer); \Civi\Core\Container::singleton()->get('dispatcher')->dispatch("hook_civicrm_caseChange", $event); @@ -1723,7 +1723,7 @@ abstract class CRM_Utils_Hook { * Note: if making "url" CRM_Utils_System::url(), set $htmlize=false * @return mixed */ - static function crudLink($spec, $bao, &$link) { + public static function crudLink($spec, $bao, &$link) { return self::singleton()->invoke(3, $spec, $bao, $link, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_crudLink' @@ -1734,7 +1734,7 @@ abstract class CRM_Utils_Hook { * @param array $fileSearches * @return mixed */ - static function fileSearches(&$fileSearches) { + public static function fileSearches(&$fileSearches) { return self::singleton()->invoke(1, $fileSearches, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_fileSearches' diff --git a/CRM/Utils/Hook/DrupalBase.php b/CRM/Utils/Hook/DrupalBase.php index 68a01f555c..9be37b1602 100644 --- a/CRM/Utils/Hook/DrupalBase.php +++ b/CRM/Utils/Hook/DrupalBase.php @@ -82,7 +82,7 @@ class CRM_Utils_Hook_DrupalBase extends CRM_Utils_Hook { /** * Build the list of modules to be processed for hooks. */ - function buildModuleList() { + public function buildModuleList() { if ($this->isBuilt === FALSE) { if ($this->drupalModules === NULL) { if (function_exists('module_list')) { diff --git a/CRM/Utils/Hook/UnitTests.php b/CRM/Utils/Hook/UnitTests.php index 773418ea08..bd4c9b9504 100644 --- a/CRM/Utils/Hook/UnitTests.php +++ b/CRM/Utils/Hook/UnitTests.php @@ -40,7 +40,7 @@ class CRM_Utils_Hook_UnitTests extends CRM_Utils_Hook { protected $civiModules = NULL; // Call this in CiviUnitTestCase::setUp() - function reset() { + public function reset() { $this->mockObject = NULL; $this->adhocHooks = array(); } @@ -49,14 +49,14 @@ class CRM_Utils_Hook_UnitTests extends CRM_Utils_Hook { * Use a unit-testing mock object to handle hook invocations * e.g. hook_civicrm_foo === $mockObject->foo() */ - function setMock($mockObject) { + public function setMock($mockObject) { $this->mockObject = $mockObject; } /** * Register a piece of code to run when invoking a hook */ - function setHook($hook, $callable) { + public function setHook($hook, $callable) { $this->adhocHooks[$hook] = $callable; } diff --git a/CRM/Utils/Hook/WordPress.php b/CRM/Utils/Hook/WordPress.php index 8dee9ebd4e..9dc05702d9 100644 --- a/CRM/Utils/Hook/WordPress.php +++ b/CRM/Utils/Hook/WordPress.php @@ -171,7 +171,7 @@ class CRM_Utils_Hook_WordPress extends CRM_Utils_Hook { * * Copied and adapted from: CRM/Utils/Hook/Drupal6.php */ - function buildModuleList() { + public function buildModuleList() { if ($this->isBuilt === FALSE) { if ($this->wordpressModules === NULL) { diff --git a/CRM/Utils/ICalendar.php b/CRM/Utils/ICalendar.php index 3125a94cb5..3050001982 100644 --- a/CRM/Utils/ICalendar.php +++ b/CRM/Utils/ICalendar.php @@ -50,7 +50,7 @@ class CRM_Utils_ICalendar { * @return Escaped text * */ - static function formatText($text) { + public static function formatText($text) { $text = strip_tags($text); $text = str_replace("\"", "DQUOTE", $text); $text = str_replace("\\", "\\\\", $text); @@ -70,7 +70,7 @@ class CRM_Utils_ICalendar { * * @return Escaped date */ - static function formatDate($date, $gdata = FALSE) { + public static function formatDate($date, $gdata = FALSE) { if ($gdata) { return date("Y-m-d\TH:i:s.000", @@ -100,7 +100,7 @@ class CRM_Utils_ICalendar { * * @return void */ - static function send($calendar, $content_type = 'text/calendar', $charset = 'us-ascii', $fileName = NULL, $disposition = NULL) { + public static function send($calendar, $content_type = 'text/calendar', $charset = 'us-ascii', $fileName = NULL, $disposition = NULL) { $config = CRM_Core_Config::singleton(); $lang = $config->lcMessages; header("Content-Language: $lang"); diff --git a/CRM/Utils/JSON.php b/CRM/Utils/JSON.php index 4c6cc1e265..a1182efeda 100644 --- a/CRM/Utils/JSON.php +++ b/CRM/Utils/JSON.php @@ -42,7 +42,7 @@ class CRM_Utils_JSON { * Output json to the client * @param mixed $input */ - static function output($input) { + public static function output($input) { header('Content-Type: application/json'); echo json_encode($input); CRM_Utils_System::civiExit(); @@ -59,7 +59,7 @@ class CRM_Utils_JSON { * @return string $jsonObject JSON array * @static */ - static function encode($params, $identifier = 'id') { + public static function encode($params, $identifier = 'id') { $buildObject = array(); foreach ($params as $value) { $name = addslashes($value['name']); @@ -81,7 +81,7 @@ class CRM_Utils_JSON { * * @return json encode string */ - static function encodeSelector(&$params, $page, $total, $selectorElements) { + public static function encodeSelector(&$params, $page, $total, $selectorElements) { $json = ""; $json .= "{\n"; $json .= "page: $page,\n"; @@ -125,7 +125,7 @@ class CRM_Utils_JSON { * @return string * */ - static function encodeDataTableSelector($params, $sEcho, $iTotal, $iFilteredTotal, $selectorElements) { + public static function encodeDataTableSelector($params, $sEcho, $iTotal, $iFilteredTotal, $selectorElements) { $sOutput = '{'; $sOutput .= '"sEcho": ' . intval($sEcho) . ', '; $sOutput .= '"iTotalRecords": ' . $iTotal . ', '; diff --git a/CRM/Utils/Mail.php b/CRM/Utils/Mail.php index f4254db1de..7875f29eae 100644 --- a/CRM/Utils/Mail.php +++ b/CRM/Utils/Mail.php @@ -58,7 +58,7 @@ class CRM_Utils_Mail { * * @return boolean true if a mail was sent, else false */ - static function send(&$params) { + public static function send(&$params) { $returnPath = CRM_Core_BAO_MailSettings::defaultReturnPath(); $includeMessageId = CRM_Core_BAO_MailSettings::includeMessageId(); $emailDomain = CRM_Core_BAO_MailSettings::defaultDomain(); @@ -198,7 +198,7 @@ class CRM_Utils_Mail { * * @return string */ - static function errorMessage($mailer, $result) { + public static function errorMessage($mailer, $result) { $message = '

' . ts('An error occurred when CiviCRM attempted to send an email (via %1). If you received this error after submitting on online contribution or event registration - the transaction was completed, but we were unable to send the email receipt.', array( 1 => 'SMTP')) . '

' . '

' . ts('The mail library returned the following error message:') . '
' . $result->getMessage() . '

' . '

' . ts('This is probably related to a problem in your Outbound Email Settings (Administer CiviCRM » System Settings » Outbound Email), OR the FROM email address specifically configured for your contribution page or event. Possible causes are:') . '

'; @@ -220,7 +220,7 @@ class CRM_Utils_Mail { * @param $headers * @param $message */ - static function logger(&$to, &$headers, &$message) { + public static function logger(&$to, &$headers, &$message) { if (is_array($to)) { $toString = implode(', ', $to); $fileName = $to[0]; @@ -259,7 +259,7 @@ class CRM_Utils_Mail { * @return string the plucked email address * @static */ - static function pluckEmailFromHeader($header) { + public static function pluckEmailFromHeader($header) { preg_match('/<([^<]*)>$/', $header, $matches); if (isset($matches[1])) { @@ -275,7 +275,7 @@ class CRM_Utils_Mail { * @access public * @static */ - static function validOutBoundMail() { + public static function validOutBoundMail() { $mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, 'mailing_backend' ); @@ -309,7 +309,7 @@ class CRM_Utils_Mail { * * @return mixed */ - static function &setMimeParams(&$message, $params = NULL) { + public static function &setMimeParams(&$message, $params = NULL) { static $mimeParams = NULL; if (!$params) { if (!$mimeParams) { @@ -333,7 +333,7 @@ class CRM_Utils_Mail { * * @return null|string */ - static function formatRFC822Email($name, $email, $useQuote = FALSE) { + public static function formatRFC822Email($name, $email, $useQuote = FALSE) { $result = NULL; $name = trim($name); @@ -371,7 +371,7 @@ class CRM_Utils_Mail { * * This code has been copied and adapted from ezc/Mail/src/tools.php */ - static function formatRFC2822Name($name) { + public static function formatRFC2822Name($name) { $name = trim($name); if (!empty($name)) { // remove the quotes around the name part if they are already there @@ -395,7 +395,7 @@ class CRM_Utils_Mail { * * @return array $attachments */ - static function appendPDF($fileName, $html, $format = NULL) { + public static function appendPDF($fileName, $html, $format = NULL) { $pdf_filename = CRM_Core_Config::singleton()->templateCompileDir . CRM_Utils_File::makeFileName($fileName); //FIXME : CRM-7894 diff --git a/CRM/Utils/Mail/EmailProcessor.php b/CRM/Utils/Mail/EmailProcessor.php index bb9af0e84d..f3e1e1f133 100644 --- a/CRM/Utils/Mail/EmailProcessor.php +++ b/CRM/Utils/Mail/EmailProcessor.php @@ -49,7 +49,7 @@ class CRM_Utils_Mail_EmailProcessor { * @return boolean always returns true (for the api). at a later stage we should * fix this to return true on success / false on failure etc */ - static function processBounces() { + public static function processBounces() { $dao = new CRM_Core_DAO_MailSettings; $dao->domain_id = CRM_Core_Config::domainID(); $dao->is_default = TRUE; @@ -71,7 +71,7 @@ class CRM_Utils_Mail_EmailProcessor { * * @return void */ - static function cleanupDir($dir, $age = 5184000) { + public static function cleanupDir($dir, $age = 5184000) { // return early if we can’t read/write the dir if (!is_writable($dir) or !is_readable($dir) or !is_dir($dir)) { return; @@ -97,7 +97,7 @@ class CRM_Utils_Mail_EmailProcessor { * * @return void */ - static function processActivities() { + public static function processActivities() { $dao = new CRM_Core_DAO_MailSettings; $dao->domain_id = CRM_Core_Config::domainID(); $dao->is_default = FALSE; @@ -120,7 +120,7 @@ class CRM_Utils_Mail_EmailProcessor { * * @return void */ - static function process($civiMail = TRUE) { + public static function process($civiMail = TRUE) { $dao = new CRM_Core_DAO_MailSettings; $dao->domain_id = CRM_Core_Config::domainID(); $dao->find(); @@ -136,7 +136,7 @@ class CRM_Utils_Mail_EmailProcessor { * * @throws Exception */ - static function _process($civiMail, $dao) { + public static function _process($civiMail, $dao) { // 0 = activities; 1 = bounce; $usedfor = $dao->is_default; diff --git a/CRM/Utils/Mail/Incoming.php b/CRM/Utils/Mail/Incoming.php index 26e3ce1cc5..60dfd987a3 100644 --- a/CRM/Utils/Mail/Incoming.php +++ b/CRM/Utils/Mail/Incoming.php @@ -44,7 +44,7 @@ class CRM_Utils_Mail_Incoming { * * @return string */ - function formatMail($mail, &$attachments) { + public function formatMail($mail, &$attachments) { $t = ''; $t .= "From: " . self::formatAddress($mail->from) . "\n"; $t .= "To: " . self::formatAddresses($mail->to) . "\n"; @@ -94,7 +94,7 @@ class CRM_Utils_Mail_Incoming { * * @throws Exception */ - function formatMailMultipart($part, &$attachments) { + public function formatMailMultipart($part, &$attachments) { if ($part instanceof ezcMailMultiPartAlternative) { return self::formatMailMultipartAlternative($part, $attachments); } @@ -124,7 +124,7 @@ class CRM_Utils_Mail_Incoming { * * @return string */ - function formatMailMultipartMixed($part, &$attachments) { + public function formatMailMultipartMixed($part, &$attachments) { $t = ''; foreach ($part->getParts() as $key => $alternativePart) { $t .= self::formatMailPart($alternativePart, $attachments); @@ -138,7 +138,7 @@ class CRM_Utils_Mail_Incoming { * * @return string */ - function formatMailMultipartRelated($part, &$attachments) { + public function formatMailMultipartRelated($part, &$attachments) { $t = ''; $t .= "-RELATED MAIN PART-\n"; $t .= self::formatMailPart($part->getMainPart(), $attachments); @@ -156,7 +156,7 @@ class CRM_Utils_Mail_Incoming { * * @return string */ - function formatMailMultipartDigest($part, &$attachments) { + public function formatMailMultipartDigest($part, &$attachments) { $t = ''; foreach ($part->getParts() as $key => $alternativePart) { $t .= "-DIGEST-$key-\n"; @@ -172,7 +172,7 @@ class CRM_Utils_Mail_Incoming { * * @return string */ - function formatMailRfc822Digest($part, &$attachments) { + public function formatMailRfc822Digest($part, &$attachments) { $t = ''; $t .= "-DIGEST-ITEM-\n"; $t .= "Item:\n\n"; @@ -187,7 +187,7 @@ class CRM_Utils_Mail_Incoming { * * @return string */ - function formatMailMultipartAlternative($part, &$attachments) { + public function formatMailMultipartAlternative($part, &$attachments) { $t = ''; foreach ($part->getParts() as $key => $alternativePart) { $t .= "-ALTERNATIVE ITEM $key-\n"; @@ -214,7 +214,7 @@ class CRM_Utils_Mail_Incoming { * * @return string */ - function formatMailMultipartReport($part, &$attachments) { + public function formatMailMultipartReport($part, &$attachments) { $t = ''; foreach ($part->getParts() as $key => $reportPart) { $t .= "-REPORT-$key-\n"; @@ -230,7 +230,7 @@ class CRM_Utils_Mail_Incoming { * * @return null */ - function formatMailFile($part, &$attachments) { + public function formatMailFile($part, &$attachments) { $attachments[] = array( 'dispositionType' => $part->dispositionType, 'contentType' => $part->contentType, @@ -246,7 +246,7 @@ class CRM_Utils_Mail_Incoming { * * @return string */ - function formatAddresses($addresses) { + public function formatAddresses($addresses) { $fa = array(); foreach ($addresses as $address) { $fa[] = self::formatAddress($address); @@ -259,7 +259,7 @@ class CRM_Utils_Mail_Incoming { * * @return string */ - function formatAddress($address) { + public function formatAddress($address) { $name = ''; if (!empty($address->name)) { $name = "{$address->name} "; @@ -273,7 +273,7 @@ class CRM_Utils_Mail_Incoming { * @return array * @throws Exception */ - function &parse(&$file) { + public function &parse(&$file) { // check that the file exists and has some content if (!file_exists($file) || diff --git a/CRM/Utils/Migrate/Export.php b/CRM/Utils/Migrate/Export.php index 8eea677570..5d1f1d9ac7 100644 --- a/CRM/Utils/Migrate/Export.php +++ b/CRM/Utils/Migrate/Export.php @@ -55,7 +55,7 @@ class CRM_Utils_Migrate_Export { /** * */ - function __construct() { + public function __construct() { $this->_xml = array( 'customGroup' => array( 'data' => array(), @@ -171,7 +171,7 @@ class CRM_Utils_Migrate_Export { * * @return void */ - function build() { + public function build() { // fetch the option group / values for // activity type and event_type @@ -270,7 +270,7 @@ class CRM_Utils_Migrate_Export { * @param array $customGroupIds list of custom groups to export * @return void */ - function buildCustomGroups($customGroupIds) { + public function buildCustomGroups($customGroupIds) { $customGroupIdsSql = implode(',', array_filter($customGroupIds, 'is_numeric')); if (empty($customGroupIdsSql)) { return; @@ -323,7 +323,7 @@ class CRM_Utils_Migrate_Export { * @param array $ufGroupIds list of custom groups to export * @return void */ - function buildUFGroups($ufGroupIds) { + public function buildUFGroups($ufGroupIds) { $ufGroupIdsSql = implode(',', array_filter($ufGroupIds, 'is_numeric')); if (empty($ufGroupIdsSql)) { return; @@ -361,7 +361,7 @@ class CRM_Utils_Migrate_Export { * * @return string XML */ - function toXML() { + public function toXML() { $buffer = ''; $buffer .= "\n\n\n"; foreach (array_keys($this->_xml) as $key) { @@ -385,7 +385,7 @@ class CRM_Utils_Migrate_Export { * * @return array */ - function toArray() { + public function toArray() { $result = array(); foreach (array_keys($this->_xml) as $key) { if (!empty($this->_xml[$key]['data'])) { @@ -400,7 +400,7 @@ class CRM_Utils_Migrate_Export { * @param string $daoName * @param null $sql */ - function fetch($groupName, $daoName, $sql = NULL) { + public function fetch($groupName, $daoName, $sql = NULL) { $idNameFields = isset($this->_xml[$groupName]['idNameFields']) ? $this->_xml[$groupName]['idNameFields'] : NULL; $mappedFields = isset($this->_xml[$groupName]['mappedFields']) ? $this->_xml[$groupName]['mappedFields'] : NULL; @@ -458,7 +458,7 @@ class CRM_Utils_Migrate_Export { * * @return array */ - function exportDAO($objectName, $object, $mappedFields) { + public function exportDAO($objectName, $object, $mappedFields) { $dbFields = & $object->fields(); // Filter the list of keys and values so that we only export interesting stuff @@ -555,7 +555,7 @@ class CRM_Utils_Migrate_Export { * @throws Exception * @return string XML */ - function renderTextTag($name, $value, $prefix = '') { + public function renderTextTag($name, $value, $prefix = '') { if (!preg_match('/^[a-zA-Z0-9\_]+$/', $name)) { throw new Exception("Malformed tag name: $name"); } diff --git a/CRM/Utils/Migrate/ExportJSON.php b/CRM/Utils/Migrate/ExportJSON.php index 657f5fd186..3e93bb74c0 100644 --- a/CRM/Utils/Migrate/ExportJSON.php +++ b/CRM/Utils/Migrate/ExportJSON.php @@ -52,7 +52,7 @@ class CRM_Utils_Migrate_ExportJSON { /** * @param array $params */ - function __construct(&$params) { + public function __construct(&$params) { foreach ($params as $name => $value) { $varName = '_' . $name; $this->$varName = $value; @@ -62,7 +62,7 @@ class CRM_Utils_Migrate_ExportJSON { /** * Split a large array of contactIDs into more manageable smaller chunks */ - function &splitContactIDs(&$contactIDs) { + public function &splitContactIDs(&$contactIDs) { // contactIDs could be a real large array, so we split it up into // smaller chunks and then general xml for each chunk $chunks = array(); @@ -91,7 +91,7 @@ class CRM_Utils_Migrate_ExportJSON { /** * Given a set of contact IDs get the values */ - function getValues(&$contactIDs, &$additionalContactIDs) { + public function getValues(&$contactIDs, &$additionalContactIDs) { $this->contact($contactIDs); $this->address($contactIDs); @@ -112,7 +112,7 @@ class CRM_Utils_Migrate_ExportJSON { $this->activity($contactIDs, $additionalContactIDs); } - function metaData() { + public function metaData() { $optionGroupVars = array( 'prefix_id' => 'individual_prefix', 'suffix_id' => 'individual_suffix', @@ -140,7 +140,7 @@ class CRM_Utils_Migrate_ExportJSON { /** * @param $tables */ - function auxTable($tables) { + public function auxTable($tables) { foreach ($tables as $tableName => $daoName) { $fields = & $this->dbFields($daoName, TRUE); @@ -152,7 +152,7 @@ class CRM_Utils_Migrate_ExportJSON { /** * @param $optionGroupVars */ - function optionGroup($optionGroupVars) { + public function optionGroup($optionGroupVars) { $names = array_values($optionGroupVars); $str = array(); foreach ($names as $name) { @@ -215,7 +215,7 @@ SELECT * * @param string $tableName * @param $fields */ - function sql($sql, $tableName, &$fields) { + public function sql($sql, $tableName, &$fields) { $dao = & CRM_Core_DAO::executeQuery($sql); while ($dao->fetch()) { @@ -236,7 +236,7 @@ SELECT * /** * @param $contactIDs */ - function contact(&$contactIDs) { + public function contact(&$contactIDs) { $fields = & $this->dbFields('CRM_Contact_DAO_Contact', TRUE); $this->table($contactIDs, 'civicrm_contact', $fields, 'id', NULL); } @@ -244,7 +244,7 @@ SELECT * /** * @param $contactIDs */ - function note(&$contactIDs) { + public function note(&$contactIDs) { $fields = & $this->dbFields('CRM_Core_DAO_Note', TRUE); $this->table($contactIDs, 'civicrm_note', $fields, 'entity_id', "entity_table = 'civicrm_contact'"); } @@ -252,7 +252,7 @@ SELECT * /** * @param $contactIDs */ - function phone(&$contactIDs) { + public function phone(&$contactIDs) { $fields = & $this->dbFields('CRM_Core_DAO_Phone', TRUE); $this->table($contactIDs, 'civicrm_phone', $fields, 'contact_id', NULL); } @@ -260,7 +260,7 @@ SELECT * /** * @param $contactIDs */ - function email(&$contactIDs) { + public function email(&$contactIDs) { $fields = & $this->dbFields('CRM_Core_DAO_Email', TRUE); $this->table($contactIDs, 'civicrm_email', $fields, 'contact_id', NULL); } @@ -268,7 +268,7 @@ SELECT * /** * @param $contactIDs */ - function im(&$contactIDs) { + public function im(&$contactIDs) { $fields = & $this->dbFields('CRM_Core_DAO_IM', TRUE); $this->table($contactIDs, 'civicrm_im', $fields, 'contact_id', NULL); } @@ -276,7 +276,7 @@ SELECT * /** * @param $contactIDs */ - function website(&$contactIDs) { + public function website(&$contactIDs) { $fields = & $this->dbFields('CRM_Core_DAO_Website', TRUE); $this->table($contactIDs, 'civicrm_website', $fields, 'contact_id', NULL); } @@ -284,7 +284,7 @@ SELECT * /** * @param $contactIDs */ - function address(&$contactIDs) { + public function address(&$contactIDs) { $fields = & $this->dbFields('CRM_Core_DAO_Email', TRUE); $this->table($contactIDs, 'civicrm_address', $fields, 'contact_id', NULL); } @@ -292,7 +292,7 @@ SELECT * /** * @param $contactIDs */ - function groupContact(&$contactIDs) { + public function groupContact(&$contactIDs) { $fields = & $this->dbFields('CRM_Contact_DAO_GroupContact', TRUE); $this->table($contactIDs, 'civicrm_group_contact', $fields, 'contact_id', NULL); } @@ -302,7 +302,7 @@ SELECT * /** * @param $contactIDs */ - function group(&$contactIDs) { + public function group(&$contactIDs) { // handle groups only once static $_groupsHandled = array(); @@ -332,7 +332,7 @@ WHERE contact_id IN ( $ids ) /** * @param $groupIDs */ - function savedSearch(&$groupIDs) { + public function savedSearch(&$groupIDs) { if (empty($groupIDs)) { return; } @@ -352,7 +352,7 @@ WHERE g.id IN ( $idString ) /** * @param $contactIDs */ - function entityTag(&$contactIDs) { + public function entityTag(&$contactIDs) { $fields = & $this->dbFields('CRM_Core_DAO_EntityTag', TRUE); $this->table($contactIDs, 'civicrm_entity_tag', $fields, 'entity_id', "entity_table = 'civicrm_contact'"); } @@ -360,7 +360,7 @@ WHERE g.id IN ( $idString ) /** * @param $contactIDs */ - function tag(&$contactIDs) { + public function tag(&$contactIDs) { // handle tags only once static $_tagsHandled = array(); @@ -389,7 +389,7 @@ AND entity_table = 'civicrm_contact' * @param $contactIDs * @param $additionalContacts */ - function relationship(&$contactIDs, &$additionalContacts) { + public function relationship(&$contactIDs, &$additionalContacts) { // handle relationships only once static $_relationshipsHandled = array(); @@ -439,7 +439,7 @@ AND entity_table = 'civicrm_contact' * @param $contactIDs * @param $additionalContacts */ - function activity(&$contactIDs, &$additionalContacts) { + public function activity(&$contactIDs, &$additionalContacts) { static $_activitiesHandled = array(); $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); @@ -499,7 +499,7 @@ WHERE ac.contact_id IN ( $ids ) * @param string $name * @param $value */ - function appendValue($id, $name, $value) { + public function appendValue($id, $name, $value) { if (empty($value)) { return; } @@ -517,7 +517,7 @@ WHERE ac.contact_id IN ( $ids ) * * @return array */ - function dbFields($daoName, $onlyKeys = FALSE) { + public function dbFields($daoName, $onlyKeys = FALSE) { static $_fieldsRetrieved = array(); if (!isset($_fieldsRetrieved[$daoName])) { @@ -551,7 +551,7 @@ WHERE ac.contact_id IN ( $ids ) * @param $contactIDs * @param $additionalContacts */ - function addAdditionalContacts($contactIDs, &$additionalContacts) { + public function addAdditionalContacts($contactIDs, &$additionalContacts) { if (!$this->_discoverContacts) { return; } @@ -569,7 +569,7 @@ WHERE ac.contact_id IN ( $ids ) /** * @param $contactIDs */ - function export(&$contactIDs) { + public function export(&$contactIDs) { $chunks = & $this->splitContactIDs($contactIDs); $additionalContactIDs = array(); diff --git a/CRM/Utils/Migrate/Import.php b/CRM/Utils/Migrate/Import.php index 38a43a9f81..9b02afa1e2 100644 --- a/CRM/Utils/Migrate/Import.php +++ b/CRM/Utils/Migrate/Import.php @@ -36,7 +36,7 @@ class CRM_Utils_Migrate_Import { /** * */ - function __construct() { + public function __construct() { } /** @@ -46,7 +46,7 @@ class CRM_Utils_Migrate_Import { * @throws CRM_Core_Exception * @return void; */ - function run($file) { + public function run($file) { // read xml file $dom = new DomDocument(); if (! $dom->load($file)) { @@ -63,7 +63,7 @@ class CRM_Utils_Migrate_Import { * @param SimpleXMLElement $xml * @return void */ - function runXmlElement($xml) { + public function runXmlElement($xml) { $idMap = array( 'custom_group' => array(), 'option_group' => array(), @@ -100,7 +100,7 @@ class CRM_Utils_Migrate_Import { * * @return bool */ - function copyData(&$dao, &$xml, $save = FALSE, $keyName = NULL) { + public function copyData(&$dao, &$xml, $save = FALSE, $keyName = NULL) { if ($keyName) { if (isset($xml->$keyName)) { $dao->$keyName = (string ) $xml->$keyName; @@ -138,7 +138,7 @@ class CRM_Utils_Migrate_Import { * @param $xml * @param $idMap */ - function optionGroups(&$xml, &$idMap) { + public function optionGroups(&$xml, &$idMap) { foreach ($xml->OptionGroups as $optionGroupsXML) { foreach ($optionGroupsXML->OptionGroup as $optionGroupXML) { $optionGroup = new CRM_Core_DAO_OptionGroup(); @@ -152,7 +152,7 @@ class CRM_Utils_Migrate_Import { * @param $xml * @param $idMap */ - function optionValues(&$xml, &$idMap) { + public function optionValues(&$xml, &$idMap) { foreach ($xml->OptionValues as $optionValuesXML) { foreach ($optionValuesXML->OptionValue as $optionValueXML) { $optionValue = new CRM_Core_DAO_OptionValue(); @@ -175,7 +175,7 @@ WHERE v.option_group_id = %1 /** * @param $xml */ - function relationshipTypes(&$xml) { + public function relationshipTypes(&$xml) { foreach ($xml->RelationshipTypes as $relationshipTypesXML) { foreach ($relationshipTypesXML->RelationshipType as $relationshipTypeXML) { @@ -188,7 +188,7 @@ WHERE v.option_group_id = %1 /** * @param $xml */ - function contributionTypes(&$xml) { + public function contributionTypes(&$xml) { foreach ($xml->ContributionTypes as $contributionTypesXML) { foreach ($contributionTypesXML->ContributionType as $contributionTypeXML) { @@ -202,7 +202,7 @@ WHERE v.option_group_id = %1 * @param $xml * @param $idMap */ - function customGroups(&$xml, &$idMap) { + public function customGroups(&$xml, &$idMap) { foreach ($xml->CustomGroups as $customGroupsXML) { foreach ($customGroupsXML->CustomGroup as $customGroupXML) { $customGroup = new CRM_Core_DAO_CustomGroup(); @@ -334,7 +334,7 @@ AND v.name = %1 * @param $xml * @param $idMap */ - function customFields(&$xml, &$idMap) { + public function customFields(&$xml, &$idMap) { // Re-index by group id so we can build out the custom fields one table // at a time, and then rebuild the table triggers at the end, rather than // rebuilding the table triggers after each field is added (which is @@ -385,7 +385,7 @@ AND v.name = %1 * @param $xml * @param $idMap */ - function dbTemplateString(&$xml, &$idMap) { + public function dbTemplateString(&$xml, &$idMap) { foreach ($xml->Persistent as $persistentXML) { foreach ($persistentXML->Persistent as $persistent) { $persistentObj = new CRM_Core_DAO_Persistent(); @@ -402,7 +402,7 @@ AND v.name = %1 * @param $xml * @param $idMap */ - function profileGroups(&$xml, &$idMap) { + public function profileGroups(&$xml, &$idMap) { foreach ($xml->ProfileGroups as $profileGroupsXML) { foreach ($profileGroupsXML->ProfileGroup as $profileGroupXML) { $profileGroup = new CRM_Core_DAO_UFGroup(); @@ -419,7 +419,7 @@ AND v.name = %1 * * @throws Exception */ - function profileFields(&$xml, &$idMap) { + public function profileFields(&$xml, &$idMap) { foreach ($xml->ProfileFields as $profileFieldsXML) { foreach ($profileFieldsXML->ProfileField as $profileFieldXML) { $profileField = new CRM_Core_DAO_UFField(); @@ -461,7 +461,7 @@ AND f.column_name = %2 * @param $xml * @param $idMap */ - function profileJoins(&$xml, &$idMap) { + public function profileJoins(&$xml, &$idMap) { foreach ($xml->ProfileJoins as $profileJoinsXML) { foreach ($profileJoinsXML->ProfileJoin as $profileJoinXML) { $profileJoin = new CRM_Core_DAO_UFJoin(); diff --git a/CRM/Utils/Migrate/ImportJSON.php b/CRM/Utils/Migrate/ImportJSON.php index 88a84db13e..3086f89736 100644 --- a/CRM/Utils/Migrate/ImportJSON.php +++ b/CRM/Utils/Migrate/ImportJSON.php @@ -41,7 +41,7 @@ class CRM_Utils_Migrate_ImportJSON { /** * */ - function __construct() { + public function __construct() { $this->_lookupCache = array(); $this->_saveMapping = array(); } @@ -49,7 +49,7 @@ class CRM_Utils_Migrate_ImportJSON { /** * @param $file */ - function run($file) { + public function run($file) { $json = file_get_contents($file); $decodedContacts = json_decode($json); @@ -78,7 +78,7 @@ class CRM_Utils_Migrate_ImportJSON { /** * @param $contact */ - function contact(&$contact) { + public function contact(&$contact) { $this->restore($contact, 'CRM_Contact_DAO_Contact', array('id' => 'civicrm_contact'), @@ -89,7 +89,7 @@ class CRM_Utils_Migrate_ImportJSON { /** * @param $email */ - function email(&$email) { + public function email(&$email) { $this->restore($email, 'CRM_Core_DAO_Email', array('contact_id' => 'civicrm_contact') @@ -99,7 +99,7 @@ class CRM_Utils_Migrate_ImportJSON { /** * @param $phone */ - function phone(&$phone) { + public function phone(&$phone) { $this->restore($phone, 'CRM_Core_DAO_Phone', array('contact_id' => 'civicrm_contact') @@ -109,7 +109,7 @@ class CRM_Utils_Migrate_ImportJSON { /** * @param $address */ - function address(&$address) { + public function address(&$address) { $this->restore($address, 'CRM_Core_DAO_Address', array('contact_id' => 'civicrm_contact') @@ -119,7 +119,7 @@ class CRM_Utils_Migrate_ImportJSON { /** * @param $note */ - function note(&$note) { + public function note(&$note) { $this->restore($note, 'CRM_Core_DAO_Note', array('contact_id' => 'civicrm_contact'), @@ -130,7 +130,7 @@ class CRM_Utils_Migrate_ImportJSON { /** * @param $relationship */ - function relationship(&$relationship) { + public function relationship(&$relationship) { $this->restore($relationship, 'CRM_Contact_DAO_Relationship', array( @@ -144,7 +144,7 @@ class CRM_Utils_Migrate_ImportJSON { * @param $activity * @param $activityContacts */ - function activity($activity, $activityContacts) { + public function activity($activity, $activityContacts) { $this->restore($activity, 'CRM_Activity_DAO_Activity', NULL, @@ -164,7 +164,7 @@ class CRM_Utils_Migrate_ImportJSON { * @param $group * @param $groupContact */ - function group($group, $groupContact) { + public function group($group, $groupContact) { $this->restore($group, 'CRM_Contact_DAO_Group', NULL, @@ -184,7 +184,7 @@ class CRM_Utils_Migrate_ImportJSON { * @param $tag * @param $entityTag */ - function tag($tag, $entityTag) { + public function tag($tag, $entityTag) { $this->restore($tag, 'CRM_Core_DAO_Tag', array( @@ -208,7 +208,7 @@ class CRM_Utils_Migrate_ImportJSON { * @param null $lookUpMapping * @param null $dateFields */ - function restore(&$chunk, $daoName, $lookUpMapping = NULL, $dateFields = NULL) { + public function restore(&$chunk, $daoName, $lookUpMapping = NULL, $dateFields = NULL) { $object = new $daoName(); $tableName = $object->__table; @@ -261,7 +261,7 @@ class CRM_Utils_Migrate_ImportJSON { } } - function saveCache() { + public function saveCache() { $sql = "INSERT INTO civicrm_migration_mapping (master_id, slave_id, entity_table ) VALUES "; foreach ($this->_lookupCache as $tableName => & $values) { @@ -282,7 +282,7 @@ class CRM_Utils_Migrate_ImportJSON { /** * @param string $tableName */ - function populateCache($tableName) { + public function populateCache($tableName) { if (isset($this->_lookupCache[$tableName])) { return; } diff --git a/CRM/Utils/Money.php b/CRM/Utils/Money.php index b196f1a6a4..105e092d88 100644 --- a/CRM/Utils/Money.php +++ b/CRM/Utils/Money.php @@ -59,7 +59,7 @@ class CRM_Utils_Money { * * @static */ - static function format($amount, $currency = NULL, $format = NULL, $onlyNumber = FALSE, $valueFormat = NULL) { + public static function format($amount, $currency = NULL, $format = NULL, $onlyNumber = FALSE, $valueFormat = NULL) { if (CRM_Utils_System::isNull($amount)) { return ''; diff --git a/CRM/Utils/Number.php b/CRM/Utils/Number.php index b79b994cac..343a73203d 100644 --- a/CRM/Utils/Number.php +++ b/CRM/Utils/Number.php @@ -12,7 +12,7 @@ class CRM_Utils_Number { * @return float * @link https://dev.mysql.com/doc/refman/5.1/en/fixed-point-types.html */ - static function createRandomDecimal($precision) { + public static function createRandomDecimal($precision) { list ($sigFigs, $decFigs) = $precision; $rand = rand(0, pow(10, $sigFigs) - 1); return $rand / pow(10, $decFigs); @@ -28,7 +28,7 @@ class CRM_Utils_Number { * @return float * @link https://dev.mysql.com/doc/refman/5.1/en/fixed-point-types.html */ - static function createTruncatedDecimal($keyValue, $precision) { + public static function createTruncatedDecimal($keyValue, $precision) { list ($sigFigs, $decFigs) = $precision; $sign = ($keyValue < 0) ? '-1' : 1; $val = str_replace('.', '', abs($keyValue)); // ex: -123.456 ==> 123456 diff --git a/CRM/Utils/OpenFlashChart.php b/CRM/Utils/OpenFlashChart.php index 9e54e7feaf..6e8dc0bdc6 100644 --- a/CRM/Utils/OpenFlashChart.php +++ b/CRM/Utils/OpenFlashChart.php @@ -59,7 +59,7 @@ class CRM_Utils_OpenFlashChart { * @return object $chart object of open flash chart. * @static */ - static function &barChart(&$params) { + public static function &barChart(&$params) { $chart = NULL; if (empty($params)) { return $chart; @@ -188,7 +188,7 @@ class CRM_Utils_OpenFlashChart { * @return object $chart object of open flash chart. * @static */ - static function &pieChart(&$params) { + public static function &pieChart(&$params) { $chart = NULL; if (empty($params)) { return $chart; @@ -251,7 +251,7 @@ class CRM_Utils_OpenFlashChart { * @return object $chart object of open flash chart. * @static */ - static function &bar_3dChart(&$params) { + public static function &bar_3dChart(&$params) { $chart = NULL; if (empty($params)) { return $chart; @@ -396,7 +396,7 @@ class CRM_Utils_OpenFlashChart { * * @return array */ - static function chart($rows, $chart, $interval) { + public static function chart($rows, $chart, $interval) { $chartData = $dateKeys = array(); switch ($interval) { @@ -479,7 +479,7 @@ class CRM_Utils_OpenFlashChart { * * @return array */ - static function reportChart($rows, $chart, $interval, &$chartInfo) { + public static function reportChart($rows, $chart, $interval, &$chartInfo) { foreach ($interval as $key => $val) { $graph[$val] = $rows['value'][$key]; } @@ -514,7 +514,7 @@ class CRM_Utils_OpenFlashChart { * * @return array */ - static function buildChart(&$params, $chart) { + public static function buildChart(&$params, $chart) { $openFlashChart = array(); if ($chart && is_array($params) && !empty($params)) { // build the chart objects. diff --git a/CRM/Utils/PDF/Label.php b/CRM/Utils/PDF/Label.php index bb083bc50a..d2f43e0689 100644 --- a/CRM/Utils/PDF/Label.php +++ b/CRM/Utils/PDF/Label.php @@ -99,7 +99,7 @@ class CRM_Utils_PDF_Label extends TCPDF { * * @access public */ - function __construct($format, $unit = 'mm') { + public function __construct($format, $unit = 'mm') { if (is_array($format)) { // Custom format $tFormat = $format; @@ -124,7 +124,7 @@ class CRM_Utils_PDF_Label extends TCPDF { * @param $objectinstance * @param string $methodname */ - function SetGenerator($objectinstance, $methodname = 'generateLabel') { + public function SetGenerator($objectinstance, $methodname = 'generateLabel') { $this->generatorMethod = $methodname; $this->generatorObject = $objectinstance; } @@ -135,7 +135,7 @@ class CRM_Utils_PDF_Label extends TCPDF { * * @return float|int|mixed */ - function getFormatValue($name, $convert = FALSE) { + public function getFormatValue($name, $convert = FALSE) { if (isset($this->format[$name])) { $value = $this->format[$name]; $metric = $this->format['metric']; @@ -157,7 +157,7 @@ class CRM_Utils_PDF_Label extends TCPDF { * @param $format * @param $unit */ - function LabelSetFormat(&$format, $unit) { + public function LabelSetFormat(&$format, $unit) { $this->defaults = CRM_Core_BAO_LabelFormat::getDefaultValues(); $this->format = &$format; $this->formatName = $this->getFormatValue('name'); @@ -189,7 +189,7 @@ class CRM_Utils_PDF_Label extends TCPDF { /** * @param $text */ - function generateLabel($text) { + public function generateLabel($text) { $args = array( 'w' => $this->width, 'h' => 0, @@ -236,7 +236,7 @@ class CRM_Utils_PDF_Label extends TCPDF { /** * @param $texte */ - function AddPdfLabel($texte) { + public function AddPdfLabel($texte) { if ($this->countX == $this->xNumber) { // Page full, we start a new one $this->AddPage(); @@ -262,7 +262,7 @@ class CRM_Utils_PDF_Label extends TCPDF { } } - function getFontNames() { + public function getFontNames() { // Define labels for TCPDF core fonts $fontLabel = array( 'courier' => ts('Courier'), diff --git a/CRM/Utils/PDF/Utils.php b/CRM/Utils/PDF/Utils.php index 5386287681..793b35fd2d 100644 --- a/CRM/Utils/PDF/Utils.php +++ b/CRM/Utils/PDF/Utils.php @@ -42,7 +42,7 @@ class CRM_Utils_PDF_Utils { * * @return string|void */ - static function html2pdf(&$text, $fileName = 'civicrm.pdf', $output = FALSE, $pdfFormat = NULL) { + public static function html2pdf(&$text, $fileName = 'civicrm.pdf', $output = FALSE, $pdfFormat = NULL) { if (is_array($text)) { $pages = &$text; } @@ -124,7 +124,7 @@ class CRM_Utils_PDF_Utils { } } - static function _html2pdf_tcpdf($paper_size, $orientation, $margins, $html, $output, $fileName, $stationery_path) { + public static function _html2pdf_tcpdf($paper_size, $orientation, $margins, $html, $output, $fileName, $stationery_path) { // Documentation on the TCPDF library can be found at: http://www.tcpdf.org // This function also uses the FPDI library documented at: http://www.setasign.com/products/fpdi/about/ // Syntax borrowed from https://github.com/jake-mw/CDNTaxReceipts/blob/master/cdntaxreceipts.functions.inc @@ -178,7 +178,7 @@ class CRM_Utils_PDF_Utils { * * @return string */ - static function _html2pdf_dompdf($paper_size, $orientation, $html, $output, $fileName) { + public static function _html2pdf_dompdf($paper_size, $orientation, $html, $output, $fileName) { require_once 'packages/dompdf/dompdf_config.inc.php'; spl_autoload_register('DOMPDF_autoload'); $dompdf = new DOMPDF(); @@ -202,7 +202,7 @@ class CRM_Utils_PDF_Utils { * @param $output * @param string $fileName */ - static function _html2pdf_wkhtmltopdf($paper_size, $orientation, $margins, $html, $output, $fileName) { + public static function _html2pdf_wkhtmltopdf($paper_size, $orientation, $margins, $html, $output, $fileName) { require_once 'packages/snappy/src/autoload.php'; $config = CRM_Core_Config::singleton(); $snappy = new Knp\Snappy\Pdf($config->wkhtmltopdfPath); @@ -235,7 +235,7 @@ class CRM_Utils_PDF_Utils { * * @return float|int */ - static function convertMetric($value, $from, $to, $precision = NULL) { + public static function convertMetric($value, $from, $to, $precision = NULL) { switch ($from . $to) { case 'incm': $value *= 2.54; diff --git a/CRM/Utils/Pager.php b/CRM/Utils/Pager.php index 76fdf032d4..70d8749135 100644 --- a/CRM/Utils/Pager.php +++ b/CRM/Utils/Pager.php @@ -80,7 +80,7 @@ class CRM_Utils_Pager extends Pager_Sliding { * * @return \CRM_Utils_Pager the newly created and initialized pager object@access public */ - function __construct($params) { + public function __construct($params) { if ($params['status'] === NULL) { $params['status'] = ts('Contacts %%StatusMessage%%'); } @@ -140,7 +140,7 @@ class CRM_Utils_Pager extends Pager_Sliding { * @return void * */ - function initialize(&$params) { + public function initialize(&$params) { /* set the mode for the pager to Sliding */ $params['mode'] = 'Sliding'; @@ -197,7 +197,7 @@ class CRM_Utils_Pager extends Pager_Sliding { * @return int new pageId to display to the user * @access public */ - function getPageID($defaultPageId = 1, &$params) { + public function getPageID($defaultPageId = 1, &$params) { // POST has higher priority than GET vars // else if a value is set that has higher priority and finally the GET var $currentPage = $defaultPageId; @@ -230,7 +230,7 @@ class CRM_Utils_Pager extends Pager_Sliding { * @access public * */ - function getPageRowCount($defaultPageRowCount = self::ROWCOUNT) { + public function getPageRowCount($defaultPageRowCount = self::ROWCOUNT) { // POST has higher priority than GET vars if (isset($_POST[self::PAGE_ROWCOUNT])) { $rowCount = max((int )@$_POST[self::PAGE_ROWCOUNT], 1); @@ -254,7 +254,7 @@ class CRM_Utils_Pager extends Pager_Sliding { * @access public * */ - function getOffsetAndRowCount() { + public function getOffsetAndRowCount() { $pageId = $this->getCurrentPageID(); if (!$pageId) { $pageId = 1; @@ -268,7 +268,7 @@ class CRM_Utils_Pager extends Pager_Sliding { /** * @return string */ - function getCurrentLocation() { + public function getCurrentLocation() { $config = CRM_Core_Config::singleton(); $path = CRM_Utils_Array::value($config->userFrameworkURLVar, $_GET); return CRM_Utils_System::url($path, CRM_Utils_System::getLinksUrl(self::PAGE_ID, FALSE, TRUE), FALSE, NULL, FALSE) . $this->getCurrentPageID(); @@ -277,7 +277,7 @@ class CRM_Utils_Pager extends Pager_Sliding { /** * @return string */ - function getFirstPageLink() { + public function getFirstPageLink() { if ($this->isFirstPage()) { return ''; } @@ -289,7 +289,7 @@ class CRM_Utils_Pager extends Pager_Sliding { /** * @return string */ - function getLastPageLink() { + public function getLastPageLink() { if ($this->isLastPage()) { return ''; } @@ -300,7 +300,7 @@ class CRM_Utils_Pager extends Pager_Sliding { /** * @return string */ - function getBackPageLink() { + public function getBackPageLink() { if ($this->_currentPage > 1) { $href = $this->makeURL(self::PAGE_ID, $this->getPreviousPageID()); return $this->formatLink($href, $this->_altPrev, $this->_prevImg) . $this->_spacesBefore . $this->_spacesAfter; @@ -311,7 +311,7 @@ class CRM_Utils_Pager extends Pager_Sliding { /** * @return string */ - function getNextPageLink() { + public function getNextPageLink() { if ($this->_currentPage < $this->_totalPages) { $href = $this->makeURL(self::PAGE_ID, $this->getNextPageID()); return $this->_spacesAfter . @@ -324,7 +324,7 @@ class CRM_Utils_Pager extends Pager_Sliding { /** * Build a url for pager links */ - function makeURL($key, $value) { + public function makeURL($key, $value) { $href = CRM_Utils_System::makeURL($key, TRUE); // CRM-12212 Remove alpha sort param if (strpos($href, '&sortByCharacter=')) { diff --git a/CRM/Utils/PagerAToZ.php b/CRM/Utils/PagerAToZ.php index c103086ede..44b534ae4c 100644 --- a/CRM/Utils/PagerAToZ.php +++ b/CRM/Utils/PagerAToZ.php @@ -51,7 +51,7 @@ class CRM_Utils_PagerAToZ { * @access public * @static */ - static function getAToZBar(&$query, $sortByCharacter, $isDAO = FALSE) { + public static function getAToZBar(&$query, $sortByCharacter, $isDAO = FALSE) { $AToZBar = self::createLinks($query, $sortByCharacter, $isDAO); return $AToZBar; } @@ -63,7 +63,7 @@ class CRM_Utils_PagerAToZ { * @access private * @static */ - static function getStaticCharacters() { + public static function getStaticCharacters() { $staticAlphabets = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); return $staticAlphabets; } @@ -78,7 +78,7 @@ class CRM_Utils_PagerAToZ { * @access private * @static */ - static function getDynamicCharacters(&$query, $isDAO) { + public static function getDynamicCharacters(&$query, $isDAO) { if ($isDAO) { $result = $query; } @@ -108,7 +108,7 @@ class CRM_Utils_PagerAToZ { * @access private * @static */ - static function createLinks(&$query, $sortByCharacter, $isDAO) { + public static function createLinks(&$query, $sortByCharacter, $isDAO) { $AToZBar = self::getStaticCharacters(); $dynamicAlphabets = self::getDynamicCharacters($query, $isDAO); diff --git a/CRM/Utils/QueryFormatter.php b/CRM/Utils/QueryFormatter.php index 7fe1a8bd61..e8d8126a6f 100644 --- a/CRM/Utils/QueryFormatter.php +++ b/CRM/Utils/QueryFormatter.php @@ -91,7 +91,7 @@ class CRM_Utils_QueryFormatter { /** * @param string $mode eg MODE_NONE */ - function __construct($mode) { + public function __construct($mode) { $this->mode = $mode; } diff --git a/CRM/Utils/REST.php b/CRM/Utils/REST.php index 73fd58503f..1b819c3b5f 100644 --- a/CRM/Utils/REST.php +++ b/CRM/Utils/REST.php @@ -79,7 +79,7 @@ class CRM_Utils_REST { * * @return array */ - static function error($message = 'Unknown Error') { + public static function error($message = 'Unknown Error') { $values = array( 'error_message' => $message, 'is_error' => 1, @@ -93,7 +93,7 @@ class CRM_Utils_REST { * * @return array */ - static function simple($params) { + public static function simple($params) { $values = array('is_error' => 0); $values += $params; return $values; @@ -102,7 +102,7 @@ class CRM_Utils_REST { /** * @return string */ - function run() { + public function run() { $result = self::handle(); return self::output($result); } @@ -110,7 +110,7 @@ class CRM_Utils_REST { /** * @return string */ - function bootAndRun() { + public function bootAndRun() { $response = $this->loadCMSBootstrap(); if (is_array($response)) { return self::output($response); @@ -123,7 +123,7 @@ class CRM_Utils_REST { * * @return string */ - static function output(&$result) { + public static function output(&$result) { $requestParams = CRM_Utils_Request::exportValues(); $hier = FALSE; @@ -183,7 +183,7 @@ class CRM_Utils_REST { * * @return string */ - static function jsonFormated($json) { + public static function jsonFormated($json) { $tabcount = 0; $result = ''; $inquote = FALSE; @@ -264,7 +264,7 @@ class CRM_Utils_REST { /** * @return array|int */ - static function handle() { + public static function handle() { $requestParams = CRM_Utils_Request::exportValues(); // Get the function name being called from the q parameter in the query string @@ -341,7 +341,7 @@ class CRM_Utils_REST { * * @return array|int */ - static function process(&$args, $params) { + public static function process(&$args, $params) { $params['check_permissions'] = TRUE; $fnName = $apiFile = NULL; // clean up all function / class names. they should be alphanumeric and _ only @@ -402,7 +402,7 @@ class CRM_Utils_REST { /** * @return array|mixed|null */ - static function &buildParamList() { + public static function &buildParamList() { $requestParams = CRM_Utils_Request::exportValues(); $params = array(); @@ -435,7 +435,7 @@ class CRM_Utils_REST { /** * @param $pearError */ - static function fatal($pearError) { + public static function fatal($pearError) { header('Content-Type: text/xml'); $error = array(); $error['code'] = $pearError->getCode(); @@ -452,7 +452,7 @@ class CRM_Utils_REST { CRM_Utils_System::civiExit(); } - static function APIDoc() { + public static function APIDoc() { CRM_Utils_System::setTitle("API Parameters"); $template = CRM_Core_Smarty::singleton(); @@ -461,7 +461,7 @@ class CRM_Utils_REST { ); } - static function ajaxDoc() { + public static function ajaxDoc() { return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/api/explorer')); } @@ -521,7 +521,7 @@ class CRM_Utils_REST { * http://example.org/civicrm/api/json?entity=Contact&action=Get"&json={"contact_type":"Individual","email.get.email":{}} to take all the emails from individuals * works for POST & GET (POST recommended) **/ - static function ajaxJson() { + public static function ajaxJson() { $requestParams = CRM_Utils_Request::exportValues(); require_once 'api/v3/utils.php'; @@ -571,7 +571,7 @@ class CRM_Utils_REST { CRM_Utils_System::civiExit(); } - static function ajax() { + public static function ajax() { $requestParams = CRM_Utils_Request::exportValues(); // this is driven by the menu system, so we can use permissioning to @@ -635,7 +635,7 @@ class CRM_Utils_REST { * Callback for multiple ajax api calls from CRM.api3() * @return array */ - static function processMultiple() { + public static function processMultiple() { $output = array(); foreach (json_decode($_REQUEST['json'], TRUE) as $key => $call) { $args = array( @@ -651,7 +651,7 @@ class CRM_Utils_REST { /** * @return array|NULL NULL if execution should proceed; array if the response is already known */ - function loadCMSBootstrap() { + public function loadCMSBootstrap() { $requestParams = CRM_Utils_Request::exportValues(); $q = CRM_Utils_array::value('q', $requestParams); $args = explode('/', $q); diff --git a/CRM/Utils/ReCAPTCHA.php b/CRM/Utils/ReCAPTCHA.php index f570bd2ffc..423e7bc5eb 100644 --- a/CRM/Utils/ReCAPTCHA.php +++ b/CRM/Utils/ReCAPTCHA.php @@ -60,7 +60,7 @@ class CRM_Utils_ReCAPTCHA { * @static * */ - static function &singleton() { + public static function &singleton() { if (self::$_singleton === NULL) { self::$_singleton = new CRM_Utils_ReCAPTCHA(); } @@ -70,13 +70,13 @@ class CRM_Utils_ReCAPTCHA { /** * */ - function __construct() {} + public function __construct() {} /** * Add element to form * */ - static function add(&$form) { + public static function add(&$form) { $error = NULL; $config = CRM_Core_Config::singleton(); $useSSL = FALSE; @@ -120,7 +120,7 @@ class CRM_Utils_ReCAPTCHA { * * @return mixed */ - static function validate($value, $form) { + public static function validate($value, $form) { $config = CRM_Core_Config::singleton(); $resp = recaptcha_check_answer($config->recaptchaPrivateKey, diff --git a/CRM/Utils/Recent.php b/CRM/Utils/Recent.php index 6ca67c419b..8ae535acfd 100644 --- a/CRM/Utils/Recent.php +++ b/CRM/Utils/Recent.php @@ -61,7 +61,7 @@ class CRM_Utils_Recent { * @access public * @static */ - static function initialize() { + public static function initialize() { if (!self::$_recent) { $session = CRM_Core_Session::singleton(); self::$_recent = $session->get(self::STORE_NAME); @@ -78,7 +78,7 @@ class CRM_Utils_Recent { * @access public * @static */ - static function &get() { + public static function &get() { self::initialize(); return self::$_recent; } @@ -155,7 +155,7 @@ class CRM_Utils_Recent { * @access public * @static */ - static function del($recentItem) { + public static function del($recentItem) { self::initialize(); $tempRecent = self::$_recent; @@ -183,7 +183,7 @@ class CRM_Utils_Recent { * @access public * @static */ - static function delContact($id) { + public static function delContact($id) { self::initialize(); $tempRecent = self::$_recent; diff --git a/CRM/Utils/Request.php b/CRM/Utils/Request.php index 7e3c9153aa..bfac27264f 100644 --- a/CRM/Utils/Request.php +++ b/CRM/Utils/Request.php @@ -52,7 +52,7 @@ class CRM_Utils_Request { /** * Class constructor */ - function __construct() {} + public function __construct() {} /** * Retrieve a value from the request (GET/POST/REQUEST) @@ -68,7 +68,7 @@ class CRM_Utils_Request { * @access public * @static */ - static function retrieve($name, $type, &$store = NULL, $abort = FALSE, $default = NULL, $method = 'REQUEST') { + public static function retrieve($name, $type, &$store = NULL, $abort = FALSE, $default = NULL, $method = 'REQUEST') { // hack to detect stuff not yet converted to new style if (!is_string($type)) { @@ -127,7 +127,7 @@ class CRM_Utils_Request { * * @return array */ - static function exportValues() { + public static function exportValues() { // For more discussion of default $_REQUEST handling, see: // http://www.php.net/manual/en/reserved.variables.request.php // http://www.php.net/manual/en/ini.core.php#ini.request-order diff --git a/CRM/Utils/Rule.php b/CRM/Utils/Rule.php index d9f802060b..038302e0ae 100644 --- a/CRM/Utils/Rule.php +++ b/CRM/Utils/Rule.php @@ -46,7 +46,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function title($str, $maxLength = 127) { + public static function title($str, $maxLength = 127) { // check length etc if (empty($str) || strlen($str) > $maxLength) { @@ -66,7 +66,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function longTitle($str) { + public static function longTitle($str) { return self::title($str, 255); } @@ -75,7 +75,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function variable($str) { + public static function variable($str) { // check length etc if (empty($str) || strlen($str) > 31) { return FALSE; @@ -94,7 +94,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function qfVariable($str) { + public static function qfVariable($str) { // check length etc //if ( empty( $str ) || strlen( $str ) > 31 ) { if (strlen(trim($str)) == 0 || strlen($str) > 31) { @@ -115,7 +115,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function phone($phone) { + public static function phone($phone) { // check length etc if (empty($phone) || strlen($phone) > 16) { return FALSE; @@ -133,7 +133,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function query($query) { + public static function query($query) { // check length etc if (empty($query) || strlen($query) < 3 || strlen($query) > 127) { return FALSE; @@ -152,7 +152,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function url($url) { + public static function url($url) { if (preg_match('/^\//', $url)) { // allow relative URL's (CRM-15598) $url = 'http://' . $_SERVER['HTTP_HOST'] . $url; @@ -165,7 +165,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function wikiURL($string) { + public static function wikiURL($string) { $items = explode(' ', trim($string), 2); return self::url($items[0]); } @@ -175,7 +175,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function domain($domain) { + public static function domain($domain) { // not perfect, but better than the previous one; see CRM-1502 if (!preg_match('/^[A-Za-z0-9]([A-Za-z0-9\.\-]*[A-Za-z0-9])?$/', $domain)) { return FALSE; @@ -189,7 +189,7 @@ class CRM_Utils_Rule { * * @return null */ - static function date($value, $default = NULL) { + public static function date($value, $default = NULL) { if (is_string($value) && preg_match('/^\d\d\d\d-?\d\d-?\d\d$/', $value) ) { @@ -204,7 +204,7 @@ class CRM_Utils_Rule { * * @return null|string */ - static function dateTime($value, $default = NULL) { + public static function dateTime($value, $default = NULL) { $result = $default; if (is_string($value) && preg_match('/^\d\d\d\d-?\d\d-?\d\d(\s\d\d:\d\d(:\d\d)?|\d\d\d\d(\d\d)?)?$/', $value) @@ -228,7 +228,7 @@ class CRM_Utils_Rule { * @static * @access public */ - static function currentDate($date, $monthRequired = TRUE) { + public static function currentDate($date, $monthRequired = TRUE) { $config = CRM_Core_Config::singleton(); $d = CRM_Utils_Array::value('d', $date); @@ -320,7 +320,7 @@ class CRM_Utils_Rule { * @static * @access public */ - static function mysqlDate($date) { + public static function mysqlDate($date) { // allow date to be null if ($date == NULL) { return TRUE; @@ -338,7 +338,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function integer($value) { + public static function integer($value) { if (is_int($value)) { return TRUE; } @@ -371,7 +371,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function positiveInteger($value) { + public static function positiveInteger($value) { if (is_int($value)) { return ($value < 0) ? FALSE : TRUE; } @@ -394,7 +394,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function numeric($value) { + public static function numeric($value) { // lets use a php gatekeeper to ensure this is numeric if (!is_numeric($value)) { return FALSE; @@ -409,7 +409,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function numberOfDigit($value, $noOfDigit) { + public static function numberOfDigit($value, $noOfDigit) { return preg_match('/^\d{' . $noOfDigit . '}$/', $value) ? TRUE : FALSE; } @@ -418,7 +418,7 @@ class CRM_Utils_Rule { * * @return mixed */ - static function cleanMoney($value) { + public static function cleanMoney($value) { // first remove all white space $value = str_replace(array(' ', "\t", "\n"), '', $value); @@ -463,7 +463,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function money($value) { + public static function money($value) { $config = CRM_Core_Config::singleton(); //only edge case when we have a decimal point in the input money @@ -492,7 +492,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function string($value, $maxLength = 0) { + public static function string($value, $maxLength = 0) { if (is_string($value) && ($maxLength === 0 || strlen($value) <= $maxLength) ) { @@ -506,7 +506,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function boolean($value) { + public static function boolean($value) { return preg_match( '/(^(1|0)$)|(^(Y(es)?|N(o)?)$)|(^(T(rue)?|F(alse)?)$)/i', $value ) ? TRUE : FALSE; @@ -517,7 +517,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function email($value) { + public static function email($value) { return (bool) filter_var($value, FILTER_VALIDATE_EMAIL); } @@ -526,7 +526,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function emailList($list) { + public static function emailList($list) { $emails = explode(',', $list); foreach ($emails as $email) { $email = trim($email); @@ -545,7 +545,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function postalCode($value) { + public static function postalCode($value) { if (preg_match('/^\d{4,6}(-\d{4})?$/', $value)) { return TRUE; } @@ -561,7 +561,7 @@ class CRM_Utils_Rule { * * @return bool true if file has been uploaded, false otherwise */ - static function asciiFile($elementValue) { + public static function asciiFile($elementValue) { if ((isset($elementValue['error']) && $elementValue['error'] == 0) || (!empty($elementValue['tmp_name']) && $elementValue['tmp_name'] != 'none') ) { @@ -578,7 +578,7 @@ class CRM_Utils_Rule { * * @return bool whether file has been uploaded properly and is now in UTF-8 */ - static function utf8File($elementValue) { + public static function utf8File($elementValue) { $success = FALSE; if ((isset($elementValue['error']) && $elementValue['error'] == 0) || @@ -608,7 +608,7 @@ class CRM_Utils_Rule { * * @return bool true if file has been uploaded, false otherwise */ - static function htmlFile($elementValue) { + public static function htmlFile($elementValue) { if ((isset($elementValue['error']) && $elementValue['error'] == 0) || (!empty($elementValue['tmp_name']) && $elementValue['tmp_name'] != 'none') ) { @@ -627,7 +627,7 @@ class CRM_Utils_Rule { * @access public * @static */ - static function objectExists($value, $options) { + public static function objectExists($value, $options) { $name = 'name'; if (isset($options[2])) { $name = $options[2]; @@ -642,7 +642,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function optionExists($value, $options) { + public static function optionExists($value, $options) { return CRM_Core_OptionValue::optionExists($value, $options[0], $options[1], $options[2], CRM_Utils_Array::value(3, $options, 'name')); } @@ -652,7 +652,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function creditCardNumber($value, $type) { + public static function creditCardNumber($value, $type) { require_once 'Validate/Finance/CreditCard.php'; return Validate_Finance_CreditCard::number($value, $type); } @@ -663,7 +663,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function cvv($value, $type) { + public static function cvv($value, $type) { require_once 'Validate/Finance/CreditCard.php'; return Validate_Finance_CreditCard::cvv($value, $type); @@ -674,7 +674,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function currencyCode($value) { + public static function currencyCode($value) { static $currencyCodes = NULL; if (!$currencyCodes) { $currencyCodes = CRM_Core_PseudoConstant::currencyCode(); @@ -690,7 +690,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function xssString($value) { + public static function xssString($value) { if (is_string($value)) { return preg_match('!<(vb)?script[^>]*>.*!ims', $value @@ -706,7 +706,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function fileExists($path) { + public static function fileExists($path) { return file_exists($path); } @@ -716,7 +716,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function autocomplete($value, $options) { + public static function autocomplete($value, $options) { if ($value) { $selectOption = CRM_Core_BAO_CustomOption::valuesByID($options['fieldID'], $options['optionGroupID']); @@ -733,7 +733,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function validContact($value, $actualElementValue = NULL) { + public static function validContact($value, $actualElementValue = NULL) { if ($actualElementValue) { $value = $actualElementValue; } @@ -755,7 +755,7 @@ class CRM_Utils_Rule { * @static * @access public */ - static function qfDate($date) { + public static function qfDate($date) { $config = CRM_Core_Config::singleton(); $d = CRM_Utils_Array::value('d', $date); @@ -802,7 +802,7 @@ class CRM_Utils_Rule { * * @return bool */ - static function qfKey($key) { + public static function qfKey($key) { return ($key) ? CRM_Core_Key::valid($key) : FALSE; } } diff --git a/CRM/Utils/Signer.php b/CRM/Utils/Signer.php index 9387273726..36eefab27f 100644 --- a/CRM/Utils/Signer.php +++ b/CRM/Utils/Signer.php @@ -63,7 +63,7 @@ class CRM_Utils_Signer { * @param $secret string, private * @param $paramNames array, fields which should be part of the signature */ - function __construct($secret, $paramNames) { + public function __construct($secret, $paramNames) { sort($paramNames); // ensure consistent serialization of payloads $this->secret = $secret; $this->paramNames = $paramNames; @@ -78,7 +78,7 @@ class CRM_Utils_Signer { * @param $salt string, the salt (if known) or NULL (for auto-generated) * @return string, the full public token representing the signature */ - function sign($params, $salt = NULL) { + public function sign($params, $salt = NULL) { $message = array(); $message['secret'] = $this->secret; $message['payload'] = array(); @@ -111,7 +111,7 @@ class CRM_Utils_Signer { * @throws Exception * @return bool, TRUE iff all $paramNames for the submitted validate($params) and the original sign($params) */ - function validate($token, $params) { + public function validate($token, $params) { list ($salt, $signature) = explode($this->signDelim, $token); if (strlen($salt) != self::SALT_LEN) { throw new Exception("Invalid salt [$token]=[$salt][$signature]"); @@ -123,7 +123,7 @@ class CRM_Utils_Signer { /** * @return string */ - function createSalt() { + public function createSalt() { // It would be more secure to generate a new value but liable to run this // many times on certain admin pages; so instead we'll re-use the hash. return $this->defaultSalt; diff --git a/CRM/Utils/Sort.php b/CRM/Utils/Sort.php index 4de6634fda..e5b78d3bbb 100644 --- a/CRM/Utils/Sort.php +++ b/CRM/Utils/Sort.php @@ -122,7 +122,7 @@ class CRM_Utils_Sort { * @return \CRM_Utils_Sort @access public */ - function __construct(&$vars, $defaultSortOrder = NULL) { + public function __construct(&$vars, $defaultSortOrder = NULL) { $this->_vars = array(); $this->_response = array(); @@ -150,7 +150,7 @@ class CRM_Utils_Sort { * @return string the order by clause * @access public */ - function orderBy() { + public function orderBy() { if (empty($this->_vars[$this->_currentSortID])) { return ''; } @@ -177,7 +177,7 @@ class CRM_Utils_Sort { * @static * @access public */ - static function sortIDValue($index, $dir) { + public static function sortIDValue($index, $dir) { return ($dir == self::DESCENDING) ? $index . '_d' : $index . '_u'; } @@ -189,7 +189,7 @@ class CRM_Utils_Sort { * @return returns null if $url- (sort url) is not found * @access public */ - function initSortID($defaultSortOrder) { + public function initSortID($defaultSortOrder) { $url = CRM_Utils_Array::value(self::SORT_ID, $_GET, $defaultSortOrder); if (empty($url)) { @@ -226,7 +226,7 @@ class CRM_Utils_Sort { * @return void * @access public */ - function initialize($defaultSortOrder) { + public function initialize($defaultSortOrder) { $this->initSortID($defaultSortOrder); $this->_response = array(); @@ -260,7 +260,7 @@ class CRM_Utils_Sort { * @return int returns of the current sort id * @acccess public */ - function getCurrentSortID() { + public function getCurrentSortID() { return $this->_currentSortID; } @@ -270,7 +270,7 @@ class CRM_Utils_Sort { * @return int returns of the current sort direction * @acccess public */ - function getCurrentSortDirection() { + public function getCurrentSortDirection() { return $this->_currentSortDirection; } @@ -283,7 +283,7 @@ class CRM_Utils_Sort { * @return int (-1 or 1) * @access public */ - static function cmpFunc($a, $b) { + public static function cmpFunc($a, $b) { $cmp_order = array('weight', 'id', 'title', 'name'); foreach ($cmp_order as $attribute) { if (isset($a[$attribute]) && isset($b[$attribute])) { diff --git a/CRM/Utils/String.php b/CRM/Utils/String.php index 9918d92215..56d4955f5e 100644 --- a/CRM/Utils/String.php +++ b/CRM/Utils/String.php @@ -62,7 +62,7 @@ class CRM_Utils_String { * @return string (or null) * @static */ - static function titleToVar($title, $maxLength = 31) { + public static function titleToVar($title, $maxLength = 31) { $variable = self::munge($title, '_', $maxLength); if (CRM_Utils_Rule::title($variable, $maxLength)) { @@ -87,7 +87,7 @@ class CRM_Utils_String { * @return string returns the manipulated string * @static */ - static function munge($name, $char = '_', $len = 63) { + public static function munge($name, $char = '_', $len = 63) { // replace all white space and non-alpha numeric with $char // we only use the ascii character set since mysql does not create table names / field names otherwise // CRM-11744 @@ -110,7 +110,7 @@ class CRM_Utils_String { * * @return string string */ - static function convertStringToCamel($string) { + public static function convertStringToCamel($string) { $fragments = explode('_', $string); foreach ($fragments as & $fragment) { $fragment = ucfirst($fragment); @@ -133,7 +133,7 @@ class CRM_Utils_String { * @access public * @static */ - static function rename($name, $len = 4) { + public static function rename($name, $len = 4) { $rand = substr(uniqid(), 0, $len); return substr_replace($name, $rand, -$len, $len); } @@ -150,7 +150,7 @@ class CRM_Utils_String { * @return string the last component * @static */ - static function getClassName($string, $char = '_') { + public static function getClassName($string, $char = '_') { $names = array(); if (!is_array($string)) { $names = explode($char, $string); @@ -172,7 +172,7 @@ class CRM_Utils_String { * @access public * @static */ - static function append(&$str, $delim, $name) { + public static function append(&$str, $delim, $name) { if (empty($name)) { return; } @@ -210,7 +210,7 @@ class CRM_Utils_String { * @access public * @static */ - static function isAscii($str, $utf8 = TRUE) { + public static function isAscii($str, $utf8 = TRUE) { if (!function_exists('mb_detect_encoding')) { // eliminate all white space from the string $str = preg_replace('/\s+/', '', $str); @@ -253,7 +253,7 @@ class CRM_Utils_String { * @access public * @static */ - static function regex($str, $regexRules) { + public static function regex($str, $regexRules) { //redact the regular expressions if (!empty($regexRules) && isset($str)) { static $matches, $totalMatches, $match = array(); @@ -291,7 +291,7 @@ class CRM_Utils_String { * * @return mixed */ - static function redaction($str, $stringRules) { + public static function redaction($str, $stringRules) { //redact the strings if (!empty($stringRules)) { foreach ($stringRules as $match => $replace) { @@ -312,7 +312,7 @@ class CRM_Utils_String { * * @return boolean */ - static function isUtf8($str) { + public static function isUtf8($str) { if (!function_exists(mb_detect_encoding)) { // eliminate all white space from the string $str = preg_replace('/\s+/', '', $str); @@ -342,7 +342,7 @@ class CRM_Utils_String { * @access public * @static */ - static function match($url1, $url2) { + public static function match($url1, $url2) { $url1 = strtolower($url1); $url2 = strtolower($url2); @@ -366,7 +366,7 @@ class CRM_Utils_String { * @access public * @static */ - static function extractURLVarValue($query) { + public static function extractURLVarValue($query) { $config = CRM_Core_Config::singleton(); $urlVar = $config->userFrameworkURLVar; @@ -391,7 +391,7 @@ class CRM_Utils_String { * @access public * @static */ - static function strtobool($str) { + public static function strtobool($str) { if (!is_scalar($str)) { return FALSE; } @@ -411,7 +411,7 @@ class CRM_Utils_String { * @access public * @static */ - static function strtoboolstr($str) { + public static function strtoboolstr($str) { if (!is_scalar($str)) { return FALSE; } @@ -436,7 +436,7 @@ class CRM_Utils_String { * @access public * @static */ - static function htmlToText($html) { + public static function htmlToText($html) { require_once 'packages/html2text/rcube_html2text.php'; $token_html = preg_replace('!\{([a-z_.]+)\}!i', 'token:{$1}', $html); $converter = new rcube_html2text($token_html); @@ -449,7 +449,7 @@ class CRM_Utils_String { * @param $string * @param array $params */ - static function extractName($string, &$params) { + public static function extractName($string, &$params) { $name = trim($string); if (empty($name)) { return; @@ -504,7 +504,7 @@ class CRM_Utils_String { * * @return array */ - static function &makeArray($string) { + public static function &makeArray($string) { $string = trim($string); $values = explode("\n", $string); @@ -526,7 +526,7 @@ class CRM_Utils_String { * * @return string only the first alternative found (or the text without alternatives) */ - static function stripAlternatives($full) { + public static function stripAlternatives($full) { $matches = array(); preg_match('/-ALTERNATIVE ITEM 0-(.*?)-ALTERNATIVE ITEM 1-.*-ALTERNATIVE END-/s', $full, $matches); @@ -550,7 +550,7 @@ class CRM_Utils_String { * @access public * @static */ - static function stripSpaces($string) { + public static function stripSpaces($string) { return (empty($string)) ? $string : preg_replace("/\s{2,}/", " ", trim($string)); } @@ -611,7 +611,7 @@ class CRM_Utils_String { * @public * @static */ - static function purifyHTML($string) { + public static function purifyHTML($string) { static $_filter = null; if (!$_filter) { $config = HTMLPurifier_Config::createDefault(); @@ -634,7 +634,7 @@ class CRM_Utils_String { * * @return string */ - static function ellipsify($string, $maxLen) { + public static function ellipsify($string, $maxLen) { $len = strlen($string); if ($len <= $maxLen) { return $string; diff --git a/CRM/Utils/Sunlight.php b/CRM/Utils/Sunlight.php index d98355264d..8d7a8094ca 100644 --- a/CRM/Utils/Sunlight.php +++ b/CRM/Utils/Sunlight.php @@ -42,7 +42,7 @@ class CRM_Utils_Sunlight { * @return SimpleXMLElement * @throws Exception */ - static function makeAPICall($uri) { + public static function makeAPICall($uri) { require_once 'HTTP/Request.php'; $params = array( 'method' => HTTP_REQUEST_METHOD_GET, @@ -68,7 +68,7 @@ class CRM_Utils_Sunlight { * * @return array */ - static function getCityState($zipcode) { + public static function getCityState($zipcode) { $key = self::$_apiKey; $uri = "places.getCityStateFromZip.php?zip={$zipcode}&apikey={$key}&output=xml"; $xml = self::makeAPICall($uri); @@ -81,7 +81,7 @@ class CRM_Utils_Sunlight { * * @return array */ - static function getDetailedInfo($peopleID) { + public static function getDetailedInfo($peopleID) { $key = self::$_apiKey; $uri = "people.getPersonInfo.php?id={$peopleID}&apikey={$key}&output=xml"; $xml = self::makeAPICall($uri); @@ -115,7 +115,7 @@ class CRM_Utils_Sunlight { * * @return array */ - static function getPeopleInfo($uri) { + public static function getPeopleInfo($uri) { $xml = self::makeAPICall($uri); $result = array(); @@ -131,7 +131,7 @@ class CRM_Utils_Sunlight { * * @return array|null */ - static function getRepresentativeInfo($city, $state) { + public static function getRepresentativeInfo($city, $state) { if (!$city || !$state ) { @@ -148,7 +148,7 @@ class CRM_Utils_Sunlight { * * @return array|null */ - static function getSenatorInfo($state) { + public static function getSenatorInfo($state) { if (!$state) { return NULL; } @@ -165,7 +165,7 @@ class CRM_Utils_Sunlight { * * @return array */ - static function getInfo($city, $state, $zipcode = NULL) { + public static function getInfo($city, $state, $zipcode = NULL) { if ($zipcode) { list($city, $state) = self::getCityState($zipcode); } diff --git a/CRM/Utils/System.php b/CRM/Utils/System.php index ac17b3dac9..65f941ce6d 100644 --- a/CRM/Utils/System.php +++ b/CRM/Utils/System.php @@ -67,7 +67,7 @@ class CRM_Utils_System { * The URL fragment. * @access public */ - static function makeURL($urlVar, $includeReset = FALSE, $includeForce = TRUE, $path = NULL, $absolute = FALSE) { + public static function makeURL($urlVar, $includeReset = FALSE, $includeForce = TRUE, $path = NULL, $absolute = FALSE) { if (empty($path)) { $config = CRM_Core_Config::singleton(); $path = CRM_Utils_Array::value($config->userFrameworkURLVar, $_GET); @@ -105,7 +105,7 @@ class CRM_Utils_System { * @return string * @access public */ - static function getLinksUrl($urlVar, $includeReset = FALSE, $includeForce = TRUE, $skipUFVar = TRUE) { + public static function getLinksUrl($urlVar, $includeReset = FALSE, $includeForce = TRUE, $skipUFVar = TRUE) { // Sort out query string to prevent messy urls $querystring = array(); $qs = array(); @@ -202,7 +202,7 @@ class CRM_Utils_System { * @param array|string $query * @return string */ - static function makeQueryString($query) { + public static function makeQueryString($query) { if (is_array($query)) { $buf = ''; foreach ($query as $key => $value) { @@ -276,7 +276,7 @@ class CRM_Utils_System { /** * @return mixed */ - static function permissionDenied() { + public static function permissionDenied() { $config = CRM_Core_Config::singleton(); return $config->userSystem->permissionDenied(); } @@ -284,13 +284,13 @@ class CRM_Utils_System { /** * @return mixed */ - static function logout() { + public static function logout() { $config = CRM_Core_Config::singleton(); return $config->userSystem->logout(); } // this is a very drupal specific function for now - static function updateCategories() { + public static function updateCategories() { $config = CRM_Core_Config::singleton(); if ($config->userSystem->is_drupal) { $config->userSystem->updateCategories(); @@ -303,7 +303,7 @@ class CRM_Utils_System { * @return string the current menu path * @access public */ - static function currentPath() { + public static function currentPath() { $config = CRM_Core_Config::singleton(); return trim(CRM_Utils_Array::value($config->userFrameworkURLVar, $_GET), '/'); } @@ -317,7 +317,7 @@ class CRM_Utils_System { * @return string url * @access public */ - static function crmURL($params) { + public static function crmURL($params) { $p = CRM_Utils_Array::value('p', $params); if (!isset($p)) { $p = self::currentPath(); @@ -342,7 +342,7 @@ class CRM_Utils_System { * * @access public */ - static function setTitle($title, $pageTitle = NULL) { + public static function setTitle($title, $pageTitle = NULL) { self::$title = $title; $config = CRM_Core_Config::singleton(); return $config->userSystem->setTitle($title, $pageTitle); @@ -360,7 +360,7 @@ class CRM_Utils_System { * * @access public */ - static function setUserContext($names, $default = NULL) { + public static function setUserContext($names, $default = NULL) { $url = $default; $session = CRM_Core_Session::singleton(); @@ -391,7 +391,7 @@ class CRM_Utils_System { * * @access public */ - static function getClassName($object) { + public static function getClassName($object) { return get_class($object); } @@ -403,7 +403,7 @@ class CRM_Utils_System { * * @access public */ - static function redirect($url = NULL) { + public static function redirect($url = NULL) { if (!$url) { $url = self::url('civicrm/dashboard', 'reset=1'); } @@ -479,7 +479,7 @@ class CRM_Utils_System { * * @access public */ - static function appendBreadCrumb($breadCrumbs) { + public static function appendBreadCrumb($breadCrumbs) { $config = CRM_Core_Config::singleton(); return $config->userSystem->appendBreadCrumb($breadCrumbs); } @@ -489,7 +489,7 @@ class CRM_Utils_System { * * @access public */ - static function resetBreadCrumb() { + public static function resetBreadCrumb() { $config = CRM_Core_Config::singleton(); return $config->userSystem->resetBreadCrumb(); } @@ -501,7 +501,7 @@ class CRM_Utils_System { * * @access public */ - static function addHTMLHead($bc) { + public static function addHTMLHead($bc) { $config = CRM_Core_Config::singleton(); return $config->userSystem->addHTMLHead($bc); } @@ -516,7 +516,7 @@ class CRM_Utils_System { * The URL to post the form. * @access public */ - static function postURL($action) { + public static function postURL($action) { $config = CRM_Core_Config::singleton(); return $config->userSystem->postURL($action); } @@ -526,7 +526,7 @@ class CRM_Utils_System { * * @access public */ - static function mapConfigToSSL() { + public static function mapConfigToSSL() { $config = CRM_Core_Config::singleton(); $config->userFrameworkResourceURL = str_replace('http://', 'https://', $config->userFrameworkResourceURL); $config->resourceBase = $config->userFrameworkResourceURL; @@ -544,14 +544,14 @@ class CRM_Utils_System { * @return string * @access public */ - static function baseURL() { + public static function baseURL() { $config = CRM_Core_Config::singleton(); return $config->userFrameworkBaseURL; } /** */ - static function authenticateAbort($message, $abort) { + public static function authenticateAbort($message, $abort) { if ($abort) { echo $message; self::civiExit(0); @@ -567,7 +567,7 @@ class CRM_Utils_System { * * @return bool */ - static function authenticateKey($abort = TRUE) { + public static function authenticateKey($abort = TRUE) { // also make sure the key is sent and is valid $key = trim(CRM_Utils_Array::value('key', $_REQUEST)); @@ -616,7 +616,7 @@ class CRM_Utils_System { * * @return bool */ - static function authenticateScript($abort = TRUE, $name = NULL, $pass = NULL, $storeInSession = TRUE, $loadCMSBootstrap = TRUE, $requireKey = TRUE) { + public static function authenticateScript($abort = TRUE, $name = NULL, $pass = NULL, $storeInSession = TRUE, $loadCMSBootstrap = TRUE, $requireKey = TRUE) { // auth to make sure the user has a login/password to do a shell operation // later on we'll link this to acl's if (!$name) { @@ -678,7 +678,7 @@ class CRM_Utils_System { * @return false|array * @access public */ - static function authenticate($name, $password, $loadCMSBootstrap = FALSE, $realPath = NULL) { + public static function authenticate($name, $password, $loadCMSBootstrap = FALSE, $realPath = NULL) { $config = CRM_Core_Config::singleton(); /* Before we do any loading, let's start the session and write to it. @@ -701,7 +701,7 @@ class CRM_Utils_System { * * @access public */ - static function setUFMessage($message) { + public static function setUFMessage($message) { $config = CRM_Core_Config::singleton(); return $config->userSystem->setMessage($message); } @@ -714,7 +714,7 @@ class CRM_Utils_System { * The value to check for null. * @return bool */ - static function isNull($value) { + public static function isNull($value) { // FIXME: remove $value = 'null' string test when we upgrade our DAO code to handle passing null in a better way. if (!isset($value) || $value === NULL || $value === '' || $value === 'null') { return TRUE; @@ -740,7 +740,7 @@ class CRM_Utils_System { * @return string * The obscured credit card number. */ - static function mungeCreditCard($number, $keep = 4) { + public static function mungeCreditCard($number, $keep = 4) { $number = trim($number); if (empty($number)) { return NULL; @@ -801,7 +801,7 @@ class CRM_Utils_System { * * @return mixed|string */ - static function memory($title = NULL) { + public static function memory($title = NULL) { static $pid = NULL; if (!$pid) { $pid = posix_getpid(); @@ -864,7 +864,7 @@ class CRM_Utils_System { * @param bool $log * (optional) Whether to log the memory usage information. */ - static function xMemory($title = NULL, $log = FALSE) { + public static function xMemory($title = NULL, $log = FALSE) { $mem = (float ) xdebug_memory_usage() / (float )(1024); $mem = number_format($mem, 5) . ", " . time(); if ($log) { @@ -889,7 +889,7 @@ class CRM_Utils_System { * @return string * The fixed URL. */ - static function fixURL($url) { + public static function fixURL($url) { $components = parse_url($url); if (!$components) { @@ -909,7 +909,7 @@ class CRM_Utils_System { * * @return bool */ - static function validCallback($callback) { + public static function validCallback($callback) { if (self::$_callbacks === NULL) { self::$_callbacks = array(); } @@ -953,7 +953,7 @@ class CRM_Utils_System { * @param int $limit * @return string[] */ - static function explode($separator, $string, $limit) { + public static function explode($separator, $string, $limit) { $result = explode($separator, $string, $limit); for ($i = count($result); $i < $limit; $i++) { $result[$i] = NULL; @@ -969,7 +969,7 @@ class CRM_Utils_System { * * @return mixed */ - static function checkURL($url, $addCookie = FALSE) { + public static function checkURL($url, $addCookie = FALSE) { // make a GET request to $url $ch = curl_init($url); if ($addCookie) { @@ -998,7 +998,7 @@ class CRM_Utils_System { * met and we're not aborting due to the failed requirement. If $abort is * TRUE and the requirement fails, this function does not return. */ - static function checkPHPVersion($ver = 5, $abort = TRUE) { + public static function checkPHPVersion($ver = 5, $abort = TRUE) { $phpVersion = substr(PHP_VERSION, 0, 1); if ($phpVersion >= $ver) { return TRUE; @@ -1018,7 +1018,7 @@ class CRM_Utils_System { * * @return string */ - static function formatWikiURL($string, $encode = FALSE) { + public static function formatWikiURL($string, $encode = FALSE) { $items = explode(' ', trim($string), 2); if (count($items) == 2) { $title = $items[1]; @@ -1037,7 +1037,7 @@ class CRM_Utils_System { * * @return null|string */ - static function urlEncode($url) { + public static function urlEncode($url) { $items = parse_url($url); if ($items === FALSE) { return NULL; @@ -1074,7 +1074,7 @@ class CRM_Utils_System { * civicrm version * @access public */ - static function version() { + public static function version() { static $version; if (!$version) { @@ -1116,14 +1116,14 @@ class CRM_Utils_System { * Version string to be checked. * @return bool */ - static function isVersionFormatValid($version) { + public static function isVersionFormatValid($version) { return preg_match("/^(\d{1,2}\.){2,3}(\d{1,2}|(alpha|beta)\d{1,2})(\.upgrade)?$/", $version); } /** * Wraps or emulates PHP's getallheaders() function. */ - static function getAllHeaders() { + public static function getAllHeaders() { if (function_exists('getallheaders')) { return getallheaders(); } @@ -1148,7 +1148,7 @@ class CRM_Utils_System { /** */ - static function getRequestHeaders() { + public static function getRequestHeaders() { if (function_exists('apache_request_headers')) { return apache_request_headers(); } @@ -1163,7 +1163,7 @@ class CRM_Utils_System { * Note that we inline this function in install/civicrm.php, so if you change * this function, please go and change the code in the install script as well. */ - static function isSSL( ) { + public static function isSSL( ) { return (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && @@ -1172,7 +1172,7 @@ class CRM_Utils_System { /** */ - static function redirectToSSL($abort = FALSE) { + public static function redirectToSSL($abort = FALSE) { $config = CRM_Core_Config::singleton(); $req_headers = self::getRequestHeaders(); if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enableSSL') && @@ -1214,7 +1214,7 @@ class CRM_Utils_System { * * @return mixed|string */ - static function ipAddress($strictIPV4 = TRUE) { + public static function ipAddress($strictIPV4 = TRUE) { $address = CRM_Utils_Array::value('REMOTE_ADDR', $_SERVER); $config = CRM_Core_Config::singleton(); @@ -1248,7 +1248,7 @@ class CRM_Utils_System { * The previous page URL * @access public */ - static function refererPath() { + public static function refererPath() { return CRM_Utils_Array::value('HTTP_REFERER', $_SERVER); } @@ -1259,7 +1259,7 @@ class CRM_Utils_System { * Base URL of the CRM documentation. * @access public */ - static function getDocBaseURL() { + public static function getDocBaseURL() { // FIXME: move this to configuration at some stage return 'http://book.civicrm.org/'; } @@ -1270,7 +1270,7 @@ class CRM_Utils_System { * @return string documentation url * @access public */ - static function getWikiBaseURL() { + public static function getWikiBaseURL() { // FIXME: move this to configuration at some stage return 'http://wiki.civicrm.org/confluence/display/CRMDOC/'; } @@ -1299,7 +1299,7 @@ class CRM_Utils_System { * URL or link to documentation page, based on provided parameters. * @access public */ - static function docURL2($page, $URLonly = FALSE, $text = NULL, $title = NULL, $style = NULL, $resource = NULL) { + public static function docURL2($page, $URLonly = FALSE, $text = NULL, $title = NULL, $style = NULL, $resource = NULL) { // if ts function doesn't exist, it means that CiviCRM hasn't been fully initialised yet - // return just the URL, no matter what other parameters are defined if (!function_exists('ts')) { @@ -1335,7 +1335,7 @@ class CRM_Utils_System { * URL or link to documentation page, based on provided parameters. * @access public */ - static function docURL($params) { + public static function docURL($params) { if (!isset($params['page'])) { return; @@ -1378,7 +1378,7 @@ class CRM_Utils_System { * @return string * The used locale or null for none. */ - static function getUFLocale() { + public static function getUFLocale() { $config = CRM_Core_Config::singleton(); return $config->userSystem->getUFLocale(); } @@ -1394,7 +1394,7 @@ class CRM_Utils_System { * @return string * Response from URL. */ - static function getServerResponse($url, $addCookie = TRUE) { + public static function getServerResponse($url, $addCookie = TRUE) { CRM_Core_TemporaryErrorScope::ignoreException(); require_once 'HTTP/Request.php'; $request = new HTTP_Request($url); @@ -1422,7 +1422,7 @@ class CRM_Utils_System { /** */ - static function isDBVersionValid(&$errorMessage) { + public static function isDBVersionValid(&$errorMessage) { $dbVersion = CRM_Core_BAO_Domain::version(); if (!$dbVersion) { @@ -1470,7 +1470,7 @@ class CRM_Utils_System { * @param int $status * (optional) Code with which to exit. */ - static function civiExit($status = 0) { + public static function civiExit($status = 0) { // move things to CiviCRM cache as needed CRM_Core_Session::storeSessionObjects(); @@ -1480,7 +1480,7 @@ class CRM_Utils_System { /** * Reset the various system caches and some important static variables. */ - static function flushCache( ) { + public static function flushCache( ) { // flush out all cache entries so we can reload new data // a bit aggressive, but livable for now $cache = CRM_Utils_Cache::singleton(); @@ -1519,7 +1519,7 @@ class CRM_Utils_System { * @param bool $throwError * @param $realPath */ - static function loadBootStrap($params = array(), $loadUser = TRUE, $throwError = TRUE, $realPath = NULL) { + public static function loadBootStrap($params = array(), $loadUser = TRUE, $throwError = TRUE, $realPath = NULL) { if (!is_array($params)) { $params = array(); } @@ -1550,7 +1550,7 @@ class CRM_Utils_System { /** */ - static function baseCMSURL() { + public static function baseCMSURL() { static $_baseURL = NULL; if (!$_baseURL) { $config = CRM_Core_Config::singleton(); @@ -1596,7 +1596,7 @@ class CRM_Utils_System { * @param string $url * @return string */ - static function relativeURL($url) { + public static function relativeURL($url) { // check if url is relative, if so return immediately if (substr($url, 0, 4) != 'http') { return $url; @@ -1623,7 +1623,7 @@ class CRM_Utils_System { * * @return string */ - static function absoluteURL($url, $removeLanguagePart = FALSE) { + public static function absoluteURL($url, $removeLanguagePart = FALSE) { // check if url is already absolute, if so return immediately if (substr($url, 0, 4) == 'http') { return $url; @@ -1648,7 +1648,7 @@ class CRM_Utils_System { * * @return string $url, clean url */ - static function cleanUrl($url) { + public static function cleanUrl($url) { if (!$url) { return NULL; } @@ -1725,7 +1725,7 @@ class CRM_Utils_System { * include path. * @access public */ - static function listIncludeFiles($relpath) { + public static function listIncludeFiles($relpath) { $file_list = array(); $inc_dirs = explode(PATH_SEPARATOR, get_include_path()); foreach ($inc_dirs as $inc_dir) { @@ -1764,7 +1764,7 @@ class CRM_Utils_System { * each element. * @access public */ - static function getPluginList($relpath, $fext = '.php', $skipList = array()) { + public static function getPluginList($relpath, $fext = '.php', $skipList = array()) { $fext_len = strlen($fext); $plugins = array(); $inc_files = CRM_Utils_System::listIncludeFiles($relpath); @@ -1783,7 +1783,7 @@ class CRM_Utils_System { /** * */ - static function executeScheduledJobs() { + public static function executeScheduledJobs() { $facility = new CRM_Core_JobManager(); $facility->execute(FALSE); @@ -1830,7 +1830,7 @@ class CRM_Utils_System { * * @return bool */ - static function isDevelopment() { + public static function isDevelopment() { static $cache = NULL; if ($cache === NULL) { global $civicrm_root; @@ -1842,7 +1842,7 @@ class CRM_Utils_System { /** * @return bool */ - static function isInUpgradeMode() { + public static function isInUpgradeMode() { $args = explode('/', $_GET['q']); $upgradeInProcess = CRM_Core_Session::singleton()->get('isUpgradePending'); if ((isset($args[1]) && $args[1] == 'upgrade') || $upgradeInProcess) { @@ -1869,7 +1869,7 @@ class CRM_Utils_System { * - title: string * - url: string */ - static function createDefaultCrudLink($crudLinkSpec) { + public static function createDefaultCrudLink($crudLinkSpec) { $crudLinkSpec['action'] = CRM_Utils_Array::value('action', $crudLinkSpec, CRM_Core_Action::VIEW); $daoClass = CRM_Core_DAO_AllCoreTables::getClassForTable($crudLinkSpec['entity_table']); if (!$daoClass) { diff --git a/CRM/Utils/System/Base.php b/CRM/Utils/System/Base.php index c5c4fe761a..aca82dc8d9 100644 --- a/CRM/Utils/System/Base.php +++ b/CRM/Utils/System/Base.php @@ -51,7 +51,7 @@ abstract class CRM_Utils_System_Base { * @return void prints content on stdout * @access public */ - function theme(&$content, $print = FALSE, $maintenance = FALSE) { + public function theme(&$content, $print = FALSE, $maintenance = FALSE) { $ret = FALSE; // TODO: Split up; this was copied verbatim from CiviCRM 4.0's multi-UF theming function @@ -99,14 +99,14 @@ abstract class CRM_Utils_System_Base { /** * @return string */ - function getDefaultBlockLocation() { + public function getDefaultBlockLocation() { return 'left'; } /** * @return string */ - function getVersion() { + public function getVersion() { return 'Unknown'; } @@ -134,7 +134,7 @@ abstract class CRM_Utils_System_Base { * * @return string|NULL local file system path to CMS root, or NULL if it cannot be determined */ - function cmsRootPath() { + public function cmsRootPath() { return NULL; } @@ -156,7 +156,7 @@ abstract class CRM_Utils_System_Base { * @throws CRM_Core_Exception * @return int|NULL */ - function getUfId($username) { + public function getUfId($username) { $className = get_class($this); throw new CRM_Core_Exception("Not implemented: {$className}->getUfId"); } @@ -168,7 +168,7 @@ abstract class CRM_Utils_System_Base { * * @access public */ - function setUserSession($data) { + public function setUserSession($data) { list($userID, $ufID) = $data; $session = CRM_Core_Session::singleton(); $session->set('ufID', $ufID); @@ -179,14 +179,14 @@ abstract class CRM_Utils_System_Base { * Reset any system caches that may be required for proper CiviCRM * integration. */ - function flush() { + public function flush() { // nullop by default } /** * Flush css/js caches */ - function clearResourceCache() { + public function clearResourceCache() { // nullop by default } @@ -200,7 +200,7 @@ abstract class CRM_Utils_System_Base { * - $siteName, * - $siteRoot */ - function getDefaultSiteSettings($dir) { + public function getDefaultSiteSettings($dir) { $config = CRM_Core_Config::singleton(); $url = $config->userFrameworkBaseURL; return array($url, NULL, NULL); @@ -215,13 +215,13 @@ abstract class CRM_Utils_System_Base { * * FIXME: Document values accepted/required by $params */ - function userLoginFinalize($params = array()){ + public function userLoginFinalize($params = array()){ } /** * Set timezone in mysql so that timestamp fields show the correct time */ - function setMySQLTimeZone(){ + public function setMySQLTimeZone(){ $timeZoneOffset = $this->getTimeZoneOffset(); if($timeZoneOffset){ $sql = "SET time_zone = '$timeZoneOffset'"; @@ -238,7 +238,7 @@ abstract class CRM_Utils_System_Base { * Get timezone from Drupal * @return boolean|string */ - function getTimeZoneOffset(){ + public function getTimeZoneOffset(){ $timezone = $this->getTimeZoneString(); if($timezone){ $tzObj = new DateTimeZone($timezone); @@ -262,7 +262,7 @@ abstract class CRM_Utils_System_Base { * Over-ridable function to get timezone as a string eg. * @return string Timezone e.g. 'America/Los_Angeles' */ - function getTimeZoneString() { + public function getTimeZoneString() { return date_default_timezone_get(); } @@ -272,7 +272,7 @@ abstract class CRM_Utils_System_Base { * @return mixed $uniqueIdentifer Unique identifier from the user Framework system * */ - function getUniqueIdentifierFromUserObject($user) {} + public function getUniqueIdentifierFromUserObject($user) {} /** * Get User ID from UserFramework system (CMS) @@ -280,21 +280,21 @@ abstract class CRM_Utils_System_Base { * @return mixed * */ - function getUserIDFromUserObject($user) {} + public function getUserIDFromUserObject($user) {} /** * Get currently logged in user uf id. * * @return int $userID logged in user uf id. */ - function getLoggedInUfID() {} + public function getLoggedInUfID() {} /** * Get currently logged in user unique identifier - this tends to be the email address or user name. * * @return string $userID logged in user unique identifier */ - function getLoggedInUniqueIdentifier() {} + public function getLoggedInUniqueIdentifier() {} /** * Return a UFID (user account ID from the UserFramework / CMS system being based on the user object @@ -307,7 +307,7 @@ abstract class CRM_Utils_System_Base { * @param object $user * @return int $ufid - user ID of UF System */ - function getBestUFID($user = NULL) { + public function getBestUFID($user = NULL) { if($user) { return $this->getUserIDFromUserObject($user); } @@ -323,7 +323,7 @@ abstract class CRM_Utils_System_Base { * @param object $user * @return string $uniqueIdentifier - unique identifier from the UF System */ - function getBestUFUniqueIdentifier($user = NULL) { + public function getBestUFUniqueIdentifier($user = NULL) { if($user) { return $this->getUniqueIdentifierFromUserObject($user); } @@ -336,14 +336,14 @@ abstract class CRM_Utils_System_Base { * * @return string */ - function getUserRecordUrl($contactID) { + public function getUserRecordUrl($contactID) { return NULL; } /** * Is the current user permitted to add a user * @return bool */ - function checkPermissionAddUser() { + public function checkPermissionAddUser() { return FALSE; } @@ -351,20 +351,20 @@ abstract class CRM_Utils_System_Base { * Output code from error function * @param string $content */ - function outputError($content) { + public function outputError($content) { echo CRM_Utils_System::theme($content); } /** * Log error to CMS */ - function logger($message) { + public function logger($message) { } /** * Append to coreResourcesList */ - function appendCoreResources(&$list) {} + public function appendCoreResources(&$list) {} } diff --git a/CRM/Utils/System/Drupal.php b/CRM/Utils/System/Drupal.php index b86074f15d..7d92ecf4b7 100644 --- a/CRM/Utils/System/Drupal.php +++ b/CRM/Utils/System/Drupal.php @@ -49,7 +49,7 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase { * @access public * */ - function createUser(&$params, $mail) { + public function createUser(&$params, $mail) { $form_state = form_state_defaults(); $form_state['input'] = array( @@ -108,7 +108,7 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase { * @param int $ufID * @param string $ufName */ - function updateCMSName($ufID, $ufName) { + public function updateCMSName($ufID, $ufName) { // CRM-5555 if (function_exists('user_load')) { $user = user_load($ufID); @@ -128,7 +128,7 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase { * * @return void */ - static function checkUserNameEmailExists(&$params, &$errors, $emailName = 'email') { + public static function checkUserNameEmailExists(&$params, &$errors, $emailName = 'email') { $config = CRM_Core_Config::singleton(); $dao = new CRM_Core_DAO(); @@ -187,7 +187,7 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase { * * @return null|string */ - function getLoginDestination(&$form) { + public function getLoginDestination(&$form) { $args = NULL; $id = $form->get('id'); @@ -242,7 +242,7 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase { * @return void * @access public */ - function setTitle($title, $pageTitle = NULL) { + public function setTitle($title, $pageTitle = NULL) { if (arg(0) == 'civicrm') { if (!$pageTitle) { $pageTitle = $title; @@ -262,7 +262,7 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase { * @return void * @access public */ - function appendBreadCrumb($breadCrumbs) { + public function appendBreadCrumb($breadCrumbs) { $breadCrumb = drupal_get_breadcrumb(); if (is_array($breadCrumbs)) { @@ -290,7 +290,7 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase { * @return void * @access public */ - function resetBreadCrumb() { + public function resetBreadCrumb() { $bc = array(); drupal_set_breadcrumb($bc); } @@ -303,7 +303,7 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase { * @return void * @access public */ - function addHTMLHead($header) { + public function addHTMLHead($header) { static $count = 0; if (!empty($header)) { $key = 'civi_' . ++$count; @@ -421,7 +421,7 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase { * @return void * @access public */ - function mapConfigToSSL() { + public function mapConfigToSSL() { global $base_url; $base_url = str_replace('http://', 'https://', $base_url); } @@ -434,7 +434,7 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase { * @return string the url to post the form * @access public */ - function postURL($action) { + public function postURL($action) { if (!empty($action)) { return $action; } @@ -456,7 +456,7 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase { * contactID, ufID, unique string ) if success * @access public */ - static function authenticate($name, $password, $loadCMSBootstrap = FALSE, $realPath = NULL) { + public static function authenticate($name, $password, $loadCMSBootstrap = FALSE, $realPath = NULL) { require_once 'DB.php'; $config = CRM_Core_Config::singleton(); @@ -535,7 +535,7 @@ AND u.status = 1 * * @return bool */ - function loadUser($username) { + public function loadUser($username) { global $user; $user = user_load_by_name($username); @@ -563,7 +563,7 @@ AND u.status = 1 * * FIXME: Document values accepted/required by $params */ - function userLoginFinalize($params = array()){ + public function userLoginFinalize($params = array()){ user_login_finalize($params); } @@ -573,7 +573,7 @@ AND u.status = 1 * @param string $username * @return int|NULL */ - function getUfId($username) { + public function getUfId($username) { $user = user_load_by_name($username); if (empty($user->uid)) { return NULL; @@ -588,19 +588,19 @@ AND u.status = 1 * * @access public */ - function setMessage($message) { + public function setMessage($message) { drupal_set_message($message); } /** * @return mixed */ - function logout() { + public function logout() { module_load_include('inc', 'user', 'user.pages'); return user_logout(); } - function updateCategories() { + public function updateCategories() { // copied this from profile.module. Seems a bit inefficient, but i dont know a better way // CRM-3600 cache_clear_all(); @@ -612,7 +612,7 @@ AND u.status = 1 * * @return string */ - function getDefaultBlockLocation() { + public function getDefaultBlockLocation() { return 'sidebar_first'; } @@ -621,7 +621,7 @@ AND u.status = 1 * * @return string with the locale or null for none */ - function getUFLocale() { + public function getUFLocale() { // return CiviCRM’s xx_YY locale that either matches Drupal’s Chinese locale // (for CRM-6281), Drupal’s xx_YY or is retrieved based on Drupal’s xx // sometimes for CLI based on order called, this might not be set and/or empty @@ -649,7 +649,7 @@ AND u.status = 1 /** * @return string */ - function getVersion() { + public function getVersion() { return defined('VERSION') ? VERSION : 'Unknown'; } @@ -663,7 +663,7 @@ AND u.status = 1 * * @return bool */ - function loadBootStrap($params = array(), $loadUser = TRUE, $throwError = TRUE, $realPath = NULL) { + public function loadBootStrap($params = array(), $loadUser = TRUE, $throwError = TRUE, $realPath = NULL) { //take the cms root path. $cmsPath = $this->cmsRootPath($realPath); @@ -763,7 +763,7 @@ AND u.status = 1 /** * */ - function cmsRootPath($scriptFilename = NULL) { + public function cmsRootPath($scriptFilename = NULL) { $cmsRoot = $valid = NULL; if (!is_null($scriptFilename)) { @@ -852,7 +852,7 @@ AND u.status = 1 * @return string $url, formatted url. * @static */ - function languageNegotiationURL($url, $addLanguagePart = TRUE, $removeLanguagePart = FALSE) { + public function languageNegotiationURL($url, $addLanguagePart = TRUE, $removeLanguagePart = FALSE) { if (empty($url)) { return $url; } @@ -923,7 +923,7 @@ AND u.status = 1 * * @return void */ - function replacePermission($oldPerm, $newPerms) { + public function replacePermission($oldPerm, $newPerms) { $roles = user_roles(FALSE, $oldPerm); if (!empty($roles)) { foreach (array_keys($roles) as $rid) { @@ -938,7 +938,7 @@ AND u.status = 1 * * @return array CRM_Core_Module */ - function getModules() { + public function getModules() { $result = array(); $q = db_query('SELECT name, status FROM {system} WHERE type = \'module\' AND schema_version <> -1'); foreach ($q as $row) { @@ -953,7 +953,7 @@ AND u.status = 1 * @param integer $ogID Organic Group ID * @param integer $drupalID drupal User ID */ - function og_membership_create($ogID, $drupalID){ + public function og_membership_create($ogID, $drupalID){ if (function_exists('og_entity_query_alter')) { // sort-of-randomly chose a function that only exists in the // 7.x-2.x branch // @@ -974,7 +974,7 @@ AND u.status = 1 * @param integer $ogID Organic Group ID * @param integer $drupalID drupal User ID */ - function og_membership_delete($ogID, $drupalID) { + public function og_membership_delete($ogID, $drupalID) { if (function_exists('og_entity_query_alter')) { // sort-of-randomly chose a function that only exists in the 7.x-2.x branch // TODO: Find a more solid way to make this test @@ -990,7 +990,7 @@ AND u.status = 1 * Over-ridable function to get timezone as a string eg. * @return string Timezone e.g. 'America/Los_Angeles' */ - function getTimeZoneString() { + public function getTimeZoneString() { global $user; if (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone)) { $timezone = $user->timezone; @@ -1006,7 +1006,7 @@ AND u.status = 1 * Reset any system caches that may be required for proper CiviCRM * integration. */ - function flush() { + public function flush() { drupal_flush_all_caches(); } } diff --git a/CRM/Utils/System/Drupal6.php b/CRM/Utils/System/Drupal6.php index fb46eae9b3..839beaee93 100644 --- a/CRM/Utils/System/Drupal6.php +++ b/CRM/Utils/System/Drupal6.php @@ -49,7 +49,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * @return void prints content on stdout * @access public */ - function theme(&$content, $print = FALSE, $maintenance = FALSE) { + public function theme(&$content, $print = FALSE, $maintenance = FALSE) { // TODO: Simplify; this was copied verbatim from CiviCRM 3.4's multi-UF theming function, but that's more complex than necessary if (function_exists('theme') && !$print) { if ($maintenance) { @@ -82,7 +82,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * * @access public */ - function createUser(&$params, $mail) { + public function createUser(&$params, $mail) { $form_state = array(); $form_state['values'] = array( 'name' => $params['cms_name'], @@ -128,7 +128,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * @param int $ufID * @param string $ufName */ - function updateCMSName($ufID, $ufName) { + public function updateCMSName($ufID, $ufName) { // CRM-5555 if (function_exists('user_load')) { $user = user_load(array('uid' => $ufID)); @@ -148,7 +148,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * * @return void */ - function checkUserNameEmailExists(&$params, &$errors, $emailName = 'email') { + public function checkUserNameEmailExists(&$params, &$errors, $emailName = 'email') { $config = CRM_Core_Config::singleton(); $dao = new CRM_Core_DAO(); @@ -218,7 +218,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * @return string $destination destination value for URL * */ - function getLoginDestination(&$form) { + public function getLoginDestination(&$form) { $args = NULL; $id = $form->get('id'); @@ -259,7 +259,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * @return void * @access public */ - function setTitle($title, $pageTitle = NULL) { + public function setTitle($title, $pageTitle = NULL) { if (!$pageTitle) { $pageTitle = $title; } @@ -280,7 +280,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * @return void * @access public */ - function appendBreadCrumb($breadCrumbs) { + public function appendBreadCrumb($breadCrumbs) { $breadCrumb = drupal_get_breadcrumb(); if (is_array($breadCrumbs)) { @@ -308,7 +308,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * @return void * @access public */ - function resetBreadCrumb() { + public function resetBreadCrumb() { $bc = array(); drupal_set_breadcrumb($bc); } @@ -321,7 +321,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * @return void * @access public */ - function addHTMLHead($head) { + public function addHTMLHead($head) { drupal_set_html_head($head); } @@ -403,7 +403,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * @return void * @access public */ - function mapConfigToSSL() { + public function mapConfigToSSL() { global $base_url; $base_url = str_replace('http://', 'https://', $base_url); } @@ -416,7 +416,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * @return string the url to post the form * @access public */ - function postURL($action) { + public function postURL($action) { if (!empty($action)) { return $action; } @@ -437,7 +437,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * contactID, ufID, unique string ) if success * @access public */ - function authenticate($name, $password, $loadCMSBootstrap = FALSE, $realPath = NULL) { + public function authenticate($name, $password, $loadCMSBootstrap = FALSE, $realPath = NULL) { //@todo this 'PEAR-y' stuff is only required when bookstrap is not being loaded which is rare // if ever now. // probably if bootstrap is loaded this call @@ -488,7 +488,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { /** * Load user into session */ - function loadUser($username) { + public function loadUser($username) { global $user; $user = user_load(array('name' => $username)); if (empty($user->uid)) { @@ -514,7 +514,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * * FIXME: Document values accepted/required by $params */ - function userLoginFinalize($params = array()) { + public function userLoginFinalize($params = array()) { user_authenticate_finalize($params); } @@ -524,7 +524,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * @param string $username * @return int|NULL */ - function getUfId($username) { + public function getUfId($username) { $user = user_load(array('name' => $username)); if (empty($user->uid)) { return NULL; @@ -539,19 +539,19 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * * @access public */ - function setMessage($message) { + public function setMessage($message) { drupal_set_message($message); } /** * @return mixed */ - function logout() { + public function logout() { module_load_include('inc', 'user', 'user.pages'); return user_logout(); } - function updateCategories() { + public function updateCategories() { // copied this from profile.module. Seems a bit inefficient, but i dont know a better way // CRM-3600 cache_clear_all(); @@ -563,7 +563,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * * @return string with the locale or null for none */ - function getUFLocale() { + public function getUFLocale() { // return CiviCRM’s xx_YY locale that either matches Drupal’s Chinese locale // (for CRM-6281), Drupal’s xx_YY or is retrieved based on Drupal’s xx // sometimes for CLI based on order called, this might not be set and/or empty @@ -591,7 +591,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { /** * @return string */ - function getVersion() { + public function getVersion() { return defined('VERSION') ? VERSION : 'Unknown'; } @@ -605,7 +605,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * * @return bool */ - function loadBootStrap($params = array(), $loadUser = TRUE, $throwError = TRUE, $realPath = NULL) { + public function loadBootStrap($params = array(), $loadUser = TRUE, $throwError = TRUE, $realPath = NULL) { //take the cms root path. $cmsPath = $this->cmsRootPath($realPath); @@ -708,7 +708,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { /** * */ - function cmsRootPath($scriptFilename = NULL) { + public function cmsRootPath($scriptFilename = NULL) { $cmsRoot = $valid = NULL; if (!is_null($scriptFilename)) { @@ -797,7 +797,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * @return string $url, formatted url. * @static */ - function languageNegotiationURL($url, $addLanguagePart = TRUE, $removeLanguagePart = FALSE) { + public function languageNegotiationURL($url, $addLanguagePart = TRUE, $removeLanguagePart = FALSE) { if (empty($url)) { return $url; } @@ -865,7 +865,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * * @return void */ - function replacePermission($oldPerm, $newPerms) { + public function replacePermission($oldPerm, $newPerms) { $roles = user_roles(FALSE, $oldPerm); foreach ($roles as $rid => $roleName) { $permList = db_result(db_query('SELECT perm FROM {permission} WHERE rid = %d', $rid)); @@ -888,7 +888,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * * @return array CRM_Core_Module */ - function getModules() { + public function getModules() { $result = array(); $q = db_query('SELECT name, status FROM {system} WHERE type = \'module\' AND schema_version <> -1'); while ($row = db_fetch_object($q)) { @@ -922,7 +922,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * @param integer $ogID Organic Group ID * @param integer $drupalID drupal User ID */ - function og_membership_create($ogID, $drupalID){ + public function og_membership_create($ogID, $drupalID){ og_save_subscription( $ogID, $drupalID, array( 'is_active' => 1 ) ); } @@ -932,7 +932,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * @param integer $ogID Organic Group ID * @param integer $drupalID drupal User ID */ - function og_membership_delete($ogID, $drupalID) { + public function og_membership_delete($ogID, $drupalID) { og_delete_subscription( $ogID, $drupalID ); } @@ -940,7 +940,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * Over-ridable function to get timezone as a string eg. * @return string Timezone e.g. 'America/Los_Angeles' */ - function getTimeZoneString() { + public function getTimeZoneString() { global $user; if (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone)) { $timezone = $user->timezone; @@ -958,7 +958,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * Reset any system caches that may be required for proper CiviCRM * integration. */ - function flush() { + public function flush() { drupal_flush_all_caches(); } } diff --git a/CRM/Utils/System/Drupal8.php b/CRM/Utils/System/Drupal8.php index 34e2f1a731..25d45fd875 100644 --- a/CRM/Utils/System/Drupal8.php +++ b/CRM/Utils/System/Drupal8.php @@ -49,7 +49,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { * @access public * */ - function createUser(&$params, $mail) { + public function createUser(&$params, $mail) { $user = \Drupal::currentUser(); $user_register_conf = \Drupal::config('user.settings')->get('register'); $verify_mail_conf = \Drupal::config('user.settings')->get('verify_mail'); @@ -117,7 +117,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { * @param integer $ufID User ID in CMS * @param string $email Primary contact email address */ - function updateCMSName($ufID, $email) { + public function updateCMSName($ufID, $email) { $user = user_load($ufID); if ($user && $user->getEmail() != $email) { $user->setEmail($email); @@ -138,7 +138,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { * * @return void */ - static function checkUserNameEmailExists(&$params, &$errors, $emailName = 'email') { + public static function checkUserNameEmailExists(&$params, &$errors, $emailName = 'email') { // If we are given a name, let's check to see if it already exists. if (!empty($params['name'])) { $name = $params['name']; @@ -180,7 +180,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { * @return string $destination destination value for URL * */ - function getLoginDestination(&$form) { + public function getLoginDestination(&$form) { $args = NULL; $id = $form->get('id'); @@ -233,7 +233,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { * @return void * @access public */ - function setTitle($title, $pageTitle = NULL) { + public function setTitle($title, $pageTitle = NULL) { if (!$pageTitle) { $pageTitle = $title; } @@ -252,7 +252,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { * @return void * @access public */ - function appendBreadCrumb($breadcrumbs) { + public function appendBreadCrumb($breadcrumbs) { $civicrmPageState = \Drupal::service('civicrm.page_state'); foreach ($breadcrumbs as $breadcrumb) { $civicrmPageState->addBreadcrumb($breadcrumb['title'], $breadcrumb['url']); @@ -265,7 +265,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { * @return void * @access public */ - function resetBreadCrumb() { + public function resetBreadCrumb() { \Drupal::service('civicrm.page_state')->resetBreadcrumbs(); } @@ -277,7 +277,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { * @return void * @access public */ - function addHTMLHead($header) { + public function addHTMLHead($header) { \Drupal::service('civicrm.page_state')->addHtmlHeader($header); } @@ -389,7 +389,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { * * @return bool */ - function formatResourceUrl(&$url) { + public function formatResourceUrl(&$url) { // Remove leading slash if present. $url = ltrim($url, '/'); @@ -412,7 +412,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { * @return void * @access public */ - function mapConfigToSSL() { + public function mapConfigToSSL() { } /** @@ -425,7 +425,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { * @param bool $forceBackend A joomla jack (unused) * @return string */ - function url($path = '', $query = '', $absolute = FALSE, $fragment = '', $htmlize = FALSE, $frontend = FALSE, $forceBackend = FALSE) { + public function url($path = '', $query = '', $absolute = FALSE, $fragment = '', $htmlize = FALSE, $frontend = FALSE, $forceBackend = FALSE) { $query = html_entity_decode($query); $url = \Drupal\civicrm\CivicrmHelper::parseURL("{$path}?{$query}"); @@ -462,7 +462,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { * * This always bootstraps Drupal */ - function authenticate($name, $password, $loadCMSBootstrap = FALSE, $realPath = NULL) { + public function authenticate($name, $password, $loadCMSBootstrap = FALSE, $realPath = NULL) { (new CRM_Utils_System_Drupal8())->loadBootStrap(array(), FALSE); $uid = \Drupal::service('user.auth')->authenticate($name, $password); @@ -474,7 +474,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { /** * Load user into session */ - function loadUser($username) { + public function loadUser($username) { $user = user_load_by_name($username); if (!$user) { return FALSE; @@ -499,7 +499,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { * @param string $username * @return int|NULL */ - function getUfId($username) { + public function getUfId($username) { if ($id = user_load_by_name($username)->id()) { return $id; } @@ -512,11 +512,11 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { * * @access public */ - function setMessage($message) { + public function setMessage($message) { drupal_set_message($message); } - function permissionDenied() { + public function permissionDenied() { \Drupal::service('civicrm.page_state')->setAccessDenied(); } @@ -524,7 +524,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { * In previous versions, this function was the controller for logging out. In Drupal 8, we rewrite the route * to hand off logout to the standard Drupal logout controller. This function should therefore never be called. */ - function logout() { + public function logout() { // Pass } @@ -539,7 +539,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { * @return bool * @Todo Handle setting cleanurls configuration for CiviCRM? */ - function loadBootStrap($params = array(), $loadUser = TRUE, $throwError = TRUE, $realPath = NULL) { + public function loadBootStrap($params = array(), $loadUser = TRUE, $throwError = TRUE, $realPath = NULL) { static $run_once = FALSE; if ($run_once) return TRUE; else $run_once = TRUE; @@ -580,7 +580,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { * * @return NULL|string */ - function cmsRootPath($path = NULL) { + public function cmsRootPath($path = NULL) { if (defined('DRUPAL_ROOT')) { return DRUPAL_ROOT; } @@ -635,7 +635,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { * @return string * */ - function getDefaultBlockLocation() { + public function getDefaultBlockLocation() { return 'sidebar_first'; } } diff --git a/CRM/Utils/System/DrupalBase.php b/CRM/Utils/System/DrupalBase.php index d541eaa849..8277c5c652 100644 --- a/CRM/Utils/System/DrupalBase.php +++ b/CRM/Utils/System/DrupalBase.php @@ -47,7 +47,7 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { /** * */ - function __construct() { + public function __construct() { /** * deprecated property to check if this is a drupal install. The correct method is to have functions on the UF classes for all UF specific * functions and leave the codebase oblivious to the type of CMS @@ -66,7 +66,7 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { * - $siteName, * - $siteRoot */ - function getDefaultSiteSettings($dir){ + public function getDefaultSiteSettings($dir){ $config = CRM_Core_Config::singleton(); $siteName = $siteRoot = NULL; $matches = array(); @@ -96,7 +96,7 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { * @return bool: TRUE for internal paths, FALSE for external. The drupal_add_js fn is able to add js more * efficiently if it is known to be in the drupal site */ - function formatResourceUrl(&$url) { + public function formatResourceUrl(&$url) { $internal = FALSE; $base = CRM_Core_Config::singleton()->resourceBase; global $base_url; @@ -130,7 +130,7 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { * @param string $url potential resource url based on standard folder assumptions * @return string $url with civicrm-core directory appended if not standard civi dir */ - function appendCoreDirectoryToResourceBase($url) { + public function appendCoreDirectoryToResourceBase($url) { global $civicrm_root; $lastDirectory = basename($civicrm_root); if($lastDirectory != 'civicrm') { @@ -220,7 +220,7 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { * @param object $user object as described by the CMS * @return mixed */ - function getUserIDFromUserObject($user) { + public function getUserIDFromUserObject($user) { return !empty($user->uid) ? $user->uid : NULL; } @@ -230,7 +230,7 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { * @return mixed $uniqueIdentifer Unique identifier from the user Framework system * */ - function getUniqueIdentifierFromUserObject($user) { + public function getUniqueIdentifierFromUserObject($user) { return empty($user->mail) ? NULL : $user->mail; } @@ -239,7 +239,7 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { * * @return string $userID logged in user unique identifier */ - function getLoggedInUniqueIdentifier() { + public function getLoggedInUniqueIdentifier() { global $user; return $this->getUniqueIdentifierFromUserObject($user); } @@ -247,7 +247,7 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { /** * Action to take when access is not permitted */ - function permissionDenied() { + public function permissionDenied() { drupal_access_denied(); } @@ -257,7 +257,7 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { * * @return string */ - function getUserRecordUrl($contactID) { + public function getUserRecordUrl($contactID) { $uid = CRM_Core_BAO_UFMatch::getUFId($contactID); if (CRM_Core_Session::singleton()->get('userID') == $contactID || CRM_Core_Permission::checkAnyPerm(array('cms:administer users', 'cms:view user account'))) { return CRM_Utils_System::url('user/' . $uid); @@ -268,7 +268,7 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { * Is the current user permitted to add a user * @return bool */ - function checkPermissionAddUser() { + public function checkPermissionAddUser() { if (CRM_Core_Permission::check('administer users')) { return TRUE; } @@ -278,7 +278,7 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { /** * Log error to CMS */ - function logger($message) { + public function logger($message) { if (CRM_Core_Config::singleton()->userFrameworkLogging) { watchdog('civicrm', $message, NULL, WATCHDOG_DEBUG); } @@ -287,14 +287,14 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { /** * Flush css/js caches */ - function clearResourceCache() { + public function clearResourceCache() { _drupal_flush_css_js(); } /** * Append to coreResourcesList */ - function appendCoreResources(&$list) { + public function appendCoreResources(&$list) { $list[] = 'js/crm.drupal.js'; } @@ -302,7 +302,7 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { * Reset any system caches that may be required for proper CiviCRM * integration. */ - function flush() { + public function flush() { drupal_flush_all_caches(); } @@ -312,7 +312,7 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { * @return array CRM_Core_Module * */ - function getModules() { + public function getModules() { $result = array(); $q = db_query('SELECT name, status FROM {system} WHERE type = \'module\' AND schema_version <> -1'); foreach ($q as $row) { @@ -330,7 +330,7 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { * * @return void */ - function replacePermission($oldPerm, $newPerms) { + public function replacePermission($oldPerm, $newPerms) { $roles = user_roles(FALSE, $oldPerm); if (!empty($roles)) { foreach (array_keys($roles) as $rid) { @@ -347,7 +347,7 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { * @return string $url, formatted url. * @static */ - function languageNegotiationURL($url, $addLanguagePart = TRUE, $removeLanguagePart = FALSE) { + public function languageNegotiationURL($url, $addLanguagePart = TRUE, $removeLanguagePart = FALSE) { if (empty($url)) { return $url; } @@ -407,13 +407,13 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { * GET CMS Version * @return string */ - function getVersion() { + public function getVersion() { return defined('VERSION') ? VERSION : 'Unknown'; } /** */ - function updateCategories() { + public function updateCategories() { // copied this from profile.module. Seems a bit inefficient, but i dont know a better way // CRM-3600 cache_clear_all(); @@ -426,7 +426,7 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { * @return string with the locale or null for none * */ - function getUFLocale() { + public function getUFLocale() { // return CiviCRM’s xx_YY locale that either matches Drupal’s Chinese locale // (for CRM-6281), Drupal’s xx_YY or is retrieved based on Drupal’s xx // sometimes for CLI based on order called, this might not be set and/or empty @@ -460,7 +460,7 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { * FIXME: Document values accepted/required by $params * */ - function userLoginFinalize($params = array()){ + public function userLoginFinalize($params = array()){ user_login_finalize($params); } @@ -472,7 +472,7 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { * @return string the url to post the form * @access public */ - function postURL($action) { + public function postURL($action) { if (!empty($action)) { return $action; } diff --git a/CRM/Utils/System/Joomla.php b/CRM/Utils/System/Joomla.php index 507774cde8..b8001ef2ea 100644 --- a/CRM/Utils/System/Joomla.php +++ b/CRM/Utils/System/Joomla.php @@ -40,7 +40,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { /** * */ - function __construct() { + public function __construct() { /** * deprecated property to check if this is a drupal install. The correct method is to have functions on the UF classes for all UF specific * functions and leave the codebase oblivious to the type of CMS @@ -60,7 +60,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * * @access public */ - function createUser(&$params, $mail) { + public function createUser(&$params, $mail) { $baseDir = JPATH_SITE; require_once $baseDir . '/components/com_users/models/registration.php'; @@ -106,7 +106,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * @param integer $ufID User ID in CMS * @param string $ufName User name */ - function updateCMSName($ufID, $ufName) { + public function updateCMSName($ufID, $ufName) { $ufID = CRM_Utils_Type::escape($ufID, 'Integer'); $ufName = CRM_Utils_Type::escape($ufName, 'String'); @@ -128,7 +128,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * * @return void */ - function checkUserNameEmailExists(&$params, &$errors, $emailName = 'email') { + public function checkUserNameEmailExists(&$params, &$errors, $emailName = 'email') { $config = CRM_Core_Config::singleton(); $dao = new CRM_Core_DAO(); @@ -183,7 +183,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * @return void * @access public */ - function setTitle($title, $pageTitle = NULL) { + public function setTitle($title, $pageTitle = NULL) { if (!$pageTitle) { $pageTitle = $title; } @@ -208,7 +208,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * @return void * @access public */ - function appendBreadCrumb($breadCrumbs) { + public function appendBreadCrumb($breadCrumbs) { $template = CRM_Core_Smarty::singleton(); $bc = $template->get_template_vars('breadcrumb'); @@ -240,7 +240,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * @return void * @access public */ - function resetBreadCrumb() { + public function resetBreadCrumb() { return; } @@ -254,7 +254,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * @return void * @access public */ - static function addHTMLHead($string = NULL) { + public static function addHTMLHead($string = NULL) { if ($string) { $document = JFactory::getDocument(); $document->addCustomTag($string); @@ -416,7 +416,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * @return void * access public */ - function mapConfigToSSL() { + public function mapConfigToSSL() { // dont need to do anything, let CMS handle their own switch to SSL return; } @@ -429,7 +429,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * @return string the url to post the form * @access public */ - function postURL($action) { + public function postURL($action) { if (!empty($action)) { return $action; } @@ -447,7 +447,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * @return void * @access public */ - function setEmail(&$user) { + public function setEmail(&$user) { global $database; $query = "SELECT email FROM #__users WHERE id='$user->id'"; $database->setQuery($query); @@ -466,7 +466,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { contactID, ufID, unique string ) if success * @access public */ - function authenticate($name, $password, $loadCMSBootstrap = FALSE) { + public function authenticate($name, $password, $loadCMSBootstrap = FALSE) { require_once 'DB.php'; $config = CRM_Core_Config::singleton(); @@ -560,7 +560,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * * @access public */ - function setUserSession($data) { + public function setUserSession($data) { list($userID, $ufID) = $data; $user = new JUser( $ufID ); $session = JFactory::getSession(); @@ -576,7 +576,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * * @access public */ - function setMessage($message) { + public function setMessage($message) { return; } @@ -585,15 +585,15 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * * @return bool */ - function loadUser($user) { + public function loadUser($user) { return TRUE; } - function permissionDenied() { + public function permissionDenied() { CRM_Core_Error::fatal(ts('You do not have permission to access this page.')); } - function logout() { + public function logout() { session_destroy(); header("Location:index.php"); } @@ -603,7 +603,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * * @return string the used locale or null for none */ - function getUFLocale() { + public function getUFLocale() { if (defined('_JEXEC')) { $conf = JFactory::getConfig(); $locale = $conf->get('language'); @@ -615,7 +615,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { /** * @return string */ - function getVersion() { + public function getVersion() { if (class_exists('JVersion')) { $version = new JVersion; return $version->getShortVersion(); @@ -636,7 +636,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * * @return bool */ - function loadBootStrap($params = array(), $loadUser = TRUE, $throwError = TRUE, $realPath = NULL, $loadDefines = TRUE) { + public function loadBootStrap($params = array(), $loadUser = TRUE, $throwError = TRUE, $realPath = NULL, $loadDefines = TRUE) { // Setup the base path related constant. $joomlaBase = dirname(dirname(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))))); @@ -707,7 +707,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * * @return string $userID logged in user unique identifier */ - function getLoggedInUniqueIdentifier() { + public function getLoggedInUniqueIdentifier() { $user = JFactory::getUser(); return $this->getUniqueIdentifierFromUserObject($user); } @@ -716,7 +716,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * @param object $user object as described by the CMS * @return mixed */ - function getUserIDFromUserObject($user) { + public function getUserIDFromUserObject($user) { return !empty($user->id) ? $user->id : NULL; } @@ -726,7 +726,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * @return mixed $uniqueIdentifer Unique identifier from the user Framework system * */ - function getUniqueIdentifierFromUserObject($user) { + public function getUniqueIdentifierFromUserObject($user) { return ($user->guest) ? NULL : $user->email; } @@ -735,7 +735,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * * @return array CRM_Core_Module */ - function getModules() { + public function getModules() { $result = array(); $db = JFactory::getDbo(); @@ -819,7 +819,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * - $siteName, * - $siteRoot */ - function getDefaultSiteSettings($dir){ + public function getDefaultSiteSettings($dir){ $config = CRM_Core_Config::singleton(); $url = preg_replace( '|/administrator|', @@ -840,7 +840,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * * @return string */ - function getUserRecordUrl($contactID) { + public function getUserRecordUrl($contactID) { $uid = CRM_Core_BAO_UFMatch::getUFId($contactID); $userRecordUrl = NULL; // if logged in user is super user, then he can view other users joomla profile @@ -856,7 +856,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * Is the current user permitted to add a user * @return bool */ - function checkPermissionAddUser() { + public function checkPermissionAddUser() { if (JFactory::getUser()->authorise('core.create', 'com_users')) { return TRUE; } @@ -866,7 +866,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * Output code from error function * @param string $content */ - function outputError($content) { + public function outputError($content) { if (class_exists('JErrorPage')) { $error = new Exception($content); JErrorPage::render($error); @@ -882,7 +882,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { /** * Append to coreResourcesList */ - function appendCoreResources(&$list) { + public function appendCoreResources(&$list) { $list[] = 'js/crm.joomla.js'; } } diff --git a/CRM/Utils/System/Soap.php b/CRM/Utils/System/Soap.php index 5be3b32a70..1368570743 100644 --- a/CRM/Utils/System/Soap.php +++ b/CRM/Utils/System/Soap.php @@ -55,7 +55,7 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base { * @return void * @access public */ - function setTitle($title, $pageTitle) { + public function setTitle($title, $pageTitle) { return; } @@ -68,7 +68,7 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base { * @static * @access public */ - function checkPermission($str) { + public function checkPermission($str) { return TRUE; } @@ -81,7 +81,7 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base { * @return void * @access public */ - function appendBreadCrumb($title, $url) { + public function appendBreadCrumb($title, $url) { return; } @@ -93,7 +93,7 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base { * @return void * @access public */ - function addHTMLHead($head) { + public function addHTMLHead($head) { return; } @@ -111,7 +111,7 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base { * @access public * */ - function url($path = NULL, $query = NULL, $absolute = TRUE, $fragment = NULL) { + public function url($path = NULL, $query = NULL, $absolute = TRUE, $fragment = NULL) { if (isset(self::$ufClass)) { $className = self::$ufClass; $url = $className::url($path, $query, $absolute, $fragment); @@ -130,7 +130,7 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base { * @return string the url to post the form * @access public */ - function postURL($action) { + public function postURL($action) { return NULL; } @@ -142,7 +142,7 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base { * @return void * @access public */ - function setEmail(&$user) {} + public function setEmail(&$user) {} /** * Authenticate a user against the real UF @@ -153,7 +153,7 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base { * @return array Result array * @access public */ - function &authenticate($name, $pass) { + public function &authenticate($name, $pass) { if (isset(self::$ufClass)) { $className = self::$ufClass; $result =& $className::authenticate($name, $pass); @@ -184,7 +184,7 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base { * * @return null as the language is set elsewhere */ - function getUFLocale() { + public function getUFLocale() { return NULL; } diff --git a/CRM/Utils/System/UnitTests.php b/CRM/Utils/System/UnitTests.php index 82c085c627..89827e2525 100644 --- a/CRM/Utils/System/UnitTests.php +++ b/CRM/Utils/System/UnitTests.php @@ -40,7 +40,7 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal { /** * */ - function __construct() { + public function __construct() { $this->is_drupal = FALSE; $this->supports_form_extensions = False; } @@ -60,7 +60,7 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal { * @param string $title * @param null $pageTitle */ - function setTitle($title, $pageTitle = NULL) { + public function setTitle($title, $pageTitle = NULL) { return; } @@ -85,7 +85,7 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal { * * @return mixed */ - static function authenticate($name, $password, $loadCMSBootstrap = FALSE, $realPath = NULL) { + public static function authenticate($name, $password, $loadCMSBootstrap = FALSE, $realPath = NULL) { $retVal = array(1, 1, 12345); return $retVal; } @@ -104,11 +104,11 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal { /** * @param $breadCrumbs */ - function appendBreadCrumb($breadCrumbs) { + public function appendBreadCrumb($breadCrumbs) { return; } - function resetBreadCrumb() { + public function resetBreadCrumb() { return; } @@ -123,11 +123,11 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal { /** * @param string $head */ - function addHTMLHead($head) { + public function addHTMLHead($head) { return; } - function mapConfigToSSL() { + public function mapConfigToSSL() { global $base_url; $base_url = str_replace('http://', 'https://', $base_url); } @@ -145,7 +145,7 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal { * * @return string */ - function postURL($action) { + public function postURL($action) { return; } @@ -237,7 +237,7 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal { /** * @param $user */ - function getUserID($user) { + public function getUserID($user) { //FIXME: look here a bit closer when testing UFMatch // this puts the appropriate values in the session, so @@ -250,7 +250,7 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal { * * @return bool */ - function getAllowedToLogin($user) { + public function getAllowedToLogin($user) { return TRUE; } @@ -264,15 +264,15 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal { /** * @param string $message */ - function setMessage($message) { + public function setMessage($message) { return; } - function permissionDenied() { + public function permissionDenied() { CRM_Core_Error::fatal(ts('You do not have permission to access this page.')); } - function logout() { + public function logout() { session_destroy(); header("Location:index.php"); } @@ -285,7 +285,7 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal { /** * @return string */ - function getUFLocale() { + public function getUFLocale() { return NULL; } @@ -297,7 +297,7 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal { /** * @return array */ - function getModules() { + public function getModules() { return array(); } @@ -318,12 +318,12 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal { * Over-ridable function to get timezone as a string eg. * @return string Timezone e.g. 'America/Los_Angeles' */ - function getTimeZoneString() { + public function getTimeZoneString() { // This class extends Drupal, but we don't want Drupal's behavior; reproduce CRM_Utils_System_Base::getTimeZoneString return date_default_timezone_get(); } - function clearResourceCache() { + public function clearResourceCache() { // UGH. Obscure Drupal-specific implementation. Why does UnitTests extend Drupal? // You should delete this function if the base-classes are properly rearranged. } diff --git a/CRM/Utils/System/WordPress.php b/CRM/Utils/System/WordPress.php index bb2cfcb9d3..186736af97 100644 --- a/CRM/Utils/System/WordPress.php +++ b/CRM/Utils/System/WordPress.php @@ -40,7 +40,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { /** * */ - function __construct() { + public function __construct() { /** * deprecated property to check if this is a drupal install. The correct method is to have functions on the UF classes for all UF specific * functions and leave the codebase oblivious to the type of CMS @@ -60,7 +60,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * @return void * @access public */ - function setTitle($title, $pageTitle = NULL) { + public function setTitle($title, $pageTitle = NULL) { if (!$pageTitle) { $pageTitle = $title; } @@ -106,7 +106,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * @access public * @static */ - function appendBreadCrumb($breadCrumbs) { + public function appendBreadCrumb($breadCrumbs) { $breadCrumb = wp_get_breadcrumb(); if (is_array($breadCrumbs)) { @@ -138,7 +138,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * @access public * @static */ - function resetBreadCrumb() { + public function resetBreadCrumb() { $bc = array(); wp_set_breadcrumb($bc); } @@ -152,7 +152,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * @access public * @static */ - function addHTMLHead($head) { + public function addHTMLHead($head) { static $registered = FALSE; if (!$registered) { // front-end view @@ -165,7 +165,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { )); } - static function _showHTMLHead() { + public static function _showHTMLHead() { $region = CRM_Core_Region::instance('wp_head', FALSE); if ($region) { echo $region->render(''); @@ -245,7 +245,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * @access public * @static */ - function mapConfigToSSL() { + public function mapConfigToSSL() { global $base_url; $base_url = str_replace('http://', 'https://', $base_url); } @@ -259,7 +259,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * @access public * @static */ - function postURL($action) { + public function postURL($action) { if (!empty($action)) { return $action; } @@ -403,7 +403,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * @access public * @static */ - function authenticate($name, $password, $loadCMSBootstrap = FALSE, $realPath = NULL) { + public function authenticate($name, $password, $loadCMSBootstrap = FALSE, $realPath = NULL) { $config = CRM_Core_Config::singleton(); if ($loadCMSBootstrap) { @@ -433,7 +433,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * @access public * @static */ - function setMessage($message) { + public function setMessage($message) { } /** @@ -441,15 +441,15 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * * @return bool */ - function loadUser( $user ) { + public function loadUser( $user ) { return true; } - function permissionDenied() { + public function permissionDenied() { CRM_Core_Error::fatal(ts('You do not have permission to access this page.')); } - function logout() { + public function logout() { // destroy session if (session_id()) { session_destroy(); @@ -458,14 +458,14 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { wp_redirect(wp_login_url()); } - function updateCategories() {} + public function updateCategories() {} /** * Get the locale set in the hosting CMS * * @return string with the locale or null for none */ - function getUFLocale() { + public function getUFLocale() { // WPML plugin if (defined('ICL_LANGUAGE_CODE')) { $language = ICL_LANGUAGE_CODE; @@ -488,7 +488,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * * @return bool */ - function loadBootStrap($name = NULL, $pass = NULL) { + public function loadBootStrap($name = NULL, $pass = NULL) { global $wp, $wp_rewrite, $wp_the_query, $wp_query, $wpdb; $cmsRootPath = $this->cmsRootPath(); @@ -520,7 +520,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * * @return bool */ - function validInstallDir($dir) { + public function validInstallDir($dir) { $includePath = "$dir/wp-includes"; if ( @opendir($includePath) && @@ -539,7 +539,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { /** * @return NULL|string */ - function cmsRootPath() { + public function cmsRootPath() { $cmsRoot = $valid = NULL; if (defined('CIVICRM_CMSDIR')) { if ($this->validInstallDir(CIVICRM_CMSDIR)) { @@ -576,7 +576,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * * @return mixed */ - function createUser(&$params, $mail) { + public function createUser(&$params, $mail) { $user_data = array( 'ID' => '', 'user_pass' => $params['cms_pass'], @@ -615,7 +615,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * @param integer $ufID User ID in CMS * @param string $ufName User name */ - function updateCMSName($ufID, $ufName) { + public function updateCMSName($ufID, $ufName) { // CRM-10620 if (function_exists('wp_update_user')) { $ufID = CRM_Utils_Type::escape($ufID, 'Integer'); @@ -633,7 +633,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * @param $errors * @param string $emailName */ - function checkUserNameEmailExists(&$params, &$errors, $emailName = 'email') { + public function checkUserNameEmailExists(&$params, &$errors, $emailName = 'email') { $config = CRM_Core_Config::singleton(); $dao = new CRM_Core_DAO(); @@ -679,7 +679,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { /** * @return mixed */ - function getLoggedInUserObject() { + public function getLoggedInUserObject() { if (function_exists('is_user_logged_in') && is_user_logged_in()) { global $current_user; @@ -702,7 +702,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * * @return string $userID logged in user unique identifier */ - function getLoggedInUniqueIdentifier() { + public function getLoggedInUniqueIdentifier() { $user = $this->getLoggedInUserObject(); return $this->getUniqueIdentifierFromUserObject($user); } @@ -712,7 +712,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * @param object $user object as described by the CMS * @return mixed */ - function getUserIDFromUserObject($user) { + public function getUserIDFromUserObject($user) { return !empty($user->ID) ? $user->ID : NULL; } @@ -722,7 +722,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * @return mixed $uniqueIdentifer Unique identifier from the user Framework system * */ - function getUniqueIdentifierFromUserObject($user) { + public function getUniqueIdentifierFromUserObject($user) { return empty($user->user_email) ? NULL : $user->user_email; } @@ -754,7 +754,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * @return string - version number * */ - function getVersion() { + public function getVersion() { if (function_exists('get_bloginfo')) { return get_bloginfo('version', 'display'); } @@ -767,7 +767,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * Get timezone as a string * @return string Timezone e.g. 'America/Los_Angeles' */ - function getTimeZoneString() { + public function getTimeZoneString() { return get_option('timezone_string'); } @@ -777,7 +777,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * * @return string */ - function getUserRecordUrl($contactID) { + public function getUserRecordUrl($contactID) { $uid = CRM_Core_BAO_UFMatch::getUFId($contactID); if (CRM_Core_Session::singleton()->get('userID') == $contactID || CRM_Core_Permission::checkAnyPerm(array('cms:administer users'))) { return CRM_Core_Config::singleton()->userFrameworkBaseURL . "wp-admin/user-edit.php?user_id=" . $uid; diff --git a/CRM/Utils/Time.php b/CRM/Utils/Time.php index 4f1207c7f8..2793eaeec5 100644 --- a/CRM/Utils/Time.php +++ b/CRM/Utils/Time.php @@ -52,7 +52,7 @@ class CRM_Utils_Time { * * @static */ - static function getTime($returnFormat = 'YmdHis') { + public static function getTime($returnFormat = 'YmdHis') { return date($returnFormat, self::getTimeRaw()); } @@ -61,7 +61,7 @@ class CRM_Utils_Time { * * @return int, seconds since epoch */ - static function getTimeRaw() { + public static function getTimeRaw() { return time() + self::$_delta; } @@ -75,7 +75,7 @@ class CRM_Utils_Time { * * @static */ - static function setTime($newDateTime, $returnFormat = 'YmdHis') { + public static function setTime($newDateTime, $returnFormat = 'YmdHis') { self::$_delta = strtotime($newDateTime) - time(); return self::getTime($returnFormat); } @@ -83,7 +83,7 @@ class CRM_Utils_Time { /** * Remove any time overrides */ - static function resetTime() { + public static function resetTime() { self::$_delta = 0; } @@ -96,7 +96,7 @@ class CRM_Utils_Time { * @param int $threshold maximum allowed difference (in seconds) * @return bool */ - static function isEqual($a, $b, $threshold = 0) { + public static function isEqual($a, $b, $threshold = 0) { $diff = strtotime($b) - strtotime($a); return (abs($diff) <= $threshold); } diff --git a/CRM/Utils/Token.php b/CRM/Utils/Token.php index e858754cad..4a2986b6d8 100644 --- a/CRM/Utils/Token.php +++ b/CRM/Utils/Token.php @@ -1054,7 +1054,7 @@ class CRM_Utils_Token { * @return array $tokens array of tokens mentioned in field@access public * @static */ - static function getTokens($string) { + public static function getTokens($string) { $matches = array(); $tokens = array(); preg_match_all('/(? array('limit' => 200000), 'membership_id' => array('IN' => (array) $membershipIDs))); return $memberships['values']; } @@ -1315,7 +1315,7 @@ class CRM_Utils_Token { * * @access public */ - static function replaceGreetingTokens(&$tokenString, $contactDetails = NULL, $contactId = NULL, $className = NULL, $escapeSmarty = FALSE) { + public static function replaceGreetingTokens(&$tokenString, $contactDetails = NULL, $contactId = NULL, $className = NULL, $escapeSmarty = FALSE) { if (!$contactDetails && !$contactId) { return; @@ -1392,7 +1392,7 @@ class CRM_Utils_Token { * * @return array */ - static function flattenTokens(&$tokens) { + public static function flattenTokens(&$tokens) { $flattenTokens = array(); foreach (array( @@ -1683,7 +1683,7 @@ class CRM_Utils_Token { /** * @return array: legacy_token => new_token */ - static function legacyContactTokens() { + public static function legacyContactTokens() { return array( 'individual_prefix' => 'prefix_id', 'individual_suffix' => 'suffix_id', @@ -1697,7 +1697,7 @@ class CRM_Utils_Token { * @param $tokens * @return array */ - static function formatTokensForDisplay($tokens) { + public static function formatTokensForDisplay($tokens) { $sorted = $output = array(); // Sort in ascending order by ignoring word case diff --git a/CRM/Utils/Type.php b/CRM/Utils/Type.php index 9db22b6867..3b640394d1 100644 --- a/CRM/Utils/Type.php +++ b/CRM/Utils/Type.php @@ -73,7 +73,7 @@ class CRM_Utils_Type { * @return string $string String datatype respective to integer datatype@access public * @static */ - static function typeToString($type) { + public static function typeToString($type) { switch ($type) { case 1: $string = 'Int'; diff --git a/CRM/Utils/VersionCheck.php b/CRM/Utils/VersionCheck.php index a10829ff0f..18ba82e851 100644 --- a/CRM/Utils/VersionCheck.php +++ b/CRM/Utils/VersionCheck.php @@ -100,7 +100,7 @@ class CRM_Utils_VersionCheck { * * @access private */ - function __construct() { + public function __construct() { global $civicrm_root; $config = CRM_Core_Config::singleton(); @@ -140,7 +140,7 @@ class CRM_Utils_VersionCheck { * * @return CRM_Utils_VersionCheck */ - static function &singleton() { + public static function &singleton() { if (!isset(self::$_singleton)) { self::$_singleton = new CRM_Utils_VersionCheck(); } diff --git a/CRM/Utils/Weight.php b/CRM/Utils/Weight.php index fa075aee47..adfc94dee5 100644 --- a/CRM/Utils/Weight.php +++ b/CRM/Utils/Weight.php @@ -48,7 +48,7 @@ class CRM_Utils_Weight { * * @return bool */ - static function correctDuplicateWeights($daoName, $fieldValues = NULL, $weightField = 'weight') { + public static function correctDuplicateWeights($daoName, $fieldValues = NULL, $weightField = 'weight') { $selectField = "MIN(id) AS dupeId, count(id) as dupeCount, $weightField as dupeWeight"; $groupBy = "$weightField having dupeCount>1"; @@ -92,7 +92,7 @@ class CRM_Utils_Weight { * * @return bool */ - static function delWeight($daoName, $fieldID, $fieldValues = NULL, $weightField = 'weight') { + public static function delWeight($daoName, $fieldID, $fieldValues = NULL, $weightField = 'weight') { $object = new $daoName(); $object->id = $fieldID; if (!$object->find(TRUE)) { @@ -126,7 +126,7 @@ class CRM_Utils_Weight { * * @return int */ - static function updateOtherWeights($daoName, $oldWeight, $newWeight, $fieldValues = NULL, $weightField = 'weight') { + public static function updateOtherWeights($daoName, $oldWeight, $newWeight, $fieldValues = NULL, $weightField = 'weight') { $oldWeight = (int ) $oldWeight; $newWeight = (int ) $newWeight; @@ -189,7 +189,7 @@ class CRM_Utils_Weight { * * @return integer */ - static function getNewWeight($daoName, $fieldValues = NULL, $weightField = 'weight') { + public static function getNewWeight($daoName, $fieldValues = NULL, $weightField = 'weight') { $selectField = "id AS fieldID, $weightField AS weight"; $field = CRM_Utils_Weight::query('SELECT', $daoName, $fieldValues, $selectField); $sameWeightCount = 0; @@ -228,7 +228,7 @@ class CRM_Utils_Weight { * * @return integer */ - static function getMax($daoName, $fieldValues = NULL, $weightField = 'weight') { + public static function getMax($daoName, $fieldValues = NULL, $weightField = 'weight') { $selectField = "MAX(ROUND($weightField)) AS max_weight"; $weightDAO = CRM_Utils_Weight::query('SELECT', $daoName, $fieldValues, $selectField); $weightDAO->fetch(); @@ -248,7 +248,7 @@ class CRM_Utils_Weight { * * @return integer */ - static function getDefaultWeight($daoName, $fieldValues = NULL, $weightField = 'weight') { + public static function getDefaultWeight($daoName, $fieldValues = NULL, $weightField = 'weight') { $maxWeight = CRM_Utils_Weight::getMax($daoName, $fieldValues, $weightField); return $maxWeight + 1; } @@ -343,7 +343,7 @@ class CRM_Utils_Weight { * @param $returnURL * @param null $filter */ - static function addOrder(&$rows, $daoName, $idName, $returnURL, $filter = NULL) { + public static function addOrder(&$rows, $daoName, $idName, $returnURL, $filter = NULL) { if (empty($rows)) { return; } @@ -408,7 +408,7 @@ class CRM_Utils_Weight { } } - static function fixOrder() { + public static function fixOrder() { $signature = CRM_Utils_Request::retrieve( '_sgn', 'String', CRM_Core_DAO::$_nullObject); $signer = new CRM_Utils_Signer(CRM_Core_Key::privateKey(), self::$SIGNABLE_FIELDS); @@ -476,7 +476,7 @@ class CRM_Utils_Weight { /** * @param $url */ - static function fixOrderOutput($url) { + public static function fixOrderOutput($url) { if (empty($_GET['snippet']) || $_GET['snippet'] !== 'json') { CRM_Utils_System::redirect($url); } diff --git a/CRM/Utils/Wrapper.php b/CRM/Utils/Wrapper.php index 6c0a0c3dd3..1f6d171891 100644 --- a/CRM/Utils/Wrapper.php +++ b/CRM/Utils/Wrapper.php @@ -63,7 +63,7 @@ class CRM_Utils_Wrapper { * @return void. * @access public */ - function run($formName, $formLabel = NULL, $arguments = NULL) { + public function run($formName, $formLabel = NULL, $arguments = NULL) { if (is_array($arguments)) { $mode = CRM_Utils_Array::value('mode', $arguments); $imageUpload = (bool) CRM_Utils_Array::value('imageUpload', $arguments, FALSE); diff --git a/CRM/Widget/Widget.php b/CRM/Widget/Widget.php index 8fe69dc256..3f07251b2b 100644 --- a/CRM/Widget/Widget.php +++ b/CRM/Widget/Widget.php @@ -13,7 +13,7 @@ class CRM_Widget_Widget { static $_methodTable; - function initialize() { + public function initialize() { if (!self::$_methodTable) { self::$_methodTable = array( 'getContributionPageData' => array( @@ -37,7 +37,7 @@ class CRM_Widget_Widget { } } - function &methodTable() { + public function &methodTable() { self::initialize(); return self::$_methodTable; @@ -52,7 +52,7 @@ class CRM_Widget_Widget { * * @return string */ - function registerRequest($contributionPageID, $widgetID, $action) { + public function registerRequest($contributionPageID, $widgetID, $action) { return "I registered a request to $action on $contributionPageID from $widgetID"; } diff --git a/Civi/CCase/CaseChangeListener.php b/Civi/CCase/CaseChangeListener.php index 53427e1fac..db86be468e 100644 --- a/Civi/CCase/CaseChangeListener.php +++ b/Civi/CCase/CaseChangeListener.php @@ -27,5 +27,5 @@ namespace Civi\CCase; interface CaseChangeListener { - function onCaseChange(\Civi\CCase\Event\CaseChangeEvent $event); + public function onCaseChange(\Civi\CCase\Event\CaseChangeEvent $event); } \ No newline at end of file diff --git a/Civi/CCase/Event/CaseChangeEvent.php b/Civi/CCase/Event/CaseChangeEvent.php index 7a611e1947..57fda7fcb1 100644 --- a/Civi/CCase/Event/CaseChangeEvent.php +++ b/Civi/CCase/Event/CaseChangeEvent.php @@ -37,7 +37,7 @@ class CaseChangeEvent extends \Symfony\Component\EventDispatcher\Event { */ public $analyzer; - function __construct($analyzer) { + public function __construct($analyzer) { $this->analyzer = $analyzer; } } diff --git a/Civi/CiUtil/Arrays.php b/Civi/CiUtil/Arrays.php index 359ad4c113..210c17e0d8 100644 --- a/Civi/CiUtil/Arrays.php +++ b/Civi/CiUtil/Arrays.php @@ -2,7 +2,7 @@ namespace Civi\CiUtil; class Arrays { - static function collect($arr, $col) { + public static function collect($arr, $col) { $r = array(); foreach ($arr as $k => $item) { $r[$k] = $item[$col]; diff --git a/Civi/CiUtil/Command/AntagonistCommand.php b/Civi/CiUtil/Command/AntagonistCommand.php index 9a719595fb..ee685e49a2 100644 --- a/Civi/CiUtil/Command/AntagonistCommand.php +++ b/Civi/CiUtil/Command/AntagonistCommand.php @@ -2,7 +2,7 @@ namespace Civi\CiUtil\Command; class AntagonistCommand { - static function main($argv) { + public static function main($argv) { if (count($argv) != 3) { print "usage: {$argv[0]} \n"; exit(1); @@ -36,7 +36,7 @@ class AntagonistCommand { * - expectedResults: array * - actualResults: array */ - static function findAntagonist($target, $candidateTests) { + public static function findAntagonist($target, $candidateTests) { //$phpUnit = new \Civi\CiUtil\EnvTestRunner('./scripts/phpunit', 'EnvTests'); $phpUnit = new \Civi\CiUtil\EnvTestRunner('phpunit', 'tests/phpunit/EnvTests.php'); $expectedResults = $phpUnit->run(array($target)); diff --git a/Civi/CiUtil/Command/CompareCommand.php b/Civi/CiUtil/Command/CompareCommand.php index 9e966490f1..78b4dd8a2e 100644 --- a/Civi/CiUtil/Command/CompareCommand.php +++ b/Civi/CiUtil/Command/CompareCommand.php @@ -2,7 +2,7 @@ namespace Civi\CiUtil\Command; class CompareCommand { - static function main($argv) { + public static function main($argv) { if (empty($argv[1])) { echo "summary: Compares the output of different test runs\n"; echo "usage: phpunit-compare [--out=txt|csv] [--phpunit-json|--jenkins-xml] ...\n"; diff --git a/Civi/CiUtil/Command/LsCommand.php b/Civi/CiUtil/Command/LsCommand.php index b4af978266..870863fabe 100644 --- a/Civi/CiUtil/Command/LsCommand.php +++ b/Civi/CiUtil/Command/LsCommand.php @@ -2,7 +2,7 @@ namespace Civi\CiUtil\Command; class LsCommand { - static function main($argv) { + public static function main($argv) { $paths = $argv; array_shift($paths); foreach (\Civi\CiUtil\PHPUnitScanner::findTestsByPath($paths) as $test) { diff --git a/Civi/CiUtil/ComparisonPrinter.php b/Civi/CiUtil/ComparisonPrinter.php index 60f5f2cb81..24305cfff9 100644 --- a/Civi/CiUtil/ComparisonPrinter.php +++ b/Civi/CiUtil/ComparisonPrinter.php @@ -5,11 +5,11 @@ class ComparisonPrinter { var $headers; var $hasHeader = FALSE; - function __construct($headers) { + public function __construct($headers) { $this->headers = $headers; } - function printHeader() { + public function printHeader() { if ($this->hasHeader) { return; } @@ -35,7 +35,7 @@ class ComparisonPrinter { $this->hasHeader = TRUE; } - function printRow($test, $values) { + public function printRow($test, $values) { $this->printHeader(); printf("%-90s ", $test); foreach ($values as $value) { diff --git a/Civi/CiUtil/CsvPrinter.php b/Civi/CiUtil/CsvPrinter.php index 9cab44a90f..d360b99e1c 100644 --- a/Civi/CiUtil/CsvPrinter.php +++ b/Civi/CiUtil/CsvPrinter.php @@ -6,12 +6,12 @@ class CsvPrinter { var $headers; var $hasHeader = FALSE; - function __construct($file, $headers) { + public function __construct($file, $headers) { $this->file = fopen($file, "w"); $this->headers = $headers; } - function printHeader() { + public function printHeader() { if ($this->hasHeader) { return; } @@ -23,7 +23,7 @@ class CsvPrinter { $this->hasHeader = TRUE; } - function printRow($test, $values) { + public function printRow($test, $values) { $this->printHeader(); $row = $values; array_unshift($row, $test); diff --git a/Civi/CiUtil/EnvTestRunner.php b/Civi/CiUtil/EnvTestRunner.php index d16bd846f7..1110d328ef 100644 --- a/Civi/CiUtil/EnvTestRunner.php +++ b/Civi/CiUtil/EnvTestRunner.php @@ -8,7 +8,7 @@ class EnvTestRunner { protected $phpunit; protected $envTestSuite; - function __construct($phpunit = "phpunit", $envTestSuite = 'EnvTests') { + public function __construct($phpunit = "phpunit", $envTestSuite = 'EnvTests') { $this->phpunit = $phpunit; $this->envTestSuite = $envTestSuite; } diff --git a/Civi/CiUtil/PHPUnitScanner.php b/Civi/CiUtil/PHPUnitScanner.php index 132f654ff4..3f1b4e4c28 100644 --- a/Civi/CiUtil/PHPUnitScanner.php +++ b/Civi/CiUtil/PHPUnitScanner.php @@ -9,7 +9,7 @@ class PHPUnitScanner { /** * @return array class names */ - static function _findTestClasses($path) { + public static function _findTestClasses($path) { // print_r(array( // 'loading' => $path, // get_included_files() @@ -28,7 +28,7 @@ class PHPUnitScanner { /** * @return array (string $file => string $class) */ - static function findTestClasses($paths) { + public static function findTestClasses($paths) { $testClasses = array(); $finder = new Finder(); @@ -71,7 +71,7 @@ class PHPUnitScanner { * - class: string * - method: string */ - static function findTestsByPath($paths) { + public static function findTestsByPath($paths) { $r = array(); $testClasses = self::findTestClasses($paths); foreach ($testClasses as $testFile => $testClass) { diff --git a/Civi/Core/DAO/Event/PostDelete.php b/Civi/Core/DAO/Event/PostDelete.php index ad40dee939..07df28e08e 100644 --- a/Civi/Core/DAO/Event/PostDelete.php +++ b/Civi/Core/DAO/Event/PostDelete.php @@ -43,7 +43,7 @@ class PostDelete extends \Symfony\Component\EventDispatcher\Event { */ public $result; - function __construct($object, $result) { + public function __construct($object, $result) { $this->object = $object; $this->result = $result; } diff --git a/Civi/Core/DAO/Event/PostUpdate.php b/Civi/Core/DAO/Event/PostUpdate.php index f4de1f475e..a1c1cfecbc 100644 --- a/Civi/Core/DAO/Event/PostUpdate.php +++ b/Civi/Core/DAO/Event/PostUpdate.php @@ -38,7 +38,7 @@ class PostUpdate extends \Symfony\Component\EventDispatcher\Event { */ public $object; - function __construct($object) { + public function __construct($object) { $this->object = $object; } } diff --git a/Civi/Core/Event/PostEvent.php b/Civi/Core/Event/PostEvent.php index ebedd8d7e3..cfa6484366 100644 --- a/Civi/Core/Event/PostEvent.php +++ b/Civi/Core/Event/PostEvent.php @@ -53,7 +53,7 @@ class PostEvent extends \Symfony\Component\EventDispatcher\Event { */ public $object; - function __construct($action, $entity, $id, $object) { + public function __construct($action, $entity, $id, $object) { $this->action = $action; $this->entity = $entity; $this->id = $id; diff --git a/Civi/Core/Event/PreEvent.php b/Civi/Core/Event/PreEvent.php index 0566b9efec..936cdf6af2 100644 --- a/Civi/Core/Event/PreEvent.php +++ b/Civi/Core/Event/PreEvent.php @@ -53,7 +53,7 @@ class PreEvent extends \Symfony\Component\EventDispatcher\Event { */ public $params; - function __construct($action, $entity, $id, $params) { + public function __construct($action, $entity, $id, $params) { $this->action = $action; $this->entity = $entity; $this->id = $id; diff --git a/Civi/Core/Transaction/Manager.php b/Civi/Core/Transaction/Manager.php index b493021c5f..3e24de811d 100644 --- a/Civi/Core/Transaction/Manager.php +++ b/Civi/Core/Transaction/Manager.php @@ -66,7 +66,7 @@ class Manager { * @param CRM_Core_DAO $dao handle for the DB connection that will execute transaction statements * (all we really care about is the query() function) */ - function __construct($dao) { + public function __construct($dao) { $this->dao = $dao; } diff --git a/Civi/Install/Requirements.php b/Civi/Install/Requirements.php index 2fcddf14bb..40053f20f7 100644 --- a/Civi/Install/Requirements.php +++ b/Civi/Install/Requirements.php @@ -153,7 +153,7 @@ class Requirements { /** * @return array */ - function checkServerVariables() { + public function checkServerVariables() { $results = array( 'title' => 'CiviCRM PHP server variables', 'severity' => $this::REQUIREMENT_OK, @@ -467,7 +467,7 @@ class Requirements { * * @return array */ - function checkMysqlLockTables($db_config) { + public function checkMysqlLockTables($db_config) { $results = array( 'title' => 'CiviCRM MySQL Lock Tables', 'severity' => $this::REQUIREMENT_OK, diff --git a/tests/phpunit/CRM/Activity/BAO/ActivityAssignmentTest.php b/tests/phpunit/CRM/Activity/BAO/ActivityAssignmentTest.php index 7dd7a07852..5e85c9276f 100644 --- a/tests/phpunit/CRM/Activity/BAO/ActivityAssignmentTest.php +++ b/tests/phpunit/CRM/Activity/BAO/ActivityAssignmentTest.php @@ -56,7 +56,7 @@ class CRM_Activity_BAO_ActivityAssignmentTest extends CiviUnitTestCase { /** * Pass zero as an id and make sure no Assignees are retrieved */ - function testRetrieveAssigneeIdsByActivityIdNoId() { + public function testRetrieveAssigneeIdsByActivityIdNoId() { $activity = $this->activityCreate(); $activityId = CRM_Activity_BAO_ActivityAssignment::retrieveAssigneeIdsByActivityId(0); @@ -66,7 +66,7 @@ class CRM_Activity_BAO_ActivityAssignmentTest extends CiviUnitTestCase { /** * Pass null as an id and make sure no Assignees are retrieved */ - function testRetrieveAssigneeIdsByActivityIdNullId() { + public function testRetrieveAssigneeIdsByActivityIdNullId() { $activity = $this->activityCreate(); $activityId = CRM_Activity_BAO_ActivityAssignment::retrieveAssigneeIdsByActivityId(Null); @@ -76,7 +76,7 @@ class CRM_Activity_BAO_ActivityAssignmentTest extends CiviUnitTestCase { /** * Pass a string as an id and make sure no Assignees are retrieved */ - function testRetrieveAssigneeIdsByActivityIdString() { + public function testRetrieveAssigneeIdsByActivityIdString() { $activity = $this->activityCreate(); $activityId = CRM_Activity_BAO_ActivityAssignment::retrieveAssigneeIdsByActivityId('test'); @@ -86,7 +86,7 @@ class CRM_Activity_BAO_ActivityAssignmentTest extends CiviUnitTestCase { /** * Pass a known activity id as an id and make sure 1 Assignees is retrieved */ - function testRetrieveAssigneeIdsByActivityIdOneId() { + public function testRetrieveAssigneeIdsByActivityIdOneId() { $activity = $this->activityCreate(); $activityId = CRM_Activity_BAO_ActivityAssignment::retrieveAssigneeIdsByActivityId($activity['id']); @@ -96,7 +96,7 @@ class CRM_Activity_BAO_ActivityAssignmentTest extends CiviUnitTestCase { /** * Pass zero as an id and make sure no Assignees are retrieved */ - function testGetAssigneeNamesNoId() { + public function testGetAssigneeNamesNoId() { $activity = $this->activityCreate(); $assignees = CRM_Activity_BAO_ActivityAssignment::getAssigneeNames(0); @@ -106,7 +106,7 @@ class CRM_Activity_BAO_ActivityAssignmentTest extends CiviUnitTestCase { /** * Pass Null as an id and make sure no Assignees are retrieved */ - function testGetAssigneeNamesNullId() { + public function testGetAssigneeNamesNullId() { $activity = $this->activityCreate(); $assignees = CRM_Activity_BAO_ActivityAssignment::getAssigneeNames(Null); @@ -116,7 +116,7 @@ class CRM_Activity_BAO_ActivityAssignmentTest extends CiviUnitTestCase { /** * Pass a known activity id as an id and make sure 1 Assignees is retrieved */ - function testGetAssigneeNamesOneId() { + public function testGetAssigneeNamesOneId() { $activity = $this->activityCreate(); $assignees = CRM_Activity_BAO_ActivityAssignment::getAssigneeNames(array($activity['id'])); $this->assertEquals(count($assignees), 1, '1 assignee names retrieved'); diff --git a/tests/phpunit/CRM/Activity/BAO/ActivityTest.php b/tests/phpunit/CRM/Activity/BAO/ActivityTest.php index d970df8d2e..906b964b6f 100644 --- a/tests/phpunit/CRM/Activity/BAO/ActivityTest.php +++ b/tests/phpunit/CRM/Activity/BAO/ActivityTest.php @@ -6,11 +6,11 @@ require_once 'CiviTest/Contact.php'; * Class CRM_Activity_BAO_ActivityTest */ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } - function tearDown() { + public function tearDown() { // truncate a few tables $tablesToTruncate = array('civicrm_contact', 'civicrm_activity', 'civicrm_activity_contact'); $this->quickCleanup($tablesToTruncate); @@ -20,7 +20,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { * Testcases for create() method * create() method Add/Edit activity. */ - function testCreate() { + public function testCreate() { $contactId = Contact::createIndividual(); $params = array( @@ -60,7 +60,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { * Testcase for getContactActivity() method. * getContactActivity() method get activities detail for given target contact id */ - function testGetContactActivity() { + public function testGetContactActivity() { $contactId = Contact::createIndividual(); $params = array( 'first_name' => 'liz', @@ -96,7 +96,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { * retrieve($params, $defaults) method return activity detail for given params * and set defaults. */ - function testRetrieve() { + public function testRetrieve() { $contactId = Contact::createIndividual(); $params = array( 'first_name' => 'liz', @@ -143,7 +143,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { * Testcase for deleteActivity() method. * deleteActivity($params) method deletes activity for given params. */ - function testDeleteActivity() { + public function testDeleteActivity() { $contactId = Contact::createIndividual(); $params = array( 'first_name' => 'liz', @@ -190,7 +190,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { * Testcase for deleteActivityTarget() method. * deleteActivityTarget($activityId) method deletes activity target for given activity id. */ - function testDeleteActivityTarget() { + public function testDeleteActivityTarget() { $contactId = Contact::createIndividual(); $params = array( 'first_name' => 'liz', @@ -231,7 +231,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { * Testcase for deleteActivityAssignment() method. * deleteActivityAssignment($activityId) method deletes activity assignment for given activity id. */ - function testDeleteActivityAssignment() { + public function testDeleteActivityAssignment() { $contactId = Contact::createIndividual(); $params = array( 'first_name' => 'liz', @@ -271,7 +271,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { /** * Test getActivitiesCount BAO method */ - function testGetActivitiesCountforAdminDashboard() { + public function testGetActivitiesCountforAdminDashboard() { $op = new PHPUnit_Extensions_Database_Operation_Insert(); $op->execute($this->_dbconn, $this->createFlatXMLDataSet( @@ -300,7 +300,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { /** * Test getActivitiesCount BAO method */ - function testGetActivitiesCountforNonAdminDashboard() { + public function testGetActivitiesCountforNonAdminDashboard() { $op = new PHPUnit_Extensions_Database_Operation_Insert(); $op->execute($this->_dbconn, $this->createFlatXMLDataSet( @@ -330,7 +330,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { /** * Test getActivitiesCount BAO method */ - function testGetActivitiesCountforContactSummary() { + public function testGetActivitiesCountforContactSummary() { $op = new PHPUnit_Extensions_Database_Operation_Insert(); $op->execute($this->_dbconn, $this->createFlatXMLDataSet( @@ -359,7 +359,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { /** * Test getActivitiesCount BAO method */ - function testGetActivitiesCountforContactSummaryWithNoActivities() { + public function testGetActivitiesCountforContactSummaryWithNoActivities() { $op = new PHPUnit_Extensions_Database_Operation_Insert(); $op->execute($this->_dbconn, $this->createFlatXMLDataSet( @@ -387,7 +387,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { /** * Test getActivities BAO method */ - function testGetActivitiesforAdminDashboard() { + public function testGetActivitiesforAdminDashboard() { $op = new PHPUnit_Extensions_Database_Operation_Insert(); $op->execute($this->_dbconn, $this->createFlatXMLDataSet( @@ -422,7 +422,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { /** * Test getActivities BAO method */ - function testGetActivitiesforNonAdminDashboard() { + public function testGetActivitiesforNonAdminDashboard() { $op = new PHPUnit_Extensions_Database_Operation_Insert(); $op->execute($this->_dbconn, $this->createFlatXMLDataSet( @@ -465,7 +465,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { /** * Test getActivities BAO method */ - function testGetActivitiesforContactSummary() { + public function testGetActivitiesforContactSummary() { $op = new PHPUnit_Extensions_Database_Operation_Insert(); $op->execute($this->_dbconn, $this->createFlatXMLDataSet( @@ -520,7 +520,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { /** * Test getActivities BAO method */ - function testGetActivitiesforContactSummaryWithNoActivities() { + public function testGetActivitiesforContactSummaryWithNoActivities() { $op = new PHPUnit_Extensions_Database_Operation_Insert(); $op->execute($this->_dbconn, $this->createFlatXMLDataSet( diff --git a/tests/phpunit/CRM/Batch/Form/EntryTest.php b/tests/phpunit/CRM/Batch/Form/EntryTest.php index 71aeb00440..fdd1cf045b 100644 --- a/tests/phpunit/CRM/Batch/Form/EntryTest.php +++ b/tests/phpunit/CRM/Batch/Form/EntryTest.php @@ -69,7 +69,7 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase { */ protected $_contactID4 = NULL; - function setUp() { + public function setUp() { parent::setUp(); $params = array( @@ -127,7 +127,7 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase { * This method is called after a test is executed. * */ - function tearDown() + public function tearDown() { $this->quickCleanUpFinancialEntities(); $this->relationshipTypeDelete($this->_relationshipTypeId); @@ -143,7 +143,7 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase { /** * Test Import */ - function testProcessMembership() { + public function testProcessMembership() { $form = new CRM_Batch_Form_Entry(); $params = $this->getMembershipData(); $this->assertTrue($form->testProcessMembership($params)); @@ -176,7 +176,7 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase { /** * Test Contribution Import */ - function testProcessContribution() { + public function testProcessContribution() { $this->offsetDefaultPriceSet(); $form = new CRM_Batch_Form_Entry(); $params = $this->getContributionData(); @@ -195,7 +195,7 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase { * Data provider for test process membership * @return array */ - function getMembershipData() { + public function getMembershipData() { return array( 'batch_id' => 4, @@ -259,7 +259,7 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase { /** * @return array */ - function getContributionData() { + public function getContributionData() { return array( //'batch_id' => 4, 'primary_profiles' => array(1 => NULL, 2 => NULL, 3 => NULL), diff --git a/tests/phpunit/CRM/Bridge/OG/DrupalTest.php b/tests/phpunit/CRM/Bridge/OG/DrupalTest.php index 0408f56364..0f2706edb0 100644 --- a/tests/phpunit/CRM/Bridge/OG/DrupalTest.php +++ b/tests/phpunit/CRM/Bridge/OG/DrupalTest.php @@ -43,7 +43,7 @@ class CRM_Bridge_OG_DrupalTest extends CiviUnitTestCase { /* * Test that one (ane only one) role (option value) is deleted by the updateCiviACLRole function */ - function testACLRoleDeleteFunctionality() { + public function testACLRoleDeleteFunctionality() { $optionGroup = civicrm_api('OptionGroup', 'Get', array( 'version' => 3, 'name' => 'acl_role', diff --git a/tests/phpunit/CRM/Case/BAO/CaseTest.php b/tests/phpunit/CRM/Case/BAO/CaseTest.php index c52718eaef..addd089404 100644 --- a/tests/phpunit/CRM/Case/BAO/CaseTest.php +++ b/tests/phpunit/CRM/Case/BAO/CaseTest.php @@ -6,7 +6,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Case_BAO_CaseTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); $this->tablesToTruncate = array( @@ -36,7 +36,7 @@ class CRM_Case_BAO_CaseTest extends CiviUnitTestCase { $this->quickCleanup($this->tablesToTruncate, TRUE); } - function testAddCaseToContact() { + public function testAddCaseToContact() { $params = array( 'case_id' => 1, 'contact_id' => 17, @@ -47,12 +47,12 @@ class CRM_Case_BAO_CaseTest extends CiviUnitTestCase { $this->assertEquals('Test Contact - Housing Support', $recent[0]['title']); } - function testGetCaseType() { + public function testGetCaseType() { $caseTypeLabel = CRM_Case_BAO_Case::getCaseType(1); $this->assertEquals('Housing Support', $caseTypeLabel); } - function testRetrieveCaseIdsByContactId() { + public function testRetrieveCaseIdsByContactId() { $caseIds = CRM_Case_BAO_Case::retrieveCaseIdsByContactId(3, FALSE, 'housing_support'); $this->assertEquals(array(1), $caseIds); } @@ -65,12 +65,12 @@ class CRM_Case_BAO_CaseTest extends CiviUnitTestCase { * } */ - function testGetCasesSummary() { + public function testGetCasesSummary() { $cases = CRM_Case_BAO_Case::getCasesSummary(TRUE, 3); $this->assertEquals(1, $cases['rows']['Housing Support']['Ongoing']['count']); } - function testGetUnclosedCases() { + public function testGetUnclosedCases() { $params = array( 'case_type' => 'ousing Suppor', ); @@ -78,7 +78,7 @@ class CRM_Case_BAO_CaseTest extends CiviUnitTestCase { $this->assertEquals('Housing Support', $cases[1]['case_type']); } - function testGetContactCases() { + public function testGetContactCases() { $cases = CRM_Case_BAO_Case::getContactCases(3); $this->assertEquals('Housing Support', $cases[1]['case_type']); } diff --git a/tests/phpunit/CRM/Case/BAO/CaseTypeForkTest.php b/tests/phpunit/CRM/Case/BAO/CaseTypeForkTest.php index 170a4285dd..a14ad77059 100644 --- a/tests/phpunit/CRM/Case/BAO/CaseTypeForkTest.php +++ b/tests/phpunit/CRM/Case/BAO/CaseTypeForkTest.php @@ -12,7 +12,7 @@ class CRM_Case_BAO_CaseTypeForkTest extends CiviCaseTestCase { CRM_Core_ManagedEntities::singleton(TRUE)->reconcile(); } - function tearDown() { + public function tearDown() { parent::tearDown(); CRM_Core_ManagedEntities::singleton(TRUE)->reconcile(); } @@ -21,7 +21,7 @@ class CRM_Case_BAO_CaseTypeForkTest extends CiviCaseTestCase { /** * Edit the definition of ForkableCaseType */ - function testForkable() { + public function testForkable() { $caseTypeId = CRM_Core_DAO::getFieldValue('CRM_Case_DAO_CaseType', 'ForkableCaseType', 'id', 'name'); $this->assertTrue(is_numeric($caseTypeId) && $caseTypeId > 0); @@ -56,7 +56,7 @@ class CRM_Case_BAO_CaseTypeForkTest extends CiviCaseTestCase { /** * Attempt to edit the definition of UnforkableCaseType. This fails. */ - function testUnforkable() { + public function testUnforkable() { $caseTypeId = CRM_Core_DAO::getFieldValue('CRM_Case_DAO_CaseType', 'UnforkableCaseType', 'id', 'name'); $this->assertTrue(is_numeric($caseTypeId) && $caseTypeId > 0); $this->assertDBNull('CRM_Case_BAO_CaseType', $caseTypeId, 'definition', 'id', "Should not have DB-based definition"); @@ -83,7 +83,7 @@ class CRM_Case_BAO_CaseTypeForkTest extends CiviCaseTestCase { * @param $caseTypes * @see \CRM_Utils_Hook::caseTypes */ - function hook_caseTypes(&$caseTypes) { + public function hook_caseTypes(&$caseTypes) { $caseTypes['ForkableCaseType'] = array( 'module' => 'civicrm', 'name' => 'ForkableCaseType', diff --git a/tests/phpunit/CRM/Case/BAO/CaseTypeTest.php b/tests/phpunit/CRM/Case/BAO/CaseTypeTest.php index 22bdbb4f41..49f65cc25b 100644 --- a/tests/phpunit/CRM/Case/BAO/CaseTypeTest.php +++ b/tests/phpunit/CRM/Case/BAO/CaseTypeTest.php @@ -12,7 +12,7 @@ class CRM_Case_BAO_CaseTypeTest extends CiviUnitTestCase { * * @return array */ - function definitionProvider() { + public function definitionProvider() { $fixtures['empty-defn'] = array( 'json' => json_encode(array()), 'xml' => ' @@ -226,7 +226,7 @@ class CRM_Case_BAO_CaseTypeTest extends CiviUnitTestCase { * @param string $inputXml * @dataProvider definitionProvider */ - function testConvertXmlToDefinition($fixtureName, $expectedJson, $inputXml) { + public function testConvertXmlToDefinition($fixtureName, $expectedJson, $inputXml) { $xml = simplexml_load_string($inputXml); $expectedDefinition = json_decode($expectedJson, TRUE); $actualDefinition = CRM_Case_BAO_CaseType::convertXmlToDefinition($xml); @@ -239,7 +239,7 @@ class CRM_Case_BAO_CaseTypeTest extends CiviUnitTestCase { * @param string $expectedXml * @dataProvider definitionProvider */ - function testConvertDefinitionToXml($fixtureName, $inputJson, $expectedXml) { + public function testConvertDefinitionToXml($fixtureName, $inputJson, $expectedXml) { $inputDefinition = json_decode($inputJson, TRUE); $actualXml = CRM_Case_BAO_CaseType::convertDefinitionToXML('Housing Support', $inputDefinition); $this->assertEquals($this->normalizeXml($expectedXml), $this->normalizeXml($actualXml)); @@ -251,7 +251,7 @@ class CRM_Case_BAO_CaseTypeTest extends CiviUnitTestCase { * @param string $inputXml * @dataProvider definitionProvider */ - function testRoundtrip_XmlToJsonToXml($fixtureName, $ignore, $inputXml) { + public function testRoundtrip_XmlToJsonToXml($fixtureName, $ignore, $inputXml) { $tempDefinition = CRM_Case_BAO_CaseType::convertXmlToDefinition(simplexml_load_string($inputXml)); $actualXml = CRM_Case_BAO_CaseType::convertDefinitionToXML('Housing Support', $tempDefinition); $this->assertEquals($this->normalizeXml($inputXml), $this->normalizeXml($actualXml)); @@ -263,7 +263,7 @@ class CRM_Case_BAO_CaseTypeTest extends CiviUnitTestCase { * @param string $ignore * @dataProvider definitionProvider */ - function testRoundtrip_JsonToXmlToJson($fixtureName, $inputJson, $ignore) { + public function testRoundtrip_JsonToXmlToJson($fixtureName, $inputJson, $ignore) { $tempXml = CRM_Case_BAO_CaseType::convertDefinitionToXML('Housing Support', json_decode($inputJson, TRUE)); $actualDefinition = CRM_Case_BAO_CaseType::convertXmlToDefinition(simplexml_load_string($tempXml)); $expectedDefinition = json_decode($inputJson, TRUE); @@ -276,7 +276,7 @@ class CRM_Case_BAO_CaseTypeTest extends CiviUnitTestCase { * @param string $xml * @return string */ - function normalizeXml($xml) { + public function normalizeXml($xml) { return trim( preg_replace(":\n*<:", "\n<", // tags on new lines preg_replace("/\n[\n ]+/", "\n", // no leading whitespace diff --git a/tests/phpunit/CRM/Case/PseudoConstantTest.php b/tests/phpunit/CRM/Case/PseudoConstantTest.php index 2a1acdc502..0bacad1d09 100644 --- a/tests/phpunit/CRM/Case/PseudoConstantTest.php +++ b/tests/phpunit/CRM/Case/PseudoConstantTest.php @@ -6,7 +6,7 @@ require_once 'CiviTest/CiviCaseTestCase.php'; */ class CRM_Case_PseudoConstantTest extends CiviCaseTestCase { - function testCaseType() { + public function testCaseType() { CRM_Core_PseudoConstant::flush(); $caseTypes = CRM_Case_PseudoConstant::caseType(); $expectedTypes = array( diff --git a/tests/phpunit/CRM/Case/XMLRepositoryTest.php b/tests/phpunit/CRM/Case/XMLRepositoryTest.php index cde2164f4b..62d0c300d3 100644 --- a/tests/phpunit/CRM/Case/XMLRepositoryTest.php +++ b/tests/phpunit/CRM/Case/XMLRepositoryTest.php @@ -97,7 +97,7 @@ class CRM_Case_XMLRepositoryTest extends CiviUnitTestCase { } - function testGetAllDeclaredActivityTypes() { + public function testGetAllDeclaredActivityTypes() { $repo = new CRM_Case_XMLRepository( array('CaseTypeWithTwoActivityTypes', 'CaseTypeWithThreeActivityTypes'), array( @@ -114,7 +114,7 @@ class CRM_Case_XMLRepositoryTest extends CiviUnitTestCase { $this->assertEquals($expected, $actual); } - function testGetAllDeclaredRelationshipTypes() { + public function testGetAllDeclaredRelationshipTypes() { $repo = new CRM_Case_XMLRepository( array('CaseTypeWithTwoRoles', 'CaseTypeWithThreeRoles', 'CaseTypeWithSingleActivityType'), array( @@ -130,7 +130,7 @@ class CRM_Case_XMLRepositoryTest extends CiviUnitTestCase { $this->assertEquals($expected, $actual); } - function testGetActivityReferenceCount_1() { + public function testGetActivityReferenceCount_1() { $repo = new CRM_Case_XMLRepository( array('CaseTypeWithSingleActivityType'), array( @@ -146,7 +146,7 @@ class CRM_Case_XMLRepositoryTest extends CiviUnitTestCase { $this->assertEquals(0, $repo->getActivityReferenceCount('Third Activity Type')); } - function testGetActivityReferenceCount_23() { + public function testGetActivityReferenceCount_23() { $repo = new CRM_Case_XMLRepository( array('CaseTypeWithTwoActivityTypes', 'CaseTypeWithThreeActivityTypes'), array( @@ -163,7 +163,7 @@ class CRM_Case_XMLRepositoryTest extends CiviUnitTestCase { $this->assertEquals(1, $repo->getActivityReferenceCount('Third Activity Type')); } - function testGetRoleReferenceCount_1() { + public function testGetRoleReferenceCount_1() { $repo = new CRM_Case_XMLRepository( array('CaseTypeWithSingleRole', 'CaseTypeWithSingleActivityType'), array( @@ -179,7 +179,7 @@ class CRM_Case_XMLRepositoryTest extends CiviUnitTestCase { $this->assertEquals(0, $repo->getRelationshipReferenceCount('Third Role')); } - function testGetRoleReferenceCount_23() { + public function testGetRoleReferenceCount_23() { $repo = new CRM_Case_XMLRepository( array('CaseTypeWithTwoRoles', 'CaseTypeWithThreeRoles', 'CaseTypeWithSingleActivityType'), array( diff --git a/tests/phpunit/CRM/Contact/BAO/ContactTest.php b/tests/phpunit/CRM/Contact/BAO/ContactTest.php index 2a4b78df3e..ec9418151f 100644 --- a/tests/phpunit/CRM/Contact/BAO/ContactTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ContactTest.php @@ -7,7 +7,7 @@ require_once 'CiviTest/Custom.php'; * Class CRM_Contact_BAO_ContactTest */ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } @@ -15,7 +15,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { * Test case for add( ) * test with empty params. */ - function testAddWithEmptyParams() { + public function testAddWithEmptyParams() { $params = array( ); $contact = CRM_Contact_BAO_Contact::add($params); @@ -28,7 +28,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { * test with names * (create and update modes) */ - function testAddWithNames() { + public function testAddWithNames() { $firstName = 'Shane'; $lastName = 'Whatson'; $params = array( @@ -69,7 +69,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { * test with all contact params * (creat and update modes) */ - function testAddWithAll() { + public function testAddWithAll() { //take the common contact params $params = $this->contactParams(); @@ -219,7 +219,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { * Test case for add( ) * test with All contact types. */ - function testAddWithAllContactTypes() { + public function testAddWithAllContactTypes() { $firstName = 'Bill'; $lastName = 'Adams'; $params = array( @@ -292,7 +292,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { * Test case for create( ) * test with missing params. */ - function testCreateWithEmptyParams() { + public function testCreateWithEmptyParams() { $params = array( 'first_name' => 'Bill', 'last_name' => 'Adams', @@ -308,7 +308,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { * test with all params. * ( create and update modes ). */ - function testCreateWithAll() { + public function testCreateWithAll() { //take the common contact params $params = $this->contactParams(); $params['note'] = 'test note'; @@ -501,7 +501,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { * Test case for resolveDefaults( ) * test all pseudoConstant, stateProvince, country. */ - function testResolveDefaults() { + public function testResolveDefaults() { $params = array( 'prefix_id' => 3, 'suffix_id' => 2, @@ -538,7 +538,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { * Test case for retrieve( ) * test with all values. */ - function testRetrieve() { + public function testRetrieve() { //take the common contact params $params = $this->contactParams(); $params['note'] = 'test note'; @@ -637,7 +637,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { /** * Test case for deleteContact( ) */ - function testDeleteContact() { + public function testDeleteContact() { $contactParams = $this->contactParams(); //create custom data @@ -724,7 +724,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { * test with all params. * ( create and update modes ) */ - function testCreateProfileContact() { + public function testCreateProfileContact() { $fields = CRM_Contact_BAO_Contact::exportableFields('Individual'); //current employer field for individual @@ -1111,7 +1111,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { /** * Test case for getContactDetails( ) */ - function testGetContactDetails() { + public function testGetContactDetails() { //get the contact params $params = $this->contactParams(); @@ -1138,7 +1138,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { * Test case for * importableFields( ) and exportableFields( ) */ - function testFields() { + public function testFields() { $allImpFileds = CRM_Contact_BAO_Contact::importableFields('All'); $allExpFileds = CRM_Contact_BAO_Contact::importableFields('All'); //Now check all fields @@ -1164,7 +1164,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { * Test case for getPrimaryEmail( ) * */ - function testGetPrimaryEmail() { + public function testGetPrimaryEmail() { //get the contact params $params = $this->contactParams(); $params['email'][2] = $params['email'][1]; @@ -1188,7 +1188,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { * Test case for getPrimaryOpenId( ) * */ - function testGetPrimaryOpenId() { + public function testGetPrimaryOpenId() { //get the contact params $params = $this->contactParams(); $params['openid'][2] = $params['openid'][1]; @@ -1213,7 +1213,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { * Test case for matchContactOnEmail( ) * */ - function testMatchContactOnEmail() { + public function testMatchContactOnEmail() { //get the contact params $params = $this->contactParams(); //create contact @@ -1235,7 +1235,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { * Test case for getContactType( ) * */ - function testGetContactType() { + public function testGetContactType() { //get the contact params $params = $this->contactParams(); //create contact @@ -1255,7 +1255,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { * Test case for displayName( ) * */ - function testDisplayName() { + public function testDisplayName() { //get the contact params $params = $this->contactParams(); @@ -1283,7 +1283,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { * Test case for getDisplayAndImage( ) * */ - function testGetDisplayAndImage() { + public function testGetDisplayAndImage() { //get the contact params $params = $this->contactParams(); @@ -1429,7 +1429,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { /** * Ensure that created_date and modified_date are set */ - function testTimestamps_contact() { + public function testTimestamps_contact() { $test = $this; $this->_testTimestamps(array( 'UPDATE' => function ($contactId) use ($test) { @@ -1447,7 +1447,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { /** * Ensure that civicrm_contact.modified_date is updated when manipulating a phone record */ - function testTimestamps_email() { + public function testTimestamps_email() { $test = $this; $this->_testTimestamps(array( 'INSERT' => function ($contactId) use ($test) { @@ -1483,7 +1483,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { /** * Ensure that civicrm_contact.modified_date is updated when manipulating an email */ - function testTimestamps_phone() { + public function testTimestamps_phone() { $test = $this; $this->_testTimestamps(array( 'INSERT' => function ($contactId) use ($test) { @@ -1520,7 +1520,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { * Ensure that civicrm_contact.modified_date is updated when contact-related * custom data */ - function testTimestamps_custom() { + public function testTimestamps_custom() { $customGroup = Custom::createGroup(array(), 'Individual'); $this->assertNotNull($customGroup); $fields = array( @@ -1563,7 +1563,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { * * @param $callbacks array ($name => $callable) */ - function _testTimestamps($callbacks) { + public function _testTimestamps($callbacks) { CRM_Core_DAO::triggerRebuild(); $contactId = Contact::createIndividual(); diff --git a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactSearchTest.php b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactSearchTest.php index 59c7bb5ec8..d0899b108a 100644 --- a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactSearchTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactSearchTest.php @@ -7,7 +7,7 @@ require_once 'CiviTest/Contact.php'; */ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); $students = 'indivi_student'.substr(sha1(rand()), 0, 7); $params = array( @@ -90,7 +90,7 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { * Search with only type * success expected. */ - function testSearchWithType() { + public function testSearchWithType() { // for type:Individual $params = array('contact_type' => 'Individual', 'version' => 3); @@ -154,7 +154,7 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { * Search with only subtype * success expected. */ - function testSearchWithSubype() { + public function testSearchWithSubype() { // for subtype:Student $params = array('contact_sub_type' => $this->student, 'version' => 3); @@ -201,7 +201,7 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { * Search with type as well as subtype * success expected. */ - function testSearchWithTypeSubype() { + public function testSearchWithTypeSubype() { // for type:individual subtype:Student $params = array('contact_sub_type' => $this->student, 'version' => 3); @@ -247,7 +247,7 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { /** * Search with invalid type or subtype */ - function testSearchWithInvalidData() { + public function testSearchWithInvalidData() { // for invalid type $params = array('contact_type' => 'Invalid' . CRM_Core_DAO::VALUE_SEPARATOR . 'Invalid', 'version' => 3); $result = civicrm_api('contact', 'get', $params); @@ -281,7 +281,7 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { /** * Search with wrong type or subtype */ - function testSearchWithWrongdData() { + public function testSearchWithWrongdData() { // for type:Individual subtype:Sponsor $defaults = array(); diff --git a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTest.php b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTest.php index 173d998843..fb9e2a6773 100644 --- a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTest.php @@ -6,7 +6,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Contact_BAO_ContactType_ContactTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); $params = array( @@ -51,7 +51,7 @@ class CRM_Contact_BAO_ContactType_ContactTest extends CiviUnitTestCase { $this->team = $params['name']; } - function tearDown() { + public function tearDown() { $this->quickCleanup(array('civicrm_contact')); $query = " DELETE FROM civicrm_contact_type @@ -64,7 +64,7 @@ DELETE FROM civicrm_contact_type * success expected * */ - function testCreateContact() { + public function testCreateContact() { //check for Type:Individual $params = array( 'first_name' => 'Anne', @@ -141,7 +141,7 @@ DELETE FROM civicrm_contact_type * Update the contact with no subtype to a valid subtype * success expected */ - function testUpdateContactNosubtypeToValid() { + public function testUpdateContactNosubtypeToValid() { $params = array( 'first_name' => 'Anne', 'last_name' => 'Grant', @@ -193,7 +193,7 @@ DELETE FROM civicrm_contact_type * Update the contact with subtype to another valid subtype * success expected */ - function testUpdateContactSubtype() { + public function testUpdateContactSubtype() { $params = array( 'first_name' => 'Anne', 'last_name' => 'Grant', diff --git a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTypeTest.php b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTypeTest.php index 6b2a86fa46..3a98de0745 100644 --- a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTypeTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTypeTest.php @@ -6,7 +6,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Contact_BAO_ContactType_ContactTypeTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); $labelsub1 = 'sub1_individual'.substr(sha1(rand()), 0, 7); $params = array( @@ -57,7 +57,7 @@ class CRM_Contact_BAO_ContactType_ContactTypeTest extends CiviUnitTestCase { * Test contactTypes() and subTypes() methods with valid data * success expected */ - function testGetMethods() { + public function testGetMethods() { // check all contact types $contactTypes = array('Individual', 'Organization', 'Household'); @@ -115,7 +115,7 @@ class CRM_Contact_BAO_ContactType_ContactTypeTest extends CiviUnitTestCase { /** * Test subTypes() methods with invalid data */ - function testGetMethodsInvalid() { + public function testGetMethodsInvalid() { $params = 'invalid'; $result = CRM_Contact_BAO_ContactType::subTypes($params); @@ -130,7 +130,7 @@ class CRM_Contact_BAO_ContactType_ContactTypeTest extends CiviUnitTestCase { * Test add() methods with valid data * success expected */ - function testAdd() { + public function testAdd() { $params = array( 'label' => 'indiviSubType', @@ -162,7 +162,7 @@ class CRM_Contact_BAO_ContactType_ContactTypeTest extends CiviUnitTestCase { /** * Test add() with invalid data */ - function testAddInvalid1() { + public function testAddInvalid1() { // parent id does not exist in db $params = array( @@ -176,7 +176,7 @@ class CRM_Contact_BAO_ContactType_ContactTypeTest extends CiviUnitTestCase { $this->assertEquals($result, NULL, 'In line ' . __LINE__); } - function testAddInvalid2() { + public function testAddInvalid2() { // params does not have name and label keys $params = array( @@ -187,7 +187,7 @@ class CRM_Contact_BAO_ContactType_ContactTypeTest extends CiviUnitTestCase { $this->assertEquals($result, NULL, 'In line ' . __LINE__); } - function testAddInvalid3() { + public function testAddInvalid3() { // params does not have parent_id $params = array( @@ -203,7 +203,7 @@ class CRM_Contact_BAO_ContactType_ContactTypeTest extends CiviUnitTestCase { * Test del() with valid data * success expected */ - function testDel() { + public function testDel() { $params = array( 'label' => 'indiviSubType', @@ -222,7 +222,7 @@ class CRM_Contact_BAO_ContactType_ContactTypeTest extends CiviUnitTestCase { /** * Test del() with invalid data */ - function testDelInvalid() { + public function testDelInvalid() { $del = CRM_Contact_BAO_ContactType::del(NULL); $this->assertEquals($del, FALSE, 'In line ' . __LINE__); diff --git a/tests/phpunit/CRM/Contact/BAO/ContactType/RelationshipTest.php b/tests/phpunit/CRM/Contact/BAO/ContactType/RelationshipTest.php index 94e89b5649..7733aecaec 100644 --- a/tests/phpunit/CRM/Contact/BAO/ContactType/RelationshipTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ContactType/RelationshipTest.php @@ -7,7 +7,7 @@ require_once 'CiviTest/Contact.php'; */ class CRM_Contact_BAO_ContactType_RelationshipTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); //create contact subtypes @@ -79,7 +79,7 @@ class CRM_Contact_BAO_ContactType_RelationshipTest extends CiviUnitTestCase { $this->organization_sponsor = Contact::create($params); } - function tearDown() { + public function tearDown() { $this->quickCleanup(array('civicrm_contact')); $query = " @@ -94,7 +94,7 @@ DELETE FROM civicrm_contact_type * success expected * */ - function testRelationshipTypeAddIndiviParent() { + public function testRelationshipTypeAddIndiviParent() { //check Individual to Parent RelationshipType $params = array( 'name_a_b' => 'indivToparent', @@ -112,7 +112,7 @@ DELETE FROM civicrm_contact_type $this->relationshipTypeDelete($result->id); } - function testRelationshipTypeAddSponcorIndivi() { + public function testRelationshipTypeAddSponcorIndivi() { //check Sponcor to Individual RelationshipType $params = array( 'name_a_b' => 'SponsorToIndiv', @@ -130,7 +130,7 @@ DELETE FROM civicrm_contact_type $this->relationshipTypeDelete($result->id); } - function testRelationshipTypeAddStudentSponcor() { + public function testRelationshipTypeAddStudentSponcor() { //check Student to Sponcer RelationshipType $params = array( 'name_a_b' => 'StudentToSponser', @@ -154,7 +154,7 @@ DELETE FROM civicrm_contact_type * Methods create relationshipe within same contact type with invalid Relationships * */ - function testRelationshipCreateInvalidWithinSameType() { + public function testRelationshipCreateInvalidWithinSameType() { //check for Individual to Parent $relTypeParams = array( 'name_a_b' => 'indivToparent', @@ -182,7 +182,7 @@ DELETE FROM civicrm_contact_type * Methods create relationshipe within diff contact type with invalid Relationships * */ - function testRelCreateInvalidWithinDiffTypeSpocorIndivi() { + public function testRelCreateInvalidWithinDiffTypeSpocorIndivi() { //check for Sponcer to Individual $relTypeParams = array( 'name_a_b' => 'SponsorToIndiv', @@ -206,7 +206,7 @@ DELETE FROM civicrm_contact_type $this->relationshipTypeDelete($relType->id); } - function testRelCreateInvalidWithinDiffTypeStudentSponcor() { + public function testRelCreateInvalidWithinDiffTypeStudentSponcor() { //check for Student to Sponcer $relTypeParams = array( 'name_a_b' => 'StudentToSponser', @@ -236,7 +236,7 @@ DELETE FROM civicrm_contact_type * success expected * */ - function testRelationshipCreateWithinSameType() { + public function testRelationshipCreateWithinSameType() { //check for Individual to Parent $relTypeParams = array( 'name_a_b' => 'indivToparent', @@ -265,7 +265,7 @@ DELETE FROM civicrm_contact_type * success expected * */ - function testRelCreateWithinDiffTypeSponsorIndivi() { + public function testRelCreateWithinDiffTypeSponsorIndivi() { //check for Sponcer to Individual $relTypeParams = array( 'name_a_b' => 'SponsorToIndiv', @@ -289,7 +289,7 @@ DELETE FROM civicrm_contact_type $this->relationshipTypeDelete($relType->id); } - function testRelCreateWithinDiffTypeStudentSponsor() { + public function testRelCreateWithinDiffTypeStudentSponsor() { //check for Student to Sponcer $relTypeParams = array( 'name_a_b' => 'StudentToSponsor', diff --git a/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php b/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php index aed709e0af..bf48926d0e 100644 --- a/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php +++ b/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php @@ -39,7 +39,7 @@ class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase { /** * Manually add and remove contacts from a smart group */ - function testManualAddRemove() { + public function testManualAddRemove() { // Create smart group $g $params = array( 'name' => 'Deceased Contacts', @@ -95,7 +95,7 @@ class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase { * Allow removing contact from a parent group even if contact is in * a child group. (CRM-8858) */ - function testRemoveFromParentSmartGroup() { + public function testRemoveFromParentSmartGroup() { // Create smart group $parent $params = array( 'name' => 'Deceased Contacts', @@ -167,7 +167,7 @@ class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase { * @param $expectedContactIds array(int) * @param $groupId int */ - function assertCacheMatches($expectedContactIds, $groupId) { + public function assertCacheMatches($expectedContactIds, $groupId) { $sql = 'SELECT contact_id FROM civicrm_group_contact_cache WHERE group_id = %1'; $params = array(1 => array($groupId, 'Integer')); $dao = CRM_Core_DAO::executeQuery($sql, $params); @@ -230,7 +230,7 @@ class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase { /** * @param $objects array DAO or BAO objects */ - function registerTestObjects($objects) { + public function registerTestObjects($objects) { //if (is_object($objects)) { // $objects = array($objects); //} @@ -240,7 +240,7 @@ class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase { } } - function deleteTestObjects() { + public function deleteTestObjects() { // Note: You might argue that the FK relations between test // objects could make this problematic; however, it should // behave intuitively as long as we mentally split our diff --git a/tests/phpunit/CRM/Contact/BAO/GroupContactTest.php b/tests/phpunit/CRM/Contact/BAO/GroupContactTest.php index 355963c3cf..076f137159 100644 --- a/tests/phpunit/CRM/Contact/BAO/GroupContactTest.php +++ b/tests/phpunit/CRM/Contact/BAO/GroupContactTest.php @@ -57,7 +57,7 @@ class CRM_Contact_BAO_GroupContactTest extends CiviUnitTestCase { /** * Test case for add( ) */ - function testAdd() { + public function testAdd() { //creates a test group contact by recursively creation //lets create 10 groupContacts for fun @@ -73,7 +73,7 @@ class CRM_Contact_BAO_GroupContactTest extends CiviUnitTestCase { /** * Test case for getGroupId( ) */ - function testGetGroupId() { + public function testGetGroupId() { //creates a test groupContact object @@ -94,7 +94,7 @@ class CRM_Contact_BAO_GroupContactTest extends CiviUnitTestCase { /** * Test case for contact search: CRM-6706, CRM-6586 Parent Group search should return contacts from child groups too. */ - function testContactSearchByParentGroup() { + public function testContactSearchByParentGroup() { // create a parent group // TODO: This is not an API test!! $groupParams1 = array( diff --git a/tests/phpunit/CRM/Contact/BAO/GroupTest.php b/tests/phpunit/CRM/Contact/BAO/GroupTest.php index 38c6a8e50c..d4a54fff56 100644 --- a/tests/phpunit/CRM/Contact/BAO/GroupTest.php +++ b/tests/phpunit/CRM/Contact/BAO/GroupTest.php @@ -58,7 +58,7 @@ class CRM_Contact_BAO_GroupTest extends CiviUnitTestCase { /** * Test case for add( ) */ - function testAddSimple() { + public function testAddSimple() { $checkParams = $params = array( 'title' => 'Group Uno', @@ -76,7 +76,7 @@ class CRM_Contact_BAO_GroupTest extends CiviUnitTestCase { ); } - function testAddSmart() { + public function testAddSmart() { $checkParams = $params = array( 'title' => 'Group Dos', @@ -100,7 +100,7 @@ class CRM_Contact_BAO_GroupTest extends CiviUnitTestCase { * Load all sql data sets & return an array of saved searches * @return array */ - function dataProviderSavedSearch() { + public function dataProviderSavedSearch() { $this->loadSavedSearches(); $results = CRM_Core_DAO::singleValueQuery('SELECT GROUP_CONCAT(id) FROM civicrm_group WHERE saved_search_id IS NOT NULL'); @@ -110,7 +110,7 @@ class CRM_Contact_BAO_GroupTest extends CiviUnitTestCase { /** * Load saved search sql files into the DB */ - function loadSavedSearches() { + public function loadSavedSearches() { $dsn = CRM_Core_Config::singleton()->dsn; foreach (glob(dirname(__FILE__) . "/SavedSearchDataSets/*.sql") as $file) { CRM_Utils_File::sourceSQLFile($dsn, $file); @@ -136,7 +136,7 @@ class CRM_Contact_BAO_GroupTest extends CiviUnitTestCase { * Copy the output to a single sql file and place in the SavedSearchDataSets folder - use the group number as the prefix. * Try to keep as much of the real world irregular glory as you can! Don't change the table ids to be number 1 as this can hide errors */ - function testGroupData() { + public function testGroupData() { $groups = $this->dataProviderSavedSearch(); foreach ($groups[0] as $groupID) { $group = new CRM_Contact_BAO_Group(); diff --git a/tests/phpunit/CRM/Contact/BAO/QueryTest.php b/tests/phpunit/CRM/Contact/BAO/QueryTest.php index 853368ed78..7e20b77faf 100644 --- a/tests/phpunit/CRM/Contact/BAO/QueryTest.php +++ b/tests/phpunit/CRM/Contact/BAO/QueryTest.php @@ -14,11 +14,11 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase { return new CRM_Contact_BAO_QueryTestDataProvider; } - function setUp() { + public function setUp() { parent::setUp(); } - function tearDown() { + public function tearDown() { $tablesToTruncate = array( 'civicrm_group_contact', 'civicrm_group', @@ -34,7 +34,7 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase { * Test CRM_Contact_BAO_Query::searchQuery() * @dataProvider dataProvider */ - function testSearch($fv, $count, $ids, $full) { + public function testSearch($fv, $count, $ids, $full) { $op = new PHPUnit_Extensions_Database_Operation_Insert(); $op->execute($this->_dbconn, $this->createFlatXMLDataSet( @@ -65,7 +65,7 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase { * Check that we get a successful result querying for home address * CRM-14263 search builder failure with search profile & address in criteria */ - function testSearchProfileHomeCityCRM14263() { + public function testSearchProfileHomeCityCRM14263() { $contactID = $this->individualCreate(); CRM_Core_Config::singleton()->defaultSearchProfileID = 1; $this->callAPISuccess('address', 'create', array('contact_id' => $contactID, 'city' => 'Cool City', 'location_type_id' => 1,)); @@ -103,7 +103,7 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase { * Check that we get a successful result querying for home address * CRM-14263 search builder failure with search profile & address in criteria */ - function testSearchProfileHomeCityNoResultsCRM14263() { + public function testSearchProfileHomeCityNoResultsCRM14263() { $contactID = $this->individualCreate(); CRM_Core_Config::singleton()->defaultSearchProfileID = 1; $this->callAPISuccess('address', 'create', array('contact_id' => $contactID, 'city' => 'Cool City', 'location_type_id' => 1,)); @@ -141,7 +141,7 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase { * We are retrieving primary here - checking the actual sql seems super prescriptive - but since the massive query object has * so few tests detecting any change seems good here :-) */ - function testSearchProfilePrimaryCityCRM14263() + public function testSearchProfilePrimaryCityCRM14263() { $contactID = $this->individualCreate(); CRM_Core_Config::singleton()->defaultSearchProfileID = 1; diff --git a/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php b/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php index 0e120bd7a2..3699a844ad 100644 --- a/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php +++ b/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php @@ -72,11 +72,11 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase { return new CRM_Contact_Form_Search_Custom_GroupTestDataProvider; } - function setUp() { + public function setUp() { parent::setUp(); } - function tearDown() {} + public function tearDown() {} /** * Test CRM_Contact_Form_Search_Custom_Group::count() diff --git a/tests/phpunit/CRM/Contribute/BAO/ContributionPageTest.php b/tests/phpunit/CRM/Contribute/BAO/ContributionPageTest.php index 847dc5e90d..efd08d33bb 100644 --- a/tests/phpunit/CRM/Contribute/BAO/ContributionPageTest.php +++ b/tests/phpunit/CRM/Contribute/BAO/ContributionPageTest.php @@ -37,18 +37,18 @@ require_once 'CiviTest/PaypalPro.php'; */ class CRM_Contribute_BAO_ContributionPageTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); $this->_financialTypeID = 1; } - function tearDown() { + public function tearDown() { } /** * Create() method (create Contribution Page) */ - function testCreate() { + public function testCreate() { $params = array( 'qfkey' => '9a3ef3c08879ad4c8c109b21c583400e', @@ -80,7 +80,7 @@ class CRM_Contribute_BAO_ContributionPageTest extends CiviUnitTestCase { /** * test setIsActive() method */ - function testsetIsActive() { + public function testsetIsActive() { $params = array( 'title' => 'Test Contribution Page', @@ -99,7 +99,7 @@ class CRM_Contribute_BAO_ContributionPageTest extends CiviUnitTestCase { /** * Test setValues() method */ - function testSetValues() { + public function testSetValues() { $params = array( 'title' => 'Test Contribution Page', @@ -122,7 +122,7 @@ class CRM_Contribute_BAO_ContributionPageTest extends CiviUnitTestCase { /** * Test copy() method */ - function testcopy() { + public function testcopy() { $params = array( 'qfkey' => '9a3ef3c08879ad4c8c109b21c583400e', 'title' => 'Test Contribution Page', @@ -154,7 +154,7 @@ class CRM_Contribute_BAO_ContributionPageTest extends CiviUnitTestCase { /** * Test checkRecurPaymentProcessor() method */ - function testcheckRecurPaymentProcessor() { + public function testcheckRecurPaymentProcessor() { //@todo paypalpro create seems to fail silently without causing this class to fail // $this->paymentProcessorCreate may be a better option $paymentProcessor = PaypalPro::create(); diff --git a/tests/phpunit/CRM/Contribute/BAO/ContributionRecurTest.php b/tests/phpunit/CRM/Contribute/BAO/ContributionRecurTest.php index 8da8399637..200a02cf94 100644 --- a/tests/phpunit/CRM/Contribute/BAO/ContributionRecurTest.php +++ b/tests/phpunit/CRM/Contribute/BAO/ContributionRecurTest.php @@ -29,7 +29,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; class CRM_Contribute_BAO_ContributionRecurTest extends CiviUnitTestCase { protected $_params = array(); - function setUp() { + public function setUp() { parent::setUp(); $this->_ids['payment_processor'] = $this->paymentProcessorCreate(); $this->_params = array( @@ -62,7 +62,7 @@ class CRM_Contribute_BAO_ContributionRecurTest extends CiviUnitTestCase { ); } - function teardown() { + public function teardown() { $this->quickCleanup(array('civicrm_contribution_recur', 'civicrm_payment_processor')); } @@ -70,7 +70,7 @@ class CRM_Contribute_BAO_ContributionRecurTest extends CiviUnitTestCase { * Test that an object can be retrieved & saved (per CRM-14986) * this has been causing a DB error so we are checking for absence of error */ - function testFindSave() { + public function testFindSave() { $contributionRecur = $this->callAPISuccess('contribution_recur', 'create', $this->_params); $dao = new CRM_Contribute_BAO_ContributionRecur(); $dao->id = $contributionRecur['id']; @@ -83,7 +83,7 @@ class CRM_Contribute_BAO_ContributionRecurTest extends CiviUnitTestCase { * Test cancellation works per CRM-14986 * we are checking for absence of error */ - function testCancelRecur() { + public function testCancelRecur() { $contributionRecur = $this->callAPISuccess('contribution_recur', 'create', $this->_params); CRM_Contribute_BAO_ContributionRecur::cancelRecurContribution($contributionRecur['id'], CRM_Core_DAO::$_nullObject); } diff --git a/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php b/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php index 1d7149fa1d..758a8bb936 100644 --- a/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php +++ b/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php @@ -35,17 +35,17 @@ require_once 'CiviTest/Custom.php'; */ class CRM_Contribute_BAO_ContributionTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } - function teardown() { + public function teardown() { } /** * Create() method (create and update modes) */ - function testCreate() { + public function testCreate() { $contactId = Contact::createIndividual(); $ids = array('contribution' => NULL); @@ -92,7 +92,7 @@ class CRM_Contribute_BAO_ContributionTest extends CiviUnitTestCase { /** * Create() method with custom data */ - function testCreateWithCustomData() { + public function testCreateWithCustomData() { $contactId = Contact::createIndividual(); $ids = array('contribution' => NULL); @@ -164,7 +164,7 @@ class CRM_Contribute_BAO_ContributionTest extends CiviUnitTestCase { /** * DeleteContribution() method */ - function testDeleteContribution() { + public function testDeleteContribution() { $contactId = Contact::createIndividual(); $ids = array('contribution' => NULL); @@ -203,7 +203,7 @@ class CRM_Contribute_BAO_ContributionTest extends CiviUnitTestCase { /** * Create honor-contact method */ - function testcreateAndGetHonorContact() { + public function testcreateAndGetHonorContact() { $firstName = 'John_' . substr(sha1(rand()), 0, 7); $lastName = 'Smith_' . substr(sha1(rand()), 0, 7); $email = "{$firstName}.{$lastName}@example.com"; @@ -289,7 +289,7 @@ class CRM_Contribute_BAO_ContributionTest extends CiviUnitTestCase { * contribution batch update through profile * sortName(); */ - function testsortName() { + public function testsortName() { $params = array( 'first_name' => 'Shane', 'last_name' => 'Whatson', @@ -345,7 +345,7 @@ class CRM_Contribute_BAO_ContributionTest extends CiviUnitTestCase { * * AddPremium(); */ - function testAddPremium() { + public function testAddPremium() { $contactId = Contact::createIndividual(); $ids = array( @@ -420,7 +420,7 @@ class CRM_Contribute_BAO_ContributionTest extends CiviUnitTestCase { * during the contribution import * checkDuplicateIds(); */ - function testcheckDuplicateIds() { + public function testcheckDuplicateIds() { $contactId = Contact::createIndividual(); $ids = array('contribution' => NULL); diff --git a/tests/phpunit/CRM/Contribute/BAO/ContributionTypeTest.php b/tests/phpunit/CRM/Contribute/BAO/ContributionTypeTest.php index f1e09197a4..62a31dfb9f 100644 --- a/tests/phpunit/CRM/Contribute/BAO/ContributionTypeTest.php +++ b/tests/phpunit/CRM/Contribute/BAO/ContributionTypeTest.php @@ -32,19 +32,19 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Contribute_BAO_ContributionTypeTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); $this->organizationCreate(); } - function teardown() { + public function teardown() { $this->financialAccountDelete('Donations'); } /** * Check method add() */ - function testAdd() { + public function testAdd() { $params = array( 'name' => 'Donations', 'is_deductible' => 0, @@ -64,7 +64,7 @@ class CRM_Contribute_BAO_ContributionTypeTest extends CiviUnitTestCase { /** * Check method retrive() */ - function testRetrieve() { + public function testRetrieve() { $params = array( 'name' => 'Donations', 'is_deductible' => 0, @@ -82,7 +82,7 @@ class CRM_Contribute_BAO_ContributionTypeTest extends CiviUnitTestCase { /** * Check method setIsActive() */ - function testSetIsActive() { + public function testSetIsActive() { $params = array( 'name' => 'Donations', 'is_deductible' => 0, @@ -103,7 +103,7 @@ class CRM_Contribute_BAO_ContributionTypeTest extends CiviUnitTestCase { /** * Check method del() */ - function testdel() { + public function testdel() { $params = array( 'name' => 'Donations', 'is_deductible' => 0, diff --git a/tests/phpunit/CRM/Contribute/BAO/ManagePremiumsTest.php b/tests/phpunit/CRM/Contribute/BAO/ManagePremiumsTest.php index e0946f114f..27222b3175 100644 --- a/tests/phpunit/CRM/Contribute/BAO/ManagePremiumsTest.php +++ b/tests/phpunit/CRM/Contribute/BAO/ManagePremiumsTest.php @@ -32,14 +32,14 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Contribute_BAO_ManagePremiumsTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } /** * Check method add() */ - function testAdd() { + public function testAdd() { $ids = array(); $params = array( 'name' => 'Test Product', @@ -64,7 +64,7 @@ class CRM_Contribute_BAO_ManagePremiumsTest extends CiviUnitTestCase { /** * Check method retrieve( ) */ - function testRetrieve() { + public function testRetrieve() { $ids = array(); $params = array( 'name' => 'Test Product', @@ -86,7 +86,7 @@ class CRM_Contribute_BAO_ManagePremiumsTest extends CiviUnitTestCase { /** * Check method setIsActive( ) */ - function testSetIsActive() { + public function testSetIsActive() { $ids = array(); $params = array( 'name' => 'Test Product', @@ -112,7 +112,7 @@ class CRM_Contribute_BAO_ManagePremiumsTest extends CiviUnitTestCase { /** * Check method del( ) */ - function testDel() { + public function testDel() { $ids = array(); $params = array( 'name' => 'Test Product', diff --git a/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php b/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php index 8cba468d92..fee9defeb2 100644 --- a/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php +++ b/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php @@ -37,7 +37,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { */ var $mut; - function setUp() { + public function setUp() { parent::setUp(); require_once 'CiviTest/CiviMailUtils.php'; @@ -421,7 +421,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { * * @access protected */ - function tearDown() { + public function tearDown() { parent::tearDown(); $this->mut->clearMessages(); @@ -431,7 +431,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { $this->_tearDown(); } - function testActivityDateTime_Match_NonRepeatableSchedule() { + public function testActivityDateTime_Match_NonRepeatableSchedule() { $actionScheduleDao = CRM_Core_BAO_ActionSchedule::add($this->fixtures['sched_activity_1day']); $this->assertTrue(is_numeric($actionScheduleDao->id)); @@ -462,7 +462,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { )); } - function testActivityDateTime_Match_RepeatableSchedule() { + public function testActivityDateTime_Match_RepeatableSchedule() { $actionScheduleDao = CRM_Core_BAO_ActionSchedule::add($this->fixtures['sched_activity_1day_r']); $this->assertTrue(is_numeric($actionScheduleDao->id)); @@ -507,7 +507,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { * For contacts/members which match schedule based on join date, * an email should be sent. */ - function testMembershipJoinDate_Match() { + public function testMembershipJoinDate_Match() { $membership = $this->createTestObject('CRM_Member_DAO_Membership', array_merge($this->fixtures['rolling_membership'], array('status_id' => 1))); $this->assertTrue(is_numeric($membership->id)); $result = $this->callAPISuccess('Email', 'create', array( @@ -540,7 +540,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { * For contacts/members which match schedule based on join date, * an email should be sent. */ - function testMembershipJoinDate_NonMatch() { + public function testMembershipJoinDate_NonMatch() { $membership = $this->createTestObject('CRM_Member_DAO_Membership', $this->fixtures['rolling_membership']); $this->assertTrue(is_numeric($membership->id)); $result = $this->callAPISuccess('Email', 'create', array( @@ -570,7 +570,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { * Test that the first and SECOND notifications are sent out * */ - function testMembershipEndDate_Repeat() { + public function testMembershipEndDate_Repeat() { // creates membership with end_date = 20120615 $membership = $this->createTestObject('CRM_Member_DAO_Membership', array_merge($this->fixtures['rolling_membership'], array('status_id' => 2))); $result = $this->callAPISuccess('Email', 'create', array( @@ -601,7 +601,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { * between * see CRM-15376 */ - function testMembershipEndDate_Repeat_ChangedEndDate_CRM_15376() { + public function testMembershipEndDate_Repeat_ChangedEndDate_CRM_15376() { // creates membership with end_date = 20120615 $membership = $this->createTestObject('CRM_Member_DAO_Membership', array_merge($this->fixtures['rolling_membership'], array('status_id' => 2))); $this->callAPISuccess('Email', 'create', array( @@ -635,7 +635,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { * For contacts/members which match schedule based on end date, * an email should be sent. */ - function testMembershipEndDate_Match() { + public function testMembershipEndDate_Match() { // creates membership with end_date = 20120615 $membership = $this->createTestObject('CRM_Member_DAO_Membership', array_merge($this->fixtures['rolling_membership'], array('status_id' => 2))); $this->assertTrue(is_numeric($membership->id)); @@ -669,7 +669,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { * For contacts/members which match schedule based on end date, * an email should be sent. */ - function testMembershipEndDate_NoMatch() { + public function testMembershipEndDate_NoMatch() { // creates membership with end_date = 20120615 $membership = $this->createTestObject('CRM_Member_DAO_Membership', array_merge($this->fixtures['rolling_membership_past'], array('status_id' => 3))); $this->assertTrue(is_numeric($membership->id)); @@ -698,7 +698,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { )); } - function testContactBirthDate_noAnniv() { + public function testContactBirthDate_noAnniv() { $contact = $this->callAPISuccess('Contact', 'create', $this->fixtures['contact_birthdate']); $this->_testObjects['CRM_Contact_DAO_Contact'][] = $contact['id']; $actionSchedule = $this->fixtures['sched_contact_bday_yesterday']; @@ -716,7 +716,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { )); } - function testContactBirthDate_Anniv() { + public function testContactBirthDate_Anniv() { $contact = $this->callAPISuccess('Contact', 'create', $this->fixtures['contact_birthdate']); $this->_testObjects['CRM_Contact_DAO_Contact'][] = $contact['id']; $actionSchedule = $this->fixtures['sched_contact_bday_anniv']; @@ -734,7 +734,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { )); } - function testContactCustomDate_noAnniv() { + public function testContactCustomDate_noAnniv() { $group = array( 'title' => 'Test_Group', 'name' => 'test_group', @@ -774,7 +774,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { /** * Check that limit_to + an empty recipients doesn't sent to multiple contacts */ - function testMembershipLimitToNone() { + public function testMembershipLimitToNone() { // creates membership with end_date = 20120615 $membership = $this->createTestObject('CRM_Member_DAO_Membership', array_merge($this->fixtures['rolling_membership'], array('status_id' => 2))); @@ -805,7 +805,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { - function testContactCustomDate_Anniv() { + public function testContactCustomDate_Anniv() { $group = array( 'title' => 'Test_Group now', 'name' => 'test_group_now', @@ -859,7 +859,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { * - time: string, e.g. '2012-06-15 21:00:01' * - recipients: array(array(string)), list of email addresses which should receive messages */ - function assertCronRuns($cronRuns) { + public function assertCronRuns($cronRuns) { foreach ($cronRuns as $cronRun) { CRM_Utils_Time::setTime($cronRun['time']); $this->callAPISuccess('job', 'send_reminder', array()); @@ -919,7 +919,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { /** * @param $objects array DAO or BAO objects */ - function registerTestObjects($objects) { + public function registerTestObjects($objects) { //if (is_object($objects)) { // $objects = array($objects); //} @@ -929,7 +929,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { } } - function deleteTestObjects() { + public function deleteTestObjects() { // Note: You might argue that the FK relations between test // objects could make this problematic; however, it should // behave intuitively as long as we mentally split our diff --git a/tests/phpunit/CRM/Core/BAO/AddressTest.php b/tests/phpunit/CRM/Core/BAO/AddressTest.php index cf738f491a..e3986b2060 100644 --- a/tests/phpunit/CRM/Core/BAO/AddressTest.php +++ b/tests/phpunit/CRM/Core/BAO/AddressTest.php @@ -33,7 +33,7 @@ require_once 'CiviTest/Contact.php'; * Class CRM_Core_BAO_AddressTest */ class CRM_Core_BAO_AddressTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); $this->quickCleanup(array('civicrm_contact', 'civicrm_address')); @@ -42,7 +42,7 @@ class CRM_Core_BAO_AddressTest extends CiviUnitTestCase { /** * Create() method (create and update modes) */ - function testCreate() { + public function testCreate() { $contactId = Contact::createIndividual(); $params = array(); @@ -106,7 +106,7 @@ class CRM_Core_BAO_AddressTest extends CiviUnitTestCase { /** * Add() method ( ) */ - function testAdd() { + public function testAdd() { $contactId = Contact::createIndividual(); $fixParams = array( @@ -145,7 +145,7 @@ class CRM_Core_BAO_AddressTest extends CiviUnitTestCase { /** * AllAddress() method ( ) */ - function testallAddress() { + public function testallAddress() { $contactId = Contact::createIndividual(); $fixParams = array( @@ -203,7 +203,7 @@ class CRM_Core_BAO_AddressTest extends CiviUnitTestCase { /** * AllAddress() method ( ) with null value */ - function testnullallAddress() { + public function testnullallAddress() { $contactId = Contact::createIndividual(); $fixParams = array( @@ -241,7 +241,7 @@ class CRM_Core_BAO_AddressTest extends CiviUnitTestCase { /** * GetValues() method (get Address fields) */ - function testGetValues() { + public function testGetValues() { $contactId = Contact::createIndividual(); $params = array(); @@ -281,7 +281,7 @@ class CRM_Core_BAO_AddressTest extends CiviUnitTestCase { /** * ParseStreetAddress() method (get street address parsed) */ - function testParseStreetAddress() { + public function testParseStreetAddress() { // valid Street address to be parsed ( without locale ) $street_address = "54A Excelsior Ave. Apt 1C"; diff --git a/tests/phpunit/CRM/Core/BAO/CustomFieldTest.php b/tests/phpunit/CRM/Core/BAO/CustomFieldTest.php index 6132a545d5..38cd7a6961 100644 --- a/tests/phpunit/CRM/Core/BAO/CustomFieldTest.php +++ b/tests/phpunit/CRM/Core/BAO/CustomFieldTest.php @@ -8,11 +8,11 @@ require_once 'CiviTest/Custom.php'; */ class CRM_Core_BAO_CustomFieldTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } - function testCreateCustomfield() { + public function testCreateCustomfield() { $customGroup = Custom::createGroup(array(), 'Individual'); $fields = array( 'label' => 'testFld', @@ -45,7 +45,7 @@ class CRM_Core_BAO_CustomFieldTest extends CiviUnitTestCase { Custom::deleteGroup($customGroup); } - function testCreateCustomfieldColumnName() { + public function testCreateCustomfieldColumnName() { $customGroup = Custom::createGroup(array(), 'Individual'); $fields = array( 'label' => 'testFld 2', @@ -65,7 +65,7 @@ class CRM_Core_BAO_CustomFieldTest extends CiviUnitTestCase { Custom::deleteGroup($customGroup); } - function testCreateCustomfieldName() { + public function testCreateCustomfieldName() { $customGroup = Custom::createGroup(array(), 'Individual'); $fields = array( 'label' => 'testFld 2', @@ -86,7 +86,7 @@ class CRM_Core_BAO_CustomFieldTest extends CiviUnitTestCase { } - function testGetFields() { + public function testGetFields() { $customGroup = Custom::createGroup(array(), 'Individual'); $fields = array( 'label' => 'testFld1', @@ -119,7 +119,7 @@ class CRM_Core_BAO_CustomFieldTest extends CiviUnitTestCase { Custom::deleteGroup($customGroup); } - function testGetDisplayedValues() { + public function testGetDisplayedValues() { $customGroup = Custom::createGroup(array(), 'Individual'); $fields = array( 'label' => 'testCountryFld1', @@ -146,7 +146,7 @@ class CRM_Core_BAO_CustomFieldTest extends CiviUnitTestCase { Custom::deleteGroup($customGroup); } - function testDeleteCustomfield() { + public function testDeleteCustomfield() { $customGroup = Custom::createGroup(array(), 'Individual'); $fields = array( 'groupId' => $customGroup->id, @@ -168,7 +168,7 @@ class CRM_Core_BAO_CustomFieldTest extends CiviUnitTestCase { * Move a custom field from $groupA to $groupB. Make sure that data records are * correctly matched and created. */ - function testMoveField() { + public function testMoveField() { $countriesByName = array_flip(CRM_Core_PseudoConstant::country(FALSE, FALSE)); $this->assertTrue($countriesByName['Andorra'] > 0); $groups = array( diff --git a/tests/phpunit/CRM/Core/BAO/CustomGroupTest.php b/tests/phpunit/CRM/Core/BAO/CustomGroupTest.php index 7173695328..a3a65b8fa5 100644 --- a/tests/phpunit/CRM/Core/BAO/CustomGroupTest.php +++ b/tests/phpunit/CRM/Core/BAO/CustomGroupTest.php @@ -36,14 +36,14 @@ require_once 'CiviTest/Custom.php'; */ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } /** * Test getTree() */ - function testGetTree() { + public function testGetTree() { $params = array(); $contactId = Contact::createIndividual(); $customGrouptitle = 'My Custom Group'; @@ -83,7 +83,7 @@ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase { /** * Test retrieve() with Empty Params */ - function testRetrieveEmptyParams() { + public function testRetrieveEmptyParams() { $params = array(); $customGroup = CRM_Core_BAO_CustomGroup::retrieve($params, $dafaults); $this->assertNull($customGroup, 'Check that no custom Group is retreived'); @@ -92,7 +92,7 @@ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase { /** * Test retrieve() with Inalid Params */ - function testRetrieveInvalidParams() { + public function testRetrieveInvalidParams() { $params = array('id' => 99); $customGroup = CRM_Core_BAO_CustomGroup::retrieve($params, $dafaults); $this->assertNull($customGroup, 'Check that no custom Group is retreived'); @@ -101,7 +101,7 @@ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase { /** * Test retrieve() */ - function testRetrieve() { + public function testRetrieve() { $customGrouptitle = 'My Custom Group'; $groupParams = array( 'title' => $customGrouptitle, @@ -137,7 +137,7 @@ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase { /** * Test setIsActive() */ - function testSetIsActive() { + public function testSetIsActive() { $customGrouptitle = 'My Custom Group'; $groupParams = array( 'title' => $customGrouptitle, @@ -167,7 +167,7 @@ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase { /** * Test getGroupDetail() with Empty Params */ - function testGetGroupDetailEmptyParams() { + public function testGetGroupDetailEmptyParams() { $customGroupId = array(); $customGroup = CRM_Core_BAO_CustomGroup::getGroupDetail($customGroupId); $this->assertTrue(empty($customGroup), 'Check that no custom Group details is retreived'); @@ -176,7 +176,7 @@ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase { /** * Test getGroupDetail() with Inalid Params */ - function testGetGroupDetailInvalidParams() { + public function testGetGroupDetailInvalidParams() { $customGroupId = 99; $customGroup = CRM_Core_BAO_CustomGroup::getGroupDetail($customGroupId); $this->assertTrue(empty($customGroup), 'Check that no custom Group details is retreived'); @@ -185,7 +185,7 @@ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase { /** * Test getGroupDetail() */ - function testGetGroupDetail() { + public function testGetGroupDetail() { $customGrouptitle = 'My Custom Group'; $groupParams = array( 'title' => $customGrouptitle, @@ -239,7 +239,7 @@ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase { /** * Test getTitle() with Invalid Params() */ - function testGetTitleWithInvalidParams() { + public function testGetTitleWithInvalidParams() { $params = 99; $customGroupTitle = CRM_Core_BAO_CustomGroup::getTitle($params); @@ -249,7 +249,7 @@ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase { /** * Test getTitle() */ - function testGetTitle() { + public function testGetTitle() { $customGrouptitle = 'My Custom Group'; $groupParams = array( 'title' => $customGrouptitle, @@ -276,7 +276,7 @@ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase { /** * Test deleteGroup() */ - function testDeleteGroup() { + public function testDeleteGroup() { $customGrouptitle = 'My Custom Group'; $groupParams = array( 'title' => $customGrouptitle, @@ -313,7 +313,7 @@ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase { /** * Test createTable() */ - function testCreateTable() { + public function testCreateTable() { $customGrouptitle = 'My Custom Group'; $groupParams = array( 'title' => $customGrouptitle, @@ -352,7 +352,7 @@ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase { /** * Test checkCustomField() */ - function testCheckCustomField() { + public function testCheckCustomField() { $customGroupTitle = 'My Custom Group'; $groupParams = array( 'title' => $customGroupTitle, @@ -415,13 +415,13 @@ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase { /** * Test getActiveGroups() with Invalid Params() */ - function testGetActiveGroupsWithInvalidParams() { + public function testGetActiveGroupsWithInvalidParams() { $contactId = Contact::createIndividual(); $activeGroups = CRM_Core_BAO_CustomGroup::getActiveGroups('ABC', 'civicrm/contact/view/cd', $contactId); $this->assertEquals(empty($activeGroups), TRUE, 'Check that Emprt params are retreived'); } - function testGetActiveGroups() { + public function testGetActiveGroups() { $contactId = Contact::createIndividual(); $customGrouptitle = 'Test Custom Group'; $groupParams = array( @@ -453,7 +453,7 @@ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase { /** * Test create() */ - function testCreate() { + public function testCreate() { $params = array( 'title' => 'Test_Group_1', 'name' => 'test_group_1', @@ -485,7 +485,7 @@ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase { /** * Test create() given a table_name */ - function testCreateTableName() { + public function testCreateTableName() { $params = array( 'title' => 'Test_Group_2', 'name' => 'test_group_2', @@ -517,7 +517,7 @@ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase { /** * Test isGroupEmpty() */ - function testIsGroupEmpty() { + public function testIsGroupEmpty() { $customGrouptitle = 'Test Custom Group'; $groupParams = array( 'title' => $customGrouptitle, @@ -540,7 +540,7 @@ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase { /** * Test getGroupTitles() with Invalid Params() */ - function testgetGroupTitlesWithInvalidParams() { + public function testgetGroupTitlesWithInvalidParams() { $params = array(99); $groupTitles = CRM_Core_BAO_CustomGroup::getGroupTitles($params); $this->assertTrue(empty($groupTitles), 'Check that no titles are recieved'); @@ -549,7 +549,7 @@ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase { /** * Test getGroupTitles() */ - function testgetGroupTitles() { + public function testgetGroupTitles() { $customGrouptitle = 'Test Custom Group'; $groupParams = array( 'title' => $customGrouptitle, diff --git a/tests/phpunit/CRM/Core/BAO/CustomValueTableMultipleTest.php b/tests/phpunit/CRM/Core/BAO/CustomValueTableMultipleTest.php index 7ef49175fe..10b9c503b4 100644 --- a/tests/phpunit/CRM/Core/BAO/CustomValueTableMultipleTest.php +++ b/tests/phpunit/CRM/Core/BAO/CustomValueTableMultipleTest.php @@ -9,11 +9,11 @@ require_once 'CiviTest/Custom.php'; */ class CRM_Core_BAO_CustomValueTableMultipleTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } - function testCustomGroupMultipleSingle() { + public function testCustomGroupMultipleSingle() { $params = array(); $contactID = Contact::createIndividual(); $customGroup = Custom::createGroup($params, 'Individual', TRUE); @@ -44,7 +44,7 @@ class CRM_Core_BAO_CustomValueTableMultipleTest extends CiviUnitTestCase { Contact::delete($contactID); } - function testCustomGroupMultipleDouble() { + public function testCustomGroupMultipleDouble() { $params = array(); $contactID = Contact::createIndividual(); $customGroup = Custom::createGroup($params, 'Individual', TRUE); @@ -77,7 +77,7 @@ class CRM_Core_BAO_CustomValueTableMultipleTest extends CiviUnitTestCase { Contact::delete($contactID); } - function testCustomGroupMultipleUpdate() { + public function testCustomGroupMultipleUpdate() { $params = array(); $contactID = Contact::createIndividual(); $customGroup = Custom::createGroup($params, 'Individual', TRUE); @@ -119,7 +119,7 @@ class CRM_Core_BAO_CustomValueTableMultipleTest extends CiviUnitTestCase { Contact::delete($contactID); } - function testCustomGroupMultipleOldFormate() { + public function testCustomGroupMultipleOldFormate() { $params = array(); $contactID = Contact::createIndividual(); $customGroup = Custom::createGroup($params, 'Individual', TRUE); diff --git a/tests/phpunit/CRM/Core/BAO/CustomValueTableSetGetTest.php b/tests/phpunit/CRM/Core/BAO/CustomValueTableSetGetTest.php index cb425ce20a..7f4d2ab006 100644 --- a/tests/phpunit/CRM/Core/BAO/CustomValueTableSetGetTest.php +++ b/tests/phpunit/CRM/Core/BAO/CustomValueTableSetGetTest.php @@ -8,14 +8,14 @@ require_once 'CiviTest/Custom.php'; */ class CRM_Core_BAO_CustomValueTableSetGetTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } /** * Test setValues() and GetValues() methods with custom Date field */ - function testSetGetValuesDate() { + public function testSetGetValuesDate() { $params = array(); $contactID = Contact::createIndividual(); @@ -114,7 +114,7 @@ class CRM_Core_BAO_CustomValueTableSetGetTest extends CiviUnitTestCase { * Test setValues() and getValues() methods with custom field YesNo(Boolean) Radio * */ - function testSetGetValuesYesNoRadio() { + public function testSetGetValuesYesNoRadio() { $params = array(); $contactID = Contact::createIndividual(); diff --git a/tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php b/tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php index 33117625f0..01c0690711 100644 --- a/tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php +++ b/tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php @@ -8,7 +8,7 @@ require_once 'CiviTest/Custom.php'; */ class CRM_Core_BAO_CustomValueTableTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } @@ -17,7 +17,7 @@ class CRM_Core_BAO_CustomValueTableTest extends CiviUnitTestCase { * Test store function for country * */ - function testStoreCountry() { + public function testStoreCountry() { $params = array(); $contactID = Contact::createIndividual(); $customGroup = Custom::createGroup($params, 'Individual'); @@ -52,7 +52,7 @@ class CRM_Core_BAO_CustomValueTableTest extends CiviUnitTestCase { * Test store function for file * */ - function atestStoreFile() { + public function atestStoreFile() { $params = array(); $contactID = Contact::createIndividual(); $customGroup = Custom::createGroup($params, 'Individual'); @@ -87,7 +87,7 @@ class CRM_Core_BAO_CustomValueTableTest extends CiviUnitTestCase { * Test store function for state province * */ - function testStoreStateProvince() { + public function testStoreStateProvince() { $params = array(); $contactID = Contact::createIndividual(); $customGroup = Custom::createGroup($params, 'Individual'); @@ -121,7 +121,7 @@ class CRM_Core_BAO_CustomValueTableTest extends CiviUnitTestCase { * Test store function for date * */ - function testStoreDate() { + public function testStoreDate() { $params = array(); $contactID = Contact::createIndividual(); $customGroup = Custom::createGroup($params, 'Individual'); @@ -156,7 +156,7 @@ class CRM_Core_BAO_CustomValueTableTest extends CiviUnitTestCase { * Test store function for rich text editor * */ - function testStoreRichTextEditor() { + public function testStoreRichTextEditor() { $params = array(); $contactID = Contact::createIndividual(); $customGroup = Custom::createGroup($params, 'Individual'); @@ -191,7 +191,7 @@ class CRM_Core_BAO_CustomValueTableTest extends CiviUnitTestCase { * Test getEntityValues function for stored value * */ - function testgetEntityValues() { + public function testgetEntityValues() { $params = array(); $contactID = Contact::createIndividual(); @@ -228,7 +228,7 @@ class CRM_Core_BAO_CustomValueTableTest extends CiviUnitTestCase { Contact::delete($contactID); } - function testCustomGroupMultiple() { + public function testCustomGroupMultiple() { $params = array(); $contactID = Contact::createIndividual(); $customGroup = Custom::createGroup($params, 'Individual'); diff --git a/tests/phpunit/CRM/Core/BAO/CustomValueTest.php b/tests/phpunit/CRM/Core/BAO/CustomValueTest.php index 41457b9555..48a810d3ff 100644 --- a/tests/phpunit/CRM/Core/BAO/CustomValueTest.php +++ b/tests/phpunit/CRM/Core/BAO/CustomValueTest.php @@ -40,7 +40,7 @@ require_once 'CiviTest/Custom.php'; * Class CRM_Core_BAO_CustomValueTest */ class CRM_Core_BAO_CustomValueTest extends CiviUnitTestCase { - function testTypeCheckWithValidInput() { + public function testTypeCheckWithValidInput() { $values = array(); $values = array( @@ -65,7 +65,7 @@ class CRM_Core_BAO_CustomValueTest extends CiviUnitTestCase { } } - function testTypeCheckWithInvalidInput() { + public function testTypeCheckWithInvalidInput() { $values = array(); $values = array('check1' => 'chk'); foreach ($values as $type => $value) { @@ -74,7 +74,7 @@ class CRM_Core_BAO_CustomValueTest extends CiviUnitTestCase { } } - function testTypeCheckWithWrongInput() { + public function testTypeCheckWithWrongInput() { $values = array(); $values = array( 'String' => 1, @@ -86,7 +86,7 @@ class CRM_Core_BAO_CustomValueTest extends CiviUnitTestCase { } } - function testTypeToFieldWithValidInput() { + public function testTypeToFieldWithValidInput() { $values = array(); $values = array( 'String' => 'char_data', @@ -108,7 +108,7 @@ class CRM_Core_BAO_CustomValueTest extends CiviUnitTestCase { } } - function testTypeToFieldWithWrongInput() { + public function testTypeToFieldWithWrongInput() { $values = array(); $values = array( 'String' => 'memo_data', @@ -121,7 +121,7 @@ class CRM_Core_BAO_CustomValueTest extends CiviUnitTestCase { } } - function testFixFieldValueOfTypeMemo() { + public function testFixFieldValueOfTypeMemo() { $customGroup = Custom::createGroup(array(), 'Individual'); $fields = array( @@ -146,7 +146,7 @@ class CRM_Core_BAO_CustomValueTest extends CiviUnitTestCase { Custom::deleteGroup($customGroup); } - function testFixFieldValueOfTypeMemoWithEmptyParams() { + public function testFixFieldValueOfTypeMemoWithEmptyParams() { $params = array(); $result = CRM_Core_BAO_CustomValue::fixFieldValueOfTypeMemo($params); $this->assertEquals($result, NULL, 'Checking the returned value of type Memo.'); diff --git a/tests/phpunit/CRM/Core/BAO/EmailTest.php b/tests/phpunit/CRM/Core/BAO/EmailTest.php index d9ac7b00f5..0aa2f90ec8 100644 --- a/tests/phpunit/CRM/Core/BAO/EmailTest.php +++ b/tests/phpunit/CRM/Core/BAO/EmailTest.php @@ -6,7 +6,7 @@ require_once 'CiviTest/Contact.php'; * Class CRM_Core_BAO_EmailTest */ class CRM_Core_BAO_EmailTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); $this->quickCleanup( array( 'civicrm_contact', 'civicrm_email' ) ); @@ -15,7 +15,7 @@ class CRM_Core_BAO_EmailTest extends CiviUnitTestCase { /** * Add() method (create and update modes) */ - function testAdd() { + public function testAdd() { $contactId = Contact::createIndividual(); $params = array(); @@ -55,7 +55,7 @@ class CRM_Core_BAO_EmailTest extends CiviUnitTestCase { /** * HoldEmail() method (set and reset on_hold condition) */ - function testHoldEmail() { + public function testHoldEmail() { $contactId = Contact::createIndividual(); $params = array(); @@ -128,7 +128,7 @@ class CRM_Core_BAO_EmailTest extends CiviUnitTestCase { /** * AllEmails() method - get all emails for our contact, with primary email first */ - function testAllEmails() { + public function testAllEmails() { $contactParams = array( 'first_name' => 'Alan', 'last_name' => 'Smith', diff --git a/tests/phpunit/CRM/Core/BAO/FinancialTrxnTest.php b/tests/phpunit/CRM/Core/BAO/FinancialTrxnTest.php index 3d104fa034..37479c604b 100644 --- a/tests/phpunit/CRM/Core/BAO/FinancialTrxnTest.php +++ b/tests/phpunit/CRM/Core/BAO/FinancialTrxnTest.php @@ -31,14 +31,14 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Class CRM_Core_BAO_FinancialTrxnTest */ class CRM_Core_BAO_FinancialTrxnTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } /** * Check method create() */ - function testCreate() { + public function testCreate() { $contactId = $this->individualCreate(); $financialTypeId = 1; $contributionId = $this->contributionCreate($contactId, $financialTypeId); diff --git a/tests/phpunit/CRM/Core/BAO/IMTest.php b/tests/phpunit/CRM/Core/BAO/IMTest.php index 84861f5ccf..facbb7ba7b 100644 --- a/tests/phpunit/CRM/Core/BAO/IMTest.php +++ b/tests/phpunit/CRM/Core/BAO/IMTest.php @@ -6,14 +6,14 @@ require_once 'CiviTest/Contact.php'; * Class CRM_Core_BAO_IMTest */ class CRM_Core_BAO_IMTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } /** * Add() method (create and update modes) */ - function testAdd() { + public function testAdd() { $contactId = Contact::createIndividual(); $params = array(); @@ -54,7 +54,7 @@ class CRM_Core_BAO_IMTest extends CiviUnitTestCase { /** * AllIMs() method - get all IMs for our contact, with primary IM first */ - function testAllIMs() { + public function testAllIMs() { $op = new PHPUnit_Extensions_Database_Operation_Insert; $op->execute( $this->_dbconn, diff --git a/tests/phpunit/CRM/Core/BAO/LocationTest.php b/tests/phpunit/CRM/Core/BAO/LocationTest.php index 441ff081eb..72de8f45ce 100644 --- a/tests/phpunit/CRM/Core/BAO/LocationTest.php +++ b/tests/phpunit/CRM/Core/BAO/LocationTest.php @@ -41,7 +41,7 @@ require_once 'CiviTest/Event.php'; * Class CRM_Core_BAO_LocationTest */ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); $this->quickCleanup( array( 'civicrm_contact', 'civicrm_address', 'civicrm_loc_block', 'civicrm_email', 'civicrm_phone', 'civicrm_im' ) ); @@ -53,7 +53,7 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase { * * @access protected */ - function tearDown() { + public function tearDown() { $tablesToTruncate = array( 'civicrm_contact', 'civicrm_openid', @@ -62,7 +62,7 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase { $this->quickCleanup($tablesToTruncate); } - function testCreateWithMissingParams() { + public function testCreateWithMissingParams() { $contactId = Contact::createIndividual(); $params = array( 'contact_id' => $contactId, @@ -85,7 +85,7 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase { * create various elements of location block * without civicrm_loc_block entry */ - function testCreateWithoutLocBlock() { + public function testCreateWithoutLocBlock() { $contactId = Contact::createIndividual(); //create various element of location block @@ -209,7 +209,7 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase { * create various elements of location block * with civicrm_loc_block */ - function testCreateWithLocBlock() { + public function testCreateWithLocBlock() { $this->_contactId = Contact::createIndividual(); //create test event record. $eventId = Event::create($this->_contactId); @@ -357,7 +357,7 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase { * created with various elements. * */ - function testDeleteLocBlock() { + public function testDeleteLocBlock() { $this->_contactId = Contact::createIndividual(); //create test event record. $eventId = Event::create($this->_contactId); @@ -449,7 +449,7 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase { * GetValues() method * get the values of various location elements */ - function testLocBlockgetValues() { + public function testLocBlockgetValues() { $contactId = Contact::createIndividual(); //create various element of location block diff --git a/tests/phpunit/CRM/Core/BAO/OpenIDTest.php b/tests/phpunit/CRM/Core/BAO/OpenIDTest.php index 09ea046598..f7ed2f30ff 100644 --- a/tests/phpunit/CRM/Core/BAO/OpenIDTest.php +++ b/tests/phpunit/CRM/Core/BAO/OpenIDTest.php @@ -6,7 +6,7 @@ require_once 'CiviTest/Contact.php'; * Class CRM_Core_BAO_OpenIDTest */ class CRM_Core_BAO_OpenIDTest extends CiviUnitTestCase { - function tearDown() { + public function tearDown() { // If we truncate only contact, then stale domain and openid records will be left. // If we truncate none of these tables, then contactDelete() will incrementally // clean correctly. @@ -14,14 +14,14 @@ class CRM_Core_BAO_OpenIDTest extends CiviUnitTestCase { //$this->quickCleanup($tablesToTruncate); } - function setUp() { + public function setUp() { parent::setUp(); } /** * Add() method (create and update modes) */ - function testAdd() { + public function testAdd() { $contactId = Contact::createIndividual(); $this->assertDBRowExist('CRM_Contact_DAO_Contact', $contactId); @@ -65,7 +65,7 @@ class CRM_Core_BAO_OpenIDTest extends CiviUnitTestCase { /** * IfAllowedToLogin() method (set and reset allowed_to_login) */ - function testIfAllowedToLogin() { + public function testIfAllowedToLogin() { $contactId = Contact::createIndividual(); $this->assertDBRowExist('CRM_Contact_DAO_Contact', $contactId); $openIdURL = "http://test-username.civicrm.org/"; @@ -110,7 +110,7 @@ class CRM_Core_BAO_OpenIDTest extends CiviUnitTestCase { /** * AllOpenIDs() method - get all OpenIDs for the given contact */ - function testAllOpenIDs() { + public function testAllOpenIDs() { $contactId = Contact::createIndividual(); $this->assertDBRowExist('CRM_Contact_DAO_Contact', $contactId); diff --git a/tests/phpunit/CRM/Core/BAO/PhoneTest.php b/tests/phpunit/CRM/Core/BAO/PhoneTest.php index 3f13befa9a..ea09884936 100644 --- a/tests/phpunit/CRM/Core/BAO/PhoneTest.php +++ b/tests/phpunit/CRM/Core/BAO/PhoneTest.php @@ -36,14 +36,14 @@ require_once 'CiviTest/Event.php'; */ class CRM_Core_BAO_PhoneTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } /** * Add() method (create and update modes) */ - function testAdd() { + public function testAdd() { $contactId = Contact::createIndividual(); $params = array(); @@ -86,7 +86,7 @@ class CRM_Core_BAO_PhoneTest extends CiviUnitTestCase { /** * AllPhones() method - get all Phones for our contact, with primary Phone first */ - function testAllPhones() { + public function testAllPhones() { $contactParams = array( 'first_name' => 'Alan', 'last_name' => 'Smith', @@ -114,6 +114,6 @@ class CRM_Core_BAO_PhoneTest extends CiviUnitTestCase { * AllEntityPhones() method - get all Phones for a location block, with primary Phone first * @todo FIXME: Fixing this test requires add helper functions in CiviTest to create location block and phone and link them to an event. Punting to 3.1 cycle. DGG */ - function SKIPPED_testAllEntityPhones() {} + public function SKIPPED_testAllEntityPhones() {} } diff --git a/tests/phpunit/CRM/Core/BAO/PreferencesTest.php b/tests/phpunit/CRM/Core/BAO/PreferencesTest.php index 973cde881b..bd8c0836e6 100644 --- a/tests/phpunit/CRM/Core/BAO/PreferencesTest.php +++ b/tests/phpunit/CRM/Core/BAO/PreferencesTest.php @@ -33,11 +33,11 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Core_BAO_PreferencesTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } - function testValueOptions() { + public function testValueOptions() { $addressOptions = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'address_options' @@ -48,7 +48,7 @@ class CRM_Core_BAO_PreferencesTest extends CiviUnitTestCase { $this->assertEquals($addressOptions['country'], 1, 'Country is not set in address options'); } - function testSetValueOptions() { + public function testSetValueOptions() { $addressOptions = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'address_options' ); diff --git a/tests/phpunit/CRM/Core/BAO/RecurringEntityTest.php b/tests/phpunit/CRM/Core/BAO/RecurringEntityTest.php index c73340638d..90baa13157 100644 --- a/tests/phpunit/CRM/Core/BAO/RecurringEntityTest.php +++ b/tests/phpunit/CRM/Core/BAO/RecurringEntityTest.php @@ -54,7 +54,7 @@ class CRM_Core_BAO_RecurringEntityTest extends CiviUnitTestCase { /** * Testing Activity Generation through Entity Recursion */ - function testActivityGeneration() { + public function testActivityGeneration() { //Activity set initial params $daoActivity = new CRM_Activity_DAO_Activity(); $daoActivity->activity_type_id = 1; @@ -113,7 +113,7 @@ class CRM_Core_BAO_RecurringEntityTest extends CiviUnitTestCase { /** * Testing Event Generation through Entity Recursion */ - function testEventGeneration() { + public function testEventGeneration() { //Event set initial params $daoEvent = new CRM_Event_DAO_Event(); $daoEvent->title = 'Test event for Recurring Entity'; diff --git a/tests/phpunit/CRM/Core/BAO/SettingTest.php b/tests/phpunit/CRM/Core/BAO/SettingTest.php index 016c2567df..6194895a39 100644 --- a/tests/phpunit/CRM/Core/BAO/SettingTest.php +++ b/tests/phpunit/CRM/Core/BAO/SettingTest.php @@ -32,21 +32,21 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Class CRM_Core_BAO_SettingTest */ class CRM_Core_BAO_SettingTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); global $civicrm_setting; $this->origSetting = $civicrm_setting; CRM_Utils_Cache::singleton()->flush(); } - function tearDown() { + public function tearDown() { global $civicrm_setting; $civicrm_setting = $this->origSetting; CRM_Utils_Cache::singleton()->flush(); parent::tearDown(); } - function testEnableComponentValid() { + public function testEnableComponentValid() { $config = CRM_Core_Config::singleton(TRUE, TRUE); $result = CRM_Core_BAO_ConfigSetting::enableComponent('CiviCampaign'); @@ -54,7 +54,7 @@ class CRM_Core_BAO_SettingTest extends CiviUnitTestCase { $this->assertTrue($result); } - function testEnableComponentAlreadyPresent() { + public function testEnableComponentAlreadyPresent() { $config = CRM_Core_Config::singleton(TRUE, TRUE); $result = CRM_Core_BAO_ConfigSetting::enableComponent('CiviCampaign'); @@ -63,7 +63,7 @@ class CRM_Core_BAO_SettingTest extends CiviUnitTestCase { $this->assertTrue($result); } - function testEnableComponentInvalid() { + public function testEnableComponentInvalid() { $config = CRM_Core_Config::singleton(TRUE, TRUE); $result = CRM_Core_BAO_ConfigSetting::enableComponent('CiviFake'); @@ -75,7 +75,7 @@ class CRM_Core_BAO_SettingTest extends CiviUnitTestCase { * Ensure that overrides in $civicrm_setting apply when * using getItem($group,$name). */ - function testGetItem_Override() { + public function testGetItem_Override() { global $civicrm_setting; $civicrm_setting[CRM_Core_BAO_Setting::DIRECTORY_PREFERENCES_NAME]['imageUploadDir'] = '/test/override'; $value = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::DIRECTORY_PREFERENCES_NAME, 'imageUploadDir'); @@ -86,7 +86,7 @@ class CRM_Core_BAO_SettingTest extends CiviUnitTestCase { * Ensure that overrides in $civicrm_setting apply when * using getItem($group). */ - function testGetItemGroup_Override() { + public function testGetItemGroup_Override() { global $civicrm_setting; $civicrm_setting[CRM_Core_BAO_Setting::DIRECTORY_PREFERENCES_NAME]['imageUploadDir'] = '/test/override'; $values = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::DIRECTORY_PREFERENCES_NAME); @@ -97,7 +97,7 @@ class CRM_Core_BAO_SettingTest extends CiviUnitTestCase { * Ensure that overrides in $civicrm_setting apply when * when using retrieveDirectoryAndURLPreferences(). */ - function testRetrieveDirectoryAndURLPreferences_Override() { + public function testRetrieveDirectoryAndURLPreferences_Override() { global $civicrm_setting; $civicrm_setting[CRM_Core_BAO_Setting::DIRECTORY_PREFERENCES_NAME]['imageUploadDir'] = '/test/override'; @@ -116,7 +116,7 @@ class CRM_Core_BAO_SettingTest extends CiviUnitTestCase { * * **/ - function testConvertAndFillSettings() { + public function testConvertAndFillSettings() { $settings = array('maxAttachments' => 6); CRM_Core_BAO_ConfigSetting::add($settings); $config = CRM_Core_Config::singleton(TRUE, TRUE); @@ -163,7 +163,7 @@ class CRM_Core_BAO_SettingTest extends CiviUnitTestCase { * Ensure that overrides in $civicrm_setting apply when * when using retrieveDirectoryAndURLPreferences(). */ - function testConvertConfigToSettingNoPrefetch() { + public function testConvertConfigToSettingNoPrefetch() { $settings = array('maxAttachments' => 6); CRM_Core_BAO_ConfigSetting::add($settings); $config = CRM_Core_Config::singleton(TRUE, TRUE); @@ -182,7 +182,7 @@ class CRM_Core_BAO_SettingTest extends CiviUnitTestCase { /* * Check that setting is converted without config value being removed * - function testConvertConfigToSettingPrefetch() { + public function testConvertConfigToSettingPrefetch() { $settings = array('debug' => 1); CRM_Core_BAO_ConfigSetting::add($settings); $config = CRM_Core_Config::singleton(true, true); @@ -203,7 +203,7 @@ class CRM_Core_BAO_SettingTest extends CiviUnitTestCase { * are very similar, but they exercise different codepaths. The first uses the API * and setItems [plural]; the second uses setItem [singular]. */ - function testOnChange() { + public function testOnChange() { global $_testOnChange_hookCalls; $this->setMockSettingsMetaData(array( 'onChangeExample' => array( @@ -257,7 +257,7 @@ class CRM_Core_BAO_SettingTest extends CiviUnitTestCase { * @param $newValue * @param $metadata */ - static function _testOnChange_onChangeExample($oldValue, $newValue, $metadata) { + public static function _testOnChange_onChangeExample($oldValue, $newValue, $metadata) { global $_testOnChange_hookCalls; $_testOnChange_hookCalls['count']++; $_testOnChange_hookCalls['oldValue'] = $oldValue; diff --git a/tests/phpunit/CRM/Core/BAO/UFFieldTest.php b/tests/phpunit/CRM/Core/BAO/UFFieldTest.php index 2e084ff3a5..5063ea3caf 100644 --- a/tests/phpunit/CRM/Core/BAO/UFFieldTest.php +++ b/tests/phpunit/CRM/Core/BAO/UFFieldTest.php @@ -7,7 +7,7 @@ require_once 'CiviTest/Contact.php'; */ class CRM_Core_BAO_UFFieldTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); $this->quickCleanup(array('civicrm_uf_group', 'civicrm_uf_field')); diff --git a/tests/phpunit/CRM/Core/CommunityMessagesTest.php b/tests/phpunit/CRM/Core/CommunityMessagesTest.php index b4a2a8e74c..6250f90769 100644 --- a/tests/phpunit/CRM/Core/CommunityMessagesTest.php +++ b/tests/phpunit/CRM/Core/CommunityMessagesTest.php @@ -364,7 +364,7 @@ class CRM_Core_CommunityMessagesTest extends CiviUnitTestCase { $this->assertEquals($trials, $freq['

Two

']); } - function testEvalMarkup() { + public function testEvalMarkup() { $communityMessages = new CRM_Core_CommunityMessages( $this->cache, $this->expectNoHttpRequest() diff --git a/tests/phpunit/CRM/Core/Config/MailerTest.php b/tests/phpunit/CRM/Core/Config/MailerTest.php index 5c407aa059..e8201e45bc 100644 --- a/tests/phpunit/CRM/Core/Config/MailerTest.php +++ b/tests/phpunit/CRM/Core/Config/MailerTest.php @@ -45,7 +45,7 @@ class CRM_Core_Config_MailerTest extends CiviUnitTestCase { */ var $calls; - function setUp() { + public function setUp() { $this->calls = array( 'civicrm_alterMailer' => 0, 'send' => 0, @@ -53,7 +53,7 @@ class CRM_Core_Config_MailerTest extends CiviUnitTestCase { parent::setUp(); } - function testHookAlterMailer() { + public function testHookAlterMailer() { $test = $this; $mockMailer = new CRM_Utils_FakeObject(array( 'send' => function ($recipients, $headers, $body) use ($test) { diff --git a/tests/phpunit/CRM/Core/DAOTest.php b/tests/phpunit/CRM/Core/DAOTest.php index 49cab99d51..6d4f6efca5 100644 --- a/tests/phpunit/CRM/Core/DAOTest.php +++ b/tests/phpunit/CRM/Core/DAOTest.php @@ -7,7 +7,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Core_DAOTest extends CiviUnitTestCase { - function testGetReferenceColumns() { + public function testGetReferenceColumns() { // choose CRM_Core_DAO_Email as an arbitrary example $emailRefs = CRM_Core_DAO_Email::getReferenceColumns(); $refsByTarget = array(); @@ -21,7 +21,7 @@ class CRM_Core_DAOTest extends CiviUnitTestCase { $this->assertEquals('CRM_Core_Reference_Basic', get_class($contactRef)); } - function testGetReferencesToTable() { + public function testGetReferencesToTable() { $refs = CRM_Core_DAO::getReferencesToTable(CRM_Financial_DAO_FinancialType::getTableName()); $refsBySource = array(); foreach ($refs as $refSpec) { @@ -35,7 +35,7 @@ class CRM_Core_DAOTest extends CiviUnitTestCase { $this->assertEquals('CRM_Core_Reference_Dynamic', get_class($genericRef)); } - function testFindReferences() { + public function testFindReferences() { $params = array( 'first_name' => 'Testy', 'last_name' => 'McScallion', @@ -69,7 +69,7 @@ class CRM_Core_DAOTest extends CiviUnitTestCase { /** * @return array */ - function composeQueryExamples() { + public function composeQueryExamples() { $cases = array(); // $cases[] = array('Input-SQL', 'Input-Params', 'Expected-SQL'); @@ -134,7 +134,7 @@ class CRM_Core_DAOTest extends CiviUnitTestCase { /** * @dataProvider composeQueryExamples */ - function testComposeQuery($inputSql, $inputParams, $expectSql) { + public function testComposeQuery($inputSql, $inputParams, $expectSql) { $actualSql = CRM_Core_DAO::composeQuery($inputSql, $inputParams); $this->assertEquals($expectSql, $actualSql); } @@ -146,7 +146,7 @@ class CRM_Core_DAOTest extends CiviUnitTestCase { // 'SELECT * FROM whatever WHERE name = %1 AND title = %3 AND year LIKE '%2012' // $params[3] = array('Bob', 'String'); // i.e. the place holder should be unique and should not contain in any other operational use in query - function testComposeQueryFailure() { + public function testComposeQueryFailure() { $cases[] = array( 'SELECT * FROM whatever WHERE name = %1 AND title = %2 AND year LIKE \'%2012\' ', array( @@ -163,7 +163,7 @@ class CRM_Core_DAOTest extends CiviUnitTestCase { /** * @return array */ - function sqlNameDataProvider() { + public function sqlNameDataProvider() { return array( array('this is a long string', 30, FALSE, 'this is a long string'), @@ -178,11 +178,11 @@ class CRM_Core_DAOTest extends CiviUnitTestCase { /** * @dataProvider sqlNameDataProvider */ - function testShortenSQLName($inputData, $length, $makeRandom, $expectedResult) { + public function testShortenSQLName($inputData, $length, $makeRandom, $expectedResult) { $this->assertEquals($expectedResult, CRM_Core_DAO::shortenSQLName($inputData, $length, $makeRandom)); } - function testFindById() { + public function testFindById() { $params = $this->sampleContact('Individual', 4); $existing_contact = CRM_Contact_BAO_Contact::add($params); $contact = CRM_Contact_BAO_Contact::findById($existing_contact->id); diff --git a/tests/phpunit/CRM/Core/ErrorTest.php b/tests/phpunit/CRM/Core/ErrorTest.php index c2a0c675a5..5ae2faeb2c 100644 --- a/tests/phpunit/CRM/Core/ErrorTest.php +++ b/tests/phpunit/CRM/Core/ErrorTest.php @@ -32,14 +32,14 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Core_ErrorTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); $config = CRM_Core_Config::singleton(); $this->oldConfigAndLogDir = $config->configAndLogDir; $config->configAndLogDir = $this->createTempDir('test-log-'); } - function tearDown() { + public function tearDown() { $config = CRM_Core_Config::singleton(); $config->configAndLogDir= $this->oldConfigAndLogDir; parent::tearDown(); @@ -48,7 +48,7 @@ class CRM_Core_ErrorTest extends CiviUnitTestCase { /** * Make sure that formatBacktrace() accepts values from debug_backtrace() */ - function testFormatBacktrace_debug() { + public function testFormatBacktrace_debug() { $bt = debug_backtrace(); $msg = CRM_Core_Error::formatBacktrace($bt); $this->assertRegexp('/CRM_Core_ErrorTest->testFormatBacktrace_debug/', $msg); @@ -57,7 +57,7 @@ class CRM_Core_ErrorTest extends CiviUnitTestCase { /** * Make sure that formatBacktrace() accepts values from Exception::getTrace() */ - function testFormatBacktrace_exception() { + public function testFormatBacktrace_exception() { $e = new Exception('foo'); $msg = CRM_Core_Error::formatBacktrace($e->getTrace()); $this->assertRegexp('/CRM_Core_ErrorTest->testFormatBacktrace_exception/', $msg); @@ -68,7 +68,7 @@ class CRM_Core_ErrorTest extends CiviUnitTestCase { * * This tests a theory about what caused CRM-10766. */ - function testMixLog() { + public function testMixLog() { CRM_Core_Error::debug_log_message("static-1"); $logger = CRM_Core_Error::createDebugLogger(); CRM_Core_Error::debug_log_message("static-2"); @@ -85,7 +85,7 @@ class CRM_Core_ErrorTest extends CiviUnitTestCase { /** * @param $pattern */ - function assertLogRegexp($pattern) { + public function assertLogRegexp($pattern) { $config = CRM_Core_Config::singleton(); $logFiles = glob($config->configAndLogDir.'/CiviCRM*.log'); $this->assertEquals(1, count($logFiles), 'Expect to find 1 file matching: ' . $config->configAndLogDir.'/CiviCRM*log*/'); diff --git a/tests/phpunit/CRM/Core/FieldOptionsTest.php b/tests/phpunit/CRM/Core/FieldOptionsTest.php index fad5520d24..5815b51c61 100644 --- a/tests/phpunit/CRM/Core/FieldOptionsTest.php +++ b/tests/phpunit/CRM/Core/FieldOptionsTest.php @@ -31,7 +31,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Tests for field options */ class CRM_Core_FieldOptionsTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } @@ -39,7 +39,7 @@ class CRM_Core_FieldOptionsTest extends CiviUnitTestCase { * Assure CRM_Core_PseudoConstant::get() is working properly for a range of * DAO fields having a tag in the XML schema. */ - function testOptionValues() { + public function testOptionValues() { /** * baoName/field combinations to test * Format: array[BAO Name] = $properties, where properties is an array whose diff --git a/tests/phpunit/CRM/Core/InnoDBIndexerTest.php b/tests/phpunit/CRM/Core/InnoDBIndexerTest.php index 4d340a2e6e..c4d67df5cb 100644 --- a/tests/phpunit/CRM/Core/InnoDBIndexerTest.php +++ b/tests/phpunit/CRM/Core/InnoDBIndexerTest.php @@ -6,7 +6,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Class CRM_Core_InnoDBIndexerTest */ class CRM_Core_InnoDBIndexerTest extends CiviUnitTestCase { - function tearDown() { + public function tearDown() { // May or may not cleanup well if there's a bug in the indexer. // This is better than nothing -- and better than duplicating the // cleanup logic. @@ -16,7 +16,7 @@ class CRM_Core_InnoDBIndexerTest extends CiviUnitTestCase { parent::tearDown(); } - function testHasDeclaredIndex() { + public function testHasDeclaredIndex() { $idx = new CRM_Core_InnoDBIndexer(TRUE, array( 'civicrm_contact' => array( array('first_name', 'last_name'), @@ -42,7 +42,7 @@ class CRM_Core_InnoDBIndexerTest extends CiviUnitTestCase { /** * When disabled, there is no FTS index, so queries that rely on FTS index fail. */ - function testDisabled() { + public function testDisabled() { $idx = new CRM_Core_InnoDBIndexer(FALSE, array( 'civicrm_contact' => array( array('first_name', 'last_name'), @@ -61,7 +61,7 @@ class CRM_Core_InnoDBIndexerTest extends CiviUnitTestCase { /** * When enabled, the FTS index is created, so queries that rely on FTS work. */ - function testEnabled() { + public function testEnabled() { if (!$this->supportsFts()) { $this->markTestSkipped("Local installation of InnoDB does not support FTS."); return; @@ -77,7 +77,7 @@ class CRM_Core_InnoDBIndexerTest extends CiviUnitTestCase { CRM_Core_DAO::executeQuery('SELECT id FROM civicrm_contact WHERE MATCH(first_name,last_name) AGAINST ("joe")'); } - function supportsFts() { + public function supportsFts() { return version_compare(CRM_Core_DAO::singleValueQuery('SELECT VERSION()'), '5.6.0', '>='); } } diff --git a/tests/phpunit/CRM/Core/JobManagerTest.php b/tests/phpunit/CRM/Core/JobManagerTest.php index 75b8d47136..26d66f7cbc 100644 --- a/tests/phpunit/CRM/Core/JobManagerTest.php +++ b/tests/phpunit/CRM/Core/JobManagerTest.php @@ -31,11 +31,11 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Core_JobManagerTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } - function testHookCron() { + public function testHookCron() { $hook = $this->getMock('stdClass', array('civicrm_cron')); $hook->expects($this->once()) ->method('civicrm_cron') diff --git a/tests/phpunit/CRM/Core/ManagedEntitiesTest.php b/tests/phpunit/CRM/Core/ManagedEntitiesTest.php index b38809b0b2..537abfc8e6 100644 --- a/tests/phpunit/CRM/Core/ManagedEntitiesTest.php +++ b/tests/phpunit/CRM/Core/ManagedEntitiesTest.php @@ -23,7 +23,7 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase { protected $fixtures; - function setUp() { + public function setUp() { parent::setUp(); $this->modules = array( 'one' => new CRM_Core_Module('com.example.one', TRUE), @@ -58,7 +58,7 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase { $this->apiKernel->registerApiProvider($this->adhocProvider); } - function tearDown() { + public function tearDown() { parent::tearDown(); CRM_Core_DAO::singleValueQuery('DELETE FROM civicrm_managed'); CRM_Core_DAO::singleValueQuery('DELETE FROM civicrm_option_value WHERE name like "CRM_Example_%"'); @@ -70,7 +70,7 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase { * to (1) create 'foo' entity, (2) create 'bar' entity', (3) remove 'foo' * entity */ - function testAddRemoveEntitiesModule_UpdateAlways_DeleteAlways() { + public function testAddRemoveEntitiesModule_UpdateAlways_DeleteAlways() { $decls = array(); // create first managed entity ('foo') @@ -119,7 +119,7 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase { * Set up an active module with one managed-entity and, over * time, the content of the entity changes */ - function testModifyDeclaration_UpdateAlways() { + public function testModifyDeclaration_UpdateAlways() { $decls = array(); // create first managed entity ('foo') @@ -145,7 +145,7 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase { * Set up an active module with one managed-entity and, over * time, the content of the entity changes */ - function testModifyDeclaration_UpdateNever() { + public function testModifyDeclaration_UpdateNever() { $decls = array(); // create first managed entity ('foo') @@ -175,7 +175,7 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase { * ensure that the policy is followed (ie the entity is not * deleted). */ - function testRemoveDeclaration_CleanupNever() { + public function testRemoveDeclaration_CleanupNever() { $decls = array(); // create first managed entity ('foo') @@ -204,7 +204,7 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase { * ensure that the policy is followed (ie the entity is not * deleted). */ - function testRemoveDeclaration_CleanupUnused() { + public function testRemoveDeclaration_CleanupUnused() { $decls = array(); // create first managed entity ('foo') @@ -255,7 +255,7 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase { /** * Setup an active module with a malformed entity declaration */ - function testInvalidDeclarationModule() { + public function testInvalidDeclarationModule() { // create first managed entity ('foo') $decls = array(); $decls[] = array( @@ -280,7 +280,7 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase { /** * Setup an active module with a malformed entity declaration */ - function testMissingName() { + public function testMissingName() { // create first managed entity ('foo') $decls = array(); $decls[] = array( @@ -305,7 +305,7 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase { /** * Setup an active module with a malformed entity declaration */ - function testMissingEntity() { + public function testMissingEntity() { // create first managed entity ('foo') $decls = array(); $decls[] = array( @@ -331,7 +331,7 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase { * Setup an active module with an entity -- then disable and re-enable the * module */ - function testDeactivateReactivateModule() { + public function testDeactivateReactivateModule() { // create first managed entity ('foo') $decls = array(); $decls[] = $this->fixtures['com.example.one-foo']; @@ -365,7 +365,7 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase { * Setup an active module with an entity -- then entirely uninstall the * module */ - function testUninstallModule() { + public function testUninstallModule() { // create first managed entity ('foo') $decls = array(); $decls[] = $this->fixtures['com.example.one-foo']; diff --git a/tests/phpunit/CRM/Core/MenuTest.php b/tests/phpunit/CRM/Core/MenuTest.php index a1a406e969..0111d97417 100644 --- a/tests/phpunit/CRM/Core/MenuTest.php +++ b/tests/phpunit/CRM/Core/MenuTest.php @@ -7,7 +7,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Core_MenuTest extends CiviUnitTestCase { - function pathArguments() { + public function pathArguments() { $cases = array(); // array(0 => string $input, 1 => array $expectedOutput) //$cases[] = array(NULL, array()); //$cases[] = array('', array()); @@ -38,7 +38,7 @@ class CRM_Core_MenuTest extends CiviUnitTestCase { * @param $expectedArray * @dataProvider pathArguments */ - function testGetArrayForPathArgs($inputString, $expectedArray) { + public function testGetArrayForPathArgs($inputString, $expectedArray) { $actual = CRM_Core_Menu::getArrayForPathArgs($inputString); $this->assertEquals($expectedArray, $actual); } diff --git a/tests/phpunit/CRM/Core/Page/RedirectTest.php b/tests/phpunit/CRM/Core/Page/RedirectTest.php index 30e55b42bf..e7268a0096 100644 --- a/tests/phpunit/CRM/Core/Page/RedirectTest.php +++ b/tests/phpunit/CRM/Core/Page/RedirectTest.php @@ -6,7 +6,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Class CRM_Core_Page_RedirectTest */ class CRM_Core_Page_RedirectTest extends CiviUnitTestCase { - function examples() { + public function examples() { $cases = array(); // $cases[] = array(string $requestPath, string $requestArgs, string $pageArgs, string $expectedUrl) diff --git a/tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php b/tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php index 154b13d4c4..b52b068dd1 100644 --- a/tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php +++ b/tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php @@ -14,7 +14,7 @@ class CRM_Core_Payment_AuthorizeNetIPNTest extends CiviUnitTestCase { protected $_contributionPageID; protected $_paymentProcessorID; - function setUp() { + public function setUp() { parent::setUp(); $this->_paymentProcessorID = $this->paymentProcessorCreate(array( 'payment_processor_type_id' => 'AuthNet', @@ -29,14 +29,14 @@ class CRM_Core_Payment_AuthorizeNetIPNTest extends CiviUnitTestCase { $this->_contributionPageID = $contributionPage['id']; } - function tearDown() { + public function tearDown() { $this->quickCleanUpFinancialEntities(); } /** * Test IPN response updates contribution_recur & contribution for first & second contribution */ - function testIPNPaymentRecurSuccess() { + public function testIPNPaymentRecurSuccess() { $this->setupRecurringPaymentProcessorTransaction(); $paypalIPN = new CRM_Core_Payment_AuthorizeNetIPN($this->getRecurTransaction()); $paypalIPN->main(); @@ -57,7 +57,7 @@ class CRM_Core_Payment_AuthorizeNetIPNTest extends CiviUnitTestCase { /** * Test IPN response updates contribution_recur & contribution for first & second contribution */ - function testIPNPaymentMembershipRecurSuccess() { + public function testIPNPaymentMembershipRecurSuccess() { $this->setupMembershipRecurringPaymentProcessorTransaction(); $paypalIPN = new CRM_Core_Payment_AuthorizeNetIPN($this->getRecurTransaction()); $paypalIPN->main(); @@ -80,7 +80,7 @@ class CRM_Core_Payment_AuthorizeNetIPNTest extends CiviUnitTestCase { /** * */ - function getRecurTransaction() { + public function getRecurTransaction() { return array( "x_amount" => "200.00", "x_country" => 'US', @@ -132,7 +132,7 @@ class CRM_Core_Payment_AuthorizeNetIPNTest extends CiviUnitTestCase { /** * @return array */ - function getRecurSubsequentTransaction() { + public function getRecurSubsequentTransaction() { return array_merge($this->getRecurTransaction(), array( 'x_trans_id' => 'second_one', 'x_MD5_Hash' => 'EA7A3CD65A85757827F51212CA1486A8', diff --git a/tests/phpunit/CRM/Core/Payment/AuthorizeNetTest.php b/tests/phpunit/CRM/Core/Payment/AuthorizeNetTest.php index 9442c84488..df1b9cc10d 100644 --- a/tests/phpunit/CRM/Core/Payment/AuthorizeNetTest.php +++ b/tests/phpunit/CRM/Core/Payment/AuthorizeNetTest.php @@ -34,7 +34,7 @@ require_once 'CiviTest/AuthorizeNet.php'; */ class CRM_Core_Payment_AuthorizeNetTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); $this->paymentProcessor = new AuthorizeNet(); $this->processorParams = $this->paymentProcessor->create(); @@ -54,7 +54,7 @@ class CRM_Core_Payment_AuthorizeNetTest extends CiviUnitTestCase { $GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK'] = array( ); } - function tearDown() { + public function tearDown() { $this->paymentProcessor->delete($this->processorParams->id); $this->quickCleanUpFinancialEntities(); } @@ -64,7 +64,7 @@ class CRM_Core_Payment_AuthorizeNetTest extends CiviUnitTestCase { * * Test works but not both due to some form of caching going on in the SmartySingleton */ - function testCreateSingleNowDated() { + public function testCreateSingleNowDated() { $firstName = 'John_' . substr(sha1(rand()), 0, 7); $lastName = 'Smith_' . substr(sha1(rand()), 0, 7); $nameParams = array('first_name' => $firstName, 'last_name' => $lastName); @@ -195,7 +195,7 @@ class CRM_Core_Payment_AuthorizeNetTest extends CiviUnitTestCase { /** * Create a single post dated payment as a recurring transaction */ - function testCreateSinglePostDated() { + public function testCreateSinglePostDated() { $start_date = date('Ymd', strtotime("+ 1 week")); $firstName = 'John_' . substr(sha1(rand()), 0, 7); diff --git a/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php b/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php index 36f20ff565..009db94534 100644 --- a/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php +++ b/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php @@ -51,7 +51,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { protected $objects; public $DBResetRequired = FALSE; - function setUp() { + public function setUp() { parent::setUp(); $this->input = $this->ids = $this->objects = array(); $this->IPN = new CRM_Core_Payment_AuthorizeNetIPN($this->input); @@ -104,7 +104,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { $this->objects['contribution'] = $contribution; } - function tearDown() { + public function tearDown() { $this->quickCleanUpFinancialEntities(); CRM_Member_PseudoConstant::membershipType(NULL, TRUE); CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'name', TRUE); @@ -114,7 +114,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { * Test the LoadObjects function with recurring membership data * */ - function testLoadMembershipObjects() { + public function testLoadMembershipObjects() { $this->_setUpMembershipObjects(); $this->_setUpRecurringContribution(); $this->IPN->loadObjects($this->input, $this->ids, $this->objects, FALSE, $this->_processorId); @@ -129,7 +129,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { * Test the LoadObjects function with recurring membership data * */ - function testLoadMembershipObjectsLoadAll() { + public function testLoadMembershipObjectsLoadAll() { $this->_setUpMembershipObjects(); $this->_setUpRecurringContribution(); unset($this->ids['membership']); @@ -148,7 +148,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { * Test the LoadObjects function with recurring membership data * */ - function testsendMailMembershipObjects() { + public function testsendMailMembershipObjects() { $this->_setUpMembershipObjects(); $values = array(); $this->IPN->loadObjects($this->input, $this->ids, $this->objects, FALSE, $this->_processorId); @@ -163,7 +163,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { * Test the LoadObjects function with recurring membership data * */ - function testsendMailMembershipWithoutLoadObjects() { + public function testsendMailMembershipWithoutLoadObjects() { $this->_setUpMembershipObjects(); $values = array(); $msg = $this->IPN->sendMail($this->input, $this->ids, $this->objects, $values, FALSE, TRUE); @@ -176,7 +176,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { /** * Test that loadObjects works with participant values */ - function testLoadParticipantObjects() { + public function testLoadParticipantObjects() { $this->_setUpParticipantObjects(); $this->IPN->loadObjects($this->input, $this->ids, $this->objects, FALSE, $this->_processorId); $this->assertFalse(empty($this->objects['participant']), 'in line ' . __LINE__); @@ -191,7 +191,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { /** * Test the LoadObjects function with a participant */ - function testComposeMailParticipant() { + public function testComposeMailParticipant() { $this->_setUpParticipantObjects(); $this->IPN->loadObjects($this->input, $this->ids, $this->objects, FALSE, $this->_processorId); $values = array(); @@ -204,7 +204,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { /** * */ - function testComposeMailParticipantObjects() { + public function testComposeMailParticipantObjects() { $this->_setUpParticipantObjects(); $values = array(); $msg = $this->IPN->sendMail($this->input, $this->ids, $this->objects, $values, FALSE, TRUE); @@ -217,7 +217,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { /** * Test the LoadObjects function with recurring membership data */ - function testsendMailParticipantObjectsCheckLog() { + public function testsendMailParticipantObjectsCheckLog() { $this->_setUpParticipantObjects(); $values = array(); require_once 'CiviTest/CiviMailUtils.php'; @@ -235,7 +235,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { /** * Test the LoadObjects function with recurring membership data */ - function testsendMailParticipantObjectsNoMail() { + public function testsendMailParticipantObjectsNoMail() { $this->_setUpParticipantObjects(); $event = new CRM_Event_BAO_Event(); $event->id = $this->_eventId; @@ -257,7 +257,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { /** * Test that loadObjects works with participant values */ - function testLoadPledgeObjects() { + public function testLoadPledgeObjects() { $this->_setUpPledgeObjects(); $this->IPN->loadObjects($this->input, $this->ids, $this->objects, FALSE, $this->_processorId); $this->assertFalse(empty($this->objects['pledge_payment'][0]), 'in line ' . __LINE__); @@ -275,7 +275,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { /** * Test that loadObjects works with participant values */ - function testLoadPledgeObjectsInvalidPledgeID() { + public function testLoadPledgeObjectsInvalidPledgeID() { $this->_setUpPledgeObjects(); $this->ids['pledge_payment'][0] = 0; $result = $this->IPN->loadObjects($this->input, $this->ids, $this->objects, TRUE, NULL, array('return_error' => 1)); @@ -304,7 +304,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { * Test the LoadObjects function with a pledge * */ - function testsendMailPledge() { + public function testsendMailPledge() { $this->_setUpPledgeObjects(); $values = array(); $this->IPN->loadObjects($this->input, $this->ids, $this->objects, FALSE, NULL); @@ -316,7 +316,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { * Test that an error is returned if required set & no contribution page * */ - function testRequiredWithoutProcessorID() { + public function testRequiredWithoutProcessorID() { $this->_setUpPledgeObjects(); $values = array(); $result = $this->IPN->loadObjects($this->input, $this->ids, $this->objects, TRUE, NULL, array('return_error' => 1)); @@ -334,7 +334,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { * * Test that an error is not if required set & no processor ID */ - function testRequiredWithContributionPage() { + public function testRequiredWithContributionPage() { $this->_setUpContributionObjects(TRUE); $result = $this->IPN->loadObjects($this->input, $this->ids, $this->objects, TRUE, NULL, array('return_error' => 1)); @@ -345,7 +345,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { * Test that an error is returned if required set & contribution page exists * */ - function testRequiredWithContributionPageError() { + public function testRequiredWithContributionPageError() { $this->_setUpContributionObjects(); $values = array(); $result = $this->IPN->loadObjects($this->input, $this->ids, $this->objects, TRUE, NULL, array('return_error' => 1)); @@ -364,7 +364,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { * fully but the calls to the POST happen in more than one function * keeping this as good example of data to bring back to life later - function testMainFunctionActions(){ + public function testMainFunctionActions(){ $ids = $objects = array( ); $input['component'] = 'Contribute'; $postedParams = array( @@ -440,7 +440,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { * * @param bool $contributionPage */ - function _setUpContributionObjects($contributionPage = FALSE) { + public function _setUpContributionObjects($contributionPage = FALSE) { $contribution = new CRM_Contribute_BAO_Contribution(); @@ -475,7 +475,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { /** * Prepare for membership test */ - function _setUpMembershipObjects() { + public function _setUpMembershipObjects() { try { $this->_membershipTypeID = $this->membershipTypeCreate(); $this->_membershipStatusID = $this->membershipStatusCreate('test status'); @@ -523,7 +523,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { $this->ids['membership'] = $this->_membershipId; } - function _setUpRecurringContribution() { + public function _setUpRecurringContribution() { $this->_contributionRecurParams = array( 'contact_id' => $this->_contactId, 'amount' => 150.00, @@ -550,7 +550,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { /** * Set up participant requirements for test */ - function _setUpParticipantObjects() { + public function _setUpParticipantObjects() { $event = $this->eventCreate(array('is_email_confirm' => 1)); $this->assertAPISuccess($event, 'line ' . __LINE__ . ' set-up of event'); $this->_eventId = $event['id']; @@ -585,7 +585,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { /** * Set up participant requirements for test */ - function _setUpPledgeObjects() { + public function _setUpPledgeObjects() { $this->_pledgeId = $this->pledgeCreate($this->_contactId); //we'll create membership payment here because to make setup more re-usable $pledgePayment = civicrm_api('pledge_payment', 'create', array( diff --git a/tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php b/tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php index 8ec5535b82..a086ef82d6 100644 --- a/tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php +++ b/tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php @@ -39,7 +39,7 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase { protected $_contributionPageID; protected $_paymentProcessorID; - function setUp() { + public function setUp() { parent::setUp(); $this->_paymentProcessorID = $this->paymentProcessorCreate(); $this->_contactID = $this->individualCreate(); @@ -53,14 +53,14 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase { $this->_contributionPageID = $contributionPage['id']; } - function tearDown() { + public function tearDown() { $this->quickCleanUpFinancialEntities(); } /** * Test IPN response updates contribution_recur & contribution for first & second contribution */ - function testIPNPaymentRecurSuccess() { + public function testIPNPaymentRecurSuccess() { $this->setupRecurringPaymentProcessorTransaction(); $paypalIPN = new CRM_Core_Payment_PayPalProIPN($this->getPaypalProRecurTransaction()); $paypalIPN->main(); @@ -81,7 +81,7 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase { /** * Test IPN response updates contribution_recur & contribution for first & second contribution */ - function testIPNPaymentMembershipRecurSuccess() { + public function testIPNPaymentMembershipRecurSuccess() { $this->setupMembershipRecurringPaymentProcessorTransaction(); $this->callAPISuccessGetSingle('membership_payment', array()); $paypalIPN = new CRM_Core_Payment_PayPalProIPN($this->getPaypalProRecurTransaction()); @@ -112,7 +112,7 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase { * It seems likely that may change in future & this test will start failing (I point this out in the hope it * will help future debuggers) */ - function testIPNPaymentCRM13743() { + public function testIPNPaymentCRM13743() { $this->setupRecurringPaymentProcessorTransaction(); $firstPaymentParams = $this->getPaypalProRecurTransaction(); $firstPaymentParams['txn_type'] = 'recurring_payment_failed'; @@ -150,7 +150,7 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase { * * Obviously if the behaviour is fixed then the test should be updated! */ - function testIPNPaymentExpressNoError() { + public function testIPNPaymentExpressNoError() { $this->setupRecurringPaymentProcessorTransaction(); $paypalIPN = new CRM_Core_Payment_PayPalProIPN($this->getPaypalExpressTransactionIPN()); try{ @@ -170,7 +170,7 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase { * Get PaymentExpress IPN for a single transaction * @return array array representing a Paypal IPN POST */ - function getPaypalExpressTransactionIPN() { + public function getPaypalExpressTransactionIPN() { return array( 'mc_gross' => '200.00', 'invoice' => $this->_invoiceID, @@ -219,7 +219,7 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase { * Get IPN results from follow on IPN transactions * @return array array representing a Paypal IPN POST */ - function getSubsequentPaypalExpressTransaction() { + public function getSubsequentPaypalExpressTransaction() { return array( 'mc_gross' => '5.00', 'period_type' => ' Regular', @@ -275,7 +275,7 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase { /** * */ - function getPaypalProRecurTransaction() { + public function getPaypalProRecurTransaction() { return array( 'amount' => '15.00', 'initial_payment_amount' => '0.00', @@ -329,7 +329,7 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase { /** * @return array */ - function getPaypalProRecurSubsequentTransaction() { + public function getPaypalProRecurSubsequentTransaction() { return array_merge($this->getPaypalProRecurTransaction(), array('txn_id' => 'secondone')); } } diff --git a/tests/phpunit/CRM/Core/PaymentTest.php b/tests/phpunit/CRM/Core/PaymentTest.php index cea19252e1..fe2306ab41 100644 --- a/tests/phpunit/CRM/Core/PaymentTest.php +++ b/tests/phpunit/CRM/Core/PaymentTest.php @@ -36,7 +36,7 @@ class CRM_Core_PaymentTest extends CiviUnitTestCase { /** * Test the payment method is adequately logged - we don't expect the processing to succeed */ - function testHandlePaymentMethodLogging() { + public function testHandlePaymentMethodLogging() { $params = array('processor_name' => 'Paypal', 'data' => 'blah'); try { CRM_Core_Payment::handlePaymentMethod('method', $params); diff --git a/tests/phpunit/CRM/Core/PseudoConstantTest.php b/tests/phpunit/CRM/Core/PseudoConstantTest.php index 9202b1b070..03b4b26117 100644 --- a/tests/phpunit/CRM/Core/PseudoConstantTest.php +++ b/tests/phpunit/CRM/Core/PseudoConstantTest.php @@ -32,7 +32,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); $this->loadAllFixtures(); @@ -45,7 +45,7 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { * Assure CRM_Core_PseudoConstant::get() is working properly for a range of * DAO fields having a tag in the XML schema. */ - function testOptionValues() { + public function testOptionValues() { // Create a custom field group for testing. $custom_group_name = md5(microtime()); @@ -1070,7 +1070,7 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { } } - function testContactTypes() { + public function testContactTypes() { $byName = array( 'Individual' => 'Individual', 'Household' => 'Household', diff --git a/tests/phpunit/CRM/Core/RegionTest.php b/tests/phpunit/CRM/Core/RegionTest.php index 27f41df94e..a9dfb8467a 100644 --- a/tests/phpunit/CRM/Core/RegionTest.php +++ b/tests/phpunit/CRM/Core/RegionTest.php @@ -6,7 +6,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Class CRM_Core_RegionTest */ class CRM_Core_RegionTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); require_once 'CRM/Core/Smarty.php'; require_once 'CRM/Core/Region.php'; @@ -20,7 +20,7 @@ class CRM_Core_RegionTest extends CiviUnitTestCase { * When a {crmRegion} is blank and when there are no extra snippets, the * output is blank. */ - function testBlank() { + public function testBlank() { $smarty = CRM_Core_Smarty::singleton(); $actual = $smarty->fetch('string:{crmRegion name=testBlank}{/crmRegion}'); $expected = ''; @@ -31,7 +31,7 @@ class CRM_Core_RegionTest extends CiviUnitTestCase { * When a {crmRegion} is not blank and when there are no extra snippets, * the output is only determined by the {crmRegion} block. */ - function testDefault() { + public function testDefault() { $smarty = CRM_Core_Smarty::singleton(); $actual = $smarty->fetch('string:{crmRegion name=testDefault}default
{/crmRegion}'); $expected = 'default
'; @@ -41,7 +41,7 @@ class CRM_Core_RegionTest extends CiviUnitTestCase { /** * Disable the normal content of a {crmRegion} and apply different content from a snippet */ - function testOverride() { + public function testOverride() { CRM_Core_Region::instance('testOverride')->update('default', array( 'disabled' => TRUE, )); @@ -58,7 +58,7 @@ class CRM_Core_RegionTest extends CiviUnitTestCase { /** * Test that each of the major content formats are correctly evaluated */ - function testAllTypes() { + public function testAllTypes() { CRM_Core_Region::instance('testAllTypes')->add(array( 'markup' => 'some-markup
', )); @@ -116,7 +116,7 @@ class CRM_Core_RegionTest extends CiviUnitTestCase { /** * Test of nested arrangement in which one {crmRegion} directly includes another {crmRegion} */ - function testDirectNest() { + public function testDirectNest() { CRM_Core_Region::instance('testDirectNestOuter')->add(array( 'template' => 'string:O={$snippet.weight} ', 'weight' => -5, @@ -144,7 +144,7 @@ class CRM_Core_RegionTest extends CiviUnitTestCase { /** * Test of nested arrangement in which one {crmRegion} is enhanced with a snippet which, in turn, includes another {crmRegion} */ - function testIndirectNest() { + public function testIndirectNest() { CRM_Core_Region::instance('testIndirectNestOuter')->add(array( // Note: all three $snippet references are bound to the $snippet which caused this template to be included, // regardless of any nested {crmRegion}s @@ -164,7 +164,7 @@ class CRM_Core_RegionTest extends CiviUnitTestCase { /** * Output from an inner-region should not be executed verbatim; this is obvious but good to verify */ - function testNoInjection() { + public function testNoInjection() { CRM_Core_Region::instance('testNoInjectionOuter')->add(array( 'template' => 'string:{$snippet.scarystuff} ', 'scarystuff' => '{$is_outer_scary}', @@ -187,7 +187,7 @@ class CRM_Core_RegionTest extends CiviUnitTestCase { * Make sure that standard Smarty variables ($smarty->assign(...)) as well * as the magical $snippet variable both evaluate correctly. */ - function testSmartyVars() { + public function testSmartyVars() { $smarty = CRM_Core_Smarty::singleton(); $smarty->assign('extrainfo', 'one'); CRM_Core_Region::instance('testSmartyVars')->add(array( @@ -204,7 +204,7 @@ class CRM_Core_RegionTest extends CiviUnitTestCase { $this->assertEquals($expected, $actual); } - function testWeight() { + public function testWeight() { CRM_Core_Region::instance('testWeight')->add(array( 'markup' => 'prepend-5
', 'weight' => -5, diff --git a/tests/phpunit/CRM/Core/ResourcesTest.php b/tests/phpunit/CRM/Core/ResourcesTest.php index aa0872f766..9b3f66a808 100644 --- a/tests/phpunit/CRM/Core/ResourcesTest.php +++ b/tests/phpunit/CRM/Core/ResourcesTest.php @@ -42,7 +42,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase { */ protected $mapper; - function setUp() { + public function setUp() { parent::setUp(); list ($this->basedir, $this->container, $this->mapper) = $this->_createMapper(); @@ -56,7 +56,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase { civicrm_smarty_register_string_resource( ); } - function testAddScriptFile() { + public function testAddScriptFile() { $this->res ->addScriptFile('com.example.ext', 'foo%20bar.js', 0, 'testAddScriptFile') ->addScriptFile('com.example.ext', 'foo%20bar.js', 0, 'testAddScriptFile') // extra @@ -77,7 +77,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase { * * FIXME: This can't work because the tests run in English and CRM_Core_Resources optimizes * away the English data from $settings['strings'] - function testAddScriptFile_strings() { + public function testAddScriptFile_strings() { file_put_contents($this->mapper->keyToBasePath('com.example.ext') . '/hello.js', 'alert(ts("Hello world"));'); $this->res->addScriptFile('com.example.ext', 'hello.js', 0, 'testAddScriptFile_strings'); $settings = $this->res->getSettings(); @@ -86,7 +86,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase { } */ - function testAddScriptURL() { + public function testAddScriptURL() { $this->res ->addScriptUrl('/whiz/foo%20bar.js', 0, 'testAddScriptURL') ->addScriptUrl('/whiz/foo%20bar.js', 0, 'testAddScriptURL') // extra @@ -102,7 +102,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase { $this->assertEquals($expected, $actual); } - function testAddScript() { + public function testAddScript() { $this->res ->addScript('alert("hi");', 0, 'testAddScript') ->addScript('alert("there");', 0, 'testAddScript') @@ -117,7 +117,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase { $this->assertEquals($expected, $actual); } - function testAddVars() { + public function testAddVars() { $this->res ->addVars('food', array('fruit' => array('mine' => 'apple', 'ours' => 'banana'))) ->addVars('food', array('fruit' => array('mine' => 'new apple', 'yours' => 'orange'))) @@ -128,7 +128,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase { ); } - function testAddSetting() { + public function testAddSetting() { $this->res ->addSetting(array('fruit' => array('mine' => 'apple'))) ->addSetting(array('fruit' => array('yours' => 'orange'))) @@ -142,7 +142,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase { $this->assertTrue(strpos($actual, $expected) !== FALSE); } - function testAddSettingFactory() { + public function testAddSettingFactory() { $this->res->addSettingsFactory(function() { return array('fruit' => array('yours' => 'orange')); }); @@ -155,7 +155,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase { $this->assertTreeEquals($expected, $actual); } - function testAddSettingAndSettingFactory() { + public function testAddSettingAndSettingFactory() { $this->res->addSetting(array('fruit' => array('mine' => 'apple'))); $muckableValue = array('fruit' => array('yours' => 'orange', 'theirs' => 'apricot')); @@ -174,7 +174,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase { $this->assertTreeEquals($expected, $actual); } - function testCrmJS() { + public function testCrmJS() { $smarty = CRM_Core_Smarty::singleton(); $actual = $smarty->fetch('string:{crmScript ext=com.example.ext file=foo%20bar.js region=testCrmJS}'); @@ -191,7 +191,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase { $this->assertEquals($expected, $actual); } - function testAddStyleFile() { + public function testAddStyleFile() { $this->res ->addStyleFile('com.example.ext', 'foo%20bar.css', 0, 'testAddStyleFile') ->addStyleFile('com.example.ext', 'foo%20bar.css', 0, 'testAddStyleFile') // extra @@ -207,7 +207,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase { $this->assertEquals($expected, $actual); } - function testAddStyleURL() { + public function testAddStyleURL() { $this->res ->addStyleUrl('/whiz/foo%20bar.css', 0, 'testAddStyleURL') ->addStyleUrl('/whiz/foo%20bar.css', 0, 'testAddStyleURL') // extra @@ -223,7 +223,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase { $this->assertEquals($expected, $actual); } - function testAddStyle() { + public function testAddStyle() { $this->res ->addStyle('body { background: black; }', 0, 'testAddStyle') ->addStyle('body { text-color: black; }', 0, 'testAddStyle') @@ -238,7 +238,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase { $this->assertEquals($expected, $actual); } - function testCrmCSS() { + public function testCrmCSS() { $smarty = CRM_Core_Smarty::singleton(); $actual = $smarty->fetch('string:{crmStyle ext=com.example.ext file=foo%20bar.css region=testCrmCSS}'); @@ -255,7 +255,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase { $this->assertEquals($expected, $actual); } - function testGetURL() { + public function testGetURL() { $this->assertEquals( 'http://core-app/dir/file%20name.txt', $this->res->getURL('civicrm', 'dir/file%20name.txt') @@ -274,7 +274,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase { ); } - function testCrmResURL() { + public function testCrmResURL() { $smarty = CRM_Core_Smarty::singleton(); $actual = $smarty->fetch('string:{crmResURL ext=com.example.ext file=foo%20bar.png}'); @@ -294,7 +294,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase { * @internal param string $appendPathGarbage * @return array(string $basedir, CRM_Extension_Container_Interface, CRM_Extension_Mapper) */ - function _createMapper(CRM_Utils_Cache_Interface $cache = NULL, $cacheKey = NULL) { + public function _createMapper(CRM_Utils_Cache_Interface $cache = NULL, $cacheKey = NULL) { $basedir = rtrim($this->createTempDir('ext-'), '/'); mkdir("$basedir/com.example.ext"); file_put_contents("$basedir/com.example.ext/info.xml", "oddball"); diff --git a/tests/phpunit/CRM/Core/Smarty/plugins/CrmScopeTest.php b/tests/phpunit/CRM/Core/Smarty/plugins/CrmScopeTest.php index 3f3c3c729a..d5255c8d2a 100644 --- a/tests/phpunit/CRM/Core/Smarty/plugins/CrmScopeTest.php +++ b/tests/phpunit/CRM/Core/Smarty/plugins/CrmScopeTest.php @@ -6,7 +6,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Class CRM_Core_Smarty_plugins_CrmScopeTest */ class CRM_Core_Smarty_plugins_CrmScopeTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); require_once 'CRM/Core/Smarty.php'; @@ -18,7 +18,7 @@ class CRM_Core_Smarty_plugins_CrmScopeTest extends CiviUnitTestCase { /** * @return array */ - function scopeCases() { + public function scopeCases() { $cases = array(); $cases[] = array('', '{crmScope}{/crmScope}'); $cases[] = array('', '{crmScope x=1}{/crmScope}'); @@ -36,7 +36,7 @@ class CRM_Core_Smarty_plugins_CrmScopeTest extends CiviUnitTestCase { /** * @dataProvider scopeCases */ - function testBlank($expected, $input) { + public function testBlank($expected, $input) { $smarty = CRM_Core_Smarty::singleton(); $actual = $smarty->fetch('string:' . $input); $this->assertEquals($expected, $actual, "Process input=[$input]"); diff --git a/tests/phpunit/CRM/Core/TransactionTest.php b/tests/phpunit/CRM/Core/TransactionTest.php index e154457348..41d88bfacf 100644 --- a/tests/phpunit/CRM/Core/TransactionTest.php +++ b/tests/phpunit/CRM/Core/TransactionTest.php @@ -20,21 +20,21 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase { */ private $cids; - function setUp() { + public function setUp() { parent::setUp(); $this->quickCleanup(array('civicrm_contact', 'civicrm_activity')); $this->callbackLog = array(); $this->cids = array(); } - function dataCreateStyle() { + public function dataCreateStyle() { return array( array('sql-insert'), array('bao-create'), ); } - function dataCreateAndCommitStyles() { + public function dataCreateAndCommitStyles() { return array( array('sql-insert', 'implicit-commit'), array('sql-insert', 'explicit-commit'), @@ -48,7 +48,7 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase { * @param string $commitStyle 'implicit-commit'|'explicit-commit' * @dataProvider dataCreateAndCommitStyles */ - function testBasicCommit($createStyle, $commitStyle) { + public function testBasicCommit($createStyle, $commitStyle) { $this->createContactWithTransaction('reuse-tx', $createStyle, $commitStyle); $this->assertCount(1, $this->cids); $this->assertContactsExistByOffset(array(0 => TRUE)); @@ -57,7 +57,7 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase { /** * @dataProvider dataCreateStyle */ - function testBasicRollback($createStyle) { + public function testBasicRollback($createStyle) { $this->createContactWithTransaction('reuse-tx', $createStyle, 'rollback'); $this->assertCount(1, $this->cids); $this->assertContactsExistByOffset(array(0 => FALSE)); @@ -71,7 +71,7 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase { * @param string $commitStyle 'implicit-commit'|'explicit-commit' * @dataProvider dataCreateAndCommitStyles */ - function testBatchRollback($createStyle, $commitStyle) { + public function testBatchRollback($createStyle, $commitStyle) { $this->runBatch( 'reuse-tx', array( @@ -95,7 +95,7 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase { * @param string $commitStyle 'implicit-commit'|'explicit-commit' * @dataProvider dataCreateAndCommitStyles */ - function testMixedBatchCommit_nesting($createStyle, $commitStyle) { + public function testMixedBatchCommit_nesting($createStyle, $commitStyle) { $this->runBatch( 'reuse-tx', array( @@ -120,7 +120,7 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase { * @param string $commitStyle 'implicit-commit'|'explicit-commit' * @dataProvider dataCreateAndCommitStyles */ - function testMixedBatchCommit_reuse($createStyle, $commitStyle) { + public function testMixedBatchCommit_reuse($createStyle, $commitStyle) { $this->runBatch( 'reuse-tx', array( @@ -144,7 +144,7 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase { * @param string $commitStyle 'implicit-commit'|'explicit-commit' * @dataProvider dataCreateAndCommitStyles */ - function testMixedBatchRollback_nesting($createStyle, $commitStyle) { + public function testMixedBatchRollback_nesting($createStyle, $commitStyle) { $this->assertFalse(CRM_Core_Transaction::isActive()); $this->runBatch( 'reuse-tx', @@ -346,7 +346,7 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase { * @param string $outcome 'rollback'|'implicit-commit'|'explicit-commit' how to finish transaction * @return int cid */ - function runBatch($nesting, $callbacks, $existsByOffset, $outcome) { + public function runBatch($nesting, $callbacks, $existsByOffset, $outcome) { if ($nesting != 'reuse-tx' && $nesting != 'nest-tx') { throw new RuntimeException('Bad test data: nesting=' . $nesting); } @@ -371,19 +371,19 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase { } // else: implicit-commit } - function _preCommit($arg1, $arg2) { + public function _preCommit($arg1, $arg2) { $this->callbackLog[] = array('_preCommit', $arg1, $arg2); } - function _postCommit($arg1, $arg2) { + public function _postCommit($arg1, $arg2) { $this->callbackLog[] = array('_postCommit', $arg1, $arg2); } - function _preRollback($arg1, $arg2) { + public function _preRollback($arg1, $arg2) { $this->callbackLog[] = array('_preRollback', $arg1, $arg2); } - function _postRollback($arg1, $arg2) { + public function _postRollback($arg1, $arg2) { $this->callbackLog[] = array('_postRollback', $arg1, $arg2); } } diff --git a/tests/phpunit/CRM/Dedupe/DedupeFinderTest.php b/tests/phpunit/CRM/Dedupe/DedupeFinderTest.php index c3eac71f4e..0b5518bab3 100644 --- a/tests/phpunit/CRM/Dedupe/DedupeFinderTest.php +++ b/tests/phpunit/CRM/Dedupe/DedupeFinderTest.php @@ -6,7 +6,7 @@ require_once 'CiviTest/Contact.php'; * Class CRM_Dedupe_DedupeFinderTest */ class CRM_Dedupe_DedupeFinderTest extends CiviUnitTestCase { - function testFuzzyDupes() { + public function testFuzzyDupes() { // make dupe checks based on based on following contact sets: // FIRST - LAST - EMAIL // --------------------------------- @@ -121,7 +121,7 @@ class CRM_Dedupe_DedupeFinderTest extends CiviUnitTestCase { civicrm_api('group', 'delete', $params); } - function testDupesByParams() { + public function testDupesByParams() { // make dupe checks based on based on following contact sets: // FIRST - LAST - EMAIL // --------------------------------- diff --git a/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php b/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php index 6ed404e227..9798dd5522 100644 --- a/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php +++ b/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php @@ -37,13 +37,13 @@ require_once 'CiviTest/Participant.php'; */ class CRM_Event_BAO_AdditionalPaymentTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); $this->_contactId = Contact::createIndividual(); $this->_eventId = Event::create($this->_contactId); } - function tearDown() { + public function tearDown() { $this->eventDelete($this->_eventId); $this->quickCleanup( array( @@ -68,7 +68,7 @@ class CRM_Event_BAO_AdditionalPaymentTest extends CiviUnitTestCase { * @return array * @throws Exception */ - function _addParticipantWithPayment($feeTotal, $actualPaidAmt) { + public function _addParticipantWithPayment($feeTotal, $actualPaidAmt) { // creating price set, price field $paramsSet['title'] = 'Price Set'; $paramsSet['name'] = CRM_Utils_String::titleToVar('Price Set'); @@ -165,7 +165,7 @@ class CRM_Event_BAO_AdditionalPaymentTest extends CiviUnitTestCase { } // CRM-13964 - function testAddPartialPayment() { + public function testAddPartialPayment() { $feeAmt = 100; $amtPaid = 60; $balance = $feeAmt - $amtPaid; diff --git a/tests/phpunit/CRM/Event/BAO/ParticipantStatusTest.php b/tests/phpunit/CRM/Event/BAO/ParticipantStatusTest.php index ba951665a3..1722d798a6 100644 --- a/tests/phpunit/CRM/Event/BAO/ParticipantStatusTest.php +++ b/tests/phpunit/CRM/Event/BAO/ParticipantStatusTest.php @@ -56,7 +56,7 @@ class CRM_Event_BAO_ParticipantStatusTest extends CiviUnitTestCase { /** * create() and deleteParticipantStatusType() method */ - function testCreateAndDelete() { + public function testCreateAndDelete() { // create using required params $params = array( @@ -83,7 +83,7 @@ class CRM_Event_BAO_ParticipantStatusTest extends CiviUnitTestCase { /** * add() method (add and edit modes of participant status type) */ - function testAddStatusType() { + public function testAddStatusType() { $params = array( 'name' => 'testStatus', @@ -122,7 +122,7 @@ class CRM_Event_BAO_ParticipantStatusTest extends CiviUnitTestCase { /** * Retrieve() method of participant status type */ - function testRetrieveStatusType() { + public function testRetrieveStatusType() { $params = array( 'name' => 'testStatus', @@ -150,7 +150,7 @@ class CRM_Event_BAO_ParticipantStatusTest extends CiviUnitTestCase { /** * SetIsActive() method of participant status type */ - function testSetIsActiveStatusType() { + public function testSetIsActiveStatusType() { $params = array( 'name' => 'testStatus', diff --git a/tests/phpunit/CRM/Event/BAO/ParticipantTest.php b/tests/phpunit/CRM/Event/BAO/ParticipantTest.php index e756252cbd..36f1e30e02 100644 --- a/tests/phpunit/CRM/Event/BAO/ParticipantTest.php +++ b/tests/phpunit/CRM/Event/BAO/ParticipantTest.php @@ -37,7 +37,7 @@ require_once 'CiviTest/Participant.php'; */ class CRM_Event_BAO_ParticipantTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); $this->_contactId = Contact::createIndividual(); $this->_eventId = Event::create($this->_contactId); @@ -46,7 +46,7 @@ class CRM_Event_BAO_ParticipantTest extends CiviUnitTestCase { /** * Add() method (add and edit modes of participant) */ - function testAdd() { + public function testAdd() { $params = array( 'send_receipt' => 1, 'is_test' => 0, @@ -93,7 +93,7 @@ class CRM_Event_BAO_ParticipantTest extends CiviUnitTestCase { /** * GetValues() method (fetch value of participant) */ - function testgetValuesWithValidParams() { + public function testgetValuesWithValidParams() { $participantId = Participant::create($this->_contactId, $this->_eventId); $params = array('id' => $participantId); $values = $ids = array(); @@ -137,7 +137,7 @@ class CRM_Event_BAO_ParticipantTest extends CiviUnitTestCase { /** * GetValues() method (checking for behavior when params are empty ) */ - function testgetValuesWithoutValidParams() { + public function testgetValuesWithoutValidParams() { $params = $values = $ids = array(); $participantId = Participant::create($this->_contactId, $this->_eventId); $fetchParticipant = CRM_Event_BAO_Participant::getValues($params, $values, $ids); @@ -150,7 +150,7 @@ class CRM_Event_BAO_ParticipantTest extends CiviUnitTestCase { /** * EventFull() method (checking the event for full ) */ - function testEventFull() { + public function testEventFull() { $eventParams = array( 'max_participants' => 1, 'id' => $this->_eventId, @@ -170,7 +170,7 @@ class CRM_Event_BAO_ParticipantTest extends CiviUnitTestCase { /** * ImportableFields() method ( Checking the Event's Importable Fields ) */ - function testimportableFields() { + public function testimportableFields() { $importableFields = CRM_Event_BAO_Participant::importableFields(); $this->assertNotEquals(count($importableFields), 0, 'Checking array not to be empty.'); @@ -181,7 +181,7 @@ class CRM_Event_BAO_ParticipantTest extends CiviUnitTestCase { /** * ParticipantDetails() method ( Checking the Participant Details ) */ - function testparticipantDetails() { + public function testparticipantDetails() { $participantId = Participant::create($this->_contactId, $this->_eventId); $params = array('name' => 'Doe, John', 'title' => 'Test Event'); @@ -199,7 +199,7 @@ class CRM_Event_BAO_ParticipantTest extends CiviUnitTestCase { /** * DeleteParticipant() method ( Delete a Participant ) */ - function testdeleteParticipant() { + public function testdeleteParticipant() { $params = array( 'send_receipt' => 1, 'is_test' => 0, @@ -233,7 +233,7 @@ class CRM_Event_BAO_ParticipantTest extends CiviUnitTestCase { /** * CheckDuplicate() method ( Checking for Duplicate Participant returns array of participant id) */ - function testcheckDuplicate() { + public function testcheckDuplicate() { $duplicate = array(); //Creating 3 new participants @@ -263,7 +263,7 @@ class CRM_Event_BAO_ParticipantTest extends CiviUnitTestCase { /** * Create() method (create and updation of participant) */ - function testCreate() { + public function testCreate() { $params = array( 'send_receipt' => 1, 'is_test' => 0, @@ -332,7 +332,7 @@ class CRM_Event_BAO_ParticipantTest extends CiviUnitTestCase { /** * ExportableFields() method ( Exportable Fields for Participant) */ - function testexportableFields() { + public function testexportableFields() { $exportableFields = CRM_Event_BAO_Participant::exportableFields(); $this->assertNotEquals(count($exportableFields), 0, 'Checking array not to be empty.'); @@ -343,7 +343,7 @@ class CRM_Event_BAO_ParticipantTest extends CiviUnitTestCase { /** * FixEventLevel() method (Setting ',' values), resolveDefaults(assinging value to array) method */ - function testfixEventLevel() { + public function testfixEventLevel() { $paramsSet['title'] = 'Price Set'; $paramsSet['name'] = CRM_Utils_String::titleToVar('Price Set'); diff --git a/tests/phpunit/CRM/Extension/BrowserTest.php b/tests/phpunit/CRM/Extension/BrowserTest.php index 08e5d5e16c..dc600fa133 100644 --- a/tests/phpunit/CRM/Extension/BrowserTest.php +++ b/tests/phpunit/CRM/Extension/BrowserTest.php @@ -6,36 +6,36 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Class CRM_Extension_BrowserTest */ class CRM_Extension_BrowserTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } - function tearDown() { + public function tearDown() { parent::tearDown(); } - function testDisabled() { + public function testDisabled() { $browser = new CRM_Extension_Browser(FALSE, '/index.html', 'file:///itd/oesn/tmat/ter'); $this->assertEquals(FALSE, $browser->isEnabled()); $this->assertEquals(array(), $browser->checkRequirements()); $this->assertEquals(array(), $browser->getExtensions()); } - function testCheckRequirements_BadCachedir_false() { + public function testCheckRequirements_BadCachedir_false() { $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) .'/dataset/good-repository', '/index.html', FALSE); $this->assertEquals(TRUE, $browser->isEnabled()); $reqs = $browser->checkRequirements(); $this->assertEquals(1, count($reqs)); } - function testCheckRequirements_BadCachedir_nonexistent() { + public function testCheckRequirements_BadCachedir_nonexistent() { $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) .'/dataset/good-repository', '/index.html', '/tot/all/yin/v/alid'); $this->assertEquals(TRUE, $browser->isEnabled()); $reqs = $browser->checkRequirements(); $this->assertEquals(1, count($reqs)); } - function testGetExtensions_good() { + public function testGetExtensions_good() { $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) .'/dataset/good-repository', '/index.html', $this->createTempDir('ext-cache-')); $this->assertEquals(TRUE, $browser->isEnabled()); $this->assertEquals(array(), $browser->checkRequirements()); @@ -49,7 +49,7 @@ class CRM_Extension_BrowserTest extends CiviUnitTestCase { $this->assertEquals('http://example.com/test.crm.extension.browsertest.b-1.2.zip', $exts['test.crm.extension.browsertest.b']->downloadUrl); } - function testGetExtension_good() { + public function testGetExtension_good() { $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) .'/dataset/good-repository', '/index.html', $this->createTempDir('ext-cache-')); $this->assertEquals(TRUE, $browser->isEnabled()); $this->assertEquals(array(), $browser->checkRequirements()); @@ -59,7 +59,7 @@ class CRM_Extension_BrowserTest extends CiviUnitTestCase { $this->assertEquals('http://example.com/test.crm.extension.browsertest.b-1.2.zip', $info->downloadUrl); } - function testGetExtension_nonexistent() { + public function testGetExtension_nonexistent() { $browser = new CRM_Extension_Browser('file://' . dirname(__FILE__) .'/dataset/good-repository', '/index.html', $this->createTempDir('ext-cache-')); $this->assertEquals(TRUE, $browser->isEnabled()); $this->assertEquals(array(), $browser->checkRequirements()); diff --git a/tests/phpunit/CRM/Extension/Container/BasicTest.php b/tests/phpunit/CRM/Extension/Container/BasicTest.php index e9c59eeac7..db372bf810 100644 --- a/tests/phpunit/CRM/Extension/Container/BasicTest.php +++ b/tests/phpunit/CRM/Extension/Container/BasicTest.php @@ -6,26 +6,26 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Class CRM_Extension_Container_BasicTest */ class CRM_Extension_Container_BasicTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } - function tearDown() { + public function tearDown() { parent::tearDown(); } - function testGetKeysEmpty() { + public function testGetKeysEmpty() { $basedir = $this->createTempDir('ext-empty-'); $c = new CRM_Extension_Container_Basic($basedir, 'http://example/basedir', NULL, NULL); $this->assertEquals($c->getKeys(), array()); } - function testGetKeys() { + public function testGetKeys() { list($basedir, $c) = $this->_createContainer(); $this->assertEquals($c->getKeys(), array('test.foo', 'test.foo.bar')); } - function testGetPath() { + public function testGetPath() { list($basedir, $c) = $this->_createContainer(); try { $c->getPath('un.kno.wn'); @@ -38,7 +38,7 @@ class CRM_Extension_Container_BasicTest extends CiviUnitTestCase { $this->assertEquals("$basedir/foo/bar", $c->getPath('test.foo.bar')); } - function testGetPath_extraSlashFromConfig() { + public function testGetPath_extraSlashFromConfig() { list($basedir, $c) = $this->_createContainer(NULL, NULL, '/'); try { $c->getPath('un.kno.wn'); @@ -51,7 +51,7 @@ class CRM_Extension_Container_BasicTest extends CiviUnitTestCase { $this->assertEquals("$basedir/foo/bar", $c->getPath('test.foo.bar')); } - function testGetResUrl() { + public function testGetResUrl() { list($basedir, $c) = $this->_createContainer(); try { $c->getResUrl('un.kno.wn'); @@ -64,7 +64,7 @@ class CRM_Extension_Container_BasicTest extends CiviUnitTestCase { $this->assertEquals('http://example/basedir/foo/bar', $c->getResUrl('test.foo.bar')); } - function testGetResUrl_extraSlashFromConfig() { + public function testGetResUrl_extraSlashFromConfig() { list($basedir, $c) = $this->_createContainer(NULL, NULL, '/'); try { $c->getResUrl('un.kno.wn'); @@ -77,7 +77,7 @@ class CRM_Extension_Container_BasicTest extends CiviUnitTestCase { $this->assertEquals('http://example/basedir/foo/bar', $c->getResUrl('test.foo.bar')); } - function testCaching() { + public function testCaching() { $cache = new CRM_Utils_Cache_Arraycache(array()); $this->assertTrue(!is_array($cache->get('basic-scan'))); list($basedir, $c) = $this->_createContainer($cache, 'basic-scan'); @@ -95,7 +95,7 @@ class CRM_Extension_Container_BasicTest extends CiviUnitTestCase { * * @return array */ - function _createContainer(CRM_Utils_Cache_Interface $cache = NULL, $cacheKey = NULL, $appendPathGarbage = '') { + public function _createContainer(CRM_Utils_Cache_Interface $cache = NULL, $cacheKey = NULL, $appendPathGarbage = '') { $basedir = rtrim($this->createTempDir('ext-'), '/'); mkdir("$basedir/foo"); mkdir("$basedir/foo/bar"); @@ -107,7 +107,7 @@ class CRM_Extension_Container_BasicTest extends CiviUnitTestCase { return array($basedir, $c); } - function testConvertPathsToUrls() { + public function testConvertPathsToUrls() { $relPaths = array( 'foo.bar' => 'foo\bar', 'whiz.bang' => 'tests\extensions\whiz\bang' diff --git a/tests/phpunit/CRM/Extension/Container/CollectionTest.php b/tests/phpunit/CRM/Extension/Container/CollectionTest.php index 2d132e80ea..7677e5b45c 100644 --- a/tests/phpunit/CRM/Extension/Container/CollectionTest.php +++ b/tests/phpunit/CRM/Extension/Container/CollectionTest.php @@ -34,25 +34,25 @@ class CRM_Extension_Container_CollectionTest extends CiviUnitTestCase { // WARNING - NEVER COPY & PASTE $_eNoticeCompliant = FALSE // new test classes should be compliant. public $_eNoticeCompliant = FALSE; - function setUp() { + public function setUp() { parent::setUp(); } - function tearDown() { + public function tearDown() { parent::tearDown(); } - function testGetKeysEmpty() { + public function testGetKeysEmpty() { $c = new CRM_Extension_Container_Collection(array()); $this->assertEquals($c->getKeys(), array()); } - function testGetKeys() { + public function testGetKeys() { $c = $this->_createContainer(); $this->assertEquals(array('test.conflict', 'test.whiz', 'test.whizbang', 'test.foo', 'test.foo.bar'), $c->getKeys()); } - function testGetPath() { + public function testGetPath() { $c = $this->_createContainer(); try { $c->getPath('un.kno.wn'); @@ -68,7 +68,7 @@ class CRM_Extension_Container_CollectionTest extends CiviUnitTestCase { $this->assertEquals("/path/to/conflict-b", $c->getPath('test.conflict')); } - function testGetResUrl() { + public function testGetResUrl() { $c = $this->_createContainer(); try { $c->getResUrl('un.kno.wn'); @@ -84,7 +84,7 @@ class CRM_Extension_Container_CollectionTest extends CiviUnitTestCase { $this->assertEquals('http://conflict-b', $c->getResUrl('test.conflict')); } - function testCaching() { + public function testCaching() { $cache = new CRM_Utils_Cache_Arraycache(array()); $this->assertTrue(!is_array($cache->get('ext-collection'))); $c = $this->_createContainer($cache, 'ext-collection'); @@ -102,7 +102,7 @@ class CRM_Extension_Container_CollectionTest extends CiviUnitTestCase { * * @return CRM_Extension_Container_Collection */ - function _createContainer(CRM_Utils_Cache_Interface $cache = NULL, $cacheKey = NULL) { + public function _createContainer(CRM_Utils_Cache_Interface $cache = NULL, $cacheKey = NULL) { $containers = array(); $containers['a'] = new CRM_Extension_Container_Static(array( 'test.foo' => array( diff --git a/tests/phpunit/CRM/Extension/Container/StaticTest.php b/tests/phpunit/CRM/Extension/Container/StaticTest.php index 4a45474184..4d199b7896 100644 --- a/tests/phpunit/CRM/Extension/Container/StaticTest.php +++ b/tests/phpunit/CRM/Extension/Container/StaticTest.php @@ -6,25 +6,25 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Class CRM_Extension_Container_StaticTest */ class CRM_Extension_Container_StaticTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } - function tearDown() { + public function tearDown() { parent::tearDown(); } - function testGetKeysEmpty() { + public function testGetKeysEmpty() { $c = new CRM_Extension_Container_Static(array()); $this->assertEquals($c->getKeys(), array()); } - function testGetKeys() { + public function testGetKeys() { $c = $this->_createContainer(); $this->assertEquals($c->getKeys(), array('test.foo', 'test.foo.bar')); } - function testGetPath() { + public function testGetPath() { $c = $this->_createContainer(); try { $c->getPath('un.kno.wn'); @@ -37,7 +37,7 @@ class CRM_Extension_Container_StaticTest extends CiviUnitTestCase { $this->assertEquals("/path/to/bar", $c->getPath('test.foo.bar')); } - function testGetResUrl() { + public function testGetResUrl() { $c = $this->_createContainer(); try { $c->getResUrl('un.kno.wn'); @@ -53,7 +53,7 @@ class CRM_Extension_Container_StaticTest extends CiviUnitTestCase { /** * @return CRM_Extension_Container_Static */ - function _createContainer() { + public function _createContainer() { return new CRM_Extension_Container_Static(array( 'test.foo' => array( 'path' => '/path/to/foo', diff --git a/tests/phpunit/CRM/Extension/InfoTest.php b/tests/phpunit/CRM/Extension/InfoTest.php index 03150a12c8..6ce2aea4cb 100644 --- a/tests/phpunit/CRM/Extension/InfoTest.php +++ b/tests/phpunit/CRM/Extension/InfoTest.php @@ -6,19 +6,19 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Class CRM_Extension_InfoTest */ class CRM_Extension_InfoTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); $this->file = NULL; } - function tearDown() { + public function tearDown() { if ($this->file) { unlink($this->file); } parent::tearDown(); } - function testGood_file() { + public function testGood_file() { $this->file = tempnam(sys_get_temp_dir(), 'infoxml-'); file_put_contents($this->file, "foozamboni"); @@ -28,7 +28,7 @@ class CRM_Extension_InfoTest extends CiviUnitTestCase { $this->assertEquals('zamboni', $info->typeInfo['extra']); } - function testBad_file() { + public function testBad_file() { // vs file> $this->file = tempnam(sys_get_temp_dir(), 'infoxml-'); file_put_contents($this->file, "file>foo"); @@ -42,7 +42,7 @@ class CRM_Extension_InfoTest extends CiviUnitTestCase { $this->assertTrue(is_object($exc)); } - function testGood_string() { + public function testGood_string() { $data = "foozamboni"; $info = CRM_Extension_Info::loadFromString($data); @@ -51,7 +51,7 @@ class CRM_Extension_InfoTest extends CiviUnitTestCase { $this->assertEquals('zamboni', $info->typeInfo['extra']); } - function testBad_string() { + public function testBad_string() { // vs file> $data = "file>foo"; diff --git a/tests/phpunit/CRM/Extension/Manager/ModuleTest.php b/tests/phpunit/CRM/Extension/Manager/ModuleTest.php index 8a35cccf71..c3224d9b50 100644 --- a/tests/phpunit/CRM/Extension/Manager/ModuleTest.php +++ b/tests/phpunit/CRM/Extension/Manager/ModuleTest.php @@ -10,7 +10,7 @@ class CRM_Extension_Manager_ModuleTest extends CiviUnitTestCase { // WARNING - NEVER COPY & PASTE $_eNoticeCompliant = FALSE // new test classes should be compliant. public $_eNoticeCompliant = FALSE; - function setUp() { + public function setUp() { parent::setUp(); // $query = "INSERT INTO civicrm_domain ( name, version ) VALUES ( 'domain', 3 )"; // $result = CRM_Core_DAO::executeQuery($query); @@ -24,7 +24,7 @@ class CRM_Extension_Manager_ModuleTest extends CiviUnitTestCase { $this->setExtensionSystem($this->system); } - function tearDown() { + public function tearDown() { parent::tearDown(); $this->system = NULL; } @@ -32,7 +32,7 @@ class CRM_Extension_Manager_ModuleTest extends CiviUnitTestCase { /** * Install an extension with a valid type name */ - function testInstallDisableUninstall() { + public function testInstallDisableUninstall() { $manager = $this->system->getManager(); $this->assertModuleActiveByName(FALSE, 'moduletest'); @@ -73,7 +73,7 @@ class CRM_Extension_Manager_ModuleTest extends CiviUnitTestCase { /** * Install an extension with a valid type name */ - function testInstallDisableEnable() { + public function testInstallDisableEnable() { $manager = $this->system->getManager(); $this->assertModuleActiveByName(FALSE, 'moduletest'); $this->assertModuleActiveByKey(FALSE, 'test.extension.manager.moduletest'); @@ -112,7 +112,7 @@ class CRM_Extension_Manager_ModuleTest extends CiviUnitTestCase { /** * Install an extension then forcibly remove the code and cleanup DB afterwards. */ - function testInstall_DirtyRemove_Disable_Uninstall() { + public function testInstall_DirtyRemove_Disable_Uninstall() { // create temporary extension (which can dirtily remove later) $this->_createExtension('test.extension.manager.module.auto1', 'module', 'test_extension_manager_module_auto1'); $mainfile = $this->basedir . '/test.extension.manager.module.auto1/test_extension_manager_module_auto1.php'; @@ -165,7 +165,7 @@ class CRM_Extension_Manager_ModuleTest extends CiviUnitTestCase { /** * Install an extension then forcibly remove the code and cleanup DB afterwards. */ - function testInstall_DirtyRemove_Disable_Restore() { + public function testInstall_DirtyRemove_Disable_Restore() { // create temporary extension (which can dirtily remove later) $this->_createExtension('test.extension.manager.module.auto2', 'module', 'test_extension_manager_module_auto2'); $mainfile = $this->basedir . '/test.extension.manager.module.auto2/test_extension_manager_module_auto2.php'; @@ -221,7 +221,7 @@ class CRM_Extension_Manager_ModuleTest extends CiviUnitTestCase { * @param $module * @param array $counts expected hook invocation counts ($hookName => $count) */ - function assertHookCounts($module, $counts) { + public function assertHookCounts($module, $counts) { global $_test_extension_manager_moduletest_counts; foreach ($counts as $key => $expected) { $actual = @$_test_extension_manager_moduletest_counts[$module][$key]; @@ -235,7 +235,7 @@ class CRM_Extension_Manager_ModuleTest extends CiviUnitTestCase { * @param $expectedIsActive * @param $prefix */ - function assertModuleActiveByName($expectedIsActive, $prefix) { + public function assertModuleActiveByName($expectedIsActive, $prefix) { $activeModules = CRM_Core_PseudoConstant::getModuleExtensions(TRUE); // FIXME foreach ($activeModules as $activeModule) { if ($activeModule['prefix'] == $prefix) { @@ -250,7 +250,7 @@ class CRM_Extension_Manager_ModuleTest extends CiviUnitTestCase { * @param $expectedIsActive * @param $key */ - function assertModuleActiveByKey($expectedIsActive, $key) { + public function assertModuleActiveByKey($expectedIsActive, $key) { foreach (CRM_Core_Module::getAll() as $module) { if ($module->name == $key) { $this->assertEquals((bool)$expectedIsActive, (bool)$module->is_active); @@ -266,7 +266,7 @@ class CRM_Extension_Manager_ModuleTest extends CiviUnitTestCase { * @param $file * @param string $template */ - function _createExtension($key, $type, $file, $template = self::MODULE_TEMPLATE) { + public function _createExtension($key, $type, $file, $template = self::MODULE_TEMPLATE) { $basedir = $this->basedir; mkdir("$basedir/$key"); file_put_contents("$basedir/$key/info.xml", "$file"); diff --git a/tests/phpunit/CRM/Extension/Manager/PaymentTest.php b/tests/phpunit/CRM/Extension/Manager/PaymentTest.php index b97c168391..1cd0b75b97 100644 --- a/tests/phpunit/CRM/Extension/Manager/PaymentTest.php +++ b/tests/phpunit/CRM/Extension/Manager/PaymentTest.php @@ -34,7 +34,7 @@ class CRM_Extension_Manager_PaymentTest extends CiviUnitTestCase { // WARNING - NEVER COPY & PASTE $_eNoticeCompliant = FALSE // new test classes should be compliant. public $_eNoticeCompliant = FALSE; - function setUp() { + public function setUp() { parent::setUp(); if (class_exists('test_extension_manager_paymenttest')) { test_extension_manager_paymenttest::$counts = array(); @@ -46,7 +46,7 @@ class CRM_Extension_Manager_PaymentTest extends CiviUnitTestCase { $this->quickCleanup(array('civicrm_payment_processor')); } - function tearDown() { + public function tearDown() { parent::tearDown(); $this->system = NULL; $this->quickCleanup(array('civicrm_payment_processor')); @@ -56,7 +56,7 @@ class CRM_Extension_Manager_PaymentTest extends CiviUnitTestCase { /** * Install an extension with a valid type name */ - function testInstallDisableUninstall() { + public function testInstallDisableUninstall() { $manager = $this->system->getManager(); $this->assertDBQuery(0, 'SELECT count(*) FROM civicrm_payment_processor_type WHERE class_name = "test.extension.manager.paymenttest"'); $manager->install(array('test.extension.manager.paymenttest')); @@ -76,7 +76,7 @@ class CRM_Extension_Manager_PaymentTest extends CiviUnitTestCase { /** * Install an extension with a valid type name */ - function testInstallDisableEnable() { + public function testInstallDisableEnable() { $manager = $this->system->getManager(); $this->assertDBQuery(0, 'SELECT count(*) FROM civicrm_payment_processor_type WHERE class_name = "test.extension.manager.paymenttest"'); @@ -98,7 +98,7 @@ class CRM_Extension_Manager_PaymentTest extends CiviUnitTestCase { * Install an extension and create a payment processor which uses it. * Attempts to uninstall fail */ - function testInstall_Add_FailUninstall() { + public function testInstall_Add_FailUninstall() { $manager = $this->system->getManager(); $this->assertDBQuery(0, 'SELECT count(*) FROM civicrm_payment_processor_type WHERE class_name = "test.extension.manager.paymenttest"'); diff --git a/tests/phpunit/CRM/Extension/Manager/ReportTest.php b/tests/phpunit/CRM/Extension/Manager/ReportTest.php index 5ad2495278..d866db5468 100644 --- a/tests/phpunit/CRM/Extension/Manager/ReportTest.php +++ b/tests/phpunit/CRM/Extension/Manager/ReportTest.php @@ -6,7 +6,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Class CRM_Extension_Manager_ReportTest */ class CRM_Extension_Manager_ReportTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); //if (class_exists('test_extension_manager_reporttest')) { // test_extension_manager_reporttest::$counts = array(); @@ -17,14 +17,14 @@ class CRM_Extension_Manager_ReportTest extends CiviUnitTestCase { )); } - function tearDown() { + public function tearDown() { parent::tearDown(); } /** * Install an extension with a valid type name */ - function testInstallDisableUninstall() { + public function testInstallDisableUninstall() { $manager = $this->system->getManager(); $this->assertDBQuery(0, 'SELECT count(*) FROM civicrm_option_value WHERE name = "test.extension.manager.reporttest"'); @@ -42,7 +42,7 @@ class CRM_Extension_Manager_ReportTest extends CiviUnitTestCase { /** * Install an extension with a valid type name */ - function testInstallDisableEnable() { + public function testInstallDisableEnable() { $manager = $this->system->getManager(); $this->assertDBQuery(0, 'SELECT count(*) FROM civicrm_option_value WHERE name = "test.extension.manager.reporttest"'); diff --git a/tests/phpunit/CRM/Extension/Manager/SearchTest.php b/tests/phpunit/CRM/Extension/Manager/SearchTest.php index 90a2f933d1..ab0eb3e98d 100644 --- a/tests/phpunit/CRM/Extension/Manager/SearchTest.php +++ b/tests/phpunit/CRM/Extension/Manager/SearchTest.php @@ -6,7 +6,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Class CRM_Extension_Manager_SearchTest */ class CRM_Extension_Manager_SearchTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); //if (class_exists('test_extension_manager_searchtest')) { // test_extension_manager_searchtest::$counts = array(); @@ -17,7 +17,7 @@ class CRM_Extension_Manager_SearchTest extends CiviUnitTestCase { )); } - function tearDown() { + public function tearDown() { parent::tearDown(); $this->system = NULL; } @@ -25,7 +25,7 @@ class CRM_Extension_Manager_SearchTest extends CiviUnitTestCase { /** * Install an extension with a valid type name */ - function testInstallDisableUninstall() { + public function testInstallDisableUninstall() { $manager = $this->system->getManager(); $this->assertDBQuery(0, 'SELECT count(*) FROM civicrm_option_value WHERE name = "test.extension.manager.searchtest"'); @@ -43,7 +43,7 @@ class CRM_Extension_Manager_SearchTest extends CiviUnitTestCase { /** * Install an extension with a valid type name */ - function testInstallDisableEnable() { + public function testInstallDisableEnable() { $manager = $this->system->getManager(); $this->assertDBQuery(0, 'SELECT count(*) FROM civicrm_option_value WHERE name = "test.extension.manager.searchtest"'); diff --git a/tests/phpunit/CRM/Extension/ManagerTest.php b/tests/phpunit/CRM/Extension/ManagerTest.php index 8801942bfe..51b327e312 100644 --- a/tests/phpunit/CRM/Extension/ManagerTest.php +++ b/tests/phpunit/CRM/Extension/ManagerTest.php @@ -33,13 +33,13 @@ class CRM_Extension_ManagerTest extends CiviUnitTestCase { const TESTING_TYPE = 'report'; const OTHER_TESTING_TYPE = 'module'; - function setUp() { + public function setUp() { parent::setUp(); list ($this->basedir, $this->container) = $this->_createContainer(); $this->mapper = new CRM_Extension_Mapper($this->container); } - function tearDown() { + public function tearDown() { parent::tearDown(); } @@ -48,7 +48,7 @@ class CRM_Extension_ManagerTest extends CiviUnitTestCase { * * @expectedException CRM_Extension_Exception */ - function testInstallInvalidType() { + public function testInstallInvalidType() { $testingTypeManager = $this->getMock('CRM_Extension_Manager_Interface'); $testingTypeManager->expects($this->never()) ->method('onPreInstall'); @@ -65,7 +65,7 @@ class CRM_Extension_ManagerTest extends CiviUnitTestCase { * the second. This controls for bad SQL queries which hit either * "the first row" or "all rows". */ - function testInstall_Disable_Uninstall() { + public function testInstall_Disable_Uninstall() { $testingTypeManager = $this->getMock('CRM_Extension_Manager_Interface'); $manager = $this->_createManager(array( self::TESTING_TYPE => $testingTypeManager, @@ -108,7 +108,7 @@ class CRM_Extension_ManagerTest extends CiviUnitTestCase { * Install an extension and then harshly remove the underlying source. * Subseuently disable and uninstall. */ - function testInstall_DirtyRemove_Disable_Uninstall() { + public function testInstall_DirtyRemove_Disable_Uninstall() { $testingTypeManager = $this->getMock('CRM_Extension_Manager_Interface'); $manager = $this->_createManager(array( self::TESTING_TYPE => $testingTypeManager, @@ -146,7 +146,7 @@ class CRM_Extension_ManagerTest extends CiviUnitTestCase { /** * Install an extension with a valid type name */ - function testInstall_Disable_Enable() { + public function testInstall_Disable_Enable() { $testingTypeManager = $this->getMock('CRM_Extension_Manager_Interface'); $manager = $this->_createManager(array( self::TESTING_TYPE => $testingTypeManager, @@ -188,7 +188,7 @@ class CRM_Extension_ManagerTest extends CiviUnitTestCase { /** * Performing 'install' on a 'disabled' extension performs an 'enable' */ - function testInstall_Disable_Install() { + public function testInstall_Disable_Install() { $testingTypeManager = $this->getMock('CRM_Extension_Manager_Interface'); $manager = $this->_createManager(array( self::TESTING_TYPE => $testingTypeManager, @@ -226,7 +226,7 @@ class CRM_Extension_ManagerTest extends CiviUnitTestCase { /** * Install an extension with a valid type name */ - function testEnableBare() { + public function testEnableBare() { $testingTypeManager = $this->getMock('CRM_Extension_Manager_Interface'); $manager = $this->_createManager(array( self::TESTING_TYPE => $testingTypeManager, @@ -252,7 +252,7 @@ class CRM_Extension_ManagerTest extends CiviUnitTestCase { /** * Get the status of an unknown extension */ - function testStatusUnknownKey() { + public function testStatusUnknownKey() { $testingTypeManager = $this->getMock('CRM_Extension_Manager_Interface'); $testingTypeManager->expects($this->never()) ->method('onPreInstall'); @@ -265,7 +265,7 @@ class CRM_Extension_ManagerTest extends CiviUnitTestCase { /** * Replace code for an extension that doesn't exist in the container */ - function testReplace_Unknown() { + public function testReplace_Unknown() { $testingTypeManager = $this->getMock('CRM_Extension_Manager_Interface'); $manager = $this->_createManager(array( self::TESTING_TYPE => $testingTypeManager, @@ -291,7 +291,7 @@ class CRM_Extension_ManagerTest extends CiviUnitTestCase { /** * Replace code for an extension that doesn't exist in the container */ - function testReplace_Uninstalled() { + public function testReplace_Uninstalled() { $testingTypeManager = $this->getMock('CRM_Extension_Manager_Interface'); $manager = $this->_createManager(array( self::TESTING_TYPE => $testingTypeManager, @@ -322,7 +322,7 @@ class CRM_Extension_ManagerTest extends CiviUnitTestCase { * Note that some metadata changes between versions -- the original has * file="oddball", and the upgrade has file="newextension". */ - function testReplace_Installed() { + public function testReplace_Installed() { $testingTypeManager = $this->getMock('CRM_Extension_Manager_Interface'); $manager = $this->_createManager(array( self::TESTING_TYPE => $testingTypeManager, @@ -359,7 +359,7 @@ class CRM_Extension_ManagerTest extends CiviUnitTestCase { * Note that some metadata changes between versions -- the original has * file="oddball", and the upgrade has file="newextension". */ - function testReplace_InstalledMissing() { + public function testReplace_InstalledMissing() { $testingTypeManager = $this->getMock('CRM_Extension_Manager_Interface'); $manager = $this->_createManager(array( self::TESTING_TYPE => $testingTypeManager, @@ -399,7 +399,7 @@ class CRM_Extension_ManagerTest extends CiviUnitTestCase { * * @return CRM_Extension_Manager */ - function _createManager($typeManagers) { + public function _createManager($typeManagers) { //list ($basedir, $c) = $this->_createContainer(); $mapper = new CRM_Extension_Mapper($this->container); return new CRM_Extension_Manager($this->container, $this->container, $this->mapper, $typeManagers); @@ -411,7 +411,7 @@ class CRM_Extension_ManagerTest extends CiviUnitTestCase { * * @return array */ - function _createContainer(CRM_Utils_Cache_Interface $cache = NULL, $cacheKey = NULL) { + public function _createContainer(CRM_Utils_Cache_Interface $cache = NULL, $cacheKey = NULL) { $basedir = $this->createTempDir('ext-'); mkdir("$basedir/weird"); mkdir("$basedir/weird/foobar"); @@ -430,7 +430,7 @@ class CRM_Extension_ManagerTest extends CiviUnitTestCase { * * @return string */ - function _createDownload($key, $file) { + public function _createDownload($key, $file) { $basedir = $this->createTempDir('ext-dl-'); file_put_contents("$basedir/info.xml", "$file"); file_put_contents("$basedir/$file.php", "basedir, $this->container) = $this->_createContainer(); $this->mapper = new CRM_Extension_Mapper($this->container); @@ -15,48 +15,48 @@ class CRM_Extension_MapperTest extends CiviUnitTestCase { $this->mapperWithSlash = new CRM_Extension_Mapper($this->containerWithSlash); } - function tearDown() { + public function tearDown() { parent::tearDown(); } - function testClassToKey() { + public function testClassToKey() { $this->assertEquals("test.foo.bar", $this->mapper->classToKey('test_foo_bar')); } - function testClassToPath() { + public function testClassToPath() { $this->assertEquals("{$this->basedir}/weird/foobar/oddball.php", $this->mapper->classToPath('test_foo_bar')); } - function testIsExtensionClass() { + public function testIsExtensionClass() { $this->assertTrue($this->mapper->isExtensionClass('test_foo_bar')); $this->assertFalse($this->mapper->isExtensionClass('test.foo.bar')); $this->assertFalse($this->mapper->isExtensionClass('CRM_Core_DAO')); } - function testIsExtensionKey() { + public function testIsExtensionKey() { $this->assertFalse($this->mapper->isExtensionKey('test_foo_bar')); $this->assertTrue($this->mapper->isExtensionKey('test.foo.bar')); $this->assertFalse($this->mapper->isExtensionKey('CRM_Core_DAO')); } - function testGetTemplateName() { + public function testGetTemplateName() { $this->assertEquals("oddball.tpl", $this->mapper->getTemplateName('test_foo_bar')); } - function testGetTemplatePath() { + public function testGetTemplatePath() { $this->assertEquals("{$this->basedir}/weird/foobar/templates", $this->mapper->getTemplatePath('test_foo_bar')); } - function testKeyToClass() { + public function testKeyToClass() { $this->assertEquals("test_foo_bar", $this->mapper->keyToClass('test.foo.bar')); } - function testKeyToPath() { + public function testKeyToPath() { $this->assertEquals("{$this->basedir}/weird/foobar/oddball.php", $this->mapper->classToPath('test.foo.bar')); $this->assertEquals("{$this->basedir2}/weird/foobar/oddball.php", $this->mapperWithSlash->classToPath('test.foo.bar')); } - function testKeyToBasePath() { + public function testKeyToBasePath() { $this->assertEquals("{$this->basedir}/weird/foobar", $this->mapper->keyToBasePath('test.foo.bar')); $this->assertEquals("{$this->basedir2}/weird/foobar", $this->mapperWithSlash->keyToBasePath('test.foo.bar')); @@ -64,7 +64,7 @@ class CRM_Extension_MapperTest extends CiviUnitTestCase { $this->assertEquals(rtrim($civicrm_root, '/'), $this->mapper->keyToBasePath('civicrm')); } - function testKeyToUrl() { + public function testKeyToUrl() { $this->assertEquals("http://example/basedir/weird/foobar", $this->mapper->keyToUrl('test.foo.bar')); $this->assertEquals("http://example/basedir/weird/foobar", $this->mapperWithSlash->keyToUrl('test.foo.bar')); @@ -80,7 +80,7 @@ class CRM_Extension_MapperTest extends CiviUnitTestCase { * * @return array */ - function _createContainer(CRM_Utils_Cache_Interface $cache = NULL, $cacheKey = NULL, $appendPathGarbage = '') { + public function _createContainer(CRM_Utils_Cache_Interface $cache = NULL, $cacheKey = NULL, $appendPathGarbage = '') { /* $container = new CRM_Extension_Container_Static(array( 'test.foo.bar' => array( diff --git a/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php b/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php index f45469aa22..4e0e79f384 100644 --- a/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php +++ b/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php @@ -31,19 +31,19 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Financial_BAO_FinancialAccountTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); $this->organizationCreate(); } - function teardown() { + public function teardown() { $this->financialAccountDelete('Donations'); } /** * Check method add() */ - function testAdd() { + public function testAdd() { $params = array( 'name' => 'Donations', 'is_deductible' => 0, @@ -66,7 +66,7 @@ class CRM_Financial_BAO_FinancialAccountTest extends CiviUnitTestCase { /** * Check method retrive() */ - function testRetrieve() { + public function testRetrieve() { $params = array( 'name' => 'Donations', 'is_deductible' => 0, @@ -83,7 +83,7 @@ class CRM_Financial_BAO_FinancialAccountTest extends CiviUnitTestCase { /** * Check method setIsActive() */ - function testSetIsActive() { + public function testSetIsActive() { $params = array( 'name' => 'Donations', 'is_deductible' => 0, @@ -107,7 +107,7 @@ class CRM_Financial_BAO_FinancialAccountTest extends CiviUnitTestCase { /** * Check method del() */ - function testdel() { + public function testdel() { $params = array( 'name' => 'Donations', 'is_deductible' => 0, @@ -125,7 +125,7 @@ class CRM_Financial_BAO_FinancialAccountTest extends CiviUnitTestCase { /** * Check method getAccountingCode() */ - function testGetAccountingCode() { + public function testGetAccountingCode() { $params = array( 'name' => 'Donations', 'is_active' => 1, diff --git a/tests/phpunit/CRM/Financial/BAO/FinancialItemTest.php b/tests/phpunit/CRM/Financial/BAO/FinancialItemTest.php index c36774cd04..de6e15cbac 100755 --- a/tests/phpunit/CRM/Financial/BAO/FinancialItemTest.php +++ b/tests/phpunit/CRM/Financial/BAO/FinancialItemTest.php @@ -33,14 +33,14 @@ require_once 'CRM/Financial/BAO/FinancialAccount.php'; */ class CRM_Financial_BAO_FinancialItemTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } /** * Check method add() */ - function testAdd() { + public function testAdd() { $firstName = 'Shane'; $lastName = 'Whatson'; $params = array( @@ -89,7 +89,7 @@ class CRM_Financial_BAO_FinancialItemTest extends CiviUnitTestCase { /** * Check method retrive() */ - function testRetrieve() { + public function testRetrieve() { $firstName = 'Shane'; $lastName = 'Whatson'; $params = array( @@ -136,7 +136,7 @@ class CRM_Financial_BAO_FinancialItemTest extends CiviUnitTestCase { /** * Check method create() */ - function testCreate() { + public function testCreate() { $firstName = 'Shane'; $lastName = 'Whatson'; $params = array( @@ -212,7 +212,7 @@ class CRM_Financial_BAO_FinancialItemTest extends CiviUnitTestCase { /** * Check method del() */ - function testCreateEntityTrxn() { + public function testCreateEntityTrxn() { $fParams = array( 'name' => 'Donations'.substr(sha1(rand()), 0, 7), 'is_deductible' => 0, @@ -248,7 +248,7 @@ class CRM_Financial_BAO_FinancialItemTest extends CiviUnitTestCase { /** * Check method retrieveEntityFinancialTrxn() */ - function testRetrieveEntityFinancialTrxn() { + public function testRetrieveEntityFinancialTrxn() { $entityTrxn = self::testCreateEntityTrxn(); $params = array( 'entity_table' => 'civicrm_contribution', diff --git a/tests/phpunit/CRM/Financial/BAO/FinancialTypeAccountTest.php b/tests/phpunit/CRM/Financial/BAO/FinancialTypeAccountTest.php index fb4360b836..c28fcdb910 100755 --- a/tests/phpunit/CRM/Financial/BAO/FinancialTypeAccountTest.php +++ b/tests/phpunit/CRM/Financial/BAO/FinancialTypeAccountTest.php @@ -31,7 +31,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Financial_BAO_FinancialTypeAccountTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); $this->organizationCreate(); } @@ -39,7 +39,7 @@ class CRM_Financial_BAO_FinancialTypeAccountTest extends CiviUnitTestCase { /** * Check method add() */ - function testAdd() { + public function testAdd() { $params = array( 'name' => 'TestFinancialAccount_1', 'accounting_code' => 4800, @@ -75,7 +75,7 @@ class CRM_Financial_BAO_FinancialTypeAccountTest extends CiviUnitTestCase { /** * Check method del() */ - function testDel() { + public function testDel() { $params = array( 'name' => 'TestFinancialAccount_2', 'is_deductible' => 0, @@ -105,7 +105,7 @@ class CRM_Financial_BAO_FinancialTypeAccountTest extends CiviUnitTestCase { /** * Check method getFinancialAccount() */ - function testRetrieve() { + public function testRetrieve() { $params = array( 'name' => 'TestFinancialAccount_3', 'is_deductible' => 0, @@ -134,7 +134,7 @@ class CRM_Financial_BAO_FinancialTypeAccountTest extends CiviUnitTestCase { /** * Check method getFinancialAccount() */ - function testGetFinancialAccount() { + public function testGetFinancialAccount() { $params = array( 'name' => 'TestFinancialAccount', 'accounting_code' => 4800, @@ -163,7 +163,7 @@ class CRM_Financial_BAO_FinancialTypeAccountTest extends CiviUnitTestCase { /** * Check method getInstrumentFinancialAccount() */ - function testGetInstrumentFinancialAccount() { + public function testGetInstrumentFinancialAccount() { $paymentInstrumentValue = 1; $params = array( 'name' => 'Donations', diff --git a/tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php b/tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php index 342ed36ad8..dfda1823ee 100755 --- a/tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php +++ b/tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php @@ -31,18 +31,18 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Financial_BAO_FinancialTypeTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } - function teardown() { + public function teardown() { $this->financialAccountDelete('Donations'); } /** * Check method add() */ - function testAdd() { + public function testAdd() { $params = array( 'name' => 'Donations', 'is_active' => 1, @@ -64,7 +64,7 @@ class CRM_Financial_BAO_FinancialTypeTest extends CiviUnitTestCase { /** * Check method retrive() */ - function testRetrieve() { + public function testRetrieve() { $params = array( 'name' => 'Donations', 'is_active' => 1, @@ -83,7 +83,7 @@ class CRM_Financial_BAO_FinancialTypeTest extends CiviUnitTestCase { /** * Check method setIsActive() */ - function testSetIsActive() { + public function testSetIsActive() { $params = array( 'name' => 'Donations', 'is_deductible' => 0, @@ -106,7 +106,7 @@ class CRM_Financial_BAO_FinancialTypeTest extends CiviUnitTestCase { /** * Check method del() */ - function testDel() { + public function testDel() { $params = array( 'name' => 'Donations', 'is_deductible' => 0, diff --git a/tests/phpunit/CRM/Financial/BAO/PaymentProcessorTypeTest.php b/tests/phpunit/CRM/Financial/BAO/PaymentProcessorTypeTest.php index 4533d78863..f990ad5996 100755 --- a/tests/phpunit/CRM/Financial/BAO/PaymentProcessorTypeTest.php +++ b/tests/phpunit/CRM/Financial/BAO/PaymentProcessorTypeTest.php @@ -34,14 +34,14 @@ require_once 'CRM/Financial/BAO/FinancialTypeAccount.php'; */ class CRM_Financial_BAO_PaymentProcessorTypeTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } /** * Check method create() */ - function testCreate() { + public function testCreate() { $params = array( 'name' => 'Test_Payment_Processor', 'title' => 'Test Payment Processor', @@ -61,7 +61,7 @@ class CRM_Financial_BAO_PaymentProcessorTypeTest extends CiviUnitTestCase { /** * Check method retrieve() */ - function testRetrieve() { + public function testRetrieve() { $params = array( 'name' => 'Test_Retrieve_Payment_Processor', 'title' => 'Test Retrieve Payment Processor', @@ -76,7 +76,7 @@ class CRM_Financial_BAO_PaymentProcessorTypeTest extends CiviUnitTestCase { /** * Check method setIsActive() */ - function testSetIsActive() { + public function testSetIsActive() { $params = array( 'name' => 'Test_Set_Payment_Processor', 'title' => 'Test Set Payment Processor', @@ -101,7 +101,7 @@ class CRM_Financial_BAO_PaymentProcessorTypeTest extends CiviUnitTestCase { /** * Check method getDefault() */ - function testGetDefault() { + public function testGetDefault() { $params = array('is_default' => 1); $defaults = array(); $result = CRM_Financial_BAO_PaymentProcessorType::retrieve($params, $defaults); @@ -113,7 +113,7 @@ class CRM_Financial_BAO_PaymentProcessorTypeTest extends CiviUnitTestCase { /** * Check method del() */ - function testDel() { + public function testDel() { $params = array( 'name' => 'Test_Del_Payment_Processor', 'title' => 'Test Del Payment Processor', diff --git a/tests/phpunit/CRM/Group/Page/AjaxTest.php b/tests/phpunit/CRM/Group/Page/AjaxTest.php index 585f0efc95..2c9dee004e 100644 --- a/tests/phpunit/CRM/Group/Page/AjaxTest.php +++ b/tests/phpunit/CRM/Group/Page/AjaxTest.php @@ -21,7 +21,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { protected $_params = array(); - function setUp() { + public function setUp() { parent::setUp(); $this->_params = array( 'sEcho' => '1', @@ -40,7 +40,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { $this->groupCreate(array('title' => 'not-me-active', 'is_active' => 1, 'name' => 'not-me-active')); } - function tearDown() { + public function tearDown() { CRM_Utils_Hook::singleton()->reset(); $this->quickCleanup(array('civicrm_group')); $config = CRM_Core_Config::singleton(); @@ -51,7 +51,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * @param $permission */ - function setPermissionAndRequest($permission) { + public function setPermissionAndRequest($permission) { CRM_Core_Config::singleton()->userPermissionClass->permissions = array($permission); CRM_Contact_BAO_Group::getPermissionClause(TRUE); global $_REQUEST; @@ -62,7 +62,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { * @param $permission * @param $hook */ - function setHookAndRequest($permission, $hook) { + public function setHookAndRequest($permission, $hook) { CRM_Core_Config::singleton()->userPermissionClass->permissions = array($permission); $this->hookClass->setHook('civicrm_aclGroup', array($this, $hook)); CRM_Contact_BAO_Group::getPermissionClause(TRUE); @@ -72,7 +72,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * Retrieve groups as 'view all contacts' */ - function testGroupListViewAllContacts() { + public function testGroupListViewAllContacts() { $this->setPermissionAndRequest('view all contacts'); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); $this->assertEquals(2, $total); @@ -85,7 +85,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { * Without setting params the default is both enabled & disabled * (if you do set default it is enabled only) */ - function testGroupListViewAllContactsFoundTitle() { + public function testGroupListViewAllContactsFoundTitle() { $this->_params['title'] = 'p'; $this->setPermissionAndRequest('view all contacts'); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); @@ -97,7 +97,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * Retrieve groups as 'view all contacts' */ - function testGroupListViewAllContactsNotFoundTitle() { + public function testGroupListViewAllContactsNotFoundTitle() { $this->_params['title'] = 'z'; $this->setPermissionAndRequest('view all contacts'); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); @@ -106,7 +106,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * Retrieve groups as 'edit all contacts' */ - function testGroupListEditAllContacts() { + public function testGroupListEditAllContacts() { $this->setPermissionAndRequest('edit all contacts'); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); $this->assertEquals(2, $total); @@ -117,7 +117,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * Retrieve groups as 'view all contacts' */ - function testGroupListViewAllContactsEnabled() { + public function testGroupListViewAllContactsEnabled() { $this->_params['status'] = 1; $this->setPermissionAndRequest('view all contacts'); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); @@ -129,7 +129,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * Retrieve groups as 'view all contacts' */ - function testGroupListViewAllContactsDisabled() { + public function testGroupListViewAllContactsDisabled() { $this->_params['status'] = 2; $this->setPermissionAndRequest('view all contacts'); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); @@ -141,7 +141,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * Retrieve groups as 'view all contacts' */ - function testGroupListViewAllContactsDisabledNotFoundTitle() { + public function testGroupListViewAllContactsDisabledNotFoundTitle() { $this->_params['status'] = 2; $this->_params['title'] = 'n'; $this->setPermissionAndRequest('view all contacts'); @@ -153,7 +153,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * Retrieve groups as 'view all contacts' */ - function testGroupListViewAllContactsDisabledFoundTitle() { + public function testGroupListViewAllContactsDisabledFoundTitle() { $this->_params['status'] = 2; $this->_params['title'] = 'p'; $this->setPermissionAndRequest('view all contacts'); @@ -165,7 +165,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * Retrieve groups as 'view all contacts' */ - function testGroupListViewAllContactsAll() { + public function testGroupListViewAllContactsAll() { $this->_params['status'] = 3; $this->setPermissionAndRequest('view all contacts'); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); @@ -180,7 +180,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * Retrieve groups as 'view all contacts' */ - function testGroupListAccessCiviCRM() { + public function testGroupListAccessCiviCRM() { $this->setPermissionAndRequest('access CiviCRM'); $permissionClause = CRM_Contact_BAO_Group::getPermissionClause(TRUE); $this->assertEquals('1 = 0', $permissionClause); @@ -191,7 +191,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * Retrieve groups as 'view all contacts' */ - function testGroupListAccessCiviCRMEnabled() { + public function testGroupListAccessCiviCRMEnabled() { $this->_params['status'] = 1; $this->setPermissionAndRequest('access CiviCRM'); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); @@ -201,7 +201,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * Retrieve groups as 'view all contacts' */ - function testGroupListAccessCiviCRMDisabled() { + public function testGroupListAccessCiviCRMDisabled() { $this->_params['status'] = 2; $this->setPermissionAndRequest('access CiviCRM'); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); @@ -212,7 +212,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * Retrieve groups as 'view all contacts' */ - function testGroupListAccessCiviCRMAll() { + public function testGroupListAccessCiviCRMAll() { $this->_params['status'] = 2; $this->setPermissionAndRequest('access CiviCRM'); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); @@ -223,7 +223,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * Retrieve groups as 'view all contacts' */ - function testGroupListAccessCiviCRMFound() { + public function testGroupListAccessCiviCRMFound() { $this->_params['title'] = 'p'; $this->setPermissionAndRequest('access CiviCRM'); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); @@ -234,7 +234,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * Retrieve groups as 'view all contacts' */ - function testGroupListAccessCiviCRMNotFound() { + public function testGroupListAccessCiviCRMNotFound() { $this->_params['title'] = 'z'; $this->setPermissionAndRequest('access CiviCRM'); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); @@ -242,7 +242,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { $this->assertEquals(0, $total, 'Total returned should be accurate based on permissions'); } - function testTraditionalACL () { + public function testTraditionalACL () { $this->setupACL(); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); $this->assertEquals(1, count($groups), 'Returned groups should exclude disabled by default'); @@ -250,7 +250,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { $this->assertEquals('pick-me-active', $groups[2]['group_name']); } - function testTraditionalACLNotFoundTitle () { + public function testTraditionalACLNotFoundTitle () { $this->_params['title'] = 'n'; $this->setupACL(); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); @@ -258,7 +258,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { $this->assertEquals(0, $total, 'Total needs to be set correctly'); } - function testTraditionalACLFoundTitle () { + public function testTraditionalACLFoundTitle () { $this->_params['title'] = 'p'; $this->setupACL(); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); @@ -268,7 +268,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { $this->assertEquals('pick-me-disabled', $groups[1]['group_name']); } - function testTraditionalACLDisabled () { + public function testTraditionalACLDisabled () { $this->_params['status'] = 2; $this->setupACL(); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); @@ -277,7 +277,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { $this->assertEquals('pick-me-disabled', $groups[1]['group_name']); } - function testTraditionalACLDisabledFoundTitle () { + public function testTraditionalACLDisabledFoundTitle () { $this->_params['status'] = 2; $this->_params['title'] = 'p'; $this->setupACL(); @@ -287,7 +287,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { $this->assertEquals('pick-me-disabled', $groups[1]['group_name']); } - function testTraditionalACLDisabledNotFoundTitle () { + public function testTraditionalACLDisabledNotFoundTitle () { $this->_params['status'] = 2; $this->_params['title'] = 'n'; $this->setupACL(); @@ -296,7 +296,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { $this->assertEquals(0, $total, 'Total needs to be set correctly'); } - function testTraditionalACLEnabled () { + public function testTraditionalACLEnabled () { $this->_params['status'] = 1; $this->setupACL(); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); @@ -305,7 +305,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { $this->assertEquals('pick-me-active', $groups[2]['group_name']); } - function testTraditionalACLAll () { + public function testTraditionalACLAll () { $this->_params['status'] = 3; $this->setupACL(); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); @@ -318,7 +318,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * ACL Group hook */ - function testGroupListAclGroupHookDisabled() { + public function testGroupListAclGroupHookDisabled() { $this->_params['status'] = 2; $this->setHookAndRequest('access CiviCRM', 'hook_civicrm_aclGroup'); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); @@ -330,7 +330,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * ACL Group hook */ - function testGroupListAclGroupHookDisabledFound() { + public function testGroupListAclGroupHookDisabledFound() { $this->_params['status'] = 2; $this->_params['title'] = 'p'; $this->setHookAndRequest('access CiviCRM', 'hook_civicrm_aclGroup'); @@ -343,7 +343,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * ACL Group hook */ - function testGroupListAclGroupHookDisabledNotFound() { + public function testGroupListAclGroupHookDisabledNotFound() { $this->_params['status'] = 2; $this->_params['title'] = 'n'; $this->setHookAndRequest('access CiviCRM', 'hook_civicrm_aclGroup'); @@ -356,7 +356,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * ACL Group hook */ - function testGroupListAclGroupHook() { + public function testGroupListAclGroupHook() { $this->setHookAndRequest('access CiviCRM', 'hook_civicrm_aclGroup'); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); $this->assertEquals(1, count($groups), 'Returned groups should exclude disabled by default'); @@ -367,7 +367,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * ACL Group hook */ - function testGroupListAclGroupHookTitleNotFound() { + public function testGroupListAclGroupHookTitleNotFound() { $this->_params['title'] = 'n'; $this->setHookAndRequest('access CiviCRM', 'hook_civicrm_aclGroup'); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); @@ -378,7 +378,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * ACL Group hook */ - function testGroupListAclGroupHookTitleFound() { + public function testGroupListAclGroupHookTitleFound() { $this->_params['title'] = 'p'; $this->setHookAndRequest('access CiviCRM', 'hook_civicrm_aclGroup'); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); @@ -391,7 +391,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * ACL Group hook */ - function testGroupListAclGroupHookAll() { + public function testGroupListAclGroupHookAll() { $this->_params['status'] = 3; $this->setHookAndRequest('access CiviCRM', 'hook_civicrm_aclGroup'); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); @@ -404,7 +404,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { /** * ACL Group hook */ - function testGroupListAclGroupHookEnabled() { + public function testGroupListAclGroupHookEnabled() { $this->_params['status'] = 1; $this->setHookAndRequest('access CiviCRM', 'hook_civicrm_aclGroup'); list($groups, $total) = CRM_Group_Page_AJAX::getGroupList(); @@ -422,7 +422,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { * @param array $allGroups * @param array $currentGroups */ - function hook_civicrm_aclGroup($type, $contactID, $tableName, &$allGroups, &$currentGroups) { + public function hook_civicrm_aclGroup($type, $contactID, $tableName, &$allGroups, &$currentGroups) { //don't use api - you will get a loop $sql = " SELECT * FROM civicrm_group WHERE name LIKE '%pick%'"; $groups = array(); diff --git a/tests/phpunit/CRM/Mailing/BAO/QueryTest.php b/tests/phpunit/CRM/Mailing/BAO/QueryTest.php index ac5ae02157..a9c2458238 100644 --- a/tests/phpunit/CRM/Mailing/BAO/QueryTest.php +++ b/tests/phpunit/CRM/Mailing/BAO/QueryTest.php @@ -14,11 +14,11 @@ class CRM_Mailing_BAO_QueryTest extends CiviUnitTestCase { return new CRM_Mailing_BAO_QueryTestDataProvider; } - function setUp() { + public function setUp() { parent::setUp(); } - function tearDown() { + public function tearDown() { $tablesToTruncate = array( 'civicrm_mailing_event_bounce', 'civicrm_mailing_event_delivered', @@ -40,7 +40,7 @@ class CRM_Mailing_BAO_QueryTest extends CiviUnitTestCase { * Test CRM_Contact_BAO_Query::searchQuery() * @dataProvider dataProvider */ - function testSearch($fv, $count, $ids, $full) { + public function testSearch($fv, $count, $ids, $full) { $op = new PHPUnit_Extensions_Database_Operation_Insert(); $op->execute($this->_dbconn, $this->createFlatXMLDataSet( diff --git a/tests/phpunit/CRM/Mailing/BAO/SpoolTest.php b/tests/phpunit/CRM/Mailing/BAO/SpoolTest.php index ae383f57d5..d5447114ad 100644 --- a/tests/phpunit/CRM/Mailing/BAO/SpoolTest.php +++ b/tests/phpunit/CRM/Mailing/BAO/SpoolTest.php @@ -15,12 +15,12 @@ class CRM_Mailing_BAO_SpoolTest extends CiviUnitTestCase { protected static $bodytext = 'Unit tests keep children safe.'; - function setUp() { + public function setUp() { parent::setUp(); $this->_mut = new CiviMailUtils( $this, true ); } - function tearDown() { + public function tearDown() { $this->_mut->stop(); parent::tearDown(); } @@ -29,7 +29,7 @@ class CRM_Mailing_BAO_SpoolTest extends CiviUnitTestCase { /** * Basic send */ - function testSend() { + public function testSend() { $contact_params_1 = array( 'first_name' => substr(sha1(rand()), 0, 7), 'last_name' => 'Anderson', diff --git a/tests/phpunit/CRM/Member/BAO/MembershipLogTest.php b/tests/phpunit/CRM/Member/BAO/MembershipLogTest.php index e726547dc6..9fe78b7c1b 100644 --- a/tests/phpunit/CRM/Member/BAO/MembershipLogTest.php +++ b/tests/phpunit/CRM/Member/BAO/MembershipLogTest.php @@ -35,7 +35,7 @@ require_once 'CiviTest/Membership.php'; */ class CRM_Member_BAO_MembershipLogTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); $params = array( @@ -72,7 +72,7 @@ class CRM_Member_BAO_MembershipLogTest extends CiviUnitTestCase { * This method is called after a test is executed. * */ - function tearDown() { + public function tearDown() { $this->relationshipTypeDelete($this->_relationshipTypeId); $this->membershipTypeDelete(array('id' => $this->_membershipTypeID)); $this->membershipStatusDelete($this->_mebershipStatusID); @@ -82,7 +82,7 @@ class CRM_Member_BAO_MembershipLogTest extends CiviUnitTestCase { /** * Test add() */ - function testadd() { + public function testadd() { $contactId = Contact::createIndividual(); $params = array( @@ -110,7 +110,7 @@ class CRM_Member_BAO_MembershipLogTest extends CiviUnitTestCase { /** * Test del() */ - function testdel() { + public function testdel() { $contactId = Contact::createIndividual(); $params = array( @@ -139,7 +139,7 @@ class CRM_Member_BAO_MembershipLogTest extends CiviUnitTestCase { /** * Test resetmodified() */ - function testresetmodifiedId() { + public function testresetmodifiedId() { $contactId = Contact::createIndividual(); $params = array( diff --git a/tests/phpunit/CRM/Member/BAO/MembershipStatusTest.php b/tests/phpunit/CRM/Member/BAO/MembershipStatusTest.php index 938d34c780..ec48cfbc5d 100644 --- a/tests/phpunit/CRM/Member/BAO/MembershipStatusTest.php +++ b/tests/phpunit/CRM/Member/BAO/MembershipStatusTest.php @@ -33,14 +33,14 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Member_BAO_MembershipStatusTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } /* check function add() * */ - function testAdd() { + public function testAdd() { $params = array( 'name' => 'pending', 'is_active' => 1, @@ -55,7 +55,7 @@ class CRM_Member_BAO_MembershipStatusTest extends CiviUnitTestCase { $this->assertEquals($result, 'pending', 'Verify membership status is_active.'); } - function testRetrieve() { + public function testRetrieve() { $params = array( 'name' => 'testStatus', @@ -69,7 +69,7 @@ class CRM_Member_BAO_MembershipStatusTest extends CiviUnitTestCase { CRM_Member_BAO_MembershipStatus::del($membershipStatus->id); } - function testSetIsActive() { + public function testSetIsActive() { $params = array( 'name' => 'pending', @@ -87,7 +87,7 @@ class CRM_Member_BAO_MembershipStatusTest extends CiviUnitTestCase { $this->assertEquals($isActive, 0, 'Verify membership status is_active.'); } - function testGetMembershipStatus() { + public function testGetMembershipStatus() { $params = array( 'name' => 'pending', 'is_active' => 1, @@ -98,7 +98,7 @@ class CRM_Member_BAO_MembershipStatusTest extends CiviUnitTestCase { $this->assertEquals($result['name'], 'pending', 'Verify membership status name.'); } - function testDel() { + public function testDel() { $params = array( 'name' => 'testStatus', 'is_active' => 1, @@ -111,7 +111,7 @@ class CRM_Member_BAO_MembershipStatusTest extends CiviUnitTestCase { $this->assertEquals(empty($result), TRUE, 'Verify membership status record deletion.'); } - function testGetMembershipStatusByDate() { + public function testGetMembershipStatusByDate() { $params = array( 'name' => 'Current', 'is_active' => 1, @@ -126,7 +126,7 @@ class CRM_Member_BAO_MembershipStatusTest extends CiviUnitTestCase { $this->assertEquals($result['name'], 'Current', 'Verify membership status record.'); } - function testgetMembershipStatusCurrent() { + public function testgetMembershipStatusCurrent() { $params = array( 'name' => 'Current', 'is_active' => 1, diff --git a/tests/phpunit/CRM/Member/BAO/MembershipTest.php b/tests/phpunit/CRM/Member/BAO/MembershipTest.php index 111d714294..7aeeaff02c 100644 --- a/tests/phpunit/CRM/Member/BAO/MembershipTest.php +++ b/tests/phpunit/CRM/Member/BAO/MembershipTest.php @@ -38,7 +38,7 @@ require_once 'CRM/Core/Controller.php'; */ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); // FIXME: something NULLs $GLOBALS['_HTML_QuickForm_registered_rules'] when the tests are ran all together $GLOBALS['_HTML_QuickForm_registered_rules'] = array( @@ -68,7 +68,7 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase { * This method is called after a test is executed. * */ - function tearDown() { + public function tearDown() { $this->membershipTypeDelete( array( 'id' => $this->_membershipTypeID ) ); $this->membershipStatusDelete( $this->_membershipStatusID ); Contact::delete( $this->_contactID ); @@ -76,7 +76,7 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase { $this->_contactID = $this->_membershipStatusID = $this->_membershipTypeID = null; } - function testCreate() { + public function testCreate() { $contactId = Contact::createIndividual(); @@ -125,7 +125,7 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase { Contact::delete($contactId); } - function testGetValues() { + public function testGetValues() { // $this->markTestSkipped( 'causes mysterious exit, needs fixing!' ); // Calculate membership dates based on the current date $now = time(); @@ -183,7 +183,7 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase { Contact::delete($contactId); } - function testRetrieve() { + public function testRetrieve() { $contactId = Contact::createIndividual(); $params = array( @@ -211,7 +211,7 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase { $this->contactDelete($contactId); } - function testActiveMembers() { + public function testActiveMembers() { $contactId = Contact::createIndividual(); $params = array( @@ -271,7 +271,7 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase { Contact::delete($contactId); } - function testDeleteMembership() { + public function testDeleteMembership() { $contactId = Contact::createIndividual(); $params = array( @@ -298,7 +298,7 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase { Contact::delete($contactId); } - function testGetContactMembership() { + public function testGetContactMembership() { $contactId = Contact::createIndividual(); $params = array( @@ -331,7 +331,7 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase { * Get the contribution * page id from the membership record */ - function testgetContributionPageId() { + public function testgetContributionPageId() { $contactId = Contact::createIndividual(); $params = array( @@ -362,7 +362,7 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase { * type. * */ - function testgetMembershipStarts() { + public function testgetMembershipStarts() { $contactId = Contact::createIndividual(); $params = array( @@ -394,7 +394,7 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase { * optionally for a specified date. * */ - function testGetMembershipCount() { + public function testGetMembershipCount() { $contactId = Contact::createIndividual(); $params = array( @@ -427,7 +427,7 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase { * batch update member via profile * */ - function testsortName() { + public function testsortName() { $contactId = Contact::createIndividual(); $params = array( @@ -462,7 +462,7 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase { * Delete related memberships * */ - function testdeleteRelatedMemberships() { + public function testdeleteRelatedMemberships() { $contactId = Contact::createIndividual(); $params = array( @@ -493,7 +493,7 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase { * Renew membership with change in membership type * */ - function testRenewMembership() { + public function testRenewMembership() { $contactId = Contact::createIndividual(); $joinDate = $startDate = date("Ymd", strtotime(date("Ymd") . " -6 month")); $endDate = date("Ymd", strtotime($joinDate . " +1 year -1 day")); @@ -556,7 +556,7 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase { * Renew stale membership * */ - function testStaleMembership() { + public function testStaleMembership() { $statusId = 3; $contactId = Contact::createIndividual(); $joinDate = $startDate = date("Ymd", strtotime(date("Ymd") . " -1 year -15 days")); diff --git a/tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php b/tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php index cccf69b163..790783e209 100644 --- a/tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php +++ b/tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php @@ -33,7 +33,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); //create relationship @@ -57,7 +57,7 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { * This method is called after a test is executed. * */ - function tearDown() { + public function tearDown() { $this->relationshipTypeDelete($this->_relationshipTypeId); $this->membershipStatusDelete($this->_membershipStatusID); $this->contactDelete($this->_orgContactID); @@ -67,7 +67,7 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { /* check function add() * */ - function testAdd() { + public function testAdd() { $ids = array(); $params = array( 'name' => 'test type', @@ -97,7 +97,7 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { /* check function retrive() * */ - function testRetrieve() { + public function testRetrieve() { $ids = array(); $params = array( 'name' => 'General', @@ -124,7 +124,7 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { /* check function isActive() * */ - function testSetIsActive() { + public function testSetIsActive() { $ids = array(); $params = array( 'name' => 'General', @@ -156,7 +156,7 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { /* check function del() * */ - function testdel() { + public function testdel() { $ids = array(); $params = array( 'name' => 'General', @@ -182,7 +182,7 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { /* check function convertDayFormat( ) * */ - function testConvertDayFormat() { + public function testConvertDayFormat() { $ids = array(); $params = array( 'name' => 'General', @@ -212,7 +212,7 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { /* check function getMembershipTypes( ) * */ - function testGetMembershipTypes() { + public function testGetMembershipTypes() { $ids = array(); $params = array( 'name' => 'General', @@ -237,7 +237,7 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { /* check function getMembershipTypeDetails( ) * */ - function testGetMembershipTypeDetails() { + public function testGetMembershipTypeDetails() { $ids = array(); $params = array( 'name' => 'General', @@ -264,7 +264,7 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { /* check function getDatesForMembershipType( ) * */ - function testGetDatesForMembershipType() { + public function testGetDatesForMembershipType() { $ids = array(); $params = array( 'name' => 'General', @@ -290,7 +290,7 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { /* check function getRenewalDatesForMembershipType( ) * */ - function testGetRenewalDatesForMembershipType() { + public function testGetRenewalDatesForMembershipType() { $ids = array(); $params = array( 'name' => 'General', @@ -333,7 +333,7 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { /* check function getMembershipTypesByOrg( ) * */ - function testGetMembershipTypesByOrg() { + public function testGetMembershipTypesByOrg() { $ids = array(); $params = array( 'name' => 'General', diff --git a/tests/phpunit/CRM/Member/Form/MembershipTest.php b/tests/phpunit/CRM/Member/Form/MembershipTest.php index 4567ce9941..8c3ac19d38 100644 --- a/tests/phpunit/CRM/Member/Form/MembershipTest.php +++ b/tests/phpunit/CRM/Member/Form/MembershipTest.php @@ -216,7 +216,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { * Test CRM_Member_Form_Membership::formRule() with a parameter * that has an empty contact_select_id value */ - function testFormRuleEmptyContact() { + public function testFormRuleEmptyContact() { $params = array( 'contact_select_id' => 0, 'membership_type_id' => array(), @@ -246,7 +246,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { * that has an start date before the join date and a rolling * membership type */ - function testFormRuleRollingEarlyStart() { + public function testFormRuleRollingEarlyStart() { $unixNow = time(); $ymdNow = date('m/d/Y', $unixNow); $unixYesterday = $unixNow - (24 * 60 * 60); @@ -275,7 +275,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { * that has an end date before the start date and a rolling * membership type */ - function testFormRuleRollingEarlyEnd() { + public function testFormRuleRollingEarlyEnd() { $unixNow = time(); $ymdNow = date('m/d/Y', $unixNow); $unixYesterday = $unixNow - (24 * 60 * 60); @@ -302,7 +302,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { * that has an end date but no start date and a rolling * membership type */ - function testFormRuleRollingEndNoStart() { + public function testFormRuleRollingEndNoStart() { $unixNow = time(); $ymdNow = date('m/d/Y', $unixNow); $unixYearFromNow = $unixNow + (365 * 24 * 60 * 60); @@ -328,7 +328,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { * Test CRM_Member_Form_Membership::formRule() with a parameter * that has an end date and a lifetime membership type */ - function testFormRuleRollingLifetimeEnd() { + public function testFormRuleRollingLifetimeEnd() { $unixNow = time(); $unixYearFromNow = $unixNow + (365 * 24 * 60 * 60); $params = array( @@ -350,7 +350,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { * Test CRM_Member_Form_Membership::formRule() with a parameter * that has an override and no status */ - function testFormRuleOverrideNoStatus() { + public function testFormRuleOverrideNoStatus() { $unixNow = time(); $unixYearFromNow = $unixNow + (365 * 24 * 60 * 60); $params = array('join_date' => date('m/d/Y', $unixNow), @@ -372,7 +372,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { * Test CRM_Member_Form_Membership::formRule() with a join date * of one month from now and a rolling membership type */ - function testFormRuleRollingJoin1MonthFromNow() { + public function testFormRuleRollingJoin1MonthFromNow() { $unixNow = time(); $unix1MFmNow = $unixNow + (31 * 24 * 60 * 60); $params = array('join_date' => date('m/d/Y', $unix1MFmNow), @@ -397,7 +397,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { * Test CRM_Member_Form_Membership::formRule() with a join date * of today and a rolling membership type */ - function testFormRuleRollingJoinToday() { + public function testFormRuleRollingJoinToday() { $unixNow = time(); $params = array('join_date' => date('m/d/Y', $unixNow), 'start_date' => '', @@ -416,7 +416,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { * Test CRM_Member_Form_Membership::formRule() with a join date * of one month ago and a rolling membership type */ - function testFormRuleRollingJoin1MonthAgo() { + public function testFormRuleRollingJoin1MonthAgo() { $unixNow = time(); $unix1MAgo = $unixNow - (31 * 24 * 60 * 60); $params = array('join_date' => date('m/d/Y', $unix1MAgo), @@ -436,7 +436,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { * Test CRM_Member_Form_Membership::formRule() with a join date * of six months ago and a rolling membership type */ - function testFormRuleRollingJoin6MonthsAgo() { + public function testFormRuleRollingJoin6MonthsAgo() { $unixNow = time(); $unix6MAgo = $unixNow - (180 * 24 * 60 * 60); $params = array('join_date' => date('m/d/Y', $unix6MAgo), @@ -456,7 +456,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { * Test CRM_Member_Form_Membership::formRule() with a join date * of one year+ ago and a rolling membership type */ - function testFormRuleRollingJoin1YearAgo() { + public function testFormRuleRollingJoin1YearAgo() { $unixNow = time(); $unix1YAgo = $unixNow - (370 * 24 * 60 * 60); $params = array('join_date' => date('m/d/Y', $unix1YAgo), @@ -476,7 +476,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { * Test CRM_Member_Form_Membership::formRule() with a join date * of two years ago and a rolling membership type */ - function testFormRuleRollingJoin2YearsAgo() { + public function testFormRuleRollingJoin2YearsAgo() { $unixNow = time(); $unix2YAgo = $unixNow - (2 * 365 * 24 * 60 * 60); $params = array('join_date' => date('m/d/Y', $unix2YAgo), @@ -496,7 +496,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { * Test CRM_Member_Form_Membership::formRule() with a join date * of six months ago and a fixed membership type */ - function testFormRuleFixedJoin6MonthsAgo() { + public function testFormRuleFixedJoin6MonthsAgo() { $unixNow = time(); $unix6MAgo = $unixNow - (180 * 24 * 60 * 60); $params = array('join_date' => date('m/d/Y', $unix6MAgo), diff --git a/tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php b/tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php index 1bd5ad9f46..8d687e4707 100644 --- a/tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php +++ b/tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php @@ -46,7 +46,7 @@ class CRM_Member_Import_Parser_MembershipTest extends CiviUnitTestCase { */ protected $_membershipTypeID = NULL; - function setUp() { + public function setUp() { parent::setUp(); $params = array( @@ -88,7 +88,7 @@ class CRM_Member_Import_Parser_MembershipTest extends CiviUnitTestCase { * This method is called after a test is executed. * */ - function tearDown() { + public function tearDown() { $tablesToTruncate = array('civicrm_membership', 'civicrm_membership_log', 'civicrm_contribution', 'civicrm_membership_payment'); $this->quickCleanup($tablesToTruncate); $this->relationshipTypeDelete($this->_relationshipTypeId); @@ -100,7 +100,7 @@ class CRM_Member_Import_Parser_MembershipTest extends CiviUnitTestCase { /** * Test Import */ - function testImport() { + public function testImport() { $contactId = $this->individualCreate(); $contact2Params = array( 'first_name' => 'Anthonita', diff --git a/tests/phpunit/CRM/PCP/BAO/PCPTest.php b/tests/phpunit/CRM/PCP/BAO/PCPTest.php index b224a44f46..e1c1b0839b 100644 --- a/tests/phpunit/CRM/PCP/BAO/PCPTest.php +++ b/tests/phpunit/CRM/PCP/BAO/PCPTest.php @@ -45,7 +45,7 @@ class CRM_PCP_BAO_PCPTest extends CiviUnitTestCase { parent::setUp(); } - function testAddPCPBlock() { + public function testAddPCPBlock() { $params = $this->pcpBlockParams(); $pcpBlock = CRM_PCP_BAO_PCP::add($params, TRUE); @@ -65,7 +65,7 @@ class CRM_PCP_BAO_PCPTest extends CiviUnitTestCase { // CRM_Core_DAO::deleteTestObjects( 'CRM_PCP_DAO_PCPBlock', $delParams ); } - function testAddPCP() { + public function testAddPCP() { $blockParams = $this->pcpBlockParams(); $pcpBlock = CRM_PCP_BAO_PCP::add($blockParams, TRUE); @@ -92,7 +92,7 @@ class CRM_PCP_BAO_PCPTest extends CiviUnitTestCase { // CRM_Core_DAO::deleteTestObjects( 'CRM_PCP_DAO_PCP', $delParams ); } - function testAddPCPNoStatus() { + public function testAddPCPNoStatus() { $blockParams = $this->pcpBlockParams(); $pcpBlock = CRM_PCP_BAO_PCP::add($blockParams, TRUE); @@ -120,7 +120,7 @@ class CRM_PCP_BAO_PCPTest extends CiviUnitTestCase { // CRM_Core_DAO::deleteTestObjects( 'CRM_PCP_DAO_PCP', $delParams ); } - function testDeletePCP() { + public function testDeletePCP() { $pcp = CRM_Core_DAO::createTestObject('CRM_PCP_DAO_PCP'); $pcpId = $pcp->id; diff --git a/tests/phpunit/CRM/Pledge/BAO/PledgeBlockTest.php b/tests/phpunit/CRM/Pledge/BAO/PledgeBlockTest.php index 0856b7ecd4..649a646993 100644 --- a/tests/phpunit/CRM/Pledge/BAO/PledgeBlockTest.php +++ b/tests/phpunit/CRM/Pledge/BAO/PledgeBlockTest.php @@ -58,7 +58,7 @@ class CRM_Pledge_BAO_PledgeBlockTest extends CiviUnitTestCase { /** * create() and deletepledgeblock() method */ - function testCreateAndDeletePledgeBlock() { + public function testCreateAndDeletePledgeBlock() { $pledgeFrequencyUnit = array( 'week' => 1, @@ -91,7 +91,7 @@ class CRM_Pledge_BAO_PledgeBlockTest extends CiviUnitTestCase { /** * Add() method (add and edit modes of pledge block) */ - function testAddPledgeBlock() { + public function testAddPledgeBlock() { $pledgeFrequencyUnit = array( 'week' => 1, @@ -135,7 +135,7 @@ class CRM_Pledge_BAO_PledgeBlockTest extends CiviUnitTestCase { /** * Retrieve() and getPledgeBlock() method of pledge block */ - function testRetrieveAndGetPledgeBlock() { + public function testRetrieveAndGetPledgeBlock() { $pledgeFrequencyUnit = array( 'week' => 1, diff --git a/tests/phpunit/CRM/Pledge/BAO/PledgePaymentTest.php b/tests/phpunit/CRM/Pledge/BAO/PledgePaymentTest.php index 6446c53c8e..1aa5bd6ca4 100644 --- a/tests/phpunit/CRM/Pledge/BAO/PledgePaymentTest.php +++ b/tests/phpunit/CRM/Pledge/BAO/PledgePaymentTest.php @@ -56,7 +56,7 @@ class CRM_Pledge_BAO_PledgePaymentTest extends CiviUnitTestCase { /** * Test for Add/Update Pledge Payment. */ - function testAdd() { + public function testAdd() { $pledge = CRM_Core_DAO::createTestObject('CRM_Pledge_BAO_Pledge'); $params = array( 'pledge_id' => $pledge->id, @@ -96,7 +96,7 @@ class CRM_Pledge_BAO_PledgePaymentTest extends CiviUnitTestCase { /** * Retrieve a payment based on a pledge id = 0 */ - function testRetrieveZeroPledeID() { + public function testRetrieveZeroPledeID() { $payment = CRM_Core_DAO::createTestObject('CRM_Pledge_BAO_PledgePayment'); $params = array('pledge_id' => 0); $defaults = array(); @@ -109,7 +109,7 @@ class CRM_Pledge_BAO_PledgePaymentTest extends CiviUnitTestCase { /** * Retrieve a payment based on a Null pledge id */ - function testRetrieveStringPledgeID() { + public function testRetrieveStringPledgeID() { $payment = CRM_Core_DAO::createTestObject('CRM_Pledge_BAO_PledgePayment'); $params = array('pledge_id' => 'Test'); $defaults = array(); @@ -122,7 +122,7 @@ class CRM_Pledge_BAO_PledgePaymentTest extends CiviUnitTestCase { /** * Test that payment retrieve wrks based on known pledge id */ - function testRetrieveKnownPledgeID() { + public function testRetrieveKnownPledgeID() { $payment = CRM_Core_DAO::createTestObject('CRM_Pledge_BAO_PledgePayment'); $pledgeId = $payment->pledge_id; $params = array('pledge_id' => $pledgeId); @@ -136,7 +136,7 @@ class CRM_Pledge_BAO_PledgePaymentTest extends CiviUnitTestCase { /** * Delete Payments payments for one pledge */ - function testDeletePledgePaymentsNormal() { + public function testDeletePledgePaymentsNormal() { $payment = CRM_Core_DAO::createTestObject('CRM_Pledge_BAO_PledgePayment'); $paymentid = CRM_Pledge_BAO_PledgePayment::deletePayments($payment->pledge_id); $this->assertEquals(count($paymentid), 1, "Deleted one payment"); @@ -146,7 +146,7 @@ class CRM_Pledge_BAO_PledgePaymentTest extends CiviUnitTestCase { /** * Pass Null Id for a payment deletion for one pledge */ - function testDeletePledgePaymentsNullId() { + public function testDeletePledgePaymentsNullId() { $payment = CRM_Core_DAO::createTestObject('CRM_Pledge_BAO_PledgePayment'); $paymentid = CRM_Pledge_BAO_PledgePayment::deletePayments(Null); $this->assertEquals(count($paymentid), 1, "No payments deleted"); @@ -156,7 +156,7 @@ class CRM_Pledge_BAO_PledgePaymentTest extends CiviUnitTestCase { /** * Pass Zero Id for a payment deletion for one pledge */ - function testDeletePaymentsZeroId() { + public function testDeletePaymentsZeroId() { $payment = CRM_Core_DAO::createTestObject('CRM_Pledge_BAO_PledgePayment'); $paymentid = CRM_Pledge_BAO_PledgePayment::deletePayments(0); $result = CRM_Pledge_BAO_Pledge::deletePledge($payment->pledge_id); @@ -165,7 +165,7 @@ class CRM_Pledge_BAO_PledgePaymentTest extends CiviUnitTestCase { /** * Test calculateBaseScheduleDate - should give 15th day of month */ - function testcalculateBaseScheduleDateMonth() { + public function testcalculateBaseScheduleDateMonth() { $params = array( 'scheduled_date' => '20110510', 'frequency_unit' => 'month', @@ -180,7 +180,7 @@ class CRM_Pledge_BAO_PledgePaymentTest extends CiviUnitTestCase { /** * Test calculateBaseScheduleDate - should give original date */ - function testcalculateBaseScheduleDateDay() { + public function testcalculateBaseScheduleDateDay() { $params = array( 'scheduled_date' => '20110510', 'frequency_unit' => 'day', @@ -196,7 +196,7 @@ class CRM_Pledge_BAO_PledgePaymentTest extends CiviUnitTestCase { * Test calculateBaseScheduleDateWeek - should give the day in the week as indicated * testing each day as this is really the only unit that does anything */ - function testcalculateBaseScheduleDateWeek() { + public function testcalculateBaseScheduleDateWeek() { $params = array( 'scheduled_date' => '20110510', 'frequency_unit' => 'week', @@ -229,7 +229,7 @@ class CRM_Pledge_BAO_PledgePaymentTest extends CiviUnitTestCase { /** * Test calculateBaseScheduleDate - should give original date */ - function testcalculateBaseScheduleDateYear() { + public function testcalculateBaseScheduleDateYear() { $params = array( 'scheduled_date' => '20110510', 'frequency_unit' => 'year', @@ -244,7 +244,7 @@ class CRM_Pledge_BAO_PledgePaymentTest extends CiviUnitTestCase { /** * Test calculateNextScheduledDate - no date provided */ - function testcalculateNextScheduledDateYear() { + public function testcalculateNextScheduledDateYear() { $params = array( 'scheduled_date' => '20110510', 'frequency_unit' => 'year', @@ -259,7 +259,7 @@ class CRM_Pledge_BAO_PledgePaymentTest extends CiviUnitTestCase { /** * Test calculateNextScheduledDate - no date provided */ - function testcalculateNextScheduledDateYearDateProvided() { + public function testcalculateNextScheduledDateYearDateProvided() { $params = array( 'scheduled_date' => '20110510', 'frequency_unit' => 'year', diff --git a/tests/phpunit/CRM/Pledge/BAO/PledgeTest.php b/tests/phpunit/CRM/Pledge/BAO/PledgeTest.php index ee0a7e3dc7..724569596b 100644 --- a/tests/phpunit/CRM/Pledge/BAO/PledgeTest.php +++ b/tests/phpunit/CRM/Pledge/BAO/PledgeTest.php @@ -58,7 +58,7 @@ class CRM_Pledge_BAO_PledgeTest extends CiviUnitTestCase { /** * Test for Add/Update Pledge. */ - function testAdd() { + public function testAdd() { $params = array( 'contact_id' => $this->_contactId, 'frequency_unit' => 'month', @@ -86,7 +86,7 @@ class CRM_Pledge_BAO_PledgeTest extends CiviUnitTestCase { /** * Retrieve a pledge based on a pledge id = 0 */ - function testRetrieveZeroPledeID() { + public function testRetrieveZeroPledeID() { $defaults = array(); $params = array('pledge_id' => 0); $pledgeId = CRM_Pledge_BAO_Pledge::retrieve($params, $defaults); @@ -97,7 +97,7 @@ class CRM_Pledge_BAO_PledgeTest extends CiviUnitTestCase { /** * Retrieve a payment based on a Null pledge id random string */ - function testRetrieveStringPledgeID() { + public function testRetrieveStringPledgeID() { $defaults = array(); $params = array('pledge_id' => 'random text'); $pledgeId = CRM_Pledge_BAO_Pledge::retrieve($params, $defaults); @@ -108,7 +108,7 @@ class CRM_Pledge_BAO_PledgeTest extends CiviUnitTestCase { /** * Test that payment retrieve wrks based on known pledge id */ - function testRetrieveKnownPledgeID() { + public function testRetrieveKnownPledgeID() { $params = array( 'contact_id' => $this->_contactId, 'frequency_unit' => 'month', diff --git a/tests/phpunit/CRM/Queue/Queue/SqlTest.php b/tests/phpunit/CRM/Queue/Queue/SqlTest.php index 1b71c073a7..3757d474ca 100644 --- a/tests/phpunit/CRM/Queue/Queue/SqlTest.php +++ b/tests/phpunit/CRM/Queue/Queue/SqlTest.php @@ -42,7 +42,7 @@ class CRM_Queue_Queue_SqlTest extends CiviUnitTestCase { /** * Return a list of persistent and transient queue providers */ - function getQueueSpecs() { + public function getQueueSpecs() { $queueSpecs = array(); $queueSpecs[] = array( array( @@ -53,12 +53,12 @@ class CRM_Queue_Queue_SqlTest extends CiviUnitTestCase { } /* ----------------------- Per-provider tests ----------------------- */ - function setUp() { + public function setUp() { parent::setUp(); $this->queueService = CRM_Queue_Service::singleton(TRUE); } - function tearDown() { + public function tearDown() { CRM_Utils_Time::resetTime(); $tablesToTruncate = array('civicrm_queue_item'); @@ -70,7 +70,7 @@ class CRM_Queue_Queue_SqlTest extends CiviUnitTestCase { * * @dataProvider getQueueSpecs */ - function testPriorities($queueSpec) { + public function testPriorities($queueSpec) { $this->queue = $this->queueService->create($queueSpec); $this->assertTrue($this->queue instanceof CRM_Queue_Queue); diff --git a/tests/phpunit/CRM/Queue/QueueTest.php b/tests/phpunit/CRM/Queue/QueueTest.php index 93f7d51f2c..cf1fe3e4ec 100644 --- a/tests/phpunit/CRM/Queue/QueueTest.php +++ b/tests/phpunit/CRM/Queue/QueueTest.php @@ -40,7 +40,7 @@ class CRM_Queue_QueueTest extends CiviUnitTestCase { /** * Return a list of persistent and transient queue providers */ - function getQueueSpecs() { + public function getQueueSpecs() { $queueSpecs = array(); $queueSpecs[] = array( array( @@ -56,12 +56,12 @@ class CRM_Queue_QueueTest extends CiviUnitTestCase { } /* ----------------------- Per-provider tests ----------------------- */ - function setUp() { + public function setUp() { parent::setUp(); $this->queueService = CRM_Queue_Service::singleton(TRUE); } - function tearDown() { + public function tearDown() { CRM_Utils_Time::resetTime(); $tablesToTruncate = array('civicrm_queue_item'); @@ -73,7 +73,7 @@ class CRM_Queue_QueueTest extends CiviUnitTestCase { * * @dataProvider getQueueSpecs */ - function testBasicUsage($queueSpec) { + public function testBasicUsage($queueSpec) { $this->queue = $this->queueService->create($queueSpec); $this->assertTrue($this->queue instanceof CRM_Queue_Queue); @@ -119,7 +119,7 @@ class CRM_Queue_QueueTest extends CiviUnitTestCase { * * @dataProvider getQueueSpecs */ - function testManualRelease($queueSpec) { + public function testManualRelease($queueSpec) { $this->queue = $this->queueService->create($queueSpec); $this->assertTrue($this->queue instanceof CRM_Queue_Queue); @@ -145,7 +145,7 @@ class CRM_Queue_QueueTest extends CiviUnitTestCase { * * @dataProvider getQueueSpecs */ - function testTimeoutRelease($queueSpec) { + public function testTimeoutRelease($queueSpec) { $this->queue = $this->queueService->create($queueSpec); $this->assertTrue($this->queue instanceof CRM_Queue_Queue); @@ -179,7 +179,7 @@ class CRM_Queue_QueueTest extends CiviUnitTestCase { * * @dataProvider getQueueSpecs */ - function testStealItem($queueSpec) { + public function testStealItem($queueSpec) { $this->queue = $this->queueService->create($queueSpec); $this->assertTrue($this->queue instanceof CRM_Queue_Queue); @@ -213,7 +213,7 @@ class CRM_Queue_QueueTest extends CiviUnitTestCase { * * @dataProvider getQueueSpecs */ - function testCreateResetTrue($queueSpec) { + public function testCreateResetTrue($queueSpec) { $this->queue = $this->queueService->create($queueSpec); $this->queue->createItem(array( 'test-key' => 'a', @@ -235,7 +235,7 @@ class CRM_Queue_QueueTest extends CiviUnitTestCase { * * @dataProvider getQueueSpecs */ - function testCreateResetFalse($queueSpec) { + public function testCreateResetFalse($queueSpec) { $this->queue = $this->queueService->create($queueSpec); $this->queue->createItem(array( 'test-key' => 'a', @@ -259,7 +259,7 @@ class CRM_Queue_QueueTest extends CiviUnitTestCase { * * @dataProvider getQueueSpecs */ - function testLoad($queueSpec) { + public function testLoad($queueSpec) { $this->queue = $this->queueService->create($queueSpec); $this->queue->createItem(array( 'test-key' => 'a', diff --git a/tests/phpunit/CRM/Queue/RunnerTest.php b/tests/phpunit/CRM/Queue/RunnerTest.php index a9cd618a41..b549f3e0f3 100644 --- a/tests/phpunit/CRM/Queue/RunnerTest.php +++ b/tests/phpunit/CRM/Queue/RunnerTest.php @@ -33,7 +33,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Queue_RunnerTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); require_once 'CRM/Queue/Service.php'; $this->queueService = CRM_Queue_Service::singleton(TRUE); @@ -44,7 +44,7 @@ class CRM_Queue_RunnerTest extends CiviUnitTestCase { self::$_recordedValues = array(); } - function tearDown() { + public function tearDown() { unset($this->queue); unset($this->queueService); @@ -54,7 +54,7 @@ class CRM_Queue_RunnerTest extends CiviUnitTestCase { $this->quickCleanup($tablesToTruncate); } - function testRunAllNormal() { + public function testRunAllNormal() { // prepare a list of tasks with an error in the middle $this->queue->createItem(new CRM_Queue_Task( array('CRM_Queue_RunnerTest', '_recordValue'), @@ -89,7 +89,7 @@ class CRM_Queue_RunnerTest extends CiviUnitTestCase { * Run a series of tasks; one of the tasks will insert more * TODOs at the start of the list */ - function testRunAll_AddMore() { + public function testRunAll_AddMore() { // prepare a list of tasks with an error in the middle $this->queue->createItem(new CRM_Queue_Task( array('CRM_Queue_RunnerTest', '_recordValue'), @@ -124,7 +124,7 @@ class CRM_Queue_RunnerTest extends CiviUnitTestCase { * Run a series of tasks; when one throws an * exception, ignore it and continue */ - function testRunAll_Continue_Exception() { + public function testRunAll_Continue_Exception() { // prepare a list of tasks with an error in the middle $this->queue->createItem(new CRM_Queue_Task( array('CRM_Queue_RunnerTest', '_recordValue'), @@ -160,7 +160,7 @@ class CRM_Queue_RunnerTest extends CiviUnitTestCase { * Run a series of tasks; when one throws an exception, * abort processing and return it to the queue. */ - function testRunAll_Abort_Exception() { + public function testRunAll_Abort_Exception() { // prepare a list of tasks with an error in the middle $this->queue->createItem(new CRM_Queue_Task( array('CRM_Queue_RunnerTest', '_recordValue'), @@ -197,7 +197,7 @@ class CRM_Queue_RunnerTest extends CiviUnitTestCase { * Run a series of tasks; when one returns false, * abort processing and return it to the queue. */ - function testRunAll_Abort_False() { + public function testRunAll_Abort_False() { // prepare a list of tasks with an error in the middle $this->queue->createItem(new CRM_Queue_Task( array('CRM_Queue_RunnerTest', '_recordValue'), @@ -242,7 +242,7 @@ class CRM_Queue_RunnerTest extends CiviUnitTestCase { * @return bool */ static - function _recordValue($taskCtx, $value) { + public function _recordValue($taskCtx, $value) { self::$_recordedValues[] = $value; return TRUE; } @@ -253,7 +253,7 @@ class CRM_Queue_RunnerTest extends CiviUnitTestCase { * @return bool */ static - function _returnFalse($taskCtx) { + public function _returnFalse($taskCtx) { return FALSE; } @@ -264,7 +264,7 @@ class CRM_Queue_RunnerTest extends CiviUnitTestCase { * @throws Exception */ static - function _throwException($taskCtx, $value) { + public function _throwException($taskCtx, $value) { throw new Exception("Manufactured error: $value"); } @@ -276,7 +276,7 @@ class CRM_Queue_RunnerTest extends CiviUnitTestCase { * @return bool */ static - function _enqueueNumbers($taskCtx, $low, $high) { + public function _enqueueNumbers($taskCtx, $low, $high) { for ($i = $low; $i <= $high; $i++) { $taskCtx->queue->createItem(new CRM_Queue_Task( array('CRM_Queue_RunnerTest', '_recordValue'), diff --git a/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php b/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php index 8b4cfde1f1..3b3ec17752 100644 --- a/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php +++ b/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php @@ -67,13 +67,13 @@ class CRM_Report_Form_Contribute_DetailTest extends CiviReportTestCase { ); } - function setUp() { + public function setUp() { parent::setUp(); $this->foreignKeyChecksOff(); $this->quickCleanup($this->_tablesToTruncate); } - function tearDown() { + public function tearDown() { parent::tearDown(); CRM_Core_DAO::executeQuery('DROP TEMPORARY TABLE IF EXISTS civireport_contribution_detail_temp1'); CRM_Core_DAO::executeQuery('DROP TEMPORARY TABLE IF EXISTS civireport_contribution_detail_temp2'); diff --git a/tests/phpunit/CRM/Report/Form/TestCaseTest.php b/tests/phpunit/CRM/Report/Form/TestCaseTest.php index 0772ceaa52..a6629ab37a 100644 --- a/tests/phpunit/CRM/Report/Form/TestCaseTest.php +++ b/tests/phpunit/CRM/Report/Form/TestCaseTest.php @@ -129,13 +129,13 @@ class CRM_Report_Form_TestCaseTest extends CiviReportTestCase { ); } - function setUp() { + public function setUp() { parent::setUp(); $this->foreignKeyChecksOff(); $this->quickCleanup($this->_tablesToTruncate); } - function tearDown() { + public function tearDown() { parent::tearDown(); CRM_Core_DAO::executeQuery('DROP TEMPORARY TABLE IF EXISTS civireport_contribution_detail_temp1'); CRM_Core_DAO::executeQuery('DROP TEMPORARY TABLE IF EXISTS civireport_contribution_detail_temp2'); diff --git a/tests/phpunit/CRM/UF/Page/ProfileEditorTest.php b/tests/phpunit/CRM/UF/Page/ProfileEditorTest.php index 55433d3eda..0d9cdba84e 100644 --- a/tests/phpunit/CRM/UF/Page/ProfileEditorTest.php +++ b/tests/phpunit/CRM/UF/Page/ProfileEditorTest.php @@ -5,14 +5,14 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Class CRM_UF_Page_ProfileEditorTest */ class CRM_UF_Page_ProfileEditorTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } /** * Spot check a few fields that should appear in schema */ - function testGetSchema() { + public function testGetSchema() { $schema = CRM_UF_Page_ProfileEditor::getSchema(array('IndividualModel', 'ActivityModel')); foreach ($schema as $entityName => $entityDef) { foreach ($entityDef['schema'] as $fieldName => $fieldDef) { diff --git a/tests/phpunit/CRM/Utils/API/MatchOptionTest.php b/tests/phpunit/CRM/Utils/API/MatchOptionTest.php index 20f067975c..17e657235c 100644 --- a/tests/phpunit/CRM/Utils/API/MatchOptionTest.php +++ b/tests/phpunit/CRM/Utils/API/MatchOptionTest.php @@ -11,7 +11,7 @@ class CRM_Utils_API_MatchOptionTest extends CiviUnitTestCase { */ var $noise; - function setUp() { + public function setUp() { parent::setUp(); $this->assertDBQuery(0, "SELECT count(*) FROM civicrm_contact WHERE first_name='Jeffrey' and last_name='Lebowski'"); @@ -27,7 +27,7 @@ class CRM_Utils_API_MatchOptionTest extends CiviUnitTestCase { )); } - function tearDown() { + public function tearDown() { $noise = $this->callAPISuccess('Contact', 'get', array( 'id' => $this->noise['individual'], 'return' => array('email'), @@ -50,7 +50,7 @@ class CRM_Utils_API_MatchOptionTest extends CiviUnitTestCase { /** * If there's no pre-existing record, then insert a new one. */ - function testCreateMatch_none() { + public function testCreateMatch_none() { $result = $this->callAPISuccess('contact', 'create', array( 'options' => array( 'match' => array('first_name', 'last_name'), @@ -68,7 +68,7 @@ class CRM_Utils_API_MatchOptionTest extends CiviUnitTestCase { /** * If there's no pre-existing record, then throw an error. */ - function testCreateMatchMandatory_none() { + public function testCreateMatchMandatory_none() { $this->callAPIFailure('contact', 'create', array( 'options' => array( 'match-mandatory' => array('first_name', 'last_name'), @@ -84,7 +84,7 @@ class CRM_Utils_API_MatchOptionTest extends CiviUnitTestCase { /** * @return array */ - function apiOptionNames() { + public function apiOptionNames() { return array( array('match'), array('match-mandatory'), @@ -97,7 +97,7 @@ class CRM_Utils_API_MatchOptionTest extends CiviUnitTestCase { * @dataProvider apiOptionNames * @param string $apiOptionName e.g. "match" or "match-mandatory" */ - function testCreateMatch_one($apiOptionName) { + public function testCreateMatch_one($apiOptionName) { // create basic record $result1 = $this->callAPISuccess('contact', 'create', array( 'contact_type' => 'Individual', @@ -135,7 +135,7 @@ class CRM_Utils_API_MatchOptionTest extends CiviUnitTestCase { * @dataProvider apiOptionNames * @param string $apiOptionName e.g. "match" or "match-mandatory" */ - function testCreateMatch_many($apiOptionName) { + public function testCreateMatch_many($apiOptionName) { // create the first Lebowski $result1 = $this->callAPISuccess('contact', 'create', array( 'contact_type' => 'Individual', @@ -173,7 +173,7 @@ class CRM_Utils_API_MatchOptionTest extends CiviUnitTestCase { * When replacing one set with another set, match items within * the set using a key. */ - function testReplaceMatch_Email() { + public function testReplaceMatch_Email() { // Create contact with two emails (j1,j2) $createResult = $this->callAPISuccess('contact', 'create', array( 'contact_type' => 'Individual', @@ -250,7 +250,7 @@ class CRM_Utils_API_MatchOptionTest extends CiviUnitTestCase { * When replacing one set with another set, match items within * the set using a key. */ - function testReplaceMatch_Address() { + public function testReplaceMatch_Address() { // Create contact with two addresses (j1,j2) $createResult = $this->callAPISuccess('contact', 'create', array( 'contact_type' => 'Individual', diff --git a/tests/phpunit/CRM/Utils/API/ReloadOptionTest.php b/tests/phpunit/CRM/Utils/API/ReloadOptionTest.php index 99a480055b..5dda910f2f 100644 --- a/tests/phpunit/CRM/Utils/API/ReloadOptionTest.php +++ b/tests/phpunit/CRM/Utils/API/ReloadOptionTest.php @@ -11,7 +11,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Utils_API_ReloadOptionTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); CRM_Utils_Hook_UnitTests::singleton()->setHook('civicrm_post', array($this, 'onPost')); } @@ -20,7 +20,7 @@ class CRM_Utils_API_ReloadOptionTest extends CiviUnitTestCase { * If reload option is missing, then 'create' returns the inputted nick_name -- despite the * fact that the hook manipulated the actual DB content. */ - function testNoReload() { + public function testNoReload() { $result = $this->callAPISuccess('contact', 'create', array( 'contact_type' => 'Individual', 'first_name' => 'First', @@ -34,7 +34,7 @@ class CRM_Utils_API_ReloadOptionTest extends CiviUnitTestCase { /** * When the reload option is unrecognized, generate an error */ - function testReloadInvalid() { + public function testReloadInvalid() { $this->callAPIFailure('contact', 'create', array( 'contact_type' => 'Individual', 'first_name' => 'First', @@ -50,7 +50,7 @@ class CRM_Utils_API_ReloadOptionTest extends CiviUnitTestCase { * If reload option is set, then 'create' returns the final nick_name -- even if it * differs from the inputted nick_name. */ - function testReloadDefault() { + public function testReloadDefault() { $result = $this->callAPISuccess('contact', 'create', array( 'contact_type' => 'Individual', 'first_name' => 'First', @@ -68,7 +68,7 @@ class CRM_Utils_API_ReloadOptionTest extends CiviUnitTestCase { * When the reload option is combined with chaining, the reload should munge * the chain results. */ - function testReloadNoChainInterference() { + public function testReloadNoChainInterference() { $result = $this->callAPISuccess('contact', 'create', array( 'contact_type' => 'Individual', 'first_name' => 'First', @@ -94,7 +94,7 @@ class CRM_Utils_API_ReloadOptionTest extends CiviUnitTestCase { * @param int $objectId * @param $objectRef */ - function onPost($op, $objectName, $objectId, &$objectRef) { + public function onPost($op, $objectName, $objectId, &$objectRef) { if ($op == 'create' && $objectName == 'Individual') { CRM_Core_DAO::executeQuery( "UPDATE civicrm_contact SET nick_name = 'munged' WHERE id = %1", diff --git a/tests/phpunit/CRM/Utils/ArrayTest.php b/tests/phpunit/CRM/Utils/ArrayTest.php index 0ae70b9594..d4e824812d 100644 --- a/tests/phpunit/CRM/Utils/ArrayTest.php +++ b/tests/phpunit/CRM/Utils/ArrayTest.php @@ -6,7 +6,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Utils_ArrayTest extends CiviUnitTestCase { - function testIndexArray() { + public function testIndexArray() { $inputs = array(); $inputs[] = array( 'lang' => 'en', @@ -49,7 +49,7 @@ class CRM_Utils_ArrayTest extends CiviUnitTestCase { $this->assertEquals($inputs[5], $byLangMsgid[NULL]['greeting']); } - function testCollect() { + public function testCollect() { $arr = array( array('catWord' => 'cat', 'dogWord' => 'dog'), array('catWord' => 'chat', 'dogWord' => 'chien'), @@ -66,7 +66,7 @@ class CRM_Utils_ArrayTest extends CiviUnitTestCase { $this->assertEquals($expected, CRM_Utils_Array::collect('catWord', $arr)); } - function testProduct0() { + public function testProduct0() { $actual = CRM_Utils_Array::product( array(), array('base data' => 1) @@ -76,7 +76,7 @@ class CRM_Utils_ArrayTest extends CiviUnitTestCase { ), $actual); } - function testProduct1() { + public function testProduct1() { $actual = CRM_Utils_Array::product( array('dim1' => array('a', 'b')), array('base data' => 1) @@ -87,7 +87,7 @@ class CRM_Utils_ArrayTest extends CiviUnitTestCase { ), $actual); } - function testProduct3() { + public function testProduct3() { $actual = CRM_Utils_Array::product( array('dim1' => array('a', 'b'), 'dim2' => array('alpha', 'beta'), 'dim3' => array('one', 'two')), array('base data' => 1) @@ -104,7 +104,7 @@ class CRM_Utils_ArrayTest extends CiviUnitTestCase { ), $actual); } - function testIsSubset() { + public function testIsSubset() { $this->assertTrue(CRM_Utils_Array::isSubset(array(), array())); $this->assertTrue(CRM_Utils_Array::isSubset(array('a'), array('a'))); $this->assertTrue(CRM_Utils_Array::isSubset(array('a'), array('b','a','c'))); @@ -114,7 +114,7 @@ class CRM_Utils_ArrayTest extends CiviUnitTestCase { $this->assertFalse(CRM_Utils_Array::isSubset(array('a'), array('b','c','d'))); } - function testRemove() { + public function testRemove() { $data = array( 'one' => 1, 'two' => 2, diff --git a/tests/phpunit/CRM/Utils/Cache/SqlGroupTest.php b/tests/phpunit/CRM/Utils/Cache/SqlGroupTest.php index 7861c6e30a..44ee487895 100644 --- a/tests/phpunit/CRM/Utils/Cache/SqlGroupTest.php +++ b/tests/phpunit/CRM/Utils/Cache/SqlGroupTest.php @@ -6,18 +6,18 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Class CRM_Utils_Cache_SqlGroupTest */ class CRM_Utils_Cache_SqlGroupTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } - function tearDown() { + public function tearDown() { parent::tearDown(); } /** * Add and remove two items from the same cache instance */ - function testSameInstance() { + public function testSameInstance() { $a = new CRM_Utils_Cache_SqlGroup(array( 'group' => 'testSameInstance', )); @@ -42,7 +42,7 @@ class CRM_Utils_Cache_SqlGroupTest extends CiviUnitTestCase { /** * Add item to one cache instance then read with another */ - function testTwoInstance() { + public function testTwoInstance() { $a = new CRM_Utils_Cache_SqlGroup(array( 'group' => 'testTwoInstance', )); @@ -60,7 +60,7 @@ class CRM_Utils_Cache_SqlGroupTest extends CiviUnitTestCase { /** * Add item to one cache instance then read (with or without prefetch) from another */ - function testPrefetch() { + public function testPrefetch() { // 1. put data in cache $a = new CRM_Utils_Cache_SqlGroup(array( 'group' => 'testPrefetch', diff --git a/tests/phpunit/CRM/Utils/DeprecatedUtilsTest.php b/tests/phpunit/CRM/Utils/DeprecatedUtilsTest.php index 1de15e186e..63503ef6eb 100644 --- a/tests/phpunit/CRM/Utils/DeprecatedUtilsTest.php +++ b/tests/phpunit/CRM/Utils/DeprecatedUtilsTest.php @@ -8,10 +8,10 @@ require_once 'CRM/Utils/DeprecatedUtils.php'; */ class CRM_Utils_DeprecatedUtilsTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } - function tearDown() { + public function tearDown() { // truncate a few tables $tablesToTruncate = array( 'civicrm_contact', @@ -25,7 +25,7 @@ class CRM_Utils_DeprecatedUtilsTest extends CiviUnitTestCase { /** * Test civicrm_contact_check_params with no contact type */ - function testCheckParamsWithNoContactType() { + public function testCheckParamsWithNoContactType() { $params = array('foo' => 'bar'); $contact = _civicrm_api3_deprecated_contact_check_params($params, FALSE); $this->assertEquals(1, $contact['is_error'], "In line " . __LINE__); @@ -35,7 +35,7 @@ class CRM_Utils_DeprecatedUtilsTest extends CiviUnitTestCase { /** * Test civicrm_contact_check_params with a duplicate */ - function testCheckParamsWithDuplicateContact() { + public function testCheckParamsWithDuplicateContact() { // Insert a row in civicrm_contact creating individual contact $op = new PHPUnit_Extensions_Database_Operation_Insert(); $op->execute($this->_dbconn, @@ -67,7 +67,7 @@ class CRM_Utils_DeprecatedUtilsTest extends CiviUnitTestCase { * Test civicrm_contact_check_params with a duplicate * and request the error in array format */ - function testCheckParamsWithDuplicateContact2() { + public function testCheckParamsWithDuplicateContact2() { // Insert a row in civicrm_contact creating individual contact $op = new PHPUnit_Extensions_Database_Operation_Insert(); $op->execute($this->_dbconn, @@ -97,7 +97,7 @@ class CRM_Utils_DeprecatedUtilsTest extends CiviUnitTestCase { * Test civicrm_contact_check_params with check for required * params and no params */ - function testCheckParamsWithNoParams() { + public function testCheckParamsWithNoParams() { $params = array(); $contact = _civicrm_api3_deprecated_contact_check_params($params, FALSE); $this->assertEquals(1, $contact['is_error'], "In line " . __LINE__); diff --git a/tests/phpunit/CRM/Utils/FileTest.php b/tests/phpunit/CRM/Utils/FileTest.php index 7235c4ca11..9f992fca53 100644 --- a/tests/phpunit/CRM/Utils/FileTest.php +++ b/tests/phpunit/CRM/Utils/FileTest.php @@ -5,7 +5,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Class CRM_Utils_FileTest */ class CRM_Utils_FileTest extends CiviUnitTestCase { - function testIsChildPath() { + public function testIsChildPath() { $testCases = array(); $testCases[] = array('/ab/cd/ef', '/ab/cd', FALSE); $testCases[] = array('/ab/cd', '/ab/cd/ef', TRUE); diff --git a/tests/phpunit/CRM/Utils/HookTest.php b/tests/phpunit/CRM/Utils/HookTest.php index 22c165b346..bf3f11d037 100644 --- a/tests/phpunit/CRM/Utils/HookTest.php +++ b/tests/phpunit/CRM/Utils/HookTest.php @@ -12,7 +12,7 @@ class CRM_Utils_HookTest extends CiviUnitTestCase { var $log; - function setUp() { + public function setUp() { parent::setUp(); $this->fakeModules = array( 'hooktesta', @@ -27,7 +27,7 @@ class CRM_Utils_HookTest extends CiviUnitTestCase { self::$activeTest = $this; } - function tearDown() { + public function tearDown() { self::$activeTest = $this; parent::tearDown(); } @@ -35,7 +35,7 @@ class CRM_Utils_HookTest extends CiviUnitTestCase { /** * Verify that runHooks() is reentrant by invoking one hook which calls another hooks */ - function testRunHooks_reentrancy() { + public function testRunHooks_reentrancy() { $arg1 = 'whatever'; $this->hook->runHooks($this->fakeModules, 'civicrm_testRunHooks_outer', 1, $arg1, CRM_Utils_Hook::$_nullObject, CRM_Utils_Hook::$_nullObject, CRM_Utils_Hook::$_nullObject, CRM_Utils_Hook::$_nullObject, CRM_Utils_Hook::$_nullObject); $this->assertEquals( @@ -54,7 +54,7 @@ class CRM_Utils_HookTest extends CiviUnitTestCase { /** * Verify that the results of runHooks() are correctly merged */ - function testRunHooks_merge() { + public function testRunHooks_merge() { $result = $this->hook->runHooks($this->fakeModules, 'civicrm_testRunHooks_merge', 0, CRM_Utils_Hook::$_nullObject, CRM_Utils_Hook::$_nullObject, CRM_Utils_Hook::$_nullObject, CRM_Utils_Hook::$_nullObject, CRM_Utils_Hook::$_nullObject, CRM_Utils_Hook::$_nullObject); $this->assertEquals( array( diff --git a/tests/phpunit/CRM/Utils/HtmlToTextTest.php b/tests/phpunit/CRM/Utils/HtmlToTextTest.php index ca51f2d914..c13bf37bfe 100644 --- a/tests/phpunit/CRM/Utils/HtmlToTextTest.php +++ b/tests/phpunit/CRM/Utils/HtmlToTextTest.php @@ -33,11 +33,11 @@ Links: ', ); - function setUp() { + public function setUp() { parent::setUp(); } - function testHtmlToText() { + public function testHtmlToText() { foreach ($this->_testInput as $html => $text) { $output = CRM_Utils_String::htmlToText($html); $this->assertEquals( diff --git a/tests/phpunit/CRM/Utils/HttpClientTest.php b/tests/phpunit/CRM/Utils/HttpClientTest.php index 613ae41bf7..fe0fcd6a39 100644 --- a/tests/phpunit/CRM/Utils/HttpClientTest.php +++ b/tests/phpunit/CRM/Utils/HttpClientTest.php @@ -42,25 +42,25 @@ class CRM_Utils_HttpClientTest extends CiviUnitTestCase { parent::tearDown(); } - function testFetchHttp() { + public function testFetchHttp() { $result = $this->client->fetch(self::VALID_HTTP_URL, $this->tmpFile); $this->assertEquals(CRM_Utils_HttpClient::STATUS_OK, $result); $this->assertRegExp(self::VALID_HTTP_REGEX, file_get_contents($this->tmpFile)); } - function testFetchHttps_valid() { + public function testFetchHttps_valid() { $result = $this->client->fetch(self::VALID_HTTPS_URL, $this->tmpFile); $this->assertEquals(CRM_Utils_HttpClient::STATUS_OK, $result); $this->assertRegExp(self::VALID_HTTPS_REGEX, file_get_contents($this->tmpFile)); } - function testFetchHttps_invalid_verify() { + public function testFetchHttps_invalid_verify() { $result = $this->client->fetch(self::SELF_SIGNED_HTTPS_URL, $this->tmpFile); $this->assertEquals(CRM_Utils_HttpClient::STATUS_DL_ERROR, $result); $this->assertEquals('', file_get_contents($this->tmpFile)); } - function testFetchHttps_invalid_noVerify() { + public function testFetchHttps_invalid_noVerify() { $result = civicrm_api('Setting', 'create', array( 'version' => 3, 'verifySSL' => FALSE, @@ -72,30 +72,30 @@ class CRM_Utils_HttpClientTest extends CiviUnitTestCase { $this->assertRegExp(self::SELF_SIGNED_HTTPS_REGEX, file_get_contents($this->tmpFile)); } - function testFetchHttp_badOutFile() { + public function testFetchHttp_badOutFile() { $result = $this->client->fetch(self::VALID_HTTP_URL, '/ba/d/path/too/utput'); $this->assertEquals(CRM_Utils_HttpClient::STATUS_WRITE_ERROR, $result); } - function testGetHttp() { + public function testGetHttp() { list($status, $data) = $this->client->get(self::VALID_HTTP_URL); $this->assertEquals(CRM_Utils_HttpClient::STATUS_OK, $status); $this->assertRegExp(self::VALID_HTTP_REGEX, $data); } - function testGetHttps_valid() { + public function testGetHttps_valid() { list($status, $data) = $this->client->get(self::VALID_HTTPS_URL); $this->assertEquals(CRM_Utils_HttpClient::STATUS_OK, $status); $this->assertRegExp(self::VALID_HTTPS_REGEX, $data); } - function testGetHttps_invalid_verify() { + public function testGetHttps_invalid_verify() { list($status, $data) = $this->client->get(self::SELF_SIGNED_HTTPS_URL); $this->assertEquals(CRM_Utils_HttpClient::STATUS_DL_ERROR, $status); $this->assertEquals('', $data); } - function testGetHttps_invalid_noVerify() { + public function testGetHttps_invalid_noVerify() { $result = civicrm_api('Setting', 'create', array( 'version' => 3, 'verifySSL' => FALSE, diff --git a/tests/phpunit/CRM/Utils/JSTest.php b/tests/phpunit/CRM/Utils/JSTest.php index 6d16012c09..5b29148516 100644 --- a/tests/phpunit/CRM/Utils/JSTest.php +++ b/tests/phpunit/CRM/Utils/JSTest.php @@ -34,7 +34,7 @@ class CRM_Utils_JSTest extends CiviUnitTestCase { /** * @return array */ - function translateExamples() { + public function translateExamples() { $cases = array(); $cases[] = array( '', @@ -62,7 +62,7 @@ class CRM_Utils_JSTest extends CiviUnitTestCase { ); $cases[] = array( // with arg ' - function whits() { + public function whits() { for (a in b) { mitts("wallaby", function(zoo){ alert(zoo + ts("Hello")) @@ -104,7 +104,7 @@ class CRM_Utils_JSTest extends CiviUnitTestCase { * @param array $expectedStrings * @dataProvider translateExamples */ - function testParseStrings($jsCode, $expectedStrings) { + public function testParseStrings($jsCode, $expectedStrings) { $actualStrings = CRM_Utils_JS::parseStrings($jsCode); sort($expectedStrings); sort($actualStrings); diff --git a/tests/phpunit/CRM/Utils/MailTest.php b/tests/phpunit/CRM/Utils/MailTest.php index 745e4ac937..1681b38bbe 100644 --- a/tests/phpunit/CRM/Utils/MailTest.php +++ b/tests/phpunit/CRM/Utils/MailTest.php @@ -6,7 +6,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Utils_MailTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } @@ -14,7 +14,7 @@ class CRM_Utils_MailTest extends CiviUnitTestCase { * Test case for add( ) * test with empty params. */ - function testFormatRFC822() { + public function testFormatRFC822() { $values = array( array('name' => "Test User", diff --git a/tests/phpunit/CRM/Utils/Migrate/ImportExportTest.php b/tests/phpunit/CRM/Utils/Migrate/ImportExportTest.php index c13f720ac4..f409e9fd97 100644 --- a/tests/phpunit/CRM/Utils/Migrate/ImportExportTest.php +++ b/tests/phpunit/CRM/Utils/Migrate/ImportExportTest.php @@ -7,12 +7,12 @@ require_once 'CiviTest/CiviUnitTestCase.php'; class CRM_Utils_Migrate_ImportExportTest extends CiviUnitTestCase { protected $_apiversion; - function setUp() { + public function setUp() { $this->_apiversion = 3; parent::setUp(); } - function tearDown() { + public function tearDown() { $tablesToTruncate = array( 'civicrm_custom_group', 'civicrm_custom_field', @@ -27,7 +27,7 @@ class CRM_Utils_Migrate_ImportExportTest extends CiviUnitTestCase { * load the XML into a clean DB and see if it creates matching custom-group * and custom-field. */ - function basicXmlTestCases() { + public function basicXmlTestCases() { // a small library which we use to describe test cases $fixtures = array(); $fixtures['textField'] = array( @@ -158,7 +158,7 @@ class CRM_Utils_Migrate_ImportExportTest extends CiviUnitTestCase { * @param $expectedXmlFilePath * @dataProvider basicXmlTestCases */ - function testBasicXMLExports($customGroupParams, $fieldParams, $expectedXmlFilePath) { + public function testBasicXMLExports($customGroupParams, $fieldParams, $expectedXmlFilePath) { $this->assertDBQuery(0, 'SELECT count(*) FROM civicrm_custom_group WHERE title = %1', array( 1 => array($customGroupParams['title'], 'String') )); @@ -183,7 +183,7 @@ class CRM_Utils_Migrate_ImportExportTest extends CiviUnitTestCase { * @throws CRM_Core_Exception * @dataProvider basicXmlTestCases */ - function testBasicXMLImports($expectCustomGroup, $expectCustomField, $inputXmlFilePath) { + public function testBasicXMLImports($expectCustomGroup, $expectCustomField, $inputXmlFilePath) { $this->assertDBQuery(0, 'SELECT count(*) FROM civicrm_custom_group WHERE title = %1', array( 1 => array($expectCustomGroup['title'], 'String') )); diff --git a/tests/phpunit/CRM/Utils/NumberTest.php b/tests/phpunit/CRM/Utils/NumberTest.php index 7213ff8eea..dac2682a48 100644 --- a/tests/phpunit/CRM/Utils/NumberTest.php +++ b/tests/phpunit/CRM/Utils/NumberTest.php @@ -9,7 +9,7 @@ class CRM_Utils_NumberTest extends CiviUnitTestCase { /** * @return array */ - function randomDecimalCases() { + public function randomDecimalCases() { $cases = array(); // array(array $precision, int $expectedMinInclusive, int $expectedMaxExclusive) $cases[] = array(array(1, 0), 0, 10); @@ -24,7 +24,7 @@ class CRM_Utils_NumberTest extends CiviUnitTestCase { * @param int $expectedMaxExclusive * @dataProvider randomDecimalCases */ - function testCreateRandomDecimal($precision, $expectedMinInclusive, $expectedMaxExclusive) { + public function testCreateRandomDecimal($precision, $expectedMinInclusive, $expectedMaxExclusive) { list ($sigFigs, $decFigs) = $precision; for ($i = 0; $i < 10; $i++) { $decimal = CRM_Utils_Number::createRandomDecimal($precision); @@ -42,7 +42,7 @@ class CRM_Utils_NumberTest extends CiviUnitTestCase { /** * @return array */ - function truncDecimalCases() { + public function truncDecimalCases() { $cases = array(); // array($value, $precision, $expectedValue) $cases[] = array(523, array(1,0), 5); @@ -60,7 +60,7 @@ class CRM_Utils_NumberTest extends CiviUnitTestCase { * @param $expectedValue * @dataProvider truncDecimalCases */ - function testCreateTruncatedDecimal($value, $precision, $expectedValue) { + public function testCreateTruncatedDecimal($value, $precision, $expectedValue) { list ($sigFigs, $decFigs) = $precision; $this->assertEquals($expectedValue, CRM_Utils_Number::createTruncatedDecimal($value, $precision), "assert createTruncatedValue($value, ($sigFigs,$decFigs)) == $expectedValue" diff --git a/tests/phpunit/CRM/Utils/QueryFormatterTest.php b/tests/phpunit/CRM/Utils/QueryFormatterTest.php index 1786dbb4b6..fb5281b6c3 100644 --- a/tests/phpunit/CRM/Utils/QueryFormatterTest.php +++ b/tests/phpunit/CRM/Utils/QueryFormatterTest.php @@ -7,7 +7,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Utils_QueryFormatterTest extends CiviUnitTestCase { - function dataProvider() { + public function dataProvider() { $cases = array(); // array(0=>$inputText, 1=>$language, 2=>$options, 3=>$expectedText) $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_LIKE, CRM_Utils_QueryFormatter::MODE_NONE, '%first second%'); @@ -56,7 +56,7 @@ class CRM_Utils_QueryFormatterTest extends CiviUnitTestCase { * @param $expectedText * @dataProvider dataProvider */ - function testFormat($text, $language, $mode, $expectedText) { + public function testFormat($text, $language, $mode, $expectedText) { $formatter = new CRM_Utils_QueryFormatter($mode); $actualText = $formatter->format($text, $language); $this->assertEquals($expectedText, $actualText); diff --git a/tests/phpunit/CRM/Utils/RestTest.php b/tests/phpunit/CRM/Utils/RestTest.php index 85defc9e56..55ee7784de 100644 --- a/tests/phpunit/CRM/Utils/RestTest.php +++ b/tests/phpunit/CRM/Utils/RestTest.php @@ -6,11 +6,11 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Utils_RestTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } - function testProcessMultiple() { + public function testProcessMultiple() { $_SERVER['REQUEST_METHOD'] = 'POST'; $input = array( 'cow' => array( diff --git a/tests/phpunit/CRM/Utils/RuleTest.php b/tests/phpunit/CRM/Utils/RuleTest.php index d5e0831aed..dbd31b7fbc 100644 --- a/tests/phpunit/CRM/Utils/RuleTest.php +++ b/tests/phpunit/CRM/Utils/RuleTest.php @@ -7,21 +7,21 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Utils_RuleTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } /** * @dataProvider integerDataProvider */ - function testInteger($inputData, $expectedResult) { + public function testInteger($inputData, $expectedResult) { $this->assertEquals($expectedResult, CRM_Utils_Rule::integer($inputData)); } /** * @return array */ - function integerDataProvider() { + public function integerDataProvider() { return array( array(10, TRUE), array('145E+3', FALSE), @@ -35,14 +35,14 @@ class CRM_Utils_RuleTest extends CiviUnitTestCase { /** * @dataProvider positiveDataProvider */ - function testPositive($inputData, $expectedResult) { + public function testPositive($inputData, $expectedResult) { $this->assertEquals($expectedResult, CRM_Utils_Rule::positiveInteger($inputData)); } /** * @return array */ - function positiveDataProvider() { + public function positiveDataProvider() { return array( array(10, TRUE), array('145.0E+3', FALSE), @@ -56,14 +56,14 @@ class CRM_Utils_RuleTest extends CiviUnitTestCase { /** * @dataProvider numericDataProvider */ - function testNumeric($inputData, $expectedResult) { + public function testNumeric($inputData, $expectedResult) { $this->assertEquals($expectedResult, CRM_Utils_Rule::numeric($inputData)); } /** * @return array */ - function numericDataProvider() { + public function numericDataProvider() { return array( array(10, TRUE), array('145.0E+3', FALSE), diff --git a/tests/phpunit/CRM/Utils/SQL/InsertTest.php b/tests/phpunit/CRM/Utils/SQL/InsertTest.php index 2231fb2935..4647f824a0 100644 --- a/tests/phpunit/CRM/Utils/SQL/InsertTest.php +++ b/tests/phpunit/CRM/Utils/SQL/InsertTest.php @@ -5,7 +5,7 @@ * Class CRM_Utils_SQL_SelectTest */ class CRM_Utils_SQL_InsertTest extends CiviUnitTestCase { - function testRow_twice() { + public function testRow_twice() { $insert = CRM_Utils_SQL_Insert::into('foo') ->row(array('first' => '1', 'second' => '2' )) ->row(array('second' => '2b', 'first' => '1b')) @@ -18,7 +18,7 @@ class CRM_Utils_SQL_InsertTest extends CiviUnitTestCase { $this->assertLike($expected, $insert->toSQL()); } - function testRows() { + public function testRows() { $insert = CRM_Utils_SQL_Insert::into('foo') ->row(array('first' => '1', 'second' => '2' )) ->rows(array( @@ -42,7 +42,7 @@ class CRM_Utils_SQL_InsertTest extends CiviUnitTestCase { * @param $actual * @param string $message */ - function assertLike($expected, $actual, $message = '') { + public function assertLike($expected, $actual, $message = '') { $expected = trim((preg_replace('/[ \r\n\t]+/', ' ', $expected))); $actual = trim((preg_replace('/[ \r\n\t]+/', ' ', $actual))); $this->assertEquals($expected, $actual, $message); diff --git a/tests/phpunit/CRM/Utils/SQL/SelectTest.php b/tests/phpunit/CRM/Utils/SQL/SelectTest.php index 0bd1c399fb..c0cdad913e 100644 --- a/tests/phpunit/CRM/Utils/SQL/SelectTest.php +++ b/tests/phpunit/CRM/Utils/SQL/SelectTest.php @@ -5,40 +5,40 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Class CRM_Utils_SQL_SelectTest */ class CRM_Utils_SQL_SelectTest extends CiviUnitTestCase { - function testGetDefault() { + public function testGetDefault() { $select = CRM_Utils_SQL_Select::from('foo bar'); $this->assertLike('SELECT * FROM foo bar', $select->toSQL()); } - function testGetFields() { + public function testGetFields() { $select = CRM_Utils_SQL_Select::from('foo') ->select('bar') ->select(array('whiz', 'bang')); $this->assertLike('SELECT bar, whiz, bang FROM foo', $select->toSQL()); } - function testWherePlain() { + public function testWherePlain() { $select = CRM_Utils_SQL_Select::from('foo') ->where('foo = bar') ->where(array('whiz = bang', 'frob > nicate')); $this->assertLike('SELECT * FROM foo WHERE (foo = bar) AND (whiz = bang) AND (frob > nicate)', $select->toSQL()); } - function testWhereArg() { + public function testWhereArg() { $select = CRM_Utils_SQL_Select::from('foo') ->where('foo = @value', array('@value' => 'not"valid')) ->where(array('whiz > @base', 'frob != @base'), array('@base' => 'in"valid')); $this->assertLike('SELECT * FROM foo WHERE (foo = "not\\"valid") AND (whiz > "in\\"valid") AND (frob != "in\\"valid")', $select->toSQL()); } - function testGroupByPlain() { + public function testGroupByPlain() { $select = CRM_Utils_SQL_Select::from('foo') ->groupBy("bar_id") ->groupBy(array('whiz_id*2', 'lower(bang)')); $this->assertLike('SELECT * FROM foo GROUP BY bar_id, whiz_id*2, lower(bang)', $select->toSQL()); } - function testHavingPlain() { + public function testHavingPlain() { $select = CRM_Utils_SQL_Select::from('foo') ->groupBy("bar_id") ->having('count(id) > 2') @@ -46,7 +46,7 @@ class CRM_Utils_SQL_SelectTest extends CiviUnitTestCase { $this->assertLike('SELECT * FROM foo GROUP BY bar_id HAVING (count(id) > 2) AND (sum(id) > 10) AND (avg(id) < 200)', $select->toSQL()); } - function testHavingArg() { + public function testHavingArg() { $select = CRM_Utils_SQL_Select::from('foo') ->groupBy("bar_id") ->having('count(id) > #mincnt', array('#mincnt' => 2)) @@ -54,33 +54,33 @@ class CRM_Utils_SQL_SelectTest extends CiviUnitTestCase { $this->assertLike('SELECT * FROM foo GROUP BY bar_id HAVING (count(id) > 2) AND (sum(id) > 10) AND (avg(id) < 10)', $select->toSQL()); } - function testOrderByPlain() { + public function testOrderByPlain() { $select = CRM_Utils_SQL_Select::from('foo bar') ->orderBy('first asc') ->orderBy(array('second desc', 'third')); $this->assertLike('SELECT * FROM foo bar ORDER BY first asc, second desc, third', $select->toSQL()); } - function testLimit_defaultOffset() { + public function testLimit_defaultOffset() { $select = CRM_Utils_SQL_Select::from('foo bar') ->limit(20); $this->assertLike('SELECT * FROM foo bar LIMIT 20 OFFSET 0', $select->toSQL()); } - function testLimit_withOffset() { + public function testLimit_withOffset() { $select = CRM_Utils_SQL_Select::from('foo bar') ->limit(20, 60); $this->assertLike('SELECT * FROM foo bar LIMIT 20 OFFSET 60', $select->toSQL()); } - function testLimit_disable() { + public function testLimit_disable() { $select = CRM_Utils_SQL_Select::from('foo bar') ->limit(20, 60) ->limit(NULL, NULL); $this->assertLike('SELECT * FROM foo bar', $select->toSQL()); } - function testBig() { + public function testBig() { $select = CRM_Utils_SQL_Select::from('foo') ->select('foo.id') ->join('rel1', 'INNER JOIN rel1_table rel1 ON foo.id = rel1.foo_id') @@ -103,7 +103,7 @@ class CRM_Utils_SQL_SelectTest extends CiviUnitTestCase { ); } - function testInterpolate() { + public function testInterpolate() { $actual = CRM_Utils_SQL_Select::from('ignore')->interpolate( '@escaped !unescaped #validated', array( @@ -115,7 +115,7 @@ class CRM_Utils_SQL_SelectTest extends CiviUnitTestCase { $this->assertLike('"foo\"bar" concat(foo,bar) 15.2', $actual); } - function testInterpolateArray() { + public function testInterpolateArray() { $actual = CRM_Utils_SQL_Select::from('ignore')->interpolate( '(@escaped) (!unescaped) (#validated)', array( @@ -127,7 +127,7 @@ class CRM_Utils_SQL_SelectTest extends CiviUnitTestCase { $this->assertLike('("foo\\"bar", "whiz", "null", NULL, "bang") (foo"bar, bar) (1, 10, NULL, 100.1)', $actual); } - function testInterpolateBadNumber() { + public function testInterpolateBadNumber() { try { $result = CRM_Utils_SQL_Select::from('ignore')->interpolate('#num', array( '#num' => '5not-a-number5' @@ -147,7 +147,7 @@ class CRM_Utils_SQL_SelectTest extends CiviUnitTestCase { } } - function testInterpolateBadKey() { + public function testInterpolateBadKey() { try { $result = CRM_Utils_SQL_Select::from('ignore')->interpolate('this is a {var}', array( '{var}' => 'not a well-formed variable name' @@ -163,7 +163,7 @@ class CRM_Utils_SQL_SelectTest extends CiviUnitTestCase { * @param $actual * @param string $message */ - function assertLike($expected, $actual, $message = '') { + public function assertLike($expected, $actual, $message = '') { $expected = trim((preg_replace('/[ \r\n\t]+/', ' ', $expected))); $actual = trim((preg_replace('/[ \r\n\t]+/', ' ', $actual))); $this->assertEquals($expected, $actual, $message); diff --git a/tests/phpunit/CRM/Utils/SignerTest.php b/tests/phpunit/CRM/Utils/SignerTest.php index 62e1d28310..7239790671 100644 --- a/tests/phpunit/CRM/Utils/SignerTest.php +++ b/tests/phpunit/CRM/Utils/SignerTest.php @@ -31,11 +31,11 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Utils_SignerTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } - function testSignValidate() { + public function testSignValidate() { $cases = array(); $cases[] = array( 'signParams' => array( diff --git a/tests/phpunit/CRM/Utils/StringTest.php b/tests/phpunit/CRM/Utils/StringTest.php index 44da91d47f..e73a379d4a 100644 --- a/tests/phpunit/CRM/Utils/StringTest.php +++ b/tests/phpunit/CRM/Utils/StringTest.php @@ -6,11 +6,11 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Utils_StringTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } - function testStripPathChars() { + public function testStripPathChars() { $testSet = array( '' => '', NULL => NULL, @@ -28,7 +28,7 @@ class CRM_Utils_StringTest extends CiviUnitTestCase { } } - function testExtractName() { + public function testExtractName() { $cases = array( array( 'full_name' => 'Alan', @@ -77,7 +77,7 @@ class CRM_Utils_StringTest extends CiviUnitTestCase { } } - function testEllipsify() { + public function testEllipsify() { $maxLen = 5; $cases = array( '1' => '1', @@ -89,7 +89,7 @@ class CRM_Utils_StringTest extends CiviUnitTestCase { } } - function testRandom() { + public function testRandom() { for ($i = 0; $i < 4; $i++) { $actual = CRM_Utils_String::createRandom(4, 'abc'); $this->assertEquals(4, strlen($actual)); @@ -121,7 +121,7 @@ class CRM_Utils_StringTest extends CiviUnitTestCase { $this->assertEquals($expected, $actual); } - function booleanDataProvider() { + public function booleanDataProvider() { $cases = array(); // array(0 => $input, 1 => $expectedOutput) $cases[] = array(TRUE, TRUE); $cases[] = array(FALSE, FALSE); @@ -151,7 +151,7 @@ class CRM_Utils_StringTest extends CiviUnitTestCase { * @param $expected bool * @dataProvider booleanDataProvider */ - function testStrToBool($input, $expected) { + public function testStrToBool($input, $expected) { $actual = CRM_Utils_String::strtobool($input); $this->assertTrue($expected === $actual); } diff --git a/tests/phpunit/CRM/Utils/SystemTest.php b/tests/phpunit/CRM/Utils/SystemTest.php index 0e1e2aaa3a..e67b75a601 100644 --- a/tests/phpunit/CRM/Utils/SystemTest.php +++ b/tests/phpunit/CRM/Utils/SystemTest.php @@ -7,11 +7,11 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Utils_SystemTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } - function testUrlQueryString() { + public function testUrlQueryString() { $config = CRM_Core_Config::singleton(); $this->assertTrue($config->userSystem instanceof CRM_Utils_System_UnitTests); $expected = '/index.php?q=civicrm/foo/bar&foo=ab&bar=cd%26ef'; @@ -19,7 +19,7 @@ class CRM_Utils_SystemTest extends CiviUnitTestCase { $this->assertEquals($expected, $actual); } - function testUrlQueryArray() { + public function testUrlQueryArray() { $config = CRM_Core_Config::singleton(); $this->assertTrue($config->userSystem instanceof CRM_Utils_System_UnitTests); $expected = '/index.php?q=civicrm/foo/bar&foo=ab&bar=cd%26ef'; diff --git a/tests/phpunit/CRM/Utils/TimeTest.php b/tests/phpunit/CRM/Utils/TimeTest.php index 691f5c9fcb..eb2e6ba30b 100644 --- a/tests/phpunit/CRM/Utils/TimeTest.php +++ b/tests/phpunit/CRM/Utils/TimeTest.php @@ -22,7 +22,7 @@ class CRM_Utils_TimeTest extends CiviUnitTestCase { * @param bool $expectedResult * @dataProvider equalCases */ - function testEquals($timeA, $timeB, $threshold, $expectedResult) { + public function testEquals($timeA, $timeB, $threshold, $expectedResult) { $actual = CRM_Utils_Time::isEqual($timeA, $timeB, $threshold); $this->assertEquals($expectedResult, $actual); diff --git a/tests/phpunit/CRM/Utils/TypeTest.php b/tests/phpunit/CRM/Utils/TypeTest.php index 84573b848b..301136e2b5 100644 --- a/tests/phpunit/CRM/Utils/TypeTest.php +++ b/tests/phpunit/CRM/Utils/TypeTest.php @@ -7,21 +7,21 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Utils_TypeTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); } /** * @dataProvider validateDataProvider */ - function testValidate($inputData, $inputType, $expectedResult) { + public function testValidate($inputData, $inputType, $expectedResult) { $this->assertEquals($expectedResult, CRM_Utils_Type::validate($inputData, $inputType, FALSE)); } /** * @return array */ - function validateDataProvider() { + public function validateDataProvider() { return array( array(10, 'Int', 10), array('145E+3', 'Int', NULL), diff --git a/tests/phpunit/CRM/Utils/ZipTest.php b/tests/phpunit/CRM/Utils/ZipTest.php index f76774603a..5ad3cb533e 100644 --- a/tests/phpunit/CRM/Utils/ZipTest.php +++ b/tests/phpunit/CRM/Utils/ZipTest.php @@ -31,75 +31,75 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class CRM_Utils_ZipTest extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); $this->file = FALSE; } - function tearDown() { + public function tearDown() { parent::tearDown(); if ($this->file) { unlink($this->file); } } - function testFindBaseDirName_normal() { + public function testFindBaseDirName_normal() { $this->_doFindBaseDirName('author-com.example.foo-random/', array('author-com.example.foo-random'), array('author-com.example.foo-random/README.txt' => 'hello') ); } - function testFindBaseDirName_0() { + public function testFindBaseDirName_0() { $this->_doFindBaseDirName('0/', array('0'), array() ); } - function testFindBaseDirName_plainfile() { + public function testFindBaseDirName_plainfile() { $this->_doFindBaseDirName(FALSE, array(), array('README.txt' => 'hello') ); } - function testFindBaseDirName_twodir() { + public function testFindBaseDirName_twodir() { $this->_doFindBaseDirName(FALSE, array('dir-1', 'dir-2'), array('dir-1/README.txt' => 'hello') ); } - function testFindBaseDirName_dirfile() { + public function testFindBaseDirName_dirfile() { $this->_doFindBaseDirName(FALSE, array('dir-1'), array('dir-1/README.txt' => 'hello', 'MANIFEST.MF' => 'extra') ); } - function testFindBaseDirName_dot() { + public function testFindBaseDirName_dot() { $this->_doFindBaseDirName(FALSE, array('.'), array('./README.txt' => 'hello') ); } - function testFindBaseDirName_dots() { + public function testFindBaseDirName_dots() { $this->_doFindBaseDirName(FALSE, array('..'), array('../README.txt' => 'hello') ); } - function testFindBaseDirName_weird() { + public function testFindBaseDirName_weird() { $this->_doFindBaseDirName(FALSE, array('foo/../'), array('foo/../README.txt' => 'hello') ); } - function testGuessBaseDir_normal() { + public function testGuessBaseDir_normal() { $this->_doGuessBaseDir('author-com.example.foo-random', array('author-com.example.foo-random'), array('author-com.example.foo-random/README.txt' => 'hello'), @@ -107,7 +107,7 @@ class CRM_Utils_ZipTest extends CiviUnitTestCase { ); } - function testGuessBaseDir_MACOSX() { + public function testGuessBaseDir_MACOSX() { $this->_doGuessBaseDir('com.example.foo', array('com.example.foo', '__MACOSX'), array('author-com.example.foo-random/README.txt' => 'hello', '__MACOSX/foo' => 'bar'), @@ -115,7 +115,7 @@ class CRM_Utils_ZipTest extends CiviUnitTestCase { ); } - function testGuessBaseDir_0() { + public function testGuessBaseDir_0() { $this->_doGuessBaseDir('0', array('0'), array(), @@ -123,7 +123,7 @@ class CRM_Utils_ZipTest extends CiviUnitTestCase { ); } - function testGuessBaseDir_plainfile() { + public function testGuessBaseDir_plainfile() { $this->_doGuessBaseDir(FALSE, array(), array('README.txt' => 'hello'), @@ -131,7 +131,7 @@ class CRM_Utils_ZipTest extends CiviUnitTestCase { ); } - function testGuessBaseDir_twodir() { + public function testGuessBaseDir_twodir() { $this->_doGuessBaseDir(FALSE, array('dir-1', 'dir-2'), array('dir-1/README.txt' => 'hello'), @@ -139,7 +139,7 @@ class CRM_Utils_ZipTest extends CiviUnitTestCase { ); } - function testGuessBaseDir_weird() { + public function testGuessBaseDir_weird() { $this->_doGuessBaseDir(FALSE, array('foo/../'), array('foo/../README.txt' => 'hello'), @@ -152,7 +152,7 @@ class CRM_Utils_ZipTest extends CiviUnitTestCase { * @param $dirs * @param $files */ - function _doFindBaseDirName($expectedBaseDirName, $dirs, $files) { + public function _doFindBaseDirName($expectedBaseDirName, $dirs, $files) { $this->file = tempnam(sys_get_temp_dir(), 'testzip-'); $this->assertTrue(CRM_Utils_Zip::createTestZip($this->file, $dirs, $files)); @@ -167,7 +167,7 @@ class CRM_Utils_ZipTest extends CiviUnitTestCase { * @param $files * @param $expectedKey */ - function _doGuessBaseDir($expectedResult, $dirs, $files, $expectedKey) { + public function _doGuessBaseDir($expectedResult, $dirs, $files, $expectedKey) { $this->file = tempnam(sys_get_temp_dir(), 'testzip-'); $this->assertTrue(CRM_Utils_Zip::createTestZip($this->file, $dirs, $files)); diff --git a/tests/phpunit/CRM/Utils/versionCheckTest.php b/tests/phpunit/CRM/Utils/versionCheckTest.php index 1153fc422e..a2d28d2dd4 100644 --- a/tests/phpunit/CRM/Utils/versionCheckTest.php +++ b/tests/phpunit/CRM/Utils/versionCheckTest.php @@ -7,7 +7,7 @@ class CRM_Utils_versionCheckTest extends CiviUnitTestCase { /** * @return array */ - function get_info() { + public function get_info() { return array( 'name' => 'VersionCheck Test', 'description' => 'Test versionCheck functionality', @@ -15,7 +15,7 @@ class CRM_Utils_versionCheckTest extends CiviUnitTestCase { ); } - function setUp() { + public function setUp() { parent::setUp(); } @@ -104,7 +104,7 @@ class CRM_Utils_versionCheckTest extends CiviUnitTestCase { * @param array $versionInfo * @param mixed $expectedResult */ - function testNewerVersion($localVersion, $versionInfo, $expectedResult) { + public function testNewerVersion($localVersion, $versionInfo, $expectedResult) { $vc = CRM_Utils_VersionCheck::singleton(); // These values are set by the constructor but for testing we override them $vc->localVersion = $localVersion; @@ -116,7 +116,7 @@ class CRM_Utils_versionCheckTest extends CiviUnitTestCase { /** * @return array (localVersion, versionInfo, expectedResult) */ - function newerVersionDataProvider() { + public function newerVersionDataProvider() { $data = array(); // Make sure we do not get unstable release updates for a stable localVersion @@ -140,7 +140,7 @@ class CRM_Utils_versionCheckTest extends CiviUnitTestCase { * @param array $versionInfo * @param bool $expectedResult */ - function testSecurityUpdate($localVersion, $versionInfo, $expectedResult) { + public function testSecurityUpdate($localVersion, $versionInfo, $expectedResult) { $vc = CRM_Utils_VersionCheck::singleton(); // These values are set by the constructor but for testing we override them $vc->localVersion = $localVersion; @@ -152,7 +152,7 @@ class CRM_Utils_versionCheckTest extends CiviUnitTestCase { /** * @return array (localVersion, versionInfo, expectedResult) */ - function securityUpdateDataProvider() { + public function securityUpdateDataProvider() { $data = array(); // Make sure we get alerted if a security release is available diff --git a/tests/phpunit/Civi/API/KernelTest.php b/tests/phpunit/Civi/API/KernelTest.php index 512c08cd82..2039b446ce 100644 --- a/tests/phpunit/Civi/API/KernelTest.php +++ b/tests/phpunit/Civi/API/KernelTest.php @@ -32,7 +32,7 @@ class KernelTest extends \CiviUnitTestCase { $this->kernel = new Kernel($this->dispatcher); } - function testNormalEvents() { + public function testNormalEvents() { $this->kernel->registerApiProvider($this->createWidgetFrobnicateProvider()); $result = $this->kernel->run('Widget', 'frobnicate', array( 'version' => self::MOCK_VERSION, @@ -48,7 +48,7 @@ class KernelTest extends \CiviUnitTestCase { $this->assertEquals('frob', $result['values'][98]); } - function testResolveException() { + public function testResolveException() { $test = $this; $this->dispatcher->addListener(Events::RESOLVE, function () { throw new \API_Exception('Oh My God', 'omg', array('the' => 'badzes')); diff --git a/tests/phpunit/Civi/API/RequestTest.php b/tests/phpunit/Civi/API/RequestTest.php index 594578f051..5c119152a9 100644 --- a/tests/phpunit/Civi/API/RequestTest.php +++ b/tests/phpunit/Civi/API/RequestTest.php @@ -10,7 +10,7 @@ class RequestTest extends \CiviUnitTestCase { /** * @return array */ - function v4options() { + public function v4options() { $cases = array(); // array(0 => $requestParams, 1 => $expectedOptions, 2 => $expectedData, 3 => $expectedChains) $cases[] = array( array('version' => 4), // requestParams @@ -80,7 +80,7 @@ class RequestTest extends \CiviUnitTestCase { * @param $expectedChains * @dataProvider v4options */ - function testCreateRequest_v4Options($inputParams, $expectedOptions, $expectedData, $expectedChains) { + public function testCreateRequest_v4Options($inputParams, $expectedOptions, $expectedData, $expectedChains) { $apiRequest = Request::create('MyEntity', 'MyAction', $inputParams, NULL); $this->assertEquals($expectedOptions, $apiRequest['options']->getArray()); $this->assertEquals($expectedData, $apiRequest['data']->getArray()); @@ -90,21 +90,21 @@ class RequestTest extends \CiviUnitTestCase { /** * @expectedException \API_Exception */ - function testCreateRequest_v4BadEntity() { + public function testCreateRequest_v4BadEntity() { Request::create('Not!Valid', 'create', array('version' => 4), NULL); } /** * @expectedException \API_Exception */ - function testCreateRequest_v4BadAction() { + public function testCreateRequest_v4BadAction() { Request::create('MyEntity', 'bad!action', array('version' => 4), NULL); } /** * @return array */ - function validEntityActionPairs() { + public function validEntityActionPairs() { $cases = array(); $cases[] = array( array('MyEntity', 'MyAction', 3), @@ -124,7 +124,7 @@ class RequestTest extends \CiviUnitTestCase { /** * @dataProvider validEntityActionPairs */ - function testCreateRequest_EntityActionMunging($input, $expected) { + public function testCreateRequest_EntityActionMunging($input, $expected) { list ($inEntity, $inAction, $inVersion) = $input; $apiRequest = Request::create($inEntity, $inAction, array('version' => $inVersion), NULL); $this->assertEquals($expected, array($apiRequest['entity'], $apiRequest['action'], $apiRequest['version'])); @@ -133,7 +133,7 @@ class RequestTest extends \CiviUnitTestCase { /** * @return array */ - function invalidEntityActionPairs() { + public function invalidEntityActionPairs() { $cases = array(); $cases[] = array('My+Entity', 'MyAction', 4); $cases[] = array('My Entity', 'MyAction', 4); @@ -148,7 +148,7 @@ class RequestTest extends \CiviUnitTestCase { * @dataProvider invalidEntityActionPairs * @expectedException \API_Exception */ - function testCreateRequest_InvalidEntityAction($inEntity, $inAction, $inVersion) { + public function testCreateRequest_InvalidEntityAction($inEntity, $inAction, $inVersion) { Request::create($inEntity, $inAction, array('version' => $inVersion), NULL); } diff --git a/tests/phpunit/Civi/API/Subscriber/DynamicFKAuthorizationTest.php b/tests/phpunit/Civi/API/Subscriber/DynamicFKAuthorizationTest.php index 8ef96bfd1f..0a997e18b9 100644 --- a/tests/phpunit/Civi/API/Subscriber/DynamicFKAuthorizationTest.php +++ b/tests/phpunit/Civi/API/Subscriber/DynamicFKAuthorizationTest.php @@ -103,7 +103,7 @@ class DynamicFKAuthorizationTest extends \CiviUnitTestCase { \CRM_Core_DAO_AllCoreTables::init(TRUE); } - function okDataProvider() { + public function okDataProvider() { $cases = array(); $cases[] = array('Widget', 'create', array('id' => self::WIDGET_ID)); @@ -121,7 +121,7 @@ class DynamicFKAuthorizationTest extends \CiviUnitTestCase { return $cases; } - function badDataProvider() { + public function badDataProvider() { $cases = array(); $cases[] = array('Forbidden', 'create', array('id' => self::FORBIDDEN_ID), '/Authorization failed/'); @@ -161,7 +161,7 @@ class DynamicFKAuthorizationTest extends \CiviUnitTestCase { * @param $params * @dataProvider okDataProvider */ - function testOk($entity, $action, $params) { + public function testOk($entity, $action, $params) { $params['version'] = 3; $params['debug'] = 1; $params['check_permissions'] = 1; @@ -180,7 +180,7 @@ class DynamicFKAuthorizationTest extends \CiviUnitTestCase { * @param $params * @dataProvider badDataProvider */ - function testBad($entity, $action, $params, $expectedError) { + public function testBad($entity, $action, $params, $expectedError) { $params['version'] = 3; $params['debug'] = 1; $params['check_permissions'] = 1; diff --git a/tests/phpunit/Civi/API/Subscriber/TransactionSubscriberTest.php b/tests/phpunit/Civi/API/Subscriber/TransactionSubscriberTest.php index e56b05ae72..1dc87c5969 100644 --- a/tests/phpunit/Civi/API/Subscriber/TransactionSubscriberTest.php +++ b/tests/phpunit/Civi/API/Subscriber/TransactionSubscriberTest.php @@ -7,7 +7,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ class TransactionSubscriberTest extends \CiviUnitTestCase { - function transactionOptions() { + public function transactionOptions() { $r = array(); // $r[] = array(string $entity, string $action, array $params, bool $isTransactional, bool $isForceRollback, bool $isNested); @@ -49,7 +49,7 @@ class TransactionSubscriberTest extends \CiviUnitTestCase { * Ensure that API parameters "is_transactional" and "force_rollback" are parsed correctly * @dataProvider transactionOptions */ - function testTransactionOptions($version, $entity, $action, $params, $isTransactional, $isForceRollback, $isNested) { + public function testTransactionOptions($version, $entity, $action, $params, $isTransactional, $isForceRollback, $isNested) { $txs = new TransactionSubscriber(); $apiProvider = NULL; @@ -61,7 +61,7 @@ class TransactionSubscriberTest extends \CiviUnitTestCase { $this->assertEquals($isNested, $txs->isNested($apiProvider, $apiRequest), 'check isNested'); } - function testForceRollback() { + public function testForceRollback() { $result = $this->callAPISuccess('contact', 'create', array( 'contact_type' => 'Individual', 'first_name' => 'Me', diff --git a/tests/phpunit/Civi/CCase/SequenceListenerTest.php b/tests/phpunit/Civi/CCase/SequenceListenerTest.php index 157759bf9e..143f6896e0 100644 --- a/tests/phpunit/Civi/CCase/SequenceListenerTest.php +++ b/tests/phpunit/Civi/CCase/SequenceListenerTest.php @@ -93,7 +93,7 @@ class SequenceListenerTest extends \CiviCaseTestCase { * @param $caseTypes * @see \CRM_Utils_Hook::caseTypes */ - function hook_caseTypes(&$caseTypes) { + public function hook_caseTypes(&$caseTypes) { $caseTypes[$this->caseType] = array( 'module' => 'org.civicrm.hrcase', 'name' => $this->caseType, @@ -101,7 +101,7 @@ class SequenceListenerTest extends \CiviCaseTestCase { ); } - function assertApproxTime($expected, $actual, $tolerance = 1) { + public function assertApproxTime($expected, $actual, $tolerance = 1) { $diff = abs(strtotime($expected) - strtotime($actual)); $this->assertTrue($diff <= $tolerance, sprintf("Check approx time equality. expected=[%s] actual=[%s] tolerance=[%s]", $expected, $actual, $tolerance @@ -115,7 +115,7 @@ class SequenceListenerTest extends \CiviCaseTestCase { * @param $key * @return mixed */ - static function ag($array, $key) { + public static function ag($array, $key) { return $array[$key]; } } \ No newline at end of file diff --git a/tests/phpunit/CiviTest/AuthorizeNet.php b/tests/phpunit/CiviTest/AuthorizeNet.php index ada476fee0..bbec7b38bc 100644 --- a/tests/phpunit/CiviTest/AuthorizeNet.php +++ b/tests/phpunit/CiviTest/AuthorizeNet.php @@ -9,7 +9,7 @@ class AuthorizeNet extends PHPUnit_Framework_Testcase { * a payment processor of type Authorize.net * @return CRM_Financial_DAO_PaymentProcessor */ - function create() { + public function create() { $paymentProcessor = new CRM_Financial_DAO_PaymentProcessor(); $paymentParams = array( @@ -39,7 +39,7 @@ class AuthorizeNet extends PHPUnit_Framework_Testcase { * @return boolean true if payment processor deleted, false otherwise * */ - function delete($id) { + public function delete($id) { $paymentProcessor = new CRM_Financial_DAO_PaymentProcessor(); $paymentProcessor->id = $id; if ($paymentProcessor->find(TRUE)) { diff --git a/tests/phpunit/CiviTest/CiviCaseTestCase.php b/tests/phpunit/CiviTest/CiviCaseTestCase.php index d08a8f5017..41a76a38c9 100644 --- a/tests/phpunit/CiviTest/CiviCaseTestCase.php +++ b/tests/phpunit/CiviTest/CiviCaseTestCase.php @@ -128,7 +128,7 @@ class CiviCaseTestCase extends CiviUnitTestCase { * * @access protected */ - function tearDown() { + public function tearDown() { $this->quickCleanup($this->tablesToTruncate, TRUE); $this->customDirectories(array('template_path' => FALSE)); CRM_Case_XMLRepository::singleton(TRUE); @@ -140,6 +140,6 @@ class CiviCaseTestCase extends CiviUnitTestCase { * @param $caseTypes * @see CRM_Utils_Hook::caseTypes */ - function hook_caseTypes(&$caseTypes) { + public function hook_caseTypes(&$caseTypes) { } } \ No newline at end of file diff --git a/tests/phpunit/CiviTest/CiviDBAssert.php b/tests/phpunit/CiviTest/CiviDBAssert.php index 9926770b62..1a39267ada 100644 --- a/tests/phpunit/CiviTest/CiviDBAssert.php +++ b/tests/phpunit/CiviTest/CiviDBAssert.php @@ -44,7 +44,7 @@ class CiviDBAssert { * that a DELETE occurred * @delete boolean True if we're checking that a DELETE action occurred. */ - function assertDBState(&$testCase, $daoName, $id, $match, $delete = FALSE) { + public function assertDBState(&$testCase, $daoName, $id, $match, $delete = FALSE) { if (empty($id)) { // adding this here since developers forget to check for an id // and hence we get the first value in the db @@ -91,7 +91,7 @@ class CiviDBAssert { /** * Request a record from the DB by seachColumn+searchValue. Success if a record is found. */ - function assertDBNotNull(&$testCase, $daoName, $searchValue, $returnColumn, $searchColumn, $message) { + public function assertDBNotNull(&$testCase, $daoName, $searchValue, $returnColumn, $searchColumn, $message) { if (empty($searchValue)) { $testCase->fail("empty value passed to assertDBNotNull"); } @@ -104,7 +104,7 @@ class CiviDBAssert { /** * Request a record from the DB by seachColumn+searchValue. Success if returnColumn value is NULL. */ - function assertDBNull(&$testCase, $daoName, $searchValue, $returnColumn, $searchColumn, $message) { + public function assertDBNull(&$testCase, $daoName, $searchValue, $returnColumn, $searchColumn, $message) { $value = CRM_Core_DAO::getFieldValue($daoName, $searchValue, $returnColumn, $searchColumn); $testCase->assertNull($value, $message); } @@ -112,7 +112,7 @@ class CiviDBAssert { /** * Request a record from the DB by id. Success if row not found. */ - function assertDBRowNotExist(&$testCase, $daoName, $id, $message) { + public function assertDBRowNotExist(&$testCase, $daoName, $id, $message) { $value = CRM_Core_DAO::getFieldValue($daoName, $id, 'id', 'id'); $testCase->assertNull($value, $message); } @@ -138,7 +138,7 @@ class CiviDBAssert { /** * Compare all values in a single retrieved DB record to an array of expected values */ - function assertDBCompareValues(&$testCase, $daoName, $searchParams, $expectedValues) { + public function assertDBCompareValues(&$testCase, $daoName, $searchParams, $expectedValues) { //get the values from db $dbValues = array(); CRM_Core_DAO::commonRetrieve($daoName, $searchParams, $dbValues); @@ -153,7 +153,7 @@ class CiviDBAssert { * @param $expectedValues * @param $actualValues */ - function assertAttributesEquals(&$testCase, &$expectedValues, &$actualValues) { + public function assertAttributesEquals(&$testCase, &$expectedValues, &$actualValues) { foreach ($expectedValues as $paramName => $paramValue) { if (isset($actualValues[$paramName])) { $testCase->assertEquals($paramValue, $actualValues[$paramName]); diff --git a/tests/phpunit/CiviTest/CiviMailUtils.php b/tests/phpunit/CiviTest/CiviMailUtils.php index d5f7522ccf..d8d77caadb 100644 --- a/tests/phpunit/CiviTest/CiviMailUtils.php +++ b/tests/phpunit/CiviTest/CiviMailUtils.php @@ -64,7 +64,7 @@ class CiviMailUtils extends PHPUnit_Framework_TestCase { * @param CiviSeleniumTestCase|CiviUnitTestCase $unit_test The currently running test * @param bool $startImmediately Start writing to db now or wait until start() is called */ - function __construct(&$unit_test, $startImmediately = TRUE) { + public function __construct(&$unit_test, $startImmediately = TRUE) { $this->_ut = $unit_test; // Check if running under webtests or not @@ -80,7 +80,7 @@ class CiviMailUtils extends PHPUnit_Framework_TestCase { /** * Start writing emails to db instead of current option */ - function start() { + public function start() { if ($this->_webtest) { // Change outbound mail setting $this->_ut->openCiviPage('admin/setting/smtp', "reset=1", "_qf_Smtp_next"); @@ -116,7 +116,7 @@ class CiviMailUtils extends PHPUnit_Framework_TestCase { } } - function stop() { + public function stop() { if ($this->_webtest) { if ($this->_outBound_option != CRM_Mailing_Config::OUTBOUND_OPTION_REDIRECT_TO_DB) { // Change outbound mail setting @@ -149,7 +149,7 @@ class CiviMailUtils extends PHPUnit_Framework_TestCase { * * @return ezcMail|string */ - function getMostRecentEmail($type = 'raw') { + public function getMostRecentEmail($type = 'raw') { $msg = ''; if ($this->_webtest) { @@ -193,7 +193,7 @@ class CiviMailUtils extends PHPUnit_Framework_TestCase { * @throws Exception * @return array(ezcMail)|array(string) */ - function getAllMessages($type = 'raw') { + public function getAllMessages($type = 'raw') { $msgs = array(); if ($this->_webtest) { @@ -224,7 +224,7 @@ class CiviMailUtils extends PHPUnit_Framework_TestCase { /** * @return int */ - function getSelectedOutboundOption() { + public function getSelectedOutboundOption() { $selectedOption = CRM_Mailing_Config::OUTBOUND_OPTION_MAIL; // Is there a better way to do this? How do you get the currently selected value of a radio button in selenium? for ($i = 0; $i <= 5; $i++) { @@ -252,7 +252,7 @@ class CiviMailUtils extends PHPUnit_Framework_TestCase { * * @return \ezcMail|string */ - function checkMailLog($strings, $absentStrings = array(), $prefix = '') { + public function checkMailLog($strings, $absentStrings = array(), $prefix = '') { $mail = $this->getMostRecentEmail('raw'); foreach ($strings as $string) { $this->_ut->assertContains($string, $mail, "$string . not found in $mail $prefix"); @@ -267,7 +267,7 @@ class CiviMailUtils extends PHPUnit_Framework_TestCase { /** * Check that mail log is empty */ - function assertMailLogEmpty($prefix = '') { + public function assertMailLogEmpty($prefix = '') { $mail = $this->getMostRecentEmail('raw'); $this->_ut->assertEmpty($mail, 'mail sent when it should not have been ' . $prefix); } @@ -277,7 +277,7 @@ class CiviMailUtils extends PHPUnit_Framework_TestCase { * * @param array $expectedRecipients array($msgPos => array($recipPos => $emailAddr)) */ - function assertRecipients($expectedRecipients) { + public function assertRecipients($expectedRecipients) { $recipients = array(); foreach ($this->getAllMessages('ezc') as $message) { $recipients[] = CRM_Utils_Array::collect('email', $message->to); @@ -294,7 +294,7 @@ class CiviMailUtils extends PHPUnit_Framework_TestCase { /** * Remove any sent messages from the log */ - function clearMessages() { + public function clearMessages() { if ($this->_webtest) { throw new Exception("Not implementated: clearMessages for WebTest"); } diff --git a/tests/phpunit/CiviTest/CiviReportTestCase.php b/tests/phpunit/CiviTest/CiviReportTestCase.php index f05efea21a..7e266ad929 100644 --- a/tests/phpunit/CiviTest/CiviReportTestCase.php +++ b/tests/phpunit/CiviTest/CiviReportTestCase.php @@ -31,12 +31,12 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Class CiviReportTestCase */ class CiviReportTestCase extends CiviUnitTestCase { - function setUp() { + public function setUp() { parent::setUp(); $this->_sethtmlGlobals(); } - function tearDown() { + public function tearDown() { // TODO Figure out how to automatically drop all temporary tables. // Note that MySQL doesn't provide a way to list them, so we would need // to keep track ourselves (eg CRM_Core_TemporaryTableManager) or reset @@ -53,7 +53,7 @@ class CiviReportTestCase extends CiviUnitTestCase { * @return string * @throws Exception */ - function getReportOutputAsCsv($reportClass, $inputParams) { + public function getReportOutputAsCsv($reportClass, $inputParams) { $config = CRM_Core_Config::singleton(); $config->keyDisable = TRUE; $controller = new CRM_Core_Controller_Simple($reportClass, ts('some title')); @@ -105,7 +105,7 @@ class CiviReportTestCase extends CiviUnitTestCase { * * @return array */ - function getArrayFromCsv($csvFile) { + public function getArrayFromCsv($csvFile) { $arrFile = array(); if (($handle = fopen($csvFile, "r")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { diff --git a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php index 2ebe9af9e0..9f109a5935 100644 --- a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php +++ b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php @@ -63,7 +63,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @param string $dataName * @param array $browser */ - function __construct($name = NULL, array$data = array(), $dataName = '', array$browser = array()) { + public function __construct($name = NULL, array$data = array(), $dataName = '', array$browser = array()) { parent::__construct($name, $data, $dataName, $browser); $this->loggedInAs = NULL; @@ -154,7 +154,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @param $user: (str) the key 'user' or 'admin', or a literal username * @param $pass: (str) if $user is a literal username and not 'user' or 'admin', supply the password */ - function webtestLogin($user = 'user', $pass = NULL) { + public function webtestLogin($user = 'user', $pass = NULL) { // If already logged in as correct user, do nothing if ($this->loggedInAs === $user) { return; @@ -179,7 +179,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { $this->loggedInAs = $user; } - function webtestLogout() { + public function webtestLogout() { if ($this->loggedInAs) { $this->open($this->sboxPath . "user/logout"); $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -198,7 +198,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * opening all civi pages, and using the $args param is also strongly encouraged * This will make it much easier to run webtests in other CMSs in the future */ - function openCiviPage($url, $args = NULL, $waitFor = 'civicrm-footer') { + public function openCiviPage($url, $args = NULL, $waitFor = 'civicrm-footer') { // Construct full url with args // This could be extended in future to work with other CMS style urls if ($args) { @@ -226,7 +226,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * Wait for the page to load * Wait for an element to be present */ - function clickLink($element, $waitFor = 'civicrm-footer', $waitForPageLoad = TRUE) { + public function clickLink($element, $waitFor = 'civicrm-footer', $waitForPageLoad = TRUE) { $this->click($element); // conditional wait for page load e.g for ajax form save if ($waitForPageLoad) { @@ -243,7 +243,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @param string $element * @param string $waitFor */ - function clickPopupLink($element, $waitFor=NULL) { + public function clickPopupLink($element, $waitFor=NULL) { $this->clickAjaxLink($element, 'css=.ui-dialog'); if ($waitFor) { $this->waitForElementPresent($waitFor); @@ -255,7 +255,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @param string $element * @param string $waitFor */ - function clickAjaxLink($element, $waitFor=NULL) { + public function clickAjaxLink($element, $waitFor=NULL) { $this->click($element); if ($waitFor) { $this->waitForElementPresent($waitFor); @@ -269,7 +269,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @param string $element * @param string $waitFor */ - function clickLinkSuppressPopup($element, $waitFor = 'civicrm-footer') { + public function clickLinkSuppressPopup($element, $waitFor = 'civicrm-footer') { $link = $this->getAttribute($element . '@href'); $this->open($link); $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -281,7 +281,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { /** * Wait for all ajax snippets to finish loading */ - function waitForAjaxContent() { + public function waitForAjaxContent() { $this->waitForElementNotPresent('css=.blockOverlay'); // Some ajax calls happen in pairs (e.g. submit a popup form then refresh the underlying content) // So we'll wait a sec and recheck to see if any more stuff is loading @@ -295,7 +295,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * Call the API on the local server * (kind of defeats the point of a webtest - see CRM-11889) */ - function webtest_civicrm_api($entity, $action, $params) { + public function webtest_civicrm_api($entity, $action, $params) { if (!isset($params['version'])) { $params['version'] = 3; } @@ -310,7 +310,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * Experimental - currently only works if permissions on remote site allow anon user to access ajax api * @see CRM-11889 */ - function rest_civicrm_api($entity, $action, $params = array()) { + public function rest_civicrm_api($entity, $action, $params = array()) { $params += array( 'version' => 3, ); @@ -332,7 +332,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * * @return array|int */ - function webtestGetFirstValueForOptionGroup($option_group_name) { + public function webtestGetFirstValueForOptionGroup($option_group_name) { $result = $this->webtest_civicrm_api("OptionValue", "getvalue", array( 'option_group_name' => $option_group_name, 'option.limit' => 1, @@ -344,7 +344,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { /** * @return mixed */ - function webtestGetValidCountryID() { + public function webtestGetValidCountryID() { static $_country_id; if (is_null($_country_id)) { $config_backend = $this->webtestGetConfig('countryLimit'); @@ -358,7 +358,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * * @return mixed|null */ - function webtestGetValidEntityID($entity) { + public function webtestGetValidEntityID($entity) { // michaelmcandrew: would like to use getvalue but there is a bug // for e.g. group where option.limit not working at the moment CRM-9110 $result = $this->webtest_civicrm_api($entity, "get", array('option.limit' => 1, 'return' => 'id')); @@ -373,7 +373,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * * @return mixed */ - function webtestGetConfig($field) { + public function webtestGetConfig($field) { static $_config_backend; if (is_null($_config_backend)) { $result = $this->webtest_civicrm_api("Domain", "getvalue", array( @@ -389,7 +389,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { /** * Ensures the required CiviCRM components are enabled */ - function enableComponents($components) { + public function enableComponents($components) { $this->openCiviPage("admin/setting/component", "reset=1", "_qf_Component_next-bottom"); $enabledComponents = $this->getSelectOptions("enableComponents-t"); $added = FALSE; @@ -419,7 +419,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * * @return mixed either a string with the (either generated or provided) email or null (if no email) */ - function webtestAddContact($fname = 'Anthony', $lname = 'Anderson', $email = NULL, $contactSubtype = NULL) { + public function webtestAddContact($fname = 'Anthony', $lname = 'Anderson', $email = NULL, $contactSubtype = NULL) { $args = 'reset=1&ct=Individual'; if ($contactSubtype) { $args .= "&cst={$contactSubtype}"; @@ -443,7 +443,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * * @return null|string */ - function webtestAddHousehold($householdName = "Smith's Home", $email = NULL) { + public function webtestAddHousehold($householdName = "Smith's Home", $email = NULL) { $this->openCiviPage("contact/add", "reset=1&ct=Household"); $this->click('household_name'); $this->type('household_name', $householdName); @@ -466,7 +466,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * * @return null|string */ - function webtestAddOrganization($organizationName = "Organization XYZ", $email = NULL, $contactSubtype = NULL) { + public function webtestAddOrganization($organizationName = "Organization XYZ", $email = NULL, $contactSubtype = NULL) { $args = 'reset=1&ct=Organization'; if ($contactSubtype) { $args .= "&cst={$contactSubtype}"; @@ -487,14 +487,14 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { /** */ - function webtestFillAutocomplete($sortName, $fieldName = 'contact_id') { + public function webtestFillAutocomplete($sortName, $fieldName = 'contact_id') { $this->select2($fieldName,$sortName); //$this->assertContains($sortName, $this->getValue($fieldName), "autocomplete expected $sortName but didn’t find it in " . $this->getValue($fieldName)); } /** */ - function webtestOrganisationAutocomplete($sortName) { + public function webtestOrganisationAutocomplete($sortName) { $this->clickAt("//*[@id='contact_id']/../div/a"); $this->waitForElementPresent("//*[@id='select2-drop']/div/input"); $this->keyDown("//*[@id='select2-drop']/div/input", " "); @@ -519,7 +519,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @param $dateElement * @param null $strToTimeArgs */ - function webtestFillDate($dateElement, $strToTimeArgs = NULL) { + public function webtestFillDate($dateElement, $strToTimeArgs = NULL) { $timeStamp = strtotime($strToTimeArgs ? $strToTimeArgs : '+1 month'); $year = date('Y', $timeStamp); @@ -539,7 +539,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @param $dateElement * @param null $strToTimeArgs */ - function webtestFillDateTime($dateElement, $strToTimeArgs = NULL) { + public function webtestFillDateTime($dateElement, $strToTimeArgs = NULL) { $this->webtestFillDate($dateElement, $strToTimeArgs); $timeStamp = strtotime($strToTimeArgs ? $strToTimeArgs : '+1 month'); @@ -559,7 +559,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @param string $tableId Pass in the id attribute of a table to be verified if you want to only check a specific table * on the web page. */ - function webtestVerifyTabularData($expected, $xpathPrefix = NULL, $tableId = NULL) { + public function webtestVerifyTabularData($expected, $xpathPrefix = NULL, $tableId = NULL) { $tableLocator = ""; if ($tableId) { $tableLocator = "[@id='$tableId']"; @@ -585,7 +585,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * * @return void */ - function fillRichTextField($fieldName, $text = 'Typing this text into editor.', $editor = 'CKEditor', $compressed = FALSE) { + public function fillRichTextField($fieldName, $text = 'Typing this text into editor.', $editor = 'CKEditor', $compressed = FALSE) { // make sure cursor focuses on the field $this->fireEvent($fieldName, 'focus'); if ($editor == 'CKEditor') { @@ -615,7 +615,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * * @return void */ - function addMultipleChoiceOptions($options, &$validateStrings) { + public function addMultipleChoiceOptions($options, &$validateStrings) { foreach ($options as $oIndex => $oValue) { $validateStrings[] = $oValue['label']; $validateStrings[] = $oValue['amount']; @@ -637,7 +637,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @param string $contactType * @return array of contact attributes (id, names, email) */ - function createDialogContact($field = 'contact_id', $contactType = 'Individual') { + public function createDialogContact($field = 'contact_id', $contactType = 'Individual') { $selectId = 's2id_' . $this->getAttribute($field . '@id'); $this->clickAt("xpath=//div[@id='$selectId']/a"); $this->clickAjaxLink("xpath=//li[@class='select2-no-results']//a[contains(text(), 'New $contactType')]", '_qf_Edit_next'); @@ -712,7 +712,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @param $strings * @return void */ - function assertStringsPresent($strings) { + public function assertStringsPresent($strings) { foreach ((array) $strings as $string) { $this->assertTrue($this->isTextPresent($string), "Could not find $string on page"); } @@ -728,7 +728,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * of the URL that are present. Querystring elements are returned in sub-array (elements.queryString) * http://php.net/manual/en/function.parse-url.php */ - function parseURL($url = NULL) { + public function parseURL($url = NULL) { if (!$url) { $url = $this->getLocation(); } @@ -744,7 +744,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { /** * Returns a single argument from the url query */ - function urlArg($arg, $url = NULL) { + public function urlArg($arg, $url = NULL) { $elements = $this->parseURL($url); return isset($elements['queryString'][$arg]) ? $elements['queryString'][$arg] : NULL; } @@ -762,7 +762,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @return int */ - function webtestAddPaymentProcessor($processorName = 'Test Processor', $processorType = 'Dummy', $processorSettings = NULL, $financialAccount = 'Deposit Bank Account') { + public function webtestAddPaymentProcessor($processorName = 'Test Processor', $processorType = 'Dummy', $processorSettings = NULL, $financialAccount = 'Deposit Bank Account') { if (!$processorName) { $this->fail("webTestAddPaymentProcessor requires $processorName."); } @@ -836,7 +836,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { return $this->urlArg('id', $paymentProcessorLink); } - function webtestAddCreditCardDetails() { + public function webtestAddCreditCardDetails() { $this->waitForElementPresent('credit_card_type'); $this->select('credit_card_type', 'label=Visa'); $this->type('credit_card_number', '4807731747657838'); @@ -852,7 +852,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * * @return array */ - function webtestAddBillingDetails($firstName = NULL, $middleName = NULL, $lastName = NULL) { + public function webtestAddBillingDetails($firstName = NULL, $middleName = NULL, $lastName = NULL) { if (!$firstName) { $firstName = 'John'; } @@ -884,7 +884,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * * @return null|string */ - function webtestAttachFile($fieldLocator, $filePath = NULL) { + public function webtestAttachFile($fieldLocator, $filePath = NULL) { if (!$filePath) { $filePath = '/tmp/testfile_' . substr(sha1(rand()), 0, 7) . '.txt'; $fp = @fopen($filePath, 'w'); @@ -906,7 +906,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * * @return null|string */ - function webtestCreateCSV($headers, $rows, $filePath = NULL) { + public function webtestCreateCSV($headers, $rows, $filePath = NULL) { if (!$filePath) { $filePath = '/tmp/testcsv_' . substr(sha1(rand()), 0, 7) . '.csv'; } @@ -937,7 +937,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * * @return an array of saved params values. */ - function webtestAddRelationshipType($params = array()) { + public function webtestAddRelationshipType($params = array()) { $this->openCiviPage("admin/reltype", "reset=1&action=add"); //build the params if not passed. @@ -1337,7 +1337,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @param array $fields Fields to be set for strict rule * @param int $threshold Rule's threshold value */ - function webtestStrictDedupeRuleDefault($contactType = 'Individual', $fields = array(), $threshold = 10) { + public function webtestStrictDedupeRuleDefault($contactType = 'Individual', $fields = array(), $threshold = 10) { // set default strict rule. $strictRuleId = 4; if ($contactType == 'Organization') { @@ -1403,7 +1403,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * * @return array */ - function webtestAddMembershipType($period_type = 'rolling', $duration_interval = 1, $duration_unit = 'year', $auto_renew = 'no') { + public function webtestAddMembershipType($period_type = 'rolling', $duration_interval = 1, $duration_unit = 'year', $auto_renew = 'no') { $membershipTitle = substr(sha1(rand()), 0, 7); $membershipOrg = $membershipTitle . ' memorg'; $this->webtestAddOrganization($membershipOrg, TRUE); @@ -1462,7 +1462,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * * @return null|string */ - function WebtestAddGroup($groupName = NULL, $parentGroupName = NULL) { + public function WebtestAddGroup($groupName = NULL, $parentGroupName = NULL) { $this->openCiviPage('group/add', 'reset=1', '_qf_Edit_upload-bottom'); // fill group name @@ -1501,7 +1501,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * * @return null */ - function WebtestAddActivity($activityType = "Meeting") { + public function WebtestAddActivity($activityType = "Meeting") { // Adding Adding contact with randomized first name for test testContactContextActivityAdd // We're using Quick Add block on the main page for this. $firstName1 = substr(sha1(rand()), 0, 7); @@ -1575,7 +1575,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @return bool */ static - function checkDoLocalDBTest() { + public function checkDoLocalDBTest() { if (defined('CIVICRM_WEBTEST_LOCAL_DB') && CIVICRM_WEBTEST_LOCAL_DB ) { @@ -1595,7 +1595,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * that a DELETE occurred * @delete boolean True if we're checking that a DELETE action occurred. */ - function assertDBState($daoName, $id, $match, $delete = FALSE) { + public function assertDBState($daoName, $id, $match, $delete = FALSE) { if (!self::checkDoLocalDBTest()) { return; } @@ -1613,7 +1613,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * * @return null|string */ - function assertDBNotNull($daoName, $searchValue, $returnColumn, $searchColumn, $message) { + public function assertDBNotNull($daoName, $searchValue, $returnColumn, $searchColumn, $message) { if (!self::checkDoLocalDBTest()) { return; } @@ -1629,7 +1629,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @param $searchColumn * @param $message */ - function assertDBNull($daoName, $searchValue, $returnColumn, $searchColumn, $message) { + public function assertDBNull($daoName, $searchValue, $returnColumn, $searchColumn, $message) { if (!self::checkDoLocalDBTest()) { return; } @@ -1643,7 +1643,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @param int $id * @param $message */ - function assertDBRowNotExist($daoName, $id, $message) { + public function assertDBRowNotExist($daoName, $id, $message) { if (!self::checkDoLocalDBTest()) { return; } @@ -1678,7 +1678,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @param array $searchParams * @param $expectedValues */ - function assertDBCompareValues($daoName, $searchParams, $expectedValues) { + public function assertDBCompareValues($daoName, $searchParams, $expectedValues) { if (!self::checkDoLocalDBTest()) { return; } @@ -1690,7 +1690,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @param $expectedValues * @param $actualValues */ - function assertAttributesEquals(&$expectedValues, &$actualValues) { + public function assertAttributesEquals(&$expectedValues, &$actualValues) { if (!self::checkDoLocalDBTest()) { return; } @@ -1703,7 +1703,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @param $actual * @param string $message */ - function assertType($expected, $actual, $message = '') { + public function assertType($expected, $actual, $message = '') { return $this->assertInternalType($expected, $actual, $message); } @@ -1876,7 +1876,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { /** * Delete Financial Account */ - function _testDeleteFinancialAccount($financialAccountTitle) { + public function _testDeleteFinancialAccount($financialAccountTitle) { $this->click("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Delete']"); $this->waitForElementPresent('_qf_FinancialAccount_next-botttom'); $this->click('_qf_FinancialAccount_next-botttom'); @@ -1887,7 +1887,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { /** * Verify data after ADD and EDIT */ - function _assertFinancialAccount($verifyData) { + public function _assertFinancialAccount($verifyData) { foreach ($verifyData as $key => $expectedValue) { $actualValue = $this->getValue($key); if ($key == 'parent_financial_account') { @@ -1902,7 +1902,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { /** * @param $verifySelectFieldData */ - function _assertSelectVerify($verifySelectFieldData) { + public function _assertSelectVerify($verifySelectFieldData) { foreach ($verifySelectFieldData as $key => $expectedvalue) { $actualvalue = $this->getSelectedLabel($key); $this->assertEquals($expectedvalue, $actualvalue); @@ -1913,7 +1913,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @param $financialType * @param string $option */ - function addeditFinancialType($financialType, $option = 'new') { + public function addeditFinancialType($financialType, $option = 'new') { $this->openCiviPage("admin/financial/financialType", "reset=1"); if ($option == 'Delete') { @@ -1966,7 +1966,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * Give the specified permissions * Note: this function logs in as 'admin' (logging out if necessary) */ - function changePermissions($permission) { + public function changePermissions($permission) { $this->webtestLogin('admin'); $this->open("{$this->sboxPath}admin/people/permissions"); $this->waitForElementPresent('edit-submit'); @@ -1982,7 +1982,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @param $profileTitle * @param $profileFields */ - function addProfile($profileTitle, $profileFields) { + public function addProfile($profileTitle, $profileFields) { $this->openCiviPage('admin/uf/group', "reset=1"); $this->clickLink('link=Add Profile', '_qf_Group_cancel-bottom'); @@ -2014,7 +2014,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @param $cost * @param $financialType */ - function addPremium($name, $sku, $amount, $price, $cost, $financialType) { + public function addPremium($name, $sku, $amount, $price, $cost, $financialType) { $this->waitForElementPresent("_qf_ManagePremiums_upload-bottom"); $this->type("name", $name); $this->type("sku", $sku); @@ -2033,7 +2033,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @param $label * @param $financialAccount */ - function addPaymentInstrument($label, $financialAccount) { + public function addPaymentInstrument($label, $financialAccount) { $this->openCiviPage('admin/options/payment_instrument', 'action=add&reset=1', "_qf_Options_next-bottom"); $this->type("label", $label); $this->select("financial_account_id", "value=$financialAccount"); @@ -2044,7 +2044,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { /** * Ensure we have a default mailbox set up for CiviMail */ - function setupDefaultMailbox() { + public function setupDefaultMailbox() { $this->openCiviPage('admin/mailSettings', 'action=update&id=1&reset=1'); // Check if it hasn't already been set up if (!$this->getSelectedValue('protocol')) { @@ -2061,7 +2061,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * * @return string, timeout expressed in milliseconds */ - function getTimeoutMsec() { + public function getTimeoutMsec() { // note: existing local versions of CiviSeleniumSettings may not declare $timeout, so use @ $timeout = ($this->settings && @$this->settings->timeout) ? ($this->settings->timeout * 1000) : 30000; return (string) $timeout; // don't know why, but all our old code used a string @@ -2082,7 +2082,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * @param callable|boolean $beforeTriggering fn to execute before actual element triggering * @return void */ - function customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl, $beforeTriggering = NULL) { + public function customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl, $beforeTriggering = NULL) { // FIXME: Testing a theory that these failures have something to do with permissions $this->webtestLogin('admin'); @@ -2148,7 +2148,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * * @return array */ - function addCustomGroupField($customSets) { + public function addCustomGroupField($customSets) { $return = array(); foreach ($customSets as $customSet) { $this->openCiviPage("admin/custom/group", "action=add&reset=1"); @@ -2198,7 +2198,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { /** * Type and select first occurance of autocomplete */ - function select2($fieldName,$label, $multiple = FALSE, $xpath=FALSE) { + public function select2($fieldName,$label, $multiple = FALSE, $xpath=FALSE) { // In the case of chainSelect, wait for options to load $this->waitForElementNotPresent('css=select.loading'); if ($multiple) { @@ -2230,7 +2230,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { /** * Select multiple options */ - function multiselect2($fieldid, $params) { + public function multiselect2($fieldid, $params) { // In the case of chainSelect, wait for options to load $this->waitForElementNotPresent('css=select.loading'); foreach($params as $value) { @@ -2246,7 +2246,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { /** * Check for unobtrusive status message as set by CRM.status */ - function checkCRMStatus($text=NULL) { + public function checkCRMStatus($text=NULL) { $this->waitForElementPresent("css=.crm-status-box-outer.status-success"); if ($text) { $this->assertElementContainsText("css=.crm-status-box-outer.status-success", $text); @@ -2256,7 +2256,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { /** * Check for obtrusive status message as set by CRM.alert */ - function checkCRMAlert($text, $type='success') { + public function checkCRMAlert($text, $type='success') { $this->waitForElementPresent("css=div.ui-notify-message.$type"); $this->waitForText("css=div.ui-notify-message.$type", $text); // We got the message, now let's close it so the webtest doesn't get confused by lots of open alerts @@ -2266,7 +2266,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { /** * Enable or disable Pop-ups via Display Preferences */ - function enableDisablePopups($enabled = TRUE) { + public function enableDisablePopups($enabled = TRUE) { $this->openCiviPage('admin/setting/preferences/display', 'reset=1'); $isChecked = $this->isChecked('ajaxPopupsEnabled'); if (($isChecked && !$enabled) || (!$isChecked && $enabled)) { @@ -2284,7 +2284,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { /** * Attempt to get information about what went wrong if we encounter an error when loading a page */ - function checkForErrorsOnPage() { + public function checkForErrorsOnPage() { foreach (array('Access denied', 'Page not found') as $err) { if ($this->isElementPresent("xpath=//h1[contains(., '$err')]")) { $this->fail("'$err' encountered at " . $this->getLocation() . "\nwhile logged in as '{$this->loggedInAs}'"); diff --git a/tests/phpunit/CiviTest/CiviTestSuite.php b/tests/phpunit/CiviTest/CiviTestSuite.php index 8cfc8a1c0e..e893941cac 100644 --- a/tests/phpunit/CiviTest/CiviTestSuite.php +++ b/tests/phpunit/CiviTest/CiviTestSuite.php @@ -41,7 +41,7 @@ class CiviTestSuite extends PHPUnit_Framework_TestSuite { /** * Simple name based constructor */ - function __construct($theClass = '', $name = '') { + public function __construct($theClass = '', $name = '') { if (empty($name)) { $name = str_replace('_', ' ', @@ -76,7 +76,7 @@ class CiviTestSuite extends PHPUnit_Framework_TestSuite { * suppress failed test error issued by phpunit when it finds * a test suite with no tests */ - function testNothing() { + public function testNothing() { } /** diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 787de4ac99..ffa3495f8e 100755 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -149,7 +149,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param array $data * @param string $dataName */ - function __construct($name = NULL, array$data = array(), $dataName = '') { + public function __construct($name = NULL, array$data = array(), $dataName = '') { parent::__construct($name, $data, $dataName); // we need full error reporting @@ -189,14 +189,14 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { /** * @return bool */ - function requireDBReset() { + public function requireDBReset() { return $this->DBResetRequired; } /** * @return string */ - static function getDBName() { + public static function getDBName() { $dbName = !empty($GLOBALS['mysql_db']) ? $GLOBALS['mysql_db'] : 'civicrm_tests_dev'; return $dbName; } @@ -500,7 +500,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { /** * FIXME: Maybe a better way to do it */ - function foreignKeyChecksOff() { + public function foreignKeyChecksOff() { self::$utils = new Utils($GLOBALS['mysql_host'], $GLOBALS['mysql_port'], $GLOBALS['mysql_user'], @@ -516,7 +516,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { return TRUE; } - function foreignKeyChecksOn() { + public function foreignKeyChecksOn() { // FIXME: might not be needed if previous fixme implemented } @@ -530,7 +530,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * that a DELETE occurred * @delete boolean True if we're checking that a DELETE action occurred. */ - function assertDBState($daoName, $id, $match, $delete = FALSE) { + public function assertDBState($daoName, $id, $match, $delete = FALSE) { if (empty($id)) { // adding this here since developers forget to check for an id // and hence we get the first value in the db @@ -585,7 +585,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @return null|string * @throws PHPUnit_Framework_AssertionFailedError */ - function assertDBNotNull($daoName, $searchValue, $returnColumn, $searchColumn, $message) { + public function assertDBNotNull($daoName, $searchValue, $returnColumn, $searchColumn, $message) { if (empty($searchValue)) { $this->fail("empty value passed to assertDBNotNull"); } @@ -603,7 +603,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param $searchColumn * @param $message */ - function assertDBNull($daoName, $searchValue, $returnColumn, $searchColumn, $message) { + public function assertDBNull($daoName, $searchValue, $returnColumn, $searchColumn, $message) { $value = CRM_Core_DAO::getFieldValue($daoName, $searchValue, $returnColumn, $searchColumn, TRUE); $this->assertNull($value, $message); } @@ -614,7 +614,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param int $id * @param null $message */ - function assertDBRowNotExist($daoName, $id, $message = NULL) { + public function assertDBRowNotExist($daoName, $id, $message = NULL) { $message = $message ? $message : "$daoName (#$id) should not exist"; $value = CRM_Core_DAO::getFieldValue($daoName, $id, 'id', 'id', TRUE); $this->assertNull($value, $message); @@ -626,7 +626,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param int $id * @param null $message */ - function assertDBRowExist($daoName, $id, $message = NULL) { + public function assertDBRowExist($daoName, $id, $message = NULL) { $message = $message ? $message : "$daoName (#$id) should exist"; $value = CRM_Core_DAO::getFieldValue($daoName, $id, 'id', 'id', TRUE); $this->assertEquals($id, $value, $message); @@ -654,7 +654,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param array $searchParams * @param $expectedValues */ - function assertDBCompareValues($daoName, $searchParams, $expectedValues) { + public function assertDBCompareValues($daoName, $searchParams, $expectedValues) { //get the values from db $dbValues = array(); CRM_Core_DAO::commonRetrieve($daoName, $searchParams, $dbValues); @@ -672,7 +672,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * Example: $this->assertSql(2, 'select count(*) from foo where foo.bar like "%1"', * array(1 => array("Whiz", "String"))); */ - function assertDBQuery($expected, $query, $params = array(), $message = '') { + public function assertDBQuery($expected, $query, $params = array(), $message = '') { if ($message) $message .= ': '; $actual = CRM_Core_DAO::singleValueQuery($query, $params); $this->assertEquals($expected, $actual, @@ -689,7 +689,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param array $expected * @param array $actual */ - function assertTreeEquals($expected, $actual) { + public function assertTreeEquals($expected, $actual) { $e = array(); $a = array(); CRM_Utils_Array::flatten($expected, $e, '', ':::'); @@ -708,7 +708,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param int|float $tolerance * @param string $message */ - function assertApproxEquals($expected, $actual, $tolerance, $message = NULL) { + public function assertApproxEquals($expected, $actual, $tolerance, $message = NULL) { if ($message === NULL) { $message = sprintf("approx-equals: expected=[%.3f] actual=[%.3f] tolerance=[%.3f]", $expected, $actual, $tolerance); } @@ -722,7 +722,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @throws PHPUnit_Framework_AssertionFailedError */ - function assertAttributesEquals($expectedValues, $actualValues, $message = NULL) { + public function assertAttributesEquals($expectedValues, $actualValues, $message = NULL) { foreach ($expectedValues as $paramName => $paramValue) { if (isset($actualValues[$paramName])) { $this->assertEquals($paramValue, $actualValues[$paramName], "Value Mismatch On $paramName - value 1 is " . print_r($paramValue, TRUE) . " value 2 is " . print_r($actualValues[$paramName], TRUE) ); @@ -737,7 +737,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param $key * @param $list */ - function assertArrayKeyExists($key, &$list) { + public function assertArrayKeyExists($key, &$list) { $result = isset($list[$key]) ? TRUE : FALSE; $this->assertTrue($result, ts("%1 element exists?", array(1 => $key) @@ -748,7 +748,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param $key * @param $list */ - function assertArrayValueNotNull($key, &$list) { + public function assertArrayValueNotNull($key, &$list) { $this->assertArrayKeyExists($key, $list); $value = isset($list[$key]) ? $list[$key] : NULL; @@ -765,7 +765,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param array $apiResult api result * @param string $prefix extra test to add to message */ - function assertAPISuccess($apiResult, $prefix = '') { + public function assertAPISuccess($apiResult, $prefix = '') { if (!empty($prefix)) { $prefix .= ': '; } @@ -788,7 +788,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param string $prefix extra test to add to message * @param null $expectedError */ - function assertAPIFailure($apiResult, $prefix = '', $expectedError = NULL) { + public function assertAPIFailure($apiResult, $prefix = '', $expectedError = NULL) { if (!empty($prefix)) { $prefix .= ': '; } @@ -804,14 +804,14 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param $actual * @param string $message */ - function assertType($expected, $actual, $message = '') { + public function assertType($expected, $actual, $message = '') { return $this->assertInternalType($expected, $actual, $message); } /** * Check that a deleted item has been deleted */ - function assertAPIDeleted($entity, $id) { + public function assertAPIDeleted($entity, $id) { $this->callAPISuccess($entity, 'getcount', array('id' => $id), 0); } @@ -824,7 +824,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param array $valuesToExclude * @param string $prefix extra test to add to message */ - function assertAPIArrayComparison($result, $expected, $valuesToExclude = array(), $prefix = '') { + public function assertAPIArrayComparison($result, $expected, $valuesToExclude = array(), $prefix = '') { $valuesToExclude = array_merge($valuesToExclude, array('debug', 'xdebug', 'sequential')); foreach ($valuesToExclude as $value) { if(isset($result[$value])) { @@ -845,7 +845,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param array $params * @return array|int */ - function civicrm_api($entity, $action, $params) { + public function civicrm_api($entity, $action, $params) { return civicrm_api($entity, $action, $params); } @@ -863,7 +863,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return array|int */ - function callAPISuccess($entity, $action, $params, $checkAgainst = NULL) { + public function callAPISuccess($entity, $action, $params, $checkAgainst = NULL) { $params = array_merge(array( 'version' => $this->_apiversion, 'debug' => 1, @@ -900,7 +900,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return array|int */ - function callAPISuccessGetValue($entity, $params, $type = NULL) { + public function callAPISuccessGetValue($entity, $params, $type = NULL) { $params += array( 'version' => $this->_apiversion, 'debug' => 1, @@ -935,7 +935,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @throws Exception * @return array|int */ - function callAPISuccessGetSingle($entity, $params, $checkAgainst = NULL) { + public function callAPISuccessGetSingle($entity, $params, $checkAgainst = NULL) { $params += array( 'version' => $this->_apiversion, 'debug' => 1, @@ -968,7 +968,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * - array * - object */ - function callAPISuccessGetCount($entity, $params, $count = NULL) { + public function callAPISuccessGetCount($entity, $params, $count = NULL) { $params += array( 'version' => $this->_apiversion, 'debug' => 1, @@ -997,7 +997,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param string|null $actionName * @return array|int */ - function callAPIAndDocument($entity, $action, $params, $function, $file, $description = "", $subfile = NULL, $actionName = NULL){ + public function callAPIAndDocument($entity, $action, $params, $function, $file, $description = "", $subfile = NULL, $actionName = NULL){ $params['version'] = $this->_apiversion; $result = $this->callAPISuccess($entity, $action, $params); $this->documentMe($params, $result, $function, $file, $description, $subfile, $actionName); @@ -1014,7 +1014,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param null $extraOutput * @return array|int */ - function callAPIFailure($entity, $action, $params, $expectedErrorMessage = NULL, $extraOutput = NULL) { + public function callAPIFailure($entity, $action, $params, $expectedErrorMessage = NULL, $extraOutput = NULL) { if (is_array($params)) { $params += array( 'version' => $this->_apiversion, @@ -1045,7 +1045,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return int id of Organisation created */ - function organizationCreate($params = array(), $seq = 0) { + public function organizationCreate($params = array(), $seq = 0) { if (!$params) { $params = array(); } @@ -1061,7 +1061,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return int id of Individual created */ - function individualCreate($params = array(), $seq = 0) { + public function individualCreate($params = array(), $seq = 0) { $params = array_merge($this->sampleContact('Individual', $seq), $params); return $this->_contactCreate($params); } @@ -1074,7 +1074,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return int id of Household created */ - function householdCreate($params = array(), $seq = 0) { + public function householdCreate($params = array(), $seq = 0) { $params = array_merge($this->sampleContact('Household', $seq), $params); return $this->_contactCreate($params); } @@ -1087,7 +1087,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return array properties of sample contact (ie. $params for API call) */ - function sampleContact($contact_type, $seq = 0) { + public function sampleContact($contact_type, $seq = 0) { $samples = array( 'Individual' => array( // The number of values in each list need to be coprime numbers to not have duplicates @@ -1138,7 +1138,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return array|int */ - function contactDelete($contactID) { + public function contactDelete($contactID) { $params = array( 'id' => $contactID, 'skip_undelete' => 1, @@ -1160,7 +1160,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @throws Exception */ - function contactTypeDelete($contactTypeId) { + public function contactTypeDelete($contactTypeId) { require_once 'CRM/Contact/BAO/ContactType.php'; $result = CRM_Contact_BAO_ContactType::del($contactTypeId); if (!$result) { @@ -1173,7 +1173,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return mixed */ - function membershipTypeCreate($params = array()) { + public function membershipTypeCreate($params = array()) { CRM_Member_PseudoConstant::flush('membershipType'); CRM_Core_Config::clearDBCache(); $memberOfOrganization = $this->organizationCreate(); @@ -1203,7 +1203,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return mixed */ - function contactMembershipCreate($params) { + public function contactMembershipCreate($params) { $pre = array( 'join_date' => '2007-01-21', 'start_date' => '2007-01-21', @@ -1226,14 +1226,14 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @param array $params */ - function membershipTypeDelete($params) { + public function membershipTypeDelete($params) { $this->callAPISuccess('MembershipType', 'Delete', $params); } /** * @param int $membershipID */ - function membershipDelete($membershipID) { + public function membershipDelete($membershipID) { $deleteParams = array('id' => $membershipID); $result = $this->callAPISuccess('Membership', 'Delete', $deleteParams); return; @@ -1244,7 +1244,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return mixed */ - function membershipStatusCreate($name = 'test member status') { + public function membershipStatusCreate($name = 'test member status') { $params['name'] = $name; $params['start_event'] = 'start_date'; $params['end_event'] = 'end_date'; @@ -1259,7 +1259,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { /** * @param int $membershipStatusID */ - function membershipStatusDelete($membershipStatusID) { + public function membershipStatusDelete($membershipStatusID) { if (!$membershipStatusID) { return; } @@ -1272,7 +1272,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return mixed */ - function relationshipTypeCreate($params = array()) { + public function relationshipTypeCreate($params = array()) { $params = array_merge(array( 'name_a_b' => 'Relation 1 for relationship type create', 'name_b_a' => 'Relation 2 for relationship type create', @@ -1295,7 +1295,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @param int $relationshipTypeID */ - function relationshipTypeDelete($relationshipTypeID) { + public function relationshipTypeDelete($relationshipTypeID) { $params['id'] = $relationshipTypeID; $this->callAPISuccess('relationship_type', 'delete', $params); } @@ -1305,7 +1305,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return mixed */ - function paymentProcessorTypeCreate($params = NULL) { + public function paymentProcessorTypeCreate($params = NULL) { if (is_null($params)) { $params = array( 'name' => 'API_Test_PP', @@ -1331,7 +1331,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return int $id of participant created */ - function participantCreate($params) { + public function participantCreate($params) { if(empty($params['contact_id'])){ $params['contact_id'] = $this->individualCreate(); } @@ -1358,7 +1358,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return object of Payment Processsor */ - function processorCreate() { + public function processorCreate() { $processorParams = array( 'domain_id' => 1, 'name' => 'Dummy', @@ -1380,7 +1380,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param array $params * @return object of contribution page */ - function contributionPageCreate($params) { + public function contributionPageCreate($params) { $this->_pageParams = array( 'title' => 'Test Contribution Page', 'financial_type_id' => 1, @@ -1402,7 +1402,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param array $params * @return array result of created tag */ - function tagCreate($params = array()) { + public function tagCreate($params = array()) { $defaults = array( 'name' => 'New Tag3', 'description' => 'This is description for Our New Tag ', @@ -1418,7 +1418,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @param int $tagId id of the tag to be deleted */ - function tagDelete($tagId) { + public function tagDelete($tagId) { require_once 'api/api.php'; $params = array( 'tag_id' => $tagId, @@ -1434,7 +1434,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return bool */ - function entityTagAdd($params) { + public function entityTagAdd($params) { $result = $this->callAPISuccess('entity_tag', 'create', $params); return TRUE; } @@ -1446,7 +1446,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return int id of created contribution */ - function pledgeCreate($cID) { + public function pledgeCreate($cID) { $params = array( 'contact_id' => $cID, 'pledge_create_date' => date('Ymd'), @@ -1471,7 +1471,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @param int $pledgeId */ - function pledgeDelete($pledgeId) { + public function pledgeDelete($pledgeId) { $params = array( 'pledge_id' => $pledgeId, ); @@ -1490,7 +1490,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param bool $isFee * @return int id of created contribution */ - function contributionCreate($cID, $cTypeID = 1, $invoiceID = 67890, $trxnID = 12345, $paymentInstrumentID = 1, $isFee = TRUE) { + public function contributionCreate($cID, $cTypeID = 1, $invoiceID = 67890, $trxnID = 12345, $paymentInstrumentID = 1, $isFee = TRUE) { $params = array( 'domain_id' => 1, 'contact_id' => $cID, @@ -1525,7 +1525,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param int $trxnID * @return int id of created contribution */ - function onlineContributionCreate($params, $financialType, $invoiceID = 67890, $trxnID = 12345) { + public function onlineContributionCreate($params, $financialType, $invoiceID = 67890, $trxnID = 12345) { $contribParams = array( 'contact_id' => $params['contact_id'], 'receive_date' => date('Ymd'), @@ -1549,7 +1549,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return array|int */ - function contributionDelete($contributionId) { + public function contributionDelete($contributionId) { $params = array( 'contribution_id' => $contributionId, ); @@ -1564,7 +1564,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return array $event */ - function eventCreate($params = array()) { + public function eventCreate($params = array()) { // if no contact was passed, make up a dummy event creator if (!isset($params['contact_id'])) { $params['contact_id'] = $this->_contactCreate(array( @@ -1603,7 +1603,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return array|int */ - function eventDelete($id) { + public function eventDelete($id) { $params = array( 'event_id' => $id, ); @@ -1617,7 +1617,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return array|int */ - function participantDelete($participantID) { + public function participantDelete($participantID) { $params = array( 'id' => $participantID, ); @@ -1631,7 +1631,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param int $contributionID * @return int $id of created payment */ - function participantPaymentCreate($participantID, $contributionID = NULL) { + public function participantPaymentCreate($participantID, $contributionID = NULL) { //Create Participant Payment record With Values $params = array( 'participant_id' => $participantID, @@ -1647,7 +1647,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @param int $paymentID */ - function participantPaymentDelete($paymentID) { + public function participantPaymentDelete($paymentID) { $params = array( 'id' => $paymentID, ); @@ -1660,7 +1660,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param int $contactID * @return int location id of created location */ - function locationAdd($contactID) { + public function locationAdd($contactID) { $address = array( 1 => array( 'location_type' => 'New Location Type', @@ -1690,7 +1690,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @param array $params parameters */ - function locationDelete($params) { + public function locationDelete($params) { $this->callAPISuccess('Location', 'delete', $params); } @@ -1700,7 +1700,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param array $params * @return int location id of created location */ - function locationTypeCreate($params = NULL) { + public function locationTypeCreate($params = NULL) { if ($params === NULL) { $params = array( 'name' => 'New Location Type', @@ -1724,7 +1724,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @param int location type id */ - function locationTypeDelete($locationTypeId) { + public function locationTypeDelete($locationTypeId) { $locationType = new CRM_Core_DAO_LocationType(); $locationType->id = $locationTypeId; $locationType->delete(); @@ -1736,7 +1736,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param array $params * @return int groupId of created group */ - function groupCreate($params = array()) { + public function groupCreate($params = array()) { $params = array_merge(array( 'name' => 'Test Group 1', 'domain_id' => 1, @@ -1763,7 +1763,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param array $params * @return int groupId of created group */ - function groupContactCreate($groupID, $totalCount = 10) { + public function groupContactCreate($groupID, $totalCount = 10) { $params = array('group_id' => $groupID); for ($i=1; $i <= $totalCount; $i++) { $contactID = $this->individualCreate(); @@ -1784,7 +1784,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @param int $gid */ - function groupDelete($gid) { + public function groupDelete($gid) { $params = array( 'id' => $gid, @@ -1797,7 +1797,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * Create a UFField * @param array $params */ - function uFFieldCreate($params = array()) { + public function uFFieldCreate($params = array()) { $params = array_merge(array( 'uf_group_id' => 1, 'field_name' => 'first_name', @@ -1818,7 +1818,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param array $params * @return int $id of created UF Join */ - function ufjoinCreate($params = NULL) { + public function ufjoinCreate($params = NULL) { if ($params === NULL) { $params = array( 'is_active' => 1, @@ -1838,7 +1838,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @param array with missing uf_group_id */ - function ufjoinDelete($params = NULL) { + public function ufjoinDelete($params = NULL) { if ($params === NULL) { $params = array( 'is_active' => 1, @@ -1858,7 +1858,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @param int $contactId */ - function contactGroupCreate($contactId) { + public function contactGroupCreate($contactId) { $params = array( 'contact_id.1' => $contactId, 'group_id' => 1, @@ -1872,7 +1872,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @param int $contactId */ - function contactGroupDelete($contactId) { + public function contactGroupDelete($contactId) { $params = array( 'contact_id.1' => $contactId, 'group_id' => 1, @@ -1886,7 +1886,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param array $params * @return array|int */ - function activityCreate($params = NULL) { + public function activityCreate($params = NULL) { if ($params === NULL) { $individualSourceID = $this->individualCreate(); @@ -1928,7 +1928,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @param array $params parameters */ - function activityTypeCreate($params) { + public function activityTypeCreate($params) { $result = $this->callAPISuccess('ActivityType', 'create', $params); return $result; } @@ -1938,7 +1938,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @param int $activityTypeId id of the activity type */ - function activityTypeDelete($activityTypeId) { + public function activityTypeDelete($activityTypeId) { $params['activity_type_id'] = $activityTypeId; $result = $this->callAPISuccess('ActivityType', 'delete', $params); return $result; @@ -1950,7 +1950,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param array $params * @return array|int */ - function customGroupCreate($params = array()) { + public function customGroupCreate($params = array()) { $defaults = array( 'title' => 'new custom group', 'extends' => 'Contact', @@ -1975,7 +1975,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * Existing function doesn't allow params to be over-ridden so need a new one * this one allows you to only pass in the params you want to change */ - function CustomGroupCreateByParams($params = array()) { + public function CustomGroupCreateByParams($params = array()) { $defaults = array( 'title' => "API Custom Group", 'extends' => 'Contact', @@ -1990,7 +1990,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { /** * Create custom group with multi fields */ - function CustomGroupMultipleCreateByParams($params = array()) { + public function CustomGroupMultipleCreateByParams($params = array()) { $defaults = array( 'style' => 'Tab', 'is_multiple' => 1, @@ -2002,7 +2002,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { /** * Create custom group with multi fields */ - function CustomGroupMultipleCreateWithFields($params = array()) { + public function CustomGroupMultipleCreateWithFields($params = array()) { // also need to pass on $params['custom_field'] if not set but not in place yet $ids = array(); $customGroup = $this->CustomGroupMultipleCreateByParams($params); @@ -2030,7 +2030,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return array $ids ids of created objects */ - function entityCustomGroupWithSingleFieldCreate($function, $filename) { + public function entityCustomGroupWithSingleFieldCreate($function, $filename) { $params = array('title' => $function); $entity = substr(basename($filename), 0, strlen(basename($filename)) - 8); $params['extends'] = $entity ? $entity : 'Contact'; @@ -2048,7 +2048,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return array|int */ - function customGroupDelete($customGroupID) { + public function customGroupDelete($customGroupID) { $params['id'] = $customGroupID; return $this->callAPISuccess('custom_group', 'delete', $params); } @@ -2059,7 +2059,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param array $params (custom_group_id) is required * @return array|int */ - function customFieldCreate($params) { + public function customFieldCreate($params) { $params = array_merge(array( 'label' => 'Custom Field', 'data_type' => 'String', @@ -2086,7 +2086,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return array|int */ - function customFieldDelete($customFieldID) { + public function customFieldDelete($customFieldID) { $params['id'] = $customFieldID; return $this->callAPISuccess('custom_field', 'delete', $params); @@ -2098,7 +2098,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param int $cId * @return array $note */ - function noteCreate($cId) { + public function noteCreate($cId) { $params = array( 'entity_table' => 'civicrm_contact', 'entity_id' => $cId, @@ -2114,7 +2114,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { /** * Enable CiviCampaign Component */ - function enableCiviCampaign() { + public function enableCiviCampaign() { CRM_Core_BAO_ConfigSetting::enableComponent('CiviCampaign'); // force reload of config object $config = CRM_Core_Config::singleton(TRUE, TRUE); @@ -2135,7 +2135,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param string $subfile name for subfile - if this is completed the example will be put in a subfolder (named by the entity) * @param string $action - optional action - otherwise taken from function name */ - function documentMe($params, $result, $function, $filename, $description = "", $subfile = NULL, $action = NULL) { + public function documentMe($params, $result, $function, $filename, $description = "", $subfile = NULL, $action = NULL) { if (defined('DONT_DOCUMENT_TEST_CONFIG') && DONT_DOCUMENT_TEST_CONFIG) { return; } @@ -2246,7 +2246,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param array $result * */ - function tidyExampleResult(&$result){ + public function tidyExampleResult(&$result){ if(!is_array($result)) { return; } @@ -2324,7 +2324,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return array|int */ - function noteDelete($params) { + public function noteDelete($params) { return $this->callAPISuccess('Note', 'delete', $params); } @@ -2336,7 +2336,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return array|int */ - function customFieldOptionValueCreate($customGroup, $name) { + public function customFieldOptionValueCreate($customGroup, $name) { $fieldParams = array( 'custom_group_id' => $customGroup['id'], 'name' => 'test_custom_group', @@ -2373,7 +2373,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @return bool */ - function confirmEntitiesDeleted($entities) { + public function confirmEntitiesDeleted($entities) { foreach ($entities as $entity) { $result = $this->callAPISuccess($entity, 'Get', array()); @@ -2388,7 +2388,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param $tablesToTruncate * @param bool $dropCustomValueTables */ - function quickCleanup($tablesToTruncate, $dropCustomValueTables = FALSE) { + public function quickCleanup($tablesToTruncate, $dropCustomValueTables = FALSE) { if ($this->tx) { throw new Exception("CiviUnitTestCase: quickCleanup() is not compatible with useTransaction()"); } @@ -2426,7 +2426,7 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) /** * Clean up financial entities after financial tests (so we remember to get all the tables :-)) */ - function quickCleanUpFinancialEntities() { + public function quickCleanUpFinancialEntities() { $tablesToTruncate = array( 'civicrm_contribution', 'civicrm_contribution_soft', @@ -2457,7 +2457,7 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) CRM_Member_BAO_Membership::createRelatedMemberships($var, $var, TRUE); } - function restoreDefaultPriceSetConfig() { + public function restoreDefaultPriceSetConfig() { CRM_Core_DAO::executeQuery("INSERT INTO `civicrm_price_field` (`id`, `price_set_id`, `name`, `label`, `html_type`, `is_enter_qty`, `help_pre`, `help_post`, `weight`, `is_display_amounts`, `options_per_line`, `is_active`, `is_required`, `active_on`, `expire_on`, `javascript`, `visibility_id`) VALUES (1, 1, 'contribution_amount', 'Contribution Amount', 'Text', 0, NULL, NULL, 1, 1, 1, 1, 1, NULL, NULL, NULL, 1)"); CRM_Core_DAO::executeQuery("INSERT INTO `civicrm_price_field_value` (`id`, `price_field_id`, `name`, `label`, `description`, `amount`, `count`, `max_value`, `weight`, `membership_type_id`, `membership_num_terms`, `is_default`, `is_active`, `financial_type_id`, `deductible_amount`) VALUES (1, 1, 'contribution_amount', 'Contribution Amount', NULL, '1', NULL, NULL, 1, NULL, NULL, 0, 1, 1, 0.00)"); } @@ -2480,7 +2480,7 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) * * @throws Exception */ - function getAndCheck($params, $id, $entity, $delete = 1, $errorText = '') { + public function getAndCheck($params, $id, $entity, $delete = 1, $errorText = '') { $result = $this->callAPISuccessGetSingle($entity, array( 'id' => $id, @@ -2547,7 +2547,7 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) * @param array $expected expected values * */ - function checkArrayEquals(&$actual, &$expected) { + public function checkArrayEquals(&$actual, &$expected) { self::unsetId($actual); self::unsetId($expected); $this->assertEquals($actual, $expected); @@ -2558,7 +2558,7 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) * @param array $unformattedArray The array from which the 'id' has to be unset * */ - static function unsetId(&$unformattedArray) { + public static function unsetId(&$unformattedArray) { $formattedArray = array(); if (array_key_exists('id', $unformattedArray)) { unset($unformattedArray['id']); @@ -2588,7 +2588,7 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) * 'php_path' Set to TRUE to use the default, FALSE or "" to disable support, or a string path to use another path * 'template_path' Set to TRUE to use the default, FALSE or "" to disable support, or a string path to use another path */ - function customDirectories($customDirs) { + public function customDirectories($customDirs) { require_once 'CRM/Core/Config.php'; $config = CRM_Core_Config::singleton(); @@ -2619,13 +2619,13 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) * @param string $prefix * @return string $string */ - function createTempDir($prefix = 'test-') { + public function createTempDir($prefix = 'test-') { $tempDir = CRM_Utils_File::tempdir($prefix); $this->tempDirs[] = $tempDir; return $tempDir; } - function cleanTempDirs() { + public function cleanTempDirs() { if (!is_array($this->tempDirs)) { // fix test errors where this is not set return; @@ -2640,14 +2640,14 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) /** * Temporarily replace the singleton extension with a different one */ - function setExtensionSystem(CRM_Extension_System $system) { + public function setExtensionSystem(CRM_Extension_System $system) { if ($this->origExtensionSystem == NULL) { $this->origExtensionSystem = CRM_Extension_System::singleton(); } CRM_Extension_System::setSingleton($this->origExtensionSystem); } - function unsetExtensionSystem() { + public function unsetExtensionSystem() { if ($this->origExtensionSystem !== NULL) { CRM_Extension_System::setSingleton($this->origExtensionSystem); $this->origExtensionSystem = NULL; @@ -2662,7 +2662,7 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) * @param $extras * @return void */ - function setMockSettingsMetaData($extras) { + public function setMockSettingsMetaData($extras) { CRM_Core_BAO_Setting::$_cache = array(); $this->callAPISuccess('system','flush', array()); CRM_Core_BAO_Setting::$_cache = array(); @@ -2681,7 +2681,7 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) /** * @param string $name */ - function financialAccountDelete($name) { + public function financialAccountDelete($name) { $financialAccount = new CRM_Financial_DAO_FinancialAccount(); $financialAccount->name = $name; if($financialAccount->find(TRUE)) { @@ -2696,7 +2696,7 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) * FIXME: something NULLs $GLOBALS['_HTML_QuickForm_registered_rules'] when the tests are ran all together * (NB unclear if this is still required) */ - function _sethtmlGlobals() { + public function _sethtmlGlobals() { $GLOBALS['_HTML_QuickForm_registered_rules'] = array( 'required' => array( 'html_quickform_rule_required', @@ -2874,7 +2874,7 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) * $this->_permissionedGroup = $this->groupCreate(array('title' => 'pick-me-active', 'is_active' => 1, 'name' => 'pick-me-active')); * */ - function setupACL() { + public function setupACL() { global $_REQUEST; $_REQUEST = $this->_params; @@ -2932,7 +2932,7 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) /** * Alter default price set so that the field numbers are not all 1 (hiding errors) */ - function offsetDefaultPriceSet() { + public function offsetDefaultPriceSet() { $contributionPriceSet = $this->callAPISuccess('price_set', 'getsingle', array('name' => 'default_contribution_amount')); $firstID = $contributionPriceSet['id']; $this->callAPISuccess('price_set', 'create', array('id' => $contributionPriceSet['id'], 'is_active' => 0, 'name' => 'old')); @@ -2958,7 +2958,7 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) * There is another function to this effect on the PaypalPro test but it appears to be silently failing * & the best protection agains that is the functions this class affords */ - function paymentProcessorCreate($params = array()) { + public function paymentProcessorCreate($params = array()) { $params = array_merge(array( 'name' => 'demo', 'domain_id' => CRM_Core_Config::domainID(), @@ -2992,7 +2992,7 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) /** * Set up initial recurring payment allowing subsequent IPN payments */ - function setupRecurringPaymentProcessorTransaction() { + public function setupRecurringPaymentProcessorTransaction() { $contributionRecur = $this->callAPISuccess('contribution_recur', 'create', array( 'contact_id' => $this->_contactID, 'amount' => 1000, @@ -3020,7 +3020,7 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) /** * We don't have a good way to set up a recurring contribution with a membership so let's just do one then alter it */ - function setupMembershipRecurringPaymentProcessorTransaction() { + public function setupMembershipRecurringPaymentProcessorTransaction() { $this->ids['membership_type'] = $this->membershipTypeCreate(); //create a contribution so our membership & contribution don't both have id = 1 $this->contributionCreate($this->_contactID, 1, 'abcd', '345j'); @@ -3055,7 +3055,7 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) * * @throws Exception */ - function CiviUnitTestCase_fatalErrorHandler($message) { + public function CiviUnitTestCase_fatalErrorHandler($message) { throw new Exception("{$message['message']}: {$message['code']}"); } @@ -3063,7 +3063,7 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) * Helper function to create new mailing * @return mixed */ - function createMailing() { + public function createMailing() { $params = array( 'subject' => 'maild' . rand(), 'body_text' => 'bdkfhdskfhduew', @@ -3080,7 +3080,7 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) * Helper function to delete mailing * @param $id */ - function deleteMailing($id) { + public function deleteMailing($id) { $params = array( 'id' => $id, ); @@ -3103,14 +3103,14 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) * * @param bool $nest whether to use nesting or reference-counting */ - function useTransaction($nest = TRUE) { + public function useTransaction($nest = TRUE) { if (!$this->tx) { $this->tx = new CRM_Core_Transaction($nest); $this->tx->rollback(); } } - function clearOutputBuffer() { + public function clearOutputBuffer() { while (ob_get_level() > 0) { ob_end_clean(); } diff --git a/tests/phpunit/CiviTest/Contact.php b/tests/phpunit/CiviTest/Contact.php index c4f0529b60..7d00f7ca27 100644 --- a/tests/phpunit/CiviTest/Contact.php +++ b/tests/phpunit/CiviTest/Contact.php @@ -12,7 +12,7 @@ class Contact extends CiviUnitTestCase { * * @return int $contactID id of created contact */ - static function create($params) { + public static function create($params) { require_once "CRM/Contact/BAO/Contact.php"; $contactID = CRM_Contact_BAO_Contact::createProfileContact($params, CRM_Core_DAO::$_nullArray); return $contactID; @@ -25,7 +25,7 @@ class Contact extends CiviUnitTestCase { * @param array $params * @return int $contactID id of created Individual */ - static function createIndividual($params = NULL) { + public static function createIndividual($params = NULL) { //compose the params, when not passed if (!$params) { $first_name = 'John'; @@ -47,7 +47,7 @@ class Contact extends CiviUnitTestCase { * @param array $params * @return mixed $contactID id of created Household */ - static function createHousehold($params = NULL) { + public static function createHousehold($params = NULL) { //compose the params, when not passed if (!$params) { $household_name = "John Doe's home"; @@ -68,7 +68,7 @@ class Contact extends CiviUnitTestCase { * @param array $params * @return mixed $contactID id of created Organisation */ - static function createOrganisation($params = NULL) { + public static function createOrganisation($params = NULL) { //compose the params, when not passed if (!$params) { $organization_name = "My Organization"; @@ -88,7 +88,7 @@ class Contact extends CiviUnitTestCase { * @param int $contactID id of the contact to delete * @return boolean true if contact deleted, false otherwise */ - static function delete($contactID) { + public static function delete($contactID) { require_once 'CRM/Contact/BAO/Contact.php'; return CRM_Contact_BAO_Contact::deleteContact($contactID); } diff --git a/tests/phpunit/CiviTest/ContributionPage.php b/tests/phpunit/CiviTest/ContributionPage.php index 083214d562..3ff31f172d 100644 --- a/tests/phpunit/CiviTest/ContributionPage.php +++ b/tests/phpunit/CiviTest/ContributionPage.php @@ -12,7 +12,7 @@ class ContributionPage extends PHPUnit_Framework_Testcase { * * @return mixed $contributionPage id of created Contribution Page */ - static function create($id = NULL) { + public static function create($id = NULL) { require_once "CRM/Contribute/BAO/ContributionPage.php"; $params = array( 'title' => 'Help Test CiviCRM!', @@ -45,7 +45,7 @@ class ContributionPage extends PHPUnit_Framework_Testcase { * to be deleted * @return boolean true if Contribution Page deleted, false otherwise */ - static function delete($contributionPageId) { + public static function delete($contributionPageId) { require_once "CRM/Contribute/DAO/ContributionPage.php"; $cp = new CRM_Contribute_DAO_ContributionPage(); $cp->id = $contributionPageId; diff --git a/tests/phpunit/CiviTest/Custom.php b/tests/phpunit/CiviTest/Custom.php index 0310b92e88..6e8094c80f 100644 --- a/tests/phpunit/CiviTest/Custom.php +++ b/tests/phpunit/CiviTest/Custom.php @@ -15,7 +15,7 @@ class Custom extends CiviUnitTestCase { * * @return object of created group */ - static function createGroup($group, $extends = NULL, $isMultiple = FALSE) { + public static function createGroup($group, $extends = NULL, $isMultiple = FALSE) { if (empty($group)) { if (isset($extends) && !is_array($extends) @@ -65,7 +65,7 @@ class Custom extends CiviUnitTestCase { * @param null $fields * @return object of created field */ - static function createField($params, $fields = NULL) { + public static function createField($params, $fields = NULL) { if (empty($params)) { $params = array( 'custom_group_id' => $fields['groupId'], @@ -101,7 +101,7 @@ class Custom extends CiviUnitTestCase { * @deprecated use function on parent class * @param object of Custom Field to delete */ - static function deleteField($params) { + public static function deleteField($params) { require_once 'CRM/Core/BAO/CustomField.php'; CRM_Core_BAO_CustomField::deleteField($params); } @@ -112,7 +112,7 @@ class Custom extends CiviUnitTestCase { * @param object Custom Group to delete * @return boolean true if Group deleted, false otherwise */ - static function deleteGroup($params) { + public static function deleteGroup($params) { require_once 'CRM/Core/BAO/CustomGroup.php'; $deleteCustomGroup = CRM_Core_BAO_CustomGroup::deleteGroup($params, TRUE); return $deleteCustomGroup; diff --git a/tests/phpunit/CiviTest/Event.php b/tests/phpunit/CiviTest/Event.php index cdb44ac0c9..e939937c8e 100644 --- a/tests/phpunit/CiviTest/Event.php +++ b/tests/phpunit/CiviTest/Event.php @@ -12,7 +12,7 @@ class Event extends PHPUnit_Framework_Testcase { * * @return mixed $event id of created Event */ - static function create($contactId) { + public static function create($contactId) { require_once "CRM/Event/BAO/Event.php"; $params = array( 'title' => 'Test Event', @@ -39,7 +39,7 @@ class Event extends PHPUnit_Framework_Testcase { * @param int $eventId * @return boolean true if event deleted, false otherwise */ - static function delete($eventId) { + public static function delete($eventId) { return CRM_Event_BAO_Event::del($eventId); } } diff --git a/tests/phpunit/CiviTest/Membership.php b/tests/phpunit/CiviTest/Membership.php index 21bce76d06..1772c04443 100644 --- a/tests/phpunit/CiviTest/Membership.php +++ b/tests/phpunit/CiviTest/Membership.php @@ -8,7 +8,7 @@ class Membership extends PHPUnit_Framework_Testcase { /** * Helper function to create membership type */ - function createMembershipType() { + public function createMembershipType() { $orgId = Contact::createOrganisation(); $ids = array('memberOfContact' => $orgId); @@ -41,7 +41,7 @@ class Membership extends PHPUnit_Framework_Testcase { /** * Helper function to create membership block for contribution page */ - function createMembershipBlock($membershipType, $contributionPageId) { + public function createMembershipBlock($membershipType, $contributionPageId) { $param = array( 'is_active' => 1, 'new_title' => 'Membership Fees', @@ -68,7 +68,7 @@ class Membership extends PHPUnit_Framework_Testcase { /** * Helper function to delete the membership block */ - function deleteMembershipBlock($blcokId) { + public function deleteMembershipBlock($blcokId) { $dao = new CRM_Member_DAO_MembershipBlock(); $dao->id = $blcokId; if ($dao->find(TRUE)) { diff --git a/tests/phpunit/CiviTest/PCP.php b/tests/phpunit/CiviTest/PCP.php index 19b72f943b..51740dbf66 100644 --- a/tests/phpunit/CiviTest/PCP.php +++ b/tests/phpunit/CiviTest/PCP.php @@ -12,7 +12,7 @@ class PCPBlock extends PHPUnit_Framework_Testcase { * @return array of created pcp block * */ - function create($contributionPageId) { + public function create($contributionPageId) { $profileParams = array( 'group_type' => 'Individual,Contact', 'title' => 'Test Supprorter Profile', @@ -96,7 +96,7 @@ class PCPBlock extends PHPUnit_Framework_Testcase { * @return boolean true if success, false otherwise * */ - function delete($params) { + public function delete($params) { $delete_params = array('id' => $params['profileId']); $resulProfile = civicrm_api('uf_group', 'delete', $delete_params); diff --git a/tests/phpunit/CiviTest/Participant.php b/tests/phpunit/CiviTest/Participant.php index 405271f863..6b845b6838 100644 --- a/tests/phpunit/CiviTest/Participant.php +++ b/tests/phpunit/CiviTest/Participant.php @@ -12,7 +12,7 @@ class Participant extends PHPUnit_Framework_Testcase { * * @return mixed $participant id of created Participant */ - static function create($contactId, $eventId) { + public static function create($contactId, $eventId) { $params = array( 'send_receipt' => 1, 'is_test' => 0, @@ -36,7 +36,7 @@ class Participant extends PHPUnit_Framework_Testcase { * @param int $participantId * @return boolean true if participant deleted, false otherwise */ - static function delete($participantId) { + public static function delete($participantId) { require_once 'CRM/Event/BAO/Participant.php'; return CRM_Event_BAO_Participant::deleteParticipant($participantId); } diff --git a/tests/phpunit/CiviTest/PaypalPro.php b/tests/phpunit/CiviTest/PaypalPro.php index 399d4cca36..0ff57c40ea 100644 --- a/tests/phpunit/CiviTest/PaypalPro.php +++ b/tests/phpunit/CiviTest/PaypalPro.php @@ -13,7 +13,7 @@ class PaypalPro extends PHPUnit_Framework_Testcase { * callAPISuccess won't work * I have duplicated this on the main test class as a work around */ - static function create() { + public static function create() { $paymentProcessor = new CRM_Financial_DAO_PaymentProcessor(); $paymentParams = array( @@ -45,7 +45,7 @@ class PaypalPro extends PHPUnit_Framework_Testcase { * to be deleted * @return boolean true if payment processor deleted, false otherwise */ - static function delete($id) { + public static function delete($id) { $pp = new CRM_Financial_DAO_PaymentProcessor(); $pp->id = $id; if ($pp->find(TRUE)) { diff --git a/tests/phpunit/HelloTest.php b/tests/phpunit/HelloTest.php index dd2d7c7c15..03f40a67ad 100644 --- a/tests/phpunit/HelloTest.php +++ b/tests/phpunit/HelloTest.php @@ -49,14 +49,14 @@ class HelloTest extends PHPUnit_Framework_TestCase { /** * @param null $name */ - function __construct($name = NULL) { + public function __construct($name = NULL) { parent::__construct($name); } // called before the test functions will be executed // this function is defined in PHPUnit_TestCase and overwritten // here - function setUp() { + public function setUp() { // create a new instance of String with the // string 'abc' $this->abc = "hello"; @@ -65,13 +65,13 @@ class HelloTest extends PHPUnit_Framework_TestCase { // called after the test functions are executed // this function is defined in PHPUnit_TestCase and overwritten // here - function tearDown() { + public function tearDown() { // delete your instance unset($this->abc); } // test the toString function - function testHello() { + public function testHello() { $result = $this->abc; $expected = 'hello'; $this->assertEquals($result, $expected); diff --git a/tests/phpunit/Utils.php b/tests/phpunit/Utils.php index 560fa2538f..781f7147a2 100644 --- a/tests/phpunit/Utils.php +++ b/tests/phpunit/Utils.php @@ -66,7 +66,7 @@ class Utils { * @return mixed PDOStatement => Results of the query * false => Query failed */ - function do_query($query) { + public function do_query($query) { // echo "do_query($query)\n"; // $stmt = $this->pdo->query( $query, PDO::FETCH_ASSOC ); // echo "PDO returned"; diff --git a/tests/phpunit/WebTest/ACL/AssignUsersToRolesTest.php b/tests/phpunit/WebTest/ACL/AssignUsersToRolesTest.php index d50906d8cf..e8fb8d2395 100755 --- a/tests/phpunit/WebTest/ACL/AssignUsersToRolesTest.php +++ b/tests/phpunit/WebTest/ACL/AssignUsersToRolesTest.php @@ -35,7 +35,7 @@ class WebTest_ACL_AssignUsersToRolesTest extends CiviSeleniumTestCase { parent::setUp(); } - function testAssignUsersToRoles() { + public function testAssignUsersToRoles() { $this->webtestLogin(); @@ -72,7 +72,7 @@ class WebTest_ACL_AssignUsersToRolesTest extends CiviSeleniumTestCase { $this->clickLink("_qf_ACL_next-bottom"); } - function testACLforSmartGroups() { + public function testACLforSmartGroups() { $this->webtestLogin(); //Create role diff --git a/tests/phpunit/WebTest/Activity/AddRecurringActivityTest.php b/tests/phpunit/WebTest/Activity/AddRecurringActivityTest.php index fc4f9cf9a5..f3b57fb493 100644 --- a/tests/phpunit/WebTest/Activity/AddRecurringActivityTest.php +++ b/tests/phpunit/WebTest/Activity/AddRecurringActivityTest.php @@ -38,7 +38,7 @@ class WebTest_Activity_AddRecurringActivityTest extends CiviSeleniumTestCase { parent::setUp(); } - function testRecurringActivity() { + public function testRecurringActivity() { $this->webtestLogin(); //Adding new contact diff --git a/tests/phpunit/WebTest/Activity/ContactContextAddTest.php b/tests/phpunit/WebTest/Activity/ContactContextAddTest.php index 345f7ef909..1f754dd4cd 100644 --- a/tests/phpunit/WebTest/Activity/ContactContextAddTest.php +++ b/tests/phpunit/WebTest/Activity/ContactContextAddTest.php @@ -35,7 +35,7 @@ class WebTest_Activity_ContactContextAddTest extends CiviSeleniumTestCase { parent::setUp(); } - function testContactContextActivityAdd() { + public function testContactContextActivityAdd() { $this->webtestLogin(); // Adding Adding contact with randomized first name for test testContactContextActivityAdd @@ -147,7 +147,7 @@ class WebTest_Activity_ContactContextAddTest extends CiviSeleniumTestCase { ); } - function testSeparateActivityForMultiTargetContacts() { + public function testSeparateActivityForMultiTargetContacts() { $this->webtestLogin(); //creating contacts diff --git a/tests/phpunit/WebTest/Activity/IcalTest.php b/tests/phpunit/WebTest/Activity/IcalTest.php index 783ea6efc1..3249afe5ce 100644 --- a/tests/phpunit/WebTest/Activity/IcalTest.php +++ b/tests/phpunit/WebTest/Activity/IcalTest.php @@ -41,7 +41,7 @@ class WebTest_Activity_IcalTest extends CiviSeleniumTestCase { parent::setUp(); } - function testStandaloneActivityAdd() { + public function testStandaloneActivityAdd() { $this->webtestLogin(); $this->openCiviPage("admin/setting/preferences/display", "reset=1", "name=activity_assignee_notification_ics"); diff --git a/tests/phpunit/WebTest/Activity/StandaloneAddTest.php b/tests/phpunit/WebTest/Activity/StandaloneAddTest.php index 745001c4b9..3826f3ae67 100644 --- a/tests/phpunit/WebTest/Activity/StandaloneAddTest.php +++ b/tests/phpunit/WebTest/Activity/StandaloneAddTest.php @@ -35,7 +35,7 @@ class WebTest_Activity_StandaloneAddTest extends CiviSeleniumTestCase { parent::setUp(); } - function testStandaloneActivityAdd() { + public function testStandaloneActivityAdd() { $this->webtestLogin(); // Adding Anderson, Anthony and Summerson, Samuel for testStandaloneActivityAdd test @@ -164,7 +164,7 @@ class WebTest_Activity_StandaloneAddTest extends CiviSeleniumTestCase { ); } - function testAjaxCustomGroupLoad() { + public function testAjaxCustomGroupLoad() { $this->webtestLogin(); $triggerElement = array('name' => 'activity_type_id', 'type' => 'select'); $customSets = array( @@ -180,7 +180,7 @@ class WebTest_Activity_StandaloneAddTest extends CiviSeleniumTestCase { * @param $expected * @param null $xpathPrefix */ - function VerifyTabularData($expected, $xpathPrefix = NULL) { + public function VerifyTabularData($expected, $xpathPrefix = NULL) { foreach ($expected as $label => $value) { $this->waitForElementPresent("xpath=//table/tbody/tr/td{$xpathPrefix}[text()='{$label}']/../following-sibling::td/span"); $this->verifyText("xpath=//table/tbody/tr/td{$xpathPrefix}[text()='{$label}']/../following-sibling::td/span", preg_quote($value), 'In line ' . __LINE__); diff --git a/tests/phpunit/WebTest/Admin/CustomAddTest.php b/tests/phpunit/WebTest/Admin/CustomAddTest.php index bfde4c32ff..8c1dd54a72 100644 --- a/tests/phpunit/WebTest/Admin/CustomAddTest.php +++ b/tests/phpunit/WebTest/Admin/CustomAddTest.php @@ -35,7 +35,7 @@ class WebTest_Admin_CustomAddTest extends CiviSeleniumTestCase { parent::setUp(); } - function testCustomAdd() { + public function testCustomAdd() { $this->webtestLogin(); $this->openCiviPage("admin/custom/group", "action=add&reset=1"); diff --git a/tests/phpunit/WebTest/Admin/CustomAddTestSameField.php b/tests/phpunit/WebTest/Admin/CustomAddTestSameField.php index b924b24750..9811391ac0 100644 --- a/tests/phpunit/WebTest/Admin/CustomAddTestSameField.php +++ b/tests/phpunit/WebTest/Admin/CustomAddTestSameField.php @@ -36,7 +36,7 @@ class WebTest_Admin_CustomAddTestSameField extends CiviSeleniumTestCase { parent::setUp(); } - function testCustomSameFieldAdd() { + public function testCustomSameFieldAdd() { $this->open($this->sboxPath); $this->webtestLogin(); @@ -44,7 +44,7 @@ class WebTest_Admin_CustomAddTestSameField extends CiviSeleniumTestCase { $this->_testCustomAdd(); } - function _testCustomAdd() { + public function _testCustomAdd() { //CRM-7564 : Different gropus can contain same custom fields $this->open($this->sboxPath . "civicrm/admin/custom/group?action=add&reset=1"); $this->waitForPageToLoad($this->getTimeoutMsec()); diff --git a/tests/phpunit/WebTest/Admin/Form/ScheduleReminderTest.php b/tests/phpunit/WebTest/Admin/Form/ScheduleReminderTest.php index 311cbdb7e7..823cb347d0 100644 --- a/tests/phpunit/WebTest/Admin/Form/ScheduleReminderTest.php +++ b/tests/phpunit/WebTest/Admin/Form/ScheduleReminderTest.php @@ -35,7 +35,7 @@ class WebTest_Admin_Form_ScheduleReminderTest extends CiviSeleniumTestCase { parent::setUp(); } - function testScheduleReminder() { + public function testScheduleReminder() { $this->webtestLogin(); // Add new Schedule Reminder diff --git a/tests/phpunit/WebTest/Admin/Form/Setting/LocalizationTest.php b/tests/phpunit/WebTest/Admin/Form/Setting/LocalizationTest.php index f6496772e8..618c995b8f 100644 --- a/tests/phpunit/WebTest/Admin/Form/Setting/LocalizationTest.php +++ b/tests/phpunit/WebTest/Admin/Form/Setting/LocalizationTest.php @@ -35,7 +35,7 @@ class WebTest_Admin_Form_Setting_LocalizationTest extends CiviSeleniumTestCase { parent::setUp(); } - function testDefaultCountryIsEnabled() { + public function testDefaultCountryIsEnabled() { $this->webtestLogin(); $this->openCiviPage("admin/setting/localization", "reset=1"); $this->addSelection("countryLimit-t", "label=United States"); diff --git a/tests/phpunit/WebTest/Admin/MoveCustomDataTest.php b/tests/phpunit/WebTest/Admin/MoveCustomDataTest.php index 762016f3c9..76f6a42f45 100644 --- a/tests/phpunit/WebTest/Admin/MoveCustomDataTest.php +++ b/tests/phpunit/WebTest/Admin/MoveCustomDataTest.php @@ -35,7 +35,7 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase { parent::setUp(); } - function testCreateCustomFields() { + public function testCreateCustomFields() { $this->webtestLogin(); $cid_all = $this->_createContact("all_data", "move_custom_data"); @@ -119,7 +119,7 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase { * @param int $from_group_id * @param int $to_group_id */ - function _moveCustomField($field_to_move, $from_group_id, $to_group_id) { + public function _moveCustomField($field_to_move, $from_group_id, $to_group_id) { //go to the move field page $this->openCiviPage('admin/custom/group/field/move', "reset=1&fid={$field_to_move}"); @@ -150,7 +150,7 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase { * * @return mixed */ - function _createContact($firstName = "John", $lastName = "Doe") { + public function _createContact($firstName = "John", $lastName = "Doe") { $firstName .= "_" . substr(sha1(rand()), 0, 5); $lastName .= "_" . substr(sha1(rand()), 0, 5); $this->webtestAddContact($firstName, $lastName); @@ -168,7 +168,7 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase { * * @return array */ - function _loadDataFromApi($contact_id, $group_id, $reset_cache = FALSE) { + public function _loadDataFromApi($contact_id, $group_id, $reset_cache = FALSE) { // cache the fields, just to speed things up a little static $field_ids = array(); @@ -209,7 +209,7 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase { * * @return null */ - function _buildCustomFieldset($prefix) { + public function _buildCustomFieldset($prefix) { $group_id = $this->_createCustomGroup($prefix); $field_ids[] = $this->_addCustomFieldToGroup($group_id, 'Alphanumeric', "CheckBox", $prefix); $field_ids[] = $this->_addCustomFieldToGroup($group_id, 'Alphanumeric', "Radio", $prefix); @@ -226,7 +226,7 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase { * * @return null */ - function _createCustomGroup($prefix = "custom", $entity = "Contact") { + public function _createCustomGroup($prefix = "custom", $entity = "Contact") { $this->openCiviPage('admin/custom/group', 'action=add&reset=1'); @@ -259,7 +259,7 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase { * @return mixed * @throws PHPUnit_Framework_AssertionFailedError */ - function _addCustomFieldToGroup($group_id, $type = 'Alphanumeric', $widget = 'CheckBox', $prefix = '') { + public function _addCustomFieldToGroup($group_id, $type = 'Alphanumeric', $widget = 'CheckBox', $prefix = '') { //A mapping of data type names to integer keys $type_map = array( 'alphanumeric' => array( @@ -414,7 +414,7 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase { * @param int $contact_id * @param int $group_id */ - function _fillCustomDataForContact($contact_id, $group_id) { + public function _fillCustomDataForContact($contact_id, $group_id) { //edit the given contact $this->openCiviPage('contact/add', "reset=1&action=update&cid={$contact_id}"); diff --git a/tests/phpunit/WebTest/Admin/RelationshipTypeAddTest.php b/tests/phpunit/WebTest/Admin/RelationshipTypeAddTest.php index b258798f64..e43c80b995 100644 --- a/tests/phpunit/WebTest/Admin/RelationshipTypeAddTest.php +++ b/tests/phpunit/WebTest/Admin/RelationshipTypeAddTest.php @@ -35,7 +35,7 @@ class WebTest_Admin_RelationshipTypeAddTest extends CiviSeleniumTestCase { parent::setUp(); } - function testRelationshipTypeAdd() { + public function testRelationshipTypeAdd() { $this->webtestLogin(); $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -78,7 +78,7 @@ class WebTest_Admin_RelationshipTypeAddTest extends CiviSeleniumTestCase { } } - function testRelationshipTypeAddValidateFormRules() { + public function testRelationshipTypeAddValidateFormRules() { $this->webtestLogin(); $this->waitForPageToLoad($this->getTimeoutMsec()); diff --git a/tests/phpunit/WebTest/Campaign/ActivityTest.php b/tests/phpunit/WebTest/Campaign/ActivityTest.php index fe6ddf7bbb..3d5d367307 100644 --- a/tests/phpunit/WebTest/Campaign/ActivityTest.php +++ b/tests/phpunit/WebTest/Campaign/ActivityTest.php @@ -35,7 +35,7 @@ class WebTest_Campaign_ActivityTest extends CiviSeleniumTestCase { parent::setUp(); } - function testCreateCampaign() { + public function testCreateCampaign() { $this->webtestLogin('admin'); // Enable CiviCampaign module if necessary @@ -115,7 +115,7 @@ class WebTest_Campaign_ActivityTest extends CiviSeleniumTestCase { * @param $campaignTitle * @param int $id */ - function activityAddTest($campaignTitle, $id) { + public function activityAddTest($campaignTitle, $id) { // Adding Adding contact with randomized first name for test testContactContextActivityAdd // We're using Quick Add block on the main page for this. $firstName1 = substr(sha1(rand()), 0, 7); diff --git a/tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php b/tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php index bb355d549f..e72db674d7 100644 --- a/tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php +++ b/tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php @@ -35,7 +35,7 @@ class WebTest_Campaign_CampaignDescriptionTest extends CiviSeleniumTestCase { parent::setUp(); } - function testCreateCampaign() { + public function testCreateCampaign() { // Fixme: testing a theory that this test was failing due to permissions $this->webtestLogin('admin'); @@ -81,7 +81,7 @@ class WebTest_Campaign_CampaignDescriptionTest extends CiviSeleniumTestCase { $this->assertEquals($campaignDescription, $fetchedVaue); } - function testAjaxCustomGroupLoad() { + public function testAjaxCustomGroupLoad() { $this->webtestLogin(); $this->enableComponents(array('CiviCampaign')); diff --git a/tests/phpunit/WebTest/Campaign/MailingTest.php b/tests/phpunit/WebTest/Campaign/MailingTest.php index 022c2efd6a..78240efe6b 100644 --- a/tests/phpunit/WebTest/Campaign/MailingTest.php +++ b/tests/phpunit/WebTest/Campaign/MailingTest.php @@ -35,7 +35,7 @@ class WebTest_Campaign_MailingTest extends CiviSeleniumTestCase { parent::setUp(); } - function testCreateCampaign() { + public function testCreateCampaign() { // Log in as admin first to verify permissions for CiviCampaign $this->webtestLogin('admin'); @@ -105,7 +105,7 @@ class WebTest_Campaign_MailingTest extends CiviSeleniumTestCase { * @param $campaignTitle * @param int $id */ - function mailingAddTest($groupName, $campaignTitle, $id) { + public function mailingAddTest($groupName, $campaignTitle, $id) { //---- create mailing contact and add to mailing Group $firstName = substr(sha1(rand()), 0, 7); $this->webtestAddContact($firstName, "Mailson", "mailino$firstName@mailson.co.in"); diff --git a/tests/phpunit/WebTest/Campaign/MembershipTest.php b/tests/phpunit/WebTest/Campaign/MembershipTest.php index 047b526036..1a25b56b95 100644 --- a/tests/phpunit/WebTest/Campaign/MembershipTest.php +++ b/tests/phpunit/WebTest/Campaign/MembershipTest.php @@ -35,7 +35,7 @@ class WebTest_Campaign_MembershipTest extends CiviSeleniumTestCase { parent::setUp(); } - function testCreateCampaign() { + public function testCreateCampaign() { $this->webtestLogin('admin'); // Create new group @@ -113,7 +113,7 @@ class WebTest_Campaign_MembershipTest extends CiviSeleniumTestCase { * @param $campaignTitle * @param int $id */ - function memberAddTest($campaignTitle, $id) { + public function memberAddTest($campaignTitle, $id) { //Add new memebershipType $memTypeParams = $this->webtestAddMembershipType(); diff --git a/tests/phpunit/WebTest/Campaign/OfflineContributionTest.php b/tests/phpunit/WebTest/Campaign/OfflineContributionTest.php index 9f8000380d..c21741f9cf 100644 --- a/tests/phpunit/WebTest/Campaign/OfflineContributionTest.php +++ b/tests/phpunit/WebTest/Campaign/OfflineContributionTest.php @@ -35,7 +35,7 @@ class WebTest_Campaign_OfflineContributionTest extends CiviSeleniumTestCase { parent::setUp(); } - function testCreateCampaign() { + public function testCreateCampaign() { $this->webtestLogin('admin'); // Create new group @@ -122,7 +122,7 @@ class WebTest_Campaign_OfflineContributionTest extends CiviSeleniumTestCase { * @param int $id * @param bool $past */ - function offlineContributionTest($campaignTitle, $id, $past = FALSE) { + public function offlineContributionTest($campaignTitle, $id, $past = FALSE) { // Create a contact to be used as soft creditor $softCreditFname = substr(sha1(rand()), 0, 7); $softCreditLname = substr(sha1(rand()), 0, 7); @@ -232,7 +232,7 @@ class WebTest_Campaign_OfflineContributionTest extends CiviSeleniumTestCase { /** * @param string $groupName */ - function pastCampaignsTest($groupName) { + public function pastCampaignsTest($groupName) { $this->openCiviPage('campaign/add', 'reset=1', '_qf_Campaign_upload-bottom'); $pastTitle = substr(sha1(rand()), 0, 7); diff --git a/tests/phpunit/WebTest/Campaign/OfflineEventRegistrationTest.php b/tests/phpunit/WebTest/Campaign/OfflineEventRegistrationTest.php index 0acae9ac9a..0eaeb9d058 100644 --- a/tests/phpunit/WebTest/Campaign/OfflineEventRegistrationTest.php +++ b/tests/phpunit/WebTest/Campaign/OfflineEventRegistrationTest.php @@ -35,7 +35,7 @@ class WebTest_Campaign_OfflineEventRegistrationTest extends CiviSeleniumTestCase parent::setUp(); } - function testCreateCampaign() { + public function testCreateCampaign() { $this->webtestLogin('admin'); // Create new group @@ -123,7 +123,7 @@ class WebTest_Campaign_OfflineEventRegistrationTest extends CiviSeleniumTestCase * @param $campaignTitle * @param int $id */ - function offlineParticipantAddTest($campaignTitle, $id) { + public function offlineParticipantAddTest($campaignTitle, $id) { // connect campaign with event $this->openCiviPage("event/manage", "reset=1"); $eventId = $this->registerUrl(); @@ -224,7 +224,7 @@ class WebTest_Campaign_OfflineEventRegistrationTest extends CiviSeleniumTestCase /** * @return mixed */ - function registerUrl() { + public function registerUrl() { $this->openCiviPage("event/manage", "reset=1"); $eventId = explode('-', $this->getAttribute("//div[@id='event_status_id']//div[2]/table/tbody/tr@id")); return $eventId[1]; diff --git a/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php b/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php index 89a3ab5924..1709421b4c 100644 --- a/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php +++ b/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php @@ -35,7 +35,7 @@ class WebTest_Campaign_OnlineContributionTest extends CiviSeleniumTestCase { parent::setUp(); } - function testCreateCampaign() { + public function testCreateCampaign() { $this->webtestLogin('admin'); // Create new group @@ -119,7 +119,7 @@ class WebTest_Campaign_OnlineContributionTest extends CiviSeleniumTestCase { * @param $campaignTitle * @param int $id */ - function onlineContributionAddTest($campaignTitle, $id) { + public function onlineContributionAddTest($campaignTitle, $id) { // Use default payment processor $processorName = 'Test Processor'; $paymentProcessorId = $this->webtestAddPaymentProcessor($processorName); diff --git a/tests/phpunit/WebTest/Campaign/OnlineEventRegistrationTest.php b/tests/phpunit/WebTest/Campaign/OnlineEventRegistrationTest.php index 9288f9b25d..e447b25be9 100644 --- a/tests/phpunit/WebTest/Campaign/OnlineEventRegistrationTest.php +++ b/tests/phpunit/WebTest/Campaign/OnlineEventRegistrationTest.php @@ -35,7 +35,7 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase parent::setUp(); } - function testCreateCampaign() { + public function testCreateCampaign() { $this->webtestLogin('admin'); // Create new group @@ -116,7 +116,7 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase * @param $campaignTitle * @param int $id */ - function onlineParticipantAddTest($campaignTitle, $id) { + public function onlineParticipantAddTest($campaignTitle, $id) { // Use default payment processor $processorName = 'Test Processor'; $paymentProcessorId = $this->webtestAddPaymentProcessor($processorName); @@ -154,7 +154,7 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase * @param $eventTitle * @param $eventDescription */ - function _testAddEventInfo($id, $eventTitle, $eventDescription) { + public function _testAddEventInfo($id, $eventTitle, $eventDescription) { $this->waitForElementPresent("_qf_EventInfo_upload-bottom"); $this->select("event_type_id", "value=1"); @@ -186,7 +186,7 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase /** * @param $streetAddress */ - function _testAddLocation($streetAddress) { + public function _testAddLocation($streetAddress) { // Wait for Location tab form to load $this->waitForElementPresent("_qf_Location_upload-bottom"); @@ -212,7 +212,7 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase * @param bool $priceSet * @param int $processorId */ - function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorId) { + public function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorId) { // Go to Fees tab $this->click("link=Fees"); $this->waitForElementPresent("_qf_Fee_upload-bottom"); @@ -245,7 +245,7 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase * @param $registerIntro * @param bool $multipleRegistrations */ - function _testAddOnlineRegistration($registerIntro, $multipleRegistrations = FALSE) { + public function _testAddOnlineRegistration($registerIntro, $multipleRegistrations = FALSE) { // Go to Online Registration tab $this->click("link=Online Registration"); $this->waitForElementPresent("_qf_Registration_upload-bottom"); @@ -273,7 +273,7 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase * @param $eventTitle * @param $eventInfoStrings */ - function _testVerifyEventInfo($eventTitle, $eventInfoStrings) { + public function _testVerifyEventInfo($eventTitle, $eventInfoStrings) { // verify event input on info page // start at Manage Events listing $this->openCiviPage("event/manage", "reset=1"); @@ -288,7 +288,7 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase * * @return string */ - function _testVerifyRegisterPage($registerStrings) { + public function _testVerifyRegisterPage($registerStrings) { // Go to Register page and check for intro text and fee levels $this->click("link=Register Now"); $this->waitForElementPresent("_qf_Register_upload-bottom"); @@ -302,7 +302,7 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase * @param int $numberRegistrations * @param bool $anonymous */ - function _testOnlineRegistration($campaignTitle, $registerUrl, $numberRegistrations = 1, $anonymous = TRUE) { + public function _testOnlineRegistration($campaignTitle, $registerUrl, $numberRegistrations = 1, $anonymous = TRUE) { if ($anonymous) { $this->webtestLogout(); } diff --git a/tests/phpunit/WebTest/Campaign/PetitionUsageScenarioTest.php b/tests/phpunit/WebTest/Campaign/PetitionUsageScenarioTest.php index dd573e9071..1388581e25 100644 --- a/tests/phpunit/WebTest/Campaign/PetitionUsageScenarioTest.php +++ b/tests/phpunit/WebTest/Campaign/PetitionUsageScenarioTest.php @@ -35,7 +35,7 @@ class WebTest_Campaign_PetitionUsageScenarioTest extends CiviSeleniumTestCase { parent::setUp(); } - function testPetitionUsageScenario() { + public function testPetitionUsageScenario() { $this->webtestLogin('admin'); // Enable CiviCampaign module if necessary diff --git a/tests/phpunit/WebTest/Campaign/PledgeTest.php b/tests/phpunit/WebTest/Campaign/PledgeTest.php index 865813182f..64542eaba3 100644 --- a/tests/phpunit/WebTest/Campaign/PledgeTest.php +++ b/tests/phpunit/WebTest/Campaign/PledgeTest.php @@ -35,7 +35,7 @@ class WebTest_Campaign_PledgeTest extends CiviSeleniumTestCase { parent::setUp(); } - function testCreateCampaign() { + public function testCreateCampaign() { // Log in as admin first to verify permissions for CiviGrant $this->webtestLogin('admin'); @@ -121,7 +121,7 @@ class WebTest_Campaign_PledgeTest extends CiviSeleniumTestCase { * @param $campaignTitle * @param int $id */ - function pledgeAddTest($campaignTitle, $id) { + public function pledgeAddTest($campaignTitle, $id) { // create unique name $name = substr(sha1(rand()), 0, 7); $firstName = 'Adam' . $name; diff --git a/tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php b/tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php index 456ec86bfe..87770620f4 100644 --- a/tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php +++ b/tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php @@ -35,7 +35,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase { parent::setUp(); } - function testSurveyUsageScenario() { + public function testSurveyUsageScenario() { $this->webtestLogin('admin'); // Create new group @@ -301,7 +301,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase { $this->waitForText("xpath=//div[@id='search-status']/table/tbody/tr[1]/td[1]",'1 Result'); } - function testSurveyReportTest() { + public function testSurveyReportTest() { $this->webtestLogin('admin'); // Enable CiviCampaign module if necessary diff --git a/tests/phpunit/WebTest/Case/ActivityToCaseTest.php b/tests/phpunit/WebTest/Case/ActivityToCaseTest.php index beb55c9bcf..260b93f5ab 100644 --- a/tests/phpunit/WebTest/Case/ActivityToCaseTest.php +++ b/tests/phpunit/WebTest/Case/ActivityToCaseTest.php @@ -35,7 +35,7 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase { parent::setUp(); } - function testAddActivityToCase() { + public function testAddActivityToCase() { // Log in as admin first to verify permissions for CiviCase $this->webtestLogin('admin'); @@ -81,7 +81,7 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase { $this->_testAddNewActivity($contact['first_name'], $subject, $customGroupTitle, $contact['sort_name']); } - function testLinkCases() { + public function testLinkCases() { // Log in as admin first to verify permissions for CiviCase $this->webtestLogin('admin'); @@ -192,7 +192,7 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase { * @param $customGroupTitle * @param $contactName */ - function _testAddNewActivity($firstName, $caseSubject, $customGroupTitle, $contactName) { + public function _testAddNewActivity($firstName, $caseSubject, $customGroupTitle, $contactName) { $customDataParams = $this->_addCustomData($customGroupTitle); //$customDataParams = array( 'optionLabel_47d58', 'custom_8_-1' ); @@ -332,7 +332,7 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase { * * @return array */ - function _addCustomData($customGroupTitle) { + public function _addCustomData($customGroupTitle) { $this->openCiviPage('admin/custom/group', 'reset=1'); diff --git a/tests/phpunit/WebTest/Case/AddCaseTest.php b/tests/phpunit/WebTest/Case/AddCaseTest.php index eefbbd6d68..dbaa299d16 100644 --- a/tests/phpunit/WebTest/Case/AddCaseTest.php +++ b/tests/phpunit/WebTest/Case/AddCaseTest.php @@ -35,7 +35,7 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase { parent::setUp(); } - function testStandaloneCaseAdd() { + public function testStandaloneCaseAdd() { // Log in as admin first to verify permissions for CiviCase $this->webtestLogin('admin'); @@ -138,7 +138,7 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase { $this->_testAssignToClient($client['first_name'], $client['last_name'], $caseTypeLabel); } - function testAjaxCustomGroupLoad() { + public function testAjaxCustomGroupLoad() { // Log in as admin first to verify permissions for CiviCase $this->webtestLogin('admin'); @@ -165,7 +165,7 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase { * @param $validateStrings * @param $activityTypes */ - function _testVerifyCaseSummary($validateStrings, $activityTypes) { + public function _testVerifyCaseSummary($validateStrings, $activityTypes) { $this->assertStringsPresent($validateStrings); foreach ($activityTypes as $aType) { $this->assertElementPresent("xpath=//div[@class='case-control-panel']/div/p/select", $aType); @@ -178,7 +178,7 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase { * @param $caseRoles * @param string $creatorName */ - function _testVerifyCaseRoles($caseRoles, $creatorName) { + public function _testVerifyCaseRoles($caseRoles, $creatorName) { $id = $this->urlArg('id'); $this->waitForElementPresent("xpath=//table[@id='caseRoles-selector-$id']/tbody/tr[4]/td[2]/a"); // check that expected roles are listed in the Case Roles pane @@ -192,7 +192,7 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase { /** * @param $activityTypes */ - function _testVerifyCaseActivities($activityTypes) { + public function _testVerifyCaseActivities($activityTypes) { $id = $this->urlArg('id'); // check that expected auto-created activities are listed in the Case Activities table foreach ($activityTypes as $aType) { @@ -204,7 +204,7 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase { * @param $subject * @param $openCaseData */ - function _testVerifyOpenCaseActivity($subject, $openCaseData) { + public function _testVerifyOpenCaseActivity($subject, $openCaseData) { $id = $this->urlArg('id'); // check that open case subject is present $this->assertText("case_id_$id", $subject); @@ -226,7 +226,7 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase { * @param string $lastName * @param $action */ - function _testSearchbyDate($firstName, $lastName, $action) { + public function _testSearchbyDate($firstName, $lastName, $action) { // Find Cases if ($action != "0") { $this->openCiviPage('case/search', 'reset=1'); @@ -277,7 +277,7 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase { * * test for assign case to another client */ - function _testAssignToClient($firstName, $lastName, $caseTypeLabel) { + public function _testAssignToClient($firstName, $lastName, $caseTypeLabel) { $this->openCiviPage('case/search', 'reset=1', '_qf_Search_refresh-bottom'); $this->type('sort_name', $firstName); $this->clickLink('_qf_Search_refresh-bottom'); diff --git a/tests/phpunit/WebTest/Case/AddCaseTypeTest.php b/tests/phpunit/WebTest/Case/AddCaseTypeTest.php index 03e9453fc7..78bb0fc777 100644 --- a/tests/phpunit/WebTest/Case/AddCaseTypeTest.php +++ b/tests/phpunit/WebTest/Case/AddCaseTypeTest.php @@ -35,7 +35,7 @@ class WebTest_Case_AddCaseTypeTest extends CiviSeleniumTestCase { parent::setUp(); } - function testAddEditCaseType() { + public function testAddEditCaseType() { $caseRoles = array(1 => 'Parent of', 2 => 'Spouse of', 3 => 'Partner of'); $activityTypes = array(1 => 'Meeting',2 => 'Contribution',3 => 'Event Registration'); $timelineActivityTypes = array(1 => 'Meeting',2 => 'Phone Call',3 => 'Email'); diff --git a/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php b/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php index 21594b48e7..10d54a3425 100644 --- a/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php +++ b/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php @@ -35,7 +35,7 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase { parent::setUp(); } - function testAddCase() { + public function testAddCase() { $this->webtestLogin('admin'); // Enable CiviCase module if necessary @@ -177,7 +177,7 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase { * * @return array */ - function _testGetCustomFieldId($customGrpId1, $noteRichEditor=FALSE) { + public function _testGetCustomFieldId($customGrpId1, $noteRichEditor=FALSE) { $customId = array(); $this->openCiviPage('admin/custom/group/field/add', array('reset' => 1, 'action' => 'add', 'gid' => $customGrpId1)); @@ -248,7 +248,7 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase { * @param $customGrpId1 * @param int $customId */ - function _testDeleteCustomData($customGrpId1, $customId) { + public function _testDeleteCustomData($customGrpId1, $customId) { // delete all custom data foreach ($customId as $cKey => $cValue) { $this->openCiviPage("admin/custom/group/field", array('action' => 'delete', 'reset' => '1', 'gid' => $customGrpId1, 'id' => $cValue)); @@ -263,7 +263,7 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase { /** * CRM-12812 */ - function testCaseCustomNoteRichEditor() { + public function testCaseCustomNoteRichEditor() { $this->webtestLogin('admin'); //setting ckeditor as WYSIWYG @@ -397,7 +397,7 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase { * @param string $custMname * @param $custLname */ - function _testAdvansearchCaseData($customId, $custFname, $custMname, $custLname) { + public function _testAdvansearchCaseData($customId, $custFname, $custMname, $custLname) { // search casecontact $this->openCiviPage('contact/search/advanced', 'reset=1', '_qf_Advanced_refresh'); $this->click("CiviCase"); diff --git a/tests/phpunit/WebTest/Case/CaseDashboardTest.php b/tests/phpunit/WebTest/Case/CaseDashboardTest.php index 273a4bfcfc..3dfee50fdc 100644 --- a/tests/phpunit/WebTest/Case/CaseDashboardTest.php +++ b/tests/phpunit/WebTest/Case/CaseDashboardTest.php @@ -35,7 +35,7 @@ class WebTest_Case_CaseDashboardTest extends CiviSeleniumTestCase { parent::setUp(); } - function testAllOrMyCases() { + public function testAllOrMyCases() { // Log in as admin first to verify permissions for CiviCase $this->webtestLogin('admin'); diff --git a/tests/phpunit/WebTest/Contact/AddCmsUserTest.php b/tests/phpunit/WebTest/Contact/AddCmsUserTest.php index 277d8e2491..50633b119d 100644 --- a/tests/phpunit/WebTest/Contact/AddCmsUserTest.php +++ b/tests/phpunit/WebTest/Contact/AddCmsUserTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_AddCmsUserTest extends CiviSeleniumTestCase { parent::setUp(); } - function testAuthenticAddUser() { + public function testAuthenticAddUser() { $this->webtestLogin('admin'); @@ -68,7 +68,7 @@ class WebTest_Contact_AddCmsUserTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); } - function testAnonymousAddUser() { + public function testAnonymousAddUser() { // Make sure Drupal account settings allow visitors to register for account w/o admin approval // login as admin $this->webtestLogin('admin'); diff --git a/tests/phpunit/WebTest/Contact/AddContactsToEventAdvancedSearchTest.php b/tests/phpunit/WebTest/Contact/AddContactsToEventAdvancedSearchTest.php index d9c60e9f3e..335c557780 100644 --- a/tests/phpunit/WebTest/Contact/AddContactsToEventAdvancedSearchTest.php +++ b/tests/phpunit/WebTest/Contact/AddContactsToEventAdvancedSearchTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_AddContactsToEventAdvancedSearchTest extends CiviSeleniumT parent::setUp(); } - function testAddContactsToEventAdvanceSearch() { + public function testAddContactsToEventAdvanceSearch() { $this->webtestLogin(); $this->waitForPageToLoad($this->getTimeoutMsec()); diff --git a/tests/phpunit/WebTest/Contact/AddTest.php b/tests/phpunit/WebTest/Contact/AddTest.php index 2774d45fe2..aa20279a19 100644 --- a/tests/phpunit/WebTest/Contact/AddTest.php +++ b/tests/phpunit/WebTest/Contact/AddTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase { parent::setUp(); } - function testIndividualAdd() { + public function testIndividualAdd() { $this->webtestLogin(); $groupName = $this->WebtestAddGroup(); @@ -171,7 +171,7 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase { $this->waitForText('crm-notification-container', "Contact Saved"); } - function testHouseholdAdd() { + public function testHouseholdAdd() { $this->webtestLogin(); $groupName = $this->WebtestAddGroup(); @@ -282,7 +282,7 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase { $this->waitForText('crm-notification-container', "Contact Saved"); } - function testOrganizationAdd() { + public function testOrganizationAdd() { $this->webtestLogin(); $groupName = $this->WebtestAddGroup(); @@ -386,7 +386,7 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase { $this->waitForText('crm-notification-container', "Contact Saved"); } - function testIndividualAddWithSharedAddress() { + public function testIndividualAddWithSharedAddress() { $this->webtestLogin(); $this->openCiviPage('contact/add', "reset=1&ct=Individual"); diff --git a/tests/phpunit/WebTest/Contact/AddViaProfileTest.php b/tests/phpunit/WebTest/Contact/AddViaProfileTest.php index fb7babc7c5..b7a2cc836a 100644 --- a/tests/phpunit/WebTest/Contact/AddViaProfileTest.php +++ b/tests/phpunit/WebTest/Contact/AddViaProfileTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_AddViaProfileTest extends CiviSeleniumTestCase { parent::setUp(); } - function testAddViaCreateProfile() { + public function testAddViaCreateProfile() { $this->webtestLogin(); $this->openCiviPage('profile/create', 'reset=1&gid=1', '_qf_Edit_next'); diff --git a/tests/phpunit/WebTest/Contact/AddressParsingTest.php b/tests/phpunit/WebTest/Contact/AddressParsingTest.php index 6ce6ffc654..7a8d0e60f5 100644 --- a/tests/phpunit/WebTest/Contact/AddressParsingTest.php +++ b/tests/phpunit/WebTest/Contact/AddressParsingTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_AddressParsingTest extends CiviSeleniumTestCase { parent::setUp(); } - function teststreetAddressParsing() { + public function teststreetAddressParsing() { // Logging in. $this->webtestLogin(); diff --git a/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php b/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php index 0534d5d289..6700444708 100644 --- a/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php +++ b/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php @@ -38,7 +38,7 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase { /* * test individual pane seperatly. */ - function testIndividualPanes() { + public function testIndividualPanes() { $this->webtestLogin(); // Get all default advance search panes. @@ -64,7 +64,7 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase { /* * test by selecting all panes at a time. */ - function testAllPanes() { + public function testAllPanes() { $this->webtestLogin(); // Get all default advance search panes. @@ -170,7 +170,7 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase { * * @return array */ - function _advanceSearchPanes($paneRef = NULL) { + public function _advanceSearchPanes($paneRef = NULL) { static $_advance_search_panes; if (!isset($_advance_search_panes) || empty($_advance_search_panes)) { diff --git a/tests/phpunit/WebTest/Contact/AdvanceSearchPrivacyOptionsTest.php b/tests/phpunit/WebTest/Contact/AdvanceSearchPrivacyOptionsTest.php index 23d9e9a025..6e69b7d376 100644 --- a/tests/phpunit/WebTest/Contact/AdvanceSearchPrivacyOptionsTest.php +++ b/tests/phpunit/WebTest/Contact/AdvanceSearchPrivacyOptionsTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_AdvanceSearchPrivacyOptionsTest extends CiviSeleniumTestCa parent::setUp(); } - function testSearchForPrivacyOptions() { + public function testSearchForPrivacyOptions() { $this->webtestLogin(); $privacyOptions = array( @@ -131,7 +131,7 @@ class WebTest_Contact_AdvanceSearchPrivacyOptionsTest extends CiviSeleniumTestCa * @param $privacyOperator * @param $allPrivacyOptions */ - function _addPrivacyCriteria($inEx, $privacyOptions, $privacyOperator, $allPrivacyOptions) { + public function _addPrivacyCriteria($inEx, $privacyOptions, $privacyOperator, $allPrivacyOptions) { $inExId = ($inEx == 'include') ? 'CIVICRM_QFID_2_privacy_toggle' : 'CIVICRM_QFID_1_privacy_toggle'; $this->click($inExId); $this->select('privacy_operator', "{$privacyOperator}"); @@ -160,7 +160,7 @@ class WebTest_Contact_AdvanceSearchPrivacyOptionsTest extends CiviSeleniumTestCa * * @return bool */ - function _searchSortNameCriteria($firstName, $lastName) { + public function _searchSortNameCriteria($firstName, $lastName) { //type in the criteria $this->type("sort_name", "{$lastName}, {$firstName}"); @@ -177,7 +177,7 @@ class WebTest_Contact_AdvanceSearchPrivacyOptionsTest extends CiviSeleniumTestCa * * @return string */ - function getOptionVal($privacyOption) { + public function getOptionVal($privacyOption) { if ($privacyOption == 'do_not_phone') { $privacyOptionVal = 'Do not phone'; } @@ -201,7 +201,7 @@ class WebTest_Contact_AdvanceSearchPrivacyOptionsTest extends CiviSeleniumTestCa * @param string $lastName * @param $options */ - function _addIndividual($firstName, $lastName, $options) { + public function _addIndividual($firstName, $lastName, $options) { $this->openCiviPage('contact/add', 'reset=1&ct=Individual'); diff --git a/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php b/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php index 5cdebbe8f4..5158b74b7a 100644 --- a/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php +++ b/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { parent::setUp(); } - function testAdvanceSearch() { + public function testAdvanceSearch() { $this->webtestLogin(); $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -170,7 +170,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { /* * Check for CRM-9873 */ - function testActivitySearchByTypeTest() { + public function testActivitySearchByTypeTest() { $this->webtestLogin(); $this->openCiviPage('contact/search/advanced', 'reset=1'); $this->clickAjaxLink("activity", 'activity_subject'); @@ -214,7 +214,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { /** * @param string $firstName */ - function submitSearch($firstName) { + public function submitSearch($firstName) { $this->clickLink("_qf_Advanced_refresh"); // verify unique name $this->waitForText("xpath=//div[@class='crm-search-results']/table/tbody", preg_quote("adv$firstName, $firstName")); @@ -227,7 +227,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { /* * Check for CRM-14952 */ - function testStateSorting() { + public function testStateSorting() { $this->webtestLogin(); $this->openCiviPage('contact/search/advanced', 'reset=1', 'group'); $this->select2("group", "Newsletter", TRUE); @@ -252,7 +252,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { * @param string $groupName * @param $tagName */ - function addBasicSearchDetail($firstName, $groupName, $tagName) { + public function addBasicSearchDetail($firstName, $groupName, $tagName) { // fill partial sort name $this->type("sort_name", "$firstName"); // select subtype @@ -277,7 +277,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { /** * @param $firstName */ - function addAddressSearchDetail($firstName) { + public function addAddressSearchDetail($firstName) { // select location type (home and main) $this->multiselect2('location_type', array('Home', 'Main')); // fill street address @@ -298,7 +298,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { /** * @param $firstName */ - function addActivitySearchDetail($firstName) { + public function addActivitySearchDetail($firstName) { // check activity types $checkActivityTypes = array("Contribution", "Event Registration", "Membership Signup"); foreach ($checkActivityTypes as $labels) { @@ -316,7 +316,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { } // function to fill demographic search details - function addDemographicSearchDetail() { + public function addDemographicSearchDetail() { // fill birth date range $this->select("birth_date_relative","value=0"); $this->webtestFillDate("birth_date_low", "-3 year"); @@ -334,7 +334,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { /** * @param $firstName */ - function addContributionSearchDetail($firstName) { + public function addContributionSearchDetail($firstName) { // fill contribution date range $this->select("contribution_date_relative","value=0"); $this->webtestFillDate("contribution_date_low", "-1 day"); @@ -356,7 +356,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { } // function to fill participant search details - function addParticipantSearchDetail() { + public function addParticipantSearchDetail() { // fill event name $this->select2("event_id", "Fall Fundraiser Dinner"); // fill event type @@ -376,7 +376,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { /** * @param $firstName */ - function addMemberSearchDetail($firstName) { + public function addMemberSearchDetail($firstName) { // check membership type (Student) $this->click("xpath=//div[@id='memberForm']/table/tbody/tr[1]/td[1]/div[1]//div/label[text()='Student']"); // check membership status (completed) @@ -403,7 +403,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { /** * @param $firstName */ - function addPledgeSearchDetail($firstName) { + public function addPledgeSearchDetail($firstName) { // fill pledge schedule date range $this->select("pledge_payment_date_relative","value=0"); $this->webtestFillDate("pledge_payment_date_low", "-1 day"); @@ -431,7 +431,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { /** * @param null $firstName */ - function createDetailContact($firstName = NULL) { + public function createDetailContact($firstName = NULL) { if (!$firstName) { $firstName = substr(sha1(rand()), 0, 7); } diff --git a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php index 3df3cbe028..7e15fecba4 100644 --- a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php +++ b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes parent::setUp(); } - function testSearchRelatedContact() { + public function testSearchRelatedContact() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -145,7 +145,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes * @param $eventTitle * @param $eventDescription */ - function _testAddEventInfo($eventTitle, $eventDescription) { + public function _testAddEventInfo($eventTitle, $eventDescription) { $this->waitForElementPresent("_qf_EventInfo_upload-bottom"); $this->select("event_type_id", "value=1"); @@ -173,7 +173,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes /** * @param $streetAddress */ - function _testAddLocation($streetAddress) { + public function _testAddLocation($streetAddress) { // Wait for Location tab form to load $this->waitForPageToLoad($this->getTimeoutMsec()); $this->waitForElementPresent("_qf_Location_upload-bottom"); @@ -199,7 +199,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes * @param bool $priceSet * @param int $processorId */ - function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorId) { + public function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorId) { // Go to Fees tab $this->click("link=Fees"); $this->waitForElementPresent("_qf_Fee_upload-bottom"); @@ -234,7 +234,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes * @param string $relatedName * @param $relType */ - function _testAddRelationship($ContactName, $relatedName, $relType) { + public function _testAddRelationship($ContactName, $relatedName, $relType) { $this->openCiviPage('contact/search', 'reset=1', '_qf_Basic_refresh'); $this->type("sort_name", $ContactName); @@ -289,7 +289,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes /** * @param $relType */ - function _testSearchResult($relType) { + public function _testSearchResult($relType) { //search related contact using Advanced Search $this->openCiviPage('contact/search/advanced', 'reset=1', '_qf_Advanced_refresh'); @@ -303,7 +303,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes $this->assertElementContainsText('search-status', '2 Contacts'); } - function testAdvanceSearchForLog() { + public function testAdvanceSearchForLog() { $this->webtestLogin(); $Pdate = date('F jS, Y h:i:s A', mktime( 0, 0, 0, date( 'm' ), date( 'd' ) - 1, date( 'Y' )) ); diff --git a/tests/phpunit/WebTest/Contact/ContactReferenceFieldTest.php b/tests/phpunit/WebTest/Contact/ContactReferenceFieldTest.php index 5f0fdcb2fb..b9cfc73725 100644 --- a/tests/phpunit/WebTest/Contact/ContactReferenceFieldTest.php +++ b/tests/phpunit/WebTest/Contact/ContactReferenceFieldTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_ContactReferenceFieldTest extends CiviSeleniumTestCase { parent::setUp(); } - function testContactReferenceField() { + public function testContactReferenceField() { $this->webtestLogin(); /* add new group */ diff --git a/tests/phpunit/WebTest/Contact/ContactTagTest.php b/tests/phpunit/WebTest/Contact/ContactTagTest.php index 58a90e13d2..98f8a29bc9 100644 --- a/tests/phpunit/WebTest/Contact/ContactTagTest.php +++ b/tests/phpunit/WebTest/Contact/ContactTagTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_ContactTagTest extends CiviSeleniumTestCase { parent::setUp(); } - function testTagAContact() { + public function testTagAContact() { $this->webtestLogin(); $this->openCiviPage("admin/tag", "action=add&reset=1", "_qf_Tag_next"); @@ -76,7 +76,7 @@ class WebTest_Contact_ContactTagTest extends CiviSeleniumTestCase { $this->checkCRMStatus(); } - function testTagSetContact() { + public function testTagSetContact() { $this->webtestLogin(); $this->openCiviPage("admin/tag", "action=add&reset=1&tagset=1"); diff --git a/tests/phpunit/WebTest/Contact/CreateCmsUserFromContactTest.php b/tests/phpunit/WebTest/Contact/CreateCmsUserFromContactTest.php index 1c8fa4b2c8..a70c71c4e0 100644 --- a/tests/phpunit/WebTest/Contact/CreateCmsUserFromContactTest.php +++ b/tests/phpunit/WebTest/Contact/CreateCmsUserFromContactTest.php @@ -39,7 +39,7 @@ class WebTest_Contact_CreateCmsUserFromContactTest extends CiviSeleniumTestCase //Test that option to create a cms user is present on a contact who does not //have a cms account already( in this case, a new contact ) - function testCreateContactLinkPresent() { + public function testCreateContactLinkPresent() { //login $this->webtestLogin('admin'); @@ -58,7 +58,7 @@ class WebTest_Contact_CreateCmsUserFromContactTest extends CiviSeleniumTestCase //Test that the action link is missing for users who already have a contact //record. The contact record for drupal user 1 is used - function testCreateContactLinkMissing() { + public function testCreateContactLinkMissing() { //login $this->webtestLogin('admin'); @@ -79,7 +79,7 @@ class WebTest_Contact_CreateCmsUserFromContactTest extends CiviSeleniumTestCase } //Test the ajax "check username availibity" link when adding cms user - function testCheckUsernameAvailability() { + public function testCheckUsernameAvailability() { $this->webtestLogin('admin'); $email = $this->_createUserAndGotoForm(); @@ -102,7 +102,7 @@ class WebTest_Contact_CreateCmsUserFromContactTest extends CiviSeleniumTestCase } //Test form submission when the username is taken - function testTakenUsernameSubmission() { + public function testTakenUsernameSubmission() { //login $this->webtestLogin('admin'); @@ -126,7 +126,7 @@ class WebTest_Contact_CreateCmsUserFromContactTest extends CiviSeleniumTestCase } //Test form sumbission when user passwords dont match - function testMismatchPasswordSubmission() { + public function testMismatchPasswordSubmission() { //login $this->webtestLogin('admin'); @@ -149,7 +149,7 @@ class WebTest_Contact_CreateCmsUserFromContactTest extends CiviSeleniumTestCase $this->assertTrue($results['count'] == 0); } - function testMissingDataSubmission() { + public function testMissingDataSubmission() { //login $this->webtestLogin('admin'); @@ -178,7 +178,7 @@ class WebTest_Contact_CreateCmsUserFromContactTest extends CiviSeleniumTestCase } //Test a valid (username unique and passwords match) submission - function testValidSubmission() { + public function testValidSubmission() { //login $this->webtestLogin('admin'); @@ -208,7 +208,7 @@ class WebTest_Contact_CreateCmsUserFromContactTest extends CiviSeleniumTestCase * @param $password * @param $confirm_password */ - function _fillCMSUserForm($username, $password, $confirm_password) { + public function _fillCMSUserForm($username, $password, $confirm_password) { $this->type("cms_name", $username); $this->type("cms_pass", $password); $this->type("cms_confirm_pass", $confirm_password); @@ -217,7 +217,7 @@ class WebTest_Contact_CreateCmsUserFromContactTest extends CiviSeleniumTestCase /** * @return array */ - function _createUserAndGoToForm() { + public function _createUserAndGoToForm() { $firstName = substr(sha1(rand()), 0, 7) . "John"; $lastName = substr(sha1(rand()), 0, 7) . "Smith"; $email = $this->webtestAddContact($firstName, $lastName, TRUE); diff --git a/tests/phpunit/WebTest/Contact/CustomDataAddTest.php b/tests/phpunit/WebTest/Contact/CustomDataAddTest.php index 70a6fff076..119b1b8258 100644 --- a/tests/phpunit/WebTest/Contact/CustomDataAddTest.php +++ b/tests/phpunit/WebTest/Contact/CustomDataAddTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_CustomDataAddTest extends CiviSeleniumTestCase { parent::setUp(); } - function testCustomDataAdd() { + public function testCustomDataAdd() { $this->webtestLogin(); $this->openCiviPage('admin/custom/group', 'action=add&reset=1'); @@ -155,7 +155,7 @@ class WebTest_Contact_CustomDataAddTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); } - function testCustomDataMoneyAdd() { + public function testCustomDataMoneyAdd() { $this->webtestLogin(); $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -235,7 +235,7 @@ class WebTest_Contact_CustomDataAddTest extends CiviSeleniumTestCase { $this->verifyText("xpath=//div[@id='custom-set-content-{$customFieldsetId}']/div/div[2]/div[2]", '12,345,678.98'); } - function testCustomDataChangeLog(){ + public function testCustomDataChangeLog(){ $this->webtestLogin(); //enable logging diff --git a/tests/phpunit/WebTest/Contact/DeceasedContactsAdvancedSearchTest.php b/tests/phpunit/WebTest/Contact/DeceasedContactsAdvancedSearchTest.php index dd04b7e080..b638fd96e9 100644 --- a/tests/phpunit/WebTest/Contact/DeceasedContactsAdvancedSearchTest.php +++ b/tests/phpunit/WebTest/Contact/DeceasedContactsAdvancedSearchTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_DeceasedContactsAdvancedSearchTest extends CiviSeleniumTes parent::setUp(); } - function testDeceasedContactsAdvanceSearch() { + public function testDeceasedContactsAdvanceSearch() { $this->webtestLogin(); $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -96,7 +96,7 @@ class WebTest_Contact_DeceasedContactsAdvancedSearchTest extends CiviSeleniumTes * @param string $groupName * @param bool $deceased */ - function _testAddContact($firstName, $lastName, $email, $groupName, $deceased = FALSE) { + public function _testAddContact($firstName, $lastName, $email, $groupName, $deceased = FALSE) { $this->webtestAddContact($firstName, $lastName, $email); if ($deceased) { $this->click('link=Edit'); diff --git a/tests/phpunit/WebTest/Contact/DupeContactTest.php b/tests/phpunit/WebTest/Contact/DupeContactTest.php index 94d29c3e0f..22c4c259f8 100644 --- a/tests/phpunit/WebTest/Contact/DupeContactTest.php +++ b/tests/phpunit/WebTest/Contact/DupeContactTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_DupeContactTest extends CiviSeleniumTestCase { parent::setUp(); } - function testDuplicateContactAdd() { + public function testDuplicateContactAdd() { $this->webtestLogin(); $this->openCiviPage('contact/add', 'reset=1&ct=Individual'); diff --git a/tests/phpunit/WebTest/Contact/EditContactTest.php b/tests/phpunit/WebTest/Contact/EditContactTest.php index 66940d07af..f4d9453cb8 100644 --- a/tests/phpunit/WebTest/Contact/EditContactTest.php +++ b/tests/phpunit/WebTest/Contact/EditContactTest.php @@ -34,7 +34,7 @@ class WebTest_Contact_EditContactTest extends CiviSeleniumTestCase { parent::setUp(); } - function testEditContact() { + public function testEditContact() { // Log in using webtestLogin() method $this->webtestLogin(); diff --git a/tests/phpunit/WebTest/Contact/GroupAddTest.php b/tests/phpunit/WebTest/Contact/GroupAddTest.php index c6fbccdd76..5ed83771bf 100644 --- a/tests/phpunit/WebTest/Contact/GroupAddTest.php +++ b/tests/phpunit/WebTest/Contact/GroupAddTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase { parent::setUp(); } - function testGroupAdd() { + public function testGroupAdd() { $this->webtestLogin(); $this->openCiviPage('group/add', 'reset=1', '_qf_Edit_upload-bottom'); @@ -104,7 +104,7 @@ class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase { $this->assertElementContainsText("css=div.crm-summary-display_name", $displayName); } - function testGroupReserved() { + public function testGroupReserved() { $this->webtestLogin('admin'); $this->openCiviPage('group/add', 'reset=1', '_qf_Edit_upload-bottom'); @@ -186,7 +186,7 @@ class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase { * * @return string */ - function _testCreateUser($roleid) { + public function _testCreateUser($roleid) { $this->open($this->sboxPath . "admin/people/create"); $this->waitForElementPresent("edit-submit"); @@ -222,7 +222,7 @@ class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase { /** * @param $role */ - function _roleDelete($role) { + public function _roleDelete($role) { $this->waitForElementPresent("xpath=//table[@id='user-roles']/tbody//tr/td[text()='{$role}']/..//td/a[text()='edit role']"); $this->click("xpath=//table[@id='user-roles']/tbody//tr/td[text()='{$role}']/..//td/a[text()='edit role']"); $this->waitForElementPresent('edit-delete'); @@ -235,7 +235,7 @@ class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase { /** * Webtest for add contact to group (CRM-15108) */ - function testAddContactToGroup() { + public function testAddContactToGroup() { $this->webtestLogin(); $this->openCiviPage("contact/add", "reset=1&ct=Individual"); $this->waitForElementPresent('_qf_Contact_upload_view-bottom'); diff --git a/tests/phpunit/WebTest/Contact/InlineFieldsEditTest.php b/tests/phpunit/WebTest/Contact/InlineFieldsEditTest.php index 67406b3231..93f27d360c 100644 --- a/tests/phpunit/WebTest/Contact/InlineFieldsEditTest.php +++ b/tests/phpunit/WebTest/Contact/InlineFieldsEditTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_InlineFieldsEditTest extends CiviSeleniumTestCase { parent::setUp(); } - function testAddAndEditField() { + public function testAddAndEditField() { $this->webtestLogin(); // Add a contact diff --git a/tests/phpunit/WebTest/Contact/MergeContactsTest.php b/tests/phpunit/WebTest/Contact/MergeContactsTest.php index 60f4f13498..6e398cda50 100644 --- a/tests/phpunit/WebTest/Contact/MergeContactsTest.php +++ b/tests/phpunit/WebTest/Contact/MergeContactsTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { parent::setUp(); } - function testIndividualAdd() { + public function testIndividualAdd() { $this->webtestLogin(); $this->openCiviPage("contact/add", "reset=1&ct=Individual"); @@ -199,7 +199,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->assertChecked("check_3"); } - function testMergeContactSubType() { + public function testMergeContactSubType() { $this->webtestLogin(); $this->openCiviPage("contact/add", "reset=1&ct=Individual"); $this->waitForElementPresent('_qf_Contact_cancel-bottom'); @@ -255,7 +255,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { * @param string $lastName * @param $subject */ - function addActivity($firstName, $lastName, $subject) { + public function addActivity($firstName, $lastName, $subject) { $withContact = substr(sha1(rand()), 0, 7); $this->webtestAddContact($withContact, "Anderson", $withContact . "@anderson.name"); @@ -315,7 +315,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->waitForText('crm-notification-container', "Activity '$subject' has been saved.", "Status message didn't show up after saving!"); } - function testMergeTest() { + public function testMergeTest() { $this->webtestLogin(); $this->openCiviPage("contact/add", "reset=1&ct=Individual"); @@ -499,7 +499,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->assertTrue($this->isElementPresent("xpath=//div[@id='phone-block']/div/div/div[3]/div[2][contains(text(), '9876543210')]")); } - function testBatchMerge(){ + public function testBatchMerge(){ $this->webtestLogin(); // add contact1 and its duplicate @@ -639,7 +639,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { /** * Helper FN */ - function _createContacts($firstName = NULL, $lastName = NULL, $organizationName = NULL, $contactType = 'Individual') { + public function _createContacts($firstName = NULL, $lastName = NULL, $organizationName = NULL, $contactType = 'Individual') { if ($contactType == 'Individual') { // add contact $this->openCiviPage("contact/add", "reset=1&ct=Individual"); @@ -730,7 +730,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { * Helper FN * to create new membership type */ - function addMembershipType($membershipOrganization) { + public function addMembershipType($membershipOrganization) { $this->openCiviPage("admin/member/membershipType", "reset=1&action=browse"); $this->click("link=Add Membership Type"); $this->waitForElementPresent('_qf_MembershipType_cancel-bottom'); @@ -761,7 +761,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { /** * Test for CRM-12695 fix */ - function testMergeOrganizations() { + public function testMergeOrganizations() { $this->webtestLogin(); // build organisation name @@ -921,7 +921,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { /** * Test for CRM-15658 fix */ - function testMergeEmailAndAddress() { + public function testMergeEmailAndAddress() { $this->webtestLogin(); $this->openCiviPage("contact/add", "reset=1&ct=Individual"); $firstName = substr(sha1(rand()), 0, 7); diff --git a/tests/phpunit/WebTest/Contact/MultipleContactSubTypes.php b/tests/phpunit/WebTest/Contact/MultipleContactSubTypes.php index e36d9021d6..e98ade7c8b 100644 --- a/tests/phpunit/WebTest/Contact/MultipleContactSubTypes.php +++ b/tests/phpunit/WebTest/Contact/MultipleContactSubTypes.php @@ -35,7 +35,7 @@ class WebTest_Contact_MultipleContactSubTypes extends CiviSeleniumTestCase { parent::setUp(); } - function testIndividualAdd() { + public function testIndividualAdd() { $this->webtestLogin(); $selection1 = 'Student'; @@ -216,7 +216,7 @@ class WebTest_Contact_MultipleContactSubTypes extends CiviSeleniumTestCase { /** * Add custom fields for a contact sub-type */ - function _addCustomData($contactSubType) { + public function _addCustomData($contactSubType) { $this->openCiviPage("admin/custom/group", "action=add&reset=1"); //fill custom group title diff --git a/tests/phpunit/WebTest/Contact/PrevNextTest.php b/tests/phpunit/WebTest/Contact/PrevNextTest.php index dbb888c76e..6bc85a0a95 100644 --- a/tests/phpunit/WebTest/Contact/PrevNextTest.php +++ b/tests/phpunit/WebTest/Contact/PrevNextTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_PrevNextTest extends CiviSeleniumTestCase { parent::setUp(); } - function testPrevNext() { + public function testPrevNext() { $this->webtestLogin(); /* add new group */ diff --git a/tests/phpunit/WebTest/Contact/PrivacyOptionSearchTest.php b/tests/phpunit/WebTest/Contact/PrivacyOptionSearchTest.php index 8a33f9a129..678f3d5383 100644 --- a/tests/phpunit/WebTest/Contact/PrivacyOptionSearchTest.php +++ b/tests/phpunit/WebTest/Contact/PrivacyOptionSearchTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_PrivacyOptionSearchTest extends CiviSeleniumTestCase { parent::setUp(); } - function testPrivacyOptionSearch() { + public function testPrivacyOptionSearch() { $this->webtestLogin(); $this->waitForPageToLoad($this->getTimeoutMsec()); diff --git a/tests/phpunit/WebTest/Contact/ProfileChecksumTest.php b/tests/phpunit/WebTest/Contact/ProfileChecksumTest.php index af8d044f3b..f077585d71 100644 --- a/tests/phpunit/WebTest/Contact/ProfileChecksumTest.php +++ b/tests/phpunit/WebTest/Contact/ProfileChecksumTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_ProfileChecksumTest extends CiviSeleniumTestCase { parent::setUp(); } - function testProfileChecksum() { + public function testProfileChecksum() { $this->webtestLogin('admin'); // Profile fields. @@ -148,7 +148,7 @@ class WebTest_Contact_ProfileChecksumTest extends CiviSeleniumTestCase { * * @return null */ - function _testCreateContactProfile($fields, $profileName) { + public function _testCreateContactProfile($fields, $profileName) { // Add new profile. $this->openCiviPage("admin/uf/group", "reset=1"); $this->click('newCiviCRMProfile-top'); diff --git a/tests/phpunit/WebTest/Contact/RelationshipAddTest.php b/tests/phpunit/WebTest/Contact/RelationshipAddTest.php index 98d9057d69..d669c3285b 100644 --- a/tests/phpunit/WebTest/Contact/RelationshipAddTest.php +++ b/tests/phpunit/WebTest/Contact/RelationshipAddTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { parent::setUp(); } - function testRelationshipAddTest() { + public function testRelationshipAddTest() { $this->webtestLogin(); //create a relationship type between different contact types @@ -280,7 +280,7 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { $this->assertTrue($this->isTextPresent($params['label_b_a'])); } - function testRelationshipAddNewIndividualTest() { + public function testRelationshipAddNewIndividualTest() { $this->webtestLogin(); //create a relationship type between different contact types @@ -352,7 +352,7 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { $this->assertTrue($this->isTextPresent($params['label_a_b'])); } - function testAjaxCustomGroupLoad() { + public function testAjaxCustomGroupLoad() { $this->webtestLogin(); //create a New Individual @@ -370,7 +370,7 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { $this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl); } - function testRelationshipAddCurrentEmployerTest() { + public function testRelationshipAddCurrentEmployerTest() { $this->webtestLogin(); //create a New Individual diff --git a/tests/phpunit/WebTest/Contact/SearchBuilderTest.php b/tests/phpunit/WebTest/Contact/SearchBuilderTest.php index 927987889f..b9f7c237fb 100644 --- a/tests/phpunit/WebTest/Contact/SearchBuilderTest.php +++ b/tests/phpunit/WebTest/Contact/SearchBuilderTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { parent::setUp(); } - function testSearchBuilderOptions() { + public function testSearchBuilderOptions() { $this->webtestLogin(); $groupName = $this->WebtestAddGroup(); @@ -57,7 +57,7 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { } } - function testSearchBuilderRLIKE() { + public function testSearchBuilderRLIKE() { $this->webtestLogin(); // Adding contact @@ -75,7 +75,7 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { /** * @param null $firstName */ - function createDetailContact($firstName = NULL) { + public function createDetailContact($firstName = NULL) { if (!$firstName) { $firstName = substr(sha1(rand()), 0, 7); @@ -112,7 +112,7 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { $this->assertTrue($this->isTextPresent("$firstName adv$firstName")); } - function testSearchBuilderContacts() { + public function testSearchBuilderContacts() { $this->webtestLogin(); //Individual @@ -219,7 +219,7 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { * @param string $op * @param null $count */ - function _searchBuilder($field, $fieldValue = NULL, $name = NULL, $op = '=', $count = NULL) { + public function _searchBuilder($field, $fieldValue = NULL, $name = NULL, $op = '=', $count = NULL) { // search builder using contacts(not using contactType) $this->openCiviPage("contact/search/builder", "reset=1"); $this->enterValues(1, 1, 'Contacts', $field, NULL, $op, "$fieldValue"); @@ -239,7 +239,7 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { /** * Enter form values in a Search Builder row */ - function enterValues($set, $row, $entity, $field, $loc, $op, $value = '') { + public function enterValues($set, $row, $entity, $field, $loc, $op, $value = '') { if ($set > 1 && $row == 1) { $this->click('addBlock'); } @@ -285,7 +285,7 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { * @param null $count * @param $field */ - function _advancedSearch($fieldValue = NULL, $name = NULL, $contactType = NULL, $count = NULL, $field) { + public function _advancedSearch($fieldValue = NULL, $name = NULL, $contactType = NULL, $count = NULL, $field) { //advanced search by selecting the contactType $this->openCiviPage("contact/search/advanced", "reset=1"); if (isset($contactType)) { @@ -337,7 +337,7 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { * @param null $streetName * @param null $postalCode */ - function _createContact($contactType, $name, $email, $streetName = NULL, $postalCode = NULL) { + public function _createContact($contactType, $name, $email, $streetName = NULL, $postalCode = NULL) { $this->openCiviPage('contact/add', array('reset' => 1, 'ct' => $contactType), '_qf_Contact_cancel'); if ($contactType == 'Individual') { @@ -375,7 +375,7 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { * Webtest for CRM-12148 * */ - function testSearchBuilderfinancialType() { + public function testSearchBuilderfinancialType() { $this->webtestLogin(); // add financial type @@ -431,7 +431,7 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { * Webtest for CRM-12588 * */ - function testSearchBuilderMembershipType() { + public function testSearchBuilderMembershipType() { $this->webtestLogin(); // create first contact diff --git a/tests/phpunit/WebTest/Contact/SearchTest.php b/tests/phpunit/WebTest/Contact/SearchTest.php index d5b95a44ba..d5db1f9ab0 100644 --- a/tests/phpunit/WebTest/Contact/SearchTest.php +++ b/tests/phpunit/WebTest/Contact/SearchTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_SearchTest extends CiviSeleniumTestCase { parent::setUp(); } - function testQuickSearch() { + public function testQuickSearch() { $this->webtestLogin(); // Adding contact @@ -64,7 +64,7 @@ class WebTest_Contact_SearchTest extends CiviSeleniumTestCase { $this->assertTrue($this->isTextPresent("$displayName"), "Contact did not find!"); } - function testQuickSearchPartial() { + public function testQuickSearchPartial() { $this->webtestLogin(); // Adding contact @@ -90,7 +90,7 @@ class WebTest_Contact_SearchTest extends CiviSeleniumTestCase { $this->assertElementContainsText('css=.crm-search-results > table.row-highlight', $sortName); } - function testContactSearch() { + public function testContactSearch() { $this->webtestLogin(); // Create new tag. @@ -156,7 +156,7 @@ class WebTest_Contact_SearchTest extends CiviSeleniumTestCase { * * @static */ - static function addTag($tagName = 'New Tag', $self) { + public static function addTag($tagName = 'New Tag', $self) { $self->openCiviPage('admin/tag', array('reset' => 1, 'action' => 'add'), '_qf_Tag_next'); // fill tag name @@ -180,7 +180,7 @@ class WebTest_Contact_SearchTest extends CiviSeleniumTestCase { } // CRM-6586 - function testContactSearchExport() { + public function testContactSearchExport() { $this->webtestLogin(); // Create new group diff --git a/tests/phpunit/WebTest/Contact/SearchbyDateFilterTest.php b/tests/phpunit/WebTest/Contact/SearchbyDateFilterTest.php index cb8870222d..03a1fbc3bc 100644 --- a/tests/phpunit/WebTest/Contact/SearchbyDateFilterTest.php +++ b/tests/phpunit/WebTest/Contact/SearchbyDateFilterTest.php @@ -38,7 +38,7 @@ class WebTest_Contact_SearchbyDateFilterTest extends CiviSeleniumTestCase { /* * test individual pane seperatly. */ - function testAdvancedSearch() { + public function testAdvancedSearch() { $this->webtestLogin(); // Get all default advance search panes. @@ -61,7 +61,7 @@ class WebTest_Contact_SearchbyDateFilterTest extends CiviSeleniumTestCase { } - function testIndividualSearchPage(){ + public function testIndividualSearchPage(){ $this->webtestLogin(); $this->openCiviPage("contribute/search", "reset=1"); @@ -230,7 +230,7 @@ class WebTest_Contact_SearchbyDateFilterTest extends CiviSeleniumTestCase { * * @return array */ - function _advanceSearchPanesDateFilter($paneRef = NULL) { + public function _advanceSearchPanesDateFilter($paneRef = NULL) { static $_advance_search_panes; if (!isset($_advance_search_panes) || empty($_advance_search_panes)) { diff --git a/tests/phpunit/WebTest/Contact/SignatureTest.php b/tests/phpunit/WebTest/Contact/SignatureTest.php index cff270306d..9b3d9e3b8b 100644 --- a/tests/phpunit/WebTest/Contact/SignatureTest.php +++ b/tests/phpunit/WebTest/Contact/SignatureTest.php @@ -38,7 +38,7 @@ class WebTest_Contact_SignatureTest extends CiviSeleniumTestCase { /** * Test Signature in TinyMC. */ - function testTinyMCE() { + public function testTinyMCE() { $this->webtestLogin(); $this->openCiviPage('dashboard', 'reset=1', 'crm-recently-viewed'); @@ -93,7 +93,7 @@ class WebTest_Contact_SignatureTest extends CiviSeleniumTestCase { /** * Test Signature in CKEditor. */ - function testCKEditor() { + public function testCKEditor() { $this->webtestLogin(); $this->openCiviPage('dashboard', 'reset=1', 'crm-recently-viewed'); @@ -144,7 +144,7 @@ class WebTest_Contact_SignatureTest extends CiviSeleniumTestCase { /** * Helper function to select Editor. */ - function _selectEditor($editor) { + public function _selectEditor($editor) { $this->openCiviPage('admin/setting/preferences/display', 'reset=1'); // Change editor if not already selected @@ -159,7 +159,7 @@ class WebTest_Contact_SignatureTest extends CiviSeleniumTestCase { /** * Helper function for Check Signature in Editor. */ - function _checkSignature($fieldName, $signature, $editor) { + public function _checkSignature($fieldName, $signature, $editor) { if ($editor == 'CKEditor') { $this->waitForElementPresent("xpath=//div[@id='cke_{$fieldName}']//iframe"); $this->selectFrame("xpath=//div[@id='cke_{$fieldName}']//iframe"); @@ -175,7 +175,7 @@ class WebTest_Contact_SignatureTest extends CiviSeleniumTestCase { /** * Helper function for Check Signature in Activity. */ - function _checkActivity($subject, $signature) { + public function _checkActivity($subject, $signature) { $this->openCiviPage('activity/search', 'reset=1', '_qf_Search_refresh'); $this->type('activity_subject', $subject); diff --git a/tests/phpunit/WebTest/Contact/TagAddTest.php b/tests/phpunit/WebTest/Contact/TagAddTest.php index 32002ed874..776d5390a0 100644 --- a/tests/phpunit/WebTest/Contact/TagAddTest.php +++ b/tests/phpunit/WebTest/Contact/TagAddTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_TagAddTest extends CiviSeleniumTestCase { parent::setUp(); } - function testAddTag() { + public function testAddTag() { $this->webtestLogin(); $this->openCiviPage("admin/tag", "action=add&reset=1", "_qf_Tag_next"); @@ -73,7 +73,7 @@ class WebTest_Contact_TagAddTest extends CiviSeleniumTestCase { $this->waitForElementPresent("xpath=//table//tbody/tr/td[1][text()= '$tagName']/following-sibling::td[7]/span/a[text()= 'Edit']"); } - function testAddTagSet() { + public function testAddTagSet() { $this->webtestLogin(); $this->openCiviPage("admin/tag", "action=add&reset=1&tagset=1"); diff --git a/tests/phpunit/WebTest/Contact/TagSetSearchTest.php b/tests/phpunit/WebTest/Contact/TagSetSearchTest.php index a5edc0ee9c..5e7d2e39e7 100644 --- a/tests/phpunit/WebTest/Contact/TagSetSearchTest.php +++ b/tests/phpunit/WebTest/Contact/TagSetSearchTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_TagSetSearchTest extends CiviSeleniumTestCase { parent::setUp(); } - function testTagSetSearch() { + public function testTagSetSearch() { $this->webtestLogin(); $tagSet1 = $this->_testAddTagSet(); @@ -117,7 +117,7 @@ class WebTest_Contact_TagSetSearchTest extends CiviSeleniumTestCase { /** * @return array */ - function _testAddTagSet() { + public function _testAddTagSet() { // Go to add tag set url. $this->openCiviPage('admin/tag', 'action=add&reset=1&tagset=1'); diff --git a/tests/phpunit/WebTest/Contact/TaskActionAddToGroupTest.php b/tests/phpunit/WebTest/Contact/TaskActionAddToGroupTest.php index 81b51be74a..44e4fe48ff 100644 --- a/tests/phpunit/WebTest/Contact/TaskActionAddToGroupTest.php +++ b/tests/phpunit/WebTest/Contact/TaskActionAddToGroupTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_TaskActionAddToGroupTest extends CiviSeleniumTestCase { parent::setUp(); } - function testAddContactsToGroup() { + public function testAddContactsToGroup() { $this->webtestLogin(); $newGroupName = 'Group_' . substr(sha1(rand()), 0, 7); @@ -104,7 +104,7 @@ class WebTest_Contact_TaskActionAddToGroupTest extends CiviSeleniumTestCase { } - function testMultiplePageContactSearchAddContactsToGroup() { + public function testMultiplePageContactSearchAddContactsToGroup() { $this->webtestLogin(); $newGroupName = 'Group_' . substr(sha1(rand()), 0, 7); $this->WebtestAddGroup($newGroupName); diff --git a/tests/phpunit/WebTest/Contact/TaskActionSendMassMailing.php b/tests/phpunit/WebTest/Contact/TaskActionSendMassMailing.php index 94e8d98817..7de1dc1903 100644 --- a/tests/phpunit/WebTest/Contact/TaskActionSendMassMailing.php +++ b/tests/phpunit/WebTest/Contact/TaskActionSendMassMailing.php @@ -35,7 +35,7 @@ class WebTest_Contact_TaskActionSendMassMailing extends CiviSeleniumTestCase { parent::setUp(); } - function testSelectedContacts() { + public function testSelectedContacts() { $this->webtestLogin(); // make group diff --git a/tests/phpunit/WebTest/Contact/TaskActionSendSMS.php b/tests/phpunit/WebTest/Contact/TaskActionSendSMS.php index 297dd16158..a62ac1ae03 100644 --- a/tests/phpunit/WebTest/Contact/TaskActionSendSMS.php +++ b/tests/phpunit/WebTest/Contact/TaskActionSendSMS.php @@ -35,7 +35,7 @@ class WebTest_Contact_TaskActionSendSMS extends CiviSeleniumTestCase { parent::setUp(); } - function testSMSToContacts() { + public function testSMSToContacts() { $this->webtestLogin(); // ADD a New Group diff --git a/tests/phpunit/WebTest/Contact/UpdateProfileTest.php b/tests/phpunit/WebTest/Contact/UpdateProfileTest.php index 88f86eb5fa..7aed12092f 100644 --- a/tests/phpunit/WebTest/Contact/UpdateProfileTest.php +++ b/tests/phpunit/WebTest/Contact/UpdateProfileTest.php @@ -35,7 +35,7 @@ class WebTest_Contact_UpdateProfileTest extends CiviSeleniumTestCase { parent::setUp(); } - function testUpdateProfile() { + public function testUpdateProfile() { // Create new via profile include_once ('WebTest/Contact/AddViaProfileTest.php'); WebTest_Contact_AddViaProfileTest::testAddViaCreateProfile(); diff --git a/tests/phpunit/WebTest/Contribute/AddBatchesTest.php b/tests/phpunit/WebTest/Contribute/AddBatchesTest.php index ef5f237e6a..46069009df 100644 --- a/tests/phpunit/WebTest/Contribute/AddBatchesTest.php +++ b/tests/phpunit/WebTest/Contribute/AddBatchesTest.php @@ -35,7 +35,7 @@ class WebTest_Contribute_AddBatchesTest extends CiviSeleniumTestCase { parent::setUp(); } - function testBatchAddContribution() { + public function testBatchAddContribution() { $this->webtestLogin(); $itemCount = 5; // create contact @@ -73,7 +73,7 @@ class WebTest_Contribute_AddBatchesTest extends CiviSeleniumTestCase { $this->_verifyData($data, "Contribution"); } - function testBatchAddMembership() { + public function testBatchAddMembership() { $this->webtestLogin(); $itemCount = 5; $softCreditTypes = CRM_Core_OptionGroup::values("soft_credit_type", FALSE); @@ -117,7 +117,7 @@ class WebTest_Contribute_AddBatchesTest extends CiviSeleniumTestCase { } - function testBatchAddPledge() { + public function testBatchAddPledge() { $this->webtestLogin(); // create a new pledge for contact @@ -174,7 +174,7 @@ class WebTest_Contribute_AddBatchesTest extends CiviSeleniumTestCase { * @param $row * @param $type */ - function _fillData($data, $row, $type) { + public function _fillData($data, $row, $type) { if (!empty($data['contact'])) { $this->select2("s2id_primary_contact_id_{$row}", $data['contact']['email']); } @@ -264,7 +264,7 @@ class WebTest_Contribute_AddBatchesTest extends CiviSeleniumTestCase { * @param $data * @param $type */ - function _checkResult($data, $type) { + public function _checkResult($data, $type) { if ($type == "Contribution") { $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low"); $this->type("sort_name", "{$data['last_name']} {$data['first_name']}"); @@ -329,7 +329,7 @@ class WebTest_Contribute_AddBatchesTest extends CiviSeleniumTestCase { * @param $data * @param $type */ - function _verifyData($data, $type) { + public function _verifyData($data, $type) { $this->waitForElementPresent("xpath=//table[@id='DataTables_Table_0']/tbody//tr/td[7]/span/a[1][text()='Enter records']"); $this->click("xpath=//table[@id='DataTables_Table_0']/tbody//tr/td[7]/span/a[1][text()='Enter records']"); $this->waitForElementPresent('_qf_Entry_upload'); diff --git a/tests/phpunit/WebTest/Contribute/AddPricesetTest.php b/tests/phpunit/WebTest/Contribute/AddPricesetTest.php index 5004f2938b..5e94d82277 100644 --- a/tests/phpunit/WebTest/Contribute/AddPricesetTest.php +++ b/tests/phpunit/WebTest/Contribute/AddPricesetTest.php @@ -35,7 +35,7 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase { parent::setUp(); } - function testAddPriceSet() { + public function testAddPriceSet() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -74,7 +74,7 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase { * @param $setHelp * @param null $financialType */ - function _testAddSet($setTitle, $usedFor, $setHelp, $financialType = NULL) { + public function _testAddSet($setTitle, $usedFor, $setHelp, $financialType = NULL) { $this->openCiviPage("admin/price", "reset=1&action=add", '_qf_Set_next-bottom'); // Enter Priceset fields (Title, Used For ...) @@ -101,7 +101,7 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase { * @param $financialType * @param bool $dateSpecificFields */ - function _testAddPriceFields(&$fields, &$validateString, $financialType, $dateSpecificFields = FALSE) { + public function _testAddPriceFields(&$fields, &$validateString, $financialType, $dateSpecificFields = FALSE) { $validateStrings[] = $financialType; $sid = $this->urlArg('sid'); $this->openCiviPage('admin/price/field', "reset=1&action=add&sid=$sid", 'label'); @@ -187,7 +187,7 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase { /** * @return string */ - function _testAddFinancialType() { + public function _testAddFinancialType() { //Add new Financial Type $financialType['name'] = 'FinancialType ' . substr(sha1(rand()), 0, 4); $financialType['is_deductible'] = TRUE; @@ -200,7 +200,7 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase { * @param $validateStrings * @param int $sid */ - function _testVerifyPriceSet($validateStrings, $sid) { + public function _testVerifyPriceSet($validateStrings, $sid) { // verify Price Set at Preview page // start at Manage Price Sets listing $this->openCiviPage("admin/price", "reset=1"); @@ -211,7 +211,7 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase { $this->assertStringsPresent($validateStrings); } - function testContributeOfflineWithPriceSet() { + public function testContributeOfflineWithPriceSet() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -312,7 +312,7 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase { } } - function testContributeOnlineWithPriceSet() { + public function testContributeOnlineWithPriceSet() { $this->webtestLogin(); //add financial type of account type expense @@ -434,7 +434,7 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase { } - function testContributeWithDateSpecificPriceSet() { + public function testContributeWithDateSpecificPriceSet() { $this->webtestLogin(); //add financial type of account type expense @@ -549,7 +549,7 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase { $this->webtestVerifyTabularData($expected); } - function testContributeOfflineforSoftcreditwithApi() { + public function testContributeOfflineforSoftcreditwithApi() { // Log in using webtestLogin() method $this->webtestLogin(); diff --git a/tests/phpunit/WebTest/Contribute/ConfirmOptionalTest.php b/tests/phpunit/WebTest/Contribute/ConfirmOptionalTest.php index ed1f7b4784..f409e22d95 100644 --- a/tests/phpunit/WebTest/Contribute/ConfirmOptionalTest.php +++ b/tests/phpunit/WebTest/Contribute/ConfirmOptionalTest.php @@ -36,7 +36,7 @@ class WebTest_Contribute_ConfirmOptionalTest extends CiviSeleniumTestCase { parent::setUp(); } - function testWithConfirm() { + public function testWithConfirm() { $this->_addContributionPage(TRUE); $this->_fillOutContributionPage(); @@ -51,7 +51,7 @@ class WebTest_Contribute_ConfirmOptionalTest extends CiviSeleniumTestCase { $this->assertTrue($this->isTextPresent("Your transaction has been processed successfully"), "Should load thank you page"); } - function testWithoutConfirm() { + public function testWithoutConfirm() { $this->_addContributionPage(FALSE); $this->_fillOutContributionPage(); diff --git a/tests/phpunit/WebTest/Contribute/ContactContextAddTest.php b/tests/phpunit/WebTest/Contribute/ContactContextAddTest.php index 3e310cf0bf..a306bc83db 100644 --- a/tests/phpunit/WebTest/Contribute/ContactContextAddTest.php +++ b/tests/phpunit/WebTest/Contribute/ContactContextAddTest.php @@ -35,7 +35,7 @@ class WebTest_Contribute_ContactContextAddTest extends CiviSeleniumTestCase { parent::setUp(); } - function testContactContextAdd() { + public function testContactContextAdd() { // Log in using webtestLogin() method $this->webtestLogin(); diff --git a/tests/phpunit/WebTest/Contribute/ContributionPageAddTest.php b/tests/phpunit/WebTest/Contribute/ContributionPageAddTest.php index df20d2209e..51ce58a747 100644 --- a/tests/phpunit/WebTest/Contribute/ContributionPageAddTest.php +++ b/tests/phpunit/WebTest/Contribute/ContributionPageAddTest.php @@ -30,7 +30,7 @@ require_once 'CiviTest/CiviSeleniumTestCase.php'; * Class WebTest_Contribute_ContributionPageAddTest */ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase { - function testContributionPageAdd() { + public function testContributionPageAdd() { // open browser, login $this->webtestLogin(); @@ -86,7 +86,7 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase { } // CRM-12510 Test copy contribution page - function testContributionPageCopy() { + public function testContributionPageCopy() { // open browser, login $this->webtestLogin(); @@ -144,7 +144,7 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase { /** * Check CRM-7943 */ - function testContributionPageSeparatePayment() { + public function testContributionPageSeparatePayment() { // open browser, login $this->webtestLogin(); @@ -190,7 +190,7 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase { /** * Check CRM-7949 */ - function testContributionPageSeparatePaymentPayLater() { + public function testContributionPageSeparatePaymentPayLater() { // open browser, login $this->webtestLogin(); @@ -287,7 +287,7 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase { /** * CRM-12994 */ - function testContributionPageAddPremiumRequiredField() { + public function testContributionPageAddPremiumRequiredField() { // open browser, login $this->webtestLogin(); diff --git a/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php b/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php index 96cce68d5a..68354ecd6a 100644 --- a/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php @@ -36,7 +36,7 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { parent::setUp(); } - function testStandaloneContributeAdd() { + public function testStandaloneContributeAdd() { $this->webtestLogin(); // Create a contact to be used as soft creditor @@ -206,7 +206,7 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { } } - function testDeductibleAmount() { + public function testDeductibleAmount() { $this->webtestLogin(); //add authorize .net payment processor @@ -317,7 +317,7 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { * @param string $lastName * @param $processorName */ - function _doOfflineContribution($params, $firstName, $lastName, $processorName) { + public function _doOfflineContribution($params, $firstName, $lastName, $processorName) { $this->waitForElementPresent("css=li#tab_contribute a"); $this->click("css=li#tab_contribute a"); @@ -370,7 +370,7 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { /** * @param $verifyData */ - function _verifyAmounts($verifyData) { + public function _verifyAmounts($verifyData) { // since we are doing test contributions we need to search for test contribution and select first contribution // record for the contact $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low"); @@ -400,7 +400,7 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { 'crm-contact-actions-link', FALSE); } - function testOnlineContributionWithZeroAmount() { + public function testOnlineContributionWithZeroAmount() { $this->webtestLogin(); // Create a contact to be used as soft creditor diff --git a/tests/phpunit/WebTest/Contribute/OfflineRecurContributionTest.php b/tests/phpunit/WebTest/Contribute/OfflineRecurContributionTest.php index 61e8ffabcc..467371eb65 100644 --- a/tests/phpunit/WebTest/Contribute/OfflineRecurContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OfflineRecurContributionTest.php @@ -35,7 +35,7 @@ class WebTest_Contribute_OfflineRecurContributionTest extends CiviSeleniumTestCa parent::setUp(); } - function testOfflineRecurContribution() { + public function testOfflineRecurContribution() { $this->webtestLogin(); // We need a payment processor diff --git a/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php b/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php index b075524c38..84b78ae6c3 100644 --- a/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php +++ b/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php @@ -35,7 +35,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { parent::setUp(); } - function testOnBehalfOfOrganization() { + public function testOnBehalfOfOrganization() { $this->webtestLogin(); // create new individual @@ -111,7 +111,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { $this->_testUserWithMoreThanOneRelationship($pageId, $cid, $pageTitle); } - function testOnBehalfOfOrganizationWithMembershipData() { + public function testOnBehalfOfOrganizationWithMembershipData() { $this->webtestLogin(); // create new individual @@ -442,7 +442,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { $this->webtestLogout(); } - function testOnBehalfOfOrganizationWithOrgData() { + public function testOnBehalfOfOrganizationWithOrgData() { $this->webtestLogin(); $this->openCiviPage("profile/edit", "reset=1&gid=4"); @@ -560,7 +560,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { $this->_testOrganization($pageId, $cid, $pageTitle); } - function testWithContactSubtypeDupe() { + public function testWithContactSubtypeDupe() { $this->webtestLogin(); //create organisation @@ -651,7 +651,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { * @param int $cid * @param $pageTitle */ - function _testOrganization($pageId, $cid, $pageTitle) { + public function _testOrganization($pageId, $cid, $pageTitle) { //Open Live Contribution Page $this->openCiviPage("contribute/transact", "reset=1&id=$pageId", "_qf_Main_upload-bottom"); @@ -682,7 +682,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { * @param int $cid * @param $pageTitle */ - function _testAnomoyousOganization($pageId, $cid, $pageTitle) { + public function _testAnomoyousOganization($pageId, $cid, $pageTitle) { //Open Live Contribution Page $this->openCiviPage("contribute/transact", "reset=1&id=$pageId", "_qf_Main_upload-bottom"); @@ -757,7 +757,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { * @param int $cid * @param $pageTitle */ - function _testUserWithOneRelationship($pageId, $cid, $pageTitle) { + public function _testUserWithOneRelationship($pageId, $cid, $pageTitle) { $this->webtestLogin('admin'); // Create new group @@ -1003,7 +1003,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { * @param int $cid * @param $pageTitle */ - function _testUserWithMoreThanOneRelationship($pageId, $cid, $pageTitle) { + public function _testUserWithMoreThanOneRelationship($pageId, $cid, $pageTitle) { $this->webtestLogin('admin'); $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -1378,7 +1378,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { ); } - function testOnBehalfOfOrganizationWithImage() { + public function testOnBehalfOfOrganizationWithImage() { $this->webtestLogin(); $this->openCiviPage("profile/edit", "reset=1&gid=4"); @@ -1479,7 +1479,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { * @param int $cid * @param $pageTitle */ - function _testOrganizationWithImageUpload($pageId, $cid, $pageTitle) { + public function _testOrganizationWithImageUpload($pageId, $cid, $pageTitle) { //Open Live Contribution Page $this->openCiviPage("contribute/transact", "reset=1&id=$pageId", '_qf_Main_upload-bottom'); diff --git a/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php b/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php index ac1d8b9c4a..6c1ea7ae0d 100644 --- a/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php @@ -35,7 +35,7 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase { parent::setUp(); } - function testOnlineContributionAdd() { + public function testOnlineContributionAdd() { $this->webtestLogin(); // Use default payment processor @@ -178,7 +178,7 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase { } - function testOnlineContributionWithZeroAmount () { + public function testOnlineContributionWithZeroAmount () { $this->webtestLogin(); // Use default payment processor @@ -255,7 +255,7 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase { * @param int $pageId * @param bool $priceSet */ - function _doContributionAndVerifyData($pageId, $priceSet = FALSE) { + public function _doContributionAndVerifyData($pageId, $priceSet = FALSE) { //logout $this->webtestLogout(); $amountLabel = 'Total Amount'; diff --git a/tests/phpunit/WebTest/Contribute/OnlineMultiplePaymentProcessorTest.php b/tests/phpunit/WebTest/Contribute/OnlineMultiplePaymentProcessorTest.php index a03499df34..a919b5f2ef 100644 --- a/tests/phpunit/WebTest/Contribute/OnlineMultiplePaymentProcessorTest.php +++ b/tests/phpunit/WebTest/Contribute/OnlineMultiplePaymentProcessorTest.php @@ -34,7 +34,7 @@ class WebTest_Contribute_OnlineMultiplePaymentProcessorTest extends CiviSelenium parent::setUp(); } - function testOnlineMultpiplePaymentProcessor() { + public function testOnlineMultpiplePaymentProcessor() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -116,7 +116,7 @@ class WebTest_Contribute_OnlineMultiplePaymentProcessorTest extends CiviSelenium } - function testOnlineMultiplePaymentProcessorWithPayLater() { + public function testOnlineMultiplePaymentProcessorWithPayLater() { // Log in using webtestLogin() method $this->webtestLogin(); diff --git a/tests/phpunit/WebTest/Contribute/OnlineRecurContributionTest.php b/tests/phpunit/WebTest/Contribute/OnlineRecurContributionTest.php index 5aa3372642..ff228149de 100644 --- a/tests/phpunit/WebTest/Contribute/OnlineRecurContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OnlineRecurContributionTest.php @@ -35,7 +35,7 @@ class WebTest_Contribute_OnlineRecurContributionTest extends CiviSeleniumTestCas parent::setUp(); } - function testOnlineRecurContribution() { + public function testOnlineRecurContribution() { require_once 'ContributionPageAddTest.php'; // a random 7-char string and an even number to make this pass unique diff --git a/tests/phpunit/WebTest/Contribute/PCPAddTest.php b/tests/phpunit/WebTest/Contribute/PCPAddTest.php index f1d44c8570..cbc8cf2c7c 100755 --- a/tests/phpunit/WebTest/Contribute/PCPAddTest.php +++ b/tests/phpunit/WebTest/Contribute/PCPAddTest.php @@ -35,7 +35,7 @@ class WebTest_Contribute_PCPAddTest extends CiviSeleniumTestCase { parent::setUp(); } - function testPCPAdd() { + public function testPCPAdd() { // open browser, login $this->webtestLogin(); diff --git a/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php b/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php index 099dbebcc7..529cef24ad 100644 --- a/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php +++ b/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php @@ -35,7 +35,7 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase { parent::setUp(); } - function testStandaloneContributeAdd() { + public function testStandaloneContributeAdd() { $this->webtestLogin(); // Create a contact to be used as soft creditor @@ -181,7 +181,7 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase { } } - function testfinancialTypeSearch() { + public function testfinancialTypeSearch() { $this->webtestLogin(); $financialType = array( @@ -214,7 +214,7 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase { /** * @param $financialType */ - function addStandaloneContribution($financialType) { + public function addStandaloneContribution($financialType) { $this->openCiviPage("contribute/add", "reset=1&context=standalone", "_qf_Contribution_upload"); @@ -277,7 +277,7 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase { } } - function testAjaxCustomGroupLoad() { + public function testAjaxCustomGroupLoad() { $this->webtestLogin(); $triggerElement = array('name' => 'financial_type_id', 'type' => 'select'); $customSets = array( diff --git a/tests/phpunit/WebTest/Contribute/UpdateBatchPendingContributionTest.php b/tests/phpunit/WebTest/Contribute/UpdateBatchPendingContributionTest.php index 4bd5bb8b15..1b93dbc041 100644 --- a/tests/phpunit/WebTest/Contribute/UpdateBatchPendingContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/UpdateBatchPendingContributionTest.php @@ -35,7 +35,7 @@ class WebTest_Contribute_UpdateBatchPendingContributionTest extends CiviSelenium parent::setUp(); } - function testBatchUpdatePendingContribution() { + public function testBatchUpdatePendingContribution() { $this->webtestLogin(); $this->_testOfflineContribution(); $this->_testOfflineContribution(); @@ -73,7 +73,7 @@ class WebTest_Contribute_UpdateBatchPendingContributionTest extends CiviSelenium $this->webtestVerifyTabularData($expected); } - function testParticipationAdd() { + public function testParticipationAdd() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -133,7 +133,7 @@ class WebTest_Contribute_UpdateBatchPendingContributionTest extends CiviSelenium /** * @param string $firstName */ - function _addParticipant($firstName) { + public function _addParticipant($firstName) { $this->openCiviPage("participant/add", "reset=1&action=add&context=standalone", '_qf_Participant_upload-bottom'); @@ -188,7 +188,7 @@ class WebTest_Contribute_UpdateBatchPendingContributionTest extends CiviSelenium ); } - function _testOfflineContribution() { + public function _testOfflineContribution() { $this->openCiviPage("contribute/add", "reset=1&context=standalone", "_qf_Contribution_upload"); // create new contact using dialog diff --git a/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php b/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php index 8aa092a008..26b0d75619 100755 --- a/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php @@ -36,7 +36,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { parent::setUp(); } - function testChangeContributionAmount() { + public function testChangeContributionAmount() { $this->webtestLogin(); $amount = 100; //Offline Pay Later Contribution @@ -83,7 +83,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { $this->assertDBCompareValues('CRM_Contribute_DAO_Contribution', $searchParams, $compare); } - function testPayLater() { + public function testPayLater() { $this->webtestLogin(); $amount = 100.00; //Offline Pay Later Contribution @@ -109,7 +109,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { $this->assertEquals($status, '1', "Verify Completed Status"); } - function testChangePremium() { + public function testChangePremium() { $this->webtestLogin(); $from = 'Premiums'; $to = 'Premiums inventory'; @@ -180,7 +180,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { $this->assertEquals($deletedAmount, $cost, "Verify actual cost for deleted premium"); } - function testDeletePremium() { + public function testDeletePremium() { $this->webtestLogin(); $from = 'Premiums'; $to = 'Premiums inventory'; @@ -242,7 +242,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { $this->assertEquals($actualAmount, $cost, "Verify actual cost for deleted premium"); } - function testChangePaymentInstrument() { + public function testChangePaymentInstrument() { $this->webtestLogin(); $label = 'TEST'.substr(sha1(rand()), 0, 7); $amount = 100.00; @@ -267,7 +267,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { $this->assertEquals($totalAmount, $amount, "Verify amount for newly inserted values"); } - function testRefundContribution() { + public function testRefundContribution() { $this->webtestLogin(); $amount = 100.00; $this->_testOfflineContribution($amount); @@ -292,7 +292,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { $this->assertEquals($amount, '-100.00', 'Verify Financial Trxn Amount.'); } - function testCancelPayLater() { + public function testCancelPayLater() { $this->webtestLogin(); $amount = 100.00; $this->_testOfflineContribution($amount, "Pending"); @@ -324,7 +324,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { $this->assertEquals($totalAmount, "-$amount", 'Verify Amount for Financial Trxn'); } - function testChangeFinancialType() { + public function testChangeFinancialType() { $this->webtestLogin(); $amount = 100.00; $this->_testOfflineContribution($amount); @@ -448,7 +448,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { * @param string $status * @return array */ - function _testOfflineContribution($amount, $status="Completed") { + public function _testOfflineContribution($amount, $status="Completed") { $this->openCiviPage("contribute/add", "reset=1&context=standalone", "_qf_Contribution_upload"); diff --git a/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php b/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php index 6d720bdbff..7db4ad0169 100644 --- a/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php @@ -35,7 +35,7 @@ class WebTest_Contribute_UpdatePendingContributionTest extends CiviSeleniumTestC parent::setUp(); } - function testUpdatePendingContribution() { + public function testUpdatePendingContribution() { $this->webtestLogin(); //Offline Pay Later Contribution @@ -76,7 +76,7 @@ class WebTest_Contribute_UpdatePendingContributionTest extends CiviSeleniumTestC /** * @return array of contact details */ - function _testOfflineContribution() { + public function _testOfflineContribution() { // Create a contact to be used as soft creditor $softCreditFname = substr(sha1(rand()), 0, 7); $softCreditLname = substr(sha1(rand()), 0, 7); @@ -183,7 +183,7 @@ class WebTest_Contribute_UpdatePendingContributionTest extends CiviSeleniumTestC /** * @param array $contact */ - function _testOnlineContribution($contact) { + public function _testOnlineContribution($contact) { // Use default payment processor $processorName = 'Test Processor'; diff --git a/tests/phpunit/WebTest/Contribute/VerifySSLContributionTest.php b/tests/phpunit/WebTest/Contribute/VerifySSLContributionTest.php index f197280602..db8552d81e 100644 --- a/tests/phpunit/WebTest/Contribute/VerifySSLContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/VerifySSLContributionTest.php @@ -39,7 +39,7 @@ class WebTest_Contribute_VerifySSLContributionTest extends CiviSeleniumTestCase parent::setUp(); } - function testPaymentProcessorsSSL() { + public function testPaymentProcessorsSSL() { $this->_initialize(); $this->_tryPaymentProcessor($this->names['AuthNet']); @@ -49,7 +49,7 @@ class WebTest_Contribute_VerifySSLContributionTest extends CiviSeleniumTestCase $this->_tryPaymentProcessor($this->names['PayPal_Standard']);*/ } - function _initialize() { + public function _initialize() { if (!$this->initialized) { // log in $this->webtestLogin(); @@ -106,7 +106,7 @@ class WebTest_Contribute_VerifySSLContributionTest extends CiviSeleniumTestCase /** * @param string $name */ - function _tryPaymentProcessor($name) { + public function _tryPaymentProcessor($name) { // load contribution page $this->openCiviPage("contribute/transact", "reset=1&action=preview&id={$this->pageId}", "_qf_Main_upload-bottom"); diff --git a/tests/phpunit/WebTest/Event/AddEventTest.php b/tests/phpunit/WebTest/Event/AddEventTest.php index 0c0ad91219..6569342dc1 100644 --- a/tests/phpunit/WebTest/Event/AddEventTest.php +++ b/tests/phpunit/WebTest/Event/AddEventTest.php @@ -35,7 +35,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { parent::setUp(); } - function testAddPaidEventNoTemplate() { + public function testAddPaidEventNoTemplate() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -78,7 +78,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { $this->_testVerifyRegisterPage($registerStrings); } - function testAddPaidEventDiscount() { + public function testAddPaidEventDiscount() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -118,7 +118,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { $this->_testOnlineRegistration($registerUrl, $numberRegistrations, $anonymous); } - function testDeletePriceSetDiscount() { + public function testDeletePriceSetDiscount() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -165,7 +165,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { } } - function testAddDeleteEventDiscount() { + public function testAddDeleteEventDiscount() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -207,7 +207,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { * @param $eventTitle * @param $discount */ - function _deleteDiscount($id, $eventTitle, $discount) { + public function _deleteDiscount($id, $eventTitle, $discount) { $this->openCiviPage("event/manage/fee", "reset=1&action=update&id=$id", "_qf_Fee_upload-bottom"); $this->type("discount_name_2", ""); $this->click("xpath=//tr[@id='discount_2']/td[3]/a"); @@ -221,7 +221,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { $this->assertStringsPresent($discount[1]); } - function testAddPaidEventWithTemplate() { + public function testAddPaidEventWithTemplate() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -256,7 +256,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { $this->_testVerifyRegisterPage($registerStrings); } - function testAddFreeEventWithTemplate() { + public function testAddFreeEventWithTemplate() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -294,7 +294,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { $this->verifyElementNotPresent("css=div.paid_event-section"); } - function testUnpaidPaid() { + public function testUnpaidPaid() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -321,7 +321,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { $this->assertNotChecked('is_pay_later'); } - function testAjaxCustomGroupLoad() { + public function testAjaxCustomGroupLoad() { $this->webtestLogin(); $triggerElement = array('name' => 'event_type_id', 'type' => 'select'); @@ -337,7 +337,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { * @param $eventTitle * @param $eventDescription */ - function _testAddEventInfo($eventTitle, $eventDescription) { + public function _testAddEventInfo($eventTitle, $eventDescription) { $this->waitForElementPresent("_qf_EventInfo_upload-bottom"); $this->select("event_type_id", "value=1"); @@ -369,7 +369,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { * @param int $templateID * @param int $eventTypeID */ - function _testAddEventInfoFromTemplate($eventTitle, $eventDescription, $templateID, $eventTypeID) { + public function _testAddEventInfoFromTemplate($eventTitle, $eventDescription, $templateID, $eventTypeID) { $this->waitForElementPresent("_qf_EventInfo_upload-bottom"); // Select event template. Use option value, not label - since labels can be translated and test would fail @@ -403,7 +403,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { /** * @param $streetAddress */ - function _testAddLocation($streetAddress) { + public function _testAddLocation($streetAddress) { // Wait for Location tab form to load $this->waitForAjaxContent(); $this->waitForElementPresent("_qf_Location_upload-bottom"); @@ -432,7 +432,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { * * @return array */ - function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorName = "PP Pro", $double = FALSE, $payLater = FALSE) { + public function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorName = "PP Pro", $double = FALSE, $payLater = FALSE) { $discount1 = "Early-bird" . substr(sha1(rand()), 0, 7); $discount2 = ""; // Go to Fees tab @@ -500,7 +500,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { * @param $registerIntro * @param bool $multipleRegistrations */ - function _testAddOnlineRegistration($registerIntro, $multipleRegistrations = FALSE) { + public function _testAddOnlineRegistration($registerIntro, $multipleRegistrations = FALSE) { // Go to Online Registration tab $this->click("link=Online Registration"); $this->waitForElementPresent("_qf_Registration_upload-bottom"); @@ -537,7 +537,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { * * @return null */ - function _testVerifyEventInfo($eventTitle, $eventInfoStrings, $eventFees = NULL) { + public function _testVerifyEventInfo($eventTitle, $eventInfoStrings, $eventFees = NULL) { // verify event input on info page // start at Manage Events listing $this->openCiviPage("event/manage", "reset=1"); @@ -562,7 +562,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { * * @return string */ - function _testVerifyRegisterPage($registerStrings) { + public function _testVerifyRegisterPage($registerStrings) { // Go to Register page and check for intro text and fee levels $this->click("link=Register Now"); $this->waitForElementPresent("_qf_Register_upload-bottom"); @@ -580,7 +580,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { * * @return array */ - function _testOnlineRegistration($registerUrl, $numberRegistrations = 1, $anonymous = TRUE, $isPayLater = FALSE, $participantEmailInfo = array(), $paymentProcessor = NULL) { + public function _testOnlineRegistration($registerUrl, $numberRegistrations = 1, $anonymous = TRUE, $isPayLater = FALSE, $participantEmailInfo = array(), $paymentProcessor = NULL) { $infoPassed = FALSE; if (!empty($participantEmailInfo)) { $infoPassed = TRUE; @@ -676,7 +676,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { /** * @param $eventTitle */ - function _testAddReminder($eventTitle) { + public function _testAddReminder($eventTitle) { // Go to Schedule Reminders tab $this->click('css=li#tab_reminder a'); $this->waitForElementPresent("newScheduleReminder"); @@ -721,7 +721,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { } } - function testEventAddMultipleParticipant() { + public function testEventAddMultipleParticipant() { // Log in using webtestLogin() method $this->webtestLogin(); $this->openCiviPage("event/add", "reset=1&action=add"); @@ -854,7 +854,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { /** * @param int $contributionID */ - function verifyFinancialRecords($contributionID) { + public function verifyFinancialRecords($contributionID) { // check count for civicrm_contribution and civicrm_financial_item in civicrm_entity_financial_trxn $query = "SELECT COUNT(DISTINCT(c1.id)) civicrm_contribution, COUNT(c2.id) civicrm_financial_item FROM civicrm_entity_financial_trxn c1 LEFT JOIN civicrm_entity_financial_trxn c2 ON c1.financial_trxn_id = c2.financial_trxn_id AND c2.entity_table ='civicrm_financial_item' @@ -873,7 +873,7 @@ WHERE ceft.entity_id = %1 AND ceft.entity_table = 'civicrm_contribution'"; $this->assertEquals('2', $dao->civicrm_financial_trxn, 'civicrm_financial_trxn count does not match'); } - function testEventApprovalRegistration() { + public function testEventApprovalRegistration() { $this->webtestLogin(); //Participant Status @@ -968,7 +968,7 @@ WHERE ceft.entity_id = %1 AND ceft.entity_table = 'civicrm_contribution'"; /** * @param $status */ - function _testEnableParticipantStatuses($status) { + public function _testEnableParticipantStatuses($status) { // enable participant status if ($this->isElementPresent("xpath=//td[@class='crm-participant-label crm-editable crm-editable-enabled'][contains(text(), '{$status}')]/../td[9]/span/a[2][text()='Enable']")) { $this->click("xpath=//td[@class='crm-participant-label crm-editable crm-editable-enabled'][contains(text(), '{$status}')]/../td[9]/span/a[2][text()='Enable']"); diff --git a/tests/phpunit/WebTest/Event/AddParticipationTest.php b/tests/phpunit/WebTest/Event/AddParticipationTest.php index f568ccf31a..e96484c5c5 100644 --- a/tests/phpunit/WebTest/Event/AddParticipationTest.php +++ b/tests/phpunit/WebTest/Event/AddParticipationTest.php @@ -35,7 +35,7 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { parent::setUp(); } - function testEventParticipationAdd() { + public function testEventParticipationAdd() { $this->webtestLogin(); // Adding contact with randomized first name (so we can then select that contact when creating event registration) @@ -122,7 +122,7 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { ); } - function testEventParticipationAddWithMultipleRoles() { + public function testEventParticipationAddWithMultipleRoles() { $this->webtestLogin(); // Adding contact with randomized first name (so we can then select that contact when creating event registration) @@ -316,7 +316,7 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { $this->verifyText("xpath=//table/tbody/tr/td[text()='Total Amount']/following-sibling::td/strong", preg_quote('$ 800.00'), 'In line ' . __LINE__); } - function testEventAddMultipleParticipants() { + public function testEventAddMultipleParticipants() { $this->webtestLogin(); $processorId = $this->webtestAddPaymentProcessor(); @@ -352,7 +352,7 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { } } - function testAjaxCustomGroupLoad() { + public function testAjaxCustomGroupLoad() { $this->webtestLogin(); $customSets = array( @@ -368,7 +368,7 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { * Webtest for CRM-10983 * */ - function testCheckDuplicateCustomDataLoad() { + public function testCheckDuplicateCustomDataLoad() { $this->webtestLogin(); $customSets = array( @@ -406,7 +406,7 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { * @param string $lastName * @param int $processorId */ - function _fillParticipantDetails($processorId) { + public function _fillParticipantDetails($processorId) { $contact = $this->createDialogContact(); $this->select('payment_processor_id', "value={$processorId}"); diff --git a/tests/phpunit/WebTest/Event/AddPricesetTest.php b/tests/phpunit/WebTest/Event/AddPricesetTest.php index 400555b887..5d06f83e28 100644 --- a/tests/phpunit/WebTest/Event/AddPricesetTest.php +++ b/tests/phpunit/WebTest/Event/AddPricesetTest.php @@ -35,7 +35,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { parent::setUp(); } - function testAddPriceSet() { + public function testAddPriceSet() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -70,7 +70,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { * @param $setHelp * @param string $financialType */ - function _testAddSet($setTitle, $usedFor, $setHelp, $financialType = 'Event Fee') { + public function _testAddSet($setTitle, $usedFor, $setHelp, $financialType = 'Event Fee') { $this->openCiviPage('admin/price', 'reset=1&action=add', '_qf_Set_next-bottom'); // Enter Priceset fields (Title, Used For ...) @@ -95,7 +95,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { * @param $validateStrings * @param bool $dateSpecificFields */ - function _testAddPriceFields(&$fields, &$validateStrings, $dateSpecificFields = FALSE) { + public function _testAddPriceFields(&$fields, &$validateStrings, $dateSpecificFields = FALSE) { $this->clickLinkSuppressPopup('newPriceField'); foreach ($fields as $label => $type) { $validateStrings[] = $label; @@ -184,7 +184,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { * @param $validateStrings * @param int $sid */ - function _testVerifyPriceSet($validateStrings, $sid) { + public function _testVerifyPriceSet($validateStrings, $sid) { // verify Price Set at Preview page // start at Manage Price Sets listing $this->openCiviPage('admin/price', 'reset=1'); @@ -196,7 +196,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { $this->assertStringsPresent($validateStrings); } - function testRegisterWithPriceSet() { + public function testRegisterWithPriceSet() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -356,7 +356,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { $this->click('_qf_ParticipantView_cancel-bottom'); } - function testParticipantWithDateSpecificPriceSet() { + public function testParticipantWithDateSpecificPriceSet() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -505,7 +505,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { * */ - function testEventWithPriceSet() { + public function testEventWithPriceSet() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -680,7 +680,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { } - function testDeletePriceSetforEventTemplate() { + public function testDeletePriceSetforEventTemplate() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -749,7 +749,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { /** * @param array $expectedLineItems */ - function _checkLineItems($expectedLineItems) { + public function _checkLineItems($expectedLineItems) { foreach ($expectedLineItems as $lineKey => $lineValue) { foreach ($lineValue as $key => $value) { $this->verifyText("xpath=//table/tbody//tr/td[text()='Selections']/following-sibling::td/table/tbody//tr[$lineKey]/td[$key]", preg_quote($value)); diff --git a/tests/phpunit/WebTest/Event/AddRecurringEventTest.php b/tests/phpunit/WebTest/Event/AddRecurringEventTest.php index f7193a6831..2aa6e1f45e 100644 --- a/tests/phpunit/WebTest/Event/AddRecurringEventTest.php +++ b/tests/phpunit/WebTest/Event/AddRecurringEventTest.php @@ -38,7 +38,7 @@ class WebTest_Event_AddRecurringEventTest extends CiviSeleniumTestCase { parent::setUp(); } - function testRecurringEvent() { + public function testRecurringEvent() { $this->webtestLogin(); //Add repeat configuration for an event diff --git a/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php b/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php index b429678d26..287f594ce8 100644 --- a/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php +++ b/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php @@ -35,7 +35,7 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase { } // CRM-13964 and CRM-13965 - function testParticipantParitalPaymentInitiation() { + public function testParticipantParitalPaymentInitiation() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -211,7 +211,7 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase { * @param $feeAmt * @param int $amtPaid */ - function _checkPaymentInfoTable($feeAmt, $amtPaid) { + public function _checkPaymentInfoTable($feeAmt, $amtPaid) { $this->assertElementContainsText("xpath=//td[@id='payment-info']/table[@id='info']/tbody/tr[2]/td", "$ {$feeAmt}", 'Missing text: appropriate fee amount'); $this->assertElementContainsText("xpath=//td[@id='payment-info']/table[@id='info']/tbody/tr[2]/td[2]", "$ {$amtPaid}", 'Missing text: appropriate fee amount'); } diff --git a/tests/phpunit/WebTest/Event/ChangeParticipantStatus.php b/tests/phpunit/WebTest/Event/ChangeParticipantStatus.php index 9a768ea328..a637c4aa2f 100644 --- a/tests/phpunit/WebTest/Event/ChangeParticipantStatus.php +++ b/tests/phpunit/WebTest/Event/ChangeParticipantStatus.php @@ -35,7 +35,7 @@ class WebTest_Event_ChangeParticipantStatus extends CiviSeleniumTestCase { parent::setUp(); } - function testParticipationAdd() { + public function testParticipationAdd() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -98,7 +98,7 @@ class WebTest_Event_ChangeParticipantStatus extends CiviSeleniumTestCase { /** * @param string $firstName */ - function addParticipant($firstName) { + public function addParticipant($firstName) { $this->openCiviPage("participant/add", "reset=1&action=add&context=standalone", '_qf_Participant_upload-bottom'); // Type contact last name in contact auto-complete, wait for dropdown and click first result diff --git a/tests/phpunit/WebTest/Event/EventListingTest.php b/tests/phpunit/WebTest/Event/EventListingTest.php index dde4a8004d..01998d72b2 100644 --- a/tests/phpunit/WebTest/Event/EventListingTest.php +++ b/tests/phpunit/WebTest/Event/EventListingTest.php @@ -10,7 +10,7 @@ class WebTest_Event_EventListingTest extends CiviSeleniumTestCase { parent::setUp(); } - function testEventListing() { + public function testEventListing() { // Log in using webtestLogin() method $this->webtestLogin('admin'); @@ -118,7 +118,7 @@ class WebTest_Event_EventListingTest extends CiviSeleniumTestCase { * @param $startdate * @param $enddate */ - function _testCreateEvent($eventTitle, $startdate, $enddate) { + public function _testCreateEvent($eventTitle, $startdate, $enddate) { $this->openCiviPage("event/add", "reset=1&action=add"); diff --git a/tests/phpunit/WebTest/Event/EventWaitListTest.php b/tests/phpunit/WebTest/Event/EventWaitListTest.php index f3692e7da4..dcb8b65386 100644 --- a/tests/phpunit/WebTest/Event/EventWaitListTest.php +++ b/tests/phpunit/WebTest/Event/EventWaitListTest.php @@ -33,7 +33,7 @@ class WebTest_Event_EventWaitListTest extends CiviSeleniumTestCase { parent::setUp(); } - function testEventWaitList() { + public function testEventWaitList() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -159,7 +159,7 @@ class WebTest_Event_EventWaitListTest extends CiviSeleniumTestCase { * @param $eventTitle * @param $eventInfoStrings */ - function _testVerifyEventInfo($eventTitle, $eventInfoStrings) { + public function _testVerifyEventInfo($eventTitle, $eventInfoStrings) { // verify event input on info page // start at Manage Events listing $this->openCiviPage("event/manage", "reset=1"); @@ -174,7 +174,7 @@ class WebTest_Event_EventWaitListTest extends CiviSeleniumTestCase { * * @return string */ - function _testVerifyRegisterPage($registerStrings) { + public function _testVerifyRegisterPage($registerStrings) { // Go to Register page and check for intro text and fee levels $this->click("link=Register Now"); $this->waitForElementPresent("_qf_Register_upload-bottom"); @@ -187,7 +187,7 @@ class WebTest_Event_EventWaitListTest extends CiviSeleniumTestCase { * @param int $numberRegistrations * @param bool $anonymous */ - function _testOnlineRegistration($registerUrl, $numberRegistrations = 1, $anonymous = TRUE) { + public function _testOnlineRegistration($registerUrl, $numberRegistrations = 1, $anonymous = TRUE) { if ($anonymous) { $this->webtestLogout(); } diff --git a/tests/phpunit/WebTest/Event/MultipleEventRegistrationbyCartTest.php b/tests/phpunit/WebTest/Event/MultipleEventRegistrationbyCartTest.php index 2a0a046816..6d2384e4a6 100755 --- a/tests/phpunit/WebTest/Event/MultipleEventRegistrationbyCartTest.php +++ b/tests/phpunit/WebTest/Event/MultipleEventRegistrationbyCartTest.php @@ -36,7 +36,7 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest } // this functionality is broken hence skipping the test - function skiptestAuthenticatedMultipleEvent() { + public function skiptestAuthenticatedMultipleEvent() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -129,7 +129,7 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest } // this functionality is broken hence skipping the test - function skiptestAnonymousMultipleEvent() { + public function skiptestAnonymousMultipleEvent() { // This is the path where our testing install resides. // The rest of URL is defined in CiviSeleniumTestCase base class, in // class attributes. @@ -236,7 +236,7 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest * @param $eventTitle * @param $eventDescription */ - function _testAddEventInfo($eventTitle, $eventDescription) { + public function _testAddEventInfo($eventTitle, $eventDescription) { $this->waitForElementPresent("_qf_EventInfo_upload-bottom"); $this->select("event_type_id", "value=1"); @@ -264,7 +264,7 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest /** * @param $streetAddress */ - function _testAddLocation($streetAddress) { + public function _testAddLocation($streetAddress) { // Wait for Location tab form to load $this->waitForPageToLoad($this->getTimeoutMsec()); $this->waitForElementPresent("_qf_Location_upload-bottom"); @@ -287,7 +287,7 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest * @param bool $priceSet * @param string $processorName */ - function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorName = "PP Pro") { + public function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorName = "PP Pro") { // Go to Fees tab $this->click("link=Fees"); $this->waitForElementPresent("_qf_Fee_upload-bottom"); @@ -329,7 +329,7 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest * @param $registerIntro * @param bool $multipleRegistrations */ - function _testAddOnlineRegistration($registerIntro, $multipleRegistrations = FALSE) { + public function _testAddOnlineRegistration($registerIntro, $multipleRegistrations = FALSE) { // Go to Online Registration tab $this->click("link=Online Registration"); $this->waitForElementPresent("_qf_Registration_upload-bottom"); @@ -358,7 +358,7 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest * @param $eventInfoStrings * @param null $eventFees */ - function _AddEventToCart($eventTitle, $eventInfoStrings, $eventFees = NULL) { + public function _AddEventToCart($eventTitle, $eventInfoStrings, $eventFees = NULL) { // verify event input on info page // start at Manage Events listing $this->openCiviPage("event/manage", "reset=1"); @@ -375,7 +375,7 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest * * @return string */ - function _testVerifyEventInfo($eventTitle, $eventInfoStrings, $eventFees = NULL) { + public function _testVerifyEventInfo($eventTitle, $eventInfoStrings, $eventFees = NULL) { // verify event input on info page // start at Manage Events listing $this->openCiviPage("event/manage", "reset=1"); @@ -398,7 +398,7 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest * @param int $numberRegistrations * @param bool $anonymous */ - function _testOnlineRegistration($registerUrl, $numberRegistrations = 1, $anonymous = TRUE) { + public function _testOnlineRegistration($registerUrl, $numberRegistrations = 1, $anonymous = TRUE) { if ($anonymous) { $this->webtestLogout(); } @@ -412,7 +412,7 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest /** * @return array */ - function _testCheckOut() { + public function _testCheckOut() { //View the Cart $this->click("xpath=//div[@id='messages']/div/div/a[text()='View your cart.']"); @@ -456,7 +456,7 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest * @param string $lastName * @param $events */ - function _checkContributionsandEventRegistration($firstName, $lastName, $events) { + public function _checkContributionsandEventRegistration($firstName, $lastName, $events) { //Type the registered participant's email in autocomplete. $this->click('sort_name_navigation'); $this->type('css=input#sort_name_navigation', "{$firstName}.{$lastName}@home.com"); diff --git a/tests/phpunit/WebTest/Event/MultiprofileEventTest.php b/tests/phpunit/WebTest/Event/MultiprofileEventTest.php index 0f0d33daa0..d750dcd87c 100644 --- a/tests/phpunit/WebTest/Event/MultiprofileEventTest.php +++ b/tests/phpunit/WebTest/Event/MultiprofileEventTest.php @@ -35,7 +35,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { parent::setUp(); } - function testCreateEventRegisterPage() { + public function testCreateEventRegisterPage() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -128,7 +128,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); } - function testAnoumyousRegisterPage() { + public function testAnoumyousRegisterPage() { // add the required Drupal permission $permission = array('edit-1-access-all-custom-data'); $this->changePermissions($permission); @@ -274,7 +274,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { * * @return array */ - function _testGetCustomFieldId($customGrpId1) { + public function _testGetCustomFieldId($customGrpId1) { $customId = array(); // Create a custom data to add in profile @@ -318,7 +318,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { /** * @param int $eventPageId */ - function _testRemoveProfile($eventPageId) { + public function _testRemoveProfile($eventPageId) { $this->openCiviPage("event/manage/settings", "reset=1&action=update&id=$eventPageId"); // Go to Online Contribution tab @@ -337,7 +337,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { * * @return array */ - function _testGetProfileId($customId) { + public function _testGetProfileId($customId) { // create profiles $profileId = array(); $profilefield = array( @@ -416,7 +416,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { * * @return null */ - function _testCreateProfile($profilefield, $location = 0, $type) { + public function _testCreateProfile($profilefield, $location = 0, $type) { $locationfields = array( 'supplemental_address_1', 'supplemental_address_2', @@ -465,7 +465,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { * @param $eventTitle * @param $eventDescription */ - function _testAddEventInfo($eventTitle, $eventDescription) { + public function _testAddEventInfo($eventTitle, $eventDescription) { $this->waitForElementPresent("_qf_EventInfo_upload-bottom"); $this->select("event_type_id", "value=1"); @@ -493,7 +493,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { /** * @param $streetAddress */ - function _testAddLocation($streetAddress) { + public function _testAddLocation($streetAddress) { // Wait for Location tab form to load $this->waitForPageToLoad($this->getTimeoutMsec()); $this->waitForElementPresent("_qf_Location_upload-bottom"); @@ -520,7 +520,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { * @param bool $priceSet * @param string $processorName */ - function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorName = "PP Pro") { + public function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorName = "PP Pro") { // Go to Fees tab $this->click("link=Fees"); $this->waitForElementPresent("_qf_Fee_upload-bottom"); @@ -559,7 +559,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { * * @return null */ - function _testAddMultipleProfile($profileId) { + public function _testAddMultipleProfile($profileId) { // Go to Online Contribution tab $this->click("link=Online Registration"); $this->waitForElementPresent("_qf_Registration_upload-bottom"); @@ -729,7 +729,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { * @param $email3 * @param $email4 */ - function _testEventRegistrationAfterRemoving($eventPageId, $customId, $firstName2, $lastName2, $participantfname2, $participantlname2, $email3, $email4) { + public function _testEventRegistrationAfterRemoving($eventPageId, $customId, $firstName2, $lastName2, $participantfname2, $participantlname2, $email3, $email4) { $this->openCiviPage("event/register", "id={$eventPageId}&reset=1", "_qf_Register_upload-bottom"); $this->select("additional_participants", "value=1"); @@ -797,7 +797,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { /** * @return array|string */ - function _addEmailField() { + public function _addEmailField() { //add email field in name and address profile $this->openCiviPage('admin/uf/group/field/add', 'reset=1&action=add&gid=1', "_qf_Field_next-bottom"); $this->select("field_name[0]", "value=Contact"); @@ -819,7 +819,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { /** * @param int $cfId */ - function _removeEmailField($cfId) { + public function _removeEmailField($cfId) { $this->openCiviPage("admin/uf/group/field", "action=delete&id={$cfId}"); $this->click("_qf_Field_next-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); diff --git a/tests/phpunit/WebTest/Event/PCPAddTest.php b/tests/phpunit/WebTest/Event/PCPAddTest.php index a7fb5df90b..fb0b76c90b 100644 --- a/tests/phpunit/WebTest/Event/PCPAddTest.php +++ b/tests/phpunit/WebTest/Event/PCPAddTest.php @@ -35,7 +35,7 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { parent::setUp(); } - function testPCPAdd() { + public function testPCPAdd() { //give permissions to anonymous user $permission = array('edit-1-profile-listings-and-forms', 'edit-1-access-all-custom-data', 'edit-1-register-for-events', 'edit-1-make-online-contributions'); $this->changePermissions($permission); @@ -124,7 +124,7 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { * @param string $middleName * @param $email */ - function _testAddEventForPCP($processorName, $campaignType, $contributionPageId = NULL, $firstName, $lastName, $middleName, $email) { + public function _testAddEventForPCP($processorName, $campaignType, $contributionPageId = NULL, $firstName, $lastName, $middleName, $email) { $this->openCiviPage("event/add", "reset=1&action=add"); @@ -150,7 +150,7 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { * @param $eventTitle * @param $eventDescription */ - function _testAddEventInfo($eventTitle, $eventDescription) { + public function _testAddEventInfo($eventTitle, $eventDescription) { $this->waitForElementPresent("_qf_EventInfo_upload-bottom"); $this->select("event_type_id", "value=1"); @@ -178,7 +178,7 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { /** * @param $streetAddress */ - function _testAddLocation($streetAddress) { + public function _testAddLocation($streetAddress) { // Wait for Location tab form to load $this->waitForPageToLoad($this->getTimeoutMsec()); $this->waitForElementPresent("_qf_Location_upload-bottom"); @@ -203,7 +203,7 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { * @param bool $priceSet * @param string $processorName */ - function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorName = "PP Pro") { + public function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorName = "PP Pro") { // Go to Fees tab $this->click("link=Fees"); $this->waitForElementPresent("_qf_Fee_upload-bottom"); @@ -237,7 +237,7 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { * @param $registerIntro * @param bool $multipleRegistrations */ - function _testAddOnlineRegistration($registerIntro, $multipleRegistrations = FALSE) { + public function _testAddOnlineRegistration($registerIntro, $multipleRegistrations = FALSE) { // Go to Online Registration tab $this->click("link=Online Registration"); $this->waitForElementPresent("_qf_Registration_upload-bottom"); @@ -274,7 +274,7 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { * @param $campaignType * @param bool $anonymous */ - function _testOnlineRegistration($eventTitle, $pageId, $firstName, $lastName, $middleName, $email, $numberRegistrations = 1, $campaignType, $anonymous = TRUE) { + public function _testOnlineRegistration($eventTitle, $pageId, $firstName, $lastName, $middleName, $email, $numberRegistrations = 1, $campaignType, $anonymous = TRUE) { $hash = substr(sha1(rand()), 0, 7); $contributionAmount = 600; @@ -439,7 +439,7 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { * * @return null */ - function _testEventPcpAdd($campaignType, $contributionPageId) { + public function _testEventPcpAdd($campaignType, $contributionPageId) { $hash = substr(sha1(rand()), 0, 7); $isPcpApprovalNeeded = TRUE; @@ -484,7 +484,7 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { * @param string $lastNameCreator * @param $amount */ - function _testParticipantSearchEventName($eventName, $lastNameDonar, $firstNameDonar, $firstNameCreator, $lastNameCreator, $amount) { + public function _testParticipantSearchEventName($eventName, $lastNameDonar, $firstNameDonar, $firstNameCreator, $lastNameCreator, $amount) { $sortName = $lastNameDonar . ', ' . $firstNameDonar; $this->openCiviPage("event/search", "reset=1"); @@ -513,7 +513,7 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { * @param $pcpCreatorLastName * @param $amount */ - function _testSearchTest($firstName, $lastName, $pcpCreatorFirstName, $pcpCreatorLastName, $amount) { + public function _testSearchTest($firstName, $lastName, $pcpCreatorFirstName, $pcpCreatorLastName, $amount) { $sortName = "$pcpCreatorLastName, $pcpCreatorFirstName"; $displayName = "$firstName $lastName"; diff --git a/tests/phpunit/WebTest/Event/ParticipantCountTest.php b/tests/phpunit/WebTest/Event/ParticipantCountTest.php index 08f2dd8de5..0992a3cf52 100644 --- a/tests/phpunit/WebTest/Event/ParticipantCountTest.php +++ b/tests/phpunit/WebTest/Event/ParticipantCountTest.php @@ -35,7 +35,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { parent::setUp(); } - function testParticipantCountWithFeelevel() { + public function testParticipantCountWithFeelevel() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -109,7 +109,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { $this->assertElementContainsText("xpath=//div[@id='search-status']/table/tbody/tr[1]/td", '2 Results'); } - function testParticipantCountWithPriceset() { + public function testParticipantCountWithPriceset() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -301,7 +301,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { * @param $setTitle * @param string $financialType */ - function _testAddSet($setTitle, $financialType = 'Event Fee') { + public function _testAddSet($setTitle, $financialType = 'Event Fee') { $this->openCiviPage('admin/price', 'reset=1&action=add', '_qf_Set_next-bottom'); // Enter Priceset fields (Title, Used For ...) @@ -317,7 +317,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { /** * @param $options */ - function _testAddMultipleChoiceOptions($options) { + public function _testAddMultipleChoiceOptions($options) { foreach ($options as $oIndex => $oValue) { $this->type("option_label_{$oIndex}", $oValue['label']); $this->type("option_amount_{$oIndex}", $oValue['amount']); @@ -335,7 +335,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { * * @return string */ - function _testAddEvent($params) { + public function _testAddEvent($params) { $this->openCiviPage('event/add', 'reset=1&action=add', '_qf_EventInfo_upload-bottom'); $this->select('event_type_id', "value={$params['event_type_id']}"); @@ -412,7 +412,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { /** * @param array $participant */ - function _testRegisterWithBillingInfo($participant = array()) { + public function _testRegisterWithBillingInfo($participant = array()) { $this->waitForElementPresent("credit_card_type"); $this->select('credit_card_type', 'value=Visa'); $this->type('credit_card_number', '4111111111111111'); @@ -441,7 +441,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { * @param $participants * @param $priceFieldOptionCounts */ - function _testPricesetDetailsCustomSearch($eventParams, $participants, $priceFieldOptionCounts) { + public function _testPricesetDetailsCustomSearch($eventParams, $participants, $priceFieldOptionCounts) { $this->openCiviPage('contact/search/custom', 'csid=9&reset=1'); $this->select('event_id', 'label=' . $eventParams['title']); diff --git a/tests/phpunit/WebTest/Event/ParticipantSearchTest.php b/tests/phpunit/WebTest/Event/ParticipantSearchTest.php index b678c41a46..4419c4cf4e 100644 --- a/tests/phpunit/WebTest/Event/ParticipantSearchTest.php +++ b/tests/phpunit/WebTest/Event/ParticipantSearchTest.php @@ -38,14 +38,14 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase { /** * @param $strings */ - function _checkStrings(&$strings) { + public function _checkStrings(&$strings) { // search for elements foreach ($strings as $string) { $this->assertTrue($this->isTextPresent($string), "Could not find $string on page"); } } - function testParticipantSearchForm() { + public function testParticipantSearchForm() { $this->webtestLogin(); // visit event search page @@ -68,7 +68,7 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase { $this->_checkStrings($stringsToCheck); } - function testParticipantSearchForce() { + public function testParticipantSearchForce() { $this->webtestLogin(); // visit event search page @@ -79,7 +79,7 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase { $this->assertTrue($this->isTextPresent("Select Records"), "A forced event search did not return any results"); } - function testParticipantSearchEmpty() { + public function testParticipantSearchEmpty() { $this->webtestLogin(); // visit event search page @@ -99,7 +99,7 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase { $this->_checkStrings($stringsToCheck); } - function testParticipantSearchEventName() { + public function testParticipantSearchEventName() { $this->webtestLogin(); // visit event search page @@ -120,7 +120,7 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase { $this->_checkStrings($stringsToCheck); } - function testParticipantSearchEventDate() { + public function testParticipantSearchEventDate() { $this->webtestLogin(); @@ -144,7 +144,7 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase { $this->_checkStrings($stringsToCheck); } - function testParticipantSearchEventDateAndType() { + public function testParticipantSearchEventDateAndType() { $this->webtestLogin(); @@ -174,7 +174,7 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase { $this->_checkStrings($stringsToCheck); } - function testParticipantSearchCustomField() { + public function testParticipantSearchCustomField() { $this->webtestLogin(); @@ -200,7 +200,7 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase { $this->_checkStrings($stringsToCheck); } - function testParticipantSearchForceAndView() { + public function testParticipantSearchForceAndView() { $this->webtestLogin(); @@ -225,7 +225,7 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase { $this->_checkStrings($stringsToCheck); } - function testParticipantSearchForceAndEdit() { + public function testParticipantSearchForceAndEdit() { $this->webtestLogin(); diff --git a/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php b/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php index 3146ca78fd..98d4ffc685 100644 --- a/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php +++ b/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php @@ -35,7 +35,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase { parent::setUp(); } - function testWithoutFieldCount() { + public function testWithoutFieldCount() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -226,7 +226,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase { $this->_checkConfirmationAndRegister(); } - function testWithFieldCount() { + public function testWithFieldCount() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -425,7 +425,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase { $this->_checkConfirmationAndRegister(); } - function testAdditionalParticipantWithoutFieldCount() { + public function testAdditionalParticipantWithoutFieldCount() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -710,7 +710,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase { $this->_checkConfirmationAndRegister(); } - function testAdditionalParticipantWithFieldCount() { + public function testAdditionalParticipantWithFieldCount() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -1006,7 +1006,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase { * @param $setTitle * @param null $financialType */ - function _testAddSet($setTitle, $financialType = NULL) { + public function _testAddSet($setTitle, $financialType = NULL) { $this->openCiviPage('admin/price', 'reset=1&action=add', '_qf_Set_next-bottom'); // Enter Priceset fields (Title, Used For ...) @@ -1027,7 +1027,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase { /** * @param $fields */ - function _testAddPriceFields($fields) { + public function _testAddPriceFields($fields) { $fieldCount = count($fields); $count = 1; $this->waitForElementPresent('label'); @@ -1085,7 +1085,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase { * @param $options * @param $fieldType */ - function _testAddMultipleChoiceOptions($options, $fieldType) { + public function _testAddMultipleChoiceOptions($options, $fieldType) { foreach ($options as $oIndex => $oValue) { $this->type("option_label_{$oIndex}", $oValue['label']); $this->type("option_amount_{$oIndex}", $oValue['amount']); @@ -1121,7 +1121,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase { * * @return string */ - function _testAddEvent($params) { + public function _testAddEvent($params) { $this->openCiviPage('event/add', 'reset=1&action=add', '_qf_EventInfo_upload-bottom'); $this->select('event_type_id', "value={$params['event_type_id']}"); @@ -1199,7 +1199,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase { return $this->getLocation(); } - function _fillRegisterWithBillingInfo() { + public function _fillRegisterWithBillingInfo() { $this->waitForElementPresent('credit_card_type'); $this->select('credit_card_type', 'value=Visa'); $this->type('credit_card_number', '4111111111111111'); @@ -1218,7 +1218,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); } - function _checkConfirmationAndRegister() { + public function _checkConfirmationAndRegister() { $confirmStrings = array('Event Fee(s)', 'Billing Name and Address', 'Credit Card Information'); $this->assertStringsPresent($confirmStrings); $this->click('_qf_Confirm_next-bottom'); diff --git a/tests/phpunit/WebTest/Event/TellAFriendTest.php b/tests/phpunit/WebTest/Event/TellAFriendTest.php index 7260705348..b42f097cfe 100644 --- a/tests/phpunit/WebTest/Event/TellAFriendTest.php +++ b/tests/phpunit/WebTest/Event/TellAFriendTest.php @@ -35,7 +35,7 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { parent::setUp(); } - function testAddEvent() { + public function testAddEvent() { // Log in using webtestLogin() method $this->webtestLogin('admin'); @@ -173,7 +173,7 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { * @param $eventTitle * @param $eventDescription */ - function _testAddEventInfo($eventTitle, $eventDescription) { + public function _testAddEventInfo($eventTitle, $eventDescription) { $this->waitForElementPresent("_qf_EventInfo_upload-bottom"); $this->select("event_type_id", "value=1"); @@ -201,7 +201,7 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { /** * @param $streetAddress */ - function _testAddLocation($streetAddress) { + public function _testAddLocation($streetAddress) { // Wait for Location tab form to load $this->waitForPageToLoad($this->getTimeoutMsec()); $this->waitForElementPresent("_qf_Location_upload-bottom"); @@ -226,7 +226,7 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { * @param $registerIntro * @param bool $multipleRegistrations */ - function _testAddOnlineRegistration($registerIntro, $multipleRegistrations = FALSE) { + public function _testAddOnlineRegistration($registerIntro, $multipleRegistrations = FALSE) { // Go to Online Registration tab $this->click("link=Online Registration"); $this->waitForElementPresent("_qf_Registration_upload-bottom"); @@ -256,7 +256,7 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { * @param $thankYouMsg * @param $eventTitle */ - function _testAddTellAFriend($subject, $thankYouMsg, $eventTitle) { + public function _testAddTellAFriend($subject, $thankYouMsg, $eventTitle) { // Go to Tell A Friend Tab $this->click('link=Tell a Friend'); $this->waitForElementPresent('_qf_Event_cancel-bottom'); diff --git a/tests/phpunit/WebTest/Export/ContactTest.php b/tests/phpunit/WebTest/Export/ContactTest.php index 9e9f598b57..7d1c9d8cee 100644 --- a/tests/phpunit/WebTest/Export/ContactTest.php +++ b/tests/phpunit/WebTest/Export/ContactTest.php @@ -35,7 +35,7 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase { parent::setUp(); } - function testPrefixGenderSuffix(){ + public function testPrefixGenderSuffix(){ $this->webtestLogin(); // Create new group @@ -148,7 +148,7 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase { /** * Test Contact Export. */ - function testContactExport() { + public function testContactExport() { $this->webtestLogin(); // Create new group @@ -258,7 +258,7 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase { $this->reviewCSV($csvFile, $checkHeaders, $checkRows, 2); } - function testMergeHousehold() { + public function testMergeHousehold() { $this->webtestLogin(); // Create new group @@ -417,7 +417,7 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase { * * @return array */ - function webtestAddContactWithGenderPrefixSuffix($fname = 'Anthony', $lname = 'Anderson', $email = NULL, $contactSubtype = NULL) { + public function webtestAddContactWithGenderPrefixSuffix($fname = 'Anthony', $lname = 'Anderson', $email = NULL, $contactSubtype = NULL) { $url = $this->sboxPath . 'civicrm/contact/add?reset=1&ct=Individual'; if ($contactSubtype) { $url = $url . "&cst={$contactSubtype}"; @@ -462,7 +462,7 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase { * * @return array|int */ - function getOptionLabel($optionGroupName,$optionValue){ + public function getOptionLabel($optionGroupName,$optionValue){ $params = array( 'version' => 3, 'sequential' => 1, diff --git a/tests/phpunit/WebTest/Export/ExportCiviSeleniumTestCase.php b/tests/phpunit/WebTest/Export/ExportCiviSeleniumTestCase.php index b2ba0fb794..1818148bf0 100644 --- a/tests/phpunit/WebTest/Export/ExportCiviSeleniumTestCase.php +++ b/tests/phpunit/WebTest/Export/ExportCiviSeleniumTestCase.php @@ -40,7 +40,7 @@ class ExportCiviSeleniumTestCase extends CiviSeleniumTestCase { * * @return string downloaded file path. */ - function downloadCSV($selector, $fileName = 'CiviCRM_Contact_Search.csv', $downloadDir = '/tmp') { + public function downloadCSV($selector, $fileName = 'CiviCRM_Contact_Search.csv', $downloadDir = '/tmp') { // File download path. $file = "{$downloadDir}/{$fileName}"; @@ -85,7 +85,7 @@ class ExportCiviSeleniumTestCase extends CiviSeleniumTestCase { * @param int $rowCount count rows (excluding header row). * @param array $settings used for override settings. */ - function reviewCSV($file, $checkColumns = array(), $checkRows = array(), $rowCount = 0, $settings = array()) { + public function reviewCSV($file, $checkColumns = array(), $checkRows = array(), $rowCount = 0, $settings = array()) { // Check file exists before proceed. $this->assertTrue(($file && file_exists($file)), "Not able to locate {$file}."); diff --git a/tests/phpunit/WebTest/Financial/FinancialAccountTest.php b/tests/phpunit/WebTest/Financial/FinancialAccountTest.php index 2eb97e26b3..a1a39328c1 100644 --- a/tests/phpunit/WebTest/Financial/FinancialAccountTest.php +++ b/tests/phpunit/WebTest/Financial/FinancialAccountTest.php @@ -35,7 +35,7 @@ class WebTest_Financial_FinancialAccountTest extends CiviSeleniumTestCase { /** * Test To Add Financial Account class attributes. */ - function testFinancialAccount() { + public function testFinancialAccount() { $this->webtestLogin(); // Add new Financial Account diff --git a/tests/phpunit/WebTest/Financial/FinancialAccountTypeTest.php b/tests/phpunit/WebTest/Financial/FinancialAccountTypeTest.php index 75e8992052..8b72ca9228 100644 --- a/tests/phpunit/WebTest/Financial/FinancialAccountTypeTest.php +++ b/tests/phpunit/WebTest/Financial/FinancialAccountTypeTest.php @@ -32,7 +32,7 @@ require_once 'CiviTest/CiviSeleniumTestCase.php'; */ class WebTest_Financial_FinancialAccountTypeTest extends CiviSeleniumTestCase { - function testFinancialAccount() { + public function testFinancialAccount() { // To Add Financial Account // class attributes. diff --git a/tests/phpunit/WebTest/Financial/FinancialBatchExport.php b/tests/phpunit/WebTest/Financial/FinancialBatchExport.php index 25c8e6f7d0..d6406db601 100644 --- a/tests/phpunit/WebTest/Financial/FinancialBatchExport.php +++ b/tests/phpunit/WebTest/Financial/FinancialBatchExport.php @@ -36,7 +36,7 @@ class WebTest_Financial_FinancialBatchExport extends CiviSeleniumTestCase { parent::setUp(); } - function testAddFinancialBatch() { + public function testAddFinancialBatch() { // Log in using webtestLogin() method $this->webtestLogin('admin'); $this->openCiviPage("financial/batch", "reset=1&action=add", '_qf_FinancialBatch_next-botttom'); @@ -66,7 +66,7 @@ class WebTest_Financial_FinancialBatchExport extends CiviSeleniumTestCase { * * @return null */ - function _testAddBatch($setTitle, $setDescription, $setPaymentInstrument, $numberOfTrxn, $totalAmt) { + public function _testAddBatch($setTitle, $setDescription, $setPaymentInstrument, $numberOfTrxn, $totalAmt) { // Enter Optional Constraints $this->type('title', $setTitle); $this->type('description', $setDescription); @@ -99,7 +99,7 @@ class WebTest_Financial_FinancialBatchExport extends CiviSeleniumTestCase { /** * @param $numberOfTrxn */ - function _testAssignBatch($numberOfTrxn) { + public function _testAssignBatch($numberOfTrxn) { $this->select( "xpath=//div[@id='crm-transaction-selector-assign_length']/label/select[@name='crm-transaction-selector-assign_length']", "value=$numberOfTrxn" ); // Because it tends to cause problems, all uses of sleep() must be justified in comments // Sleep should never be used for wait for anything to load from the server @@ -116,7 +116,7 @@ class WebTest_Financial_FinancialBatchExport extends CiviSeleniumTestCase { * @param int $batchId * @param $exportFormat */ - function _testExportBatch($setTitle, $batchId, $exportFormat) { + public function _testExportBatch($setTitle, $batchId, $exportFormat) { $this->openCiviPage("financial/batch", "reset=1&action=export&id=$batchId"); if ($exportFormat == 'CSV') { $this->click("xpath=//form[@id='FinancialBatch']/div[2]/table[@class='form-layout']/tbody/tr/td/input[2]"); diff --git a/tests/phpunit/WebTest/Generic/CheckActivityTest.php b/tests/phpunit/WebTest/Generic/CheckActivityTest.php index 85b624627a..68b2000530 100644 --- a/tests/phpunit/WebTest/Generic/CheckActivityTest.php +++ b/tests/phpunit/WebTest/Generic/CheckActivityTest.php @@ -35,7 +35,7 @@ class WebTest_Generic_CheckActivityTest extends CiviSeleniumTestCase { parent::setUp(); } - function testCheckDashboardElements() { + public function testCheckDashboardElements() { // Log in using webtestLogin() method $this->webtestLogin(); diff --git a/tests/phpunit/WebTest/Generic/CheckDashboardTest.php b/tests/phpunit/WebTest/Generic/CheckDashboardTest.php index 0b425110a2..9325851930 100644 --- a/tests/phpunit/WebTest/Generic/CheckDashboardTest.php +++ b/tests/phpunit/WebTest/Generic/CheckDashboardTest.php @@ -36,7 +36,7 @@ class WebTest_Generic_CheckDashboardTest extends CiviSeleniumTestCase { parent::setUp(); } - function testCheckDashboardElements() { + public function testCheckDashboardElements() { $this->webtestLogin(); @@ -55,7 +55,7 @@ class WebTest_Generic_CheckDashboardTest extends CiviSeleniumTestCase { * @param $widgetEnabledSelector * @param $widgetTitle */ - function _testAddDashboardElement($widgetConfigureID, $widgetEnabledSelector, $widgetTitle) { + public function _testAddDashboardElement($widgetConfigureID, $widgetEnabledSelector, $widgetTitle) { // Check if desired widget is already loaded on dashboard and remove it if it is so we can test adding it. // Because it tends to cause problems, all uses of sleep() must be justified in comments // Sleep should never be used for wait for anything to load from the server @@ -101,7 +101,7 @@ class WebTest_Generic_CheckDashboardTest extends CiviSeleniumTestCase { * @param int $widgetConfigureID * @param $widgetEnabledSelector */ - function _testRemoveDashboardElement($widgetConfigureID, $widgetEnabledSelector) { + public function _testRemoveDashboardElement($widgetConfigureID, $widgetEnabledSelector) { $this->click("link=Configure Your Dashboard"); $this->waitForElementPresent("dashlets-header-col-0"); $this->mouseDownAt("{$widgetConfigureID}", ""); @@ -129,7 +129,7 @@ class WebTest_Generic_CheckDashboardTest extends CiviSeleniumTestCase { $this->assertFalse($this->isElementPresent($widgetEnabledSelector)); } - function _testActivityDashlet() { + public function _testActivityDashlet() { // Add an activity that will show up in the widget $this->WebtestAddActivity(); $widgetTitle = "Activities"; diff --git a/tests/phpunit/WebTest/Generic/CheckFindTest.php b/tests/phpunit/WebTest/Generic/CheckFindTest.php index 7484523dd9..9c65bad830 100644 --- a/tests/phpunit/WebTest/Generic/CheckFindTest.php +++ b/tests/phpunit/WebTest/Generic/CheckFindTest.php @@ -35,7 +35,7 @@ class WebTest_Generic_CheckFindTest extends CiviSeleniumTestCase { parent::setUp(); } - function testCheckDashboardElements() { + public function testCheckDashboardElements() { $this->webtestLogin(); $this->openCiviPage("contact/search", "reset=1", "_qf_Basic_refresh"); diff --git a/tests/phpunit/WebTest/Generic/GeneralClickAroundTest.php b/tests/phpunit/WebTest/Generic/GeneralClickAroundTest.php index efea486f6b..3f9de523ce 100644 --- a/tests/phpunit/WebTest/Generic/GeneralClickAroundTest.php +++ b/tests/phpunit/WebTest/Generic/GeneralClickAroundTest.php @@ -35,12 +35,12 @@ class WebTest_Generic_GeneralClickAroundTest extends CiviSeleniumTestCase { parent::setUp(); } - function login() { + public function login() { $this->webtestLogin(); $this->openCiviPage(''); } - function testSearchMenu() { + public function testSearchMenu() { $this->login(); // click Search -> Find Contacts // Use class names for menu items since li array can change based on which components are enabled @@ -66,7 +66,7 @@ class WebTest_Generic_GeneralClickAroundTest extends CiviSeleniumTestCase { $this->assertText('search-status', 'Tagged IN Major Donor'); } - function testNewIndividual() { + public function testNewIndividual() { $this->login(); // Create New → Individual @@ -87,7 +87,7 @@ class WebTest_Generic_GeneralClickAroundTest extends CiviSeleniumTestCase { $this->assertTextPresent("Do not phone"); } - function testManageGroups() { + public function testManageGroups() { $this->login(); // Contacts → Manage Groups @@ -102,7 +102,7 @@ class WebTest_Generic_GeneralClickAroundTest extends CiviSeleniumTestCase { $this->assertTextPresent("Add Group"); } - function testContributionDashboard() { + public function testContributionDashboard() { $this->webtestLogin(); // Enable CiviContribute module if necessary $this->enableComponents("CiviContribute"); @@ -117,7 +117,7 @@ class WebTest_Generic_GeneralClickAroundTest extends CiviSeleniumTestCase { $this->assertTextPresent("Recent Contributions"); } - function testEventDashboard() { + public function testEventDashboard() { $this->webtestLogin(); // Enable CiviEvent module if necessary @@ -141,7 +141,7 @@ class WebTest_Generic_GeneralClickAroundTest extends CiviSeleniumTestCase { $this->assertTextPresent("Configure"); } - function testMembershipsDashboard() { + public function testMembershipsDashboard() { $this->webtestLogin(); // Enable CiviMember module if necessary @@ -158,7 +158,7 @@ class WebTest_Generic_GeneralClickAroundTest extends CiviSeleniumTestCase { $this->assertTextPresent("Find more members..."); } - function testFindContributions() { + public function testFindContributions() { $this->webtestLogin(); // Enable CiviContribute module if necessary @@ -183,7 +183,7 @@ class WebTest_Generic_GeneralClickAroundTest extends CiviSeleniumTestCase { $this->assertTextPresent("Currency"); } - function testNewMailing() { + public function testNewMailing() { $this->webtestLogin(); // Enable CiviMail module if necessary @@ -203,7 +203,7 @@ class WebTest_Generic_GeneralClickAroundTest extends CiviSeleniumTestCase { $this->assertElementPresent("excludeGroups"); } - function testConstituentReportSummary() { + public function testConstituentReportSummary() { $this->login(); // Constituent Report Summary @@ -227,7 +227,7 @@ class WebTest_Generic_GeneralClickAroundTest extends CiviSeleniumTestCase { $this->assertTextPresent("Total Row(s)"); } - function testCustomData() { + public function testCustomData() { $this->login(); // Use class names for menu items since li array can change based on which components are enabled @@ -249,7 +249,7 @@ class WebTest_Generic_GeneralClickAroundTest extends CiviSeleniumTestCase { $this->assertTextPresent("Post-form Help"); } - function testProfile() { + public function testProfile() { $this->login(); // Use class names for menu items since li array can change based on which components are enabled @@ -291,7 +291,7 @@ class WebTest_Generic_GeneralClickAroundTest extends CiviSeleniumTestCase { $this->assertTextPresent("Proximity Search"); } - function testTags() { + public function testTags() { $this->login(); // Use class names for menu items since li array can change based on which components are enabled @@ -307,7 +307,7 @@ class WebTest_Generic_GeneralClickAroundTest extends CiviSeleniumTestCase { $this->assertTextPresent("Volunteer"); } - function testActivityTypes() { + public function testActivityTypes() { $this->login(); // Use class names for menu items since li array can change based on which components are enabled @@ -324,7 +324,7 @@ class WebTest_Generic_GeneralClickAroundTest extends CiviSeleniumTestCase { $this->assertTextPresent("Membership Signup"); } - function testRelationshipTypes() { + public function testRelationshipTypes() { $this->login(); // Use class names for menu items since li array can change based on which components are enabled @@ -342,7 +342,7 @@ class WebTest_Generic_GeneralClickAroundTest extends CiviSeleniumTestCase { $this->assertTextPresent("Volunteer for"); } - function testMessageTemplates() { + public function testMessageTemplates() { $this->login(); // Use class names for menu items since li array can change based on which components are enabled diff --git a/tests/phpunit/WebTest/Grant/ContactContextAddTest.php b/tests/phpunit/WebTest/Grant/ContactContextAddTest.php index 71a6a7c4d7..ab30ea7a36 100644 --- a/tests/phpunit/WebTest/Grant/ContactContextAddTest.php +++ b/tests/phpunit/WebTest/Grant/ContactContextAddTest.php @@ -35,7 +35,7 @@ class WebTest_Grant_ContactContextAddTest extends CiviSeleniumTestCase { parent::setUp(); } - function testContactContextAddTest() { + public function testContactContextAddTest() { // Log in as admin first to verify permissions for CiviGrant $this->webtestLogin('admin'); diff --git a/tests/phpunit/WebTest/Grant/CustomFieldsetTest.php b/tests/phpunit/WebTest/Grant/CustomFieldsetTest.php index 081255353f..d981e5375a 100644 --- a/tests/phpunit/WebTest/Grant/CustomFieldsetTest.php +++ b/tests/phpunit/WebTest/Grant/CustomFieldsetTest.php @@ -35,7 +35,7 @@ class WebTest_Grant_CustomFieldsetTest extends CiviSeleniumTestCase { parent::setUp(); } - function testCustomFieldsetTest() { + public function testCustomFieldsetTest() { // Log in as admin first to verify permissions for CiviGrant $this->webtestLogin('admin'); @@ -106,7 +106,7 @@ class WebTest_Grant_CustomFieldsetTest extends CiviSeleniumTestCase { ); } - function testAjaxCustomGroupLoad() { + public function testAjaxCustomGroupLoad() { $this->webtestLogin(); // Enable CiviGrant module if necessary diff --git a/tests/phpunit/WebTest/Grant/StandaloneAddTest.php b/tests/phpunit/WebTest/Grant/StandaloneAddTest.php index 8936c0b248..d96856aebc 100644 --- a/tests/phpunit/WebTest/Grant/StandaloneAddTest.php +++ b/tests/phpunit/WebTest/Grant/StandaloneAddTest.php @@ -35,7 +35,7 @@ class WebTest_Grant_StandaloneAddTest extends CiviSeleniumTestCase { parent::setUp(); } - function testStandaloneGrantAdd() { + public function testStandaloneGrantAdd() { // Log in as admin first to verify permissions for CiviGrant $this->webtestLogin('admin'); diff --git a/tests/phpunit/WebTest/Import/ActivityTest.php b/tests/phpunit/WebTest/Import/ActivityTest.php index fdc701fccc..59c4b93878 100644 --- a/tests/phpunit/WebTest/Import/ActivityTest.php +++ b/tests/phpunit/WebTest/Import/ActivityTest.php @@ -35,7 +35,7 @@ class WebTest_Import_ActivityTest extends ImportCiviSeleniumTestCase { parent::setUp(); } - function testActivityImport() { + public function testActivityImport() { $this->webtestLogin(); @@ -53,7 +53,7 @@ class WebTest_Import_ActivityTest extends ImportCiviSeleniumTestCase { /** * @return array */ - function _activityCSVData() { + public function _activityCSVData() { $firstName1 = substr(sha1(rand()), 0, 7); $email1 = 'mail_' . substr(sha1(rand()), 0, 7) . '@example.com'; diff --git a/tests/phpunit/WebTest/Import/AddressImportTest.php b/tests/phpunit/WebTest/Import/AddressImportTest.php index ed8d03a1f7..880e531aa6 100644 --- a/tests/phpunit/WebTest/Import/AddressImportTest.php +++ b/tests/phpunit/WebTest/Import/AddressImportTest.php @@ -35,7 +35,7 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase { parent::setUp(); } - function testCustomAddressDataImport() { + public function testCustomAddressDataImport() { $this->webtestLogin(); $firstName1 = 'Ma_' . substr(sha1(rand()), 0, 7); @@ -73,7 +73,7 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase { * * @return array */ - function _individualCustomCSVData($customDataParams, $firstName1) { + public function _individualCustomCSVData($customDataParams, $firstName1) { $headers = array( 'first_name' => 'First Name', @@ -109,7 +109,7 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase { /** * @return array */ - function _addCustomData() { + public function _addCustomData() { $this->openCiviPage('admin/custom/group', 'reset=1'); @@ -293,7 +293,7 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase { * * @return array */ - function _createMultipleValueCustomField( $customFieldName, $type ){ + public function _createMultipleValueCustomField( $customFieldName, $type ){ $this->type('label', $customFieldName); $this->select("data_type[0]","value=0"); $this->select("data_type[1]","value=".$type); diff --git a/tests/phpunit/WebTest/Import/AddressParsingTest.php b/tests/phpunit/WebTest/Import/AddressParsingTest.php index 697223f97f..d2e80a6d1a 100644 --- a/tests/phpunit/WebTest/Import/AddressParsingTest.php +++ b/tests/phpunit/WebTest/Import/AddressParsingTest.php @@ -38,7 +38,7 @@ class WebTest_Import_AddressParsingTest extends ImportCiviSeleniumTestCase { /** * Check for Valid Street Address */ - function testValidStreetAddressParsing() { + public function testValidStreetAddressParsing() { $this->webtestLogin(); //Go to the URL of Address Setting to enable street address parsing option @@ -93,7 +93,7 @@ class WebTest_Import_AddressParsingTest extends ImportCiviSeleniumTestCase { /** * Check for Invalid Street Address */ - function testInvalidStreetAddressParsing() { + public function testInvalidStreetAddressParsing() { $this->webtestLogin(); //Go to the URL of Address Setting to enable street address parsing option @@ -149,7 +149,7 @@ class WebTest_Import_AddressParsingTest extends ImportCiviSeleniumTestCase { /** * Check Street Address when Address Parsing is Disabled */ - function testStreetAddress() { + public function testStreetAddress() { $this->webtestLogin(); //Go to the URL of Address Setting to enable street address parsing option @@ -187,7 +187,7 @@ class WebTest_Import_AddressParsingTest extends ImportCiviSeleniumTestCase { * * @return array */ - function _validStreetAddressCSVData() { + public function _validStreetAddressCSVData() { $headers = array( 'first_name' => 'First Name', 'middle_name' => 'Middle Name', @@ -237,7 +237,7 @@ class WebTest_Import_AddressParsingTest extends ImportCiviSeleniumTestCase { * * @return array */ - function _invalidStreetAddressCSVData() { + public function _invalidStreetAddressCSVData() { $headers = array( 'first_name' => 'First Name', 'middle_name' => 'Middle Name', diff --git a/tests/phpunit/WebTest/Import/ContactCustomDataTest.php b/tests/phpunit/WebTest/Import/ContactCustomDataTest.php index 4956098723..027e285a51 100644 --- a/tests/phpunit/WebTest/Import/ContactCustomDataTest.php +++ b/tests/phpunit/WebTest/Import/ContactCustomDataTest.php @@ -35,7 +35,7 @@ class WebTest_Import_ContactCustomDataTest extends ImportCiviSeleniumTestCase { parent::setUp(); } - function testCustomDataImport() { + public function testCustomDataImport() { $this->webtestLogin(); $firstName1 = 'Ma_' . substr(sha1(rand()), 0, 7); @@ -113,7 +113,7 @@ class WebTest_Import_ContactCustomDataTest extends ImportCiviSeleniumTestCase { * * @return array */ - function _individualCustomCSVData($customDataParams, $firstName1) { + public function _individualCustomCSVData($customDataParams, $firstName1) { $headers = array( 'first_name' => 'First Name', 'last_name' => 'Last Name', @@ -135,14 +135,14 @@ class WebTest_Import_ContactCustomDataTest extends ImportCiviSeleniumTestCase { * @param $originalRows * @param $checkSummary */ - function checkDuplicateContacts($originalHeaders, $originalRows, $checkSummary) { + public function checkDuplicateContacts($originalHeaders, $originalRows, $checkSummary) { $this->assertTrue($this->isTextPresent('CiviCRM has detected one record which is a duplicate of existing CiviCRM contact record. These records have not been imported.')); } /** * @return array */ - function _addCustomData() { + public function _addCustomData() { $this->openCiviPage("admin/custom/group", "reset=1"); diff --git a/tests/phpunit/WebTest/Import/ContactSubtypeTest.php b/tests/phpunit/WebTest/Import/ContactSubtypeTest.php index 6546912da1..464482d17a 100644 --- a/tests/phpunit/WebTest/Import/ContactSubtypeTest.php +++ b/tests/phpunit/WebTest/Import/ContactSubtypeTest.php @@ -38,7 +38,7 @@ class WebTest_Import_ContactSubtypeTest extends ImportCiviSeleniumTestCase { /* * Test contact import for Individuals Subtype. */ - function testIndividualSubtypeImport() { + public function testIndividualSubtypeImport() { $this->webtestLogin(); // Get sample import data. @@ -120,7 +120,7 @@ class WebTest_Import_ContactSubtypeTest extends ImportCiviSeleniumTestCase { /* * Test contact import for Organization Subtype. */ - function testOrganizationSubtypeImport() { + public function testOrganizationSubtypeImport() { $this->webtestLogin(); // Get sample import data. @@ -196,7 +196,7 @@ class WebTest_Import_ContactSubtypeTest extends ImportCiviSeleniumTestCase { /* * Test contact import for Household Subtype. */ - function testHouseholdSubtypeImport() { + public function testHouseholdSubtypeImport() { $this->webtestLogin(); // Create Household Subtype @@ -278,7 +278,7 @@ class WebTest_Import_ContactSubtypeTest extends ImportCiviSeleniumTestCase { /** * @return string */ - function _createHouseholdSubtype() { + public function _createHouseholdSubtype() { // Visit to create contact subtype $this->openCiviPage("admin/options/subtype", "action=add&reset=1"); @@ -298,7 +298,7 @@ class WebTest_Import_ContactSubtypeTest extends ImportCiviSeleniumTestCase { /** * @return array */ - function _individualSubtypeCSVData() { + public function _individualSubtypeCSVData() { $headers = array( 'first_name' => 'First Name', 'middle_name' => 'Middle Name', @@ -346,7 +346,7 @@ class WebTest_Import_ContactSubtypeTest extends ImportCiviSeleniumTestCase { /** * @return array */ - function _organizationSubtypeCSVData() { + public function _organizationSubtypeCSVData() { $headers = array( 'organization_name' => 'Organization Name', 'email' => 'Email', @@ -388,7 +388,7 @@ class WebTest_Import_ContactSubtypeTest extends ImportCiviSeleniumTestCase { /** * @return array */ - function _householdSubtypeCSVData() { + public function _householdSubtypeCSVData() { $headers = array( 'household_name' => 'Household Name', 'email' => 'Email', diff --git a/tests/phpunit/WebTest/Import/ContactTest.php b/tests/phpunit/WebTest/Import/ContactTest.php index 795b61a03a..4abc01383d 100644 --- a/tests/phpunit/WebTest/Import/ContactTest.php +++ b/tests/phpunit/WebTest/Import/ContactTest.php @@ -38,7 +38,7 @@ class WebTest_Import_ContactTest extends ImportCiviSeleniumTestCase { /* * Test contact import for Individuals. */ - function testIndividualImport() { + public function testIndividualImport() { $this->webtestLogin(); // Get sample import data. @@ -125,7 +125,7 @@ class WebTest_Import_ContactTest extends ImportCiviSeleniumTestCase { /* * Test contact import for Organization. */ - function testOrganizationImport() { + public function testOrganizationImport() { $this->webtestLogin(); @@ -206,7 +206,7 @@ class WebTest_Import_ContactTest extends ImportCiviSeleniumTestCase { /* * Test contact import for Household. */ - function testHouseholdImport() { + public function testHouseholdImport() { $this->webtestLogin(); @@ -290,7 +290,7 @@ class WebTest_Import_ContactTest extends ImportCiviSeleniumTestCase { /** * @return array */ - function _individualCSVData() { + public function _individualCSVData() { $headers = array( 'first_name' => 'First Name', 'middle_name' => 'Middle Name', @@ -338,7 +338,7 @@ class WebTest_Import_ContactTest extends ImportCiviSeleniumTestCase { /** * @return array */ - function _organizationCSVData() { + public function _organizationCSVData() { $headers = array( 'organization_name' => 'Organization Name', 'email' => 'Email', @@ -380,7 +380,7 @@ class WebTest_Import_ContactTest extends ImportCiviSeleniumTestCase { /** * @return array */ - function _householdCSVData() { + public function _householdCSVData() { $headers = array( 'household_name' => 'Household Name', 'email' => 'Email', diff --git a/tests/phpunit/WebTest/Import/ContributionTest.php b/tests/phpunit/WebTest/Import/ContributionTest.php index 40990750ef..b4062ffe4d 100644 --- a/tests/phpunit/WebTest/Import/ContributionTest.php +++ b/tests/phpunit/WebTest/Import/ContributionTest.php @@ -35,7 +35,7 @@ class WebTest_Import_ContributionTest extends ImportCiviSeleniumTestCase { parent::setUp(); } - function testContributionImportIndividual() { + public function testContributionImportIndividual() { $this->webtestLogin(); @@ -51,7 +51,7 @@ class WebTest_Import_ContributionTest extends ImportCiviSeleniumTestCase { $this->importCSVComponent('Contribution', $headers, $rows, 'Individual', 'Insert new contributions', $fieldMapper); } - function testContributionImportOrganization() { + public function testContributionImportOrganization() { $this->webtestLogin(); @@ -65,7 +65,7 @@ class WebTest_Import_ContributionTest extends ImportCiviSeleniumTestCase { $this->importCSVComponent('Contribution', $headers, $rows, 'Organization', 'Insert new contributions', $fieldMapper); } - function testContributionImportHousehold() { + public function testContributionImportHousehold() { $this->webtestLogin(); @@ -82,7 +82,7 @@ class WebTest_Import_ContributionTest extends ImportCiviSeleniumTestCase { /** * @return array */ - function _contributionIndividualCSVData() { + public function _contributionIndividualCSVData() { $firstName1 = substr(sha1(rand()), 0, 7); $email1 = 'mail_' . substr(sha1(rand()), 0, 7) . '@example.com'; $this->webtestAddContact($firstName1, 'Anderson', $email1); @@ -122,7 +122,7 @@ class WebTest_Import_ContributionTest extends ImportCiviSeleniumTestCase { /** * @return array */ - function _contributionHouseholdCSVData() { + public function _contributionHouseholdCSVData() { $household1 = substr(sha1(rand()), 0, 7) . ' home'; $this->webtestAddHousehold($household1, TRUE); @@ -160,7 +160,7 @@ class WebTest_Import_ContributionTest extends ImportCiviSeleniumTestCase { /** * @return array */ - function _contributionOrganizationCSVData() { + public function _contributionOrganizationCSVData() { $organization1 = substr(sha1(rand()), 0, 7) . ' org'; $this->webtestAddOrganization($organization1, TRUE); diff --git a/tests/phpunit/WebTest/Import/CustomDataTest.php b/tests/phpunit/WebTest/Import/CustomDataTest.php index c8f29eeeae..f5cd7aead9 100644 --- a/tests/phpunit/WebTest/Import/CustomDataTest.php +++ b/tests/phpunit/WebTest/Import/CustomDataTest.php @@ -35,7 +35,7 @@ class WebTest_Import_CustomDataTest extends ImportCiviSeleniumTestCase { parent::setUp(); } - function testCustomDataImport() { + public function testCustomDataImport() { $this->webtestLogin(); $firstName1 = 'Ma_' . substr(sha1(rand()), 0, 7); @@ -113,7 +113,7 @@ class WebTest_Import_CustomDataTest extends ImportCiviSeleniumTestCase { * * @return array */ - function _individualCustomCSVData($customGroupTitle, $firstName1, $firstName2, $id1, $id2) { + public function _individualCustomCSVData($customGroupTitle, $firstName1, $firstName2, $id1, $id2) { list($customDataParams, $customDataVerify) = $this->_addCustomData($customGroupTitle, $id1, $id2); $headers = array( @@ -155,7 +155,7 @@ class WebTest_Import_CustomDataTest extends ImportCiviSeleniumTestCase { * * @return array */ - function _addCustomData($customGroupTitle, $id1, $id2) { + public function _addCustomData($customGroupTitle, $id1, $id2) { $this->openCiviPage("admin/custom/group", "reset=1"); diff --git a/tests/phpunit/WebTest/Import/DateFormatTest.php b/tests/phpunit/WebTest/Import/DateFormatTest.php index c1897f82fe..0c5d5f60ba 100644 --- a/tests/phpunit/WebTest/Import/DateFormatTest.php +++ b/tests/phpunit/WebTest/Import/DateFormatTest.php @@ -38,7 +38,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase { /* * Test contact import for yyyy_mm_dd date format. */ - function testDateFormat_yyyy_mm_dd() { + public function testDateFormat_yyyy_mm_dd() { $this->webtestLogin(); // Get sample import data. @@ -53,7 +53,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase { /* * Test contact import for mm_dd_yy date format. */ - function testDateFormat_mm_dd_yy() { + public function testDateFormat_mm_dd_yy() { $this->webtestLogin(); // Get sample import data. @@ -69,7 +69,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase { /* * Test contact import for mm_dd_yyyy date format. */ - function testDateFormat_mm_dd_yyyy() { + public function testDateFormat_mm_dd_yyyy() { // Logging in. Remember to wait for page to load. In most cases, // you can rely on 30000 as the value that allows your test to pass, however, // sometimes your test might fail because of this. In such cases, it's better to pick one element @@ -90,7 +90,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase { /* * Test contact import for Month_dd_yyyy date format. */ - function testDateFormat_Month_dd_yyyy() { + public function testDateFormat_Month_dd_yyyy() { // Logging in. Remember to wait for page to load. In most cases, // you can rely on 30000 as the value that allows your test to pass, however, // sometimes your test might fail because of this. In such cases, it's better to pick one element @@ -111,7 +111,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase { /* * Test contact import for dd_mon_yy date format. */ - function testDateFormat_dd_mon_yy() { + public function testDateFormat_dd_mon_yy() { // Logging in. Remember to wait for page to load. In most cases, // you can rely on 30000 as the value that allows your test to pass, however, // sometimes your test might fail because of this. In such cases, it's better to pick one element @@ -132,7 +132,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase { /* * Test contact import for dd_mm_yyyy date format. */ - function testDateFormat_dd_mm_yyyy() { + public function testDateFormat_dd_mm_yyyy() { // Logging in. Remember to wait for page to load. In most cases, // you can rely on 30000 as the value that allows your test to pass, however, // sometimes your test might fail because of this. In such cases, it's better to pick one element @@ -156,7 +156,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase { /** * @return array */ - function _individualCSVData_yyyy_mm_dd() { + public function _individualCSVData_yyyy_mm_dd() { $headers = array( 'first_name' => 'First Name', 'middle_name' => 'Middle Name', @@ -207,7 +207,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase { /** * @return array */ - function _individualCSVData_mm_dd_yy() { + public function _individualCSVData_mm_dd_yy() { $headers = array( 'first_name' => 'First Name', 'middle_name' => 'Middle Name', @@ -258,7 +258,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase { /** * @return array */ - function _individualCSVData_mm_dd_yyyy() { + public function _individualCSVData_mm_dd_yyyy() { $headers = array( 'first_name' => 'First Name', 'middle_name' => 'Middle Name', @@ -309,7 +309,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase { /** * @return array */ - function _individualCSVData_Month_dd_yyyy() { + public function _individualCSVData_Month_dd_yyyy() { $headers = array( 'first_name' => 'First Name', 'middle_name' => 'Middle Name', @@ -360,7 +360,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase { /** * @return array */ - function _individualCSVData_dd_mon_yy() { + public function _individualCSVData_dd_mon_yy() { $headers = array( 'first_name' => 'First Name', 'middle_name' => 'Middle Name', @@ -411,7 +411,7 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase { /** * @return array */ - function _individualCSVData_dd_mm_yyyy() { + public function _individualCSVData_dd_mm_yyyy() { $headers = array( 'first_name' => 'First Name', 'middle_name' => 'Middle Name', diff --git a/tests/phpunit/WebTest/Import/DuplicateMatchingTest.php b/tests/phpunit/WebTest/Import/DuplicateMatchingTest.php index 7c248483ca..3bd45dd45c 100644 --- a/tests/phpunit/WebTest/Import/DuplicateMatchingTest.php +++ b/tests/phpunit/WebTest/Import/DuplicateMatchingTest.php @@ -38,7 +38,7 @@ class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase { /* * Test contact import for Individuals Duplicate Matching. */ - function testIndividualDuplicateMatchingImport() { + public function testIndividualDuplicateMatchingImport() { $this->webtestLogin(); $this->openCiviPage("contact/add", "reset=1&ct=Individual", 'first_name'); @@ -139,7 +139,7 @@ class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase { /* * Test contact import for Organization Duplicate Matching. */ - function testOrganizationDuplicateMatchingImport() { + public function testOrganizationDuplicateMatchingImport() { $this->webtestLogin(); //create oranization @@ -234,7 +234,7 @@ class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase { /* * Test contact import for Household Duplicate Matching. */ - function testHouseholdDuplicateMatchingImport() { + public function testHouseholdDuplicateMatchingImport() { $this->webtestLogin(); // create household @@ -332,7 +332,7 @@ class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase { * @param $originalRows * @param $checkSummary */ - function checkDuplicateContacts($originalHeaders, $originalRows, $checkSummary) { + public function checkDuplicateContacts($originalHeaders, $originalRows, $checkSummary) { $this->assertTrue($this->isTextPresent('CiviCRM has detected one record which is a duplicate of existing CiviCRM contact record. These records have not been imported.')); $checkSummary = array( @@ -355,7 +355,7 @@ class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase { * * @return array */ - function _individualDuplicateMatchingCSVData($individualFields) { + public function _individualDuplicateMatchingCSVData($individualFields) { $headers = array( 'first_name' => 'First Name', 'middle_name' => 'Middle Name', @@ -406,7 +406,7 @@ class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase { * * @return array */ - function _organizationDuplicateMatchingCSVData($organizationFields) { + public function _organizationDuplicateMatchingCSVData($organizationFields) { $headers = array( 'organization_name' => 'Organization Name', 'email' => 'Email', @@ -450,7 +450,7 @@ class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase { * * @return array */ - function _householdDuplicateMatchingCSVData($householdFields) { + public function _householdDuplicateMatchingCSVData($householdFields) { $headers = array( 'household_name' => 'Household Name', 'email' => 'Email', diff --git a/tests/phpunit/WebTest/Import/GroupTest.php b/tests/phpunit/WebTest/Import/GroupTest.php index c93384d5e2..2cf7cfbf40 100644 --- a/tests/phpunit/WebTest/Import/GroupTest.php +++ b/tests/phpunit/WebTest/Import/GroupTest.php @@ -38,7 +38,7 @@ class WebTest_Import_GroupTest extends ImportCiviSeleniumTestCase { /** * Test contact import for Individuals. */ - function testIndividualImportWithGroup() { + public function testIndividualImportWithGroup() { $this->webtestLogin(); // Get sample import data. @@ -96,7 +96,7 @@ class WebTest_Import_GroupTest extends ImportCiviSeleniumTestCase { * * @return array */ - function _individualGroupCSVData() { + public function _individualGroupCSVData() { $headers = array( 'first_name' => 'First Name', 'middle_name' => 'Middle Name', diff --git a/tests/phpunit/WebTest/Import/ImportCiviSeleniumTestCase.php b/tests/phpunit/WebTest/Import/ImportCiviSeleniumTestCase.php index e4f28cc27c..00a63a26a7 100644 --- a/tests/phpunit/WebTest/Import/ImportCiviSeleniumTestCase.php +++ b/tests/phpunit/WebTest/Import/ImportCiviSeleniumTestCase.php @@ -185,7 +185,7 @@ class ImportCiviSeleniumTestCase extends CiviSeleniumTestCase { * @param string $type import type (csv/sql) * @todo:currently only supports csv, need to work on sql import */ - function importContacts($headers, $rows, $contactType = 'Individual', $mode = 'Skip', $fieldMapper = array(), $other = array(), $type = 'csv') { + public function importContacts($headers, $rows, $contactType = 'Individual', $mode = 'Skip', $fieldMapper = array(), $other = array(), $type = 'csv') { // Go to contact import page. $this->openCiviPage("import/contact", "reset=1", "uploadFile"); @@ -438,7 +438,7 @@ class ImportCiviSeleniumTestCase extends CiviSeleniumTestCase { * * @return string */ - function _getImportComponentContactType($component, $contactType) { + public function _getImportComponentContactType($component, $contactType) { $importComponentMode = array( 'Event' => array( 'Individual' => 'CIVICRM_QFID_1_8', @@ -468,7 +468,7 @@ class ImportCiviSeleniumTestCase extends CiviSeleniumTestCase { * @param array $checkMapperHeaders * @param string $headerSelector */ - function _checkImportMapperData($headers, $rows, $existingMapping = NULL, $checkMapperHeaders = array(), $headerSelector = 'th') { + public function _checkImportMapperData($headers, $rows, $existingMapping = NULL, $checkMapperHeaders = array(), $headerSelector = 'th') { if (empty($checkMapperHeaders)) { $checkMapperHeaders = array( @@ -509,7 +509,7 @@ class ImportCiviSeleniumTestCase extends CiviSeleniumTestCase { * * @return array $contactIds imported contact ids */ - function _getImportedContactIds($rows, $contactType = 'Individual') { + public function _getImportedContactIds($rows, $contactType = 'Individual') { $contactIds = array(); foreach ($rows as $row) { @@ -553,7 +553,7 @@ class ImportCiviSeleniumTestCase extends CiviSeleniumTestCase { * @param array $headers * @param array $rows */ - function _formatContactCSVdata(&$headers, &$rows) { + public function _formatContactCSVdata(&$headers, &$rows) { if (!isset($headers['contact_relationships'])) { return; } diff --git a/tests/phpunit/WebTest/Import/MatchExternalIdTest.php b/tests/phpunit/WebTest/Import/MatchExternalIdTest.php index bf56e1760e..7bc0c14a8e 100644 --- a/tests/phpunit/WebTest/Import/MatchExternalIdTest.php +++ b/tests/phpunit/WebTest/Import/MatchExternalIdTest.php @@ -38,7 +38,7 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase { /** * Test participant import for Individuals matching on external identifier. */ - function testContributionImport() { + public function testContributionImport() { $this->webtestLogin(); // Get sample import data. @@ -51,7 +51,7 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase { /** * Test membership import for Individuals matching on external identifier. */ - function testMemberImportIndividual() { + public function testMemberImportIndividual() { $this->webtestLogin(); // Get membership import data for Individuals. @@ -64,7 +64,7 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase { /** * Test participant import for Individuals matching on external identifier. */ - function testParticipantImportIndividual() { + public function testParticipantImportIndividual() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -80,7 +80,7 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase { * * @return array */ - function _contributionIndividualCSVData() { + public function _contributionIndividualCSVData() { $firstName1 = substr(sha1(rand()), 0, 7); $lastName1 = substr(sha1(rand()), 0, 7); $externalId1 = substr(sha1(rand()), 0, 4); @@ -130,7 +130,7 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase { * * @return array */ - function _memberIndividualCSVData() { + public function _memberIndividualCSVData() { $memTypeParams = $this->webtestAddMembershipType(); $firstName1 = substr(sha1(rand()), 0, 7); @@ -179,7 +179,7 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase { * * @return array */ - function _participantIndividualCSVData() { + public function _participantIndividualCSVData() { $eventInfo = $this->_addNewEvent(); $firstName1 = substr(sha1(rand()), 0, 7); @@ -241,7 +241,7 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase { * * @return int external id */ - function _addContact($firstName, $lastName, $externalId) { + public function _addContact($firstName, $lastName, $externalId) { $this->openCiviPage('contact/add', 'reset=1&ct=Individual'); //fill in first name @@ -268,7 +268,7 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase { * * @return array event details of newly created event */ - function _addNewEvent($params = array()) { + public function _addNewEvent($params = array()) { if (empty($params)) { // Use default payment processor diff --git a/tests/phpunit/WebTest/Import/MemberTest.php b/tests/phpunit/WebTest/Import/MemberTest.php index 9710b2fab0..674205a17a 100644 --- a/tests/phpunit/WebTest/Import/MemberTest.php +++ b/tests/phpunit/WebTest/Import/MemberTest.php @@ -38,7 +38,7 @@ class WebTest_Import_MemberTest extends ImportCiviSeleniumTestCase { /** * Test participant import for Individuals. */ - function testMemberImportIndividual() { + public function testMemberImportIndividual() { $this->webtestLogin(); @@ -52,7 +52,7 @@ class WebTest_Import_MemberTest extends ImportCiviSeleniumTestCase { /** * Test participant import for Households. */ - function testMemberImportHousehold() { + public function testMemberImportHousehold() { $this->webtestLogin(); @@ -66,7 +66,7 @@ class WebTest_Import_MemberTest extends ImportCiviSeleniumTestCase { /** * Test participant import for Organizations. */ - function testMemberImportOrganization() { + public function testMemberImportOrganization() { $this->webtestLogin(); @@ -82,7 +82,7 @@ class WebTest_Import_MemberTest extends ImportCiviSeleniumTestCase { * * @return array */ - function _memberIndividualCSVData() { + public function _memberIndividualCSVData() { $memTypeParams = $this->webtestAddMembershipType(); $firstName1 = substr(sha1(rand()), 0, 7); @@ -128,7 +128,7 @@ class WebTest_Import_MemberTest extends ImportCiviSeleniumTestCase { * * @return array */ - function _memberHouseholdCSVData() { + public function _memberHouseholdCSVData() { $memTypeParams = $this->webtestAddMembershipType(); $household1 = substr(sha1(rand()), 0, 7) . ' home'; @@ -172,7 +172,7 @@ class WebTest_Import_MemberTest extends ImportCiviSeleniumTestCase { * * @return array */ - function _memberOrganizationCSVData() { + public function _memberOrganizationCSVData() { $memTypeParams = $this->webtestAddMembershipType(); $organization1 = substr(sha1(rand()), 0, 7) . ' org'; diff --git a/tests/phpunit/WebTest/Import/MultipleRelationshipTest.php b/tests/phpunit/WebTest/Import/MultipleRelationshipTest.php index c83816257d..753bea9f62 100644 --- a/tests/phpunit/WebTest/Import/MultipleRelationshipTest.php +++ b/tests/phpunit/WebTest/Import/MultipleRelationshipTest.php @@ -38,7 +38,7 @@ class WebTest_Import_MultipleRelationshipTest extends ImportCiviSeleniumTestCase /* * Test Multiple Relationship import for Individuals. */ - function testMultipleRelationshipImport() { + public function testMultipleRelationshipImport() { $this->webtestLogin(); // Get sample import data. @@ -56,7 +56,7 @@ class WebTest_Import_MultipleRelationshipTest extends ImportCiviSeleniumTestCase /** * @return array */ - function _individualRelationshipCSVData() { + public function _individualRelationshipCSVData() { $headers = array( 'first_name' => 'First Name', diff --git a/tests/phpunit/WebTest/Import/ParticipantTest.php b/tests/phpunit/WebTest/Import/ParticipantTest.php index 07029841e6..a047ca6ec2 100644 --- a/tests/phpunit/WebTest/Import/ParticipantTest.php +++ b/tests/phpunit/WebTest/Import/ParticipantTest.php @@ -38,7 +38,7 @@ class WebTest_Import_ParticipantTest extends ImportCiviSeleniumTestCase { /** * Test participant import for Individuals. */ - function testParticipantImportIndividual() { + public function testParticipantImportIndividual() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -59,7 +59,7 @@ class WebTest_Import_ParticipantTest extends ImportCiviSeleniumTestCase { /** * Test participant import for Organizations. */ - function testParticipantImportOrganization() { + public function testParticipantImportOrganization() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -80,7 +80,7 @@ class WebTest_Import_ParticipantTest extends ImportCiviSeleniumTestCase { /** * Test participant import for Households. */ - function testParticipantImportHousehold() { + public function testParticipantImportHousehold() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -103,7 +103,7 @@ class WebTest_Import_ParticipantTest extends ImportCiviSeleniumTestCase { * * @return array */ - function _participantIndividualCSVData() { + public function _participantIndividualCSVData() { $eventInfo = $this->_addNewEvent(); $firstName1 = substr(sha1(rand()), 0, 7); @@ -150,7 +150,7 @@ class WebTest_Import_ParticipantTest extends ImportCiviSeleniumTestCase { * * @return array */ - function _participantHouseholdCSVData() { + public function _participantHouseholdCSVData() { $eventInfo = $this->_addNewEvent(); $household1 = substr(sha1(rand()), 0, 7) . ' home'; @@ -194,7 +194,7 @@ class WebTest_Import_ParticipantTest extends ImportCiviSeleniumTestCase { * Helper function to provide data for participant import for Organization. * @return array */ - function _participantOrganizationCSVData() { + public function _participantOrganizationCSVData() { $eventInfo = $this->_addNewEvent(); $organization1 = substr(sha1(rand()), 0, 7) . ' org'; @@ -241,7 +241,7 @@ class WebTest_Import_ParticipantTest extends ImportCiviSeleniumTestCase { * * @return array $params event details of newly created event */ - function _addNewEvent($params = array()) { + public function _addNewEvent($params = array()) { if (empty($params)) { diff --git a/tests/phpunit/WebTest/Import/SavedMappingTest.php b/tests/phpunit/WebTest/Import/SavedMappingTest.php index 6316630aec..ed1dbd8da4 100644 --- a/tests/phpunit/WebTest/Import/SavedMappingTest.php +++ b/tests/phpunit/WebTest/Import/SavedMappingTest.php @@ -38,7 +38,7 @@ class WebTest_Import_SavedMappingTest extends ImportCiviSeleniumTestCase { /** * Test Saved Import Mapping for Individuals. */ - function testSaveIndividualMapping() { + public function testSaveIndividualMapping() { // Logging in. $this->webtestLogin(); @@ -87,7 +87,7 @@ class WebTest_Import_SavedMappingTest extends ImportCiviSeleniumTestCase { * * @return array */ - function _individualCSVData() { + public function _individualCSVData() { $headers = array( 'individual_prefix' => 'Individual Prefix', 'first_name' => 'First Name', diff --git a/tests/phpunit/WebTest/Import/TagTest.php b/tests/phpunit/WebTest/Import/TagTest.php index 5585ebc081..08472da327 100644 --- a/tests/phpunit/WebTest/Import/TagTest.php +++ b/tests/phpunit/WebTest/Import/TagTest.php @@ -38,7 +38,7 @@ class WebTest_Import_TagTest extends ImportCiviSeleniumTestCase { /* * Test contact import for Individuals. */ - function testContactImportWithTag() { + public function testContactImportWithTag() { $this->webtestLogin(); // Get sample import data. @@ -93,7 +93,7 @@ class WebTest_Import_TagTest extends ImportCiviSeleniumTestCase { * * @return array */ - function _contactTagCSVData() { + public function _contactTagCSVData() { $headers = array( 'first_name' => 'First Name', 'middle_name' => 'Middle Name', diff --git a/tests/phpunit/WebTest/Mailing/AddMessageTemplateTest.php b/tests/phpunit/WebTest/Mailing/AddMessageTemplateTest.php index 392f22052b..1aca0be8a4 100644 --- a/tests/phpunit/WebTest/Mailing/AddMessageTemplateTest.php +++ b/tests/phpunit/WebTest/Mailing/AddMessageTemplateTest.php @@ -39,7 +39,7 @@ class WebTest_Mailing_AddMessageTemplateTest extends CiviSeleniumTestCase { * @param bool $useTokens * @param null $msgTitle */ - function testTemplateAdd($useTokens = FALSE, $msgTitle = NULL) { + public function testTemplateAdd($useTokens = FALSE, $msgTitle = NULL) { $this->webtestLogin(); $this->openCiviPage("admin/messageTemplates/add", "action=add&reset=1"); @@ -87,7 +87,7 @@ class WebTest_Mailing_AddMessageTemplateTest extends CiviSeleniumTestCase { } } - function testAddMailingWithMessageTemplate() { + public function testAddMailingWithMessageTemplate() { // Call the above test to set up our environment $msgTitle = 'msg_' . substr(sha1(rand()), 0, 7); $this->testTemplateAdd(TRUE, $msgTitle); diff --git a/tests/phpunit/WebTest/Mailing/AddNewMailingComponentTest.php b/tests/phpunit/WebTest/Mailing/AddNewMailingComponentTest.php index 8bd33869e6..af07b05e07 100644 --- a/tests/phpunit/WebTest/Mailing/AddNewMailingComponentTest.php +++ b/tests/phpunit/WebTest/Mailing/AddNewMailingComponentTest.php @@ -35,7 +35,7 @@ class WebTest_Mailing_AddNewMailingComponentTest extends CiviSeleniumTestCase { parent::setUp(); } - function testHeaderAdd() { + public function testHeaderAdd() { $this->webtestLogin(); $this->openCiviPage("admin/component", "action=add&reset=1"); @@ -72,7 +72,7 @@ class WebTest_Mailing_AddNewMailingComponentTest extends CiviSeleniumTestCase { $this->assertTrue($this->isElementPresent("xpath=//table/tbody//tr/td[text()='{$componentName}']/../td[2][text()='Header']/../td[3][text()='{$subject}']/../td[4][text()='{$txtMsg}']/../td[5][text()='{$htmlMsg}']"), "The row doesn't consists of proper component details"); } - function testFooterAdd() { + public function testFooterAdd() { $this->webtestLogin(); $this->openCiviPage("admin/component", "action=add&reset=1"); @@ -109,7 +109,7 @@ class WebTest_Mailing_AddNewMailingComponentTest extends CiviSeleniumTestCase { $this->assertTrue($this->isElementPresent("xpath=//table/tbody//tr/td[text()='{$componentName}']/../td[2][text()='Footer']/../td[3][text()='{$subject}']/../td[4][text()='{$txtMsg}']/../td[5][text()='{$htmlMsg}']"), "The row doesn't consists of proper component details"); } - function testAutomatedAdd() { + public function testAutomatedAdd() { $this->webtestLogin(); $this->openCiviPage("admin/component", "action=add&reset=1"); diff --git a/tests/phpunit/WebTest/Mailing/MailingTest.php b/tests/phpunit/WebTest/Mailing/MailingTest.php index b9c995a89c..684a996fcc 100644 --- a/tests/phpunit/WebTest/Mailing/MailingTest.php +++ b/tests/phpunit/WebTest/Mailing/MailingTest.php @@ -35,7 +35,7 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase { parent::setUp(); } - function testAddMailing() { + public function testAddMailing() { $this->webtestLogin(); //----do create test mailing group @@ -286,7 +286,7 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase { // //------ end unsubscribe ------- } - function testAdvanceSearchAndReportCheck() { + public function testAdvanceSearchAndReportCheck() { $this->webtestLogin(); @@ -495,7 +495,7 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase { * @param $criteriaCheck * @param $mailingReportUrl */ - function criteriaCheck($criteriaCheck, $mailingReportUrl) { + public function criteriaCheck($criteriaCheck, $mailingReportUrl) { foreach($criteriaCheck as $key => $infoFilter) { foreach($infoFilter as $entity => $dataToCheck) { $this->open($mailingReportUrl); @@ -514,7 +514,7 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase { * @param $dataToCheck * @param $entity */ - function _verifyCriteria($summaryInfo, $dataToCheck, $entity) { + public function _verifyCriteria($summaryInfo, $dataToCheck, $entity) { foreach($dataToCheck as $key => $value) { if ($entity == 'report') { if ($key == 'report_name') { diff --git a/tests/phpunit/WebTest/Mailing/SpoolTest.php b/tests/phpunit/WebTest/Mailing/SpoolTest.php index e1814a41ec..977534311f 100644 --- a/tests/phpunit/WebTest/Mailing/SpoolTest.php +++ b/tests/phpunit/WebTest/Mailing/SpoolTest.php @@ -38,7 +38,7 @@ class WebTest_Mailing_SpoolTest extends CiviSeleniumTestCase { parent::setUp(); } - function testSpooledMailing() { + public function testSpooledMailing() { $this->webtestLogin(); diff --git a/tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php b/tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php index f3e35a7b6e..5e35541615 100644 --- a/tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php +++ b/tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php @@ -35,7 +35,7 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase { parent::setUp(); } - function testMemberAdd() { + public function testMemberAdd() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -152,7 +152,7 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase { /** * @param array $memTypeParams */ - function _addMembership($memTypeParams) { + public function _addMembership($memTypeParams) { // click through to the membership view screen $this->click("css=li#tab_member a"); $this->waitForElementPresent("link=Add Membership"); @@ -189,7 +189,7 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase { * @param $profileTitle * @param array $customDataParams */ - function _addProfile($profileTitle, $customDataParams) { + public function _addProfile($profileTitle, $customDataParams) { $this->openCiviPage("admin/uf/group", "reset=1"); @@ -227,7 +227,7 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase { /** * @return array */ - function _addCustomData() { + public function _addCustomData() { $customGroupTitle = 'Custom_' . substr(sha1(rand()), 0, 4); $this->openCiviPage('admin/custom/group', 'reset=1'); diff --git a/tests/phpunit/WebTest/Member/ContactContextAddTest.php b/tests/phpunit/WebTest/Member/ContactContextAddTest.php index 94e9f33e65..c31ede79e9 100644 --- a/tests/phpunit/WebTest/Member/ContactContextAddTest.php +++ b/tests/phpunit/WebTest/Member/ContactContextAddTest.php @@ -35,7 +35,7 @@ class WebTest_Member_ContactContextAddTest extends CiviSeleniumTestCase { parent::setUp(); } - function testContactMemberAdd() { + public function testContactMemberAdd() { $this->webtestLogin(); // Create a membership type to use for this test (defaults for this helper function are rolling 1 year membership) @@ -158,7 +158,7 @@ class WebTest_Member_ContactContextAddTest extends CiviSeleniumTestCase { $this->webtestVerifyTabularData($verifyData); } - function testMemberAddWithLifeTimeMembershipType() { + public function testMemberAddWithLifeTimeMembershipType() { $this->webtestLogin(); // Create a membership type to use for this test (defaults for this helper function are rolling 1 year membership) diff --git a/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php b/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php index 7f2123c742..ad9aa67f97 100755 --- a/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php +++ b/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php @@ -35,7 +35,7 @@ class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase parent::setUp(); } - function testDefaultPricesetSelection() { + public function testDefaultPricesetSelection() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -130,7 +130,7 @@ class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase * @param array $contactParams * @param $streetAddress */ - function contactInfoFill($firstName, $lastName, $email, $contactParams, $streetAddress) { + public function contactInfoFill($firstName, $lastName, $email, $contactParams, $streetAddress) { //Credit Card Info $this->select("credit_card_type", "value=Visa"); $this->type("credit_card_number", "4111111111111111"); @@ -152,7 +152,7 @@ class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase * @param $priceSetSection * @param $optionNumber */ - function checkOptions($priceSetSection, $optionNumber) { + public function checkOptions($priceSetSection, $optionNumber) { $this->assertChecked("xpath=//div[@id='priceset']/div[@class='crm-section {$priceSetSection}']/div[2]/div[{$optionNumber}]/span/input"); } @@ -160,7 +160,7 @@ class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase * @param $priceSetSection * @param $optionNumber */ - function _testDefaultSenarios($priceSetSection, $optionNumber) { + public function _testDefaultSenarios($priceSetSection, $optionNumber) { $this->click("xpath=//div[@id='priceset']/div[@class='crm-section {$priceSetSection}']/div[2]/div[{$optionNumber}]/span/input"); } @@ -170,7 +170,7 @@ class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase * @param null $contributionType * @param $setHelp */ - function _testAddSet($setTitle, $usedFor, $contributionType = NULL, $setHelp) { + public function _testAddSet($setTitle, $usedFor, $contributionType = NULL, $setHelp) { $this->openCiviPage("admin/price", "reset=1&action=add", '_qf_Set_next-bottom'); // Enter Priceset fields (Title, Used For ...) @@ -205,7 +205,7 @@ class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase * * @return array */ - function _testAddPriceFields(&$fields, &$validateString, $dateSpecificFields = FALSE, $title, $sid, $defaultPriceSet = FALSE, $contributionType) { + public function _testAddPriceFields(&$fields, &$validateString, $dateSpecificFields = FALSE, $title, $sid, $defaultPriceSet = FALSE, $contributionType) { if ($defaultPriceSet) { $memTypeTitle1 = 'General'; diff --git a/tests/phpunit/WebTest/Member/EditMembershipTest.php b/tests/phpunit/WebTest/Member/EditMembershipTest.php index 16f64b6d20..32a931cf13 100644 --- a/tests/phpunit/WebTest/Member/EditMembershipTest.php +++ b/tests/phpunit/WebTest/Member/EditMembershipTest.php @@ -34,7 +34,7 @@ class WebTest_Member_EditMembershipTest extends CiviSeleniumTestCase { parent::setUp(); } - function testEditMembershipActivityTypes() { + public function testEditMembershipActivityTypes() { // Log in using webtestLogin() method $this->webtestLogin(); // create contact diff --git a/tests/phpunit/WebTest/Member/FixedMembershipTypeTest.php b/tests/phpunit/WebTest/Member/FixedMembershipTypeTest.php index 12a5c34a34..1840815c90 100644 --- a/tests/phpunit/WebTest/Member/FixedMembershipTypeTest.php +++ b/tests/phpunit/WebTest/Member/FixedMembershipTypeTest.php @@ -35,7 +35,7 @@ class WebTest_Member_FixedMembershipTypeTest extends CiviSeleniumTestCase { parent::setUp(); } - function testMembershipTypeScenario1() { + public function testMembershipTypeScenario1() { // Scenario 1 // Rollover Date < Start Date // Join Date > Rollover Date and Join Date < Start Date @@ -191,7 +191,7 @@ SELECT end_event_adjust_interval ); } - function testMembershipTypeScenario2() { + public function testMembershipTypeScenario2() { // Scenario 2 // Rollover Date < Join Date @@ -347,7 +347,7 @@ SELECT end_event_adjust_interval ); } - function testMembershipTypeScenario3() { + public function testMembershipTypeScenario3() { // Scenario 3 // Standard Fixed scenario - Jan 1 Fixed Period Start and October 31 rollover // Join Date is later than Rollover Date @@ -496,7 +496,7 @@ SELECT end_event_adjust_interval ); } - function testMembershipTypeScenario4() { + public function testMembershipTypeScenario4() { // Scenario 4 // Standard Fixed scenario - Jan 1 Fixed Period Start and October 31 rollover // Join Date is earlier than Rollover Date diff --git a/tests/phpunit/WebTest/Member/InheritedMembershipTest.php b/tests/phpunit/WebTest/Member/InheritedMembershipTest.php index d816b8e224..99d33b295d 100644 --- a/tests/phpunit/WebTest/Member/InheritedMembershipTest.php +++ b/tests/phpunit/WebTest/Member/InheritedMembershipTest.php @@ -34,7 +34,7 @@ class WebTest_Member_InheritedMembershipTest extends CiviSeleniumTestCase { parent::setUp(); } - function testInheritedMembership() { + public function testInheritedMembership() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -262,7 +262,7 @@ class WebTest_Member_InheritedMembershipTest extends CiviSeleniumTestCase { * Webtest for CRM-10146 * */ - function testInheritedMembershipActivity() { + public function testInheritedMembershipActivity() { // Log in using webtestLogin() method $this->webtestLogin(); diff --git a/tests/phpunit/WebTest/Member/OfflineAutoRenewMembershipTest.php b/tests/phpunit/WebTest/Member/OfflineAutoRenewMembershipTest.php index a58ccb43e1..aedeb87a1c 100644 --- a/tests/phpunit/WebTest/Member/OfflineAutoRenewMembershipTest.php +++ b/tests/phpunit/WebTest/Member/OfflineAutoRenewMembershipTest.php @@ -35,7 +35,7 @@ class WebTest_Member_OfflineAutoRenewMembershipTest extends CiviSeleniumTestCase parent::setUp(); } - function testOfflineAutoRenewMembership() { + public function testOfflineAutoRenewMembership() { $this->webtestLogin(); // We need a payment processor diff --git a/tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php b/tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php index b3fc6b8234..a860a92ab2 100644 --- a/tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php +++ b/tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php @@ -35,7 +35,7 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa parent::setUp(); } - function testAddPriceSet() { + public function testAddPriceSet() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -80,7 +80,7 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa $this->_testSignUpOrRenewMembership($sid, $contactParams, $memTypeTitle1, $memTypeTitle2, $renew = TRUE); } - function testAddPriceSetWithMultipleTerms() { + public function testAddPriceSetWithMultipleTerms() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -172,7 +172,7 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa * @param null $contributionType * @param $setHelp */ - function _testAddSet($setTitle, $usedFor, $contributionType = NULL, $setHelp) { + public function _testAddSet($setTitle, $usedFor, $contributionType = NULL, $setHelp) { $this->openCiviPage('admin/price', 'reset=1&action=add', '_qf_Set_next-bottom'); // Enter Priceset fields (Title, Used For ...) @@ -206,7 +206,7 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa * * @return array */ - function _testAddPriceFields(&$fields, &$validateString, $dateSpecificFields = FALSE, $title, $sid, $contributionType) { + public function _testAddPriceFields(&$fields, &$validateString, $dateSpecificFields = FALSE, $title, $sid, $contributionType) { $memTypeParams1 = $this->webtestAddMembershipType(); $memTypeTitle1 = $memTypeParams1['membership_type']; @@ -272,7 +272,7 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa * @param $validateStrings * @param int $sid */ - function _testVerifyPriceSet($validateStrings, $sid) { + public function _testVerifyPriceSet($validateStrings, $sid) { // verify Price Set at Preview page // start at Manage Price Sets listing $this->openCiviPage('admin/price', 'reset=1'); @@ -294,7 +294,7 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa * @param $memTypeTitle2 * @param bool $renew */ - function _testSignUpOrRenewMembership($sid, $contactParams, $memTypeTitle1, $memTypeTitle2, $renew = FALSE) { + public function _testSignUpOrRenewMembership($sid, $contactParams, $memTypeTitle1, $memTypeTitle2, $renew = FALSE) { //build the membership dates. require_once 'CRM/Core/Config.php'; require_once 'CRM/Utils/Array.php'; @@ -381,7 +381,7 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa * @param $memTypeTitle1 * @param $term */ - function _testMultilpeTermsMembershipRegistration($sid, $contactParams, $memTypeTitle1, $term){ + public function _testMultilpeTermsMembershipRegistration($sid, $contactParams, $memTypeTitle1, $term){ //build the membership dates. require_once 'CRM/Core/Config.php'; require_once 'CRM/Utils/Array.php'; diff --git a/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php b/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php index f46866607a..35f688614f 100644 --- a/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php +++ b/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php @@ -35,7 +35,7 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase { parent::setUp(); } - function testOfflineMembershipRenew() { + public function testOfflineMembershipRenew() { $this->webtestLogin(); // make sure period is correct for the membership type we testing for, @@ -120,7 +120,7 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase { $this->webtestVerifyTabularData($verifyMembershipRenewData); } - function testOfflineMemberRenewOverride() { + public function testOfflineMemberRenewOverride() { $this->webtestLogin(); // add membership type @@ -224,7 +224,7 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase { $this->webtestVerifyTabularData($verifyMembershipRenewOverrideData); } - function testOfflineMembershipRenewChangeType() { + public function testOfflineMembershipRenewChangeType() { $this->webtestLogin(); // make sure period is correct for the membership type we testing for, @@ -322,7 +322,7 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase { $this->webtestVerifyTabularData($verifyMembershipData); } - function testOfflineMembershipRenewMultipleTerms() { + public function testOfflineMembershipRenewMultipleTerms() { $this->webtestLogin(); // make sure period is correct for the membership type we testing for, diff --git a/tests/phpunit/WebTest/Member/OnlineAutoRenewMembershipGCTest.php b/tests/phpunit/WebTest/Member/OnlineAutoRenewMembershipGCTest.php index e533eac652..a32038e0f2 100644 --- a/tests/phpunit/WebTest/Member/OnlineAutoRenewMembershipGCTest.php +++ b/tests/phpunit/WebTest/Member/OnlineAutoRenewMembershipGCTest.php @@ -35,7 +35,7 @@ class WebTest_Member_OnlineAutoRenewMembershipGCTest extends CiviSeleniumTestCas parent::setUp(); } - function testOnlineAutoRenewMembershipAnonymous() { + public function testOnlineAutoRenewMembershipAnonymous() { //configure membership signup page. $pageId = $this->_configureMembershipPage(); @@ -65,7 +65,7 @@ class WebTest_Member_OnlineAutoRenewMembershipGCTest extends CiviSeleniumTestCas // has changed a bit. No point in adding test for external page as we 'll test with fake transactions. } - function testOnlineAutoRenewMembershipAuthenticated() { + public function testOnlineAutoRenewMembershipAuthenticated() { //configure membership signup page. $pageId = $this->_configureMembershipPage(); @@ -101,7 +101,7 @@ class WebTest_Member_OnlineAutoRenewMembershipGCTest extends CiviSeleniumTestCas /** * @return null */ - function _configureMembershipPage() { + public function _configureMembershipPage() { static $pageId = NULL; if (!$pageId) { diff --git a/tests/phpunit/WebTest/Member/OnlineAutoRenewMembershipTest.php b/tests/phpunit/WebTest/Member/OnlineAutoRenewMembershipTest.php index 715c1b97ee..09b0ce5e68 100644 --- a/tests/phpunit/WebTest/Member/OnlineAutoRenewMembershipTest.php +++ b/tests/phpunit/WebTest/Member/OnlineAutoRenewMembershipTest.php @@ -35,7 +35,7 @@ class WebTest_Member_OnlineAutoRenewMembershipTest extends CiviSeleniumTestCase parent::setUp(); } - function testOnlineAutoRenewMembershipAnonymous() { + public function testOnlineAutoRenewMembershipAnonymous() { //configure membership signup page. $pageId = $this->_configureMembershipPage(); @@ -64,7 +64,7 @@ class WebTest_Member_OnlineAutoRenewMembershipTest extends CiviSeleniumTestCase $this->assertElementContainsText("xpath=//div[@class='crm-group amount_display-group']/div[2]/strong[3]", $text, 'Missing text: ' . $text); } - function testOnlineAutoRenewMembershipAuthenticated() { + public function testOnlineAutoRenewMembershipAuthenticated() { //configure membership signup page. $pageId = $this->_configureMembershipPage(); @@ -97,7 +97,7 @@ class WebTest_Member_OnlineAutoRenewMembershipTest extends CiviSeleniumTestCase $this->assertElementContainsText("xpath=//div[@class='crm-group amount_display-group']/div[2]/strong[3]", $text, 'Missing text: ' . $text); } - function testOnlinePendingAutoRenewMembershipAnonymous() { + public function testOnlinePendingAutoRenewMembershipAnonymous() { //configure membership signup page. $pageId = $this->_configureMembershipPage(); @@ -128,7 +128,7 @@ class WebTest_Member_OnlineAutoRenewMembershipTest extends CiviSeleniumTestCase /** * @return null */ - function _configureMembershipPage() { + public function _configureMembershipPage() { static $pageId = NULL; if (!$pageId) { diff --git a/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php b/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php index bccdf85b5e..ac122178d2 100644 --- a/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php +++ b/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php @@ -35,7 +35,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas parent::setUp(); } - function testAddPriceSet() { + public function testAddPriceSet() { // add the required permission $permissions = array('edit-1-make-online-contributions'); $this->changePermissions($permissions); @@ -87,7 +87,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas $this->_testSignUpOrRenewMembership($pageId, $contactParams, $memTypeTitle1, $memTypeTitle2, $renew = TRUE); } - function testAddPriceSetWithMultipleTerms() { + public function testAddPriceSetWithMultipleTerms() { // add the required permission $permissions = array('edit-1-make-online-contributions'); $this->changePermissions($permissions); @@ -187,7 +187,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas * @param null $contributionType * @param $setHelp */ - function _testAddSet($setTitle, $usedFor, $contributionType = NULL, $setHelp) { + public function _testAddSet($setTitle, $usedFor, $contributionType = NULL, $setHelp) { $this->openCiviPage('admin/price', 'reset=1&action=add', '_qf_Set_next-bottom'); // Enter Priceset fields (Title, Used For ...) @@ -222,7 +222,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas * * @return array */ - function _testAddPriceFields(&$fields, &$validateString, $dateSpecificFields = FALSE, $title, $sid, $contributionType) { + public function _testAddPriceFields(&$fields, &$validateString, $dateSpecificFields = FALSE, $title, $sid, $contributionType) { $memTypeParams1 = $this->webtestAddMembershipType(); $memTypeTitle1 = $memTypeParams1['membership_type']; $memTypeId1 = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/table/tbody//tr/td[1][text()='{$memTypeTitle1}']/../td[12]/span/a[3]@href")); @@ -286,7 +286,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas * @param $validateStrings * @param int $sid */ - function _testVerifyPriceSet($validateStrings, $sid) { + public function _testVerifyPriceSet($validateStrings, $sid) { // verify Price Set at Preview page // start at Manage Price Sets listing $this->openCiviPage('admin/price', 'reset=1'); @@ -305,7 +305,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas * @param $memTypeTitle2 * @param bool $renew */ - function _testSignUpOrRenewMembership($pageId, $contactParams, $memTypeTitle1, $memTypeTitle2, $renew = FALSE) { + public function _testSignUpOrRenewMembership($pageId, $contactParams, $memTypeTitle1, $memTypeTitle2, $renew = FALSE) { $this->webtestLogout(); $this->openCiviPage('contribute/transact', "reset=1&id=$pageId", '_qf_Main_upload-bottom'); @@ -415,7 +415,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas * @param $term * @param bool $renew */ - function _testMultilpeTermsMembershipRegistration($pageId, $contactParams, $memTypeTitle1, $term, $renew = FALSE){ + public function _testMultilpeTermsMembershipRegistration($pageId, $contactParams, $memTypeTitle1, $term, $renew = FALSE){ if($renew){ $this->openCiviPage('member/search', 'reset=1', 'member_end_date_high'); $this->type("sort_name", "{$contactParams['first_name']} {$contactParams['last_name']}"); diff --git a/tests/phpunit/WebTest/Member/OnlineMembershipCreateTest.php b/tests/phpunit/WebTest/Member/OnlineMembershipCreateTest.php index 1f24bb2537..d0c175be1b 100644 --- a/tests/phpunit/WebTest/Member/OnlineMembershipCreateTest.php +++ b/tests/phpunit/WebTest/Member/OnlineMembershipCreateTest.php @@ -35,7 +35,7 @@ class WebTest_Member_OnlineMembershipCreateTest extends CiviSeleniumTestCase { parent::setUp(); } - function testOnlineMembershipCreate() { + public function testOnlineMembershipCreate() { //check for online contribution and profile listings permissions $permissions = array("edit-1-make-online-contributions", "edit-1-profile-listings-and-forms"); $this->changePermissions($permissions); @@ -190,7 +190,7 @@ class WebTest_Member_OnlineMembershipCreateTest extends CiviSeleniumTestCase { * @param $hash * @param bool $otherAmount */ - function _testOnlineMembershipSignup($pageId, $memTypeId, $firstName, $lastName, $payLater, $hash, $otherAmount = FALSE) { + public function _testOnlineMembershipSignup($pageId, $memTypeId, $firstName, $lastName, $payLater, $hash, $otherAmount = FALSE) { //Open Live Contribution Page $this->openCiviPage("contribute/transact", "reset=1&id=$pageId", "_qf_Main_upload-bottom"); // Select membership type 1 @@ -251,7 +251,7 @@ class WebTest_Member_OnlineMembershipCreateTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); } - function testOnlineMembershipCreateWithContribution() { + public function testOnlineMembershipCreateWithContribution() { //login with admin credentials & make sure we do have required permissions. $permissions = array("edit-1-make-online-contributions", "edit-1-profile-listings-and-forms"); $this->changePermissions($permissions); diff --git a/tests/phpunit/WebTest/Member/OnlineMembershipRenewTest.php b/tests/phpunit/WebTest/Member/OnlineMembershipRenewTest.php index d95e277905..e15963202f 100644 --- a/tests/phpunit/WebTest/Member/OnlineMembershipRenewTest.php +++ b/tests/phpunit/WebTest/Member/OnlineMembershipRenewTest.php @@ -38,7 +38,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase { /** * FIXME: This test tries to update a contribution page (id=2) that may not exist :( */ - function testOnlineMembershipRenew() { + public function testOnlineMembershipRenew() { // a random 7-char string and an even number to make this pass unique $hash = substr(sha1(rand()), 0, 7); $rand = 2 * rand(2, 50); @@ -212,7 +212,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase { /** * FIXME: This test tries to update a contribution page (id=2) that may not exist :( */ - function testOnlineMembershipRenewChangeType() { + public function testOnlineMembershipRenewChangeType() { // a random 7-char string and an even number to make this pass unique $hash = substr(sha1(rand()), 0, 7); $rand = 2 * rand(2, 50); @@ -360,7 +360,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase { $this->assertEquals($membershipCreatedId, $membershipRenewedId); } - function testUpdateInheritedMembershipOnBehalfOfRenewal() { + public function testUpdateInheritedMembershipOnBehalfOfRenewal() { // Log in as admin $this->webtestLogin('admin'); diff --git a/tests/phpunit/WebTest/Member/SeperateMembershipPaymentTest.php b/tests/phpunit/WebTest/Member/SeperateMembershipPaymentTest.php index 14ff61f628..fd85a91811 100644 --- a/tests/phpunit/WebTest/Member/SeperateMembershipPaymentTest.php +++ b/tests/phpunit/WebTest/Member/SeperateMembershipPaymentTest.php @@ -35,7 +35,7 @@ class WebTest_Member_SeperateMembershipPaymentTest extends CiviSeleniumTestCase parent::setUp(); } - function testSeperateMembershipCreate() { + public function testSeperateMembershipCreate() { // a random 7-char string and an even number to make this pass unique $hash = substr(sha1(rand()), 0, 7); $rand = 2 * rand(2, 50); @@ -148,7 +148,7 @@ class WebTest_Member_SeperateMembershipPaymentTest extends CiviSeleniumTestCase * @param int $memTypeId * @param int $cid */ - function _testOnlineMembershipSignup($pageId, $memTypeId, $cid = NULL) { + public function _testOnlineMembershipSignup($pageId, $memTypeId, $cid = NULL) { //Open Live Contribution Page $args = array('reset' => 1, 'id' => $pageId); if ($cid) { diff --git a/tests/phpunit/WebTest/Member/StandaloneAddTest.php b/tests/phpunit/WebTest/Member/StandaloneAddTest.php index 76696f54f8..618b60b2e2 100644 --- a/tests/phpunit/WebTest/Member/StandaloneAddTest.php +++ b/tests/phpunit/WebTest/Member/StandaloneAddTest.php @@ -35,7 +35,7 @@ class WebTest_Member_StandaloneAddTest extends CiviSeleniumTestCase { parent::setUp(); } - function testStandaloneMemberAdd() { + public function testStandaloneMemberAdd() { $this->webtestLogin(); @@ -88,7 +88,7 @@ class WebTest_Member_StandaloneAddTest extends CiviSeleniumTestCase { $this->webtestVerifyTabularData($expected); } - function testStandaloneGiftMembership() { + public function testStandaloneGiftMembership() { $this->webtestLogin(); @@ -156,7 +156,7 @@ class WebTest_Member_StandaloneAddTest extends CiviSeleniumTestCase { } - function testStandaloneMemberOverrideAdd() { + public function testStandaloneMemberOverrideAdd() { $this->webtestLogin(); @@ -235,7 +235,7 @@ class WebTest_Member_StandaloneAddTest extends CiviSeleniumTestCase { $this->webtestVerifyTabularData($expected); } - function testAjaxCustomGroupLoad() { + public function testAjaxCustomGroupLoad() { $this->webtestLogin(); $triggerElement = array('name' => 'membership_type_id_1', 'type' => 'select'); $customSets = array( diff --git a/tests/phpunit/WebTest/Member/UpdateMembershipScriptTest.php b/tests/phpunit/WebTest/Member/UpdateMembershipScriptTest.php index bfaa62d4dd..9eae2d513f 100644 --- a/tests/phpunit/WebTest/Member/UpdateMembershipScriptTest.php +++ b/tests/phpunit/WebTest/Member/UpdateMembershipScriptTest.php @@ -35,7 +35,7 @@ class WebTest_Member_UpdateMembershipScriptTest extends CiviSeleniumTestCase { parent::setUp(); } - function testAddMembership() { + public function testAddMembership() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -87,7 +87,7 @@ class WebTest_Member_UpdateMembershipScriptTest extends CiviSeleniumTestCase { /** * @return array */ - function addMembershipType() { + public function addMembershipType() { $membershipTitle = substr(sha1(rand()), 0, 7); $membershipOrg = $membershipTitle . ' memorg'; $this->webtestAddOrganization($membershipOrg, TRUE); diff --git a/tests/phpunit/WebTest/Pledge/AddCancelPaymentTest.php b/tests/phpunit/WebTest/Pledge/AddCancelPaymentTest.php index e221dd3182..30a5f40c00 100644 --- a/tests/phpunit/WebTest/Pledge/AddCancelPaymentTest.php +++ b/tests/phpunit/WebTest/Pledge/AddCancelPaymentTest.php @@ -35,7 +35,7 @@ class WebTest_Pledge_AddCancelPaymentTest extends CiviSeleniumTestCase { parent::setUp(); } - function testAddCancelPayment() { + public function testAddCancelPayment() { $this->webtestLogin(); $this->openCiviPage('pledge/add', 'reset=1&context=standalone', '_qf_Pledge_upload'); diff --git a/tests/phpunit/WebTest/Pledge/ContactContextAddTest.php b/tests/phpunit/WebTest/Pledge/ContactContextAddTest.php index 047d283bee..ad0e3c57a6 100644 --- a/tests/phpunit/WebTest/Pledge/ContactContextAddTest.php +++ b/tests/phpunit/WebTest/Pledge/ContactContextAddTest.php @@ -35,7 +35,7 @@ class WebTest_Pledge_ContactContextAddTest extends CiviSeleniumTestCase { parent::setUp(); } - function testContactContextAddTest() { + public function testContactContextAddTest() { $this->webtestLogin(); // Disable pop-ups for this test. Running test w/ pop-ups causes a spurious failure. dgg $this->enableDisablePopups(FALSE); diff --git a/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php b/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php index ac2193f83a..a366cb6c20 100644 --- a/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php +++ b/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php @@ -35,7 +35,7 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest parent::setUp(); } - function testAddPledgePaymentWithAdjustPledgePaymentSchedule() { + public function testAddPledgePaymentWithAdjustPledgePaymentSchedule() { $this->webtestLogin(); $this->openCiviPage('admin/setting/localization', 'reset=1'); $this->select("currencyLimit-f","value=FJD"); @@ -206,7 +206,7 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest $this->enableDisablePopups(TRUE); } - function testAddPledgePaymentWithAdjustTotalPledgeAmount() { + public function testAddPledgePaymentWithAdjustTotalPledgeAmount() { $this->webtestLogin(); // Disable pop-ups for this test. Running test w/ pop-ups causes a spurious failure. dgg $this->enableDisablePopups(FALSE); @@ -353,7 +353,7 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest $this->enableDisablePopups(TRUE); } - function testAddPledgePayment() { + public function testAddPledgePayment() { $this->webtestLogin(); // Disable pop-ups for this test. Running test w/ pop-ups causes a spurious failure. dgg $this->enableDisablePopups(FALSE); diff --git a/tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php b/tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php index 7f8d907375..afa5d2d33c 100644 --- a/tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php +++ b/tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php @@ -35,7 +35,7 @@ class WebTest_Pledge_StandaloneAddDeleteTest extends CiviSeleniumTestCase { parent::setUp(); } - function testStandalonePledgeAddDelete() { + public function testStandalonePledgeAddDelete() { $this->webtestLogin(); $this->openCiviPage('pledge/add', 'reset=1&context=standalone', '_qf_Pledge_upload'); diff --git a/tests/phpunit/WebTest/Pledge/StandaloneAddTest.php b/tests/phpunit/WebTest/Pledge/StandaloneAddTest.php index 106870ee48..1edae47636 100644 --- a/tests/phpunit/WebTest/Pledge/StandaloneAddTest.php +++ b/tests/phpunit/WebTest/Pledge/StandaloneAddTest.php @@ -35,7 +35,7 @@ class WebTest_Pledge_StandaloneAddTest extends CiviSeleniumTestCase { parent::setUp(); } - function testStandalonePledgeAdd() { + public function testStandalonePledgeAdd() { $this->webtestLogin(); $this->openCiviPage('pledge/add', 'reset=1&context=standalone', '_qf_Pledge_upload'); diff --git a/tests/phpunit/WebTest/Profile/BatchUpdateTest.php b/tests/phpunit/WebTest/Profile/BatchUpdateTest.php index 85389296d2..de76fd93ce 100644 --- a/tests/phpunit/WebTest/Profile/BatchUpdateTest.php +++ b/tests/phpunit/WebTest/Profile/BatchUpdateTest.php @@ -35,7 +35,7 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { parent::setUp(); } - function testBatchUpdateWithContactSubtypes() { + public function testBatchUpdateWithContactSubtypes() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -122,7 +122,7 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->verifyText($xpath, preg_quote("Staff")); } - function testBatchUpdate() { + public function testBatchUpdate() { // Log in using webtestLogin() method $this->webtestLogin(); @@ -570,7 +570,7 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { * @param $customDataArr * @param $profileFor */ - function _addProfile($profileTitle, $customDataArr, $profileFor) { + public function _addProfile($profileTitle, $customDataArr, $profileFor) { $this->openCiviPage('admin/uf/group', 'reset=1'); @@ -605,7 +605,7 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { * * @return array */ - function _addCustomData($profileFor) { + public function _addCustomData($profileFor) { $returnArray = array(); $customGroupTitle = 'Custom_' . substr(sha1(rand()), 0, 4); diff --git a/tests/phpunit/WebTest/Profile/DedupeTest.php b/tests/phpunit/WebTest/Profile/DedupeTest.php index ca24b6c140..6b8ca1dbc4 100644 --- a/tests/phpunit/WebTest/Profile/DedupeTest.php +++ b/tests/phpunit/WebTest/Profile/DedupeTest.php @@ -35,7 +35,7 @@ class WebTest_Profile_DedupeTest extends CiviSeleniumTestCase { parent::setUp(); } - function testProfileCreateDupeStrictDefault() { + public function testProfileCreateDupeStrictDefault() { // lets give profile related permision to anonymous user. $permission = array('edit-1-profile-create', 'edit-1-profile-edit', 'edit-1-profile-listings', 'edit-1-profile-view'); $this->changePermissions($permission); diff --git a/tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php b/tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php index 6db8841764..d2ebb6b7fc 100644 --- a/tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php +++ b/tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php @@ -34,13 +34,13 @@ class WebTest_Profile_MultiRecordProfileAddTest extends CiviSeleniumTestCase { protected function setUp() { parent::setUp(); } - function testAdminAddNewProfile() { + public function testAdminAddNewProfile() { $this->webtestLogin(); list($id, $profileTitle) = $this->_addNewProfile(); $this->_deleteProfile($id, $profileTitle); } - function testUserAddNewProfile() { + public function testUserAddNewProfile() { //add the required permission $permissions = array( 'edit-2-profile-listings-and-forms', @@ -52,13 +52,13 @@ class WebTest_Profile_MultiRecordProfileAddTest extends CiviSeleniumTestCase { $this->_deleteProfile($id, $profileTitle); } - function testAddNewNonMultiProfile() { + public function testAddNewNonMultiProfile() { $this->webtestLogin(); list($id, $profileTitle) = $this->_addNewProfile(FALSE); $this->_deleteProfile($id, $profileTitle); } - function testNonSearchableMultiProfile() { + public function testNonSearchableMultiProfile() { $this->webtestLogin(); list($id, $profileTitle) = $this->_addNewProfile(TRUE, TRUE); $this->_deleteProfile($id, $profileTitle); @@ -71,7 +71,7 @@ class WebTest_Profile_MultiRecordProfileAddTest extends CiviSeleniumTestCase { * * @return array */ - function _addNewProfile($checkMultiRecord = TRUE, $checkSearchable = FALSE, $userCheck = FALSE) { + public function _addNewProfile($checkMultiRecord = TRUE, $checkSearchable = FALSE, $userCheck = FALSE) { $params = $this->_testCustomAdd($checkSearchable); $this->openCiviPage('admin/uf/group', 'reset=1'); @@ -284,7 +284,7 @@ class WebTest_Profile_MultiRecordProfileAddTest extends CiviSeleniumTestCase { * @param int $gid * @param $profileTitle */ - function _deleteProfile($gid, $profileTitle) { + public function _deleteProfile($gid, $profileTitle) { $this->webtestLogin(); $this->openCiviPage("admin/uf/group", "action=delete&id={$gid}", '_qf_Group_next-bottom'); $this->click('_qf_Group_next-bottom'); @@ -297,7 +297,7 @@ class WebTest_Profile_MultiRecordProfileAddTest extends CiviSeleniumTestCase { * * @return mixed */ - function _testCustomAdd($checkSearchable) { + public function _testCustomAdd($checkSearchable) { $this->openCiviPage('admin/custom/group', 'action=add&reset=1'); @@ -371,7 +371,7 @@ class WebTest_Profile_MultiRecordProfileAddTest extends CiviSeleniumTestCase { * * @return mixed */ - function _addRecords($context = 'Edit', $dialog = FALSE) { + public function _addRecords($context = 'Edit', $dialog = FALSE) { $params['text'] = 'text' . substr(sha1(rand()), 0, 3); $this->waitForElementPresent("//div[@id='crm-profile-block']/div/div[2]/input[@class='crm-form-text required']"); $this->type("//div[@id='crm-profile-block']/div/div[2]/input[@class='crm-form-text required']", $params['text']); diff --git a/tests/phpunit/WebTest/Profile/ProfileAddTest.php b/tests/phpunit/WebTest/Profile/ProfileAddTest.php index cff2d3121d..ef03f5be42 100644 --- a/tests/phpunit/WebTest/Profile/ProfileAddTest.php +++ b/tests/phpunit/WebTest/Profile/ProfileAddTest.php @@ -35,7 +35,7 @@ class WebTest_Profile_ProfileAddTest extends CiviSeleniumTestCase { parent::setUp(); } - function testAddNewProfile() { + public function testAddNewProfile() { $this->webtestLogin(); // Add new profile. @@ -121,7 +121,7 @@ class WebTest_Profile_ProfileAddTest extends CiviSeleniumTestCase { $this->_testdeleteProfile($profileTitle); } - function testProfileAddContactstoGroup() { + public function testProfileAddContactstoGroup() { $this->webtestLogin(); $permissions = array("edit-1-profile-listings-and-forms"); @@ -235,7 +235,7 @@ class WebTest_Profile_ProfileAddTest extends CiviSeleniumTestCase { /** * @param $profileTitle */ - function _testdeleteProfile($profileTitle) { + public function _testdeleteProfile($profileTitle) { //$this->waitForPageToLoad($this->getTimeoutMsec()); $this->waitForElementPresent("xpath=//div[@id='user-profiles']/div/div/table/tbody//tr/td/span[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul//li/a[text()='Delete']"); $this->click("xpath=//div[@id='user-profiles']/div/div/table/tbody//tr/td/span[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul//li/a[text()='Delete']"); @@ -251,7 +251,7 @@ class WebTest_Profile_ProfileAddTest extends CiviSeleniumTestCase { * Test to check profile description field * which has a rich text editor (CKEditor) */ - function testCheckDescAndCreatedIdFields() { + public function testCheckDescAndCreatedIdFields() { // Log in using webtestLogin() method $this->webtestLogin(); diff --git a/tests/phpunit/WebTest/Profile/ProfileCountryState.php b/tests/phpunit/WebTest/Profile/ProfileCountryState.php index b29f208f6c..6f666c5a85 100644 --- a/tests/phpunit/WebTest/Profile/ProfileCountryState.php +++ b/tests/phpunit/WebTest/Profile/ProfileCountryState.php @@ -35,7 +35,7 @@ class WebTest_Profile_ProfileCountryState extends CiviSeleniumTestCase { parent::setUp(); } - function testStateCountry() { + public function testStateCountry() { $this->webtestLogin(); $config = CRM_Core_Config::singleton(); // Add new profile. diff --git a/tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php b/tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php index 8c42b85305..2af6d7fc83 100644 --- a/tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php +++ b/tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php @@ -35,7 +35,7 @@ class WebTest_Profile_ProfileGroupSubscriptionTest extends CiviSeleniumTestCase parent::setUp(); } - function testProfileGroupSubscription() { + public function testProfileGroupSubscription() { $this->webtestLogin(); // Add new profile. @@ -135,7 +135,7 @@ class WebTest_Profile_ProfileGroupSubscriptionTest extends CiviSeleniumTestCase /** * @param $profileTitle */ - function _testdeleteProfile($profileTitle) { + public function _testdeleteProfile($profileTitle) { $this->waitForElementPresent("xpath=//div[@id='user-profiles']/div/div[1]/table/tbody//tr/td[1]/span[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul/li[5]/a[text()='Delete']"); $this->click("xpath=//div[@id='user-profiles']/div/div[1]/table/tbody//tr/td[1]/span[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul/li[5]/a[text()='Delete']"); $this->waitForElementPresent('_qf_Group_next-bottom'); diff --git a/tests/phpunit/WebTest/Profile/SearchTest.php b/tests/phpunit/WebTest/Profile/SearchTest.php index 7620cc7aa1..2e1cc5208d 100644 --- a/tests/phpunit/WebTest/Profile/SearchTest.php +++ b/tests/phpunit/WebTest/Profile/SearchTest.php @@ -35,7 +35,7 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase { parent::setUp(); } - function testSearchProfile() { + public function testSearchProfile() { $this->webtestLogin(); // enable county field diff --git a/tests/phpunit/WebTest/Release/InstallScript.php b/tests/phpunit/WebTest/Release/InstallScript.php index dc686c1221..e8d00431e3 100644 --- a/tests/phpunit/WebTest/Release/InstallScript.php +++ b/tests/phpunit/WebTest/Release/InstallScript.php @@ -39,7 +39,7 @@ class WebTest_Release_InstallScript extends WebTest_Release_ReleaseTestCase { parent::setUp(); } - function testInstall() { + public function testInstall() { $this->webtestLogin(); $this->open($this->settings->installURL); diff --git a/tests/phpunit/WebTest/Release/UpgradeScript.php b/tests/phpunit/WebTest/Release/UpgradeScript.php index 1cbc7e967e..db5b213065 100644 --- a/tests/phpunit/WebTest/Release/UpgradeScript.php +++ b/tests/phpunit/WebTest/Release/UpgradeScript.php @@ -39,7 +39,7 @@ class WebTest_Release_UpgradeScript extends WebTest_Release_ReleaseTestCase { parent::setUp(); } - function testUpgrade() { + public function testUpgrade() { $this->webtestLogin(); $this->open($this->settings->upgradeURL); $this->waitForTextPresent("Upgrade CiviCRM to Version"); diff --git a/tests/phpunit/WebTest/Report/AddTest.php b/tests/phpunit/WebTest/Report/AddTest.php index 7e5516f2ef..9bbe51a39c 100644 --- a/tests/phpunit/WebTest/Report/AddTest.php +++ b/tests/phpunit/WebTest/Report/AddTest.php @@ -35,7 +35,7 @@ class WebTest_Report_AddTest extends CiviSeleniumTestCase { parent::setUp(); } - function testAddReport() { + public function testAddReport() { $this->webtestLogin(); // create contact diff --git a/tests/phpunit/WebTest/Report/DonarReportTest.php b/tests/phpunit/WebTest/Report/DonarReportTest.php index a085c1485d..d3cd45c066 100644 --- a/tests/phpunit/WebTest/Report/DonarReportTest.php +++ b/tests/phpunit/WebTest/Report/DonarReportTest.php @@ -35,7 +35,7 @@ class WebTest_Report_DonarReportTest extends CiviSeleniumTestCase { parent::setUp(); } - function testDonarReportPager() { + public function testDonarReportPager() { $this->webtestLogin(); // now create new donar detail report instance diff --git a/tests/phpunit/WebTest/Report/LoggingReportTest.php b/tests/phpunit/WebTest/Report/LoggingReportTest.php index e7c3a59238..febed4d7a3 100644 --- a/tests/phpunit/WebTest/Report/LoggingReportTest.php +++ b/tests/phpunit/WebTest/Report/LoggingReportTest.php @@ -35,7 +35,7 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase { parent::setUp(); } - function testLoggingReport() { + public function testLoggingReport() { $this->webtestLogin(); //enable the logging @@ -274,7 +274,7 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase { /** * @param $data */ - function verifyReportData($data) { + public function verifyReportData($data) { foreach ($data as $value) { // check for the row contains proper data $actionPath = ($value['action'] == 'Update') ? "td[1]/a[2]" : "td[1][contains(text(), '{$value['action']}')]"; @@ -292,7 +292,7 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase { * @param $dataForReportDetail * @param array $filters */ - function detailReportCheck($dataForReportDetail, $filters = array()) { + public function detailReportCheck($dataForReportDetail, $filters = array()) { foreach ($dataForReportDetail as $value) { $this->waitForElementPresent("xpath=//table/tbody//tr/td[2][contains(text(), '{$value['log_type']}')]/../td[4]/a[contains(text(), '{$value['altered_contact']}')]/../../td[1]/a[2]"); $this->click("xpath=//table/tbody//tr/td[2][contains(text(), '{$value['log_type']}')]/../td[4]/a[contains(text(), '{$value['altered_contact']}')]/../../td[1]/a[2]"); diff --git a/tests/phpunit/WebTest/Report/RolePermissionReportTest.php b/tests/phpunit/WebTest/Report/RolePermissionReportTest.php index 1d0743ba0f..a3a23aa006 100644 --- a/tests/phpunit/WebTest/Report/RolePermissionReportTest.php +++ b/tests/phpunit/WebTest/Report/RolePermissionReportTest.php @@ -35,7 +35,7 @@ class WebTest_Report_RolePermissionReportTest extends CiviSeleniumTestCase { parent::setUp(); } - function testRolePermissionReport() { + public function testRolePermissionReport() { $this->webtestLogin('admin'); //create new roles @@ -98,7 +98,7 @@ class WebTest_Report_RolePermissionReportTest extends CiviSeleniumTestCase { /* *check for CRM-10148 */ - function testReservedReportPermission() { + public function testReservedReportPermission() { $this->webtestLogin('admin'); //create new role @@ -207,7 +207,7 @@ class WebTest_Report_RolePermissionReportTest extends CiviSeleniumTestCase { /** * @param $role */ - function _roleDelete($role) { + public function _roleDelete($role) { $this->waitForElementPresent("xpath=//table[@id='user-roles']/tbody//tr/td[text()='{$role}']/..//td/a[text()='edit role']"); $this->click("xpath=//table[@id='user-roles']/tbody//tr/td[text()='{$role}']/..//td/a[text()='edit role']"); $this->waitForElementPresent('edit-delete'); @@ -222,7 +222,7 @@ class WebTest_Report_RolePermissionReportTest extends CiviSeleniumTestCase { * * @return string */ - function _testCreateUser($roleid) { + public function _testCreateUser($roleid) { $this->open($this->sboxPath . "admin/people/create"); diff --git a/tests/phpunit/WebTest/Utils/RestTest.php b/tests/phpunit/WebTest/Utils/RestTest.php index 5bff1f02f9..fd569b2a86 100644 --- a/tests/phpunit/WebTest/Utils/RestTest.php +++ b/tests/phpunit/WebTest/Utils/RestTest.php @@ -79,7 +79,7 @@ class WebTest_Utils_RestTest extends CiviSeleniumTestCase { * * @return array; each item is a list of parameters for testAPICalls */ - function apiTestCases() { + public function apiTestCases() { $cases = array(); // entity,action: omit apiKey, valid entity+action @@ -190,7 +190,7 @@ class WebTest_Utils_RestTest extends CiviSeleniumTestCase { /** * @dataProvider apiTestCases */ - function testAPICalls($query, $is_error) { + public function testAPICalls($query, $is_error) { $client = CRM_Utils_HttpClient::singleton(); list($status, $data) = $client->post($this->url, $query); $this->assertEquals(CRM_Utils_HttpClient::STATUS_OK, $status); @@ -206,7 +206,7 @@ class WebTest_Utils_RestTest extends CiviSeleniumTestCase { * Submit a request with an API key that exists but does not correspond to * a real user. Submit in "?entity=X&action=X" notation */ - function testNotCMSUser_entityAction() { + public function testNotCMSUser_entityAction() { $client = CRM_Utils_HttpClient::singleton(); //Create contact with api_key @@ -238,7 +238,7 @@ class WebTest_Utils_RestTest extends CiviSeleniumTestCase { * Submit a request with an API key that exists but does not correspond to * a real user. Submit in "?q=civicrm/$entity/$action" notation */ - function testNotCMSUser_q() { + public function testNotCMSUser_q() { $client = CRM_Utils_HttpClient::singleton(); //Create contact with api_key diff --git a/tests/phpunit/api/v3/ACLCachingTest.php b/tests/phpunit/api/v3/ACLCachingTest.php index a28434c903..94b63774ee 100644 --- a/tests/phpunit/api/v3/ACLCachingTest.php +++ b/tests/phpunit/api/v3/ACLCachingTest.php @@ -41,21 +41,21 @@ class api_v3_ACLCachingTest extends CiviUnitTestCase { public $DBResetRequired = FALSE; - function setUp() { + public function setUp() { parent::setUp(); } /** * (non-PHPdoc) * @see CiviUnitTestCase::tearDown() */ - function tearDown() { + public function tearDown() { $tablesToTruncate = array( 'civicrm_activity', ); $this->quickCleanup($tablesToTruncate, TRUE); } - function testActivityCreateCustomBefore() { + public function testActivityCreateCustomBefore() { $values = $this->callAPISuccess('custom_field', 'getoptions', array('field' => 'custom_group_id',)); $this->assertTrue($values['count'] == 0); $this->CustomGroupCreate(array('extends' => 'Activity')); diff --git a/tests/phpunit/api/v3/ACLPermissionTest.php b/tests/phpunit/api/v3/ACLPermissionTest.php index 86a53784ae..82978f90d3 100644 --- a/tests/phpunit/api/v3/ACLPermissionTest.php +++ b/tests/phpunit/api/v3/ACLPermissionTest.php @@ -48,7 +48,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { protected $_entity; - function setUp() { + public function setUp() { parent::setUp(); $baoObj = new CRM_Core_DAO(); $baoObj->createTestObject('CRM_Pledge_BAO_Pledge', array(), 1, 0); @@ -62,7 +62,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { * (non-PHPdoc) * @see CiviUnitTestCase::tearDown() */ - function tearDown() { + public function tearDown() { CRM_Utils_Hook::singleton()->reset(); $tablesToTruncate = array( 'civicrm_contact', @@ -83,7 +83,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { /** * Function tests that an empty where hook returns no results */ - function testContactGetNoResultsHook() { + public function testContactGetNoResultsHook() { $this->hookClass->setHook('civicrm_aclWhereClause', array($this, 'aclWhereHookNoResults')); $result = $this->callAPISuccess('contact', 'get', array( 'check_permissions' => 1, @@ -95,7 +95,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { /** * Function tests all results are returned */ - function testContactGetAllResultsHook() { + public function testContactGetAllResultsHook() { $this->hookClass->setHook('civicrm_aclWhereClause', array($this, 'aclWhereHookAllResults')); $result = $this->callAPISuccess('contact', 'get', array( 'check_permissions' => 1, @@ -108,7 +108,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { /** * Function tests that deleted contacts are not returned */ - function testContactGetPermissionHookNoDeleted() { + public function testContactGetPermissionHookNoDeleted() { $this->callAPISuccess('contact', 'create', array('id' => 2, 'is_deleted' => 1)); $this->hookClass->setHook('civicrm_aclWhereClause', array($this, 'aclWhereHookAllResults')); $result = $this->callAPISuccess('contact', 'get', array( @@ -121,7 +121,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { /** * Test permissions limited by hook */ - function testContactGetHookLimitingHook() { + public function testContactGetHookLimitingHook() { $this->hookClass->setHook('civicrm_aclWhereClause', array($this, 'aclWhereOnlySecond')); $result = $this->callAPISuccess('contact', 'get', array( @@ -134,7 +134,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { /** * Confirm that without check permissions we still get 2 contacts returned */ - function testContactGetHookLimitingHookDontCheck() { + public function testContactGetHookLimitingHookDontCheck() { // $result = $this->callAPISuccess('contact', 'get', array( 'check_permissions' => 0, @@ -146,7 +146,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { /** * Check that id works as a filter */ - function testContactGetIDFilter() { + public function testContactGetIDFilter() { $this->hookClass->setHook('civicrm_aclWhereClause', array($this, 'aclWhereHookAllResults')); $result = $this->callAPISuccess('contact', 'get', array( 'sequential' => 1, @@ -161,7 +161,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { /** * Check that address IS returned */ - function testContactGetAddressReturned() { + public function testContactGetAddressReturned() { $this->hookClass->setHook('civicrm_aclWhereClause', array($this, 'aclWhereOnlySecond')); $fullresult = $this->callAPISuccess('contact', 'get', array( 'sequential' => 1, @@ -195,7 +195,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { /** * Check that pledge IS not returned */ - function testContactGetPledgeIDNotReturned() { + public function testContactGetPledgeIDNotReturned() { $this->hookClass->setHook('civicrm_aclWhereClause', array($this, 'aclWhereHookAllResults')); $this->callAPISuccess('contact', 'get', array( 'sequential' => 1, @@ -211,7 +211,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { /** * Check that pledge IS not an allowable filter */ - function testContactGetPledgeIDNotFiltered() { + public function testContactGetPledgeIDNotFiltered() { $this->hookClass->setHook('civicrm_aclWhereClause', array($this, 'aclWhereHookAllResults')); $this->callAPISuccess('contact', 'get', array( 'sequential' => 1, @@ -227,7 +227,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { /** * Check that chaining doesn't bypass permissions */ - function testContactGetPledgeNotChainable() { + public function testContactGetPledgeNotChainable() { $this->hookClass->setHook('civicrm_aclWhereClause', array($this, 'aclWhereOnlySecond')); $this->callAPISuccess('contact', 'get', array( 'sequential' => 1, @@ -241,7 +241,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { ); } - function setupCoreACL() { + public function setupCoreACL() { $this->createLoggedInUser(); $this->_permissionedDisabledGroup = $this->groupCreate(array('title' => 'pick-me-disabled', 'is_active' => 0, 'name' => 'pick-me-disabled')); $this->_permissionedGroup = $this->groupCreate(array('title' => 'pick-me-active', 'is_active' => 1, 'name' => 'pick-me-active')); @@ -251,7 +251,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { * @dataProvider entities * confirm that without check permissions we still get 2 contacts returned */ - function testEntitiesGetHookLimitingHookNoCheck($entity) { + public function testEntitiesGetHookLimitingHookNoCheck($entity) { CRM_Core_Config::singleton()->userPermissionClass->permissions = array(); $this->setUpEntities($entity); $this->hookClass->setHook('civicrm_aclWhereClause', array($this, 'aclWhereHookNoResults')); @@ -266,7 +266,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { * @dataProvider entities * confirm that without check permissions we still get 2 entities returned */ - function testEntitiesGetCoreACLLimitingHookNoCheck($entity) { + public function testEntitiesGetCoreACLLimitingHookNoCheck($entity) { $this->setupCoreACL(); //CRM_Core_Config::singleton()->userPermissionClass->permissions = array(); $this->setUpEntities($entity); @@ -281,7 +281,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { * @dataProvider entities * confirm that with check permissions we don't get entities */ - function testEntitiesGetCoreACLLimitingCheck($entity) { + public function testEntitiesGetCoreACLLimitingCheck($entity) { $this->markTestIncomplete('this does not work in 4.4 but can be enabled in 4.5 or a security release of 4.4 including the important security fix CRM-14877'); $this->setupCoreACL(); $this->setUpEntities($entity); @@ -297,7 +297,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { * @dataProvider entities * Function tests that an empty where hook returns no results */ - function testEntityGetNoResultsHook($entity) { + public function testEntityGetNoResultsHook($entity) { $this->markTestIncomplete('hook acls only work with contacts so far'); CRM_Core_Config::singleton()->userPermissionClass->permissions = array(); $this->setUpEntities($entity); @@ -332,14 +332,14 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { /** * No results returned */ - function aclWhereHookNoResults($type, &$tables, &$whereTables, &$contactID, &$where) { + public function aclWhereHookNoResults($type, &$tables, &$whereTables, &$contactID, &$where) { } /** * All results returned * @implements CRM_Utils_Hook::aclWhereClause */ - function aclWhereHookAllResults($type, &$tables, &$whereTables, &$contactID, &$where) { + public function aclWhereHookAllResults($type, &$tables, &$whereTables, &$contactID, &$where) { $where = " (1) "; } @@ -347,7 +347,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { * Full results returned * @implements CRM_Utils_Hook::aclWhereClause */ - function aclWhereOnlySecond($type, &$tables, &$whereTables, &$contactID, &$where) { + public function aclWhereOnlySecond($type, &$tables, &$whereTables, &$contactID, &$where) { $where = " contact_a.id > 1"; } } diff --git a/tests/phpunit/api/v3/APIStandardsTest.php b/tests/phpunit/api/v3/APIStandardsTest.php index 176539de76..658800e1f0 100644 --- a/tests/phpunit/api/v3/APIStandardsTest.php +++ b/tests/phpunit/api/v3/APIStandardsTest.php @@ -98,7 +98,7 @@ class api_v3_APIStandardsTest extends CiviUnitTestCase { * Test checks that all v3 API return a standardised error message when * the $params passed in is not an array. */ - function testParamsNotArray() { + public function testParamsNotArray() { /*I have commented this out as the check for is_array has been moved to civicrm_api. But keeping in place as * this test, in contrast to the standards test, tests all existing API rather than just CRUD ones * so want to keep code for re-use @@ -125,7 +125,7 @@ class api_v3_APIStandardsTest extends CiviUnitTestCase { * Get all the files in the API directory for the relevant version which contain API functions * @return array $files array of php files in the directory excluding helper files */ - function getAllFilesinAPIDir() { + public function getAllFilesinAPIDir() { $files = array(); $handle = opendir($this->_apiDir); @@ -147,7 +147,7 @@ class api_v3_APIStandardsTest extends CiviUnitTestCase { * Require once Files * @param $files array list of files to load */ - function requireOnceFilesArray($files) { + public function requireOnceFilesArray($files) { foreach ($files as $key => $file) { require_once $this->_apiDir . $file; } @@ -157,7 +157,7 @@ class api_v3_APIStandardsTest extends CiviUnitTestCase { * Get all api exposed functions that are expected to conform to standards * @return array $functionlist */ - function getAllAPIStdFunctions() { + public function getAllAPIStdFunctions() { $functionlist = get_defined_functions(); $functions = preg_grep($this->_regexForGettingAPIStdFunctions, $functionlist['user']); foreach ($functions as $key => $function) { diff --git a/tests/phpunit/api/v3/APITest.php b/tests/phpunit/api/v3/APITest.php index ae4b0a610d..4187d6573b 100644 --- a/tests/phpunit/api/v3/APITest.php +++ b/tests/phpunit/api/v3/APITest.php @@ -38,7 +38,7 @@ class api_v3_APITest extends CiviUnitTestCase { protected $_apiversion =3; - function testAPIReplaceVariables() { + public function testAPIReplaceVariables() { $result = array(); $result['testfield'] = 6; $result['api.tag.get'] = 999; @@ -71,21 +71,21 @@ class api_v3_APITest extends CiviUnitTestCase { /* * test that error doesn't occur for non-existant file */ - function testAPIWrapperIncludeNoFile() { + public function testAPIWrapperIncludeNoFile() { $result = $this->callAPIFailure('RandomFile', 'get', array(), 'API (RandomFile,get) does not exist (join the API team and implement it!)'); } - function testAPIWrapperCamelCaseFunction() { + public function testAPIWrapperCamelCaseFunction() { $result = $this->callAPISuccess('OptionGroup', 'Get', array()); } - function testAPIWrapperLcaseFunction() { + public function testAPIWrapperLcaseFunction() { $result = $this->callAPISuccess('OptionGroup', 'get', array()); } - function testAPIResolver() { + public function testAPIResolver() { $oldpath = get_include_path(); set_include_path($oldpath . PATH_SEPARATOR . dirname(__FILE__) . '/dataset/resolver'); @@ -99,7 +99,7 @@ class api_v3_APITest extends CiviUnitTestCase { set_include_path($oldpath); } - function testFromCamel() { + public function testFromCamel() { $cases = array( 'Contribution' => 'contribution', 'contribution' => 'contribution', @@ -116,7 +116,7 @@ class api_v3_APITest extends CiviUnitTestCase { } } - function testToCamel() { + public function testToCamel() { $cases = array( 'Contribution' => 'Contribution', 'contribution' => 'Contribution', @@ -135,7 +135,7 @@ class api_v3_APITest extends CiviUnitTestCase { /** * Test that calling via wrapper works */ - function testv3Wrapper() { + public function testv3Wrapper() { try{ $result = civicrm_api3('contact', 'get', array()); } @@ -149,7 +149,7 @@ class api_v3_APITest extends CiviUnitTestCase { /** * Test exception is thrown */ - function testv3WrapperException(){ + public function testv3WrapperException(){ try{ $result = civicrm_api3('contact', 'create', array('debug' => 1)); } diff --git a/tests/phpunit/api/v3/APIWrapperTest.php b/tests/phpunit/api/v3/APIWrapperTest.php index e5ce7fcb6d..a8ed35939d 100644 --- a/tests/phpunit/api/v3/APIWrapperTest.php +++ b/tests/phpunit/api/v3/APIWrapperTest.php @@ -66,7 +66,7 @@ class api_v3_APIWrapperTest extends CiviUnitTestCase { * @param $apiWrappers * @param $apiRequest */ - function onApiWrappers(&$apiWrappers, $apiRequest) { + public function onApiWrappers(&$apiWrappers, $apiRequest) { $this->assertTrue(is_string($apiRequest['entity']) && !empty($apiRequest['entity'])); $this->assertTrue(is_string($apiRequest['action']) && !empty($apiRequest['action'])); $this->assertTrue(is_array($apiRequest['params']) && !empty($apiRequest['params'])); @@ -74,7 +74,7 @@ class api_v3_APIWrapperTest extends CiviUnitTestCase { $apiWrappers[] = new api_v3_APIWrapperTest_Impl(); } - function testWrapperHook() { + public function testWrapperHook() { // Note: this API call would fail due to missing contact_type, but // the wrapper intervenes (fromApiInput) // Note: The output would define "display_name", but the wrapper diff --git a/tests/phpunit/api/v3/ActionScheduleTest.php b/tests/phpunit/api/v3/ActionScheduleTest.php index 1fb09f188a..080e988ea1 100644 --- a/tests/phpunit/api/v3/ActionScheduleTest.php +++ b/tests/phpunit/api/v3/ActionScheduleTest.php @@ -52,7 +52,7 @@ class api_v3_ActionScheduleTest extends CiviUnitTestCase { $this->useTransaction(TRUE); } - function testSimpleActionScheduleCreate() { + public function testSimpleActionScheduleCreate() { $oldCount = CRM_Core_DAO::singleValueQuery('select count(*) from civicrm_action_schedule'); $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); @@ -82,7 +82,7 @@ class api_v3_ActionScheduleTest extends CiviUnitTestCase { /** * Check if required fields are not passed */ - function testActionScheduleCreateWithoutRequired() { + public function testActionScheduleCreateWithoutRequired() { $params = array( 'subject' => 'this case should fail', 'scheduled_date_time' => date('Ymd'), @@ -90,7 +90,7 @@ class api_v3_ActionScheduleTest extends CiviUnitTestCase { $result = $this->callAPIFailure('activity', 'create', $params); } - function testActionScheduleWithScheduledDatesCreate() { + public function testActionScheduleWithScheduledDatesCreate() { $oldCount = CRM_Core_DAO::singleValueQuery('select count(*) from civicrm_action_schedule'); $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); diff --git a/tests/phpunit/api/v3/ActivityContactTest.php b/tests/phpunit/api/v3/ActivityContactTest.php index e1bfd5d97a..6ce5e83c76 100644 --- a/tests/phpunit/api/v3/ActivityContactTest.php +++ b/tests/phpunit/api/v3/ActivityContactTest.php @@ -42,7 +42,7 @@ class api_v3_ActivityContactTest extends CiviUnitTestCase { protected $_params; - function setUp() { + public function setUp() { $this->_apiversion = 3; parent::setUp(); $this->useTransaction(TRUE); diff --git a/tests/phpunit/api/v3/ActivityTest.php b/tests/phpunit/api/v3/ActivityTest.php index 92e277b9b8..c868cb3e3e 100644 --- a/tests/phpunit/api/v3/ActivityTest.php +++ b/tests/phpunit/api/v3/ActivityTest.php @@ -100,7 +100,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { * * @access protected */ - function tearDown() { + public function tearDown() { $tablesToTruncate = array( 'civicrm_contact', 'civicrm_activity', @@ -113,14 +113,14 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Check with empty array */ - function testActivityCreateEmpty() { + public function testActivityCreateEmpty() { $result = $this->callAPIFailure('activity', 'create', array()); } /** * Check if required fields are not passed */ - function testActivityCreateWithoutRequired() { + public function testActivityCreateWithoutRequired() { $params = array( 'subject' => 'this case should fail', 'scheduled_date_time' => date('Ymd'), @@ -132,7 +132,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { * Test civicrm_activity_create() with mismatched activity_type_id * and activity_name */ - function testActivityCreateMismatchNameType() { + public function testActivityCreateMismatchNameType() { $params = array( 'source_contact_id' => $this->_contactID, 'subject' => 'Test activity', @@ -152,7 +152,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Test civicrm_activity_id() with missing source_contact_id is put with the current user. */ - function testActivityCreateWithMissingContactId() { + public function testActivityCreateWithMissingContactId() { $params = array( 'subject' => 'Make-it-Happen Meeting', 'activity_date_time' => date('Ymd'), @@ -169,7 +169,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Test civicrm_activity_id() with non-numeric source_contact_id */ - function testActivityCreateWithNonNumericContactId() { + public function testActivityCreateWithNonNumericContactId() { $params = array( 'source_contact_id' => 'fubar', 'subject' => 'Make-it-Happen Meeting', @@ -189,7 +189,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { * oddly enough this test was failing because the creation of the invalid type * got added to the set up routine. Probably a mis-fix on a test */ - function testActivityCreateWithNonNumericActivityTypeId() { + public function testActivityCreateWithNonNumericActivityTypeId() { $params = array( 'source_contact_id' => $this->_contactID, 'subject' => 'Make-it-Happen Meeting', @@ -207,7 +207,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Check with incorrect required fields */ - function testActivityCreateWithUnknownActivityTypeId() { + public function testActivityCreateWithUnknownActivityTypeId() { $params = array( 'source_contact_id' => $this->_contactID, 'subject' => 'Make-it-Happen Meeting', @@ -222,7 +222,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { $result = $this->callAPIFailure('activity', 'create', $params); } - function testActivityCreateWithInvalidPriority() { + public function testActivityCreateWithInvalidPriority() { $params = array( 'source_contact_id' => $this->_contactID, 'subject' => 'Make-it-Happen Meeting', @@ -242,7 +242,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { - function testActivityCreateWithValidStringPriority() { + public function testActivityCreateWithValidStringPriority() { $params = array( 'source_contact_id' => $this->_contactID, 'subject' => 'Make-it-Happen Meeting', @@ -259,7 +259,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { $this->assertEquals(1, $result['values'][$result['id']]['priority_id']); } - function testActivityCreateWithInValidStringPriority() { + public function testActivityCreateWithInValidStringPriority() { $params = array( 'source_contact_id' => $this->_contactID, 'subject' => 'Make-it-Happen Meeting', @@ -279,7 +279,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Test civicrm_activity_create() with valid parameters */ - function testActivityCreate() { + public function testActivityCreate() { $result = $this->callAPISuccess('activity', 'create', $this->_params); $result = $this->callAPISuccess('activity', 'get', $this->_params); @@ -295,7 +295,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Test civicrm_activity_create() with valid parameters - use type_id */ - function testActivityCreateCampaignTypeID() { + public function testActivityCreateCampaignTypeID() { $this->enableCiviCampaign(); $defaults = array(); @@ -325,7 +325,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { $this->assertEquals($result['values'][$result['id']]['status_id'], 1, 'in line ' . __LINE__); } - function testActivityReturnTargetAssignee() { + public function testActivityReturnTargetAssignee() { $description = "Example demonstrates setting & retrieving the target & source"; $subfile = "GetTargetandAssignee"; @@ -350,7 +350,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { $this->assertEquals($this->_contactID, $result['values'][$result['id']]['target_contact_id'][0], 'in line ' . __LINE__); } - function testActivityCreateExample() { + public function testActivityCreateExample() { /** * Test civicrm_activity_create() using example code */ @@ -364,7 +364,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { * Test civicrm_activity_create() with valid parameters * and some custom data */ - function testActivityCreateCustom() { + public function testActivityCreateCustom() { $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__); $params = $this->_params; $params['custom_' . $ids['custom_field_id']] = "custom string"; @@ -380,7 +380,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { * Test civicrm_activity_create() with valid parameters * and some custom data */ - function testActivityCreateCustomContactRefField() { + public function testActivityCreateCustomContactRefField() { $this->callAPISuccess('contact', 'create', array('id' => $this->_contactID, 'sort_name' => 'Contact, Test')); $subfile = 'ContactRefCustomField'; @@ -415,7 +415,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Test civicrm_activity_create() with an invalid text status_id */ - function testActivityCreateBadTextStatus() { + public function testActivityCreateBadTextStatus() { $params = array( 'source_contact_id' => $this->_contactID, @@ -434,7 +434,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Test civicrm_activity_create() with an invalid text status_id */ - function testActivityCreateSupportActivityStatus() { + public function testActivityCreateSupportActivityStatus() { $params = array( 'source_contact_id' => $this->_contactID, @@ -456,7 +456,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { * Test civicrm_activity_create() with valid parameters, * using a text status_id */ - function testActivityCreateTextStatus() { + public function testActivityCreateTextStatus() { $params = array( @@ -481,14 +481,14 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Test civicrm_activity_get() with no params */ - function testActivityGetEmpty() { + public function testActivityGetEmpty() { $result = $this->callAPISuccess('activity', 'get', array()); } /** * Test civicrm_activity_get() with a good activity ID */ - function testActivityGetGoodID1() { + public function testActivityGetGoodID1() { // Insert rows in civicrm_activity creating activities 4 and // 13 $description = "Function demonstrates getting asignee_contact_id & using it to get the contact"; @@ -529,7 +529,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /* * test that get functioning does filtering */ - function testGetFilter() { + public function testGetFilter() { $params = array( 'source_contact_id' => $this->_contactID, 'subject' => 'Make-it-Happen Meeting', @@ -552,7 +552,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Test civicrm_activity_get() with filter target_contact_id */ - function testActivityGetTargetFilter() { + public function testActivityGetTargetFilter() { $params = $this->_params; $contact1Params = array( 'first_name' => 'John', @@ -594,7 +594,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /* * test that get functioning does filtering */ - function testGetStatusID() { + public function testGetStatusID() { $params = array( 'source_contact_id' => $this->_contactID, 'subject' => 'Make-it-Happen Meeting', @@ -626,7 +626,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /* * test that get functioning does filtering */ - function testGetFilterMaxDate() { + public function testGetFilterMaxDate() { $params = array( 'source_contact_id' => $this->_contactID, 'subject' => 'Make-it-Happen Meeting', @@ -677,7 +677,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { * Test civicrm_activity_get() with a good activity ID which * has associated custom data */ - function testActivityGetGoodIDCustom() { + public function testActivityGetGoodIDCustom() { $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__); $params = $this->_params; @@ -704,7 +704,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { * Test civicrm_activity_get() with a good activity ID which * has associated custom data */ - function testActivityGetContact_idCustom() { + public function testActivityGetContact_idCustom() { $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__); $params = $this->_params; @@ -729,7 +729,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Check activity deletion with empty params */ - function testDeleteActivityForEmptyParams() { + public function testDeleteActivityForEmptyParams() { $params = array('version' => $this->_apiversion); $result = $this->callAPIFailure('activity', 'delete', $params); } @@ -737,7 +737,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Check activity deletion without activity id */ - function testDeleteActivityWithoutId() { + public function testDeleteActivityWithoutId() { $params = array( 'activity_name' => 'Meeting', 'version' => $this->_apiversion, @@ -748,7 +748,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Check activity deletion without activity type */ - function testDeleteActivityWithoutActivityType() { + public function testDeleteActivityWithoutActivityType() { $params = array('id' => 1); $result = $this->callAPIFailure('activity', 'delete', $params); } @@ -756,7 +756,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Check activity deletion with incorrect data */ - function testDeleteActivityWithIncorrectActivityType() { + public function testDeleteActivityWithIncorrectActivityType() { $params = array( 'id' => 1, 'activity_name' => 'Test Activity', @@ -768,7 +768,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Check activity deletion with correct data */ - function testDeleteActivity() { + public function testDeleteActivity() { $result = $this->callAPISuccess('activity', 'create', $this->_params); $params = array( 'id' => $result['id'], @@ -782,7 +782,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Check if required fields are not passed */ - function testActivityUpdateWithoutRequired() { + public function testActivityUpdateWithoutRequired() { $params = array( 'subject' => 'this case should fail', 'scheduled_date_time' => date('Ymd'), @@ -794,7 +794,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Test civicrm_activity_update() with non-numeric id */ - function testActivityUpdateWithNonNumericId() { + public function testActivityUpdateWithNonNumericId() { $params = array( 'id' => 'lets break it', 'activity_name' => 'Meeting', @@ -808,7 +808,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Check with incorrect required fields */ - function testActivityUpdateWithIncorrectContactActivityType() { + public function testActivityUpdateWithIncorrectContactActivityType() { $params = array( 'id' => 1, 'activity_name' => 'Test Activity', @@ -824,7 +824,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Test civicrm_activity_update() to update an existing activity */ - function testActivityUpdate() { + public function testActivityUpdate() { $result = $this->callAPISuccess('activity', 'create', $this->_params); $params = array( @@ -851,7 +851,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { * Test civicrm_activity_update() with valid parameters * and some custom data */ - function testActivityUpdateCustom() { + public function testActivityUpdateCustom() { $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__); $params = $this->_params; @@ -901,7 +901,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { * Test civicrm_activity_update() for core activity fields * and some custom data */ - function testActivityUpdateCheckCoreFields() { + public function testActivityUpdateCheckCoreFields() { $params = $this->_params; $contact1Params = array( 'first_name' => 'John', @@ -1005,7 +1005,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { * Test civicrm_activity_update() where the DB has a date_time * value and there is none in the update params. */ - function testActivityUpdateNotDate() { + public function testActivityUpdateNotDate() { $result = $this->callAPISuccess('activity', 'create', $this->_params); $params = array( @@ -1030,7 +1030,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Check activity update with status */ - function testActivityUpdateWithStatus() { + public function testActivityUpdateWithStatus() { $activity = $this->callAPISuccess('activity', 'create', $this->_params); $params = array( 'id' => $activity['id'], @@ -1051,7 +1051,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { * Test civicrm_activity_update() where the source_contact_id * is not in the update params. */ - function testActivityUpdateKeepSource() { + public function testActivityUpdateKeepSource() { $activity = $this->callAPISuccess('activity', 'create', $this->_params); // Updating the activity but not providing anything for the source contact // (It was set as $this->_contactID earlier.) @@ -1073,7 +1073,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Test civicrm_activities_contact_get() */ - function testActivitiesContactGet() { + public function testActivitiesContactGet() { $activity = $this->callAPISuccess('activity', 'create', $this->_params); $activity2 = $this->callAPISuccess('activity', 'create', $this->_params2); // Get activities associated with contact $this->_contactID @@ -1090,7 +1090,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /* * test chained Activity format */ - function testchainedActivityGet() { + public function testchainedActivityGet() { $activity = $this->callAPISuccess('Contact', 'Create', array( 'display_name' => "bob brown", @@ -1115,7 +1115,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Test civicrm_activity_contact_get() with invalid Contact Id */ - function testActivitiesContactGetWithInvalidContactId() { + public function testActivitiesContactGetWithInvalidContactId() { $params = array('contact_id' => 'contact'); $result = $this->callAPIFailure('activity', 'get', $params); } @@ -1123,7 +1123,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { /** * Test civicrm_activity_contact_get() with contact having no Activity */ - function testActivitiesContactGetHavingNoActivity() { + public function testActivitiesContactGetHavingNoActivity() { $params = array( 'first_name' => 'dan', 'last_name' => 'conberg', @@ -1139,7 +1139,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { $this->assertEquals($result['count'], 0, 'in line ' . __LINE__); } - function testGetFields() { + public function testGetFields() { $params = array('action' => 'create'); $result = $this->callAPIAndDocument('activity', 'getfields', $params, __FUNCTION__, __FILE__, NULL, NULL, 'getfields'); $this->assertTrue(is_array($result['values']), 'get fields doesnt return values array in line ' . __LINE__); diff --git a/tests/phpunit/api/v3/ActivityTypeTest.php b/tests/phpunit/api/v3/ActivityTypeTest.php index 79a97a8706..93ccdf0782 100644 --- a/tests/phpunit/api/v3/ActivityTypeTest.php +++ b/tests/phpunit/api/v3/ActivityTypeTest.php @@ -36,7 +36,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; class api_v3_ActivityTypeTest extends CiviUnitTestCase { protected $_apiversion; - function setUp() { + public function setUp() { $this->_apiversion = 3; CRM_Core_PseudoConstant::activityType(TRUE, TRUE, TRUE, 'name'); parent::setUp(); @@ -46,7 +46,7 @@ class api_v3_ActivityTypeTest extends CiviUnitTestCase { /** * Test civicrm_activity_type_get() */ - function testActivityTypeGet() { + public function testActivityTypeGet() { $params = array(); $result = $this->callAPIAndDocument('activity_type', 'get', $params, __FUNCTION__, __FILE__); $this->assertEquals($result['values']['1'], 'Meeting', 'In line ' . __LINE__); @@ -56,7 +56,7 @@ class api_v3_ActivityTypeTest extends CiviUnitTestCase { /** * Test civicrm_activity_type_create() */ - function testActivityTypeCreate() { + public function testActivityTypeCreate() { $params = array( 'weight' => '2', 'label' => 'send out letters', @@ -71,7 +71,7 @@ class api_v3_ActivityTypeTest extends CiviUnitTestCase { /** * Test civicrm_activity_type_create - check id */ - function testActivityTypecreatecheckId() { + public function testActivityTypecreatecheckId() { $params = array( 'label' => 'type_create', 'weight' => '2', @@ -84,7 +84,7 @@ class api_v3_ActivityTypeTest extends CiviUnitTestCase { /** * Test civicrm_activity_type_delete() */ - function testActivityTypeDelete() { + public function testActivityTypeDelete() { $params = array( 'label' => 'type_create_delete', 'weight' => '2', diff --git a/tests/phpunit/api/v3/AddressTest.php b/tests/phpunit/api/v3/AddressTest.php index 10c72e9880..a3a6bf0d1e 100644 --- a/tests/phpunit/api/v3/AddressTest.php +++ b/tests/phpunit/api/v3/AddressTest.php @@ -45,7 +45,7 @@ class api_v3_AddressTest extends CiviUnitTestCase { protected $_entity; - function setUp() { + public function setUp() { $this->_entity = 'Address'; parent::setUp(); @@ -66,7 +66,7 @@ class api_v3_AddressTest extends CiviUnitTestCase { ); } - function tearDown() { + public function tearDown() { $this->locationTypeDelete($this->_locationType->id); $this->contactDelete($this->_contactID); } @@ -231,7 +231,7 @@ class api_v3_AddressTest extends CiviUnitTestCase { $this->callAPISuccess('address', 'delete', array('id' => $create['id'])); } - function testGetWithCustom() { + public function testGetWithCustom() { $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__); $params = $this->_params; diff --git a/tests/phpunit/api/v3/BatchTest.php b/tests/phpunit/api/v3/BatchTest.php index 7d7e3a94c3..4ab3c26cad 100644 --- a/tests/phpunit/api/v3/BatchTest.php +++ b/tests/phpunit/api/v3/BatchTest.php @@ -51,7 +51,7 @@ class api_v3_BatchTest extends CiviUnitTestCase { /** * Create a sample batch */ - function batchCreate() { + public function batchCreate() { $params = $this->_params; $params['name'] = $params['title'] = 'Batch_433397'; $params['status_id'] = 1; @@ -73,7 +73,7 @@ class api_v3_BatchTest extends CiviUnitTestCase { /** * Test civicrm_batch_create - success expected. */ - function testCreate() { + public function testCreate() { $params = array( 'name' => 'New_Batch_03', 'title' => 'New Batch 03', @@ -91,7 +91,7 @@ class api_v3_BatchTest extends CiviUnitTestCase { /** * Test civicrm_batch_create with id. */ - function testUpdate() { + public function testUpdate() { $params = array( 'name' => 'New_Batch_04', 'title' => 'New Batch 04', @@ -109,7 +109,7 @@ class api_v3_BatchTest extends CiviUnitTestCase { /** * Test civicrm_batch_delete using the old $params['batch_id'] syntax. */ - function testBatchDeleteOldSyntax() { + public function testBatchDeleteOldSyntax() { $batchID = $this->batchCreate(); $params = array( 'batch_id' => $batchID, @@ -120,7 +120,7 @@ class api_v3_BatchTest extends CiviUnitTestCase { /** * Test civicrm_batch_delete using the new $params['id'] syntax */ - function testBatchDeleteCorrectSyntax() { + public function testBatchDeleteCorrectSyntax() { $batchID = $this->batchCreate(); $params = array( 'id' => $batchID, diff --git a/tests/phpunit/api/v3/CRM11793Test.php b/tests/phpunit/api/v3/CRM11793Test.php index c8a022ce14..fc94e96845 100644 --- a/tests/phpunit/api/v3/CRM11793Test.php +++ b/tests/phpunit/api/v3/CRM11793Test.php @@ -31,7 +31,7 @@ class api_v3_CRM11793Test extends CiviUnitTestCase { Contact::createOrganisation(); } - function tearDown() { + public function tearDown() { } /** @@ -40,21 +40,21 @@ class api_v3_CRM11793Test extends CiviUnitTestCase { * Verify that attempt to create individual contact with only * first and last names succeeds */ - function testCRM11793Organization() { + public function testCRM11793Organization() { $this->_testCRM11793ContactType('Organization'); } - function testCRM11793Household() { + public function testCRM11793Household() { $this->_testCRM11793ContactType('Household'); } - function testCRM11793Individual() { + public function testCRM11793Individual() { $this->_testCRM11793ContactType('Individual'); } /** * @param $contactType */ - function _testCRM11793ContactType($contactType) { + public function _testCRM11793ContactType($contactType) { $result = $this->callAPISuccess( 'contact', 'get', diff --git a/tests/phpunit/api/v3/CampaignTest.php b/tests/phpunit/api/v3/CampaignTest.php index bdc0fd654a..6b1e4f00df 100644 --- a/tests/phpunit/api/v3/CampaignTest.php +++ b/tests/phpunit/api/v3/CampaignTest.php @@ -38,7 +38,7 @@ class api_v3_CampaignTest extends CiviUnitTestCase { public $DBResetRequired = FALSE; - function setUp() { + public function setUp() { $this->_apiversion = 3; $this->params = array( 'title' => "campaign title", diff --git a/tests/phpunit/api/v3/CaseTest.php b/tests/phpunit/api/v3/CaseTest.php index be1c562940..b52f1fce7e 100644 --- a/tests/phpunit/api/v3/CaseTest.php +++ b/tests/phpunit/api/v3/CaseTest.php @@ -73,14 +73,14 @@ class api_v3_CaseTest extends CiviCaseTestCase { /** * Check with empty array */ - function testCaseCreateEmpty() { + public function testCaseCreateEmpty() { $result = $this->callAPIFailure('case', 'create', array()); } /** * Check if required fields are not passed */ - function testCaseCreateWithoutRequired() { + public function testCaseCreateWithoutRequired() { $params = array( 'subject' => 'this case should fail', 'case_type_id' => 1, @@ -92,7 +92,7 @@ class api_v3_CaseTest extends CiviCaseTestCase { /** * Test create function with valid parameters */ - function testCaseCreate() { + public function testCaseCreate() { // Create Case $params = $this->_params; // Test using label instead of value @@ -111,7 +111,7 @@ class api_v3_CaseTest extends CiviCaseTestCase { /** * Test update (create with id) function with valid parameters */ - function testCaseUpdate() { + public function testCaseUpdate() { // Create Case $params = $this->_params; // Test using name instead of value @@ -135,7 +135,7 @@ class api_v3_CaseTest extends CiviCaseTestCase { /** * Test delete function with valid parameters */ - function testCaseDelete() { + public function testCaseDelete() { // Create Case $result = $this->callAPISuccess('case', 'create', $this->_params); @@ -158,7 +158,7 @@ class api_v3_CaseTest extends CiviCaseTestCase { /** * Test get function based on activity */ - function testCaseGetByActivity() { + public function testCaseGetByActivity() { // Create Case $result = $this->callAPISuccess('case', 'create', $this->_params); $id = $result['id']; @@ -177,7 +177,7 @@ class api_v3_CaseTest extends CiviCaseTestCase { /** * Test get function based on contact id */ - function testCaseGetByContact() { + public function testCaseGetByContact() { // Create Case $result = $this->callAPISuccess('case', 'create', $this->_params); $id = $result['id']; @@ -193,7 +193,7 @@ class api_v3_CaseTest extends CiviCaseTestCase { /** * Test get function based on subject */ - function testCaseGetBySubject() { + public function testCaseGetBySubject() { // Create Case $result = $this->callAPISuccess('case', 'create', $this->_params); $id = $result['id']; @@ -209,7 +209,7 @@ class api_v3_CaseTest extends CiviCaseTestCase { /** * Test get function based on wrong subject */ - function testCaseGetByWrongSubject() { + public function testCaseGetByWrongSubject() { // Create Case $result = $this->callAPISuccess('case', 'create', $this->_params); $id = $result['id']; @@ -222,7 +222,7 @@ class api_v3_CaseTest extends CiviCaseTestCase { /** * Test get function with no criteria */ - function testCaseGetNoCriteria() { + public function testCaseGetNoCriteria() { // Create Case $result = $this->callAPISuccess('case', 'create', $this->_params); $id = $result['id']; @@ -237,7 +237,7 @@ class api_v3_CaseTest extends CiviCaseTestCase { /** * Test activity api create for case activities */ - function testCaseActivityCreate() { + public function testCaseActivityCreate() { // Create a case first $params = $this->_params; $result = $this->callAPISuccess('case', 'create', $params); @@ -275,7 +275,7 @@ class api_v3_CaseTest extends CiviCaseTestCase { /** * Test activity api update for case activities */ - function testCaseActivityUpdate() { + public function testCaseActivityUpdate() { // Need to create the case and activity before we can update it $this->testCaseActivityCreate(); @@ -314,7 +314,7 @@ class api_v3_CaseTest extends CiviCaseTestCase { //TODO: check some more things } - function testCaseActivityUpdateCustom() { + public function testCaseActivityUpdateCustom() { // Create a case first $result = $this->callAPISuccess('case', 'create', $this->_params); diff --git a/tests/phpunit/api/v3/CaseTypeTest.php b/tests/phpunit/api/v3/CaseTypeTest.php index 481c4e5ec9..a43c51c57f 100644 --- a/tests/phpunit/api/v3/CaseTypeTest.php +++ b/tests/phpunit/api/v3/CaseTypeTest.php @@ -32,7 +32,7 @@ require_once 'CiviTest/CiviCaseTestCase.php'; */ class api_v3_CaseTypeTest extends CiviCaseTestCase { - function setUp() { + public function setUp() { $this->quickCleanup(array('civicrm_case_type')); parent::setUp(); @@ -67,7 +67,7 @@ class api_v3_CaseTypeTest extends CiviCaseTestCase { * This method is called after a test is executed. * */ - function tearDown() { + public function tearDown() { parent::tearDown(); $this->quickCleanup(array('civicrm_case_type')); } @@ -75,14 +75,14 @@ class api_v3_CaseTypeTest extends CiviCaseTestCase { /** * Check with empty array */ - function testCaseTypeCreateEmpty() { + public function testCaseTypeCreateEmpty() { $this->callAPIFailure('CaseType', 'create', array()); } /** * Check if required fields are not passed */ - function testCaseTypeCreateWithoutRequired() { + public function testCaseTypeCreateWithoutRequired() { $params = array( 'name' => 'this case should fail', ); @@ -99,7 +99,7 @@ class api_v3_CaseTypeTest extends CiviCaseTestCase { * Test create methods with valid data * success expected */ - function testCaseTypeCreate() { + public function testCaseTypeCreate() { // Create Case Type $params = array( 'title' => 'Application', @@ -120,7 +120,7 @@ class api_v3_CaseTypeTest extends CiviCaseTestCase { /** * Create a case with an invalid name */ - function testCaseTypeCreate_invalidName() { + public function testCaseTypeCreate_invalidName() { // Create Case Type $params = array( 'title' => 'Application', @@ -136,7 +136,7 @@ class api_v3_CaseTypeTest extends CiviCaseTestCase { /** * Test update (create with id) function with valid parameters */ - function testCaseTypeUpdate() { + public function testCaseTypeUpdate() { // Create Case Type $params = array( 'title' => 'Application', @@ -162,7 +162,7 @@ class api_v3_CaseTypeTest extends CiviCaseTestCase { /** * Test delete function with valid parameters */ - function testCaseTypeDelete_New() { + public function testCaseTypeDelete_New() { // Create Case Type $params = array( 'title' => 'Application', @@ -184,7 +184,7 @@ class api_v3_CaseTypeTest extends CiviCaseTestCase { * Test create methods with xml file * success expected */ - function testCaseTypeCreateWithDefinition() { + public function testCaseTypeCreateWithDefinition() { // Create Case Type $params = $this->fixtures['Application_with_Definition']; $result = $this->callAPISuccess('CaseType', 'create', $params); @@ -203,7 +203,7 @@ class api_v3_CaseTypeTest extends CiviCaseTestCase { /** * Create a CaseType+case then delete the CaseType. */ - function testCaseTypeDelete_InUse() { + public function testCaseTypeDelete_InUse() { // Create Case Type $params = $this->fixtures['Application_with_Definition']; $createCaseType = $this->callAPISuccess('CaseType', 'create', $params); diff --git a/tests/phpunit/api/v3/ContactTest.php b/tests/phpunit/api/v3/ContactTest.php index 1b6758dd55..67b54d7a49 100644 --- a/tests/phpunit/api/v3/ContactTest.php +++ b/tests/phpunit/api/v3/ContactTest.php @@ -68,7 +68,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { ); } - function tearDown() { + public function tearDown() { // truncate a few tables $tablesToTruncate = array( 'civicrm_contact', @@ -90,7 +90,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * Verify that attempt to create individual contact with only * first and last names succeeds */ - function testAddCreateIndividual() { + public function testAddCreateIndividual() { $oldCount = CRM_Core_DAO::singleValueQuery('select count(*) from civicrm_contact'); $params = array( 'first_name' => 'abc1', @@ -115,7 +115,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * * Verify that sub-types are created successfully and not deleted by subsequent updates */ - function testIndividualSubType() { + public function testIndividualSubType() { $params = array( 'first_name' => 'test abc', 'contact_type' => 'Individual', @@ -140,14 +140,14 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * Verify that attempt to create contact with empty params fails */ - function testCreateEmptyContact() { + public function testCreateEmptyContact() { $this->callAPIFailure('contact', 'create', array()); } /** * Verify that attempt to create contact with bad contact type fails */ - function testCreateBadTypeContact() { + public function testCreateBadTypeContact() { $params = array( 'email' => 'man1@yahoo.com', 'contact_type' => 'Does not Exist', @@ -159,7 +159,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * Verify that attempt to create individual contact with required * fields missing fails */ - function testCreateBadRequiredFieldsIndividual() { + public function testCreateBadRequiredFieldsIndividual() { $params = array( 'middle_name' => 'This field is not required', 'contact_type' => 'Individual', @@ -171,7 +171,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * Verify that attempt to create household contact with required * fields missing fails */ - function testCreateBadRequiredFieldsHousehold() { + public function testCreateBadRequiredFieldsHousehold() { $params = array( 'middle_name' => 'This field is not required', 'contact_type' => 'Household', @@ -183,7 +183,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * Verify that attempt to create organization contact with * required fields missing fails */ - function testCreateBadRequiredFieldsOrganization() { + public function testCreateBadRequiredFieldsOrganization() { $params = array( 'middle_name' => 'This field is not required', 'contact_type' => 'Organization', @@ -196,7 +196,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * Verify that attempt to create individual contact with only an * email succeeds */ - function testCreateEmailIndividual() { + public function testCreateEmailIndividual() { $params = array( 'email' => 'man3@yahoo.com', @@ -218,7 +218,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * Verify that attempt to create individual contact with only * first and last names succeeds */ - function testCreateNameIndividual() { + public function testCreateNameIndividual() { $params = array( 'first_name' => 'abc1', 'contact_type' => 'Individual', @@ -233,7 +233,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * Verify that attempt to create individual contact with * first and last names and old key values works */ - function testCreateNameIndividualOldKeys() { + public function testCreateNameIndividualOldKeys() { $params = array( 'individual_prefix' => 'Dr.', 'first_name' => 'abc1', @@ -256,7 +256,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * Verify that attempt to create individual contact with * first and last names and old key values works */ - function testCreateNameIndividualrecommendedKeys2() { + public function testCreateNameIndividualrecommendedKeys2() { $params = array( 'prefix_id' => 'Dr.', 'first_name' => 'abc1', @@ -280,7 +280,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * Verify that attempt to create household contact with only * household name succeeds */ - function testCreateNameHousehold() { + public function testCreateNameHousehold() { $params = array( 'household_name' => 'The abc Household', 'contact_type' => 'Household', @@ -293,7 +293,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * Verify that attempt to create organization contact with only * organization name succeeds */ - function testCreateNameOrganization() { + public function testCreateNameOrganization() { $params = array( 'organization_name' => 'The abc Organization', 'contact_type' => 'Organization', @@ -304,7 +304,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * Verify that attempt to create organization contact without organization name fails */ - function testCreateNoNameOrganization() { + public function testCreateNoNameOrganization() { $params = array( 'first_name' => 'The abc Organization', 'contact_type' => 'Organization', @@ -317,7 +317,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * variables specific to participant so it can be replicated into other entities * and / or moved to the automated test suite */ - function testCreateWithCustom() { + public function testCreateWithCustom() { $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__); $params = $this->_params; @@ -336,7 +336,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * CRM-12773 - expectation is that civicrm quietly ignores * fields without values */ - function testCreateWithNULLCustomCRM12773() { + public function testCreateWithNULLCustomCRM12773() { $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__); $params = $this->_params; $params['custom_' . $ids['custom_field_id']] = NULL; @@ -349,7 +349,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /* * Test creating a current employer through API */ - function testContactCreateCurrentEmployer(){ + public function testContactCreateCurrentEmployer(){ //here we will just do the get for set-up purposes $count = $this->callAPISuccess('contact', 'getcount', array( 'organization_name' => 'new employer org', @@ -381,7 +381,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * Test creating a current employer through API * - check it will re-activate a de-activated employer */ - function testContactCreateDuplicateCurrentEmployerEnables(){ + public function testContactCreateDuplicateCurrentEmployerEnables(){ //set up - create employer relationship $employerResult = $this->callAPISuccess('contact', 'create', array_merge($this->_params, array( 'current_employer' => 'new employer org',) @@ -411,7 +411,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * Check deceased contacts are not retrieved * Note at time of writing the default is to return default. This should possibly be changed & test added */ - function testGetDeceasedRetrieved() { + public function testGetDeceasedRetrieved() { $this->callAPISuccess($this->_entity, 'create', $this->_params); $c2 = $this->callAPISuccess($this->_entity, 'create', array('first_name' => 'bb', 'last_name' => 'ccc', 'contact_type' => 'Individual', 'is_deceased' => 1)); $result = $this->callAPISuccess($this->_entity, 'get', array('is_deceased' => 0)); @@ -421,7 +421,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * Test that sort works - old syntax */ - function testGetSort() { + public function testGetSort() { $c1 = $this->callAPISuccess($this->_entity, 'create', $this->_params); $c2 = $this->callAPISuccess($this->_entity, 'create', array('first_name' => 'bb', 'last_name' => 'ccc', 'contact_type' => 'Individual')); $result = $this->callAPISuccess($this->_entity, 'get', array( @@ -447,7 +447,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * Test that we can retrieve contacts using * 'id' => array('IN' => array('3,4')) syntax */ - function testGetINIDArray() { + public function testGetINIDArray() { $c1 = $this->callAPISuccess($this->_entity, 'create', $this->_params); $c2 = $this->callAPISuccess($this->_entity, 'create', array('first_name' => 'bb', 'last_name' => 'ccc', 'contact_type' => 'Individual')); $c3 = $this->callAPISuccess($this->_entity, 'create', array('first_name' => 'hh', 'last_name' => 'll', 'contact_type' => 'Individual')); @@ -461,7 +461,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /* * Test variants on deleted behaviour */ - function testGetDeleted() { + public function testGetDeleted() { $params = $this->_params; $contact1 = $this->callAPISuccess('contact', 'create', $params); $params['is_deleted'] = 1; @@ -490,7 +490,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * Test that sort works - new syntax */ - function testGetSortNewSYntax() { + public function testGetSortNewSYntax() { $c1 = $this->callAPISuccess($this->_entity, 'create', $this->_params); $c2 = $this->callAPISuccess($this->_entity, 'create', array('first_name' => 'bb', 'last_name' => 'ccc', 'contact_type' => 'Individual')); $result = $this->callAPISuccess($this->_entity, 'getvalue', array( @@ -518,7 +518,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * Test apostrophe works in get & create */ - function testGetApostropheCRM10857() { + public function testGetApostropheCRM10857() { $params = array_merge($this->_params, array('last_name' => "O'Connor")); $this->callAPISuccess($this->_entity, 'create', $params); $result = $this->callAPISuccess($this->_entity, 'getsingle', array( @@ -534,7 +534,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * variables specific to participant so it can be replicated into other entities * and / or moved to the automated test suite */ - function testGetWithCustom() { + public function testGetWithCustom() { $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__); $params = $this->_params; @@ -558,7 +558,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * variables specific to participant so it can be replicated into other entities * and / or moved to the automated test suite */ - function testGetWithCustomReturnSyntax() { + public function testGetWithCustomReturnSyntax() { $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__); $params = $this->_params; @@ -577,7 +577,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * Check that address name is returned if required */ - function testGetReturnAddressName () { + public function testGetReturnAddressName () { $contactID = $this->individualCreate(); $this->callAPISuccess('address', 'create', array('contact_id' => $contactID, 'address_name' => 'My house', 'location_type_id' => 'Home', 'street_address' => '1 my road')); $result = $this->callAPISuccessGetSingle('contact', array('return' => 'address_name, street_address', 'id' => $contactID)); @@ -586,7 +586,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { } - function testGetGroupIDFromContact() { + public function testGetGroupIDFromContact() { $groupId = $this->groupCreate(); $description = "Get all from group and display contacts"; $subFile = "GroupFilterUsingContactAPI"; @@ -646,7 +646,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * Verify that attempt to create individual contact with two chained websites succeeds */ - function testCreateIndividualWithContributionDottedSyntax() { + public function testCreateIndividualWithContributionDottedSyntax() { $description = "test demonstrates the syntax to create 2 chained entities"; $subFile = "ChainTwoWebsites"; $params = array( @@ -690,7 +690,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * Verify that attempt to create individual contact with chained contribution and website succeeds */ - function testCreateIndividualWithContributionChainedArrays() { + public function testCreateIndividualWithContributionChainedArrays() { $params = array( 'first_name' => 'abc3', 'last_name' => 'xyz3', @@ -737,7 +737,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * Verify that attempt to create individual contact with first * and last names and email succeeds */ - function testCreateIndividualWithNameEmail() { + public function testCreateIndividualWithNameEmail() { $params = array( 'first_name' => 'abc3', 'last_name' => 'xyz3', @@ -754,7 +754,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * Verify that attempt to create individual contact with no data fails */ - function testCreateIndividualWithOutNameEmail() { + public function testCreateIndividualWithOutNameEmail() { $params = array( 'contact_type' => 'Individual', ); @@ -764,7 +764,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * Verify that attempt to create individual contact with first * and last names, email and location type succeeds */ - function testCreateIndividualWithNameEmailLocationType() { + public function testCreateIndividualWithNameEmailLocationType() { $params = array( 'first_name' => 'abc4', 'last_name' => 'xyz4', @@ -783,7 +783,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * Verify that when changing employers * the old employer relationship becomes inactive */ - function testCreateIndividualWithEmployer() { + public function testCreateIndividualWithEmployer() { $employer = $this->organizationCreate(); $employer2 = $this->organizationCreate(); @@ -830,7 +830,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * Verify that attempt to create household contact with details * succeeds */ - function testCreateHouseholdDetails() { + public function testCreateHouseholdDetails() { $params = array( 'household_name' => 'abc8\'s House', 'nick_name' => 'x House', @@ -848,7 +848,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * Verify that attempt to create household contact with inadequate details * fails */ - function testCreateHouseholdInadequateDetails() { + public function testCreateHouseholdInadequateDetails() { $params = array( 'nick_name' => 'x House', 'email' => 'man8@yahoo.com', @@ -860,7 +860,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * Verify successful update of individual contact */ - function testUpdateIndividualWithAll() { + public function testUpdateIndividualWithAll() { // Insert a row in civicrm_contact creating individual contact $op = new PHPUnit_Extensions_Database_Operation_Insert(); $op->execute($this->_dbconn, @@ -908,7 +908,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * Verify successful update of organization contact */ - function testUpdateOrganizationWithAll() { + public function testUpdateOrganizationWithAll() { // Insert a row in civicrm_contact creating organization contact $op = new PHPUnit_Extensions_Database_Operation_Insert(); $op->execute($this->_dbconn, @@ -941,7 +941,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * Verify successful update of household contact */ - function testUpdateHouseholdwithAll() { + public function testUpdateHouseholdwithAll() { // Insert a row in civicrm_contact creating household contact $op = new PHPUnit_Extensions_Database_Operation_Insert(); $op->execute($this->_dbconn, @@ -996,7 +996,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * Test civicrm_contact_delete() with no contact ID */ - function testContactDeleteNoID() { + public function testContactDeleteNoID() { $params = array( 'foo' => 'bar', ); @@ -1006,7 +1006,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * Test civicrm_contact_delete() with error */ - function testContactDeleteError() { + public function testContactDeleteError() { $params = array('contact_id' => 999); $this->callAPIFailure('contact', 'delete', $params); } @@ -1014,7 +1014,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * Test civicrm_contact_delete() */ - function testContactDelete() { + public function testContactDelete() { $contactID = $this->individualCreate(); $params = array( 'id' => $contactID , @@ -1239,7 +1239,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * Test for Contact.get id=@user:username */ - function testContactGetByUsername() { + public function testContactGetByUsername() { // setup - create contact with a uf-match $cid = $this->individualCreate(array( 'contact_type' => 'Individual', @@ -1274,7 +1274,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * Test to check return works OK */ - function testContactGetReturnValues() { + public function testContactGetReturnValues() { $extraParams = array('nick_name' => 'Bob', 'phone' => '456', 'email' => 'e@mail.com'); $contactID = $this->individualCreate($extraParams); //actually it turns out the above doesn't create a phone @@ -1290,7 +1290,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { } } - function testCRM13252MultipleChainedPhones() { + public function testCRM13252MultipleChainedPhones() { $contactID = $this->householdCreate(); $this->callAPISuccessGetCount('phone', array('contact_id' => $contactID), 0); $params = array( @@ -1317,7 +1317,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * Test for Contact.get id=@user:username (with an invalid username) */ - function testContactGetByUnknownUsername() { + public function testContactGetByUnknownUsername() { // setup - mock the calls to CRM_Utils_System_*::getUfId $userSystem = $this->getMock('CRM_Utils_System_UnitTests', array('getUfId')); $userSystem->expects($this->once()) @@ -1336,7 +1336,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * Verify attempt to create individual with chained arrays */ - function testGetIndividualWithChainedArrays() { + public function testGetIndividualWithChainedArrays() { $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__); $params['custom_' . $ids['custom_field_id']] = "custom string"; @@ -1400,7 +1400,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { $this->assertEquals("http://civicrm.org", $result['values'][$result['id']]['api.website.get']['values'][0]['url']); } - function testGetIndividualWithChainedArraysFormats() { + public function testGetIndividualWithChainedArraysFormats() { $description = "/*this demonstrates the usage of chained api functions. A variety of return formats are used. Note that no notes *custom fields or memberships exist"; $subfile = "APIChainedArrayFormats"; @@ -1463,7 +1463,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { $this->customGroupDelete($moreids['custom_group_id']); } - function testGetIndividualWithChainedArraysAndMultipleCustom() { + public function testGetIndividualWithChainedArraysAndMultipleCustom() { $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__); $params['custom_' . $ids['custom_field_id']] = "custom string"; $moreids = $this->CustomGroupMultipleCreateWithFields(); @@ -1536,7 +1536,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /* * Test checks siusage of $values to pick & choose inputs */ - function testChainingValuesCreate() { + public function testChainingValuesCreate() { $description = "/*this demonstrates the usage of chained api functions. Specifically it has one 'parent function' & 2 child functions - one receives values from the parent (Contact) and the other child (Tag). "; $subfile = "APIChainedArrayValuesFromSiblingFunction"; @@ -1560,7 +1560,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /* * test TrueFalse format - I couldn't come up with an easy way to get an error on Get */ - function testContactGetFormatIsSuccessTrue() { + public function testContactGetFormatIsSuccessTrue() { $this->createContactFromXML(); $description = "This demonstrates use of the 'format.is_success' param. This param causes only the success or otherwise of the function to be returned as BOOLEAN"; @@ -1573,7 +1573,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /* * test TrueFalse format */ - function testContactCreateFormatIsSuccessFalse() { + public function testContactCreateFormatIsSuccessFalse() { $description = "This demonstrates use of the 'format.is_success' param. This param causes only the success or otherwise of the function to be returned as BOOLEAN"; @@ -1585,7 +1585,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /* * test Single Entity format */ - function testContactGetSingle_entity_array() { + public function testContactGetSingle_entity_array() { $this->createContactFromXML(); $description = "This demonstrates use of the 'format.single_entity_array' param. /* This param causes the only contact to be returned as an array without the other levels. @@ -1600,7 +1600,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /* * test Single Entity format */ - function testContactGetFormatcount_only() { + public function testContactGetFormatcount_only() { $this->createContactFromXML(); $description = "/*This demonstrates use of the 'getCount' action /* This param causes the count of the only function to be returned as an integer"; @@ -1613,7 +1613,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /* * Test id only format */ - function testContactGetFormatID_only() { + public function testContactGetFormatID_only() { $this->createContactFromXML(); $description = "This demonstrates use of the 'format.id_only' param. /* This param causes the id of the only entity to be returned as an integer. @@ -1628,7 +1628,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /* * Test id only format */ - function testContactGetFormatSingleValue() { + public function testContactGetFormatSingleValue() { $this->createContactFromXML(); $description = "This demonstrates use of the 'format.single_value' param. /* This param causes only a single value of the only entity to be returned as an string. @@ -1643,7 +1643,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * Test that permissions are respected when creating contacts */ - function testContactCreationPermissions() { + public function testContactCreationPermissions() { $params = array( 'contact_type' => 'Individual', 'first_name' => 'Foo', 'last_name' => 'Bear', @@ -1658,7 +1658,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { $this->callAPISuccess('contact', 'create', $params, NULL, 'overfluous permissions should be enough to create a contact'); } - function testContactUpdatePermissions() { + public function testContactUpdatePermissions() { $params = array('contact_type' => 'Individual', 'first_name' => 'Foo', 'last_name' => 'Bear', 'check_permissions' => TRUE,); $result = $this->callAPISuccess('contact', 'create', $params); $config = CRM_Core_Config::singleton(); @@ -1672,7 +1672,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { $this->callAPISuccess('contact', 'update', $params, NULL, 'overfluous permissions should be enough to update a contact'); } - function createContactFromXML() { + public function createContactFromXML() { // Insert a row in civicrm_contact creating contact 17 $op = new PHPUnit_Extensions_Database_Operation_Insert(); $op->execute($this->_dbconn, @@ -1682,7 +1682,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { ); } - function testContactProximity() { + public function testContactProximity() { // first create a contact with a SF location with a specific // geocode $contactID = $this->organizationCreate(); @@ -1719,7 +1719,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { * Test that Ajax API permission is sufficient to access getquick api * (note that getquick api is required for autocomplete & has ACL permissions applied) */ - function testGetquickPermission_CRM_13744() { + public function testGetquickPermission_CRM_13744() { CRM_Core_Config::singleton()->userPermissionClass->permissions = array('access CiviEvent'); $this->callAPIFailure('contact', 'getquick', array('name' => 'b', 'check_permissions' => TRUE)); CRM_Core_Config::singleton()->userPermissionClass->permissions = array('access CiviCRM'); @@ -1731,7 +1731,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * Test get ref api - gets a list of references to an entity */ - function testGetReferenceCounts() { + public function testGetReferenceCounts() { $result = $this->callAPISuccess('Contact', 'create', array( 'first_name' => 'Testily', 'last_name' => 'McHaste', @@ -1784,7 +1784,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { $this->assertTrue(!isset($refCountsIdx['sql:civicrm_address:contact_id'])); } - function testSQLOperatorsOnContactAPI() { + public function testSQLOperatorsOnContactAPI() { $this->individualCreate(); $this->organizationCreate(); $this->householdCreate(); @@ -1797,7 +1797,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * CRM-14743 - test api respects search operators */ - function testGetModifiedDateByOperators() { + public function testGetModifiedDateByOperators() { $preExistingContactCount = CRM_Core_DAO::singleValueQuery('select count(*) FROM civicrm_contact'); $contact1 = $this->individualCreate(); $sql = "UPDATE civicrm_contact SET created_date = '2012-01-01', modified_date = '2013-01-01' WHERE id = " . $contact1; @@ -1817,7 +1817,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * CRM-14743 - test api respects search operators */ - function testGetCreatedDateByOperators() { + public function testGetCreatedDateByOperators() { $preExistingContactCount = CRM_Core_DAO::singleValueQuery('select count(*) FROM civicrm_contact'); $contact1 = $this->individualCreate(); $sql = "UPDATE civicrm_contact SET created_date = '2012-01-01' WHERE id = " . $contact1; @@ -1837,7 +1837,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * CRM-14263 check that API is not affected by search profile related bug */ - function testReturnCityProfile () { + public function testReturnCityProfile () { $contactID = $this->individualCreate(); CRM_Core_Config::singleton()->defaultSearchProfileID = 1; $this->callAPISuccess('address', 'create', array('contact_id' => $contactID, 'city' => 'Cool City', 'location_type_id' => 1,)); @@ -1848,7 +1848,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * CRM-15443 - ensure getlist api does not return deleted contacts */ - function testGetlistExcludeConditions() { + public function testGetlistExcludeConditions() { $name = md5(time()); $contact = $this->individualCreate(array('last_name' => $name)); $deceasedContact = $this->individualCreate(array('last_name' => $name, 'is_deceased' => 1)); @@ -1865,7 +1865,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { /** * Test contact.getactions */ - function testGetActions() { + public function testGetActions() { $description = "Getting the available actions for an entity."; $result = $this->callAPIAndDocument($this->_entity, 'getactions', array(), __FUNCTION__, __FILE__, $description); $expected = array( diff --git a/tests/phpunit/api/v3/ContactTypeTest.php b/tests/phpunit/api/v3/ContactTypeTest.php index 63a64da32f..87f9b2fe42 100644 --- a/tests/phpunit/api/v3/ContactTypeTest.php +++ b/tests/phpunit/api/v3/ContactTypeTest.php @@ -37,7 +37,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; class api_v3_ContactTypeTest extends CiviUnitTestCase { protected $_apiversion; - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(TRUE); $this->_apiversion = 3; @@ -76,7 +76,7 @@ class api_v3_ContactTypeTest extends CiviUnitTestCase { * Test add methods with valid data * success expected */ - function testContactCreate() { + public function testContactCreate() { // check for Type:Individual Subtype:sub_individual $contactParams = array( @@ -119,7 +119,7 @@ class api_v3_ContactTypeTest extends CiviUnitTestCase { /** * Test add with invalid data */ - function testContactAddInvalidData() { + public function testContactAddInvalidData() { // check for Type:Individual Subtype:sub_household $contactParams = array( @@ -144,7 +144,7 @@ class api_v3_ContactTypeTest extends CiviUnitTestCase { * Test update with no subtype to valid subtype * success expected */ - function testContactUpdateNoSubtypeValid() { + public function testContactUpdateNoSubtypeValid() { // check for Type:Individual $contactParams = array( @@ -209,7 +209,7 @@ class api_v3_ContactTypeTest extends CiviUnitTestCase { /** * Test update with no subtype to invalid subtype */ - function testContactUpdateNoSubtypeInvalid() { + public function testContactUpdateNoSubtypeInvalid() { // check for Type:Individual $contactParams = array( @@ -257,7 +257,7 @@ class api_v3_ContactTypeTest extends CiviUnitTestCase { * Test update with no subtype to valid subtype * success expected */ - function testContactUpdateSubtypeValid() { + public function testContactUpdateSubtypeValid() { $params = array( 'label' => 'sub2_individual', @@ -346,7 +346,7 @@ class api_v3_ContactTypeTest extends CiviUnitTestCase { /** * Test update with no subtype to invalid subtype */ - function testContactUpdateSubtypeInvalid() { + public function testContactUpdateSubtypeInvalid() { // check for Type:Individual subtype:sub_individual $contactParams = array( diff --git a/tests/phpunit/api/v3/ContributionPageTest.php b/tests/phpunit/api/v3/ContributionPageTest.php index cf7dde46ce..3c676a1e0c 100644 --- a/tests/phpunit/api/v3/ContributionPageTest.php +++ b/tests/phpunit/api/v3/ContributionPageTest.php @@ -81,7 +81,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase { ); } - function tearDown() { + public function tearDown() { foreach ($this->contactIds as $id) { $this->callAPISuccess('contact', 'delete', array('id' => $id)); } @@ -375,7 +375,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase { * Set up membership contribution page * @param bool $isSeparatePayment */ - function setUpMembershipContributionPage($isSeparatePayment = FALSE) { + public function setUpMembershipContributionPage($isSeparatePayment = FALSE) { $this->setUpMembershipBlockPriceSet(); $this->params['payment_processor_id'] = $this->_ids['payment_processor'] = $this->paymentProcessorCreate(array( 'payment_processor_type_id' => 'Dummy', @@ -399,7 +399,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase { * The default data set does not include a complete default membership price set - not quite sure why * This function ensures it exists & populates $this->_ids with it's data */ - function setUpMembershipBlockPriceSet() { + public function setUpMembershipBlockPriceSet() { $this->_ids['price_set'][] = $this->callAPISuccess('price_set', 'getvalue', array('name' => 'default_membership_type_amount', 'return' => 'id')); if (empty($this->_ids['membership_type'])) { $this->_ids['membership_type'] = array($this->membershipTypeCreate(array('minimum_fee' => 2))); @@ -429,7 +429,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase { /** * Help function to set up contribution page with some defaults */ - function setUpContributionPage() { + public function setUpContributionPage() { $contributionPageResult = $this->callAPISuccess($this->_entity, 'create', $this->params); if (empty($this->_ids['price_set'])) { $priceSet = $this->callAPISuccess('price_set', 'create', $this->_priceSetParams); diff --git a/tests/phpunit/api/v3/ContributionRecurTest.php b/tests/phpunit/api/v3/ContributionRecurTest.php index e492a0d611..188dba8d50 100644 --- a/tests/phpunit/api/v3/ContributionRecurTest.php +++ b/tests/phpunit/api/v3/ContributionRecurTest.php @@ -44,7 +44,7 @@ class api_v3_ContributionRecurTest extends CiviUnitTestCase { public $DBResetRequired = FALSE; - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(TRUE); $this->ids['contact'][0] = $this->individualCreate(); diff --git a/tests/phpunit/api/v3/ContributionSoftTest.php b/tests/phpunit/api/v3/ContributionSoftTest.php index 6884bb71d9..078edbf596 100644 --- a/tests/phpunit/api/v3/ContributionSoftTest.php +++ b/tests/phpunit/api/v3/ContributionSoftTest.php @@ -50,7 +50,7 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { protected $_params; - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(TRUE); @@ -88,7 +88,7 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { * Test get methods * @todo - this might be better broken down into more smaller tests */ - function testGetContributionSoft() { + public function testGetContributionSoft() { //We don't test for PCP fields because there's no PCP API, so we can't create campaigns. $p = array( 'contribution_id' => $this->_contributionId, @@ -156,19 +156,19 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { ///////////////// civicrm_contribution_soft - function testCreateEmptyParamsContributionSoft() { + public function testCreateEmptyParamsContributionSoft() { $softcontribution = $this->callAPIFailure('contribution_soft', 'create', array(), 'Mandatory key(s) missing from params array: contribution_id, amount, contact_id' ); } - function testCreateParamsWithoutRequiredKeysContributionSoft() { + public function testCreateParamsWithoutRequiredKeysContributionSoft() { $softcontribution = $this->callAPIFailure('contribution_soft', 'create', array(), 'Mandatory key(s) missing from params array: contribution_id, amount, contact_id' ); } - function testCreateContributionSoftInvalidContact() { + public function testCreateContributionSoftInvalidContact() { $params = array( 'contact_id' => 999, @@ -182,7 +182,7 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { ); } - function testCreateContributionSoftInvalidContributionId() { + public function testCreateContributionSoftInvalidContributionId() { $params = array( 'contribution_id' => 999999, @@ -199,7 +199,7 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { /* * Function tests that additional financial records are created when fee amount is recorded */ - function testCreateContributionSoft() { + public function testCreateContributionSoft() { $params = array( 'contribution_id' => $this->_contributionId, 'contact_id' => $this->_softIndividual1Id, @@ -217,7 +217,7 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { } //To Update Soft Contribution - function testCreateUpdateContributionSoft() { + public function testCreateUpdateContributionSoft() { //create a soft credit $params = array( 'contribution_id' => $this->_contributionId, @@ -278,19 +278,19 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { } ///////////////// civicrm_contribution_soft_delete methods - function testDeleteEmptyParamsContributionSoft() { + public function testDeleteEmptyParamsContributionSoft() { $params = array(); $softcontribution = $this->callAPIFailure('contribution_soft', 'delete', $params); } - function testDeleteWrongParamContributionSoft() { + public function testDeleteWrongParamContributionSoft() { $params = array( 'contribution_source' => 'SSF', ); $softcontribution = $this->callAPIFailure('contribution_soft', 'delete', $params); } - function testDeleteContributionSoft() { + public function testDeleteContributionSoft() { //create a soft credit $params = array( 'contribution_id' => $this->_contributionId, @@ -313,7 +313,7 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { * Test civicrm_contribution_search with empty params. * All available contributions expected. */ - function testSearchEmptyParams() { + public function testSearchEmptyParams() { $p = array( 'contribution_id' => $this->_contributionId, 'contact_id' => $this->_softIndividual1Id, @@ -335,7 +335,7 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { /** * Test civicrm_contribution_soft_search. Success expected. */ - function testSearch() { + public function testSearch() { $p1 = array( 'contribution_id' => $this->_contributionId, 'contact_id' => $this->_softIndividual1Id, diff --git a/tests/phpunit/api/v3/ContributionTest.php b/tests/phpunit/api/v3/ContributionTest.php index 160f2941c6..061854f512 100644 --- a/tests/phpunit/api/v3/ContributionTest.php +++ b/tests/phpunit/api/v3/ContributionTest.php @@ -51,7 +51,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { protected $_ids = array(); protected $_pageParams = array(); - function setUp() { + public function setUp() { parent::setUp(); $this->_apiversion = 3; @@ -92,11 +92,11 @@ class api_v3_ContributionTest extends CiviUnitTestCase { ); } - function tearDown() { + public function tearDown() { $this->quickCleanUpFinancialEntities(); } - function testGetContribution() { + public function testGetContribution() { $p = array( 'contact_id' => $this->_individualId, 'receive_date' => '2010-01-20', @@ -176,7 +176,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /** * We need to ensure previous tested behaviour still works as part of the api contract */ - function testGetContributionLegacyBehaviour() { + public function testGetContributionLegacyBehaviour() { $p = array( 'contact_id' => $this->_individualId, 'receive_date' => '2010-01-20', @@ -251,7 +251,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { )); } ///////////////// civicrm_contribution_ - function testCreateEmptyContributionIDUseDonation() { + public function testCreateEmptyContributionIDUseDonation() { $params = array( 'contribution_id' => FALSE, 'contact_id' => 1, @@ -266,7 +266,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { * stability *///////////////// civicrm_contribution_ - function testCreateLegacyBehaviour() { + public function testCreateLegacyBehaviour() { $params = array( 'contribution_id' => FALSE, 'contact_id' => 1, @@ -285,7 +285,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { * variables specific to participant so it can be replicated into other entities * and / or moved to the automated test suite */ - function testCreateWithCustom() { + public function testCreateWithCustom() { $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__); $params = $this->_params; @@ -308,7 +308,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { * variables specific to participant so it can be replicated into other entities * and / or moved to the automated test suite */ - function testCreateGetFieldsWithCustom() { + public function testCreateGetFieldsWithCustom() { $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__); $idsContact = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, 'ContactTest.php'); $result = $this->callAPISuccess('Contribution', 'getfields', array()); @@ -320,7 +320,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { $this->customGroupDelete($idsContact['custom_group_id']); } - function testCreateContributionNoLineItems() { + public function testCreateContributionNoLineItems() { $params = array( 'contact_id' => $this->_individualId, @@ -349,7 +349,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /* * Test checks that passing in line items suppresses the create mechanism */ - function testCreateContributionChainedLineItems() { + public function testCreateContributionChainedLineItems() { $params = array( 'contact_id' => $this->_individualId, @@ -394,7 +394,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { $this->assertEquals(2, $lineItems['count']); } - function testCreateContributionOffline() { + public function testCreateContributionOffline() { $params = array( 'contact_id' => $this->_individualId, 'receive_date' => '20120511', @@ -429,7 +429,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /** * Test create with valid payment instument */ - function testCreateContributionWithPaymentInstrument() { + public function testCreateContributionWithPaymentInstrument() { $params = $this->_params + array('payment_instrument' => 'EFT'); $contribution = $this->callAPISuccess('contribution', 'create', $params); $contribution = $this->callAPISuccess('contribution','get', array( @@ -448,7 +448,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { $this->assertEquals('Credit Card', $contribution['values'][0]['payment_instrument']); } - function testGetContributionByPaymentInstrument() { + public function testGetContributionByPaymentInstrument() { $params = $this->_params + array('payment_instrument' => 'EFT'); $params2 = $this->_params + array('payment_instrument' => 'Cash'); $this->callAPISuccess('contribution','create',$params); @@ -479,7 +479,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /** * Create test with unique field name on source */ - function testCreateContributionSource() { + public function testCreateContributionSource() { $params = array( 'contact_id' => $this->_individualId, @@ -504,7 +504,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /* * Create test with unique field name on source */ - function testCreateDefaultNow() { + public function testCreateDefaultNow() { $params = $this->_params; unset($params['receive_date']); @@ -517,7 +517,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /** * Create test with unique field name on source */ - function testCreateContributionSourceInvalidContac() { + public function testCreateContributionSourceInvalidContac() { $params = array( 'contact_id' => 999, @@ -537,7 +537,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { $this->callAPIFailure('contribution', 'create', $params, 'contact_id is not valid : 999'); } - function testCreateContributionSourceInvalidContContact() { + public function testCreateContributionSourceInvalidContContact() { $params = array( 'contribution_contact_id' => 999, @@ -560,7 +560,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /** * Test note created correctly */ - function testCreateContributionWithNote() { + public function testCreateContributionWithNote() { $description = "Demonstrates creating contribution with Note Entity"; $subfile = "ContributionCreateWithNote"; $params = array( @@ -585,7 +585,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { $this->callAPISuccess('contribution', 'delete', array('id' => $contribution['id'])); } - function testCreateContributionWithNoteUniqueNameAliases() { + public function testCreateContributionWithNoteUniqueNameAliases() { $params = array( 'contact_id' => $this->_individualId, 'receive_date' => '2012-01-01', @@ -612,7 +612,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { * This is the test for creating soft credits - however a 'get' is not yet possible via API * as the current BAO functions are contact-centric (from what I can find) */ - function testCreateContributionWithSoftCredt() { + public function testCreateContributionWithSoftCredt() { $description = "Demonstrates creating contribution with SoftCredit"; $subfile = "ContributionCreateWithSoftCredit"; $contact2 = $this->callAPISuccess('Contact', 'create', array('display_name' => 'superman', 'contact_type' => 'Individual')); @@ -634,7 +634,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { $this->callAPISuccess('contact', 'delete', array('id' => $contact2['id'])); } - function testCreateContributionWithSoftCreditDefaults() { + public function testCreateContributionWithSoftCreditDefaults() { $description = "Demonstrates creating contribution with Soft Credit defaults for amount and type"; $subfile = "ContributionCreateWithSoftCreditDefaults"; $contact2 = $this->callAPISuccess('Contact', 'create', array('display_name' => 'superman', 'contact_type' => 'Individual')); @@ -653,7 +653,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { $this->callAPISuccess('contact', 'delete', array('id' => $contact2['id'])); } - function testCreateContributionWithHonoreeContact() { + public function testCreateContributionWithHonoreeContact() { $description = "Demonstrates creating contribution with Soft Credit by passing in honor_contact_id"; $subfile = "ContributionCreateWithHonoreeContact"; $contact2 = $this->callAPISuccess('Contact', 'create', array('display_name' => 'superman', 'contact_type' => 'Individual')); @@ -676,7 +676,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /** * Test using example code */ - function testContributionCreateExample() { + public function testContributionCreateExample() { //make sure at least on page exists since there is a truncate in tear down $page = $this->callAPISuccess('contribution_page', 'create', $this->_pageParams); $this->assertAPISuccess($page); @@ -692,7 +692,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /* * Function tests that additional financial records are created when fee amount is recorded */ - function testCreateContributionWithFee() { + public function testCreateContributionWithFee() { $params = array( 'contact_id' => $this->_individualId, 'receive_date' => '20120511', @@ -740,7 +740,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /** * Function tests that additional financial records are created when online contribution is created */ - function testCreateContributionOnline() { + public function testCreateContributionOnline() { CRM_Financial_BAO_PaymentProcessor::create($this->_processorParams); $contributionPage = $this->callAPISuccess( 'contribution_page','create', $this->_pageParams ); $this->assertAPISuccess($contributionPage); @@ -773,7 +773,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { * In the interests of removing financial type / contribution type checks from * legacy format function lets test that the api is doing this for us */ - function testCreateInvalidFinancialType() { + public function testCreateInvalidFinancialType() { $params = $this->_params; $params['financial_type_id'] = 99999; $this->callAPIFailure($this->_entity, 'create', $params, "'99999' is not a valid option for field financial_type_id"); @@ -783,7 +783,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { * In the interests of removing financial type / contribution type checks from * legacy format function lets test that the api is doing this for us */ - function testValidNamedFinancialType() { + public function testValidNamedFinancialType() { $params = $this->_params; $params['financial_type_id'] = 'Donation'; $this->callAPISuccess($this->_entity, 'create', $params); @@ -793,7 +793,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { * Function tests that additional financial records are created when online contribution with pay later option * is created */ - function testCreateContributionPayLaterOnline() { + public function testCreateContributionPayLaterOnline() { CRM_Financial_BAO_PaymentProcessor::create($this->_processorParams); $this->_pageParams['is_pay_later'] = 1; $contributionPage = $this->callAPISuccess( 'contribution_page','create',$this->_pageParams ); @@ -827,7 +827,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { * Function tests that additional financial records are created when online contribution with pending option * is created */ - function testCreateContributionPendingOnline() { + public function testCreateContributionPendingOnline() { $paymentProcessor = CRM_Financial_BAO_PaymentProcessor::create($this->_processorParams); $contributionPage = $this->callAPISuccess( 'contribution_page', 'create', $this->_pageParams ); $this->assertAPISuccess($contributionPage); @@ -857,7 +857,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /** * Test that BAO defaults work */ - function testCreateBAODefaults() { + public function testCreateBAODefaults() { unset($this->_params['contribution_source_id'], $this->_params['payment_instrument_id']); $contribution = $this->callAPISuccess('contribution', 'create', $this->_params); $contribution = $this->callAPISuccess('contribution', 'getsingle', array('id' => $contribution['id'], 'api.contribution.delete' => 1)); @@ -868,7 +868,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /* * Function tests that line items, financial records are updated when contribution amount is changed */ - function testCreateUpdateContributionChangeTotal() { + public function testCreateUpdateContributionChangeTotal() { $contribution = $this->callAPISuccess('contribution', 'create', $this->_params); $lineItems = $this->callAPISuccess('line_item','getvalue', array( @@ -906,7 +906,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /* * Function tests that line items, financial records are updated when pay later contribution is received */ - function testCreateUpdateContributionPayLater() { + public function testCreateUpdateContributionPayLater() { $contribParams = array( 'contact_id' => $this->_individualId, 'receive_date' => '2012-01-01', @@ -933,7 +933,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /* * Function tests that financial records are updated when Payment Instrument is changed */ - function testCreateUpdateContributionPaymentInstrument() { + public function testCreateUpdateContributionPaymentInstrument() { $instrumentId = $this->_addPaymentInstrument(); $contribParams = array( 'contact_id' => $this->_individualId, @@ -957,7 +957,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /* * Function tests that financial records are added when Contribution is Refunded */ - function testCreateUpdateContributionRefund() { + public function testCreateUpdateContributionRefund() { $contribParams = array( 'contact_id' => $this->_individualId, 'receive_date' => '2012-01-01', @@ -982,7 +982,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /* * Function tests invalid contribution status change */ - function testCreateUpdateContributionInValidStatusChange() { + public function testCreateUpdateContributionInValidStatusChange() { $contribParams = array( 'contact_id' => 1, 'receive_date' => '2012-01-01', @@ -1004,7 +1004,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /* * Function tests that financial records are added when Pending Contribution is Canceled */ - function testCreateUpdateContributionCancelPending() { + public function testCreateUpdateContributionCancelPending() { $contribParams = array( 'contact_id' => $this->_individualId, 'receive_date' => '2012-01-01', @@ -1029,7 +1029,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /* * Function tests that financial records are added when Financial Type is Changed */ - function testCreateUpdateContributionChangeFinancialType() { + public function testCreateUpdateContributionChangeFinancialType() { $contribParams = array( 'contact_id' => $this->_individualId, 'receive_date' => '2012-01-01', @@ -1053,7 +1053,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /** * Test that update does not change status id CRM-15105 */ - function testCreateUpdateWithoutChangingPendingStatus() { + public function testCreateUpdateWithoutChangingPendingStatus() { $contribution = $this->callAPISuccess('contribution', 'create', array_merge($this->_params, array('contribution_status_id' => 2))); $this->callAPISuccess('contribution', 'create', array('id' => $contribution['id'], 'source' => 'new source')); $contribution = $this->callAPISuccess('contribution', 'getsingle', array('id' => $contribution['id'], 'api.contribution.delete' => 1)); @@ -1061,7 +1061,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { } //To Update Contribution //CHANGE: we require the API to do an incremental update - function testCreateUpdateContribution() { + public function testCreateUpdateContribution() { $contributionID = $this->contributionCreate($this->_individualId, $this->_financialTypeId, 'idofsh', 212355); $old_params = array( @@ -1129,18 +1129,18 @@ class api_v3_ContributionTest extends CiviUnitTestCase { } ///////////////// civicrm_contribution_delete methods - function testDeleteEmptyParamsContribution() { + public function testDeleteEmptyParamsContribution() { $params = array(); $this->callAPIFailure('contribution', 'delete', $params); } - function testDeleteParamsNotArrayContribution() { + public function testDeleteParamsNotArrayContribution() { $params = 'contribution_id= 1'; $contribution = $this->callAPIFailure('contribution', 'delete', $params); $this->assertEquals($contribution['error_message'], 'Input variable `params` is not an array'); } - function testDeleteWrongParamContribution() { + public function testDeleteWrongParamContribution() { $params = array( 'contribution_source' => 'SSF', @@ -1148,7 +1148,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { $this->callAPIFailure('contribution', 'delete', $params); } - function testDeleteContribution() { + public function testDeleteContribution() { $contributionID = $this->contributionCreate($this->_individualId, $this->_financialTypeId, 'dfsdf', 12389); $params = array( @@ -1161,7 +1161,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { * Test civicrm_contribution_search with empty params. * All available contributions expected. */ - function testSearchEmptyParams() { + public function testSearchEmptyParams() { $params = array(); $p = array( @@ -1202,7 +1202,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /** * Test civicrm_contribution_search. Success expected. */ - function testSearch() { + public function testSearch() { $p1 = array( 'contact_id' => $this->_individualId, 'receive_date' => date('Ymd'), @@ -1257,7 +1257,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { * Note that we are creating a logged in user because email goes out from * that person */ - function testCompleteTransaction() { + public function testCompleteTransaction() { $mut = new CiviMailUtils( $this, true ); $this->createLoggedInUser(); $params = array_merge($this->_params, array('contribution_status_id' => 2,)); @@ -1280,7 +1280,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { * * tests. */ - function testCompleteTransactionWithReceiptDateSet() { + public function testCompleteTransactionWithReceiptDateSet() { $mut = new CiviMailUtils( $this, true ); $this->createLoggedInUser(); $params = array_merge($this->_params, array('contribution_status_id' => 2,'receipt_date' => 'now')); @@ -1301,7 +1301,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { * Note that we are creating a logged in user because email goes out from * that person */ - function testCompleteTransactionWithParticipantRecord() { + public function testCompleteTransactionWithParticipantRecord() { $mut = new CiviMailUtils( $this, true ); $mut->clearMessages(); $this->createLoggedInUser(); @@ -1322,7 +1322,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /** * Test membership is renewed when transaction completed */ - function testCompleteTransactionMembershipPriceSet() { + public function testCompleteTransactionMembershipPriceSet() { $this->createPriceSetWithPage('membership'); $this->setUpPendingContribution($this->_ids['price_field_value'][0]); $this->callAPISuccess('contribution', 'completetransaction', array('id' => $this->_ids['contribution'])); @@ -1334,7 +1334,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /** * Test membership is renewed when transaction completed */ - function testCompleteTransactionMembershipPriceSetTwoTerms() { + public function testCompleteTransactionMembershipPriceSetTwoTerms() { $this->createPriceSetWithPage('membership'); $this->setUpPendingContribution($this->_ids['price_field_value'][1]); $this->callAPISuccess('contribution', 'completetransaction', array('id' => $this->_ids['contribution'])); @@ -1343,7 +1343,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { $this->cleanUpAfterPriceSets(); } - function cleanUpAfterPriceSets() { + public function cleanUpAfterPriceSets() { $this->quickCleanUpFinancialEntities(); $this->contactDelete($this->_ids['contact']); $this->callAPISuccess('price_set', 'delete', array('id' => $this->_ids['price_set'])); @@ -1356,7 +1356,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { * @param $entity * @param array $params */ - function createPriceSetWithPage($entity, $params = array()) { + public function createPriceSetWithPage($entity, $params = array()) { $membershipTypeID = $this->membershipTypeCreate(); $contributionPageResult = $this->callAPISuccess('contribution_page', 'create', array( 'title' => "Test Contribution Page", @@ -1412,7 +1412,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { * Set up a pending transaction with a specific price field id * @param int $priceFieldValueID */ - function setUpPendingContribution($priceFieldValueID){ + public function setUpPendingContribution($priceFieldValueID){ $contactID = $this->individualCreate(); $membership = $this->callAPISuccess('membership', 'create', array( 'contact_id' => $contactID, @@ -1455,7 +1455,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /** * Test sending a mail via the API */ - function testSendMail() { + public function testSendMail() { $mut = new CiviMailUtils( $this, true ); $contribution = $this->callAPISuccess('contribution','create',$this->_params); $this->callAPISuccess('contribution', 'sendconfirmation', array( @@ -1477,7 +1477,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /** * Test sending a mail via the API */ - function testSendMailEvent() { + public function testSendMailEvent() { $mut = new CiviMailUtils( $this, true ); $contribution = $this->callAPISuccess('contribution','create',$this->_params); $event = $this->eventCreate(array( @@ -1521,7 +1521,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { * This function does a GET & compares the result against the $params * Use as a double check on Creates */ - function contributionGetnCheck($params, $id, $delete = 1) { + public function contributionGetnCheck($params, $id, $delete = 1) { $contribution = $this->callAPISuccess('Contribution', 'Get', array( 'id' => $id, @@ -1547,7 +1547,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { * Create a pending contribution & linked pending participant record * (along with an event) */ - function createPendingParticipantContribution(){ + public function createPendingParticipantContribution(){ $event = $this->eventCreate(array('is_email_confirm' => 1, 'confirm_from_email' => 'test@civicrm.org',)); $participantID = $this->participantCreate(array('event_id' => $event['id'], 'status_id' => 6)); $this->_ids['participant'] = $participantID; @@ -1600,7 +1600,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { * @param int $contId * @param $context */ - function _checkFinancialItem($contId, $context) { + public function _checkFinancialItem($contId, $context) { if ($context != 'paylater') { $params = array ( 'entity_id' => $contId, @@ -1669,7 +1669,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { * @param $context * @param int $instrumentId */ - function _checkFinancialTrxn($contribution, $context, $instrumentId = NULL) { + public function _checkFinancialTrxn($contribution, $context, $instrumentId = NULL) { $trxnParams = array( 'entity_id' => $contribution['id'], 'entity_table' => 'civicrm_contribution', @@ -1739,7 +1739,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /** * @return mixed */ - function _addPaymentInstrument () { + public function _addPaymentInstrument () { $gId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'payment_instrument', 'id', 'name'); $optionParams = array( 'option_group_id' => $gId, @@ -1766,7 +1766,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { * @param array $params * @param $context */ - function _checkFinancialRecords($params,$context) { + public function _checkFinancialRecords($params,$context) { $entityParams = array( 'entity_id' => $params['id'], 'entity_table' => 'civicrm_contribution', diff --git a/tests/phpunit/api/v3/CountryTest.php b/tests/phpunit/api/v3/CountryTest.php index 49da6db407..61f91f24fa 100644 --- a/tests/phpunit/api/v3/CountryTest.php +++ b/tests/phpunit/api/v3/CountryTest.php @@ -40,7 +40,7 @@ class api_v3_CountryTest extends CiviUnitTestCase { protected $_params; - function setUp() { + public function setUp() { $this->_apiversion = 3; parent::setUp(); $this->useTransaction(TRUE); diff --git a/tests/phpunit/api/v3/CustomFieldTest.php b/tests/phpunit/api/v3/CustomFieldTest.php index 05d449f8d1..9c3165f37f 100644 --- a/tests/phpunit/api/v3/CustomFieldTest.php +++ b/tests/phpunit/api/v3/CustomFieldTest.php @@ -39,12 +39,12 @@ require_once 'tests/phpunit/CiviTest/CiviUnitTestCase.php'; class api_v3_CustomFieldTest extends CiviUnitTestCase { protected $_apiversion; - function setUp() { + public function setUp() { $this->_apiversion = 3; parent::setUp(); } - function tearDown() { + public function tearDown() { $tablesToTruncate = array( 'civicrm_custom_group', 'civicrm_custom_field', ); @@ -55,7 +55,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { /** * Check with no array */ - function testCustomFieldCreateNoArray() { + public function testCustomFieldCreateNoArray() { $fieldParams = NULL; $customField = $this->callAPIFailure('custom_field', 'create', $fieldParams); @@ -65,7 +65,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { /** * Check with no label */ - function testCustomFieldCreateWithoutLabel() { + public function testCustomFieldCreateWithoutLabel() { $customGroup = $this->customGroupCreate(array('extends' => 'Individual', 'title' => 'text_test_group')); $params = array( 'custom_group_id' => $customGroup['id'], @@ -86,7 +86,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { /** * Check with edit */ - function testCustomFieldCreateWithEdit() { + public function testCustomFieldCreateWithEdit() { $customGroup = $this->customGroupCreate(array('extends' => 'Individual', 'title' => 'text_test_group')); $params = array( 'custom_group_id' => $customGroup['id'], @@ -111,7 +111,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { /** * Check without groupId */ - function testCustomFieldCreateWithoutGroupID() { + public function testCustomFieldCreateWithoutGroupID() { $fieldParams = array( 'name' => 'test_textfield1', 'label' => 'Name', @@ -132,7 +132,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { /** * Check for Each data type: loop through available form input types **/ - function testCustomFieldCreateAllAvailableFormInputs() { + public function testCustomFieldCreateAllAvailableFormInputs() { $gid = $this->customGroupCreate(array('extends' => 'Individual', 'title' => 'testAllFormInputs')); $dtype = CRM_Core_BAO_CustomField::dataType(); @@ -153,7 +153,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { /** * @param array $params */ - function _loopingCustomFieldCreateTest($params) { + public function _loopingCustomFieldCreateTest($params) { $customField = $this->callAPISuccess('custom_field', 'create', $params); $this->assertNotNull($customField['id']); $this->getAndCheck($params, $customField['id'], 'CustomField'); @@ -166,7 +166,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { * * @return array */ - function _buildParams($gid, $htype, $dtype) { + public function _buildParams($gid, $htype, $dtype) { $params = $this->_buildBasicParams($gid, $htype, $dtype); /* //Not Working for any type. Maybe redundant with testCustomFieldCreateWithOptionValues() if ($htype == 'Multi-Select') @@ -190,7 +190,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { * * @return array */ - function _buildBasicParams($gid, $htype, $dtype) { + public function _buildBasicParams($gid, $htype, $dtype) { return array( 'custom_group_id' => $gid, 'label' => $dtype . $htype, @@ -221,7 +221,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { /** * Check with data type - Options with option_values */ - function testCustomFieldCreateWithEmptyOptionGroup() { + public function testCustomFieldCreateWithEmptyOptionGroup() { $customGroup = $this->customGroupCreate(array('extends' => 'Contact', 'title' => 'select_test_group')); $params = array( 'custom_group_id' => $customGroup['id'], @@ -253,7 +253,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { /** * Test custom field with existing option group */ - function testCustomFieldExistingOptionGroup() { + public function testCustomFieldExistingOptionGroup() { $customGroup = $this->customGroupCreate(array('extends' => 'Organization', 'title' => 'test_group')); $params = array( 'custom_group_id' => $customGroup['id'], @@ -283,7 +283,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { /** * Test custom field get works & return param works */ - function testCustomFieldGetReturnOptions(){ + public function testCustomFieldGetReturnOptions(){ $customGroup = $this->customGroupCreate(array('extends' => 'Individual', 'title' => 'test_group')); $customField = $this->customFieldCreate(array('custom_group_id' => $customGroup['id'])); @@ -298,7 +298,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { /** * Test custom field get works & return param works */ - function testCustomFieldGetReturnArray(){ + public function testCustomFieldGetReturnArray(){ $customGroup = $this->customGroupCreate(array('extends' => 'Individual', 'title' => 'test_group')); $customField = $this->customFieldCreate(array('custom_group_id' => $customGroup['id'])); @@ -313,7 +313,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { /** * Test custom field get works & return param works */ - function testCustomFieldGetReturnTwoOptions(){ + public function testCustomFieldGetReturnTwoOptions(){ $customGroup = $this->customGroupCreate(array('extends' => 'Individual', 'test_group')); $customField = $this->customFieldCreate(array('custom_group_id' => $customGroup['id'])); @@ -326,7 +326,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { $this->assertFalse(array_key_exists('label', $result)); } - function testCustomFieldCreateWithOptionValues() { + public function testCustomFieldCreateWithOptionValues() { $customGroup = $this->customGroupCreate(array('extends' => 'Contact', 'title' => 'select_test_group')); $option_values = array( @@ -383,7 +383,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { /** * Check with no array */ - function testCustomFieldDeleteNoArray() { + public function testCustomFieldDeleteNoArray() { $params = NULL; $customField = $this->callAPIFailure('custom_field', 'delete', $params); $this->assertEquals($customField['error_message'], 'Input variable `params` is not an array'); @@ -392,7 +392,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { /** * Check without Field ID */ - function testCustomFieldDeleteWithoutFieldID() { + public function testCustomFieldDeleteWithoutFieldID() { $params = array(); $customField = $this->callAPIFailure('custom_field', 'delete', $params, 'Mandatory key(s) missing from params array: id'); @@ -401,7 +401,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { /** * Check without valid array */ - function testCustomFieldDelete() { + public function testCustomFieldDelete() { $customGroup = $this->customGroupCreate(array('extends' => 'Individual', 'title' => 'test_group')); $customField = $this->customFieldCreate(array('custom_group_id' => $customGroup['id'])); $this->assertNotNull($customField['id'], 'in line ' . __LINE__); @@ -417,7 +417,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { /** * Check for Option Value */ - function testCustomFieldOptionValueDelete() { + public function testCustomFieldOptionValueDelete() { $customGroup = $this->customGroupCreate(array('extends' => 'Contact', 'title' => 'ABC')); $customOptionValueFields = $this->customFieldOptionValueCreate($customGroup, 'fieldABC'); $params = array( @@ -432,7 +432,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { * and "Activity.getfields" should return only their respective fields (not the other's fields), * and unrelated entities should return no custom fields. */ - function testGetfields_CrossEntityPollution() { + public function testGetfields_CrossEntityPollution() { $auxEntities = array('Email', 'Address', 'LocBlock', 'Membership', 'ContributionPage', 'ReportInstance'); $allEntities = array_merge(array('Contact', 'Activity'), $auxEntities); @@ -488,7 +488,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { * * @return array */ - function getCustomFieldKeys($getFieldsResult) { + public function getCustomFieldKeys($getFieldsResult) { $isCustom = function($key) { return preg_match('/^custom_/', $key); }; diff --git a/tests/phpunit/api/v3/CustomGroupTest.php b/tests/phpunit/api/v3/CustomGroupTest.php index e93934c1b0..160063e439 100644 --- a/tests/phpunit/api/v3/CustomGroupTest.php +++ b/tests/phpunit/api/v3/CustomGroupTest.php @@ -42,7 +42,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { public $DBResetRequired = TRUE; - function setUp() { + public function setUp() { $this->_entity = 'CustomGroup'; $this->_params = array( 'title' => 'Test_Group_1', @@ -58,7 +58,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { parent::setUp(); } - function tearDown() { + public function tearDown() { $tablesToTruncate = array('civicrm_custom_group', 'civicrm_custom_field'); // true tells quickCleanup to drop any tables that might have been created in the test $this->quickCleanup($tablesToTruncate, TRUE); @@ -72,7 +72,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { * code. The SyntaxConformance is capable of testing this for all entities on create * & delete (& it would be easy to add if not there) */ - function testCustomGroupCreateNoParam() { + public function testCustomGroupCreateNoParam() { $customGroup = $this->callAPIFailure('custom_group', 'create', array(), 'Mandatory key(s) missing from params array: title, extends' ); @@ -81,7 +81,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { /** * Check with empty array */ - function testCustomGroupCreateNoExtends() { + public function testCustomGroupCreateNoExtends() { $params = array( 'domain_id' => 1, 'title' => 'Test_Group_1', @@ -102,7 +102,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { /** * Check with empty array */ - function testCustomGroupCreateInvalidExtends() { + public function testCustomGroupCreateInvalidExtends() { $params = array( 'domain_id' => 1, 'title' => 'Test_Group_1', @@ -123,7 +123,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { /** * Check with a string instead of array for extends */ - function testCustomGroupCreateExtendsString() { + public function testCustomGroupCreateExtendsString() { $params = array( 'domain_id' => 1, 'title' => 'Test_Group_1', @@ -143,7 +143,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { /** * Check with valid array */ - function testCustomGroupCreate() { + public function testCustomGroupCreate() { $params = array( 'title' => 'Test_Group_1', 'name' => 'test_group_1', @@ -164,7 +164,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { /** * Check with valid array */ - function testCustomGroupGetFields() { + public function testCustomGroupGetFields() { $params = array( 'options' => array('get_options' => 'style'), ); @@ -181,7 +181,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { /** * Check with extends array length greater than 1 */ - function testCustomGroupExtendsMultipleCreate() { + public function testCustomGroupExtendsMultipleCreate() { $params = array( 'title' => 'Test_Group_1', 'name' => 'test_group_1', @@ -201,7 +201,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { /** * Check with style missing from params array */ - function testCustomGroupCreateNoStyle() { + public function testCustomGroupCreateNoStyle() { $params = array( 'title' => 'Test_Group_1', 'name' => 'test_group_1', @@ -221,7 +221,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { /** * Check with not array */ - function testCustomGroupCreateNotArray() { + public function testCustomGroupCreateNotArray() { $params = NULL; $customGroup = $this->callAPIFailure('custom_group', 'create', $params); $this->assertEquals($customGroup['error_message'], 'Input variable `params` is not an array', 'In line ' . __LINE__); @@ -230,7 +230,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { /** * Check without title */ - function testCustomGroupCreateNoTitle() { + public function testCustomGroupCreateNoTitle() { $params = array('extends' => array('Contact'), 'weight' => 5, 'collapse_display' => 1, @@ -246,7 +246,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { /** * Check for household without weight */ - function testCustomGroupCreateHouseholdNoWeight() { + public function testCustomGroupCreateHouseholdNoWeight() { $params = array( 'title' => 'Test_Group_3', 'name' => 'test_group_3', @@ -267,7 +267,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { /** * Check for Contribution Donation */ - function testCustomGroupCreateContributionDonation() { + public function testCustomGroupCreateContributionDonation() { $params = array( 'title' => 'Test_Group_6', 'name' => 'test_group_6', @@ -288,7 +288,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { /** * Check with valid array */ - function testCustomGroupCreateGroup() { + public function testCustomGroupCreateGroup() { $params = array( 'domain_id' => 1, 'title' => 'Test_Group_8', @@ -310,7 +310,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { /** * Check with Activity - Meeting Type */ - function testCustomGroupCreateActivityMeeting() { + public function testCustomGroupCreateActivityMeeting() { $params = array( 'title' => 'Test_Group_10', 'name' => 'test_group_10', @@ -332,7 +332,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { /** * Check without GroupID */ - function testCustomGroupDeleteWithoutGroupID() { + public function testCustomGroupDeleteWithoutGroupID() { $customGroup = $this->callAPIFailure('custom_group', 'delete', array()); $this->assertEquals($customGroup['error_message'], 'Mandatory key(s) missing from params array: id', 'In line ' . __LINE__); } @@ -340,7 +340,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { /** * Check with no array */ - function testCustomGroupDeleteNoArray() { + public function testCustomGroupDeleteNoArray() { $params = NULL; $customGroup = $this->callAPIFailure('custom_group', 'delete', $params); $this->assertEquals($customGroup['error_message'], 'Input variable `params` is not an array', 'In line ' . __LINE__); @@ -349,7 +349,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { /** * Check with valid custom group id */ - function testCustomGroupDelete() { + public function testCustomGroupDelete() { $customGroup = $this->customGroupCreate(array('extends' => 'Individual', 'title' => 'test_group')); $params = array( 'id' => $customGroup['id'], diff --git a/tests/phpunit/api/v3/CustomSearchTest.php b/tests/phpunit/api/v3/CustomSearchTest.php index 55baa300ae..a0b658801f 100644 --- a/tests/phpunit/api/v3/CustomSearchTest.php +++ b/tests/phpunit/api/v3/CustomSearchTest.php @@ -8,7 +8,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; class api_v3_CustomSearchTest extends CiviUnitTestCase { protected $_apiversion; - function setUp() { + public function setUp() { $this->_apiversion = 3; parent::setUp(); $this->useTransaction(TRUE); diff --git a/tests/phpunit/api/v3/CustomValueContactTypeTest.php b/tests/phpunit/api/v3/CustomValueContactTypeTest.php index c4648f7d44..509886df02 100644 --- a/tests/phpunit/api/v3/CustomValueContactTypeTest.php +++ b/tests/phpunit/api/v3/CustomValueContactTypeTest.php @@ -40,7 +40,7 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase { protected $CustomGroupIndividual; protected $individualStudent; - function setUp() { + public function setUp() { parent::setUp(); // Create Group For Individual Contact Type $groupIndividual = array( @@ -108,14 +108,14 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase { CRM_Core_BAO_CustomField::getTableColumnGroup($this->IndiStudentField['id'], True); } - function tearDown() { + public function tearDown() { $tablesToTruncate = array('civicrm_contact', 'civicrm_cache'); $this->quickCleanup($tablesToTruncate, TRUE); } /* * Test that custom fields is returned for correct contact type only */ - function testGetFields() { + public function testGetFields() { $result = $this->callAPISuccess('Contact', 'getfields', array()); $this->assertArrayHasKey("custom_{$this->IndividualField['id']}", $result['values'], 'If This fails there is probably a caching issue - failure in line' . __LINE__ . print_r(array_keys($result['values']), TRUE)); $result = $this->callAPISuccess('Contact', 'getfields', array('action' => 'create', 'contact_type' => 'Individual'), 'in line' . __LINE__); @@ -129,7 +129,7 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase { /** * Add Custom data of Contact Type : Individual to a Contact type: Organization */ - function testAddIndividualCustomDataToOrganization() { + public function testAddIndividualCustomDataToOrganization() { $params = array( 'id' => $this->organization, @@ -146,7 +146,7 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase { * Add valid Empty params to a Contact Type : Individual * note - don't copy & paste this - is of marginal value */ - function testAddCustomDataEmptyToIndividual() { + public function testAddCustomDataEmptyToIndividual() { $contact = $this->callAPIFailure('contact', 'create', array(), 'Mandatory key(s) missing from params array: contact_type' ); @@ -155,7 +155,7 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase { /** * Add valid custom data to a Contact Type : Individual */ - function testAddValidCustomDataToIndividual() { + public function testAddValidCustomDataToIndividual() { $params = array( 'contact_id' => $this->individual, @@ -175,7 +175,7 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase { /** * Add Custom data of Contact Type : Individual , SubType : Student to a Contact type: Organization Subtype: Sponsor */ - function testAddIndividualStudentCustomDataToOrganizationSponsor() { + public function testAddIndividualStudentCustomDataToOrganizationSponsor() { $params = array( 'contact_id' => $this->organizationSponsor, @@ -192,7 +192,7 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase { /** * Add valid custom data to a Contact Type : Individual Subtype: Student */ - function testCreateValidCustomDataToIndividualStudent() { + public function testCreateValidCustomDataToIndividualStudent() { $params = array( 'contact_id' => $this->individualStudent, @@ -212,7 +212,7 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase { /** * Add custom data of Individual Student to a Contact Type : Individual - parent */ - function testAddIndividualStudentCustomDataToIndividualParent() { + public function testAddIndividualStudentCustomDataToIndividualParent() { $params = array( 'contact_id' => $this->individualParent, @@ -231,7 +231,7 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase { /** * Retrieve Valid custom Data added to Individual Contact Type */ - function testRetrieveValidCustomDataToIndividual() { + public function testRetrieveValidCustomDataToIndividual() { $params = array( 'contact_id' => $this->individual, @@ -255,7 +255,7 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase { /** * Retrieve Valid custom Data added to Individual Contact Type , Subtype : Student. */ - function testRetrieveValidCustomDataToIndividualStudent() { + public function testRetrieveValidCustomDataToIndividualStudent() { $params = array( 'contact_id' => $this->individualStudent, diff --git a/tests/phpunit/api/v3/CustomValueTest.php b/tests/phpunit/api/v3/CustomValueTest.php index 89aa3de7ce..799ce5bdcb 100644 --- a/tests/phpunit/api/v3/CustomValueTest.php +++ b/tests/phpunit/api/v3/CustomValueTest.php @@ -38,7 +38,7 @@ class api_v3_CustomValueTest extends CiviUnitTestCase { public $DBResetRequired = FALSE; - function setUp() { + public function setUp() { parent::setUp(); $this->individual = $this->individualCreate(); $this->params = array( @@ -49,7 +49,7 @@ class api_v3_CustomValueTest extends CiviUnitTestCase { $this->ids['multi2'] = $this->CustomGroupMultipleCreateWithFields(array('title' => 'group2')); } - function tearDown() { + public function tearDown() { $tablesToTruncate = array( 'civicrm_email', 'civicrm_custom_field', diff --git a/tests/phpunit/api/v3/DashboardContactTest.php b/tests/phpunit/api/v3/DashboardContactTest.php index cd0cf03672..5db408c5c0 100644 --- a/tests/phpunit/api/v3/DashboardContactTest.php +++ b/tests/phpunit/api/v3/DashboardContactTest.php @@ -49,7 +49,7 @@ class api_v3_DashboardContactTest extends CiviUnitTestCase { $this->useTransaction(TRUE); } - function testDashboardContactCreate() { + public function testDashboardContactCreate() { $dashParams = array( 'version' => 3, 'label' => 'New Dashlet element', diff --git a/tests/phpunit/api/v3/DashboardTest.php b/tests/phpunit/api/v3/DashboardTest.php index 3e031d96fd..b874f194a9 100644 --- a/tests/phpunit/api/v3/DashboardTest.php +++ b/tests/phpunit/api/v3/DashboardTest.php @@ -49,7 +49,7 @@ class api_v3_DashboardTest extends CiviUnitTestCase { $this->useTransaction(TRUE); } - function testDashboardCreate() { + public function testDashboardCreate() { $oldCount = CRM_Core_DAO::singleValueQuery('select count(*) from civicrm_dashboard'); $params = array( 'version' => 3, @@ -70,7 +70,7 @@ class api_v3_DashboardTest extends CiviUnitTestCase { * @param int $id * @param $oldCount */ - function DashboardDelete($id, $oldCount) { + public function DashboardDelete($id, $oldCount) { $params = array( 'version' => 3, 'id' => $id, diff --git a/tests/phpunit/api/v3/EmailTest.php b/tests/phpunit/api/v3/EmailTest.php index ddd5b3b7e6..d2eae37cac 100644 --- a/tests/phpunit/api/v3/EmailTest.php +++ b/tests/phpunit/api/v3/EmailTest.php @@ -37,7 +37,7 @@ class api_v3_EmailTest extends CiviUnitTestCase { protected $_entity; protected $_params; - function setUp() { + public function setUp() { $this->_apiversion = 3; $this->_entity = 'Email'; parent::setUp(); diff --git a/tests/phpunit/api/v3/EntityTagTest.php b/tests/phpunit/api/v3/EntityTagTest.php index d6fe580593..cb2c4f7d89 100644 --- a/tests/phpunit/api/v3/EntityTagTest.php +++ b/tests/phpunit/api/v3/EntityTagTest.php @@ -51,7 +51,7 @@ class api_v3_EntityTagTest extends CiviUnitTestCase { protected $_entity = 'entity_tag'; - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(TRUE); @@ -62,13 +62,13 @@ class api_v3_EntityTagTest extends CiviUnitTestCase { $this->_organizationID = $this->organizationCreate(); } - function testAddEmptyParams() { + public function testAddEmptyParams() { $individualEntity = $this->callAPIFailure('entity_tag', 'create', $params = array(), 'contact_id is a required field' ); } - function testAddWithoutTagID() { + public function testAddWithoutTagID() { $params = array( 'contact_id' => $this->_individualID, ); @@ -77,7 +77,7 @@ class api_v3_EntityTagTest extends CiviUnitTestCase { ); } - function testAddWithoutContactID() { + public function testAddWithoutContactID() { $params = array( 'tag_id' => $this->_tagID, ); @@ -85,7 +85,7 @@ class api_v3_EntityTagTest extends CiviUnitTestCase { 'contact_id is a required field'); } - function testContactEntityTagCreate() { + public function testContactEntityTagCreate() { $params = array( 'contact_id' => $this->_individualID, 'tag_id' => $this->_tagID, @@ -95,7 +95,7 @@ class api_v3_EntityTagTest extends CiviUnitTestCase { $this->assertEquals($result['added'], 1); } - function testAddDouble() { + public function testAddDouble() { $individualId = $this->_individualID; $organizationId = $this->_organizationID; $tagID = $this->_tagID; @@ -120,7 +120,7 @@ class api_v3_EntityTagTest extends CiviUnitTestCase { } ///////////////// civicrm_entity_tag_get methods - function testGetNoEntityID() { + public function testGetNoEntityID() { $ContactId = $this->_individualID; $tagID = $this->_tagID; $params = array( @@ -134,7 +134,7 @@ class api_v3_EntityTagTest extends CiviUnitTestCase { $this->assertEquals($ContactId, $result['values'][0]['entity_id']); } - function testIndividualEntityTagGet() { + public function testIndividualEntityTagGet() { $contactId = $this->_individualID; $tagID = $this->_tagID; $params = array( @@ -151,7 +151,7 @@ class api_v3_EntityTagTest extends CiviUnitTestCase { $entity = $this->callAPISuccess('entity_tag', 'get', $paramsEntity); } - function testHouseholdEntityGet() { + public function testHouseholdEntityGet() { $ContactId = $this->_householdID; $tagID = $this->_tagID; $params = array( @@ -163,7 +163,7 @@ class api_v3_EntityTagTest extends CiviUnitTestCase { $this->assertEquals($householdEntity['added'], 1); } - function testOrganizationEntityGet() { + public function testOrganizationEntityGet() { $ContactId = $this->_organizationID; $tagID = $this->_tagID; $params = array( @@ -179,7 +179,7 @@ class api_v3_EntityTagTest extends CiviUnitTestCase { } ///////////////// civicrm_entity_tag_Delete methods - function testEntityTagDeleteNoTagId() { + public function testEntityTagDeleteNoTagId() { $entityTagParams = array( 'contact_id_i' => $this->_individualID, 'contact_id_h' => $this->_householdID, @@ -197,7 +197,7 @@ class api_v3_EntityTagTest extends CiviUnitTestCase { ); } - function testEntityTagDeleteINDHH() { + public function testEntityTagDeleteINDHH() { $entityTagParams = array( 'contact_id_i' => $this->_individualID, 'contact_id_h' => $this->_householdID, @@ -216,7 +216,7 @@ class api_v3_EntityTagTest extends CiviUnitTestCase { $this->assertEquals($result['removed'], 2); } - function testEntityTagDeleteHH() { + public function testEntityTagDeleteHH() { $entityTagParams = array( 'contact_id_i' => $this->_individualID, 'contact_id_h' => $this->_householdID, @@ -233,7 +233,7 @@ class api_v3_EntityTagTest extends CiviUnitTestCase { $this->assertEquals($result['removed'], 1); } - function testEntityTagDeleteHHORG() { + public function testEntityTagDeleteHHORG() { $entityTagParams = array( 'contact_id_i' => $this->_individualID, 'contact_id_h' => $this->_householdID, @@ -254,7 +254,7 @@ class api_v3_EntityTagTest extends CiviUnitTestCase { ///////////////// civicrm_tag_entities_get methods - function testCommonContactEntityTagAdd() { + public function testCommonContactEntityTagAdd() { $params = array( 'contact_id' => $this->_individualID, 'tag_id' => $this->_tagID, @@ -265,7 +265,7 @@ class api_v3_EntityTagTest extends CiviUnitTestCase { } - function testEntityTagCommonDeleteINDHH() { + public function testEntityTagCommonDeleteINDHH() { $entityTagParams = array( 'contact_id_i' => $this->_individualID, 'contact_id_h' => $this->_householdID, @@ -283,7 +283,7 @@ class api_v3_EntityTagTest extends CiviUnitTestCase { $this->assertEquals($result['removed'], 2); } - function testEntityTagCommonDeleteHH() { + public function testEntityTagCommonDeleteHH() { $entityTagParams = array( 'contact_id_i' => $this->_individualID, 'contact_id_h' => $this->_householdID, @@ -300,7 +300,7 @@ class api_v3_EntityTagTest extends CiviUnitTestCase { $this->assertEquals($result['removed'], 1); } - function testEntityTagCommonDeleteHHORG() { + public function testEntityTagCommonDeleteHHORG() { $entityTagParams = array( 'contact_id_i' => $this->_individualID, 'contact_id_h' => $this->_householdID, diff --git a/tests/phpunit/api/v3/EventTest.php b/tests/phpunit/api/v3/EventTest.php index 4af5b729fd..8e67c374d6 100644 --- a/tests/phpunit/api/v3/EventTest.php +++ b/tests/phpunit/api/v3/EventTest.php @@ -37,7 +37,7 @@ class api_v3_EventTest extends CiviUnitTestCase { protected $_apiversion; protected $_entity; - function setUp() { + public function setUp() { parent::setUp(); $this->_apiversion = 3; $this->_entity = 'event'; @@ -98,7 +98,7 @@ class api_v3_EventTest extends CiviUnitTestCase { } } - function tearDown() { + public function tearDown() { foreach ($this->eventIds as $eventId) { $this->eventDelete($eventId); } @@ -111,14 +111,14 @@ class api_v3_EventTest extends CiviUnitTestCase { ///////////////// civicrm_event_get methods - function testGetEventById() { + public function testGetEventById() { $params = array( 'id' => $this->_events[1]['id'],); $result = $this->callAPISuccess('event', 'get', $params); $this->assertEquals($result['values'][$this->_eventIds[1]]['event_title'], 'Annual CiviCRM meet 2'); } - function testGetEventByEventTitle() { + public function testGetEventByEventTitle() { $params = array( 'event_title' => 'Annual CiviCRM meet', @@ -130,13 +130,13 @@ class api_v3_EventTest extends CiviUnitTestCase { $this->assertEquals($result['values'][0]['id'], $this->_eventIds[0]); } - function testGetEventByWrongTitle() { + public function testGetEventByWrongTitle() { $params = array( 'title' => 'No event with that title',); $result = $this->callAPISuccess('Event', 'Get', $params); $this->assertEquals(0, $result['count']); } - function testGetEventByIdSort() { + public function testGetEventByIdSort() { $params = array( 'return.sort' => 'id ASC', 'return.max_results' => 1, ); @@ -167,7 +167,7 @@ class api_v3_EventTest extends CiviUnitTestCase { */ /* - function testGetIdOfEventByEventTitle() { + public function testGetIdOfEventByEventTitle() { $params = array( 'title' => 'Annual CiviCRM meet', 'return' => 'id' ); @@ -180,7 +180,7 @@ class api_v3_EventTest extends CiviUnitTestCase { /** * Test 'is.Current' option. Existing event is 'old' so only current should be returned */ - function testGetIsCurrent() { + public function testGetIsCurrent() { $params = array( 'isCurrent' => 1, ); @@ -202,7 +202,7 @@ class api_v3_EventTest extends CiviUnitTestCase { /** * There has been a schema change & the api needs to buffer developers from it */ - function testGetPaymentProcessorId() { + public function testGetPaymentProcessorId() { $params = $this->_params[0]; $params['payment_processor_id'] = 1; $params['sequential'] =1; @@ -212,7 +212,7 @@ class api_v3_EventTest extends CiviUnitTestCase { $this->assertEquals($result['values'][0]['payment_processor_id'], 1,"handing get payment processor compatibility"); } - function testInvalidData() { + public function testInvalidData() { $params = $this->_params[0]; $params['sequential'] =1; $params['loc_block_id'] =100; @@ -223,7 +223,7 @@ class api_v3_EventTest extends CiviUnitTestCase { /** * Test 'is.Current' option. Existing event is 'old' so only current should be returned */ - function testGetSingleReturnIsFull() { + public function testGetSingleReturnIsFull() { $contactID = $this->individualCreate(); $params = array( 'id' => $this->_eventIds[0], 'max_participants' => 1, @@ -250,7 +250,7 @@ class api_v3_EventTest extends CiviUnitTestCase { * Legacy support for Contribution Type ID. We need to ensure this is supported * as an alias for financial_type_id */ - function testCreateGetEventLegacyContributionTypeID() { + public function testCreateGetEventLegacyContributionTypeID() { $contributionTypeArray = array('contribution_type_id' => 3); if(isset($this->_params[0]['financial_type_id'])){ //in case someone edits $this->_params & invalidates this test :-) @@ -270,7 +270,7 @@ class api_v3_EventTest extends CiviUnitTestCase { * variables specific to participant so it can be replicated into other entities * and / or moved to the automated test suite */ - function testCreateWithCustom() { + public function testCreateWithCustom() { $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__); $params = $this->_params[0]; @@ -289,7 +289,7 @@ class api_v3_EventTest extends CiviUnitTestCase { /** * Test that an event with a price set can be created */ - function testCreatePaidEvent() { + public function testCreatePaidEvent() { //@todo alter API so that an integer is converted to an array $priceSetParams = array('price_set_id' => (array) 1, 'is_monetary' => 1); $result = $this->callAPISuccess('Event', 'Create', array_merge($this->_params[0], $priceSetParams)); @@ -297,33 +297,33 @@ class api_v3_EventTest extends CiviUnitTestCase { $this->assertArrayKeyExists('price_set_id', $event); } - function testCreateEventParamsNotArray() { + public function testCreateEventParamsNotArray() { $params = NULL; $result = $this->callAPIFailure('event', 'create', $params); } - function testCreateEventEmptyParams() { + public function testCreateEventEmptyParams() { $params = array(); $result = $this->callAPIFailure('event', 'create', $params); } - function testCreateEventParamsWithoutTitle() { + public function testCreateEventParamsWithoutTitle() { unset($this->_params['title']); $result = $this->callAPIFailure('event', 'create', $this->_params); $this->assertAPIFailure($result); } - function testCreateEventParamsWithoutEventTypeId() { + public function testCreateEventParamsWithoutEventTypeId() { unset($this->_params['event_type_id']); $result = $this->callAPIFailure('event', 'create', $this->_params); } - function testCreateEventParamsWithoutStartDate() { + public function testCreateEventParamsWithoutStartDate() { unset($this->_params['start_date']); $result = $this->callAPIFailure('event', 'create', $this->_params); } - function testCreateEventSuccess() { + public function testCreateEventSuccess() { $result = $this->callAPIAndDocument('Event', 'Create', $this->_params[0], __FUNCTION__, __FILE__); $this->assertArrayHasKey('id', $result['values'][$result['id']], 'In line ' . __LINE__); $result = $this->callAPISuccess($this->_entity, 'Get', array('id' => $result['id'])); @@ -337,7 +337,7 @@ class api_v3_EventTest extends CiviUnitTestCase { /** * Test that passing in Unique field names works */ - function testCreateEventSuccessUniqueFieldNames() { + public function testCreateEventSuccessUniqueFieldNames() { $this->_params[0]['event_start_date'] = $this->_params[0]['start_date']; unset($this->_params[1]['start_date']); $this->_params[0]['event_title'] = $this->_params[0]['title']; @@ -355,7 +355,7 @@ class api_v3_EventTest extends CiviUnitTestCase { $this->assertEquals($this->_params[0]['event_title'], $result['values'][$result['id']]['title'], 'end date is not set in line ' . __LINE__); } - function testUpdateEvent() { + public function testUpdateEvent() { $result = $this->callAPISuccess('event', 'create', $this->_params[1]); $params = array( @@ -369,11 +369,11 @@ class api_v3_EventTest extends CiviUnitTestCase { } - function testDeleteEmptyParams() { + public function testDeleteEmptyParams() { $result = $this->callAPIFailure('Event', 'Delete', array()); } - function testDelete() { + public function testDelete() { $params = array( 'id' => $this->_eventIds[0], ); @@ -383,7 +383,7 @@ class api_v3_EventTest extends CiviUnitTestCase { /** * Check event_id still supported for delete */ - function testDeleteWithEventId() { + public function testDeleteWithEventId() { $params = array( 'event_id' => $this->_eventIds[0], ); $result = $this->callAPISuccess('Event', 'Delete', $params); @@ -393,7 +393,7 @@ class api_v3_EventTest extends CiviUnitTestCase { /** * Trying to delete an event with participants should return error */ - function testDeleteWithExistingParticipant() { + public function testDeleteWithExistingParticipant() { $contactID = $this->individualCreate(); $participantID = $this->participantCreate( array( @@ -404,7 +404,7 @@ class api_v3_EventTest extends CiviUnitTestCase { $result = $this->callAPISuccess('Event', 'Delete', array('id' => $this->_eventIds[0])); } - function testDeleteWithWrongEventId() { + public function testDeleteWithWrongEventId() { $params = array('event_id' => $this->_eventIds[0]); $result = $this->callAPISuccess('Event', 'Delete', $params); // try to delete again - there's no such event anymore @@ -417,7 +417,7 @@ class api_v3_EventTest extends CiviUnitTestCase { /** * Test civicrm_event_search with wrong params type */ - function testSearchWrongParamsType() { + public function testSearchWrongParamsType() { $params = 'a string'; $result = $this->callAPIFailure('event', 'get', $params); } @@ -425,7 +425,7 @@ class api_v3_EventTest extends CiviUnitTestCase { /** * Test civicrm_event_search with empty params */ - function testSearchEmptyParams() { + public function testSearchEmptyParams() { $event = $this->callAPISuccess('event', 'create', $this->_params[1]); $getparams = array( 'sequential' => 1, @@ -440,7 +440,7 @@ class api_v3_EventTest extends CiviUnitTestCase { /** * Test civicrm_event_search. Success expected. */ - function testSearch() { + public function testSearch() { $params = array( 'event_type_id' => 1, 'return.title' => 1, @@ -456,7 +456,7 @@ class api_v3_EventTest extends CiviUnitTestCase { * Test civicrm_event_search. Success expected. * return.offset and return.max_results test (CRM-5266) */ - function testSearchWithOffsetAndMaxResults() { + public function testSearchWithOffsetAndMaxResults() { $maxEvents = 5; $events = array(); while ($maxEvents > 0) { @@ -479,7 +479,7 @@ class api_v3_EventTest extends CiviUnitTestCase { $this->assertEquals(2, $result['count'], ' 2 results returned In line ' . __LINE__); } - function testEventCreationPermissions() { + public function testEventCreationPermissions() { $params = array( 'event_type_id' => 1, 'start_date' => '2010-10-03', 'title' => 'le cake is a tie', 'check_permissions' => TRUE, ); $config = &CRM_Core_Config::singleton(); @@ -491,7 +491,7 @@ class api_v3_EventTest extends CiviUnitTestCase { $result = $this->callAPISuccess('event', 'create', $params); } - function testgetfields() { + public function testgetfields() { $description = "demonstrate use of getfields to interrogate api"; $params = array('action' => 'create'); $result = $this->callAPISuccess('event', 'getfields', $params); @@ -501,19 +501,19 @@ class api_v3_EventTest extends CiviUnitTestCase { /** * Test api_action param also works */ - function testgetfieldsRest() { + public function testgetfieldsRest() { $description = "demonstrate use of getfields to interrogate api"; $params = array('api_action' => 'create'); $result = $this->callAPISuccess('event', 'getfields', $params); $this->assertEquals(1, $result['values']['title']['api.required'], 'in line ' . __LINE__); } - function testgetfieldsGet() { + public function testgetfieldsGet() { $description = "demonstrate use of getfields to interrogate api"; $params = array('action' => 'get'); $result = $this->callAPISuccess('event', 'getfields', $params); $this->assertEquals('title', $result['values']['event_title']['name'], 'in line ' . __LINE__); } - function testgetfieldsDelete() { + public function testgetfieldsDelete() { $description = "demonstrate use of getfields to interrogate api"; $params = array('action' => 'delete'); $result = $this->callAPISuccess('event', 'getfields', $params); diff --git a/tests/phpunit/api/v3/GrantTest.php b/tests/phpunit/api/v3/GrantTest.php index 275a2652c4..be4f16fc59 100644 --- a/tests/phpunit/api/v3/GrantTest.php +++ b/tests/phpunit/api/v3/GrantTest.php @@ -43,7 +43,7 @@ class api_v3_GrantTest extends CiviUnitTestCase { public $DBResetRequired = FALSE; - function setUp() { + public function setUp() { parent::setUp(); $this->ids['contact'][0] = $this->individualCreate(); $this->params = array( @@ -58,7 +58,7 @@ class api_v3_GrantTest extends CiviUnitTestCase { ); } - function tearDown() { + public function tearDown() { foreach ($this->ids as $entity => $entities) { foreach ($entities as $id) { $this->callAPISuccess($entity, 'delete', array( 'id' => $id)); diff --git a/tests/phpunit/api/v3/GroupContactTest.php b/tests/phpunit/api/v3/GroupContactTest.php index 59d74af5e6..39d86be666 100644 --- a/tests/phpunit/api/v3/GroupContactTest.php +++ b/tests/phpunit/api/v3/GroupContactTest.php @@ -44,7 +44,7 @@ class api_v3_GroupContactTest extends CiviUnitTestCase { * * @todo set up calls function that doesn't work @ the moment */ - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(TRUE); @@ -83,7 +83,7 @@ class api_v3_GroupContactTest extends CiviUnitTestCase { } ///////////////// civicrm_group_contact_get methods - function testGet() { + public function testGet() { $params = array( 'contact_id' => $this->_contactId, ); @@ -95,7 +95,7 @@ class api_v3_GroupContactTest extends CiviUnitTestCase { } } - function testGetGroupID() { + public function testGetGroupID() { $description = "Get all from group and display contacts"; $subfile = "GetWithGroupID"; $params = array( @@ -111,7 +111,7 @@ class api_v3_GroupContactTest extends CiviUnitTestCase { } } - function testCreateWithEmptyParams() { + public function testCreateWithEmptyParams() { $params = array(); $groups = $this->callAPIFailure('group_contact', 'create', $params); $this->assertEquals($groups['error_message'], @@ -119,7 +119,7 @@ class api_v3_GroupContactTest extends CiviUnitTestCase { ); } - function testCreateWithoutGroupIdParams() { + public function testCreateWithoutGroupIdParams() { $params = array( 'contact_id' => $this->_contactId, ); @@ -127,14 +127,14 @@ class api_v3_GroupContactTest extends CiviUnitTestCase { $this->assertEquals($groups['error_message'], 'Mandatory key(s) missing from params array: group_id'); } - function testCreateWithoutContactIdParams() { + public function testCreateWithoutContactIdParams() { $params = array( 'group_id' => $this->_groupId1, ); $groups = $this->callAPIFailure('group_contact', 'create', $params); $this->assertEquals($groups['error_message'], 'Mandatory key(s) missing from params array: contact_id'); } - function testCreate() { + public function testCreate() { $cont = array( 'first_name' => 'Amiteshwar', 'middle_name' => 'L.', @@ -158,7 +158,7 @@ class api_v3_GroupContactTest extends CiviUnitTestCase { } ///////////////// civicrm_group_contact_remove methods - function testDelete() { + public function testDelete() { $params = array( 'contact_id' => $this->_contactId, 'group_id' => $this->_groupId1, @@ -169,7 +169,7 @@ class api_v3_GroupContactTest extends CiviUnitTestCase { $this->assertEquals($result['total_count'], 1, "in line " . __LINE__); } - function testDeletePermanent() { + public function testDeletePermanent() { $result = $this->callAPISuccess('group_contact', 'get', array('contact_id' => $this->_contactId)); $params = array( 'id' => $result['id'], diff --git a/tests/phpunit/api/v3/GroupTest.php b/tests/phpunit/api/v3/GroupTest.php index 7b3b3ca3f6..fc25922b46 100644 --- a/tests/phpunit/api/v3/GroupTest.php +++ b/tests/phpunit/api/v3/GroupTest.php @@ -37,19 +37,19 @@ class api_v3_GroupTest extends CiviUnitTestCase { protected $_apiversion; protected $_groupID; - function setUp() { + public function setUp() { $this->_apiversion = 3; parent::setUp(); $this->_groupID = $this->groupCreate(); } - function tearDown() { + public function tearDown() { $this->groupDelete($this->_groupID); } - function testgroupCreateNoTitle() { + public function testgroupCreateNoTitle() { $params = array( 'name' => 'Test Group No title ', 'domain_id' => 1, @@ -66,7 +66,7 @@ class api_v3_GroupTest extends CiviUnitTestCase { } - function testGetGroupWithEmptyParams() { + public function testGetGroupWithEmptyParams() { $group = $this->callAPISuccess('group', 'get', $params = array()); $group = $group["values"]; @@ -76,7 +76,7 @@ class api_v3_GroupTest extends CiviUnitTestCase { $this->assertEquals($group[$this->_groupID]['visibility'], 'Public Pages'); } - function testGetGroupParamsWithGroupId() { + public function testGetGroupParamsWithGroupId() { $params = array('id' => $this->_groupID); $group = $this->callAPISuccess('group', 'get', $params); @@ -89,7 +89,7 @@ class api_v3_GroupTest extends CiviUnitTestCase { } } - function testGetGroupParamsWithGroupName() { + public function testGetGroupParamsWithGroupName() { $params = array( 'name' => "Test Group 1", ); @@ -105,7 +105,7 @@ class api_v3_GroupTest extends CiviUnitTestCase { } } - function testGetGroupParamsWithReturnName() { + public function testGetGroupParamsWithReturnName() { $params = array(); $params['id'] = $this->_groupID; $params['return.name'] = 1; @@ -115,7 +115,7 @@ class api_v3_GroupTest extends CiviUnitTestCase { ); } - function testGetGroupParamsWithGroupTitle() { + public function testGetGroupParamsWithGroupTitle() { $params = array(); $params['title'] = 'New Test Group Created'; $group = $this->callAPISuccess('group', 'get', $params); @@ -129,18 +129,18 @@ class api_v3_GroupTest extends CiviUnitTestCase { } } - function testGetNonExistingGroup() { + public function testGetNonExistingGroup() { $params = array(); $params['title'] = 'No such group Exist'; $group = $this->callAPISuccess('group', 'get', $params); $this->assertEquals(0, $group['count']); } - function testgroupdeleteParamsnoId() { + public function testgroupdeleteParamsnoId() { $group = $this->callAPIFailure('group', 'delete', array(), 'Mandatory key(s) missing from params array: id'); } - function testgetfields() { + public function testgetfields() { $description = "demonstrate use of getfields to interrogate api"; $params = array('action' => 'create'); $result = $this->callAPIAndDocument('group', 'getfields', $params, __FUNCTION__, __FILE__, $description, 'getfields', 'getfields'); diff --git a/tests/phpunit/api/v3/ImTest.php b/tests/phpunit/api/v3/ImTest.php index 8f46590d59..95baf4780a 100644 --- a/tests/phpunit/api/v3/ImTest.php +++ b/tests/phpunit/api/v3/ImTest.php @@ -43,7 +43,7 @@ class api_v3_ImTest extends CiviUnitTestCase { public $DBResetRequired = FALSE; - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(TRUE); diff --git a/tests/phpunit/api/v3/JobProcessMailingTest.php b/tests/phpunit/api/v3/JobProcessMailingTest.php index 3bd6d24972..8160ba4926 100644 --- a/tests/phpunit/api/v3/JobProcessMailingTest.php +++ b/tests/phpunit/api/v3/JobProcessMailingTest.php @@ -55,7 +55,7 @@ class api_v3_JobProcessMailingTest extends CiviUnitTestCase { */ private $_mut; - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(); CRM_Mailing_BAO_MailingJob::$mailsProcessed = 0; // DGW @@ -75,7 +75,7 @@ class api_v3_JobProcessMailingTest extends CiviUnitTestCase { /** * */ - function tearDown() { + public function tearDown() { $this->_mut->stop(); // $this->quickCleanup(array('civicrm_mailing', 'civicrm_mailing_job', 'civicrm_contact')); CRM_Utils_Hook::singleton()->reset(); @@ -87,7 +87,7 @@ class api_v3_JobProcessMailingTest extends CiviUnitTestCase { /** * Check mailing is sent */ - function testProcessMailing() { + public function testProcessMailing() { $this->createContactsInGroup(10, $this->_groupID); CRM_Core_Config::singleton()->mailerBatchLimit = 2; $this->callAPISuccess('mailing', 'create', $this->_params); @@ -99,7 +99,7 @@ class api_v3_JobProcessMailingTest extends CiviUnitTestCase { * @param integer $count * @param integer $groupID */ - function createContactsInGroup($count, $groupID) { + public function createContactsInGroup($count, $groupID) { for($i = 1; $i <= $count; $i++ ) { $contactID = $this->individualCreate(array('first_name' => $count, 'email' => 'mail' . $i . '@nul.com')); $this->callAPISuccess('group_contact', 'create', array('contact_id' => $contactID, 'group_id' => $groupID, 'status' => 'Added')); @@ -112,7 +112,7 @@ class api_v3_JobProcessMailingTest extends CiviUnitTestCase { * * @return array */ - function getRecipients($start, $count) { + public function getRecipients($start, $count) { $recipients = array(); for($i = $start; $i < ($start + $count); $i++ ) { $recipients[][0] = 'mail' . $i . '@nul.com'; diff --git a/tests/phpunit/api/v3/JobTest.php b/tests/phpunit/api/v3/JobTest.php index 2ddb005ece..a2e0f80393 100644 --- a/tests/phpunit/api/v3/JobTest.php +++ b/tests/phpunit/api/v3/JobTest.php @@ -47,7 +47,7 @@ class api_v3_JobTest extends CiviUnitTestCase { public $_entity = 'Job'; public $_params = array(); - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(TRUE); $this->_params = array( @@ -65,7 +65,7 @@ class api_v3_JobTest extends CiviUnitTestCase { /** * Check with no name */ - function testCreateWithoutName() { + public function testCreateWithoutName() { $params = array( 'is_active' => 1, ); $result = $this->callAPIFailure('job', 'create', $params, @@ -76,7 +76,7 @@ class api_v3_JobTest extends CiviUnitTestCase { /** * Create job with an invalid "run_frequency" value */ - function testCreateWithInvalidFrequency() { + public function testCreateWithInvalidFrequency() { $params = array( 'sequential' => 1, 'name' => 'API_Test_Job', @@ -93,7 +93,7 @@ class api_v3_JobTest extends CiviUnitTestCase { /** * Create job */ - function testCreate() { + public function testCreate() { $result = $this->callAPIAndDocument('job', 'create', $this->_params, __FUNCTION__, __FILE__); $this->assertNotNull($result['values'][0]['id'], 'in line ' . __LINE__); @@ -106,7 +106,7 @@ class api_v3_JobTest extends CiviUnitTestCase { /** * Check with empty array */ - function testDeleteEmpty() { + public function testDeleteEmpty() { $params = array(); $result = $this->callAPIFailure('job', 'delete', $params); } @@ -114,14 +114,14 @@ class api_v3_JobTest extends CiviUnitTestCase { /** * Check with No array */ - function testDeleteParamsNotArray() { + public function testDeleteParamsNotArray() { $result = $this->callAPIFailure('job', 'delete', 'string'); } /** * Check if required fields are not passed */ - function testDeleteWithoutRequired() { + public function testDeleteWithoutRequired() { $params = array( 'name' => 'API_Test_PP', 'title' => 'API Test Payment Processor', @@ -135,7 +135,7 @@ class api_v3_JobTest extends CiviUnitTestCase { /** * Check with incorrect required fields */ - function testDeleteWithIncorrectData() { + public function testDeleteWithIncorrectData() { $params = array( 'id' => 'abcd', ); $result = $this->callAPIFailure('job', 'delete', $params); @@ -144,7 +144,7 @@ class api_v3_JobTest extends CiviUnitTestCase { /** * Check job delete */ - function testDelete() { + public function testDelete() { $createResult = $this->callAPISuccess('job', 'create', $this->_params); $params = array('id' => $createResult['id'],); $result = $this->callAPIAndDocument('job', 'delete', $params, __FUNCTION__, __FILE__); @@ -283,7 +283,7 @@ class api_v3_JobTest extends CiviUnitTestCase { * @param int $id * @param array $params */ - function hookPreRelationship($op, $objectName, $id, &$params ) { + public function hookPreRelationship($op, $objectName, $id, &$params ) { if($op == 'delete') { return; } diff --git a/tests/phpunit/api/v3/MailSettingsTest.php b/tests/phpunit/api/v3/MailSettingsTest.php index 280e4013b6..12c597cc5c 100644 --- a/tests/phpunit/api/v3/MailSettingsTest.php +++ b/tests/phpunit/api/v3/MailSettingsTest.php @@ -37,7 +37,7 @@ class api_v3_MailSettingsTest extends CiviUnitTestCase { protected $id; public $DBResetRequired = FALSE; - function setUp() { + public function setUp() { $this->params = array( 'domain_id' => 1, 'name' => "my mail setting", diff --git a/tests/phpunit/api/v3/MailingABTest.php b/tests/phpunit/api/v3/MailingABTest.php index 1a60397b02..d50453ae40 100755 --- a/tests/phpunit/api/v3/MailingABTest.php +++ b/tests/phpunit/api/v3/MailingABTest.php @@ -40,7 +40,7 @@ class api_v3_MailingABTest extends CiviUnitTestCase { protected $_entity = 'MailingAB'; protected $_groupID; - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(TRUE); $this->_mailingID_A = $this->createMailing(); diff --git a/tests/phpunit/api/v3/MailingContactTest.php b/tests/phpunit/api/v3/MailingContactTest.php index 25d4f6f14d..ba22a060d9 100644 --- a/tests/phpunit/api/v3/MailingContactTest.php +++ b/tests/phpunit/api/v3/MailingContactTest.php @@ -44,7 +44,7 @@ class api_v3_MailingContactTest extends CiviUnitTestCase { protected $_apiversion = 3; protected $_entity = 'mailing'; - function setUp() { + public function setUp() { parent::setUp(); $params = array( 'first_name' => 'abc1', @@ -54,7 +54,7 @@ class api_v3_MailingContactTest extends CiviUnitTestCase { $this->_contact = $this->callAPISuccess("contact", "create", $params); } - function tearDown() { + public function tearDown() { $this->callAPISuccess("contact", "delete", array('id' => $this->_contact['id'])); parent::tearDown(); } @@ -163,7 +163,7 @@ class api_v3_MailingContactTest extends CiviUnitTestCase { /** * Test that the API returns only the "Bounced" mailings when instructed to do so */ - function testMailingContactBounced( ) { + public function testMailingContactBounced( ) { $op = new PHPUnit_Extensions_Database_Operation_Insert(); //Create the User $op->execute($this->_dbconn, diff --git a/tests/phpunit/api/v3/MailingGroupTest.php b/tests/phpunit/api/v3/MailingGroupTest.php index c9f9262643..80fd7d001e 100644 --- a/tests/phpunit/api/v3/MailingGroupTest.php +++ b/tests/phpunit/api/v3/MailingGroupTest.php @@ -37,7 +37,7 @@ class api_v3_MailingGroupTest extends CiviUnitTestCase { protected $_email; protected $_apiversion; - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(TRUE); $this->_apiversion = 3; diff --git a/tests/phpunit/api/v3/MailingTest.php b/tests/phpunit/api/v3/MailingTest.php index 0eb25d514d..1b86e3eddd 100755 --- a/tests/phpunit/api/v3/MailingTest.php +++ b/tests/phpunit/api/v3/MailingTest.php @@ -39,7 +39,7 @@ class api_v3_MailingTest extends CiviUnitTestCase { protected $_entity = 'Mailing'; protected $_contactID; - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(); CRM_Mailing_BAO_MailingJob::$mailsProcessed = 0; // DGW @@ -55,7 +55,7 @@ class api_v3_MailingTest extends CiviUnitTestCase { ); } - function tearDown() { + public function tearDown() { CRM_Mailing_BAO_MailingJob::$mailsProcessed = 0; // DGW parent::tearDown(); } diff --git a/tests/phpunit/api/v3/MembershipPaymentTest.php b/tests/phpunit/api/v3/MembershipPaymentTest.php index 16287d7313..254450acbe 100644 --- a/tests/phpunit/api/v3/MembershipPaymentTest.php +++ b/tests/phpunit/api/v3/MembershipPaymentTest.php @@ -42,7 +42,7 @@ class api_v3_MembershipPaymentTest extends CiviUnitTestCase { protected $_membershipTypeID; protected $_membershipStatusID; protected $_contribution = array(); - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(TRUE); diff --git a/tests/phpunit/api/v3/MembershipStatusTest.php b/tests/phpunit/api/v3/MembershipStatusTest.php index 2d8ff85387..0b5d25a4e0 100644 --- a/tests/phpunit/api/v3/MembershipStatusTest.php +++ b/tests/phpunit/api/v3/MembershipStatusTest.php @@ -39,7 +39,7 @@ class api_v3_MembershipStatusTest extends CiviUnitTestCase { protected $_apiversion =3; - function setUp() { + public function setUp() { parent::setUp(); $this->_contactID = $this->individualCreate(); $this->_membershipTypeID = $this->membershipTypeCreate(array('member_of_contact_id' => $this->_contactID)); @@ -49,7 +49,7 @@ class api_v3_MembershipStatusTest extends CiviUnitTestCase { CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'name', TRUE); } - function tearDown() { + public function tearDown() { $this->membershipStatusDelete($this->_membershipStatusID); $this->membershipTypeDelete(array('id' => $this->_membershipTypeID)); $this->contactDelete($this->_contactID); @@ -61,7 +61,7 @@ class api_v3_MembershipStatusTest extends CiviUnitTestCase { /** * Test civicrm_membership_status_get with empty params */ - function testGetEmptyParams() { + public function testGetEmptyParams() { $result = $this->callAPISuccess('membership_status', 'get', array()); // It should be 8 statuses, 7 default from mysql_data // plus one test status added in setUp @@ -71,7 +71,7 @@ class api_v3_MembershipStatusTest extends CiviUnitTestCase { /** * Test civicrm_membership_status_get. Success expected. */ - function testGet() { + public function testGet() { $params = array( 'name' => 'test status', ); @@ -82,7 +82,7 @@ class api_v3_MembershipStatusTest extends CiviUnitTestCase { /** * Test civicrm_membership_status_get. Success expected. */ - function testGetLimit() { + public function testGetLimit() { $result = $this->callAPISuccess('membership_status', 'get', array()); $this->assertGreaterThan(1, $result['count'], "Check more than one exists In line " . __LINE__); $params['option.limit'] = 1; @@ -90,7 +90,7 @@ class api_v3_MembershipStatusTest extends CiviUnitTestCase { $this->assertEquals(1, $result['count'], "Check only 1 retrieved " . __LINE__); } - function testCreateDuplicateName() { + public function testCreateDuplicateName() { $params = array('name' => 'name'); $result = $this->callAPISuccess('membership_status', 'create', $params); $result = $this->callAPIFailure('membership_status', 'create', $params, @@ -98,12 +98,12 @@ class api_v3_MembershipStatusTest extends CiviUnitTestCase { ); } - function testCreateWithMissingRequired() { + public function testCreateWithMissingRequired() { $params = array('title' => 'Does not make sense'); $result = $this->callAPIFailure('membership_status', 'create', $params); } - function testCreate() { + public function testCreate() { $params = array( 'name' => 'test membership status', ); @@ -113,7 +113,7 @@ class api_v3_MembershipStatusTest extends CiviUnitTestCase { $this->membershipStatusDelete($result['id']); } - function testUpdate() { + public function testUpdate() { $params = array( 'name' => 'test membership status', ); $result = $this->callAPISuccess('membership_status', 'create', $params); @@ -131,16 +131,16 @@ class api_v3_MembershipStatusTest extends CiviUnitTestCase { ///////////////// civicrm_membership_status_delete methods - function testDeleteEmptyParams() { + public function testDeleteEmptyParams() { $result = $this->callAPIFailure('membership_status', 'delete', array()); } - function testDeleteWithMissingRequired() { + public function testDeleteWithMissingRequired() { $params = array('title' => 'Does not make sense'); $result = $this->callAPIFailure('membership_status', 'delete', $params); } - function testDelete() { + public function testDelete() { $membershipID = $this->membershipStatusCreate(); $params = array( 'id' => $membershipID, @@ -151,7 +151,7 @@ class api_v3_MembershipStatusTest extends CiviUnitTestCase { /** * Test that trying to delete membership status while membership still exists creates error */ - function testDeleteWithMembershipError() { + public function testDeleteWithMembershipError() { $membershipStatusID = $this->membershipStatusCreate(); $this->_contactID = $this->individualCreate(); $this->_entity = 'membership'; diff --git a/tests/phpunit/api/v3/MembershipTest.php b/tests/phpunit/api/v3/MembershipTest.php index 1d423e680b..0adfa12a49 100644 --- a/tests/phpunit/api/v3/MembershipTest.php +++ b/tests/phpunit/api/v3/MembershipTest.php @@ -75,7 +75,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { ); } - function tearDown() { + public function tearDown() { $this->quickCleanup(array( 'civicrm_membership', 'civicrm_membership_payment', @@ -93,7 +93,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { /** * Test civicrm_membership_delete() */ - function testMembershipDelete() { + public function testMembershipDelete() { $membershipID = $this->contactMembershipCreate($this->_params); $this->assertDBRowExist('CRM_Member_DAO_Membership', $membershipID); $params = array( @@ -103,12 +103,12 @@ class api_v3_MembershipTest extends CiviUnitTestCase { $this->assertDBRowNotExist('CRM_Member_DAO_Membership', $membershipID); } - function testMembershipDeleteEmpty() { + public function testMembershipDeleteEmpty() { $params = array(); $result = $this->callAPIFailure('membership', 'delete', $params); } - function testMembershipDeleteInvalidID() { + public function testMembershipDeleteInvalidID() { $params = array('id' => 'blah'); $result = $this->callAPIFailure('membership', 'delete', $params); } @@ -116,7 +116,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { /** * Test civicrm_membership_delete() with invalid Membership Id */ - function testMembershipDeleteWithInvalidMembershipId() { + public function testMembershipDeleteWithInvalidMembershipId() { $membershipId = 'membership'; $result = $this->callAPIFailure('membership', 'delete', $membershipId); } @@ -127,7 +127,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * these methods for backwards compatibility, also verifying basic * behaviour is the same as new methods. */ - function testContactMembershipsGet() { + public function testContactMembershipsGet() { $this->_membershipID = $this->contactMembershipCreate($this->_params); $params = array(); $result = $this->callAPISuccess('membership', 'get', $params); @@ -140,7 +140,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * Test civicrm_membership_get with params not array. * Gets treated as contact_id, memberships expected. */ - function testGetWithParamsContactId() { + public function testGetWithParamsContactId() { $this->_membershipID = $this->contactMembershipCreate($this->_params); $params = array( 'contact_id' => $this->_contactID, @@ -165,7 +165,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * Test civicrm_membership_get with params not array. * Gets treated as contact_id, memberships expected. */ - function testGetInSyntax() { + public function testGetInSyntax() { $this->_membershipID = $this->contactMembershipCreate($this->_params); $this->_membershipID2 = $this->contactMembershipCreate($this->_params); $this->_membershipID3 = $this->contactMembershipCreate($this->_params); @@ -188,7 +188,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * Test civicrm_membership_get with params not array. * Gets treated as contact_id, memberships expected. */ - function testGetInSyntaxOnContactID() { + public function testGetInSyntaxOnContactID() { $this->_membershipID = $this->contactMembershipCreate($this->_params); $contact2 = $this->individualCreate(); $contact3 = $this->individualCreate(array('first_name' => 'Scout', 'last_name' => 'Canine')); @@ -211,7 +211,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * Test civicrm_membership_get with params not array. * Gets treated as contact_id, memberships expected. */ - function testGetWithParamsMemberShipTypeId() { + public function testGetWithParamsMemberShipTypeId() { $result = $this->callAPISuccess($this->_entity, 'create', $this->_params); $params = array( 'membership_type_id' => $this->_membershipTypeID, @@ -235,7 +235,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * Test civicrm_membership_get with params not array. * Gets treated as contact_id, memberships expected. */ - function testGetWithParamsMemberShipTypeIdContactID() { + public function testGetWithParamsMemberShipTypeIdContactID() { $params = $this->_params; $this->callAPISuccess($this->_entity, 'create', $params); $params['membership_type_id'] = $this->_membershipTypeID2; @@ -263,7 +263,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * variables specific to participant so it can be replicated into other entities * and / or moved to the automated test suite */ - function testGetWithParamsMemberShipIdAndCustom() { + public function testGetWithParamsMemberShipIdAndCustom() { $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__); $params = $this->_params; @@ -284,7 +284,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * Test civicrm_membership_get with proper params. * Memberships expected. */ - function testGet() { + public function testGet() { $membershipID = $this->contactMembershipCreate($this->_params); $params = array( 'contact_id' => $this->_contactID, @@ -311,7 +311,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * Test civicrm_membership_get with proper params. * Memberships expected. */ - function testGetWithId() { + public function testGetWithId() { $membershipID = $this->contactMembershipCreate($this->_params); $params = array( 'contact_id' => $this->_contactID, @@ -333,7 +333,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * Test civicrm_membership_get for only active. * Memberships expected. */ - function testGetOnlyActive() { + public function testGetOnlyActive() { $description = "Demonstrates use of 'filter' active_only' param"; $this->_membershipID = $this->contactMembershipCreate($this->_params); $subfile = 'filterIsCurrent'; @@ -368,7 +368,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * Test civicrm_membership_get for non exist contact. * empty Memberships. */ - function testGetNoContactExists() { + public function testGetNoContactExists() { $params = array( 'contact_id' => 55555, ); @@ -381,7 +381,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * Test civicrm_membership_get with relationship. * get Memberships. */ - function testGetWithRelationship() { + public function testGetWithRelationship() { $membershipOrgId = $this->organizationCreate(NULL); $memberContactId = $this->individualCreate(); @@ -447,7 +447,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * Test suite for CRM-14758: API ( contact, create ) does not always create related membership * and max_related property for Membership_Type and Membership entities */ - function testCreateWithRelationship() { + public function testCreateWithRelationship() { // Create membership type: inherited through employment, max_related = 2 $params = array( 'name_a_b' => 'Employee of', @@ -568,7 +568,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { /** * We are checking for no enotices + only id & end_date returned */ - function testMembershipGetWithReturn() { + public function testMembershipGetWithReturn() { $membershipID = $this->contactMembershipCreate($this->_params); $result = $this->callAPISuccess('membership', 'get', array('return' => 'end_date')); foreach ($result['values'] as $membership) { @@ -581,7 +581,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * Test civicrm_contact_memberships_create with empty params. * Error expected. */ - function testCreateWithEmptyParams() { + public function testCreateWithEmptyParams() { $params = array(); $result = $this->callAPIFailure('membership', 'create', $params); } @@ -589,13 +589,13 @@ class api_v3_MembershipTest extends CiviUnitTestCase { /** * If is_overide is passed in status must also be passed in */ - function testCreateOverrideNoStatus() { + public function testCreateOverrideNoStatus() { $params = $this->_params; unset($params['status_id']); $result = $this->callAPIFailure('membership', 'create', $params); } - function testMembershipCreateMissingRequired() { + public function testMembershipCreateMissingRequired() { $params = array( 'membership_type_id' => '1', 'join_date' => '2006-01-21', @@ -608,7 +608,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { $result = $this->callAPIFailure('membership', 'create', $params); } - function testMembershipCreate() { + public function testMembershipCreate() { $params = array( 'contact_id' => $this->_contactID, 'membership_type_id' => $this->_membershipTypeID, @@ -629,7 +629,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { /* * Check for useful message if contact doesn't exist */ - function testMembershipCreateWithInvalidContact() { + public function testMembershipCreateWithInvalidContact() { $params = array( 'contact_id' => 999, 'membership_type_id' => $this->_membershipTypeID, @@ -645,7 +645,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { 'contact_id is not valid : 999' ); } - function testMembershipCreateWithInvalidStatus() { + public function testMembershipCreateWithInvalidStatus() { $params = $this->_params; $params['status_id'] = 999; $result = $this->callAPIFailure('membership', 'create', $params, @@ -653,7 +653,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { ); } - function testMembershipCreateWithInvalidType() { + public function testMembershipCreateWithInvalidType() { $params = $this->_params; $params['membership_type_id'] = 999; @@ -668,7 +668,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * variables specific to participant so it can be replicated into other entities * and / or moved to the automated test suite */ - function testCreateWithCustom() { + public function testCreateWithCustom() { $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__); $params = $this->_params; @@ -684,7 +684,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * membership). * success expected. */ - function testMembershipCreateWithId() { + public function testMembershipCreateWithId() { $membershipID = $this->contactMembershipCreate($this->_params); $params = array( 'id' => $membershipID, @@ -710,7 +710,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * membership). * success expected. */ - function testMembershipCreateUpdateWithIdNoContact() { + public function testMembershipCreateUpdateWithIdNoContact() { $membershipID = $this->contactMembershipCreate($this->_params); $params = array( 'id' => $membershipID, @@ -737,7 +737,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * membership). * success expected. */ - function testMembershipCreateUpdateWithIdNoDates() { + public function testMembershipCreateUpdateWithIdNoDates() { $membershipID = $this->contactMembershipCreate($this->_params); $params = array( 'id' => $membershipID, @@ -760,7 +760,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * membership). * success expected. */ - function testMembershipCreateUpdateWithIdNoDatesNoType() { + public function testMembershipCreateUpdateWithIdNoDatesNoType() { $membershipID = $this->contactMembershipCreate($this->_params); $params = array( 'id' => $membershipID, @@ -782,7 +782,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * membership). * success expected. */ - function testMembershipCreateUpdateWithIDAndSource() { + public function testMembershipCreateUpdateWithIDAndSource() { $membershipID = $this->contactMembershipCreate($this->_params); $params = array( 'id' => $membershipID, @@ -801,7 +801,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { /** * Change custom field using update */ - function testUpdateWithCustom() { + public function testUpdateWithCustom() { $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__); $params = $this->_params; @@ -823,7 +823,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * Test civicrm_contact_memberships_create Invalid membership data * Error expected. */ - function testMembershipCreateInvalidMemData() { + public function testMembershipCreateInvalidMemData() { //membership_contact_id as string $params = array( 'membership_contact_id' => 'Invalid', @@ -852,7 +852,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * membership). * Success expected. */ - function testMembershipCreateWithMemContact() { + public function testMembershipCreateWithMemContact() { $params = array( 'membership_contact_id' => $this->_contactID, 'membership_type_id' => $this->_membershipTypeID, @@ -875,7 +875,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * membership). * Success expected. */ - function testMembershipCreateValidMembershipTypeString() { + public function testMembershipCreateValidMembershipTypeString() { $params = array( 'membership_contact_id' => $this->_contactID, 'membership_type_id' => 'General', @@ -899,7 +899,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * membership). * Success expected. */ - function testMembershipCreateInValidMembershipTypeString() { + public function testMembershipCreateInValidMembershipTypeString() { $params = array( 'membership_contact_id' => $this->_contactID, 'membership_type_id' => 'invalid', @@ -917,7 +917,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { /** * Test that if membership join date is not set it defaults to today */ - function testEmptyJoinDate() { + public function testEmptyJoinDate() { unset($this->_params['join_date'], $this->_params['is_override']); $result = $this->callAPISuccess($this->_entity, 'create', $this->_params); $result = $this->callAPISuccess($this->_entity, 'getsingle', array('id' => $result['id'])); @@ -929,7 +929,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * Test that if membership start date is not set it defaults to correct end date * - fixed */ - function testEmptyStartDateFixed() { + public function testEmptyStartDateFixed() { unset($this->_params['start_date'], $this->_params['is_override']); $this->_params['membership_type_id'] = $this->_membershipTypeID2; $result = $this->callAPISuccess($this->_entity, 'create', $this->_params); @@ -943,7 +943,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * Test that if membership start date is not set it defaults to correct end date * - fixed */ - function testEmptyStartDateRolling() { + public function testEmptyStartDateRolling() { unset($this->_params['start_date'], $this->_params['is_override']); $result = $this->callAPISuccess($this->_entity, 'create', $this->_params); $result = $this->callAPISuccess($this->_entity, 'getsingle', array('id' => $result['id'])); @@ -955,7 +955,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * Test that if membership end date is not set it defaults to correct end date * - rolling */ - function testEmptyEndDateFixed() { + public function testEmptyEndDateFixed() { unset($this->_params['start_date'], $this->_params['is_override'], $this->_params['end_date']); $this->_params['membership_type_id'] = $this->_membershipTypeID2; $result = $this->callAPISuccess($this->_entity, 'create', $this->_params); @@ -968,7 +968,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * Test that if membership end date is not set it defaults to correct end date * - rolling */ - function testEmptyEndDateRolling() { + public function testEmptyEndDateRolling() { unset($this->_params['is_override'], $this->_params['end_date']); $this->_params['membership_type_id'] = $this->_membershipTypeID; $result = $this->callAPISuccess($this->_entity, 'create', $this->_params); @@ -982,7 +982,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { /** * Test that if datesdate are not set they not over-ridden if id is passed in */ - function testMembershipDatesNotOverridden() { + public function testMembershipDatesNotOverridden() { $result = $this->callAPISuccess($this->_entity, 'create', $this->_params); unset($this->_params['end_date'], $this->_params['start_date']); $this->_params['id'] = $result['id']; diff --git a/tests/phpunit/api/v3/MembershipTypeTest.php b/tests/phpunit/api/v3/MembershipTypeTest.php index 382f4ea55a..bbb6d48241 100644 --- a/tests/phpunit/api/v3/MembershipTypeTest.php +++ b/tests/phpunit/api/v3/MembershipTypeTest.php @@ -37,14 +37,14 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { protected $_apiversion; protected $_entity = 'MembershipType'; - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(TRUE); $this->_apiversion = 3; $this->_contactID = $this->organizationCreate(NULL); } - function testGetWithoutId() { + public function testGetWithoutId() { $params = array( 'name' => '60+ Membership', 'description' => 'people above 60 are given health instructions', @@ -59,7 +59,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { $this->assertEquals($membershiptype['count'], 0); } - function testGet() { + public function testGet() { $id = $this->membershipTypeCreate(array('member_of_contact_id' => $this->_contactID)); $params = array( @@ -76,14 +76,14 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { } ///////////////// civicrm_membership_type_create methods - function testCreateWithEmptyParams() { + public function testCreateWithEmptyParams() { $membershiptype = $this->callAPIFailure('membership_type', 'create', array()); $this->assertEquals($membershiptype['error_message'], 'Mandatory key(s) missing from params array: domain_id, member_of_contact_id, financial_type_id, duration_unit, duration_interval, name' ); } - function testCreateWithoutMemberOfContactId() { + public function testCreateWithoutMemberOfContactId() { $params = array( 'name' => '60+ Membership', 'description' => 'people above 60 are given health instructions', @@ -101,7 +101,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { ); } - function testCreateWithoutContributionTypeId() { + public function testCreateWithoutContributionTypeId() { $params = array( 'name' => '70+ Membership', 'description' => 'people above 70 are given health instructions', @@ -118,7 +118,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { ); } - function testCreateWithoutDurationUnit() { + public function testCreateWithoutDurationUnit() { $params = array( 'name' => '80+ Membership', 'description' => 'people above 80 are given health instructions', @@ -135,7 +135,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { ); } - function testCreateWithoutDurationInterval() { + public function testCreateWithoutDurationInterval() { $params = array( 'name' => '70+ Membership', 'description' => 'people above 70 are given health instructions', @@ -151,7 +151,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { ); } - function testCreateWithoutNameandDomainIDandDurationUnit() { + public function testCreateWithoutNameandDomainIDandDurationUnit() { $params = array( 'description' => 'people above 50 are given health instructions', 'member_of_contact_id' => $this->_contactID, @@ -167,7 +167,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { ); } - function testCreateWithoutName() { + public function testCreateWithoutName() { $params = array( 'description' => 'people above 50 are given health instructions', 'member_of_contact_id' => $this->_contactID, @@ -183,7 +183,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { $this->assertEquals($membershiptype['error_message'], 'Mandatory key(s) missing from params array: name'); } - function testCreate() { + public function testCreate() { $params = array( 'name' => '40+ Membership', 'description' => 'people above 40 are given health instructions', @@ -203,7 +203,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { } - function testUpdateWithEmptyParams() { + public function testUpdateWithEmptyParams() { $params = array(); $membershiptype = $this->callAPIFailure('membership_type', 'create', $params); $this->assertEquals($membershiptype['error_message'], @@ -211,7 +211,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { ); } - function testUpdateWithoutId() { + public function testUpdateWithoutId() { $params = array( 'name' => '60+ Membership', 'description' => 'people above 60 are given health instructions', @@ -227,7 +227,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { $this->assertEquals($membershiptype['error_message'], 'Mandatory key(s) missing from params array: domain_id'); } - function testUpdate() { + public function testUpdate() { $id = $this->membershipTypeCreate(array('member_of_contact_id' => $this->_contactID, 'financial_type_id' => 2)); $newMembOrgParams = array( 'organization_name' => 'New membership organisation', @@ -251,7 +251,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { $this->getAndCheck($params, $id, $this->_entity); } - function testDeleteNotExists() { + public function testDeleteNotExists() { $params = array( 'id' => 'doesNotExist', ); @@ -260,7 +260,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { ); } - function testDelete() { + public function testDelete() { $orgID = $this->organizationCreate(NULL); $membershipTypeID = $this->membershipTypeCreate(array('member_of_contact_id' => $orgID)); $params = array( diff --git a/tests/phpunit/api/v3/MessageTemplateTest.php b/tests/phpunit/api/v3/MessageTemplateTest.php index 8c25604726..ea6281efeb 100644 --- a/tests/phpunit/api/v3/MessageTemplateTest.php +++ b/tests/phpunit/api/v3/MessageTemplateTest.php @@ -40,7 +40,7 @@ class api_v3_MessageTemplateTest extends CiviUnitTestCase { protected $params; - function setUp() { + public function setUp() { $this->_apiversion = 3; parent::setUp(); $this->useTransaction(TRUE); diff --git a/tests/phpunit/api/v3/NoteTest.php b/tests/phpunit/api/v3/NoteTest.php index 90485b1ecf..63eda0aabc 100644 --- a/tests/phpunit/api/v3/NoteTest.php +++ b/tests/phpunit/api/v3/NoteTest.php @@ -39,7 +39,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { protected $_noteID; protected $_note; - function setUp() { + public function setUp() { $this->_apiversion = 3; // Connect to the database @@ -65,7 +65,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { * Check retrieve note with empty parameter array * Error expected */ - function testGetWithEmptyParams() { + public function testGetWithEmptyParams() { $this->callAPISuccess('note', 'get', array()); } @@ -73,7 +73,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { * Check retrieve note with missing patrameters * Error expected */ - function testGetWithoutEntityId() { + public function testGetWithoutEntityId() { $params = array( 'entity_table' => 'civicrm_contact', ); @@ -83,7 +83,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { /** * Check civicrm_note_get */ - function testGet() { + public function testGet() { $entityId = $this->_noteID; $params = array( 'entity_table' => 'civicrm_contact', @@ -99,7 +99,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { * Check create with empty parameter array * Error Expected */ - function testCreateWithEmptyNoteField() { + public function testCreateWithEmptyNoteField() { $this->_params['note'] = ""; $result = $this->callAPIFailure('note', 'create', $this->_params, 'Mandatory key(s) missing from params array: note'); @@ -109,7 +109,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { * Check create with partial params * Error expected */ - function testCreateWithoutEntityId() { + public function testCreateWithoutEntityId() { unset($this->_params['entity_id']); $result = $this->callAPIFailure('note', 'create', $this->_params, 'Mandatory key(s) missing from params array: entity_id'); @@ -119,7 +119,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { * Check create with partially empty params * Error expected */ - function testCreateWithEmptyEntityId() { + public function testCreateWithEmptyEntityId() { $this->_params['entity_id'] = ""; $result = $this->callAPIFailure('note', 'create', $this->_params, 'Mandatory key(s) missing from params array: entity_id'); @@ -128,7 +128,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { /** * Check civicrm_note_create */ - function testCreate() { + public function testCreate() { $result = $this->callAPIAndDocument('note', 'create', $this->_params, __FUNCTION__, __FILE__); $this->assertEquals($result['values'][$result['id']]['note'], 'Hello!!! m testing Note', 'in line ' . __LINE__); @@ -140,7 +140,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { $this->noteDelete($note); } - function testCreateWithApostropheInString() { + public function testCreateWithApostropheInString() { $params = array( 'entity_table' => 'civicrm_contact', 'entity_id' => $this->_contactID, @@ -164,7 +164,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { /** * Check civicrm_note_create - tests used of default set to now */ - function testCreateWithoutModifiedDate() { + public function testCreateWithoutModifiedDate() { unset($this->_params['modified_date']); $apiResult = $this->callAPISuccess('note', 'create', $this->_params); $this->assertAPISuccess($apiResult); @@ -181,7 +181,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { * Please don't copy & paste this - is of marginal value * better to put time into the function on Syntax Conformance class that tests this */ - function testUpdateWithEmptyParams() { + public function testUpdateWithEmptyParams() { $note = $this->callAPIFailure('note', 'create', array()); } @@ -189,7 +189,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { * Check update with missing parameter (contact id) * Error expected */ - function testUpdateWithoutContactId() { + public function testUpdateWithoutContactId() { $params = array( 'entity_id' => $this->_contactID, 'entity_table' => 'civicrm_contact', ); @@ -201,7 +201,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { /** * Check civicrm_note_update */ - function testUpdate() { + public function testUpdate() { $params = array( 'id' => $this->_noteID, 'contact_id' => $this->_contactID, @@ -225,7 +225,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { * Check delete with empty parametes array * Error expected */ - function testDeleteWithEmptyParams() { + public function testDeleteWithEmptyParams() { $deleteNote = $this->callAPIFailure('note', 'delete', array(), 'Mandatory key(s) missing from params array: id'); } @@ -233,7 +233,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { * Check delete with wrong id * Error expected */ - function testDeleteWithWrongID() { + public function testDeleteWithWrongID() { $params = array( 'id' => 0, ); @@ -244,7 +244,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { /** * Check civicrm_note_delete */ - function testDelete() { + public function testDelete() { $additionalNote = $this->noteCreate($this->_contactID); $params = array( diff --git a/tests/phpunit/api/v3/OptionGroupTest.php b/tests/phpunit/api/v3/OptionGroupTest.php index add644e132..0b11f04892 100644 --- a/tests/phpunit/api/v3/OptionGroupTest.php +++ b/tests/phpunit/api/v3/OptionGroupTest.php @@ -35,7 +35,7 @@ class api_v3_OptionGroupTest extends CiviUnitTestCase { protected $_entity = 'OptionGroup'; - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(TRUE); $this->_params = array( diff --git a/tests/phpunit/api/v3/OptionValueTest.php b/tests/phpunit/api/v3/OptionValueTest.php index 5f783208be..0a3c6e41d9 100644 --- a/tests/phpunit/api/v3/OptionValueTest.php +++ b/tests/phpunit/api/v3/OptionValueTest.php @@ -33,7 +33,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; class api_v3_OptionValueTest extends CiviUnitTestCase { protected $_apiversion = 3; - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(TRUE); } @@ -58,7 +58,7 @@ class api_v3_OptionValueTest extends CiviUnitTestCase { /** * Test limit param */ - function testGetOptionValueLimit() { + public function testGetOptionValueLimit() { $params = array(); $result = $this->callAPISuccess('option_value', 'get', $params); $this->assertGreaterThan(1, $result['count'], "Check more than one exists In line " . __LINE__); @@ -70,7 +70,7 @@ class api_v3_OptionValueTest extends CiviUnitTestCase { /** * Test offset param */ - function testGetOptionValueOffSet() { + public function testGetOptionValueOffSet() { $result = $this->callAPISuccess('option_value', 'get', array( 'option_group_id' => 1, @@ -86,7 +86,7 @@ class api_v3_OptionValueTest extends CiviUnitTestCase { /** * Test offset param */ - function testGetSingleValueOptionValueSort() { + public function testGetSingleValueOptionValueSort() { $description = "demonstrates use of Sort param (available in many api functions). Also, getsingle"; $subfile = 'SortOption'; $result = $this->callAPISuccess('option_value', 'getsingle', array( @@ -108,7 +108,7 @@ class api_v3_OptionValueTest extends CiviUnitTestCase { /** * Try to emulate a pagination: fetch the first page of 10 options, then fetch the second page with an offset of 9 (instead of 10) and check the start of the second page is the end of the 1st one. */ - function testGetValueOptionPagination() { + public function testGetValueOptionPagination() { $pageSize = 10; $page1 = $this->callAPISuccess('option_value', 'get', array('options' => array('limit' => $pageSize), )); $page2 = $this->callAPISuccess('option_value', 'get', array( diff --git a/tests/phpunit/api/v3/ParticipantPaymentTest.php b/tests/phpunit/api/v3/ParticipantPaymentTest.php index f0e14752e2..3003b767ee 100644 --- a/tests/phpunit/api/v3/ParticipantPaymentTest.php +++ b/tests/phpunit/api/v3/ParticipantPaymentTest.php @@ -45,7 +45,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { protected $_participantPaymentID; protected $_contributionTypeId; - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(TRUE); $event = $this->eventCreate(NULL); @@ -68,7 +68,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { /** * Test civicrm_participant_payment_create with wrong params type */ - function testPaymentCreateWrongParamsType() { + public function testPaymentCreateWrongParamsType() { $params = 'a string'; $result = $this->callAPIFailure('participant_payment', 'create', $params); } @@ -76,7 +76,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { /** * Test civicrm_participant_payment_create with empty params */ - function testPaymentCreateEmptyParams() { + public function testPaymentCreateEmptyParams() { $params = array(); $result = $this->callAPIFailure('participant_payment', 'create', $params); } @@ -84,7 +84,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { /** * Check without contribution_id */ - function testPaymentCreateMissingContributionId() { + public function testPaymentCreateMissingContributionId() { //Without Payment EntityID $params = array( 'participant_id' => $this->_participantID, ); @@ -95,7 +95,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { /** * Check with valid array */ - function testPaymentCreate() { + public function testPaymentCreate() { //Create Contribution & get contribution ID $contributionID = $this->contributionCreate($this->_contactID); @@ -118,7 +118,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { /** * Test civicrm_participant_payment_create with wrong params type */ - function testPaymentUpdateWrongParamsType() { + public function testPaymentUpdateWrongParamsType() { $params = 'a string'; $result = $this->callAPIFailure('participant_payment', 'create', $params); $this->assertEquals('Input variable `params` is not an array', $result['error_message'], 'In line ' . __LINE__); @@ -127,7 +127,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { /** * Check with empty array */ - function testPaymentUpdateEmpty() { + public function testPaymentUpdateEmpty() { $params = array(); $participantPayment = $this->callAPIFailure('participant_payment', 'create', $params); } @@ -135,7 +135,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { /** * Check with missing participant_id */ - function testPaymentUpdateMissingParticipantId() { + public function testPaymentUpdateMissingParticipantId() { //WithoutParticipantId $params = array( 'contribution_id' => '3', ); @@ -146,7 +146,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { /** * Check with missing contribution_id */ - function testPaymentUpdateMissingContributionId() { + public function testPaymentUpdateMissingContributionId() { $params = array( 'participant_id' => $this->_participantID, ); $participantPayment = $this->callAPIFailure('participant_payment', 'create', $params); @@ -155,7 +155,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { /** * Check financial records for offline Participants */ - function testPaymentOffline() { + public function testPaymentOffline() { // create contribution w/o fee $contributionID = $this->contributionCreate($this->_contactID, $this->_contributionTypeId, NULL, NULL, 4, FALSE); @@ -181,7 +181,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { /** * Check financial records for online Participant */ - function testPaymentOnline() { + public function testPaymentOnline() { $paymentProcessor = $this->processorCreate(); $pageParams['processor_id'] = $paymentProcessor->id; @@ -214,7 +214,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { /** * Check financial records for online Participant pay later scenario */ - function testPaymentPayLaterOnline() { + public function testPaymentPayLaterOnline() { $paymentProcessor = $this->processorCreate(); $pageParams['processor_id'] = $paymentProcessor->id; @@ -251,7 +251,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { /** * Test civicrm_participant_payment_delete with wrong params type */ - function testPaymentDeleteWrongParamsType() { + public function testPaymentDeleteWrongParamsType() { $params = 'a string'; $result = $this->callAPIFailure('participant_payment', 'delete', $params); } @@ -259,7 +259,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { /** * Check with empty array */ - function testPaymentDeleteWithEmptyParams() { + public function testPaymentDeleteWithEmptyParams() { $params = array(); $deletePayment = $this->callAPIFailure('participant_payment', 'delete', $params); $this->assertEquals('Mandatory key(s) missing from params array: id', $deletePayment['error_message']); @@ -268,7 +268,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { /** * Check with wrong id */ - function testPaymentDeleteWithWrongID() { + public function testPaymentDeleteWithWrongID() { $params = array( 'id' => 0, ); $deletePayment = $this->callAPIFailure('participant_payment', 'delete', $params); @@ -278,7 +278,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { /** * Check with valid array */ - function testPaymentDelete() { + public function testPaymentDelete() { // create contribution $contributionID = $this->contributionCreate($this->_contactID, $this->_contributionTypeId); @@ -316,7 +316,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { * @param array $params * @param $context */ - function _checkFinancialRecords($params, $context) { + public function _checkFinancialRecords($params, $context) { $entityParams = array( 'entity_id' => $params['id'], 'entity_table' => 'civicrm_contribution', diff --git a/tests/phpunit/api/v3/ParticipantStatusTypeTest.php b/tests/phpunit/api/v3/ParticipantStatusTypeTest.php index 79ac4480e6..076223110a 100644 --- a/tests/phpunit/api/v3/ParticipantStatusTypeTest.php +++ b/tests/phpunit/api/v3/ParticipantStatusTypeTest.php @@ -38,7 +38,7 @@ class api_v3_ParticipantStatusTypeTest extends CiviUnitTestCase { public $DBResetRequired = FALSE; - function setUp() { + public function setUp() { $this->_apiversion = 3; $this->params = array( 'name' => 'test status', diff --git a/tests/phpunit/api/v3/ParticipantTest.php b/tests/phpunit/api/v3/ParticipantTest.php index 5707f368fa..295d010527 100644 --- a/tests/phpunit/api/v3/ParticipantTest.php +++ b/tests/phpunit/api/v3/ParticipantTest.php @@ -50,7 +50,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { protected $_individualId; protected $_params; - function setUp() { + public function setUp() { $this->_apiversion = 3; parent::setUp(); $this->_entity = 'participant'; @@ -77,7 +77,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { ); } - function tearDown() { + public function tearDown() { $this->eventDelete($this->_eventID); $tablesToTruncate = array( 'civicrm_custom_group', 'civicrm_custom_field', 'civicrm_contact', 'civicrm_participant' @@ -92,7 +92,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { * variables specific to participant so it can be replicated into other entities * and / or moved to the automated test suite */ - function testCreateWithCustom() { + public function testCreateWithCustom() { $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__); $params = $this->_params; @@ -115,7 +115,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Check with wrong params type */ - function testGetWrongParamsType() { + public function testGetWrongParamsType() { $params = 'a string'; $result = $this->callAPIFailure('participant', 'get', $params); } @@ -123,14 +123,14 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Test civicrm_participant_get with empty params */ - function testGetEmptyParams() { + public function testGetEmptyParams() { $this->callAPISuccess('participant', 'get', array()); } /** * Check with participant_id */ - function testGetParticipantIdOnly() { + public function testGetParticipantIdOnly() { $params = array( 'participant_id' => $this->_participantID, 'return' => array( @@ -159,7 +159,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Check with params id */ - function testGetParamsAsIdOnly() { + public function testGetParamsAsIdOnly() { $params = array( 'id' => $this->_participantID, ); @@ -173,7 +173,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Check with params id */ - function testGetNestedEventGet() { + public function testGetNestedEventGet() { //create a second event & add participant to it. $event = $this->eventCreate(NULL); $this->callAPISuccess('participant', 'create', array('event_id' => $event['id'], 'contact_id' => $this->_contactID)); @@ -195,7 +195,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Check Participant Get respects return properties */ - function testGetWithReturnProperties() { + public function testGetWithReturnProperties() { $params = array( 'contact_id' => $this->_contactID, 'return.status_id' => 1, 'return.participant_status_id' => 1, @@ -208,7 +208,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Check with contact_id */ - function testGetContactIdOnly() { + public function testGetContactIdOnly() { $params = array( 'contact_id' => $this->_contactID, ); $participant = $this->callAPISuccess('participant', 'get', $params); @@ -234,7 +234,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { * Check with event_id * fetch first record */ - function testGetMultiMatchReturnFirst() { + public function testGetMultiMatchReturnFirst() { $params = array( 'event_id' => $this->_eventID, 'rowCount' => 1, ); @@ -247,7 +247,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { * Check with event_id * in v3 this should return all participants */ - function testGetMultiMatchNoReturnFirst() { + public function testGetMultiMatchNoReturnFirst() { $params = array( 'event_id' => $this->_eventID, ); @@ -261,7 +261,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { * Test civicrm_participant_get with empty params * In this case all the participant records are returned. */ - function testSearchEmptyParams() { + public function testSearchEmptyParams() { $result = $this->callAPISuccess('participant', 'get', array()); // expecting 3 participant records $this->assertEquals($result['count'], 3); @@ -270,7 +270,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Check with participant_id */ - function testSearchParticipantIdOnly() { + public function testSearchParticipantIdOnly() { $params = array( 'participant_id' => $this->_participantID, ); @@ -283,7 +283,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Check with contact_id */ - function testSearchContactIdOnly() { + public function testSearchContactIdOnly() { // Should get 2 participant records for this contact. $params = array( 'contact_id' => $this->_contactID2, @@ -296,7 +296,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Check with event_id */ - function testSearchByEvent() { + public function testSearchByEvent() { // Should get >= 3 participant records for this event. Also testing that last_name and event_title are returned. $params = array( 'event_id' => $this->_eventID, @@ -316,7 +316,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { * Check with event_id * fetch with limit */ - function testSearchByEventWithLimit() { + public function testSearchByEventWithLimit() { // Should 2 participant records since we're passing rowCount = 2. $params = array( 'event_id' => $this->_eventID, @@ -332,7 +332,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Test civicrm_participant_create with empty params */ - function testCreateEmptyParams() { + public function testCreateEmptyParams() { $params = array(); $result = $this->callAPIFailure('participant', 'create', $params); } @@ -340,7 +340,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Check with event_id */ - function testCreateMissingContactID() { + public function testCreateMissingContactID() { $params = array( 'event_id' => $this->_eventID, ); @@ -351,7 +351,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { * Check with contact_id * without event_id */ - function testCreateMissingEventID() { + public function testCreateMissingEventID() { $params = array( 'contact_id' => $this->_contactID, ); @@ -361,7 +361,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Check with contact_id & event_id */ - function testCreateEventIdOnly() { + public function testCreateEventIdOnly() { $params = array( 'contact_id' => $this->_contactID, 'event_id' => $this->_eventID, @@ -373,7 +373,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Check with complete array */ - function testCreateAllParams() { + public function testCreateAllParams() { $params = $this->_params; $participant = $this->callAPISuccess('participant', 'create', $params); @@ -385,7 +385,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Test to check if receive date is being changed per CRM-9763 */ - function testCreateUpdateReceiveDate() { + public function testCreateUpdateReceiveDate() { $participant = $this->callAPISuccess('participant', 'create', $this->_params); $update = array( 'id' => $participant['id'], @@ -398,7 +398,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Test to check if participant fee level is being changed per CRM-9781 */ - function testCreateUpdateParticipantFeeLevel() { + public function testCreateUpdateParticipantFeeLevel() { $myParams = $this->_params + array('participant_fee_level' => CRM_Core_DAO::VALUE_SEPARATOR . "fee" . CRM_Core_DAO::VALUE_SEPARATOR); $participant = $this->callAPISuccess('participant', 'create', $myParams); $update = array( @@ -417,7 +417,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Test the line items for participant fee with multiple price field values. */ - function testCreateParticipantLineItems() { + public function testCreateParticipantLineItems() { // Create a price set for this event. $priceset = $this->callAPISuccess('PriceSet', 'create', array( @@ -510,7 +510,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Check with complete array */ - function testUpdate() { + public function testUpdate() { $participantId = $this->participantCreate(array( 'contactID' => $this->_individualId, 'eventID' => $this->_eventID @@ -534,7 +534,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { * Try again without a custom separater to check that one isn't added * (get & check won't accept an array) */ - function testUpdateCreateParticipantFeeLevelNoSeparator() { + public function testUpdateCreateParticipantFeeLevelNoSeparator() { $myParams = $this->_params + array('participant_fee_level' => "fee"); $participant = $this->callAPISuccess('participant', 'create', $myParams); @@ -554,7 +554,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Test civicrm_participant_update with wrong params type */ - function testUpdateWrongParamsType() { + public function testUpdateWrongParamsType() { $params = 'a string'; $result = $this->callAPIFailure('participant', 'create', $params); $this->assertEquals('Input variable `params` is not an array', $result['error_message'], 'In line ' . __LINE__); @@ -563,7 +563,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Check with empty array */ - function testUpdateEmptyParams() { + public function testUpdateEmptyParams() { $params = array(); $participant = $this->callAPIFailure('participant', 'create', $params); $this->assertEquals($participant['error_message'], 'Mandatory key(s) missing from params array: event_id, contact_id'); @@ -572,7 +572,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Check without event_id */ - function testUpdateWithoutEventId() { + public function testUpdateWithoutEventId() { $participantId = $this->participantCreate(array('contactID' => $this->_individualId, 'eventID' => $this->_eventID)); $params = array( 'contact_id' => $this->_individualId, @@ -590,7 +590,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Check with Invalid participantId */ - function testUpdateWithWrongParticipantId() { + public function testUpdateWithWrongParticipantId() { $params = array( 'id' => 1234, 'status_id' => 3, @@ -604,7 +604,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Check with Invalid ContactId */ - function testUpdateWithWrongContactId() { + public function testUpdateWithWrongContactId() { $participantId = $this->participantCreate(array( 'contactID' => $this->_individualId, 'eventID' => $this->_eventID, @@ -626,7 +626,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Test civicrm_participant_delete with wrong params type */ - function testDeleteWrongParamsType() { + public function testDeleteWrongParamsType() { $params = 'a string'; $result = $this->callAPIFailure('participant', 'delete', $params); } @@ -634,7 +634,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Test civicrm_participant_delete with empty params */ - function testDeleteEmptyParams() { + public function testDeleteEmptyParams() { $params = array(); $result = $this->callAPIFailure('participant', 'delete', $params); } @@ -642,7 +642,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Check with participant_id */ - function testParticipantDelete() { + public function testParticipantDelete() { $params = array( 'id' => $this->_participantID, ); $participant = $this->callAPISuccess('participant', 'delete', $params); @@ -655,7 +655,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { * and with event_id * This should return an error because required param is missing.. */ - function testParticipantDeleteMissingID() { + public function testParticipantDeleteMissingID() { $params = array( 'event_id' => $this->_eventID, ); $participant = $this->callAPIFailure('participant', 'delete', $params); @@ -665,7 +665,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Delete with a get - a 'criteria delete' */ - function testNestedDelete() { + public function testNestedDelete() { $description = "Criteria delete by nesting a GET & a DELETE"; $subfile = "NestedDelete"; $participants = $this->callAPISuccess('Participant', 'Get', array()); @@ -679,7 +679,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { /** * Test creation of a participant with an associated contribution */ - function testCreateParticipantWithPayment() { + public function testCreateParticipantWithPayment() { $description = "single function to create contact w partipation & contribution. Note that in the case of 'contribution' the 'create' is implied (api.contribution.create)"; $subfile = "CreateParticipantPayment"; diff --git a/tests/phpunit/api/v3/PaymentProcessorTest.php b/tests/phpunit/api/v3/PaymentProcessorTest.php index 60710a7b10..1ed1dc09c5 100644 --- a/tests/phpunit/api/v3/PaymentProcessorTest.php +++ b/tests/phpunit/api/v3/PaymentProcessorTest.php @@ -36,7 +36,7 @@ class api_v3_PaymentProcessorTest extends CiviUnitTestCase { protected $_apiversion = 3; protected $_params; - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(TRUE); // Create dummy processor @@ -63,7 +63,7 @@ class api_v3_PaymentProcessorTest extends CiviUnitTestCase { /** * Check with no name */ - function testPaymentProcessorCreateWithoutName() { + public function testPaymentProcessorCreateWithoutName() { $payProcParams = array( 'is_active' => 1, ); @@ -73,7 +73,7 @@ class api_v3_PaymentProcessorTest extends CiviUnitTestCase { /** * Create payment processor */ - function testPaymentProcessorCreate() { + public function testPaymentProcessorCreate() { $params = $this->_params; $result = $this->callAPIAndDocument('payment_processor', 'create', $params, __FUNCTION__, __FILE__); $this->assertNotNull($result['id'], 'in line ' . __LINE__); @@ -86,7 +86,7 @@ class api_v3_PaymentProcessorTest extends CiviUnitTestCase { /** * Test using example code */ - function testPaymentProcessorCreateExample() { + public function testPaymentProcessorCreateExample() { require_once 'api/v3/examples/PaymentProcessor/Create.php'; $result = payment_processor_create_example(); $expectedResult = payment_processor_create_expectedresult(); @@ -98,7 +98,7 @@ class api_v3_PaymentProcessorTest extends CiviUnitTestCase { /** * Check payment processor delete */ - function testPaymentProcessorDelete() { + public function testPaymentProcessorDelete() { $id = $this->testPaymentProcessorCreate(); $params = array( 'id' => $id, @@ -112,7 +112,7 @@ class api_v3_PaymentProcessorTest extends CiviUnitTestCase { /** * Check with valid params array. */ - function testPaymentProcessorsGet() { + public function testPaymentProcessorsGet() { $params = $this->_params; $params['user_name'] = 'test@test.com'; $this->callAPISuccess('payment_processor', 'create', $params); diff --git a/tests/phpunit/api/v3/PaymentProcessorTypeTest.php b/tests/phpunit/api/v3/PaymentProcessorTypeTest.php index 2bd7a72a48..5adfa71bfc 100644 --- a/tests/phpunit/api/v3/PaymentProcessorTypeTest.php +++ b/tests/phpunit/api/v3/PaymentProcessorTypeTest.php @@ -35,7 +35,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase { protected $_ppTypeID; protected $_apiversion; - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(TRUE); @@ -55,7 +55,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase { /** * Check with no name */ - function testPaymentProcessorTypeCreateWithoutName() { + public function testPaymentProcessorTypeCreateWithoutName() { $payProcParams = array( 'is_active' => 1, ); $result = $this->callAPIFailure('payment_processor_type', 'create', $payProcParams); @@ -67,7 +67,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase { /** * Create payment processor type */ - function testPaymentProcessorTypeCreate() { + public function testPaymentProcessorTypeCreate() { $params = array( 'sequential' => 1, 'name' => 'API_Test_PP', 'title' => 'API Test Payment Processor', @@ -88,7 +88,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase { /** * Test using example code */ - function testPaymentProcessorTypeCreateExample() { + public function testPaymentProcessorTypeCreateExample() { require_once 'api/v3/examples/PaymentProcessorType/Create.php'; $result = payment_processor_type_create_example(); $expectedResult = payment_processor_type_create_expectedresult(); @@ -100,7 +100,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase { /** * Check with empty array */ - function testPaymentProcessorTypeDeleteEmpty() { + public function testPaymentProcessorTypeDeleteEmpty() { $params = array(); $result = $this->callAPIFailure('payment_processor_type', 'delete', $params); } @@ -108,14 +108,14 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase { /** * Check with No array */ - function testPaymentProcessorTypeDeleteParamsNotArray() { + public function testPaymentProcessorTypeDeleteParamsNotArray() { $result = $this->callAPIFailure('payment_processor_type', 'delete', 'string'); } /** * Check if required fields are not passed */ - function testPaymentProcessorTypeDeleteWithoutRequired() { + public function testPaymentProcessorTypeDeleteWithoutRequired() { $params = array( 'name' => 'API_Test_PP', 'title' => 'API Test Payment Processor', @@ -129,14 +129,14 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase { /** * Check with incorrect required fields */ - function testPaymentProcessorTypeDeleteWithIncorrectData() { + public function testPaymentProcessorTypeDeleteWithIncorrectData() { $result = $this->callAPIFailure('payment_processor_type', 'delete', array('id' => 'abcd')); } /** * Check payment processor type delete */ - function testPaymentProcessorTypeDelete() { + public function testPaymentProcessorTypeDelete() { $payProcType = $this->paymentProcessorTypeCreate(); $params = array( 'id' => $payProcType, @@ -150,7 +150,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase { /** * Check with empty array */ - function testPaymentProcessorTypeUpdateEmpty() { + public function testPaymentProcessorTypeUpdateEmpty() { $params = array(); $result = $this->callAPIFailure('payment_processor_type', 'create', $params); $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: name, title, class_name, billing_mode'); @@ -159,7 +159,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase { /** * Check with No array */ - function testPaymentProcessorTypeUpdateParamsNotArray() { + public function testPaymentProcessorTypeUpdateParamsNotArray() { $result = $this->callAPIFailure('payment_processor_type', 'create', 'string'); $this->assertEquals($result['error_message'], 'Input variable `params` is not an array'); } @@ -167,7 +167,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase { /** * Check with all parameters */ - function testPaymentProcessorTypeUpdate() { + public function testPaymentProcessorTypeUpdate() { // create sample payment processor type. $this->_ppTypeID = $this->paymentProcessorTypeCreate(NULL); @@ -190,7 +190,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase { /** * Check with empty array */ - function testPaymentProcessorTypesGetEmptyParams() { + public function testPaymentProcessorTypesGetEmptyParams() { $results = $this->callAPISuccess('payment_processor_type', 'get', array( )); $baselineCount = $results['count']; @@ -219,7 +219,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase { /** * Check with valid params array. */ - function testPaymentProcessorTypesGet() { + public function testPaymentProcessorTypesGet() { $firstRelTypeParams = array( 'name' => 'API_Test_PP_11', 'title' => 'API Test Payment Processor 11', diff --git a/tests/phpunit/api/v3/PhoneTest.php b/tests/phpunit/api/v3/PhoneTest.php index b99f74d177..dc8b1c918d 100644 --- a/tests/phpunit/api/v3/PhoneTest.php +++ b/tests/phpunit/api/v3/PhoneTest.php @@ -42,7 +42,7 @@ class api_v3_PhoneTest extends CiviUnitTestCase { protected $_params; - function setUp() { + public function setUp() { $this->_apiversion = 3; parent::setUp(); $this->useTransaction(); diff --git a/tests/phpunit/api/v3/PledgePaymentTest.php b/tests/phpunit/api/v3/PledgePaymentTest.php index 4a8b21ae41..0832e4e14e 100644 --- a/tests/phpunit/api/v3/PledgePaymentTest.php +++ b/tests/phpunit/api/v3/PledgePaymentTest.php @@ -46,14 +46,14 @@ class api_v3_PledgePaymentTest extends CiviUnitTestCase { protected $_entity = 'PledgePayment'; public $DBResetRequired = TRUE; - function setUp() { + public function setUp() { parent::setUp(); $this->_individualId = $this->individualCreate(); $this->_pledgeID = $this->pledgeCreate($this->_individualId); $this->_contributionID = $this->contributionCreate($this->_individualId); } - function tearDown() { + public function tearDown() { $tablesToTruncate = array( 'civicrm_contribution', 'civicrm_contact', @@ -65,7 +65,7 @@ class api_v3_PledgePaymentTest extends CiviUnitTestCase { $this->quickCleanup($tablesToTruncate); } - function testGetPledgePayment() { + public function testGetPledgePayment() { $params = array(); $result = $this->callAPIAndDocument('pledge_payment', 'get', $params, __FUNCTION__, __FILE__); $this->assertEquals(5, $result['count'], " in line " . __LINE__); @@ -74,7 +74,7 @@ class api_v3_PledgePaymentTest extends CiviUnitTestCase { /** * Test that passing in a single variable works */ - function testGetSinglePledgePayment() { + public function testGetSinglePledgePayment() { $createparams = array( 'contact_id' => $this->_individualId, 'pledge_id' => $this->_pledgeID, @@ -92,7 +92,7 @@ class api_v3_PledgePaymentTest extends CiviUnitTestCase { /** * Test that passing in a single variable works:: status_id */ - function testGetSinglePledgePaymentByStatusID() { + public function testGetSinglePledgePaymentByStatusID() { $createparams = array( 'contact_id' => $this->_individualId, 'pledge_id' => $this->_pledgeID, @@ -111,7 +111,7 @@ class api_v3_PledgePaymentTest extends CiviUnitTestCase { /** * Test that creating a payment will add the contribution ID */ - function testCreatePledgePayment() { + public function testCreatePledgePayment() { //check that 5 pledge payments exist at the start $beforeAdd = $this->callAPISuccess('pledge_payment', 'get', array()); $this->assertEquals(5, $beforeAdd['count'], " in line " . __LINE__); @@ -157,7 +157,7 @@ class api_v3_PledgePaymentTest extends CiviUnitTestCase { /** * Test checks behaviour when more payments are created than should be possible */ - function testCreatePledgePaymentAllCreated() { + public function testCreatePledgePaymentAllCreated() { $params = array( 'pledge_id' => $this->_pledgeID, 'status_id' => 1, @@ -200,7 +200,7 @@ class api_v3_PledgePaymentTest extends CiviUnitTestCase { * Test that creating a payment will add the contribution ID where only one pledge payment * in schedule */ - function testCreatePledgePaymentWhereOnlyOnePayment() { + public function testCreatePledgePaymentWhereOnlyOnePayment() { $pledgeParams = array( 'contact_id' => $this->_individualId, 'pledge_create_date' => date('Ymd'), @@ -237,7 +237,7 @@ class api_v3_PledgePaymentTest extends CiviUnitTestCase { $this->assertEquals(1, $afterAdd['count'], " in line " . __LINE__); } - function testUpdatePledgePayment() { + public function testUpdatePledgePayment() { $params = array( 'pledge_id' => $this->_pledgeID, 'contribution_id' => $this->_contributionID, @@ -254,7 +254,7 @@ class api_v3_PledgePaymentTest extends CiviUnitTestCase { $this->getAndCheck(array_merge($params,$updateparams), $result['id'], $this->_entity); } - function testDeletePledgePayment() { + public function testDeletePledgePayment() { $params = array( 'contact_id' => $this->_individualId, 'pledge_id' => $this->_pledgeID, @@ -271,7 +271,7 @@ class api_v3_PledgePaymentTest extends CiviUnitTestCase { $result = $this->callAPIAndDocument('pledge_payment', 'delete', $deleteParams, __FUNCTION__, __FILE__); } - function testGetFields() { + public function testGetFields() { $result = $this->callAPISuccess('PledgePayment', 'GetFields', array()); $this->assertType('array', $result); } diff --git a/tests/phpunit/api/v3/PledgeTest.php b/tests/phpunit/api/v3/PledgeTest.php index f4508a1280..1020827aee 100644 --- a/tests/phpunit/api/v3/PledgeTest.php +++ b/tests/phpunit/api/v3/PledgeTest.php @@ -45,7 +45,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { protected $scheduled_date; public $DBResetRequired = True; - function setUp() { + public function setUp() { $this->_apiversion = 3; parent::setUp(); $this->quickCleanup(array('civicrm_pledge', 'civicrm_pledge_payment')); @@ -71,7 +71,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { ); } - function tearDown() { + public function tearDown() { $this->contactDelete($this->_individualId); } @@ -83,7 +83,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { * variables specific to participant so it can be replicated into other entities * and / or moved to the automated test suite */ - function testCreateWithCustom() { + public function testCreateWithCustom() { $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__); $params = $this->_params; @@ -104,12 +104,12 @@ class api_v3_PledgeTest extends CiviUnitTestCase { /* * */ - function testgetfieldspledge() { + public function testgetfieldspledge() { $result = $this->callAPISuccess('pledge', 'getfields', array('action' => 'get')); $this->assertEquals(1, $result['values']['next_pay_date']['api.return']); } - function testGetPledge() { + public function testGetPledge() { $this->_pledge = $this->callAPISuccess('pledge', 'create', $this->_params); @@ -135,7 +135,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { /** * Test 'return.pledge_financial_type' => 1 works */ - function testGetPledgewithReturn() { + public function testGetPledgewithReturn() { $this->_pledge = $this->callAPISuccess('pledge', 'create', $this->_params); $params = array( @@ -150,7 +150,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { * Test 'return.pledge_contribution_type' => 1 works * This is for legacy compatibility */ - function testGetPledgewithReturnLegacy() { + public function testGetPledgewithReturnLegacy() { $this->_pledge = $this->callAPISuccess('pledge', 'create', $this->_params); $params = array( @@ -162,7 +162,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { $this->assertEquals('Donation', $pledge['pledge_financial_type']); } - function testPledgeGetReturnFilters() { + public function testPledgeGetReturnFilters() { $oldPledge = $this->callAPISuccess('pledge', 'create', $this->_params); $overdueParams = array( @@ -183,7 +183,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { /* * create 2 pledges - see if we can get by status id */ - function testGetOverduePledge() { + public function testGetOverduePledge() { $overdueParams = array( 'scheduled_date' => 'first saturday of march last year', 'start_date' => 'first saturday of march last year', @@ -204,7 +204,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { /* * create 2 pledges - see if we can get by status id */ - function testSortParamPledge() { + public function testSortParamPledge() { $pledge1 = $this->callAPISuccess('pledge', 'create', $this->_params); $overdueParams = array( 'scheduled_date' => 'first saturday of march last year', @@ -231,7 +231,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { $this->callAPISuccess('pledge', 'delete', array('id' => $pledge2['id'])); } - function testCreatePledge() { + public function testCreatePledge() { $result = $this->callAPIAndDocument('pledge', 'create', $this->_params, __FUNCTION__, __FILE__); $this->assertEquals($result['values'][0]['amount'], 100.00, 'In line ' . __LINE__); @@ -258,7 +258,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { /* * Test that pledge with weekly schedule calculates dates correctly */ - function testCreatePledgeWeeklySchedule() { + public function testCreatePledgeWeeklySchedule() { $params = array( 'scheduled_date' => '20110510', 'frequency_unit' => 'week', @@ -279,7 +279,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { /* * Test that pledge with weekly schedule calculates dates correctly */ - function testCreatePledgeMontlySchedule() { + public function testCreatePledgeMontlySchedule() { $params = array( 'scheduled_date' => '20110510', 'frequency_unit' => 'Month', @@ -298,7 +298,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { * http://issues.civicrm.org/jira/browse/CRM-8551 * */ - function testCreatePledgeSinglePayment() { + public function testCreatePledgeSinglePayment() { $params = array( 'scheduled_date' => '20110510', 'frequency_unit' => 'week', @@ -325,7 +325,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { * test that using original_installment_amount rather than pledge_original_installment_amount works * Pledge field behaviour is a bit random & so pledge has come to try to handle both unique & non -unique fields */ - function testCreatePledgeWithNonUnique() { + public function testCreatePledgeWithNonUnique() { $params = $this->_params; $params['original_installment_amount'] = $params['pledge_original_installment_amount']; @@ -342,7 +342,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { $pledge = $this->callAPISuccess('pledge', 'delete', $pledgeID); } - function testCreateCancelPledge() { + public function testCreateCancelPledge() { $result = $this->callAPISuccess('pledge', 'create', $this->_params); @@ -357,7 +357,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { /** * Test that status is set to pending */ - function testCreatePledgeNoStatus() { + public function testCreatePledgeNoStatus() { $params = $this->_params; unset($params['status_id']); @@ -372,7 +372,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { /** * To Update Pledge */ - function testCreateUpdatePledge() { + public function testCreateUpdatePledge() { // we test 'sequential' param here too $pledgeID = $this->pledgeCreate($this->_individualId); $old_params = array( @@ -416,7 +416,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { * Here we ensure we are maintaining our 'contract' & supporting previously working syntax * ie contribution_type_id */ - function testCreateUpdatePledgeLegacy() { + public function testCreateUpdatePledgeLegacy() { // we test 'sequential' param here too $pledgeID = $this->pledgeCreate($this->_individualId); @@ -459,12 +459,12 @@ class api_v3_PledgeTest extends CiviUnitTestCase { } ///////////////// civicrm_pledge_delete methods - function testDeleteEmptyParamsPledge() { + public function testDeleteEmptyParamsPledge() { $pledge = $this->callAPIFailure('pledge', 'delete', array(), 'Mandatory key(s) missing from params array: id'); } - function testDeleteWrongParamPledge() { + public function testDeleteWrongParamPledge() { $params = array( 'pledge_source' => 'SSF', ); @@ -474,7 +474,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { /** * Legacy support for pledge_id */ - function testDeletePledge() { + public function testDeletePledge() { $pledgeID = $this->pledgeCreate($this->_individualId); $params = array( @@ -486,7 +486,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { /** * Std is to accept id */ - function testDeletePledgeUseID() { + public function testDeletePledgeUseID() { $pledgeID = $this->pledgeCreate($this->_individualId); $params = array( @@ -500,7 +500,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { * Note that the function gives incorrect results if no pledges exist as it does a * contact search instead - test only checks that the get finds the one existing */ - function testGetEmpty() { + public function testGetEmpty() { $result = $this->callAPISuccess('pledge', 'create', $this->_params); $result = $this->callAPISuccess('pledge', 'get', array()); $this->assertAPISuccess($result, "This test is failing because it's acting like a contact get when no params set. Not sure the fix"); diff --git a/tests/phpunit/api/v3/PriceFieldTest.php b/tests/phpunit/api/v3/PriceFieldTest.php index 7a1a9a04b8..95fb78fa2c 100644 --- a/tests/phpunit/api/v3/PriceFieldTest.php +++ b/tests/phpunit/api/v3/PriceFieldTest.php @@ -67,7 +67,7 @@ class api_v3_PriceFieldTest extends CiviUnitTestCase { ); } - function tearDown() { + public function tearDown() { $tablesToTruncate = array( 'civicrm_contact', 'civicrm_contribution', diff --git a/tests/phpunit/api/v3/PriceFieldValueTest.php b/tests/phpunit/api/v3/PriceFieldValueTest.php index c7a1708b89..1e628619dc 100644 --- a/tests/phpunit/api/v3/PriceFieldValueTest.php +++ b/tests/phpunit/api/v3/PriceFieldValueTest.php @@ -101,7 +101,7 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase { $this->priceFieldID1 = $priceField1['id']; } - function tearDown() { + public function tearDown() { $tablesToTruncate = array( 'civicrm_contact', 'civicrm_contribution', diff --git a/tests/phpunit/api/v3/PriceSetTest.php b/tests/phpunit/api/v3/PriceSetTest.php index 1664144095..696673773f 100644 --- a/tests/phpunit/api/v3/PriceSetTest.php +++ b/tests/phpunit/api/v3/PriceSetTest.php @@ -55,7 +55,7 @@ class api_v3_PriceSetTest extends CiviUnitTestCase { ); } - function tearDown() { + public function tearDown() { } /** diff --git a/tests/phpunit/api/v3/ProductTest.php b/tests/phpunit/api/v3/ProductTest.php index f8982831e4..1c4bd281fa 100644 --- a/tests/phpunit/api/v3/ProductTest.php +++ b/tests/phpunit/api/v3/ProductTest.php @@ -36,7 +36,7 @@ class api_v3_ProductTest extends CiviUnitTestCase { protected $_entity = 'Product'; - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(); $this->_params = array( @@ -48,12 +48,12 @@ class api_v3_ProductTest extends CiviUnitTestCase { // $this->quickCleanup(array('civicrm_product'), TRUE); // } - function testGetFields() { + public function testGetFields() { $fields = $this->callAPISuccess($this->_entity, 'getfields', array('action' => 'create')); $this->assertArrayHasKey('period_type', $fields['values']); } - function testGetOptions() { + public function testGetOptions() { $options = $this->callAPISuccess($this->_entity, 'getoptions', array('field' => 'period_type')); $this->assertArrayHasKey('rolling', $options['values']); } diff --git a/tests/phpunit/api/v3/ProfileTest.php b/tests/phpunit/api/v3/ProfileTest.php index 01d47865fa..c3de39dc0e 100644 --- a/tests/phpunit/api/v3/ProfileTest.php +++ b/tests/phpunit/api/v3/ProfileTest.php @@ -42,7 +42,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { protected $_membershipTypeID; protected $_contactID; - function setUp() { + public function setUp() { $this->_apiversion = 3; parent::setUp(); $config = CRM_Core_Config::singleton(); @@ -52,7 +52,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { $this->_membershipTypeID = $this->membershipTypeCreate(); } - function tearDown() { + public function tearDown() { $this->quickCleanup(array( 'civicrm_contact', @@ -71,7 +71,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Check Without ProfileId */ - function testProfileGetWithoutProfileId() { + public function testProfileGetWithoutProfileId() { $params = array( 'contact_id' => 1, ); @@ -83,7 +83,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Check with no invalid profile Id */ - function testProfileGetInvalidProfileId() { + public function testProfileGetInvalidProfileId() { $params = array( 'contact_id' => 1, 'profile_id' => 1000, @@ -94,7 +94,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Check with success */ - function testProfileGet() { + public function testProfileGet() { $pofileFieldValues = $this->_createIndividualContact(); $expected = current($pofileFieldValues); $contactId = key($pofileFieldValues); @@ -108,7 +108,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { } } - function testProfileGetMultiple() { + public function testProfileGetMultiple() { $pofileFieldValues = $this->_createIndividualContact(); $expected = current($pofileFieldValues); $contactId = key($pofileFieldValues); @@ -137,7 +137,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { )); } - function testProfileGetBillingUseIsBillingLocation() { + public function testProfileGetBillingUseIsBillingLocation() { $individual = $this->_createIndividualContact(); $contactId = key($individual); $this->callAPISuccess('address', 'create', array( @@ -170,7 +170,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { ), $result['values']['Billing']); } - function testProfileGetMultipleHasBillingLocation() { + public function testProfileGetMultipleHasBillingLocation() { $individual = $this->_createIndividualContact(); $contactId = key($individual); $this->callAPISuccess('address', 'create', array('contact_id' => $contactId , 'street_address' => '25 Big Street', 'city' => 'big city', 'location_type_id' => 5)); @@ -202,7 +202,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Get Billing empty contact - this will return generic defaults */ - function testProfileGetBillingEmptyContact() { + public function testProfileGetBillingEmptyContact() { $params = array( 'profile_id' => array('Billing'), @@ -226,7 +226,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Check contact activity profile without activity id */ - function testContactActivityGetWithoutActivityId() { + public function testContactActivityGetWithoutActivityId() { list($params, $expected) = $this->_createContactWithActivity(); unset($params['activity_id']); @@ -237,7 +237,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Check contact activity profile wrong activity id */ - function testContactActivityGetWrongActivityId() { + public function testContactActivityGetWrongActivityId() { list($params, $expected) = $this->_createContactWithActivity(); $params['activity_id'] = 100001; @@ -248,7 +248,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Check contact activity profile with wrong activity type */ - function testContactActivityGetWrongActivityType() { + public function testContactActivityGetWrongActivityType() { //flush cache by calling with reset $activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, TRUE, 'name', TRUE); @@ -281,7 +281,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Check contact activity profile with success */ - function testContactActivityGetSuccess() { + public function testContactActivityGetSuccess() { list($params, $expected) = $this->_createContactWithActivity(); $result = $this->callAPISuccess('profile', 'get', $params); @@ -295,7 +295,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Check getfields works & gives us our fields */ - function testGetFields() { + public function testGetFields() { $this->_createIndividualProfile(); $this->_addCustomFieldToProfile($this->_profileID); $result = $this->callAPIAndDocument('profile', 'getfields', array('action' => 'submit', 'profile_id' => $this->_profileID), __FUNCTION__, __FILE__, @@ -311,7 +311,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Check getfields works & gives us our fields - partipant profile */ - function testGetFieldsParticipantProfile() { + public function testGetFieldsParticipantProfile() { $result = $this->callAPISuccess('profile', 'getfields', array( 'action' => 'submit', 'profile_id' => 'participant_status', @@ -326,7 +326,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { * Check getfields works & gives us our fields - membership_batch_entry * (getting to the end with no e-notices is pretty good evidence it's working) */ - function testGetFieldsMembershipBatchProfile() { + public function testGetFieldsMembershipBatchProfile() { $result = $this->callAPISuccess('profile', 'getfields', array( 'action' => 'submit', 'profile_id' => 'membership_batch_entry', @@ -343,7 +343,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { * Check getfields works & gives us our fields - do them all * (getting to the end with no e-notices is pretty good evidence it's working) */ - function testGetFieldsAllProfiles() { + public function testGetFieldsAllProfiles() { $result = $this->callAPISuccess('uf_group', 'get', array('return' => 'id')); $profileIDs = array_keys($result['values']); foreach ($profileIDs as $profileID) { @@ -359,7 +359,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Check Without ProfileId */ - function testProfileSubmitWithoutProfileId() { + public function testProfileSubmitWithoutProfileId() { $params = array( 'contact_id' => 1, ); @@ -371,7 +371,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Check with no invalid profile Id */ - function testProfileSubmitInvalidProfileId() { + public function testProfileSubmitInvalidProfileId() { $params = array( 'contact_id' => 1, 'profile_id' => 1000, @@ -382,7 +382,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Check with missing required field in profile */ - function testProfileSubmitCheckProfileRequired() { + public function testProfileSubmitCheckProfileRequired() { $pofileFieldValues = $this->_createIndividualContact(); current($pofileFieldValues); $contactId = key($pofileFieldValues); @@ -406,7 +406,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Check with success */ - function testProfileSubmit() { + public function testProfileSubmit() { $pofileFieldValues = $this->_createIndividualContact(); current($pofileFieldValues); $contactId = key($pofileFieldValues); @@ -448,7 +448,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { * Ensure caches are being cleared so we don't get into a debugging trap because of cached metadata * First we delete & create to increment the version & then check for caching probs */ - function testProfileSubmitCheckCaching() { + public function testProfileSubmitCheckCaching() { $this->callAPISuccess('membership_type', 'delete', array('id' => $this->_membershipTypeID)); $this->_membershipTypeID = $this->membershipTypeCreate(); @@ -463,7 +463,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Test that the fields are returned in the right order despite the faffing around that goes on */ - function testMembershipGetFieldsOrder() { + public function testMembershipGetFieldsOrder() { $result = $this->callAPISuccess('profile', 'getfields', array('action' => 'submit', 'profile_id' => 'membership_batch_entry')); $weight = 1; foreach($result['values'] as $fieldName => $field) { @@ -477,7 +477,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Check we can submit membership batch profiles (create mode) */ - function testProfileSubmitMembershipBatch() { + public function testProfileSubmitMembershipBatch() { $this->_contactID = $this->individualCreate(); $this->callAPISuccess('profile', 'submit', array( 'profile_id' => 'membership_batch_entry', @@ -493,7 +493,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Set is deprecated but we need to ensure it still works */ - function testLegacySet() { + public function testLegacySet() { $pofileFieldValues = $this->_createIndividualContact(); current($pofileFieldValues); $contactId = key($pofileFieldValues); @@ -529,7 +529,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Check contact activity profile without activity id */ - function testContactActivitySubmitWithoutActivityId() { + public function testContactActivitySubmitWithoutActivityId() { list($params, $expected) = $this->_createContactWithActivity(); $params = array_merge($params, $expected); @@ -541,7 +541,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Check contact activity profile wrong activity id */ - function testContactActivitySubmitWrongActivityId() { + public function testContactActivitySubmitWrongActivityId() { list($params, $expected) = $this->_createContactWithActivity(); $params = array_merge($params, $expected); $params['activity_id'] = 100001; @@ -552,7 +552,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Check contact activity profile with wrong activity type */ - function testContactActivitySubmitWrongActivityType() { + public function testContactActivitySubmitWrongActivityType() { //flush cache by calling with reset $activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, TRUE, 'name', TRUE); @@ -585,7 +585,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Check contact activity profile with success */ - function testContactActivitySubmitSuccess() { + public function testContactActivitySubmitSuccess() { list($params, $expected) = $this->_createContactWithActivity(); $updateParams = array( @@ -611,7 +611,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Check profile apply Without ProfileId */ - function testProfileApplyWithoutProfileId() { + public function testProfileApplyWithoutProfileId() { $params = array( 'contact_id' => 1, ); @@ -622,7 +622,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Check profile apply with no invalid profile Id */ - function testProfileApplyInvalidProfileId() { + public function testProfileApplyInvalidProfileId() { $params = array( 'contact_id' => 1, 'profile_id' => 1000, @@ -633,7 +633,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Check with success */ - function testProfileApply() { + public function testProfileApply() { $pofileFieldValues = $this->_createIndividualContact(); current($pofileFieldValues); $contactId = key($pofileFieldValues); @@ -698,7 +698,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { * * @return mixed */ - function _createIndividualContact($params = array()) { + public function _createIndividualContact($params = array()) { $contactParams = array_merge(array( 'first_name' => 'abc1', 'last_name' => 'xyz1', @@ -743,7 +743,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * @return array */ - function _createContactWithActivity() { + public function _createContactWithActivity() { // @TODO: Create profile with custom fields $op = new PHPUnit_Extensions_Database_Operation_Insert(); $op->execute($this->_dbconn, @@ -821,7 +821,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Create a profile */ - function _createIndividualProfile() { + public function _createIndividualProfile() { // creating these via the api as we want to utilise & test the flushing of caches when fields created // via the api @@ -893,7 +893,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * @param int $profileID */ - function _addCustomFieldToProfile($profileID) { + public function _addCustomFieldToProfile($profileID) { $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, ''); $this->uFFieldCreate(array('uf_group_id' => $profileID, 'field_name' => 'custom_' . $ids['custom_field_id'], 'contact_type' => 'Contact')); } diff --git a/tests/phpunit/api/v3/RelationshipTest.php b/tests/phpunit/api/v3/RelationshipTest.php index e8702ddc6f..68b56fb5bd 100644 --- a/tests/phpunit/api/v3/RelationshipTest.php +++ b/tests/phpunit/api/v3/RelationshipTest.php @@ -49,7 +49,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { protected $_entity; - function setUp() { + public function setUp() { parent::setUp(); $this->_cId_a = $this->individualCreate(); $this->_cId_a_2 = $this->individualCreate(array('last_name' => 'c2', 'email' => 'c@w.com', 'contact_type' => 'Individual')); @@ -78,7 +78,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { } - function tearDown() { + public function tearDown() { $this->contactDelete($this->_cId_a); $this->contactDelete($this->_cId_a_2); $this->contactDelete($this->_cId_b); @@ -92,14 +92,14 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * Check with empty array */ - function testRelationshipCreateEmpty() { + public function testRelationshipCreateEmpty() { $this->callAPIFailure('relationship', 'create', array()); } /** * Check if required fields are not passed */ - function testRelationshipCreateWithoutRequired() { + public function testRelationshipCreateWithoutRequired() { $params = array( 'start_date' => array('d' => '10', 'M' => '1', 'Y' => '2008'), 'end_date' => array('d' => '10', 'M' => '1', 'Y' => '2009'), @@ -112,7 +112,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * Check with incorrect required fields */ - function testRelationshipCreateWithIncorrectData() { + public function testRelationshipCreateWithIncorrectData() { $params = array( 'contact_id_a' => $this->_cId_a, @@ -145,7 +145,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * Check relationship creation with invalid Relationship */ - function testRelationshipCreatInvalidRelationship() { + public function testRelationshipCreatInvalidRelationship() { // both the contact of type Individual $params = array( 'contact_id_a' => $this->_cId_a, @@ -172,7 +172,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * Check relationship already exists */ - function testRelationshipCreateAlreadyExists() { + public function testRelationshipCreateAlreadyExists() { $params = array( 'contact_id_a' => $this->_cId_a, 'contact_id_b' => $this->_cId_b, @@ -198,7 +198,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * Check relationship already exists */ - function testRelationshipCreateUpdateAlreadyExists() { + public function testRelationshipCreateUpdateAlreadyExists() { $params = array( 'contact_id_a' => $this->_cId_a, 'contact_id_b' => $this->_cId_b, @@ -223,7 +223,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * Checkupdate doesn't reset stuff badly - CRM-11789 */ - function testRelationshipCreateUpdateDoesntMangle() { + public function testRelationshipCreateUpdateDoesntMangle() { $params = array( 'contact_id_a' => $this->_cId_a, 'contact_id_b' => $this->_cId_b, @@ -251,7 +251,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * Check relationship creation */ - function testRelationshipCreate() { + public function testRelationshipCreate() { $params = array( 'contact_id_a' => $this->_cId_a, 'contact_id_b' => $this->_cId_b, @@ -284,7 +284,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * Ensure disabling works */ - function testRelationshipUpdate() { + public function testRelationshipUpdate() { $result = $this->callAPISuccess('relationship', 'create', $this->_params); $relID = $result['id']; $result = $this->callAPISuccess('relationship', 'create', array('id' => $relID, 'description' => 'blah')); @@ -300,7 +300,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * Check relationship creation */ - function testRelationshipCreateEmptyEndDate() { + public function testRelationshipCreateEmptyEndDate() { $params = array( 'contact_id_a' => $this->_cId_a, 'contact_id_b' => $this->_cId_b, @@ -338,7 +338,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * Check relationship creation with custom data */ - function testRelationshipCreateWithCustomData() { + public function testRelationshipCreateWithCustomData() { $customGroup = $this->createCustomGroup(); $this->_ids = $this->createCustomField(); //few custom Values for comparing @@ -376,7 +376,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { * variables specific to participant so it can be replicated into other entities * and / or moved to the automated test suite */ - function testGetWithCustom() { + public function testGetWithCustom() { $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__); $params = $this->_params; @@ -396,7 +396,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * @return mixed */ - function createCustomGroup() { + public function createCustomGroup() { $params = array( 'title' => 'Custom Group', 'extends' => array('Relationship'), @@ -413,7 +413,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * @return array */ - function createCustomField() { + public function createCustomField() { $ids = array(); $params = array( 'custom_group_id' => $this->_customGroupId, @@ -506,7 +506,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * Check with empty array */ - function testRelationshipDeleteEmpty() { + public function testRelationshipDeleteEmpty() { $params = array(); $result = $this->callAPIFailure('relationship', 'delete', $params, 'Mandatory key(s) missing from params array: id'); } @@ -514,7 +514,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * Check if required fields are not passed */ - function testRelationshipDeleteWithoutRequired() { + public function testRelationshipDeleteWithoutRequired() { $params = array( 'start_date' => '2008-12-20', 'end_date' => '2009-12-20', @@ -527,7 +527,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * Check with incorrect required fields */ - function testRelationshipDeleteWithIncorrectData() { + public function testRelationshipDeleteWithIncorrectData() { $params = array( 'contact_id_a' => $this->_cId_a, 'contact_id_b' => $this->_cId_b, @@ -543,7 +543,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * Check relationship creation */ - function testRelationshipDelete() { + public function testRelationshipDelete() { $params = array( 'contact_id_a' => $this->_cId_a, 'contact_id_b' => $this->_cId_b, @@ -567,7 +567,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * Check with empty array */ - function testRelationshipUpdateEmpty() { + public function testRelationshipUpdateEmpty() { $result = $this->callAPIFailure('relationship', 'create', array(), 'Mandatory key(s) missing from params array: contact_id_a, contact_id_b, relationship_type_id'); } @@ -579,7 +579,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * Check relationship update */ - function testRelationshipCreateDuplicate() { + public function testRelationshipCreateDuplicate() { $relParams = array( 'contact_id_a' => $this->_cId_a, 'contact_id_b' => $this->_cId_b, @@ -619,7 +619,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * Check with valid params array. */ - function testRelationshipsGet() { + public function testRelationshipsGet() { $relParams = array( 'contact_id_a' => $this->_cId_a, 'contact_id_b' => $this->_cId_b, @@ -654,7 +654,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { * Check with valid params array. * (The get function will behave differently without 'contact_id' passed */ - function testRelationshipsGetGeneric() { + public function testRelationshipsGetGeneric() { $relParams = array( 'contact_id_a' => $this->_cId_a, 'contact_id_b' => $this->_cId_b, @@ -673,7 +673,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { $result = $this->callAPISuccess('relationship', 'get', $params); } - function testGetIsCurrent() { + public function testGetIsCurrent() { $rel2Params =array( 'contact_id_a' => $this->_cId_a, 'contact_id_b' => $this->_cId_b2, @@ -711,7 +711,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /* * Test using various operators */ - function testGetTypeOperators() { + public function testGetTypeOperators() { $relTypeParams = array( 'name_a_b' => 'Relation 3 for delete', 'name_b_a' => 'Relation 6 for delete', @@ -794,7 +794,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * Check with invalid relationshipType Id */ - function testRelationshipTypeAddInvalidId() { + public function testRelationshipTypeAddInvalidId() { $relTypeParams = array( 'id' => 'invalid', 'name_a_b' => 'Relation 1 for delete', @@ -809,7 +809,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * Check with valid data with contact_b */ - function testGetRelationshipWithContactB() { + public function testGetRelationshipWithContactB() { $relParams = array( 'contact_id_a' => $this->_cId_a, 'contact_id_b' => $this->_cId_b, @@ -837,7 +837,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * Check with valid data with relationshipTypes */ - function testGetRelationshipWithRelTypes() { + public function testGetRelationshipWithRelTypes() { $relParams = array( 'contact_id_a' => $this->_cId_a, 'contact_id_b' => $this->_cId_b, @@ -869,7 +869,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { * We should get 1 result without or with correct relationship type id & 0 with * an incorrect one */ - function testGetRelationshipByTypeReciprocal() { + public function testGetRelationshipByTypeReciprocal() { $created = $this->callAPISuccess($this->_entity, 'create', $this->_params); $result = $this->callAPISuccess($this->_entity, 'get', array( 'contact_id' => $this->_cId_a, @@ -891,7 +891,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { * We should get 1 result without or with correct relationship type id & 0 with * an incorrect one */ - function testGetRelationshipByTypeDAO() { + public function testGetRelationshipByTypeDAO() { $this->ids['relationship'] = $this->callAPISuccess($this->_entity, 'create', array('format.only_id' => TRUE,) + $this->_params); $result = $this->callAPISuccess($this->_entity, 'getcount', array( 'contact_id_a' => $this->_cId_a,), @@ -915,7 +915,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { * We should get 1 result without or with correct relationship type id & 0 with * an incorrect one */ - function testGetRelationshipByTypeArrayDAO() { + public function testGetRelationshipByTypeArrayDAO() { $created = $this->callAPISuccess($this->_entity, 'create', $this->_params); $org3 = $this->organizationCreate(); $relType2 = 5; // lets just assume built in ones aren't being messed with! @@ -953,7 +953,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { * We should get 1 result without or with correct relationship type id & 0 with * an incorrect one */ - function testGetRelationshipByTypeArrayReciprocal() { + public function testGetRelationshipByTypeArrayReciprocal() { $created = $this->callAPISuccess($this->_entity, 'create', $this->_params); $org3 = $this->organizationCreate(); $relType2 = 5; // lets just assume built in ones aren't being messed with! @@ -991,7 +991,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { * We should get 1 result without or with correct relationship type id & 0 with * an incorrect one */ - function testGetRelationshipByMembershipTypeDAO() { + public function testGetRelationshipByMembershipTypeDAO() { $created = $this->callAPISuccess($this->_entity, 'create', $this->_params); $org3 = $this->organizationCreate(); @@ -1043,7 +1043,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { * We should get 1 result without or with correct relationship type id & 0 with * an incorrect one */ - function testGetRelationshipByMembershipTypeReciprocal() { + public function testGetRelationshipByMembershipTypeReciprocal() { $created = $this->callAPISuccess($this->_entity, 'create', $this->_params); $org3 = $this->organizationCreate(); @@ -1092,7 +1092,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * Check for enotices on enable & disable as reported in CRM-14350 */ - function testSetActive() { + public function testSetActive() { $relationship = $this->callAPISuccess($this->_entity, 'create', $this->_params); $this->callAPISuccess($this->_entity, 'create', array('id' => $relationship['id'], 'is_active' => 0)); $this->callAPISuccess($this->_entity, 'create', array('id' => $relationship['id'], 'is_active' => 1)); diff --git a/tests/phpunit/api/v3/RelationshipTypeTest.php b/tests/phpunit/api/v3/RelationshipTypeTest.php index 9e8e39522a..01fbd0402f 100644 --- a/tests/phpunit/api/v3/RelationshipTypeTest.php +++ b/tests/phpunit/api/v3/RelationshipTypeTest.php @@ -64,14 +64,14 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase { protected $_relTypeID; protected $_apiversion = 3; - function setUp() { + public function setUp() { parent::setUp(); $this->_cId_a = $this->individualCreate(); $this->_cId_b = $this->organizationCreate(); } - function tearDown() { + public function tearDown() { $tablesToTruncate = array( 'civicrm_contact', @@ -85,7 +85,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase { /** * Check with no name */ - function testRelationshipTypeCreateWithoutName() { + public function testRelationshipTypeCreateWithoutName() { $relTypeParams = array( 'contact_type_a' => 'Individual', 'contact_type_b' => 'Organization', @@ -98,7 +98,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase { /** * Check with no contact type */ - function testRelationshipTypeCreateWithoutContactType() { + public function testRelationshipTypeCreateWithoutContactType() { $relTypeParams = array( 'name_a_b' => 'Relation 1 without contact type', 'name_b_a' => 'Relation 2 without contact type', @@ -111,7 +111,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase { /** * Create relationship type */ - function testRelationshipTypeCreate() { + public function testRelationshipTypeCreate() { $params = array( 'name_a_b' => 'Relation 1 for relationship type create', 'name_b_a' => 'Relation 2 for relationship type create', @@ -131,7 +131,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase { /** * Test using example code */ - function testRelationshipTypeCreateExample() { + public function testRelationshipTypeCreateExample() { require_once 'api/v3/examples/RelationshipType/Create.php'; $result = relationship_type_create_example(); $expectedResult = relationship_type_create_expectedresult(); @@ -141,7 +141,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase { /** * Check if required fields are not passed */ - function testRelationshipTypeDeleteWithoutRequired() { + public function testRelationshipTypeDeleteWithoutRequired() { $params = array( 'name_b_a' => 'Relation 2 delete without required', 'contact_type_b' => 'Individual', @@ -156,7 +156,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase { /** * Check with incorrect required fields */ - function testRelationshipTypeDeleteWithIncorrectData() { + public function testRelationshipTypeDeleteWithIncorrectData() { $params = array( 'id' => 'abcd', 'name_b_a' => 'Relation 2 delete with incorrect', @@ -174,7 +174,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase { /** * Check relationship type delete */ - function testRelationshipTypeDelete() { + public function testRelationshipTypeDelete() { $id = $this->_relationshipTypeCreate(); // create sample relationship type. $params = array( @@ -189,7 +189,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase { /** * Check with empty array */ - function testRelationshipTypeUpdateEmpty() { + public function testRelationshipTypeUpdateEmpty() { $params = array(); $result = $this->callAPIFailure('relationship_type', 'create', $params); $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: name_a_b, name_b_a, contact_type_a, contact_type_b'); @@ -198,7 +198,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase { /** * Check with no contact type */ - function testRelationshipTypeUpdateWithoutContactType() { + public function testRelationshipTypeUpdateWithoutContactType() { // create sample relationship type. $this->_relTypeID = $this->_relationshipTypeCreate(); @@ -220,7 +220,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase { /** * Check with all parameters */ - function testRelationshipTypeUpdate() { + public function testRelationshipTypeUpdate() { // create sample relationship type. $this->_relTypeID = $this->_relationshipTypeCreate(); @@ -247,7 +247,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase { /** * Check with empty array */ - function testRelationshipTypesGetEmptyParams() { + public function testRelationshipTypesGetEmptyParams() { $firstRelTypeParams = array( 'name_a_b' => 'Relation 27 for create', 'name_b_a' => 'Relation 28 for create', @@ -278,7 +278,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase { /** * Check with params Not Array. */ - function testRelationshipTypesGetParamsNotArray() { + public function testRelationshipTypesGetParamsNotArray() { $results = $this->callAPIFailure('relationship_type', 'get', 'string'); } @@ -286,7 +286,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase { /** * Check with valid params array. */ - function testRelationshipTypesGet() { + public function testRelationshipTypesGet() { $firstRelTypeParams = array( 'name_a_b' => 'Relation 30 for create', 'name_b_a' => 'Relation 31 for create', @@ -324,7 +324,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase { /** * Create relationship type. */ - function _relationshipTypeCreate($params = NULL) { + public function _relationshipTypeCreate($params = NULL) { if (!is_array($params) || empty($params)) { $params = array( 'name_a_b' => 'Relation 1 for create', diff --git a/tests/phpunit/api/v3/ReportTemplateTest.php b/tests/phpunit/api/v3/ReportTemplateTest.php index 3ae81b8e87..fc739265ca 100644 --- a/tests/phpunit/api/v3/ReportTemplateTest.php +++ b/tests/phpunit/api/v3/ReportTemplateTest.php @@ -38,7 +38,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; class api_v3_ReportTemplateTest extends CiviUnitTestCase { protected $_apiversion = 3; - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(TRUE); } @@ -111,7 +111,7 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase { /** * */ - function testReportTemplateGetRowsContactSummary() { + public function testReportTemplateGetRowsContactSummary() { $description = "Retrieve rows from a report template (optionally providing the instance_id)"; $result = $this->callAPIAndDocument('report_template', 'getrows', array( 'report_id' => 'contact/summary', @@ -135,7 +135,7 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase { /** * @dataProvider getReportTemplates */ - function testReportTemplateGetRowsAllReports($reportID) { + public function testReportTemplateGetRowsAllReports($reportID) { if(stristr($reportID, 'has existing issues')) { $this->markTestIncomplete($reportID); } @@ -147,7 +147,7 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase { /** * @dataProvider getReportTemplates */ - function testReportTemplateGetStatisticsAllReports($reportID) { + public function testReportTemplateGetStatisticsAllReports($reportID) { if(stristr($reportID, 'has existing issues')) { $this->markTestIncomplete($reportID); } diff --git a/tests/phpunit/api/v3/SettingTest.php b/tests/phpunit/api/v3/SettingTest.php index 0d50c502a5..e25b989f01 100644 --- a/tests/phpunit/api/v3/SettingTest.php +++ b/tests/phpunit/api/v3/SettingTest.php @@ -48,7 +48,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { protected $_domainID2; protected $_domainID3; - function setUp() { + public function setUp() { parent::setUp(); $params = array( 'name' => 'Default Domain Name', @@ -74,7 +74,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { $this->hookClass = CRM_Utils_Hook::singleton(); } - function tearDown() { + public function tearDown() { CRM_Utils_Hook::singleton()->reset(); parent::tearDown(); $this->callAPISuccess('system','flush', array()); @@ -85,7 +85,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { * Set additional settings into metadata (implements hook) * @param array $metaDataFolders */ - function setExtensionMetadata(&$metaDataFolders) { + public function setExtensionMetadata(&$metaDataFolders) { global $civicrm_root; $metaDataFolders[] = $civicrm_root . '/tests/phpunit/api/v3/settings'; } @@ -93,7 +93,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { /** * Check getfields works */ - function testGetFields() { + public function testGetFields() { $description = 'Demonstrate return from getfields - see subfolder for variants'; $result = $this->callAPIAndDocument('setting', 'getfields', array(), __FUNCTION__, __FILE__, $description); $this->assertArrayHasKey('customCSSURL', $result['values']); @@ -107,7 +107,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { /** * Let's check it's loading from cache by meddling with the cache */ - function testGetFieldsCaching() { + public function testGetFieldsCaching() { $settingsMetadata = array(); CRM_Core_BAO_Cache::setItem($settingsMetadata,'CiviCRM setting Specs', 'settingsMetadata__'); CRM_Core_BAO_Cache::setItem($settingsMetadata,'CiviCRM setting Spec', 'All'); @@ -116,7 +116,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { $this->quickCleanup(array('civicrm_cache')); } - function testGetFieldsFilters() { + public function testGetFieldsFilters() { $params = array('name' => 'advanced_search_options'); $result = $this->callAPISuccess('setting', 'getfields', $params); $this->assertArrayNotHasKey('customCSSURL', $result['values']); @@ -126,7 +126,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { /** * Test that getfields will filter on group */ - function testGetFieldsGroupFilters() { + public function testGetFieldsGroupFilters() { $params = array('filters' => array('group' => 'multisite')); $result = $this->callAPISuccess('setting', 'getfields', $params); $this->assertArrayNotHasKey('customCSSURL', $result['values']); @@ -136,7 +136,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { /** * Test that getfields will filter on another field (prefetch) */ - function testGetFieldsPrefetchFilters() { + public function testGetFieldsPrefetchFilters() { $params = array('filters' => array('prefetch' => 1)); $result = $this->callAPISuccess('setting', 'getfields', $params); $this->assertArrayNotHasKey('disable_mandatory_tokens_check', $result['values']); @@ -150,7 +150,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { * are very similar, but they exercise different codepaths. The first uses the API * and setItems [plural]; the second uses setItem [singular]. */ - function testOnChange() { + public function testOnChange() { global $_testOnChange_hookCalls; $this->setMockSettingsMetaData(array( 'onChangeExample' => array( @@ -200,7 +200,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { * @param $newValue * @param $metadata */ - static function _testOnChange_onChangeExample($oldValue, $newValue, $metadata) { + public static function _testOnChange_onChangeExample($oldValue, $newValue, $metadata) { global $_testOnChange_hookCalls; $_testOnChange_hookCalls['count']++; $_testOnChange_hookCalls['oldValue'] = $oldValue; @@ -211,7 +211,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { /** * Check getfields works */ - function testCreateSetting() { + public function testCreateSetting() { $description = "shows setting a variable for a given domain - if no domain is set current is assumed"; $params = array( @@ -229,7 +229,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { /** * Check getfields works */ - function testCreateInvalidSettings() { + public function testCreateInvalidSettings() { $params = array( 'domain_id' => $this->_domainID2, 'invalid_key' => 1, @@ -240,7 +240,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { /** * Check invalid settings rejected - */ - function testCreateInvalidURLSettings() { + public function testCreateInvalidURLSettings() { $params = array( 'domain_id' => $this->_domainID2, 'userFrameworkResourceURL' => 'dfhkdhfd', @@ -256,7 +256,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { /** * Check getfields works */ - function testCreateInvalidBooleanSettings() { + public function testCreateInvalidBooleanSettings() { $params = array( 'domain_id' => $this->_domainID2, 'track_civimail_replies' => 'dfhkdhfd', @@ -290,7 +290,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { /** * Check getfields works */ - function testCreateSettingMultipleDomains() { + public function testCreateSettingMultipleDomains() { $description = "shows setting a variable for all domains"; $params = array( @@ -336,7 +336,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { } - function testGetSetting() { + public function testGetSetting() { $params = array( 'domain_id' => $this->_domainID2, 'return' => 'uniq_email_per_site', @@ -356,7 +356,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { /** * Check that setting defined in extension can be retrieved */ - function testGetExtensionSetting() { + public function testGetExtensionSetting() { $this->hookClass->setHook('civicrm_alterSettingsFolders', array($this, 'setExtensionMetadata')); $data = NULL; // the caching of data to all duplicates the caching of data to the empty string @@ -372,7 +372,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { /** * Setting api should set & fetch settings stored in config as well as those in settings table */ - function testSetConfigSetting() { + public function testSetConfigSetting() { $config = CRM_Core_Config::singleton(); $this->assertFalse($config->debug == 1); $params = array( @@ -394,7 +394,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { /** * Setting api should set & fetch settings stored in config as well as those in settings table */ - function testGetConfigSetting() { + public function testGetConfigSetting() { $settings = $this->callAPISuccess('setting', 'get', array( 'name' => 'defaultCurrency', 'sequential' => 1,) ); @@ -404,7 +404,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { /** * Setting api should set & fetch settings stored in config as well as those in settings table */ - function testGetSetConfigSettingMultipleDomains() { + public function testGetSetConfigSettingMultipleDomains() { $settings = $this->callAPISuccess('setting', 'create', array( 'defaultCurrency' => 'USD', 'domain_id' => $this->_currentDomain) ); @@ -424,7 +424,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { /** * Use getValue against a config setting */ - function testGetValueConfigSetting() { + public function testGetValueConfigSetting() { $params = array( 'name' => 'monetaryThousandSeparator', 'group' => 'Localization Setting', ); @@ -432,7 +432,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { $this->assertEquals(',', $result); } - function testGetValue() { + public function testGetValue() { $params = array( 'name' => 'petition_contacts', 'group' => 'Campaign Preferences' ); @@ -442,7 +442,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { $this->assertEquals('Petition Contacts', $result); } - function testGetDefaults() { + public function testGetDefaults() { $description = "gets defaults setting a variable for a given domain - if no domain is set current is assumed"; $params = array( @@ -459,7 +459,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { /** * Function tests reverting a specific parameter */ - function testRevert() { + public function testRevert() { $params = array( 'address_format' => 'xyz', 'mailing_format' => 'bcs', ); @@ -485,7 +485,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { /** * Tests reverting ALL parameters (specific domain) */ - function testRevertAll() { + public function testRevertAll() { $params = array( 'address_format' => 'xyz', 'mailing_format' => 'bcs', ); @@ -505,7 +505,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { /** * Tests filling missing params */ - function testFill() { + public function testFill() { $domparams = array( 'name' => 'B Team Domain', ); diff --git a/tests/phpunit/api/v3/SurveyRespondantTest.php b/tests/phpunit/api/v3/SurveyRespondantTest.php index 4367ab0c74..0e0c229e80 100644 --- a/tests/phpunit/api/v3/SurveyRespondantTest.php +++ b/tests/phpunit/api/v3/SurveyRespondantTest.php @@ -35,7 +35,7 @@ class api_v3_SurveyRespondantTest extends CiviUnitTestCase { protected $params; - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(TRUE); $phoneBankActivity = $this->callAPISuccess('Option_value', 'Get', array('label' => 'PhoneBank', 'sequential' => 1)); diff --git a/tests/phpunit/api/v3/SurveyTest.php b/tests/phpunit/api/v3/SurveyTest.php index 5f4312c14c..7ca33e466b 100644 --- a/tests/phpunit/api/v3/SurveyTest.php +++ b/tests/phpunit/api/v3/SurveyTest.php @@ -54,7 +54,7 @@ class api_v3_SurveyTest extends CiviUnitTestCase { public $DBResetRequired = FALSE; - function setUp() { + public function setUp() { $phoneBankActivityTypeID = $this->callAPISuccessGetValue('Option_value', array('label' => 'PhoneBank', 'return' => 'value'), 'integer'); $this->useTransaction(); $this->enableCiviCampaign(); diff --git a/tests/phpunit/api/v3/SyntaxConformanceTest.php b/tests/phpunit/api/v3/SyntaxConformanceTest.php index 73510f2518..de12d1e0d4 100644 --- a/tests/phpunit/api/v3/SyntaxConformanceTest.php +++ b/tests/phpunit/api/v3/SyntaxConformanceTest.php @@ -79,7 +79,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { and that will never exist (eg an obsoleted Entity they need to be returned by the function toBeSkipped_{$action} (because it has to be a static method and therefore couldn't access a this->toBeSkipped) */ - function setUp() { + public function setUp() { parent::setUp(); $this->enableCiviCampaign(); $this->toBeImplemented['get'] = array('Profile', 'CustomValue', 'Constant', 'CustomSearch', 'Extension', 'ReportTemplate', 'System', 'Setting'); @@ -90,7 +90,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { $this->deletableTestObjects = array(); } - function tearDown() { + public function tearDown() { foreach ($this->deletableTestObjects as $entityName => $entities) { foreach ($entities as $entityID) { CRM_Core_DAO::deleteTestObjects($entityName, array('id' => $entityID)); @@ -685,7 +685,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { * @param string $entityName * */ - function testLimit($entityName) { + public function testLimit($entityName) { $cases = array(); // each case is array(0 => $inputtedApiOptions, 1 => $expectedResultCount) $cases[] = array( array('options' => array('limit' => NULL)), @@ -751,7 +751,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { * @param string $entityName * */ - function testSqlOperators($entityName) { + public function testSqlOperators($entityName) { $baoString = _civicrm_api3_get_BAO($entityName); if (empty($baoString)) { $this->markTestIncomplete("Entity [$entityName] cannot be mocked - no known DAO"); @@ -784,7 +784,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { * @param integer $limit * @param string $message */ - function checkLimitAgainstExpected($entityName, $params, $limit, $message) { + public function checkLimitAgainstExpected($entityName, $params, $limit, $message) { $result = $this->callAPISuccess($entityName, 'get', $params); if($limit == 30) { $this->assertGreaterThanOrEqual($limit, $result['count'], $message); diff --git a/tests/phpunit/api/v3/SystemTest.php b/tests/phpunit/api/v3/SystemTest.php index 1de297cb10..82e8f666f2 100644 --- a/tests/phpunit/api/v3/SystemTest.php +++ b/tests/phpunit/api/v3/SystemTest.php @@ -74,7 +74,7 @@ class api_v3_SystemTest extends CiviUnitTestCase { /** * Test system log function */ - function testSystemLog() { + public function testSystemLog() { $this->callAPISuccess('system', 'log', array('level' => 'info', 'message' => 'We wish you a merry Christmas')); $result = $this->callAPISuccess('SystemLog', 'getsingle', array( 'sequential' => 1, @@ -87,7 +87,7 @@ class api_v3_SystemTest extends CiviUnitTestCase { /** * Test system log function */ - function testSystemLogNoLevel() { + public function testSystemLogNoLevel() { $this->callAPISuccess('system', 'log', array('message' => 'We wish you a merry Christmas', 'level' => 'alert')); $result = $this->callAPISuccess('SystemLog', 'getsingle', array( 'sequential' => 1, @@ -97,7 +97,7 @@ class api_v3_SystemTest extends CiviUnitTestCase { $this->assertEquals($result['level'], 'alert'); } - function testSystemGet() { + public function testSystemGet() { $result = $this->callAPISuccess('system', 'get', array()); $this->assertRegExp('/^[0-9]+\.[0-9]+\.[0-9a-z\-]+$/', $result['values'][0]['version']); $this->assertEquals('UnitTests', $result['values'][0]['uf']); diff --git a/tests/phpunit/api/v3/TagTest.php b/tests/phpunit/api/v3/TagTest.php index cc6f59b1ce..5c4485e173 100644 --- a/tests/phpunit/api/v3/TagTest.php +++ b/tests/phpunit/api/v3/TagTest.php @@ -49,7 +49,7 @@ class api_v3_TagTest extends CiviUnitTestCase { protected $tagID; - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(TRUE); $this->tag = $this->tagCreate(); @@ -101,14 +101,14 @@ class api_v3_TagTest extends CiviUnitTestCase { /** * Test civicrm_tag_create with empty params. */ - function testCreateEmptyParams() { + public function testCreateEmptyParams() { $result = $this->callAPIFailure('tag', 'create', array(),'Mandatory key(s) missing from params array: name'); } /** * Test civicrm_tag_create */ - function testCreatePasstagInParams() { + public function testCreatePasstagInParams() { $params = array( 'tag' => 10, 'name' => 'New Tag23', @@ -121,7 +121,7 @@ class api_v3_TagTest extends CiviUnitTestCase { /** * Test civicrm_tag_create - success expected. */ - function testCreate() { + public function testCreate() { $params = array( 'name' => 'Super Heros', 'description' => 'Outside undie-wearers', @@ -136,7 +136,7 @@ class api_v3_TagTest extends CiviUnitTestCase { * Test civicrm_tag_create activity tag- success expected. Test checks that used_for is set * and not over-written by default on update */ - function testCreateEntitySpecificTag() { + public function testCreateEntitySpecificTag() { $params = array( 'name' => 'New Tag4', 'description' => 'This is description for New Activity tag', @@ -156,14 +156,14 @@ class api_v3_TagTest extends CiviUnitTestCase { /** * Test civicrm_tag_delete without tag id. */ - function testDeleteWithoutTagId() { + public function testDeleteWithoutTagId() { $result = $this->callAPIFailure('tag', 'delete', array(), 'Mandatory key(s) missing from params array: id'); } /** * Test civicrm_tag_delete . */ - function testTagDeleteOldSyntax() { + public function testTagDeleteOldSyntax() { $params = array( 'tag_id' => $this->tagID, ); @@ -174,7 +174,7 @@ class api_v3_TagTest extends CiviUnitTestCase { /** * Test civicrm_tag_delete = $params['id'] is correct */ - function testTagDeleteCorrectSyntax() { + public function testTagDeleteCorrectSyntax() { $params = array( 'id' => $this->tagID, ); @@ -182,14 +182,14 @@ class api_v3_TagTest extends CiviUnitTestCase { unset($this->ids['tag']); } - function testTagGetfields() { + public function testTagGetfields() { $description = "demonstrate use of getfields to interrogate api"; $params = array('action' => 'create'); $result = $this->callAPIAndDocument('tag', 'getfields', $params, __FUNCTION__, __FILE__, $description, NULL, 'getfields'); $this->assertEquals('civicrm_contact', $result['values']['used_for']['api.default']); } - function testTagGetList() { + public function testTagGetList() { $description = "Demonstrates use of api.getlist for autocomplete and quicksearch applications"; $params = array( 'input' => $this->tag['name'], diff --git a/tests/phpunit/api/v3/TaxContributionPageTest.php b/tests/phpunit/api/v3/TaxContributionPageTest.php index e55b8fd32e..5e282b402f 100644 --- a/tests/phpunit/api/v3/TaxContributionPageTest.php +++ b/tests/phpunit/api/v3/TaxContributionPageTest.php @@ -180,7 +180,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { $this->assertAPISuccess($result); } - function tearDown() { + public function tearDown() { $this->quickCleanup(array( 'civicrm_contribution', 'civicrm_contribution_soft', @@ -200,7 +200,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { CRM_Core_PseudoConstant::flush('taxRates'); } - function setUpContributionPage() { + public function setUpContributionPage() { $contributionPageResult = $this->callAPISuccess($this->_entity, 'create', $this->params); if (empty($this->_ids['price_set'])) { $priceSet = $this->callAPISuccess('price_set', 'create', $this->_priceSetParams); @@ -240,7 +240,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { /** * Online and offline contrbution from above created contrbution page */ - function testCreateContributionOnline() { + public function testCreateContributionOnline() { $this->setUpContributionPage(); $params = array( 'contact_id' => $this->_individualId, @@ -268,7 +268,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { $this->_checkFinancialRecords($contribution, 'online'); } - function testCreateContributionChainedLineItems() { + public function testCreateContributionChainedLineItems() { $this->setUpContributionPage(); $params = array( 'contact_id' => $this->_individualId, @@ -311,7 +311,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { $this->assertEquals(2, $lineItems['count']); } - function testCreateContributionPayLaterOnline() { + public function testCreateContributionPayLaterOnline() { $this->setUpContributionPage(); $params = array( 'contact_id' => $this->_individualId, @@ -336,7 +336,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { $this->assertEquals($contribution['values'][$contribution['id']]['contribution_status_id'], 2, 'In line ' . __LINE__); $this->_checkFinancialRecords($contribution, 'payLater'); } - function testCreateContributionPendingOnline() { + public function testCreateContributionPendingOnline() { $this->setUpContributionPage(); $params = array( 'contact_id' => $this->_individualId, @@ -366,7 +366,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { * Updation of contrbution * Function tests that line items, financial records are updated when contribution amount is changed */ - function testCreateUpdateContributionChangeTotal() { + public function testCreateUpdateContributionChangeTotal() { $this->setUpContributionPage(); $this->contributionParams = array( 'contact_id' => $this->_individualId, @@ -412,7 +412,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { * * @return null|string */ - function _getFinancialTrxnAmount($contId) { + public function _getFinancialTrxnAmount($contId) { $query = "SELECT SUM( ft.total_amount ) AS total FROM civicrm_financial_trxn AS ft @@ -428,7 +428,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { * * @return null|string */ - function _getFinancialItemAmount($contId) { + public function _getFinancialItemAmount($contId) { $lineItem = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution')); $query = "SELECT SUM(amount) @@ -443,7 +443,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { * @param array $params * @param $context */ - function _checkFinancialRecords($params, $context) { + public function _checkFinancialRecords($params, $context) { $entityParams = array( 'entity_id' => $params['id'], 'entity_table' => 'civicrm_contribution', @@ -506,7 +506,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { * @param array $params * @param int $financialTypeId */ - function _getFinancialAccountId($financialTypeId) { + public function _getFinancialAccountId($financialTypeId) { $accountRel = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Income Account is' ")); $searchParams = array( @@ -521,7 +521,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { } ///////////////// civicrm_contribution_delete methods - function testDeleteContribution() { + public function testDeleteContribution() { $contributionID = $this->contributionCreate($this->_individualId, $this->financialtypeID, 'dfsdf', 12389); $params = array( 'id' => $contributionID, diff --git a/tests/phpunit/api/v3/UFFieldTest.php b/tests/phpunit/api/v3/UFFieldTest.php index 6f713e03e2..31f85c8252 100644 --- a/tests/phpunit/api/v3/UFFieldTest.php +++ b/tests/phpunit/api/v3/UFFieldTest.php @@ -79,7 +79,7 @@ class api_v3_UFFieldTest extends CiviUnitTestCase { ); } - function tearDown() { + public function tearDown() { $this->quickCleanup( array( 'civicrm_group', @@ -110,7 +110,7 @@ class api_v3_UFFieldTest extends CiviUnitTestCase { $this->callAPIFailure('uf_field', 'create', $params); } - function testCreateUFFieldWithWrongParams() { + public function testCreateUFFieldWithWrongParams() { $this->callAPIFailure('uf_field', 'create', array('field_name' => 'test field')); $this->callAPIFailure('uf_field', 'create', array('label' => 'name-less field')); } diff --git a/tests/phpunit/api/v3/UFGroupTest.php b/tests/phpunit/api/v3/UFGroupTest.php index 5f3df85592..cfa2d3e6b9 100644 --- a/tests/phpunit/api/v3/UFGroupTest.php +++ b/tests/phpunit/api/v3/UFGroupTest.php @@ -83,7 +83,7 @@ class api_v3_UFGroupTest extends CiviUnitTestCase { ); } - function tearDown() { + public function tearDown() { // Truncate the tables $this->quickCleanup( array( @@ -113,7 +113,7 @@ class api_v3_UFGroupTest extends CiviUnitTestCase { } } - function testUFGroupCreate() { + public function testUFGroupCreate() { $result = $this->callAPIAndDocument('uf_group', 'create', $this->params, __FUNCTION__, __FILE__); $this->assertAPISuccess($result); @@ -134,11 +134,11 @@ class api_v3_UFGroupTest extends CiviUnitTestCase { } } - function testUFGroupCreateWithWrongParams() { + public function testUFGroupCreateWithWrongParams() { $result = $this->callAPIFailure('uf_group', 'create', array('name' => 'A title-less group')); } - function testUFGroupUpdate() { + public function testUFGroupUpdate() { $params = array( 'id' => $this->_ufGroupId, 'add_captcha' => 1, @@ -174,7 +174,7 @@ class api_v3_UFGroupTest extends CiviUnitTestCase { $this->assertEquals($result['values'][$result['id']]['limit_listings_group_id'], $params['group'], 'in line ' . __LINE__); } - function testUFGroupGet() { + public function testUFGroupGet() { $result = $this->callAPISuccess('uf_group', 'create', $this->params); $params = array('id' => $result['id']); $result = $this->callAPIAndDocument('uf_group', 'get', $params, __FUNCTION__, __FILE__); @@ -195,11 +195,11 @@ class api_v3_UFGroupTest extends CiviUnitTestCase { } } - function testUFGroupUpdateWithEmptyParams() { + public function testUFGroupUpdateWithEmptyParams() { $result = $this->callAPIFailure('uf_group', 'create', array(), $this->_ufGroupId); } - function testUFGroupDelete() { + public function testUFGroupDelete() { $ufGroup = $this->callAPISuccess('uf_group', 'create', $this->params); $params = array('id' => $ufGroup['id']); $this->assertEquals(1, $this->callAPISuccess('uf_group', 'getcount', $params), "in line " . __LINE__); diff --git a/tests/phpunit/api/v3/UFJoinTest.php b/tests/phpunit/api/v3/UFJoinTest.php index 66c8339d02..04b4cb5fc0 100644 --- a/tests/phpunit/api/v3/UFJoinTest.php +++ b/tests/phpunit/api/v3/UFJoinTest.php @@ -63,7 +63,7 @@ class api_v3_UFJoinTest extends CiviUnitTestCase { ); } - function tearDown() { + public function tearDown() { // Truncate the tables $this->quickCleanup( array( @@ -206,7 +206,7 @@ class api_v3_UFJoinTest extends CiviUnitTestCase { /** * Test civicrm_activity_create() using example code */ - function testUFJoinCreateExample() { + public function testUFJoinCreateExample() { require_once 'api/v3/examples/UFJoin/Create.php'; $result = UF_join_create_example(); $expectedResult = UF_join_create_expectedresult(); diff --git a/tests/phpunit/api/v3/UFMatchTest.php b/tests/phpunit/api/v3/UFMatchTest.php index e70c2dd2c6..de55c9e644 100644 --- a/tests/phpunit/api/v3/UFMatchTest.php +++ b/tests/phpunit/api/v3/UFMatchTest.php @@ -73,7 +73,7 @@ class api_v3_UFMatchTest extends CiviUnitTestCase { ); } - function tearDown() { + public function tearDown() { // Truncate the tables $this->quickCleanup( array( @@ -97,7 +97,7 @@ class api_v3_UFMatchTest extends CiviUnitTestCase { $this->assertEquals($result['values'][$result['id']]['contact_id'], 69); } - function testGetUFMatchIDWrongParam() { + public function testGetUFMatchIDWrongParam() { $params = 'a string'; $result = $this->callAPIFailure('uf_match', 'get', $params); } @@ -113,7 +113,7 @@ class api_v3_UFMatchTest extends CiviUnitTestCase { $this->assertEquals($result['values'][$result['id']]['uf_id'], 42); } - function testGetUFIDWrongParam() { + public function testGetUFIDWrongParam() { $params = 'a string'; $result = $this->callAPIFailure('uf_match', 'get', $params); } @@ -121,19 +121,19 @@ class api_v3_UFMatchTest extends CiviUnitTestCase { /** * Test civicrm_activity_create() using example code */ - function testUFMatchGetExample() { + public function testUFMatchGetExample() { require_once 'api/v3/examples/UFMatch/Get.php'; $result = UF_match_get_example(); $expectedResult = UF_match_get_expectedresult(); $this->assertEquals($result, $expectedResult); } - function testCreate() { + public function testCreate() { $result = $this->callAPISuccess('uf_match', 'create', $this->_params); $this->getAndCheck($this->_params, $result['id'], 'uf_match'); } - function testDelete() { + public function testDelete() { $result = $this->callAPISuccess('uf_match', 'create', $this->_params); $this->assertEquals(1, $this->callAPISuccess('uf_match', 'getcount', array( 'id' => $result['id'], ))); diff --git a/tests/phpunit/api/v3/UtilsTest.php b/tests/phpunit/api/v3/UtilsTest.php index db2f9f8c7f..150f234c2b 100644 --- a/tests/phpunit/api/v3/UtilsTest.php +++ b/tests/phpunit/api/v3/UtilsTest.php @@ -50,14 +50,14 @@ class api_v3_UtilsTest extends CiviUnitTestCase { $this->useTransaction(TRUE); } - function testAddFormattedParam() { + public function testAddFormattedParam() { $values = array('contact_type' => 'Individual'); $params = array('something' => 1); $result = _civicrm_api3_deprecated_add_formatted_param($values, $params); $this->assertTrue($result); } - function testCheckPermissionReturn() { + public function testCheckPermissionReturn() { $check = array('check_permissions' => TRUE); $config = CRM_Core_Config::singleton(); $config->userPermissionClass->permissions = array(); @@ -74,7 +74,7 @@ class api_v3_UtilsTest extends CiviUnitTestCase { $this->assertTrue($this->runPermissionCheck('contact', 'create', $check), 'overfluous permissions should be enough'); } - function testCheckPermissionThrow() { + public function testCheckPermissionThrow() { $check = array('check_permissions' => TRUE); $config = CRM_Core_Config::singleton(); try { @@ -90,7 +90,7 @@ class api_v3_UtilsTest extends CiviUnitTestCase { $this->assertTrue($this->runPermissionCheck('contact', 'create', $check), 'overfluous permissions should return true'); } - function testCheckPermissionSkip() { + public function testCheckPermissionSkip() { $config = CRM_Core_Config::singleton(); $config->userPermissionClass->permissions = array('access CiviCRM'); $params = array('check_permissions' => TRUE); @@ -109,7 +109,7 @@ class api_v3_UtilsTest extends CiviUnitTestCase { * @throws Exception * @return bool TRUE or FALSE depending on the outcome of the authorization check */ - function runPermissionCheck($entity, $action, $params, $throws = FALSE) { + public function runPermissionCheck($entity, $action, $params, $throws = FALSE) { $dispatcher = new \Symfony\Component\EventDispatcher\EventDispatcher(); $dispatcher->addSubscriber(new \Civi\API\Subscriber\PermissionCheck()); $kernel = new \Civi\API\Kernel($dispatcher); @@ -130,7 +130,7 @@ class api_v3_UtilsTest extends CiviUnitTestCase { /** * Test verify mandatory - includes DAO & passed as well as empty & NULL fields */ - function testVerifyMandatory() { + public function testVerifyMandatory() { _civicrm_api3_initialize(TRUE); $params = array( 'entity_table' => 'civicrm_contact', @@ -154,7 +154,7 @@ class api_v3_UtilsTest extends CiviUnitTestCase { /** * Test verify one mandatory - includes DAO & passed as well as empty & NULL fields */ - function testVerifyOneMandatory() { + public function testVerifyOneMandatory() { _civicrm_api3_initialize(TRUE); $params = array( 'entity_table' => 'civicrm_contact', @@ -179,7 +179,7 @@ class api_v3_UtilsTest extends CiviUnitTestCase { /** * Test verify one mandatory - includes DAO & passed as well as empty & NULL fields */ - function testVerifyOneMandatoryOneSet() { + public function testVerifyOneMandatoryOneSet() { _civicrm_api3_initialize(TRUE); $params = array('version' => 3, 'entity_table' => 'civicrm_contact', 'note' => 'note', 'contact_id' => $this->_contactID, 'modified_date' => '2011-01-31', 'subject' => NULL); @@ -195,7 +195,7 @@ class api_v3_UtilsTest extends CiviUnitTestCase { /** * Test GET DAO function returns DAO */ - function testGetDAO() { + public function testGetDAO() { $params = array( 'civicrm_api3_custom_group_get' => 'CRM_Core_DAO_CustomGroup', 'custom_group' => 'CRM_Core_DAO_CustomGroup', @@ -215,7 +215,7 @@ class api_v3_UtilsTest extends CiviUnitTestCase { /** * Test GET BAO function returns BAO when it exists */ - function testGetBAO() { + public function testGetBAO() { $params = array( 'civicrm_api3_website_get' => 'CRM_Core_BAO_Website', 'civicrm_api3_survey_get' => 'CRM_Campaign_BAO_Survey', @@ -232,7 +232,7 @@ class api_v3_UtilsTest extends CiviUnitTestCase { } } - function test_civicrm_api3_validate_fields() { + public function test_civicrm_api3_validate_fields() { $params = array('start_date' => '2010-12-20', 'end_date' => ''); $fields = civicrm_api3('relationship', 'getfields', array('action' => 'get')); _civicrm_api3_validate_fields('relationship', 'get', $params, $fields['values']); @@ -240,7 +240,7 @@ class api_v3_UtilsTest extends CiviUnitTestCase { $this->assertEquals('', $params['end_date']); } - function test_civicrm_api3_validate_fields_membership() { + public function test_civicrm_api3_validate_fields_membership() { $params = array('start_date' => '2010-12-20', 'end_date' => '', 'membership_end_date' => '0', 'join_date' => '2010-12-20', 'membership_start_date' => '2010-12-20'); $fields = civicrm_api3('Membership', 'getfields', array('action' => 'get')); _civicrm_api3_validate_fields('Membership', 'get', $params, $fields['values']); @@ -249,7 +249,7 @@ class api_v3_UtilsTest extends CiviUnitTestCase { $this->assertEquals('20101220000000', $params['join_date'], 'join_date not set in line ' . __LINE__); } - function test_civicrm_api3_validate_fields_event() { + public function test_civicrm_api3_validate_fields_event() { $params = array( 'registration_start_date' => 20080601, @@ -263,7 +263,7 @@ class api_v3_UtilsTest extends CiviUnitTestCase { $this->assertEquals('20080601000000', $params['registration_start_date']); } - function test_civicrm_api3_validate_fields_exception() { + public function test_civicrm_api3_validate_fields_exception() { $params = array( 'join_date' => 'abc', ); @@ -276,7 +276,7 @@ class api_v3_UtilsTest extends CiviUnitTestCase { } } - function testGetFields() { + public function testGetFields() { $result = $this->callAPISuccess('membership', 'getfields', array()); $this->assertArrayHasKey('values', $result); $result = $this->callAPISuccess('relationship', 'getfields', array()); @@ -285,7 +285,7 @@ class api_v3_UtilsTest extends CiviUnitTestCase { $this->assertArrayHasKey('values', $result); } - function testGetFields_AllOptions() { + public function testGetFields_AllOptions() { $result = $this->callAPISuccess('contact', 'getfields', array( 'options' => array( 'get_options' => 'all', diff --git a/tests/phpunit/api/v3/WebsiteTest.php b/tests/phpunit/api/v3/WebsiteTest.php index 2ced7ff7ba..8688335a9a 100644 --- a/tests/phpunit/api/v3/WebsiteTest.php +++ b/tests/phpunit/api/v3/WebsiteTest.php @@ -43,7 +43,7 @@ class api_v3_WebsiteTest extends CiviUnitTestCase { public $DBResetRequired = FALSE; - function setUp() { + public function setUp() { parent::setUp(); $this->useTransaction(); -- 2.25.1