diff --git a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/datacontroller.js b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/datacontroller.js index 1b9287c926df5689a5630fa8bf8eb991e002bfd2..d799e1bee2f7b450a11f29840d566d9cbaa978b0 100644 --- a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/datacontroller.js +++ b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/datacontroller.js @@ -1174,6 +1174,15 @@ dataControllerMod.controller('DataController', } }; + $scope.getFullTimeWindowForSelectedProject = function() { + dataService.getProjectTasksTimeWindow(dataService.selected_project_id).then(function(window) { + if(window.min_starttime && window.max_endtime) { + dataService.viewTimeSpan.from = dataService.convertDatestringToLocalUTCDate(window.min_starttime); + dataService.viewTimeSpan.to = dataService.convertDatestringToLocalUTCDate(window.max_endtime); + } + }); + }; + $scope.$watch('dataService.viewTimeSpan', function() { $scope.selectZoomTimespan(); diff --git a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/templates/projects.html b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/templates/projects.html index 70fd1f62512ffe61856cc5425f6a3c3c558b99ce..264cf31e92b904762bc22dc651b81af10b0d6434 100644 --- a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/templates/projects.html +++ b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/templates/projects.html @@ -92,10 +92,11 @@ <button title="Scroll forward in time" type="button" class="btn btn-default" ng-click="scrollForward()"><i class="glyphicon glyphicon-step-forward"></i></button> </p> </div> - <div style="float:left; min-width:180px; padding-right:16px; "> + <div style="float:left; min-width:230px; padding-right:16px; "> <label>Zoom:</label> <p class="input-group"> - <select class="form-control" ng-model="$parent.zoomTimespan" ng-options="option.name for option in $parent.zoomTimespans track by option.value" ng-change="$parent.onZoomTimespanChanged()"></select> + <select style="float:left; width:180px" class="form-control" ng-model="$parent.zoomTimespan" ng-options="option.name for option in $parent.zoomTimespans track by option.value" ng-change="$parent.onZoomTimespanChanged()"></select> + <button style="float:left; " title="Select full time window for this project" type="button" class="btn btn-default" ng-click="getFullTimeWindowForSelectedProject()"><i class="glyphicon glyphicon-resize-horizontal"></i></button> </p> </div> <div style="float:left; min-width:50px;">