Difference between revisions of "ActivityHistory class"

From Catglobe Wiki
Jump to: navigation, search
(Created page with "{{CGscriptClass_Template |Name=<nowiki>ActivityHistory</nowiki> |Description=<nowiki>Activities by users.</nowiki> |Methods= {{CGscriptMethods_Template|ReturnType=Empty|Name=<...")
 
 
(5 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
|Name=<nowiki>ActivityHistory</nowiki>
 
|Name=<nowiki>ActivityHistory</nowiki>
 
|Description=<nowiki>Activities by users.</nowiki>
 
|Description=<nowiki>Activities by users.</nowiki>
|Methods=
+
|InheritsFrom=object|Methods=
 
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>OrderByDate</nowiki>|Description=<nowiki>Order the data by date</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>OrderByDate</nowiki>|Description=<nowiki>Order the data by date</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>OrderByDateDesc</nowiki>|Description=<nowiki>Order the data by date descending</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>OrderByDateDesc</nowiki>|Description=<nowiki>Order the data by date descending</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>OrderByUserThenByDate</nowiki>|Description=<nowiki>Order the data by user, then by date</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>OrderByUserThenByDate</nowiki>|Description=<nowiki>Order the data by user, then by date</nowiki>}}
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>OrderByUserThenByDate</nowiki>|Description=<nowiki>Order the data by user, then by date descending</nowiki>}}
+
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>OrderByUserThenByDateDesc</nowiki>|Description=<nowiki>Order the data by user, then by date descending</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>SetCurrent</nowiki>|Parameters=
 
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>SetCurrent</nowiki>|Parameters=
 
{{CGscriptParameters_Template|Type=int|Name=<nowiki>index</nowiki>|Description=<nowiki>Index to look up</nowiki>}}
 
{{CGscriptParameters_Template|Type=int|Name=<nowiki>index</nowiki>|Description=<nowiki>Index to look up</nowiki>}}
 
|Description=<nowiki>Set the current activity to look at</nowiki>}}
 
|Description=<nowiki>Set the current activity to look at</nowiki>}}
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Description=<nowiki>The string representation of the object.</nowiki>}}
+
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Inherited=object|Description=<nowiki>The string representation of the object.</nowiki>}}
 
|Properties=
 
|Properties=
 
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>AccessLevelToActivity</nowiki>|HasGetter=1|Description=<nowiki>Level of access to activity. See RESOURCE_PERMISSION_*</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>AccessLevelToActivity</nowiki>|HasGetter=1|Description=<nowiki>Level of access to activity. See RESOURCE_PERMISSION_*</nowiki>}}
Line 16: Line 16:
 
{{CGscriptProperties_Template|ReturnType=DateTime|Name=<nowiki>Date</nowiki>|HasGetter=1|Description=<nowiki>Get main created or occured date activity</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=DateTime|Name=<nowiki>Date</nowiki>|HasGetter=1|Description=<nowiki>Get main created or occured date activity</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>Description</nowiki>|HasGetter=1|Description=<nowiki>Description of activity, may be empty if not enough permission to read this info</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>Description</nowiki>|HasGetter=1|Description=<nowiki>Description of activity, may be empty if not enough permission to read this info</nowiki>}}
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>FromUserId</nowiki>|HasGetter=1|Description=<nowiki>Get id of the user that created activity</nowiki>}}
 
 
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>HistoryType</nowiki>|HasGetter=1|Description=<nowiki>Type of activity</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>HistoryType</nowiki>|HasGetter=1|Description=<nowiki>Type of activity</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>HistoryTypeAsString</nowiki>|HasGetter=1|Description=<nowiki>Type of activity as string</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>HistoryTypeAsString</nowiki>|HasGetter=1|Description=<nowiki>Type of activity as string</nowiki>}}
Line 22: Line 21:
 
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>Id</nowiki>|HasGetter=1|Description=<nowiki>Get main id for the activity, this could be the journal resource id</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>Id</nowiki>|HasGetter=1|Description=<nowiki>Get main id for the activity, this could be the journal resource id</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}}
 +
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>OtherUserId</nowiki>|HasGetter=1|Obsolete=1
 +
