summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 889d176)
raw | patch | inline | side by side (parent: 889d176)
author | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 3 Feb 2010 13:27:21 +0000 (13:27 +0000) | ||
committer | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 3 Feb 2010 13:27:21 +0000 (13:27 +0000) |
Allow human-readable timestamps when adding events via
CSV files.
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@15577 594d385d-05f5-0310-b6e9-bd551577e9d8
CSV files.
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@15577 594d385d-05f5-0310-b6e9-bd551577e9d8
trunk/gosa-core/include/utils/class_tests.inc | patch | blob | history | |
trunk/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc | patch | blob | history |
diff --git a/trunk/gosa-core/include/utils/class_tests.inc b/trunk/gosa-core/include/utils/class_tests.inc
index 2f1d0b05cada8039c64bc22a1d0ae05e6484c2a1..a34eac4ca8eb0a04547031e4dd4ce2d4cdaa078d 100644 (file)
return ($ad >= $from && $ad <= $to);
}
+
+ /* Check if given timestamp is in gosa-si time-format */
+ public static function is_gosa_si_time($time){
+ return preg_match ("/^20\d\d[0-1]\d[0-3]\d[0-2]\d[0-5]\d[0-5]\d$/i", $time);
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/trunk/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc b/trunk/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc
index b163d1b0552aff03fe479d7fa38caf4b1677b736..c06fa68ccb7208f9ce16913a1d56741db6d0b11d 100644 (file)
$ret[$attr] = $this->$attr;
}
- $ret['timestamp'] = $this->_timestamp_to_event($this->timestamp);
-
+ # Check if timestamp is in gosa-si-time-format
+ if(!tests::is_gosa_si_time($ret['timestamp'])){
+ $ret['timestamp'] = $this->_timestamp_to_event($this->timestamp);
+ }
return($ret);
}