-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProcessBase_Table_Element.php
More file actions
164 lines (133 loc) · 3.98 KB
/
Copy pathProcessBase_Table_Element.php
File metadata and controls
164 lines (133 loc) · 3.98 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<?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_Table_Element extends WgtTable
{
/*//////////////////////////////////////////////////////////////////////////////
// attributes
//////////////////////////////////////////////////////////////////////////////*/
/**
* @var string $id
*/
public $id = 'wgt-table-process-base-history';
/**
* @var array
*/
public $classes = array('full');
/**
* the most likley class of a given query object
*
* @var ProcesBase_Query
*/
public $data = null;
/**
*
* @var array
*/
public $url = array
(
'paging' => array
(
Wgt::ACTION_PAGING ,
'index.php?c=Widget.UserTask.reload'
),
'checkbox' => array
(
Wgt::ACTION_CHECKBOX,
'select',
null,
null,
null,
'wbf.label.select'
),
);
/*//////////////////////////////////////////////////////////////////////////////
// context: table
//////////////////////////////////////////////////////////////////////////////*/
/**
* create the head for the table
* @return string
*/
public function buildThead()
{
$this->numCols = 4;
if ($this->enableNav)
++ $this->numCols;
// Creating the Head
$html = '<thead>'.NL;
$html .= '<tr>'.NL;
$html .= '<th style="width:30px" >Pos.</th>'.NL;
$html .= '<th style="width:230px" >User</th>'.NL;
$html .= '<th style="width:70px" >Date</th>'.NL;
$html .= '<th style="width:180px" >Step</th>'.NL;
$html .= '<th>Comment</th>'.NL;
$html .= '<th style="width:80px" >Rating</th>'.NL;
// the default navigation col
/*
if ($this->enableNav)
$html .= '<th style="width:70px;">'.$this->i18n->l('Nav.', 'wbf.label' ).'</th>'.NL;
*/
$html .= '</tr>'.NL;
$html .= '</thead>'.NL;
//\ Creating the Head
return $html;
}//end public function buildThead */
/**
* create the body for the table
* @return string
*/
public function buildTbody()
{
$body = '<tbody>'.NL;
// simple switch method to create collored rows
$pos = 1;
$num = 1;
foreach ($this->data as $key => $row) {
$objid = $row['rowid'];
$rowid = $this->id.'_row_'.$objid;
$body .= '<tr class="row'.$num.'" id="'.$rowid.'" >'.NL;
$body .= '<td valign="top" class="pos" >'.$pos.'</td>'.NL;
$body .= '<td valign="top" >('.$row['wbfsys_role_user_name'].') '.$row['core_person_lastname'].', '.$row['core_person_firstname'].' </td>'.NL;
$body .= '<td valign="top" >'.(!is_null($row['m_time_created'])?$this->view->i18n->timestamp($row['m_time_created']):'').'</td>'.NL;
$body .= '<td valign="top" >'.$row['node_from_name'].'<br /> => <br />'.$row['node_to_name'].'</td>'.NL;
$body .= '<td valign="top" >'.Validator::sanitizeHtml($row['comment']).'</td>'.NL;
$body .= '<td valign="top" >'.$row['rate'].'</td>'.NL;
$body .= '</tr>'.NL;
$pos ++;
$num ++;
if ($num > $this->numOfColors)
$num = 1;
} //end foreach
$body .= '</tbody>'.NL;
//\ Create the table body
return $body;
}//end public function buildTbody */
/**
* @return string
*/
public function buildTableFooter()
{
$html = ' <div class="wgt-panel wgt-border-top" >';
$html .= '</div>'.NL;
return $html;
}//end public function buildTableFooter */
}//end class UserProjectTask_Table