View | Details | Raw Unified | Return to bug 22896 | Differences between
and this patch

Collapse All | Expand All

(-)umc/python/pkgdb/de.po (-42 / +41 lines)
 Lines 12-178    Link Here 
12
"Content-Type: text/plain; charset=UTF-8\n"
12
"Content-Type: text/plain; charset=UTF-8\n"
13
"Content-Transfer-Encoding: 8bit\n"
13
"Content-Transfer-Encoding: 8bit\n"
14
14
15
#: umc/python/pkgdb/__init__.py:200
15
#: umc/python/pkgdb/__init__.py:205
16
msgid "Compared to version"
16
msgid "Compared to version"
17
msgstr "Verglichen mit Version"
17
msgstr "Verglichen mit Version"
18
18
19
#: umc/python/pkgdb/__init__.py:227
19
#: umc/python/pkgdb/__init__.py:232
20
msgid "Deinstall"
20
msgid "Deinstall"
21
msgstr "Deinstall"
21
msgstr "Deinstall"
22
22
23
#: umc/python/pkgdb/__init__.py:219
23
#: umc/python/pkgdb/__init__.py:224
24
msgid "Domaincontroller Backup"
24
msgid "Domaincontroller Backup"
25
msgstr "Domaincontroller Backup"
25
msgstr "Domaincontroller Backup"
26
26
27
#: umc/python/pkgdb/__init__.py:218
27
#: umc/python/pkgdb/__init__.py:223
28
msgid "Domaincontroller Master"
28
msgid "Domaincontroller Master"
29
msgstr "Domaincontroller Master"
29
msgstr "Domaincontroller Master"
30
30
31
#: umc/python/pkgdb/__init__.py:220
31
#: umc/python/pkgdb/__init__.py:225
32
msgid "Domaincontroller Slave"
32
msgid "Domaincontroller Slave"
33
msgstr "Domaincontroller Slave"
33
msgstr "Domaincontroller Slave"
34
34
35
#: umc/python/pkgdb/__init__.py:196
35
#: umc/python/pkgdb/__init__.py:201
36
msgid "Find packages installed incompletely"
36
msgid "Find packages installed incompletely"
37
msgstr "Unvollständig installierte Pakete"
37
msgstr "Unvollständig installierte Pakete"
38
38
39
#: umc/python/pkgdb/__init__.py:226
39
#: umc/python/pkgdb/__init__.py:231
40
msgid "Hold"
40
msgid "Hold"
41
msgstr "Hold"
41
msgstr "Hold"
42
42
43
#: umc/python/pkgdb/__init__.py:234
43
#: umc/python/pkgdb/__init__.py:239
44
msgid "Hold + Reinstall required"
44
msgid "Hold + Reinstall required"
45
msgstr "Hold + Reinstall required"
45
msgstr "Hold + Reinstall required"
46
46
47
#: umc/python/pkgdb/__init__.py:222
47
#: umc/python/pkgdb/__init__.py:227
48
msgid "IP-managed Client"
48
msgid "IP-managed Client"
49
msgstr "IP-managed Client"
49
msgstr "IP-managed Client"
50
50
51
#: umc/python/pkgdb/__init__.py:225
51
#: umc/python/pkgdb/__init__.py:230
52
msgid "Install"
52
msgid "Install"
53
msgstr "Install"
53
msgstr "Install"
54
54
55
#: umc/python/pkgdb/__init__.py:197
55
#: umc/python/pkgdb/__init__.py:202
56
msgid "Installation state"
56
msgid "Installation state"
57
msgstr "Installationsstatus"
57
msgstr "Installationsstatus"
58
58
59
#: umc/python/pkgdb/__init__.py:198
59
#: umc/python/pkgdb/__init__.py:203
60
msgid "Inventory date"
60
msgid "Inventory date"
61
msgstr "Erfassungsdatum"
61
msgstr "Erfassungsdatum"
62
62
63
#: umc/python/pkgdb/__init__.py:221
63
#: umc/python/pkgdb/__init__.py:226
64
msgid "Member Server"
64
msgid "Member Server"
65
msgstr "Member Server"
65
msgstr "Member Server"
66
66
67
#: umc/python/pkgdb/__init__.py:223
67
#: umc/python/pkgdb/__init__.py:228
68
msgid "Mobile Client"
68
msgid "Mobile Client"
69
msgstr "Mobile Client"
69
msgstr "Mobile Client"
70
70
71
#: umc/python/pkgdb/__init__.py:231
71
#: umc/python/pkgdb/__init__.py:236
72
msgid "OK"
72
msgid "OK"
73
msgstr "OK"
73
msgstr "OK"
74
74
75
#: umc/python/pkgdb/__init__.py:201
75
#: umc/python/pkgdb/__init__.py:206
76
msgid "Package name"
76
msgid "Package name"
77
msgstr "Paketname"
77
msgstr "Paketname"
78
78
79
#: umc/python/pkgdb/__init__.py:203
79
#: umc/python/pkgdb/__init__.py:208
80
msgid "Package state"
80
msgid "Package state"
81
msgstr "Paketstatus"
81
msgstr "Paketstatus"
82
82
83
#: umc/python/pkgdb/__init__.py:202
83
#: umc/python/pkgdb/__init__.py:207
84
msgid "Package version"
84
msgid "Package version"
85
msgstr "Paketversion"
85
msgstr "Paketversion"
86
86
87
#: umc/python/pkgdb/__init__.py:228
87
#: umc/python/pkgdb/__init__.py:233
88
msgid "Purge"
88
msgid "Purge"
89
msgstr "Purge"
89
msgstr "Purge"
90
90
91
#: umc/python/pkgdb/__init__.py:232
91
#: umc/python/pkgdb/__init__.py:237
92
msgid "Reinstall required"
92
msgid "Reinstall required"
93
msgstr "Neuinstallation erforderlich"
93
msgstr "Neuinstallation erforderlich"
94
94
95
#: umc/python/pkgdb/__init__.py:204
95
#: umc/python/pkgdb/__init__.py:209
96
msgid "Selection state"
96
msgid "Selection state"
97
msgstr "Selektionsstatus"
97
msgstr "Selektionsstatus"
98
98
99
#: umc/python/pkgdb/__init__.py:205
99
#: umc/python/pkgdb/__init__.py:210
100
msgid "System name"
100
msgid "System name"
101
msgstr "Systemname"
101
msgstr "Systemname"
102
102
103
#: umc/python/pkgdb/__init__.py:206
103
#: umc/python/pkgdb/__init__.py:211
104
msgid "System role"
104
msgid "System role"
105
msgstr "Systemrolle"
105
msgstr "Systemrolle"
106
106
107
#: umc/python/pkgdb/__init__.py:199
107
#: umc/python/pkgdb/__init__.py:204
108
msgid "Systems not updated"
108
msgid "Systems not updated"
109
msgstr "Nicht aktualisierte Systeme"
109
msgstr "Nicht aktualisierte Systeme"
110
110
111
#: umc/python/pkgdb/__init__.py:207
111
#: umc/python/pkgdb/__init__.py:212
112
msgid "UCS Version"
112
msgid "UCS Version"
113
msgstr "UCS Version"
113
msgstr "UCS Version"
114
114
115
#: umc/python/pkgdb/__init__.py:229
115
#: umc/python/pkgdb/__init__.py:234
116
msgid "Unknown"
116
msgid "Unknown"
117
msgstr "Unbekannt"
117
msgstr "Unbekannt"
118
118
119
#: umc/python/pkgdb/__init__.py:241
119
#: umc/python/pkgdb/__init__.py:246
120
msgid "configfiles"
120
msgid "configfiles"
121
msgstr "configfiles"
121
msgstr "configfiles"
122
122
123
#: umc/python/pkgdb/__init__.py:212
123
#: umc/python/pkgdb/__init__.py:217
124
msgid "doesn't match"
124
msgid "doesn't match"
125
msgstr "entspricht nicht"
125
msgstr "entspricht nicht"
126
126
127
#: umc/python/pkgdb/__init__.py:238
127
#: umc/python/pkgdb/__init__.py:243
128
msgid "half-configured"
128
msgid "half-configured"
129
msgstr "halb-konfiguriert"
129
msgstr "halb-konfiguriert"
130
130
131
#: umc/python/pkgdb/__init__.py:240
131
#: umc/python/pkgdb/__init__.py:245
132
msgid "half-installed"
132
msgid "half-installed"
133
msgstr "halb-installiert"
133
msgstr "halb-installiert"
134
134
135
#: umc/python/pkgdb/__init__.py:242
135
#: umc/python/pkgdb/__init__.py:247
136
msgid "installed"
136
msgid "installed"
137
msgstr "installiert"
137
msgstr "installiert"
138
138
139
#: umc/python/pkgdb/__init__.py:209
139
#: umc/python/pkgdb/__init__.py:214
140
msgid "is"
140
msgid "is"
141
msgstr "ist"
141
msgstr "ist"
142
142
143
#: umc/python/pkgdb/__init__.py:214
143
#: umc/python/pkgdb/__init__.py:219
144
msgid "is greater or equal"
144
msgid "is greater or equal"
145
msgstr "ist größer oder gleich"
145
msgstr "ist größer oder gleich"
146
146
147
#: umc/python/pkgdb/__init__.py:213
147
#: umc/python/pkgdb/__init__.py:218
148
msgid "is greater than"
148
msgid "is greater than"
149
msgstr "ist größer als"
149
msgstr "ist größer als"
150
150
151
#: umc/python/pkgdb/__init__.py:210
151
#: umc/python/pkgdb/__init__.py:215
152
msgid "is not"
152
msgid "is not"
153
msgstr "ist nicht"
153
msgstr "ist nicht"
154
154
155
#: umc/python/pkgdb/__init__.py:216
155
#: umc/python/pkgdb/__init__.py:221
156
msgid "is smaller or equal"
156
msgid "is smaller or equal"
157
msgstr "ist kleiner oder gleich"
157
msgstr "ist kleiner oder gleich"
158
158
159
#: umc/python/pkgdb/__init__.py:215
159
#: umc/python/pkgdb/__init__.py:220
160
msgid "is smaller than"
160
msgid "is smaller than"
161
msgstr "ist kleiner als"
161
msgstr "ist kleiner als"
162
162
163
#: umc/python/pkgdb/__init__.py:211
163
#: umc/python/pkgdb/__init__.py:216
164
msgid "matches"
164
msgid "matches"
165
msgstr "entspricht"
165
msgstr "entspricht"
166
166
167
#: umc/python/pkgdb/__init__.py:236
167
#: umc/python/pkgdb/__init__.py:241
168
msgid "not installed"
168
msgid "not installed"
169
msgstr "nicht installiert"
169
msgstr "nicht installiert"
170
170
171
#: umc/python/pkgdb/__init__.py:239
171
#: umc/python/pkgdb/__init__.py:244
172
msgid "uninstalled"
172
msgid "uninstalled"
173
msgstr "nicht installiert"
173
msgstr "nicht installiert"
174
174
175
#: umc/python/pkgdb/__init__.py:237
175
#: umc/python/pkgdb/__init__.py:242
176
msgid "unpacked"
176
msgid "unpacked"
177
msgstr "ausgepackt"
177
msgstr "ausgepackt"
178
(-)umc/python/pkgdb/__init__.py (-2 / +26 lines)
 Lines 131-138    Link Here 
