Completed
Push — 14.2 ( e07840...cec2da )
by Ralf
83:18 queued 52:04
created
redirect.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
 	  "<a href=\"$webserverURL/redirect.php?go=".htmlentities(urlencode('http://www.egroupware.org')).'">'
23 23
 	*/
24 24
 
25
-	if(!function_exists('html_entity_decode'))
25
+	if (!function_exists('html_entity_decode'))
26 26
 	{
27 27
 		function html_entity_decode($given_html, $quote_style = ENT_QUOTES)
28 28
 		{
29
-			$trans_table = array_flip(get_html_translation_table( HTML_SPECIALCHARS, $quote_style));
29
+			$trans_table = array_flip(get_html_translation_table(HTML_SPECIALCHARS, $quote_style));
30 30
 			$trans_table['&#39;'] = "'";
31 31
 			return(strtr($given_html, $trans_table));
32 32
 		}
@@ -45,17 +45,17 @@  discard block
 block discarded – undo
45 45
 
46 46
 	/* Only allow redirects from inside this eGroupware installation. */
47 47
 	$valid_referer = array();
48
-	$path = preg_replace('/\/[^\/]*$/','',$_SERVER['PHP_SELF']) . '/';
48
+	$path = preg_replace('/\/[^\/]*$/', '', $_SERVER['PHP_SELF']).'/';
49 49
 	array_push($valid_referer, $path);
50
-	array_push($valid_referer, ($_SERVER['HTTPS'] ? 'https://' : 'http://') . $_SERVER['SERVER_ADDR'] . $path);
51
-	array_push($valid_referer, ($_SERVER['HTTPS'] ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . $path);
50
+	array_push($valid_referer, ($_SERVER['HTTPS'] ? 'https://' : 'http://').$_SERVER['SERVER_ADDR'].$path);
51
+	array_push($valid_referer, ($_SERVER['HTTPS'] ? 'https://' : 'http://').$_SERVER['SERVER_NAME'].$path);
52 52
 
53 53
 	$referrer = trim($_SERVER['HTTP_REFERER']);
54 54
 	if ((!isset($_SERVER['HTTP_REFERER'])) || (empty($referrer)))
55 55
 	{
56 56
 		echo "Only usable from within eGroupware.\n";
57 57
 	}
58
-	else if($_GET['go'])
58
+	else if ($_GET['go'])
59 59
 	{
60 60
 		$allow = false;
61 61
 		foreach ($valid_referer as $urlRoot)
@@ -69,15 +69,15 @@  discard block
 block discarded – undo
69 69
 		}
70 70
 		if ($allow)
71 71
 		{
72
-			$url= html_entity_decode(urldecode($_GET['go']));
72
+			$url = html_entity_decode(urldecode($_GET['go']));
73 73
 			unset($_GET['go']);
74 74
 			/* Only add "&" if there is something to append. */
75 75
 			if (!empty($_GET))
76 76
 			{
77
-				$url=$url."&".http_build_query($_GET);
77
+				$url = $url."&".http_build_query($_GET);
78 78
 			}
79 79
 
80
-			Header('Location: ' . html_entity_decode(urldecode($url)));
80
+			Header('Location: '.html_entity_decode(urldecode($url)));
81 81
 			exit;
82 82
 		}
83 83
 		else
Please login to merge, or discard this patch.
filemanager/setup/setup.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 	'name'  => 'Ralf Becker',
21 21
 	'email' => '[email protected]'
22 22
 );
23
-$setup_info['filemanager']['license']  = 'GPL';
23
+$setup_info['filemanager']['license'] = 'GPL';
24 24
 
25 25
 /* The hooks this app includes, needed for hooks registration */
26 26
 $setup_info['filemanager']['hooks']['settings'] = 'filemanager_hooks::settings';
Please login to merge, or discard this patch.
filemanager/inc/class.filemanager_hooks.inc.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 		);
106 106
 		if ($location == 'admin')
107 107
 		{
108
-        	display_section(self::$appname,$file);
108
+			display_section(self::$appname,$file);
109 109
 		}
110 110
 		else
111 111
 		{
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 			'yes' => lang('Yes')
129 129
 		);
130 130
 
