fix voor onderhanden werkpositie uren per werknemer

This commit is contained in:
Theo Weijmer
2021-04-01 15:06:20 +02:00
parent 54f84f8c22
commit 321432efa2
3 changed files with 11 additions and 12 deletions
@@ -40,8 +40,8 @@
</li> </li>
<!-- ko foreach:uniqueEmployees --> <!-- ko foreach:uniqueEmployees -->
<li class="nav-item" data-bind="click:$root.setActivetab.bind($data, slug)" style="z-index:10"> <li class="nav-item" data-bind="click:$root.setActivetab.bind($data, id)" style="z-index:10">
<a class="nav-link" data-bind="text:fullname, css:{'active':$root.sluggy() == slug}"></a> <a class="nav-link" data-bind="text:fullname, css:{'active':$root.sluggy() == id}"></a>
</li> </li>
<!-- /ko --> <!-- /ko -->
</ul> </ul>
@@ -54,7 +54,7 @@
</div> </div>
<!-- ko foreach:uniqueEmployees --> <!-- ko foreach:uniqueEmployees -->
<div class="tab-pane" data-bind="css:{'active':$root.sluggy() == slug}"> <div class="tab-pane" data-bind="css:{'active':$root.sluggy() == id}">
<div style="position:relative"> <div style="position:relative">
<div style="position:absolute;right:20px; z-index:10;"> <div style="position:absolute;right:20px; z-index:10;">
<div class="onoffswitch" data-bind="click:$root.toggleHourView"> <div class="onoffswitch" data-bind="click:$root.toggleHourView">
@@ -83,4 +83,4 @@
</div> </div>
</div> </div>
</div> </div>
-2
View File
@@ -30,7 +30,5 @@
"paragonie/random_compat": "Provides better randomness in PHP 5.x" "paragonie/random_compat": "Provides better randomness in PHP 5.x"
}, },
"require-dev": { "require-dev": {
"mikey179/vfsStream": "1.1.*",
"phpunit/phpunit": "4.* || 5.*"
} }
} }
@@ -162,12 +162,13 @@ dbo.monthlyemployeehoursInit = function () {
}, 700 ); }, 700 );
}, },
refreshTab: function () { refreshTab: function (userID) {
var vm = dbo.monthlyEmployeeHoursModel; var vm = dbo.monthlyEmployeeHoursModel;
if ( vm.currentTab == false ) return; if ( vm.currentTab == false ) return;
dbo.reportsDataService.getEmployeeHours( vm.currentTab.id, vm.selectedYear(), function ( data ) { dbo.reportsDataService.getEmployeeHours( userID, vm.selectedYear(), function ( data ) {
console.log( data );
vm.currentTab.myData( data ); vm.currentTab.myData( data );
vm.currentTab.totalJanuari( 0 ); vm.currentTab.totalJanuari( 0 );
vm.currentTab.totalFebruari( 0 ); vm.currentTab.totalFebruari( 0 );
@@ -259,17 +260,17 @@ dbo.monthlyemployeehoursInit = function () {
dbo.monthlyEmployeeHoursModel.drawCharts( this ); dbo.monthlyEmployeeHoursModel.drawCharts( this );
}, },
setActivetab: function ( tab ) { setActivetab: function ( userID ) {
var vm = dbo.monthlyEmployeeHoursModel; var vm = dbo.monthlyEmployeeHoursModel;
$.each( vm.uniqueEmployees(), function ( i, p ) { $.each( vm.uniqueEmployees(), function ( i, p ) {
if ( tab == p.slug ) { if ( userID == p.id ) {
vm.currentTab = p; vm.currentTab = p;
vm.refreshTab(); vm.refreshTab( userID );
vm.sluggy( userID );
} }
} ) } )
vm.sluggy( tab );
}, },
UniqueEmployee: function ( data ) { UniqueEmployee: function ( data ) {