Changeset 141

Show
Ignore:
Timestamp:
10/12/08 23:12:46 (7 weeks ago)
Author:
amp4ecs
Message:

Fix wrong width of time slot if one slot in a row is missing.
Fixed wrong sorting of rooms in time slot view.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pi1/class.tx_wseevents_pi1.php

    r137 r141  
    33*  Copyright notice 
    44* 
    5 *  (c) 2007 Michael Oehlhof <typo3@oehlhof.de> 
     5*  (c) 2007-2008 Michael Oehlhof <typo3@oehlhof.de> 
    66*  All rights reserved 
    77* 
     
    703703                } 
    704704 
     705                # Check for given width of event titles 
     706                $teaserwidth = $conf['listTimeslotView.']['teaserWidth']; 
     707                if (empty($teaserwidth)) { 
     708                        $teaserwidth = 0; 
     709                } 
     710 
    705711                # For debugging output used in development 
    706712                $showdebug = $conf['listTimeslotView.']['debug']; 
     
    730736                } 
    731737                $template['titlerow']       = $this->cObj->getSubpart($template['total'],     '###TITLEROW###'); 
     738                $template['select']         = $this->cObj->getSubpart($template['titlerow'],  '###SELECT###'); 
     739                $template['titlecol']       = $this->cObj->getSubpart($template['titlerow'],  '###TITLECOLUMN###'); 
    732740                $template['evtsection']     = $this->cObj->getSubpart($template['total'],     '###EVENTSELECT###'); 
    733741                $template['evtselect']      = $this->cObj->getSubpart($template['evtsection'],'###SELECT###'); 
    734742                $template['evtoption']      = $this->cObj->getSubpart($template['evtselect'], '###OPTIONNOTSELECTED###'); 
    735743                $template['evtoptionsel']   = $this->cObj->getSubpart($template['evtselect'], '###OPTIONSELECTED###'); 
    736                 $template['select']         = $this->cObj->getSubpart($template['titlerow'],  '###SELECT###'); 
    737744                $template['option']         = $this->cObj->getSubpart($template['select'],    '###OPTIONNOTSELECTED###'); 
    738745                $template['optionsel']      = $this->cObj->getSubpart($template['select'],    '###OPTIONSELECTED###'); 
    739                 $template['titlecol']       = $this->cObj->getSubpart($template['titlerow'],  '###TITLECOLUMN###'); 
    740746                $template['headerrow']      = $this->cObj->getSubpart($template['total'],     '###HEADERROW###'); 
    741747                $template['headercol']      = $this->cObj->getSubpart($template['headerrow'], '###HEADERCOLUMN###'); 
     
    951957                                                if ($showdebugsql==1) { echo '<br>getSlot:'.$showevent.', '.$d.', '.$rooms[$r]['uid'].', '.$s.'<br>'; }; 
    952958                                                $slot_id = $this->getSlot($showevent, $d, $rooms[$r]['uid'], $s, $showdebugsql); 
    953                                                 if (empty($slot_id) && !$allrooms) { 
     959                                                if ($r==1 && empty($slot_id) && !$allrooms) { 
    954960                                                        // Check if a slot is assigned for all rooms 
    955961                                                        if ($showdebugsql==1) { echo 'getSlot:'.$showevent.', '.$d.', 0, '.$s.'<br>'; }; 
     
    984990                                                                $markerArray['###SLOTLINKNAME###'] = $sessionlinkname; 
    985991                                                                $markerArray['###SLOTSESSION###'] = $sessiondata['catnum']; 
    986                                                                 $markerArray['###SLOTTEASER###'] = $sessiondata['teaser']; 
     992                                                                # Cut teaser if longer than max teaser width 
     993                                                                if ($teaserwidth > 0) { 
     994                                                                        $markerArray['###SLOTTEASER###'] = substr($sessiondata['teaser'], 0, $teaserwidth).'...'; 
     995                                                                } else { 
     996                                                                        $markerArray['###SLOTTEASER###'] = $sessiondata['teaser']; 
     997                                                                } 
     998                                                                # Get speaker list of session 
     999                                                                $markerArray['###SLOTSPEAKER###'] = $this->getSpeakerNames($sessiondata['speaker']); 
    9871000                                                        } else { 
    9881001                                                                $markerArray = array(); 
     
    9911004                                                                        $markerArray['###SLOTSESSION###'] = $this->pi_getLL('tx_wseevents_sessions.slot_notassigned'); 
    9921005                                                                        $markerArray['###SLOTTEASER###'] = $this->pi_getLL('tx_wseevents_sessions.slot_notassigned'); 
     1006                                                                        $markerArray['###SLOTSPEAKER###'] = ''; 
    9931007                                                                } else { 
    9941008                                                                        $markerArray['###SLOTNAME###'] = ''; 
    9951009                                                                        $markerArray['###SLOTSESSION###'] = ''; 
    9961010                                                                        $markerArray['###SLOTTEASER###'] = ''; 
     1011                                                                        $markerArray['###SLOTSPEAKER###'] = ''; 
    9971012                                                                } 
    9981013                                                                $markerArray['###SLOTCATEGORY###'] = 0; 
     
    15751590                                $data = $this->pi_getRecord('static_countries',$this->internal['currentRow'][$fN]); 
    15761591                                $iso = $data['cn_iso_3']; 
    1577                                 return $this->staticInfo->getStaticInfoName('COUNTRIES', $iso); 
     1592                                return $this->staticInfo->getStaticInfoName('COUNTRIES', $iso);//.':'.$iso.':'.$this->staticInfo->getCurrentLanguage(); 
    15781593                        break; 
    15791594 
     
    17731788                $where = 'sys_language_uid=0 AND location='.$loc_id.$this->cObj->enableFields('tx_wseevents_rooms'); 
    17741789                $this->conf['pidList'] = $eventPid; 
    1775                 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,name,comment,seats', 'tx_wseevents_rooms', $where); 
     1790                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,name,comment,seats,number', 'tx_wseevents_rooms', $where, 'number'); 
    17761791                $id = 1; 
    17771792                while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { 
     
    17941809        function getSlot($event, $day, $room, $slot, $showdbgsql) { 
    17951810                $where = 'event='.$event.' AND eventday='.$day.' AND room='.$room.' AND begin='.$slot.$this->cObj->enableFields('tx_wseevents_timeslots'); 
    1796                 $this->conf['pidList'] = $eventPid; 
     1811//              $this->conf['pidList'] = $eventPid; 
    17971812                if ($showdbgsql==1) { echo 'getSlot where:'.$where.'<br>'; }; 
    17981813                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'tx_wseevents_timeslots', $where); 
     
    18331848                $where = 'sys_language_uid=0'.$this->cObj->enableFields('tx_wseevents_sessions'); 
    18341849                $this->conf['pidList'] = $eventPid; 
    1835                 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,name,category,number,teaser,timeslots', 'tx_wseevents_sessions', $where); 
     1850                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,name,category,number,teaser,timeslots,speaker', 'tx_wseevents_sessions', $where); 
    18361851                while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { 
    18371852//                      foreach(explode(',',$row['timeslots']) as $k){ 
     
    18511866        } 
    18521867 
     1868 
     1869 
     1870 
     1871        /** 
     1872         * Get speaker names for a list of speaker id's 
     1873         * 
     1874         * @param       integer         $speakerlist: list of speaker id's 
     1875         * @return      string          string with list of speakers 
     1876         */ 
     1877        function getSpeakerNames($speakerlist) { 
     1878                foreach(explode(',',$speakerlist) as $k){ 
     1879                        $data = $this->pi_getRecord('tx_wseevents_speakers',$k); 
     1880                        // Get the name and firstname 
     1881                        if (!empty($data['firstname'])) { 
     1882                                if (((isset($this->conf['lastnameFirst']))) && ($this->conf['lastnameFirst']==1)) { 
     1883                                        $speakername =  $data['name'].', '.$data['firstname']; 
     1884                                } else { 
     1885                                        $speakername =  $data['firstname'].' '.$data['name']; 
     1886                                } 
     1887                        } else { 
     1888                                $speakername =  $data['name']; 
     1889                        } 
     1890                        if (isset($content)) { 
     1891                                $content .= $this->internal['speakerdelimiter'].$speakername; 
     1892                        } else { 
     1893                                $content = $speakername; 
     1894                        } 
     1895                } 
     1896                if (empty($content)) { 
     1897                        $content = $this->pi_getLL('tx_wseevents_sessions.nospeakers','[no speaker assigned]'); 
     1898                } 
     1899                return $content; 
     1900        } 
     1901 
    18531902} 
    18541903