131
		'columns':		['sysname','pkgname','vername','inventory_date',              'selectedstate','inststate','currentstate' ],
131
		'columns':		['sysname','pkgname','vername','inventory_date',              'selectedstate','inststate','currentstate' ],
132
		'db_fields':	['sysname','pkgname','vername','inventory_date', 'inststatus','selectedstate','inststate','currentstate' ],
132
		'db_fields':	['sysname','pkgname','vername','inventory_date', 'inststatus','selectedstate','inststate','currentstate' ],
133
		'function':		'sql_get_packages_in_systems_by_query',
133
		'function':		'sql_get_packages_in_systems_by_query',
134
		# They allow querying for the UCS version, and then they don't display it? Who would use that at all? 
135
		# But nevertheless, if 'sysversion' is an allowed search key we have to switch this 'Join' flag on,
136
		# or we get always empty result sets.
137
		# (No, this join is not the performance bottleneck, believe me.)
134
		'args':			{
138
		'args':			{
135
			'join_systems':		False,
139
			'join_systems':		True,
136
# /usr/share/pyshared/univention/pkgdb.py needs to be patched to understand these args:
140
# /usr/share/pyshared/univention/pkgdb.py needs to be patched to understand these args:
137
#
141
#
138
#	'limit' ... avoids fetching large amounts of data that can't be processed either
142
#	'limit' ... avoids fetching large amounts of data that can't be processed either
 Lines 261-266    Link Here 
261
			
265
			
262
			what = 'checking variable lists'
266
			what = 'checking variable lists'
263
			self._check_variable_lists()
267
			self._check_variable_lists()
268
			
269
			# initialize some member variables
270
			self._last_query = 0
271
			self._last_result = []
264
272
265
		except Exception,ex:
273
		except Exception,ex:
266
			MODULE.warn("[INIT] while %s: %s" % (what,str(ex)))
274
			MODULE.warn("[INIT] while %s: %s" % (what,str(ex)))
 Lines 300-305    Link Here 
300
		for s in st:
308
		for s in st:
301
			MODULE.info("   << %s" % s)
309
			MODULE.info("   << %s" % s)
302
		# -----------------------------------
310
		# -----------------------------------
311
		
312
		# When a sort header is clicked, the frontend will issue the same query
313
		# again. We're prepared for this, remembering the last query options and
314
		# the result set.
315
		
316
		if cmp(self._last_query,request.options) == 0:
317
			MODULE.info("   ++ Same query: returning same result (%d entries) again." % len(self._last_result))
318
			result = self._last_result
319
			self.finished(request.id,result)
320
			return
321
		
322
		self._last_query = request.options
303
323
304
		result = []
324
		result = []
305
		
325
		
 Lines 362-367    Link Here 
362
				MODULE.warn("   !! execute query: %s" % str(ex))
382
				MODULE.warn("   !! execute query: %s" % str(ex))
363
			
383
			
364
		request.status = SUCCESS
384
		request.status = SUCCESS
385
		
386
		# Remember result for repeated invocation of the same query
387
		# (e.g. click on any sort header)
388
		self._last_result = result
365
389
366
		# ---------- DEBUG --------------
390
		# ---------- DEBUG --------------
367
		MODULE.info("pkgdb/query returns:")
391
		MODULE.info("pkgdb/query returns:")
 Lines 707-713    Link Here 
707
			if len(result) > RECORD_LIMIT:
731
			if len(result) > RECORD_LIMIT:
708
				what = 'limiting record count'
732
				what = 'limiting record count'
709
				MODULE.warn("   >> QUERY returned %d entries -> showing only first %d" % (len(result),RECORD_LIMIT))
733
				MODULE.warn("   >> QUERY returned %d entries -> showing only first %d" % (len(result),RECORD_LIMIT))
710
				result = result[0:RECORD_LIMIT]
734
				del result[RECORD_LIMIT:]
711
			return result
735
			return result
712
		except Exception,ex:
736
		except Exception,ex:
713
			MODULE.warn("   !! Query (function='%s',query='%s',args='%s') failed:" % (function,query,args))
737
			MODULE.warn("   !! Query (function='%s',query='%s',args='%s') failed:" % (function,query,args))
(-)umc/js/pkgdb.js (-13 lines)
 Lines 42-58    Link Here 
42
		
42
		
43
	}
43
	}