131
-        $settings = array(
131
+		$settings = array(
132 132
 			'startfolder'	=> array(
133 133
 				'type'		=> 'input',
134 134
 				'name'		=> 'startfolder',
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -34,19 +34,19 @@  discard block
 block discarded – undo
34 34
 		//echo "<p>admin_prefs_sidebox_hooks::all_hooks(".print_r($args,True).") appname='$appname', location='$location'</p>\n";
35 35
 		$config = config::read(self::$appname);
36 36
 		if (!empty($config['max_folderlinks'])) self::$foldercount = (int)$config['max_folderlinks'];
37
-		$file_prefs    = &$GLOBALS['egw_info']['user']['preferences'][self::$appname];
37
+		$file_prefs = &$GLOBALS['egw_info']['user']['preferences'][self::$appname];
38 38
 		if ($location == 'sidebox_menu')
39 39
 		{
40
-			$title = $GLOBALS['egw_info']['apps'][self::$appname]['title'] . ' '. lang('Menu');
40
+			$title = $GLOBALS['egw_info']['apps'][self::$appname]['title'].' '.lang('Menu');
41 41
 			$file = array();
42
-			if($GLOBALS['egw_info']['apps']['stylite'])
42
+			if ($GLOBALS['egw_info']['apps']['stylite'])
43 43
 			{
44 44
 				// add "file a file" (upload) dialog
45 45
 				$file[] = array(
46 46
 					'text' => 'File a file',
47
-					'link' => "javascript:egw_openWindowCentered2('".egw::link('/index.php',array(
47
+					'link' => "javascript:egw_openWindowCentered2('".egw::link('/index.php', array(
48 48
 							'menuaction'=>'stylite.stylite_filemanager.upload',
49
-						),false)."','_blank',550,350)",
49
+						), false)."','_blank',550,350)",
50 50
 					'app'  => 'phpgwapi',
51 51
 					'icon' => 'upload',
52 52
 				);
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
 			// add selection for available views, if we have more then one
55 55
 			if (count(filemanager_ui::init_views()) > 1)
56 56
 			{
57
-				$index_url = egw::link('/index.php',array('menuaction' => 'filemanager.filemanager_ui.index'),false);
57
+				$index_url = egw::link('/index.php', array('menuaction' => 'filemanager.filemanager_ui.index'), false);
58 58
 				$file[] = array(
59
-					'text' => html::select('filemanager_view',filemanager_ui::get_view(),filemanager_ui::$views,false,
59
+					'text' => html::select('filemanager_view', filemanager_ui::get_view(), filemanager_ui::$views, false,
60 60
 						' onchange="'."egw_appWindow('filemanager').location='$index_url&view='+this.value;".
61 61
 						'" style="width: 100%;"'),
62 62
 					'no_lang' => True,
@@ -65,23 +65,23 @@  discard block
 block discarded – undo
65 65
 			}
66 66
 			if ($file_prefs['showhome'] != 'no')
67 67
 			{
68
-				$file['Your home directory'] = egw::link('/index.php',array('menuaction'=>self::$appname.'.filemanager_ui.index','path'=>$homepath,'ajax'=>'true'));
68
+				$file['Your home directory'] = egw::link('/index.php', array('menuaction'=>self::$appname.'.filemanager_ui.index', 'path'=>$homepath, 'ajax'=>'true'));
69 69
 			}
70 70
 			if ($file_prefs['showusers'] != 'no')
71 71
 			{
72
-				$file['Users and groups'] = egw::link('/index.php',array('menuaction'=>self::$appname.'.filemanager_ui.index','path'=>$basepath,'ajax'=>'true'));
72
+				$file['Users and groups'] = egw::link('/index.php', array('menuaction'=>self::$appname.'.filemanager_ui.index', 'path'=>$basepath, 'ajax'=>'true'));
73 73
 			}
74
-			if (!empty($file_prefs['showbase']) && $file_prefs['showbase']=='yes')
74
+			if (!empty($file_prefs['showbase']) && $file_prefs['showbase'] == 'yes')
75 75
 			{
76
-				$file['Basedirectory'] = egw::link('/index.php',array('menuaction'=>self::$appname.'.filemanager_ui.index','path'=>$rootpath,'ajax'=>'true'));
76
+				$file['Basedirectory'] = egw::link('/index.php', array('menuaction'=>self::$appname.'.filemanager_ui.index', 'path'=>$rootpath, 'ajax'=>'true'));
77 77
 			}
78
-			if (!empty($file_prefs['startfolder'])) $file['Startfolder']= egw::link('/index.php',array('menuaction'=>self::$appname.'.filemanager_ui.index','path'=>$file_prefs['startfolder'],'ajax'=>'true'));
79
-			for ($i=1; $i<=self::$foldercount; $i++)
78
+			if (!empty($file_prefs['startfolder'])) $file['Startfolder'] = egw::link('/index.php', array('menuaction'=>self::$appname.'.filemanager_ui.index', 'path'=>$file_prefs['startfolder'], 'ajax'=>'true'));
79
+			for ($i = 1; $i <= self::$foldercount; $i++)
80 80
 			{
81 81
 				if (!empty($file_prefs['folderlink'.$i]))
82 82
 				{
83
-					$foldername = array_pop(explode('/',$file_prefs['folderlink'.$i]));
84
-					$file[lang('Link %1: %2',$i,$foldername)]= egw::link('/index.php',array(
83
+					$foldername = array_pop(explode('/', $file_prefs['folderlink'.$i]));
84
+					$file[lang('Link %1: %2', $i, $foldername)] = egw::link('/index.php', array(
85 85
 						'menuaction' => self::$appname.'.filemanager_ui.index',
86 86
 						'path'       => $file_prefs['folderlink'.$i],
87 87
 						'nolang'     => true,
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
 					));
90 90
 				}
91 91
 			}
92
-			$file['Placeholders'] = egw::link('/index.php','menuaction=filemanager.filemanager_merge.show_replacements');
93
-			$file['Shared files'] = egw::link('/index.php','menuaction=filemanager.filemanager_shares.index&ajax=true');
94
-			display_sidebox(self::$appname,$title,$file);
92
+			$file['Placeholders'] = egw::link('/index.php', 'menuaction=filemanager.filemanager_merge.show_replacements');
93
+			$file['Shared files'] = egw::link('/index.php', 'menuaction=filemanager.filemanager_shares.index&ajax=true');
94
+			display_sidebox(self::$appname, $title, $file);
95 95
 		}
96 96
 		if ($GLOBALS['egw_info']['user']['apps']['admin']) self::admin(self::$appname);
97 97
 	}
@@ -106,18 +106,18 @@  discard block
 block discarded – undo
106 106
 		if (is_array($location)) $location = $location['location'];
107 107
 
108 108
 		$file = Array(
109
-			'Site Configuration' => egw::link('/index.php','menuaction=admin.uiconfig.index&appname='.self::$appname),
110
-			'Custom fields' => egw::link('/index.php','menuaction=admin.customfields.index&appname='.self::$appname.'&ajax=true'),
111
-			'Check virtual filesystem' => egw::link('/index.php','menuaction=filemanager.filemanager_admin.fsck'),
109
+			'Site Configuration' => egw::link('/index.php', 'menuaction=admin.uiconfig.index&appname='.self::$appname),
110
+			'Custom fields' => egw::link('/index.php', 'menuaction=admin.customfields.index&appname='.self::$appname.'&ajax=true'),
111
+			'Check virtual filesystem' => egw::link('/index.php', 'menuaction=filemanager.filemanager_admin.fsck'),
112 112
 			'VFS mounts and versioning' => egw::link('/index.php', 'menuaction=filemanager.filemanager_admin.index'),
113 113
 		);
114 114
 		if ($location == 'admin')
115 115
 		{
116
-        	display_section(self::$appname,$file);
116
+        	display_section(self::$appname, $file);
117 117
 		}
118 118
 		else
119 119
 		{
120
-			display_sidebox(self::$appname,lang('Admin'),$file);
120
+			display_sidebox(self::$appname, lang('Admin'), $file);
121 121
 		}
122 122
 	}
123 123
 
@@ -147,15 +147,15 @@  discard block
 block discarded – undo
147 147
 				'admin'		=> False,
148 148
 			),
149 149
 		);
150
-		for ($i=1; $i <= self::$foldercount; $i++)
150
+		for ($i = 1; $i <= self::$foldercount; $i++)
151 151
 		{
152
-			$settings['folderlink'.$i]	= array(
152
+			$settings['folderlink'.$i] = array(
153 153
 				'type'		=> 'input',
154 154
 				'name'		=> 'folderlink'.$i,
155 155
 				'size'		=> 60,
156 156
 				'default'	=> '',
157 157
 				'label' 	=> lang('Enter the complete VFS path to specify a fast access link to a folder').' ('.$i.').',
158
-				'run_lang'  => -1,	// -1 = no lang on label
158
+				'run_lang'  => -1, // -1 = no lang on label
159 159
 				'xmlrpc'	=> True,
160 160
 				'admin'		=> False
161 161
 			);
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 				'type'		=> 'select',
177 177
 				'name'		=> 'showhome',
178 178
 				'values'	=> $yes_no,
179
-				'label' 	=> lang('Show link "%1" in side box menu?',lang('Your home directory')),
179
+				'label' 	=> lang('Show link "%1" in side box menu?', lang('Your home directory')),
180 180
 				'xmlrpc'	=> True,
181 181
 				'admin'		=> False,
182 182
 				'forced'   => 'yes',
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 				'type'		=> 'select',
186 186
 				'name'		=> 'showusers',
187 187
 				'values'	=> $yes_no,
188
-				'label' 	=> lang('Show link "%1" in side box menu?',lang('Users and groups')),
188
+				'label' 	=> lang('Show link "%1" in side box menu?', lang('Users and groups')),
189 189
 				'xmlrpc'	=> True,
190 190
 				'admin'		=> False,
191 191
 				'forced'   => 'yes',
@@ -197,9 +197,9 @@  discard block
 block discarded – undo
197 197
 			'size'   => 60,
198 198
 			'label'  => 'Default document to insert entries',
199 199
 			'name'   => 'default_document',
200
-			'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('filemanager')).' '.
200
+			'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('filemanager')).' '.
201 201
 				lang('The document can contain placeholder like {{%1}}, to be replaced with the data.', 'name').' '.
202
-				lang('The following document-types are supported:'). implode(',',bo_merge::get_file_extensions()),
202
+				lang('The following document-types are supported:').implode(',', bo_merge::get_file_extensions()),
203 203
 			'run_lang' => false,
204 204
 			'xmlrpc' => True,
205 205
 			'admin'  => False,
@@ -210,8 +210,8 @@  discard block
 block discarded – undo
210 210
 			'label'  => 'Directory with documents to insert entries',
211 211
 			'name'   => 'document_dir',
212 212
 			'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('filemanager')).' '.
213
-				lang('The document can contain placeholder like {{%1}}, to be replaced with the data.','name').' '.
214
-				lang('The following document-types are supported:'). implode(',',bo_merge::get_file_extensions()),
213
+				lang('The document can contain placeholder like {{%1}}, to be replaced with the data.', 'name').' '.
214
+				lang('The following document-types are supported:').implode(',', bo_merge::get_file_extensions()),
215 215
 			'run_lang' => false,
216 216
 			'xmlrpc' => True,
217 217
 			'admin'  => False,
Please login to merge, or discard this patch.
filemanager/inc/class.filemanager_merge.inc.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@
 block discarded – undo
123 123
 		}
124 124
 		// Custom fields
125 125
 		if($content && strpos($content, '#') !== 0)
126
-                {
126
+				{
127 127
 			// Expand link-to custom fields
128 128
 			 $this->cf_link_to_expand($file, $content, $info);
129 129
 
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	{
57 57
 		parent::__construct();
58 58
 
59
-		if($_dir)
59
+		if ($_dir)
60 60
 		{
61 61
 			$this->dir = $_dir;
62 62
 		}
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 * @param string &$content=null content to create some replacements only if they are use
73 73
 	 * @return array|boolean
74 74
 	 */
75
-	protected function get_replacements($id,&$content=null)
75
+	protected function get_replacements($id, &$content = null)
76 76
 	{
77 77
 		if (!($replacements = $this->filemanager_replacements($id, '', $content)))
78 78
 		{
@@ -88,27 +88,27 @@  discard block
 block discarded – undo
88 88
 	 * @param string $prefix='' prefix like eg. 'erole'
89 89
 	 * @return array|boolean
90 90
 	 */
91
-	public function filemanager_replacements($id,$prefix='', &$content = null)
91
+	public function filemanager_replacements($id, $prefix = '', &$content = null)
92 92
 	{
93 93
 		$info = array();
94
-		$file = egw_vfs::lstat($id,true);
94
+		$file = egw_vfs::lstat($id, true);
95 95
 
96 96
 		$file['mtime'] = egw_time::to($file['mtime']);
97 97
 		$file['ctime'] = egw_time::to($file['ctime']);
98 98
 
99 99
 		$file['name'] = egw_vfs::basename($id);
100 100
 		$file['dir'] = egw_vfs::decodePath(egw_vfs::dirname($id));
101
-		$dirlist = explode('/',$file['dir']);
101
+		$dirlist = explode('/', $file['dir']);
102 102
 		$file['folder'] = array_pop($dirlist);
103
-		$file['folder_file'] = $file['folder'] . '/'.$file['name'];
103
+		$file['folder_file'] = $file['folder'].'/'.$file['name'];
104 104
 		$file['path'] = $id;
105 105
 		$file['rel_path'] = str_replace($this->dir.'/', '', $id);
106 106
 		$file['hsize'] = egw_vfs::hsize($file['size']);
107 107
 		$file['mime'] = egw_vfs::mime_content_type($id);
108
-		$file['gid'] *= -1;  // our widgets use negative gid's
108
+		$file['gid'] *= -1; // our widgets use negative gid's
109 109
 		if (($props = egw_vfs::propfind($id)))
110 110
 		{
111
-			foreach($props as $prop)
111
+			foreach ($props as $prop)
112 112
 			{
113 113
 				$file[$prop['name']] = $prop['val'];
114 114
 			}
@@ -118,22 +118,22 @@  discard block
 block discarded – undo
118 118
 			$file['symlink'] = egw_vfs::readlink($id);
119 119
 		}
120 120
 		// Custom fields
121
-		if($content && strpos($content, '#') !== 0)
121
+		if ($content && strpos($content, '#') !== 0)
122 122
                 {
123 123
 			// Expand link-to custom fields
124 124
 			 $this->cf_link_to_expand($file, $content, $info);
125 125
 
126
-			foreach(config::get_customfields('filemanager') as $name => $field)
126
+			foreach (config::get_customfields('filemanager') as $name => $field)
127 127
 			{
128 128
 				// Set any missing custom fields, or the marker will stay
129
-				if(!$file['#'.$name])
129
+				if (!$file['#'.$name])
130 130
 				{
131 131
 					$file['#'.$name] = '';
132 132
 					continue;
133 133
 				}
134 134
 
135 135
 				// Format date cfs per user preferences
136
-				if($field['type'] == 'date' || $field['type'] == 'date-time')
136
+				if ($field['type'] == 'date' || $field['type'] == 'date-time')
137 137
 				{
138 138
 					$this->date_fields[] = '#'.$name;
139 139
 					$file['#'.$name] = egw_time::to($file['#'.$name], $field['type'] == 'date' ? true : '');
@@ -142,51 +142,51 @@  discard block
 block discarded – undo
142 142
 		}
143 143
 
144 144
 		// If in apps folder, try for app-specific placeholders
145
-		if($dirlist[1] == 'apps' && count($dirlist) > 1)
145
+		if ($dirlist[1] == 'apps' && count($dirlist) > 1)
146 146
 		{
147 147
 			// Try this first - a normal path /apps/appname/id/file
148
-			list($app, $app_id) = explode('/', substr($file['path'], strpos($file['path'], 'apps/')+5));
148
+			list($app, $app_id) = explode('/', substr($file['path'], strpos($file['path'], 'apps/') + 5));
149 149
 			// Symlink?
150
-			if(!$app || !(int)$app_id || !array_key_exists($app, $GLOBALS['egw_info']['user']['apps'])) {
150
+			if (!$app || !(int)$app_id || !array_key_exists($app, $GLOBALS['egw_info']['user']['apps'])) {
151 151
 				// Try resolving just app + ID - /apps/App Name/Record Title/file
152
-				$resolved = egw_vfs::resolve_url_symlinks(implode('/',array_slice(explode('/',$file['dir']),0,4)));
153
-				list($app, $app_id) = explode('/', substr($resolved, strpos($resolved, 'apps/')+5));
152
+				$resolved = egw_vfs::resolve_url_symlinks(implode('/', array_slice(explode('/', $file['dir']), 0, 4)));
153
+				list($app, $app_id) = explode('/', substr($resolved, strpos($resolved, 'apps/') + 5));
154 154
 
155
-				if(!$app || !(int)$app_id || !array_key_exists($app, $GLOBALS['egw_info']['user']['apps'])) {
155
+				if (!$app || !(int)$app_id || !array_key_exists($app, $GLOBALS['egw_info']['user']['apps'])) {
156 156
 					// Get rid of any virtual folders (eg: All$) and symlinks
157 157
 					$resolved = egw_vfs::resolve_url_symlinks($file['path']);
158
-					list($app, $app_id) = explode('/', substr($resolved, strpos($resolved, 'apps/')+5));
158
+					list($app, $app_id) = explode('/', substr($resolved, strpos($resolved, 'apps/') + 5));
159 159
 				}
160 160
 			}
161
-			if($app && $app_id)
161
+			if ($app && $app_id)
162 162
 			{
163
-				if($app && $GLOBALS['egw_info']['user']['apps'][$app])
163
+				if ($app && $GLOBALS['egw_info']['user']['apps'][$app])
164 164
 				{
165 165
 					$app_merge = null;
166 166
 					try
167 167
 					{
168
-						$classname = $app .'_merge';
169
-						if(class_exists($classname))
168
+						$classname = $app.'_merge';
169
+						if (class_exists($classname))
170 170
 						{
171 171
 							$app_merge = new $classname();
172
-							if($app_merge && method_exists($app_merge, 'get_replacements'))
172
+							if ($app_merge && method_exists($app_merge, 'get_replacements'))
173 173
 							{
174 174
 								$app_placeholders = $app_merge->get_replacements($app_id, $content);
175 175
 							}
176 176
 						}
177 177
 					}
178 178
 					// Silently discard & continue
179
-					catch(Exception $e) {
180
-						unset($e);	// not used
179
+					catch (Exception $e) {
180
+						unset($e); // not used
181 181
 					}
182 182
 				}
183 183
 			}
184 184
 		}
185 185
 		$link = egw_link::mime_open($file['url'], $file['mime']);
186
-		if(is_array($link))
186
+		if (is_array($link))
187 187
 		{
188 188
 			// Directories have their internal protocol in path here
189
-			if($link['path'] && strpos($link['path'], '://') !== false) $link['path'] = $file['path'];
189
+			if ($link['path'] && strpos($link['path'], '://') !== false) $link['path'] = $file['path'];
190 190
 			$link = egw_session::link('/index.php', $link);
191 191
 		}
192 192
 		else
@@ -205,12 +205,12 @@  discard block
 block discarded – undo
205 205
 		$file['url'] = $link;
206 206
 
207 207
 		// Add markers
208
-		foreach($file as $key => &$value)
208
+		foreach ($file as $key => &$value)
209 209
 		{
210
-			if(!$value) $value = '';
211
-			$info['$$'.($prefix ? $prefix.'/':'').$key.'$$'] = $value;
210
+			if (!$value) $value = '';
211
+			$info['$$'.($prefix ? $prefix.'/' : '').$key.'$$'] = $value;
212 212
 		}
213
-		if($app_placeholders)
213
+		if ($app_placeholders)
214 214
 		{
215 215
 			$info = array_merge($app_placeholders, $info);
216 216
 		}
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 			'hsize' => 'Size',
247 247
 			'size' => 'Size (in bytes)',
248 248
 		);
249
-		foreach($fields as $name => $label)
249
+		foreach ($fields as $name => $label)
250 250
 		{
251 251
 			if (!($n&1)) echo '<tr>';
252 252
 			echo '<td>{{'.$name.'}}</td><td>'.lang($label).'</td>';
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 		}
256 256
 
257 257
 		echo '<tr><td colspan="4"><h3>'.lang('Custom fields').":</h3></td></tr>";
258
-		foreach(config::get_customfields('filemanager') as $name => $field)
258
+		foreach (config::get_customfields('filemanager') as $name => $field)
259 259
 		{
260 260
 			echo '<tr><td>{{#'.$name.'}}</td><td colspan="3">'.$field['label']."</td></tr>\n";
261 261
 		}
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 		echo '<tr><td colspan="4">'.lang('For files linked to an application entry (inside /apps/appname/id/) the placeholders for that application are also available.  See the specific application for a list of available placeholders.').'</td></tr>';
265 265
 
266 266
 		echo '<tr><td colspan="4"><h3>'.lang('General fields:')."</h3></td></tr>";
267
-		foreach(array(
267
+		foreach (array(
268 268
 			'date' => lang('Date'),
269 269
 			'user/n_fn' => lang('Name of current user, all other contact fields are valid too'),
270 270
 			'user/account_lid' => lang('Username'),
Please login to merge, or discard this patch.
calendar/sitemgr/class.module_calendar.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,12 +27,12 @@
 block discarded – undo
27 27
 		$this->description = lang('This module displays the current month');
28 28
  	}
29 29
 
30
-	function get_content(&$arguments,$properties)
30
+	function get_content(&$arguments, $properties)
31 31
 	{
32
-		$date = (int) (strtotime(get_var('date',array('POST','GET'))));
32
+		$date = (int)(strtotime(get_var('date', array('POST', 'GET'))));
33 33
 		$redirect = $arguments['redirect'] ? $arguments['redirect'] : '#';
34 34
 
35 35
 		return $GLOBALS['egw']->jscalendar->get_javascript().
36
-			$GLOBALS['egw']->jscalendar->flat($redirect,$date);
36
+			$GLOBALS['egw']->jscalendar->flat($redirect, $date);
37 37
 	}
38 38
 }
Please login to merge, or discard this patch.
calendar/setup/setup.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 $setup_info['calendar']['enable']  = 1;
16 16
 $setup_info['calendar']['index']   = 'calendar.calendar_uiviews.index&ajax=true';
17 17
 
18
-$setup_info['calendar']['license']  = 'GPL';
18
+$setup_info['calendar']['license'] = 'GPL';
19 19
 $setup_info['calendar']['description'] =
20 20
 	'Powerful group calendar with meeting request system and ACL security.';
21 21
 $setup_info['calendar']['note'] =
Please login to merge, or discard this patch.
calendar/setup/tables_update.inc.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1909,7 +1909,7 @@
 block discarded – undo
1909 1909
 			WHERE cal_id='.(int)$row['cal_id'].' AND cal_start='.(int)$row['cal_start'],__LINE__,__FILE__);
1910 1910
 	}
1911 1911
 
1912
-    $GLOBALS['egw_setup']->db->query('UPDATE egw_cal_repeats SET recur_interval=1
1912
+	$GLOBALS['egw_setup']->db->query('UPDATE egw_cal_repeats SET recur_interval=1
1913 1913
 			WHERE recur_interval=0',__LINE__,__FILE__);
1914 1914
 
1915 1915
 	return $GLOBALS['setup_info']['calendar']['currentver'] = '1.7.007';
Please login to merge, or discard this patch.
Spacing   +430 added lines, -430 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 		{
19 19
 			$owner[count($owner)] = $GLOBALS['egw_setup']->oProc->f($field);
20 20
 		}
21
-		if($GLOBALS['egw_setup']->alessthanb($GLOBALS['setup_info']['phpgwapi']['currentver'],'0.9.10pre4'))
21
+		if ($GLOBALS['egw_setup']->alessthanb($GLOBALS['setup_info']['phpgwapi']['currentver'], '0.9.10pre4'))
22 22
 		{
23 23
 			$acctstbl = 'accounts';
24 24
 		}
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 		{
27 27
 			$acctstbl = 'phpgw_accounts';
28 28
 		}
29
-		for($i=0;$i<count($owner);$i++)
29
+		for ($i = 0; $i < count($owner); $i++)
30 30
 		{
31 31
 			$GLOBALS['egw_setup']->oProc->query("SELECT account_id FROM $acctstbl WHERE account_lid='".$owner[$i]."'");
32 32
 			$GLOBALS['egw_setup']->oProc->next_record();
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 
40 40
 function calendar_upgrade0_9_3pre1()
41 41
 {
42
-	calendar_v0_9_2to0_9_3update_owner('webcal_entry','cal_create_by');
43
-	calendar_v0_9_2to0_9_3update_owner('webcal_entry_user','cal_login');
42
+	calendar_v0_9_2to0_9_3update_owner('webcal_entry', 'cal_create_by');
43
+	calendar_v0_9_2to0_9_3update_owner('webcal_entry_user', 'cal_login');
44 44
 	$GLOBALS['setup_info']['calendar']['currentver'] = '0.9.3pre2';
45 45
 	return $GLOBALS['setup_info']['calendar']['currentver'];
46 46
 }
@@ -207,12 +207,12 @@  discard block
 block discarded – undo
207 207
 		)
208 208
 	);
209 209
 
210
-	$GLOBALS['egw_setup']->oProc->query('SELECT count(*) FROM webcal_entry',__LINE__,__FILE__);
210
+	$GLOBALS['egw_setup']->oProc->query('SELECT count(*) FROM webcal_entry', __LINE__, __FILE__);
211 211
 	$GLOBALS['egw_setup']->oProc->next_record();
212
-	if($GLOBALS['egw_setup']->oProc->f(0))
212
+	if ($GLOBALS['egw_setup']->oProc->f(0))
213 213
 	{
214
-		$GLOBALS['egw_setup']->oProc->query('SELECT cal_id,cal_owner,cal_duration,cal_priority,cal_type,cal_access,cal_name,cal_description,cal_id,cal_date,cal_time,cal_mod_date,cal_mod_time FROM webcal_entry ORDER BY cal_id',__LINE__,__FILE__);
215
-		while($GLOBALS['egw_setup']->oProc->next_record())
214
+		$GLOBALS['egw_setup']->oProc->query('SELECT cal_id,cal_owner,cal_duration,cal_priority,cal_type,cal_access,cal_name,cal_description,cal_id,cal_date,cal_time,cal_mod_date,cal_mod_time FROM webcal_entry ORDER BY cal_id', __LINE__, __FILE__);
215
+		while ($GLOBALS['egw_setup']->oProc->next_record())
216 216
 		{
217 217
 			$cal_id = $GLOBALS['egw_setup']->oProc->f('cal_id');
218 218
 			$cal_owner = $GLOBALS['egw_setup']->oProc->f('cal_owner');
@@ -222,13 +222,13 @@  discard block
 block discarded – undo
222 222
 			$cal_access = $GLOBALS['egw_setup']->oProc->f('cal_access');
223 223
 			$cal_name = $GLOBALS['egw_setup']->oProc->f('cal_name');
224 224
 			$cal_description = $GLOBALS['egw_setup']->oProc->f('cal_description');
225
-			$datetime = mktime(intval(strrev(substr(strrev($GLOBALS['egw_setup']->oProc->f('cal_time')),4))),intval(strrev(substr(strrev($GLOBALS['egw_setup']->oProc->f('cal_time')),2,2))),intval(strrev(substr(strrev($GLOBALS['egw_setup']->oProc->f('cal_time')),0,2))),intval(substr($GLOBALS['egw_setup']->oProc->f('cal_date'),4,2)),intval(substr($GLOBALS['egw_setup']->oProc->f('cal_date'),6,2)),intval(substr($GLOBALS['egw_setup']->oProc->f('cal_date'),0,4)));
226
-			$moddatetime = mktime(intval(strrev(substr(strrev($GLOBALS['egw_setup']->oProc->f('cal_mod_time')),4))),intval(strrev(substr(strrev($GLOBALS['egw_setup']->oProc->f('cal_mod_time')),2,2))),intval(strrev(substr(strrev($GLOBALS['egw_setup']->oProc->f('cal_mod_time')),0,2))),intval(substr($GLOBALS['egw_setup']->oProc->f('cal_mod_date'),4,2)),intval(substr($GLOBALS['egw_setup']->oProc->f('cal_mod_date'),6,2)),intval(substr($GLOBALS['egw_setup']->oProc->f('cal_mod_date'),0,4)));
227
-			$db2->query('SELECT groups FROM webcal_entry_groups WHERE cal_id='.$cal_id,__LINE__,__FILE__);
225
+			$datetime = mktime(intval(strrev(substr(strrev($GLOBALS['egw_setup']->oProc->f('cal_time')), 4))), intval(strrev(substr(strrev($GLOBALS['egw_setup']->oProc->f('cal_time')), 2, 2))), intval(strrev(substr(strrev($GLOBALS['egw_setup']->oProc->f('cal_time')), 0, 2))), intval(substr($GLOBALS['egw_setup']->oProc->f('cal_date'), 4, 2)), intval(substr($GLOBALS['egw_setup']->oProc->f('cal_date'), 6, 2)), intval(substr($GLOBALS['egw_setup']->oProc->f('cal_date'), 0, 4)));
226
+			$moddatetime = mktime(intval(strrev(substr(strrev($GLOBALS['egw_setup']->oProc->f('cal_mod_time')), 4))), intval(strrev(substr(strrev($GLOBALS['egw_setup']->oProc->f('cal_mod_time')), 2, 2))), intval(strrev(substr(strrev($GLOBALS['egw_setup']->oProc->f('cal_mod_time')), 0, 2))), intval(substr($GLOBALS['egw_setup']->oProc->f('cal_mod_date'), 4, 2)), intval(substr($GLOBALS['egw_setup']->oProc->f('cal_mod_date'), 6, 2)), intval(substr($GLOBALS['egw_setup']->oProc->f('cal_mod_date'), 0, 4)));
227
+			$db2->query('SELECT groups FROM webcal_entry_groups WHERE cal_id='.$cal_id, __LINE__, __FILE__);
228 228
 			$db2->next_record();
229 229
 			$cal_group = $db2->f('groups');
230 230
 			$db2->query('INSERT INTO calendar_entry(cal_id,cal_owner,cal_group,cal_datetime,cal_mdatetime,cal_duration,cal_priority,cal_type,cal_access,cal_name,cal_description) '
231
-				.'VALUES('.$cal_id.",'".$cal_owner."','".$cal_group."',".$datetime.",".$moddatetime.",".$cal_duration.",".$cal_priority.",'".$cal_type."','".$cal_access."','".$cal_name."','".$cal_description."')",__LINE__,__FILE__);
231
+				.'VALUES('.$cal_id.",'".$cal_owner."','".$cal_group."',".$datetime.",".$moddatetime.",".$cal_duration.",".$cal_priority.",'".$cal_type."','".$cal_access."','".$cal_name."','".$cal_description."')", __LINE__, __FILE__);
232 232
 		}
233 233
 	}
234 234
 
@@ -249,17 +249,17 @@  discard block
 block discarded – undo
249 249
 		)
250 250
 	);
251 251
 
252
-	$GLOBALS['egw_setup']->oProc->query('SELECT count(*) FROM webcal_entry_user',__LINE__,__FILE__);
252
+	$GLOBALS['egw_setup']->oProc->query('SELECT count(*) FROM webcal_entry_user', __LINE__, __FILE__);
253 253
 	$GLOBALS['egw_setup']->oProc->next_record();
254
-	if($GLOBALS['egw_setup']->oProc->f(0))
254
+	if ($GLOBALS['egw_setup']->oProc->f(0))
255 255
 	{
256
-		$GLOBALS['egw_setup']->oProc->query('SELECT cal_id,cal_login,cal_status FROM webcal_entry_user ORDER BY cal_id',__LINE__,__FILE__);
257
-		while($GLOBALS['egw_setup']->oProc->next_record())
256
+		$GLOBALS['egw_setup']->oProc->query('SELECT cal_id,cal_login,cal_status FROM webcal_entry_user ORDER BY cal_id', __LINE__, __FILE__);
257
+		while ($GLOBALS['egw_setup']->oProc->next_record())
258 258
 		{
259 259
 			$cal_id = $GLOBALS['egw_setup']->oProc->f('cal_id');
260 260
 			$cal_login = $GLOBALS['egw_setup']->oProc->f('cal_login');
261 261
 			$cal_status = $GLOBALS['egw_setup']->oProc->f('cal_status');
262
-			$db2->query('INSERT INTO calendar_entry_user(cal_id,cal_login,cal_status) VALUES('.$cal_id.','.$cal_login.",'".$cal_status."')",__LINE__,__FILE__);
262
+			$db2->query('INSERT INTO calendar_entry_user(cal_id,cal_login,cal_status) VALUES('.$cal_id.','.$cal_login.",'".$cal_status."')", __LINE__, __FILE__);
263 263
 		}
264 264
 	}
265 265
 
@@ -282,18 +282,18 @@  discard block
 block discarded – undo
282 282
 		)
283 283
 	);
284 284
 
285
-	$GLOBALS['egw_setup']->oProc->query('SELECT count(*) FROM webcal_entry_repeats',__LINE__,__FILE__);
285
+	$GLOBALS['egw_setup']->oProc->query('SELECT count(*) FROM webcal_entry_repeats', __LINE__, __FILE__);
286 286
 	$GLOBALS['egw_setup']->oProc->next_record();
287
-	if($GLOBALS['egw_setup']->oProc->f(0))
287
+	if ($GLOBALS['egw_setup']->oProc->f(0))
288 288
 	{
289
-		$GLOBALS['egw_setup']->oProc->query('SELECT cal_id,cal_type,cal_end,cal_frequency,cal_days FROM webcal_entry_repeats ORDER BY cal_id',__LINE__,__FILE__);
290
-		while($GLOBALS['egw_setup']->oProc->next_record())
289
+		$GLOBALS['egw_setup']->oProc->query('SELECT cal_id,cal_type,cal_end,cal_frequency,cal_days FROM webcal_entry_repeats ORDER BY cal_id', __LINE__, __FILE__);
290
+		while ($GLOBALS['egw_setup']->oProc->next_record())
291 291
 		{
292 292
 			$cal_id = $GLOBALS['egw_setup']->oProc->f('cal_id');
293 293
 			$cal_type = $GLOBALS['egw_setup']->oProc->f('cal_type');
294
-			if(isset($GLOBALS['egw_setup']->oProc->Record['cal_end']))
294
+			if (isset($GLOBALS['egw_setup']->oProc->Record['cal_end']))
295 295
 			{
296
-				$enddate = mktime(0,0,0,intval(substr($GLOBALS['egw_setup']->oProc->f('cal_end'),4,2)),intval(substr($GLOBALS['egw_setup']->oProc->f('cal_end'),6,2)),intval(substr($GLOBALS['egw_setup']->oProc->f('cal_end'),0,4)));
296
+				$enddate = mktime(0, 0, 0, intval(substr($GLOBALS['egw_setup']->oProc->f('cal_end'), 4, 2)), intval(substr($GLOBALS['egw_setup']->oProc->f('cal_end'), 6, 2)), intval(substr($GLOBALS['egw_setup']->oProc->f('cal_end'), 0, 4)));
297 297
 				$useend = 1;
298 298
 			}
299 299
 			else
@@ -303,12 +303,12 @@  discard block
 block discarded – undo
303 303
 			}
304 304
 			$cal_frequency = $GLOBALS['egw_setup']->oProc->f('cal_frequency');
305 305
 			$cal_days = $GLOBALS['egw_setup']->oProc->f('cal_days');
306
-			$db2->query('INSERT INTO calendar_entry_repeats(cal_id,cal_type,cal_use_end,cal_end,cal_frequency,cal_days) VALUES('.$cal_id.",'".$cal_type."',".$useend.",".$enddate.",".$cal_frequency.",'".$cal_days."')",__LINE__,__FILE__);
306
+			$db2->query('INSERT INTO calendar_entry_repeats(cal_id,cal_type,cal_use_end,cal_end,cal_frequency,cal_days) VALUES('.$cal_id.",'".$cal_type."',".$useend.",".$enddate.",".$cal_frequency.",'".$cal_days."')", __LINE__, __FILE__);
307 307
 		}
308 308
 	}
309 309
 
310 310
 	$GLOBALS['egw_setup']->oProc->DropTable('webcal_entry_repeats');
311
-	$GLOBALS['egw_setup']->oProc->query("UPDATE {$GLOBALS['egw_setup']->applications_table} SET app_tables='calendar_entry,calendar_entry_user,calendar_entry_repeats' WHERE app_name='calendar'",__LINE__,__FILE__);
311
+	$GLOBALS['egw_setup']->oProc->query("UPDATE {$GLOBALS['egw_setup']->applications_table} SET app_tables='calendar_entry,calendar_entry_user,calendar_entry_repeats' WHERE app_name='calendar'", __LINE__, __FILE__);
312 312
 
313 313
 	$GLOBALS['setup_info']['calendar']['currentver'] = '0.9.7pre2';
314 314
 	return $GLOBALS['setup_info']['calendar']['currentver'];
@@ -320,19 +320,19 @@  discard block
 block discarded – undo
320 320
 	$db2 = $GLOBALS['egw_setup']->db;
321 321
 
322 322
 	$GLOBALS['egw_setup']->oProc->RenameColumn('calendar_entry', 'cal_duration', 'cal_edatetime');
323
-	$GLOBALS['egw_setup']->oProc->query('SELECT cal_id,cal_datetime,cal_owner,cal_edatetime,cal_mdatetime FROM calendar_entry ORDER BY cal_id',__LINE__,__FILE__);
324
-	if($GLOBALS['egw_setup']->oProc->num_rows())
323
+	$GLOBALS['egw_setup']->oProc->query('SELECT cal_id,cal_datetime,cal_owner,cal_edatetime,cal_mdatetime FROM calendar_entry ORDER BY cal_id', __LINE__, __FILE__);
324
+	if ($GLOBALS['egw_setup']->oProc->num_rows())
325 325
 	{
326
-		while($GLOBALS['egw_setup']->oProc->next_record())
326
+		while ($GLOBALS['egw_setup']->oProc->next_record())
327 327
 		{
328
-			$db2->query("SELECT preference_value FROM preferences WHERE preference_name='tz_offset' AND preference_appname='common' AND preference_owner=".$GLOBALS['egw_setup']->db->f('cal_owner'),__LINE__,__FILE__);
328
+			$db2->query("SELECT preference_value FROM preferences WHERE preference_name='tz_offset' AND preference_appname='common' AND preference_owner=".$GLOBALS['egw_setup']->db->f('cal_owner'), __LINE__, __FILE__);
329 329
 			$db2->next_record();
330 330
 			$tz = $db2->f('preference_value');
331 331
 			$cal_id = $GLOBALS['egw_setup']->oProc->f('cal_id');
332 332
 			$datetime = $GLOBALS['egw_setup']->oProc->f('cal_datetime') - ((60 * 60) * $tz);
333 333
 			$mdatetime = $GLOBALS['egw_setup']->oProc->f('cal_mdatetime') - ((60 * 60) * $tz);
334 334
 			$edatetime = $datetime + (60 * $GLOBALS['egw_setup']->oProc->f('cal_edatetime'));
335
-			$db2->query('UPDATE calendar_entry SET cal_datetime='.$datetime.', cal_edatetime='.$edatetime.', cal_mdatetime='.$mdatetime.' WHERE cal_id='.$cal_id,__LINE__,__FILE__);
335
+			$db2->query('UPDATE calendar_entry SET cal_datetime='.$datetime.', cal_edatetime='.$edatetime.', cal_mdatetime='.$mdatetime.' WHERE cal_id='.$cal_id, __LINE__, __FILE__);
336 336
 		}
337 337
 	}
338 338
 
@@ -580,22 +580,22 @@  discard block
 block discarded – undo
580 580
 {
581 581
 	$db2 = $GLOBALS['egw_setup']->db;
582 582
 
583
-	if(extension_loaded('mcal') == False)
583
+	if (extension_loaded('mcal') == False)
584 584
 	{
585
-		define(RECUR_NONE,0);
586
-		define(RECUR_DAILY,1);
587
-		define(RECUR_WEEKLY,2);
588
-		define(RECUR_MONTHLY_MDAY,3);
589
-		define(RECUR_MONTHLY_WDAY,4);
590
-		define(RECUR_YEARLY,5);
591
-
592
-		define(M_SUNDAY,1);
593
-		define(M_MONDAY,2);
594
-		define(M_TUESDAY,4);
595
-		define(M_WEDNESDAY,8);
596
-		define(M_THURSDAY,16);
597
-		define(M_FRIDAY,32);
598
-		define(M_SATURDAY,64);
585
+		define(RECUR_NONE, 0);
586
+		define(RECUR_DAILY, 1);
587
+		define(RECUR_WEEKLY, 2);
588
+		define(RECUR_MONTHLY_MDAY, 3);
589
+		define(RECUR_MONTHLY_WDAY, 4);
590
+		define(RECUR_YEARLY, 5);
591
+
592
+		define(M_SUNDAY, 1);
593
+		define(M_MONDAY, 2);
594
+		define(M_TUESDAY, 4);
595
+		define(M_WEDNESDAY, 8);
596
+		define(M_THURSDAY, 16);
597
+		define(M_FRIDAY, 32);
598
+		define(M_SATURDAY, 64);
599 599
 	}
600 600
 
601 601
 // calendar_entry => phpgw_cal
@@ -622,13 +622,13 @@  discard block
 block discarded – undo
622 622
 		)
623 623
 	);
624 624
 
625
-	$GLOBALS['egw_setup']->oProc->query('SELECT * FROM calendar_entry',__LINE__,__FILE__);
626
-	while($GLOBALS['egw_setup']->oProc->next_record())
625
+	$GLOBALS['egw_setup']->oProc->query('SELECT * FROM calendar_entry', __LINE__, __FILE__);
626
+	while ($GLOBALS['egw_setup']->oProc->next_record())
627 627
 	{
628 628
 		$id = $GLOBALS['egw_setup']->oProc->f('cal_id');
629 629
 		$owner = $GLOBALS['egw_setup']->oProc->f('cal_owner');
630 630
 		$access = $GLOBALS['egw_setup']->oProc->f('cal_access');
631
-		switch($access)
631
+		switch ($access)
632 632
 		{
633 633
 			case 'private':
634 634
 				$is_public = 0;
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
 		$description = $GLOBALS['egw_setup']->oProc->f('cal_description');
651 651
 
652 652
 		$db2->query("INSERT INTO phpgw_cal(cal_id,owner,groups,datetime,mdatetime,edatetime,priority,cal_type,is_public,title,description) "
653
-			. "VALUES($id,$owner,'$groups',$datetime,$mdatetime,$edatetime,$priority,'$type',$is_public,'$title','$description')",__LINE__,__FILE__);
653
+			. "VALUES($id,$owner,'$groups',$datetime,$mdatetime,$edatetime,$priority,'$type',$is_public,'$title','$description')", __LINE__, __FILE__);
654 654
 	}
655 655
 	$GLOBALS['egw_setup']->oProc->DropTable('calendar_entry');
656 656
 
@@ -658,12 +658,12 @@  discard block
 block discarded – undo
658 658
 	$GLOBALS['egw_setup']->oProc->CreateTable('phpgw_cal_repeats',
659 659
 		Array(
660 660
 			'fd' => array(
661
-				'cal_id' => array('type' => 'int', 'precision' => 8,'nullable' => False),
662
-				'recur_type' => array('type' => 'int', 'precision' => 8,'nullable' => False),
663
-				'recur_use_end' => array('type' => 'int', 'precision' => 8,'nullable' => True),
664
-				'recur_enddate' => array('type' => 'int', 'precision' => 8,'nullable' => True),
665
-				'recur_interval' => array('type' => 'int', 'precision' => 8,'nullable' => True,'default' => '1'),
666
-				'recur_data' => array('type' => 'int', 'precision' => 8,'nullable' => True,'default' => '1')
661
+				'cal_id' => array('type' => 'int', 'precision' => 8, 'nullable' => False),
662
+				'recur_type' => array('type' => 'int', 'precision' => 8, 'nullable' => False),
663
+				'recur_use_end' => array('type' => 'int', 'precision' => 8, 'nullable' => True),
664
+				'recur_enddate' => array('type' => 'int', 'precision' => 8, 'nullable' => True),
665
+				'recur_interval' => array('type' => 'int', 'precision' => 8, 'nullable' => True, 'default' => '1'),
666
+				'recur_data' => array('type' => 'int', 'precision' => 8, 'nullable' => True, 'default' => '1')
667 667
 			),
668 668
 			'pk' => array(),
669 669
 			'fk' => array(),
@@ -671,12 +671,12 @@  discard block
 block discarded – undo
671 671
 			'uc' => array()
672 672
 		)
673 673
 	);
674
-	$GLOBALS['egw_setup']->oProc->query('SELECT * FROM calendar_entry_repeats',__LINE__,__FILE__);
675
-	while($GLOBALS['egw_setup']->oProc->next_record())
674
+	$GLOBALS['egw_setup']->oProc->query('SELECT * FROM calendar_entry_repeats', __LINE__, __FILE__);
675
+	while ($GLOBALS['egw_setup']->oProc->next_record())
676 676
 	{
677 677
 		$id = $GLOBALS['egw_setup']->oProc->f('cal_id');
678 678
 		$recur_type = $GLOBALS['egw_setup']->oProc->f('cal_type');
679
-		switch($recur_type)
679
+		switch ($recur_type)
680 680
 		{
681 681
 			case 'daily':
682 682
 				$recur_type_num = RECUR_DAILY;
@@ -699,20 +699,20 @@  discard block
 block discarded – undo
699 699
 		$recur_interval = $GLOBALS['egw_setup']->oProc->f('cal_frequency');
700 700
 		$days = strtoupper($GLOBALS['egw_setup']->oProc->f('cal_days'));
701 701
 		$recur_data = 0;
702
-		$recur_data += (substr($days,0,1)=='Y'?M_SUNDAY:0);
703
-		$recur_data += (substr($days,1,1)=='Y'?M_MONDAY:0);
704
-		$recur_data += (substr($days,2,1)=='Y'?M_TUESDAY:0);
705
-		$recur_data += (substr($days,3,1)=='Y'?M_WEDNESDAY:0);
706
-		$recur_data += (substr($days,4,1)=='Y'?M_THURSDAY:0);
707
-		$recur_data += (substr($days,5,1)=='Y'?M_FRIDAY:0);
708
-		$recur_data += (substr($days,6,1)=='Y'?M_SATURDAY:0);
702
+		$recur_data += (substr($days, 0, 1) == 'Y' ? M_SUNDAY : 0);
703
+		$recur_data += (substr($days, 1, 1) == 'Y' ? M_MONDAY : 0);
704
+		$recur_data += (substr($days, 2, 1) == 'Y' ? M_TUESDAY : 0);
705
+		$recur_data += (substr($days, 3, 1) == 'Y' ? M_WEDNESDAY : 0);
706
+		$recur_data += (substr($days, 4, 1) == 'Y' ? M_THURSDAY : 0);
707
+		$recur_data += (substr($days, 5, 1) == 'Y' ? M_FRIDAY : 0);
708
+		$recur_data += (substr($days, 6, 1) == 'Y' ? M_SATURDAY : 0);
709 709
 		$db2->query("INSERT INTO phpgw_cal_repeats(cal_id,recur_type,recur_use_end,recur_enddate,recur_interval,recur_data) "
710
-			. "VALUES($id,$recur_type_num,$recur_use_end,$recur_end,$recur_interval,$recur_data)",__LINE__,__FILE__);
710
+			. "VALUES($id,$recur_type_num,$recur_use_end,$recur_end,$recur_interval,$recur_data)", __LINE__, __FILE__);
711 711
 	}
712 712
 	$GLOBALS['egw_setup']->oProc->DropTable('calendar_entry_repeats');
713 713
 
714 714
 // calendar_entry_user => phpgw_cal_user
715
-	$GLOBALS['egw_setup']->oProc->RenameTable('calendar_entry_user','phpgw_cal_user');
715
+	$GLOBALS['egw_setup']->oProc->RenameTable('calendar_entry_user', 'phpgw_cal_user');
716 716
 
717 717
 	$GLOBALS['setup_info']['calendar']['currentver'] = '0.9.11.002';
718 718
 	return $GLOBALS['setup_info']['calendar']['currentver'];
@@ -731,11 +731,11 @@  discard block
 block discarded – undo
731 731
 	$GLOBALS['egw_setup']->oProc->CreateTable('phpgw_cal_holidays',
732 732
 		Array(
733 733
 			'fd' => array(
734
-				'locale' => array('type' => 'char', 'precision' => 2,'nullable' => False),
735
-				'name' => array('type' => 'varchar', 'precision' => 50,'nullable' => False),
736
-				'date_time' => array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0')
734
+				'locale' => array('type' => 'char', 'precision' => 2, 'nullable' => False),
735
+				'name' => array('type' => 'varchar', 'precision' => 50, 'nullable' => False),
736
+				'date_time' => array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0')
737 737
 			),
738
-			'pk' => array('locale','name'),
738
+			'pk' => array('locale', 'name'),
739 739
 			'fk' => array(),
740 740
 			'ix' => array(),
741 741
 			'uc' => array()
@@ -767,10 +767,10 @@  discard block
 block discarded – undo
767 767
 	$GLOBALS['egw_setup']->oProc->CreateTable('phpgw_cal_holidays',
768 768
 		Array(
769 769
 			'fd' => array(
770
-				'hol_id' => array('type' => 'auto','nullable' => False),
771
-				'locale' => array('type' => 'char', 'precision' => 2,'nullable' => False),
772
-				'name' => array('type' => 'varchar', 'precision' => 50,'nullable' => False),
773
-				'date_time' => array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0')
770
+				'hol_id' => array('type' => 'auto', 'nullable' => False),
771
+				'locale' => array('type' => 'char', 'precision' => 2, 'nullable' => False),
772
+				'name' => array('type' => 'varchar', 'precision' => 50, 'nullable' => False),
773
+				'date_time' => array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0')
774 774
 			),
775 775
 			'pk' => array('hol_id'),
776 776
 			'fk' => array(),
@@ -787,10 +787,10 @@  discard block
 block discarded – undo
787 787
 function calendar_upgrade0_9_11_007()
788 788
 {
789 789
 	$GLOBALS['egw_setup']->oProc->query('DELETE FROM phpgw_cal_holidays');
790
-	$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays','mday',array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0'));
791
-	$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays','month_num',array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0'));
792
-	$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays','occurence',array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0'));
793
-	$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays','dow',array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0'));
790
+	$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays', 'mday', array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0'));
791
+	$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays', 'month_num', array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0'));
792
+	$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays', 'occurence', array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0'));
793
+	$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays', 'dow', array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0'));
794 794
 
