CRM-13657 : code improvement

----------------------------------------
* CRM-13657: Fatal error when accessing civicase
  http://issues.civicrm.org/jira/browse/CRM-13657
CRM-13657 : more code improvement needed to be done

----------------------------------------
* CRM-13657: Fatal error when accessing civicase
  http://issues.civicrm.org/jira/browse/CRM-13657
Merge pull request #1863 from pratik-joshi/CRM-13657

CRM-13657