44
	
44
	
45
//	startup: function() {
46
//		
47
//		this.inherited(arguments);
48
//		
49
//	},
50
//	
51
//	uninitialize: function() {
52
//		
53
//		this.inherited(arguments);
54
//		this._refresh_time = 0;
55
//		
56
//	}
57
	
58
});
45
});
(-)umc/js/de.po (-9 / +6 lines)
 Lines 12-18    Link Here 
12
"Content-Type: text/plain; charset=UTF-8\n"
12
"Content-Type: text/plain; charset=UTF-8\n"
13
"Content-Transfer-Encoding: 8bit\n"
13
"Content-Transfer-Encoding: 8bit\n"
14
14
15
#: umc/js/_pkgdb/SearchForm.js:33
15
#: umc/js/_pkgdb/SearchForm.js:39
16
msgid "--- Please select ---"
16
msgid "--- Please select ---"
17
msgstr "--- Bitte wählen ---"
17
msgstr "--- Bitte wählen ---"
18
18
 Lines 32-38    Link Here 
32
msgid "Inventory date"
32
msgid "Inventory date"
33
msgstr "Erfaßt am"
33
msgstr "Erfaßt am"
34
34
35
#: umc/js/_pkgdb/SearchForm.js:48
35
#: umc/js/_pkgdb/SearchForm.js:52
36
msgid "Operator"
36
msgid "Operator"
37
msgstr "Operator"
37
msgstr "Operator"
38
38
 Lines 52-61    Link Here 
