@@ -75,6 +75,7 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | + * @param string $code |
|
| 78 | 79 | */ |
| 79 | 80 | public function setActionCode($code) { |
| 80 | 81 | $this->actionCode = $code; |
@@ -89,6 +90,7 @@ discard block |
||
| 89 | 90 | |
| 90 | 91 | /** |
| 91 | 92 | * @param int |
| 93 | + * @param string $seconds |
|
| 92 | 94 | */ |
| 93 | 95 | public function setEstimatedTime($seconds) { |
| 94 | 96 | $this->estimatedTime = $seconds; |
@@ -961,7 +961,7 @@ |
||
| 961 | 961 | * @param array $data |
| 962 | 962 | * @param Form $form |
| 963 | 963 | * |
| 964 | - * @return bool|HTMLText|SS_HTTPResponse |
|
| 964 | + * @return SS_HTTPResponse|null |
|
| 965 | 965 | */ |
| 966 | 966 | public function doCreateEnvironment($data, Form $form) { |
| 967 | 967 | $this->setCurrentActionType(self::ACTION_ENVIRONMENTS); |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | * |
| 47 | 47 | * @param \SS_HTTPRequest $request |
| 48 | 48 | * |
| 49 | - * @return \HTMLText|\SS_HTTPResponse |
|
| 49 | + * @return SS_HTTPResponse|null |
|
| 50 | 50 | */ |
| 51 | 51 | public function index(\SS_HTTPRequest $request) { |
| 52 | 52 | return $this->redirect(\Controller::join_links($this->Link(), 'history'), 302); |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | * |
| 48 | 48 | * @param \SS_HTTPRequest $request |
| 49 | 49 | * |
| 50 | - * @return \HTMLText|\SS_HTTPResponse |
|
| 50 | + * @return SS_HTTPResponse|null |
|
| 51 | 51 | */ |
| 52 | 52 | public function index(\SS_HTTPRequest $request) { |
| 53 | 53 | return $this->redirect(\Controller::join_links($this->Link(), 'show'), 302); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | /** |
| 73 | 73 | * @param SS_HTTPRequest $request |
| 74 | 74 | * |
| 75 | - * @return string |
|
| 75 | + * @return SS_HTTPResponse |
|
| 76 | 76 | */ |
| 77 | 77 | public function show(\SS_HTTPRequest $request) { |
| 78 | 78 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | /** |
| 169 | - * @param $project |
|
| 169 | + * @param DNProject $project |
|
| 170 | 170 | * |
| 171 | 171 | * @return array |
| 172 | 172 | */ |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | /** |
| 185 | - * @param $project |
|
| 185 | + * @param DNProject $project |
|
| 186 | 186 | * |
| 187 | 187 | * @return array |
| 188 | 188 | */ |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | /** |
| 201 | - * @param $project |
|
| 201 | + * @param DNProject $project |
|
| 202 | 202 | * |
| 203 | 203 | * @return array |
| 204 | 204 | */ |
@@ -578,7 +578,7 @@ |
||
| 578 | 578 | * Dear people of the future: If you are looking to optimize this, simply create a CurrentBuildSHA(), which can be |
| 579 | 579 | * a lot faster. I presume you came here because of the Project display template, which only needs a SHA. |
| 580 | 580 | * |
| 581 | - * @return false|DNDeployment |
|
| 581 | + * @return DNDeployment |
|
| 582 | 582 | */ |
| 583 | 583 | public function CurrentBuild() { |
| 584 | 584 | // The DeployHistory function is far too slow to use for this |
@@ -82,6 +82,9 @@ |
||
| 82 | 82 | 'Deployer.Name' => 'Deployer' |
| 83 | 83 | ); |
| 84 | 84 | |
| 85 | + /** |
|
| 86 | + * @param false|string $token |
|
| 87 | + */ |
|
| 85 | 88 | public function setResqueToken($token) { |
| 86 | 89 | $this->ResqueToken = $token; |
| 87 | 90 | } |
@@ -6,20 +6,20 @@ |
||
| 6 | 6 | */ |
| 7 | 7 | class SS_Datetimezone extends SS_Datetime |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Returns the date in the raw SQL-format specific to a given timezone passed from the Member class, e.g. “2006-01-18 16:32:04” |
|
| 11 | - */ |
|
| 12 | - public function Nice() { |
|
| 13 | - if($timestamp = $this){ |
|
| 14 | - //instantiate new DateTime object based off received timestamp in the default timezone |
|
| 15 | - $timestamp = new DateTime($timestamp, new DateTimeZone(date_default_timezone_get())); |
|
| 16 | - //if a user is logged in, has set a timezone that is in the allowed list and |
|
| 17 | - //that timezone is NOT the default one then convert the timestamp to use the selected timezone |
|
| 18 | - if(Member::currentUserID() && isset(Member::CurrentUser()->Timezone) && in_array(Member::CurrentUser()->Timezone, timezone_identifiers_list()) && Member::CurrentUser()->Timezone != date_default_timezone_get()){ |
|
| 19 | - $timestamp->setTimezone(new DateTimeZone(Member::CurrentUser()->Timezone)); |
|
| 20 | - } |
|
| 21 | - } |
|
| 22 | - //return timestamp in "Nice" format + the user's timezone |
|
| 23 | - return $timestamp->Format('d/m/Y g:ia'); |
|
| 24 | - } |
|
| 9 | + /** |
|
| 10 | + * Returns the date in the raw SQL-format specific to a given timezone passed from the Member class, e.g. “2006-01-18 16:32:04” |
|
| 11 | + */ |
|
| 12 | + public function Nice() { |
|
| 13 | + if($timestamp = $this){ |
|
| 14 | + //instantiate new DateTime object based off received timestamp in the default timezone |
|
| 15 | + $timestamp = new DateTime($timestamp, new DateTimeZone(date_default_timezone_get())); |
|
| 16 | + //if a user is logged in, has set a timezone that is in the allowed list and |
|
| 17 | + //that timezone is NOT the default one then convert the timestamp to use the selected timezone |
|
| 18 | + if(Member::currentUserID() && isset(Member::CurrentUser()->Timezone) && in_array(Member::CurrentUser()->Timezone, timezone_identifiers_list()) && Member::CurrentUser()->Timezone != date_default_timezone_get()){ |
|
| 19 | + $timestamp->setTimezone(new DateTimeZone(Member::CurrentUser()->Timezone)); |
|
| 20 | + } |
|
| 21 | + } |
|
| 22 | + //return timestamp in "Nice" format + the user's timezone |
|
| 23 | + return $timestamp->Format('d/m/Y g:ia'); |
|
| 24 | + } |
|
| 25 | 25 | } |
| 26 | 26 | \ No newline at end of file |
@@ -6,24 +6,24 @@ |
||
| 6 | 6 | */ |
| 7 | 7 | class TimezoneMemberExtension extends DataExtension |
| 8 | 8 | { |
| 9 | - private static $db = [ |
|
| 10 | - 'Timezone' => 'Varchar(255)', |
|
| 11 | - ]; |
|
| 9 | + private static $db = [ |
|
| 10 | + 'Timezone' => 'Varchar(255)', |
|
| 11 | + ]; |
|
| 12 | 12 | |
| 13 | - public function getTimezones() { |
|
| 14 | - $timezones = timezone_identifiers_list(); |
|
| 15 | - return array_combine($timezones, $timezones); |
|
| 16 | - } |
|
| 13 | + public function getTimezones() { |
|
| 14 | + $timezones = timezone_identifiers_list(); |
|
| 15 | + return array_combine($timezones, $timezones); |
|
| 16 | + } |
|
| 17 | 17 | |
| 18 | - public function updateCMSFields(FieldList $fields) |
|
| 19 | - { |
|
| 20 | - $fields->removeFieldFromTab('Root', 'Timezone'); |
|
| 21 | - $field = DropdownField::create( |
|
| 22 | - 'Timezone', |
|
| 23 | - 'Timezone', |
|
| 24 | - $this->getTimezones())->setEmptyString('For NZ, choose Pacific/Auckland'); |
|
| 25 | - $fields->addFieldToTab('Root.timezone', $field); |
|
| 26 | - return $fields; |
|
| 27 | - } |
|
| 18 | + public function updateCMSFields(FieldList $fields) |
|
| 19 | + { |
|
| 20 | + $fields->removeFieldFromTab('Root', 'Timezone'); |
|
| 21 | + $field = DropdownField::create( |
|
| 22 | + 'Timezone', |
|
| 23 | + 'Timezone', |
|
| 24 | + $this->getTimezones())->setEmptyString('For NZ, choose Pacific/Auckland'); |
|
| 25 | + $fields->addFieldToTab('Root.timezone', $field); |
|
| 26 | + return $fields; |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | 29 | } |