Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/application/admin/index/controllers/ProposalsController.php b/application/admin/index/controllers/ProposalsController.php
- index 9d50637..2856ed4 100644
- --- a/application/admin/index/controllers/ProposalsController.php
- +++ b/application/admin/index/controllers/ProposalsController.php
- @@ -293,8 +293,24 @@ class ProposalsController extends IP_Controller_EventAction {
- $post = $this->getRequest()->getPost();
- $value = $post['newPersonnel'];
- foreach($value as $val) {
- - $personnelData = explode(":", $val['personnelNameValue']);
- - $personnelID = $personnelData[1];
- + if ($val['personnelNameValue']) {
- + $personnelData = explode(":", $val['personnelNameValue']);
- + $personnelID = $personnelData[1];
- + } else {
- + $select = MyDB::getInstance()->select()
- + ->from(array('smp'=>SessionManagementPersonnel::TABLE), array(),
- + $this->getEvent()->getDatabase())
- + ->join(array('p'=>Profiles::TABLE),
- + 'smp.profileID = p.recordID',
- + array('profileID'=>'smp.profileID'),
- + $this->getEvent()->getDatabase())
- + ->where('p.email = ?', $val['personnelName']);
- + $personnel = MyDB::getInstance()->fetchRow($select);
- + $personnelID = $personnel['profileID'];
- + }
- + if(is_null($personnelID)) {
- + throw new IP_Controller_Action_ErrorException(IP::_('SessionManagementPersonnel::INVALID_PERSONNEL'), "proposals/edit/proposalID/$preID");
- + }
- $pp = $obj->ProposalPersonnel->createRow();
- $pp->roleID = $val['personnelRole'];
- $pp->proposalID = $preID;
- diff --git a/application/admin/index/controllers/SessionsController.php b/application/admin/index/controllers/SessionsController.php
- index eaaa8ad..97f0a42 100644
- --- a/application/admin/index/controllers/SessionsController.php
- +++ b/application/admin/index/controllers/SessionsController.php
- @@ -397,8 +397,24 @@ class SessionsController extends IP_Controller_EventAction {
- $post = $this->getRequest()->getPost();
- $value = $post['newPersonnel'];
- foreach($value as $val) {
- - $personnelData = explode(":", $val['personnelNameValue']);
- - $personnelID = $personnelData[1];
- + if ($val['personnelNameValue']) {
- + $personnelData = explode(":", $val['personnelNameValue']);
- + $personnelID = $personnelData[1];
- + } else {
- + $select = MyDB::getInstance()->select()
- + ->from(array('smp'=>SessionManagementPersonnel::TABLE), array(),
- + $this->getEvent()->getDatabase())
- + ->join(array('p'=>Profiles::TABLE),
- + 'smp.profileID = p.recordID',
- + array('profileID'=>'smp.profileID'),
- + $this->getEvent()->getDatabase())
- + ->where('p.email = ?', $val['personnelName']);
- + $personnel = MyDB::getInstance()->fetchRow($select);
- + $personnelID = $personnel['profileID'];
- + }
- + if(is_null($personnelID)) {
- + throw new IP_Controller_Action_ErrorException(IP::_('SessionManagementPersonnel::INVALID_PERSONNEL'), "sessions/edit/sessionID/$preID");
- + }
- $sp = $obj->SessionPersonnel->createRow();
- $sp->roleID = $val['personnelRole'];
- $sp->sessionID = $preID;
- @@ -642,6 +658,9 @@ class SessionsController extends IP_Controller_EventAction {
- } catch (MessageException $me) {
- IP_Log::debug($me);
- $this->_helper->MessageBroker->error($me->getMessage());
- + } catch (IP_Controller_Action_ErrorException $ipe) {
- + IP_Log::debug($ipe->getMessage());
- + $this->_helper->MessageBroker->error($ipe->getMessage());
- } catch (Exception $e) {
- IP_Log::debug($e);
- $this->_helper->MessageBroker->error(IP::_('Sessions::SESSION_SAVE_FAILED'));
- diff --git a/application/admin/index/scripts/sessions/edit.phtml b/application/admin/index/scripts/sessions/edit.phtml
- index 3d15e9f..3a3e7f2 100644
- --- a/application/admin/index/scripts/sessions/edit.phtml
- +++ b/application/admin/index/scripts/sessions/edit.phtml
- @@ -136,7 +136,7 @@ $this->ip()->startContainer();
- $this->ip()->sectionTitle('Personnel');
- } else if (((Zend_Auth::getInstance()->getIdentity()->getUser()->canWriteObject('Sessions', 'page_addperson') === true) || !$this->notFullAccess) && ($this->tabAccess != true)) {
- $this->ip()->sectionTitle('Personnel
- - <a href="#"><img src="' . IP::getInstance()->getAssetsUrl() . IP::ADD_IMAGE . '" id="addExistingPersonnelButton" class="left pointer addPersonne" title="Add Existing Personnel" alt="Add Existing Personnel"/></a>
- + <a href="#"><img src="' . IP::getInstance()->getAssetsUrl() . IP::ADD_IMAGE . '" id="addExistingPersonnelButton" class="left pointer addPersonnel" title="Add Existing Personnel" alt="Add Existing Personnel"/></a>
- <span class="titleDescription">Add Existing Personnel</span>
- <a href="' . IP::getInstance()->getBaseUrl() . '/sessions/addperson/sessionID/' . $this->sessionID . '">
- <img src="' . IP::getInstance()->getAssetsUrl() . IP::ADD_IMAGE . '" id="addPersonnelButton" class="left pointer" title="Add New Personnel" alt="Add New Personnel"/></a>
- diff --git a/model/SessionManagementPersonnel.php b/model/SessionManagementPersonnel.php
- index f481412..81cac19 100644
- --- a/model/SessionManagementPersonnel.php
- +++ b/model/SessionManagementPersonnel.php
- @@ -27,6 +27,7 @@ class SessionManagementPersonnel extends IP_Db_Table_EventAbstract
- const LABEL_NUMSESSIONS = 'Number of Sessions';
- const LABEL_NUMPROPOSALS = 'Number of Proposals';
- + const INVALID_PERSONNEL = "Invalid Personnel";
- protected function getTableName() {
- return self::TABLE;
Add Comment
Please, Sign In to add comment