Exemple #1
0
def resource_supply(request, page_name):
    """Supply the view_objects content for this widget."""
    _ = page_name
    user = request.user
    team = user.get_profile().team
    golow_activities = smartgrid.get_available_golow_actions(user, page_name)
    hourly_goal = None
    daily_goal = None
    if team:
        if not resource_goal.is_manual_entry(team, page_name):
            hourly_goal = get_hourly_goal_data(team, page_name)
        else:
            daily_goal = get_daily_goal_data(team, page_name)

    resource_setting = resource_mgr.get_resource_setting(page_name)

    return {
        "golow_activities": golow_activities,
        "hourly_goal": hourly_goal,
        "daily_goal": daily_goal,
        "resource": resource_setting,
        }
Exemple #2
0
def resource_supply(request, page_name):
    """Supply the view_objects content for this widget."""
    user = request.user
    team = user.profile.team
    golow_activities = smartgrid.get_available_golow_actions(user, page_name)
    hourly_goal = None
    daily_goal = None
    goal_settings = None
    if team:
        goal_settings = resource_goal.team_goal_settings(team, page_name)
        if not goal_settings.manual_entry and not "calendar_view" in request.GET:
            hourly_goal = get_hourly_goal_data(team, page_name)
        else:
            daily_goal = get_daily_goal_data(team, page_name)

    resource_setting = resource_mgr.get_resource_setting(page_name)

    return {
        "golow_activities": golow_activities,
        "hourly_goal": hourly_goal,
        "daily_goal": daily_goal,
        "resource": resource_setting,
        "goal_settings": goal_settings,
    }
Exemple #3
0
def resource_supply(request, page_name):
    """Supply the view_objects content for this widget."""
    user = request.user
    team = user.profile.team
    golow_activities = smartgrid.get_available_golow_actions(user, page_name)
    hourly_goal = None
    daily_goal = None
    goal_settings = None
    if team:
        goal_settings = resource_goal.team_goal_settings(team, page_name)
        if not goal_settings.manual_entry and not "calendar_view" in request.GET:
            hourly_goal = get_hourly_goal_data(team, page_name)
        else:
            daily_goal = get_daily_goal_data(team, page_name)

    resource_setting = resource_mgr.get_resource_setting(page_name)

    return {
        "golow_activities": golow_activities,
        "hourly_goal": hourly_goal,
        "daily_goal": daily_goal,
        "resource": resource_setting,
        "goal_settings": goal_settings,
        }