/**
 * Populate $objects with object that $user can see
 *
 * @param Milestone $milestone
 * @param array $objects
 * @param User $user
 * @return null
 */
function pages_handle_on_milestone_objects(&$milestone, &$objects, &$user)
{
    if ($user->getProjectPermission('page', $milestone->getProject()) >= PROJECT_PERMISSION_ACCESS) {
        $objects[lang('Pages')] = Pages::findByMilestone($milestone, STATE_VISIBLE, $user->getVisibility());
    }
    // if
}
/**
 * Populate $objects with objects that are in $visibility domain
 *
 * @param Milestone $milestone
 * @param array $objects
 * @param integer $visibility
 * @return null
 */
function pages_handle_on_milestone_objects_by_visibility(&$milestone, &$objects, $visibility)
{
    $objects[lang('Pages')] = Pages::findByMilestone($milestone, STATE_VISIBLE, $visibility);
}