/*
 * This file is part of LibrePlan
 *
 * Copyright (C) 2012 Igalia, S.L.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.libreplan.web.users.dashboard;

import org.joda.time.LocalDate;
import org.libreplan.web.common.entrypoints.IURLHandlerRegistry;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.util.GenericForwardComposer;

/**
 * Controller for creation/edition of a monthly timesheet
 *
 * @author Manuel Rego Casasnovas <mrego@igalia.com>
 */
@SuppressWarnings("serial")
public class MonthlyTimesheetController extends GenericForwardComposer
        implements IMonthlyTimesheetController {

    private IMonthlyTimesheetModel monthlyTimesheetModel;

    private IURLHandlerRegistry URLHandlerRegistry;

    @Override
    public void doAfterCompose(Component comp) throws Exception {
        super.doAfterCompose(comp);
        comp.setAttribute("controller", this);

        URLHandlerRegistry.getRedirectorFor(IMonthlyTimesheetController.class)
                .register(this, page);
    }

    @Override
    public void goToCreateOrEditForm(LocalDate date) {
        monthlyTimesheetModel.initCreateOrEdit(date);
    }

    public LocalDate getDate() {
        return monthlyTimesheetModel.getDate();
    }

}

@@ -787,16 +787,161 @@
 board;%0A%0A
+import static org.libreplan.web.I18nHelper._;%0Aimport static org.libreplan.web.planner.tabs.MultipleTabsPlannerController.BREADCRUMBS_SEPARATOR;%0A%0A
 import o
@@ -964,16 +964,16 @@
 alDate;%0A
-
 import o
@@ -1114,16 +1114,72 @@
 omposer;
+%0Aimport org.zkoss.zul.Image;%0Aimport org.zkoss.zul.Label;
 %0A%0A/**%0A *
@@ -1719,16 +1719,47 @@
 this);%0A%0A
+        setBreadcrumbs(comp);%0A%0A
         
@@ -1829,16 +1829,16 @@
 .class)%0A
-
         
@@ -1871,24 +1871,653 @@
 ge);%0A    %7D%0A%0A
+    private void setBreadcrumbs(Component comp) %7B%0A        Component breadcrumbs = comp.getPage().getFellow(%22breadcrumbs%22);%0A        if (breadcrumbs.getChildren() != null) %7B%0A            breadcrumbs.getChildren().clear();%0A        %7D%0A        breadcrumbs.appendChild(new Image(BREADCRUMBS_SEPARATOR));%0A        breadcrumbs.appendChild(new Label(_(%22My account%22)));%0A        breadcrumbs.appendChild(new Image(BREADCRUMBS_SEPARATOR));%0A        breadcrumbs.appendChild(new Label(_(%22My dashboard%22)));%0A        breadcrumbs.appendChild(new Image(BREADCRUMBS_SEPARATOR));%0A        breadcrumbs.appendChild(new Label(_(%22Monthly timesheet%22)));%0A    %7D%0A%0A
     @Overrid

Add breadcrumb to moonthly timesheet page