Author: obruce Date: 2014-06-24 15:20:34 +0200 (Tue, 24 Jun 2014) New Revision: 3006 Url: http://forge.chorem.org/projects/jtimer/repository/revisions/3006 Log: correction config + checkbox rapport Modified: branches/ng-jtimer/src/main/java/org/chorem/jtimer/storage/Storage.java branches/ng-jtimer/src/main/java/org/chorem/jtimer/web/TasksResource.java branches/ng-jtimer/src/main/resources/jtimer-default.properties branches/ng-jtimer/src/main/webapp/js/controllers.js branches/ng-jtimer/src/main/webapp/js/entities.js branches/ng-jtimer/src/main/webapp/partials/reportModal.html Modified: branches/ng-jtimer/src/main/java/org/chorem/jtimer/storage/Storage.java =================================================================== --- branches/ng-jtimer/src/main/java/org/chorem/jtimer/storage/Storage.java 2014-06-23 15:38:30 UTC (rev 3005) +++ branches/ng-jtimer/src/main/java/org/chorem/jtimer/storage/Storage.java 2014-06-24 13:20:34 UTC (rev 3006) @@ -152,7 +152,7 @@ statement.executeUpdate(config.getStorageQueryCreateTableVersion()); statement.executeUpdate(config.getStorageQueryCreateTableTask()); - statement.executeUpdate(config.getStorageQueryDeleteTime()); + statement.executeUpdate(config.getStorageQueryCreateTableTime()); } catch (SQLException ex) { throw new StorageException("Can't create schema", ex); @@ -199,6 +199,8 @@ statement = connection.prepareStatement(config.getStorageQuerySelectTimedTask()); statement.setLong(1, date); + log.debug(statement.toString()); + ResultSet rs = statement.executeQuery(); while (rs.next()) { TimerTask task = new TimerTask(); @@ -260,6 +262,7 @@ } finally { closeStatement(statement); } + log.info("insert done"); } public void modifyTask(TimerTask task) { Modified: branches/ng-jtimer/src/main/java/org/chorem/jtimer/web/TasksResource.java =================================================================== --- branches/ng-jtimer/src/main/java/org/chorem/jtimer/web/TasksResource.java 2014-06-23 15:38:30 UTC (rev 3005) +++ branches/ng-jtimer/src/main/java/org/chorem/jtimer/web/TasksResource.java 2014-06-24 13:20:34 UTC (rev 3006) @@ -84,7 +84,7 @@ date = Long.valueOf(getQuery().getValues("date")); } catch (Exception e) { if(log.isErrorEnabled()){ - log.error("enttities.getTasks date revenu null"); + log.warn("entities.getTasks REST date null"); } } ArrayList<TimerTask> timerTasks; Modified: branches/ng-jtimer/src/main/resources/jtimer-default.properties =================================================================== --- branches/ng-jtimer/src/main/resources/jtimer-default.properties 2014-06-23 15:38:30 UTC (rev 3005) +++ branches/ng-jtimer/src/main/resources/jtimer-default.properties 2014-06-24 13:20:34 UTC (rev 3006) @@ -2,7 +2,7 @@ # jTimer default properties ### # jTimer storage path -jtimer.storage.path=/home/olivia/Bureau/jtimer/jtimer8081 +jtimer.storage.path=/home/olivia/Bureau/jtimer/jtimerNew ### # SQL properties ### @@ -38,19 +38,19 @@ #INSERT jtimer.storage.insert.version.number=INSERT INTO VERSION VALUES('2.0') jtimer.storage.insert.task=INSERT INTO task (name, parent, taskId, hidden, note,creationDate, modificationDate, removed) VALUES (?, ?, ?, ?, ?,?, ?, ?) -jtimer.storage.insert.time=INSERT INTO tasktime (taskid, date, uuid, duration, modificationDate, removed) VALUES(?, ?, ?, ?, ?, ?) +jtimer.storage.insert.time=INSERT INTO tasktime (taskid, date, uuid, duration, modificationDate, removed) VALUES (?, ?, ?, ?, ?, ?) ### #SELECT jtimer.storage.select.table.name=SELECT table_name FROM information_schema.tables; jtimer.storage.select.count.task=SELECT count(*) FROM task WHERE removed = 0 jtimer.storage.select.timed.task=SELECT TA.*, sum(TI.duration) AS totalduration \ FROM task TA, tasktime TI \ - WHERE TA.taskId = TI.taskid \ - AND TA.modificationDate > ? \ - GROUP BY TA.taskId + WHERE TA.taskId = TI.taskid \ + AND TA.modificationDate > ? \ + GROUP BY TA.taskId jtimer.storage.select.nottimed.task=SELECT * \ FROM task \ - WHERE (taskId not in (SELECT taskid FROM task)) \ + WHERE (taskId not in (SELECT taskid FROM tasktime)) \ AND task.modificationDate > ? jtimer.storage.select.time.withdate=SELECT TA.taskId AS mytask, TI.* \ FROM task TA, tasktime TI \ @@ -66,16 +66,16 @@ AND TA.removed > 0 \ GROUP BY TA.taskId jtimer.storage.select.report.timedtasks=SELECT TA.taskId AS taskid, TA.name AS task, TA.parent AS parent, \ - TA.creationDate AS creationDate, sum(TI.duration) AS totalduration \ + TA.creationDate AS creationDate, sum(TI.duration) AS totalduration \ FROM task TA, tasktime TI \ - WHERE TA.taskId = TI.taskid\ + WHERE TA.taskId = TI.taskid \ AND TA.creationDate > ? \ AND TA.creationDate < ? \ GROUP BY TA.taskId \ ORDER BY TA.creationDate DESC jtimer.storage.select.report.roottasks=SELECT * \ FROM task \ - WHERE (taskId not in (SELECT taskid FROM task) AND parent = '' ) + WHERE (taskId not in (SELECT taskid FROM tasktime) AND parent = '' ) ### #DELETE jtimer.storage.delete.time.withid=DELETE FROM tasktime WHERE uuid = ? Modified: branches/ng-jtimer/src/main/webapp/js/controllers.js =================================================================== --- branches/ng-jtimer/src/main/webapp/js/controllers.js 2014-06-23 15:38:30 UTC (rev 3005) +++ branches/ng-jtimer/src/main/webapp/js/controllers.js 2014-06-24 13:20:34 UTC (rev 3006) @@ -909,8 +909,11 @@ var modalInstance = $modal.open({ templateUrl: 'partials/reportModal.html', controller: ReportModalInstanceCtrl, - - + resolve: { + tree : function(){ + return $scope.tree; + } + } }); modalInstance.result.then(function (item) { @@ -957,8 +960,10 @@ }; } -function ReportModalInstanceCtrl($scope, $modalInstance,$http, $sce){ +function ReportModalInstanceCtrl($scope, $modalInstance,$http, $sce, tree){ + $scope.tree = tree; + $scope.obj={ startDate : new Date(), endDate : new Date() @@ -967,7 +972,7 @@ $scope.obj.endDate.setHours(23,59,59,999); $scope.radioModel = '5'; - $scope.htmlReport=""; + $scope.htmlReport="Générer un rapport"; $scope.toHTML = function (data) { return $sce.trustAsHtml(data); @@ -980,6 +985,8 @@ var deb =($scope.obj.startDate).getTime(); var end =($scope.obj.endDate).getTime(); + + //TODO obruce envoyer les taches à reporter $http({method: "GET", url: "/rest/report", params:{start_Date : deb, end_Date : end}}) .success(function(data){ @@ -989,8 +996,13 @@ } - $scope.changeFonc= function(){ + $scope.setChildrenCheckbox = function(node){ + + angular.forEach(node.children, function(child) { + child.task.isReported = node.task.isReported; + }); } + //TODO obruce faire un check et uncheck all $scope.close = function() { $modalInstance.close(); Modified: branches/ng-jtimer/src/main/webapp/js/entities.js =================================================================== --- branches/ng-jtimer/src/main/webapp/js/entities.js 2014-06-23 15:38:30 UTC (rev 3005) +++ branches/ng-jtimer/src/main/webapp/js/entities.js 2014-06-24 13:20:34 UTC (rev 3006) @@ -402,6 +402,7 @@ this.name = name; this.description = ""; + this.isReported = true; this.tags = []; this.syncOptions = {}; }; Modified: branches/ng-jtimer/src/main/webapp/partials/reportModal.html =================================================================== --- branches/ng-jtimer/src/main/webapp/partials/reportModal.html 2014-06-23 15:38:30 UTC (rev 3005) +++ branches/ng-jtimer/src/main/webapp/partials/reportModal.html 2014-06-24 13:20:34 UTC (rev 3006) @@ -1,14 +1,16 @@ <div> - <h2>Option du rapport :</h2> + <h2>Rapport :</h2> </div> <hr/> <div > + <!-- Datepicker div --> - <div style="display : inline-block;vertical-align: top;"> + <div style="border:1px solid black; display : inline-block;vertical-align: top;margin-left:2px;"> + <h4><u>Option :</u></h4> De : - <div ng-controller="ReportDatePickerCtrl" class="row"> + <div style="margin-left:2px;" ng-controller="ReportDatePickerCtrl" class="row"> <div class="col-md-6"> <p class="input-group medium_input"> <input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="obj.startDate" is-open="opened" min-date="minDate" max-date="obj.endDate" ng-required="true" close-text="Close" /> @@ -20,7 +22,7 @@ </div> A : - <div class="row" ng-controller="ReportDatePickerCtrl"> + <div style="margin-left:2px;" class="row" ng-controller="ReportDatePickerCtrl"> <div class="col-md-6"> <p class="input-group medium_input"> <input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="obj.endDate" is-open="opened" min-date="obj.startDate" max-date="maxDate" ng-required="true" close-text="Close" /> @@ -30,13 +32,43 @@ </p> </div> </div> - + <hr/> <div> + <h4><u>Projet :</u></h4> - </div> + <!--la div de l'arbre--> + <div> + <div class='table'> + <!-- Div du body wt-tree-repeat Angular js directive in app.js--> + <div class="tbody" + wt-tree-repeat="tree | orderBy:'task.name'" + wt-force-open="query || forceExpanded"> + <div class="tr" ng-class="{'current-row' : ($node.task === currentTask), 'selected-row' : ($node.task === selectedTask)}"> + <!--ng-click="setSelectedTask($node.task)" + ng-keydown="keyPressed($event)">ng-dblclick="timeTask($node.task)"--> + <div class="td"> + <span class="spacer level{{$level}}"></span> + + <!--Task state icon--> + <i class="glyphicon glyphicon-ban-circle" ng-show="$state=='empty'"></i> + <i class="glyphicon glyphicon-plus-sign" ng-click="$toggleState()" ng-show="$state=='close'"></i> + <i class="glyphicon glyphicon-minus-sign" ng-click="$toggleState()" ng-show="$state=='open'"></i> + + <!--Project name visible and editable --> + <input type="checkbox" ng-model="$node.task.isReported" ng-change="setChildrenCheckbox($node)"> + <span>{{$node.task.name}} </span> + + </div> + </div> + </div> + </div> + + </div> + </div> + </div> <div style="display : inline-block; vertical-align: top; width : 350px"> @@ -53,7 +85,9 @@ </div> + + <div class="modal-footer"> - <button class="btn btn-primary" ng-click="generateReport()">Generer</button> + <button class="btn btn-primary" ng-click="generateReport()">Générer</button> <button class="btn btn-primary" ng-click="close()">Fermer</button> </div> \ No newline at end of file