Changeset 5741
- Timestamp:
- 03/16/12 15:02:14 (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoCalendar/setup/setup.inc.php
r5715 r5741 13 13 $setup_info['expressoCalendar']['title'] = 'Expresso Calendar'; 14 14 /* Ao incrementar versão, não esquecer de declarar função do tables_update.inc.php*/ 15 $setup_info['expressoCalendar']['version'] = '1.00 2';15 $setup_info['expressoCalendar']['version'] = '1.003'; 16 16 $setup_info['expressoCalendar']['app_order'] = 10; 17 17 -
trunk/expressoCalendar/setup/tables_current.inc.php
r5715 r5741 229 229 'bysetpos' => array( 'type' => 'varchar','precision' => '50', 'nullable' => True), 230 230 'wkst' => array( 'type' => 'varchar','precision' => '50', 'nullable' => True), 231 'exceptions' => array( 'type' => 'varchar','precision' => '50', 'nullable' => True), 231 232 'interval' => array( 'type' => 'int', 'precision' => '8', 'nullable' => True) 232 233 ), … … 254 255 'id' => array( 'type' => 'auto', 'nullable' => False), 255 256 'occurrence' => array( 'type' => 'bigint','precision' => '16', 'nullable' => False), 256 'repeat_id' => array( 'type' => 'int', 'precision' => '8', 'nullable' => False) 257 'exception' => array( 'type' => 'smallint','precision' => '1', 'nullable' => False), 258 'repeat_id' => array( 'type' => 'int', 'precision' => '8', 'nullable' => False) 257 259 ), 258 260 -
trunk/expressoCalendar/setup/tables_update.inc.php
r5715 r5741 70 70 ); 71 71 72 $oProc->query("ALTER TABLE calendar_ repeat_occurrence ADD CONSTRAINT fk_calendar_repeat_to_calendar_repeat_occurrence FOREIGN KEY (repeat_id) REFERENCES calendar_repeat (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE;");72 $oProc->query("ALTER TABLE calendar_participant ADD COLUMN receive_notification smallint not null DEFAULT 1 "); 73 73 74 74 $GLOBALS['setup_info']['expressoCalendar']['currentver'] = '1.002'; 75 75 return $GLOBALS['setup_info']['expressoCalendar']['currentver']; 76 76 } 77 78 $test[] = '1.002'; 79 function expressoCalendar_upgrade1_002() { 80 81 $oProc = $GLOBALS['phpgw_setup']->oProc; 82 83 $oProc->query("ALTER TABLE calendar_repeat_occurrence ADD COLUMN exception smallint DEFAULT 0;"); 84 85 $GLOBALS['setup_info']['expressoCalendar']['currentver'] = '1.003'; 86 return $GLOBALS['setup_info']['expressoCalendar']['currentver']; 87 } 77 88 ?> -
trunk/prototype/config/repeatOccurrence.ini
r5715 r5741 8 8 occurrence = occurrence 9 9 repeat = repeat_id 10 exception = exception 10 11 id = id -
trunk/prototype/modules/calendar/interceptors/DBMapping.php
r5737 r5741 120 120 121 121 $params = Controller::service('PostgreSQL')->execResultSql($sql); 122 123 $params = array_merge( $params, $occ ); 122 124 $params = self::deepnessFindEvent( &$uri , &$params , &$criteria , $original); 123 124 $params = array_merge( $params, $occ );125 125 126 126 return false; … … 166 166 unset( $repeat['id'] ); 167 167 168 $params = self::decodeRepeat( $repeat, $ranges[0]['rangeStart'], $ranges[0]['rangeEnd'] ); 168 $exceptions = array(); 169 170 if( isset( $repeat['exceptions'] ) ) 171 { 172 $exceptions = explode( ',', $repeat['exceptions'] ); 173 unset( $repeat['exceptions'] ); 174 } 175 176 $params = array_diff( self::decodeRepeat( $repeat, $ranges[0]['rangeStart'], $ranges[0]['rangeEnd'] ), $exceptions ); 169 177 170 178 Controller::delete( array( 'concept' => 'repeatOccurrence' ), false, array( 'filter' => array( '=', 'repeat', $id ) ) ); 171 179 172 180 if( !empty($params) ) 173 Controller::service('PostgreSQL')->execResultSql( "INSERT INTO calendar_repeat_occurrence(repeat_id, occurrence)VALUES('".$id."', '".implode( "'),('".$id."','", $params )."')");181 Controller::service('PostgreSQL')->execResultSql( "INSERT INTO calendar_repeat_occurrence(repeat_id,exception,occurrence)VALUES('".$id."','0','".implode( "'),('".$id."','0','", $params )."')".( empty($exceptions) ? "" : ",('".$id."','1','".implode( "'),('".$id."','0','", $exceptions )."')" ) ); 174 182 175 183 } … … 244 252 } 245 253 246 $return = Controller::find( array( 'concept' => 'repeatOccurrence' ), false, array( 'filter' => array( 'AND', array( '>=', 'occurrence', $origStart ), array( '<=', 'occurrence', $origEnd ), array( 'IN', 'repeat', $ids ) ), 'deepness' => $deep ) ); 254 // $return = Controller::find( array( 'concept' => 'repeatOccurrence' ), false, array( 'filter' => array( 'AND', array( '>=', 'occurrence', $origStart ), array( '<=', 'occurrence', $origEnd ), array( 'IN', 'repeat', $ids ) ), 'deepness' => $deep ) ); 255 256 $return = Controller::service('PostgreSQL')->execResultSql( 'SELECT calendar_repeat_occurrence.occurrence as "occurrence", calendar_repeat.object_id as "schedulable" FROM calendar_repeat, calendar_repeat_occurrence WHERE calendar_repeat_occurrence.occurrence >= \''.$origStart.'\' AND calendar_repeat_occurrence.occurrence <= \''.$origEnd.'\' AND calendar_repeat_occurrence.repeat_id IN (\''.implode( '\',\'', $ids ).'\') AND calendar_repeat.id = calendar_repeat_occurrence.repeat_id AND calendar_repeat_occurrence.exception != 1' ); 247 257 248 258 if( !is_array( $return ) ) … … 254 264 foreach( $return as $ret ) 255 265 { 256 $currentId = $ret[' repeat']['schedulable']['id'];266 $currentId = $ret['schedulable']; 257 267 258 268 if( !isset( $result[ $currentId ] ) ) 259 269 { 260 $result[ $currentId ] = $ret['repeat']['schedulable']; 261 $result[ $currentId ]['repeat']['schedulable'] = $currentId; 262 270 $result[ $currentId ] = Controller::read( array( 'concept' => 'schedulable', 'id' => $currentId ) ); 263 271 $result[ $currentId ][ 'occurrences' ] = array(); 264 272 265 273 $calendarToCalendarObj = self::schedulable2calendarToObject( $currentId ); 266 267 $result[ $currentId ]['calendar'] = $calendarToCalendarObj[0]['calendar_id']; 274 $result[ $currentId ]['calendar'] = $calendarToCalendarObj[0]['calendar_id']; 268 275 } 269 276 … … 527 534 $repeat = Controller::find( array( 'concept' => 'repeat' ), false, array( 'filter' => array( '=', 'schedulable', $v['id'] ) ) ); 528 535 536 unset( $result[$i]['repeat'] ); 537 529 538 if( is_array($repeat) ) 530 539 $result[$i]['repeat'] = $repeat[0];
Note: See TracChangeset
for help on using the changeset viewer.