@@ -27,25 +27,25 @@ ActivityStreamCollector.prototype = {
27
27
activityFields = activityFields . split ( "," ) ;
28
28
29
29
// Collect the initial data
30
- var initialHistoryData = this . getFirstHistory ( currentRec , activityFields ) ;
30
+ var initialHistoryData = this . _getFirstHistory ( currentRec , activityFields ) ;
31
31
32
32
// Walking through the history data
33
33
while ( hw . walkForward ( ) ) {
34
34
var nextRec = hw . getWalkedRecord ( ) ;
35
35
36
36
// Get all field changes
37
- var fieldChanges = this . compareTwoRecord ( currentRec , nextRec , activityFields ) ;
37
+ var fieldChanges = this . _compareTwoRecords ( currentRec , nextRec , activityFields ) ;
38
38
if ( fieldChanges . fields . length > 0 )
39
39
historyArray . push ( fieldChanges ) ;
40
40
41
41
currentRec = hw . getWalkedRecordCopy ( ) ;
42
42
}
43
43
44
44
// Get Comments and Work Notes
45
- historyArray = this . arrayUtil . concat ( historyArray , this . getNotesComments ( ) ) ;
45
+ historyArray = this . arrayUtil . concat ( historyArray , this . _getNotesComments ( ) ) ;
46
46
47
47
// Get attachments
48
- historyArray = this . arrayUtil . concat ( historyArray , this . getAttachments ( ) ) ;
48
+ historyArray = this . arrayUtil . concat ( historyArray , this . _getAttachments ( ) ) ;
49
49
50
50
// Sort the element by date desc.
51
51
historyArray . sort ( function ( elem1 , elem2 ) {
@@ -103,7 +103,7 @@ ActivityStreamCollector.prototype = {
103
103
/**
104
104
* Get all attachments, which are related to the current record
105
105
*/
106
- getAttachments : function ( ) {
106
+ _getAttachments : function ( ) {
107
107
var attachments = [ ] ;
108
108
var saGr = new GlideRecord ( 'sys_attachment' ) ;
109
109
saGr . addQuery ( "table_name" , this . tableName ) ;
@@ -112,7 +112,7 @@ ActivityStreamCollector.prototype = {
112
112
while ( saGr . next ( ) ) {
113
113
attachments . push ( {
114
114
date : saGr . getDisplayValue ( "sys_created_on" ) ,
115
- userName : this . getUserDisplayName ( saGr . getValue ( "sys_created_by" ) ) ,
115
+ userName : this . _getUserDisplayName ( saGr . getValue ( "sys_created_by" ) ) ,
116
116
type : "attachment" ,
117
117
fileName : saGr . getValue ( "file_name" )
118
118
} ) ;
@@ -123,7 +123,7 @@ ActivityStreamCollector.prototype = {
123
123
/**
124
124
* This function collects and gives back the audited fields which are shown on the activity stream
125
125
*/
126
- getFirstHistory : function ( currGr , activityFields ) {
126
+ _getFirstHistory : function ( currGr , activityFields ) {
127
127
var fieldDataArray = [ ] ;
128
128
129
129
for ( var idxItem in activityFields ) {
@@ -152,7 +152,7 @@ ActivityStreamCollector.prototype = {
152
152
153
153
return {
154
154
date : currGr . getDisplayValue ( "sys_created_on" ) ,
155
- userName : this . getUserDisplayName ( currGr . getValue ( "sys_created_by" ) ) ,
155
+ userName : this . _getUserDisplayName ( currGr . getValue ( "sys_created_by" ) ) ,
156
156
type : "field_changes" ,
157
157
fields : fieldDataArray
158
158
} ;
@@ -161,7 +161,7 @@ ActivityStreamCollector.prototype = {
161
161
/**
162
162
* This function compares two records and gets all audited fields, where the content is different
163
163
*/
164
- compareTwoRecord : function ( currGr , nextGr , activityFields ) {
164
+ _compareTwoRecords : function ( currGr , nextGr , activityFields ) {
165
165
166
166
var fieldDataArray = [ ] ;
167
167
@@ -183,7 +183,7 @@ ActivityStreamCollector.prototype = {
183
183
184
184
return {
185
185
date : nextGr . getDisplayValue ( "sys_updated_on" ) ,
186
- userName : this . getUserDisplayName ( nextGr . getValue ( "sys_created_by" ) ) ,
186
+ userName : this . _getUserDisplayName ( nextGr . getValue ( "sys_created_by" ) ) ,
187
187
type : "field_changes" ,
188
188
fields : fieldDataArray
189
189
} ;
@@ -192,7 +192,7 @@ ActivityStreamCollector.prototype = {
192
192
/**
193
193
* Get Work notes, Comments from a record
194
194
*/
195
- getNotesComments : function ( ) {
195
+ _getNotesComments : function ( ) {
196
196
197
197
var noteArray = [ ] ;
198
198
@@ -203,7 +203,7 @@ ActivityStreamCollector.prototype = {
203
203
while ( journalGr . next ( ) ) {
204
204
noteArray . push ( {
205
205
date : journalGr . getDisplayValue ( "sys_created_on" ) ,
206
- userName : this . getUserDisplayName ( journalGr . getValue ( "sys_created_by" ) ) ,
206
+ userName : this . _getUserDisplayName ( journalGr . getValue ( "sys_created_by" ) ) ,
207
207
type : journalGr . getDisplayValue ( "element" ) ,
208
208
text : journalGr . getValue ( "value" ) ,
209
209
} ) ;
@@ -215,7 +215,7 @@ ActivityStreamCollector.prototype = {
215
215
/**
216
216
* Get user display name
217
217
*/
218
- getUserDisplayName : function ( userName ) {
218
+ _getUserDisplayName : function ( userName ) {
219
219
220
220
// A bit caching...
221
221
if ( this . users [ userName ] )
0 commit comments