mirror of
https://github.com/atlanticbiomedical/biomedjs.git
synced 2025-07-02 00:47:26 -04:00
Latest tweaks
This commit is contained in:
@ -6,7 +6,7 @@ var mongoose = require('mongoose'),
|
|||||||
|
|
||||||
var log = require('log4node');
|
var log = require('log4node');
|
||||||
|
|
||||||
var frequencies = ["Medical Device","Sterilizer - TT","Vaporizer","Ice Maker","Anesthesia","Waste Management System","Imaging","Medical Gas Systems","RAE","ERT","N2O Trace Gas","Sterilizer - F","Quarterly","Semi","Annual","legacy","DLLR", "Isolation Panel"];
|
var frequencies = ["Medical Device","Sterilizer - TT","Vaporizer","Ice Maker","Anesthesia","Waste Management System","Imaging","Medical Gas Systems","RAE","ERT","N2O Trace Gas","Sterilizer - F","Quarterly","Semi","Annual","legacy","DLLR", "Isolation Panel", "Battery Backup"];
|
||||||
|
|
||||||
exports.index = function(req, res) {
|
exports.index = function(req, res) {
|
||||||
log.info("clients.index");
|
log.info("clients.index");
|
||||||
|
@ -21,7 +21,6 @@ angular.module('biomed')
|
|||||||
start: moment($scope.date).subtract('days', 10).toDate().toJSON(),
|
start: moment($scope.date).subtract('days', 10).toDate().toJSON(),
|
||||||
end: moment($scope.date).add('days', 21).toDate().toJSON()
|
end: moment($scope.date).add('days', 21).toDate().toJSON()
|
||||||
}, function(result) {
|
}, function(result) {
|
||||||
console.log(result);
|
|
||||||
$scope.schedule = result;
|
$scope.schedule = result;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -122,7 +121,7 @@ angular.module('biomed')
|
|||||||
.controller("UsersIndexCtrl", function($scope, $filter, $routeParams, $location, Users, LocationBinder) {
|
.controller("UsersIndexCtrl", function($scope, $filter, $routeParams, $location, Users, LocationBinder) {
|
||||||
$scope.loading = true;
|
$scope.loading = true;
|
||||||
|
|
||||||
$scope.account.$then(function(value) {
|
$scope.account.$promise.then(function(value) {
|
||||||
if (!$scope.accountHasPermission('system.admin'))
|
if (!$scope.accountHasPermission('system.admin'))
|
||||||
return $location.path('/');
|
return $location.path('/');
|
||||||
});
|
});
|
||||||
@ -276,13 +275,11 @@ angular.module('biomed')
|
|||||||
},
|
},
|
||||||
eventHandlers: {
|
eventHandlers: {
|
||||||
success: function(file, response) {
|
success: function(file, response) {
|
||||||
console.log('adding file');
|
|
||||||
$scope.$apply(function() {
|
$scope.$apply(function() {
|
||||||
$scope.model.image = response.filename;
|
$scope.model.image = response.filename;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
removedfile: function(file) {
|
removedfile: function(file) {
|
||||||
console.log('removing file');
|
|
||||||
$scope.$apply(function() {
|
$scope.$apply(function() {
|
||||||
$scope.model.image = undefined;
|
$scope.model.image = undefined;
|
||||||
});
|
});
|
||||||
@ -303,7 +300,6 @@ angular.module('biomed')
|
|||||||
},
|
},
|
||||||
eventHandlers: {
|
eventHandlers: {
|
||||||
success: function(file, response) {
|
success: function(file, response) {
|
||||||
console.log('Adding File');
|
|
||||||
file.filename = response.filename;
|
file.filename = response.filename;
|
||||||
|
|
||||||
if (galleryImages[file.filename]) {
|
if (galleryImages[file.filename]) {
|
||||||
@ -314,7 +310,6 @@ angular.module('biomed')
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
removedfile: function(file) {
|
removedfile: function(file) {
|
||||||
console.log('Removing File');
|
|
||||||
galleryImages[file.filename]--;
|
galleryImages[file.filename]--;
|
||||||
|
|
||||||
if (galleryImages[file.filename] <= 0) {
|
if (galleryImages[file.filename] <= 0) {
|
||||||
@ -372,8 +367,6 @@ angular.module('biomed')
|
|||||||
$scope.model = Posts.get($routeParams, function() {
|
$scope.model = Posts.get($routeParams, function() {
|
||||||
$scope.loading = false;
|
$scope.loading = false;
|
||||||
|
|
||||||
console.log($scope.model);
|
|
||||||
|
|
||||||
if ($scope.model.image) {
|
if ($scope.model.image) {
|
||||||
$scope.existingTitleImages = [$scope.model.image];
|
$scope.existingTitleImages = [$scope.model.image];
|
||||||
}
|
}
|
||||||
@ -397,13 +390,11 @@ angular.module('biomed')
|
|||||||
},
|
},
|
||||||
eventHandlers: {
|
eventHandlers: {
|
||||||
success: function(file, response) {
|
success: function(file, response) {
|
||||||
console.log('adding file');
|
|
||||||
$scope.$apply(function() {
|
$scope.$apply(function() {
|
||||||
$scope.model.image = response.filename;
|
$scope.model.image = response.filename;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
removedfile: function(file) {
|
removedfile: function(file) {
|
||||||
console.log('removing file');
|
|
||||||
$scope.$apply(function() {
|
$scope.$apply(function() {
|
||||||
$scope.model.image = undefined;
|
$scope.model.image = undefined;
|
||||||
});
|
});
|
||||||
@ -423,7 +414,6 @@ angular.module('biomed')
|
|||||||
},
|
},
|
||||||
eventHandlers: {
|
eventHandlers: {
|
||||||
success: function(file, response) {
|
success: function(file, response) {
|
||||||
console.log('Adding File');
|
|
||||||
file.filename = response.filename;
|
file.filename = response.filename;
|
||||||
|
|
||||||
if (galleryImages[file.filename]) {
|
if (galleryImages[file.filename]) {
|
||||||
@ -434,7 +424,6 @@ angular.module('biomed')
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
removedfile: function(file) {
|
removedfile: function(file) {
|
||||||
console.log('Removing File');
|
|
||||||
galleryImages[file.filename]--;
|
galleryImages[file.filename]--;
|
||||||
|
|
||||||
if (galleryImages[file.filename] <= 0) {
|
if (galleryImages[file.filename] <= 0) {
|
||||||
@ -448,8 +437,6 @@ angular.module('biomed')
|
|||||||
$scope.model.gallery = Object.keys(galleryImages);
|
$scope.model.gallery = Object.keys(galleryImages);
|
||||||
$scope.model.status = status;
|
$scope.model.status = status;
|
||||||
|
|
||||||
console.log($scope.model);
|
|
||||||
|
|
||||||
Posts.update({id: $scope.model._id}, $scope.model, function(result) {
|
Posts.update({id: $scope.model._id}, $scope.model, function(result) {
|
||||||
$location.path("/posts/");
|
$location.path("/posts/");
|
||||||
});
|
});
|
||||||
@ -673,10 +660,13 @@ angular.module('biomed')
|
|||||||
var defaultEnd = moment().toDate();
|
var defaultEnd = moment().toDate();
|
||||||
var defaultStart = moment(defaultEnd).subtract('days', 7).toDate();
|
var defaultStart = moment(defaultEnd).subtract('days', 7).toDate();
|
||||||
|
|
||||||
LocationBinder($scope, ['query', 'status', 'start', 'end'], {
|
$scope.start = defaultStart;
|
||||||
start: defaultStart,
|
$scope.end = defaultEnd;
|
||||||
end: defaultEnd
|
|
||||||
});
|
// LocationBinder($scope, ['query', 'status', 'start', 'end'], {
|
||||||
|
// start: defaultStart,
|
||||||
|
// end: defaultEnd
|
||||||
|
// });
|
||||||
|
|
||||||
fetchData();
|
fetchData();
|
||||||
|
|
||||||
@ -686,6 +676,7 @@ angular.module('biomed')
|
|||||||
var initialPageSize = 100;
|
var initialPageSize = 100;
|
||||||
var pageSize = 5;
|
var pageSize = 5;
|
||||||
|
|
||||||
|
$scope.query = '!n/a';
|
||||||
$scope.canLoad = true;
|
$scope.canLoad = true;
|
||||||
|
|
||||||
$scope.$watch('query', filter);
|
$scope.$watch('query', filter);
|
||||||
@ -733,7 +724,6 @@ angular.module('biomed')
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.selectPage = function(status) {
|
$scope.selectPage = function(status) {
|
||||||
console.log('SelectPage: ' + status);
|
|
||||||
$scope.status = status;
|
$scope.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -844,6 +834,8 @@ angular.module('biomed')
|
|||||||
|
|
||||||
var search = $location.search();
|
var search = $location.search();
|
||||||
|
|
||||||
|
$scope.model.status = 'scheduled';
|
||||||
|
|
||||||
if (search.workorderType == 'pm') {
|
if (search.workorderType == 'pm') {
|
||||||
$scope.model.client = search.clientId;
|
$scope.model.client = search.clientId;
|
||||||
$scope.model.reason = "Preventive Maintenance";
|
$scope.model.reason = "Preventive Maintenance";
|
||||||
@ -853,6 +845,7 @@ angular.module('biomed')
|
|||||||
} else if (search.workorderType == "meeting") {
|
} else if (search.workorderType == "meeting") {
|
||||||
$scope.model.reason = "Meeting";
|
$scope.model.reason = "Meeting";
|
||||||
$scope.workorderType = 'meeting';
|
$scope.workorderType = 'meeting';
|
||||||
|
$scope.model.status = 'n/a';
|
||||||
|
|
||||||
if (search.clientId) {
|
if (search.clientId) {
|
||||||
$scope.model.client = search.clientId;
|
$scope.model.client = search.clientId;
|
||||||
@ -966,7 +959,6 @@ angular.module('biomed')
|
|||||||
var startDate = moment(picker.startDate).format('YYYY-MM-DD');
|
var startDate = moment(picker.startDate).format('YYYY-MM-DD');
|
||||||
var endDate = moment(picker.endDate).format('YYYY-MM-DD');
|
var endDate = moment(picker.endDate).format('YYYY-MM-DD');
|
||||||
|
|
||||||
model.status = 'scheduled';
|
|
||||||
model.scheduling = {};
|
model.scheduling = {};
|
||||||
model.scheduling.start = moment(startDate + 'T' + picker.startTime).toDate();
|
model.scheduling.start = moment(startDate + 'T' + picker.startTime).toDate();
|
||||||
model.scheduling.end = moment(endDate + 'T' + picker.endTime).toDate();
|
model.scheduling.end = moment(endDate + 'T' + picker.endTime).toDate();
|
||||||
@ -1175,6 +1167,7 @@ angular.module('biomed')
|
|||||||
}
|
}
|
||||||
|
|
||||||
$scope.$watch('scheduling.startDate', function() {
|
$scope.$watch('scheduling.startDate', function() {
|
||||||
|
if ($scope.scheduling.startDate) {
|
||||||
Schedule.index({
|
Schedule.index({
|
||||||
date: $scope.scheduling.startDate.toJSON()
|
date: $scope.scheduling.startDate.toJSON()
|
||||||
}, function(result) {
|
}, function(result) {
|
||||||
@ -1185,6 +1178,7 @@ angular.module('biomed')
|
|||||||
$scope.scheduling.endDate = $scope.scheduling.startDate;
|
$scope.scheduling.endDate = $scope.scheduling.startDate;
|
||||||
}
|
}
|
||||||
updateDuration();
|
updateDuration();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.$watch('scheduling.endDate', function() {
|
$scope.$watch('scheduling.endDate', function() {
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<input type="text" ng-model="query" class="input-large" placeholder="Search">
|
<input type="text" ng-model="query" class="input-large" placeholder="Search">
|
||||||
<span class="add-on"><i class="icon-search"></i></span>
|
<span class="add-on"><i class="icon-search"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<a ng-click="selectPage()" class="btn">All</a>
|
<a ng-click="selectPage('!n/a')" class="btn">All</a>
|
||||||
<a ng-click="selectPage('scheduled')" class="btn">Scheduled</a>
|
<a ng-click="selectPage('scheduled')" class="btn">Scheduled</a>
|
||||||
<a ng-click="selectPage('invoiced')" class="btn">Invoiced</a>
|
<a ng-click="selectPage('invoiced')" class="btn">Invoiced</a>
|
||||||
<a ng-click="selectPage('paid')" class="btn">Paid</a>
|
<a ng-click="selectPage('paid')" class="btn">Paid</a>
|
||||||
|
Reference in New Issue
Block a user