/**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $intDateStart = class_carrier::getInstance()->getObjSession()->getSession(self::$STR_SESSION_KEY_DATE_START);
     if ($intDateStart == "") {
         $intDateStart = strtotime(strftime("%Y-%m", time()) . "-01");
     }
     //Start: first day of current month
     $this->objDateStart = new class_date();
     $this->objDateStart->setTimeInOldStyle($intDateStart);
     //End: Current Day of month
     $intDateEnd = class_carrier::getInstance()->getObjSession()->getSession(self::$STR_SESSION_KEY_DATE_END);
     if ($intDateEnd == "") {
         $intDateEnd = time() + 3600 * 24;
     }
     $this->objDateEnd = new class_date();
     $this->objDateEnd->setTimeInOldStyle($intDateEnd);
     $this->intInterval = class_carrier::getInstance()->getObjSession()->getSession(self::$STR_SESSION_KEY_INTERVAL);
     if ($this->intInterval == "") {
         $this->intInterval = 2;
     }
     class_carrier::getInstance()->getObjSession()->setSession(self::$STR_SESSION_KEY_DATE_START, $intDateStart);
     class_carrier::getInstance()->getObjSession()->setSession(self::$STR_SESSION_KEY_DATE_END, $intDateEnd);
     class_carrier::getInstance()->getObjSession()->setSession(self::$STR_SESSION_KEY_INTERVAL, $this->intInterval);
     //stats may take time -> increase the time available
     if (@ini_get("max_execution_time") < 500 && @ini_get("max_execution_time") > 0) {
         @ini_set("max_execution_time", "500");
     }
     //stats may consume a lot of memory, increase max mem limit
     if (class_carrier::getInstance()->getObjConfig()->getPhpIni("memory_limit") < 30) {
         @ini_set("memory_limit", "60M");
     }
     $this->objPluginManager = new class_pluginmanager(self::$STR_PLUGIN_EXTENSION_POINT, "/admin/statsreports");
     $this->setAction("list");
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $intDateStart = class_carrier::getInstance()->getObjSession()->getSession(class_module_stats_admin::$STR_SESSION_KEY_DATE_START);
     //Start: first day of current month
     $this->objDateStart = new class_date();
     $this->objDateStart->setTimeInOldStyle($intDateStart);
     //End: Current Day of month
     $intDateEnd = class_carrier::getInstance()->getObjSession()->getSession(class_module_stats_admin::$STR_SESSION_KEY_DATE_END);
     $this->objDateEnd = new class_date();
     $this->objDateEnd->setTimeInOldStyle($intDateEnd);
     $this->intInterval = class_carrier::getInstance()->getObjSession()->getSession(class_module_stats_admin::$STR_SESSION_KEY_INTERVAL);
 }
 /**
  * Creates the list of events available
  *
  * @return string
  * @permissions view
  */
 protected function actionList()
 {
     $strReturn = "";
     $strEvents = "";
     //switch between calendar and list-modes
     if ($this->arrElementData["int2"] == "0") {
         //calendar mode
         $strWrapperID = $this->objTemplate->readTemplate("/module_eventmanager/" . $this->arrElementData["char1"], "event_calendar");
         $arrTemplate = array();
         $arrTemplate["cal_eventsource"] = _xmlpath_ . "?module=eventmanager&action=getJsonEvents&page=" . $this->getPagename();
         $arrTemplate["rssurl"] = _xmlpath_ . "?module=eventmanager&action=eventRssFeed&page=" . $this->getPagename();
         $strReturn .= $this->objTemplate->fillTemplate($arrTemplate, $strWrapperID);
     } else {
         //list based mode
         $objFilterStartDate = null;
         $objFilterEndDate = null;
         $intFilterStatus = $this->getParam("event_filter_status") != "" ? htmlspecialchars($this->getParam("event_filter_status"), ENT_QUOTES, "UTF-8", false) : null;
         if ($this->getParam("event_filter_date_from") != "") {
             $objDateTime = DateTime::createFromFormat("Y-m-d", $this->getParam("event_filter_date_from"));
             $objFilterStartDate = new class_date();
             $objFilterStartDate->setTimeInOldStyle($objDateTime->getTimestamp());
         }
         if ($this->getParam("event_filter_date_to") != "") {
             $objDateTime = DateTime::createFromFormat("Y-m-d", $this->getParam("event_filter_date_to"));
             $objFilterEndDate = new class_date();
             $objFilterEndDate->setTimeInOldStyle($objDateTime->getTimestamp());
         }
         $arrEvents = class_module_eventmanager_event::getAllEvents(false, false, $objFilterStartDate, $objFilterEndDate, true, $this->arrElementData["int1"], $intFilterStatus);
         foreach ($arrEvents as $objOneEvent) {
             if ($objOneEvent->rightView()) {
                 $objMapper = new class_template_mapper($objOneEvent);
                 //legacy support
                 $objMapper->addPlaceholder("dateTimeFrom", dateToString($objOneEvent->getObjStartDate(), true));
                 $objMapper->addPlaceholder("dateFrom", dateToString($objOneEvent->getObjStartDate(), false));
                 $objMapper->addPlaceholder("dateTimeUntil", dateToString($objOneEvent->getObjEndDate(), true));
                 $objMapper->addPlaceholder("dateUntil", dateToString($objOneEvent->getObjEndDate(), false));
                 $objMapper->addPlaceholder("title", $objOneEvent->getStrTitle());
                 $objMapper->addPlaceholder("description", $objOneEvent->getStrDescription());
                 $objMapper->addPlaceholder("location", $objOneEvent->getStrLocation());
                 $objMapper->addPlaceholder("eventStatus", $objOneEvent->getIntEventStatus());
                 $objMapper->addPlaceholder("systemid", $objOneEvent->getSystemid());
                 $objMapper->addPlaceholder("detailsLinkHref", class_link::getLinkPortalHref($this->getPagename(), "", "eventDetails", "", $objOneEvent->getSystemid(), "", $objOneEvent->getStrTitle()));
                 if ($objOneEvent->getIntRegistrationRequired() == "1" && $objOneEvent->rightRight1()) {
                     $objMapper->addPlaceholder("registerLinkHref", class_link::getLinkPortalHref($this->getPagename(), "", "registerForEvent", "", $objOneEvent->getSystemid(), "", $objOneEvent->getStrTitle()));
                     $objMapper->addPlaceholder("registerLink", $objMapper->writeToTemplate("/module_eventmanager/" . $this->arrElementData["char1"], "event_details_registerlink"));
                 }
                 $strEvents .= $objMapper->writeToTemplate("/module_eventmanager/" . $this->arrElementData["char1"], "event_list_entry");
             }
         }
         $strRssUrl = _xmlpath_ . "?module=eventmanager&action=eventRssFeed&page=" . $this->getPagename();
         $arrListTemplate = array("events" => $strEvents, "rssurl" => $strRssUrl, "formaction" => class_link::getLinkPortalHref($this->getPagename()), "event_filter_status" => $intFilterStatus != null ? $intFilterStatus : "", "event_filter_date_from" => $objFilterStartDate != null ? htmlspecialchars($this->getParam("event_filter_date_from"), ENT_QUOTES, "UTF-8", false) : "", "event_filter_date_to" => $objFilterEndDate != null ? htmlspecialchars($this->getParam("event_filter_date_to"), ENT_QUOTES, "UTF-8", false) : "");
         $strWrapperID = $this->objTemplate->readTemplate("/module_eventmanager/" . $this->arrElementData["char1"], "event_list");
         $strReturn .= $this->objTemplate->fillTemplate($arrListTemplate, $strWrapperID);
     }
     return $strReturn;
 }
