<?php include 'include.php'; //Includes the necessary bootstrapping and the ajax functions module_load_include('php', 'vals_soc', 'includes/classes/Timeline'); // old version switch ($_GET['action']) { case 'setdate': if (isset($_POST['date'])) { $now = Timeline::getInstance($_POST['date'])->getNow(); echo $now->format('F j, Y, g:i a'); } else { echo t("No date submitted!"); } break; default: echo "No such action: " . $_GET['action']; }
public static function getOrgadminTimelineVars() { $timeline = Timeline::getInstance(); $timeline_args = array(); $timeline_args['managedOrganisationsVisible'] = FALSE; $timeline_args['manageProjectIdeasVisible'] = FALSE; $timeline_args['browseProjectIdeasVisible'] = FALSE; $timeline_args['organisationMembersVisible'] = FALSE; $timeline_args['connectionsVisible'] = FALSE; $timeline_args['proposalsVisible'] = FALSE; //$timeline_args['matchedProjectsVisible'] = FALSE; $timeline_args['myAcceptedProjectsVisible'] = FALSE; $timeline_args['dashboardLegend'] = ""; $period = $timeline->getCurrentPeriod(); switch ($period) { case PROGRAM_NOT_YET_STARTED: $timeline_args['dashboardLegend'] = t("Program has not started yet. Menu options will be available from the following date. ") . $timeline->getProgramStartDate()->format('F j, Y, g:i a'); break; case PRE_ORG_SIGNUP_PERIOD: $timeline_args['dashboardLegend'] = t("Program is active, however you must wait until the following date to register your organization/s. ") . $timeline->getOrgsSignupStartDate()->format('F j, Y, g:i a'); break; case ORG_SIGNUP_PERIOD: $timeline_args['dashboardLegend'] = t("Enter your organisation details and project ideas. You have until the following date when you can no longer add or delete entries. ") . $timeline->getOrgsSignupEndDate()->format('F j, Y, g:i a'); $timeline_args['managedOrganisationsVisible'] = TRUE; $timeline_args['manageProjectIdeasVisible'] = TRUE; $timeline_args['browseProjectIdeasVisible'] = TRUE; $timeline_args['organisationMembersVisible'] = TRUE; break; case PRE_ORGS_ANNOUNCED_PERIOD: $timeline_args['dashboardLegend'] = t("Modify your organisation details and project ideas. You have until the following date when your organisations and project " . "ideas become visible to students. ") . $timeline->getOrgsAnnouncedDate()->format('F j, Y, g:i a'); $timeline_args['managedOrganisationsVisible'] = TRUE; // only modify entries $timeline_args['manageProjectIdeasVisible'] = TRUE; $timeline_args['browseProjectIdeasVisible'] = TRUE; $timeline_args['organisationMembersVisible'] = TRUE; break; case POST_ORGS_ANNOUNCED_PERIOD: $timeline_args['dashboardLegend'] = t("Your organisations and project ideas are now visible to other users of the system."); $timeline_args['managedOrganisationsVisible'] = TRUE; $timeline_args['manageProjectIdeasVisible'] = TRUE; $timeline_args['browseProjectIdeasVisible'] = TRUE; $timeline_args['organisationMembersVisible'] = TRUE; $timeline_args['connectionsVisible'] = TRUE; break; case STUDENT_SIGNUP_PERIOD: $timeline_args['dashboardLegend'] = t("Student signup period. Students can now submit project proposals"); $timeline_args['managedOrganisationsVisible'] = TRUE; $timeline_args['manageProjectIdeasVisible'] = TRUE; $timeline_args['browseProjectIdeasVisible'] = TRUE; $timeline_args['organisationMembersVisible'] = TRUE; $timeline_args['connectionsVisible'] = TRUE; $timeline_args['proposalsVisible'] = TRUE; //menu options - Proposals submitted to my Organisations $timeline_args['myAcceptedProjectsVisible'] = TRUE; break; case PRE_ORGS_REVIEW_APPLICATIONS_DEADLINE: $timeline_args['dashboardLegend'] = t("Please review your project applications before the following date. ") . $timeline->getOrgsReviewApplicationsDate()->format('F j, Y, g:i a'); $timeline_args['managedOrganisationsVisible'] = TRUE; $timeline_args['manageProjectIdeasVisible'] = TRUE; $timeline_args['browseProjectIdeasVisible'] = TRUE; $timeline_args['organisationMembersVisible'] = TRUE; $timeline_args['connectionsVisible'] = TRUE; $timeline_args['proposalsVisible'] = TRUE; //menu options - Proposals submitted to my Organisations $timeline_args['myAcceptedProjectsVisible'] = TRUE; break; case PRE_PROPOSAL_MATCHED_DEADLINE: $timeline_args['dashboardLegend'] = t("Please ensure you have matched all students projects to mentors before the following date. ") . $timeline->getStudentsMatchedToMentorsDate()->format('F j, Y, g:i a'); $timeline_args['managedOrganisationsVisible'] = TRUE; $timeline_args['manageProjectIdeasVisible'] = TRUE; $timeline_args['browseProjectIdeasVisible'] = TRUE; $timeline_args['organisationMembersVisible'] = TRUE; $timeline_args['connectionsVisible'] = TRUE; $timeline_args['proposalsVisible'] = TRUE; //menu options - Proposals submitted to my Organisations $timeline_args['myAcceptedProjectsVisible'] = TRUE; break; case PRE_STUDENTS_ANNOUNCED_DEADLINE: $timeline_args['dashboardLegend'] = t("The list of students and projects will become visable to everyone after the following date. ") . $timeline->getAcceptedStudentsAnnouncedDate()->format('F j, Y, g:i a'); $timeline_args['managedOrganisationsVisible'] = TRUE; $timeline_args['manageProjectIdeasVisible'] = TRUE; $timeline_args['browseProjectIdeasVisible'] = TRUE; $timeline_args['organisationMembersVisible'] = TRUE; $timeline_args['connectionsVisible'] = TRUE; $timeline_args['proposalsVisible'] = TRUE; //menu options - Proposals submitted to my Organisations $timeline_args['myAcceptedProjectsVisible'] = TRUE; break; case PRE_BONDING_PERIOD: $timeline_args['dashboardLegend'] = t("The list of students and projects is now visible to other users of the system. " . "The Bonding period starts on the following date. ") . $timeline->getCommunityBondingPeriodStart()->format('F j, Y, g:i a'); $timeline_args['managedOrganisationsVisible'] = TRUE; $timeline_args['manageProjectIdeasVisible'] = TRUE; $timeline_args['browseProjectIdeasVisible'] = TRUE; $timeline_args['organisationMembersVisible'] = TRUE; $timeline_args['connectionsVisible'] = TRUE; $timeline_args['proposalsVisible'] = TRUE; //menu options - Proposals submitted to my Organisations //$timeline_args['matchedProjectsVisible'] = TRUE;//- MENU OPTION - PROJECTS FOR myOrgs - these are the matched proper projects $timeline_args['myAcceptedProjectsVisible'] = TRUE; break; case PRE_CODING_PERIOD: $timeline_args['dashboardLegend'] = t("Community bonding period. Coding starts on the following date. ") . $timeline->getCodingStartDate()->format('F j, Y, g:i a'); $timeline_args['managedOrganisationsVisible'] = TRUE; $timeline_args['manageProjectIdeasVisible'] = TRUE; $timeline_args['browseProjectIdeasVisible'] = TRUE; $timeline_args['organisationMembersVisible'] = TRUE; $timeline_args['connectionsVisible'] = TRUE; $timeline_args['proposalsVisible'] = TRUE; //menu options - Proposals submitted to my Organisations //$timeline_args['matchedProjectsVisible'] = TRUE;//- MENU OPTION - PROJECTS FOR myOrgs - these are the matched proper projects $timeline_args['myAcceptedProjectsVisible'] = TRUE; break; case PRE_SUGGESTED_CODING_END_DATE: $timeline_args['dashboardLegend'] = t("Coding period. The following is the suggested end date for coding. ") . $timeline->getSuggestedCodingDeadline()->format('F j, Y, g:i a'); $timeline_args['managedOrganisationsVisible'] = TRUE; $timeline_args['manageProjectIdeasVisible'] = TRUE; $timeline_args['browseProjectIdeasVisible'] = TRUE; $timeline_args['organisationMembersVisible'] = TRUE; $timeline_args['connectionsVisible'] = TRUE; $timeline_args['proposalsVisible'] = TRUE; //menu options - Proposals submitted to my Organisations //$timeline_args['matchedProjectsVisible'] = TRUE;//- MENU OPTION - PROJECTS FOR myOrgs - these are the matched proper projects $timeline_args['myAcceptedProjectsVisible'] = TRUE; break; case PRE_CODING_DEADLINE: $timeline_args['dashboardLegend'] = t("Coding period. The following is the deadline date for coding. ") . $timeline->getCodingEndDate()->format('F j, Y, g:i a'); $timeline_args['managedOrganisationsVisible'] = TRUE; $timeline_args['manageProjectIdeasVisible'] = TRUE; $timeline_args['browseProjectIdeasVisible'] = TRUE; $timeline_args['organisationMembersVisible'] = TRUE; $timeline_args['connectionsVisible'] = TRUE; $timeline_args['proposalsVisible'] = TRUE; //menu options - Proposals submitted to my Organisations //$timeline_args['matchedProjectsVisible'] = TRUE;//- MENU OPTION - PROJECTS FOR myOrgs - these are the matched proper projects $timeline_args['myAcceptedProjectsVisible'] = TRUE; break; case OUT_OF_SEASON: $timeline_args['dashboardLegend'] = t("The program is currently out of season."); break; case PROGRAM_INACTIVE: default: $timeline_args['dashboardLegend'] = t("No program currently active."); break; } return $timeline_args; }