diff --git a/framework/helper.class.php b/framework/helper.class.php index a6f142d08e..165ba1bab1 100644 --- a/framework/helper.class.php +++ b/framework/helper.class.php @@ -124,3 +124,20 @@ function isonlybody() { return helper::inOnlyBodyMode(); } + +/** + * Format time. + * + * @param int $time + * @param string $format + * @access public + * @return void + */ +function formatTime($time, $format = '') +{ + $time = str_replace('0000-00-00', '', $time); + $time = str_replace('00:00:00', '', $time); + if(trim($time) == '') return ; + if($format) return date($format, strtotime($time)); + return trim($time); +} diff --git a/module/action/model.php b/module/action/model.php index ea946197c3..0c36c2e19f 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -703,7 +703,13 @@ class actionModel extends model $objectType = strtolower($action->objectType); $action->date = date(DT_MONTHTIME2, strtotime($action->date)); $action->actionLabel = isset($this->lang->action->label->$actionType) ? $this->lang->action->label->$actionType : $action->action; - $action->objectLabel = isset($this->lang->action->label->$objectType) ? $this->lang->action->label->$objectType : $objectType; + $action->objectLabel = $objectType; + if(isset($this->lang->action->label->$objectType)) + { + $objectLabel = $this->lang->action->label->$objectType; + if(!is_array($objectLabel)) $action->objectLabel = $objectLabel; + if(is_array($objectLabel) and isset($objectLabel[$actionType])) $action->objectLabel = $objectLabel[$actionType]; + } /* If action type is login or logout, needn't link. */ if($actionType == 'svncommited') @@ -715,8 +721,12 @@ class actionModel extends model if(strpos($action->objectLabel, '|') !== false) { list($objectLabel, $moduleName, $methodName, $vars) = explode('|', $action->objectLabel); - $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->objectID)); - if($action->objectType == 'user') $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->actor)); + $action->objectLink = ''; + if(common::hasPriv($moduleName, $methodName)) + { + $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->objectID)); + if($action->objectType == 'user') $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->actor)); + } $action->objectLabel = $objectLabel; } else diff --git a/module/common/lang/en.php b/module/common/lang/en.php index db3dcc5321..7bfe9b4d5e 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -478,7 +478,7 @@ $lang->datepicker->dpText->TEXT_CLOSE = 'Close'; $lang->datepicker->dpText->TEXT_DATE = 'Choose Time'; $lang->datepicker->dpText->TEXT_CHOOSE_DATE = 'Choose Date'; -$lang->datepicker->dayNames = array('Sun', 'Mon', 'Tues', 'Wed', 'Thur', 'Fri', 'Sat'); +$lang->datepicker->dayNames = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'); $lang->datepicker->abbrDayNames = array('Sun', 'Mon', 'Tues', 'Wed', 'Thur', 'Fri', 'Sat'); $lang->datepicker->monthNames = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index e42dadacef..820f8dfda2 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -478,7 +478,7 @@ $lang->datepicker->dpText->TEXT_CLOSE = '关闭'; $lang->datepicker->dpText->TEXT_DATE = '选择时间段'; $lang->datepicker->dpText->TEXT_CHOOSE_DATE = '选择日期'; -$lang->datepicker->dayNames = array('日', '一', '二', '三', '四', '五', '六'); +$lang->datepicker->dayNames = array('星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'); $lang->datepicker->abbrDayNames = array('日', '一', '二', '三', '四', '五', '六'); $lang->datepicker->monthNames = array('一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月');