52
msgid "Packages"
52
msgid "Packages"
53
msgstr "Pakete"
53
msgstr "Pakete"
54
54
55
#: umc/js/_pkgdb/SearchForm.js:65
55
#: umc/js/_pkgdb/SearchForm.js:67 umc/js/_pkgdb/SearchForm.js:81
56
#: umc/js/_pkgdb/SearchForm.js:81
56
#: umc/js/_pkgdb/SearchForm.js:283
57
#: umc/js/_pkgdb/SearchForm.js:335
58
#: umc/js/_pkgdb/SearchForm.js:336
59
msgid "Pattern"
57
msgid "Pattern"
60
msgstr "Suchbegriff"
58
msgstr "Suchbegriff"
61
59
 Lines 63-69    Link Here 
63
msgid "Problems"
61
msgid "Problems"
64
msgstr "Probleme"
62
msgstr "Probleme"
65
63
66
#: umc/js/_pkgdb/SearchForm.js:101
64
#: umc/js/_pkgdb/SearchForm.js:97
67
msgid "Search"
65
msgid "Search"
68
msgstr "Suchen"
66
msgstr "Suchen"
69
67
 Lines 75-81    Link Here 
75
msgid "Search for systems with specific software properties"
73
msgid "Search for systems with specific software properties"
76
msgstr "Sucht Systeme mit speziellen Software-Eigenschaften"
74
msgstr "Sucht Systeme mit speziellen Software-Eigenschaften"
77
75
78
#: umc/js/_pkgdb/SearchForm.js:31
76
#: umc/js/_pkgdb/SearchForm.js:37
79
msgid "Search for:"
77
msgid "Search for:"
80
msgstr "Suche nach:"
78
msgstr "Suche nach:"
81
79
 Lines 106-109    Link Here 
