Skip to content

Commit

Permalink
Merge pull request #70 from SalesforceFoundation/feature/300-306-npsp…
Browse files Browse the repository at this point in the history
…-to-hedap

Removing "with sharing" from TDTM classes, and bringing in NPSP CON c…
  • Loading branch information
ceiroa committed Oct 12, 2015
2 parents 092d839 + 2874ecc commit 32dd781
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 12 deletions.
15 changes: 15 additions & 0 deletions ApexDocContent/Contacts.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<html>
<body>
<h2>Contacts Classes</h2>
<p>NPSP Contacts functionality is made up of these components:</p>
<ul>
<li>Do Not Contact</li>
</ul>

<p>The classes involved with Do Not Contact include:</p>
<ul>
<li>CON_DoNotContact_TDTM</li>
<li>CON_DoNotContact_TEST</li>
</ul>
</body>
</html>
2 changes: 1 addition & 1 deletion src/classes/ACCT_IndividualAccounts_TDTM.cls
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @group Accounts
* @description Implements Household or Administrative account model - controls syncing within the model
*/
public with sharing class ACCT_IndividualAccounts_TDTM extends TDTM_Runnable {
public class ACCT_IndividualAccounts_TDTM extends TDTM_Runnable {

/*******************************************************************************************************
* @description the current Contact Settings object
Expand Down
2 changes: 1 addition & 1 deletion src/classes/ADDR_Account_TDTM.cls
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @group Address Management
* @description Trigger Handler on Account for Address management
*/
public with sharing class ADDR_Account_TDTM extends TDTM_Runnable {
public class ADDR_Account_TDTM extends TDTM_Runnable {

/*******************************************************************************************************
* @description Trigger Handler on Account that handles Address management.
Expand Down
2 changes: 1 addition & 1 deletion src/classes/ADDR_Contact_TDTM.cls
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @group Address Management
* @description Trigger Handler on Contact for Address management
*/
public with sharing class ADDR_Contact_TDTM extends TDTM_Runnable {
public class ADDR_Contact_TDTM extends TDTM_Runnable {

public static Boolean contactsUpdatedAfterInsert = false;

Expand Down
2 changes: 1 addition & 1 deletion src/classes/AFFL_AccRecordType_TDTM.cls
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @group Affiliations
* @description Supports changing the record type of an account.
*/
public with sharing class AFFL_AccRecordType_TDTM extends TDTM_Runnable {
public class AFFL_AccRecordType_TDTM extends TDTM_Runnable {

/*******************************************************************************************************
* @description Updates key affiliation lookups on contact, and any other primary affiliation of the new type.
Expand Down
2 changes: 1 addition & 1 deletion src/classes/AFFL_MultiRecordType_TDTM.cls
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @group Affiliations
* @description Handles affiliations of different record types, with one primary per type.
*/
public with sharing class AFFL_MultiRecordType_TDTM extends TDTM_Runnable {
public class AFFL_MultiRecordType_TDTM extends TDTM_Runnable {

//Get the primary affiliation fields defined in the Affiliation Mappings
private static AFFL_MultiRecordTypeMapper afflMapper = new AFFL_MultiRecordTypeMapper();
Expand Down
2 changes: 1 addition & 1 deletion src/classes/COFF_Affiliation_TDTM.cls
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @group Program Enrollment
* @description Keeps Course Offering and Affiliation records for a Contact in sync.
*/
public with sharing class COFF_Affiliation_TDTM extends TDTM_Runnable {
public class COFF_Affiliation_TDTM extends TDTM_Runnable {

/*******************************************************************************************************
* @description Handles Affiliation management for Course Offering.
Expand Down
4 changes: 3 additions & 1 deletion src/classes/CON_DoNotContact_TDTM.cls
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
/**
* @author Salesforce.com Foundation
* @date 2015
* @group Contacts
* @group-content ../../ApexDocContent/Contacts.htm
* @description Handles changes to the deceased and do not contact fields on Contact.
*/
public with sharing class CON_DoNotContact_TDTM extends TDTM_Runnable {
public class CON_DoNotContact_TDTM extends TDTM_Runnable {

/*******************************************************************************************************
* @description Handles deceased and do not contact fields.
Expand Down
16 changes: 16 additions & 0 deletions src/classes/CON_DoNotContact_TEST.cls
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,21 @@
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @author Salesforce.com Foundation
* @date 2015
* @group Contacts
* @group-content ../../ApexDocContent/Contacts.htm
* @description Handles changes to the deceased and do not contact fields on Contact.
*/
@isTest
private class CON_DoNotContact_TEST {

/*******************************************************************************************************
* @description Marks a contact as Deceased, verifies DoNotCall, HasOptedOutOfEmail, and naming
* exclusions are set. Removes deceased flag, verifies DoNotCall, HasOptedOutOfEmail, and naming
* exclusion have been removed.
*/
static testMethod void testDeceased() {
UTIL_CustomSettingsFacade.getSettingsForTests(new Hierarchy_Settings__c (Account_Processor__c = CAO_Constants.HH_ACCOUNT_PROCESSOR));

Expand Down Expand Up @@ -61,6 +73,10 @@ private class CON_DoNotContact_TEST {
system.assert(!queryCon[0].HasOptedOutOfEmail, 'Contact should not be opted out of email.');
}

/*******************************************************************************************************
* @description Marks a contact as Do Not Contact, verifies DoNotCall and HasOptedOutOfEmail are set.
* Removes Do Not Contact flag, verifies DoNotCall and HasOptedOutOfEmail are no longer set.
*/
static testMethod void testDoNotContact() {
UTIL_CustomSettingsFacade.getSettingsForTests(new Hierarchy_Settings__c (Account_Processor__c = CAO_Constants.HH_ACCOUNT_PROCESSOR));

Expand Down
2 changes: 1 addition & 1 deletion src/classes/CON_Preferred_TDTM.cls
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @group Contacts
* @description Populates default email and phone fields according to user preferences.
*/
public with sharing class CON_Preferred_TDTM extends TDTM_Runnable {
public class CON_Preferred_TDTM extends TDTM_Runnable {

/*******************************************************************************************************
* @description Updates default email and phone fields based to the preferred email and preferred phone values.
Expand Down
2 changes: 1 addition & 1 deletion src/classes/CON_PrimaryAffls_TDTM.cls
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* @description Creates Affiliations when the user manually populates
* any of the primary affiliation lookup fields.
*/
public with sharing class CON_PrimaryAffls_TDTM extends TDTM_Runnable {
public class CON_PrimaryAffls_TDTM extends TDTM_Runnable {

//Get the primary affiliation fields defined in the Affiliation Mappings
private static AFFL_MultiRecordTypeMapper afflMapper = new AFFL_MultiRecordTypeMapper();
Expand Down
2 changes: 1 addition & 1 deletion src/classes/PREN_Affiliation_TDTM.cls
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @group Program Enrollment
* @description Keeps Program Enrollment and Affiliation records for a Contact in sync.
*/
public with sharing class PREN_Affiliation_TDTM extends TDTM_Runnable {
public class PREN_Affiliation_TDTM extends TDTM_Runnable {

/*******************************************************************************************************
* @description Handles Affiliation management for Program Enrollment.
Expand Down
2 changes: 1 addition & 1 deletion src/classes/REL_Relationships_Cm_TDTM.cls
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @author Salesforce.com Foundation
* @description Implements relationships behavior
*/
public with sharing class REL_Relationships_Cm_TDTM extends TDTM_Runnable {
public class REL_Relationships_Cm_TDTM extends TDTM_Runnable {

public override DmlWrapper run(List<SObject> newList, List<SObject> oldList,
TDTM_Runnable.Action triggerAction, Schema.DescribeSObjectResult objResult) {
Expand Down
2 changes: 1 addition & 1 deletion src/classes/THAN_Filter_TDTM.cls
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @group TDTM
* @description Validates Trigger Handler fields data.
*/
public with sharing class THAN_Filter_TDTM extends TDTM_Runnable {
public class THAN_Filter_TDTM extends TDTM_Runnable {

/*******************************************************************************************************
* @description Validates Trigger Handler fields data.
Expand Down

0 comments on commit 32dd781

Please sign in to comment.