@@ -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'] = |
@@ -12,41 +12,41 @@ discard block |
||
| 12 | 12 | $phpgw_baseline = array( |
| 13 | 13 | 'egw_cal' => array( |
| 14 | 14 | 'fd' => array( |
| 15 | - 'cal_id' => array('type' => 'auto','nullable' => False,'comment' => 'calendar id'), |
|
| 16 | - 'cal_uid' => array('type' => 'ascii','precision' => '128','nullable' => False,'comment' => 'unique id of event(-series)'), |
|
| 17 | - 'cal_owner' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False,'comment' => 'event owner / calendar'), |
|
| 18 | - 'cal_category' => array('type' => 'ascii','meta' => 'category','precision' => '64','comment' => 'category id(s)'), |
|
| 19 | - 'cal_modified' => array('type' => 'int','meta' => 'timestamp','precision' => '8','comment' => 'ts of last modification'), |
|
| 20 | - 'cal_priority' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '2','comment' => 'priority: 1=Low, 2=Normal, 3=High'), |
|
| 21 | - 'cal_public' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '1','comment' => '1=public, 0=private event'), |
|
| 22 | - 'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'comment' => 'title of event'), |
|
| 23 | - 'cal_description' => array('type' => 'varchar','precision' => '16384','comment' => 'description'), |
|
| 24 | - 'cal_location' => array('type' => 'varchar','precision' => '255','comment' => 'location'), |
|
| 25 | - 'cal_reference' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0','comment' => 'cal_id of series for exception'), |
|
| 26 | - 'cal_modifier' => array('type' => 'int','meta' => 'user','precision' => '4','comment' => 'user who last modified event'), |
|
| 27 | - 'cal_non_blocking' => array('type' => 'int','precision' => '2','default' => '0','comment' => '1 for non-blocking events'), |
|
| 28 | - 'cal_special' => array('type' => 'int','precision' => '2','default' => '0'), |
|
| 29 | - 'cal_etag' => array('type' => 'int','precision' => '4','default' => '0','comment' => 'etag for optimistic locking'), |
|
| 30 | - 'cal_creator' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False,'comment' => 'creating user'), |
|
| 31 | - 'cal_created' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False,'comment' => 'creation time of event'), |
|
| 32 | - 'cal_recurrence' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False,'default' => '0','comment' => 'cal_start of original recurrence for exception'), |
|
| 33 | - 'tz_id' => array('type' => 'int','precision' => '4','comment' => 'key into egw_cal_timezones'), |
|
| 34 | - 'cal_deleted' => array('type' => 'int','precision' => '8','comment' => 'ts when event was deleted'), |
|
| 35 | - 'caldav_name' => array('type' => 'ascii','precision' => '128','comment' => 'name part of CalDAV URL, if specified by client'), |
|
| 36 | - 'range_start' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False,'comment' => 'startdate (of range)'), |
|
| 37 | - 'range_end' => array('type' => 'int','meta' => 'timestamp','precision' => '8','comment' => 'enddate (of range, UNTIL of RRULE)') |
|
| 15 | + 'cal_id' => array('type' => 'auto', 'nullable' => False, 'comment' => 'calendar id'), |
|
| 16 | + 'cal_uid' => array('type' => 'ascii', 'precision' => '128', 'nullable' => False, 'comment' => 'unique id of event(-series)'), |
|
| 17 | + 'cal_owner' => array('type' => 'int', 'meta' => 'user', 'precision' => '4', 'nullable' => False, 'comment' => 'event owner / calendar'), |
|
| 18 | + 'cal_category' => array('type' => 'ascii', 'meta' => 'category', 'precision' => '64', 'comment' => 'category id(s)'), |
|
| 19 | + 'cal_modified' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'comment' => 'ts of last modification'), |
|
| 20 | + 'cal_priority' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '2', 'comment' => 'priority: 1=Low, 2=Normal, 3=High'), |
|
| 21 | + 'cal_public' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '1', 'comment' => '1=public, 0=private event'), |
|
| 22 | + 'cal_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'comment' => 'title of event'), |
|
| 23 | + 'cal_description' => array('type' => 'varchar', 'precision' => '16384', 'comment' => 'description'), |
|
| 24 | + 'cal_location' => array('type' => 'varchar', 'precision' => '255', 'comment' => 'location'), |
|
| 25 | + 'cal_reference' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'default' => '0', 'comment' => 'cal_id of series for exception'), |
|
| 26 | + 'cal_modifier' => array('type' => 'int', 'meta' => 'user', 'precision' => '4', 'comment' => 'user who last modified event'), |
|
| 27 | + 'cal_non_blocking' => array('type' => 'int', 'precision' => '2', 'default' => '0', 'comment' => '1 for non-blocking events'), |
|
| 28 | + 'cal_special' => array('type' => 'int', 'precision' => '2', 'default' => '0'), |
|
| 29 | + 'cal_etag' => array('type' => 'int', 'precision' => '4', 'default' => '0', 'comment' => 'etag for optimistic locking'), |
|
| 30 | + 'cal_creator' => array('type' => 'int', 'meta' => 'user', 'precision' => '4', 'nullable' => False, 'comment' => 'creating user'), |
|
| 31 | + 'cal_created' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'nullable' => False, 'comment' => 'creation time of event'), |
|
| 32 | + 'cal_recurrence' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'nullable' => False, 'default' => '0', 'comment' => 'cal_start of original recurrence for exception'), |
|
| 33 | + 'tz_id' => array('type' => 'int', 'precision' => '4', 'comment' => 'key into egw_cal_timezones'), |
|
| 34 | + 'cal_deleted' => array('type' => 'int', 'precision' => '8', 'comment' => 'ts when event was deleted'), |
|
| 35 | + 'caldav_name' => array('type' => 'ascii', 'precision' => '128', 'comment' => 'name part of CalDAV URL, if specified by client'), |
|
| 36 | + 'range_start' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'nullable' => False, 'comment' => 'startdate (of range)'), |
|
| 37 | + 'range_end' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'comment' => 'enddate (of range, UNTIL of RRULE)') |
|
| 38 | 38 | ), |
| 39 | 39 | 'pk' => array('cal_id'), |
| 40 | 40 | 'fk' => array(), |
| 41 | - 'ix' => array('cal_uid','cal_owner','cal_modified','cal_reference','cal_deleted','caldav_name'), |
|
| 41 | + 'ix' => array('cal_uid', 'cal_owner', 'cal_modified', 'cal_reference', 'cal_deleted', 'caldav_name'), |
|
| 42 | 42 | 'uc' => array() |
| 43 | 43 | ), |
| 44 | 44 | 'egw_cal_repeats' => array( |
| 45 | 45 | 'fd' => array( |
| 46 | - 'cal_id' => array('type' => 'int','precision' => '4','nullable' => False), |
|
| 47 | - 'recur_type' => array('type' => 'int','precision' => '2','nullable' => False), |
|
| 48 | - 'recur_interval' => array('type' => 'int','precision' => '2','default' => '1'), |
|
| 49 | - 'recur_data' => array('type' => 'int','precision' => '2','default' => '1') |
|
| 46 | + 'cal_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
| 47 | + 'recur_type' => array('type' => 'int', 'precision' => '2', 'nullable' => False), |
|
| 48 | + 'recur_interval' => array('type' => 'int', 'precision' => '2', 'default' => '1'), |
|
| 49 | + 'recur_data' => array('type' => 'int', 'precision' => '2', 'default' => '1') |
|
| 50 | 50 | ), |
| 51 | 51 | 'pk' => array('cal_id'), |
| 52 | 52 | 'fk' => array(), |
@@ -55,53 +55,53 @@ discard block |
||
| 55 | 55 | ), |
| 56 | 56 | 'egw_cal_user' => array( |
| 57 | 57 | 'fd' => array( |
| 58 | - 'cal_id' => array('type' => 'int','precision' => '4','nullable' => False), |
|
| 59 | - 'cal_recur_date' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False,'default' => '0'), |
|
| 60 | - 'cal_user_type' => array('type' => 'ascii','precision' => '1','nullable' => False,'default' => 'u','comment' => 'u=user, g=group, c=contact, r=resource, e=email'), |
|
| 61 | - 'cal_user_id' => array('type' => 'ascii','meta' => array("cal_user_type='u'" => 'account'),'precision' => '32','nullable' => False,'comment' => 'id or md5(email-address) for type=e'), |
|
| 62 | - 'cal_status' => array('type' => 'ascii','precision' => '1','default' => 'A','comment' => 'U=unknown, A=accepted, R=rejected, T=tentative'), |
|
| 63 | - 'cal_quantity' => array('type' => 'int','precision' => '4','default' => '1','comment' => 'only for certain types (eg. resources)'), |
|
| 64 | - 'cal_role' => array('type' => 'ascii','precision' => '64','default' => 'REQ-PARTICIPANT','comment' => 'CHAIR, REQ-PARTICIPANT, OPT-PARTICIPANT, NON-PARTICIPANT, X-CAT-$cat_id'), |
|
| 65 | - 'cal_user_modified' => array('type' => 'timestamp','default' => 'current_timestamp','comment' => 'automatic timestamp of last update'), |
|
| 66 | - 'cal_user_auto' => array('type' => 'auto','nullable' => False), |
|
| 67 | - 'cal_user_attendee' => array('type' => 'varchar','precision' => '255','comment' => 'email or json object with attr. cn, url, ...') |
|
| 58 | + 'cal_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
| 59 | + 'cal_recur_date' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'nullable' => False, 'default' => '0'), |
|
| 60 | + 'cal_user_type' => array('type' => 'ascii', 'precision' => '1', 'nullable' => False, 'default' => 'u', 'comment' => 'u=user, g=group, c=contact, r=resource, e=email'), |
|
| 61 | + 'cal_user_id' => array('type' => 'ascii', 'meta' => array("cal_user_type='u'" => 'account'), 'precision' => '32', 'nullable' => False, 'comment' => 'id or md5(email-address) for type=e'), |
|
| 62 | + 'cal_status' => array('type' => 'ascii', 'precision' => '1', 'default' => 'A', 'comment' => 'U=unknown, A=accepted, R=rejected, T=tentative'), |
|
| 63 | + 'cal_quantity' => array('type' => 'int', 'precision' => '4', 'default' => '1', 'comment' => 'only for certain types (eg. resources)'), |
|
| 64 | + 'cal_role' => array('type' => 'ascii', 'precision' => '64', 'default' => 'REQ-PARTICIPANT', 'comment' => 'CHAIR, REQ-PARTICIPANT, OPT-PARTICIPANT, NON-PARTICIPANT, X-CAT-$cat_id'), |
|
| 65 | + 'cal_user_modified' => array('type' => 'timestamp', 'default' => 'current_timestamp', 'comment' => 'automatic timestamp of last update'), |
|
| 66 | + 'cal_user_auto' => array('type' => 'auto', 'nullable' => False), |
|
| 67 | + 'cal_user_attendee' => array('type' => 'varchar', 'precision' => '255', 'comment' => 'email or json object with attr. cn, url, ...') |
|
| 68 | 68 | ), |
| 69 | 69 | 'pk' => array('cal_user_auto'), |
| 70 | 70 | 'fk' => array(), |
| 71 | - 'ix' => array('cal_user_modified',array('cal_user_type','cal_user_id')), |
|
| 72 | - 'uc' => array(array('cal_id','cal_recur_date','cal_user_type','cal_user_id')) |
|
| 71 | + 'ix' => array('cal_user_modified', array('cal_user_type', 'cal_user_id')), |
|
| 72 | + 'uc' => array(array('cal_id', 'cal_recur_date', 'cal_user_type', 'cal_user_id')) |
|
| 73 | 73 | ), |
| 74 | 74 | 'egw_cal_extra' => array( |
| 75 | 75 | 'fd' => array( |
| 76 | - 'cal_id' => array('type' => 'int','precision' => '4','nullable' => False), |
|
| 77 | - 'cal_extra_name' => array('type' => 'varchar','meta' => 'cfname','precision' => '40','nullable' => False), |
|
| 78 | - 'cal_extra_value' => array('type' => 'varchar','meta' => 'cfvalue','precision' => '16384','nullable' => False,'default' => '') |
|
| 76 | + 'cal_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
| 77 | + 'cal_extra_name' => array('type' => 'varchar', 'meta' => 'cfname', 'precision' => '40', 'nullable' => False), |
|
| 78 | + 'cal_extra_value' => array('type' => 'varchar', 'meta' => 'cfvalue', 'precision' => '16384', 'nullable' => False, 'default' => '') |
|
| 79 | 79 | ), |
| 80 | - 'pk' => array('cal_id','cal_extra_name'), |
|
| 80 | + 'pk' => array('cal_id', 'cal_extra_name'), |
|
| 81 | 81 | 'fk' => array(), |
| 82 | 82 | 'ix' => array(), |
| 83 | 83 | 'uc' => array() |
| 84 | 84 | ), |
| 85 | 85 | 'egw_cal_dates' => array( |
| 86 | 86 | 'fd' => array( |
| 87 | - 'cal_id' => array('type' => 'int','precision' => '4','nullable' => False), |
|
| 88 | - 'cal_start' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False,'comment' => 'starttime in server time'), |
|
| 89 | - 'cal_end' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False,'comment' => 'endtime in server time'), |
|
| 90 | - 'recur_exception' => array('type' => 'bool','nullable' => False,'default' => '','comment' => 'date is an exception') |
|
| 87 | + 'cal_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
| 88 | + 'cal_start' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'nullable' => False, 'comment' => 'starttime in server time'), |
|
| 89 | + 'cal_end' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'nullable' => False, 'comment' => 'endtime in server time'), |
|
| 90 | + 'recur_exception' => array('type' => 'bool', 'nullable' => False, 'default' => '', 'comment' => 'date is an exception') |
|
| 91 | 91 | ), |
| 92 | - 'pk' => array('cal_id','cal_start'), |
|
| 92 | + 'pk' => array('cal_id', 'cal_start'), |
|
| 93 | 93 | 'fk' => array(), |
| 94 | - 'ix' => array(array('recur_exception','cal_id')), |
|
| 94 | + 'ix' => array(array('recur_exception', 'cal_id')), |
|
| 95 | 95 | 'uc' => array() |
| 96 | 96 | ), |
| 97 | 97 | 'egw_cal_timezones' => array( |
| 98 | 98 | 'fd' => array( |
| 99 | - 'tz_id' => array('type' => 'auto','nullable' => False), |
|
| 100 | - 'tz_tzid' => array('type' => 'ascii','precision' => '128','nullable' => False), |
|
| 101 | - 'tz_alias' => array('type' => 'int','precision' => '4','comment' => 'tz_id for data'), |
|
| 102 | - 'tz_latitude' => array('type' => 'int','precision' => '4'), |
|
| 103 | - 'tz_longitude' => array('type' => 'int','precision' => '4'), |
|
| 104 | - 'tz_component' => array('type' => 'ascii','precision' => '8192','comment' => 'iCal VTIMEZONE component') |
|
| 99 | + 'tz_id' => array('type' => 'auto', 'nullable' => False), |
|
| 100 | + 'tz_tzid' => array('type' => 'ascii', 'precision' => '128', 'nullable' => False), |
|
| 101 | + 'tz_alias' => array('type' => 'int', 'precision' => '4', 'comment' => 'tz_id for data'), |
|
| 102 | + 'tz_latitude' => array('type' => 'int', 'precision' => '4'), |
|
| 103 | + 'tz_longitude' => array('type' => 'int', 'precision' => '4'), |
|
| 104 | + 'tz_component' => array('type' => 'ascii', 'precision' => '8192', 'comment' => 'iCal VTIMEZONE component') |
|
| 105 | 105 | ), |
| 106 | 106 | 'pk' => array('tz_id'), |
| 107 | 107 | 'fk' => array(), |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | { |
| 21 | 21 | $owner[count($owner)] = $GLOBALS['egw_setup']->oProc->f($field); |
| 22 | 22 | } |
| 23 | - if($GLOBALS['egw_setup']->alessthanb($GLOBALS['setup_info']['phpgwapi']['currentver'],'0.9.10pre4')) |
|
| 23 | + if ($GLOBALS['egw_setup']->alessthanb($GLOBALS['setup_info']['phpgwapi']['currentver'], '0.9.10pre4')) |
|
| 24 | 24 | { |
| 25 | 25 | $acctstbl = 'accounts'; |
| 26 | 26 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | { |
| 29 | 29 | $acctstbl = 'phpgw_accounts'; |
| 30 | 30 | } |
| 31 | - for($i=0;$i<count($owner);$i++) |
|
| 31 | + for ($i = 0; $i < count($owner); $i++) |
|
| 32 | 32 | { |
| 33 | 33 | $GLOBALS['egw_setup']->oProc->query("SELECT account_id FROM $acctstbl WHERE account_lid='".$owner[$i]."'"); |
| 34 | 34 | $GLOBALS['egw_setup']->oProc->next_record(); |
@@ -41,8 +41,8 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | function calendar_upgrade0_9_3pre1() |
| 43 | 43 | { |
| 44 | - calendar_v0_9_2to0_9_3update_owner('webcal_entry','cal_create_by'); |
|
| 45 | - calendar_v0_9_2to0_9_3update_owner('webcal_entry_user','cal_login'); |
|
| 44 | + calendar_v0_9_2to0_9_3update_owner('webcal_entry', 'cal_create_by'); |
|
| 45 | + calendar_v0_9_2to0_9_3update_owner('webcal_entry_user', 'cal_login'); |
|
| 46 | 46 | $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.3pre2'; |
| 47 | 47 | return $GLOBALS['setup_info']['calendar']['currentver']; |
| 48 | 48 | } |
@@ -209,12 +209,12 @@ discard block |
||
| 209 | 209 | ) |
| 210 | 210 | ); |
| 211 | 211 | |
| 212 | - $GLOBALS['egw_setup']->oProc->query('SELECT count(*) FROM webcal_entry',__LINE__,__FILE__); |
|
| 212 | + $GLOBALS['egw_setup']->oProc->query('SELECT count(*) FROM webcal_entry', __LINE__, __FILE__); |
|
| 213 | 213 | $GLOBALS['egw_setup']->oProc->next_record(); |
| 214 | - if($GLOBALS['egw_setup']->oProc->f(0)) |
|
| 214 | + if ($GLOBALS['egw_setup']->oProc->f(0)) |
|
| 215 | 215 | { |
| 216 | - $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__); |
|
| 217 | - while($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 216 | + $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__); |
|
| 217 | + while ($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 218 | 218 | { |
| 219 | 219 | $cal_id = $GLOBALS['egw_setup']->oProc->f('cal_id'); |
| 220 | 220 | $cal_owner = $GLOBALS['egw_setup']->oProc->f('cal_owner'); |
@@ -224,13 +224,13 @@ discard block |
||
| 224 | 224 | $cal_access = $GLOBALS['egw_setup']->oProc->f('cal_access'); |
| 225 | 225 | $cal_name = $GLOBALS['egw_setup']->oProc->f('cal_name'); |
| 226 | 226 | $cal_description = $GLOBALS['egw_setup']->oProc->f('cal_description'); |
| 227 | - $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))); |
|
| 228 | - $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))); |
|
| 229 | - $db2->query('SELECT groups FROM webcal_entry_groups WHERE cal_id='.$cal_id,__LINE__,__FILE__); |
|
| 227 | + $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))); |
|
| 228 | + $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))); |
|
| 229 | + $db2->query('SELECT groups FROM webcal_entry_groups WHERE cal_id='.$cal_id, __LINE__, __FILE__); |
|
| 230 | 230 | $db2->next_record(); |
| 231 | 231 | $cal_group = $db2->f('groups'); |
| 232 | 232 | $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) ' |
| 233 | - .'VALUES('.$cal_id.",'".$cal_owner."','".$cal_group."',".$datetime.",".$moddatetime.",".$cal_duration.",".$cal_priority.",'".$cal_type."','".$cal_access."','".$cal_name."','".$cal_description."')",__LINE__,__FILE__); |
|
| 233 | + .'VALUES('.$cal_id.",'".$cal_owner."','".$cal_group."',".$datetime.",".$moddatetime.",".$cal_duration.",".$cal_priority.",'".$cal_type."','".$cal_access."','".$cal_name."','".$cal_description."')", __LINE__, __FILE__); |
|
| 234 | 234 | } |
| 235 | 235 | } |
| 236 | 236 | |
@@ -251,17 +251,17 @@ discard block |
||
| 251 | 251 | ) |
| 252 | 252 | ); |
| 253 | 253 | |
| 254 | - $GLOBALS['egw_setup']->oProc->query('SELECT count(*) FROM webcal_entry_user',__LINE__,__FILE__); |
|
| 254 | + $GLOBALS['egw_setup']->oProc->query('SELECT count(*) FROM webcal_entry_user', __LINE__, __FILE__); |
|
| 255 | 255 | $GLOBALS['egw_setup']->oProc->next_record(); |
| 256 | - if($GLOBALS['egw_setup']->oProc->f(0)) |
|
| 256 | + if ($GLOBALS['egw_setup']->oProc->f(0)) |
|
| 257 | 257 | { |
| 258 | - $GLOBALS['egw_setup']->oProc->query('SELECT cal_id,cal_login,cal_status FROM webcal_entry_user ORDER BY cal_id',__LINE__,__FILE__); |
|
| 259 | - while($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 258 | + $GLOBALS['egw_setup']->oProc->query('SELECT cal_id,cal_login,cal_status FROM webcal_entry_user ORDER BY cal_id', __LINE__, __FILE__); |
|
| 259 | + while ($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 260 | 260 | { |
| 261 | 261 | $cal_id = $GLOBALS['egw_setup']->oProc->f('cal_id'); |
| 262 | 262 | $cal_login = $GLOBALS['egw_setup']->oProc->f('cal_login'); |
| 263 | 263 | $cal_status = $GLOBALS['egw_setup']->oProc->f('cal_status'); |
| 264 | - $db2->query('INSERT INTO calendar_entry_user(cal_id,cal_login,cal_status) VALUES('.$cal_id.','.$cal_login.",'".$cal_status."')",__LINE__,__FILE__); |
|
| 264 | + $db2->query('INSERT INTO calendar_entry_user(cal_id,cal_login,cal_status) VALUES('.$cal_id.','.$cal_login.",'".$cal_status."')", __LINE__, __FILE__); |
|
| 265 | 265 | } |
| 266 | 266 | } |
| 267 | 267 | |
@@ -284,18 +284,18 @@ discard block |
||
| 284 | 284 | ) |
| 285 | 285 | ); |
| 286 | 286 | |
| 287 | - $GLOBALS['egw_setup']->oProc->query('SELECT count(*) FROM webcal_entry_repeats',__LINE__,__FILE__); |
|
| 287 | + $GLOBALS['egw_setup']->oProc->query('SELECT count(*) FROM webcal_entry_repeats', __LINE__, __FILE__); |
|
| 288 | 288 | $GLOBALS['egw_setup']->oProc->next_record(); |
| 289 | - if($GLOBALS['egw_setup']->oProc->f(0)) |
|
| 289 | + if ($GLOBALS['egw_setup']->oProc->f(0)) |
|
| 290 | 290 | { |
| 291 | - $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__); |
|
| 292 | - while($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 291 | + $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__); |
|
| 292 | + while ($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 293 | 293 | { |
| 294 | 294 | $cal_id = $GLOBALS['egw_setup']->oProc->f('cal_id'); |
| 295 | 295 | $cal_type = $GLOBALS['egw_setup']->oProc->f('cal_type'); |
| 296 | - if(isset($GLOBALS['egw_setup']->oProc->Record['cal_end'])) |
|
| 296 | + if (isset($GLOBALS['egw_setup']->oProc->Record['cal_end'])) |
|
| 297 | 297 | { |
| 298 | - $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 | + $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))); |
|
| 299 | 299 | $useend = 1; |
| 300 | 300 | } |
| 301 | 301 | else |
@@ -305,12 +305,12 @@ discard block |
||
| 305 | 305 | } |
| 306 | 306 | $cal_frequency = $GLOBALS['egw_setup']->oProc->f('cal_frequency'); |
| 307 | 307 | $cal_days = $GLOBALS['egw_setup']->oProc->f('cal_days'); |
| 308 | - $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 | + $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__); |
|
| 309 | 309 | } |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | $GLOBALS['egw_setup']->oProc->DropTable('webcal_entry_repeats'); |
| 313 | - $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 | + $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__); |
|
| 314 | 314 | |
| 315 | 315 | $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.7pre2'; |
| 316 | 316 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -322,19 +322,19 @@ discard block |
||
| 322 | 322 | $db2 = $GLOBALS['egw_setup']->db; |
| 323 | 323 | |
| 324 | 324 | $GLOBALS['egw_setup']->oProc->RenameColumn('calendar_entry', 'cal_duration', 'cal_edatetime'); |
| 325 | - $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__); |
|
| 326 | - if($GLOBALS['egw_setup']->oProc->num_rows()) |
|
| 325 | + $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__); |
|
| 326 | + if ($GLOBALS['egw_setup']->oProc->num_rows()) |
|
| 327 | 327 | { |
| 328 | - while($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 328 | + while ($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 329 | 329 | { |
| 330 | - $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 | + $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__); |
|
| 331 | 331 | $db2->next_record(); |
| 332 | 332 | $tz = $db2->f('preference_value'); |
| 333 | 333 | $cal_id = $GLOBALS['egw_setup']->oProc->f('cal_id'); |
| 334 | 334 | $datetime = $GLOBALS['egw_setup']->oProc->f('cal_datetime') - ((60 * 60) * $tz); |
| 335 | 335 | $mdatetime = $GLOBALS['egw_setup']->oProc->f('cal_mdatetime') - ((60 * 60) * $tz); |
| 336 | 336 | $edatetime = $datetime + (60 * $GLOBALS['egw_setup']->oProc->f('cal_edatetime')); |
| 337 | - $db2->query('UPDATE calendar_entry SET cal_datetime='.$datetime.', cal_edatetime='.$edatetime.', cal_mdatetime='.$mdatetime.' WHERE cal_id='.$cal_id,__LINE__,__FILE__); |
|
| 337 | + $db2->query('UPDATE calendar_entry SET cal_datetime='.$datetime.', cal_edatetime='.$edatetime.', cal_mdatetime='.$mdatetime.' WHERE cal_id='.$cal_id, __LINE__, __FILE__); |
|
| 338 | 338 | } |
| 339 | 339 | } |
| 340 | 340 | |
@@ -582,22 +582,22 @@ discard block |
||
| 582 | 582 | { |
| 583 | 583 | $db2 = $GLOBALS['egw_setup']->db; |
| 584 | 584 | |
| 585 | - if(extension_loaded('mcal') == False) |
|
| 585 | + if (extension_loaded('mcal') == False) |
|
| 586 | 586 | { |
| 587 | - define(RECUR_NONE,0); |
|
| 588 | - define(RECUR_DAILY,1); |
|
| 589 | - define(RECUR_WEEKLY,2); |
|
| 590 | - define(RECUR_MONTHLY_MDAY,3); |
|
| 591 | - define(RECUR_MONTHLY_WDAY,4); |
|
| 592 | - define(RECUR_YEARLY,5); |
|
| 593 | - |
|
| 594 | - define(M_SUNDAY,1); |
|
| 595 | - define(M_MONDAY,2); |
|
| 596 | - define(M_TUESDAY,4); |
|
| 597 | - define(M_WEDNESDAY,8); |
|
| 598 | - define(M_THURSDAY,16); |
|
| 599 | - define(M_FRIDAY,32); |
|
| 600 | - define(M_SATURDAY,64); |
|
| 587 | + define(RECUR_NONE, 0); |
|
| 588 | + define(RECUR_DAILY, 1); |
|
| 589 | + define(RECUR_WEEKLY, 2); |
|
| 590 | + define(RECUR_MONTHLY_MDAY, 3); |
|
| 591 | + define(RECUR_MONTHLY_WDAY, 4); |
|
| 592 | + define(RECUR_YEARLY, 5); |
|
| 593 | + |
|
| 594 | + define(M_SUNDAY, 1); |
|
| 595 | + define(M_MONDAY, 2); |
|
| 596 | + define(M_TUESDAY, 4); |
|
| 597 | + define(M_WEDNESDAY, 8); |
|
| 598 | + define(M_THURSDAY, 16); |
|
| 599 | + define(M_FRIDAY, 32); |
|
| 600 | + define(M_SATURDAY, 64); |
|
| 601 | 601 | } |
| 602 | 602 | |
| 603 | 603 | // calendar_entry => phpgw_cal |
@@ -624,13 +624,13 @@ discard block |
||
| 624 | 624 | ) |
| 625 | 625 | ); |
| 626 | 626 | |
| 627 | - $GLOBALS['egw_setup']->oProc->query('SELECT * FROM calendar_entry',__LINE__,__FILE__); |
|
| 628 | - while($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 627 | + $GLOBALS['egw_setup']->oProc->query('SELECT * FROM calendar_entry', __LINE__, __FILE__); |
|
| 628 | + while ($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 629 | 629 | { |
| 630 | 630 | $id = $GLOBALS['egw_setup']->oProc->f('cal_id'); |
| 631 | 631 | $owner = $GLOBALS['egw_setup']->oProc->f('cal_owner'); |
| 632 | 632 | $access = $GLOBALS['egw_setup']->oProc->f('cal_access'); |
| 633 | - switch($access) |
|
| 633 | + switch ($access) |
|
| 634 | 634 | { |
| 635 | 635 | case 'private': |
| 636 | 636 | $is_public = 0; |
@@ -652,7 +652,7 @@ discard block |
||
| 652 | 652 | $description = $GLOBALS['egw_setup']->oProc->f('cal_description'); |
| 653 | 653 | |
| 654 | 654 | $db2->query("INSERT INTO phpgw_cal(cal_id,owner,groups,datetime,mdatetime,edatetime,priority,cal_type,is_public,title,description) " |
| 655 | - . "VALUES($id,$owner,'$groups',$datetime,$mdatetime,$edatetime,$priority,'$type',$is_public,'$title','$description')",__LINE__,__FILE__); |
|
| 655 | + . "VALUES($id,$owner,'$groups',$datetime,$mdatetime,$edatetime,$priority,'$type',$is_public,'$title','$description')", __LINE__, __FILE__); |
|
| 656 | 656 | } |
| 657 | 657 | $GLOBALS['egw_setup']->oProc->DropTable('calendar_entry'); |
| 658 | 658 | |
@@ -660,12 +660,12 @@ discard block |
||
| 660 | 660 | $GLOBALS['egw_setup']->oProc->CreateTable('phpgw_cal_repeats', |
| 661 | 661 | Array( |
| 662 | 662 | 'fd' => array( |
| 663 | - 'cal_id' => array('type' => 'int', 'precision' => 8,'nullable' => False), |
|
| 664 | - 'recur_type' => array('type' => 'int', 'precision' => 8,'nullable' => False), |
|
| 665 | - 'recur_use_end' => array('type' => 'int', 'precision' => 8,'nullable' => True), |
|
| 666 | - 'recur_enddate' => array('type' => 'int', 'precision' => 8,'nullable' => True), |
|
| 667 | - 'recur_interval' => array('type' => 'int', 'precision' => 8,'nullable' => True,'default' => '1'), |
|
| 668 | - 'recur_data' => array('type' => 'int', 'precision' => 8,'nullable' => True,'default' => '1') |
|
| 663 | + 'cal_id' => array('type' => 'int', 'precision' => 8, 'nullable' => False), |
|
| 664 | + 'recur_type' => array('type' => 'int', 'precision' => 8, 'nullable' => False), |
|
| 665 | + 'recur_use_end' => array('type' => 'int', 'precision' => 8, 'nullable' => True), |
|
| 666 | + 'recur_enddate' => array('type' => 'int', 'precision' => 8, 'nullable' => True), |
|
| 667 | + 'recur_interval' => array('type' => 'int', 'precision' => 8, 'nullable' => True, 'default' => '1'), |
|
| 668 | + 'recur_data' => array('type' => 'int', 'precision' => 8, 'nullable' => True, 'default' => '1') |
|
| 669 | 669 | ), |
| 670 | 670 | 'pk' => array(), |
| 671 | 671 | 'fk' => array(), |
@@ -673,12 +673,12 @@ discard block |
||
| 673 | 673 | 'uc' => array() |
| 674 | 674 | ) |
| 675 | 675 | ); |
| 676 | - $GLOBALS['egw_setup']->oProc->query('SELECT * FROM calendar_entry_repeats',__LINE__,__FILE__); |
|
| 677 | - while($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 676 | + $GLOBALS['egw_setup']->oProc->query('SELECT * FROM calendar_entry_repeats', __LINE__, __FILE__); |
|
| 677 | + while ($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 678 | 678 | { |
| 679 | 679 | $id = $GLOBALS['egw_setup']->oProc->f('cal_id'); |
| 680 | 680 | $recur_type = $GLOBALS['egw_setup']->oProc->f('cal_type'); |
| 681 | - switch($recur_type) |
|
| 681 | + switch ($recur_type) |
|
| 682 | 682 | { |
| 683 | 683 | case 'daily': |
| 684 | 684 | $recur_type_num = RECUR_DAILY; |
@@ -701,20 +701,20 @@ discard block |
||
| 701 | 701 | $recur_interval = $GLOBALS['egw_setup']->oProc->f('cal_frequency'); |
| 702 | 702 | $days = strtoupper($GLOBALS['egw_setup']->oProc->f('cal_days')); |
| 703 | 703 | $recur_data = 0; |
| 704 | - $recur_data += (substr($days,0,1)=='Y'?M_SUNDAY:0); |
|
| 705 | - $recur_data += (substr($days,1,1)=='Y'?M_MONDAY:0); |
|
| 706 | - $recur_data += (substr($days,2,1)=='Y'?M_TUESDAY:0); |
|
| 707 | - $recur_data += (substr($days,3,1)=='Y'?M_WEDNESDAY:0); |
|
| 708 | - $recur_data += (substr($days,4,1)=='Y'?M_THURSDAY:0); |
|
| 709 | - $recur_data += (substr($days,5,1)=='Y'?M_FRIDAY:0); |
|
| 710 | - $recur_data += (substr($days,6,1)=='Y'?M_SATURDAY:0); |
|
| 704 | + $recur_data += (substr($days, 0, 1) == 'Y' ? M_SUNDAY : 0); |
|
| 705 | + $recur_data += (substr($days, 1, 1) == 'Y' ? M_MONDAY : 0); |
|
| 706 | + $recur_data += (substr($days, 2, 1) == 'Y' ? M_TUESDAY : 0); |
|
| 707 | + $recur_data += (substr($days, 3, 1) == 'Y' ? M_WEDNESDAY : 0); |
|
| 708 | + $recur_data += (substr($days, 4, 1) == 'Y' ? M_THURSDAY : 0); |
|
| 709 | + $recur_data += (substr($days, 5, 1) == 'Y' ? M_FRIDAY : 0); |
|
| 710 | + $recur_data += (substr($days, 6, 1) == 'Y' ? M_SATURDAY : 0); |
|
| 711 | 711 | $db2->query("INSERT INTO phpgw_cal_repeats(cal_id,recur_type,recur_use_end,recur_enddate,recur_interval,recur_data) " |
| 712 | - . "VALUES($id,$recur_type_num,$recur_use_end,$recur_end,$recur_interval,$recur_data)",__LINE__,__FILE__); |
|
| 712 | + . "VALUES($id,$recur_type_num,$recur_use_end,$recur_end,$recur_interval,$recur_data)", __LINE__, __FILE__); |
|
| 713 | 713 | } |
| 714 | 714 | $GLOBALS['egw_setup']->oProc->DropTable('calendar_entry_repeats'); |
| 715 | 715 | |
| 716 | 716 | // calendar_entry_user => phpgw_cal_user |
| 717 | - $GLOBALS['egw_setup']->oProc->RenameTable('calendar_entry_user','phpgw_cal_user'); |
|
| 717 | + $GLOBALS['egw_setup']->oProc->RenameTable('calendar_entry_user', 'phpgw_cal_user'); |
|
| 718 | 718 | |
| 719 | 719 | $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.11.002'; |
| 720 | 720 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -733,11 +733,11 @@ discard block |
||
| 733 | 733 | $GLOBALS['egw_setup']->oProc->CreateTable('phpgw_cal_holidays', |
| 734 | 734 | Array( |
| 735 | 735 | 'fd' => array( |
| 736 | - 'locale' => array('type' => 'char', 'precision' => 2,'nullable' => False), |
|
| 737 | - 'name' => array('type' => 'varchar', 'precision' => 50,'nullable' => False), |
|
| 738 | - 'date_time' => array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0') |
|
| 736 | + 'locale' => array('type' => 'char', 'precision' => 2, 'nullable' => False), |
|
| 737 | + 'name' => array('type' => 'varchar', 'precision' => 50, 'nullable' => False), |
|
| 738 | + 'date_time' => array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0') |
|
| 739 | 739 | ), |
| 740 | - 'pk' => array('locale','name'), |
|
| 740 | + 'pk' => array('locale', 'name'), |
|
| 741 | 741 | 'fk' => array(), |
| 742 | 742 | 'ix' => array(), |
| 743 | 743 | 'uc' => array() |
@@ -769,10 +769,10 @@ discard block |
||
| 769 | 769 | $GLOBALS['egw_setup']->oProc->CreateTable('phpgw_cal_holidays', |
| 770 | 770 | Array( |
| 771 | 771 | 'fd' => array( |
| 772 | - 'hol_id' => array('type' => 'auto','nullable' => False), |
|
| 773 | - 'locale' => array('type' => 'char', 'precision' => 2,'nullable' => False), |
|
| 774 | - 'name' => array('type' => 'varchar', 'precision' => 50,'nullable' => False), |
|
| 775 | - 'date_time' => array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0') |
|
| 772 | + 'hol_id' => array('type' => 'auto', 'nullable' => False), |
|
| 773 | + 'locale' => array('type' => 'char', 'precision' => 2, 'nullable' => False), |
|
| 774 | + 'name' => array('type' => 'varchar', 'precision' => 50, 'nullable' => False), |
|
| 775 | + 'date_time' => array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0') |
|
| 776 | 776 | ), |
| 777 | 777 | 'pk' => array('hol_id'), |
| 778 | 778 | 'fk' => array(), |
@@ -789,10 +789,10 @@ discard block |
||
| 789 | 789 | function calendar_upgrade0_9_11_007() |
| 790 | 790 | { |
| 791 | 791 | $GLOBALS['egw_setup']->oProc->query('DELETE FROM phpgw_cal_holidays'); |
| 792 | - $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays','mday',array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0')); |
|
| 793 | - $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays','month_num',array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0')); |
|
| 794 | - $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays','occurence',array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0')); |
|
| 795 | - $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays','dow',array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0')); |
|
| 792 | + $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays', 'mday', array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0')); |
|
| 793 | + $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays', 'month_num', array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0')); |
|
| 794 | + $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays', 'occurence', array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0')); |
|
| 795 | + $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays', 'dow', array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0')); |
|
| 796 | 796 | |
| 797 | 797 | $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.11.008'; |
| 798 | 798 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -809,7 +809,7 @@ discard block |
||
| 809 | 809 | function calendar_upgrade0_9_11_009() |
| 810 | 810 | { |
| 811 | 811 | $GLOBALS['egw_setup']->oProc->query('DELETE FROM phpgw_cal_holidays'); |
| 812 | - $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays','observance_rule',array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0')); |
|
| 812 | + $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_holidays', 'observance_rule', array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0')); |
|
| 813 | 813 | |
| 814 | 814 | $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.11.010'; |
| 815 | 815 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -844,7 +844,7 @@ discard block |
||
| 844 | 844 | |
| 845 | 845 | function calendar_upgrade0_9_13_002() |
| 846 | 846 | { |
| 847 | - $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal','reference',array('type' => 'int', 'precision' => 8,'nullable' => False, 'default' => '0')); |
|
| 847 | + $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal', 'reference', array('type' => 'int', 'precision' => 8, 'nullable' => False, 'default' => '0')); |
|
| 848 | 848 | |
| 849 | 849 | $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.13.003'; |
| 850 | 850 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -856,7 +856,7 @@ discard block |
||
| 856 | 856 | $GLOBALS['egw_setup']->oProc->CreateTable('phpgw_cal_alarm', |
| 857 | 857 | Array( |
| 858 | 858 | 'fd' => array( |
| 859 | - 'alarm_id' => array('type' => 'auto','nullable' => False), |
|
| 859 | + 'alarm_id' => array('type' => 'auto', 'nullable' => False), |
|
| 860 | 860 | 'cal_id' => array('type' => 'int', 'precision' => 8, 'nullable' => False), |
| 861 | 861 | 'cal_owner' => array('type' => 'int', 'precision' => 8, 'nullable' => False), |
| 862 | 862 | 'cal_time' => array('type' => 'int', 'precision' => 8, 'nullable' => False), |
@@ -869,8 +869,8 @@ discard block |
||
| 869 | 869 | ) |
| 870 | 870 | ); |
| 871 | 871 | |
| 872 | - $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal','uid',array('type' => 'varchar', 'precision' => 255,'nullable' => False)); |
|
| 873 | - $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal','location',array('type' => 'varchar', 'precision' => 255,'nullable' => True)); |
|
| 872 | + $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal', 'uid', array('type' => 'varchar', 'precision' => 255, 'nullable' => False)); |
|
| 873 | + $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal', 'location', array('type' => 'varchar', 'precision' => 255, 'nullable' => True)); |
|
| 874 | 874 | |
| 875 | 875 | $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.13.004'; |
| 876 | 876 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -879,7 +879,7 @@ discard block |
||
| 879 | 879 | |
| 880 | 880 | function calendar_upgrade0_9_13_004() |
| 881 | 881 | { |
| 882 | - $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_alarm','alarm_enabled',array('type' => 'int', 'precision' => 4,'nullable' => False, 'default' => '1')); |
|
| 882 | + $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_alarm', 'alarm_enabled', array('type' => 'int', 'precision' => 4, 'nullable' => False, 'default' => '1')); |
|
| 883 | 883 | |
| 884 | 884 | $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.13.005'; |
| 885 | 885 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -889,18 +889,18 @@ discard block |
||
| 889 | 889 | function calendar_upgrade0_9_13_005() |
| 890 | 890 | { |
| 891 | 891 | $calendar_data = Array(); |
| 892 | - $GLOBALS['egw_setup']->oProc->query('SELECT cal_id, category FROM phpgw_cal',__LINE__,__FILE__); |
|
| 893 | - while($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 892 | + $GLOBALS['egw_setup']->oProc->query('SELECT cal_id, category FROM phpgw_cal', __LINE__, __FILE__); |
|
| 893 | + while ($GLOBALS['egw_setup']->oProc->next_record()) |
|
| 894 | 894 | { |
| 895 | 895 | $calendar_data[$GLOBALS['egw_setup']->oProc->f('cal_id')] = $GLOBALS['egw_setup']->oProc->f('category'); |
| 896 | 896 | } |
| 897 | 897 | |
| 898 | - $GLOBALS['egw_setup']->oProc->AlterColumn('phpgw_cal','category',array('type' => 'varchar', 'precision' => 30,'nullable' => True)); |
|
| 898 | + $GLOBALS['egw_setup']->oProc->AlterColumn('phpgw_cal', 'category', array('type' => 'varchar', 'precision' => 30, 'nullable' => True)); |
|
| 899 | 899 | |
| 900 | 900 | @reset($calendar_data); |
| 901 | - while($calendar_data && list($cal_id,$category) = each($calendar_data)) |
|
| 901 | + while ($calendar_data && list($cal_id, $category) = each($calendar_data)) |
|
| 902 | 902 | { |
| 903 | - $GLOBALS['egw_setup']->oProc->query("UPDATE phpgw_cal SET category='".$category."' WHERE cal_id=".$cal_id,__LINE__,__FILE__); |
|
| 903 | + $GLOBALS['egw_setup']->oProc->query("UPDATE phpgw_cal SET category='".$category."' WHERE cal_id=".$cal_id, __LINE__, __FILE__); |
|
| 904 | 904 | } |
| 905 | 905 | $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.13.006'; |
| 906 | 906 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -909,7 +909,7 @@ discard block |
||
| 909 | 909 | |
| 910 | 910 | function calendar_upgrade0_9_13_006() |
| 911 | 911 | { |
| 912 | - $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_repeats','recur_exception',array('type' => 'varchar', 'precision' => 255, 'nullable' => True, 'default' => '')); |
|
| 912 | + $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_repeats', 'recur_exception', array('type' => 'varchar', 'precision' => 255, 'nullable' => True, 'default' => '')); |
|
| 913 | 913 | |
| 914 | 914 | $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.13.007'; |
| 915 | 915 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -919,20 +919,20 @@ discard block |
||
| 919 | 919 | |
| 920 | 920 | function calendar_upgrade0_9_13_007() |
| 921 | 921 | { |
| 922 | - $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_user','cal_type',array( |
|
| 922 | + $GLOBALS['egw_setup']->oProc->AddColumn('phpgw_cal_user', 'cal_type', array( |
|
| 923 | 923 | 'type' => 'varchar', |
| 924 | 924 | 'precision' => '1', |
| 925 | 925 | 'nullable' => False, |
| 926 | 926 | 'default' => 'u' |
| 927 | 927 | )); |
| 928 | 928 | |
| 929 | - $GLOBALS['egw_setup']->oProc->CreateTable('phpgw_cal_extra',array( |
|
| 929 | + $GLOBALS['egw_setup']->oProc->CreateTable('phpgw_cal_extra', array( |
|
| 930 | 930 | 'fd' => array( |
| 931 | - 'cal_id' => array('type' => 'int','precision' => '4','nullable' => False), |
|
| 932 | - 'cal_extra_name' => array('type' => 'varchar','precision' => '40','nullable' => False), |
|
| 933 | - 'cal_extra_value' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '') |
|
| 931 | + 'cal_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
| 932 | + 'cal_extra_name' => array('type' => 'varchar', 'precision' => '40', 'nullable' => False), |
|
| 933 | + 'cal_extra_value' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '') |
|
| 934 | 934 | ), |
| 935 | - 'pk' => array('cal_id','cal_extra_name'), |
|
| 935 | + 'pk' => array('cal_id', 'cal_extra_name'), |
|
| 936 | 936 | 'fk' => array(), |
| 937 | 937 | 'ix' => array(), |
| 938 | 938 | 'uc' => array() |
@@ -949,7 +949,7 @@ discard block |
||
| 949 | 949 | function calendar_upgrade0_9_16_001() |
| 950 | 950 | { |
| 951 | 951 | // this is to set the default as schema_proc was not setting an empty default |
| 952 | - $GLOBALS['egw_setup']->oProc->AlterColumn('phpgw_cal_user','cal_type',array( |
|
| 952 | + $GLOBALS['egw_setup']->oProc->AlterColumn('phpgw_cal_user', 'cal_type', array( |
|
| 953 | 953 | 'type' => 'varchar', |
| 954 | 954 | 'precision' => '1', |
| 955 | 955 | 'nullable' => False, |
@@ -966,15 +966,15 @@ discard block |
||
| 966 | 966 | |
| 967 | 967 | function calendar_upgrade0_9_16_002() |
| 968 | 968 | { |
| 969 | - $GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_repeats',array( |
|
| 969 | + $GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_repeats', array( |
|
| 970 | 970 | 'fd' => array( |
| 971 | - 'cal_id' => array('type' => 'int','precision' => '8','nullable' => False), |
|
| 972 | - 'recur_type' => array('type' => 'int','precision' => '8','nullable' => False), |
|
| 973 | - 'recur_use_end' => array('type' => 'int','precision' => '8','default' => '0'), |
|
| 974 | - 'recur_enddate' => array('type' => 'int','precision' => '8'), |
|
| 975 | - 'recur_interval' => array('type' => 'int','precision' => '8','default' => '1'), |
|
| 976 | - 'recur_data' => array('type' => 'int','precision' => '8','default' => '1'), |
|
| 977 | - 'recur_exception' => array('type' => 'varchar','precision' => '255','default' => '') |
|
| 971 | + 'cal_id' => array('type' => 'int', 'precision' => '8', 'nullable' => False), |
|
| 972 | + 'recur_type' => array('type' => 'int', 'precision' => '8', 'nullable' => False), |
|
| 973 | + 'recur_use_end' => array('type' => 'int', 'precision' => '8', 'default' => '0'), |
|
| 974 | + 'recur_enddate' => array('type' => 'int', 'precision' => '8'), |
|
| 975 | + 'recur_interval' => array('type' => 'int', 'precision' => '8', 'default' => '1'), |
|
| 976 | + 'recur_data' => array('type' => 'int', 'precision' => '8', 'default' => '1'), |
|
| 977 | + 'recur_exception' => array('type' => 'varchar', 'precision' => '255', 'default' => '') |
|
| 978 | 978 | ), |
| 979 | 979 | 'pk' => array(), |
| 980 | 980 | 'fk' => array(), |
@@ -990,14 +990,14 @@ discard block |
||
| 990 | 990 | |
| 991 | 991 | function calendar_upgrade0_9_16_003() |
| 992 | 992 | { |
| 993 | - $GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_user',array( |
|
| 993 | + $GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_user', array( |
|
| 994 | 994 | 'fd' => array( |
| 995 | - 'cal_id' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'), |
|
| 996 | - 'cal_login' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'), |
|
| 997 | - 'cal_status' => array('type' => 'char','precision' => '1','default' => 'A'), |
|
| 998 | - 'cal_type' => array('type' => 'varchar','precision' => '1','nullable' => False,'default' => 'u') |
|
| 995 | + 'cal_id' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'), |
|
| 996 | + 'cal_login' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'), |
|
| 997 | + 'cal_status' => array('type' => 'char', 'precision' => '1', 'default' => 'A'), |
|
| 998 | + 'cal_type' => array('type' => 'varchar', 'precision' => '1', 'nullable' => False, 'default' => 'u') |
|
| 999 | 999 | ), |
| 1000 | - 'pk' => array('cal_id','cal_login','cal_type'), |
|
| 1000 | + 'pk' => array('cal_id', 'cal_login', 'cal_type'), |
|
| 1001 | 1001 | 'fk' => array(), |
| 1002 | 1002 | 'ix' => array(), |
| 1003 | 1003 | 'uc' => array() |
@@ -1011,16 +1011,16 @@ discard block |
||
| 1011 | 1011 | |
| 1012 | 1012 | function calendar_upgrade0_9_16_004() |
| 1013 | 1013 | { |
| 1014 | - $GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_holidays',array( |
|
| 1014 | + $GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_holidays', array( |
|
| 1015 | 1015 | 'fd' => array( |
| 1016 | - 'hol_id' => array('type' => 'auto','nullable' => False), |
|
| 1017 | - 'locale' => array('type' => 'char','precision' => '2','nullable' => False), |
|
| 1018 | - 'name' => array('type' => 'varchar','precision' => '50','nullable' => False), |
|
| 1019 | - 'mday' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'), |
|
| 1020 | - 'month_num' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'), |
|
| 1021 | - 'occurence' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'), |
|
| 1022 | - 'dow' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'), |
|
| 1023 | - 'observance_rule' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0') |
|
| 1016 | + 'hol_id' => array('type' => 'auto', 'nullable' => False), |
|
| 1017 | + 'locale' => array('type' => 'char', 'precision' => '2', 'nullable' => False), |
|
| 1018 | + 'name' => array('type' => 'varchar', 'precision' => '50', 'nullable' => False), |
|
| 1019 | + 'mday' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'), |
|
| 1020 | + 'month_num' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'), |
|
| 1021 | + 'occurence' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'), |
|
| 1022 | + 'dow' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'), |
|
| 1023 | + 'observance_rule' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0') |
|
| 1024 | 1024 | ), |
| 1025 | 1025 | 'pk' => array('hol_id'), |
| 1026 | 1026 | 'fk' => array(), |
@@ -1038,13 +1038,13 @@ discard block |
||
| 1038 | 1038 | { |
| 1039 | 1039 | // creates uid's for all entries which do not have unique ones, they are '[email protected]' |
| 1040 | 1040 | // very old entries even have an empty uid, see 0.9.16.006 update |
| 1041 | - $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 | + $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__); |
|
| 1042 | 1042 | while ($GLOBALS['egw_setup']->oProc->next_record()) |
| 1043 | 1043 | { |
| 1044 | 1044 | $config[$GLOBALS['egw_setup']->oProc->f(0)] = $GLOBALS['egw_setup']->oProc->f(1); |
| 1045 | 1045 | } |
| 1046 | 1046 | $GLOBALS['egw_setup']->oProc->query('UPDATE phpgw_cal SET uid='. |
| 1047 | - $GLOBALS['egw_setup']->db->concat($GLOBALS['egw_setup']->db->quote('cal-'),'cal_id', |
|
| 1047 | + $GLOBALS['egw_setup']->db->concat($GLOBALS['egw_setup']->db->quote('cal-'), 'cal_id', |
|
| 1048 | 1048 | $GLOBALS['egw_setup']->db->quote('-'.$config['install_id'].'@'. |
| 1049 | 1049 | ($config['mail_suffix'] ? $config['mail_suffix'] : 'local'))). |
| 1050 | 1050 | " WHERE uid LIKE '-@%' OR uid=''"); |
@@ -1067,7 +1067,7 @@ discard block |
||
| 1067 | 1067 | function calendar_upgrade0_9_16_007() |
| 1068 | 1068 | { |
| 1069 | 1069 | // update the sequenzes for refreshed tables (postgres only) |
| 1070 | - $GLOBALS['egw_setup']->oProc->UpdateSequence('phpgw_cal_holidays','hol_id'); |
|
| 1070 | + $GLOBALS['egw_setup']->oProc->UpdateSequence('phpgw_cal_holidays', 'hol_id'); |
|
| 1071 | 1071 | |
| 1072 | 1072 | $GLOBALS['setup_info']['calendar']['currentver'] = '1.0.0'; |
| 1073 | 1073 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -1077,19 +1077,19 @@ discard block |
||
| 1077 | 1077 | |
| 1078 | 1078 | function calendar_upgrade1_0_0() |
| 1079 | 1079 | { |
| 1080 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','uid','cal_uid'); |
|
| 1081 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','owner','cal_owner'); |
|
| 1082 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','category','cal_category'); |
|
| 1083 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','groups','cal_groups'); |
|
| 1084 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','datetime','cal_starttime'); |
|
| 1085 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','mdatetime','cal_modified'); |
|
| 1086 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','edatetime','cal_endtime'); |
|
| 1087 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','priority','cal_priority'); |
|
| 1088 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','is_public','cal_public'); |
|
| 1089 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','title','cal_title'); |
|
| 1090 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','description','cal_description'); |
|
| 1091 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','location','cal_location'); |
|
| 1092 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal','reference','cal_reference'); |
|
| 1080 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'uid', 'cal_uid'); |
|
| 1081 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'owner', 'cal_owner'); |
|
| 1082 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'category', 'cal_category'); |
|
| 1083 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'groups', 'cal_groups'); |
|
| 1084 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'datetime', 'cal_starttime'); |
|
| 1085 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'mdatetime', 'cal_modified'); |
|
| 1086 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'edatetime', 'cal_endtime'); |
|
| 1087 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'priority', 'cal_priority'); |
|
| 1088 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'is_public', 'cal_public'); |
|
| 1089 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'title', 'cal_title'); |
|
| 1090 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'description', 'cal_description'); |
|
| 1091 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'location', 'cal_location'); |
|
| 1092 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal', 'reference', 'cal_reference'); |
|
| 1093 | 1093 | |
| 1094 | 1094 | $GLOBALS['setup_info']['calendar']['currentver'] = '1.0.0.001'; |
| 1095 | 1095 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -1099,13 +1099,13 @@ discard block |
||
| 1099 | 1099 | |
| 1100 | 1100 | function calendar_upgrade1_0_0_001() |
| 1101 | 1101 | { |
| 1102 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays','locale','hol_locale'); |
|
| 1103 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays','name','hol_name'); |
|
| 1104 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays','mday','hol_mday'); |
|
| 1105 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays','month_num','hol_month_num'); |
|
| 1106 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays','occurence','hol_occurence'); |
|
| 1107 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays','dow','hol_dow'); |
|
| 1108 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays','observance_rule','hol_observance_rule'); |
|
| 1102 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays', 'locale', 'hol_locale'); |
|
| 1103 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays', 'name', 'hol_name'); |
|
| 1104 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays', 'mday', 'hol_mday'); |
|
| 1105 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays', 'month_num', 'hol_month_num'); |
|
| 1106 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays', 'occurence', 'hol_occurence'); |
|
| 1107 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays', 'dow', 'hol_dow'); |
|
| 1108 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_holidays', 'observance_rule', 'hol_observance_rule'); |
|
| 1109 | 1109 | |
| 1110 | 1110 | $GLOBALS['setup_info']['calendar']['currentver'] = '1.0.0.002'; |
| 1111 | 1111 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -1115,8 +1115,8 @@ discard block |
||
| 1115 | 1115 | |
| 1116 | 1116 | function calendar_upgrade1_0_0_002() |
| 1117 | 1117 | { |
| 1118 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_user','cal_login','cal_user_id'); |
|
| 1119 | - $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_user','cal_type','cal_user_type'); |
|
| 1118 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_user', 'cal_login', 'cal_user_id'); |
|
| 1119 | + $GLOBALS['egw_setup']->oProc->RenameColumn('phpgw_cal_user', 'cal_type', 'cal_user_type'); |
|
| 1120 | 1120 | |
| 1121 | 1121 | $GLOBALS['setup_info']['calendar']['currentver'] = '1.0.0.003'; |
| 1122 | 1122 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -1126,7 +1126,7 @@ discard block |
||
| 1126 | 1126 | |
| 1127 | 1127 | function calendar_upgrade1_0_0_003() |
| 1128 | 1128 | { |
| 1129 | - $GLOBALS['egw_setup']->oProc->AlterColumn('phpgw_cal','cal_title',array( |
|
| 1129 | + $GLOBALS['egw_setup']->oProc->AlterColumn('phpgw_cal', 'cal_title', array( |
|
| 1130 | 1130 | 'type' => 'varchar', |
| 1131 | 1131 | 'precision' => '255', |
| 1132 | 1132 | 'nullable' => False, |
@@ -1141,15 +1141,15 @@ discard block |
||
| 1141 | 1141 | |
| 1142 | 1142 | function calendar_upgrade1_0_0_004() |
| 1143 | 1143 | { |
| 1144 | - $GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_repeats',array( |
|
| 1144 | + $GLOBALS['egw_setup']->oProc->RefreshTable('phpgw_cal_repeats', array( |
|
| 1145 | 1145 | 'fd' => array( |
| 1146 | - 'cal_id' => array('type' => 'int','precision' => '8','nullable' => False), |
|
| 1147 | - 'recur_type' => array('type' => 'int','precision' => '8','nullable' => False), |
|
| 1148 | - 'recur_use_end' => array('type' => 'int','precision' => '8','default' => '0'), |
|
| 1149 | - 'recur_enddate' => array('type' => 'int','precision' => '8'), |
|
| 1150 | - 'recur_interval' => array('type' => 'int','precision' => '8','default' => '1'), |
|
| 1151 | - 'recur_data' => array('type' => 'int','precision' => '8','default' => '1'), |
|
| 1152 | - 'recur_exception' => array('type' => 'varchar','precision' => '255','default' => '') |
|
| 1146 | + 'cal_id' => array('type' => 'int', 'precision' => '8', 'nullable' => False), |
|
| 1147 | + 'recur_type' => array('type' => 'int', 'precision' => '8', 'nullable' => False), |
|
| 1148 | + 'recur_use_end' => array('type' => 'int', 'precision' => '8', 'default' => '0'), |
|
| 1149 | + 'recur_enddate' => array('type' => 'int', 'precision' => '8'), |
|
| 1150 | + 'recur_interval' => array('type' => 'int', 'precision' => '8', 'default' => '1'), |
|
| 1151 | + 'recur_data' => array('type' => 'int', 'precision' => '8', 'default' => '1'), |
|
| 1152 | + 'recur_exception' => array('type' => 'varchar', 'precision' => '255', 'default' => '') |
|
| 1153 | 1153 | ), |
| 1154 | 1154 | 'pk' => array('cal_id'), |
| 1155 | 1155 | 'fk' => array(), |
@@ -1166,19 +1166,19 @@ discard block |
||
| 1166 | 1166 | function calendar_upgrade1_0_0_005() |
| 1167 | 1167 | { |
| 1168 | 1168 | // change prefix of all calendar tables to egw_ |
| 1169 | - foreach(array('cal_user','cal_repeats','cal_extra','cal_holidays','cal') as $name) |
|
| 1169 | + foreach (array('cal_user', 'cal_repeats', 'cal_extra', 'cal_holidays', 'cal') as $name) |
|
| 1170 | 1170 | { |
| 1171 | - $GLOBALS['egw_setup']->oProc->RenameTable('phpgw_'.$name,'egw_'.$name); |
|
| 1171 | + $GLOBALS['egw_setup']->oProc->RenameTable('phpgw_'.$name, 'egw_'.$name); |
|
| 1172 | 1172 | } |
| 1173 | 1173 | |
| 1174 | 1174 | // create new dates table, with content from the egw_cal table |
| 1175 | - $GLOBALS['egw_setup']->oProc->CreateTable('egw_cal_dates',array( |
|
| 1175 | + $GLOBALS['egw_setup']->oProc->CreateTable('egw_cal_dates', array( |
|
| 1176 | 1176 | 'fd' => array( |
| 1177 | - 'cal_id' => array('type' => 'int','precision' => '4','nullable' => False), |
|
| 1178 | - 'cal_start' => array('type' => 'int','precision' => '8','nullable' => False), |
|
| 1179 | - 'cal_end' => array('type' => 'int','precision' => '8','nullable' => False) |
|
| 1177 | + 'cal_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
| 1178 | + 'cal_start' => array('type' => 'int', 'precision' => '8', 'nullable' => False), |
|
| 1179 | + 'cal_end' => array('type' => 'int', 'precision' => '8', 'nullable' => False) |
|
| 1180 | 1180 | ), |
| 1181 | - 'pk' => array('cal_id','cal_start'), |
|
| 1181 | + 'pk' => array('cal_id', 'cal_start'), |
|
| 1182 | 1182 | 'fk' => array(), |
| 1183 | 1183 | 'ix' => array(), |
| 1184 | 1184 | 'uc' => array() |
@@ -1186,49 +1186,49 @@ discard block |
||
| 1186 | 1186 | $GLOBALS['egw_setup']->oProc->query("INSERT INTO egw_cal_dates SELECT cal_id,cal_starttime,cal_endtime FROM egw_cal"); |
| 1187 | 1187 | |
| 1188 | 1188 | // drop the fields transfered to the dates table |
| 1189 | - $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal',array( |
|
| 1189 | + $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal', array( |
|
| 1190 | 1190 | 'fd' => array( |
| 1191 | - 'cal_id' => array('type' => 'auto','nullable' => False), |
|
| 1192 | - 'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False), |
|
| 1193 | - 'cal_owner' => array('type' => 'int','precision' => '8','nullable' => False), |
|
| 1194 | - 'cal_category' => array('type' => 'varchar','precision' => '30'), |
|
| 1195 | - 'cal_groups' => array('type' => 'varchar','precision' => '255'), |
|
| 1196 | - 'cal_modified' => array('type' => 'int','precision' => '8'), |
|
| 1197 | - 'cal_endtime' => array('type' => 'int','precision' => '8'), |
|
| 1198 | - 'cal_priority' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '2'), |
|
| 1199 | - 'cal_type' => array('type' => 'varchar','precision' => '10'), |
|
| 1200 | - 'cal_public' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '1'), |
|
| 1201 | - 'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'), |
|
| 1191 | + 'cal_id' => array('type' => 'auto', 'nullable' => False), |
|
| 1192 | + 'cal_uid' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False), |
|
| 1193 | + 'cal_owner' => array('type' => 'int', 'precision' => '8', 'nullable' => False), |
|
| 1194 | + 'cal_category' => array('type' => 'varchar', 'precision' => '30'), |
|
| 1195 | + 'cal_groups' => array('type' => 'varchar', 'precision' => '255'), |
|
| 1196 | + 'cal_modified' => array('type' => 'int', 'precision' => '8'), |
|
| 1197 | + 'cal_endtime' => array('type' => 'int', 'precision' => '8'), |
|
| 1198 | + 'cal_priority' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '2'), |
|
| 1199 | + 'cal_type' => array('type' => 'varchar', 'precision' => '10'), |
|
| 1200 | + 'cal_public' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '1'), |
|
| 1201 | + 'cal_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '1'), |
|
| 1202 | 1202 | 'cal_description' => array('type' => 'text'), |
| 1203 | - 'cal_location' => array('type' => 'varchar','precision' => '255'), |
|
| 1204 | - 'cal_reference' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0') |
|
| 1203 | + 'cal_location' => array('type' => 'varchar', 'precision' => '255'), |
|
| 1204 | + 'cal_reference' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0') |
|
| 1205 | 1205 | ), |
| 1206 | 1206 | 'pk' => array('cal_id'), |
| 1207 | 1207 | 'fk' => array(), |
| 1208 | 1208 | 'ix' => array(), |
| 1209 | 1209 | 'uc' => array() |
| 1210 | - ),'cal_starttime'); |
|
| 1211 | - $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal',array( |
|
| 1210 | + ), 'cal_starttime'); |
|
| 1211 | + $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal', array( |
|
| 1212 | 1212 | 'fd' => array( |
| 1213 | - 'cal_id' => array('type' => 'auto','nullable' => False), |
|
| 1214 | - 'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False), |
|
| 1215 | - 'cal_owner' => array('type' => 'int','precision' => '8','nullable' => False), |
|
| 1216 | - 'cal_category' => array('type' => 'varchar','precision' => '30'), |
|
| 1217 | - 'cal_groups' => array('type' => 'varchar','precision' => '255'), |
|
| 1218 | - 'cal_modified' => array('type' => 'int','precision' => '8'), |
|
| 1219 | - 'cal_priority' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '2'), |
|
| 1220 | - 'cal_type' => array('type' => 'varchar','precision' => '10'), |
|
| 1221 | - 'cal_public' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '1'), |
|
| 1222 | - 'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'), |
|
| 1213 | + 'cal_id' => array('type' => 'auto', 'nullable' => False), |
|
| 1214 | + 'cal_uid' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False), |
|
| 1215 | + 'cal_owner' => array('type' => 'int', 'precision' => '8', 'nullable' => False), |
|
| 1216 | + 'cal_category' => array('type' => 'varchar', 'precision' => '30'), |
|
| 1217 | + 'cal_groups' => array('type' => 'varchar', 'precision' => '255'), |
|
| 1218 | + 'cal_modified' => array('type' => 'int', 'precision' => '8'), |
|
| 1219 | + 'cal_priority' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '2'), |
|
| 1220 | + 'cal_type' => array('type' => 'varchar', 'precision' => '10'), |
|
| 1221 | + 'cal_public' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '1'), |
|
| 1222 | + 'cal_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '1'), |
|
| 1223 | 1223 | 'cal_description' => array('type' => 'text'), |
| 1224 | - 'cal_location' => array('type' => 'varchar','precision' => '255'), |
|
| 1225 | - 'cal_reference' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0') |
|
| 1224 | + 'cal_location' => array('type' => 'varchar', 'precision' => '255'), |
|
| 1225 | + 'cal_reference' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0') |
|
| 1226 | 1226 | ), |
| 1227 | 1227 | 'pk' => array('cal_id'), |
| 1228 | 1228 | 'fk' => array(), |
| 1229 | 1229 | 'ix' => array(), |
| 1230 | 1230 | 'uc' => array() |
| 1231 | - ),'cal_endtime'); |
|
| 1231 | + ), 'cal_endtime'); |
|
| 1232 | 1232 | |
| 1233 | 1233 | $GLOBALS['setup_info']['calendar']['currentver'] = '1.0.1.001'; |
| 1234 | 1234 | return $GLOBALS['setup_info']['calendar']['currentver']; |
@@ -1244,15 +1244,15 @@ discard block |
||
| 1244 | 1244 | 'precision' => '8', |
| 1245 | 1245 | 'default' => '0' |
| 1246 | 1246 | ));*/ |
| 1247 | - $GLOBALS['egw_setup']->oProc->RefreshTable('egw_cal_user',array( |
|
| 1247 | + $GLOBALS['egw_setup']->oProc->RefreshTable('egw_cal_user', array( |
|
| 1248 | 1248 | 'fd' => array( |
| 1249 | - 'cal_id' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'), |
|
| 1250 | - 'cal_recur_date' => array('type' => 'int','precision' => '8','default' => '0'), |
|
| 1251 | - 'cal_user_type' => array('type' => 'varchar','precision' => '1','nullable' => False,'default' => 'u'), |
|
| 1252 | - 'cal_user_id' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'), |
|
| 1253 | - 'cal_status' => array('type' => 'char','precision' => '1','default' => 'A') |
|
| 1249 | + 'cal_id' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'), |
|
| 1250 | + 'cal_recur_date' => array('type' => 'int', 'precision' => '8', 'default' => '0'), |
|
| 1251 | + 'cal_user_type' => array('type' => 'varchar', 'precision' => '1', 'nullable' => False, 'default' => 'u'), |
|
| 1252 | + 'cal_user_id' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0'), |
|
| 1253 | + 'cal_status' => array('type' => 'char', 'precision' => '1', 'default' => 'A') |
|
| 1254 | 1254 | ), |
| 1255 | - 'pk' => array('cal_id','cal_recur_date','cal_user_type','cal_user_id'), |
|
| 1255 | + 'pk' => array('cal_id', 'cal_recur_date', 'cal_user_type', 'cal_user_id'), |
|
| 1256 | 1256 | 'fk' => array(), |
| 1257 | 1257 | 'ix' => array(), |
| 1258 | 1258 | 'uc' => array() |
@@ -1266,50 +1266,50 @@ discard block |
||
| 1266 | 1266 | |
| 1267 | 1267 | function calendar_upgrade1_0_1_002() |
| 1268 | 1268 | { |
| 1269 | - $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal',array( |
|
| 1269 | + $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal', array( |
|
| 1270 | 1270 | 'fd' => array( |
| 1271 | - 'cal_id' => array('type' => 'auto','nullable' => False), |
|
| 1272 | - 'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False), |
|
| 1273 | - 'cal_owner' => array('type' => 'int','precision' => '8','nullable' => False), |
|
| 1274 | - 'cal_category' => array('type' => 'varchar','precision' => '30'), |
|
| 1275 | - 'cal_groups' => array('type' => 'varchar','precision' => '255'), |
|
| 1276 | - 'cal_modified' => array('type' => 'int','precision' => '8'), |
|
| 1277 | - 'cal_priority' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '2'), |
|
| 1278 | - 'cal_public' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '1'), |
|
| 1279 | - 'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'), |
|
| 1271 | + 'cal_id' => array('type' => 'auto', 'nullable' => False), |
|
| 1272 | + 'cal_uid' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False), |
|
| 1273 | + 'cal_owner' => array('type' => 'int', 'precision' => '8', 'nullable' => False), |
|
| 1274 | + 'cal_category' => array('type' => 'varchar', 'precision' => '30'), |
|
| 1275 | + 'cal_groups' => array('type' => 'varchar', 'precision' => '255'), |
|
| 1276 | + 'cal_modified' => array('type' => 'int', 'precision' => '8'), |
|
| 1277 | + 'cal_priority' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '2'), |
|
| 1278 | + 'cal_public' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '1'), |
|
| 1279 | + 'cal_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '1'), |
|
| 1280 | 1280 | 'cal_description' => array('type' => 'text'), |
| 1281 | - 'cal_location' => array('type' => 'varchar','precision' => '255'), |
|
| 1282 | - 'cal_reference' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0') |
|
| 1281 | + 'cal_location' => array('type' => 'varchar', 'precision' => '255'), |
|
| 1282 | + 'cal_reference' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0') |
|
| 1283 | 1283 | ), |
| 1284 | 1284 | 'pk' => array('cal_id'), |
| 1285 | 1285 | 'fk' => array(), |
| 1286 | 1286 | 'ix' => array(), |
| 1287 | 1287 | 'uc' => array() |
| 1288 | - ),'cal_type'); |
|
| 1289 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_owner',array( |
|
| 1288 | + ), 'cal_type'); |
|
| 1289 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_owner', array( |
|
| 1290 | 1290 | 'type' => 'int', |
| 1291 | 1291 | 'precision' => '4', |
| 1292 | 1292 | 'nullable' => False |
| 1293 | 1293 | )); |
| 1294 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_priority',array( |
|
| 1294 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_priority', array( |
|
| 1295 | 1295 | 'type' => 'int', |
| 1296 | 1296 | 'precision' => '2', |
| 1297 | 1297 | 'nullable' => False, |
| 1298 | 1298 | 'default' => '2' |
| 1299 | 1299 | )); |
| 1300 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_public',array( |
|
| 1300 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_public', array( |
|
| 1301 | 1301 | 'type' => 'int', |
| 1302 | 1302 | 'precision' => '2', |
| 1303 | 1303 | 'nullable' => False, |
| 1304 | 1304 | 'default' => '1' |
| 1305 | 1305 | )); |
| 1306 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_reference',array( |
|
| 1306 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_reference', array( |
|
| 1307 | 1307 | 'type' => 'int', |
| 1308 | 1308 | 'precision' => '4', |
| 1309 | 1309 | 'nullable' => False, |
| 1310 | 1310 | 'default' => '0' |
| 1311 | 1311 | )); |
| 1312 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_modifier',array( |
|
| 1312 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_modifier', array( |
|
| 1313 | 1313 | 'type' => 'int', |
| 1314 | 1314 | 'precision' => '4' |
| 1315 | 1315 | )); |
@@ -1322,36 +1322,36 @@ discard block |
||
| 1322 | 1322 | |
| 1323 | 1323 | function calendar_upgrade1_0_1_003() |
| 1324 | 1324 | { |
| 1325 | - $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal_repeats',array( |
|
| 1325 | + $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal_repeats', array( |
|
| 1326 | 1326 | 'fd' => array( |
| 1327 | - 'cal_id' => array('type' => 'int','precision' => '8','nullable' => False), |
|
| 1328 | - 'recur_type' => array('type' => 'int','precision' => '8','nullable' => False), |
|
| 1329 | - 'recur_enddate' => array('type' => 'int','precision' => '8'), |
|
| 1330 | - 'recur_interval' => array('type' => 'int','precision' => '8','default' => '1'), |
|
| 1331 | - 'recur_data' => array('type' => 'int','precision' => '8','default' => '1'), |
|
| 1332 | - 'recur_exception' => array('type' => 'varchar','precision' => '255','default' => '') |
|
| 1327 | + 'cal_id' => array('type' => 'int', 'precision' => '8', 'nullable' => False), |
|
| 1328 | + 'recur_type' => array('type' => 'int', 'precision' => '8', 'nullable' => False), |
|
| 1329 | + 'recur_enddate' => array('type' => 'int', 'precision' => '8'), |
|
| 1330 | + 'recur_interval' => array('type' => 'int', 'precision' => '8', 'default' => '1'), |
|
| 1331 | + 'recur_data' => array('type' => 'int', 'precision' => '8', 'default' => '1'), |
|
| 1332 | + 'recur_exception' => array('type' => 'varchar', 'precision' => '255', 'default' => '') |
|
| 1333 | 1333 | ), |
| 1334 | 1334 | 'pk' => array('cal_id'), |
| 1335 | 1335 | 'fk' => array(), |
| 1336 | 1336 | 'ix' => array(), |
| 1337 | 1337 | 'uc' => array() |
| 1338 | - ),'recur_use_end'); |
|
| 1339 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats','cal_id',array( |
|
| 1338 | + ), 'recur_use_end'); |
|
| 1339 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats', 'cal_id', array( |
|
| 1340 | 1340 | 'type' => 'int', |
| 1341 | 1341 | 'precision' => '4', |
| 1342 | 1342 | 'nullable' => False |
| 1343 | 1343 | )); |
| 1344 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats','recur_type',array( |
|
| 1344 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats', 'recur_type', array( |
|
| 1345 | 1345 | 'type' => 'int', |
| 1346 | 1346 | 'precision' => '2', |
| 1347 | 1347 | 'nullable' => False |
| 1348 | 1348 | )); |
| 1349 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats','recur_interval',array( |
|
| 1349 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats', 'recur_interval', array( |
|
| 1350 | 1350 | 'type' => 'int', |
| 1351 | 1351 | 'precision' => '2', |
| 1352 | 1352 | 'default' => '1' |
| 1353 | 1353 | )); |
| 1354 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats','recur_data',array( |
|
| 1354 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats', 'recur_data', array( |
|
| 1355 | 1355 | 'type' => 'int', |
| 1356 | 1356 | 'precision' => '2', |
| 1357 | 1357 | 'default' => '1' |
@@ -1365,13 +1365,13 @@ discard block |
||
| 1365 | 1365 | |
| 1366 | 1366 | function calendar_upgrade1_0_1_004() |
| 1367 | 1367 | { |
| 1368 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_id',array( |
|
| 1368 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_id', array( |
|
| 1369 | 1369 | 'type' => 'int', |
| 1370 | 1370 | 'precision' => '4', |
| 1371 | 1371 | 'nullable' => False, |
| 1372 | 1372 | 'default' => '0' |
| 1373 | 1373 | )); |
| 1374 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_user_id',array( |
|
| 1374 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_user_id', array( |
|
| 1375 | 1375 | 'type' => 'int', |
| 1376 | 1376 | 'precision' => '4', |
| 1377 | 1377 | 'nullable' => False, |
@@ -1386,7 +1386,7 @@ discard block |
||
| 1386 | 1386 | |
| 1387 | 1387 | function calendar_upgrade1_0_1_005() |
| 1388 | 1388 | { |
| 1389 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user','cal_quantity',array( |
|
| 1389 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user', 'cal_quantity', array( |
|
| 1390 | 1390 | 'type' => 'int', |
| 1391 | 1391 | 'precision' => '4', |
| 1392 | 1392 | 'default' => '1' |
@@ -1400,7 +1400,7 @@ discard block |
||
| 1400 | 1400 | |
| 1401 | 1401 | function calendar_upgrade1_0_1_006() |
| 1402 | 1402 | { |
| 1403 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_non_blocking',array( |
|
| 1403 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_non_blocking', array( |
|
| 1404 | 1404 | 'type' => 'int', |
| 1405 | 1405 | 'precision' => '2', |
| 1406 | 1406 | 'default' => '0' |
@@ -1414,9 +1414,9 @@ discard block |
||
| 1414 | 1414 | |
| 1415 | 1415 | function calendar_upgrade1_0_1_007() |
| 1416 | 1416 | { |
| 1417 | - $GLOBALS['egw_setup']->db->update('egw_cal_repeats',array('recur_exception' => null),array('recur_exception' => ''),__LINE__,__FILE__,'calendar'); |
|
| 1417 | + $GLOBALS['egw_setup']->db->update('egw_cal_repeats', array('recur_exception' => null), array('recur_exception' => ''), __LINE__, __FILE__, 'calendar'); |
|
| 1418 | 1418 | |
| 1419 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats','recur_exception',array( |
|
| 1419 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_repeats', 'recur_exception', array( |
|
| 1420 | 1420 | 'type' => 'text' |
| 1421 | 1421 | )); |
| 1422 | 1422 | |
@@ -1433,11 +1433,11 @@ discard block |
||
| 1433 | 1433 | { |
| 1434 | 1434 | $customfields = array(); |
| 1435 | 1435 | $order = 0; |
| 1436 | - foreach($config_data['fields'] as $name => $data) |
|
| 1436 | + foreach ($config_data['fields'] as $name => $data) |
|
| 1437 | 1437 | { |
| 1438 | 1438 | if ($name{0} == '#' && !$data['disabled']) // real not-disabled custom field |
| 1439 | 1439 | { |
| 1440 | - $customfields[substr($name,1)] = array( |
|
| 1440 | + $customfields[substr($name, 1)] = array( |
|
| 1441 | 1441 | 'type' => 'text', |
| 1442 | 1442 | 'len' => $data['length'].($data['shown'] ? ','.$data['shown'] : ''), |
| 1443 | 1443 | 'label' => $data['name'], |
@@ -1460,38 +1460,38 @@ discard block |
||
| 1460 | 1460 | function calendar_upgrade1_0_1_009() |
| 1461 | 1461 | { |
| 1462 | 1462 | $db2 = clone($GLOBALS['egw_setup']->db); |
| 1463 | - $GLOBALS['egw_setup']->db->select('egw_cal','DISTINCT egw_cal.cal_id,cal_groups,cal_recur_date',"cal_groups != ''",__LINE__,__FILE__, |
|
| 1464 | - False,'','calendar',0,',egw_cal_user WHERE egw_cal.cal_id=egw_cal_user.cal_id'); |
|
| 1465 | - while(($row = $GLOBALS['egw_setup']->db->row(true))) |
|
| 1463 | + $GLOBALS['egw_setup']->db->select('egw_cal', 'DISTINCT egw_cal.cal_id,cal_groups,cal_recur_date', "cal_groups != ''", __LINE__, __FILE__, |
|
| 1464 | + False, '', 'calendar', 0, ',egw_cal_user WHERE egw_cal.cal_id=egw_cal_user.cal_id'); |
|
| 1465 | + while (($row = $GLOBALS['egw_setup']->db->row(true))) |
|
| 1466 | 1466 | { |
| 1467 | 1467 | $row['cal_user_type'] = 'u'; |
| 1468 | - foreach(explode(',',$row['cal_groups']) as $group) |
|
| 1468 | + foreach (explode(',', $row['cal_groups']) as $group) |
|
| 1469 | 1469 | { |
| 1470 | 1470 | $row['cal_user_id'] = $group; |
| 1471 | - $db2->insert('egw_cal_user',array('cal_status' => 'U'),$row,__LINE__,__FILE__,'calendar'); |
|
| 1471 | + $db2->insert('egw_cal_user', array('cal_status' => 'U'), $row, __LINE__, __FILE__, 'calendar'); |
|
| 1472 | 1472 | } |
| 1473 | 1473 | } |
| 1474 | - $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal',array( |
|
| 1474 | + $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal', array( |
|
| 1475 | 1475 | 'fd' => array( |
| 1476 | - 'cal_id' => array('type' => 'auto','nullable' => False), |
|
| 1477 | - 'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False), |
|
| 1478 | - 'cal_owner' => array('type' => 'int','precision' => '4','nullable' => False), |
|
| 1479 | - 'cal_category' => array('type' => 'varchar','precision' => '30'), |
|
| 1480 | - 'cal_modified' => array('type' => 'int','precision' => '8'), |
|
| 1481 | - 'cal_priority' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '2'), |
|
| 1482 | - 'cal_public' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '1'), |
|
| 1483 | - 'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'), |
|
| 1476 | + 'cal_id' => array('type' => 'auto', 'nullable' => False), |
|
| 1477 | + 'cal_uid' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False), |
|
| 1478 | + 'cal_owner' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
| 1479 | + 'cal_category' => array('type' => 'varchar', 'precision' => '30'), |
|
| 1480 | + 'cal_modified' => array('type' => 'int', 'precision' => '8'), |
|
| 1481 | + 'cal_priority' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '2'), |
|
| 1482 | + 'cal_public' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '1'), |
|
| 1483 | + 'cal_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '1'), |
|
| 1484 | 1484 | 'cal_description' => array('type' => 'text'), |
| 1485 | - 'cal_location' => array('type' => 'varchar','precision' => '255'), |
|
| 1486 | - 'cal_reference' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), |
|
| 1487 | - 'cal_modifier' => array('type' => 'int','precision' => '4'), |
|
| 1488 | - 'cal_non_blocking' => array('type' => 'int','precision' => '2','default' => '0') |
|
| 1485 | + 'cal_location' => array('type' => 'varchar', 'precision' => '255'), |
|
| 1486 | + 'cal_reference' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'default' => '0'), |
|
| 1487 | + 'cal_modifier' => array('type' => 'int', 'precision' => '4'), |
|
| 1488 | + 'cal_non_blocking' => array('type' => 'int', 'precision' => '2', 'default' => '0') |
|
| 1489 | 1489 | ), |
| 1490 | 1490 | 'pk' => array('cal_id'), |
| 1491 | 1491 | 'fk' => array(), |
| 1492 | 1492 | 'ix' => array(), |
| 1493 | 1493 | 'uc' => array() |
| 1494 | - ),'cal_groups'); |
|
| 1494 | + ), 'cal_groups'); |
|
| 1495 | 1495 | |
| 1496 | 1496 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.2'; |
| 1497 | 1497 | } |
@@ -1501,7 +1501,7 @@ discard block |
||
| 1501 | 1501 | function calendar_upgrade1_2() |
| 1502 | 1502 | { |
| 1503 | 1503 | // get old alarms (saved before 1.2) working again |
| 1504 | - $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 | + $GLOBALS['egw_setup']->db->query("UPDATE egw_async SET async_method ='calendar.bocalupdate.send_alarm' WHERE async_method ='calendar.bocalendar.send_alarm'", __LINE__, __FILE__); |
|
| 1505 | 1505 | |
| 1506 | 1506 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.2.001'; |
| 1507 | 1507 | } |
@@ -1509,7 +1509,7 @@ discard block |
||
| 1509 | 1509 | |
| 1510 | 1510 | function calendar_upgrade1_2_001() |
| 1511 | 1511 | { |
| 1512 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_special',array( |
|
| 1512 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_special', array( |
|
| 1513 | 1513 | 'type' => 'int', |
| 1514 | 1514 | 'precision' => '2', |
| 1515 | 1515 | 'default' => '0' |
@@ -1527,7 +1527,7 @@ discard block |
||
| 1527 | 1527 | |
| 1528 | 1528 | function calendar_upgrade1_4() |
| 1529 | 1529 | { |
| 1530 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_etag',array( |
|
| 1530 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_etag', array( |
|
| 1531 | 1531 | 'type' => 'int', |
| 1532 | 1532 | 'precision' => '4', |
| 1533 | 1533 | 'default' => '0' |
@@ -1539,59 +1539,59 @@ discard block |
||
| 1539 | 1539 | |
| 1540 | 1540 | function calendar_upgrade1_5() |
| 1541 | 1541 | { |
| 1542 | - $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal',array( |
|
| 1542 | + $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal', array( |
|
| 1543 | 1543 | 'fd' => array( |
| 1544 | - 'cal_id' => array('type' => 'auto','nullable' => False), |
|
| 1545 | - 'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False), |
|
| 1546 | - 'cal_owner' => array('type' => 'int','precision' => '4','nullable' => False), |
|
| 1547 | - 'cal_category' => array('type' => 'varchar','precision' => '30'), |
|
| 1548 | - 'cal_modified' => array('type' => 'int','precision' => '8'), |
|
| 1549 | - 'cal_priority' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '2'), |
|
| 1550 | - 'cal_public' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '1'), |
|
| 1551 | - 'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'), |
|
| 1544 | + 'cal_id' => array('type' => 'auto', 'nullable' => False), |
|
| 1545 | + 'cal_uid' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False), |
|
| 1546 | + 'cal_owner' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
| 1547 | + 'cal_category' => array('type' => 'varchar', 'precision' => '30'), |
|
| 1548 | + 'cal_modified' => array('type' => 'int', 'precision' => '8'), |
|
| 1549 | + 'cal_priority' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '2'), |
|
| 1550 | + 'cal_public' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '1'), |
|
| 1551 | + 'cal_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '1'), |
|
| 1552 | 1552 | 'cal_description' => array('type' => 'text'), |
| 1553 | - 'cal_location' => array('type' => 'varchar','precision' => '255'), |
|
| 1554 | - 'cal_reference' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), |
|
| 1555 | - 'cal_modifier' => array('type' => 'int','precision' => '4'), |
|
| 1556 | - 'cal_non_blocking' => array('type' => 'int','precision' => '2','default' => '0'), |
|
| 1557 | - 'cal_special' => array('type' => 'int','precision' => '2','default' => '0'), |
|
| 1558 | - 'cal_etag' => array('type' => 'int','precision' => '4'), |
|
| 1559 | - 'cal_edit_time' => array('type' => 'int','precision' => '8') |
|
| 1553 | + 'cal_location' => array('type' => 'varchar', 'precision' => '255'), |
|
| 1554 | + 'cal_reference' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'default' => '0'), |
|
| 1555 | + 'cal_modifier' => array('type' => 'int', 'precision' => '4'), |
|
| 1556 | + 'cal_non_blocking' => array('type' => 'int', 'precision' => '2', 'default' => '0'), |
|
| 1557 | + 'cal_special' => array('type' => 'int', 'precision' => '2', 'default' => '0'), |
|
| 1558 | + 'cal_etag' => array('type' => 'int', 'precision' => '4'), |
|
| 1559 | + 'cal_edit_time' => array('type' => 'int', 'precision' => '8') |
|
| 1560 | 1560 | ), |
| 1561 | 1561 | 'pk' => array('cal_id'), |
| 1562 | 1562 | 'fk' => array(), |
| 1563 | 1563 | 'ix' => array(), |
| 1564 | 1564 | 'uc' => array() |
| 1565 | - ),'cal_edit_user'); |
|
| 1566 | - $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal',array( |
|
| 1565 | + ), 'cal_edit_user'); |
|
| 1566 | + $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal', array( |
|
| 1567 | 1567 | 'fd' => array( |
| 1568 | - 'cal_id' => array('type' => 'auto','nullable' => False), |
|
| 1569 | - 'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False), |
|
| 1570 | - 'cal_owner' => array('type' => 'int','precision' => '4','nullable' => False), |
|
| 1571 | - 'cal_category' => array('type' => 'varchar','precision' => '30'), |
|
| 1572 | - 'cal_modified' => array('type' => 'int','precision' => '8'), |
|
| 1573 | - 'cal_priority' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '2'), |
|
| 1574 | - 'cal_public' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '1'), |
|
| 1575 | - 'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'), |
|
| 1568 | + 'cal_id' => array('type' => 'auto', 'nullable' => False), |
|
| 1569 | + 'cal_uid' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False), |
|
| 1570 | + 'cal_owner' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
| 1571 | + 'cal_category' => array('type' => 'varchar', 'precision' => '30'), |
|
| 1572 | + 'cal_modified' => array('type' => 'int', 'precision' => '8'), |
|
| 1573 | + 'cal_priority' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '2'), |
|
| 1574 | + 'cal_public' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '1'), |
|
| 1575 | + 'cal_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '1'), |
|
| 1576 | 1576 | 'cal_description' => array('type' => 'text'), |
| 1577 | - 'cal_location' => array('type' => 'varchar','precision' => '255'), |
|
| 1578 | - 'cal_reference' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), |
|
| 1579 | - 'cal_modifier' => array('type' => 'int','precision' => '4'), |
|
| 1580 | - 'cal_non_blocking' => array('type' => 'int','precision' => '2','default' => '0'), |
|
| 1581 | - 'cal_special' => array('type' => 'int','precision' => '2','default' => '0'), |
|
| 1582 | - 'cal_etag' => array('type' => 'int','precision' => '4') |
|
| 1577 | + 'cal_location' => array('type' => 'varchar', 'precision' => '255'), |
|
| 1578 | + 'cal_reference' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'default' => '0'), |
|
| 1579 | + 'cal_modifier' => array('type' => 'int', 'precision' => '4'), |
|
| 1580 | + 'cal_non_blocking' => array('type' => 'int', 'precision' => '2', 'default' => '0'), |
|
| 1581 | + 'cal_special' => array('type' => 'int', 'precision' => '2', 'default' => '0'), |
|
| 1582 | + 'cal_etag' => array('type' => 'int', 'precision' => '4') |
|
| 1583 | 1583 | ), |
| 1584 | 1584 | 'pk' => array('cal_id'), |
| 1585 | 1585 | 'fk' => array(), |
| 1586 | 1586 | 'ix' => array(), |
| 1587 | 1587 | 'uc' => array() |
| 1588 | - ),'cal_edit_time'); |
|
| 1589 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_etag',array( |
|
| 1588 | + ), 'cal_edit_time'); |
|
| 1589 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_etag', array( |
|
| 1590 | 1590 | 'type' => 'int', |
| 1591 | 1591 | 'precision' => '4', |
| 1592 | 1592 | 'default' => '0' |
| 1593 | 1593 | )); |
| 1594 | - $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_etag=0 WHERE cal_etag IS NULL',__LINE__,__FILE__); |
|
| 1594 | + $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_etag=0 WHERE cal_etag IS NULL', __LINE__, __FILE__); |
|
| 1595 | 1595 | |
| 1596 | 1596 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.5.001'; |
| 1597 | 1597 | } |
@@ -1599,12 +1599,12 @@ discard block |
||
| 1599 | 1599 | |
| 1600 | 1600 | function calendar_upgrade1_5_001() |
| 1601 | 1601 | { |
| 1602 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_id',array( |
|
| 1602 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_id', array( |
|
| 1603 | 1603 | 'type' => 'int', |
| 1604 | 1604 | 'precision' => '4', |
| 1605 | 1605 | 'nullable' => False |
| 1606 | 1606 | )); |
| 1607 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_user_id',array( |
|
| 1607 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_user_id', array( |
|
| 1608 | 1608 | 'type' => 'varchar', |
| 1609 | 1609 | 'precision' => '128', |
| 1610 | 1610 | 'nullable' => False |
@@ -1618,12 +1618,12 @@ discard block |
||
| 1618 | 1618 | { |
| 1619 | 1619 | // update the alarm methods |
| 1620 | 1620 | $async = new Api\Asyncservice(); |
| 1621 | - foreach((array)$async->read('cal:%') as $job) |
|
| 1621 | + foreach ((array)$async->read('cal:%') as $job) |
|
| 1622 | 1622 | { |
| 1623 | 1623 | if ($job['method'] == 'calendar.bocalupdate.send_alarm') |
| 1624 | 1624 | { |
| 1625 | 1625 | $job['method'] = 'calendar.calendar_boupdate.send_alarm'; |
| 1626 | - $async->write($job,true); |
|
| 1626 | + $async->write($job, true); |
|
| 1627 | 1627 | } |
| 1628 | 1628 | } |
| 1629 | 1629 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.6'; |
@@ -1640,48 +1640,48 @@ discard block |
||
| 1640 | 1640 | { |
| 1641 | 1641 | // Set UID of series exception to UID of series master |
| 1642 | 1642 | // update cal_etag, cal_modified and cal_modifier to distribute changes on GroupDAV devices |
| 1643 | - foreach($GLOBALS['egw_setup']->db->query(' |
|
| 1643 | + foreach ($GLOBALS['egw_setup']->db->query(' |
|
| 1644 | 1644 | SELECT cal_ex.cal_id,cal_ex.cal_uid AS cal_uid_ex,cal_master.cal_uid AS cal_uid_master |
| 1645 | 1645 | FROM egw_cal cal_ex |
| 1646 | 1646 | JOIN egw_cal cal_master ON cal_ex.cal_reference=cal_master.cal_id |
| 1647 | - WHERE cal_ex.cal_reference != 0',__LINE__,__FILE__) as $row) |
|
| 1647 | + WHERE cal_ex.cal_reference != 0',__LINE__, __FILE__) as $row) |
|
| 1648 | 1648 | { |
| 1649 | 1649 | if (strlen($row['cal_uid_master']) > 0 && $row['cal_uid_ex'] != $row['cal_uid_master']) |
| 1650 | 1650 | { |
| 1651 | 1651 | $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_uid=\''.$row['cal_uid_master']. |
| 1652 | 1652 | '\',cal_etag=cal_etag+1,cal_modified='.time(). |
| 1653 | - ',cal_modifier=NULL WHERE cal_id='.(int)$row['cal_id'],__LINE__,__FILE__); |
|
| 1653 | + ',cal_modifier=NULL WHERE cal_id='.(int)$row['cal_id'], __LINE__, __FILE__); |
|
| 1654 | 1654 | } |
| 1655 | 1655 | } |
| 1656 | 1656 | |
| 1657 | 1657 | // Search series exception for nearest exception in series master and add that RECURRENCE-ID |
| 1658 | 1658 | // as cal_reference (for 1.6.003 and move it to new field cal_recurrence in 1.7.001) |
| 1659 | 1659 | $diff = null; |
| 1660 | - foreach($GLOBALS['egw_setup']->db->query('SELECT egw_cal.cal_id,cal_start,recur_exception FROM egw_cal |
|
| 1660 | + foreach ($GLOBALS['egw_setup']->db->query('SELECT egw_cal.cal_id,cal_start,recur_exception FROM egw_cal |
|
| 1661 | 1661 | JOIN egw_cal_dates ON egw_cal.cal_id=egw_cal_dates.cal_id |
| 1662 | 1662 | JOIN egw_cal_repeats ON cal_reference=egw_cal_repeats.cal_id |
| 1663 | - WHERE cal_reference != 0',__LINE__,__FILE__) as $row) |
|
| 1663 | + WHERE cal_reference != 0',__LINE__, __FILE__) as $row) |
|
| 1664 | 1664 | { |
| 1665 | 1665 | $recurrence = null; |
| 1666 | - foreach(explode(',',$row['recur_exception']) as $ts) |
|
| 1666 | + foreach (explode(',', $row['recur_exception']) as $ts) |
|
| 1667 | 1667 | { |
| 1668 | - if (is_null($recurrence) || abs($ts-$row['cal_start']) < $diff) |
|
| 1668 | + if (is_null($recurrence) || abs($ts - $row['cal_start']) < $diff) |
|
| 1669 | 1669 | { |
| 1670 | 1670 | $recurrence = $ts; |
| 1671 | - $diff = abs($ts-$row['cal_start']); |
|
| 1671 | + $diff = abs($ts - $row['cal_start']); |
|
| 1672 | 1672 | } |
| 1673 | 1673 | } |
| 1674 | 1674 | if ($recurrence) |
| 1675 | 1675 | { |
| 1676 | 1676 | $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_reference='.(int)$recurrence. |
| 1677 | - ' WHERE cal_id='.(int)$row['cal_id'],__LINE__,__FILE__); |
|
| 1677 | + ' WHERE cal_id='.(int)$row['cal_id'], __LINE__, __FILE__); |
|
| 1678 | 1678 | } |
| 1679 | 1679 | else |
| 1680 | 1680 | { |
| 1681 | 1681 | // if we cannot determine the RECURRENCE-ID use cal_start |
| 1682 | 1682 | // because RECURRENCE-ID must be present |
| 1683 | 1683 | $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_reference='.(int)$row['cal_start']. |
| 1684 | - ' WHERE cal_id='.(int)$row['cal_id'],__LINE__,__FILE__); |
|
| 1684 | + ' WHERE cal_id='.(int)$row['cal_id'], __LINE__, __FILE__); |
|
| 1685 | 1685 | } |
| 1686 | 1686 | } |
| 1687 | 1687 | |
@@ -1696,33 +1696,33 @@ discard block |
||
| 1696 | 1696 | */ |
| 1697 | 1697 | function calendar_upgrade1_6_003() |
| 1698 | 1698 | { |
| 1699 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_creator',array( |
|
| 1699 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_creator', array( |
|
| 1700 | 1700 | 'type' => 'int', |
| 1701 | 1701 | 'precision' => '4', |
| 1702 | 1702 | 'comment' => 'creating user' |
| 1703 | 1703 | )); |
| 1704 | - $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_creator=cal_owner',__LINE__,__FILE__); |
|
| 1705 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_creator',array( |
|
| 1704 | + $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_creator=cal_owner', __LINE__, __FILE__); |
|
| 1705 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_creator', array( |
|
| 1706 | 1706 | 'type' => 'int', |
| 1707 | 1707 | 'precision' => '4', |
| 1708 | 1708 | 'nullable' => False, |
| 1709 | 1709 | 'comment' => 'creating user' |
| 1710 | 1710 | )); |
| 1711 | 1711 | |
| 1712 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_created',array( |
|
| 1712 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_created', array( |
|
| 1713 | 1713 | 'type' => 'int', |
| 1714 | 1714 | 'precision' => '8', |
| 1715 | 1715 | 'comment' => 'creation time of event' |
| 1716 | 1716 | )); |
| 1717 | - $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_created=cal_modified',__LINE__,__FILE__); |
|
| 1718 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_created',array( |
|
| 1717 | + $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_created=cal_modified', __LINE__, __FILE__); |
|
| 1718 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_created', array( |
|
| 1719 | 1719 | 'type' => 'int', |
| 1720 | 1720 | 'precision' => '8', |
| 1721 | 1721 | 'nullable' => False, |
| 1722 | 1722 | 'comment' => 'creation time of event' |
| 1723 | 1723 | )); |
| 1724 | 1724 | |
| 1725 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_recurrence',array( |
|
| 1725 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_recurrence', array( |
|
| 1726 | 1726 | 'type' => 'int', |
| 1727 | 1727 | 'precision' => '8', |
| 1728 | 1728 | 'nullable' => False, |
@@ -1733,14 +1733,14 @@ discard block |
||
| 1733 | 1733 | // move RECURRENCE-ID from temporarily (1.6.003) |
| 1734 | 1734 | // used field cal_reference to new field cal_recurrence |
| 1735 | 1735 | // and restore cal_reference field of series exceptions with id of the series master |
| 1736 | - foreach($GLOBALS['egw_setup']->db->query(' |
|
| 1736 | + foreach ($GLOBALS['egw_setup']->db->query(' |
|
| 1737 | 1737 | SELECT cal_ex.cal_id AS cal_id_ex,cal_master.cal_id AS cal_id_master, |
| 1738 | 1738 | cal_ex.cal_reference AS cal_reference_ex,cal_ex.cal_uid AS cal_uid_ex, |
| 1739 | 1739 | cal_master.cal_uid AS cal_uid_master |
| 1740 | 1740 | FROM egw_cal cal_ex |
| 1741 | 1741 | JOIN egw_cal cal_master |
| 1742 | 1742 | ON cal_ex.cal_uid=cal_master.cal_uid AND cal_master.cal_reference = 0 AND cal_ex.cal_owner = cal_master.cal_owner |
| 1743 | - WHERE cal_ex.cal_reference !=0 AND cal_master.cal_id IS NOT NULL',__LINE__,__FILE__) as $row) |
|
| 1743 | + WHERE cal_ex.cal_reference !=0 AND cal_master.cal_id IS NOT NULL',__LINE__, __FILE__) as $row) |
|
| 1744 | 1744 | { |
| 1745 | 1745 | $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_recurrence='.(int)$row['cal_reference_ex']. |
| 1746 | 1746 | ', cal_reference='.(int)$row['cal_id_master']. |
@@ -1757,7 +1757,7 @@ discard block |
||
| 1757 | 1757 | */ |
| 1758 | 1758 | function calendar_upgrade1_7_001() |
| 1759 | 1759 | { |
| 1760 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user','cal_role',array( |
|
| 1760 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user', 'cal_role', array( |
|
| 1761 | 1761 | 'type' => 'varchar', |
| 1762 | 1762 | 'precision' => '64', |
| 1763 | 1763 | 'default' => 'REQ-PARTICIPANT' |
@@ -1773,14 +1773,14 @@ discard block |
||
| 1773 | 1773 | */ |
| 1774 | 1774 | function calendar_upgrade1_7_002() |
| 1775 | 1775 | { |
| 1776 | - $GLOBALS['egw_setup']->oProc->CreateTable('egw_cal_timezones',array( |
|
| 1776 | + $GLOBALS['egw_setup']->oProc->CreateTable('egw_cal_timezones', array( |
|
| 1777 | 1777 | 'fd' => array( |
| 1778 | - 'tz_id' => array('type' => 'auto','nullable' => False), |
|
| 1779 | - 'tz_tzid' => array('type' => 'varchar','precision' => '128','nullable' => False), |
|
| 1780 | - 'tz_alias' => array('type' => 'int','precision' => '4','comment' => 'tz_id for data'), |
|
| 1781 | - 'tz_latitude' => array('type' => 'int','precision' => '4'), |
|
| 1782 | - 'tz_longitude' => array('type' => 'int','precision' => '4'), |
|
| 1783 | - 'tz_component' => array('type' => 'text','comment' => 'iCal VTIMEZONE component') |
|
| 1778 | + 'tz_id' => array('type' => 'auto', 'nullable' => False), |
|
| 1779 | + 'tz_tzid' => array('type' => 'varchar', 'precision' => '128', 'nullable' => False), |
|
| 1780 | + 'tz_alias' => array('type' => 'int', 'precision' => '4', 'comment' => 'tz_id for data'), |
|
| 1781 | + 'tz_latitude' => array('type' => 'int', 'precision' => '4'), |
|
| 1782 | + 'tz_longitude' => array('type' => 'int', 'precision' => '4'), |
|
| 1783 | + 'tz_component' => array('type' => 'text', 'comment' => 'iCal VTIMEZONE component') |
|
| 1784 | 1784 | ), |
| 1785 | 1785 | 'pk' => array('tz_id'), |
| 1786 | 1786 | 'fk' => array(), |
@@ -1800,38 +1800,38 @@ discard block |
||
| 1800 | 1800 | */ |
| 1801 | 1801 | function calendar_upgrade1_7_003() |
| 1802 | 1802 | { |
| 1803 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_user_type',array( |
|
| 1803 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_user_type', array( |
|
| 1804 | 1804 | 'type' => 'varchar', |
| 1805 | 1805 | 'precision' => '1', |
| 1806 | 1806 | 'nullable' => False, |
| 1807 | 1807 | 'default' => 'u', |
| 1808 | 1808 | 'comment' => 'u=user, g=group, c=contact, r=resource, e=email' |
| 1809 | 1809 | )); |
| 1810 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_user_id',array( |
|
| 1810 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_user_id', array( |
|
| 1811 | 1811 | 'type' => 'varchar', |
| 1812 | 1812 | 'precision' => '128', |
| 1813 | 1813 | 'nullable' => False, |
| 1814 | 1814 | 'comment' => 'id or email-address for type=e' |
| 1815 | 1815 | )); |
| 1816 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_status',array( |
|
| 1816 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_status', array( |
|
| 1817 | 1817 | 'type' => 'char', |
| 1818 | 1818 | 'precision' => '1', |
| 1819 | 1819 | 'default' => 'A', |
| 1820 | 1820 | 'comment' => 'U=unknown, A=accepted, R=rejected, T=tentative' |
| 1821 | 1821 | )); |
| 1822 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_quantity',array( |
|
| 1822 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_quantity', array( |
|
| 1823 | 1823 | 'type' => 'int', |
| 1824 | 1824 | 'precision' => '4', |
| 1825 | 1825 | 'default' => '1', |
| 1826 | 1826 | 'comment' => 'only for certain types (eg. resources)' |
| 1827 | 1827 | )); |
| 1828 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_role',array( |
|
| 1828 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_role', array( |
|
| 1829 | 1829 | 'type' => 'varchar', |
| 1830 | 1830 | 'precision' => '64', |
| 1831 | 1831 | 'default' => 'REQ-PARTICIPANT', |
| 1832 | 1832 | 'comment' => 'CHAIR, REQ-PARTICIPANT, OPT-PARTICIPANT, NON-PARTICIPANT, X-CAT-$cat_id' |
| 1833 | 1833 | )); |
| 1834 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user','cal_user_modified',array( |
|
| 1834 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user', 'cal_user_modified', array( |
|
| 1835 | 1835 | 'type' => 'timestamp', |
| 1836 | 1836 | 'default' => 'current_timestamp', |
| 1837 | 1837 | 'comment' => 'automatic timestamp of last update' |
@@ -1847,19 +1847,19 @@ discard block |
||
| 1847 | 1847 | */ |
| 1848 | 1848 | function calendar_upgrade1_7_004() |
| 1849 | 1849 | { |
| 1850 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_dates','cal_start',array( |
|
| 1850 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_dates', 'cal_start', array( |
|
| 1851 | 1851 | 'type' => 'int', |
| 1852 | 1852 | 'precision' => '8', |
| 1853 | 1853 | 'nullable' => False, |
| 1854 | 1854 | 'comment' => 'starttime in server time' |
| 1855 | 1855 | )); |
| 1856 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_dates','cal_end',array( |
|
| 1856 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_dates', 'cal_end', array( |
|
| 1857 | 1857 | 'type' => 'int', |
| 1858 | 1858 | 'precision' => '8', |
| 1859 | 1859 | 'nullable' => False, |
| 1860 | 1860 | 'comment' => 'endtime in server time' |
| 1861 | 1861 | )); |
| 1862 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','tz_id',array( |
|
| 1862 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'tz_id', array( |
|
| 1863 | 1863 | 'type' => 'int', |
| 1864 | 1864 | 'precision' => '4', |
| 1865 | 1865 | 'comment' => 'key into egw_cal_timezones' |
@@ -1868,7 +1868,7 @@ discard block |
||
| 1868 | 1868 | // set id of server timezone for existing events, as that's the timezone their recurrences are using |
| 1869 | 1869 | if (($tzid = date_default_timezone_get()) && ($tz_id = calendar_timezones::tz2id($tzid))) |
| 1870 | 1870 | { |
| 1871 | - $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET tz_id='.(int)$tz_id,__LINE__,__FILE__); |
|
| 1871 | + $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET tz_id='.(int)$tz_id, __LINE__, __FILE__); |
|
| 1872 | 1872 | } |
| 1873 | 1873 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.7.005'; |
| 1874 | 1874 | } |
@@ -1895,22 +1895,22 @@ discard block |
||
| 1895 | 1895 | */ |
| 1896 | 1896 | function calendar_upgrade1_7_006() |
| 1897 | 1897 | { |
| 1898 | - foreach($GLOBALS['egw_setup']->db->query('SELECT * FROM egw_cal_dates |
|
| 1899 | - WHERE (cal_end-cal_start)%86400=86340',__LINE__,__FILE__) as $row) |
|
| 1898 | + foreach ($GLOBALS['egw_setup']->db->query('SELECT * FROM egw_cal_dates |
|
| 1899 | + WHERE (cal_end-cal_start)%86400=86340',__LINE__, __FILE__) as $row) |
|
| 1900 | 1900 | { |
| 1901 | 1901 | $GLOBALS['egw_setup']->db->query('UPDATE egw_cal_dates SET cal_end=cal_end+59 |
| 1902 | - WHERE cal_id='.(int)$row['cal_id'].' AND cal_start='.(int)$row['cal_start'],__LINE__,__FILE__); |
|
| 1902 | + WHERE cal_id='.(int)$row['cal_id'].' AND cal_start='.(int)$row['cal_start'], __LINE__, __FILE__); |
|
| 1903 | 1903 | } |
| 1904 | 1904 | |
| 1905 | - foreach($GLOBALS['egw_setup']->db->query('SELECT * FROM egw_cal_dates |
|
| 1906 | - WHERE cal_end-cal_start>0 AND (cal_end-cal_start)%86400=0',__LINE__,__FILE__) as $row) |
|
| 1905 | + foreach ($GLOBALS['egw_setup']->db->query('SELECT * FROM egw_cal_dates |
|
| 1906 | + WHERE cal_end-cal_start>0 AND (cal_end-cal_start)%86400=0',__LINE__, __FILE__) as $row) |
|
| 1907 | 1907 | { |
| 1908 | 1908 | $GLOBALS['egw_setup']->db->query('UPDATE egw_cal_dates SET cal_end=cal_end-1 |
| 1909 | - WHERE cal_id='.(int)$row['cal_id'].' AND cal_start='.(int)$row['cal_start'],__LINE__,__FILE__); |
|
| 1909 | + WHERE cal_id='.(int)$row['cal_id'].' AND cal_start='.(int)$row['cal_start'], __LINE__, __FILE__); |
|
| 1910 | 1910 | } |
| 1911 | 1911 | |
| 1912 | 1912 | $GLOBALS['egw_setup']->db->query('UPDATE egw_cal_repeats SET recur_interval=1 |
| 1913 | - WHERE recur_interval=0',__LINE__,__FILE__); |
|
| 1913 | + WHERE recur_interval=0',__LINE__, __FILE__); |
|
| 1914 | 1914 | |
| 1915 | 1915 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.7.007'; |
| 1916 | 1916 | } |
@@ -1926,17 +1926,17 @@ discard block |
||
| 1926 | 1926 | { |
| 1927 | 1927 | // Set UID of series exception to UID of series master |
| 1928 | 1928 | // update cal_etag,cal_modified and cal_modifier to distribute changes on GroupDAV devices |
| 1929 | - foreach($GLOBALS['egw_setup']->db->query(' |
|
| 1929 | + foreach ($GLOBALS['egw_setup']->db->query(' |
|
| 1930 | 1930 | SELECT cal_ex.cal_id,cal_ex.cal_uid AS cal_uid_ex,cal_master.cal_uid AS cal_uid_master |
| 1931 | 1931 | FROM egw_cal cal_ex |
| 1932 | 1932 | JOIN egw_cal cal_master ON cal_ex.cal_reference=cal_master.cal_id |
| 1933 | - WHERE cal_ex.cal_reference != 0',__LINE__,__FILE__) as $row) |
|
| 1933 | + WHERE cal_ex.cal_reference != 0',__LINE__, __FILE__) as $row) |
|
| 1934 | 1934 | { |
| 1935 | 1935 | if (strlen($row['cal_uid_master']) > 0 && $row['cal_uid_ex'] != $row['cal_uid_master']) |
| 1936 | 1936 | { |
| 1937 | 1937 | $GLOBALS['egw_setup']->db->query('UPDATE egw_cal SET cal_uid=\''.$row['cal_uid_master']. |
| 1938 | 1938 | '\',cal_etag=cal_etag+1,cal_modified='.time(). |
| 1939 | - ',cal_modifier=NULL WHERE cal_id='.(int)$row['cal_id'],__LINE__,__FILE__); |
|
| 1939 | + ',cal_modifier=NULL WHERE cal_id='.(int)$row['cal_id'], __LINE__, __FILE__); |
|
| 1940 | 1940 | } |
| 1941 | 1941 | } |
| 1942 | 1942 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.7.008'; |
@@ -1949,7 +1949,7 @@ discard block |
||
| 1949 | 1949 | */ |
| 1950 | 1950 | function calendar_upgrade1_7_008() |
| 1951 | 1951 | { |
| 1952 | - $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal_user',array('cal_user_type','cal_user_id')); |
|
| 1952 | + $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal_user', array('cal_user_type', 'cal_user_id')); |
|
| 1953 | 1953 | |
| 1954 | 1954 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.7.009'; |
| 1955 | 1955 | } |
@@ -1961,22 +1961,22 @@ discard block |
||
| 1961 | 1961 | */ |
| 1962 | 1962 | function calendar_upgrade1_7_009() |
| 1963 | 1963 | { |
| 1964 | - $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal','cal_uid'); |
|
| 1965 | - $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal','cal_owner'); |
|
| 1964 | + $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal', 'cal_uid'); |
|
| 1965 | + $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal', 'cal_owner'); |
|
| 1966 | 1966 | |
| 1967 | 1967 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.7.010'; |
| 1968 | 1968 | } |
| 1969 | 1969 | |
| 1970 | 1970 | function calendar_upgrade1_7_010() |
| 1971 | 1971 | { |
| 1972 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','cal_deleted',array( |
|
| 1972 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'cal_deleted', array( |
|
| 1973 | 1973 | 'type' => 'bool', |
| 1974 | 1974 | 'nullable' => False, |
| 1975 | 1975 | 'default' => '0', |
| 1976 | 1976 | 'comment' => '1 if the event has been deleted, but you want to keep it around' |
| 1977 | 1977 | )); |
| 1978 | 1978 | |
| 1979 | - return $GLOBALS['setup_info']['calendar']['currentver'] = '1.9.001'; // was 1.7.011 |
|
| 1979 | + return $GLOBALS['setup_info']['calendar']['currentver'] = '1.9.001'; // was 1.7.011 |
|
| 1980 | 1980 | } |
| 1981 | 1981 | |
| 1982 | 1982 | function calendar_upgrade1_7_011() |
@@ -2001,7 +2001,7 @@ discard block |
||
| 2001 | 2001 | function calendar_upgrade1_9_001() |
| 2002 | 2002 | { |
| 2003 | 2003 | // delete in the past wrongly created entries for a single recurrence, which mess up the update, beside being wrong anyway |
| 2004 | - $GLOBALS['egw_setup']->db->delete('egw_api_content_history',array( |
|
| 2004 | + $GLOBALS['egw_setup']->db->delete('egw_api_content_history', array( |
|
| 2005 | 2005 | 'sync_appname' => 'calendar', |
| 2006 | 2006 | "sync_contentid LIKE '%:%'", |
| 2007 | 2007 | ), __LINE__, __FILE__); |
@@ -2012,36 +2012,36 @@ discard block |
||
| 2012 | 2012 | 'precision' => '8', |
| 2013 | 2013 | 'comment' => 'ts when event was deleted' |
| 2014 | 2014 | ));*/ |
| 2015 | - $GLOBALS['egw_setup']->oProc->RefreshTable('egw_cal',array( |
|
| 2015 | + $GLOBALS['egw_setup']->oProc->RefreshTable('egw_cal', array( |
|
| 2016 | 2016 | 'fd' => array( |
| 2017 | - 'cal_id' => array('type' => 'auto','nullable' => False), |
|
| 2018 | - 'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False,'comment' => 'unique id of event(-series)'), |
|
| 2019 | - 'cal_owner' => array('type' => 'int','precision' => '4','nullable' => False,'comment' => 'event owner / calendar'), |
|
| 2020 | - 'cal_category' => array('type' => 'varchar','precision' => '30','comment' => 'category id'), |
|
| 2021 | - 'cal_modified' => array('type' => 'int','precision' => '8','comment' => 'ts of last modification'), |
|
| 2022 | - 'cal_priority' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '2'), |
|
| 2023 | - 'cal_public' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '1','comment' => '1=public, 0=private event'), |
|
| 2024 | - 'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'), |
|
| 2017 | + 'cal_id' => array('type' => 'auto', 'nullable' => False), |
|
| 2018 | + 'cal_uid' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'comment' => 'unique id of event(-series)'), |
|
| 2019 | + 'cal_owner' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'comment' => 'event owner / calendar'), |
|
| 2020 | + 'cal_category' => array('type' => 'varchar', 'precision' => '30', 'comment' => 'category id'), |
|
| 2021 | + 'cal_modified' => array('type' => 'int', 'precision' => '8', 'comment' => 'ts of last modification'), |
|
| 2022 | + 'cal_priority' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '2'), |
|
| 2023 | + 'cal_public' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '1', 'comment' => '1=public, 0=private event'), |
|
| 2024 | + 'cal_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '1'), |
|
| 2025 | 2025 | 'cal_description' => array('type' => 'text'), |
| 2026 | - 'cal_location' => array('type' => 'varchar','precision' => '255'), |
|
| 2027 | - 'cal_reference' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0','comment' => 'cal_id of series for exception'), |
|
| 2028 | - 'cal_modifier' => array('type' => 'int','precision' => '4','comment' => 'user who last modified event'), |
|
| 2029 | - 'cal_non_blocking' => array('type' => 'int','precision' => '2','default' => '0','comment' => '1 for non-blocking events'), |
|
| 2030 | - 'cal_special' => array('type' => 'int','precision' => '2','default' => '0'), |
|
| 2031 | - 'cal_etag' => array('type' => 'int','precision' => '4','default' => '0','comment' => 'etag for optimistic locking'), |
|
| 2032 | - 'cal_creator' => array('type' => 'int','precision' => '4','nullable' => False,'comment' => 'creating user'), |
|
| 2033 | - 'cal_created' => array('type' => 'int','precision' => '8','nullable' => False,'comment' => 'creation time of event'), |
|
| 2034 | - 'cal_recurrence' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0','comment' => 'cal_start of original recurrence for exception'), |
|
| 2035 | - 'tz_id' => array('type' => 'int','precision' => '4','comment' => 'key into egw_cal_timezones'), |
|
| 2036 | - 'cal_deleted' => array('type' => 'int','precision' => '8','comment' => 'ts when event was deleted') |
|
| 2026 | + 'cal_location' => array('type' => 'varchar', 'precision' => '255'), |
|
| 2027 | + 'cal_reference' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'default' => '0', 'comment' => 'cal_id of series for exception'), |
|
| 2028 | + 'cal_modifier' => array('type' => 'int', 'precision' => '4', 'comment' => 'user who last modified event'), |
|
| 2029 | + 'cal_non_blocking' => array('type' => 'int', 'precision' => '2', 'default' => '0', 'comment' => '1 for non-blocking events'), |
|
| 2030 | + 'cal_special' => array('type' => 'int', 'precision' => '2', 'default' => '0'), |
|
| 2031 | + 'cal_etag' => array('type' => 'int', 'precision' => '4', 'default' => '0', 'comment' => 'etag for optimistic locking'), |
|
| 2032 | + 'cal_creator' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'comment' => 'creating user'), |
|
| 2033 | + 'cal_created' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'comment' => 'creation time of event'), |
|
| 2034 | + 'cal_recurrence' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0', 'comment' => 'cal_start of original recurrence for exception'), |
|
| 2035 | + 'tz_id' => array('type' => 'int', 'precision' => '4', 'comment' => 'key into egw_cal_timezones'), |
|
| 2036 | + 'cal_deleted' => array('type' => 'int', 'precision' => '8', 'comment' => 'ts when event was deleted') |
|
| 2037 | 2037 | ), |
| 2038 | 2038 | 'pk' => array('cal_id'), |
| 2039 | 2039 | 'fk' => array(), |
| 2040 | - 'ix' => array('cal_uid','cal_owner','cal_deleted'), |
|
| 2040 | + 'ix' => array('cal_uid', 'cal_owner', 'cal_deleted'), |
|
| 2041 | 2041 | 'uc' => array() |
| 2042 | - ),array( |
|
| 2042 | + ), array( |
|
| 2043 | 2043 | // for deleted rows use cal_modified as deleted date, NULL for not deleted ones |
| 2044 | - 'cal_deleted' => 'CASE cal_deleted WHEN '.$GLOBALS['egw_setup']->db->quote(true,'bool').' THEN cal_modified ELSE NULL END', |
|
| 2044 | + 'cal_deleted' => 'CASE cal_deleted WHEN '.$GLOBALS['egw_setup']->db->quote(true, 'bool').' THEN cal_modified ELSE NULL END', |
|
| 2045 | 2045 | )); |
| 2046 | 2046 | |
| 2047 | 2047 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.9.002'; |
@@ -2053,16 +2053,16 @@ discard block |
||
| 2053 | 2053 | */ |
| 2054 | 2054 | function calendar_upgrade1_9_002() |
| 2055 | 2055 | { |
| 2056 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','caldav_name',array( |
|
| 2056 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'caldav_name', array( |
|
| 2057 | 2057 | 'type' => 'varchar', |
| 2058 | 2058 | 'precision' => '64', |
| 2059 | 2059 | 'comment' => 'name part of CalDAV URL, if specified by client' |
| 2060 | 2060 | )); |
| 2061 | - $GLOBALS['egw_setup']->db->query($sql='UPDATE egw_cal SET caldav_name='. |
|
| 2061 | + $GLOBALS['egw_setup']->db->query($sql = 'UPDATE egw_cal SET caldav_name='. |
|
| 2062 | 2062 | $GLOBALS['egw_setup']->db->concat( |
| 2063 | - $GLOBALS['egw_setup']->db->to_varchar('cal_id'),"'.ics'"),__LINE__,__FILE__); |
|
| 2063 | + $GLOBALS['egw_setup']->db->to_varchar('cal_id'), "'.ics'"), __LINE__, __FILE__); |
|
| 2064 | 2064 | |
| 2065 | - $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal','caldav_name'); |
|
| 2065 | + $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal', 'caldav_name'); |
|
| 2066 | 2066 | |
| 2067 | 2067 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.9.003'; |
| 2068 | 2068 | } |
@@ -2073,8 +2073,8 @@ discard block |
||
| 2073 | 2073 | */ |
| 2074 | 2074 | function calendar_upgrade1_9_003() |
| 2075 | 2075 | { |
| 2076 | - $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal','cal_modified'); |
|
| 2077 | - $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal_user','cal_user_modified'); |
|
| 2076 | + $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal', 'cal_modified'); |
|
| 2077 | + $GLOBALS['egw_setup']->oProc->CreateIndex('egw_cal_user', 'cal_user_modified'); |
|
| 2078 | 2078 | |
| 2079 | 2079 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.9.004'; |
| 2080 | 2080 | } |
@@ -2086,7 +2086,7 @@ discard block |
||
| 2086 | 2086 | */ |
| 2087 | 2087 | function calendar_upgrade1_9_004() |
| 2088 | 2088 | { |
| 2089 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_dates','recur_exception',array( |
|
| 2089 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_dates', 'recur_exception', array( |
|
| 2090 | 2090 | 'type' => 'bool', |
| 2091 | 2091 | 'default' => '', |
| 2092 | 2092 | 'null' => false, |
@@ -2094,16 +2094,16 @@ discard block |
||
| 2094 | 2094 | )); |
| 2095 | 2095 | |
| 2096 | 2096 | // migrate existing exceptions to egw_cal_dates |
| 2097 | - foreach($GLOBALS['egw_setup']->db->select('egw_cal_repeats', |
|
| 2097 | + foreach ($GLOBALS['egw_setup']->db->select('egw_cal_repeats', |
|
| 2098 | 2098 | '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', |
| 2099 | 2099 | 'egw_cal_repeats.recur_exception IS NOT NULL', __LINE__, __FILE__, false, |
| 2100 | 2100 | 'GROUP BY egw_cal_repeats.cal_id,egw_cal_repeats.recur_exception', 'calendar', '', |
| 2101 | 2101 | 'JOIN egw_cal_dates ON egw_cal_repeats.cal_id=egw_cal_dates.cal_id') as $row) |
| 2102 | 2102 | { |
| 2103 | - foreach($row['recur_exception'] ? array_unique(explode(',', $row['recur_exception'])) : array() as $recur_exception) |
|
| 2103 | + foreach ($row['recur_exception'] ? array_unique(explode(',', $row['recur_exception'])) : array() as $recur_exception) |
|
| 2104 | 2104 | { |
| 2105 | 2105 | $GLOBALS['egw_setup']->db->insert('egw_cal_dates', array( |
| 2106 | - 'cal_end' => $recur_exception+$row['cal_end']-$row['cal_start'], |
|
| 2106 | + 'cal_end' => $recur_exception + $row['cal_end'] - $row['cal_start'], |
|
| 2107 | 2107 | 'recur_exception' => true, |
| 2108 | 2108 | ), array( |
| 2109 | 2109 | 'cal_id' => $row['cal_id'], |
@@ -2115,11 +2115,11 @@ discard block |
||
| 2115 | 2115 | |
| 2116 | 2116 | $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal_repeats', array( |
| 2117 | 2117 | 'fd' => array( |
| 2118 | - 'cal_id' => array('type' => 'int','precision' => '4','nullable' => False), |
|
| 2119 | - 'recur_type' => array('type' => 'int','precision' => '2','nullable' => False), |
|
| 2120 | - 'recur_enddate' => array('type' => 'int','precision' => '8'), |
|
| 2121 | - 'recur_interval' => array('type' => 'int','precision' => '2','default' => '1'), |
|
| 2122 | - 'recur_data' => array('type' => 'int','precision' => '2','default' => '1'), |
|
| 2118 | + 'cal_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
| 2119 | + 'recur_type' => array('type' => 'int', 'precision' => '2', 'nullable' => False), |
|
| 2120 | + 'recur_enddate' => array('type' => 'int', 'precision' => '8'), |
|
| 2121 | + 'recur_interval' => array('type' => 'int', 'precision' => '2', 'default' => '1'), |
|
| 2122 | + 'recur_data' => array('type' => 'int', 'precision' => '2', 'default' => '1'), |
|
| 2123 | 2123 | ), |
| 2124 | 2124 | 'pk' => array('cal_id'), |
| 2125 | 2125 | 'fk' => array(), |
@@ -2140,19 +2140,19 @@ discard block |
||
| 2140 | 2140 | // returns NULL, if there are no rows! |
| 2141 | 2141 | if ((int)$max_description_length <= 16384 && $GLOBALS['egw_setup']->oProc->max_varchar_length >= 16384) |
| 2142 | 2142 | { |
| 2143 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_description',array( |
|
| 2143 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_description', array( |
|
| 2144 | 2144 | 'type' => 'varchar', |
| 2145 | 2145 | 'precision' => '16384' |
| 2146 | 2146 | )); |
| 2147 | 2147 | } |
| 2148 | 2148 | // allow more categories |
| 2149 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_category',array( |
|
| 2149 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_category', array( |
|
| 2150 | 2150 | 'type' => 'varchar', |
| 2151 | 2151 | 'precision' => '64', |
| 2152 | 2152 | 'comment' => 'category id(s)' |
| 2153 | 2153 | )); |
| 2154 | 2154 | // remove silly default of 1 |
| 2155 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_title',array( |
|
| 2155 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_title', array( |
|
| 2156 | 2156 | 'type' => 'varchar', |
| 2157 | 2157 | 'precision' => '255', |
| 2158 | 2158 | 'nullable' => False |
@@ -2167,14 +2167,14 @@ discard block |
||
| 2167 | 2167 | { |
| 2168 | 2168 | // PostgreSQL needs temporary a nullable column, to not stall on broken events without dates! |
| 2169 | 2169 | // We add that constrain in 1.9.007, after deleting all rows with range_start=0 OR range_start IS NULL |
| 2170 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','range_start',array( |
|
| 2170 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'range_start', array( |
|
| 2171 | 2171 | 'type' => 'int', |
| 2172 | 2172 | 'precision' => '8', |
| 2173 | 2173 | 'comment' => 'startdate (of range)' |
| 2174 | 2174 | )); |
| 2175 | 2175 | $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__); |
| 2176 | 2176 | |
| 2177 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal','range_end',array( |
|
| 2177 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal', 'range_end', array( |
|
| 2178 | 2178 | 'type' => 'int', |
| 2179 | 2179 | 'precision' => '8', |
| 2180 | 2180 | 'comment' => 'enddate (of range, UNTIL of RRULE)' |
@@ -2190,18 +2190,18 @@ discard block |
||
| 2190 | 2190 | { |
| 2191 | 2191 | $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__); |
| 2192 | 2192 | } |
| 2193 | - $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal_repeats',array( |
|
| 2193 | + $GLOBALS['egw_setup']->oProc->DropColumn('egw_cal_repeats', array( |
|
| 2194 | 2194 | 'fd' => array( |
| 2195 | - 'cal_id' => array('type' => 'int','precision' => '4','nullable' => False), |
|
| 2196 | - 'recur_type' => array('type' => 'int','precision' => '2','nullable' => False), |
|
| 2197 | - 'recur_interval' => array('type' => 'int','precision' => '2','default' => '1'), |
|
| 2198 | - 'recur_data' => array('type' => 'int','precision' => '2','default' => '1') |
|
| 2195 | + 'cal_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
| 2196 | + 'recur_type' => array('type' => 'int', 'precision' => '2', 'nullable' => False), |
|
| 2197 | + 'recur_interval' => array('type' => 'int', 'precision' => '2', 'default' => '1'), |
|
| 2198 | + 'recur_data' => array('type' => 'int', 'precision' => '2', 'default' => '1') |
|
| 2199 | 2199 | ), |
| 2200 | 2200 | 'pk' => array('cal_id'), |
| 2201 | 2201 | 'fk' => array(), |
| 2202 | 2202 | 'ix' => array(), |
| 2203 | 2203 | 'uc' => array() |
| 2204 | - ),'recur_enddate'); |
|
| 2204 | + ), 'recur_enddate'); |
|
| 2205 | 2205 | |
| 2206 | 2206 | return $GLOBALS['setup_info']['calendar']['currentver'] = '1.9.007'; |
| 2207 | 2207 | } |
@@ -2213,14 +2213,14 @@ discard block |
||
| 2213 | 2213 | */ |
| 2214 | 2214 | function calendar_upgrade1_9_007() |
| 2215 | 2215 | { |
| 2216 | - foreach(array('egw_cal_repeats','egw_cal_dates','egw_cal_user','egw_cal_extra') as $table) |
|
| 2216 | + foreach (array('egw_cal_repeats', 'egw_cal_dates', 'egw_cal_user', 'egw_cal_extra') as $table) |
|
| 2217 | 2217 | { |
| 2218 | 2218 | $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__); |
| 2219 | 2219 | } |
| 2220 | 2220 | $GLOBALS['egw_setup']->db->query("DELETE FROM egw_cal WHERE range_start=0 OR range_start IS NULL", __LINE__, __FILE__); |
| 2221 | 2221 | |
| 2222 | 2222 | // now we can remove temporary default of 0 from range_start and set it NOT NULL |
| 2223 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','range_start',array( |
|
| 2223 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'range_start', array( |
|
| 2224 | 2224 | 'type' => 'int', |
| 2225 | 2225 | 'precision' => '8', |
| 2226 | 2226 | 'nullable' => False, |
@@ -2285,7 +2285,7 @@ discard block |
||
| 2285 | 2285 | |
| 2286 | 2286 | function calendar_upgrade1_9_010() |
| 2287 | 2287 | { |
| 2288 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','caldav_name',array( |
|
| 2288 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'caldav_name', array( |
|
| 2289 | 2289 | 'type' => 'varchar', |
| 2290 | 2290 | 'precision' => '200', |
| 2291 | 2291 | 'comment' => 'name part of CalDAV URL, if specified by client' |
@@ -2315,7 +2315,7 @@ discard block |
||
| 2315 | 2315 | SET cal_reference=0,cal_recurrence=0,cal_etag=cal_etag+1,cal_modifier=0,cal_modified=".time()." |
| 2316 | 2316 | WHERE cal_reference != 0 AND cal_id IN (SELECT cal_id FROM egw_cal_repeats)", __LINE__, __FILE__); |
| 2317 | 2317 | |
| 2318 | - foreach($GLOBALS['egw_setup']->db->query( |
|
| 2318 | + foreach ($GLOBALS['egw_setup']->db->query( |
|
| 2319 | 2319 | "SELECT DISTINCT master.cal_id,egw_cal_user.cal_user_type,egw_cal_user.cal_user_id,'E' AS cal_status |
| 2320 | 2320 | FROM egw_cal_user |
| 2321 | 2321 | JOIN egw_cal ON egw_cal_user.cal_id=egw_cal.cal_id |
@@ -2342,7 +2342,7 @@ discard block |
||
| 2342 | 2342 | */ |
| 2343 | 2343 | function calendar_upgrade14_1_001() |
| 2344 | 2344 | { |
| 2345 | - foreach($GLOBALS['egw_setup']->db->query( |
|
| 2345 | + foreach ($GLOBALS['egw_setup']->db->query( |
|
| 2346 | 2346 | "SELECT egw_cal.cal_id AS cal_id,cal_start,cal_end,range_start,range_end,egw_cal_repeats.*,tz_tzid AS tzid |
| 2347 | 2347 | FROM egw_cal |
| 2348 | 2348 | JOIN egw_cal_repeats ON egw_cal_repeats.cal_id=egw_cal.cal_id |
@@ -2364,7 +2364,7 @@ discard block |
||
| 2364 | 2364 | $enddate->modify(($event['end'] - $event['start']).' second'); |
| 2365 | 2365 | if (($range_end = $enddate->format('server')) != $event['range_end']) |
| 2366 | 2366 | { |
| 2367 | - $GLOBALS['egw_setup']->db->update('egw_cal',array( |
|
| 2367 | + $GLOBALS['egw_setup']->db->update('egw_cal', array( |
|
| 2368 | 2368 | 'range_end' => $range_end, |
| 2369 | 2369 | 'cal_etag=cal_etag+1', |
| 2370 | 2370 | 'cal_modified' => time(), |
@@ -2374,7 +2374,7 @@ discard block |
||
| 2374 | 2374 | //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)); |
| 2375 | 2375 | } |
| 2376 | 2376 | } |
| 2377 | - return $GLOBALS['setup_info']['calendar']['currentver'] = '14.2.002'; // skip 14.2.001 update, as query is fixed now |
|
| 2377 | + return $GLOBALS['setup_info']['calendar']['currentver'] = '14.2.002'; // skip 14.2.001 update, as query is fixed now |
|
| 2378 | 2378 | } |
| 2379 | 2379 | |
| 2380 | 2380 | /** |
@@ -2398,7 +2398,7 @@ discard block |
||
| 2398 | 2398 | // if maximum is bigger then 3 |
| 2399 | 2399 | if ($values[1] > 3) |
| 2400 | 2400 | { |
| 2401 | - switch($GLOBALS['egw_setup']->db->Type) |
|
| 2401 | + switch ($GLOBALS['egw_setup']->db->Type) |
|
| 2402 | 2402 | { |
| 2403 | 2403 | case 'mysql': |
| 2404 | 2404 | $sql = "UPDATE egw_cal |
@@ -2448,7 +2448,7 @@ discard block |
||
| 2448 | 2448 | |
| 2449 | 2449 | function calendar_upgrade14_2_003() |
| 2450 | 2450 | { |
| 2451 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_uid',array( |
|
| 2451 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_uid', array( |
|
| 2452 | 2452 | 'type' => 'ascii', |
| 2453 | 2453 | 'precision' => '128', |
| 2454 | 2454 | 'nullable' => False, |
@@ -2460,13 +2460,13 @@ discard block |
||
| 2460 | 2460 | { |
| 2461 | 2461 | $GLOBALS['egw_setup']->db->query("UPDATE egw_cal SET cal_category='' WHERE cal_category NOT REGEXP '^[0-9,]*$'", __LINE__, __FILE__); |
| 2462 | 2462 | } |
| 2463 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','cal_category',array( |
|
| 2463 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'cal_category', array( |
|
| 2464 | 2464 | 'type' => 'ascii', |
| 2465 | 2465 | 'meta' => 'category', |
| 2466 | 2466 | 'precision' => '64', |
| 2467 | 2467 | 'comment' => 'category id(s)' |
| 2468 | 2468 | )); |
| 2469 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal','caldav_name',array( |
|
| 2469 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal', 'caldav_name', array( |
|
| 2470 | 2470 | 'type' => 'ascii', |
| 2471 | 2471 | 'precision' => '128', |
| 2472 | 2472 | 'comment' => 'name part of CalDAV URL, if specified by client' |
@@ -2523,22 +2523,22 @@ discard block |
||
| 2523 | 2523 | 'type' => 'auto', |
| 2524 | 2524 | 'nullable' => False |
| 2525 | 2525 | ));*/ |
| 2526 | - $GLOBALS['egw_setup']->oProc->RefreshTable('egw_cal_user',array( |
|
| 2526 | + $GLOBALS['egw_setup']->oProc->RefreshTable('egw_cal_user', array( |
|
| 2527 | 2527 | 'fd' => array( |
| 2528 | - 'cal_id' => array('type' => 'int','precision' => '4','nullable' => False), |
|
| 2529 | - 'cal_recur_date' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False,'default' => '0'), |
|
| 2530 | - 'cal_user_type' => array('type' => 'ascii','precision' => '1','nullable' => False,'default' => 'u','comment' => 'u=user, g=group, c=contact, r=resource, e=email'), |
|
| 2531 | - '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'), |
|
| 2532 | - 'cal_status' => array('type' => 'ascii','precision' => '1','default' => 'A','comment' => 'U=unknown, A=accepted, R=rejected, T=tentative'), |
|
| 2533 | - 'cal_quantity' => array('type' => 'int','precision' => '4','default' => '1','comment' => 'only for certain types (eg. resources)'), |
|
| 2534 | - 'cal_role' => array('type' => 'ascii','precision' => '64','default' => 'REQ-PARTICIPANT','comment' => 'CHAIR, REQ-PARTICIPANT, OPT-PARTICIPANT, NON-PARTICIPANT, X-CAT-$cat_id'), |
|
| 2535 | - 'cal_user_modified' => array('type' => 'timestamp','default' => 'current_timestamp','comment' => 'automatic timestamp of last update'), |
|
| 2536 | - 'cal_user_auto' => array('type' => 'auto','nullable' => False) |
|
| 2528 | + 'cal_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
| 2529 | + 'cal_recur_date' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'nullable' => False, 'default' => '0'), |
|
| 2530 | + 'cal_user_type' => array('type' => 'ascii', 'precision' => '1', 'nullable' => False, 'default' => 'u', 'comment' => 'u=user, g=group, c=contact, r=resource, e=email'), |
|
| 2531 | + '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'), |
|
| 2532 | + 'cal_status' => array('type' => 'ascii', 'precision' => '1', 'default' => 'A', 'comment' => 'U=unknown, A=accepted, R=rejected, T=tentative'), |
|
| 2533 | + 'cal_quantity' => array('type' => 'int', 'precision' => '4', 'default' => '1', 'comment' => 'only for certain types (eg. resources)'), |
|
| 2534 | + 'cal_role' => array('type' => 'ascii', 'precision' => '64', 'default' => 'REQ-PARTICIPANT', 'comment' => 'CHAIR, REQ-PARTICIPANT, OPT-PARTICIPANT, NON-PARTICIPANT, X-CAT-$cat_id'), |
|
| 2535 | + 'cal_user_modified' => array('type' => 'timestamp', 'default' => 'current_timestamp', 'comment' => 'automatic timestamp of last update'), |
|
| 2536 | + 'cal_user_auto' => array('type' => 'auto', 'nullable' => False) |
|
| 2537 | 2537 | ), |
| 2538 | 2538 | 'pk' => array('cal_user_auto'), |
| 2539 | 2539 | 'fk' => array(), |
| 2540 | - 'ix' => array('cal_user_modified',array('cal_user_type','cal_user_id')), |
|
| 2541 | - 'uc' => array(array('cal_id','cal_recur_date','cal_user_type','cal_user_id')) |
|
| 2540 | + 'ix' => array('cal_user_modified', array('cal_user_type', 'cal_user_id')), |
|
| 2541 | + 'uc' => array(array('cal_id', 'cal_recur_date', 'cal_user_type', 'cal_user_id')) |
|
| 2542 | 2542 | )); |
| 2543 | 2543 | |
| 2544 | 2544 | return $GLOBALS['setup_info']['calendar']['currentver'] = '14.2.005'; |
@@ -2547,12 +2547,12 @@ discard block |
||
| 2547 | 2547 | |
| 2548 | 2548 | function calendar_upgrade14_2_005() |
| 2549 | 2549 | { |
| 2550 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_timezones','tz_tzid',array( |
|
| 2550 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_timezones', 'tz_tzid', array( |
|
| 2551 | 2551 | 'type' => 'ascii', |
| 2552 | 2552 | 'precision' => '128', |
| 2553 | 2553 | 'nullable' => False |
| 2554 | 2554 | )); |
| 2555 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_timezones','tz_component',array( |
|
| 2555 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_timezones', 'tz_component', array( |
|
| 2556 | 2556 | 'type' => 'ascii', |
| 2557 | 2557 | 'precision' => '8192', |
| 2558 | 2558 | 'comment' => 'iCal VTIMEZONE component' |
@@ -2568,7 +2568,7 @@ discard block |
||
| 2568 | 2568 | */ |
| 2569 | 2569 | function calendar_upgrade14_3() |
| 2570 | 2570 | { |
| 2571 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user','cal_user_attendee',array( |
|
| 2571 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_cal_user', 'cal_user_attendee', array( |
|
| 2572 | 2572 | 'type' => 'varchar', |
| 2573 | 2573 | 'precision' => '255', |
| 2574 | 2574 | 'comment' => 'email or json object with attr. cn, url, ...' |
@@ -2579,12 +2579,12 @@ discard block |
||
| 2579 | 2579 | |
| 2580 | 2580 | // delete all but one row, which would give a doublicate key, after above normalising of email addresses |
| 2581 | 2581 | // by ordering by status we prever accepted over tentative over unknow over deleted |
| 2582 | - foreach($GLOBALS['egw_setup']->db->select('egw_cal_user', "cal_id,cal_recur_date,$email AS email", array( |
|
| 2582 | + foreach ($GLOBALS['egw_setup']->db->select('egw_cal_user', "cal_id,cal_recur_date,$email AS email", array( |
|
| 2583 | 2583 | 'cal_user_type' => 'e', |
| 2584 | 2584 | ), __LINE__, __FILE__, false, "GROUP BY cal_id,cal_recur_date,$email HAVING COUNT(*)>1", 'calendar') as $row) |
| 2585 | 2585 | { |
| 2586 | 2586 | $n = 0; |
| 2587 | - foreach($GLOBALS['egw_setup']->db->select('egw_cal_user', "*,$email AS email", array( |
|
| 2587 | + foreach ($GLOBALS['egw_setup']->db->select('egw_cal_user', "*,$email AS email", array( |
|
| 2588 | 2588 | 'cal_id' => $row['cal_id'], |
| 2589 | 2589 | 'cal_recur_date' => $row['cal_recur_date'], |
| 2590 | 2590 | 'cal_user_type' => 'e', |
@@ -2592,7 +2592,7 @@ discard block |
||
| 2592 | 2592 | ), __LINE__, __FILE__, false, 'ORDER BY cal_status', 'calendar') as $user) // order A, T, U, X |
| 2593 | 2593 | { |
| 2594 | 2594 | if (strpos($user['email'], '@') !== false && !$n++) continue; |
| 2595 | - $GLOBALS['egw_setup']->db->delete('egw_cal_user', array_intersect_key($user, array_flip(array('cal_id','cal_recur_date','cal_user_type','cal_user_id','cal_status')))); |
|
| 2595 | + $GLOBALS['egw_setup']->db->delete('egw_cal_user', array_intersect_key($user, array_flip(array('cal_id', 'cal_recur_date', 'cal_user_type', 'cal_user_id', 'cal_status')))); |
|
| 2596 | 2596 | } |
| 2597 | 2597 | } |
| 2598 | 2598 | |
@@ -2601,7 +2601,7 @@ discard block |
||
| 2601 | 2601 | "UPDATE egw_cal_user SET cal_user_attendee=cal_user_id,cal_user_id=MD5($email) WHERE cal_user_type='e'", |
| 2602 | 2602 | __LINE__, __FILE__); |
| 2603 | 2603 | |
| 2604 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user','cal_user_id',array( |
|
| 2604 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_user', 'cal_user_id', array( |
|
| 2605 | 2605 | 'type' => 'ascii', |
| 2606 | 2606 | 'meta' => array( |
| 2607 | 2607 | "cal_user_type='u'" => 'account' |
@@ -2623,7 +2623,7 @@ discard block |
||
| 2623 | 2623 | { |
| 2624 | 2624 | $GLOBALS['calendar_upgrade14_3_001-run'] = true; |
| 2625 | 2625 | |
| 2626 | - 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 |
|
| 2626 | + 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 |
|
| 2627 | 2627 | FROM egw_cal_user |
| 2628 | 2628 | 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 |
| 2629 | 2629 | WHERE egw_cal_user.cal_user_type='e' AND egw_cal_user.cal_user_attendee IS NOT NULL |
@@ -2674,8 +2674,8 @@ discard block |
||
| 2674 | 2674 | { |
| 2675 | 2675 | Api\Preferences::change_preference('calendar', '/^favorite_/', function($attr, $old_value, $owner) |
| 2676 | 2676 | { |
| 2677 | - unset($attr, $owner); // not used, but required by function signature |
|
| 2678 | - if($old_value['state'] && is_array($old_value['state'])) |
|
| 2677 | + unset($attr, $owner); // not used, but required by function signature |
|
| 2678 | + if ($old_value['state'] && is_array($old_value['state'])) |
|
| 2679 | 2679 | { |
| 2680 | 2680 | unset($old_value['state']['date']); |
| 2681 | 2681 | unset($old_value['state']['startdate']); |
@@ -2695,15 +2695,15 @@ discard block |
||
| 2695 | 2695 | { |
| 2696 | 2696 | Api\Preferences::change_preference('calendar', 'use_time_grid', function($attr, $old_value, $owner) |
| 2697 | 2697 | { |
| 2698 | - unset($attr, $owner); // not used, but required by function signature |
|
| 2699 | - switch($old_value) |
|
| 2698 | + unset($attr, $owner); // not used, but required by function signature |
|
| 2699 | + switch ($old_value) |
|
| 2700 | 2700 | { |
| 2701 | 2701 | case 'all': |
| 2702 | 2702 | return 0; |
| 2703 | 2703 | case 'day_week': |
| 2704 | - return ['day','day4','week']; |
|
| 2704 | + return ['day', 'day4', 'week']; |
|
| 2705 | 2705 | case 'day4': |
| 2706 | - return ['day','day4']; |
|
| 2706 | + return ['day', 'day4']; |
|
| 2707 | 2707 | } |
| 2708 | 2708 | return null; |
| 2709 | 2709 | }); |
@@ -2728,7 +2728,7 @@ discard block |
||
| 2728 | 2728 | function calendar_upgrade16_1_001() |
| 2729 | 2729 | { |
| 2730 | 2730 | $GLOBALS['egw_setup']->oProc->AlterColumn('egw_cal_extra', 'cal_extra_value', |
| 2731 | - array('type' => 'varchar','meta' => 'cfvalue','precision' => '16384','nullable' => False,'default' => '')); |
|
| 2731 | + array('type' => 'varchar', 'meta' => 'cfvalue', 'precision' => '16384', 'nullable' => False, 'default' => '')); |
|
| 2732 | 2732 | |
| 2733 | 2733 | Api\Preferences::change_preference('calendar', 'defaultresource_sel', 'resources', 'addressbook', 'forced'); |
| 2734 | 2734 | Api\Preferences::change_preference('calendar', 'defaultresource_sel', 'resources', 'addressbook', 'default'); |
@@ -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', |
@@ -10,17 +10,17 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // enable auto-loading of holidays from localhost by default |
| 13 | -foreach(array( |
|
| 13 | +foreach (array( |
|
| 14 | 14 | 'auto_load_holidays' => 'True', |
| 15 | 15 | 'holidays_url_path' => 'localhost', |
| 16 | 16 | ) as $name => $value) |
| 17 | 17 | { |
| 18 | - $oProc->insert($GLOBALS['egw_setup']->config_table,array( |
|
| 18 | + $oProc->insert($GLOBALS['egw_setup']->config_table, array( |
|
| 19 | 19 | 'config_value' => $value, |
| 20 | - ),array( |
|
| 20 | + ), array( |
|
| 21 | 21 | 'config_app' => 'phpgwapi', |
| 22 | 22 | 'config_name' => $name, |
| 23 | - ),__FILE__,__LINE__); |
|
| 23 | + ), __FILE__, __LINE__); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | // import timezone data |
@@ -41,23 +41,23 @@ discard block |
||
| 41 | 41 | $GLOBALS['egw_info']['flags']['currentapp'] = 'calendar'; |
| 42 | 42 | } |
| 43 | 43 | // fix for SOGo connector, which does not decode the = in our f/b url |
| 44 | -if (strpos($_SERVER['QUERY_STRING'],'=3D') !== false && substr($_GET['user'],0,2) == '3D') |
|
| 44 | +if (strpos($_SERVER['QUERY_STRING'], '=3D') !== false && substr($_GET['user'], 0, 2) == '3D') |
|
| 45 | 45 | { |
| 46 | - $_GET['user'] = substr($_GET['user'],2); |
|
| 47 | - if (isset($_GET['password'])) $_GET['password'] = substr($_GET['password'],2); |
|
| 48 | - if (isset($_GET['cred'])) $_GET['cred'] = substr($_GET['cred'],2); |
|
| 46 | + $_GET['user'] = substr($_GET['user'], 2); |
|
| 47 | + if (isset($_GET['password'])) $_GET['password'] = substr($_GET['password'], 2); |
|
| 48 | + if (isset($_GET['cred'])) $_GET['cred'] = substr($_GET['cred'], 2); |
|
| 49 | 49 | } |
| 50 | 50 | if (!is_numeric($user = $_GET['user'])) |
| 51 | 51 | { |
| 52 | 52 | // check if user contains the current domain --> remove it |
| 53 | - list(,$domain) = explode('@',$user); |
|
| 53 | + list(,$domain) = explode('@', $user); |
|
| 54 | 54 | if ($domain === $GLOBALS['egw_info']['user']['domain']) |
| 55 | - list($user) = explode('@',$user); |
|
| 56 | - $user = $GLOBALS['egw']->accounts->name2id($user,'account_lid','u'); |
|
| 55 | + list($user) = explode('@', $user); |
|
| 56 | + $user = $GLOBALS['egw']->accounts->name2id($user, 'account_lid', 'u'); |
|
| 57 | 57 | } |
| 58 | 58 | if ($user === false || !($username = $GLOBALS['egw']->accounts->id2name($user))) |
| 59 | 59 | { |
| 60 | - fail_exit(lang("freebusy: Unknow user '%1', wrong password or not availible to not loged in users !!!"." $username($user)",$_GET['user'])); |
|
| 60 | + fail_exit(lang("freebusy: Unknow user '%1', wrong password or not availible to not loged in users !!!"." $username($user)", $_GET['user'])); |
|
| 61 | 61 | } |
| 62 | 62 | if (!$loged_in) |
| 63 | 63 | { |
@@ -78,11 +78,11 @@ discard block |
||
| 78 | 78 | if (strpos($authuser, '@') === false) |
| 79 | 79 | { |
| 80 | 80 | $domain = $GLOBALS['egw_info']['server']['default_domain']; |
| 81 | - $authuser .= '@' . $domain; |
|
| 81 | + $authuser .= '@'.$domain; |
|
| 82 | 82 | } |
| 83 | 83 | else |
| 84 | 84 | { |
| 85 | - list(, $domain) = explode('@',$authuser, 2); |
|
| 85 | + list(, $domain) = explode('@', $authuser, 2); |
|
| 86 | 86 | } |
| 87 | 87 | if (array_key_exists($domain, $GLOBALS['egw_domain'])) |
| 88 | 88 | { |
@@ -92,8 +92,8 @@ discard block |
||
| 92 | 92 | $GLOBALS['egw_info']['user']['domain'] = $domain; |
| 93 | 93 | $GLOBALS['egw_info']['flags']['currentapp'] = 'login'; |
| 94 | 94 | $GLOBALS['egw_info']['flags']['noapi'] = false; |
| 95 | - require_once(EGW_API_INC . '/functions.inc.php'); |
|
| 96 | - $loged_in = $GLOBALS['egw']->session->create($authuser, $password, 'text'); |
|
| 95 | + require_once(EGW_API_INC.'/functions.inc.php'); |
|
| 96 | + $loged_in = $GLOBALS['egw']->session->create($authuser, $password, 'text'); |
|
| 97 | 97 | session_unset(); |
| 98 | 98 | session_destroy(); |
| 99 | 99 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | } |
| 110 | 110 | else |
| 111 | 111 | { |
| 112 | - Api\Header\Content::type('freebusy.ifb','text/calendar'); |
|
| 112 | + Api\Header\Content::type('freebusy.ifb', 'text/calendar'); |
|
| 113 | 113 | } |
| 114 | 114 | $ical = new calendar_ical(); |
| 115 | 115 | echo $ical->freebusy($user, $_GET['end']); |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | public static $types = array( |
| 26 | 26 | 'select-cat' => array('category'), |
| 27 | - 'select-account'=> array('owner','creator', 'modifier'), |
|
| 28 | - 'date-time' => array('modified', 'created','start','end','recur_date'), |
|
| 27 | + 'select-account'=> array('owner', 'creator', 'modifier'), |
|
| 28 | + 'date-time' => array('modified', 'created', 'start', 'end', 'recur_date'), |
|
| 29 | 29 | 'date' => array('recur_enddate'), |
| 30 | 30 | 'select-bool' => array('public', 'non_blocking'), |
| 31 | 31 | 'select' => array('priority'), |
@@ -37,12 +37,12 @@ discard block |
||
| 37 | 37 | * |
| 38 | 38 | * @param string $_identifier |
| 39 | 39 | */ |
| 40 | - public function __construct( $_identifier='' ){ |
|
| 40 | + public function __construct($_identifier = '') { |
|
| 41 | 41 | $this->identifier = $_identifier; |
| 42 | - if(!is_object($this->bo)) { |
|
| 42 | + if (!is_object($this->bo)) { |
|
| 43 | 43 | $this->bo = new calendar_bo(); |
| 44 | 44 | } |
| 45 | - if($this->identifier) { |
|
| 45 | + if ($this->identifier) { |
|
| 46 | 46 | $this->record = $this->bo->read($this->identifier); |
| 47 | 47 | } |
| 48 | 48 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * @todo add some checks |
| 97 | 97 | * @return void |
| 98 | 98 | */ |
| 99 | - public function set_record(array $_record){ |
|
| 99 | + public function set_record(array $_record) { |
|
| 100 | 100 | $this->record = $_record; |
| 101 | 101 | } |
| 102 | 102 | |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | * |
| 125 | 125 | * @return string identifier |
| 126 | 126 | */ |
| 127 | - public function save ( $_dst_identifier ) { |
|
| 127 | + public function save($_dst_identifier) { |
|
| 128 | 128 | // Not yet implemeted |
| 129 | 129 | $this->identifier = $_dst_identifier; |
| 130 | 130 | } |
@@ -135,8 +135,8 @@ discard block |
||
| 135 | 135 | * @param string $_dst_identifier |
| 136 | 136 | * @return string dst_identifier |
| 137 | 137 | */ |
| 138 | - public function copy ( $_dst_identifier ) { |
|
| 139 | - unset($_dst_identifier); // not used |
|
| 138 | + public function copy($_dst_identifier) { |
|
| 139 | + unset($_dst_identifier); // not used |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /** |
@@ -146,15 +146,15 @@ discard block |
||
| 146 | 146 | * @param string $_dst_identifier |
| 147 | 147 | * @return string dst_identifier |
| 148 | 148 | */ |
| 149 | - public function move ( $_dst_identifier ) { |
|
| 150 | - unset($_dst_identifier); // not used |
|
| 149 | + public function move($_dst_identifier) { |
|
| 150 | + unset($_dst_identifier); // not used |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | /** |
| 154 | 154 | * delets current record from backend |
| 155 | 155 | * |
| 156 | 156 | */ |
| 157 | - public function delete () { |
|
| 157 | + public function delete() { |
|
| 158 | 158 | |
| 159 | 159 | } |
| 160 | 160 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * |
| 42 | 42 | * @var mixed |
| 43 | 43 | */ |
| 44 | - var $debug=false; |
|
| 44 | + var $debug = false; |
|
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * extra rows above and below the workday |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * |
| 93 | 93 | * @var boolean |
| 94 | 94 | */ |
| 95 | - var $use_time_grid=true; |
|
| 95 | + var $use_time_grid = true; |
|
| 96 | 96 | |
| 97 | 97 | /** |
| 98 | 98 | * Pref value of use_time_grid preference |
@@ -105,14 +105,14 @@ discard block |
||
| 105 | 105 | * |
| 106 | 106 | * @var boolean |
| 107 | 107 | */ |
| 108 | - var $scroll_to_wdstart=false; |
|
| 108 | + var $scroll_to_wdstart = false; |
|
| 109 | 109 | |
| 110 | 110 | /** |
| 111 | 111 | * counter for the current whole day event of a single day |
| 112 | 112 | * |
| 113 | 113 | * @var int |
| 114 | 114 | */ |
| 115 | - var $wholeDayPosCounter=1; |
|
| 115 | + var $wholeDayPosCounter = 1; |
|
| 116 | 116 | |
| 117 | 117 | /** |
| 118 | 118 | * Switch to disable private data and possibility to view and edit events |
@@ -135,25 +135,25 @@ discard block |
||
| 135 | 135 | * |
| 136 | 136 | * @param array $set_states = null to manualy set / change one of the states, default NULL = use $_REQUEST |
| 137 | 137 | */ |
| 138 | - function __construct($set_states=null) |
|
| 138 | + function __construct($set_states = null) |
|
| 139 | 139 | { |
| 140 | - parent::__construct(false,$set_states); // call the parent's constructor |
|
| 140 | + parent::__construct(false, $set_states); // call the parent's constructor |
|
| 141 | 141 | $this->extraRowsOriginal = $this->extraRows; //save original extraRows value |
| 142 | 142 | |
| 143 | 143 | $GLOBALS['egw_info']['flags']['nonavbar'] = False; |
| 144 | 144 | |
| 145 | 145 | // Check for GET message (from merge) |
| 146 | - if($_GET['msg']) |
|
| 146 | + if ($_GET['msg']) |
|
| 147 | 147 | { |
| 148 | 148 | Framework::message($_GET['msg']); |
| 149 | 149 | unset($_GET['msg']); |
| 150 | 150 | } |
| 151 | 151 | // standard params for calling bocal::search for all views |
| 152 | - $this->owner = str_replace('%2C',',',$this->owner); |
|
| 152 | + $this->owner = str_replace('%2C', ',', $this->owner); |
|
| 153 | 153 | $this->search_params = array( |
| 154 | 154 | 'start' => $this->date, |
| 155 | - 'cat_id' => $this->cat_id ? (is_array($this->cat_id)?$this->cat_id:explode(',',$this->cat_id)) : 0, |
|
| 156 | - 'users' => explode(',',$this->owner), |
|
| 155 | + 'cat_id' => $this->cat_id ? (is_array($this->cat_id) ? $this->cat_id : explode(',', $this->cat_id)) : 0, |
|
| 156 | + 'users' => explode(',', $this->owner), |
|
| 157 | 157 | 'filter' => $this->filter, |
| 158 | 158 | 'daywise' => True, |
| 159 | 159 | 'use_so_events' => $this->test === 'true', |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | */ |
| 180 | 180 | public function week_number($time) |
| 181 | 181 | { |
| 182 | - if (!is_a($time,'DateTime')) $time = new Api\DateTime($time); |
|
| 182 | + if (!is_a($time, 'DateTime')) $time = new Api\DateTime($time); |
|
| 183 | 183 | |
| 184 | 184 | // if week does not start Monday and $time is Sunday --> add one day |
| 185 | 185 | if ($this->cal_prefs['weekdaystarts'] != 'Monday' && !($wday = $time->format('w'))) |
@@ -197,19 +197,19 @@ discard block |
||
| 197 | 197 | /** |
| 198 | 198 | * Load all views used by calendar, client side switches between them as needed |
| 199 | 199 | */ |
| 200 | - function index($content=array()) |
|
| 200 | + function index($content = array()) |
|
| 201 | 201 | { |
| 202 | - if($content['merge']) |
|
| 202 | + if ($content['merge']) |
|
| 203 | 203 | { |
| 204 | 204 | // View from sidebox is JSON encoded |
| 205 | - $this->manage_states(array_merge($content,json_decode($content['view'],true))); |
|
| 206 | - if($content['first']) |
|
| 205 | + $this->manage_states(array_merge($content, json_decode($content['view'], true))); |
|
| 206 | + if ($content['first']) |
|
| 207 | 207 | { |
| 208 | - $this->first = Api\DateTime::to($content['first'],'ts'); |
|
| 208 | + $this->first = Api\DateTime::to($content['first'], 'ts'); |
|
| 209 | 209 | } |
| 210 | - if($content['last']) |
|
| 210 | + if ($content['last']) |
|
| 211 | 211 | { |
| 212 | - $this->last = Api\DateTime::to($content['last'],'ts'); |
|
| 212 | + $this->last = Api\DateTime::to($content['last'], 'ts'); |
|
| 213 | 213 | } |
| 214 | 214 | $_GET['merge'] = $content['merge']; |
| 215 | 215 | $this->merge(); |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | $GLOBALS['egw_info']['flags']['params']['manual'] = array('page' => 'ManualCalendar'.ucfirst($this->view)); |
| 226 | 226 | |
| 227 | 227 | // Sidebox & iframe for old views |
| 228 | - if(in_array($this->view,array('year')) && $_GET['view']) |
|
| 228 | + if (in_array($this->view, array('year')) && $_GET['view']) |
|
| 229 | 229 | { |
| 230 | 230 | $GLOBALS['egw_info']['flags']['nonavbar'] = true; |
| 231 | 231 | $this->manage_states($_GET); |
@@ -237,24 +237,24 @@ discard block |
||
| 237 | 237 | $tmpl = new Etemplate('calendar.toolbar'); |
| 238 | 238 | $tmpl->setElementAttribute('toolbar', 'actions', $this->getToolbarActions($content)); |
| 239 | 239 | // Adjust toolbar for mobile |
| 240 | - if(Api\Header\UserAgent::mobile()){ |
|
| 241 | - $tmpl->setElementAttribute('toolbar','class', 'et2_head_toolbar'); |
|
| 242 | - $tmpl->setElementAttribute('toolbar','view_range', '3'); |
|
| 240 | + if (Api\Header\UserAgent::mobile()) { |
|
| 241 | + $tmpl->setElementAttribute('toolbar', 'class', 'et2_head_toolbar'); |
|
| 242 | + $tmpl->setElementAttribute('toolbar', 'view_range', '3'); |
|
| 243 | 243 | } |
| 244 | - $tmpl->exec('calendar_uiviews::index',array()); |
|
| 244 | + $tmpl->exec('calendar_uiviews::index', array()); |
|
| 245 | 245 | |
| 246 | 246 | // Load the different views once, we'll switch between them on the client side |
| 247 | 247 | $todo = new Etemplate('calendar.todo'); |
| 248 | 248 | $label = ''; |
| 249 | - $todo->exec('calendar_uiviews::index',array('todos'=>$this->get_todos($label), 'label' => $label)); |
|
| 249 | + $todo->exec('calendar_uiviews::index', array('todos'=>$this->get_todos($label), 'label' => $label)); |
|
| 250 | 250 | |
| 251 | 251 | // Actually, this takes care of most of it... |
| 252 | 252 | $this->week(); |
| 253 | 253 | |
| 254 | 254 | $planner = new Etemplate('calendar.planner'); |
| 255 | 255 | // Get the actions |
| 256 | - $planner->setElementAttribute('planner','actions',$this->get_actions()); |
|
| 257 | - $planner->exec('calendar_uiviews::index',array()); |
|
| 256 | + $planner->setElementAttribute('planner', 'actions', $this->get_actions()); |
|
| 257 | + $planner->exec('calendar_uiviews::index', array()); |
|
| 258 | 258 | |
| 259 | 259 | // List view in a separate file |
| 260 | 260 | $list_ui = new calendar_uilist(); |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | { |
| 397 | 397 | foreach (array_keys($actions) as $key) |
| 398 | 398 | { |
| 399 | - if (!in_array($key, array('day_view','week_view','next', 'today','previous'))) { |
|
| 399 | + if (!in_array($key, array('day_view', 'week_view', 'next', 'today', 'previous'))) { |
|
| 400 | 400 | $actions[$key]['toolbarDefault'] = false; |
| 401 | 401 | } |
| 402 | 402 | else { |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | * |
| 415 | 415 | * @param boolean|Etemplate $home = false if etemplate return content suitable for home-page |
| 416 | 416 | */ |
| 417 | - function &planner($content = array(), $home=false) |
|
| 417 | + function &planner($content = array(), $home = false) |
|
| 418 | 418 | { |
| 419 | 419 | if ($this->sortby == 'month') // yearly planner with month rows |
| 420 | 420 | { |
@@ -423,17 +423,17 @@ discard block |
||
| 423 | 423 | unset($this->first['raw']); |
| 424 | 424 | $this->last = $this->first; |
| 425 | 425 | $this->last['year']++; |
| 426 | - $this->last = $this->bo->date2ts($this->last)-1; |
|
| 426 | + $this->last = $this->bo->date2ts($this->last) - 1; |
|
| 427 | 427 | } |
| 428 | 428 | elseif (!$this->planner_view || $this->planner_view == 'month') // planner monthview |
| 429 | 429 | { |
| 430 | 430 | if ($this->day < 15) // show one complete month |
| 431 | 431 | { |
| 432 | - $this->_week_align_month($this->first,$this->last); |
|
| 432 | + $this->_week_align_month($this->first, $this->last); |
|
| 433 | 433 | } |
| 434 | 434 | else // show 2 half month |
| 435 | 435 | { |
| 436 | - $this->_week_align_month($this->first,$this->last,15); |
|
| 436 | + $this->_week_align_month($this->first, $this->last, 15); |
|
| 437 | 437 | } |
| 438 | 438 | } |
| 439 | 439 | elseif ($this->planner_view == 'week' || $this->planner_view == 'weekN') // weeekview |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | $start->setWeekstart(); |
| 443 | 443 | $this->first = $start->format('ts'); |
| 444 | 444 | $this->last = $this->bo->date2array($this->first); |
| 445 | - $this->last['day'] += ($this->planner_view == 'week' ? 7 : 7 * $this->cal_prefs['multiple_weeks'])-1; |
|
| 445 | + $this->last['day'] += ($this->planner_view == 'week' ? 7 : 7 * $this->cal_prefs['multiple_weeks']) - 1; |
|
| 446 | 446 | $this->last['hour'] = 23; $this->last['minute'] = $this->last['sec'] = 59; |
| 447 | 447 | unset($this->last['raw']); |
| 448 | 448 | $this->last = $this->bo->date2ts($this->last); |
@@ -458,9 +458,9 @@ discard block |
||
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | $merge = $this->merge(); |
| 461 | - if($merge) |
|
| 461 | + if ($merge) |
|
| 462 | 462 | { |
| 463 | - Egw::redirect_link('/index.php',array( |
|
| 463 | + Egw::redirect_link('/index.php', array( |
|
| 464 | 464 | 'menuaction' => 'calendar.calendar_uiviews.index', |
| 465 | 465 | 'msg' => $merge, |
| 466 | 466 | )); |
@@ -472,21 +472,21 @@ discard block |
||
| 472 | 472 | $search_params['end'] = $this->last; |
| 473 | 473 | $search_params['enum_groups'] = $this->sortby == 'user'; |
| 474 | 474 | $content['planner'] = $this->bo->search($search_params); |
| 475 | - foreach($content['planner'] as &$event) |
|
| 475 | + foreach ($content['planner'] as &$event) |
|
| 476 | 476 | { |
| 477 | 477 | $this->to_client($event); |
| 478 | 478 | } |
| 479 | 479 | |
| 480 | - if ($this->debug > 0) $this->bo->debug_message('uiviews::planner() date=%1: first=%2, last=%3',False,$this->date,$this->bo->date2string($this->first),$this->bo->date2string($this->last)); |
|
| 480 | + if ($this->debug > 0) $this->bo->debug_message('uiviews::planner() date=%1: first=%2, last=%3', False, $this->date, $this->bo->date2string($this->first), $this->bo->date2string($this->last)); |
|
| 481 | 481 | |
| 482 | 482 | $tmpl = $home ? $home : new Etemplate('calendar.planner'); |
| 483 | 483 | |
| 484 | - $tmpl->setElementAttribute('planner','start_date', Api\DateTime::to($this->first, Api\DateTime::ET2)); |
|
| 485 | - $tmpl->setElementAttribute('planner','end_date', Api\DateTime::to($this->last, Api\DateTime::ET2)); |
|
| 486 | - $tmpl->setElementAttribute('planner','owner', $search_params['users']); |
|
| 487 | - $tmpl->setElementAttribute('planner','group_by', $this->sortby); |
|
| 484 | + $tmpl->setElementAttribute('planner', 'start_date', Api\DateTime::to($this->first, Api\DateTime::ET2)); |
|
| 485 | + $tmpl->setElementAttribute('planner', 'end_date', Api\DateTime::to($this->last, Api\DateTime::ET2)); |
|
| 486 | + $tmpl->setElementAttribute('planner', 'owner', $search_params['users']); |
|
| 487 | + $tmpl->setElementAttribute('planner', 'group_by', $this->sortby); |
|
| 488 | 488 | // Get the actions |
| 489 | - $tmpl->setElementAttribute('planner','actions',$this->get_actions()); |
|
| 489 | + $tmpl->setElementAttribute('planner', 'actions', $this->get_actions()); |
|
| 490 | 490 | |
| 491 | 491 | $tmpl->exec(__METHOD__, $content); |
| 492 | 492 | } |
@@ -499,30 +499,30 @@ discard block |
||
| 499 | 499 | * @param int $weeks = 0 number of weeks to show, if 0 (default) all weeks of one month are shown |
| 500 | 500 | * @param boolean|etemplate2 $home = false if not false return content suitable for home-page |
| 501 | 501 | */ |
| 502 | - function &month($weeks=0,$home=false) |
|
| 502 | + function &month($weeks = 0, $home = false) |
|
| 503 | 503 | { |
| 504 | - if ($this->debug > 0) $this->bo->debug_message('uiviews::month(weeks=%1) date=%2',True,$weeks,$this->date); |
|
| 504 | + if ($this->debug > 0) $this->bo->debug_message('uiviews::month(weeks=%1) date=%2', True, $weeks, $this->date); |
|
| 505 | 505 | |
| 506 | 506 | if (!$home) |
| 507 | 507 | { |
| 508 | - trigger_error(__METHOD__ .' only used by home app', E_USER_DEPRECATED); |
|
| 508 | + trigger_error(__METHOD__.' only used by home app', E_USER_DEPRECATED); |
|
| 509 | 509 | return; |
| 510 | 510 | } |
| 511 | 511 | |
| 512 | - $this->use_time_grid = !$this->use_time_grid_pref || $this->use_time_grid_pref == 'all'; // all views |
|
| 512 | + $this->use_time_grid = !$this->use_time_grid_pref || $this->use_time_grid_pref == 'all'; // all views |
|
| 513 | 513 | $granularity = 0; |
| 514 | - if($weeks) |
|
| 514 | + if ($weeks) |
|
| 515 | 515 | { |
| 516 | 516 | $granularity = ($this->cal_prefs['interval'] ? (int)$this->cal_prefs['interval'] : 30); |
| 517 | 517 | |
| 518 | 518 | $list = $this->cal_prefs['use_time_grid']; |
| 519 | - if(!is_array($list)) |
|
| 519 | + if (!is_array($list)) |
|
| 520 | 520 | { |
| 521 | - $list = explode(',',$list); |
|
| 521 | + $list = explode(',', $list); |
|
| 522 | 522 | } |
| 523 | - if(is_array($list)) |
|
| 523 | + if (is_array($list)) |
|
| 524 | 524 | { |
| 525 | - $granularity = in_array('weekN',$list) ? 0 : $granularity; |
|
| 525 | + $granularity = in_array('weekN', $list) ? 0 : $granularity; |
|
| 526 | 526 | } |
| 527 | 527 | } |
| 528 | 528 | $content = array('view' => array()); |
@@ -532,23 +532,23 @@ discard block |
||
| 532 | 532 | $start = new Api\DateTime($this->date); |
| 533 | 533 | $start->setWeekstart(); |
| 534 | 534 | $this->first = $start->format('ts'); |
| 535 | - $this->last = strtotime("+$weeks weeks",$this->first) - 1; |
|
| 535 | + $this->last = strtotime("+$weeks weeks", $this->first) - 1; |
|
| 536 | 536 | $weekNavH = "$weeks weeks"; |
| 537 | 537 | $navHeader = lang('Week').' '.$this->week_number($this->first).' - '.$this->week_number($this->last).': '. |
| 538 | - $this->bo->long_date($this->first,$this->last); |
|
| 538 | + $this->bo->long_date($this->first, $this->last); |
|
| 539 | 539 | } |
| 540 | 540 | else |
| 541 | 541 | { |
| 542 | - $this->_week_align_month($this->first,$this->last); |
|
| 542 | + $this->_week_align_month($this->first, $this->last); |
|
| 543 | 543 | $weekNavH = "1 month"; |
| 544 | - $navHeader = lang(adodb_date('F',$this->bo->date2ts($this->date))).' '.$this->year; |
|
| 544 | + $navHeader = lang(adodb_date('F', $this->bo->date2ts($this->date))).' '.$this->year; |
|
| 545 | 545 | } |
| 546 | - if ($this->debug > 0) $this->bo->debug_message('uiviews::month(%1) date=%2: first=%3, last=%4',False,$weeks,$this->date,$this->bo->date2string($this->first),$this->bo->date2string($this->last)); |
|
| 546 | + if ($this->debug > 0) $this->bo->debug_message('uiviews::month(%1) date=%2: first=%3, last=%4', False, $weeks, $this->date, $this->bo->date2string($this->first), $this->bo->date2string($this->last)); |
|
| 547 | 547 | |
| 548 | 548 | // Loop through, using Api\DateTime to handle DST |
| 549 | 549 | $week = 0; |
| 550 | 550 | $week_start = new EGroupware\Api\DateTime($this->first); |
| 551 | - $week_start->setTime(0,0,0); |
|
| 551 | + $week_start->setTime(0, 0, 0); |
|
| 552 | 552 | $week_end = new Api\DateTime($week_start); |
| 553 | 553 | $week_end->add(new DateInterval('P6DT23H59M59S')); |
| 554 | 554 | $last = new EGroupware\Api\DateTime($this->last); |
@@ -562,14 +562,14 @@ discard block |
||
| 562 | 562 | array( |
| 563 | 563 | 'id' => $week_start->format('Ymd') |
| 564 | 564 | ); |
| 565 | - $home->setElementAttribute("view[$week]",'onchange',false); |
|
| 566 | - $home->setElementAttribute("view[$week]",'granularity',$granularity); |
|
| 567 | - $home->setElementAttribute("view[$week]",'show_weekend', $this->search_params['weekend']); |
|
| 565 | + $home->setElementAttribute("view[$week]", 'onchange', false); |
|
| 566 | + $home->setElementAttribute("view[$week]", 'granularity', $granularity); |
|
| 567 | + $home->setElementAttribute("view[$week]", 'show_weekend', $this->search_params['weekend']); |
|
| 568 | 568 | $week++; |
| 569 | 569 | } |
| 570 | 570 | |
| 571 | 571 | // Get the actions |
| 572 | - $home->setElementAttribute('view','actions',$this->get_actions()); |
|
| 572 | + $home->setElementAttribute('view', 'actions', $this->get_actions()); |
|
| 573 | 573 | |
| 574 | 574 | $home->exec(__METHOD__, $content); |
| 575 | 575 | } |
@@ -581,13 +581,13 @@ discard block |
||
| 581 | 581 | * @param int &$last timestamp 23:59:59 of last day of week containg the last day of the current month |
| 582 | 582 | * @param int $day = 1 should the alignment be based on the 1. of the month or an other date, eg. the 15. |
| 583 | 583 | */ |
| 584 | - function _week_align_month(&$first,&$last,$day=1) |
|
| 584 | + function _week_align_month(&$first, &$last, $day = 1) |
|
| 585 | 585 | { |
| 586 | 586 | $start = new Api\DateTime($this->date); |
| 587 | - $start->setDate($this->year,$this->month,$this->day=$day); |
|
| 587 | + $start->setDate($this->year, $this->month, $this->day = $day); |
|
| 588 | 588 | $start->setWeekstart(); |
| 589 | 589 | $first = $start->format('ts'); |
| 590 | - $start->setDate($this->year,$this->month+1,$day); |
|
| 590 | + $start->setDate($this->year, $this->month + 1, $day); |
|
| 591 | 591 | if ($day == 1) $start->add('-1day'); |
| 592 | 592 | $start->setWeekstart(); |
| 593 | 593 | // now we need to calculate the end of the last day of that week |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | $arr['day'] += 6; |
| 597 | 597 | $arr['hour'] = 23; |
| 598 | 598 | $arr['min'] = $arr['sec'] = 59; |
| 599 | - unset($arr['raw']); // otherwise date2ts does not calc raw new, but uses it |
|
| 599 | + unset($arr['raw']); // otherwise date2ts does not calc raw new, but uses it |
|
| 600 | 600 | $last = $this->bo->date2ts($arr); |
| 601 | 601 | } |
| 602 | 602 | |
@@ -606,7 +606,7 @@ discard block |
||
| 606 | 606 | * @param int $days = 0 number of days to show, if 0 (default) the value from the URL or the prefs is used |
| 607 | 607 | * @param boolean|etemplate2 $home = false if not false return content suitable for home-page |
| 608 | 608 | */ |
| 609 | - function week($days=0,$home=false) |
|
| 609 | + function week($days = 0, $home = false) |
|
| 610 | 610 | { |
| 611 | 611 | if (!$days) |
| 612 | 612 | { |
@@ -614,17 +614,17 @@ discard block |
||
| 614 | 614 | if ($days != 5) $days = 7; |
| 615 | 615 | if ($days != $this->cal_prefs['days_in_weekview']) // save the preference |
| 616 | 616 | { |
| 617 | - $GLOBALS['egw']->preferences->add('calendar','days_in_weekview',$days); |
|
| 617 | + $GLOBALS['egw']->preferences->add('calendar', 'days_in_weekview', $days); |
|
| 618 | 618 | $GLOBALS['egw']->preferences->save_repository(); |
| 619 | 619 | $this->cal_prefs['days_in_weekview'] = $days; |
| 620 | 620 | } |
| 621 | 621 | } |
| 622 | - if ($this->debug > 0) $this->bo->debug_message('uiviews::week(days=%1) date=%2',True,$days,$this->date); |
|
| 622 | + if ($this->debug > 0) $this->bo->debug_message('uiviews::week(days=%1) date=%2', True, $days, $this->date); |
|
| 623 | 623 | |
| 624 | 624 | if ($days <= 4) // next 4 days view |
| 625 | 625 | { |
| 626 | 626 | $wd_start = $this->first = $this->bo->date2ts($this->date); |
| 627 | - $this->last = strtotime("+$days days",$this->first) - 1; |
|
| 627 | + $this->last = strtotime("+$days days", $this->first) - 1; |
|
| 628 | 628 | $view = $days == 1 ? 'day' : 'day4'; |
| 629 | 629 | } |
| 630 | 630 | else |
@@ -634,30 +634,30 @@ discard block |
||
| 634 | 634 | $wd_start = $this->first = $start->format('ts'); |
| 635 | 635 | if ($days <= 5) // no weekend-days |
| 636 | 636 | { |
| 637 | - switch($this->cal_prefs['weekdaystarts']) |
|
| 637 | + switch ($this->cal_prefs['weekdaystarts']) |
|
| 638 | 638 | { |
| 639 | 639 | case 'Saturday': |
| 640 | - $this->first = strtotime("+2 days",$this->first); |
|
| 640 | + $this->first = strtotime("+2 days", $this->first); |
|
| 641 | 641 | break; |
| 642 | 642 | case 'Sunday': |
| 643 | - $this->first = strtotime("+1 day",$this->first); |
|
| 643 | + $this->first = strtotime("+1 day", $this->first); |
|
| 644 | 644 | break; |
| 645 | 645 | } |
| 646 | 646 | } |
| 647 | - $this->last = strtotime("+$days days",$this->first) - 1; |
|
| 647 | + $this->last = strtotime("+$days days", $this->first) - 1; |
|
| 648 | 648 | $view = 'week'; |
| 649 | 649 | } |
| 650 | 650 | |
| 651 | 651 | $granularity = ($this->cal_prefs['interval'] ? (int)$this->cal_prefs['interval'] : 30); |
| 652 | 652 | |
| 653 | 653 | $list = $this->cal_prefs['use_time_grid']; |
| 654 | - if(!is_array($list)) |
|
| 654 | + if (!is_array($list)) |
|
| 655 | 655 | { |
| 656 | - $list = explode(',',$list); |
|
| 656 | + $list = explode(',', $list); |
|
| 657 | 657 | } |
| 658 | - if(is_array($list)) |
|
| 658 | + if (is_array($list)) |
|
| 659 | 659 | { |
| 660 | - $granularity = in_array($view,$list) ? 0 : $granularity; |
|
| 660 | + $granularity = in_array($view, $list) ? 0 : $granularity; |
|
| 661 | 661 | } |
| 662 | 662 | |
| 663 | 663 | $search_params = array( |
@@ -670,15 +670,15 @@ discard block |
||
| 670 | 670 | |
| 671 | 671 | $content = array('view' => array()); |
| 672 | 672 | |
| 673 | - if(!$home) |
|
| 673 | + if (!$home) |
|
| 674 | 674 | { |
| 675 | 675 | // Fill with the minimum needed 'weeks' |
| 676 | 676 | $min = max( |
| 677 | 677 | 6, // Some months need 6 weeks for full display |
| 678 | - $this->cal_prefs['multiple_weeks'], // WeekN view |
|
| 678 | + $this->cal_prefs['multiple_weeks'], // WeekN view |
|
| 679 | 679 | $this->cal_prefs['week_consolidate'] // We collapse after this many users |
| 680 | 680 | ); |
| 681 | - for($i = 0; $i < $min; $i++) |
|
| 681 | + for ($i = 0; $i < $min; $i++) |
|
| 682 | 682 | { |
| 683 | 683 | $content['view'][] = array(); |
| 684 | 684 | } |
@@ -686,8 +686,8 @@ discard block |
||
| 686 | 686 | else |
| 687 | 687 | { |
| 688 | 688 | // Always do 7 days for a week so scrolling works properly |
| 689 | - $this->last = ($days == 4 ? $this->last : $search_params['end'] = strtotime("+$days days",$this->first) - 1); |
|
| 690 | - if (count($users) == 1 || count($users) >= $this->cal_prefs['week_consolidate'] ||// for more then X users, show all in one row |
|
| 689 | + $this->last = ($days == 4 ? $this->last : $search_params['end'] = strtotime("+$days days", $this->first) - 1); |
|
| 690 | + if (count($users) == 1 || count($users) >= $this->cal_prefs['week_consolidate'] || // for more then X users, show all in one row |
|
| 691 | 691 | $days == 1 // Showing just 1 day |
| 692 | 692 | ) |
| 693 | 693 | { |
@@ -696,7 +696,7 @@ discard block |
||
| 696 | 696 | } |
| 697 | 697 | else |
| 698 | 698 | { |
| 699 | - foreach(array_keys($this->_get_planner_users(false)) as $uid) |
|
| 699 | + foreach (array_keys($this->_get_planner_users(false)) as $uid) |
|
| 700 | 700 | { |
| 701 | 701 | $search_params['users'] = $uid; |
| 702 | 702 | $content['view'][] = $this->tagWholeDayOnTop($this->bo->search($search_params)) |
@@ -704,15 +704,15 @@ discard block |
||
| 704 | 704 | } |
| 705 | 705 | } |
| 706 | 706 | } |
| 707 | - $tmpl = $home ? $home :new Etemplate('calendar.view'); |
|
| 708 | - foreach(array_keys($content['view']) as $index) |
|
| 707 | + $tmpl = $home ? $home : new Etemplate('calendar.view'); |
|
| 708 | + foreach (array_keys($content['view']) as $index) |
|
| 709 | 709 | { |
| 710 | - $tmpl->setElementAttribute("view[$index]",'granularity',$granularity); |
|
| 711 | - $tmpl->setElementAttribute("view[$index]",'show_weekend',$this->search_params['weekend']); |
|
| 710 | + $tmpl->setElementAttribute("view[$index]", 'granularity', $granularity); |
|
| 711 | + $tmpl->setElementAttribute("view[$index]", 'show_weekend', $this->search_params['weekend']); |
|
| 712 | 712 | } |
| 713 | 713 | |
| 714 | 714 | // Get the actions |
| 715 | - $tmpl->setElementAttribute('view','actions',$this->get_actions()); |
|
| 715 | + $tmpl->setElementAttribute('view', 'actions', $this->get_actions()); |
|
| 716 | 716 | |
| 717 | 717 | $tmpl->exec(__METHOD__, $content); |
| 718 | 718 | } |
@@ -754,57 +754,56 @@ discard block |
||
| 754 | 754 | 'owner' => $this->owner // num. id of the user, not necessary current user |
| 755 | 755 | )); |
| 756 | 756 | |
| 757 | - if(is_array($todo_label)) |
|
| 757 | + if (is_array($todo_label)) |
|
| 758 | 758 | { |
| 759 | - list($label,$showall)=$todo_label; |
|
| 759 | + list($label, $showall) = $todo_label; |
|
| 760 | 760 | } |
| 761 | 761 | else |
| 762 | 762 | { |
| 763 | - $label=$todo_label; |
|
| 764 | - $showall=true; |
|
| 763 | + $label = $todo_label; |
|
| 764 | + $showall = true; |
|
| 765 | 765 | } |
| 766 | 766 | $maxshow = (int)$GLOBALS['egw_info']['user']['preferences']['infolog']['mainscreen_maxshow']; |
| 767 | - if($maxshow <= 0) |
|
| 767 | + if ($maxshow <= 0) |
|
| 768 | 768 | { |
| 769 | - $maxshow=10; |
|
| 769 | + $maxshow = 10; |
|
| 770 | 770 | } |
| 771 | 771 | //print_debug("get_todos(): label=$label; showall=$showall; max=$maxshow"); |
| 772 | 772 | |
| 773 | 773 | $content = $todo_label = ''; |
| 774 | 774 | if (is_array($todos_from_hook) && count($todos_from_hook)) |
| 775 | 775 | { |
| 776 | - foreach($todos_from_hook as $todos) |
|
| 776 | + foreach ($todos_from_hook as $todos) |
|
| 777 | 777 | { |
| 778 | 778 | $i = 0; |
| 779 | 779 | if (is_array($todos)) |
| 780 | 780 | { |
| 781 | 781 | $todo_label = !empty($label) ? $label : lang("open ToDo's:"); |
| 782 | 782 | |
| 783 | - foreach($todos as &$todo) |
|
| 783 | + foreach ($todos as &$todo) |
|
| 784 | 784 | { |
| 785 | - if(!$showall && ($i++ > $maxshow)) |
|
| 785 | + if (!$showall && ($i++ > $maxshow)) |
|
| 786 | 786 | { |
| 787 | 787 | break; |
| 788 | 788 | } |
| 789 | 789 | $icons = ''; |
| 790 | - foreach($todo['icons'] as $name => $alt) |
|
| 790 | + foreach ($todo['icons'] as $name => $alt) |
|
| 791 | 791 | { |
| 792 | - $icons .= ($icons?' ':'').Api\Html::image('infolog',$name,lang($alt),'border="0" width="15" height="15"'); |
|
| 792 | + $icons .= ($icons ? ' ' : '').Api\Html::image('infolog', $name, lang($alt), 'border="0" width="15" height="15"'); |
|
| 793 | 793 | } |
| 794 | 794 | $todo['icons'] = $icons; |
| 795 | 795 | $class = $class == 'row_on' ? 'row_off' : 'row_on'; |
| 796 | - if($todo['edit']) { |
|
| 796 | + if ($todo['edit']) { |
|
| 797 | 797 | $todo['edit_size'] = $todo['edit']['size']; |
| 798 | 798 | unset($todo['edit']['size']); |
| 799 | - $edit_icon_href = Api\Html::a_href( $icons, $todo['edit'],'',' data-todo="app|750x590" '); |
|
| 800 | - $edit_href = Api\Html::a_href( $todo['title'], $todo['edit'],'',' data-todo="app|750x590" '); |
|
| 801 | - $todo['edit'] = Framework::link('/index.php',$todo['edit'],true); |
|
| 799 | + $edit_icon_href = Api\Html::a_href($icons, $todo['edit'], '', ' data-todo="app|750x590" '); |
|
| 800 | + $edit_href = Api\Html::a_href($todo['title'], $todo['edit'], '', ' data-todo="app|750x590" '); |
|
| 801 | + $todo['edit'] = Framework::link('/index.php', $todo['edit'], true); |
|
| 802 | 802 | } |
| 803 | - $icon_href = Api\Html::a_href($icons,$todo['view']); |
|
| 803 | + $icon_href = Api\Html::a_href($icons, $todo['view']); |
|
| 804 | 804 | $content .= " <tr class=\"$class\">\n <td valign=\"top\" width=\"15%\" nowrap>". |
| 805 | - ($this->bo->printer_friendly?$icons:($edit_icon_href ? $edit_icon_href : $icon_href)). |
|
| 806 | - "</td>\n <td>".($this->printer_friendly?$todo['title']: |
|
| 807 | - $edit_href)."</td>\n </tr>\n"; |
|
| 805 | + ($this->bo->printer_friendly ? $icons : ($edit_icon_href ? $edit_icon_href : $icon_href)). |
|
| 806 | + "</td>\n <td>".($this->printer_friendly ? $todo['title'] : $edit_href)."</td>\n </tr>\n"; |
|
| 808 | 807 | /** |
| 809 | 808 | * ToDo: add delete and closing action |
| 810 | 809 | */ |
@@ -827,9 +826,9 @@ discard block |
||
| 827 | 826 | * @param int|string $id |
| 828 | 827 | * @return string |
| 829 | 828 | */ |
| 830 | - public static function integration_get_popup($app,$id) |
|
| 829 | + public static function integration_get_popup($app, $id) |
|
| 831 | 830 | { |
| 832 | - $app_data = calendar_bo::integration_get_data($app,'edit_link'); |
|
| 831 | + $app_data = calendar_bo::integration_get_data($app, 'edit_link'); |
|
| 833 | 832 | |
| 834 | 833 | if (is_array($app_data) && isset($app_data['edit'])) |
| 835 | 834 | { |
@@ -839,7 +838,7 @@ discard block |
||
| 839 | 838 | } |
| 840 | 839 | else |
| 841 | 840 | { |
| 842 | - $edit = Link::edit($app,$id,$popup_size); |
|
| 841 | + $edit = Link::edit($app, $id, $popup_size); |
|
| 843 | 842 | } |
| 844 | 843 | if ($edit) |
| 845 | 844 | { |
@@ -868,28 +867,28 @@ discard block |
||
| 868 | 867 | * @param array $event |
| 869 | 868 | * @return array |
| 870 | 869 | */ |
| 871 | - static function integration_get_icons($app,$id,$event) |
|
| 870 | + static function integration_get_icons($app, $id, $event) |
|
| 872 | 871 | { |
| 873 | 872 | $icons = array(); |
| 874 | 873 | if ($event['icons']) |
| 875 | 874 | { |
| 876 | - foreach(explode(',',$event['icons']) as $icon) |
|
| 875 | + foreach (explode(',', $event['icons']) as $icon) |
|
| 877 | 876 | { |
| 878 | - list($icon_app,$icon) = explode(':',$icon); |
|
| 879 | - if (Api\Image::find($icon_app,$icon)) |
|
| 877 | + list($icon_app, $icon) = explode(':', $icon); |
|
| 878 | + if (Api\Image::find($icon_app, $icon)) |
|
| 880 | 879 | { |
| 881 | - $icons[] = Api\Html::image($icon_app,$icon); |
|
| 880 | + $icons[] = Api\Html::image($icon_app, $icon); |
|
| 882 | 881 | } |
| 883 | 882 | } |
| 884 | 883 | } |
| 885 | - $app_data = calendar_bo::integration_get_data($app,'icons'); |
|
| 884 | + $app_data = calendar_bo::integration_get_data($app, 'icons'); |
|
| 886 | 885 | if (is_null($app_data)) |
| 887 | 886 | { |
| 888 | - $icons[] = Api\Html::image($app,'navbar'); // use navbar icon |
|
| 887 | + $icons[] = Api\Html::image($app, 'navbar'); // use navbar icon |
|
| 889 | 888 | } |
| 890 | 889 | elseif ($app_data) |
| 891 | 890 | { |
| 892 | - $icons += (array)ExecMethod2($app_data,$id,$event); |
|
| 891 | + $icons += (array)ExecMethod2($app_data, $id, $event); |
|
| 893 | 892 | } |
| 894 | 893 | return $icons; |
| 895 | 894 | } |
@@ -912,20 +911,20 @@ discard block |
||
| 912 | 911 | unset($actions['select_all']); |
| 913 | 912 | |
| 914 | 913 | // This disables the event actions for the grid rows (calendar weeks/owners) |
| 915 | - foreach($actions as $id => &$action) |
|
| 914 | + foreach ($actions as $id => &$action) |
|
| 916 | 915 | { |
| 917 | - if($id=='add') continue; |
|
| 918 | - if(!$action['enabled']) |
|
| 916 | + if ($id == 'add') continue; |
|
| 917 | + if (!$action['enabled']) |
|
| 919 | 918 | { |
| 920 | 919 | $action['enabled'] = 'javaScript:app.calendar.is_event'; |
| 921 | 920 | } |
| 922 | 921 | } |
| 923 | 922 | $actions['add']['open'] = '{"app":"calendar","type":"add"}'; |
| 924 | - $actions['add']['onExecute'] = 'javaScript:app.calendar.action_open'; |
|
| 923 | + $actions['add']['onExecute'] = 'javaScript:app.calendar.action_open'; |
|
| 925 | 924 | $actions['copy']['open'] = '{"app": "calendar", "type": "add", "extra": "cal_id=$id&action=copy"}'; |
| 926 | 925 | $actions['copy']['onExecute'] = 'javaScript:app.calendar.action_open'; |
| 927 | 926 | |
| 928 | - foreach($actions['status']['children'] as $id => &$status) |
|
| 927 | + foreach ($actions['status']['children'] as $id => &$status) |
|
| 929 | 928 | { |
| 930 | 929 | $status = array( |
| 931 | 930 | 'id' => $id, |
@@ -936,7 +935,7 @@ discard block |
||
| 936 | 935 | |
| 937 | 936 | if ($actions['filemanager']) |
| 938 | 937 | { |
| 939 | - $actions['filemanager']['url'] = '/index.php?'. $actions['filemanager']['url']; |
|
| 938 | + $actions['filemanager']['url'] = '/index.php?'.$actions['filemanager']['url']; |
|
| 940 | 939 | $actions['filemanager']['onExecute'] = 'javaScript:app.calendar.action_open'; |
| 941 | 940 | } |
| 942 | 941 | if ($actions['infolog_app']) |
@@ -981,26 +980,26 @@ discard block |
||
| 981 | 980 | { |
| 982 | 981 | $start = $this->bo->date2array($event['start']); |
| 983 | 982 | $end = $this->bo->date2array($event['end']); |
| 984 | - if(!$start['hour'] && !$start['minute'] && $end['hour'] == 23 && $end['minute'] == 59) |
|
| 983 | + if (!$start['hour'] && !$start['minute'] && $end['hour'] == 23 && $end['minute'] == 59) |
|
| 985 | 984 | { |
| 986 | - if($event['non_blocking']) |
|
| 985 | + if ($event['non_blocking']) |
|
| 987 | 986 | { |
| 988 | - $dayEvents[$day][$num]['whole_day_on_top']=true; |
|
| 989 | - $this->whole_day_positions[$num]=($this->rowHeight*($num+2)); |
|
| 987 | + $dayEvents[$day][$num]['whole_day_on_top'] = true; |
|
| 988 | + $this->whole_day_positions[$num] = ($this->rowHeight * ($num + 2)); |
|
| 990 | 989 | $extraRowsToAdd++; |
| 991 | 990 | } |
| 992 | 991 | else |
| 993 | 992 | { |
| 994 | - $dayEvents[$day][$num]['whole_day']=true; |
|
| 993 | + $dayEvents[$day][$num]['whole_day'] = true; |
|
| 995 | 994 | } |
| 996 | 995 | } |
| 997 | 996 | $this->to_client($dayEvents[$day][$num]); |
| 998 | 997 | } |
| 999 | 998 | // check after every day if we have to increase $this->extraRows |
| 1000 | - if(($this->extraRowsOriginal+$extraRowsToAdd) > $this->extraRows) |
|
| 999 | + if (($this->extraRowsOriginal + $extraRowsToAdd) > $this->extraRows) |
|
| 1001 | 1000 | { |
| 1002 | 1001 | $this->remBotExtraRows = $extraRowsToAdd; |
| 1003 | - $this->extraRows = ($this->extraRowsOriginal+$extraRowsToAdd); |
|
| 1002 | + $this->extraRows = ($this->extraRowsOriginal + $extraRowsToAdd); |
|
| 1004 | 1003 | } |
| 1005 | 1004 | } |
| 1006 | 1005 | } |