Changeset 142
- Timestamp:
- Jan 26, 2007 3:48:17 PM (6 years ago)
- Location:
- trunk/jpdd
- Files:
-
- 3 edited
-
class.jpdd.php (modified) (3 diffs)
-
class.jpdd.workshop.php (modified) (1 diff)
-
web/jpdd.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/jpdd/class.jpdd.php
r140 r142 55 55 56 56 if ($this->isAuthenticated()) { 57 if ($this->_authenticated_user->hasAnyOfThesePrivileges('Update Workshops')) 57 if ($this->_authenticated_user->hasAnyOfThesePrivileges('Update Workshops')) { 58 58 $links['Workshops'] = 'workshop'; 59 $links['Review Signups'] = 'attendance'; 60 } 59 61 if ($this->_authenticated_user->hasAnyOfThesePrivileges('List People')) 60 62 $links['People'] = 'person'; … … 109 111 110 112 function getAllowedActions() { 111 return array_merge(parent::getAllowedActions(), array('signup', 'printout')); 112 } 113 113 return array_merge(parent::getAllowedActions(), array('signup', 'printout', 'attendance')); 114 } 115 116 117 function getWorkshopOverviewWithAttendence() { 118 return '<table><tr><th>workshop</th><th>max</th><th>min</th><th>total</th><th>by school</th></tr>'."\n<tbody>\n". 119 join('', array_map(create_function('$w', 'return $w->getOverviewRowWithAttendence();'), $this->getAll('workshop'))). 120 '</tbody></table>'."\n"; 121 } 114 122 115 123 function handleSignup() { … … 184 192 $pdf->Output($pdfname, 'I'); 185 193 } 186 } 194 } elseif ($this->_action = 'attendance') { 195 if ($this->isAuthenticated() && $this->_authenticated_user->hasAnyOfThesePrivileges('Update Workshops')) 196 return $this->getWorkshopOverviewWithAttendence(); 197 else 198 $this->permissionDenied('You are not authorized to view this overview.'); 199 } 187 200 return parent::getMainContentExtended(); 188 201 } -
trunk/jpdd/class.jpdd.workshop.php
r139 r142 138 138 } 139 139 140 function getAudienceListBySchoolCount() { 141 global $jpdd; 142 $sql = 'SELECT organization.id, MAX(organization.title) AS title, COUNT(*) AS count FROM audience LEFT JOIN affiliation ON (audience.person_id = affiliation.person_id) LEFT JOIN organization ON (affiliation.organization_id = organization.id) WHERE workshop_id = '.$this->getID().' GROUP BY organization.id ORDER BY MAX(organization.title)'; 143 $x = $jpdd->getSeriesFromSQL($sql); 144 // FIXME: link these schools! 145 return "<ul>\n".join('', array_map(create_function('$x', 'return "<li>".(int)$x["count"]." ".(is_null($x["title"]) ? "unaffiliated" : " from ".htmlentities($x["title"]));'), $x))."</ul>\n"; 146 } 147 148 function getOverviewRowWithAttendence() { 149 return '<tr><td>'.$this->getLinkedTitle().$this->getPresentersWithOrgs().'</td>'. 150 '<td class="attendance">'.(int)$this->_max_attendees.'</td>'. 151 '<td class="attendance">'.(int)$this->_min_attendees.'</td>'. 152 '<td class="attendance">'.$this->getAudienceCount().'</td>'. 153 '<td>'.$this->getAudienceListBySchoolCount().'</td></tr>'."\n"; 154 } 155 140 156 function getDetailTopInnards() { 141 157 return $this->getPresentersWithOrgs(); -
trunk/jpdd/web/jpdd.css
r141 r142 150 150 } 151 151 152 153 table { 154 border: thin solid black; 155 } 156 157 td { 158 border: thin solid black; 159 } 160 161 td.attendance { 162 text-align: center; 163 } 164 152 165 @media print { 153 166
Note: See TracChangeset
for help on using the changeset viewer.

