-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVTWorkflowApplication.inc
75 lines (66 loc) · 2.26 KB
/
VTWorkflowApplication.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
/*+**********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
************************************************************************************/
class VTWorkflowApplication{
function __construct($action){
global $_REQUEST;
$this->request;
$this->name = "com_vtiger_workflow";
$this->label = "Workflow";
$this->action = $action;
$this->returnUrl = $_SERVER["REQUEST_URI"];
}
function currentUrl(){
// $req = $this->request;
// $url = "index.php?module={$this->name}&action={$this->action}";
// if($this->action=='editworkflow'){
// if(isset($req['workflow_id'])){
// $url.="&workflow_id=".$req['workflow_id'];
// }
// }else if($this->action=='edittask'){
// if(isset($req['task_id'])){
// $url.="&task_id=".$req['task_id'];
// }
// }
return $_SERVER["REQUEST_URI"];
}
function returnUrl(){
return $this->returnUrl;
}
function listViewUrl(){
return "index.php?module={$this->name}&action=workflowlist";
}
function editWorkflowUrl($id=null){
if($id!=null){
$idPart="&workflow_id=$id";
}
return "index.php?module={$this->name}&action=editworkflow$idPart&return_url=".urlencode($this->returnUrl());
}
function deleteWorkflowUrl($id){
$idPart="&workflow_id=$id";
return "index.php?module={$this->name}&action=deleteworkflow$idPart&return_url=".urlencode($this->returnUrl());
}
function editTaskUrl($id=null){
if($id!=null){
$idPart="&task_id=$id";
}
return "index.php?module={$this->name}&action=edittask$idPart&return_url=".urlencode($this->returnUrl());
}
function deleteTaskUrl($id){
$idPart="&task_id=$id";
return "index.php?module={$this->name}&action=deletetask$idPart&return_url=".urlencode($this->returnUrl());
}
function setReturnUrl($returnUrl){
$this->returnUrl = $returnUrl;
}
function errorPageUrl($message){
return "index.php?module={$this->name}&action=errormessage&message=".urlencode($message);
}
}
?>