Completed
Push — 14.2 ( e07840...cec2da )
by Ralf
83:18 queued 52:04
created
timesheet/inc/class.timesheet_wizard_export_csv.inc.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
                 );
48 48
 
49 49
 		$custom = Api\Storage\Customfields::get('resources', true);
50
-		foreach($custom as $name => $data) {
50
+		foreach ($custom as $name => $data) {
51 51
 			$this->mapping_fields['#'.$name] = $data['label'];
52 52
 		}
53 53
 
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.
timesheet/inc/class.timesheet_hooks.inc.php 3 patches
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -156,7 +156,10 @@
 block discarded – undo
156 156
 	static function settings()
157 157
 	{
158 158
 		$settings = array();
159
-		if (is_null(self::$timesheet_bo)) self::$timesheet_bo = new timesheet_bo();
159
+		if (is_null(self::$timesheet_bo))
160
+		{
161
+			self::$timesheet_bo = new timesheet_bo();
162
+		}
160 163
 		if (self::$timesheet_bo->status_labels)
161 164
 		{
162 165
 			$settings['predefined_status'] = array(
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 if (!defined('TIMESHEET_APP'))
14 14
 {
15
-	define('TIMESHEET_APP','timesheet');
15
+	define('TIMESHEET_APP', 'timesheet');
16 16
 }
17 17
 
18 18
 /**
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 			'add_id'     => 'link_id',
57 57
 			'add_popup'  => '600x425',
58 58
 			'file_access'=> TIMESHEET_APP.'.timesheet_bo.file_access',
59
-			'file_access_user' => true,	// file_access supports 4th parameter $user
59
+			'file_access_user' => true, // file_access supports 4th parameter $user
60 60
 			'notify'     => TIMESHEET_APP.'.timesheet_bo.notify',
61 61
 			'merge' => true,
62 62
 		);
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
 	 */
73 73
 	static function cumulate($param)
74 74
 	{
75
-		$links = egw_link::get_3links(TIMESHEET_APP,'projectmanager',$param['pm_id']);
75
+		$links = egw_link::get_3links(TIMESHEET_APP, 'projectmanager', $param['pm_id']);
76 76
 
77 77
 		$rows = array();
78
-		foreach($links as $link)
78
+		foreach ($links as $link)
79 79
 		{
80 80
 			$rows[$link['id']] = array(
81 81
 				'pm_id'       => $link['id2'],
@@ -107,37 +107,37 @@  discard block
 block discarded – undo
107 107
 			display_sidebox($appname, lang('Favorites'), egw_framework::favorite_list($appname));
108 108
 
109 109
 			$file = array(
110
-				'Timesheet list' => egw::link('/index.php',array(
110
+				'Timesheet list' => egw::link('/index.php', array(
111 111
 					'menuaction' => 'timesheet.timesheet_ui.index',
112 112
 					'ajax' => 'true')),
113 113
 				array(
114
-					'text' => lang('Add %1',lang(egw_link::get_registry($appname, 'entry'))),
114
+					'text' => lang('Add %1', lang(egw_link::get_registry($appname, 'entry'))),
115 115
 					'no_lang' => true,
116 116
 					'link' => "javascript:egw.open('','$appname','add')"
117 117
 				),
118 118
 			);
119
-			$file['Placeholders'] = egw::link('/index.php','menuaction=timesheet.timesheet_merge.show_replacements');
120
-			display_sidebox($appname,$GLOBALS['egw_info']['apps'][$appname]['title'].' '.lang('Menu'),$file);
119
+			$file['Placeholders'] = egw::link('/index.php', 'menuaction=timesheet.timesheet_merge.show_replacements');
120
+			display_sidebox($appname, $GLOBALS['egw_info']['apps'][$appname]['title'].' '.lang('Menu'), $file);
121 121
 		}
122 122
 
123 123
 		if ($GLOBALS['egw_info']['user']['apps']['admin'])
124 124
 		{
125 125
 			$file = Array(
126
-				'Site Configuration' => egw::link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname),
127
-				'Custom fields' => egw::link('/index.php','menuaction=admin.customfields.index&appname='.$appname.'&use_private=1'),
128
-				'Global Categories'  => egw::link('/index.php',array(
126
+				'Site Configuration' => egw::link('/index.php', 'menuaction=admin.uiconfig.index&appname='.$appname),
127
+				'Custom fields' => egw::link('/index.php', 'menuaction=admin.customfields.index&appname='.$appname.'&use_private=1'),
128
+				'Global Categories'  => egw::link('/index.php', array(
129 129
 					'menuaction' => 'admin.admin_categories.index',
130 130
 					'appname'    => $appname,
131 131
 					'global_cats'=> True)),
132
-				'Edit Status' => egw::link('/index.php','menuaction=timesheet.timesheet_ui.editstatus'),
132
+				'Edit Status' => egw::link('/index.php', 'menuaction=timesheet.timesheet_ui.editstatus'),
133 133
 			);
134 134
 			if ($location == 'admin')
135 135
 			{
136
-				display_section($appname,$file);
136
+				display_section($appname, $file);
137 137
 			}
138 138
 			else
139 139
 			{
140
-				display_sidebox($appname,lang('Admin'),$file);
140
+				display_sidebox($appname, lang('Admin'), $file);
141 141
 			}
142 142
 		}
143 143
 	}
@@ -170,9 +170,9 @@  discard block
 block discarded – undo
170 170
 				'size'   => 60,
171 171
 				'label'  => 'Default document to insert entries',
172 172
 				'name'   => 'default_document',
173
-				'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('timesheet')).' '.
173
+				'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('timesheet')).' '.
174 174
 					lang('The document can contain placeholder like {{%1}}, to be replaced with the data.', 'ts_title').' '.
175
-					lang('The following document-types are supported:'). implode(',',bo_merge::get_file_extensions()),
175
+					lang('The following document-types are supported:').implode(',', bo_merge::get_file_extensions()),
176 176
 				'run_lang' => false,
177 177
 				'xmlrpc' => True,
178 178
 				'admin'  => False,
@@ -183,8 +183,8 @@  discard block
 block discarded – undo
183 183
 				'label'  => 'Directory with documents to insert entries',
184 184
 				'name'   => 'document_dir',
185 185
 				'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 %1 data inserted.', lang('timesheet')).' '.
186
-					lang('The document can contain placeholder like {{%1}}, to be replaced with the data.','ts_title').' '.
187
-					lang('The following document-types are supported:'). implode(',',bo_merge::get_file_extensions()),
186
+					lang('The document can contain placeholder like {{%1}}, to be replaced with the data.', 'ts_title').' '.
187
+					lang('The following document-types are supported:').implode(',', bo_merge::get_file_extensions()),
188 188
 				'run_lang' => false,
189 189
 				'xmlrpc' => True,
190 190
 				'admin'  => False,
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.
timesheet/inc/class.timesheet_merge.inc.php 2 patches
Braces   +33 added lines, -8 removed lines patch added patch discarded remove patch
@@ -139,7 +139,10 @@  discard block
 block discarded – undo
139 139
 		// Set any missing custom fields, or the marker will stay
140 140
 		foreach(array_keys($this->bo->customfields) as $name)
141 141
 		{
142
-			if(!$array['#'.$name]) $array['#'.$name] = '';
142
+			if(!$array['#'.$name])
143
+			{
144
+				$array['#'.$name] = '';
145
+			}
143 146
 		}
144 147
 
145 148
 		// Links
@@ -148,7 +151,10 @@  discard block
 block discarded – undo
148 151
 		// Add markers
149 152
 		foreach($array as $key => &$value)
150 153
 		{
151
-			if(!$value) $value = '';
154
+			if(!$value)
155
+			{
156
+				$value = '';
157
+			}
152 158
 			$info['$$'.($prefix ? $prefix.'/':'').$key.'$$'] = $value;
153 159
 		}
154 160
 		return $info;
@@ -171,16 +177,29 @@  discard block
 block discarded – undo
171 177
 		$fields = array('ts_id' => lang('Timesheet ID')) + $this->bo->field2label + array('ts_total' => lang('total'));
172 178
 		foreach($fields as $name => $label)
173 179
 		{
174
-			if (in_array($name,array('pl_id','customfields'))) continue;	// dont show them
180
+			if (in_array($name,array('pl_id','customfields')))
181
+			{
182
+				continue;
183
+			}
184
+			// dont show them
175 185
 
176
-			if (in_array($name,array('ts_title', 'ts_description')) && $n&1)		// main values, which should be in the first column
186
+			if (in_array($name,array('ts_title', 'ts_description')) && $n&1)
187
+			{
188
+				// main values, which should be in the first column
177 189
 			{
178 190
 				echo "</tr>\n";
191
+			}
179 192
 				$n++;
180 193
 			}
181
-			if (!($n&1)) echo '<tr>';
194
+			if (!($n&1))
195
+			{
196
+				echo '<tr>';
197
+			}
182 198
 			echo '<td>{{'.$name.'}}</td><td>'.lang($label).'</td>';
183
-			if ($n&1) echo "</tr>\n";
199
+			if ($n&1)
200
+			{
201
+				echo "</tr>\n";
202
+			}
184 203
 			$n++;
185 204
 		}
186 205
 
@@ -195,9 +214,15 @@  discard block
 block discarded – undo
195 214
 		$i = 0;
196 215
 		foreach($pm_merge->projectmanager_fields as $name => $label)
197 216
 		{
198
-			if (!($i&1)) echo '<tr>';
217
+			if (!($i&1))
218
+			{
219
+				echo '<tr>';
220
+			}
199 221
 			echo '<td>{{ts_project/'.$name.'}}</td><td>'.$label.'</td>';
200
-			if ($i&1) echo "</tr>\n";
222
+			if ($i&1)
223
+			{
224
+				echo "</tr>\n";
225
+			}
201 226
 			$i++;
202 227
 		}
203 228
 
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -67,23 +67,23 @@  discard block
 block discarded – undo
67 67
 	 * @param string &$content=null content to create some replacements only if they are use
68 68
 	 * @return array|boolean
69 69
 	 */
70
-	protected function get_replacements($id,&$content=null)
70
+	protected function get_replacements($id, &$content = null)
71 71
 	{
72 72
 		if (!($replacements = $this->timesheet_replacements($id, '', $content)))
73 73
 		{
74 74
 			return false;
75 75
 		}
76
-		if (!(strpos($content,'$$ts_project/') === false))
76
+		if (!(strpos($content, '$$ts_project/') === false))
77 77
 		{
78 78
 			// Check to see if it's actually a project, then load
79
-			if($replacements['$$pm_id$$'])
79
+			if ($replacements['$$pm_id$$'])
80 80
 			{
81
-				if(!$this->pm)
81
+				if (!$this->pm)
82 82
 				{
83 83
 					$this->pm = new projectmanager_merge();
84 84
 				}
85 85
 				$this->pm->projectmanager_bo = new projectmanager_bo($replacements['$$pm_id$$']);
86
-				$replacements += $this->pm->projectmanager_replacements($replacements['$$pm_id$$'],'ts_project');
86
+				$replacements += $this->pm->projectmanager_replacements($replacements['$$pm_id$$'], 'ts_project');
87 87
 			}
88 88
 		}
89 89
 		return $replacements;
@@ -96,14 +96,14 @@  discard block
 block discarded – undo
96 96
 	 * @param string $prefix='' prefix like eg. 'erole'
97 97
 	 * @return array|boolean
98 98
 	 */
99
-	public function timesheet_replacements($id,$prefix='', &$content = null)
99
+	public function timesheet_replacements($id, $prefix = '', &$content = null)
100 100
 	{
101 101
 		$record = new timesheet_egw_record($id);
102 102
 		$info = array();
103 103
 
104 104
 		// Get project manager ID
105
-		$links = solink::get_links('timesheet',$id,'projectmanager');
106
-		if($links)
105
+		$links = solink::get_links('timesheet', $id, 'projectmanager');
106
+		if ($links)
107 107
 		{
108 108
 			$record->pm_id = current($links);
109 109
 		}
@@ -111,15 +111,15 @@  discard block
 block discarded – undo
111 111
 		// Convert to human friendly values
112 112
 		$types = timesheet_egw_record::$types;
113 113
 		$_selects = array('status' => $this->bo->status_labels);
114
-		foreach($_selects['status'] as &$status)
114
+		foreach ($_selects['status'] as &$status)
115 115
 		{
116 116
 			$status = str_replace('&nbsp;', '', $status);
117 117
 		}
118
-		foreach($_selects as $name => $value)
118
+		foreach ($_selects as $name => $value)
119 119
 		{
120 120
 			$selects['ts_'.$name] = $value;
121 121
 		}
122
-		if($content && strpos($content, '#') !== 0)
122
+		if ($content && strpos($content, '#') !== 0)
123 123
 		{
124 124
 			$this->cf_link_to_expand($record->get_record_array(), $content, $info);
125 125
 		}
@@ -128,25 +128,25 @@  discard block
 block discarded – undo
128 128
 
129 129
 		$array = $record->get_record_array();
130 130
 		$array['ts_total'] = $array['ts_quantity'] * $array['ts_unitprice'];
131
-		foreach(array('ts_duration','ts_quantity','ts_unitprice','ts_total') as $key)
131
+		foreach (array('ts_duration', 'ts_quantity', 'ts_unitprice', 'ts_total') as $key)
132 132
 		{
133
-			$array[$key] = self::number_format($array[$key],2,$this->mimetype);
133
+			$array[$key] = self::number_format($array[$key], 2, $this->mimetype);
134 134
 		}
135 135
 
136 136
 		// Set any missing custom fields, or the marker will stay
137
-		foreach(array_keys($this->bo->customfields) as $name)
137
+		foreach (array_keys($this->bo->customfields) as $name)
138 138
 		{
139
-			if(!$array['#'.$name]) $array['#'.$name] = '';
139
+			if (!$array['#'.$name]) $array['#'.$name] = '';
140 140
 		}
141 141
 
142 142
 		// Links
143 143
 		$array += $this->get_all_links('timesheet', $id, $prefix, $content);
144 144
 
145 145
 		// Add markers
146
-		foreach($array as $key => &$value)
146
+		foreach ($array as $key => &$value)
147 147
 		{
148
-			if(!$value) $value = '';
149
-			$info['$$'.($prefix ? $prefix.'/':'').$key.'$$'] = $value;
148
+			if (!$value) $value = '';
149
+			$info['$$'.($prefix ? $prefix.'/' : '').$key.'$$'] = $value;
150 150
 		}
151 151
 		return $info;
152 152
 	}
@@ -166,11 +166,11 @@  discard block
 block discarded – undo
166 166
 
167 167
 		$n = 0;
168 168
 		$fields = array('ts_id' => lang('Timesheet ID')) + $this->bo->field2label + array('ts_total' => lang('total'));
169
-		foreach($fields as $name => $label)
169
+		foreach ($fields as $name => $label)
170 170
 		{
171
-			if (in_array($name,array('pl_id','customfields'))) continue;	// dont show them
171
+			if (in_array($name, array('pl_id', 'customfields'))) continue; // dont show them
172 172
 
173
-			if (in_array($name,array('ts_title', 'ts_description')) && $n&1)		// main values, which should be in the first column
173
+			if (in_array($name, array('ts_title', 'ts_description')) && $n&1)		// main values, which should be in the first column
174 174
 			{
175 175
 				echo "</tr>\n";
176 176
 				$n++;
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 		}
183 183
 
184 184
 		echo '<tr><td colspan="4"><h3>'.lang('Custom fields').":</h3></td></tr>";
185
-		foreach($this->bo->customfields as $name => $field)
185
+		foreach ($this->bo->customfields as $name => $field)
186 186
 		{
187 187
 			echo '<tr><td>{{#'.$name.'}}</td><td colspan="3">'.$field['label']."</td></tr>\n";
188 188
 		}
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 		echo '<tr><td colspan="4"><h3>'.lang('Project fields').':</h3></td></tr>';
191 191
 		$pm_merge = new projectmanager_merge();
192 192
 		$i = 0;
193
-		foreach($pm_merge->projectmanager_fields as $name => $label)
193
+		foreach ($pm_merge->projectmanager_fields as $name => $label)
194 194
 		{
195 195
 			if (!($i&1)) echo '<tr>';
196 196
 			echo '<td>{{ts_project/'.$name.'}}</td><td>'.$label.'</td>';
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 		}
200 200
 
201 201
 		echo '<tr><td colspan="4"><h3>'.lang('General fields:')."</h3></td></tr>";
202
-		foreach(array(
202
+		foreach (array(
203 203
 			'link' => lang('HTML link to the current record'),
204 204
 			'links' => lang('Titles of any entries linked to the current record, excluding attached files'),
205 205
  			'attachments' => lang('List of files linked to the current record'),
Please login to merge, or discard this patch.
notifications/inc/class.notifications_iface.inc.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,8 @@
 block discarded – undo
12 12
 /**
13 13
  * Instant user notification
14 14
  */
15
-interface notifications_iface {
15
+interface notifications_iface
16
+{
16 17
 
17 18
 	/**
18 19
 	 * constructor
Please login to merge, or discard this patch.
notifications/inc/class.notifications_popup.inc.php 4 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
106 106
 		// Check access log to see if user is still logged in
107 107
 		if ( !Api\Session::notifications_active($this->recipient->account_id) )
108 108
 		{
109
-			throw new Exception("User {$this->recipient->account_lid} isn't online. Can't send notification via popup");
109
+			throw new Exception("user {$this->recipient->account_lid} isn't online. Can't send notification via popup");
110 110
 		}
111 111
 
112 112
 		$message = 	$this->render_infos($_subject)
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -117,7 +117,6 @@  discard block
 block discarded – undo
117 117
 	 * saves notification into database so that the client can fetch it from there
118 118
 	 *
119 119
 	 * @param string $_message
120
-	 * @param array $_user_sessions
121 120
 	 */
122 121
 	private function save( $_message ) {
123 122
 		$result = $this->db->insert( self::_notification_table, array(
@@ -179,9 +178,8 @@  discard block
 block discarded – undo
179 178
 	 * returns javascript to open a popup window: window.open(...)
180 179
 	 *
181 180
 	 * @param string $link link or this.href
182
-	 * @param string $target='_blank' name of target or this.target
183
-	 * @param int $width=750 width of the window
184
-	 * @param int $height=400 height of the window
181
+	 * @param int $width width of the window
182
+	 * @param int $height height of the window
185 183
 	 * @return string javascript (using single quotes)
186 184
 	 */
187 185
 	private function jspopup($link,$target='_blank',$width=750,$height=410)
@@ -202,7 +200,7 @@  discard block
 block discarded – undo
202 200
 	 * renders additional infos from sender and subject
203 201
 	 *
204 202
 	 * @param string $_subject
205
-	 * @return html rendered info as complete string
203
+	 * @return string rendered info as complete string
206 204
 	 */
207 205
 	private function render_infos($_subject = false) {
208 206
 		$infos = array();
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
 	 */
82 82
 	public function __construct($_sender, $_recipient, $_config = null, $_preferences = null) {
83 83
 		//error_log(__METHOD__."(".array2string($_sender).', '.array2string($_recipient).', '.array2string($config).',...)');
84
-		if(!is_object($_sender)) { throw new Exception("no sender given."); }
85
-		if(!is_object($_recipient)) { throw new Exception("no recipient given."); }
84
+		if (!is_object($_sender)) { throw new Exception("no sender given."); }
85
+		if (!is_object($_recipient)) { throw new Exception("no recipient given."); }
86 86
 		$this->sender = $_sender;
87 87
 		$this->recipient = $_recipient;
88 88
 		$this->config = $_config;
@@ -100,17 +100,17 @@  discard block
 block discarded – undo
100 100
 	 */
101 101
 	public function send(array $_messages, $_subject = false, $_links = false, $_attachments = false) {
102 102
 		// Check access log to see if user is still logged in
103
-		if ( !egw_session::notifications_active($this->recipient->account_id) )
103
+		if (!egw_session::notifications_active($this->recipient->account_id))
104 104
 		{
105 105
 			throw new Exception("User {$this->recipient->account_lid} isn't online. Can't send notification via popup");
106 106
 		}
107 107
 
108
-		$message = 	$this->render_infos($_subject)
108
+		$message = $this->render_infos($_subject)
109 109
 					.html::hr()
110
-					.(isset($_messages['popup'])&&!empty($_messages['popup'])?$_messages['popup']:$_messages['html'])
110
+					.(isset($_messages['popup']) && !empty($_messages['popup']) ? $_messages['popup'] : $_messages['html'])
111 111
 					.$this->render_links($_links);
112 112
 
113
-		$this->save( $message );
113
+		$this->save($message);
114 114
 	}
115 115
 
116 116
 	/**
@@ -119,12 +119,12 @@  discard block
 block discarded – undo
119 119
 	 * @param string $_message
120 120
 	 * @param array $_user_sessions
121 121
 	 */
122
-	private function save( $_message ) {
123
-		$result = $this->db->insert( self::_notification_table, array(
122
+	private function save($_message) {
123
+		$result = $this->db->insert(self::_notification_table, array(
124 124
 			'account_id'     => $this->recipient->account_id,
125 125
 			'notify_message' => $_message,
126 126
 			'notify_type'	 => self::_type
127
-			), false,__LINE__,__FILE__,self::_appname);
127
+			), false, __LINE__, __FILE__, self::_appname);
128 128
 		if ($result === false) throw new Exception("Can't save notification into SQL table");
129 129
 	}
130 130
 
@@ -136,25 +136,25 @@  discard block
 block discarded – undo
136 136
 	 * @return html rendered link(s) as complete string with jspopup or a new window
137 137
 	 */
138 138
 	private function render_links($_links = false) {
139
-		if(!is_array($_links) || count($_links) == 0) { return false; }
139
+		if (!is_array($_links) || count($_links) == 0) { return false; }
140 140
 		$newline = "<br />";
141 141
 
142 142
 		$rendered_links = array();
143
-		foreach($_links as $link) {
144
-			if(!$link->popup) { $link->view['no_popup'] = 1; }
143
+		foreach ($_links as $link) {
144
+			if (!$link->popup) { $link->view['no_popup'] = 1; }
145 145
 
146 146
 			$url = html::link('/index.php', $link->view);
147 147
 			// do not expose sensitive data
148
-			$url = preg_replace('/(sessionid|kp3|domain)=[^&]+&?/','',$url);
148
+			$url = preg_replace('/(sessionid|kp3|domain)=[^&]+&?/', '', $url);
149 149
 			// extract application-icon from menuaction
150
-			if($link->view['menuaction']) {
151
-				$menuaction_arr = explode('.',$link->view['menuaction']);
150
+			if ($link->view['menuaction']) {
151
+				$menuaction_arr = explode('.', $link->view['menuaction']);
152 152
 				$application = $menuaction_arr[0];
153
-				$image = $application ? html::image($application,'navbar',$link->text,'align="middle" style="width: 24px; margin-right: 0.5em;"') : '';
153
+				$image = $application ? html::image($application, 'navbar', $link->text, 'align="middle" style="width: 24px; margin-right: 0.5em;"') : '';
154 154
 			} else {
155 155
 				$image = '';
156 156
 			}
157
-			if($link->popup && !$GLOBALS['egw_info']['user']['preferences']['notifications']['external_mailclient'])
157
+			if ($link->popup && !$GLOBALS['egw_info']['user']['preferences']['notifications']['external_mailclient'])
158 158
 			{
159 159
 				$dimensions = explode('x', $link->popup);
160 160
 				$data = array(
@@ -164,14 +164,14 @@  discard block
 block discarded – undo
164 164
 					"data-popup = '{$link->popup}'"
165 165
 				);
166 166
 
167
-				$rendered_links[] = html::div($image.$link->text,implode(' ',$data),'link');
167
+				$rendered_links[] = html::div($image.$link->text, implode(' ', $data), 'link');
168 168
 			} else {
169
-				$rendered_links[] = html::div('<a href="'.$url.'" target="_blank">'.$image.$link->text.'</a>','','link');
169
+				$rendered_links[] = html::div('<a href="'.$url.'" target="_blank">'.$image.$link->text.'</a>', '', 'link');
170 170
 			}
171 171
 
172 172
 		}
173
-		if(count($rendered_links) > 0) {
174
-			return html::hr().html::bold(lang('Linked entries:')).$newline.implode($newline,$rendered_links);
173
+		if (count($rendered_links) > 0) {
174
+			return html::hr().html::bold(lang('Linked entries:')).$newline.implode($newline, $rendered_links);
175 175
 		}
176 176
 	}
177 177
 
@@ -184,9 +184,9 @@  discard block
 block discarded – undo
184 184
 	 * @param int $height=400 height of the window
185 185
 	 * @return string javascript (using single quotes)
186 186
 	 */
187
-	private function jspopup($link,$target='_blank',$width=750,$height=410)
187
+	private function jspopup($link, $target = '_blank', $width = 750, $height = 410)
188 188
 	{
189
-		if($GLOBALS['egw_info']['user']['preferences']['notifications']['external_mailclient'])
189
+		if ($GLOBALS['egw_info']['user']['preferences']['notifications']['external_mailclient'])
190 190
 		{
191 191
 			return 'window.open('.($link == 'this.href' ? $link : "'".$link."'").','.
192 192
 				($target == 'this.target' ? $target : "'".$target."'").",$width,$height,'yes')";
@@ -210,8 +210,8 @@  discard block
 block discarded – undo
210 210
 
211 211
 		$sender = $this->sender->account_fullname ? $this->sender->account_fullname : $this->sender_account_email;
212 212
 		$infos[] = lang('Message from').': '.$sender;
213
-		if(!empty($_subject)) { $infos[] = html::bold($_subject); }
214
-		return implode($newline,$infos);
213
+		if (!empty($_subject)) { $infos[] = html::bold($_subject); }
214
+		return implode($newline, $infos);
215 215
 	}
216 216
 
217 217
 	/**
@@ -220,8 +220,8 @@  discard block
 block discarded – undo
220 220
 	 * @param settings array with keys account_id and new_owner (new_owner is optional)
221 221
 	 */
222 222
 	public static function deleteaccount($settings) {
223
-		$GLOBALS['egw']->db->delete( self::_notification_table, array(
223
+		$GLOBALS['egw']->db->delete(self::_notification_table, array(
224 224
 			'account_id'	=> $settings['account_id']
225
-		),__LINE__,__FILE__,self::_appname);
225
+		), __LINE__, __FILE__, self::_appname);
226 226
 	}
227 227
 }
Please login to merge, or discard this patch.
Braces   +45 added lines, -18 removed lines patch added patch discarded remove patch
@@ -19,7 +19,8 @@  discard block
 block discarded – undo
19 19
  * out the table to look if there is a notificaton for this
20 20
  * client. The second stage is done in class.notifications_ajax.inc.php
21 21
  */
22
-class notifications_popup implements notifications_iface {
22
+class notifications_popup implements notifications_iface
23
+{
23 24
 
24 25
 	/**
25 26
 	 * Appname
@@ -79,10 +80,15 @@  discard block
 block discarded – undo
79 80
 	 * @param object $_config
80 81
 	 * @param object $_preferences
81 82
 	 */
82
-	public function __construct($_sender, $_recipient, $_config = null, $_preferences = null) {
83
+	public function __construct($_sender, $_recipient, $_config = null, $_preferences = null)
84
+	{
83 85
 		//error_log(__METHOD__."(".array2string($_sender).', '.array2string($_recipient).', '.array2string($config).',...)');
84
-		if(!is_object($_sender)) { throw new Exception("no sender given."); }
85
-		if(!is_object($_recipient)) { throw new Exception("no recipient given."); }
86
+		if(!is_object($_sender))
87
+		{
88
+throw new Exception("no sender given."); }
89
+		if(!is_object($_recipient))
90
+		{
91
+throw new Exception("no recipient given."); }
86 92
 		$this->sender = $_sender;
87 93
 		$this->recipient = $_recipient;
88 94
 		$this->config = $_config;
@@ -98,7 +104,8 @@  discard block
 block discarded – undo
98 104
 	 * @param array $_links
99 105
 	 * @param array $_attachments
100 106
 	 */
101
-	public function send(array $_messages, $_subject = false, $_links = false, $_attachments = false) {
107
+	public function send(array $_messages, $_subject = false, $_links = false, $_attachments = false)
108
+	{
102 109
 		// Check access log to see if user is still logged in
103 110
 		if ( !egw_session::notifications_active($this->recipient->account_id) )
104 111
 		{
@@ -119,13 +126,17 @@  discard block
 block discarded – undo
119 126
 	 * @param string $_message
120 127
 	 * @param array $_user_sessions
121 128
 	 */
122
-	private function save( $_message ) {
129
+	private function save( $_message )
130
+	{
123 131
 		$result = $this->db->insert( self::_notification_table, array(
124 132
 			'account_id'     => $this->recipient->account_id,
125 133
 			'notify_message' => $_message,
126 134
 			'notify_type'	 => self::_type
127 135
 			), false,__LINE__,__FILE__,self::_appname);
128
-		if ($result === false) throw new Exception("Can't save notification into SQL table");
136
+		if ($result === false)
137
+		{
138
+			throw new Exception("Can't save notification into SQL table");
139
+		}
129 140
 	}
130 141
 
131 142
 	/**
@@ -135,23 +146,32 @@  discard block
 block discarded – undo
135 146
 	 * @param array $_links
136 147
 	 * @return html rendered link(s) as complete string with jspopup or a new window
137 148
 	 */
138
-	private function render_links($_links = false) {
139
-		if(!is_array($_links) || count($_links) == 0) { return false; }
149
+	private function render_links($_links = false)
150
+	{
151
+		if(!is_array($_links) || count($_links) == 0)
152
+		{
153
+return false; }
140 154
 		$newline = "<br />";
141 155
 
142 156
 		$rendered_links = array();
143
-		foreach($_links as $link) {
144
-			if(!$link->popup) { $link->view['no_popup'] = 1; }
157
+		foreach($_links as $link)
158
+		{
159
+			if(!$link->popup)
160
+			{
161
+$link->view['no_popup'] = 1; }
145 162
 
146 163
 			$url = html::link('/index.php', $link->view);
147 164
 			// do not expose sensitive data
148 165
 			$url = preg_replace('/(sessionid|kp3|domain)=[^&]+&?/','',$url);
149 166
 			// extract application-icon from menuaction
150
-			if($link->view['menuaction']) {
167
+			if($link->view['menuaction'])
168
+			{
151 169
 				$menuaction_arr = explode('.',$link->view['menuaction']);
152 170
 				$application = $menuaction_arr[0];
153 171
 				$image = $application ? html::image($application,'navbar',$link->text,'align="middle" style="width: 24px; margin-right: 0.5em;"') : '';
154
-			} else {
172
+			}
173
+			else
174
+			{
155 175
 				$image = '';
156 176
 			}
157 177
 			if($link->popup && !$GLOBALS['egw_info']['user']['preferences']['notifications']['external_mailclient'])
@@ -165,12 +185,15 @@  discard block
 block discarded – undo
165 185
 				);
166 186
 
167 187
 				$rendered_links[] = html::div($image.$link->text,implode(' ',$data),'link');
168
-			} else {
188
+			}
189
+			else
190
+			{
169 191
 				$rendered_links[] = html::div('<a href="'.$url.'" target="_blank">'.$image.$link->text.'</a>','','link');
170 192
 			}
171 193
 
172 194
 		}
173
-		if(count($rendered_links) > 0) {
195
+		if(count($rendered_links) > 0)
196
+		{
174 197
 			return html::hr().html::bold(lang('Linked entries:')).$newline.implode($newline,$rendered_links);
175 198
 		}
176 199
 	}
@@ -204,13 +227,16 @@  discard block
 block discarded – undo
204 227
 	 * @param string $_subject
205 228
 	 * @return html rendered info as complete string
206 229
 	 */
207
-	private function render_infos($_subject = false) {
230
+	private function render_infos($_subject = false)
231
+	{
208 232
 		$infos = array();
209 233
 		$newline = "<br />";
210 234
 
211 235
 		$sender = $this->sender->account_fullname ? $this->sender->account_fullname : $this->sender_account_email;
212 236
 		$infos[] = lang('Message from').': '.$sender;
213
-		if(!empty($_subject)) { $infos[] = html::bold($_subject); }
237
+		if(!empty($_subject))
238
+		{
239
+$infos[] = html::bold($_subject); }
214 240
 		return implode($newline,$infos);
215 241
 	}
216 242
 
@@ -219,7 +245,8 @@  discard block
 block discarded – undo
219 245
 	 *
220 246
 	 * @param settings array with keys account_id and new_owner (new_owner is optional)
221 247
 	 */
222
-	public static function deleteaccount($settings) {
248
+	public static function deleteaccount($settings)
249
+	{
223 250
 		$GLOBALS['egw']->db->delete( self::_notification_table, array(
224 251
 			'account_id'	=> $settings['account_id']
225 252
 		),__LINE__,__FILE__,self::_appname);
Please login to merge, or discard this patch.
notifications/inc/class.notifications_ajax.inc.php 2 patches
Braces   +21 added lines, -10 removed lines patch added patch discarded remove patch
@@ -15,7 +15,8 @@  discard block
 block discarded – undo
15 15
 /**
16 16
  * Ajax methods for notifications
17 17
  */
18
-class notifications_ajax {
18
+class notifications_ajax
19
+{
19 20
 	/**
20 21
 	 * Appname
21 22
 	 */
@@ -91,7 +92,8 @@  discard block
 block discarded – undo
91 92
 	 * constructor
92 93
 	 *
93 94
 	 */
94
-	public function __construct() {
95
+	public function __construct()
96
+	{
95 97
 		$this->response = Api\Json\Response::get();
96 98
 		$this->recipient = (object)$GLOBALS['egw']->accounts->read($GLOBALS['egw_info']['user']['account_id']);
97 99
 
@@ -153,15 +155,18 @@  discard block
 block discarded – undo
153 155
 	 *
154 156
 	 * @return boolean true or false
155 157
 	 */
156
-	private function get_egwpopup($browserNotify = false) {
158
+	private function get_egwpopup($browserNotify = false)
159
+	{
157 160
 		$message = '';
158 161
 		$rs = $this->db->select(self::_notification_table, '*', array(
159 162
 				'account_id' => $this->recipient->account_id,
160 163
 				'notify_type' => self::_type
161 164
 			),
162 165
 			__LINE__,__FILE__,false,'',self::_appname);
163
-		if ($rs->NumRows() > 0)	{
164
-			foreach ($rs as $notification) {
166
+		if ($rs->NumRows() > 0)
167
+		{
168
+			foreach ($rs as $notification)
169
+			{
165 170
 				$message = null;
166 171
 				if($browserNotify)
167 172
 				{
@@ -179,7 +184,8 @@  discard block
 block discarded – undo
179 184
 				$this->response->apply('app.notifications.append',array($notification['notify_id'],$notification['notify_message'],$message3));
180 185
 			}
181 186
 
182
-			switch($this->preferences[self::_appname]['egwpopup_verbosity']) {
187
+			switch($this->preferences[self::_appname]['egwpopup_verbosity'])
188
+			{
183 189
 				case 'low':
184 190
 					$this->response->apply('app.notifications.bell', array('active'));
185 191
 					break;
@@ -201,11 +207,15 @@  discard block
 block discarded – undo
201 207
 	 *
202 208
 	 * @return boolean true
203 209
 	 */
204
-	private function restore_session_data() {
210
+	private function restore_session_data()
211
+	{
205 212
 		$session_data = $GLOBALS['egw']->session->appsession('session_data',self::_appname);
206
-		if(is_array($session_data)) {
213
+		if(is_array($session_data))
214
+		{
207 215
 			$this->session_data = $session_data;
208
-		} else {
216
+		}
217
+		else
218
+		{
209 219
 			$this->session_data = $this->session_data_defaults;
210 220
 		}
211 221
 
@@ -217,7 +227,8 @@  discard block
 block discarded – undo
217 227
 	 *
218 228
 	 * @return boolean true
219 229
 	 */
220
-	private function save_session_data() {
230
+	private function save_session_data()
231
+	{
221 232
 		$GLOBALS['egw']->session->appsession('session_data',self::_appname,$this->session_data);
222 233
 		return true;
223 234
 	}
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -138,11 +138,11 @@  discard block
 block discarded – undo
138 138
 	{
139 139
 		if ($notify_id)
140 140
 		{
141
-			$this->db->delete(self::_notification_table,array(
141
+			$this->db->delete(self::_notification_table, array(
142 142
 				'notify_id' => $notify_id,
143 143
 				'account_id' => $this->recipient->account_id,
144 144
 				'notify_type' => self::_type
145
-			),__LINE__,__FILE__,self::_appname);
145
+			), __LINE__, __FILE__, self::_appname);
146 146
 		}
147 147
 	}
148 148
 
@@ -157,27 +157,27 @@  discard block
 block discarded – undo
157 157
 				'account_id' => $this->recipient->account_id,
158 158
 				'notify_type' => self::_type
159 159
 			),
160
-			__LINE__,__FILE__,false,'',self::_appname);
161
-		if ($rs->NumRows() > 0)	{
160
+			__LINE__, __FILE__, false, '', self::_appname);
161
+		if ($rs->NumRows() > 0) {
162 162
 			foreach ($rs as $notification) {
163 163
 				$message = null;
164
-				if($browserNotify)
164
+				if ($browserNotify)
165 165
 				{
166 166
 					$message = $notification['notify_message'];
167 167
 
168 168
 					// Check for a link - doesn't work in notification
169
-					if(strpos($message, lang('Linked entries:')))
169
+					if (strpos($message, lang('Linked entries:')))
170 170
 					{
171 171
 						$message = substr_replace($message, '', strpos($message, lang('Linked entries:')));
172 172
 					}
173
-					$message = preg_replace('#</?a[^>]*>#is','',$message);
173
+					$message = preg_replace('#</?a[^>]*>#is', '', $message);
174 174
 
175
-					$message = 'data:text/html;charset=' . translation::charset() .';base64,'.base64_encode($message);
175
+					$message = 'data:text/html;charset='.translation::charset().';base64,'.base64_encode($message);
176 176
 				}
177
-				$this->response->apply('app.notifications.append',array($notification['notify_id'],$notification['notify_message'],$message));
177
+				$this->response->apply('app.notifications.append', array($notification['notify_id'], $notification['notify_message'], $message));
178 178
 			}
179 179
 
180
-			switch($this->preferences[self::_appname]['egwpopup_verbosity']) {
180
+			switch ($this->preferences[self::_appname]['egwpopup_verbosity']) {
181 181
 				case 'low':
182 182
 					$this->response->apply('app.notifications.bell', array('active'));
183 183
 					break;
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
 	 * @return boolean true
201 201
 	 */
202 202
 	private function restore_session_data() {
203
-		$session_data = $GLOBALS['egw']->session->appsession('session_data',self::_appname);
204
-		if(is_array($session_data)) {
203
+		$session_data = $GLOBALS['egw']->session->appsession('session_data', self::_appname);
204
+		if (is_array($session_data)) {
205 205
 			$this->session_data = $session_data;
206 206
 		} else {
207 207
 			$this->session_data = $this->session_data_defaults;
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 	 * @return boolean true
217 217
 	 */
218 218
 	private function save_session_data() {
219
-		$GLOBALS['egw']->session->appsession('session_data',self::_appname,$this->session_data);
219
+		$GLOBALS['egw']->session->appsession('session_data', self::_appname, $this->session_data);
220 220
 		return true;
221 221
 	}
222 222
 }
Please login to merge, or discard this patch.
mail/inc/class.mail_hooks.inc.php 4 patches
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 		if (isset($GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID']))
374 374
 			$profileID = (int)$GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'];
375 375
 
376
-		$file = Array(
376
+		$file = array(
377 377
 			'Site Configuration' => Egw::link('/index.php',array('menuaction'=>'admin.uiconfig.index','appname'=>'mail')),
378 378
 		);
379 379
 		display_section($appname,$title,$file);
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
 
466 466
 		if ($GLOBALS['egw_info']['user']['apps']['admin'] && !Api\Header\UserAgent::mobile())
467 467
 		{
468
-			$file = Array(
468
+			$file = array(
469 469
 				'Site Configuration' => Egw::link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname),
470 470
 			);
471 471
 			display_sidebox($appname,lang('Admin'),$file);
Please login to merge, or discard this patch.
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -65,14 +65,14 @@  discard block
 block discarded – undo
65 65
 	}
66 66
 
67 67
 	/**
68
-     * Hook called by link-class to include mail in the appregistry of the linkage
69
-     *
70
-     * @param array/string $location location and other parameters (not used)
71
-     * @return array with method-names
72
-     */
73
-    static function search_link($location)
74
-    {
75
-        return array(
68
+	 * Hook called by link-class to include mail in the appregistry of the linkage
69
+	 *
70
+	 * @param array/string $location location and other parameters (not used)
71
+	 * @return array with method-names
72
+	 */
73
+	static function search_link($location)
74
+	{
75
+		return array(
76 76
 			'view'  => array(
77 77
 				'menuaction' => 'mail.mail_ui.displayMessage',
78 78
 			),
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
 			),
102 102
 			'entry' => 'Mail',
103 103
 			'entries' => 'Mails',
104
-        );
105
-    }
104
+		);
105
+	}
106 106
 
107 107
 	/**
108 108
 	 * Settings hook
@@ -239,10 +239,10 @@  discard block
 block discarded – undo
239 239
 		);
240 240
 
241 241
 		$templateOptions = array_merge(
242
-		    array(
243
-		        'none' => lang("Don't use template folder")
244
-		    ),
245
-		    $folderList
242
+			array(
243
+				'none' => lang("Don't use template folder")
244
+			),
245
+			$folderList
246 246
 		);
247 247
 
248 248
 		// modify folderlist, add a none entry, to be able to force the regarding settings, if no folders apply
Please login to merge, or discard this patch.
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
 			if (true /* ToDo check ACL available */ || $account['acc_imap_type'] == 'managementserver_imap')
34 34
 			{
35
-				$actions[] = array (
35
+				$actions[] = array(
36 36
 					'id' => 'mail_acl',
37 37
 					'caption' => 'Folder ACL',
38 38
 					'icon' => 'lock',
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 			}
48 48
 			if ($account['acc_sieve_enabled'] || $account['acc_imap_type'] == 'managementserver_imap')
49 49
 			{
50
-				$actions[] = array (
50
+				$actions[] = array(
51 51
 					'id' => 'mail_vacation',
52 52
 					'caption' => 'Vacation notice',
53 53
 					'icon' => 'mail/navbar',
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 			'0' => lang('no'),
141 141
 			'1' => lang('yes')
142 142
 		);
143
-		$no_yes_copy = array_merge($no_yes,array('2'=>lang('yes, offer copy option')));
143
+		$no_yes_copy = array_merge($no_yes, array('2'=>lang('yes, offer copy option')));
144 144
 
145 145
  		$prefAllowManageFolders = $no_yes;
146 146
 
@@ -161,12 +161,12 @@  discard block
 block discarded – undo
161 161
 
162 162
 		$trustServersUnseenOptions = array_merge(
163 163
 			$no_yes,
164
-			array('2' => lang('yes') . ' - ' . lang('but check shared folders'))
164
+			array('2' => lang('yes').' - '.lang('but check shared folders'))
165 165
 		);
166 166
 
167 167
 		$selectOptions = array_merge(
168 168
 			$no_yes,
169
-			array('2' => lang('yes') . ' - ' . lang('small view'))
169
+			array('2' => lang('yes').' - '.lang('small view'))
170 170
  		);
171 171
 		$newWindowOptions = array(
172 172
 			'1' => lang('only one window'),
@@ -206,12 +206,12 @@  discard block
 block discarded – undo
206 206
 			'always_display'	=> lang('always show html emails'),
207 207
 		);
208 208
 		$toggle = false;
209
-		if ($GLOBALS['egw_info']['user']['preferences']['common']['select_mode'] == 'EGW_SELECTMODE_TOGGLE') $toggle=true;
209
+		if ($GLOBALS['egw_info']['user']['preferences']['common']['select_mode'] == 'EGW_SELECTMODE_TOGGLE') $toggle = true;
210 210
 		$rowOrderStyle = array(
211 211
 			'mail'	=> lang('mail'),
212 212
 			'outlook'	=> 'Outlook',
213
-			'mail_wCB' => lang('mail').' '.($toggle?lang('(select mails by clicking on the line, like a checkbox)'):lang('(with checkbox enforced)')),
214
-			'outlook_wCB'	=> 'Outlook'.' '.($toggle?lang('(select mails by clicking on the line, like a checkbox)'):lang('(with checkbox enforced)')),
213
+			'mail_wCB' => lang('mail').' '.($toggle ? lang('(select mails by clicking on the line, like a checkbox)') : lang('(with checkbox enforced)')),
214
+			'outlook_wCB'	=> 'Outlook'.' '.($toggle ? lang('(select mails by clicking on the line, like a checkbox)') : lang('(with checkbox enforced)')),
215 215
 		);
216 216
 
217 217
 		// otherwise we get warnings during setup
@@ -439,9 +439,9 @@  discard block
 block discarded – undo
439 439
 			$profileID = (int)$GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'];
440 440
 
441 441
 		$file = Array(
442
-			'Site Configuration' => egw::link('/index.php',array('menuaction'=>'admin.uiconfig.index','appname'=>'mail')),
442
+			'Site Configuration' => egw::link('/index.php', array('menuaction'=>'admin.uiconfig.index', 'appname'=>'mail')),
443 443
 		);
444
-		display_section($appname,$title,$file);
444
+		display_section($appname, $title, $file);
445 445
 	}
446 446
 
447 447
 	/**
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 		// always show the side bar
456 456
 		unset($GLOBALS['egw_info']['user']['preferences']['common']['auto_hide_sidebox']);
457 457
 		$appname = 'mail';
458
-		$menu_title = $GLOBALS['egw_info']['apps'][$appname]['title'] . ' '. lang('Menu');
458
+		$menu_title = $GLOBALS['egw_info']['apps'][$appname]['title'].' '.lang('Menu');
459 459
 /*
460 460
 		$file = array();
461 461
 		$profileID = 0;
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 			}
491 491
 		}
492 492
 */
493
-		$file=array();
493
+		$file = array();
494 494
 		// Destination div for folder tree
495 495
 		$file[] = array(
496 496
 			'no_lang' => true,
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 		);
511 511
 
512 512
 		$file += array(
513
-			'import message' => "javascript:egw_openWindowCentered2('".egw::link('/index.php', $linkData,false)."','importMessageDialog',600,100,'no','$appname');",
513
+			'import message' => "javascript:egw_openWindowCentered2('".egw::link('/index.php', $linkData, false)."','importMessageDialog',600,100,'no','$appname');",
514 514
 		);
515 515
 
516 516
 
@@ -518,20 +518,20 @@  discard block
 block discarded – undo
518 518
 		if (self::access('createaccount'))
519 519
 		{
520 520
 			$file += array(
521
-				'create new account' => "javascript:egw_openWindowCentered2('" .
521
+				'create new account' => "javascript:egw_openWindowCentered2('".
522 522
 					egw::link('/index.php', array('menuaction' => 'mail.mail_wizard.add'), '').
523 523
 					"','_blank',640,480,'yes')",
524 524
 			);
525 525
 		}
526 526
 		// display them all
527
-		display_sidebox($appname,$menu_title,$file);
527
+		display_sidebox($appname, $menu_title, $file);
528 528
 
529 529
 		if ($GLOBALS['egw_info']['user']['apps']['admin'])
530 530
 		{
531 531
 			$file = Array(
532
-				'Site Configuration' => egw::link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname),
532
+				'Site Configuration' => egw::link('/index.php', 'menuaction=admin.uiconfig.index&appname='.$appname),
533 533
 			);
534
-			display_sidebox($appname,lang('Admin'),$file);
534
+			display_sidebox($appname, lang('Admin'), $file);
535 535
 		}
536 536
 	}
537 537
 
@@ -543,31 +543,31 @@  discard block
 block discarded – undo
543 543
 	static function notification_check_mailbox()
544 544
 	{
545 545
 		// should not run more often then every 3 minutes;
546
-		$lastRun = egw_cache::getCache(egw_cache::INSTANCE,'email','mailNotifyLastRun'.trim($GLOBALS['egw_info']['user']['account_id']),null,array(),$expiration=60*60*24*2);
546
+		$lastRun = egw_cache::getCache(egw_cache::INSTANCE, 'email', 'mailNotifyLastRun'.trim($GLOBALS['egw_info']['user']['account_id']), null, array(), $expiration = 60 * 60 * 24 * 2);
547 547
 		$currentTime = time();
548
-		if (!empty($lastRun) && $lastRun>$currentTime-3*60)
548
+		if (!empty($lastRun) && $lastRun > $currentTime - 3 * 60)
549 549
 		{
550 550
 			//error_log(__METHOD__.__LINE__." Job should not run too often; we limit this to once every 3 Minutes :". ($currentTime-$lastRun). " Seconds to go!");
551 551
 			return true;
552 552
 		}
553
-		$accountsToSearchObj = emailadmin_account::search($only_current_user=true, $just_name=true);
553
+		$accountsToSearchObj = emailadmin_account::search($only_current_user = true, $just_name = true);
554 554
 
555
-		foreach($accountsToSearchObj as $acc_id => $identity_name)
555
+		foreach ($accountsToSearchObj as $acc_id => $identity_name)
556 556
 		{
557 557
 			//error_log(__METHOD__.__LINE__.' '.$acc_id.':'.$identity_name);
558
-			$folders2notify[$acc_id] = emailadmin_notifications::read($acc_id);// read all, even those set for acc_id 0 (folders for all acounts?)
559
-			$accountsToSearchArray[$acc_id] = str_replace(array('<','>'),array('[',']'),$identity_name);
558
+			$folders2notify[$acc_id] = emailadmin_notifications::read($acc_id); // read all, even those set for acc_id 0 (folders for all acounts?)
559
+			$accountsToSearchArray[$acc_id] = str_replace(array('<', '>'), array('[', ']'), $identity_name);
560 560
 		}
561
-		$notified_mail_uidsCache = egw_cache::getCache(egw_cache::INSTANCE,'email','notified_mail_uids'.trim($GLOBALS['egw_info']['user']['account_id']),null,array(),$expiration=60*60*24*2);
561
+		$notified_mail_uidsCache = egw_cache::getCache(egw_cache::INSTANCE, 'email', 'notified_mail_uids'.trim($GLOBALS['egw_info']['user']['account_id']), null, array(), $expiration = 60 * 60 * 24 * 2);
562 562
 		//error_log(__METHOD__.__LINE__.array2string($notified_mail_uidsCache));
563 563
 		if (!is_array($folders2notify)) return true;
564 564
 		foreach ($folders2notify as $nFKey =>$notifyfolders)
565 565
 		{
566 566
 			try
567 567
 			{
568
-				$currentRecipient = (object)$GLOBALS['egw']->accounts->read(($notifyfolders['notify_account_id']?$notifyfolders['notify_account_id']:$GLOBALS['egw_info']['user']['account_id']));
568
+				$currentRecipient = (object)$GLOBALS['egw']->accounts->read(($notifyfolders['notify_account_id'] ? $notifyfolders['notify_account_id'] : $GLOBALS['egw_info']['user']['account_id']));
569 569
 				$notify_folders = $notifyfolders['notify_folders'];
570
-				if(count($notify_folders) == 0) {
570
+				if (count($notify_folders) == 0) {
571 571
 					continue; //no folders configured for notifying
572 572
 				}
573 573
 				//error_log(__METHOD__.__LINE__.' '.$nFKey.' =>'.array2string($notifyfolders));
@@ -575,14 +575,14 @@  discard block
 block discarded – undo
575 575
 				//error_log(__METHOD__.__LINE__.' (user: '.$currentRecipient->account_lid.') Active Profile:'.$activeProfile);
576 576
 				try
577 577
 				{
578
-					$bomail = mail_bo::getInstance(false, $activeProfile,false);
578
+					$bomail = mail_bo::getInstance(false, $activeProfile, false);
579 579
 				} catch (Exception $e)
580 580
 				{
581 581
 					error_log(__METHOD__.__LINE__.' (user: '.$currentRecipient->account_lid.') notification for Profile:'.$activeProfile.' failed.'.$e->getMessage());
582 582
 					continue; //fail silently
583 583
 				}
584 584
 				//error_log(__METHOD__.__LINE__.' '.$nFKey.' =>'.array2string($bomail->icServer->params));
585
-				$icServerParams=$bomail->icServer->params;
585
+				$icServerParams = $bomail->icServer->params;
586 586
 				if (empty($icServerParams['acc_imap_host']))
587 587
 				{
588 588
 					error_log(__METHOD__.__LINE__.' (user: '.$currentRecipient->account_lid.') notification for Profile:'.$activeProfile.' failed: NO IMAP HOST configured!');
@@ -603,42 +603,42 @@  discard block
 block discarded – undo
603 603
 				//$notified_mail_uidsCache = array();
604 604
 				$recent_messages = array();
605 605
 				$folder_status = array();
606
-				foreach($notify_folders as $id=>$notify_folder) {
606
+				foreach ($notify_folders as $id=>$notify_folder) {
607 607
 					if (empty($notify_folder)) continue;
608
-					if(!is_array($notified_mail_uidsCache[$activeProfile][$notify_folder])) {
608
+					if (!is_array($notified_mail_uidsCache[$activeProfile][$notify_folder])) {
609 609
 						$notified_mail_uidsCache[$activeProfile][$notify_folder] = array();
610 610
 					}
611 611
 					$folder_status[$notify_folder] = $bomail->getFolderStatus($notify_folder);
612 612
 					$cutoffdate = time();
613
-					$cutoffdate = $cutoffdate - (60*60*24*14); // last 14 days
614
-					$_filter = array('status'=>array('UNSEEN','UNDELETED'),'type'=>"SINCE",'string'=> date("d-M-Y", $cutoffdate));
613
+					$cutoffdate = $cutoffdate - (60 * 60 * 24 * 14); // last 14 days
614
+					$_filter = array('status'=>array('UNSEEN', 'UNDELETED'), 'type'=>"SINCE", 'string'=> date("d-M-Y", $cutoffdate));
615 615
 					//error_log(__METHOD__.__LINE__.' (user: '.$currentRecipient->account_lid.') Mailbox:'.$notify_folder.' filter:'.array2string($_filter));
616 616
 					// $_folderName, $_startMessage, $_numberOfMessages, $_sort, $_reverse, $_filter, $_thisUIDOnly=null, $_cacheResult=true
617
-					$headers = $bomail->getHeaders($notify_folder, 1, 999, 0, true, $_filter,null,false);
618
-					if(is_array($headers['header']) && count($headers['header']) > 0) {
619
-						foreach($headers['header'] as $id=>$header) {
617
+					$headers = $bomail->getHeaders($notify_folder, 1, 999, 0, true, $_filter, null, false);
618
+					if (is_array($headers['header']) && count($headers['header']) > 0) {
619
+						foreach ($headers['header'] as $id=>$header) {
620 620
 							//error_log(__METHOD__.__LINE__.' Found Message:'.$header['uid'].' Subject:'.$header['subject']);
621 621
 							// check if unseen mail has already been notified
622
-							$headerrowid = mail_ui::generateRowID($activeProfile, $notify_folder, $header['uid'], $_prependApp=false);
623
-						 	if(!in_array($headerrowid, $notified_mail_uidsCache[$activeProfile][$notify_folder])) {
622
+							$headerrowid = mail_ui::generateRowID($activeProfile, $notify_folder, $header['uid'], $_prependApp = false);
623
+						 	if (!in_array($headerrowid, $notified_mail_uidsCache[$activeProfile][$notify_folder])) {
624 624
 						 		// got a REAL recent message
625 625
 						 		$header['folder'] = $notify_folder;
626 626
 						 		$header['folder_display_name'] = $folder_status[$notify_folder]['displayName'];
627
-						 		$header['folder_base64'] =  base64_encode($notify_folder);
627
+						 		$header['folder_base64'] = base64_encode($notify_folder);
628 628
 						 		$recent_messages[] = $header;
629 629
 						 	}
630 630
 						}
631 631
 					}
632 632
 				}
633 633
 				//error_log(__METHOD__.__LINE__.' Found Messages for Profile'.$activeProfile.':'.array2string($recent_messages).'<->'.array2string($notified_mail_uidsCache[$activeProfile]));
634
-				if(count($recent_messages) > 0) {
634
+				if (count($recent_messages) > 0) {
635 635
 					// create notify message
636 636
 					$notification_subject = lang("You've got new mail").':'.$accountsToSearchArray[$activeProfile];
637 637
 					$values = array();
638 638
 					$values[] = array(); // content array starts at index 1
639
-					foreach($recent_messages as $id=>$recent_message) {
639
+					foreach ($recent_messages as $id=>$recent_message) {
640 640
 						//error_log(__METHOD__.__LINE__.' Found Message for Profile '.$activeProfile.':'.array2string($recent_message));
641
-						$values[] =	array(
641
+						$values[] = array(
642 642
 							'mail_uid'				=> $recent_message['uid'],
643 643
 							'mail_folder' 			=> $recent_message['folder_display_name'],
644 644
 							'mail_folder_base64' 	=> $recent_message['folder_base64'],
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
 							'mail_received'			=> $recent_message['date'],
648 648
 						);
649 649
 						// save notification status
650
-						$notified_mail_uidsCache[$activeProfile][$recent_message['folder']][] = mail_ui::generateRowID($activeProfile, $recent_message['folder'], $recent_message['uid'], $_prependApp=false);
650
+						$notified_mail_uidsCache[$activeProfile][$recent_message['folder']][] = mail_ui::generateRowID($activeProfile, $recent_message['folder'], $recent_message['uid'], $_prependApp = false);
651 651
 					}
652 652
 					// create etemplate
653 653
 					$tpl = new etemplate('mail.checkmailbox');
@@ -663,13 +663,13 @@  discard block
 block discarded – undo
663 663
 					$notification->set_skip_backends(array('email'));
664 664
 					$notification->send();
665 665
 				}
666
-				egw_cache::setCache(egw_cache::INSTANCE,'email','notified_mail_uids'.trim($GLOBALS['egw_info']['user']['account_id']),$notified_mail_uidsCache, $expiration=60*60*24*2);
666
+				egw_cache::setCache(egw_cache::INSTANCE, 'email', 'notified_mail_uids'.trim($GLOBALS['egw_info']['user']['account_id']), $notified_mail_uidsCache, $expiration = 60 * 60 * 24 * 2);
667 667
 			} catch (Exception $e) {
668 668
 				// fail silently per server, if possible
669 669
 				error_log(__METHOD__.__LINE__.' Notification on new messages for Profile '.$activeProfile.' ('.$accountsToSearchArray[$activeProfile].') failed:'.$e->getMessage());
670 670
 			}
671 671
 		}
672
-		egw_cache::setCache(egw_cache::INSTANCE,'email','mailNotifyLastRun'.trim($GLOBALS['egw_info']['user']['account_id']),time(), $expiration=60*60*24*2);
672
+		egw_cache::setCache(egw_cache::INSTANCE, 'email', 'mailNotifyLastRun'.trim($GLOBALS['egw_info']['user']['account_id']), time(), $expiration = 60 * 60 * 24 * 2);
673 673
 		//error_log(__METHOD__.__LINE__.array2string($notified_mail_uidsCache));
674 674
 		return true;
675 675
 	}
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
 	{
686 686
 		if (substr($name, 0, 5) != 'deny_')
687 687
 		{
688
-			if ($name == 'edit_user') return;	// to ease upgrade, as hook is removed
688
+			if ($name == 'edit_user') return; // to ease upgrade, as hook is removed
689 689
 			throw new egw_exception_wrong_parameter("No method $name!");
690 690
 		}
691 691
 		$accountsel = new uiaccountsel();
@@ -705,21 +705,21 @@  discard block
 block discarded – undo
705 705
 	 */
706 706
 	public static function access($feature)
707 707
 	{
708
-		static $config=null;
708
+		static $config = null;
709 709
 		if ($GLOBALS['egw_info']['user']['apps']['admin'] || $GLOBALS['egw_info']['user']['apps']['emailadmin'])
710 710
 		{
711
-			return true;	// allways give admins or emailadmins all rights, even if they are in a denied group
711
+			return true; // allways give admins or emailadmins all rights, even if they are in a denied group
712 712
 		}
713 713
 		if (!isset($config)) $config = (array)config::read('mail');
714 714
 		//error_log(__METHOD__.__LINE__.' '.$feature.':'.array2string($config['deny_'.$feature]));
715 715
 		if (!empty($config['deny_'.$feature]))
716 716
 		{
717 717
 			//error_log(__METHOD__.__LINE__.' feature:'.$feature.':'.array2string($config['deny_'.$feature]));
718
-			$denied_groups = (is_array($config['deny_'.$feature])?$config['deny_'.$feature]:explode(',', $config['deny_'.$feature]));
718
+			$denied_groups = (is_array($config['deny_'.$feature]) ? $config['deny_'.$feature] : explode(',', $config['deny_'.$feature]));
719 719
 			//error_log(__METHOD__.__LINE__.array2string($GLOBALS['egw']->accounts->memberships($GLOBALS['egw_info']['user']['account_id'], true)));
720 720
 			//error_log(__METHOD__.__LINE__.array2string(array_intersect($denied_groups, $GLOBALS['egw']->accounts->memberships($GLOBALS['egw_info']['user']['account_id'], true))));
721 721
 			// since access asks positively, the stored deny_$feature must return false if we find the denied group in the users membership-list
722
-			return (array_intersect($denied_groups, $GLOBALS['egw']->accounts->memberships($GLOBALS['egw_info']['user']['account_id'], true))?false:true);
722
+			return (array_intersect($denied_groups, $GLOBALS['egw']->accounts->memberships($GLOBALS['egw_info']['user']['account_id'], true)) ? false : true);
723 723
 		}
724 724
 		return true;
725 725
 	}
Please login to merge, or discard this patch.
Braces   +65 added lines, -22 removed lines patch added patch discarded remove patch
@@ -112,13 +112,18 @@  discard block
 block discarded – undo
112 112
 	static function settings($hook_data)
113 113
 	{
114 114
 		unset($GLOBALS['egw_info']['user']['preferences']['common']['auto_hide_sidebox']);
115
-		if (!$hook_data['setup'])	// does not work on setup time
115
+		if (!$hook_data['setup'])
116
+		{
117
+			// does not work on setup time
116 118
 		{
117 119
 			$folderList = array();
120
+		}
118 121
 
119 122
 			$profileID = 0;
120 123
 			if (isset($GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID']))
121
-				$profileID = (int)$GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'];
124
+			{
125
+							$profileID = (int)$GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'];
126
+			}
122 127
 
123 128
 			$mailConfig = config::read('mail');
124 129
 		}
@@ -206,7 +211,10 @@  discard block
 block discarded – undo
206 211
 			'always_display'	=> lang('always show html emails'),
207 212
 		);
208 213
 		$toggle = false;
209
-		if ($GLOBALS['egw_info']['user']['preferences']['common']['select_mode'] == 'EGW_SELECTMODE_TOGGLE') $toggle=true;
214
+		if ($GLOBALS['egw_info']['user']['preferences']['common']['select_mode'] == 'EGW_SELECTMODE_TOGGLE')
215
+		{
216
+			$toggle=true;
217
+		}
210 218
 		$rowOrderStyle = array(
211 219
 			'mail'	=> lang('mail'),
212 220
 			'outlook'	=> 'Outlook',
@@ -215,7 +223,10 @@  discard block
 block discarded – undo
215 223
 		);
216 224
 
217 225
 		// otherwise we get warnings during setup
218
-		if (!is_array($folderList)) $folderList = array();
226
+		if (!is_array($folderList))
227
+		{
228
+			$folderList = array();
229
+		}
219 230
 
220 231
 		$trashOptions = array_merge(
221 232
 			array(
@@ -420,7 +431,10 @@  discard block
 block discarded – undo
420 431
 				'default' => '0'
421 432
 			),
422 433
 		);
423
-		if (!$GLOBALS['egw_info']['apps']['stylite']) unset($settingsArray['attachVCardAtCompose']);
434
+		if (!$GLOBALS['egw_info']['apps']['stylite'])
435
+		{
436
+			unset($settingsArray['attachVCardAtCompose']);
437
+		}
424 438
 		return $settingsArray;
425 439
 	}
426 440
 
@@ -436,7 +450,9 @@  discard block
 block discarded – undo
436 450
 		$title = $appname = 'mail';
437 451
 		$profileID = 0;
438 452
 		if (isset($GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID']))
439
-			$profileID = (int)$GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'];
453
+		{
454
+					$profileID = (int)$GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'];
455
+		}
440 456
 
441 457
 		$file = Array(
442 458
 			'Site Configuration' => egw::link('/index.php',array('menuaction'=>'admin.uiconfig.index','appname'=>'mail')),
@@ -560,14 +576,18 @@  discard block
 block discarded – undo
560 576
 		}
561 577
 		$notified_mail_uidsCache = egw_cache::getCache(egw_cache::INSTANCE,'email','notified_mail_uids'.trim($GLOBALS['egw_info']['user']['account_id']),null,array(),$expiration=60*60*24*2);
562 578
 		//error_log(__METHOD__.__LINE__.array2string($notified_mail_uidsCache));
563
-		if (!is_array($folders2notify)) return true;
579
+		if (!is_array($folders2notify))
580
+		{
581
+			return true;
582
+		}
564 583
 		foreach ($folders2notify as $nFKey =>$notifyfolders)
565 584
 		{
566 585
 			try
567 586
 			{
568 587
 				$currentRecipient = (object)$GLOBALS['egw']->accounts->read(($notifyfolders['notify_account_id']?$notifyfolders['notify_account_id']:$GLOBALS['egw_info']['user']['account_id']));
569 588
 				$notify_folders = $notifyfolders['notify_folders'];
570
-				if(count($notify_folders) == 0) {
589
+				if(count($notify_folders) == 0)
590
+				{
571 591
 					continue; //no folders configured for notifying
572 592
 				}
573 593
 				//error_log(__METHOD__.__LINE__.' '.$nFKey.' =>'.array2string($notifyfolders));
@@ -576,7 +596,8 @@  discard block
 block discarded – undo
576 596
 				try
577 597
 				{
578 598
 					$bomail = mail_bo::getInstance(false, $activeProfile,false);
579
-				} catch (Exception $e)
599
+				}
600
+				catch (Exception $e)
580 601
 				{
581 602
 					error_log(__METHOD__.__LINE__.' (user: '.$currentRecipient->account_lid.') notification for Profile:'.$activeProfile.' failed.'.$e->getMessage());
582 603
 					continue; //fail silently
@@ -591,11 +612,15 @@  discard block
 block discarded – undo
591 612
 				try
592 613
 				{
593 614
 					$bomail->openConnection($activeProfile);
594
-				} catch (Exception $e) {
615
+				}
616
+				catch (Exception $e) {
595 617
 					// TODO: This is ugly. Log a bit nicer!
596 618
 					$error = $e->getMessage();
597 619
 					error_log(__METHOD__.__LINE__.' # '.' (user: '.$currentRecipient->account_lid.'): cannot connect to mailbox with Profile:'.$activeProfile.'. Please check your prefs!');
598
-					if (!empty($error)) error_log(__METHOD__.__LINE__.' # '.$error);
620
+					if (!empty($error))
621
+					{
622
+						error_log(__METHOD__.__LINE__.' # '.$error);
623
+					}
599 624
 					error_log(__METHOD__.__LINE__.' # Instance='.$GLOBALS['egw_info']['user']['domain'].', User='.$GLOBALS['egw_info']['user']['account_lid']);
600 625
 					return false; // cannot connect to mailbox
601 626
 				}
@@ -603,9 +628,14 @@  discard block
 block discarded – undo
603 628
 				//$notified_mail_uidsCache = array();
604 629
 				$recent_messages = array();
605 630
 				$folder_status = array();
606
-				foreach($notify_folders as $id=>$notify_folder) {
607
-					if (empty($notify_folder)) continue;
608
-					if(!is_array($notified_mail_uidsCache[$activeProfile][$notify_folder])) {
631
+				foreach($notify_folders as $id=>$notify_folder)
632
+				{
633
+					if (empty($notify_folder))
634
+					{
635
+						continue;
636
+					}
637
+					if(!is_array($notified_mail_uidsCache[$activeProfile][$notify_folder]))
638
+					{
609 639
 						$notified_mail_uidsCache[$activeProfile][$notify_folder] = array();
610 640
 					}
611 641
 					$folder_status[$notify_folder] = $bomail->getFolderStatus($notify_folder);
@@ -615,12 +645,15 @@  discard block
 block discarded – undo
615 645
 					//error_log(__METHOD__.__LINE__.' (user: '.$currentRecipient->account_lid.') Mailbox:'.$notify_folder.' filter:'.array2string($_filter));
616 646
 					// $_folderName, $_startMessage, $_numberOfMessages, $_sort, $_reverse, $_filter, $_thisUIDOnly=null, $_cacheResult=true
617 647
 					$headers = $bomail->getHeaders($notify_folder, 1, 999, 0, true, $_filter,null,false);
618
-					if(is_array($headers['header']) && count($headers['header']) > 0) {
619
-						foreach($headers['header'] as $id=>$header) {
648
+					if(is_array($headers['header']) && count($headers['header']) > 0)
649
+					{
650
+						foreach($headers['header'] as $id=>$header)
651
+						{
620 652
 							//error_log(__METHOD__.__LINE__.' Found Message:'.$header['uid'].' Subject:'.$header['subject']);
621 653
 							// check if unseen mail has already been notified
622 654
 							$headerrowid = mail_ui::generateRowID($activeProfile, $notify_folder, $header['uid'], $_prependApp=false);
623
-						 	if(!in_array($headerrowid, $notified_mail_uidsCache[$activeProfile][$notify_folder])) {
655
+						 	if(!in_array($headerrowid, $notified_mail_uidsCache[$activeProfile][$notify_folder]))
656
+						 	{
624 657
 						 		// got a REAL recent message
625 658
 						 		$header['folder'] = $notify_folder;
626 659
 						 		$header['folder_display_name'] = $folder_status[$notify_folder]['displayName'];
@@ -631,12 +664,14 @@  discard block
 block discarded – undo
631 664
 					}
632 665
 				}
633 666
 				//error_log(__METHOD__.__LINE__.' Found Messages for Profile'.$activeProfile.':'.array2string($recent_messages).'<->'.array2string($notified_mail_uidsCache[$activeProfile]));
634
-				if(count($recent_messages) > 0) {
667
+				if(count($recent_messages) > 0)
668
+				{
635 669
 					// create notify message
636 670
 					$notification_subject = lang("You've got new mail").':'.$accountsToSearchArray[$activeProfile];
637 671
 					$values = array();
638 672
 					$values[] = array(); // content array starts at index 1
639
-					foreach($recent_messages as $id=>$recent_message) {
673
+					foreach($recent_messages as $id=>$recent_message)
674
+					{
640 675
 						//error_log(__METHOD__.__LINE__.' Found Message for Profile '.$activeProfile.':'.array2string($recent_message));
641 676
 						$values[] =	array(
642 677
 							'mail_uid'				=> $recent_message['uid'],
@@ -664,7 +699,8 @@  discard block
 block discarded – undo
664 699
 					$notification->send();
665 700
 				}
666 701
 				egw_cache::setCache(egw_cache::INSTANCE,'email','notified_mail_uids'.trim($GLOBALS['egw_info']['user']['account_id']),$notified_mail_uidsCache, $expiration=60*60*24*2);
667
-			} catch (Exception $e) {
702
+			}
703
+			catch (Exception $e) {
668 704
 				// fail silently per server, if possible
669 705
 				error_log(__METHOD__.__LINE__.' Notification on new messages for Profile '.$activeProfile.' ('.$accountsToSearchArray[$activeProfile].') failed:'.$e->getMessage());
670 706
 			}
@@ -685,7 +721,11 @@  discard block
 block discarded – undo
685 721
 	{
686 722
 		if (substr($name, 0, 5) != 'deny_')
687 723
 		{
688
-			if ($name == 'edit_user') return;	// to ease upgrade, as hook is removed
724
+			if ($name == 'edit_user')
725
+			{
726
+				return;
727
+			}
728
+			// to ease upgrade, as hook is removed
689 729
 			throw new egw_exception_wrong_parameter("No method $name!");
690 730
 		}
691 731
 		$accountsel = new uiaccountsel();
@@ -710,7 +750,10 @@  discard block
 block discarded – undo
710 750
 		{
711 751
 			return true;	// allways give admins or emailadmins all rights, even if they are in a denied group
712 752
 		}
713
-		if (!isset($config)) $config = (array)config::read('mail');
753
+		if (!isset($config))
754
+		{
755
+			$config = (array)config::read('mail');
756
+		}
714 757
 		//error_log(__METHOD__.__LINE__.' '.$feature.':'.array2string($config['deny_'.$feature]));
715 758
 		if (!empty($config['deny_'.$feature]))
716 759
 		{
Please login to merge, or discard this patch.
pixelegg/stylesheet2svg.php 2 patches
Braces   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,18 +10,24 @@
 block discarded – undo
10 10
  * @version $Id$
11 11
  */
12 12
 
13
-if (php_sapi_name() !== 'cli') die("This is a commandline ONLY tool!\n");
13
+if (php_sapi_name() !== 'cli')
14
+{
15
+	die("This is a commandline ONLY tool!\n");
16
+}
14 17
 
15 18
 $args = $_SERVER['argv'];
16 19
 $prog = array_shift($args);
17 20
 
18
-if ($_SERVER['argc'] <= 1 || $prog != 'pixelegg/stylesheet2svg.php') die("
21
+if ($_SERVER['argc'] <= 1 || $prog != 'pixelegg/stylesheet2svg.php')
22
+{
23
+	die("
19 24
 Usage: pixelegg/stylesheet2svg [-s stylesheet|-c color] svg-image(s)
20 25
 Add an external stylesheet to an svg image and sets id of svg tag to app_image
21 26
 Examples:
22 27
 - pixelegg/stylesheet2svg -s pixelegg/less/svg.css */templates/pixelegg/images/*.svg pixelegg/images/*.svg
23 28
 - pixelegg/stylesheet2svg -c '#6e6e6e,#939393' */templates/pixelegg/images/*.svg pixelegg/images/*.svg
24 29
 \n");
30
+}
25 31
 
26 32
 $stylesheet = 'pixelegg/less/svg.css';
27 33
 if ($args[0] == '-s')
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	array_shift($args);
31 31
 }
32 32
 
33
-foreach($args as $path)
33
+foreach ($args as $path)
34 34
 {
35 35
 	if (!preg_match('|^([^/]+)/.*/(.*).svg$|', $path, $matches) || !($svg = file_get_contents($path)))
36 36
 	{
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	array_pop($i_parts);
57 57
 	$rel_parts = $s_parts = explode('/', $stylesheet);
58 58
 
59
-	foreach($i_parts as $n => $i_part)
59
+	foreach ($i_parts as $n => $i_part)
60 60
 	{
61 61
 		if (isset($s_parts[$n]) && $s_parts[$n] === $i_part)
62 62
 		{
Please login to merge, or discard this patch.
resources/setup/tables_update.inc.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -333,7 +333,7 @@
 block discarded – undo
333 333
 	// Give default group all rights to this general cat
334 334
 	$defaultgroup = $GLOBALS['egw_setup']->add_account('Default','Default','Group',False,False);
335 335
 	$GLOBALS['egw_setup']->add_acl('resources','run',$defaultgroup);
336
-	$GLOBALS['egw_setup']->add_acl('resources',"L$locations_cat_id",$defaultgroup,399);
336
+	$GLOBALS['egw_setup']->add_acl('resources',"l$locations_cat_id",$defaultgroup,399);
337 337
 
338 338
 	return $GLOBALS['setup_info']['resources']['currentver'] = '1.9.001';
339 339
 }
Please login to merge, or discard this patch.
Spacing   +111 added lines, -111 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 function resources_upgrade0_0_1_008()
15 15
 {
16
-	$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','picture_src',array(
16
+	$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources', 'picture_src', array(
17 17
 		'type' => 'varchar',
18 18
 		'precision' => '20'
19 19
 	));
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 function resources_upgrade0_0_1_012()
27 27
 {
28
-	$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','picture_thumb',array(
28
+	$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources', 'picture_thumb', array(
29 29
 		'type' => 'blob'
30 30
 	));
31 31
 
@@ -36,49 +36,49 @@  discard block
 block discarded – undo
36 36
 
37 37
 function resources_upgrade0_0_1_013()
38 38
 {
39
-	$GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources',array(
39
+	$GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources', array(
40 40
 		'fd' => array(
41 41
 			'id' => array('type' => 'auto'),
42
-			'name' => array('type' => 'varchar','precision' => '100'),
43
-			'short_description' => array('type' => 'varchar','precision' => '100'),
44
-			'cat_id' => array('type' => 'int','precision' => '11','nullable' => False),
45
-			'quantity' => array('type' => 'int','precision' => '11'),
46
-			'useable' => array('type' => 'int','precision' => '11'),
47
-			'location' => array('type' => 'varchar','precision' => '100'),
48
-			'bookable' => array('type' => 'varchar','precision' => '1'),
49
-			'buyable' => array('type' => 'varchar','precision' => '1'),
50
-			'prize' => array('type' => 'varchar','precision' => '200'),
42
+			'name' => array('type' => 'varchar', 'precision' => '100'),
43
+			'short_description' => array('type' => 'varchar', 'precision' => '100'),
44
+			'cat_id' => array('type' => 'int', 'precision' => '11', 'nullable' => False),
45
+			'quantity' => array('type' => 'int', 'precision' => '11'),
46
+			'useable' => array('type' => 'int', 'precision' => '11'),
47
+			'location' => array('type' => 'varchar', 'precision' => '100'),
48
+			'bookable' => array('type' => 'varchar', 'precision' => '1'),
49
+			'buyable' => array('type' => 'varchar', 'precision' => '1'),
50
+			'prize' => array('type' => 'varchar', 'precision' => '200'),
51 51
 			'long_description' => array('type' => 'longtext'),
52
-			'accessories' => array('type' => 'varchar','precision' => '50'),
53
-			'picture_src' => array('type' => 'varchar','precision' => '20'),
52
+			'accessories' => array('type' => 'varchar', 'precision' => '50'),
53
+			'picture_src' => array('type' => 'varchar', 'precision' => '20'),
54 54
 			'picture_thumb' => array('type' => 'blob')
55 55
 		),
56 56
 		'pk' => array('id'),
57 57
 		'fk' => array(),
58 58
 		'ix' => array(),
59 59
 		'uc' => array()
60
-	),'picture');
61
-	$GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources',array(
60
+	), 'picture');
61
+	$GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources', array(
62 62
 		'fd' => array(
63 63
 			'id' => array('type' => 'auto'),
64
-			'name' => array('type' => 'varchar','precision' => '100'),
65
-			'short_description' => array('type' => 'varchar','precision' => '100'),
66
-			'cat_id' => array('type' => 'int','precision' => '11','nullable' => False),
67
-			'quantity' => array('type' => 'int','precision' => '11'),
68
-			'useable' => array('type' => 'int','precision' => '11'),
69
-			'location' => array('type' => 'varchar','precision' => '100'),
70
-			'bookable' => array('type' => 'varchar','precision' => '1'),
71
-			'buyable' => array('type' => 'varchar','precision' => '1'),
72
-			'prize' => array('type' => 'varchar','precision' => '200'),
64
+			'name' => array('type' => 'varchar', 'precision' => '100'),
65
+			'short_description' => array('type' => 'varchar', 'precision' => '100'),
66
+			'cat_id' => array('type' => 'int', 'precision' => '11', 'nullable' => False),
67
+			'quantity' => array('type' => 'int', 'precision' => '11'),
68
+			'useable' => array('type' => 'int', 'precision' => '11'),
69
+			'location' => array('type' => 'varchar', 'precision' => '100'),
70
+			'bookable' => array('type' => 'varchar', 'precision' => '1'),
71
+			'buyable' => array('type' => 'varchar', 'precision' => '1'),
72
+			'prize' => array('type' => 'varchar', 'precision' => '200'),
73 73
 			'long_description' => array('type' => 'longtext'),
74
-			'accessories' => array('type' => 'varchar','precision' => '50'),
75
-			'picture_src' => array('type' => 'varchar','precision' => '20')
74
+			'accessories' => array('type' => 'varchar', 'precision' => '50'),
75
+			'picture_src' => array('type' => 'varchar', 'precision' => '20')
76 76
 		),
77 77
 		'pk' => array('id'),
78 78
 		'fk' => array(),
79 79
 		'ix' => array(),
80 80
 		'uc' => array()
81
-	),'picture_thumb');
81
+	), 'picture_thumb');
82 82
 
83 83
 	$GLOBALS['setup_info']['resources']['currentver'] = '0.0.1.014';
84 84
 	return $GLOBALS['setup_info']['resources']['currentver'];
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
 
88 88
 function resources_upgrade0_0_1_014()
89 89
 {
90
-	$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','quantity',array(
90
+	$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources', 'quantity', array(
91 91
 		'type' => 'int',
92 92
 		'precision' => '11',
93 93
 		'default' => '1'
94 94
 	));
95
-	$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','useable',array(
95
+	$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources', 'useable', array(
96 96
 		'type' => 'int',
97 97
 		'precision' => '11',
98 98
 		'default' => '1'
@@ -105,16 +105,16 @@  discard block
 block discarded – undo
105 105
 
106 106
 function resources_upgrade0_0_1_015()
107 107
 {
108
-	$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','accessories',array(
108
+	$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources', 'accessories', array(
109 109
 		'type' => 'varchar',
110 110
 		'precision' => '100'
111 111
 	));
112
-	$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','accessory_only',array(
112
+	$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources', 'accessory_only', array(
113 113
 		'type' => 'varchar',
114 114
 		'precision' => '1',
115 115
 		'default' => '0'
116 116
 	));
117
-	$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','relatives',array(
117
+	$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources', 'relatives', array(
118 118
 		'type' => 'varchar',
119 119
 		'precision' => '100'
120 120
 	));
@@ -126,70 +126,70 @@  discard block
 block discarded – undo
126 126
 
127 127
 function resources_upgrade0_0_1_016()
128 128
 {
129
-	$GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources',array(
129
+	$GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources', array(
130 130
 		'fd' => array(
131 131
 			'id' => array('type' => 'auto'),
132
-			'name' => array('type' => 'varchar','precision' => '100'),
133
-			'short_description' => array('type' => 'varchar','precision' => '100'),
134
-			'cat_id' => array('type' => 'int','precision' => '11','nullable' => False),
135
-			'quantity' => array('type' => 'int','precision' => '11','default' => '1'),
136
-			'useable' => array('type' => 'int','precision' => '11','default' => '1'),
137
-			'location' => array('type' => 'varchar','precision' => '100'),
138
-			'bookable' => array('type' => 'varchar','precision' => '1'),
139
-			'buyable' => array('type' => 'varchar','precision' => '1'),
140
-			'prize' => array('type' => 'varchar','precision' => '200'),
132
+			'name' => array('type' => 'varchar', 'precision' => '100'),
133
+			'short_description' => array('type' => 'varchar', 'precision' => '100'),
134
+			'cat_id' => array('type' => 'int', 'precision' => '11', 'nullable' => False),
135
+			'quantity' => array('type' => 'int', 'precision' => '11', 'default' => '1'),
136
+			'useable' => array('type' => 'int', 'precision' => '11', 'default' => '1'),
137
+			'location' => array('type' => 'varchar', 'precision' => '100'),
138
+			'bookable' => array('type' => 'varchar', 'precision' => '1'),
139
+			'buyable' => array('type' => 'varchar', 'precision' => '1'),
140
+			'prize' => array('type' => 'varchar', 'precision' => '200'),
141 141
 			'long_description' => array('type' => 'longtext'),
142
-			'accessories' => array('type' => 'varchar','precision' => '100'),
143
-			'picture_src' => array('type' => 'varchar','precision' => '20'),
144
-			'relatives' => array('type' => 'varchar','precision' => '100')
142
+			'accessories' => array('type' => 'varchar', 'precision' => '100'),
143
+			'picture_src' => array('type' => 'varchar', 'precision' => '20'),
144
+			'relatives' => array('type' => 'varchar', 'precision' => '100')
145 145
 		),
146 146
 		'pk' => array('id'),
147 147
 		'fk' => array(),
148 148
 		'ix' => array(),
149 149
 		'uc' => array()
150
-	),'accessory_only');
151
-	$GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources',array(
150
+	), 'accessory_only');
151
+	$GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources', array(
152 152
 		'fd' => array(
153 153
 			'id' => array('type' => 'auto'),
154
-			'name' => array('type' => 'varchar','precision' => '100'),
155
-			'short_description' => array('type' => 'varchar','precision' => '100'),
156
-			'cat_id' => array('type' => 'int','precision' => '11','nullable' => False),
157
-			'quantity' => array('type' => 'int','precision' => '11','default' => '1'),
158
-			'useable' => array('type' => 'int','precision' => '11','default' => '1'),
159
-			'location' => array('type' => 'varchar','precision' => '100'),
160
-			'bookable' => array('type' => 'varchar','precision' => '1'),
161
-			'buyable' => array('type' => 'varchar','precision' => '1'),
162
-			'prize' => array('type' => 'varchar','precision' => '200'),
154
+			'name' => array('type' => 'varchar', 'precision' => '100'),
155
+			'short_description' => array('type' => 'varchar', 'precision' => '100'),
156
+			'cat_id' => array('type' => 'int', 'precision' => '11', 'nullable' => False),
157
+			'quantity' => array('type' => 'int', 'precision' => '11', 'default' => '1'),
158
+			'useable' => array('type' => 'int', 'precision' => '11', 'default' => '1'),
159
+			'location' => array('type' => 'varchar', 'precision' => '100'),
160
+			'bookable' => array('type' => 'varchar', 'precision' => '1'),
161
+			'buyable' => array('type' => 'varchar', 'precision' => '1'),
162
+			'prize' => array('type' => 'varchar', 'precision' => '200'),
163 163
 			'long_description' => array('type' => 'longtext'),
164
-			'accessories' => array('type' => 'varchar','precision' => '100'),
165
-			'picture_src' => array('type' => 'varchar','precision' => '20')
164
+			'accessories' => array('type' => 'varchar', 'precision' => '100'),
165
+			'picture_src' => array('type' => 'varchar', 'precision' => '20')
166 166
 		),
167 167
 		'pk' => array('id'),
168 168
 		'fk' => array(),
169 169
 		'ix' => array(),
170 170
 		'uc' => array()
171
-	),'relatives');
172
-	$GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources',array(
171
+	), 'relatives');
172
+	$GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources', array(
173 173
 		'fd' => array(
174 174
 			'id' => array('type' => 'auto'),
175
-			'name' => array('type' => 'varchar','precision' => '100'),
176
-			'short_description' => array('type' => 'varchar','precision' => '100'),
177
-			'cat_id' => array('type' => 'int','precision' => '11','nullable' => False),
178
-			'quantity' => array('type' => 'int','precision' => '11','default' => '1'),
179
-			'useable' => array('type' => 'int','precision' => '11','default' => '1'),
180
-			'location' => array('type' => 'varchar','precision' => '100'),
181
-			'bookable' => array('type' => 'varchar','precision' => '1'),
182
-			'buyable' => array('type' => 'varchar','precision' => '1'),
183
-			'prize' => array('type' => 'varchar','precision' => '200'),
175
+			'name' => array('type' => 'varchar', 'precision' => '100'),
176
+			'short_description' => array('type' => 'varchar', 'precision' => '100'),
177
+			'cat_id' => array('type' => 'int', 'precision' => '11', 'nullable' => False),
178
+			'quantity' => array('type' => 'int', 'precision' => '11', 'default' => '1'),
179
+			'useable' => array('type' => 'int', 'precision' => '11', 'default' => '1'),
180
+			'location' => array('type' => 'varchar', 'precision' => '100'),
181
+			'bookable' => array('type' => 'varchar', 'precision' => '1'),
182
+			'buyable' => array('type' => 'varchar', 'precision' => '1'),
183
+			'prize' => array('type' => 'varchar', 'precision' => '200'),
184 184
 			'long_description' => array('type' => 'longtext'),
185
-			'picture_src' => array('type' => 'varchar','precision' => '20')
185
+			'picture_src' => array('type' => 'varchar', 'precision' => '20')
186 186
 		),
187 187
 		'pk' => array('id'),
188 188
 		'fk' => array(),
189 189
 		'ix' => array(),
190 190
 		'uc' => array()
191
-	),'accessories');
192
-	$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','accessory_of',array(
191
+	), 'accessories');
192
+	$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources', 'accessory_of', array(
193 193
 		'type' => 'int',
194 194
 		'precision' => '11',
195 195
 		'default' => '-1'
@@ -201,22 +201,22 @@  discard block
 block discarded – undo
201 201
 
202 202
 function resources_upgrade0_0_1_017()
203 203
 {
204
-	$GLOBALS['phpgw_setup']->oProc->RenameColumn('egw_resources','id','res_id');
205
-	$GLOBALS['phpgw_setup']->oProc->RefreshTable('egw_resources',array(
204
+	$GLOBALS['phpgw_setup']->oProc->RenameColumn('egw_resources', 'id', 'res_id');
205
+	$GLOBALS['phpgw_setup']->oProc->RefreshTable('egw_resources', array(
206 206
 		'fd' => array(
207 207
 			'res_id' => array('type' => 'auto'),
208
-			'name' => array('type' => 'varchar','precision' => '100'),
209
-			'short_description' => array('type' => 'varchar','precision' => '100'),
210
-			'cat_id' => array('type' => 'int','precision' => '11','nullable' => False),
211
-			'quantity' => array('type' => 'int','precision' => '11','default' => '1'),
212
-			'useable' => array('type' => 'int','precision' => '11','default' => '1'),
213
-			'location' => array('type' => 'varchar','precision' => '100'),
214
-			'bookable' => array('type' => 'varchar','precision' => '1'),
215
-			'buyable' => array('type' => 'varchar','precision' => '1'),
216
-			'prize' => array('type' => 'varchar','precision' => '200'),
208
+			'name' => array('type' => 'varchar', 'precision' => '100'),
209
+			'short_description' => array('type' => 'varchar', 'precision' => '100'),
210
+			'cat_id' => array('type' => 'int', 'precision' => '11', 'nullable' => False),
211
+			'quantity' => array('type' => 'int', 'precision' => '11', 'default' => '1'),
212
+			'useable' => array('type' => 'int', 'precision' => '11', 'default' => '1'),
213
+			'location' => array('type' => 'varchar', 'precision' => '100'),
214
+			'bookable' => array('type' => 'varchar', 'precision' => '1'),
215
+			'buyable' => array('type' => 'varchar', 'precision' => '1'),
216
+			'prize' => array('type' => 'varchar', 'precision' => '200'),
217 217
 			'long_description' => array('type' => 'longtext'),
218
-			'picture_src' => array('type' => 'varchar','precision' => '20'),
219
-			'accessory_of' => array('type' => 'int','precision' => '11','default' => '-1')
218
+			'picture_src' => array('type' => 'varchar', 'precision' => '20'),
219
+			'accessory_of' => array('type' => 'int', 'precision' => '11', 'default' => '-1')
220 220
 		),
221 221
 		'pk' => array('res_id'),
222 222
 		'fk' => array(),
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 
232 232
 function resources_upgrade0_0_1_018()
233 233
 {
234
-	$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','storage_info',array(
234
+	$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources', 'storage_info', array(
235 235
 		'type' => 'varchar',
236 236
 		'precision' => '200'
237 237
 	));
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 
244 244
 function resources_upgrade0_0_1_019()
245 245
 {
246
-	$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','inventory_number',array(
246
+	$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources', 'inventory_number', array(
247 247
 		'type' => 'varchar',
248 248
 		'precision' => '20'
249 249
 	));
@@ -255,14 +255,14 @@  discard block
 block discarded – undo
255 255
 
256 256
 function resources_upgrade0_0_1_020()
257 257
 {
258
-	$GLOBALS['egw_setup']->oProc->CreateTable('egw_resources_extra',array(
258
+	$GLOBALS['egw_setup']->oProc->CreateTable('egw_resources_extra', array(
259 259
 		'fd' => array(
260
-			'extra_id' => array('type' => 'int','precision' => '4','nullable' => False),
261
-			'extra_name' => array('type' => 'varchar','precision' => '40','nullable' => False),
262
-			'extra_owner' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '-1'),
263
-			'extra_value' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '')
260
+			'extra_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False),
261
+			'extra_name' => array('type' => 'varchar', 'precision' => '40', 'nullable' => False),
262
+			'extra_owner' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'default' => '-1'),
263
+			'extra_value' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '')
264 264
 		),
265
-		'pk' => array('extra_id','extra_name','extra_owner'),
265
+		'pk' => array('extra_id', 'extra_name', 'extra_owner'),
266 266
 		'fk' => array(),
267 267
 		'ix' => array(),
268 268
 		'uc' => array()
@@ -295,20 +295,20 @@  discard block
 block discarded – undo
295 295
 	egw_vfs::load_wrapper('sqlfs');
296 296
 	if (egw_vfs::is_dir('/resources/pictures'))
297 297
 	{
298
-		egw_vfs::remove('/resources/pictures/thumbs');	// remove thumb dir incl. thumbnails
299
-		foreach(egw_vfs::find('sqlfs://default/resources/pictures',array('url' => true)) as $url)
298
+		egw_vfs::remove('/resources/pictures/thumbs'); // remove thumb dir incl. thumbnails
299
+		foreach (egw_vfs::find('sqlfs://default/resources/pictures', array('url' => true)) as $url)
300 300
 		{
301
-			if (is_numeric($id = basename($url,'.jpg')))
301
+			if (is_numeric($id = basename($url, '.jpg')))
302 302
 			{
303 303
 				if (!egw_vfs::is_dir($dir = "/apps/resources/$id"))
304 304
 				{
305
-					egw_vfs::mkdir($dir,0777,STREAM_MKDIR_RECURSIVE);
305
+					egw_vfs::mkdir($dir, 0777, STREAM_MKDIR_RECURSIVE);
306 306
 				}
307
-				rename($url,'sqlfs://default'.$dir.'/.picture.jpg');	// we need to rename on the same wrapper!
307
+				rename($url, 'sqlfs://default'.$dir.'/.picture.jpg'); // we need to rename on the same wrapper!
308 308
 			}
309 309
 		}
310
-		egw_vfs::rmdir('/resources/pictures',0);
311
-		egw_vfs::rmdir('/resources',0);
310
+		egw_vfs::rmdir('/resources/pictures', 0);
311
+		egw_vfs::rmdir('/resources', 0);
312 312
 	}
313 313
 	return $GLOBALS['setup_info']['resources']['currentver'] = '1.6';
314 314
 }
@@ -323,14 +323,14 @@  discard block
 block discarded – undo
323 323
 function resources_upgrade1_8()
324 324
 {
325 325
 	// add location category required for CalDAV to distinguish between locations and resources
326
-	$GLOBALS['egw_setup']->db->insert($GLOBALS['egw_setup']->cats_table,array('cat_parent' => 0, 'cat_owner' => categories::GLOBAL_ACCOUNT,'cat_access' => 'public','cat_appname' => 'resources','cat_name' => 'Locations','cat_description' => 'This category has been added by setup','last_mod' => time()),false,__LINE__,__FILE__);
327
-	$locations_cat_id = $GLOBALS['egw_setup']->db->get_last_insert_id($GLOBALS['egw_setup']->cats_table,'cat_id');
326
+	$GLOBALS['egw_setup']->db->insert($GLOBALS['egw_setup']->cats_table, array('cat_parent' => 0, 'cat_owner' => categories::GLOBAL_ACCOUNT, 'cat_access' => 'public', 'cat_appname' => 'resources', 'cat_name' => 'Locations', 'cat_description' => 'This category has been added by setup', 'last_mod' => time()), false, __LINE__, __FILE__);
327
+	$locations_cat_id = $GLOBALS['egw_setup']->db->get_last_insert_id($GLOBALS['egw_setup']->cats_table, 'cat_id');
328 328
 	config::save_value('location_cats', $locations_cat_id, 'resources');
329 329
 
330 330
 	// Give default group all rights to this general cat
331
-	$defaultgroup = $GLOBALS['egw_setup']->add_account('Default','Default','Group',False,False);
332
-	$GLOBALS['egw_setup']->add_acl('resources','run',$defaultgroup);
333
-	$GLOBALS['egw_setup']->add_acl('resources',"L$locations_cat_id",$defaultgroup,399);
331
+	$defaultgroup = $GLOBALS['egw_setup']->add_account('Default', 'Default', 'Group', False, False);
332
+	$GLOBALS['egw_setup']->add_acl('resources', 'run', $defaultgroup);
333
+	$GLOBALS['egw_setup']->add_acl('resources', "L$locations_cat_id", $defaultgroup, 399);
334 334
 
335 335
 	return $GLOBALS['setup_info']['resources']['currentver'] = '1.9.001';
336 336
 }
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 
339 339
 function resources_upgrade1_9_001()
340 340
 {
341
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_resources','deleted',array(
341
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_resources', 'deleted', array(
342 342
 		'type' => 'int',
343 343
 		'precision' => '8'
344 344
 	));
@@ -355,22 +355,22 @@  discard block
 block discarded – undo
355 355
 
356 356
 function resources_upgrade1_9_003()
357 357
 {
358
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_resources','res_creator',array(
358
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_resources', 'res_creator', array(
359 359
 		'type' => 'int',
360 360
 		'meta' => 'user',
361 361
 		'precision' => '11'
362 362
 	));
363
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_resources','res_created',array(
363
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_resources', 'res_created', array(
364 364
 		'type' => 'int',
365 365
 		'meta' => 'timestamp',
366 366
 		'precision' => '8'
367 367
 	));
368
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_resources','res_modifier',array(
368
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_resources', 'res_modifier', array(
369 369
 		'type' => 'int',
370 370
 		'meta' => 'user',
371 371
 		'precision' => '11'
372 372
 	));
373
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_resources','res_modified',array(
373
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_resources', 'res_modified', array(
374 374
 		'type' => 'int',
375 375
 		'meta' => 'timestamp',
376 376
 		'precision' => '8'
Please login to merge, or discard this patch.