Completed
Push — master ( aa44e9...fa84e5 )
by Ralf
90:14 queued 73:21
created
infolog/inc/class.infolog_egw_record.inc.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,11 +25,11 @@
 block discarded – undo
25 25
 	// Used in conversions
26 26
 	static $types = array(
27 27
 		'select' => array('info_type', 'info_status', 'info_priority', 'pl_id'),
28
-                'select-cat' => array('info_cat'),
29
-                'select-account' => array('info_owner','info_responsible','info_modifier'),
30
-                'date-time' => array('info_startdate', 'info_enddate','info_datecompleted', 'info_datemodified','info_created'),
28
+				'select-cat' => array('info_cat'),
29
+				'select-account' => array('info_owner','info_responsible','info_modifier'),
30
+				'date-time' => array('info_startdate', 'info_enddate','info_datecompleted', 'info_datemodified','info_created'),
31 31
 		'links' => array('info_link_id'),
32
-        );
32
+		);
33 33
 
34 34
 	/**
35 35
 	 * constructor
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 	static $types = array(
27 27
 		'select' => array('info_type', 'info_status', 'info_priority', 'pl_id'),
28 28
                 'select-cat' => array('info_cat'),
29
-                'select-account' => array('info_owner','info_responsible','info_modifier'),
30
-                'date-time' => array('info_startdate', 'info_enddate','info_datecompleted', 'info_datemodified','info_created'),
29
+                'select-account' => array('info_owner', 'info_responsible', 'info_modifier'),
30
+                'date-time' => array('info_startdate', 'info_enddate', 'info_datecompleted', 'info_datemodified', 'info_created'),
31 31
 		'links' => array('info_link_id'),
32 32
         );
33 33
 
@@ -37,10 +37,10 @@  discard block
 block discarded – undo
37 37
 	 *
38 38
 	 * @param string $_identifier
39 39
 	 */
