Esempio n. 1
0
 /**
  * Wing delete
  * CODE:wing_delete
  */
 public function executeDelete(sfWebRequest $request)
 {
     #security
     if (!$this->getUser()->hasCredential(array('Administrator'), false)) {
         $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
         $this->redirect('dashboard/index');
     }
     $request->checkCSRFProtection();
     try {
         $wing = WingPeer::retrieveByPK($request->getParameter('id'));
         $this->forward404Unless($wing);
         $wing->delete();
         $this->getUser()->setFlash('success', "Successfully deleted.");
     } catch (Exception $e) {
         $this->getUser()->setFlash('warning', "There are related persons to this wing. Please remove them first.");
     }
     $this->redirect('wing/index');
 }
Esempio n. 2
0
           ?>
     <?php 
           $person = PersonPeer::retrieveByPK($person_id);
           ?>
 <?php 
       }
       ?>
 
 <?php 
       $wing_id = $member->getWingId();
       ?>
 <?php 
       if ($wing_id) {
           ?>
     <?php 
           $wing = WingPeer::retrieveByPK($wing_id);
           ?>
 <?php 
       }
       ?>
 
 <tr>
   <td class="cell-1">
       <?php 
       if (isset($member)) {
           echo $member->getExternalId();
       }
       ?>
   </td>
   <td class="cell-1">
       <?php 
Esempio n. 3
0
 /**
  * CODE: member_view
  */
 public function executeView(sfWebRequest $request)
 {
     # security
     if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Pilot', 'Member', 'Coordinator', 'Volunteer'), false)) {
         $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
         $this->redirect('dashboard/index');
     }
     $member = MemberPeer::retrieveByPK($request->getParameter('id'));
     $this->forward404Unless($member);
     $this->member = $member;
     $this->person = $member->getPerson();
     $this->applications = $member->getApplications();
     if ($member->getSecondaryWingId()) {
         $this->secondWing = WingPeer::retrieveByPK($member->getSecondaryWingId());
     }
     # recent item
     $this->getUser()->addRecentItem('Member', 'member', 'member/view?id=' . $member->getId());
     # handle the master member
     if ($request->hasParameter('master_for') && $this->getUser()->hasCredential(array('Administrator', 'Staff', 'Member'), false)) {
         $this->master_for = MemberPeer::retrieveByPK($request->getParameter('master_for'));
     } else {
         $this->master_for = null;
     }
 }