-- removed hardcoded values and handled reopened status. CRM-14191

----------------------------------------
* CRM-14191:
  https://issues.civicrm.org/jira/browse/CRM-14191