795 795
 	$GLOBALS['setup_info']['calendar']['currentver'] = '0.9.11.008';
796 796
 	return $GLOBALS['setup_info']['calendar']['currentver'];
@@ -807,7 +807,7 @@  discard block
 block discarded – undo
807 807
 function calendar_upgrade0_9_11_009()
808 808
 {
809 809
 	$GLOBALS['egw_setup']->oProc->query('DELETE FROM phpgw_cal_holidays');
810
-	$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays','observance_rule',array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0'));
810
+	$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays', 'observance_rule', array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0'));
811 811
 
812 812
 	$GLOBALS['setup_info']['calendar']['currentver'] = '0.9.11.010';
813 813
 	return $GLOBALS['setup_info']['calendar']['currentver'];
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
 
843 843
 function calendar_upgrade0_9_13_002()
844 844
 {
845
-	$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal','reference',array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0'));
845
+	$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal', 'reference', array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0'));
846 846
 
847 847
 	$GLOBALS['setup_info']['calendar']['currentver'] = '0.9.13.003';
848 848
 	return $GLOBALS['setup_info']['calendar']['currentver'];
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
 	$GLOBALS['egw_setup']->oProc->CreateTable('phpgw_cal_alarm',
855 855
 		Array(
856 856
 			'fd' => array(
857
-				'alarm_id' => array('type' => 'auto','nullable' => False),
857
+				'alarm_id' => array('type' => 'auto', 'nullable' => False),
858 858
 				'cal_id'   => array('type' => 'int', 'precision' => 8, 'nullable' => False),
859 859
 				'cal_owner'	=> array('type' => 'int', 'precision' => 8, 'nullable' => False),
860 860
 				'cal_time' => array('type' => 'int', 'precision' => 8, 'nullable' => False),
@@ -867,8 +867,8 @@  discard block
 block discarded – undo
867 867
 		)
868 868
 	);
869 869
 
870
-	$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal','uid',array('type' => 'varchar', 'precision' => 255,'nullable' => False));
871
-	$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal','location',array('type' => 'varchar', 'precision' => 255,'nullable' => True));
870
+	$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal', 'uid', array('type' => 'varchar', 'precision' => 255, 'nullable' => False));
871
+	$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal', 'location', array('type' => 'varchar', 'precision' => 255, 'nullable' => True));
872 872
 
873 873
 	$GLOBALS['setup_info']['calendar']['currentver'] = '0.9.13.004';
874 874
 	return $GLOBALS['setup_info']['calendar']['currentver'];
@@ -877,7 +877,7 @@  discard block
 block discarded – undo
877 877
 
878 878
 function calendar_upgrade0_9_13_004()
879 879
 {
880
-	$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_alarm','alarm_enabled',array('type' => 'int', 'precision' => 4,'nullable' => False, 'default' => '1'));
880
+	$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_alarm', 'alarm_enabled', array('type' => 'int', 'precision' => 4, 'nullable' => False, 'default' => '1'));
881 881
 
882 882
 	$GLOBALS['setup_info']['calendar']['currentver'] = '0.9.13.005';
883 883
 	return $GLOBALS['setup_info']['calendar']['currentver'];
@@ -887,18 +887,18 @@  discard block
 block discarded – undo
887 887
 function calendar_upgrade0_9_13_005()
888 888
 {
889 889
 	$calendar_data = Array();
890
-	$GLOBALS['egw_setup']->oProc->query('SELECT cal_id, category FROM phpgw_cal',__LINE__,__FILE__);
891
-	while($GLOBALS['egw_setup']->oProc->next_record())
890
+	$GLOBALS['egw_setup']->oProc->query('SELECT cal_id, category FROM phpgw_cal', __LINE__, __FILE__);
891
+	while ($GLOBALS['egw_setup']->oProc->next_record())
892 892
 	{
893 893
 		$calendar_data[$GLOBALS['egw_setup']->oProc->f('cal_id')] = $GLOBALS['egw_setup']->oProc->f('category');
894 894
 	}
895 895
 
896
-	$GLOBALS['egw_setup']->oProc->AlterColumn('phpgw_cal','category',array('type' => 'varchar', 'precision' => 30,'nullable' => True));
896
+	$GLOBALS['egw_setup']->oProc->AlterColumn('phpgw_cal', 'category', array('type' => 'varchar', 'precision' => 30, 'nullable' => True));
897 897
 
898 898
 	@reset($calendar_data);
899
-	while($calendar_data && list($cal_id,$category) = each($calendar_data))
899
+	while ($calendar_data && list($cal_id, $category) = each($calendar_data))
900 900
 	{
901
-		$GLOBALS['egw_setup']->oProc->query("UPDATE phpgw_cal SET category='".$category."' WHERE cal_id=".$cal_id,__LINE__,__FILE__);
901
+		$GLOBALS['egw_setup']->oProc->query("UPDATE phpgw_cal SET category='".$category."' WHERE cal_id=".$cal_id, __LINE__, __FILE__);
902 902
 	}
903 903
 	$GLOBALS['setup_info']['calendar']['currentver'] = '0.9.13.006';
904 904
 	return $GLOBALS['setup_info']['calendar']['currentver'];
@@ -907,7 +907,7 @@  discard block
 block discarded – undo
907 907
 
908 908
 function calendar_upgrade0_9_13_006()
909 909
 {
910
-	$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_repeats','recur_exception',array('type' => 'varchar', 'precision' => 255, 'nullable' => True, 'default' => ''));
910
+	$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_repeats', 'recur_exception', array('type' => 'varchar', 'precision' => 255, 'nullable' => True, 'default' => ''));
911 911
 
912 912
 	$GLOBALS['setup_info']['calendar']['currentver'] = '0.9.13.007';
913 913
 	return $GLOBALS['setup_info']['calendar']['currentver'];
@@ -917,20 +917,20 @@  discard block
 block discarded – undo
917 917
 
918 918
 function calendar_upgrade0_9_13_007()
919 919
 {
920
-	$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_user','cal_type',array(
920
+	$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_user', 'cal_type', array(
921 921
 		'type' => 'varchar',
922 922
 		'precision' => '1',
923 923
 		'nullable' => False,
924 924
 		'default' => 'u'
925 925
 	));
926 926
 
927
-	$GLOBALS['egw_setup']->oProc->CreateTable('phpgw_cal_extra',array(
927
+	$GLOBALS['egw_setup']->oProc->CreateTable('phpgw_cal_extra', array(
928 928
 		'fd' => array(
929
-			'cal_id' => array('type' => 'int','precision' => '4','nullable' => False),
930
-			'cal_extra_name' => array('type' => 'varchar','precision' => '40','nullable' => False),
931
-			'cal_extra_value' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '')
929
+			'cal_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False),
930
+			'cal_extra_name' => array('type' => 'varchar', 'precision' => '40', 'nullable' => False),
931
+			'cal_extra_value' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '')
932 932
 		),
933
-		'pk' => array('cal_id','cal_extra_name'),
933
+		'pk' => array('cal_id', 'cal_extra_name'),
934 934
 		'fk' => array(),
935 935
 		'ix' => array(),
936 936
 		'uc' => array()
@@ -947,7 +947,7 @@  discard block
 block discarded – undo
947 947
 function calendar_upgrade0_9_16_001()
948 948
 {
949 949
 	// this is to set the default as schema_proc was not setting an empty default
950
-	$GLOBALS['egw_setup']->oProc->AlterColumn('phpgw_cal_user','cal_type',array(
950
+	$GLOBALS['egw_setup']->oProc->AlterColumn('phpgw_cal_user', 'cal_type', array(
951 951
 		'type' => 'varchar',
952 952
 		'precision' => '1',
953 953
 		'nullable' => False,
@@ -964,15 +964,15 @@  discard block
 block discarded – undo
964 964
 
965 965
 function calendar_upgrade0_9_16_002()
966 966
 {
967
-	$GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_repeats',array(
967
+	$GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_repeats', array(
968 968
 		'fd' => array(
969
-			'cal_id' => array('type' => 'int','precision' => '8','nullable' => False),
970
-			'recur_type' => array('type' => 'int','precision' => '8','nullable' => False),
971
-			'recur_use_end' => array('type' => 'int','precision' => '8','default' => '0'),
972
-			'recur_enddate' => array('type' => 'int','precision' => '8'),
973
-			'recur_interval' => array('type' => 'int','precision' => '8','default' => '1'),
974
-			'recur_data' => array('type' => 'int','precision' => '8','default' => '1'),
975
-			'recur_exception' => array('type' => 'varchar','precision' => '255','default' => '')
969
+			'cal_id' => array('type' => 'int', 'precision' => '8', 'nullable' => False),
970
+			'recur_type' => array('type' => 'int', 'precision' => '8', 'nullable' => False),
971
+			'recur_use_end' => array('type' => 'int', 'precision' => '8', 'default' => '0'),
972
+			'recur_enddate' => array('type' => 'int', 'precision' => '8'),
973
+			'recur_interval' => array('type' => 'int', 'precision' => '8', 'default' => '1'),
974
+			'recur_data' => array('type' => 'int', 'precision' => '8', 'default' => '1'),
975
+			'recur_exception' => array('type' => 'varchar', 'precision' => '255', 'default' => '')
976 976
 		),
977 977
 		'pk' => array(),
978 978
 		'fk' => array(),
@@ -988,14 +988,14 @@  discard block
 block discarded – undo
988 988
 
989 989
 function calendar_upgrade0_9_16_003()
990 990
 {
991
-	$GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_user',array(
991
+	$GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_user', array(
992 992
 		'fd' => array(
993
-			'cal_id' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'),
994
-			'cal_login' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'),
995
-			'cal_status' => array('type' => 'char','precision' => '1','default' => 'A'),
996
-			'cal_type' => array('type' => 'varchar','precision' => '1','nullable' => False,'default' => 'u')
993
+			'cal_id' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'),
994
+			'cal_login' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'),
995
+			'cal_status' => array('type' => 'char', 'precision' => '1', 'default' => 'A'),
996
+			'cal_type' => array('type' => 'varchar', 'precision' => '1', 'nullable' => False, 'default' => 'u')
997 997
 		),
998
-		'pk' => array('cal_id','cal_login','cal_type'),
998
+		'pk' => array('cal_id', 'cal_login', 'cal_type'),
999 999
 		'fk' => array(),
1000 1000
 		'ix' => array(),
1001 1001
 		'uc' => array()
@@ -1009,16 +1009,16 @@  discard block
 block discarded – undo
1009 1009
 
1010 1010
 function calendar_upgrade0_9_16_004()
1011 1011
 {
1012
-	$GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_holidays',array(
1012
+	$GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_holidays', array(
1013 1013
 		'fd' => array(
1014
-			'hol_id' => array('type' => 'auto','nullable' => False),
1015
-			'locale' => array('type' => 'char','precision' => '2','nullable' => False),
1016
-			'name' => array('type' => 'varchar','precision' => '50','nullable' => False),
1017
-			'mday' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'),
1018
-			'month_num' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'),
1019
-			'occurence' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'),
1020
-			'dow' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'),
1021
-			'observance_rule' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0')
1014
+			'hol_id' => array('type' => 'auto', 'nullable' => False),
1015
+			'locale' => array('type' => 'char', 'precision' => '2', 'nullable' => False),
1016
+			'name' => array('type' => 'varchar', 'precision' => '50', 'nullable' => False),
1017
+			'mday' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'),
1018
+			'month_num' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'),
1019
+			'occurence' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'),
1020
+			'dow' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'),
1021
+			'observance_rule' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0')
1022 1022
 		),
1023 1023
 		'pk' => array('hol_id'),
1024 1024
 		'fk' => array(),
@@ -1036,13 +1036,13 @@  discard block
 block discarded – undo
1036 1036
 {
1037 1037
 	// creates uid's for all entries which do not have unique ones, they are '[email protected]'
1038 1038
 	// very old entries even have an empty uid, see 0.9.16.006 update
1039
-	$GLOBALS['egw_setup']->oProc->query("SELECT config_name,config_value FROM {$GLOBALS['egw_setup']->config_table} WHERE config_name IN ('install_id','mail_suffix') AND config_app='phpgwapi'",__LINE__,__FILE__);
1039
+	$GLOBALS['egw_setup']->oProc->query("SELECT config_name,config_value FROM {$GLOBALS['egw_setup']->config_table} WHERE config_name IN ('install_id','mail_suffix') AND config_app='phpgwapi'", __LINE__, __FILE__);
1040 1040
 	while ($GLOBALS['egw_setup']->oProc->next_record())
1041 1041
 	{
1042 1042
 		$config[$GLOBALS['egw_setup']->oProc->f(0)] = $GLOBALS['egw_setup']->oProc->f(1);
1043 1043
 	}
1044 1044
 	$GLOBALS['egw_setup']->oProc->query('UPDATE phpgw_cal SET uid='.
1045
-		$GLOBALS['egw_setup']->db->concat($GLOBALS['egw_setup']->db->quote('cal-'),'cal_id',
1045
+		$GLOBALS['egw_setup']->db->concat($GLOBALS['egw_setup']->db->quote('cal-'), 'cal_id',
1046 1046
 			$GLOBALS['egw_setup']->db->quote('-'.$config['install_id'].'@'.
1047 1047
 			($config['mail_suffix'] ? $config['mail_suffix'] : 'local'))).
1048 1048
 		" WHERE uid LIKE '-@%' OR uid=''");
@@ -1065,7 +1065,7 @@  discard block
 block discarded – undo
1065 1065
 function calendar_upgrade0_9_16_007()
1066 1066
 {
1067 1067
 	// update the sequenzes for refreshed tables (postgres only)
1068
-	$GLOBALS['egw_setup']->oProc->UpdateSequence('phpgw_cal_holidays','hol_id');
1068
+	$GLOBALS['egw_setup']->oProc->UpdateSequence('phpgw_cal_holidays', 'hol_id');
1069 1069
 
1070 1070
 	$GLOBALS['setup_info']['calendar']['currentver'] = '1.0.0';
1071 1071
 	return $GLOBALS['setup_info']['calendar']['currentver'];
@@ -1075,19 +1075,19 @@  discard block
 block discarded – undo
1075 1075
 
1076 1076
 function calendar_upgrade1_0_0()
1077 1077
 {
1078
-	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','uid','cal_uid');
1079
-	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','owner','cal_owner');
1080
-	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','category','cal_category');
1081
-	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','groups','cal_groups');
1082
-	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','datetime','cal_starttime');
1083
-	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','mdatetime','cal_modified');
1084
-	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','edatetime','cal_endtime');
1085
-	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','priority','cal_priority');
1086
-	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','is_public','cal_public');
1087
-	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','title','cal_title');
1088
-	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','description','cal_description');
1089
-	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','location','cal_location');
1090
-	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','reference','cal_reference');
1078
+	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'uid', 'cal_uid');
1079
+	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'owner', 'cal_owner');
1080
+	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'category', 'cal_category');
1081
+	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'groups', 'cal_groups');
1082
+	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'datetime', 'cal_starttime');
1083
+	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'mdatetime', 'cal_modified');
1084
+	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'edatetime', 'cal_endtime');
1085
+	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'priority', 'cal_priority');
1086
+	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'is_public', 'cal_public');
1087
+	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'title', 'cal_title');
1088
+	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'description', 'cal_description');
1089
+	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'location', 'cal_location');
1090
+	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'reference', 'cal_reference');
1091 1091
 
1092 1092
 	$GLOBALS['setup_info']['calendar']['currentver'] = '1.0.0.001';
1093 1093
 	return $GLOBALS['setup_info']['calendar']['currentver'];
@@ -1097,13 +1097,13 @@  discard block
 block discarded – undo
1097 1097
 
1098 1098
 function calendar_upgrade1_0_0_001()
1099 1099
 {
1100
-	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays','locale','hol_locale');
1101
-	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays','name','hol_name');
1102
-	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays','mday','hol_mday');
1103
-	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays','month_num','hol_month_num');
1104
-	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays','occurence','hol_occurence');
1105
-	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays','dow','hol_dow');
1106
-	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays','observance_rule','hol_observance_rule');
1100
+	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays', 'locale', 'hol_locale');
1101
+	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays', 'name', 'hol_name');
1102
+	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays', 'mday', 'hol_mday');
1103
+	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays', 'month_num', 'hol_month_num');
1104
+	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays', 'occurence', 'hol_occurence');
1105
+	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays', 'dow', 'hol_dow');
1106
+	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays', 'observance_rule', 'hol_observance_rule');
1107 1107
 
1108 1108
 	$GLOBALS['setup_info']['calendar']['currentver'] = '1.0.0.002';
1109 1109
 	return $GLOBALS['setup_info']['calendar']['currentver'];
@@ -1113,8 +1113,8 @@  discard block
 block discarded – undo
1113 1113
 
1114 1114
 function calendar_upgrade1_0_0_002()
1115 1115
 {
1116
-	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_user','cal_login','cal_user_id');
1117
-	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_user','cal_type','cal_user_type');
1116
+	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_user', 'cal_login', 'cal_user_id');
1117
+	$GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_user', 'cal_type', 'cal_user_type');
1118 1118
 
1119 1119
 	$GLOBALS['setup_info']['calendar']['currentver'] = '1.0.0.003';
1120 1120
 	return $GLOBALS['setup_info']['calendar']['currentver'];
@@ -1124,7 +1124,7 @@  discard block
 block discarded – undo
1124 1124
 
1125 1125
 function calendar_upgrade1_0_0_003()
1126 1126
 {
1127
-	$GLOBALS['egw_setup']->oProc->AlterColumn('phpgw_cal','cal_title',array(
1127
+	$GLOBALS['egw_setup']->oProc->AlterColumn('phpgw_cal', 'cal_title', array(
1128 1128
 		'type' => 'varchar',
1129 1129
 		'precision' => '255',
1130 1130
 		'nullable' => False,
@@ -1139,15 +1139,15 @@  discard block
 block discarded – undo
1139 1139
 
1140 1140
 function calendar_upgrade1_0_0_004()
1141 1141
 {
1142
-	$GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_repeats',array(
1142
+	$GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_repeats', array(
1143 1143
 		'fd' => array(
1144
-			'cal_id' => array('type' => 'int','precision' => '8','nullable' => False),
1145
-			'recur_type' => array('type' => 'int','precision' => '8','nullable' => False),
1146
-			'recur_use_end' => array('type' => 'int','precision' => '8','default' => '0'),
1147
-			'recur_enddate' => array('type' => 'int','precision' => '8'),
1148
-			'recur_interval' => array('type' => 'int','precision' => '8','default' => '1'),
1149
-			'recur_data' => array('type' => 'int','precision' => '8','default' => '1'),
1150
-			'recur_exception' => array('type' => 'varchar','precision' => '255','default' => '')
1144
+			'cal_id' => array('type' => 'int', 'precision' => '8', 'nullable' => False),
1145
+			'recur_type' => array('type' => 'int', 'precision' => '8', 'nullable' => False),
1146
+			'recur_use_end' => array('type' => 'int', 'precision' => '8', 'default' => '0'),
1147
+			'recur_enddate' => array('type' => 'int', 'precision' => '8'),
1148
+			'recur_interval' => array('type' => 'int', 'precision' => '8', 'default' => '1'),
1149
+			'recur_data' => array('type' => 'int', 'precision' => '8', 'default' => '1'),
1150
+			'recur_exception' => array('type' => 'varchar', 'precision' => '255', 'default' => '')
1151 1151
 		),
1152 1152
 		'pk' => array('cal_id'),
1153 1153
 		'fk' => array(),
@@ -1164,19 +1164,19 @@  discard block
 block discarded – undo
1164 1164
 function calendar_upgrade1_0_0_005()
1165 1165
 {
1166 1166
 	// change prefix of all calendar tables to egw_
1167
-	foreach(array('cal_user','cal_repeats','cal_extra','cal_holidays','cal') as $name)
1167
+	foreach (array('cal_user', 'cal_repeats', 'cal_extra', 'cal_holidays', 'cal') as $name)
1168 1168
 	{
1169
-		$GLOBALS['egw_setup']->oProc->RenameTable('phpgw_'.$name,'egw_'.$name);
1169
+		$GLOBALS['egw_setup']->oProc->RenameTable('phpgw_'.$name, 'egw_'.$name);
1170 1170
 	}
1171 1171
 
1172 1172
 	// create new dates table, with content from the egw_cal table
1173
-	$GLOBALS['egw_setup']->oProc->CreateTable('egw_cal_dates',array(
1173
+	$GLOBALS['egw_setup']->oProc->CreateTable('egw_cal_dates', array(
1174 1174
 		'fd' => array(
1175
-			'cal_id' => array('type' => 'int','precision' => '4','nullable' => False),
1176
-			'cal_start' => array('type' => 'int','precision' => '8','nullable' => False),
1177
-			'cal_end' => array('type' => 'int','precision' => '8','nullable' => False)
1175
+			'cal_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False),
1176
+			'cal_start' => array('type' => 'int', 'precision' => '8', 'nullable' => False),
1177
+			'cal_end' => array('type' => 'int', 'precision' => '8', 'nullable' => False)
1178 1178
 		),
1179
-		'pk' => array('cal_id','cal_start'),
1179
+		'pk' => array('cal_id', 'cal_start'),
1180 1180
 		'fk' => array(),
1181 1181
 		'ix' => array(),
1182 1182
 		'uc' => array()
@@ -1184,49 +1184,49 @@  discard block
 block discarded – undo
1184 1184
 	$GLOBALS['egw_setup']->oProc->query("INSERT INTO egw_cal_dates SELECT cal_id,cal_starttime,cal_endtime FROM egw_cal");
1185 1185
 
1186 1186
 	// drop the fields transfered to the dates table
1187
-	$GLOBALS['egw_setup']->oProc->DropColumn('egw_cal',array(
1187
+	$GLOBALS['egw_setup']->oProc->DropColumn('egw_cal', array(
1188 1188
 		'fd' => array(
1189
-			'cal_id' => array('type' => 'auto','nullable' => False),
1190
-			'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False),
1191
-			'cal_owner' => array('type' => 'int','precision' => '8','nullable' => False),
1192
-			'cal_category' => array('type' => 'varchar','precision' => '30'),
1193
-			'cal_groups' => array('type' => 'varchar','precision' => '255'),
1194
-			'cal_modified' => array('type' => 'int','precision' => '8'),
1195
-			'cal_endtime' => array('type' => 'int','precision' => '8'),
1196
-			'cal_priority' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '2'),
1197
-			'cal_type' => array('type' => 'varchar','precision' => '10'),
1198
-			'cal_public' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '1'),
1199
-			'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'),
1189
+			'cal_id' => array('type' => 'auto', 'nullable' => False),
1190
+			'cal_uid' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False),
1191
+			'cal_owner' => array('type' => 'int', 'precision' => '8', 'nullable' => False),
1192
+			'cal_category' => array('type' => 'varchar', 'precision' => '30'),
1193
+			'cal_groups' => array('type' => 'varchar', 'precision' => '255'),
1194
+			'cal_modified' => array('type' => 'int', 'precision' => '8'),
1195
+			'cal_endtime' => array('type' => 'int', 'precision' => '8'),
1196
+			'cal_priority' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '2'),
1197
+			'cal_type' => array('type' => 'varchar', 'precision' => '10'),
1198
+			'cal_public' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '1'),
1199
+			'cal_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '1'),
1200 1200
 			'cal_description' => array('type' => 'text'),
1201
-			'cal_location' => array('type' => 'varchar','precision' => '255'),
1202
-			'cal_reference' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0')
1201
+			'cal_location' => array('type' => 'varchar', 'precision' => '255'),
1202
+			'cal_reference' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0')
1203 1203
 		),
1204 1204
 		'pk' => array('cal_id'),
1205 1205
 		'fk' => array(),
1206 1206
 		'ix' => array(),
1207 1207
 		'uc' => array()
1208
-	),'cal_starttime');
1209
-	$GLOBALS['egw_setup']->oProc->DropColumn('egw_cal',array(
1208
+	), 'cal_starttime');
1209
+	$GLOBALS['egw_setup']->oProc->DropColumn('egw_cal', array(
1210 1210
 		'fd' => array(
1211
-			'cal_id' => array('type' => 'auto','nullable' => False),
1212
-			'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False),
1213
-			'cal_owner' => array('type' => 'int','precision' => '8','nullable' => False),
1214
-			'cal_category' => array('type' => 'varchar','precision' => '30'),
1215
-			'cal_groups' => array('type' => 'varchar','precision' => '255'),
1216
-			'cal_modified' => array('type' => 'int','precision' => '8'),
1217
-			'cal_priority' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '2'),
1218
-			'cal_type' => array('type' => 'varchar','precision' => '10'),
1219
-			'cal_public' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '1'),
1220
-			'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'),
1211
+			'cal_id' => array('type' => 'auto', 'nullable' => False),
1212
+			'cal_uid' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False),
1213
+			'cal_owner' => array('type' => 'int', 'precision' => '8', 'nullable' => False),
1214
+			'cal_category' => array('type' => 'varchar', 'precision' => '30'),
1215
+			'cal_groups' => array('type' => 'varchar', 'precision' => '255'),
1216
+			'cal_modified' => array('type' => 'int', 'precision' => '8'),
1217
+			'cal_priority' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '2'),
1218
+			'cal_type' => array('type' => 'varchar', 'precision' => '10'),
1219
+			'cal_public' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '1'),
1220
+			'cal_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '1'),
1221 1221
 			'cal_description' => array('type' => 'text'),
1222
-			'cal_location' => array('type' => 'varchar','precision' => '255'),
1223
-			'cal_reference' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0')
1222
+			'cal_location' => array('type' => 'varchar', 'precision' => '255'),
1223
+			'cal_reference' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0')
1224 1224
 		),
1225 1225
 		'pk' => array('cal_id'),
1226 1226
 		'fk' => array(),
1227 1227
 		'ix' => array(),
1228 1228
 		'uc' => array()
1229
-	),'cal_endtime');
1229
+	), 'cal_endtime');
1230 1230
 
1231 1231
 	$GLOBALS['setup_info']['calendar']['currentver'] = '1.0.1.001';
1232 1232
 	return $GLOBALS['setup_info']['calendar']['currentver'];
@@ -1242,15 +1242,15 @@  discard block
 block discarded – undo
1242 1242
 		'precision' => '8',
1243 1243
 		'default' => '0'
1244 1244
 	));*/
1245
-	$GLOBALS['egw_setup']->oProc->RefreshTable('egw_cal_user',array(
1245
+	$GLOBALS['egw_setup']->oProc->RefreshTable('egw_cal_user', array(
1246 1246
 		'fd' => array(
1247
-			'cal_id' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'),
1248
-			'cal_recur_date' => array('type' => 'int','precision' => '8','default' => '0'),
1249
-			'cal_user_type' => array('type' => 'varchar','precision' => '1','nullable' => False,'default' => 'u'),
1250
-			'cal_user_id' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'),
1251
-			'cal_status' => array('type' => 'char','precision' => '1','default' => 'A')
1247
+			'cal_id' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'),
1248
+			'cal_recur_date' => array('type' => 'int', 'precision' => '8', 'default' => '0'),
1249
+			'cal_user_type' => array('type' => 'varchar', 'precision' => '1', 'nullable' => False, 'default' => 'u'),
1250
+			'cal_user_id' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'),
1251
+			'cal_status' => array('type' => 'char', 'precision' => '1', 'default' => 'A')
1252 1252
 		),
1253
-		'pk' => array('cal_id','cal_recur_date','cal_user_type','cal_user_id'),
1253
+		'pk' => array('cal_id', 'cal_recur_date', 'cal_user_type', 'cal_user_id'),
1254 1254
 		'fk' => array(),
1255 1255
 		'ix' => array(),
1256 1256
 		'uc' => array()
@@ -1264,50 +1264,50 @@  discard block
 block discarded – undo
1264 1264
 
1265 1265
 function calendar_upgrade1_0_1_002()
1266 1266
 {
1267
-	$GLOBALS['egw_setup']->oProc->DropColumn('egw_cal',array(
1267
+	$GLOBALS['egw_setup']->oProc->DropColumn('egw_cal', array(
1268 1268
 		'fd' => array(
1269
-			'cal_id' => array('type' => 'auto','nullable' => False),
1270
-			'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False),
1271
-			'cal_owner' => array('type' => 'int','precision' => '8','nullable' => False),
1272
-			'cal_category' => array('type' => 'varchar','precision' => '30'),
1273
-			'cal_groups' => array('type' => 'varchar','precision' => '255'),
1274
-			'cal_modified' => array('type' => 'int','precision' => '8'),
1275
-			'cal_priority' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '2'),
1276
-			'cal_public' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '1'),
1277
-			'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'),
1269
+			'cal_id' => array('type' => 'auto', 'nullable' => False),
1270
+			'cal_uid' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False),
1271
+			'cal_owner' => array('type' => 'int', 'precision' => '8', 'nullable' => False),
1272
+			'cal_category' => array('type' => 'varchar', 'precision' => '30'),
1273
+			'cal_groups' => array('type' => 'varchar', 'precision' => '255'),
1274
+			'cal_modified' => array('type' => 'int', 'precision' => '8'),
1275
+			'cal_priority' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '2'),
1276
+			'cal_public' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '1'),
1277
+			'cal_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '1'),
1278 1278
 			'cal_description' => array('type' => 'text'),
1279
-			'cal_location' => array('type' => 'varchar','precision' => '255'),
1280
-			'cal_reference' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0')
1279
+			'cal_location' => array('type' => 'varchar', 'precision' => '255'),
1280
+			'cal_reference' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0')
1281 1281
 		),
1282 1282
 		'pk' => array('cal_id'),
1283 1283
 		'fk' => array(),
1284 1284
 		'ix' => array(),
1285 1285
 		'uc' => array()
1286
-	),'cal_type');
1287
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_owner',array(
1286
+	), 'cal_type');
1287
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_owner', array(
1288 1288
 		'type' => 'int',
1289 1289
 		'precision' => '4',
1290 1290
 		'nullable' => False
1291 1291
 	));
