CRM-15713 - Case ajax fixes

I didn't fully get this at first, but it seems smart -- getCases(TRUE) initially seemed more correct (because https://github.com/civicrm/civicrm-core/blob/master/CRM/Case/BAO/Case.php#L736 will ignore $allCases if the user lacks permission). However, combining L3073 and L3082 should produce the same results with better performance -- because there's no need to execute getCases(...) when we know that the user has permission 'access all cases and activities'.

I'm not sure sure it's proper to use getCases(...$type=='upcoming' [default-value]...); this seems to be saying that one only has permission to access cases with upcoming activities. As the general rule, I don't see how dates on activities would affect access-control to the overall case. $type=='any' seems more appropriate to me.