worked on CRM-12981

applied the patch for CRM-12981 for sorting activities