diff --git a/datepicker/code/JQueryUIDatePickerField.php b/datepicker/code/JQueryUIDatePickerField.php index 8b0ff92..6cbf833 100644 --- a/datepicker/code/JQueryUIDatePickerField.php +++ b/datepicker/code/JQueryUIDatePickerField.php @@ -34,12 +34,10 @@ class JQueryUIDatePickerField extends TextField { function Field() { $this->addExtraClass('DatePickerField'); Requirements::block(SAPPHIRE_DIR .'/thirdparty/jquery/jquery.js'); - - Requirements::css("themes/openstack/javascript/jquery-ui-1.10.3.custom/css/smoothness/jquery-ui-1.10.3.custom.min.css"); - Requirements::javascript('themes/openstack/javascript/jquery-2.0.3.min.js'); Requirements::javascript('themes/openstack/javascript/jquery-migrate-1.2.1.min.js'); - Requirements::javascript("themes/openstack/javascript/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.min.js"); + Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css'); + Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js'); Requirements::javascript("datepicker/javascript/datepicker.js"); $attributes = array( diff --git a/events/code/ui/admin/SangriaPageEventExtension.php b/events/code/ui/admin/SangriaPageEventExtension.php index fddf16f..c60dc38 100644 --- a/events/code/ui/admin/SangriaPageEventExtension.php +++ b/events/code/ui/admin/SangriaPageEventExtension.php @@ -25,6 +25,7 @@ final class SangriaPageEventExtension extends Extension { public function onBeforeInit(){ Config::inst()->update(get_class($this), 'allowed_actions', array('ViewEventDetails')); + Config::inst()->update(get_class($this->owner), 'allowed_actions', array('ViewEventDetails')); } public function EventRegistrationRequestForm() { @@ -50,12 +51,12 @@ final class SangriaPageEventExtension extends Extension { private function commonScripts(){ Requirements::css("themes/openstack/css/chosen.css", "screen,projection"); - Requirements::css("themes/openstack/javascript/jquery-ui-1.10.3.custom/css/smoothness/jquery-ui-1.10.3.custom.min.css"); + Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css'); + Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js'); Requirements::css("events/css/sangria.page.view.event.details.css"); Requirements::javascript("themes/openstack/javascript/chosen.jquery.min.js"); Requirements::javascript(Director::protocol()."ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"); Requirements::javascript(Director::protocol()."ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.min.js"); - Requirements::javascript("themes/openstack/javascript/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.js"); Requirements::javascript("themes/openstack/javascript/jquery.ui.datepicker.validation.package-1.0.1/jquery.ui.datepicker.validation.js"); Requirements::javascript("themes/openstack/javascript/jquery.validate.custom.methods.js"); Requirements::javascript('marketplace/code/ui/admin/js/utils.js'); diff --git a/events/code/ui/frontend/EventRegistrationRequestPage.php b/events/code/ui/frontend/EventRegistrationRequestPage.php index 733b02b..7a3ae7d 100644 --- a/events/code/ui/frontend/EventRegistrationRequestPage.php +++ b/events/code/ui/frontend/EventRegistrationRequestPage.php @@ -69,11 +69,11 @@ final class EventRegistrationRequestPage_Controller extends Page_Controller { ); //js files Requirements::css("themes/openstack/css/chosen.css", "screen,projection"); - Requirements::css("themes/openstack/javascript/jquery-ui-1.10.3.custom/css/smoothness/jquery-ui-1.10.3.custom.min.css"); + Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css'); + Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js'); Requirements::javascript("themes/openstack/javascript/chosen.jquery.min.js"); Requirements::javascript(Director::protocol()."ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"); Requirements::javascript(Director::protocol()."ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.min.js"); - Requirements::javascript("themes/openstack/javascript/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.js"); Requirements::javascript("themes/openstack/javascript/jquery.ui.datepicker.validation.package-1.0.1/jquery.ui.datepicker.validation.js"); Requirements::javascript("themes/openstack/javascript/jquery.validate.custom.methods.js"); Requirements::javascript('events/js/event.registration.request.page.js'); diff --git a/events/templates/Layout/Includes/EventRegistrationRequestForm.ss b/events/templates/Layout/Includes/EventRegistrationRequestForm.ss index aa8cebb..714a5e3 100644 --- a/events/templates/Layout/Includes/EventRegistrationRequestForm.ss +++ b/events/templates/Layout/Includes/EventRegistrationRequestForm.ss @@ -1,5 +1,5 @@ <% if IncludeFormTag %> -
+ <% end_if %> <% if Message %>

$Message

@@ -51,7 +51,7 @@ -
+

Event Location

@@ -78,17 +78,20 @@
-
-

Event Duration

- -
+
+
+

Event Duration

+
+
+
+
$Fields.dataFieldByName(start_date)
-
+
diff --git a/jobs/code/ui/admin/SangriaPageJobsExtension.php b/jobs/code/ui/admin/SangriaPageJobsExtension.php index 78479d7..e98ad0e 100644 --- a/jobs/code/ui/admin/SangriaPageJobsExtension.php +++ b/jobs/code/ui/admin/SangriaPageJobsExtension.php @@ -25,6 +25,7 @@ final class SangriaPageJobsExtension extends Extension { public function onBeforeInit(){ Config::inst()->update(get_class($this), 'allowed_actions', array('ViewJobsDetails')); + Config::inst()->update(get_class($this->owner), 'allowed_actions', array('ViewJobsDetails')); } public function onAfterInit(){ @@ -33,11 +34,11 @@ final class SangriaPageJobsExtension extends Extension { private function commonScripts(){ Requirements::css("themes/openstack/css/chosen.css", "screen,projection"); - Requirements::css("themes/openstack/javascript/jquery-ui-1.10.3.custom/css/smoothness/jquery-ui-1.10.3.custom.min.css"); Requirements::javascript("themes/openstack/javascript/chosen.jquery.min.js"); Requirements::javascript(Director::protocol()."ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"); Requirements::javascript(Director::protocol()."ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.min.js"); - Requirements::javascript("themes/openstack/javascript/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.js"); + Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css'); + Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js'); Requirements::javascript("themes/openstack/javascript/jquery.ui.datepicker.validation.package-1.0.1/jquery.ui.datepicker.validation.js"); Requirements::javascript("themes/openstack/javascript/jquery.validate.custom.methods.js"); Requirements::javascript('marketplace/code/ui/admin/js/utils.js'); diff --git a/jobs/code/ui/frontend/JobRegistrationRequestPage.php b/jobs/code/ui/frontend/JobRegistrationRequestPage.php index 7af9a0f..e3afb9e 100644 --- a/jobs/code/ui/frontend/JobRegistrationRequestPage.php +++ b/jobs/code/ui/frontend/JobRegistrationRequestPage.php @@ -32,12 +32,12 @@ final class JobRegistrationRequestPage_Controller extends Page_Controller { function init() { parent::init(); + Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css'); + Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js'); Requirements::css("themes/openstack/css/chosen.css", "screen,projection"); - Requirements::css("themes/openstack/javascript/jquery-ui-1.10.3.custom/css/smoothness/jquery-ui-1.10.3.custom.min.css"); Requirements::javascript("themes/openstack/javascript/chosen.jquery.min.js"); Requirements::javascript(Director::protocol()."ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"); Requirements::javascript(Director::protocol()."ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.min.js"); - Requirements::javascript("themes/openstack/javascript/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.js"); Requirements::javascript("themes/openstack/javascript/jquery.ui.datepicker.validation.package-1.0.1/jquery.ui.datepicker.validation.js"); Requirements::javascript("themes/openstack/javascript/jquery.validate.custom.methods.js"); Requirements::javascript(Director::protocol()."maps.googleapis.com/maps/api/js?sensor=false"); diff --git a/marketplace/code/ui/frontend/CloudsDirectoryPage_Controller.php b/marketplace/code/ui/frontend/CloudsDirectoryPage_Controller.php index 7233eb6..c6d64b5 100644 --- a/marketplace/code/ui/frontend/CloudsDirectoryPage_Controller.php +++ b/marketplace/code/ui/frontend/CloudsDirectoryPage_Controller.php @@ -132,15 +132,17 @@ abstract class CloudsDirectoryPage_Controller extends MarketPlaceDirectoryPage_C parent::init(); $cloud_type = $this->getCloudTypeForJS(); + Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css'); + Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js'); + Requirements::customScript(" var cloud_type = '{$cloud_type}' jQuery(document).ready(function($) { $('#{$cloud_type}','.marketplace-nav').addClass('current'); });"); - Requirements::css("themes/openstack/javascript/jquery-ui-1.10.3.custom/css/smoothness/jquery-ui-1.10.3.custom.min.css"); Requirements::css("themes/openstack/css/chosen.css", "screen,projection"); - Requirements::javascript("themes/openstack/javascript/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.min.js"); + Requirements::javascript(Director::protocol()."maps.googleapis.com/maps/api/js?sensor=false"); Requirements::javascript("marketplace/code/ui/admin/js/utils.js"); Requirements::javascript("marketplace/code/ui/frontend/js/markerclusterer.js"); diff --git a/marketplace/code/ui/frontend/ConsultantsDirectoryPage.php b/marketplace/code/ui/frontend/ConsultantsDirectoryPage.php index 9638d85..813ef01 100644 --- a/marketplace/code/ui/frontend/ConsultantsDirectoryPage.php +++ b/marketplace/code/ui/frontend/ConsultantsDirectoryPage.php @@ -54,12 +54,13 @@ class ConsultantsDirectoryPage_Controller extends MarketPlaceDirectoryPage_Contr function init() { parent::init(); + Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css'); + Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js'); + Requirements::customScript("jQuery(document).ready(function($) { $('#consulting','.marketplace-nav').addClass('current'); });"); - Requirements::css("themes/openstack/javascript/jquery-ui-1.10.3.custom/css/smoothness/jquery-ui-1.10.3.custom.min.css"); Requirements::css("themes/openstack/css/chosen.css", "screen,projection"); - Requirements::javascript("themes/openstack/javascript/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.min.js"); Requirements::javascript(Director::protocol()."maps.googleapis.com/maps/api/js?sensor=false"); Requirements::javascript("marketplace/code/ui/admin/js/utils.js"); Requirements::javascript("marketplace/code/ui/frontend/js/markerclusterer.js"); diff --git a/marketplace/code/ui/frontend/DistributionsDirectoryPage.php b/marketplace/code/ui/frontend/DistributionsDirectoryPage.php index f706e8d..c76c076 100644 --- a/marketplace/code/ui/frontend/DistributionsDirectoryPage.php +++ b/marketplace/code/ui/frontend/DistributionsDirectoryPage.php @@ -58,12 +58,15 @@ class DistributionsDirectoryPage_Controller extends MarketPlaceDirectoryPage_Con function init() { parent::init(); + + Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css'); + Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js'); + Requirements::customScript("jQuery(document).ready(function($) { $('#distros','.marketplace-nav').addClass('current'); });"); - Requirements::css("themes/openstack/javascript/jquery-ui-1.10.3.custom/css/smoothness/jquery-ui-1.10.3.custom.min.css"); Requirements::css("themes/openstack/css/chosen.css", "screen,projection"); - Requirements::javascript("themes/openstack/javascript/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.min.js"); + Requirements::javascript("themes/openstack/javascript/chosen.jquery.min.js"); Requirements::javascript("marketplace/code/ui/frontend/js/implementation.directory.page.js"); Requirements::customScript($this->GATrackingCode()); diff --git a/marketplace/code/ui/frontend/TrainingDirectoryPage.php b/marketplace/code/ui/frontend/TrainingDirectoryPage.php index 4564755..a682063 100644 --- a/marketplace/code/ui/frontend/TrainingDirectoryPage.php +++ b/marketplace/code/ui/frontend/TrainingDirectoryPage.php @@ -49,10 +49,10 @@ class TrainingDirectoryPage_Controller extends MarketPlaceDirectoryPage_Controll function init(){ parent::init(); //JS - Requirements::css("themes/openstack/javascript/jquery-ui-1.10.3.custom/css/smoothness/jquery-ui-1.10.3.custom.min.css"); - Requirements::css("themes/openstack/css/chosen.css", "screen,projection"); - Requirements::javascript("themes/openstack/javascript/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.min.js"); + Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css'); + Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js'); + Requirements::css("themes/openstack/css/chosen.css", "screen,projection"); Requirements::javascript("themes/openstack/javascript/chosen.jquery.min.js"); Requirements::javascript("marketplace/code/ui/frontend/js/training.directory.page.js"); Requirements::customScript("jQuery(document).ready(function($) { diff --git a/news/code/ui/frontend/NewsRequestPage.php b/news/code/ui/frontend/NewsRequestPage.php index f7b56d1..68525fb 100644 --- a/news/code/ui/frontend/NewsRequestPage.php +++ b/news/code/ui/frontend/NewsRequestPage.php @@ -82,13 +82,7 @@ final class NewsRequestPage_Controller extends Page_Controller { private function commonScripts(){ Requirements::css("themes/openstack/javascript/datetimepicker/jquery.datetimepicker.css"); Requirements::javascript("themes/openstack/javascript/datetimepicker/jquery.datetimepicker.js"); - - Requirements::javascript(Director::protocol()."ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"); - /*Requirements::javascript("themes/openstack/javascript/jquery.validate.custom.methods.js"); - Requirements::javascript(Director::protocol()."ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.min.js"); - Requirements::javascript("themes/openstack/javascript/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.js"); - Requirements::javascript("themes/openstack/javascript/jquery.ui.datepicker.validation.package-1.0.1/jquery.ui.datepicker.validation.js");*/ - + Requirements::javascript(Director::protocol()."ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"); } function saveNewsArticle($data, Form $form){ diff --git a/openstack/_config.php b/openstack/_config.php index 24d757b..bf777f6 100644 --- a/openstack/_config.php +++ b/openstack/_config.php @@ -87,4 +87,15 @@ if (Director::isDev()) { SSViewer::flush_template_cache(); //Set default login Security::setDefaultAdmin('admin','pass'); -} \ No newline at end of file +} + +//sangria configuration +Object::add_extension('SangriaPage_Controller', 'SangriaPageDeploymentExtension'); +Object::add_extension('SangriaPage_Controller', 'SangriaPageStandardizeOrgNamesExtension'); +Object::add_extension('SangriaPage_Controller', 'SangriaPageViewCurrentStoriesExtension'); +Object::add_extension('SangriaPage_Controller', 'SangriaPageExportDataExtension'); +Object::add_extension('SangriaPage_Controller', 'SangriaPageViewSpeakingSubmissionsExtension'); +Object::add_extension('SangriaPage_Controller', 'SangriaSetCategorySponsorsExtension'); +Object::add_extension('SangriaPage_Controller', 'SangriaPageInvolvementTypeExtension'); + +HTTP::set_cache_age(0); diff --git a/openstack/_config/routes.yml b/openstack/_config/routes.yml index 9f1946f..e738dff 100644 --- a/openstack/_config/routes.yml +++ b/openstack/_config/routes.yml @@ -5,4 +5,3 @@ After: 'framework/routes#coreroutes' Director: rules: 'depsurvey': 'DeploymentSurveyController' ---- \ No newline at end of file diff --git a/openstack/code/CompanyListPage.php b/openstack/code/CompanyListPage.php index 9f8eebd..71afca7 100644 --- a/openstack/code/CompanyListPage.php +++ b/openstack/code/CompanyListPage.php @@ -48,14 +48,16 @@ class CompanyListPage_Controller extends Page_Controller Requirements::css("themes/openstack/css/chosen.css", "screen,projection"); Requirements::css("themes/openstack/css/jquery.autocomplete.css"); - Requirements::css(THEMES_DIR, "/openstack/javascript/jquery-ui-1.10.3.custom/css/smoothness/jquery-ui-1.10.3.custom.min.css"); + + Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css'); + Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js'); Requirements::javascript("themes/openstack/javascript/chosen.jquery.min.js"); Requirements::javascript("themes/openstack/javascript/jquery.autocomplete.min.js"); Requirements::javascript(Director::protocol()."ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"); Requirements::javascript(Director::protocol()."ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.min.js"); - Requirements::javascript(THEMES_DIR, "/openstack/javascript/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.min.js"); + } function DisplayedCompanies($type) diff --git a/openstack/code/SangriaPage.php b/openstack/code/SangriaPage.php deleted file mode 100644 index 43f810f..0000000 --- a/openstack/code/SangriaPage.php +++ /dev/null @@ -1,1425 +0,0 @@ -default_start_date = date('Y/m/d', strtotime('-12 months')) . ' 00:00'; - $this->default_end_date = date('Y/m/d') . ' 23:59'; - } - - function providePermissions() - { - return array( - "SANGRIA_ACCESS" => "Access the Sangria Admin" - ); - } - - // Deployment Survey Filters - - - function DeploymentSurveyDeploymentsFilters($action) - { - Requirements::css("themes/openstack/javascript/datetimepicker/jquery.datetimepicker.css"); - Requirements::javascript("themes/openstack/javascript/datetimepicker/jquery.datetimepicker.js"); - Requirements::css("themes/openstack/css/deployment.survey.page.css"); - Requirements::javascript("themes/openstack/javascript/deployment.survey.filters.js"); - $data = Session::get("FormInfo.Form_DeploymentSurveyDeploymentsFilters.data"); - $params = $this->requestParams; - $start_date = (isset($params['date-from'])) ? $params['date-from'] : $this->default_start_date; - $end_date = (isset($params['date-to'])) ? $params['date-to'] : $this->default_end_date; - $form = new DeploymentSurveyDeploymentsFilters($this, 'DeploymentSurveyDeploymentsFilters', $action, $start_date, $end_date); - // we should also load the data stored in the session. if failed - if (is_array($data)) { - $form->loadDataFrom($data); - } - } - - // DASHBOARD METRICS - - - function IndividualMemberCount() - { - return EntityCounterHelper::getInstance()->EntityCount('FoundationMember', function () { - $query = new IndividualFoundationMemberCountQuery(); - $res = $query->handle(null)->getResult(); - return $res[0]; - }); - } - - function CommunityMemberCount() - { - return EntityCounterHelper::getInstance()->EntityCount('CommunityMember', function () { - $query = new IndividualCommunityMemberCountQuery(); - $res = $query->handle(null)->getResult(); - return $res[0]; - }); - } - - function NewsletterMemberCount() - { - return EntityCounterHelper::getInstance()->EntityCount('NewsletterMember', function () { - $query = new FoundationMembersSubscribedToNewsLetterCountQuery(); - $res = $query->handle(new FoundationMembersSubscribedToNewsLetterCountQuerySpecification)->getResult(); - return $res[0]; - }); - } - - function NewsletterPercentage() - { - return number_format(($this->NewsletterMemberCount() / $this->IndividualMemberCount()) * 100, 2); - } - - function UserStoryCount() - { - return EntityCounterHelper::getInstance()->EntityCount('UserStory', function () { - $query = new UserStoriesCountQuery(); - $res = $query->handle(new UserStoriesCountQuerySpecification(true))->getResult(); - return $res[0]; - }); - } - - function UserLogoCount() - { - return EntityCounterHelper::getInstance()->EntityCount('UserLogo', function () { - $query = new UserStoriesCountQuery(); - $res = $query->handle(new UserStoriesCountQuerySpecification(false))->getResult(); - return $res[0]; - }); - } - - function PlatinumMemberCount() - { - return EntityCounterHelper::getInstance()->EntityCount('PlatinumOrg', function () { - $query = new CompanyCountQuery(); - $res = $query->handle(new CompanyCountQuerySpecification('Platinum'))->getResult(); - return $res[0]; - }); - } - - function GoldMemberCount() - { - return EntityCounterHelper::getInstance()->EntityCount('GoldOrg', function () { - $query = new CompanyCountQuery(); - $res = $query->handle(new CompanyCountQuerySpecification('Gold'))->getResult(); - return $res[0]; - }); - } - - function CorporateSponsorCount() - { - return EntityCounterHelper::getInstance()->EntityCount('CorporateOrg', function () { - $query = new CompanyCountQuery(); - $res = $query->handle(new CompanyCountQuerySpecification('Corporate'))->getResult(); - return $res[0]; - }); - } - - function StartupSponsorCount() - { - return EntityCounterHelper::getInstance()->EntityCount('StartupOrg', function () { - $query = new CompanyCountQuery(); - $res = $query->handle(new CompanyCountQuerySpecification('Startup'))->getResult(); - return $res[0]; - }); - } - - function SupportingOrganizationCount() - { - return EntityCounterHelper::getInstance()->EntityCount('MentionOrg', function () { - $query = new CompanyCountQuery(); - $res = $query->handle(new CompanyCountQuerySpecification('Mention'))->getResult(); - return $res[0]; - }); - } - - function TotalOrganizationCount() - { - return EntityCounterHelper::getInstance()->EntityCount('TotalOrgs', function () { - $query = new CompanyCountQuery(); - $res = $query->handle(new CompanyCountQuerySpecification())->getResult(); - return $res[0]; - }); - } - - function NewsletterInternationalCount() - { - return EntityCounterHelper::getInstance()->EntityCount('NewsletterInternationalCount', function () { - $query = new FoundationMembersSubscribedToNewsLetterCountQuery(); - $res = $query->handle(new FoundationMembersSubscribedToNewsLetterCountQuerySpecification('US'))->getResult(); - return $res[0]; - }); - } - - function NewsletterInternationalPercentage() - { - return number_format(($this->NewsletterInternationalCount() / $this->NewsletterMemberCount()) * 100, 2); - } - - function IndividualMemberCountryCount() - { - $Count = DB::query('select count(distinct(Member.Country)) from Member left join Group_Members on Member.ID = Group_Members.MemberID where Group_Members.GroupID = 5;')->value(); - return $Count; - } - - function InternationalOrganizationCount() - { - return EntityCounterHelper::getInstance()->EntityCount('InternationalOrganization', function () { - $query = new CompanyCountQuery(); - $res = $query->handle(new CompanyCountQuerySpecification(null, 'US'))->getResult(); - return $res[0]; - }); - } - - function OrgsInternationalPercentage() - { - return number_format(($this->InternationalOrganizationCount() / $this->TotalOrganizationCount()) * 100, 2); - } - - - // Involvement Types - function InvolvementTypes() - { - return InvolvementType::get(); - } - - function AddInvolvementTypeForm() - { - return new AddInvolvementTypeForm($this, 'AddInvolvementTypeForm'); - } - - function GenerateAutoLoginHashes() - { - $startVal = 0; - - if (isset($_GET["startID"]) && intval($_GET["startID"]) > 0) { - $startVal = intval($_GET["startID"]); - } - - $members = Member::get()->filter(array('SubscribedToNewsletter' => 1, 'ID:GreaterThan' => $startVal))->order('ID')->leftJoin('Group_Members', "`Member`.`ID` = `Group_Members`.`MemberID` AND Group_Members.GroupID = 5 "); - foreach ($members as $member) { - $token = $member->generateAutologinTokenAndStoreHash(14); - echo "\"" . $member->ID . "\",\"" . $member->Email . "\",\"" . $member->FirstName . "\",\"" . $member->Surname . "\",\"" . urldecode($token) . "\"
"; - flush(); - } - } - - // Speaking Submissions - - function SpeakingSubmissionCount() - { - $this->SpeakingSubmissions(); - return $this->submissionsCount; - } - - function SpeakingSubmissions() - { - $submissions = SpeakerSubmission::get()->filter('Created:GreaterThan', '2012-11-01')->sort('Created'); - $this->submissionsCount = $submissions->Count(); - return $submissions; - } - - // Org Standardization - - function Orgs() - { - $orgs = Org::get()->sort("Name"); - return $orgs; - } - - function NonStandardizedOrgs() - { - $orgs = Org::get()->filter(array('IsStandardizedOrg' => 0))->sort('Name')->limit(150); - return $orgs; - } - - - function StandardizedOrgs() - { - global $orgs_cached; - - if (count($orgs_cached) > 0) { - return $orgs_cached; - } else { - $orgs = Org::get()->filter('IsStandardizedOrg', 1)->sort('Name'); - $orgs_cached = $orgs; - return $orgs; - } - } - - function MarkOrgStandardized() - { - if (isset($_GET['orgId']) && is_numeric($_GET['orgId'])) { - $orgId = $_GET['orgId']; - } - - $org = Org::get()->byID($orgId); - - $org->IsStandardizedOrg = 1; - $org->write(); - $this->redirectBack(); - } - - function RemoveDuplicateOrg() - { - if (isset($_POST['oldOrgIds']) && is_array($_POST['oldOrgIds'])) { - $oldOrgIds = $_POST['oldOrgIds']; - } - - foreach ($oldOrgIds as $oldId => $newId) { - if ($newId == "STANDARDIZE") { - $org = Org::get()->byID($oldId); - - $org->IsStandardizedOrg = 1; - $org->write(); - } else if ($newId != 0) { - // Update all members with new Org - DB::query("UPDATE `Affiliation` SET `OrganizationID` = " . $newId . " WHERE `OrganizationID` = " . $oldId); - - // Remove old Org - DB::query("DELETE FROM `Org` WHERE `ID` = " . $oldId); - } - } - - $this->redirectBack(); - } - - // Deployment Survey data - function DeploymentSurveysCount() - { - $DeploymentSurveys = DeploymentSurvey::get()->where("Title IS NOT NULL")->where($this->date_filter_query); - $Count = $DeploymentSurveys->Count(); - return $Count; - } - - function IndustrySummary() - { - $list = new ArrayList(); - $deploymentSurvey = new DeploymentSurvey(); - $options = DeploymentSurvey::$industry_options; - - foreach ($options as $option => $label) { - $count = DB::query("select count(*) from DeploymentSurvey where Industry like '%" . $option . "%' AND " . $this->date_filter_query)->value(); - $do = new DataObject(); - $do->Value = $label; - $do->Count = $count; - $list->push($do); - } - - return $list; - } - - function OtherIndustry() - { - $list = DeploymentSurvey::get()->where("OtherIndustry IS NOT NULL AND " . $this->date_filter_query)->sort('OtherIndustry'); - return $list; - } - - function OrganizationSizeSummary() - { - $list = new ArrayList(); - $deploymentSurvey = new DeploymentSurvey(); - $options = DeploymentSurvey::$organization_size_options; - - foreach ($options as $option => $label) { - $count = DB::query("select count(*) from DeploymentSurvey where OrgSize like '%" . $option . "%' AND " . $this->date_filter_query)->value(); - $do = new DataObject(); - $do->Value = $label; - $do->Count = $count; - $list->push($do); - } - - return $list; - } - - function InvolvementSummary() - { - $list = new ArrayList(); - $deploymentSurvey = new DeploymentSurvey(); - $options = DeploymentSurvey::$openstack_involvement_options; - - foreach ($options as $option => $label) { - $count = DB::query("select count(*) from DeploymentSurvey where OpenStackInvolvement like '%" . $option . "%' AND " . $this->date_filter_query)->value(); - $do = new DataObject(); - $do->Value = $label; - $do->Count = $count; - $list->push($do); - } - - return $list; - } - - function InformationSourcesSummary() - { - $list = new ArrayList(); - $deploymentSurvey = new DeploymentSurvey(); - $options = DeploymentSurvey::$information_options; - - foreach ($options as $option => $label) { - $count = DB::query("select count(*) from DeploymentSurvey where InformationSources like '%" . $option . "%' AND " . $this->date_filter_query)->value(); - $do = new DataObject(); - $do->Value = $label; - $do->Count = $count; - $list->push($do); - } - - return $list; - } - - function OtherInformationSources() - { - $list = DeploymentSurvey::get()->where("OtherInformationSources IS NOT NULL AND " . $this->date_filter_query)->sort('OtherInformationSources'); - return $list; - } - - function FurtherEnhancement() - { - $list = DeploymentSurvey::get()->where("FurtherEnhancement IS NOT NULL AND " . $this->date_filter_query)->sort('FurtherEnhancement'); - return $list; - } - - function FoundationUserCommitteePriorities() - { - $list = DeploymentSurvey::get()->where("FoundationUserCommitteePriorities IS NOT NULL AND " . $this->date_filter_query)->sort('FurtherEnhancement'); - return $list; - } - - function BusinessDriversSummary() - { - $list = new ArrayList(); - $deploymentSurvey = new DeploymentSurvey(); - $options = DeploymentSurvey::$business_drivers_options; - - foreach ($options as $option => $label) { - if ($option == 'Ability to innovate, compete') { - $option = 'Ability to innovate{comma} compete'; - } - $count = DB::query("select count(*) from DeploymentSurvey where BusinessDrivers like '%" . $option . "%' AND " . $this->date_filter_query)->value(); - $do = new DataObject(); - $do->Value = $label; - $do->Count = $count; - $list->push($do); - } - - return $list; - } - - function OtherBusinessDrivers() - { - $list = DeploymentSurvey::get()->where("OtherBusinessDrivers IS NOT NULL AND " . $this->date_filter_query)->sort("OtherBusinessDrivers"); - return $list; - } - - function WhatDoYouLikeMost() - { - $list = DeploymentSurvey::get()->where("WhatDoYouLikeMost IS NOT NULL AND " . $this->date_filter_query)->sort("WhatDoYouLikeMost"); - return $list; - } - - - // Deployment data - function DeploymentsCount() - { - $filterWhereClause = $this->generateFilterWhereClause(); - $Deployments = Deployment::get()->where(" 1=1 " . $filterWhereClause.' AND '.$this->date_filter_query); - $Count = $Deployments->count(); - return $Count; - } - - - - function IsPublicSummary() - { - $options = array(0 => "No", 1 => "Yes"); - return $this->generateSelectListSummary("IsPublic", $options, true); - } - - - function DeploymentTypeSummary() - { - return $this->generateSelectListSummary("DeploymentType", Deployment::$deployment_type_options, true); - } - - function ProjectsUsedSummary() - { - return $this->generateSelectListSummary("ProjectsUsed", Deployment::$projects_used_options, true); - } - - function CurrentReleasesSummary() - { - return $this->generateSelectListSummary("CurrentReleases", Deployment::$current_release_options, true); - } - - function DeploymentStageSummary() - { - return $this->generateSelectListSummary("DeploymentStage", Deployment::$stage_options, true); - } - - function APIFormatsSummary() - { - return $this->generateSelectListSummary("APIFormats", Deployment::$api_options, true); - } - - function HypervisorsSummary() - { - return $this->generateSelectListSummary("Hypervisors",Deployment::$hypervisors_options, true); - } - - function BlockStorageDriversSummary() - { - return $this->generateSelectListSummary("BlockStorageDrivers", - Deployment::$block_storage_divers_options,true); - } - - function NetworkDriversSummary() - { - return $this->generateSelectListSummary("NetworkDrivers", - Deployment::$network_driver_options, true); - } - - function IdentityDriversSummary() - { - return $this->generateSelectListSummary("IdentityDrivers", - Deployment::$identity_driver_options,true); - } - - function SupportedFeaturesSummary() - { - return $this->generateSelectListSummary("SupportedFeatures", - Deployment::$deployment_features_options,true); - } - - function ComputeNodesSummary() - { - return $this->generateSelectListSummary("ComputeNodes", - Deployment::$compute_nodes_options,true); - } - - function ComputeCoresSummary() - { - return $this->generateSelectListSummary("ComputeCores", - Deployment::$compute_cores_options,true); - } - - function ComputeInstancesSummary() - { - return $this->generateSelectListSummary("ComputeInstances", - Deployment::$compute_instances_options,true); - } - - function BlockStorageTotalSizeSummary() - { - return $this->generateSelectListSummary("BlockStorageTotalSize", - Deployment::$storage_size_options,true); - } - - function ObjectStorageSizeSummary() - { - return $this->generateSelectListSummary("ObjectStorageSize", - Deployment::$storage_size_options,true); - } - - function ObjectStorageNumObjectsSummary() - { - return $this->generateSelectListSummary("ObjectStorageNumObjects", - Deployment::$stoage_objects_options,true); - } - - function NetworkNumIPsSummary() - { - return $this->generateSelectListSummary("NetworkNumIPs", - Deployment::$network_ip_options,true); - } - - function NumCloudUsersSummary() - { - return $this->generateSelectListSummary("NumCloudUsers", - Deployment::$num_cloud_users_options); - } - - function WorkloadsSummary() - { - return $this->generateSelectListSummary("WorkloadsDescription", - Deployment::$workloads_description_options); - } - - function DeploymentToolsSummary() - { - return $this->generateSelectListSummary("DeploymentTools", - Deployment::$deployment_tools_options); - } - - function OperatingSystemSummary() - { - return $this->generateSelectListSummary("OperatingSystems", - Deployment::$operating_systems_options); - } - - function WhyNovaNetwork() - { - $filterWhereClause = $this->generateFilterWhereClause(); - - $list = Deployment::get()->where("WhyNovaNetwork IS NOT NULL" . $filterWhereClause)->sort('WhyNovaNetwork'); - - return $list; - } - - function DeploymentMatchingOrgs() - { - $filterWhereClause = $this->generateFilterWhereClause(); - - $results = DB::query("select o.Name from Deployment d join DeploymentSurvey s on (d.DeploymentSurveyID = s.ID) join Org o on (s.OrgID = o.ID) where 1=1" . $filterWhereClause); - $list = new ArrayList(); - - for ($i = 0; $i < $results->numRecords(); $i++) { - $record = $results->nextRecord(); - $do = new DataObject(); - $do->OrgName = $record["Name"]; - $list->push($do); - } - return $list; - } - - - // Export CSV of all Deployment Surveys and Associated Deployments - function ExportSurveyResults() { - $fileDate = date( 'Ymdhis' ); - - $this->generateDateFilters('s'); - - $surveyQuery = "select s.ID as SurveyID, s.Created as SurveyCreated, - s.UpdateDate as SurveyEdited, o.Name as OrgName, o.ID as OrgID , d.ID as DeploymentID, - d.Created as DeploymentCreated, d.UpdateDate as DeploymentEdited, m.FirstName, - m.Surname, m.Email, s.Title, s.Industry, s.OtherIndustry, s.PrimaryCity, - s.PrimaryState, s.PrimaryCountry, s.OrgSize, s.OpenStackInvolvement, - s.InformationSources, s.OtherInformationSources, s.FurtherEnhancement, - s.FoundationUserCommitteePriorities, s.UserGroupMember, s.UserGroupName, - s.OkToContact, s.BusinessDrivers, s.OtherBusinessDrivers, s.WhatDoYouLikeMost, - s.OpenStackRecommendRate as NetPromoter, s.OpenStackRecommendation, - d.Label, d.IsPublic, d.DeploymentType, d.ProjectsUsed, d.CurrentReleases, - d.DeploymentStage, d.NumCloudUsers, d.APIFormats, d.Hypervisors, d.OtherHypervisor, - d.BlockStorageDrivers, d.OtherBlockStorageDriver, d.NetworkDrivers, - d.OtherNetworkDriver, d.IdentityDrivers, d.OtherIndentityDriver, - d.SupportedFeatures, d.ComputeNodes, d.ComputeCores, d.ComputeInstances, - d.BlockStorageTotalSize, d.ObjectStorageSize, d.ObjectStorageNumObjects, - d.NetworkNumIPs, d.WorkloadsDescription, d.OtherWorkloadsDescription, - d.WhyNovaNetwork, d.OtherWhyNovaNetwork, d.DeploymentTools, d.OtherDeploymentTools, d.OperatingSystems, - d.OtherOperatingSystems, d.SwiftGlobalDistributionFeatures, d.SwiftGlobalDistributionFeaturesUsesCases, - d.OtherSwiftGlobalDistributionFeaturesUsesCases, d.Plans2UseSwiftStoragePolicies, - d.OtherPlans2UseSwiftStoragePolicies, d.UsedDBForOpenStackComponents, - d.OtherUsedDBForOpenStackComponents, d.ToolsUsedForYourUsers, d.OtherToolsUsedForYourUsers, - d.Reason2Move2Ceilometer - from DeploymentSurvey s - left outer join Member m on (s.MemberID = m.ID) - left outer join Deployment d on (d.DeploymentSurveyID = s.ID) - left outer join Org o on (s.OrgID = o.ID) - where s.Title is not null AND ".$this->date_filter_query." - order by s.ID;"; - - $res = DB::query($surveyQuery); - - $fields = array('SurveyID','SurveyCreated','SurveyEdited','OrgName','OrgID','DeploymentID','DeploymentCreated', 'DeploymentEdited', 'FirstName', - 'Surname','Email','Title','Industry','OtherIndustry','PrimaryCity','PrimaryState','PrimaryCountry','OrgSize','OpenStackInvolvement','InformationSources', - 'OtherInformationSources','FurtherEnhancement','FoundationUserCommitteePriorities','UserGroupMember','UserGroupName','OkToContact','BusinessDrivers', - 'OtherBusinessDrivers','WhatDoYouLikeMost','NetPromoter','OpenStackRecommendation','Label','IsPublic','DeploymentType','ProjectsUsed', - 'CurrentReleases','DeploymentStage','NumCloudUsers','APIFormats','Hypervisors','OtherHypervisor','BlockStorageDrivers','OtherBlockStorageDriver', - 'NetworkDrivers','OtherNetworkDriver','IdentityDrivers','OtherIndentityDriver','SupportedFeatures','ComputeNodes','ComputeCores','ComputeInstances', - 'BlockStorageTotalSize','ObjectStorageSize','ObjectStorageNumObjects','NetworkNumIPs','WorkloadsDescription','OtherWorkloadsDescription', - 'WhyNovaNetwork','OtherWhyNovaNetwork','DeploymentTools','OtherDeploymentTools','OperatingSystems','OtherOperatingSystems','SwiftGlobalDistributionFeatures', - 'SwiftGlobalDistributionFeaturesUsesCases','OtherSwiftGlobalDistributionFeaturesUsesCases','Plans2UseSwiftStoragePolicies','OtherPlans2UseSwiftStoragePolicies', - 'UsedDBForOpenStackComponents','OtherUsedDBForOpenStackComponents','ToolsUsedForYourUsers','OtherToolsUsedForYourUsers','Reason2Move2Ceilometer'); - $data = array(); - - foreach($res as $row){ - $member = array(); - foreach($fields as $field){ - $member[$field] = $row[$field]; - } - array_push($data,$member); - } - - $filename = "survey_results" . $fileDate . ".csv"; - - return CSVExporter::getInstance()->export($filename, $data, ','); - - } - - // Export CSV of all App Dev Surveys - function ExportAppDevSurveyResults() { - $fileDate = date( 'Ymdhis' ); - - $this->generateDateFilters('s'); - - $surveyQuery = "select s.ID as SurveyID, s.Created as SurveyCreated, - s.LastEdited as SurveyEdited, o.Name as OrgName, o.ID as OrgID, a.ID as AppSurveyID, - a.Created as AppSurveyCreated, a.LastEdited as AppSurveyEdited, m.FirstName, - m.Surname, m.Email, s.Title, s.Industry, s.OtherIndustry, s.PrimaryCity, - s.PrimaryState, s.PrimaryCountry, s.OrgSize, s.OpenStackInvolvement, - s.InformationSources, s.OtherInformationSources, s.FurtherEnhancement, - s.FoundationUserCommitteePriorities, s.UserGroupMember, s.UserGroupName, - s.OkToContact, s.BusinessDrivers, s.OtherBusinessDrivers, s.WhatDoYouLikeMost, - a.Toolkits, a.OtherToolkits, a.ProgrammingLanguages, a.OtherProgrammingLanguages, - a.APIFormats, a.DevelopmentEnvironments, a.OtherDevelopmentEnvironments, - a.OperatingSystems, a.OtherOperatingSystems, a.ConfigTools, a.OtherConfigTools, - a.StateOfOpenStack, a.DocsPriority, a.InteractionWithOtherClouds - from DeploymentSurvey s - right join AppDevSurvey a on (a.DeploymentSurveyID = s.ID) - left outer join Member m on (a.MemberID = m.ID) - left outer join Org o on (s.OrgID = o.ID) - where s.Title is not null AND ".$this->date_filter_query." - order by s.ID;"; - - $res = DB::query($surveyQuery); - - - $fields = array('SurveyID','SurveyCreated','SurveyEdited','OrgName','OrgID','AppSurveyID','AppSurveyCreated', 'AppSurveyEdited', 'FirstName', - 'Surname','Email','Title','Industry','OtherIndustry','PrimaryCity','PrimaryState','PrimaryCountry','OrgSize','OpenStackInvolvement','InformationSources', - 'OtherInformationSources','FurtherEnhancement','FoundationUserCommitteePriorities','UserGroupMember','UserGroupName','OkToContact','BusinessDrivers', - 'OtherBusinessDrivers','WhatDoYouLikeMost','Toolkits','OtherToolkits','ProgrammingLanguages','OtherProgrammingLanguages','APIFormats','DevelopmentEnvironments','OtherDevelopmentEnvironments', - 'OperatingSystems','OtherOperatingSystems','ConfigTools','OtherConfigTools','StateOfOpenStack','DocsPriority','InteractionWithOtherClouds'); - $data = array(); - - foreach($res as $row){ - $member = array(); - foreach($fields as $field){ - $member[$field] = $row[$field]; - } - array_push($data,$member); - } - - $filename = "app_dev_surveys" . $fileDate . ".csv"; - - return CSVExporter::getInstance()->export($filename, $data, ','); - } - - function getSortIcon($type) - { - return $this->getSortDir($type, true) == 'desc' ? '▾' : '▴'; - } - - public function getSortDir($type, $read_only = false) - { - $default = 'asc'; - $dir = Session::get($type . '.sort.dir'); - if (empty($dir)) { - $dir = $default; - } else { - $dir = $dir == 'asc' ? 'desc' : 'asc'; - } - if (!$read_only) - Session::set($type . '.sort.dir', $dir); - return $dir; - } - - function Deployments() - { - $sort = $this->request->getVar('sort'); - $sort_dir = $this->getSortDir('deployments'); - $date_from = Convert::raw2sql(trim($this->request->getVar('date-from'))); - $date_to = Convert::raw2sql(trim($this->request->getVar('date-to'))); - - $sort_query = ''; - $sort_dir = ''; - if (!empty($sort)) { - switch (strtolower(trim($sort))) { - case 'date': { - $sort_query = "UpdateDate"; - $sort_dir = strtoupper($sort_dir); - } - break; - default: { - $sort_query = "ID"; - $sort_dir = 'DESC'; - } - break; - } - } - - $where_query = "IsPublic = 1"; - - if (!empty($date_from) && !empty($date_to)) { - $start = new \DateTime($date_from); - $start->setTime(00, 00, 00); - $end = new \DateTime($date_to); - $end->setTime(23, 59, 59); - $where_query .= " AND ( UpdateDate >= '{$start->format('Y-m-d H:i:s')}' AND UpdateDate <= '{$end->format('Y-m-d H:i:s')}')"; - } - - $res = Deployment::get()->where($where_query); - if (!empty($sort_query) && !empty($sort_dir)) { - $res->sort($sort_query, $sort_dir); - } - return $res; - } - - function DeploymentsSurvey() - { - - $sqlQuery = new SQLQuery(); - $sqlQuery->addSelect(array('DeploymentSurvey.*')); - $sqlQuery->addFrom(array("DeploymentSurvey, Deployment, Org")); - $sqlQuery->addWhere(array("Deployment.DeploymentSurveyID = DeploymentSurvey.ID - AND Deployment.IsPublic = 1 - AND Org.ID = DeploymentSurvey.OrgID - AND DeploymentSurvey.Title IS NOT NULL - ")); - $sqlQuery->addOrderBy('Org.Name'); - - $result = $sqlQuery->execute(); - - $arrayList = new ArrayList(); - - foreach ($result as $rowArray) { - // concept: new Product($rowArray) - $arrayList->push(new $rowArray['ClassName']($rowArray)); - } - - return $arrayList; - } - - function UserStoriesIndustries() - { - return UserStoriesIndustry::get()->filter('Active', 1); - } - - // Current User Stories - function UserStoriesPerIndustry($Industry) - { - return UserStory::get()->filter('UserStoriesIndustryID', $Industry); - } - - function SetCaseStudy() - { - if (isset($_GET['ID']) && is_numeric($_GET['ID'])) { - $UserStory = $_GET['ID']; - } else { - die(); - } - - $setCaseStudy = ($_GET['Set'] == 1) ? 1 : 0; - $story = SiteTree::get_by_id("UserStory", $UserStory); - - $story->ShowCaseStudy = $setCaseStudy; - $story->write(); - $story->publish("Live", "Stage"); - - $this->setMessage('Success', 'Case Study updated for ' . $story->Title . ''); - - $this->redirectBack(); - } - - function SetAdminSS() - { - if (isset($_GET['ID']) && is_numeric($_GET['ID'])) { - $UserStory = $_GET['ID']; - } else { - die(); - } - $showinAdmin = ($_GET['Set'] == 1) ? 1 : 0; - $story = SiteTree::get_by_id("UserStory", $UserStory); - - $parent = UserStoryHolder::get()->first(); - if (!$parent) { - $this->setMessage('Error', 'could not publish user story bc there is not any available parent page(UserStoryHolder).'); - $this->redirectBack(); - } - - $story->ShowInAdmin = $showinAdmin; - $story->setParent($parent); // Should set the ID once the Holder is created... - $story->write(); - //$story->publish("Live", "Stage"); - - $this->setMessage('Success', '' . $story->Title . ' updated.'); - - $this->redirectBack(); - } - - // Add User Story from Deployment - function AddUserStory() - { - if (isset($_GET['ID']) && is_numeric($_GET['ID'])) { - $ID = $_GET['ID']; - } else { - die(); - } - - $parent = UserStoryHolder::get()->first(); - if (!$parent) { - $this->setMessage('Error', 'could not add an user story bc there is not any available parent page(UserStoryHolder).'); - $this->redirectBack(); - } - $userStory = new UserStory; - $userStory->Title = $_GET['label']; - $userStory->DeploymentID = $ID; - $userStory->UserStoriesIndustryID = $_GET['industry']; - $userStory->CompanyName = $_GET['org']; - $userStory->CaseStudyTitle = $_GET['org']; - $userStory->setParent($parent); // Should set the ID once the Holder is created... - $userStory->write(); - $userStory->publish("Live", "Stage"); - - $this->setMessage('Success', '' . $userStory->Title . ' added as User Story.'); - - $this->redirectBack(); - } - - - // Update Stories Industry and Order - function UpdateStories() - { - foreach ($_POST['industry'] as $story_id => $industry) { - $story = SiteTree::get_by_id("UserStory", $story_id); - $story->UserStoriesIndustryID = $industry; - $story->Sort = $_POST['order'][$story_id]; - $story->Video = $_POST['video'][$story_id]; - $story->Title = $_POST['title'][$story_id]; - $story->ShowVideo = ($_POST['video'][$story_id]) ? true : false; - $story->write(); - $story->publish("Live", "Stage"); - } - - $this->setMessage('Success', 'User Stories saved.'); - - $this->redirectBack(); - } - - function CountriesDDL() - { - return new CountryDropdownField('country', 'Country'); - } - - function ViewDeploymentDetails() - { - Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"); - Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.min.js"); - Requirements::javascript("themes/openstack/javascript/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.js"); - Requirements::javascript("themes/openstack/javascript/jquery.ui.datepicker.validation.package-1.0.1/jquery.ui.datepicker.validation.js"); - Requirements::javascript("themes/openstack/javascript/jquery.validate.custom.methods.js"); - Requirements::javascript("themes/openstack/javascript/sangria/view.deployment.details.js"); - return $this->getViewer('ViewDeploymentDetails')->process($this); - } - - function getQuickActionsExtensions() - { - $html = ''; - $this->extend('getQuickActionsExtensions', $html); - return $html; - } - - function DeploymentDetails() - { - $params = $this->request->allParams(); - $deployment_id = intval(Convert::raw2sql($params["ID"]));; - $deployment = Deployment::get()->byID($deployment_id); - if ($deployment) - return $this->Customise($deployment)->renderWith(array('SangriaPage_DeploymentDetails', 'SangriaPage', 'SangriaPage')); - return $this->httpError(404, 'Sorry that Deployment could not be found!.'); - } - - function SurveyDetails() - { - $params = $this->request->allParams(); - $survey_id = intval(Convert::raw2sql($params["ID"]));; - $survey = DeploymentSurvey::get()->byID($survey_id); - if ($survey) - return $this->Customise($survey)->renderWith(array('SangriaPage_SurveyDetails', 'SangriaPage', 'SangriaPage')); - return $this->httpError(404, 'Sorry that Deployment Survey could not be found!.'); - } - - function exportFoundationMembers() - { - $params = $this->getRequest()->getVars(); - if (!isset($params['fields']) || empty($params['fields'])) - return $this->httpError('412', 'missing required param fields'); - - if (!isset($params['ext']) || empty($params['ext'])) - return $this->httpError('412', 'missing required param ext'); - - $fields = $params['fields']; - $ext = $params['ext']; - - $sanitized_fields = array(); - - if (!count($fields)) { - return $this->httpError('412', 'missing required param fields'); - } - - $allowed_fields = array('ID' => 'ID', 'FirstName' => 'FirstName', 'SurName' => 'SurName', 'Email' => 'Email'); - - for ($i = 0; $i < count($fields); $i++) { - if (!array_key_exists($fields[$i], $allowed_fields)) - return $this->httpError('412', 'invalid field'); - array_push($sanitized_fields, 'Member.' . $fields[$i]); - } - - $query = new SQLQuery(); - $query->addFrom('Member'); - $query->addSelect($sanitized_fields); - $query->addInnerJoin('Group_Members', 'Group_Members.MemberID = Member.ID'); - $query->addInnerJoin('Group', "Group.ID = Group_Members.GroupID AND Group.Code='foundation-members'"); - $query->setOrderBy('SurName,FirstName'); - $result = $query->execute(); - - $data = array(); - - foreach ($result as $row) { - $member = array(); - foreach ($fields as $field) { - $member[$field] = $row[$field]; - } - array_push($data, $member); - } - - $filename = "FoundationMembers" . date('Ymd') . "." . $ext; - - return CSVExporter::getInstance()->export($filename, $data); - } - - function exportCorporateSponsors() - { - - $params = $this->getRequest()->getVars(); - - if (!isset($params['levels']) || empty($params['levels'])) - return $this->httpError('412', 'missing required param level'); - - if (!isset($params['fields']) || empty($params['fields'])) - return $this->httpError('412', 'missing required param fields'); - - if (!isset($params['ext']) || empty($params['ext'])) - return $this->httpError('412', 'missing required param ext'); - - $level = $params['levels']; - - $fields = $params['fields']; - - $ext = $params['ext']; - - $sanitized_fields = array(); - - if (!count($fields)) { - return $this->httpError('412', 'missing required param fields'); - } - - if (!count($level)) { - return $this->httpError('412', 'missing required param $level'); - } - - $allowed_fields = array('MemberLevel' => 'MemberLevel', 'Name' => 'Name', 'City' => 'City', 'State' => 'State', 'Country' => 'Country', 'Industry' => 'Industry', 'ContactEmail' => 'ContactEmail', 'AdminEmail' => 'AdminEmail'); - $allowed_levels = array('Platinum' => 'Platinum', 'Gold' => 'Gold', 'Startup' => 'Startup', 'Mention' => 'Mention'); - for ($i = 0; $i < count($fields); $i++) { - if (!array_key_exists($fields[$i], $allowed_fields)) - return $this->httpError('412', 'invalid field'); - array_push($sanitized_fields, 'Company.' . $fields[$i]); - } - for ($i = 0; $i < count($level); $i++) { - if (!array_key_exists($level[$i], $allowed_levels)) - return $this->httpError('412', 'invalid level'); - } - - $query = new SQLQuery(); - - $query->addFrom('Company'); - $query->addSelect($sanitized_fields); - $query->addWhere(" MemberLevel IN ('" . implode("','", $level) . "')"); - $query->setOrderBy('MemberLevel'); - - $result = $query->execute(); - - $data = array(); - - foreach ($result as $row) { - $company = array(); - foreach ($fields as $field) { - $company[$field] = $row[$field]; - } - array_push($data, $company); - } - - $filename = "Companies" . date('Ymd') . "." . $ext; - - return CSVExporter::getInstance()->export($filename, $data); - } - - function ExportData() - { - $this->Title = 'Export Data'; - Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"); - Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.min.js"); - Requirements::javascript("themes/openstack/javascript/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.js"); - Requirements::javascript("themes/openstack/javascript/jquery.validate.custom.methods.js"); - Requirements::javascript('themes/openstack/javascript/sangria/sangria.page.export.data.js'); - return $this->getViewer('ExportData')->process($this); - } - - function AddNewDeployment() - { - - $survey = DataObject::get_one('DeploymentSurvey', 'ID = ' . $_POST['survey']); - - $deployment = new Deployment; - $deployment->Label = $_POST['label']; - $deployment->DeploymentType = $_POST['type']; - $deployment->CountryCode = $_POST['country']; - $deployment->DeploymentSurveyID = $_POST['survey']; - if ($survey) { - $deployment->OrgID = $survey->OrgID; - } else { - $deployment->OrgID = 0; - } - $deployment->IsPublic = 1; - $deployment->write(); - - $this->setMessage('Success', '' . $_POST['label'] . ' added as a new Deployment.'); - - $this->redirectBack(); - } - - function exportCLAUsers() - { - - $params = $this->getRequest()->getVars(); - if (!isset($params['fields']) || empty($params['fields'])) - return $this->httpError('412', 'missing required param fields'); - - if (!isset($params['ext']) || empty($params['ext'])) - return $this->httpError('412', 'missing required param ext'); - - - if (!isset($params['status']) || empty($params['status'])) - return $this->httpError('412', 'missing required param status'); - - $sanitized_filters = $params['status']; - $fields = $params['fields']; - $ext = $params['ext']; - - $sanitized_filters = implode("','", $sanitized_filters); - - $sanitized_fields = array(); - - if (!count($fields)) { - return $this->httpError('412', 'missing required param fields'); - } - - $allowed_fields = array('ID' => 'ID', 'FirstName' => 'FirstName', 'SurName' => 'SurName', 'Email' => 'Email'); - - for ($i = 0; $i < count($fields); $i++) { - if (!array_key_exists($fields[$i], $allowed_fields)) - return $this->httpError('412', 'invalid field'); - array_push($sanitized_fields, 'M.' . $fields[$i]); - } - - - $sanitized_fields = implode(',', $sanitized_fields); - - $sql = <<< SQL - SELECT {$sanitized_fields} - , GROUP_CONCAT(G.Code, ' | ') AS Groups - FROM Member M - LEFT JOIN Group_Members GM on GM.MemberID = M.ID - LEFT JOIN `Group` G on G.ID = GM.GroupID - WHERE GerritID IS NOT NULL AND G.Code IN ('{$sanitized_filters}') - GROUP BY M.ID - ORDER BY M.SurName, M.FirstName; -SQL; - - - $result = DB::query($sql); - $data = array(); - array_push($fields, 'Groups'); - foreach ($result as $row) { - $member = array(); - foreach ($fields as $field) { - $member[$field] = $row[$field]; - } - array_push($data, $member); - } - - $filename = "CLAMembers" . date('Ymd') . "." . $ext; - - return CSVExporter::getInstance()->export($filename, $data); - } - - - function exportGerritUsers() - { - $params = $this->getRequest()->getVars(); - if (!isset($params['status']) || empty($params['status'])) - return $this->httpError('412', 'missing required param status'); - - if (!isset($params['ext']) || empty($params['ext'])) - return $this->httpError('412', 'missing required param ext'); - - $status = $params['status']; - $ext = $params['ext']; - - $sanitized_filters = array(); - $allowed_filter_values = array('foundation-members' => 'foundation-members', 'community-members' => 'community-members'); - for ($i = 0; $i < count($status); $i++) { - if (!array_key_exists($status[$i], $allowed_filter_values)) - return $this->httpError('412', 'invalid filter value'); - array_push($sanitized_filters, $status[$i]); - } - - $sanitized_filters = implode("','", $sanitized_filters); - $sql = <<export($filename, $data); - } - - public function Groups() - { - $sql = <<push(new $rowArray['ClassName']($rowArray)); - } - return $groups; - } - - function ViewDeploymentStatistics(){ - $this->generateDateFilters(); - Requirements::css("themes/openstack/javascript/datetimepicker/jquery.datetimepicker.css"); - Requirements::javascript("themes/openstack/javascript/datetimepicker/jquery.datetimepicker.js"); - Requirements::css("themes/openstack/css/deployment.survey.page.css"); - Requirements::javascript("themes/openstack/javascript/deployment.survey.filters.js"); - return $this->Customise(array())->renderWith(array('SangriaPage_ViewDeploymentStatistics','SangriaPage','SangriaPage')); - } - - function ViewDeploymentSurveyStatistics(){ - $this->generateDateFilters(); - Requirements::css("themes/openstack/javascript/datetimepicker/jquery.datetimepicker.css"); - Requirements::javascript("themes/openstack/javascript/datetimepicker/jquery.datetimepicker.js"); - Requirements::css("themes/openstack/css/deployment.survey.page.css"); - Requirements::javascript("themes/openstack/javascript/deployment.survey.filters.js"); - return $this->Customise(array())->renderWith(array('SangriaPage_ViewDeploymentSurveyStatistics','SangriaPage','SangriaPage')); - } - - - function generateSelectListSummary($fieldName, $optionSet, $applyDateFilters=false) - { - $list = new ArrayList(); - - $urlString = $_SERVER["REDIRECT_URL"] . "?"; - $keyUrlString = ""; - $keyValue = ""; - - foreach ($_GET as $key => $value) { - if (preg_match("/Filter$/", $key)) { - if ($key != $fieldName . "Filter") { - $urlString .= $key . "=" . $value . "&"; - } else { - $keyUrlString = $key . "=" . $value; - $keyValue = $value; - } - } - } - - foreach ($optionSet as $option => $label) { - - $query = "select count(*) from Deployment where ".$fieldName." like '%".$option."%'".$this->generateFilterWhereClause(); - $query .= ($applyDateFilters) ? ' AND '.$this->date_filter_query : ''; - - $count = DB::query($query)->value(); - $do = new DataObject(); - - $href = $urlString.$fieldName."Filter=".$option; - - if ($applyDateFilters) { - $start_date = $this->request->getVar('From'); - $end_date = $this->request->getVar('To'); - if ($start_date && $end_date) - $href .= "&From=".$start_date."&To=".$end_date; - } - - $do->Value = "".$label.""; - if( !empty($keyUrlString) && $keyValue != $option) { - $do->Value .= " (+) (|)"; - } - $do->Count = $count; - $list->push($do); - } - - return $list; - } - - - function generateFilterWhereClause() - { - $filterWhereClause = ""; - - foreach ($_GET as $key => $value) { - if (preg_match("/Filter$/", $key)) { - $orValues = preg_split("/\|\|/", $value); - $andValues = preg_split("/\,\,/", $value); - - if (count($orValues) > 1) { - $filterWhereClause .= " and ("; - for ($i = 0; $i < count($orValues); $i++) { - if ($i > 0) { - $filterWhereClause .= " OR "; - } - $filterWhereClause .= preg_replace("/Filter$/", "", $key) . " like '%" . $orValues[$i] . "%'"; - } - $filterWhereClause .= ")"; - } else if (count($andValues) > 1) { - $filterWhereClause .= " and ("; - for ($i = 0; $i < count($andValues); $i++) { - if ($i > 0) { - $filterWhereClause .= " AND "; - } - $filterWhereClause .= preg_replace("/Filter$/", "", $key) . " like '%" . $andValues[$i] . "%'"; - } - $filterWhereClause .= ")"; - } else { - $filterWhereClause .= " and " . preg_replace("/Filter$/", "", $key) . " like '%" . $value . "%'"; - } - } - } - - - return $filterWhereClause; - } - - function generateDateFilters($table_prefix = '' ) { - $where_query = ''; - $start_date = $this->request->getVar('From'); - $end_date = $this->request->getVar('To'); - if(!empty($table_prefix)) - $table_prefix .= '.'; - if(isset($start_date) && isset($end_date)){ - $date_from = Convert::raw2sql(trim($start_date)); - $date_to = Convert::raw2sql(trim($end_date)); - $start = new \DateTime($date_from); - $start->setTime(00, 00, 00); - $end = new \DateTime($date_to); - $end->setTime(23, 59, 59); - $where_query .= " ( {$table_prefix}UpdateDate >= '{$start->format('Y-m-d H:i:s')}' AND {$table_prefix}UpdateDate <= '{$end->format('Y-m-d H:i:s')}' ) "; - } else { - $where_query .= " ( {$table_prefix}UpdateDate >= '{$this->default_start_date}' AND {$table_prefix}UpdateDate <= '{$this->default_end_date}' ) "; - } - - $this->date_filter_query = $where_query; - } - - //Survey date filters constructor - function DateFilters($action='') { - $start_date = ($this->request->getVar('From')) ? $this->request->getVar('From') : $this->default_start_date; - $end_date = ($this->request->getVar('To')) ? $this->request->getVar('To') : $this->default_end_date; - - $data = array("start_date"=>$start_date, "end_date"=>$end_date, "action"=>$action); - return $this->renderWith("SurveyDateFilters",$data); - } -} diff --git a/openstack/code/sangria/SangriaPage.php b/openstack/code/sangria/SangriaPage.php new file mode 100644 index 0000000..749f9e5 --- /dev/null +++ b/openstack/code/sangria/SangriaPage.php @@ -0,0 +1,349 @@ + "Access the Sangria Admin" + ); + } + + // DASHBOARD METRICS + + function IndividualMemberCount() { + return EntityCounterHelper::getInstance()->EntityCount('FoundationMember',function (){ + $query = new IndividualFoundationMemberCountQuery(); + $res = $query->handle(null)->getResult(); + return $res[0]; + }); + } + + function CommunityMemberCount() { + return EntityCounterHelper::getInstance()->EntityCount('CommunityMember',function (){ + $query = new IndividualCommunityMemberCountQuery(); + $res = $query->handle(null)->getResult(); + return $res[0]; + }); + } + + function NewsletterMemberCount() { + return EntityCounterHelper::getInstance()->EntityCount('NewsletterMember',function (){ + $query = new FoundationMembersSubscribedToNewsLetterCountQuery(); + $res = $query->handle(new FoundationMembersSubscribedToNewsLetterCountQuerySpecification)->getResult(); + return $res[0]; + }); + } + + function NewsletterPercentage() { + return number_format(($this->NewsletterMemberCount() / $this->IndividualMemberCount())*100,2); + } + + function UserStoryCount() { + return EntityCounterHelper::getInstance()->EntityCount('UserStory',function (){ + $query = new UserStoriesCountQuery(); + $res = $query->handle(new UserStoriesCountQuerySpecification(true))->getResult(); + return $res[0]; + }); + } + + function UserLogoCount() { + return EntityCounterHelper::getInstance()->EntityCount('UserLogo',function (){ + $query = new UserStoriesCountQuery(); + $res = $query->handle(new UserStoriesCountQuerySpecification(false))->getResult(); + return $res[0]; + }); + } + + function PlatinumMemberCount() { + return EntityCounterHelper::getInstance()->EntityCount('PlatinumOrg',function (){ + $query = new CompanyCountQuery(); + $res = $query->handle(new CompanyCountQuerySpecification('Platinum'))->getResult(); + return $res[0]; + }); + } + + function GoldMemberCount() { + return EntityCounterHelper::getInstance()->EntityCount('GoldOrg',function (){ + $query = new CompanyCountQuery(); + $res = $query->handle(new CompanyCountQuerySpecification('Gold'))->getResult(); + return $res[0]; + }); + } + + function CorporateSponsorCount() { + return EntityCounterHelper::getInstance()->EntityCount('CorporateOrg',function (){ + $query = new CompanyCountQuery(); + $res = $query->handle(new CompanyCountQuerySpecification('Corporate'))->getResult(); + return $res[0]; + }); + } + + function StartupSponsorCount() { + return EntityCounterHelper::getInstance()->EntityCount('StartupOrg',function (){ + $query = new CompanyCountQuery(); + $res = $query->handle(new CompanyCountQuerySpecification('Startup'))->getResult(); + return $res[0]; + }); + } + + function SupportingOrganizationCount() { + return EntityCounterHelper::getInstance()->EntityCount('MentionOrg',function (){ + $query = new CompanyCountQuery(); + $res = $query->handle(new CompanyCountQuerySpecification('Mention'))->getResult(); + return $res[0]; + }); + } + + function TotalOrganizationCount() { + return EntityCounterHelper::getInstance()->EntityCount('TotalOrgs',function (){ + $query = new CompanyCountQuery(); + $res = $query->handle(new CompanyCountQuerySpecification())->getResult(); + return $res[0]; + }); + } + + function NewsletterInternationalCount() { + return EntityCounterHelper::getInstance()->EntityCount('NewsletterInternationalCount',function (){ + $query = new FoundationMembersSubscribedToNewsLetterCountQuery(); + $res = $query->handle(new FoundationMembersSubscribedToNewsLetterCountQuerySpecification('US'))->getResult(); + return $res[0]; + }); + } + + function NewsletterInternationalPercentage() { + return number_format(($this->NewsletterInternationalCount()/$this->NewsletterMemberCount())*100,2); + } + + function IndividualMemberCountryCount() { + $Count = DB::query('select count(distinct(Member.Country)) from Member left join Group_Members on Member.ID = Group_Members.MemberID where Group_Members.GroupID = 5;')->value(); + return $Count; + } + + function InternationalOrganizationCount() { + return EntityCounterHelper::getInstance()->EntityCount('InternationalOrganization',function (){ + $query = new CompanyCountQuery(); + $res = $query->handle(new CompanyCountQuerySpecification(null,'US'))->getResult(); + return $res[0]; + }); + } + + function OrgsInternationalPercentage() { + return number_format(($this->InternationalOrganizationCount()/$this->TotalOrganizationCount())*100,2); + } + + //Survey date filters constructor + + function DateFilters($action='') { + $start_date = ($this->request->getVar('From')) ? $this->request->getVar('From') : self::$default_start_date; + $end_date = ($this->request->getVar('To')) ? $this->request->getVar('To') : self::$default_end_date; + $data = array("start_date"=>$start_date, "end_date"=>$end_date, "action"=>$action); + return $this->renderWith("SurveyDateFilters",$data); + } + + public function getSortDir($type, $read_only=false){ + $default = 'asc'; + $dir = Session::get($type.'.sort.dir'); + if(empty($dir)){ + $dir = $default; + } + else{ + $dir = $dir=='asc'?'desc':'asc'; + } + if(!$read_only) + Session::set($type.'.sort.dir',$dir); + return $dir; + } + + function getSortIcon($type){ + return $this->getSortDir($type,true) == 'desc'?'▾':'▴'; + } + + function UserStoriesPerIndustry($Industry){ + return DataObject::get("UserStory","UserStoriesIndustryID = " . $Industry); + } + + function Countries(){ + return CountryCodes::asObject(); + } + + function getQuickActionsExtensions(){ + $html = ''; + $this->extend('getQuickActionsExtensions',$html); + return $html; + } + + public function DeploymentMatchingOrgs() { + $filterWhereClause = self::generateFilterWhereClause(); + + $results = DB::query("select o.Name from Deployment d join DeploymentSurvey s on (d.DeploymentSurveyID = s.ID) join Org o on (s.OrgID = o.ID) where 1=1".$filterWhereClause); + $list = new DataObjectSet(); + + for( $i=0; $i < $results->numRecords(); $i++) { + $record = $results->nextRecord(); + $do = new ArrayList(); + $do->OrgName = $record["Name"]; + $list->push($do); + } + return $list; + } + + public static function generateSelectListSummary($fieldName, $optionSet, $applyDateFilters=false) { + $list = new ArrayList(); + + $urlString = $_SERVER["REDIRECT_URL"]."?"; + $keyUrlString = ""; + $keyValue = ""; + + foreach($_GET as $key=>$value) { + if (preg_match("/Filter$/",$key)) { + if ($key != $fieldName."Filter") { + $urlString .= $key."=".$value."&"; + } else { + $keyUrlString = $key."=".$value; + $keyValue = $value; + } + } + } + + foreach( $optionSet as $option => $label ) { + + $query = "select count(*) from Deployment where ".$fieldName." like '%".$option."%'".self::generateFilterWhereClause(); + $query .= ($applyDateFilters) ? ' AND '.self::$date_filter_query : ''; + + $count = DB::query($query)->value(); + $do = new DataObject(); + + $href = $urlString.$fieldName."Filter=".$option; + + if ($applyDateFilters) { + $start_date = Controller::curr()->request->getVar('From'); + $end_date = Controller::curr()->request->getVar('To'); + if ($start_date && $end_date) + $href .= "&From=".$start_date."&To=".$end_date; + } + + $do->Value = "".$label.""; + if( !empty($keyUrlString) && $keyValue != $option) { + $do->Value .= " (+) (|)"; + } + $do->Count = $count; + $list->push($do); + } + + return $list; + } + + public static function generateFilterWhereClause() { + $filterWhereClause = ""; + + foreach($_GET as $key=>$value) { + if (preg_match("/Filter$/",$key)) { + $orValues = split("\|\|", $value); + $andValues = split("\,\,", $value); + + if (count($orValues) > 1) { + $filterWhereClause .= " and ("; + for($i=0; $i0 ) { + $filterWhereClause .= " OR "; + } + $filterWhereClause .= preg_replace("/Filter$/","",$key)." like '%".$orValues[$i]."%'"; + } + $filterWhereClause .= ")"; + } else if (count($andValues) > 1) { + $filterWhereClause .= " and ("; + for($i=0; $i0 ) { + $filterWhereClause .= " AND "; + } + $filterWhereClause .= preg_replace("/Filter$/","",$key)." like '%".$andValues[$i]."%'"; + } + $filterWhereClause .= ")"; + } else { + $filterWhereClause .= " and ".preg_replace("/Filter$/","",$key)." like '%".$value."%'"; + } + } + } + + + return $filterWhereClause; + } + + public static function generateDateFilters($table_prefix = '' ) { + $where_query = ''; + $start_date = Controller::curr()->request->getVar('From'); + $end_date = Controller::curr()->request->getVar('To'); + if(!empty($table_prefix)) + $table_prefix .= '.'; + if(isset($start_date) && isset($end_date)){ + $date_from = Convert::raw2sql(trim($start_date)); + $date_to = Convert::raw2sql(trim($end_date)); + $start = new \DateTime($date_from); + $start->setTime(00, 00, 00); + $end = new \DateTime($date_to); + $end->setTime(23, 59, 59); + $where_query .= " ( {$table_prefix}UpdateDate >= '{$start->format('Y-m-d H:i:s')}' AND {$table_prefix}UpdateDate <= '{$end->format('Y-m-d H:i:s')}' ) "; + } else { + $start_date = self::$default_start_date; + $end_date = self::$default_end_date; + $where_query .= " ( {$table_prefix}UpdateDate >= '{$start_date}' AND {$table_prefix}UpdateDate <= '{$end_date}' ) "; + } + + self::$date_filter_query = $where_query; + } +} \ No newline at end of file diff --git a/openstack/code/sangria/SangriaPageDeploymentExtension.php b/openstack/code/sangria/SangriaPageDeploymentExtension.php new file mode 100644 index 0000000..56fa5a3 --- /dev/null +++ b/openstack/code/sangria/SangriaPageDeploymentExtension.php @@ -0,0 +1,417 @@ +update(get_class($this), 'allowed_actions', array( + 'ViewDeploymentStatistics', + 'ViewDeploymentSurveyStatistics', + 'ViewDeploymentDetails', + 'DeploymentDetails', + 'AddNewDeployment', + 'AddUserStory')); + + Config::inst()->update(get_class($this->owner), 'allowed_actions', array( + 'ViewDeploymentStatistics', + 'ViewDeploymentSurveyStatistics', + 'ViewDeploymentDetails', + 'DeploymentDetails', + 'AddNewDeployment', + 'AddUserStory')); + } + + function DeploymentDetails(){ + $params = $this->owner->request->allParams(); + $deployment_id = intval(Convert::raw2sql($params["ID"]));; + $deployment = Deployment::get()->byID($deployment_id); + if($deployment) + return $this->owner->Customise($deployment)->renderWith(array('SangriaPage_DeploymentDetails','SangriaPage','SangriaPage')); + return $this->owner->httpError(404, 'Sorry that Deployment could not be found!.'); + } + + // Deployment Survey data + + public function ViewDeploymentSurveyStatistics(){ + SangriaPage_Controller::generateDateFilters(); + Requirements::css("themes/openstack/javascript/datetimepicker/jquery.datetimepicker.css"); + Requirements::javascript("themes/openstack/javascript/datetimepicker/jquery.datetimepicker.js"); + Requirements::css("themes/openstack/css/deployment.survey.page.css"); + Requirements::javascript("themes/openstack/javascript/deployment.survey.filters.js"); + return $this->owner->Customise(array())->renderWith(array('SangriaPage_ViewDeploymentSurveyStatistics','SangriaPage','SangriaPage')); + } + + function DeploymentSurveysCount() { + $DeploymentSurveys = DeploymentSurvey::get()->where("Title IS NOT NULL")->where(SangriaPage_Controller::$date_filter_query); + $Count = ($DeploymentSurveys) ? $DeploymentSurveys->Count() : 0; + return $Count; + } + + function IndustrySummary() { + $list = new ArrayList(); + $options = DeploymentSurvey::$industry_options; + + foreach( $options as $option => $label ) { + $count = DB::query("select count(*) from DeploymentSurvey where Industry like '%".$option."%' AND ".SangriaPage_Controller::$date_filter_query)->value(); + $do = new DataObject(); + $do->Value = $label; + $do->Count = $count; + $list->push($do); + } + + return $list; + } + + function OtherIndustry() { + $list = DeploymentSurvey::get()->where("OtherIndustry IS NOT NULL AND " . SangriaPage_Controller::$date_filter_query)->sort('OtherIndustry'); + return $list; + } + + function OrganizationSizeSummary() { + $list = new ArrayList(); + $options = DeploymentSurvey::$organization_size_options; + + foreach( $options as $option => $label ) { + $count = DB::query("select count(*) from DeploymentSurvey where OrgSize like '%".$option."%' AND ".SangriaPage_Controller::$date_filter_query)->value(); + $do = new DataObject(); + $do->Value = $label; + $do->Count = $count; + $list->push($do); + } + + return $list; + } + + function InvolvementSummary() { + $list = new ArrayList(); + $options = DeploymentSurvey::$openstack_involvement_options; + + foreach( $options as $option => $label ) { + $count = DB::query("select count(*) from DeploymentSurvey where OpenStackInvolvement like '%".$option."%' AND ".SangriaPage_Controller::$date_filter_query)->value(); + $do = new DataObject(); + $do->Value = $label; + $do->Count = $count; + $list->push($do); + } + + return $list; + } + + function InformationSourcesSummary() { + $list = new ArrayList(); + $options = DeploymentSurvey::$information_options; + + foreach( $options as $option => $label ) { + $count = DB::query("select count(*) from DeploymentSurvey where InformationSources like '%".$option."%' AND ".SangriaPage_Controller::$date_filter_query)->value(); + $do = new DataObject(); + $do->Value = $label; + $do->Count = $count; + $list->push($do); + } + + return $list; + } + + function OtherInformationSources() { + $list = DeploymentSurvey::get()->where("OtherInformationSources IS NOT NULL AND " . SangriaPage_Controller::$date_filter_query)->sort('OtherInformationSources'); + return $list; + } + + function FurtherEnhancement() { + $list = DeploymentSurvey::get()->where("FurtherEnhancement IS NOT NULL AND " . SangriaPage_Controller::$date_filter_query)->sort('FurtherEnhancement'); + return $list; + } + + function FoundationUserCommitteePriorities() { + $list = DeploymentSurvey::get()->where("FoundationUserCommitteePriorities IS NOT NULL AND " . SangriaPage_Controller::$date_filter_query)->sort('FurtherEnhancement'); + return $list; + } + + function BusinessDriversSummary() { + $list = new ArrayList(); + $options = DeploymentSurvey::$business_drivers_options; + + foreach( $options as $option => $label ) { + if( $option == 'Ability to innovate, compete') { + $option = 'Ability to innovate{comma} compete'; + } + $count = DB::query("select count(*) from DeploymentSurvey where BusinessDrivers like '%".$option."%' AND ".SangriaPage_Controller::$date_filter_query)->value(); + $do = new DataObject(); + $do->Value = $label; + $do->Count = $count; + $list->push($do); + } + + return $list; + } + + function OtherBusinessDrivers() { + $list = DeploymentSurvey::get()->where("OtherBusinessDrivers IS NOT NULL AND " . SangriaPage_Controller::$date_filter_query)->sort("OtherBusinessDrivers"); + return $list; + } + + function WhatDoYouLikeMost() { + $list = DeploymentSurvey::get()->where("WhatDoYouLikeMost IS NOT NULL AND " . SangriaPage_Controller::$date_filter_query)->sort("WhatDoYouLikeMost"); + return $list; + } + + function NumCloudUsersSummary() { + return SangriaPage_Controller::generateSelectListSummary("NumCloudUsers", + Deployment::$num_cloud_users_options); + } + + + // Deployment Survey data + + function ViewDeploymentStatistics(){ + SangriaPage_Controller::generateDateFilters(); + Requirements::css("themes/openstack/javascript/datetimepicker/jquery.datetimepicker.css"); + Requirements::javascript("themes/openstack/javascript/datetimepicker/jquery.datetimepicker.js"); + Requirements::css("themes/openstack/css/deployment.survey.page.css"); + Requirements::javascript("themes/openstack/javascript/deployment.survey.filters.js"); + return $this->owner->Customise(array())->renderWith(array('SangriaPage_ViewDeploymentStatistics','SangriaPage','SangriaPage')); + } + + function DeploymentsCount() { + $filterWhereClause = SangriaPage_Controller::generateFilterWhereClause(); + $Deployments = Deployment::get()->where(" 1=1 " . $filterWhereClause.' AND '.SangriaPage_Controller::$date_filter_query); + return $Deployments->count(); + } + + function IsPublicSummary() { + $options = array( 0 => "No", 1 => "Yes" ); + return SangriaPage_Controller::generateSelectListSummary("IsPublic", $options, true); + } + + function DeploymentTypeSummary() { + return SangriaPage_Controller::generateSelectListSummary("DeploymentType", Deployment::$deployment_type_options, true); + } + + function ProjectsUsedSummary() { + return SangriaPage_Controller::generateSelectListSummary("ProjectsUsed", Deployment::$projects_used_options, true); + } + + function CurrentReleasesSummary() { + return SangriaPage_Controller::generateSelectListSummary("CurrentReleases", Deployment::$current_release_options, true); + } + + function APIFormatsSummary() { + return SangriaPage_Controller::generateSelectListSummary("APIFormats", Deployment::$api_options, true); + } + + function DeploymentStageSummary() { + return SangriaPage_Controller::generateSelectListSummary("DeploymentStage", Deployment::$stage_options, true); + } + + function HypervisorsSummary() { + return SangriaPage_Controller::generateSelectListSummary("Hypervisors", Deployment::$hypervisors_options, true); + } + + function IdentityDriversSummary() { + return SangriaPage_Controller::generateSelectListSummary("IdentityDrivers", Deployment::$identity_driver_options, true); + } + + function SupportedFeaturesSummary() { + return SangriaPage_Controller::generateSelectListSummary("SupportedFeatures", Deployment::$deployment_features_options, true); + } + + function NetworkDriversSummary() { + return SangriaPage_Controller::generateSelectListSummary("NetworkDrivers", Deployment::$network_driver_options, true); + } + + function NetworkNumIPsSummary() { + return SangriaPage_Controller::generateSelectListSummary("NetworkNumIPs", Deployment::$network_ip_options, true); + } + + function BlockStorageDriversSummary() { + return SangriaPage_Controller::generateSelectListSummary("BlockStorageDrivers", Deployment::$block_storage_divers_options, true); + } + + function ComputeNodesSummary() { + return SangriaPage_Controller::generateSelectListSummary("ComputeNodes", Deployment::$compute_nodes_options, true); + } + + function ComputeCoresSummary() { + return SangriaPage_Controller::generateSelectListSummary("ComputeCores", Deployment::$compute_cores_options, true); + } + + function ComputeInstancesSummary() { + return SangriaPage_Controller::generateSelectListSummary("ComputeInstances", Deployment::$compute_instances_options, true); + } + + function BlockStorageTotalSizeSummary() { + return SangriaPage_Controller::generateSelectListSummary("BlockStorageTotalSize", Deployment::$storage_size_options, true); + } + + function ObjectStorageSizeSummary() { + return SangriaPage_Controller::generateSelectListSummary("ObjectStorageSize", Deployment::$storage_size_options, true); + } + + function ObjectStorageNumObjectsSummary() { + return SangriaPage_Controller::generateSelectListSummary("ObjectStorageNumObjects", Deployment::$stoage_objects_options, true); + } + + // Deployment Details + + function ViewDeploymentDetails(){ + Requirements::javascript(Director::protocol()."ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"); + Requirements::javascript(Director::protocol()."ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.min.js"); + Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css'); + Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js'); + Requirements::javascript("themes/openstack/javascript/jquery.ui.datepicker.validation.package-1.0.1/jquery.ui.datepicker.validation.js"); + Requirements::javascript("themes/openstack/javascript/jquery.validate.custom.methods.js"); + Requirements::javascript("themes/openstack/javascript/sangria/view.deployment.details.js"); + return $this->owner->getViewer('ViewDeploymentDetails')->process($this->owner); + } + + function Deployments(){ + $sort = $this->request->getVar('sort'); + $sort_dir = $this->getSortDir('deployments'); + $date_from = Convert::raw2sql(trim($this->request->getVar('date-from'))); + $date_to = Convert::raw2sql(trim($this->request->getVar('date-to'))); + $sort_query = ''; + if (!empty($sort)) { + switch (strtolower(trim($sort))) { + case 'date': { + $sort_query = "UpdateDate"; + $sort_dir = strtoupper($sort_dir); + } + break; + default: { + $sort_query = "ID"; + $sort_dir = 'DESC'; + } + break; + } + } + + $where_query = "IsPublic = 1"; + + if (!empty($date_from) && !empty($date_to)) { + $start = new \DateTime($date_from); + $start->setTime(00, 00, 00); + $end = new \DateTime($date_to); + $end->setTime(23, 59, 59); + $where_query .= " AND ( UpdateDate >= '{$start->format('Y-m-d H:i:s')}' AND UpdateDate <= '{$end->format('Y-m-d H:i:s')}')"; + } + + $res = Deployment::get()->where($where_query); + if (!empty($sort_query) && !empty($sort_dir)) { + $res->sort($sort_query, $sort_dir); + } + return $res; + } + + + function DeploymentsSurvey(){ + + $sqlQuery = new SQLQuery(); + $sqlQuery->select = array('DeploymentSurvey.*'); + $sqlQuery->from = array("DeploymentSurvey, Deployment, Org"); + $sqlQuery->where = array("Deployment.DeploymentSurveyID = DeploymentSurvey.ID + AND Deployment.IsPublic = 1 + AND Org.ID = DeploymentSurvey.OrgID + AND DeploymentSurvey.Title IS NOT NULL + "); + $sqlQuery->orderby = 'Org.Name'; + + $result = $sqlQuery->execute(); + + $arrayList = new ArrayList(); + + foreach ($result as $rowArray) { + // concept: new Product($rowArray) + $arrayList->push(new $rowArray['ClassName']($rowArray)); + } + + return $arrayList; + } + + // Add User Story from Deployment + function AddUserStory() { + + if (isset($_GET['ID']) && is_numeric($_GET['ID'])) { + $ID = $_GET['ID']; + } else { + die(); + } + + $parent = UserStoryHolder::get()->first(); + if (!$parent) { + $this->setMessage('Error', 'could not add an user story bc there is not any available parent page(UserStoryHolder).'); + $this->redirectBack(); + } + $userStory = new UserStory; + $userStory->Title = $_GET['label']; + $userStory->DeploymentID = $ID; + $userStory->UserStoriesIndustryID = $_GET['industry']; + $userStory->CompanyName = $_GET['org']; + $userStory->CaseStudyTitle = $_GET['org']; + $userStory->ShowInAdmin = 1; + $userStory->setParent($parent); // Should set the ID once the Holder is created... + $userStory->write(); + $userStory->publish("Live", "Stage"); + + $this->setMessage('Success', '' . $userStory->Title . ' added as User Story.'); + + $this->redirectBack(); + } + + function AddNewDeployment(){ + + $survey = DataObject::get_one('DeploymentSurvey','ID = ' . $_POST['survey'] ); + + $deployment = new Deployment; + $deployment->Label = $_POST['label']; + $deployment->DeploymentType = $_POST['type']; + $deployment->CountryCode = $_POST['country']; + $deployment->DeploymentSurveyID = $_POST['survey']; + if($survey){ + $deployment->OrgID = $survey->OrgID; + }else{ + $deployment->OrgID = 0; + } + $deployment->IsPublic = 1; + $deployment->write(); + + $this->owner->setMessage('Success', '' . $_POST['label'] . ' added as a new Deployment.'); + + Controller::curr()->redirectBack(); + } + + function WorkloadsSummary() { + return SangriaPage_Controller::generateSelectListSummary("WorkloadsDescription", + Deployment::$workloads_description_options); + } + + function DeploymentToolsSummary() { + return SangriaPage_Controller::generateSelectListSummary("DeploymentTools", + Deployment::$deployment_tools_options); + } + + function OperatingSystemSummary() { + return SangriaPage_Controller::generateSelectListSummary("OperatingSystems", + Deployment::$operating_systems_options); + } + + function WhyNovaNetwork() { + $filterWhereClause = SangriaPage_Controller::generateFilterWhereClause(); + + $list = DataObject::get("Deployment","WhyNovaNetwork IS NOT NULL".$filterWhereClause,"WhyNovaNetwork"); + + return $list; + } +} \ No newline at end of file diff --git a/openstack/code/sangria/SangriaPageExportDataExtension.php b/openstack/code/sangria/SangriaPageExportDataExtension.php new file mode 100644 index 0000000..62d20b7 --- /dev/null +++ b/openstack/code/sangria/SangriaPageExportDataExtension.php @@ -0,0 +1,419 @@ +update(get_class($this), 'allowed_actions', array( + 'ExportData', + 'exportCLAUsers', + 'exportGerritUsers', + 'ExportSurveyResults', + 'ExportAppDevSurveyResults', + 'exportFoundationMembers', + 'exportCorporateSponsors', + )); + + + Config::inst()->update(get_class($this->owner), 'allowed_actions', array( + 'ExportData', + 'exportCLAUsers', + 'exportGerritUsers', + 'ExportSurveyResults', + 'ExportAppDevSurveyResults', + 'exportFoundationMembers', + 'exportCorporateSponsors', + )); + } + + function ExportData() + { + $this->Title = 'Export Data'; + Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"); + Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.min.js"); + Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css'); + Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js'); + Requirements::javascript("themes/openstack/javascript/jquery.validate.custom.methods.js"); + Requirements::javascript('themes/openstack/javascript/sangria/sangria.page.export.data.js'); + return $this->owner->getViewer('ExportData')->process($this->owner); + } + + function exportCLAUsers() + { + + $params = $this->owner->getRequest()->getVars(); + if (!isset($params['fields']) || empty($params['fields'])) + return $this->owner->httpError('412', 'missing required param fields'); + + if (!isset($params['ext']) || empty($params['ext'])) + return $this->owner->httpError('412', 'missing required param ext'); + + $fields = $params['fields']; + $ext = $params['ext']; + + $sanitized_fields = array(); + + if (!count($fields)) { + return $this->httpError('412', 'missing required param fields'); + } + + $allowed_fields = array('ID' => 'ID', 'FirstName' => 'FirstName', 'SurName' => 'SurName', 'Email' => 'Email'); + + for ($i = 0; $i < count($fields); $i++) { + if (!array_key_exists($fields[$i], $allowed_fields)) + return $this->httpError('412', 'invalid field'); + array_push($sanitized_fields, 'M.' . $fields[$i]); + } + + $sanitized_fields = implode(',', $sanitized_fields); + + $sql = <<< SQL + SELECT {$sanitized_fields} + , GROUP_CONCAT(G.Code, ' | ') AS Groups + FROM Member M + LEFT JOIN Group_Members GM on GM.MemberID = M.ID + LEFT JOIN `Group` G on G.ID = GM.GroupID + WHERE GerritID IS NOT NULL + GROUP BY M.ID + ORDER BY M.SurName, M.FirstName; +SQL; + + $result = DB::query($sql); + $data = array(); + array_push($fields, 'Groups'); + foreach ($result as $row) { + $member = array(); + foreach ($fields as $field) { + $member[$field] = $row[$field]; + } + array_push($data, $member); + } + + $filename = "CLAMembers" . date('Ymd') . "." . $ext; + + return CSVExporter::getInstance()->export($filename, $data); + } + + function exportGerritUsers() + { + $params = $this->owner->getRequest()->getVars(); + if (!isset($params['status']) || empty($params['status'])) + return $this->owner->httpError('412', 'missing required param status'); + + if (!isset($params['ext']) || empty($params['ext'])) + return $this->owner->httpError('412', 'missing required param ext'); + + $status = $params['status']; + $ext = $params['ext']; + + $sanitized_filters = array(); + $allowed_filter_values = array('foundation-members' => 'foundation-members', 'community-members' => 'community-members'); + for ($i = 0; $i < count($status); $i++) { + if (!array_key_exists($status[$i], $allowed_filter_values)) + return $this->httpError('412', 'invalid filter value'); + array_push($sanitized_filters, $status[$i]); + } + + $sanitized_filters = implode("','", $sanitized_filters); + $sql = <<export($filename, $data); + } + + public function Groups() + { + $sql = <<push(new $rowArray['ClassName']($rowArray)); + } + } + + // Export CSV of all Deployment Surveys and Associated Deployments + function ExportSurveyResults() + { + $fileDate = date('Ymdhis'); + + SangriaPage_Controller::generateDateFilters('s'); + + $surveyQuery = "select s.ID as SurveyID, s.Created as SurveyCreated, + s.UpdateDate as SurveyEdited, o.Name as OrgName, o.ID as OrgID , d.ID as DeploymentID, + d.Created as DeploymentCreated, d.UpdateDate as DeploymentEdited, m.FirstName, + m.Surname, m.Email, s.Title, s.Industry, s.OtherIndustry, s.PrimaryCity, + s.PrimaryState, s.PrimaryCountry, s.OrgSize, s.OpenStackInvolvement, + s.InformationSources, s.OtherInformationSources, s.FurtherEnhancement, + s.FoundationUserCommitteePriorities, s.UserGroupMember, s.UserGroupName, + s.OkToContact, s.BusinessDrivers, s.OtherBusinessDrivers, s.WhatDoYouLikeMost, + s.OpenStackRecommendRate as NetPromoter, s.OpenStackRecommendation, + d.Label, d.IsPublic, d.DeploymentType, d.ProjectsUsed, d.CurrentReleases, + d.DeploymentStage, d.NumCloudUsers, d.APIFormats, d.Hypervisors, d.OtherHypervisor, + d.BlockStorageDrivers, d.OtherBlockStorageDriver, d.NetworkDrivers, + d.OtherNetworkDriver, d.IdentityDrivers, d.OtherIndentityDriver, + d.SupportedFeatures, d.ComputeNodes, d.ComputeCores, d.ComputeInstances, + d.BlockStorageTotalSize, d.ObjectStorageSize, d.ObjectStorageNumObjects, + d.NetworkNumIPs, d.WorkloadsDescription, d.OtherWorkloadsDescription, + d.WhyNovaNetwork, d.OtherWhyNovaNetwork, d.DeploymentTools, d.OtherDeploymentTools, d.OperatingSystems, + d.OtherOperatingSystems, d.SwiftGlobalDistributionFeatures, d.SwiftGlobalDistributionFeaturesUsesCases, + d.OtherSwiftGlobalDistributionFeaturesUsesCases, d.Plans2UseSwiftStoragePolicies, + d.OtherPlans2UseSwiftStoragePolicies, d.UsedDBForOpenStackComponents, + d.OtherUsedDBForOpenStackComponents, d.ToolsUsedForYourUsers, d.OtherToolsUsedForYourUsers, + d.Reason2Move2Ceilometer + from DeploymentSurvey s + left outer join Member m on (s.MemberID = m.ID) + left outer join Deployment d on (d.DeploymentSurveyID = s.ID) + left outer join Org o on (s.OrgID = o.ID) + where s.Title is not null AND " . SangriaPage_Controller::$date_filter_query . " + order by s.ID;"; + + $res = DB::query($surveyQuery); + + $fields = array('SurveyID', 'SurveyCreated', 'SurveyEdited', 'OrgName', 'OrgID', 'DeploymentID', 'DeploymentCreated', 'DeploymentEdited', 'FirstName', + 'Surname', 'Email', 'Title', 'Industry', 'OtherIndustry', 'PrimaryCity', 'PrimaryState', 'PrimaryCountry', 'OrgSize', 'OpenStackInvolvement', 'InformationSources', + 'OtherInformationSources', 'FurtherEnhancement', 'FoundationUserCommitteePriorities', 'UserGroupMember', 'UserGroupName', 'OkToContact', 'BusinessDrivers', + 'OtherBusinessDrivers', 'WhatDoYouLikeMost', 'NetPromoter', 'OpenStackRecommendation', 'Label', 'IsPublic', 'DeploymentType', 'ProjectsUsed', + 'CurrentReleases', 'DeploymentStage', 'NumCloudUsers', 'APIFormats', 'Hypervisors', 'OtherHypervisor', 'BlockStorageDrivers', 'OtherBlockStorageDriver', + 'NetworkDrivers', 'OtherNetworkDriver', 'IdentityDrivers', 'OtherIndentityDriver', 'SupportedFeatures', 'ComputeNodes', 'ComputeCores', 'ComputeInstances', + 'BlockStorageTotalSize', 'ObjectStorageSize', 'ObjectStorageNumObjects', 'NetworkNumIPs', 'WorkloadsDescription', 'OtherWorkloadsDescription', + 'WhyNovaNetwork', 'OtherWhyNovaNetwork', 'DeploymentTools', 'OtherDeploymentTools', 'OperatingSystems', 'OtherOperatingSystems', 'SwiftGlobalDistributionFeatures', + 'SwiftGlobalDistributionFeaturesUsesCases', 'OtherSwiftGlobalDistributionFeaturesUsesCases', 'Plans2UseSwiftStoragePolicies', 'OtherPlans2UseSwiftStoragePolicies', + 'UsedDBForOpenStackComponents', 'OtherUsedDBForOpenStackComponents', 'ToolsUsedForYourUsers', 'OtherToolsUsedForYourUsers', 'Reason2Move2Ceilometer'); + $data = array(); + + foreach ($res as $row) { + $member = array(); + foreach ($fields as $field) { + $member[$field] = $row[$field]; + } + array_push($data, $member); + } + + $filename = "survey_results" . $fileDate . ".csv"; + + return CSVExporter::getInstance()->export($filename, $data, ','); + + } + + // Export CSV of all App Dev Surveys + function ExportAppDevSurveyResults() + { + + $fileDate = date('Ymdhis'); + + SangriaPage_Controller::generateDateFilters('s'); + + $surveyQuery = "select s.ID as SurveyID, s.Created as SurveyCreated, + s.LastEdited as SurveyEdited, o.Name as OrgName, o.ID as OrgID, a.ID as AppSurveyID, + a.Created as AppSurveyCreated, a.LastEdited as AppSurveyEdited, m.FirstName, + m.Surname, m.Email, s.Title, s.Industry, s.OtherIndustry, s.PrimaryCity, + s.PrimaryState, s.PrimaryCountry, s.OrgSize, s.OpenStackInvolvement, + s.InformationSources, s.OtherInformationSources, s.FurtherEnhancement, + s.FoundationUserCommitteePriorities, s.UserGroupMember, s.UserGroupName, + s.OkToContact, s.BusinessDrivers, s.OtherBusinessDrivers, s.WhatDoYouLikeMost, + a.Toolkits, a.OtherToolkits, a.ProgrammingLanguages, a.OtherProgrammingLanguages, + a.APIFormats, a.DevelopmentEnvironments, a.OtherDevelopmentEnvironments, + a.OperatingSystems, a.OtherOperatingSystems, a.ConfigTools, a.OtherConfigTools, + a.StateOfOpenStack, a.DocsPriority, a.InteractionWithOtherClouds + from DeploymentSurvey s + right join AppDevSurvey a on (a.DeploymentSurveyID = s.ID) + left outer join Member m on (a.MemberID = m.ID) + left outer join Org o on (s.OrgID = o.ID) + where s.Title is not null AND " . SangriaPage_Controller::$date_filter_query . " + order by s.ID;"; + + $res = DB::query($surveyQuery); + + + $fields = array('SurveyID', 'SurveyCreated', 'SurveyEdited', 'OrgName', 'OrgID', 'AppSurveyID', 'AppSurveyCreated', 'AppSurveyEdited', 'FirstName', + 'Surname', 'Email', 'Title', 'Industry', 'OtherIndustry', 'PrimaryCity', 'PrimaryState', 'PrimaryCountry', 'OrgSize', 'OpenStackInvolvement', 'InformationSources', + 'OtherInformationSources', 'FurtherEnhancement', 'FoundationUserCommitteePriorities', 'UserGroupMember', 'UserGroupName', 'OkToContact', 'BusinessDrivers', + 'OtherBusinessDrivers', 'WhatDoYouLikeMost', 'Toolkits', 'OtherToolkits', 'ProgrammingLanguages', 'OtherProgrammingLanguages', 'APIFormats', 'DevelopmentEnvironments', 'OtherDevelopmentEnvironments', + 'OperatingSystems', 'OtherOperatingSystems', 'ConfigTools', 'OtherConfigTools', 'StateOfOpenStack', 'DocsPriority', 'InteractionWithOtherClouds'); + $data = array(); + + foreach ($res as $row) { + $member = array(); + foreach ($fields as $field) { + $member[$field] = $row[$field]; + } + array_push($data, $member); + } + + $filename = "app_dev_surveys" . $fileDate . ".csv"; + + return CSVExporter::getInstance()->export($filename, $data, ','); + } + + function exportFoundationMembers(){ + $params = $this->owner->getRequest()->getVars(); + if(!isset($params['fields']) || empty($params['fields']) ) + return $this->owner->httpError('412','missing required param fields'); + + if(!isset($params['ext']) || empty($params['ext']) ) + return $this->owner->httpError('412','missing required param ext'); + + $fields = $params['fields']; + $ext = $params['ext']; + + $sanitized_fields = array(); + + if(!count($fields)){ + return $this->owner->httpError('412','missing required param fields'); + } + + $allowed_fields = array('ID'=>'ID','FirstName'=>'FirstName','SurName'=>'SurName','Email'=>'Email'); + + for($i=0 ; $i< count($fields);$i++){ + if(!array_key_exists($fields[$i],$allowed_fields)) + return $this->httpError('412','invalid field'); + array_push($sanitized_fields, 'Member.'.$fields[$i]); + } + + $query = new SQLQuery(); + + $query->setFrom('Member'); + $query->setSelect($sanitized_fields); + $query->addInnerJoin('Group_Members','Group_Members.MemberID = Member.ID'); + $query->addInnerJoin('Group',"Group.ID = Group_Members.GroupID AND Group.Code='foundation-members'"); + $query->setOrderBy('SurName,FirstName'); + + $result = $query->execute(); + + $data = array(); + + foreach($result as $row){ + $member = array(); + foreach($fields as $field){ + $member[$field] = $row[$field]; + } + array_push($data,$member); + } + + $filename = "FoundationMembers" . date('Ymd') . ".".$ext; + + return CSVExporter::getInstance()->export($filename, $data); + } + + function exportCorporateSponsors(){ + + $params = $this->owner->getRequest()->getVars(); + + if(!isset($params['levels']) || empty($params['levels']) ) + return $this->owner->httpError('412','missing required param level'); + + if(!isset($params['fields']) || empty($params['fields']) ) + return $this->owner->httpError('412','missing required param fields'); + + if(!isset($params['ext']) || empty($params['ext']) ) + return $this->owner->httpError('412','missing required param ext'); + + $level = $params['levels']; + + $fields = $params['fields']; + + $ext = $params['ext']; + + $sanitized_fields = array(); + + if(!count($fields)){ + return $this->owner->httpError('412','missing required param fields'); + } + + if(!count($level)){ + return $this->owner->httpError('412','missing required param $level'); + } + + $allowed_fields = array('MemberLevel'=>'MemberLevel','Name'=>'Name','City'=>'City','State'=>'State','Country'=>'Country','Industry'=>'Industry','ContactEmail'=>'ContactEmail','AdminEmail'=>'AdminEmail'); + $allowed_levels = array('Platinum'=>'Platinum', 'Gold'=>'Gold','Startup'=>'Startup','Mention'=>'Mention'); + for($i = 0 ; $i< count($fields);$i++){ + if(!array_key_exists($fields[$i],$allowed_fields)) + return $this->httpError('412','invalid field'); + array_push($sanitized_fields, 'Company.'.$fields[$i]); + } + for($i = 0 ; $i< count($level);$i++){ + if(!array_key_exists($level[$i],$allowed_levels)) + return $this->httpError('412','invalid level'); + } + + $query = new SQLQuery(); + + $query->setFrom('Company'); + $query->setSelect($sanitized_fields); + $query->setWhere(" MemberLevel IN ('".implode("','",$level) ."')"); + $query->setOrderBy('MemberLevel'); + + $result = $query->execute(); + + $data = array(); + + foreach($result as $row){ + $company = array(); + foreach($fields as $field){ + $company[$field] = $row[$field]; + } + array_push($data,$company); + } + + $filename = "Companies" . date('Ymd') . ".".$ext; + + return CSVExporter::getInstance()->export($filename, $data); + } + +} \ No newline at end of file diff --git a/openstack/code/sangria/SangriaPageInvolvementTypeExtension.php b/openstack/code/sangria/SangriaPageInvolvementTypeExtension.php new file mode 100644 index 0000000..3a60f30 --- /dev/null +++ b/openstack/code/sangria/SangriaPageInvolvementTypeExtension.php @@ -0,0 +1,58 @@ +update(get_class($this), 'allowed_actions', array( + 'AddInvolvementType', + 'AddInvolvementTypeForm', + 'GenerateAutoLoginHashes', + )); + + Config::inst()->update(get_class($this->owner), 'allowed_actions', array( + 'AddInvolvementType', + 'AddInvolvementTypeForm', + 'GenerateAutoLoginHashes', + )); + } + + // Involvement Types + function InvolvementTypes() { + return DataObject::get("InvolvementType"); + } + + function AddInvolvementTypeForm() { + return new AddInvolvementTypeForm($this->owner, 'AddInvolvementTypeForm'); + } + + function GenerateAutoLoginHashes() { + $startVal = 0; + + if (isset($_GET["startID"]) && intval($_GET["startID"]) > 0 ) { + $startVal = intval($_GET["startID"]); + } + + $members = Member::get()->filter(array('SubscribedToNewsletter' => 1, 'ID:GreaterThan' => $startVal))->order('ID')->leftJoin('Group_Members', "`Member`.`ID` = `Group_Members`.`MemberID` AND Group_Members.GroupID = 5 "); + foreach( $members as $member ) { + $token = $member->generateAutologinTokenAndStoreHash(14); + echo "\"".$member->ID."\",\"".$member->Email."\",\"".$member->FirstName."\",\"".$member->Surname."\",\"".urldecode($token)."\"
"; + flush(); + } + } +} \ No newline at end of file diff --git a/openstack/code/sangria/SangriaPageStandardizeOrgNamesExtension.php b/openstack/code/sangria/SangriaPageStandardizeOrgNamesExtension.php new file mode 100644 index 0000000..1e1bb69 --- /dev/null +++ b/openstack/code/sangria/SangriaPageStandardizeOrgNamesExtension.php @@ -0,0 +1,94 @@ +update(get_class($this), 'allowed_actions', array( + 'StandardizeOrgNames', + 'MarkOrgStandardized', + 'RemoveDuplicateOrg')); + + Config::inst()->update(get_class($this->owner), 'allowed_actions', array( + 'StandardizeOrgNames', + 'MarkOrgStandardized', + 'RemoveDuplicateOrg')); + } + + // Org Standardization + function Orgs() { + $orgs = DataObject::get("Org","Name"); + return $orgs; + } + + function NonStandardizedOrgs() { + $orgs = DataObject::get("Org","IsStandardizedOrg = 0","Name",null,150); + return $orgs; + } + + function StandardizedOrgs() { + global $orgs_cached; + + if( count($orgs_cached) > 0 ) { + return $orgs_cached; + } else { + $orgs = DataObject::get("Org","IsStandardizedOrg = 1","Name"); + $orgs_cached = $orgs; + return $orgs; + } + } + + function MarkOrgStandardized() { + if(isset($_GET['orgId']) && is_numeric($_GET['orgId'])) { + $orgId = $_GET['orgId']; + } + + $org = DataObject::get_by_id("Org",$orgId); + $org->IsStandardizedOrg = 1; + $org->write(); + Controller::curr()->redirectBack(); + } + + function RemoveDuplicateOrg() { + if(isset($_POST['oldOrgIds']) && is_array($_POST['oldOrgIds'])) { + $oldOrgIds = $_POST['oldOrgIds']; + } + + foreach( $oldOrgIds as $oldId => $newId) { + if( $newId == "STANDARDIZE") { + $org = DataObject::get_by_id("Org",$oldId); + $org->IsStandardizedOrg = 1; + $org->write(); + } else if( $newId != 0 ) { + $oldOrg = DataObject::get_by_id("Org",$oldId); + $newOrg = DataObject::get_by_id("Org",$newId); + + // Update all members with new Org + DB::query("UPDATE `Affiliation` SET `OrganizationID` = ".$newId." WHERE `OrganizationID` = ".$oldId); + + // Remove old Org + DB::query("DELETE FROM `Org` WHERE `ID` = ".$oldId); + } + } + + Controller::curr()->redirectBack(); + } + +} \ No newline at end of file diff --git a/openstack/code/sangria/SangriaPageSurveyDetailsExtension.php b/openstack/code/sangria/SangriaPageSurveyDetailsExtension.php new file mode 100644 index 0000000..41012f6 --- /dev/null +++ b/openstack/code/sangria/SangriaPageSurveyDetailsExtension.php @@ -0,0 +1,62 @@ +update(get_class($this), 'allowed_actions', array( + 'SetCaseStudy', + 'SurveyDetails', + )); + + Config::inst()->update(get_class($this->owner), 'allowed_actions', array( + 'SetCaseStudy', + 'SurveyDetails', + )); + } + + function SetCaseStudy() { + if(isset($_GET['ID']) && is_numeric($_GET['ID'])) { + $UserStory = $_GET['ID']; + }else{ + die(); + } + + $setCaseStudy = ($_GET['Set'] == 1)? 1 : 0; + $story = SiteTree::get_by_id("UserStory",$UserStory); + + $story->ShowCaseStudy = $setCaseStudy; + $story->write(); + $story->publish("Live","Stage"); + + $this->owner->setMessage('Success', 'Case Study updated for ' . $story->Title . ''); + + Controller::curr()->redirectBack(); + } + + function SurveyDetails(){ + $params = $this->owner->request->allParams(); + $survey_id = intval(Convert::raw2sql($params["ID"]));; + $survey = DeploymentSurvey::get()->byID($survey_id); + if($survey) + return $this->owner->Customise($survey)->renderWith(array('SangriaPage_SurveyDetails','SangriaPage','SangriaPage')); + return $this->owner->httpError(404, 'Sorry that Deployment Survey could not be found!.'); + } + +} \ No newline at end of file diff --git a/openstack/code/sangria/SangriaPageViewCurrentStoriesExtension.php b/openstack/code/sangria/SangriaPageViewCurrentStoriesExtension.php new file mode 100644 index 0000000..9cdfc71 --- /dev/null +++ b/openstack/code/sangria/SangriaPageViewCurrentStoriesExtension.php @@ -0,0 +1,82 @@ +update(get_class($this), 'allowed_actions',array( + 'ViewCurrentStories', + 'UpdateStories', + 'SetAdminSS', + )); + + Config::inst()->update(get_class($this->owner), 'allowed_actions',array( + 'ViewCurrentStories', + 'UpdateStories', + 'SetAdminSS', + )); + } + + // Update Stories Industry and Order + function UpdateStories(){ + foreach($_POST['industry'] as $story_id => $industry){ + $story = SiteTree::get_by_id("UserStory",$story_id); + $story->UserStoriesIndustryID = $industry; + $story->Sort = $_POST['order'][$story_id]; + $story->Video = $_POST['video'][$story_id]; + $story->Title = $_POST['title'][$story_id]; + $story->ShowVideo = ($_POST['video'][$story_id])? true : false; + $story->write(); + $story->publish("Live","Stage"); + } + + $this->owner->setMessage('Success', 'User Stories saved.'); + } + + function SetAdminSS() { + if(isset($_GET['ID']) && is_numeric($_GET['ID'])) { + $UserStory = $_GET['ID']; + }else{ + die(); + } + $showinAdmin = ($_GET['Set'] == 1)? 1 : 0; + + $story = SiteTree::get_by_id("UserStory", $UserStory); + $parent = UserStoryHolder::get()->first(); + + if(!$parent){ + $this->owner->setMessage('Error', 'could not publish user story bc there is not any available parent page(UserStoryHolder).'); + Controller::curr()->redirectBack(); + } + + $story->ShowInAdmin = $showinAdmin; + $story->setParent($parent); // Should set the ID once the Holder is created... + $story->write(); + $story->publish("Live","Stage"); + + $this->owner->setMessage('Success', '' . $story->Title . ' updated.'); + + Controller::curr()->redirectBack(); + } + + function UserStoriesIndustries(){ + return UserStoriesIndustry::get()->filter('Active', 1); + } + +} \ No newline at end of file diff --git a/openstack/code/sangria/SangriaPageViewSpeakingSubmissionsExtension.php b/openstack/code/sangria/SangriaPageViewSpeakingSubmissionsExtension.php new file mode 100644 index 0000000..a614ec6 --- /dev/null +++ b/openstack/code/sangria/SangriaPageViewSpeakingSubmissionsExtension.php @@ -0,0 +1,44 @@ +update(get_class($this), 'allowed_actions',array( + 'ViewSpeakingSubmissions', + )); + + Config::inst()->update(get_class($this->owner), 'allowed_actions',array( + 'ViewSpeakingSubmissions', + )); + } + + // Speaking Submissions + function SpeakingSubmissions() { + $submissions = DataObject::get("SpeakerSubmission","Created > '2012-11-01'","Created desc"); + SangriaPage_Controller::$submissionsCount = $submissions->Count(); + return $submissions; + } + + function SpeakingSubmissionCount() { + $this->SpeakingSubmissions(); + return SangriaPage_Controller::$submissionsCount; + } +} \ No newline at end of file diff --git a/openstack/code/sangria/SangriaSetCategorySponsorsExtension.php b/openstack/code/sangria/SangriaSetCategorySponsorsExtension.php new file mode 100644 index 0000000..157bf19 --- /dev/null +++ b/openstack/code/sangria/SangriaSetCategorySponsorsExtension.php @@ -0,0 +1,144 @@ +update(get_class($this), 'allowed_actions',array( + 'SetCategorySponsors', + 'UpdateSponsor', + 'SetSponsorMarketplaces', + )); + + Config::inst()->update(get_class($this->owner), 'allowed_actions',array( + 'SetCategorySponsors', + 'UpdateSponsor', + 'SetSponsorMarketplaces', + )); + } + + // Sponsors + + function SponsorsRequest(){ + return DataObject::get('Sponsor','Approved = 0'); + } + + function SponsorsApproved(){ + return DataObject::Get('Sponsor','Approved = 2'); + } + + function SponsorViaGet(){ + return DataObject::get_one('Sponsor','ID = ' . intval($_GET['sponsor_id'])); + } + + function SponsorsMarketplaces(){ + $list = new ArrayList(); + for ($i=1; $i<=5; $i++){ + $do = new DataObject(); + $do->Name = 'Market '.$i; + $do->Key = $i; + $list->push($do); + } + return $list; + } + + /*function UpdateSponsor(){ + $sponsor = DataObject::get_one('Sponsor','ID = ' . intval($_GET['sponsor_id'])); + + switch($_GET['action']){ + case 'approved': + $sponsor->Approved = 1; + break; + case 'rejected': + $sponsor->Approved = -1; + break; + default: + throw new Exception('Method not allowed.'); + die(); + break; + } + + $marketplaces = explode(',', $sponsor->Category); + + foreach($marketplaces as $m){ + + $market = new SponsorMarketplace(); + $market->SponsorID = $sponsor->ID; + $market->MarketplaceID = $m; + $market->write(); + + } + + $contract_template = DataObject::get_one('ContractTemplate', " Type = 'General' "); + $contract_url = Director::baseFolder($contract_template->PDF()->URL).$contract_template->PDF()->URL; + + $ESLoader = new SplClassLoader('EchoSign', realpath(__DIR__.'/../../')); + $ESLoader->register(); + + $client = new SoapClient(EchoSign\API::getWSDL()); + $api = new EchoSign\API($client, 'PGRUY64K6T664Z'); + + $file = EchoSign\Info\FileInfo::createFromFile($contract_url); + + $document = new EchoSign\Info\DocumentCreationInfo('This is a test contract', $file); + + $recipients = new EchoSign\Info\RecipientInfo; + $recipients->addRecipient( $sponsor->LegalEmail ); + + $document->setRecipients($recipients); + + $contract = new Contract(); + $contract->SponsorID = $sponsor->ID; + $contract->write(); + + $url = 'http://openstack.dev9.tipit.net/contract/UpdateStatus?id=' . $contract->ID; + + $document->setCallbackInfo($url); + + $result = $api->sendDocument($document); + + $contract->EchosignID = $result->documentKeys->DocumentKey->documentKey; + + $contract->write(); + + + $sponsor->write(); + mail($sponsor->Email,'Your Sponsor Request has been ' . $_GET['action'], 'Awesome!'); + + $this->setMessage('Success', '' . $sponsor->CompanyName . ': Updated'); + + Director::redirect('/sangria/ViewSponsorsRequest'); + +}*/ + + function SetSponsorMarketplaces(){ + + $sponsor_id = intval($_POST['SponsorID']); + + DB::query("DELETE FROM `SponsorMarketplace` WHERE SponsorID = " . $sponsor_id . ""); + + foreach($_POST['marketplaces'] as $markets){ + $market = new SponsorMarketplace(); + $market->SponsorID = $sponsor_id; + $market->MarketplaceID = $markets; + $market->write(); + } + Controller::curr()->redirect('/sangria/SetCategorySponsors'); + } +} \ No newline at end of file diff --git a/registration/code/EditProfilePage.php b/registration/code/EditProfilePage.php index b24cc28..f4116e7 100755 --- a/registration/code/EditProfilePage.php +++ b/registration/code/EditProfilePage.php @@ -64,8 +64,9 @@ class EditProfilePage_Controller extends Page_Controller Requirements::css("themes/openstack/css/chosen.css", "screen,projection"); Requirements::css('registration/css/edit.profile.page.css'); - Requirements::css("themes/openstack/javascript/jquery-ui-1.10.3.custom/css/smoothness/jquery-ui-1.10.3.custom.min.css"); Requirements::css("registration/css/affiliations.css"); + Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css'); + Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js'); Requirements::javascript("themes/openstack/javascript/chosen.jquery.min.js"); Requirements::javascript("themes/openstack/javascript/pure.min.js"); @@ -73,12 +74,11 @@ class EditProfilePage_Controller extends Page_Controller Requirements::javascript("themes/openstack/javascript/jquery.cleanform.js"); Requirements::javascript(Director::protocol()."ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"); Requirements::javascript(Director::protocol()."ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.min.js"); - Requirements::javascript("themes/openstack/javascript/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.js"); Requirements::javascript("themes/openstack/javascript/jquery.ui.datepicker.validation.package-1.0.1/jquery.ui.datepicker.validation.js"); Requirements::javascript("themes/openstack/javascript/jquery.validate.custom.methods.js"); - Requirements::javascript("registration/javascript/affiliations.js"); Requirements::javascript('registration/javascript/edit.profile.page.js'); + $this->course_repository = new SapphireCourseRepository; $this->training_repository = new SapphireTrainingServiceRepository; @@ -457,8 +457,9 @@ class EditProfilePage_Controller extends Page_Controller function AddTrainingCourseForm() { - Requirements::css("themes/openstack/javascript/jquery-ui-1.10.3.custom/css/smoothness/jquery-ui-1.10.3.custom.min.css"); - Requirements::javascript("themes/openstack/javascript/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.min.js"); + Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css'); + Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js'); + Requirements::javascript("datepicker/javascript/datepicker.js"); Requirements::javascript('registration/javascript/edit.profile.training.form.js'); diff --git a/registration/code/RegistrationPage.php b/registration/code/RegistrationPage.php index b58672f..b36b02d 100755 --- a/registration/code/RegistrationPage.php +++ b/registration/code/RegistrationPage.php @@ -30,18 +30,16 @@ class RegistrationPage_Controller extends Page_Controller { parent::init(); + Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css'); + Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js'); Requirements::css("themes/openstack/css/chosen.css", "screen,projection"); - Requirements::css("themes/openstack/javascript/jquery-ui-1.10.3.custom/css/smoothness/jquery-ui-1.10.3.custom.min.css"); Requirements::css("registration/css/affiliations.css"); - - Requirements::javascript("themes/openstack/javascript/chosen.jquery.min.js"); Requirements::javascript("themes/openstack/javascript/pure.min.js"); Requirements::javascript("themes/openstack/javascript/jquery.serialize.js"); Requirements::javascript("themes/openstack/javascript/jquery.cleanform.js"); Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"); Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.min.js"); - Requirements::javascript("themes/openstack/javascript/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.js"); Requirements::javascript("themes/openstack/javascript/jquery.ui.datepicker.validation.package-1.0.1/jquery.ui.datepicker.validation.js"); Requirements::javascript("themes/openstack/javascript/jquery.validate.custom.methods.js"); diff --git a/registration/code/SpeakerVotingRegistrationPage.php b/registration/code/SpeakerVotingRegistrationPage.php index 7b7aa26..33021c9 100644 --- a/registration/code/SpeakerVotingRegistrationPage.php +++ b/registration/code/SpeakerVotingRegistrationPage.php @@ -28,18 +28,16 @@ class SpeakerVotingRegistrationPage_Controller extends Page_Controller { parent::init(); + Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css'); + Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js'); Requirements::css("themes/openstack/css/chosen.css", "screen,projection"); - Requirements::css("themes/openstack/javascript/jquery-ui-1.10.3.custom/css/smoothness/jquery-ui-1.10.3.custom.min.css"); Requirements::css("registration/css/affiliations.css"); - - Requirements::javascript("themes/openstack/javascript/chosen.jquery.min.js"); Requirements::javascript("themes/openstack/javascript/pure.min.js"); Requirements::javascript("themes/openstack/javascript/jquery.serialize.js"); Requirements::javascript("themes/openstack/javascript/jquery.cleanform.js"); Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"); Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.min.js"); - Requirements::javascript("themes/openstack/javascript/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.js"); Requirements::javascript("themes/openstack/javascript/jquery.ui.datepicker.validation.package-1.0.1/jquery.ui.datepicker.validation.js"); Requirements::javascript("themes/openstack/javascript/jquery.validate.custom.methods.js"); diff --git a/registration/css/affiliations.css b/registration/css/affiliations.css index 80ac185..524464e 100644 --- a/registration/css/affiliations.css +++ b/registration/css/affiliations.css @@ -25,6 +25,6 @@ } .affiliation-info{ - width: 200px !important; + width: 300px !important; float: left; } \ No newline at end of file diff --git a/registration/css/edit.profile.page.css b/registration/css/edit.profile.page.css index 38f8c5d..3d5fd66 100644 --- a/registration/css/edit.profile.page.css +++ b/registration/css/edit.profile.page.css @@ -4,12 +4,13 @@ label.error{ color: #fff; padding: 5px; margin: 0; - width: 100%; + width: auto; float:left; -webkit-border-radius: 05px; -moz-border-radius: 05px; border-radius: 05px; } + input.error{ border: 1px solid #aa2222; } diff --git a/registration/javascript/affiliations.js b/registration/javascript/affiliations.js index 8c7c9b0..8304153 100644 --- a/registration/javascript/affiliations.js +++ b/registration/javascript/affiliations.js @@ -103,10 +103,12 @@ if(org_name.length>0){ org_name.autocomplete({ source: rest_urls.ListOrganizations, - minLength: 2 + minLength: 2, + open: function( event, ui ) { + org_name.autocomplete("widget").css('z-index',5000); + } }); - org_name.autocomplete("widget").css('z-index',1000); } var date_picker_start = $(affiliation_form_id+"_StartDate"); diff --git a/themes/openstack/templates/Layout/SangriaPage_AddInvolvementType.ss b/themes/openstack/templates/Layout/SangriaPage_AddInvolvementType.ss index c3d8c6a..5633d86 100644 --- a/themes/openstack/templates/Layout/SangriaPage_AddInvolvementType.ss +++ b/themes/openstack/templates/Layout/SangriaPage_AddInvolvementType.ss @@ -1,9 +1,8 @@ -

Add an Involvement Type

-

Involvement Types

+<% if InvolvementTypes %> <% loop InvolvementTypes %>

$Name

<% end_loop %> - +<% end_if %> $AddInvolvementTypeForm \ No newline at end of file diff --git a/themes/openstack/templates/Layout/SangriaPage_SetCategorySponsors.ss b/themes/openstack/templates/Layout/SangriaPage_SetCategorySponsors.ss new file mode 100644 index 0000000..6ded3f4 --- /dev/null +++ b/themes/openstack/templates/Layout/SangriaPage_SetCategorySponsors.ss @@ -0,0 +1,16 @@ +
+

Set Category for Sponsors

+ <% if SponsorsApproved %> + <% control SponsorsApproved %> +
    +
  • $CompanyName

    + + +

    $ApproveCategoriesForm

    +

    +

  • + +
+ <% end_control %> + <% end_if %> +
diff --git a/themes/openstack/templates/Layout/SangriaPage_ViewCurrentStories.ss b/themes/openstack/templates/Layout/SangriaPage_ViewCurrentStories.ss index 23009ac..f8c0b7d 100644 --- a/themes/openstack/templates/Layout/SangriaPage_ViewCurrentStories.ss +++ b/themes/openstack/templates/Layout/SangriaPage_ViewCurrentStories.ss @@ -4,13 +4,13 @@ }

User Stories

-View Deployment List +View Deployment List
<% loop UserStoriesIndustries %> <% if Stories %>

$IndustryName

-
+ diff --git a/themes/openstack/templates/Layout/SangriaPage_ViewDeploymentDetails.ss b/themes/openstack/templates/Layout/SangriaPage_ViewDeploymentDetails.ss index f9e2004..eb0bf22 100644 --- a/themes/openstack/templates/Layout/SangriaPage_ViewDeploymentDetails.ss +++ b/themes/openstack/templates/Layout/SangriaPage_ViewDeploymentDetails.ss @@ -19,7 +19,7 @@
- +
@@ -104,7 +104,7 @@ <% loop Deployments %> - +
Deployment Name
diff --git a/themes/openstack/templates/Layout/SangriaPage_ViewSponsorsRequest.ss b/themes/openstack/templates/Layout/SangriaPage_ViewSponsorsRequest.ss new file mode 100644 index 0000000..3664af1 --- /dev/null +++ b/themes/openstack/templates/Layout/SangriaPage_ViewSponsorsRequest.ss @@ -0,0 +1,11 @@ +
+

Sponsor Requests

+ <% if SponsorsRequest %> + <% control SponsorsRequest %> + + <% end_control %> + <% end_if %> +