106
#: umc/js/_pkgdb/KeyTranslator.js:53
104
#: umc/js/_pkgdb/KeyTranslator.js:53
107
msgid "UCS Version"
105
msgid "UCS Version"
108
msgstr "UCS Version"
106
msgstr "UCS Version"
109
(-)umc/js/_pkgdb/SearchForm.js (-87 / +155 lines)
 Lines 17-25    Link Here 
17
	i18nClass:			'umc.modules.pkgdb',
17
	i18nClass:			'umc.modules.pkgdb',
18
	
18
	
19
	// Some status variables
19
	// Some status variables
20
	_patterns_allowed:		false,		// true if operator is selectable
20
	_pattern_needed:		true,		// true if a pattern is required by this key+operator 
21
	_pattern_is_list:		false,		// true if pattern is ComboBox (not TextBox)
21
	_pattern_is_list:		false,		// true if pattern is ComboBox. false if TextBox.
22
	_submit_allowed:		false,		// true if current input allows SUBMIT (including that no queries are pending)
22
	
23
	
24
	// true while the corresponding query is pending
25
	_keys_pending:			true,
26
	_operators_pending:		false,
27
	_proposals_pending:		false,
28
	
23
	postMixInProperties: function() {
29
	postMixInProperties: function() {
24
		
30
		
25
		dojo.mixin(this,{
31
		dojo.mixin(this,{
 Lines 36-44    Link Here 
36
						dynamicOptions:			{page:this.pageKey},
42
						dynamicOptions:			{page:this.pageKey},
37
						onDynamicValuesLoaded:	dojo.hitch(this, function(values) {
43
						onDynamicValuesLoaded:	dojo.hitch(this, function(values) {
38
							this._set_selection_to_first_element('key');
44
							this._set_selection_to_first_element('key');
39
						}),
45
							this._set_query_pending('key',false);
40
						onChange:				dojo.hitch(this, function(value) {
41
							this.onQueryChanged('key',value);
42
						})
46
						})
43
					},
47
					},
44
					{
48
					{
 Lines 53-61    Link Here 
53
						}),
57
						}),
54
						onDynamicValuesLoaded:	dojo.hitch(this, function(values) {
58
						onDynamicValuesLoaded:	dojo.hitch(this, function(values) {
55
							this._handle_operators(values);
59
							this._handle_operators(values);
56
						}),
60
							this._set_query_pending('operator',false);
57
						onChange:				dojo.hitch(this, function(value) {
58
							this.onQueryChanged('operator',value);
59
						})
61
						})
60
					},
62
					},
61
					{
63
					{
 Lines 70-78    Link Here 
70
						}),
72
						}),
71
						onDynamicValuesLoaded:	dojo.hitch(this, function(values) {
73
						onDynamicValuesLoaded:	dojo.hitch(this, function(values) {
72
							this._handle_proposals(values);
74
							this._handle_proposals(values);
73
						}),
75
							this._set_query_pending('proposal',false);
74
						onChange:				dojo.hitch(this, function(value) {
75
							this.onQueryChanged('pattern_list',value);
76
						})
76
						})
77
					},
77
					},
78
					{
78
					{
 Lines 80-92    Link Here 
80
						name:					'pattern_text',
80
						name:					'pattern_text',
81
						label:					this._("Pattern"),
81
						label:					this._("Pattern"),
82
						style:					'width:350px;',
82
						style:					'width:350px;',
83
						onChange:				dojo.hitch(this, function(value) {
84
							this.onQueryChanged('pattern_text',value);
85
						}),
86
						// inherits from dijit.form.ValidationTextBox, so we can use its
83
						// inherits from dijit.form.ValidationTextBox, so we can use its
87
						// validation abilities
84
						// validation abilities
88
						regExp:					'^[A-Za-z0-9_.*?-]+$',		// [:alnum:] and these: _ - . * ?
85
						regExp:					'^[A-Za-z0-9_.*?-]+$',		// [:alnum:] and these: _ - . * ?
89
						required:				true						// force nonempty
90
					}
86
					}
91
				],
87
				],
92
			layout:
88
			layout:
 Lines 117-122    Link Here 
117
		this.showWidget('pattern_text',false);
113
		this.showWidget('pattern_text',false);
118
		this.showWidget('pattern_list',false);
114
		this.showWidget('pattern_list',false);
119
		this.showWidget('operator',false);
115
		this.showWidget('operator',false);
116
		
117
		// whenever one of our 'pending' vars is changed...
118
		this.watch('_keys_pending',dojo.hitch(this,function(name,oldval,value) {
119
			this._handle_query_changes(name,value);
120
		}));
