Changeset 184


Ignore:
Timestamp:
Jan 30, 2007 11:22:21 PM (6 years ago)
Author:
dkg
Message:

JPDD: properly limit printout listing, change text to be more what phyllis wants, added new "open" function to show details of all open workshops.

Location:
trunk/jpdd
Files:
2 edited

Legend:

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

    r117 r184  
    1717        } 
    1818 
    19     function showList($items) { 
     19    function showList($items, $onlyopen = false) { 
    2020      $ret = ''; 
    2121      reset($items); 
    2222      while (list(,$item) = each($items)) { 
    2323        $wshops = $item->getM2MPeers('workshop', 'workshop_category', 'Workshops'); 
     24        if ($onlyopen) 
     25          $wshops = array_filter($wshops, create_function('$x', 'return !$x->isFull();')); 
    2426        if (count($wshops)) { 
    2527          $ret .= '<div class="array"><div class="array-title">'.$item->getLinkedTitle('title')."</div>\n<ul>\n"; 
  • trunk/jpdd/class.jpdd.php

    r183 r184  
    146146 
    147147    function getAllowedActions() { 
    148       return array_merge(parent::getAllowedActions(), array('signup', 'printout', 'overview')); 
     148      return array_merge(parent::getAllowedActions(), array('signup', 'printout', 'overview', 'open')); 
    149149    } 
    150150 
     
    196196 
    197197 
     198    // fudged from JPDD_Category::getList() 
     199    function getOpenWorkshops() { 
     200      $cats = $this->getAll('category'); 
     201      $ret = ''; 
     202      reset($cats); 
     203      while (list(,$cat) = each($cats)) { 
     204        $wshops = $cat->getM2MPeers('workshop', 'workshop_category', 'Workshops'); 
     205        $wshops = array_filter($wshops, create_function('$x', 'return !$x->isFull();')); 
     206        if (count($wshops)) { 
     207          $ret .= '<div class="array"><div class="array-title">'.$cat->getLinkedTitle('title')."</div>\n"; 
     208          $ret .= join('', array_map(create_function('$w', 'return "<h2>".$w->getLinkedTitle()."</h2>\n".$w->getPresentersWithOrgs()."<div class=\"workshop-blurb\">".$w->getDescription()."</div>\n</li>\n";'), $wshops)); 
     209          $ret .= "</div>\n"; 
     210        } 
     211      } 
     212      return $ret; 
     213    } 
     214 
    198215    function getUnaffiliatedAccounts() { 
    199216      $sql = 'SELECT person.* FROM person LEFT JOIN affiliation ON (person.id = affiliation.person_id) WHERE organization_id IS NULL AND person.pass IS NOT NULL ORDER BY last_name, first_name'; 
     
    337354      if ($this->_action == 'signup') { 
    338355        return $this->handleSignup(); 
     356      } elseif ($this->_action == 'open') { 
     357        return $this->getOpenWorkshops(); 
    339358      } elseif ($this->_action == 'printout') { 
    340359        $pdf = NULL; 
     
    381400              $this->permissionDenied('This printout is not for you.'); 
    382401          } elseif ($this->isEmpty($this->_type)) { 
    383             return $this->getPDFLinkList(); 
     402            if ($this->isAuthenticated() && $this->_authenticated_user->hasAllOfThesePrivileges('Edit People', 'Update Workshops', 'Edit Categories'))  
     403              return $this->getPDFLinkList(); 
     404            else 
     405              $this->permissionDenied('This printout is not for you.'); 
    384406          } 
    385407        } 
     
    404426                   'door.pdf' => array('description' => 'printouts for the doors', 
    405427                                       'function' => 'addDoorPDFs'), 
    406                    'signup.pdf' => array('description' => 'signup sheets for the workshops', 
     428                   'signup.pdf' => array('description' => 'attendance sheets for the workshops', 
    407429                                         'function' => 'addSignupPDFs'), 
    408430                   'table.pdf' => array('description' => 'pages for the entrance table', 
Note: See TracChangeset for help on using the changeset viewer.