5 require_once
'./Services/Table/classes/class.ilTable2GUI.php';
7 require_once
'./Services/Form/classes/class.ilTextInputGUI.php';
9 require_once
'./Services/Form/classes/class.ilCheckboxInputGUI.php';
11 require_once
'./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
37 public function __construct($parent_obj, $parent_cmd, $template_context =
"")
39 $this->
setId(
'wfedef');
40 parent::__construct($parent_obj, $parent_cmd, $template_context);
43 $this->
ilCtrl = $DIC[
'ilCtrl'];
44 $this->lng = $DIC[
'lng'];
53 $this->
setRowTemplate(
"tpl.wfe_def_row.html",
"Services/WorkflowEngine");
56 $this->
setTitle($this->lng->txt(
"definitions"));
64 $title_filter_input =
new ilTextInputGUI($this->lng->txt(
"title"),
"title");
66 $title_filter_input->setSize(20);
68 $title_filter_input->readFromSession();
69 $this->filter[
"title"] = $title_filter_input->getValue();
71 $instances_filter_input =
new ilCheckboxInputGUI($this->lng->txt(
'instances'),
'instances');
73 $instances_filter_input->readFromSession();
74 $this->filter[
'instances'] = $instances_filter_input->getChecked();
82 $this->
addColumn($this->lng->txt(
"title"),
"title",
"20%");
86 if(in_array(
'file', $selected_columns))
88 $this->
addColumn($this->lng->txt(
"file"),
"file",
"30%");
91 if(in_array(
'version', $selected_columns))
93 $this->
addColumn($this->lng->txt(
"version"),
"version",
"10%");
96 if(in_array(
'status', $selected_columns))
98 $this->
addColumn($this->lng->txt(
"status"),
"status",
"10%");
101 if(in_array(
'instances', $selected_columns))
103 $this->
addColumn($this->lng->txt(
"instances"),
"instances",
"15%");
106 $this->
addColumn($this->lng->txt(
"actions"),
"",
"10%");
115 $cols[
"file"] =
array(
116 "txt" => $this->lng->txt(
"file"),
118 $cols[
"version"] =
array(
119 "txt" => $this->lng->txt(
"version"),
121 $cols[
"status"] =
array(
122 "txt" => $this->lng->txt(
"status"),
124 $cols[
"instances"] =
array(
125 "txt" => $this->lng->txt(
"instances"),
136 $ilDB = $DIC[
'ilDB'];
137 $query =
'SELECT workflow_class, count(workflow_id) total, sum(active) active 139 GROUP BY workflow_class';
144 $stats[
$row[
'workflow_class']] =
array(
'total' => $row[
'total'],
'active' => $row[
'active'] );
154 $base_list =
array();
155 foreach($entries as $entry)
157 if( $entry ==
'.' || $entry ==
'..' )
162 if(substr($entry, strlen($entry)-6) ==
'.bpmn2')
164 $file_entry =
array();
165 $file_entry[
'file'] = $entry;
166 $file_entry[
'id'] = substr($entry, 0, strlen($entry)-6);
167 $parts = explode(
'_', substr($entry, 6, strlen($entry)-12));
169 $file_entry[
'status'] =
'OK';
172 $file_entry[
'status'] = $this->lng->txt(
'missing_parsed_class');
175 $file_entry[
'version'] = substr(array_pop($parts),1);
176 $file_entry[
'title'] = implode(
' ', $parts);
177 $file_entry[
'instances'] = $stats[$file_entry[
'id'].
'.php'];
181 $base_list[] = $file_entry;
200 if($title_filter->getValue() != null)
202 if(strpos(strtolower(
$row[
'title']),strtolower($title_filter->getValue())) ===
false)
210 if($instances_filter->getChecked() &&
$row[
'instances'][
'active'] == 0)
224 $this->tpl->setVariable(
'VAL_TITLE', $set[
'title']);
228 if(in_array(
'file', $selected_columns))
230 $this->tpl->setVariable(
'VAL_FILE', $set[
'file']);
233 if(in_array(
'version', $selected_columns))
235 $this->tpl->setVariable(
'VAL_VERSION', $set[
'version']);
238 if(in_array(
'status', $selected_columns))
240 if($set[
'status'] !=
'OK')
242 $this->tpl->setVariable(
'VAL_STATUS', $set[
'status']);
246 $this->tpl->setVariable(
'VAL_STATUS', $this->lng->txt(
'ok'));
250 if(in_array(
'instances', $selected_columns))
252 $this->tpl->setVariable(
'TXT_INSTANCES_TOTAL', $this->lng->txt(
'total'));
253 $this->tpl->setVariable(
'VAL_INSTANCES_TOTAL', 0+$set[
'instances'][
'total']);
254 $this->tpl->setVariable(
'TXT_INSTANCES_ACTIVE', $this->lng->txt(
'active'));
255 $this->tpl->setVariable(
'VAL_INSTANCES_ACTIVE', 0+$set[
'instances'][
'active']);
259 $action->setId(
'asl_' . $set[
'id']);
260 $action->setListTitle($this->lng->txt(
'actions'));
263 $this->lng->txt(
'start_process'),
268 if(0+$set[
'instances'][
'active'] == 0)
271 $this->lng->txt(
'delete_definition'),
278 $class = substr($set[
'id'],4);
279 if($class::$startEventRequired ==
true)
282 $this->lng->txt(
'start_listening'),
288 $this->lng->txt(
'stop_listening'),
294 $this->tpl->setVariable(
'HTML_ASL', $action->getHTML());
setParameter($a_obj, $a_parameter, $a_value)
Set parameters that should be passed a form and link of a gui class.
This class provides processing control methods.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
getFilterItemByPostVar($a_post_var)
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
getFormAction($a_gui_obj, $a_fallback_cmd="", $a_anchor="", $a_asynch=false, $xml_style=true)
Get form action url for gui class object.
This class represents a text property in a property form.
static getRepositoryDir()
getSelectedColumns()
Get selected columns.
setMaxLength($a_maxlength)
Set Max Length.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
User interface class for advanced drop-down selection lists.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
getLinkTarget($a_gui_obj, $a_cmd="", $a_anchor="", $a_asynch=false, $xml_style=true)
Get link target for command using gui object.
__construct($parent_obj, $parent_cmd, $template_context="")
ilWorkflowEngineDefinitionsTableGUI constructor.
setEnableHeader($a_enableheader)
Set Enable Header.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.