121
		this.watch('_operators_pending',dojo.hitch(this,function(name,oldval,value) {
122
			this._handle_query_changes(name,value);
123
		}));
124
		this.watch('_proposals_pending',dojo.hitch(this,function(name,oldval,value) {
125
			this._handle_query_changes(name,value);
126
		}));
127
		
128
		// whenever one of the dialog values is being changed...
129
		dojo.connect(this.getWidget('key'),'onChange',dojo.hitch(this, function(value) {
130
			this._handle_query_changes('key',value);
131
		}));
132
		dojo.connect(this.getWidget('operator'),'onChange',dojo.hitch(this, function(value) {
133
			this._handle_query_changes('operator',value);
134
		}));
135
		dojo.connect(this.getWidget('pattern_text'),'onChange',dojo.hitch(this, function(value) {
136
			this._handle_query_changes('pattern_text',value);
137
		}));
138
		dojo.connect(this.getWidget('pattern_list'),'onChange',dojo.hitch(this, function(value) {
139
			this._handle_query_changes('pattern_list',value);
140
		}));
120
	},
141
	},
121
	
142
	
122
	// ---------------------------------------------------------------------
143
	// ---------------------------------------------------------------------
 Lines 158-164    Link Here 
158
		if (crit != '_')
179
		if (crit != '_')
