Toggle menu
862
3.8K
30.2K
279.1K
Catglobe Wiki
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Task new: Difference between revisions

From Catglobe Wiki
Cg_pham (talk | contribs)
No edit summary
Nguyenduyan (talk | contribs)
No edit summary
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:Task_Functions]]
{{HelpFiles}}

 
== Task_new  ==


=====Task_new=====
Create new task object


Create new task object
'''Syntax'''


'''Syntax'''
Task_new(taskname, parentResourceId[, taskDescription][, taskTemplateResourceId])


Task_new(taskname, parentResourceId[, taskTemplateResourceId][, taskDescription])
'''Arguments'''


'''Arguments'''
*taskname: is string. It is the name of new task
*parentResourceId: is number. It is parent resource id of the new task
*taskDescription: is string. It is journal's description of task
*taskTemplateResourceId: is number. It is the template resource Id


* taskname: is string. It is the name of new task
* parentResourceId: is number. It is parent resource id of the new task
* taskTemplateResourceId: is number. It is the template resource Id
* taskDescription: is string. It is journal's description of task


'''Return value'''
'''Return value'''  


Array which is Task object:
Array which is Task object:  


{| class="tableintopic" style="border-collapse: collapse" width="1067" cellpadding="2"
{| class="tableintopic" style="border-collapse: collapse" width="1067" cellpadding="2"
|- align="left" valign="top"
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" bgcolor="#C0C0C0" |
| style="border: 1px solid #010101" width="356" bgcolor="#C0C0C0" |  
'''Index'''
'''Index'''  
| style="border: 1px solid #010101" width="356" bgcolor="#C0C0C0" |
 
'''Data type'''
| style="border: 1px solid #010101" width="356" bgcolor="#C0C0C0" |  
| style="border: 1px solid #010101" width="356" bgcolor="#C0C0C0" |
'''Data type'''  
'''Initial Value'''
 
|- align="left" valign="top"
| style="border: 1px solid #010101" width="356" bgcolor="#C0C0C0" |  
| width="356" |
'''Initial Value'''  
TASK_RESOURCE_ID
 
| width="356" |
|- style="border: 1px solid #010101" valign="top" align="left"
number
| width="356" |
| width="356" |
TASK_RESOURCE_ID
0
 
|- align="left" valign="top"
| style="border: 1px solid #010101" width="356" |
number
 
| style="border: 1px solid #010101" width="356" |
0
 
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_CASE_NUMBER
 
| style="border: 1px solid #010101" width="356" |
number
 
| style="border: 1px solid #010101" width="356" |
0
 
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_NAME
 
| style="border: 1px solid #010101" width="356" |
string
 
| style="border: 1px solid #010101" width="356" |
Entered value
 
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_PARENT_RESOURCE_ID
 
| style="border: 1px solid #010101" width="356" |
number
 
| style="border: 1px solid #010101" width="356" |
Entered value
 
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_TEMPLATE_RESOURCE_ID
 
| style="border: 1px solid #010101" width="356" |
number
 
| style="border: 1px solid #010101" width="356" |
Entered value (default if it is not specified)
 
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_TIME_REGISTRATION
 
| style="border: 1px solid #010101" width="356" |
bool
 
| style="border: 1px solid #010101" width="356" |
TRUE
 
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_COMPLETED
 
| style="border: 1px solid #010101" width="356" |
bool (read only)
 
| style="border: 1px solid #010101" width="356" |
FALSE
 
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_TESTCASE_RESOURCE_ID
 
| style="border: 1px solid #010101" width="356" |
number
 
| style="border: 1px solid #010101" width="356" |  
0 (Always = 0 if test case is not required)
 
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_RESPONSIBLE_RESOURCE_ID
 
| style="border: 1px solid #010101" width="356" |
number
 
| style="border: 1px solid #010101" width="356" |
0
 
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_SUPERVISOR_RESOURCE_ID
 
| style="border: 1px solid #010101" width="356" |
number
 
| style="border: 1px solid #010101" width="356" |
0
 
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_OBSERVER
 
| style="border: 1px solid #010101" width="356" |
array
 
| style="border: 1px solid #010101" width="356" |
(Explanation *)
 
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_OBSERVER_INHERIT_ACCESS
 
| style="border: 1px solid #010101" width="356" |
bool
 
| style="border: 1px solid #010101" width="356" |
FALSE
 
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_STATUS
 
| style="border: 1px solid #010101" width="356" |  
number (read only)
 
| style="border: 1px solid #010101" width="356" |
(Explanation **)&nbsp;<br>
 
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_ACCEPTANCE_DEADLINE
 
| style="border: 1px solid #010101" width="356" |  
array DateTime
 
| style="border: 1px solid #010101" width="356" |{1,1,1,1,0,0,0,1,40}
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_COMPLETION_DEADLINE
 
| style="border: 1px solid #010101" width="356" |
array DateTime
 
| style="border: 1px solid #010101" width="356" | {9999,12,31,23,59,59,999,52,40}
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_APPROVAL_DEADLINE
 
| style="border: 1px solid #010101" width="356" |
array DateTime
 
| style="border: 1px solid #010101" width="356" | {1,1,1,1,0,0,0,1,40}
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_ACTUAL_START_DATE
 
| style="border: 1px solid #010101" width="356" |
array DateTime (read only)
 
| style="border: 1px solid #010101" width="356" | {1,1,1,1,0,0,0,1,40}
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_ACTUAL_END_DATE
 
| style="border: 1px solid #010101" width="356" |
array DateTime (read only)
 
| style="border: 1px solid #010101" width="356" | {9999,12,31,23,59,59,999,52,40}
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_APPROVED_DATE
 
| style="border: 1px solid #010101" width="356" |
array DateTime (read only)
 
| style="border: 1px solid #010101" width="356" |{1,1,1,1,0,0,0,1,40}
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_MAN_HOURS
 
| style="border: 1px solid #010101" width="356" | number
 
| style="border: 1px solid #010101" width="356" |0
 
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_DESCRIPTION
 
| style="border: 1px solid #010101" width="356" | string
 
| style="border: 1px solid #010101" width="356" |Entered value (Task name is default if not specified)
 
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" | TASK_VERSION
 
| style="border: 1px solid #010101" width="356" | number (read only)
 
| style="border: 1px solid #010101" width="356" |0
 
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
| style="border: 1px solid #010101" width="356" |
TASK_CASE_NUMBER
TASK_CREATED_DATE
 
| style="border: 1px solid #010101" width="356" | array DateTime (read only)
 
| style="border: 1px solid #010101" width="356" |
| style="border: 1px solid #010101" width="356" |
number
 
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_MODIFIED_DATE
 
| style="border: 1px solid #010101" width="356" | array DateTime (read only)
 
| style="border: 1px solid #010101" width="356" |
| style="border: 1px solid #010101" width="356" |
0
 
|- align="left" valign="top"
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_RESPONSIBLE_NAME
 
| style="border: 1px solid #010101" width="356" | string  (read only)
 
| style="border: 1px solid #010101" width="356" |
| style="border: 1px solid #010101" width="356" |
TASK_NAME
 
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_SUPERVISOR_NAME
 
| style="border: 1px solid #010101" width="356" | string  (read only)
 
| style="border: 1px solid #010101" width="356" |
| style="border: 1px solid #010101" width="356" |
string
 
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_CURRENT_USER_IS_RESPONSIBLE
 
| style="border: 1px solid #010101" width="356" | bool  (read only)
 
| style="border: 1px solid #010101" width="356" |
| style="border: 1px solid #010101" width="356" |
Entered value
 
|- align="left" valign="top"
|- valign="top" align="left"
| style="border: 1px solid #010101" width="356" |
TASK_CURRENT_USER_IS_SUPERVISOR
 
| style="border: 1px solid #010101" width="356" | bool  (read only)
 
| style="border: 1px solid #010101" width="356" |
| style="border: 1px solid #010101" width="356" |
TASK_PARENT_RESOURCE_ID
|}
| style="border: 1px solid #010101" width="356" |
 
number
'''''Explanation *'''''
| style="border: 1px solid #010101" width="356" |
 
Entered value
TASK_OBSERVER:  
|- align="left" valign="top"
 
| style="border: 1px solid #010101" width="356" |
List of user or group which is observer of this task { {observer's resource id, control access, observer's name},...}
TASK_TEMPLATE_RESOURCE_ID
 
| style="border: 1px solid #010101" width="356" |
Ex: <nowiki>{{123,RESOURCE_ACCESS_OBSERVER, John Smith (JohnSmith)},{246,RESOURCE_ACCESS_MANAGER, Alice Sophia Eve (AliceAve)}}</nowiki>
number
 
| style="border: 1px solid #010101" width="356" |
Or:<nowiki>{{123,2, John Smith (JohnSmith)},{246,4, Alice Sophia Eve (AliceAve)}}</nowiki>
Entered value (default if it is not specified)
 
|- align="left" valign="top"
In which, control access constants are:  
| style="border: 1px solid #010101" width="356" |
 
TASK_TIME_REGISTRATION
{| class="tableintopic" style="border-collapse:collapse; border:1px solid #010101" width="444" cellspacing="0" cellpadding="2" border="1"
| style="border: 1px solid #010101" width="356" |
|- valign="top" align="left"
bool
| style="border:1px solid #010101;" width="120" bgcolor="#C0C0C0" |  
| style="border: 1px solid #010101" width="356" |
'''Index'''
TRUE
 
|- align="left" valign="top"
| style="border:1px solid #010101;" width="324" bgcolor="#C0C0C0" |  
| style="border: 1px solid #010101" width="356" |
'''Constant name'''
TASK_COMPLETED
 
| style="border: 1px solid #010101" width="356" |
|- valign="top" align="left"
bool (read only)
| style="border:1px solid #010101;" width="120" |  
| style="border: 1px solid #010101" width="356" |
2
FALSE
|- align="left" valign="top"
| style="border: 1px solid #010101" width="356" |
TASK_TESTCASE_RESOURCE_ID
| style="border: 1px solid #010101" width="356" |
number
| style="border: 1px solid #010101" width="356" |
0 (Always = 0 if test case is not required)
|- align="left" valign="top"
| style="border: 1px solid #010101" width="356" |
TASK_RESPONSIBLE_RESOURCE_ID
| style="border: 1px solid #010101" width="356" |
number
| style="border: 1px solid #010101" width="356" |
0
|- align="left" valign="top"
| style="border: 1px solid #010101" width="356" |
TASK_SUPERVISOR_RESOURCE_ID
| style="border: 1px solid #010101" width="356" |
number
| style="border: 1px solid #010101" width="356" |
0
|- align="left" valign="top"
| style="border: 1px solid #010101" width="356" |
TASK_OBSERVER
| style="border: 1px solid #010101" width="356" |
array
| style="border: 1px solid #010101" width="356" |
(Explanation *)
|- align="left" valign="top"
| style="border: 1px solid #010101" width="356" |
TASK_OBSERVER_INHERIT_ACCESS
| style="border: 1px solid #010101" width="356" |
bool
| style="border: 1px solid #010101" width="356" |
FALSE
|- align="left" valign="top"
| style="border: 1px solid #010101" width="356" |
TASK_STATUS
| style="border: 1px solid #010101" width="356" |
number (read only)
| style="border: 1px solid #010101" width="356" |
(Explanation **)


''Explanation *''
| style="border:1px solid #010101;" width="324" |
RESOURCE_ACCESS_OBSERVER


TASK_OBSERVER:
|- valign="top" align="left"
| style="border:1px solid #010101;" width="120" |
4


<nowiki>{{current user's resource id, "FullControl"}}</nowiki>
| style="border:1px solid #010101;" width="324" |
RESOURCE_ACCESS_MANAGER


List of user or group which is observer of this task { {observer's resource id, control access},...}
|- valign="top" align="left"
| style="border:1px solid #010101;" width="120" |
6


<nowiki>Ex: {{1,"RESOURCE_ACCESS_OBSERVER"},{2,"RESOURCE_ACCESS_MANAGER"}}</nowiki>
| style="border:1px solid #010101;" width="324" |
RESOURCE_ACCESS_ADMINISTRATOR


In which, control access constants are:
|}


* RESOURCE_ACCESS_OBSERVER
Observer's name can be set by function [[User_formatName]]
* RESOURCE_ACCESS_MANAGER
* RESOURCE_ACCESS_ADMINISTRATOR


''Explanation **''
'''''Explanation **'''''  


TASK_STATUS:
TASK_STATUS:  


Default value is 0
Default value is 0  


Constants:
Constants:  


{| class="tableintopic" style="border-collapse: collapse; border: 1px solid #010101" width="444" border="1" cellpadding="2"
{| class="tableintopic" style="border-collapse:collapse; border:1px solid #010101" width="444" cellspacing="0" cellpadding="2" border="1"
|- align="left" valign="top"
|- valign="top" align="left"
| style="border: 1px solid #010101" width="120" bgcolor="#C0C0C0" |
| style="border:1px solid #010101;" width="120" bgcolor="#C0C0C0" |  
'''Index'''
'''Index'''
| style="border: 1px solid #010101" width="324" bgcolor="#C0C0C0" |
 
| style="border:1px solid #010101;" width="324" bgcolor="#C0C0C0" |  
'''Constant name'''
'''Constant name'''
|- align="left" valign="top"
 
| style="border: 1px solid #010101" width="120" |
|- valign="top" align="left"
| style="border:1px solid #010101;" width="120" |  
0
0
| style="border: 1px solid #010101" width="324" |
 
| style="border:1px solid #010101;" width="324" |  
TASK_STATUS_NEEDACCEPTANCE
TASK_STATUS_NEEDACCEPTANCE
|- align="left" valign="top"
 
| style="border: 1px solid #010101" width="120" |
|- valign="top" align="left"
| style="border:1px solid #010101;" width="120" |  
1
1
| style="border: 1px solid #010101" width="324" |
 
| style="border:1px solid #010101;" width="324" |  
TASK_STATUS_INPROGRESS
TASK_STATUS_INPROGRESS
|- align="left" valign="top"
 
| style="border: 1px solid #010101" width="120" |
|- valign="top" align="left"
| style="border:1px solid #010101;" width="120" |  
2
2
| style="border: 1px solid #010101" width="324" |
 
| style="border:1px solid #010101;" width="324" |  
TASK_STATUS_APPROVED
TASK_STATUS_APPROVED
|- align="left" valign="top"
 
| style="border: 1px solid #010101" width="120" |
|- valign="top" align="left"
| style="border:1px solid #010101;" width="120" |  
3
3
| style="border: 1px solid #010101" width="324" |
 
| style="border:1px solid #010101;" width="324" |  
TASK_STATUS_AWAITINGAPPROVAL
TASK_STATUS_AWAITINGAPPROVAL
|}


'''Example'''
'''Example'''


string bulkMailName = "TestBulkMail";
<source lang="javascript">
string taskname = "Test Task";
number responsibleRId = 14042920;
number supervisorRId = 12344998;
number observerRId = 10768810;
number parentResourceId = 11088827;
number taskTemplateResourceId = 2072;
array task = Task_new(taskname, parentResourceId, taskTemplateResourceId);
task[TASK_RESPONSIBLE_RESOURCE_ID] = responsibleRId;
task[TASK_SUPERVISOR_RESOURCE_ID ] = supervisorRId;
task[TASK_OBSERVER]={{observerRId, 2, User_formatName(User_getUserByResourceId(observerRId))}};
task[TASK_ACCEPTANCE_DEADLINE]=DateTime_getByYMD(2017,10,18);
task[TASK_COMPLETION_DEADLINE]=DateTime_getByYMD(2017,10,21);
task[TASK_APPROVAL_DEADLINE]=DateTime_getByYMD(2017,10,30);
task[TASK_DESCRIPTION]="This task with high priority";
Task_save(task);
</source>


number parentResourceId = 34778803;
'''Availability'''


number mailTemplateResourceId = 501537;
Version 5.8


array newBM = BulkMail_new(bulkMailName, parentResourceId, mailTemplateResourceId);
__FORCETOC__ <!-- imported from file: 7607.htm-->


print(newBM);
[[Category:Task_Functions]]
 
'''Availability'''
 
Version 5.8
__NOTOC__
<!-- imported from file: 7607.htm-->

Latest revision as of 07:30, 17 October 2017



Task_new

Create new task object

Syntax

Task_new(taskname, parentResourceId[, taskDescription][, taskTemplateResourceId])

Arguments

  • taskname: is string. It is the name of new task
  • parentResourceId: is number. It is parent resource id of the new task
  • taskDescription: is string. It is journal's description of task
  • taskTemplateResourceId: is number. It is the template resource Id


Return value

Array which is Task object:

Index

Data type

Initial Value

TASK_RESOURCE_ID

number

0

TASK_CASE_NUMBER

number

0

TASK_NAME

string

Entered value

TASK_PARENT_RESOURCE_ID

number

Entered value

TASK_TEMPLATE_RESOURCE_ID

number

Entered value (default if it is not specified)

TASK_TIME_REGISTRATION

bool

TRUE

TASK_COMPLETED

bool (read only)

FALSE

TASK_TESTCASE_RESOURCE_ID

number

0 (Always = 0 if test case is not required)

TASK_RESPONSIBLE_RESOURCE_ID

number

0

TASK_SUPERVISOR_RESOURCE_ID

number

0

TASK_OBSERVER

array

(Explanation *)

TASK_OBSERVER_INHERIT_ACCESS

bool

FALSE

TASK_STATUS

number (read only)

(Explanation **) 

TASK_ACCEPTANCE_DEADLINE

array DateTime

{1,1,1,1,0,0,0,1,40}

TASK_COMPLETION_DEADLINE

array DateTime

{9999,12,31,23,59,59,999,52,40}

TASK_APPROVAL_DEADLINE

array DateTime

{1,1,1,1,0,0,0,1,40}

TASK_ACTUAL_START_DATE

array DateTime (read only)

{1,1,1,1,0,0,0,1,40}

TASK_ACTUAL_END_DATE

array DateTime (read only)

{9999,12,31,23,59,59,999,52,40}

TASK_APPROVED_DATE

array DateTime (read only)

{1,1,1,1,0,0,0,1,40}

TASK_MAN_HOURS

number 0

TASK_DESCRIPTION

string Entered value (Task name is default if not specified)
TASK_VERSION number (read only) 0

TASK_CREATED_DATE

array DateTime (read only)

TASK_MODIFIED_DATE

array DateTime (read only)

TASK_RESPONSIBLE_NAME

string (read only)

TASK_SUPERVISOR_NAME

string (read only)

TASK_CURRENT_USER_IS_RESPONSIBLE

bool (read only)

TASK_CURRENT_USER_IS_SUPERVISOR

bool (read only)

Explanation *

TASK_OBSERVER:

List of user or group which is observer of this task { {observer's resource id, control access, observer's name},...}

Ex: {{123,RESOURCE_ACCESS_OBSERVER, John Smith (JohnSmith)},{246,RESOURCE_ACCESS_MANAGER, Alice Sophia Eve (AliceAve)}}

Or:{{123,2, John Smith (JohnSmith)},{246,4, Alice Sophia Eve (AliceAve)}}

In which, control access constants are:

Index

Constant name

2

RESOURCE_ACCESS_OBSERVER

4

RESOURCE_ACCESS_MANAGER

6

RESOURCE_ACCESS_ADMINISTRATOR

Observer's name can be set by function User_formatName

Explanation **

TASK_STATUS:

Default value is 0

Constants:

Index

Constant name

0

TASK_STATUS_NEEDACCEPTANCE

1

TASK_STATUS_INPROGRESS

2

TASK_STATUS_APPROVED

3

TASK_STATUS_AWAITINGAPPROVAL

Example

string taskname = "Test Task";
number responsibleRId = 14042920;
number supervisorRId = 12344998;
number observerRId = 10768810;
number parentResourceId = 11088827;
number taskTemplateResourceId = 2072;
array task = Task_new(taskname, parentResourceId, taskTemplateResourceId);
task[TASK_RESPONSIBLE_RESOURCE_ID] = responsibleRId;
task[TASK_SUPERVISOR_RESOURCE_ID ] = supervisorRId;
task[TASK_OBSERVER]={{observerRId, 2, User_formatName(User_getUserByResourceId(observerRId))}};
task[TASK_ACCEPTANCE_DEADLINE]=DateTime_getByYMD(2017,10,18);
task[TASK_COMPLETION_DEADLINE]=DateTime_getByYMD(2017,10,21);
task[TASK_APPROVAL_DEADLINE]=DateTime_getByYMD(2017,10,30);
task[TASK_DESCRIPTION]="This task with high priority";
Task_save(task);

Availability

Version 5.8

Contents