1292
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_priority',array(
1292
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_priority', array(
1293 1293
 		'type' => 'int',
1294 1294
 		'precision' => '2',
1295 1295
 		'nullable' => False,
1296 1296
 		'default' => '2'
1297 1297
 	));
1298
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_public',array(
1298
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_public', array(
1299 1299
 		'type' => 'int',
1300 1300
 		'precision' => '2',
1301 1301
 		'nullable' => False,
1302 1302
 		'default' => '1'
1303 1303
 	));
1304
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_reference',array(
1304
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_reference', array(
1305 1305
 		'type' => 'int',
1306 1306
 		'precision' => '4',
1307 1307
 		'nullable' => False,
1308 1308
 		'default' => '0'
1309 1309
 	));
1310
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_modifier',array(
1310
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_modifier', array(
1311 1311
 		'type' => 'int',
1312 1312
 		'precision' => '4'
1313 1313
 	));
@@ -1320,36 +1320,36 @@  discard block
 block discarded – undo
1320 1320
 
1321 1321
 function calendar_upgrade1_0_1_003()
1322 1322
 {
1323
-	$GLOBALS['egw_setup']->oProc->DropColumn('egw_cal_repeats',array(
1323
+	$GLOBALS['egw_setup']->oProc->DropColumn('egw_cal_repeats', array(
1324 1324
 		'fd' => array(
1325
-			'cal_id' => array('type' => 'int','precision' => '8','nullable' => False),
1326
-			'recur_type' => array('type' => 'int','precision' => '8','nullable' => False),
1327
-			'recur_enddate' => array('type' => 'int','precision' => '8'),
1328
-			'recur_interval' => array('type' => 'int','precision' => '8','default' => '1'),
1329
-			'recur_data' => array('type' => 'int','precision' => '8','default' => '1'),
1330
-			'recur_exception' => array('type' => 'varchar','precision' => '255','default' => '')
1325
+			'cal_id' => array('type' => 'int', 'precision' => '8', 'nullable' => False),
1326
+			'recur_type' => array('type' => 'int', 'precision' => '8', 'nullable' => False),
1327
+			'recur_enddate' => array('type' => 'int', 'precision' => '8'),
1328
+			'recur_interval' => array('type' => 'int', 'precision' => '8', 'default' => '1'),
1329
+			'recur_data' => array('type' => 'int', 'precision' => '8', 'default' => '1'),
1330
+			'recur_exception' => array('type' => 'varchar', 'precision' => '255', 'default' => '')
1331 1331
 		),
1332 1332
 		'pk' => array('cal_id'),
1333 1333
 		'fk' => array(),
1334 1334
 		'ix' => array(),
1335 1335
 		'uc' => array()
1336
-	),'recur_use_end');
1337
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats','cal_id',array(
1336
+	), 'recur_use_end');
1337
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats', 'cal_id', array(
1338 1338
 		'type' => 'int',
1339 1339
 		'precision' => '4',
1340 1340
 		'nullable' => False
1341 1341
 	));