|Description=<nowiki>[Obsolete]Get id of the other user in the activity, if there is one</nowiki>}}
 +
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>OtherUserResourceId</nowiki>|HasGetter=1|Description=<nowiki>Get id of the other user in the activity, if there is one</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>ParentResourceId</nowiki>|HasGetter=1|Description=<nowiki>Main parent of the communucation, usually the questionnaire or user of the activity</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>ParentResourceId</nowiki>|HasGetter=1|Description=<nowiki>Main parent of the communucation, usually the questionnaire or user of the activity</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ParentResourcePath</nowiki>|HasGetter=1|Description=<nowiki>Main parent path of the communucation, usually the questionnaire or user of the activity</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ParentResourcePath</nowiki>|HasGetter=1|Description=<nowiki>Main parent path of the communucation, usually the questionnaire or user of the activity</nowiki>}}
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>ToUserId</nowiki>|HasGetter=1|Description=<nowiki>Get id of the user that received activity</nowiki>}}
+
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>ToUserId</nowiki>|HasGetter=1|Obsolete=1
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>ToUserResourceId</nowiki>|HasGetter=1|Description=<nowiki>Get resource id of the user that received activity</nowiki>}}
+
|Description=<nowiki>[Obsolete]Get id of the user of the activity</nowiki>}}
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Description=<nowiki>Get information about this class.</nowiki>}}
+
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Inherited=object|Description=<nowiki>Get information about this class.</nowiki>}}
 +
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>UserResourceId</nowiki>|HasGetter=1|Description=<nowiki>Get resource id of the user of the activity</nowiki>}}
 
}}
 
}}
 +
 +
=== <span style="color:#DF8621">'''Examples'''</span> ===
 +
 +
<source lang="javascript">
 +
//get mail, bulkmail history
 +
array userRid = {15210};
 +
ActivityHistorySearch search = new ActivityHistorySearch(userRid);
 +
search.SearchForMails = true;
 +
search.SearchForBulkMails = true;
 +
search.SearchForSMS = false;
 +
search.SearchForBulkSMS = false;
 +
search.SearchForCati = false;
 +
search.SearchForDialedCati = false;
 +
search.SearchForJournal = false;
 +
search.SearchForQuestionnaireActivity = false;
 +
DateTime dateFrom = new DateTime ("2016/1/30");
 +
search.SetSearchStartPeriod(dateFrom);
 +
ActivityHistory result = search.Execute();
 +
result.OrderByDate();
 +
for(number i = 0; i< result.Count; i++)
 +
{
 +
result.SetCurrent(i);
 +
print(result.ParentResourcePath );
 +
}
 +
</source>

Latest revision as of 05:54, 23 December 2022

ActivityHistory



Activities by users.

Parent class

Inherits from object

Methods

  • Empty OrderByDate() - Order the data by date
  • Empty OrderByDateDesc() - Order the data by date descending
  • Empty OrderByUserThenByDate() - Order the data by user, then by date
  • Empty OrderByUserThenByDateDesc() - Order the data by user, then by date descending
  • Empty SetCurrent(int index "Index to look up") - Set the current activity to look at
  • (From object) string ToString() - The string representation of the object.

Properties

  • int AccessLevelToActivity { get; } - Level of access to activity. See RESOURCE_PERMISSION_*
  • int Count { get; } - Number of history entries
  • DateTime Date { get; } - Get main created or occured date activity
  • string Description { get; } - Description of activity, may be empty if not enough permission to read this info
  • int HistoryType { get; } - Type of activity
  • string HistoryTypeAsString { get; } - Type of activity as string
  • int HistoryTypeSpecificId { get; } - Some activities have secondary ids that may contain more information. May be 0 if not enough access
  • int Id { get; } - Get main id for the activity, this could be the journal resource id
  • string ObjectTypeName { get; } - The name of the type of object.
  • int OtherUserId { get; } - [Obsolete]Get id of the other user in the activity, if there is one
  • int OtherUserResourceId { get; } - Get id of the other user in the activity, if there is one
  • int ParentResourceId { get; } - Main parent of the communucation, usually the questionnaire or user of the activity
  • string ParentResourcePath { get; } - Main parent path of the communucation, usually the questionnaire or user of the activity
  • int ToUserId { get; } - [Obsolete]Get id of the user of the activity
  • (From object) TypeInformation TypeInformation { get; } - Get information about this class.
  • int UserResourceId { get; } - Get resource id of the user of the activity


Examples

//get mail, bulkmail history 
array userRid = {15210};
ActivityHistorySearch search = new ActivityHistorySearch(userRid);
search.SearchForMails = true;
search.SearchForBulkMails = true;
search.SearchForSMS = false;
search.SearchForBulkSMS = false;
search.SearchForCati = false;
search.SearchForDialedCati = false;
search.SearchForJournal = false;
search.SearchForQuestionnaireActivity = false;
DateTime dateFrom = new DateTime ("2016/1/30");
search.SetSearchStartPeriod(dateFrom);
ActivityHistory result = search.Execute();
result.OrderByDate();
for(number i = 0; i< result.Count; i++)
{
	result.SetCurrent(i);
	print(result.ParentResourcePath );
}