Beispiel #1
0
 /**
  * return requested context object
  * @param string $name context name
  * @return object context object
  */
 public static function get($name = 'default')
 {
     if (!self::$contexts) {
         self::$contexts = array();
     }
     if (!isset(self::$contexts[$name])) {
         self::$contexts[$name] = new stdClass();
     }
     return self::$contexts[$name];
 }
Beispiel #2
0
 function updateTime()
 {
     $team = $_POST['teamname'];
     $args = $_REQUEST;
     $this->menu = 'backup';
     $this->view = 'calendar/addedittime';
     $obj_assignee = new calendarConfig();
     if ($args[btnSubmit]) {
         $this->invalid_crumb = 0;
         if (getenv(".bycrumb") != $_REQUEST['crumb']) {
             $this->invalid_crumb = 1;
         }
         if (!$this->invalid_crumb) {
             $dbh = Connection::cal_rw();
             try {
                 $res = $obj_assignee->updateTimeConfig($args, $dbh);
             } catch (Exception $e) {
                 $messages = OpsContext::get('messages');
                 $messages->errors[] = $e->getMessage();
                 return forward_to('this', 'configTime');
             }
             if ($res) {
                 echo "<script language='javascript'>parent.window.location=parent.window.location</script>";
             } else {
                 return forward_to('this', 'configTime');
             }
         } else {
             error("INVALID Crumb");
             return forward_to('this', 'configTime');
         }
     } else {
         return forward_to('this', 'configTime');
     }
 }