Skip to content

Commit eb0f997

Browse files
authored
Update ActivityCollector.js
1 parent 344237c commit eb0f997

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

GlideRecord/Record Activity Collector/ActivityCollector.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,25 @@ ActivityStreamCollector.prototype = {
2727
activityFields = activityFields.split(",");
2828

2929
// Collect the initial data
30-
var initialHistoryData = this.getFirstHistory(currentRec, activityFields);
30+
var initialHistoryData = this._getFirstHistory(currentRec, activityFields);
3131

3232
// Walking through the history data
3333
while (hw.walkForward()) {
3434
var nextRec = hw.getWalkedRecord();
3535

3636
// Get all field changes
37-
var fieldChanges = this.compareTwoRecord(currentRec, nextRec, activityFields);
37+
var fieldChanges = this._compareTwoRecords(currentRec, nextRec, activityFields);
3838
if (fieldChanges.fields.length > 0)
3939
historyArray.push(fieldChanges);
4040

4141
currentRec = hw.getWalkedRecordCopy();
4242
}
4343

4444
// Get Comments and Work Notes
45-
historyArray = this.arrayUtil.concat(historyArray, this.getNotesComments());
45+
historyArray = this.arrayUtil.concat(historyArray, this._getNotesComments());
4646

4747
// Get attachments
48-
historyArray = this.arrayUtil.concat(historyArray, this.getAttachments());
48+
historyArray = this.arrayUtil.concat(historyArray, this._getAttachments());
4949

5050
// Sort the element by date desc.
5151
historyArray.sort(function(elem1, elem2) {
@@ -103,7 +103,7 @@ ActivityStreamCollector.prototype = {
103103
/**
104104
* Get all attachments, which are related to the current record
105105
*/
106-
getAttachments: function() {
106+
_getAttachments: function() {
107107
var attachments = [];
108108
var saGr = new GlideRecord('sys_attachment');
109109
saGr.addQuery("table_name", this.tableName);
@@ -112,7 +112,7 @@ ActivityStreamCollector.prototype = {
112112
while (saGr.next()) {
113113
attachments.push({
114114
date: saGr.getDisplayValue("sys_created_on"),
115-
userName: this.getUserDisplayName(saGr.getValue("sys_created_by")),
115+
userName: this._getUserDisplayName(saGr.getValue("sys_created_by")),
116116
type: "attachment",
117117
fileName: saGr.getValue("file_name")
118118
});
@@ -123,7 +123,7 @@ ActivityStreamCollector.prototype = {
123123
/**
124124
* This function collects and gives back the audited fields which are shown on the activity stream
125125
*/
126-
getFirstHistory: function(currGr, activityFields) {
126+
_getFirstHistory: function(currGr, activityFields) {
127127
var fieldDataArray = [];
128128

129129
for (var idxItem in activityFields) {
@@ -152,7 +152,7 @@ ActivityStreamCollector.prototype = {
152152

153153
return {
154154
date: currGr.getDisplayValue("sys_created_on"),
155-
userName: this.getUserDisplayName(currGr.getValue("sys_created_by")),
155+
userName: this._getUserDisplayName(currGr.getValue("sys_created_by")),
156156
type: "field_changes",
157157
fields: fieldDataArray
158158
};
@@ -161,7 +161,7 @@ ActivityStreamCollector.prototype = {
161161
/**
162162
* This function compares two records and gets all audited fields, where the content is different
163163
*/
164-
compareTwoRecord: function(currGr, nextGr, activityFields) {
164+
_compareTwoRecords: function(currGr, nextGr, activityFields) {
165165

166166
var fieldDataArray = [];
167167

@@ -183,7 +183,7 @@ ActivityStreamCollector.prototype = {
183183

184184
return {
185185
date: nextGr.getDisplayValue("sys_updated_on"),
186-
userName: this.getUserDisplayName(nextGr.getValue("sys_created_by")),
186+
userName: this._getUserDisplayName(nextGr.getValue("sys_created_by")),
187187
type: "field_changes",
188188
fields: fieldDataArray
189189
};
@@ -192,7 +192,7 @@ ActivityStreamCollector.prototype = {
192192
/**
193193
* Get Work notes, Comments from a record
194194
*/
195-
getNotesComments: function() {
195+
_getNotesComments: function() {
196196

197197
var noteArray = [];
198198

@@ -203,7 +203,7 @@ ActivityStreamCollector.prototype = {
203203
while (journalGr.next()) {
204204
noteArray.push({
205205
date: journalGr.getDisplayValue("sys_created_on"),
206-
userName: this.getUserDisplayName(journalGr.getValue("sys_created_by")),
206+
userName: this._getUserDisplayName(journalGr.getValue("sys_created_by")),
207207
type: journalGr.getDisplayValue("element"),
208208
text: journalGr.getValue("value"),
209209
});
@@ -215,7 +215,7 @@ ActivityStreamCollector.prototype = {
215215
/**
216216
* Get user display name
217217
*/
218-
getUserDisplayName: function(userName) {
218+
_getUserDisplayName: function(userName) {
219219

220220
// A bit caching...
221221
if (this.users[userName])

0 commit comments

Comments
 (0)