Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2016-12-02 14:11:07 -0500
committerGerrit Code Review @ Eclipse.org2017-01-22 07:14:56 -0500
commit0924348790cef34199b4e15638d5932a0eec0da7 (patch)
treee79b2e93de2f6a62bdd0becc42d29be79296065b
parentb73943da5b5d8291c6035c74e4af59df224bd333 (diff)
downloadorg.eclipse.mylyn.tasks-0924348790cef34199b4e15638d5932a0eec0da7.tar.gz
org.eclipse.mylyn.tasks-0924348790cef34199b4e15638d5932a0eec0da7.tar.xz
org.eclipse.mylyn.tasks-0924348790cef34199b4e15638d5932a0eec0da7.zip
499382: add Flag support for bugs and attachments (UI part)
Change-Id: I1be748c765db030115dbfd8ffb5603f4863b48ba Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=499382
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestFlagAttributeEditor.java363
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestFlagPart.java305
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestRepositoryConnectorUi.java7
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskAttachmentPage.java206
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPage.java11
-rw-r--r--org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb12
6 files changed, 898 insertions, 6 deletions
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestFlagAttributeEditor.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestFlagAttributeEditor.java
new file mode 100644
index 000000000..2808a7c65
--- /dev/null
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestFlagAttributeEditor.java
@@ -0,0 +1,363 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Frank Becker and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Frank Becker - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.bugzilla.rest.ui;
+
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.fieldassist.IContentProposalProvider;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.mylyn.commons.ui.CommonImages;
+import org.eclipse.mylyn.internal.tasks.ui.PersonProposalLabelProvider;
+import org.eclipse.mylyn.internal.tasks.ui.PersonProposalProvider;
+import org.eclipse.mylyn.internal.tasks.ui.editors.EditorUtil;
+import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
+import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
+import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor;
+import org.eclipse.mylyn.tasks.ui.editors.LayoutHint;
+import org.eclipse.mylyn.tasks.ui.editors.LayoutHint.ColumnSpan;
+import org.eclipse.mylyn.tasks.ui.editors.LayoutHint.RowSpan;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseTrackAdapter;
+import org.eclipse.swt.events.MouseTrackListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ImageHyperlink;
+
+public class BugzillaRestFlagAttributeEditor extends AbstractAttributeEditor {
+
+ private String[] values;
+
+ private CCombo combo;
+
+ private Text requesteeText;
+
+ private ImageHyperlink selfLink;
+
+ private Text flagText;
+
+ private Text requesteeROText;
+
+ private boolean suppressRefresh;
+
+ private Composite flagComposite;
+
+ public BugzillaRestFlagAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute) {
+ super(manager, taskAttribute);
+ setLayoutHint(new LayoutHint(RowSpan.SINGLE, ColumnSpan.SINGLE));
+ if (taskAttribute.getAttribute("state") != null) { //$NON-NLS-1$
+ setReadOnly(taskAttribute.getAttribute("state").getMetaData().isReadOnly()); //$NON-NLS-1$
+ }
+ }
+
+ @Override
+ public void createControl(Composite parent, FormToolkit toolkit) {
+ flagComposite = toolkit.createComposite(parent);
+
+ GridLayout layout = new GridLayout(2, false);
+ layout.marginHeight = 1;
+ layout.marginWidth = 1;
+ layout.horizontalSpacing = 10;
+ flagComposite.setLayout(layout);
+ if (isReadOnly()) {
+ flagText = new Text(flagComposite, SWT.FLAT | SWT.READ_ONLY);
+ toolkit.adapt(flagText, false, false);
+ flagText.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.FALSE);
+ flagText.setText(getValueLabel());
+ flagText.setBackground(parent.getBackground());
+ flagText.setEditable(false);
+ String tooltip = getTaskAttribute().getMetaData().getLabel();
+ if (tooltip == null) {
+ tooltip = getDescription();
+ }
+ if (tooltip != null) {
+ flagText.setToolTipText(tooltip);
+ }
+ TaskAttribute requestee = getTaskAttribute().getAttribute("requestee"); //$NON-NLS-1$
+ requesteeROText = new Text(flagComposite, SWT.FLAT | SWT.READ_ONLY);
+ toolkit.adapt(requesteeROText, false, false);
+ requesteeROText.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.FALSE);
+ requesteeROText.setText(requestee.getValue());
+ requesteeROText.setBackground(parent.getBackground());
+ requesteeROText.setEditable(false);
+ requesteeROText.setToolTipText(requestee.getMetaData().getValue(TaskAttribute.META_DESCRIPTION));
+ } else {
+ combo = new CCombo(flagComposite, SWT.FLAT | SWT.READ_ONLY);
+ toolkit.adapt(combo, false, false);
+ combo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
+ String tooltip = getTaskAttribute().getMetaData().getLabel();
+ if (tooltip == null) {
+ tooltip = getDescription();
+ }
+ if (tooltip != null) {
+ combo.setToolTipText(tooltip);
+ }
+ EditorUtil.addScrollListener(combo);
+
+ updateComboWithOptions();
+
+ select(getValue(), getValueLabel());
+
+ if (values != null) {
+ combo.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ int index = combo.getSelectionIndex();
+ if (index > -1) {
+ Assert.isNotNull(values);
+ Assert.isLegal(index >= 0 && index <= values.length - 1);
+ try {
+ suppressRefresh = true;
+ setValue(values[index]);
+ selectionChanged(index);
+ } finally {
+ suppressRefresh = false;
+ }
+ }
+ }
+ });
+ }
+ TaskAttribute requestee = getTaskAttribute().getAttribute("requestee"); //$NON-NLS-1$
+ if (requestee != null && !requestee.getMetaData().isReadOnly()) {
+ final Composite requesteeComposite = new Composite(flagComposite, SWT.NONE);
+ GridLayout requesteeLayout = new GridLayout(2, false);
+ requesteeLayout.marginHeight = 0;
+ requesteeLayout.marginWidth = 0;
+ requesteeLayout.horizontalSpacing = 0;
+ requesteeComposite.setLayout(requesteeLayout);
+ requesteeComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ requesteeComposite.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER);
+
+ requesteeText = toolkit.createText(requesteeComposite, requestee.getValue());
+ boolean enabled = "?".equals(getValueLabel()); //$NON-NLS-1$
+ requesteeText.setEnabled(enabled);
+ requesteeText.setToolTipText(requestee.getMetaData().getValue(TaskAttribute.META_DESCRIPTION));
+ IContentProposalProvider contentProposalProvider = new PersonProposalProvider(null,
+ requestee.getTaskData());
+ ILabelProvider labelPropsalProvider = new PersonProposalLabelProvider();
+// if (contentProposalProvider != null && labelPropsalProvider != null) {
+// ContentAssistCommandAdapter adapter = new ContentAssistCommandAdapter(requesteeText,
+// new TextContentAdapter(), contentProposalProvider,
+// ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS, new char[0], true);
+// adapter.setLabelProvider(labelPropsalProvider);
+// adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
+// }
+
+ selfLink = new ImageHyperlink(requesteeComposite, SWT.NO_FOCUS);
+ selfLink.setToolTipText("Insert My User ID");
+ selfLink.setActiveImage(CommonImages.getImage(CommonImages.PERSON_ME_SMALL));
+ selfLink.setHoverImage(CommonImages.getImage(CommonImages.PERSON_ME_SMALL));
+ selfLink.setEnabled(enabled);
+ selfLink.setBackground(requesteeText.getBackground());
+ selfLink.addHyperlinkListener(new HyperlinkAdapter() {
+ @Override
+ public void linkActivated(HyperlinkEvent e) {
+ String userName = getModel().getTaskRepository().getUserName();
+ if (userName != null && userName.length() > 0) {
+ requesteeText.setText(userName);
+ setValue(userName);
+ }
+ }
+ });
+ GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).exclude(true).applyTo(selfLink);
+ MouseTrackListener mouseListener = new MouseTrackAdapter() {
+ int version = 0;
+
+ @Override
+ public void mouseEnter(MouseEvent e) {
+ ((GridData) selfLink.getLayoutData()).exclude = false;
+ requesteeComposite.layout();
+ selfLink.setImage(CommonImages.getImage(CommonImages.PERSON_ME_SMALL));
+ selfLink.redraw();
+ version++;
+ }
+
+ @Override
+ public void mouseExit(MouseEvent e) {
+ final int lastVersion = version;
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ if (version != lastVersion || selfLink.isDisposed()) {
+ return;
+ }
+ selfLink.setImage(null);
+ selfLink.redraw();
+ ((GridData) selfLink.getLayoutData()).exclude = true;
+ requesteeComposite.layout();
+ }
+ });
+ }
+ };
+ requesteeText.addMouseTrackListener(mouseListener);
+ selfLink.addMouseTrackListener(mouseListener);
+ GridData requesteeData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ requesteeText.setLayoutData(requesteeData);
+ requesteeText.setFont(EditorUtil.TEXT_FONT);
+ requesteeText.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER);
+
+ requesteeText.addKeyListener(new KeyListener() {
+
+ public void keyReleased(KeyEvent e) {
+ try {
+ suppressRefresh = true;
+ setRequestee(requesteeText.getText());
+ } finally {
+ suppressRefresh = false;
+ }
+ }
+
+ public void keyPressed(KeyEvent e) {
+ }
+ });
+ requesteeText.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ try {
+ suppressRefresh = true;
+ setRequestee(requesteeText.getText());
+ } finally {
+ suppressRefresh = false;
+ }
+ }
+ });
+ toolkit.adapt(requesteeText, false, false);
+
+ }
+ }
+ toolkit.paintBordersFor(flagComposite);
+ setControl(flagComposite);
+ }
+
+ private void updateComboWithOptions() {
+ Map<String, String> labelByValue = getAttributeMapper().getAssoctiatedAttribute(getTaskAttribute())
+ .getOptions();
+ if (labelByValue != null) {
+ combo.removeAll();
+ values = labelByValue.keySet().toArray(new String[0]);
+ for (String value : values) {
+ combo.add(labelByValue.get(value));
+ }
+ }
+ }
+
+ public String getValue() {
+ return getAttributeMapper().getValue(getAttributeMapper().getAssoctiatedAttribute(getTaskAttribute()));
+ }
+
+ public String getValueLabel() {
+ return getAttributeMapper().getValueLabel(getAttributeMapper().getAssoctiatedAttribute(getTaskAttribute()));
+ }
+
+ private void select(String value, String label) {
+ if (values != null) {
+ for (int i = 0; i < values.length; i++) {
+ if (values[i].equals(value)) {
+ combo.select(i);
+ break;
+ }
+ }
+ } else {
+ combo.setText(label);
+ }
+ }
+
+ public void setRequestee(String value) {
+ TaskAttribute requestee = getTaskAttribute().getAttribute("requestee"); //$NON-NLS-1$
+ if (requestee != null) {
+ if (!requestee.getValue().equals(value)) {
+ getAttributeMapper().setValue(requestee, value);
+ attributeChanged();
+ }
+ }
+ }
+
+ public void setValue(String value) {
+ getAttributeMapper().setValue(getAttributeMapper().getAssoctiatedAttribute(getTaskAttribute()), value);
+ attributeChanged();
+ }
+
+ @Override
+ public String getLabel() {
+ String label = getAttributeMapper().getLabel(getAttributeMapper().getAssoctiatedAttribute(getTaskAttribute()));
+ if (label != null) {
+ label.replace("&", "&&"); //$NON-NLS-1$//$NON-NLS-2$
+ } else {
+ label = ""; //$NON-NLS-1$
+ }
+
+ TaskAttribute setter = getTaskAttribute().getAttribute("setter"); //$NON-NLS-1$
+ if (setter != null) {
+ String setterValue = setter.getValue();
+ if (setterValue != null && !setterValue.equals("")) { //$NON-NLS-1$
+ if (setterValue.indexOf("@") > -1) { //$NON-NLS-1$
+ setterValue = setterValue.substring(0, setterValue.indexOf("@")); //$NON-NLS-1$
+ }
+ label = setterValue + ": " + label; //$NON-NLS-1$
+ }
+ }
+ return label;
+ }
+
+ @Override
+ public void refresh() {
+ if (flagText != null && !flagText.isDisposed()) {
+ flagText.setText(getValueLabel());
+ }
+ if (combo != null && !combo.isDisposed()) {
+ updateComboWithOptions();
+ select(getValue(), getValueLabel());
+ if (combo.getSelectionIndex() >= 0) {
+ selectionChanged(combo.getSelectionIndex());
+ }
+ }
+ TaskAttribute requestee = getTaskAttribute().getAttribute("requestee"); //$NON-NLS-1$
+ if (requestee != null) {
+ if (requesteeROText != null && !requesteeROText.isDisposed()) {
+ requesteeROText.setText(requestee.getValue());
+ }
+ if (requesteeText != null && !requesteeText.isDisposed()) {
+ requesteeText.setText(requestee.getValue());
+ }
+ }
+ updateLabel();
+ if (flagComposite != null && !flagComposite.isDisposed()) {
+ flagComposite.layout();
+ }
+ }
+
+ @Override
+ public boolean shouldAutoRefresh() {
+ return !suppressRefresh;
+ }
+
+ private void selectionChanged(int index) {
+ if (requesteeText != null) {
+ requesteeText.setEnabled(values[index].equals("?")); //$NON-NLS-1$
+ selfLink.setEnabled(values[index].equals("?")); //$NON-NLS-1$
+ }
+ }
+}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestFlagPart.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestFlagPart.java
new file mode 100644
index 000000000..eb917560a
--- /dev/null
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestFlagPart.java
@@ -0,0 +1,305 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Frank Becker and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Frank Becker - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.bugzilla.rest.ui;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.jface.action.LegacyActionTools;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.mylyn.internal.bugzilla.rest.core.IBugzillaRestConstants;
+import org.eclipse.mylyn.internal.tasks.ui.editors.EditorUtil;
+import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskDiffUtil;
+import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
+import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor;
+import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPart;
+import org.eclipse.mylyn.tasks.ui.editors.LayoutHint;
+import org.eclipse.mylyn.tasks.ui.editors.LayoutHint.ColumnSpan;
+import org.eclipse.mylyn.tasks.ui.editors.LayoutHint.RowSpan;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.IFormColors;
+import org.eclipse.ui.forms.events.ExpansionAdapter;
+import org.eclipse.ui.forms.events.ExpansionEvent;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+public class BugzillaRestFlagPart extends AbstractTaskEditorPart {
+ private static final int LABEL_WIDTH = 110;
+
+ private static final int COLUMN_WIDTH = 140;
+
+ private static final int COLUMN_GAP = 20;
+
+ private static final int MULTI_COLUMN_WIDTH = COLUMN_WIDTH + 5 + COLUMN_GAP + LABEL_WIDTH + 5 + COLUMN_WIDTH;
+
+ private static final int MULTI_ROW_HEIGHT = 55;
+
+ private boolean hasIncoming;
+
+ private List<AbstractAttributeEditor> flagEditors;
+
+ private String infoOverlayText = null;
+
+ private String infoOverlayTooltipText = null;
+
+ public BugzillaRestFlagPart() {
+ setPartName("Flags");
+ }
+
+ @Override
+ public void createControl(Composite parent, FormToolkit toolkit) {
+ initialize();
+ if (flagEditors.size() == 0) {
+ return;
+ }
+ int style = ExpandableComposite.TWISTIE | ExpandableComposite.LEFT_TEXT_CLIENT_ALIGNMENT;
+ if (hasIncoming) {
+ style |= ExpandableComposite.EXPANDED;
+ }
+ Section flagSection = createSection(parent, toolkit, style);
+ EditorUtil.setTitleBarForeground(flagSection, toolkit.getColors().getColor(IFormColors.TITLE));
+
+ GridLayout gl = new GridLayout();
+ GridData gd = new GridData(SWT.FILL, SWT.NONE, false, false);
+ gd.horizontalSpan = 4;
+ flagSection.setLayout(gl);
+ flagSection.setLayoutData(gd);
+
+ Composite flagComposite = toolkit.createComposite(flagSection);
+
+ GridLayout flagsLayout = EditorUtil.createSectionClientLayout();
+ flagsLayout.numColumns = 4;
+ flagsLayout.horizontalSpacing = 7;
+ flagsLayout.verticalSpacing = 6;
+ flagComposite.setLayout(flagsLayout);
+
+ GridData flagsData = new GridData(GridData.FILL_BOTH);
+ flagsData.horizontalSpan = 1;
+ flagsData.grabExcessVerticalSpace = false;
+ flagComposite.setLayoutData(flagsData);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(true, false).applyTo(flagComposite);
+
+ createAttributeControls(flagComposite, toolkit, flagsLayout.numColumns);
+ flagSection.setClient(flagComposite);
+ toolkit.paintBordersFor(flagComposite);
+ setSection(toolkit, flagSection);
+ }
+
+ private void initialize() {
+ hasIncoming = false;
+ flagEditors = new ArrayList<AbstractAttributeEditor>();
+ int used = 0;
+ int unused = 0;
+ String usedDetail = ""; //$NON-NLS-1$
+ String unusedDetail = ""; //$NON-NLS-1$
+ Map<String, TaskAttribute> attributes = getTaskData().getRoot().getAttributes();
+ for (TaskAttribute attribute : attributes.values()) {
+ if (!IBugzillaRestConstants.KIND_FLAG.equals(attribute.getMetaData().getKind())) {
+ continue;
+ }
+
+ TaskAttribute stateAttribute = attribute.getAttribute("state"); //$NON-NLS-1$
+ if (stateAttribute == null) {
+ continue;
+ }
+ String val = stateAttribute.getValue();
+ if (val != null && !val.equals("") && !val.equals(" ")) { //$NON-NLS-1$ //$NON-NLS-2$
+ if (used > 0) {
+ usedDetail += ", "; //$NON-NLS-1$
+ }
+ used++;
+ usedDetail += stateAttribute.getMetaData().getLabel();
+ } else {
+ if (unused > 0) {
+ unusedDetail += ", "; //$NON-NLS-1$
+ }
+ unused++;
+ unusedDetail += stateAttribute.getMetaData().getLabel();
+ }
+ AbstractAttributeEditor attributeEditor = createAttributeEditor(attribute);
+ if (attributeEditor != null) {
+ flagEditors.add(attributeEditor);
+ if (getModel().hasIncomingChanges(attribute)) {
+ hasIncoming = true;
+ }
+ }
+ }
+ Comparator<AbstractAttributeEditor> attributeSorter = createAttributeEditorSorter();
+ if (attributeSorter != null) {
+ Collections.sort(flagEditors, attributeSorter);
+ }
+
+ if (used > 0) {
+ infoOverlayText = NLS.bind(" " + "{0} Flags ({1} set)", "" + (unused + used), "" + used); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ } else {
+ infoOverlayText = NLS.bind(" " + "{0} Flags", "" + (unused + used)); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ usedDetail = NLS.bind("{0} {1}", used == 1 ? "{0} Flags" + " is" : "set flags" + " are", usedDetail); //$NON-NLS-1$
+ unusedDetail = NLS.bind("{0} {1}", unused == 1 ? "{0} Flags" + " is" : "unused flags" + " are", unusedDetail); //$NON-NLS-1$
+ if (used > 0 && unused > 0) {
+ infoOverlayTooltipText = NLS.bind("{0}\n{1}", usedDetail, unusedDetail); //$NON-NLS-1$
+ } else {
+ infoOverlayTooltipText = used > 0 ? usedDetail : unusedDetail;
+ }
+ }
+
+ /**
+ * Create a comparator by which attribute editors will be sorted. By default attribute editors are sorted by layout
+ * hint priority. Subclasses may override this method to sort attribute editors in a custom way.
+ *
+ * @return comparator for {@link AbstractAttributeEditor} objects
+ */
+ protected Comparator<AbstractAttributeEditor> createAttributeEditorSorter() {
+ return new Comparator<AbstractAttributeEditor>() {
+ public int compare(AbstractAttributeEditor o1, AbstractAttributeEditor o2) {
+ int p1 = (o1.getLayoutHint() != null) ? o1.getLayoutHint().getPriority() : LayoutHint.DEFAULT_PRIORITY;
+ int p2 = (o2.getLayoutHint() != null) ? o2.getLayoutHint().getPriority() : LayoutHint.DEFAULT_PRIORITY;
+ return p1 - p2;
+ }
+ };
+ }
+
+ private void createAttributeControls(Composite attributesComposite, FormToolkit toolkit, int columnCount) {
+ int currentColumn = 1;
+ int currentPriority = 0;
+ for (AbstractAttributeEditor attributeEditor : flagEditors) {
+ int priority = (attributeEditor.getLayoutHint() != null)
+ ? attributeEditor.getLayoutHint().getPriority()
+ : LayoutHint.DEFAULT_PRIORITY;
+ if (priority != currentPriority) {
+ currentPriority = priority;
+ if (currentColumn > 1) {
+ while (currentColumn <= columnCount) {
+ getManagedForm().getToolkit().createLabel(attributesComposite, ""); //$NON-NLS-1$
+ currentColumn++;
+ }
+ currentColumn = 1;
+ }
+ }
+
+ if (attributeEditor.hasLabel()) {
+ attributeEditor.createLabelControl(attributesComposite, toolkit);
+ Label label = attributeEditor.getLabelControl();
+ String text = label.getText();
+ String shortenText = TaskDiffUtil.shortenText(label, text, LABEL_WIDTH);
+ label.setText(shortenText);
+ if (!text.equals(shortenText)) {
+ label.setToolTipText(text);
+ }
+ GridData gd = GridDataFactory.fillDefaults()
+ .align(SWT.RIGHT, SWT.CENTER)
+ .hint(LABEL_WIDTH, SWT.DEFAULT)
+ .create();
+ if (currentColumn > 1) {
+ gd.horizontalIndent = COLUMN_GAP;
+ gd.widthHint = LABEL_WIDTH + COLUMN_GAP;
+ }
+ label.setLayoutData(gd);
+ currentColumn++;
+ }
+
+ attributeEditor.createControl(attributesComposite, toolkit);
+ LayoutHint layoutHint = attributeEditor.getLayoutHint();
+ GridData gd = new GridData(SWT.FILL, SWT.CENTER, false, false);
+ if (layoutHint != null
+ && !(layoutHint.rowSpan == RowSpan.SINGLE && layoutHint.columnSpan == ColumnSpan.SINGLE)) {
+ if (layoutHint.rowSpan == RowSpan.MULTIPLE) {
+ gd.heightHint = MULTI_ROW_HEIGHT;
+ }
+ if (layoutHint.columnSpan == ColumnSpan.SINGLE) {
+ gd.widthHint = COLUMN_WIDTH;
+ gd.horizontalSpan = 1;
+ } else {
+ gd.widthHint = MULTI_COLUMN_WIDTH;
+ gd.horizontalSpan = columnCount - currentColumn + 1;
+ }
+ } else {
+ gd.widthHint = COLUMN_WIDTH;
+ gd.horizontalSpan = 1;
+ }
+ attributeEditor.getControl().setLayoutData(gd);
+
+ getTaskEditorPage().getAttributeEditorToolkit().adapt(attributeEditor);
+
+ currentColumn += gd.horizontalSpan;
+ currentColumn %= columnCount;
+ }
+ }
+
+ protected String getInfoOverlayText() {
+ return infoOverlayText;
+ }
+
+ protected String getInfoOverlayTooltipText() {
+ return infoOverlayTooltipText;
+ }
+
+ private void createInfoOverlay(Composite composite, Section section, FormToolkit toolkit) {
+ String text = getInfoOverlayText();
+ if (text == null) {
+ return;
+ }
+
+ final Label label = toolkit.createLabel(composite, LegacyActionTools.escapeMnemonics(text));
+ label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ label.setBackground(null);
+ label.setVisible(!section.isExpanded());
+ label.setToolTipText(getInfoOverlayTooltipText());
+
+ section.addExpansionListener(new ExpansionAdapter() {
+ @Override
+ public void expansionStateChanging(ExpansionEvent e) {
+ label.setVisible(!e.getState());
+ }
+ });
+ }
+
+ @Override
+ protected void setSection(FormToolkit toolkit, Section section) {
+ if (section.getTextClient() == null) {
+ ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
+ fillToolBar(toolBarManager);
+
+ if (toolBarManager.getSize() > 0 || getInfoOverlayText() != null) {
+ Composite toolbarComposite = toolkit.createComposite(section);
+ toolbarComposite.setBackground(null);
+ RowLayout rowLayout = new RowLayout();
+ rowLayout.marginLeft = 0;
+ rowLayout.marginRight = 0;
+ rowLayout.marginTop = 0;
+ rowLayout.marginBottom = 0;
+ rowLayout.center = true;
+ toolbarComposite.setLayout(rowLayout);
+
+ createInfoOverlay(toolbarComposite, section, toolkit);
+
+ toolBarManager.createControl(toolbarComposite);
+ section.clientVerticalSpacing = 0;
+ section.descriptionVerticalSpacing = 0;
+ section.setTextClient(toolbarComposite);
+ }
+ }
+ setControl(section);
+ }
+}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestRepositoryConnectorUi.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestRepositoryConnectorUi.java
index a9d096c82..c270e8302 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestRepositoryConnectorUi.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestRepositoryConnectorUi.java
@@ -12,6 +12,7 @@
package org.eclipse.mylyn.internal.bugzilla.rest.ui;
import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.mylyn.internal.bugzilla.rest.core.BugzillaRestConnector;
import org.eclipse.mylyn.internal.bugzilla.rest.core.BugzillaRestCore;
import org.eclipse.mylyn.internal.bugzilla.rest.core.BugzillaRestTaskAttributeMapper;
@@ -21,6 +22,7 @@ import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITaskMapping;
import org.eclipse.mylyn.tasks.core.TaskRepository;
+import org.eclipse.mylyn.tasks.core.data.TaskAttachmentModel;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi;
import org.eclipse.mylyn.tasks.ui.wizards.ITaskRepositoryPage;
@@ -84,4 +86,9 @@ public class BugzillaRestRepositoryConnectorUi extends AbstractRepositoryConnect
return true;
}
+ @Override
+ public IWizardPage getTaskAttachmentPage(TaskAttachmentModel model) {
+ return new BugzillaRestTaskAttachmentPage(model);
+ }
+
}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskAttachmentPage.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskAttachmentPage.java
new file mode 100644
index 000000000..5346d0eff
--- /dev/null
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskAttachmentPage.java
@@ -0,0 +1,206 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Frank Becker and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Frank Becker - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.bugzilla.rest.ui;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.mylyn.commons.workbench.forms.SectionComposite;
+import org.eclipse.mylyn.internal.bugzilla.rest.core.BugzillaRestAttachmentMapper;
+import org.eclipse.mylyn.internal.bugzilla.rest.core.BugzillaRestConnector;
+import org.eclipse.mylyn.internal.bugzilla.rest.core.IBugzillaRestConstants;
+import org.eclipse.mylyn.internal.bugzilla.rest.core.response.data.FlagType;
+import org.eclipse.mylyn.tasks.core.data.TaskAttachmentModel;
+import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
+import org.eclipse.mylyn.tasks.ui.TasksUi;
+import org.eclipse.mylyn.tasks.ui.wizards.TaskAttachmentPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.events.ExpansionAdapter;
+import org.eclipse.ui.forms.events.ExpansionEvent;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+public class BugzillaRestTaskAttachmentPage extends TaskAttachmentPage {
+ private final List<FlagType> flagAttributes = new ArrayList<FlagType>();
+
+ private final FormToolkit toolkit;
+
+ private ExpandableComposite flagExpandComposite = null;
+
+ private Composite flagScrollComposite;
+
+ private SectionComposite scrolledComposite;
+
+ private Composite scrolledBodyComposite;
+
+ public BugzillaRestTaskAttachmentPage(TaskAttachmentModel model) {
+ super(model);
+ BugzillaRestAttachmentMapper attachmentMapper = BugzillaRestAttachmentMapper.createFrom(model.getAttribute());
+ attachmentMapper.addMissingFlags(model.getAttribute());
+ toolkit = new FormToolkit(Display.getCurrent());
+ }
+
+ private void updateScrolledCompositeSize() {
+ Point p = scrolledBodyComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
+ scrolledComposite.setMinSize(p);
+ Shell shell = getShell();
+ shell.pack();
+ Point shellSize = shell.getSize();
+ shellSize.x++;
+ shell.setSize(shellSize);
+ shellSize.x--;
+ shell.setSize(shellSize);
+ shell.pack();
+ }
+
+ private void createScrolledComposite(Composite parent) {
+ scrolledComposite = new SectionComposite(parent, SWT.NONE) {
+ @Override
+ public Point computeSize(int hint, int hint2, boolean changed) {
+ return new Point(64, 64);
+ }
+ };
+ scrolledBodyComposite = scrolledComposite.getContent();
+ scrolledBodyComposite.setLayout(new GridLayout());
+ scrolledComposite.setContent(scrolledBodyComposite);
+ setControl(scrolledComposite);
+ Dialog.applyDialogFont(scrolledBodyComposite);
+ }
+
+ private Composite getScrolledBodyComposite() {
+ return scrolledBodyComposite;
+ }
+
+ @Override
+ public void createControl(Composite parent) {
+ createScrolledComposite(parent);
+ updateScrolledCompositeSize();
+ super.createControl(getScrolledBodyComposite());
+ BugzillaRestConnector connector = (BugzillaRestConnector) TasksUi
+ .getRepositoryConnector(getModel().getTaskRepository().getConnectorKind());
+ Control[] children = getScrolledBodyComposite().getChildren();
+ Composite pageComposite = (Composite) children[children.length - 1];
+ Composite flagComposite = null;
+ for (TaskAttribute attribute : getModel().getAttribute().getAttributes().values()) {
+ if (flagComposite == null) {
+ flagComposite = createFlagSection(pageComposite);
+ }
+ if (attribute.getId().startsWith(IBugzillaRestConstants.KIND_FLAG_TYPE)) {
+ TaskAttribute stateAttribute = attribute.getTaskData().getAttributeMapper().getAssoctiatedAttribute(
+ attribute);
+ TaskAttribute requesteeAttribute = attribute.getAttribute("requestee");
+ Label flagLiteral = new Label(flagComposite, SWT.NONE);
+ flagLiteral.setText(stateAttribute.getMetaData().getLabel());
+ flagLiteral.setToolTipText(attribute.getMetaData().getValue(TaskAttribute.META_DESCRIPTION));
+ final Combo flagState = new Combo(flagComposite, SWT.BORDER | SWT.DROP_DOWN | SWT.READ_ONLY);
+ for (String option : stateAttribute.getOptions().values()) {
+ flagState.add(option);
+ }
+ if (!requesteeAttribute.getMetaData().isReadOnly()) {
+ flagState.setLayoutData(new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false, 1, 1));
+ final Text requesteeText = new Text(flagComposite, SWT.BORDER);
+ requesteeText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
+ requesteeText.setEditable(false);
+ requesteeText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ TaskAttribute requesteeAttribute = attribute.getAttribute("requestee"); //$NON-NLS-1$
+ if (requesteeAttribute != null) {
+ String value = requesteeText.getText().trim();
+ requesteeAttribute.setValue(value);
+ }
+ }
+ });
+ flagState.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // ignore
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ TaskAttribute state = attribute.getAttribute("state"); //$NON-NLS-1$
+ if (state != null) {
+ String value = flagState.getItem(flagState.getSelectionIndex());
+ state.setValue(value);
+ requesteeText.setEditable(value.equals("?")); //$NON-NLS-1$
+ }
+ }
+ });
+ } else {
+ flagState.setLayoutData(new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false, 2, 1));
+ flagState.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // ignore
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ TaskAttribute state = attribute.getAttribute("state"); //$NON-NLS-1$
+ String value = flagState.getItem(flagState.getSelectionIndex());
+ if (state != null && value != null) {
+ state.setValue(value);
+ }
+ }
+ });
+ }
+ }
+ }
+
+ updateScrolledCompositeSize();
+ }
+
+ private Composite createFlagSection(Composite container) {
+ flagExpandComposite = toolkit.createExpandableComposite(container,
+ ExpandableComposite.COMPACT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR);
+ flagExpandComposite.setFont(container.getFont());
+ flagExpandComposite.setBackground(container.getBackground());
+ flagExpandComposite.setText("Advanced");
+ flagExpandComposite.setLayout(new GridLayout(3, false));
+ GridData g = new GridData(SWT.FILL, SWT.TOP, true, false);
+ g.horizontalSpan = 3;
+ flagExpandComposite.setLayoutData(g);
+ flagExpandComposite.addExpansionListener(new ExpansionAdapter() {
+ @Override
+ public void expansionStateChanged(ExpansionEvent e) {
+ updateScrolledCompositeSize();
+ getControl().getShell().pack();
+ }
+ });
+
+ flagScrollComposite = new Composite(flagExpandComposite, SWT.NONE);
+ flagScrollComposite.setLayout(new GridLayout(3, false));
+ flagExpandComposite.setClient(flagScrollComposite);
+ return flagScrollComposite;
+ }
+
+ @Override
+ public void dispose() {
+ if (toolkit != null) {
+ if (toolkit.getColors() != null) {
+ toolkit.dispose();
+ }
+ }
+ super.dispose();
+ }
+}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPage.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPage.java
index 44d20b61a..420ce3cd6 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPage.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPage.java
@@ -28,6 +28,9 @@ import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditorPartDescriptor;
public class BugzillaRestTaskEditorPage extends AbstractTaskEditorPage {
+ public static final String ID_PART_BUGZILLA_FLAGS = "org.eclipse.mylyn.bugzilla.rest.ui.editors.part.flags"; //$NON-NLS-1$
+
+ public static final String PATH_FLAGS = "flags"; //$NON-NLS-1$
public BugzillaRestTaskEditorPage(TaskEditor editor) {
this(editor, BugzillaRestCore.CONNECTOR_KIND);
@@ -50,6 +53,8 @@ public class BugzillaRestTaskEditorPage extends AbstractTaskEditorPage {
editor = new BugzillaCcAttributeEditor(getModel(), taskAttribute);
} else if (IBugzillaRestConstants.EDITOR_TYPE_KEYWORD.equals(type)) {
editor = new BugzillaKeywordAttributeEditor(getModel(), taskAttribute);
+ } else if (IBugzillaRestConstants.EDITOR_TYPE_FLAG.equals(type)) {
+ editor = new BugzillaRestFlagAttributeEditor(getModel(), taskAttribute);
} else {
editor = super.createEditor(type, taskAttribute);
}
@@ -80,6 +85,12 @@ public class BugzillaRestTaskEditorPage extends AbstractTaskEditorPage {
return new BugzillaRestTaskEditorPeoplePart();
}
}.setPath(PATH_PEOPLE));
+ descriptors.add(new TaskEditorPartDescriptor(ID_PART_BUGZILLA_FLAGS) {
+ @Override
+ public AbstractTaskEditorPart createPart() {
+ return new BugzillaRestFlagPart();
+ }
+ }.setPath(ID_PART_ATTRIBUTES + "/" + PATH_FLAGS)); //$NON-NLS-1$
return descriptors;
}
diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb
index 40a6bb146..92fecbd92 100644
--- a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb
+++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb
@@ -302,7 +302,7 @@ sub install_before_final_checks {
# set the inclusion to __Any__:__Any__
my $sth = $dbh->prepare("INSERT INTO flaginclusions
(type_id, product_id, component_id) VALUES (?, ?, ?)");
- $sth->execute(bless($flagtype,, 'Bugzilla::FlagType' )->id, undef, undef);
+ $sth->execute(bless($flagtype, 'Bugzilla::FlagType' )->id, undef, undef);
$flagtype = Bugzilla::FlagType->insert_create_data({
name => 'BugFlag2',
@@ -318,7 +318,7 @@ sub install_before_final_checks {
# set the inclusion to __Any__:__Any__
$sth = $dbh->prepare("INSERT INTO flaginclusions
(type_id, product_id, component_id) VALUES (?, ?, ?)");
- $sth->execute(bless($flagtype,, 'Bugzilla::FlagType' )->id, undef, undef);
+ $sth->execute(bless($flagtype, 'Bugzilla::FlagType' )->id, undef, undef);
$flagtype = Bugzilla::FlagType->insert_create_data({
name => 'AttachmentFlag1',
@@ -334,7 +334,7 @@ sub install_before_final_checks {
# set the inclusion to __Any__:__Any__
$sth = $dbh->prepare("INSERT INTO flaginclusions
(type_id, product_id, component_id) VALUES (?, ?, ?)");
- $sth->execute(bless($flagtype,, 'Bugzilla::FlagType' )->id, undef, undef);
+ $sth->execute(bless($flagtype, 'Bugzilla::FlagType' )->id, undef, undef);
$flagtype = Bugzilla::FlagType->insert_create_data({
name => 'AttachmentFlag2',
@@ -350,7 +350,7 @@ sub install_before_final_checks {
# set the inclusion to __Any__:__Any__
$sth = $dbh->prepare("INSERT INTO flaginclusions
(type_id, product_id, component_id) VALUES (?, ?, ?)");
- $sth->execute(bless($flagtype,, 'Bugzilla::FlagType' )->id, undef, undef);
+ $sth->execute(bless($flagtype, 'Bugzilla::FlagType' )->id, undef, undef);
$flagtype = Bugzilla::FlagType->insert_create_data({
name => 'BugFlag3',
@@ -366,7 +366,7 @@ sub install_before_final_checks {
# set the inclusion to __Any__:__Any__
$sth = $dbh->prepare("INSERT INTO flaginclusions
(type_id, product_id, component_id) VALUES (?, ?, ?)");
- $sth->execute(bless($flagtype,, 'Bugzilla::FlagType' )->id, undef, undef);
+ $sth->execute(bless($flagtype, 'Bugzilla::FlagType' )->id, undef, undef);
$flagtype = Bugzilla::FlagType->insert_create_data({
name => 'BugFlag4',
@@ -382,7 +382,7 @@ sub install_before_final_checks {
# set the inclusion to __Any__:__Any__
$sth = $dbh->prepare("INSERT INTO flaginclusions
(type_id, product_id, component_id) VALUES (?, ?, ?)");
- $sth->execute(bless($flagtype,, 'Bugzilla::FlagType' )->id, undef, undef);
+ $sth->execute(bless($flagtype, 'Bugzilla::FlagType' )->id, undef, undef);
}
if (!$dbh->selectrow_array('SELECT 1 FROM keyworddefs')) {

Back to the top