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';
39 $this->
setId(
'wfedef');
43 $this->
ilCtrl = $DIC[
'ilCtrl'];
44 $this->lng = $DIC[
'lng'];
53 $this->
setRowTemplate(
"tpl.wfe_def_row.html",
"Services/WorkflowEngine");
58 $this->
setTitle($this->lng->txt(
"definitions"));
66 $title_filter_input =
new ilTextInputGUI($this->lng->txt(
"title"),
"title");
68 $title_filter_input->setSize(20);
70 $title_filter_input->readFromSession();
71 $this->filter[
"title"] = $title_filter_input->getValue();
73 $instances_filter_input =
new ilCheckboxInputGUI($this->lng->txt(
'instances'),
'instances');
75 $instances_filter_input->readFromSession();
76 $this->filter[
'instances'] = $instances_filter_input->getChecked();
84 $this->
addColumn($this->lng->txt(
"title"),
"title",
"20%");
88 if (in_array(
'file', $selected_columns)) {
89 $this->
addColumn($this->lng->txt(
"file"),
"file",
"30%");
92 if (in_array(
'version', $selected_columns)) {
93 $this->
addColumn($this->lng->txt(
"version"),
"version",
"10%");
96 if (in_array(
'status', $selected_columns)) {
97 $this->
addColumn($this->lng->txt(
"status"),
"status",
"10%");
100 if (in_array(
'instances', $selected_columns)) {
101 $this->
addColumn($this->lng->txt(
"instances"),
"instances",
"15%");
104 $this->
addColumn($this->lng->txt(
"actions"),
"",
"10%");
113 "txt" => $this->lng->txt(
"file"),
116 "txt" => $this->lng->txt(
"version"),
118 $cols[
"status"] =
array(
119 "txt" => $this->lng->txt(
"status"),
121 $cols[
"instances"] =
array(
122 "txt" => $this->lng->txt(
"instances"),
134 require_once
'Services/WorkflowEngine/classes/administration/class.ilWorkflowDefinitionRepository.php';
141 $baseList = $repository->getAll();
145 array_walk($baseList,
function (
array &$definition) use ($that) {
146 $status = $that->lng->txt(
'missing_parsed_class');
147 if ($definition[
'status']) {
151 $definition[
'status'] = $status;
154 $filteredBaseList = array_filter($baseList,
function ($item) use ($that) {
158 $this->
setData($filteredBaseList);
170 if ($title_filter->getValue() != null) {
171 if (strpos(strtolower(
$row[
'title']), strtolower($title_filter->getValue())) ===
false) {
178 if ($instances_filter->getChecked() &&
$row[
'instances'][
'active'] == 0) {
190 $this->tpl->setVariable(
'VAL_TITLE', $set[
'title']);
194 if (in_array(
'file', $selected_columns)) {
195 $this->tpl->setVariable(
'VAL_FILE', $set[
'file']);
198 if (in_array(
'version', $selected_columns)) {
199 $this->tpl->setVariable(
'VAL_VERSION', $set[
'version']);
202 if (in_array(
'status', $selected_columns)) {
203 if ($set[
'status'] !=
'OK') {
204 $this->tpl->setVariable(
'VAL_STATUS', $set[
'status']);
206 $this->tpl->setVariable(
'VAL_STATUS', $this->lng->txt(
'ok'));
210 if (in_array(
'instances', $selected_columns)) {
211 $this->tpl->setVariable(
'TXT_INSTANCES_TOTAL', $this->lng->txt(
'total'));
212 $this->tpl->setVariable(
'VAL_INSTANCES_TOTAL', 0+$set[
'instances'][
'total']);
213 $this->tpl->setVariable(
'TXT_INSTANCES_ACTIVE', $this->lng->txt(
'active'));
214 $this->tpl->setVariable(
'VAL_INSTANCES_ACTIVE', 0+$set[
'instances'][
'active']);
218 $action->setId(
'asl_' . $set[
'id']);
219 $action->setListTitle($this->lng->txt(
'actions'));
222 $this->lng->txt(
'start_process'),
227 if (0+$set[
'instances'][
'active'] == 0) {
229 $this->lng->txt(
'delete_definition'),
236 $class = substr($set[
'id'], 4);
237 if ($class::$startEventRequired ==
true) {
239 $this->lng->txt(
'start_listening'),
245 $this->lng->txt(
'stop_listening'),
251 $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.
getLinkTarget( $a_gui_obj, $a_cmd="", $a_anchor="", $a_asynch=false, $xml_style=true)
Get link target for command using gui object.
getFilterItemByPostVar($a_post_var)
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
static getRepositoryDir($relative=false)
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
This class represents a text property in a property form.
Class ilWorkflowDefinitionRepository.
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.
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.
__construct($parent_obj, $parent_cmd, $template_context="")
ilWorkflowEngineDefinitionsTableGUI constructor.
setEnableHeader($a_enableheader)
Set Enable Header.
getFormAction( $a_gui_obj, $a_fallback_cmd="", $a_anchor="", $a_asynch=false, $xml_style=true)
Get form action url for gui class object.