@@ -78,6 +78,9 @@ |
||
78 | 78 | && $this->mappingExists($mapping_tracker->getId()); |
79 | 79 | } |
80 | 80 | |
81 | + /** |
|
82 | + * @param integer $mapping_tracker_id |
|
83 | + */ |
|
81 | 84 | private function mappingExists($mapping_tracker_id) { |
82 | 85 | return isset($this->existing_mappings[$mapping_tracker_id]) |
83 | 86 | && $this->existing_mappings[$mapping_tracker_id] instanceof Cardwall_OnTop_Config_TrackerMappingFreestyle; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * Get all mappings defined for the cardwall on top of a tracker |
66 | 66 | * |
67 | 67 | * @param Tracker $tracker The tracker |
68 | - * @param array $columns array of Cardwall_Column |
|
68 | + * @param Cardwall_OnTop_Config_ColumnCollection $columns array of Cardwall_Column |
|
69 | 69 | * |
70 | 70 | * @return Cardwall_OnTop_Config_TrackerMapping[] |
71 | 71 | */ |
@@ -113,6 +113,7 @@ discard block |
||
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
116 | + * @param Tracker_FormElement_Field $mapping_field |
|
116 | 117 | * @return Cardwall_OnTop_Config_TrackerMappingFreestyle |
117 | 118 | */ |
118 | 119 | private function instantiateFreestyleMapping(Tracker $tracker, array &$mappings, Tracker $mapping_tracker, array $available_fields, $mapping_field) { |
@@ -126,7 +127,7 @@ discard block |
||
126 | 127 | } |
127 | 128 | |
128 | 129 | /** |
129 | - * @return Cardwall_OnTop_Config_TrackerMappingFreestyle |
|
130 | + * @return Cardwall_OnTop_Config_TrackerMappingNoField |
|
130 | 131 | */ |
131 | 132 | private function instantiateNoFieldMapping(Tracker $mapping_tracker, array $available_fields) { |
132 | 133 | return new Cardwall_OnTop_Config_TrackerMappingNoField( |
@@ -65,10 +65,16 @@ |
||
65 | 65 | return $this->matchLabel($artifact_status_label) || $this->matchNone($artifact_status_label); |
66 | 66 | } |
67 | 67 | |
68 | + /** |
|
69 | + * @param string $artifact_status_label |
|
70 | + */ |
|
68 | 71 | private function matchLabel($artifact_status_label) { |
69 | 72 | return $this->getValueLabel() == $artifact_status_label; |
70 | 73 | } |
71 | 74 | |
75 | + /** |
|
76 | + * @param string $artifact_status_label |
|
77 | + */ |
|
72 | 78 | private function matchNone($artifact_status_label) { |
73 | 79 | return $artifact_status_label === null && $this->getValueId() == 100; |
74 | 80 | } |
@@ -29,6 +29,9 @@ discard block |
||
29 | 29 | return $this->generateAdminForm($config); |
30 | 30 | } |
31 | 31 | |
32 | + /** |
|
33 | + * @param Cardwall_OnTop_Config $config |
|
34 | + */ |
|
32 | 35 | private function generateAdminForm($config) { |
33 | 36 | $column_definition_view = new Cardwall_OnTop_Config_View_ColumnDefinition($config); |
34 | 37 | $checked = $config->isEnabled() ? 'checked="checked"' : ''; |
@@ -52,6 +55,8 @@ discard block |
||
52 | 55 | } |
53 | 56 | |
54 | 57 | /** |
58 | + * @param string $page |
|
59 | + * @param string $category |
|
55 | 60 | * @return string |
56 | 61 | */ |
57 | 62 | private function translate($page, $category, $args = "") { |
@@ -207,6 +207,9 @@ discard block |
||
207 | 207 | return $html; |
208 | 208 | } |
209 | 209 | |
210 | + /** |
|
211 | + * @param Cardwall_Column $column |
|
212 | + */ |
|
210 | 213 | private function decorateEdit($column) { |
211 | 214 | $id = 'column_'. $column->id .'_field'; |
212 | 215 | $hexa = ColorHelper::CssRGBToHexa($column->bgcolor); |
@@ -215,6 +218,10 @@ discard block |
||
215 | 218 | return $html; |
216 | 219 | } |
217 | 220 | |
221 | + /** |
|
222 | + * @param string $id |
|
223 | + * @param string $classname |
|
224 | + */ |
|
218 | 225 | private function fetchSquareColor($id, $title, $classname, $img = 'blank16x16.png') { |
219 | 226 | $html = ''; |
220 | 227 | $bgcolor = "background-color:$title;"; |
@@ -261,6 +268,8 @@ discard block |
||
261 | 268 | } |
262 | 269 | |
263 | 270 | /** |
271 | + * @param string $page |
|
272 | + * @param string $category |
|
264 | 273 | * @return string |
265 | 274 | */ |
266 | 275 | protected function translate($page, $category, $args = "") { |
@@ -43,8 +43,7 @@ discard block |
||
43 | 43 | /** |
44 | 44 | * Get Frestyle columns for Cardwall_OnTop, or status columns if none |
45 | 45 | * |
46 | - * @param Tracker $tracker |
|
47 | - * @return Cardwall_OnTop_Config_ColumnCollection |
|
46 | + * @return boolean |
|
48 | 47 | */ |
49 | 48 | public function getDashboardColumns() { |
50 | 49 | return false; |
@@ -52,7 +51,7 @@ discard block |
||
52 | 51 | |
53 | 52 | /** |
54 | 53 | * Get Columns from the values of a $field |
55 | - * @return Cardwall_OnTop_Config_ColumnCollection |
|
54 | + * @return boolean |
|
56 | 55 | */ |
57 | 56 | public function getRendererColumns(Tracker_FormElement_Field_List $cardwall_field) { |
58 | 57 | return false; |
@@ -91,7 +90,7 @@ discard block |
||
91 | 90 | * |
92 | 91 | * @param array $fields array of Tracker_FormElement_Field_Selectbox |
93 | 92 | * |
94 | - * @return Cardwall_MappingCollection |
|
93 | + * @return boolean |
|
95 | 94 | */ |
96 | 95 | public function getCardwallMappings(array $fields, Cardwall_OnTop_Config_ColumnCollection $cardwall_columns) { |
97 | 96 | return false; |
@@ -37,7 +37,7 @@ |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
40 | - * @param Tracker $tracker |
|
40 | + * @param Tracker $tracker_id |
|
41 | 41 | * |
42 | 42 | * @return \Cardwall_OnTop_Config |
43 | 43 | */ |
@@ -41,6 +41,9 @@ discard block |
||
41 | 41 | return $this->update($sql); |
42 | 42 | } |
43 | 43 | |
44 | + /** |
|
45 | + * @param integer $tracker_id |
|
46 | + */ |
|
44 | 47 | public function disable($tracker_id) { |
45 | 48 | $tracker_id = $this->da->escapeInt($tracker_id); |
46 | 49 | $sql = "DELETE FROM plugin_cardwall_on_top |
@@ -49,6 +52,7 @@ discard block |
||
49 | 52 | } |
50 | 53 | |
51 | 54 | /** |
55 | + * @param integer $tracker_id |
|
52 | 56 | * @return boolean |
53 | 57 | */ |
54 | 58 | public function isFreestyleEnabled($tracker_id) { |
@@ -66,10 +70,16 @@ discard block |
||
66 | 70 | return $this->updateFreestyleColumns($tracker_id, 1); |
67 | 71 | } |
68 | 72 | |
73 | + /** |
|
74 | + * @param integer $tracker_id |
|
75 | + */ |
|
69 | 76 | public function disableFreestyleColumns($tracker_id) { |
70 | 77 | return $this->updateFreestyleColumns($tracker_id, 0); |
71 | 78 | } |
72 | 79 | |
80 | + /** |
|
81 | + * @param integer $value |
|
82 | + */ |
|
73 | 83 | private function updateFreestyleColumns($tracker_id, $value) { |
74 | 84 | $tracker_id = $this->da->escapeInt($tracker_id); |
75 | 85 | $value = $this->da->escapeInt($value); |
@@ -24,12 +24,24 @@ discard block |
||
24 | 24 | */ |
25 | 25 | interface Cardwall_OnTop_IConfig { |
26 | 26 | |
27 | + /** |
|
28 | + * @return Tracker|null |
|
29 | + */ |
|
27 | 30 | public function getTracker(); |
28 | 31 | |
32 | + /** |
|
33 | + * @return boolean |
|
34 | + */ |
|
29 | 35 | public function isEnabled(); |
30 | 36 | |
37 | + /** |
|
38 | + * @return boolean |
|
39 | + */ |
|
31 | 40 | public function enable(); |
32 | 41 | |
42 | + /** |
|
43 | + * @return boolean |
|
44 | + */ |
|
33 | 45 | public function disable(); |
34 | 46 | |
35 | 47 | public function getDashboardColumns(); |
@@ -40,14 +52,23 @@ discard block |
||
40 | 52 | |
41 | 53 | public function getTrackers(); |
42 | 54 | |
55 | + /** |
|
56 | + * @return Cardwall_OnTop_Config_TrackerMapping|null |
|
57 | + */ |
|
43 | 58 | public function getMappingFor(Tracker $mapping_tracker); |
44 | 59 | |
60 | + /** |
|
61 | + * @return boolean |
|
62 | + */ |
|
45 | 63 | public function isInColumn(Tracker_Artifact $artifact, |
46 | 64 | Cardwall_FieldProviders_IProvideFieldGivenAnArtifact $field_provider, |
47 | 65 | Cardwall_Column $column); |
48 | 66 | |
49 | 67 | public function getCardwallMappings(array $fields, Cardwall_OnTop_Config_ColumnCollection $cardwall_columns); |
50 | 68 | |
69 | + /** |
|
70 | + * @return void |
|
71 | + */ |
|
51 | 72 | public function fillMappingsWithOnTopMappings(Cardwall_MappingCollection $mappings, |
52 | 73 | Cardwall_OnTop_Config_ColumnCollection $columns); |
53 | 74 | } |