Code Duplication    Length = 17-17 lines in 2 locations

code/actions/PublishItemWorkflowAction.php 1 location

@@ 52-68 (lines=17) @@
49
		return true;
50
	}
51
52
	public function getCMSFields() {
53
		$fields = parent::getCMSFields();
54
55
		if (class_exists('AbstractQueuedJob')) {
56
			$before = _t('PublishItemWorkflowAction.DELAYPUBDAYSBEFORE', 'Delay publication ');
57
			$after  = _t('PublishItemWorkflowAction.DELAYPUBDAYSAFTER', ' days');
58
59
			$fields->addFieldToTab('Root.Main', new FieldGroup(
60
				_t('PublishItemWorkflowAction.PUBLICATIONDELAY', 'Publication Delay'),
61
				new LabelField('PublishDelayBefore', $before),
62
				new NumericField('PublishDelay', ''),
63
				new LabelField('PublishDelayAfter', $after)
64
			));
65
		}
66
67
		return $fields;
68
	}
69
70
	/**
71
	 * Publish action allows a user who is currently assigned at this point of the workflow to

code/actions/UnpublishItemWorkflowAction.php 1 location

@@ 48-64 (lines=17) @@
45
		return true;
46
	}
47
48
	public function getCMSFields() {
49
		$fields = parent::getCMSFields();
50
51
		if (class_exists('AbstractQueuedJob')) {
52
			$before = _t('UnpublishItemWorkflowAction.DELAYUNPUBDAYSBEFORE', 'Delay unpublishing by ');
53
			$after  = _t('UnpublishItemWorkflowAction.DELAYUNPUBDAYSAFTER', ' days');
54
55
			$fields->addFieldToTab('Root.Main', new FieldGroup(
56
				_t('UnpublishItemWorkflowAction.UNPUBLICATIONDELAY', 'Delay Un-publishing'),
57
				new LabelField('UnpublishDelayBefore', $before),
58
				new NumericField('UnpublishDelay', ''),
59
				new LabelField('UnpublishDelayAfter', $after)
60
			));
61
		}
62
63
		return $fields;
64
	}
65
66
	/**
67
	 * @param  DataObject $target