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 (-22 / +46 lines)
Lines 18-24 Link Here
18
import org.eclipse.core.runtime.IStatus;
18
import org.eclipse.core.runtime.IStatus;
19
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants.BUGZILLA_OPERATION;
19
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants.BUGZILLA_OPERATION;
20
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants.BUGZILLA_REPORT_STATUS;
20
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants.BUGZILLA_REPORT_STATUS;
21
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants.BUGZILLA_RESOLUTION;
21
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants.BUGZILLA_RESOLUTION_2_0;
22
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants.BUGZILLA_RESOLUTION_3_0;
22
import org.eclipse.mylyn.monitor.core.StatusHandler;
23
import org.eclipse.mylyn.monitor.core.StatusHandler;
23
import org.eclipse.mylyn.tasks.core.AbstractAttributeFactory;
24
import org.eclipse.mylyn.tasks.core.AbstractAttributeFactory;
24
import org.eclipse.mylyn.tasks.core.AbstractTaskDataHandler;
25
import org.eclipse.mylyn.tasks.core.AbstractTaskDataHandler;
Lines 195-224 Link Here
195
		case UNCONFIRMED:
196
		case UNCONFIRMED:
196
		case REOPENED:
197
		case REOPENED:
197
		case NEW:
198
		case NEW:
198
			addOperation(bugReport, BUGZILLA_OPERATION.none, userName);
199
			addOperation(repository, bugReport, BUGZILLA_OPERATION.none, userName);
199
			addOperation(bugReport, BUGZILLA_OPERATION.accept, userName);
200
			addOperation(repository, bugReport, BUGZILLA_OPERATION.accept, userName);
200
			addOperation(bugReport, BUGZILLA_OPERATION.resolve, userName);
201
			addOperation(repository, bugReport, BUGZILLA_OPERATION.resolve, userName);
201
			addOperation(bugReport, BUGZILLA_OPERATION.duplicate, userName);
202
			addOperation(repository, bugReport, BUGZILLA_OPERATION.duplicate, userName);
202
			break;
203
			break;
203
		case ASSIGNED:
204
		case ASSIGNED:
204
			addOperation(bugReport, BUGZILLA_OPERATION.none, userName);
205
			addOperation(repository, bugReport, BUGZILLA_OPERATION.none, userName);
205
			addOperation(bugReport, BUGZILLA_OPERATION.resolve, userName);
206
			addOperation(repository, bugReport, BUGZILLA_OPERATION.resolve, userName);
206
			addOperation(bugReport, BUGZILLA_OPERATION.duplicate, userName);
207
			addOperation(repository, bugReport, BUGZILLA_OPERATION.duplicate, userName);
207
			break;
208
			break;
208
		case RESOLVED:
209
		case RESOLVED:
209
			addOperation(bugReport, BUGZILLA_OPERATION.none, userName);
210
			addOperation(repository, bugReport, BUGZILLA_OPERATION.none, userName);
210
			addOperation(bugReport, BUGZILLA_OPERATION.reopen, userName);
211
			addOperation(repository, bugReport, BUGZILLA_OPERATION.reopen, userName);
211
			addOperation(bugReport, BUGZILLA_OPERATION.verify, userName);
212
			addOperation(repository, bugReport, BUGZILLA_OPERATION.verify, userName);
212
			addOperation(bugReport, BUGZILLA_OPERATION.close, userName);
213
			addOperation(repository, bugReport, BUGZILLA_OPERATION.close, userName);
213
			break;
214
			break;
214
		case CLOSED:
215
		case CLOSED:
215
			addOperation(bugReport, BUGZILLA_OPERATION.none, userName);
216
			addOperation(repository, bugReport, BUGZILLA_OPERATION.none, userName);
216
			addOperation(bugReport, BUGZILLA_OPERATION.reopen, userName);
217
			addOperation(repository, bugReport, BUGZILLA_OPERATION.reopen, userName);
217
			break;
218
			break;
218
		case VERIFIED:
219
		case VERIFIED:
219
			addOperation(bugReport, BUGZILLA_OPERATION.none, userName);
220
			addOperation(repository, bugReport, BUGZILLA_OPERATION.none, userName);
220
			addOperation(bugReport, BUGZILLA_OPERATION.reopen, userName);
221
			addOperation(repository, bugReport, BUGZILLA_OPERATION.reopen, userName);
221
			addOperation(bugReport, BUGZILLA_OPERATION.close, userName);
222
			addOperation(repository, bugReport, BUGZILLA_OPERATION.close, userName);
222
		}
223
		}
223
		String bugzillaVersion;
224
		String bugzillaVersion;
