Changeset 2843
- Timestamp:
- 01/08/12 07:58:06 (4 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 modified
-
base/scripts/upgrade-v0.19.sql (modified) (1 diff)
-
lib/phpcommon/racesiterators.class.php (modified) (4 diffs)
-
site/admin/index.php (modified) (1 diff)
-
site/admin/races_instructions.php (modified) (1 diff)
-
site/admin/racespreview.php (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/base/scripts/upgrade-v0.19.sql
r2842 r2843 1 1 #Creation de la table racespreview 2 DROP TABLE IF EXISTS `race preview`;2 DROP TABLE IF EXISTS `racespreview`; 3 3 CREATE TABLE `racespreview` ( 4 4 `idracespreview` int(11) NOT NULL auto_increment, -
trunk/lib/phpcommon/racesiterators.class.php
r2439 r2843 26 26 27 27 function __construct() { 28 $this->query = " SELECT *FROM `races` ".28 $this->query = "(SELECT deptime, closetime, racename, racename as description, boattype, idraces FROM `races` ". 29 29 "WHERE ( ( started = ". RACE_PENDING ." AND deptime > UNIX_TIMESTAMP() ) OR ( closetime > UNIX_TIMESTAMP() ) ) ". 30 "AND !(racetype & ".RACE_TYPE_RECORD. ") ORDER BY started ASC, deptime ASC, closetime ASC " ; 30 "AND !(racetype & ".RACE_TYPE_RECORD. ") ORDER BY started ASC, deptime ASC, closetime ASC ) ". 31 "UNION ( SELECT deptime, deptime+3600 as closetime, racename, comments as description, NULL as boattype, NULL as idraces ". 32 "FROM `racespreview` ". 33 "WHERE deptime > UNIX_TIMESTAMP() )"; 31 34 parent::__construct(); 32 35 } … … 49 52 $vevent->setProperty( 'dtend', array('timestamp' => $row['closetime']) ); 50 53 $vevent->setProperty( 'summary', html_entity_decode($row['racename'], ENT_COMPAT, "UTF-8") ); 51 $vevent->setProperty( 'description', html_entity_decode($row['racename'], ENT_COMPAT, "UTF-8")." ( ".substr($row['boattype'], 5 )." ) " ); 54 if (!is_null($row['boattype'])) { 55 $vevent->setProperty( 'description', html_entity_decode($row['racename'], ENT_COMPAT, "UTF-8")." ( ".substr($row['boattype'], 5 )." ) " ); 56 } else { 57 $vevent->setProperty( 'description', html_entity_decode($row['description'], ENT_COMPAT, "UTF-8") ); 58 } 52 59 //FIXME: construction de l'url ??? 53 $vevent->setProperty( 'url', sprintf("http://%s/ics.php?idraces=%d", $_SERVER['SERVER_NAME'], $row['idraces'])); 60 if (!is_null($row['idraces'])) { 61 $vevent->setProperty( 'url', sprintf("http://%s/ics.php?idraces=%d", $_SERVER['SERVER_NAME'], $row['idraces'])); 62 } 54 63 $this->icalobject->setComponent ( $vevent ); // add event to calendar 55 64 } … … 65 74 66 75 function __construct() { 67 $this->query = " SELECT * FROM races".76 $this->query = "(SELECT deptime, closetime, racename, racename as description, boattype, idraces FROM `races` ". 68 77 " WHERE ( deptime > (UNIX_TIMESTAMP()-2592000 ) ) AND !(racetype & ".RACE_TYPE_RECORD.") ". 69 " ORDER BY started ASC, deptime ASC, closetime ASC "; 78 " ORDER BY started ASC, deptime ASC, closetime ASC ) ". 79 "UNION ( SELECT deptime, NULL as closetime, racename, comments as description, NULL as boattype, NULL as idraces ". 80 "FROM `racespreview` ". 81 "WHERE deptime > UNIX_TIMESTAMP() )"; 82 83 ; 70 84 parent::__construct(); 71 85 } … … 80 94 $jsonarray['end'] = $row['closetime']; 81 95 $jsonarray['title'] = html_entity_decode($row['racename'], ENT_COMPAT, "UTF-8"); 82 $jsonarray['allDay'] = False;83 $jsonarray['url'] = sprintf("http://%s/ics.php?idraces=%d", $_SERVER['SERVER_NAME'], $row['idraces']);96 $jsonarray['allDay'] = is_null($row['closetime']); 97 if (!is_null($row['idraces'])) $jsonarray['url'] = sprintf("http://%s/ics.php?idraces=%d", $_SERVER['SERVER_NAME'], $row['idraces']); 84 98 $this->jsonarray[] = $jsonarray; 85 99 } -
trunk/site/admin/index.php
r2540 r2843 34 34 35 35 $tablepages = Array( 36 "racespreview.php" => "Incoming Races - Calendar Management", 36 37 "races_instructions.php" => "Races instructions", 37 38 "races.php" => "Races definitions (no uploading, see below)", -
trunk/site/admin/races_instructions.php
r2638 r2843 20 20 21 21 $opts['fdd']['autoid'] = array( 22 'help' => 'Unique id of the race ',22 'help' => 'Unique id of the race instruction', 23 23 'select' => 'T', 24 24 'input' => 'R',