159
		{
180
		{
160
			query['key'] = crit;
181
			query['key'] = crit;
161
			if (this._patterns_allowed)
182
			if (this._submit_allowed)
162
			{
183
			{
163
				query['operator'] = this.getWidget('operator').get('value');
184
				query['operator'] = this.getWidget('operator').get('value');
164
				if (this._pattern_is_list)
185
				if (this._pattern_is_list)
 Lines 195-207    Link Here 
195
	// suitable for a given key
216
	// suitable for a given key
196
	_operators_query: function() {
217
	_operators_query: function() {
197
		
218
		
219
		if (this._operators_pending)
220
		{
221
			//alert("OPERATORS already pending!");
222
		}
223
		this._set_query_pending('operator',true);
198
		try
224
		try
199
		{
225
		{
200
			// While the query is underway I can always see the 'invalid' indicator
201
			// at the 'operator' ComboBox. So I try to set the ComboBox to a
202
			// neutral value.
203
			this.getWidget('operator').set('value',null);
204
			
205
			var value = this.getWidget('key').get('value');
226
			var value = this.getWidget('key').get('value');
206
227
207
			return umc.tools.umcpCommand('pkgdb/operators',{
228
			return umc.tools.umcpCommand('pkgdb/operators',{
 Lines 222-234    Link Here 
222
	// key and operator. (pageKey is added silently)
243
	// key and operator. (pageKey is added silently)
223
	_proposals_query: function() {
244
	_proposals_query: function() {
224
		
245
		
246
		if (this._proposals_pending)
247
		{
248
			//alert("PROPOSALS already pending!");
249
		}
250
		this._set_query_pending('proposal',true);
225
		try
251
		try
226
		{
252
		{
227
			// While the query is underway I can always see the 'invalid' indicator
228
			// at the 'pattern_list' ComboBox. So I try to set the ComboBox to a
229
			// neutral value.
230
			this.getWidget('pattern_list').set('value',null);
231
232
			var key = this.getWidget('key').get('value');
253
			var key = this.getWidget('key').get('value');
233
			
254
			
234
			return umc.tools.umcpCommand('pkgdb/proposals',{
255
			return umc.tools.umcpCommand('pkgdb/proposals',{
 Lines 258-287    Link Here 
258
	//		entirely.
279
	//		entirely.
259
	//
280
	//
260
	_handle_operators: function(values) {
281
	_handle_operators: function(values) {
282
		
283
		var p_label = this._("Pattern");
284
		var o_show  = false;
285
		var p_show  = true;
261
		if (dojo.isArray(values))
286
		if (dojo.isArray(values))
262
		{
287
		{
263
			if (values.length)
288
			if (values.length)
264
			{
289
			{
265
				this._set_selection_to_first_element('operator');
290
				this._set_selection_to_first_element('operator');
266
				this._allow_patterns(true);
291
				this._pattern_needed = true;
292
				o_show = true;
267
			}
293
			}
268
			else
294
			else
269
			{
295
			{
270
				this._allow_patterns(false);
296
				this._pattern_needed = false;
297
				p_show = false;
271
			}
298
			}
272
		}
299
		}
273
		else
300
		else
274
		{
301
		{
275
			this._set_single_operator(values);
302
			this._pattern_needed = true;
303
			p_label = values;
276
		}
304
		}
305
		
306
		this.showWidget('operator',o_show);
307
		
308
		if (p_show)
309
		{
310
			this.showWidget('pattern_text',!this._pattern_is_list);
311
			this.showWidget('pattern_list',this._pattern_is_list);
312
		}
313
		else
314
		{
315
			this.showWidget('pattern_text',false);
316
			this.showWidget('pattern_list',false);
317
		}
318
319
		this.getWidget('pattern_text').set('label',p_label);
320
		this.getWidget('pattern_list').set('label',p_label);
277
	},
321
	},
278
	
322
	
279
	// handles the result (and especially: the result type) of the
323
	// handles the result (and especially: the result type) of the
280
	// proposals returned by the 'pkgdb/proposals' query
324
	// proposals returned by the 'pkgdb/proposals' query
281
	_handle_proposals: function(values) {
325
	_handle_proposals: function(values) {
282
		
326
283
		if (! this._patterns_allowed) { return; }			// nothing to do here.
284
		
285
		var is_single = dojo.isString(values);
327
		var is_single = dojo.isString(values);
286
		this._pattern_is_list = !is_single;				// remember for later.
328
		this._pattern_is_list = !is_single;				// remember for later.
287
		if (is_single)
329
		if (is_single)
 Lines 292-340    Link Here 
292
		{
334
		{
293
			this._set_selection_to_first_element('pattern_list');
335
			this._set_selection_to_first_element('pattern_list');
294
		}
336
		}
295
		// values are set. now show/hide appropriately.
337
		// values are set. now show/hide appropriately, but only if needed.
296
		this.showWidget('pattern_text',is_single);
338
		if (this._pattern_needed)
297
		this.showWidget('pattern_list',!is_single);
339
		{
340
			this.showWidget('pattern_text',is_single);
341
			this.showWidget('pattern_list',!is_single);
342
		}
298
	},
343
	},
299
	
344
	
300
	// If we get a single operator we use it as a label for the
345
	// sets state of 'this query is pending' in a boolean variable
301
	// text input. Here is the function that switches the corresponding
346
	// and in the 'disabled' state of the corresponding dialog element(s)
302
	// status values.
347
	_set_query_pending: function(element,on) {
303
	_set_single_operator: function(operator) {
304
		
348
		
305
		this._patterns_allowed = true;
349
		var bv = '_' + element + 's_pending';
306
		this.showWidget('operator',false);
350
		this.set(bv,on);
307
		this._set_selection_to_first_element('operator');
308
		this.getWidget('operator').set('value',operator);
309
		
310
		this.getWidget('pattern_text').set('label',operator);
311
		this.getWidget('pattern_list').set('label',operator);
312
351
313
		this.showWidget('pattern_text',true);
352
// To make it 100% safe against impatient users... but the downside is that
314
		this.showWidget('pattern_list',false);
353
// the dialog elements would flicker on every selection change at the 'key'
315
	},
354
// ComboBox...
355
//
356
//		var ele = this.getWidget(element);
357
//		if (ele)
358
//		{
359
//			// applies to 'key' and 'operator' ComboBox
360
//			ele.set('disabled',on);
361
//		}
362
//		else
363
//		{
364
//			// applies to these two 'pattern' entry elements
365
//			this.getWidget('pattern_text').set('disabled',on);
366
//			this.getWidget('pattern_list').set('disabled',on);
367
//		}
316
368
317
	// switches exutability of this query on or off: shows or hides
318
	// the 'operator' and 'pattern' elements. Additionally remembers
319
	// the last given pattern so subsequent handlers know the state.
320
	_allow_patterns: function(allow) {
321
		this._patterns_allowed = allow;
322
		
323
		this.showWidget('operator',allow);
324
		
325
		// at least, if NOT allowed -> hide both 'pattern_*' widgets.
326
		// showing one of them depending on allowed values must
327
		// be deferred until we have the 'proposals' data back.
328
		if (! allow)
329
		{
330
			this.showWidget('pattern_text',false);
331
			this.showWidget('pattern_list',false);
332
		}
333
		else
334
		{
335
			this.getWidget('pattern_text').set('label',this._("Pattern"));
336
			this.getWidget('pattern_list').set('label',this._("Pattern"));
337
		}
338
	},
369
	},
339
	
370
	
340
	_set_selection_to_first_element: function(name) {
371
	_set_selection_to_first_element: function(name) {
 Lines 351-377    Link Here 
351
	// feature if the form doesn't honor it?
382
	// feature if the form doesn't honor it?
352
	onSubmit: function() {
383
	onSubmit: function() {
353
		
384
		
354
		var keys = this.getWidget('key');
385
		// the 'onChange' handler of the textbox is not invoked until the focus
355
		var ok = ((keys.get('value') != '_') && (keys.getAllItems().length > 1));
386
		// has left the field... so we have to do a last check here in case
356
		if (ok)
387
		// the text changed.
388
		this._handle_query_changes();
389
		
390
		if (this._submit_allowed)
357
		{
391
		{
358
			// this widget must not be honored since it is invisible
392
			this.onExecuteQuery(this.getQuery());
359
			var ignore = (this._pattern_is_list ? 'pattern_text' : 'pattern_list');
393
		}
394
	},
395
	
396
	// an internal callback for everything that changes a query, operator or pattern.
397
	// should call the external callback 'onQueryChanged' only if something has
398
	// changed. This maintains all internal variables that reflect the state of
399
	// the current entry and the executability of the query.
400
	_handle_query_changes: function(name,value) {
401
		
402
		// start with: allowed if none of our dynamicValues queries is pending
403
		var allow = ! (this._keys_pending || this._operators_pending || this._proposals_pending);
404
		
405
		// only allow if the 'key' position is not '--- select one ---'
406
		allow = allow && (this.getWidget('key').get('value')!='_');
407
		
408
		// check validation for all elements that must be valid
409
		if (allow)
410
		{
360
			for (var w in this._widgets)
411
			for (var w in this._widgets)
361
			{
412
			{
362
				var widget = this._widgets[w];
413
				var widget = this._widgets[w];
363
				if (widget.name != ignore)
414
				var n = widget['name'];
415
				var toprocess = true;
416
				if (n.substr(0,8) == 'pattern_')
364
				{
417
				{
418
					if (this._pattern_needed)
419
					{
420
						if (	((this._pattern_is_list) && (n == 'pattern_text'))
421
							||	((!this._pattern_is_list) && (n == 'pattern_list')))
422
						{
423
							toprocess = false;
424
						}
425
					}
426
					else
427
					{
428
						// no pattern required: pattern_text AND pattern_list should
429
						// should be ignored
430
						toprocess = false;
431
					}
432
				}
433
				if (toprocess)
434
				{
365
					if (! widget.isValid())
435
					if (! widget.isValid())
366
					{
436
					{
367
						ok = false;
437
						allow = false;
368
					}
438
					}
369
				}
439
				}
370
			}
440
			}
371
		}
441
		}
372
		if (ok)
442
443
		if (allow != this._submit_allowed)
373
		{
444
		{
374
			this.onExecuteQuery(this.getQuery());
445
			this._submit_allowed = allow;
446
			this.enableSearchButton(allow);
375
		}
447
		}
376
	},
448
	},
377
	
449
	
 Lines 389-402    Link Here 
389
		this.enableEntryElements(false);
461
		this.enableEntryElements(false);
390
	},
462
	},
391
	
463
	
392
	// invoked whenever a substantial dialog element is being changed. The
464
	// the invoking Page or Module can listen here to know that the query is become
393
	// ancestor can listen here and clear (or switch invisible) the result
465
	// ready or disabled. Internal function _handle_query_changes() maintains all
394
	// grid. Args are the name of the field being changed, and the new value.
466
	// state variables and calls this only if the state has changed.
395
	onQueryChanged: function(field,value) {
467
	onQueryChanged: function(query) {
396
		if (field == 'key')
397
		{
398
			this.enableSearchButton(value != '_');
399
		}
400
	}
468
	}
401
	
469
	
402
});
470
});
(-)umc/js/_pkgdb/Page.js (-17 lines)
 Lines 61-79    Link Here 
61
		
61
		
62
		this._current_query = query;
62
		this._current_query = query;
63
		
63
		
64
		// ----------------- DEBUG ----------------------
65
//		var txt = "Executing query:\n~~~~~~~~~~~~~~~\n\n";
66
//		var fl = ['key','operator','pattern'];
67
//		for (var f in fl)
68
//		{
69
//			if (query[fl[f]])
70
//			{
71
//				txt += " '" + query[fl[f]] + "'";
72
//			}
73
//		}
74
//		alert(txt);
75
		// ----------------------------------------------
76
		
77
		try
64
		try
78
		{
65
		{
79
			umc.tools.umcpCommand('pkgdb/columns',{
66
			umc.tools.umcpCommand('pkgdb/columns',{
 Lines 131-140    Link Here 
131
					actions:		[],
118
					actions:		[],
132
					columns:		columns,
119
					columns:		columns,
133
					moduleStore:	umc.store.getModuleStore(fields[0],'pkgdb')
120
					moduleStore:	umc.store.getModuleStore(fields[0],'pkgdb')
134
//					onFilterDone:	dojo.hitch(this, function(success) {
135
//						alert("Filter done!");
136
//						this._searchform.enableSearchButton(true);
137
//					})
138
				});
121
				});
139
				
122
				
140
				if (this._grid)
123
				if (this._grid)

Return to bug 22896