Newer
Older
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
/**
* @module package/quiqqer/erp/bin/backend/controls/process/ProcessWindow
* @author www.pcsg.de (Henning Leutz)
*/
define('package/quiqqer/erp/bin/backend/controls/process/ProcessWindow', [
'qui/QUI',
'qui/controls/windows/Popup',
'Locale',
'Ajax',
'css!package/quiqqer/erp/bin/backend/controls/process/ProcessWindow.css'
], function(QUI, QUIPopup, QUILocale, QUIAjax) {
'use strict';
const lg = 'quiqqer/erp';
return new Class({
Extends: QUIPopup,
Type: 'package/quiqqer/erp/bin/backend/controls/process/ProcessWindow',
Binds: [
'$onCreate',
'$onOpen'
],
options: {
globalProcessId: false,
hash: false,
buttons: false
},
initialize: function(options) {
this.setAttributes({
icon: 'fa fa-timeline',
title: '',
maxHeight: 900,
maxWidth: 750,
});
this.parent(options);
this.$Comments = null;
this.addEvents({
onCreate: this.$onCreate,
onOpen: this.$onOpen
});
},
$onCreate: function() {
if (!this.getAttribute('globalProcessId') && !this.getAttribute('hash')) {
this.close();
return;
}
this.Loader.show();
this.refresh();
this.getContent().setStyle('padding', 0);
this.getContent().addClass('quiqqer-erp-process-window');
new Element('div', {
'class': 'quiqqer-erp-process-window-header',
html: '<div class="quiqqer-erp-process-window-header-filter">' +
' <input type="text" name="filter" placeholder="Filter (Nachricht, Type, ID) ...">' +
' </div>'
}).inject(this.getContent());
require(['package/quiqqer/erp/bin/backend/controls/Comments'], (Comments) => {
const CommentContainer = new Element('div', {
'class': 'quiqqer-erp-process-window-comments',
styles: {
padding: 20
}
}).inject(this.getContent());
const Filter = this.getContent().getElement('[name="filter"]');
this.$Comments = new Comments().inject(CommentContainer);
Filter.addEvent('keyup', () => {
this.$Comments.filter(Filter.value);
});
this.$onOpen();
});
},
$onOpen: function() {
if (!this.getAttribute('globalProcessId') && !this.getAttribute('hash')) {
this.close();
return;
}
if (!this.$Comments) {
return;
}
this.Loader.show();
QUIAjax.get('package_quiqqer_erp_ajax_process_getProcess', (result) => {
this.setAttributes({
icon: 'fa fa-timeline',
title: QUILocale.get(lg, 'panel.globalProcess.title', {
globalProcessId: result.globalProcessId
})
});
this.refresh();
this.$Comments.clear();
this.$Comments.unserialize(result.history);
this.Loader.hide();
}, {
'package': 'quiqqer/erp',
globalProcessId: this.getAttribute('globalProcessId'),
hash: this.getAttribute('hash'),
});
}
});
});