Permalink
Browse files

updating to api v24.0

  • Loading branch information...
1 parent c0b58f3 commit a3a218cbdcc9c9f069f463d8b73f91c5b27a496c @mickle00 committed Apr 3, 2012
View
92 src/classes/CaseTransferController.cls
@@ -1,10 +1,10 @@
public class CaseTransferController{
-
- public Case myCase {get;set;}
- public string transferReason {get;set;}
- public String transferringToCaseTeam {get;set;}
-
- public CaseTransferController(ApexPages.StandardController stdController){
+
+ public Case myCase {get;set;}
+ public string transferReason {get;set;}
+ public String transferringToCaseTeam {get;set;}
+
+ public CaseTransferController(ApexPages.StandardController stdController){
// Get fields without needing to query for them
// Hack to allow tests to run
if (!Test.isRunningTest()) stdController.addFields(this.FIELDNAMES);
@@ -17,21 +17,21 @@ public class CaseTransferController{
public PageReference transferCase(){
this.createTransferredCase(myCase);
- return this.returnToCase();
+ return this.returnToCase();
}
public PageReference closeAndTransferCase(){
this.createTransferredCase(myCase);
//Why doesn't the standard controller have ClosingView() as a method, similar to View()?
- PageReference originalCaseClosePage = new PageReference('/' + myCase.Id + '/s?retURL=' + myCase.Id);
- return originalCaseClosePage;
+ PageReference originalCaseClosePage = new PageReference('/' + myCase.Id + '/s?retURL=' + myCase.Id);
+ return originalCaseClosePage;
}
public List<selectOption> getCaseTeamPicklistOptions() {
List<selectOption> options = new List<selectOption>();
String appendText;
for (Case_Team__c myCaseTeam : getAllCaseTeams()) {
- appendText = myCaseTeam.Email__c == null ? '' : ' (' + myCaseTeam.Email__c + ')';
+ appendText = myCaseTeam.Email__c == null ? '' : ' (' + myCaseTeam.Email__c + ')';
options.add(new selectOption(myCaseTeam.Name, myCaseTeam.Name + appendText));
}
return options;
@@ -42,34 +42,34 @@ public class CaseTransferController{
**/
public Map<String, Id> getCaseTeamToRecordTypeIdMap(){
- if (this.caseTeamToRecordTypeIdMap == null){
- this.caseTeamToRecordTypeIdMap = new Map<String, Id>();
- Map<String, RecordType> caseRecordTypeMap = Utilities.getRecordTypesMap('Case', true);
- for (Case_Team__c myCaseTeam : getAllCaseTeams()){
- if (caseRecordTypeMap.containsKey(myCaseTeam.Record_Type_Developer_Name__c)){
+ if (this.caseTeamToRecordTypeIdMap == null){
+ this.caseTeamToRecordTypeIdMap = new Map<String, Id>();
+ Map<String, RecordType> caseRecordTypeMap = Utilities.getRecordTypesMap('Case', true);
+ for (Case_Team__c myCaseTeam : getAllCaseTeams()){
+ if (caseRecordTypeMap.containsKey(myCaseTeam.Record_Type_Developer_Name__c)){
this.caseTeamToRecordTypeIdMap.put(myCaseTeam.Name, caseRecordTypeMap.get(myCaseTeam.Record_Type_Developer_Name__c).Id);
- }
- }
- }
- return this.caseTeamToRecordTypeIdMap;
+ }
+ }
+ }
+ return this.caseTeamToRecordTypeIdMap;
}
public Map<String, Case_Team__c> getCaseTeamMap(){
- if (this.caseTeamMap == null){
- this.caseTeamMap = new Map<String, Case_Team__c>();
- for (Case_Team__c myCaseTeam : this.getAllCaseTeams()){
- this.caseTeamMap.put(myCaseTeam.Name, myCaseTeam);
- }
- }
- return this.caseTeamMap;
+ if (this.caseTeamMap == null){
+ this.caseTeamMap = new Map<String, Case_Team__c>();
+ for (Case_Team__c myCaseTeam : this.getAllCaseTeams()){
+ this.caseTeamMap.put(myCaseTeam.Name, myCaseTeam);
+ }
+ }
+ return this.caseTeamMap;
}
private List<Case_Team__c> getAllCaseTeams(){
- if (this.allCaseTeams == null){
- this.allCaseTeams = new List<Case_Team__c>();
- this.allCaseTeams = [SELECT Id, Name, Record_Type_Developer_Name__c, Email__c, Team__c FROM Case_Team__c WHERE Active__c = true order by Name ASC];
- }
- return this.allCaseTeams;
+ if (this.allCaseTeams == null){
+ this.allCaseTeams = new List<Case_Team__c>();
+ this.allCaseTeams = [SELECT Id, Name, Record_Type_Developer_Name__c, Email__c, Team__c FROM Case_Team__c WHERE Active__c = true order by Name ASC];
+ }
+ return this.allCaseTeams;
}
private void createTransferredCase(Case parentCase){
@@ -100,7 +100,7 @@ public class CaseTransferController{
insert newCase;
this.createTransferredCaseComment(newCase.Id);
} catch (Exception exc){
- ExceptionClass.InsertException(exc);
+ ExceptionClass.InsertException(exc);
}
}
@@ -116,11 +116,11 @@ public class CaseTransferController{
}
private Integer getParentCaseCommentsSize(){
- if (this.parentCaseComments == null){
- this.parentCaseComments = new List<CaseComment>();
- this.parentCaseComments = [SELECT Id FROM CaseComment WHERE ParentId = :this.myCase.Id];
- }
- return this.parentCaseComments.size();
+ if (this.parentCaseComments == null){
+ this.parentCaseComments = new List<CaseComment>();
+ this.parentCaseComments = [SELECT Id FROM CaseComment WHERE ParentId = :this.myCase.Id];
+ }
+ return this.parentCaseComments.size();
}
private Integer getParentAttachmentsSize(){
@@ -137,13 +137,13 @@ public class CaseTransferController{
private Map<String, Case_Team__c> caseTeamMap;
private List<Case_Team__c> allCaseTeams;
private List<String> FIELDNAMES = new List<String>{'Description'
- ,'Description_Rich_Text__c'
- ,'SuppliedEmail'
- ,'SuppliedName'
- ,'ContactId'
- ,'AccountId'
- ,'Status'
- ,'Team__c'
- ,'RecordTypeId'
- ,'Id'};
+ ,'Description_Rich_Text__c'
+ ,'SuppliedEmail'
+ ,'SuppliedName'
+ ,'ContactId'
+ ,'AccountId'
+ ,'Status'
+ ,'Team__c'
+ ,'RecordTypeId'
+ ,'Id'};
}
View
2 src/classes/CaseTransferController.cls-meta.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
- <apiVersion>23.0</apiVersion>
+ <apiVersion>24.0</apiVersion>
<status>Active</status>
</ApexClass>
View
32 src/classes/CaseTransferController_Test.cls
@@ -1,26 +1,26 @@
@isTest
private class CaseTransferController_Test {
-
- static Case testCase;
- static Case_Team__c testCaseTeam;
-
- static CaseTransferController getTestController(){
- testCase = new Case(Subject = 'TestCase', Status = 'TestStatus', Description = 'Test Description');
- insert testCase;
- PageReference CaseTransferPage = Page.CaseTransfer;
+
+ static Case testCase;
+ static Case_Team__c testCaseTeam;
+
+ static CaseTransferController getTestController(){
+ testCase = new Case(Subject = 'TestCase', Status = 'TestStatus', Description = 'Test Description');
+ insert testCase;
+ PageReference CaseTransferPage = Page.CaseTransfer;
Test.setCurrentPage(CaseTransferPage);
ApexPages.currentPage().getParameters().put('Id', testCase.Id);
ApexPages.StandardController caseController = new ApexPages.StandardController(testCase);
CaseTransferController myController = new CaseTransferController(caseController);
return myController;
- }
-
- static Case_Team__c getNewCaseTeam(){
- RecordType randomRecordType = [SELECT Id, DeveloperName FROM RecordType WHERE sObjectType = 'Case'AND isActive = true LIMIT 1];
- testCaseTeam = new Case_Team__c (Name = 'TestCaseTeam', Record_Type_Developer_Name__c = randomRecordType.DeveloperName, Email_Service_Address__c = 'fake@nevergoingtohappen.org');
- insert testCaseTeam;
- return testCaseTeam;
- }
+ }
+
+ static Case_Team__c getNewCaseTeam(){
+ RecordType randomRecordType = [SELECT Id, DeveloperName FROM RecordType WHERE sObjectType = 'Case'AND isActive = true LIMIT 1];
+ testCaseTeam = new Case_Team__c (Name = 'TestCaseTeam', Record_Type_Developer_Name__c = randomRecordType.DeveloperName, Email_Service_Address__c = 'fake@nevergoingtohappen.org');
+ insert testCaseTeam;
+ return testCaseTeam;
+ }
static testMethod void shouldHaveCaseComment() {
CaseTransferController myController = getTestController();
View
2 src/classes/CaseTransferController_Test.cls-meta.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
- <apiVersion>23.0</apiVersion>
+ <apiVersion>24.0</apiVersion>
<status>Active</status>
</ApexClass>

0 comments on commit a3a218c

Please sign in to comment.