Changeset 1422


Ignore:
Timestamp:
Jan 4, 2014, 4:17:11 AM (4 years ago)
Author:
dkg
Message:

add a link to submit proposals

Location:
trunk/jpdd
Files:
4 edited

Legend:

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

    r1375 r1422  
    6666        }
    6767
     68    function advertiseProposals() {
     69      return (!is_null($this->advertise_proposals_until) &&
     70              $this->advertise_proposals_until > strftime('%Y-%m-%d'));
     71    }
     72
    6873        function handleCreation() {
    6974          // just insert a new row, grab the created ID, and re-initialize
  • trunk/jpdd/class.jpdd.person.php

    r1393 r1422  
    3131    function getSalutation() {
    3232      global $jpdd;
     33
     34      $ret = '';
     35      if ($jpdd->getActiveEvent()->advertiseProposals()) {
     36        $ret .= '<div>Please <a href="'.$jpdd->Path('edit', 'proposal').'">submit a workshop proposal!</a></div>';
     37        // FIXME: if they have already submitted some, give them links to their own proposals...
     38      }
    3339
    3440      // if no workshops are set up at all, people should be able to
     
    4854          // (like "all done")?  provide direct links to liaison
    4955          // pages?
    50           return 'Please check in on your organization'.($lc > 1 ? 's':'').' through the links below';
     56          $ret .= 'Please check in on your organization'.($lc > 1 ? 's':'').' through the links below';
    5157        } else {
    52           return 'No workshops have been created yet.  You will be notified when workshops have been created.';
     58          $ret .= 'No workshops have been created yet.  You will be notified when workshops have been created.';
    5359        }
    5460      } else {
    5561        $wt = $this->getWorkshopText();
    5662        if ('' == $wt) {
    57           return 'You are not signed up for any workshop.'.($jpdd->isSignupClosed() ? '' : ' Please <a href="'.$jpdd->Path('category').'">choose one</a>.');
     63          $ret .= 'You are not signed up for any workshop.'.($jpdd->isSignupClosed() ? '' : ' Please <a href="'.$jpdd->Path('category').'">choose one</a>.');
    5864        } else {
    59           return 'You will be '.$wt;
     65          $ret .='You will be '.$wt;
    6066        }
    6167      }
     68      return $ret;
    6269    }
    6370
     
    274281    }
    275282
     283    function getProposals() {
     284      global $jpdd;
     285      $sql = 'SELECT * FROM proposal WHERE proposer_id = '.$this->getID().' AND event_id = '.$jpdd->getActiveEventID();
     286      $jpdd->prepClass('proposal');
     287      return $jpdd->getSeriesFromSQL($sql, 'JPDD_Proposal');
     288
     289    }
     290
    276291    function getWorkshopText($usedivs = true, $eventid = NULL) {
    277292      global $jpdd;
  • trunk/jpdd/class.jpdd.php

    r1419 r1422  
    8989    }
    9090
     91    function getActiveEvent() {
     92      $map = $jpdd->prepClass('event');
     93      return new $map['classname'](array('id' => $this->getActiveEventID()));
     94    }
     95
    9196    function getNavLinks() {
    9297      // FIXME: this is way way way too static.
  • trunk/jpdd/sql/db.sql

    r1403 r1422  
    10681068
    10691069ALTER TABLE workshop ADD COLUMN proposal_id integer REFERENCES proposal(id);
     1070
     1071ALTER TABLE event ADD COLUMN advertise_proposals_until timestamp with time zone;
     1072
     1073ALTER TABLE event ADD CONSTRAINT event_advertise_proposals_date_range CHECK (start_planning <= advertise_proposals_until AND advertise_proposals_until <= start_time);
Note: See TracChangeset for help on using the changeset viewer.