1342
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats','recur_type',array(
1342
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats', 'recur_type', array(
1343 1343
 		'type' => 'int',
1344 1344
 		'precision' => '2',
1345 1345
 		'nullable' => False
1346 1346
 	));
1347
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats','recur_interval',array(
1347
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats', 'recur_interval', array(
1348 1348
 		'type' => 'int',
1349 1349
 		'precision' => '2',
1350 1350
 		'default' => '1'
1351 1351
 	));
1352
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats','recur_data',array(
1352
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats', 'recur_data', array(
1353 1353
 		'type' => 'int',
1354 1354
 		'precision' => '2',
1355 1355
 		'default' => '1'
@@ -1363,13 +1363,13 @@  discard block
 block discarded – undo
1363 1363
 
1364 1364
 function calendar_upgrade1_0_1_004()
1365 1365
 {
1366
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_id',array(
1366
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_id', array(
1367 1367
 		'type' => 'int',
1368 1368
 		'precision' => '4',
1369 1369
 		'nullable' => False,
1370 1370
 		'default' => '0'
1371 1371
 	));
1372
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_user_id',array(
1372
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_user_id', array(
1373 1373
 		'type' => 'int',
1374 1374
 		'precision' => '4',
1375 1375
 		'nullable' => False,
@@ -1384,7 +1384,7 @@  discard block
 block discarded – undo
1384 1384
 
1385 1385
 function calendar_upgrade1_0_1_005()
1386 1386
 {
1387
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user','cal_quantity',array(
1387
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user', 'cal_quantity', array(
1388 1388
 		'type' => 'int',
1389 1389
 		'precision' => '4',
1390 1390
 		'default' => '1'
@@ -1398,7 +1398,7 @@  discard block
 block discarded – undo
1398 1398
 
1399 1399
 function calendar_upgrade1_0_1_006()
1400 1400
 {
1401
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_non_blocking',array(
1401
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_non_blocking', array(
1402 1402
 		'type' => 'int',
1403 1403
 		'precision' => '2',
1404 1404
 		'default' => '0'
@@ -1412,9 +1412,9 @@  discard block
 block discarded – undo
1412 1412
 
1413 1413
 function calendar_upgrade1_0_1_007()
1414 1414
 {
1415
-	$GLOBALS['egw_setup']->db->update('egw_cal_repeats',array('recur_exception' => null),array('recur_exception' => ''),__LINE__,__FILE__,'calendar');
1415
+	$GLOBALS['egw_setup']->db->update('egw_cal_repeats', array('recur_exception' => null), array('recur_exception' => ''), __LINE__, __FILE__, 'calendar');
1416 1416
 
1417
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats','recur_exception',array(
1417
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats', 'recur_exception', array(
1418 1418
 		'type' => 'text'
1419 1419
 	));
1420 1420
 
@@ -1431,11 +1431,11 @@  discard block
 block discarded – undo
1431 1431
 	{
1432 1432
 		$customfields = array();
1433 1433
 		$order = 0;
1434
-		foreach($config_data['fields'] as $name => $data)
1434
+		foreach ($config_data['fields'] as $name => $data)
1435 1435
 		{
1436 1436
 			if ($name{0} == '#' && !$data['disabled'])	// real not-disabled custom field
1437 1437
 			{
1438
-				$customfields[substr($name,1)] = array(
1438
+				$customfields[substr($name, 1)] = array(
1439 1439
 					'type'  => 'text',
1440 1440
 					'len'   => $data['length'].($data['shown'] ? ','.$data['shown'] : ''),
1441 1441
 					'label' => $data['name'],
@@ -1458,38 +1458,38 @@  discard block
 block discarded – undo
1458 1458
 function calendar_upgrade1_0_1_009()
1459 1459
 {
1460 1460
 	$db2 = clone($GLOBALS['egw_setup']->db);
1461
-	$GLOBALS['egw_setup']->db->select('egw_cal','DISTINCT egw_cal.cal_id,cal_groups,cal_recur_date',"cal_groups != ''",__LINE__,__FILE__,
1462
-		False,'','calendar',0,',egw_cal_user WHERE egw_cal.cal_id=egw_cal_user.cal_id');
1463
-	while(($row = $GLOBALS['egw_setup']->db->row(true)))
1461
+	$GLOBALS['egw_setup']->db->select('egw_cal', 'DISTINCT egw_cal.cal_id,cal_groups,cal_recur_date', "cal_groups != ''", __LINE__, __FILE__,
1462
+		False, '', 'calendar', 0, ',egw_cal_user WHERE egw_cal.cal_id=egw_cal_user.cal_id');
1463
+	while (($row = $GLOBALS['egw_setup']->db->row(true)))
1464 1464
 	{
1465 1465
 		$row['cal_user_type'] = 'u';
1466
-		foreach(explode(',',$row['cal_groups']) as $group)
1466
+		foreach (explode(',', $row['cal_groups']) as $group)
1467 1467
 		{
1468 1468
 			$row['cal_user_id'] = $group;
1469
-			$db2->insert('egw_cal_user',array('cal_status' => 'U'),$row,__LINE__,__FILE__,'calendar');
1469
+			$db2->insert('egw_cal_user', array('cal_status' => 'U'), $row, __LINE__, __FILE__, 'calendar');
1470 1470
 		}
1471 1471
 	}
1472
-	$GLOBALS['egw_setup']->oProc->DropColumn('egw_cal',array(
1472
+	$GLOBALS['egw_setup']->oProc->DropColumn('egw_cal', array(
1473 1473
 		'fd' => array(
1474
-			'cal_id' => array('type' => 'auto','nullable' => False),
1475
-			'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False),
1476
-			'cal_owner' => array('type' => 'int','precision' => '4','nullable' => False),
1477
-			'cal_category' => array('type' => 'varchar','precision' => '30'),
1478
-			'cal_modified' => array('type' => 'int','precision' => '8'),
1479
-			'cal_priority' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '2'),
1480
-			'cal_public' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '1'),
1481
-			'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'),
1474
+			'cal_id' => array('type' => 'auto', 'nullable' => False),
1475
+			'cal_uid' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False),
1476
+			'cal_owner' => array('type' => 'int', 'precision' => '4', 'nullable' => False),
1477
+			'cal_category' => array('type' => 'varchar', 'precision' => '30'),
1478
+			'cal_modified' => array('type' => 'int', 'precision' => '8'),
1479
+			'cal_priority' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '2'),
1480
+			'cal_public' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '1'),
1481
+			'cal_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '1'),
1482 1482
 			'cal_description' => array('type' => 'text'),
1483
-			'cal_location' => array('type' => 'varchar','precision' => '255'),
1484
-			'cal_reference' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
1485
-			'cal_modifier' => array('type' => 'int','precision' => '4'),
1486
-			'cal_non_blocking' => array('type' => 'int','precision' => '2','default' => '0')
1483
+			'cal_location' => array('type' => 'varchar', 'precision' => '255'),
1484
+			'cal_reference' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'default' => '0'),
1485
+			'cal_modifier' => array('type' => 'int', 'precision' => '4'),
1486
+			'cal_non_blocking' => array('type' => 'int', 'precision' => '2', 'default' => '0')
1487 1487
 		),
1488 1488
 		'pk' => array('cal_id'),
1489 1489
 		'fk' => array(),
1490 1490
 		'ix' => array(),
1491 1491
 		'uc' => array()
1492
-	),'cal_groups');
1492
+	), 'cal_groups');
1493 1493
 
1494 1494
 	return $GLOBALS['setup_info']['calendar']['currentver'] = '1.2';
1495 1495
 }
@@ -1499,7 +1499,7 @@  discard block
 block discarded – undo
1499 1499
 function calendar_upgrade1_2()
1500 1500
 {
1501 1501
 	// get old alarms (saved before 1.2) working again
1502
-	$GLOBALS['egw_setup']->db->query("UPDATE egw_async SET async_method ='calendar.bocalupdate.send_alarm' WHERE async_method ='calendar.bocalendar.send_alarm'",__LINE__,__FILE__);
1502
+	$GLOBALS['egw_setup']->db->query("UPDATE egw_async SET async_method ='calendar.bocalupdate.send_alarm' WHERE async_method ='calendar.bocalendar.send_alarm'", __LINE__, __FILE__);
1503 1503
 
1504 1504
 	return $GLOBALS['setup_info']['calendar']['currentver'] = '1.2.001';
1505 1505
 }
@@ -1507,7 +1507,7 @@  discard block
 block discarded – undo
1507 1507
 
1508 1508
 function calendar_upgrade1_2_001()
