Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 161457 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java (-21 / +37 lines)
Lines 195-224 Link Here
195
		case UNCONFIRMED:
195
		case UNCONFIRMED:
196
		case REOPENED:
196
		case REOPENED:
197
		case NEW:
197
		case NEW:
198
			addOperation(bugReport, BUGZILLA_OPERATION.none, userName);
198
			addOperation(repository, bugReport, BUGZILLA_OPERATION.none, userName);
199
			addOperation(bugReport, BUGZILLA_OPERATION.accept, userName);
199
			addOperation(repository, bugReport, BUGZILLA_OPERATION.accept, userName);
200
			addOperation(bugReport, BUGZILLA_OPERATION.resolve, userName);
200
			addOperation(repository, bugReport, BUGZILLA_OPERATION.resolve, userName);
201
			addOperation(bugReport, BUGZILLA_OPERATION.duplicate, userName);
201
			addOperation(repository, bugReport, BUGZILLA_OPERATION.duplicate, userName);
202
			break;
202
			break;
203
		case ASSIGNED:
203
		case ASSIGNED:
204
			addOperation(bugReport, BUGZILLA_OPERATION.none, userName);
204
			addOperation(repository, bugReport, BUGZILLA_OPERATION.none, userName);
205
			addOperation(bugReport, BUGZILLA_OPERATION.resolve, userName);
205
			addOperation(repository, bugReport, BUGZILLA_OPERATION.resolve, userName);
206
			addOperation(bugReport, BUGZILLA_OPERATION.duplicate, userName);
206
			addOperation(repository, bugReport, BUGZILLA_OPERATION.duplicate, userName);
207
			break;
207
			break;
208
		case RESOLVED:
208
		case RESOLVED:
209
			addOperation(bugReport, BUGZILLA_OPERATION.none, userName);
209
			addOperation(repository, bugReport, BUGZILLA_OPERATION.none, userName);
210
			addOperation(bugReport, BUGZILLA_OPERATION.reopen, userName);
210
			addOperation(repository, bugReport, BUGZILLA_OPERATION.reopen, userName);
211
			addOperation(bugReport, BUGZILLA_OPERATION.verify, userName);
211
			addOperation(repository, bugReport, BUGZILLA_OPERATION.verify, userName);
212
			addOperation(bugReport, BUGZILLA_OPERATION.close, userName);
212
			addOperation(repository, bugReport, BUGZILLA_OPERATION.close, userName);
213
			break;
213
			break;
214
		case CLOSED:
214
		case CLOSED:
215
			addOperation(bugReport, BUGZILLA_OPERATION.none, userName);
215
			addOperation(repository, bugReport, BUGZILLA_OPERATION.none, userName);
216
			addOperation(bugReport, BUGZILLA_OPERATION.reopen, userName);
216
			addOperation(repository, bugReport, BUGZILLA_OPERATION.reopen, userName);
217
			break;
217
			break;
218
		case VERIFIED:
218
		case VERIFIED:
219
			addOperation(bugReport, BUGZILLA_OPERATION.none, userName);
219
			addOperation(repository, bugReport, BUGZILLA_OPERATION.none, userName);
220
			addOperation(bugReport, BUGZILLA_OPERATION.reopen, userName);
220
			addOperation(repository, bugReport, BUGZILLA_OPERATION.reopen, userName);
221
			addOperation(bugReport, BUGZILLA_OPERATION.close, userName);
221
			addOperation(repository, bugReport, BUGZILLA_OPERATION.close, userName);
222
		}
222
		}
223
		String bugzillaVersion;
223
		String bugzillaVersion;
224
		try {
224
		try {
Lines 230-241 Link Here
230
		if (bugzillaVersion.compareTo("3.1") < 0
230
		if (bugzillaVersion.compareTo("3.1") < 0
231
				&& (status == BUGZILLA_REPORT_STATUS.NEW || status == BUGZILLA_REPORT_STATUS.ASSIGNED)) {
231
				&& (status == BUGZILLA_REPORT_STATUS.NEW || status == BUGZILLA_REPORT_STATUS.ASSIGNED)) {
232
			// old bugzilla workflow is used
232
			// old bugzilla workflow is used
233
			addOperation(bugReport, BUGZILLA_OPERATION.reassign, userName);
233
			addOperation(repository, bugReport, BUGZILLA_OPERATION.reassign, userName);
234
			addOperation(bugReport, BUGZILLA_OPERATION.reassignbycomponent, userName);
234
			addOperation(repository, bugReport, BUGZILLA_OPERATION.reassignbycomponent, userName);
235
		}
235
		}
236
	}
236
	}
237
237
238
	private void addOperation(RepositoryTaskData bugReport, BUGZILLA_OPERATION opcode, String userName) {
238
	private void addOperation(TaskRepository repository, RepositoryTaskData bugReport, BUGZILLA_OPERATION opcode,
239
			String userName) {
239
		RepositoryOperation newOperation = null;
240
		RepositoryOperation newOperation = null;
240
		switch (opcode) {
241
		switch (opcode) {
241
		case none:
242
		case none:
Lines 249-256 Link Here
249
		case resolve:
250
		case resolve:
250
			newOperation = new RepositoryOperation(opcode.toString(), OPERATION_LABEL_RESOLVE);
251
			newOperation = new RepositoryOperation(opcode.toString(), OPERATION_LABEL_RESOLVE);
251
			newOperation.setUpOptions(OPERATION_OPTION_RESOLUTION);
252
			newOperation.setUpOptions(OPERATION_OPTION_RESOLUTION);
252
			for (BUGZILLA_RESOLUTION resolution : BUGZILLA_RESOLUTION.values()) {
253
			RepositoryConfiguration config;
253
				newOperation.addOption(resolution.toString(), resolution.toString());
254
			try {
255
				config = BugzillaCorePlugin.getRepositoryConfiguration(repository, false);
256
			} catch (CoreException e) {
257
				config = null;
258
			}
259
			if (config != null) {
260
				for (String resolution : config.getResolutions()) {
261
					// DUPLICATE and MOVED have special meanings so do not show as resolution
262
					if (resolution.compareTo("DUPLICATE")!= 0 && resolution.compareTo("MOVED")!= 0)
263
						newOperation.addOption(resolution, resolution);
264
				}
265
			} else {
266
				// LATER and REMIND must not be there in Bugzilla >= 3.0 is used
267
				for (BUGZILLA_RESOLUTION resolution : BUGZILLA_RESOLUTION.values()) {
268
					newOperation.addOption(resolution.toString(), resolution.toString());
269
				}
254
			}
270
			}
255
			break;
271
			break;
256
		case duplicate:
272
		case duplicate:

Return to bug 161457