@@ -22,11 +22,11 @@ discard block |
||
| 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['''] = "'"; |
| 31 | 31 | return(strtr($given_html, $trans_table)); |
| 32 | 32 | } |
@@ -45,17 +45,17 @@ discard block |
||
| 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 |
||
| 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 |
@@ -20,7 +20,7 @@ |
||
| 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'; |
@@ -123,7 +123,7 @@ |
||
| 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 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | { |
| 61 | 61 | parent::__construct(); |
| 62 | 62 | |
| 63 | - if($_dir) |
|
| 63 | + if ($_dir) |
|
| 64 | 64 | { |
| 65 | 65 | $this->dir = $_dir; |
| 66 | 66 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | * @param string &$content=null content to create some replacements only if they are use |
| 77 | 77 | * @return array|boolean |
| 78 | 78 | */ |
| 79 | - protected function get_replacements($id,&$content=null) |
|
| 79 | + protected function get_replacements($id, &$content = null) |
|
| 80 | 80 | { |
| 81 | 81 | if (!($replacements = $this->filemanager_replacements($id, '', $content))) |
| 82 | 82 | { |
@@ -92,27 +92,27 @@ discard block |
||
| 92 | 92 | * @param string $prefix='' prefix like eg. 'erole' |
| 93 | 93 | * @return array|boolean |
| 94 | 94 | */ |
| 95 | - public function filemanager_replacements($id,$prefix='', &$content = null) |
|
| 95 | + public function filemanager_replacements($id, $prefix = '', &$content = null) |
|
| 96 | 96 | { |
| 97 | 97 | $info = array(); |
| 98 | - $file = Vfs::lstat($id,true); |
|
| 98 | + $file = Vfs::lstat($id, true); |
|
| 99 | 99 | |
| 100 | 100 | $file['mtime'] = Api\DateTime::to($file['mtime']); |
| 101 | 101 | $file['ctime'] = Api\DateTime::to($file['ctime']); |
| 102 | 102 | |
| 103 | 103 | $file['name'] = Vfs::basename($id); |
| 104 | 104 | $file['dir'] = ($dir = Vfs::dirname($id)) ? Vfs::decodePath($dir) : ''; |
| 105 | - $dirlist = explode('/',$file['dir']); |
|
| 105 | + $dirlist = explode('/', $file['dir']); |
|
| 106 | 106 | $file['folder'] = array_pop($dirlist); |
| 107 | - $file['folder_file'] = $file['folder'] . '/'.$file['name']; |
|
| 107 | + $file['folder_file'] = $file['folder'].'/'.$file['name']; |
|
| 108 | 108 | $file['path'] = $id; |
| 109 | 109 | $file['rel_path'] = str_replace($this->dir.'/', '', $id); |
| 110 | 110 | $file['hsize'] = Vfs::hsize($file['size']); |
| 111 | 111 | $file['mime'] = Vfs::mime_content_type($id); |
| 112 | - $file['gid'] *= -1; // our widgets use negative gid's |
|
| 112 | + $file['gid'] *= -1; // our widgets use negative gid's |
|
| 113 | 113 | if (($props = Vfs::propfind($id))) |
| 114 | 114 | { |
| 115 | - foreach($props as $prop) |
|
| 115 | + foreach ($props as $prop) |
|
| 116 | 116 | { |
| 117 | 117 | $file[$prop['name']] = $prop['val']; |
| 118 | 118 | } |
@@ -122,22 +122,22 @@ discard block |
||
| 122 | 122 | $file['symlink'] = Vfs::readlink($id); |
| 123 | 123 | } |
| 124 | 124 | // Custom fields |
| 125 | - if($content && strpos($content, '#') !== 0) |
|
| 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 | |
| 130 | - foreach(Api\Storage\Customfields::get('filemanager') as $name => $field) |
|
| 130 | + foreach (Api\Storage\Customfields::get('filemanager') as $name => $field) |
|
| 131 | 131 | { |
| 132 | 132 | // Set any missing custom fields, or the marker will stay |
| 133 | - if(!$file['#'.$name]) |
|
| 133 | + if (!$file['#'.$name]) |
|
| 134 | 134 | { |
| 135 | 135 | $file['#'.$name] = ''; |
| 136 | 136 | continue; |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | // Format date cfs per user Api\Preferences |
| 140 | - if($field['type'] == 'date' || $field['type'] == 'date-time') |
|
| 140 | + if ($field['type'] == 'date' || $field['type'] == 'date-time') |
|
| 141 | 141 | { |
| 142 | 142 | $this->date_fields[] = '#'.$name; |
| 143 | 143 | $file['#'.$name] = Api\DateTime::to($file['#'.$name], $field['type'] == 'date' ? true : ''); |
@@ -146,51 +146,51 @@ discard block |
||
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | // If in apps folder, try for app-specific placeholders |
| 149 | - if($dirlist[1] == 'apps' && count($dirlist) > 1) |
|
| 149 | + if ($dirlist[1] == 'apps' && count($dirlist) > 1) |
|
| 150 | 150 | { |
| 151 | 151 | // Try this first - a normal path /apps/appname/id/file |
| 152 | - list($app, $app_id) = explode('/', substr($file['path'], strpos($file['path'], 'apps/')+5)); |
|
| 152 | + list($app, $app_id) = explode('/', substr($file['path'], strpos($file['path'], 'apps/') + 5)); |
|
| 153 | 153 | // Symlink? |
| 154 | - if(!$app || !(int)$app_id || !array_key_exists($app, $GLOBALS['egw_info']['user']['apps'])) { |
|
| 154 | + if (!$app || !(int)$app_id || !array_key_exists($app, $GLOBALS['egw_info']['user']['apps'])) { |
|
| 155 | 155 | // Try resolving just app + ID - /apps/App Name/Record Title/file |
| 156 | - $resolved = Vfs::resolve_url_symlinks(implode('/',array_slice(explode('/',$file['dir']),0,4))); |
|
| 157 | - list($app, $app_id) = explode('/', substr($resolved, strpos($resolved, 'apps/')+5)); |
|
| 156 | + $resolved = Vfs::resolve_url_symlinks(implode('/', array_slice(explode('/', $file['dir']), 0, 4))); |
|
| 157 | + list($app, $app_id) = explode('/', substr($resolved, strpos($resolved, 'apps/') + 5)); |
|
| 158 | 158 | |
| 159 | - if(!$app || !(int)$app_id || !array_key_exists($app, $GLOBALS['egw_info']['user']['apps'])) { |
|
| 159 | + if (!$app || !(int)$app_id || !array_key_exists($app, $GLOBALS['egw_info']['user']['apps'])) { |
|
| 160 | 160 | // Get rid of any virtual folders (eg: All$) and symlinks |
| 161 | 161 | $resolved = Vfs::resolve_url_symlinks($file['path']); |
| 162 | - list($app, $app_id) = explode('/', substr($resolved, strpos($resolved, 'apps/')+5)); |
|
| 162 | + list($app, $app_id) = explode('/', substr($resolved, strpos($resolved, 'apps/') + 5)); |
|
| 163 | 163 | } |
| 164 | 164 | } |
| 165 | - if($app && $app_id) |
|
| 165 | + if ($app && $app_id) |
|
| 166 | 166 | { |
| 167 | - if($app && $GLOBALS['egw_info']['user']['apps'][$app]) |
|
| 167 | + if ($app && $GLOBALS['egw_info']['user']['apps'][$app]) |
|
| 168 | 168 | { |
| 169 | 169 | $app_merge = null; |
| 170 | 170 | try |
| 171 | 171 | { |
| 172 | - $classname = $app .'_merge'; |
|
| 173 | - if(class_exists($classname)) |
|
| 172 | + $classname = $app.'_merge'; |
|
| 173 | + if (class_exists($classname)) |
|
| 174 | 174 | { |
| 175 | 175 | $app_merge = new $classname(); |
| 176 | - if($app_merge && method_exists($app_merge, 'get_replacements')) |
|
| 176 | + if ($app_merge && method_exists($app_merge, 'get_replacements')) |
|
| 177 | 177 | { |
| 178 | 178 | $app_placeholders = $app_merge->get_replacements($app_id, $content); |
| 179 | 179 | } |
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | // Silently discard & continue |
| 183 | - catch(Exception $e) { |
|
| 184 | - unset($e); // not used |
|
| 183 | + catch (Exception $e) { |
|
| 184 | + unset($e); // not used |
|
| 185 | 185 | } |
| 186 | 186 | } |
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | $link = Link::mime_open($file['url'], $file['mime']); |
| 190 | - if(is_array($link)) |
|
| 190 | + if (is_array($link)) |
|
| 191 | 191 | { |
| 192 | 192 | // Directories have their internal protocol in path here |
| 193 | - if($link['path'] && strpos($link['path'], '://') !== false) $link['path'] = $file['path']; |
|
| 193 | + if ($link['path'] && strpos($link['path'], '://') !== false) $link['path'] = $file['path']; |
|
| 194 | 194 | $link = Api\Session::link('/index.php', $link); |
| 195 | 195 | } |
| 196 | 196 | else |
@@ -209,12 +209,12 @@ discard block |
||
| 209 | 209 | $file['url'] = $link; |
| 210 | 210 | |
| 211 | 211 | // Add markers |
| 212 | - foreach($file as $key => &$value) |
|
| 212 | + foreach ($file as $key => &$value) |
|
| 213 | 213 | { |
| 214 | - if(!$value) $value = ''; |
|
| 215 | - $info['$$'.($prefix ? $prefix.'/':'').$key.'$$'] = $value; |
|
| 214 | + if (!$value) $value = ''; |
|
| 215 | + $info['$$'.($prefix ? $prefix.'/' : '').$key.'$$'] = $value; |
|
| 216 | 216 | } |
| 217 | - if($app_placeholders) |
|
| 217 | + if ($app_placeholders) |
|
| 218 | 218 | { |
| 219 | 219 | $info = array_merge($app_placeholders, $info); |
| 220 | 220 | } |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | 'hsize' => 'Size', |
| 251 | 251 | 'size' => 'Size (in bytes)', |
| 252 | 252 | ); |
| 253 | - foreach($fields as $name => $label) |
|
| 253 | + foreach ($fields as $name => $label) |
|
| 254 | 254 | { |
| 255 | 255 | if (!($n&1)) echo '<tr>'; |
| 256 | 256 | echo '<td>{{'.$name.'}}</td><td>'.lang($label).'</td>'; |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | echo '<tr><td colspan="4"><h3>'.lang('Custom fields').":</h3></td></tr>"; |
| 262 | - foreach(Api\Storage\Customfields::get('filemanager') as $name => $field) |
|
| 262 | + foreach (Api\Storage\Customfields::get('filemanager') as $name => $field) |
|
| 263 | 263 | { |
| 264 | 264 | echo '<tr><td>{{#'.$name.'}}</td><td colspan="3">'.$field['label']."</td></tr>\n"; |
| 265 | 265 | } |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | 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>'; |
| 269 | 269 | |
| 270 | 270 | echo '<tr><td colspan="4"><h3>'.lang('General fields:')."</h3></td></tr>"; |
| 271 | - foreach(array( |
|
| 271 | + foreach (array( |
|
| 272 | 272 | 'date' => lang('Date'), |
| 273 | 273 | 'user/n_fn' => lang('Name of current user, all other contact fields are valid too'), |
| 274 | 274 | 'user/account_lid' => lang('Username'), |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $readonlys = null; |
| 90 | 90 | $total = Sharing::so()->get_rows($query, $rows, $readonlys); |
| 91 | 91 | |
| 92 | - foreach($rows as &$row) |
|
| 92 | + foreach ($rows as &$row) |
|
| 93 | 93 | { |
| 94 | 94 | if (substr($row['share_path'], 0, strlen(self::$tmp_dir)) === self::$tmp_dir) |
| 95 | 95 | { |
@@ -130,21 +130,21 @@ discard block |
||
| 130 | 130 | * @param array $content=null |
| 131 | 131 | * @param string $msg='' |
| 132 | 132 | */ |
| 133 | - public function index(array $content=null) |
|
| 133 | + public function index(array $content = null) |
|
| 134 | 134 | { |
| 135 | 135 | if (!is_array($content)) |
| 136 | 136 | { |
| 137 | 137 | $content = array( |
| 138 | 138 | 'nm' => array( |
| 139 | - 'get_rows' => 'filemanager.filemanager_shares.get_rows', // I method/callback to request the data for the rows eg. 'notes.bo.get_rows' |
|
| 140 | - 'no_filter' => True, // current dir only |
|
| 141 | - 'no_filter2' => True, // I disable the 2. filter (params are the same as for filter) |
|
| 142 | - 'no_cat' => True, // I disable the cat-selectbox |
|
| 143 | - 'lettersearch' => false, // I show a lettersearch |
|
| 144 | - 'searchletter' => false, // I0 active letter of the lettersearch or false for [all] |
|
| 145 | - 'start' => 0, // IO position in list |
|
| 146 | - 'order' => 'share_created', // IO name of the column to sort after (optional for the sortheaders) |
|
| 147 | - 'sort' => 'DESC', // IO direction of the sort: 'ASC' or 'DESC' |
|
| 139 | + 'get_rows' => 'filemanager.filemanager_shares.get_rows', // I method/callback to request the data for the rows eg. 'notes.bo.get_rows' |
|
| 140 | + 'no_filter' => True, // current dir only |
|
| 141 | + 'no_filter2' => True, // I disable the 2. filter (params are the same as for filter) |
|
| 142 | + 'no_cat' => True, // I disable the cat-selectbox |
|
| 143 | + 'lettersearch' => false, // I show a lettersearch |
|
| 144 | + 'searchletter' => false, // I0 active letter of the lettersearch or false for [all] |
|
| 145 | + 'start' => 0, // IO position in list |
|
| 146 | + 'order' => 'share_created', // IO name of the column to sort after (optional for the sortheaders) |
|
| 147 | + 'sort' => 'DESC', // IO direction of the sort: 'ASC' or 'DESC' |
|
| 148 | 148 | //'default_cols' => '!', // I columns to use if there's no user or default pref (! as first char uses all but the named columns), default all columns |
| 149 | 149 | 'csv_fields' => false, // I false=disable csv export, true or unset=enable it with auto-detected fieldnames, |
| 150 | 150 | //or array with name=>label or name=>array('label'=>label,'type'=>type) pairs (type is a eT widget-type) |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | } |
| 157 | 157 | elseif ($content['nm']['action']) |
| 158 | 158 | { |
| 159 | - switch($content['nm']['action']) |
|
| 159 | + switch ($content['nm']['action']) |
|
| 160 | 160 | { |
| 161 | 161 | case 'delete': |
| 162 | 162 | $where = array('share_owner' => $GLOBALS['egw_info']['user']['account_id']); |
@@ -36,11 +36,11 @@ discard block |
||
| 36 | 36 | } |
| 37 | 37 | //print_r($config); exit; |
| 38 | 38 | |
| 39 | -$uglify =& $config['uglify']; |
|
| 39 | +$uglify = & $config['uglify']; |
|
| 40 | 40 | |
| 41 | -foreach(Bundle::all() as $name => $files) |
|
| 41 | +foreach (Bundle::all() as $name => $files) |
|
| 42 | 42 | { |
| 43 | - if ($name == '.ts') continue; // ignore timestamp |
|
| 43 | + if ($name == '.ts') continue; // ignore timestamp |
|
| 44 | 44 | |
| 45 | 45 | // remove leading / from file-names |
| 46 | 46 | array_walk($files, function(&$path) |
@@ -79,16 +79,16 @@ discard block |
||
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | // add css for all templates and themes |
| 82 | -$cssmin =& $config['cssmin']; |
|
| 83 | -$GLOBALS['egw_info']['flags']['currentapp'] = '*grunt*'; // to no find any app.css files |
|
| 84 | -$GLOBALS['egw_info']['server']['debug_minify'] = 'True'; // otherwise we would only get minified file |
|
| 85 | -foreach(array('pixelegg','jdots')/*array_keys(Framework::list_templates())*/ as $template) |
|
| 82 | +$cssmin = & $config['cssmin']; |
|
| 83 | +$GLOBALS['egw_info']['flags']['currentapp'] = '*grunt*'; // to no find any app.css files |
|
| 84 | +$GLOBALS['egw_info']['server']['debug_minify'] = 'True'; // otherwise we would only get minified file |
|
| 85 | +foreach (array('pixelegg', 'jdots')/*array_keys(Framework::list_templates())*/ as $template) |
|
| 86 | 86 | { |
| 87 | 87 | $GLOBALS['egw_info']['server']['template_set'] = $template; |
| 88 | 88 | $tpl = Framework::factory(); |
| 89 | 89 | $themes = $tpl->list_themes(); |
| 90 | - if ($template == 'pixelegg') $themes[] = 'fw_mobile'; // this is for mobile devices |
|
| 91 | - foreach($themes as $theme) |
|
| 90 | + if ($template == 'pixelegg') $themes[] = 'fw_mobile'; // this is for mobile devices |
|
| 91 | + foreach ($themes as $theme) |
|
| 92 | 92 | { |
| 93 | 93 | // skip not working cssmin of pixelegg/traditional: Broken @import declaration of "../../etemplate/templates/default/etemplate2.css" |
| 94 | 94 | if ($template == 'pixelegg' && $theme == 'traditional') continue; |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $new_json = str_replace("\n", "\n\t", |
| 115 | 115 | preg_replace_callback('/^( *)/m', function($matches) |
| 116 | 116 | { |
| 117 | - return str_repeat("\t", strlen($matches[1])/4); |
|
| 117 | + return str_repeat("\t", strlen($matches[1]) / 4); |
|
| 118 | 118 | }, json_encode($config, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES))); |
| 119 | 119 | |
| 120 | 120 | $new_content = preg_replace('/^(\s*)"([a-z0-9]+)":/mi', '$1$2:', $new_json); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | 'category' => array( |
| 56 | 56 | 'type' => 'select', |
| 57 | 57 | 'label' => lang('Choose a category'), |
| 58 | - 'options' => array(), // specification of options is postponed into the get_user_interface function |
|
| 58 | + 'options' => array(), // specification of options is postponed into the get_user_interface function |
|
| 59 | 59 | 'multiple' => true, |
| 60 | 60 | ), |
| 61 | 61 | 'numWeeks' => array( |
@@ -107,8 +107,8 @@ discard block |
||
| 107 | 107 | function get_user_interface() |
| 108 | 108 | { |
| 109 | 109 | // copied from bookmarks module. |
| 110 | - $cat = createobject('phpgwapi.categories','','calendar'); |
|
| 111 | - $cats = $cat->return_array('all',0,False,'','cat_name','',True); |
|
| 110 | + $cat = createobject('phpgwapi.categories', '', 'calendar'); |
|
| 111 | + $cats = $cat->return_array('all', 0, False, '', 'cat_name', '', True); |
|
| 112 | 112 | $cat_ids = array(); |
| 113 | 113 | while (list(,$category) = @each($cats)) |
| 114 | 114 | { |
@@ -119,12 +119,12 @@ discard block |
||
| 119 | 119 | $this->arguments['category']['multiple'] = 5; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - if (! isset($GLOBALS['egw']->accounts)) |
|
| 122 | + if (!isset($GLOBALS['egw']->accounts)) |
|
| 123 | 123 | { |
| 124 | 124 | $GLOBALS['egw']->accounts = new Api\Accounts(); |
| 125 | 125 | } |
| 126 | - $this->accounts =& $GLOBALS['egw']->accounts; |
|
| 127 | - $search_params=array( |
|
| 126 | + $this->accounts = & $GLOBALS['egw']->accounts; |
|
| 127 | + $search_params = array( |
|
| 128 | 128 | 'type' => 'both', |
| 129 | 129 | 'app' => 'calendar', |
| 130 | 130 | ); |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | // sort users and groups separately. |
| 135 | 135 | if (isset($GLOBALS['sitemgr_info']['anonymous_user'])) |
| 136 | 136 | { |
| 137 | - $anon_user = $this->accounts->name2id($GLOBALS['sitemgr_info']['anonymous_user'],'account_lid','u'); |
|
| 137 | + $anon_user = $this->accounts->name2id($GLOBALS['sitemgr_info']['anonymous_user'], 'account_lid', 'u'); |
|
| 138 | 138 | } |
| 139 | 139 | else |
| 140 | 140 | { |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * Get possible sitemgr paths from the HTTP_REFERRER in order to unreveal the |
| 144 | 144 | * anonymous user for the correct site. |
| 145 | 145 | */ |
| 146 | - $sitemgr_path = preg_replace('/^[^\/]+:\/\/[^\/]+\/([^\?]*)(\?.*)*$/',"/\${1}",$_SERVER['HTTP_REFERER']); |
|
| 146 | + $sitemgr_path = preg_replace('/^[^\/]+:\/\/[^\/]+\/([^\?]*)(\?.*)*$/', "/\${1}", $_SERVER['HTTP_REFERER']); |
|
| 147 | 147 | // Remove the trailing file- / pathname if any |
| 148 | 148 | $sitemgr_path = preg_replace('/[^\/]*$/', '', $sitemgr_path); |
| 149 | 149 | // Add leading slash if it has been lost. |
@@ -155,14 +155,14 @@ discard block |
||
| 155 | 155 | // Code adapted from sitemgr-site/index.php |
| 156 | 156 | $site_urls = array(); |
| 157 | 157 | $site_urls[] = $sitemgr_path; |
| 158 | - $site_urls[] = ($_SERVER['HTTPS'] ? 'https://' : 'http://') . $_SERVER['SERVER_ADDR'] . $sitemgr_path; |
|
| 159 | - $site_urls[] = $site_url = ($_SERVER['HTTPS'] ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . $sitemgr_path; |
|
| 158 | + $site_urls[] = ($_SERVER['HTTPS'] ? 'https://' : 'http://').$_SERVER['SERVER_ADDR'].$sitemgr_path; |
|
| 159 | + $site_urls[] = $site_url = ($_SERVER['HTTPS'] ? 'https://' : 'http://').$_SERVER['SERVER_NAME'].$sitemgr_path; |
|
| 160 | 160 | |
| 161 | - $anon_user = $this->accounts->name2id($GLOBALS['egw']->db->select('egw_sitemgr_sites','anonymous_user,anonymous_passwd,site_id', |
|
| 162 | - array('site_url' => $site_urls),__LINE__,__FILE__,false,'','sitemgr')->fetchColumn(),'account_lid','u'); |
|
| 161 | + $anon_user = $this->accounts->name2id($GLOBALS['egw']->db->select('egw_sitemgr_sites', 'anonymous_user,anonymous_passwd,site_id', |
|
| 162 | + array('site_url' => $site_urls), __LINE__, __FILE__, false, '', 'sitemgr')->fetchColumn(), 'account_lid', 'u'); |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - $anon_groups = $this->accounts->memberships($anon_user,true); |
|
| 165 | + $anon_groups = $this->accounts->memberships($anon_user, true); |
|
| 166 | 166 | foreach ($accounts as $entry) |
| 167 | 167 | { |
| 168 | 168 | $is_group = false; |
@@ -170,9 +170,9 @@ discard block |
||
| 170 | 170 | $acl = new Acl($entry['account_id']); |
| 171 | 171 | $acl->read_repository(); |
| 172 | 172 | // get the rights for each account to check whether the anon user has read permissions. |
| 173 | - $rights = $acl->get_rights($anon_user,'calendar'); |
|
| 173 | + $rights = $acl->get_rights($anon_user, 'calendar'); |
|
| 174 | 174 | // also add the anon user if it's his own calendar. |
| 175 | - if (($rights & Acl::READ) || ($entry['account_id'] == $anon_user)) |
|
| 175 | + if (($rights&Acl::READ) || ($entry['account_id'] == $anon_user)) |
|
| 176 | 176 | { |
| 177 | 177 | $has_read_permissions = true; |
| 178 | 178 | } |
@@ -182,8 +182,8 @@ discard block |
||
| 182 | 182 | // or ass permissions if this is the anon group's calendar. |
| 183 | 183 | foreach ($anon_groups as $parent_group) |
| 184 | 184 | { |
| 185 | - $rights = $acl->get_rights($parent_group,'calendar'); |
|
| 186 | - if (($rights & Acl::READ) || ($entry['account_id'] == $parent_group)) |
|
| 185 | + $rights = $acl->get_rights($parent_group, 'calendar'); |
|
| 186 | + if (($rights&Acl::READ) || ($entry['account_id'] == $parent_group)) |
|
| 187 | 187 | { |
| 188 | 188 | $has_read_permissions = true; |
| 189 | 189 | break; |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | } |
| 200 | 200 | else |
| 201 | 201 | { |
| 202 | - $users[$entry['account_id']] = Api\Accounts::format_username($entry['account_lid'],$entry['account_firstname'],$entry['account_lastname']); |
|
| 202 | + $users[$entry['account_id']] = Api\Accounts::format_username($entry['account_lid'], $entry['account_firstname'], $entry['account_lastname']); |
|
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 | } |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | return parent::get_user_interface(); |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | - function get_content(&$arguments,$properties) |
|
| 222 | + function get_content(&$arguments, $properties) |
|
| 223 | 223 | { |
| 224 | 224 | $html = ""; |
| 225 | 225 | Api\Translation::add_app('calendar'); |
@@ -227,33 +227,32 @@ discard block |
||
| 227 | 227 | $this->ui->allowEdit = false; |
| 228 | 228 | $this->ui->use_time_grid = isset($arguments['grid']) ? $arguments['grid'] : false; |
| 229 | 229 | |
| 230 | - $weeks = $arguments['numWeeks'] ? (int) $arguments['numWeeks'] : 2; |
|
| 230 | + $weeks = $arguments['numWeeks'] ? (int)$arguments['numWeeks'] : 2; |
|
| 231 | 231 | |
| 232 | - if (($arguments['acceptDateParam']) && (get_var('date',array('POST','GET')))) |
|
| 232 | + if (($arguments['acceptDateParam']) && (get_var('date', array('POST', 'GET')))) |
|
| 233 | 233 | { |
| 234 | - $start = (int) (strtotime(get_var('date',array('POST','GET'))) + |
|
| 234 | + $start = (int)(strtotime(get_var('date', array('POST', 'GET'))) + |
|
| 235 | 235 | (60 * 60 * 24 * 7 * $dateOffset)); |
| 236 | 236 | } |
| 237 | 237 | else |
| 238 | 238 | { |
| 239 | - $start = (int) ($this->bo->now_su + |
|
| 239 | + $start = (int)($this->bo->now_su + |
|
| 240 | 240 | (60 * 60 * 24 * 7 * $dateOffset)); |
| 241 | 241 | } |
| 242 | 242 | $start = new Api\DateTime($start); |
| 243 | 243 | $start->setWeekstart(); |
| 244 | 244 | $first = $start->format('ts'); |
| 245 | - $last = strtotime("+$weeks weeks",$first) - 1; |
|
| 245 | + $last = strtotime("+$weeks weeks", $first) - 1; |
|
| 246 | 246 | |
| 247 | 247 | if ($arguments['showTitle']) |
| 248 | 248 | { |
| 249 | 249 | $html .= '<div id="divAppboxHeader">'.$GLOBALS['egw_info']['apps']['calendar']['title'].' - '.lang('Weekview').": "; |
| 250 | - $html .= lang('After %1',$this->bo->long_date($first)); |
|
| 250 | + $html .= lang('After %1', $this->bo->long_date($first)); |
|
| 251 | 251 | $html .= "</div>"; |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | // set the search parameters |
| 255 | - $search_params = Array |
|
| 256 | - ( |
|
| 255 | + $search_params = Array( |
|
| 257 | 256 | 'offset' => false, |
| 258 | 257 | 'order' => 'cal_start ASC', |
| 259 | 258 | 'start' => $first, |
@@ -288,19 +287,19 @@ discard block |
||
| 288 | 287 | $html .= '<!-- END Calendar info -->'."\n"; |
| 289 | 288 | unset($css_file); |
| 290 | 289 | // we add DAY_s/2 to $this->first (using 12h), to deal with daylight saving changes |
| 291 | - for ($week_start = $first; $week_start < $last; $week_start = strtotime("+1 week",$week_start)) |
|
| 290 | + for ($week_start = $first; $week_start < $last; $week_start = strtotime("+1 week", $week_start)) |
|
| 292 | 291 | { |
| 293 | 292 | $week = array(); |
| 294 | 293 | for ($i = 0; $i < 7; ++$i) |
| 295 | 294 | { |
| 296 | - $day_ymd = $this->bo->date2string($i ? strtotime("+$i days",$week_start) : $week_start); |
|
| 295 | + $day_ymd = $this->bo->date2string($i ? strtotime("+$i days", $week_start) : $week_start); |
|
| 297 | 296 | $week[$day_ymd] = array_shift($rows); |
| 298 | 297 | } |
| 299 | 298 | $week_view = array( |
| 300 | 299 | 'menuaction' => false, |
| 301 | 300 | 'date' => $this->bo->date2string($week_start), |
| 302 | 301 | ); |
| 303 | - $title = lang('Wk').' '.adodb_date('W',$week_start); |
|
| 302 | + $title = lang('Wk').' '.adodb_date('W', $week_start); |
|
| 304 | 303 | if (!isset($GLOBALS['egw']->template)) |
| 305 | 304 | { |
| 306 | 305 | $GLOBALS['egw']->template = new Framework\Template; |
@@ -15,7 +15,7 @@ |
||
| 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'] = |
@@ -1909,7 +1909,7 @@ |
||
| 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'; |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | { |
| 20 | 20 | $owner[count($owner)] = $GLOBALS['egw_setup']->oProc->f($field); |
| 21 | 21 | } |
| 22 | - if($GLOBALS['egw_setup']->alessthanb($GLOBALS['setup_info']['phpgwapi']['currentver'],'0.9.10pre4')) |
|
| 22 | + if ($GLOBALS['egw_setup']->alessthanb($GLOBALS['setup_info']['phpgwapi']['currentver'], '0.9.10pre4')) |
|
| 23 | 23 | { |
| 24 | 24 | $acctstbl = 'accounts'; |
| 25 | 25 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | $acctstbl = 'phpgw_accounts'; |
| 29 | 29 | } |
| 30 | - for($i=0;$i<count($owner);$i++) |
|
| 30 | + for ($i = 0; $i < count($owner); $i++) |
|
| 31 | 31 | { |
| 32 | 32 | $GLOBALS['egw_setup']->oProc->query("SELECT account_id FROM $acctstbl WHERE account_lid='".$owner[$i]."'"); |
| 33 | 33 | $GLOBALS['egw_setup']->oProc->next_record(); |
@@ -40,8 +40,8 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | function calendar_upgrade0_9_3pre1() |
| 42 | 42 | { |
| 43 | - calendar_v0_9_2to0_9_3update_owner('webcal_entry','cal_create_by'); |
|
| 44 | - calendar_v0_9_2to0_9_3update_owner('webcal_entry_user','cal_login'); |
|
| 43 | + calendar_v0_9_2to0_9_3update_owner('webcal_entry', 'cal_create_by'); |
|
| 44 | + calendar_v0_9_2to0_9_3update_owner('webcal_entry_user', 'cal_login'); |
|
| 45 | 45 | $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.3pre2'; |
| 46 | 46 | return $GLOBALS['setup_info']['calendar']['currentver']; |
| 47 | 47 | } |
@@ -208,12 +208,12 @@ discard block |
||
| 208 | 208 | ) |
| 209 | 209 | ); |
| 210 | 210 | |
| 211 | - $GLOBALS['egw_setup']->oProc->query('SELECT count(*) FROM webcal_entry',__LINE__,__FILE__); |
|
| 211 | + $GLOBALS['egw_setup']->oProc->query('SELECT count(*) FROM webcal_entry', __LINE__, __FILE__); |
|
| 212 | 212 | $GLOBALS['egw_setup']->oProc->next_record(); |
| 213 | - if($GLOBALS['egw_setup']->oProc->f(0)) |
|
| 213 | + if ($GLOBALS['egw_setup']->oProc->f(0)) |
|
| 214 | 214 | { |
| 215 | - $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__); |
|
| 216 | - while($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 215 | + $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__); |
|
| 216 | + while ($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 217 | 217 | { |
| 218 | 218 | $cal_id = $GLOBALS['egw_setup']->oProc->f('cal_id'); |
| 219 | 219 | $cal_owner = $GLOBALS['egw_setup']->oProc->f('cal_owner'); |
@@ -223,13 +223,13 @@ discard block |
||
| 223 | 223 | $cal_access = $GLOBALS['egw_setup']->oProc->f('cal_access'); |
| 224 | 224 | $cal_name = $GLOBALS['egw_setup']->oProc->f('cal_name'); |
| 225 | 225 | $cal_description = $GLOBALS['egw_setup']->oProc->f('cal_description'); |
| 226 | - $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))); |
|
| 227 | - $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))); |
|
| 228 | - $db2->query('SELECT groups FROM webcal_entry_groups WHERE cal_id='.$cal_id,__LINE__,__FILE__); |
|
| 226 | + $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))); |
|
| 227 | + $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))); |
|
| 228 | + $db2->query('SELECT groups FROM webcal_entry_groups WHERE cal_id='.$cal_id, __LINE__, __FILE__); |
|
| 229 | 229 | $db2->next_record(); |
| 230 | 230 | $cal_group = $db2->f('groups'); |
| 231 | 231 | $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) ' |
| 232 | - .'VALUES('.$cal_id.",'".$cal_owner."','".$cal_group."',".$datetime.",".$moddatetime.",".$cal_duration.",".$cal_priority.",'".$cal_type."','".$cal_access."','".$cal_name."','".$cal_description."')",__LINE__,__FILE__); |
|
| 232 | + .'VALUES('.$cal_id.",'".$cal_owner."','".$cal_group."',".$datetime.",".$moddatetime.",".$cal_duration.",".$cal_priority.",'".$cal_type."','".$cal_access."','".$cal_name."','".$cal_description."')", __LINE__, __FILE__); |
|
| 233 | 233 | } |
| 234 | 234 | } |
| 235 | 235 | |
@@ -250,17 +250,17 @@ discard block |
||
| 250 | 250 | ) |
| 251 | 251 | ); |
| 252 | 252 | |
| 253 | - $GLOBALS['egw_setup']->oProc->query('SELECT count(*) FROM webcal_entry_user',__LINE__,__FILE__); |
|
| 253 | + $GLOBALS['egw_setup']->oProc->query('SELECT count(*) FROM webcal_entry_user', __LINE__, __FILE__); |
|
| 254 | 254 | $GLOBALS['egw_setup']->oProc->next_record(); |
| 255 | - if($GLOBALS['egw_setup']->oProc->f(0)) |
|
| 255 | + if ($GLOBALS['egw_setup']->oProc->f(0)) |
|
| 256 | 256 | { |
| 257 | - $GLOBALS['egw_setup']->oProc->query('SELECT cal_id,cal_login,cal_status FROM webcal_entry_user ORDER BY cal_id',__LINE__,__FILE__); |
|
| 258 | - while($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 257 | + $GLOBALS['egw_setup']->oProc->query('SELECT cal_id,cal_login,cal_status FROM webcal_entry_user ORDER BY cal_id', __LINE__, __FILE__); |
|
| 258 | + while ($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 259 | 259 | { |
| 260 | 260 | $cal_id = $GLOBALS['egw_setup']->oProc->f('cal_id'); |
| 261 | 261 | $cal_login = $GLOBALS['egw_setup']->oProc->f('cal_login'); |
| 262 | 262 | $cal_status = $GLOBALS['egw_setup']->oProc->f('cal_status'); |
| 263 | - $db2->query('INSERT INTO calendar_entry_user(cal_id,cal_login,cal_status) VALUES('.$cal_id.','.$cal_login.",'".$cal_status."')",__LINE__,__FILE__); |
|
| 263 | + $db2->query('INSERT INTO calendar_entry_user(cal_id,cal_login,cal_status) VALUES('.$cal_id.','.$cal_login.",'".$cal_status."')", __LINE__, __FILE__); |
|
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | 266 | |
@@ -283,18 +283,18 @@ discard block |
||
| 283 | 283 | ) |
| 284 | 284 | ); |
| 285 | 285 | |
| 286 | - $GLOBALS['egw_setup']->oProc->query('SELECT count(*) FROM webcal_entry_repeats',__LINE__,__FILE__); |
|
| 286 | + $GLOBALS['egw_setup']->oProc->query('SELECT count(*) FROM webcal_entry_repeats', __LINE__, __FILE__); |
|
| 287 | 287 | $GLOBALS['egw_setup']->oProc->next_record(); |
| 288 | - if($GLOBALS['egw_setup']->oProc->f(0)) |
|
| 288 | + if ($GLOBALS['egw_setup']->oProc->f(0)) |
|
| 289 | 289 | { |
| 290 | - $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__); |
|
| 291 | - while($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 290 | + $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__); |
|
| 291 | + while ($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 292 | 292 | { |
| 293 | 293 | $cal_id = $GLOBALS['egw_setup']->oProc->f('cal_id'); |
| 294 | 294 | $cal_type = $GLOBALS['egw_setup']->oProc->f('cal_type'); |
| 295 | - if(isset($GLOBALS['egw_setup']->oProc->Record['cal_end'])) |
|
| 295 | + if (isset($GLOBALS['egw_setup']->oProc->Record['cal_end'])) |
|
| 296 | 296 | { |
| 297 | - $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 | + $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))); |
|
| 298 | 298 | $useend = 1; |
| 299 | 299 | } |
| 300 | 300 | else |
@@ -304,12 +304,12 @@ discard block |
||
| 304 | 304 | } |
| 305 | 305 | $cal_frequency = $GLOBALS['egw_setup']->oProc->f('cal_frequency'); |
| 306 | 306 | $cal_days = $GLOBALS['egw_setup']->oProc->f('cal_days'); |
| 307 | - $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 | + $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__); |
|
| 308 | 308 | } |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | $GLOBALS['egw_setup']->oProc->DropTable('webcal_entry_repeats'); |
| 312 | - $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 | + $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__); |
|
| 313 | 313 | |
| 314 | 314 | $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.7pre2'; |
| 315 | 315 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -321,19 +321,19 @@ discard block |
||
| 321 | 321 | $db2 = $GLOBALS['egw_setup']->db; |
| 322 | 322 | |
| 323 | 323 | $GLOBALS['egw_setup']->oProc->RenameColumn('calendar_entry', 'cal_duration', 'cal_edatetime'); |
| 324 | - $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__); |
|
| 325 | - if($GLOBALS['egw_setup']->oProc->num_rows()) |
|
| 324 | + $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__); |
|
| 325 | + if ($GLOBALS['egw_setup']->oProc->num_rows()) |
|
| 326 | 326 | { |
| 327 | - while($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 327 | + while ($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 328 | 328 | { |
| 329 | - $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 | + $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__); |
|
| 330 | 330 | $db2->next_record(); |
| 331 | 331 | $tz = $db2->f('preference_value'); |
| 332 | 332 | $cal_id = $GLOBALS['egw_setup']->oProc->f('cal_id'); |
| 333 | 333 | $datetime = $GLOBALS['egw_setup']->oProc->f('cal_datetime') - ((60 * 60) * $tz); |
| 334 | 334 | $mdatetime = $GLOBALS['egw_setup']->oProc->f('cal_mdatetime') - ((60 * 60) * $tz); |
| 335 | 335 | $edatetime = $datetime + (60 * $GLOBALS['egw_setup']->oProc->f('cal_edatetime')); |
| 336 | - $db2->query('UPDATE calendar_entry SET cal_datetime='.$datetime.', cal_edatetime='.$edatetime.', cal_mdatetime='.$mdatetime.' WHERE cal_id='.$cal_id,__LINE__,__FILE__); |
|
| 336 | + $db2->query('UPDATE calendar_entry SET cal_datetime='.$datetime.', cal_edatetime='.$edatetime.', cal_mdatetime='.$mdatetime.' WHERE cal_id='.$cal_id, __LINE__, __FILE__); |
|
| 337 | 337 | } |
| 338 | 338 | } |
| 339 | 339 | |
@@ -581,22 +581,22 @@ discard block |
||
| 581 | 581 | { |
| 582 | 582 | $db2 = $GLOBALS['egw_setup']->db; |
| 583 | 583 | |
| 584 | - if(extension_loaded('mcal') == False) |
|
| 584 | + if (extension_loaded('mcal') == False) |
|
| 585 | 585 | { |
| 586 | - define(RECUR_NONE,0); |
|
| 587 | - define(RECUR_DAILY,1); |
|
| 588 | - define(RECUR_WEEKLY,2); |
|
| 589 | - define(RECUR_MONTHLY_MDAY,3); |
|
| 590 | - define(RECUR_MONTHLY_WDAY,4); |
|
| 591 | - define(RECUR_YEARLY,5); |
|
| 592 | - |
|
| 593 | - define(M_SUNDAY,1); |
|
| 594 | - define(M_MONDAY,2); |
|
| 595 | - define(M_TUESDAY,4); |
|
| 596 | - define(M_WEDNESDAY,8); |
|
| 597 | - define(M_THURSDAY,16); |
|
| 598 | - define(M_FRIDAY,32); |
|
| 599 | - define(M_SATURDAY,64); |
|
| 586 | + define(RECUR_NONE, 0); |
|
| 587 | + define(RECUR_DAILY, 1); |
|
| 588 | + define(RECUR_WEEKLY, 2); |
|
| 589 | + define(RECUR_MONTHLY_MDAY, 3); |
|
| 590 | + define(RECUR_MONTHLY_WDAY, 4); |
|
| 591 | + define(RECUR_YEARLY, 5); |
|
| 592 | + |
|
| 593 | + define(M_SUNDAY, 1); |
|
| 594 | + define(M_MONDAY, 2); |
|
| 595 | + define(M_TUESDAY, 4); |
|
| 596 | + define(M_WEDNESDAY, 8); |
|
| 597 | + define(M_THURSDAY, 16); |
|
| 598 | + define(M_FRIDAY, 32); |
|
| 599 | + define(M_SATURDAY, 64); |
|
| 600 | 600 | } |
| 601 | 601 | |
| 602 | 602 | // calendar_entry => phpgw_cal |
@@ -623,13 +623,13 @@ discard block |
||
| 623 | 623 | ) |
| 624 | 624 | ); |
| 625 | 625 | |
| 626 | - $GLOBALS['egw_setup']->oProc->query('SELECT * FROM calendar_entry',__LINE__,__FILE__); |
|
| 627 | - while($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 626 | + $GLOBALS['egw_setup']->oProc->query('SELECT * FROM calendar_entry', __LINE__, __FILE__); |
|
| 627 | + while ($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 628 | 628 | { |
| 629 | 629 | $id = $GLOBALS['egw_setup']->oProc->f('cal_id'); |
| 630 | 630 | $owner = $GLOBALS['egw_setup']->oProc->f('cal_owner'); |
| 631 | 631 | $access = $GLOBALS['egw_setup']->oProc->f('cal_access'); |
| 632 | - switch($access) |
|
| 632 | + switch ($access) |
|
| 633 | 633 | { |
| 634 | 634 | case 'private': |
| 635 | 635 | $is_public = 0; |
@@ -651,7 +651,7 @@ discard block |
||
| 651 | 651 | $description = $GLOBALS['egw_setup']->oProc->f('cal_description'); |
| 652 | 652 | |
| 653 | 653 | $db2->query("INSERT INTO phpgw_cal(cal_id,owner,groups,datetime,mdatetime,edatetime,priority,cal_type,is_public,title,description) " |
| 654 | - . "VALUES($id,$owner,'$groups',$datetime,$mdatetime,$edatetime,$priority,'$type',$is_public,'$title','$description')",__LINE__,__FILE__); |
|
| 654 | + . "VALUES($id,$owner,'$groups',$datetime,$mdatetime,$edatetime,$priority,'$type',$is_public,'$title','$description')", __LINE__, __FILE__); |
|
| 655 | 655 | } |
| 656 | 656 | $GLOBALS['egw_setup']->oProc->DropTable('calendar_entry'); |
| 657 | 657 | |
@@ -659,12 +659,12 @@ discard block |
||
| 659 | 659 | $GLOBALS['egw_setup']->oProc->CreateTable('phpgw_cal_repeats', |
| 660 | 660 | Array( |
| 661 | 661 | 'fd' => array( |
| 662 | - 'cal_id' => array('type' => 'int', 'precision' => 8,'nullable' => False), |
|
| 663 | - 'recur_type' => array('type' => 'int', 'precision' => 8,'nullable' => False), |
|
| 664 | - 'recur_use_end' => array('type' => 'int', 'precision' => 8,'nullable' => True), |
|
| 665 | - 'recur_enddate' => array('type' => 'int', 'precision' => 8,'nullable' => True), |
|
| 666 | - 'recur_interval' => array('type' => 'int', 'precision' => 8,'nullable' => True,'default' => '1'), |
|
| 667 | - 'recur_data' => array('type' => 'int', 'precision' => 8,'nullable' => True,'default' => '1') |
|
| 662 | + 'cal_id' => array('type' => 'int', 'precision' => 8, 'nullable' => False), |
|
| 663 | + 'recur_type' => array('type' => 'int', 'precision' => 8, 'nullable' => False), |
|
| 664 | + 'recur_use_end' => array('type' => 'int', 'precision' => 8, 'nullable' => True), |
|
| 665 | + 'recur_enddate' => array('type' => 'int', 'precision' => 8, 'nullable' => True), |
|
| 666 | + 'recur_interval' => array('type' => 'int', 'precision' => 8, 'nullable' => True, 'default' => '1'), |
|
| 667 | + 'recur_data' => array('type' => 'int', 'precision' => 8, 'nullable' => True, 'default' => '1') |
|
| 668 | 668 | ), |
| 669 | 669 | 'pk' => array(), |
| 670 | 670 | 'fk' => array(), |
@@ -672,12 +672,12 @@ discard block |
||
| 672 | 672 | 'uc' => array() |
| 673 | 673 | ) |
| 674 | 674 | ); |
| 675 | - $GLOBALS['egw_setup']->oProc->query('SELECT * FROM calendar_entry_repeats',__LINE__,__FILE__); |
|
| 676 | - while($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 675 | + $GLOBALS['egw_setup']->oProc->query('SELECT * FROM calendar_entry_repeats', __LINE__, __FILE__); |
|
| 676 | + while ($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 677 | 677 | { |
| 678 | 678 | $id = $GLOBALS['egw_setup']->oProc->f('cal_id'); |
| 679 | 679 | $recur_type = $GLOBALS['egw_setup']->oProc->f('cal_type'); |
| 680 | - switch($recur_type) |
|
| 680 | + switch ($recur_type) |
|
| 681 | 681 | { |
| 682 | 682 | case 'daily': |
| 683 | 683 | $recur_type_num = RECUR_DAILY; |
@@ -700,20 +700,20 @@ discard block |
||
| 700 | 700 | $recur_interval = $GLOBALS['egw_setup']->oProc->f('cal_frequency'); |
| 701 | 701 | $days = strtoupper($GLOBALS['egw_setup']->oProc->f('cal_days')); |
| 702 | 702 | $recur_data = 0; |
| 703 | - $recur_data += (substr($days,0,1)=='Y'?M_SUNDAY:0); |
|
| 704 | - $recur_data += (substr($days,1,1)=='Y'?M_MONDAY:0); |
|
| 705 | - $recur_data += (substr($days,2,1)=='Y'?M_TUESDAY:0); |
|
| 706 | - $recur_data += (substr($days,3,1)=='Y'?M_WEDNESDAY:0); |
|
| 707 | - $recur_data += (substr($days,4,1)=='Y'?M_THURSDAY:0); |
|
| 708 | - $recur_data += (substr($days,5,1)=='Y'?M_FRIDAY:0); |
|
| 709 | - $recur_data += (substr($days,6,1)=='Y'?M_SATURDAY:0); |
|
| 703 | + $recur_data += (substr($days, 0, 1) == 'Y' ?M_SUNDAY:0); |
|
| 704 | + $recur_data += (substr($days, 1, 1) == 'Y' ?M_MONDAY:0); |
|
| 705 | + $recur_data += (substr($days, 2, 1) == 'Y' ?M_TUESDAY:0); |
|
| 706 | + $recur_data += (substr($days, 3, 1) == 'Y' ?M_WEDNESDAY:0); |
|
| 707 | + $recur_data += (substr($days, 4, 1) == 'Y' ?M_THURSDAY:0); |
|
| 708 | + $recur_data += (substr($days, 5, 1) == 'Y' ?M_FRIDAY:0); |
|
| 709 | + $recur_data += (substr($days, 6, 1) == 'Y' ?M_SATURDAY:0); |
|
| 710 | 710 | $db2->query("INSERT INTO phpgw_cal_repeats(cal_id,recur_type,recur_use_end,recur_enddate,recur_interval,recur_data) " |
| 711 | - . "VALUES($id,$recur_type_num,$recur_use_end,$recur_end,$recur_interval,$recur_data)",__LINE__,__FILE__); |
|
| 711 | + . "VALUES($id,$recur_type_num,$recur_use_end,$recur_end,$recur_interval,$recur_data)", __LINE__, __FILE__); |
|
| 712 | 712 | } |
| 713 | 713 | $GLOBALS['egw_setup']->oProc->DropTable('calendar_entry_repeats'); |
| 714 | 714 | |
| 715 | 715 | // calendar_entry_user => phpgw_cal_user |
| 716 | - $GLOBALS['egw_setup']->oProc->RenameTable('calendar_entry_user','phpgw_cal_user'); |
|
| 716 | + $GLOBALS['egw_setup']->oProc->RenameTable('calendar_entry_user', 'phpgw_cal_user'); |
|
| 717 | 717 | |
| 718 | 718 | $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.11.002'; |
| 719 | 719 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -732,11 +732,11 @@ discard block |
||
| 732 | 732 | $GLOBALS['egw_setup']->oProc->CreateTable('phpgw_cal_holidays', |
| 733 | 733 | Array( |
| 734 | 734 | 'fd' => array( |
| 735 | - 'locale' => array('type' => 'char', 'precision' => 2,'nullable' => False), |
|
| 736 | - 'name' => array('type' => 'varchar', 'precision' => 50,'nullable' => False), |
|
| 737 | - 'date_time' => array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0') |
|
| 735 | + 'locale' => array('type' => 'char', 'precision' => 2, 'nullable' => False), |
|
| 736 | + 'name' => array('type' => 'varchar', 'precision' => 50, 'nullable' => False), |
|
| 737 | + 'date_time' => array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0') |
|
| 738 | 738 | ), |
| 739 | - 'pk' => array('locale','name'), |
|
| 739 | + 'pk' => array('locale', 'name'), |
|
| 740 | 740 | 'fk' => array(), |
| 741 | 741 | 'ix' => array(), |
| 742 | 742 | 'uc' => array() |
@@ -768,10 +768,10 @@ discard block |
||
| 768 | 768 | $GLOBALS['egw_setup']->oProc->CreateTable('phpgw_cal_holidays', |
| 769 | 769 | Array( |
| 770 | 770 | 'fd' => array( |
| 771 | - 'hol_id' => array('type' => 'auto','nullable' => False), |
|
| 772 | - 'locale' => array('type' => 'char', 'precision' => 2,'nullable' => False), |
|
| 773 | - 'name' => array('type' => 'varchar', 'precision' => 50,'nullable' => False), |
|
| 774 | - 'date_time' => array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0') |
|
| 771 | + 'hol_id' => array('type' => 'auto', 'nullable' => False), |
|
| 772 | + 'locale' => array('type' => 'char', 'precision' => 2, 'nullable' => False), |
|
| 773 | + 'name' => array('type' => 'varchar', 'precision' => 50, 'nullable' => False), |
|
| 774 | + 'date_time' => array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0') |
|
| 775 | 775 | ), |
| 776 | 776 | 'pk' => array('hol_id'), |
| 777 | 777 | 'fk' => array(), |
@@ -788,10 +788,10 @@ discard block |
||
| 788 | 788 | function calendar_upgrade0_9_11_007() |
| 789 | 789 | { |
| 790 | 790 | $GLOBALS['egw_setup']->oProc->query('DELETE FROM phpgw_cal_holidays'); |
| 791 | - $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays','mday',array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0')); |
|
| 792 | - $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays','month_num',array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0')); |
|
| 793 | - $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays','occurence',array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0')); |
|
| 794 | - $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays','dow',array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0')); |
|
| 791 | + $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays', 'mday', array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0')); |
|
| 792 | + $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays', 'month_num', array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0')); |
|
| 793 | + $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays', 'occurence', array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0')); |
|
| 794 | + $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays', 'dow', array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0')); |
|
| 795 | 795 | |
| 796 | 796 | $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.11.008'; |
| 797 | 797 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -808,7 +808,7 @@ discard block |
||
| 808 | 808 | function calendar_upgrade0_9_11_009() |
| 809 | 809 | { |
| 810 | 810 | $GLOBALS['egw_setup']->oProc->query('DELETE FROM phpgw_cal_holidays'); |
| 811 | - $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays','observance_rule',array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0')); |
|
| 811 | + $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays', 'observance_rule', array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0')); |
|
| 812 | 812 | |
| 813 | 813 | $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.11.010'; |
| 814 | 814 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -843,7 +843,7 @@ discard block |
||
| 843 | 843 | |
| 844 | 844 | function calendar_upgrade0_9_13_002() |
| 845 | 845 | { |
| 846 | - $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal','reference',array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0')); |
|
| 846 | + $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal', 'reference', array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0')); |
|
| 847 | 847 | |
| 848 | 848 | $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.13.003'; |
| 849 | 849 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -855,7 +855,7 @@ discard block |
||
| 855 | 855 | $GLOBALS['egw_setup']->oProc->CreateTable('phpgw_cal_alarm', |
| 856 | 856 | Array( |
| 857 | 857 | 'fd' => array( |
| 858 | - 'alarm_id' => array('type' => 'auto','nullable' => False), |
|
| 858 | + 'alarm_id' => array('type' => 'auto', 'nullable' => False), |
|
| 859 | 859 | 'cal_id' => array('type' => 'int', 'precision' => 8, 'nullable' => False), |
| 860 | 860 | 'cal_owner' => array('type' => 'int', 'precision' => 8, 'nullable' => False), |
| 861 | 861 | 'cal_time' => array('type' => 'int', 'precision' => 8, 'nullable' => False), |
@@ -868,8 +868,8 @@ discard block |
||
| 868 | 868 | ) |
| 869 | 869 | ); |
| 870 | 870 | |
| 871 | - $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal','uid',array('type' => 'varchar', 'precision' => 255,'nullable' => False)); |
|
| 872 | - $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal','location',array('type' => 'varchar', 'precision' => 255,'nullable' => True)); |
|
| 871 | + $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal', 'uid', array('type' => 'varchar', 'precision' => 255, 'nullable' => False)); |
|
| 872 | + $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal', 'location', array('type' => 'varchar', 'precision' => 255, 'nullable' => True)); |
|
| 873 | 873 | |
| 874 | 874 | $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.13.004'; |
| 875 | 875 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -878,7 +878,7 @@ discard block |
||
| 878 | 878 | |
| 879 | 879 | function calendar_upgrade0_9_13_004() |
| 880 | 880 | { |
| 881 | - $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_alarm','alarm_enabled',array('type' => 'int', 'precision' => 4,'nullable' => False, 'default' => '1')); |
|
| 881 | + $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_alarm', 'alarm_enabled', array('type' => 'int', 'precision' => 4, 'nullable' => False, 'default' => '1')); |
|
| 882 | 882 | |
| 883 | 883 | $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.13.005'; |
| 884 | 884 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -888,18 +888,18 @@ discard block |
||
| 888 | 888 | function calendar_upgrade0_9_13_005() |
| 889 | 889 | { |
| 890 | 890 | $calendar_data = Array(); |
| 891 | - $GLOBALS['egw_setup']->oProc->query('SELECT cal_id, category FROM phpgw_cal',__LINE__,__FILE__); |
|
| 892 | - while($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 891 | + $GLOBALS['egw_setup']->oProc->query('SELECT cal_id, category FROM phpgw_cal', __LINE__, __FILE__); |
|
| 892 | + while ($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 893 | 893 | { |
| 894 | 894 | $calendar_data[$GLOBALS['egw_setup']->oProc->f('cal_id')] = $GLOBALS['egw_setup']->oProc->f('category'); |
| 895 | 895 | } |
| 896 | 896 | |
| 897 | - $GLOBALS['egw_setup']->oProc->AlterColumn('phpgw_cal','category',array('type' => 'varchar', 'precision' => 30,'nullable' => True)); |
|
| 897 | + $GLOBALS['egw_setup']->oProc->AlterColumn('phpgw_cal', 'category', array('type' => 'varchar', 'precision' => 30, 'nullable' => True)); |
|
| 898 | 898 | |
| 899 | 899 | @reset($calendar_data); |
| 900 | - while($calendar_data && list($cal_id,$category) = each($calendar_data)) |
|
| 900 | + while ($calendar_data && list($cal_id, $category) = each($calendar_data)) |
|
| 901 | 901 | { |
| 902 | - $GLOBALS['egw_setup']->oProc->query("UPDATE phpgw_cal SET category='".$category."' WHERE cal_id=".$cal_id,__LINE__,__FILE__); |
|
| 902 | + $GLOBALS['egw_setup']->oProc->query("UPDATE phpgw_cal SET category='".$category."' WHERE cal_id=".$cal_id, __LINE__, __FILE__); |
|
| 903 | 903 | } |
| 904 | 904 | $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.13.006'; |
| 905 | 905 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -908,7 +908,7 @@ discard block |
||
| 908 | 908 | |
| 909 | 909 | function calendar_upgrade0_9_13_006() |
| 910 | 910 | { |
| 911 | - $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_repeats','recur_exception',array('type' => 'varchar', 'precision' => 255, 'nullable' => True, 'default' => '')); |
|
| 911 | + $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_repeats', 'recur_exception', array('type' => 'varchar', 'precision' => 255, 'nullable' => True, 'default' => '')); |
|
| 912 | 912 | |
| 913 | 913 | $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.13.007'; |
| 914 | 914 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -918,20 +918,20 @@ discard block |
||
| 918 | 918 | |
| 919 | 919 | function calendar_upgrade0_9_13_007() |
| 920 | 920 | { |
| 921 | - $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_user','cal_type',array( |
|
| 921 | + $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_user', 'cal_type', array( |
|
| 922 | 922 | 'type' => 'varchar', |
| 923 | 923 | 'precision' => '1', |
| 924 | 924 | 'nullable' => False, |
| 925 | 925 | 'default' => 'u' |
| 926 | 926 | )); |
| 927 | 927 | |
| 928 | - $GLOBALS['egw_setup']->oProc->CreateTable('phpgw_cal_extra',array( |
|
| 928 | + $GLOBALS['egw_setup']->oProc->CreateTable('phpgw_cal_extra', array( |
|
| 929 | 929 | 'fd' => array( |
| 930 | - 'cal_id' => array('type' => 'int','precision' => '4','nullable' => False), |
|
| 931 | - 'cal_extra_name' => array('type' => 'varchar','precision' => '40','nullable' => False), |
|
| 932 | - 'cal_extra_value' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '') |
|
| 930 | + 'cal_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
| 931 | + 'cal_extra_name' => array('type' => 'varchar', 'precision' => '40', 'nullable' => False), |
|
| 932 | + 'cal_extra_value' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '') |
|
| 933 | 933 | ), |
| 934 | - 'pk' => array('cal_id','cal_extra_name'), |
|
| 934 | + 'pk' => array('cal_id', 'cal_extra_name'), |
|
| 935 | 935 | 'fk' => array(), |
| 936 | 936 | 'ix' => array(), |
| 937 | 937 | 'uc' => array() |
@@ -948,7 +948,7 @@ discard block |
||
| 948 | 948 | function calendar_upgrade0_9_16_001() |
| 949 | 949 | { |
| 950 | 950 | // this is to set the default as schema_proc was not setting an empty default |
| 951 | - $GLOBALS['egw_setup']->oProc->AlterColumn('phpgw_cal_user','cal_type',array( |
|
| 951 | + $GLOBALS['egw_setup']->oProc->AlterColumn('phpgw_cal_user', 'cal_type', array( |
|
| 952 | 952 | 'type' => 'varchar', |
| 953 | 953 | 'precision' => '1', |
| 954 | 954 | 'nullable' => False, |
@@ -965,15 +965,15 @@ discard block |
||
| 965 | 965 | |
| 966 | 966 | function calendar_upgrade0_9_16_002() |
| 967 | 967 | { |
| 968 | - $GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_repeats',array( |
|
| 968 | + $GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_repeats', array( |
|
| 969 | 969 | 'fd' => array( |
| 970 | - 'cal_id' => array('type' => 'int','precision' => '8','nullable' => False), |
|
| 971 | - 'recur_type' => array('type' => 'int','precision' => '8','nullable' => False), |
|
| 972 | - 'recur_use_end' => array('type' => 'int','precision' => '8','default' => '0'), |
|
| 973 | - 'recur_enddate' => array('type' => 'int','precision' => '8'), |
|
| 974 | - 'recur_interval' => array('type' => 'int','precision' => '8','default' => '1'), |
|
| 975 | - 'recur_data' => array('type' => 'int','precision' => '8','default' => '1'), |
|
| 976 | - 'recur_exception' => array('type' => 'varchar','precision' => '255','default' => '') |
|
| 970 | + 'cal_id' => array('type' => 'int', 'precision' => '8', 'nullable' => False), |
|
| 971 | + 'recur_type' => array('type' => 'int', 'precision' => '8', 'nullable' => False), |
|
| 972 | + 'recur_use_end' => array('type' => 'int', 'precision' => '8', 'default' => '0'), |
|
| 973 | + 'recur_enddate' => array('type' => 'int', 'precision' => '8'), |
|
| 974 | + 'recur_interval' => array('type' => 'int', 'precision' => '8', 'default' => '1'), |
|
| 975 | + 'recur_data' => array('type' => 'int', 'precision' => '8', 'default' => '1'), |
|
| 976 | + 'recur_exception' => array('type' => 'varchar', 'precision' => '255', 'default' => '') |
|
| 977 | 977 | ), |
| 978 | 978 | 'pk' => array(), |
| 979 | 979 | 'fk' => array(), |
@@ -989,14 +989,14 @@ discard block |
||
| 989 | 989 | |
| 990 | 990 | function calendar_upgrade0_9_16_003() |
| 991 | 991 | { |
| 992 | - $GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_user',array( |
|
| 992 | + $GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_user', array( |
|
| 993 | 993 | 'fd' => array( |
| 994 | - 'cal_id' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'), |
|
| 995 | - 'cal_login' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'), |
|
| 996 | - 'cal_status' => array('type' => 'char','precision' => '1','default' => 'A'), |
|
| 997 | - 'cal_type' => array('type' => 'varchar','precision' => '1','nullable' => False,'default' => 'u') |
|
| 994 | + 'cal_id' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'), |
|
| 995 | + 'cal_login' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'), |
|
| 996 | + 'cal_status' => array('type' => 'char', 'precision' => '1', 'default' => 'A'), |
|
| 997 | + 'cal_type' => array('type' => 'varchar', 'precision' => '1', 'nullable' => False, 'default' => 'u') |
|
| 998 | 998 | ), |
| 999 | - 'pk' => array('cal_id','cal_login','cal_type'), |
|
| 999 | + 'pk' => array('cal_id', 'cal_login', 'cal_type'), |
|
| 1000 | 1000 | 'fk' => array(), |
| 1001 | 1001 | 'ix' => array(), |
| 1002 | 1002 | 'uc' => array() |
@@ -1010,16 +1010,16 @@ discard block |
||
| 1010 | 1010 | |
| 1011 | 1011 | function calendar_upgrade0_9_16_004() |
| 1012 | 1012 | { |
| 1013 | - $GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_holidays',array( |
|
| 1013 | + $GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_holidays', array( |
|
| 1014 | 1014 | 'fd' => array( |
| 1015 | - 'hol_id' => array('type' => 'auto','nullable' => False), |
|
| 1016 | - 'locale' => array('type' => 'char','precision' => '2','nullable' => False), |
|
| 1017 | - 'name' => array('type' => 'varchar','precision' => '50','nullable' => False), |
|
| 1018 | - 'mday' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'), |
|
| 1019 | - 'month_num' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'), |
|
| 1020 | - 'occurence' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'), |
|
| 1021 | - 'dow' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'), |
|
| 1022 | - 'observance_rule' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0') |
|
| 1015 | + 'hol_id' => array('type' => 'auto', 'nullable' => False), |
|
| 1016 | + 'locale' => array('type' => 'char', 'precision' => '2', 'nullable' => False), |
|
| 1017 | + 'name' => array('type' => 'varchar', 'precision' => '50', 'nullable' => False), |
|
| 1018 | + 'mday' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'), |
|
| 1019 | + 'month_num' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'), |
|
| 1020 | + 'occurence' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'), |
|
| 1021 | + 'dow' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'), |
|
| 1022 | + 'observance_rule' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0') |
|
| 1023 | 1023 | ), |
| 1024 | 1024 | 'pk' => array('hol_id'), |
| 1025 | 1025 | 'fk' => array(), |
@@ -1037,13 +1037,13 @@ discard block |
||
| 1037 | 1037 | { |
| 1038 | 1038 | // creates uid's for all entries which do not have unique ones, they are '[email protected]' |
| 1039 | 1039 | // very old entries even have an empty uid, see 0.9.16.006 update |
| 1040 | - $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 | + $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__); |
|
| 1041 | 1041 | while ($GLOBALS['egw_setup']->oProc->next_record()) |
| 1042 | 1042 | { |
| 1043 | 1043 | $config[$GLOBALS['egw_setup']->oProc->f(0)] = $GLOBALS['egw_setup']->oProc->f(1); |
| 1044 | 1044 | } |
| 1045 | 1045 | $GLOBALS['egw_setup']->oProc->query('UPDATE phpgw_cal SET uid='. |
| 1046 | - $GLOBALS['egw_setup']->db->concat($GLOBALS['egw_setup']->db->quote('cal-'),'cal_id', |
|
| 1046 | + $GLOBALS['egw_setup']->db->concat($GLOBALS['egw_setup']->db->quote('cal-'), 'cal_id', |
|
| 1047 | 1047 | $GLOBALS['egw_setup']->db->quote('-'.$config['install_id'].'@'. |
| 1048 | 1048 | ($config['mail_suffix'] ? $config['mail_suffix'] : 'local'))). |
| 1049 | 1049 | " WHERE uid LIKE '-@%' OR uid=''"); |
@@ -1066,7 +1066,7 @@ discard block |
||
| 1066 | 1066 | function calendar_upgrade0_9_16_007() |
| 1067 | 1067 | { |
| 1068 | 1068 | // update the sequenzes for refreshed tables (postgres only) |
| 1069 | - $GLOBALS['egw_setup']->oProc->UpdateSequence('phpgw_cal_holidays','hol_id'); |
|
| 1069 | + $GLOBALS['egw_setup']->oProc->UpdateSequence('phpgw_cal_holidays', 'hol_id'); |
|
| 1070 | 1070 | |
| 1071 | 1071 | $GLOBALS['setup_info']['calendar']['currentver'] = '1.0.0'; |
| 1072 | 1072 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -1076,19 +1076,19 @@ discard block |
||
| 1076 | 1076 | |
| 1077 | 1077 | function calendar_upgrade1_0_0() |
| 1078 | 1078 | { |
| 1079 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','uid','cal_uid'); |
|
| 1080 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','owner','cal_owner'); |
|
| 1081 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','category','cal_category'); |
|
| 1082 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','groups','cal_groups'); |
|
| 1083 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','datetime','cal_starttime'); |
|
| 1084 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','mdatetime','cal_modified'); |
|
| 1085 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','edatetime','cal_endtime'); |
|
| 1086 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','priority','cal_priority'); |
|
| 1087 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','is_public','cal_public'); |
|
| 1088 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','title','cal_title'); |
|
| 1089 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','description','cal_description'); |
|
| 1090 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','location','cal_location'); |
|
| 1091 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','reference','cal_reference'); |
|
| 1079 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'uid', 'cal_uid'); |
|
| 1080 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'owner', 'cal_owner'); |
|
| 1081 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'category', 'cal_category'); |
|
| 1082 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'groups', 'cal_groups'); |
|
| 1083 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'datetime', 'cal_starttime'); |
|
| 1084 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'mdatetime', 'cal_modified'); |
|
| 1085 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'edatetime', 'cal_endtime'); |
|
| 1086 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'priority', 'cal_priority'); |
|
| 1087 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'is_public', 'cal_public'); |
|
| 1088 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'title', 'cal_title'); |
|
| 1089 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'description', 'cal_description'); |
|
| 1090 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'location', 'cal_location'); |
|
| 1091 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'reference', 'cal_reference'); |
|
| 1092 | 1092 | |
| 1093 | 1093 | $GLOBALS['setup_info']['calendar']['currentver'] = '1.0.0.001'; |
| 1094 | 1094 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -1098,13 +1098,13 @@ discard block |
||
| 1098 | 1098 | |
| 1099 | 1099 | function calendar_upgrade1_0_0_001() |
| 1100 | 1100 | { |
| 1101 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays','locale','hol_locale'); |
|
| 1102 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays','name','hol_name'); |
|
| 1103 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays','mday','hol_mday'); |
|
| 1104 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays','month_num','hol_month_num'); |
|
| 1105 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays','occurence','hol_occurence'); |
|
| 1106 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays','dow','hol_dow'); |
|
| 1107 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays','observance_rule','hol_observance_rule'); |
|
| 1101 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays', 'locale', 'hol_locale'); |
|
| 1102 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays', 'name', 'hol_name'); |
|
| 1103 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays', 'mday', 'hol_mday'); |
|
| 1104 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays', 'month_num', 'hol_month_num'); |
|
| 1105 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays', 'occurence', 'hol_occurence'); |
|
| 1106 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays', 'dow', 'hol_dow'); |
|
| 1107 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays', 'observance_rule', 'hol_observance_rule'); |
|
| 1108 | 1108 | |
| 1109 | 1109 | $GLOBALS['setup_info']['calendar']['currentver'] = '1.0.0.002'; |
| 1110 | 1110 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -1114,8 +1114,8 @@ discard block |
||
| 1114 | 1114 | |
| 1115 | 1115 | function calendar_upgrade1_0_0_002() |
| 1116 | 1116 | { |
| 1117 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_user','cal_login','cal_user_id'); |
|
| 1118 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_user','cal_type','cal_user_type'); |
|
| 1117 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_user', 'cal_login', 'cal_user_id'); |
|
| 1118 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_user', 'cal_type', 'cal_user_type'); |
|
| 1119 | 1119 | |
| 1120 | 1120 | $GLOBALS['setup_info']['calendar']['currentver'] = '1.0.0.003'; |
| 1121 | 1121 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -1125,7 +1125,7 @@ discard block |
||
| 1125 | 1125 | |
| 1126 | 1126 | function calendar_upgrade1_0_0_003() |
| 1127 | 1127 | { |
| 1128 | - $GLOBALS['egw_setup']->oProc->AlterColumn('phpgw_cal','cal_title',array( |
|
| 1128 | + $GLOBALS['egw_setup']->oProc->AlterColumn('phpgw_cal', 'cal_title', array( |
|
| 1129 | 1129 | 'type' => 'varchar', |
| 1130 | 1130 | 'precision' => '255', |
| 1131 | 1131 | 'nullable' => False, |
@@ -1140,15 +1140,15 @@ discard block |
||
| 1140 | 1140 | |
| 1141 | 1141 | function calendar_upgrade1_0_0_004() |
| 1142 | 1142 | { |
| 1143 | - $GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_repeats',array( |
|
| 1143 | + $GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_repeats', array( |
|
| 1144 | 1144 | 'fd' => array( |
| 1145 | - 'cal_id' => array('type' => 'int','precision' => '8','nullable' => False), |
|
| 1146 | - 'recur_type' => array('type' => 'int','precision' => '8','nullable' => False), |
|
| 1147 | - 'recur_use_end' => array('type' => 'int','precision' => '8','default' => '0'), |
|
| 1148 | - 'recur_enddate' => array('type' => 'int','precision' => '8'), |
|
| 1149 | - 'recur_interval' => array('type' => 'int','precision' => '8','default' => '1'), |
|
| 1150 | - 'recur_data' => array('type' => 'int','precision' => '8','default' => '1'), |
|
| 1151 | - 'recur_exception' => array('type' => 'varchar','precision' => '255','default' => '') |
|
| 1145 | + 'cal_id' => array('type' => 'int', 'precision' => '8', 'nullable' => False), |
|
| 1146 | + 'recur_type' => array('type' => 'int', 'precision' => '8', 'nullable' => False), |
|
| 1147 | + 'recur_use_end' => array('type' => 'int', 'precision' => '8', 'default' => '0'), |
|
| 1148 | + 'recur_enddate' => array('type' => 'int', 'precision' => '8'), |
|
| 1149 | + 'recur_interval' => array('type' => 'int', 'precision' => '8', 'default' => '1'), |
|
| 1150 | + 'recur_data' => array('type' => 'int', 'precision' => '8', 'default' => '1'), |
|
| 1151 | + 'recur_exception' => array('type' => 'varchar', 'precision' => '255', 'default' => '') |
|
| 1152 | 1152 | ), |
| 1153 | 1153 | 'pk' => array('cal_id'), |
| 1154 | 1154 | 'fk' => array(), |
@@ -1165,19 +1165,19 @@ discard block |
||
| 1165 | 1165 | function calendar_upgrade1_0_0_005() |
| 1166 | 1166 | { |
| 1167 | 1167 | // change prefix of all calendar tables to egw_ |
| 1168 | - foreach(array('cal_user','cal_repeats','cal_extra','cal_holidays','cal') as $name) |
|
| 1168 | + foreach (array('cal_user', 'cal_repeats', 'cal_extra', 'cal_holidays', 'cal') as $name) |
|
| 1169 | 1169 | { |
| 1170 | - $GLOBALS['egw_setup']->oProc->RenameTable('phpgw_'.$name,'egw_'.$name); |
|
| 1170 | + $GLOBALS['egw_setup']->oProc->RenameTable('phpgw_'.$name, 'egw_'.$name); |
|
| 1171 | 1171 | } |
| 1172 | 1172 | |
| 1173 | 1173 | // create new dates table, with content from the egw_cal table |
| 1174 | - $GLOBALS['egw_setup']->oProc->CreateTable('egw_cal_dates',array( |
|
| 1174 | + $GLOBALS['egw_setup']->oProc->CreateTable('egw_cal_dates', array( |
|
| 1175 | 1175 | 'fd' => array( |
| 1176 | - 'cal_id' => array('type' => 'int','precision' => '4','nullable' => False), |
|
| 1177 | - 'cal_start' => array('type' => 'int','precision' => '8','nullable' => False), |
|
| 1178 | - 'cal_end' => array('type' => 'int','precision' => '8','nullable' => False) |
|
| 1176 | + 'cal_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
| 1177 | + 'cal_start' => array('type' => 'int', 'precision' => '8', 'nullable' => False), |
|
| 1178 | + 'cal_end' => array('type' => 'int', 'precision' => '8', 'nullable' => False) |
|
| 1179 | 1179 | ), |
| 1180 | - 'pk' => array('cal_id','cal_start'), |
|
| 1180 | + 'pk' => array('cal_id', 'cal_start'), |
|
| 1181 | 1181 | 'fk' => array(), |
| 1182 | 1182 | 'ix' => array(), |
| 1183 | 1183 | 'uc' => array() |
@@ -1185,49 +1185,49 @@ discard block |
||
| 1185 | 1185 | $GLOBALS['egw_setup']->oProc->query("INSERT INTO egw_cal_dates SELECT cal_id,cal_starttime,cal_endtime FROM egw_cal"); |
| 1186 | 1186 | |
| 1187 | 1187 | // drop the fields transfered to the dates table |
| 1188 | - $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal',array( |
|
| 1188 | + $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal', array( |
|
| 1189 | 1189 | 'fd' => array( |
| 1190 | - 'cal_id' => array('type' => 'auto','nullable' => False), |
|
| 1191 | - 'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False), |
|
| 1192 | - 'cal_owner' => array('type' => 'int','precision' => '8','nullable' => False), |
|
| 1193 | - 'cal_category' => array('type' => 'varchar','precision' => '30'), |
|
| 1194 | - 'cal_groups' => array('type' => 'varchar','precision' => '255'), |
|
| 1195 | - 'cal_modified' => array('type' => 'int','precision' => '8'), |
|
| 1196 | - 'cal_endtime' => array('type' => 'int','precision' => '8'), |
|
| 1197 | - 'cal_priority' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '2'), |
|
| 1198 | - 'cal_type' => array('type' => 'varchar','precision' => '10'), |
|
| 1199 | - 'cal_public' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '1'), |
|
| 1200 | - 'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'), |
|
| 1190 | + 'cal_id' => array('type' => 'auto', 'nullable' => False), |
|
| 1191 | + 'cal_uid' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False), |
|
| 1192 | + 'cal_owner' => array('type' => 'int', 'precision' => '8', 'nullable' => False), |
|
| 1193 | + 'cal_category' => array('type' => 'varchar', 'precision' => '30'), |
|
| 1194 | + 'cal_groups' => array('type' => 'varchar', 'precision' => '255'), |
|
| 1195 | + 'cal_modified' => array('type' => 'int', 'precision' => '8'), |
|
| 1196 | + 'cal_endtime' => array('type' => 'int', 'precision' => '8'), |
|
| 1197 | + 'cal_priority' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '2'), |
|
| 1198 | + 'cal_type' => array('type' => 'varchar', 'precision' => '10'), |
|
| 1199 | + 'cal_public' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '1'), |
|
| 1200 | + 'cal_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '1'), |
|
| 1201 | 1201 | 'cal_description' => array('type' => 'text'), |
| 1202 | - 'cal_location' => array('type' => 'varchar','precision' => '255'), |
|
| 1203 | - 'cal_reference' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0') |
|
| 1202 | + 'cal_location' => array('type' => 'varchar', 'precision' => '255'), |
|
| 1203 | + 'cal_reference' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0') |
|
| 1204 | 1204 | ), |
| 1205 | 1205 | 'pk' => array('cal_id'), |
| 1206 | 1206 | 'fk' => array(), |
| 1207 | 1207 | 'ix' => array(), |
| 1208 | 1208 | 'uc' => array() |
| 1209 | - ),'cal_starttime'); |
|
| 1210 | - $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal',array( |
|
| 1209 | + ), 'cal_starttime'); |
|
| 1210 | + $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal', array( |
|
| 1211 | 1211 | 'fd' => array( |
| 1212 | - 'cal_id' => array('type' => 'auto','nullable' => False), |
|
| 1213 | - 'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False), |
|
| 1214 | - 'cal_owner' => array('type' => 'int','precision' => '8','nullable' => False), |
|
| 1215 | - 'cal_category' => array('type' => 'varchar','precision' => '30'), |
|
| 1216 | - 'cal_groups' => array('type' => 'varchar','precision' => '255'), |
|
| 1217 | - 'cal_modified' => array('type' => 'int','precision' => '8'), |
|
| 1218 | - 'cal_priority' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '2'), |
|
| 1219 | - 'cal_type' => array('type' => 'varchar','precision' => '10'), |
|
| 1220 | - 'cal_public' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '1'), |
|
| 1221 | - 'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'), |
|
| 1212 | + 'cal_id' => array('type' => 'auto', 'nullable' => False), |
|
| 1213 | + 'cal_uid' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False), |
|
| 1214 | + 'cal_owner' => array('type' => 'int', 'precision' => '8', 'nullable' => False), |
|
| 1215 | + 'cal_category' => array('type' => 'varchar', 'precision' => '30'), |
|
| 1216 | + 'cal_groups' => array('type' => 'varchar', 'precision' => '255'), |
|
| 1217 | + 'cal_modified' => array('type' => 'int', 'precision' => '8'), |
|
| 1218 | + 'cal_priority' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '2'), |
|
| 1219 | + 'cal_type' => array('type' => 'varchar', 'precision' => '10'), |
|
| 1220 | + 'cal_public' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '1'), |
|
| 1221 | + 'cal_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '1'), |
|
| 1222 | 1222 | 'cal_description' => array('type' => 'text'), |
| 1223 | - 'cal_location' => array('type' => 'varchar','precision' => '255'), |
|
| 1224 | - 'cal_reference' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0') |
|
| 1223 | + 'cal_location' => array('type' => 'varchar', 'precision' => '255'), |
|
| 1224 | + 'cal_reference' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0') |
|
| 1225 | 1225 | ), |
| 1226 | 1226 | 'pk' => array('cal_id'), |
| 1227 | 1227 | 'fk' => array(), |
| 1228 | 1228 | 'ix' => array(), |
| 1229 | 1229 | 'uc' => array() |
| 1230 | - ),'cal_endtime'); |
|
| 1230 | + ), 'cal_endtime'); |
|
| 1231 | 1231 | |
| 1232 | 1232 | $GLOBALS['setup_info']['calendar']['currentver'] = '1.0.1.001'; |
| 1233 | 1233 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -1243,15 +1243,15 @@ discard block |
||
| 1243 | 1243 | 'precision' => '8', |
| 1244 | 1244 | 'default' => '0' |
| 1245 | 1245 | ));*/ |
| 1246 | - $GLOBALS['egw_setup']->oProc->RefreshTable('egw_cal_user',array( |
|
| 1246 | + $GLOBALS['egw_setup']->oProc->RefreshTable('egw_cal_user', array( |
|
| 1247 | 1247 | 'fd' => array( |
| 1248 | - 'cal_id' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'), |
|
| 1249 | - 'cal_recur_date' => array('type' => 'int','precision' => '8','default' => '0'), |
|
| 1250 | - 'cal_user_type' => array('type' => 'varchar','precision' => '1','nullable' => False,'default' => 'u'), |
|
| 1251 | - 'cal_user_id' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'), |
|
| 1252 | - 'cal_status' => array('type' => 'char','precision' => '1','default' => 'A') |
|
| 1248 | + 'cal_id' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'), |
|
| 1249 | + 'cal_recur_date' => array('type' => 'int', 'precision' => '8', 'default' => '0'), |
|
| 1250 | + 'cal_user_type' => array('type' => 'varchar', 'precision' => '1', 'nullable' => False, 'default' => 'u'), |
|
| 1251 | + 'cal_user_id' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'), |
|
| 1252 | + 'cal_status' => array('type' => 'char', 'precision' => '1', 'default' => 'A') |
|
| 1253 | 1253 | ), |
| 1254 | - 'pk' => array('cal_id','cal_recur_date','cal_user_type','cal_user_id'), |
|
| 1254 | + 'pk' => array('cal_id', 'cal_recur_date', 'cal_user_type', 'cal_user_id'), |
|
| 1255 | 1255 | 'fk' => array(), |
| 1256 | 1256 | 'ix' => array(), |
| 1257 | 1257 | 'uc' => array() |
@@ -1265,50 +1265,50 @@ discard block |
||
| 1265 | 1265 | |
| 1266 | 1266 | function calendar_upgrade1_0_1_002() |
| 1267 | 1267 | { |
| 1268 | - $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal',array( |
|
| 1268 | + $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal', array( |
|
| 1269 | 1269 | 'fd' => array( |
| 1270 | - 'cal_id' => array('type' => 'auto','nullable' => False), |
|
| 1271 | - 'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False), |
|
| 1272 | - 'cal_owner' => array('type' => 'int','precision' => '8','nullable' => False), |
|
| 1273 | - 'cal_category' => array('type' => 'varchar','precision' => '30'), |
|
| 1274 | - 'cal_groups' => array('type' => 'varchar','precision' => '255'), |
|
| 1275 | - 'cal_modified' => array('type' => 'int','precision' => '8'), |
|
| 1276 | - 'cal_priority' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '2'), |
|
| 1277 | - 'cal_public' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '1'), |
|
| 1278 | - 'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'), |
|
| 1270 | + 'cal_id' => array('type' => 'auto', 'nullable' => False), |
|
| 1271 | + 'cal_uid' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False), |
|
| 1272 | + 'cal_owner' => array('type' => 'int', 'precision' => '8', 'nullable' => False), |
|
| 1273 | + 'cal_category' => array('type' => 'varchar', 'precision' => '30'), |
|
| 1274 | + 'cal_groups' => array('type' => 'varchar', 'precision' => '255'), |
|
| 1275 | + 'cal_modified' => array('type' => 'int', 'precision' => '8'), |
|
| 1276 | + 'cal_priority' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '2'), |
|
| 1277 | + 'cal_public' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '1'), |
|
| 1278 | + 'cal_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '1'), |
|
| 1279 | 1279 | 'cal_description' => array('type' => 'text'), |
| 1280 | - 'cal_location' => array('type' => 'varchar','precision' => '255'), |
|
| 1281 | - 'cal_reference' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0') |
|
| 1280 | + 'cal_location' => array('type' => 'varchar', 'precision' => '255'), |
|
| 1281 | + 'cal_reference' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0') |
|
| 1282 | 1282 | ), |
| 1283 | 1283 | 'pk' => array('cal_id'), |
| 1284 | 1284 | 'fk' => array(), |
| 1285 | 1285 | 'ix' => array(), |
| 1286 | 1286 | 'uc' => array() |
| 1287 | - ),'cal_type'); |
|
| 1288 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_owner',array( |
|
| 1287 | + ), 'cal_type'); |
|
| 1288 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_owner', array( |
|
| 1289 | 1289 | 'type' => 'int', |
| 1290 | 1290 | 'precision' => '4', |
| 1291 | 1291 | 'nullable' => False |
| 1292 | 1292 | )); |
| 1293 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_priority',array( |
|
| 1293 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_priority', array( |
|
| 1294 | 1294 | 'type' => 'int', |
| 1295 | 1295 | 'precision' => '2', |
| 1296 | 1296 | 'nullable' => False, |
| 1297 | 1297 | 'default' => '2' |
| 1298 | 1298 | )); |
| 1299 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_public',array( |
|
| 1299 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_public', array( |
|
| 1300 | 1300 | 'type' => 'int', |
| 1301 | 1301 | 'precision' => '2', |
| 1302 | 1302 | 'nullable' => False, |
| 1303 | 1303 | 'default' => '1' |
| 1304 | 1304 | )); |
| 1305 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_reference',array( |
|
| 1305 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_reference', array( |
|
| 1306 | 1306 | 'type' => 'int', |
| 1307 | 1307 | 'precision' => '4', |
| 1308 | 1308 | 'nullable' => False, |
| 1309 | 1309 | 'default' => '0' |
| 1310 | 1310 | )); |
| 1311 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_modifier',array( |
|
| 1311 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_modifier', array( |
|
| 1312 | 1312 | 'type' => 'int', |
| 1313 | 1313 | 'precision' => '4' |
| 1314 | 1314 | )); |
@@ -1321,36 +1321,36 @@ discard block |
||
| 1321 | 1321 | |
| 1322 | 1322 | function calendar_upgrade1_0_1_003() |
| 1323 | 1323 | { |
| 1324 | - $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal_repeats',array( |
|
| 1324 | + $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal_repeats', array( |
|
| 1325 | 1325 | 'fd' => array( |
| 1326 | - 'cal_id' => array('type' => 'int','precision' => '8','nullable' => False), |
|
| 1327 | - 'recur_type' => array('type' => 'int','precision' => '8','nullable' => False), |
|
| 1328 | - 'recur_enddate' => array('type' => 'int','precision' => '8'), |
|
| 1329 | - 'recur_interval' => array('type' => 'int','precision' => '8','default' => '1'), |
|
| 1330 | - 'recur_data' => array('type' => 'int','precision' => '8','default' => '1'), |
|
| 1331 | - 'recur_exception' => array('type' => 'varchar','precision' => '255','default' => '') |
|
| 1326 | + 'cal_id' => array('type' => 'int', 'precision' => '8', 'nullable' => False), |
|
| 1327 | + 'recur_type' => array('type' => 'int', 'precision' => '8', 'nullable' => False), |
|
| 1328 | + 'recur_enddate' => array('type' => 'int', 'precision' => '8'), |
|
| 1329 | + 'recur_interval' => array('type' => 'int', 'precision' => '8', 'default' => '1'), |
|
| 1330 | + 'recur_data' => array('type' => 'int', 'precision' => '8', 'default' => '1'), |
|
| 1331 | + 'recur_exception' => array('type' => 'varchar', 'precision' => '255', 'default' => '') |
|
| 1332 | 1332 | ), |
| 1333 | 1333 | 'pk' => array('cal_id'), |
| 1334 | 1334 | 'fk' => array(), |
| 1335 | 1335 | 'ix' => array(), |
| 1336 | 1336 | 'uc' => array() |
| 1337 | - ),'recur_use_end'); |
|
| 1338 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats','cal_id',array( |
|
| 1337 | + ), 'recur_use_end'); |
|
| 1338 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats', 'cal_id', array( |
|
| 1339 | 1339 | 'type' => 'int', |
| 1340 | 1340 | 'precision' => '4', |
| 1341 | 1341 | 'nullable' => False |
| 1342 | 1342 | )); |
| 1343 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats','recur_type',array( |
|
| 1343 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats', 'recur_type', array( |
|
| 1344 | 1344 | 'type' => 'int', |
| 1345 | 1345 | 'precision' => '2', |
| 1346 | 1346 | 'nullable' => False |
| 1347 | 1347 | )); |
| 1348 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats','recur_interval',array( |
|
| 1348 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats', 'recur_interval', array( |
|
| 1349 | 1349 | 'type' => 'int', |
| 1350 | 1350 | 'precision' => '2', |
| 1351 | 1351 | 'default' => '1' |
| 1352 | 1352 | )); |
| 1353 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats','recur_data',array( |
|
| 1353 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats', 'recur_data', array( |
|
| 1354 | 1354 | 'type' => 'int', |
| 1355 | 1355 | 'precision' => '2', |
| 1356 | 1356 | 'default' => '1' |
@@ -1364,13 +1364,13 @@ discard block |
||
| 1364 | 1364 | |
| 1365 | 1365 | function calendar_upgrade1_0_1_004() |
| 1366 | 1366 | { |
| 1367 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_id',array( |
|
| 1367 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_id', array( |
|
| 1368 | 1368 | 'type' => 'int', |
| 1369 | 1369 | 'precision' => '4', |
| 1370 | 1370 | 'nullable' => False, |
| 1371 | 1371 | 'default' => '0' |
| 1372 | 1372 | )); |
| 1373 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_user_id',array( |
|
| 1373 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_user_id', array( |
|
| 1374 | 1374 | 'type' => 'int', |
| 1375 | 1375 | 'precision' => '4', |
| 1376 | 1376 | 'nullable' => False, |
@@ -1385,7 +1385,7 @@ discard block |
||
| 1385 | 1385 | |
| 1386 | 1386 | function calendar_upgrade1_0_1_005() |
| 1387 | 1387 | { |
| 1388 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user','cal_quantity',array( |
|
| 1388 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user', 'cal_quantity', array( |
|
| 1389 | 1389 | 'type' => 'int', |
| 1390 | 1390 | 'precision' => '4', |
| 1391 | 1391 | 'default' => '1' |
@@ -1399,7 +1399,7 @@ discard block |
||
| 1399 | 1399 | |
| 1400 | 1400 | function calendar_upgrade1_0_1_006() |
| 1401 | 1401 | { |
| 1402 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_non_blocking',array( |
|
| 1402 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_non_blocking', array( |
|
| 1403 | 1403 | 'type' => 'int', |
| 1404 | 1404 | 'precision' => '2', |
| 1405 | 1405 | 'default' => '0' |
@@ -1413,9 +1413,9 @@ discard block |
||
| 1413 | 1413 | |
| 1414 | 1414 | function calendar_upgrade1_0_1_007() |
| 1415 | 1415 | { |
| 1416 | - $GLOBALS['egw_setup']->db->update('egw_cal_repeats',array('recur_exception' => null),array('recur_exception' => ''),__LINE__,__FILE__,'calendar'); |
|
| 1416 | + $GLOBALS['egw_setup']->db->update('egw_cal_repeats', array('recur_exception' => null), array('recur_exception' => ''), __LINE__, __FILE__, 'calendar'); |
|
| 1417 | 1417 | |
| 1418 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats','recur_exception',array( |
|
| 1418 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats', 'recur_exception', array( |
|
| 1419 | 1419 | 'type' => 'text' |
| 1420 | 1420 | )); |
| 1421 | 1421 | |
@@ -1432,11 +1432,11 @@ discard block |
||
| 1432 | 1432 | { |
| 1433 | 1433 | $customfields = array(); |
| 1434 | 1434 | $order = 0; |
| 1435 | - foreach($config_data['fields'] as $name => $data) |
|
| 1435 | + foreach ($config_data['fields'] as $name => $data) |
|
| 1436 | 1436 | { |
| 1437 | 1437 | if ($name{0} == '#' && !$data['disabled']) // real not-disabled custom field |
| 1438 | 1438 | { |
| 1439 | - $customfields[substr($name,1)] = array( |
|
| 1439 | + $customfields[substr($name, 1)] = array( |
|
| 1440 | 1440 | 'type' => 'text', |
| 1441 | 1441 | 'len' => $data['length'].($data['shown'] ? ','.$data['shown'] : ''), |
| 1442 | 1442 | 'label' => $data['name'], |
@@ -1459,38 +1459,38 @@ discard block |
||
| 1459 | 1459 | function calendar_upgrade1_0_1_009() |
| 1460 | 1460 | { |
| 1461 | 1461 | $db2 = clone($GLOBALS['egw_setup']->db); |
| 1462 | - $GLOBALS['egw_setup']->db->select('egw_cal','DISTINCT egw_cal.cal_id,cal_groups,cal_recur_date',"cal_groups != ''",__LINE__,__FILE__, |
|
| 1463 | - False,'','calendar',0,',egw_cal_user WHERE egw_cal.cal_id=egw_cal_user.cal_id'); |
|
| 1464 | - while(($row = $GLOBALS['egw_setup']->db->row(true))) |
|
| 1462 | + $GLOBALS['egw_setup']->db->select('egw_cal', 'DISTINCT egw_cal.cal_id,cal_groups,cal_recur_date', "cal_groups != ''", __LINE__, __FILE__, |
|
| 1463 | + False, '', 'calendar', 0, ',egw_cal_user WHERE egw_cal.cal_id=egw_cal_user.cal_id'); |
|
| 1464 | + while (($row = $GLOBALS['egw_setup']->db->row(true))) |
|
| 1465 | 1465 | { |
| 1466 | 1466 | $row['cal_user_type'] = 'u'; |
| 1467 | - foreach(explode(',',$row['cal_groups']) as $group) |
|
| 1467 | + foreach (explode(',', $row['cal_groups']) as $group) |
|
| 1468 | 1468 | { |
| 1469 | 1469 | $row['cal_user_id'] = $group; |
| 1470 | - $db2->insert('egw_cal_user',array('cal_status' => 'U'),$row,__LINE__,__FILE__,'calendar'); |
|
| 1470 | + $db2->insert('egw_cal_user', array('cal_status' => 'U'), $row, __LINE__, __FILE__, 'calendar'); |
|
| 1471 | 1471 | } |
| 1472 | 1472 | } |
| 1473 | - $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal',array( |
|
| 1473 | + $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal', array( |
|
| 1474 | 1474 | 'fd' => array( |
| 1475 | - 'cal_id' => array('type' => 'auto','nullable' => False), |
|
| 1476 | - 'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False), |
|
| 1477 | - 'cal_owner' => array('type' => 'int','precision' => '4','nullable' => False), |
|
| 1478 | - 'cal_category' => array('type' => 'varchar','precision' => '30'), |
|
| 1479 | - 'cal_modified' => array('type' => 'int','precision' => '8'), |
|
| 1480 | - 'cal_priority' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '2'), |
|
| 1481 | - 'cal_public' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '1'), |
|
| 1482 | - 'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'), |
|
| 1475 | + 'cal_id' => array('type' => 'auto', 'nullable' => False), |
|
| 1476 | + 'cal_uid' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False), |
|
| 1477 | + 'cal_owner' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
| 1478 | + 'cal_category' => array('type' => 'varchar', 'precision' => '30'), |
|
| 1479 | + 'cal_modified' => array('type' => 'int', 'precision' => '8'), |
|
| 1480 | + 'cal_priority' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '2'), |
|
| 1481 | + 'cal_public' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '1'), |
|
| 1482 | + 'cal_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '1'), |
|
| 1483 | 1483 | 'cal_description' => array('type' => 'text'), |
| 1484 | - 'cal_location' => array('type' => 'varchar','precision' => '255'), |
|
| 1485 | - 'cal_reference' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), |
|
| 1486 | - 'cal_modifier' => array('type' => 'int','precision' => '4'), |
|
| 1487 | - 'cal_non_blocking' => array('type' => 'int','precision' => '2','default' => '0') |
|
| 1484 | + 'cal_location' => array('type' => 'varchar', 'precision' => '255'), |
|
| 1485 | + 'cal_reference' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'default' => '0'), |
|
| 1486 | + 'cal_modifier' => array('type' => 'int', 'precision' => '4'), |
|
| 1487 | + 'cal_non_blocking' => array('type' => 'int', 'precision' => '2', 'default' => '0') |
|
| 1488 | 1488 | ), |
| 1489 | 1489 | 'pk' => array('cal_id'), |
| 1490 | 1490 | 'fk' => array(), |
| 1491 | 1491 | 'ix' => array(), |
| 1492 | 1492 | 'uc' => array() |
| 1493 | - ),'cal_groups'); |
|
| 1493 | + ), 'cal_groups'); |
|
| 1494 | 1494 | |
| 1495 | 1495 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.2'; |
| 1496 | 1496 | } |
@@ -1500,7 +1500,7 @@ discard block |
||
| 1500 | 1500 | function calendar_upgrade1_2() |
| 1501 | 1501 | { |
| 1502 | 1502 | // get old alarms (saved before 1.2) working again |
| 1503 | - $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 | + $GLOBALS['egw_setup']->db->query("UPDATE egw_async SET async_method ='calendar.bocalupdate.send_alarm' WHERE async_method ='calendar.bocalendar.send_alarm'", __LINE__, __FILE__); |
|
| 1504 | 1504 | |
| 1505 | 1505 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.2.001'; |
| 1506 | 1506 | } |
@@ -1508,7 +1508,7 @@ discard block |
||
| 1508 | 1508 | |
| 1509 | 1509 | function calendar_upgrade1_2_001() |
| 1510 | 1510 | { |
| 1511 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_special',array( |
|
| 1511 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_special', array( |
|
| 1512 | 1512 | 'type' => 'int', |
| 1513 | 1513 | 'precision' => '2', |
| 1514 | 1514 | 'default' => '0' |
@@ -1526,7 +1526,7 @@ discard block |
||
| 1526 | 1526 | |
| 1527 | 1527 | function calendar_upgrade1_4() |
| 1528 | 1528 | { |
| 1529 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_etag',array( |
|
| 1529 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_etag', array( |
|
| 1530 | 1530 | 'type' => 'int', |
| 1531 | 1531 | 'precision' => '4', |
| 1532 | 1532 | 'default' => '0' |
@@ -1538,59 +1538,59 @@ discard block |
||
| 1538 | 1538 | |
| 1539 | 1539 | function calendar_upgrade1_5() |
| 1540 | 1540 | { |
| 1541 | - $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal',array( |
|
| 1541 | + $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal', array( |
|
| 1542 | 1542 | 'fd' => array( |
| 1543 | - 'cal_id' => array('type' => 'auto','nullable' => False), |
|
| 1544 | - 'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False), |
|
| 1545 | - 'cal_owner' => array('type' => 'int','precision' => '4','nullable' => False), |
|
| 1546 | - 'cal_category' => array('type' => 'varchar','precision' => '30'), |
|
| 1547 | - 'cal_modified' => array('type' => 'int','precision' => '8'), |
|
| 1548 | - 'cal_priority' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '2'), |
|
| 1549 | - 'cal_public' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '1'), |
|
| 1550 | - 'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'), |
|
| 1543 | + 'cal_id' => array('type' => 'auto', 'nullable' => False), |
|
| 1544 | + 'cal_uid' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False), |
|
| 1545 | + 'cal_owner' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
| 1546 | + 'cal_category' => array('type' => 'varchar', 'precision' => '30'), |
|
| 1547 | + 'cal_modified' => array('type' => 'int', 'precision' => '8'), |
|
| 1548 | + 'cal_priority' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '2'), |
|
| 1549 | + 'cal_public' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '1'), |
|
| 1550 | + 'cal_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '1'), |
|
| 1551 | 1551 | 'cal_description' => array('type' => 'text'), |
| 1552 | - 'cal_location' => array('type' => 'varchar','precision' => '255'), |
|
| 1553 | - 'cal_reference' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), |
|
| 1554 | - 'cal_modifier' => array('type' => 'int','precision' => '4'), |
|
| 1555 | - 'cal_non_blocking' => array('type' => 'int','precision' => '2','default' => '0'), |
|
| 1556 | - 'cal_special' => array('type' => 'int','precision' => '2','default' => '0'), |
|
| 1557 | - 'cal_etag' => array('type' => 'int','precision' => '4'), |
|
| 1558 | - 'cal_edit_time' => array('type' => 'int','precision' => '8') |
|
| 1552 | + 'cal_location' => array('type' => 'varchar', 'precision' => '255'), |
|
| 1553 | + 'cal_reference' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'default' => '0'), |
|
| 1554 | + 'cal_modifier' => array('type' => 'int', 'precision' => '4'), |
|
| 1555 | + 'cal_non_blocking' => array('type' => 'int', 'precision' => '2', 'default' => '0'), |
|
| 1556 | + 'cal_special' => array('type' => 'int', 'precision' => '2', 'default' => '0'), |
|
| 1557 | + 'cal_etag' => array('type' => 'int', 'precision' => '4'), |
|
| 1558 | + 'cal_edit_time' => array('type' => 'int', 'precision' => '8') |
|
| 1559 | 1559 | ), |
| 1560 | 1560 | 'pk' => array('cal_id'), |
| 1561 | 1561 | 'fk' => array(), |
| 1562 | 1562 | 'ix' => array(), |
| 1563 | 1563 | 'uc' => array() |
| 1564 | - ),'cal_edit_user'); |
|
| 1565 | - $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal',array( |
|
| 1564 | + ), 'cal_edit_user'); |
|
| 1565 | + $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal', array( |
|
| 1566 | 1566 | 'fd' => array( |
| 1567 | - 'cal_id' => array('type' => 'auto','nullable' => False), |
|
| 1568 | - 'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False), |
|
| 1569 | - 'cal_owner' => array('type' => 'int','precision' => '4','nullable' => False), |
|
| 1570 | - 'cal_category' => array('type' => 'varchar','precision' => '30'), |
|
| 1571 | - 'cal_modified' => array('type' => 'int','precision' => '8'), |
|
| 1572 | - 'cal_priority' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '2'), |
|
| 1573 | - 'cal_public' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '1'), |
|
| 1574 | - 'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'), |
|
| 1567 | + 'cal_id' => array('type' => 'auto', 'nullable' => False), |
|
| 1568 | + 'cal_uid' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False), |
|
| 1569 | + 'cal_owner' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
| 1570 | + 'cal_category' => array('type' => 'varchar', 'precision' => '30'), |
|
| 1571 | + 'cal_modified' => array('type' => 'int', 'precision' => '8'), |
|
| 1572 | + 'cal_priority' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '2'), |
|
| 1573 | + 'cal_public' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '1'), |
|
| 1574 | + 'cal_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '1'), |
|
| 1575 | 1575 | 'cal_description' => array('type' => 'text'), |
| 1576 | - 'cal_location' => array('type' => 'varchar','precision' => '255'), |
|
| 1577 | - 'cal_reference' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), |
|
| 1578 | - 'cal_modifier' => array('type' => 'int','precision' => '4'), |
|
| 1579 | - 'cal_non_blocking' => array('type' => 'int','precision' => '2','default' => '0'), |
|
| 1580 | - 'cal_special' => array('type' => 'int','precision' => '2','default' => '0'), |
|
| 1581 | - 'cal_etag' => array('type' => 'int','precision' => '4') |
|
| 1576 | + 'cal_location' => array('type' => 'varchar', 'precision' => '255'), |
|
| 1577 | + 'cal_reference' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'default' => '0'), |
|
| 1578 | + 'cal_modifier' => array('type' => 'int', 'precision' => '4'), |
|
| 1579 | + 'cal_non_blocking' => array('type' => 'int', 'precision' => '2', 'default' => '0'), |
|
| 1580 | + 'cal_special' => array('type' => 'int', 'precision' => '2', 'default' => '0'), |
|
| 1581 | + 'cal_etag' => array('type' => 'int', 'precision' => '4') |
|
| 1582 | 1582 | ), |
| 1583 | 1583 | 'pk' => array('cal_id'), |
| 1584 | 1584 | 'fk' => array(), |
| 1585 | 1585 | 'ix' => array(), |
| 1586 | 1586 | 'uc' => array() |
| 1587 | - ),'cal_edit_time'); |
|
| 1588 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_etag',array( |
|
| 1587 | + ), 'cal_edit_time'); |
|
| 1588 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_etag', array( |
|
| 1589 | 1589 | 'type' => 'int', |
| 1590 | 1590 | 'precision' => '4', |
| 1591 | 1591 | 'default' => '0' |
| 1592 | 1592 | )); |
| 1593 | - $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_etag=0 WHERE cal_etag IS NULL',__LINE__,__FILE__); |
|
| 1593 | + $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_etag=0 WHERE cal_etag IS NULL', __LINE__, __FILE__); |
|
| 1594 | 1594 | |
| 1595 | 1595 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.5.001'; |
| 1596 | 1596 | } |
@@ -1598,12 +1598,12 @@ discard block |
||
| 1598 | 1598 | |
| 1599 | 1599 | function calendar_upgrade1_5_001() |
| 1600 | 1600 | { |
| 1601 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_id',array( |
|
| 1601 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_id', array( |
|
| 1602 | 1602 | 'type' => 'int', |
| 1603 | 1603 | 'precision' => '4', |
| 1604 | 1604 | 'nullable' => False |
| 1605 | 1605 | )); |
| 1606 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_user_id',array( |
|
| 1606 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_user_id', array( |
|
| 1607 | 1607 | 'type' => 'varchar', |
| 1608 | 1608 | 'precision' => '128', |
| 1609 | 1609 | 'nullable' => False |
@@ -1617,12 +1617,12 @@ discard block |
||
| 1617 | 1617 | { |
| 1618 | 1618 | // update the alarm methods |
| 1619 | 1619 | $async = new Api\Asyncservice(); |
| 1620 | - foreach((array)$async->read('cal:%') as $job) |
|
| 1620 | + foreach ((array)$async->read('cal:%') as $job) |
|
| 1621 | 1621 | { |
| 1622 | 1622 | if ($job['method'] == 'calendar.bocalupdate.send_alarm') |
| 1623 | 1623 | { |
| 1624 | 1624 | $job['method'] = 'calendar.calendar_boupdate.send_alarm'; |
| 1625 | - $async->write($job,true); |
|
| 1625 | + $async->write($job, true); |
|
| 1626 | 1626 | } |
| 1627 | 1627 | } |
| 1628 | 1628 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.6'; |
@@ -1639,48 +1639,48 @@ discard block |
||
| 1639 | 1639 | { |
| 1640 | 1640 | // Set UID of series exception to UID of series master |
| 1641 | 1641 | // update cal_etag, cal_modified and cal_modifier to distribute changes on GroupDAV devices |
| 1642 | - foreach($GLOBALS['egw_setup']->db->query(' |
|
| 1642 | + foreach ($GLOBALS['egw_setup']->db->query(' |
|
| 1643 | 1643 | SELECT cal_ex.cal_id,cal_ex.cal_uid AS cal_uid_ex,cal_master.cal_uid AS cal_uid_master |
| 1644 | 1644 | FROM egw_cal cal_ex |
| 1645 | 1645 | JOIN egw_cal cal_master ON cal_ex.cal_reference=cal_master.cal_id |
| 1646 | - WHERE cal_ex.cal_reference != 0',__LINE__,__FILE__) as $row) |
|
| 1646 | + WHERE cal_ex.cal_reference != 0',__LINE__, __FILE__) as $row) |
|
| 1647 | 1647 | { |
| 1648 | 1648 | if (strlen($row['cal_uid_master']) > 0 && $row['cal_uid_ex'] != $row['cal_uid_master']) |
| 1649 | 1649 | { |
| 1650 | 1650 | $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_uid=\''.$row['cal_uid_master']. |
| 1651 | 1651 | '\',cal_etag=cal_etag+1,cal_modified='.time(). |
| 1652 | - ',cal_modifier=NULL WHERE cal_id='.(int)$row['cal_id'],__LINE__,__FILE__); |
|
| 1652 | + ',cal_modifier=NULL WHERE cal_id='.(int)$row['cal_id'], __LINE__, __FILE__); |
|
| 1653 | 1653 | } |
| 1654 | 1654 | } |
| 1655 | 1655 | |
| 1656 | 1656 | // Search series exception for nearest exception in series master and add that RECURRENCE-ID |
| 1657 | 1657 | // as cal_reference (for 1.6.003 and move it to new field cal_recurrence in 1.7.001) |
| 1658 | 1658 | $diff = null; |
| 1659 | - foreach($GLOBALS['egw_setup']->db->query('SELECT egw_cal.cal_id,cal_start,recur_exception FROM egw_cal |
|
| 1659 | + foreach ($GLOBALS['egw_setup']->db->query('SELECT egw_cal.cal_id,cal_start,recur_exception FROM egw_cal |
|
| 1660 | 1660 | JOIN egw_cal_dates ON egw_cal.cal_id=egw_cal_dates.cal_id |
| 1661 | 1661 | JOIN egw_cal_repeats ON cal_reference=egw_cal_repeats.cal_id |
| 1662 | - WHERE cal_reference != 0',__LINE__,__FILE__) as $row) |
|
| 1662 | + WHERE cal_reference != 0',__LINE__, __FILE__) as $row) |
|
| 1663 | 1663 | { |
| 1664 | 1664 | $recurrence = null; |
| 1665 | - foreach(explode(',',$row['recur_exception']) as $ts) |
|
| 1665 | + foreach (explode(',', $row['recur_exception']) as $ts) |
|
| 1666 | 1666 | { |
| 1667 | - if (is_null($recurrence) || abs($ts-$row['cal_start']) < $diff) |
|
| 1667 | + if (is_null($recurrence) || abs($ts - $row['cal_start']) < $diff) |
|
| 1668 | 1668 | { |
| 1669 | 1669 | $recurrence = $ts; |
| 1670 | - $diff = abs($ts-$row['cal_start']); |
|
| 1670 | + $diff = abs($ts - $row['cal_start']); |
|
| 1671 | 1671 | } |
| 1672 | 1672 | } |
| 1673 | 1673 | if ($recurrence) |
| 1674 | 1674 | { |
| 1675 | 1675 | $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_reference='.(int)$recurrence. |
| 1676 | - ' WHERE cal_id='.(int)$row['cal_id'],__LINE__,__FILE__); |
|
| 1676 | + ' WHERE cal_id='.(int)$row['cal_id'], __LINE__, __FILE__); |
|
| 1677 | 1677 | } |
| 1678 | 1678 | else |
| 1679 | 1679 | { |
| 1680 | 1680 | // if we cannot determine the RECURRENCE-ID use cal_start |
| 1681 | 1681 | // because RECURRENCE-ID must be present |
| 1682 | 1682 | $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_reference='.(int)$row['cal_start']. |
| 1683 | - ' WHERE cal_id='.(int)$row['cal_id'],__LINE__,__FILE__); |
|
| 1683 | + ' WHERE cal_id='.(int)$row['cal_id'], __LINE__, __FILE__); |
|
| 1684 | 1684 | } |
| 1685 | 1685 | } |
| 1686 | 1686 | |
@@ -1695,33 +1695,33 @@ discard block |
||
| 1695 | 1695 | */ |
| 1696 | 1696 | function calendar_upgrade1_6_003() |
| 1697 | 1697 | { |
| 1698 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_creator',array( |
|
| 1698 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_creator', array( |
|
| 1699 | 1699 | 'type' => 'int', |
| 1700 | 1700 | 'precision' => '4', |
| 1701 | 1701 | 'comment' => 'creating user' |
| 1702 | 1702 | )); |
| 1703 | - $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_creator=cal_owner',__LINE__,__FILE__); |
|
| 1704 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_creator',array( |
|
| 1703 | + $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_creator=cal_owner', __LINE__, __FILE__); |
|
| 1704 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_creator', array( |
|
| 1705 | 1705 | 'type' => 'int', |
| 1706 | 1706 | 'precision' => '4', |
| 1707 | 1707 | 'nullable' => False, |
| 1708 | 1708 | 'comment' => 'creating user' |
| 1709 | 1709 | )); |
| 1710 | 1710 | |
| 1711 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_created',array( |
|
| 1711 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_created', array( |
|
| 1712 | 1712 | 'type' => 'int', |
| 1713 | 1713 | 'precision' => '8', |
| 1714 | 1714 | 'comment' => 'creation time of event' |
| 1715 | 1715 | )); |
| 1716 | - $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_created=cal_modified',__LINE__,__FILE__); |
|
| 1717 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_created',array( |
|
| 1716 | + $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_created=cal_modified', __LINE__, __FILE__); |
|
| 1717 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_created', array( |
|
| 1718 | 1718 | 'type' => 'int', |
| 1719 | 1719 | 'precision' => '8', |
| 1720 | 1720 | 'nullable' => False, |
| 1721 | 1721 | 'comment' => 'creation time of event' |
| 1722 | 1722 | )); |
| 1723 | 1723 | |
| 1724 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_recurrence',array( |
|
| 1724 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_recurrence', array( |
|
| 1725 | 1725 | 'type' => 'int', |
| 1726 | 1726 | 'precision' => '8', |
| 1727 | 1727 | 'nullable' => False, |
@@ -1732,14 +1732,14 @@ discard block |
||
| 1732 | 1732 | // move RECURRENCE-ID from temporarily (1.6.003) |
| 1733 | 1733 | // used field cal_reference to new field cal_recurrence |
| 1734 | 1734 | // and restore cal_reference field of series exceptions with id of the series master |
| 1735 | - foreach($GLOBALS['egw_setup']->db->query(' |
|
| 1735 | + foreach ($GLOBALS['egw_setup']->db->query(' |
|
| 1736 | 1736 | SELECT cal_ex.cal_id AS cal_id_ex,cal_master.cal_id AS cal_id_master, |
| 1737 | 1737 | cal_ex.cal_reference AS cal_reference_ex,cal_ex.cal_uid AS cal_uid_ex, |
| 1738 | 1738 | cal_master.cal_uid AS cal_uid_master |
| 1739 | 1739 | FROM egw_cal cal_ex |
| 1740 | 1740 | JOIN egw_cal cal_master |
| 1741 | 1741 | ON cal_ex.cal_uid=cal_master.cal_uid AND cal_master.cal_reference = 0 AND cal_ex.cal_owner = cal_master.cal_owner |
| 1742 | - WHERE cal_ex.cal_reference !=0 AND cal_master.cal_id IS NOT NULL',__LINE__,__FILE__) as $row) |
|
| 1742 | + WHERE cal_ex.cal_reference !=0 AND cal_master.cal_id IS NOT NULL',__LINE__, __FILE__) as $row) |
|
| 1743 | 1743 | { |
| 1744 | 1744 | $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_recurrence='.(int)$row['cal_reference_ex']. |
| 1745 | 1745 | ', cal_reference='.(int)$row['cal_id_master']. |
@@ -1756,7 +1756,7 @@ discard block |
||
| 1756 | 1756 | */ |
| 1757 | 1757 | function calendar_upgrade1_7_001() |
| 1758 | 1758 | { |
| 1759 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user','cal_role',array( |
|
| 1759 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user', 'cal_role', array( |
|
| 1760 | 1760 | 'type' => 'varchar', |
| 1761 | 1761 | 'precision' => '64', |
| 1762 | 1762 | 'default' => 'REQ-PARTICIPANT' |
@@ -1772,14 +1772,14 @@ discard block |
||
| 1772 | 1772 | */ |
| 1773 | 1773 | function calendar_upgrade1_7_002() |
| 1774 | 1774 | { |
| 1775 | - $GLOBALS['egw_setup']->oProc->CreateTable('egw_cal_timezones',array( |
|
| 1775 | + $GLOBALS['egw_setup']->oProc->CreateTable('egw_cal_timezones', array( |
|
| 1776 | 1776 | 'fd' => array( |
| 1777 | - 'tz_id' => array('type' => 'auto','nullable' => False), |
|
| 1778 | - 'tz_tzid' => array('type' => 'varchar','precision' => '128','nullable' => False), |
|
| 1779 | - 'tz_alias' => array('type' => 'int','precision' => '4','comment' => 'tz_id for data'), |
|
| 1780 | - 'tz_latitude' => array('type' => 'int','precision' => '4'), |
|
| 1781 | - 'tz_longitude' => array('type' => 'int','precision' => '4'), |
|
| 1782 | - 'tz_component' => array('type' => 'text','comment' => 'iCal VTIMEZONE component') |
|
| 1777 | + 'tz_id' => array('type' => 'auto', 'nullable' => False), |
|
| 1778 | + 'tz_tzid' => array('type' => 'varchar', 'precision' => '128', 'nullable' => False), |
|
| 1779 | + 'tz_alias' => array('type' => 'int', 'precision' => '4', 'comment' => 'tz_id for data'), |
|
| 1780 | + 'tz_latitude' => array('type' => 'int', 'precision' => '4'), |
|
| 1781 | + 'tz_longitude' => array('type' => 'int', 'precision' => '4'), |
|
| 1782 | + 'tz_component' => array('type' => 'text', 'comment' => 'iCal VTIMEZONE component') |
|
| 1783 | 1783 | ), |
| 1784 | 1784 | 'pk' => array('tz_id'), |
| 1785 | 1785 | 'fk' => array(), |
@@ -1799,38 +1799,38 @@ discard block |
||
| 1799 | 1799 | */ |
| 1800 | 1800 | function calendar_upgrade1_7_003() |
| 1801 | 1801 | { |
| 1802 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_user_type',array( |
|
| 1802 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_user_type', array( |
|
| 1803 | 1803 | 'type' => 'varchar', |
| 1804 | 1804 | 'precision' => '1', |
| 1805 | 1805 | 'nullable' => False, |
| 1806 | 1806 | 'default' => 'u', |
| 1807 | 1807 | 'comment' => 'u=user, g=group, c=contact, r=resource, e=email' |
| 1808 | 1808 | )); |
| 1809 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_user_id',array( |
|
| 1809 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_user_id', array( |
|
| 1810 | 1810 | 'type' => 'varchar', |
| 1811 | 1811 | 'precision' => '128', |
| 1812 | 1812 | 'nullable' => False, |
| 1813 | 1813 | 'comment' => 'id or email-address for type=e' |
| 1814 | 1814 | )); |
| 1815 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_status',array( |
|
| 1815 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_status', array( |
|
| 1816 | 1816 | 'type' => 'char', |
| 1817 | 1817 | 'precision' => '1', |
| 1818 | 1818 | 'default' => 'A', |
| 1819 | 1819 | 'comment' => 'U=unknown, A=accepted, R=rejected, T=tentative' |
| 1820 | 1820 | )); |
| 1821 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_quantity',array( |
|
| 1821 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_quantity', array( |
|
| 1822 | 1822 | 'type' => 'int', |
| 1823 | 1823 | 'precision' => '4', |
| 1824 | 1824 | 'default' => '1', |
| 1825 | 1825 | 'comment' => 'only for certain types (eg. resources)' |
| 1826 | 1826 | )); |
| 1827 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_role',array( |
|
| 1827 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_role', array( |
|
| 1828 | 1828 | 'type' => 'varchar', |
| 1829 | 1829 | 'precision' => '64', |
| 1830 | 1830 | 'default' => 'REQ-PARTICIPANT', |
| 1831 | 1831 | 'comment' => 'CHAIR, REQ-PARTICIPANT, OPT-PARTICIPANT, NON-PARTICIPANT, X-CAT-$cat_id' |
| 1832 | 1832 | )); |
| 1833 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user','cal_user_modified',array( |
|
| 1833 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user', 'cal_user_modified', array( |
|
| 1834 | 1834 | 'type' => 'timestamp', |
| 1835 | 1835 | 'default' => 'current_timestamp', |
| 1836 | 1836 | 'comment' => 'automatic timestamp of last update' |
@@ -1846,19 +1846,19 @@ discard block |
||
| 1846 | 1846 | */ |
| 1847 | 1847 | function calendar_upgrade1_7_004() |
| 1848 | 1848 | { |
| 1849 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_dates','cal_start',array( |
|
| 1849 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_dates', 'cal_start', array( |
|
| 1850 | 1850 | 'type' => 'int', |
| 1851 | 1851 | 'precision' => '8', |
| 1852 | 1852 | 'nullable' => False, |
| 1853 | 1853 | 'comment' => 'starttime in server time' |
| 1854 | 1854 | )); |
| 1855 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_dates','cal_end',array( |
|
| 1855 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_dates', 'cal_end', array( |
|
| 1856 | 1856 | 'type' => 'int', |
| 1857 | 1857 | 'precision' => '8', |
| 1858 | 1858 | 'nullable' => False, |
| 1859 | 1859 | 'comment' => 'endtime in server time' |
| 1860 | 1860 | )); |
| 1861 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','tz_id',array( |
|
| 1861 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'tz_id', array( |
|
| 1862 | 1862 | 'type' => 'int', |
| 1863 | 1863 | 'precision' => '4', |
| 1864 | 1864 | 'comment' => 'key into egw_cal_timezones' |
@@ -1867,7 +1867,7 @@ discard block |
||
| 1867 | 1867 | // set id of server timezone for existing events, as that's the timezone their recurrences are using |
| 1868 | 1868 | if (($tzid = date_default_timezone_get()) && ($tz_id = calendar_timezones::tz2id($tzid))) |
| 1869 | 1869 | { |
| 1870 | - $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET tz_id='.(int)$tz_id,__LINE__,__FILE__); |
|
| 1870 | + $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET tz_id='.(int)$tz_id, __LINE__, __FILE__); |
|
| 1871 | 1871 | } |
| 1872 | 1872 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.7.005'; |
| 1873 | 1873 | } |
@@ -1894,22 +1894,22 @@ discard block |
||
| 1894 | 1894 | */ |
| 1895 | 1895 | function calendar_upgrade1_7_006() |
| 1896 | 1896 | { |
| 1897 | - foreach($GLOBALS['egw_setup']->db->query('SELECT * FROM egw_cal_dates |
|
| 1898 | - WHERE (cal_end-cal_start)%86400=86340',__LINE__,__FILE__) as $row) |
|
| 1897 | + foreach ($GLOBALS['egw_setup']->db->query('SELECT * FROM egw_cal_dates |
|
| 1898 | + WHERE (cal_end-cal_start)%86400=86340',__LINE__, __FILE__) as $row) |
|
| 1899 | 1899 | { |
| 1900 | 1900 | $GLOBALS['egw_setup']->db->query('UPDATE egw_cal_dates SET cal_end=cal_end+59 |
| 1901 | - WHERE cal_id='.(int)$row['cal_id'].' AND cal_start='.(int)$row['cal_start'],__LINE__,__FILE__); |
|
| 1901 | + WHERE cal_id='.(int)$row['cal_id'].' AND cal_start='.(int)$row['cal_start'], __LINE__, __FILE__); |
|
| 1902 | 1902 | } |
| 1903 | 1903 | |
| 1904 | - foreach($GLOBALS['egw_setup']->db->query('SELECT * FROM egw_cal_dates |
|
| 1905 | - WHERE cal_end-cal_start>0 AND (cal_end-cal_start)%86400=0',__LINE__,__FILE__) as $row) |
|
| 1904 | + foreach ($GLOBALS['egw_setup']->db->query('SELECT * FROM egw_cal_dates |
|
| 1905 | + WHERE cal_end-cal_start>0 AND (cal_end-cal_start)%86400=0',__LINE__, __FILE__) as $row) |
|
| 1906 | 1906 | { |
| 1907 | 1907 | $GLOBALS['egw_setup']->db->query('UPDATE egw_cal_dates SET cal_end=cal_end-1 |
| 1908 | - WHERE cal_id='.(int)$row['cal_id'].' AND cal_start='.(int)$row['cal_start'],__LINE__,__FILE__); |
|
| 1908 | + WHERE cal_id='.(int)$row['cal_id'].' AND cal_start='.(int)$row['cal_start'], __LINE__, __FILE__); |
|
| 1909 | 1909 | } |
| 1910 | 1910 | |
| 1911 | 1911 | $GLOBALS['egw_setup']->db->query('UPDATE egw_cal_repeats SET recur_interval=1 |
| 1912 | - WHERE recur_interval=0',__LINE__,__FILE__); |
|
| 1912 | + WHERE recur_interval=0',__LINE__, __FILE__); |
|
| 1913 | 1913 | |
| 1914 | 1914 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.7.007'; |
| 1915 | 1915 | } |
@@ -1925,17 +1925,17 @@ discard block |
||
| 1925 | 1925 | { |
| 1926 | 1926 | // Set UID of series exception to UID of series master |
| 1927 | 1927 | // update cal_etag,cal_modified and cal_modifier to distribute changes on GroupDAV devices |
| 1928 | - foreach($GLOBALS['egw_setup']->db->query(' |
|
| 1928 | + foreach ($GLOBALS['egw_setup']->db->query(' |
|
| 1929 | 1929 | SELECT cal_ex.cal_id,cal_ex.cal_uid AS cal_uid_ex,cal_master.cal_uid AS cal_uid_master |
| 1930 | 1930 | FROM egw_cal cal_ex |
| 1931 | 1931 | JOIN egw_cal cal_master ON cal_ex.cal_reference=cal_master.cal_id |
| 1932 | - WHERE cal_ex.cal_reference != 0',__LINE__,__FILE__) as $row) |
|
| 1932 | + WHERE cal_ex.cal_reference != 0',__LINE__, __FILE__) as $row) |
|
| 1933 | 1933 | { |
| 1934 | 1934 | if (strlen($row['cal_uid_master']) > 0 && $row['cal_uid_ex'] != $row['cal_uid_master']) |
| 1935 | 1935 | { |
| 1936 | 1936 | $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_uid=\''.$row['cal_uid_master']. |
| 1937 | 1937 | '\',cal_etag=cal_etag+1,cal_modified='.time(). |
| 1938 | - ',cal_modifier=NULL WHERE cal_id='.(int)$row['cal_id'],__LINE__,__FILE__); |
|
| 1938 | + ',cal_modifier=NULL WHERE cal_id='.(int)$row['cal_id'], __LINE__, __FILE__); |
|
| 1939 | 1939 | } |
| 1940 | 1940 | } |
| 1941 | 1941 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.7.008'; |
@@ -1948,7 +1948,7 @@ discard block |
||
| 1948 | 1948 | */ |
| 1949 | 1949 | function calendar_upgrade1_7_008() |
| 1950 | 1950 | { |
| 1951 | - $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal_user',array('cal_user_type','cal_user_id')); |
|
| 1951 | + $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal_user', array('cal_user_type', 'cal_user_id')); |
|
| 1952 | 1952 | |
| 1953 | 1953 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.7.009'; |
| 1954 | 1954 | } |
@@ -1960,22 +1960,22 @@ discard block |
||
| 1960 | 1960 | */ |
| 1961 | 1961 | function calendar_upgrade1_7_009() |
| 1962 | 1962 | { |
| 1963 | - $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal','cal_uid'); |
|
| 1964 | - $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal','cal_owner'); |
|
| 1963 | + $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal', 'cal_uid'); |
|
| 1964 | + $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal', 'cal_owner'); |
|
| 1965 | 1965 | |
| 1966 | 1966 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.7.010'; |
| 1967 | 1967 | } |
| 1968 | 1968 | |
| 1969 | 1969 | function calendar_upgrade1_7_010() |
| 1970 | 1970 | { |
| 1971 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_deleted',array( |
|
| 1971 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_deleted', array( |
|
| 1972 | 1972 | 'type' => 'bool', |
| 1973 | 1973 | 'nullable' => False, |
| 1974 | 1974 | 'default' => '0', |
| 1975 | 1975 | 'comment' => '1 if the event has been deleted, but you want to keep it around' |
| 1976 | 1976 | )); |
| 1977 | 1977 | |
| 1978 | - return $GLOBALS['setup_info']['calendar']['currentver'] = '1.9.001'; // was 1.7.011 |
|
| 1978 | + return $GLOBALS['setup_info']['calendar']['currentver'] = '1.9.001'; // was 1.7.011 |
|
| 1979 | 1979 | } |
| 1980 | 1980 | |
| 1981 | 1981 | function calendar_upgrade1_7_011() |
@@ -2005,36 +2005,36 @@ discard block |
||
| 2005 | 2005 | 'precision' => '8', |
| 2006 | 2006 | 'comment' => 'ts when event was deleted' |
| 2007 | 2007 | ));*/ |
| 2008 | - $GLOBALS['egw_setup']->oProc->RefreshTable('egw_cal',array( |
|
| 2008 | + $GLOBALS['egw_setup']->oProc->RefreshTable('egw_cal', array( |
|
| 2009 | 2009 | 'fd' => array( |
| 2010 | - 'cal_id' => array('type' => 'auto','nullable' => False), |
|
| 2011 | - 'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False,'comment' => 'unique id of event(-series)'), |
|
| 2012 | - 'cal_owner' => array('type' => 'int','precision' => '4','nullable' => False,'comment' => 'event owner / calendar'), |
|
| 2013 | - 'cal_category' => array('type' => 'varchar','precision' => '30','comment' => 'category id'), |
|
| 2014 | - 'cal_modified' => array('type' => 'int','precision' => '8','comment' => 'ts of last modification'), |
|
| 2015 | - 'cal_priority' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '2'), |
|
| 2016 | - 'cal_public' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '1','comment' => '1=public, 0=private event'), |
|
| 2017 | - 'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'), |
|
| 2010 | + 'cal_id' => array('type' => 'auto', 'nullable' => False), |
|
| 2011 | + 'cal_uid' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'comment' => 'unique id of event(-series)'), |
|
| 2012 | + 'cal_owner' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'comment' => 'event owner / calendar'), |
|
| 2013 | + 'cal_category' => array('type' => 'varchar', 'precision' => '30', 'comment' => 'category id'), |
|
| 2014 | + 'cal_modified' => array('type' => 'int', 'precision' => '8', 'comment' => 'ts of last modification'), |
|
| 2015 | + 'cal_priority' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '2'), |
|
| 2016 | + 'cal_public' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '1', 'comment' => '1=public, 0=private event'), |
|
| 2017 | + 'cal_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '1'), |
|
| 2018 | 2018 | 'cal_description' => array('type' => 'text'), |
| 2019 | - 'cal_location' => array('type' => 'varchar','precision' => '255'), |
|
| 2020 | - 'cal_reference' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0','comment' => 'cal_id of series for exception'), |
|
| 2021 | - 'cal_modifier' => array('type' => 'int','precision' => '4','comment' => 'user who last modified event'), |
|
| 2022 | - 'cal_non_blocking' => array('type' => 'int','precision' => '2','default' => '0','comment' => '1 for non-blocking events'), |
|
| 2023 | - 'cal_special' => array('type' => 'int','precision' => '2','default' => '0'), |
|
| 2024 | - 'cal_etag' => array('type' => 'int','precision' => '4','default' => '0','comment' => 'etag for optimistic locking'), |
|
| 2025 | - 'cal_creator' => array('type' => 'int','precision' => '4','nullable' => False,'comment' => 'creating user'), |
|
| 2026 | - 'cal_created' => array('type' => 'int','precision' => '8','nullable' => False,'comment' => 'creation time of event'), |
|
| 2027 | - 'cal_recurrence' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0','comment' => 'cal_start of original recurrence for exception'), |
|
| 2028 | - 'tz_id' => array('type' => 'int','precision' => '4','comment' => 'key into egw_cal_timezones'), |
|
| 2029 | - 'cal_deleted' => array('type' => 'int','precision' => '8','comment' => 'ts when event was deleted') |
|
| 2019 | + 'cal_location' => array('type' => 'varchar', 'precision' => '255'), |
|
| 2020 | + 'cal_reference' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'default' => '0', 'comment' => 'cal_id of series for exception'), |
|
| 2021 | + 'cal_modifier' => array('type' => 'int', 'precision' => '4', 'comment' => 'user who last modified event'), |
|
| 2022 | + 'cal_non_blocking' => array('type' => 'int', 'precision' => '2', 'default' => '0', 'comment' => '1 for non-blocking events'), |
|
| 2023 | + 'cal_special' => array('type' => 'int', 'precision' => '2', 'default' => '0'), |
|
| 2024 | + 'cal_etag' => array('type' => 'int', 'precision' => '4', 'default' => '0', 'comment' => 'etag for optimistic locking'), |
|
| 2025 | + 'cal_creator' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'comment' => 'creating user'), |
|
| 2026 | + 'cal_created' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'comment' => 'creation time of event'), |
|
| 2027 | + 'cal_recurrence' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0', 'comment' => 'cal_start of original recurrence for exception'), |
|
| 2028 | + 'tz_id' => array('type' => 'int', 'precision' => '4', 'comment' => 'key into egw_cal_timezones'), |
|
| 2029 | + 'cal_deleted' => array('type' => 'int', 'precision' => '8', 'comment' => 'ts when event was deleted') |
|
| 2030 | 2030 | ), |
| 2031 | 2031 | 'pk' => array('cal_id'), |
| 2032 | 2032 | 'fk' => array(), |
| 2033 | - 'ix' => array('cal_uid','cal_owner','cal_deleted'), |
|
| 2033 | + 'ix' => array('cal_uid', 'cal_owner', 'cal_deleted'), |
|
| 2034 | 2034 | 'uc' => array() |
| 2035 | - ),array( |
|
| 2035 | + ), array( |
|
| 2036 | 2036 | // for deleted rows use cal_modified as deleted date, NULL for not deleted ones |
| 2037 | - 'cal_deleted' => 'CASE cal_deleted WHEN '.$GLOBALS['egw_setup']->db->quote(true,'bool').' THEN cal_modified ELSE NULL END', |
|
| 2037 | + 'cal_deleted' => 'CASE cal_deleted WHEN '.$GLOBALS['egw_setup']->db->quote(true, 'bool').' THEN cal_modified ELSE NULL END', |
|
| 2038 | 2038 | )); |
| 2039 | 2039 | |
| 2040 | 2040 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.9.002'; |
@@ -2046,16 +2046,16 @@ discard block |
||
| 2046 | 2046 | */ |
| 2047 | 2047 | function calendar_upgrade1_9_002() |
| 2048 | 2048 | { |
| 2049 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','caldav_name',array( |
|
| 2049 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'caldav_name', array( |
|
| 2050 | 2050 | 'type' => 'varchar', |
| 2051 | 2051 | 'precision' => '64', |
| 2052 | 2052 | 'comment' => 'name part of CalDAV URL, if specified by client' |
| 2053 | 2053 | )); |
| 2054 | - $GLOBALS['egw_setup']->db->query($sql='UPDATE egw_cal SET caldav_name='. |
|
| 2054 | + $GLOBALS['egw_setup']->db->query($sql = 'UPDATE egw_cal SET caldav_name='. |
|
| 2055 | 2055 | $GLOBALS['egw_setup']->db->concat( |
| 2056 | - $GLOBALS['egw_setup']->db->to_varchar('cal_id'),"'.ics'"),__LINE__,__FILE__); |
|
| 2056 | + $GLOBALS['egw_setup']->db->to_varchar('cal_id'), "'.ics'"), __LINE__, __FILE__); |
|
| 2057 | 2057 | |
| 2058 | - $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal','caldav_name'); |
|
| 2058 | + $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal', 'caldav_name'); |
|
| 2059 | 2059 | |
| 2060 | 2060 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.9.003'; |
| 2061 | 2061 | } |
@@ -2066,8 +2066,8 @@ discard block |
||
| 2066 | 2066 | */ |
| 2067 | 2067 | function calendar_upgrade1_9_003() |
| 2068 | 2068 | { |
| 2069 | - $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal','cal_modified'); |
|
| 2070 | - $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal_user','cal_user_modified'); |
|
| 2069 | + $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal', 'cal_modified'); |
|
| 2070 | + $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal_user', 'cal_user_modified'); |
|
| 2071 | 2071 | |
| 2072 | 2072 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.9.004'; |
| 2073 | 2073 | } |
@@ -2079,7 +2079,7 @@ discard block |
||
| 2079 | 2079 | */ |
| 2080 | 2080 | function calendar_upgrade1_9_004() |
| 2081 | 2081 | { |
| 2082 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_dates','recur_exception',array( |
|
| 2082 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_dates', 'recur_exception', array( |
|
| 2083 | 2083 | 'type' => 'bool', |
| 2084 | 2084 | 'default' => '', |
| 2085 | 2085 | 'null' => false, |
@@ -2087,16 +2087,16 @@ discard block |
||
| 2087 | 2087 | )); |
| 2088 | 2088 | |
| 2089 | 2089 | // migrate existing exceptions to egw_cal_dates |
| 2090 | - foreach($GLOBALS['egw_setup']->db->select('egw_cal_repeats', |
|
| 2090 | + foreach ($GLOBALS['egw_setup']->db->select('egw_cal_repeats', |
|
| 2091 | 2091 | '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', |
| 2092 | 2092 | 'egw_cal_repeats.recur_exception IS NOT NULL', __LINE__, __FILE__, false, |
| 2093 | 2093 | 'GROUP BY egw_cal_repeats.cal_id,egw_cal_repeats.recur_exception', 'calendar', '', |
| 2094 | 2094 | 'JOIN egw_cal_dates ON egw_cal_repeats.cal_id=egw_cal_dates.cal_id') as $row) |
| 2095 | 2095 | { |
| 2096 | - foreach($row['recur_exception'] ? array_unique(explode(',', $row['recur_exception'])) : array() as $recur_exception) |
|
| 2096 | + foreach ($row['recur_exception'] ? array_unique(explode(',', $row['recur_exception'])) : array() as $recur_exception) |
|
| 2097 | 2097 | { |
| 2098 | 2098 | $GLOBALS['egw_setup']->db->insert('egw_cal_dates', array( |
| 2099 | - 'cal_end' => $recur_exception+$row['cal_end']-$row['cal_start'], |
|
| 2099 | + 'cal_end' => $recur_exception + $row['cal_end'] - $row['cal_start'], |
|
| 2100 | 2100 | 'recur_exception' => true, |
| 2101 | 2101 | ), array( |
| 2102 | 2102 | 'cal_id' => $row['cal_id'], |
@@ -2108,11 +2108,11 @@ discard block |
||
| 2108 | 2108 | |
| 2109 | 2109 | $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal_repeats', array( |
| 2110 | 2110 | 'fd' => array( |
| 2111 | - 'cal_id' => array('type' => 'int','precision' => '4','nullable' => False), |
|
| 2112 | - 'recur_type' => array('type' => 'int','precision' => '2','nullable' => False), |
|
| 2113 | - 'recur_enddate' => array('type' => 'int','precision' => '8'), |
|
| 2114 | - 'recur_interval' => array('type' => 'int','precision' => '2','default' => '1'), |
|
| 2115 | - 'recur_data' => array('type' => 'int','precision' => '2','default' => '1'), |
|
| 2111 | + 'cal_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
| 2112 | + 'recur_type' => array('type' => 'int', 'precision' => '2', 'nullable' => False), |
|
| 2113 | + 'recur_enddate' => array('type' => 'int', 'precision' => '8'), |
|
| 2114 | + 'recur_interval' => array('type' => 'int', 'precision' => '2', 'default' => '1'), |
|
| 2115 | + 'recur_data' => array('type' => 'int', 'precision' => '2', 'default' => '1'), |
|
| 2116 | 2116 | ), |
| 2117 | 2117 | 'pk' => array('cal_id'), |
| 2118 | 2118 | 'fk' => array(), |
@@ -2133,19 +2133,19 @@ discard block |
||
| 2133 | 2133 | // returns NULL, if there are no rows! |
| 2134 | 2134 | if ((int)$max_description_length <= 16384 && $GLOBALS['egw_setup']->oProc->max_varchar_length >= 16384) |
| 2135 | 2135 | { |
| 2136 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_description',array( |
|
| 2136 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_description', array( |
|
| 2137 | 2137 | 'type' => 'varchar', |
| 2138 | 2138 | 'precision' => '16384' |
| 2139 | 2139 | )); |
| 2140 | 2140 | } |
| 2141 | 2141 | // allow more categories |
| 2142 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_category',array( |
|
| 2142 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_category', array( |
|
| 2143 | 2143 | 'type' => 'varchar', |
| 2144 | 2144 | 'precision' => '64', |
| 2145 | 2145 | 'comment' => 'category id(s)' |
| 2146 | 2146 | )); |
| 2147 | 2147 | // remove silly default of 1 |
| 2148 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_title',array( |
|
| 2148 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_title', array( |
|
| 2149 | 2149 | 'type' => 'varchar', |
| 2150 | 2150 | 'precision' => '255', |
| 2151 | 2151 | 'nullable' => False |
@@ -2160,14 +2160,14 @@ discard block |
||
| 2160 | 2160 | { |
| 2161 | 2161 | // PostgreSQL needs temporary a nullable column, to not stall on broken events without dates! |
| 2162 | 2162 | // We add that constrain in 1.9.007, after deleting all rows with range_start=0 OR range_start IS NULL |
| 2163 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','range_start',array( |
|
| 2163 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'range_start', array( |
|
| 2164 | 2164 | 'type' => 'int', |
| 2165 | 2165 | 'precision' => '8', |
| 2166 | 2166 | 'comment' => 'startdate (of range)' |
| 2167 | 2167 | )); |
| 2168 | 2168 | $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__); |
| 2169 | 2169 | |
| 2170 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','range_end',array( |
|
| 2170 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'range_end', array( |
|
| 2171 | 2171 | 'type' => 'int', |
| 2172 | 2172 | 'precision' => '8', |
| 2173 | 2173 | 'comment' => 'enddate (of range, UNTIL of RRULE)' |
@@ -2183,18 +2183,18 @@ discard block |
||
| 2183 | 2183 | { |
| 2184 | 2184 | $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__); |
| 2185 | 2185 | } |
| 2186 | - $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal_repeats',array( |
|
| 2186 | + $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal_repeats', array( |
|
| 2187 | 2187 | 'fd' => array( |
| 2188 | - 'cal_id' => array('type' => 'int','precision' => '4','nullable' => False), |
|
| 2189 | - 'recur_type' => array('type' => 'int','precision' => '2','nullable' => False), |
|
| 2190 | - 'recur_interval' => array('type' => 'int','precision' => '2','default' => '1'), |
|
| 2191 | - 'recur_data' => array('type' => 'int','precision' => '2','default' => '1') |
|
| 2188 | + 'cal_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
| 2189 | + 'recur_type' => array('type' => 'int', 'precision' => '2', 'nullable' => False), |
|
| 2190 | + 'recur_interval' => array('type' => 'int', 'precision' => '2', 'default' => '1'), |
|
| 2191 | + 'recur_data' => array('type' => 'int', 'precision' => '2', 'default' => '1') |
|
| 2192 | 2192 | ), |
| 2193 | 2193 | 'pk' => array('cal_id'), |
| 2194 | 2194 | 'fk' => array(), |
| 2195 | 2195 | 'ix' => array(), |
| 2196 | 2196 | 'uc' => array() |
| 2197 | - ),'recur_enddate'); |
|
| 2197 | + ), 'recur_enddate'); |
|
| 2198 | 2198 | |
| 2199 | 2199 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.9.007'; |
| 2200 | 2200 | } |
@@ -2206,14 +2206,14 @@ discard block |
||
| 2206 | 2206 | */ |
| 2207 | 2207 | function calendar_upgrade1_9_007() |
| 2208 | 2208 | { |
| 2209 | - foreach(array('egw_cal_repeats','egw_cal_dates','egw_cal_user','egw_cal_extra') as $table) |
|
| 2209 | + foreach (array('egw_cal_repeats', 'egw_cal_dates', 'egw_cal_user', 'egw_cal_extra') as $table) |
|
| 2210 | 2210 | { |
| 2211 | 2211 | $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__); |
| 2212 | 2212 | } |
| 2213 | 2213 | $GLOBALS['egw_setup']->db->query("DELETE FROM egw_cal WHERE range_start=0 OR range_start IS NULL", __LINE__, __FILE__); |
| 2214 | 2214 | |
| 2215 | 2215 | // now we can remove temporary default of 0 from range_start and set it NOT NULL |
| 2216 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','range_start',array( |
|
| 2216 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'range_start', array( |
|
| 2217 | 2217 | 'type' => 'int', |
| 2218 | 2218 | 'precision' => '8', |
| 2219 | 2219 | 'nullable' => False, |
@@ -2278,7 +2278,7 @@ discard block |
||
| 2278 | 2278 | |
| 2279 | 2279 | function calendar_upgrade1_9_010() |
| 2280 | 2280 | { |
| 2281 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','caldav_name',array( |
|
| 2281 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'caldav_name', array( |
|
| 2282 | 2282 | 'type' => 'varchar', |
| 2283 | 2283 | 'precision' => '200', |
| 2284 | 2284 | 'comment' => 'name part of CalDAV URL, if specified by client' |
@@ -2308,7 +2308,7 @@ discard block |
||
| 2308 | 2308 | SET cal_reference=0,cal_recurrence=0,cal_etag=cal_etag+1,cal_modifier=0,cal_modified=".time()." |
| 2309 | 2309 | WHERE cal_reference != 0 AND cal_id IN (SELECT cal_id FROM egw_cal_repeats)", __LINE__, __FILE__); |
| 2310 | 2310 | |
| 2311 | - foreach($GLOBALS['egw_setup']->db->query( |
|
| 2311 | + foreach ($GLOBALS['egw_setup']->db->query( |
|
| 2312 | 2312 | "SELECT DISTINCT master.cal_id,egw_cal_user.cal_user_type,egw_cal_user.cal_user_id,'E' AS cal_status |
| 2313 | 2313 | FROM egw_cal_user |
| 2314 | 2314 | JOIN egw_cal ON egw_cal_user.cal_id=egw_cal.cal_id |
@@ -2335,7 +2335,7 @@ discard block |
||
| 2335 | 2335 | */ |
| 2336 | 2336 | function calendar_upgrade14_1_001() |
| 2337 | 2337 | { |
| 2338 | - foreach($GLOBALS['egw_setup']->db->query( |
|
| 2338 | + foreach ($GLOBALS['egw_setup']->db->query( |
|
| 2339 | 2339 | "SELECT egw_cal.cal_id AS cal_id,cal_start,cal_end,range_start,range_end,egw_cal_repeats.*,tz_tzid AS tzid |
| 2340 | 2340 | FROM egw_cal |
| 2341 | 2341 | JOIN egw_cal_repeats ON egw_cal_repeats.cal_id=egw_cal.cal_id |
@@ -2363,7 +2363,7 @@ discard block |
||
| 2363 | 2363 | $enddate->modify(($event['end'] - $event['start']).' second'); |
| 2364 | 2364 | if (($range_end = $enddate->format('server')) != $event['range_end']) |
| 2365 | 2365 | { |
| 2366 | - $GLOBALS['egw_setup']->db->update('egw_cal',array( |
|
| 2366 | + $GLOBALS['egw_setup']->db->update('egw_cal', array( |
|
| 2367 | 2367 | 'range_end' => $range_end, |
| 2368 | 2368 | 'cal_etag=cal_etag+1', |
| 2369 | 2369 | 'cal_modified' => time(), |
@@ -2373,7 +2373,7 @@ discard block |
||
| 2373 | 2373 | //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)); |
| 2374 | 2374 | } |
| 2375 | 2375 | } |
| 2376 | - return $GLOBALS['setup_info']['calendar']['currentver'] = '14.2.002'; // skip 14.2.001 update, as query is fixed now |
|
| 2376 | + return $GLOBALS['setup_info']['calendar']['currentver'] = '14.2.002'; // skip 14.2.001 update, as query is fixed now |
|
| 2377 | 2377 | } |
| 2378 | 2378 | |
| 2379 | 2379 | /** |
@@ -2397,7 +2397,7 @@ discard block |
||
| 2397 | 2397 | // if maximum is bigger then 3 |
| 2398 | 2398 | if ($values[1] > 3) |
| 2399 | 2399 | { |
| 2400 | - switch($GLOBALS['egw_setup']->db->Type) |
|
| 2400 | + switch ($GLOBALS['egw_setup']->db->Type) |
|
| 2401 | 2401 | { |
| 2402 | 2402 | case 'mysql': |
| 2403 | 2403 | $sql = "UPDATE egw_cal |
@@ -2442,7 +2442,7 @@ discard block |
||
| 2442 | 2442 | |
| 2443 | 2443 | function calendar_upgrade14_2_003() |
| 2444 | 2444 | { |
| 2445 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_uid',array( |
|
| 2445 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_uid', array( |
|
| 2446 | 2446 | 'type' => 'ascii', |
| 2447 | 2447 | 'precision' => '128', |
| 2448 | 2448 | 'nullable' => False, |
@@ -2454,13 +2454,13 @@ discard block |
||
| 2454 | 2454 | { |
| 2455 | 2455 | $GLOBALS['egw_setup']->db->query("UPDATE egw_cal SET cal_category='' WHERE cal_category NOT REGEXP '^[0-9,]*$'", __LINE__, __FILE__); |
| 2456 | 2456 | } |
| 2457 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_category',array( |
|
| 2457 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_category', array( |
|
| 2458 | 2458 | 'type' => 'ascii', |
| 2459 | 2459 | 'meta' => 'category', |
| 2460 | 2460 | 'precision' => '64', |
| 2461 | 2461 | 'comment' => 'category id(s)' |
| 2462 | 2462 | )); |
| 2463 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','caldav_name',array( |
|
| 2463 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'caldav_name', array( |
|
| 2464 | 2464 | 'type' => 'ascii', |
| 2465 | 2465 | 'precision' => '128', |
| 2466 | 2466 | 'comment' => 'name part of CalDAV URL, if specified by client' |
@@ -2517,22 +2517,22 @@ discard block |
||
| 2517 | 2517 | 'type' => 'auto', |
| 2518 | 2518 | 'nullable' => False |
| 2519 | 2519 | ));*/ |
| 2520 | - $GLOBALS['egw_setup']->oProc->RefreshTable('egw_cal_user',array( |
|
| 2520 | + $GLOBALS['egw_setup']->oProc->RefreshTable('egw_cal_user', array( |
|
| 2521 | 2521 | 'fd' => array( |
| 2522 | - 'cal_id' => array('type' => 'int','precision' => '4','nullable' => False), |
|
| 2523 | - 'cal_recur_date' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False,'default' => '0'), |
|
| 2524 | - 'cal_user_type' => array('type' => 'ascii','precision' => '1','nullable' => False,'default' => 'u','comment' => 'u=user, g=group, c=contact, r=resource, e=email'), |
|
| 2525 | - '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'), |
|
| 2526 | - 'cal_status' => array('type' => 'ascii','precision' => '1','default' => 'A','comment' => 'U=unknown, A=accepted, R=rejected, T=tentative'), |
|
| 2527 | - 'cal_quantity' => array('type' => 'int','precision' => '4','default' => '1','comment' => 'only for certain types (eg. resources)'), |
|
| 2528 | - 'cal_role' => array('type' => 'ascii','precision' => '64','default' => 'REQ-PARTICIPANT','comment' => 'CHAIR, REQ-PARTICIPANT, OPT-PARTICIPANT, NON-PARTICIPANT, X-CAT-$cat_id'), |
|
| 2529 | - 'cal_user_modified' => array('type' => 'timestamp','default' => 'current_timestamp','comment' => 'automatic timestamp of last update'), |
|
| 2530 | - 'cal_user_auto' => array('type' => 'auto','nullable' => False) |
|
| 2522 | + 'cal_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
| 2523 | + 'cal_recur_date' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'nullable' => False, 'default' => '0'), |
|
| 2524 | + 'cal_user_type' => array('type' => 'ascii', 'precision' => '1', 'nullable' => False, 'default' => 'u', 'comment' => 'u=user, g=group, c=contact, r=resource, e=email'), |
|
| 2525 | + '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'), |
|
| 2526 | + 'cal_status' => array('type' => 'ascii', 'precision' => '1', 'default' => 'A', 'comment' => 'U=unknown, A=accepted, R=rejected, T=tentative'), |
|
| 2527 | + 'cal_quantity' => array('type' => 'int', 'precision' => '4', 'default' => '1', 'comment' => 'only for certain types (eg. resources)'), |
|
| 2528 | + 'cal_role' => array('type' => 'ascii', 'precision' => '64', 'default' => 'REQ-PARTICIPANT', 'comment' => 'CHAIR, REQ-PARTICIPANT, OPT-PARTICIPANT, NON-PARTICIPANT, X-CAT-$cat_id'), |
|
| 2529 | + 'cal_user_modified' => array('type' => 'timestamp', 'default' => 'current_timestamp', 'comment' => 'automatic timestamp of last update'), |
|
| 2530 | + 'cal_user_auto' => array('type' => 'auto', 'nullable' => False) |
|
| 2531 | 2531 | ), |
| 2532 | 2532 | 'pk' => array('cal_user_auto'), |
| 2533 | 2533 | 'fk' => array(), |
| 2534 | - 'ix' => array('cal_user_modified',array('cal_user_type','cal_user_id')), |
|
| 2535 | - 'uc' => array(array('cal_id','cal_recur_date','cal_user_type','cal_user_id')) |
|
| 2534 | + 'ix' => array('cal_user_modified', array('cal_user_type', 'cal_user_id')), |
|
| 2535 | + 'uc' => array(array('cal_id', 'cal_recur_date', 'cal_user_type', 'cal_user_id')) |
|
| 2536 | 2536 | )); |
| 2537 | 2537 | |
| 2538 | 2538 | return $GLOBALS['setup_info']['calendar']['currentver'] = '14.2.005'; |
@@ -2541,12 +2541,12 @@ discard block |
||
| 2541 | 2541 | |
| 2542 | 2542 | function calendar_upgrade14_2_005() |
| 2543 | 2543 | { |
| 2544 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_timezones','tz_tzid',array( |
|
| 2544 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_timezones', 'tz_tzid', array( |
|
| 2545 | 2545 | 'type' => 'ascii', |
| 2546 | 2546 | 'precision' => '128', |
| 2547 | 2547 | 'nullable' => False |
| 2548 | 2548 | )); |
| 2549 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_timezones','tz_component',array( |
|
| 2549 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_timezones', 'tz_component', array( |
|
| 2550 | 2550 | 'type' => 'ascii', |
| 2551 | 2551 | 'precision' => '8192', |
| 2552 | 2552 | 'comment' => 'iCal VTIMEZONE component' |
@@ -2562,7 +2562,7 @@ discard block |
||
| 2562 | 2562 | */ |
| 2563 | 2563 | function calendar_upgrade14_3() |
| 2564 | 2564 | { |
| 2565 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user','cal_user_attendee',array( |
|
| 2565 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user', 'cal_user_attendee', array( |
|
| 2566 | 2566 | 'type' => 'varchar', |
| 2567 | 2567 | 'precision' => '255', |
| 2568 | 2568 | 'comment' => 'email or json object with attr. cn, url, ...' |
@@ -2573,12 +2573,12 @@ discard block |
||
| 2573 | 2573 | |
| 2574 | 2574 | // delete all but one row, which would give a doublicate key, after above normalising of email addresses |
| 2575 | 2575 | // by ordering by status we prever accepted over tentative over unknow over deleted |
| 2576 | - foreach($GLOBALS['egw_setup']->db->select('egw_cal_user', "cal_id,cal_recur_date,$email AS email", array( |
|
| 2576 | + foreach ($GLOBALS['egw_setup']->db->select('egw_cal_user', "cal_id,cal_recur_date,$email AS email", array( |
|
| 2577 | 2577 | 'cal_user_type' => 'e', |
| 2578 | 2578 | ), __LINE__, __FILE__, false, "GROUP BY cal_id,cal_recur_date,$email HAVING COUNT(*)>1", 'calendar') as $row) |
| 2579 | 2579 | { |
| 2580 | 2580 | $n = 0; |
| 2581 | - foreach($GLOBALS['egw_setup']->db->select('egw_cal_user', "*,$email AS email", array( |
|
| 2581 | + foreach ($GLOBALS['egw_setup']->db->select('egw_cal_user', "*,$email AS email", array( |
|
| 2582 | 2582 | 'cal_id' => $row['cal_id'], |
| 2583 | 2583 | 'cal_recur_date' => $row['cal_recur_date'], |
| 2584 | 2584 | 'cal_user_type' => 'e', |
@@ -2587,7 +2587,7 @@ discard block |
||
| 2587 | 2587 | { |
| 2588 | 2588 | if (strpos($user['email'], '@') !== false && !$n++) continue; |
| 2589 | 2589 | $GLOBALS['egw_setup']->db->delete('egw_cal_user', |
| 2590 | - array_intersect_key($user, array_flip(array('cal_id','cal_recur_date','cal_user_type','cal_user_id','cal_status'))), |
|
| 2590 | + array_intersect_key($user, array_flip(array('cal_id', 'cal_recur_date', 'cal_user_type', 'cal_user_id', 'cal_status'))), |
|
| 2591 | 2591 | __LINE__, __FILE__, 'calendar'); |
| 2592 | 2592 | } |
| 2593 | 2593 | } |
@@ -2597,7 +2597,7 @@ discard block |
||
| 2597 | 2597 | "UPDATE egw_cal_user SET cal_user_attendee=cal_user_id,cal_user_id=MD5($email) WHERE cal_user_type='e'", |
| 2598 | 2598 | __LINE__, __FILE__); |
| 2599 | 2599 | |
| 2600 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_user_id',array( |
|
| 2600 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_user_id', array( |
|
| 2601 | 2601 | 'type' => 'ascii', |
| 2602 | 2602 | 'meta' => array( |
| 2603 | 2603 | "cal_user_type='u'" => 'account' |
@@ -2619,7 +2619,7 @@ discard block |
||
| 2619 | 2619 | { |
| 2620 | 2620 | $GLOBALS['calendar_upgrade14_3_001-run'] = true; |
| 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 |
@@ -2670,8 +2670,8 @@ discard block |
||
| 2670 | 2670 | { |
| 2671 | 2671 | Api\Preferences::change_preference('calendar', '/^favorite_/', function($attr, $old_value, $owner) |
| 2672 | 2672 | { |
| 2673 | - unset($attr, $owner); // not used, but required by function signature |
|
| 2674 | - if($old_value['state'] && is_array($old_value['state'])) |
|
| 2673 | + unset($attr, $owner); // not used, but required by function signature |
|
| 2674 | + if ($old_value['state'] && is_array($old_value['state'])) |
|
| 2675 | 2675 | { |
| 2676 | 2676 | unset($old_value['state']['date']); |
| 2677 | 2677 | unset($old_value['state']['startdate']); |
@@ -2691,15 +2691,15 @@ discard block |
||
| 2691 | 2691 | { |
| 2692 | 2692 | Api\Preferences::change_preference('calendar', 'use_time_grid', function($attr, $old_value, $owner) |
| 2693 | 2693 | { |
| 2694 | - unset($attr, $owner); // not used, but required by function signature |
|
| 2695 | - switch($old_value) |
|
| 2694 | + unset($attr, $owner); // not used, but required by function signature |
|
| 2695 | + switch ($old_value) |
|
| 2696 | 2696 | { |
| 2697 | 2697 | case 'all': |
| 2698 | 2698 | return 0; |
| 2699 | 2699 | case 'day_week': |
| 2700 | - return ['day','day4','week']; |
|
| 2700 | + return ['day', 'day4', 'week']; |
|
| 2701 | 2701 | case 'day4': |
| 2702 | - return ['day','day4']; |
|
| 2702 | + return ['day', 'day4']; |
|
| 2703 | 2703 | } |
| 2704 | 2704 | return null; |
| 2705 | 2705 | }); |
@@ -2724,7 +2724,7 @@ discard block |
||
| 2724 | 2724 | function calendar_upgrade16_1_001() |
| 2725 | 2725 | { |
| 2726 | 2726 | $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_extra', 'cal_extra_value', |
| 2727 | - array('type' => 'varchar','meta' => 'cfvalue','precision' => '16384','nullable' => False,'default' => '')); |
|
| 2727 | + array('type' => 'varchar', 'meta' => 'cfvalue', 'precision' => '16384', 'nullable' => False, 'default' => '')); |
|
| 2728 | 2728 | |
| 2729 | 2729 | Api\Preferences::change_preference('calendar', 'defaultresource_sel', 'resources', 'addressbook', 'forced'); |
| 2730 | 2730 | Api\Preferences::change_preference('calendar', 'defaultresource_sel', 'resources', 'addressbook', 'default'); |
@@ -2736,8 +2736,8 @@ discard block |
||
| 2736 | 2736 | { |
| 2737 | 2737 | // Explicitly add months as showing list of events, no times |
| 2738 | 2738 | $change = function($attr, $old_value, $owner) { |
| 2739 | - if($owner == Api\Preferences::FORCED_ID) return; |
|
| 2740 | - if(is_array($old_value) && !in_array('month', $old_value)) |
|
| 2739 | + if ($owner == Api\Preferences::FORCED_ID) return; |
|
| 2740 | + if (is_array($old_value) && !in_array('month', $old_value)) |
|
| 2741 | 2741 | { |
| 2742 | 2742 | $old_value[] = 'month'; |
| 2743 | 2743 | } |
@@ -2759,7 +2759,7 @@ discard block |
||
| 2759 | 2759 | { |
| 2760 | 2760 | // Update birthdays as events preference from boolean |
| 2761 | 2761 | $change = function($attr, $old_value, $owner) { |
| 2762 | - if (!isset($old_value)) return null; // do not set anything, if nothing was set before |
|
| 2762 | + if (!isset($old_value)) return null; // do not set anything, if nothing was set before |
|
| 2763 | 2763 | return $old_value ? 'birthday' : 'none'; |
| 2764 | 2764 | }; |
| 2765 | 2765 | Api\Preferences::change_preference('calendar', 'birthdays_as_events', $change); |
@@ -2775,13 +2775,13 @@ discard block |
||
| 2775 | 2775 | |
| 2776 | 2776 | function calendar_upgrade17_1_002() |
| 2777 | 2777 | { |
| 2778 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_uid',array( |
|
| 2778 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_uid', array( |
|
| 2779 | 2779 | 'type' => 'ascii', |
| 2780 | 2780 | 'precision' => '255', |
| 2781 | 2781 | 'nullable' => False, |
| 2782 | 2782 | 'comment' => 'unique id of event(-series)' |
| 2783 | 2783 | )); |
| 2784 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','caldav_name',array( |
|
| 2784 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'caldav_name', array( |
|
| 2785 | 2785 | 'type' => 'ascii', |
| 2786 | 2786 | 'precision' => '260', |
| 2787 | 2787 | 'comment' => 'name part of CalDAV URL, if specified by client' |
@@ -24,7 +24,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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', |