Changeset 561


Ignore:
Timestamp:
Sep 17, 2007 1:19:31 AM (6 years ago)
Author:
dkg
Message:

JPDD: cleaning up rules for self-edit of accounts.

Location:
trunk/jpdd
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/jpdd/class.dkg.row.php

    r560 r561  
    9797        $nonpeers = array_filter($nonpeers, $nonpeerlimitfunc); 
    9898      } 
     99      if (count($peers) == 0 && 
     100          count($nonpeers) == 0) 
     101        return ''; 
     102 
    99103      $ret = '<fieldset class="m2medit"><legend>'; 
    100104      if (count($peers)) 
     
    112116<option value="">None</option> 
    113117'.join("\n", array_map(create_function('$h', "return '<option value=\"'.\$h->getID().'\">'.\$h->getTitle().'</option>';"), $nonpeers)).' 
    114 </select></label> 
    115 </fieldset> 
    116 '; 
     118</select></label>'; 
     119 
     120      $ret .= '</fieldset>'; 
    117121       
    118122      return $ret; 
  • trunk/jpdd/class.dkg.site.php

    r560 r561  
    393393    function getLogoutForm($followupURI = NULL) { 
    394394      return '<form id="logout_form" class="logout" action="'.$this->Path("logout").'" method="post"> 
    395 '.($this->isAuthenticated() ? '<div class="salutation">Welcome,<br/>'.$this->_authenticated_user->getTitle().$this->getAdditionalSalutation().'</div>':'').' 
     395'.($this->isAuthenticated() ? '<div class="salutation">Welcome,<br/>'.$this->_authenticated_user->getLinkedTitle().$this->getAdditionalSalutation().'</div>':'').' 
    396396<input class="submit" type="submit" value="Logout"/> 
    397397'.$this->getFormTokenHiddenInput().' 
  • trunk/jpdd/class.jpdd.person.php

    r560 r561  
    2828    function getSalutation() { 
    2929      global $jpdd; 
    30       $wt = $this->getWorkshopText(); 
    31       if ('' == $wt) { 
    32         return 'You are not signed up for any workshop.  Please <a href="'.$jpdd->Path('category').'">choose one</a>.'; 
     30 
     31      // if no workshops are set up at all, people should be able to 
     32      // apply to the workshop by indicating a preferred category: 
     33      $wc = $jpdd->getValueFromSQL('SELECT COUNT(*) AS foo FROM workshop WHERE event_id = '.$jpdd->getActiveEventID(), 'foo'); 
     34      if ($wc == 0) { 
     35        // FIXME: is this person already applied?  if not, should they 
     36        // be able to make an application on their own?  should we 
     37        // report the category their application is under? 
     38 
     39        // this person a liaison for this event?  if so, direct them to their  
     40        $lc = $jpdd->getValueFromSQL('SELECT COUNT(*) AS foo FROM person_role JOIN role ON (role.id = role_id) WHERE person_id = '. 
     41                                     $this->getID().' AND event_id = '.$jpdd->getActiveEventID().' AND role.title = '.$jpdd->escStr('liaison'), 
     42                                     'foo'); 
     43        if ($lc > 0) { 
     44          // FIXME: present some sort of simplified reporting here? 
     45          // (like "all done")?  provide direct links to liaison 
     46          // pages? 
     47          return 'Please check in on your organization'.($lc > 1 ? 's':'').' through the links below'; 
     48        } else { 
     49          return 'No workshops have been created yet.  You will be notified when workshops have been created.'; 
     50        } 
    3351      } else { 
    34         return 'You will be '.$wt; 
     52        $wt = $this->getWorkshopText(); 
     53        if ('' == $wt) { 
     54          return 'You are not signed up for any workshop.  Please <a href="'.$jpdd->Path('category').'">choose one</a>.'; 
     55        } else { 
     56          return 'You will be '.$wt; 
     57        } 
    3558      } 
    3659    } 
     
    84107    } 
    85108 
     109    function canEditAffiliationsAndRoles() { 
     110       
     111    } 
     112 
    86113    function getFormInnards() { 
    87114      global $jpdd; 
    88115      $emailerr = is_null($this->_email) ? NULL : $jpdd->isValid('e-mail',$this->_email); 
    89116      $editroles = ''; 
     117      $editaffiliations = ''; 
     118 
     119      // we'll use editing roles as a decent proxy for being able to massage affiliations directly. 
    90120      if ($jpdd->_authenticated_user->HasAnyOfThesePrivileges('Edit Roles')) { 
    91121 
     
    104134          } 
    105135        } 
     136         
     137        $editaffiliations = $this->getM2MEditView('organization', 'affiliation', 'Affiliated With', 'Add Affiliation'); 
    106138      } 
    107139      return '<div> 
     
    111143<label>Last name:<br/><input type="text" name="last_name" value="'.htmlentities($this->_last_name).'"/></label><br/> 
    112144<label>E-mail Address:<br/>'.(is_null($emailerr)?'':'<span class="error">'.$emailerr.'</span><br/>').'<input type="text" name="email" '.(is_null($emailerr)?'':'class="error" ').'value="'.htmlentities($this->_email).'"/></label><br/> 
    113 '.$this->getM2MEditView('organization', 'affiliation', 'Affiliated With', 'Add Affiliation').' 
    114 '.$this->getM2MEditView('workshop', 'audience', 'Attending', 'Sign up for', NULL, create_function('$x', 'return !$x->isFull();')).' 
     145'.$editaffiliations.' 
     146'.$this->getM2MEditView('workshop', 'audience', 'Attending', 'Sign up for', NULL, create_function('$x', 'global $jpdd; $x->_event_id == $jpdd->getActiveEventID() && !$x->isFull();')).' 
    115147'.$editroles.' 
    116148</div>'; 
Note: See TracChangeset for help on using the changeset viewer.