40
-	public function __construct( $_identifier='' ){
40
+	public function __construct($_identifier = '') {
41 41
 		$this->identifier = $_identifier;
42
-		if(self::$bo == null) self::$bo = new infolog_bo();
43
-		if($_identifier) {
42
+		if (self::$bo == null) self::$bo = new infolog_bo();
43
+		if ($_identifier) {
44 44
 			$rec = self::$bo->read($this->identifier);
45 45
 			if (is_array($rec)) $this->set_record($rec);
46 46
 		}
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	 * @todo add some checks
96 96
 	 * @return void
97 97
 	 */
98
-	public function set_record(array $_record){
98
+	public function set_record(array $_record) {
99 99
 		$this->record = $_record;
100 100
 	}
101 101
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 	 *
134 134
 	 * @return string identifier
135 135
 	 */
136
-	public function save ( $_dst_identifier ) {
136
+	public function save($_dst_identifier) {
137 137
 
138 138
 	}
139 139
 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	 * @param string $_dst_identifier
144 144
 	 * @return string dst_identifier
145 145
 	 */
146
-	public function copy ( $_dst_identifier ) {
146
+	public function copy($_dst_identifier) {
147 147
 
148 148
 	}
149 149
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 	 * @param string $_dst_identifier
155 155
 	 * @return string dst_identifier
156 156
 	 */
157
-	public function move ( $_dst_identifier ) {
157
+	public function move($_dst_identifier) {
158 158
 
159 159
 	}
160 160
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 	 * delets current record from backend
163 163
 	 *
164 164
 	 */
165
-	public function delete () {
165
+	public function delete() {
166 166
 
167 167
 	}
168 168
 
Please login to merge, or discard this patch.
Braces   +38 added lines, -17 removed lines patch added patch discarded remove patch
@@ -37,12 +37,20 @@  discard block
 block discarded – undo
37 37
 	 *
38 38
 	 * @param string $_identifier
39 39
 	 */
40
-	public function __construct( $_identifier='' ){
40
+	public function __construct( $_identifier='' )
41
+	{
41 42
 		$this->identifier = $_identifier;
42
-		if(self::$bo == null) self::$bo = new infolog_bo();
43
-		if($_identifier) {
43
+		if(self::$bo == null)
44
+		{
45
+			self::$bo = new infolog_bo();
46
+		}
47
+		if($_identifier)
48
+		{
44 49
 			$rec = self::$bo->read($this->identifier);
45
-			if (is_array($rec)) $this->set_record($rec);
50
+			if (is_array($rec))
51
+			{
52
+				$this->set_record($rec);
53
+			}
46 54
 		}
47 55
 	}
48 56
 
@@ -51,7 +59,8 @@  discard block
 block discarded – undo
51 59
 	 *
52 60
 	 * @param string $_attribute_name
53 61
 	 */
54
-	public function __get($_attribute_name) {
62
+	public function __get($_attribute_name)
63
+	{
55 64
 		return $this->record[$_attribute_name];
56 65
 	}
57 66
 
@@ -61,7 +70,8 @@  discard block
 block discarded – undo
61 70
 	 * @param string $_attribute_name
62 71
 	 * @param data $data
63 72
 	 */
64
-	public function __set($_attribute_name, $data) {
73
+	public function __set($_attribute_name, $data)
74
+	{
65 75
 		$this->record[$_attribute_name] = $data;
66 76
 	}
67 77
 
@@ -73,7 +83,8 @@  discard block
 block discarded – undo
73 83
 	 *
74 84
 	 * @return array complete record as associative array
75 85
 	 */
76
-	public function get_record_array() {
86
+	public function get_record_array()
87
+	{
77 88
 		return $this->record;
78 89
 	}
79 90
 
@@ -82,8 +93,10 @@  discard block
 block discarded – undo
82 93
 	 *
83 94
 	 *@return string tiltle
84 95
 	 */
85
-	public function get_title() {
86
-		if (empty($this->record)) {
96
+	public function get_title()
97
+	{
98
+		if (empty($this->record))
99
+		{
87 100
 			$this->get_record();
88 101
 		}
89 102
 		return self::$bo->link_title($this->record);
@@ -95,7 +108,8 @@  discard block
 block discarded – undo
95 108
 	 * @todo add some checks
96 109
 	 * @return void
97 110
 	 */
98
-	public function set_record(array $_record){
111
+	public function set_record(array $_record)
112
+	{
99 113
 		$this->record = $_record;
100 114
 	}
101 115
 
@@ -104,7 +118,8 @@  discard block
 block discarded – undo
104 118
 	 *
105 119
 	 * @return string identifier of current record
106 120
 	 */
107
-	public function get_identifier() {
121
+	public function get_identifier()
122
+	{
108 123
 		return $this->identifier;
109 124
 	}
110 125
 
@@ -114,7 +129,8 @@  discard block
 block discarded – undo
114 129
 	 *
115 130
 	 * @return string Full URL of an icon, or appname/icon_name
116 131
 	 */
117
-	public function get_icon() {
132
+	public function get_icon()
133
+	{
118 134
 		$icon = 'infolog/navbar';
119 135
 		$ui = new infolog_ui();
120 136
 		if (!($icon = $ui->icons['type'][$this->info_type]))
@@ -133,7 +149,8 @@  discard block
 block discarded – undo
133 149
 	 *
134 150
 	 * @return string identifier
135 151
 	 */
136
-	public function save ( $_dst_identifier ) {
152
+	public function save ( $_dst_identifier )
153
+	{
137 154
 
138 155
 	}
139 156
 
@@ -143,7 +160,8 @@  discard block
 block discarded – undo
143 160
 	 * @param string $_dst_identifier
144 161
 	 * @return string dst_identifier
145 162
 	 */
146
-	public function copy ( $_dst_identifier ) {
163
+	public function copy ( $_dst_identifier )
164
+	{
147 165
 
148 166
 	}
149 167
 
@@ -154,7 +172,8 @@  discard block
 block discarded – undo
154 172
 	 * @param string $_dst_identifier
155 173
 	 * @return string dst_identifier
156 174
 	 */
157
-	public function move ( $_dst_identifier ) {
175
+	public function move ( $_dst_identifier )
176
+	{
158 177
 
159 178
 	}
160 179
 
@@ -162,7 +181,8 @@  discard block
 block discarded – undo
162 181
 	 * delets current record from backend
163 182
 	 *
164 183
 	 */
165
-	public function delete () {
184
+	public function delete ()
185
+	{
166 186
 
167 187
 	}
168 188
 
@@ -170,7 +190,8 @@  discard block
 block discarded – undo
170 190
 	 * destructor
171 191
 	 *
172 192
 	 */
173
-	public function __destruct() {
193
+	public function __destruct()
194
+	{
174 195
 	}
175 196
 
176 197
 } // end of egw_addressbook_record
Please login to merge, or discard this patch.
infolog/inc/class.infolog_favorite_portlet.inc.php 2 patches
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 		$context['appname'] = 'infolog';
33 33
 
34 34
 		// Let parent handle the basic stuff
35
-		parent::__construct($context,$need_reload);
35
+		parent::__construct($context, $need_reload);
36 36
 
37 37
 		$ui = new infolog_ui();
38 38
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 			if ($tpl->read('infolog.index.rows.'.$query['col_filter']['info_type']))
74 74
 			{
75 75
 				$query['template'] = $tpl->name;
76
-				$query['custom_fields'] = true;	// read the custom fields too
76
+				$query['custom_fields'] = true; // read the custom fields too
77 77
 			}
78 78
 		}
79 79
 		$ui = new infolog_ui();
@@ -105,27 +105,27 @@  discard block
 block discarded – undo
105 105
 				// Some processing to add values in for links and cats
106 106
 				$multi_action = $values['nm']['multi_action'];
107 107
 				// Action has an additional action - add / delete, etc.  Buttons named <multi-action>_action[action_name]
108
-				if(in_array($multi_action, array('link', 'responsible')))
108
+				if (in_array($multi_action, array('link', 'responsible')))
109 109
 				{
110 110
 					// eTemplate ignores the _popup namespace, but et2 doesn't
111
-					if($values[$multi_action.'_popup'])
111
+					if ($values[$multi_action.'_popup'])
112 112
 					{
113
-						$popup =& $values[$multi_action.'_popup'];
113
+						$popup = & $values[$multi_action.'_popup'];
114 114
 					}
115 115
 					else
116 116
 					{
117
-						$popup =& $values;
117
+						$popup = & $values;
118 118
 					}
119
-					$values['nm']['multi_action'] .= '_' . key($popup[$multi_action . '_action']);
120
-					if($multi_action == 'link')
119
+					$values['nm']['multi_action'] .= '_'.key($popup[$multi_action.'_action']);
120
+					if ($multi_action == 'link')
121 121
 					{
122
-						$popup[$multi_action] = $popup['link']['app'] . ':'.$popup['link']['id'];
122
+						$popup[$multi_action] = $popup['link']['app'].':'.$popup['link']['id'];
123 123
 					}
124
-					else if(is_array($popup[$multi_action]))
124
+					else if (is_array($popup[$multi_action]))
125 125
 					{
126
-						$popup[$multi_action] = implode(',',$popup[$multi_action]);
126
+						$popup[$multi_action] = implode(',', $popup[$multi_action]);
127 127
 					}
128
-					$values['nm']['multi_action'] .= '_' . $popup[$multi_action];
128
+					$values['nm']['multi_action'] .= '_'.$popup[$multi_action];
129 129
 					unset($values[$multi_action.'_popup']);
130 130
 					unset($values[$multi_action]);
131 131
 				}
@@ -133,24 +133,24 @@  discard block
 block discarded – undo
133 133
 				if ($ui->action($values['nm']['multi_action'], $values['nm']['selected'], $values['nm']['select_all'],
134 134
 					$success, $failed, $action_msg, $values['nm'], $msg, $values['nm']['checkboxes']['no_notifications']))
135 135
 				{
136
-					$msg .= lang('%1 entries %2',$success,$action_msg);
137
-					Api\Json\Response::get()->apply('egw.message',array($msg,'success'));
138
-					foreach($values['nm']['selected'] as &$id)
136
+					$msg .= lang('%1 entries %2', $success, $action_msg);
137
+					Api\Json\Response::get()->apply('egw.message', array($msg, 'success'));
138
+					foreach ($values['nm']['selected'] as &$id)
139 139
 					{
140 140
 						$id = 'infolog::'.$id;
141 141
 					}
142 142
 					// Directly request an update - this will get infolog tab too
143
-					Api\Json\Response::get()->apply('egw.dataRefreshUIDs',array($values['nm']['selected']));
143
+					Api\Json\Response::get()->apply('egw.dataRefreshUIDs', array($values['nm']['selected']));
144 144
 				}
145
-				elseif(is_null($msg))
145
+				elseif (is_null($msg))
146 146
 				{
147
-					$msg .= lang('%1 entries %2, %3 failed because of insufficent rights !!!',$success,$action_msg,$failed);
148
-					Api\Json\Response::get()->apply('egw.message',array($msg,'error'));
147
+					$msg .= lang('%1 entries %2, %3 failed because of insufficent rights !!!', $success, $action_msg, $failed);
148
+					Api\Json\Response::get()->apply('egw.message', array($msg, 'error'));
149 149
 				}
150
-				elseif($msg)
150
+				elseif ($msg)
151 151
 				{
152
-					$msg .= "\n".lang('%1 entries %2, %3 failed.',$success,$action_msg,$failed);
153
-					Api\Json\Response::get()->apply('egw.message',array($msg,'error'));
152
+					$msg .= "\n".lang('%1 entries %2, %3 failed.', $success, $action_msg, $failed);
153
+					Api\Json\Response::get()->apply('egw.message', array($msg, 'error'));
154 154
 				}
155 155
 				unset($values['nm']['multi_action']);
156 156
 				unset($values['nm']['select_all']);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
 	 *
50 50
 	 * @param boolean $need_reload Flag to indicate that the portlet needs to be reloaded (exec will be called)
51 51
 	 */
52
-	public function __construct(Array &$context = array(), &$need_reload = false)
52
+	public function __construct(array &$context = array(), &$need_reload = false)
53 53
 	{
54 54
 		if (false) parent::__construct();
55 55
 
Please login to merge, or discard this patch.
infolog/inc/class.infolog_export_csv.inc.php 5 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -259,10 +259,10 @@
 block discarded – undo
259 259
 	}
260 260
 
261 261
 	/**
262
-	* Convert some internal data to something with more meaning
263
-	*
264
-	* This is for something specific to Infolog, in addition to the normal conversions.
265
-	*/
262
+	 * Convert some internal data to something with more meaning
263
+	 *
264
+	 * This is for something specific to Infolog, in addition to the normal conversions.
265
+	 */
266 266
 	public static function convert(infolog_egw_record &$record) {
267 267
 		// Stub, for now
268 268
 	}
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	 *
32 32
 	 * @param egw_record $_definition
33 33
 	 */
34
-	public function export( $_stream, importexport_definition $_definition) {
34
+	public function export($_stream, importexport_definition $_definition) {
35 35
 		$options = $_definition->plugin_options;
36 36
 
37 37
 		$selection = array();
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 		$this->export_object->set_mapping($options['mapping']);
43 43
 
44 44
 		$ids = array();
45
-		switch($options['selection'])
45
+		switch ($options['selection'])
46 46
 		{
47 47
 			case 'search':
48 48
 				$query = array_merge((array)Api\Cache::getSession('infolog', 'session_data'), $query);
@@ -51,36 +51,36 @@  discard block
 block discarded – undo
51 51
 			case 'all':
52 52
 				// do we need to query the cf's
53 53
 				$query['custom_fields'] = false;
54
-				foreach($options['mapping'] + (array)$_definition->filter as $field => $map) {
55
-					if($field[0] == '#') {
54
+				foreach ($options['mapping'] + (array)$_definition->filter as $field => $map) {
55
+					if ($field[0] == '#') {
56 56
 						$query['custom_fields'] = true;
57 57
 						$query['selectcols'] .= ",$field";
58 58
 
59
-						if($GLOBALS['egw_info']['user']['apps'][$this->bo->customfields[substr($field,1)]['type']])
59
+						if ($GLOBALS['egw_info']['user']['apps'][$this->bo->customfields[substr($field, 1)]['type']])
60 60
 						{
61
-							$cf_links[$field] = $this->bo->customfields[substr($field,1)]['type'];
61
+							$cf_links[$field] = $this->bo->customfields[substr($field, 1)]['type'];
62 62
 						}
63 63
 					}
64 64
 				}
65
-				if($options['selection'] == 'filter')
65
+				if ($options['selection'] == 'filter')
66 66
 				{
67 67
 					$fields = importexport_helper_functions::get_filter_fields($_definition->application, $this);
68 68
 					$query['col_filter'] = $_definition->filter;
69 69
 
70 70
 					// Backend expects a string
71
-					if($query['col_filter']['info_responsible'])
71
+					if ($query['col_filter']['info_responsible'])
72 72
 					{
73
-						$query['col_filter']['info_responsible'] = implode(',',$query['col_filter']['info_responsible']);
73
+						$query['col_filter']['info_responsible'] = implode(',', $query['col_filter']['info_responsible']);
74 74
 					}
75 75
 
76 76
 					// Handle ranges
77
-					foreach($query['col_filter'] as $field => $value)
77
+					foreach ($query['col_filter'] as $field => $value)
78 78
 					{
79
-						if(!is_array($value) || (!$value['from'] && !$value['to'])) continue;
79
+						if (!is_array($value) || (!$value['from'] && !$value['to'])) continue;
80 80
 
81 81
 						// Ranges are inclusive, so should be provided that way (from 2 to 10 includes 2 and 10)
82
-						if($value['from']) $query['col_filter'][] = "$field >= " . (int)$value['from'];
83
-						if($value['to']) $query['col_filter'][] = "$field <= " . (int)$value['to'];
82
+						if ($value['from']) $query['col_filter'][] = "$field >= ".(int)$value['from'];
83
+						if ($value['to']) $query['col_filter'][] = "$field <= ".(int)$value['to'];
84 84
 						unset($query['col_filter'][$field]);
85 85
 					}
86 86
 				}
@@ -92,11 +92,11 @@  discard block
 block discarded – undo
92 92
 
93 93
 					// Pre-load any cfs that are links
94 94
 					$cf_preload = array();
95
-					foreach($cf_links as $field => $app) {
96
-						foreach($selection as &$row) {
97
-							if($row[$field]) $cf_preload[$app][] = $row[$field];
95
+					foreach ($cf_links as $field => $app) {
96
+						foreach ($selection as &$row) {
97
+							if ($row[$field]) $cf_preload[$app][] = $row[$field];
98 98
 						}
99
-						if($cf_preload[$app]){
99
+						if ($cf_preload[$app]) {
100 100
 							 $selects[$field] = Link::titles($app, $cf_preload[$app]);
101 101
 							//error_log('Preload ' . $field . '['.$app . ']: ' . implode(',',$cf_preload[$app]));
102 102
 						}
@@ -104,12 +104,12 @@  discard block
 block discarded – undo
104 104
 
105 105
 					$this->export_records($this->export_object, $options, $selection, $ids);
106 106
 					$query['start'] += $query['num_rows'];
107
-				} while($query['start'] < $query['total']);
107
+				} while ($query['start'] < $query['total']);
108 108
 
109 109
 				return $this->export_object;
110 110
 
111 111
 			default:
112
-				$ids = $selection = explode(',',$options['selection']);
112
+				$ids = $selection = explode(',', $options['selection']);
113 113
 				$this->export_records($this->export_object, $options, $selection, $ids);
114 114
 				break;
115 115
 		}
@@ -119,33 +119,33 @@  discard block
 block discarded – undo
119 119
 	protected function export_records(&$export_object, $options, &$selection, $ids = array())
120 120
 	{
121 121
 		// Pre-load links all at once
122
-		if($ids && $options['mapping']['info_link_id'])
122
+		if ($ids && $options['mapping']['info_link_id'])
123 123
 		{
124 124
 			$links = Link::get_links_multiple('infolog', $ids, true, '!'.Link::VFS_APPNAME);
125
-			foreach($links as $id => $link) {
126
-				if(!is_array($selection[$id])) break;
125
+			foreach ($links as $id => $link) {
126
+				if (!is_array($selection[$id])) break;
127 127
 				$selection[$id]['info_link_id'] = $link;
128
-				if($options['convert']) $selection[$id]['info_link_id'] = Link::title($link['app'], $link['id']);
128
+				if ($options['convert']) $selection[$id]['info_link_id'] = Link::title($link['app'], $link['id']);
129 129
 			}
130 130
 		}
131 131
 		// If exporting PM fields, pre-load them all at once
132
-		if($ids && ($options['mapping']['pm_id'] || $options['mapping']['project']))
132
+		if ($ids && ($options['mapping']['pm_id'] || $options['mapping']['project']))
133 133
 		{
134 134
 			$projects = Link::get_links_multiple('infolog', $ids, true, 'projectmanager');
135
-			foreach($projects as $id => $links)
135
+			foreach ($projects as $id => $links)
136 136
 			{
137
-				if(!is_array($selection[$id])) break;
137
+				if (!is_array($selection[$id])) break;
138 138
 				$selection[$id]['pm_id'] = current($links);
139 139
 				$selection[$id]['project'] = Link::title('projectmanager', $selection[$id]['pm_id']);
140
-				$this->selects['pl_id'] = ExecMethod('projectmanager.projectmanager_pricelist_bo.pricelist',$selection[$id]['pm_id']);
140
+				$this->selects['pl_id'] = ExecMethod('projectmanager.projectmanager_pricelist_bo.pricelist', $selection[$id]['pm_id']);
141 141
 			}
142 142
 		}
143 143
 
144 144
 		foreach ($selection as $_identifier) {
145
-			if(!is_array($_identifier)) {
145
+			if (!is_array($_identifier)) {
146 146
 				$record = new infolog_egw_record($_identifier);
147
-				if(($link = $links[$record->info_id])) $record->info_link_id = $options['convert'] ? Link::title($link['app'], $link['id']) : $link;
148
-				if(($project = $projects[$record->info_id]))
147
+				if (($link = $links[$record->info_id])) $record->info_link_id = $options['convert'] ? Link::title($link['app'], $link['id']) : $link;
148
+				if (($project = $projects[$record->info_id]))
149 149
 				{
150 150
 					$record->pm_id = current($project);
151 151
 					$record->project = Link::title('projectmanager', $record->pm_id);
@@ -155,20 +155,20 @@  discard block
 block discarded – undo
155 155
 				$record->set_record($_identifier);
156 156
 			}
157 157
 			// Some conversion
158
-			if($options['convert']) {
158
+			if ($options['convert']) {
159 159
 				$this->selects['info_status'] = $this->bo->get_status($record->info_type);
160 160
 				importexport_export_csv::convert($record, infolog_egw_record::$types, 'infolog', $this->selects);
161 161
 				$this->convert($record);
162 162
 
163 163
 				// Force 0 times to ''
164
-				foreach(array('info_planned_time', 'info_used_time', 'info_replanned_time') as $field)
164
+				foreach (array('info_planned_time', 'info_used_time', 'info_replanned_time') as $field)
165 165
 				{
166
-					if($record->$field == 0) $record->$field = '';
166
+					if ($record->$field == 0) $record->$field = '';
167 167
 				}
168 168
 			} else {
169 169
 				// Implode arrays, so they don't say 'Array'
170
-				foreach($record->get_record_array() as $key => $value) {
171
-					if(is_array($value)) $record->$key = implode(',', $value);
170
+				foreach ($record->get_record_array() as $key => $value) {
171
+					if (is_array($value)) $record->$key = implode(',', $value);
172 172
 				}
173 173
 			}
174 174
 			$export_object->export_record($record);
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 	 */
214 214
 	public function get_filename()
215 215
 	{
216
-		if(is_object($this->export_object) && $this->export_object->get_num_of_records() == 1)
216
+		if (is_object($this->export_object) && $this->export_object->get_num_of_records() == 1)
217 217
 		{
218 218
 			return $this->export_object->record->get_title();
219 219
 		}
@@ -243,18 +243,18 @@  discard block
 block discarded – undo
243 243
 	{
244 244
 		$this->selects['info_type'] = $this->bo->enums['type'];
245 245
 		$this->selects['info_priority'] = $this->bo->enums['priority'];
246
-		$this->selects['pl_id'] = ExecMethod('projectmanager.projectmanager_pricelist_bo.pricelist',false);
246
+		$this->selects['pl_id'] = ExecMethod('projectmanager.projectmanager_pricelist_bo.pricelist', false);
247 247
 		$this->selects['info_status'] = $this->bo->get_status();
248 248
 	}
249 249
 
250 250
 	public function get_filter_fields(Array &$filters)
251 251
 	{
252
-		foreach($filters as $field_name => &$settings)
252
+		foreach ($filters as $field_name => &$settings)
253 253
 		{
254
-			if($this->selects[$field_name]) $settings['values'] = $this->selects[$field_name];
254
+			if ($this->selects[$field_name]) $settings['values'] = $this->selects[$field_name];
255 255
 
256 256
 			// Infolog can't handle ranges in custom fields due to the way searching is done.
257
-			if(strpos($field_name, '#') === 0 && strpos($settings['type'],'date') === 0) unset($filters[$field_name]);
257
+			if (strpos($field_name, '#') === 0 && strpos($settings['type'], 'date') === 0) unset($filters[$field_name]);
258 258
 		}
259 259
 	}
260 260
 
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 	*
264 264
 	* This is for something specific to Infolog, in addition to the normal conversions.
265 265
 	*/
266
-	public static function convert(infolog_egw_record &$record) {
266
+	public static function convert(infolog_egw_record&$record) {
267 267
 		// Stub, for now
268 268
 	}
269 269
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 	/**
30 30
 	 * Exports records as defined in $_definition
31 31
 	 *
32
-	 * @param egw_record $_definition
32
+	 * @param importexport_definition $_definition
33 33
 	 */
34 34
 	public function export( $_stream, importexport_definition $_definition) {
35 35
 		$options = $_definition->plugin_options;
Please login to merge, or discard this patch.
Braces   +94 added lines, -34 removed lines patch added patch discarded remove patch
@@ -17,10 +17,12 @@  discard block
 block discarded – undo
17 17
 /**
18 18
  * export plugin of infolog
19 19
  */
20
-class infolog_export_csv implements importexport_iface_export_plugin {
20
+class infolog_export_csv implements importexport_iface_export_plugin
21
+{
21 22
 
22 23
 
23
-	public function __construct() {
24
+	public function __construct()
25
+	{
24 26
 		Api\Translation::add_app('infolog');
25 27
 		$this->bo = new infolog_bo();
26 28
 		$this->get_selects();
@@ -31,7 +33,8 @@  discard block
 block discarded – undo
31 33
 	 *
32 34
 	 * @param egw_record $_definition
33 35
 	 */
34
-	public function export( $_stream, importexport_definition $_definition) {
36
+	public function export( $_stream, importexport_definition $_definition)
37
+	{
35 38
 		$options = $_definition->plugin_options;
36 39
 
37 40
 		$selection = array();
@@ -51,8 +54,10 @@  discard block
 block discarded – undo
51 54
 			case 'all':
52 55
 				// do we need to query the cf's
53 56
 				$query['custom_fields'] = false;
54
-				foreach($options['mapping'] + (array)$_definition->filter as $field => $map) {
55
-					if($field[0] == '#') {
57
+				foreach($options['mapping'] + (array)$_definition->filter as $field => $map)
58
+				{
59
+					if($field[0] == '#')
60
+					{
56 61
 						$query['custom_fields'] = true;
57 62
 						$query['selectcols'] .= ",$field";
58 63
 
@@ -76,11 +81,20 @@  discard block
 block discarded – undo
76 81
 					// Handle ranges
77 82
 					foreach($query['col_filter'] as $field => $value)
78 83
 					{
79
-						if(!is_array($value) || (!$value['from'] && !$value['to'])) continue;
84
+						if(!is_array($value) || (!$value['from'] && !$value['to']))
85
+						{
86
+							continue;
87
+						}
80 88
 
81 89
 						// Ranges are inclusive, so should be provided that way (from 2 to 10 includes 2 and 10)
82
-						if($value['from']) $query['col_filter'][] = "$field >= " . (int)$value['from'];
83
-						if($value['to']) $query['col_filter'][] = "$field <= " . (int)$value['to'];
90
+						if($value['from'])
91
+						{
92
+							$query['col_filter'][] = "$field >= " . (int)$value['from'];
93
+						}
94
+						if($value['to'])
95
+						{
96
+							$query['col_filter'][] = "$field <= " . (int)$value['to'];
97
+						}
84 98
 						unset($query['col_filter'][$field]);
85 99
 					}
86 100
 				}
@@ -92,11 +106,17 @@  discard block
 block discarded – undo
92 106
 
93 107
 					// Pre-load any cfs that are links
94 108
 					$cf_preload = array();
95
-					foreach($cf_links as $field => $app) {
96
-						foreach($selection as &$row) {
97
-							if($row[$field]) $cf_preload[$app][] = $row[$field];
109
+					foreach($cf_links as $field => $app)
110
+					{
111
+						foreach($selection as &$row)
112
+						{
113
+							if($row[$field])
114
+							{
115
+								$cf_preload[$app][] = $row[$field];
116
+							}
98 117
 						}
99
-						if($cf_preload[$app]){
118
+						if($cf_preload[$app])
119
+						{
100 120
 							 $selects[$field] = Link::titles($app, $cf_preload[$app]);
101 121
 							//error_log('Preload ' . $field . '['.$app . ']: ' . implode(',',$cf_preload[$app]));
102 122
 						}
@@ -122,10 +142,17 @@  discard block
 block discarded – undo
122 142
 		if($ids && $options['mapping']['info_link_id'])
123 143
 		{
124 144
 			$links = Link::get_links_multiple('infolog', $ids, true, '!'.Link::VFS_APPNAME);
125
-			foreach($links as $id => $link) {
126
-				if(!is_array($selection[$id])) break;
145
+			foreach($links as $id => $link)
146
+			{
147
+				if(!is_array($selection[$id]))
148
+				{
149
+					break;
150
+				}
127 151
 				$selection[$id]['info_link_id'] = $link;
128
-				if($options['convert']) $selection[$id]['info_link_id'] = Link::title($link['app'], $link['id']);
152
+				if($options['convert'])
153
+				{
154
+					$selection[$id]['info_link_id'] = Link::title($link['app'], $link['id']);
155
+				}
129 156
 			}
130 157
 		}
131 158
 		// If exporting PM fields, pre-load them all at once
@@ -134,28 +161,39 @@  discard block
 block discarded – undo
134 161
 			$projects = Link::get_links_multiple('infolog', $ids, true, 'projectmanager');
135 162
 			foreach($projects as $id => $links)
136 163
 			{
137
-				if(!is_array($selection[$id])) break;
164
+				if(!is_array($selection[$id]))
165
+				{
166
+					break;
167
+				}
138 168
 				$selection[$id]['pm_id'] = current($links);
139 169
 				$selection[$id]['project'] = Link::title('projectmanager', $selection[$id]['pm_id']);
140 170
 				$this->selects['pl_id'] = ExecMethod('projectmanager.projectmanager_pricelist_bo.pricelist',$selection[$id]['pm_id']);
141 171
 			}
142 172
 		}
143 173
 
144
-		foreach ($selection as $_identifier) {
145
-			if(!is_array($_identifier)) {
174
+		foreach ($selection as $_identifier)
175
+		{
176
+			if(!is_array($_identifier))
177
+			{
146 178
 				$record = new infolog_egw_record($_identifier);
147
-				if(($link = $links[$record->info_id])) $record->info_link_id = $options['convert'] ? Link::title($link['app'], $link['id']) : $link;
179
+				if(($link = $links[$record->info_id]))
180
+				{
181
+					$record->info_link_id = $options['convert'] ? Link::title($link['app'], $link['id']) : $link;
182
+				}
148 183
 				if(($project = $projects[$record->info_id]))
149 184
 				{
150 185
 					$record->pm_id = current($project);
151 186
 					$record->project = Link::title('projectmanager', $record->pm_id);
152 187
 				}
153
-			} else {
188
+			}
189
+			else
190
+			{
154 191
 				$record = new infolog_egw_record();
155 192
 				$record->set_record($_identifier);
156 193
 			}
157 194
 			// Some conversion
158
-			if($options['convert']) {
195
+			if($options['convert'])
196
+			{
159 197
 				$this->selects['info_status'] = $this->bo->get_status($record->info_type);
160 198
 				importexport_export_csv::convert($record, infolog_egw_record::$types, 'infolog', $this->selects);
161 199
 				$this->convert($record);
@@ -163,12 +201,21 @@  discard block
 block discarded – undo
163 201
 				// Force 0 times to ''
164 202
 				foreach(array('info_planned_time', 'info_used_time', 'info_replanned_time') as $field)
165 203
 				{
166
-					if($record->$field == 0) $record->$field = '';
204
+					if($record->$field == 0)
205
+					{
206
+						$record->$field = '';
207
+					}
167 208
 				}
168
-			} else {
209
+			}
210
+			else
211
+			{
169 212
 				// Implode arrays, so they don't say 'Array'
170
-				foreach($record->get_record_array() as $key => $value) {
171
-					if(is_array($value)) $record->$key = implode(',', $value);
213
+				foreach($record->get_record_array() as $key => $value)
214
+				{
215
+					if(is_array($value))
216
+					{
217
+						$record->$key = implode(',', $value);
218
+					}
172 219
 				}
173 220
 			}
174 221
 			$export_object->export_record($record);
@@ -181,7 +228,8 @@  discard block
 block discarded – undo
181 228
 	 *
182 229
 	 * @return string name
183 230
 	 */
184
-	public static function get_name() {
231
+	public static function get_name()
232
+	{
185 233
 		return lang('Infolog CSV export');
186 234
 	}
187 235
 
@@ -190,7 +238,8 @@  discard block
 block discarded – undo
190 238
 	 *
191 239
 	 * @return string descriprion
192 240
 	 */
193
-	public static function get_description() {
241
+	public static function get_description()
242
+	{
194 243
 		return lang("Exports Infolog entries into a CSV File.");
195 244
 	}
196 245
 
@@ -199,11 +248,13 @@  discard block
 block discarded – undo
199 248
 	 *
200 249
 	 * @return string suffix
201 250
 	 */
202
-	public static function get_filesuffix() {
251
+	public static function get_filesuffix()
252
+	{
203 253
 		return 'csv';
204 254
 	}
205 255
 
206
-	public static function get_mimetype() {
256
+	public static function get_mimetype()
257
+	{
207 258
 		return 'text/csv';
208 259
 	}
209 260
 
@@ -226,14 +277,16 @@  discard block
 block discarded – undo
226 277
 	 *
227 278
 	 * @return string html
228 279
 	 */
229
-	public function get_options_etpl() {
280
+	public function get_options_etpl()
281
+	{
230 282
 	}
231 283
 
232 284
 	/**
233 285
 	 * returns slectors of this plugin via xajax
234 286
 	 *
235 287
 	 */
236
-	public function get_selectors_etpl() {
288
+	public function get_selectors_etpl()
289
+	{
237 290
 		return array(
238 291
 			'name'	=> 'infolog.export_csv_selectors',
239 292
 		);
@@ -251,10 +304,16 @@  discard block
 block discarded – undo
251 304
 	{
252 305
 		foreach($filters as $field_name => &$settings)
253 306
 		{
254
-			if($this->selects[$field_name]) $settings['values'] = $this->selects[$field_name];
307
+			if($this->selects[$field_name])
308
+			{
309
+				$settings['values'] = $this->selects[$field_name];
310
+			}
255 311
 
256 312
 			// Infolog can't handle ranges in custom fields due to the way searching is done.
257
-			if(strpos($field_name, '#') === 0 && strpos($settings['type'],'date') === 0) unset($filters[$field_name]);
313
+			if(strpos($field_name, '#') === 0 && strpos($settings['type'],'date') === 0)
314
+			{
315
+				unset($filters[$field_name]);
316
+			}
258 317
 		}
259 318
 	}
260 319
 
@@ -263,7 +322,8 @@  discard block
 block discarded – undo
263 322
 	*
264 323
 	* This is for something specific to Infolog, in addition to the normal conversions.
265 324
 	*/
266
-	public static function convert(infolog_egw_record &$record) {
325
+	public static function convert(infolog_egw_record &$record)
326
+	{
267 327
 		// Stub, for now
268 328
 	}
269 329
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -247,7 +247,7 @@
 block discarded – undo
247 247
 		$this->selects['info_status'] = $this->bo->get_status();
248 248
 	}
249 249
 
250
-	public function get_filter_fields(Array &$filters)
250
+	public function get_filter_fields(array &$filters)
251 251
 	{
252 252
 		foreach($filters as $field_name => &$settings)
253 253
 		{
Please login to merge, or discard this patch.
infolog/inc/class.infolog_customfields.inc.php 2 patches
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 use EGroupware\Api;
14 14
 use EGroupware\Api\Etemplate;
15 15
 
16
-require_once(EGW_INCLUDE_ROOT . '/admin/inc/class.customfields.inc.php');
16
+require_once(EGW_INCLUDE_ROOT.'/admin/inc/class.customfields.inc.php');
17 17
 /**
18 18
  * Administration of custom fields, type and status
19 19
  */
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 		$this->status = &$this->bo->status;
50 50
 		$this->config_data = Api\Config::read('infolog');
51 51
 		$this->fields = &$this->bo->customfields;
52
-		$this->group_owners =& $this->bo->group_owners;
52
+		$this->group_owners = & $this->bo->group_owners;
53 53
 	}
54 54
 
55 55
 
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
58 58
 	 */
59 59
 	protected function app_index(&$content, &$sel_options, &$readonlys, &$preserve)
60 60
 	{
61
-		unset($sel_options);	// not used, but required by function signature
61
+		unset($sel_options); // not used, but required by function signature
62 62
 
63 63
 		$n = 0;
64
-		foreach($this->status[$this->content_type] as $name => $label)
64
+		foreach ($this->status[$this->content_type] as $name => $label)
65 65
 		{
66 66
 			$content['content_type_options']['status'][++$n] = array(
67 67
 				'name'     => $name,
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 			unset($fields['delete']);
100 100
 		}
101 101
 
102
-		foreach($fields as $field)
102
+		foreach ($fields as $field)
103 103
 		{
104 104
 			$name = trim($field['name']);
105 105
 			$old_name = $field['old_name'];
@@ -131,9 +131,9 @@  discard block
 block discarded – undo
131 131
 			$values = array();
132 132
 			if (!empty($field['values']))
133 133
 			{
134
-				foreach(explode("\n",$field['values']) as $line)
134
+				foreach (explode("\n", $field['values']) as $line)
135 135
 				{
136
-					list($var2,$value) = explode('=',trim($line),2);
136
+					list($var2, $value) = explode('=', trim($line), 2);
137 137
 					$var = trim($var2);
138 138
 					$values[$var] = empty($value) ? $var : $value;
139 139
 				}
@@ -152,15 +152,15 @@  discard block
 block discarded – undo
152 152
 		}
153 153
 		if (!function_exists('sort_by_order'))
154 154
 		{
155
-			function sort_by_order($arr1,$arr2)
155
+			function sort_by_order($arr1, $arr2)
156 156
 			{
157 157
 				return $arr1['order'] - $arr2['order'];
158 158
 			}
159 159
 		}
160
-		uasort($this->fields,sort_by_order);
160
+		uasort($this->fields, sort_by_order);
161 161
 
162 162
 		$n = 0;
163
-		foreach(array_keys($this->fields) as $name)
163
+		foreach (array_keys($this->fields) as $name)
164 164
 		{
165 165
 			$this->fields[$name]['order'] = ($n += 10);
166 166
 		}
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 			unset($status['delete']);
184 184
 		}
185 185
 
186
-		foreach($status as $stat)
186
+		foreach ($status as $stat)
187 187
 		{
188 188
 			$name = trim($stat['name']);
189 189
 			$old_name = $stat['old_name'];
@@ -264,16 +264,16 @@  discard block
 block discarded – undo
264 264
 		$new_name = trim($content['content_types']['name']);
265 265
 		if (empty($new_name))
266 266
 		{
267
-			$this->tmpl->set_validation_error('content_types[name]','You have to enter a name, to create a new type!!!');
267
+			$this->tmpl->set_validation_error('content_types[name]', 'You have to enter a name, to create a new type!!!');
268 268
 			return false;
269 269
 		}
270 270
 		else
271 271
 		{
272
-			foreach($this->content_types as $name)
272
+			foreach ($this->content_types as $name)
273 273
 			{
274
-				if($name == $new_name)
274
+				if ($name == $new_name)
275 275
 				{
276
-					$this->tmpl->set_validation_error('content_types[name]',lang("type '%1' already exists !!!",$new_name));
276
+					$this->tmpl->set_validation_error('content_types[name]', lang("type '%1' already exists !!!", $new_name));
277 277
 					return false;
278 278
 				}
279 279
 			}
@@ -293,11 +293,11 @@  discard block
 block discarded – undo
293 293
 	function save_repository()
294 294
 	{
295 295
 		// save changes to repository
296
-		Api\Config::save_value('types',$this->content_types,'infolog');
296
+		Api\Config::save_value('types', $this->content_types, 'infolog');
297 297
 		//echo '<p>'.__METHOD__.'() \$this->status=<pre style="text-aling: left;">'; print_r($this->status); echo "</pre>\n";
298
-		Api\Config::save_value('status',$this->status,'infolog');
298
+		Api\Config::save_value('status', $this->status, 'infolog');
299 299
 		//echo '<p>'.__METHOD__.'() \$this->fields=<pre style="text-aling: left;">'; print_r($this->fields); echo "</pre>\n";
300 300
 		Api\Storage\Customfields::save('infolog', $this->fields);
301
-		Api\Config::save_value('group_owners',$this->group_owners,'infolog');
301
+		Api\Config::save_value('group_owners', $this->group_owners, 'infolog');
302 302
 	}
303 303
 }
Please login to merge, or discard this patch.
Braces   +24 added lines, -6 removed lines patch added patch discarded remove patch
@@ -109,25 +109,34 @@  discard block
 block discarded – undo
109 109
 				unset($this->fields[$old_name]);
110 110
 				continue;
111 111
 			}
112
-			if (isset($field['name']) && empty($name) && ($create || !empty($old_name)))	// empty name not allowed
112
+			if (isset($field['name']) && empty($name) && ($create || !empty($old_name)))
113
+			{
114
+				// empty name not allowed
113 115
 			{
114 116
 				$content['error_msg'] = lang('Name must not be empty !!!');
115 117
 			}
118
+			}
116 119
 			if (isset($field['old_name']))
117 120
 			{
118
-				if (!empty($name) && $old_name != $name)	// renamed
121
+				if (!empty($name) && $old_name != $name)
122
+				{
123
+					// renamed
119 124
 				{
120 125
 					unset($this->fields[$old_name]);
121 126
 				}
127
+				}
122 128
 				elseif (empty($name))
123 129
 				{
124 130
 					$name = $old_name;
125 131
 				}
126 132
 			}
127
-			elseif (empty($name))		// new item and empty ==> ignore it
133
+			elseif (empty($name))
134
+			{
135
+				// new item and empty ==> ignore it
128 136
 			{
129 137
 				continue;
130 138
 			}
139
+			}
131 140
 			$values = array();
132 141
 			if (!empty($field['values']))
133 142
 			{
@@ -193,15 +202,21 @@  discard block
 block discarded – undo
193 202
 				unset($this->status[$typ][$old_name]);
194 203
 				continue;
195 204
 			}
196
-			if (isset($stat['name']) && empty($name) && ($create || !empty($old_name)))	// empty name not allowed
205
+			if (isset($stat['name']) && empty($name) && ($create || !empty($old_name)))
206
+			{
207
+				// empty name not allowed
197 208
 			{
198 209
 				$content['error_msg'] = lang('Name must not be empty !!!');
199 210
 			}
211
+			}
200 212
 			if (isset($stat['old_name']))
201 213
 			{
202
-				if (!empty($name) && $old_name != $name)	// renamed
214
+				if (!empty($name) && $old_name != $name)
215
+				{
216
+					// renamed
203 217
 				{
204 218
 					unset($this->status[$typ][$old_name]);
219
+				}
205 220
 
206 221
 					if ($default == $old_name)
207 222
 					{
@@ -213,10 +228,13 @@  discard block
 block discarded – undo
213 228
 					$name = $old_name;
214 229
 				}
215 230
 			}
216
-			elseif (empty($name))		// new item and empty ==> ignore it
231
+			elseif (empty($name))
232
+			{
233
+				// new item and empty ==> ignore it
217 234
 			{
218 235
 				continue;
219 236
 			}
237
+			}
220 238
 			$this->status[$typ][$name] = empty($stat['label']) ? $name : $stat['label'];
221 239
 		}
222 240
 		$this->status['defaults'][$typ] = empty($default) ? $name : $default;
Please login to merge, or discard this patch.
infolog/inc/class.infolog_wizard_export_csv.inc.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,13 +21,13 @@
 block discarded – undo
21 21
 		$bo = new infolog_tracking(new infolog_bo());
22 22
 		$this->export_fields = array('info_id' => 'Infolog ID', 'pm_id' => 'Project ID', 'project' => 'Project Name') + $bo->field2label;
23 23
 		// Add in created date, in the appropriate place
24
-		$first = array_splice($this->export_fields, 0, array_search('info_datemodified',array_keys($this->export_fields)));
24
+		$first = array_splice($this->export_fields, 0, array_search('info_datemodified', array_keys($this->export_fields)));
25 25
 		$this->export_fields = array_merge($first, array('info_created'=>'creation'), $this->export_fields);
26 26
 
27 27
 		// Custom fields
28 28
 		unset($this->export_fields['custom']); // Heading, not a real field
29 29
 		$custom = Api\Storage\Customfields::get('infolog', true);
30
-		foreach($custom as $name => $data) {
30
+		foreach ($custom as $name => $data) {
31 31
 			$this->export_fields['#'.$name] = $data['label'];
32 32
 		}
33 33
 	}
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,8 @@  discard block
 block discarded – undo
14 14
 
15 15
 class infolog_wizard_export_csv extends importexport_wizard_basic_export_csv
16 16
 {
17
-	public function __construct() {
17
+	public function __construct()
18
+	{
18 19
 		parent::__construct();
19 20
 
20 21
 		// Field mapping
@@ -27,7 +28,8 @@  discard block
 block discarded – undo
27 28
 		// Custom fields
28 29
 		unset($this->export_fields['custom']); // Heading, not a real field
29 30
 		$custom = Api\Storage\Customfields::get('infolog', true);
30
-		foreach($custom as $name => $data) {
31
+		foreach($custom as $name => $data)
32
+		{
31 33
 			$this->export_fields['#'.$name] = $data['label'];
32 34
 		}
33 35
 	}
Please login to merge, or discard this patch.
infolog/inc/class.infolog_merge.inc.php 2 patches
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -63,20 +63,20 @@  discard block
 block discarded – undo
63 63
 	 * @param string &$content=null content to create some replacements only if they are use
64 64
 	 * @return array|boolean
65 65
 	 */
66
-	protected function get_replacements($id,&$content=null)
66
+	protected function get_replacements($id, &$content = null)
67 67
 	{
68 68
 		if (!($replacements = $this->infolog_replacements($id, '', $content)))
69 69
 		{
70 70
 			return false;
71 71
 		}
72
-		if (!(strpos($content,'$$info_contact/') === false))
72
+		if (!(strpos($content, '$$info_contact/') === false))
73 73
 		{
74 74
 			// Check to see if it's actually a contact, then load
75
-			if(is_array($replacements['$$info_link$$']) && $replacements['$$info_link$$']['app'] == 'addressbook')
75
+			if (is_array($replacements['$$info_link$$']) && $replacements['$$info_link$$']['app'] == 'addressbook')
76 76
 			{
77
-				$replacements += $this->contact_replacements($replacements['$$info_link$$']['id'],'info_contact');
77
+				$replacements += $this->contact_replacements($replacements['$$info_link$$']['id'], 'info_contact');
78 78
 			}
79
-			if(is_array($replacements['$$info_link$$'])) unset($replacements['$$info_link$$']);
79
+			if (is_array($replacements['$$info_link$$'])) unset($replacements['$$info_link$$']);
80 80
 		}
81 81
 		return $replacements;
82 82
 	}
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	 * @param string $prefix='' prefix like eg. 'erole'
89 89
 	 * @return array|boolean
90 90
 	 */
91
-	public function infolog_replacements($id,$prefix='', &$content = '')
91
+	public function infolog_replacements($id, $prefix = '', &$content = '')
92 92
 	{
93 93
 		$record = new infolog_egw_record($id);
94 94
 		$info = array();
@@ -96,33 +96,33 @@  discard block
 block discarded – undo
96 96
 		// Convert to human friendly values
97 97
 		$types = infolog_egw_record::$types;
98 98
 		$_selects = $this->bo->enums + array('status' => $this->bo->status[$record->info_type]);
99
-		foreach($_selects as $name => $value)
99
+		foreach ($_selects as $name => $value)
100 100
 		{
101 101
 			$selects['info_'.$name] = $value;
102
-			if(!in_array('info_'.$name, $types['select'])) $types['select'][] = 'info_'.$name;
102
+			if (!in_array('info_'.$name, $types['select'])) $types['select'][] = 'info_'.$name;
103 103
 		}
104 104
 
105
-		if($content && strpos($content, '$$#') !== FALSE)
105
+		if ($content && strpos($content, '$$#') !== FALSE)
106 106
 		{
107 107
 			$this->cf_link_to_expand($record->get_record_array(), $content, $info);
108 108
 		}
109 109
 
110 110
 		importexport_export_csv::convert($record, $types, 'infolog', $selects);
111
-		if($record->info_contact)
111
+		if ($record->info_contact)
112 112
 		{
113 113
 			$array['info_contact'] = $array['info_link']['title'];
114 114
 		}
115 115
 
116 116
 		// Set any missing custom fields, or the marker will stay
117 117
 		$array = $record->get_record_array();
118
-		foreach($this->bo->customfields as $name => $field)
118
+		foreach ($this->bo->customfields as $name => $field)
119 119
 		{
120
-			if(!$array['#'.$name])
120
+			if (!$array['#'.$name])
121 121
 			{
122 122
 				$array['#'.$name] = '';
123 123
 			}
124 124
 			// Format date cfs per user Api\Preferences
125
-			if($field['type'] == 'date' || $field['type'] == 'date-time')
125
+			if ($field['type'] == 'date' || $field['type'] == 'date-time')
126 126
 			{
127 127
 				$this->date_fields[] = '#'.$name;
128 128
 				$array['#'.$name] = Api\DateTime::to($array['#'.$name], $field['type'] == 'date' ? true : '');
@@ -133,16 +133,16 @@  discard block
 block discarded – undo
133 133
 		$array += $this->get_all_links('infolog', $id, $prefix, $content);
134 134
 
135 135
 		// Timesheet time
136
-		if(strpos($content, 'info_sum_timesheets'))
136
+		if (strpos($content, 'info_sum_timesheets'))
137 137
 		{
138
-			$links = Link::get_links('infolog',$id,'timesheet');
139
-			$sum = ExecMethod('timesheet.timesheet_bo.sum',$links);
138
+			$links = Link::get_links('infolog', $id, 'timesheet');
139
+			$sum = ExecMethod('timesheet.timesheet_bo.sum', $links);
140 140
 			$info['$$info_sum_timesheets$$'] = $sum['duration'];
141 141
 		}
142 142
 
143 143
 		// Check for linked project ID
144 144
 		$links = Link::get_links('infolog', $id, 'projectmanager');
145
-		foreach($links as $app_id)
145
+		foreach ($links as $app_id)
146 146
 		{
147 147
 			$array['pm_id'] = $app_id;
148 148
 			$array['project'] = Link::title('projectmanager', $app_id);
@@ -150,14 +150,14 @@  discard block
 block discarded – undo
150 150
 		}
151 151
 
152 152
 		// Add markers
153
-		foreach($array as $key => &$value)
153
+		foreach ($array as $key => &$value)
154 154
 		{
155
-			if(!$value) $value = '';
156
-			$info['$$'.($prefix ? $prefix.'/':'').$key.'$$'] = $value;
155
+			if (!$value) $value = '';
156
+			$info['$$'.($prefix ? $prefix.'/' : '').$key.'$$'] = $value;
157 157
 		}
158 158
 
159 159
 		// Add parent
160
-		if($record->info_id_parent)
160
+		if ($record->info_id_parent)
161 161
 		{
162 162
 			$info += $this->infolog_replacements($record->info_id_parent, 'info_id_parent', $content);
163 163
 		}
@@ -181,11 +181,11 @@  discard block
 block discarded – undo
181 181
 		$tracking = new infolog_tracking($this->bo);
182 182
 		$fields = array('info_id' => lang('Infolog ID'), 'pm_id' => lang('Project ID'), 'project' => lang('Project name')) + $tracking->field2label + array('info_sum_timesheets' => lang('Used time'));
183 183
 		Api\Translation::add_app('projectmanager');
184
-		foreach($fields as $name => $label)
184
+		foreach ($fields as $name => $label)
185 185
 		{
186
-			if (in_array($name,array('custom'))) continue;	// dont show them
186
+			if (in_array($name, array('custom'))) continue; // dont show them
187 187
 
188
-			if (in_array($name,array('info_subject', 'info_des')) && $n&1)		// main values, which should be in the first column
188
+			if (in_array($name, array('info_subject', 'info_des')) && $n&1)		// main values, which should be in the first column
189 189
 			{
190 190
 				echo "</tr>\n";
191 191
 				$n++;
@@ -198,26 +198,26 @@  discard block
 block discarded – undo
198 198
 
199 199
 		echo '<tr><td colspan="4"><h3>'.lang('Custom fields').":</h3></td></tr>";
200 200
 		$contact_custom = false;
201
-		foreach($this->bo->customfields as $name => $field)
201
+		foreach ($this->bo->customfields as $name => $field)
202 202
 		{
203
-			echo '<tr><td>{{#'.$name.'}}</td><td colspan="3">'.$field['label'].($field['type'] == 'select-account' ? '*':'')."</td></tr>\n";
204
-			if($field['type'] == 'select-account') $contact_custom = true;
203
+			echo '<tr><td>{{#'.$name.'}}</td><td colspan="3">'.$field['label'].($field['type'] == 'select-account' ? '*' : '')."</td></tr>\n";
204
+			if ($field['type'] == 'select-account') $contact_custom = true;
205 205
 		}
206
-		if($contact_custom)
206
+		if ($contact_custom)
207 207
 		{
208
-			echo '<tr><td /><td colspan="3">* '.lang('Addressbook placeholders available'). '</td></tr>';
208
+			echo '<tr><td /><td colspan="3">* '.lang('Addressbook placeholders available').'</td></tr>';
209 209
 		}
210 210
 
211 211
 		echo '<tr><td colspan="4"><h3>'.lang('Parent').":</h3></td></tr>";
212
-		echo '<tr><td>{{info_id_parent/info_subject}}</td><td colspan="3">'.lang('All other %1 fields are valid',lang('infolog'))."</td></tr>\n";
212
+		echo '<tr><td>{{info_id_parent/info_subject}}</td><td colspan="3">'.lang('All other %1 fields are valid', lang('infolog'))."</td></tr>\n";
213 213
 
214 214
 		echo '<tr><td colspan="4"><h3>'.lang('Contact fields').':</h3></td></tr>';
215 215
 		$i = 0;
216
-		foreach($this->contacts->contact_fields as $name => $label)
216
+		foreach ($this->contacts->contact_fields as $name => $label)
217 217
 		{
218
-			if (in_array($name,array('tid','label','geo'))) continue;       // dont show them, as they are not used in the UI atm.
218
+			if (in_array($name, array('tid', 'label', 'geo'))) continue; // dont show them, as they are not used in the UI atm.
219 219
 
220
-			if (in_array($name,array('email','org_name','tel_work','url')) && $n&1)         // main values, which should be in the first column
220
+			if (in_array($name, array('email', 'org_name', 'tel_work', 'url')) && $n&1)         // main values, which should be in the first column
221 221
 			{
222 222
 					echo "</tr>\n";
223 223
 					$i++;
@@ -229,13 +229,13 @@  discard block
 block discarded – undo
229 229
 		}
230 230
 
231 231
 		echo '<tr><td colspan="4"><h3>'.lang('Custom fields').":</h3></td></tr>";
232
-		foreach($this->contacts->customfields as $name => $field)
232
+		foreach ($this->contacts->customfields as $name => $field)
233 233
 		{
234 234
 			echo '<tr><td>{{info_contact/#'.$name.'}}</td><td colspan="3">'.$field['label']."</td></tr>\n";
235 235
 		}
236 236
 
237 237
 		echo '<tr><td colspan="4"><h3>'.lang('General fields:')."</h3></td></tr>";
238
-		foreach(array(
238
+		foreach (array(
239 239
 			'link' => lang('HTML link to the current record'),
240 240
 			'links' => lang('Titles of any entries linked to the current record, excluding attached files'),
241 241
 			'attachments' => lang('List of files linked to the current record'),
Please login to merge, or discard this patch.
Braces   +50 added lines, -12 removed lines patch added patch discarded remove patch
@@ -76,7 +76,10 @@  discard block
 block discarded – undo
76 76
 			{
77 77
 				$replacements += $this->contact_replacements($replacements['$$info_link$$']['id'],'info_contact');
78 78
 			}
79
-			if(is_array($replacements['$$info_link$$'])) unset($replacements['$$info_link$$']);
79
+			if(is_array($replacements['$$info_link$$']))
80
+			{
81
+				unset($replacements['$$info_link$$']);
82
+			}
80 83
 		}
81 84
 		return $replacements;
82 85
 	}
@@ -99,7 +102,10 @@  discard block
 block discarded – undo
99 102
 		foreach($_selects as $name => $value)
100 103
 		{
101 104
 			$selects['info_'.$name] = $value;
102
-			if(!in_array('info_'.$name, $types['select'])) $types['select'][] = 'info_'.$name;
105
+			if(!in_array('info_'.$name, $types['select']))
106
+			{
107
+				$types['select'][] = 'info_'.$name;
108
+			}
103 109
 		}
104 110
 
105 111
 		if($content && strpos($content, '$$#') !== FALSE)
@@ -152,7 +158,10 @@  discard block
 block discarded – undo
152 158
 		// Add markers
153 159
 		foreach($array as $key => &$value)
154 160
 		{
155
-			if(!$value) $value = '';
161
+			if(!$value)
162
+			{
163
+				$value = '';
164
+			}
156 165
 			$info['$$'.($prefix ? $prefix.'/':'').$key.'$$'] = $value;
157 166
 		}
158 167
 
@@ -183,16 +192,29 @@  discard block
 block discarded – undo
183 192
 		Api\Translation::add_app('projectmanager');
184 193
 		foreach($fields as $name => $label)
185 194
 		{
186
-			if (in_array($name,array('custom'))) continue;	// dont show them
195
+			if (in_array($name,array('custom')))
196
+			{
197
+				continue;
198
+			}
199
+			// dont show them
187 200
 
188
-			if (in_array($name,array('info_subject', 'info_des')) && $n&1)		// main values, which should be in the first column
201
+			if (in_array($name,array('info_subject', 'info_des')) && $n&1)
202
+			{
203
+				// main values, which should be in the first column
189 204
 			{
190 205
 				echo "</tr>\n";
206
+			}
191 207
 				$n++;
192 208
 			}
193
-			if (!($n&1)) echo '<tr>';
209
+			if (!($n&1))
210
+			{
211
+				echo '<tr>';
212
+			}
194 213
 			echo '<td>{{'.$name.'}}</td><td>'.lang($label).'</td>';
195
-			if ($n&1) echo "</tr>\n";
214
+			if ($n&1)
215
+			{
216
+				echo "</tr>\n";
217
+			}
196 218
 			$n++;
197 219
 		}
198 220
 
@@ -201,7 +223,10 @@  discard block
 block discarded – undo
201 223
 		foreach($this->bo->customfields as $name => $field)
202 224
 		{
203 225
 			echo '<tr><td>{{#'.$name.'}}</td><td colspan="3">'.$field['label'].($field['type'] == 'select-account' ? '*':'')."</td></tr>\n";
204
-			if($field['type'] == 'select-account') $contact_custom = true;
226
+			if($field['type'] == 'select-account')
227
+			{
228
+				$contact_custom = true;
229
+			}
205 230
 		}
206 231
 		if($contact_custom)
207 232
 		{
@@ -215,16 +240,29 @@  discard block
 block discarded – undo
215 240
 		$i = 0;
216 241
 		foreach($this->contacts->contact_fields as $name => $label)
217 242
 		{
218
-			if (in_array($name,array('tid','label','geo'))) continue;       // dont show them, as they are not used in the UI atm.
243
+			if (in_array($name,array('tid','label','geo')))
244
+			{
245
+				continue;
246
+			}
247
+			// dont show them, as they are not used in the UI atm.
219 248
 
220
-			if (in_array($name,array('email','org_name','tel_work','url')) && $n&1)         // main values, which should be in the first column
249
+			if (in_array($name,array('email','org_name','tel_work','url')) && $n&1)
250
+			{
251
+				// main values, which should be in the first column
221 252
 			{
222 253
 					echo "</tr>\n";
254
+			}
223 255
 					$i++;
224 256
 			}
225
-			if (!($i&1)) echo '<tr>';
257
+			if (!($i&1))
258
+			{
259
+				echo '<tr>';
260
+			}
226 261
 			echo '<td>{{info_contact/'.$name.'}}</td><td>'.$label.'</td>';
227
-			if ($i&1) echo "</tr>\n";
262
+			if ($i&1)
263
+			{
264
+				echo "</tr>\n";
265
+			}
228 266
 			$i++;
229 267
 		}
230 268
 
Please login to merge, or discard this patch.
infolog/inc/class.infolog_export_ical.inc.php 4 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -109,8 +109,8 @@
 block discarded – undo
109 109
 	 */
110 110
 	public function get_selectors_etpl() {
111 111
 		return array(
112
-                        'name'  => 'infolog.export_csv_selectors',
113
-                        'content'       => 'search'
114
-                );
112
+						'name'  => 'infolog.export_csv_selectors',
113
+						'content'       => 'search'
114
+				);
115 115
 	}
116 116
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	 *
24 24
 	 * @param egw_record $_definition
25 25
 	 */
26
-	public function export( $_stream, importexport_definition $_definition) {
26
+	public function export($_stream, importexport_definition $_definition) {
27 27
 		$options = $_definition->plugin_options;
28 28
 		$this->bo = new infolog_bo();
29 29
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
 		$ids = array();
34 34
 		$query = array();
35
-		switch($options['selection'])
35
+		switch ($options['selection'])
36 36
 		{
37 37
 			case 'search':
38 38
 				$query = array_merge(Api\Cache::getSession('infolog', 'session_data'), $query);
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
 				break;
46 46
 			default:
47
-				$ids = $this->selection = explode(',',$options['selection']);
47
+				$ids = $this->selection = explode(',', $options['selection']);
48 48
 				break;
49 49
 		}
50 50
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 */
90 90
 	public function get_filename()
91 91
 	{
92
-		if(is_array($this->selection) && count($this->selection) == 1)
92
+		if (is_array($this->selection) && count($this->selection) == 1)
93 93
 		{
94 94
 			return $this->bo->link_title(current($this->selection));
95 95
 		}
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 	/**
30 30
 	 * Exports records as defined in $_definition
31 31
 	 *
32
-	 * @param egw_record $_definition
32
+	 * @param importexport_definition $_definition
33 33
 	 */
34 34
 	public function export( $_stream, importexport_definition $_definition) {
35 35
 		$options = $_definition->plugin_options;
Please login to merge, or discard this patch.
Braces   +20 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,19 +16,24 @@  discard block
 block discarded – undo
16 16
 /**
17 17
  * export iCal plugin of infolog
18 18
  */
19
-class infolog_export_ical extends infolog_export_csv {
19
+class infolog_export_ical extends infolog_export_csv
20
+{
20 21
 
21 22
 	/**
22 23
 	 * Exports records as defined in $_definition
23 24
 	 *
24 25
 	 * @param egw_record $_definition
25 26
 	 */
26
-	public function export( $_stream, importexport_definition $_definition) {
27
+	public function export( $_stream, importexport_definition $_definition)
28
+	{
27 29
 		$options = $_definition->plugin_options;
28 30
 		$this->bo = new infolog_bo();
29 31
 
30 32
 		$limit_exception = Api\Storage\Merge::is_export_limit_excepted();
31
-		if (!$limit_exception) $export_limit = Api\Storage\Merge::getExportLimit('infolog');
33
+		if (!$limit_exception)
34
+		{
35
+			$export_limit = Api\Storage\Merge::getExportLimit('infolog');
36
+		}
32 37
 
33 38
 		$ids = array();
34 39
 		$query = array();
@@ -57,7 +62,8 @@  discard block
 block discarded – undo
57 62
 	 *
58 63
 	 * @return string name
59 64
 	 */
60
-	public static function get_name() {
65
+	public static function get_name()
66
+	{
61 67
 		return lang('Infolog iCal export');
62 68
 	}
63 69
 
@@ -66,7 +72,8 @@  discard block
 block discarded – undo
66 72
 	 *
67 73
 	 * @return string descriprion
68 74
 	 */
69
-	public static function get_description() {
75
+	public static function get_description()
76
+	{
70 77
 		return lang("Exports in iCal format.");
71 78
 	}
72 79
 
@@ -75,11 +82,13 @@  discard block
 block discarded – undo
75 82
 	 *
76 83
 	 * @return string suffix
77 84
 	 */
78
-	public static function get_filesuffix() {
85
+	public static function get_filesuffix()
86
+	{
79 87
 		return 'ics';
80 88
 	}
81 89
 
82
-	public static function get_mimetype() {
90
+	public static function get_mimetype()
91
+	{
83 92
 		return 'text/infolog';
84 93
 	}
85 94
 
@@ -100,14 +109,16 @@  discard block
 block discarded – undo
100 109
 	 * return html for options.
101 110
 	 *
102 111
 	 */
103
-	public function get_options_etpl() {
112
+	public function get_options_etpl()
113
+	{
104 114
 	}
105 115
 
106 116
 	/**
107 117
 	 * returns selectors of this plugin
108 118
 	 *
109 119
 	 */
110
-	public function get_selectors_etpl() {
120
+	public function get_selectors_etpl()
121
+	{
111 122
 		return array(
112 123
                         'name'  => 'infolog.export_csv_selectors',
113 124
                         'content'       => 'search'
Please login to merge, or discard this patch.
infolog/inc/class.infolog_wizard_import_infologs_csv.inc.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 		// List each custom field
35 35
 		unset($this->mapping_fields['custom']);
36 36
 		$custom = Api\Storage\Customfields::get('infolog');
37
-		foreach($custom as $name => $data) {
37
+		foreach ($custom as $name => $data) {
38 38
 			$this->mapping_fields['#'.$name] = $data['label'];
39 39
 		}
40 40
 
@@ -62,20 +62,20 @@  discard block
 block discarded – undo
62 62
 	# Skipped for now (or forever)
63 63
 	function wizard_step60(&$content, &$sel_options, &$readonlys, &$preserv)
64 64
 	{
65
-		if($this->debug) error_log(__METHOD__.'->$content '.print_r($content,true));
65
+		if ($this->debug) error_log(__METHOD__.'->$content '.print_r($content, true));
66 66
 		unset($content['no_owner_map']);
67 67
 		// Check that record owner has access
68 68
 		$access = true;
69
-		if($content['record_owner'])
69
+		if ($content['record_owner'])
70 70
 		{
71 71
 			$bo = new infolog_bo();
72
-			$access = $bo->check_access(0,Acl::EDIT, $content['record_owner']);
72
+			$access = $bo->check_access(0, Acl::EDIT, $content['record_owner']);
73 73
 		}
74 74
 
75 75
 		// return from step60
76 76
 		if ($content['step'] == 'wizard_step60')
77 77
 		{
78
-			if(!$access) {
78
+			if (!$access) {
79 79
 				$step = $content['step'];
80 80
 				unset($content['step']);
81 81
 				return $step;
@@ -83,34 +83,34 @@  discard block
 block discarded – undo
83 83
 			switch (array_search('pressed', $content['button']))
84 84
 			{
85 85
 				case 'next':
86
-					return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],1);
86
+					return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'], 1);
87 87
 				case 'previous' :
88
-					return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],-1);
88
+					return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'], -1);
89 89
 				case 'finish':
90 90
 					return 'wizard_finish';
91 91
 				default :
92
-					return $this->wizard_step60($content,$sel_options,$readonlys,$preserv);
92
+					return $this->wizard_step60($content, $sel_options, $readonlys, $preserv);
93 93
 			}
94 94
 		}
95 95
 		// init step60
96 96
 		else
97 97
 		{
98 98
 			$content['msg'] = $this->steps['wizard_step60'];
99
-			if(!$access) {
100
-				$content['msg'] .= "\n* " . lang('Owner does not have edit rights');
99
+			if (!$access) {
100
+				$content['msg'] .= "\n* ".lang('Owner does not have edit rights');
101 101
 			}
102 102
 			$content['step'] = 'wizard_step60';
103
-			if(!array_key_exists($content['record_owner']) && $content['plugin_options']) {
103
+			if (!array_key_exists($content['record_owner']) && $content['plugin_options']) {
104 104
 				$content['record_owner'] = $content['plugin_options']['record_owner'];
105 105
 			}
106
-			if(!array_key_exists($content['owner_from_csv']) && $content['plugin_options']) {
106
+			if (!array_key_exists($content['owner_from_csv']) && $content['plugin_options']) {
107 107
 				$content['owner_from_csv'] = $content['plugin_options']['owner_from_csv'];
108 108
 			}
109
-			if(!array_key_exists($content['change_owner']) && $content['plugin_options']) {
109
+			if (!array_key_exists($content['change_owner']) && $content['plugin_options']) {
110 110
 				$content['change_owner'] = $content['plugin_options']['change_owner'];
111 111
 			}
112 112
 
113
-			if(!in_array('info_owner', $content['field_mapping'])) {
113
+			if (!in_array('info_owner', $content['field_mapping'])) {
114 114
 				$content['no_owner_map'] = true;
115 115
 			}
116 116
 
Please login to merge, or discard this patch.
Braces   +18 added lines, -8 removed lines patch added patch discarded remove patch
@@ -34,7 +34,8 @@  discard block
 block discarded – undo
34 34
 		// List each custom field
35 35
 		unset($this->mapping_fields['custom']);
36 36
 		$custom = Api\Storage\Customfields::get('infolog');
37
-		foreach($custom as $name => $data) {
37
+		foreach($custom as $name => $data)
38
+		{
38 39
 			$this->mapping_fields['#'.$name] = $data['label'];
39 40
 		}
40 41
 
@@ -62,7 +63,10 @@  discard block
 block discarded – undo
62 63
 	# Skipped for now (or forever)
63 64
 	function wizard_step60(&$content, &$sel_options, &$readonlys, &$preserv)
64 65
 	{
65
-		if($this->debug) error_log(__METHOD__.'->$content '.print_r($content,true));
66
+		if($this->debug)
67
+		{
68
+			error_log(__METHOD__.'->$content '.print_r($content,true));
69
+		}
66 70
 		unset($content['no_owner_map']);
67 71
 		// Check that record owner has access
68 72
 		$access = true;
@@ -75,7 +79,8 @@  discard block
 block discarded – undo
75 79
 		// return from step60
76 80
 		if ($content['step'] == 'wizard_step60')
77 81
 		{
78
-			if(!$access) {
82
+			if(!$access)
83
+			{
79 84
 				$step = $content['step'];
80 85
 				unset($content['step']);
81 86
 				return $step;
@@ -96,21 +101,26 @@  discard block
 block discarded – undo
96 101
 		else
97 102
 		{
98 103
 			$content['msg'] = $this->steps['wizard_step60'];
99
-			if(!$access) {
104
+			if(!$access)
105
+			{
100 106
 				$content['msg'] .= "\n* " . lang('Owner does not have edit rights');
101 107
 			}
102 108
 			$content['step'] = 'wizard_step60';
103
-			if(!array_key_exists($content['record_owner']) && $content['plugin_options']) {
109
+			if(!array_key_exists($content['record_owner']) && $content['plugin_options'])
110
+			{
104 111
 				$content['record_owner'] = $content['plugin_options']['record_owner'];
105 112
 			}
106
-			if(!array_key_exists($content['owner_from_csv']) && $content['plugin_options']) {
113
+			if(!array_key_exists($content['owner_from_csv']) && $content['plugin_options'])
114
+			{
107 115
 				$content['owner_from_csv'] = $content['plugin_options']['owner_from_csv'];
108 116
 			}
109
-			if(!array_key_exists($content['change_owner']) && $content['plugin_options']) {
117
+			if(!array_key_exists($content['change_owner']) && $content['plugin_options'])
118
+			{
110 119
 				$content['change_owner'] = $content['plugin_options']['change_owner'];
111 120
 			}
112 121
 
113
-			if(!in_array('info_owner', $content['field_mapping'])) {
122
+			if(!in_array('info_owner', $content['field_mapping']))
123
+			{
114 124
 				$content['no_owner_map'] = true;
115 125
 			}
116 126
 
Please login to merge, or discard this patch.
infolog/inc/class.infolog_hooks.inc.php 2 patches
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	static function not_enum_group_acls($location)
31 31
 	{
32
-		unset($location);	// not used, but part of hook signature
32
+		unset($location); // not used, but part of hook signature
33 33
 		$config = Api\Config::read('infolog');
34 34
 
35 35
 		return $config['group_owners'];
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	static function search_link($location)
45 45
 	{
46
-		unset($location);	// not used, but part of hook signature
46
+		unset($location); // not used, but part of hook signature
47 47
 
48 48
 		return array(
49 49
 			'query'      => 'infolog.infolog_bo.link_query',
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 			'add_id'     => 'action_id',
67 67
 			'add_popup'  => '760x570',
68 68
 			'file_access'=> 'infolog.infolog_bo.file_access',
69
-			'file_access_user' => true,	// file_access supports 4th parameter $user
69
+			'file_access_user' => true, // file_access supports 4th parameter $user
70 70
 			'edit'       => array(
71 71
 				'menuaction' => 'infolog.infolog_ui.edit',
72 72
 			),
@@ -93,38 +93,38 @@  discard block
 block discarded – undo
93 93
 			display_sidebox($appname, lang('Favorites'), Framework\Favorites::list_favorites($appname));
94 94
 
95 95
 			$file = array(
96
-				'infolog list' => Egw::link('/index.php',array(
96
+				'infolog list' => Egw::link('/index.php', array(
97 97
 					'menuaction' => 'infolog.infolog_ui.index',
98 98
 					'ajax' => 'true')),
99 99
 				array(
100
-					'text' => lang('Add %1',lang(Link::get_registry($appname, 'entry'))),
100
+					'text' => lang('Add %1', lang(Link::get_registry($appname, 'entry'))),
101 101
 					'no_lang' => true,
102 102
 					'link' => "javascript:app.infolog.add_link_sidemenu();"
103 103
 				),
104
-				'Placeholders' => Egw::link('/index.php','menuaction=infolog.infolog_merge.show_replacements')
104
+				'Placeholders' => Egw::link('/index.php', 'menuaction=infolog.infolog_merge.show_replacements')
105 105
 			);
106
-			display_sidebox($appname,$GLOBALS['egw_info']['apps']['infolog']['title'].' '.lang('Menu'),$file);
106
+			display_sidebox($appname, $GLOBALS['egw_info']['apps']['infolog']['title'].' '.lang('Menu'), $file);
107 107
 		}
108 108
 
109 109
 		if ($GLOBALS['egw_info']['user']['apps']['admin'] && !Api\Header\UserAgent::mobile())
110 110
 		{
111 111
 			$file = Array(
112
-				'Site configuration' => Egw::link('/index.php',array(
112
+				'Site configuration' => Egw::link('/index.php', array(
113 113
 					'menuaction' => 'infolog.infolog_ui.admin' )),
114
-				'Global Categories'  => Egw::link('/index.php',array(
114
+				'Global Categories'  => Egw::link('/index.php', array(
115 115
 					'menuaction' => 'admin.admin_categories.index',
116 116
 					'appname'    => $appname,
117 117
 					'global_cats'=> True)),
118
-				'Custom fields, typ and status' => Egw::link('/index.php',array(
118
+				'Custom fields, typ and status' => Egw::link('/index.php', array(
119 119
 					'menuaction' => 'infolog.infolog_customfields.index')),
120 120
 			);
121 121
 			if ($location == 'admin')
122 122
 			{
123
-				display_section($appname,$file);
123
+				display_section($appname, $file);
124 124
 			}
125 125
 			else
126 126
 			{
127
-				display_sidebox($appname,lang('Admin'),$file);
127
+				display_sidebox($appname, lang('Admin'), $file);
128 128
 			}
129 129
 		}
130 130
 	}
@@ -137,19 +137,19 @@  discard block
 block discarded – undo
137 137
 	static function settings()
138 138
 	{
139 139
 		/* Setup some values to fill the array of this app's settings below */
140
-		$info = new infolog_bo();	// need some labels from
140
+		$info = new infolog_bo(); // need some labels from
141 141
 		$filters = $show_home = array();
142 142
 		$show_home[] = lang("DON'T show InfoLog");
143 143
 		$filters['none'] = $info->filters[''];
144
-		foreach($info->filters as $key => $label)
144
+		foreach ($info->filters as $key => $label)
145 145
 		{
146 146
 			$show_home[$key] = $filters[$key] = lang($label);
147 147
 		}
148 148
 
149 149
 		// migrage old filter-pref 1,2 to the filter one 'own-open-today'
150
-		if (isset($GLOBALS['type']) && in_array($GLOBALS['egw']->preferences->{$GLOBALS['type']}['homeShowEvents'],array('1','2')))
150
+		if (isset($GLOBALS['type']) && in_array($GLOBALS['egw']->preferences->{$GLOBALS['type']}['homeShowEvents'], array('1', '2')))
151 151
 		{
152
-			$GLOBALS['egw']->preferences->add('infolog','homeShowEvents','own-open-today',$GLOBALS['type']);
152
+			$GLOBALS['egw']->preferences->add('infolog', 'homeShowEvents', 'own-open-today', $GLOBALS['type']);
153 153
 			$GLOBALS['egw']->preferences->save_repository();
154 154
 		}
155 155
 		$show_links = array(
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 				'help'   => 'Should the Infolog list show a unique numerical Id, which can be used eg. as ticket Id.',
227 227
 				'xmlrpc' => True,
228 228
 				'admin'  => False,
229
-				'default'=> '1',	// Yes
229
+				'default'=> '1', // Yes
230 230
 			),
231 231
 			'listNoSubs' => array(
232 232
 				'type'   => 'select',
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 				'help'   => 'Should InfoLog show Subtasks, -calls or -notes in the normal view or not. You can always view the Subs via there parent.',
241 241
 				'xmlrpc' => True,
242 242
 				'admin'  => False,
243
-				'default'=> '0',	// Allways show them
243
+				'default'=> '0', // Allways show them
244 244
 			),
245 245
 			'show_links' => array(
246 246
 				'type'   => 'select',
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 				'help'   => 'Should the Infolog list show the percent done only for status ongoing or two separate icons.',
261 261
 				'xmlrpc' => True,
262 262
 				'admin'  => False,
263
-				'default'=> 1,	// Yes
263
+				'default'=> 1, // Yes
264 264
 			),
265 265
 			'limit_des_lines' => array(
266 266
 				'type'   => 'input',
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 			'help'   => 'Do you want a notification, if items you created get updated?',
290 290
 			'xmlrpc' => True,
291 291
 			'admin'  => False,
292
-			'default'=> '1',	// Yes
292
+			'default'=> '1', // Yes
293 293
 		);
294 294
 		$settings['notify_assigned'] = array(
295 295
 			'type'   => 'select',
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 			),
304 304
 			'xmlrpc' => True,
305 305
 			'admin'  => False,
306
-			'default'=> '1',	// Yes
306
+			'default'=> '1', // Yes
307 307
 		);
308 308
 
309 309
 		// to add options for more then 3 days back or in advance, you need to update soinfolog::users_with_open_entries()!
@@ -312,8 +312,8 @@  discard block
 block discarded – undo
312 312
 			'-1d' => lang('one day after'),
313 313
 			'0d'  => lang('same day'),
314 314
 			'1d'  => lang('one day in advance'),
315
-			'2d'  => lang('%1 days in advance',2),
316
-			'3d'  => lang('%1 days in advance',3),
315
+			'2d'  => lang('%1 days in advance', 2),
316
+			'3d'  => lang('%1 days in advance', 3),
317 317
 		);
318 318
 		$settings['notify_due_delegated'] = array(
319 319
 			'type'   => 'select',
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 			'values' => $options,
324 324
 			'xmlrpc' => True,
325 325
 			'admin'  => False,
326
-			'default'=> '0',	// No
326
+			'default'=> '0', // No
327 327
 		);
328 328
 		$settings['notify_due_responsible'] = array(
329 329
 			'type'   => 'select',
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 			'values' => $options,
334 334
 			'xmlrpc' => True,
335 335
 			'admin'  => False,
336
-			'default'=> '0d',	// Same day
336
+			'default'=> '0d', // Same day
337 337
 		);
338 338
 		$settings['notify_start_delegated'] = array(
339 339
 			'type'   => 'select',
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 			'values' => $options,
344 344
 			'xmlrpc' => True,
345 345
 			'admin'  => False,
346
-			'default'=> '0',	// No
346
+			'default'=> '0', // No
347 347
 		);
348 348
 		$settings['notify_start_responsible'] = array(
349 349
 			'type'   => 'select',
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 			'values' => $options,
354 354
 			'xmlrpc' => True,
355 355
 			'admin'  => False,
356
-			'default'=> '0d',	// Same day
356
+			'default'=> '0d', // Same day
357 357
 		);
358 358
 
359 359
 		// receive notification for items owned by groups you are part of
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 			'help'   => 'Do you want a notification if items owned by groups you are part of get updated ?',
365 365
 			'xmlrpc' => True,
366 366
 			'admin'  => False,
367
-			'default'=> '0',	// No
367
+			'default'=> '0', // No
368 368
 		);
369 369
 
370 370
 		$settings[] = array(
@@ -383,8 +383,8 @@  discard block
 block discarded – undo
383 383
 				'size'   => 60,
384 384
 				'label'  => 'Default document to insert entries',
385 385
 				'name'   => 'default_document',
386
-				'help'   => lang('If you specify a document (full vfs path) here, %1 displays an extra document icon for each entry. That icon allows to download the specified document with the data inserted.',lang('infolog')).' '.
387
-					lang('The document can contain placeholder like {{%1}}, to be replaced with the data.','info_subject').' '.
386
+				'help'   => lang('If you specify a document (full vfs path) here, %1 displays an extra document icon for each entry. That icon allows to download the specified document with the data inserted.', lang('infolog')).' '.
387
+					lang('The document can contain placeholder like {{%1}}, to be replaced with the data.', 'info_subject').' '.
388 388
 					lang('The following document-types are supported:').'*.rtf, *.txt',
389 389
 				'run_lang' => false,
390 390
 				'xmlrpc' => True,
@@ -395,8 +395,8 @@  discard block
 block discarded – undo
395 395
 				'size'   => 60,
396 396
 				'label'  => 'Directory with documents to insert entries',
397 397
 				'name'   => 'document_dir',
398
-				'help'   => lang('If you specify a directory (full vfs path) here, %1 displays an action for each document. That action allows to download the specified document with the data inserted.',lang('infolog')).' '.
399
-					lang('The document can contain placeholder like {{%1}}, to be replaced with the data.','info_subject').' '.
398
+				'help'   => lang('If you specify a directory (full vfs path) here, %1 displays an action for each document. That action allows to download the specified document with the data inserted.', lang('infolog')).' '.
399
+					lang('The document can contain placeholder like {{%1}}, to be replaced with the data.', 'info_subject').' '.
400 400
 					lang('The following document-types are supported:').'*.rtf, *.txt',
401 401
 				'run_lang' => false,
402 402
 				'xmlrpc' => True,
@@ -485,12 +485,12 @@  discard block
 block discarded – undo
485 485
 	 */
486 486
 	private static function all_cats()
487 487
 	{
488
-		$categories = new Api\Categories('','infolog');
488
+		$categories = new Api\Categories('', 'infolog');
489 489
 		$accountId = $GLOBALS['egw_info']['user']['account_id'];
490 490
 
491
-		foreach((array)$categories->return_sorted_array(0,False,'','','',true) as $cat)
491
+		foreach ((array)$categories->return_sorted_array(0, False, '', '', '', true) as $cat)
492 492
 		{
493
-			$s = str_repeat('&nbsp;',$cat['level']) . stripslashes($cat['name']);
493
+			$s = str_repeat('&nbsp;', $cat['level']).stripslashes($cat['name']);
494 494
 
495 495
 			if ($cat['app_name'] == 'phpgw' || $cat['owner'] == '-1')
496 496
 			{
@@ -498,13 +498,13 @@  discard block
 block discarded – undo
498 498
 			}
499 499
 			elseif ($cat['owner'] != $accountId)
500 500
 			{
501
-				$s .= '&lt;' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '&gt;';
501
+				$s .= '&lt;'.$GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname').'&gt;';
502 502
 			}
503 503
 			elseif ($cat['access'] == 'private')
504 504
 			{
505 505
 				$s .= ' &#9829;';
506 506
 			}
507
-			$sel_options[$cat['id']] = $s;	// 0.9.14 only
507
+			$sel_options[$cat['id']] = $s; // 0.9.14 only
508 508
 		}
509 509
 		return $sel_options;
510 510
 	}
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
 
526 526
 			if (!$async->read('infolog-async-notification'))
527 527
 			{
528
-				$async->set_timer(array('hour' => 2),'infolog-async-notification','infolog.infolog_bo.async_notification',null);
528
+				$async->set_timer(array('hour' => 2), 'infolog-async-notification', 'infolog.infolog_bo.async_notification', null);
529 529
 			}
530 530
 		}
531 531
 	}
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
 	 */
539 539
 	public static function acl_rights($params)
540 540
 	{
541
-		unset($params);	// not used, but default function signature for hooks
541
+		unset($params); // not used, but default function signature for hooks
542 542
 		return array(
543 543
 			Acl::READ    => 'read',
544 544
 			Acl::ADD     => 'add',
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
 	 */
557 557
 	public static function categories($location)
558 558
 	{
559
-		unset($location);	// not used, but part of hook signature
559
+		unset($location); // not used, but part of hook signature
560 560
 		return true;
561 561
 	}
562 562
 
@@ -567,9 +567,9 @@  discard block
 block discarded – undo
567 567
 	 */
568 568
 	public static function mail_import($args)
569 569
 	{
570
-		unset($args);	// not used, but required by function signature
570
+		unset($args); // not used, but required by function signature
571 571
 
572
-		return array (
572
+		return array(
573 573
 			'menuaction' => 'infolog.infolog_ui.mail_import',
574 574
 			'popup' => Link::get_registry('infolog', 'edit_popup')
575 575
 		);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
 
109 109
 		if ($GLOBALS['egw_info']['user']['apps']['admin'] && !Api\Header\UserAgent::mobile())
110 110
 		{
111
-			$file = Array(
111
+			$file = array(
112 112
 				'Site configuration' => Egw::link('/index.php',array(
113 113
 					'menuaction' => 'infolog.infolog_ui.admin' )),
114 114
 				'Global Categories'  => Egw::link('/index.php',array(
Please login to merge, or discard this patch.