Commit 6ff11843 authored by Stéphane Bouvry's avatar Stéphane Bouvry
Browse files

On peut compléter automatiquement les journées d'un mois passé

parent 72b4168e
Loading
Loading
Loading
Loading
+1 −0
Changes for module/Oscar/config/routes.yml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ timesheet:
        defaults:
            controller: Timesheet
    may_terminate: false

    child_routes:
        resolve:
            type: segment
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+40 −5
Changes for public/js/oscar/src/TimesheetMonth.vue: 40 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -339,6 +339,20 @@
                        Mois de <strong>{{ mois }}</strong>
                    </h3>

                    <section v-if="monthRest > 0 && ts.periodFinished">
                        <p>
                            <i class="icon-help-circled"></i>
                            Vous pouvez compléter automatiquement ce mois avec :
                        </p>
                        <wpselector :others="ts.otherWP" :workpackages="ts.workpackages" :selection="fillMonthWP"
                                    @select="fillMonthWP = $event"></wpselector>
                        <button class="btn btn-default" @click="handlerFillMonth(fillMonthWP)"
                                :class="fillMonthWP ? 'btn-primary' : 'disabled'">
                            <i class="icon-floppy"></i>
                            Compléter
                        </button>
                    </section>

                    <section v-for="week in weeks" v-if="ts" class="card xs">
                        <header class="week-header" @click="selectWeek(week)">
                                <span>
@@ -833,7 +847,8 @@
                selectedTime: null,
                dayMenuSelected: null,
                dayMenuTime: 0.0,
                editedTimesheet: null
                editedTimesheet: null,
                fillMonthWP: null
            }
        },

@@ -854,6 +869,10 @@
        },

        computed: {
            monthRest(){
                return this.monthLength - this.ts.total;
            },

            monthLength(){
                let t = 0.0;
                for( let day in this.ts.days ){
@@ -974,6 +993,26 @@

        methods: {

            handlerFillMonth(withWP){
                console.log("Remplir", withWP);

                let data = [];

                Object.keys(this.ts.days).forEach(date => {
                    let d = this.ts.days[date];
                    if (!(d.closed || d.locked || d.duration >= d.dayLength)) {
                        data.push({
                            'day': d.date,
                            'wpId': withWP.id,
                            'code': withWP.code,
                            'commentaire': '',
                            'duration': (d.dayLength - d.duration) * 60
                        });
                    }
                });
                this.performAddDays(data);
            },

            handlerPasteDay( day ){
                let datasSendable = [];

@@ -1095,10 +1134,6 @@

            },

            fillMonth() {
                // TODO Remplissage automatique du mois
            },

            fillWeek(week, wp) {
                let data = [];