1509 1509
 {
1510
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_special',array(
1510
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_special', array(
1511 1511
 		'type' => 'int',
1512 1512
 		'precision' => '2',
1513 1513
 		'default' => '0'
@@ -1525,7 +1525,7 @@  discard block
 block discarded – undo
1525 1525
 
1526 1526
 function calendar_upgrade1_4()
1527 1527
 {
1528
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_etag',array(
1528
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_etag', array(
1529 1529
 		'type' => 'int',
1530 1530
 		'precision' => '4',
1531 1531
 		'default' => '0'
@@ -1537,59 +1537,59 @@  discard block
 block discarded – undo
1537 1537
 
1538 1538
 function calendar_upgrade1_5()
1539 1539
 {
1540
-	$GLOBALS['egw_setup']->oProc->DropColumn('egw_cal',array(
1540
+	$GLOBALS['egw_setup']->oProc->DropColumn('egw_cal', array(
1541 1541
 		'fd' => array(
1542
-			'cal_id' => array('type' => 'auto','nullable' => False),
1543
-			'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False),
1544
-			'cal_owner' => array('type' => 'int','precision' => '4','nullable' => False),
1545
-			'cal_category' => array('type' => 'varchar','precision' => '30'),
1546
-			'cal_modified' => array('type' => 'int','precision' => '8'),
1547
-			'cal_priority' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '2'),
1548
-			'cal_public' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '1'),
1549
-			'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'),
1542
+			'cal_id' => array('type' => 'auto', 'nullable' => False),
1543
+			'cal_uid' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False),
1544
+			'cal_owner' => array('type' => 'int', 'precision' => '4', 'nullable' => False),
1545
+			'cal_category' => array('type' => 'varchar', 'precision' => '30'),
1546
+			'cal_modified' => array('type' => 'int', 'precision' => '8'),
1547
+			'cal_priority' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '2'),
1548
+			'cal_public' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '1'),
1549
+			'cal_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '1'),
1550 1550
 			'cal_description' => array('type' => 'text'),
1551
-			'cal_location' => array('type' => 'varchar','precision' => '255'),
1552
-			'cal_reference' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
1553
-			'cal_modifier' => array('type' => 'int','precision' => '4'),
1554
-			'cal_non_blocking' => array('type' => 'int','precision' => '2','default' => '0'),
1555
-			'cal_special' => array('type' => 'int','precision' => '2','default' => '0'),
1556
-			'cal_etag' => array('type' => 'int','precision' => '4'),
1557
-			'cal_edit_time' => array('type' => 'int','precision' => '8')
1551
+			'cal_location' => array('type' => 'varchar', 'precision' => '255'),
1552
+			'cal_reference' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'default' => '0'),
1553
+			'cal_modifier' => array('type' => 'int', 'precision' => '4'),
1554
+			'cal_non_blocking' => array('type' => 'int', 'precision' => '2', 'default' => '0'),
1555
+			'cal_special' => array('type' => 'int', 'precision' => '2', 'default' => '0'),
1556
+			'cal_etag' => array('type' => 'int', 'precision' => '4'),
1557
+			'cal_edit_time' => array('type' => 'int', 'precision' => '8')
1558 1558
 		),
1559 1559
 		'pk' => array('cal_id'),
1560 1560
 		'fk' => array(),
1561 1561
 		'ix' => array(),
1562 1562
 		'uc' => array()
1563
-	),'cal_edit_user');
1564
-	$GLOBALS['egw_setup']->oProc->DropColumn('egw_cal',array(
1563
+	), 'cal_edit_user');
1564
+	$GLOBALS['egw_setup']->oProc->DropColumn('egw_cal', array(
1565 1565
 		'fd' => array(
1566
-			'cal_id' => array('type' => 'auto','nullable' => False),
1567
-			'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False),
1568
-			'cal_owner' => array('type' => 'int','precision' => '4','nullable' => False),
1569
-			'cal_category' => array('type' => 'varchar','precision' => '30'),
1570
-			'cal_modified' => array('type' => 'int','precision' => '8'),
1571
-			'cal_priority' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '2'),
1572
-			'cal_public' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '1'),
1573
-			'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'),
1566
+			'cal_id' => array('type' => 'auto', 'nullable' => False),
1567
+			'cal_uid' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False),
1568
+			'cal_owner' => array('type' => 'int', 'precision' => '4', 'nullable' => False),
1569
+			'cal_category' => array('type' => 'varchar', 'precision' => '30'),
1570
+			'cal_modified' => array('type' => 'int', 'precision' => '8'),
1571
+			'cal_priority' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '2'),
1572
+			'cal_public' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '1'),
1573
+			'cal_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '1'),
1574 1574
 			'cal_description' => array('type' => 'text'),
1575
-			'cal_location' => array('type' => 'varchar','precision' => '255'),
1576
-			'cal_reference' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
1577
-			'cal_modifier' => array('type' => 'int','precision' => '4'),
1578
-			'cal_non_blocking' => array('type' => 'int','precision' => '2','default' => '0'),
1579
-			'cal_special' => array('type' => 'int','precision' => '2','default' => '0'),
1580
-			'cal_etag' => array('type' => 'int','precision' => '4')
1575
+			'cal_location' => array('type' => 'varchar', 'precision' => '255'),
1576
+			'cal_reference' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'default' => '0'),
1577
+			'cal_modifier' => array('type' => 'int', 'precision' => '4'),
1578
+			'cal_non_blocking' => array('type' => 'int', 'precision' => '2', 'default' => '0'),
1579
+			'cal_special' => array('type' => 'int', 'precision' => '2', 'default' => '0'),
1580
+			'cal_etag' => array('type' => 'int', 'precision' => '4')
1581 1581
 		),
1582 1582
 		'pk' => array('cal_id'),
1583 1583
 		'fk' => array(),
1584 1584
 		'ix' => array(),
1585 1585
 		'uc' => array()
1586
-	),'cal_edit_time');
1587
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_etag',array(
1586
+	), 'cal_edit_time');
1587
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_etag', array(
1588 1588
 		'type' => 'int',
1589 1589
 		'precision' => '4',
1590 1590
 		'default' => '0'
1591 1591
 	));
1592
-	$GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_etag=0 WHERE cal_etag IS NULL',__LINE__,__FILE__);
1592
+	$GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_etag=0 WHERE cal_etag IS NULL', __LINE__, __FILE__);
1593 1593
 
1594 1594
 	return $GLOBALS['setup_info']['calendar']['currentver'] = '1.5.001';
1595 1595
 }
@@ -1597,12 +1597,12 @@  discard block
 block discarded – undo
1597 1597
 
1598 1598
 function calendar_upgrade1_5_001()
1599 1599
 {
1600
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_id',array(
1600
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_id', array(
1601 1601
 		'type' => 'int',
1602 1602
 		'precision' => '4',
1603 1603
 		'nullable' => False
1604 1604
 	));
1605
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_user_id',array(
1605
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_user_id', array(
1606 1606
 		'type' => 'varchar',
1607 1607
 		'precision' => '128',
1608 1608
 		'nullable' => False
@@ -1616,12 +1616,12 @@  discard block
 block discarded – undo
1616 1616
 {
1617 1617
 	// update the alarm methods
1618 1618
 	$async = new asyncservice();
1619
-	foreach((array)$async->read('cal:%') as $job)
1619
+	foreach ((array)$async->read('cal:%') as $job)
1620 1620
 	{
1621 1621
 		if ($job['method'] == 'calendar.bocalupdate.send_alarm')
1622 1622
 		{
1623 1623
 			$job['method'] = 'calendar.calendar_boupdate.send_alarm';
1624
-			$async->write($job,true);
1624
+			$async->write($job, true);
1625 1625
 		}
1626 1626
 	}
1627 1627
 	return $GLOBALS['setup_info']['calendar']['currentver'] = '1.6';
@@ -1638,48 +1638,48 @@  discard block
 block discarded – undo
1638 1638
 {
1639 1639
 	// Set UID of series exception to UID of series master
1640 1640
 	// update cal_etag, cal_modified and cal_modifier to distribute changes on GroupDAV devices
1641
-	foreach($GLOBALS['egw_setup']->db->query('
1641
+	foreach ($GLOBALS['egw_setup']->db->query('
1642 1642
 		SELECT cal_ex.cal_id,cal_ex.cal_uid AS cal_uid_ex,cal_master.cal_uid AS cal_uid_master
1643 1643
 		FROM egw_cal cal_ex
1644 1644
 		JOIN egw_cal cal_master ON cal_ex.cal_reference=cal_master.cal_id
1645
-		WHERE cal_ex.cal_reference != 0',__LINE__,__FILE__) as $row)
1645
+		WHERE cal_ex.cal_reference != 0',__LINE__, __FILE__) as $row)
1646 1646
 	{
1647 1647
 		if (strlen($row['cal_uid_master']) > 0 && $row['cal_uid_ex'] != $row['cal_uid_master'])
1648 1648
 		{
1649 1649
 			$GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_uid=\''.$row['cal_uid_master'].
1650 1650
 				'\',cal_etag=cal_etag+1,cal_modified='.time().
1651
-				',cal_modifier=NULL WHERE cal_id='.(int)$row['cal_id'],__LINE__,__FILE__);
1651
+				',cal_modifier=NULL WHERE cal_id='.(int)$row['cal_id'], __LINE__, __FILE__);
1652 1652
 		}
1653 1653
 	}
1654 1654
 
1655 1655
 	// Search series exception for nearest exception in series master and add that RECURRENCE-ID
1656 1656
 	// as cal_reference (for 1.6.003 and move it to new field cal_recurrence in 1.7.001)
1657 1657
 	$diff = null;
1658
-	foreach($GLOBALS['egw_setup']->db->query('SELECT egw_cal.cal_id,cal_start,recur_exception FROM egw_cal
1658
+	foreach ($GLOBALS['egw_setup']->db->query('SELECT egw_cal.cal_id,cal_start,recur_exception FROM egw_cal
1659 1659
 		JOIN egw_cal_dates ON egw_cal.cal_id=egw_cal_dates.cal_id
1660 1660
 		JOIN egw_cal_repeats ON cal_reference=egw_cal_repeats.cal_id
1661
-		WHERE cal_reference != 0',__LINE__,__FILE__) as $row)
1661
+		WHERE cal_reference != 0',__LINE__, __FILE__) as $row)
1662 1662
 	{
1663 1663
 		$recurrence = null;
1664
-		foreach(explode(',',$row['recur_exception']) as $ts)
1664
+		foreach (explode(',', $row['recur_exception']) as $ts)
1665 1665
 		{
1666
-			if (is_null($recurrence) || abs($ts-$row['cal_start']) < $diff)
1666
+			if (is_null($recurrence) || abs($ts - $row['cal_start']) < $diff)
1667 1667
 			{
1668 1668
 				$recurrence = $ts;
1669
-				$diff = abs($ts-$row['cal_start']);
1669
+				$diff = abs($ts - $row['cal_start']);
1670 1670
 			}
1671 1671
 		}
1672 1672
 		if ($recurrence)
1673 1673
 		{
1674 1674
 			$GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_reference='.(int)$recurrence.
1675
-				' WHERE cal_id='.(int)$row['cal_id'],__LINE__,__FILE__);
1675
+				' WHERE cal_id='.(int)$row['cal_id'], __LINE__, __FILE__);
1676 1676
 		}
1677 1677
 		else
1678 1678
 		{
1679 1679
 			// if we cannot determine the RECURRENCE-ID use cal_start
1680 1680
 			// because RECURRENCE-ID must be present
1681 1681
 			$GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_reference='.(int)$row['cal_start'].
1682
-				' WHERE cal_id='.(int)$row['cal_id'],__LINE__,__FILE__);
1682
+				' WHERE cal_id='.(int)$row['cal_id'], __LINE__, __FILE__);
1683 1683
 		}
1684 1684
 	}
1685 1685
 
@@ -1694,33 +1694,33 @@  discard block
 block discarded – undo
1694 1694
  */
1695 1695
 function calendar_upgrade1_6_003()
1696 1696
 {
1697
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_creator',array(
1697
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_creator', array(
1698 1698
 		'type' => 'int',
1699 1699
 		'precision' => '4',
1700 1700
 		'comment' => 'creating user'
1701 1701
 	));
1702
-	$GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_creator=cal_owner',__LINE__,__FILE__);
1703
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_creator',array(
1702
+	$GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_creator=cal_owner', __LINE__, __FILE__);
1703
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_creator', array(
1704 1704
 		'type' => 'int',
1705 1705
 		'precision' => '4',
1706 1706
 		'nullable' => False,
1707 1707
 		'comment' => 'creating user'
1708 1708
 	));
1709 1709
 
1710
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_created',array(
1710
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_created', array(
1711 1711
 		'type' => 'int',
1712 1712
 		'precision' => '8',
1713 1713
 		'comment' => 'creation time of event'
1714 1714
 	));
1715
-	$GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_created=cal_modified',__LINE__,__FILE__);
1716
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_created',array(
1715
+	$GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_created=cal_modified', __LINE__, __FILE__);
1716
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_created', array(
1717 1717
 		'type' => 'int',
1718 1718
 		'precision' => '8',
1719 1719
 		'nullable' => False,
1720 1720
 		'comment' => 'creation time of event'
1721 1721
 	));
1722 1722
 
1723
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_recurrence',array(
1723
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_recurrence', array(
1724 1724
 		'type' => 'int',
1725 1725
 		'precision' => '8',
1726 1726
 		'nullable' => False,
@@ -1731,14 +1731,14 @@  discard block
 block discarded – undo
1731 1731
 	// move RECURRENCE-ID from temporarily (1.6.003)
1732 1732
 	// used field cal_reference to new field cal_recurrence
1733 1733
 	// and restore cal_reference field of series exceptions with id of the series master
1734
-	foreach($GLOBALS['egw_setup']->db->query('
1734
+	foreach ($GLOBALS['egw_setup']->db->query('
1735 1735
 		SELECT cal_ex.cal_id AS cal_id_ex,cal_master.cal_id AS cal_id_master,
1736 1736
 		cal_ex.cal_reference AS cal_reference_ex,cal_ex.cal_uid AS cal_uid_ex,
1737 1737
 		cal_master.cal_uid AS cal_uid_master
1738 1738
 		FROM egw_cal cal_ex
1739 1739
 		JOIN egw_cal cal_master
1740 1740
 		ON cal_ex.cal_uid=cal_master.cal_uid AND cal_master.cal_reference = 0 AND cal_ex.cal_owner = cal_master.cal_owner
1741
-		WHERE cal_ex.cal_reference !=0 AND cal_master.cal_id IS NOT NULL',__LINE__,__FILE__) as $row)
1741
+		WHERE cal_ex.cal_reference !=0 AND cal_master.cal_id IS NOT NULL',__LINE__, __FILE__) as $row)
1742 1742
 	{
1743 1743
 		$GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_recurrence='.(int)$row['cal_reference_ex'].
1744 1744
 			', cal_reference='.(int)$row['cal_id_master'].
@@ -1755,7 +1755,7 @@  discard block
 block discarded – undo
1755 1755
  */
1756 1756
 function calendar_upgrade1_7_001()
1757 1757
 {
1758
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user','cal_role',array(
1758
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user', 'cal_role', array(
1759 1759
 		'type' => 'varchar',
1760 1760
 		'precision' => '64',
1761 1761
 		'default' => 'REQ-PARTICIPANT'
@@ -1771,14 +1771,14 @@  discard block
 block discarded – undo
1771 1771
  */
1772 1772
 function calendar_upgrade1_7_002()
1773 1773
 {
1774
-	$GLOBALS['egw_setup']->oProc->CreateTable('egw_cal_timezones',array(
1774
+	$GLOBALS['egw_setup']->oProc->CreateTable('egw_cal_timezones', array(
1775 1775
 		'fd' => array(
1776
-			'tz_id' => array('type' => 'auto','nullable' => False),
1777
-			'tz_tzid' => array('type' => 'varchar','precision' => '128','nullable' => False),
1778
-			'tz_alias' => array('type' => 'int','precision' => '4','comment' => 'tz_id for data'),
1779
-			'tz_latitude' => array('type' => 'int','precision' => '4'),
1780
-			'tz_longitude' => array('type' => 'int','precision' => '4'),
1781
-			'tz_component' => array('type' => 'text','comment' => 'iCal VTIMEZONE component')
1776
+			'tz_id' => array('type' => 'auto', 'nullable' => False),
1777
+			'tz_tzid' => array('type' => 'varchar', 'precision' => '128', 'nullable' => False),
1778
+			'tz_alias' => array('type' => 'int', 'precision' => '4', 'comment' => 'tz_id for data'),
1779
+			'tz_latitude' => array('type' => 'int', 'precision' => '4'),
1780
+			'tz_longitude' => array('type' => 'int', 'precision' => '4'),
1781
+			'tz_component' => array('type' => 'text', 'comment' => 'iCal VTIMEZONE component')
1782 1782
 		),
1783 1783
 		'pk' => array('tz_id'),
1784 1784
 		'fk' => array(),
@@ -1798,38 +1798,38 @@  discard block
 block discarded – undo
1798 1798
  */
1799 1799
 function calendar_upgrade1_7_003()
1800 1800
 {
1801
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_user_type',array(
1801
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_user_type', array(
1802 1802
 		'type' => 'varchar',
1803 1803
 		'precision' => '1',
1804 1804
 		'nullable' => False,
1805 1805
 		'default' => 'u',
1806 1806
 		'comment' => 'u=user, g=group, c=contact, r=resource, e=email'
1807 1807
 	));
1808
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_user_id',array(
1808
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_user_id', array(
1809 1809
 		'type' => 'varchar',
1810 1810
 		'precision' => '128',
1811 1811
 		'nullable' => False,
1812 1812
 		'comment' => 'id or email-address for type=e'
1813 1813
 	));
1814
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_status',array(
1814
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_status', array(
1815 1815
 		'type' => 'char',
1816 1816
 		'precision' => '1',
1817 1817
 		'default' => 'A',
1818 1818
 		'comment' => 'U=unknown, A=accepted, R=rejected, T=tentative'
1819 1819
 	));
1820
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_quantity',array(
1820
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_quantity', array(
1821 1821
 		'type' => 'int',
1822 1822
 		'precision' => '4',
1823 1823
 		'default' => '1',
1824 1824
 		'comment' => 'only for certain types (eg. resources)'
1825 1825
 	));
1826
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_role',array(
1826
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_role', array(
1827 1827
 		'type' => 'varchar',
1828 1828
 		'precision' => '64',
1829 1829
 		'default' => 'REQ-PARTICIPANT',
1830 1830
 		'comment' => 'CHAIR, REQ-PARTICIPANT, OPT-PARTICIPANT, NON-PARTICIPANT, X-CAT-$cat_id'
1831 1831
 	));
1832
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user','cal_user_modified',array(
1832
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user', 'cal_user_modified', array(
1833 1833
 		'type' => 'timestamp',
1834 1834
 		'default' => 'current_timestamp',
1835 1835
 		'comment' => 'automatic timestamp of last update'
@@ -1845,19 +1845,19 @@  discard block
 block discarded – undo
1845 1845
  */
1846 1846
 function calendar_upgrade1_7_004()
1847 1847
 {
1848
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_dates','cal_start',array(
1848
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_dates', 'cal_start', array(
1849 1849
 		'type' => 'int',
1850 1850
 		'precision' => '8',
1851 1851
 		'nullable' => False,
1852 1852
 		'comment' => 'starttime in server time'
1853 1853
 	));
1854
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_dates','cal_end',array(
1854
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_dates', 'cal_end', array(
1855 1855
 		'type' => 'int',
1856 1856
 		'precision' => '8',
1857 1857
 		'nullable' => False,
1858 1858
 		'comment' => 'endtime in server time'
1859 1859
 	));