Ejemplo n.º 4
0
echo "| DATECONVERTER                                                                 |\n";
echo "|                                                                               |\n";
echo "+-------------------------------------------------------------------------------+\n";
echo "<form method=\"post\">";
echo "--- UNIX timestamp handling -----------------------------------------------------\n\n";
echo "integer to date: \n";
echo "\tinteger: <input type=\"text\" value=\"" . getPost("inttime") . "\" name=\"inttime\"/>";
echo "  --> " . timeToString(getPost("inttime")) . "\n";
echo "date to integer: \n";
echo "\tdate: d:<input type=\"text\" value=\"" . getPost("strday") . "\" name=\"strday\" size=\"2\" />";
echo " m:<input type=\"text\" value=\"" . getPost("strmonth") . "\" name=\"strmonth\" size=\"2\" />";
echo " y:<input type=\"text\" value=\"" . getPost("stryear") . "\" name=\"stryear\" size=\"4\" />";
echo "  --> " . strtotime(getPost("stryear") . "-" . getPost("strmonth") . "-" . getPost("strday")) . "\n";
echo "\n<input type=\"submit\" value=\"submit\" />\n";
echo "\n--- Kajona timestamp handling ---------------------------------------------------\n\n";
echo "integer to date: \n";
$objDateFromInt = new class_date();
$objDateFromInt->setTimeInOldStyle(getPost("kajonainttime"));
echo "\tinteger: <input type=\"text\" value=\"" . getPost("kajonainttime") . "\" name=\"kajonainttime\"/>";
echo "  --> " . $objDateFromInt . "\n";
$objDateFromInt = new class_date(getPost("kajonainttime"));
echo "\tinteger: <input type=\"text\" value=\"" . getPost("kajonainttime") . "\" name=\"kajonainttime\"/>";
echo "  --> " . $objDateFromInt . "\n";
echo "\n<input type=\"submit\" value=\"submit\" />\n";
echo "<input type='hidden' name='debugfile' value='" . basename(__FILE__) . "'>";
echo "</form>";
echo "\ncurrent time: " . class_date::getCurrentTimestamp() . "\n";
echo "\n\n";
echo "+-------------------------------------------------------------------------------+\n";
echo "| (c) www.kajona.de                                                             |\n";
echo "+-------------------------------------------------------------------------------+\n";