Changeset 1383


Ignore:
Timestamp:
Jan 9, 2013, 2:59:36 AM (5 years ago)
Author:
dkg
Message:

modified organization view

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/jpdd/class.jpdd.organization.php

    r1375 r1383  
    5050    }
    5151
    52     # try to add a richtext editor for this form, since it has a description:
     52    // try to add a richtext editor for this form, since it has a description:
    5353    function getFormInnards() {
    5454      global $jpdd;
     
    171171    function getLiaisonForm() {
    172172      global $jpdd;
     173
     174      $requirements = $jpdd->getSeriesFromSQL('SELECT category.*, minimum, maximum FROM attendance_requirements JOIN category ON (category.id = category_id) WHERE event_id = '.$jpdd->getActiveEventID().' ORDER BY minimum DESC', 'JPDD_Category');
     175     
     176      if (count($requirements) == 0) {
     177       
     178      }
    173179     
    174180      // this is gonna require the interface js libraries:
     
    194200      // get the per-category requirements for this event:
    195201      $jpdd->prepClass('category');
    196       $requirements = $jpdd->getSeriesFromSQL('SELECT category.*, minimum, maximum FROM attendance_requirements JOIN category ON (category.id = category_id) WHERE event_id = '.$jpdd->getActiveEventID().' ORDER BY minimum DESC', 'JPDD_Category');
    197202
    198203      $ret = '<div class="instructions">Please sign up teachers from your school by clicking and dragging their names to the appropriate subject areas on the left.<br/>'.
     
    347352      // FIXME: maybe show all affiliated people?
    348353      if ($jpdd->isAuthenticated() && $jpdd->_authenticated_user->hasAllOfThesePrivileges('List People')) {
    349         $peops = $this->getM2MPeers('person', 'affiliation');
    350 
    351         // show people with specific roles for this conference:
    352         $roles = $jpdd->getKeyValuePairsFromSQL('SELECT person_id, role.title AS title FROM person_role JOIN role ON (role_id = role.id)
    353 WHERE event_id = '.$jpdd->getActiveEventID().' AND organization_id = '.$this->getID(), 'person_id', 'title');
    354         $applications = $jpdd->getKeyValuePairsFromSQL('SELECT person_id, category.title AS title FROM application JOIN
     354        $ret .= $this->getListOfPeopleForConference($jpdd->getActiveEventID());
     355      }
     356      return $ret;
     357    }
     358
     359    function getListOfPeopleForEvent($event) {
     360      global $jpdd;
     361      $ret = '';
     362      $event = (int)$event;
     363
     364      $peops = $this->getM2MPeers('person', 'affiliation');
     365
     366      // show people with specific roles for this conference:
     367      $roles = $jpdd->getKeyValuePairsFromSQL('SELECT person_id, role.title AS title FROM person_role JOIN role ON (role_id = role.id)
     368WHERE event_id = '.$event.' AND organization_id = '.$this->getID(), 'person_id', 'title');
     369      $applications = $jpdd->getKeyValuePairsFromSQL('SELECT person_id, category.title AS title FROM application JOIN
    355370category ON (category_id = category.id) JOIN affiliation USING (person_id) WHERE event_id = '.$jpdd->getActiveEventID().' AND organization_id = '.$this->getID(), 'person_id', 'title');
    356371
    357         $ret .= '<h3>'.count($peops).(count($peops) == 1 ? ' Affiliated Person' : ' Affiliated People').'</h3><ul>'."\n";
    358         reset($peops);
    359         while(list(,$x) = each($peops))
    360           $ret .= "<li>".$x->getLinkedTitle()." ".$x->getWorkshopText(false).
    361             (array_key_exists($x->getID(), $roles) ? ' <span class="roletag">'.$roles[$x->getID()].'</span>' : '').
    362             (array_key_exists($x->getID(), $applications) ? ' <span class="applicationtag">'.$applications[$x->getID()].'</span>' : '')."\n";
    363         $ret .= "</ul>\n";
    364       }
    365 
     372      $ret .= '<h3>'.count($peops).(count($peops) == 1 ? ' Affiliated Person' : ' Affiliated People').'</h3><ul>'."\n";
     373      reset($peops);
     374      while(list(,$x) = each($peops))
     375        $ret .= "<li>".$x->getLinkedTitle()." ".$x->getWorkshopText(false).
     376          (array_key_exists($x->getID(), $roles) ? ' <span class="roletag">'.$roles[$x->getID()].'</span>' : '').
     377          (array_key_exists($x->getID(), $applications) ? ' <span class="applicationtag">'.$applications[$x->getID()].'</span>' : '')."\n";
     378      $ret .= "</ul>\n";
    366379          return $ret;
    367380        }
Note: See TracChangeset for help on using the changeset viewer.