Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/application/admin/index/controllers/SessionsController.php b/application/admin/index/controllers/SessionsController.php
- index 135110c..ad72250 100644
- --- a/application/admin/index/controllers/SessionsController.php
- +++ b/application/admin/index/controllers/SessionsController.php
- @@ -77,6 +77,7 @@ class SessionsController extends IP_Controller_EventAction {
- $obj->groupIDs = $form->getElement('groupIDs')->getValue();
- $obj->title = $form->getElement('title')->getValue();
- $obj->number = $form->getElement('number')->getValue();
- + $obj->points = $form->getElement('points')->getValue();
- $obj->maxAttendance = $form->getElement('maxAttendance')->getValue();
- $obj->typeID = ($form->getElement('typeID')->getValue() != '') ? $form->getElement('typeID')->getValue() : null;
- $obj->programID = ($form->getElement('programID')->getValue() != '') ? $form->getElement('programID')->getValue() : null;
- @@ -518,6 +519,9 @@ class SessionsController extends IP_Controller_EventAction {
- $obj->title = $form->getElement('title')->getValue();
- if(!$notFullAccess || $obj->canWrite('number'))
- $obj->number = $form->getElement('number')->getValue();
- + if(!$notFullAccess || $obj->canWrite('points')) {
- + $obj->points = $form->getElement('points')->getValue();
- + }
- if(!$notFullAccess || $obj->canWrite('maxAttendance')) {
- $obj->maxAttendance = $form->getElement('maxAttendance')->getValue();
- }
- @@ -673,6 +677,9 @@ class SessionsController extends IP_Controller_EventAction {
- $form->getElement('title')->setValue($obj->title);
- if($form->getElement('number'))
- $form->getElement('number')->setValue($obj->number);
- + if($form->getElement('points')) {
- + $form->getElement('points')->setValue($obj->points);
- + }
- if($form->getElement('maxAttendance')) {
- $form->getElement('maxAttendance')->setValue($obj->maxAttendance);
- }
- @@ -1778,6 +1785,13 @@ class SessionsController extends IP_Controller_EventAction {
- if($mode == 'readonly')
- $e->setAttrib('disabled','disabled');
- $f->addElement($e);
- +
- + $e = $f->createElement('text', 'points');
- + $e->setLabel(IP::_('Sessions::LABEL_POINTS'));
- + if($mode == 'readonly') {
- + $e->setAttrib('disabled','disabled');
- + }
- + $f->addElement($e);
- $e = $f->createElement('text', 'number');
- $e->setLabel(IP::_('Sessions::LABEL_NUMBER'));
- diff --git a/application/admin/index/scripts/sessions/add.phtml b/application/admin/index/scripts/sessions/add.phtml
- index 32def06..8c83acc 100644
- --- a/application/admin/index/scripts/sessions/add.phtml
- +++ b/application/admin/index/scripts/sessions/add.phtml
- @@ -31,6 +31,7 @@ $this->ip()->startContainer();
- $this->ip()->endElement();
- echo $this->form->getElement('maxAttendance');
- echo $this->form->getElement('typeID');
- + echo $this->form->getElement('points');
- echo $this->form->getElement('exhibitorID');
- echo $this->form->getElement('publish');
- @@ -52,6 +53,11 @@ $this->ip()->startContainer();
- echo $this->form->getElement('mentorUserID');
- echo $this->form->getElement('groupIDs');
- + foreach (IP::getInstance()->getEvent()->getTableObject('SessionTypes')->fetchAll() as $type)
- + {
- + echo $this->form->getElement('sessionType_'.$type->recordID);
- + }
- +
- $this->ip()->endGroup();
- $this->ip()->endRightContainer();
- @@ -216,12 +222,25 @@ function checkSponsorSelect(selectValue) {
- jQuery('#exhibitorID').attr("disabled", true);
- }
- }
- +function togglePointsField(selectValue) {
- + var systemType = jQuery("#sessionType_"+selectValue).val();
- + if(systemType != "1"){
- + jQuery("#points").hide();
- + jQuery('[for=points]').hide();
- + jQuery("#points").val(0);
- + } else {
- + jQuery("#points").show();
- + jQuery('[for=points]').show();
- + }
- +}
- function onSessionTypeSelectChange(target) {
- checkSponsorSelect(target.value);
- + togglePointsField(target.value);
- }
- jQuery(document).ready(function() {
- checkSponsorSelect(jQuery('#typeID').val());
- + togglePointsField(jQuery('#typeID').val());
- jQuery('#date').bind('change', checkDate);
- jQuery('#startTime').bind('change', checkRooms);
- jQuery('#duration').bind('change', checkRooms);
- diff --git a/application/admin/index/scripts/sessions/edit.phtml b/application/admin/index/scripts/sessions/edit.phtml
- index 0121b2e..43acbfb 100644
- --- a/application/admin/index/scripts/sessions/edit.phtml
- +++ b/application/admin/index/scripts/sessions/edit.phtml
- @@ -55,6 +55,7 @@ $this->ip()->startContainer();
- $this->ip()->endElement();
- echo $this->form->getElement('maxAttendance');
- echo $this->form->getElement('typeID');
- + echo $this->form->getElement('points');
- echo $this->form->getElement('exhibitorID');
- echo $this->form->getElement('status');
- echo $this->form->getElement('publish');
- @@ -611,6 +612,18 @@ function checkSponsorSelect(selectValue) {
- }
- }
- +function togglePointsField(selectValue) {
- + var systemType = jQuery("#sessionType_"+selectValue).val();
- + if(systemType != "1"){
- + jQuery("#points").hide();
- + jQuery('[for=points]').hide();
- + jQuery("#points").val(0);
- + } else {
- + jQuery("#points").show();
- + jQuery('[for=points]').show();
- + }
- +}
- +
- function onSessionTypeSelectChange(target){
- var recordID = jQuery("#typeID option:selected").val();
- var systemType = jQuery("#sessionType_"+recordID).val();
- @@ -621,10 +634,12 @@ function onSessionTypeSelectChange(target){
- }
- checkSponsorSelect(target.value);
- + togglePointsField(target.value);
- }
- jQuery(document).ready(function() {
- checkSponsorSelect(jQuery('#typeID').val());
- + togglePointsField(jQuery('#typeID').val());
- jQuery('#date').bind('change', checkDate);
- jQuery('#startTime').bind('change', checkRooms);
- jQuery('#duration').bind('change', checkRooms);
- diff --git a/application/public/index/controllers/XmlController.php b/application/public/index/controllers/XmlController.php
- index c60612b..fb83cf8 100644
- --- a/application/public/index/controllers/XmlController.php
- +++ b/application/public/index/controllers/XmlController.php
- @@ -11,27 +11,26 @@
- */
- class XmlController extends IP_Controller_EventAction {
- +
- protected $_profileAdditionalQuestions = array();
- -
- +
- protected function _getProfileAdditionalQuestions()
- {
- if (!$this->_profileAdditionalQuestions) {
- $this->_profileAdditionalQuestions = $this->getEvent()->getTableObject('AdditionalQuestionConfigs')->fetchAll('objectType = ' . '"Profiles"');
- }
- -
- +
- return $this->_profileAdditionalQuestions;
- }
- -
- - public function getPublicActions()
- - {
- - return array(
- - 'authentication', 'profiles', 'tracks',
- - 'ancillarysponsorships', 'packages', 'booths',
- - 'golfsponsorpackages', 'event', 'refreshcache',
- - 'golfpsonsorancillarysponsorships', 'xml',
- - );
- +
- +
- + public function getPublicActions() {
- + return array( 'authentication', 'profiles', 'registrations', 'tracks', 'sessions', 'speakers',
- + 'exhibitors', 'ancillarysponsorships', 'packages', 'booths',
- + 'golfsponsors', 'golfpsonsorancillarysponsorships', 'golfsponsorpackages', 'event',
- + 'refreshcache');
- }
- -
- +
- protected function isRequest() {
- if ($this->_request->isPost())
- return true;
- @@ -249,7 +248,54 @@ class XmlController extends IP_Controller_EventAction {
- $element->appendChild($additionalQuestionsElement);
- }
- -
- +
- + public function registrationsAction() {
- + if ($this->isRequest()) {
- + Zend_Controller_Front::getInstance()->getResponse()->setHeader('Content-Type', 'text/xml');
- + $authProfile = $this->authenticationAction();
- + $this->_helper->layout->disableLayout();
- +
- + if($authProfile == TRUE) {
- + try {
- +
- + /**
- + * Note there is not currently a way to get all registrations from the feed at once.
- + * There is also no way to change the number of registrations displayed.
- + * As handled by the controller, the feed delivers up to 1000 registrations,
- + * using pagination controls to handle the offset multiplier.
- + */
- +
- + $options = array();
- +
- + $optionKeys = array('regStatus', 'modifiedDate', 'page');
- +
- + foreach ($optionKeys as $option)
- + {
- + if ($param = $this->_getParam($option)) {
- + $options[$option] = $param;
- + }
- + }
- +
- + $service = new IP_Mapper_Service_RegistrationsXmlFeed($options);
- + $this->view->XML = $service->execute();
- + } catch (IP_Controller_Action_ErrorException $me) {
- + $message = $me->getMessage();
- + if (!empty($message)) {
- + $this->_helper->MessageBroker->error($message);
- + }
- + } catch (Exception $e) {
- + throw $e;
- + }
- + } else {
- + return FALSE;
- + }
- + } else {
- + $form = $this->getTestForm();
- + echo $form;
- + return FALSE;
- + }
- + }
- +
- public function refreshcacheAction() {
- if ($this->isRequest()) {
- Zend_Controller_Front::getInstance()->getResponse()->setHeader('Content-Type', 'text/xml');
- @@ -393,7 +439,7 @@ class XmlController extends IP_Controller_EventAction {
- }
- }
- - protected function _sessionsDeprecated() {
- + public function sessionsAction() {
- if ($this->isRequest()) {
- Zend_Controller_Front::getInstance()->getResponse()->setHeader('Content-Type', 'text/xml');
- $this->_helper->layout->disableLayout();
- @@ -623,8 +669,8 @@ class XmlController extends IP_Controller_EventAction {
- return FALSE;
- }
- }
- -
- - protected function _speakersDeprecated() {
- +
- + public function speakersAction() {
- if ($this->isRequest()) {
- Zend_Controller_Front::getInstance()->getResponse()->setHeader('Content-Type', 'text/xml');
- $this->_helper->layout->disableLayout();
- @@ -871,8 +917,8 @@ class XmlController extends IP_Controller_EventAction {
- return $questionArray;
- }
- -
- - protected function _exhibitorsDeprecated() {
- +
- + public function exhibitorsAction() {
- if ($this->isRequest()) {
- Zend_Controller_Front::getInstance()->getResponse()->setHeader('Content-Type', 'text/xml');
- $this->_helper->layout->disableLayout();
- @@ -1481,73 +1527,4 @@ $f = '
- public function isGolfObject() {
- return (bool)$this->_getParam('golfObject', false);
- }
- -
- - /**
- - * Routes.ini uses this action to generate an XML feed from the Mapper Service Classes
- - *
- - * @author Joel Ehrhard <jehrhard@aetherquest.com>
- - */
- - public function xmlAction()
- - {
- - $deprecated = (bool)$this->_getParam('deprecated', false);
- - $feed = $this->_getParam('feed', null);
- - if ($deprecated) {
- - $this->_buildDeprecatedXmlFeed($feed);
- - } else {
- - $optionKeys = $this->_getParam('optkeys', array());
- - $this->_buildXmlFeed($feed, $optionKeys);
- - }
- - }
- -
- - protected function _buildXmlFeed($feed = null, $optionKeys = array())
- - {
- - if ($this->isRequest()) {
- - Zend_Controller_Front::getInstance()->getResponse()->setHeader('Content-Type', 'text/xml');
- - $authProfile = $this->authenticationAction();
- - $this->_helper->layout->disableLayout();
- -
- - if($authProfile == true) {
- - try {
- - if ($feed === null || !class_exists($mapperService = 'IP_Mapper_Service_' . $feed)) {
- - throw new IP_Controller_Action_ErrorException('ERROR: No Valid Feed Provided');
- - }
- - $options = array();
- - foreach ($optionKeys as $option) {
- - if (($param = $this->_getParam($option, false)) !== false)
- - $options[$option] = $param;
- - }
- - $service = new $mapperService($options);
- - $this->view->XML = $service->execute();
- - } catch (IP_Controller_Action_ErrorException $me) {
- - $message = $me->getMessage();
- - if (!empty($message)) {
- - $this->_helper->MessageBroker->error($message);
- - }
- - } catch (Exception $e) {
- - throw $e;
- - }
- - } else {
- - return false;
- - }
- - } else {
- - echo $this->getAuthenticateTestForm();
- - return false;
- - }
- - }
- -
- - protected function _buildDeprecatedXmlFeed($feed = null)
- - {
- - try {
- - if ($feed === null || !method_exists($this, '_' . $feed . 'Deprecated'))
- - throw new IP_Controller_Action_ErrorException('ERROR: Invalid Deprecated Xml Feed Provided');
- - $this->{'_' . $feed . 'Deprecated'}();
- - } catch (IP_Controller_Action_ErrorException $me) {
- - $message = $me->getMessage();
- - if (!empty($message)) {
- - $this->_helper->MessageBroker->error($message);
- - }
- - } catch (Exception $e) {
- - throw $e;
- - }
- - }
- -}
- \ No newline at end of file
- +}
- diff --git a/application/public/index/scripts/xml/exhibitors.phtml b/application/public/index/scripts/xml/exhibitors.phtml
- new file mode 100644
- index 0000000..e669ffe
- --- /dev/null
- +++ b/application/public/index/scripts/xml/exhibitors.phtml
- @@ -0,0 +1,11 @@
- +<?php
- +if($this->XML != NULL) {
- + if(is_array($this->XML)) {
- + foreach($this->XML as $xml) {
- + echo $xml;
- + }
- + } else {
- + echo $this->XML;
- + }
- +}
- +?>
- \ No newline at end of file
- diff --git a/application/public/index/scripts/xml/registrations.phtml b/application/public/index/scripts/xml/registrations.phtml
- new file mode 100644
- index 0000000..e669ffe
- --- /dev/null
- +++ b/application/public/index/scripts/xml/registrations.phtml
- @@ -0,0 +1,11 @@
- +<?php
- +if($this->XML != NULL) {
- + if(is_array($this->XML)) {
- + foreach($this->XML as $xml) {
- + echo $xml;
- + }
- + } else {
- + echo $this->XML;
- + }
- +}
- +?>
- \ No newline at end of file
- diff --git a/application/public/index/scripts/xml/sessions.phtml b/application/public/index/scripts/xml/sessions.phtml
- new file mode 100644
- index 0000000..e669ffe
- --- /dev/null
- +++ b/application/public/index/scripts/xml/sessions.phtml
- @@ -0,0 +1,11 @@
- +<?php
- +if($this->XML != NULL) {
- + if(is_array($this->XML)) {
- + foreach($this->XML as $xml) {
- + echo $xml;
- + }
- + } else {
- + echo $this->XML;
- + }
- +}
- +?>
- \ No newline at end of file
- diff --git a/application/public/index/scripts/xml/speakers.phtml b/application/public/index/scripts/xml/speakers.phtml
- new file mode 100644
- index 0000000..e669ffe
- --- /dev/null
- +++ b/application/public/index/scripts/xml/speakers.phtml
- @@ -0,0 +1,11 @@
- +<?php
- +if($this->XML != NULL) {
- + if(is_array($this->XML)) {
- + foreach($this->XML as $xml) {
- + echo $xml;
- + }
- + } else {
- + echo $this->XML;
- + }
- +}
- +?>
- \ No newline at end of file
- diff --git a/application/public/routes.ini b/application/public/routes.ini
- index d7ce3d6..d025ccd 100644
- --- a/application/public/routes.ini
- +++ b/application/public/routes.ini
- @@ -1,101 +1,50 @@
- [production]
- -
- -; Registration Invitation Route
- routes.regsInvitation.route = "registrations/invitation/:invitation"
- routes.regsInvitation.module = "index"
- routes.regsInvitation.controller = "registrations"
- routes.regsInvitation.action = "start"
- -; Invitation Route
- routes.invitation.route = "invitation/:invitation"
- routes.invitation.module = "index"
- routes.invitation.controller = "registrations"
- routes.invitation.action = "start"
- -; Login Route
- routes.login.route = "login"
- routes.login.defaults.module = "index"
- routes.login.defaults.controller = "login"
- routes.login.defaults.action = "index"
- -; Logout Route
- routes.logout.route = "logout"
- routes.logout.defaults.module = "index"
- routes.logout.defaults.controller = "login"
- routes.logout.defaults.action = "logout"
- -; Session File Route
- routes.sessionfiles.route = "sessionfile/:id"
- routes.sessionfiles.defaults.module = "index"
- routes.sessionfiles.defaults.controller = "index"
- routes.sessionfiles.defaults.action = "sessionfile"
- -; Golf Sponsor Sponsorship Packages XML Feed
- +; Golf Sponsor XML
- +
- routes.golfSponsorSponsorshipPackagesXml.route = "xml/golfsponsorpackages"
- routes.golfSponsorSponsorshipPackagesXml.defaults.module = "index"
- routes.golfSponsorSponsorshipPackagesXml.defaults.controller = "xml"
- routes.golfSponsorSponsorshipPackagesXml.defaults.action = "packages"
- routes.golfSponsorSponsorshipPackagesXml.defaults.golfObject = "1"
- -; Golf Sponsor Ancillary Sponsroships XML Feed
- routes.golfSponsorAncillarySponsorshipsXml.route = "xml/golfsponsorancillarysponsorships"
- routes.golfSponsorAncillarySponsorshipsXml.defaults.module = "index"
- routes.golfSponsorAncillarySponsorshipsXml.defaults.controller = "xml"
- routes.golfSponsorAncillarySponsorshipsXml.defaults.action = "ancillarysponsorships"
- routes.golfSponsorAncillarySponsorshipsXml.defaults.golfObject = "1"
- -; Buyer Selection
- +routes.golfSponsorsXml.route = "xml/golfsponsors"
- +routes.golfSponsorsXml.defaults.module = "index"
- +routes.golfSponsorsXml.defaults.controller = "xml"
- +routes.golfSponsorsXml.defaults.action = "exhibitors"
- +routes.golfSponsorsXml.defaults.golfObject = "1"
- +
- routes.buyerselection.route = 'buyerselection'
- routes.buyerselection.defaults.module = 'index'
- routes.buyerselection.defaults.controller = 'buyerselection'
- -routes.buyerselection.defaults.action = 'index'
- -
- -; Sessions XML Feed
- -routes.sessionsXml.route = "xml/sessions"
- -routes.sessionsXml.defaults.module = "index"
- -routes.sessionsXml.defaults.controller = "xml"
- -routes.sessionsXml.defaults.action = "xml"
- -routes.sessionsXml.defaults.feed = "SessionsXmlFeed"
- -
- -; Exhibitors XML Feed
- -routes.exhibitorsXml.route = "xml/exhibitors"
- -routes.exhibitorsXml.defaults.module = "index"
- -routes.exhibitorsXml.defaults.controller = "xml"
- -routes.exhibitorsXml.defaults.action = "xml"
- -routes.exhibitorsXml.defaults.feed = "ExhibitorsXmlFeed"
- -routes.exhibitorsXml.defaults.optkeys[] = "isGolf"
- -routes.exhibitorsXml.defaults.isGolf = "0"
- -
- -; Golf Sponsors XML Feed
- -routes.exhibitorsXml.route = "xml/golfsponsors"
- -routes.exhibitorsXml.defaults.module = "index"
- -routes.exhibitorsXml.defaults.controller = "xml"
- -routes.exhibitorsXml.defaults.action = "xml"
- -routes.exhibitorsXml.defaults.feed = "ExhibitorsXmlFeed"
- -routes.exhibitorsXml.defaults.optkeys[] = "isGolf"
- -routes.exhibitorsXml.defaults.isGolf = "1"
- -
- -; Registrations XML Feed
- -; Add "/*" if params are passed through url string
- -routes.regXml.route = "xml/registrations/*"
- -routes.regXml.defaults.module = "index"
- -routes.regXml.defaults.controller = "xml"
- -routes.regXml.defaults.action = "xml"
- -routes.regXml.defaults.feed = "RegistrationsXmlFeed"
- -routes.regXml.defaults.optkeys[] = "regStatus"
- -routes.regXml.defaults.optkeys[] = "modifiedDate"
- -routes.regXml.defaults.optkeys[] = "page"
- -
- -; Speakers XML Feed
- -routes.exhibitorsXml.route = "xml/speakers"
- -routes.exhibitorsXml.defaults.module = "index"
- -routes.exhibitorsXml.defaults.controller = "xml"
- -routes.exhibitorsXml.defaults.action = "xml"
- -routes.exhibitorsXml.defaults.feed = "SpeakersXmlFeed"
- -
- -; Deprecated XML Feeds
- -routes.deprecatedXml.route = "xml/deprecated/:feed"
- -routes.deprecatedXml.defaults.module = "index"
- -routes.deprecatedXml.defaults.controller = "xml"
- -routes.deprecatedXml.defaults.action = "xml"
- -routes.deprecatedXml.defaults.deprecated = "1"
- \ No newline at end of file
- +routes.buyerselection.defaults.action = 'index'
- \ No newline at end of file
- diff --git a/classes/IP/Command/RefreshXml.php b/classes/IP/Command/RefreshXml.php
- index c1be858..879b4f2 100644
- --- a/classes/IP/Command/RefreshXml.php
- +++ b/classes/IP/Command/RefreshXml.php
- @@ -23,7 +23,7 @@ class IP_Command_RefreshXml extends IP_Command
- public function run() {
- // Disable notifications that are not vital to saving the records
- IP::getInstance()->isBulkOperation(true);
- - error_reporting(E_ERROR | E_PARSE);
- + error_reporting(E_ERROR | E_PARSE | E_FATAL);
- // Set time limit to unlimited
- set_time_limit(0);
- // Increase memory limit
- diff --git a/classes/IP/Db/Table/Abstract.php b/classes/IP/Db/Table/Abstract.php
- index 0f9bd54..a56b231 100644
- --- a/classes/IP/Db/Table/Abstract.php
- +++ b/classes/IP/Db/Table/Abstract.php
- @@ -13,6 +13,7 @@ abstract class IP_Db_Table_Abstract extends Zend_Db_Table_Abstract implements IP
- const DATETIME = 'datetime';
- const ENUM = 'enum';
- const DECIMAL = 'decimal';
- + const SMALLINT = 'smallint';
- const PARENT_CLASS_COLUMN = 'parentClassColumn';
- const DEPENDENT_SORT = 'dependentSort';
- diff --git a/classes/IP/Mapper/Abstract.php b/classes/IP/Mapper/Abstract.php
- index 6e66534..a1cbe50 100644
- --- a/classes/IP/Mapper/Abstract.php
- +++ b/classes/IP/Mapper/Abstract.php
- @@ -121,7 +121,7 @@ abstract class IP_Mapper_Abstract
- if(property_exists($instance, $value)) {
- $returnValue = $this->_mapAttribute($key, $instance, $value);
- } else if ($function != 'get' && method_exists($instance, $function)) {
- - $returnValue = $this->_mapMethod($key, $instance, $function, $value);
- + $returnValue = $this->_mapMethod($key, $instance, $function);
- } else if(substr_count($value, ".") > 0) {
- $splitValue = explode(".", $value);
- if($instance->hasReference($splitValue[0]) &&
- @@ -131,7 +131,7 @@ abstract class IP_Mapper_Abstract
- $returnValue = $value;
- }
- } else if($instance->hasDependents($value) || $instance->hasReference($value)) {
- - $returnValue = $this->_mapObject($key, $instance->{$value});
- + $returnValue = $this->_mapObject($key, $instance->{$value}, $value);
- } else {
- $returnValue = $this->_mapString($key, $instance, $value);
- }
- diff --git a/classes/IP/Mapper/Service/ExhibitorsXmlFeed.php b/classes/IP/Mapper/Service/ExhibitorsXmlFeed.php
- deleted file mode 100644
- index fe7566b..0000000
- --- a/classes/IP/Mapper/Service/ExhibitorsXmlFeed.php
- +++ /dev/null
- @@ -1,238 +0,0 @@
- -<?php
- -
- -class IP_Mapper_Service_ExhibitorsXmlFeed extends IP_Mapper_Service_Abstract
- -{
- - private $_cache;
- - private $_cacheKey;
- - private $_shouldCache = false;
- - private $_isGolf;
- - public function __construct($options = array(), $event = null)
- - {
- - if ($event) {
- - $this->setEvent($event);
- - }
- - $this->_regTable = $this->getEvent()->getTableObject('Sessions');
- -
- - foreach ($options as $option=>$value) {
- - switch ($option) {
- - case 'isGolf':
- - $this->setGolf($value);
- - }
- - }
- -
- - $this->_cache = $this->getEvent()->getCache();
- -
- - $this->_cacheKey = 'exb_xml_'.preg_replace('/[^a-zA-Z0-9_]/', '_', http_build_query($options));
- - }
- -
- - public function setGolf($isGolf)
- - {
- - if (is_bool($isGolf) || (in_array($isGolf, array(0, '0', 1, '1')))) {
- - $this->_isGolf = (bool)$isGolf;
- - }
- - }
- -
- -
- - public function execute()
- - {
- - if ($this->_shouldCache && ($xml = $this->getCachedXml())) {
- - return $xml;
- - }
- -
- - /**
- - * this is where we're going to use the xml saved in the database to generate the feed
- - */
- -
- - $this->_initializeMappables();
- - $event = $this->getEvent();
- - $xmlTable = $event->getTableObject('XmlNodes');
- -
- - $exhibitorsTable = $event->getTableObject((($this->_isGolf) ? 'GolfSponsors' : 'Exhibitors'));
- - $selector = $xmlTable->select()->from(array('xml'=>XmlNodes::TABLE), array('*'), $event->getDatabase())
- - ->joinInner(array('ex'=>$exhibitorsTable->getSelectTableName()),
- - '(ex.recordID = xml.objectID) AND (objectType = "Exhibitors")',
- - array(),
- - $event->getDatabase())
- - ->where(MyDB::getInstance()->getInClauseAsOr('ex.regStatus', Exhibitors::getValidRegStatuses()))
- - ->where('visible = 1')
- - ->where('golfObject = ?', $this->_isGolf);
- - $selector->order('objectID');
- - $xmlDocument = new DOMDocument('1.0', 'iso-8859-1');
- - $xmlDocument->formatOutput = TRUE;
- - $exElement = $xmlDocument->createElement((($this->_isGolf) ? 'golfsponsors' : 'exhibitors') . '_response');
- -
- - foreach ($xmlTable->fetchAll($selector) as $node)
- - {
- - $domNode = $node->asDomNode();
- - $newDomNode = $xmlDocument->importNode($domNode, true);
- - $exElement->appendChild($newDomNode);
- - }
- -
- -
- - $xmlDocument->appendChild($exElement);
- -
- - $xml = $xmlDocument->saveXml();
- - $this->setCachedXml($xml);
- - return $xml;
- - }
- -
- - public function getCachedXml()
- - {
- - if ($xmlArray = $this->_cache->load($this->_cacheKey)) {
- - if ($xmlArray['expires'] > time()) {
- - return $xmlArray['xml'];
- - }
- - }
- -
- - return false;
- - }
- -
- - public function mapInstance($instance)
- - {
- - $this->_initializeMappables();
- -
- - $table = $instance->getTable();
- - if (!$table instanceOf IP_Mappable_Interface) {
- - throw new Exception('Instance of '.get_class($instance).' cannot be mapped because its table is not mappable');
- - }
- -
- - $mappableAdapter = IP_Mappable_Adapter_Factory::get($table);
- - $mappableAdapter->setMappable($instance->getTable());
- - $mappableAdapter->setFieldOrderAppend();
- - $xmlMapper = new IP_Mapper_Xml($mappableAdapter);
- - return $xmlMapper->mapInstance($instance);
- -
- - }
- -
- -
- - public function setCachedXml($xml)
- - {
- - $xmlArray = array('xml'=>$xml, 'expires'=>strtotime('+15 minutes'));
- -
- - $this->_cache->save($xmlArray, $this->_cacheKey);
- - }
- -
- -
- - private function _initializeMappables()
- - {
- - $event = $this->getEvent();
- -
- - $exTable = $event->getTableObject((($this->_isGolf) ? 'GolfSponsors' : 'Exhibitors'));
- - $exTableInfo = $exTable->info();
- - foreach ($exTableInfo['dependentTables'] as $dep)
- - {
- - if (!in_array($dep, $this->_exFieldOrder)) {
- - $this->_exExcludedFields[] = $dep;
- - }
- - }
- -
- - foreach ($exTableInfo['referenceMap'] as $referenceKey=>$mapping)
- - {
- - if (!in_array($referenceKey, $this->_exFieldOrder)
- - && $referenceKey != 'Profile') {
- - $this->_exExcludedFields[] = $referenceKey;
- - }
- - }
- -
- - $exTable->setExcludedFields($this->_exExcludedFields);
- - $exTable->setColumnAliases($this->_exColumnAliases);
- - $exTable->setFieldOrder($this->_exFieldOrder);
- - $exTable->setExcludeUnorderedFields(true);
- - $profilesTable = $event->getTableObject('Profiles');
- - $profileTableInfo = $profilesTable->info();
- -
- - foreach ($profileTableInfo['dependentTables'] as $dep)
- - {
- - $this->_profileExcludedFields[] = $dep;
- - }
- -
- - foreach ($profileTableInfo['referenceMap'] as $referenceKey=>$mapping)
- - {
- - $this->_profileExcludedFields[] = $referenceKey;
- - }
- -
- - $profilesTable->setFieldOrder($this->_profileFieldOrder);
- - $profilesTable->setExcludedFields($this->_profileExcludedFields);
- - $profilesTable->setExcludeUnorderedFields(true);
- -
- - $profilesTable->setColumnAliases($this->_profileColumnAliases);
- - }
- -
- - private $_exFieldOrder = array('exhibitor_id', 'type', 'confirmation','company', 'address1', 'address2','address3', 'city', 'state',
- - 'postal_code', 'country', 'industry', 'description','url', 'fax', 'phone', 'PrimaryContact', 'ExhibitorPersonnel',
- - 'booths', 'sponsorship_packages', 'ancillary_sponsorships', 'AdditionalQuestions');
- - private $_exExcludedFields = array('primaryContactID', 'exhibitorTypeID', 'housingSubblockID', 'visible',
- - 'invitationHash','invitationStatus', 'notes','totalBalance','totalCollected',
- - 'balanceBeforeTaxes','vat1Value','vat2Value','vat3Value', 'vat1Collected',
- - 'vat2Collected','vat3Collected', 'payStatus','regStatus','accessCode',
- - 'accessCodeDate','cancellationDate','creationDate','modifiedDate','golfObject');
- - private $_exColumnAliases = array(
- - 'recordID' => 'exhibitor_id',
- - 'ExhibitorPersonnelForXml' => 'ExhibitorPersonnel',
- - 'ExhibitorBoothsForXml' => 'booths',
- - 'ExbSpPackagesForXml' => 'sponsorship_packages',
- - 'AnsSponsorshipsForXml' => 'ancillary_sponsorships',
- - 'AdditionalQuestionsForXml' => 'AdditionalQuestions',
- - 'ReadableExhibitorTypeID' => 'type',
- - 'bizName' => 'company',
- - 'bizAddress1' => 'address1',
- - 'bizAddress2' => 'address2',
- - 'bizAddress3' => 'address3',
- - 'readableCity' => 'city',
- - 'readableState' => 'state',
- - 'bizPostalCode' => 'postal_code',
- - 'bizUrl' => 'url',
- - 'bizFax' => 'fax',
- - 'bizPhone' => 'phone',
- - 'readableCountry' => 'country',
- - 'readableIndustry' => 'industry',
- - 'objectCreated' => 'created',
- - 'objectModified' => 'modified',
- - );
- -
- - private $_profileFieldOrder = array('uuid', 'prefix', 'firstName', 'middleName', 'lastName', 'suffix',
- - 'badgeFirstName', 'badgeLastName', 'email', 'emailVerified',
- - 'secondEmail', 'mobilePhone', 'phone', 'extension', 'fax',
- - 'ccName', 'ccEmail', 'ccPhone', 'twitterHandle', 'sex', 'membershipNumber',
- - 'title', 'company', 'division', 'industry', 'address1',
- - 'address2', 'address3', 'address4', 'city', 'state',
- - 'postalCode', 'country', 'hasOptedOut', 'preferredLanguage',
- - 'utcTimezone', 'bio', 'thumbnailUrl', 'taxExemptionNumber', 'taxExemptionNumber2',
- - 'taxExemptionNumber3', 'emergencyContact', 'emergencyPhone', 'emergencyEmail', 'emergencyRelationship',
- - 'ProfileAdditionalQuestions');
- -
- - private $_profileColumnAliases = array( 'readablePrefixID' => 'prefix',
- - 'readableSuffixID' => 'suffix',
- - 'bizPhone' => 'phone',
- - 'bizTitle' => 'title',
- - 'bizName' => 'company',
- - 'bizDivision' => 'division',
- - 'readableBizIndustryID'=> 'industry',
- - 'bizAddress1' => 'address1',
- - 'bizAddress2' => 'address2',
- - 'bizAddress3' => 'address3',
- - 'bizAddress4' => 'address4',
- - 'bizCity' => 'city',
- - 'readableBizStateID' => 'state',
- - 'readableBizCountryID' => 'country',
- - 'bizPostalCode' => 'postalCode',
- - 'AdditionalQuestionsForXml'=>'ProfileAdditionalQuestions'
- - );
- - /**
- - * @return the $_shouldCache
- - */
- - public function getShouldCache ()
- - {
- - return $this->_shouldCache;
- - }
- -
- - /**
- - * // set this to false if you're trying to debug
- - * @param field_type $_shouldCache
- - */
- - public function setShouldCache ($_shouldCache)
- - {
- - $this->_shouldCache = $_shouldCache;
- - }
- -
- -}
- \ No newline at end of file
- diff --git a/classes/IP/Mapper/Service/RegistrationsXmlFeed.php b/classes/IP/Mapper/Service/RegistrationsXmlFeed.php
- index d90b5fe..d33b794 100644
- --- a/classes/IP/Mapper/Service/RegistrationsXmlFeed.php
- +++ b/classes/IP/Mapper/Service/RegistrationsXmlFeed.php
- @@ -18,6 +18,7 @@ class IP_Mapper_Service_RegistrationsXmlFeed extends IP_Mapper_Service_Abstract
- }
- $this->_regTable = $this->getEvent()->getTableObject('Registrations');
- +
- foreach ($options as $option=>$value)
- {
- switch ($option) {
- diff --git a/classes/IP/Mapper/Service/SessionsXmlFeed.php b/classes/IP/Mapper/Service/SessionsXmlFeed.php
- deleted file mode 100644
- index d830b5b..0000000
- --- a/classes/IP/Mapper/Service/SessionsXmlFeed.php
- +++ /dev/null
- @@ -1,234 +0,0 @@
- -<?php
- -
- -class IP_Mapper_Service_SessionsXmlFeed extends IP_Mapper_Service_Abstract
- -{
- - private $_cache;
- - private $_cacheKey;
- - private $_shouldCache = false;
- -
- - public function __construct($options = array(), $event = null)
- - {
- - if ($event) {
- - $this->setEvent($event);
- - }
- -
- - $this->_regTable = $this->getEvent()->getTableObject('Sessions');
- - $this->_cache = $this->getEvent()->getCache();
- -
- - $this->_cacheKey = 'session_xml';
- - }
- -
- -
- -
- - public function execute()
- - {
- - if ($this->_shouldCache && ($xml = $this->getCachedXml())) {
- - return $xml;
- - }
- -
- - /**
- - * this is where we're going to use the xml saved in the database to generate the feed
- - */
- -
- - $this->_initializeMappables();
- - $event = $this->getEvent();
- - $regTable = $event->getTableObject('Sessions');
- - $xmlTable = $event->getTableObject('XmlNodes');
- -
- -
- - $selector = $xmlTable->select()->from(array('xml'=>XmlNodes::TABLE), array('*'), $event->getDatabase())
- - ->joinInner(array('s'=>Sessions::TABLE),
- - '(s.recordID = xml.objectID) AND (objectType = "Sessions")',
- - array(),
- - $event->getDatabase())
- - ->where('s.publish=?', 1);
- - $selector->order('objectID');
- - $xmlDocument = new DOMDocument('1.0', 'iso-8859-1');
- - $xmlDocument->formatOutput = TRUE;
- - $sessionsElement = $xmlDocument->createElement('session_response');
- -
- - foreach ($xmlTable->fetchAll($selector) as $node)
- - {
- - $domNode = $node->asDomNode();
- - $newDomNode = $xmlDocument->importNode($domNode, true);
- - $sessionsElement->appendChild($newDomNode);
- - }
- -
- -
- - $xmlDocument->appendChild($sessionsElement);
- -
- - $xml = $xmlDocument->saveXml();
- - $this->setCachedXml($xml);
- - return $xml;
- - }
- -
- - public function getCachedXml()
- - {
- - if ($xmlArray = $this->_cache->load($this->_cacheKey)) {
- - if ($xmlArray['expires'] > time()) {
- - return $xmlArray['xml'];
- - }
- - }
- -
- - return false;
- - }
- -
- - public function mapInstance($instance)
- - {
- - $this->_initializeMappables();
- -
- - $table = $instance->getTable();
- - if (!$table instanceOf IP_Mappable_Interface) {
- - throw new Exception('Instance of '.get_class($instance).' cannot be mapped because its table is not mappable');
- - }
- -
- - $mappableAdapter = IP_Mappable_Adapter_Factory::get($table);
- - $mappableAdapter->setMappable($instance->getTable());
- - $mappableAdapter->setFieldOrderAppend();
- - IP_Log::error("map");
- - $xmlMapper = new IP_Mapper_Xml($mappableAdapter);
- - return $xmlMapper->mapInstance($instance);
- -
- - }
- -
- -
- - public function setCachedXml($xml)
- - {
- - $xmlArray = array('xml'=>$xml, 'expires'=>strtotime('+15 minutes'));
- -
- - $this->_cache->save($xmlArray, $this->_cacheKey);
- - }
- -
- -
- - private function _initializeMappables()
- - {
- - $event = $this->getEvent();
- -
- - $sessionsTable = $event->getTableObject('Sessions');
- - $sessionsTableInfo = $sessionsTable->info();
- - foreach ($sessionsTableInfo['dependentTables'] as $dep)
- - {
- - if (!in_array($dep, $this->_sessionFieldOrder)) {
- - $this->_sessionExcludedFields[] = $dep;
- - }
- - }
- -
- - foreach ($sessionsTableInfo['referenceMap'] as $referenceKey=>$mapping)
- - {
- - if (!in_array($referenceKey, $this->_sessionFieldOrder)
- - && $referenceKey != 'Profile') {
- - $this->_sessionExcludedFields[] = $referenceKey;
- - }
- - }
- -
- - $sessionsTable->setExcludedFields($this->_sessionExcludedFields);
- - $sessionsTable->setExcludeUnorderedFields(true);
- - $sessionsTable->setColumnAliases($this->_sessionColumnAliases);
- - $sessionsTable->setFieldOrder($this->_sessionFieldOrder);
- -
- - $profilesTable = $event->getTableObject('Profiles');
- - $profileTableInfo = $profilesTable->info();
- -
- - foreach ($profileTableInfo['dependentTables'] as $dep)
- - {
- - $this->_profileExcludedFields[] = $dep;
- - }
- -
- - foreach ($profileTableInfo['referenceMap'] as $referenceKey=>$mapping)
- - {
- - $this->_profileExcludedFields[] = $referenceKey;
- - }
- -
- - $profilesTable->setFieldOrder($this->_profileFieldOrder);
- - $profilesTable->setExcludedFields($this->_profileExcludedFields);
- - $profilesTable->setExcludeUnorderedFields(true);
- -
- - $profilesTable->setColumnAliases($this->_profileColumnAliases);
- - }
- -
- - private $_sessionFieldOrder = array('session_id', 'is_scheduled', 'title', 'number', 'programID', 'Program',
- - 'trackID', 'track', 'trackID2', 'track2', 'trackID3', 'track3', 'topicID',
- - 'topic', 'typeID', 'type', 'date', 'roomID', 'room', 'startTime', 'endTime',
- - 'capacity', 'Owner', 'Mentor', 'headcount1', 'headcount2', 'abstract',
- - 'AdditionalQuestions' , 'Speakers', 'files', 'EvaluationQuestions');
- -
- - private $_sessionExcludedFields = array('status', 'abstractOverallStatus', 'fileOverallStatus', 'publish',
- - 'mentorUserID', 'ownerUserID', 'notes', 'abstractStatus', 'avRequirements',
- - 'creationDate', 'modifiedDate', 'exhibitorID');
- -
- - private $_sessionColumnAliases = array('recordID' => 'session_id',
- - 'readableTitle' =>'title',
- - 'readableNumber' =>'number',
- - 'readableProgramID' =>'Program',
- - 'readableTrack' =>'track',
- - 'readableTopic' =>'topic',
- - 'readableType' =>'type',
- - 'mentor' => 'Mentor',
- - 'owner' => 'Owner',
- - 'AdditionalQuestionsForXml' => 'AdditionalQuestions',
- - 'sessionPersonnelForXml' => 'Speakers',
- - 'scheduledForXml' => 'is_scheduled',
- - 'readableTrackID' => 'track',
- - 'readableTrackID2' =>'track2',
- - 'readableTrackID3' =>'track3',
- - 'readableTopicID' =>'topic',
- - 'readableTypeID' =>'type',
- - 'sessionDate' => 'date' ,
- - 'readableRoomID' => 'room',
- - 'readableStartTime' => 'startTime',
- - 'readableEndTime' => 'endTime',
- - 'maxAttendance' => 'capacity',
- - 'AbstractForXml' => 'abstract',
- - 'localProfile' => 'Profile',
- - 'filesForXml' => 'files',
- - 'EvaluationQuestionsForXml' => 'EvaluationQuestions',
- - 'objectCreated' => 'created',
- - 'objectModified' => 'modified'
- - );
- -
- - private $_profileFieldOrder = array('uuid', 'prefix', 'firstName', 'middleName', 'lastName', 'suffix',
- - 'badgeFirstName', 'badgeLastName', 'email', 'emailVerified',
- - 'secondEmail', 'mobilePhone', 'phone', 'extension', 'fax',
- - 'ccName', 'ccEmail', 'ccPhone', 'twitterHandle', 'sex', 'membershipNumber',
- - 'title', 'company', 'division', 'industry', 'address1',
- - 'address2', 'address3', 'address4', 'city', 'state',
- - 'postalCode', 'country', 'hasOptedOut', 'preferredLanguage',
- - 'utcTimezone', 'bio', 'thumbnailUrl', 'taxExemptionNumber', 'taxExemptionNumber2',
- - 'taxExemptionNumber3', 'emergencyContact', 'emergencyPhone', 'emergencyEmail', 'emergencyRelationship',
- - 'ProfileAdditionalQuestions');
- -
- - private $_profileColumnAliases = array( 'readablePrefixID' => 'prefix',
- - 'readableSuffixID' => 'suffix',
- - 'bizPhone' => 'phone',
- - 'bizTitle' => 'title',
- - 'bizName' => 'company',
- - 'bizDivision' => 'division',
- - 'readableBizIndustryID'=> 'industry',
- - 'bizAddress1' => 'address1',
- - 'bizAddress2' => 'address2',
- - 'bizAddress3' => 'address3',
- - 'bizAddress4' => 'address4',
- - 'bizCity' => 'city',
- - 'readableBizStateID' => 'state',
- - 'readableBizCountryID' => 'country',
- - 'bizPostalCode' => 'postalCode',
- - 'AdditionalQuestionsForXml'=>'ProfileAdditionalQuestions'
- - );
- - /**
- - * @return the $_shouldCache
- - */
- - public function getShouldCache ()
- - {
- - return $this->_shouldCache;
- - }
- -
- - /**
- - * // set this to false if you're trying to debug
- - * @param field_type $_shouldCache
- - */
- - public function setShouldCache ($_shouldCache)
- - {
- - $this->_shouldCache = $_shouldCache;
- - }
- -
- -}
- \ No newline at end of file
- diff --git a/classes/IP/Mapper/Service/SpeakersXmlFeed.php b/classes/IP/Mapper/Service/SpeakersXmlFeed.php
- deleted file mode 100644
- index d2be5da..0000000
- --- a/classes/IP/Mapper/Service/SpeakersXmlFeed.php
- +++ /dev/null
- @@ -1,268 +0,0 @@
- -<?php
- -
- -class IP_Mapper_Service_SpeakersXmlFeed extends IP_Mapper_Service_Abstract
- -{
- - private $_cache;
- - private $_cacheKey;
- - private $_shouldCache = false;
- -
- - public function __construct($options = array(), $event = null)
- - {
- - if ($event) {
- - $this->setEvent($event);
- - }
- -
- - $this->_regTable = $this->getEvent()->getTableObject('SessionPersonnel');
- - $this->_cache = $this->getEvent()->getCache();
- -
- - $this->_cacheKey = 'speaker_xml';
- - }
- -
- - public function execute()
- - {
- - if ($this->_shouldCache && ($xml = $this->getCachedXml())) {
- - return $xml;
- - }
- -
- - /**
- - * this is where we're going to use the xml saved in the database to generate the feed
- - */
- -
- - $this->_initializeMappables();
- - $event = $this->getEvent();
- - $regTable = $event->getTableObject('SessionPersonnel');
- - $xmlTable = $event->getTableObject('XmlNodes');
- -
- -
- - $selector = $xmlTable->select()->from(array('xml'=>XmlNodes::TABLE), array('*'), $event->getDatabase())
- - ->joinInner(array('sp'=>SessionPersonnel::TABLE),
- - '(sp.recordID = xml.objectID) AND (objectType = "SessionPersonnel")',
- - array(),
- - $event->getDatabase());
- - $selector->order('objectID');
- - $xmlDocument = new DOMDocument('1.0', 'iso-8859-1');
- - $xmlDocument->formatOutput = TRUE;
- - $sessionsElement = $xmlDocument->createElement('speaker_response');
- -
- - foreach ($xmlTable->fetchAll($selector) as $node)
- - {
- - $domNode = $node->asDomNode();
- - $newDomNode = $xmlDocument->importNode($domNode, true);
- - $sessionsElement->appendChild($newDomNode);
- - }
- -
- -
- - $xmlDocument->appendChild($sessionsElement);
- -
- - $xml = $xmlDocument->saveXml();
- - $this->setCachedXml($xml);
- - return $xml;
- - }
- -
- - public function getCachedXml()
- - {
- - if ($xmlArray = $this->_cache->load($this->_cacheKey)) {
- - if ($xmlArray['expires'] > time()) {
- - return $xmlArray['xml'];
- - }
- - }
- -
- - return false;
- - }
- -
- - public function mapInstance($instance)
- - {
- - $this->_initializeMappables();
- -
- - $table = $instance->getTable();
- - if (!$table instanceOf IP_Mappable_Interface) {
- - throw new Exception('Instance of '.get_class($instance).' cannot be mapped because its table is not mappable');
- - }
- -
- - $mappableAdapter = IP_Mappable_Adapter_Factory::get($table);
- - $mappableAdapter->setMappable($instance->getTable());
- - $mappableAdapter->setFieldOrderAppend();
- - IP_Log::error("map");
- - $xmlMapper = new IP_Mapper_Xml($mappableAdapter);
- - return $xmlMapper->mapInstance($instance);
- -
- - }
- -
- -
- - public function setCachedXml($xml)
- - {
- - $xmlArray = array('xml'=>$xml, 'expires'=>strtotime('+15 minutes'));
- -
- - $this->_cache->save($xmlArray, $this->_cacheKey);
- - }
- -
- -
- - private function _initializeMappables()
- - {
- - $event = $this->getEvent();
- -
- - $spTable = $event->getTableObject('SessionPersonnel');
- - $spTableInfo = $spTable->info();
- - foreach ($spTableInfo['dependentTables'] as $dep)
- - {
- - if (!in_array($dep, $this->_spFieldOrder)) {
- - $this->_spExcludedFields[] = $dep;
- - }
- - }
- -
- - foreach ($spTableInfo['referenceMap'] as $referenceKey=>$mapping)
- - {
- - if (!in_array($referenceKey, $this->_spFieldOrder)
- - && $referenceKey != 'Profile') {
- - $this->_spExcludedFields[] = $referenceKey;
- - }
- - }
- -
- - $spTable->setExcludedFields($this->_spExcludedFields);
- - $spTable->setExcludeUnorderedFields(true);
- - $spTable->setColumnAliases($this->_spColumnAliases);
- - $spTable->setFieldOrder($this->_spFieldOrder);
- -
- - $profilesTable = $event->getTableObject('Profiles');
- - $profileTableInfo = $profilesTable->info();
- -
- - foreach ($profileTableInfo['dependentTables'] as $dep)
- - {
- - $this->_profileExcludedFields[] = $dep;
- - }
- -
- - foreach ($profileTableInfo['referenceMap'] as $referenceKey=>$mapping)
- - {
- - $this->_profileExcludedFields[] = $referenceKey;
- - }
- -
- - $profilesTable->setFieldOrder($this->_profileFieldOrder);
- - $profilesTable->setExcludedFields($this->_profileExcludedFields);
- - $profilesTable->setExcludeUnorderedFields(true);
- -
- - $profilesTable->setColumnAliases($this->_profileColumnAliases);
- -
- -
- - $sessionsTable = $event->getTableObject('Sessions');
- - $sessionsInfo = $sessionsTable->info();
- -
- - foreach ($sessionsInfo['dependentTables'] as $dep)
- - {
- - if (!in_array($dep, $this->_sessionFieldOrder)) {
- - $this->_sessionExcludedFields[] = $dep;
- - }
- - }
- -
- - foreach ($sessionsInfo['referenceMap'] as $referenceKey=>$mapping)
- - {
- - if (!in_array($referenceKey, $this->_sessionFieldOrder)
- - && $referenceKey != 'Profile') {
- - $this->_sessionExcludedFields[] = $referenceKey;
- - }
- - }
- -
- - $sessionsTable->setFieldOrder($this->_sessionFieldOrder);
- - $sessionsTable->setExcludedFields($this->_sessionExcludedFields);
- - $sessionsTable->setExcludeUnorderedFields(true);
- -
- - $sessionsTable->setColumnAliases($this->_sessionColumnAliases);
- -
- -
- - }
- -
- - private $_spFieldOrder = array('Profile', 'AdditionalQuestions', 'role', 'evaluation_responses', 'evaluation_average',
- - 'evaluation_notes', 'Sessions');
- - private $_spExcludedFields = array('recordID', 'sessionID', 'profileID', 'roleID', 'publicChangesLocked', 'acceptedTerms',
- - 'creationDate');
- -
- - private $_spColumnAliases = array(
- - 'readableRoleID' => 'role',
- - 'numberOfResponses' => 'evaluation_responses',
- - 'averageResponse' => 'evaluation_average',
- - 'notes' => 'evaluation_notes',
- - 'AdditionalQuestionsForXml'=>'AdditionalQuestions'
- - );
- -
- - private $_profileFieldOrder = array('uuid', 'prefix', 'firstName', 'middleName', 'lastName', 'suffix',
- - 'badgeFirstName', 'badgeLastName', 'email', 'emailVerified',
- - 'secondEmail', 'mobilePhone', 'phone', 'extension', 'fax',
- - 'ccName', 'ccEmail', 'ccPhone', 'twitterHandle', 'sex', 'membershipNumber',
- - 'title', 'company', 'division', 'industry', 'address1',
- - 'address2', 'address3', 'address4', 'city', 'state',
- - 'postalCode', 'country', 'hasOptedOut', 'preferredLanguage',
- - 'utcTimezone', 'bio', 'thumbnailUrl', 'taxExemptionNumber', 'taxExemptionNumber2',
- - 'taxExemptionNumber3', 'emergencyContact', 'emergencyPhone', 'emergencyEmail', 'emergencyRelationship',
- - 'ProfileAdditionalQuestions');
- -
- - private $_profileColumnAliases = array( 'readablePrefixID' => 'prefix',
- - 'readableSuffixID' => 'suffix',
- - 'bizPhone' => 'phone',
- - 'bizTitle' => 'title',
- - 'bizName' => 'company',
- - 'bizDivision' => 'division',
- - 'readableBizIndustryID'=> 'industry',
- - 'bizAddress1' => 'address1',
- - 'bizAddress2' => 'address2',
- - 'bizAddress3' => 'address3',
- - 'bizAddress4' => 'address4',
- - 'bizCity' => 'city',
- - 'readableBizStateID' => 'state',
- - 'readableBizCountryID' => 'country',
- - 'bizPostalCode' => 'postalCode',
- - 'AdditionalQuestionsForXml'=>'ProfileAdditionalQuestions'
- - );
- -
- - private $_sessionFieldOrder = array('session_id', 'is_scheduled', 'title', 'programID', 'Program', 'trackID', 'track',
- - 'trackID2', 'track2', 'trackID3', 'track3', 'topicID', 'topic', 'typeID', 'type',
- - 'date', 'roomID', 'room', 'startTime', 'endTime', 'capacity', 'abstract', 'Owner',
- - 'Mentor', 'headcount1', 'headcount2', 'abstract', 'AdditionalQuestions', 'files', 'EvaluationQuestions');
- -
- - private $_sessionExcludedFields = array('status', 'abstractOverallStatus', 'fileOverallStatus', 'publish', 'mentorUserID',
- - 'ownerUserID', 'notes', 'abstractStatus', 'avRequirements', 'creationDate', 'exhibitorID');
- -
- - private $_sessionColumnAliases = array('recordID' => 'session_id',
- - 'readableTitle' =>'title',
- - 'readableNumber' =>'number',
- - 'readableProgramID' =>'Program',
- - 'readableTrack' =>'track',
- - 'readableTopic' =>'topic',
- - 'readableType' =>'type',
- - 'mentor' => 'Mentor',
- - 'owner' => 'Owner',
- - 'AdditionalQuestionsForXml' => 'AdditionalQuestions',
- - 'sessionPersonnelForXml' => 'SessionPersonnel',
- - 'scheduledForXml' => 'is_scheduled',
- - 'readableTrackID' => 'track',
- - 'readableTrackID2' =>'track2',
- - 'readableTrackID3' =>'track3',
- - 'readableTopicID' =>'topic',
- - 'readableTypeID' =>'type',
- - 'sessionDate' => 'date' ,
- - 'readableRoomID' => 'room',
- - 'readableStartTime' => 'startTime',
- - 'readableEndTime' => 'endTime',
- - 'maxAttendance' => 'capacity',
- - 'AbstractForXml' => 'abstract',
- - 'localProfile' => 'Profile',
- - 'filesForXml' => 'files',
- - 'EvaluationQuestionsForXml' => 'EvaluationQuestions'
- - );
- -
- - /**
- - * @return the $_shouldCache
- - */
- - public function getShouldCache ()
- - {
- - return $this->_shouldCache;
- - }
- -
- - /**
- - * // set this to false if you're trying to debug
- - * @param field_type $_shouldCache
- - */
- - public function setShouldCache ($_shouldCache)
- - {
- - $this->_shouldCache = $_shouldCache;
- - }
- -
- -}
- \ No newline at end of file
- diff --git a/classes/IP/Mapper/Xml.php b/classes/IP/Mapper/Xml.php
- index 6f46e90..ecde010 100644
- --- a/classes/IP/Mapper/Xml.php
- +++ b/classes/IP/Mapper/Xml.php
- @@ -70,6 +70,7 @@ class IP_Mapper_Xml extends IP_Mapper_Abstract
- }
- // Adding the child nodes here.
- $values = $this->_getValuesFromMap($instance);
- +
- foreach ($values as $mapKey=>$mapValue)
- {
- if(is_array($mapValue)) {
- @@ -100,9 +101,6 @@ class IP_Mapper_Xml extends IP_Mapper_Abstract
- } else {
- $this->addArrayNode($value, $xml);
- }
- - } else if(is_object($value)) {
- - $arrayVal[$key] = $this->_mapObject($key, $value);
- - $this->addArrayNode($arrayVal, $xml);
- } else {
- $title = $name ? $name : $key;
- $this->_addChildElement($xml, $title, $value);
- @@ -140,17 +138,16 @@ class IP_Mapper_Xml extends IP_Mapper_Abstract
- return $returnArray;
- }
- - protected function _mapMethod($fieldName, $object, $method, $value = '')
- + protected function _mapMethod($fieldName, $object, $method)
- {
- try {
- $result = $object->{$method}();
- if ($result === null) {
- - return ''; // If null is returned then the final value is assumed blank.
- + return $method;
- }
- } catch (Exception $e) {
- - IP_Log::notice('XML Mapper exception in _mapMethod. Attempted method "' . $method . '" of "' . get_class($object) . '". Reverted to the value of ' . $value . ' for XML.');
- - IP_Log::error($e);
- - return $value; // "band-aid" fix to not leave empty data when value is final but matches a method that exists (i.e.: last name of "date" or "row")
- + // ex: getDate() for a guy with the last name "date", band-aid for now
- + return '';
- }
- return $this->_getValueFromMap($fieldName, $result, $object);
- diff --git a/db/Event/499-AddPointColumn.php b/db/Event/499-AddPointColumn.php
- new file mode 100644
- index 0000000..eaa4272
- --- /dev/null
- +++ b/db/Event/499-AddPointColumn.php
- @@ -0,0 +1,24 @@
- +<?php
- +/**
- + * Add points column
- + * @author kshema
- + */
- +class Event_499 extends Migration
- +{
- + public function deploy()
- + {
- + if (!MyDB::getInstance()->columnExists($this->migrationObject->database, Sessions::TABLE, 'points')) {
- + $sql = "ALTER TABLE {$this->getTableName(Sessions::TABLE)} ADD COLUMN `points` smallint(1)";
- + $result = MyDB::getInstance()->execute($sql);
- + if (!$result) {
- + return false;
- + }
- + }
- + return true;
- + }
- +
- + public function getRollbackSQL()
- + {
- + return "ALTER TABLE {$this->getTableName(Sessions::TABLE)} DROP COLUMN `points`";
- + }
- +}
- diff --git a/model/Exhibitor.php b/model/Exhibitor.php
- index bd0df45..ca51669 100644
- --- a/model/Exhibitor.php
- +++ b/model/Exhibitor.php
- @@ -3,7 +3,7 @@
- *
- * @package Models
- */
- -class Exhibitor extends IP_Db_Table_Row_EventAbstract implements XmlTransformable {
- +class Exhibitor extends IP_Db_Table_Row_EventAbstract {
- protected $_isGolf = false;
- @@ -946,7 +946,6 @@ class Exhibitor extends IP_Db_Table_Row_EventAbstract implements XmlTransformabl
- public function save($bypass = false)
- {
- if($bypass) {
- - $this->generateXml();
- //this is a GolfSponsor being saved - bypass the rest of this method
- return parent::save();
- }
- @@ -1043,7 +1042,7 @@ class Exhibitor extends IP_Db_Table_Row_EventAbstract implements XmlTransformabl
- if($this->confirmation == null || $this->confirmation == '') {
- $this->_generateConfirmation();
- }
- - $this->generateXml();
- +
- return parent::save();
- }
- @@ -2166,113 +2165,6 @@ class Exhibitor extends IP_Db_Table_Row_EventAbstract implements XmlTransformabl
- public function getReadableCountry() {
- return $this->Country->full;
- }
- - public function generateXml()
- - {
- - if($this->_isGolf()) {
- - $tableName = 'GolfSponsors';
- - $rowName = 'GolfSponsor';
- - } else {
- - $tableName = 'Exhibitors';
- - $rowName = 'Exhibitor';
- - }
- - // don't generate on public side
- - if (IP::getInstance()->isPublic()) {
- - $this->getTableObject('CronObjectUpdates')->registerUpdate($tableName, $this->recordID);
- - return;
- - }
- -
- - $time = microtime();
- - $service = new IP_Mapper_Service_ExhibitorsXmlFeed(array('isGolf'=>$this->_isGolf()), $this->getEvent());
- - $xml = $service->mapInstance($this);
- - $xmlTable = $this->getEvent()->getTableObject('XmlNodes');
- - $select = $xmlTable->select()->where("objectType = '$tableName'")
- - ->where('objectID = ?', $this->recordID)
- - ->where("parentNodeName = '$tableName'")
- - ->where("nodeName = '$rowName'");
- -
- -
- - if (!($sessionNode = $xmlTable->fetchRow($select))) {
- - $sessionNode = $xmlTable->createRow();
- - // @todo implement parent reference in a way that doesn't break when generating xml on update
- - $sessionNode->objectType = "$tableName";
- - $sessionNode->objectID = $this->recordID;
- - }
- -
- - $sessionNode->nodeName = "$rowName";
- - $sessionNode->parentNodeName = "$tableName";
- - $sessionNode->xmlString = $xml;
- - $sessionNode->save();
- - }
- -
- - public function getExhibitorPersonnelForXml() {
- - $persons = array();
- - foreach ($this->ExhibitorPersonnel as $person) {
- - $persons[] = array(
- - 'additional_personnel' => array(
- - 'Role' => $person->readableExhibitorRoleID,
- - 'Profile' => $person->Profile));
- - }
- - return $persons;
- - }
- -
- - public function getExhibitorBoothsForXml() {
- - $booths = array();
- - foreach ($this->ExhibitorBooths as $booth) {
- - $booths[] = array(
- - 'booth' => array(
- - 'name' => $booth->name,
- - 'booth_type' => $booth->BoothType->description,
- - 'status' => 'Reserved',
- - 'exhibitor_name'=> $this->bizName,
- - 'exhibitor_id' => $this->recordID
- - ));
- - }
- - return $booths;
- - }
- -
- - public function getExbSpPackagesForXml() {
- - $packages = array();
- - foreach ($this->ExhibitorPackages as $package) {
- - $packages[] = array(
- - 'sponsorship_package' => array(
- - 'id' => $package->sponsorshipPackageID,
- - 'name' => $package->name,
- - ));
- - }
- - return $packages;
- - }
- -
- - public function getAnsSponsorshipsForXml() {
- - $packages = array();
- - foreach ($this->ExhibitorsAncillarySponsorships as $package) {
- - $packages[] = array(
- - 'ancillary_sponsorship' => array(
- - 'id' => $package->ancillarySponsorshipID,
- - 'name' => $package->name,
- - ));
- - }
- - return $packages;
- - }
- -
- - public function getAdditionalQuestionsForXml()
- - {
- - $additionalQuestions = array();
- - foreach ($this->AdditionalQuestionResponses as $response)
- - {
- - if (!array_key_exists($response->questionID, $additionalQuestions)) {
- - $additionalQuestions[$response->questionID] = array(
- - 'AdditionalQuestion' => array(
- - 'questionID' => $response->questionID,
- - 'questionLabel' => $response->getQuestionLabel(),
- - 'responses' => array()
- - )
- - );
- - }
- - $responseArray = array('value' => $response->getReadableString(), 'code' => $response->Option->globalAnswerID);
- - $additionalQuestions[$response->questionID]['AdditionalQuestion']['responses'][] = array('response' => $responseArray);
- - }
- - return $additionalQuestions;
- - }
- public function exportColumn($column, $groupBy = null, &$sequentialID, $fileStatus) {
- include('FilesexportController.php');
- diff --git a/model/Exhibitors.php b/model/Exhibitors.php
- index e514cdc..9a13359 100644
- --- a/model/Exhibitors.php
- +++ b/model/Exhibitors.php
- @@ -5,7 +5,7 @@
- * @package Models
- * @subpackage Table
- */
- -class Exhibitors extends IP_Db_Table_EventAbstract implements IP_Mappable_Interface, XmlTrackable
- +class Exhibitors extends IP_Db_Table_EventAbstract implements IP_Mappable_Interface
- {
- protected $_excludedProtectedTableFields = array('golfObject', 'accessCodeDate');
- @@ -1244,52 +1244,4 @@ class Exhibitors extends IP_Db_Table_EventAbstract implements IP_Mappable_Interf
- self::LABEL_PROMOCODES_ANY));
- }
- -
- - public function selectNodesToUpdate($expirationTimeString = "-15 minutes", $limit = null, $offset = 0)
- - {
- - $dbName = $this->getEvent()->getDatabase();
- - $expiredTime = date('Y-m-d H:i:s', strtotime($expirationTimeString, time()));
- - $xmlTable = $this->getEvent()->getTableObject('XmlNodes');
- -
- - $notInXmlSelect = "SELECT recordID FROM {$this->getSelectTableName()}
- - WHERE recordID NOT IN (SELECT objectID FROM {$xmlTable->getSelectTableName()} WHERE objectType = 'Exhibitors' AND objectID IS NOT NULL)";
- -
- - $ids = array();
- - foreach (MyDb::getInstance()->fetchAll($notInXmlSelect) as $row)
- - {
- - $ids[] = $row['recordID'];
- - }
- -
- - $expiredXmlSelect = "SELECT objectID FROM {$xmlTable->getSelectTableName()}
- - WHERE objectType = 'Exhibitors' AND objectID IS NOT NULL
- - AND modifiedDate <= '{$expiredTime}'";
- -
- - foreach (MyDb::getInstance()->fetchAll($expiredXmlSelect) as $row)
- - {
- - $ids[] = $row['objectID'];
- - }
- - if (!empty($ids)) {
- - $implodedIDs = implode(', ', $ids);
- -
- - $expiredSelect = $this->select()->from(array('reg'=>self::TABLE), array('*'), $dbName)
- - ->where("reg.recordID IN ($implodedIDs)");
- - } else {
- - return null;
- -
- - }
- - if ($limit) {
- - $expiredSelect->limit($limit, $offset);
- - }
- -
- - return $expiredSelect;
- -
- - }
- -
- - public function refreshNodes($expirationTimeString = "-15 minutes", $limit = null, $offset = 0)
- - {
- - foreach ($this->fetchAll($this->selectNodesToUpdate($expirationTimeString, $limit, $offset)) as $exhibitor)
- - {
- - $exhibitor->generateXml();
- - }
- - }
- }
- diff --git a/model/Profile.php b/model/Profile.php
- index 36d1483..a27bd78 100644
- --- a/model/Profile.php
- +++ b/model/Profile.php
- @@ -1811,7 +1811,7 @@ class Profile extends IP_Db_Table_Row_EventAbstract
- public function getBuyerCategories() {
- if (count($this->Buyers) > 0) {
- $catogories = $this->Buyers->get(0)->buyerCategoryNames;
- - return implode(", ",$catogories);
- + return implode(",",$catogories);
- }
- return null;
- }
- diff --git a/model/Session.php b/model/Session.php
- index e2d86d4..3366ca5 100644
- --- a/model/Session.php
- +++ b/model/Session.php
- @@ -5,7 +5,7 @@
- * @package Models
- * @subpackage Row
- */
- -class Session extends IP_Db_Table_Row_EventAbstractCalendarObject implements XmlTransformable {
- +class Session extends IP_Db_Table_Row_EventAbstractCalendarObject {
- protected $_usesCache = true;
- @@ -1108,167 +1108,32 @@ class Session extends IP_Db_Table_Row_EventAbstractCalendarObject implements Xml
- return $summary;
- }
- - public function save()
- - {
- - $this->generateXml();
- - parent::save();
- + public function getReadableStartTime() {
- + $startTime = $this->getDateTimeObject('startTime');
- + if ($startTime) {
- + $startTimestamp = $startTime->getTimestamp();
- + return formatTime($startTime);
- + }
- }
- -
- - public function generateXml()
- - {
- - // don't generate on public side
- - if (IP::getInstance()->isPublic()) {
- - $this->getTableObject('CronObjectUpdates')->registerUpdate('Sessions', $this->recordID);
- - return;
- - }
- -
- - $time = microtime();
- - $service = new IP_Mapper_Service_SessionsXmlFeed(array(), $this->getEvent());
- - $xml = $service->mapInstance($this);
- - $xmlTable = $this->getEvent()->getTableObject('XmlNodes');
- - $select = $xmlTable->select()->where('objectType = "Sessions"')
- - ->where('objectID = ?', $this->recordID)
- - ->where('parentNodeName = "Sessions"')
- - ->where('nodeName = "Session"');
- -
- -
- - if (!($sessionNode = $xmlTable->fetchRow($select))) {
- - $sessionNode = $xmlTable->createRow();
- - // @todo implement parent reference in a way that doesn't break when generating xml on update
- - $sessionNode->objectType = "Sessions";
- - $sessionNode->objectID = $this->recordID;
- - }
- -
- - $sessionNode->nodeName = 'Session';
- - $sessionNode->parentNodeName = 'Sessions';
- - $sessionNode->xmlString = $xml;
- - $sessionNode->save();
- - }
- -
- - public function getSessionPersonnelForXml()
- - {
- - $sp = array();
- - foreach ($this->SessionPersonnel as $ra)
- - {
- - $sp[] = array('Speaker' => array(
- - 'Role' => $ra->readableRoleID,
- - 'Profile' => $ra->Profile,
- - 'evaluation_responses' => $ra->numberOfResponses,
- - 'evaluation_average' => $ra->averageResponse,
- - 'evaluation_notes' => $ra->notes,
- - 'sessionPersonnel_AdditionalQuestions' => $ra->additionalQuestionsForXml
- - ));
- - }
- - return $sp;
- - }
- - public function getAdditionalQuestionsForXml()
- - {
- - $additionalQuestions = array();
- - foreach ($this->AdditionalQuestionResponses as $response)
- - {
- - if (!array_key_exists($response->questionID, $additionalQuestions)) {
- - $additionalQuestions[$response->questionID] = array(
- - 'AdditionalQuestion' => array(
- - 'questionID' => $response->questionID,
- - 'questionLabel' => $response->getQuestionLabel(),
- - 'responses' => array()
- - )
- - );
- - }
- - $responseArray = array('value' => $response->getReadableString(), 'code' => $response->Option->globalAnswerID);
- - $additionalQuestions[$response->questionID]['AdditionalQuestion']['responses'][] = array('response' => $responseArray);
- - }
- - return $additionalQuestions;
- - }
- -
- - public function getScheduledForXml() {
- - $date = '';
- - $startTime = $this->getDateTimeObject('startTime');
- - if ($startTime) {
- - $date = formatDate($startTime);
- - }
- - if (empty($date)) {
- - return IP::_('IP::NO');
- - } else {
- - return IP::_('IP::YES');
- - }
- - }
- - public function getReadableStartTime() {
- - $startTime = $this->getDateTimeObject('startTime');
- - if ($startTime) {
- - $startTimestamp = $startTime->getTimestamp();
- - return formatTime($startTime);
- - }
- - }
- -
- - public function getReadableEndTime() {
- - $endTime = $this->getDateTimeObject('endTime');
- - if ($endTime) {
- - $startTimestamp = $endTime->getTimestamp();
- - return formatTime($endTime);
- - }
- - }
- -
- - public function getAbstractForXml() {
- - $abstarct = '';
- - $approvedAbstract = $this->getApprovedAbstract();
- - if ($approvedAbstract) {
- - $abstarct = $approvedAbstract->text;
- - } else {
- - $abstarct = '';
- - }
- - return $abstarct;
- - }
- -
- - public function getFilesForXml() {
- - $files = array();
- - foreach ($this->SessionFiles as $file)
- - {
- - $files[] = array(
- - 'file' => array(
- - 'title' => $file->filename,
- - 'type' => $file->filetype,
- - 'url' => $file->url,
- - 'description' => $file->description,
- - 'size' => $file->filesize
- - )
- - );
- -
- - }
- - return $files;
- - }
- -
- - public function getEvaluationQuestionsForXml()
- - {
- - $evaluationQuestions = array();
- - foreach ($this->SessionEvaluationQuestions as $qstn)
- - {
- - if ($qstn->SessionEvaluationQuestionConfig->questionType == SessionEvaluationQuestionConfigs::QUESTION_TYPE_RANKING) {
- - $value = $qstn->averageResponse;
- - } else if ($qstn->SessionEvaluationQuestionConfig->questionType == SessionEvaluationQuestionConfigs::QUESTION_TYPE_TEXT) {
- - $value = $qstn->notes;
- - }
- - $evaluationQuestions[] = array(
- - 'EvaluationQuestion' => array(
- - 'global_question_id' => $qstn->globalQuestionID,
- - 'label' => $qstn->questionLabel,
- - 'value' => $value,
- - 'responses' => $qstn->questionNumberOfResponses
- - )
- - );
- +
- + public function getReadableEndTime() {
- + $endTime = $this->getDateTimeObject('endTime');
- + if ($endTime) {
- + $startTimestamp = $endTime->getTimestamp();
- + return formatTime($endTime);
- }
- -
- - return $evaluationQuestions;
- - }
- -
- - public function getAbstractApproved() {
- - return $this->AbstractHistories->getApprovedAbstract();
- - }
- + }
- +
- + public function getAbstractApproved() {
- + return $this->AbstractHistories->getApprovedAbstract();
- + }
- +
- + public function getAbstractLatest() {
- + return $this->AbstractHistories->getLatestAbstract();
- + }
- +
- + public function getFileOverallStatus() {
- + return $this->fileOverallStatus;
- + }
- - public function getAbstractLatest() {
- - return $this->AbstractHistories->getLatestAbstract();
- - }
- - public function getFileOverallStatus() {
- - return $this->fileOverallStatus;
- - }
- }
- diff --git a/model/SessionPerson.php b/model/SessionPerson.php
- index d1e3a93..b74ec6b 100644
- --- a/model/SessionPerson.php
- +++ b/model/SessionPerson.php
- @@ -5,7 +5,7 @@
- * @package Models
- * @subpackage Row
- */
- -class SessionPerson extends IP_Db_Table_Row_EventAbstract implements XmlTransformable {
- +class SessionPerson extends IP_Db_Table_Row_EventAbstract {
- protected $_usesCache = true;
- protected $_sendTemplateOnPersonAdd = false;
- @@ -260,60 +260,5 @@ class SessionPerson extends IP_Db_Table_Row_EventAbstract implements XmlTransfor
- }
- parent::delete();
- }
- - public function save()
- - {
- - $this->generateXml();
- - parent::save();
- - }
- -
- - public function generateXml()
- - {
- - // don't generate on public side
- - if (IP::getInstance()->isPublic()) {
- - $this->getTableObject('CronObjectUpdates')->registerUpdate('SessionPersonnel', $this->recordID);
- - return;
- - }
- -
- - $time = microtime();
- - $service = new IP_Mapper_Service_SpeakersXmlFeed(array(), $this->getEvent());
- - $xml = $service->mapInstance($this);
- - $xmlTable = $this->getEvent()->getTableObject('XmlNodes');
- - $select = $xmlTable->select()->where('objectType = "SessionPersonnel"')
- - ->where('objectID = ?', $this->recordID)
- - ->where('parentNodeName = "SessionPersonnel"')
- - ->where('nodeName = "SessionPerson"');
- -
- -
- - if (!($sessionNode = $xmlTable->fetchRow($select))) {
- - $sessionNode = $xmlTable->createRow();
- - // @todo implement parent reference in a way that doesn't break when generating xml on update
- - $sessionNode->objectType = "SessionPersonnel";
- - $sessionNode->objectID = $this->recordID;
- - }
- -
- - $sessionNode->nodeName = 'SessionPerson';
- - $sessionNode->parentNodeName = 'SessionPersonnel';
- - $sessionNode->xmlString = $xml;
- - $sessionNode->save();
- - }
- -
- - public function getAdditionalQuestionsForXml()
- - {
- - $additionalQuestions = array();
- - foreach ($this->AdditionalQuestionResponses as $response)
- - {
- - if (!array_key_exists($response->questionID, $additionalQuestions)) {
- - $additionalQuestions[$response->questionID] = array(
- - 'AdditionalQuestion' => array(
- - 'questionID' => $response->questionID,
- - 'questionLabel' => $response->getQuestionLabel(),
- - 'responses' => array()
- - )
- - );
- - }
- - $responseArray = array('value' => $response->getReadableString(), 'code' => $response->Option->globalAnswerID);
- - $additionalQuestions[$response->questionID]['AdditionalQuestion']['responses'][] = array('response' => $responseArray);
- - }
- - return $additionalQuestions;
- - }
- +
- }
- diff --git a/model/SessionPersonnel.php b/model/SessionPersonnel.php
- index 269bb58..9ddebb9 100644
- --- a/model/SessionPersonnel.php
- +++ b/model/SessionPersonnel.php
- @@ -5,7 +5,7 @@
- * @package Models
- * @subpackage Table
- */
- -class SessionPersonnel extends IP_Db_Table_EventAbstract implements IP_Mappable_Interface, XmlTrackable
- +class SessionPersonnel extends IP_Db_Table_EventAbstract implements IP_Mappable_Interface
- {
- protected $_excludedProtectedTableFields = array('recordID', 'publicChangesLocked', 'creationDate', 'profileID');
- protected $_rowClass = 'SessionPerson';
- @@ -608,52 +608,4 @@ class SessionPersonnel extends IP_Db_Table_EventAbstract implements IP_Mappable_
- );
- }
- - public function selectNodesToUpdate($expirationTimeString = "-15 minutes", $limit = null, $offset = 0)
- - {
- - $dbName = $this->getEvent()->getDatabase();
- - $expiredTime = date('Y-m-d H:i:s', strtotime($expirationTimeString, time()));
- - $xmlTable = $this->getEvent()->getTableObject('XmlNodes');
- -
- - $notInXmlSelect = "SELECT recordID FROM {$this->getSelectTableName()}
- - WHERE recordID NOT IN (SELECT objectID FROM {$xmlTable->getSelectTableName()} WHERE objectType = 'SessionPersonnel' AND objectID IS NOT NULL)";
- -
- - $ids = array();
- - foreach (MyDb::getInstance()->fetchAll($notInXmlSelect) as $row)
- - {
- - $ids[] = $row['recordID'];
- - }
- -
- - $expiredXmlSelect = "SELECT objectID FROM {$xmlTable->getSelectTableName()}
- - WHERE objectType = 'SessionPersonnel' AND objectID IS NOT NULL
- - AND modifiedDate <= '{$expiredTime}'";
- -
- - foreach (MyDb::getInstance()->fetchAll($expiredXmlSelect) as $row)
- - {
- - $ids[] = $row['objectID'];
- - }
- - if (!empty($ids)) {
- - $implodedIDs = implode(', ', $ids);
- -
- - $expiredSelect = $this->select()->from(array('reg'=>self::TABLE), array('*'), $dbName)
- - ->where("reg.recordID IN ($implodedIDs)");
- - } else {
- - return null;
- -
- - }
- - if ($limit) {
- - $expiredSelect->limit($limit, $offset);
- - }
- -
- - return $expiredSelect;
- -
- - }
- -
- - public function refreshNodes($expirationTimeString = "-15 minutes", $limit = null, $offset = 0)
- - {
- - foreach ($this->fetchAll($this->selectNodesToUpdate($expirationTimeString, $limit, $offset)) as $speaker)
- - {
- - $speaker->generateXml();
- - }
- - }
- -
- }
- diff --git a/model/Sessions.php b/model/Sessions.php
- index 9a4e216..f83afde 100644
- --- a/model/Sessions.php
- +++ b/model/Sessions.php
- @@ -5,7 +5,7 @@
- * @package Models
- * @subpackage Table
- */
- -class Sessions extends IP_Db_Table_EventAbstractCalendarObject implements IP_Mappable_Interface, XmlTrackable
- +class Sessions extends IP_Db_Table_EventAbstractCalendarObject implements IP_Mappable_Interface
- {
- protected $_excludedProtectedTableFields = array('creationDate', 'recordID');
- protected $_rowClass = 'Session';
- @@ -21,6 +21,7 @@ class Sessions extends IP_Db_Table_EventAbstractCalendarObject implements IP_Map
- const LABEL_SCHEDULED = 'Scheduled';
- const LABEL_STATUS = 'Status';
- const LABEL_TITLE = 'Title';
- + const LABEL_POINTS = 'Points';
- const LABEL_NUMBER = 'Number';
- const LABEL_TYPEID = 'Type';
- const LABEL_PROGRAMID = 'Program';
- @@ -203,6 +204,7 @@ class Sessions extends IP_Db_Table_EventAbstractCalendarObject implements IP_Map
- $this->addColumn('modifiedDate',self::DATETIME);
- $this->addColumn('objectCreated', self::DATE);
- $this->addColumn('objectModified', self::DATE);
- + $this->addColumn('points', self::SMALLINT);
- return true;
- }
- @@ -1113,60 +1115,11 @@ class Sessions extends IP_Db_Table_EventAbstractCalendarObject implements IP_Map
- }
- return implode(', ' , $registrationWorkshopTitles);
- }
- -
- - public function getSubTemplateTypes() {
- - return array(array('name'=>'Sessions', 'context'=>'SessionManagementPerson.SessionPerson.Sessions', 'description'=>'When included in a template, this sub-template will be repeated for each Session.'));
- - }
- - public function enableSubTemplates() {
- - return true;
- - }
- -
- - public function selectNodesToUpdate($expirationTimeString = "-15 minutes", $limit = null, $offset = 0)
- - {
- - $dbName = $this->getEvent()->getDatabase();
- - $expiredTime = date('Y-m-d H:i:s', strtotime($expirationTimeString, time()));
- - $xmlTable = $this->getEvent()->getTableObject('XmlNodes');
- -
- - $notInXmlSelect = "SELECT recordID FROM {$this->getSelectTableName()}
- - WHERE recordID NOT IN (SELECT objectID FROM {$xmlTable->getSelectTableName()} WHERE objectType = 'Sessions' AND objectID IS NOT NULL)";
- -
- - $ids = array();
- - foreach (MyDb::getInstance()->fetchAll($notInXmlSelect) as $row)
- - {
- - $ids[] = $row['recordID'];
- - }
- -
- - $expiredXmlSelect = "SELECT objectID FROM {$xmlTable->getSelectTableName()}
- - WHERE objectType = 'Sessions' AND objectID IS NOT NULL
- - AND modifiedDate <= '{$expiredTime}'";
- -
- - foreach (MyDb::getInstance()->fetchAll($expiredXmlSelect) as $row)
- - {
- - $ids[] = $row['objectID'];
- - }
- - if (!empty($ids)) {
- - $implodedIDs = implode(', ', $ids);
- -
- - $expiredSelect = $this->select()->from(array('reg'=>self::TABLE), array('*'), $dbName)
- - ->where("reg.recordID IN ($implodedIDs)");
- - } else {
- - return null;
- -
- - }
- - if ($limit) {
- - $expiredSelect->limit($limit, $offset);
- - }
- -
- - return $expiredSelect;
- -
- - }
- -
- - public function refreshNodes($expirationTimeString = "-15 minutes", $limit = null, $offset = 0)
- - {
- - foreach ($this->fetchAll($this->selectNodesToUpdate($expirationTimeString, $limit, $offset)) as $session)
- - {
- - $session->generateXml();
- - }
- - }
- + public function getSubTemplateTypes() {
- + return array(array('name'=>'Sessions', 'context'=>'SessionManagementPerson.SessionPerson.Sessions', 'description'=>'When included in a template, this sub-template will be repeated for each Session.'));
- + }
- + public function enableSubTemplates() {
- + return true;
- + }
- }
- diff --git a/phing/classes/RefreshXml.php b/phing/classes/RefreshXml.php
- index ddb3d40..27b4948 100644
- --- a/phing/classes/RefreshXml.php
- +++ b/phing/classes/RefreshXml.php
- @@ -98,14 +98,10 @@ class RefreshXml extends Task
- $expirationString = "-{$this->expirationTime} minutes";
- $countSelect = $table->selectNodesToUpdate();
- - if($countSelect) {
- $countSelect->reset(Zend_Db_Select::COLUMNS);
- $countSelect->columns('count(reg.recordID)');
- - $this->log($countSelect);
- $count = MyDb::getInstance()->fetchOne($countSelect);
- - } else {
- - $count = 0;
- - }
- +
- $this->log(sprintf('%s: Processing %d %s', $event->url, $count, $this->class));
- for ($i = 0; $i <= ((int)$count/100); $i++)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement