Added stored porcedure to count archived tasks and php functions to call it to fix archived task pagination bug. Part of #872