-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProcessBase_Modal_View.php
More file actions
142 lines (114 loc) · 3.5 KB
/
Copy pathProcessBase_Modal_View.php
File metadata and controls
142 lines (114 loc) · 3.5 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?php
/*******************************************************************************
*
* @author : Dominik Bonsch <[email protected]>
* @date :
* @copyright : Webfrap Developer Network <[email protected]>
* @project : Webfrap Web Frame Application
* @projectUrl : http://webfrap.net
*
* @licence : BSD License see: LICENCE/BSD Licence.txt
*
* @version: @package_version@ Revision: @package_revision@
*
* Changes:
*
*******************************************************************************/
/**
* @package WebFrap
* @subpackage Core
* @author Dominik Bonsch <[email protected]>
* @copyright Webfrap Developer Network <[email protected]>
*/
class ProcessBase_Modal_View extends WgtModal
{
/*//////////////////////////////////////////////////////////////////////////////
// Attributes
//////////////////////////////////////////////////////////////////////////////*/
/**
* @var ProcessBase_Model
*/
public $model = null;
/**
* @var int
*/
public $height = 550;
/**
* @var int
*/
public $width = 850;
/*//////////////////////////////////////////////////////////////////////////////
// method
//////////////////////////////////////////////////////////////////////////////*/
/**
* the default edit form
*
* @param int $process
* @param TFlag $params
*
* @return null|Error im Fehlerfall
*/
public function displayHistory($process, $params)
{
$request = $this->getRequest();
// set the window title
$this->setTitle('Process History');
// set the window status text
$this->setStatus('Process History');
// set the from template
$this->setTemplate('process/history');
$table = $this->createElement('historyTable' , 'ProcessBase_Table');
$table->setData($this->model->getProcessEdges($process));
$table->buildHtml();
$this->addVar('entity', $this->model->getEntity());
return null;
}//end public function displayHistory */
/**
* add a drop menu to the create window
*
* @param TFlag $params the named parameter object that was created in
* the controller
* {
* string formId: the id of the form;
* }
*/
public function addMenu($objid, $params)
{
$menu = $this->newMenu(
$this->id.'_dropmenu',
'ProcessBase'
);
$menu->id = $this->id.'_dropmenu';
$menu->buildMenu($objid, $params);
return true;
}//end public function addMenu */
/**
* just add the code for the edit ui controlls
*
* @param TFlag $params the named parameter object that was created in
* the controller
* {
* string formId: the id of the form;
* }
*/
public function addActions($objid, $params)
{
// add the button action for save in the window
// the code will be binded direct on a window object and is removed
// on close
// all buttons with the class save will call that action
$code = <<<BUTTONJS
self.getObject().find(".wgtac_edit").click(function() {
self.setChanged(false);
\$R.form('{$params->formId}');
}).removeClass("wgtac_edit");
self.getObject().find(".wgtac_show").click(function() {
\$R.get('modal.php?c=Project.Constraint.show&objid={$objid}');
}).removeClass("wgtac_show");
self.getObject().find(".wgtac_metadata").click(function() {
\$R.get('modal.php?c=Project.Constraint.showMeta&objid={$objid}');
}).removeClass("wgtac_metadata");
BUTTONJS;
$this->addJsCode($code);
}//end public function addActions */
}//end class ProcessBase_Modal_View