1860
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','tz_id',array(
1860
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'tz_id', array(
1861 1861
 		'type' => 'int',
1862 1862
 		'precision' => '4',
1863 1863
 		'comment' => 'key into egw_cal_timezones'
@@ -1866,7 +1866,7 @@  discard block
 block discarded – undo
1866 1866
 	// set id of server timezone for existing events, as that's the timezone their recurrences are using
1867 1867
 	if (($tzid = date_default_timezone_get()) && ($tz_id = calendar_timezones::tz2id($tzid)))
1868 1868
 	{
1869
-		$GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET tz_id='.(int)$tz_id,__LINE__,__FILE__);
1869
+		$GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET tz_id='.(int)$tz_id, __LINE__, __FILE__);
1870 1870
 	}
1871 1871
 	return $GLOBALS['setup_info']['calendar']['currentver'] = '1.7.005';
1872 1872
 }
@@ -1893,22 +1893,22 @@  discard block
 block discarded – undo
1893 1893
  */
1894 1894
 function calendar_upgrade1_7_006()
1895 1895
 {
1896
-	foreach($GLOBALS['egw_setup']->db->query('SELECT * FROM egw_cal_dates
1897
-		WHERE (cal_end-cal_start)%86400=86340',__LINE__,__FILE__) as $row)
1896
+	foreach ($GLOBALS['egw_setup']->db->query('SELECT * FROM egw_cal_dates
1897
+		WHERE (cal_end-cal_start)%86400=86340',__LINE__, __FILE__) as $row)
1898 1898
 	{
1899 1899
 		$GLOBALS['egw_setup']->db->query('UPDATE egw_cal_dates SET cal_end=cal_end+59
1900
-			WHERE cal_id='.(int)$row['cal_id'].' AND cal_start='.(int)$row['cal_start'],__LINE__,__FILE__);
1900
+			WHERE cal_id='.(int)$row['cal_id'].' AND cal_start='.(int)$row['cal_start'], __LINE__, __FILE__);
1901 1901
 	}
1902 1902
 
1903
-	foreach($GLOBALS['egw_setup']->db->query('SELECT * FROM egw_cal_dates
1904
-		WHERE cal_end-cal_start>0 AND (cal_end-cal_start)%86400=0',__LINE__,__FILE__) as $row)
1903
+	foreach ($GLOBALS['egw_setup']->db->query('SELECT * FROM egw_cal_dates
1904
+		WHERE cal_end-cal_start>0 AND (cal_end-cal_start)%86400=0',__LINE__, __FILE__) as $row)
1905 1905
 	{
1906 1906
 		$GLOBALS['egw_setup']->db->query('UPDATE egw_cal_dates SET cal_end=cal_end-1
1907
-			WHERE cal_id='.(int)$row['cal_id'].' AND cal_start='.(int)$row['cal_start'],__LINE__,__FILE__);
1907
+			WHERE cal_id='.(int)$row['cal_id'].' AND cal_start='.(int)$row['cal_start'], __LINE__, __FILE__);
1908 1908
 	}
1909 1909
 
1910 1910
     $GLOBALS['egw_setup']->db->query('UPDATE egw_cal_repeats SET recur_interval=1
1911
-			WHERE recur_interval=0',__LINE__,__FILE__);
1911
+			WHERE recur_interval=0',__LINE__, __FILE__);
1912 1912
 
1913 1913
 	return $GLOBALS['setup_info']['calendar']['currentver'] = '1.7.007';
1914 1914
 }
@@ -1924,17 +1924,17 @@  discard block
 block discarded – undo
1924 1924
 {
1925 1925
 	// Set UID of series exception to UID of series master
1926 1926
 	// update cal_etag,cal_modified and cal_modifier to distribute changes on GroupDAV devices
1927
-	foreach($GLOBALS['egw_setup']->db->query('
1927
+	foreach ($GLOBALS['egw_setup']->db->query('
1928 1928
 		SELECT cal_ex.cal_id,cal_ex.cal_uid AS cal_uid_ex,cal_master.cal_uid AS cal_uid_master
1929 1929
 		FROM egw_cal cal_ex
1930 1930
 		JOIN egw_cal cal_master ON cal_ex.cal_reference=cal_master.cal_id
1931
-		WHERE cal_ex.cal_reference != 0',__LINE__,__FILE__) as $row)
1931
+		WHERE cal_ex.cal_reference != 0',__LINE__, __FILE__) as $row)
1932 1932
 	{
1933 1933
 		if (strlen($row['cal_uid_master']) > 0 && $row['cal_uid_ex'] != $row['cal_uid_master'])
1934 1934
 		{
1935 1935
 			$GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_uid=\''.$row['cal_uid_master'].
1936 1936
 				'\',cal_etag=cal_etag+1,cal_modified='.time().
1937
-				',cal_modifier=NULL WHERE cal_id='.(int)$row['cal_id'],__LINE__,__FILE__);
1937
+				',cal_modifier=NULL WHERE cal_id='.(int)$row['cal_id'], __LINE__, __FILE__);
1938 1938
 		}
1939 1939
 	}
1940 1940
 	return $GLOBALS['setup_info']['calendar']['currentver'] = '1.7.008';
@@ -1947,7 +1947,7 @@  discard block
 block discarded – undo
1947 1947
  */
1948 1948
 function calendar_upgrade1_7_008()
1949 1949
 {
1950
-	$GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal_user',array('cal_user_type','cal_user_id'));
1950
+	$GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal_user', array('cal_user_type', 'cal_user_id'));
1951 1951
 
1952 1952
 	return $GLOBALS['setup_info']['calendar']['currentver'] = '1.7.009';
1953 1953
 }
@@ -1959,22 +1959,22 @@  discard block
 block discarded – undo
1959 1959
  */
1960 1960
 function calendar_upgrade1_7_009()
1961 1961
 {
1962
-	$GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal','cal_uid');
1963
-	$GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal','cal_owner');
1962
+	$GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal', 'cal_uid');
1963
+	$GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal', 'cal_owner');
1964 1964
 
1965 1965
 	return $GLOBALS['setup_info']['calendar']['currentver'] = '1.7.010';
1966 1966
 }
1967 1967
 
1968 1968
 function calendar_upgrade1_7_010()
1969 1969
 {
1970
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_deleted',array(
1970
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_deleted', array(
1971 1971
 		'type' => 'bool',
1972 1972
 		'nullable' => False,
1973 1973
 		'default' => '0',
1974 1974
 		'comment' => '1 if the event has been deleted, but you want to keep it around'
1975 1975
 	));
1976 1976
 
1977
-	return $GLOBALS['setup_info']['calendar']['currentver'] = '1.9.001';	// was 1.7.011
1977
+	return $GLOBALS['setup_info']['calendar']['currentver'] = '1.9.001'; // was 1.7.011
1978 1978
 }
1979 1979
 
1980 1980
 function calendar_upgrade1_7_011()
@@ -1999,7 +1999,7 @@  discard block
 block discarded – undo
1999 1999
 function calendar_upgrade1_9_001()
2000 2000
 {
2001 2001
 	// delete in the past wrongly created entries for a single recurrence, which mess up the update, beside being wrong anyway
2002
-	$GLOBALS['egw_setup']->db->delete('egw_api_content_history',array(
2002
+	$GLOBALS['egw_setup']->db->delete('egw_api_content_history', array(
2003 2003
 		'sync_appname' => 'calendar',
2004 2004
 		"sync_contentid LIKE '%:%'",
2005 2005
 	), __LINE__, __FILE__);
@@ -2010,36 +2010,36 @@  discard block
 block discarded – undo
2010 2010
 		'precision' => '8',
2011 2011
 		'comment' => 'ts when event was deleted'
2012 2012
 	));*/
2013
-	$GLOBALS['egw_setup']->oProc->RefreshTable('egw_cal',array(
2013
+	$GLOBALS['egw_setup']->oProc->RefreshTable('egw_cal', array(
2014 2014
 		'fd' => array(
2015
-			'cal_id' => array('type' => 'auto','nullable' => False),
2016
-			'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False,'comment' => 'unique id of event(-series)'),
2017
-			'cal_owner' => array('type' => 'int','precision' => '4','nullable' => False,'comment' => 'event owner / calendar'),
2018
-			'cal_category' => array('type' => 'varchar','precision' => '30','comment' => 'category id'),
2019
-			'cal_modified' => array('type' => 'int','precision' => '8','comment' => 'ts of last modification'),
2020
-			'cal_priority' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '2'),
2021
-			'cal_public' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '1','comment' => '1=public, 0=private event'),
2022
-			'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'),
2015
+			'cal_id' => array('type' => 'auto', 'nullable' => False),
2016
+			'cal_uid' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'comment' => 'unique id of event(-series)'),
2017
+			'cal_owner' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'comment' => 'event owner / calendar'),
2018
+			'cal_category' => array('type' => 'varchar', 'precision' => '30', 'comment' => 'category id'),
2019
+			'cal_modified' => array('type' => 'int', 'precision' => '8', 'comment' => 'ts of last modification'),
2020
+			'cal_priority' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '2'),
2021
+			'cal_public' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '1', 'comment' => '1=public, 0=private event'),
2022
+			'cal_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '1'),
2023 2023
 			'cal_description' => array('type' => 'text'),
2024
-			'cal_location' => array('type' => 'varchar','precision' => '255'),
2025
-			'cal_reference' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0','comment' => 'cal_id of series for exception'),
2026
-			'cal_modifier' => array('type' => 'int','precision' => '4','comment' => 'user who last modified event'),
2027
-			'cal_non_blocking' => array('type' => 'int','precision' => '2','default' => '0','comment' => '1 for non-blocking events'),
2028
-			'cal_special' => array('type' => 'int','precision' => '2','default' => '0'),
2029
-			'cal_etag' => array('type' => 'int','precision' => '4','default' => '0','comment' => 'etag for optimistic locking'),
2030
-			'cal_creator' => array('type' => 'int','precision' => '4','nullable' => False,'comment' => 'creating user'),
2031
-			'cal_created' => array('type' => 'int','precision' => '8','nullable' => False,'comment' => 'creation time of event'),
2032
-			'cal_recurrence' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0','comment' => 'cal_start of original recurrence for exception'),
2033
-			'tz_id' => array('type' => 'int','precision' => '4','comment' => 'key into egw_cal_timezones'),
2034
-			'cal_deleted' => array('type' => 'int','precision' => '8','comment' => 'ts when event was deleted')
2024
+			'cal_location' => array('type' => 'varchar', 'precision' => '255'),
2025
+			'cal_reference' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'default' => '0', 'comment' => 'cal_id of series for exception'),
2026
+			'cal_modifier' => array('type' => 'int', 'precision' => '4', 'comment' => 'user who last modified event'),
2027
+			'cal_non_blocking' => array('type' => 'int', 'precision' => '2', 'default' => '0', 'comment' => '1 for non-blocking events'),
2028
+			'cal_special' => array('type' => 'int', 'precision' => '2', 'default' => '0'),
2029
+			'cal_etag' => array('type' => 'int', 'precision' => '4', 'default' => '0', 'comment' => 'etag for optimistic locking'),
2030
+			'cal_creator' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'comment' => 'creating user'),
2031
+			'cal_created' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'comment' => 'creation time of event'),
2032
+			'cal_recurrence' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0', 'comment' => 'cal_start of original recurrence for exception'),
2033
+			'tz_id' => array('type' => 'int', 'precision' => '4', 'comment' => 'key into egw_cal_timezones'),
2034
+			'cal_deleted' => array('type' => 'int', 'precision' => '8', 'comment' => 'ts when event was deleted')
2035 2035
 		),
2036 2036
 		'pk' => array('cal_id'),
2037 2037
 		'fk' => array(),
2038
-		'ix' => array('cal_uid','cal_owner','cal_deleted'),
2038
+		'ix' => array('cal_uid', 'cal_owner', 'cal_deleted'),
2039 2039
 		'uc' => array()
2040
-	),array(
2040
+	), array(
2041 2041
 		// for deleted rows use cal_modified as deleted date, NULL for not deleted ones
2042
-		'cal_deleted' => 'CASE cal_deleted WHEN '.$GLOBALS['egw_setup']->db->quote(true,'bool').' THEN cal_modified ELSE NULL END',
2042
+		'cal_deleted' => 'CASE cal_deleted WHEN '.$GLOBALS['egw_setup']->db->quote(true, 'bool').' THEN cal_modified ELSE NULL END',
2043 2043
 	));
2044 2044
 
2045 2045
 	return $GLOBALS['setup_info']['calendar']['currentver'] = '1.9.002';
@@ -2051,16 +2051,16 @@  discard block
 block discarded – undo
2051 2051
  */
2052 2052
 function calendar_upgrade1_9_002()
2053 2053
 {
2054
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','caldav_name',array(
2054
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'caldav_name', array(
2055 2055
 		'type' => 'varchar',
2056 2056
 		'precision' => '64',
2057 2057
 		'comment' => 'name part of CalDAV URL, if specified by client'
2058 2058
 	));
2059
-	$GLOBALS['egw_setup']->db->query($sql='UPDATE egw_cal SET caldav_name='.
2059
+	$GLOBALS['egw_setup']->db->query($sql = 'UPDATE egw_cal SET caldav_name='.
2060 2060
 		$GLOBALS['egw_setup']->db->concat(
2061
-			$GLOBALS['egw_setup']->db->to_varchar('cal_id'),"'.ics'"),__LINE__,__FILE__);
2061
+			$GLOBALS['egw_setup']->db->to_varchar('cal_id'), "'.ics'"), __LINE__, __FILE__);
2062 2062
 
2063
-	$GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal','caldav_name');
2063
+	$GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal', 'caldav_name');
2064 2064
 
2065 2065
 	return $GLOBALS['setup_info']['calendar']['currentver'] = '1.9.003';
2066 2066
 }
@@ -2071,8 +2071,8 @@  discard block
 block discarded – undo
2071 2071
  */
2072 2072
 function calendar_upgrade1_9_003()
2073 2073
 {
2074
-	$GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal','cal_modified');
2075
-	$GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal_user','cal_user_modified');
2074
+	$GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal', 'cal_modified');
2075
+	$GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal_user', 'cal_user_modified');
2076 2076
 
2077 2077
 	return $GLOBALS['setup_info']['calendar']['currentver'] = '1.9.004';
2078 2078
 }
@@ -2084,7 +2084,7 @@  discard block
 block discarded – undo
2084 2084
  */
2085 2085
 function calendar_upgrade1_9_004()
2086 2086
 {
2087
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_dates','recur_exception',array(
2087
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_dates', 'recur_exception', array(
2088 2088
 		'type' => 'bool',
2089 2089
 		'default' => '',
2090 2090
 		'null' => false,
@@ -2092,16 +2092,16 @@  discard block
 block discarded – undo
2092 2092
 	));
2093 2093
 
2094 2094
 	// migrate existing exceptions to egw_cal_dates
2095
-	foreach($GLOBALS['egw_setup']->db->select('egw_cal_repeats',
2095
+	foreach ($GLOBALS['egw_setup']->db->select('egw_cal_repeats',
2096 2096
 		'egw_cal_repeats.cal_id AS cal_id,egw_cal_repeats.recur_exception AS recur_exception,MIN(cal_start) AS cal_start,MIN(cal_end) AS cal_end',
2097 2097
 		'egw_cal_repeats.recur_exception IS NOT NULL', __LINE__, __FILE__, false,
2098 2098
 		'GROUP BY egw_cal_repeats.cal_id,egw_cal_repeats.recur_exception', 'calendar', '',
2099 2099
 		'JOIN egw_cal_dates ON egw_cal_repeats.cal_id=egw_cal_dates.cal_id') as $row)
2100 2100
 	{
2101
-		foreach($row['recur_exception'] ? array_unique(explode(',', $row['recur_exception'])) : array() as $recur_exception)
2101
+		foreach ($row['recur_exception'] ? array_unique(explode(',', $row['recur_exception'])) : array() as $recur_exception)
2102 2102
 		{
2103 2103
 			$GLOBALS['egw_setup']->db->insert('egw_cal_dates', array(
2104
-				'cal_end' => $recur_exception+$row['cal_end']-$row['cal_start'],
2104
+				'cal_end' => $recur_exception + $row['cal_end'] - $row['cal_start'],
2105 2105
 				'recur_exception' => true,
2106 2106
 			), array(
2107 2107
 				'cal_id' => $row['cal_id'],
@@ -2113,11 +2113,11 @@  discard block
 block discarded – undo
2113 2113
 
2114 2114
 	$GLOBALS['egw_setup']->oProc->DropColumn('egw_cal_repeats', array(
2115 2115
 		'fd' => array(
2116
-			'cal_id' => array('type' => 'int','precision' => '4','nullable' => False),
2117
-			'recur_type' => array('type' => 'int','precision' => '2','nullable' => False),
2118
-			'recur_enddate' => array('type' => 'int','precision' => '8'),
2119
-			'recur_interval' => array('type' => 'int','precision' => '2','default' => '1'),
2120
-			'recur_data' => array('type' => 'int','precision' => '2','default' => '1'),
2116
+			'cal_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False),
2117
+			'recur_type' => array('type' => 'int', 'precision' => '2', 'nullable' => False),
2118
+			'recur_enddate' => array('type' => 'int', 'precision' => '8'),
2119
+			'recur_interval' => array('type' => 'int', 'precision' => '2', 'default' => '1'),
2120
+			'recur_data' => array('type' => 'int', 'precision' => '2', 'default' => '1'),
2121 2121
 		),
2122 2122
 		'pk' => array('cal_id'),
2123 2123
 		'fk' => array(),
@@ -2138,19 +2138,19 @@  discard block
 block discarded – undo
2138 2138
 	// returns NULL, if there are no rows!
2139 2139
 	if ((int)$max_description_length <= 16384 && $GLOBALS['egw_setup']->oProc->max_varchar_length >= 16384)
2140 2140
 	{
2141
-		$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_description',array(
2141
+		$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_description', array(
2142 2142
 			'type' => 'varchar',
2143 2143
 			'precision' => '16384'
2144 2144
 		));
2145 2145
 	}
2146 2146
 	// allow more categories
2147
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_category',array(
2147
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_category', array(
2148 2148
 		'type' => 'varchar',
2149 2149
 		'precision' => '64',
2150 2150
 		'comment' => 'category id(s)'
2151 2151
 	));
2152 2152
 	// remove silly default of 1
2153
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_title',array(
2153
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_title', array(
2154 2154
 		'type' => 'varchar',
2155 2155
 		'precision' => '255',
2156 2156
 		'nullable' => False
@@ -2165,14 +2165,14 @@  discard block
 block discarded – undo
2165 2165
 {
2166 2166
 	// PostgreSQL needs temporary a nullable column, to not stall on broken events without dates!
2167 2167
 	// We add that constrain in 1.9.007, after deleting all rows with range_start=0 OR range_start IS NULL
2168
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','range_start',array(
2168
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'range_start', array(
2169 2169
 		'type' => 'int',
2170 2170
 		'precision' => '8',
2171 2171
 		'comment' => 'startdate (of range)'
2172 2172
 	));
2173 2173
 	$GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET range_start = (SELECT MIN(cal_start) FROM egw_cal_dates WHERE egw_cal_dates.cal_id=egw_cal.cal_id)', __LINE__, __FILE__);
2174 2174
 
2175
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','range_end',array(
2175
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'range_end', array(
2176 2176
 		'type' => 'int',
2177 2177
 		'precision' => '8',
2178 2178
 		'comment' => 'enddate (of range, UNTIL of RRULE)'
@@ -2188,18 +2188,18 @@  discard block
 block discarded – undo
2188 2188
 	{
2189 2189
 		$GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET range_end=recur_enddate FROM egw_cal_repeats WHERE egw_cal.cal_id=egw_cal_repeats.cal_id', __LINE__, __FILE__);
2190 2190
 	}
2191
-	$GLOBALS['egw_setup']->oProc->DropColumn('egw_cal_repeats',array(
2191
+	$GLOBALS['egw_setup']->oProc->DropColumn('egw_cal_repeats', array(
2192 2192
 		'fd' => array(
2193
-			'cal_id' => array('type' => 'int','precision' => '4','nullable' => False),
2194
-			'recur_type' => array('type' => 'int','precision' => '2','nullable' => False),
2195
-			'recur_interval' => array('type' => 'int','precision' => '2','default' => '1'),
2196
-			'recur_data' => array('type' => 'int','precision' => '2','default' => '1')
2193
+			'cal_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False),
2194
+			'recur_type' => array('type' => 'int', 'precision' => '2', 'nullable' => False),
2195
+			'recur_interval' => array('type' => 'int', 'precision' => '2', 'default' => '1'),
2196
+			'recur_data' => array('type' => 'int', 'precision' => '2', 'default' => '1')
2197 2197
 		),
2198 2198
 		'pk' => array('cal_id'),
2199 2199
 		'fk' => array(),
2200 2200
 		'ix' => array(),
2201 2201
 		'uc' => array()
2202
-	),'recur_enddate');
2202
+	), 'recur_enddate');
2203 2203
 
2204 2204
 	return $GLOBALS['setup_info']['calendar']['currentver'] = '1.9.007';
2205 2205
 }
@@ -2211,14 +2211,14 @@  discard block
 block discarded – undo
2211 2211
  */
2212 2212
 function calendar_upgrade1_9_007()
2213 2213
 {
2214
-	foreach(array('egw_cal_repeats','egw_cal_dates','egw_cal_user','egw_cal_extra') as $table)
2214
+	foreach (array('egw_cal_repeats', 'egw_cal_dates', 'egw_cal_user', 'egw_cal_extra') as $table)
2215 2215
 	{
2216 2216
 		$GLOBALS['egw_setup']->db->query("DELETE FROM $table WHERE cal_id IN (SELECT cal_id FROM egw_cal WHERE range_start=0 OR range_start IS NULL)", __LINE__, __FILE__);
2217 2217
 	}
2218 2218
 	$GLOBALS['egw_setup']->db->query("DELETE FROM egw_cal WHERE range_start=0 OR range_start IS NULL", __LINE__, __FILE__);
2219 2219
 
2220 2220
 	// now we can remove temporary default of 0 from range_start and set it NOT NULL
2221
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','range_start',array(
2221
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'range_start', array(
2222 2222
 		'type' => 'int',
2223 2223
 		'precision' => '8',
2224 2224
 		'nullable' => False,
@@ -2283,7 +2283,7 @@  discard block
 block discarded – undo
2283 2283
 
2284 2284
 function calendar_upgrade1_9_010()
2285 2285
 {
2286
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','caldav_name',array(
2286
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'caldav_name', array(
2287 2287
 		'type' => 'varchar',
2288 2288
 		'precision' => '200',
2289 2289
 		'comment' => 'name part of CalDAV URL, if specified by client'
@@ -2313,7 +2313,7 @@  discard block
 block discarded – undo
2313 2313
 SET cal_reference=0,cal_recurrence=0,cal_etag=cal_etag+1,cal_modifier=0,cal_modified=".time()."
2314 2314
 WHERE cal_reference != 0 AND cal_id IN (SELECT cal_id FROM egw_cal_repeats)", __LINE__, __FILE__);
2315 2315
 
2316
-	foreach($GLOBALS['egw_setup']->db->query(
2316
+	foreach ($GLOBALS['egw_setup']->db->query(
2317 2317
 "SELECT DISTINCT master.cal_id,egw_cal_user.cal_user_type,egw_cal_user.cal_user_id,'E' AS cal_status
2318 2318
 FROM egw_cal_user
2319 2319
 JOIN egw_cal ON egw_cal_user.cal_id=egw_cal.cal_id
@@ -2340,7 +2340,7 @@  discard block
 block discarded – undo
2340 2340
  */
2341 2341
 function calendar_upgrade14_1_001()
2342 2342
 {
2343
-	foreach($GLOBALS['egw_setup']->db->query(
2343
+	foreach ($GLOBALS['egw_setup']->db->query(
2344 2344
 "SELECT egw_cal.cal_id AS cal_id,cal_start,cal_end,range_start,range_end,egw_cal_repeats.*,tz_tzid AS tzid
2345 2345
 FROM egw_cal
2346 2346
 JOIN egw_cal_repeats ON egw_cal_repeats.cal_id=egw_cal.cal_id
@@ -2362,7 +2362,7 @@  discard block
 block discarded – undo
2362 2362
 		$enddate->modify(($event['end'] - $event['start']).' second');
2363 2363
 		if (($range_end = $enddate->format('server')) != $event['range_end'])
2364 2364
 		{
2365
-			$GLOBALS['egw_setup']->db->update('egw_cal',array(
2365
+			$GLOBALS['egw_setup']->db->update('egw_cal', array(
2366 2366
 				'range_end' => $range_end,
2367 2367
 				'cal_etag=cal_etag+1',
2368 2368
 				'cal_modified' => time(),
@@ -2372,7 +2372,7 @@  discard block
 block discarded – undo
2372 2372
 			//error_log(__FUNCTION__."() #$event[id], start=".date('Y-m-d H:i:s', $event['start']).', end='.date('Y-m-d H:i:s', $event['end']).', range_end='.date('Y-m-d H:i:s', $event['recur_enddate']).' --> '.date('Y-m-d H:i:s', $range_end));
2373 2373
 		}
2374 2374
 	}
2375
-	return $GLOBALS['setup_info']['calendar']['currentver'] = '14.2.002';	// skip 14.2.001 update, as query is fixed now
2375
+	return $GLOBALS['setup_info']['calendar']['currentver'] = '14.2.002'; // skip 14.2.001 update, as query is fixed now
2376 2376
 }
2377 2377
 
2378 2378
 /**
@@ -2396,7 +2396,7 @@  discard block
 block discarded – undo
2396 2396
 	// if maximum is bigger then 3
2397 2397
 	if ($values[1] > 3)
2398 2398
 	{
2399
-		switch($GLOBALS['egw_setup']->db->Type)
2399
+		switch ($GLOBALS['egw_setup']->db->Type)
2400 2400
 		{
2401 2401
 			case 'mysql':
2402 2402
 				$sql = "UPDATE egw_cal
@@ -2446,7 +2446,7 @@  discard block
 block discarded – undo
2446 2446
 
2447 2447
 function calendar_upgrade14_2_003()
2448 2448
 {
2449
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_uid',array(
2449
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_uid', array(
2450 2450
 		'type' => 'ascii',
2451 2451
 		'precision' => '128',
2452 2452
 		'nullable' => False,
@@ -2458,13 +2458,13 @@  discard block
 block discarded – undo
2458 2458
 	{
2459 2459
 		$GLOBALS['egw_setup']->db->query("UPDATE egw_cal SET cal_category='' WHERE cal_category NOT REGEXP '^[0-9,]*$'", __LINE__, __FILE__);
2460 2460
 	}
2461
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_category',array(
2461
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_category', array(
2462 2462
 		'type' => 'ascii',
2463 2463
 		'meta' => 'category',
2464 2464
 		'precision' => '64',
2465 2465
 		'comment' => 'category id(s)'
2466 2466
 	));
2467
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','caldav_name',array(
2467
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'caldav_name', array(
2468 2468
 		'type' => 'ascii',
2469 2469
 		'precision' => '128',
2470 2470
 		'comment' => 'name part of CalDAV URL, if specified by client'
@@ -2521,22 +2521,22 @@  discard block
 block discarded – undo
2521 2521
 		'type' => 'auto',
2522 2522
 		'nullable' => False
2523 2523
 	));*/
2524
-	$GLOBALS['egw_setup']->oProc->RefreshTable('egw_cal_user',array(
2524
+	$GLOBALS['egw_setup']->oProc->RefreshTable('egw_cal_user', array(
2525 2525
 		'fd' => array(
2526
-			'cal_id' => array('type' => 'int','precision' => '4','nullable' => False),
2527
-			'cal_recur_date' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False,'default' => '0'),
2528
-			'cal_user_type' => array('type' => 'ascii','precision' => '1','nullable' => False,'default' => 'u','comment' => 'u=user, g=group, c=contact, r=resource, e=email'),
2529
-			'cal_user_id' => array('type' => 'varchar','meta' => array("cal_user_type='u'" => 'account'),'precision' => '128','nullable' => False,'comment' => 'id or email-address for type=e'),
2530
-			'cal_status' => array('type' => 'ascii','precision' => '1','default' => 'A','comment' => 'U=unknown, A=accepted, R=rejected, T=tentative'),
2531
-			'cal_quantity' => array('type' => 'int','precision' => '4','default' => '1','comment' => 'only for certain types (eg. resources)'),
2532
-			'cal_role' => array('type' => 'ascii','precision' => '64','default' => 'REQ-PARTICIPANT','comment' => 'CHAIR, REQ-PARTICIPANT, OPT-PARTICIPANT, NON-PARTICIPANT, X-CAT-$cat_id'),
2533
-			'cal_user_modified' => array('type' => 'timestamp','default' => 'current_timestamp','comment' => 'automatic timestamp of last update'),
2534
-			'cal_user_auto' => array('type' => 'auto','nullable' => False)
2526
+			'cal_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False),
2527
+			'cal_recur_date' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'nullable' => False, 'default' => '0'),
2528
+			'cal_user_type' => array('type' => 'ascii', 'precision' => '1', 'nullable' => False, 'default' => 'u', 'comment' => 'u=user, g=group, c=contact, r=resource, e=email'),
2529
+			'cal_user_id' => array('type' => 'varchar', 'meta' => array("cal_user_type='u'" => 'account'), 'precision' => '128', 'nullable' => False, 'comment' => 'id or email-address for type=e'),
2530
+			'cal_status' => array('type' => 'ascii', 'precision' => '1', 'default' => 'A', 'comment' => 'U=unknown, A=accepted, R=rejected, T=tentative'),
2531
+			'cal_quantity' => array('type' => 'int', 'precision' => '4', 'default' => '1', 'comment' => 'only for certain types (eg. resources)'),
2532
+			'cal_role' => array('type' => 'ascii', 'precision' => '64', 'default' => 'REQ-PARTICIPANT', 'comment' => 'CHAIR, REQ-PARTICIPANT, OPT-PARTICIPANT, NON-PARTICIPANT, X-CAT-$cat_id'),
2533
+			'cal_user_modified' => array('type' => 'timestamp', 'default' => 'current_timestamp', 'comment' => 'automatic timestamp of last update'),
2534
+			'cal_user_auto' => array('type' => 'auto', 'nullable' => False)
2535 2535
 		),
2536 2536
 		'pk' => array('cal_user_auto'),
2537 2537
 		'fk' => array(),
2538
-		'ix' => array('cal_user_modified',array('cal_user_type','cal_user_id')),
2539
-		'uc' => array(array('cal_id','cal_recur_date','cal_user_type','cal_user_id'))
2538
+		'ix' => array('cal_user_modified', array('cal_user_type', 'cal_user_id')),
2539
+		'uc' => array(array('cal_id', 'cal_recur_date', 'cal_user_type', 'cal_user_id'))
2540 2540
 	));
2541 2541
 
2542 2542
 	return $GLOBALS['setup_info']['calendar']['currentver'] = '14.2.005';
@@ -2545,12 +2545,12 @@  discard block
 block discarded – undo
2545 2545
 
2546 2546
 function calendar_upgrade14_2_005()
2547 2547
 {
2548
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_timezones','tz_tzid',array(
2548
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_timezones', 'tz_tzid', array(
2549 2549
 		'type' => 'ascii',
2550 2550
 		'precision' => '128',
2551 2551
 		'nullable' => False
2552 2552
 	));
2553
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_timezones','tz_component',array(
2553
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_timezones', 'tz_component', array(
2554 2554
 		'type' => 'ascii',
2555 2555
 		'precision' => '8192',
2556 2556
 		'comment' => 'iCal VTIMEZONE component'
@@ -2566,7 +2566,7 @@  discard block
 block discarded – undo
2566 2566
  */
2567 2567
 function calendar_upgrade14_3()
2568 2568
 {
2569
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user','cal_user_attendee',array(
2569
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user', 'cal_user_attendee', array(
2570 2570
 		'type' => 'varchar',
2571 2571
 		'precision' => '255',
2572 2572
 		'comment' => 'email or json object with attr. cn, url, ...'
@@ -2577,12 +2577,12 @@  discard block
 block discarded – undo
2577 2577
 
2578 2578
 	// delete all but one row, which would give a doublicate key, after above normalising of email addresses
2579 2579
 	// by ordering by status we prever accepted over tentative over unknow over deleted
2580
-	foreach($GLOBALS['egw_setup']->db->select('egw_cal_user', "cal_id,cal_recur_date,$email AS email", array(
2580
+	foreach ($GLOBALS['egw_setup']->db->select('egw_cal_user', "cal_id,cal_recur_date,$email AS email", array(
2581 2581
 		'cal_user_type' => 'e',
2582 2582
 	), __LINE__, __FILE__, false, "GROUP BY cal_id,cal_recur_date,$email HAVING COUNT(*)>1", 'calendar') as $row)
2583 2583
 	{
2584 2584
 		$n = 0;
2585
-		foreach($GLOBALS['egw_setup']->db->select('egw_cal_user', "*,$email AS email", array(
2585
+		foreach ($GLOBALS['egw_setup']->db->select('egw_cal_user', "*,$email AS email", array(
2586 2586
 			'cal_id' => $row['cal_id'],
2587 2587
 			'cal_recur_date' => $row['cal_recur_date'],
2588 2588
 			'cal_user_type' => 'e',
@@ -2590,7 +2590,7 @@  discard block
 block discarded – undo
2590 2590
 		), __LINE__, __FILE__, false, 'ORDER BY cal_status', 'calendar') as $user)	// order A, T, U, X
2591 2591
 		{
2592 2592
 			if (strpos($user['email'], '@') !== false && !$n++) continue;
2593
-			$GLOBALS['egw_setup']->db->delete('egw_cal_user', array_intersect_key($user, array_flip(array('cal_id','cal_recur_date','cal_user_type','cal_user_id','cal_status'))));
2593
+			$GLOBALS['egw_setup']->db->delete('egw_cal_user', array_intersect_key($user, array_flip(array('cal_id', 'cal_recur_date', 'cal_user_type', 'cal_user_id', 'cal_status'))));
2594 2594
 		}
2595 2595
 	}
2596 2596
 
@@ -2599,7 +2599,7 @@  discard block
 block discarded – undo
2599 2599
 		"UPDATE egw_cal_user SET cal_user_attendee=cal_user_id,cal_user_id=MD5($email) WHERE cal_user_type='e'",
2600 2600
 		__LINE__, __FILE__);
2601 2601
 
2602
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_user_id',array(
2602
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_user_id', array(
2603 2603
 		'type' => 'ascii',
2604 2604
 		'meta' => array(
2605 2605
 			"cal_user_type='u'" => 'account'
@@ -2619,7 +2619,7 @@  discard block
 block discarded – undo
2619 2619
  */
2620 2620
 function calendar_upgrade14_3_001()
2621 2621
 {
2622
-	foreach($GLOBALS['egw_setup']->db->query("SELECT egw_cal_user.cal_id AS cal_id,egw_cal_user.cal_user_id AS cal_user_id,egw_cal_user.cal_user_attendee AS cal_user_attendee
2622
+	foreach ($GLOBALS['egw_setup']->db->query("SELECT egw_cal_user.cal_id AS cal_id,egw_cal_user.cal_user_id AS cal_user_id,egw_cal_user.cal_user_attendee AS cal_user_attendee
2623 2623
 FROM egw_cal_user
2624 2624
 JOIN egw_cal_user euser ON euser.cal_id=egw_cal_user.cal_id AND euser.cal_user_type='e' AND euser.cal_user_id=egw_cal_user.cal_user_id AND euser.cal_user_attendee IS NULL
2625 2625
 WHERE egw_cal_user.cal_user_type='e' AND egw_cal_user.cal_user_attendee IS NOT NULL
Please login to merge, or discard this patch.
calendar/setup/tz_aliases.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	'Arab Standard Time' => 'Asia/Riyadh',
25 25
 	'Arabian Standard Time' => 'Asia/Dubai',
26 26
 	'Arabic Standard Time' => 'Asia/Baghdad',
27
-	'Argentina Standard Time' => 'America/Argentina/Buenos_Aires',	// was 'America/Buenos_Aires',
27
+	'Argentina Standard Time' => 'America/Argentina/Buenos_Aires', // was 'America/Buenos_Aires',
28 28
 	'Atlantic Standard Time' => 'America/Halifax',
29 29
 	'Azerbaijan Standard Time' => 'Asia/Baku',
30 30
 	'Azores Standard Time' => 'Atlantic/Azores',
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	'Greenland Standard Time' => 'America/Godthab',
60 60
 	'Greenwich Standard Time' => 'Atlantic/Reykjavik',
61 61
 	'Hawaiian Standard Time' => 'Pacific/Honolulu',
62
-	'India Standard Time' => 'Asia/Kolkata',	// Asia/Calcutta is an alias to Asia/Kolkata
62
+	'India Standard Time' => 'Asia/Kolkata', // Asia/Calcutta is an alias to Asia/Kolkata
63 63
 	'Iran Standard Time' => 'Asia/Tehran',
64 64
 	'Israel Standard Time' => 'Asia/Jerusalem',
65 65
 	'Jordan Standard Time' => 'Asia/Amman',
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 	'Eniwetok, Kwajalein, Dateline Time' => 'Pacific/Kwajalein',
199 199
 
200 200
 	// various aliases collected over time
201
-	'America/Creston' => 'America/Dawson_Creek',	// not in sqlight DB of Thunderbird version 1.2011n, Dawson Creek is also UTC-7 without DS
201
+	'America/Creston' => 'America/Dawson_Creek', // not in sqlight DB of Thunderbird version 1.2011n, Dawson Creek is also UTC-7 without DS
202 202
 	'Armenian Standard Time' => 'Asia/Yerevan',
203 203
 	'Asia/Katmandu' => 'Asia/Kathmandu',
204 204
 	'Asia/Calcutta' => 'Asia/Kolkata',
Please login to merge, or discard this patch.
calendar/setup/default_records.inc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,17 +10,17 @@
 block discarded – undo
10 10
  */
11 11
 
12 12
 // enable auto-loading of holidays from localhost by default
13
-foreach(array(
13
+foreach (array(
14 14
 	'auto_load_holidays' => 'True',
15 15
 	'holidays_url_path'  => 'localhost',
16 16
 ) as $name => $value)
17 17
 {
18
-	$oProc->insert($GLOBALS['egw_setup']->config_table,array(
18
+	$oProc->insert($GLOBALS['egw_setup']->config_table, array(
19 19
 		'config_value' => $value,
20
-	),array(
20
+	), array(
21 21
 		'config_app' => 'phpgwapi',
22 22
 		'config_name' => $name,
23
-	),__FILE__,__LINE__);
23
+	), __FILE__, __LINE__);
24 24
 }
25 25
 
26 26
 // import timezone data
Please login to merge, or discard this patch.