224
		try {
225
		try {
Lines 230-241 Link Here
230
		if (bugzillaVersion.compareTo("3.1") < 0
231
		if (bugzillaVersion.compareTo("3.1") < 0
231
				&& (status == BUGZILLA_REPORT_STATUS.NEW || status == BUGZILLA_REPORT_STATUS.ASSIGNED)) {
232
				&& (status == BUGZILLA_REPORT_STATUS.NEW || status == BUGZILLA_REPORT_STATUS.ASSIGNED)) {
232
			// old bugzilla workflow is used
233
			// old bugzilla workflow is used
233
			addOperation(bugReport, BUGZILLA_OPERATION.reassign, userName);
234
			addOperation(repository, bugReport, BUGZILLA_OPERATION.reassign, userName);
234
			addOperation(bugReport, BUGZILLA_OPERATION.reassignbycomponent, userName);
235
			addOperation(repository, bugReport, BUGZILLA_OPERATION.reassignbycomponent, userName);
235
		}
236
		}
236
	}
237
	}
237
238
238
	private void addOperation(RepositoryTaskData bugReport, BUGZILLA_OPERATION opcode, String userName) {
239
	private void addOperation(TaskRepository repository, RepositoryTaskData bugReport, BUGZILLA_OPERATION opcode,
240
			String userName) {
239
		RepositoryOperation newOperation = null;
241
		RepositoryOperation newOperation = null;
240
		switch (opcode) {
242
		switch (opcode) {
241
		case none:
243
		case none:
Lines 249-256 Link Here
249
		case resolve:
251
		case resolve:
250
			newOperation = new RepositoryOperation(opcode.toString(), OPERATION_LABEL_RESOLVE);
252
			newOperation = new RepositoryOperation(opcode.toString(), OPERATION_LABEL_RESOLVE);
251
			newOperation.setUpOptions(OPERATION_OPTION_RESOLUTION);
253
			newOperation.setUpOptions(OPERATION_OPTION_RESOLUTION);
252
			for (BUGZILLA_RESOLUTION resolution : BUGZILLA_RESOLUTION.values()) {
254
			RepositoryConfiguration config;
253
				newOperation.addOption(resolution.toString(), resolution.toString());
255
			try {
256
				config = BugzillaCorePlugin.getRepositoryConfiguration(repository, false);
257
			} catch (CoreException e) {
258
				config = null;
259
			}
260
			if (config != null && 0==1) {
261
				for (String resolution : config.getResolutions()) {
262
					// DUPLICATE and MOVED have special meanings so do not show as resolution
263
					if (resolution.compareTo("DUPLICATE")!= 0 && resolution.compareTo("MOVED")!= 0)
264
						newOperation.addOption(resolution, resolution);
265
				}
266
			} else {
267
				// LATER and REMIND must not be there in Bugzilla >= 3.0 is used
268
				//If getVersion() returns "Automatic (Use Validate Settings)" we use the Version 3 Resolution 
269
				if (repository.getVersion().compareTo("3.0")>= 0) {
270
					for (BUGZILLA_RESOLUTION_3_0 resolution : BUGZILLA_RESOLUTION_3_0.values()) {
271
						newOperation.addOption(resolution.toString(), resolution.toString());
272
					}
273
				} else {
274
					for (BUGZILLA_RESOLUTION_2_0 resolution : BUGZILLA_RESOLUTION_2_0.values()) {
275
						newOperation.addOption(resolution.toString(), resolution.toString());
276
					}
277
				}
254
			}
278
			}
255
			break;
279
			break;
256
		case duplicate:
280
		case duplicate:
(-)src/org/eclipse/mylyn/internal/bugzilla/core/IBugzillaConstants.java (-1 / +5 lines)
Lines 227-236 Link Here
227
		UNCONFIRMED, NEW, ASSIGNED, REOPENED, RESOLVED, VERIFIED, CLOSED, SCHEDULED;
227
		UNCONFIRMED, NEW, ASSIGNED, REOPENED, RESOLVED, VERIFIED, CLOSED, SCHEDULED;
228
	}
228
	}
229
229
230
	public static enum BUGZILLA_RESOLUTION {
230
	public static enum BUGZILLA_RESOLUTION_2_0 {
231
		FIXED, INVALID, WONTFIX, LATER, REMIND, WORKSFORME;
231
		FIXED, INVALID, WONTFIX, LATER, REMIND, WORKSFORME;
232
	}
232
	}
233
233
234
	public static enum BUGZILLA_RESOLUTION_3_0 {
235
		FIXED, INVALID, WONTFIX, WORKSFORME;
236
	}
237
234
	public static final String ERROR_MSG_OP_NOT_PERMITTED = "The requested operation is not permitted.";
238
	public static final String ERROR_MSG_OP_NOT_PERMITTED = "The requested operation is not permitted.";
235
239
236
	public static final String ERROR_MSG_INVALID_BUG_ID = "Invalid bug id. The requested bug id does not exist.";
240
	public static final String ERROR_MSG_INVALID_BUG_ID = "Invalid bug id. The requested bug id does not exist.";

Return to bug 161457