CRM-13852 - avoid multiple calls to Array::value

----------------------------------------
* CRM-13852: activity filter user preference: flush cache before setting
  http://issues.civicrm.org/jira/browse/CRM-13852
CRM-13852 - use php calls directly

----------------------------------------
* CRM-13852: activity filter user preference: flush cache before setting
  http://issues.civicrm.org/jira/browse/CRM-13852
Merge pull request #2117 from dlobo/CRM-13852

CRM-13852 - avoid multiple calls to Array::value
Temporary solution to people being able to see too much information on membership dashboard
CRM-13493 don't fatal on duplicate invoice id
Readability on createActivites