|
1
|
|
|
"use strict"; |
|
2
|
|
|
app.controller('staffProfileViewController', ['$scope', '$element', function($scope, $element, $rootScope) { |
|
3
|
|
|
function Initialize() { |
|
4
|
|
|
var entryForm = {}; |
|
5
|
|
|
$scope.entryForm = entryForm; |
|
6
|
|
|
$scope.directiveScopeDict = {}; |
|
7
|
|
|
|
|
8
|
|
|
$scope.deptEditBox = {}; |
|
9
|
|
|
$scope.sectionEditBox = {}; |
|
10
|
|
|
} |
|
11
|
|
|
Initialize(); |
|
12
|
|
|
|
|
13
|
|
|
$scope.SetDefaultValue = function(scope, iElement, iAttrs, controller) { |
|
14
|
|
|
controller.ngModel.DateOfBirth = new Date(0, 0, 0); |
|
15
|
|
|
controller.ngModel.EmploymentDate = new Date(0, 0, 0); |
|
16
|
|
|
} |
|
17
|
|
|
|
|
18
|
|
|
$scope.EventListener = function(scope, iElement, iAttrs, controller) { |
|
19
|
|
|
var prgmID = scope.programId; |
|
20
|
|
|
var tagName = iElement[0].tagName; |
|
21
|
|
|
if ($scope.directiveScopeDict[prgmID] == null || typeof($scope.directiveScopeDict[prgmID]) == "undefined") { |
|
22
|
|
|
$scope.directiveScopeDict[prgmID] = scope; |
|
23
|
|
|
} |
|
24
|
|
|
|
|
25
|
|
|
iElement.ready(function() { |
|
26
|
|
|
|
|
27
|
|
|
}) |
|
28
|
|
|
} |
|
29
|
|
|
|
|
30
|
|
|
$scope.CustomSelectedToRecord = function(sRecord, rowScope, scope, iElement, controller) { |
|
31
|
|
|
console.log("<" + iElement[0].tagName + ">" + " Directive overried CustomPointedToRecord()"); |
|
|
|
|
|
|
32
|
|
|
|
|
33
|
|
|
var tagName = iElement[0].tagName.toLowerCase(); |
|
34
|
|
|
var prgmID = scope.programId.toLowerCase(); |
|
35
|
|
|
|
|
36
|
|
|
if (prgmID == "dw02sp") { |
|
37
|
|
|
// asign the selected record to ng-model |
|
38
|
|
|
$.extend(true, $scope.entryForm, sRecord) |
|
39
|
|
|
} |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
$scope.ValidateBuffer = function(scope, iElement, iAttrs, controller) { |
|
43
|
|
|
controller.ngModel.FullName = controller.ngModel.LastName + ' ' + controller.ngModel.FirstName; |
|
44
|
|
|
|
|
45
|
|
|
return true; |
|
46
|
|
|
}; |
|
47
|
|
|
|
|
48
|
|
|
}]); |